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.Topology.Order.IntermediateValue |
| 2 | import Mathlib.Topology.Instances.Real.Lemmas |
| 3 | import Mathlib.Tactic.Linarith |
| 4 | |
| 5 | /-! |
| 6 | # Uniform open intervals force continuation along a segment |
| 7 | |
| 8 | The relative trace of the domain is clopen: a point outside it cannot be |
| 9 | within the uniform restart radius of a point inside it. |
| 10 | -/ |
| 11 | |
| 12 | set_option autoImplicit false |
| 13 | |
| 14 | open scoped Topology |
| 15 | |
| 16 | namespace PoincareMT.ReducedLength |
| 17 | |
| 18 | theorem Icc_subset_of_uniform_open_intervals (D : Set ℝ) (hD : IsOpen D) |
| 19 | (h0 : 0 ∈ D) (S : ℝ) (hS : 0 ≤ S) (r : ℝ) (hr : 0 < r) |
| 20 | (hstep : ∀ t ∈ Set.Icc 0 S, t ∈ D → Set.Ioo (t - r) (t + r) ⊆ D) : |
| 21 | Set.Icc 0 S ⊆ D := by |
| 22 | let E := Set.Icc 0 S |
| 23 | let : PreconnectedSpace E := isPreconnected_iff_preconnectedSpace.mp isPreconnected_Icc |
| 24 | let A : Set E := {t | (t : ℝ) ∈ D} |
| 25 | have hopen : IsOpen A := hD.preimage continuous_subtype_val |
| 26 | have hcompl : IsOpen Aᶜ := by |
| 27 | apply isOpen_iff_mem_nhds.mpr |
| 28 | intro t ht |
| 29 | have hN : Set.Ioo ((t : ℝ) - r) ((t : ℝ) + r) ∈ 𝓝 (t : ℝ) := |
| 30 | Ioo_mem_nhds (by linarith) (by linarith) |
| 31 | filter_upwards [continuousAt_subtype_val.preimage_mem_nhds hN] with z hz |
| 32 | change (z : ℝ) ∉ D |
| 33 | intro hzD |
| 34 | apply ht |
| 35 | exact hstep z z.property hzD ⟨by linarith [hz.2], by linarith [hz.1]⟩ |
| 36 | have hAll : A = Set.univ := IsClopen.eq_univ ⟨isOpen_compl_iff.mp hcompl, hopen⟩ |
| 37 | ⟨⟨0, le_rfl, hS⟩, h0⟩ |
| 38 | intro s hs |
| 39 | have hm : (⟨s, hs⟩ : E) ∈ A := by rw [hAll]; trivial |
| 40 | exact hm |
| 41 | |
| 42 | end PoincareMT.ReducedLength |