Poincaré conjecture: the Lean proof, cleaned up together
The 2026 Lean proof of the Poincaré conjecture after Morgan and Tian, 3 million lines, cleaned up together: smaller, faster to build, more readable, the theorems unchanged

| 1 | import PoincareLib.Geometry.RicciFlow.Surgery.StandardCap.Uniqueness.Imports |
| 2 | import PoincareLib.Geometry.RicciFlow.Surgery.StandardCap.Geometry |
| 3 | import Mathlib.Analysis.SpecialFunctions.Pow.Deriv |
| 4 | |
| 5 | /-! |
| 6 | # Spatial control of the reciprocal scalar scale |
| 7 | |
| 8 | Morgan-Tian Proposition 12.31, pp. 325-326, and Lemma 11.2, pp. 268-269. |
| 9 | The actual guarded scalar-gradient estimate gives a uniform differential |
| 10 | bound for R^(-1/2) on the high-curvature region. This is the spatial |
| 11 | estimate needed to propagate a finite terminal scalar bound near the tip. |
| 12 | -/ |
| 13 | |
| 14 | set_option autoImplicit false |
| 15 | |
| 16 | open Set |
| 17 | open scoped Manifold ContDiff Bundle Topology |
| 18 | |
| 19 | namespace PoincareMT.LeviCivitaData |
| 20 | |
| 21 | /-- Lemma 11.2 and Proposition 12.31: unit-vector control of the actual |
| 22 | scalar differential extends by homogeneity to every tangent vector. -/ |
| 23 | theorem scalar_directional_bound_of_unit_bound |
| 24 | {n : ℕ} {M : Type*} [TopologicalSpace M] |
| 25 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] [IsManifold (𝓡 n) ∞ M] |
| 26 | {g : RiemannianMetric n M} (D : LeviCivitaData g) (x : M) {B : ℝ} |
| 27 | (hunit : ∀ v : TangentSpace (𝓡 n) x, g.inner x v v = 1 → |
| 28 | |mvfderiv (𝓡 n) D.scalarCurvature x v| ≤ B) |
| 29 | (v : TangentSpace (𝓡 n) x) : |
| 30 | |mvfderiv (𝓡 n) D.scalarCurvature x v| ≤ B * g.tangentNorm x v := by |
| 31 | let : Bundle.RiemannianBundle (TangentSpace (𝓡 n) : M → Type _) := |
| 32 | ⟨g.toRiemannianMetric⟩ |
| 33 | by_cases hv : v = 0 |
| 34 | · subst v |
| 35 | simp [RiemannianMetric.tangentNorm] |
| 36 | have hnorm : 0 < ‖v‖ := norm_pos_iff.mpr hv |
| 37 | have hw : g.inner x (‖v‖⁻¹ • v) (‖v‖⁻¹ • v) = 1 := by |
| 38 | change inner ℝ (‖v‖⁻¹ • v) (‖v‖⁻¹ • v) = 1 |
| 39 | rw [real_inner_smul_left, inner_smul_right, real_inner_self_eq_norm_sq] |
| 40 | field_simp |
| 41 | have h := hunit (‖v‖⁻¹ • v) hw |
| 42 | rw [map_smul, smul_eq_mul, abs_mul, abs_of_pos (inv_pos.mpr hnorm)] at h |
| 43 | have hmul := mul_le_mul_of_nonneg_left h hnorm.le |
| 44 | rw [← mul_assoc, mul_inv_cancel₀ hnorm.ne', one_mul] at hmul |
| 45 | have hnorm_eq : ‖v‖ = g.tangentNorm x v := by |
| 46 | rw [norm_eq_sqrt_real_inner] |
| 47 | rfl |
| 48 | simpa only [hnorm_eq, mul_comm] using hmul |
| 49 | |
| 50 | /-- Lemma 11.2 and Proposition 12.31: differentiating the actual scalar |
| 51 | radius cancels its R^(3/2) gradient growth, retaining the factor one half. -/ |
| 52 | theorem scalar_radius_directional_bound |
| 53 | {n : ℕ} {M : Type*} [TopologicalSpace M] |
| 54 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] [IsManifold (𝓡 n) ∞ M] |
| 55 | {g : RiemannianMetric n M} (D : LeviCivitaData g) (x : M) {A : ℝ} |
| 56 | (hR : 0 < D.scalarCurvature x) |
| 57 | (hreg : MDifferentiableAt (𝓡 n) 𝓘(ℝ, ℝ) D.scalarCurvature x) |
| 58 | (hunit : ∀ v : TangentSpace (𝓡 n) x, g.inner x v v = 1 → |
| 59 | |mvfderiv (𝓡 n) D.scalarCurvature x v| ≤ |
| 60 | A * D.scalarCurvature x ^ (3 / 2 : ℝ)) |
| 61 | (v : TangentSpace (𝓡 n) x) : |
| 62 | |mvfderiv (𝓡 n) (fun y => D.scalarCurvature y ^ (-1 / 2 : ℝ)) x v| ≤ |
| 63 | (A / 2) * g.tangentNorm x v := by |
| 64 | have hrpow := Real.hasDerivAt_rpow_const (p := (-1 / 2 : ℝ)) (Or.inl hR.ne') |
| 65 | have hchain : mvfderiv (𝓡 n) (fun y => D.scalarCurvature y ^ (-1 / 2 : ℝ)) x v = |
| 66 | (-1 / 2 : ℝ) * D.scalarCurvature x ^ (-3 / 2 : ℝ) * |
| 67 | mvfderiv (𝓡 n) D.scalarCurvature x v := by |
| 68 | change mvfderiv (𝓡 n) ((fun r : ℝ => r ^ (-1 / 2 : ℝ)) ∘ D.scalarCurvature) x v = _ |
| 69 | rw [mvfderiv_comp_apply x hrpow.differentiableAt.mdifferentiableAt hreg v] |
| 70 | simp only [mvfderiv, mfderiv_eq_fderiv, ContinuousLinearMap.comp_apply] |
| 71 | change fderiv ℝ (fun r : ℝ => r ^ (-1 / 2 : ℝ)) (D.scalarCurvature x) |
| 72 | (mvfderiv (𝓡 n) D.scalarCurvature x v) = _ |
| 73 | rw [fderiv_eq_deriv_mul, hrpow.deriv] |
| 74 | norm_num [mvfderiv, ContinuousLinearMap.comp_apply] |
| 75 | rw [hchain, abs_mul, abs_mul, abs_of_pos (Real.rpow_pos_of_pos hR _)] |
| 76 | norm_num |
| 77 | have h := D.scalar_directional_bound_of_unit_bound x hunit v |
| 78 | have hmul := mul_le_mul_of_nonneg_left h |
| 79 | (mul_nonneg (by norm_num : (0 : ℝ) ≤ 1 / 2) |
| 80 | (Real.rpow_nonneg hR.le (-3 / 2 : ℝ))) |
| 81 | have hcancel : D.scalarCurvature x ^ (-3 / 2 : ℝ) * |
| 82 | D.scalarCurvature x ^ (3 / 2 : ℝ) = 1 := by |
| 83 | rw [← Real.rpow_add hR] |
| 84 | norm_num |
| 85 | have heq : (1 / 2 * D.scalarCurvature x ^ (-3 / 2 : ℝ)) * |
| 86 | (A * D.scalarCurvature x ^ (3 / 2 : ℝ) * g.tangentNorm x v) = |
| 87 | A / 2 * g.tangentNorm x v := by |
| 88 | calc |
| 89 | _ = (A / 2 * g.tangentNorm x v) * |
| 90 | (D.scalarCurvature x ^ (-3 / 2 : ℝ) * D.scalarCurvature x ^ (3 / 2 : ℝ)) := by ring |
| 91 | _ = _ := by rw [hcancel, mul_one] |
| 92 | simpa only [neg_div] using hmul.trans_eq heq |
| 93 | |
| 94 | end PoincareMT.LeviCivitaData |