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

[Merged by Bors] - feat(GroupTheory/SpecificGroups/Alternating/Centralizer): compute the centralizer of a permutation in the alternating group #17047

Closed
wants to merge 176 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
176 commits
Select commit Hold shift + click to select a range
972be5e
initial commit
Dec 29, 2023
320c553
delegate cardinality to ArrowAction
Dec 30, 2023
e66eedf
A working file. Names need to be cleaned up.
Dec 30, 2023
2b363b8
adjust Mathlib.lean and import DomMulAct
Dec 30, 2023
d9fc7f5
avoid the use of finite sets
Dec 30, 2023
6c2e67d
update (linter)
Dec 30, 2023
a42782f
linter (isolated by)
Dec 30, 2023
99a506c
delete ArrowAction
Dec 30, 2023
a59e9af
update (bad ConjAct.toConjAct)
Dec 30, 2023
7c34d07
adjust docstring
Dec 31, 2023
02777f8
merge and adjust DomMulAct
Jan 8, 2024
ee2a9c4
adjust sections and docstring
Jan 8, 2024
9674747
remove buggy examples, lint100, use factorial notation
Jan 8, 2024
23f08e6
adjust docstring
Jan 9, 2024
13a230c
delete #align lines
Jan 9, 2024
548fbcc
update following suggestions of jmc
Jan 9, 2024
e4344f8
tidy up residues of one #align line
Jan 9, 2024
efdcff8
feat: lemmas on permutations, cycles, etc.
Jan 9, 2024
1e36ff2
add Mathlib.GroupTheory.Perm.ConjAct in Mathlib.lean
Jan 9, 2024
bd7b7b1
rw [ConjAct.smul_def]
AntoineChambert-Loir Jan 10, 2024
af58d27
apply RB's suggestions
Jan 18, 2024
5a38e91
a forgotten one
Jan 18, 2024
842d3ba
lint100
Jan 18, 2024
5e3c875
update the name of a lemma
Jan 18, 2024
455b6a6
update the name of a lemma
Jan 18, 2024
1501d2b
use "generalizing" in induction proofs
Jan 23, 2024
02eb460
fix : remove "intro… "
Jan 23, 2024
6f8b69a
take care of comments by Ruben-VandeVelde
AntoineChambert-Loir Feb 13, 2024
6c3fd6f
move the simp tag after the docstring
AntoineChambert-Loir Feb 13, 2024
c740010
Merge branch 'master' into ACL/PermLemmas
riccardobrasca Feb 23, 2024
3c90171
Merge branch 'master' into ACL/PermLemmas
AntoineChambert-Loir Feb 24, 2024
d29bed5
Merge branch 'master' into ACL/PermLemmas
AntoineChambert-Loir Apr 1, 2024
ca8c802
adjust (change of suffices syntax)
AntoineChambert-Loir Apr 1, 2024
e6d77d8
adjustments
AntoineChambert-Loir Apr 1, 2024
93cfb1d
other adjustments
AntoineChambert-Loir Apr 1, 2024
e1ae4cf
Update Mathlib/GroupTheory/Perm/Support.lean
AntoineChambert-Loir Apr 18, 2024
4ab4567
Merge branch 'master' into ACL/ConjClassCount
AntoineChambert-Loir Apr 20, 2024
555ff10
adjust Mathlib.lean
AntoineChambert-Loir Apr 20, 2024
9733093
Merge branch 'ACL/PermLemmas' into ACL/ConjClassCount
AntoineChambert-Loir Apr 20, 2024
ccf51ec
adjust to new syntax of suffices; add ncard lemma
AntoineChambert-Loir Apr 20, 2024
6f110ce
adjust to new syntax of suffices
AntoineChambert-Loir Apr 20, 2024
8cf1ad9
remove lemmas that are elsewhere
AntoineChambert-Loir Apr 20, 2024
5efdead
Merge branch 'master' into ACL/PermLemmas
AntoineChambert-Loir Jul 18, 2024
0f85639
adjust to linter
AntoineChambert-Loir Jul 18, 2024
89cb2f5
more adjustments
AntoineChambert-Loir Jul 18, 2024
b2a1cd3
adjust
AntoineChambert-Loir Jul 18, 2024
ee21919
linter 100
AntoineChambert-Loir Jul 18, 2024
59de845
Merge branch 'master' into ACL/PermLemmas
AntoineChambert-Loir Jul 19, 2024
45a4748
Merge branch 'ACL/PermLemmas' into ACL/ConjClassCount
AntoineChambert-Loir Jul 19, 2024
49a6fcd
update with Fintype condition
AntoineChambert-Loir Jul 19, 2024
6f16fa2
adjust
AntoineChambert-Loir Jul 19, 2024
ef78e9b
update import
AntoineChambert-Loir Jul 19, 2024
6054e28
golf, reorganize
AntoineChambert-Loir Jul 30, 2024
f770717
mv Multiset.prod_pos
AntoineChambert-Loir Jul 30, 2024
1be185c
update Mathlib (and push what wasn't)
AntoineChambert-Loir Jul 30, 2024
e7a59ac
a bit of cleaning
AntoineChambert-Loir Jul 30, 2024
9c94527
adjust
AntoineChambert-Loir Jul 30, 2024
4d1e0c0
more cleaning in the Perm stuff
AntoineChambert-Loir Jul 30, 2024
aadc5d8
make linter100 happy
AntoineChambert-Loir Jul 30, 2024
e08bda2
more cleaning
AntoineChambert-Loir Jul 31, 2024
207bb4c
golf perm.centralizer
AntoineChambert-Loir Jul 31, 2024
2aa1596
this is a mess
AntoineChambert-Loir Aug 1, 2024
015937b
add pow/zpow Pi.mulSingle lemmas
AntoineChambert-Loir Aug 1, 2024
a7f5932
much cleanup
AntoineChambert-Loir Aug 1, 2024
78b6d0b
Merge branch 'master' into ACL/ConjClassCount
AntoineChambert-Loir Aug 1, 2024
0e07052
Update Mathlib/Algebra/Group/Pi/Lemmas.lean
AntoineChambert-Loir Aug 1, 2024
6f05404
Update Mathlib/GroupTheory/Perm/Centralizer.lean
AntoineChambert-Loir Aug 1, 2024
87916d2
Update Mathlib/GroupTheory/Perm/Centralizer.lean
AntoineChambert-Loir Aug 1, 2024
358c241
Update Mathlib/GroupTheory/Perm/Centralizer.lean
AntoineChambert-Loir Aug 1, 2024
5eb1367
linter 100
AntoineChambert-Loir Aug 1, 2024
7dd828b
delete duplicate section (after merge)
AntoineChambert-Loir Aug 1, 2024
76eff21
change to (non)deprecated lemma
AntoineChambert-Loir Aug 1, 2024
2d1197c
follow linter requirements
AntoineChambert-Loir Aug 2, 2024
741e124
some more golfing
AntoineChambert-Loir Aug 2, 2024
f3ad475
pass to centralizer
AntoineChambert-Loir Aug 2, 2024
2e1f3a2
no centralizers…
AntoineChambert-Loir Aug 3, 2024
f94f966
update documentation preample
AntoineChambert-Loir Aug 3, 2024
dc15db9
use noncommProd
AntoineChambert-Loir Aug 4, 2024
51ef18e
Merge branch 'master' into ACL/ConjClassCount
AntoineChambert-Loir Aug 4, 2024
d3f6c16
in (re)construction
AntoineChambert-Loir Aug 5, 2024
8cb5488
better version, with lemmas to dispatch
AntoineChambert-Loir Aug 5, 2024
fbca8fc
Update Mathlib/GroupTheory/Perm/Centralizer.lean
AntoineChambert-Loir Aug 6, 2024
2826adf
Update Mathlib/GroupTheory/Perm/Centralizer.lean
AntoineChambert-Loir Aug 6, 2024
25eb856
Update Mathlib/GroupTheory/Perm/Centralizer.lean
AntoineChambert-Loir Aug 6, 2024
5167777
Update Mathlib/GroupTheory/Perm/Centralizer.lean
AntoineChambert-Loir Aug 6, 2024
656f765
remove trailing spaces
AntoineChambert-Loir Aug 6, 2024
64e3bb1
lint-style
AntoineChambert-Loir Aug 6, 2024
93f298b
lint-style
AntoineChambert-Loir Aug 6, 2024
33ae038
(previous was golf, split proofs), lint-style
AntoineChambert-Loir Aug 6, 2024
eee759a
redefine ofPerm
AntoineChambert-Loir Aug 6, 2024
7d115e9
golf further
AntoineChambert-Loir Aug 6, 2024
cccb048
adjust the case of alternating group
AntoineChambert-Loir Aug 7, 2024
cb34d86
add two docstrings
AntoineChambert-Loir Aug 7, 2024
b058c1e
remove after exit
AntoineChambert-Loir Aug 7, 2024
f772ece
merge master
AntoineChambert-Loir Sep 9, 2024
de67f3a
add a comment
AntoineChambert-Loir Sep 13, 2024
5202480
Revert "add a comment"
AntoineChambert-Loir Sep 13, 2024
d254a9d
update import of Finset.Pointwise
AntoineChambert-Loir Sep 13, 2024
528d762
remove already included variables
AntoineChambert-Loir Sep 13, 2024
6c94cfe
correct namespace in function
AntoineChambert-Loir Sep 13, 2024
b115d30
adjust
AntoineChambert-Loir Sep 13, 2024
9a7d9e7
adjust once more
AntoineChambert-Loir Sep 13, 2024
65b51c2
generalize
AntoineChambert-Loir Sep 13, 2024
4f94062
remove namespace
AntoineChambert-Loir Sep 13, 2024
edf3817
Merge branch 'master' of https://github.com/leanprover-community/math…
AntoineChambert-Loir Sep 13, 2024
77990b7
feat (Mathlib/Algebra/Group/Pi/Lemmas): add Pi.single_pow
AntoineChambert-Loir Sep 13, 2024
b1fe685
Revert "Revert "add a comment""
AntoineChambert-Loir Sep 13, 2024
05758e1
initial commit
AntoineChambert-Loir Sep 13, 2024
ad63503
Update WeightedHomogeneous.lean
AntoineChambert-Loir Sep 13, 2024
665dda1
remove typo
AntoineChambert-Loir Sep 13, 2024
ad56a4c
Update Mathlib/Algebra/Group/Pi/Lemmas.lean
AntoineChambert-Loir Sep 13, 2024
26604ca
Update Mathlib/Algebra/Group/Pi/Lemmas.lean
AntoineChambert-Loir Sep 13, 2024
329a046
obey shake
AntoineChambert-Loir Sep 13, 2024
c3a2ffc
merge with ACL/BigOperatorsGroupWithZero #16755
AntoineChambert-Loir Sep 14, 2024
a2ec9af
merge ACL/PiLemmas #16774
AntoineChambert-Loir Sep 14, 2024
81b57e1
remove trailing space
AntoineChambert-Loir Sep 14, 2024
153e926
Merge branch 'master' into ACL/ConjClassCount
AntoineChambert-Loir Sep 14, 2024
6d060a6
adjust import
AntoineChambert-Loir Sep 14, 2024
7425f4c
adjust
AntoineChambert-Loir Sep 14, 2024
6f74848
Update Mathlib/GroupTheory/Perm/Centralizer.lean
AntoineChambert-Loir Sep 14, 2024
910a00f
remove useless
AntoineChambert-Loir Sep 14, 2024
4482a3f
Merge branch 'ACL/ConjClassCount' of https://github.com/leanprover-co…
AntoineChambert-Loir Sep 14, 2024
b1fc7d1
remove useless have
AntoineChambert-Loir Sep 14, 2024
23c2025
adjust to deprecated function
AntoineChambert-Loir Sep 14, 2024
b735b33
revert multiset to mathlib state
AntoineChambert-Loir Sep 15, 2024
6a930a6
merge master
AntoineChambert-Loir Sep 20, 2024
0aa44d5
delete the two files that compute the centralizer
AntoineChambert-Loir Sep 23, 2024
6d0ee39
update Mathlib.lean
AntoineChambert-Loir Sep 23, 2024
9344d0f
Centralizer of Perm
AntoineChambert-Loir Sep 23, 2024
0f31e0b
Centralizer of Alternating
AntoineChambert-Loir Sep 23, 2024
6d54d74
Merge branch 'master' into ACL/ConjClassCount-2
AntoineChambert-Loir Sep 27, 2024
7335852
add docstrings for primed theorems
AntoineChambert-Loir Sep 27, 2024
d302d09
remove blank lines (spurious modifications)
AntoineChambert-Loir Sep 30, 2024
0930b6c
dispatch disjoint lemmas
AntoineChambert-Loir Sep 30, 2024
b54c7ce
try to explain erw around line 170
AntoineChambert-Loir Sep 30, 2024
533937b
dispatch noncomm(Pi)Coprod lemmas
AntoineChambert-Loir Sep 30, 2024
57ed2a5
commit changes from style linters
leanprover-community-mathlib4-bot Sep 30, 2024
b536f07
dispatch some centralizer lemmas
AntoineChambert-Loir Sep 30, 2024
b5a834c
clean up
AntoineChambert-Loir Sep 30, 2024
f86decb
clean up
AntoineChambert-Loir Sep 30, 2024
9caf3d6
mv decidable instance
AntoineChambert-Loir Sep 30, 2024
6f0ccc6
dispatch some lemmas
AntoineChambert-Loir Oct 1, 2024
93efba9
lint-style
AntoineChambert-Loir Oct 1, 2024
fae9281
dispatch more lemmas
AntoineChambert-Loir Oct 1, 2024
2dd057e
dispatch more lemmas
AntoineChambert-Loir Oct 1, 2024
644f27e
merge master
AntoineChambert-Loir Oct 7, 2024
373685c
adjust
AntoineChambert-Loir Oct 9, 2024
53a2f87
Merge branch 'ACL/ConjClassCount-25' into ACL/ConjClassCount-3
AntoineChambert-Loir Oct 9, 2024
3b10222
relocate comp_noncommPiCoprod
AntoineChambert-Loir Oct 9, 2024
9afa87d
adjust
AntoineChambert-Loir Oct 9, 2024
539ef34
Merge branch 'master' into ACL/ConjClassCount-25
AntoineChambert-Loir Oct 28, 2024
6110ee6
Merge branch 'master' into ACL/ConjClassCount-3
AntoineChambert-Loir Oct 28, 2024
04f78d8
adjust to linter
AntoineChambert-Loir Oct 30, 2024
7e81149
adjust to linter
AntoineChambert-Loir Oct 30, 2024
3e5415f
Merge branch 'master' into ACL/ConjClassCount-25
AntoineChambert-Loir Nov 13, 2024
1b8470e
Merge branch 'ACL/ConjClassCount-25' into ACL/ConjClassCount-3
AntoineChambert-Loir Nov 13, 2024
5d674f9
merge master
AntoineChambert-Loir Feb 1, 2025
4488a6f
Merge branch 'master' into ACL/ConjClassCount-3
AntoineChambert-Loir Feb 5, 2025
3e25a3a
first adjustments after merge
AntoineChambert-Loir Feb 6, 2025
d446dce
add new lemma about support
AntoineChambert-Loir Feb 6, 2025
46ebe34
recover lemma
AntoineChambert-Loir Feb 6, 2025
94d4e14
adjust
AntoineChambert-Loir Feb 6, 2025
fcbec0c
adjust docstring
AntoineChambert-Loir Feb 6, 2025
f5b3521
use le_centralizer
AntoineChambert-Loir Feb 6, 2025
e5bbdcd
Update Mathlib/GroupTheory/Perm/Centralizer.lean
AntoineChambert-Loir Feb 6, 2025
4b68027
adjust open
AntoineChambert-Loir Feb 6, 2025
53ac61d
Apply suggestions from code review
AntoineChambert-Loir Feb 21, 2025
165508b
address remarks of ON
AntoineChambert-Loir Feb 21, 2025
d6dd1a5
Apply suggestions from code review
AntoineChambert-Loir Feb 21, 2025
79bd779
Apply suggestions from code review
AntoineChambert-Loir Feb 21, 2025
020dfcb
some simplifications
AntoineChambert-Loir Feb 21, 2025
64599ec
address comments by OFC
AntoineChambert-Loir Feb 27, 2025
1dd0e18
Merge branch 'master' into ACL/ConjClassCount-3
AntoineChambert-Loir Feb 27, 2025
551ab56
adjust to deprecated lemma
AntoineChambert-Loir Feb 27, 2025
68a3358
Apply suggestions from code review
AntoineChambert-Loir Mar 1, 2025
cdd62b3
simplify, add lemma
AntoineChambert-Loir Mar 1, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Mathlib.lean
Original file line number Diff line number Diff line change
Expand Up @@ -3539,6 +3539,7 @@ import Mathlib.GroupTheory.SchurZassenhaus
import Mathlib.GroupTheory.SemidirectProduct
import Mathlib.GroupTheory.Solvable
import Mathlib.GroupTheory.SpecificGroups.Alternating
import Mathlib.GroupTheory.SpecificGroups.Alternating.Centralizer
import Mathlib.GroupTheory.SpecificGroups.Cyclic
import Mathlib.GroupTheory.SpecificGroups.Dihedral
import Mathlib.GroupTheory.SpecificGroups.KleinFour
Expand Down
27 changes: 25 additions & 2 deletions Mathlib/GroupTheory/NoncommPiCoprod.lean
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,17 @@ theorem noncommPiCoprod_mulSingle [DecidableEq ι] (i : ι) (y : N i) :
simp only [Finset.mem_erase] at hj
simp [hj]

/-- The universal property of `MonoidHom.noncommPiCoprod` -/
@[to_additive "The universal property of `AddMonoidHom.noncommPiCoprod`"]
/--
The universal property of `MonoidHom.noncommPiCoprod`

Given monoid morphisms `φᵢ : Nᵢ → M` whose images pairwise commute,
there exists a unique monoid morphism `φ : Πᵢ Nᵢ → M` that induces the `φᵢ`,
and it is given by `MonoidHom.noncommPiCoprod`. -/
@[to_additive "The universal property of `MonoidHom.noncommPiCoprod`

Given monoid morphisms `φᵢ : Nᵢ → M` whose images pairwise commute,
there exists a unique monoid morphism `φ : Πᵢ Nᵢ → M` that induces the `φᵢ`,
and it is given by `AddMonoidHom.noncommPiCoprod`."]
def noncommPiCoprodEquiv [DecidableEq ι] :
{ ϕ : ∀ i, N i →* M // Pairwise fun i j => ∀ x y, Commute (ϕ i x) (ϕ j y) } ≃
((∀ i, N i) →* M) where
Expand Down Expand Up @@ -174,6 +183,20 @@ lemma noncommPiCoprod_apply (h : (i : ι) → N i) :
(Pairwise.set_pairwise (fun ⦃i j⦄ a ↦ hcomm a (h i) (h j)) _) := by
dsimp only [MonoidHom.noncommPiCoprod, MonoidHom.coe_mk, OneHom.coe_mk]

/--
Given monoid morphisms `φᵢ : Nᵢ → M` and `f : M → P`, if we have sufficient commutativity, then
`f ∘ (∐ᵢ φᵢ) = ∐ᵢ (f ∘ φᵢ)` -/
@[to_additive]
theorem comp_noncommPiCoprod {P : Type*} [Monoid P] {f : M →* P}
(hcomm' : Pairwise fun i j => ∀ x y, Commute (f.comp (ϕ i) x) (f.comp (ϕ j) y) :=
Pairwise.mono hcomm (fun i j ↦ forall_imp (fun x h y ↦ by
simp only [MonoidHom.coe_comp, Function.comp_apply, Commute.map (h y) f]))) :
f.comp (MonoidHom.noncommPiCoprod ϕ hcomm) =
MonoidHom.noncommPiCoprod (fun i ↦ f.comp (ϕ i)) hcomm' :=
MonoidHom.ext fun _ ↦ by
simp only [MonoidHom.noncommPiCoprod, MonoidHom.coe_comp, MonoidHom.coe_mk, OneHom.coe_mk,
Function.comp_apply, Finset.map_noncommProd]

end MonoidHom

end FamilyOfMonoids
Expand Down
153 changes: 118 additions & 35 deletions Mathlib/GroupTheory/Perm/Centralizer.lean
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import Mathlib.GroupTheory.Perm.DomMulAct
Let `α : Type` with `Fintype α` (and `DecidableEq α`).
The main goal of this file is to compute the cardinality of
conjugacy classes in `Equiv.Perm α`.
Every `g : Equiv.Perm α` has a `cycleType α : Multiset ℕ`.
Every `g : Equiv.Perm α` has a `g.cycleType : Multiset ℕ`.
By `Equiv.Perm.isConj_iff_cycleType_eq`,
two permutations are conjugate in `Equiv.Perm α` iff
their cycle types are equal.
Expand All @@ -33,16 +33,14 @@ orbit-stabilizer theorem
the computation to the computation of the centralizer of `g`, the
subgroup of `Equiv.Perm α` consisting of all permutations which
commute with `g`. It is accessed here as `MulAction.stabilizer
(ConjAct (Equiv.Perm α)) g` and
`Equiv.Perm.centralizer_eq_comap_stabilizer`.
(ConjAct (Equiv.Perm α)) g` and `Subgroup.centralizer_eq_comap_stabilizer`.

We compute this subgroup as follows.

* If `h : Subgroup.centralizer {g}`, then the action of `ConjAct.toConjAct h`
by conjugation on `Equiv.Perm α` stabilizes `g.cycleFactorsFinset`.
That induces an action of `Subgroup.centralizer {g}` on
`g.cycleFactorsFinset` which is defined via
`Equiv.Perm.OnCycleFactors.subMulActionOnCycleFactors`
`g.cycleFactorsFinset` which is defined as an instance.

* This action defines a group morphism `Equiv.Perm.OnCycleFactors.toPermHom g`
from `Subgroup.centralizer {g}` to `Equiv.Perm g.cycleFactorsFinset`.
Expand All @@ -51,9 +49,10 @@ We compute this subgroup as follows.
`Equiv.Perm g.cycleFactorsFinset` consisting of permutations that
preserve the cardinality of the support.

* `Equiv.Perm.OnCycleFactors.range_toPermHom_eq_range_toPermHom' shows that
* `Equiv.Perm.OnCycleFactors.range_toPermHom_eq_range_toPermHom'` shows that
the range of `Equiv.Perm.OnCycleFactors.toPermHom g`
is the subgroup `toPermHom_range' g` of `Equiv.Perm g.cycleFactorsFinset`.
is the subgroup `Equiv.Perm.OnCycleFactors.toPermHom_range' g`
of `Equiv.Perm g.cycleFactorsFinset`.

This is shown by constructing a right inverse
`Equiv.Perm.Basis.toCentralizer`, as established by
Expand All @@ -73,10 +72,13 @@ This is shown by constructing a right inverse
This allows to give a description of the kernel of
`Equiv.Perm.OnCycleFactors.toPermHom g` as the product of a
symmetric group and of a product of cyclic groups. This analysis
starts with the morphism `Equiv.Perm.OnCycleFactors.θ`, its
injectivity `Equiv.Perm.OnCycleFactors.θ_injective`, its range
`Equiv.Perm.OnCycleFactors.θ_range_eq`, and its cardinality
`Equiv.Perm.OnCycleFactors.θ_range_card`.
starts with the morphism `Equiv.Perm.OnCycleFactors.kerParam`, its
injectivity `Equiv.Perm.OnCycleFactors.kerParam_injective`, its range
`Equiv.Perm.OnCycleFactors.kerParam_range_eq`, and its cardinality
`Equiv.Perm.OnCycleFactors.kerParam_range_card`.

* `Equiv.Perm.OnCycleFactors.sign_kerParam_apply_apply` computes the signature
of the permutation induced given by `Equiv.Perm.OnCycleFactors.kerParam`.

* `Equiv.Perm.nat_card_centralizer g` computes the cardinality
of the centralizer of `g`.
Expand Down Expand Up @@ -124,16 +126,16 @@ lemma Subgroup.Centralizer.toConjAct_smul_mem_cycleFactorsFinset {k c : Perm α}
on the cycles of a given permutation -/
def Subgroup.Centralizer.cycleFactorsFinset_mulAction :
MulAction (centralizer {g}) g.cycleFactorsFinset where
smul k c := ⟨ConjAct.toConjAct (k : Perm α) • (c : Perm α),
smul k c := ⟨ConjAct.toConjAct (k : Perm α) • c.val,
Subgroup.Centralizer.toConjAct_smul_mem_cycleFactorsFinset k.prop c.prop⟩
one_smul c := by
rw [← Subtype.coe_inj]
change ConjAct.toConjAct (1 : Perm α) • (c : Perm α) = c
change ConjAct.toConjAct (1 : Perm α) • c.val = c
simp only [map_one, one_smul]
mul_smul k l c := by
simp only [← Subtype.coe_inj]
change ConjAct.toConjAct (k * l : Perm α) • (c : Perm α) =
ConjAct.toConjAct (k : Perm α) • (ConjAct.toConjAct (l : Perm α)) • (c : Perm α)
change ConjAct.toConjAct (k * l : Perm α) • c.val =
ConjAct.toConjAct (k : Perm α) • (ConjAct.toConjAct (l : Perm α)) • c.val
simp only [map_mul, mul_smul]

/-- The conjugation action of `Subgroup.centralizer {g}` on `g.cycleFactorsFinset` -/
Expand Down Expand Up @@ -164,7 +166,7 @@ theorem coe_toPermHom (k : centralizer {g}) (c : g.cycleFactorsFinset) :

The equality is proved by `Equiv.Perm.OnCycleFactors.range_toPermHom_eq_range_toPermHom'`. -/
def range_toPermHom' : Subgroup (Perm g.cycleFactorsFinset) where
carrier := {τ | ∀ c, (τ c : Perm α).support.card = (c : Perm α).support.card}
carrier := {τ | ∀ c, (τ c).val.support.card = c.val.support.card}
one_mem' := by
simp only [Set.mem_setOf_eq, coe_one, id_eq, eq_self_iff_true, imp_true_iff]
mul_mem' hσ hτ := by
Expand All @@ -182,7 +184,7 @@ def range_toPermHom' : Subgroup (Perm g.cycleFactorsFinset) where
variable {g} in
theorem mem_range_toPermHom'_iff {τ : Perm g.cycleFactorsFinset} :
τ ∈ range_toPermHom' g ↔
∀ c, (τ c : Perm α).support.card = (c : Perm α).support.card :=
∀ c, (τ c).val.support.card = c.val.support.card :=
Iff.rfl

variable (k : centralizer {g})
Expand All @@ -204,7 +206,7 @@ structure Basis (g : Equiv.Perm α) where
/-- A choice of elements in each cycle -/
(toFun : g.cycleFactorsFinset → α)
/-- For each cycle, the chosen element belongs to the cycle -/
(mem_support_self' : ∀ (c : g.cycleFactorsFinset), toFun c ∈ (c : Perm α).support)
(mem_support_self' : ∀ (c : g.cycleFactorsFinset), toFun c ∈ c.val.support)

instance (g : Perm α) :
DFunLike (Basis g) (g.cycleFactorsFinset) (fun _ => α) where
Expand All @@ -214,14 +216,14 @@ instance (g : Perm α) :
namespace Basis

theorem nonempty (g : Perm α) : Nonempty (Basis g) := by
have (c : g.cycleFactorsFinset) : (c : Perm α).support.Nonempty :=
have (c : g.cycleFactorsFinset) : c.val.support.Nonempty :=
IsCycle.nonempty_support (mem_cycleFactorsFinset_iff.mp c.prop).1
exact ⟨fun c ↦ (this c).choose, fun c ↦ (this c).choose_spec⟩

variable (a : Basis g) (c : g.cycleFactorsFinset)

theorem mem_support_self :
a c ∈ (c : Perm α).support := a.mem_support_self' c
a c ∈ c.val.support := a.mem_support_self' c

theorem injective : Function.Injective a := by
intro c d h
Expand Down Expand Up @@ -251,7 +253,7 @@ def ofPermHomFun (x : α) : α :=

theorem mem_fixedPoints_or_exists_zpow_eq (x : α) :
x ∈ Function.fixedPoints g ∨
∃ (c : g.cycleFactorsFinset) (_ : x ∈ (c : Perm α).support) (m : ℤ), (g ^ m) (a c) = x := by
∃ (c : g.cycleFactorsFinset) (_ : x ∈ c.val.support) (m : ℤ), (g ^ m) (a c) = x := by
rw [Classical.or_iff_not_imp_left]
intro hx
rw [Function.mem_fixedPoints_iff, ← ne_eq, ← mem_support,
Expand All @@ -261,7 +263,7 @@ theorem mem_fixedPoints_or_exists_zpow_eq (x : α) :
simp [SameCycle.rfl, hx, and_self]

theorem ofPermHomFun_apply_of_cycleOf_mem {x : α} {c : g.cycleFactorsFinset}
(hx : x ∈ (c : Perm α).support) {m : ℤ} (hm : (g ^ m) (a c) = x) :
(hx : x ∈ c.val.support) {m : ℤ} (hm : (g ^ m) (a c) = x) :
ofPermHomFun a τ x = (g ^ m) (a ((τ : Perm g.cycleFactorsFinset) c)) := by
have hx' : c = g.cycleOf x := cycle_is_cycleOf hx (Subtype.prop c)
have hx'' : g.cycleOf x ∈ g.cycleFactorsFinset := hx' ▸ c.prop
Expand Down Expand Up @@ -290,7 +292,7 @@ theorem ofPermHomFun_apply_of_mem_fixedPoints {x : α} (hx : x ∈ Function.fixe

theorem ofPermHomFun_apply_mem_support_cycle_iff {x : α} {c : g.cycleFactorsFinset} :
ofPermHomFun a τ x ∈ ((τ : Perm g.cycleFactorsFinset) c : Perm α).support ↔
x ∈ (c : Perm α).support := by
x ∈ c.val.support := by
rcases mem_fixedPoints_or_exists_zpow_eq a x with (hx | ⟨d, hd, m, hm⟩)
· simp only [ofPermHomFun_apply_of_mem_fixedPoints a τ hx]
suffices ∀ (d : g.cycleFactorsFinset), x ∉ (d : Perm α).support by
Expand All @@ -303,7 +305,7 @@ theorem ofPermHomFun_apply_mem_support_cycle_iff {x : α} {c : g.cycleFactorsFin
rw [zpow_apply_mem_support_of_mem_cycleFactorsFinset_iff]
by_cases h : c = d
· simp only [h, hd, iff_true, mem_support_self]
· have H : Disjoint (c : Perm α) (d : Perm α) :=
· have H : Disjoint c.val d.val :=
cycleFactorsFinset_pairwise_disjoint g c.prop d.prop (Subtype.coe_ne_coe.mpr h)
have H' : Disjoint ((τ : Perm g.cycleFactorsFinset) c : Perm α)
((τ : Perm g.cycleFactorsFinset) d : Perm α) :=
Expand Down Expand Up @@ -354,6 +356,40 @@ noncomputable def ofPermHom : range_toPermHom' g →* Perm α where
map_one' := ext fun x ↦ ofPermHomFun_one a x
map_mul' := fun σ τ ↦ ext fun x ↦ by simp [mul_apply, ofPermHomFun_mul a σ τ x]

theorem ofPermHom_apply (τ) (x) : a.ofPermHom τ x = a.ofPermHomFun τ x := rfl

theorem ofPermHom_support :
(ofPermHom a τ).support =
(τ : Perm g.cycleFactorsFinset).support.biUnion (fun c ↦ c.val.support) := by
ext x
simp only [mem_support, Finset.mem_biUnion, ofPermHom_apply]
rcases mem_fixedPoints_or_exists_zpow_eq a x with (hx | ⟨c, hc, m, hm⟩)
· simp only [ofPermHomFun_apply_of_mem_fixedPoints a τ hx, ne_eq, not_true_eq_false, false_iff,
← mem_support]
rintro ⟨c, -, hc⟩
rw [Function.mem_fixedPoints_iff] at hx
exact mem_support.mp ((mem_cycleFactorsFinset_support_le c.prop) hc) hx
· rw [ofPermHomFun_apply_of_cycleOf_mem a τ hc hm]
conv_lhs => rw [← hm]
rw [(g ^ m).injective.ne_iff, a.injective.ne_iff, not_iff_comm]
by_cases H : (τ : Perm g.cycleFactorsFinset) c = c
· simp only [H, iff_true]
push_neg
intro d hd
rw [← not_mem_support]
have := g.cycleFactorsFinset_pairwise_disjoint c.prop d.prop
rw [disjoint_iff_disjoint_support, Finset.disjoint_left] at this
exact this (by aesop) hc
· simpa only [H, iff_false, not_not] using ⟨c, H, mem_support.mp hc⟩

theorem card_ofPermHom_support :
(ofPermHom a τ).support.card =
∑ c ∈ (τ : Perm g.cycleFactorsFinset).support, c.val.support.card := by
rw [ofPermHom_support, Finset.card_biUnion]
intro c _ d _ h
apply Equiv.Perm.Disjoint.disjoint_support
apply g.cycleFactorsFinset_pairwise_disjoint c.prop d.prop (Subtype.coe_ne_coe.mpr h)

theorem ofPermHom_mem_centralizer :
a.ofPermHom τ ∈ centralizer {g} := by
rw [mem_centralizer_singleton_iff]
Expand All @@ -377,7 +413,7 @@ theorem toCentralizer_equivariant :
simp only [← Subtype.coe_inj, val_centralizer_smul, InvMemClass.coe_inv, mul_inv_eq_iff_eq_mul]
ext x
simp only [mul_apply, toCentralizer_apply]
by_cases hx : x ∈ (c : Perm α).support
by_cases hx : x ∈ c.val.support
· rw [(mem_cycleFactorsFinset_iff.mp c.prop).2 x hx]
have := ofPermHomFun_commute_zpow_apply a τ x 1
simp only [zpow_one] at this
Expand All @@ -401,7 +437,7 @@ namespace OnCycleFactors
open Basis BigOperators Nat Equiv.Perm Equiv Subgroup

theorem mem_range_toPermHom_iff {τ} : τ ∈ (toPermHom g).range ↔
∀ c, (τ c : Perm α).support.card = (c : Perm α).support.card := by
∀ c, (τ c).val.support.card = c.val.support.card := by
constructor
· rintro ⟨k, rfl⟩ c
rw [coe_toPermHom, Equiv.Perm.support_conj]
Expand All @@ -411,8 +447,8 @@ theorem mem_range_toPermHom_iff {τ} : τ ∈ (toPermHom g).range ↔

/-- Unapplied variant of `Equiv.Perm.mem_range_toPermHom_iff` -/
theorem mem_range_toPermHom_iff' {τ} : τ ∈ (toPermHom g).range ↔
(fun (c : g.cycleFactorsFinset) ↦ (c : Perm α).support.card) ∘ τ =
fun (c : g.cycleFactorsFinset) ↦ (c : Perm α).support.card := by
(fun (c : g.cycleFactorsFinset) ↦ c.val.support.card) ∘ τ =
fun (c : g.cycleFactorsFinset) ↦ c.val.support.card := by
rw [mem_range_toPermHom_iff, funext_iff]
simp only [Finset.coe_sort_coe, Subtype.forall, Function.comp_apply]

Expand All @@ -426,7 +462,7 @@ theorem nat_card_range_toPermHom :
Nat.card (toPermHom g).range =
∏ n ∈ g.cycleType.toFinset, (g.cycleType.count n)! := by
classical
set sc : (c : g.cycleFactorsFinset) → ℕ := fun c ↦ (c : Perm α).support.card with hsc
set sc := fun (c : g.cycleFactorsFinset) ↦ c.val.support.card with hsc
suffices Fintype.card (toPermHom g).range =
Fintype.card { k : Perm g.cycleFactorsFinset | sc ∘ k = sc } by
simp only [Nat.card_eq_fintype_card, this, Set.coe_setOf, DomMulAct.stabilizer_card', hsc,
Expand All @@ -450,13 +486,12 @@ open BigOperators Nat OnCycleFactors Subgroup
variable (g) in
/-- The parametrization of the kernel of `toPermHom` -/
def kerParam : (Perm (Function.fixedPoints g)) ×
((c : g.cycleFactorsFinset) → Subgroup.zpowers (c : Perm α)) →* Perm α :=
((c : g.cycleFactorsFinset) → Subgroup.zpowers c.val) →* Perm α :=
MonoidHom.noncommCoprod ofSubtype (Subgroup.noncommPiCoprod g.pairwise_commute_of_mem_zpowers)
g.commute_ofSubtype_noncommPiCoprod


theorem kerParam_apply {u : Perm (Function.fixedPoints g)}
{v : (c : g.cycleFactorsFinset) → Subgroup.zpowers (c : Perm α)} {x : α} :
{v : (c : g.cycleFactorsFinset) → Subgroup.zpowers c.val} {x : α} :
kerParam g (u,v) x =
if hx : g.cycleOf x ∈ g.cycleFactorsFinset
then (v ⟨g.cycleOf x, hx⟩ : Perm α) x
Expand Down Expand Up @@ -525,7 +560,7 @@ theorem kerParam_range_eq :
set u : Perm (Function.fixedPoints g) :=
subtypePerm p (fun x ↦ mem_fixedPoints_iff_apply_mem_of_mem_centralizer p.2)
simp only [SetLike.mem_coe, mem_ker_toPermHom_iff, IsCycle.forall_commute_iff] at hp
set v : (c : g.cycleFactorsFinset) → (Subgroup.zpowers (c : Perm α)) :=
set v : (c : g.cycleFactorsFinset) → (Subgroup.zpowers c.val) :=
fun c => ⟨ofSubtype
(p.1.subtypePerm (Classical.choose (hp c.val c.prop))),
Classical.choose_spec (hp c.val c.prop)⟩
Expand All @@ -539,6 +574,11 @@ theorem kerParam_range_eq :
· rw [cycleOf_mem_cycleFactorsFinset_iff, not_mem_support] at hx
rwa [ofSubtype_apply_of_mem, subtypePerm_apply]

theorem kerParam_range_le_centralizer :
(kerParam g).range ≤ Subgroup.centralizer {g} := by
rw [kerParam_range_eq]
exact map_subtype_le (toPermHom g).ker

theorem kerParam_range_card (g : Equiv.Perm α) :
Fintype.card (kerParam g).range = (Fintype.card α - g.cycleType.sum)! * g.cycleType.prod := by
rw [Fintype.card_coeSort_range (kerParam_injective g)]
Expand All @@ -551,6 +591,38 @@ theorem kerParam_range_card (g : Equiv.Perm α) :

end Kernel

section Sign

open Equiv Function MulAction Finset

variable {a : Type*} (g : Perm α) (k : Perm (fixedPoints g))
(v : (c : g.cycleFactorsFinset) → Subgroup.zpowers (c : Perm α))

theorem sign_kerParam_apply_apply :
sign (kerParam g ⟨k, v⟩) = sign k * ∏ c, sign (v c).val := by
rw [kerParam, MonoidHom.noncommCoprod_apply, ← Prod.fst_mul_snd ⟨k, v⟩, Prod.mk_mul_mk, mul_one,
one_mul, map_mul, sign_ofSubtype, Finset.univ_eq_attach, mul_right_inj, ← MonoidHom.comp_apply,
Subgroup.noncommPiCoprod, MonoidHom.comp_noncommPiCoprod _, MonoidHom.noncommPiCoprod_apply,
Finset.univ_eq_attach, Finset.noncommProd_eq_prod]
simp

theorem cycleType_kerParam_apply_apply :
cycleType (kerParam g ⟨k, v⟩) = cycleType k + ∑ c, (v c).val.cycleType := by
let U := (Finset.univ : Finset { x // x ∈ g.cycleFactorsFinset }).toSet
have hU : U.Pairwise fun i j ↦ (v i).val.Disjoint (v j).val := fun c _ d _ h ↦ by
obtain ⟨m, hm⟩ := (v c).prop
obtain ⟨n, hn⟩ := (v d).prop
simp only [← hm, ← hn]
apply Disjoint.zpow_disjoint_zpow
apply cycleFactorsFinset_pairwise_disjoint g c.prop d.prop
exact Subtype.coe_ne_coe.mpr h
rw [kerParam, MonoidHom.noncommCoprod_apply, ← Prod.fst_mul_snd ⟨k, v⟩, Prod.mk_mul_mk, mul_one,
one_mul, Finset.univ_eq_attach, Disjoint.cycleType (disjoint_ofSubtype_noncommPiCoprod g k v),
Subgroup.noncommPiCoprod_apply, Disjoint.cycleType_noncommProd hU, Finset.univ_eq_attach]
exact congr_arg₂ _ cycleType_ofSubtype rfl

end Sign

end OnCycleFactors

open Nat
Expand Down Expand Up @@ -604,8 +676,7 @@ theorem card_of_cycleType_eq_zero_iff {m : Multiset ℕ} :

theorem card_of_cycleType_mul_eq (m : Multiset ℕ) :
({g | g.cycleType = m} : Finset (Perm α)).card *
((Fintype.card α - m.sum)! * m.prod *
(∏ n ∈ m.toFinset, (m.count n)!)) =
((Fintype.card α - m.sum)! * m.prod * (∏ n ∈ m.toFinset, (m.count n)!)) =
if (m.sum ≤ Fintype.card α ∧ ∀ a ∈ m, 2 ≤ a) then (Fintype.card α)! else 0 := by
split_ifs with hm
· -- nonempty case
Expand Down Expand Up @@ -635,4 +706,16 @@ theorem card_of_cycleType (m : Multiset ℕ) :
· -- empty case
exact (card_of_cycleType_eq_zero_iff α).mpr hm

open Fintype in
variable {α} in
/-- The number of cycles of given length -/
lemma card_of_cycleType_singleton {n : ℕ} (hn' : 2 ≤ n) (hα : n ≤ card α) :
({g | g.cycleType = {n}} : Finset (Perm α)).card = (n - 1)! * (choose (card α) n) := by
have hn₀ : n ≠ 0 := by omega
have aux : n ! = (n - 1)! * n := by rw [mul_comm, mul_factorial_pred (by omega)]
rw [mul_comm, ← Nat.mul_left_inj hn₀, mul_assoc, ← aux, ← Nat.mul_left_inj (factorial_ne_zero _),
Nat.choose_mul_factorial_mul_factorial hα, mul_assoc]
simpa [ite_and, if_pos hα, if_pos hn', mul_comm _ n, mul_assoc]
using card_of_cycleType_mul_eq α {n}

end Equiv.Perm
Loading