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.Manifold.Interior.Dense |
| 2 | import PoincareLib.Geometry.Manifold.Interior.LocalPathConnected |
| 3 | |
| 4 | /-! |
| 5 | # Path connectedness of the intrinsic manifold interior |
| 6 | |
| 7 | Convex chart neighborhoods prevent separate interior components from meeting |
| 8 | at boundary points. Density then gives connectedness of the intrinsic interior, |
| 9 | and local path connectedness supplies paths within it. |
| 10 | -/ |
| 11 | |
| 12 | noncomputable section |
| 13 | |
| 14 | open Set Filter Metric |
| 15 | open scoped ContDiff Manifold Topology |
| 16 | |
| 17 | namespace Poincare.Manifold |
| 18 | |
| 19 | private theorem isPreconnected_of_dense_local |
| 20 | {X : Type*} [TopologicalSpace X] [PreconnectedSpace X] |
| 21 | {s : Set X} (hdense : Dense s) |
| 22 | (hlocal : ∀ x : X, ∃ U ∈ 𝓝 x, IsPreconnected (U ∩ s)) : |
| 23 | IsPreconnected s := by |
| 24 | intro u v hu hv hcover hsu hsv |
| 25 | have hclosedcover : (univ : Set X) ⊆ closure (s ∩ u) ∪ closure (s ∩ v) := by |
| 26 | have hs : s ⊆ closure (s ∩ u) ∪ closure (s ∩ v) := by |
| 27 | intro x hx |
| 28 | rcases hcover hx with hxu | hxv |
| 29 | · exact Or.inl (subset_closure ⟨hx, hxu⟩) |
| 30 | · exact Or.inr (subset_closure ⟨hx, hxv⟩) |
| 31 | simpa only [hdense.closure_eq, (isClosed_closure.union isClosed_closure).closure_eq] |
| 32 | using closure_mono hs |
| 33 | obtain ⟨x, _, hxu, hxv⟩ := isPreconnected_closed_iff.mp isPreconnected_univ |
| 34 | (closure (s ∩ u)) (closure (s ∩ v)) isClosed_closure isClosed_closure |
| 35 | hclosedcover |
| 36 | (by obtain ⟨x, hx⟩ := hsu; exact ⟨x, mem_univ x, subset_closure hx⟩) |
| 37 | (by obtain ⟨x, hx⟩ := hsv; exact ⟨x, mem_univ x, subset_closure hx⟩) |
| 38 | obtain ⟨U, hU, hconn⟩ := hlocal x |
| 39 | obtain ⟨a, haU, has, hau⟩ := mem_closure_iff_nhds.mp hxu U hU |
| 40 | obtain ⟨b, hbU, hbs, hbv⟩ := mem_closure_iff_nhds.mp hxv U hU |
| 41 | obtain ⟨z, hz, hzu, hzv⟩ := hconn u v hu hv |
| 42 | (fun y hy => hcover hy.2) ⟨a, ⟨haU, has⟩, hau⟩ ⟨b, ⟨hbU, hbs⟩, hbv⟩ |
| 43 | exact ⟨z, hz.2, hzu, hzv⟩ |
| 44 | |
| 45 | variable {E H M : Type*} |
| 46 | [NormedAddCommGroup E] [NormedSpace ℝ E] |
| 47 | [TopologicalSpace H] {I : ModelWithCorners ℝ E H} |
| 48 | [TopologicalSpace M] [ChartedSpace H M] [IsManifold I ∞ M] |
| 49 | |
| 50 | private theorem exists_preconnected_interior_nhds (x : M) : |
| 51 | ∃ U ∈ 𝓝 x, IsPreconnected (U ∩ I.interior M) := by |
| 52 | obtain ⟨r, hr, hball⟩ := Metric.mem_nhds_iff.mp |
| 53 | (extChartAt_target_union_compl_range_mem_nhds_of_mem (mem_extChartAt_target (I := I) x)) |
| 54 | let C := ball (extChartAt I x x) r ∩ interior (range I) |
| 55 | have hC : C ⊆ (extChartAt I x).target := by |
| 56 | intro z hz |
| 57 | exact (hball hz.1).resolve_right (not_not.mpr (interior_subset hz.2)) |
| 58 | let U := (extChartAt I x).source ∩ extChartAt I x ⁻¹' ball (extChartAt I x x) r |
| 59 | have hU : U ∈ 𝓝 x := (isOpen_extChartAt_preimage' x isOpen_ball).mem_nhds |
| 60 | ⟨mem_extChartAt_source x, mem_ball_self hr⟩ |
| 61 | refine ⟨U, hU, ?_⟩ |
| 62 | have heq : U ∩ I.interior M = (extChartAt I x).symm '' C := by |
| 63 | ext y |
| 64 | constructor |
| 65 | · rintro ⟨⟨hys, hyball⟩, hyint⟩ |
| 66 | have hycoord := (I.isInteriorPoint_iff_of_mem_atlas |
| 67 | (by simp : (∞ : WithTop ℕ∞) ≠ 0) (chart_mem_atlas H x) |
| 68 | (by simpa only [extChartAt_source] using hys)).mp hyint |
| 69 | exact ⟨extChartAt I x y, ⟨hyball, |
| 70 | (chartAt H x).interior_extend_target_subset_interior_range hycoord⟩, |
| 71 | (extChartAt I x).left_inv hys⟩ |
| 72 | · rintro ⟨z, hz, rfl⟩ |
| 73 | have hzt := hC hz |
| 74 | have hys := (extChartAt I x).map_target hzt |
| 75 | refine ⟨⟨hys, ?_⟩, ?_⟩ |
| 76 | · simpa only [mem_preimage, (extChartAt I x).right_inv hzt] using hz.1 |
| 77 | · apply (I.isInteriorPoint_iff_of_mem_atlas |
| 78 | (by simp : (∞ : WithTop ℕ∞) ≠ 0) (chart_mem_atlas H x) |
| 79 | (by simpa only [extChartAt_source] using hys)).2 |
| 80 | change extChartAt I x ((extChartAt I x).symm z) ∈ interior (extChartAt I x).target |
| 81 | rw [(extChartAt I x).right_inv hzt] |
| 82 | exact (extChartAt_target_eventuallyEq_of_mem hzt).symm.mem_interior hz.2 |
| 83 | rw [heq] |
| 84 | exact ((convex_ball _ _).inter I.convex_range.interior).isPreconnected.image |
| 85 | (extChartAt I x).symm ((continuousOn_extChartAt_symm x).mono hC) |
| 86 | |
| 87 | /-- A connected smooth manifold has a path connected intrinsic interior. -/ |
| 88 | theorem isPathConnected_manifoldInterior [ConnectedSpace M] : |
| 89 | IsPathConnected (I.interior M) := by |
| 90 | let : LocallyPathConnectedSpace M := manifold_locallyPathConnected (I := I) |
| 91 | apply (I.isOpen_interior (by simp : (∞ : WithTop ℕ∞) ≠ 0)).isConnected_iff_isPathConnected.mp |
| 92 | exact ⟨(dense_manifoldInterior (I := I)).nonempty, |
| 93 | isPreconnected_of_dense_local (dense_manifoldInterior (I := I)) |
| 94 | (exists_preconnected_interior_nhds (I := I))⟩ |
| 95 | |
| 96 | end Poincare.Manifold |