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.Algebra.Order.Archimedean.Real.Basic |
| 2 | import Mathlib.Tactic.Linarith |
| 3 | |
| 4 | /-! |
| 5 | # A bad point controlling all earlier points above twice its value |
| 6 | |
| 7 | A bounded nonempty set of bad values has a point above half its |
| 8 | supremum. Transitivity of an arbitrary preorder clock then excludes |
| 9 | earlier bad points with twice that value. No maximum is required. |
| 10 | Source: the point selection in Morgan-Tian Theorem 12.28, pp. 323-324; |
| 11 | M34 bad-point selection derivation, section 2. |
| 12 | -/ |
| 13 | |
| 14 | set_option autoImplicit false |
| 15 | |
| 16 | open Set |
| 17 | |
| 18 | namespace PoincareMT.M34 |
| 19 | |
| 20 | /-- A positive bad seed and an upper bound on earlier bad values give |
| 21 | a bad point with all earlier sufficiently high points good. -/ |
| 22 | theorem exists_bad_point_with_earlier_good |
| 23 | {X T : Type*} [Preorder T] (time : X → T) (value : X → ℝ) (Good : X → Prop) |
| 24 | (p0 : X) (hbad : ¬ Good p0) (hpositive : 0 < value p0) |
| 25 | (hbound : BddAbove (value '' {p | time p ≤ time p0 ∧ ¬ Good p})) : |
| 26 | ∃ p : X, time p ≤ time p0 ∧ ¬ Good p ∧ value p0 / 2 < value p ∧ |
| 27 | ∀ q : X, time q ≤ time p → 2 * value p ≤ value q → Good q := by |
| 28 | classical |
| 29 | let V := value '' {p | time p ≤ time p0 ∧ ¬ Good p} |
| 30 | have hseed : value p0 ∈ V := ⟨p0, ⟨le_rfl, hbad⟩, rfl⟩ |
| 31 | have hsup : value p0 ≤ sSup V := le_csSup hbound hseed |
| 32 | have hhalf : sSup V / 2 < sSup V := by linarith |
| 33 | obtain ⟨a, ⟨p, ⟨ht, hp⟩, rfl⟩, ha⟩ := exists_lt_of_lt_csSup ⟨value p0, hseed⟩ hhalf |
| 34 | refine ⟨p, ht, hp, by linarith, ?_⟩ |
| 35 | intro q hq hv |
| 36 | by_contra hbadq |
| 37 | have hqbound : value q ≤ sSup V := |
| 38 | le_csSup hbound ⟨q, ⟨hq.trans ht, hbadq⟩, rfl⟩ |
| 39 | linarith |
| 40 | |
| 41 | end PoincareMT.M34 |