-
-
Notifications
You must be signed in to change notification settings - Fork 688
refuse to compare two ideals that we don't know how to compare #41040
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
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
c81110f
comparing ideals ≠ comparing their generators
yyyyx4 50efa21
I 𝑡ℎ𝑖𝑛𝑘 this piece of code really wanted to compare the ideal generators
yyyyx4 c291dcb
add test for #37409
yyyyx4 2c8bed3
catch AttributeError to fix doctest failure in schemes/generic/scheme.py
yyyyx4 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is only a partial order... right? cf. how are ZZ[x,y] currently compared?
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. As far as I can tell from a quick experiment, ideals of ℤ[x,y] are compared by set inclusion, while ideals of ℤ[x] are compared by generators. This patch renders the behaviour uniform in that regard. (It is possible that I missed some other rings that compare ideals in a non-mathematical way.)
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wait, seriously.
which means…
at least with the previous behavior, sorting is order-invariant.
actually…
there is a precedent. Maybe it's actually fine.
most Python containers are hash-based instead of order-based so they're unaffected by non-total-ordering. (doctest output checker may suffer however)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup. Even the comparison between standard Python
sets is only partial. Related comments: #37409 (comment), #35546 (comment).There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what is "comparison by generators" for PIDs? Shouldn't one rather check for the mathematically correct "gen1 in (gen2) and gen2 in (gen1)" ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As far as I can tell, all PIDs that I could immediately think of are doing it right, i.e., perform a mathematical comparison. In some PIDs (such as
ZZ,QQ['x']) the generators are normalized (non-negative resp. monic), hence simply comparing the generators would also work.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmm, gens of (f) for f in GF(q)[x] normalised too? is monic enough?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They appear to be monic over
GFs as well. (In a PID, the generator of any ideal is unique up to scaling by units, so monic is indeed enough to get a canonical generator for the ideal.)In any case, I'm not sure I understand what your questions are about: Are you worried that we're still not comparing ideals correctly after this patch? Or are you suggesting that it could be done in a simpler/faster/better way for PIDs?