Sign of a permutation #
The main definition of this file is equiv.perm.sign
, associating a ℤˣ
sign with a
permutation.
This file also contains miscellaneous lemmas about equiv.perm
and equiv.swap
, building on top
of those in data/equiv/basic
and other files in group_theory/perm/*
.
mod_swap i j
contains permutations up to swapping i
and j
.
We use this to partition permutations in matrix.det_zero_of_row_eq
, such that each partition
sums up to 0
.
Equations
- equiv.perm.mod_swap i j = {r := λ (σ τ : equiv.perm α), σ = τ ∨ σ = (equiv.swap i j) * τ, iseqv := _}
Equations
- equiv.perm.r.decidable_rel i j = λ (σ τ : equiv.perm α), or.decidable
If the permutation f
maps {x // p x}
into itself, then this returns the permutation
on {x // p x}
induced by f
. Note that the h
hypothesis is weaker than for
equiv.perm.subtype_perm
.
Given a list l : list α
and a permutation f : perm α
such that the nonfixed points of f
are in l
, recursively factors f
as a product of transpositions.
Equations
- equiv.perm.swap_factors_aux (x :: l) = λ (f : equiv.perm α) (h : ∀ {x_1 : α}, ⇑f x_1 ≠ x_1 → x_1 ∈ x :: l), dite (x = ⇑f x) (λ (hfx : x = ⇑f x), equiv.perm.swap_factors_aux l f _) (λ (hfx : ¬x = ⇑f x), let m : {l // l.prod = (equiv.swap x (⇑f x)) * f ∧ ∀ (g : equiv.perm α), g ∈ l → g.is_swap} := equiv.perm.swap_factors_aux l ((equiv.swap x (⇑f x)) * f) _ in ⟨equiv.swap x (⇑f x) :: m.val, _⟩)
- equiv.perm.swap_factors_aux list.nil = λ (f : equiv.perm α) (h : ∀ {x : α}, ⇑f x ≠ x → x ∈ list.nil), ⟨list.nil (equiv.perm α), _⟩
swap_factors
represents a permutation as a product of a list of transpositions.
The representation is non unique and depends on the linear order structure.
For types without linear order trunc_swap_factors
can be used.
Equations
This computably represents the fact that any permutation can be represented as the product of a list of transpositions.
Equations
- f.trunc_swap_factors = quotient.rec_on_subsingleton finset.univ.val (λ (l : list α) (h : ∀ (x : α), ⇑f x ≠ x → x ∈ ⟦l⟧), trunc.mk (equiv.perm.swap_factors_aux l f h)) _
An induction principle for permutations. If P
holds for the identity permutation, and
is preserved under composition with a non-trivial swap, then P
holds for all permutations.
Like swap_induction_on
, but with the composition on the right of f
.
An induction principle for permutations. If P
holds for the identity permutation, and
is preserved under composition with a non-trivial swap, then P
holds for all permutations.
set of all pairs (⟨a, b⟩ : Σ a : fin n, fin n) such that b < a
Equations
- equiv.perm.fin_pairs_lt n = finset.univ.sigma (λ (a : fin n), (finset.range ↑a).attach_fin _)
sign_aux σ
is the sign of a permutation on fin n
, defined as the parity of the number of
pairs (x₁, x₂)
such that x₂ < x₁
but σ x₁ ≤ σ x₂
sign_bij_aux f ⟨a, b⟩
returns the pair consisting of f a
and f b
in decreasing order.
When the list l : list α
contains all nonfixed points of the permutation f : perm α
,
sign_aux2 l f
recursively calculates the sign of f
.
Equations
- equiv.perm.sign_aux2 (x :: l) f = ite (x = ⇑f x) (equiv.perm.sign_aux2 l f) (-equiv.perm.sign_aux2 l ((equiv.swap x (⇑f x)) * f))
- equiv.perm.sign_aux2 list.nil f = 1
When the multiset s : multiset α
contains all nonfixed points of the permutation f : perm α
,
sign_aux2 f _
recursively calculates the sign of f
.
Equations
- f.sign_aux3 = quotient.hrec_on s (λ (l : list α) (h : ∀ (x : α), x ∈ ⟦l⟧), equiv.perm.sign_aux2 l f) _
sign
of a permutation returns the signature or parity of a permutation, 1
for even
permutations, -1
for odd permutations. It is the unique surjective group homomorphism from
perm α
to the group with two elements.
Equations
- equiv.perm.sign = monoid_hom.mk' (λ (f : equiv.perm α), f.sign_aux3 finset.mem_univ) equiv.perm.sign._proof_1
If we apply prod_extend_right a (σ a)
for all a : α
in turn,
we get prod_congr_right σ
.