import PoincareLib.Geometry.Riemannian.Distance.MinimizingGeodesic import Mathlib.Analysis.ODE.PicardLindelof /-! # Smoothness of the actual radial geodesic The local coordinate phase already stored by IsGeodesicOn solves the smooth metric geodesic equation. ODE regularity upgrades that same phase to smoothness, retaining its actual curve and parameter interval. Source: Chapter 1, Section 3.1, pp. 10-11, and Definition 1.22, p. 14. See `proof-work/tasks/M47/derivations/joint-seed-ball.md`, Stage E4. -/ set_option autoImplicit false open Set Filter open scoped Manifold ContDiff Bundle Topology namespace PoincareMT.M47 variable {n : β„•} {M : Type*} [TopologicalSpace M] [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] [IsManifold (𝓑 n) ∞ M] /-- The actual local phase equation makes every affine metric geodesic smooth in an ambient parameter neighborhood; Chapter 1, Section 3.1. -/ theorem jointSeed_geodesic_contMDiffAt {g : RiemannianMetric n M} {gamma : ℝ β†’ M} {S : Set ℝ} (hgamma : g.IsGeodesicOn gamma S) {t : ℝ} (ht : t ∈ S) : ContMDiffAt (π“˜(ℝ, ℝ)) (𝓑 n) ∞ gamma t := by obtain ⟨p, q, w, hlocal⟩ := hgamma t ht obtain ⟨a, b, _htab, hnbhd, hab⟩ := exists_Icc_mem_subset_of_mem_nhds hlocal let B := g.pullbackCoefficients (extChartAt (𝓑 n) p).symm let U := (extChartAt (𝓑 n) p).target Γ—Λ’ (univ : Set (EuclideanSpace ℝ (Fin n))) have hfield : ContDiffOn ℝ ∞ (fun z : ℝ Γ— (EuclideanSpace ℝ (Fin n) Γ— EuclideanSpace ℝ (Fin n)) => coordinateGeodesicField B z.2) (Icc a b Γ—Λ’ U) := by intro z hz have hzsrc : z.2.1 ∈ (extChartAt (𝓑 n) p).target := hz.2.1 have hB : ContDiffAt ℝ ∞ B z.2.1 := (g.contDiffOn_chartCoefficients p z.2.1 hzsrc).contDiffAt ((isOpen_extChartAt_target (I := 𝓑 n) p).mem_nhds hzsrc) exact ((contDiffAt_coordinateGeodesicField hB (g.isInvertible_chartCoefficients p hzsrc)).comp z contDiffAt_snd).contDiffWithinAt have hphase (s : ℝ) (hs : s ∈ Icc a b) : HasDerivWithinAt (fun s => (q s, w s)) (coordinateGeodesicField B (q s, w s)) (Icc a b) s := by exact ((hab hs).2.2.1.prodMk (hab hs).2.2.2).hasDerivWithinAt have hmem : MapsTo (fun s => (q s, w s)) (Icc a b) U := fun s hs => ⟨(hab hs).2.1, mem_univ _⟩ have hphaseSmooth := ODE.contDiffOn_enat_Icc_of_hasDerivWithinAt (n := ⊀) (f := fun _ z => coordinateGeodesicField B z) hfield hphase hmem have hcurve : ContMDiffOn (π“˜(ℝ, ℝ)) (𝓑 n) ∞ (fun s => (extChartAt (𝓑 n) p).symm (q s)) (Icc a b) := (contMDiffOn_extChartAt_symm (I := 𝓑 n) (n := ∞) p).comp (contMDiffOn_iff_contDiffOn.mpr hphaseSmooth.fst) (fun s hs => (hab hs).2.1) exact (hcurve.contMDiffAt hnbhd).congr_of_eventuallyEq (hlocal.mono fun s hs => hs.1) /-- Smoothness holds on the literal geodesic parameter set, with no completeness or endpoint extension assumption. -/ theorem jointSeed_geodesic_contMDiffOn {g : RiemannianMetric n M} {gamma : ℝ β†’ M} {S : Set ℝ} (hgamma : g.IsGeodesicOn gamma S) : ContMDiffOn (π“˜(ℝ, ℝ)) (𝓑 n) ∞ gamma S := fun _ ht => (jointSeed_geodesic_contMDiffAt hgamma ht).contMDiffWithinAt end PoincareMT.M47