import PoincareLib.Geometry.CurveShortening.Comparison.Compatibility.SourceNames import PoincareLib.Geometry.CurveShortening.Ramp.Approximation.Geodesic.Equation import PoincareLib.Geometry.CurveShortening.Ramp.Polygon /-! # The retained side equation is the intrinsic geodesic equation In a fixed chart, the pullback velocity equation is the actual coordinate geodesic ODE. This supplies the reverse bridge needed to apply intrinsic initial-value uniqueness to arbitrary sampled minimizing sides. Morgan--Tian context: Section 19.4, Definition 19.18 and Claims 19.19-19.22, printed pp. 450-453. -/ set_option autoImplicit false set_option backward.isDefEq.respectTransparency false open Set Filter open scoped Manifold ContDiff Topology Bundle namespace PoincareMT open Proofs.M09 variable {n : โ„•} {M : Type*} [TopologicalSpace M] [ChartedSpace (EuclideanSpace โ„ (Fin n)) M] [IsManifold (๐“ก n) โˆž M] {g : RiemannianMetric n M} /-- The retained zero covariant acceleration equation implies the actual intrinsic geodesic ODE. Source: Auxiliary step for MT Definition 19.18 and Claims 19.19/19.22, pp. 450-453; project construction in `proof-work/tasks/M64/reports/2026-09-23-static-polygon.md`. -/ theorem m64_isGeodesicOn_of_pullback_velocity_eq_zero (D : LeviCivitaData g) {gamma : โ„ โ†’ M} {U : Set โ„} (hU : IsOpen U) (hsmooth : ContMDiffOn ๐“˜(โ„, โ„) (๐“ก n) โˆž gamma U) (hequation : โˆ€ t โˆˆ U, rampHorizontalCovariantDerivative D gamma (fun s => curveVelocity (n := n) gamma s) t = 0) : g.IsGeodesicOn gamma U := by intro t ht let E := EuclideanSpace โ„ (Fin n) let p := gamma t let c := chartAt E p let V := U โˆฉ gamma โปยน' c.source have hV : IsOpen V := hsmooth.continuousOn.isOpen_inter_preimage hU c.open_source have htV : t โˆˆ V := โŸจht, mem_chart_source E pโŸฉ let q : โ„ โ†’ E := fun s => c (gamma s) let w : โ„ โ†’ E := deriv q have hq : ContDiffOn โ„ โˆž q V := (contMDiffOn_chart.comp (hsmooth.mono inter_subset_left) (fun _ hs => hs.2)).contDiffOn have hw : ContDiffOn โ„ โˆž w V := hq.deriv_of_isOpen hV (by simp) have hdiff (s : โ„) (hs : s โˆˆ V) : MDifferentiableAt ๐“˜(โ„, โ„) (๐“ก n) gamma s := (hsmooth.contMDiffAt (hU.mem_nhds hs.1)).mdifferentiableAt (by simp) have hqd (s : โ„) (hs : s โˆˆ V) : HasDerivAt q (w s) s := ((hq.contDiffAt (hV.mem_nhds hs)).differentiableAt (by simp)).hasDerivAt have hvel (s : โ„) (hs : s โˆˆ V) : chartVectorField p (w s) (gamma s) = curveVelocity (n := n) gamma s := chartVectorField_coordinate_velocity p gamma s (w s) hs.2 (hdiff s hs) (hqd s hs) have hode (s : โ„) (hs : s โˆˆ V) : HasDerivAt w (-coordinateChristoffel (g.pullbackCoefficients c.symm) (q s) (w s) (w s)) s := by have hconn := M63.chartVectorField_coordinateChristoffel D p (q s) (c.map_source hs.2) (w s) (w s) have hbase : c.symm (q s) = gamma s := c.left_inv hs.2 rw [hbase] at hconn have hzero : chartVectorField p (deriv w s + coordinateChristoffel (g.pullbackCoefficients c.symm) (q s) (w s) (w s)) (gamma s) = 0 := by calc _ = chartVectorField p (deriv w s) (gamma s) + chartVectorField p (coordinateChristoffel (g.pullbackCoefficients c.symm) (q s) (w s) (w s)) (gamma s) := by simp only [chartVectorField, VectorField.mpullback, map_add] _ = chartVectorField p (deriv w s) (gamma s) + D.connection (chartVectorField p (w s)) (gamma s) (curveVelocity gamma s) := by rw [hconn, hvel s hs] _ = rampHorizontalCovariantDerivative D gamma (fun u => chartVectorField p (w u) (gamma u)) s := (M62.pullback_chart_field D p (hdiff s hs) hs.2 hV hs w hw).symm _ = rampHorizontalCovariantDerivative D gamma (fun u => curveVelocity gamma u) s := M62.pullback_congr D (by filter_upwards [hV.mem_nhds hs] with u hu exact hvel u hu) _ = 0 := hequation s hs.1 have hinv : (mfderiv (๐“ก n) (๐“ก n) c (gamma s)).IsInvertible := โŸจ(mdifferentiable_chart (I := ๐“ก n) p).mfderiv hs.2, rflโŸฉ have hcoord := congrArg (mfderiv (๐“ก n) (๐“ก n) c (gamma s)) hzero change (mfderiv (๐“ก n) (๐“ก n) c (gamma s)) ((mfderiv (๐“ก n) (๐“ก n) c (gamma s)).inverse (deriv w s + coordinateChristoffel (g.pullbackCoefficients c.symm) (q s) (w s) (w s))) = _ at hcoord rw [hinv.self_apply_inverse, map_zero] at hcoord exact ((hw.contDiffAt (hV.mem_nhds hs)).differentiableAt (by simp)).hasDerivAt |>.congr_deriv (eq_neg_of_add_eq_zero_left hcoord) have he : extChartAt (๐“ก n) p = c.toPartialEquiv := by ext x <;> simp [c] refine โŸจp, q, w, ?_โŸฉ filter_upwards [hV.mem_nhds htV] with s hs rw [he] exact โŸจ(c.left_inv hs.2).symm, c.map_source hs.2, hqd s hs, hode s hsโŸฉ /-- A retained minimizing side is an intrinsic geodesic on its complete closed parameter interval. Source: Auxiliary step for MT Definition 19.18 and Claims 19.19/19.22, pp. 450-453; project construction in `proof-work/tasks/M64/reports/2026-09-23-static-polygon.md`. -/ theorem m64MinimizingSide_isGeodesicOn {D : LeviCivitaData g} {ell : โ„} {p q : M} (side : M63MinimizingGeodesicSide g D ell p q) : g.IsGeodesicOn side.map (Icc (0 : โ„) ell) := fun _ ht => m64_isGeodesicOn_of_pullback_velocity_eq_zero D side.domain_open side.smooth side.equation _ (side.interval_subset ht) end PoincareMT