import PoincareLib.Geometry.Riemannian.Connection import Mathlib.Analysis.InnerProductSpace.Calculus import Mathlib.Geometry.Manifold.ContMDiff.Atlas import Mathlib.Geometry.Manifold.MFDeriv.Atlas /-! Adapted from Mapher06/Poincare-MorganTian, `PoincareMT/Proofs/M04/ChartScalarBarrier.lean`, revision `f927d9e1f0810042766d3b5f64d3f4da02ee93cc`. See the curvature import record under `references/ricci-flow/mapher/curvature/`. -/ /-! # Radial scalar barriers inside a manifold chart -/ set_option autoImplicit false open scoped Manifold ContDiff Bundle open Set Topology Filter Metric universe u namespace PoincareMT.RicciFlowAnalysis variable {n : β„•} {M : Type u} [TopologicalSpace M] [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] [IsManifold (𝓑 n) ∞ M] theorem contMDiffOn_chart_radial (p : M) (c : EuclideanSpace ℝ (Fin n)) (r : ℝ) : ContMDiffOn (𝓑 n) π“˜(ℝ, ℝ) ∞ (fun x ↦ r ^ 2 - β€–extChartAt (𝓑 n) p x - cβ€– ^ 2) (extChartAt (𝓑 n) p).source := by have he : ContMDiffOn (𝓑 n) π“˜(ℝ, EuclideanSpace ℝ (Fin n)) ∞ (extChartAt (𝓑 n) p) (extChartAt (𝓑 n) p).source := by simpa only [extChartAt_source] using (contMDiffOn_extChartAt (I := 𝓑 n) (x := p) (n := ∞)) have hΟ† : ContDiff ℝ ∞ (fun z : EuclideanSpace ℝ (Fin n) ↦ r ^ 2 - β€–z - cβ€– ^ 2) := contDiff_const.sub ((contDiff_id.sub contDiff_const).norm_sq ℝ) exact hΟ†.contMDiff.comp_contMDiffOn he set_option maxHeartbeats 1000000 in -- The chart chain rule and tangent-space isomorphisms need extra elaboration. set_option backward.isDefEq.respectTransparency false in theorem mfderiv_chart_radial_ne_zero (p : M) (c : EuclideanSpace ℝ (Fin n)) (r : ℝ) {x : M} (hx : x ∈ (extChartAt (𝓑 n) p).source) (hne : extChartAt (𝓑 n) p x β‰  c) : mfderiv (𝓑 n) π“˜(ℝ, ℝ) (fun y ↦ r ^ 2 - β€–extChartAt (𝓑 n) p y - cβ€– ^ 2) x β‰  0 := by let E := EuclideanSpace ℝ (Fin n) let e := extChartAt (𝓑 n) p let Ο† : E β†’ ℝ := fun z ↦ r ^ 2 - β€–z - cβ€– ^ 2 let L : TangentSpace (𝓑 n) x β†’L[ℝ] E := mfderiv (𝓑 n) π“˜(ℝ, E) e x let z : E := e x - c let v := L.inverse z have hL : L.IsInvertible := isInvertible_mfderiv_extChartAt hx have hv : L v = z := hL.self_apply_inverse z have hz : z β‰  0 := sub_ne_zero.mpr hne have he : MDifferentiableAt (𝓑 n) π“˜(ℝ, E) e x := mdifferentiableAt_extChartAt (by simpa only [extChartAt_source] using hx) have hΟ† : ContDiff ℝ ∞ Ο† := contDiff_const.sub ((contDiff_id.sub contDiff_const).norm_sq ℝ) have hc : mfderiv (𝓑 n) π“˜(ℝ, ℝ) (fun y ↦ Ο† (e y)) x = (fderiv ℝ Ο† (e x)).comp L := by change mfderiv (𝓑 n) π“˜(ℝ, ℝ) (Ο† ∘ e) x = _ rw [mfderiv_comp x ((hΟ†.differentiable (by simp)) (e x)).mdifferentiableAt he, mfderiv_eq_fderiv] have hs := ((hasFDerivAt_id (e x)).sub_const c).norm_sq have hΟ†d : HasFDerivAt Ο† (0 - 2 β€’ (innerSL ℝ) z) (e x) := by simpa only [Ο†, z, Pi.sub_apply, id_eq, ContinuousLinearMap.comp_id] using! (hasFDerivAt_const (r ^ 2) (e x)).sub hs have hvalue : fderiv ℝ Ο† (e x) z = -2 * β€–zβ€– ^ 2 := by rw [hΟ†d.fderiv] simp only [sub_apply, zero_apply, two_smul, add_apply, innerSL_apply_apply] rw [real_inner_self_eq_norm_sq] ring intro hzero have h := congrArg (fun K : TangentSpace (𝓑 n) x β†’L[ℝ] ℝ ↦ K v) hzero change (mfderiv (𝓑 n) π“˜(ℝ, ℝ) (fun y ↦ Ο† (e y)) x) v = 0 at h rw [hc] at h change fderiv ℝ Ο† (e x) (L v) = 0 at h rw [hv, hvalue] at h have hpos : 0 < β€–zβ€– ^ 2 := sq_pos_of_pos (norm_pos_iff.mpr hz) linarith theorem chart_closedBall_properties [T2Space M] (p : M) (c : EuclideanSpace ℝ (Fin n)) {R : ℝ} (_hR : 0 < R) (hball : closedBall c R βŠ† (extChartAt (𝓑 n) p).target) : let e := extChartAt (𝓑 n) p let C := e.symm '' closedBall c R IsCompact C ∧ C βŠ† e.source ∧ (βˆ€ x ∈ e.source, x ∈ C ↔ β€–e x - cβ€– ≀ R) ∧ (βˆ€ x ∈ e.source, β€–e x - cβ€– < R β†’ x ∈ interior C) := by let e := extChartAt (𝓑 n) p let C := e.symm '' closedBall c R have hC : IsCompact C := (isCompact_closedBall c R).image_of_continuousOn ((continuousOn_extChartAt_symm p).mono hball) have hCs : C βŠ† e.source := by rintro x ⟨z, hz, rfl⟩ exact e.map_target (hball hz) have hmem (x : M) (hx : x ∈ e.source) : x ∈ C ↔ β€–e x - cβ€– ≀ R := by constructor Β· rintro ⟨z, hz, rfl⟩ rw [e.right_inv (hball hz)] exact mem_closedBall_iff_norm.mp hz Β· intro hnorm exact ⟨e x, mem_closedBall_iff_norm.mpr hnorm, e.left_inv hx⟩ refine ⟨hC, hCs, hmem, ?_⟩ intro x hx hnorm have hO : IsOpen (e.source ∩ e ⁻¹' ball c R) := (continuousOn_extChartAt p).isOpen_inter_preimage (isOpen_extChartAt_source p) isOpen_ball have hOC : e.source ∩ e ⁻¹' ball c R βŠ† C := by intro y hy exact (hmem y hy.1).2 (mem_ball_iff_norm.mp hy.2).le exact mem_interior.mpr ⟨e.source ∩ e ⁻¹' ball c R, hOC, hO, hx, mem_ball_iff_norm.mpr hnorm⟩ end PoincareMT.RicciFlowAnalysis