Documentation

Mathlib.Analysis.Matrix.Order

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 #

Implementation notes #

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

@[reducible, inline]
abbrev Matrix.instPreOrder {π•œ : Type u_1} {n : Type u_2} [RCLike π•œ] :
Preorder (Matrix n n π•œ)

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

Equations
    Instances For
      theorem Matrix.le_iff {π•œ : Type u_1} {n : Type u_2} [RCLike π•œ] {A B : Matrix n n π•œ} :
      theorem Matrix.nonneg_iff_posSemidef {π•œ : Type u_1} {n : Type u_2} [RCLike π•œ] {A : Matrix n n π•œ} :
      theorem Matrix.LE.le.posSemidef {π•œ : Type u_1} {n : Type u_2} [RCLike π•œ] {A : Matrix n n π•œ} :
      0 ≀ A β†’ A.PosSemidef

      Alias of the forward direction of Matrix.nonneg_iff_posSemidef.

      theorem Matrix.PosSemidef.nonneg {π•œ : Type u_1} {n : Type u_2} [RCLike π•œ] {A : Matrix n n π•œ} :
      A.PosSemidef β†’ 0 ≀ A

      Alias of the reverse direction of Matrix.nonneg_iff_posSemidef.

      @[reducible, inline]
      abbrev Matrix.instPartialOrder {π•œ : Type u_1} {n : Type u_2} [RCLike π•œ] :
      PartialOrder (Matrix n n π•œ)

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

      Equations
        Instances For
          theorem Matrix.instIsOrderedAddMonoid {π•œ : Type u_1} {n : Type u_2} [RCLike π•œ] :
          IsOrderedAddMonoid (Matrix n n π•œ)
          theorem Matrix.instNonnegSpectrumClass {π•œ : Type u_1} {n : Type u_2} [RCLike π•œ] [Fintype n] :
          theorem Matrix.instStarOrderedRing {π•œ : Type u_1} {n : Type u_2} [RCLike π•œ] [Fintype n] :
          StarOrderedRing (Matrix n n π•œ)
          @[deprecated CFC.sqrt (since := "2025-09-22")]
          noncomputable def Matrix.PosSemidef.sqrt {π•œ : Type u_1} {n : Type u_2} [RCLike π•œ] [Fintype n] [DecidableEq n] {A : Matrix n n π•œ} (hA : A.PosSemidef) :
          Matrix n n π•œ

          The positive semidefinite square root of a positive semidefinite matrix

          Equations
            Instances For
              @[deprecated CFC.sqrt_nonneg (since := "2025-09-22")]
              theorem Matrix.PosSemidef.posSemidef_sqrt {π•œ : Type u_1} {n : Type u_2} [RCLike π•œ] [Fintype n] [DecidableEq n] {A : Matrix n n π•œ} :
              @[deprecated CFC.sq_sqrt (since := "2025-09-22")]
              theorem Matrix.PosSemidef.sq_sqrt {π•œ : Type u_1} {n : Type u_2} [RCLike π•œ] [Fintype n] [DecidableEq n] {A : Matrix n n π•œ} (hA : A.PosSemidef) :
              CFC.sqrt A ^ 2 = A
              @[deprecated CFC.sqrt_mul_sqrt_self (since := "2025-09-22")]
              theorem Matrix.PosSemidef.sqrt_mul_self {π•œ : Type u_1} {n : Type u_2} [RCLike π•œ] [Fintype n] [DecidableEq n] {A : Matrix n n π•œ} (hA : A.PosSemidef) :
              @[deprecated CFC.sq_eq_sq_iff (since := "2025-09-24")]
              theorem Matrix.PosSemidef.sq_eq_sq_iff {π•œ : Type u_1} {n : Type u_2} [RCLike π•œ] [Fintype n] [DecidableEq n] {A : Matrix n n π•œ} (hA : A.PosSemidef) {B : Matrix n n π•œ} (hB : B.PosSemidef) :
              A ^ 2 = B ^ 2 ↔ A = B
              @[deprecated CFC.sq_eq_sq_iff (since := "2025-09-24")]
              theorem Matrix.PosSemidef.eq_of_sq_eq_sq {A : Type u_1} [PartialOrder A] [Ring A] [StarRing A] [TopologicalSpace A] [StarOrderedRing A] [Algebra ℝ A] [ContinuousFunctionalCalculus ℝ A IsSelfAdjoint] [NonnegSpectrumClass ℝ A] [IsTopologicalRing A] [T2Space A] (a b : A) (ha : 0 ≀ a := by cfc_tac) (hb : 0 ≀ b := by cfc_tac) :
              a ^ 2 = b ^ 2 β†’ a = b

              Alias of the forward direction of CFC.sq_eq_sq_iff.

              @[deprecated CFC.sqrt_sq (since := "2025-09-22")]
              theorem Matrix.PosSemidef.sqrt_sq {π•œ : Type u_1} {n : Type u_2} [RCLike π•œ] [Fintype n] [DecidableEq n] {A : Matrix n n π•œ} (hA : A.PosSemidef) :
              CFC.sqrt (A ^ 2) = A
              @[deprecated CFC.sqrt_eq_iff (since := "2025-09-23")]
              theorem Matrix.PosSemidef.eq_sqrt_iff_sq_eq {π•œ : Type u_1} {n : Type u_2} [RCLike π•œ] [Fintype n] [DecidableEq n] {A : Matrix n n π•œ} (hA : A.PosSemidef) {B : Matrix n n π•œ} (hB : B.PosSemidef) :
              A = CFC.sqrt B ↔ A ^ 2 = B
              @[deprecated CFC.sqrt_eq_iff (since := "2025-09-23")]
              theorem Matrix.PosSemidef.sqrt_eq_iff_eq_sq {π•œ : Type u_1} {n : Type u_2} [RCLike π•œ] [Fintype n] [DecidableEq n] {A : Matrix n n π•œ} (hA : A.PosSemidef) {B : Matrix n n π•œ} (hB : B.PosSemidef) :
              CFC.sqrt A = B ↔ A = B ^ 2
              @[deprecated CFC.sqrt_eq_zero_iff (since := "2025-09-22")]
              theorem Matrix.PosSemidef.sqrt_eq_zero_iff {π•œ : Type u_1} {n : Type u_2} [RCLike π•œ] [Fintype n] [DecidableEq n] {A : Matrix n n π•œ} (hA : A.PosSemidef) :
              CFC.sqrt A = 0 ↔ A = 0
              @[deprecated CFC.sqrt_eq_one_iff (since := "2025-09-23")]
              theorem Matrix.PosSemidef.sqrt_eq_one_iff {π•œ : Type u_1} {n : Type u_2} [RCLike π•œ] [Fintype n] [DecidableEq n] {A : Matrix n n π•œ} (hA : A.PosSemidef) :
              CFC.sqrt A = 1 ↔ A = 1
              @[deprecated CFC.isUnit_sqrt_iff (since := "2025-09-22")]
              theorem Matrix.PosSemidef.isUnit_sqrt_iff {π•œ : Type u_1} {n : Type u_2} [RCLike π•œ] [Fintype n] [DecidableEq n] {A : Matrix n n π•œ} (hA : A.PosSemidef) :
              theorem Matrix.PosSemidef.inv_sqrt {π•œ : Type u_1} {n : Type u_2} [RCLike π•œ] [Fintype n] [DecidableEq n] {A : Matrix n n π•œ} (hA : A.PosSemidef) :
              theorem Matrix.PosSemidef.dotProduct_mulVec_zero_iff {π•œ : Type u_1} {n : Type u_2} [RCLike π•œ] [Fintype n] {A : Matrix n n π•œ} (hA : A.PosSemidef) (x : n β†’ π•œ) :

              For A positive semidefinite, we have x⋆ A x = 0 iff A x = 0.

              theorem Matrix.PosSemidef.toLinearMapβ‚‚'_zero_iff {π•œ : Type u_1} {n : Type u_2} [RCLike π•œ] [Fintype n] [DecidableEq n] {A : Matrix n n π•œ} (hA : A.PosSemidef) (x : n β†’ π•œ) :
              (((toLinearMapβ‚‚' π•œ) A) (star x)) x = 0 ↔ A.mulVec x = 0

              For A positive semidefinite, we have x⋆ A x = 0 iff A x = 0 (linear maps version).

              theorem Matrix.PosSemidef.det_sqrt {π•œ : Type u_1} {n : Type u_2} [RCLike π•œ] [Fintype n] [DecidableEq n] {A : Matrix n n π•œ} (hA : A.PosSemidef) :
              theorem Matrix.IsHermitian.det_abs {π•œ : Type u_1} {n : Type u_2} [RCLike π•œ] [Fintype n] [DecidableEq n] {A : Matrix n n π•œ} (hA : A.IsHermitian) :
              @[deprecated CStarAlgebra.nonneg_iff_eq_star_mul_self (since := "2025-09-22")]
              theorem Matrix.posSemidef_iff_eq_conjTranspose_mul_self {π•œ : Type u_1} {n : Type u_2} [RCLike π•œ] [Fintype n] {A : Matrix n n π•œ} :
              A.PosSemidef ↔ βˆƒ (B : Matrix n n π•œ), A = B.conjTranspose * B

              A matrix is positive semidefinite if and only if it has the form Bα΄΄ * B for some B.

              theorem Matrix.posSemidef_iff_isHermitian_and_spectrum_nonneg {π•œ : Type u_1} {n : Type u_2} [RCLike π•œ] [Fintype n] [DecidableEq n] {A : Matrix n n π•œ} :
              @[deprecated commute_iff_mul_nonneg (since := "2025-09-23")]
              theorem Matrix.PosSemidef.commute_iff {π•œ : Type u_1} {n : Type u_2} [RCLike π•œ] [Fintype n] {A B : Matrix n n π•œ} (hA : A.PosSemidef) (hB : B.PosSemidef) :
              theorem Matrix.PosSemidef.posDef_iff_isUnit {π•œ : Type u_1} {n : Type u_2} [RCLike π•œ] [Fintype n] [DecidableEq n] {x : Matrix n n π•œ} (hx : x.PosSemidef) :

              A positive semi-definite matrix is positive definite if and only if it is invertible.

              theorem Matrix.isStrictlyPositive_iff_posDef {π•œ : Type u_1} {n : Type u_2} [RCLike π•œ] [Fintype n] [DecidableEq n] {x : Matrix n n π•œ} :
              theorem Matrix.PosDef.isStrictlyPositive {π•œ : Type u_1} {n : Type u_2} [RCLike π•œ] [Fintype n] [DecidableEq n] {x : Matrix n n π•œ} :

              Alias of the reverse direction of Matrix.isStrictlyPositive_iff_posDef.

              theorem Matrix.IsStrictlyPositive.posDef {π•œ : Type u_1} {n : Type u_2} [RCLike π•œ] [Fintype n] [DecidableEq n] {x : Matrix n n π•œ} :

              Alias of the forward direction of Matrix.isStrictlyPositive_iff_posDef.

              @[deprecated IsStrictlyPositive.commute_iff (since := "2025-09-26")]
              theorem Matrix.PosDef.commute_iff {π•œ : Type u_1} {n : Type u_2} [RCLike π•œ] [Fintype n] {A B : Matrix n n π•œ} (hA : A.PosDef) (hB : B.PosDef) :
              @[deprecated IsStrictlyPositive.sqrt (since := "2025-09-26")]
              theorem Matrix.PosDef.posDef_sqrt {π•œ : Type u_1} {n : Type u_2} [RCLike π•œ] [Fintype n] [DecidableEq n] {M : Matrix n n π•œ} (hM : M.PosDef) :
              theorem Matrix.PosSemidef.kronecker {π•œ : Type u_1} {n : Type u_2} [RCLike π•œ] [Finite n] {m : Type u_3} [Finite m] {x : Matrix n n π•œ} {y : Matrix m m π•œ} (hx : x.PosSemidef) (hy : y.PosSemidef) :
              (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 {π•œ : Type u_1} {n : Type u_2} [RCLike π•œ] [Finite n] {m : Type u_3} [Finite m] {x : Matrix n n π•œ} {y : Matrix m m π•œ} (hx : x.PosDef) (hy : y.PosDef) :
              (kroneckerMap (fun (x1 x2 : π•œ) => x1 * x2) x y).PosDef

              The kronecker of two positive definite matrices is positive definite.

              @[deprecated CStarAlgebra.isStrictlyPositive_iff_eq_star_mul_self (since := "2025-09-28")]
              theorem Matrix.posDef_iff_eq_conjTranspose_mul_self {π•œ : Type u_1} {n : Type u_2} [RCLike π•œ] [Fintype n] [DecidableEq n] {A : Matrix n n π•œ} :
              A.PosDef ↔ βˆƒ (B : Matrix n n π•œ), IsUnit B ∧ A = B.conjTranspose * B

              A matrix is positive definite if and only if it has the form Bα΄΄ * B for some invertible B.

              noncomputable def Matrix.toMatrixSeminormedAddCommGroup {π•œ : Type u_1} {n : Type u_2} [RCLike π•œ] [Fintype n] (M : Matrix n n π•œ) (hM : M.PosSemidef) :

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

              Equations
                Instances For
                  noncomputable def Matrix.toMatrixNormedAddCommGroup {π•œ : Type u_1} {n : Type u_2} [RCLike π•œ] [Fintype n] (M : Matrix n n π•œ) (hM : M.PosDef) :
                  NormedAddCommGroup (Matrix n n π•œ)

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

                  Equations
                    Instances For
                      def Matrix.toMatrixInnerProductSpace {π•œ : Type u_1} {n : Type u_2} [RCLike π•œ] [Fintype n] (M : Matrix n n π•œ) (hM : M.PosSemidef) :
                      InnerProductSpace π•œ (Matrix n n π•œ)

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

                      Equations
                        Instances For
                          @[deprecated Matrix.toMatrixNormedAddCommGroup (since := "2025-11-18")]
                          def Matrix.PosDef.matrixNormedAddCommGroup {π•œ : Type u_1} {n : Type u_2} [RCLike π•œ] [Fintype n] (M : Matrix n n π•œ) (hM : M.PosDef) :
                          NormedAddCommGroup (Matrix n n π•œ)

                          Alias of Matrix.toMatrixNormedAddCommGroup.


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

                          Equations
                            Instances For
                              @[deprecated Matrix.toMatrixInnerProductSpace (since := "2025-11-12")]
                              def Matrix.PosDef.matrixInnerProductSpace {π•œ : Type u_1} {n : Type u_2} [RCLike π•œ] [Fintype n] (M : Matrix n n π•œ) (hM : M.PosSemidef) :
                              InnerProductSpace π•œ (Matrix n n π•œ)

                              Alias of Matrix.toMatrixInnerProductSpace.


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

                              Equations
                                Instances For