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.Extinction.Width.Path.Theory |
| 2 | |
| 3 | set_option autoImplicit false |
| 4 | |
| 5 | open Set Filter |
| 6 | open scoped Topology |
| 7 | |
| 8 | namespace PoincareMT |
| 9 | |
| 10 | /-! |
| 11 | The endpoint part of the finite restart argument. A regular comparison is |
| 12 | only required on the open side of a surgery time. The lower-limit clause of |
| 13 | M67, together with continuity of the scalar profile, closes the comparison at |
| 14 | the surgery time itself. This lemma deliberately contains no global |
| 15 | continuity assumption on `f`. |
| 16 | -/ |
| 17 | theorem m68_event_restart_bound |
| 18 | {a s : ℝ} {f G : ℝ → ℝ} |
| 19 | (has : a < s) |
| 20 | (hbound : ∀ t, t ∈ Ioo a s → f t ≤ G t) |
| 21 | (hleft : ∀ ε : ℝ, 0 < ε → ∃ δ : ℝ, 0 < δ ∧ |
| 22 | ∀ t, t ∈ Icc a s → s - δ < t → t < s → f s ≤ f t + ε) |
| 23 | (hG : ContinuousAt G s) : f s ≤ G s := by |
| 24 | apply le_of_forall_pos_le_add |
| 25 | intro ε hε |
| 26 | obtain ⟨δ, hδ, hδall⟩ := hleft (ε / 2) (by linarith) |
| 27 | have hupper : G s < G s + ε / 2 := by linarith |
| 28 | have hnhds : G ⁻¹' Iio (G s + ε / 2) ∈ 𝓝 s := |
| 29 | hG.preimage_mem_nhds (Iio_mem_nhds hupper) |
| 30 | obtain ⟨r, hr, hball⟩ := Metric.mem_nhds_iff.mp hnhds |
| 31 | let d : ℝ := min (δ / 2) (min ((s - a) / 2) (r / 2)) |
| 32 | have hd : 0 < d := by |
| 33 | dsimp [d] |
| 34 | exact lt_min (by linarith) (lt_min (by linarith) (by linarith)) |
| 35 | let t : ℝ := s - d |
| 36 | have hta : a < t := by |
| 37 | dsimp [t] |
| 38 | have hdle : d ≤ (s - a) / 2 := |
| 39 | (min_le_right _ _).trans (min_le_left _ _) |
| 40 | linarith |
| 41 | have hts : t < s := by |
| 42 | dsimp [t] |
| 43 | linarith |
| 44 | have hst : s - δ < t := by |
| 45 | dsimp [t] |
| 46 | have hdle : d ≤ δ / 2 := min_le_left _ _ |
| 47 | linarith |
| 48 | have htmem : t ∈ Ioo a s := ⟨hta, hts⟩ |
| 49 | have hfg := hbound t htmem |
| 50 | have hfs := hδall t ⟨le_of_lt hta, hts.le⟩ hst hts |
| 51 | have habs : dist t s < r := by |
| 52 | rw [Real.dist_eq] |
| 53 | dsimp [t] |
| 54 | have hdle : d ≤ r / 2 := |
| 55 | (min_le_right _ _).trans (min_le_right _ _) |
| 56 | have hdr : d < r := lt_of_le_of_lt hdle (by linarith) |
| 57 | simpa [abs_of_nonneg hd.le] using hdr |
| 58 | have hGt : G t < G s + ε / 2 := by |
| 59 | apply hball |
| 60 | exact habs |
| 61 | linarith |
| 62 | |
| 63 | end PoincareMT |