Assumptions giving wrong boolean answer for simple expression

asked 2 years ago

narodnik gravatar image

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
Preview: (hide)

Comments

bool(b != 0) also evaluates to False. Perhaps, Sage cannot do much deductions from the given assumptions. If you deal with polynomial (in)equalities, you'd better employ specialized machinery such as QEPCAD.

Max Alekseyev gravatar imageMax Alekseyev ( 2 years ago )