Skip to content

Commit 9998e6a

Browse files
committed
Resolve TODOs: drop CLM aliases, upgrade Jordan to CommRing, simplify grind calls, grind in Basic, simplify PosDef.zero_lt proof
1 parent cec7e36 commit 9998e6a

5 files changed

Lines changed: 6 additions & 31 deletions

File tree

QuantumInfo/ForMathlib/ContinuousLinearMap.lean

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,8 @@ Copyright (c) 2025 Alex Meiburg. All rights reserved.
33
Released under MIT license as described in the file LICENSE.
44
Authors: Alex Meiburg
55
-/
6-
--For the first three lemmas
76
import Mathlib.Topology.Algebra.Module.LinearMap
87

9-
--For the third lemma
108
import Mathlib.Analysis.CStarAlgebra.Classes
119
import Mathlib.Analysis.InnerProductSpace.Spectrum
1210
import Mathlib.Order.CompletePartialOrder
@@ -17,16 +15,6 @@ variable {R S : Type*} [Semiring R] [Semiring S] (σ : R →+* S) (M M₂ : Type
1715
variable [TopologicalSpace M] [AddCommMonoid M] [TopologicalSpace M₂] [AddCommMonoid M₂]
1816
variable [Module R M] [Module S M₂]
1917

20-
--These two theorems might look a bit silly as aliases of `LinearMap.____`, but they don't `simp` on their
21-
--TODO: I think we can remove these now that we've bumped to Lean 4.28.0
22-
@[simp]
23-
theorem range_zero [RingHomSurjective σ] : (0 : M →SL[σ] M₂).range = ⊥ := by
24-
simp
25-
26-
@[simp]
27-
theorem ker_zero : (0 : M →SL[σ] M₂).ker = ⊤ := by
28-
simp
29-
3018
theorem ker_mk (f : M →ₛₗ[σ] M₂) (hf : Continuous f.toFun) :
3119
(ContinuousLinearMap.mk f hf).ker = LinearMap.ker f := by
3220
rfl

QuantumInfo/ForMathlib/HermitianMat/Basic.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -726,7 +726,7 @@ theorem conj_ne_zero {A : HermitianMat d 𝕜} {M : Matrix d₂ d 𝕜} (hA : A
726726
theorem conj_ne_zero_iff {A : HermitianMat d 𝕜} {M : Matrix d₂ d 𝕜}
727727
(h : LinearMap.ker M.toEuclideanLin ≤ A.ker) : A.conj M ≠ 0 ↔ A ≠ 0 := by
728728
refine ⟨?_, (conj_ne_zero · h)⟩
729-
intro h rfl; simp at h--should be grind[= map_zero] but I don't know why. TODO.
729+
intro h rfl; grind
730730

731731
section spectrum
732732

QuantumInfo/ForMathlib/HermitianMat/Jordan.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,8 +130,8 @@ scoped instance : NonUnitalNonAssocRing (HermitianMat d 𝕜) where
130130

131131
variable [Invertible (2 : 𝕜)] [DecidableEq d]
132132

133-
--TODO: Upgrade this to NonAssocCommRing, see #28604 in Mathlib
134-
scoped instance : NonAssocRing (HermitianMat d 𝕜) where
133+
scoped instance : NonAssocCommRing (HermitianMat d 𝕜) where
134+
mul_comm := HermitianMat.symmMul_comm
135135

136136
end field
137137

QuantumInfo/ForMathlib/Matrix.lean

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1141,18 +1141,7 @@ theorem PosDef.zero_lt {n : Type*} [Nonempty n] [Fintype n] {A : Matrix n n ℂ}
11411141
apply lt_of_le_of_ne
11421142
· replace hA := hA.posSemidef
11431143
rwa [Matrix.nonneg_iff_posSemidef]
1144-
· rintro rfl
1145-
--wtf do better. TODO
1146-
have : ¬(0 < 0) := by trivial
1147-
classical rw [← Matrix.posDef_natCast_iff (n := n) (R := ℂ)] at this
1148-
revert hA
1149-
convert this
1150-
ext; simp
1151-
trans ((0 : ℕ) : ℂ)
1152-
· simp
1153-
classical
1154-
change _ = ite _ _ _
1155-
simp
1144+
· rintro rfl; exact absurd (hA.diag_pos (i := Classical.arbitrary n)) (by simp)
11561145

11571146

11581147
lemma IsHermitian.spectrum_eq_image_eigenvalues [Fintype n] {A : Matrix n n ℂ} (hA : A.IsHermitian) :

QuantumInfo/ForMathlib/SionMinimax.lean

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -425,8 +425,7 @@ private lemma sion_exists_min_2 (y₁ y₂ : N) (hy₁ : y₁ ∈ T) (hy₂ : y
425425
have hfxz (x) (hx : x ∈ S) (z) (hz : z ∈ segment ℝ y₁ y₂) : min (f x y₁) (f x y₂) ≤ f x z :=
426426
(hfq₁ x hx).min_le_mem_segment hy₁ hy₂ hz
427427
have hC'zAB (z) (hz : z ∈ segment ℝ y₁ y₂) : C' z ⊆ A ∪ B := by
428-
--TODO: On newer Mathlib this is just `grind [inf_le_iff, le_trans]`
429-
intro; simp [C', A, B]; grind [inf_le_iff, le_trans]
428+
intro; grind [inf_le_iff, le_trans]
430429
have hC'z (z) (hz : z ∈ segment ℝ y₁ y₂) : Convex ℝ (C' z) :=
431430
hfq₂ z (hT₂.segment_subset hy₁ hy₂ hz) β
432431
have hC'zAB (z) (hz : z ∈ segment ℝ y₁ y₂) : C' z ⊆ A ∨ C' z ⊆ B := by
@@ -650,8 +649,7 @@ private lemma sion_exists_min_fin
650649
apply h_bddB.mono
651650
rintro _ ⟨x, hx, rfl⟩
652651
use x, hx
653-
-- TODO: On a newer mathlib this line is just `grind`
654-
rcases max_cases (f x ↑y₀') (f x yₙ) <;> grind
652+
grind
655653
clear h_non_inter
656654
rw [lt_inf_iff]
657655
constructor

0 commit comments

Comments
 (0)