Permanent of a matrix #
This file defines the permanent of a matrix, Matrix.permanent, and some of its properties.
Main definitions #
Matrix.permanent: the permanent of a square matrix, as a sum over permutations
def Matrix.permanent {n : Type u_1} [DecidableEq n] [Fintype n] {R : Type u_2} [CommSemiring R] (M : 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.
Equations
- M.permanent = ∑ σ : Equiv.Perm n, ∏ i : n, M (σ i) i
Instances For
@[simp]
theorem Matrix.permanent_diagonal {n : Type u_1} [DecidableEq n] [Fintype n] {R : Type u_2} [CommSemiring R] {d : n → R} :
@[simp]
theorem Matrix.permanent_zero {n : Type u_1} [DecidableEq n] [Fintype n] {R : Type u_2} [CommSemiring R] [Nonempty n] :
@[simp]
theorem Matrix.permanent_one {n : Type u_1} [DecidableEq n] [Fintype n] {R : Type u_2} [CommSemiring R] :
theorem Matrix.permanent_isEmpty {n : Type u_1} [DecidableEq n] [Fintype n] {R : Type u_2} [CommSemiring R] [IsEmpty n] {A : Matrix n n R} :
theorem Matrix.permanent_eq_one_of_card_eq_zero {n : Type u_1} [DecidableEq n] [Fintype n] {R : Type u_2} [CommSemiring R] {A : Matrix n n R} (h : Fintype.card n = 0) :
@[simp]
theorem Matrix.permanent_unique {R : Type u_2} [CommSemiring R] {n : Type u_3} [Unique n] [DecidableEq n] [Fintype n] (A : Matrix n n R) :
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 {n : Type u_1} [DecidableEq n] [Fintype n] {R : Type u_2} [CommSemiring R] [Subsingleton n] (A : Matrix n n R) (k : n) :
theorem Matrix.permanent_eq_elem_of_card_eq_one {n : Type u_1} [DecidableEq n] [Fintype n] {R : Type u_2} [CommSemiring R] {A : Matrix n n R} (h : Fintype.card n = 1) (k : n) :
@[simp]
theorem Matrix.permanent_transpose {n : Type u_1} [DecidableEq n] [Fintype n] {R : Type u_2} [CommSemiring R] (M : Matrix n n R) :
Transposing a matrix preserves the permanent.
theorem Matrix.permanent_permute_cols {n : Type u_1} [DecidableEq n] [Fintype n] {R : Type u_2} [CommSemiring R] (σ : Equiv.Perm n) (M : Matrix n n R) :
Permuting the columns does not change the permanent.
theorem Matrix.permanent_permute_rows {n : Type u_1} [DecidableEq n] [Fintype n] {R : Type u_2} [CommSemiring R] (σ : Equiv.Perm n) (M : Matrix n n R) :
Permuting the rows does not change the permanent.
@[simp]
theorem Matrix.permanent_smul {n : Type u_1} [DecidableEq n] [Fintype n] {R : Type u_2} [CommSemiring R] (M : Matrix n n R) (c : R) :
@[simp]
theorem Matrix.permanent_updateCol_smul {n : Type u_1} [DecidableEq n] [Fintype n] {R : Type u_2} [CommSemiring R] (M : Matrix n n R) (j : n) (c : R) (u : n → R) :
@[simp]
theorem Matrix.permanent_updateRow_smul {n : Type u_1} [DecidableEq n] [Fintype n] {R : Type u_2} [CommSemiring R] (M : Matrix n n R) (j : n) (c : R) (u : n → R) :