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.Matrix.Tensors |
| 2 | |
| 3 | /-! # The reaction term in Hamilton's three-tensor evolution -/ |
| 4 | |
| 5 | set_option autoImplicit false |
| 6 | |
| 7 | open scoped Manifold ContDiff Bundle BigOperators |
| 8 | |
| 9 | universe u |
| 10 | |
| 11 | namespace Poincare.RicciFlow.Harnack |
| 12 | |
| 13 | open PoincareMT |
| 14 | |
| 15 | variable {n : ℕ} {M : Type u} [TopologicalSpace M] |
| 16 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] [IsManifold (𝓡 n) ∞ M] |
| 17 | {g : RiemannianMetric n M} |
| 18 | |
| 19 | /-- The four contractions in Chow et al., Part II, (15.45), with the |
| 20 | retained curvature convention. -/ |
| 21 | noncomputable def hamiltonPReaction (D : LeviCivitaData g) : CovariantTensorEvaluation n M 3 := |
| 22 | fun x z => |
| 23 | let e := g.orthonormalBasis x |
| 24 | 2 * (∑ i, ∑ j, D.curvatureTensor x (z 0) (e i) (z 1) (e j) * |
| 25 | hamiltonP D x (e i) (e j) (z 2)) + |
| 26 | 2 * (∑ i, ∑ j, D.curvatureTensor x (z 0) (e i) (z 2) (e j) * |
| 27 | hamiltonP D x (e i) (z 1) (e j)) + |
| 28 | 2 * (∑ i, ∑ j, D.curvatureTensor x (z 1) (e i) (z 2) (e j) * |
| 29 | hamiltonP D x (z 0) (e i) (e j)) - |
| 30 | 2 * (∑ i, ∑ j, D.ricci x (e i) (e j) * |
| 31 | D.covariantTensorDerivative D.riemannEvaluation x ![e i, z 0, z 1, z 2, e j]) |
| 32 | |
| 33 | end Poincare.RicciFlow.Harnack |