import PoincareLib.Geometry.RicciFlow.Generalized.BoundedDistance.GeometryImports import Mathlib.Geometry.Manifold.LocalDiffeomorph /-! # Smooth restriction to an actual open image A guarded partial diffeomorphism restricts to a diffeomorphism from an open source subset onto its literal image. Both inherited source charts and the canonical singleton chart on an open model domain are supported. Used in Morgan--Tian Theorem 5.6, pp. 85-87; M28 derivation 132. -/ noncomputable section set_option autoImplicit false set_option backward.isDefEq.respectTransparency false open Set open scoped Manifold ContDiff Topology universe u v namespace PartialDiffeomorph variable {๐•œ : Type*} [NontriviallyNormedField ๐•œ] {E : Type*} [NormedAddCommGroup E] [NormedSpace ๐•œ E] {F : Type*} [NormedAddCommGroup F] [NormedSpace ๐•œ F] {H : Type*} [TopologicalSpace H] {H' : Type*} [TopologicalSpace H'] {I : ModelWithCorners ๐•œ E H} {J : ModelWithCorners ๐•œ F H'} {M : Type u} [TopologicalSpace M] [ChartedSpace H M] {N : Type v} [TopologicalSpace N] [ChartedSpace H' N] /-- Restrict a smooth partial diffeomorphism to an open subset of its source and the literal open image, with both inherited subtype charts. -/ def diffeomorphOnOpens (e : PartialDiffeomorph I J M N โˆž) (V : TopologicalSpace.Opens M) (W : TopologicalSpace.Opens N) (hV : (V : Set M) โІ e.source) (hW : e '' (V : Set M) = (W : Set N)) : V โ‰ƒโ‚˜โŸฎI, JโŸฏ W := by let L : V โ‰ƒโ‚œ W := e.toOpenPartialHomeomorph.homeomorphOfImageSubsetSource hV hW have htarget : (W : Set N) โІ e.target := by intro y hy rw [โ† hW] at hy obtain โŸจx, hx, rflโŸฉ := hy exact e.toPartialEquiv.map_source (hV hx) refine { toEquiv := L.toEquiv contMDiff_toFun := ?_ contMDiff_invFun := ?_ } ยท apply (ContMDiff.subtypeVal_comp_iff W (L : V โ†’ W)).mp intro x change ContMDiffAt I J โˆž (e โˆ˜ (Subtype.val : V โ†’ M)) x exact ((e.contMDiffOn (x : M) (hV x.property)).contMDiffAt (e.open_source.mem_nhds (hV x.property))).comp x (contMDiff_subtype_val (I := I) (U := V) (n := โˆž)).contMDiffAt ยท apply (ContMDiff.subtypeVal_comp_iff V (L.symm : W โ†’ V)).mp intro y change ContMDiffAt J I โˆž (e.symm โˆ˜ (Subtype.val : W โ†’ N)) y exact ((e.symm.contMDiffOn (y : N) (htarget y.property)).contMDiffAt (e.open_target.mem_nhds (htarget y.property))).comp y (contMDiff_subtype_val (I := J) (U := W) (n := โˆž)).contMDiffAt /-- The restricted diffeomorphism has the original forward map. -/ @[simp] theorem diffeomorphOnOpens_apply (e : PartialDiffeomorph I J M N โˆž) (V : TopologicalSpace.Opens M) (W : TopologicalSpace.Opens N) (hV : (V : Set M) โІ e.source) (hW : e '' (V : Set M) = (W : Set N)) (x : V) : ((diffeomorphOnOpens e V W hV hW x : W) : N) = e (x : M) := rfl /-- The restricted inverse is the partial inverse on its true image. -/ @[simp] theorem diffeomorphOnOpens_symm_apply (e : PartialDiffeomorph I J M N โˆž) (V : TopologicalSpace.Opens M) (W : TopologicalSpace.Opens N) (hV : (V : Set M) โІ e.source) (hW : e '' (V : Set M) = (W : Set N)) (y : W) : (((diffeomorphOnOpens e V W hV hW).symm y : V) : M) = e.symm (y : N) := rfl /-- The same restriction when the source open model domain carries its canonical singleton chart, as in the source normal-chart flow APIs. -/ def diffeomorphOnCanonicalSource (e : PartialDiffeomorph I J H N โˆž) (V : TopologicalSpace.Opens H) [Nonempty V] (W : TopologicalSpace.Opens N) (hV : (V : Set H) โІ e.source) (hW : e '' (V : Set H) = (W : Set N)) : letI := V.isOpen.isOpenEmbedding_subtypeVal.singletonChartedSpace V โ‰ƒโ‚˜โŸฎI, JโŸฏ W := by letI := V.isOpen.isOpenEmbedding_subtypeVal.singletonChartedSpace let L : V โ‰ƒโ‚œ W := e.toOpenPartialHomeomorph.homeomorphOfImageSubsetSource hV hW have htarget : (W : Set N) โІ e.target := by intro y hy rw [โ† hW] at hy obtain โŸจx, hx, rflโŸฉ := hy exact e.toPartialEquiv.map_source (hV hx) have hsource : ContMDiff I I โˆž (Subtype.val : V โ†’ H) := contMDiff_isOpenEmbedding (I := I) (n := โˆž) V.isOpen.isOpenEmbedding_subtypeVal refine { toEquiv := L.toEquiv contMDiff_toFun := ?_ contMDiff_invFun := ?_ } ยท apply (ContMDiff.subtypeVal_comp_iff W (L : V โ†’ W)).mp intro x change ContMDiffAt I J โˆž (e โˆ˜ (Subtype.val : V โ†’ H)) x exact ((e.contMDiffOn (x : H) (hV x.property)).contMDiffAt (e.open_source.mem_nhds (hV x.property))).comp x hsource.contMDiffAt ยท have hraw : ContMDiff J I โˆž ((Subtype.val : V โ†’ H) โˆ˜ (L.symm : W โ†’ V)) := by intro y change ContMDiffAt J I โˆž (e.symm โˆ˜ (Subtype.val : W โ†’ N)) y exact ((e.symm.contMDiffOn (y : N) (htarget y.property)).contMDiffAt (e.open_target.mem_nhds (htarget y.property))).comp y (contMDiff_subtype_val (I := J) (U := W) (n := โˆž)).contMDiffAt exact ContMDiff.of_comp_isOpenEmbedding V.isOpen.isOpenEmbedding_subtypeVal hraw /-- The singleton-source restriction has the original forward map. -/ @[simp] theorem diffeomorphOnCanonicalSource_apply (e : PartialDiffeomorph I J H N โˆž) (V : TopologicalSpace.Opens H) [Nonempty V] (W : TopologicalSpace.Opens N) (hV : (V : Set H) โІ e.source) (hW : e '' (V : Set H) = (W : Set N)) (x : V) : ((diffeomorphOnCanonicalSource e V W hV hW x : W) : N) = e (x : H) := rfl end PartialDiffeomorph