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.Calculus |
| 2 | import PoincareLib.Geometry.RicciFlow.Harnack.Matrix.Spacetime |
| 3 | import PoincareLib.Geometry.RicciFlow.Harnack.Matrix.Evolution.P |
| 4 | import PoincareLib.Geometry.RicciFlow.Tensor.HeatGradient.Three |
| 5 | |
| 6 | /-! |
| 7 | # Heat-gradient commutation for Hamilton's P |
| 8 | |
| 9 | The actual Ricci-flow tensor satisfies the three-slot commutator with no |
| 10 | additional regularity certificate. Contracting the derivative and first |
| 11 | tensor slots gives the spatial commutator used in Chow et al., Part II, |
| 12 | (15.48), printed p. 275 (PDF p. 302). |
| 13 | -/ |
| 14 | |
| 15 | set_option autoImplicit false |
| 16 | set_option backward.isDefEq.respectTransparency false |
| 17 | |
| 18 | open scoped Manifold ContDiff Bundle Topology BigOperators |
| 19 | |
| 20 | universe u |
| 21 | |
| 22 | namespace Poincare.RicciFlow.Harnack |
| 23 | |
| 24 | open PoincareMT |
| 25 | |
| 26 | variable {n : ℕ} {M : Type u} [TopologicalSpace M] |
| 27 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] [IsManifold (𝓡 n) ∞ M] |
| 28 | {J : Set ℝ} |
| 29 | |
| 30 | theorem tensorHeatOperator_covariantHamiltonP_commutator |
| 31 | (hC : RicciFlowCurvatureCalculus.{u}) (F : RicciFlow n M J) |
| 32 | {t : ℝ} (ht : t ∈ interior J) (x : M) |
| 33 | (a b c d : TangentSpace (𝓡 n) x) : |
| 34 | let D := F.connection t |
| 35 | let e := (F.metric t).orthonormalBasis x |
| 36 | let P : ℝ → CovariantTensorEvaluation n M 3 := fun s y z => |
| 37 | hamiltonP (F.connection s) y (z 0) (z 1) (z 2) |
| 38 | F.tensorHeatOperator (fun s => (F.connection s).covariantTensorDerivative (P s)) t x ![a, b, c, d] - |
| 39 | D.covariantTensorDerivative (F.tensorHeatOperator P t) x ![a, b, c, d] = |
| 40 | 2 * (∑ i, ∑ j, D.curvatureTensor x a (e i) b (e j) * |
| 41 | D.covariantTensorDerivative (P t) x ![e i, e j, c, d]) + |
| 42 | 2 * (∑ i, ∑ j, D.curvatureTensor x a (e i) c (e j) * |
| 43 | D.covariantTensorDerivative (P t) x ![e i, b, e j, d]) + |
| 44 | 2 * (∑ i, ∑ j, D.curvatureTensor x a (e i) d (e j) * |
| 45 | D.covariantTensorDerivative (P t) x ![e i, b, c, e j]) := by |
| 46 | let P : ℝ → CovariantTensorEvaluation n M 3 := fun s y z => |
| 47 | hamiltonP (F.connection s) y (z 0) (z 1) (z 2) |
| 48 | let W : ℝ → CovariantTensorEvaluation n M 3 := fun s y z => |
| 49 | deriv (fun r => P r y z) s |
| 50 | apply F.tensorHeatOperator_covariantTensorDerivative_commutator_three (W := W) hC ht |
| 51 | · exact fun s => hamiltonP_isSmoothCovariantTensor (F.connection s) |
| 52 | (hC.tensor_calculus n M (F.metric s) (F.connection s)) |
| 53 | · exact fun _ _ hX => contMDiffAt_hamiltonP_fields hC F ht hX |
| 54 | · intro y z |
| 55 | exact (hasDerivAt_hamiltonP_evolution hC F ht y (z 0) (z 1) (z 2)).differentiableAt.hasDerivAt |
| 56 | |
| 57 | end Poincare.RicciFlow.Harnack |