Loading [MathJax]/jax/output/HTML-CSS/jax.js

First time here? Check out the FAQ!

Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Assumptions giving wrong boolean answer for simple expression

Let a,bZ with a<0, then we can plainly see that ab2=0b=0 since Z is an integral domain.

sage: var("a b")
(a, b)
sage: assumptions()
[]
sage: assume(a, "integer")
sage: assume(b, "integer")
sage: assume(b^2 == 0)
sage: bool(b == 0)
True

But as soon as I introduce another non-zero variable in the expression, it cannot detect b is 0.

sage: var("a b")
(a, b)
sage: assumptions()
[]
sage: assume(a, "integer")
sage: assume(b, "integer")
sage: assume(a < 0)
sage: a != 0
a != 0
sage: bool(a != 0)
True
sage: assume(a*b^2 == 0)
sage: bool(b == 0)
False