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 PoincareLib.Geometry.RicciFlow.Surgery.Continuation.Branch |
| 2 | |
| 3 | /-! |
| 4 | # Observe the maximal ordinary restart |
| 5 | |
| 6 | Choose the next singular endpoint or a prescribed later observation time |
| 7 | from the actual M33 output. This is the numerical choice used in Section |
| 8 | 17.2, pp. 409--410; it does not restrict a longer surgery flow. |
| 9 | -/ |
| 10 | |
| 11 | set_option autoImplicit false |
| 12 | |
| 13 | open Set |
| 14 | |
| 15 | universe u |
| 16 | |
| 17 | namespace PoincareMT.RepairedContinuationConclusion |
| 18 | |
| 19 | /-- A finite ordinary endpoint supplies its actual final slab even when it |
| 20 | equals the prescribed observation bound. A longer flow retains its domain. -/ |
| 21 | theorem frontier_before |
| 22 | {F : SurgeryFlowData.{u}} {T : ℝ} {I : RepairedContinuationInput F T} |
| 23 | (C : RepairedContinuationConclusion I) {B : ℝ} (hB : T < B) : |
| 24 | ∃ U : ℝ, T < U ∧ U ≤ B ∧ |
| 25 | Ico 0 U ⊆ C.extension.extended.time_domain ∧ |
| 26 | Disjoint C.extension.extended.surgery_times (Ioo T U) ∧ |
| 27 | (U < B → C.extension.extended.time_domain = Ico 0 U) ∧ |
| 28 | (C.extension.extended.time_domain = Ico 0 U → |
| 29 | ∃ next : RepairedPreterminalSlab C.extension.extended U, |
| 30 | next.start = T) := by |
| 31 | have hT : 0 ≤ T := I.terminal_pos.le |
| 32 | have hBpos : 0 < B := I.terminal_pos.trans hB |
| 33 | have free (U : ℝ) (hU : Ico 0 U ⊆ C.extension.extended.time_domain) : |
| 34 | Disjoint C.extension.extended.surgery_times (Ioo T U) := by |
| 35 | apply Set.disjoint_left.mpr |
| 36 | intro t hs ht |
| 37 | exact C.no_later_surgery t (hU ⟨hT.trans ht.1.le, ht.2⟩) ht.1 hs |
| 38 | by_cases h : C.end_time < ENNReal.ofReal B |
| 39 | · have hfinite : C.end_time ≠ ⊤ := ne_top_of_lt h |
| 40 | have hTU : T < C.end_time.toReal := |
| 41 | (ENNReal.ofReal_lt_iff_lt_toReal hT hfinite).mp C.extends_past |
| 42 | have hUB : C.end_time.toReal < B := ENNReal.toReal_lt_of_lt_ofReal h |
| 43 | have hdomain : C.extension.extended.time_domain = Ico 0 C.end_time.toReal := by |
| 44 | rw [C.time_domain_eq] |
| 45 | ext t |
| 46 | constructor |
| 47 | · rintro ⟨ht, he⟩ |
| 48 | exact ⟨ht, (ENNReal.ofReal_lt_iff_lt_toReal ht hfinite).mp he⟩ |
| 49 | · rintro ⟨ht, he⟩ |
| 50 | exact ⟨ht, (ENNReal.ofReal_lt_iff_lt_toReal ht hfinite).mpr he⟩ |
| 51 | have hsubset : Ico 0 C.end_time.toReal ⊆ C.extension.extended.time_domain := |
| 52 | hdomain.symm.subset |
| 53 | exact ⟨C.end_time.toReal, hTU, hUB.le, hsubset, free _ hsubset, |
| 54 | fun _ => hdomain, fun _ => C.finite_end_slab hfinite⟩ |
| 55 | · have hend : ENNReal.ofReal B ≤ C.end_time := le_of_not_gt h |
| 56 | have hsubset : Ico 0 B ⊆ C.extension.extended.time_domain := by |
| 57 | intro t ht |
| 58 | rw [C.time_domain_eq] |
| 59 | exact ⟨ht.1, ((ENNReal.ofReal_lt_ofReal_iff_of_nonneg ht.1).mpr ht.2).trans_le hend⟩ |
| 60 | refine ⟨B, hB, le_rfl, hsubset, free B hsubset, fun hlt => (lt_irrefl B hlt).elim, ?_⟩ |
| 61 | intro hdomain |
| 62 | have hexcluded : B ∉ C.extension.extended.time_domain := by |
| 63 | rw [hdomain] |
| 64 | exact fun ht => (lt_irrefl B ht.2) |
| 65 | have hend_le : C.end_time ≤ ENNReal.ofReal B := by |
| 66 | by_contra hnot |
| 67 | apply hexcluded |
| 68 | rw [C.time_domain_eq] |
| 69 | exact ⟨hBpos.le, lt_of_not_ge hnot⟩ |
| 70 | have heq : C.end_time = ENNReal.ofReal B := le_antisymm hend_le hend |
| 71 | have hfinite : C.end_time ≠ ⊤ := by rw [heq]; exact ENNReal.ofReal_ne_top |
| 72 | have hreal : C.end_time.toReal = B := by rw [heq, ENNReal.toReal_ofReal hBpos.le] |
| 73 | rw [← hreal] |
| 74 | exact C.finite_end_slab hfinite |
| 75 | |
| 76 | end PoincareMT.RepairedContinuationConclusion |