The Mathlib Handbook

The volumes of the handbook are not written yet. This site shows the map of Mathlib that they will follow, at Mathlib 4472534b60.

The areas / V07. Linear algebra

Mathlib.LinearAlgebra.Matrix.Permutation

15 declarations. Mathlib docs · Source

Permutation matrices

This file defines the matrix associated with a permutation

Main definitions

  • Equiv.Perm.permMatrix: the permutation matrix associated with an Equiv.Perm

Main results

  • Matrix.det_permutation: the determinant is the sign of the permutation
  • Matrix.trace_permutation: the trace is the number of fixed points of the permutation

theorem Equiv.Perm.permMatrix.congr_simp E1 #

∀ {n : Type u_1} (R : Type u_2) {inst : DecidableEq n} [inst_1 : DecidableEq n] (σ σ_1 : Equiv.Perm n),
  σ = σ_1 →
    ∀ [inst_2 : Zero R] [inst_3 : One R] (a a_1 : n),
      a = a_1 → ∀ (a_2 a_3 : n), a_2 = a_3 → Equiv.Perm.permMatrix R σ a a_2 = Equiv.Perm.permMatrix R σ_1 a_1 a_3

abbrev Equiv.Perm.permMatrix E3 #

{n : Type u_1} → (R : Type u_2) → [DecidableEq n] → Equiv.Perm n → [Zero R] → [One R] → Matrix n n R

the permutation matrix associated with an Equiv.Perm.

This is available in a bundled form as Matrix.permMatrixHom.

theorem Matrix.permMatrix_refl E0 #

∀ {n : Type u_1} {R : Type u_2} [inst : DecidableEq n] [inst_1 : Zero R] [inst_2 : One R],
  Equiv.Perm.permMatrix R (Equiv.refl n) = 1

theorem Matrix.permMatrix_one E0 #

∀ {n : Type u_1} {R : Type u_2} [inst : DecidableEq n] [inst_1 : Zero R] [inst_2 : One R], Equiv.Perm.permMatrix R 1 = 1

theorem Matrix.transpose_permMatrix E0 #

∀ {n : Type u_1} {R : Type u_2} [inst : DecidableEq n] (σ : Equiv.Perm n) [inst_1 : Zero R] [inst_2 : One R],
  (Equiv.Perm.permMatrix R σ).transpose = Equiv.Perm.permMatrix R σ⁻¹

theorem Matrix.conjTranspose_permMatrix E0 #

∀ {n : Type u_1} {R : Type u_2} [inst : DecidableEq n] (σ : Equiv.Perm n) [inst_1 : NonAssocSemiring R]
  [inst_2 : StarRing R], (Equiv.Perm.permMatrix R σ).conjTranspose = Equiv.Perm.permMatrix R σ⁻¹

theorem Matrix.det_permutation E3 #

∀ {n : Type u_1} {R : Type u_2} [inst : DecidableEq n] (σ : Equiv.Perm n) [inst_1 : Fintype n] [inst_2 : CommRing R],
  (Equiv.Perm.permMatrix R σ).det = ↑↑(Equiv.Perm.sign σ)

The determinant of a permutation matrix equals its sign.

theorem Matrix.trace_permutation E3 #

∀ {n : Type u_1} {R : Type u_2} [inst : DecidableEq n] (σ : Equiv.Perm n) [inst_1 : Fintype n]
  [inst_2 : AddCommMonoidWithOne R], (Equiv.Perm.permMatrix R σ).trace = ↑(Function.fixedPoints ⇑σ).ncard

The trace of a permutation matrix equals the number of fixed points.

theorem Matrix.permMatrix_mulVec E1 #

∀ {n : Type u_1} {R : Type u_2} [inst : DecidableEq n] (σ : Equiv.Perm n) [inst_1 : Fintype n] {v : n → R}
  [inst_2 : CommRing R], (Equiv.Perm.permMatrix R σ).mulVec v = v ∘ ⇑σ

theorem Matrix.vecMul_permMatrix E1 #

∀ {n : Type u_1} {R : Type u_2} [inst : DecidableEq n] (σ : Equiv.Perm n) [inst_1 : Fintype n] {v : n → R}
  [inst_2 : CommRing R], Matrix.vecMul v (Equiv.Perm.permMatrix R σ) = v ∘ ⇑(Equiv.symm σ)

theorem Matrix.permMatrix_mul E0 #

∀ {n : Type u_1} {R : Type u_2} [inst : DecidableEq n] (σ τ : Equiv.Perm n) [inst_1 : Fintype n]
  [inst_2 : NonAssocSemiring R], Equiv.Perm.permMatrix R (σ * τ) = Equiv.Perm.permMatrix R τ * Equiv.Perm.permMatrix R σ

def Matrix.permMatrixHom E1 #

{n : Type u_1} →
  {R : Type u_2} →
    [inst : DecidableEq n] → [inst_1 : Fintype n] → [inst_2 : NonAssocSemiring R] → Equiv.Perm n →* Matrix n n R

permMatrix as a homomorphism.

theorem Matrix.permMatrixHom_apply E0 #

∀ {n : Type u_1} {R : Type u_2} [inst : DecidableEq n] [inst_1 : Fintype n] [inst_2 : NonAssocSemiring R]
  (σ : Equiv.Perm n), Matrix.permMatrixHom σ = Equiv.Perm.permMatrix R σ⁻¹

theorem Matrix.permMatrix_l2_opNorm_le E1 #

∀ {n : Type u_1} [inst : DecidableEq n] (σ : Equiv.Perm n) [inst_1 : Fintype n] {𝕜 : Type u_3} [inst_2 : RCLike 𝕜],
  ‖Equiv.Perm.permMatrix 𝕜 σ‖ ≤ 1

The l2-operator norm of a permutation matrix is bounded above by 1. See Matrix.permMatrix_l2_opNorm_eq for the equality statement assuming the matrix is nonempty.

theorem Matrix.permMatrix_l2_opNorm_eq E0 #

∀ {n : Type u_1} [inst : DecidableEq n] (σ : Equiv.Perm n) [inst_1 : Fintype n] {𝕜 : Type u_3} [inst_2 : RCLike 𝕜]
  [Nonempty n], ‖Equiv.Perm.permMatrix 𝕜 σ‖ = 1

The l2-operator norm of a nonempty permutation matrix is equal to 1. Note that this is not true for the empty case, since the empty matrix has l2-operator norm 0. See Matrix.permMatrix_l2_opNorm_le for the inequality version of the empty case.