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.Riemannian.MinimalSurface.Sphere.Analysis.Logarithm.QuadraticDerivative |
| 2 | import PoincareLib.Geometry.RicciFlow.Area.MinimalSphere.Round.Laplacian |
| 3 | |
| 4 | /-! |
| 5 | # The source curvature term in stereographic coordinates |
| 6 | |
| 7 | Morgan-Tian Claim 18.12, printed pp. 426-427, coordinate curvature |
| 8 | derivation. For the frozen density sigma=16/(|z|^2+4)^2, its Euclidean |
| 9 | logarithmic Laplacian is -2*sigma, with the radius-one normalization. |
| 10 | -/ |
| 11 | |
| 12 | set_option autoImplicit false |
| 13 | set_option backward.isDefEq.respectTransparency false |
| 14 | |
| 15 | open scoped ContDiff BigOperators |
| 16 | |
| 17 | namespace PoincareMT |
| 18 | |
| 19 | /-- The logarithmic round density is smooth on the entire plane. |
| 20 | Source: MT Claim 18.12, pp. 426-427, source curvature derivation. -/ |
| 21 | theorem m60SphereParameter_logDensity_contDiff : |
| 22 | ContDiff ℝ ∞ (fun z : LoopPlane => Real.log (16 / (‖z‖ ^ 2 + 4) ^ 2)) := by |
| 23 | apply ContDiff.log |
| 24 | · exact contDiff_const.div (((contDiff_norm_sq ℝ).add contDiff_const).pow 2) |
| 25 | (by intro z; positivity) |
| 26 | · intro z |
| 27 | positivity |
| 28 | |
| 29 | /-- The exact Euclidean logarithmic Laplacian of the round density. |
| 30 | Source: MT Claim 18.12, pp. 426-427, source curvature derivation. -/ |
| 31 | theorem m60SphereParameter_logDensity_laplacian (z : LoopPlane) : |
| 32 | (∑ i : Fin 2, fderiv ℝ (fun y => fderiv ℝ |
| 33 | (fun x : LoopPlane => Real.log (16 / (‖x‖ ^ 2 + 4) ^ 2)) y |
| 34 | (EuclideanSpace.basisFun (Fin 2) ℝ i)) z |
| 35 | (EuclideanSpace.basisFun (Fin 2) ℝ i)) = |
| 36 | -2 * (16 / (‖z‖ ^ 2 + 4) ^ 2) := by |
| 37 | let q : LoopPlane → ℝ := fun x => Real.log (‖x‖ ^ 2 + 4) |
| 38 | have hq : ContDiff ℝ ∞ q := |
| 39 | ((contDiff_norm_sq ℝ).add contDiff_const).log (by intro x; positivity) |
| 40 | have heq : (fun x : LoopPlane => Real.log (16 / (‖x‖ ^ 2 + 4) ^ 2)) = |
| 41 | (fun x => Real.log 16 - 2 * q x) := by |
| 42 | funext x |
| 43 | rw [Real.log_div (by norm_num) (by positivity), Real.log_pow] |
| 44 | rfl |
| 45 | have hfirst (x v : LoopPlane) : |
| 46 | fderiv ℝ (fun x : LoopPlane => Real.log (16 / (‖x‖ ^ 2 + 4) ^ 2)) x v = |
| 47 | -2 * fderiv ℝ q x v := by |
| 48 | rw [heq, fderiv_const_sub, fderiv_const_mul (hq.differentiable (by simp) x)] |
| 49 | simp only [neg_apply, smul_apply, smul_eq_mul] |
| 50 | ring |
| 51 | have hsecond (v : LoopPlane) : |
| 52 | fderiv ℝ (fun y => fderiv ℝ |
| 53 | (fun x : LoopPlane => Real.log (16 / (‖x‖ ^ 2 + 4) ^ 2)) y v) z v = |
| 54 | -2 * (2 * ‖v‖ ^ 2 / (‖z‖ ^ 2 + 4) - |
| 55 | 4 * (inner ℝ z v) ^ 2 / (‖z‖ ^ 2 + 4) ^ 2) := by |
| 56 | simp_rw [hfirst] |
| 57 | have hd : DifferentiableAt ℝ (fun y => fderiv ℝ q y v) z := |
| 58 | ((hq.contDiffAt.fderiv_right (m := ∞) (by simp)).clm_apply contDiffAt_const).differentiableAt |
| 59 | (by simp) |
| 60 | rw [fderiv_const_mul hd] |
| 61 | simp only [smul_apply, smul_eq_mul] |
| 62 | rw [M60.second_fderiv_log_norm_sq_add 4 (by norm_num)] |
| 63 | rw [Fin.sum_univ_two, hsecond, hsecond] |
| 64 | simp only [OrthonormalBasis.norm_eq_one, one_pow] |
| 65 | have hs : (inner ℝ z (EuclideanSpace.basisFun (Fin 2) ℝ 0)) ^ 2 + |
| 66 | (inner ℝ z (EuclideanSpace.basisFun (Fin 2) ℝ 1)) ^ 2 = ‖z‖ ^ 2 := by |
| 67 | simpa only [Fin.sum_univ_two, real_inner_comm] using |
| 68 | (EuclideanSpace.basisFun (Fin 2) ℝ).sum_sq_inner_right z |
| 69 | have hden : ‖z‖ ^ 2 + 4 ≠ 0 := by positivity |
| 70 | field_simp |
| 71 | nlinarith |
| 72 | |
| 73 | end PoincareMT |