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.Permanent

16 declarations. Mathlib docs · Source

theorem Matrix.permanent.congr_simp E1 #

∀ {n : Type u_1} {inst : DecidableEq n} [inst_1 : DecidableEq n] [inst_2 : Fintype n] {R : Type u_2}
  [inst_3 : CommSemiring R] (M M_1 : Matrix n n R), M = M_1 → M.permanent = M_1.permanent

def Matrix.permanent E1 #

{n : Type u_1} → [DecidableEq n] → [Fintype n] → {R : Type u_2} → [CommSemiring R] → Matrix n n R → R

The permanent of a square matrix defined as a sum over all permutations. This is analogous to the determinant but without alternating signs.

theorem Matrix.permanent_diagonal E0 #

∀ {n : Type u_1} [inst : DecidableEq n] [inst_1 : Fintype n] {R : Type u_2} [inst_2 : CommSemiring R] {d : n → R},
  (Matrix.diagonal d).permanent = ∏ i, d i

theorem Matrix.permanent_zero E0 #

∀ {n : Type u_1} [inst : DecidableEq n] [inst_1 : Fintype n] {R : Type u_2} [inst_2 : CommSemiring R] [Nonempty n],
  Matrix.permanent 0 = 0

theorem Matrix.permanent_one E0 #

∀ {n : Type u_1} [inst : DecidableEq n] [inst_1 : Fintype n] {R : Type u_2} [inst_2 : CommSemiring R],
  Matrix.permanent 1 = 1

theorem Matrix.permanent_isEmpty E1 #

∀ {n : Type u_1} [inst : DecidableEq n] [inst_1 : Fintype n] {R : Type u_2} [inst_2 : CommSemiring R] [IsEmpty n]
  {A : Matrix n n R}, A.permanent = 1

theorem Matrix.permanent_eq_one_of_card_eq_zero E1 #

∀ {n : Type u_1} [inst : DecidableEq n] [inst_1 : Fintype n] {R : Type u_2} [inst_2 : CommSemiring R]
  {A : Matrix n n R}, Fintype.card n = 0 → A.permanent = 1

theorem Matrix.permanent_unique E0 #

∀ {R : Type u_2} [inst : CommSemiring R] {n : Type u_3} [inst_1 : Unique n] [inst_2 : DecidableEq n]
  [inst_3 : Fintype n] (A : Matrix n n R), A.permanent = A default default

If n has only one element, the permanent of an n by n matrix is just that element. Although Unique implies DecidableEq and Fintype, the instances might not be syntactically equal. Thus, we need to fill in the args explicitly.

theorem Matrix.permanent_eq_elem_of_subsingleton E1 #

∀ {n : Type u_1} [inst : DecidableEq n] [inst_1 : Fintype n] {R : Type u_2} [inst_2 : CommSemiring R] [Subsingleton n]
  (A : Matrix n n R) (k : n), A.permanent = A k k

theorem Matrix.permanent_eq_elem_of_card_eq_one E1 #

∀ {n : Type u_1} [inst : DecidableEq n] [inst_1 : Fintype n] {R : Type u_2} [inst_2 : CommSemiring R]
  {A : Matrix n n R}, Fintype.card n = 1 → ∀ (k : n), A.permanent = A k k

theorem Matrix.permanent_transpose E0 #

∀ {n : Type u_1} [inst : DecidableEq n] [inst_1 : Fintype n] {R : Type u_2} [inst_2 : CommSemiring R]
  (M : Matrix n n R), M.transpose.permanent = M.permanent

Transposing a matrix preserves the permanent.

theorem Matrix.permanent_permute_cols E1 #

∀ {n : Type u_1} [inst : DecidableEq n] [inst_1 : Fintype n] {R : Type u_2} [inst_2 : CommSemiring R] (σ : Equiv.Perm n)
  (M : Matrix n n R), (M.submatrix (⇑σ) id).permanent = M.permanent

Permuting the columns does not change the permanent.

theorem Matrix.permanent_permute_rows E1 #

∀ {n : Type u_1} [inst : DecidableEq n] [inst_1 : Fintype n] {R : Type u_2} [inst_2 : CommSemiring R] (σ : Equiv.Perm n)
  (M : Matrix n n R), (M.submatrix id ⇑σ).permanent = M.permanent

Permuting the rows does not change the permanent.

theorem Matrix.permanent_smul E0 #

∀ {n : Type u_1} [inst : DecidableEq n] [inst_1 : Fintype n] {R : Type u_2} [inst_2 : CommSemiring R] (M : Matrix n n R)
  (c : R), (c • M).permanent = c ^ Fintype.card n * M.permanent

theorem Matrix.permanent_updateCol_smul E0 #

∀ {n : Type u_1} [inst : DecidableEq n] [inst_1 : Fintype n] {R : Type u_2} [inst_2 : CommSemiring R] (M : Matrix n n R)
  (j : n) (c : R) (u : n → R), (M.updateCol j (c • u)).permanent = c * (M.updateCol j u).permanent

theorem Matrix.permanent_updateRow_smul E0 #

∀ {n : Type u_1} [inst : DecidableEq n] [inst_1 : Fintype n] {R : Type u_2} [inst_2 : CommSemiring R] (M : Matrix n n R)
  (j : n) (c : R) (u : n → R), (M.updateRow j (c • u)).permanent = c * (M.updateRow j u).permanent