Skip to content

Commit 25560be

Browse files
committed
feat(Analysis/InnerProductSpace): Gram matrix det ≠ 0 iff input vectors are independent (#37918)
Small lemma extracted from #37295. Convenient for talking about the determinant directly without detour through Pos(Semi)def
1 parent c82b385 commit 25560be

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

Mathlib/Analysis/InnerProductSpace/GramMatrix.lean

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ module
88
public import Mathlib.Analysis.InnerProductSpace.Basic
99
public import Mathlib.Analysis.InnerProductSpace.PiL2
1010
public import Mathlib.LinearAlgebra.Matrix.PosDef
11+
import Mathlib.Analysis.Matrix.Order
1112

1213
/-! # Gram Matrices
1314
@@ -95,6 +96,11 @@ theorem linearIndependent_of_posDef_gram {v : n → E} (h_gram : PosDef (gram
9596
have := h_gram.dotProduct_mulVec_pos (x := y)
9697
simp_all [star_dotProduct_gram_mulVec]
9798

99+
omit [Finite n] in
100+
theorem linearIndependent_of_det_gram_ne_zero [Fintype n] [DecidableEq n] {v : n → E}
101+
(h : (gram 𝕜 v).det ≠ 0) : LinearIndependent 𝕜 v :=
102+
linearIndependent_of_posDef_gram <| (posSemidef_gram 𝕜 v).posDef_iff_det_ne_zero.mpr h
103+
98104
end SemiInnerProductSpace
99105

100106
section NormedInnerProductSpace
@@ -116,6 +122,11 @@ theorem posDef_gram_iff_linearIndependent {v : n → E} :
116122
PosDef (gram 𝕜 v) ↔ LinearIndependent 𝕜 v :=
117123
⟨linearIndependent_of_posDef_gram, posDef_gram_of_linearIndependent⟩
118124

125+
omit [Finite n] in
126+
theorem det_gram_ne_zero_iff_linearIndependent [Fintype n] [DecidableEq n] {v : n → E} :
127+
(gram 𝕜 v).det ≠ 0 ↔ LinearIndependent 𝕜 v := by
128+
rw [← posDef_gram_iff_linearIndependent, (posSemidef_gram 𝕜 v).posDef_iff_det_ne_zero]
129+
119130
omit [Finite n] in
120131
theorem gram_eq_conjTranspose_mul {ι : Type*} [Fintype ι] (b : OrthonormalBasis ι 𝕜 E) (v : n → E) :
121132
letI m := of fun i j ↦ b.repr (v j) i

Mathlib/Analysis/Matrix/Order.lean

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,10 @@ alias ⟨IsStrictlyPositive.posDef, PosDef.isStrictlyPositive⟩ := isStrictlyPo
196196

197197
attribute [aesop safe forward (rule_sets := [CStarAlgebra])] PosDef.isStrictlyPositive
198198

199+
lemma PosSemidef.posDef_iff_det_ne_zero [DecidableEq n] {A : Matrix n n 𝕜} (hA : A.PosSemidef) :
200+
A.PosDef ↔ A.det ≠ 0 := by
201+
simp [hA.posDef_iff_isUnit, isUnit_iff_isUnit_det]
202+
199203
@[deprecated IsStrictlyPositive.commute_iff (since := "2025-09-26")]
200204
theorem PosDef.commute_iff {A B : Matrix n n 𝕜} (hA : A.PosDef) (hB : B.PosDef) :
201205
Commute A B ↔ (A * B).PosDef := by

0 commit comments

Comments
 (0)