On Thu, 2021-07-22 at 10:08 -0700, Marcus A. wrote:
> Hi all,
>
> I think I found a bug when substituting "-a == 0" into "a". The result is
> not "0" but "a". This also happens when I assume that "a" is real. (see
> below)
>
> sage: var('a')
> a
> sage: a.substitute(a == 0)
> 0
> sage: a.substitute(-a == 0) # bug?
> a
>
This is trying to replace the "-a" in the expression "a" with "0".
Since there is no "-a" in "a", nothing happens.
The expression/substitution stuff is not very smart and doesn't realize
that it could just multiply both sides by -1 and then proceed as
before.