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.Cylinders.CylinderSphereSides |
| 3 | |
| 4 | /-! |
| 5 | # Identify an actual full component with a cylinder half |
| 6 | |
| 7 | An actual connected component of a sphere complement occupies exactly |
| 8 | one signed-height half. The component equality is used in the ambient |
| 9 | manifold, so no change of source carrier or component convention occurs. |
| 10 | Source: Morgan--Tian Claim 10.8, p. 254; M28 derivation 124. |
| 11 | -/ |
| 12 | |
| 13 | set_option autoImplicit false |
| 14 | |
| 15 | open Set |
| 16 | open scoped Topology |
| 17 | |
| 18 | namespace PoincareMT.M28 |
| 19 | |
| 20 | variable {M : Type*} [TopologicalSpace M] {U : TopologicalSpace.Opens M} |
| 21 | |
| 22 | /-- The two possible signs of a genuine full component are exhaustive. |
| 23 | Both directions of membership are proved using its connectedness and |
| 24 | the maximality of its actual ambient component. Source: Claim 10.8, |
| 25 | p. 254; M28 derivation 124. -/ |
| 26 | theorem cylinderSignedHeight_component_half |
| 27 | (phi : U ≃ₜ (UnitTwoSphere × Ioo (0 : ℝ) 1)) {S F : Set M} |
| 28 | (hzero : ∀ x : U, cylinderSignedHeight phi x = 0 ↔ (x : M) ∈ S) |
| 29 | (hF : IsConnected F) (hFU : F ⊆ (U : Set M) \ S) |
| 30 | (hcomponent : ∀ x ∈ F, connectedComponentIn ((U : Set M) \ S) x = F) : |
| 31 | (∀ x : U, cylinderSignedHeight phi x < 0 ↔ (x : M) ∈ F) ∨ |
| 32 | (∀ x : U, 0 < cylinderSignedHeight phi x ↔ (x : M) ∈ F) := by |
| 33 | obtain ⟨w, hw⟩ := hF.nonempty |
| 34 | let wU : U := ⟨w, (hFU hw).1⟩ |
| 35 | have hFrange : F ⊆ range (Subtype.val : U → M) := by |
| 36 | intro x hx |
| 37 | exact ⟨⟨x, (hFU hx).1⟩, rfl⟩ |
| 38 | have hpre : IsPreconnected {x : U | (x : M) ∈ F} := |
| 39 | hF.isPreconnected.preimage_of_isOpenMap Subtype.val_injective |
| 40 | U.isOpen.isOpenMap_subtype_val hFrange |
| 41 | have havoid : ∀ x ∈ {x : U | (x : M) ∈ F}, cylinderSignedHeight phi x ≠ 0 := by |
| 42 | intro x hx hh |
| 43 | exact (hFU hx).2 ((hzero x).mp hh) |
| 44 | have hwne : cylinderSignedHeight phi wU ≠ 0 := havoid wU hw |
| 45 | rcases lt_or_gt_of_ne hwne with hwneg | hwpos |
| 46 | · left |
| 47 | have hhalf : IsPreconnected |
| 48 | ((Subtype.val : U → M) '' {x : U | cylinderSignedHeight phi x < 0}) := |
| 49 | (isPreconnected_cylinderSignedHeight_negative phi).image _ |
| 50 | continuous_subtype_val.continuousOn |
| 51 | have hhalfsub : (Subtype.val : U → M) '' {x : U | cylinderSignedHeight phi x < 0} ⊆ |
| 52 | (U : Set M) \ S := by |
| 53 | rintro _ ⟨x, hx, rfl⟩ |
| 54 | exact ⟨x.property, fun hxS => (ne_of_lt hx) ((hzero x).mpr hxS)⟩ |
| 55 | have hhalfF : (Subtype.val : U → M) '' {x : U | cylinderSignedHeight phi x < 0} ⊆ |
| 56 | F := by |
| 57 | rw [← hcomponent w hw] |
| 58 | exact hhalf.subset_connectedComponentIn ⟨wU, hwneg, rfl⟩ hhalfsub |
| 59 | intro x |
| 60 | exact ⟨fun hx => hhalfF ⟨x, hx, rfl⟩, |
| 61 | fun hx => hpre.gt_of_ne (continuous_cylinderSignedHeight phi).continuousOn |
| 62 | havoid ⟨wU, hw, hwneg⟩ hx⟩ |
| 63 | · right |
| 64 | have hhalf : IsPreconnected |
| 65 | ((Subtype.val : U → M) '' {x : U | 0 < cylinderSignedHeight phi x}) := |
| 66 | (isPreconnected_cylinderSignedHeight_positive phi).image _ |
| 67 | continuous_subtype_val.continuousOn |
| 68 | have hhalfsub : (Subtype.val : U → M) '' {x : U | 0 < cylinderSignedHeight phi x} ⊆ |
| 69 | (U : Set M) \ S := by |
| 70 | rintro _ ⟨x, hx, rfl⟩ |
| 71 | exact ⟨x.property, fun hxS => (ne_of_gt hx) ((hzero x).mpr hxS)⟩ |
| 72 | have hhalfF : (Subtype.val : U → M) '' {x : U | 0 < cylinderSignedHeight phi x} ⊆ |
| 73 | F := by |
| 74 | rw [← hcomponent w hw] |
| 75 | exact hhalf.subset_connectedComponentIn ⟨wU, hwpos, rfl⟩ hhalfsub |
| 76 | intro x |
| 77 | exact ⟨fun hx => hhalfF ⟨x, hx, rfl⟩, |
| 78 | fun hx => hpre.lt_of_ne (continuous_cylinderSignedHeight phi).continuousOn |
| 79 | havoid ⟨wU, hw, hwpos⟩ hx⟩ |
| 80 | |
| 81 | end PoincareMT.M28 |