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.Finset.Max |
| 2 | import Mathlib.Order.Interval.Set.Basic |
| 3 | |
| 4 | /-! |
| 5 | # Propagation through finitely many ordered events |
| 6 | |
| 7 | A property propagating on event-free intervals and across each |
| 8 | event holds on the whole ordered interval. Used for uniqueness of |
| 9 | the actual surgery transports in Morgan--Tian Proposition 16.5, |
| 10 | pp. 374-375; see M44 derivation 56. |
| 11 | -/ |
| 12 | |
| 13 | set_option autoImplicit false |
| 14 | |
| 15 | open Set |
| 16 | |
| 17 | namespace Poincare |
| 18 | |
| 19 | /-- Propagate a property through a finite ordered event set, |
| 20 | using all preceding values when crossing an event. -/ |
| 21 | theorem finite_event_induction {α : Type*} [LinearOrder α] |
| 22 | (S : Finset α) {a b : α} (hS : (S : Set α) ⊆ Ioc a b) |
| 23 | (Q : α → Prop) (hinit : Q a) |
| 24 | (hregular : ∀ s ∈ Icc a b, ∀ t ∈ Icc a b, s < t → |
| 25 | Disjoint (S : Set α) (Ioc s t) → Q s → Q t) |
| 26 | (hevent : ∀ t ∈ S, (∀ s ∈ Ico a t, Q s) → Q t) : |
| 27 | ∀ t ∈ Icc a b, Q t := by |
| 28 | classical |
| 29 | induction S using Finset.induction_on_min generalizing a b with |
| 30 | | empty => |
| 31 | intro t ht |
| 32 | rcases ht.1.eq_or_lt with heq | hlt |
| 33 | · simpa only [← heq] using hinit |
| 34 | · exact hregular a ⟨le_rfl, ht.1.trans ht.2⟩ t ht hlt (by simp) hinit |
| 35 | | insert z S hmin ih => |
| 36 | have hz : z ∈ Ioc a b := hS (by simp) |
| 37 | have hbefore : ∀ t ∈ Ico a z, Q t := by |
| 38 | intro t ht |
| 39 | rcases ht.1.eq_or_lt with heq | hlt |
| 40 | · simpa only [← heq] using hinit |
| 41 | · apply hregular a ⟨le_rfl, hz.1.le.trans hz.2⟩ t |
| 42 | ⟨ht.1, ht.2.le.trans hz.2⟩ hlt _ hinit |
| 43 | apply Set.disjoint_left.mpr |
| 44 | intro x hx hxt |
| 45 | rcases Finset.mem_insert.mp hx with rfl | hx |
| 46 | · exact (not_le_of_gt ht.2) hxt.2 |
| 47 | · exact (not_lt_of_ge (hxt.2.trans ht.2.le)) (hmin x hx) |
| 48 | have hQz : Q z := hevent z (by simp) hbefore |
| 49 | have hS' : (S : Set α) ⊆ Ioc z b := by |
| 50 | intro x hx |
| 51 | exact ⟨hmin x hx, (hS (Finset.mem_insert_of_mem hx)).2⟩ |
| 52 | have hregular' : ∀ s ∈ Icc z b, ∀ t ∈ Icc z b, s < t → |
| 53 | Disjoint (S : Set α) (Ioc s t) → Q s → Q t := by |
| 54 | intro s hs t ht hst hfree hQs |
| 55 | apply hregular s ⟨hz.1.le.trans hs.1, hs.2⟩ t |
| 56 | ⟨hz.1.le.trans ht.1, ht.2⟩ hst _ hQs |
| 57 | apply Set.disjoint_left.mpr |
| 58 | intro x hx hxt |
| 59 | rcases Finset.mem_insert.mp hx with rfl | hx |
| 60 | · exact (not_lt_of_ge hs.1) hxt.1 |
| 61 | · exact Set.disjoint_left.mp hfree hx hxt |
| 62 | have hevent' : ∀ t ∈ S, (∀ s ∈ Ico z t, Q s) → Q t := by |
| 63 | intro t ht hprev |
| 64 | apply hevent t (Finset.mem_insert_of_mem ht) |
| 65 | intro s hs |
| 66 | by_cases hsz : s < z |
| 67 | · exact hbefore s ⟨hs.1, hsz⟩ |
| 68 | · exact hprev s ⟨le_of_not_gt hsz, hs.2⟩ |
| 69 | intro t ht |
| 70 | by_cases htz : t < z |
| 71 | · exact hbefore t ⟨ht.1, htz⟩ |
| 72 | · exact ih hS' hQz hregular' hevent' t ⟨le_of_not_gt htz, ht.2⟩ |
| 73 | |
| 74 | end Poincare |