@@ -1218,12 +1218,10 @@ end CycleOf
1218
1218
### `cycleFactors`
1219
1219
-/
1220
1220
1221
- variable [DecidableEq α]
1222
-
1223
1221
open scoped List in
1224
1222
/-- Given a list `l : List α` and a permutation `f : perm α` whose nonfixed points are all in `l`,
1225
1223
recursively factors `f` into cycles. -/
1226
- def cycleFactorsAux [Fintype α] :
1224
+ def cycleFactorsAux [DecidableEq α] [ Fintype α] :
1227
1225
∀ (l : List α) (f : Perm α),
1228
1226
(∀ {x}, f x ≠ x → x ∈ l) →
1229
1227
{ l : List (Perm α) // l.prod = f ∧ (∀ g ∈ l, IsCycle g) ∧ l.Pairwise Disjoint } := by
@@ -1325,15 +1323,15 @@ def cycleFactors [Fintype α] [LinearOrder α] (f : Perm α) :
1325
1323
1326
1324
/-- Factors a permutation `f` into a list of disjoint cyclic permutations that multiply to `f`,
1327
1325
without a linear order. -/
1328
- def truncCycleFactors [Fintype α] (f : Perm α) :
1326
+ def truncCycleFactors [DecidableEq α] [ Fintype α] (f : Perm α) :
1329
1327
Trunc { l : List (Perm α) // l.prod = f ∧ (∀ g ∈ l, IsCycle g) ∧ l.Pairwise Disjoint } :=
1330
1328
Quotient.recOnSubsingleton (@univ α _).1 (fun l h => Trunc.mk (cycleFactorsAux l f (h _)))
1331
1329
(show ∀ x, f x ≠ x → x ∈ (@univ α _).1 from fun _ _ => mem_univ _)
1332
1330
#align equiv.perm.trunc_cycle_factors Equiv.Perm.truncCycleFactors
1333
1331
1334
1332
section CycleFactorsFinset
1335
1333
1336
- variable [Fintype α] (f : Perm α)
1334
+ variable [DecidableEq α] [ Fintype α] (f : Perm α)
1337
1335
1338
1336
/-- Factors a permutation `f` into a `Finset` of disjoint cyclic permutations that multiply to `f`.
1339
1337
-/
@@ -1547,7 +1545,7 @@ theorem cycle_induction_on [Finite β] (P : Perm β → Prop) (σ : Perm β) (ba
1547
1545
(ih (fun τ hτ => h1 τ (List.mem_cons_of_mem σ hτ)) h2.of_cons)
1548
1546
#align equiv.perm.cycle_induction_on Equiv.Perm.cycle_induction_on
1549
1547
1550
- theorem cycleFactorsFinset_mul_inv_mem_eq_sdiff [Fintype α] {f g : Perm α}
1548
+ theorem cycleFactorsFinset_mul_inv_mem_eq_sdiff [DecidableEq α] [ Fintype α] {f g : Perm α}
1551
1549
(h : f ∈ cycleFactorsFinset g) : cycleFactorsFinset (g * f⁻¹) = cycleFactorsFinset g \ {f} := by
1552
1550
revert f
1553
1551
refine'
@@ -1607,7 +1605,7 @@ theorem closure_isCycle : closure { σ : Perm β | IsCycle σ } = ⊤ := by
1607
1605
top_le_iff.mp (le_trans (ge_of_eq closure_isSwap) (closure_mono fun _ => IsSwap.isCycle))
1608
1606
#align equiv.perm.closure_is_cycle Equiv.Perm.closure_isCycle
1609
1607
1610
- variable [Fintype α]
1608
+ variable [DecidableEq α] [ Fintype α]
1611
1609
1612
1610
theorem closure_cycle_adjacent_swap {σ : Perm α} (h1 : IsCycle σ) (h2 : σ.support = ⊤) (x : α) :
1613
1611
closure ({σ, swap x (σ x)} : Set (Perm α)) = ⊤ := by
@@ -1692,15 +1690,14 @@ end Generation
1692
1690
1693
1691
section
1694
1692
1695
- variable [Fintype α] {σ τ : Perm α}
1696
-
1697
1693
noncomputable section
1698
1694
1695
+ variable [DecidableEq α] [Fintype α] {σ τ : Perm α}
1696
+
1699
1697
theorem isConj_of_support_equiv
1700
1698
(f : { x // x ∈ (σ.support : Set α) } ≃ { x // x ∈ (τ.support : Set α) })
1701
- (hf :
1702
- ∀ (x : α) (hx : x ∈ (σ.support : Set α)),
1703
- (f ⟨σ x, apply_mem_support.2 hx⟩ : α) = τ ↑(f ⟨x, hx⟩)) :
1699
+ (hf : ∀ (x : α) (hx : x ∈ (σ.support : Set α)),
1700
+ (f ⟨σ x, apply_mem_support.2 hx⟩ : α) = τ ↑(f ⟨x, hx⟩)) :
1704
1701
IsConj σ τ := by
1705
1702
refine' isConj_iff.2 ⟨Equiv.extendSubtype f, _⟩
1706
1703
rw [mul_inv_eq_iff_eq_mul]
@@ -1762,7 +1759,7 @@ theorem card_support_conj : (σ * τ * σ⁻¹).support.card = τ.support.card :
1762
1759
1763
1760
end
1764
1761
1765
- theorem Disjoint.isConj_mul {α : Type *} [Finite α] {σ τ π ρ : Perm α} (hc1 : IsConj σ π)
1762
+ theorem Disjoint.isConj_mul [Finite α] {σ τ π ρ : Perm α} (hc1 : IsConj σ π)
1766
1763
(hc2 : IsConj τ ρ) (hd1 : Disjoint σ τ) (hd2 : Disjoint π ρ) : IsConj (σ * τ) (π * ρ) := by
1767
1764
classical
1768
1765
cases nonempty_fintype α
@@ -1816,7 +1813,7 @@ section FixedPoints
1816
1813
-/
1817
1814
1818
1815
1819
- theorem fixed_point_card_lt_of_ne_one [Fintype α] {σ : Perm α} (h : σ ≠ 1 ) :
1816
+ theorem fixed_point_card_lt_of_ne_one [DecidableEq α] [ Fintype α] {σ : Perm α} (h : σ ≠ 1 ) :
1820
1817
(filter (fun x => σ x = x) univ).card < Fintype.card α - 1 := by
1821
1818
rw [lt_tsub_iff_left, ← lt_tsub_iff_right, ← Finset.card_compl, Finset.compl_filter]
1822
1819
exact one_lt_card_support_of_ne_one h
@@ -1866,9 +1863,8 @@ variable [DecidableEq α] [Fintype α]
1866
1863
1867
1864
theorem _root_.Finset.exists_cycleOn (s : Finset α) :
1868
1865
∃ f : Perm α, f.IsCycleOn s ∧ f.support ⊆ s := by
1869
- refine'
1870
- ⟨s.toList.formPerm, _, fun x hx => by
1871
- simpa using List.mem_of_formPerm_apply_ne _ _ (Perm.mem_support.1 hx)⟩
1866
+ refine ⟨s.toList.formPerm, ?_, fun x hx => by
1867
+ simpa using List.mem_of_formPerm_apply_ne _ _ (Perm.mem_support.1 hx)⟩
1872
1868
convert s.nodup_toList.isCycleOn_formPerm
1873
1869
simp
1874
1870
#align finset.exists_cycle_on Finset.exists_cycleOn
@@ -1882,18 +1878,16 @@ variable {f : Perm α} {s : Set α}
1882
1878
theorem _root_.Set.Countable.exists_cycleOn (hs : s.Countable) :
1883
1879
∃ f : Perm α, f.IsCycleOn s ∧ { x | f x ≠ x } ⊆ s := by
1884
1880
classical
1885
- obtain hs' | hs' := s.finite_or_infinite
1886
- · refine'
1887
- ⟨hs'.toFinset.toList.formPerm, _, fun x hx => by
1888
- simpa using List.mem_of_formPerm_apply_ne _ _ hx⟩
1889
- convert hs'.toFinset.nodup_toList.isCycleOn_formPerm
1890
- simp
1891
- haveI := hs.to_subtype
1881
+ obtain hs' | hs' := s.finite_or_infinite
1882
+ · refine ⟨hs'.toFinset.toList.formPerm, ?_, fun x hx => by
1883
+ simpa using List.mem_of_formPerm_apply_ne _ _ hx⟩
1884
+ convert hs'.toFinset.nodup_toList.isCycleOn_formPerm
1885
+ simp
1886
+ · haveI := hs.to_subtype
1892
1887
haveI := hs'.to_subtype
1893
1888
obtain ⟨f⟩ : Nonempty (ℤ ≃ s) := inferInstance
1894
- refine'
1895
- ⟨(Equiv.addRight 1 ).extendDomain f, _, fun x hx =>
1896
- of_not_not fun h => hx <| Perm.extendDomain_apply_not_subtype _ _ h⟩
1889
+ refine ⟨(Equiv.addRight 1 ).extendDomain f, ?_, fun x hx =>
1890
+ of_not_not fun h => hx <| Perm.extendDomain_apply_not_subtype _ _ h⟩
1897
1891
convert Int.addRight_one_isCycle.isCycleOn.extendDomain f
1898
1892
rw [Set.image_comp, Equiv.image_eq_preimage]
1899
1893
ext
0 commit comments