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 GroupTheory/Perm/*
.
modSwap 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.modSwap i j = { r := fun (σ τ : Equiv.Perm α) => σ = τ ∨ σ = Equiv.swap i j * τ, iseqv := (_ : Equivalence fun (σ τ : Equiv.Perm α) => σ = τ ∨ σ = Equiv.swap i j * τ) }
Instances For
Equations
- Equiv.Perm.instDecidableRelPermRModSwap i j x✝ x = 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.subtypePerm
.
Equations
- Equiv.Perm.subtypePermOfFintype f h = Equiv.Perm.subtypePerm f (_ : ∀ (x : α), p x ↔ p (f x))
Instances For
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
- One or more equations did not get rendered due to their size.
- Equiv.Perm.swapFactorsAux [] = fun (f : Equiv.Perm α) (h : ∀ {x : α}, f x ≠ x → x ∈ []) => { val := [], property := (_ : List.prod [] = f ∧ ∀ g ∈ [], Equiv.Perm.IsSwap g) }
Instances For
swapFactors
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 truncSwapFactors
can be used.
Equations
- One or more equations did not get rendered due to their size.
Instances For
This computably represents the fact that any permutation can be represented as the product of a list of transpositions.
Equations
- One or more equations did not get rendered due to their size.
Instances For
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.finPairsLT n = Finset.sigma Finset.univ fun (a : Fin n) => Finset.attachFin (Finset.range ↑a) (_ : ∀ x ∈ Finset.range ↑a, x < n)
Instances For
signAux σ
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₂
Equations
- Equiv.Perm.signAux a = Finset.prod (Equiv.Perm.finPairsLT n) fun (x : (_ : Fin n) × Fin n) => if a x.fst ≤ a x.snd then -1 else 1
Instances For
signBijAux f ⟨a, b⟩
returns the pair consisting of f a
and f b
in decreasing order.
Equations
- Equiv.Perm.signBijAux f a = if x : f a.snd < f a.fst then { fst := f a.fst, snd := f a.snd } else { fst := f a.snd, snd := f a.fst }
Instances For
When the list l : List α
contains all nonfixed points of the permutation f : Perm α
,
signAux2 l f
recursively calculates the sign of f
.
Equations
- Equiv.Perm.signAux2 [] x = 1
- Equiv.Perm.signAux2 (x_2 :: l) x = if x_2 = x x_2 then Equiv.Perm.signAux2 l x else -Equiv.Perm.signAux2 l (Equiv.swap x_2 (x x_2) * x)
Instances For
When the multiset s : Multiset α
contains all nonfixed points of the permutation f : Perm α
,
signAux2 f _
recursively calculates the sign of f
.
Equations
- One or more equations did not get rendered due to their size.
Instances For
SignType.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
- One or more equations did not get rendered due to their size.
Instances For
If we apply prod_extendRight a (σ a)
for all a : α
in turn,
we get prod_congrRight σ
.