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.Harnack.Finite |
| 2 | |
| 3 | /-! |
| 4 | # Scalar Harnack from Hamilton block positivity |
| 5 | |
| 6 | The trace of the lower diagonal block gives the scalar Harnack expression |
| 7 | for an arbitrary elapsed time, using Lean's total division also at zero. |
| 8 | -/ |
| 9 | |
| 10 | set_option autoImplicit false |
| 11 | |
| 12 | open scoped Manifold ContDiff Bundle BigOperators |
| 13 | |
| 14 | universe u |
| 15 | |
| 16 | namespace Poincare.RicciFlow.Harnack |
| 17 | |
| 18 | open PoincareMT |
| 19 | |
| 20 | variable {n : ℕ} {M : Type u} [TopologicalSpace M] |
| 21 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] [IsManifold (𝓡 n) ∞ M] |
| 22 | |
| 23 | /-- The trace of the Hamilton block is nonnegative in the vector-zero case. -/ |
| 24 | lemma scalar_harnack_nonneg_of_hamiltonBlockPos |
| 25 | (hC : RicciFlowCurvatureTheory.{u}) {T₀ T₁ : ℝ} |
| 26 | (F : RicciFlow n M (Set.Ioo T₀ T₁)) {t : ℝ} |
| 27 | (_ht : t ∈ Set.Ioo T₀ T₁) (x : M) (τ : ℝ) |
| 28 | (hblock : HamiltonBlockPos F t x τ) : |
| 29 | 0 ≤ (F.connection t).laplacian (F.connection t).scalarCurvature x + |
| 30 | 2 * (F.connection t).ricciNormSq x + (F.connection t).scalarCurvature x / τ := by |
| 31 | have hsum : 0 ≤ ∑ i, hamiltonM (F.connection t) τ x |
| 32 | ((F.metric t).orthonormalBasis x i) ((F.metric t).orthonormalBasis x i) := by |
| 33 | apply Finset.sum_nonneg |
| 34 | intro i _ |
| 35 | exact Matrix.PosSemidef.diag_nonneg hblock (i := Sum.inr i) |
| 36 | calc |
| 37 | 0 ≤ 2 * (∑ i, hamiltonM (F.connection t) τ x |
| 38 | ((F.metric t).orthonormalBasis x i) ((F.metric t).orthonormalBasis x i)) := |
| 39 | mul_nonneg (by norm_num) hsum |
| 40 | _ = _ := by |
| 41 | rw [hamiltonM_trace (F.connection t) |
| 42 | (hC.tensor_calculus n M (F.metric t) (F.connection t)) τ x] |
| 43 | ring |
| 44 | |
| 45 | end Poincare.RicciFlow.Harnack |