[Merged by Bors] - refactor(algebra/gcd_monoid): don't require normalization#9443
[Merged by Bors] - refactor(algebra/gcd_monoid): don't require normalization#9443Ruben-VandeVelde wants to merge 27 commits intomasterfrom
Conversation
This will allow us to set up a gcd_monoid instance for all euclidean_domains and generalize the results in ring_theory/euclidean_domain.lean to PIDs.
src/algebra/gcd_monoid/basic.lean
Outdated
| @@ -208,44 +211,53 @@ end associates | |||
| supremum, `1` is bottom, and `0` is top. The type class focuses on `gcd` and we derive the | |||
There was a problem hiding this comment.
Doesn't a bounded lattice require lcm and gcd be commutative and associative, which is no longer true of the weaker typeclass?
There was a problem hiding this comment.
That seems plausible - I can't find an actual Lean instance, though, so I'm not sure what this comment is referring to.
There was a problem hiding this comment.
Do the generalisations you care about not have associativity or commutativity either?
There was a problem hiding this comment.
No commutativity, in any case:
import algebra.euclidean_domain
#eval euclidean_domain.gcd (1 : int) (-1 : int)
-- 1
#eval euclidean_domain.gcd (-1 : int) (1 : int)
-- -1Co-authored-by: Johan Commelin <johan@commelin.net>
|
Please don't write I'll mark as WIP for now, for you to add the doc-strings, but otherwise this is looking good! |
awainverse
left a comment
There was a problem hiding this comment.
I left some small recommendations. This seems like a good idea overall.
In particular, this doesn't get rid of the existing functionality of the existing gcd_monoid, just renames it, so I'm happy.
I think it would also be nice to tie a gcd_monoid structure on M to a normalized_gcd_monoid structure on associates M, but that should probably wait for a later PR because this one is a lot of lines!
Yeah, I'm happy to do that after this. |
|
bors d+ |
|
✌️ Ruben-VandeVelde can now approve this pull request. To approve and merge a pull request, simply reply with |
|
bors merge Thanks! |
This will allow us to set up a gcd_monoid instance for all euclidean_domains and generalize the results in ring_theory/euclidean_domain.lean to PIDs.
|
Pull request successfully merged into master. Build succeeded: |
This will allow us to set up a gcd_monoid instance for all euclidean_domains and generalize the results in ring_theory/euclidean_domain.lean to PIDs.
This still needs some documentation and lint fixes, and I didn't pay much attention to names yet, but I'd like to hear if people think this is the right direction first.