import PoincareLib.Geometry.CurveShortening.Comparison.AnnularEvolution.Finite.ParameterJets import PoincareLib.Geometry.CurveShortening.Comparison.AnnularEvolution.Modulus.MovingMetricDerivative /-! The genuine moving-metric derivative for a C1 parameter map. An affine parameter replacement preserves every time-dependent first jet at the given source point. Source: MT Lemma 19.15, pp. 447-449; finite-conormal-variation derivation. -/ noncomputable section set_option autoImplicit false set_option warningAsError true set_option backward.isDefEq.respectTransparency false open Set Filter open scoped Manifold ContDiff Topology namespace PoincareMT variable {E : Type*} [NormedAddCommGroup E] [NormedSpace โ„ E] {n : โ„•} {M : Type*} [TopologicalSpace M] [ChartedSpace (EuclideanSpace โ„ (Fin n)) M] [IsManifold (๐“ก n) โˆž M] {a b : โ„} /-- The actual moving metric contributes precisely the two weighted Ricci contractions, even for a merely differentiable parameter map. Source: Morgan--Tian (2007), Lemma 19.15 and Corollary 19.16, pp. 447-449; project derivation `proof-work/tasks/M64/reports/2026-09-27-annulus-energy-and-finite-variation-derivation.md`. -/ theorem m64ParameterAnnulus_moving_metric_energy_hasDerivAt (F : RicciFlow n M (Icc a b)) (r : โ„) {t : โ„} (ht : t โˆˆ Ioo a b) {Phi : โ„ ร— E โ†’ M} {O : Set (โ„ ร— E)} (hO : IsOpen O) (hPhi : ContMDiffOn ๐“˜(โ„, โ„ ร— E) (๐“ก n) โˆž Phi O) {h : LoopPlane โ†’ E} {p : LoopPlane} (hh : DifferentiableAt โ„ h p) (hp : (0, h p) โˆˆ O) : let v := fun s q => Phi (s, h q) let d := mfderiv (๐“ก 2) (๐“ก n) (v 0) p HasDerivAt (fun s => m64ModulusEnergyDensity (F.metric (t + s)) r (v s) p) (deriv (fun s => m64ModulusEnergyDensity (F.metric t) r (v s) p) 0 - r * (F.connection t).ricci (v 0 p) (d (EuclideanSpace.basisFun (Fin 2) โ„ 0)) (d (EuclideanSpace.basisFun (Fin 2) โ„ 0)) - rโปยน * (F.connection t).ricci (v 0 p) (d (EuclideanSpace.basisFun (Fin 2) โ„ 1)) (d (EuclideanSpace.basisFun (Fin 2) โ„ 1))) 0 := by let H := fun q : LoopPlane => h p + fderiv โ„ h p (q - p) have hHp : H p = h p := by simp [H] have hH : HasFDerivAt H (fderiv โ„ h p) p := by simpa only [H, ContinuousLinearMap.comp_id, Function.comp_def, id_eq] using! (((fderiv โ„ h p).hasFDerivAt.comp p ((hasFDerivAt_id p).sub_const p)).const_add (h p)) have hHs : ContDiff โ„ โˆž H := by dsimp only [H]; fun_prop let v := fun s q => Phi (s, h q) let w := fun s q => Phi (s, H q) have hproxy : ContMDiffAt ๐“˜(โ„, โ„ ร— LoopPlane) (๐“ก n) โˆž (fun q => w q.1 q.2) (0, p) := by have heq : ((0 : โ„), H p) = (0, h p) := Prod.ext rfl hHp exact (heq.symm โ–ธ hPhi.contMDiffAt (hO.mem_nhds hp)).comp (0, p) ((contDiffAt_fst.prodMk (hHs.contDiffAt.comp (0, p) contDiffAt_snd)).contMDiffAt) have hnear : โˆ€แถ  s in ๐“ (0 : โ„), (s, h p) โˆˆ O := (continuous_id.prodMk continuous_const).continuousAt (hO.mem_nhds hp) have heq (g : RiemannianMetric n M) (s : โ„) (hs : (s, h p) โˆˆ O) : m64ModulusEnergyDensity g r (v s) p = m64ModulusEnergyDensity g r (w s) p := m64ParameterAnnulus_energy_eq_of_firstJet g r ((hPhi.contMDiffAt (hO.mem_nhds hs)).mdifferentiableAt (by simp)) hh hH.differentiableAt hHp.symm hH.fderiv.symm have hfixed : (fun s => m64ModulusEnergyDensity (F.metric t) r (v s) p) =แถ [๐“ 0] fun s => m64ModulusEnergyDensity (F.metric t) r (w s) p := hnear.mono fun s hs => heq (F.metric t) s hs have hmove : (fun s => m64ModulusEnergyDensity (F.metric (t + s)) r (v s) p) =แถ [๐“ 0] fun s => m64ModulusEnergyDensity (F.metric (t + s)) r (w s) p := hnear.mono fun s hs => heq (F.metric (t + s)) s hs have hcol (d : LoopPlane) : mfderiv (๐“ก 2) (๐“ก n) (w 0) p d = mfderiv (๐“ก 2) (๐“ก n) (v 0) p d := (m64ParameterAnnulus_differential_eq_of_firstJet ((hPhi.contMDiffAt (hO.mem_nhds hp)).mdifferentiableAt (by simp)) hh hH.differentiableAt hHp.symm hH.fderiv.symm d).symm have hric (i : Fin 2) : (F.connection t).ricci (w 0 p) (mfderiv (๐“ก 2) (๐“ก n) (w 0) p (EuclideanSpace.basisFun (Fin 2) โ„ i)) (mfderiv (๐“ก 2) (๐“ก n) (w 0) p (EuclideanSpace.basisFun (Fin 2) โ„ i)) = (F.connection t).ricci (v 0 p) (mfderiv (๐“ก 2) (๐“ก n) (v 0) p (EuclideanSpace.basisFun (Fin 2) โ„ i)) (mfderiv (๐“ก 2) (๐“ก n) (v 0) p (EuclideanSpace.basisFun (Fin 2) โ„ i)) := by have hdata : (w 0 p, (mfderiv (๐“ก 2) (๐“ก n) (w 0) p (EuclideanSpace.basisFun (Fin 2) โ„ i) : EuclideanSpace โ„ (Fin n))) = (v 0 p, (mfderiv (๐“ก 2) (๐“ก n) (v 0) p (EuclideanSpace.basisFun (Fin 2) โ„ i) : EuclideanSpace โ„ (Fin n))) := Prod.ext (congrArg (fun q => Phi (0, q)) hHp) (hcol _) exact congrArg (fun q : M ร— EuclideanSpace โ„ (Fin n) => (F.connection t).ricci q.1 q.2 q.2) hdata have hd := m64ModulusAnnulus_moving_metric_energy_hasDerivAt F r ht p hproxy apply (hd.congr_of_eventuallyEq hmove).congr_deriv change deriv (fun s => m64ModulusEnergyDensity (F.metric t) r (w s) p) 0 - r * (F.connection t).ricci (w 0 p) (mfderiv (๐“ก 2) (๐“ก n) (w 0) p (EuclideanSpace.basisFun (Fin 2) โ„ 0)) (mfderiv (๐“ก 2) (๐“ก n) (w 0) p (EuclideanSpace.basisFun (Fin 2) โ„ 0)) - rโปยน * (F.connection t).ricci (w 0 p) (mfderiv (๐“ก 2) (๐“ก n) (w 0) p (EuclideanSpace.basisFun (Fin 2) โ„ 1)) (mfderiv (๐“ก 2) (๐“ก n) (w 0) p (EuclideanSpace.basisFun (Fin 2) โ„ 1)) = _ rw [hric 0, hric 1, โ† hfixed.deriv_eq] end PoincareMT