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.Generalized.BoundedDistance.GeometryImports |
| 2 | import PoincareLib.Geometry.RicciFlow.CanonicalNeighborhood.Cap |
| 3 | |
| 4 | /-! |
| 5 | # The boundary of a cap core |
| 6 | |
| 7 | The compact core and its boundary sphere form a barrier: a connected set |
| 8 | meeting both the core interior and its exterior must meet the boundary. |
| 9 | These statements use the actual closed core in the frozen cap certificate. |
| 10 | |
| 11 | Reference: Morgan--Tian, Proposition A.21 and Claims A.23--A.24, pp. 508--514. |
| 12 | -/ |
| 13 | |
| 14 | set_option autoImplicit false |
| 15 | |
| 16 | open Set |
| 17 | open scoped Manifold ContDiff |
| 18 | |
| 19 | universe u |
| 20 | |
| 21 | namespace PoincareMT.CapCertificate |
| 22 | |
| 23 | variable {M : Type u} [TopologicalSpace M] |
| 24 | [ChartedSpace (EuclideanSpace ℝ (Fin 3)) M] |
| 25 | [IsManifold (𝓡 3) ∞ M] [MeasurableSpace M] [BorelSpace M] |
| 26 | [T2Space M] [T3Space M] {g : RiemannianMetric 3 M} |
| 27 | (C : CapCertificate g) |
| 28 | |
| 29 | theorem isClosed_closed_core_m28 : IsClosed C.closed_core := |
| 30 | C.closed_core_compact.isClosed |
| 31 | |
| 32 | omit [T2Space M] in |
| 33 | theorem isOpen_core_m28 : IsOpen C.core := by |
| 34 | rw [C.core_eq_interior_closed_core] |
| 35 | exact isOpen_interior |
| 36 | |
| 37 | omit [T2Space M] in |
| 38 | theorem core_subset_closed_core_m28 : C.core ⊆ C.closed_core := by |
| 39 | rw [C.core_eq_interior_closed_core] |
| 40 | exact interior_subset |
| 41 | |
| 42 | theorem boundary_eq_closed_core_diff_core_m28 : |
| 43 | C.boundary_sphere = C.closed_core \ C.core := by |
| 44 | rw [← C.core_frontier_eq_boundary, frontier, C.isClosed_closed_core_m28.closure_eq, |
| 45 | C.core_eq_interior_closed_core] |
| 46 | |
| 47 | theorem disjoint_core_boundary_m28 : Disjoint C.core C.boundary_sphere := by |
| 48 | rw [C.boundary_eq_closed_core_diff_core_m28] |
| 49 | exact disjoint_sdiff_right |
| 50 | |
| 51 | omit [T2Space M] in |
| 52 | theorem disjoint_closed_core_end_m28 : Disjoint C.closed_core C.end_neck.carrier := by |
| 53 | rw [C.closed_core_eq_complement_end] |
| 54 | exact disjoint_sdiff_left |
| 55 | |
| 56 | theorem closed_core_eq_core_union_boundary_m28 : |
| 57 | C.closed_core = C.core ∪ C.boundary_sphere := by |
| 58 | rw [C.boundary_eq_closed_core_diff_core_m28, |
| 59 | union_sdiff_cancel C.core_subset_closed_core_m28] |
| 60 | |
| 61 | omit [T2Space M] in |
| 62 | theorem carrier_eq_closed_core_union_end_m28 : |
| 63 | C.carrier = C.closed_core ∪ C.end_neck.carrier := by |
| 64 | rw [C.closed_core_eq_complement_end, sdiff_union_of_subset C.end_neck_subset] |
| 65 | |
| 66 | /-- A set avoiding the boundary lies on one side of the closed core. -/ |
| 67 | theorem subset_core_or_compl_closed_core_m28 {S : Set M} (hS : IsPreconnected S) |
| 68 | (havoid : Disjoint S C.boundary_sphere) : |
| 69 | S ⊆ C.core ∨ S ⊆ C.closed_coreᶜ := by |
| 70 | apply hS.subset_or_subset C.isOpen_core_m28 C.isClosed_closed_core_m28.isOpen_compl |
| 71 | (disjoint_compl_right.mono_left C.core_subset_closed_core_m28) |
| 72 | intro x hx |
| 73 | by_cases hcore : x ∈ C.closed_core |
| 74 | · left |
| 75 | by_contra hint |
| 76 | exact (Set.disjoint_left.mp havoid) hx |
| 77 | (C.boundary_eq_closed_core_diff_core_m28.symm ▸ ⟨hcore, hint⟩) |
| 78 | · exact Or.inr hcore |
| 79 | |
| 80 | /-- Every connected crossing from the core to its exterior meets its sphere. -/ |
| 81 | theorem boundary_inter_nonempty_of_crossing_m28 {S : Set M} (hS : IsPreconnected S) |
| 82 | (hin : (S ∩ C.core).Nonempty) (hout : (S \ C.closed_core).Nonempty) : |
| 83 | (S ∩ C.boundary_sphere).Nonempty := by |
| 84 | by_contra h |
| 85 | have hd : Disjoint S C.boundary_sphere := |
| 86 | disjoint_iff_inter_eq_empty.mpr (Set.not_nonempty_iff_eq_empty.mp h) |
| 87 | rcases C.subset_core_or_compl_closed_core_m28 hS hd with hside | hside |
| 88 | · obtain ⟨x, hx, hxout⟩ := hout |
| 89 | exact hxout (C.core_subset_closed_core_m28 (hside hx)) |
| 90 | · obtain ⟨x, hx, hxin⟩ := hin |
| 91 | exact hside hx (C.core_subset_closed_core_m28 hxin) |
| 92 | |
| 93 | theorem boundary_inter_nonempty_of_core_end_m28 {S : Set M} (hS : IsPreconnected S) |
| 94 | (hin : (S ∩ C.core).Nonempty) (hout : (S ∩ C.end_neck.carrier).Nonempty) : |
| 95 | (S ∩ C.boundary_sphere).Nonempty := by |
| 96 | apply C.boundary_inter_nonempty_of_crossing_m28 hS hin |
| 97 | obtain ⟨x, hx, hxend⟩ := hout |
| 98 | exact ⟨x, hx, fun hxcore => Set.disjoint_left.mp C.disjoint_closed_core_end_m28 hxcore hxend⟩ |
| 99 | |
| 100 | end PoincareMT.CapCertificate |