import PoincareLib.Geometry.CurveShortening.Ramp.LocalFlow.Fixed.LabelSpatialRecurrences import PoincareLib.Geometry.CurveShortening.Ramp.LocalFlow.Fixed.LabelC2Transport import PoincareLib.Geometry.CurveShortening.Ramp.LocalFlow.C2.SpeedPrimitive import PoincareLib.Geometry.CurveShortening.Ramp.LocalFlow.Pullback.RicciRegularity import PoincareLib.Geometry.CurveShortening.Ramp.Analysis.Normalized.SpatialPathBootstrap import Mathlib.Analysis.Calculus.IteratedDeriv.Defs /-! # Actual spatial smoothness in fixed constant-speed labels The original intrinsic fields, actual speed primitive and closed spatial recurrences supply one smooth family of closed-time paths. MT2007 Claim 19.1, p. 437, and Lemma 19.6, pp. 441-442; `2026-09-22-fixed-label-spatial-smoothness.md`. -/ set_option autoImplicit false set_option backward.isDefEq.respectTransparency false open Set open scoped Manifold ContDiff Bundle intervalIntegral universe u v namespace PoincareMT.M63 variable {n : β„•} {M : Type u} [TopologicalSpace M] [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] [IsManifold (𝓑 n) ∞ M] {ΞΉ : Type v} [Fintype ΞΉ] {a b : ℝ} local notation "W" => EuclideanSpace ℝ ΞΉ /-- Constant actual anchor speed and the original intrinsic fields give smooth spatial paths through both included positive endpoints. MT2007 Claim 19.1, p. 437; fixed-label spatial smoothness derivation. -/ theorem fixedLabel_embedded_path_smooth_of_constant_speed (F : RicciFlow n M (Icc a b)) {c : ℝ β†’ ℝ β†’ M} {J : Set ℝ} (hc : M63C2ShrinkingCurveOn F c J) (hi : M63IntrinsicRegularityOn F c J) {tau s : ℝ} (hat : a < tau) (hts : tau < s) (hslab : Icc tau s βŠ† J) {psi : ℝ β†’ ℝ} (hpsi : ContDiff ℝ 2 psi) (hpos : βˆ€ x, 0 < deriv psi x) (hshift : βˆ€ x, psi (x + curvePeriod) = psi x + curvePeriod) {v0 : ℝ} (hanchor : βˆ€ x, curveSpeed F (fun y t => c (psi y) t) tau x = v0) {e : M β†’ W} (he : ContMDiff (𝓑 n) π“˜(ℝ, W) ∞ e) {U : Set W} (hU : IsOpen U) (heU : range e βŠ† U) {ρ : W β†’ M} (hρ : ContMDiffOn π“˜(ℝ, W) (𝓑 n) ∞ ρ U) (hρe : βˆ€ p, ρ (e p) = p) : βˆƒ Q : ℝ β†’ C(Icc tau s, W), (βˆ€ x (t : Icc tau s), Q x t = e (c (psi x) t)) ∧ ContDiff ℝ ∞ Q ∧ (βˆ€ t ∈ Icc tau s, ContMDiff π“˜(ℝ, ℝ) (𝓑 n) ∞ (fun x => c (psi x) t)) ∧ βˆ€ k : β„•, ContinuousOn (fun z : ℝ Γ— ℝ => iteratedDeriv k (fun x => e (c (psi x) z.2)) z.1) (univ Γ—Λ’ Icc tau s) := by let d := fun x t => c (psi x) t let q := fun x t => e (d x t) let v := fun x t => curveSpeed F d t x let K := fun (i : β„•) (t x : ℝ) => match i with | 0 => spatialUnitTangent F c t x | i + 1 => m63CurvatureJet F c i t x let R : β„• β†’ ℝ β†’ ℝ β†’ W := fun i x t => mfderiv (𝓑 n) π“˜(ℝ, W) e (d x t) (K i t (psi x)) let A : (ℝ Γ— W) Γ— (W Γ— W) β†’ ℝ := fun z => (F.connection z.1.1).ricci (ρ z.1.2) (mfderiv π“˜(ℝ, W) (𝓑 n) ρ z.1.2 z.2.1) (mfderiv π“˜(ℝ, W) (𝓑 n) ρ z.1.2 z.2.1) + (F.metric z.1.1).inner (ρ z.1.2) (mfderiv π“˜(ℝ, W) (𝓑 n) ρ z.1.2 z.2.2) (mfderiv π“˜(ℝ, W) (𝓑 n) ρ z.1.2 z.2.2) let B : (ℝ Γ— W) Γ— (W Γ— W) β†’ W := fun z => coordinateHessian (F.connection z.1.1) e (ρ z.1.2) (mfderiv π“˜(ℝ, W) (𝓑 n) ρ z.1.2 z.2.1) (mfderiv π“˜(ℝ, W) (𝓑 n) ρ z.1.2 z.2.2) have htime : Icc tau s βŠ† Icc a b := hslab.trans hc.domain_subset have hric := flow_pullback_ricci_contDiffOn F hU hρ have hmetric := (flow_pullback_metric_hessian_contDiffOn F hU hρ (contMDiff_const (c := (0 : ℝ)))).1 have hfirstMap : ContDiff ℝ ∞ (fun z : (ℝ Γ— W) Γ— (W Γ— W) => (z.1, z.2.1)) := by fun_prop have hsecondMap : ContDiff ℝ ∞ (fun z : (ℝ Γ— W) Γ— (W Γ— W) => (z.1, z.2.2)) := by fun_prop have hAfst := hric.comp (s := (Icc tau s Γ—Λ’ U) Γ—Λ’ univ) hfirstMap.contDiffOn (fun z hz => ⟨⟨htime hz.1.1, hz.1.2⟩, mem_univ _⟩) have hAsnd := hmetric.comp (s := (Icc tau s Γ—Λ’ U) Γ—Λ’ univ) hsecondMap.contDiffOn (fun z hz => ⟨⟨htime hz.1.1, hz.1.2⟩, mem_univ _⟩) have hA : ContDiffOn ℝ ∞ A ((Icc tau s Γ—Λ’ U) Γ—Λ’ univ) := hAfst.add hAsnd have hB : ContDiffOn ℝ ∞ B ((Icc tau s Γ—Λ’ U) Γ—Λ’ univ) := (flow_coordinateHessian_mixed_pullback_contDiffOn F he hU hρ).mono (fun z hz => ⟨⟨htime hz.1.1, hz.1.2⟩, hz.2⟩) have hrec := fixedLabel_embedded_closed_spatial_recurrences F hc hi hat hts hslab hpsi hpos he hU heU hρ hρe change ContinuousOn (fun z : ℝ Γ— ℝ => q z.1 z.2) (univ Γ—Λ’ Icc tau s) ∧ ContinuousOn (fun z : ℝ Γ— ℝ => v z.1 z.2) (univ Γ—Λ’ Icc tau s) ∧ (βˆ€ i, ContinuousOn (fun z : ℝ Γ— ℝ => R i z.1 z.2) (univ Γ—Λ’ Icc tau s)) ∧ (βˆ€ t ∈ Icc tau s, βˆ€ x, HasDerivAt (fun y => q y t) (v x t β€’ R 0 x t) x) ∧ (βˆ€ i, βˆ€ t ∈ Icc tau s, βˆ€ x, HasDerivAt (fun y => R i y t) (v x t β€’ (B ((t, q x t), (R 0 x t, R i x t)) + R (i + 1) x t)) x) at hrec obtain ⟨hq, _hv, hR, hqder, hRder⟩ := hrec have hd : M63C2ShrinkingCurveOn F d J := c2ShrinkingCurve_fixedLabel_comp F hc hpsi hpos hshift have hH := c2ShrinkingCurve_fixedLabel_curvature_contMDiffOn F hc hpsi hpos (hi.interior_jets 0) have hleft := (smooth_retraction_differentials he hU heU hρ hρe).2.2 have hAvalue (t : ℝ) (ht : t ∈ Icc tau s) (x : ℝ) : A ((t, q x t), (R 0 x t, R 1 x t)) = m62TangentRicci F d t x + m62CurvatureSquared F d t x := by have hS := spatialUnitTangent_comp F c ((hc.spatial_regular t (hslab ht)).mdifferentiable (by norm_num) (psi x)) ((hpsi.differentiable (by norm_num) x).hasDerivAt) (hpos x) have hcurv := curvatureVector_comp F c ((hc.spatial_regular t (hslab ht)).mdifferentiable (by norm_num)) (hpsi.differentiable (by norm_num)) hpos ((unitTangent_contMDiff_of_c2 F c (hc.spatial_regular t (hslab ht)) (hc.immersed t (hslab ht)) (psi x)).mdifferentiableAt (by norm_num)) dsimp only [A, q, R] erw [hleft (d x t) (K 0 t (psi x)), hleft (d x t) (K 1 t (psi x)), hρe (d x t)] change (F.connection t).ricci (d x t) (spatialUnitTangent F c t (psi x)) (spatialUnitTangent F c t (psi x)) + (F.metric t).inner (d x t) (m62CurvatureVector F c t (psi x)) (m62CurvatureVector F c t (psi x)) = _ rw [← hS, ← hcurv] rfl have hvformula (x : ℝ) (t : ℝ) (ht : t ∈ Icc tau s) : v x t = v0 * Real.exp (-∫ u in tau..t, A ((u, q x u), (R 0 x u, R 1 x u))) := by have hsub : Icc tau t βŠ† J := fun u hu => hslab ⟨hu.1, hu.2.trans ht.2⟩ have hp := c2ShrinkingCurve_speed_eq_exp_integral F hd hH ht.1 hsub x have hInt : (∫ u in tau..t, A ((u, q x u), (R 0 x u, R 1 x u))) = ∫ u in tau..t, m62TangentRicci F d u x + m62CurvatureSquared F d u x := by apply intervalIntegral.integral_congr intro u hu have hut : u ∈ Icc tau t := by simpa only [uIcc_of_le ht.1] using hu exact hAvalue u ⟨hut.1, hut.2.trans ht.2⟩ x rw [hInt, ← hanchor x] exact hp obtain ⟨Q, V, Rpath, hQvalue, _hVvalue, _hRvalue, hQ, _hV, _hRp⟩ := exists_contDiff_pathFamily_of_normalized_spatial_recurrences hts hU A B hA hB q v R v0 hq hR (fun x t _ => heU (mem_range_self (d x t))) hvformula hqder hRder have hslice (t : Icc tau s) : ContDiff ℝ ∞ (fun x => q x t) := by let ev : C(Icc tau s, W) β†’L[ℝ] W := ContinuousMap.evalCLM ℝ t have heval := ev.contDiff.comp hQ change ContDiff ℝ ∞ (fun x => Q x t) at heval have heq : (fun x => Q x t) = fun x => q x t := funext fun x => hQvalue x t rwa [heq] at heval have hmanifold (t : ℝ) (ht : t ∈ Icc tau s) : ContMDiff π“˜(ℝ, ℝ) (𝓑 n) ∞ (fun x => d x t) := by have hcomp := hρ.comp_contMDiff (hslice ⟨t, ht⟩).contMDiff (fun x => heU (mem_range_self (d x t))) exact hcomp.congr (fun x => (hρe (d x t)).symm) have hjet (k : β„•) (t : Icc tau s) : iteratedDeriv k (fun x => q x t) = fun x => iteratedDeriv k Q x t := by induction k with | zero => simp only [iteratedDeriv_zero] exact funext (fun x => (hQvalue x t).symm) | succ k ih => rw [iteratedDeriv_succ, iteratedDeriv_succ, ih] funext x have hqd := (hQ.differentiable_iteratedDeriv k (ENat.natCast_lt_of_coe_top_le_withTop le_rfl k) x).hasDerivAt exact ((ContinuousMap.evalCLM ℝ t).hasFDerivAt.comp_hasDerivAt x hqd).deriv refine ⟨Q, hQvalue, hQ, hmanifold, ?_⟩ intro k have hpaths : Continuous (fun z : ℝ Γ— ℝ => iteratedDeriv k Q z.1) := (hQ.continuous_iteratedDeriv k (ENat.natCast_le_of_coe_top_le_withTop le_rfl k)).comp continuous_fst have hclamp : Continuous (fun z : ℝ Γ— ℝ => projIcc tau s hts.le z.2) := continuous_projIcc.comp continuous_snd have hcont := continuous_eval.comp (hpaths.prodMk hclamp) apply hcont.continuousOn.congr intro z hz change iteratedDeriv k (fun x => q x z.2) z.1 = iteratedDeriv k Q z.1 (projIcc tau s hts.le z.2) rw [projIcc_of_mem _ hz.2] exact congrFun (hjet k ⟨z.2, hz.2⟩) z.1 end PoincareMT.M63