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.Integrability |
| 2 | import PoincareLib.Geometry.Riemannian.LoopSpace.Area.Polar.Integration |
| 3 | import PoincareLib.Geometry.Riemannian.MinimalSurface.Sphere.Compatibility.ShortLoops |
| 4 | import Mathlib.MeasureTheory.Integral.IntegralEqImproper |
| 5 | |
| 6 | /-! |
| 7 | # Exact integral of the round stereographic factor |
| 8 | |
| 9 | Morgan-Tian Claim 18.12, printed pp. 426-427. The normalization of the |
| 10 | fixed inverse chart gives total area 4*pi. Polar coordinates reduce the |
| 11 | calculation to the derivative of -8/(r^2+4) on the positive half-line. |
| 12 | -/ |
| 13 | |
| 14 | set_option autoImplicit false |
| 15 | set_option backward.isDefEq.respectTransparency false |
| 16 | |
| 17 | open Set Filter MeasureTheory |
| 18 | open scoped Topology |
| 19 | |
| 20 | namespace PoincareMT |
| 21 | |
| 22 | /-- The radial integral of the actual round stereographic density. |
| 23 | Source: MT Claim 18.12, pp. 426-427, round-volume normalization. -/ |
| 24 | theorem m60SphereParameter_radial_integral : |
| 25 | (∫ r in Ioi (0 : ℝ), r * (16 / (r ^ 2 + 4) ^ 2)) = 2 := by |
| 26 | have hd (r : ℝ) : HasDerivAt (fun s : ℝ => -8 / (s ^ 2 + 4)) |
| 27 | (r * (16 / (r ^ 2 + 4) ^ 2)) r := by |
| 28 | have h := (hasDerivAt_const r (-8 : ℝ)).div |
| 29 | (((hasDerivAt_id r).pow 2).add_const 4) |
| 30 | (show r ^ 2 + 4 ≠ 0 by positivity) |
| 31 | convert! h using 1 |
| 32 | simp only [Pi.pow_apply, id_eq] |
| 33 | ring |
| 34 | have hlim : Tendsto (fun r : ℝ => -8 / (r ^ 2 + 4)) atTop (𝓝 0) := by |
| 35 | have hsq : Tendsto (fun r : ℝ => r ^ 2 + 4) atTop atTop := |
| 36 | tendsto_atTop_add_const_right atTop 4 (tendsto_pow_atTop (by decide : (2 : ℕ) ≠ 0)) |
| 37 | simpa only [Function.comp_def, div_eq_mul_inv, mul_zero] using |
| 38 | (tendsto_inv_atTop_zero.comp hsq).const_mul (-8 : ℝ) |
| 39 | have h := integral_Ioi_of_hasDerivAt_of_nonneg' |
| 40 | (a := (0 : ℝ)) (fun r _ => hd r) |
| 41 | (fun r hr => mul_nonneg hr.le (by positivity)) hlim |
| 42 | norm_num at h |
| 43 | exact h |
| 44 | |
| 45 | /-- The actual stereographic factor integrates to 4*pi, with independent |
| 46 | integrability supplied by `m60SphereParameter_factor_integrable`. |
| 47 | Source: MT Claim 18.12, pp. 426-427. -/ |
| 48 | theorem m60SphereParameter_factor_integral : |
| 49 | (∫ z : LoopPlane, 16 / (‖z‖ ^ 2 + 4) ^ 2) = 4 * Real.pi := by |
| 50 | rw [← Proofs.M58.integral_polar_loopPlane, polarCoord_target] |
| 51 | calc |
| 52 | _ = ∫ p in Ioi (0 : ℝ) ×ˢ Ioo (-Real.pi) Real.pi, |
| 53 | (p.1 * (16 / (p.1 ^ 2 + 4) ^ 2)) * (1 : ℝ) := by |
| 54 | apply setIntegral_congr_fun (measurableSet_Ioi.prod measurableSet_Ioo) |
| 55 | intro p hp |
| 56 | dsimp only |
| 57 | rw [norm_smul, Real.norm_eq_abs, abs_of_pos hp.1, |
| 58 | Proofs.M58.norm_angularPoint, mul_one, mul_one] |
| 59 | _ = (∫ r in Ioi (0 : ℝ), r * (16 / (r ^ 2 + 4) ^ 2)) * |
| 60 | (∫ t in Ioo (-Real.pi) Real.pi, (1 : ℝ)) := by |
| 61 | change (∫ p in Ioi (0 : ℝ) ×ˢ Ioo (-Real.pi) Real.pi, |
| 62 | (p.1 * (16 / (p.1 ^ 2 + 4) ^ 2)) * (1 : ℝ) ∂volume.prod volume) = _ |
| 63 | exact setIntegral_prod_mul (fun r : ℝ => r * (16 / (r ^ 2 + 4) ^ 2)) |
| 64 | (fun _ : ℝ => 1) (Ioi (0 : ℝ)) (Ioo (-Real.pi) Real.pi) |
| 65 | _ = 4 * Real.pi := by |
| 66 | rw [m60SphereParameter_radial_integral] |
| 67 | simp only [integral_const, Measure.real, Measure.restrict_apply_univ, Real.volume_Ioo, |
| 68 | ENNReal.toReal_ofReal (by linarith [Real.pi_pos] : 0 ≤ Real.pi - -Real.pi), |
| 69 | smul_eq_mul, mul_one] |
| 70 | ring |
| 71 | |
| 72 | end PoincareMT |