Documentation

Mathlib.LinearAlgebra.Matrix.SemiringInverse

Nonsingular inverses over semirings #

This file proves A * B = 1 ↔ B * A = 1 for square matrices over a commutative semiring.

def Matrix.detp {n : Type u_1} {R : Type u_3} [Fintype n] [DecidableEq n] [CommSemiring R] (s : ˣ) (A : Matrix n n R) :
R

The determinant, but only the terms of a given sign. A.detp 1 is written |A|⁺ in the literature and A.detp (-1) is written |A|⁻.

Equations
Instances For
    @[simp]
    theorem Matrix.detp_transpose {n : Type u_1} {R : Type u_3} [Fintype n] [DecidableEq n] [CommSemiring R] (s : ˣ) (A : Matrix n n R) :
    @[simp]
    theorem Matrix.detp_zero {n : Type u_1} {R : Type u_3} [Fintype n] [DecidableEq n] [CommSemiring R] (s : ˣ) [Nonempty n] :
    detp s 0 = 0
    @[simp]
    theorem Matrix.detp_one_diagonal {n : Type u_1} {R : Type u_3} [Fintype n] [DecidableEq n] [CommSemiring R] (d : nR) :
    detp 1 (diagonal d) = i : n, d i
    @[simp]
    theorem Matrix.detp_one_one {n : Type u_1} {R : Type u_3} [Fintype n] [DecidableEq n] [CommSemiring R] :
    detp 1 1 = 1
    @[simp]
    theorem Matrix.detp_neg_one_diagonal {n : Type u_1} {R : Type u_3} [Fintype n] [DecidableEq n] [CommSemiring R] (d : nR) :
    detp (-1) (diagonal d) = 0
    @[simp]
    theorem Matrix.detp_neg_one_one {n : Type u_1} {R : Type u_3} [Fintype n] [DecidableEq n] [CommSemiring R] :
    detp (-1) 1 = 0
    @[simp]
    theorem Matrix.detp_one_of_isEmpty {n : Type u_1} {R : Type u_3} [Fintype n] [DecidableEq n] [CommSemiring R] (A : Matrix n n R) [IsEmpty n] :
    detp 1 A = 1
    @[simp]
    theorem Matrix.detp_neg_one_of_isEmpty {n : Type u_1} {R : Type u_3} [Fintype n] [DecidableEq n] [CommSemiring R] (A : Matrix n n R) [IsEmpty n] :
    detp (-1) A = 0
    @[simp]
    theorem Matrix.detp_submatrix_equiv_equiv {n : Type u_1} {m : Type u_2} {R : Type u_3} [Fintype m] [Fintype n] [DecidableEq m] [DecidableEq n] [CommSemiring R] (s : ˣ) (A : Matrix n n R) (f g : m n) :
    detp s (A.submatrix f g) = detp (s * Equiv.Perm.sign (f.symm.trans g)) A
    theorem Matrix.detp_submatrix_equiv_self {n : Type u_1} {m : Type u_2} {R : Type u_3} [Fintype m] [Fintype n] [DecidableEq m] [DecidableEq n] [CommSemiring R] (s : ˣ) (A : Matrix n n R) (e : m n) :
    detp s (A.submatrix e e) = detp s A
    theorem Matrix.detp_smul {n : Type u_1} {R : Type u_3} [Fintype n] [DecidableEq n] [CommSemiring R] (s : ˣ) (A : Matrix n n R) (c : R) :
    detp s (c A) = c ^ Fintype.card n * detp s A
    theorem Matrix.detp_map {n : Type u_1} {R : Type u_3} [Fintype n] [DecidableEq n] [CommSemiring R] (s : ˣ) (A : Matrix n n R) {S : Type u_4} [CommSemiring S] (f : R →+* S) :
    detp s (A.map f) = f (detp s A)
    def Matrix.IsDetpBalanced {n : Type u_1} {R : Type u_3} [Fintype n] [DecidableEq n] [CommSemiring R] (A : Matrix n n R) (a b : R) :

    A square matrix A over a commutative semiring R is "determinant balanced" with respect to a b : R if a|A|⁺ + b|A|⁻ = b|A|⁺ + a|A|⁻. Over a commutative ring, this is equivalent to (a - b)|A| = 0, see Matrix.isDetpBalanced_iff_sub_mul_det_eq_zero.

    Equations
    Instances For
      theorem Matrix.IsDetpBalanced.refl {n : Type u_1} {R : Type u_3} [Fintype n] [DecidableEq n] [CommSemiring R] (A : Matrix n n R) (a : R) :
      theorem Matrix.IsDetpBalanced.of_eq {n : Type u_1} {R : Type u_3} [Fintype n] [DecidableEq n] [CommSemiring R] {A : Matrix n n R} {a b : R} (eq : detp 1 A = detp (-1) A) :
      theorem Matrix.IsDetpBalanced.symm {n : Type u_1} {R : Type u_3} [Fintype n] [DecidableEq n] [CommSemiring R] {A : Matrix n n R} {a b : R} :
      theorem Matrix.IsDetpBalanced_comm {n : Type u_1} {R : Type u_3} [Fintype n] [DecidableEq n] [CommSemiring R] {A : Matrix n n R} {a b : R} :
      theorem Matrix.IsDetpBalanced.trans {n : Type u_1} {R : Type u_3} [Fintype n] [DecidableEq n] [CommSemiring R] {A : Matrix n n R} {a b c : R} [IsCancelAdd R] (hab : A.IsDetpBalanced a b) (hbc : A.IsDetpBalanced b c) :
      theorem Matrix.IsDetpBalanced.mul_add_mul_eq {n : Type u_1} {R : Type u_3} [Fintype n] [DecidableEq n] [CommSemiring R] {A : Matrix n n R} {a b : R} (h : A.IsDetpBalanced a b) (s t : ˣ) :
      a * detp s A + b * detp t A = b * detp s A + a * detp t A
      @[simp]
      theorem Matrix.isDetpBalanced_transpose_iff {n : Type u_1} {R : Type u_3} [Fintype n] [DecidableEq n] [CommSemiring R] {A : Matrix n n R} {a b : R} :
      theorem Matrix.IsDetpBalanced.transpose {n : Type u_1} {R : Type u_3} [Fintype n] [DecidableEq n] [CommSemiring R] {A : Matrix n n R} {a b : R} :

      Alias of the reverse direction of Matrix.isDetpBalanced_transpose_iff.

      theorem Matrix.IsDetpBalanced.of_transpose {n : Type u_1} {R : Type u_3} [Fintype n] [DecidableEq n] [CommSemiring R] {A : Matrix n n R} {a b : R} :

      Alias of the forward direction of Matrix.isDetpBalanced_transpose_iff.

      theorem Matrix.IsDetpBalanced.submatrix_equiv {n : Type u_1} {m : Type u_2} {R : Type u_3} [Fintype m] [Fintype n] [DecidableEq m] [DecidableEq n] [CommSemiring R] {A : Matrix n n R} {a b : R} (e₁ e₂ : m n) (h : A.IsDetpBalanced a b) :
      (A.submatrix e₁ e₂).IsDetpBalanced a b
      @[simp]
      theorem Matrix.isDetpBalanced_submatrix_equiv_iff {n : Type u_1} {m : Type u_2} {R : Type u_3} [Fintype m] [Fintype n] [DecidableEq m] [DecidableEq n] [CommSemiring R] {A : Matrix n n R} {a b : R} {e₁ e₂ : m n} :
      (A.submatrix e₁ e₂).IsDetpBalanced a b A.IsDetpBalanced a b
      theorem Matrix.IsDetpBalanced.smul {n : Type u_1} {R : Type u_3} [Fintype n] [DecidableEq n] [CommSemiring R] {A : Matrix n n R} {a b : R} (h : A.IsDetpBalanced a b) (c : R) :
      def Matrix.Nonsingular {n : Type u_1} {R : Type u_3} [Fintype n] [DecidableEq n] [CommSemiring R] (A : Matrix n n R) :

      A square matrix A over a commutative semiring R is called nonsingular if it is only determinant balanced with respect to equal elements.

      See also See also Matrix.Nondegenerate.

      Equations
      Instances For
        theorem Matrix.Nonsingular.eq_of_IsDetpBalanced {n : Type u_1} {R : Type u_3} [Fintype n] [DecidableEq n] [CommSemiring R] {A : Matrix n n R} {a b : R} (hA : A.Nonsingular) (hAd : A.IsDetpBalanced a b) :
        a = b
        theorem Matrix.IsDetpBalanced.eq_of_nonsingular {n : Type u_1} {R : Type u_3} [Fintype n] [DecidableEq n] [CommSemiring R] {A : Matrix n n R} {a b : R} (hA : A.IsDetpBalanced a b) (hAn : A.Nonsingular) :
        a = b
        @[simp]
        theorem Matrix.nonsingular_one {n : Type u_1} {R : Type u_3} [Fintype n] [DecidableEq n] [CommSemiring R] :
        @[simp]
        theorem Matrix.Nonsingular.of_isEmpty {n : Type u_1} {R : Type u_3} [Fintype n] [DecidableEq n] [CommSemiring R] (A : Matrix n n R) [IsEmpty n] :
        theorem Matrix.Nonsingular.transpose {n : Type u_1} {R : Type u_3} [Fintype n] [DecidableEq n] [CommSemiring R] {A : Matrix n n R} :

        Alias of the reverse direction of Matrix.nonsingular_transpose_iff.

        Alias of the forward direction of Matrix.nonsingular_transpose_iff.

        @[simp]
        theorem Matrix.nonsingular_submatrix_equiv_iff {n : Type u_1} {m : Type u_2} {R : Type u_3} [Fintype m] [Fintype n] [DecidableEq m] [DecidableEq n] [CommSemiring R] {A : Matrix n n R} {e₁ e₂ : m n} :
        (A.submatrix e₁ e₂).Nonsingular A.Nonsingular
        theorem Matrix.Nonsingular.submatrix_equiv {n : Type u_1} {m : Type u_2} {R : Type u_3} [Fintype m] [Fintype n] [DecidableEq m] [DecidableEq n] [CommSemiring R] {A : Matrix n n R} {e₁ e₂ : m n} :
        A.Nonsingular(A.submatrix e₁ e₂).Nonsingular

        Alias of the reverse direction of Matrix.nonsingular_submatrix_equiv_iff.

        theorem Matrix.detp_eq_of_row_eq {n : Type u_1} {R : Type u_3} [Fintype n] [DecidableEq n] [CommSemiring R] {A : Matrix n n R} {p q : n} (hpq : p q) (hrow : A.row p = A.row q) (s : ˣ := 1) (t : ˣ := -1) :
        detp s A = detp t A
        theorem Matrix.detp_eq_of_col_eq {n : Type u_1} {R : Type u_3} [Fintype n] [DecidableEq n] [CommSemiring R] {A : Matrix n n R} {p q : n} (hpq : p q) (hcol : A.col p = A.col q) (s : ˣ := 1) (t : ˣ := -1) :
        detp s A = detp t A
        theorem Matrix.detp_eq_of_row_eq_zero {n : Type u_1} {R : Type u_3} [Fintype n] [DecidableEq n] [CommSemiring R] (s : ˣ) {A : Matrix n n R} {p : n} (hrow : A.row p = 0) :
        detp s A = 0
        theorem Matrix.detp_eq_of_col_eq_zero {n : Type u_1} {R : Type u_3} [Fintype n] [DecidableEq n] [CommSemiring R] (s : ˣ) {A : Matrix n n R} {p : n} (hcol : A.col p = 0) :
        detp s A = 0
        theorem Matrix.IsDetpBalanced.submatrix_of_card_le {n : Type u_1} {m : Type u_2} {R : Type u_3} [Fintype m] [Fintype n] [DecidableEq m] [DecidableEq n] [CommSemiring R] {A : Matrix n n R} {a b : R} (h : A.IsDetpBalanced a b) (le : Fintype.card n Fintype.card m) (f g : mn) :

        If A is determinant balanced with respect to a and b, any submatrix of the same or bigger size (possibly with repeated rows or columns) is also.

        def Matrix.adjp {n : Type u_1} {R : Type u_3} [Fintype n] [DecidableEq n] [CommSemiring R] (s : ˣ) (A : Matrix n n R) :
        Matrix n n R

        The adjugate matrix, but only the terms of a given sign.

        Equations
        Instances For
          theorem Matrix.adjp_apply {n : Type u_1} {R : Type u_3} [Fintype n] [DecidableEq n] [CommSemiring R] (s : ˣ) (A : Matrix n n R) (i j : n) :
          adjp s A i j = σEquiv.Perm.ofSign s with σ j = i, k{j}, A k (σ k)
          theorem Matrix.adjp_transpose {n : Type u_1} {R : Type u_3} [Fintype n] [DecidableEq n] [CommSemiring R] (s : ˣ) (A : Matrix n n R) :
          theorem Matrix.adjp_none_none {n : Type u_1} {R : Type u_3} [Fintype n] [DecidableEq n] [CommSemiring R] (s : ˣ) (A : Matrix (Option n) (Option n) R) :
          theorem Matrix.adjp_some_none {n : Type u_1} {R : Type u_3} [Fintype n] [DecidableEq n] [CommSemiring R] (s : ˣ) (i : n) (A : Matrix (Option n) (Option n) R) :
          theorem Matrix.adjp_none_some {n : Type u_1} {R : Type u_3} [Fintype n] [DecidableEq n] [CommSemiring R] (s : ˣ) (i : n) (A : Matrix (Option n) (Option n) R) :
          theorem Matrix.detp_mul {n : Type u_1} {R : Type u_3} [Fintype n] [DecidableEq n] [CommSemiring R] (A B : Matrix n n R) :
          detp 1 (A * B) + (detp 1 A * detp (-1) B + detp (-1) A * detp 1 B) = detp (-1) (A * B) + (detp 1 A * detp 1 B + detp (-1) A * detp (-1) B)
          theorem Matrix.mul_adjp_apply_eq {n : Type u_1} {R : Type u_3} [Fintype n] [DecidableEq n] [CommSemiring R] (s : ˣ) (A : Matrix n n R) (i : n) :
          (A * adjp s A) i i = detp s A
          theorem Matrix.mul_adjp_apply_ne {n : Type u_1} {R : Type u_3} [Fintype n] [DecidableEq n] [CommSemiring R] (A : Matrix n n R) (i j : n) (h : i j) :
          (A * adjp 1 A) i j = (A * adjp (-1) A) i j
          theorem Matrix.adjp_mul_apply_eq {n : Type u_1} {R : Type u_3} [Fintype n] [DecidableEq n] [CommSemiring R] (s : ˣ) (A : Matrix n n R) (i : n) :
          (adjp s A * A) i i = detp s A
          theorem Matrix.adjp_mul_apply_ne {n : Type u_1} {R : Type u_3} [Fintype n] [DecidableEq n] [CommSemiring R] (A : Matrix n n R) (i j : n) (h : i j) :
          (adjp 1 A * A) i j = (adjp (-1) A * A) i j
          theorem Matrix.mul_adjp_add_detp {n : Type u_1} {R : Type u_3} [Fintype n] [DecidableEq n] [CommSemiring R] (A : Matrix n n R) :
          A * adjp 1 A + detp (-1) A 1 = A * adjp (-1) A + detp 1 A 1
          theorem Matrix.detp_option_expand_row_none {n : Type u_1} {R : Type u_3} [Fintype n] [DecidableEq n] [CommSemiring R] (s : ˣ) (A : Matrix (Option n) (Option n) R) :
          detp s A = A none none * detp s (A.submatrix some some) + k : n, A none (some k) * detp (-s) (A.submatrix some (Function.update some k none))

          Laplace expansion of detp along the none row of an Option-indexed matrix.

          theorem Matrix.isAddUnit_mul {n : Type u_1} {R : Type u_3} [Fintype n] [DecidableEq n] [CommSemiring R] {A B : Matrix n n R} {d : nR} (hAB : A * B = diagonal d) (i j k : n) (hij : i j) :
          IsAddUnit (A i k * B k j)
          theorem Matrix.isAddUnit_detp_mul_detp {n : Type u_1} {R : Type u_3} [Fintype n] [DecidableEq n] [CommSemiring R] {A B : Matrix n n R} {d : nR} (hAB : A * B = diagonal d) :
          IsAddUnit (detp 1 A * detp (-1) B + detp (-1) A * detp 1 B)
          theorem Matrix.isAddUnit_detp_smul_mul_adjp {n : Type u_1} {R : Type u_3} [Fintype n] [DecidableEq n] [CommSemiring R] {A B : Matrix n n R} {d : nR} (hAB : A * B = diagonal d) :
          IsAddUnit (detp 1 A (B * adjp (-1) B) + detp (-1) A (B * adjp 1 B))
          theorem Matrix.detp_smul_add_adjp {n : Type u_1} {R : Type u_3} [Fintype n] [DecidableEq n] [CommSemiring R] {A B : Matrix n n R} (hAB : A * B = 1) :
          detp 1 B A + adjp (-1) B = detp (-1) B A + adjp 1 B
          theorem Matrix.detp_smul_adjp {n : Type u_1} {R : Type u_3} [Fintype n] [DecidableEq n] [CommSemiring R] {A B : Matrix n n R} (hAB : A * B = 1) :
          A + (detp 1 A adjp (-1) B + detp (-1) A adjp 1 B) = detp 1 A adjp 1 B + detp (-1) A adjp (-1) B