import PoincareLib.Geometry.RicciFlow.Surgery.StandardCap.Uniqueness.Imports import PoincareLib.Geometry.RicciFlow.Surgery.StandardCap.Geometry import Mathlib.Analysis.SpecialFunctions.Pow.Deriv /-! # Spatial control of the reciprocal scalar scale Morgan-Tian Proposition 12.31, pp. 325-326, and Lemma 11.2, pp. 268-269. The actual guarded scalar-gradient estimate gives a uniform differential bound for R^(-1/2) on the high-curvature region. This is the spatial estimate needed to propagate a finite terminal scalar bound near the tip. -/ set_option autoImplicit false open Set open scoped Manifold ContDiff Bundle Topology namespace PoincareMT.LeviCivitaData /-- Lemma 11.2 and Proposition 12.31: unit-vector control of the actual scalar differential extends by homogeneity to every tangent vector. -/ theorem scalar_directional_bound_of_unit_bound {n : β„•} {M : Type*} [TopologicalSpace M] [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] [IsManifold (𝓑 n) ∞ M] {g : RiemannianMetric n M} (D : LeviCivitaData g) (x : M) {B : ℝ} (hunit : βˆ€ v : TangentSpace (𝓑 n) x, g.inner x v v = 1 β†’ |mvfderiv (𝓑 n) D.scalarCurvature x v| ≀ B) (v : TangentSpace (𝓑 n) x) : |mvfderiv (𝓑 n) D.scalarCurvature x v| ≀ B * g.tangentNorm x v := by let : Bundle.RiemannianBundle (TangentSpace (𝓑 n) : M β†’ Type _) := ⟨g.toRiemannianMetric⟩ by_cases hv : v = 0 Β· subst v simp [RiemannianMetric.tangentNorm] have hnorm : 0 < β€–vβ€– := norm_pos_iff.mpr hv have hw : g.inner x (β€–v‖⁻¹ β€’ v) (β€–v‖⁻¹ β€’ v) = 1 := by change inner ℝ (β€–v‖⁻¹ β€’ v) (β€–v‖⁻¹ β€’ v) = 1 rw [real_inner_smul_left, inner_smul_right, real_inner_self_eq_norm_sq] field_simp have h := hunit (β€–v‖⁻¹ β€’ v) hw rw [map_smul, smul_eq_mul, abs_mul, abs_of_pos (inv_pos.mpr hnorm)] at h have hmul := mul_le_mul_of_nonneg_left h hnorm.le rw [← mul_assoc, mul_inv_cancelβ‚€ hnorm.ne', one_mul] at hmul have hnorm_eq : β€–vβ€– = g.tangentNorm x v := by rw [norm_eq_sqrt_real_inner] rfl simpa only [hnorm_eq, mul_comm] using hmul /-- Lemma 11.2 and Proposition 12.31: differentiating the actual scalar radius cancels its R^(3/2) gradient growth, retaining the factor one half. -/ theorem scalar_radius_directional_bound {n : β„•} {M : Type*} [TopologicalSpace M] [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] [IsManifold (𝓑 n) ∞ M] {g : RiemannianMetric n M} (D : LeviCivitaData g) (x : M) {A : ℝ} (hR : 0 < D.scalarCurvature x) (hreg : MDifferentiableAt (𝓑 n) π“˜(ℝ, ℝ) D.scalarCurvature x) (hunit : βˆ€ v : TangentSpace (𝓑 n) x, g.inner x v v = 1 β†’ |mvfderiv (𝓑 n) D.scalarCurvature x v| ≀ A * D.scalarCurvature x ^ (3 / 2 : ℝ)) (v : TangentSpace (𝓑 n) x) : |mvfderiv (𝓑 n) (fun y => D.scalarCurvature y ^ (-1 / 2 : ℝ)) x v| ≀ (A / 2) * g.tangentNorm x v := by have hrpow := Real.hasDerivAt_rpow_const (p := (-1 / 2 : ℝ)) (Or.inl hR.ne') have hchain : mvfderiv (𝓑 n) (fun y => D.scalarCurvature y ^ (-1 / 2 : ℝ)) x v = (-1 / 2 : ℝ) * D.scalarCurvature x ^ (-3 / 2 : ℝ) * mvfderiv (𝓑 n) D.scalarCurvature x v := by change mvfderiv (𝓑 n) ((fun r : ℝ => r ^ (-1 / 2 : ℝ)) ∘ D.scalarCurvature) x v = _ rw [mvfderiv_comp_apply x hrpow.differentiableAt.mdifferentiableAt hreg v] simp only [mvfderiv, mfderiv_eq_fderiv, ContinuousLinearMap.comp_apply] change fderiv ℝ (fun r : ℝ => r ^ (-1 / 2 : ℝ)) (D.scalarCurvature x) (mvfderiv (𝓑 n) D.scalarCurvature x v) = _ rw [fderiv_eq_deriv_mul, hrpow.deriv] norm_num [mvfderiv, ContinuousLinearMap.comp_apply] rw [hchain, abs_mul, abs_mul, abs_of_pos (Real.rpow_pos_of_pos hR _)] norm_num have h := D.scalar_directional_bound_of_unit_bound x hunit v have hmul := mul_le_mul_of_nonneg_left h (mul_nonneg (by norm_num : (0 : ℝ) ≀ 1 / 2) (Real.rpow_nonneg hR.le (-3 / 2 : ℝ))) have hcancel : D.scalarCurvature x ^ (-3 / 2 : ℝ) * D.scalarCurvature x ^ (3 / 2 : ℝ) = 1 := by rw [← Real.rpow_add hR] norm_num have heq : (1 / 2 * D.scalarCurvature x ^ (-3 / 2 : ℝ)) * (A * D.scalarCurvature x ^ (3 / 2 : ℝ) * g.tangentNorm x v) = A / 2 * g.tangentNorm x v := by calc _ = (A / 2 * g.tangentNorm x v) * (D.scalarCurvature x ^ (-3 / 2 : ℝ) * D.scalarCurvature x ^ (3 / 2 : ℝ)) := by ring _ = _ := by rw [hcancel, mul_one] simpa only [neg_div] using hmul.trans_eq heq end PoincareMT.LeviCivitaData