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.CylinderSphereOrder |
| 3 | |
| 4 | /-! |
| 5 | # Three fixed cylinder spheres and a bounded connecting set |
| 6 | |
| 7 | A connected set from the first sphere to the middle sphere misses the |
| 8 | high sphere. Together with the common end orientation, this determines |
| 9 | the middle sphere's signs at the original base and the high witness. |
| 10 | Source: Morgan--Tian Claim 10.8, p. 254; M28 derivation 123. |
| 11 | -/ |
| 12 | |
| 13 | set_option autoImplicit false |
| 14 | |
| 15 | open Set |
| 16 | open scoped Topology |
| 17 | |
| 18 | namespace PoincareMT.M28 |
| 19 | |
| 20 | variable {X : Type*} [TopologicalSpace X] |
| 21 | |
| 22 | /-- Three coherently oriented essential spheres place the base and high |
| 23 | witness on opposite sides of the middle sphere. The connecting set and |
| 24 | the high carrier are actual connected sets, with explicit exclusions. |
| 25 | Source: Claim 10.8, p. 254; M28 derivation 123. -/ |
| 26 | theorem cylinderSignedHeight_middle_signs |
| 27 | (phiS phiC phiH : X ≃ₜ (UnitTwoSphere × Ioo (0 : ℝ) 1)) |
| 28 | (hCpos : ∀ x, cylinderSignedHeight phiC x = 0 → 0 < cylinderSignedHeight phiS x) |
| 29 | (hHpos : ∀ x, cylinderSignedHeight phiH x = 0 → 0 < cylinderSignedHeight phiS x) |
| 30 | (hCH : ∀ x, cylinderSignedHeight phiC x = 0 → cylinderSignedHeight phiH x ≠ 0) |
| 31 | (hlow : ∃ x, cylinderSignedHeight phiS x < 0 ∧ |
| 32 | cylinderSignedHeight phiC x < 0 ∧ cylinderSignedHeight phiH x < 0) |
| 33 | (hhigh : ∃ x, 0 < cylinderSignedHeight phiS x ∧ |
| 34 | 0 < cylinderSignedHeight phiC x ∧ 0 < cylinderSignedHeight phiH x) |
| 35 | {b q z p : X} (hb : cylinderSignedHeight phiS b = 0) |
| 36 | (hq : cylinderSignedHeight phiC q = 0) (hz : cylinderSignedHeight phiH z = 0) |
| 37 | {K P : Set X} (hK : IsPreconnected K) (hbK : b ∈ K) (hqK : q ∈ K) |
| 38 | (havoidK : ∀ x ∈ K, cylinderSignedHeight phiH x ≠ 0) |
| 39 | (hP : IsPreconnected P) (hzP : z ∈ P) (hpP : p ∈ P) |
| 40 | (havoidP : ∀ x ∈ P, cylinderSignedHeight phiC x ≠ 0) : |
| 41 | cylinderSignedHeight phiC b < 0 ∧ 0 < cylinderSignedHeight phiC p := by |
| 42 | obtain ⟨l, hlS, hlC, hlH⟩ := hlow |
| 43 | obtain ⟨r, hrS, hrC, hrH⟩ := hhigh |
| 44 | have hSC : ∀ x, cylinderSignedHeight phiS x = 0 → |
| 45 | cylinderSignedHeight phiC x ≠ 0 := by |
| 46 | intro x hxS hxC |
| 47 | have h := hCpos x hxC |
| 48 | rw [hxS] at h |
| 49 | exact lt_irrefl _ h |
| 50 | have hSH : ∀ x, cylinderSignedHeight phiS x = 0 → |
| 51 | cylinderSignedHeight phiH x ≠ 0 := by |
| 52 | intro x hxS hxH |
| 53 | have h := hHpos x hxH |
| 54 | rw [hxS] at h |
| 55 | exact lt_irrefl _ h |
| 56 | have hbC : cylinderSignedHeight phiC b < 0 := by |
| 57 | rcases cylinderSignedHeight_opposite_order phiS phiC hSC |
| 58 | ⟨l, hlS, hlC⟩ ⟨r, hrS, hrC⟩ with h | h |
| 59 | · exact h.2 b hb |
| 60 | · exact False.elim ((not_lt_of_ge (hCpos q hq).le) (h.1 q hq)) |
| 61 | have hbH : cylinderSignedHeight phiH b < 0 := by |
| 62 | rcases cylinderSignedHeight_opposite_order phiS phiH hSH |
| 63 | ⟨l, hlS, hlH⟩ ⟨r, hrS, hrH⟩ with h | h |
| 64 | · exact h.2 b hb |
| 65 | · exact False.elim ((not_lt_of_ge (hHpos z hz).le) (h.1 z hz)) |
| 66 | have hqH : cylinderSignedHeight phiH q < 0 := |
| 67 | hK.gt_of_ne (continuous_cylinderSignedHeight phiH).continuousOn |
| 68 | havoidK ⟨b, hbK, hbH⟩ hqK |
| 69 | have hHC : ∀ x, cylinderSignedHeight phiH x = 0 → |
| 70 | 0 < cylinderSignedHeight phiC x := by |
| 71 | rcases cylinderSignedHeight_opposite_order phiC phiH hCH |
| 72 | ⟨l, hlC, hlH⟩ ⟨r, hrC, hrH⟩ with h | h |
| 73 | · exact h.1 |
| 74 | · exact False.elim ((not_lt_of_ge (h.2 q hq).le) hqH) |
| 75 | exact ⟨hbC, hP.lt_of_ne (continuous_cylinderSignedHeight phiC).continuousOn |
| 76 | havoidP ⟨z, hzP, hHC z hz⟩ hpP⟩ |
| 77 | |
| 78 | end PoincareMT.M28 |