Documentation

Mathlib.LinearAlgebra.Matrix.PosDef

Positive Definite Matrices #

This file defines positive (semi)definite matrices and connects the notion to positive definiteness of quadratic forms. In Mathlib/Analysis/Matrix/Order.lean, positive semi-definiteness is used to define the partial order on matrices on or .

Main definitions #

Main results #

Positive semidefinite matrices #

def Matrix.PosSemidef {n : Type u_2} {R : Type u_3} [Ring R] [PartialOrder R] [StarRing R] (M : Matrix n n R) :

A matrix M : Matrix n n R is positive semidefinite if it is Hermitian and xᴴ * M * x is nonnegative for all x of finite support.

Equations
    Instances For
      theorem Matrix.PosSemidef.diagonal {n : Type u_2} {R : Type u_3} [Ring R] [PartialOrder R] [StarRing R] [StarOrderedRing R] [DecidableEq n] {d : nR} (h : 0 d) :
      @[simp]
      theorem Matrix.posSemidef_diagonal_iff {n : Type u_2} {R : Type u_3} [Ring R] [PartialOrder R] [StarRing R] [StarOrderedRing R] [DecidableEq n] {d : nR} :
      (diagonal d).PosSemidef ∀ (i : n), 0 d i

      A diagonal matrix is positive semidefinite iff its diagonal entries are nonnegative.

      theorem Matrix.PosSemidef.isHermitian {n : Type u_2} {R : Type u_3} [Ring R] [PartialOrder R] [StarRing R] {M : Matrix n n R} (hM : M.PosSemidef) :
      theorem Matrix.PosSemidef.submatrix {m : Type u_1} {n : Type u_2} {R : Type u_3} [Ring R] [PartialOrder R] [StarRing R] {M : Matrix n n R} (hM : M.PosSemidef) (e : mn) :
      theorem Matrix.PosSemidef.transpose {n : Type u_2} {R' : Type u_4} [CommRing R'] [PartialOrder R'] [StarRing R'] {M : Matrix n n R'} (hM : M.PosSemidef) :
      theorem Matrix.PosSemidef.add {m : Type u_1} {R : Type u_3} [Ring R] [PartialOrder R] [StarRing R] [AddLeftMono R] {A B : Matrix m m R} (hA : A.PosSemidef) (hB : B.PosSemidef) :
      theorem Matrix.PosSemidef.smul {n : Type u_2} {R : Type u_3} [Ring R] [PartialOrder R] [StarRing R] {α : Type u_5} [CommSemiring α] [PartialOrder α] [StarRing α] [StarOrderedRing α] [Algebra α R] [StarModule α R] [PosSMulMono α R] {x : Matrix n n R} (hx : x.PosSemidef) {a : α} (ha : 0 a) :
      theorem Matrix.PosSemidef.intCast {n : Type u_2} {R : Type u_3} [Ring R] [PartialOrder R] [StarRing R] [StarOrderedRing R] [DecidableEq n] (d : ) (hd : 0 d) :
      (↑d).PosSemidef
      @[simp]
      theorem Matrix.posSemidef_intCast_iff {n : Type u_2} {R : Type u_3} [Ring R] [PartialOrder R] [StarRing R] [StarOrderedRing R] [DecidableEq n] [Nonempty n] [Nontrivial R] (d : ) :
      (↑d).PosSemidef 0 d
      theorem Matrix.PosSemidef.diag_nonneg {n : Type u_2} {R : Type u_3} [Ring R] [PartialOrder R] [StarRing R] {A : Matrix n n R} (hA : A.PosSemidef) {i : n} :
      0 A i i
      @[simp]
      theorem Matrix.posSemidef_submatrix_equiv {m : Type u_1} {n : Type u_2} {R : Type u_3} [Ring R] [PartialOrder R] [StarRing R] {M : Matrix n n R} (e : m n) :
      theorem Matrix.posSemidef_sum {n : Type u_2} {R : Type u_3} [Ring R] [PartialOrder R] [StarRing R] {ι : Type u_5} [AddLeftMono R] {x : ιMatrix n n R} (s : Finset ι) (h : is, (x i).PosSemidef) :
      (∑ is, x i).PosSemidef

      Positive definite matrices #

      def Matrix.PosDef {n : Type u_2} {R : Type u_3} [Ring R] [PartialOrder R] [StarRing R] (M : Matrix n n R) :

      A matrix M : Matrix n n R is positive definite if it is Hermitian and xᴴMx is greater than zero for all nonzero x.

      Equations
        Instances For
          theorem Matrix.PosDef.isHermitian {n : Type u_2} {R : Type u_3} [Ring R] [PartialOrder R] [StarRing R] {M : Matrix n n R} (hM : M.PosDef) :
          theorem Matrix.PosDef.posSemidef {n : Type u_2} {R : Type u_3} [Ring R] [PartialOrder R] [StarRing R] {M : Matrix n n R} (hM : M.PosDef) :
          theorem Matrix.PosDef.transpose {n : Type u_2} {R' : Type u_4} [CommRing R'] [PartialOrder R'] [StarRing R'] {M : Matrix n n R'} (hM : M.PosDef) :
          @[simp]
          theorem Matrix.PosDef.transpose_iff {n : Type u_2} {R' : Type u_4} [CommRing R'] [PartialOrder R'] [StarRing R'] {M : Matrix n n R'} :
          theorem Matrix.PosDef.diagonal {n : Type u_2} {R : Type u_3} [Ring R] [PartialOrder R] [StarRing R] [StarOrderedRing R] [DecidableEq n] [NoZeroDivisors R] {d : nR} (h : ∀ (i : n), 0 < d i) :
          @[simp]
          theorem Matrix.posDef_diagonal_iff {n : Type u_2} {R : Type u_3} [Ring R] [PartialOrder R] [StarRing R] [StarOrderedRing R] [DecidableEq n] [NoZeroDivisors R] [Nontrivial R] {d : nR} :
          (diagonal d).PosDef ∀ (i : n), 0 < d i
          @[simp]
          theorem Matrix.PosDef.of_subsingleton {n : Type u_2} {R : Type u_3} [Ring R] [PartialOrder R] [StarRing R] (h : Subsingleton R) (M : Matrix n n R) :
          theorem Matrix.PosDef.natCast {n : Type u_2} {R : Type u_3} [Ring R] [PartialOrder R] [StarRing R] [StarOrderedRing R] [DecidableEq n] [NoZeroDivisors R] (d : ) (hd : d 0) :
          (↑d).PosDef
          @[simp]
          theorem Matrix.posDef_natCast_iff {n : Type u_2} {R : Type u_3} [Ring R] [PartialOrder R] [StarRing R] [StarOrderedRing R] [DecidableEq n] [NoZeroDivisors R] [Nonempty n] [Nontrivial R] {d : } :
          (↑d).PosDef 0 < d
          theorem Matrix.PosDef.intCast {n : Type u_2} {R : Type u_3} [Ring R] [PartialOrder R] [StarRing R] [StarOrderedRing R] [DecidableEq n] [NoZeroDivisors R] (d : ) (hd : 0 < d) :
          (↑d).PosDef
          @[simp]
          theorem Matrix.posDef_intCast_iff {n : Type u_2} {R : Type u_3} [Ring R] [PartialOrder R] [StarRing R] [StarOrderedRing R] [DecidableEq n] [NoZeroDivisors R] [Nonempty n] [Nontrivial R] {d : } :
          (↑d).PosDef 0 < d
          theorem Matrix.PosDef.add_posSemidef {m : Type u_1} {R : Type u_3} [Ring R] [PartialOrder R] [StarRing R] [AddLeftMono R] {A B : Matrix m m R} (hA : A.PosDef) (hB : B.PosSemidef) :
          (A + B).PosDef
          theorem Matrix.PosDef.posSemidef_add {m : Type u_1} {R : Type u_3} [Ring R] [PartialOrder R] [StarRing R] [AddLeftMono R] {A B : Matrix m m R} (hA : A.PosSemidef) (hB : B.PosDef) :
          (A + B).PosDef
          theorem Matrix.PosDef.add {m : Type u_1} {R : Type u_3} [Ring R] [PartialOrder R] [StarRing R] [AddLeftMono R] {A B : Matrix m m R} (hA : A.PosDef) (hB : B.PosDef) :
          (A + B).PosDef
          theorem Matrix.posDef_sum {m : Type u_1} {R : Type u_3} [Ring R] [PartialOrder R] [StarRing R] {ι : Type u_5} [AddLeftMono R] {A : ιMatrix m m R} {s : Finset ι} (hs : s.Nonempty) (hA : is, (A i).PosDef) :
          (∑ is, A i).PosDef
          theorem Matrix.PosDef.smul {n : Type u_2} {R : Type u_3} [Ring R] [PartialOrder R] [StarRing R] {α : Type u_5} [CommSemiring α] [PartialOrder α] [StarRing α] [StarOrderedRing α] [Algebra α R] [StarModule α R] [PosSMulStrictMono α R] {x : Matrix n n R} (hx : x.PosDef) {a : α} (ha : 0 < a) :
          (a x).PosDef
          theorem Matrix.PosDef.conjTranspose {n : Type u_2} {R : Type u_3} [Ring R] [PartialOrder R] [StarRing R] {M : Matrix n n R} (hM : M.PosDef) :
          theorem Matrix.PosDef.diag_pos {n : Type u_2} {R : Type u_3} [Ring R] [PartialOrder R] [StarRing R] [Nontrivial R] {A : Matrix n n R} (hA : A.PosDef) {i : n} :
          0 < A i i

          Finite positive semidefinite matrices #

          theorem Matrix.posSemidef_iff_dotProduct_mulVec {n : Type u_2} {R : Type u_3} [Ring R] [PartialOrder R] [StarRing R] [Fintype n] {M : Matrix n n R} :
          M.PosSemidef M.IsHermitian ∀ (x : nR), 0 star x ⬝ᵥ M.mulVec x

          A finite matrix M : Matrix n n R is positive semidefinite iff it is Hermitian and xᴴ * M * x is nonnegative for all x.

          @[simp]
          theorem Matrix.PosSemidef.dotProduct_mulVec_nonneg {n : Type u_2} {R : Type u_3} [Ring R] [PartialOrder R] [StarRing R] [Fintype n] {M : Matrix n n R} (hM : M.PosSemidef) (x : nR) :
          theorem Matrix.PosSemidef.of_dotProduct_mulVec_nonneg {n : Type u_2} {R : Type u_3} [Ring R] [PartialOrder R] [StarRing R] [Fintype n] {M : Matrix n n R} (hM1 : M.IsHermitian) (hM2 : ∀ (x : nR), 0 star x ⬝ᵥ M.mulVec x) :
          theorem Matrix.PosSemidef.conjTranspose_mul_mul_same {m : Type u_1} {n : Type u_2} {R : Type u_3} [Ring R] [PartialOrder R] [StarRing R] [Fintype n] [Finite m] {A : Matrix n n R} (hA : A.PosSemidef) (B : Matrix n m R) :
          theorem Matrix.PosSemidef.mul_mul_conjTranspose_same {m : Type u_1} {n : Type u_2} {R : Type u_3} [Ring R] [PartialOrder R] [StarRing R] [Fintype n] [Finite m] {A : Matrix n n R} (hA : A.PosSemidef) (B : Matrix m n R) :
          theorem Matrix.PosSemidef.pow {n : Type u_2} {R : Type u_3} [Ring R] [PartialOrder R] [StarRing R] [Fintype n] [StarOrderedRing R] [DecidableEq n] {M : Matrix n n R} (hM : M.PosSemidef) (k : ) :
          theorem Matrix.PosSemidef.inv {n : Type u_2} {R' : Type u_4} [CommRing R'] [PartialOrder R'] [StarRing R'] [Fintype n] [DecidableEq n] {M : Matrix n n R'} (hM : M.PosSemidef) :
          theorem Matrix.PosSemidef.zpow {n : Type u_2} {R' : Type u_4} [CommRing R'] [PartialOrder R'] [StarRing R'] [Fintype n] [StarOrderedRing R'] [DecidableEq n] {M : Matrix n n R'} (hM : M.PosSemidef) (z : ) :
          theorem Matrix.PosSemidef.trace_nonneg {n : Type u_2} {R : Type u_3} [Ring R] [PartialOrder R] [StarRing R] [Fintype n] [AddLeftMono R] {A : Matrix n n R} (hA : A.PosSemidef) :
          theorem Matrix.posSemidef_conjTranspose_mul_self {m : Type u_1} {n : Type u_2} {R : Type u_3} [Ring R] [PartialOrder R] [StarRing R] [Fintype m] [Finite n] [StarOrderedRing R] (A : Matrix m n R) :

          The conjugate transpose of a matrix multiplied by the matrix is positive semidefinite

          theorem Matrix.posSemidef_self_mul_conjTranspose {m : Type u_1} {n : Type u_2} {R : Type u_3} [Ring R] [PartialOrder R] [StarRing R] [Fintype n] [Finite m] [StarOrderedRing R] (A : Matrix m n R) :

          A matrix multiplied by its conjugate transpose is positive semidefinite

          theorem Matrix.IsUnit.posSemidef_star_left_conjugate_iff {n : Type u_2} {R : Type u_3} [Ring R] [PartialOrder R] [StarRing R] [Fintype n] [DecidableEq n] {U x : Matrix n n R} (hU : IsUnit U) :

          For an invertible matrix U, star U * x * U is positive semi-definite iff x is. This works on any ⋆-ring with a partial order.

          See IsUnit.star_left_conjugate_nonneg_iff for a similar statement for star-ordered rings.

          theorem Matrix.IsUnit.posSemidef_star_right_conjugate_iff {n : Type u_2} {R : Type u_3} [Ring R] [PartialOrder R] [StarRing R] [Fintype n] [DecidableEq n] {U x : Matrix n n R} (hU : IsUnit U) :

          For an invertible matrix U, U * x * star U is positive semi-definite iff x is. This works on any ⋆-ring with a partial order.

          See IsUnit.star_right_conjugate_nonneg_iff for a similar statement for star-ordered rings.

          theorem Matrix.posSemidef_vecMulVec_self_star {n : Type u_2} {R : Type u_3} [Ring R] [PartialOrder R] [StarRing R] [Finite n] [StarOrderedRing R] (a : nR) :

          The matrix vecMulVec a (star a) is always positive semi-definite.

          theorem Matrix.posSemidef_vecMulVec_star_self {n : Type u_2} {R : Type u_3} [Ring R] [PartialOrder R] [StarRing R] [Finite n] [StarOrderedRing R] (a : nR) :

          The matrix vecMulVec (star a) a is always positive semi-definite.

          Finite Positive definite matrices #

          theorem Matrix.posDef_iff_dotProduct_mulVec {n : Type u_2} {R : Type u_3} [Ring R] [PartialOrder R] [StarRing R] [Fintype n] {M : Matrix n n R} :
          M.PosDef M.IsHermitian ∀ ⦃x : nR⦄, x 00 < star x ⬝ᵥ M.mulVec x
          @[simp]
          theorem Matrix.PosDef.dotProduct_mulVec_pos {n : Type u_2} {R : Type u_3} [Ring R] [PartialOrder R] [StarRing R] [Fintype n] {M : Matrix n n R} (hM : M.PosDef) {x : nR} (hx : x 0) :

          A matrix M : Matrix n n R is positive definite if it is Hermitian and xᴴMx is greater than zero for all nonzero x.

          theorem Matrix.PosDef.of_dotProduct_mulVec_pos {n : Type u_2} {R : Type u_3} [Ring R] [PartialOrder R] [StarRing R] [Fintype n] {M : Matrix n n R} (hM1 : M.IsHermitian) (hM2 : ∀ ⦃x : nR⦄, x 00 < star x ⬝ᵥ M.mulVec x) :
          theorem Matrix.PosDef.conjTranspose_mul_mul_same {m : Type u_1} {n : Type u_2} {R : Type u_3} [Ring R] [PartialOrder R] [StarRing R] [Fintype n] [Fintype m] {A : Matrix n n R} {B : Matrix n m R} (hA : A.PosDef) (hB : Function.Injective B.mulVec) :
          theorem Matrix.PosDef.mul_mul_conjTranspose_same {m : Type u_1} {n : Type u_2} {R : Type u_3} [Ring R] [PartialOrder R] [StarRing R] [Fintype n] [Fintype m] {A : Matrix n n R} {B : Matrix m n R} (hA : A.PosDef) (hB : Function.Injective fun (v : mR) => vecMul v B) :
          theorem Matrix.PosDef.mul_conjTranspose_self {m : Type u_1} {n : Type u_2} {R : Type u_3} [Ring R] [PartialOrder R] [StarRing R] [Fintype n] [Fintype m] [StarOrderedRing R] [NoZeroDivisors R] (A : Matrix m n R) (hA : Function.Injective fun (v : mR) => vecMul v A) :
          theorem Matrix.PosDef.trace_pos {n : Type u_2} {R : Type u_3} [Ring R] [PartialOrder R] [StarRing R] [Fintype n] [Nontrivial R] [IsOrderedCancelAddMonoid R] [Nonempty n] {A : Matrix n n R} (hA : A.PosDef) :
          0 < A.trace
          theorem Matrix.PosDef.isUnit {n : Type u_2} [Fintype n] {K : Type u_5} [Field K] [PartialOrder K] [StarRing K] [DecidableEq n] {M : Matrix n n K} (hM : M.PosDef) :
          theorem Matrix.PosDef.inv {n : Type u_2} [Fintype n] {K : Type u_5} [Field K] [PartialOrder K] [StarRing K] [DecidableEq n] {M : Matrix n n K} (hM : M.PosDef) :
          @[simp]
          theorem Matrix.posDef_inv_iff {n : Type u_2} [Fintype n] {K : Type u_5} [Field K] [PartialOrder K] [StarRing K] [DecidableEq n] {M : Matrix n n K} :
          theorem Matrix.IsUnit.posDef_star_left_conjugate_iff {n : Type u_2} {R : Type u_3} [Ring R] [PartialOrder R] [StarRing R] [Fintype n] [DecidableEq n] {x U : Matrix n n R} (hU : IsUnit U) :
          (star U * x * U).PosDef x.PosDef

          For an invertible matrix U, star U * x * U is positive definite iff x is. This works on any ⋆-ring with a partial order.

          See IsUnit.isStrictlyPositive_star_left_conjugate_iff' for a similar statement for star-ordered rings. For matrices, positive definiteness is equivalent to strict positivity when the underlying field is or (see Matrix.isStrictlyPositive_iff_posDef).

          theorem Matrix.IsUnit.posDef_star_right_conjugate_iff {n : Type u_2} {R : Type u_3} [Ring R] [PartialOrder R] [StarRing R] [Fintype n] [DecidableEq n] {x U : Matrix n n R} (hU : IsUnit U) :
          (U * x * star U).PosDef x.PosDef

          For an invertible matrix U, U * x * star U is positive definite iff x is. This works on any ⋆-ring with a partial order.

          See IsUnit.isStrictlyPositive_star_right_conjugate_iff for a similar statement for star-ordered rings. For matrices, positive definiteness is equivalent to strict positivity when the underlying field is or (see Matrix.isStrictlyPositive_iff_posDef).

          theorem Matrix.PosDef.fromBlocks₁₁ {m : Type u_1} {n : Type u_2} {R' : Type u_4} [CommRing R'] [PartialOrder R'] [StarRing R'] [Fintype m] [StarOrderedRing R'] [Finite n] [DecidableEq m] {A : Matrix m m R'} (B : Matrix m n R') (D : Matrix n n R') (hA : A.PosDef) [Invertible A] :
          theorem Matrix.PosDef.fromBlocks₂₂ {m : Type u_1} {n : Type u_2} {R' : Type u_4} [CommRing R'] [PartialOrder R'] [StarRing R'] [Fintype n] [StarOrderedRing R'] [Finite m] [DecidableEq n] (A : Matrix m m R') (B : Matrix m n R') {D : Matrix n n R'} (hD : D.PosDef) [Invertible D] :