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.Basic |
| 2 | import PoincareLib.Geometry.Riemannian.MetricComparison |
| 3 | import Mathlib.Analysis.Calculus.Deriv.MeanValue |
| 4 | |
| 5 | /-! |
| 6 | # Metric monotonicity under nonnegative Ricci curvature |
| 7 | |
| 8 | The Ricci-flow equation makes squared tangent lengths nonincreasing when |
| 9 | Ricci curvature is nonnegative. Applied on a reference-time ball, this gives |
| 10 | the ball inclusion used in Cabezas-Rivas--Wilking, Proposition 4.3, p. 3161. |
| 11 | -/ |
| 12 | |
| 13 | set_option autoImplicit false |
| 14 | |
| 15 | open Set |
| 16 | open scoped Manifold ContDiff Bundle |
| 17 | |
| 18 | universe u |
| 19 | |
| 20 | namespace PoincareMT.RicciFlow |
| 21 | |
| 22 | variable {n : ℕ} {M : Type u} [TopologicalSpace M] |
| 23 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] [IsManifold (𝓡 n) ∞ M] |
| 24 | {J : Set ℝ} |
| 25 | |
| 26 | /-- Nonnegative Ricci curvature on a fixed tangent vector makes its squared |
| 27 | length nonincreasing in time. -/ |
| 28 | theorem antitoneOn_metric_inner_self_of_ricci_nonneg |
| 29 | (F : RicciFlow n M J) {a b : ℝ} (hJ : Icc a b ⊆ interior J) |
| 30 | (x : M) (v : TangentSpace (𝓡 n) x) |
| 31 | (hRic : ∀ t ∈ Icc a b, 0 ≤ (F.connection t).ricci x v v) : |
| 32 | AntitoneOn (fun t => (F.metric t).inner x v v) (Icc a b) := by |
| 33 | have hd (t : ℝ) (ht : t ∈ Icc a b) : |
| 34 | HasDerivAt (fun s => (F.metric s).inner x v v) |
| 35 | (-2 * (F.connection t).ricci x v v) t := |
| 36 | (F.equation t (interior_subset (hJ ht)) x v v).hasDerivAt |
| 37 | (mem_interior_iff_mem_nhds.mp (hJ ht)) |
| 38 | apply antitoneOn_of_deriv_nonpos (convex_Icc a b) |
| 39 | (fun t ht => (hd t ht).continuousAt.continuousWithinAt) |
| 40 | (fun t ht => (hd t (interior_subset ht)).differentiableAt.differentiableWithinAt) |
| 41 | intro t ht |
| 42 | rw [(hd t (interior_subset ht)).deriv] |
| 43 | exact mul_nonpos_of_nonpos_of_nonneg (by norm_num) (hRic t (interior_subset ht)) |
| 44 | |
| 45 | /-- The tangent norm also decreases under nonnegative Ricci curvature. -/ |
| 46 | theorem tangentNorm_le_of_ricci_nonneg |
| 47 | (F : RicciFlow n M J) {a b : ℝ} (hJ : Icc a b ⊆ interior J) |
| 48 | (x : M) (v : TangentSpace (𝓡 n) x) |
| 49 | (hRic : ∀ τ ∈ Icc a b, 0 ≤ (F.connection τ).ricci x v v) |
| 50 | {s t : ℝ} (hs : s ∈ Icc a b) (ht : t ∈ Icc a b) (hst : s ≤ t) : |
| 51 | (F.metric t).tangentNorm x v ≤ (F.metric s).tangentNorm x v := |
| 52 | Real.sqrt_le_sqrt (F.antitoneOn_metric_inner_self_of_ricci_nonneg hJ x v hRic hs ht hst) |
| 53 | |
| 54 | /-- Nonnegative Ricci curvature on a reference-time ball makes that ball |
| 55 | contained in the same-radius ball at each later time. -/ |
| 56 | theorem ball_subset_ball_of_ricci_nonneg |
| 57 | (F : RicciFlow n M J) {a b : ℝ} (hJ : Icc a b ⊆ interior J) |
| 58 | (p : M) (r : ℝ) {s t : ℝ} |
| 59 | (hs : s ∈ Icc a b) (ht : t ∈ Icc a b) (hst : s ≤ t) |
| 60 | (hRic : ∀ τ ∈ Icc a b, ∀ x ∈ (F.metric s).ball p r, |
| 61 | ∀ v : TangentSpace (𝓡 n) x, 0 ≤ (F.connection τ).ricci x v v) : |
| 62 | (F.metric s).ball p r ⊆ (F.metric t).ball p r := by |
| 63 | simpa only [one_mul] using |
| 64 | RiemannianMetric.ball_subset_ball_of_tangentNorm_le |
| 65 | (F.metric s) (F.metric t) p r 1 zero_lt_one (by |
| 66 | intro x hx v |
| 67 | simpa only [one_mul] using F.tangentNorm_le_of_ricci_nonneg hJ x v |
| 68 | (fun τ hτ => hRic τ hτ x hx v) hs ht hst) |
| 69 | |
| 70 | end PoincareMT.RicciFlow |