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 details #
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.
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.
Equations
- s.formPerm = Quotient.hrecOn (motive := fun (x : Cycle α) => x.Nodup → Equiv.Perm α) s (fun (l : List α) (x : Cycle.Nodup ⟦l⟧) => l.formPerm) ⋯
Instances For
Alias of Cycle.formPerm_eq_self_of_notMem.
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 = [].
Instances For
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.
Equations
Instances For
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.
Equations
- One or more equations did not get rendered due to their size.
Instances For
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.
Equations
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
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
Equations
- One or more equations did not get rendered due to their size.