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

Commit 49fd719

Browse files
committed
feat(topology/algebra,geometry/manifold): continuity and smoothness of locally finite products of functions (#7128)
1 parent d820a9d commit 49fd719

File tree

3 files changed

+113
-34
lines changed

3 files changed

+113
-34
lines changed

src/geometry/manifold/algebra/monoid.lean

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,3 +173,54 @@ instance : inhabited (smooth_monoid_morphism I I' G G') := ⟨1⟩
173173
instance : has_coe_to_fun (smooth_monoid_morphism I I' G G') := ⟨_, λ a, a.to_fun⟩
174174

175175
end monoid
176+
177+
section comm_monoid
178+
179+
open_locale big_operators
180+
181+
variables {𝕜 : Type*} [nondiscrete_normed_field 𝕜]
182+
{H : Type*} [topological_space H]
183+
{E : Type*} [normed_group E] [normed_space 𝕜 E] {I : model_with_corners 𝕜 E H}
184+
{G : Type*} [comm_monoid G] [topological_space G] [charted_space H G] [has_smooth_mul I G]
185+
{E' : Type*} [normed_group E'] [normed_space 𝕜 E']
186+
{H' : Type*} [topological_space H'] {I' : model_with_corners 𝕜 E' H'}
187+
{M : Type*} [topological_space M] [charted_space H' M]
188+
189+
@[to_additive]
190+
lemma smooth_finset_prod' {ι} {s : finset ι} {f : ι → M → G} (h : ∀ i ∈ s, smooth I' I (f i)) :
191+
smooth I' I (∏ i in s, f i) :=
192+
finset.prod_induction _ _ (λ f g hf hg, hf.mul hg)
193+
(@smooth_const _ _ _ _ _ _ _ I' _ _ _ _ _ _ _ _ I _ _ _ 1) h
194+
195+
@[to_additive]
196+
lemma smooth_finset_prod {ι} {s : finset ι} {f : ι → M → G} (h : ∀ i ∈ s, smooth I' I (f i)) :
197+
smooth I' I (λ x, ∏ i in s, f i x) :=
198+
by { simp only [← finset.prod_apply], exact smooth_finset_prod' h }
199+
200+
open function filter
201+
202+
@[to_additive]
203+
lemma smooth_finprod {ι} {f : ι → M → G} (h : ∀ i, smooth I' I (f i))
204+
(hfin : locally_finite (λ i, mul_support (f i))) :
205+
smooth I' I (λ x, ∏ᶠ i, f i x) :=
206+
begin
207+
intro x,
208+
rcases hfin x with ⟨U, hxU, hUf⟩,
209+
have : smooth_at I' I (λ x, ∏ i in hUf.to_finset, f i x) x,
210+
from smooth_finset_prod (λ i hi, h i) x,
211+
refine this.congr_of_eventually_eq (mem_sets_of_superset hxU $ λ y hy, _),
212+
refine finprod_eq_prod_of_mul_support_subset _ (λ i hi, _),
213+
rw [hUf.coe_to_finset],
214+
exact ⟨y, hi, hy⟩
215+
end
216+
217+
@[to_additive]
218+
lemma smooth_finprod_cond {ι} {f : ι → M → G} {p : ι → Prop} (hc : ∀ i, p i → smooth I' I (f i))
219+
(hf : locally_finite (λ i, mul_support (f i))) :
220+
smooth I' I (λ x, ∏ᶠ i (hi : p i), f i x) :=
221+
begin
222+
simp only [← finprod_subtype_eq_finprod_cond],
223+
exact smooth_finprod (λ i, hc i i.2) (hf.comp_injective subtype.coe_injective)
224+
end
225+
226+
end comm_monoid

src/topology/algebra/monoid.lean

Lines changed: 55 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import topology.continuous_on
77
import group_theory.submonoid.operations
88
import algebra.group.prod
99
import algebra.pointwise
10+
import algebra.big_operators.finprod
1011

1112
/-!
1213
# Theory of topological monoids
@@ -19,17 +20,17 @@ the definitions.
1920
open classical set filter topological_space
2021
open_locale classical topological_space big_operators
2122

22-
variables {α β M N : Type*}
23+
variables {ι α X M N : Type*} [topological_space X]
2324

2425
/-- Basic hypothesis to talk about a topological additive monoid or a topological additive
25-
semigroup. A topological additive monoid over `α`, for example, is obtained by requiring both the
26-
instances `add_monoid α` and `has_continuous_add α`. -/
26+
semigroup. A topological additive monoid over `M`, for example, is obtained by requiring both the
27+
instances `add_monoid M` and `has_continuous_add M`. -/
2728
class has_continuous_add (M : Type*) [topological_space M] [has_add M] : Prop :=
2829
(continuous_add : continuous (λ p : M × M, p.1 + p.2))
2930

3031
/-- Basic hypothesis to talk about a topological monoid or a topological semigroup.
31-
A topological monoid over `α`, for example, is obtained by requiring both the instances `monoid α`
32-
and `has_continuous_mul α`. -/
32+
A topological monoid over `M`, for example, is obtained by requiring both the instances `monoid M`
33+
and `has_continuous_mul M`. -/
3334
@[to_additive]
3435
class has_continuous_mul (M : Type*) [topological_space M] [has_mul M] : Prop :=
3536
(continuous_mul : continuous (λ p : M × M, p.1 * p.2))
@@ -43,8 +44,7 @@ lemma continuous_mul : continuous (λp:M×M, p.1 * p.2) :=
4344
has_continuous_mul.continuous_mul
4445

4546
@[continuity, to_additive]
46-
lemma continuous.mul [topological_space α] {f : α → M} {g : α → M}
47-
(hf : continuous f) (hg : continuous g) :
47+
lemma continuous.mul {f g : X → M} (hf : continuous f) (hg : continuous g) :
4848
continuous (λx, f x * g x) :=
4949
continuous_mul.comp (hf.prod_mk hg : _)
5050

@@ -60,8 +60,8 @@ lemma continuous_mul_right (a : M) : continuous (λ b:M, b * a) :=
6060
continuous_id.mul continuous_const
6161

6262
@[to_additive]
63-
lemma continuous_on.mul [topological_space α] {f : α → M} {g : α → M} {s : set α}
64-
(hf : continuous_on f s) (hg : continuous_on g s) :
63+
lemma continuous_on.mul {f g : X → M} {s : set X} (hf : continuous_on f s)
64+
(hg : continuous_on g s) :
6565
continuous_on (λx, f x * g x) s :=
6666
(continuous_mul.comp_continuous_on (hf.prod hg) : _)
6767

@@ -70,7 +70,7 @@ lemma tendsto_mul {a b : M} : tendsto (λp:M×M, p.fst * p.snd) (𝓝 (a, b)) (
7070
continuous_iff_continuous_at.mp has_continuous_mul.continuous_mul (a, b)
7171

7272
@[to_additive]
73-
lemma filter.tendsto.mul {f : α → M} {g : α → M} {x : filter α} {a b : M}
73+
lemma filter.tendsto.mul {f g : α → M} {x : filter α} {a b : M}
7474
(hf : tendsto f x (𝓝 a)) (hg : tendsto g x (𝓝 b)) :
7575
tendsto (λx, f x * g x) x (𝓝 (a * b)) :=
7676
tendsto_mul.comp (hf.prod_mk_nhds hg)
@@ -86,14 +86,13 @@ lemma filter.tendsto.mul_const (b : M) {c : M} {f : α → M} {l : filter α}
8686
h.mul tendsto_const_nhds
8787

8888
@[to_additive]
89-
lemma continuous_at.mul [topological_space α] {f : α → M} {g : α → M} {x : α}
90-
(hf : continuous_at f x) (hg : continuous_at g x) :
89+
lemma continuous_at.mul {f g : X → M} {x : X} (hf : continuous_at f x) (hg : continuous_at g x) :
9190
continuous_at (λx, f x * g x) x :=
9291
hf.mul hg
9392

9493
@[to_additive]
95-
lemma continuous_within_at.mul [topological_space α] {f : α → M} {g : α → M} {s : set α} {x : α}
96-
(hf : continuous_within_at f s x) (hg : continuous_within_at g s x) :
94+
lemma continuous_within_at.mul {f g : X → M} {s : set X} {x : X} (hf : continuous_within_at f s x)
95+
(hg : continuous_within_at g s x) :
9796
continuous_within_at (λx, f x * g x) s x :=
9897
hf.mul hg
9998

@@ -103,8 +102,8 @@ instance [topological_space N] [has_mul N] [has_continuous_mul N] : has_continuo
103102
((continuous_snd.comp continuous_fst).mul (continuous_snd.comp continuous_snd))⟩
104103

105104
@[to_additive]
106-
instance pi.has_continuous_mul {C : βType*} [∀ b, topological_space (C b)]
107-
[∀ b, has_mul (C b)] [∀ b, has_continuous_mul (C b)] : has_continuous_mul (Π b, C b) :=
105+
instance pi.has_continuous_mul {C : ιType*} [∀ i, topological_space (C i)]
106+
[∀ i, has_mul (C i)] [∀ i, has_continuous_mul (C i)] : has_continuous_mul (Π i, C i) :=
108107
{ continuous_mul := continuous_pi (λ i, continuous.mul
109108
((continuous_apply i).comp continuous_fst) ((continuous_apply i).comp continuous_snd)) }
110109

@@ -243,8 +242,8 @@ begin
243242
end
244243

245244
@[to_additive]
246-
lemma tendsto_list_prod {f : β → α → M} {x : filter α} {a : β → M} :
247-
∀l:list β, (∀c∈l, tendsto (f c) x (𝓝 (a c))) →
245+
lemma tendsto_list_prod {f : ι → α → M} {x : filter α} {a : ι → M} :
246+
l:list ι, (∀i∈l, tendsto (f i) x (𝓝 (a i))) →
248247
tendsto (λb, (l.map (λc, f c b)).prod) x (𝓝 ((l.map a).prod))
249248
| [] _ := by simp [tendsto_const_nhds]
250249
| (f :: l) h :=
@@ -255,9 +254,9 @@ lemma tendsto_list_prod {f : β → α → M} {x : filter α} {a : β → M} :
255254
end
256255

257256
@[to_additive]
258-
lemma continuous_list_prod [topological_space α] {f : βα → M} (l : list β)
259-
(h : ∀c∈l, continuous (f c)) :
260-
continuous (λa, (l.map (λc, f c a)).prod) :=
257+
lemma continuous_list_prod {f : ιX → M} (l : list ι)
258+
(h : ∀i∈l, continuous (f i)) :
259+
continuous (λa, (l.map (λi, f i a)).prod) :=
261260
continuous_iff_continuous_at.2 $ assume x, tendsto_list_prod l $ assume c hc,
262261
continuous_iff_continuous_at.1 (h c hc) x
263262

@@ -268,7 +267,7 @@ lemma continuous_pow : ∀ n : ℕ, continuous (λ a : M, a ^ n)
268267
| (k+1) := by { simp only [pow_succ], exact continuous_id.mul (continuous_pow _) }
269268

270269
@[continuity]
271-
lemma continuous.pow {f : α → M} [topological_space α] (h : continuous f) (n : ℕ) :
270+
lemma continuous.pow {f : X → M} (h : continuous f) (n : ℕ) :
272271
continuous (λ b, (f b) ^ n) :=
273272
continuous.comp (continuous_pow n) h
274273

@@ -338,31 +337,55 @@ mem_nhds_sets oS S.one_mem
338337
variable [has_continuous_mul M]
339338

340339
@[to_additive]
341-
lemma tendsto_multiset_prod {f : β → α → M} {x : filter α} {a : β → M} (s : multiset β) :
342-
(∀c∈s, tendsto (f c) x (𝓝 (a c))) →
340+
lemma tendsto_multiset_prod {f : ι → α → M} {x : filter α} {a : ι → M} (s : multiset ι) :
341+
(∀ i ∈ s, tendsto (f i) x (𝓝 (a i))) →
343342
tendsto (λb, (s.map (λc, f c b)).prod) x (𝓝 ((s.map a).prod)) :=
344-
by { rcases s with ⟨l⟩, simp, exact tendsto_list_prod l }
343+
by { rcases s with ⟨l⟩, simpa using tendsto_list_prod l }
345344

346345
@[to_additive]
347-
lemma tendsto_finset_prod {f : β → α → M} {x : filter α} {a : β → M} (s : finset β) :
348-
(∀c∈s, tendsto (f c) x (𝓝 (a c))) → tendsto (λb, ∏ c in s, f c b) x (𝓝 (∏ c in s, a c)) :=
346+
lemma tendsto_finset_prod {f : ι → α → M} {x : filter α} {a : ι → M} (s : finset ι) :
347+
(∀ i ∈ s, tendsto (f i) x (𝓝 (a i))) → tendsto (λb, ∏ c in s, f c b) x (𝓝 (∏ c in s, a c)) :=
349348
tendsto_multiset_prod _
350349

351350
@[to_additive, continuity]
352-
lemma continuous_multiset_prod [topological_space α] {f : βα → M} (s : multiset β) :
353-
(∀c∈s, continuous (f c)) → continuous (λa, (s.map (λc, f c a)).prod) :=
354-
by { rcases s with ⟨l⟩, simp, exact continuous_list_prod l }
351+
lemma continuous_multiset_prod {f : ιX → M} (s : multiset ι) :
352+
(∀i ∈ s, continuous (f i)) → continuous (λ a, (s.map (λ i, f i a)).prod) :=
353+
by { rcases s with ⟨l⟩, simpa using continuous_list_prod l }
355354

356355
attribute [continuity] continuous_multiset_sum
357356

358357
@[continuity, to_additive]
359-
lemma continuous_finset_prod [topological_space α] {f : βα → M} (s : finset β) :
360-
(∀c∈s, continuous (f c)) → continuous (λa, ∏ c in s, f c a) :=
358+
lemma continuous_finset_prod {f : ιX → M} (s : finset ι) :
359+
(∀ i ∈ s, continuous (f i)) → continuous (λa, ∏ i in s, f i a) :=
361360
continuous_multiset_prod _
362361

363362
-- should `to_additive` be doing this?
364363
attribute [continuity] continuous_finset_sum
365364

365+
open function
366+
367+
@[to_additive] lemma continuous_finprod {f : ι → X → M} (hc : ∀ i, continuous (f i))
368+
(hf : locally_finite (λ i, mul_support (f i))) :
369+
continuous (λ x, ∏ᶠ i, f i x) :=
370+
begin
371+
refine continuous_iff_continuous_at.2 (λ x, _),
372+
rcases hf x with ⟨U, hxU, hUf⟩,
373+
have : continuous_at (λ x, ∏ i in hUf.to_finset, f i x) x,
374+
from tendsto_finset_prod _ (λ i hi, (hc i).continuous_at),
375+
refine this.congr (mem_sets_of_superset hxU $ λ y hy, _),
376+
refine (finprod_eq_prod_of_mul_support_subset _ (λ i hi, _)).symm,
377+
rw [hUf.coe_to_finset],
378+
exact ⟨y, hi, hy⟩
379+
end
380+
381+
@[to_additive] lemma continuous_finprod_cond {f : ι → X → M} {p : ι → Prop}
382+
(hc : ∀ i, p i → continuous (f i)) (hf : locally_finite (λ i, mul_support (f i))) :
383+
continuous (λ x, ∏ᶠ i (hi : p i), f i x) :=
384+
begin
385+
simp only [← finprod_subtype_eq_finprod_cond],
386+
exact continuous_finprod (λ i, hc i i.2) (hf.comp_injective subtype.coe_injective)
387+
end
388+
366389
end
367390

368391
instance additive.has_continuous_add {M} [h : topological_space M] [has_mul M]

src/topology/continuous_function/basic.lean

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,14 @@ instance : has_coe_to_fun (C(α, β)) := ⟨_, continuous_map.to_fun⟩
3636

3737
variables {α β} {f g : continuous_map α β}
3838

39-
protected lemma continuous (f : C(α, β)) : continuous f := f.continuous_to_fun
39+
@[continuity] protected lemma continuous (f : C(α, β)) : continuous f := f.continuous_to_fun
4040

41-
@[continuity] lemma coe_continuous : continuous (f : α → β) := f.continuous_to_fun
41+
protected lemma continuous_at (f : C(α, β)) (x : α) : continuous_at f x :=
42+
f.continuous.continuous_at
43+
44+
protected lemma continuous_within_at (f : C(α, β)) (s : set α) (x : α) :
45+
continuous_within_at f s x :=
46+
f.continuous.continuous_within_at
4247

4348
@[ext] theorem ext (H : ∀ x, f x = g x) : f = g :=
4449
by cases f; cases g; congr'; exact funext H

0 commit comments

Comments
 (0)