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 by Bors] - feat(group_theory/perm/cycle_type): Cycle type of a permutation #6999
Conversation
Co-authored-by: tb65536 <tb65536@users.noreply.github.com>
Co-authored-by: tb65536 <tb65536@users.noreply.github.com>
🎉 Great news! Looks like all the dependencies have been resolved:
💡 To add or remove a dependency please update this issue/PR description. Brought to you by Dependent Issues (:robot: ). Happy coding! |
@@ -820,4 +821,27 @@ gcd_monoid_of_lcm | |||
(λ a b c ac ab, normalize_dvd_iff.2 ((classical.some_spec (h c b) a).1 ⟨ac, ab⟩)) | |||
(λ a b, normalize_idem _) | |||
|
|||
/-- `ℕ` is a `gcd_monoid` -/ | |||
instance : gcd_monoid ℕ := |
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.
@awainverse was this not already somewhere else? You know this part of the library best. Is this the correct place for the instance, or should it go somewhere in data/nat/*
?
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.
It's been a minute, but it looks like the only global instances of gcd_monoid
anywhere are polynomial.gcd_monoid
and int.gcd_monoid
. There is also unique_factorization_monoid.to_gcd_monoid
, which is not an instance because it would cause a loop. Perhaps it's better if this just goes in ring_theory/int/basic
next to int.gcd_monoid
? I told @tb65536 it could go in either place.
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.
It seems weird to me to put this in ring_theory/int/basic
when this doesn't use facts about the integers.
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.
(In case it's not clear, either place is actually still fine with me)
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.
I should mention that the gcd_monoid
instance is also in #7180
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.
I'm happy to close #7180 but I'm wondering whether it makes more sense to deduce the normalization_monoid
part from unique (units nat)
which already exists - althought in the very weird ring_theory/int/basic
. I think it would be better to move it to data/nat/basic
where one can also find this fact (not as an instance).
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 a very nice development. The statements look great. The proofs overall look pretty clean as well, I have some minor comments.
I haven't looked before at permutations in mathlib, but the library seems to work very nicely!
How far away are you to showing that two permutations are conjugates iff they have the same cycle type? That seems like a nice fact.
@fpvandoorn, I have progress towards that conjugacy result at #7024, and most of the rest at the branch |
bors d+ |
✌️ tb65536 can now approve this pull request. To approve and merge a pull request, simply reply with |
bors r+ |
Generally please wait to |
Ah, thanks for mentioning this. |
You can view the https://github.com/leanprover-community/mathlib/tree/pechersky/list-rotate-cycle branch I have, which merged in some commits from your There is also a I haven't proved things about conjugacy, but I think with my refactor of One more note -- the support refactor is at #7118, generalizing |
This PR defines the cycle type of a permutation. At some point we should prove the bijection between partitions and conjugacy classes. Co-authored-by: Aaron Anderson <65780815+awainverse@users.noreply.github.com> Co-authored-by: Thomas Browning <tb65536@uw.edu>
Pull request successfully merged into master. Build succeeded: |
This PR defines the cycle type of a permutation.
At some point we should prove the bijection between partitions and conjugacy classes.