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.CanonicalInduction.Positive.PositiveGradientBarrier |
| 2 | import PoincareLib.Geometry.RicciFlow.Surgery.CanonicalInduction.Positive.PositiveGradientThresholds |
| 3 | import PoincareLib.Geometry.RicciFlow.Surgery.CanonicalInduction.Positive.PositiveWeightedBound |
| 4 | |
| 5 | /-! |
| 6 | # The uniform scalar-gradient estimate in positive curvature |
| 7 | |
| 8 | Hamilton's actual barrier is compared on closed subintervals of the |
| 9 | original finite flow. The Ricci pinching, scalar threshold, and initial |
| 10 | barrier constants are all chosen before the evaluation time. This proves |
| 11 | the gradient estimate in Hamilton (1982), Section 11, supporting |
| 12 | Morgan--Tian, Theorem 4.23, pp. 74-75. |
| 13 | -/ |
| 14 | |
| 15 | set_option autoImplicit false |
| 16 | -- Retained metric and tensor expressions use definitionally equal fiber instances. |
| 17 | set_option backward.isDefEq.respectTransparency false |
| 18 | |
| 19 | open Set |
| 20 | open scoped Manifold ContDiff Bundle BigOperators Topology |
| 21 | |
| 22 | universe u |
| 23 | |
| 24 | namespace PoincareMT.M47Positive |
| 25 | |
| 26 | variable {M : Type u} [TopologicalSpace M] |
| 27 | [ChartedSpace (EuclideanSpace ℝ (Fin 3)) M] [IsManifold (𝓡 3) ∞ M] |
| 28 | [T2Space M] [CompactSpace M] [SecondCountableTopology M] |
| 29 | |
| 30 | /-- Compact initial strict sectional positivity gives an arbitrarily |
| 31 | small cubic scalar coefficient in the actual scalar-gradient bound, |
| 32 | uniformly on the original finite interval. This is the gradient estimate |
| 33 | of Hamilton (1982), Section 11, used in Morgan--Tian, Theorem 4.23, |
| 34 | pp. 74-75; no terminal divergence is assumed. -/ |
| 35 | theorem exists_uniform_scalar_gradient_bound |
| 36 | (hC : RicciFlowCurvatureTheory.{u}) {T : ℝ} (hT : 0 < T) |
| 37 | (F : RicciFlow 3 M (Ico 0 T)) |
| 38 | (hpos : ∀ x : M, ∀ v w : TangentSpace (𝓡 3) x, |
| 39 | LeviCivitaData.IsOrthonormalPair (F.metric 0) x v w → |
| 40 | 0 < (F.connection 0).sectionalCurvature x v w) |
| 41 | {eta : ℝ} (heta : 0 < eta) : |
| 42 | ∃ K : ℝ, 0 < K ∧ ∀ t ∈ Ico 0 T, ∀ x : M, |
| 43 | (F.metric t).inner x |
| 44 | ((F.connection t).gradient (F.connection t).scalarCurvature x) |
| 45 | ((F.connection t).gradient (F.connection t).scalarCurvature x) ≤ |
| 46 | eta * (F.connection t).scalarCurvature x ^ 3 + K := by |
| 47 | obtain ⟨delta, hdelta, _, hpinch⟩ := exists_uniform_ricci_pinching hC hT F hpos |
| 48 | obtain ⟨r, hr, hlower⟩ := exists_uniform_positive_scalar_lower hT F hpos |
| 49 | obtain ⟨epsilon, C, hepsilon, _, _, hnormalized⟩ := |
| 50 | exists_uniform_normalized_ricci_bound hC hT F hpos |
| 51 | have hR (t : ℝ) (ht : t ∈ Ico 0 T) (x : M) : |
| 52 | 0 < (F.connection t).scalarCurvature x := hr.trans_le (hlower t ht x) |
| 53 | have hRic (t : ℝ) (ht : t ∈ Ico 0 T) (x : M) |
| 54 | (v : TangentSpace (𝓡 3) x) (hv : (F.metric t).inner x v v = 1) : |
| 55 | 0 ≤ (F.connection t).ricci x v v := |
| 56 | (mul_nonneg hdelta.le (hR t ht x).le).trans (hpinch t ht x v hv) |
| 57 | let beta := min (eta / 2) 1 |
| 58 | have hbeta : 0 < beta := lt_min (by positivity) (by norm_num) |
| 59 | have hbeta1 : beta ≤ 1 := min_le_right _ _ |
| 60 | have hbetaeta : beta ≤ eta / 2 := min_le_left _ _ |
| 61 | obtain ⟨L, hL, hreaction⟩ := exists_gradient_reaction_upper (C := C) hepsilon hbeta |
| 62 | let H := fun s y => (F.metric s).inner y |
| 63 | ((F.connection s).gradient (F.connection s).scalarCurvature y) |
| 64 | ((F.connection s).gradient (F.connection s).scalarCurvature y) / |
| 65 | (F.connection s).scalarCurvature y + |
| 66 | 240 * ((F.connection s).ricciNormSq y - (F.connection s).scalarCurvature y ^ 2 / 3) - |
| 67 | beta * (F.connection s).scalarCurvature y ^ 2 |
| 68 | have hH0 : Continuous (H 0) := |
| 69 | (contMDiff_scalar_gradient_barrier (F.connection 0) |
| 70 | (hC.tensor_calculus 3 M (F.metric 0) (F.connection 0)) (hR 0 ⟨le_rfl, hT⟩) beta).continuous |
| 71 | obtain ⟨C0, hC0⟩ := isCompact_univ.bddAbove_image hH0.continuousOn |
| 72 | let Cinit := max 0 C0 |
| 73 | have hCinit : 0 ≤ Cinit := le_max_left _ _ |
| 74 | have hinit (x : M) : H 0 x ≤ Cinit := |
| 75 | (hC0 ⟨x, mem_univ x, rfl⟩).trans (le_max_right _ _) |
| 76 | have hHjoint := continuousOn_scalar_gradient_barrier hC F hR beta |
| 77 | have hHbound (t : ℝ) (ht : t ∈ Ico 0 T) (x : M) : H t x ≤ Cinit + L * T := by |
| 78 | let W := fun y s => H s y - L * s - Cinit |
| 79 | let W' := fun y s => deriv (fun a => H a y) s - L |
| 80 | have htime (s : ℝ) (hs : s ∈ Icc 0 t) : s ∈ Ico 0 T := |
| 81 | ⟨hs.1, hs.2.trans_lt ht.2⟩ |
| 82 | have hinterior (s : ℝ) (hs : s ∈ Ioc 0 t) : s ∈ interior (Ico 0 T) := by |
| 83 | rw [interior_Ico] |
| 84 | exact ⟨hs.1, hs.2.trans_lt ht.2⟩ |
| 85 | have hW : ContinuousOn (Function.uncurry W) (univ ×ˢ Icc 0 t) := by |
| 86 | exact ((hHjoint.comp (continuous_snd.prodMk continuous_fst).continuousOn |
| 87 | (fun z hz => ⟨htime z.2 hz.2, mem_univ z.1⟩)).sub |
| 88 | (continuousOn_const.mul continuousOn_snd)).sub continuousOn_const |
| 89 | have hderiv : ∀ y s, s ∈ Ioc 0 t → |
| 90 | HasDerivWithinAt (W y) (W' y s) (Icc 0 t) s := by |
| 91 | intro y s hs |
| 92 | have hd := differentiableAt_scalar_gradient_barrier hC F (hinterior s hs) y |
| 93 | (hR s (htime s ⟨hs.1.le, hs.2⟩) y) beta |
| 94 | convert ((hd.hasDerivAt.sub ((hasDerivAt_id s).const_mul L)).sub_const Cinit).hasDerivWithinAt |
| 95 | using 1 <;> first | rfl | simp only [W', H, mul_one] |
| 96 | have hmax : ∀ y s, s ∈ Ioc 0 t → 0 < W y s → |
| 97 | (∀ z, W z s ≤ W y s) → W' y s ≤ 0 * W y s := by |
| 98 | intro y s hs _ hbound |
| 99 | have hs' := htime s ⟨hs.1.le, hs.2⟩ |
| 100 | have hD := hC.tensor_calculus 3 M (F.metric s) (F.connection s) |
| 101 | have hnorm := ricci_norm_bounds_of_nonneg (F.connection s) hD y (hRic s hs' y) |
| 102 | have hmaxH : IsLocalMax (H s) y := Filter.Eventually.of_forall (fun z => by |
| 103 | have hz := hbound z |
| 104 | dsimp only [W] at hz |
| 105 | linarith only [hz]) |
| 106 | have hspatial := contMDiff_scalar_gradient_barrier (F.connection s) hD (hR s hs') beta |
| 107 | have hLap := (F.connection s).laplacian_nonpos_of_isLocalMax hspatial hmaxH |
| 108 | have hPDE := scalar_gradient_barrier_evolution_le hC F (hinterior s hs) |
| 109 | (hR s hs') y (hRic s hs' y) hbeta.le hbeta1 |
| 110 | have hdefupper : (F.connection s).ricciNormSq y - |
| 111 | (F.connection s).scalarCurvature y ^ 2 / 3 ≤ |
| 112 | (F.connection s).scalarCurvature y ^ 2 := by |
| 113 | nlinarith only [hnorm.2, sq_nonneg ((F.connection s).scalarCurvature y)] |
| 114 | have hreact := hreaction ((F.connection s).scalarCurvature y) |
| 115 | ((F.connection s).ricciNormSq y - (F.connection s).scalarCurvature y ^ 2 / 3) |
| 116 | (hR s hs' y) hdefupper (hnormalized s hs' y) |
| 117 | change deriv (fun a => H a y) s ≤ (F.connection s).laplacian (H s) y + |
| 118 | 960 * (F.connection s).scalarCurvature y * |
| 119 | ((F.connection s).ricciNormSq y - (F.connection s).scalarCurvature y ^ 2 / 3) - |
| 120 | (4 * beta / 3) * (F.connection s).scalarCurvature y ^ 3 at hPDE |
| 121 | change deriv (fun a => H a y) s - L ≤ 0 * W y s |
| 122 | nlinarith only [hPDE, hLap, hreact] |
| 123 | have hcomp := Poincare.Parabolic.nonpos_of_deriv_le_mul_at_max hW hderiv hmax |
| 124 | (fun y => by simpa only [W, mul_zero, sub_zero] using sub_nonpos.mpr (hinit y)) |
| 125 | have h := hcomp x t ⟨ht.1, le_rfl⟩ |
| 126 | have hLt := mul_le_mul_of_nonneg_left ht.2.le hL |
| 127 | dsimp only [W] at h |
| 128 | linarith only [h, hLt] |
| 129 | let C1 := Cinit + L * T |
| 130 | have hC1 : 0 ≤ C1 := add_nonneg hCinit (mul_nonneg hL hT.le) |
| 131 | obtain ⟨K, hK, habsorb⟩ := exists_linear_cubic_absorption (by positivity : 0 < eta / 2) hC1 |
| 132 | refine ⟨K, hK, ?_⟩ |
| 133 | intro t ht x |
| 134 | have hRx := hR t ht x |
| 135 | have hD := hC.tensor_calculus 3 M (F.metric t) (F.connection t) |
| 136 | have hnorm := ricci_norm_bounds_of_nonneg (F.connection t) hD x (hRic t ht x) |
| 137 | have hbarrier := hHbound t ht x |
| 138 | have hquot : (F.metric t).inner x |
| 139 | ((F.connection t).gradient (F.connection t).scalarCurvature x) |
| 140 | ((F.connection t).gradient (F.connection t).scalarCurvature x) / |
| 141 | (F.connection t).scalarCurvature x ≤ |
| 142 | beta * (F.connection t).scalarCurvature x ^ 2 + C1 := by |
| 143 | dsimp only [H] at hbarrier |
| 144 | change _ ≤ C1 at hbarrier |
| 145 | linarith only [hbarrier, hnorm.1] |
| 146 | have henergy := (div_le_iff₀ hRx).mp hquot |
| 147 | have hlinear := habsorb ((F.connection t).scalarCurvature x) hRx |
| 148 | have hbetacubic := mul_le_mul_of_nonneg_right hbetaeta (pow_nonneg hRx.le 3) |
| 149 | nlinarith only [henergy, hlinear, hbetacubic] |
| 150 | |
| 151 | end PoincareMT.M47Positive |