import PoincareLib.Geometry.RicciFlow.Basic import PoincareLib.Geometry.RicciFlow.Harnack.Basic import PoincareLib.Geometry.Riemannian.ScalarOperators import PoincareLib.Geometry.Riemannian.Tensor.Operations import Mathlib.Analysis.InnerProductSpace.Dual import Mathlib.Geometry.Manifold.MFDeriv.NormedSpace import Mathlib.Geometry.Manifold.VectorBundle.ContMDiffSection import Mathlib.MeasureTheory.Integral.IntervalIntegral.Basic /-! # Backward-time L-geometry The ordinary-flow specialization of Morgan-Tian Chapters 6-7 uses the selected metric and connection at every time. Actual derivatives along curves include the explicit parameter derivative of a locally smooth extension. The older conditional spatial-extension API remains available for Chapter 19. Variations and Jacobi fields have smooth square-root-time representatives near the closed geometric interval. The corrected Jacobi operator retains the time variation of the connection, as checked against Claim 6.34 and Proposition 6.33. -/ set_option autoImplicit false open scoped Manifold ContDiff Bundle intervalIntegral universe u namespace PoincareMT variable {n : โ„•} {M : Type u} [TopologicalSpace M] [ChartedSpace (EuclideanSpace โ„ (Fin n)) M] [IsManifold (๐“ก n) โˆž M] /-- The tangent velocity of a parameterized curve. -/ noncomputable def curveVelocity (ฮณ : โ„ โ†’ M) (ฯ„ : โ„) : TangentSpace (๐“ก n) (ฮณ ฯ„) := (mfderiv (๐“˜(โ„, โ„)) (๐“ก n) ฮณ ฯ„) 1 /-- A local smooth extension of a field along a curve. -/ structure SmoothAlongCurveExtensionOn (I : Set โ„) (ฮณ : โ„ โ†’ M) (Y : โˆ€ ฯ„, TangentSpace (๐“ก n) (ฮณ ฯ„)) where extension : โˆ€ ฯ„, ฯ„ โˆˆ I โ†’ Cโ‚›^โˆžโŸฎ(๐“ก n); EuclideanSpace โ„ (Fin n), (TangentSpace (๐“ก n) : M โ†’ Type _)โŸฏ agrees_near : โˆ€ ฯ„ (hฯ„ : ฯ„ โˆˆ I), โˆƒ ฮด > 0, โˆ€ ฯƒ โˆˆ I, |ฯƒ - ฯ„| < ฮด โ†’ extension ฯ„ hฯ„ (ฮณ ฯƒ) = Y ฯƒ /-- Pointwise smooth spatial sections realizing a tangent field along a curve. -/ structure PointwiseSectionExtensionOn (I : Set โ„) (ฮณ : โ„ โ†’ M) (Y : โˆ€ ฯ„, TangentSpace (๐“ก n) (ฮณ ฯ„)) where extension : โˆ€ ฯ„, ฯ„ โˆˆ I โ†’ Cโ‚›^โˆžโŸฎ(๐“ก n); EuclideanSpace โ„ (Fin n), (TangentSpace (๐“ก n) : M โ†’ Type _)โŸฏ agrees_at : โˆ€ ฯ„ (hฯ„ : ฯ„ โˆˆ I), extension ฯ„ hฯ„ (ฮณ ฯ„) = Y ฯ„ /-- The metric covariant derivative of an along-curve field in a prescribed direction. -/ noncomputable def alongCovariantDerivative {J : Set โ„} (F : RicciFlow n M J) (time : โ„ โ†’ โ„) (ฮณ : โ„ โ†’ M) (Y : โˆ€ ฯ„, TangentSpace (๐“ก n) (ฮณ ฯ„)) (I : Set โ„) (E : SmoothAlongCurveExtensionOn I ฮณ Y) (V : โˆ€ ฯ„, TangentSpace (๐“ก n) (ฮณ ฯ„)) (ฯ„ : โ„) (hฯ„ : ฯ„ โˆˆ I) : TangentSpace (๐“ก n) (ฮณ ฯ„) := (F.connection (time ฯ„)).connection (E.extension ฯ„ hฯ„) (ฮณ ฯ„) (V ฯ„) /-- The velocity within the actual parameter domain. -/ noncomputable def curveVelocityWithin (ฮณ : โ„ โ†’ M) (I : Set โ„) (s : โ„) : TangentSpace (๐“ก n) (ฮณ s) := (mfderivWithin (๐“˜(โ„, โ„)) (๐“ก n) ฮณ I s) 1 /-- A smooth extension on a neighborhood of the parameterized graph. -/ structure ParametricAlongCurveExtensionOn (I : Set โ„) (ฮณ : โ„ โ†’ M) (Y : โˆ€ s, TangentSpace (๐“ก n) (ฮณ s)) where extension : โ„ โ†’ (x : M) โ†’ TangentSpace (๐“ก n) x domain : Set (โ„ ร— M) open_domain : IsOpen domain graph_mem : โˆ€ s โˆˆ I, (s, ฮณ s) โˆˆ domain smooth : ContMDiffOn ((๐“˜(โ„, โ„)).prod (๐“ก n)) ((๐“ก n).prod (๐“ก n)) โˆž (fun z : โ„ ร— M โ†ฆ Bundle.TotalSpace.mk' (EuclideanSpace โ„ (Fin n)) z.2 (extension z.1 z.2)) domain agrees : โˆ€ s โˆˆ I, extension s (ฮณ s) = Y s /-- The pullback connection derivative, including explicit parameter dependence. -/ noncomputable def pullbackCovariantDerivative {J : Set โ„} (F : RicciFlow n M J) (time : โ„ โ†’ โ„) (ฮณ : โ„ โ†’ M) (Y : โˆ€ s, TangentSpace (๐“ก n) (ฮณ s)) (I : Set โ„) (E : ParametricAlongCurveExtensionOn I ฮณ Y) (s : โ„) : TangentSpace (๐“ก n) (ฮณ s) := deriv (fun r โ†ฆ E.extension r (ฮณ s)) s + (F.connection (time s)).connection (E.extension s) (ฮณ s) (curveVelocityWithin (n := n) ฮณ I s) /-- The scalar-curvature differential on the selected time slice. -/ noncomputable def scalarCurvatureDifferential {J : Set โ„} (F : RicciFlow n M J) (time : โ„ โ†’ โ„) (ฮณ : โ„ โ†’ M) (ฯ„ : โ„) : TangentSpace (๐“ก n) (ฮณ ฯ„) โ†’L[โ„] โ„ := mvfderiv (๐“ก n) (fun y โ†ฆ (F.connection (time ฯ„)).scalarCurvature y) (ฮณ ฯ„) /-- The backward-time L-integrand `โˆšฯ„ (R + |X|ยฒ)`. -/ noncomputable def backwardLIntegrand {J : Set โ„} (F : RicciFlow n M J) (T : โ„) (ฮณ : โ„ โ†’ M) (ฯ„ : โ„) : โ„ := Real.sqrt ฯ„ * ((F.connection (T - ฯ„)).scalarCurvature (ฮณ ฯ„) + (F.metric (T - ฯ„)).inner (ฮณ ฯ„) (curveVelocity (n := n) ฮณ ฯ„) (curveVelocity (n := n) ฮณ ฯ„)) /-- Backward-time L-length, using the signed interval integral. -/ noncomputable def backwardLLength {J : Set โ„} (F : RicciFlow n M J) (T ฯ„โ‚ ฯ„โ‚‚ : โ„) (ฮณ : โ„ โ†’ M) : โ„ := โˆซ ฯ„ in ฯ„โ‚..ฯ„โ‚‚, backwardLIntegrand F T ฮณ ฯ„ /-- A curve whose time coordinate is the backward-time parameter `ฯ„`. -/ structure BackwardTimePath {J : Set โ„} (F : RicciFlow n M J) (T ฯ„โ‚ ฯ„โ‚‚ : โ„) where curve : โ„ โ†’ M nonnegative : 0 โ‰ค ฯ„โ‚ ordered : ฯ„โ‚ < ฯ„โ‚‚ terminal_mem : T โˆˆ J time_mem : โˆ€ ฯ„ โˆˆ Set.Icc ฯ„โ‚ ฯ„โ‚‚, T - ฯ„ โˆˆ J continuous : ContinuousOn curve (Set.Icc ฯ„โ‚ ฯ„โ‚‚) regular : ContMDiffOn (๐“˜(โ„, โ„)) (๐“ก n) 1 curve (Set.Ioo ฯ„โ‚ ฯ„โ‚‚) l_integrable : IntervalIntegrable (backwardLIntegrand F T curve) MeasureTheory.volume ฯ„โ‚ ฯ„โ‚‚ /-- The actual Euler residual, used only at positive interior backward times. -/ noncomputable def backwardEulerResidual {J : Set โ„} (F : RicciFlow n M J) (T : โ„) (ฮณ : โ„ โ†’ M) (I : Set โ„) (E : ParametricAlongCurveExtensionOn I ฮณ (curveVelocityWithin (n := n) ฮณ I)) (ฯ„ : โ„) (W : TangentSpace (๐“ก n) (ฮณ ฯ„)) : โ„ := (F.metric (T - ฯ„)).inner (ฮณ ฯ„) (pullbackCovariantDerivative F (fun r โ†ฆ T - r) ฮณ (curveVelocityWithin (n := n) ฮณ I) I E ฯ„) W - (1 / 2 : โ„) * scalarCurvatureDifferential F (fun r โ†ฆ T - r) ฮณ ฯ„ W + (1 / (2 * ฯ„) : โ„) * (F.metric (T - ฯ„)).inner (ฮณ ฯ„) (curveVelocityWithin (n := n) ฮณ I ฯ„) W + 2 * (F.connection (T - ฯ„)).ricci (ฮณ ฯ„) (curveVelocityWithin (n := n) ฮณ I ฯ„) W /-- The paired Euler equation at one parameter. -/ def backwardEulerLagrange {J : Set โ„} (F : RicciFlow n M J) (T : โ„) (ฮณ : โ„ โ†’ M) (I : Set โ„) (E : ParametricAlongCurveExtensionOn I ฮณ (curveVelocityWithin (n := n) ฮณ I)) (ฯ„ : โ„) : Prop := โˆ€ W : TangentSpace (๐“ก n) (ฮณ ฯ„), backwardEulerResidual F T ฮณ I E ฯ„ W = 0 /-- The interior Euler equation with actual derivative data. -/ def IsBackwardLGeodesic {J : Set โ„} (F : RicciFlow n M J) (T ฯ„โ‚ ฯ„โ‚‚ : โ„) (p : BackwardTimePath F T ฯ„โ‚ ฯ„โ‚‚) : Prop := โˆƒ E : ParametricAlongCurveExtensionOn (Set.Ioo ฯ„โ‚ ฯ„โ‚‚) p.curve (curveVelocityWithin (n := n) p.curve (Set.Ioo ฯ„โ‚ ฯ„โ‚‚)), โˆ€ ฯ„ โˆˆ Set.Ioo ฯ„โ‚ ฯ„โ‚‚, backwardEulerLagrange F T p.curve (Set.Ioo ฯ„โ‚ ฯ„โ‚‚) E ฯ„ /-- The square-root reparameterization used to regularize the equation at `ฯ„ = 0`. -/ def squareReparameterizedCurve (ฮณ : โ„ โ†’ M) : โ„ โ†’ M := fun s โ†ฆ ฮณ (s ^ 2) /-- The closed parameter interval after the square-root change of variable. -/ def sqrtParameterInterval (ฯ„โ‚ ฯ„โ‚‚ : โ„) : Set โ„ := Set.Icc (Real.sqrt ฯ„โ‚) (Real.sqrt ฯ„โ‚‚) /-- A smooth representative near the closed square-root-time interval. -/ structure SqrtRegularPath {J : Set โ„} {F : RicciFlow n M J} {T ฯ„โ‚ ฯ„โ‚‚ : โ„} (p : BackwardTimePath F T ฯ„โ‚ ฯ„โ‚‚) where curve : โ„ โ†’ M domain : Set โ„ open_domain : IsOpen domain interval_subset : sqrtParameterInterval ฯ„โ‚ ฯ„โ‚‚ โІ domain smooth : ContMDiffOn (๐“˜(โ„, โ„)) (๐“ก n) โˆž curve domain agrees : โˆ€ s โˆˆ sqrtParameterInterval ฯ„โ‚ ฯ„โ‚‚, curve s = p.curve (s ^ 2) /-- The nonsingular Euler residual, paired with an actual tangent vector. -/ noncomputable def regularizedEulerResidual {J : Set โ„} (F : RicciFlow n M J) (T : โ„) (ฮฑ : โ„ โ†’ M) (I : Set โ„) (E : ParametricAlongCurveExtensionOn I ฮฑ (curveVelocityWithin (n := n) ฮฑ I)) (s : โ„) (W : TangentSpace (๐“ก n) (ฮฑ s)) : โ„ := (F.metric (T - s ^ 2)).inner (ฮฑ s) (pullbackCovariantDerivative F (fun r โ†ฆ T - r ^ 2) ฮฑ (curveVelocityWithin (n := n) ฮฑ I) I E s) W - 2 * s ^ 2 * scalarCurvatureDifferential F (fun r โ†ฆ T - r ^ 2) ฮฑ s W + 4 * s * (F.connection (T - s ^ 2)).ricci (ฮฑ s) (curveVelocityWithin (n := n) ฮฑ I s) W /-- The regularized Euler equation at an included parameter. -/ def regularizedLGeodesicEquation {J : Set โ„} (F : RicciFlow n M J) (T : โ„) (ฮฑ : โ„ โ†’ M) (I : Set โ„) (E : ParametricAlongCurveExtensionOn I ฮฑ (curveVelocityWithin (n := n) ฮฑ I)) (s : โ„) : Prop := โˆ€ W : TangentSpace (๐“ก n) (ฮฑ s), regularizedEulerResidual F T ฮฑ I E s W = 0 /-- An actual square-root-time Euler solution, including one-sided endpoints. -/ structure RegularizedLGeodesicData {J : Set โ„} {F : RicciFlow n M J} {T ฯ„โ‚ ฯ„โ‚‚ : โ„} (p : BackwardTimePath F T ฯ„โ‚ ฯ„โ‚‚) where path : SqrtRegularPath p velocity_extension : ParametricAlongCurveExtensionOn (sqrtParameterInterval ฯ„โ‚ ฯ„โ‚‚) path.curve (curveVelocityWithin (n := n) path.curve (sqrtParameterInterval ฯ„โ‚ ฯ„โ‚‚)) equation : โˆ€ s โˆˆ sqrtParameterInterval ฯ„โ‚ ฯ„โ‚‚, regularizedLGeodesicEquation F T path.curve (sqrtParameterInterval ฯ„โ‚ ฯ„โ‚‚) velocity_extension s /-- A backward-time path is L-minimizing between its fixed endpoints. -/ def IsMinimizingBackwardLPath {J : Set โ„} (F : RicciFlow n M J) (T ฯ„โ‚ ฯ„โ‚‚ : โ„) (p : BackwardTimePath F T ฯ„โ‚ ฯ„โ‚‚) : Prop := โˆ€ q : BackwardTimePath F T ฯ„โ‚ ฯ„โ‚‚, q.curve ฯ„โ‚ = p.curve ฯ„โ‚ โ†’ q.curve ฯ„โ‚‚ = p.curve ฯ„โ‚‚ โ†’ backwardLLength F T ฯ„โ‚ ฯ„โ‚‚ p.curve โ‰ค backwardLLength F T ฯ„โ‚ ฯ„โ‚‚ q.curve /-- A general variation smooth in square-root time near the closed interval. -/ structure LVariation {J : Set โ„} (F : RicciFlow n M J) (T ฯ„โ‚ ฯ„โ‚‚ : โ„) (p : BackwardTimePath F T ฯ„โ‚ ฯ„โ‚‚) where family : โ„ โ†’ โ„ โ†’ M at_zero : โˆ€ ฯ„, family ฯ„ 0 = p.curve ฯ„ radius : โ„ radius_pos : 0 < radius squareFamily : โ„ โ†’ โ„ โ†’ M squareDomain : Set (โ„ ร— โ„) square_open : IsOpen squareDomain square_contains : sqrtParameterInterval ฯ„โ‚ ฯ„โ‚‚ ร—หข Set.Ioo (-radius) radius โІ squareDomain square_smooth : ContMDiffOn ((๐“˜(โ„, โ„)).prod (๐“˜(โ„, โ„))) (๐“ก n) โˆž (fun z : โ„ ร— โ„ โ†ฆ squareFamily z.1 z.2) squareDomain square_agrees : โˆ€ s โˆˆ sqrtParameterInterval ฯ„โ‚ ฯ„โ‚‚, โˆ€ u โˆˆ Set.Ioo (-radius) radius, squareFamily s u = family (s ^ 2) u l_integrable : โˆ€ u โˆˆ Set.Ioo (-radius) radius, IntervalIntegrable (backwardLIntegrand F T (fun ฯ„ โ†ฆ family ฯ„ u)) MeasureTheory.volume ฯ„โ‚ ฯ„โ‚‚ /-- The open neighborhood of the variation parameter zero. -/ def LVariation.parameterDomain {J : Set โ„} {F : RicciFlow n M J} {T ฯ„โ‚ ฯ„โ‚‚ : โ„} {p : BackwardTimePath F T ฯ„โ‚ ฯ„โ‚‚} (V : LVariation F T ฯ„โ‚ ฯ„โ‚‚ p) : Set โ„ := Set.Ioo (-V.radius) V.radius /-- The smooth representative of the base curve supplied by a variation. -/ def LVariation.baseSquareCurve {J : Set โ„} {F : RicciFlow n M J} {T ฯ„โ‚ ฯ„โ‚‚ : โ„} {p : BackwardTimePath F T ฯ„โ‚ ฯ„โ‚‚} (V : LVariation F T ฯ„โ‚ ฯ„โ‚‚ p) : โ„ โ†’ M := fun s โ†ฆ V.squareFamily s 0 /-- A variation whose initial endpoint is fixed throughout its parameter neighborhood. -/ structure InitialFixedLVariation {J : Set โ„} (F : RicciFlow n M J) (T ฯ„โ‚ ฯ„โ‚‚ : โ„) (p : BackwardTimePath F T ฯ„โ‚ ฯ„โ‚‚) extends LVariation F T ฯ„โ‚ ฯ„โ‚‚ p where fixed_left : โˆ€ u โˆˆ Set.Ioo (-radius) radius, family ฯ„โ‚ u = p.curve ฯ„โ‚ /-- A variation fixing both endpoints throughout its parameter neighborhood. -/ structure FixedEndpointLVariation {J : Set โ„} (F : RicciFlow n M J) (T ฯ„โ‚ ฯ„โ‚‚ : โ„) (p : BackwardTimePath F T ฯ„โ‚ ฯ„โ‚‚) extends InitialFixedLVariation F T ฯ„โ‚ ฯ„โ‚‚ p where fixed_right : โˆ€ u โˆˆ Set.Ioo (-radius) radius, family ฯ„โ‚‚ u = p.curve ฯ„โ‚‚ /-- The original L-length of a variation slice. -/ noncomputable def variationLLength {J : Set โ„} {F : RicciFlow n M J} {T ฯ„โ‚ ฯ„โ‚‚ : โ„} {p : BackwardTimePath F T ฯ„โ‚ ฯ„โ‚‚} (V : LVariation F T ฯ„โ‚ ฯ„โ‚‚ p) (u : โ„) : โ„ := backwardLLength F T ฯ„โ‚ ฯ„โ‚‚ (fun ฯ„ โ†ฆ V.family ฯ„ u) /-- The variation field, with its basepoint identified by the actual family equality. -/ noncomputable def variationField {J : Set โ„} {F : RicciFlow n M J} {T ฯ„โ‚ ฯ„โ‚‚ : โ„} {p : BackwardTimePath F T ฯ„โ‚ ฯ„โ‚‚} (V : LVariation F T ฯ„โ‚ ฯ„โ‚‚ p) (ฯ„ : โ„) : TangentSpace (๐“ก n) (p.curve ฯ„) := (V.at_zero ฯ„) โ–ธ curveVelocity (fun u โ†ฆ V.family ฯ„ u) 0 /-- The variation field along the smooth square-root representative. -/ noncomputable def squareVariationField {J : Set โ„} {F : RicciFlow n M J} {T ฯ„โ‚ ฯ„โ‚‚ : โ„} {p : BackwardTimePath F T ฯ„โ‚ ฯ„โ‚‚} (V : LVariation F T ฯ„โ‚ ฯ„โ‚‚ p) (s : โ„) : TangentSpace (๐“ก n) (V.baseSquareCurve s) := curveVelocity (fun u โ†ฆ V.squareFamily s u) 0 /-- Actual derivative data used in both variation formulas. -/ structure LVariationDerivativeData {J : Set โ„} {F : RicciFlow n M J} {T ฯ„โ‚ ฯ„โ‚‚ : โ„} {p : BackwardTimePath F T ฯ„โ‚ ฯ„โ‚‚} (V : LVariation F T ฯ„โ‚ ฯ„โ‚‚ p) where velocity_extension : ParametricAlongCurveExtensionOn (sqrtParameterInterval ฯ„โ‚ ฯ„โ‚‚) V.baseSquareCurve (curveVelocityWithin (n := n) V.baseSquareCurve (sqrtParameterInterval ฯ„โ‚ ฯ„โ‚‚)) variation_extension : ParametricAlongCurveExtensionOn (sqrtParameterInterval ฯ„โ‚ ฯ„โ‚‚) V.baseSquareCurve (squareVariationField V) endpoint_extension : โˆ€ s โˆˆ sqrtParameterInterval ฯ„โ‚ ฯ„โ‚‚, ParametricAlongCurveExtensionOn V.parameterDomain (V.squareFamily s) (curveVelocityWithin (n := n) (V.squareFamily s) V.parameterDomain) /-- The first-variation boundary term, retaining the actual limit at backward time zero. -/ noncomputable def firstVariationBoundaryTerm {J : Set โ„} {F : RicciFlow n M J} {T ฯ„โ‚ ฯ„โ‚‚ : โ„} {p : BackwardTimePath F T ฯ„โ‚ ฯ„โ‚‚} (V : LVariation F T ฯ„โ‚ ฯ„โ‚‚ p) : โ„ := let B := fun s โ†ฆ (F.metric (T - s ^ 2)).inner (V.baseSquareCurve s) (curveVelocityWithin (n := n) V.baseSquareCurve (sqrtParameterInterval ฯ„โ‚ ฯ„โ‚‚) s) (squareVariationField V s) B (Real.sqrt ฯ„โ‚‚) - B (Real.sqrt ฯ„โ‚) /-- The regularized residual contribution to first variation. -/ noncomputable def firstVariationResidualIntegral {J : Set โ„} {F : RicciFlow n M J} {T ฯ„โ‚ ฯ„โ‚‚ : โ„} {p : BackwardTimePath F T ฯ„โ‚ ฯ„โ‚‚} (V : LVariation F T ฯ„โ‚ ฯ„โ‚‚ p) (D : LVariationDerivativeData V) : โ„ := โˆซ s in Real.sqrt ฯ„โ‚..Real.sqrt ฯ„โ‚‚, -regularizedEulerResidual F T V.baseSquareCurve (sqrtParameterInterval ฯ„โ‚ ฯ„โ‚‚) D.velocity_extension s (squareVariationField V s) /-- The actual covariant acceleration of a variation endpoint at its fixed flow time. -/ noncomputable def variationEndpointAcceleration {J : Set โ„} {F : RicciFlow n M J} {T ฯ„โ‚ ฯ„โ‚‚ : โ„} {p : BackwardTimePath F T ฯ„โ‚ ฯ„โ‚‚} (V : LVariation F T ฯ„โ‚ ฯ„โ‚‚ p) (D : LVariationDerivativeData V) (s : โ„) (hs : s โˆˆ sqrtParameterInterval ฯ„โ‚ ฯ„โ‚‚) : TangentSpace (๐“ก n) (V.baseSquareCurve s) := pullbackCovariantDerivative F (fun _ โ†ฆ T - s ^ 2) (V.squareFamily s) (curveVelocityWithin (n := n) (V.squareFamily s) V.parameterDomain) V.parameterDomain (D.endpoint_extension s hs) 0 /-- Both acceleration boundary terms in the second variation of an Euler path. -/ noncomputable def secondVariationBoundaryTerm {J : Set โ„} {F : RicciFlow n M J} {T ฯ„โ‚ ฯ„โ‚‚ : โ„} {p : BackwardTimePath F T ฯ„โ‚ ฯ„โ‚‚} (V : LVariation F T ฯ„โ‚ ฯ„โ‚‚ p) (D : LVariationDerivativeData V) : โ„ := let B := fun s (hs : s โˆˆ sqrtParameterInterval ฯ„โ‚ ฯ„โ‚‚) โ†ฆ (F.metric (T - s ^ 2)).inner (V.baseSquareCurve s) (curveVelocityWithin (n := n) V.baseSquareCurve (sqrtParameterInterval ฯ„โ‚ ฯ„โ‚‚) s) (variationEndpointAcceleration V D s hs) B (Real.sqrt ฯ„โ‚‚) โŸจReal.sqrt_le_sqrt (le_of_lt p.ordered), le_rflโŸฉ - B (Real.sqrt ฯ„โ‚) โŸจle_rfl, Real.sqrt_le_sqrt (le_of_lt p.ordered)โŸฉ /-- The covariant Ricci derivative with the differentiation direction first. -/ noncomputable def ricciDerivativePairing {g : RiemannianMetric n M} (D : LeviCivitaData g) (x : M) (U V W : TangentSpace (๐“ก n) x) : โ„ := D.covariantTensorDerivative D.ricciEvaluation x ![U, V, W] /-- The backward-time connection variation tensor paired using its metric. -/ noncomputable def backwardConnectionVariationPairing {g : RiemannianMetric n M} (D : LeviCivitaData g) (x : M) (U V W : TangentSpace (๐“ก n) x) : โ„ := ricciDerivativePairing D x U V W + ricciDerivativePairing D x V U W - ricciDerivativePairing D x W U V /-- The expanded regularized index density from Morgan-Tian Proposition 6.33. -/ noncomputable def secondVariationIndexDensity {J : Set โ„} {F : RicciFlow n M J} {T ฯ„โ‚ ฯ„โ‚‚ : โ„} {p : BackwardTimePath F T ฯ„โ‚ ฯ„โ‚‚} (V : LVariation F T ฯ„โ‚ ฯ„โ‚‚ p) (D : LVariationDerivativeData V) (s : โ„) : โ„ := let x := V.baseSquareCurve s let A := curveVelocityWithin (n := n) V.baseSquareCurve (sqrtParameterInterval ฯ„โ‚ ฯ„โ‚‚) s let Y := squareVariationField V s let DY := pullbackCovariantDerivative F (fun r โ†ฆ T - r ^ 2) V.baseSquareCurve (squareVariationField V) (sqrtParameterInterval ฯ„โ‚ ฯ„โ‚‚) D.variation_extension s let connection := F.connection (T - s ^ 2) (F.metric (T - s ^ 2)).inner x DY DY + connection.curvatureTensor x Y A A Y + 2 * s ^ 2 * connection.hessian connection.scalarCurvature x Y Y - 4 * s * ricciDerivativePairing connection x Y A Y + 2 * s * ricciDerivativePairing connection x A Y Y /-- The expanded second-variation index integral. -/ noncomputable def secondVariationIndexForm {J : Set โ„} {F : RicciFlow n M J} {T ฯ„โ‚ ฯ„โ‚‚ : โ„} {p : BackwardTimePath F T ฯ„โ‚ ฯ„โ‚‚} (V : LVariation F T ฯ„โ‚ ฯ„โ‚‚ p) (D : LVariationDerivativeData V) : โ„ := โˆซ s in Real.sqrt ฯ„โ‚..Real.sqrt ฯ„โ‚‚, secondVariationIndexDensity V D s /-- A field and its first pullback derivative with smooth representatives near the interval. -/ structure SqrtRegularField {J : Set โ„} {F : RicciFlow n M J} {T ฯ„โ‚ ฯ„โ‚‚ : โ„} {p : BackwardTimePath F T ฯ„โ‚ ฯ„โ‚‚} (R : SqrtRegularPath p) (Y : โˆ€ ฯ„, TangentSpace (๐“ก n) (p.curve ฯ„)) where field : โˆ€ s, TangentSpace (๐“ก n) (R.curve s) agrees : โˆ€ s (hs : s โˆˆ sqrtParameterInterval ฯ„โ‚ ฯ„โ‚‚), field s = (R.agrees s hs).symm โ–ธ Y (s ^ 2) extension : ParametricAlongCurveExtensionOn (sqrtParameterInterval ฯ„โ‚ ฯ„โ‚‚) R.curve field derivative_extension : ParametricAlongCurveExtensionOn (sqrtParameterInterval ฯ„โ‚ ฯ„โ‚‚) R.curve (pullbackCovariantDerivative F (fun r โ†ฆ T - r ^ 2) R.curve field (sqrtParameterInterval ฯ„โ‚ ฯ„โ‚‚) extension) /-- The actual first covariant derivative of a square-root regular field. -/ noncomputable def SqrtRegularField.firstDerivative {J : Set โ„} {F : RicciFlow n M J} {T ฯ„โ‚ ฯ„โ‚‚ : โ„} {p : BackwardTimePath F T ฯ„โ‚ ฯ„โ‚‚} {R : SqrtRegularPath p} {Y : โˆ€ ฯ„, TangentSpace (๐“ก n) (p.curve ฯ„)} (Q : SqrtRegularField R Y) (s : โ„) : TangentSpace (๐“ก n) (R.curve s) := pullbackCovariantDerivative F (fun r โ†ฆ T - r ^ 2) R.curve Q.field (sqrtParameterInterval ฯ„โ‚ ฯ„โ‚‚) Q.extension s /-- The actual repeated pullback derivative, including the connection's time dependence. -/ noncomputable def SqrtRegularField.secondDerivative {J : Set โ„} {F : RicciFlow n M J} {T ฯ„โ‚ ฯ„โ‚‚ : โ„} {p : BackwardTimePath F T ฯ„โ‚ ฯ„โ‚‚} {R : SqrtRegularPath p} {Y : โˆ€ ฯ„, TangentSpace (๐“ก n) (p.curve ฯ„)} (Q : SqrtRegularField R Y) (s : โ„) : TangentSpace (๐“ก n) (R.curve s) := pullbackCovariantDerivative F (fun r โ†ฆ T - r ^ 2) R.curve Q.firstDerivative (sqrtParameterInterval ฯ„โ‚ ฯ„โ‚‚) Q.derivative_extension s /-- The corrected regularized Jacobi operator paired against an actual tangent vector. -/ noncomputable def regularizedJacobiResidual {J : Set โ„} {F : RicciFlow n M J} {T ฯ„โ‚ ฯ„โ‚‚ : โ„} {p : BackwardTimePath F T ฯ„โ‚ ฯ„โ‚‚} (R : RegularizedLGeodesicData p) {Y : โˆ€ ฯ„, TangentSpace (๐“ก n) (p.curve ฯ„)} (Q : SqrtRegularField R.path Y) (s : โ„) (W : TangentSpace (๐“ก n) (R.path.curve s)) : โ„ := let x := R.path.curve s let A := curveVelocityWithin (n := n) R.path.curve (sqrtParameterInterval ฯ„โ‚ ฯ„โ‚‚) s let connection := F.connection (T - s ^ 2) (F.metric (T - s ^ 2)).inner x (Q.secondDerivative s) W + connection.curvatureTensor x (Q.field s) A W A - 2 * s * backwardConnectionVariationPairing connection x A (Q.field s) W - 2 * s ^ 2 * connection.hessian connection.scalarCurvature x (Q.field s) W + 4 * s * ricciDerivativePairing connection x (Q.field s) A W + 4 * s * connection.ricci x (Q.firstDerivative s) W /-- An initial-zero Jacobi field along an actual Euler path, with no terminal-zero constraint. -/ def IsLJacobiField {J : Set โ„} (F : RicciFlow n M J) (T ฯ„โ‚ ฯ„โ‚‚ : โ„) (p : BackwardTimePath F T ฯ„โ‚ ฯ„โ‚‚) (Y : โˆ€ ฯ„, TangentSpace (๐“ก n) (p.curve ฯ„)) : Prop := โˆƒ R : RegularizedLGeodesicData p, โˆƒ Q : SqrtRegularField R.path Y, Y ฯ„โ‚ = 0 โˆง โˆ€ s โˆˆ sqrtParameterInterval ฯ„โ‚ ฯ„โ‚‚, โˆ€ W : TangentSpace (๐“ก n) (R.path.curve s), regularizedJacobiResidual R Q s W = 0 /-- The prescribed square-root-time initial derivative, with its actual initial basepoint. -/ def HasLJacobiInitialDerivative {J : Set โ„} {F : RicciFlow n M J} {T ฯ„โ‚ ฯ„โ‚‚ : โ„} {p : BackwardTimePath F T ฯ„โ‚ ฯ„โ‚‚} (R : RegularizedLGeodesicData p) (Y : โˆ€ ฯ„, TangentSpace (๐“ก n) (p.curve ฯ„)) (Z : TangentSpace (๐“ก n) (p.curve ฯ„โ‚)) : Prop := โˆƒ Q : SqrtRegularField R.path Y, let hbase : R.path.curve (Real.sqrt ฯ„โ‚) = p.curve ฯ„โ‚ := (R.path.agrees (Real.sqrt ฯ„โ‚) โŸจle_rfl, Real.sqrt_le_sqrt (le_of_lt p.ordered)โŸฉ).trans (congrArg p.curve (Real.sq_sqrt p.nonnegative)) Q.firstDerivative (Real.sqrt ฯ„โ‚) = hbase.symm โ–ธ Z /-- Completeness and a uniform curvature bound on a time set. -/ def CompleteBoundedCurvatureOn {J : Set โ„} (F : RicciFlow n M J) (I : Set โ„) [T3Space M] : Prop := (โˆ€ t โˆˆ I, MetricComplete (F.metric t)) โˆง โˆƒ K : โ„, 0 โ‰ค K โˆง โˆ€ t โˆˆ I, โˆ€ x : M, |(F.connection t).curvatureTensorNorm x| โ‰ค K /-- The reduced length, totalized at nonpositive backward time. -/ noncomputable def reducedLength {J : Set โ„} (F : RicciFlow n M J) (T : โ„) (p q : M) (ฯ„ : โ„) : โ„ := if _hฯ„ : 0 < ฯ„ then sInf {L : โ„ | โˆƒ path : BackwardTimePath F T 0 ฯ„, path.curve 0 = p โˆง path.curve ฯ„ = q โˆง L = backwardLLength F T 0 ฯ„ path.curve} / (2 * Real.sqrt ฯ„) else 0 end PoincareMT