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

Commit 70b14ce

Browse files
committed
refactor(*): use is_scalar_tower instead of restrict_scalars (#4733)
- rename `semimodule.restrict_scalars` to `restrict_scalars` - rename `restrict_scalars` to `subspace.restrict_scalars` - use `is_scalar_tower` wherever possible - add warnings to docstrings about `restrict_scalars` to encourage `is_scalar_tower` instead
1 parent 82b4843 commit 70b14ce

File tree

14 files changed

+315
-309
lines changed

14 files changed

+315
-309
lines changed

src/algebra/algebra/basic.lean

Lines changed: 188 additions & 168 deletions
Large diffs are not rendered by default.

src/algebra/monoid_algebra.lean

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -375,32 +375,35 @@ section
375375
local attribute [reducible] monoid_algebra
376376

377377
variables (k)
378+
-- TODO: generalise from groups `G` to monoids
378379
/-- When `V` is a `k[G]`-module, multiplication by a group element `g` is a `k`-linear map. -/
379380
def group_smul.linear_map [group G] [comm_ring k]
380-
(V : Type u₃) [add_comm_group V] [module (monoid_algebra k G) V] (g : G) :
381-
(semimodule.restrict_scalars k (monoid_algebra k G) V) →ₗ[k]
382-
(semimodule.restrict_scalars k (monoid_algebra k G) V) :=
381+
(V : Type u₃) [add_comm_group V] [module k V] [module (monoid_algebra k G) V]
382+
[is_scalar_tower k (monoid_algebra k G) V] (g : G) :
383+
V →ₗ[k] V :=
383384
{ to_fun := λ v, (single g (1 : k) • v : V),
384385
map_add' := λ x y, smul_add (single g (1 : k)) x y,
385-
map_smul' := λ c x,
386-
by simp only [semimodule.restrict_scalars_smul_def, coe_algebra_map, ←mul_smul, single_one_comm], }.
386+
map_smul' := λ c x, smul_algebra_smul_comm _ _ _ }
387387

388388
@[simp]
389389
lemma group_smul.linear_map_apply [group G] [comm_ring k]
390-
(V : Type u₃) [add_comm_group V] [module (monoid_algebra k G) V] (g : G) (v : V) :
390+
(V : Type u₃) [add_comm_group V] [module k V] [module (monoid_algebra k G) V]
391+
[is_scalar_tower k (monoid_algebra k G) V] (g : G) (v : V) :
391392
(group_smul.linear_map k V g) v = (single g (1 : k) • v : V) :=
392393
rfl
393394

394395
section
395396
variables {k}
396-
variables [group G] [comm_ring k]
397-
{V : Type u₃} {gV : add_comm_group V} {mV : module (monoid_algebra k G) V}
398-
{W : Type u₃} {gW : add_comm_group W} {mW : module (monoid_algebra k G) W}
399-
(f : (semimodule.restrict_scalars k (monoid_algebra k G) V) →ₗ[k]
400-
(semimodule.restrict_scalars k (monoid_algebra k G) W))
397+
variables [group G] [comm_ring k] {V W : Type u₃}
398+
[add_comm_group V] [module k V] [module (monoid_algebra k G) V]
399+
[is_scalar_tower k (monoid_algebra k G) V]
400+
[add_comm_group W] [module k W] [module (monoid_algebra k G) W]
401+
[is_scalar_tower k (monoid_algebra k G) W]
402+
(f : V →ₗ[k] W)
401403
(h : ∀ (g : G) (v : V), f (single g (1 : k) • v : V) = (single g (1 : k) • (f v) : W))
402404
include h
403405

406+
-- TODO generalise from groups `G` to monoids??
404407
/-- Build a `k[G]`-linear map from a `k`-linear map and evidence that it is `G`-equivariant. -/
405408
def equivariant_of_linear_of_comm : V →ₗ[monoid_algebra k G] W :=
406409
{ to_fun := f,
@@ -410,10 +413,10 @@ def equivariant_of_linear_of_comm : V →ₗ[monoid_algebra k G] W :=
410413
apply finsupp.induction c,
411414
{ simp, },
412415
{ intros g r c' nm nz w,
413-
rw [add_smul, linear_map.map_add, w, add_smul, add_left_inj,
414-
single_eq_algebra_map_mul_of, ←smul_smul, ←smul_smul],
415-
erw [f.map_smul, h g v],
416-
refl, }
416+
simp only [add_smul, f.map_add, w, add_left_inj, single_eq_algebra_map_mul_of, ← smul_smul],
417+
erw [algebra_map_smul (monoid_algebra k G) r, algebra_map_smul (monoid_algebra k G) r,
418+
f.map_smul, h g v, of_apply],
419+
all_goals { apply_instance } }
417420
end, }
418421

419422
@[simp]

src/analysis/calculus/fderiv.lean

Lines changed: 23 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -2488,11 +2488,12 @@ respectively by `𝕜'` and `𝕜` where `𝕜'` is a normed algebra over `𝕜`
24882488
-/
24892489

24902490
variables (𝕜 : Type*) [nondiscrete_normed_field 𝕜]
2491-
{𝕜' : Type*} [nondiscrete_normed_field 𝕜'] [normed_algebra 𝕜 𝕜']
2492-
{E : Type*} [normed_group E] [normed_space 𝕜' E]
2493-
{F : Type*} [normed_group F] [normed_space 𝕜' F]
2494-
{f : semimodule.restrict_scalars 𝕜 𝕜' E → semimodule.restrict_scalars 𝕜 𝕜' F}
2495-
{f' : semimodule.restrict_scalars 𝕜 𝕜' E →L[𝕜'] semimodule.restrict_scalars 𝕜 𝕜' F} {s : set E} {x : E}
2491+
variables {𝕜' : Type*} [nondiscrete_normed_field 𝕜'] [normed_algebra 𝕜 𝕜']
2492+
variables {E : Type*} [normed_group E] [normed_space 𝕜 E] [normed_space 𝕜' E]
2493+
variables [is_scalar_tower 𝕜 𝕜' E]
2494+
variables {F : Type*} [normed_group F] [normed_space 𝕜 F] [normed_space 𝕜' F]
2495+
variables [is_scalar_tower 𝕜 𝕜' F]
2496+
variables {f : E → F} {f' : E →L[𝕜'] F} {s : set E} {x : E}
24962497

24972498
lemma has_strict_fderiv_at.restrict_scalars (h : has_strict_fderiv_at f f' x) :
24982499
has_strict_fderiv_at f (f'.restrict_scalars 𝕜) x := h
@@ -2532,12 +2533,12 @@ by a normed algebra `𝕜'` over `𝕜`.
25322533
section smul_algebra
25332534

25342535
variables {𝕜 : Type*} [nondiscrete_normed_field 𝕜]
2535-
{𝕜' : Type*} [nondiscrete_normed_field 𝕜'] [normed_algebra 𝕜 𝕜']
2536-
{E : Type*} [normed_group E] [normed_space 𝕜 E]
2537-
{F : Type*} [normed_group F] [normed_space 𝕜' F]
2538-
{f : E → semimodule.restrict_scalars 𝕜 𝕜' F}
2539-
{f' : E →L[𝕜] semimodule.restrict_scalars 𝕜 𝕜' F} {s : set E} {x : E}
2540-
{c : E → 𝕜'} {c' : E →L[𝕜] 𝕜'} {L : filter E}
2536+
variables {𝕜' : Type*} [nondiscrete_normed_field 𝕜'] [normed_algebra 𝕜 𝕜']
2537+
variables {E : Type*} [normed_group E] [normed_space 𝕜 E]
2538+
variables {F : Type*} [normed_group F] [normed_space 𝕜 F] [normed_space 𝕜' F]
2539+
variables [is_scalar_tower 𝕜 𝕜' F]
2540+
variables {f : E → F} {f' : E →L[𝕜] F} {s : set E} {x : E}
2541+
variables {c : E → 𝕜'} {c' : E →L[𝕜] 𝕜'} {L : filter E}
25412542

25422543
theorem has_strict_fderiv_at.smul_algebra (hc : has_strict_fderiv_at c c' x)
25432544
(hf : has_strict_fderiv_at f f' x) :
@@ -2586,60 +2587,58 @@ lemma fderiv_smul_algebra (hc : differentiable_at 𝕜 c x) (hf : differentiable
25862587
(hc.has_fderiv_at.smul_algebra hf.has_fderiv_at).fderiv
25872588

25882589
theorem has_strict_fderiv_at.smul_algebra_const
2589-
(hc : has_strict_fderiv_at c c' x) (f : semimodule.restrict_scalars 𝕜 𝕜' F) :
2590+
(hc : has_strict_fderiv_at c c' x) (f : F) :
25902591
has_strict_fderiv_at (λ y, c y • f) (c'.smul_algebra_right f) x :=
25912592
by simpa only [smul_zero, zero_add] using hc.smul_algebra (has_strict_fderiv_at_const f x)
25922593

25932594
theorem has_fderiv_within_at.smul_algebra_const
2594-
(hc : has_fderiv_within_at c c' s x) (f : semimodule.restrict_scalars 𝕜 𝕜' F) :
2595+
(hc : has_fderiv_within_at c c' s x) (f : F) :
25952596
has_fderiv_within_at (λ y, c y • f) (c'.smul_algebra_right f) s x :=
25962597
by simpa only [smul_zero, zero_add] using hc.smul_algebra (has_fderiv_within_at_const f x s)
25972598

25982599
theorem has_fderiv_at.smul_algebra_const
2599-
(hc : has_fderiv_at c c' x) (f : semimodule.restrict_scalars 𝕜 𝕜' F) :
2600+
(hc : has_fderiv_at c c' x) (f : F) :
26002601
has_fderiv_at (λ y, c y • f) (c'.smul_algebra_right f) x :=
26012602
by simpa only [smul_zero, zero_add] using hc.smul_algebra (has_fderiv_at_const f x)
26022603

26032604
lemma differentiable_within_at.smul_algebra_const
2604-
(hc : differentiable_within_at 𝕜 c s x) (f : semimodule.restrict_scalars 𝕜 𝕜' F) :
2605+
(hc : differentiable_within_at 𝕜 c s x) (f : F) :
26052606
differentiable_within_at 𝕜 (λ y, c y • f) s x :=
26062607
(hc.has_fderiv_within_at.smul_algebra_const f).differentiable_within_at
26072608

26082609
lemma differentiable_at.smul_algebra_const
2609-
(hc : differentiable_at 𝕜 c x) (f : semimodule.restrict_scalars 𝕜 𝕜' F) :
2610+
(hc : differentiable_at 𝕜 c x) (f : F) :
26102611
differentiable_at 𝕜 (λ y, c y • f) x :=
26112612
(hc.has_fderiv_at.smul_algebra_const f).differentiable_at
26122613

26132614
lemma differentiable_on.smul_algebra_const
2614-
(hc : differentiable_on 𝕜 c s) (f : semimodule.restrict_scalars 𝕜 𝕜' F) :
2615+
(hc : differentiable_on 𝕜 c s) (f : F) :
26152616
differentiable_on 𝕜 (λ y, c y • f) s :=
26162617
λx hx, (hc x hx).smul_algebra_const f
26172618

26182619
lemma differentiable.smul_algebra_const
2619-
(hc : differentiable 𝕜 c) (f : semimodule.restrict_scalars 𝕜 𝕜' F) :
2620+
(hc : differentiable 𝕜 c) (f : F) :
26202621
differentiable 𝕜 (λ y, c y • f) :=
26212622
λx, (hc x).smul_algebra_const f
26222623

26232624
lemma fderiv_within_smul_algebra_const (hxs : unique_diff_within_at 𝕜 s x)
2624-
(hc : differentiable_within_at 𝕜 c s x) (f : semimodule.restrict_scalars 𝕜 𝕜' F) :
2625+
(hc : differentiable_within_at 𝕜 c s x) (f : F) :
26252626
fderiv_within 𝕜 (λ y, c y • f) s x =
26262627
(fderiv_within 𝕜 c s x).smul_algebra_right f :=
26272628
(hc.has_fderiv_within_at.smul_algebra_const f).fderiv_within hxs
26282629

26292630
lemma fderiv_smul_algebra_const
2630-
(hc : differentiable_at 𝕜 c x) (f : semimodule.restrict_scalars 𝕜 𝕜' F) :
2631+
(hc : differentiable_at 𝕜 c x) (f : F) :
26312632
fderiv 𝕜 (λ y, c y • f) x = (fderiv 𝕜 c x).smul_algebra_right f :=
26322633
(hc.has_fderiv_at.smul_algebra_const f).fderiv
26332634

26342635
theorem has_strict_fderiv_at.const_smul_algebra (h : has_strict_fderiv_at f f' x) (c : 𝕜') :
26352636
has_strict_fderiv_at (λ x, c • f x) (c • f') x :=
2636-
(c • (1 : (semimodule.restrict_scalars 𝕜 𝕜' F) →L[𝕜] ((semimodule.restrict_scalars 𝕜 𝕜' F))))
2637-
.has_strict_fderiv_at.comp x h
2637+
(c • (1 : F →L[𝕜] F)).has_strict_fderiv_at.comp x h
26382638

26392639
theorem has_fderiv_at_filter.const_smul_algebra (h : has_fderiv_at_filter f f' x L) (c : 𝕜') :
26402640
has_fderiv_at_filter (λ x, c • f x) (c • f') x L :=
2641-
(c • (1 : (semimodule.restrict_scalars 𝕜 𝕜' F) →L[𝕜] ((semimodule.restrict_scalars 𝕜 𝕜' F))))
2642-
.has_fderiv_at_filter.comp x h
2641+
(c • (1 : F →L[𝕜] F)).has_fderiv_at_filter.comp x h
26432642

26442643
theorem has_fderiv_within_at.const_smul_algebra (h : has_fderiv_within_at f f' s x) (c : 𝕜') :
26452644
has_fderiv_within_at (λ x, c • f x) (c • f') s x :=

src/analysis/complex/basic.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ attribute [instance, priority 900] complex.finite_dimensional.proper
7474
/-- A complex normed vector space is also a real normed vector space. -/
7575
@[priority 900]
7676
instance normed_space.restrict_scalars_real (E : Type*) [normed_group E] [normed_space ℂ E] :
77-
normed_space ℝ E := normed_space.restrict_scalars' ℝ ℂ E
77+
normed_space ℝ E := normed_space.restrict_scalars ℝ ℂ E
7878

7979
/-- The space of continuous linear maps over `ℝ`, from a real vector space to a complex vector
8080
space, is a normed vector space over `ℂ`. -/

src/analysis/normed_space/basic.lean

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1127,27 +1127,30 @@ section restrict_scalars
11271127
variables (𝕜 : Type*) (𝕜' : Type*) [normed_field 𝕜] [normed_field 𝕜'] [normed_algebra 𝕜 𝕜']
11281128
(E : Type*) [normed_group E] [normed_space 𝕜' E]
11291129

1130-
/-- `𝕜`-normed space structure induced by a `𝕜'`-normed space structure when `𝕜'` is a
1130+
/-- Warning: This declaration should be used judiciously.
1131+
Please consider using `is_scalar_tower` instead.
1132+
1133+
`𝕜`-normed space structure induced by a `𝕜'`-normed space structure when `𝕜'` is a
11311134
normed algebra over `𝕜`. Not registered as an instance as `𝕜'` can not be inferred.
11321135
11331136
The type synonym `semimodule.restrict_scalars 𝕜 𝕜' E` will be endowed with this instance by default.
11341137
-/
1135-
def normed_space.restrict_scalars' : normed_space 𝕜 E :=
1138+
def normed_space.restrict_scalars : normed_space 𝕜 E :=
11361139
{ norm_smul_le := λc x, le_of_eq $ begin
11371140
change ∥(algebra_map 𝕜 𝕜' c) • x∥ = ∥c∥ * ∥x∥,
11381141
simp [norm_smul]
11391142
end,
1140-
..semimodule.restrict_scalars' 𝕜 𝕜' E }
1143+
..restrict_scalars.semimodule 𝕜 𝕜' E }
11411144

11421145
instance {𝕜 : Type*} {𝕜' : Type*} {E : Type*} [I : normed_group E] :
1143-
normed_group (semimodule.restrict_scalars 𝕜 𝕜' E) := I
1146+
normed_group (restrict_scalars 𝕜 𝕜' E) := I
11441147

11451148
instance semimodule.restrict_scalars.normed_space_orig {𝕜 : Type*} {𝕜' : Type*} {E : Type*}
11461149
[normed_field 𝕜'] [normed_group E] [I : normed_space 𝕜' E] :
1147-
normed_space 𝕜' (semimodule.restrict_scalars 𝕜 𝕜' E) := I
1150+
normed_space 𝕜' (restrict_scalars 𝕜 𝕜' E) := I
11481151

1149-
instance : normed_space 𝕜 (semimodule.restrict_scalars 𝕜 𝕜' E) :=
1150-
(normed_space.restrict_scalars' 𝕜 𝕜' E : normed_space 𝕜 E)
1152+
instance : normed_space 𝕜 (restrict_scalars 𝕜 𝕜' E) :=
1153+
(normed_space.restrict_scalars 𝕜 𝕜' E : normed_space 𝕜 E)
11511154

11521155
end restrict_scalars
11531156

src/analysis/normed_space/bounded_linear_maps.lean

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -280,8 +280,9 @@ lemma is_bounded_bilinear_map_smul :
280280
bound := ⟨1, zero_lt_one, λx y, by simp [norm_smul]⟩ }
281281

282282
lemma is_bounded_bilinear_map_smul_algebra {𝕜' : Type*} [normed_field 𝕜']
283-
[normed_algebra 𝕜 𝕜'] {E : Type*} [normed_group E] [normed_space 𝕜' E] :
284-
is_bounded_bilinear_map 𝕜 (λ (p : 𝕜' × (semimodule.restrict_scalars 𝕜 𝕜' E)), p.1 • p.2) :=
283+
[normed_algebra 𝕜 𝕜'] {E : Type*} [normed_group E] [normed_space 𝕜 E] [normed_space 𝕜' E]
284+
[is_scalar_tower 𝕜 𝕜' E] :
285+
is_bounded_bilinear_map 𝕜 (λ (p : 𝕜' × E), p.1 • p.2) :=
285286
{ add_left := add_smul,
286287
smul_left := λ c x y, by simp [smul_assoc],
287288
add_right := smul_add,

src/analysis/normed_space/hahn_banach.lean

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,14 +90,17 @@ end real
9090
section complex
9191
variables {F : Type*} [normed_group F] [normed_space ℂ F]
9292

93+
-- TODO: generalize away from `ℝ` and `ℂ`
94+
9395
-- Inlining the following two definitions causes a type mismatch between
9496
-- subspace ℝ (semimodule.restrict_scalars ℝ ℂ F) and subspace ℂ F.
9597
/-- Restrict a `ℂ`-subspace to an `ℝ`-subspace. -/
96-
noncomputable def restrict_scalars (p : subspace ℂ F) : subspace ℝ F := p.restrict_scalars ℝ
98+
noncomputable def subspace.restrict_scalars (p : subspace ℂ F) :
99+
subspace ℝ F := p.restrict_scalars ℝ
97100

98101
private lemma apply_real (p : subspace ℂ F) (f' : p →L[ℝ] ℝ) :
99-
∃ g : F →L[ℝ] ℝ, (∀ x : restrict_scalars p, g x = f' x) ∧ ∥g∥ = ∥f'∥ :=
100-
exists_extension_norm_eq (p.restrict_scalars ℝ) f'
102+
∃ g : F →L[ℝ] ℝ, (∀ x : p.restrict_scalars, g x = f' x) ∧ ∥g∥ = ∥f'∥ :=
103+
exists_extension_norm_eq (submodule.restrict_scalars ℝ p) f'
101104

102105
open complex
103106

src/analysis/normed_space/inner_product.lean

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1111,7 +1111,7 @@ def inner_product_space.is_R_or_C_to_real : inner_product_space ℝ E :=
11111111
simp [this, inner_smul_left, smul_coe_mul_ax],
11121112
end,
11131113
..has_inner.is_R_or_C_to_real 𝕜,
1114-
..normed_space.restrict_scalars' ℝ 𝕜 E }
1114+
..normed_space.restrict_scalars ℝ 𝕜 E }
11151115

11161116
omit 𝕜
11171117

@@ -1353,7 +1353,9 @@ theorem exists_norm_eq_infi_of_complete_subspace (K : subspace 𝕜 E)
13531353
(h : is_complete (↑K : set E)) : ∀ u : E, ∃ v ∈ K, ∥u - v∥ = ⨅ w : (K : set E), ∥u - w∥ :=
13541354
begin
13551355
letI : inner_product_space ℝ E := inner_product_space.is_R_or_C_to_real 𝕜,
1356-
let K' : subspace ℝ E := K.restrict_scalars ℝ,
1356+
letI : module ℝ E := restrict_scalars.semimodule ℝ 𝕜 E,
1357+
letI : is_scalar_tower ℝ 𝕜 E := restrict_scalars.is_scalar_tower _ _ _,
1358+
let K' : subspace ℝ E := submodule.restrict_scalars ℝ K,
13571359
exact exists_norm_eq_infi_of_complete_convex ⟨0, K'.zero_mem⟩ h K'.convex
13581360
end
13591361

@@ -1410,6 +1412,8 @@ theorem norm_eq_infi_iff_inner_eq_zero (K : subspace 𝕜 E) {u : E} {v : E}
14101412
(hv : v ∈ K) : ∥u - v∥ = (⨅ w : (↑K : set E), ∥u - w∥) ↔ ∀ w ∈ K, ⟪u - v, w⟫ = 0 :=
14111413
begin
14121414
letI : inner_product_space ℝ E := inner_product_space.is_R_or_C_to_real 𝕜,
1415+
letI : module ℝ E := restrict_scalars.semimodule ℝ 𝕜 E,
1416+
letI : is_scalar_tower ℝ 𝕜 E := restrict_scalars.is_scalar_tower _ _ _,
14131417
let K' : subspace ℝ E := K.restrict_scalars ℝ,
14141418
split,
14151419
{ assume H,

src/analysis/normed_space/operator_norm.lean

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -708,19 +708,20 @@ section restrict_scalars
708708

709709
variable (𝕜)
710710
variables {𝕜' : Type*} [normed_field 𝕜'] [normed_algebra 𝕜 𝕜']
711-
{E' : Type*} [normed_group E'] [normed_space 𝕜' E']
712-
{F' : Type*} [normed_group F'] [normed_space 𝕜' F']
711+
variables {E' : Type*} [normed_group E'] [normed_space 𝕜 E'] [normed_space 𝕜' E']
712+
variables [is_scalar_tower 𝕜 𝕜' E']
713+
variables {F' : Type*} [normed_group F'] [normed_space 𝕜 F'] [normed_space 𝕜' F']
714+
variables [is_scalar_tower 𝕜 𝕜' F']
713715

714716
/-- `𝕜`-linear continuous function induced by a `𝕜'`-linear continuous function when `𝕜'` is a
715717
normed algebra over `𝕜`. -/
716718
def restrict_scalars (f : E' →L[𝕜'] F') :
717-
(semimodule.restrict_scalars 𝕜 𝕜' E') →L[𝕜] (semimodule.restrict_scalars 𝕜 𝕜' F') :=
719+
E' →L[𝕜] F' :=
718720
{ cont := f.cont,
719721
..linear_map.restrict_scalars 𝕜 (f.to_linear_map) }
720722

721723
@[simp, norm_cast] lemma restrict_scalars_coe_eq_coe (f : E' →L[𝕜'] F') :
722-
(f.restrict_scalars 𝕜 :
723-
(semimodule.restrict_scalars 𝕜 𝕜' E') →ₗ[𝕜] (semimodule.restrict_scalars 𝕜 𝕜' F')) =
724+
(f.restrict_scalars 𝕜 : E' →ₗ[𝕜] F') =
724725
(f : E' →ₗ[𝕜'] F').restrict_scalars 𝕜 := rfl
725726

726727
@[simp, norm_cast squash] lemma restrict_scalars_coe_eq_coe' (f : E' →L[𝕜'] F') :
@@ -731,9 +732,10 @@ end restrict_scalars
731732
section extend_scalars
732733

733734
variables {𝕜' : Type*} [normed_field 𝕜'] [normed_algebra 𝕜 𝕜']
734-
{F' : Type*} [normed_group F'] [normed_space 𝕜' F']
735+
variables {F' : Type*} [normed_group F'] [normed_space 𝕜 F'] [normed_space 𝕜' F']
736+
variables [is_scalar_tower 𝕜 𝕜' F']
735737

736-
instance has_scalar_extend_scalars : has_scalar 𝕜' (E →L[𝕜] (semimodule.restrict_scalars 𝕜 𝕜' F')) :=
738+
instance has_scalar_extend_scalars : has_scalar 𝕜' (E →L[𝕜] F') :=
737739
{ smul := λ c f, (c • f.to_linear_map).mk_continuous (∥c∥ * ∥f∥)
738740
begin
739741
assume x,
@@ -742,27 +744,24 @@ begin
742744
... = ∥c∥ * ∥f∥ * ∥x∥ : (mul_assoc _ _ _).symm
743745
end }
744746

745-
instance module_extend_scalars : module 𝕜' (E →L[𝕜] (semimodule.restrict_scalars 𝕜 𝕜' F')) :=
747+
instance module_extend_scalars : module 𝕜' (E →L[𝕜] F') :=
746748
{ smul_zero := λ _, ext $ λ _, smul_zero _,
747749
zero_smul := λ _, ext $ λ _, zero_smul _ _,
748750
one_smul := λ _, ext $ λ _, one_smul _ _,
749751
mul_smul := λ _ _ _, ext $ λ _, mul_smul _ _ _,
750752
add_smul := λ _ _ _, ext $ λ _, add_smul _ _ _,
751753
smul_add := λ _ _ _, ext $ λ _, smul_add _ _ _ }
752754

753-
instance normed_space_extend_scalars : normed_space 𝕜' (E →L[𝕜] (semimodule.restrict_scalars 𝕜 𝕜' F')) :=
755+
instance normed_space_extend_scalars : normed_space 𝕜' (E →L[𝕜] F') :=
754756
{ norm_smul_le := λ c f,
755757
linear_map.mk_continuous_norm_le _ (mul_nonneg (norm_nonneg _) (norm_nonneg _)) _ }
756758

757759
/-- When `f` is a continuous linear map taking values in `S`, then `λb, f b • x` is a
758760
continuous linear map. -/
759-
def smul_algebra_right (f : E →L[𝕜] 𝕜') (x : semimodule.restrict_scalars 𝕜 𝕜' F') :
760-
E →L[𝕜] (semimodule.restrict_scalars 𝕜 𝕜' F') :=
761-
{ cont := by continuity!,
762-
.. smul_algebra_right f.to_linear_map x }
761+
def smul_algebra_right (f : E →L[𝕜] 𝕜') (x : F') : E →L[𝕜] F' :=
762+
{ cont := by continuity!, .. f.to_linear_map.smul_algebra_right x }
763763

764-
@[simp] theorem smul_algebra_right_apply
765-
(f : E →L[𝕜] 𝕜') (x : semimodule.restrict_scalars 𝕜 𝕜' F') (c : E) :
764+
@[simp] theorem smul_algebra_right_apply (f : E →L[𝕜] 𝕜') (x : F') (c : E) :
766765
smul_algebra_right f x c = f c • x := rfl
767766

768767
end extend_scalars

src/data/complex/is_R_or_C.lean

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -362,6 +362,8 @@ by rw [← of_real_rat_cast, of_real_im]
362362

363363
/-! ### Characteristic zero -/
364364

365+
-- TODO: I think this can be instance, because it is a `Prop`
366+
365367
/--
366368
ℝ and ℂ are both of characteristic zero.
367369

0 commit comments

Comments
 (0)