Skip to content
This repository was archived by the owner on Jul 24, 2024. It is now read-only.

Commit a7524b6

Browse files
sgouezelmergify[bot]
authored andcommitted
refactor(analysis/normed_space/operator_norm): topological modules (#1085)
* refactor(analysis/normed_space/operator_norm): topological modules * remove useless typeclass in definition of topological module * refactor(analysis/normed_space/operator_norm): style
1 parent a152f3a commit a7524b6

File tree

5 files changed

+418
-293
lines changed

5 files changed

+418
-293
lines changed

src/analysis/normed_space/basic.lean

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ Authors: Patrick Massot, Johannes Hölzl
99
import algebra.pi_instances
1010
import linear_algebra.basic
1111
import topology.instances.nnreal topology.instances.complex
12+
import topology.algebra.module
13+
1214
variables {α : Type*} {β : Type*} {γ : Type*} {ι : Type*}
1315

1416
noncomputable theory
@@ -415,10 +417,9 @@ lemma tendsto_smul_const {g : γ → F} {e : filter γ} (s : α) {b : F} :
415417
(tendsto g e (nhds b)) → tendsto (λ x, s • (g x)) e (nhds (s • b)) :=
416418
tendsto_smul tendsto_const_nhds
417419

418-
lemma continuous_smul [topological_space γ] {f : γ → α} {g : γ → E}
419-
(hf : continuous f) (hg : continuous g) : continuous (λc, f c • g c) :=
420-
continuous_iff_continuous_at.2 $ assume c,
421-
tendsto_smul (continuous_iff_continuous_at.1 hf _) (continuous_iff_continuous_at.1 hg _)
420+
instance normed_space.topological_vector_space : topological_vector_space α E :=
421+
{ continuous_smul := continuous_iff_continuous_at.2 $ λp, tendsto_smul
422+
(continuous_iff_continuous_at.1 continuous_fst _) (continuous_iff_continuous_at.1 continuous_snd _) }
422423

423424
/-- If there is a scalar `c` with `∥c∥>1`, then any element can be moved by scalar multiplication to
424425
any shell of width `∥c∥`. Also recap information on the norm of the rescaling element that shows

src/analysis/normed_space/bounded_linear_maps.lean

Lines changed: 53 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,14 @@ local notation f ` →_{`:50 a `} `:0 b := filter.tendsto f (nhds a) (nhds b)
1616
open filter (tendsto)
1717
open metric
1818

19-
variables {k : Type*} [normed_field k]
19+
variables {k : Type*} [nondiscrete_normed_field k]
2020
variables {E : Type*} [normed_space k E]
2121
variables {F : Type*} [normed_space k F]
2222
variables {G : Type*} [normed_space k G]
2323

24+
25+
set_option class.instance_max_depth 80
26+
2427
structure is_bounded_linear_map (k : Type*) [normed_field k] {E : Type*}
2528
[normed_space k E] {F : Type*} [normed_space k F] (f : E → F)
2629
extends is_linear_map k f : Prop :=
@@ -34,25 +37,27 @@ lemma is_linear_map.with_bound
3437
le_trans (h x) $ mul_le_mul_of_nonneg_right (le_trans this zero_le_one) (norm_nonneg x)⟩)
3538
(assume : ¬ M ≤ 0, ⟨M, lt_of_not_ge this, h⟩)⟩
3639

37-
/-- A bounded linear map satisfies `is_bounded_linear_map` -/
38-
lemma bounded_linear_map.is_bounded_linear_map (f : E →L[k] F) : is_bounded_linear_map k f := {..f}
40+
/-- A continuous linear map satisfies `is_bounded_linear_map` -/
41+
lemma continuous_linear_map.is_bounded_linear_map (f : E →L[k] F) : is_bounded_linear_map k f :=
42+
{ bound := f.bound,
43+
..f.to_linear_map }
3944

4045
namespace is_bounded_linear_map
4146

4247
def to_linear_map (f : E → F) (h : is_bounded_linear_map k f) : E →ₗ[k] F :=
4348
(is_linear_map.mk' _ h.to_is_linear_map)
4449

45-
/-- Construct a bounded linear map from is_bounded_linear_map -/
46-
def to_bounded_linear_map {f : E → F} (hf : is_bounded_linear_map k f) : E →L[k] F :=
47-
{ bound := hf.bound, ..is_bounded_linear_map.to_linear_map f hf }
50+
/-- Construct a continuous linear map from is_bounded_linear_map -/
51+
def to_continuous_linear_map {f : E → F} (hf : is_bounded_linear_map k f) : E →L[k] F :=
52+
{ cont := let ⟨C, Cpos, hC⟩ := hf.bound in linear_map.continuous_of_bound _ C hC,
53+
..to_linear_map f hf}
4854

4955
lemma zero : is_bounded_linear_map k (λ (x:E), (0:F)) :=
5056
(0 : E →ₗ F).is_linear.with_bound 0 $ by simp [le_refl]
5157

5258
lemma id : is_bounded_linear_map k (λ (x:E), x) :=
5359
linear_map.id.is_linear.with_bound 1 $ by simp [le_refl]
5460

55-
set_option class.instance_max_depth 43
5661
variables { f g : E → F }
5762

5863
lemma smul (c : k) (hf : is_bounded_linear_map k f) :
@@ -129,82 +134,51 @@ end
129134

130135
end is_bounded_linear_map
131136

132-
set_option class.instance_max_depth 60
137+
section
138+
set_option class.instance_max_depth 250
133139

134140
lemma is_bounded_linear_map_prod_iso :
135141
is_bounded_linear_map k (λ(p : (E →L[k] F) × (E →L[k] G)),
136-
(bounded_linear_map.prod p.1 p.2 : (E →L[k] (F × G)))) :=
142+
(continuous_linear_map.prod p.1 p.2 : (E →L[k] (F × G)))) :=
137143
begin
138144
refine is_linear_map.with_bound ⟨λu v, rfl, λc u, rfl⟩ 1 (λp, _),
139145
simp only [norm, one_mul],
140-
refine bounded_linear_map.op_norm_le_bound _ (le_trans (norm_nonneg _) (le_max_left _ _)) (λu, _),
141-
simp only [norm, bounded_linear_map.prod, max_le_iff],
146+
refine continuous_linear_map.op_norm_le_bound _ (le_trans (norm_nonneg _) (le_max_left _ _)) (λu, _),
147+
simp only [norm, continuous_linear_map.prod, max_le_iff],
142148
split,
143-
{ calc ∥p.1 u∥ ≤ ∥p.1∥ * ∥u∥ : bounded_linear_map.le_op_norm _ _
149+
{ calc ∥p.1 u∥ ≤ ∥p.1∥ * ∥u∥ : continuous_linear_map.le_op_norm _ _
144150
... ≤ max (∥p.1∥) (∥p.2∥) * ∥u∥ :
145151
mul_le_mul_of_nonneg_right (le_max_left _ _) (norm_nonneg _) },
146-
{ calc ∥p.2 u∥ ≤ ∥p.2∥ * ∥u∥ : bounded_linear_map.le_op_norm _ _
152+
{ calc ∥p.2 u∥ ≤ ∥p.2∥ * ∥u∥ : continuous_linear_map.le_op_norm _ _
147153
... ≤ max (∥p.1∥) (∥p.2∥) * ∥u∥ :
148154
mul_le_mul_of_nonneg_right (le_max_right _ _) (norm_nonneg _) }
149155
end
150156

151-
lemma bounded_linear_map.is_bounded_linear_map_comp_left (g : bounded_linear_map k F G) :
152-
is_bounded_linear_map k (λ(f : E →L[k] F), bounded_linear_map.comp g f) :=
157+
lemma continuous_linear_map.is_bounded_linear_map_comp_left (g : continuous_linear_map k F G) :
158+
is_bounded_linear_map k (λ(f : E →L[k] F), continuous_linear_map.comp g f) :=
153159
begin
154160
refine is_linear_map.with_bound ⟨λu v, _, λc u, _⟩
155-
(∥g∥) (λu, bounded_linear_map.op_norm_comp_le _ _),
161+
(∥g∥) (λu, continuous_linear_map.op_norm_comp_le _ _),
156162
{ ext x,
157163
change g ((u+v) x) = g (u x) + g (v x),
158164
have : (u+v) x = u x + v x := rfl,
159165
rw [this, g.map_add] },
160166
{ ext x,
161167
change g ((c • u) x) = c • g (u x),
162168
have : (c • u) x = c • u x := rfl,
163-
rw [this, bounded_linear_map.map_smul] }
169+
rw [this, continuous_linear_map.map_smul] }
164170
end
165171

166-
lemma bounded_linear_map.is_bounded_linear_map_comp_right (f : bounded_linear_map k E F) :
167-
is_bounded_linear_map k (λ(g : F →L[k] G), bounded_linear_map.comp g f) :=
172+
lemma continuous_linear_map.is_bounded_linear_map_comp_right (f : continuous_linear_map k E F) :
173+
is_bounded_linear_map k (λ(g : F →L[k] G), continuous_linear_map.comp g f) :=
168174
begin
169175
refine is_linear_map.with_bound ⟨λu v, rfl, λc u, rfl⟩ (∥f∥) (λg, _),
170176
rw mul_comm,
171-
exact bounded_linear_map.op_norm_comp_le _ _
177+
exact continuous_linear_map.op_norm_comp_le _ _
172178
end
173179

174-
/-- A continuous linear map between normed spaces is bounded when the field is nondiscrete.
175-
The continuity ensures boundedness on a ball of some radius δ. The nondiscreteness is then
176-
used to rescale any element into an element of norm in [δ/C, δ], whose image has a controlled norm.
177-
The norm control for the original element follows by rescaling. -/
178-
theorem is_linear_map.bounded_of_continuous_at {k : Type*} [nondiscrete_normed_field k]
179-
{E : Type*} [normed_space k E] {F : Type*} [normed_space k F] {f : E → F} {x₀ : E}
180-
(lin : is_linear_map k f) (cont : continuous_at f x₀) : is_bounded_linear_map k f :=
181-
begin
182-
rcases tendsto_nhds_nhds.1 cont 1 zero_lt_one with ⟨ε, ε_pos, hε⟩,
183-
let δ := ε/2,
184-
have δ_pos : δ > 0 := half_pos ε_pos,
185-
have H : ∀{a}, ∥a∥ ≤ δ → ∥f a∥ ≤ 1,
186-
{ assume a ha,
187-
have : dist (f (x₀+a)) (f x₀) ≤ 1,
188-
{ apply le_of_lt (hε _),
189-
have : dist x₀ (x₀ + a) = ∥a∥, by { rw dist_eq_norm, simp },
190-
rw [dist_comm, this],
191-
exact lt_of_le_of_lt ha (half_lt_self ε_pos) },
192-
simpa [dist_eq_norm, lin.add] using this },
193-
rcases exists_one_lt_norm k with ⟨c, hc⟩,
194-
refine lin.with_bound (δ⁻¹ * ∥c∥) (λx, _),
195-
by_cases h : x = 0,
196-
{ simp only [h, lin.map_zero, norm_zero, mul_zero] },
197-
{ rcases rescale_to_shell hc δ_pos h with ⟨d, hd, dxle, ledx, dinv⟩,
198-
calc ∥f x∥
199-
= ∥f ((d⁻¹ * d) • x)∥ : by rwa [inv_mul_cancel, one_smul]
200-
... = ∥d∥⁻¹ * ∥f (d • x)∥ :
201-
by rw [mul_smul, lin.smul, norm_smul, norm_inv]
202-
... ≤ ∥d∥⁻¹ * 1 :
203-
mul_le_mul_of_nonneg_left (H dxle) (by { rw ← norm_inv, exact norm_nonneg _ })
204-
... ≤ δ⁻¹ * ∥c∥ * ∥x∥ : by { rw mul_one, exact dinv } }
205180
end
206181

207-
208182
section bilinear_map
209183

210184
variable (k)
@@ -253,21 +227,23 @@ lemma is_bounded_bilinear_map_comp :
253227
smul_left := λc x y, begin
254228
ext z,
255229
change y (c • (x z)) = c • y (x z),
256-
rw bounded_linear_map.map_smul
230+
rw continuous_linear_map.map_smul
257231
end,
258232
add_right := λx y₁ y₂, rfl,
259233
smul_right := λc x y, rfl,
260234
bound := ⟨1, zero_lt_one, λx y, calc
261-
bounded_linear_map.comp ((x, y).snd) ((x, y).fst)∥
262-
≤ ∥y∥ * ∥x∥ : bounded_linear_map.op_norm_comp_le _ _
235+
continuous_linear_map.comp ((x, y).snd) ((x, y).fst)∥
236+
≤ ∥y∥ * ∥x∥ : continuous_linear_map.op_norm_comp_le _ _
263237
... = 1 * ∥x∥ * ∥ y∥ : by ring ⟩ }
264238

265239
/-- Definition of the derivative of a bilinear map `f`, given at a point `p` by
266240
`q ↦ f(p.1, q.2) + f(q.1, p.2)` as in the standard formula for the derivative of a product.
267241
We define this function here a bounded linear map from `E × F` to `G`. The fact that this
268242
is indeed the derivative of `f` is proved in `is_bounded_bilinear_map.has_fderiv_at` in
269243
`deriv.lean`-/
270-
def is_bounded_bilinear_map.deriv (h : is_bounded_bilinear_map k f) (p : E × F) : (E × F) →L[k] G :=
244+
245+
def is_bounded_bilinear_map.linear_deriv (h : is_bounded_bilinear_map k f) (p : E × F) :
246+
(E × F) →ₗ[k] G :=
271247
{ to_fun := λq, f (p.1, q.2) + f (q.1, p.2),
272248
add := λq₁ q₂, begin
273249
change f (p.1, q₁.2 + q₂.2) + f (q₁.1 + q₂.1, p.2) =
@@ -277,22 +253,28 @@ def is_bounded_bilinear_map.deriv (h : is_bounded_bilinear_map k f) (p : E × F)
277253
smul := λc q, begin
278254
change f (p.1, c • q.2) + f (c • q.1, p.2) = c • (f (p.1, q.2) + f (q.1, p.2)),
279255
simp [h.smul_left, h.smul_right, smul_add]
280-
end,
281-
bound := begin
282-
rcases h.bound with ⟨C, Cpos, hC⟩,
283-
refine exists_pos_bound_of_bound (C * ∥p.1∥ + C * ∥p.2∥) (λq, _),
284-
calc ∥f (p.1, q.2) + f (q.1, p.2)∥
285-
≤ ∥f (p.1, q.2)∥ + ∥f (q.1, p.2)∥ : norm_triangle _ _
286-
... ≤ C * ∥p.1∥ * ∥q.2∥ + C * ∥q.1∥ * ∥p.2∥ : add_le_add (hC _ _) (hC _ _)
287-
... ≤ C * ∥p.1∥ * ∥q∥ + C * ∥q∥ * ∥p.2∥ : begin
288-
apply add_le_add,
289-
exact mul_le_mul_of_nonneg_left (le_max_right _ _) (mul_nonneg (le_of_lt Cpos) (norm_nonneg _)),
290-
apply mul_le_mul_of_nonneg_right _ (norm_nonneg _),
291-
exact mul_le_mul_of_nonneg_left (le_max_left _ _) (le_of_lt Cpos),
292-
end
293-
... = (C * ∥p.1∥ + C * ∥p.2∥) * ∥q∥ : by ring
294256
end }
295257

258+
def is_bounded_bilinear_map.deriv (h : is_bounded_bilinear_map k f) (p : E × F) : (E × F) →L[k] G :=
259+
(h.linear_deriv p).with_bound $ begin
260+
rcases h.bound with ⟨C, Cpos, hC⟩,
261+
refine ⟨C * ∥p.1∥ + C * ∥p.2∥, λq, _⟩,
262+
calc ∥f (p.1, q.2) + f (q.1, p.2)∥
263+
≤ ∥f (p.1, q.2)∥ + ∥f (q.1, p.2)∥ : norm_triangle _ _
264+
... ≤ C * ∥p.1∥ * ∥q.2∥ + C * ∥q.1∥ * ∥p.2∥ : add_le_add (hC _ _) (hC _ _)
265+
... ≤ C * ∥p.1∥ * ∥q∥ + C * ∥q∥ * ∥p.2∥ : begin
266+
apply add_le_add,
267+
exact mul_le_mul_of_nonneg_left (le_max_right _ _) (mul_nonneg (le_of_lt Cpos) (norm_nonneg _)),
268+
apply mul_le_mul_of_nonneg_right _ (norm_nonneg _),
269+
exact mul_le_mul_of_nonneg_left (le_max_left _ _) (le_of_lt Cpos),
270+
end
271+
... = (C * ∥p.1∥ + C * ∥p.2∥) * ∥q∥ : by ring
272+
end
273+
274+
set_option class.instance_max_depth 150
275+
@[simp] lemma is_bounded_bilinear_map_deriv_coe (h : is_bounded_bilinear_map k f) (p q : E × F) :
276+
h.deriv p q = f (p.1, q.2) + f (q.1, p.2) := rfl
277+
296278
/-- Given a bounded bilinear map `f`, the map associating to a point `p` the derivative of `f` at
297279
`p` is itself a bounded linear map. -/
298280
lemma is_bounded_bilinear_map.is_bounded_linear_map_deriv (h : is_bounded_bilinear_map k f) :
@@ -301,14 +283,10 @@ begin
301283
rcases h.bound with ⟨C, Cpos, hC⟩,
302284
refine is_linear_map.with_bound ⟨λp₁ p₂, _, λc p, _⟩ (C + C) (λp, _),
303285
{ ext q,
304-
change f (p₁.1 + p₂.1, q.2) + f (q.1, p₁.2 + p₂.2) =
305-
(f (p₁.1, q.2) + f (q.1, p₁.2)) + ((f (p₂.1, q.2) + f (q.1, p₂.2))),
306286
simp [h.add_left, h.add_right] },
307287
{ ext q,
308-
change f (c • p.1, q.2) + f (q.1, c • p.2) = c • (f (p.1, q.2) + f (q.1, p.2)),
309288
simp [h.smul_left, h.smul_right, smul_add] },
310-
{ dunfold is_bounded_bilinear_map.deriv,
311-
refine bounded_linear_map.op_norm_le_bound _
289+
{ refine continuous_linear_map.op_norm_le_bound _
312290
(mul_nonneg (add_nonneg (le_of_lt Cpos) (le_of_lt Cpos)) (norm_nonneg _)) (λq, _),
313291
calc ∥f (p.1, q.2) + f (q.1, p.2)∥
314292
≤ ∥f (p.1, q.2)∥ + ∥f (q.1, p.2)∥ : norm_triangle _ _

0 commit comments

Comments
 (0)