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.CylinderSphereCoordinates |
| 3 | import Mathlib.Analysis.Normed.Module.Connected |
| 4 | |
| 5 | /-! |
| 6 | # The two sides of actual transported cylinder coordinates |
| 7 | |
| 8 | Morgan--Tian Claim 10.3, pp. 248-249. A genuine product homeomorphism gives |
| 9 | a continuous open signed height, two preconnected half-cylinders, and the |
| 10 | exact relative closure of either half. The preceding coordinate producer |
| 11 | constructs this homeomorphism from the actual selected sphere isotopy. |
| 12 | -/ |
| 13 | |
| 14 | set_option autoImplicit false |
| 15 | |
| 16 | open Set |
| 17 | open scoped Topology |
| 18 | |
| 19 | universe u |
| 20 | |
| 21 | namespace PoincareMT.M28 |
| 22 | |
| 23 | variable {X : Type u} [TopologicalSpace X] |
| 24 | |
| 25 | /-- Signed height in the actual product homeomorphism (Claim 10.3). -/ |
| 26 | noncomputable def cylinderSignedHeight |
| 27 | (φ : X ≃ₜ (UnitTwoSphere × Ioo (0 : ℝ) 1)) (x : X) : ℝ := |
| 28 | ((φ x).2 : ℝ) - 1 / 2 |
| 29 | |
| 30 | /-- The actual signed height is continuous on its full open subtype. -/ |
| 31 | theorem continuous_cylinderSignedHeight |
| 32 | (φ : X ≃ₜ (UnitTwoSphere × Ioo (0 : ℝ) 1)) : |
| 33 | Continuous (cylinderSignedHeight φ) := |
| 34 | (continuous_subtype_val.comp (continuous_snd.comp φ.continuous)).sub continuous_const |
| 35 | |
| 36 | /-- Openness follows from the actual product coordinate and the open |
| 37 | interval inclusion, with no separation assumption. -/ |
| 38 | theorem isOpenMap_cylinderSignedHeight |
| 39 | (φ : X ≃ₜ (UnitTwoSphere × Ioo (0 : ℝ) 1)) : |
| 40 | IsOpenMap (cylinderSignedHeight φ) := |
| 41 | (isOpenMap_sub_right (1 / 2 : ℝ)).comp |
| 42 | (isOpen_Ioo.isOpenMap_subtype_val.comp (isOpenMap_snd.comp φ.isOpenMap)) |
| 43 | |
| 44 | private theorem sphere_univ_preconnected : IsPreconnected (univ : Set UnitTwoSphere) := by |
| 45 | have hs : IsConnected (Metric.sphere (0 : EuclideanSpace ℝ (Fin 3)) 1) := |
| 46 | isConnected_sphere (by rw [← Module.finrank_eq_rank]; norm_num) _ (by norm_num) |
| 47 | let : ConnectedSpace UnitTwoSphere := Subtype.connectedSpace hs |
| 48 | exact isPreconnected_univ |
| 49 | |
| 50 | private theorem lower_interval_preconnected : |
| 51 | IsPreconnected {s : Ioo (0 : ℝ) 1 | (s : ℝ) < 1 / 2} := by |
| 52 | have hrange : Ioo (0 : ℝ) (1 / 2) ⊆ range (Subtype.val : Ioo (0 : ℝ) 1 → ℝ) := by |
| 53 | intro s hs |
| 54 | exact ⟨⟨s, hs.1, hs.2.trans (by norm_num)⟩, rfl⟩ |
| 55 | have hh := (isPreconnected_Ioo : IsPreconnected (Ioo (0 : ℝ) (1 / 2))).preimage_of_isOpenMap |
| 56 | Subtype.val_injective isOpen_Ioo.isOpenMap_subtype_val hrange |
| 57 | convert hh using 1 |
| 58 | ext s |
| 59 | exact ⟨fun hs => ⟨s.property.1, hs⟩, fun hs => hs.2⟩ |
| 60 | |
| 61 | private theorem upper_interval_preconnected : |
| 62 | IsPreconnected {s : Ioo (0 : ℝ) 1 | (1 / 2 : ℝ) < s} := by |
| 63 | have hrange : Ioo (1 / 2 : ℝ) 1 ⊆ range (Subtype.val : Ioo (0 : ℝ) 1 → ℝ) := by |
| 64 | intro s hs |
| 65 | exact ⟨⟨s, (by norm_num : (0 : ℝ) < 1 / 2).trans hs.1, hs.2⟩, rfl⟩ |
| 66 | have hh := (isPreconnected_Ioo : IsPreconnected (Ioo (1 / 2 : ℝ) 1)).preimage_of_isOpenMap |
| 67 | Subtype.val_injective isOpen_Ioo.isOpenMap_subtype_val hrange |
| 68 | convert hh using 1 |
| 69 | ext s |
| 70 | exact ⟨fun hs => ⟨hs, s.property.2⟩, fun hs => hs.1⟩ |
| 71 | |
| 72 | /-- The actual negative half is preconnected (Claim 10.3). -/ |
| 73 | theorem isPreconnected_cylinderSignedHeight_negative |
| 74 | (φ : X ≃ₜ (UnitTwoSphere × Ioo (0 : ℝ) 1)) : |
| 75 | IsPreconnected {x | cylinderSignedHeight φ x < 0} := by |
| 76 | have hh := (sphere_univ_preconnected.prod lower_interval_preconnected).preimage_of_isOpenMap |
| 77 | φ.injective φ.isOpenMap (fun x _ => φ.surjective x) |
| 78 | convert hh using 1 |
| 79 | ext x |
| 80 | simp [cylinderSignedHeight] |
| 81 | |
| 82 | /-- The actual positive half is preconnected (Claim 10.3). -/ |
| 83 | theorem isPreconnected_cylinderSignedHeight_positive |
| 84 | (φ : X ≃ₜ (UnitTwoSphere × Ioo (0 : ℝ) 1)) : |
| 85 | IsPreconnected {x | 0 < cylinderSignedHeight φ x} := by |
| 86 | have hh := (sphere_univ_preconnected.prod upper_interval_preconnected).preimage_of_isOpenMap |
| 87 | φ.injective φ.isOpenMap (fun x _ => φ.surjective x) |
| 88 | convert hh using 1 |
| 89 | ext x |
| 90 | simp [cylinderSignedHeight] |
| 91 | |
| 92 | /-- The actual zero sphere is preconnected; its parametrization is a |
| 93 | literal factor of the produced cylinder homeomorphism. -/ |
| 94 | theorem isPreconnected_cylinderSignedHeight_zero |
| 95 | (φ : X ≃ₜ (UnitTwoSphere × Ioo (0 : ℝ) 1)) : |
| 96 | IsPreconnected {x | cylinderSignedHeight φ x = 0} := by |
| 97 | let c : Ioo (0 : ℝ) 1 := ⟨1 / 2, by norm_num⟩ |
| 98 | have hh := |
| 99 | (sphere_univ_preconnected.prod (isPreconnected_singleton (x := c))).preimage_of_isOpenMap |
| 100 | φ.injective φ.isOpenMap (fun x _ => φ.surjective x) |
| 101 | convert hh using 1 |
| 102 | ext x |
| 103 | simp [cylinderSignedHeight, c, Subtype.ext_iff, sub_eq_zero] |
| 104 | |
| 105 | /-- The relative closure of the negative half includes precisely its |
| 106 | zero sphere. This follows from openness of the actual signed height. -/ |
| 107 | theorem closure_cylinderSignedHeight_negative |
| 108 | (φ : X ≃ₜ (UnitTwoSphere × Ioo (0 : ℝ) 1)) : |
| 109 | closure {x | cylinderSignedHeight φ x < 0} = |
| 110 | {x | cylinderSignedHeight φ x ≤ 0} := by |
| 111 | have hh := (isOpenMap_cylinderSignedHeight φ).preimage_closure_eq_closure_preimage |
| 112 | (continuous_cylinderSignedHeight φ) (Iio (0 : ℝ)) |
| 113 | rw [closure_Iio] at hh |
| 114 | exact hh.symm |
| 115 | |
| 116 | /-- The relative closure of the positive half includes precisely its |
| 117 | zero sphere, in the same actual open subtype. -/ |
| 118 | theorem closure_cylinderSignedHeight_positive |
| 119 | (φ : X ≃ₜ (UnitTwoSphere × Ioo (0 : ℝ) 1)) : |
| 120 | closure {x | 0 < cylinderSignedHeight φ x} = |
| 121 | {x | 0 ≤ cylinderSignedHeight φ x} := by |
| 122 | have hh := (isOpenMap_cylinderSignedHeight φ).preimage_closure_eq_closure_preimage |
| 123 | (continuous_cylinderSignedHeight φ) (Ioi (0 : ℝ)) |
| 124 | rw [closure_Ioi] at hh |
| 125 | exact hh.symm |
| 126 | |
| 127 | end PoincareMT.M28 |