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.Order.MonotoneConvergence |
| 2 | import Mathlib.Topology.Instances.Real.Lemmas |
| 3 | |
| 4 | /-! # Subsequence selection above prescribed thresholds -/ |
| 5 | |
| 6 | open Set Filter |
| 7 | |
| 8 | namespace Poincare.CurvatureIntegral |
| 9 | |
| 10 | /-- A sequence of unbounded rows admits a strictly increasing diagonal |
| 11 | selection exceeding any prescribed finite thresholds. -/ |
| 12 | theorem exists_strictMono_above_thresholds_family |
| 13 | (a : ℕ → ℕ → ℝ) (b : ℕ → ℝ) |
| 14 | (hlarge : ∀ k, ∀ C : ℝ, ∃ j : ℕ, C < a k j) : |
| 15 | ∃ phi : ℕ → ℕ, StrictMono phi ∧ ∀ k, b k < a k (phi k) := by |
| 16 | classical |
| 17 | have hnext (i k : ℕ) : ∃ j : ℕ, i < j ∧ b k < a k j := by |
| 18 | obtain ⟨C, hC⟩ := ((Set.finite_Iic i).image (a k)).bddAbove |
| 19 | obtain ⟨j, hj⟩ := hlarge k (max C (b k)) |
| 20 | refine ⟨j, ?_, (le_max_right _ _).trans_lt hj⟩ |
| 21 | by_contra hji |
| 22 | have := hC ⟨j, not_lt.mp hji, rfl⟩ |
| 23 | exact (not_le_of_gt ((le_max_left _ _).trans_lt hj)) this |
| 24 | choose next hindex hvalue using hnext |
| 25 | let phi : ℕ → ℕ := fun k => Nat.rec (next 0 0) (fun i j => next j (i + 1)) k |
| 26 | refine ⟨phi, strictMono_nat_of_lt_succ (fun k => hindex (phi k) (k + 1)), ?_⟩ |
| 27 | intro k |
| 28 | cases k with |
| 29 | | zero => exact hvalue 0 0 |
| 30 | | succ k => exact hvalue (phi k) (k + 1) |
| 31 | |
| 32 | /-- An unbounded real sequence has a strictly increasing selection exceeding |
| 33 | any prescribed sequence of finite thresholds. -/ |
| 34 | theorem exists_strictMono_above_thresholds |
| 35 | (a b : ℕ → ℝ) (hlarge : ∀ C : ℝ, ∃ j : ℕ, C < a j) : |
| 36 | ∃ phi : ℕ → ℕ, StrictMono phi ∧ ∀ k, b k < a (phi k) := |
| 37 | exists_strictMono_above_thresholds_family (fun _ => a) b (fun _ => hlarge) |
| 38 | |
| 39 | end Poincare.CurvatureIntegral |