Skip to content

Commit 6455ba8

Browse files
committed
feat: define IsPositive and Löwner order for LinearMap (leanprover-community#24471)
Moves: - ContinuousLinearMap.IsPositive.inner_nonneg_left -> ContinuousLinearMap.IsPositive.re_inner_nonneg_left - ContinuousLinearMap.IsPositive.inner_nonneg_right -> ContinuousLinearMap.IsPositive.re_inner_nonneg_right
1 parent 1c92026 commit 6455ba8

File tree

5 files changed

+270
-23
lines changed

5 files changed

+270
-23
lines changed

Mathlib/Analysis/InnerProductSpace/Adjoint.lean

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -451,6 +451,20 @@ theorem im_inner_adjoint_mul_self_eq_zero (T : E →ₗ[𝕜] E) (x : E) :
451451
simp only [Module.End.mul_apply, adjoint_inner_right, inner_self_eq_norm_sq_to_K]
452452
norm_cast
453453

454+
theorem isSelfAdjoint_toContinuousLinearMap_iff [CompleteSpace E] (T : E →ₗ[𝕜] E) :
455+
IsSelfAdjoint T.toContinuousLinearMap ↔ IsSelfAdjoint T := by
456+
simp only [IsSelfAdjoint, star, adjoint, LinearEquiv.trans_apply,
457+
coe_toContinuousLinearMap_symm,
458+
ContinuousLinearMap.toLinearMap_eq_iff_eq_toContinuousLinearMap]
459+
rfl
460+
461+
theorem _root_.ContinuousLinearMap.isSelfAdjoint_toLinearMap_iff [CompleteSpace E] (T : E →L[𝕜] E) :
462+
IsSelfAdjoint T.toLinearMap ↔ IsSelfAdjoint T := by
463+
simp only [IsSelfAdjoint, star, adjoint, LinearEquiv.trans_apply,
464+
coe_toContinuousLinearMap_symm,
465+
ContinuousLinearMap.toLinearMap_eq_iff_eq_toContinuousLinearMap]
466+
rfl
467+
454468
end LinearMap
455469

456470
section Unitary

Mathlib/Analysis/InnerProductSpace/Positive.lean

Lines changed: 211 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -8,21 +8,23 @@ import Mathlib.Analysis.InnerProductSpace.Adjoint
88
/-!
99
# Positive operators
1010
11-
In this file we define positive operators in a Hilbert space. We follow Bourbaki's choice
11+
In this file we define when an operator in a Hilbert space is positive. We follow Bourbaki's choice
1212
of requiring self adjointness in the definition.
1313
1414
## Main definitions
1515
16-
* `IsPositive` : a continuous linear map is positive if it is self adjoint and
17-
`∀ x, 0 ≤ re ⟪T x, x⟫`
16+
* `LinearMap.IsPositive` : a linear map is positive if it is self adjoint and
17+
`∀ x, 0 ≤ re ⟪T x, x⟫`.
18+
* `ContinuousLinearMap.IsPositive` : a continuous linear map is positive if it is self adjoint and
19+
`∀ x, 0 ≤ re ⟪T x, x⟫`.
1820
1921
## Main statements
2022
2123
* `ContinuousLinearMap.IsPositive.conj_adjoint` : if `T : E →L[𝕜] E` is positive,
2224
then for any `S : E →L[𝕜] F`, `S ∘L T ∘L S†` is also positive.
2325
* `ContinuousLinearMap.isPositive_iff_complex` : in a ***complex*** Hilbert space,
2426
checking that `⟪T x, x⟫` is a nonnegative real number for all `x` suffices to prove that
25-
`T` is positive
27+
`T` is positive.
2628
2729
## References
2830
@@ -33,20 +35,20 @@ of requiring self adjointness in the definition.
3335
Positive operator
3436
-/
3537

36-
37-
open InnerProductSpace RCLike ContinuousLinearMap
38+
open InnerProductSpace RCLike LinearMap ContinuousLinearMap
3839

3940
open scoped InnerProduct ComplexConjugate
4041

41-
namespace ContinuousLinearMap
42-
4342
variable {𝕜 E F : Type*} [RCLike 𝕜]
4443
variable [NormedAddCommGroup E] [NormedAddCommGroup F]
4544
variable [InnerProductSpace 𝕜 E] [InnerProductSpace 𝕜 F]
46-
variable [CompleteSpace E] [CompleteSpace F]
4745

4846
local notation "⟪" x ", " y "⟫" => inner 𝕜 x y
4947

48+
namespace ContinuousLinearMap
49+
50+
variable [CompleteSpace E] [CompleteSpace F]
51+
5052
/-- A continuous linear endomorphism `T` of a Hilbert space is **positive** if it is self adjoint
5153
and `∀ x, 0 ≤ re ⟪T x, x⟫`. -/
5254
def IsPositive (T : E →L[𝕜] E) : Prop :=
@@ -55,33 +57,72 @@ def IsPositive (T : E →L[𝕜] E) : Prop :=
5557
theorem IsPositive.isSelfAdjoint {T : E →L[𝕜] E} (hT : IsPositive T) : IsSelfAdjoint T :=
5658
hT.1
5759

58-
theorem IsPositive.inner_nonneg_left {T : E →L[𝕜] E} (hT : IsPositive T) (x : E) :
60+
theorem IsPositive.inner_left_eq_inner_right {T : E →L[𝕜] E} (hT : IsPositive T) (x : E) :
61+
⟪T x, x⟫ = ⟪x, T x⟫ := by
62+
rw [← adjoint_inner_left, show adjoint T = T from hT.left]
63+
64+
theorem IsPositive.re_inner_nonneg_left {T : E →L[𝕜] E} (hT : IsPositive T) (x : E) :
5965
0 ≤ re ⟪T x, x⟫ :=
6066
hT.2 x
6167

68+
theorem IsPositive.re_inner_nonneg_right {T : E →L[𝕜] E} (hT : IsPositive T) (x : E) :
69+
0 ≤ re ⟪x, T x⟫ := by rw [inner_re_symm]; exact hT.re_inner_nonneg_left x
70+
71+
open ComplexOrder in
72+
theorem isPositive_iff (T : E →L[𝕜] E) :
73+
IsPositive T ↔ IsSelfAdjoint T ∧ ∀ x, 0 ≤ ⟪T x, x⟫ := by
74+
simp_rw [IsPositive, and_congr_right_iff, ← RCLike.ofReal_nonneg (K := 𝕜), reApplyInnerSelf_apply]
75+
intro hT
76+
have := hT.isSymmetric.coe_re_inner_apply_self
77+
simp_all
78+
79+
open ComplexOrder in
80+
theorem IsPositive.inner_nonneg_left {T : E →L[𝕜] E} (hT : IsPositive T) (x : E) :
81+
0 ≤ ⟪T x, x⟫ :=
82+
((isPositive_iff T).mp hT).right x
83+
84+
open ComplexOrder in
6285
theorem IsPositive.inner_nonneg_right {T : E →L[𝕜] E} (hT : IsPositive T) (x : E) :
63-
0 ≤ re ⟪x, T x⟫ := by rw [inner_re_symm]; exact hT.inner_nonneg_left x
86+
0 ≤ ⟪x, T x⟫ := by
87+
rw [← hT.inner_left_eq_inner_right]
88+
exact inner_nonneg_left hT x
6489

90+
@[simp]
6591
theorem isPositive_zero : IsPositive (0 : E →L[𝕜] E) := by
6692
refine ⟨.zero _, fun x => ?_⟩
6793
change 0 ≤ re ⟪_, _⟫
6894
rw [zero_apply, inner_zero_left, ZeroHomClass.map_zero]
6995

96+
@[simp]
7097
theorem isPositive_one : IsPositive (1 : E →L[𝕜] E) :=
7198
⟨.one _, fun _ => inner_self_nonneg⟩
7299

100+
@[simp]
101+
theorem isPositive_natCast {n : ℕ} : IsPositive (n : E →L[𝕜] E) := by
102+
refine ⟨IsSelfAdjoint.natCast n, ?_⟩
103+
intro x
104+
simp [reApplyInnerSelf, ← Nat.cast_smul_eq_nsmul 𝕜, inner_smul_left]
105+
exact mul_nonneg n.cast_nonneg' inner_self_nonneg
106+
107+
@[simp]
108+
theorem isPositive_ofNat {n : ℕ} [n.AtLeastTwo] : IsPositive (ofNat(n) : E →L[𝕜] E) :=
109+
isPositive_natCast
110+
111+
@[aesop safe apply]
73112
theorem IsPositive.add {T S : E →L[𝕜] E} (hT : T.IsPositive) (hS : S.IsPositive) :
74113
(T + S).IsPositive := by
75114
refine ⟨hT.isSelfAdjoint.add hS.isSelfAdjoint, fun x => ?_⟩
76115
rw [reApplyInnerSelf, add_apply, inner_add_left, map_add]
77-
exact add_nonneg (hT.inner_nonneg_left x) (hS.inner_nonneg_left x)
116+
exact add_nonneg (hT.re_inner_nonneg_left x) (hS.re_inner_nonneg_left x)
78117

118+
@[aesop safe apply]
79119
theorem IsPositive.conj_adjoint {T : E →L[𝕜] E} (hT : T.IsPositive) (S : E →L[𝕜] F) :
80120
(S ∘L T ∘L S†).IsPositive := by
81121
refine ⟨hT.isSelfAdjoint.conj_adjoint S, fun x => ?_⟩
82122
rw [reApplyInnerSelf, comp_apply, ← adjoint_inner_right]
83-
exact hT.inner_nonneg_left _
123+
exact hT.re_inner_nonneg_left _
84124

125+
@[aesop safe apply]
85126
theorem IsPositive.adjoint_conj {T : E →L[𝕜] E} (hT : T.IsPositive) (S : F →L[𝕜] E) :
86127
(S† ∘L T ∘L S).IsPositive := by
87128
convert hT.conj_adjoint (S†)
@@ -144,20 +185,16 @@ section PartialOrder
144185
`StarOrderedRing`. -/
145186
instance instLoewnerPartialOrder : PartialOrder (E →L[𝕜] E) where
146187
le f g := (g - f).IsPositive
147-
le_refl _ := by simpa using isPositive_zero
188+
le_refl _ := by simp
148189
le_trans _ _ _ h₁ h₂ := by simpa using h₁.add h₂
149190
le_antisymm f₁ f₂ h₁ h₂ := by
150191
rw [← sub_eq_zero]
151192
have h_isSymm := isSelfAdjoint_iff_isSymmetric.mp <| IsPositive.isSelfAdjoint h₂
152193
exact_mod_cast h_isSymm.inner_map_self_eq_zero.mp fun x ↦ by
153-
apply RCLike.ext
154-
· rw [map_zero]
155-
apply le_antisymm
156-
· rw [← neg_nonneg, ← map_neg, ← inner_neg_left]
157-
simpa using h₁.inner_nonneg_left _
158-
· exact h₂.inner_nonneg_left _
159-
· rw [coe_sub, LinearMap.sub_apply, coe_coe, coe_coe, map_zero, ← sub_apply,
160-
← h_isSymm.coe_reApplyInnerSelf_apply (T := f₁ - f₂) x, RCLike.ofReal_im]
194+
open scoped ComplexOrder in
195+
refine le_antisymm ?_ (h₂.inner_nonneg_left x)
196+
rw [← neg_nonneg, ← inner_neg_left]
197+
simpa using h₁.inner_nonneg_left x
161198

162199
lemma le_def (f g : E →L[𝕜] E) : f ≤ g ↔ (g - f).IsPositive := Iff.rfl
163200

@@ -167,3 +204,155 @@ lemma nonneg_iff_isPositive (f : E →L[𝕜] E) : 0 ≤ f ↔ f.IsPositive := b
167204
end PartialOrder
168205

169206
end ContinuousLinearMap
207+
208+
namespace LinearMap
209+
210+
variable [FiniteDimensional 𝕜 E] [FiniteDimensional 𝕜 F]
211+
212+
/-- A linear map `T` of a Hilbert space is **positive** if it is self adjoint and
213+
`∀ x, 0 ≤ re ⟪T x, x⟫`. -/
214+
def IsPositive (T : E →ₗ[𝕜] E) : Prop :=
215+
IsSelfAdjoint T ∧ ∀ x, 0 ≤ re ⟪T x, x⟫
216+
217+
theorem IsPositive.isSelfAdjoint {T : E →ₗ[𝕜] E} (hT : IsPositive T) :
218+
IsSelfAdjoint T := hT.1
219+
220+
theorem IsPositive.re_inner_nonneg_left {T : E →ₗ[𝕜] E} (hT : IsPositive T)
221+
(x : E) : 0 ≤ re ⟪T x, x⟫ :=
222+
hT.2 x
223+
224+
theorem IsPositive.re_inner_nonneg_right {T : E →ₗ[𝕜] E} (hT : IsPositive T)
225+
(x : E) : 0 ≤ re ⟪x, T x⟫ := by
226+
rw [inner_re_symm]
227+
exact hT.re_inner_nonneg_left x
228+
229+
lemma isPositive_toContinuousLinearMap_iff [CompleteSpace E] (T : E →ₗ[𝕜] E) :
230+
T.toContinuousLinearMap.IsPositive ↔ T.IsPositive := by
231+
apply Iff.intro
232+
· intro hT
233+
apply And.intro
234+
· exact (isSelfAdjoint_toContinuousLinearMap_iff T).mp hT.left
235+
· intro x
236+
have hx : 0 ≤ re ⟪T x, x⟫ := hT.right x
237+
exact hx
238+
· intro hT
239+
apply And.intro
240+
· exact (isSelfAdjoint_toContinuousLinearMap_iff T).mpr hT.left
241+
· intro x
242+
simp [ContinuousLinearMap.reApplyInnerSelf]
243+
exact hT.right x
244+
245+
lemma _root_.ContinuousLinearMap.isPositive_toLinearMap_iff [CompleteSpace E] (T : E →L[𝕜] E) :
246+
(T : E →ₗ[𝕜] E).IsPositive ↔ T.IsPositive := by
247+
apply Iff.intro
248+
· intro hT
249+
apply And.intro
250+
· exact (isSelfAdjoint_toLinearMap_iff T).mp hT.left
251+
· intro x
252+
have hx : 0 ≤ re ⟪T x, x⟫ := hT.right x
253+
exact hx
254+
· intro hT
255+
apply And.intro
256+
· exact (isSelfAdjoint_toLinearMap_iff T).mpr hT.left
257+
· intro x
258+
have hx : 0 ≤ re ⟪T x, x⟫ := hT.right x
259+
simp [hx]
260+
261+
section Complex
262+
263+
variable {E' : Type*} [NormedAddCommGroup E'] [InnerProductSpace ℂ E'] [FiniteDimensional ℂ E']
264+
265+
theorem isPositive_iff_complex (T : E' →ₗ[ℂ] E') :
266+
IsPositive T ↔ ∀ x, (re ⟪T x, x⟫_ℂ : ℂ) = ⟪T x, x⟫_ℂ ∧ 0 ≤ re ⟪T x, x⟫_ℂ := by
267+
simp_rw [IsPositive, forall_and, ← isSymmetric_iff_isSelfAdjoint,
268+
LinearMap.isSymmetric_iff_inner_map_self_real, conj_eq_iff_re]
269+
rfl
270+
271+
end Complex
272+
273+
theorem IsPositive.isSymmetric {T : E →ₗ[𝕜] E} (hT : IsPositive T) :
274+
IsSymmetric T := (isSymmetric_iff_isSelfAdjoint T).mpr hT.isSelfAdjoint
275+
276+
open ComplexOrder in
277+
theorem isPositive_iff (T : E →ₗ[𝕜] E) :
278+
IsPositive T ↔ IsSelfAdjoint T ∧ ∀ x, 0 ≤ ⟪T x, x⟫ := by
279+
simp_rw [IsPositive, and_congr_right_iff, ← RCLike.ofReal_nonneg (K := 𝕜)]
280+
intro hT
281+
simp [isSymmetric_iff_isSelfAdjoint _ |>.mpr hT]
282+
283+
open ComplexOrder in
284+
theorem IsPositive.inner_nonneg_left {T : E →ₗ[𝕜] E} (hT : IsPositive T) (x : E) : 0 ≤ ⟪T x, x⟫ :=
285+
((isPositive_iff T).mp hT).right x
286+
287+
open ComplexOrder in
288+
theorem IsPositive.inner_nonneg_right {T : E →ₗ[𝕜] E} (hT : IsPositive T) (x : E) :
289+
0 ≤ ⟪x, T x⟫ := by
290+
rw [← hT.isSymmetric]
291+
exact hT.inner_nonneg_left x
292+
293+
@[simp]
294+
theorem isPositive_zero : IsPositive (0 : E →ₗ[𝕜] E) := ⟨.zero _, by simp⟩
295+
296+
@[simp]
297+
theorem isPositive_one : IsPositive (1 : E →ₗ[𝕜] E) := ⟨.one _, fun _ => inner_self_nonneg⟩
298+
299+
@[simp]
300+
theorem isPositive_natCast {n : ℕ} : IsPositive (n : E →ₗ[𝕜] E) := by
301+
refine ⟨IsSelfAdjoint.natCast n, ?_⟩
302+
intro x
303+
simp only [Module.End.natCast_apply, ← Nat.cast_smul_eq_nsmul 𝕜, inner_smul_left, map_natCast,
304+
mul_re, natCast_re, inner_self_im, mul_zero, sub_zero]
305+
exact mul_nonneg n.cast_nonneg' inner_self_nonneg
306+
307+
@[simp]
308+
theorem isPositive_ofNat {n : ℕ} [n.AtLeastTwo] : IsPositive (ofNat(n) : E →ₗ[𝕜] E) :=
309+
isPositive_natCast
310+
311+
@[aesop safe apply]
312+
theorem IsPositive.add {T S : E →ₗ[𝕜] E} (hT : T.IsPositive) (hS : S.IsPositive) :
313+
(T + S).IsPositive := by
314+
refine ⟨hT.isSelfAdjoint.add hS.isSelfAdjoint, fun x => ?_⟩
315+
rw [add_apply, inner_add_left, map_add]
316+
exact add_nonneg (hT.re_inner_nonneg_left x) (hS.re_inner_nonneg_left x)
317+
318+
@[aesop safe apply]
319+
theorem IsPositive.conj_adjoint {T : E →ₗ[𝕜] E} (hT : T.IsPositive) (S : E →ₗ[𝕜] F) :
320+
(S ∘ₗ T ∘ₗ S.adjoint).IsPositive := by
321+
refine And.intro ?_ ?_
322+
· rw [isSelfAdjoint_iff', adjoint_comp, adjoint_comp, adjoint_adjoint, ← star_eq_adjoint, hT.1]
323+
rfl
324+
· intro x
325+
rw [comp_apply, ← adjoint_inner_right]
326+
exact hT.re_inner_nonneg_left _
327+
328+
@[aesop safe apply]
329+
theorem IsPositive.adjoint_conj {T : E →ₗ[𝕜] E} (hT : T.IsPositive) (S : F →ₗ[𝕜] E) :
330+
(S.adjoint ∘ₗ T ∘ₗ S).IsPositive := by
331+
convert hT.conj_adjoint S.adjoint
332+
rw [adjoint_adjoint]
333+
334+
section PartialOrder
335+
336+
/-- The (Loewner) partial order on linear maps on a Hilbert space determined by `f ≤ g`
337+
if and only if `g - f` is a positive linear map (in the sense of `LinearMap.IsPositive`). -/
338+
instance instLoewnerPartialOrder : PartialOrder (E →ₗ[𝕜] E) where
339+
le f g := (g - f).IsPositive
340+
le_refl _ := by simp
341+
le_trans _ _ _ h₁ h₂ := by simpa using h₁.add h₂
342+
le_antisymm f₁ f₂ h₁ h₂ := by
343+
rw [← sub_eq_zero]
344+
have h_isSymm := (isSymmetric_iff_isSelfAdjoint (f₁ - f₂)).mpr h₂.isSelfAdjoint
345+
exact h_isSymm.inner_map_self_eq_zero.mp fun x ↦ by
346+
open scoped ComplexOrder in
347+
refine le_antisymm ?_ (h₂.inner_nonneg_left x)
348+
rw [← neg_nonneg, ← inner_neg_left]
349+
simpa using h₁.inner_nonneg_left x
350+
351+
lemma le_def (f g : E →ₗ[𝕜] E) : f ≤ g ↔ (g - f).IsPositive := Iff.rfl
352+
353+
lemma nonneg_iff_isPositive (f : E →ₗ[𝕜] E) : 0 ≤ f ↔ f.IsPositive := by
354+
simpa using le_def 0 f
355+
356+
end PartialOrder
357+
358+
end LinearMap

Mathlib/Analysis/InnerProductSpace/StarOrder.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ lemma IsPositive.spectrumRestricts {f : H →L[𝕜] H} (hf : f.IsPositive) :
4242
re_ofReal_mul, inner_self_eq_norm_sq, mul_comm]
4343
_ ≤ re ⟪(f + (algebraMap ℝ (H →L[𝕜] H)) c) x, x⟫_𝕜 := by
4444
simpa only [add_apply, inner_add_left, map_add, le_add_iff_nonneg_left]
45-
using hf.inner_nonneg_left x
45+
using hf.re_inner_nonneg_left x
4646
_ ≤ ‖⟪(f + (algebraMap ℝ (H →L[𝕜] H)) c) x, x⟫_𝕜‖ := RCLike.re_le_norm _
4747

4848
instance : NonnegSpectrumClass ℝ (H →L[𝕜] H) where

Mathlib/Analysis/InnerProductSpace/Symmetric.lean

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,26 @@ theorem IsSymmetric.restrictScalars {T : E →ₗ[𝕜] E} (hT : T.IsSymmetric)
127127
(T.restrictScalars ℝ).IsSymmetric :=
128128
fun x y => by simp [hT x y, real_inner_eq_re_inner, LinearMap.coe_restrictScalars ℝ]
129129

130+
@[simp]
131+
theorem IsSymmetric.im_inner_apply_self {T : E →ₗ[𝕜] E} (hT : T.IsSymmetric) (x : E) :
132+
im ⟪T x, x⟫ = 0 :=
133+
conj_eq_iff_im.mp <| hT.conj_inner_sym x x
134+
135+
@[simp]
136+
theorem IsSymmetric.im_inner_self_apply {T : E →ₗ[𝕜] E} (hT : T.IsSymmetric) (x : E) :
137+
im ⟪x, T x⟫ = 0 := by
138+
simp [← hT x x, hT]
139+
140+
@[simp]
141+
theorem IsSymmetric.coe_re_inner_apply_self {T : E →ₗ[𝕜] E} (hT : T.IsSymmetric) (x : E) :
142+
re ⟪T x, x⟫ = ⟪T x, x⟫ :=
143+
conj_eq_iff_re.mp <| hT.conj_inner_sym x x
144+
145+
@[simp]
146+
theorem IsSymmetric.coe_re_inner_self_apply {T : E →ₗ[𝕜] E} (hT : T.IsSymmetric) (x : E) :
147+
re ⟪x, T x⟫ = ⟪x, T x⟫ := by
148+
simp [← hT x x, hT]
149+
130150
section Complex
131151

132152
variable {V : Type*} [SeminormedAddCommGroup V] [InnerProductSpace ℂ V]

0 commit comments

Comments
 (0)