Sign of a permutation #
The main definition of this file is Equiv.Perm.sign
,
associating a ℤˣ
sign with a permutation.
Other lemmas have been moved to Mathlib.GroupTheory.Perm.Fintype
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 := ⋯ }
Instances For
Equations
- Equiv.Perm.instDecidableRelROfFintype i j x✝ x = inferInstanceAs (Decidable (x✝ = x ∨ x✝ = Equiv.swap i j * x))
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 ∈ []) => ⟨[], ⋯⟩
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
- f.swapFactors = Equiv.Perm.swapFactorsAux (Finset.sort (fun (x1 x2 : α) => x1 ≤ x2) Finset.univ) f ⋯
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.
Every finite symmetric group is generated by transpositions of adjacent elements.
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.univ.sigma fun (a : Fin n) => (Finset.range ↑a).attachFin ⋯
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
- a.signAux = ∏ x ∈ Equiv.Perm.finPairsLT 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.
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
- f.signAux3 = Quotient.hrecOn (motive := fun (x : Multiset α) => (∀ (x_1 : α), x_1 ∈ x) → ℤˣ) s (fun (l : List α) (x : ∀ (x : α), x ∈ ⟦l⟧) => Equiv.Perm.signAux2 l f) ⋯
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
- Equiv.Perm.sign = MonoidHom.mk' (fun (f : Equiv.Perm α) => f.signAux3 ⋯) ⋯
Instances For
If we apply prod_extendRight a (σ a)
for all a : α
in turn,
we get prod_congrRight σ
.