Cyclic permutations #
THIS FILE IS SYNCHRONIZED WITH MATHLIB4. Any changes to this file require a corresponding PR to mathlib4.
This file develops the theory of cycles in permutations.
Main definitions #
In the following, f : equiv.perm β
.
equiv.perm.same_cycle
:f.same_cycle x y
whenx
andy
are in the same cycle off
.equiv.perm.is_cycle
:f
is a cycle if any two nonfixed points off
are related by repeated applications off
, andf
is not the identity.equiv.perm.is_cycle_on
:f
is a cycle on a sets
when any two points ofs
are related by repeated applications off
.
The following two definitions require that β
is a fintype
:
equiv.perm.cycle_of
:f.cycle_of x
is the cycle off
thatx
belongs to.equiv.perm.cycle_factors
:f.cycle_factors
is a list of disjoint cyclic permutations that multiply tof
.
Main results #
- This file contains several closure results:
closure_is_cycle
: The symmetric group is generated by cyclesclosure_cycle_adjacent_swap
: The symmetric group is generated by a cycle and an adjacent transpositionclosure_cycle_coprime_swap
: The symmetric group is generated by a cycle and a coprime transpositionclosure_prime_cycle_swap
: The symmetric group is generated by a prime cycle and a transposition
Notes #
equiv.perm.is_cycle
and equiv.perm.is_cycle_on
are different in three ways:
is_cycle
is about the entire type whileis_cycle_on
is restricted to a set.is_cycle
forbids the identity whileis_cycle_on
allows it (ifs
is a subsingleton).is_cycle_on
forbids fixed points ons
(ifs
is nontrivial), whileis_cycle
allows them.
same_cycle
#
The equivalence relation indicating that two points are in the same cycle of a permutation.
Instances for equiv.perm.same_cycle
Alias of the forward direction of equiv.perm.same_cycle_inv
.
Alias of the reverse direction of equiv.perm.same_cycle_inv
.
Alias of the forward direction of equiv.perm.same_cycle_apply_left
.
Alias of the reverse direction of equiv.perm.same_cycle_apply_left
.
Alias of the forward direction of equiv.perm.same_cycle_apply_right
.
Alias of the reverse direction of equiv.perm.same_cycle_apply_right
.
Alias of the reverse direction of equiv.perm.same_cycle_inv_apply_left
.
Alias of the forward direction of equiv.perm.same_cycle_inv_apply_left
.
Alias of the reverse direction of equiv.perm.same_cycle_inv_apply_right
.
Alias of the forward direction of equiv.perm.same_cycle_inv_apply_right
.
Alias of the forward direction of equiv.perm.same_cycle_pow_left
.
Alias of the reverse direction of equiv.perm.same_cycle_pow_left
.
Alias of the reverse direction of equiv.perm.same_cycle_pow_right
.
Alias of the forward direction of equiv.perm.same_cycle_pow_right
.
Alias of the reverse direction of equiv.perm.same_cycle_zpow_left
.
Alias of the forward direction of equiv.perm.same_cycle_zpow_left
.
Alias of the reverse direction of equiv.perm.same_cycle_zpow_right
.
Alias of the forward direction of equiv.perm.same_cycle_zpow_right
.
Alias of the reverse direction of equiv.perm.same_cycle_subtype_perm
.
Alias of the reverse direction of equiv.perm.same_cycle_extend_domain
.
Equations
- equiv.perm.same_cycle.decidable_rel f = λ (x y : α), decidable_of_iff (∃ (n : ℕ) (H : n ∈ list.range (fintype.card (equiv.perm α))), ⇑(f ^ n) x = y) _
is_cycle
#
The subgroup generated by a cycle is in bijection with its support
Equations
- hσ.zpowers_equiv_support = equiv.of_bijective (λ (τ : ↥↑(subgroup.zpowers σ)), ⟨⇑τ (classical.some hσ), _⟩) _
Unlike support_congr
, which assumes that ∀ (x ∈ g.support), f x = g x)
, here
we have the weaker assumption that ∀ (x ∈ f.support), f x = g x
.
If two cyclic permutations agree on all terms in their intersection, and that intersection is not empty, then the two cyclic permutations must be equal.
is_cycle_on
#
A permutation is a cycle on s
when any two points of s
are related by repeated application
of the permutation. Note that this means the identity is a cycle of subsingleton sets.
Equations
- f.is_cycle_on s = (set.bij_on ⇑f s s ∧ ∀ ⦃x : α⦄, x ∈ s → ∀ ⦃y : α⦄, y ∈ s → f.same_cycle x y)
Alias of the reverse direction of equiv.perm.is_cycle_on_one
.
Alias of the forward direction of equiv.perm.is_cycle_on_one
.
Alias of the forward direction of equiv.perm.is_cycle_on_inv
.
Alias of the reverse direction of equiv.perm.is_cycle_on_inv
.
This lemma demonstrates the relation between equiv.perm.is_cycle
and equiv.perm.is_cycle_on
in non-degenerate cases.
Note that the identity satisfies is_cycle_on
for any subsingleton set, but not is_cycle
.
Note that the identity is a cycle on any subsingleton set, but not a cycle.
cycle_of
#
f.cycle_of x
is the cycle of the permutation f
to which x
belongs.
Equations
- f.cycle_of x = ⇑equiv.perm.of_subtype (f.subtype_perm _)
x
is in the support of f
iff equiv.perm.cycle_of f x
is a cycle.
cycle_factors
#
Given a list l : list α
and a permutation f : perm α
whose nonfixed points are all in l
,
recursively factors f
into cycles.
Equations
- equiv.perm.cycle_factors_aux (x :: l) f h = dite (⇑f x = x) (λ (hx : ⇑f x = x), equiv.perm.cycle_factors_aux l f _) (λ (hx : ¬⇑f x = x), equiv.perm.cycle_factors_aux._match_1 x f hx (equiv.perm.cycle_factors_aux l ((f.cycle_of x)⁻¹ * f) _))
- equiv.perm.cycle_factors_aux list.nil f h = ⟨list.nil (equiv.perm α), _⟩
- equiv.perm.cycle_factors_aux._match_1 x f hx ⟨m, _⟩ = ⟨f.cycle_of x :: m, _⟩
Factors a permutation f
into a list of disjoint cyclic permutations that multiply to f
.
Equations
Factors a permutation f
into a list of disjoint cyclic permutations that multiply to f
,
without a linear order.
Equations
- f.trunc_cycle_factors = quotient.rec_on_subsingleton finset.univ.val (λ (l : list α) (h : ∀ (x : α), ⇑f x ≠ x → x ∈ ⟦l⟧), trunc.mk (equiv.perm.cycle_factors_aux l f h)) _
Factors a permutation f
into a finset
of disjoint cyclic permutations that multiply to f
.
Equations
- f.cycle_factors_finset = trunc.lift (λ (l : {l // l.prod = f ∧ (∀ (g : equiv.perm α), g ∈ l → g.is_cycle) ∧ list.pairwise equiv.perm.disjoint l}), l.val.to_finset) _ f.trunc_cycle_factors
The product of cycle factors is equal to the original f : perm α
.
Two permutations f g : perm α
have the same cycle factors iff they are the same.
If c is a cycle, a ∈ c.support and c is a cycle of f, then c = f.cycle_of a
Fixed points #
We can partition the square s ×ˢ s
into shifted diagonals as such:
01234
40123
34012
23401
12340
The diagonals are given by the cycle f
.