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.isoCycle
but with evaluation via choosing over fintypes- The notation
c[1, 2, 3]
to emulate notation of cyclic permutations(1 2 3)
- A
Repr
instance for anyPerm α
, by representing theFinset
ofCycle α
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
.
Running #eval
on even a simple noncyclic permutation c[(1 : Fin 7), 2, 3] * c[0, 5]
to show it takes a long time. TODO: is this because computing the cycle factors is slow?
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
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 = []
.
Equations
- p.toList x = List.map (fun (k : ℕ) => (p ^ k) x) (List.range (p.cycleOf x).support.card)
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
- Equiv.Perm.isoCycle' = { toFun := Fintype.bijInv ⋯, invFun := fun (s : { s : Cycle α // s.Nodup ∧ s.Nontrivial }) => ⟨(↑s).formPerm ⋯, ⋯⟩, left_inv := ⋯, right_inv := ⋯ }
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- One or more equations did not get rendered due to their size.