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

Commit a16650c

Browse files
committed
feat(geometry/manifold/algebra/smooth_functions): add coe_fn_(linear_map|ring_hom|alg_hom) (#7749)
Changed names to be consistent with the topology library and proven that some coercions are morphisms.
1 parent bf83c30 commit a16650c

File tree

1 file changed

+69
-39
lines changed

1 file changed

+69
-39
lines changed

src/geometry/manifold/algebra/smooth_functions.lean

Lines changed: 69 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,6 @@ instance has_one {G : Type*} [monoid G] [topological_space G] [charted_space H'
5353
lemma coe_one {G : Type*} [monoid G] [topological_space G] [charted_space H' G] :
5454
⇑(1 : C^∞⟮I, N; I', G⟯) = 1 := rfl
5555

56-
end smooth_map
57-
5856
section group_structure
5957

6058
/-!
@@ -65,56 +63,63 @@ under pointwise multiplication.
6563
-/
6664

6765
@[to_additive]
68-
instance smooth_map_semigroup {G : Type*} [semigroup G] [topological_space G]
66+
instance semigroup {G : Type*} [semigroup G] [topological_space G]
6967
[charted_space H' G] [has_smooth_mul I' G] :
7068
semigroup C^∞⟮I, N; I', G⟯ :=
7169
{ mul_assoc := λ a b c, by ext; exact mul_assoc _ _ _,
7270
..smooth_map.has_mul}
7371

7472
@[to_additive]
75-
instance smooth_map_monoid {G : Type*} [monoid G] [topological_space G]
73+
instance monoid {G : Type*} [monoid G] [topological_space G]
7674
[charted_space H' G] [has_smooth_mul I' G] :
7775
monoid C^∞⟮I, N; I', G⟯ :=
7876
{ one_mul := λ a, by ext; exact one_mul _,
7977
mul_one := λ a, by ext; exact mul_one _,
80-
..smooth_map_semigroup,
78+
..smooth_map.semigroup,
8179
..smooth_map.has_one }
8280

81+
/-- Coercion to a function as an `monoid_hom`. Similar to `monoid_hom.coe_fn`. -/
82+
@[to_additive "Coercion to a function as an `add_monoid_hom`. Similar to `add_monoid_hom.coe_fn`.",
83+
simps]
84+
def coe_fn_monoid_hom {G : Type*} [monoid G] [topological_space G]
85+
[charted_space H' G] [has_smooth_mul I' G] : C^∞⟮I, N; I', G⟯ →* (N → G) :=
86+
{ to_fun := coe_fn, map_one' := coe_one, map_mul' := coe_mul }
87+
8388
@[to_additive]
84-
instance smooth_map_comm_monoid {G : Type*} [comm_monoid G] [topological_space G]
89+
instance comm_monoid {G : Type*} [comm_monoid G] [topological_space G]
8590
[charted_space H' G] [has_smooth_mul I' G] :
8691
comm_monoid C^∞⟮I, N; I', G⟯ :=
8792
{ mul_comm := λ a b, by ext; exact mul_comm _ _,
88-
..smooth_map_monoid,
93+
..smooth_map.monoid,
8994
..smooth_map.has_one }
9095

9196
@[to_additive]
92-
instance smooth_map_group {G : Type*} [group G] [topological_space G]
97+
instance group {G : Type*} [group G] [topological_space G]
9398
[charted_space H' G] [lie_group I' G] :
9499
group C^∞⟮I, N; I', G⟯ :=
95100
{ inv := λ f, ⟨λ x, (f x)⁻¹, f.smooth.inv⟩,
96101
mul_left_inv := λ a, by ext; exact mul_left_inv _,
97102
div := λ f g, ⟨f / g, f.smooth.div g.smooth⟩,
98103
div_eq_mul_inv := λ f g, by ext; exact div_eq_mul_inv _ _,
99-
.. smooth_map_monoid }
104+
.. smooth_map.monoid }
100105

101106
@[simp, to_additive]
102-
lemma smooth_map.coe_inv {G : Type*} [group G] [topological_space G]
107+
lemma coe_inv {G : Type*} [group G] [topological_space G]
103108
[charted_space H' G] [lie_group I' G] (f : C^∞⟮I, N; I', G⟯) :
104109
⇑f⁻¹ = f⁻¹ := rfl
105110

106111
@[simp, to_additive]
107-
lemma smooth_map.coe_div {G : Type*} [group G] [topological_space G]
112+
lemma coe_div {G : Type*} [group G] [topological_space G]
108113
[charted_space H' G] [lie_group I' G] (f g : C^∞⟮I, N; I', G⟯) :
109114
⇑(f / g) = f / g :=
110115
rfl
111116

112117
@[to_additive]
113-
instance smooth_map_comm_group {G : Type*} [comm_group G] [topological_space G]
118+
instance comm_group {G : Type*} [comm_group G] [topological_space G]
114119
[charted_space H' G] [lie_group I' G] :
115120
comm_group C^∞⟮I, N; I', G⟯ :=
116-
{ ..smooth_map_group,
117-
..smooth_map_comm_monoid }
121+
{ ..smooth_map.group,
122+
..smooth_map.comm_monoid }
118123

119124
end group_structure
120125

@@ -127,28 +132,36 @@ In this section we show that smooth functions valued in a smooth ring `R` inheri
127132
under pointwise multiplication.
128133
-/
129134

130-
instance smooth_map_semiring {R : Type*} [semiring R] [topological_space R]
135+
instance semiring {R : Type*} [semiring R] [topological_space R]
131136
[charted_space H' R] [smooth_semiring I' R] :
132137
semiring C^∞⟮I, N; I', R⟯ :=
133138
{ left_distrib := λ a b c, by ext; exact left_distrib _ _ _,
134139
right_distrib := λ a b c, by ext; exact right_distrib _ _ _,
135140
zero_mul := λ a, by ext; exact zero_mul _,
136141
mul_zero := λ a, by ext; exact mul_zero _,
137-
..smooth_map_add_comm_monoid,
138-
..smooth_map_monoid }
142+
..smooth_map.add_comm_monoid,
143+
..smooth_map.monoid }
139144

140-
instance smooth_map_ring {R : Type*} [ring R] [topological_space R]
145+
instance ring {R : Type*} [ring R] [topological_space R]
141146
[charted_space H' R] [smooth_ring I' R] :
142147
ring C^∞⟮I, N; I', R⟯ :=
143-
{ ..smooth_map_semiring,
144-
..smooth_map_add_comm_group, }
148+
{ ..smooth_map.semiring,
149+
..smooth_map.add_comm_group, }
145150

146-
instance smooth_map_comm_ring {R : Type*} [comm_ring R] [topological_space R]
151+
instance comm_ring {R : Type*} [comm_ring R] [topological_space R]
147152
[charted_space H' R] [smooth_ring I' R] :
148153
comm_ring C^∞⟮I, N; I', R⟯ :=
149-
{ ..smooth_map_semiring,
150-
..smooth_map_add_comm_group,
151-
..smooth_map_comm_monoid,}
154+
{ ..smooth_map.semiring,
155+
..smooth_map.add_comm_group,
156+
..smooth_map.comm_monoid,}
157+
158+
/-- Coercion to a function as a `ring_hom`. -/
159+
@[simps]
160+
def coe_fn_ring_hom {R : Type*} [comm_ring R] [topological_space R]
161+
[charted_space H' R] [smooth_ring I' R] : C^∞⟮I, N; I', R⟯ →+* (N → R) :=
162+
{ to_fun := coe_fn,
163+
..(coe_fn_monoid_hom : C^∞⟮I, N; I', R⟯ →* _),
164+
..(coe_fn_add_monoid_hom : C^∞⟮I, N; I', R⟯ →+ _) }
152165

153166
end ring_structure
154167

@@ -161,22 +174,20 @@ In this section we show that smooth functions valued in a vector space `M` over
161174
field `𝕜` inherit a vector space structure.
162175
-/
163176

164-
instance smooth_map_has_scalar
165-
{V : Type*} [normed_group V] [normed_space 𝕜 V] :
177+
instance has_scalar {V : Type*} [normed_group V] [normed_space 𝕜 V] :
166178
has_scalar 𝕜 C^∞⟮I, N; 𝓘(𝕜, V), V⟯ :=
167179
⟨λ r f, ⟨r • f, smooth_const.smul f.smooth⟩⟩
168180

169181
@[simp]
170-
lemma smooth_map.coe_smul
171-
{V : Type*} [normed_group V] [normed_space 𝕜 V] (r : 𝕜) (f : C^∞⟮I, N; 𝓘(𝕜, V), V⟯) :
182+
lemma coe_smul {V : Type*} [normed_group V] [normed_space 𝕜 V]
183+
(r : 𝕜) (f : C^∞⟮I, N; 𝓘(𝕜, V), V⟯) :
172184
⇑(r • f) = r • f := rfl
173185

174-
@[simp] lemma smooth_map.smul_comp {V : Type*} [normed_group V] [normed_space 𝕜 V]
186+
@[simp] lemma smul_comp {V : Type*} [normed_group V] [normed_space 𝕜 V]
175187
(r : 𝕜) (g : C^∞⟮I'', N'; 𝓘(𝕜, V), V⟯) (h : C^∞⟮I, N; I'', N'⟯) :
176188
(r • g).comp h = r • (g.comp h) := rfl
177189

178-
instance smooth_map_module
179-
{V : Type*} [normed_group V] [normed_space 𝕜 V] :
190+
instance module {V : Type*} [normed_group V] [normed_space 𝕜 V] :
180191
module 𝕜 C^∞⟮I, N; 𝓘(𝕜, V), V⟯ :=
181192
module.of_core $
182193
{ smul := (•),
@@ -185,6 +196,14 @@ module.of_core $
185196
mul_smul := λ c₁ c₂ f, by ext x; exact mul_smul c₁ c₂ (f x),
186197
one_smul := λ f, by ext x; exact one_smul 𝕜 (f x), }
187198

199+
/-- Coercion to a function as a `linear_map`. -/
200+
@[simps]
201+
def coe_fn_linear_map {V : Type*} [normed_group V] [normed_space 𝕜 V] :
202+
C^∞⟮I, N; 𝓘(𝕜, V), V⟯ →ₗ[𝕜] (N → V) :=
203+
{ to_fun := coe_fn,
204+
map_smul' := coe_smul,
205+
..(coe_fn_add_monoid_hom : C^∞⟮I, N; 𝓘(𝕜, V), V⟯ →+ _) }
206+
188207
end module_structure
189208

190209
section algebra_structure
@@ -199,20 +218,31 @@ inherit an algebra structure.
199218
variables {A : Type*} [normed_ring A] [normed_algebra 𝕜 A] [smooth_ring 𝓘(𝕜, A) A]
200219

201220
/-- Smooth constant functions as a `ring_hom`. -/
202-
def smooth_map.C : 𝕜 →+* C^∞⟮I, N; 𝓘(𝕜, A), A⟯ :=
221+
def C : 𝕜 →+* C^∞⟮I, N; 𝓘(𝕜, A), A⟯ :=
203222
{ to_fun := λ c : 𝕜, ⟨λ x, ((algebra_map 𝕜 A) c), smooth_const⟩,
204223
map_one' := by ext x; exact (algebra_map 𝕜 A).map_one,
205224
map_mul' := λ c₁ c₂, by ext x; exact (algebra_map 𝕜 A).map_mul _ _,
206225
map_zero' := by ext x; exact (algebra_map 𝕜 A).map_zero,
207226
map_add' := λ c₁ c₂, by ext x; exact (algebra_map 𝕜 A).map_add _ _ }
208227

209-
instance : algebra 𝕜 C^∞⟮I, N; 𝓘(𝕜, A), A⟯ :=
228+
instance algebra : algebra 𝕜 C^∞⟮I, N; 𝓘(𝕜, A), A⟯ :=
210229
{ smul := λ r f,
211230
⟨r • f, smooth_const.smul f.smooth⟩,
212231
to_ring_hom := smooth_map.C,
213232
commutes' := λ c f, by ext x; exact algebra.commutes' _ _,
214233
smul_def' := λ c f, by ext x; exact algebra.smul_def' _ _,
215-
..smooth_map_semiring }
234+
..smooth_map.semiring }
235+
236+
/-- Coercion to a function as an `alg_hom`. -/
237+
@[simps]
238+
def coe_fn_alg_hom : C^∞⟮I, N; 𝓘(𝕜, A), A⟯ →ₐ[𝕜] (N → A) :=
239+
{ to_fun := coe_fn,
240+
commutes' := λ r, rfl,
241+
-- `..(smooth_map.coe_fn_ring_hom : C^∞⟮I, N; 𝓘(𝕜, A), A⟯ →+* _)` times out for some reason
242+
map_zero' := smooth_map.coe_zero,
243+
map_one' := smooth_map.coe_one,
244+
map_add' := smooth_map.coe_add,
245+
map_mul' := smooth_map.coe_mul }
216246

217247
end algebra_structure
218248

@@ -224,17 +254,15 @@ section module_over_continuous_functions
224254
If `V` is a module over `𝕜`, then we show that the space of smooth functions from `N` to `V`
225255
is naturally a vector space over the ring of smooth functions from `N` to `𝕜`. -/
226256

227-
instance smooth_map_has_scalar'
228-
{V : Type*} [normed_group V] [normed_space 𝕜 V] :
257+
instance has_scalar' {V : Type*} [normed_group V] [normed_space 𝕜 V] :
229258
has_scalar C^∞⟮I, N; 𝕜⟯ C^∞⟮I, N; 𝓘(𝕜, V), V⟯ :=
230259
⟨λ f g, ⟨λ x, (f x) • (g x), (smooth.smul f.2 g.2)⟩⟩
231260

232-
@[simp] lemma smooth_map.smul_comp' {V : Type*} [normed_group V] [normed_space 𝕜 V]
261+
@[simp] lemma smul_comp' {V : Type*} [normed_group V] [normed_space 𝕜 V]
233262
(f : C^∞⟮I'', N'; 𝕜⟯) (g : C^∞⟮I'', N'; 𝓘(𝕜, V), V⟯) (h : C^∞⟮I, N; I'', N'⟯) :
234263
(f • g).comp h = (f.comp h) • (g.comp h) := rfl
235264

236-
instance smooth_map_module'
237-
{V : Type*} [normed_group V] [normed_space 𝕜 V] :
265+
instance module' {V : Type*} [normed_group V] [normed_space 𝕜 V] :
238266
module C^∞⟮I, N; 𝓘(𝕜), 𝕜⟯ C^∞⟮I, N; 𝓘(𝕜, V), V⟯ :=
239267
{ smul := (•),
240268
smul_add := λ c f g, by ext x; exact smul_add (c x) (f x) (g x),
@@ -245,3 +273,5 @@ instance smooth_map_module'
245273
smul_zero := λ r, by ext x; exact smul_zero _, }
246274

247275
end module_over_continuous_functions
276+
277+
end smooth_map

0 commit comments

Comments
 (0)