Problem with IS and EQUAL in evaluating equality of expressions



On 5/13/06, Henry Lenzi <henry.lenzi at gmail.com> wrote:
>
> (%i28) is(equal(sin(a+b),sin(a)*cos(b)+cos(a)*sin(b)));
> Maxima was unable to evaluate the predicate:
> equal(sin(b + a), cos(a) sin(b) + sin(a) cos(b))


There are three issues here:
   1) why does equal not 'get' some equalities?
   2) why does it give an error despite the documentation?
   3) why does "=" behave differently?

As for (1), very simply: 'equal' is not very powerful.  It essentially
checks whether ratsimp(a-b)=0, and also looks at the "assume" database. It
does not perform trigonometric simplifications, etc.  In general, comparing
two expressions for equality is undecidable (Richardon, Davis, Wang), so
there has to be some 'out' when Maxima can not determine equality.

For (2), I think this is a documentation error.  I don't think 'equal' ever
returned a simplified form, e.g. equal(x,x+a) => equal(a,0).

For (3), comparison with "equal" is semantic comparison, whereas comparison
with "=" is syntactic comparison. Two things are "=" if and only if they
are of the same *form*, e.g. x=x => true, x^3=x^3 => true, but
(x^2-1)/(x-1)=x+1 => false, while equal(x^2-1)/(x-1),x+1) => true. Since
syntactic comparison is trivially computable, is/= never gives an error.

I realize all this is confusing, but it *is* intentional, and there are good
(though debatable) reasons for doing it this way.

          -s