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 Mathlib.Topology.Instances.Real.Lemmas |
| 2 | import Mathlib.Analysis.Normed.Field.Basic |
| 3 | import Mathlib.Tactic.FunProp |
| 4 | import Mathlib.Tactic.Linarith |
| 5 | |
| 6 | /-! |
| 7 | # Parameters for distance slabs |
| 8 | |
| 9 | At a fixed positive radial scale the Hessian contribution tends to zero |
| 10 | with the geodesic step. Choosing the smoothing error after that step gives |
| 11 | a positive lower gradient bound with a fixed numerical margin. |
| 12 | -/ |
| 13 | |
| 14 | set_option autoImplicit false |
| 15 | |
| 16 | open Filter Topology |
| 17 | |
| 18 | namespace Poincare.CurvatureIntegral |
| 19 | |
| 20 | theorem exists_positive_slab_parameters {r : ℝ} (hr : 0 < r) (K : ℝ) : |
| 21 | ∃ T ε : ℝ, 0 < T ∧ T < r / 4 ∧ 0 < ε ∧ ε < r / 8 ∧ |
| 22 | 2 * ε / T + (4 / (3 * (r / 2 - T)) + K * (3 * r + T) / 4 + 1) * T / 2 < |
| 23 | 1 / 4 := by |
| 24 | let E : ℝ → ℝ := fun t => |
| 25 | (4 / (3 * (r / 2 - t)) + K * (3 * r + t) / 4 + 1) * t / 2 |
| 26 | have hden : 3 * (r / 2 - 0) ≠ 0 := by |
| 27 | apply ne_of_gt |
| 28 | linarith |
| 29 | have hE : ContinuousAt E 0 := by |
| 30 | dsimp only [E] |
| 31 | fun_prop (disch := first | exact hden | positivity) |
| 32 | have hE0 : E 0 = 0 := by simp [E] |
| 33 | have hev : ∀ᶠ t in 𝓝 (0 : ℝ), E t < 1 / 8 := |
| 34 | hE.eventually_lt continuousAt_const (by rw [hE0]; norm_num) |
| 35 | obtain ⟨δ, hδ, hball⟩ := Metric.eventually_nhds_iff.mp hev |
| 36 | let T := min (δ / 2) (r / 8) |
| 37 | have hT : 0 < T := lt_min (half_pos hδ) (by positivity) |
| 38 | have hTδ : T < δ := (min_le_left _ _).trans_lt (by linarith) |
| 39 | have hTr : T < r / 4 := (min_le_right _ _).trans_lt (by linarith) |
| 40 | have hET : E T < 1 / 8 := by |
| 41 | apply hball |
| 42 | simpa only [Real.dist_eq, sub_zero, abs_of_pos hT] using hTδ |
| 43 | let ε := min (r / 16) (T / 32) |
| 44 | have hε : 0 < ε := lt_min (by positivity) (by positivity) |
| 45 | have hεr : ε < r / 8 := (min_le_left _ _).trans_lt (by linarith) |
| 46 | have herr : 2 * ε / T ≤ 1 / 16 := by |
| 47 | apply (div_le_iff₀ hT).mpr |
| 48 | have hle : ε ≤ T / 32 := min_le_right _ _ |
| 49 | linarith |
| 50 | refine ⟨T, ε, hT, hTr, hε, hεr, ?_⟩ |
| 51 | change 2 * ε / T + E T < 1 / 4 |
| 52 | linarith only [herr, hET] |
| 53 | |
| 54 | end Poincare.CurvatureIntegral |