-
Notifications
You must be signed in to change notification settings - Fork 297
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
feat(group_theory/perm/sign): Add equiv.perm.move
, to move an item in a permutation
#4739
base: master
Are you sure you want to change the base?
Conversation
…in a permutation Also provides a decomposition to convert any swap into a series of adjacent swaps
c2e20f2
to
1c13a10
Compare
/-- | ||
A permutation that swaps `i` with `i+1`. | ||
-/ | ||
def adj_swap [add_monoid α] [has_one α] (i : α) : perm α := equiv.swap i (i + 1) |
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.
Frustratingly I can't actually use this definition for fin ℕ
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.
/-- | |
A permutation that swaps `i` with `i+1`. | |
-/ | |
def adj_swap [add_monoid α] [has_one α] (i : α) : perm α := equiv.swap i (i + 1) | |
variables {ι : Type*} [decidable_eq ι] [has_zero ι] [has_one ι] [has_add ι] -- castable to ℕ | |
/-- | |
A permutation that swaps `i` with `i+1`. | |
-/ | |
def adj_swap (i : ι) : perm ι := equiv.swap i (i + 1) | |
/-- The set of adjacent swaps needed to perform a move -/ | |
def move_components (i j : ℕ) : list (perm ι) := | |
(((list.range' j (i - j) ++ (list.range' i (j - i)).reverse).map nat.cast).map adj_swap) |
What about that @eric-wieser?
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.
That's a good idea, thanks! I think I was shelving this PR until @Vierkantor wraps up or abandons their has_enum
typeclass, or whatever it was; but I'll try that approach when I revive it!
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.
(or, feel free to adopt this branch yourself)
I would prefer to see the right abstraction in place so that |
This PR/issue depends on: |
This was written in the hopes it would provide some building blocks for breaking up the proofs in #3770