AFTD Auto-Formalizing Theoretical Domains

real_pos_def_has_invertible_gram_factor

theoremverified

Every finite real positive-definite matrix is the Gram matrix Fᵀ F of an invertible real square matrix F.

Statement

theorem real_pos_def_has_invertible_gram_factor {n : Type*} [Fintype n] [DecidableEq n] (H : Matrix n n ℝ) (hH : H.PosDef) : ∃ F : Matrix n n ℝ, IsUnit F.det ∧ F.transpose * F = H
Source
arXiv:2611.19367v1, Section III D–E, positive-definite factorization and singular-case extension.
Verified
18 Nov 2026
Axioms
Classical.choiceQuot.soundpropext

The proof, explained

The proof chooses the candidate matrix F to be the positive semidefinite square root √H obtained from the continuous functional calculus. Because H is positive-definite, it is invertible, so the identity (√H)² = H implies that √H is invertible and hence has a unit determinant. Furthermore, √H is non-negative and therefore self-adjoint, which over the real numbers means symmetric: (√H)ᵀ = √H. Substituting (√H)ᵀ = √H and (√H)² = H yields Fᵀ F = H.

  1. We choose F = √H, the square root of H provided by the continuous functional calculus, reducing the goal to showing that det F is a unit and Fᵀ F = H.

    We enable classical reasoning and equip the algebra of real matrices with its standard partial order (`Matrix.instPartialOrder`), star-ordered ring structure (`Matrix.instStarOrderedRing`), and non-negative spectrum property (`Matrix.instNonnegSpectrumClass`). These instances allow the continuous functional calculus to define F = √H, leaving two subgoals: proving that det(√H) is a unit and that (√H)ᵀ √H = H.

    lines 2–6

    uses Matrix.instPartialOrder, Matrix.instStarOrderedRing, Matrix.instNonnegSpectrumClass

      classical
      letI : PartialOrder (Matrix n n ℝ) := Matrix.instPartialOrder
      letI : StarOrderedRing (Matrix n n ℝ) := Matrix.instStarOrderedRing
      letI : NonnegSpectrumClass ℝ (Matrix n n ℝ) := Matrix.instNonnegSpectrumClass
      refine ⟨CFC.sqrt H, ?_, ?_⟩
  2. (√H)² = √H · √H = H.

    Since H is positive-definite (`Matrix.PosDef.isStrictlyPositive`), it is strictly positive and therefore non-negative (`IsStrictlyPositive.nonneg`). By the continuous functional calculus property `CFC.sq_sqrt`, the square of the square root of a non-negative element is the element itself; rewriting (√H)² as √H · √H via `pow_two` yields √H · √H = H.

    lines 7–9

    uses pow_two, CFC.sq_sqrt, IsStrictlyPositive.nonneg, Matrix.PosDef.isStrictlyPositive

      · have hsq : (CFC.sqrt H) * (CFC.sqrt H) = H := by
          simpa [pow_two] using
            CFC.sq_sqrt H (IsStrictlyPositive.nonneg (Matrix.PosDef.isStrictlyPositive hH))
  3. det(√H) is a unit in ℝ.

    Since √H · √H = H and every positive-definite matrix is invertible (`Matrix.PosDef.isUnit`), the product √H · √H is invertible. In a matrix ring, invertibility of the product implies invertibility of the factor √H (`isUnit_of_mul_isUnit_left`). Finally, a square matrix is invertible if and only if its determinant is a unit (`Matrix.isUnit_iff_isUnit_det`).

    lines 10–14

    uses Matrix.PosDef.isUnit, isUnit_of_mul_isUnit_left, Matrix.isUnit_iff_isUnit_det

        have hprod : IsUnit ((CFC.sqrt H) * (CFC.sqrt H)) := by
          rw [hsq]
          exact Matrix.PosDef.isUnit hH
        have hFunit : IsUnit (CFC.sqrt H) := isUnit_of_mul_isUnit_left hprod
        rwa [← Matrix.isUnit_iff_isUnit_det]
  4. (√H)² = √H · √H = H.

    In the second branch of the proof, we re-establish that √H · √H = H using the same argument: H is positive-definite, hence non-negative, so `CFC.sq_sqrt` and `pow_two` give √H · √H = H.

    lines 15–17

    uses pow_two, CFC.sq_sqrt, IsStrictlyPositive.nonneg, Matrix.PosDef.isStrictlyPositive

      · have hsq : (CFC.sqrt H) * (CFC.sqrt H) = H := by
          simpa [pow_two] using
            CFC.sq_sqrt H (IsStrictlyPositive.nonneg (Matrix.PosDef.isStrictlyPositive hH))
  5. √H is symmetric: (√H)ᵀ = √H.

    The functional calculus square root √H is non-negative (`CFC.sqrt_nonneg`), so it is self-adjoint (`IsSelfAdjoint.of_nonneg`), meaning star(√H) = √H. For matrices, star is the conjugate transpose (`Matrix.star_eq_conjTranspose`), which over ℝ coincides with the ordinary transpose (`Matrix.conjTranspose_eq_transpose_of_trivial`). Therefore, (√H)ᵀ = √H.

    lines 18–22

    uses IsSelfAdjoint.of_nonneg, CFC.sqrt_nonneg, Matrix.star_eq_conjTranspose, Matrix.conjTranspose_eq_transpose_of_trivial

        have hF : IsSelfAdjoint (CFC.sqrt H) := IsSelfAdjoint.of_nonneg (CFC.sqrt_nonneg H)
        have hstar : star (CFC.sqrt H) = CFC.sqrt H := hF
        have htr : (CFC.sqrt H).transpose = CFC.sqrt H := by
          rw [Matrix.star_eq_conjTranspose] at hstar
          simpa [Matrix.conjTranspose_eq_transpose_of_trivial] using hstar
  6. (√H)ᵀ √H = H.

    Substituting (√H)ᵀ = √H and √H · √H = H into the goal confirms that (√H)ᵀ √H = H, completing the proof.

    line 23

        rw [htr, hsq]
Matrix.instPartialOrder
The standard partial order on square matrices over an RCLike field.
Matrix.instStarOrderedRing
The star-ordered ring structure on square matrices over an RCLike field.
Matrix.instNonnegSpectrumClass
Every non-negative matrix over an RCLike field has non-negative real spectrum.
pow_two
In any monoid, the square of an element a ^ 2 equals a * a.
CFC.sq_sqrt
In an algebra equipped with continuous functional calculus, the square of the square root of a non-negative element a is a.
IsStrictlyPositive.nonneg
A strictly positive element in an ordered monoid with zero is non-negative (0 ≤ a).
Matrix.PosDef.isStrictlyPositive
Every positive-definite matrix is strictly positive.
Matrix.PosDef.isUnit
Every positive-definite matrix is invertible (a unit).
isUnit_of_mul_isUnit_left
In a Dedekind-finite monoid, if a product x * y is invertible, then x is invertible.
Matrix.isUnit_iff_isUnit_det
A square matrix over a commutative ring is invertible if and only if its determinant is invertible.
IsSelfAdjoint.of_nonneg
In a star-ordered ring, every non-negative element is self-adjoint.
CFC.sqrt_nonneg
The square root of an element produced by the continuous functional calculus is non-negative.
Matrix.star_eq_conjTranspose
The star involution on square matrices is the conjugate transpose.
Matrix.conjTranspose_eq_transpose_of_trivial
For matrices over a ring with trivial involution (such as ℝ), the conjugate transpose equals the ordinary transpose.

Written by a model (gemini-3.8-flash) from the Lean proof and the goal states Lean reported at each step. Lean verified the proof; this explanation is a reading aid and is not itself machine-checked.

Lean source view module on GitHub

theorem real_pos_def_has_invertible_gram_factor {n : Type*} [Fintype n] [DecidableEq n] (H : Matrix n n ℝ) (hH : H.PosDef) : ∃ F : Matrix n n ℝ, IsUnit F.det ∧ F.transpose * F = H := by  classical  letI : PartialOrder (Matrix n n ℝ) := Matrix.instPartialOrder  letI : StarOrderedRing (Matrix n n ℝ) := Matrix.instStarOrderedRing  letI : NonnegSpectrumClass ℝ (Matrix n n ℝ) := Matrix.instNonnegSpectrumClass  refine ⟨CFC.sqrt H, ?_, ?_⟩  · have hsq : (CFC.sqrt H) * (CFC.sqrt H) = H := by      simpa [pow_two] using        CFC.sq_sqrt H (IsStrictlyPositive.nonneg (Matrix.PosDef.isStrictlyPositive hH))    have hprod : IsUnit ((CFC.sqrt H) * (CFC.sqrt H)) := by      rw [hsq]      exact Matrix.PosDef.isUnit hH    have hFunit : IsUnit (CFC.sqrt H) := isUnit_of_mul_isUnit_left hprod    rwa [← Matrix.isUnit_iff_isUnit_det]  · have hsq : (CFC.sqrt H) * (CFC.sqrt H) = H := by      simpa [pow_two] using        CFC.sq_sqrt H (IsStrictlyPositive.nonneg (Matrix.PosDef.isStrictlyPositive hH))    have hF : IsSelfAdjoint (CFC.sqrt H) := IsSelfAdjoint.of_nonneg (CFC.sqrt_nonneg H)    have hstar : star (CFC.sqrt H) = CFC.sqrt H := hF    have htr : (CFC.sqrt H).transpose = CFC.sqrt H := by      rw [Matrix.star_eq_conjTranspose] at hstar      simpa [Matrix.conjTranspose_eq_transpose_of_trivial] using hstar    rw [htr, hsq]
See it in the graphDiscuss this resultChallenge it