From: Eduardo O. <edu...@gm...> - 2023-10-29 05:08:53
|
Hi all, thanks a lot - radcan is exactly what I needed! =) In my case neither is(a=b) nor is(equal(a,b)) would work. Look: o1 : a^k*b^k = (a*b)^k; /* a^k*b^k = (a*b)^k */ o2 : radcan(o1); /* a^k*b^k = a^k*b^k */ is(o1); /* false */ is(lhs(o1) = rhs(o1)); /* false */ is(equal(lhs(o1), rhs(o1))); /* unknown */ is(radcan(o1)); /* true */ is(o2); /* true */ Cheers =), Eduardo Ochs On Sat, 28 Oct 2023 at 22:13, Robert Dodier <rob...@gm...> wrote: > On Sat, Oct 28, 2023 at 12:36 PM Eduardo Ochs <edu...@gm...> > wrote: > > > o1 : a^k*b^k = (a*b)^k; > > o2 : a^k*b^k + a^k*c^k = a^k*(b^k+c^k); > > is(o1); /* false */ > > is(o2); /* false */ > > is(ratsimp(o1)); /* false */ > > is(ratsimp(o2)); /* true */ > > is(ratexpand(o1)); /* false */ > > is(ratexpand(o2)); /* true */ > > Bear in mind that is(foo = bar) only looks at whether foo and bar are > just copies of the same thing; that is, whether foo and bar are > identical, and not whether foo and bar are equivalent. On the other > hand, is(equal(foo, bar)) looks at whether foo and bar are equivalent, > specifically in the sense that ratsimp(foo - bar) is 0. > > E.g. is(x*(x + 1) = x^2 + x) yields false, while is(equal(x*(x + 1), > x^2 + x)) yields true. > > For what it's worth, > > Robert > |