import Mathlib.Geometry.Manifold.SmoothEmbedding import Mathlib.Geometry.Manifold.ContMDiff.Atlas import Mathlib.Topology.Homeomorph.Lemmas /-! # Reparametrizing smooth embeddings Precomposition by a diffeomorphism transports the immersion source charts. Two smooth embeddings with the same range have a smooth reparametrization: their range homeomorphism is smooth by the immersion composition criterion. -/ noncomputable section set_option autoImplicit false open Set open scoped Manifold ContDiff namespace Manifold variable {π•œ : Type*} [NontriviallyNormedField π•œ] {E F G : Type*} [NormedAddCommGroup E] [NormedSpace π•œ E] [NormedAddCommGroup F] [NormedSpace π•œ F] [NormedAddCommGroup G] [NormedSpace π•œ G] {M N : Type*} [TopologicalSpace M] [ChartedSpace E M] [TopologicalSpace N] [ChartedSpace G N] {n : β„•βˆžΟ‰} [IsManifold π“˜(π•œ, E) n M] {f g : M β†’ N} /-- A change of source coordinates preserves an immersion with its given normal complement. -/ theorem IsImmersionOfComplement.comp_diffeomorph (hf : IsImmersionOfComplement F π“˜(π•œ, E) π“˜(π•œ, G) n f) (e : Diffeomorph π“˜(π•œ, E) π“˜(π•œ, E) M M n) : IsImmersionOfComplement F π“˜(π•œ, E) π“˜(π•œ, G) n (f ∘ e) := by intro x let h := hf (e x) let d := e.toHomeomorph.toOpenPartialHomeomorph.trans h.domChart have hd : d ∈ IsManifold.maximalAtlas π“˜(π•œ, E) n M := by apply d.mem_maximalAtlas_of_contMDiffOn Β· exact (contMDiffOn_of_mem_maximalAtlas h.domChart_mem_maximalAtlas).comp e.contMDiff.contMDiffOn (fun y hy => hy.2) Β· exact e.symm.contMDiff.comp_contMDiffOn ((contMDiffOn_symm_of_mem_maximalAtlas h.domChart_mem_maximalAtlas).mono inter_subset_left) have hx : x ∈ d.source := ⟨mem_univ _, h.mem_domChart_source⟩ have hsource (y : M) (hy : y ∈ d.source) : f (e y) ∈ h.codChart.source := h.source_subset_preimage_source hy.2 apply IsImmersionAtOfComplement.mk_of_charts h.equiv d h.codChart hx (hsource x hx) hd h.codChart_mem_maximalAtlas hsource intro v hv have hv' : v ∈ h.domChart.target := by have hvt : v ∈ d.target := by simpa using hv exact hvt.1 change h.codChart (f (e (e.symm (h.domChart.symm v)))) = h.equiv (v, 0) rw [e.apply_symm_apply] exact h.writtenInCharts (by simpa using hv') /-- Reparametrizing the source of a smooth embedding by a diffeomorphism preserves its smooth embedding property. -/ theorem IsSmoothEmbedding.comp_diffeomorph (hf : IsSmoothEmbedding π“˜(π•œ, E) π“˜(π•œ, G) n f) (e : Diffeomorph π“˜(π•œ, E) π“˜(π•œ, E) M M n) : IsSmoothEmbedding π“˜(π•œ, E) π“˜(π•œ, G) n (f ∘ e) := ⟨(hf.isImmersion.isImmersionOfComplement_complement.comp_diffeomorph e).isImmersion, hf.isEmbedding.comp e.toHomeomorph.isEmbedding⟩ omit [IsManifold π“˜(π•œ, E) n M] in /-- Equal images of smooth embeddings give an actual smooth change of parameter, with a pointwise identity between the two maps. -/ theorem IsSmoothEmbedding.exists_reparametrizing_diffeomorph (hf : IsSmoothEmbedding π“˜(π•œ, E) π“˜(π•œ, G) n f) (hg : IsSmoothEmbedding π“˜(π•œ, E) π“˜(π•œ, G) n g) (hrange : range f = range g) : βˆƒ e : Diffeomorph π“˜(π•œ, E) π“˜(π•œ, E) M M n, βˆ€ x, g (e x) = f x := by let e : M β‰ƒβ‚œ M := hf.isEmbedding.toHomeomorph.trans ((Homeomorph.setCongr hrange).trans hg.isEmbedding.toHomeomorph.symm) have heq (x : M) : g (e x) = f x := by have h := congrArg Subtype.val (hg.isEmbedding.toHomeomorph.apply_symm_apply ((Homeomorph.setCongr hrange) (hf.isEmbedding.toHomeomorph x))) exact h have hinv (x : M) : f (e.symm x) = g x := by rw [← heq (e.symm x), e.apply_symm_apply] have hsmooth : ContMDiff π“˜(π•œ, E) π“˜(π•œ, E) n e := by apply (ContMDiff.iff_comp_isImmersion hg.isImmersion).mpr refine ⟨e.continuous, ?_⟩ have he : g ∘ e = f := funext heq rw [he] exact hf.contMDiff have hinverse : ContMDiff π“˜(π•œ, E) π“˜(π•œ, E) n e.symm := by apply (ContMDiff.iff_comp_isImmersion hf.isImmersion).mpr refine ⟨e.symm.continuous, ?_⟩ have he : f ∘ e.symm = g := funext hinv rw [he] exact hg.contMDiff exact ⟨{ e.toEquiv with contMDiff_toFun := hsmooth, contMDiff_invFun := hinverse }, heq⟩ end Manifold