On Tuesday, July 2, 2013 4:48:54 AM UTC-7, Eric Gourgoulhon wrote: > > > > Le mardi 2 juillet 2013 02:38:44 UTC+2, rjf a écrit : >> >> >> >> What you've written is just a hack. >> > > Of course it's a hack; this is why I did not submit it as a patch for Sage. > As far as one restricts oneself to the REAL DOMAIN, I think it works. > Please show me a counter-example. > > Again, let me insist: > it is elementary mathematics that > sqrt: R+ --> R+, x |--> sqrt(x) > is a ONE-TO-ONE map, the reverse of which is > R+ --> R+, x |--> x^2 > I think everybody agrees that when working only with real variables, this > is the standard meaning of the sqrt function. > Then it must obey > sqrt(x^2) = abs(x) > and the above hack simply ensures this. This is why I called it > 'simplify_sqrt_real' to insist that it is valid only for REAL-valued > expressions of REAL variables. >
If you called the function in question "real positive branch of the square root of a positive number" rather than sqrt, maybe you might get agreement. Let's call that RPBSRPN. Your statement then translates to RPBSRPN(x^2) = abs(x) . But then if it ir R+-->R+, the abs() is unnecessary, and RPBSRPN(x^2) = x. Surely you don't believe that sqrt of positive numbers are always positive. (for the movie clip from Airplane -- Surely you can't be serious -- see http://www.ign.com/top/movie-moments/88 ) For example you can then derive the quadratic formula and show that a quadratic equation has only one root. (Or only has a single root if b^2-4ac > 0, your constraint. As I suggested, you are free to come up with some other function, perhaps absqrt() with your specified behavior, but I would expect it to be of limited use. -- 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 post to this group, send email to sage-devel@googlegroups.com. Visit this group at http://groups.google.com/group/sage-devel. For more options, visit https://groups.google.com/groups/opt_out.