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.Generalized.BoundedDistance.Tube.CompactGeometry.CompactCapSide |
| 3 | import PoincareLib.Geometry.RicciFlow.Generalized.BoundedDistance.Tube.Geometry.CanonicalCarrierUnion |
| 4 | import PoincareLib.Geometry.RicciFlow.Generalized.BoundedDistance.Analysis.Geometry.FrontierCrossing |
| 5 | |
| 6 | /-! |
| 7 | # An actual compact cap side containing both selected neck centers |
| 8 | |
| 9 | Morgan--Tian Claim 10.3, printed pp. 248-249. Scalar separation makes the |
| 10 | cap disjoint from at least one endpoint neck. Its compact cap side either |
| 11 | contains the other center, or the whole other neck lies outside that side. |
| 12 | The latter neck is then cap-disjoint, and its compact side contains the |
| 13 | first one by connectedness and the actual disjoint frontiers. No ordering |
| 14 | or nesting input is supplied. |
| 15 | -/ |
| 16 | |
| 17 | set_option autoImplicit false |
| 18 | |
| 19 | open Set |
| 20 | open scoped Manifold ContDiff Bundle Topology |
| 21 | |
| 22 | universe u |
| 23 | |
| 24 | namespace PoincareMT.CappedTubeCertificate |
| 25 | |
| 26 | variable {M : Type u} [TopologicalSpace M] |
| 27 | [ChartedSpace (EuclideanSpace ℝ (Fin 3)) M] |
| 28 | [IsManifold (𝓡 3) ∞ M] [MeasurableSpace M] [BorelSpace M] |
| 29 | [T2Space M] [T3Space M] {g : RiemannianMetric 3 M} |
| 30 | |
| 31 | private theorem exists_side_of_first_cap_disjoint (T : CappedTubeCertificate g) |
| 32 | (N₀ N₁ : EpsilonNeck g) |
| 33 | (hS₀ : SmoothSphereIsotopicIn T.tube.carrier N₀.central_sphere T.tube.cylinder.middleSphere) |
| 34 | (hS₁ : SmoothSphereIsotopicIn T.tube.carrier N₁.central_sphere T.tube.cylinder.middleSphere) |
| 35 | (hdisj : Disjoint N₀.carrier N₁.carrier) |
| 36 | (hcapN₀ : Disjoint T.cap.carrier N₀.carrier) : |
| 37 | ∃ (k : Bool) (C : Set M), IsCompact C ∧ IsPreconnected C ∧ C ⊆ T.carrier ∧ |
| 38 | N₀.center ∈ C ∧ N₁.center ∈ C ∧ |
| 39 | (if k then N₁ else N₀).central_sphere ⊆ C ∧ |
| 40 | frontier C ⊆ (if k then N₁ else N₀).central_sphere := by |
| 41 | obtain ⟨C₀, hC₀, hconn₀, hC₀U, hcap₀, hSC₀, hfront₀⟩ := |
| 42 | T.exists_preconnected_compact_cap_side hS₀ (hcapN₀.mono_right N₀.central_sphere_subset) |
| 43 | have hcenter₀ : N₀.center ∈ C₀ := hSC₀ N₀.center_on_central_sphere |
| 44 | by_cases hcenter₁ : N₁.center ∈ C₀ |
| 45 | · exact ⟨false, C₀, hC₀, hconn₀, hC₀U, hcenter₀, hcenter₁, hSC₀, hfront₀⟩ |
| 46 | · have hN₁C₀ : Disjoint N₁.carrier C₀ := by |
| 47 | apply disjoint_left.mpr |
| 48 | intro x hxN hxC |
| 49 | obtain ⟨z, hzN, hzfront⟩ := N₁.isPreconnected_carrier.exists_mem_frontier_of_mem_of_notMem |
| 50 | hxN hxC (N₁.central_sphere_subset N₁.center_on_central_sphere) hcenter₁ |
| 51 | exact disjoint_left.mp hdisj (N₀.central_sphere_subset (hfront₀ hzfront)) hzN |
| 52 | have hcapN₁ : Disjoint T.cap.carrier N₁.carrier := by |
| 53 | apply disjoint_left.mpr |
| 54 | intro x hxcap hxN |
| 55 | exact disjoint_left.mp hN₁C₀ hxN (interior_subset (hcap₀ hxcap)) |
| 56 | obtain ⟨C₁, hC₁, hconn₁, hC₁U, hcap₁, hSC₁, hfront₁⟩ := |
| 57 | T.exists_preconnected_compact_cap_side hS₁ (hcapN₁.mono_right N₁.central_sphere_subset) |
| 58 | have hC₀C₁ : C₀ ⊆ C₁ := by |
| 59 | intro x hx |
| 60 | by_contra hxnot |
| 61 | obtain ⟨p, hp⟩ := T.cap.core_nonempty |
| 62 | have hpCap := T.cap.core_subset_carrier_m28 hp |
| 63 | obtain ⟨z, hzC₀, hzfront⟩ := hconn₀.exists_mem_frontier_of_mem_of_notMem |
| 64 | (interior_subset (hcap₀ hpCap)) (interior_subset (hcap₁ hpCap)) hx hxnot |
| 65 | exact disjoint_left.mp hN₁C₀ (N₁.central_sphere_subset (hfront₁ hzfront)) hzC₀ |
| 66 | exact ⟨true, C₁, hC₁, hconn₁, hC₁U, hC₀C₁ hcenter₀, |
| 67 | hSC₁ N₁.center_on_central_sphere, hSC₁, hfront₁⟩ |
| 68 | |
| 69 | /-- For the actual two selected chain necks in a singly capped tube, |
| 70 | one actual compact cap side contains both centers. The cap-disjoint-one |
| 71 | alternative is the checked consequence of scalar separation (Claim 10.3). -/ |
| 72 | theorem exists_compact_side_containing_chain_centers (T : CappedTubeCertificate g) |
| 73 | (i j : ℤ) (hi : i ∈ T.tube.chain.shape.active) (hj : j ∈ T.tube.chain.shape.active) |
| 74 | (hdisj : Disjoint (T.tube.chain.neck i).carrier (T.tube.chain.neck j).carrier) |
| 75 | (hcap : Disjoint T.cap.carrier (T.tube.chain.neck i).carrier ∨ |
| 76 | Disjoint T.cap.carrier (T.tube.chain.neck j).carrier) : |
| 77 | ∃ (k : Bool) (C : Set M), IsCompact C ∧ IsPreconnected C ∧ C ⊆ T.carrier ∧ |
| 78 | (T.tube.chain.neck i).center ∈ C ∧ (T.tube.chain.neck j).center ∈ C ∧ |
| 79 | (T.tube.chain.neck (if k then j else i)).central_sphere ⊆ C ∧ |
| 80 | frontier C ⊆ (T.tube.chain.neck (if k then j else i)).central_sphere := by |
| 81 | rcases hcap with hcap | hcap |
| 82 | · obtain ⟨k, C, hC, hconn, hCU, h₀, h₁, hS, hfront⟩ := |
| 83 | T.exists_side_of_first_cap_disjoint (T.tube.chain.neck i) (T.tube.chain.neck j) |
| 84 | (T.tube.central_sphere_isotopy i hi) (T.tube.central_sphere_isotopy j hj) hdisj hcap |
| 85 | refine ⟨k, C, hC, hconn, hCU, h₀, h₁, ?_, ?_⟩ |
| 86 | · cases k <;> exact hS |
| 87 | · cases k <;> exact hfront |
| 88 | · obtain ⟨k, C, hC, hconn, hCU, h₁, h₀, hS, hfront⟩ := |
| 89 | T.exists_side_of_first_cap_disjoint (T.tube.chain.neck j) (T.tube.chain.neck i) |
| 90 | (T.tube.central_sphere_isotopy j hj) (T.tube.central_sphere_isotopy i hi) hdisj.symm hcap |
| 91 | refine ⟨!k, C, hC, hconn, hCU, h₀, h₁, ?_, ?_⟩ |
| 92 | · cases k <;> exact hS |
| 93 | · cases k <;> exact hfront |
| 94 | |
| 95 | end PoincareMT.CappedTubeCertificate |