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.Lemmas |
| 2 | import Mathlib.Order.WellFoundedSet |
| 3 | import Mathlib.Order.Interval.Set.LinearOrder |
| 4 | import Mathlib.Data.Real.Basic |
| 5 | |
| 6 | /-! |
| 7 | # Forward induction with finitely many included surgery times |
| 8 | |
| 9 | Morgan--Tian p. 393. Ordinary propagation covers the intervals after |
| 10 | the latest event; the event step may use all earlier included times. |
| 11 | -/ |
| 12 | |
| 13 | set_option autoImplicit false |
| 14 | |
| 15 | open Set |
| 16 | |
| 17 | namespace PoincareMT.Proofs.M46 |
| 18 | |
| 19 | private theorem propagation_from_event_values {a b : ℝ} {S : Set ℝ} |
| 20 | (hab : a ≤ b) (hfinite : (S ∩ Ioc a b).Finite) (Q : ℝ → Prop) (ha : Q a) |
| 21 | (hordinary : ∀ s ∈ Icc a b, ∀ t ∈ Icc a b, s ≤ t → |
| 22 | Disjoint S (Ioc s t) → Q s → Q t) |
| 23 | (hevents : ∀ t ∈ S ∩ Ioc a b, Q t) : Q b := by |
| 24 | classical |
| 25 | by_cases hn : (S ∩ Ioc a b).Nonempty |
| 26 | · obtain ⟨t, ht, hmax⟩ := (S ∩ Ioc a b).exists_max_image id hfinite hn |
| 27 | apply hordinary t ⟨ht.2.1.le, ht.2.2⟩ b ⟨hab, le_rfl⟩ ht.2.2 |
| 28 | · apply Set.disjoint_left.mpr |
| 29 | intro s hs hst |
| 30 | exact (hmax s ⟨hs, ht.2.1.trans hst.1, hst.2⟩).not_gt hst.1 |
| 31 | · exact hevents t ht |
| 32 | · apply hordinary a ⟨le_rfl, hab⟩ b ⟨hab, le_rfl⟩ hab |
| 33 | · exact Set.disjoint_left.mpr (fun t ht htab => hn ⟨t, ht, htab⟩) |
| 34 | · exact ha |
| 35 | |
| 36 | /-- Propagate through a finite sequence of actual included events. |
| 37 | The event step needs no assertion at an excluded earlier frontier. -/ |
| 38 | theorem finite_event_forward_induction {a b : ℝ} {S : Set ℝ} |
| 39 | (hab : a ≤ b) (hfinite : (S ∩ Ioc a b).Finite) (Q : ℝ → Prop) (ha : Q a) |
| 40 | (hordinary : ∀ s ∈ Icc a b, ∀ t ∈ Icc a b, s ≤ t → |
| 41 | Disjoint S (Ioc s t) → Q s → Q t) |
| 42 | (hevent : ∀ t ∈ S ∩ Ioc a b, (∀ s ∈ Ico a t, Q s) → Q t) : |
| 43 | Q b := by |
| 44 | have hevents : ∀ t ∈ S ∩ Ioc a b, Q t := by |
| 45 | intro t ht |
| 46 | refine hfinite.isWF.induction ht ?_ |
| 47 | intro t ht ih |
| 48 | apply hevent t ht |
| 49 | intro s hs |
| 50 | have hsb : s ≤ b := hs.2.le.trans ht.2.2 |
| 51 | have hsmall : (S ∩ Ioc a s).Finite := hfinite.subset |
| 52 | (fun u hu => ⟨hu.1, hu.2.1, hu.2.2.trans hsb⟩) |
| 53 | apply propagation_from_event_values hs.1 hsmall Q ha |
| 54 | · intro u hu v hv huv hfree hQu |
| 55 | exact hordinary u ⟨hu.1, hu.2.trans hsb⟩ v ⟨hv.1, hv.2.trans hsb⟩ |
| 56 | huv hfree hQu |
| 57 | · intro u hu |
| 58 | exact ih u ⟨hu.1, hu.2.1, hu.2.2.trans hsb⟩ (hu.2.2.trans_lt hs.2) |
| 59 | exact propagation_from_event_values hab hfinite Q ha hordinary hevents |
| 60 | |
| 61 | end PoincareMT.Proofs.M46 |