import PoincareLib.Geometry.Manifold.InverseFunction.LocalDiffeomorph import PoincareLib.Geometry.Riemannian.Metric.Product.EuclideanModel import Mathlib.Geometry.Manifold.IntegralCurve.Basic import Mathlib.Geometry.Manifold.MFDeriv.SpecificFunctions import Mathlib.Geometry.Manifold.LocalDiffeomorph import Mathlib.LinearAlgebra.FiniteDimensional.Lemmas /-! # Local diffeomorphism of a transverse flowout A supplied smooth all-time flow carries a transverse immersed section to a locally diffeomorphic flowout. The source uses the actual Euclidean line-product atlas. This is the local differential step in Morgan--Tian Claim 11.7, pp. 270-271; it requires no metric or scalar primitive. -/ set_option autoImplicit false set_option backward.isDefEq.respectTransparency false open Set Manifold open scoped Manifold ContDiff Bundle universe u v namespace PoincareMT.M30 /-- A transverse section of a supplied smooth flow has a locally diffeomorphic flowout in the actual line-product atlas. -/ theorem isLocalDiffeomorph_transverseFlowout {n : โ„•} {S : Type u} {Q : Type v} [TopologicalSpace S] [TopologicalSpace Q] [ChartedSpace (EuclideanSpace โ„ (Fin n)) S] [ChartedSpace (EuclideanSpace โ„ (Fin (n + 1))) Q] [IsManifold (๐“ก n) โˆž S] [IsManifold (๐“ก (n + 1)) โˆž Q] {j : S โ†’ Q} {X : (x : Q) โ†’ TangentSpace (๐“ก (n + 1)) x} {Phi : โ„ โ†’ Q โ†’ Q} (hj : ContMDiff (๐“ก n) (๐“ก (n + 1)) โˆž j) (hj_inj : โˆ€ q, Function.Injective (mfderiv (๐“ก n) (๐“ก (n + 1)) j q)) (hs : ContMDiff (๐“˜(โ„, โ„).prod (๐“ก (n + 1))) (๐“ก (n + 1)) โˆž (Function.uncurry Phi)) (hcurve : โˆ€ x, IsMIntegralCurve (I := ๐“ก (n + 1)) (fun t => Phi t x) X) (h0 : โˆ€ x, Phi 0 x = x) (hadd : โˆ€ s t x, Phi (s + t) x = Phi s (Phi t x)) (htrans : โˆ€ q, ยฌ โˆƒ w : TangentSpace (๐“ก n) q, mfderiv (๐“ก n) (๐“ก (n + 1)) j q w = X (j q)) : letI := RiemannianMetric.lineProductChartedSpace (n := n) (M := S) letI := RiemannianMetric.lineProductIsManifold (n := n) (M := S) IsLocalDiffeomorph (๐“ก (n + 1)) (๐“ก (n + 1)) โˆž (fun z : S ร— โ„ => Phi z.2 (j z.1)) := by let : ChartedSpace (EuclideanSpace โ„ (Fin n) ร— โ„) (S ร— โ„) := prodChartedSpace (EuclideanSpace โ„ (Fin n)) S โ„ โ„ let := RiemannianMetric.lineProductChartedSpace (n := n) (M := S) let := RiemannianMetric.lineProductIsManifold (n := n) (M := S) let Gamma : S ร— โ„ โ†’ Q := fun z => Phi z.2 (j z.1) have hPhi (t : โ„) : ContMDiff (๐“ก (n + 1)) (๐“ก (n + 1)) โˆž (Phi t) := hs.comp (contMDiff_const.prodMk contMDiff_id) have hGamma : ContMDiff ((๐“ก n).prod ๐“˜(โ„, โ„)) (๐“ก (n + 1)) โˆž Gamma := hs.comp (contMDiff_snd.prodMk (hj.comp contMDiff_fst)) have hzero (q : S) (w : TangentSpace ((๐“ก n).prod ๐“˜(โ„, โ„)) (q, (0 : โ„))) : mfderiv ((๐“ก n).prod ๐“˜(โ„, โ„)) (๐“ก (n + 1)) Gamma (q, 0) w = mfderiv (๐“ก n) (๐“ก (n + 1)) j q w.1 + w.2 โ€ข X (j q) := by rw [mfderiv_prod_eq_add_apply (hGamma.mdifferentiable (by simp) (q, 0))] have hinit : (fun y : S => Gamma (y, 0)) = j := funext (fun y => h0 (j y)) rw [hinit] have ht := (hcurve (j q) 0).mfderiv change mfderiv ๐“˜(โ„, โ„) (๐“ก (n + 1)) (fun t => Phi t (j q)) 0 = (1 : โ„ โ†’L[โ„] โ„).smulRight (X (Phi 0 (j q))) at ht rw [h0] at ht change _ + mfderiv ๐“˜(โ„, โ„) (๐“ก (n + 1)) (fun t => Phi t (j q)) 0 w.2 = _ rw [ht] rfl have hraw0 (q : S) : Function.Injective (mfderiv ((๐“ก n).prod ๐“˜(โ„, โ„)) (๐“ก (n + 1)) Gamma (q, (0 : โ„))) := by apply (injective_iff_map_eq_zero _).mpr intro w hw rw [hzero] at hw have ha : w.2 = 0 := by by_contra ha apply htrans q refine โŸจ-(w.2)โปยน โ€ข w.1, ?_โŸฉ have hjw : mfderiv (๐“ก n) (๐“ก (n + 1)) j q w.1 = -(w.2 โ€ข X (j q)) := by simpa only [add_sub_cancel_right, zero_sub] using congrArg (fun y => y - w.2 โ€ข X (j q)) hw rw [map_smul, hjw, smul_neg, neg_smul, neg_neg, smul_smul, inv_mul_cancelโ‚€ ha, one_smul] have hv : w.1 = 0 := by apply hj_inj q simpa only [ha, zero_smul, add_zero, map_zero] using hw exact Prod.ext hv ha let A (t : โ„) : Q โ‰ƒโ‚˜โŸฎ๐“ก (n + 1), ๐“ก (n + 1)โŸฏ Q := { toEquiv := { toFun := Phi t invFun := Phi (-t) left_inv := fun x => by simpa only [neg_add_cancel, h0] using (hadd (-t) t x).symm right_inv := fun x => by simpa only [add_neg_cancel, h0] using (hadd t (-t) x).symm } contMDiff_toFun := hPhi t contMDiff_invFun := hPhi (-t) } let T (t : โ„) : (S ร— โ„) โ‰ƒโ‚˜โŸฎ(๐“ก n).prod ๐“˜(โ„, โ„), (๐“ก n).prod ๐“˜(โ„, โ„)โŸฏ (S ร— โ„) := { toEquiv := { toFun := fun z => (z.1, z.2 - t) invFun := fun z => (z.1, z.2 + t) left_inv := fun z => by simp right_inv := fun z => by simp } contMDiff_toFun := contMDiff_fst.prodMk (contMDiff_snd.sub contMDiff_const) contMDiff_invFun := contMDiff_fst.prodMk (contMDiff_snd.add contMDiff_const) } have hfactor (t : โ„) : Gamma = A t โˆ˜ (Gamma โˆ˜ T t) := by funext z change Phi z.2 (j z.1) = Phi t (Phi (z.2 - t) (j z.1)) rw [โ† hadd, add_comm t (z.2 - t), sub_add_cancel] have hraw (z : S ร— โ„) : Function.Injective (mfderiv ((๐“ก n).prod ๐“˜(โ„, โ„)) (๐“ก (n + 1)) Gamma z) := by have hTz : T z.2 z = (z.1, (0 : โ„)) := by change (z.1, z.2 - z.2) = (z.1, 0) rw [sub_self] have hmid : Function.Injective (mfderiv ((๐“ก n).prod ๐“˜(โ„, โ„)) (๐“ก (n + 1)) Gamma (T z.2 z)) := by rw [hTz] exact hraw0 z.1 have hderiv : mfderiv ((๐“ก n).prod ๐“˜(โ„, โ„)) (๐“ก (n + 1)) Gamma z = (mfderiv (๐“ก (n + 1)) (๐“ก (n + 1)) (A z.2) (Gamma (T z.2 z))).comp ((mfderiv ((๐“ก n).prod ๐“˜(โ„, โ„)) (๐“ก (n + 1)) Gamma (T z.2 z)).comp (mfderiv ((๐“ก n).prod ๐“˜(โ„, โ„)) ((๐“ก n).prod ๐“˜(โ„, โ„)) (T z.2) z)) := by conv_lhs => rw [hfactor z.2] rw [mfderiv_comp z ((A z.2).mdifferentiable (by simp) _) ((hGamma.comp (T z.2).contMDiff).mdifferentiable (by simp) z), mfderiv_comp z (hGamma.mdifferentiable (by simp) _) ((T z.2).mdifferentiable (by simp) z)] rfl rw [hderiv] exact ((A z.2).mfderivToContinuousLinearEquiv (by simp) _).injective.comp (hmid.comp ((T z.2).mfderivToContinuousLinearEquiv (by simp) z).injective) let e : (S ร— โ„) โ‰ƒโ‚˜โŸฎ(๐“ก n).prod ๐“˜(โ„, โ„), ๐“ก (n + 1)โŸฏ (S ร— โ„) := by refine { toEquiv := Equiv.refl _ contMDiff_toFun := ?_ contMDiff_invFun := ?_ } ยท change ContMDiff ((๐“ก n).prod ๐“˜(โ„, โ„)) (๐“ก (n + 1)) โˆž (id : S ร— โ„ โ†’ _) rw [โ† modelWithCornersSelf_prod] exact Poincare.Manifold.contMDiff_linearRechart_id (M := S ร— โ„) (RiemannianMetric.lineModelEquiv n) ยท change ContMDiff (๐“ก (n + 1)) ((๐“ก n).prod ๐“˜(โ„, โ„)) โˆž (id : S ร— โ„ โ†’ _) rw [โ† modelWithCornersSelf_prod] exact Poincare.Manifold.contMDiff_linearRechart_id_symm (M := S ร— โ„) (RiemannianMetric.lineModelEquiv n) have hflat : ContMDiff (๐“ก (n + 1)) (๐“ก (n + 1)) โˆž Gamma := hGamma.comp e.symm.contMDiff apply Poincare.isLocalDiffeomorph_of_contMDiff_bijective_mfderiv hflat intro z have hderiv : mfderiv (๐“ก (n + 1)) (๐“ก (n + 1)) Gamma z = (mfderiv ((๐“ก n).prod ๐“˜(โ„, โ„)) (๐“ก (n + 1)) Gamma (e.symm z)).comp (mfderiv (๐“ก (n + 1)) ((๐“ก n).prod ๐“˜(โ„, โ„)) e.symm z) := mfderiv_comp z (hGamma.mdifferentiable (by simp) _) (e.symm.mdifferentiable (by simp) z) have hinj : Function.Injective (mfderiv (๐“ก (n + 1)) (๐“ก (n + 1)) Gamma z) := by rw [hderiv] exact (hraw (e.symm z)).comp (e.symm.mfderivToContinuousLinearEquiv (by simp) z).injective refine โŸจhinj, ?_โŸฉ let : FiniteDimensional โ„ (TangentSpace (๐“ก (n + 1)) z) := by unfold TangentSpace infer_instance let : FiniteDimensional โ„ (TangentSpace (๐“ก (n + 1)) (Gamma z)) := by unfold TangentSpace infer_instance exact (LinearMap.injective_iff_surjective_of_finrank_eq_finrank (f := (mfderiv (๐“ก (n + 1)) (๐“ก (n + 1)) Gamma z).toLinearMap) rfl).mp hinj end PoincareMT.M30