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

Commit 02ca494

Browse files
sgouezelavigad
authored andcommitted
Remove outparam in normed space (#844)
1 parent 52fddda commit 02ca494

File tree

4 files changed

+99
-95
lines changed

4 files changed

+99
-95
lines changed

src/analysis/normed_space/basic.lean

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,7 @@ by rw [real.norm_eq_abs, abs_of_nonneg (norm_nonneg _)]
330330

331331
section normed_space
332332

333-
class normed_space (α : out_param $ Type*) (β : Type*) [out_param $ normed_field α]
333+
class normed_space (α : Type*) (β : Type*) [normed_field α]
334334
extends normed_group β, vector_space α β :=
335335
(norm_smul : ∀ (a:α) b, norm (a • b) = has_norm.norm a * norm b)
336336

@@ -413,15 +413,17 @@ instance fintype.normed_space {ι : Type*} {E : ι → Type*} [fintype ι] [∀i
413413
..metric_space_pi,
414414
..pi.vector_space α }
415415

416-
/-- A normed space can be build from a norm that satisfies algebraic properties. This is formalised in this structure. -/
416+
/-- A normed space can be built from a norm that satisfies algebraic properties. This is
417+
formalised in this structure. -/
417418
structure normed_space.core (α : Type*) (β : Type*)
418-
[out_param $ discrete_field α] [normed_field α] [add_comm_group β] [has_scalar α β] [has_norm β]:=
419+
[normed_field α] [add_comm_group β] [has_scalar α β] [has_norm β] :=
419420
(norm_eq_zero_iff : ∀ x : β, ∥x∥ = 0 ↔ x = 0)
420421
(norm_smul : ∀ c : α, ∀ x : β, ∥c • x∥ = ∥c∥ * ∥x∥)
421422
(triangle : ∀ x y : β, ∥x + y∥ ≤ ∥x∥ + ∥y∥)
422423

423424
noncomputable def normed_space.of_core (α : Type*) (β : Type*)
424-
[normed_field α] [add_comm_group β] [vector_space α β] [has_norm β] (C : normed_space.core α β) : normed_space α β :=
425+
[normed_field α] [add_comm_group β] [vector_space α β] [has_norm β]
426+
(C : normed_space.core α β) : normed_space α β :=
425427
{ dist := λ x y, ∥x - y∥,
426428
dist_eq := assume x y, by refl,
427429
dist_self := assume x, (C.norm_eq_zero_iff (x - x)).mpr (show x - x = 0, by simp),
@@ -432,8 +434,7 @@ noncomputable def normed_space.of_core (α : Type*) (β : Type*)
432434
dist_comm := assume x y,
433435
calc ∥x - y∥ = ∥ -(1 : α) • (y - x)∥ : by simp
434436
... = ∥y - x∥ : begin rw[C.norm_smul], simp end,
435-
norm_smul := C.norm_smul
436-
}
437+
norm_smul := C.norm_smul }
437438

438439
end normed_space
439440

src/analysis/normed_space/bounded_linear_maps.lean

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ variables {E : Type*} [normed_space k E]
2828
variables {F : Type*} [normed_space k F]
2929
variables {G : Type*} [normed_space k G]
3030

31-
structure is_bounded_linear_map {k : Type*}
31+
structure is_bounded_linear_map (k : Type*)
3232
[normed_field k] {E : Type*} [normed_space k E] {F : Type*} [normed_space k F] (L : E → F)
3333
extends is_linear_map k L : Prop :=
3434
(bound : ∃ M, M > 0 ∧ ∀ x : E, ∥ L x ∥ ≤ M * ∥ x ∥)
@@ -37,79 +37,80 @@ include k
3737

3838
lemma is_linear_map.with_bound
3939
{L : E → F} (hf : is_linear_map k L) (M : ℝ) (h : ∀ x : E, ∥ L x ∥ ≤ M * ∥ x ∥) :
40-
is_bounded_linear_map L :=
40+
is_bounded_linear_map k L :=
4141
⟨ hf, classical.by_cases
4242
(assume : M ≤ 0, ⟨1, zero_lt_one, assume x,
4343
le_trans (h x) $ mul_le_mul_of_nonneg_right (le_trans this zero_le_one) (norm_nonneg x)⟩)
4444
(assume : ¬ M ≤ 0, ⟨M, lt_of_not_ge this, h⟩)⟩
4545

4646
namespace is_bounded_linear_map
4747

48-
def to_linear_map (f : E → F) (h : is_bounded_linear_map f) : E →ₗ[k] F :=
48+
def to_linear_map (f : E → F) (h : is_bounded_linear_map k f) : E →ₗ[k] F :=
4949
(is_linear_map.mk' _ h.to_is_linear_map)
5050

51-
lemma zero : is_bounded_linear_map (λ (x:E), (0:F)) :=
51+
lemma zero : is_bounded_linear_map k (λ (x:E), (0:F)) :=
5252
(0 : E →ₗ F).is_linear.with_bound 0 $ by simp [le_refl]
5353

54-
lemma id : is_bounded_linear_map (λ (x:E), x) :=
54+
lemma id : is_bounded_linear_map k (λ (x:E), x) :=
5555
linear_map.id.is_linear.with_bound 1 $ by simp [le_refl]
5656

57-
lemma smul {f : E → F} (c : k) : is_bounded_linear_map f → is_bounded_linear_map (λ e, c • f e)
57+
set_option class.instance_max_depth 40
58+
lemma smul {f : E → F} (c : k) : is_bounded_linear_map k f → is_bounded_linear_map k (λ e, c • f e)
5859
| ⟨hf, ⟨M, hM, h⟩⟩ := (c • hf.mk' f).is_linear.with_bound (∥c∥ * M) $ assume x,
5960
calc ∥c • f x∥ = ∥c∥ * ∥f x∥ : norm_smul c (f x)
6061
... ≤ ∥c∥ * (M * ∥x∥) : mul_le_mul_of_nonneg_left (h x) (norm_nonneg c)
6162
... = (∥c∥ * M) * ∥x∥ : (mul_assoc _ _ _).symm
6263

63-
lemma neg {f : E → F} (hf : is_bounded_linear_map f) : is_bounded_linear_map (λ e, -f e) :=
64+
lemma neg {f : E → F} (hf : is_bounded_linear_map k f) : is_bounded_linear_map k (λ e, -f e) :=
6465
begin
6566
rw show (λ e, -f e) = (λ e, (-1 : k) • f e), { funext, simp },
6667
exact smul (-1) hf
6768
end
6869

6970
lemma add {f : E → F} {g : E → F} :
70-
is_bounded_linear_map f → is_bounded_linear_map g → is_bounded_linear_map (λ e, f e + g e)
71+
is_bounded_linear_map k f → is_bounded_linear_map k g → is_bounded_linear_map k (λ e, f e + g e)
7172
| ⟨hlf, Mf, hMf, hf⟩ ⟨hlg, Mg, hMg, hg⟩ := (hlf.mk' _ + hlg.mk' _).is_linear.with_bound (Mf + Mg) $ assume x,
7273
calc ∥f x + g x∥ ≤ ∥f x∥ + ∥g x∥ : norm_triangle _ _
7374
... ≤ Mf * ∥x∥ + Mg * ∥x∥ : add_le_add (hf x) (hg x)
7475
... ≤ (Mf + Mg) * ∥x∥ : by rw add_mul
7576

76-
lemma sub {f : E → F} {g : E → F} (hf : is_bounded_linear_map f) (hg : is_bounded_linear_map g) :
77-
is_bounded_linear_map (λ e, f e - g e) := add hf (neg hg)
77+
lemma sub {f : E → F} {g : E → F} (hf : is_bounded_linear_map k f) (hg : is_bounded_linear_map k g) :
78+
is_bounded_linear_map k (λ e, f e - g e) := add hf (neg hg)
7879

7980
lemma comp {f : E → F} {g : F → G} :
80-
is_bounded_linear_map g → is_bounded_linear_map f → is_bounded_linear_map (g ∘ f)
81+
is_bounded_linear_map k g → is_bounded_linear_map k f → is_bounded_linear_map k (g ∘ f)
8182
| ⟨hlg, Mg, hMg, hg⟩ ⟨hlf, Mf, hMf, hf⟩ := ((hlg.mk' _).comp (hlf.mk' _)).is_linear.with_bound (Mg * Mf) $ assume x,
8283
calc ∥g (f x)∥ ≤ Mg * ∥f x∥ : hg _
8384
... ≤ Mg * (Mf * ∥x∥) : mul_le_mul_of_nonneg_left (hf _) (le_of_lt hMg)
8485
... = Mg * Mf * ∥x∥ : (mul_assoc _ _ _).symm
8586

86-
lemma tendsto {L : E → F} (x : E) : is_bounded_linear_map L → L →_{x} (L x)
87+
lemma tendsto {L : E → F} (x : E) : is_bounded_linear_map k L → L →_{x} (L x)
8788
| ⟨hL, M, hM, h_ineq⟩ := tendsto_iff_norm_tendsto_zero.2 $
8889
squeeze_zero (assume e, norm_nonneg _)
8990
(assume e, calc ∥L e - L x∥ = ∥hL.mk' L (e - x)∥ : by rw (hL.mk' _).map_sub e x; refl
9091
... ≤ M*∥e-x∥ : h_ineq (e-x))
9192
(suffices (λ (e : E), M * ∥e - x∥) →_{x} (M * 0), by simpa,
9293
tendsto_mul tendsto_const_nhds (lim_norm _))
9394

94-
lemma continuous {L : E → F} (hL : is_bounded_linear_map L) : continuous L :=
95+
lemma continuous {L : E → F} (hL : is_bounded_linear_map k L) : continuous L :=
9596
continuous_iff_continuous_at.2 $ assume x, hL.tendsto x
9697

97-
lemma lim_zero_bounded_linear_map {L : E → F} (H : is_bounded_linear_map L) : (L →_{0} 0) :=
98+
lemma lim_zero_bounded_linear_map {L : E → F} (H : is_bounded_linear_map k L) : (L →_{0} 0) :=
9899
(H.1.mk' _).map_zero ▸ continuous_iff_continuous_at.1 H.continuous 0
99100

100101
section
101102
open asymptotics filter
102103

103-
theorem is_O_id {L : E → F} (h : is_bounded_linear_map L) (l : filter E) :
104+
theorem is_O_id {L : E → F} (h : is_bounded_linear_map k L) (l : filter E) :
104105
is_O L (λ x, x) l :=
105106
let ⟨M, Mpos, hM⟩ := h.bound in
106107
⟨M, Mpos, mem_sets_of_superset univ_mem_sets (λ x _, hM x)⟩
107108

108-
theorem is_O_comp {L : F → G} (h : is_bounded_linear_map L)
109+
theorem is_O_comp {L : F → G} (h : is_bounded_linear_map k L)
109110
{f : E → F} (l : filter E) : is_O (λ x', L (f x')) f l :=
110111
((h.is_O_id ⊤).comp _).mono (map_le_iff_le_comap.mp lattice.le_top)
111112

112-
theorem is_O_sub {L : E → F} (h : is_bounded_linear_map L) (l : filter E) (x : E) :
113+
theorem is_O_sub {L : E → F} (h : is_bounded_linear_map k L) (l : filter E) (x : E) :
113114
is_O (λ x', L (x' - x)) (λ x', x' - x) l :=
114115
is_O_comp h l
115116

@@ -120,7 +121,7 @@ end is_bounded_linear_map
120121
-- Next lemma is stated for real normed space but it would work as soon as the base field is an extension of ℝ
121122
lemma bounded_continuous_linear_map
122123
{E : Type*} [normed_space ℝ E] {F : Type*} [normed_space ℝ F] {L : E → F}
123-
(lin : is_linear_map ℝ L) (cont : continuous L) : is_bounded_linear_map L :=
124+
(lin : is_linear_map ℝ L) (cont : continuous L) : is_bounded_linear_map L :=
124125
let ⟨δ, δ_pos, hδ⟩ := exists_delta_of_continuous cont zero_lt_one 0 in
125126
have HL0 : L 0 = 0, from (lin.mk' _).map_zero,
126127
have H : ∀{a}, ∥a∥ ≤ δ → ∥L a∥ < 1, by simpa only [HL0, dist_zero_right] using hδ,

0 commit comments

Comments
 (0)