sagemath / sage

Main repository of SageMath. Now open for Issues and Pull Requests.
https://www.sagemath.org
Other
1.08k stars 394 forks source link

Sage/Maxima produces an incorrect result for an inequality when certain assumptions are applied #37874

Open jsimonrichard opened 2 weeks ago

jsimonrichard commented 2 weeks ago

Steps To Reproduce

In a new sage environment (REPL, notebook, etc.) run the following commands.

s, t, l = var("s, t, l")
assume(s > 0)
assume(t > s)
assume(l > 1)

print(bool(l*(t-s) > 0))
print(bool(l*t - l*s == 0))

Expected Behavior

Output:

True
False

Actual Behavior

Output:

True
True

Which is, of course, a direct contradiction.

Additional Information

If we use assume(l > 0) instead of assume(l > 1), we get the expected result.

Environment

- **OS**: Kubuntu 22.04.3 LTS x86_64
- **Sage Version**: 9.5

Checklist