import PoincareLib.Geometry.RicciFlow.ReducedGeometry.LGeometry.Path.PathBasics import Mathlib.Analysis.Calculus.LocalExtr.Basic import Mathlib.Analysis.SpecialFunctions.Sqrt /-! Adapted from Mapher `PoincareMT/Proofs/M08/VariationPaths.lean` at `f927d9e1f0810042766d3b5f64d3f4da02ee93cc`. -/ /-! # Admissible slices of an L-variation Square-root regularity supplies admissibility of each variation slice. A minimizing path consequently gives a local minimum of the action for every fixed-endpoint variation. -/ set_option autoImplicit false open scoped Manifold ContDiff Bundle Topology universe u namespace PoincareMT.LGeometry variable {n : β„•} {M : Type u} [TopologicalSpace M] [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] [IsManifold (𝓑 n) ∞ M] /-- Every slice in the open variation parameter interval is an admissible backward path. -/ def variationPath {J : Set ℝ} {F : RicciFlow n M J} {T τ₁ Ο„β‚‚ : ℝ} {p : BackwardTimePath F T τ₁ Ο„β‚‚} (V : LVariation F T τ₁ Ο„β‚‚ p) {u : ℝ} (hu : u ∈ V.parameterDomain) : BackwardTimePath F T τ₁ Ο„β‚‚ := by have hmaps : Set.MapsTo (fun Ο„ : ℝ ↦ (Real.sqrt Ο„, u)) (Set.Icc τ₁ Ο„β‚‚) V.squareDomain := by intro Ο„ hΟ„ exact V.square_contains ⟨⟨Real.sqrt_le_sqrt hΟ„.1, Real.sqrt_le_sqrt hΟ„.2⟩, hu⟩ have hagrees (Ο„ : ℝ) (hΟ„ : Ο„ ∈ Set.Icc τ₁ Ο„β‚‚) : V.squareFamily (Real.sqrt Ο„) u = V.family Ο„ u := by have hnonneg : 0 ≀ Ο„ := p.nonnegative.trans hΟ„.1 simpa only [Real.sq_sqrt hnonneg] using V.square_agrees (Real.sqrt Ο„) ⟨Real.sqrt_le_sqrt hΟ„.1, Real.sqrt_le_sqrt hΟ„.2⟩ u hu refine { curve := fun Ο„ ↦ V.family Ο„ u nonnegative := p.nonnegative ordered := p.ordered terminal_mem := p.terminal_mem time_mem := p.time_mem continuous := ?_ regular := ?_ l_integrable := V.l_integrable u hu } Β· exact (V.square_smooth.continuousOn.comp (Real.continuous_sqrt.prodMk continuous_const).continuousOn hmaps).congr (fun Ο„ hΟ„ ↦ (hagrees Ο„ hΟ„).symm) Β· have hsqrt : ContMDiffOn (π“˜(ℝ, ℝ)) (π“˜(ℝ, ℝ)) 1 Real.sqrt (Set.Ioo τ₁ Ο„β‚‚) := by intro Ο„ hΟ„ exact (Real.contDiffAt_sqrt (ne_of_gt (lt_of_le_of_lt p.nonnegative hΟ„.1))).contMDiffAt.contMDiffWithinAt exact ((V.square_smooth.of_le (by simp)).comp (hsqrt.prodMk contMDiffOn_const) (hmaps.mono_left Set.Ioo_subset_Icc_self)).congr (fun Ο„ hΟ„ ↦ (hagrees Ο„ (Set.Ioo_subset_Icc_self hΟ„)).symm) /-- Along a fixed-endpoint variation, the action of a minimizing path is a local minimum. -/ theorem isLocalMin_variationLLength {J : Set ℝ} {F : RicciFlow n M J} {T τ₁ Ο„β‚‚ : ℝ} {p : BackwardTimePath F T τ₁ Ο„β‚‚} (hmin : IsMinimizingBackwardLPath F T τ₁ Ο„β‚‚ p) (V : FixedEndpointLVariation F T τ₁ Ο„β‚‚ p) : IsLocalMin (variationLLength V.toLVariation) 0 := by have hzero : variationLLength V.toLVariation 0 = backwardLLength F T τ₁ Ο„β‚‚ p.curve := by have hcurve : (fun Ο„ ↦ V.family Ο„ 0) = p.curve := funext V.at_zero simp only [variationLLength, hcurve] change βˆ€αΆ  u in 𝓝 (0 : ℝ), variationLLength V.toLVariation 0 ≀ variationLLength V.toLVariation u refine Filter.eventually_of_mem (isOpen_Ioo.mem_nhds ⟨neg_neg_of_pos V.radius_pos, V.radius_pos⟩) ?_ intro u hu rw [hzero] exact hmin (variationPath V.toLVariation hu) (V.fixed_left u hu) (V.fixed_right u hu) /-- Any actual first derivative of the fixed-endpoint action vanishes at a minimizer. -/ theorem hasDerivAt_variationLLength_eq_zero {J : Set ℝ} {F : RicciFlow n M J} {T τ₁ Ο„β‚‚ : ℝ} {p : BackwardTimePath F T τ₁ Ο„β‚‚} (hmin : IsMinimizingBackwardLPath F T τ₁ Ο„β‚‚ p) (V : FixedEndpointLVariation F T τ₁ Ο„β‚‚ p) {d : ℝ} (hd : HasDerivAt (variationLLength V.toLVariation) d 0) : d = 0 := (isLocalMin_variationLLength hmin V).hasDerivAt_eq_zero hd /-- The totalized first derivative vanishes; this statement alone asserts no differentiability. -/ theorem deriv_variationLLength_eq_zero {J : Set ℝ} {F : RicciFlow n M J} {T τ₁ Ο„β‚‚ : ℝ} {p : BackwardTimePath F T τ₁ Ο„β‚‚} (hmin : IsMinimizingBackwardLPath F T τ₁ Ο„β‚‚ p) (V : FixedEndpointLVariation F T τ₁ Ο„β‚‚ p) : deriv (variationLLength V.toLVariation) 0 = 0 := (isLocalMin_variationLLength hmin V).deriv_eq_zero end PoincareMT.LGeometry