@@ -328,6 +328,7 @@ theorem posSemidef_self_mul_conjTranspose [StarOrderedRing R] (A : Matrix m n R)
328328 PosSemidef (A * Aᴴ) := by
329329 simpa only [conjTranspose_conjTranspose] using posSemidef_conjTranspose_mul_self Aᴴ
330330
331+ -- move to a much earlier file
331332theorem _root_.isSelfAdjoint_sum {ι R : Type *} [AddCommMonoid R] [StarAddMonoid R] (s : Finset ι)
332333 {x : ι → R} (h : ∀ i ∈ s, IsSelfAdjoint (x i)) : IsSelfAdjoint (∑ i ∈ s, x i) := by
333334 simpa [IsSelfAdjoint, star_sum] using Finset.sum_congr rfl fun _ hi => h _ hi
@@ -541,6 +542,18 @@ protected lemma add [AddLeftMono R] {A : Matrix m m R} {B : Matrix m m R}
541542 (hA : A.PosDef) (hB : B.PosDef) : (A + B).PosDef :=
542543 hA.add_posSemidef hB.posSemidef
543544
545+ theorem _root_.Matrix.posDef_sum {ι : Type *} [AddLeftMono R] {A : ι → Matrix m m R}
546+ {s : Finset ι} (hs : s.Nonempty) (hA : ∀ i ∈ s, (A i).PosDef) : (∑ i ∈ s, A i).PosDef := by
547+ classical
548+ induction s using Finset.induction_on with
549+ | empty => simp at hs
550+ | insert i hi hins H =>
551+ rw [Finset.sum_insert hins]
552+ by_cases h : ¬ hi.Nonempty
553+ · simp_all
554+ · exact PosDef.add (hA _ <| Finset.mem_insert_self i hi) <|
555+ H (not_not.mp h) fun _ _hi => hA _ (Finset.mem_insert_of_mem _hi)
556+
544557protected theorem smul {α : Type *} [CommSemiring α] [PartialOrder α] [StarRing α]
545558 [StarOrderedRing α] [Algebra α R] [StarModule α R] [PosSMulStrictMono α R]
546559 {x : Matrix n n R} (hx : x.PosDef) {a : α} (ha : 0 < a) : (a • x).PosDef := by
0 commit comments