Bug 2546: Solve with duplicate equations



On 2/16/13 10:35 AM, Rupert Swarbrick wrote:
> Richard Fateman <fateman at eecs.berkeley.edu> writes:
>>>> So, in my opinion, this isn't really a bug. The weird behaviour is that
>>>> SSOLVE returns a sort of partial result when it gets stuck and SOLVEX
>>>> returns an empty list. Weirdness like this is why I don't call solve()
>>>> in scripts and instead rely on eg. algsys() where at least I know what
>>>> I'll get if it fails.
>>> Hmm. I think SSOLVE should return an empty list if it can't find a
>>> solution.
>> I think we need to distinguish these cases:
>> 1. Solve decides that there are no solutions.
>> 2. Solve cannot find a solution.
>>
>> I think these are currently distinguished in the case of the
>> single-equation solve by returning, respectively, an empty list and an
>> "unsolved" equation or equations, i.e. not of the form x= ... .
> This is true; for a multiple-equation solve, there is no distinction
> currently made between the two.
>
Then the problem is with the multiple-equation solve.
In fact we do not check that the solutions are valid -- solve may
return superfluous ones.  It is, in general, not possible to prove
all solutions by back substitutions. I think Mathematica has as
an option to try to prove validity by substitution.

Anyway, the number of solutions or whether there are any is
kind of wide open, given the generality of expressions in Maxima.

e.g.  solve (x^n=1,x)  has n solutions of x=1 but solve says one.

to_poly_solve(x^n=1,x)   gives a %union expression...

Although neither solve notices ...
  if n=0  when the solution is  x#0
....

Mathematica's Solve is not much different .. it says x=1 but mentions
that solutions may be lost.  Mathematica's Reduce,  a program that
would be nice to examine and emulate in Maxima, does much more.
It answers (in effect)   n=0  OR  Realpart(n)#0 and x=1  OR  {a whole 
bunch of
what looks like garbage}

Anyway, I think its certainly possible to improve solve and to_poly_solve,
perhaps by combining them,  but there are still extensions possible. Or
perhaps alternative/additional programs like Reduce.

RJF