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

Commit 0b0fd52

Browse files
committed
chore(analysis/normed_space/extend): provide a version without restrict_scalars (#6693)
This is some pre-work to try and speed up the proof in `hahn_banach`, which as I understand it is super slow because it has to work very hard to unify typeclass which keep switching back and forth between `F` and `restrict_scalars ℝ 𝕜 F`. This PR is unlikely to have changed the speed of that proof, but I suspect these definitions might help in a future PR - and it pushes `restrict_scalars` out of the interesting bit of the proof.
1 parent 6db70c9 commit 0b0fd52

File tree

2 files changed

+46
-10
lines changed

2 files changed

+46
-10
lines changed

src/analysis/normed_space/extend.lean

Lines changed: 45 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,17 @@ extension is trivial) or `ℂ`. We formulate the extension uniformly, by assumin
1616
We motivate the form of the extension as follows. Note that `fc : F →ₗ[𝕜] 𝕜` is determined fully by
1717
`Re fc`: for all `x : F`, `fc (I • x) = I * fc x`, so `Im (fc x) = -Re (fc (I • x))`. Therefore,
1818
given an `fr : F →ₗ[ℝ] ℝ`, we define `fc x = fr x - fr (I • x) * I`.
19+
20+
## Main definitions
21+
22+
* `linear_map.extend_to_𝕜`
23+
* `continuous_linear_map.extend_to_𝕜`
24+
25+
## Implementation details
26+
27+
For convenience, the main definitions above operate in terms of `restrict_scalars ℝ 𝕜 F`.
28+
Alternate forms which operate on `[is_scalar_tower ℝ 𝕜 F]` instead are provided with a primed name.
29+
1930
-/
2031

2132
open is_R_or_C
@@ -25,7 +36,8 @@ local notation `abs𝕜` := @is_R_or_C.abs 𝕜 _
2536

2637
/-- Extend `fr : F →ₗ[ℝ] ℝ` to `F →ₗ[𝕜] 𝕜` in a way that will also be continuous and have its norm
2738
bounded by `∥fr∥` if `fr` is continuous. -/
28-
noncomputable def linear_map.extend_to_𝕜 (fr : (restrict_scalars ℝ 𝕜 F) →ₗ[ℝ] ℝ) : F →ₗ[𝕜] 𝕜 :=
39+
noncomputable def linear_map.extend_to_𝕜'
40+
[semimodule ℝ F] [is_scalar_tower ℝ 𝕜 F] (fr : F →ₗ[ℝ] ℝ) : F →ₗ[𝕜] 𝕜 :=
2941
begin
3042
let fc : F → 𝕜 := λ x, (fr x : 𝕜) - (I : 𝕜) * (fr ((I : 𝕜) • x)),
3143
have add : ∀ x y : F, fc (x + y) = fc x + fc y,
@@ -40,10 +52,11 @@ begin
4052
{ assume c x,
4153
rw [← of_real_mul],
4254
congr' 1,
43-
exact fr.map_smul c x },
55+
rw [is_R_or_C.of_real_alg, smul_assoc, fr.map_smul, algebra.id.smul_eq_mul, one_smul] },
4456
have smul_ℝ : ∀ (c : ℝ) (x : F), fc ((c : 𝕜) • x) = (c : 𝕜) * fc x,
4557
{ assume c x,
4658
simp only [fc, A],
59+
rw A c x,
4760
rw [smul_smul, mul_comm I (c : 𝕜), ← smul_smul, A, mul_sub],
4861
ring },
4962
have smul_I : ∀ x : F, fc ((I : 𝕜) • x) = (I : 𝕜) * fc x,
@@ -60,11 +73,15 @@ begin
6073
exact { to_fun := fc, map_add' := add, map_smul' := smul_𝕜 }
6174
end
6275

76+
lemma linear_map.extend_to_𝕜'_apply [semimodule ℝ F] [is_scalar_tower ℝ 𝕜 F]
77+
(fr : F →ₗ[ℝ] ℝ) (x : F) :
78+
fr.extend_to_𝕜' x = (fr x : 𝕜) - (I : 𝕜) * fr ((I : 𝕜) • x) := rfl
79+
6380
/-- The norm of the extension is bounded by `∥fr∥`. -/
64-
lemma norm_bound (fr : (restrict_scalars ℝ 𝕜 F) →L[ℝ] ℝ) (x : F) :
65-
∥fr.to_linear_map.extend_to_𝕜 x∥ ≤ ∥fr∥ * ∥x∥ :=
81+
lemma norm_bound [normed_space ℝ F] [is_scalar_tower ℝ 𝕜 F] (fr : F →L[ℝ] ℝ) (x : F) :
82+
(fr.to_linear_map.extend_to_𝕜' x : 𝕜)∥ ≤ ∥fr∥ * ∥x∥ :=
6683
begin
67-
let lm := fr.to_linear_map.extend_to_𝕜,
84+
let lm : F →ₗ[𝕜] 𝕜 := fr.to_linear_map.extend_to_𝕜',
6885
-- We aim to find a `t : 𝕜` such that
6986
-- * `lm (t • x) = fr (t • x)` (so `lm (t • x) = t * lm x ∈ ℝ`)
7087
-- * `∥lm x∥ = ∥lm (t • x)∥` (so `t.abs` must be 1)
@@ -81,8 +98,8 @@ begin
8198
is_R_or_C.abs_div, is_R_or_C.abs_abs, h],
8299
have h1 : (fr (t • x) : 𝕜) = lm (t • x),
83100
{ apply ext,
84-
{ simp only [lm, of_real_re, linear_map.extend_to_𝕜, mul_re, I_re, of_real_im, zero_mul,
85-
linear_map.coe_mk, add_monoid_hom.map_sub, sub_zero, mul_zero],
101+
{ simp only [lm, of_real_re, linear_map.extend_to_𝕜'_apply, mul_re, I_re, of_real_im, zero_mul,
102+
add_monoid_hom.map_sub, sub_zero, mul_zero],
86103
refl },
87104
{ symmetry,
88105
calc im (lm (t • x))
@@ -102,6 +119,26 @@ begin
102119
end
103120

104121
/-- Extend `fr : F →L[ℝ] ℝ` to `F →L[𝕜] 𝕜`. -/
122+
noncomputable def continuous_linear_map.extend_to_𝕜' [normed_space ℝ F] [is_scalar_tower ℝ 𝕜 F]
123+
(fr : F →L[ℝ] ℝ) :
124+
F →L[𝕜] 𝕜 :=
125+
fr.to_linear_map.extend_to_𝕜'.mk_continuous (∥fr∥) (norm_bound _)
126+
127+
lemma continuous_linear_map.extend_to_𝕜'_apply [normed_space ℝ F] [is_scalar_tower ℝ 𝕜 F]
128+
(fr : F →L[ℝ] ℝ) (x : F) :
129+
fr.extend_to_𝕜' x = (fr x : 𝕜) - (I : 𝕜) * fr ((I : 𝕜) • x) := rfl
130+
131+
/-- Extend `fr : restrict_scalars ℝ 𝕜 F →ₗ[ℝ] ℝ` to `F →ₗ[𝕜] 𝕜`. -/
132+
noncomputable def linear_map.extend_to_𝕜 (fr : (restrict_scalars ℝ 𝕜 F) →ₗ[ℝ] ℝ) : F →ₗ[𝕜] 𝕜 :=
133+
fr.extend_to_𝕜'
134+
135+
lemma linear_map.extend_to_𝕜_apply (fr : (restrict_scalars ℝ 𝕜 F) →ₗ[ℝ] ℝ) (x : F) :
136+
fr.extend_to_𝕜 x = (fr x : 𝕜) - (I : 𝕜) * fr ((I : 𝕜) • x) := rfl
137+
138+
/-- Extend `fr : restrict_scalars ℝ 𝕜 F →L[ℝ] ℝ` to `F →L[𝕜] 𝕜`. -/
105139
noncomputable def continuous_linear_map.extend_to_𝕜 (fr : (restrict_scalars ℝ 𝕜 F) →L[ℝ] ℝ) :
106140
F →L[𝕜] 𝕜 :=
107-
fr.to_linear_map.extend_to_𝕜.mk_continuous ∥fr∥ (norm_bound _)
141+
fr.extend_to_𝕜'
142+
143+
lemma continuous_linear_map.extend_to_𝕜_apply (fr : (restrict_scalars ℝ 𝕜 F) →L[ℝ] ℝ) (x : F) :
144+
fr.extend_to_𝕜 x = (fr x : 𝕜) - (I : 𝕜) * fr ((I : 𝕜) • x) := rfl

src/analysis/normed_space/hahn_banach.lean

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,7 @@ begin
9494
-- It is an extension of `f`.
9595
have h : ∀ x : p, g.extend_to_𝕜 x = f x,
9696
{ assume x,
97-
change (g (x : F) : 𝕜) - (I : 𝕜) * g ((((I : 𝕜) • x) : p) : F) = f x,
98-
rw [hextends, hextends],
97+
rw [continuous_linear_map.extend_to_𝕜_apply, ←submodule.coe_smul, hextends, hextends],
9998
change (re (f x) : 𝕜) - (I : 𝕜) * (re (f ((I : 𝕜) • x))) = f x,
10099
apply ext,
101100
{ simp only [add_zero, algebra.id.smul_eq_mul, I_re, of_real_im, add_monoid_hom.map_add,

0 commit comments

Comments
 (0)