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

feat(group_theory/perm/sign): Add equiv.perm.move, to move an item in a permutation #4739

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

eric-wieser
Copy link
Member

@eric-wieser eric-wieser commented Oct 22, 2020


This was written in the hopes it would provide some building blocks for breaking up the proofs in #3770

@eric-wieser eric-wieser added the blocked-by-other-PR This PR depends on another PR which is still in the queue. A bot manages this label via PR comment. label Oct 22, 2020
…in a permutation

Also provides a decomposition to convert any swap into a series of adjacent swaps
Comment on lines +790 to +793
/--
A permutation that swaps `i` with `i+1`.
-/
def adj_swap [add_monoid α] [has_one α] (i : α) : perm α := equiv.swap i (i + 1)
Copy link
Member Author

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 ℕ

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
/--
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?

Copy link
Member Author

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!

Copy link
Member Author

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)

@eric-wieser eric-wieser added the WIP Work in progress label Oct 23, 2020
@github-actions github-actions bot added the merge-conflict Please `git merge origin/master` then a bot will remove this label. label Oct 23, 2020
@bryangingechen bryangingechen removed the blocked-by-other-PR This PR depends on another PR which is still in the queue. A bot manages this label via PR comment. label Oct 31, 2020
@github-actions github-actions bot removed the merge-conflict Please `git merge origin/master` then a bot will remove this label. label Dec 16, 2020
@jcommelin
Copy link
Member

I would prefer to see the right abstraction in place so that move is not only about nat, but also works for fin n and int, as suggested elsewhere.

@github-actions github-actions bot added the merge-conflict Please `git merge origin/master` then a bot will remove this label. label Jan 16, 2021
@YaelDillies YaelDillies self-assigned this Oct 19, 2021
@github-actions
Copy link

This PR/issue depends on:

@YaelDillies YaelDillies removed their assignment Jan 11, 2023
@semorrison semorrison added the too-late This PR was ready too late for inclusion in mathlib3 label Jul 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merge-conflict Please `git merge origin/master` then a bot will remove this label. too-late This PR was ready too late for inclusion in mathlib3 WIP Work in progress
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants