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.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.

    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.

    @[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 π•œ)
      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) :
      theorem Matrix.posSemidef_iff_isHermitian_and_spectrum_nonneg {π•œ : Type u_1} {n : Type u_2} [RCLike π•œ] [Fintype n] [DecidableEq n] {A : Matrix n n π•œ} :
      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.

      def Matrix.tracePositiveLinearMap (n : Type u_3) (Ξ± : Type u_4) (π•œ : Type u_5) [Fintype n] [Semiring Ξ±] [RCLike π•œ] [Module Ξ± π•œ] :
      Matrix n n π•œ β†’β‚š[Ξ±] π•œ

      Matrix.trace as a positive linear map.

      Equations
      Instances For
        @[simp]
        theorem Matrix.toLinearMap_tracePositiveLinearMap (n : Type u_3) (Ξ± : Type u_4) (π•œ : Type u_5) [Fintype n] [Semiring Ξ±] [RCLike π•œ] [Module Ξ± π•œ] :
        (tracePositiveLinearMap n Ξ± π•œ).toLinearMap = traceLinearMap n Ξ± π•œ
        @[simp]
        theorem Matrix.tracePositiveLinearMap_apply (n : Type u_3) (Ξ± : Type u_4) (π•œ : Type u_5) [Fintype n] [Semiring Ξ±] [RCLike π•œ] [Module Ξ± π•œ] (x : Matrix n n π•œ) :
        (tracePositiveLinearMap n Ξ± π•œ) x = x.trace
        @[implicit_reducible]
        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
          @[implicit_reducible]
          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
            @[implicit_reducible]
            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