On 2020-08-05 15:49, NicoJG wrote: > @rjf Isn't the square root defined to be positive? > Sure: x^2=y <=> x=+/-sqrt(y) > But I think you would never consider f(x):=sqrt(x) to have the codomain > of all negative numbers. > At least I would expect a CAS to interpret a square root to be positive. >
If you think of sqrt() as a function on the real numbers, then sure. The problem with this (and many other functions) is that we really have no idea what the domain and codomain are. The documentation is silent on the matter. This comes up especially often in the context of sqrt() because we all learned square roots in elementary school and therefore arrive with some (soon to be violated) expectation of how they work. To do things right, you really need to know the (co)domain of a function before you do anything else with it. Of course, we don't want high school students to have to learn modules and algebras before they can create 2x^2 + y^3, so we wind up faking it with things like the symbolic ring, on which sqrt() acts... somehow. How exactly it should act no one can say for sure, and that's ultimately what leads to this problem. -- You received this message because you are subscribed to the Google Groups "sage-devel" group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-devel+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/sage-devel/43324f03-a6de-ad0d-11c7-35f59c65ff6c%40orlitzky.com.