File: Mathlib/GroupTheory/Perm/Cycle/Factors.lean

full_name: Equiv.Perm.cycleOf
code: /-- `f.cycleOf x` is the cycle of the permutation `f` to which `x` belongs. -/
def cycleOf (f : Perm α) [DecidableRel f.SameCycle] (x : α) : Perm α 
goal: Equiv.Perm α

full_name: Equiv.Perm.cycleOf_apply
code: theorem cycleOf_apply (f : Perm α) [DecidableRel f.SameCycle] (x y : α) :
    cycleOf f x y = if SameCycle f x y then f y else y 
goal: (f.cycleOf x) y = if f.SameCycle x y then f y else y

full_name: Equiv.Perm.cycleOf_inv
code: theorem cycleOf_inv (f : Perm α) [DecidableRel f.SameCycle] (x : α) :
    (cycleOf f x)⁻¹ = cycleOf f⁻¹ x 
goal: (f.cycleOf x)⁻¹ = f⁻¹.cycleOf x

full_name: Equiv.Perm.cycleOf_pow_apply_self
code: @[simp]
theorem cycleOf_pow_apply_self (f : Perm α) [DecidableRel f.SameCycle] (x : α) :
    ∀ n : ℕ, (cycleOf f x ^ n) x = (f ^ n) x 
goal: (f.cycleOf x ^ n) x = (f ^ n) x

full_name: Equiv.Perm.cycleOf_zpow_apply_self
code: @[simp]
theorem cycleOf_zpow_apply_self (f : Perm α) [DecidableRel f.SameCycle] (x : α) :
    ∀ n : ℤ, (cycleOf f x ^ n) x = (f ^ n) x 
goal: (f.cycleOf x ^ n) x = (f ^ n) x

full_name: Equiv.Perm.SameCycle.cycleOf_apply
code: theorem SameCycle.cycleOf_apply : SameCycle f x y → cycleOf f x y = f y 
goal: f.SameCycle x y → (f.cycleOf x) y = f y

full_name: Equiv.Perm.cycleOf_apply_of_not_sameCycle
code: theorem cycleOf_apply_of_not_sameCycle : ¬SameCycle f x y → cycleOf f x y = y 
goal: ¬f.SameCycle x y → (f.cycleOf x) y = y

full_name: Equiv.Perm.SameCycle.cycleOf_eq
code: theorem SameCycle.cycleOf_eq (h : SameCycle f x y) : cycleOf f x = cycleOf f y 
goal: f.cycleOf x = f.cycleOf y

full_name: Equiv.Perm.cycleOf_apply_apply_zpow_self
code: @[simp]
theorem cycleOf_apply_apply_zpow_self (f : Perm α) [DecidableRel f.SameCycle] (x : α) (k : ℤ) :
    cycleOf f x ((f ^ k) x) = (f ^ (k + 1) : Perm α) x 
goal: (f.cycleOf x) ((f ^ k) x) = (f ^ (k + 1)) x

full_name: Equiv.Perm.cycleOf_apply_apply_pow_self
code: @[simp]
theorem cycleOf_apply_apply_pow_self (f : Perm α) [DecidableRel f.SameCycle] (x : α) (k : ℕ) :
    cycleOf f x ((f ^ k) x) = (f ^ (k + 1) : Perm α) x 
goal: (f.cycleOf x) ((f ^ k) x) = (f ^ (k + 1)) x

full_name: Equiv.Perm.cycleOf_apply_apply_self
code: @[simp]
theorem cycleOf_apply_apply_self (f : Perm α) [DecidableRel f.SameCycle] (x : α) :
    cycleOf f x (f x) = f (f x) 
goal: (f.cycleOf x) (f x) = f (f x)

full_name: Equiv.Perm.cycleOf_apply_self
code: @[simp]
theorem cycleOf_apply_self (f : Perm α) [DecidableRel f.SameCycle] (x : α) : cycleOf f x x = f x 
goal: (f.cycleOf x) x = f x

full_name: Equiv.Perm.IsCycle.cycleOf_eq
code: theorem IsCycle.cycleOf_eq (hf : IsCycle f) (hx : f x ≠ x) : cycleOf f x = f 
goal: f.cycleOf x = f

full_name: Equiv.Perm.cycleOf_eq_one_iff
code: @[simp]
theorem cycleOf_eq_one_iff (f : Perm α) [DecidableRel f.SameCycle] : cycleOf f x = 1 ↔ f x = x 
goal: f.cycleOf x = 1 ↔ f x = x

full_name: Equiv.Perm.cycleOf_self_apply
code: @[simp]
theorem cycleOf_self_apply (f : Perm α) [DecidableRel f.SameCycle] (x : α) :
    cycleOf f (f x) = cycleOf f x 
goal: f.cycleOf (f x) = f.cycleOf x

full_name: Equiv.Perm.cycleOf_self_apply_pow
code: @[simp]
theorem cycleOf_self_apply_pow (f : Perm α) [DecidableRel f.SameCycle] (n : ℕ) (x : α) :
    cycleOf f ((f ^ n) x) = cycleOf f x 
goal: f.cycleOf ((f ^ n) x) = f.cycleOf x

full_name: Equiv.Perm.cycleOf_self_apply_zpow
code: @[simp]
theorem cycleOf_self_apply_zpow (f : Perm α) [DecidableRel f.SameCycle] (n : ℤ) (x : α) :
    cycleOf f ((f ^ n) x) = cycleOf f x 
goal: f.cycleOf ((f ^ n) x) = f.cycleOf x

full_name: Equiv.Perm.IsCycle.cycleOf
code: protected theorem IsCycle.cycleOf [DecidableEq α] (hf : IsCycle f) :
    cycleOf f x = if f x = x then 1 else f 
goal: f.cycleOf x = if f x = x then 1 else f

full_name: Equiv.Perm.cycleOf_one
code: theorem cycleOf_one [DecidableRel (1 : Perm α).SameCycle] (x : α) :
    cycleOf 1 x = 1 
goal: Equiv.Perm.cycleOf 1 x = 1

full_name: Equiv.Perm.isCycle_cycleOf
code: theorem isCycle_cycleOf (f : Perm α) [DecidableRel f.SameCycle] (hx : f x ≠ x) :
    IsCycle (cycleOf f x) 
goal: (f.cycleOf x).IsCycle

full_name: Equiv.Perm.two_le_card_support_cycleOf_iff
code: @[simp]
theorem two_le_card_support_cycleOf_iff [DecidableEq α] [Fintype α] :
    2 ≤ card (cycleOf f x).support ↔ f x ≠ x 
goal: 2 ≤ (f.cycleOf x).support.card ↔ f x ≠ x

full_name: Equiv.Perm.support_cycleOf_nonempty
code: @[simp] lemma support_cycleOf_nonempty [DecidableEq α] [Fintype α] :
    (cycleOf f x).support.Nonempty ↔ f x ≠ x 
goal: (f.cycleOf x).support.Nonempty ↔ f x ≠ x

full_name: Equiv.Perm.card_support_cycleOf_pos_iff
code: @[deprecated support_cycleOf_nonempty (since := "2024-06-16")]
theorem card_support_cycleOf_pos_iff [DecidableEq α] [Fintype α] :
    0 < card (cycleOf f x).support ↔ f x ≠ x 
goal: 0 < (f.cycleOf x).support.card ↔ f x ≠ x

full_name: Equiv.Perm.pow_mod_orderOf_cycleOf_apply
code: theorem pow_mod_orderOf_cycleOf_apply (f : Perm α) [DecidableRel f.SameCycle] (n : ℕ) (x : α) :
    (f ^ (n % orderOf (cycleOf f x))) x = (f ^ n) x 
goal: (f ^ (n % orderOf (f.cycleOf x))) x = (f ^ n) x

full_name: Equiv.Perm.cycleOf_mul_of_apply_right_eq_self
code: theorem cycleOf_mul_of_apply_right_eq_self [DecidableRel (f * g).SameCycle]
    (h : Commute f g) (x : α) (hx : g x = x) : (f * g).cycleOf x = f.cycleOf x 
goal: (f * g).cycleOf x = f.cycleOf x

full_name: Equiv.Perm.Disjoint.cycleOf_mul_distrib
code: theorem Disjoint.cycleOf_mul_distrib [DecidableRel (f * g).SameCycle]
    [DecidableRel (g * f).SameCycle]  (h : f.Disjoint g) (x : α) :
    (f * g).cycleOf x = f.cycleOf x * g.cycleOf x 
goal: (f * g).cycleOf x = f.cycleOf x * g.cycleOf x

full_name: Equiv.Perm.support_cycleOf_eq_nil_iff
code: theorem support_cycleOf_eq_nil_iff [DecidableEq α] [Fintype α] :
    (f.cycleOf x).support = ∅ ↔ x ∉ f.support 
goal: (f.cycleOf x).support = ∅ ↔ x ∉ f.support

full_name: Equiv.Perm.support_cycleOf_le
code: theorem support_cycleOf_le [DecidableEq α] [Fintype α] (f : Perm α) (x : α) :
    support (f.cycleOf x) ≤ support f 
goal: (f.cycleOf x).support ≤ f.support

full_name: Equiv.Perm.mem_support_cycleOf_iff
code: theorem mem_support_cycleOf_iff [DecidableEq α] [Fintype α] :
    y ∈ support (f.cycleOf x) ↔ SameCycle f x y ∧ x ∈ support f 
goal: y ∈ (f.cycleOf x).support ↔ f.SameCycle x y ∧ x ∈ f.support

full_name: Equiv.Perm.mem_support_cycleOf_iff'
code: theorem mem_support_cycleOf_iff' (hx : f x ≠ x) [DecidableEq α] [Fintype α] :
    y ∈ support (f.cycleOf x) ↔ SameCycle f x y 
goal: y ∈ (f.cycleOf x).support ↔ f.SameCycle x y

full_name: Equiv.Perm.SameCycle.mem_support_iff
code: theorem SameCycle.mem_support_iff {f} [DecidableEq α] [Fintype α] (h : SameCycle f x y) :
    x ∈ support f ↔ y ∈ support f 
goal: x ∈ f.support ↔ y ∈ f.support

full_name: Equiv.Perm.pow_mod_card_support_cycleOf_self_apply
code: theorem pow_mod_card_support_cycleOf_self_apply [DecidableEq α] [Fintype α]
    (f : Perm α) (n : ℕ) (x : α) : (f ^ (n % (f.cycleOf x).support.card)) x = (f ^ n) x 
goal: (f ^ (n % (f.cycleOf x).support.card)) x = (f ^ n) x

full_name: Equiv.Perm.isCycle_cycleOf_iff
code: /-- `x` is in the support of `f` iff `Equiv.Perm.cycle_of f x` is a cycle. -/
theorem isCycle_cycleOf_iff (f : Perm α) [DecidableRel f.SameCycle] :
    IsCycle (cycleOf f x) ↔ f x ≠ x 
goal: (f.cycleOf x).IsCycle ↔ f x ≠ x

full_name: Equiv.Perm.isCycleOn_support_cycleOf
code: theorem isCycleOn_support_cycleOf [DecidableEq α] [Fintype α] (f : Perm α) (x : α) :
    f.IsCycleOn (f.cycleOf x).support 
goal: f.IsCycleOn ↑(f.cycleOf x).support

full_name: Equiv.Perm.SameCycle.exists_pow_eq_of_mem_support
code: theorem SameCycle.exists_pow_eq_of_mem_support {f} [DecidableEq α] [Fintype α] (h : SameCycle f x y)
    (hx : x ∈ f.support) : ∃ i < (f.cycleOf x).support.card, (f ^ i) x = y 
goal: ∃ i < (f.cycleOf x).support.card, (f ^ i) x = y

full_name: Equiv.Perm.SameCycle.exists_pow_eq
code: theorem SameCycle.exists_pow_eq [DecidableEq α] [Fintype α] (f : Perm α) (h : SameCycle f x y) :
    ∃ i : ℕ, 0 < i ∧ i ≤ (f.cycleOf x).support.card + 1 ∧ (f ^ i) x = y 
goal: ∃ i, 0 < i ∧ i ≤ (f.cycleOf x).support.card + 1 ∧ (f ^ i) x = y

full_name: Equiv.Perm.cycleFactorsAux
code: /-- Given a list `l : List α` and a permutation `f : Perm α` whose nonfixed points are all in `l`,
  recursively factors `f` into cycles. -/
def cycleFactorsAux [DecidableEq α] [Fintype α] :
    ∀ (l : List α) (f : Perm α),
      (∀ {x}, f x ≠ x → x ∈ l) →
        { l : List (Perm α) // l.prod = f ∧ (∀ g ∈ l, IsCycle g) ∧ l.Pairwise Disjoint } 
goal: (∀ {x : α}, f x ≠ x → x ∈ l) → { l // l.prod = f ∧ (∀ g ∈ l, g.IsCycle) ∧ List.Pairwise Equiv.Perm.Disjoint l }

full_name: Equiv.Perm.mem_list_cycles_iff
code: theorem mem_list_cycles_iff {α : Type*} [Finite α] {l : List (Perm α)}
    (h1 : ∀ σ : Perm α, σ ∈ l → σ.IsCycle) (h2 : l.Pairwise Disjoint) {σ : Perm α} :
    σ ∈ l ↔ σ.IsCycle ∧ ∀ a, σ a ≠ a → σ a = l.prod a 
goal: σ ∈ l ↔ σ.IsCycle ∧ ∀ (a : α), σ a ≠ a → σ a = l.prod a

full_name: Equiv.Perm.list_cycles_perm_list_cycles
code: theorem list_cycles_perm_list_cycles {α : Type*} [Finite α] {l₁ l₂ : List (Perm α)}
    (h₀ : l₁.prod = l₂.prod) (h₁l₁ : ∀ σ : Perm α, σ ∈ l₁ → σ.IsCycle)
    (h₁l₂ : ∀ σ : Perm α, σ ∈ l₂ → σ.IsCycle) (h₂l₁ : l₁.Pairwise Disjoint)
    (h₂l₂ : l₂.Pairwise Disjoint) : l₁ ~ l₂ 
goal: l₁.Perm l₂

full_name: Equiv.Perm.cycleFactors
code: /-- Factors a permutation `f` into a list of disjoint cyclic permutations that multiply to `f`. -/
def cycleFactors [Fintype α] [LinearOrder α] (f : Perm α) :
    { l : List (Perm α) // l.prod = f ∧ (∀ g ∈ l, IsCycle g) ∧ l.Pairwise Disjoint } 
goal: { l // l.prod = f ∧ (∀ g ∈ l, g.IsCycle) ∧ List.Pairwise Equiv.Perm.Disjoint l }

full_name: Equiv.Perm.truncCycleFactors
code: /-- Factors a permutation `f` into a list of disjoint cyclic permutations that multiply to `f`,
  without a linear order. -/
def truncCycleFactors [DecidableEq α] [Fintype α] (f : Perm α) :
    Trunc { l : List (Perm α) // l.prod = f ∧ (∀ g ∈ l, IsCycle g) ∧ l.Pairwise Disjoint } 
goal: Trunc { l // l.prod = f ∧ (∀ g ∈ l, g.IsCycle) ∧ List.Pairwise Equiv.Perm.Disjoint l }

full_name: Equiv.Perm.cycleFactorsFinset
code: /-- Factors a permutation `f` into a `Finset` of disjoint cyclic permutations that multiply to `f`.
-/
def cycleFactorsFinset : Finset (Perm α) 
goal: Finset (Equiv.Perm α)

full_name: Equiv.Perm.cycleFactorsFinset_eq_list_toFinset
code: theorem cycleFactorsFinset_eq_list_toFinset {σ : Perm α} {l : List (Perm α)} (hn : l.Nodup) :
    σ.cycleFactorsFinset = l.toFinset ↔
      (∀ f : Perm α, f ∈ l → f.IsCycle) ∧ l.Pairwise Disjoint ∧ l.prod = σ 
goal: σ.cycleFactorsFinset = l.toFinset ↔ (∀ f ∈ l, f.IsCycle) ∧ List.Pairwise Equiv.Perm.Disjoint l ∧ l.prod = σ

full_name: Equiv.Perm.cycleFactorsFinset_eq_finset
code: theorem cycleFactorsFinset_eq_finset {σ : Perm α} {s : Finset (Perm α)} :
    σ.cycleFactorsFinset = s ↔
      (∀ f : Perm α, f ∈ s → f.IsCycle) ∧
        ∃ h : (s : Set (Perm α)).Pairwise Disjoint,
          s.noncommProd id (h.mono' fun _ _ => Disjoint.commute) = σ 
goal: σ.cycleFactorsFinset = s ↔ (∀ f ∈ s, f.IsCycle) ∧ ∃ (h : (↑s).Pairwise Equiv.Perm.Disjoint), s.noncommProd id ⋯ = σ

full_name: Equiv.Perm.cycleFactorsFinset_pairwise_disjoint
code: theorem cycleFactorsFinset_pairwise_disjoint :
    (cycleFactorsFinset f : Set (Perm α)).Pairwise Disjoint 
goal: (↑f.cycleFactorsFinset).Pairwise Equiv.Perm.Disjoint

full_name: Equiv.Perm.cycleFactorsFinset_mem_commute
code: theorem cycleFactorsFinset_mem_commute : (cycleFactorsFinset f : Set (Perm α)).Pairwise Commute 
goal: (↑f.cycleFactorsFinset).Pairwise Commute

full_name: Equiv.Perm.cycleFactorsFinset_noncommProd
code: /-- The product of cycle factors is equal to the original `f : perm α`. -/
theorem cycleFactorsFinset_noncommProd
    (comm : (cycleFactorsFinset f : Set (Perm α)).Pairwise Commute :=
      cycleFactorsFinset_mem_commute f) :
    f.cycleFactorsFinset.noncommProd id comm = f 
goal: f.cycleFactorsFinset.noncommProd id comm = f

full_name: Equiv.Perm.mem_cycleFactorsFinset_iff
code: theorem mem_cycleFactorsFinset_iff {f p : Perm α} :
    p ∈ cycleFactorsFinset f ↔ p.IsCycle ∧ ∀ a ∈ p.support, p a = f a 
goal: p ∈ f.cycleFactorsFinset ↔ p.IsCycle ∧ ∀ a ∈ p.support, p a = f a

full_name: Equiv.Perm.cycleOf_mem_cycleFactorsFinset_iff
code: theorem cycleOf_mem_cycleFactorsFinset_iff {f : Perm α} {x : α} :
    cycleOf f x ∈ cycleFactorsFinset f ↔ x ∈ f.support 
goal: f.cycleOf x ∈ f.cycleFactorsFinset ↔ x ∈ f.support

full_name: Equiv.Perm.mem_cycleFactorsFinset_support_le
code: theorem mem_cycleFactorsFinset_support_le {p f : Perm α} (h : p ∈ cycleFactorsFinset f) :
    p.support ≤ f.support 
goal: p.support ≤ f.support

full_name: Equiv.Perm.cycleFactorsFinset_eq_empty_iff
code: theorem cycleFactorsFinset_eq_empty_iff {f : Perm α} : cycleFactorsFinset f = ∅ ↔ f = 1 
goal: f.cycleFactorsFinset = ∅ ↔ f = 1

full_name: Equiv.Perm.cycleFactorsFinset_one
code: @[simp]
theorem cycleFactorsFinset_one : cycleFactorsFinset (1 : Perm α) = ∅ 
goal: Equiv.Perm.cycleFactorsFinset 1 = ∅

full_name: Equiv.Perm.cycleFactorsFinset_eq_singleton_self_iff
code: @[simp]
theorem cycleFactorsFinset_eq_singleton_self_iff {f : Perm α} :
    f.cycleFactorsFinset = {f} ↔ f.IsCycle 
goal: f.cycleFactorsFinset = {f} ↔ f.IsCycle

full_name: Equiv.Perm.IsCycle.cycleFactorsFinset_eq_singleton
code: theorem IsCycle.cycleFactorsFinset_eq_singleton {f : Perm α} (hf : IsCycle f) :
    f.cycleFactorsFinset = {f} 
goal: f.cycleFactorsFinset = {f}

full_name: Equiv.Perm.cycleFactorsFinset_eq_singleton_iff
code: theorem cycleFactorsFinset_eq_singleton_iff {f g : Perm α} :
    f.cycleFactorsFinset = {g} ↔ f.IsCycle ∧ f = g 
goal: f.cycleFactorsFinset = {g} ↔ f.IsCycle ∧ f = g

full_name: Equiv.Perm.cycleFactorsFinset_injective
code: /-- Two permutations `f g : Perm α` have the same cycle factors iff they are the same. -/
theorem cycleFactorsFinset_injective : Function.Injective (@cycleFactorsFinset α _ _) 
goal: Function.Injective Equiv.Perm.cycleFactorsFinset

full_name: Equiv.Perm.Disjoint.disjoint_cycleFactorsFinset
code: theorem Disjoint.disjoint_cycleFactorsFinset {f g : Perm α} (h : Disjoint f g) :
    _root_.Disjoint (cycleFactorsFinset f) (cycleFactorsFinset g) 
goal: Disjoint f.cycleFactorsFinset g.cycleFactorsFinset

full_name: Equiv.Perm.Disjoint.cycleFactorsFinset_mul_eq_union
code: theorem Disjoint.cycleFactorsFinset_mul_eq_union {f g : Perm α} (h : Disjoint f g) :
    cycleFactorsFinset (f * g) = cycleFactorsFinset f ∪ cycleFactorsFinset g 
goal: (f * g).cycleFactorsFinset = f.cycleFactorsFinset ∪ g.cycleFactorsFinset

full_name: Equiv.Perm.disjoint_mul_inv_of_mem_cycleFactorsFinset
code: theorem disjoint_mul_inv_of_mem_cycleFactorsFinset {f g : Perm α} (h : f ∈ cycleFactorsFinset g) :
    Disjoint (g * f⁻¹) f 
goal: (g * f⁻¹).Disjoint f

full_name: Equiv.Perm.cycle_is_cycleOf
code: /-- If c is a cycle, a ∈ c.support and c is a cycle of f, then `c = f.cycleOf a` -/
theorem cycle_is_cycleOf {f c : Equiv.Perm α} {a : α} (ha : a ∈ c.support)
    (hc : c ∈ f.cycleFactorsFinset) : c = f.cycleOf a 
goal: c = f.cycleOf a

full_name: Equiv.Perm.cycle_induction_on
code: @[elab_as_elim]
theorem cycle_induction_on [Finite β] (P : Perm β → Prop) (σ : Perm β) (base_one : P 1)
    (base_cycles : ∀ σ : Perm β, σ.IsCycle → P σ)
    (induction_disjoint : ∀ σ τ : Perm β,
      Disjoint σ τ → IsCycle σ → P σ → P τ → P (σ * τ)) : P σ 
goal: P σ

full_name: Equiv.Perm.cycleFactorsFinset_mul_inv_mem_eq_sdiff
code: theorem cycleFactorsFinset_mul_inv_mem_eq_sdiff [DecidableEq α] [Fintype α] {f g : Perm α}
    (h : f ∈ cycleFactorsFinset g) : cycleFactorsFinset (g * f⁻¹) = cycleFactorsFinset g \ {f} 
goal: (g * f⁻¹).cycleFactorsFinset = g.cycleFactorsFinset \ {f}