Documentation

LeanPool.BollobasNikiforov.TN.Basic

Total nonnegativity #

A real matrix is totally nonnegative when every square minor formed by strictly increasing index maps is nonnegative. The empty (k = 0) minor is the determinant of a Matrix (Fin 0) (Fin 0), which Mathlib sets to 1.

Cauchy–Binet is proved only for a product with middle dimension 3, by enumerating the C(3, r) strictly increasing maps Fin r → Fin 3 (r = 0,1,2,3) and using rank for r > 3.

TN01: definition #

A matrix is totally nonnegative if every square minor with strictly increasing row and column index maps has nonnegative determinant. The k = 0 case is included: Matrix.det_fin_zero says the empty minor equals 1.

Equations
Instances For

    TN02: size-one minors and nondecreasing index maps #

    theorem BollobasNikiforov.strictMono_of_monotone_injective {α : Type u_3} {β : Type u_4} [LinearOrder α] [PartialOrder β] {f : αβ} (hmono : Monotone f) (hinj : Function.Injective f) :

    A monotone injective map out of a linear order is strictly increasing.

    theorem BollobasNikiforov.IsTotallyNonneg.apply {m : Type u_1} {n : Type u_2} [LinearOrder m] [LinearOrder n] {A : Matrix m n } (hA : IsTotallyNonneg A) (i : m) (j : n) :
    0 A i j

    Totally nonnegative matrices are entrywise nonnegative (the k = 1 minors).

    theorem BollobasNikiforov.det_submatrix_eq_zero_of_not_injective {m : Type u_1} {n : Type u_2} {k : } (A : Matrix m n ) {I : Fin km} {J : Fin kn} (h : ¬Function.Injective I ¬Function.Injective J) :
    (A.submatrix I J).det = 0
    theorem BollobasNikiforov.IsTotallyNonneg.det_submatrix_monotone {m : Type u_1} {n : Type u_2} [LinearOrder m] [LinearOrder n] {A : Matrix m n } (hA : IsTotallyNonneg A) {k : } {I : Fin km} {J : Fin kn} (hI : Monotone I) (hJ : Monotone J) :
    0 (A.submatrix I J).det

    If A is totally nonnegative and I, J are merely nondecreasing, the corresponding minor is still nonnegative: a repeated index forces determinant 0 when k ≥ 2, and an injective monotone map is strictly increasing.

    TN03: Cauchy–Binet of width 3 #

    @[reducible, inline]

    Strictly increasing maps Fin r → Fin 3. There are C(3, r) of them for r ≤ 3, and none when r > 3.

    Equations
    Instances For
      theorem BollobasNikiforov.det_eq_zero_of_rank_lt {r : } {A : Matrix (Fin r) (Fin r) } (h : A.rank < r) :
      A.det = 0
      theorem BollobasNikiforov.det_mul_eq_zero_of_three_lt {r : } (hr : 3 < r) (P : Matrix (Fin r) (Fin 3) ) (Q : Matrix (Fin 3) (Fin r) ) :
      (P * Q).det = 0
      theorem BollobasNikiforov.strictMono_eq_id {k : } {f : Fin kFin k} (hf : StrictMono f) :
      f = id

      The three strictly increasing maps Fin 2 → Fin 3 are Fin.succAbove k for k : Fin 3 (skip one of {0,1,2}).

      Equations
      Instances For

        All maps Fin 1 → Fin 3 are strictly monotone (the domain is a subsingleton).

        Equations
        Instances For

          Direct expansion of a 2 × 2 determinant of a product through width 3.

          theorem BollobasNikiforov.det_mul_eq_sum_strictMono_width3 {r : } (P : Matrix (Fin r) (Fin 3) ) (Q : Matrix (Fin 3) (Fin r) ) :
          (P * Q).det = S : StrictMonoFin3 r, (P.submatrix id S).det * (Q.submatrix (↑S) id).det

          Cauchy–Binet for P * Q with middle index Fin 3.

          theorem BollobasNikiforov.submatrix_mul_transpose {ι : Type u_3} {κ : Type u_4} {r : } (X : Matrix ι (Fin 3) ) (Y : Matrix κ (Fin 3) ) (I : Fin rι) (J : Fin rκ) :
          theorem BollobasNikiforov.det_submatrix_mul_transpose_eq_zero_of_lt {ι : Type u_3} {κ : Type u_4} {r : } (hr : 3 < r) (X : Matrix ι (Fin 3) ) (Y : Matrix κ (Fin 3) ) (I : Fin rι) (J : Fin rκ) :
          ((X * Y.transpose).submatrix I J).det = 0

          Square minors of size greater than 3 of a product X * Yᵀ vanish, since the factors have only three columns (rank at most 3).

          theorem BollobasNikiforov.det_submatrix_mul_transpose_eq_sum_strictMono {ι : Type u_3} {κ : Type u_4} {r : } (X : Matrix ι (Fin 3) ) (Y : Matrix κ (Fin 3) ) (I : Fin rι) (J : Fin rκ) :
          ((X * Y.transpose).submatrix I J).det = S : StrictMonoFin3 r, (X.submatrix I S).det * (Y.submatrix J S).det

          Cauchy–Binet for a product of two three-column real matrices. The sum runs over the strictly increasing maps Fin r → Fin 3 (equivalently, the C(3, r) increasing embeddings, enumerated as the unique empty map, the three constants, Fin.succAbove, and id). For r > 3 both sides are zero.

          TN04: product of two 3-column TN matrices #

          theorem BollobasNikiforov.IsTotallyNonneg.mul_transpose {ι : Type u_3} {κ : Type u_4} [LinearOrder ι] [LinearOrder κ] {X : Matrix ι (Fin 3) } {Y : Matrix κ (Fin 3) } (hX : IsTotallyNonneg X) (hY : IsTotallyNonneg Y) :

          The product X * Yᵀ of two three-column totally nonnegative matrices is totally nonnegative. Size r > 3 minors vanish by rank; smaller minors are nonnegative sums of products of TN minors via Cauchy–Binet.