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

full_name: List.formPerm_disjoint_iff
code: theorem formPerm_disjoint_iff (hl : Nodup l) (hl' : Nodup l') (hn : 2 ≤ l.length)
    (hn' : 2 ≤ l'.length) : Perm.Disjoint (formPerm l) (formPerm l') ↔ l.Disjoint l' 
goal: l.formPerm.Disjoint l'.formPerm ↔ l.Disjoint l'

full_name: List.isCycle_formPerm
code: theorem isCycle_formPerm (hl : Nodup l) (hn : 2 ≤ l.length) : IsCycle (formPerm l) 
goal: l.formPerm.IsCycle

full_name: List.pairwise_sameCycle_formPerm
code: theorem pairwise_sameCycle_formPerm (hl : Nodup l) (hn : 2 ≤ l.length) :
    Pairwise l.formPerm.SameCycle l 
goal: List.Pairwise l.formPerm.SameCycle l

full_name: List.cycleOf_formPerm
code: theorem cycleOf_formPerm (hl : Nodup l) (hn : 2 ≤ l.length) (x) :
    cycleOf l.attach.formPerm x = l.attach.formPerm 
goal: l.attach.formPerm.cycleOf x = l.attach.formPerm

full_name: List.cycleType_formPerm
code: theorem cycleType_formPerm (hl : Nodup l) (hn : 2 ≤ l.length) :
    cycleType l.attach.formPerm = {l.length} 
goal: l.attach.formPerm.cycleType = {l.length}

full_name: List.formPerm_apply_mem_eq_next
code: theorem formPerm_apply_mem_eq_next (hl : Nodup l) (x : α) (hx : x ∈ l) :
    formPerm l x = next l x hx 
goal: l.formPerm x = l.next x hx

full_name: Cycle.formPerm
code: /-- A cycle `s : Cycle α`, given `Nodup s` can be interpreted as an `Equiv.Perm α`
where each element in the list is permuted to the next one, defined as `formPerm`.
-/
def formPerm : ∀ s : Cycle α, Nodup s → Equiv.Perm α 
goal: s.Nodup → Equiv.Perm α

full_name: Cycle.formPerm_coe
code: @[simp]
theorem formPerm_coe (l : List α) (hl : l.Nodup) : formPerm (l : Cycle α) hl = l.formPerm 
goal: (↑l).formPerm hl = l.formPerm

full_name: Cycle.formPerm_subsingleton
code: theorem formPerm_subsingleton (s : Cycle α) (h : Subsingleton s) : formPerm s h.nodup = 1 
goal: s.formPerm ⋯ = 1

full_name: Cycle.isCycle_formPerm
code: theorem isCycle_formPerm (s : Cycle α) (h : Nodup s) (hn : Nontrivial s) :
    IsCycle (formPerm s h) 
goal: (s.formPerm h).IsCycle

full_name: Cycle.support_formPerm
code: theorem support_formPerm [Fintype α] (s : Cycle α) (h : Nodup s) (hn : Nontrivial s) :
    support (formPerm s h) = s.toFinset 
goal: (s.formPerm h).support = s.toFinset

full_name: Cycle.formPerm_eq_self_of_not_mem
code: theorem formPerm_eq_self_of_not_mem (s : Cycle α) (h : Nodup s) (x : α) (hx : x ∉ s) :
    formPerm s h x = x 
goal: (s.formPerm h) x = x

full_name: Cycle.formPerm_apply_mem_eq_next
code: theorem formPerm_apply_mem_eq_next (s : Cycle α) (h : Nodup s) (x : α) (hx : x ∈ s) :
    formPerm s h x = next s h x hx 
goal: (s.formPerm h) x = s.next h x hx

full_name: Cycle.formPerm_reverse
code: nonrec theorem formPerm_reverse (s : Cycle α) (h : Nodup s) :
    formPerm s.reverse (nodup_reverse_iff.mpr h) = (formPerm s h)⁻¹ 
goal: s.reverse.formPerm ⋯ = (s.formPerm h)⁻¹

full_name: Cycle.formPerm_eq_formPerm_iff
code: nonrec theorem formPerm_eq_formPerm_iff {α : Type*} [DecidableEq α] {s s' : Cycle α} {hs : s.Nodup}
    {hs' : s'.Nodup} :
    s.formPerm hs = s'.formPerm hs' ↔ s = s' ∨ s.Subsingleton ∧ s'.Subsingleton 
goal: s.formPerm hs = s'.formPerm hs' ↔ s = s' ∨ s.Subsingleton ∧ s'.Subsingleton

full_name: Equiv.Perm.toList
code: /-- `Equiv.Perm.toList (f : Perm α) (x : α)` generates the list `[x, f x, f (f x), ...]`
until looping. That means when `f x = x`, `toList f x = []`.
-/
def toList : List α 
goal: List α

full_name: Equiv.Perm.toList_one
code: @[simp]
theorem toList_one : toList (1 : Perm α) x = [] 
goal: Equiv.Perm.toList 1 x = []

full_name: Equiv.Perm.toList_eq_nil_iff
code: @[simp]
theorem toList_eq_nil_iff {p : Perm α} {x} : toList p x = [] ↔ x ∉ p.support 
goal: p.toList x = [] ↔ x ∉ p.support

full_name: Equiv.Perm.length_toList
code: @[simp]
theorem length_toList : length (toList p x) = (cycleOf p x).support.card 
goal: (p.toList x).length = (p.cycleOf x).support.card

full_name: Equiv.Perm.toList_ne_singleton
code: theorem toList_ne_singleton (y : α) : toList p x ≠ [y] 
goal: p.toList x ≠ [y]

full_name: Equiv.Perm.two_le_length_toList_iff_mem_support
code: theorem two_le_length_toList_iff_mem_support {p : Perm α} {x : α} :
    2 ≤ length (toList p x) ↔ x ∈ p.support 
goal: 2 ≤ (p.toList x).length ↔ x ∈ p.support

full_name: Equiv.Perm.length_toList_pos_of_mem_support
code: theorem length_toList_pos_of_mem_support (h : x ∈ p.support) : 0 < length (toList p x) 
goal: 0 < (p.toList x).length

full_name: Equiv.Perm.get_toList
code: theorem get_toList (n : ℕ) (hn : n < length (toList p x)) :
    (toList p x).get ⟨n, hn⟩ = (p ^ n) x 
goal: (p.toList x).get ⟨n, hn⟩ = (p ^ n) x

full_name: Equiv.Perm.toList_get_zero
code: theorem toList_get_zero (h : x ∈ p.support) :
    (toList p x).get ⟨0, (length_toList_pos_of_mem_support _ _ h)⟩ = x 
goal: (p.toList x).get ⟨0, ⋯⟩ = x

full_name: Equiv.Perm.nthLe_toList
code: @[deprecated get_toList (since := "2024-05-08")]
theorem nthLe_toList (n : ℕ) (hn : n < length (toList p x)) :
    (toList p x).nthLe n hn = (p ^ n) x 
goal: (p.toList x).nthLe n hn = (p ^ n) x

full_name: Equiv.Perm.toList_nthLe_zero
code: @[deprecated toList_get_zero (since := "2024-05-08")]
theorem toList_nthLe_zero (h : x ∈ p.support) :
    (toList p x).nthLe 0 (length_toList_pos_of_mem_support _ _ h) = x 
goal: (p.toList x).nthLe 0 ⋯ = x

full_name: Equiv.Perm.mem_toList_iff
code: theorem mem_toList_iff {y : α} : y ∈ toList p x ↔ SameCycle p x y ∧ x ∈ p.support 
goal: y ∈ p.toList x ↔ p.SameCycle x y ∧ x ∈ p.support

full_name: Equiv.Perm.nodup_toList
code: theorem nodup_toList (p : Perm α) (x : α) : Nodup (toList p x) 
goal: (p.toList x).Nodup

full_name: Equiv.Perm.next_toList_eq_apply
code: theorem next_toList_eq_apply (p : Perm α) (x y : α) (hy : y ∈ toList p x) :
    next (toList p x) y hy = p y 
goal: (p.toList x).next y hy = p y

full_name: Equiv.Perm.toList_pow_apply_eq_rotate
code: theorem toList_pow_apply_eq_rotate (p : Perm α) (x : α) (k : ℕ) :
    p.toList ((p ^ k) x) = (p.toList x).rotate k 
goal: p.toList ((p ^ k) x) = (p.toList x).rotate k

full_name: Equiv.Perm.SameCycle.toList_isRotated
code: theorem SameCycle.toList_isRotated {f : Perm α} {x y : α} (h : SameCycle f x y) :
    toList f x ~r toList f y 
goal: f.toList x ~r f.toList y

full_name: Equiv.Perm.pow_apply_mem_toList_iff_mem_support
code: theorem pow_apply_mem_toList_iff_mem_support {n : ℕ} : (p ^ n) x ∈ p.toList x ↔ x ∈ p.support 
goal: (p ^ n) x ∈ p.toList x ↔ x ∈ p.support

full_name: Equiv.Perm.toList_formPerm_nil
code: theorem toList_formPerm_nil (x : α) : toList (formPerm ([] : List α)) x = [] 
goal: [].formPerm.toList x = []

full_name: Equiv.Perm.toList_formPerm_singleton
code: theorem toList_formPerm_singleton (x y : α) : toList (formPerm [x]) y = [] 
goal: [x].formPerm.toList y = []

full_name: Equiv.Perm.toList_formPerm_nontrivial
code: theorem toList_formPerm_nontrivial (l : List α) (hl : 2 ≤ l.length) (hn : Nodup l) :
    toList (formPerm l) (l.get ⟨0, (zero_lt_two.trans_le hl)⟩) = l 
goal: l.formPerm.toList (l.get ⟨0, ⋯⟩) = l

full_name: Equiv.Perm.toList_formPerm_isRotated_self
code: theorem toList_formPerm_isRotated_self (l : List α) (hl : 2 ≤ l.length) (hn : Nodup l) (x : α)
    (hx : x ∈ l) : toList (formPerm l) x ~r l 
goal: l.formPerm.toList x ~r l

full_name: Equiv.Perm.formPerm_toList
code: theorem formPerm_toList (f : Perm α) (x : α) : formPerm (toList f x) = f.cycleOf x 
goal: (f.toList x).formPerm = f.cycleOf x

full_name: Equiv.Perm.toCycle
code: /-- Given a cyclic `f : Perm α`, generate the `Cycle α` in the order
of application of `f`. Implemented by finding an element `x : α`
in the support of `f` in `Finset.univ`, and iterating on using
`Equiv.Perm.toList f x`.
-/
def toCycle (f : Perm α) (hf : IsCycle f) : Cycle α 
goal: Cycle α

full_name: Equiv.Perm.toCycle_eq_toList
code: theorem toCycle_eq_toList (f : Perm α) (hf : IsCycle f) (x : α) (hx : f x ≠ x) :
    toCycle f hf = toList f x 
goal: f.toCycle hf = ↑(f.toList x)

full_name: Equiv.Perm.nodup_toCycle
code: theorem nodup_toCycle (f : Perm α) (hf : IsCycle f) : (toCycle f hf).Nodup 
goal: (f.toCycle hf).Nodup

full_name: Equiv.Perm.nontrivial_toCycle
code: theorem nontrivial_toCycle (f : Perm α) (hf : IsCycle f) : (toCycle f hf).Nontrivial 
goal: (f.toCycle hf).Nontrivial

full_name: Equiv.Perm.isoCycle
code: /-- Any cyclic `f : Perm α` is isomorphic to the nontrivial `Cycle α`
that corresponds to repeated application of `f`.
The forward direction is implemented by `Equiv.Perm.toCycle`.
-/
def isoCycle : { f : Perm α // IsCycle f } ≃ { s : Cycle α // s.Nodup ∧ s.Nontrivial } 
goal: { f // f.IsCycle } ≃ { s // s.Nodup ∧ s.Nontrivial }

full_name: Equiv.Perm.IsCycle.existsUnique_cycle
code: theorem IsCycle.existsUnique_cycle {f : Perm α} (hf : IsCycle f) :
    ∃! s : Cycle α, ∃ h : s.Nodup, s.formPerm h = f 
goal: ∃! s, ∃ (h : s.Nodup), s.formPerm h = f

full_name: Equiv.Perm.IsCycle.existsUnique_cycle_subtype
code: theorem IsCycle.existsUnique_cycle_subtype {f : Perm α} (hf : IsCycle f) :
    ∃! s : { s : Cycle α // s.Nodup }, (s : Cycle α).formPerm s.prop = f 
goal: ∃! s, (↑s).formPerm ⋯ = f

full_name: Equiv.Perm.IsCycle.existsUnique_cycle_nontrivial_subtype
code: theorem IsCycle.existsUnique_cycle_nontrivial_subtype {f : Perm α} (hf : IsCycle f) :
    ∃! s : { s : Cycle α // s.Nodup ∧ s.Nontrivial }, (s : Cycle α).formPerm s.prop.left = f 
goal: ∃! s, (↑s).formPerm ⋯ = f

full_name: Equiv.Perm.isoCycle'
code: /-- Any cyclic `f : Perm α` is isomorphic to the nontrivial `Cycle α`
that corresponds to repeated application of `f`.
The forward direction is implemented by finding this `Cycle α` using `Fintype.choose`.
-/
def isoCycle' : { f : Perm α // IsCycle f } ≃ { s : Cycle α // s.Nodup ∧ s.Nontrivial } 
goal: { f // f.IsCycle } ≃ { s // s.Nodup ∧ s.Nontrivial }

full_name: Equiv.Perm.«_aux_Mathlib_GroupTheory_Perm_Cycle_Concrete___macroRules_Equiv_Perm_termC[_,]_1»
code: notation3 (prettyPrint := false) "c["(l", "* => foldr (h t => List.cons h t) List.nil)"]" =>
  Cycle.formPerm (Cycle.ofList l) (Iff.mpr Cycle.nodup_coe_iff (by decide))
goal: Lean.Macro

full_name: Equiv.Perm.repr_perm
code: unsafe instance repr_perm [Repr α] : Repr (Perm α) 
goal: Repr (Equiv.Perm α)