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.Data.Set.Finite.Basic |
| 2 | |
| 3 | /-! |
| 4 | # Finiteness from bounded finite subsets |
| 5 | |
| 6 | The set-theoretic step in Morgan--Tian, Lemma 17.12, pp. 410-411. |
| 7 | Adapted from `PoincareMT/Proofs/M50/Mathlib/FiniteCardBound.lean` at |
| 8 | Mapher revision `f927d9e1f0810042766d3b5f64d3f4da02ee93cc`. |
| 9 | -/ |
| 10 | |
| 11 | set_option autoImplicit false |
| 12 | |
| 13 | namespace Set |
| 14 | |
| 15 | /-- A common cardinal bound on finite subsets forces finiteness. -/ |
| 16 | theorem finite_of_forall_finset_card_le {α : Type*} (s : Set α) (n : ℕ) |
| 17 | (bound : ∀ A : Finset α, (↑A : Set α) ⊆ s → A.card ≤ n) : |
| 18 | s.Finite := by |
| 19 | classical |
| 20 | by_contra hinfinite |
| 21 | obtain ⟨A, hA, hcard⟩ := Set.Infinite.exists_subset_card_eq hinfinite (n + 1) |
| 22 | have hle : n + 1 ≤ n := by simpa only [hcard] using bound A hA |
| 23 | exact Nat.not_succ_le_self n hle |
| 24 | |
| 25 | end Set |