import PoincareLib.Geometry.CurveShortening.Ramp.LocalFlow.Initial.ArclengthGauge import Mathlib.Topology.Algebra.GroupWithZero /-! # Unit initial speed on the physical length period Rescaling the normalized initial arclength label gives the actual length as physical period and principal coefficient one. MT2007 Claim 19.1, p. 437 and Lemma 19.6, pp. 441-442; contract review block 8 and `2026-09-21-unit-speed-initial-period.md`. -/ set_option autoImplicit false open Set open scoped Manifold ContDiff universe u namespace PoincareMT.M63 variable {n : β„•} {M : Type u} [TopologicalSpace M] [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] [IsManifold (𝓑 n) ∞ M] {a b : ℝ} /-- The actual initial speed primitive gives a C2 unit-speed parameter with physical period equal to the metric length. MT2007 Claim 19.1, p. 437 and Lemma 19.6, pp. 441-442; unit-speed initial-period derivation. The unequal forward and inverse period shifts are explicit. -/ theorem exists_c2_unit_speed_parameter (F : RicciFlow n M (Icc a b)) (gamma : ℝ β†’ M) (t : ℝ) (hperiod : Function.Periodic gamma curvePeriod) (hgamma : ContMDiff π“˜(ℝ, ℝ) (𝓑 n) 2 gamma) (himm : βˆ€ x, curveVelocity (n := n) gamma x β‰  0) : let v := curveSpeed F (fun x _ => gamma x) t let ell := ∫ x in (0 : ℝ)..curvePeriod, v x 0 < ell ∧ βˆƒ sigma : ℝ β‰ƒβ‚œ ℝ, (βˆ€ x, sigma x = ∫ y in (0 : ℝ)..x, v y) ∧ ContDiff ℝ 2 (sigma : ℝ β†’ ℝ) ∧ ContDiff ℝ 2 (sigma.symm : ℝ β†’ ℝ) ∧ sigma 0 = 0 ∧ (βˆ€ x, 0 < deriv sigma x) ∧ (βˆ€ y, 0 < deriv sigma.symm y) ∧ (βˆ€ x, sigma (x + curvePeriod) = sigma x + ell) ∧ (βˆ€ y, sigma.symm (y + ell) = sigma.symm y + curvePeriod) ∧ Function.Periodic (fun y => gamma (sigma.symm y)) ell ∧ ContMDiff π“˜(ℝ, ℝ) (𝓑 n) 2 (fun y => gamma (sigma.symm y)) ∧ (βˆ€ y, curveVelocity (n := n) (fun z => gamma (sigma.symm z)) y β‰  0) ∧ (βˆ€ y, curveSpeed F (fun z _ => gamma (sigma.symm z)) t y = 1) ∧ (βˆ€ y, (curveSpeed F (fun z _ => gamma (sigma.symm z)) t y ^ 2)⁻¹ = 1) ∧ βˆ€ x, gamma (sigma.symm (sigma x)) = gamma x := by let v := curveSpeed F (fun x _ => gamma x) t let ell := ∫ x in (0 : ℝ)..curvePeriod, v x have hp : 0 < curvePeriod := Real.two_pi_pos obtain ⟨hell, phi, hformula, hphi, hinv, hzero, hdpos, hinvpos, hshift, hinvshift, _, hq, _, hspeed, _⟩ := exists_c2_constant_speed_relabeling F gamma t hperiod hgamma himm change 0 < ell at hell change βˆ€ x, phi x = (curvePeriod / ell) * ∫ y in (0 : ℝ)..x, v y at hformula change βˆ€ y, curveSpeed F (fun z _ => gamma (phi.symm z)) t y = ell / curvePeriod at hspeed let c : ℝ := ell / curvePeriod have hc : 0 < c := div_pos hell hp let sigma : ℝ β‰ƒβ‚œ ℝ := phi.trans (Homeomorph.mulLeftβ‚€ c hc.ne') have hsig (x : ℝ) : sigma x = c * phi x := rfl have hsigInv (y : ℝ) : sigma.symm y = phi.symm ((curvePeriod / ell) * y) := by change phi.symm (c⁻¹ * y) = _ dsimp only [c] rw [inv_div] have hsigFun : (sigma : ℝ β†’ ℝ) = fun x => c * phi x := funext hsig have hsigInvFun : (sigma.symm : ℝ β†’ ℝ) = fun y => phi.symm ((curvePeriod / ell) * y) := funext hsigInv have hscale : 0 < curvePeriod / ell := div_pos hp hell have hsigReg : ContDiff ℝ 2 (sigma : ℝ β†’ ℝ) := by rw [hsigFun] exact contDiff_const.mul hphi have hsigInvReg : ContDiff ℝ 2 (sigma.symm : ℝ β†’ ℝ) := by rw [hsigInvFun] exact hinv.comp (contDiff_const.mul contDiff_id) have hsigPos (x : ℝ) : 0 < deriv sigma x := by have hd := ((hphi.differentiable (by norm_num) x).hasDerivAt.const_mul c) rw [hsigFun, hd.deriv] exact mul_pos hc (hdpos x) have hsigInvPos (y : ℝ) : 0 < deriv sigma.symm y := by have hd := ((hinv.differentiable (by norm_num) ((curvePeriod / ell) * y)).hasDerivAt).comp y ((hasDerivAt_id y).const_mul (curvePeriod / ell)) simp only [Function.comp_def, mul_one] at hd rw [hsigInvFun, hd.deriv] exact mul_pos (hinvpos _) hscale have hsigShift (x : ℝ) : sigma (x + curvePeriod) = sigma x + ell := by rw [hsig, hshift, hsig] dsimp only [c] field_simp have hsigInvShift (y : ℝ) : sigma.symm (y + ell) = sigma.symm y + curvePeriod := by rw [hsigInv, hsigInv] have heq : (curvePeriod / ell) * (y + ell) = (curvePeriod / ell) * y + curvePeriod := by field_simp [hell.ne'] rw [heq, hinvshift] have hnewSpeed (y : ℝ) : curveSpeed F (fun z _ => gamma (sigma.symm z)) t y = 1 := by simp only [hsigInvFun] calc _ = (curvePeriod / ell) * curveSpeed F (fun z _ => gamma (phi.symm z)) t ((curvePeriod / ell) * y) := curveSpeed_comp F (fun z _ => gamma (phi.symm z)) (hq.mdifferentiable (by norm_num) _) (by simpa only [id_eq, mul_one] using (hasDerivAt_id y).const_mul (curvePeriod / ell)) hscale.le _ = 1 := by rw [hspeed]; field_simp [hell.ne'] refine ⟨hell, sigma, ?_, hsigReg, hsigInvReg, ?_, hsigPos, hsigInvPos, hsigShift, hsigInvShift, ?_, hgamma.comp hsigInvReg.contMDiff, ?_, hnewSpeed, ?_, ?_⟩ Β· intro x change sigma x = ∫ y in (0 : ℝ)..x, v y rw [hsig, hformula] dsimp only [c] field_simp Β· rw [hsig, hzero, mul_zero] Β· intro y dsimp only rw [hsigInvShift, hperiod] Β· intro y rw [curveVelocity_comp (hgamma.mdifferentiable (by norm_num) _) ((hsigInvReg.differentiable (by norm_num) y).hasDerivAt)] exact smul_ne_zero (hsigInvPos y).ne' (himm _) Β· intro y rw [hnewSpeed] norm_num Β· intro x rw [sigma.symm_apply_apply] end PoincareMT.M63