-
-
Notifications
You must be signed in to change notification settings - Fork 510
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
incorrect test for equality of vectors over SR #33697
Labels
Milestone
Comments
Branch: public/33697 |
This comment has been minimized.
This comment has been minimized.
comment:2
Changed milestone to 9.6, but perhaps should be 9.7 because 9.6 is in release-candidate stage (and perhaps the priority should not be "critical"). New commits:
|
Commit: |
Reviewer: Travis Scrimshaw |
comment:3
LGTM. I also agree on both points. |
comment:4
Thanks! |
Changed branch from public/33697 to |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
As reported in this sage-devel thread, sage can report that two unequal vectors over the symbolic ring
SR
are equal:The problem comes from the fact that
if lx != rx:
is not the same asif not(lx == rx):
whenlx
andrx
are inSR
. More precisely, for a symbolic relation such asf(x) == g(x)
, the docstring ofsage.symbolic.expression.__bool__
saysbool
will returnTrue
if the relation is true for all possible values ofx
, and will returnFalse
otherwise. Therefore, it is often the case thatbool(f(x) == g(x))
andbool(f(x) != g(x))
are bothFalse
.The test for equality of vectors uses the comparison
if lx != rx:
on each component, but it should useif not(lx == rx):
. What happens in the example is that there is a value ofx
for whichx
is equal to1
. This means thatbool(x != 1)
isFalse
, so sagemath erroneously concludes thatv == w
should be true.Related ticket: #33698. This bug does not arise without
assume(x > 0)
, because inequality of symbolic relations does not follow the docstring's description when there are no assumptions.Component: symbolics
Author: Dave Morris
Branch/Commit:
d7d7bda
Reviewer: Travis Scrimshaw
Issue created by migration from https://trac.sagemath.org/ticket/33697
The text was updated successfully, but these errors were encountered: