Skip to content
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

expand difference of relations before evaluation to a boolean #20105

Open
behackl opened this issue Feb 24, 2016 · 14 comments
Open

expand difference of relations before evaluation to a boolean #20105

behackl opened this issue Feb 24, 2016 · 14 comments

Comments

@behackl
Copy link
Member

behackl commented Feb 24, 2016

As described in this discussion, we currently have

sage: bool(x^2 - 1 - (x+1)*(x-1) != 0)
True

Duplicate of #19040.

CC: @cheuberg @rwst

Component: symbolics

Keywords: pynac

Issue created by migration from https://trac.sagemath.org/ticket/20105

@behackl behackl added this to the sage-7.1 milestone Feb 24, 2016
@rwst
Copy link
Contributor

rwst commented Feb 24, 2016

comment:1

Note that the change in Pynac simply leads to Maxima being called in Expression.__nonzero__ (waiting time on first invocation). The issue will be resolved in general with #19040 because we expand in __nonzero__ then. But at the moment it's a bug and it's resolved by your Pynac patch.

@cheuberg
Copy link
Contributor

comment:2

As posted on sage-devel:

$ cat test.sage
a = -1/(x+1) + 1/x
b = 1/(x*(x+1))
print bool(a == b), bool(a != b)
$ sage-6.9 test.sage
True False
$ sage-6.10 test.sage
True True
$ sage-7.0 test.sage
True True

@rwst
Copy link
Contributor

rwst commented Feb 24, 2016

comment:3

Actually, the change in Pynac does not resolve this (a!=b) so it's unclear what causes it.

@behackl
Copy link
Member Author

behackl commented Feb 24, 2016

comment:4

I see. Expansion of the difference does not detect the partial fraction stuff going on there. In that case its probably better to wait for #19040 instead of submitting a fix in pynac.

I think that the more interesting question is whether the partial fraction stuff is also resolved with the ticket.

The pynac pull request and this ticket are then duplicates/wontfixes.

@rwst
Copy link
Contributor

rwst commented Feb 24, 2016

comment:5

(deleted)

@behackl

This comment has been minimized.

@behackl
Copy link
Member Author

behackl commented Feb 24, 2016

comment:6

My mistake. The wording in the ticket is actually wrong, somewhen today I must have switched to testing the wrong thing... >.<

@rwst
Copy link
Contributor

rwst commented Feb 24, 2016

comment:7

Ok confirmed.

sage: bool(x^2 - 1 - (x+1)*(x-1) != 0)
True

@rwst

This comment has been minimized.

@behackl

This comment has been minimized.

@behackl
Copy link
Member Author

behackl commented Feb 24, 2016

Changed dependencies from pynac-0.6.3 to none

@rwst
Copy link
Contributor

rwst commented Feb 25, 2016

comment:9

With the new #19040 you will get:

sage: bool(x^2 - 1 - (x+1)*(x-1) != 0)
False
sage: (x^2 - 1 - (x+1)*(x-1) != 0).holds()
False

The first because we expand in __nonzero__, the second because Maxima is called. So, I think this ticket will turn out as duplicate of #19040.

@behackl
Copy link
Member Author

behackl commented Feb 25, 2016

comment:10

Replying to @rwst:

With the new #19040 you will get:

sage: bool(x^2 - 1 - (x+1)*(x-1) != 0)
False
sage: (x^2 - 1 - (x+1)*(x-1) != 0).holds()
False

The first because we expand in __nonzero__, the second because Maxima is called. So, I think this ticket will turn out as duplicate of #19040.

Excellent! Thanks for checking. :-)

@behackl

This comment has been minimized.

@behackl behackl removed this from the sage-7.1 milestone Feb 25, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants