@@ -496,6 +496,23 @@ theorem mul_conjTranspose_self [StarOrderedRing R] [NoZeroDivisors R] (A : Matri
496496 classical
497497 simpa using mul_mul_conjTranspose_same .one hA
498498
499+ lemma mulVec_injective {M : Matrix n n R} (hM : M.PosDef) : Function.Injective M.mulVec := by
500+ intro _ _ hxy; by_contra h
501+ simpa [mulVec_sub, hxy] using hM.dotProduct_mulVec_pos (sub_ne_zero_of_ne h)
502+
503+ lemma _root_.Matrix.posDef_iff_posSemidef_and_mulVec_injective [StarOrderedRing R']
504+ [NoZeroDivisors R'] {A : Matrix n n R'} :
505+ PosDef A ↔ A.PosSemidef ∧ Function.Injective A.mulVec := by
506+ refine ⟨fun hA ↦ ⟨hA.posSemidef, hA.mulVec_injective⟩, fun ⟨hA, hA'⟩ ↦ ?_⟩
507+ refine posDef_iff_dotProduct_mulVec.mpr ⟨hA.isHermitian, fun x hx ↦ lt_of_le_of_ne' ?_ ?_⟩
508+ · exact hA.dotProduct_mulVec_nonneg x
509+ simpa [hA.dotProduct_mulVec_zero_iff, hx] using hA'.eq_iff (a := x) (b := 0 )
510+
511+ lemma _root_.Matrix.PosSemidef.posDef_iff_mulVec_injective [StarOrderedRing R']
512+ [NoZeroDivisors R'] {A : Matrix n n R'} (hA : A.PosSemidef) :
513+ PosDef A ↔ Function.Injective A.mulVec := by
514+ simp [posDef_iff_posSemidef_and_mulVec_injective, hA]
515+
499516theorem of_toQuadraticForm' {R : Type *} [CommRing R] [PartialOrder R] [StarRing R] [TrivialStar R]
500517 [DecidableEq n] {M : Matrix n n R} (hM : M.IsSymm)
501518 (hMq : M.toQuadraticForm'.PosDef) : M.PosDef := by
@@ -554,12 +571,8 @@ theorem det_pos [DecidableEq n] [Nontrivial R'] [IsOrderedRing R'] [PosMulReflec
554571section Field
555572variable {K : Type *} [Field K] [PartialOrder K] [StarRing K]
556573
557- theorem isUnit [DecidableEq n] {M : Matrix n n K} (hM : M.PosDef) : IsUnit M := by
558- by_contra h
559- obtain ⟨a, ha, ha2⟩ : ∃ a ≠ 0 , M *ᵥ a = 0 := by
560- obtain ⟨a, b, ha⟩ := Function.not_injective_iff.mp <| mulVec_injective_iff_isUnit.not.mpr h
561- exact ⟨a - b, by simp [sub_eq_zero, ha, mulVec_sub]⟩
562- simpa [ha2] using hM.dotProduct_mulVec_pos ha
574+ theorem isUnit [DecidableEq n] {M : Matrix n n K} (hM : M.PosDef) : IsUnit M :=
575+ mulVec_injective_iff_isUnit.mp (mulVec_injective hM)
563576
564577protected theorem inv [DecidableEq n] {M : Matrix n n K} (hM : M.PosDef) : M⁻¹.PosDef := by
565578 have := hM.mul_mul_conjTranspose_same (B := M⁻¹) ?_
@@ -574,6 +587,16 @@ theorem _root_.Matrix.posDef_inv_iff [DecidableEq n] {M : Matrix n n K} :
574587 letI := (Matrix.isUnit_nonsing_inv_iff.1 <| h.isUnit).invertible
575588 Matrix.inv_inv_of_invertible M ▸ h.inv, (·.inv)⟩
576589
590+ /-- A positive semi-definite matrix is positive definite if and only if it is invertible. -/
591+ @ [grind =]
592+ theorem _root_.Matrix.PosSemidef.posDef_iff_isUnit [DecidableEq n] [StarOrderedRing K]
593+ {A : Matrix n n K} (hA : A.PosSemidef) : A.PosDef ↔ IsUnit A := by
594+ simp [hA.posDef_iff_mulVec_injective, mulVec_injective_iff_isUnit]
595+
596+ lemma _root_.Matrix.PosSemidef.posDef_iff_det_ne_zero [DecidableEq n] [StarOrderedRing K]
597+ {A : Matrix n n K} (hA : A.PosSemidef) : A.PosDef ↔ A.det ≠ 0 := by
598+ simp [hA.posDef_iff_isUnit, isUnit_iff_isUnit_det]
599+
577600end Field
578601
579602section conjugate
0 commit comments