import PoincareLib.Geometry.RicciFlow.ReducedGeometry.ReducedVolume.Analysis.Distance.CurveCalculus import PoincareLib.Geometry.RicciFlow.ReducedGeometry.ReducedVolume.Regularity.Continuity.MinimizingLifts import Mathlib.Analysis.Calculus.Deriv.Pow /-! # Kinetic energy of a locally smooth curve The energy is the selected metric evaluated on the actual curve velocity. Its continuity is local on the smooth parameter domain. Reparametrization by square time is handled directly by the manifold chain rule. -/ set_option autoImplicit false open Set Filter Bundle open scoped Manifold ContDiff Topology universe u namespace PoincareMT.ReducedVolume variable {n : β„•} {M : Type u} [TopologicalSpace M] [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] [IsManifold (𝓑 n) ∞ M] set_option backward.isDefEq.respectTransparency false in /-- The actual kinetic energy is continuous on an open smooth curve domain. -/ theorem curve_energy_continuousOn (g : RiemannianMetric n M) {Ξ³ : ℝ β†’ M} {U : Set ℝ} (hU : IsOpen U) (hΞ³ : ContMDiffOn (π“˜(ℝ, ℝ)) (𝓑 n) 1 Ξ³ U) : ContinuousOn (fun s ↦ g.inner (Ξ³ s) (curveVelocity Ξ³ s) (curveVelocity Ξ³ s)) U := by let : Bundle.RiemannianBundle (TangentSpace (𝓑 n) : M β†’ Type _) := ⟨g.toRiemannianMetric⟩ let : IsContinuousRiemannianBundle (EuclideanSpace ℝ (Fin n)) (TangentSpace (𝓑 n) : M β†’ Type _) := ⟨⟨g.inner, g.toContinuousRiemannianMetric.continuous, fun _ _ _ ↦ rfl⟩⟩ have hsection : Continuous (fun t : ℝ ↦ (⟨t, (1 : ℝ)⟩ : TangentBundle (π“˜(ℝ, ℝ)) ℝ)) := (tangentBundleModelSpaceHomeomorph (π“˜(ℝ, ℝ))).symm.continuous.comp (continuous_id.prodMk continuous_const) have hD := hΞ³.continuousOn_tangentMapWithin le_rfl hU.uniqueMDiffOn have hv : ContinuousOn (fun t : ℝ ↦ (⟨γ t, mfderivWithin (π“˜(ℝ, ℝ)) (𝓑 n) Ξ³ U t 1⟩ : TangentBundle (𝓑 n) M)) U := hD.comp hsection.continuousOn (fun _ ht ↦ ht) apply (hv.inner_bundle hv).congr intro s hs change g.inner (Ξ³ s) (curveVelocity Ξ³ s) (curveVelocity Ξ³ s) = _ simp only [curveVelocity, mfderivWithin_of_mem_nhds (hU.mem_nhds hs)] rfl /-- The actual metric energy depends only on the curve germ. -/ theorem curve_energy_eq_of_eventuallyEq (g : RiemannianMetric n M) {Ξ³ Ξ· : ℝ β†’ M} {s : ℝ} (h : Ξ³ =αΆ [𝓝 s] Ξ·) : g.inner (Ξ³ s) (curveVelocity Ξ³ s) (curveVelocity Ξ³ s) = g.inner (Ξ· s) (curveVelocity Ξ· s) (curveVelocity Ξ· s) := by unfold curveVelocity rw [h.mfderiv_eq (I := π“˜(ℝ, ℝ)) (I' := 𝓑 n), h.eq_of_nhds] set_option backward.isDefEq.respectTransparency false in /-- Squaring the parameter multiplies actual kinetic energy by four times parameter squared. -/ theorem curve_energy_comp_square (g : RiemannianMetric n M) {Ξ³ : ℝ β†’ M} {s : ℝ} (hΞ³ : MDifferentiableAt (π“˜(ℝ, ℝ)) (𝓑 n) Ξ³ (s ^ 2)) : g.inner (Ξ³ (s ^ 2)) (curveVelocity (fun r : ℝ ↦ Ξ³ (r ^ 2)) s) (curveVelocity (fun r : ℝ ↦ Ξ³ (r ^ 2)) s) = (2 * s) ^ 2 * g.inner (Ξ³ (s ^ 2)) (curveVelocity Ξ³ (s ^ 2)) (curveVelocity Ξ³ (s ^ 2)) := by have hsq : HasDerivAt (fun r : ℝ ↦ r ^ 2) (2 * s) s := by simpa using hasDerivAt_pow 2 s have hc := mfderiv_comp (f := fun r : ℝ ↦ r ^ 2) s hΞ³ hsq.differentiableAt.mdifferentiableAt simp only [Function.comp_def] at hc unfold curveVelocity rw [hc, mfderiv_eq_fderiv, hsq.hasFDerivAt.fderiv] have hv : mfderiv (π“˜(ℝ, ℝ)) (𝓑 n) Ξ³ (s ^ 2) (2 * s) = (2 * s) β€’ mfderiv (π“˜(ℝ, ℝ)) (𝓑 n) Ξ³ (s ^ 2) 1 := by simpa only [smul_eq_mul, mul_one] using (mfderiv (π“˜(ℝ, ℝ)) (𝓑 n) Ξ³ (s ^ 2)).map_smul (2 * s) (1 : ℝ) simp only [ContinuousLinearMap.comp_apply] change g.inner (Ξ³ (s ^ 2)) (mfderiv (π“˜(ℝ, ℝ)) (𝓑 n) Ξ³ (s ^ 2) (1 * (2 * s))) (mfderiv (π“˜(ℝ, ℝ)) (𝓑 n) Ξ³ (s ^ 2) (1 * (2 * s))) = _ rw [one_mul, hv] simp only [map_smul, smul_apply, smul_eq_mul] ring end PoincareMT.ReducedVolume