Mathlib.GroupTheory.Perm.Cycle.Concrete
52 declarations. Mathlib docs · Source
Properties of cyclic permutations constructed from lists/cycles
In the following, {α : Type*} [Fintype α] [DecidableEq α].
Main definitions
Cycle.formPerm: the cyclic permutation created by looping over aCycle αEquiv.Perm.toList: the list formed by iterating application of a permutationEquiv.Perm.toCycle: the cycle formed by iterating application of a permutationEquiv.Perm.isoCycle: the equivalence between cyclic permutationsf : Perm αand the terms ofCycle αthat correspond to themEquiv.Perm.isoCycle': the same equivalence asEquiv.Perm.isoCyclebut with evaluation via choosing over fintypes- The notation
c[1, 2, 3]to emulate notation of cyclic permutations(1 2 3) - A
Reprinstance for anyPerm α, by representing theFinsetofCycle αthat correspond to the cycle factors.
Main results
List.isCycle_formPerm: a nontrivial list without duplicates, when interpreted as a permutation, is cyclicEquiv.Perm.IsCycle.existsUnique_cycle: there is only one nontrivialCycle αcorresponding to each cyclicf : Perm α
Implementation notes
The forward direction of Equiv.Perm.isoCycle' uses Fintype.choose of the uniqueness
result, relying on the Fintype instance of a Cycle.Nodup subtype.
It is unclear if this works faster than the Equiv.Perm.toCycle, which relies
on recursion over Finset.univ.
theorem Multiset.recOn.congr_simp E1 #
∀ {α : Type u_1} {C : Multiset α → Sort u_3} (m : Multiset α) (C_0 C_0_1 : C 0),
C_0 = C_0_1 →
∀ (C_cons C_cons_1 : (a : α) → (m : Multiset α) → C m → C (a ::ₘ m)) (e_C_cons : C_cons = C_cons_1)
(C_cons_heq :
∀ (a a' : α) (m : Multiset α) (b : C m),
C_cons a (a' ::ₘ m) (C_cons a' m b) ≍ C_cons a' (a ::ₘ m) (C_cons a m b)),
m.recOn C_0 C_cons C_cons_heq = m.recOn C_0_1 C_cons_1 ⋯
theorem Cycle.formPerm.congr_simp E1 #
∀ {α : Type u_1} [inst : DecidableEq α] (s s_1 : Cycle α) (e_s : s = s_1) (a : s.Nodup), s.formPerm a = s_1.formPerm ⋯
theorem Equiv.Perm.toCycle.congr_simp E1 #
∀ {α : Type u_1} [inst : Fintype α] [inst_1 : DecidableEq α] (f f_1 : Equiv.Perm α) (e_f : f = f_1) (hf : f.IsCycle),
f.toCycle hf = f_1.toCycle ⋯
theorem List.formPerm_disjoint_iff E0 #
∀ {α : Type u_1} [inst : DecidableEq α] {l l' : List α},
l.Nodup → l'.Nodup → 2 ≤ l.length → 2 ≤ l'.length → (l.formPerm.Disjoint l'.formPerm ↔ l.Disjoint l')
theorem List.isCycle_formPerm E3 #
∀ {α : Type u_1} [inst : DecidableEq α] {l : List α}, l.Nodup → 2 ≤ l.length → l.formPerm.IsCycle
theorem List.pairwise_sameCycle_formPerm E1 #
∀ {α : Type u_1} [inst : DecidableEq α] {l : List α}, l.Nodup → 2 ≤ l.length → List.Pairwise l.formPerm.SameCycle l
theorem List.cycleOf_formPerm E1 #
∀ {α : Type u_1} [inst : DecidableEq α] {l : List α},
l.Nodup → 2 ≤ l.length → ∀ (x : { x // x ∈ l }), l.attach.formPerm.cycleOf x = l.attach.formPerm
theorem List.cycleType_formPerm E1 #
∀ {α : Type u_1} [inst : DecidableEq α] {l : List α}, l.Nodup → 2 ≤ l.length → l.attach.formPerm.cycleType = {l.length}
theorem List.formPerm_apply_mem_eq_next E1 #
∀ {α : Type u_1} [inst : DecidableEq α] {l : List α}, l.Nodup → ∀ (x : α) (hx : x ∈ l), l.formPerm x = l.next x hx
def Cycle.formPerm E3 #
{α : Type u_1} → [DecidableEq α] → (s : Cycle α) → s.Nodup → Equiv.Perm α
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.
theorem Cycle.formPerm_coe E0 #
∀ {α : Type u_1} [inst : DecidableEq α] (l : List α) (hl : l.Nodup), (↑l).formPerm hl = l.formPerm
theorem Cycle.formPerm_subsingleton E1 #
∀ {α : Type u_1} [inst : DecidableEq α] (s : Cycle α) (h : s.Subsingleton), s.formPerm ⋯ = 1
theorem Cycle.isCycle_formPerm E1 #
∀ {α : Type u_1} [inst : DecidableEq α] (s : Cycle α) (h : s.Nodup), s.Nontrivial → (s.formPerm h).IsCycle
theorem Cycle.support_formPerm E1 #
∀ {α : Type u_1} [inst : DecidableEq α] [inst_1 : Fintype α] (s : Cycle α) (h : s.Nodup),
s.Nontrivial → (s.formPerm h).support = s.toFinset
theorem Cycle.formPerm_eq_self_of_notMem E1 #
∀ {α : Type u_1} [inst : DecidableEq α] (s : Cycle α) (h : s.Nodup), ∀ x ∉ s, (s.formPerm h) x = x
theorem Cycle.formPerm_apply_mem_eq_next E1 #
∀ {α : Type u_1} [inst : DecidableEq α] (s : Cycle α) (h : s.Nodup) (x : α) (hx : x ∈ s),
(s.formPerm h) x = s.next h x hx
theorem Cycle.formPerm_reverse E1 #
∀ {α : Type u_1} [inst : DecidableEq α] (s : Cycle α) (h : s.Nodup), s.reverse.formPerm ⋯ = (s.formPerm h)⁻¹
theorem Cycle.formPerm_eq_formPerm_iff E0 #
∀ {α : Type u_2} [inst : DecidableEq α] {s s' : Cycle α} {hs : s.Nodup} {hs' : s'.Nodup},
s.formPerm hs = s'.formPerm hs' ↔ s = s' ∨ s.Subsingleton ∧ s'.Subsingleton
def Equiv.Perm.toList E3 #
{α : Type u_1} → [Fintype α] → [DecidableEq α] → Equiv.Perm α → α → List α
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 = [].
theorem Equiv.Perm.toList_one E0 #
∀ {α : Type u_1} [inst : Fintype α] [inst_1 : DecidableEq α] (x : α), Equiv.Perm.toList 1 x = []
theorem Equiv.Perm.toList_eq_nil_iff E0 #
∀ {α : Type u_1} [inst : Fintype α] [inst_1 : DecidableEq α] {p : Equiv.Perm α} {x : α}, p.toList x = [] ↔ x ∉ p.support
theorem Equiv.Perm.length_toList E0 #
∀ {α : Type u_1} [inst : Fintype α] [inst_1 : DecidableEq α] (p : Equiv.Perm α) (x : α),
(p.toList x).length = (p.cycleOf x).support.card
theorem Equiv.Perm.toList_ne_singleton E1 #
∀ {α : Type u_1} [inst : Fintype α] [inst_1 : DecidableEq α] (p : Equiv.Perm α) (x y : α), p.toList x ≠ [y]
theorem Equiv.Perm.two_le_length_toList_iff_mem_support E1 #
∀ {α : Type u_1} [inst : Fintype α] [inst_1 : DecidableEq α] {p : Equiv.Perm α} {x : α},
2 ≤ (p.toList x).length ↔ x ∈ p.support
theorem Equiv.Perm.length_toList_pos_of_mem_support E1 #
∀ {α : Type u_1} [inst : Fintype α] [inst_1 : DecidableEq α] (p : Equiv.Perm α),
∀ x ∈ p.support, 0 < (p.toList x).length
theorem Equiv.Perm.getElem_toList E1 #
∀ {α : Type u_1} [inst : Fintype α] [inst_1 : DecidableEq α] (p : Equiv.Perm α) (x : α) (n : ℕ)
(hn : n < (p.toList x).length), (p.toList x)[n] = (p ^ n) x
theorem Equiv.Perm.toList_getElem_zero E1 #
∀ {α : Type u_1} [inst : Fintype α] [inst_1 : DecidableEq α] (p : Equiv.Perm α) (x : α) (h : x ∈ p.support),
(p.toList x)[0] = x
theorem Equiv.Perm.mem_toList_iff E0 #
∀ {α : Type u_1} [inst : Fintype α] [inst_1 : DecidableEq α] {p : Equiv.Perm α} {x y : α},
y ∈ p.toList x ↔ p.SameCycle x y ∧ x ∈ p.support
theorem Equiv.Perm.nodup_toList E1 #
∀ {α : Type u_1} [inst : Fintype α] [inst_1 : DecidableEq α] (p : Equiv.Perm α) (x : α), (p.toList x).Nodup
theorem Equiv.Perm.next_toList_eq_apply E0 #
∀ {α : Type u_1} [inst : Fintype α] [inst_1 : DecidableEq α] (p : Equiv.Perm α) (x y : α) (hy : y ∈ p.toList x),
(p.toList x).next y hy = p y
theorem Equiv.Perm.toList_pow_apply_eq_rotate E1 #
∀ {α : Type u_1} [inst : Fintype α] [inst_1 : DecidableEq α] (p : Equiv.Perm α) (x : α) (k : ℕ),
p.toList ((p ^ k) x) = (p.toList x).rotate k
theorem Equiv.Perm.SameCycle.toList_isRotated E1 #
∀ {α : Type u_1} [inst : Fintype α] [inst_1 : DecidableEq α] {f : Equiv.Perm α} {x y : α},
f.SameCycle x y → f.toList x ~r f.toList y
theorem Equiv.Perm.pow_apply_mem_toList_iff_mem_support E1 #
∀ {α : Type u_1} [inst : Fintype α] [inst_1 : DecidableEq α] {p : Equiv.Perm α} {x : α} {n : ℕ},
(p ^ n) x ∈ p.toList x ↔ x ∈ p.support
theorem Equiv.Perm.toList_formPerm_nil E1 #
∀ {α : Type u_1} [inst : Fintype α] [inst_1 : DecidableEq α] (x : α), [].formPerm.toList x = []
theorem Equiv.Perm.toList_formPerm_singleton E1 #
∀ {α : Type u_1} [inst : Fintype α] [inst_1 : DecidableEq α] (x y : α), [x].formPerm.toList y = []
theorem Equiv.Perm.toList_formPerm_nontrivial E1 #
∀ {α : Type u_1} [inst : Fintype α] [inst_1 : DecidableEq α] (l : List α) (hl : 2 ≤ l.length),
l.Nodup → l.formPerm.toList (l.get ⟨0, ⋯⟩) = l
theorem Equiv.Perm.toList_formPerm_isRotated_self E1 #
∀ {α : Type u_1} [inst : Fintype α] [inst_1 : DecidableEq α] (l : List α),
2 ≤ l.length → l.Nodup → ∀ x ∈ l, l.formPerm.toList x ~r l
theorem Equiv.Perm.formPerm_toList E1 #
∀ {α : Type u_1} [inst : Fintype α] [inst_1 : DecidableEq α] (f : Equiv.Perm α) (x : α),
(f.toList x).formPerm = f.cycleOf x
def Equiv.Perm.toCycle E3 #
{α : Type u_1} → [Fintype α] → [DecidableEq α] → (f : Equiv.Perm α) → f.IsCycle → Cycle α
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.
theorem Equiv.Perm.toCycle_eq_toList E1 #
∀ {α : Type u_1} [inst : Fintype α] [inst_1 : DecidableEq α] (f : Equiv.Perm α) (hf : f.IsCycle) (x : α),
f x ≠ x → f.toCycle hf = ↑(f.toList x)
theorem Equiv.Perm.exists_toCycle_toList E1 #
∀ {α : Type u_1} [inst : Fintype α] [inst_1 : DecidableEq α] (f : Equiv.Perm α) (hf : f.IsCycle),
∃ x, f.toCycle hf = ↑(f.toList x)
theorem Equiv.Perm.nodup_toCycle E1 #
∀ {α : Type u_1} [inst : Fintype α] [inst_1 : DecidableEq α] (f : Equiv.Perm α) (hf : f.IsCycle), (f.toCycle hf).Nodup
theorem Equiv.Perm.nontrivial_toCycle E1 #
∀ {α : Type u_1} [inst : Fintype α] [inst_1 : DecidableEq α] (f : Equiv.Perm α) (hf : f.IsCycle),
(f.toCycle hf).Nontrivial
theorem Equiv.Perm.mem_toCycle_iff_support E0 #
∀ {α : Type u_1} [inst : Fintype α] [inst_1 : DecidableEq α] {x : α} (f : Equiv.Perm α) (hf : f.IsCycle),
x ∈ f.toCycle hf ↔ f x ≠ x
theorem Equiv.Perm.toCycle_next E0 #
∀ {α : Type u_1} [inst : Fintype α] [inst_1 : DecidableEq α] {x : α} (f : Equiv.Perm α) (hf : f.IsCycle)
(hx : x ∈ f.toCycle hf), (f.toCycle hf).next ⋯ x hx = f x
def Equiv.Perm.isoCycle E3 #
{α : Type u_1} → [Fintype α] → [DecidableEq α] → { f // f.IsCycle } ≃ { s // s.Nodup ∧ s.Nontrivial }
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.
theorem Equiv.Perm.IsCycle.existsUnique_cycle E3 #
∀ {α : Type u_1} [Finite α] [inst : DecidableEq α] {f : Equiv.Perm α},
f.IsCycle → ∃! s, ∃ (h : s.Nodup), s.formPerm h = f
theorem Equiv.Perm.IsCycle.existsUnique_cycle_subtype E1 #
∀ {α : Type u_1} [Finite α] [inst : DecidableEq α] {f : Equiv.Perm α}, f.IsCycle → ∃! s, (↑s).formPerm ⋯ = f
theorem Equiv.Perm.IsCycle.existsUnique_cycle_nontrivial_subtype E1 #
∀ {α : Type u_1} [Finite α] [inst : DecidableEq α] {f : Equiv.Perm α}, f.IsCycle → ∃! s, (↑s).formPerm ⋯ = f
def Equiv.Perm.isoCycle' E3 #
{α : Type u_1} → [Fintype α] → [DecidableEq α] → { f // f.IsCycle } ≃ { s // s.Nodup ∧ s.Nontrivial }
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 Equiv.Perm.«termC[_,]» E1 #
Lean.ParserDescr
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.
instance Equiv.Perm.instRepr E0 #
{α : Type u_1} → [Fintype α] → [DecidableEq α] → [Repr α] → Repr (Equiv.Perm α)
Represents a permutation as product of disjoint cycles:
#eval (c[0, 1, 2, 3] : Perm (Fin 4))
-- c[0, 1, 2, 3]
#eval (c[3, 1] * c[0, 2] : Perm (Fin 4))
-- c[0, 2] * c[1, 3]
#eval (c[1, 2, 3] * c[0, 1, 2] : Perm (Fin 4))
-- c[0, 2] * c[1, 3]
#eval (c[1, 2, 3] * c[0, 1, 2] * c[3, 1] * c[0, 2] : Perm (Fin 4))
-- 1