import PoincareLib.Geometry.Spacetime.Interval.RealTime import Mathlib.Analysis.Calculus.MeanValue import Mathlib.Geometry.Manifold.MFDeriv.FDeriv /-! Adapted from Mapher `PoincareMT/Proofs/M15/Lemma8_7_IntervalCalculus.lean` at `0c5d5c4e1ecbc12703b1994e226df1b15d2e8d39`. See the source mapping in `references/ricci-flow/mapher/noncollapse/import.json`. -/ /-! # Endpoint calculus for cylinder lifting Morgan-Tian Claims 8.6-8.7, pp. 173-174, and the compatible worldlines of Definition 3.38, p. 61. These lemmas use the selected smooth interval atlas, including its endpoints. The local lifting argument is recorded in `references/ricci-flow/mapher/noncollapse/derivations/2026-09-21-cylinder-lift.md`. -/ set_option autoImplicit false -- The selected interval and vector-model tangent instances agree after unfolding. set_option backward.isDefEq.respectTransparency false open Set open scoped Manifold ContDiff Topology universe v namespace PoincareMT.Generalized.Noncollapse /-- Differentiate in actual real time within the selected interval, as needed for the worldline argument in Claims 8.6-8.7, pp. 173-174. -/ theorem hasDerivWithinAt_comp_realParam {K : SpacetimeInterval} {E : Type v} [NormedAddCommGroup E] [NormedSpace ℝ E] (D : SmoothSpacetimeInterval K) {U : Set D.Point} (hU : IsOpen U) {f : D.Point β†’ E} (hf : ContMDiffOn (π“‘βˆ‚ 1) π“˜(ℝ, E) ∞ f U) (t : D.Point) (ht : t ∈ U) : HasDerivWithinAt (fun s => f (D.realParam s)) (mfderiv (π“‘βˆ‚ 1) π“˜(ℝ, E) f t (D.positiveTangent t)) K.domain t.val := by have hF : MDifferentiableAt (π“‘βˆ‚ 1) π“˜(ℝ, E) f (D.realParam t.val) := by simpa only [D.realParam_coe] using ((hf t ht).contMDiffAt (hU.mem_nhds ht)).mdifferentiableAt (by simp) have hR : MDifferentiableWithinAt π“˜(ℝ) (π“‘βˆ‚ 1) D.realParam K.domain t.val := D.realParam_smoothOn.mdifferentiableOn (by simp) t.val t.property have h := (hF.hasMFDerivAt.comp_hasMFDerivWithinAt t.val hR.hasMFDerivWithinAt).hasFDerivWithinAt.hasDerivWithinAt change HasDerivWithinAt (fun s => f (D.realParam s)) (mfderiv (π“‘βˆ‚ 1) π“˜(ℝ, E) f (D.realParam t.val) (mfderivWithin π“˜(ℝ) (π“‘βˆ‚ 1) D.realParam K.domain t.val 1)) K.domain t.val at h rwa [D.realParam_mfderivWithin_one, D.realParam_coe] at h /-- A vanishing normalized time derivative gives constancy on a closed worldline segment, including a degenerate segment. This is the local coordinate argument behind Claims 8.6-8.7, pp. 173-174. -/ theorem eq_of_mfderiv_positiveTangent_eq_zero_on_Icc {K : SpacetimeInterval} {E : Type v} [NormedAddCommGroup E] [NormedSpace ℝ E] (D : SmoothSpacetimeInterval K) {U : Set D.Point} (hU : IsOpen U) {f : D.Point β†’ E} (hf : ContMDiffOn (π“‘βˆ‚ 1) π“˜(ℝ, E) ∞ f U) (hz : βˆ€ t ∈ U, mfderiv (π“‘βˆ‚ 1) π“˜(ℝ, E) f t (D.positiveTangent t) = 0) (a b : D.Point) (hab : a.val ≀ b.val) (hseg : βˆ€ t : D.Point, a.val ≀ t.val β†’ t.val ≀ b.val β†’ t ∈ U) : f a = f b := by have hsubset : Icc a.val b.val βŠ† K.domain := K.ordConnected.out a.property b.property have hd (s : ℝ) (hs : s ∈ Icc a.val b.val) : HasFDerivWithinAt (fun s => f (D.realParam s)) (0 : ℝ β†’L[ℝ] E) (Icc a.val b.val) s := by let t : D.Point := ⟨s, hsubset hs⟩ have ht : t ∈ U := hseg t hs.1 hs.2 have h := hasDerivWithinAt_comp_realParam D hU hf t ht rw [hz t ht] at h simpa using (h.mono hsubset).hasFDerivWithinAt have h := Convex.norm_image_sub_le_of_norm_hasFDerivWithin_le (C := 0) hd (fun _ _ => by simp) (convex_Icc a.val b.val) ⟨le_rfl, hab⟩ ⟨hab, le_rfl⟩ have he : f (D.realParam b.val) - f (D.realParam a.val) = 0 := norm_le_zero_iff.mp (by simpa only [zero_mul] using h) simpa only [D.realParam_coe] using (sub_eq_zero.mp he).symm end PoincareMT.Generalized.Noncollapse