import PoincareLib.Geometry.RicciFlow.Harnack.Basic import Mathlib.Analysis.Calculus.TangentCone.Real import Mathlib.Geometry.Manifold.ContMDiffMFDeriv import Mathlib.Geometry.Manifold.VectorBundle.Hom /-! # Energy regularity of manifold paths The spacetime energy integrates squared speed in the evolving metric and uses the ambient derivative. For a path that is C1 on a closed interval, the within-interval squared-speed integrand is continuous, and the ambient integrand agrees with it on the interior. This suffices for integrability; ambient continuity is asserted only on the open interval. These regularity lemmas support the path-energy integral in the proof of Morgan--Tian, Theorem 4.40. That proof then bounds the evolving-metric energy using a geodesic for the initial metric; this file does not make that comparison. Reference: *Ricci Flow and the Poincare Conjecture*, arXiv:math/0607607v2 (2007), Chapter 4, Section 5.2, proof of Theorem 4.40, p. 106. -/ set_option autoImplicit false open Set MeasureTheory open scoped Manifold ContDiff Bundle intervalIntegral universe u namespace Poincare.Geometry.RicciFlow.Harnack variable {n : β„•} {M : Type u} [TopologicalSpace M] [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] [IsManifold (𝓑 n) ∞ M] {J : Set ℝ} theorem continuousOn_spacetimeEnergyWithin_integrand (F : PoincareMT.RicciFlow n M J) {a b : ℝ} (hab : a < b) (hJ : Icc a b βŠ† J) (Ξ³ : ℝ β†’ M) (hΞ³ : ContMDiffOn (π“˜(ℝ, ℝ)) (𝓑 n) 1 Ξ³ (Icc a b)) : ContinuousOn (fun t ↦ (F.metric t).inner (Ξ³ t) (mfderivWithin (π“˜(ℝ, ℝ)) (𝓑 n) Ξ³ (Icc a b) t 1) (mfderivWithin (π“˜(ℝ, ℝ)) (𝓑 n) Ξ³ (Icc a b) t 1)) (Icc a b) := by have htangent := hΞ³.contMDiffOn_tangentMapWithin (m := 0) (by simp) (uniqueDiffOn_Icc hab).uniqueMDiffOn have hunit : ContMDiffOn (π“˜(ℝ, ℝ)) ((π“˜(ℝ, ℝ)).prod (π“˜(ℝ, ℝ))) 0 (fun t : ℝ ↦ (⟨t, 1⟩ : TangentBundle (π“˜(ℝ, ℝ)) ℝ)) (Icc a b) := by intro t ht simp only [Bundle.contMDiffWithinAt_totalSpace, trivializationAt_model_space_apply] exact ⟨contMDiffWithinAt_id, contMDiffWithinAt_const⟩ have hv := htangent.comp hunit (fun t ht ↦ ht) have hg := (F.smooth.of_le (show (0 : WithTop β„•βˆž) ≀ ∞ from by simp)).comp (contMDiffOn_id.prodMk (hΞ³.of_le (by simp))) (fun t ht ↦ ⟨hJ ht, mem_univ (Ξ³ t)⟩) have heval := hg.clm_bundle_applyβ‚‚ (F₃ := ℝ) (E₃ := Bundle.Trivial M ℝ) hv hv intro t ht have hpoint := heval t ht simp only [Bundle.contMDiffWithinAt_totalSpace] at hpoint exact hpoint.2.continuousWithinAt theorem spacetimeEnergyWithin_integrand_eqOn (F : PoincareMT.RicciFlow n M J) (Ξ³ : ℝ β†’ M) (a b : ℝ) : EqOn (fun t ↦ (F.metric t).inner (Ξ³ t) (mfderivWithin (π“˜(ℝ, ℝ)) (𝓑 n) Ξ³ (Icc a b) t 1) (mfderivWithin (π“˜(ℝ, ℝ)) (𝓑 n) Ξ³ (Icc a b) t 1)) (fun t ↦ (F.metric t).inner (Ξ³ t) (mfderiv (π“˜(ℝ, ℝ)) (𝓑 n) Ξ³ t 1) (mfderiv (π“˜(ℝ, ℝ)) (𝓑 n) Ξ³ t 1)) (Ioo a b) := by intro t ht dsimp only rw [mfderivWithin_of_mem_nhds (I := π“˜(ℝ, ℝ)) (I' := 𝓑 n) (Icc_mem_nhds ht.1 ht.2)] theorem intervalIntegrable_spacetimeEnergy_integrand (F : PoincareMT.RicciFlow n M J) {a b : ℝ} (hab : a < b) (hJ : Icc a b βŠ† J) (Ξ³ : ℝ β†’ M) (hΞ³ : ContMDiffOn (π“˜(ℝ, ℝ)) (𝓑 n) 1 Ξ³ (Icc a b)) : IntervalIntegrable (fun t ↦ (F.metric t).inner (Ξ³ t) (mfderiv (π“˜(ℝ, ℝ)) (𝓑 n) Ξ³ t 1) (mfderiv (π“˜(ℝ, ℝ)) (𝓑 n) Ξ³ t 1)) volume a b := by have hc := continuousOn_spacetimeEnergyWithin_integrand F hab hJ Ξ³ hΞ³ apply (hc.intervalIntegrable_of_Icc hab.le).congr_uIoo rw [uIoo_of_le hab.le] exact spacetimeEnergyWithin_integrand_eqOn F Ξ³ a b theorem continuousOn_spacetimeEnergy_integrand (F : PoincareMT.RicciFlow n M J) {a b : ℝ} (hab : a < b) (hJ : Icc a b βŠ† J) (Ξ³ : ℝ β†’ M) (hΞ³ : ContMDiffOn (π“˜(ℝ, ℝ)) (𝓑 n) 1 Ξ³ (Icc a b)) : ContinuousOn (fun t ↦ (F.metric t).inner (Ξ³ t) (mfderiv (π“˜(ℝ, ℝ)) (𝓑 n) Ξ³ t 1) (mfderiv (π“˜(ℝ, ℝ)) (𝓑 n) Ξ³ t 1)) (Ioo a b) := by have hc := continuousOn_spacetimeEnergyWithin_integrand F hab hJ Ξ³ hΞ³ exact (hc.mono Ioo_subset_Icc_self).congr (spacetimeEnergyWithin_integrand_eqOn F Ξ³ a b).symm end Poincare.Geometry.RicciFlow.Harnack