Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
42d4e78
refactor
themathqueen Sep 22, 2025
b168fde
Merge branch 'master' into refactor_posDef
themathqueen Sep 22, 2025
69a51bb
revert
themathqueen Sep 22, 2025
97295f0
override dir
themathqueen Sep 22, 2025
f94bb82
more import overrides? idk
themathqueen Sep 22, 2025
ba36cbb
fix
themathqueen Sep 23, 2025
af40316
remove deprecated docstring
themathqueen Sep 23, 2025
1e25d63
remove?
themathqueen Sep 23, 2025
ecbf15e
revert
themathqueen Sep 23, 2025
a800e55
remove def
themathqueen Sep 23, 2025
e390e54
update test
themathqueen Sep 23, 2025
9e8147a
cleanup
themathqueen Sep 23, 2025
9c0adca
more cleanup
themathqueen Sep 23, 2025
c678365
cleanup
themathqueen Sep 23, 2025
6a20572
a lot more cleanup
themathqueen Sep 23, 2025
6119b9f
suggestions
themathqueen Sep 23, 2025
9828b96
commute_iff cfc
themathqueen Sep 23, 2025
b4ac9e3
new file
themathqueen Sep 23, 2025
430b300
remove docstring
themathqueen Sep 23, 2025
b3f9a64
lapmatrix
themathqueen Sep 23, 2025
e991aa3
Update Mathlib/Combinatorics/SimpleGraph/LapMatrix.lean
themathqueen Sep 23, 2025
d84e271
fix
themathqueen Sep 23, 2025
fc3b219
deprecations
themathqueen Sep 23, 2025
39b2d08
fix
themathqueen Sep 23, 2025
355b074
suggestions
themathqueen Sep 24, 2025
c4ee8b6
some golfs
themathqueen Sep 24, 2025
dc68bb0
Merge branch 'master' into refactor_posDef
themathqueen Sep 25, 2025
269905a
revert
themathqueen Sep 25, 2025
c756194
Remove duplicate entry in DirectoryDependency
themathqueen Sep 26, 2025
19f9bc6
Merge branch 'master' into refactor_posDef
themathqueen Sep 26, 2025
4a37c7f
Update Order.lean
themathqueen Sep 26, 2025
5cfcc43
golf
themathqueen Sep 26, 2025
b82f7f2
docstring
themathqueen Sep 26, 2025
f98e1b4
fix
themathqueen Sep 26, 2025
40c55f4
rename to nonneg_iff_posSemidef instead of nonneg_iff
themathqueen Sep 28, 2025
c68ee59
isStrictlyPositive_iff_posDef
themathqueen Sep 28, 2025
fb395ff
Merge branch 'master' into refactor_posDef_2
themathqueen Sep 28, 2025
e0837ac
deprecate stuff
themathqueen Sep 28, 2025
df90875
fix
themathqueen Sep 28, 2025
d699209
move sqrt_eq_one_iff
themathqueen Oct 3, 2025
fb53c58
Update Mathlib/Analysis/Matrix/Order.lean
themathqueen Oct 7, 2025
b2c41a2
20%?
themathqueen Oct 7, 2025
4839a73
safe
themathqueen Oct 7, 2025
2989375
sqrt_eq_one_iff'
themathqueen Oct 8, 2025
daee56b
cfc_tac instead of split_ifs<;>simp_all
themathqueen Oct 8, 2025
1d959d7
Merge branch 'refactor_posDef' into refactor_posDef_2
themathqueen Oct 8, 2025
bca60ca
safe forward
themathqueen Oct 8, 2025
4a88d98
Merge branch 'master' into refactor_posDef_2
themathqueen Oct 8, 2025
4f776bd
clean up
themathqueen Oct 8, 2025
2c8a54c
fix date
themathqueen Oct 8, 2025
9187ce3
Merge branch 'master' into refactor_posDef_2
themathqueen Oct 17, 2025
9ab71ac
move commute_iff
themathqueen Oct 17, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,11 @@ instance Nonneg.instContinuousFunctionalCalculus :
isUniformEmbedding_subtype_val le_rfl
(fun _ ↦ nonneg_iff_isSelfAdjoint_and_quasispectrumRestricts)

theorem IsStrictlyPositive.commute_iff {a b : A} (ha : IsStrictlyPositive a)
(hb : IsStrictlyPositive b) : Commute a b ↔ IsStrictlyPositive (a * b) := by
rw [commute_iff_mul_nonneg ha.nonneg hb.nonneg]
exact ⟨fun h => ha.isUnit.mul hb.isUnit |>.isStrictlyPositive h, fun h => h.nonneg⟩

end Nonneg

/-!
Expand Down
34 changes: 21 additions & 13 deletions Mathlib/Analysis/Matrix/Order.lean
Original file line number Diff line number Diff line change
Expand Up @@ -209,28 +209,35 @@ theorem PosSemidef.posDef_iff_isUnit [DecidableEq n] {x : Matrix n n 𝕜}
rw [← map_eq_zero_iff (f := (yᴴ * y).mulVecLin) (mulVec_injective_iff_isUnit.mpr h),
mulVecLin_apply, ← mulVec_mulVec, hv, mulVec_zero]

theorem isStrictlyPositive_iff_posDef [DecidableEq n] {x : Matrix n n 𝕜} :
IsStrictlyPositive x ↔ x.PosDef :=
⟨fun h => h.nonneg.posSemidef.posDef_iff_isUnit.mpr h.isUnit,
fun h => h.isUnit.isStrictlyPositive h.posSemidef.nonneg⟩

alias ⟨IsStrictlyPositive.posDef, PosDef.isStrictlyPositive⟩ := isStrictlyPositive_iff_posDef

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

@[deprecated IsStrictlyPositive.commute_iff (since := "2025-09-26")]
theorem PosDef.commute_iff {A B : Matrix n n 𝕜} (hA : A.PosDef) (hB : B.PosDef) :
Commute A B ↔ (A * B).PosDef := by
classical
rw [commute_iff_mul_nonneg hA.posSemidef.nonneg hB.posSemidef.nonneg, nonneg_iff_posSemidef]
exact ⟨fun h => h.posDef_iff_isUnit.mpr <| hA.isUnit.mul hB.isUnit, fun h => h.posSemidef⟩
rw [hA.isStrictlyPositive.commute_iff hB.isStrictlyPositive, isStrictlyPositive_iff_posDef]

@[deprecated IsStrictlyPositive.sqrt (since := "2025-09-26")]
lemma PosDef.posDef_sqrt [DecidableEq n] {M : Matrix n n 𝕜} (hM : M.PosDef) :
PosDef (CFC.sqrt M) :=
(CFC.sqrt_nonneg M).posSemidef.posDef_iff_isUnit.mpr <|
CFC.isUnit_sqrt_iff M hM.posSemidef.nonneg |>.mpr hM.isUnit
PosDef (CFC.sqrt M) := hM.isStrictlyPositive.sqrt.posDef

/--
A matrix is positive definite if and only if it has the form `Bᴴ * B` for some invertible `B`.
-/
@[deprecated CStarAlgebra.isStrictlyPositive_iff_eq_star_mul_self (since := "2025-09-28")]
lemma posDef_iff_eq_conjTranspose_mul_self [DecidableEq n] {A : Matrix n n 𝕜} :
PosDef A ↔ ∃ B : Matrix n n 𝕜, IsUnit B ∧ A = Bᴴ * B := by
refine ⟨fun hA ↦ ⟨_, hA.posDef_sqrt.isUnit, ?_⟩, fun ⟨B, hB, hA⟩ ↦ (hA ▸ ?_)⟩
· simp [hA.posDef_sqrt.isHermitian.eq, CFC.sqrt_mul_sqrt_self A hA.posSemidef.nonneg]
· exact PosDef.conjTranspose_mul_self _ (mulVec_injective_of_isUnit hB)
PosDef A ↔ ∃ B : Matrix n n 𝕜, IsUnit B ∧ A = Bᴴ * B :=
isStrictlyPositive_iff_posDef.symm.trans CStarAlgebra.isStrictlyPositive_iff_eq_star_mul_self

@[deprecated (since := "07-08-2025")] alias PosDef.posDef_iff_eq_conjTranspose_mul_self :=
Matrix.posDef_iff_eq_conjTranspose_mul_self
@[deprecated (since := "2025-08-07")] alias PosDef.posDef_iff_eq_conjTranspose_mul_self :=
CStarAlgebra.isStrictlyPositive_iff_eq_star_mul_self

/-- A positive definite matrix `M` induces a norm on `Matrix n n 𝕜`:
`‖x‖ = sqrt (x * M * xᴴ).trace`. -/
Expand All @@ -247,8 +254,9 @@ noncomputable def PosDef.matrixNormedAddCommGroup {M : Matrix n n 𝕜} (hM : M.
smul_left := by simp
definite x hx := by
classical
obtain ⟨y, hy, rfl⟩ := Matrix.posDef_iff_eq_conjTranspose_mul_self.mp hM
rw [← mul_assoc, ← conjTranspose_conjTranspose x, ← conjTranspose_mul,
obtain ⟨y, hy, rfl⟩ := CStarAlgebra.isStrictlyPositive_iff_eq_star_mul_self.mp
hM.isStrictlyPositive
rw [← mul_assoc, ← conjTranspose_conjTranspose x, star_eq_conjTranspose, ← conjTranspose_mul,
conjTranspose_conjTranspose, mul_assoc, trace_conjTranspose_mul_self_eq_zero_iff] at hx
lift y to (Matrix n n 𝕜)ˣ using hy
simpa [← mul_assoc] using congr(y⁻¹ * $hx) }
Expand Down