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.Curvature.Theory |
| 2 | import Mathlib.Analysis.Calculus.Deriv.Inv |
| 3 | import Mathlib.Tactic.FieldSimp |
| 4 | import Mathlib.Tactic.Ring |
| 5 | |
| 6 | /-! |
| 7 | # Evolution of Hamilton's singular-time correction |
| 8 | |
| 9 | The Ricci term `Ric / (2 * (t - T₀))` in Hamilton's two-tensor has a |
| 10 | time derivative supplied by the Ricci evolution equation and the quotient |
| 11 | rule. This is one term of the tensor evolution, not matrix positivity. |
| 12 | |
| 13 | See Chow et al., Part II, equation (15.9), PDF p. 288, and the tensor |
| 14 | evolution calculation in Section 15.2. |
| 15 | -/ |
| 16 | |
| 17 | set_option autoImplicit false |
| 18 | |
| 19 | open scoped Manifold ContDiff Bundle |
| 20 | |
| 21 | universe u |
| 22 | |
| 23 | namespace Poincare.RicciFlow.Harnack |
| 24 | |
| 25 | open PoincareMT |
| 26 | |
| 27 | variable {n : ℕ} {M : Type u} [TopologicalSpace M] |
| 28 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] [IsManifold (𝓡 n) ∞ M] |
| 29 | |
| 30 | /-- The singular-time Ricci correction has its geometric evolution value on |
| 31 | fixed tangent inputs, including within-domain derivatives at endpoints. -/ |
| 32 | lemma ricci_timeCorrection_hasDerivWithinAt |
| 33 | (hC : RicciFlowCurvatureTheory.{u}) (J : Set ℝ) (F : RicciFlow n M J) |
| 34 | (T₀ t : ℝ) (ht : t ∈ J) (hT : t ≠ T₀) |
| 35 | (x : M) (u v : TangentSpace (𝓡 n) x) : |
| 36 | HasDerivWithinAt (fun s ↦ (F.connection s).ricci x u v / (2 * (s - T₀))) |
| 37 | (((F.connection t).tensorLaplacian (F.connection t).ricciEvaluation x ![u, v] + |
| 38 | (F.connection t).ricciReaction x u v) / (2 * (t - T₀)) - |
| 39 | (F.connection t).ricci x u v / (2 * (t - T₀) ^ 2)) J t := by |
| 40 | have hden : HasDerivWithinAt (fun s : ℝ ↦ 2 * (s - T₀)) 2 J t := by |
| 41 | simpa using (((hasDerivAt_id t).sub_const T₀).const_mul 2).hasDerivWithinAt |
| 42 | have hne : t - T₀ ≠ 0 := sub_ne_zero.mpr hT |
| 43 | apply ((hC.ricci_evolution n M J F t ht x u v).fun_div hden |
| 44 | (mul_ne_zero (by norm_num) hne)).congr_deriv |
| 45 | field_simp [hne] |
| 46 | |
| 47 | /-- At an interior time, the same formula gives the ordinary derivative. -/ |
| 48 | lemma ricci_timeCorrection_hasDerivAt |
| 49 | (hC : RicciFlowCurvatureTheory.{u}) (J : Set ℝ) (F : RicciFlow n M J) |
| 50 | (T₀ t : ℝ) (ht : t ∈ interior J) (hT : t ≠ T₀) |
| 51 | (x : M) (u v : TangentSpace (𝓡 n) x) : |
| 52 | HasDerivAt (fun s ↦ (F.connection s).ricci x u v / (2 * (s - T₀))) |
| 53 | (((F.connection t).tensorLaplacian (F.connection t).ricciEvaluation x ![u, v] + |
| 54 | (F.connection t).ricciReaction x u v) / (2 * (t - T₀)) - |
| 55 | (F.connection t).ricci x u v / (2 * (t - T₀) ^ 2)) t := by |
| 56 | exact (ricci_timeCorrection_hasDerivWithinAt hC J F T₀ t |
| 57 | (interior_subset ht) hT x u v).hasDerivAt (mem_interior_iff_mem_nhds.mp ht) |
| 58 | |
| 59 | end Poincare.RicciFlow.Harnack |