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

Commit 49049e4

Browse files
Nicknamenkbuzzard
andcommitted
feat(topology): implemented continuous bundled maps (#3486)
In this PR we defined continuous bundled maps, adapted the file `compact_open` accordingly, and proved instances of algebraic structures over the type `continuous_map` of continuous bundled maps. This feature was suggested on Zulip multiple times, see for example https://leanprover.zulipchat.com/#narrow/stream/113489-new-members/topic/Continuous.20maps Co-authored-by: Kevin Buzzard <k.buzzard@imperial.ac.uk>
1 parent 5c55e15 commit 49049e4

File tree

4 files changed

+245
-40
lines changed

4 files changed

+245
-40
lines changed

src/topology/algebra/continuous_functions.lean

Lines changed: 191 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,20 @@
11
/-
22
Copyright (c) 2019 Scott Morrison. All rights reserved.
33
Released under Apache 2.0 license as described in the file LICENSE.
4-
Authors: Scott Morrison
4+
Authors: Scott Morrison, Nicolò Cavalleri
55
-/
66
import topology.algebra.module
7+
import topology.continuous_map
78

8-
/- TODO: change subtype of continuous functions into continuous bundled functions. -/
9+
/-!
10+
# Algebraic structures over continuous functions
911
10-
universes u v
12+
In this file we define instances of algebraic sturctures over continuous functions. Instances are
13+
present both in the case of the subtype of continuous functions and the type of continuous bundled
14+
functions. Both implementations have advantages and disadvantages, but many experienced people in
15+
Zulip have expressed a preference towards continuous bundled maps, so when there is no particular
16+
reason to use the subtype, continuous bundled functions should be used for the sake of uniformity.
17+
-/
1118

1219
local attribute [elab_simple] continuous.comp
1320

@@ -20,6 +27,19 @@ instance : has_coe_to_fun {f : α → β | continuous f } := ⟨_, subtype.val
2027

2128
end continuous_functions
2229

30+
namespace continuous_map
31+
32+
@[to_additive]
33+
instance has_mul {α : Type*} {β : Type*} [topological_space α] [topological_space β]
34+
[has_mul β] [has_continuous_mul β] : has_mul C(α, β) :=
35+
⟨λ f g, ⟨f * g, continuous_mul.comp (f.continuous.prod_mk g.continuous)⟩⟩
36+
37+
@[to_additive]
38+
instance {α : Type*} {β : Type*} [topological_space α] [topological_space β]
39+
[has_one β] : has_one C(α, β) := ⟨const (1 : β)⟩
40+
41+
end continuous_map
42+
2343
section group_structure
2444

2545
/-!
@@ -29,26 +49,28 @@ In this section we show that continuous functions valued in a topological group
2949
the structure of a group.
3050
-/
3151

52+
section subtype
53+
3254
@[to_additive continuous_add_submonoid]
33-
instance continuous_submonoid (α : Type u) (β : Type v) [topological_space α] [topological_space β]
55+
instance continuous_submonoid (α : Type*) (β : Type*) [topological_space α] [topological_space β]
3456
[monoid β] [has_continuous_mul β] : is_submonoid { f : α → β | continuous f } :=
3557
{ one_mem := @continuous_const _ _ _ _ 1,
36-
mul_mem :=
37-
λ f g fc gc, continuous.comp has_continuous_mul.continuous_mul (continuous.prod_mk fc gc) }.
58+
mul_mem := λ f g fc gc, continuous.comp
59+
has_continuous_mul.continuous_mul (continuous.prod_mk fc gc) }.
3860

3961
@[to_additive continuous_add_subgroup]
40-
instance continuous_subgroup (α : Type u) (β : Type v) [topological_space α] [topological_space β]
62+
instance continuous_subgroup (α : Type*) (β : Type*) [topological_space α] [topological_space β]
4163
[group β] [topological_group β] : is_subgroup { f : α → β | continuous f } :=
4264
{ inv_mem := λ f fc, continuous.comp topological_group.continuous_inv fc,
4365
..continuous_submonoid α β, }.
4466

4567
@[to_additive continuous_add_monoid]
46-
instance continuous_monoid {α : Type u} {β : Type v} [topological_space α] [topological_space β]
68+
instance continuous_monoid {α : Type*} {β : Type*} [topological_space α] [topological_space β]
4769
[monoid β] [has_continuous_mul β] : monoid { f : α → β | continuous f } :=
4870
subtype.monoid
4971

5072
@[to_additive continuous_add_group]
51-
instance continuous_group {α : Type u} {β : Type v} [topological_space α] [topological_space β]
73+
instance continuous_group {α : Type*} {β : Type*} [topological_space α] [topological_space β]
5274
[group β] [topological_group β] : group { f : α → β | continuous f } :=
5375
subtype.group
5476

@@ -57,6 +79,48 @@ instance continuous_comm_group {α : Type*} {β : Type*} [topological_space α]
5779
[comm_group β] [topological_group β] : comm_group { f : α → β | continuous f } :=
5880
@subtype.comm_group _ _ _ (continuous_subgroup α β) -- infer_instance doesn't work?!
5981

82+
end subtype
83+
84+
section continuous_map
85+
86+
@[to_additive continuous_map_add_semigroup]
87+
instance continuous_map_semigroup {α : Type*} {β : Type*} [topological_space α] [topological_space β]
88+
[semigroup β] [has_continuous_mul β] : semigroup C(α, β) :=
89+
{ mul_assoc := λ a b c, by ext; exact mul_assoc _ _ _,
90+
..continuous_map.has_mul}
91+
92+
@[to_additive continuous_map_add_monoid]
93+
instance continuous_map_monoid {α : Type*} {β : Type*} [topological_space α] [topological_space β]
94+
[monoid β] [has_continuous_mul β] : monoid C(α, β) :=
95+
{ one_mul := λ a, by ext; exact one_mul _,
96+
mul_one := λ a, by ext; exact mul_one _,
97+
..continuous_map_semigroup,
98+
..continuous_map.has_one }
99+
100+
@[to_additive continuous_map_add_comm_monoid]
101+
instance continuous_map_comm_monoid {α : Type*} {β : Type*} [topological_space α]
102+
[topological_space β] [comm_monoid β] [has_continuous_mul β] : comm_monoid C(α, β) :=
103+
{ one_mul := λ a, by ext; exact one_mul _,
104+
mul_one := λ a, by ext; exact mul_one _,
105+
mul_comm := λ a b, by ext; exact mul_comm _ _,
106+
..continuous_map_semigroup,
107+
..continuous_map.has_one }
108+
109+
@[to_additive continuous_map_add_group]
110+
instance continuous_map_group {α : Type*} {β : Type*} [topological_space α] [topological_space β]
111+
[group β] [topological_group β] : group C(α, β) :=
112+
{ inv := λ f, ⟨λ x, (f x)⁻¹, continuous_inv.comp f.continuous⟩,
113+
mul_left_inv := λ a, by ext; exact mul_left_inv _,
114+
..continuous_map_monoid }
115+
116+
@[to_additive continuous_map_add_comm_group]
117+
instance continuous_map_comm_group {α : Type*} {β : Type*} [topological_space α] [topological_space β]
118+
[comm_group β] [topological_group β] : comm_group C(α, β) :=
119+
{ ..continuous_map_group,
120+
..continuous_map_comm_monoid }
121+
122+
end continuous_map
123+
60124
end group_structure
61125

62126
section ring_structure
@@ -68,19 +132,47 @@ In this section we show that continuous functions valued in a topological ring `
68132
the structure of a ring.
69133
-/
70134

71-
instance continuous_subring (α : Type u) (R : Type v) [topological_space α] [topological_space R]
135+
section subtype
136+
137+
instance continuous_subring (α : Type*) (R : Type*) [topological_space α] [topological_space R]
72138
[ring R] [topological_ring R] : is_subring { f : α → R | continuous f } :=
73139
{ ..continuous_add_subgroup α R,
74140
..continuous_submonoid α R }.
75141

76-
instance continuous_ring {α : Type u} {R : Type v} [topological_space α] [topological_space R]
142+
instance continuous_ring {α : Type*} {R : Type*} [topological_space α] [topological_space R]
77143
[ring R] [topological_ring R] : ring { f : α → R | continuous f } :=
78144
@subtype.ring _ _ _ (continuous_subring α R) -- infer_instance doesn't work?!
79145

80-
instance continuous_comm_ring {α : Type u} {R : Type v} [topological_space α] [topological_space R]
146+
instance continuous_comm_ring {α : Type*} {R : Type*} [topological_space α] [topological_space R]
81147
[comm_ring R] [topological_ring R] : comm_ring { f : α → R | continuous f } :=
82148
@subtype.comm_ring _ _ _ (continuous_subring α R) -- infer_instance doesn't work?!
83149

150+
end subtype
151+
152+
section continuous_map
153+
154+
instance continuous_map_semiring {α : Type*} {β : Type*} [topological_space α] [topological_space β]
155+
[semiring β] [topological_semiring β] : semiring C(α, β) :=
156+
{ left_distrib := λ a b c, by ext; exact left_distrib _ _ _,
157+
right_distrib := λ a b c, by ext; exact right_distrib _ _ _,
158+
zero_mul := λ a, by ext; exact zero_mul _,
159+
mul_zero := λ a, by ext; exact mul_zero _,
160+
..continuous_map_add_comm_monoid,
161+
..continuous_map_monoid }
162+
163+
instance continuous_map_ring {α : Type*} {β : Type*} [topological_space α] [topological_space β]
164+
[ring β] [topological_ring β] : ring C(α, β) :=
165+
{ ..continuous_map_semiring,
166+
..continuous_map_add_comm_group, }
167+
168+
instance continuous_map_comm_ring {α : Type*} {β : Type*} [topological_space α]
169+
[topological_space β] [comm_ring β] [topological_ring β] : comm_ring C(α, β) :=
170+
{ ..continuous_map_semiring,
171+
..continuous_map_add_comm_group,
172+
..continuous_map_comm_monoid,}
173+
174+
end continuous_map
175+
84176
end ring_structure
85177

86178
local attribute [ext] subtype.eq
@@ -94,7 +186,9 @@ In this section we show that continuous functions valued in a topological semimo
94186
topological semiring `R` inherit the structure of a semimodule.
95187
-/
96188

97-
instance continuous_has_scalar {α : Type*} [topological_space α]
189+
section subtype
190+
191+
instance coninuous_has_scalar {α : Type*} [topological_space α]
98192
(R : Type*) [semiring R] [topological_space R]
99193
(M : Type*) [topological_space M] [add_comm_group M]
100194
[semimodule R M] [topological_semimodule R M] :
@@ -113,6 +207,31 @@ instance continuous_semimodule {α : Type*} [topological_space α]
113207
mul_smul := λ c₁ c₂ f, by ext x; exact mul_smul c₁ c₂ (f x),
114208
one_smul := λ f, by ext x; exact one_smul R (f x) }
115209

210+
end subtype
211+
212+
section continuous_map
213+
214+
instance continuous_map_has_scalar {α : Type*} [topological_space α]
215+
(R : Type*) [semiring R] [topological_space R]
216+
(M : Type*) [topological_space M] [add_comm_monoid M]
217+
[semimodule R M] [topological_semimodule R M] :
218+
has_scalar R C(α, M) :=
219+
⟨λ r f, ⟨r • f, continuous_const.smul f.continuous⟩⟩
220+
221+
instance continuous_map_semimodule {α : Type*} [topological_space α]
222+
{R : Type*} [semiring R] [topological_space R]
223+
{M : Type*} [topological_space M] [add_comm_group M] [topological_add_group M]
224+
[semimodule R M] [topological_semimodule R M] :
225+
semimodule R C(α, M) :=
226+
semimodule.of_core $
227+
{ smul := (•),
228+
smul_add := λ c f g, by ext x; exact smul_add c (f x) (g x),
229+
add_smul := λ c₁ c₂ f, by ext x; exact add_smul c₁ c₂ (f x),
230+
mul_smul := λ c₁ c₂ f, by ext x; exact mul_smul c₁ c₂ (f x),
231+
one_smul := λ f, by ext x; exact one_smul R (f x) }
232+
233+
end continuous_map
234+
116235
end semimodule_structure
117236

118237
section algebra_structure
@@ -125,13 +244,15 @@ In this section we show that continuous functions valued in a topological algebr
125244
obtained by requiring that `A` be both a `topological_semimodule` and a `topological_semiring`
126245
(by now we require `topological_ring`: see TODO below).-/
127246

247+
section subtype
248+
128249
variables {α : Type*} [topological_space α]
129250
{R : Type*} [comm_semiring R]
130251
{A : Type*} [topological_space A] [ring A]
131252
[algebra R A] [topological_ring A]
132253

133254
/-- Continuous constant functions as a `ring_hom`. -/
134-
def C : R →+* { f : α → A | continuous f } :=
255+
def continuous.C : R →+* { f : α → A | continuous f } :=
135256
{ to_fun := λ c : R, ⟨λ x: α, ((algebra_map R A) c), continuous_const⟩,
136257
map_one' := by ext x; exact (algebra_map R A).map_one,
137258
map_mul' := λ c₁ c₂, by ext x; exact (algebra_map R A).map_mul _ _,
@@ -141,7 +262,7 @@ def C : R →+* { f : α → A | continuous f } :=
141262
variables [topological_space R] [topological_semimodule R A]
142263

143264
instance : algebra R { f : α → A | continuous f } :=
144-
{ to_ring_hom := C,
265+
{ to_ring_hom := continuous.C,
145266
commutes' := λ c f, by ext x; exact algebra.commutes' _ _,
146267
smul_def' := λ c f, by ext x; exact algebra.smul_def' _ _,
147268
..continuous_semimodule,
@@ -153,7 +274,34 @@ no `is_subsemiring` but only `subsemiring`, and it will make sense to change thi
153274
file will have no more `is_subobject`s but only `subobject`s. It does not make sense to change
154275
it yet in this direction as `subring` does not exist yet, so everything is being blocked by
155276
`subring`: afterwards everything will need to be updated to the new conventions of Mathlib.
156-
Then the instance of `topological_ring` can also be removed. -/
277+
Then the instance of `topological_ring` can also be removed, as it is below for `continuous_map`. -/
278+
279+
end subtype
280+
281+
section continuous_map
282+
283+
variables {α : Type*} [topological_space α]
284+
{R : Type*} [comm_semiring R]
285+
{A : Type*} [topological_space A] [semiring A]
286+
[algebra R A] [topological_semiring A]
287+
288+
/-- Continuous constant functions as a `ring_hom`. -/
289+
def continuous_map.C : R →+* C(α, A) :=
290+
{ to_fun := λ c : R, ⟨λ x: α, ((algebra_map R A) c), continuous_const⟩,
291+
map_one' := by ext x; exact (algebra_map R A).map_one,
292+
map_mul' := λ c₁ c₂, by ext x; exact (algebra_map R A).map_mul _ _,
293+
map_zero' := by ext x; exact (algebra_map R A).map_zero,
294+
map_add' := λ c₁ c₂, by ext x; exact (algebra_map R A).map_add _ _ }
295+
296+
variables [topological_space R] [topological_semimodule R A]
297+
298+
instance : algebra R C(α, A) :=
299+
{ to_ring_hom := continuous_map.C,
300+
commutes' := λ c f, by ext x; exact algebra.commutes' _ _,
301+
smul_def' := λ c f, by ext x; exact algebra.smul_def' _ _,
302+
..continuous_map_semiring }
303+
304+
end continuous_map
157305

158306
end algebra_structure
159307

@@ -165,6 +313,8 @@ section module_over_continuous_functions
165313
If `M` is a module over `R`, then we show that the space of continuous functions from `α` to `M`
166314
is naturally a module over the algebra of continuous functions from `α` to `M`. -/
167315

316+
section subtype
317+
168318
instance continuous_has_scalar' {α : Type*} [topological_space α]
169319
{R : Type*} [semiring R] [topological_space R]
170320
{M : Type*} [topological_space M] [add_comm_group M]
@@ -184,4 +334,29 @@ instance continuous_module' {α : Type*} [topological_space α]
184334
mul_smul := λ c₁ c₂ f, by ext x; exact mul_smul (c₁ x) (c₂ x) (f x),
185335
one_smul := λ f, by ext x; exact one_smul R (f x) }
186336

337+
end subtype
338+
339+
section continuous_map
340+
341+
instance continuous_map_has_scalar' {α : Type*} [topological_space α]
342+
{R : Type*} [semiring R] [topological_space R]
343+
{M : Type*} [topological_space M] [add_comm_group M]
344+
[semimodule R M] [topological_semimodule R M] :
345+
has_scalar C(α, R) C(α, M) :=
346+
⟨λ f g, ⟨λ x, (f x) • (g x), (continuous.smul f.2 g.2)⟩⟩
347+
348+
instance continuous_map_module' {α : Type*} [topological_space α]
349+
(R : Type*) [ring R] [topological_space R] [topological_ring R]
350+
(M : Type*) [topological_space M] [add_comm_group M] [topological_add_group M]
351+
[module R M] [topological_module R M]
352+
: module C(α, R) C(α, M) :=
353+
semimodule.of_core $
354+
{ smul := (•),
355+
smul_add := λ c f g, by ext x; exact smul_add (c x) (f x) (g x),
356+
add_smul := λ c₁ c₂ f, by ext x; exact add_smul (c₁ x) (c₂ x) (f x),
357+
mul_smul := λ c₁ c₂ f, by ext x; exact mul_smul (c₁ x) (c₂ x) (f x),
358+
one_smul := λ f, by ext x; exact one_smul R (f x) }
359+
360+
end continuous_map
361+
187362
end module_over_continuous_functions

src/topology/algebra/group.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,7 @@ instance : has_continuous_add α :=
342342
(map (λx:α, (a + b) + x) (Z α)),
343343
{ simpa [(∘), add_comm, add_left_comm] },
344344
exact tendsto_map.comp add_Z
345-
end
345+
end
346346

347347
@[priority 100] -- see Note [lower instance priority]
348348
instance : topological_add_group α :=

0 commit comments

Comments
 (0)