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 / V16. Normed spaces and functional analysis

Mathlib.Analysis.Matrix.Order

28 declarations and 1 deprecated aliases. Mathlib docs Β· Source

The partial order on matrices

This file constructs the partial order and star ordered instances on matrices on π•œ. This allows us to use more general results from C⋆-algebras, like CFC.sqrt.

Main results

  • Matrix.instPartialOrder: the partial order on matrices given by x ≀ y := (y - x).PosSemidef.
  • Matrix.toMatrixInnerProductSpace: the inner product on matrices induced by a positive semi-definite matrix M: βŸͺx, y⟫ = (y * M * xα΄΄).trace.

Implementation notes

Note that the partial order instance is scoped to MatrixOrder. Please open scoped MatrixOrder to use this.

abbrev Matrix.instPreOrder E1 #

{π•œ : Type u_1} β†’ {n : Type u_3} β†’ [RCLike π•œ] β†’ Preorder (Matrix n n π•œ)

The preorder on matrices given by A ≀ B := (B - A).PosSemidef.

theorem Matrix.le_iff E0 #

βˆ€ {π•œ : Type u_1} {n : Type u_3} [inst : RCLike π•œ] {A B : Matrix n n π•œ}, A ≀ B ↔ (B - A).PosSemidef

theorem Matrix.nonneg_iff_posSemidef E1 #

βˆ€ {π•œ : Type u_1} {n : Type u_3} [inst : RCLike π•œ] {A : Matrix n n π•œ}, 0 ≀ A ↔ A.PosSemidef

theorem Matrix.LE.le.posSemidef E1 #

βˆ€ {π•œ : Type u_1} {n : Type u_3} [inst : RCLike π•œ] {A : Matrix n n π•œ}, 0 ≀ A β†’ A.PosSemidef

Alias of the forward direction of Matrix.nonneg_iff_posSemidef.

theorem Matrix.PosSemidef.nonneg E1 #

βˆ€ {π•œ : Type u_1} {n : Type u_3} [inst : RCLike π•œ] {A : Matrix n n π•œ}, A.PosSemidef β†’ 0 ≀ A

Alias of the reverse direction of Matrix.nonneg_iff_posSemidef.

abbrev Matrix.instPartialOrder E3 #

{π•œ : Type u_1} β†’ {n : Type u_3} β†’ [RCLike π•œ] β†’ PartialOrder (Matrix n n π•œ)

The partial order on matrices given by A ≀ B := (B - A).PosSemidef.

theorem Matrix.instIsOrderedAddMonoid E1 #

βˆ€ {π•œ : Type u_1} {n : Type u_3} [inst : RCLike π•œ], IsOrderedAddMonoid (Matrix n n π•œ)

theorem Matrix.instOrderClosedTopology E1 #

βˆ€ {π•œ : Type u_1} {n : Type u_3} [inst : RCLike π•œ], OrderClosedTopology (Matrix n n π•œ)

theorem Matrix.instNonnegSpectrumClass E1 #

βˆ€ {π•œ : Type u_1} {n : Type u_3} [inst : RCLike π•œ] [inst_1 : Fintype n], NonnegSpectrumClass ℝ (Matrix n n π•œ)

theorem Matrix.instStarOrderedRing E1 #

βˆ€ {π•œ : Type u_1} {n : Type u_3} [inst : RCLike π•œ] [inst_1 : Fintype n], StarOrderedRing (Matrix n n π•œ)

theorem Matrix.PosSemidef.inv_sqrt E1 #

βˆ€ {π•œ : Type u_1} {n : Type u_3} [inst : RCLike π•œ] [inst_1 : Fintype n] [inst_2 : DecidableEq n] {A : Matrix n n π•œ},
  A.PosSemidef β†’ (CFC.sqrt A)⁻¹ = CFC.sqrt A⁻¹

theorem Matrix.PosSemidef.det_sqrt E1 #

βˆ€ {π•œ : Type u_1} {n : Type u_3} [inst : RCLike π•œ] [inst_1 : Fintype n] [inst_2 : DecidableEq n] {A : Matrix n n π•œ},
  A.PosSemidef β†’ (CFC.sqrt A).det = RCLike.sqrt A.det

theorem Matrix.IsHermitian.det_abs E1 #

βˆ€ {π•œ : Type u_1} {n : Type u_3} [inst : RCLike π•œ] [inst_1 : Fintype n] [inst_2 : DecidableEq n] {A : Matrix n n π•œ},
  A.IsHermitian β†’ (CFC.abs A).det = ↑‖A.detβ€–

theorem Matrix.posSemidef_iff_isHermitian_and_spectrum_nonneg E1 #

βˆ€ {π•œ : Type u_1} {n : Type u_3} [inst : RCLike π•œ] [inst_1 : Fintype n] [inst_2 : DecidableEq n] {A : Matrix n n π•œ},
  A.PosSemidef ↔ A.IsHermitian ∧ spectrum π•œ A βŠ† {a | 0 ≀ a}

theorem Matrix.isStrictlyPositive_iff_posDef E1 #

βˆ€ {π•œ : Type u_1} {n : Type u_3} [inst : RCLike π•œ] [inst_1 : Fintype n] [inst_2 : DecidableEq n] {x : Matrix n n π•œ},
  IsStrictlyPositive x ↔ x.PosDef

theorem Matrix.PosDef.isStrictlyPositive E1 #

βˆ€ {π•œ : Type u_1} {n : Type u_3} [inst : RCLike π•œ] [inst_1 : Fintype n] [inst_2 : DecidableEq n] {x : Matrix n n π•œ},
  x.PosDef β†’ IsStrictlyPositive x

Alias of the reverse direction of Matrix.isStrictlyPositive_iff_posDef.

theorem Matrix.IsStrictlyPositive.posDef E1 #

βˆ€ {π•œ : Type u_1} {n : Type u_3} [inst : RCLike π•œ] [inst_1 : Fintype n] [inst_2 : DecidableEq n] {x : Matrix n n π•œ},
  IsStrictlyPositive x β†’ x.PosDef

Alias of the forward direction of Matrix.isStrictlyPositive_iff_posDef.

theorem Matrix.PosSemidef.kronecker E1 #

βˆ€ {π•œ : Type u_1} {m : Type u_2} {n : Type u_3} [inst : RCLike π•œ] {x : Matrix n n π•œ} {y : Matrix m m π•œ},
  x.PosSemidef β†’ y.PosSemidef β†’ (Matrix.kroneckerMap (fun x1 x2 ↦ x1 * x2) x y).PosSemidef

The kronecker product of two positive semi-definite matrices is positive semi-definite.

theorem Matrix.PosDef.kronecker E1 #

βˆ€ {π•œ : Type u_1} {m : Type u_2} {n : Type u_3} [inst : RCLike π•œ] {x : Matrix n n π•œ} {y : Matrix m m π•œ},
  x.PosDef β†’ y.PosDef β†’ (Matrix.kroneckerMap (fun x1 x2 ↦ x1 * x2) x y).PosDef

The kronecker of two positive definite matrices is positive definite.

theorem Matrix.PosSemidef.hadamard E1 #

βˆ€ {π•œ : Type u_1} [inst : RCLike π•œ] {ΞΉ : Type u_4} {A B : Matrix ΞΉ ΞΉ π•œ},
  A.PosSemidef β†’ B.PosSemidef β†’ (A.hadamard B).PosSemidef

[Schur product theorem][schur1911] (positive semidefinite version): the Hadamard (entrywise) product of positive semidefinite matrices is positive semidefinite.

theorem Matrix.PosDef.hadamard E1 #

βˆ€ {π•œ : Type u_1} [inst : RCLike π•œ] {ΞΉ : Type u_4} {A B : Matrix ΞΉ ΞΉ π•œ}, A.PosDef β†’ B.PosDef β†’ (A.hadamard B).PosDef

Schur product theorem: the Hadamard (entrywise) product of positive definite matrices is positive definite.

def Matrix.tracePositiveLinearMap E1 #

(n : Type u_4) β†’
  (Ξ± : Type u_5) β†’
    (π•œ : Type u_6) β†’
      [Fintype n] β†’ [inst : Semiring Ξ±] β†’ [inst_1 : RCLike π•œ] β†’ [inst_2 : Module Ξ± π•œ] β†’ Matrix n n π•œ β†’β‚š[Ξ±] π•œ

Matrix.trace as a positive linear map.

theorem Matrix.toLinearMap_tracePositiveLinearMap E0 #

βˆ€ (n : Type u_4) (Ξ± : Type u_5) (π•œ : Type u_6) [inst : Fintype n] [inst_1 : Semiring Ξ±] [inst_2 : RCLike π•œ]
  [inst_3 : Module Ξ± π•œ], (Matrix.tracePositiveLinearMap n Ξ± π•œ).toLinearMap = Matrix.traceLinearMap n Ξ± π•œ

theorem Matrix.tracePositiveLinearMap_apply E0 #

βˆ€ (n : Type u_4) (Ξ± : Type u_5) (π•œ : Type u_6) [inst : Fintype n] [inst_1 : Semiring Ξ±] [inst_2 : RCLike π•œ]
  [inst_3 : Module Ξ± π•œ] (x : Matrix n n π•œ), (Matrix.tracePositiveLinearMap n Ξ± π•œ) x = x.trace

def Matrix.toMatrixSeminormedAddCommGroup E1 #

{π•œ : Type u_1} β†’
  (m : Type u_2) β†’
    {n : Type u_3} β†’
      [inst : RCLike π•œ] β†’
        [Fintype m] β†’ [Fintype n] β†’ (M : Matrix n n π•œ) β†’ M.PosSemidef β†’ SeminormedAddCommGroup (Matrix m n π•œ)

A positive definite matrix M induces a norm on Matrix m n π•œ β€–xβ€– = sqrt (x * M * xα΄΄).trace.

def Matrix.toMatrixNormedAddCommGroup E1 #

{π•œ : Type u_1} β†’
  (m : Type u_2) β†’
    {n : Type u_3} β†’
      [inst : RCLike π•œ] β†’ [Fintype m] β†’ [Fintype n] β†’ (M : Matrix n n π•œ) β†’ M.PosDef β†’ NormedAddCommGroup (Matrix m n π•œ)

A positive definite matrix M induces a norm on Matrix m n π•œ: β€–xβ€– = sqrt (x * M * xα΄΄).trace.

def Matrix.toMatrixInnerProductSpace E3 #

{π•œ : Type u_1} β†’
  (m : Type u_2) β†’
    {n : Type u_3} β†’
      [inst : RCLike π•œ] β†’
        [inst_1 : Fintype m] β†’
          [inst_2 : Fintype n] β†’ (M : Matrix n n π•œ) β†’ (hM : M.PosSemidef) β†’ InnerProductSpace π•œ (Matrix m n π•œ)

A positive semi-definite matrix M induces an inner product on Matrix m n π•œ: βŸͺx, y⟫ = (y * M * xα΄΄).trace.

instance Matrix.instIsometricContinuousFunctionalCalculus E0 #

βˆ€ {π•œ : Type u_1} {n : Type u_3} [inst : RCLike π•œ] [inst_1 : Fintype n] [inst_2 : DecidableEq n],
  IsometricContinuousFunctionalCalculus ℝ (Matrix n n π•œ) IsSelfAdjoint

The isometric continuous functional calculus on Matrix n n π•œ arising from the operator norm given by the identification with (continuous) linear endomorphisms of EuclideanSpace π•œ n.

Deprecated aliases

NameNew nameSince
Matrix.posSemidef_is_closedisClosed_setOfPred_posSemidef2026-10-28