Documentation

AlgebraicCombinatorics.Permutations.Signs

Signs of Permutations #

This file formalizes the notion of the sign (signature) of a permutation and its properties.

The sign of a permutation σ ∈ Sₙ is defined as (-1)^ℓ(σ) where ℓ(σ) is the length (number of inversions) of σ. This is a fundamental concept in combinatorics and algebra, playing a crucial role in the definition of determinants and exterior powers.

Main definitions #

Most definitions are already in Mathlib:

We provide:

Main results #

Properties of the sign (Proposition prop.perm.sign.props) #

The sign homomorphism (Corollary cor.perm.sign.hom) #

The alternating group (Corollary cor.perm.altgp) #

Counting even/odd permutations (Corollary cor.perm.num-even) #

Sign for finite sets (Proposition prop.perm.sign.X) #

References #

Tags #

permutation, sign, signature, alternating group, parity

Definition of sign #

The sign of a permutation σ is (-1)^ℓ(σ) where ℓ(σ) is the length (number of inversions). In Mathlib, this is Equiv.Perm.sign.

Definition (def.perm.sign): For n ∈ ℕ, the sign of σ ∈ Sₙ is (-1)^ℓ(σ). It is denoted (-1)^σ, sgn(σ), sign(σ), or ε(σ).

Proof that sign σ = (-1)^ℓ(σ) #

The fundamental theorem connecting the Mathlib definition of Equiv.Perm.sign (which uses a product formula) with the textbook definition sign(σ) = (-1)^ℓ(σ) where ℓ(σ) is the number of inversions.

This formalizes Definition (def.perm.sign).

The sign of a permutation equals (-1)^ℓ(σ) where ℓ(σ) is the number of inversions.

Definition (def.perm.sign): The sign of σ ∈ Sₙ is defined as (-1)^ℓ(σ), where ℓ(σ) is the length (number of inversions) of σ.

This theorem proves that Mathlib's Equiv.Perm.sign equals the textbook definition.

Corollary: sign as an integer equals (-1)^invCount. Definition (def.perm.sign)

def Equiv.Perm.IsEven {α : Type u_1} [DecidableEq α] [Fintype α] (σ : Perm α) :

A permutation is even if its sign is 1 (equivalently, if its length is even). Definition (def.perm.even-odd)

Equations
Instances For
    def Equiv.Perm.IsOdd {α : Type u_1} [DecidableEq α] [Fintype α] (σ : Perm α) :

    A permutation is odd if its sign is -1 (equivalently, if its length is odd). Definition (def.perm.even-odd)

    Equations
    Instances For
      theorem Equiv.Perm.isEven_iff_sign_eq_one {α : Type u_1} [DecidableEq α] [Fintype α] {σ : Perm α} :
      σ.IsEven sign σ = 1
      theorem Equiv.Perm.isOdd_iff_sign_eq_neg_one {α : Type u_1} [DecidableEq α] [Fintype α] {σ : Perm α} :
      σ.IsOdd sign σ = -1
      @[simp]
      theorem Equiv.Perm.isEven_one {α : Type u_1} [DecidableEq α] [Fintype α] :

      The identity permutation is even. This is a useful base case when reasoning about permutation parity.

      @[simp]
      theorem Equiv.Perm.not_isOdd_one {α : Type u_1} [DecidableEq α] [Fintype α] :

      The identity permutation is not odd.

      theorem Equiv.Perm.isOdd_swap {α : Type u_1} [DecidableEq α] [Fintype α] {x y : α} (hxy : x y) :
      (swap x y).IsOdd

      A transposition (swap) is an odd permutation. This provides a cleaner interface when working with the IsOdd predicate rather than directly with sign values.

      theorem Equiv.Perm.isEven_or_isOdd {α : Type u_1} [DecidableEq α] [Fintype α] (σ : Perm α) :

      Every permutation is either even or odd. This follows from the fact that sign takes values in {1, -1}.

      theorem Equiv.Perm.not_isEven_and_isOdd {α : Type u_1} [DecidableEq α] [Fintype α] (σ : Perm α) :

      A permutation cannot be both even and odd.

      Properties of the sign (Proposition prop.perm.sign.props) #

      theorem Equiv.Perm.sign_id {α : Type u_1} [DecidableEq α] [Fintype α] :
      sign 1 = 1

      (a) The sign of the identity permutation is 1. Proposition (prop.perm.sign.props)(a)

      theorem Equiv.Perm.sign_transposition {α : Type u_1} [DecidableEq α] [Fintype α] {x y : α} (hxy : x y) :
      sign (swap x y) = -1

      (b) The sign of a transposition is -1. Proposition (prop.perm.sign.props)(b)

      theorem Equiv.Perm.sign_isCycle {α : Type u_1} [DecidableEq α] [Fintype α] {σ : Perm α} ( : σ.IsCycle) :
      sign σ = -(-1) ^ σ.support.card

      (c) The sign of a k-cycle is (-1)^(k-1). Proposition (prop.perm.sign.props)(c)

      This follows from the fact that a k-cycle has support of size k and sign(σ) = -(-1)^|support(σ)| for cycles.

      theorem Equiv.Perm.sign_mul' {α : Type u_1} [DecidableEq α] [Fintype α] (σ τ : Perm α) :
      sign (σ * τ) = sign σ * sign τ

      (d) The sign is multiplicative: sign(στ) = sign(σ) · sign(τ). Proposition (prop.perm.sign.props)(d)

      theorem Equiv.Perm.sign_prod_list {α : Type u_1} [DecidableEq α] [Fintype α] (l : List (Perm α)) :

      (e) The sign of a product equals the product of signs. Proposition (prop.perm.sign.props)(e)

      theorem Equiv.Perm.sign_inv' {α : Type u_1} [DecidableEq α] [Fintype α] (σ : Perm α) :

      (f) The sign of the inverse equals the sign of the permutation. Proposition (prop.perm.sign.props)(f)

      Product formula for sign (Proposition prop.perm.sign.props (g) and (h)) #

      (g) For σ ∈ Sₙ: sign(σ) = ∏_{1 ≤ i < j ≤ n} (σ(i) - σ(j)) / (i - j)

      (h) For any x₁, ..., xₙ in a commutative ring and σ ∈ Sₙ: ∏{1 ≤ i < j ≤ n} (x{σ(i)} - x_{σ(j)}) = sign(σ) · ∏_{1 ≤ i < j ≤ n} (xᵢ - xⱼ)

      theorem Equiv.Perm.prod_diff_comp_perm {n : } {R : Type u_2} [CommRing R] (σ : Perm (Fin n)) (x : Fin nR) :
      i : Fin n, jFinset.Ioi i, (x (σ i) - x (σ j)) = (sign σ) * i : Fin n, jFinset.Ioi i, (x i - x j)

      (h) Product of differences under permutation. Proposition (prop.perm.sign.props)(h)

      For any elements x₁, ..., xₙ of a commutative ring and σ ∈ Sₙ: ∏{i < j} (x{σ(i)} - x_{σ(j)}) = sign(σ) · ∏_{i < j} (xᵢ - xⱼ)

      theorem Equiv.Perm.sign_eq_prod_pairs {n : } (σ : Perm (Fin n)) :
      sign σ = i : Fin n, jFinset.Ioi i, if σ i < σ j then 1 else -1

      (g) Sign as a product over pairs. Proposition (prop.perm.sign.props)(g)

      For σ ∈ Sₙ: sign(σ) = ∏_{1 ≤ i < j ≤ n} (σ(i) - σ(j)) / (i - j)

      We state this in a slightly different but equivalent form using the indicator function.

      The sign homomorphism (Corollary cor.perm.sign.hom) #

      The map σ ↦ sign(σ) from Sₙ to {1, -1} is a group homomorphism. This is captured by Equiv.Perm.sign : Perm α →* ℤˣ being a MonoidHom.

      theorem Equiv.Perm.sign_hom_mul {α : Type u_1} [DecidableEq α] [Fintype α] (σ τ : Perm α) :
      sign (σ * τ) = sign σ * sign τ

      Corollary (cor.perm.sign.hom) The sign is a group homomorphism from Sₙ to {1, -1}.

      In Mathlib, this is expressed by Equiv.Perm.sign being a MonoidHom.

      The alternating group (Corollary cor.perm.altgp) #

      The set of even permutations forms a normal subgroup of Sₙ, called the alternating group.

      Corollary (cor.perm.altgp) The set of all even permutations in Sₙ is a normal subgroup. This is the alternating group Aₙ.

      Counting even and odd permutations (Corollary cor.perm.num-even) #

      For n ≥ 2, the number of even permutations equals the number of odd permutations, and both equal n!/2.

      Corollary (cor.perm.num-even) The number of even permutations in Sₙ equals n!/2 for n ≥ 2. More precisely, |Aₙ| = (card α)!/2.

      theorem Equiv.Perm.card_odd_eq_card_even {α : Type u_1} [DecidableEq α] [Fintype α] [Nontrivial α] :
      {σ : Perm α | sign σ = -1}.card = {σ : Perm α | sign σ = 1}.card

      The number of odd permutations equals the number of even permutations. This follows from the bijection σ ↦ σ * swap(a,b) for any distinct a, b.

      theorem Equiv.Perm.sum_sign_eq_zero {α : Type u_1} [DecidableEq α] [Fintype α] [Nontrivial α] :
      σ : Perm α, (sign σ) = 0

      Equation (eq.cor.perm.num-even.sum-sign) The sum of signs over all permutations is 0 for n ≥ 2.

      ∑_{σ ∈ Sₙ} sign(σ) = 0 for n ≥ 2

      Sign for permutations of arbitrary finite sets (Proposition prop.perm.sign.X) #

      The sign can be defined for permutations of any finite set X, not just [n]. Given a bijection φ : X → [n], we define sign_φ(σ) = sign(φ ∘ σ ∘ φ⁻¹). This is independent of the choice of φ.

      theorem Equiv.Perm.sign_conj_eq {α : Type u_1} [DecidableEq α] [Fintype α] {β : Type u_2} [DecidableEq β] [Fintype β] (σ : Perm α) (e : α β) :
      sign ((e.symm.trans σ).trans e) = sign σ

      Proposition (prop.perm.sign.X)(a) The sign of a permutation of a finite set is independent of the chosen bijection.

      For any bijections φ₁, φ₂ : X → [n], we have sign_{φ₁}(σ) = sign_{φ₂}(σ).

      theorem Equiv.Perm.sign_id_finiteSet {α : Type u_1} [DecidableEq α] [Fintype α] :
      sign 1 = 1

      Proposition (prop.perm.sign.X)(b) The identity permutation of any finite set has sign 1.

      theorem Equiv.Perm.sign_mul_finiteSet {α : Type u_1} [DecidableEq α] [Fintype α] (σ τ : Perm α) :
      sign (σ * τ) = sign σ * sign τ

      Proposition (prop.perm.sign.X)(c) The sign is multiplicative for permutations of any finite set.