On Tuesday, December 16, 2014 6:43:27 AM UTC-8, William wrote: ....
> >> > What do you suppose is going on at WRI, > > > > > > http://www.wolframalpha.com/input/?i=solve+sqrt%28x%29+%3D+x > > > > seems to be quite happy to tell us that the solutions are x=0 and x=1 . > > Just sayin', though that may be part of their 'natural language' stuff > that > > usually (though not always) gives me "Using closest Wolfram|Alpha > > interpretation" and something completely irrelevant. > > Mathematica itself also outputs 0 and 1 as the solutions. > Yes, I tried it again in a fresh Mathematica 10. I must have somehow broken the earlier version I had running. (Sorry, I tend to break Mathematica for fun.) > > > > > > >> > >> and with Maxima, each refusing to do > >> > this? > >> > >> sqrt(x) (or Sqrt[x] in Mathematica) denotes the principal square root > >> in every computer algebra system I can think of, even in Maxima: > >> > >> (%i1) sqrt(1); > >> (%o1) 1 > >> > >> Why should solve() work with a different definition of sqrt() than the > >> definition the system uses for evaluation? > >> > >> I propose naming this context-dependently non-principal sqrt function > >> of yours the "strawman square root". > >> > > > > Well, the problem is whether sqrt is a function or a symbolic > expression, > > sqrt is a function > > sqrt(x) is a symbolic expression. > > We should define what the solve function is supposed to do for this > discussion. > > - Sage's documentation for solve is: "Algebraically solve an > equation or system of equations (over the > complex numbers) for given variables. Inequalities and systems of > inequalities are also supported. [...]" > > - The Maxima documentation for solve is: "Solves the algebraic > equation <expr> for the variable <x> and returns a list of solution > equations in <x>. [...]" > > - The Mathematica documentation says: "attempts to solve the system > expr of equations or inequalities for the variables vars." > > All of those definitions are circular, hence unenlightening for this > conversation. Here's the definition in Wikipedia of a solution to an > equation: "A solution of the equation is an assignment of expressions > to the unknowns that satisfies the equation; in other words, > expressions such that, when they are substituted for the unknowns, the > equation becomes an identity." That's hard to argue with. > > I would define the solve function in Sage to do the following: > > "Given a symbolic expression expr, the solve function returns a finite > list of expressions e_1, ..., e_n, such that any solution to any e_i > is a solution to expr. There is no guarantee that the union of the > solutions to the e_i is the set of solutions to expr. A *solution* X > of a symbolic expression f is a choice of specific numbers X so that > if we replace the variables in f by those numbers to obtain f(X) then > bool(f(X)) is true." > > In particular, we should delete "algebraically", since, e.g., > > solve(sin(x)==0, x) and solve(2^x == 5, x) > I think the term algebra is not quite the technical one you refer to. A Computer Algebra System does not just do Algebra. The tree-like internal form used by symbolic math systems (as well as compilers) is referred to sometimes as an algebraic expression tree. So the relationship with "modern algebra" is not so rigorous. > > works as above, and there's nothing particularly "algebraic" about > that. Also, we should reserve the right to add new code to Sage to > solve all kinds of weird non-algebraic equations. > > The following code outputs True twice, so with the above definition, 0 > and 1 would be valid output for the solve function in Sage: > > f = sqrt(x) == x > bool(f(x=1)) > bool(f(x=0)) > > Anyway, we obviously should be improving our solve function to do much > more than just "call mathematica". if Sage calls Maxima, why not improve Maxima? One of the issues that I recall is that it was unworkable to run solve in two phases: phase one would produce as many solutions as possible by various dubious methods (prominent one: square both sides...) and then have phase two check solutions, returning only the subset that passes inspection. Unfortunately the simplification of expressions that come out of the first phase (think: cubic, quartic formulas) stuck into the original expression may not simplify with current programs. But if you can do a better job simplifying, you could consider that. Apparently WRI offers such a check. RJF > I vaguely remember back in maybe > 2007 when Sage was getting a lot of publicity on slashdot, that Martin > Albrecht (?) and I improved solve to do something with systems of > equations mod p. I imagined back then that people would do all kinds > of things over time to expand the range of solve. However, that > several people in this thread were confused or disagree about what > "solve" even means, suggests a useful first step in that direction is > to rigorously define what solve is supposed to do. After that is > done, I think it would very cool if someone wrote something that at > least expanded solve to handle expressions like sqrt(x)==x... > > -- William > > > -- > William Stein > Professor of Mathematics > University of Washington > http://wstein.org > -- 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/d/optout.