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.Spacetime.Realization.Interval.Topology |
| 2 | |
| 3 | /-! |
| 4 | # Nontrivial interval neighborhoods inside prescribed relative neighborhoods |
| 5 | -/ |
| 6 | |
| 7 | set_option autoImplicit false |
| 8 | |
| 9 | open Set Filter |
| 10 | open scoped Topology |
| 11 | |
| 12 | open PoincareMT |
| 13 | |
| 14 | namespace Poincare.Spacetime.Realization |
| 15 | |
| 16 | theorem interval_exists_small_neighborhood (I : SpacetimeInterval) (t : I.domain) |
| 17 | {U : Set I.domain} (hU : U ∈ 𝓝 t) : |
| 18 | ∃ J : SpacetimeInterval, ∃ h : J.domain ⊆ I.domain, |
| 19 | t.val ∈ J.domain ∧ {s : I.domain | s.val ∈ J.domain} ∈ 𝓝 t ∧ |
| 20 | ∀ s : J.domain, (⟨s.val, h s.property⟩ : I.domain) ∈ U := by |
| 21 | obtain ⟨r, hr, hrU⟩ := Metric.mem_nhds_iff.mp hU |
| 22 | let S : Set ℝ := I.domain ∩ Metric.ball t.val r |
| 23 | have htS : t.val ∈ S := ⟨t.property, Metric.mem_ball_self hr⟩ |
| 24 | have hacc : AccPt t.val (𝓟 S) := |
| 25 | ((interval_uniqueDiffOn I t.val t.property).inter (Metric.ball_mem_nhds _ hr)).accPt |
| 26 | obtain ⟨s, hs, hst⟩ := accPt_iff_nhds.mp hacc univ univ_mem |
| 27 | let J : SpacetimeInterval := { |
| 28 | domain := S |
| 29 | ordConnected := ((interval_convex I).inter (convex_ball _ _)).ordConnected |
| 30 | nontrivial := ⟨s, hs.2, t.val, htS, hst⟩ |
| 31 | } |
| 32 | refine ⟨J, inter_subset_left, htS, ?_, ?_⟩ |
| 33 | · have he : {s : I.domain | s.val ∈ J.domain} = Metric.ball t r := by |
| 34 | ext s |
| 35 | change (s.val ∈ I.domain ∧ dist s.val t.val < r) ↔ dist s t < r |
| 36 | simp only [s.property, true_and, Subtype.dist_eq] |
| 37 | rw [he] |
| 38 | exact Metric.ball_mem_nhds t hr |
| 39 | · intro s |
| 40 | apply hrU |
| 41 | exact s.property.2 |
| 42 | |
| 43 | end Poincare.Spacetime.Realization |