Properties of cyclic permutations constructed from lists/cycles #
THIS FILE IS SYNCHRONIZED WITH MATHLIB4. Any changes to this file require a corresponding PR to mathlib4.
In the following, {α : Type*} [fintype α] [decidable_eq α]
.
Main definitions #
cycle.form_perm
: the cyclic permutation created by looping over acycle α
equiv.perm.to_list
: the list formed by iterating application of a permutationequiv.perm.to_cycle
: the cycle formed by iterating application of a permutationequiv.perm.iso_cycle
: the equivalence between cyclic permutationsf : perm α
and the terms ofcycle α
that correspond to themequiv.perm.iso_cycle'
: the same equivalence asequiv.perm.iso_cycle
but with evaluation via choosing over fintypes- The notation
c[1, 2, 3]
to emulate notation of cyclic permutations(1 2 3)
- A
has_repr
instance for anyperm α
, by representing thefinset
ofcycle α
that correspond to the cycle factors.
Main results #
list.is_cycle_form_perm
: a nontrivial list without duplicates, when interpreted as a permutation, is cyclicequiv.perm.is_cycle.exists_unique_cycle
: there is only one nontrivialcycle α
corresponding to each cyclicf : perm α
Implementation details #
The forward direction of equiv.perm.iso_cycle'
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.to_cycle
, 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 a equiv.perm α
where each element in the list is permuted to the next one, defined as form_perm
.
Equations
- cycle.form_perm = λ (s : cycle α), quot.hrec_on s (λ (l : list α) (h : cycle.nodup (quot.mk setoid.r l)), l.form_perm) cycle.form_perm._proof_1
equiv.perm.to_list (f : perm α) (x : α)
generates the list [x, f x, f (f x), ...]
until looping. That means when f x = x
, to_list f x = []
.
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.to_list f x
.
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.to_cycle
.
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
.