Skip to content

Commit c9ee63a

Browse files
committed
feat: golf SpectrumRestricts.closedEmbedding_starAlgHom using uniform trickery (#13014)
1 parent 49e1c29 commit c9ee63a

File tree

2 files changed

+42
-35
lines changed

2 files changed

+42
-35
lines changed

Mathlib/Analysis/NormedSpace/Star/ContinuousFunctionalCalculus/Instances.lean

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,8 @@ lemma SpectrumRestricts.isSelfAdjoint (a : A) (ha : SpectrumRestricts a Complex.
9494
instance IsSelfAdjoint.instContinuousFunctionalCalculus [∀ x : A, CompactSpace (spectrum ℂ x)] :
9595
ContinuousFunctionalCalculus ℝ (IsSelfAdjoint : A → Prop) :=
9696
SpectrumRestricts.cfc (q := IsStarNormal) (p := IsSelfAdjoint) Complex.reCLM
97-
Complex.isometry_ofReal (fun _ ↦ isSelfAdjoint_iff_isStarNormal_and_spectrumRestricts)
97+
Complex.isometry_ofReal.uniformEmbedding
98+
(fun _ ↦ isSelfAdjoint_iff_isStarNormal_and_spectrumRestricts)
9899
(fun _ _ ↦ inferInstance)
99100

100101
lemma unitary_iff_isStarNormal_and_spectrum_subset_circle {u : A} :
@@ -161,7 +162,7 @@ open NNReal in
161162
instance Nonneg.instContinuousFunctionalCalculus [∀ a : A, CompactSpace (spectrum ℝ a)] :
162163
ContinuousFunctionalCalculus ℝ≥0 (fun x : A ↦ 0 ≤ x) :=
163164
SpectrumRestricts.cfc (q := IsSelfAdjoint) ContinuousMap.realToNNReal
164-
isometry_subtype_coe (fun _ ↦ nonneg_iff_isSelfAdjoint_and_spectrumRestricts)
165+
uniformEmbedding_subtype_val (fun _ ↦ nonneg_iff_isSelfAdjoint_and_spectrumRestricts)
165166
(fun _ _ ↦ inferInstance)
166167

167168
end Nonneg
@@ -317,14 +318,15 @@ variable {A : Type*} [TopologicalSpace A] [Ring A] [StarRing A] [Algebra ℂ A]
317318
lemma cfcHom_real_eq_restrict {a : A} (ha : IsSelfAdjoint a) :
318319
cfcHom ha = ha.spectrumRestricts.starAlgHom (cfcHom ha.isStarNormal) (f := Complex.reCLM) :=
319320
have := UniqueContinuousFunctionalCalculus.compactSpace_spectrum a (R := ℂ)
320-
ha.spectrumRestricts.cfcHom_eq_restrict Complex.isometry_ofReal ha ha.isStarNormal
321+
ha.spectrumRestricts.cfcHom_eq_restrict Complex.isometry_ofReal.uniformEmbedding
322+
ha ha.isStarNormal
321323

322324
lemma cfc_real_eq_complex {a : A} (f : ℝ → ℝ) (ha : IsSelfAdjoint a := by cfc_tac) :
323325
cfc f a = cfc (fun x ↦ f x.re : ℂ → ℂ) a := by
324326
have := UniqueContinuousFunctionalCalculus.compactSpace_spectrum a (R := ℂ)
325327
replace ha : IsSelfAdjoint a := ha -- hack to avoid issues caused by autoParam
326-
exact ha.spectrumRestricts.cfc_eq_restrict (f := Complex.reCLM) Complex.isometry_ofReal ha
327-
ha.isStarNormal f
328+
exact ha.spectrumRestricts.cfc_eq_restrict (f := Complex.reCLM)
329+
Complex.isometry_ofReal.uniformEmbedding ha ha.isStarNormal f
328330

329331
end RealEqComplex
330332

@@ -342,14 +344,14 @@ lemma cfcHom_nnreal_eq_restrict {a : A} (ha : 0 ≤ a) :
342344
cfcHom ha = (SpectrumRestricts.nnreal_of_nonneg ha).starAlgHom
343345
(cfcHom (IsSelfAdjoint.of_nonneg ha)) := by
344346
have := UniqueContinuousFunctionalCalculus.compactSpace_spectrum a (R := ℝ)
345-
apply (SpectrumRestricts.nnreal_of_nonneg ha).cfcHom_eq_restrict isometry_subtype_coe
347+
apply (SpectrumRestricts.nnreal_of_nonneg ha).cfcHom_eq_restrict uniformEmbedding_subtype_val
346348

347349
lemma cfc_nnreal_eq_real {a : A} (f : ℝ≥0 → ℝ≥0) (ha : 0 ≤ a := by cfc_tac) :
348350
cfc f a = cfc (fun x ↦ f x.toNNReal : ℝ → ℝ) a := by
349351
have := UniqueContinuousFunctionalCalculus.compactSpace_spectrum a (R := ℝ)
350352
replace ha : 0 ≤ a := ha -- hack to avoid issues caused by autoParam
351353
apply (SpectrumRestricts.nnreal_of_nonneg ha).cfc_eq_restrict
352-
isometry_subtype_coe ha (.of_nonneg ha)
354+
uniformEmbedding_subtype_val ha (.of_nonneg ha)
353355

354356
end NNRealEqReal
355357

Mathlib/Analysis/NormedSpace/Star/ContinuousFunctionalCalculus/Restrict.lean

Lines changed: 33 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,23 @@ simply by proving:
2424
2. `0 ≤ x ↔ IsSelfAdjoint x ∧ SpectrumRestricts Real.toNNReal x`.
2525
-/
2626

27+
open Set
28+
2729
namespace SpectrumRestricts
2830

31+
/-- The homeomorphism `spectrum S a ≃ₜ spectrum R a` induced by `SpectrumRestricts a f`. -/
32+
def homeomorph {R S A : Type*} [Semifield R] [Semifield S] [Ring A]
33+
[Algebra R S] [Algebra R A] [Algebra S A] [IsScalarTower R S A] [TopologicalSpace R]
34+
[TopologicalSpace S] [ContinuousSMul R S] {a : A} {f : C(S, R)} (h : SpectrumRestricts a f) :
35+
spectrum S a ≃ₜ spectrum R a where
36+
toFun := MapsTo.restrict f _ _ h.subset_preimage
37+
invFun := MapsTo.restrict (algebraMap R S) _ _ (image_subset_iff.mp h.algebraMap_image.subset)
38+
left_inv x := Subtype.ext <| h.rightInvOn x.2
39+
right_inv x := Subtype.ext <| h.left_inv x
40+
continuous_toFun := continuous_induced_rng.mpr <| f.continuous.comp continuous_induced_dom
41+
continuous_invFun := continuous_induced_rng.mpr <|
42+
continuous_algebraMap R S |>.comp continuous_induced_dom
43+
2944
lemma compactSpace {R S A : Type*} [Semifield R] [Semifield S] [Ring A]
3045
[Algebra R S] [Algebra R A] [Algebra S A] [IsScalarTower R S A] [TopologicalSpace R]
3146
[TopologicalSpace S] {a : A} (f : C(S, R)) (h : SpectrumRestricts a f)
@@ -60,23 +75,12 @@ variable [CompleteSpace R]
6075

6176
lemma closedEmbedding_starAlgHom {a : A} {φ : C(spectrum S a, S) →⋆ₐ[S] A}
6277
(hφ : ClosedEmbedding φ) {f : C(S, R)} (h : SpectrumRestricts a f)
63-
(h_isom : Isometry (algebraMap R S)) [h_cpct : CompactSpace (spectrum S a)] :
64-
ClosedEmbedding (h.starAlgHom φ) := by
65-
apply hφ.comp
66-
simp only [RingHom.coe_coe, StarAlgHom.coe_toAlgHom, StarAlgHom.comp_apply,
67-
ContinuousMap.compStarAlgHom'_apply, ContinuousMap.compStarAlgHom_apply]
68-
have : CompactSpace (spectrum R a) := h.compactSpace
69-
apply Isometry.closedEmbedding ?_
70-
simp only [isometry_iff_dist_eq]
71-
refine fun g₁ g₂ ↦ le_antisymm ?_ ?_
72-
all_goals refine (ContinuousMap.dist_le dist_nonneg).mpr fun x ↦ ?_
73-
· simpa [h_isom.dist_eq] using ContinuousMap.dist_apply_le_dist _
74-
· obtain ⟨y, y_mem, hy⟩ : (x : R) ∈ f '' spectrum S a := h.image.symm ▸ x.2
75-
lift y to spectrum S a using y_mem
76-
refine le_of_eq_of_le ?_ <| ContinuousMap.dist_apply_le_dist y
77-
simp only [ContinuousMap.coe_mk, ContinuousMap.comp_apply, StarAlgHom.ofId_apply]
78-
rw [h_isom.dist_eq]
79-
congr <;> exact Subtype.ext hy.symm
78+
(halg : UniformEmbedding (algebraMap R S)) [CompactSpace (spectrum S a)] :
79+
ClosedEmbedding (h.starAlgHom φ) :=
80+
have := h.compactSpace
81+
hφ.comp <| UniformEmbedding.toClosedEmbedding <| .comp
82+
(ContinuousMap.uniformEmbedding_comp _ halg)
83+
(UniformEquiv.arrowCongr h.homeomorph.symm (.refl _) |>.uniformEmbedding)
8084

8185
lemma starAlgHom_id {a : A} {φ : C(spectrum S a, S) →⋆ₐ[S] A} {f : C(S, R)}
8286
(h : SpectrumRestricts a f) (h_id : φ (.restrict (spectrum S a) <| .id S) = a) :
@@ -90,15 +94,16 @@ lemma starAlgHom_id {a : A} {φ : C(spectrum S a, S) →⋆ₐ[S] A} {f : C(S, R
9094
characterized by: `q a` and the spectrum of `a` restricts to the scalar subring `R` via
9195
`f : C(S, R)`, then we can get a restricted functional calculus
9296
`ContinuousFunctionalCalculus R p`. -/
93-
protected theorem cfc (f : C(S, R)) (h_isom : Isometry (algebraMap R S))
97+
protected theorem cfc (f : C(S, R)) (halg : UniformEmbedding (algebraMap R S))
9498
(h : ∀ a, p a ↔ q a ∧ SpectrumRestricts a f) (h_cpct : ∀ a, q a → CompactSpace (spectrum S a)) :
9599
ContinuousFunctionalCalculus R p where
96100
exists_cfc_of_predicate a ha := by
97101
refine ⟨((h a).mp ha).2.starAlgHom (cfcHom ((h a).mp ha).1 (R := S)),
98102
?hom_closedEmbedding, ?hom_id, ?hom_map_spectrum, ?predicate_hom⟩
99103
case hom_closedEmbedding =>
100-
exact ((h a).mp ha).2.closedEmbedding_starAlgHom (cfcHom_closedEmbedding ((h a).mp ha).1)
101-
h_isom (h_cpct := h_cpct a ((h a).mp ha).1)
104+
have := h_cpct a ((h a).mp ha).1
105+
exact ((h a).mp ha).2.closedEmbedding_starAlgHom
106+
(cfcHom_closedEmbedding ((h a).mp ha).1) halg
102107
case hom_id => exact ((h a).mp ha).2.starAlgHom_id <| cfcHom_id ((h a).mp ha).1
103108
case hom_map_spectrum =>
104109
intro g
@@ -128,27 +133,27 @@ protected theorem cfc (f : C(S, R)) (h_isom : Isometry (algebraMap R S))
128133

129134
variable [ContinuousFunctionalCalculus R p] [UniqueContinuousFunctionalCalculus R A]
130135

131-
lemma cfcHom_eq_restrict (f : C(S, R)) (h_isom : Isometry (algebraMap R S)) {a : A} (hpa : p a)
132-
(hqa : q a) (h : SpectrumRestricts a f) [CompactSpace (spectrum S a)] :
136+
lemma cfcHom_eq_restrict (f : C(S, R)) (halg : UniformEmbedding (algebraMap R S))
137+
{a : A} (hpa : p a) (hqa : q a) (h : SpectrumRestricts a f) [CompactSpace (spectrum S a)] :
133138
cfcHom hpa = h.starAlgHom (cfcHom hqa) := by
134139
apply cfcHom_eq_of_continuous_of_map_id
135-
· exact h.closedEmbedding_starAlgHom (cfcHom_closedEmbedding hqa) h_isom |>.continuous
140+
· exact h.closedEmbedding_starAlgHom (cfcHom_closedEmbedding hqa) halg |>.continuous
136141
· exact h.starAlgHom_id (cfcHom_id hqa)
137142

138-
lemma cfc_eq_restrict (f : C(S, R)) (h_isom : Isometry (algebraMap R S)) {a : A} (hpa : p a)
143+
lemma cfc_eq_restrict (f : C(S, R)) (halg : UniformEmbedding (algebraMap R S)) {a : A} (hpa : p a)
139144
(hqa : q a) (h : SpectrumRestricts a f) [CompactSpace (spectrum S a)] (g : R → R) :
140145
cfc g a = cfc (fun x ↦ algebraMap R S (g (f x))) a := by
141146
by_cases hg : ContinuousOn g (spectrum R a)
142-
· rw [cfc_apply g a, cfcHom_eq_restrict f h_isom hpa hqa h, SpectrumRestricts.starAlgHom_apply,
147+
· rw [cfc_apply g a, cfcHom_eq_restrict f halg hpa hqa h, SpectrumRestricts.starAlgHom_apply,
143148
cfcHom_eq_cfc_extend 0]
144149
apply cfc_congr fun x hx ↦ ?_
145150
lift x to spectrum S a using hx
146151
simp [Function.comp, Subtype.val_injective.extend_apply]
147152
· have : ¬ ContinuousOn (fun x ↦ algebraMap R S (g (f x)) : S → S) (spectrum S a) := by
148153
refine fun hg' ↦ hg ?_
149-
rw [h_isom.embedding.continuousOn_iff]
150-
simpa [h_isom.embedding.continuousOn_iff, Function.comp, h.left_inv _] using
151-
hg'.comp h_isom.continuous.continuousOn (fun _ : R ↦ spectrum.algebraMap_mem S)
154+
rw [halg.embedding.continuousOn_iff]
155+
simpa [halg.embedding.continuousOn_iff, Function.comp, h.left_inv _] using
156+
hg'.comp halg.embedding.continuous.continuousOn (fun _ : R ↦ spectrum.algebraMap_mem S)
152157
rw [cfc_apply_of_not_continuousOn a hg, cfc_apply_of_not_continuousOn a this]
153158

154159
end SpectrumRestricts

0 commit comments

Comments
 (0)