This repository has been archived by the owner on Jul 24, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 299
/
cont_mdiff.lean
1986 lines (1654 loc) · 85.3 KB
/
cont_mdiff.lean
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/-
Copyright (c) 2020 Sébastien Gouëzel. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Sébastien Gouëzel, Floris van Doorn
-/
import geometry.manifold.smooth_manifold_with_corners
import geometry.manifold.local_invariant_properties
/-!
# Smooth functions between smooth manifolds
> THIS FILE IS SYNCHRONIZED WITH MATHLIB4.
> Any changes to this file require a corresponding PR to mathlib4.
We define `Cⁿ` functions between smooth manifolds, as functions which are `Cⁿ` in charts, and prove
basic properties of these notions.
## Main definitions and statements
Let `M ` and `M'` be two smooth manifolds, with respect to model with corners `I` and `I'`. Let
`f : M → M'`.
* `cont_mdiff_within_at I I' n f s x` states that the function `f` is `Cⁿ` within the set `s`
around the point `x`.
* `cont_mdiff_at I I' n f x` states that the function `f` is `Cⁿ` around `x`.
* `cont_mdiff_on I I' n f s` states that the function `f` is `Cⁿ` on the set `s`
* `cont_mdiff I I' n f` states that the function `f` is `Cⁿ`.
* `cont_mdiff_on.comp` gives the invariance of the `Cⁿ` property under composition
* `cont_mdiff_iff_cont_diff` states that, for functions between vector spaces,
manifold-smoothness is equivalent to usual smoothness.
We also give many basic properties of smooth functions between manifolds, following the API of
smooth functions between vector spaces.
## Implementation details
Many properties follow for free from the corresponding properties of functions in vector spaces,
as being `Cⁿ` is a local property invariant under the smooth groupoid. We take advantage of the
general machinery developed in `local_invariant_properties.lean` to get these properties
automatically. For instance, the fact that being `Cⁿ` does not depend on the chart one considers
is given by `lift_prop_within_at_indep_chart`.
For this to work, the definition of `cont_mdiff_within_at` and friends has to
follow definitionally the setup of local invariant properties. Still, we recast the definition
in terms of extended charts in `cont_mdiff_on_iff` and `cont_mdiff_iff`.
-/
open set function filter charted_space smooth_manifold_with_corners
open_locale topology manifold
/-! ### Definition of smooth functions between manifolds -/
variables {𝕜 : Type*} [nontrivially_normed_field 𝕜]
-- declare a smooth manifold `M` over the pair `(E, H)`.
{E : Type*} [normed_add_comm_group E] [normed_space 𝕜 E]
{H : Type*} [topological_space H] (I : model_with_corners 𝕜 E H)
{M : Type*} [topological_space M] [charted_space H M] [Is : smooth_manifold_with_corners I M]
-- declare a smooth manifold `M'` over the pair `(E', H')`.
{E' : Type*} [normed_add_comm_group E'] [normed_space 𝕜 E']
{H' : Type*} [topological_space H'] (I' : model_with_corners 𝕜 E' H')
{M' : Type*} [topological_space M'] [charted_space H' M'] [I's : smooth_manifold_with_corners I' M']
-- declare a manifold `M''` over the pair `(E'', H'')`.
{E'' : Type*} [normed_add_comm_group E''] [normed_space 𝕜 E'']
{H'' : Type*} [topological_space H''] {I'' : model_with_corners 𝕜 E'' H''}
{M'' : Type*} [topological_space M''] [charted_space H'' M'']
-- declare a smooth manifold `N` over the pair `(F, G)`.
{F : Type*} [normed_add_comm_group F] [normed_space 𝕜 F]
{G : Type*} [topological_space G] {J : model_with_corners 𝕜 F G}
{N : Type*} [topological_space N] [charted_space G N] [Js : smooth_manifold_with_corners J N]
-- declare a smooth manifold `N'` over the pair `(F', G')`.
{F' : Type*} [normed_add_comm_group F'] [normed_space 𝕜 F']
{G' : Type*} [topological_space G'] {J' : model_with_corners 𝕜 F' G'}
{N' : Type*} [topological_space N'] [charted_space G' N'] [J's : smooth_manifold_with_corners J' N']
-- F₁, F₂, F₃, F₄ are normed spaces
{F₁ : Type*} [normed_add_comm_group F₁] [normed_space 𝕜 F₁]
{F₂ : Type*} [normed_add_comm_group F₂] [normed_space 𝕜 F₂]
{F₃ : Type*} [normed_add_comm_group F₃] [normed_space 𝕜 F₃]
{F₄ : Type*} [normed_add_comm_group F₄] [normed_space 𝕜 F₄]
-- declare functions, sets, points and smoothness indices
{e : local_homeomorph M H} {e' : local_homeomorph M' H'}
{f f₁ : M → M'} {s s₁ t : set M} {x : M} {m n : ℕ∞}
/-- Property in the model space of a model with corners of being `C^n` within at set at a point,
when read in the model vector space. This property will be lifted to manifolds to define smooth
functions between manifolds. -/
def cont_diff_within_at_prop (n : ℕ∞) (f : H → H') (s : set H) (x : H) : Prop :=
cont_diff_within_at 𝕜 n (I' ∘ f ∘ I.symm) (I.symm ⁻¹' s ∩ range I) (I x)
lemma cont_diff_within_at_prop_self_source {f : E → H'} {s : set E} {x : E} :
cont_diff_within_at_prop 𝓘(𝕜, E) I' n f s x ↔ cont_diff_within_at 𝕜 n (I' ∘ f) s x :=
begin
simp_rw [cont_diff_within_at_prop, model_with_corners_self_coe, range_id, inter_univ],
refl
end
lemma cont_diff_within_at_prop_self {f : E → E'} {s : set E} {x : E} :
cont_diff_within_at_prop 𝓘(𝕜, E) 𝓘(𝕜, E') n f s x ↔ cont_diff_within_at 𝕜 n f s x :=
cont_diff_within_at_prop_self_source 𝓘(𝕜, E')
lemma cont_diff_within_at_prop_self_target {f : H → E'} {s : set H} {x : H} :
cont_diff_within_at_prop I 𝓘(𝕜, E') n f s x ↔
cont_diff_within_at 𝕜 n (f ∘ I.symm) (I.symm ⁻¹' s ∩ range I) (I x) :=
iff.rfl
/-- Being `Cⁿ` in the model space is a local property, invariant under smooth maps. Therefore,
it will lift nicely to manifolds. -/
lemma cont_diff_within_at_local_invariant_prop (n : ℕ∞) :
(cont_diff_groupoid ∞ I).local_invariant_prop (cont_diff_groupoid ∞ I')
(cont_diff_within_at_prop I I' n) :=
{ is_local :=
begin
assume s x u f u_open xu,
have : I.symm ⁻¹' (s ∩ u) ∩ range I = (I.symm ⁻¹' s ∩ range I) ∩ I.symm ⁻¹' u,
by simp only [inter_right_comm, preimage_inter],
rw [cont_diff_within_at_prop, cont_diff_within_at_prop, this],
symmetry,
apply cont_diff_within_at_inter,
have : u ∈ 𝓝 (I.symm (I x)),
by { rw [model_with_corners.left_inv], exact is_open.mem_nhds u_open xu },
apply continuous_at.preimage_mem_nhds I.continuous_symm.continuous_at this,
end,
right_invariance' :=
begin
assume s x f e he hx h,
rw cont_diff_within_at_prop at h ⊢,
have : I x = (I ∘ e.symm ∘ I.symm) (I (e x)), by simp only [hx] with mfld_simps,
rw this at h,
have : I (e x) ∈ (I.symm) ⁻¹' e.target ∩ range I, by simp only [hx] with mfld_simps,
have := ((mem_groupoid_of_pregroupoid.2 he).2.cont_diff_within_at this).of_le le_top,
convert (h.comp' _ this).mono_of_mem _ using 1,
{ ext y, simp only with mfld_simps },
refine mem_nhds_within.mpr ⟨I.symm ⁻¹' e.target, e.open_target.preimage I.continuous_symm,
by simp_rw [mem_preimage, I.left_inv, e.maps_to hx], _⟩,
mfld_set_tac
end,
congr_of_forall :=
begin
assume s x f g h hx hf,
apply hf.congr,
{ assume y hy,
simp only with mfld_simps at hy,
simp only [h, hy] with mfld_simps },
{ simp only [hx] with mfld_simps }
end,
left_invariance' :=
begin
assume s x f e' he' hs hx h,
rw cont_diff_within_at_prop at h ⊢,
have A : (I' ∘ f ∘ I.symm) (I x) ∈ (I'.symm ⁻¹' e'.source ∩ range I'),
by simp only [hx] with mfld_simps,
have := ((mem_groupoid_of_pregroupoid.2 he').1.cont_diff_within_at A).of_le le_top,
convert this.comp _ h _,
{ ext y, simp only with mfld_simps },
{ assume y hy, simp only with mfld_simps at hy, simpa only [hy] with mfld_simps using hs hy.1 }
end }
lemma cont_diff_within_at_prop_mono_of_mem (n : ℕ∞)
⦃s x t⦄ ⦃f : H → H'⦄ (hts : s ∈ 𝓝[t] x) (h : cont_diff_within_at_prop I I' n f s x) :
cont_diff_within_at_prop I I' n f t x :=
begin
refine h.mono_of_mem _,
refine inter_mem _ (mem_of_superset self_mem_nhds_within $ inter_subset_right _ _),
rwa [← filter.mem_map, ← I.image_eq, I.symm_map_nhds_within_image]
end
lemma cont_diff_within_at_prop_id (x : H) :
cont_diff_within_at_prop I I n id univ x :=
begin
simp [cont_diff_within_at_prop],
have : cont_diff_within_at 𝕜 n id (range I) (I x) :=
cont_diff_id.cont_diff_at.cont_diff_within_at,
apply this.congr (λ y hy, _),
{ simp only with mfld_simps },
{ simp only [model_with_corners.right_inv I hy] with mfld_simps }
end
/-- A function is `n` times continuously differentiable within a set at a point in a manifold if
it is continuous and it is `n` times continuously differentiable in this set around this point, when
read in the preferred chart at this point. -/
def cont_mdiff_within_at (n : ℕ∞) (f : M → M') (s : set M) (x : M) :=
lift_prop_within_at (cont_diff_within_at_prop I I' n) f s x
/-- Abbreviation for `cont_mdiff_within_at I I' ⊤ f s x`. See also documentation for `smooth`.
-/
@[reducible] def smooth_within_at (f : M → M') (s : set M) (x : M) :=
cont_mdiff_within_at I I' ⊤ f s x
/-- A function is `n` times continuously differentiable at a point in a manifold if
it is continuous and it is `n` times continuously differentiable around this point, when
read in the preferred chart at this point. -/
def cont_mdiff_at (n : ℕ∞) (f : M → M') (x : M) :=
cont_mdiff_within_at I I' n f univ x
lemma cont_mdiff_at_iff {n : ℕ∞} {f : M → M'} {x : M} :
cont_mdiff_at I I' n f x ↔ continuous_at f x ∧ cont_diff_within_at 𝕜 n
(ext_chart_at I' (f x) ∘ f ∘ (ext_chart_at I x).symm) (range I) (ext_chart_at I x x) :=
lift_prop_at_iff.trans $ by { rw [cont_diff_within_at_prop, preimage_univ, univ_inter], refl }
/-- Abbreviation for `cont_mdiff_at I I' ⊤ f x`. See also documentation for `smooth`. -/
@[reducible] def smooth_at (f : M → M') (x : M) := cont_mdiff_at I I' ⊤ f x
/-- A function is `n` times continuously differentiable in a set of a manifold if it is continuous
and, for any pair of points, it is `n` times continuously differentiable on this set in the charts
around these points. -/
def cont_mdiff_on (n : ℕ∞) (f : M → M') (s : set M) :=
∀ x ∈ s, cont_mdiff_within_at I I' n f s x
/-- Abbreviation for `cont_mdiff_on I I' ⊤ f s`. See also documentation for `smooth`. -/
@[reducible] def smooth_on (f : M → M') (s : set M) := cont_mdiff_on I I' ⊤ f s
/-- A function is `n` times continuously differentiable in a manifold if it is continuous
and, for any pair of points, it is `n` times continuously differentiable in the charts
around these points. -/
def cont_mdiff (n : ℕ∞) (f : M → M') :=
∀ x, cont_mdiff_at I I' n f x
/-- Abbreviation for `cont_mdiff I I' ⊤ f`.
Short note to work with these abbreviations: a lemma of the form `cont_mdiff_foo.bar` will
apply fine to an assumption `smooth_foo` using dot notation or normal notation.
If the consequence `bar` of the lemma involves `cont_diff`, it is still better to restate
the lemma replacing `cont_diff` with `smooth` both in the assumption and in the conclusion,
to make it possible to use `smooth` consistently.
This also applies to `smooth_at`, `smooth_on` and `smooth_within_at`.-/
@[reducible] def smooth (f : M → M') := cont_mdiff I I' ⊤ f
/-! ### Basic properties of smooth functions between manifolds -/
variables {I I'}
lemma cont_mdiff.smooth (h : cont_mdiff I I' ⊤ f) : smooth I I' f := h
lemma smooth.cont_mdiff (h : smooth I I' f) : cont_mdiff I I' ⊤ f := h
lemma cont_mdiff_on.smooth_on (h : cont_mdiff_on I I' ⊤ f s) : smooth_on I I' f s := h
lemma smooth_on.cont_mdiff_on (h : smooth_on I I' f s) : cont_mdiff_on I I' ⊤ f s := h
lemma cont_mdiff_at.smooth_at (h : cont_mdiff_at I I' ⊤ f x) : smooth_at I I' f x := h
lemma smooth_at.cont_mdiff_at (h : smooth_at I I' f x) : cont_mdiff_at I I' ⊤ f x := h
lemma cont_mdiff_within_at.smooth_within_at (h : cont_mdiff_within_at I I' ⊤ f s x) :
smooth_within_at I I' f s x := h
lemma smooth_within_at.cont_mdiff_within_at (h : smooth_within_at I I' f s x) :
cont_mdiff_within_at I I' ⊤ f s x := h
lemma cont_mdiff.cont_mdiff_at (h : cont_mdiff I I' n f) :
cont_mdiff_at I I' n f x :=
h x
lemma smooth.smooth_at (h : smooth I I' f) :
smooth_at I I' f x := cont_mdiff.cont_mdiff_at h
lemma cont_mdiff_within_at_univ :
cont_mdiff_within_at I I' n f univ x ↔ cont_mdiff_at I I' n f x :=
iff.rfl
lemma smooth_within_at_univ :
smooth_within_at I I' f univ x ↔ smooth_at I I' f x := cont_mdiff_within_at_univ
lemma cont_mdiff_on_univ :
cont_mdiff_on I I' n f univ ↔ cont_mdiff I I' n f :=
by simp only [cont_mdiff_on, cont_mdiff, cont_mdiff_within_at_univ,
forall_prop_of_true, mem_univ]
lemma smooth_on_univ : smooth_on I I' f univ ↔ smooth I I' f := cont_mdiff_on_univ
/-- One can reformulate smoothness within a set at a point as continuity within this set at this
point, and smoothness in the corresponding extended chart. -/
lemma cont_mdiff_within_at_iff :
cont_mdiff_within_at I I' n f s x ↔ continuous_within_at f s x ∧
cont_diff_within_at 𝕜 n ((ext_chart_at I' (f x)) ∘ f ∘ (ext_chart_at I x).symm)
((ext_chart_at I x).symm ⁻¹' s ∩ range I)
(ext_chart_at I x x) :=
iff.rfl
/-- One can reformulate smoothness within a set at a point as continuity within this set at this
point, and smoothness in the corresponding extended chart. This form states smoothness of `f`
written in such a way that the set is restricted to lie within the domain/codomain of the
corresponding charts.
Even though this expression is more complicated than the one in `cont_mdiff_within_at_iff`, it is
a smaller set, but their germs at `ext_chart_at I x x` are equal. It is sometimes useful to rewrite
using this in the goal.
-/
lemma cont_mdiff_within_at_iff' :
cont_mdiff_within_at I I' n f s x ↔ continuous_within_at f s x ∧
cont_diff_within_at 𝕜 n ((ext_chart_at I' (f x)) ∘ f ∘ (ext_chart_at I x).symm)
((ext_chart_at I x).target ∩
(ext_chart_at I x).symm ⁻¹' (s ∩ f ⁻¹' (ext_chart_at I' (f x)).source))
(ext_chart_at I x x) :=
begin
rw [cont_mdiff_within_at_iff, and.congr_right_iff],
set e := ext_chart_at I x, set e' := ext_chart_at I' (f x),
refine λ hc, cont_diff_within_at_congr_nhds _,
rw [← e.image_source_inter_eq', ← map_ext_chart_at_nhds_within_eq_image,
← map_ext_chart_at_nhds_within, inter_comm, nhds_within_inter_of_mem],
exact hc (ext_chart_at_source_mem_nhds _ _)
end
/-- One can reformulate smoothness within a set at a point as continuity within this set at this
point, and smoothness in the corresponding extended chart in the target. -/
lemma cont_mdiff_within_at_iff_target :
cont_mdiff_within_at I I' n f s x ↔ continuous_within_at f s x ∧
cont_mdiff_within_at I 𝓘(𝕜, E') n (ext_chart_at I' (f x) ∘ f) s x :=
begin
simp_rw [cont_mdiff_within_at, lift_prop_within_at, ← and_assoc],
have cont : (continuous_within_at f s x ∧
continuous_within_at (ext_chart_at I' (f x) ∘ f) s x) ↔
continuous_within_at f s x,
{ refine ⟨λ h, h.1, λ h, ⟨h, _⟩⟩,
have h₂ := (chart_at H' (f x)).continuous_to_fun.continuous_within_at (mem_chart_source _ _),
refine ((I'.continuous_at.comp_continuous_within_at h₂).comp' h).mono_of_mem _,
exact inter_mem self_mem_nhds_within (h.preimage_mem_nhds_within $
(chart_at _ _).open_source.mem_nhds $ mem_chart_source _ _) },
simp_rw [cont, cont_diff_within_at_prop, ext_chart_at, local_homeomorph.extend,
local_equiv.coe_trans, model_with_corners.to_local_equiv_coe, local_homeomorph.coe_coe,
model_with_corners_self_coe, chart_at_self_eq, local_homeomorph.refl_apply, comp.left_id]
end
lemma smooth_within_at_iff :
smooth_within_at I I' f s x ↔ continuous_within_at f s x ∧
cont_diff_within_at 𝕜 ∞ (ext_chart_at I' (f x) ∘ f ∘ (ext_chart_at I x).symm)
((ext_chart_at I x).symm ⁻¹' s ∩ range I)
(ext_chart_at I x x) :=
cont_mdiff_within_at_iff
lemma smooth_within_at_iff_target :
smooth_within_at I I' f s x ↔ continuous_within_at f s x ∧
smooth_within_at I 𝓘(𝕜, E') (ext_chart_at I' (f x) ∘ f) s x :=
cont_mdiff_within_at_iff_target
lemma cont_mdiff_at_iff_target {x : M} :
cont_mdiff_at I I' n f x ↔
continuous_at f x ∧ cont_mdiff_at I 𝓘(𝕜, E') n (ext_chart_at I' (f x) ∘ f) x :=
by rw [cont_mdiff_at, cont_mdiff_at, cont_mdiff_within_at_iff_target, continuous_within_at_univ]
lemma smooth_at_iff_target {x : M} :
smooth_at I I' f x ↔ continuous_at f x ∧ smooth_at I 𝓘(𝕜, E') (ext_chart_at I' (f x) ∘ f) x :=
cont_mdiff_at_iff_target
include Is I's
lemma cont_mdiff_within_at_iff_of_mem_maximal_atlas
{x : M} (he : e ∈ maximal_atlas I M) (he' : e' ∈ maximal_atlas I' M')
(hx : x ∈ e.source) (hy : f x ∈ e'.source) :
cont_mdiff_within_at I I' n f s x ↔ continuous_within_at f s x ∧
cont_diff_within_at 𝕜 n (e'.extend I' ∘ f ∘ (e.extend I).symm)
((e.extend I).symm ⁻¹' s ∩ range I)
(e.extend I x) :=
(cont_diff_within_at_local_invariant_prop I I' n).lift_prop_within_at_indep_chart he hx he' hy
/-- An alternative formulation of `cont_mdiff_within_at_iff_of_mem_maximal_atlas`
if the set if `s` lies in `e.source`. -/
lemma cont_mdiff_within_at_iff_image {x : M} (he : e ∈ maximal_atlas I M)
(he' : e' ∈ maximal_atlas I' M') (hs : s ⊆ e.source) (hx : x ∈ e.source) (hy : f x ∈ e'.source) :
cont_mdiff_within_at I I' n f s x ↔ continuous_within_at f s x ∧
cont_diff_within_at 𝕜 n (e'.extend I' ∘ f ∘ (e.extend I).symm) (e.extend I '' s) (e.extend I x) :=
begin
rw [cont_mdiff_within_at_iff_of_mem_maximal_atlas he he' hx hy, and.congr_right_iff],
refine λ hf, cont_diff_within_at_congr_nhds _,
simp_rw [nhds_within_eq_iff_eventually_eq,
e.extend_symm_preimage_inter_range_eventually_eq I hs hx]
end
/-- One can reformulate smoothness within a set at a point as continuity within this set at this
point, and smoothness in any chart containing that point. -/
lemma cont_mdiff_within_at_iff_of_mem_source
{x' : M} {y : M'} (hx : x' ∈ (chart_at H x).source)
(hy : f x' ∈ (chart_at H' y).source) :
cont_mdiff_within_at I I' n f s x' ↔ continuous_within_at f s x' ∧
cont_diff_within_at 𝕜 n (ext_chart_at I' y ∘ f ∘ (ext_chart_at I x).symm)
((ext_chart_at I x).symm ⁻¹' s ∩ range I)
(ext_chart_at I x x') :=
cont_mdiff_within_at_iff_of_mem_maximal_atlas
(chart_mem_maximal_atlas _ x) (chart_mem_maximal_atlas _ y) hx hy
lemma cont_mdiff_within_at_iff_of_mem_source' {x' : M} {y : M'} (hx : x' ∈ (chart_at H x).source)
(hy : f x' ∈ (chart_at H' y).source) :
cont_mdiff_within_at I I' n f s x' ↔ continuous_within_at f s x' ∧
cont_diff_within_at 𝕜 n ((ext_chart_at I' y) ∘ f ∘ (ext_chart_at I x).symm)
((ext_chart_at I x).target ∩ (ext_chart_at I x).symm ⁻¹' (s ∩ f ⁻¹' (ext_chart_at I' y).source))
(ext_chart_at I x x') :=
begin
refine (cont_mdiff_within_at_iff_of_mem_source hx hy).trans _,
rw [← ext_chart_at_source I] at hx,
rw [← ext_chart_at_source I'] at hy,
rw [and.congr_right_iff],
set e := ext_chart_at I x, set e' := ext_chart_at I' (f x),
refine λ hc, cont_diff_within_at_congr_nhds _,
rw [← e.image_source_inter_eq', ← map_ext_chart_at_nhds_within_eq_image' I x hx,
← map_ext_chart_at_nhds_within' I x hx, inter_comm, nhds_within_inter_of_mem],
exact hc (ext_chart_at_source_mem_nhds' _ _ hy)
end
lemma cont_mdiff_at_iff_of_mem_source {x' : M} {y : M'} (hx : x' ∈ (chart_at H x).source)
(hy : f x' ∈ (chart_at H' y).source) :
cont_mdiff_at I I' n f x' ↔ continuous_at f x' ∧
cont_diff_within_at 𝕜 n (ext_chart_at I' y ∘ f ∘ (ext_chart_at I x).symm)
(range I)
(ext_chart_at I x x') :=
(cont_mdiff_within_at_iff_of_mem_source hx hy).trans $
by rw [continuous_within_at_univ, preimage_univ, univ_inter]
omit Is
lemma cont_mdiff_within_at_iff_target_of_mem_source
{x : M} {y : M'} (hy : f x ∈ (chart_at H' y).source) :
cont_mdiff_within_at I I' n f s x ↔ continuous_within_at f s x ∧
cont_mdiff_within_at I 𝓘(𝕜, E') n (ext_chart_at I' y ∘ f) s x :=
begin
simp_rw [cont_mdiff_within_at],
rw [(cont_diff_within_at_local_invariant_prop I I' n).lift_prop_within_at_indep_chart_target
(chart_mem_maximal_atlas I' y) hy, and_congr_right],
intro hf,
simp_rw [structure_groupoid.lift_prop_within_at_self_target],
simp_rw [((chart_at H' y).continuous_at hy).comp_continuous_within_at hf],
rw [← ext_chart_at_source I'] at hy,
simp_rw [(continuous_at_ext_chart_at' I' _ hy).comp_continuous_within_at hf],
refl,
end
lemma cont_mdiff_at_iff_target_of_mem_source
{x : M} {y : M'} (hy : f x ∈ (chart_at H' y).source) :
cont_mdiff_at I I' n f x ↔ continuous_at f x ∧
cont_mdiff_at I 𝓘(𝕜, E') n (ext_chart_at I' y ∘ f) x :=
begin
rw [cont_mdiff_at, cont_mdiff_within_at_iff_target_of_mem_source hy,
continuous_within_at_univ, cont_mdiff_at],
apply_instance
end
omit I's
include Is
lemma cont_mdiff_within_at_iff_source_of_mem_maximal_atlas
(he : e ∈ maximal_atlas I M) (hx : x ∈ e.source) :
cont_mdiff_within_at I I' n f s x ↔
cont_mdiff_within_at 𝓘(𝕜, E) I' n (f ∘ (e.extend I).symm)
((e.extend I).symm ⁻¹' s ∩ range I) (e.extend I x) :=
begin
have h2x := hx, rw [← e.extend_source I] at h2x,
simp_rw [cont_mdiff_within_at,
(cont_diff_within_at_local_invariant_prop I I' n).lift_prop_within_at_indep_chart_source
he hx, structure_groupoid.lift_prop_within_at_self_source,
e.extend_symm_continuous_within_at_comp_right_iff, cont_diff_within_at_prop_self_source,
cont_diff_within_at_prop, function.comp, e.left_inv hx, (e.extend I).left_inv h2x],
refl,
end
lemma cont_mdiff_within_at_iff_source_of_mem_source
{x' : M} (hx' : x' ∈ (chart_at H x).source) :
cont_mdiff_within_at I I' n f s x' ↔
cont_mdiff_within_at 𝓘(𝕜, E) I' n (f ∘ (ext_chart_at I x).symm)
((ext_chart_at I x).symm ⁻¹' s ∩ range I) (ext_chart_at I x x') :=
cont_mdiff_within_at_iff_source_of_mem_maximal_atlas (chart_mem_maximal_atlas I x) hx'
lemma cont_mdiff_at_iff_source_of_mem_source
{x' : M} (hx' : x' ∈ (chart_at H x).source) :
cont_mdiff_at I I' n f x' ↔ cont_mdiff_within_at 𝓘(𝕜, E) I' n (f ∘ (ext_chart_at I x).symm)
(range I) (ext_chart_at I x x') :=
by simp_rw [cont_mdiff_at, cont_mdiff_within_at_iff_source_of_mem_source hx', preimage_univ,
univ_inter]
include I's
lemma cont_mdiff_on_iff_of_mem_maximal_atlas
(he : e ∈ maximal_atlas I M) (he' : e' ∈ maximal_atlas I' M')
(hs : s ⊆ e.source)
(h2s : maps_to f s e'.source) :
cont_mdiff_on I I' n f s ↔ continuous_on f s ∧
cont_diff_on 𝕜 n (e'.extend I' ∘ f ∘ (e.extend I).symm)
(e.extend I '' s) :=
begin
simp_rw [continuous_on, cont_diff_on, set.ball_image_iff, ← forall_and_distrib, cont_mdiff_on],
exact forall₂_congr (λ x hx, cont_mdiff_within_at_iff_image he he' hs (hs hx) (h2s hx))
end
/-- If the set where you want `f` to be smooth lies entirely in a single chart, and `f` maps it
into a single chart, the smoothness of `f` on that set can be expressed by purely looking in
these charts.
Note: this lemma uses `ext_chart_at I x '' s` instead of `(ext_chart_at I x).symm ⁻¹' s` to ensure
that this set lies in `(ext_chart_at I x).target`. -/
lemma cont_mdiff_on_iff_of_subset_source {x : M} {y : M'}
(hs : s ⊆ (chart_at H x).source)
(h2s : maps_to f s (chart_at H' y).source) :
cont_mdiff_on I I' n f s ↔ continuous_on f s ∧
cont_diff_on 𝕜 n (ext_chart_at I' y ∘ f ∘ (ext_chart_at I x).symm)
(ext_chart_at I x '' s) :=
cont_mdiff_on_iff_of_mem_maximal_atlas
(chart_mem_maximal_atlas I x) (chart_mem_maximal_atlas I' y) hs h2s
/-- One can reformulate smoothness on a set as continuity on this set, and smoothness in any
extended chart. -/
lemma cont_mdiff_on_iff :
cont_mdiff_on I I' n f s ↔ continuous_on f s ∧
∀ (x : M) (y : M'), cont_diff_on 𝕜 n (ext_chart_at I' y ∘ f ∘ (ext_chart_at I x).symm)
((ext_chart_at I x).target ∩
(ext_chart_at I x).symm ⁻¹' (s ∩ f ⁻¹' (ext_chart_at I' y).source)) :=
begin
split,
{ assume h,
refine ⟨λ x hx, (h x hx).1, λ x y z hz, _⟩,
simp only with mfld_simps at hz,
let w := (ext_chart_at I x).symm z,
have : w ∈ s, by simp only [w, hz] with mfld_simps,
specialize h w this,
have w1 : w ∈ (chart_at H x).source, by simp only [w, hz] with mfld_simps,
have w2 : f w ∈ (chart_at H' y).source, by simp only [w, hz] with mfld_simps,
convert ((cont_mdiff_within_at_iff_of_mem_source w1 w2).mp h).2.mono _,
{ simp only [w, hz] with mfld_simps },
{ mfld_set_tac } },
{ rintros ⟨hcont, hdiff⟩ x hx,
refine (cont_diff_within_at_local_invariant_prop I I' n).lift_prop_within_at_iff.mpr _,
refine ⟨hcont x hx, _⟩,
dsimp [cont_diff_within_at_prop],
convert hdiff x (f x) (ext_chart_at I x x) (by simp only [hx] with mfld_simps) using 1,
mfld_set_tac }
end
/-- One can reformulate smoothness on a set as continuity on this set, and smoothness in any
extended chart in the target. -/
lemma cont_mdiff_on_iff_target :
cont_mdiff_on I I' n f s ↔ continuous_on f s ∧ ∀ (y : M'),
cont_mdiff_on I 𝓘(𝕜, E') n (ext_chart_at I' y ∘ f)
(s ∩ f ⁻¹' (ext_chart_at I' y).source) :=
begin
inhabit E',
simp only [cont_mdiff_on_iff, model_with_corners.source_eq, chart_at_self_eq,
local_homeomorph.refl_local_equiv, local_equiv.refl_trans, ext_chart_at,
local_homeomorph.extend, set.preimage_univ, set.inter_univ, and.congr_right_iff],
intros h,
split,
{ refine λ h' y, ⟨_, λ x _, h' x y⟩,
have h'' : continuous_on _ univ := (model_with_corners.continuous I').continuous_on,
convert (h''.comp' (chart_at H' y).continuous_to_fun).comp' h,
simp },
{ exact λ h' x y, (h' y).2 x default }
end
lemma smooth_on_iff :
smooth_on I I' f s ↔ continuous_on f s ∧
∀ (x : M) (y : M'), cont_diff_on 𝕜 ⊤ (ext_chart_at I' y ∘ f ∘ (ext_chart_at I x).symm)
((ext_chart_at I x).target ∩
(ext_chart_at I x).symm ⁻¹' (s ∩ f ⁻¹' (ext_chart_at I' y).source)) :=
cont_mdiff_on_iff
lemma smooth_on_iff_target :
smooth_on I I' f s ↔ continuous_on f s ∧ ∀ (y : M'),
smooth_on I 𝓘(𝕜, E') (ext_chart_at I' y ∘ f)
(s ∩ f ⁻¹' (ext_chart_at I' y).source) :=
cont_mdiff_on_iff_target
/-- One can reformulate smoothness as continuity and smoothness in any extended chart. -/
lemma cont_mdiff_iff :
cont_mdiff I I' n f ↔ continuous f ∧
∀ (x : M) (y : M'), cont_diff_on 𝕜 n (ext_chart_at I' y ∘ f ∘ (ext_chart_at I x).symm)
((ext_chart_at I x).target ∩ (ext_chart_at I x).symm ⁻¹' (f ⁻¹' (ext_chart_at I' y).source)) :=
by simp [← cont_mdiff_on_univ, cont_mdiff_on_iff, continuous_iff_continuous_on_univ]
/-- One can reformulate smoothness as continuity and smoothness in any extended chart in the
target. -/
lemma cont_mdiff_iff_target :
cont_mdiff I I' n f ↔ continuous f ∧
∀ (y : M'), cont_mdiff_on I 𝓘(𝕜, E') n (ext_chart_at I' y ∘ f)
(f ⁻¹' (ext_chart_at I' y).source) :=
begin
rw [← cont_mdiff_on_univ, cont_mdiff_on_iff_target],
simp [continuous_iff_continuous_on_univ]
end
lemma smooth_iff :
smooth I I' f ↔ continuous f ∧
∀ (x : M) (y : M'), cont_diff_on 𝕜 ⊤ (ext_chart_at I' y ∘ f ∘ (ext_chart_at I x).symm)
((ext_chart_at I x).target ∩ (ext_chart_at I x).symm ⁻¹' (f ⁻¹' (ext_chart_at I' y).source)) :=
cont_mdiff_iff
lemma smooth_iff_target :
smooth I I' f ↔ continuous f ∧ ∀ (y : M'), smooth_on I 𝓘(𝕜, E') (ext_chart_at I' y ∘ f)
(f ⁻¹' (ext_chart_at I' y).source) :=
cont_mdiff_iff_target
omit Is I's
/-! ### Deducing smoothness from higher smoothness -/
lemma cont_mdiff_within_at.of_le (hf : cont_mdiff_within_at I I' n f s x) (le : m ≤ n) :
cont_mdiff_within_at I I' m f s x :=
⟨hf.1, hf.2.of_le le⟩
lemma cont_mdiff_at.of_le (hf : cont_mdiff_at I I' n f x) (le : m ≤ n) :
cont_mdiff_at I I' m f x :=
cont_mdiff_within_at.of_le hf le
lemma cont_mdiff_on.of_le (hf : cont_mdiff_on I I' n f s) (le : m ≤ n) :
cont_mdiff_on I I' m f s :=
λ x hx, (hf x hx).of_le le
lemma cont_mdiff.of_le (hf : cont_mdiff I I' n f) (le : m ≤ n) :
cont_mdiff I I' m f :=
λ x, (hf x).of_le le
/-! ### Deducing smoothness from smoothness one step beyond -/
lemma cont_mdiff_within_at.of_succ {n : ℕ}
(h : cont_mdiff_within_at I I' n.succ f s x) :
cont_mdiff_within_at I I' n f s x :=
h.of_le (with_top.coe_le_coe.2 (nat.le_succ n))
lemma cont_mdiff_at.of_succ {n : ℕ} (h : cont_mdiff_at I I' n.succ f x) :
cont_mdiff_at I I' n f x :=
cont_mdiff_within_at.of_succ h
lemma cont_mdiff_on.of_succ {n : ℕ} (h : cont_mdiff_on I I' n.succ f s) :
cont_mdiff_on I I' n f s :=
λ x hx, (h x hx).of_succ
lemma cont_mdiff.of_succ {n : ℕ} (h : cont_mdiff I I' n.succ f) :
cont_mdiff I I' n f :=
λ x, (h x).of_succ
/-! ### Deducing continuity from smoothness -/
lemma cont_mdiff_within_at.continuous_within_at
(hf : cont_mdiff_within_at I I' n f s x) : continuous_within_at f s x :=
hf.1
lemma cont_mdiff_at.continuous_at
(hf : cont_mdiff_at I I' n f x) : continuous_at f x :=
(continuous_within_at_univ _ _ ).1 $ cont_mdiff_within_at.continuous_within_at hf
lemma cont_mdiff_on.continuous_on
(hf : cont_mdiff_on I I' n f s) : continuous_on f s :=
λ x hx, (hf x hx).continuous_within_at
lemma cont_mdiff.continuous (hf : cont_mdiff I I' n f) :
continuous f :=
continuous_iff_continuous_at.2 $ λ x, (hf x).continuous_at
/-! ### `C^∞` smoothness -/
lemma cont_mdiff_within_at_top :
smooth_within_at I I' f s x ↔ (∀n:ℕ, cont_mdiff_within_at I I' n f s x) :=
⟨λ h n, ⟨h.1, cont_diff_within_at_top.1 h.2 n⟩,
λ H, ⟨(H 0).1, cont_diff_within_at_top.2 (λ n, (H n).2)⟩⟩
lemma cont_mdiff_at_top :
smooth_at I I' f x ↔ (∀n:ℕ, cont_mdiff_at I I' n f x) :=
cont_mdiff_within_at_top
lemma cont_mdiff_on_top :
smooth_on I I' f s ↔ (∀n:ℕ, cont_mdiff_on I I' n f s) :=
⟨λ h n, h.of_le le_top, λ h x hx, cont_mdiff_within_at_top.2 (λ n, h n x hx)⟩
lemma cont_mdiff_top :
smooth I I' f ↔ (∀n:ℕ, cont_mdiff I I' n f) :=
⟨λ h n, h.of_le le_top, λ h x, cont_mdiff_within_at_top.2 (λ n, h n x)⟩
lemma cont_mdiff_within_at_iff_nat :
cont_mdiff_within_at I I' n f s x ↔
(∀m:ℕ, (m : ℕ∞) ≤ n → cont_mdiff_within_at I I' m f s x) :=
begin
refine ⟨λ h m hm, h.of_le hm, λ h, _⟩,
cases n,
{ exact cont_mdiff_within_at_top.2 (λ n, h n le_top) },
{ exact h n le_rfl }
end
/-! ### Restriction to a smaller set -/
lemma cont_mdiff_within_at.mono_of_mem (hf : cont_mdiff_within_at I I' n f s x)
(hts : s ∈ 𝓝[t] x) : cont_mdiff_within_at I I' n f t x :=
structure_groupoid.local_invariant_prop.lift_prop_within_at_mono_of_mem
(cont_diff_within_at_prop_mono_of_mem I I' n) hf hts
lemma cont_mdiff_within_at.mono (hf : cont_mdiff_within_at I I' n f s x) (hts : t ⊆ s) :
cont_mdiff_within_at I I' n f t x :=
hf.mono_of_mem $ mem_of_superset self_mem_nhds_within hts
lemma cont_mdiff_within_at_congr_nhds (hst : 𝓝[s] x = 𝓝[t] x) :
cont_mdiff_within_at I I' n f s x ↔ cont_mdiff_within_at I I' n f t x :=
⟨λ h, h.mono_of_mem $ hst ▸ self_mem_nhds_within,
λ h, h.mono_of_mem $ hst.symm ▸ self_mem_nhds_within⟩
lemma cont_mdiff_at.cont_mdiff_within_at (hf : cont_mdiff_at I I' n f x) :
cont_mdiff_within_at I I' n f s x :=
cont_mdiff_within_at.mono hf (subset_univ _)
lemma smooth_at.smooth_within_at (hf : smooth_at I I' f x) :
smooth_within_at I I' f s x :=
cont_mdiff_at.cont_mdiff_within_at hf
lemma cont_mdiff_on.mono (hf : cont_mdiff_on I I' n f s) (hts : t ⊆ s) :
cont_mdiff_on I I' n f t :=
λ x hx, (hf x (hts hx)).mono hts
lemma cont_mdiff.cont_mdiff_on (hf : cont_mdiff I I' n f) :
cont_mdiff_on I I' n f s :=
λ x hx, (hf x).cont_mdiff_within_at
lemma smooth.smooth_on (hf : smooth I I' f) :
smooth_on I I' f s :=
cont_mdiff.cont_mdiff_on hf
lemma cont_mdiff_within_at_inter' (ht : t ∈ 𝓝[s] x) :
cont_mdiff_within_at I I' n f (s ∩ t) x ↔ cont_mdiff_within_at I I' n f s x :=
(cont_diff_within_at_local_invariant_prop I I' n).lift_prop_within_at_inter' ht
lemma cont_mdiff_within_at_inter (ht : t ∈ 𝓝 x) :
cont_mdiff_within_at I I' n f (s ∩ t) x ↔ cont_mdiff_within_at I I' n f s x :=
(cont_diff_within_at_local_invariant_prop I I' n).lift_prop_within_at_inter ht
lemma cont_mdiff_within_at.cont_mdiff_at
(h : cont_mdiff_within_at I I' n f s x) (ht : s ∈ 𝓝 x) :
cont_mdiff_at I I' n f x :=
(cont_diff_within_at_local_invariant_prop I I' n).lift_prop_at_of_lift_prop_within_at h ht
lemma smooth_within_at.smooth_at
(h : smooth_within_at I I' f s x) (ht : s ∈ 𝓝 x) :
smooth_at I I' f x :=
cont_mdiff_within_at.cont_mdiff_at h ht
lemma cont_mdiff_on.cont_mdiff_at (h : cont_mdiff_on I I' n f s) (hx : s ∈ 𝓝 x) :
cont_mdiff_at I I' n f x :=
(h x (mem_of_mem_nhds hx)).cont_mdiff_at hx
lemma smooth_on.smooth_at (h : smooth_on I I' f s) (hx : s ∈ 𝓝 x) : smooth_at I I' f x :=
h.cont_mdiff_at hx
include Is
lemma cont_mdiff_on_iff_source_of_mem_maximal_atlas
(he : e ∈ maximal_atlas I M) (hs : s ⊆ e.source) :
cont_mdiff_on I I' n f s ↔ cont_mdiff_on 𝓘(𝕜, E) I' n (f ∘ (e.extend I).symm) (e.extend I '' s) :=
begin
simp_rw [cont_mdiff_on, set.ball_image_iff],
refine forall₂_congr (λ x hx, _),
rw [cont_mdiff_within_at_iff_source_of_mem_maximal_atlas he (hs hx)],
apply cont_mdiff_within_at_congr_nhds,
simp_rw [nhds_within_eq_iff_eventually_eq,
e.extend_symm_preimage_inter_range_eventually_eq I hs (hs hx)]
end
include I's
/-- A function is `C^n` within a set at a point, for `n : ℕ`, if and only if it is `C^n` on
a neighborhood of this point. -/
lemma cont_mdiff_within_at_iff_cont_mdiff_on_nhds {n : ℕ} :
cont_mdiff_within_at I I' n f s x ↔
∃ u ∈ 𝓝[insert x s] x, cont_mdiff_on I I' n f u :=
begin
split,
{ assume h,
-- the property is true in charts. We will pull such a good neighborhood in the chart to the
-- manifold. For this, we need to restrict to a small enough set where everything makes sense
obtain ⟨o, o_open, xo, ho, h'o⟩ : ∃ (o : set M),
is_open o ∧ x ∈ o ∧ o ⊆ (chart_at H x).source ∧ o ∩ s ⊆ f ⁻¹' (chart_at H' (f x)).source,
{ have : (chart_at H' (f x)).source ∈ 𝓝 (f x) :=
is_open.mem_nhds (local_homeomorph.open_source _) (mem_chart_source H' (f x)),
rcases mem_nhds_within.1 (h.1.preimage_mem_nhds_within this) with ⟨u, u_open, xu, hu⟩,
refine ⟨u ∩ (chart_at H x).source, _, ⟨xu, mem_chart_source _ _⟩, _, _⟩,
{ exact is_open.inter u_open (local_homeomorph.open_source _) },
{ assume y hy, exact hy.2 },
{ assume y hy, exact hu ⟨hy.1.1, hy.2⟩ } },
have h' : cont_mdiff_within_at I I' n f (s ∩ o) x := h.mono (inter_subset_left _ _),
simp only [cont_mdiff_within_at, lift_prop_within_at, cont_diff_within_at_prop] at h',
-- let `u` be a good neighborhood in the chart where the function is smooth
rcases h.2.cont_diff_on le_rfl with ⟨u, u_nhds, u_subset, hu⟩,
-- pull it back to the manifold, and intersect with a suitable neighborhood of `x`, to get the
-- desired good neighborhood `v`.
let v := ((insert x s) ∩ o) ∩ (ext_chart_at I x) ⁻¹' u,
have v_incl : v ⊆ (chart_at H x).source := λ y hy, ho hy.1.2,
have v_incl' : ∀ y ∈ v, f y ∈ (chart_at H' (f x)).source,
{ assume y hy,
rcases hy.1.1 with rfl|h',
{ simp only with mfld_simps },
{ apply h'o ⟨hy.1.2, h'⟩ } },
refine ⟨v, _, _⟩,
show v ∈ 𝓝[insert x s] x,
{ rw nhds_within_restrict _ xo o_open,
refine filter.inter_mem self_mem_nhds_within _,
suffices : u ∈ 𝓝[(ext_chart_at I x) '' (insert x s ∩ o)] (ext_chart_at I x x),
from (continuous_at_ext_chart_at I x).continuous_within_at.preimage_mem_nhds_within' this,
apply nhds_within_mono _ _ u_nhds,
rw image_subset_iff,
assume y hy,
rcases hy.1 with rfl|h',
{ simp only [mem_insert_iff] with mfld_simps },
{ simp only [mem_insert_iff, ho hy.2, h', h'o ⟨hy.2, h'⟩] with mfld_simps } },
show cont_mdiff_on I I' n f v,
{ assume y hy,
have : continuous_within_at f v y,
{ apply (((continuous_on_ext_chart_at_symm I' (f x) _ _).comp'
(hu _ hy.2).continuous_within_at).comp' (continuous_on_ext_chart_at I x _ _)).congr_mono,
{ assume z hz,
simp only [v_incl hz, v_incl' z hz] with mfld_simps },
{ assume z hz,
simp only [v_incl hz, v_incl' z hz] with mfld_simps,
exact hz.2 },
{ simp only [v_incl hy, v_incl' y hy] with mfld_simps },
{ simp only [v_incl hy, v_incl' y hy] with mfld_simps },
{ simp only [v_incl hy] with mfld_simps } },
refine (cont_mdiff_within_at_iff_of_mem_source' (v_incl hy) (v_incl' y hy)).mpr ⟨this, _⟩,
{ apply hu.mono,
{ assume z hz,
simp only [v] with mfld_simps at hz,
have : I ((chart_at H x) (((chart_at H x).symm) (I.symm z))) ∈ u, by simp only [hz],
simpa only [hz] with mfld_simps using this },
{ have exty : I (chart_at H x y) ∈ u := hy.2,
simp only [v_incl hy, v_incl' y hy, exty, hy.1.1, hy.1.2] with mfld_simps } } } },
{ rintros ⟨u, u_nhds, hu⟩,
have : cont_mdiff_within_at I I' ↑n f (insert x s ∩ u) x,
{ have : x ∈ insert x s := mem_insert x s,
exact hu.mono (inter_subset_right _ _) _ ⟨this, mem_of_mem_nhds_within this u_nhds⟩ },
rw cont_mdiff_within_at_inter' u_nhds at this,
exact this.mono (subset_insert x s) }
end
/-- A function is `C^n` at a point, for `n : ℕ`, if and only if it is `C^n` on
a neighborhood of this point. -/
lemma cont_mdiff_at_iff_cont_mdiff_on_nhds {n : ℕ} :
cont_mdiff_at I I' n f x ↔ ∃ u ∈ 𝓝 x, cont_mdiff_on I I' n f u :=
by simp [← cont_mdiff_within_at_univ, cont_mdiff_within_at_iff_cont_mdiff_on_nhds,
nhds_within_univ]
/-- Note: This does not hold for `n = ∞`. `f` being `C^∞` at `x` means that for every `n`, `f` is
`C^n` on some neighborhood of `x`, but this neighborhood can depend on `n`. -/
lemma cont_mdiff_at_iff_cont_mdiff_at_nhds {n : ℕ} :
cont_mdiff_at I I' n f x ↔ ∀ᶠ x' in 𝓝 x, cont_mdiff_at I I' n f x' :=
begin
refine ⟨_, λ h, h.self_of_nhds⟩,
rw [cont_mdiff_at_iff_cont_mdiff_on_nhds],
rintro ⟨u, hu, h⟩,
refine (eventually_mem_nhds.mpr hu).mono (λ x' hx', _),
exact (h x' $ mem_of_mem_nhds hx').cont_mdiff_at hx'
end
omit Is I's
/-! ### Congruence lemmas -/
lemma cont_mdiff_within_at.congr
(h : cont_mdiff_within_at I I' n f s x) (h₁ : ∀ y ∈ s, f₁ y = f y)
(hx : f₁ x = f x) : cont_mdiff_within_at I I' n f₁ s x :=
(cont_diff_within_at_local_invariant_prop I I' n).lift_prop_within_at_congr h h₁ hx
lemma cont_mdiff_within_at_congr (h₁ : ∀ y ∈ s, f₁ y = f y) (hx : f₁ x = f x) :
cont_mdiff_within_at I I' n f₁ s x ↔ cont_mdiff_within_at I I' n f s x :=
(cont_diff_within_at_local_invariant_prop I I' n).lift_prop_within_at_congr_iff h₁ hx
lemma cont_mdiff_within_at.congr_of_eventually_eq
(h : cont_mdiff_within_at I I' n f s x) (h₁ : f₁ =ᶠ[𝓝[s] x] f)
(hx : f₁ x = f x) : cont_mdiff_within_at I I' n f₁ s x :=
(cont_diff_within_at_local_invariant_prop I I' n).lift_prop_within_at_congr_of_eventually_eq
h h₁ hx
lemma filter.eventually_eq.cont_mdiff_within_at_iff
(h₁ : f₁ =ᶠ[𝓝[s] x] f) (hx : f₁ x = f x) :
cont_mdiff_within_at I I' n f₁ s x ↔ cont_mdiff_within_at I I' n f s x :=
(cont_diff_within_at_local_invariant_prop I I' n)
.lift_prop_within_at_congr_iff_of_eventually_eq h₁ hx
lemma cont_mdiff_at.congr_of_eventually_eq
(h : cont_mdiff_at I I' n f x) (h₁ : f₁ =ᶠ[𝓝 x] f) :
cont_mdiff_at I I' n f₁ x :=
(cont_diff_within_at_local_invariant_prop I I' n).lift_prop_at_congr_of_eventually_eq h h₁
lemma filter.eventually_eq.cont_mdiff_at_iff (h₁ : f₁ =ᶠ[𝓝 x] f) :
cont_mdiff_at I I' n f₁ x ↔ cont_mdiff_at I I' n f x :=
(cont_diff_within_at_local_invariant_prop I I' n).lift_prop_at_congr_iff_of_eventually_eq h₁
lemma cont_mdiff_on.congr (h : cont_mdiff_on I I' n f s) (h₁ : ∀ y ∈ s, f₁ y = f y) :
cont_mdiff_on I I' n f₁ s :=
(cont_diff_within_at_local_invariant_prop I I' n).lift_prop_on_congr h h₁
lemma cont_mdiff_on_congr (h₁ : ∀ y ∈ s, f₁ y = f y) :
cont_mdiff_on I I' n f₁ s ↔ cont_mdiff_on I I' n f s :=
(cont_diff_within_at_local_invariant_prop I I' n).lift_prop_on_congr_iff h₁
/-! ### Locality -/
/-- Being `C^n` is a local property. -/
lemma cont_mdiff_on_of_locally_cont_mdiff_on
(h : ∀x∈s, ∃u, is_open u ∧ x ∈ u ∧ cont_mdiff_on I I' n f (s ∩ u)) :
cont_mdiff_on I I' n f s :=
(cont_diff_within_at_local_invariant_prop I I' n).lift_prop_on_of_locally_lift_prop_on h
lemma cont_mdiff_of_locally_cont_mdiff_on
(h : ∀x, ∃u, is_open u ∧ x ∈ u ∧ cont_mdiff_on I I' n f u) :
cont_mdiff I I' n f :=
(cont_diff_within_at_local_invariant_prop I I' n).lift_prop_of_locally_lift_prop_on h
/-! ### Smoothness of the composition of smooth functions between manifolds -/
section composition
/-- The composition of `C^n` functions within domains at points is `C^n`. -/
lemma cont_mdiff_within_at.comp {t : set M'} {g : M' → M''} (x : M)
(hg : cont_mdiff_within_at I' I'' n g t (f x))
(hf : cont_mdiff_within_at I I' n f s x)
(st : maps_to f s t) : cont_mdiff_within_at I I'' n (g ∘ f) s x :=
begin
rw cont_mdiff_within_at_iff at hg hf ⊢,
refine ⟨hg.1.comp hf.1 st, _⟩,
set e := ext_chart_at I x,
set e' := ext_chart_at I' (f x),
set e'' := ext_chart_at I'' (g (f x)),
have : e' (f x) = (written_in_ext_chart_at I I' x f) (e x),
by simp only [e, e'] with mfld_simps,
rw this at hg,
have A : ∀ᶠ y in 𝓝[e.symm ⁻¹' s ∩ range I] e x,
y ∈ e.target ∧ f (e.symm y) ∈ t ∧ f (e.symm y) ∈ e'.source ∧ g (f (e.symm y)) ∈ e''.source,
{ simp only [← map_ext_chart_at_nhds_within, eventually_map],
filter_upwards [hf.1.tendsto (ext_chart_at_source_mem_nhds I' (f x)),
(hg.1.comp hf.1 st).tendsto (ext_chart_at_source_mem_nhds I'' (g (f x))),
(inter_mem_nhds_within s (ext_chart_at_source_mem_nhds I x))],
rintros x' (hfx' : f x' ∈ _) (hgfx' : g (f x') ∈ _) ⟨hx's, hx'⟩,
simp only [e.map_source hx', true_and, e.left_inv hx', st hx's, *] },
refine ((hg.2.comp _ (hf.2.mono (inter_subset_right _ _)) (inter_subset_left _ _)).mono_of_mem
(inter_mem _ self_mem_nhds_within)).congr_of_eventually_eq _ _,
{ filter_upwards [A],
rintro x' ⟨hx', ht, hfx', hgfx'⟩,
simp only [*, mem_preimage, written_in_ext_chart_at, (∘), mem_inter_iff, e'.left_inv, true_and],
exact mem_range_self _ },
{ filter_upwards [A],
rintro x' ⟨hx', ht, hfx', hgfx'⟩,
simp only [*, (∘), written_in_ext_chart_at, e'.left_inv] },
{ simp only [written_in_ext_chart_at, (∘), mem_ext_chart_source, e.left_inv, e'.left_inv] }
end
/-- See note [comp_of_eq lemmas] -/
lemma cont_mdiff_within_at.comp_of_eq {t : set M'} {g : M' → M''} {x : M} {y : M'}
(hg : cont_mdiff_within_at I' I'' n g t y) (hf : cont_mdiff_within_at I I' n f s x)
(st : maps_to f s t) (hx : f x = y) :
cont_mdiff_within_at I I'' n (g ∘ f) s x :=
by { subst hx, exact hg.comp x hf st }
/-- The composition of `C^∞` functions within domains at points is `C^∞`. -/
lemma smooth_within_at.comp {t : set M'} {g : M' → M''} (x : M)
(hg : smooth_within_at I' I'' g t (f x))
(hf : smooth_within_at I I' f s x)
(st : maps_to f s t) : smooth_within_at I I'' (g ∘ f) s x :=
hg.comp x hf st
/-- The composition of `C^n` functions on domains is `C^n`. -/
lemma cont_mdiff_on.comp {t : set M'} {g : M' → M''}
(hg : cont_mdiff_on I' I'' n g t) (hf : cont_mdiff_on I I' n f s)
(st : s ⊆ f ⁻¹' t) : cont_mdiff_on I I'' n (g ∘ f) s :=
λ x hx, (hg _ (st hx)).comp x (hf x hx) st
/-- The composition of `C^∞` functions on domains is `C^∞`. -/
lemma smooth_on.comp {t : set M'} {g : M' → M''}
(hg : smooth_on I' I'' g t) (hf : smooth_on I I' f s)
(st : s ⊆ f ⁻¹' t) : smooth_on I I'' (g ∘ f) s :=
hg.comp hf st
/-- The composition of `C^n` functions on domains is `C^n`. -/
lemma cont_mdiff_on.comp' {t : set M'} {g : M' → M''}
(hg : cont_mdiff_on I' I'' n g t) (hf : cont_mdiff_on I I' n f s) :
cont_mdiff_on I I'' n (g ∘ f) (s ∩ f ⁻¹' t) :=
hg.comp (hf.mono (inter_subset_left _ _)) (inter_subset_right _ _)
/-- The composition of `C^∞` functions is `C^∞`. -/
lemma smooth_on.comp' {t : set M'} {g : M' → M''}
(hg : smooth_on I' I'' g t) (hf : smooth_on I I' f s) :
smooth_on I I'' (g ∘ f) (s ∩ f ⁻¹' t) :=
hg.comp' hf
/-- The composition of `C^n` functions is `C^n`. -/
lemma cont_mdiff.comp {g : M' → M''}
(hg : cont_mdiff I' I'' n g) (hf : cont_mdiff I I' n f) :
cont_mdiff I I'' n (g ∘ f) :=
begin
rw ← cont_mdiff_on_univ at hf hg ⊢,
exact hg.comp hf subset_preimage_univ,
end
/-- The composition of `C^∞` functions is `C^∞`. -/
lemma smooth.comp {g : M' → M''} (hg : smooth I' I'' g) (hf : smooth I I' f) :
smooth I I'' (g ∘ f) :=
hg.comp hf
/-- The composition of `C^n` functions within domains at points is `C^n`. -/
lemma cont_mdiff_within_at.comp' {t : set M'} {g : M' → M''} (x : M)
(hg : cont_mdiff_within_at I' I'' n g t (f x))
(hf : cont_mdiff_within_at I I' n f s x) :
cont_mdiff_within_at I I'' n (g ∘ f) (s ∩ f⁻¹' t) x :=
hg.comp x (hf.mono (inter_subset_left _ _)) (inter_subset_right _ _)
/-- The composition of `C^∞` functions within domains at points is `C^∞`. -/
lemma smooth_within_at.comp' {t : set M'} {g : M' → M''} (x : M)
(hg : smooth_within_at I' I'' g t (f x))
(hf : smooth_within_at I I' f s x) :
smooth_within_at I I'' (g ∘ f) (s ∩ f⁻¹' t) x :=
hg.comp' x hf
/-- `g ∘ f` is `C^n` within `s` at `x` if `g` is `C^n` at `f x` and
`f` is `C^n` within `s` at `x`. -/
lemma cont_mdiff_at.comp_cont_mdiff_within_at {g : M' → M''} (x : M)
(hg : cont_mdiff_at I' I'' n g (f x)) (hf : cont_mdiff_within_at I I' n f s x) :