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.Geometry.SeparatingNeckComponents |
| 3 | import PoincareLib.Geometry.RicciFlow.Generalized.BoundedDistance.Tube.Cylinders.CylinderComponentSide |
| 4 | |
| 5 | /-! |
| 6 | # An ambient component inside the actual positive cylinder |
| 7 | |
| 8 | A selected separating neck lies in a region whose complement is |
| 9 | preconnected. One full sphere-complement component therefore lies in |
| 10 | that region. If the region lies in the actual tube, sphere isotopy |
| 11 | identifies that component with a full cylinder half. Source: |
| 12 | Morgan--Tian Claim 10.8, p. 254; M28 derivation 94. |
| 13 | -/ |
| 14 | |
| 15 | set_option autoImplicit false |
| 16 | |
| 17 | open Set |
| 18 | open scoped Manifold ContDiff Topology |
| 19 | |
| 20 | universe u |
| 21 | |
| 22 | namespace PoincareMT.M28 |
| 23 | |
| 24 | variable {M : Type u} [TopologicalSpace M] [ConnectedSpace M] |
| 25 | [ChartedSpace (EuclideanSpace ℝ (Fin 3)) M] [IsManifold (𝓡 3) ∞ M] |
| 26 | [MeasurableSpace M] [BorelSpace M] [T3Space M] {g : RiemannianMetric 3 M} |
| 27 | |
| 28 | /-- One full complementary side of a separating neck stays in any |
| 29 | containing region with preconnected complement. Its exact frontier, |
| 30 | closure and a literal collar half are retained. Source: Claim 10.8; |
| 31 | M28 derivation 94. -/ |
| 32 | theorem exists_neck_component_inside_of_compl_preconnected |
| 33 | (N : EpsilonNeck g) (hsep : N.IsSeparating) {X : Set M} |
| 34 | (hNX : N.carrier ⊆ X) (hX : IsPreconnected Xᶜ) : |
| 35 | ∃ P : Set M, IsOpen P ∧ IsConnected P ∧ P ⊆ X \ N.central_sphere ∧ |
| 36 | frontier P = N.central_sphere ∧ closure P = P ∪ N.central_sphere ∧ |
| 37 | (∀ x ∈ P, connectedComponentIn N.central_sphereᶜ x = P) ∧ |
| 38 | (N.belowGraph_m28 (fun _ => 0) ⊆ P ∨ N.aboveGraph_m28 (fun _ => 0) ⊆ P) := by |
| 39 | let : T2Space M := @T25Space.t2Space M _ (@T3Space.t25Space M _ inferInstance) |
| 40 | have hzero : ∀ q : UnitTwoSphere, (0 : ℝ) ∈ Ioo (-N.epsilon⁻¹) N.epsilon⁻¹ := |
| 41 | fun _ => ⟨neg_lt_zero.mpr (inv_pos.mpr N.epsilon_pos), inv_pos.mpr N.epsilon_pos⟩ |
| 42 | obtain ⟨a, ha⟩ := (N.isConnected_belowGraph_m28 _ continuous_const hzero).nonempty |
| 43 | obtain ⟨b, hb⟩ := (N.isConnected_aboveGraph_m28 _ continuous_const hzero).nonempty |
| 44 | obtain ⟨ho0, ho1, hc0, hc1, hd, hu, hf0, hf1, hcl0, hcl1, hbelow, habove⟩ := |
| 45 | N.complement_components_of_isSeparating hsep ha hb |
| 46 | have hsub : Xᶜ ⊆ connectedComponentIn N.central_sphereᶜ a ∪ |
| 47 | connectedComponentIn N.central_sphereᶜ b := by |
| 48 | rw [hu] |
| 49 | intro x hx hS |
| 50 | exact hx (hNX (N.central_sphere_subset hS)) |
| 51 | rcases hX.subset_or_subset ho0 ho1 hd hsub with hside | hside |
| 52 | · refine ⟨connectedComponentIn N.central_sphereᶜ b, ho1, hc1, ?_, hf1, hcl1, |
| 53 | fun _ hx => (connectedComponentIn_eq hx).symm, Or.inr habove⟩ |
| 54 | intro x hx |
| 55 | refine ⟨?_, connectedComponentIn_subset _ _ hx⟩ |
| 56 | by_contra hnot |
| 57 | exact Set.disjoint_left.mp hd (hside hnot) hx |
| 58 | · refine ⟨connectedComponentIn N.central_sphereᶜ a, ho0, hc0, ?_, hf0, hcl0, |
| 59 | fun _ hx => (connectedComponentIn_eq hx).symm, Or.inl hbelow⟩ |
| 60 | intro x hx |
| 61 | refine ⟨?_, connectedComponentIn_subset _ _ hx⟩ |
| 62 | by_contra hnot |
| 63 | exact Set.disjoint_left.mp hd hx (hside hnot) |
| 64 | |
| 65 | /-- An actual sphere isotopy in a containing cylinder identifies the |
| 66 | produced ambient component with exactly one whole cylinder half. No |
| 67 | properness of the whole cylinder is assumed. Source: Claim 10.8; |
| 68 | M28 derivation 94. -/ |
| 69 | theorem exists_positive_ambient_cylinder_half |
| 70 | (N : EpsilonNeck g) (hsep : N.IsSeparating) {X : Set M} |
| 71 | (hNX : N.carrier ⊆ X) (hX : IsPreconnected Xᶜ) |
| 72 | (U : TopologicalSpace.Opens M) (T : OpenCylinderModel (U : Set M)) |
| 73 | (hXU : X ⊆ U) (hisotopy : SmoothSphereIsotopicIn (U : Set M) |
| 74 | N.central_sphere T.middleSphere) : |
| 75 | ∃ (P : Set M) (phi : U ≃ₜ (UnitTwoSphere × Ioo (0 : ℝ) 1)), |
| 76 | IsOpen P ∧ IsConnected P ∧ P ⊆ X \ N.central_sphere ∧ |
| 77 | frontier P = N.central_sphere ∧ closure P = P ∪ N.central_sphere ∧ |
| 78 | (∀ x ∈ P, connectedComponentIn N.central_sphereᶜ x = P) ∧ |
| 79 | (N.belowGraph_m28 (fun _ => 0) ⊆ P ∨ N.aboveGraph_m28 (fun _ => 0) ⊆ P) ∧ |
| 80 | (∀ x : U, cylinderSignedHeight phi x = 0 ↔ x.val ∈ N.central_sphere) ∧ |
| 81 | ((∀ x : U, cylinderSignedHeight phi x < 0 ↔ x.val ∈ P) ∨ |
| 82 | (∀ x : U, 0 < cylinderSignedHeight phi x ↔ x.val ∈ P)) := by |
| 83 | obtain ⟨P, hPo, hPc, hPX, hPf, hPcl, hcomponent, hcollar⟩ := |
| 84 | exists_neck_component_inside_of_compl_preconnected N hsep hNX hX |
| 85 | obtain ⟨phi, a, b, _ha, _ha', _hb, _hb', hzero, _htail⟩ := |
| 86 | T.exists_isotopic_sphere_coordinates hisotopy |
| 87 | have hzero' (x : U) : cylinderSignedHeight phi x = 0 ↔ x.val ∈ N.central_sphere := by |
| 88 | rw [cylinderSignedHeight, sub_eq_zero] |
| 89 | exact hzero x |
| 90 | have hPU : P ⊆ (U : Set M) \ N.central_sphere := |
| 91 | fun _ hx => ⟨hXU (hPX hx).1, (hPX hx).2⟩ |
| 92 | have hcomponentU (x : M) (hx : x ∈ P) : |
| 93 | connectedComponentIn ((U : Set M) \ N.central_sphere) x = P := by |
| 94 | apply Subset.antisymm |
| 95 | · exact (connectedComponentIn_mono x (fun _ hy => hy.2)).trans_eq (hcomponent x hx) |
| 96 | · exact hPc.isPreconnected.subset_connectedComponentIn hx hPU |
| 97 | exact ⟨P, phi, hPo, hPc, hPX, hPf, hPcl, hcomponent, hcollar, hzero', |
| 98 | cylinderSignedHeight_component_half phi hzero' hPc hPU hcomponentU⟩ |
| 99 | |
| 100 | end PoincareMT.M28 |