import PoincareLib.Analysis.ODE.LocalFlow.Smooth import PoincareLib.Geometry.Riemannian.Metric.Pullback import Mathlib.Geometry.Manifold.IntegralCurve.UniformTime /-! # Smooth local flows in manifold charts -/ noncomputable section set_option autoImplicit false set_option backward.isDefEq.respectTransparency false open Set Filter Bundle open scoped Manifold ContDiff Bundle Topology namespace Poincare.Manifold variable {n : β„•} {M : Type*} [TopologicalSpace M] [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] [IsManifold (𝓑 n) ∞ M] /-- A smooth vector field has a jointly smooth local flow through each point. -/ theorem exists_smooth_localFlow {X : (x : M) β†’ TangentSpace (𝓑 n) x} (hX : ContMDiff (𝓑 n) ((𝓑 n).prod (𝓑 n)) ∞ (T% X)) (x : M) : βˆƒ (V : Set M) (Ξ΄ : ℝ) (Ξ¦ : ℝ Γ— M β†’ M), IsOpen V ∧ x ∈ V ∧ 0 < Ξ΄ ∧ ContMDiffOn (π“˜(ℝ, ℝ).prod (𝓑 n)) (𝓑 n) ∞ Ξ¦ (Ioo (-Ξ΄) Ξ΄ Γ—Λ’ V) ∧ (βˆ€ y ∈ V, Ξ¦ (0, y) = y) ∧ βˆ€ y ∈ V, IsMIntegralCurveOn (I := 𝓑 n) (fun t => Ξ¦ (t, y)) X (Ioo (-Ξ΄) Ξ΄) := by let E := EuclideanSpace ℝ (Fin n) let c := extChartAt (𝓑 n) x have hchart : ContMDiffOn (𝓑 n) (𝓑 n) ∞ c c.source := by simpa only [c, extChartAt_source] using (contMDiffOn_extChartAt (I := 𝓑 n) (x := x) (n := ∞)) have hc (y : M) (hy : y ∈ c.source) : ContMDiffAt (𝓑 n) (𝓑 n) ∞ c y := hchart.contMDiffAt (extChartAt_source_mem_nhds' hy) have hci (z : E) (hz : z ∈ c.target) : ContMDiffAt (𝓑 n) (𝓑 n) ∞ c.symm z := (contMDiffWithinAt_extChartAt_symm_target (n := ∞) x hz).contMDiffAt (extChartAt_target_mem_nhds' hz) let F : E β†’ E := fun z => mfderiv (𝓑 n) (𝓑 n) c (c.symm z) (X (c.symm z)) have hF : ContDiffOn ℝ ∞ F c.target := by intro z hz have hd := ((hc _ (c.map_target hz)).mfderiv_const (m := ∞) (by simp)).clm_apply_of_inCoordinates (hX _) (hc _ (c.map_target hz)) have hs := (contMDiff_snd_tangentBundle_modelSpace E (𝓑 n)).contMDiffAt.comp _ hd exact (contMDiffAt_iff_contDiffAt.mp (hs.comp z (hci z hz))).contDiffWithinAt have hpush (z : E) (hz : z ∈ c.target) : mfderiv (𝓑 n) (𝓑 n) c.symm z (F z) = X (c.symm z) := by have h := congrArg (fun L => L (X (c.symm z))) (mfderivWithin_extChartAt_symm_comp_mfderiv_extChartAt' (I := 𝓑 n) (c.map_target hz)) simp only [ModelWithCorners.range_eq_univ, mfderivWithin_univ, ContinuousLinearMap.comp_apply] at h change mfderiv (𝓑 n) (𝓑 n) c.symm (c (c.symm z)) (F z) = X (c.symm z) at h have hz' : c (c.symm z) = z := c.right_inv hz rw [hz'] at h exact h obtain ⟨B, Ξ΄, q, hB, hxB, hBc, hΞ΄, hq, hq0, hqmem, hqtime⟩ := Poincare.ODE.LocalFlow.exists_smooth_localFlow (isOpen_extChartAt_target x) hF (mem_extChartAt_target x) let V := c.source ∩ c ⁻¹' B have hV : IsOpen V := hchart.continuousOn.isOpen_inter_preimage (isOpen_extChartAt_source x) hB let Ξ¦ : ℝ Γ— M β†’ M := fun p => c.symm (q (c p.2, p.1)) have hΞ¦ : ContMDiffOn (π“˜(ℝ, ℝ).prod (𝓑 n)) (𝓑 n) ∞ Ξ¦ (Ioo (-Ξ΄) Ξ΄ Γ—Λ’ V) := by rintro ⟨t, y⟩ ⟨ht, hy⟩ have hp : ContMDiffAt (π“˜(ℝ, ℝ).prod (𝓑 n)) ((𝓑 n).prod π“˜(ℝ, ℝ)) ∞ (fun p : ℝ Γ— M => (c p.2, p.1)) (t, y) := ((hc y hy.1).comp (t, y) contMDiffAt_snd).prodMk contMDiffAt_fst have hqm : ContMDiffAt ((𝓑 n).prod π“˜(ℝ, ℝ)) (𝓑 n) ∞ q (c y, t) := by have hqd := hq.contDiffAt ((hB.prod isOpen_Ioo).mem_nhds (show (c y, t) ∈ B Γ—Λ’ Ioo (-Ξ΄) Ξ΄ from ⟨hy.2, ht⟩)) rw [← modelWithCornersSelf_prod, chartedSpaceSelf_prod] exact hqd.contMDiffAt exact ((hci _ (hqmem _ hy.2 t ht)).comp (t, y) (hqm.comp (t, y) hp)).contMDiffWithinAt refine ⟨V, Ξ΄, Ξ¦, hV, ⟨mem_extChartAt_source x, hxB⟩, hΞ΄, hΞ¦, ?_, ?_⟩ Β· intro y hy change c.symm (q (c y, 0)) = y rw [hq0 _ hy.2, c.left_inv hy.1] Β· intro y hy t ht have hd := ((hci _ (hqmem _ hy.2 t ht)).mdifferentiableAt (by simp)).hasMFDerivAt.comp t (hqtime _ hy.2 t ht).hasFDerivAt.hasMFDerivAt apply HasMFDerivAt.hasMFDerivWithinAt apply hd.congr_mfderiv apply ContinuousLinearMap.ext intro a change ℝ at a change mfderiv (𝓑 n) (𝓑 n) c.symm (q (c y, t)) (a β€’ F (q (c y, t))) = a β€’ X (c.symm (q (c y, t))) rw [map_smul, hpush _ (hqmem _ hy.2 t ht)] end Poincare.Manifold