import PoincareLib.Geometry.RicciFlow.ReducedGeometry.LGeometry.Basic import Mathlib.Analysis.Calculus.Deriv.Pow import Mathlib.MeasureTheory.Integral.IntervalIntegral.IntegrationByParts import Mathlib.Tactic.Ring /-! Adapted from Mapher `PoincareMT/Proofs/M08/RegularizedAction.lean` at `f927d9e1f0810042766d3b5f64d3f4da02ee93cc`. -/ /-! # The action in square-root time The change of variables is valid for every admissible backward path with a smooth square-root representative, including a nonzero initial square-root velocity at backward time zero. -/ set_option autoImplicit false set_option backward.isDefEq.respectTransparency false open scoped Manifold ContDiff Bundle Topology intervalIntegral universe u namespace PoincareMT.LGeometry variable {n : β„•} {M : Type u} [TopologicalSpace M] [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] [IsManifold (𝓑 n) ∞ M] /-- The nonsingular Lagrangian after the substitution `Ο„ = sΒ²`. -/ noncomputable def regularizedLIntegrand {J : Set ℝ} (F : RicciFlow n M J) (T : ℝ) (Ξ± : ℝ β†’ M) (s : ℝ) : ℝ := 2 * s ^ 2 * (F.connection (T - s ^ 2)).scalarCurvature (Ξ± s) + (1 / 2 : ℝ) * (F.metric (T - s ^ 2)).inner (Ξ± s) (curveVelocity (n := n) Ξ± s) (curveVelocity (n := n) Ξ± s) /-- The regular action on the closed square-root parameter interval. -/ noncomputable def regularizedLAction {J : Set ℝ} (F : RicciFlow n M J) (T τ₁ Ο„β‚‚ : ℝ) (Ξ± : ℝ β†’ M) : ℝ := ∫ s in Real.sqrt τ₁..Real.sqrt Ο„β‚‚, regularizedLIntegrand F T Ξ± s /-- Interior square-root parameters correspond to positive interior backward times. -/ theorem sq_mem_backward_interior {τ₁ Ο„β‚‚ s : ℝ} (hτ₁ : 0 ≀ τ₁) (hs : s ∈ Set.Ioo (Real.sqrt τ₁) (Real.sqrt Ο„β‚‚)) : 0 < s ∧ s ^ 2 ∈ Set.Ioo τ₁ Ο„β‚‚ := by have hpos : 0 < s := (Real.sqrt_nonneg τ₁).trans_lt hs.1 refine ⟨hpos, Real.lt_sq_of_sqrt_lt hs.1, ?_⟩ exact (Real.lt_sqrt hpos.le).mp hs.2 /-- The ordinary tangent velocity obeys the chain rule for squaring. -/ theorem curveVelocity_comp_sq {Ξ³ : ℝ β†’ M} {s : ℝ} (hΞ³ : MDifferentiableAt (π“˜(ℝ, ℝ)) (𝓑 n) Ξ³ (s ^ 2)) : curveVelocity (n := n) (fun r ↦ Ξ³ (r ^ 2)) s = (2 * s) β€’ curveVelocity (n := n) Ξ³ (s ^ 2) := by have hsq : HasDerivAt (fun r : ℝ ↦ r ^ 2) (2 * s) s := by simpa using hasDerivAt_pow 2 s have hsqmf_apply : mfderiv (π“˜(ℝ, ℝ)) (π“˜(ℝ, ℝ)) (fun r : ℝ ↦ r ^ 2) s 1 = 2 * s := by have hm := hsq.hasFDerivAt.hasMFDerivAt.mfderiv have hv := congrArg (fun L : TangentSpace (π“˜(ℝ, ℝ)) s β†’L[ℝ] TangentSpace (π“˜(ℝ, ℝ)) (s ^ 2) ↦ L 1) hm change (mfderiv (π“˜(ℝ, ℝ)) (π“˜(ℝ, ℝ)) (fun r : ℝ ↦ r ^ 2) s) (1 : ℝ) = (ContinuousLinearMap.toSpanSingleton ℝ (2 * s)) (1 : ℝ) at hv simpa only [ContinuousLinearMap.toSpanSingleton_apply, one_smul] using hv change (mfderiv (π“˜(ℝ, ℝ)) (𝓑 n) (Ξ³ ∘ fun r : ℝ ↦ r ^ 2) s) 1 = _ have hchain := mfderiv_comp_apply s (f := fun r : ℝ ↦ r ^ 2) (g := Ξ³) hΞ³ hsq.differentiableAt.mdifferentiableAt (1 : TangentSpace (π“˜(ℝ, ℝ)) s) have hinput : mfderiv (π“˜(ℝ, ℝ)) (π“˜(ℝ, ℝ)) (fun r : ℝ ↦ r ^ 2) s 1 = (2 * s) β€’ (1 : TangentSpace (π“˜(ℝ, ℝ)) s) := by rw [hsqmf_apply] simp rw [hinput, map_smul] at hchain simpa only [curveVelocity, Function.comp_apply] using hchain /-- The representative velocity is twice the square-root parameter times the path velocity. -/ theorem sqrtRegularPath_velocity {J : Set ℝ} {F : RicciFlow n M J} {T τ₁ Ο„β‚‚ : ℝ} {p : BackwardTimePath F T τ₁ Ο„β‚‚} (R : SqrtRegularPath p) {s : ℝ} (hs : s ∈ Set.Ioo (Real.sqrt τ₁) (Real.sqrt Ο„β‚‚)) : curveVelocity (n := n) R.curve s = (2 * s) β€’ curveVelocity (n := n) p.curve (s ^ 2) := by have hΟ„ := (sq_mem_backward_interior p.nonnegative hs).2 have hbase : R.curve s = p.curve (s ^ 2) := R.agrees s ⟨hs.1.le, hs.2.le⟩ have hnear : R.curve =αΆ [𝓝 s] fun r ↦ p.curve (r ^ 2) := Filter.eventually_of_mem (Ioo_mem_nhds hs.1 hs.2) (fun r hr ↦ R.agrees r ⟨hr.1.le, hr.2.le⟩) have hΞ³ := (p.regular (s ^ 2) hΟ„).contMDiffAt (Ioo_mem_nhds hΟ„.1 hΟ„.2) have hvel : curveVelocity (n := n) R.curve s = curveVelocity (n := n) (fun r ↦ p.curve (r ^ 2)) s := by unfold curveVelocity rw [hnear.mfderiv_eq] rfl exact hvel.trans (curveVelocity_comp_sq (hΞ³.mdifferentiableAt one_ne_zero)) /-- The transformed integrands agree away from the two endpoints. -/ theorem regularizedLIntegrand_eq_transformed {J : Set ℝ} {F : RicciFlow n M J} {T τ₁ Ο„β‚‚ : ℝ} {p : BackwardTimePath F T τ₁ Ο„β‚‚} (R : SqrtRegularPath p) {s : ℝ} (hs : s ∈ Set.Ioo (Real.sqrt τ₁) (Real.sqrt Ο„β‚‚)) : regularizedLIntegrand F T R.curve s = backwardLIntegrand F T p.curve (s ^ 2) * (2 * s) := by have hpos := (sq_mem_backward_interior p.nonnegative hs).1 have hbase := R.agrees s ⟨hs.1.le, hs.2.le⟩ have hvel := sqrtRegularPath_velocity R hs unfold regularizedLIntegrand backwardLIntegrand rw [Real.sqrt_sq hpos.le] rw [hbase] simp only [hvel, map_smul, smul_apply, smul_eq_mul] ring /-- Squaring transports the action integral even when the original integrand is singular at zero. -/ theorem backwardLLength_eq_transformed {J : Set ℝ} {F : RicciFlow n M J} {T τ₁ Ο„β‚‚ : ℝ} (p : BackwardTimePath F T τ₁ Ο„β‚‚) : backwardLLength F T τ₁ Ο„β‚‚ p.curve = ∫ s in Real.sqrt τ₁..Real.sqrt Ο„β‚‚, backwardLIntegrand F T p.curve (s ^ 2) * (2 * s) := by have hle := Real.sqrt_le_sqrt p.ordered.le have hsub := intervalIntegral.integral_comp_mul_deriv_of_deriv_nonneg (a := Real.sqrt τ₁) (b := Real.sqrt Ο„β‚‚) (f := fun s : ℝ ↦ s ^ 2) (f' := fun s ↦ 2 * s) (g := backwardLIntegrand F T p.curve) (continuous_id.pow 2).continuousOn (fun s _ ↦ by simpa using hasDerivAt_pow 2 s) (fun s hs ↦ by rw [min_eq_left hle, max_eq_right hle] at hs exact mul_nonneg (by norm_num) ((Real.sqrt_nonneg τ₁).trans hs.1.le)) simpa only [Real.sq_sqrt p.nonnegative, Real.sq_sqrt (p.nonnegative.trans p.ordered.le), Function.comp_def, backwardLLength] using hsub.symm /-- The regular action is the frozen backward L-length. -/ theorem regularizedLAction_eq_backwardLLength {J : Set ℝ} {F : RicciFlow n M J} {T τ₁ Ο„β‚‚ : ℝ} {p : BackwardTimePath F T τ₁ Ο„β‚‚} (R : SqrtRegularPath p) : regularizedLAction F T τ₁ Ο„β‚‚ R.curve = backwardLLength F T τ₁ Ο„β‚‚ p.curve := by rw [backwardLLength_eq_transformed p] exact intervalIntegral.integral_congr_Ioo_of_le (Real.sqrt_le_sqrt p.ordered.le) (fun _ hs ↦ regularizedLIntegrand_eq_transformed R hs) /-- The regular action density inherits integrability from the admissible backward path. -/ theorem regularizedLIntegrand_intervalIntegrable {J : Set ℝ} {F : RicciFlow n M J} {T τ₁ Ο„β‚‚ : ℝ} {p : BackwardTimePath F T τ₁ Ο„β‚‚} (R : SqrtRegularPath p) : IntervalIntegrable (regularizedLIntegrand F T R.curve) MeasureTheory.volume (Real.sqrt τ₁) (Real.sqrt Ο„β‚‚) := by have hle := Real.sqrt_le_sqrt p.ordered.le have hiff := intervalIntegral.integrable_comp_mul_deriv_iff_of_deriv_nonneg (a := Real.sqrt τ₁) (b := Real.sqrt Ο„β‚‚) (f := fun s : ℝ ↦ s ^ 2) (f' := fun s ↦ 2 * s) (g := backwardLIntegrand F T p.curve) (continuous_id.pow 2).continuousOn (fun s _ ↦ by simpa using hasDerivAt_pow 2 s) (fun s hs ↦ by rw [min_eq_left hle, max_eq_right hle] at hs exact mul_nonneg (by norm_num) ((Real.sqrt_nonneg τ₁).trans hs.1.le)) have htrans : IntervalIntegrable (fun s ↦ backwardLIntegrand F T p.curve (s ^ 2) * (2 * s)) MeasureTheory.volume (Real.sqrt τ₁) (Real.sqrt Ο„β‚‚) := by apply hiff.mpr simpa only [Real.sq_sqrt p.nonnegative, Real.sq_sqrt (p.nonnegative.trans p.ordered.le)] using p.l_integrable apply htrans.congr_uIoo intro s hs rw [Set.uIoo_of_le hle] at hs exact (regularizedLIntegrand_eq_transformed R hs).symm end PoincareMT.LGeometry