import Mathlib.Geometry.Manifold.SmoothEmbedding import Mathlib.Geometry.Manifold.ContMDiff.Constructions import Mathlib.Geometry.Manifold.ContMDiff.NormedSpace /-! # Smooth slices of product coordinates A slice of a smooth open partial homeomorphism is a smooth embedding. The proof uses the chart normal form of Mathlib's immersion definition. This supports Morgan--Tian Definition 2.18, p. 31, and Lemma A.13, p. 505. Adapted from Mapher, `PoincareMT/Proofs/M25/Mathlib/SmoothSlice.lean`, commit `56d9cc710a322b1e69daa9353c1758b861c0e3fe`. -/ set_option autoImplicit false open Set open scoped Manifold ContDiff namespace OpenPartialHomeomorph 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] [IsManifold ๐“˜(๐•œ, G) n N] /-- A full product slice in smooth coordinates is a smooth embedding. The complement and its linear identification are explicit, as required by the immersion normal form. -/ theorem isSmoothEmbedding_slice (e : OpenPartialHomeomorph (M ร— F) N) (he : ContMDiffOn (๐“˜(๐•œ, E).prod ๐“˜(๐•œ, F)) ๐“˜(๐•œ, G) n e e.source) (hi : ContMDiffOn ๐“˜(๐•œ, G) (๐“˜(๐•œ, E).prod ๐“˜(๐•œ, F)) n e.symm e.target) (L : (E ร— F) โ‰ƒL[๐•œ] G) (c : F) (hc : โˆ€ x : M, (x, c) โˆˆ e.source) : Manifold.IsSmoothEmbedding ๐“˜(๐•œ, E) ๐“˜(๐•œ, G) n (fun x => e (x, c)) := by refine โŸจ?_, e.isEmbedding_restrict.comp ((isEmbedding_prodMkLeft c).codRestrict e.source hc)โŸฉ apply Manifold.IsImmersionOfComplement.isImmersion (F := F) intro x let d := chartAt E x let p := d.prod (Homeomorph.addRight (-c)).toOpenPartialHomeomorph let b := (e.symm.trans p).trans L.toHomeomorph.toOpenPartialHomeomorph have hp : ContMDiffOn (๐“˜(๐•œ, E).prod ๐“˜(๐•œ, F)) ๐“˜(๐•œ, E ร— F) n p p.source := by have hshift : ContMDiff ๐“˜(๐•œ, F) ๐“˜(๐•œ, F) n (fun y : F => y + -c) := (contDiff_id.add contDiff_const).contMDiff exact ((contMDiffOn_chart (I := ๐“˜(๐•œ, E)) (x := x)).comp contMDiffOn_fst (fun y hy => hy.1)).prodMk_space (hshift.comp_contMDiffOn contMDiffOn_snd) have hp' : ContMDiffOn ๐“˜(๐•œ, E ร— F) (๐“˜(๐•œ, E).prod ๐“˜(๐•œ, F)) n p.symm p.target := by have hshift : ContMDiff ๐“˜(๐•œ, E ร— F) ๐“˜(๐•œ, F) n (fun y : E ร— F => y.2 + -(-c)) := (contDiff_snd.add contDiff_const).contMDiff exact ((contMDiffOn_chart_symm (I := ๐“˜(๐•œ, E)) (x := x)).comp contDiff_fst.contMDiff.contMDiffOn (fun y hy => hy.1)).prodMk hshift.contMDiffOn have hb : b โˆˆ IsManifold.maximalAtlas ๐“˜(๐•œ, G) n N := by apply b.mem_maximalAtlas_of_contMDiffOn ยท change ContMDiffOn ๐“˜(๐•œ, G) ๐“˜(๐•œ, G) n (L โˆ˜ p โˆ˜ e.symm) b.source apply L.contDiff.contMDiff.comp_contMDiffOn exact hp.comp (hi.mono (fun y hy => hy.1.1)) (fun y hy => hy.1.2) ยท change ContMDiffOn ๐“˜(๐•œ, G) ๐“˜(๐•œ, G) n (e โˆ˜ p.symm โˆ˜ L.symm) b.target exact he.comp (hp'.comp L.symm.contDiff.contMDiff.contMDiffOn (fun y hy => hy.2.1)) (fun y hy => hy.2.2) have hsource (y : M) (hy : y โˆˆ d.source) : e (y, c) โˆˆ b.source := by refine โŸจโŸจe.map_source (hc y), ?_โŸฉ, Set.mem_univ _โŸฉ change e.symm (e (y, c)) โˆˆ p.source rw [e.left_inv (hc y)] exact โŸจhy, Set.mem_univ _โŸฉ apply Manifold.IsImmersionAtOfComplement.mk_of_charts L d b (mem_chart_source E x) (hsource x (mem_chart_source E x)) (IsManifold.chart_mem_maximalAtlas x) hb hsource intro v hv have hv' : v โˆˆ d.target := by simpa using hv change L (p (e.symm (e (d.symm v, c)))) = L (v, 0) rw [e.left_inv (hc _)] congr 1 change (d (d.symm v), c + -c) = (v, 0) rw [d.right_inv hv', add_neg_cancel] end OpenPartialHomeomorph