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.PositiveEnds.PositiveComponentDistance |
| 3 | import PoincareLib.Geometry.RicciFlow.Generalized.BoundedDistance.Tube.NeckGeometry.NeckRegionConnector |
| 4 | import PoincareLib.Geometry.RicciFlow.Generalized.BoundedDistance.Tube.IntrinsicGeometry.IntrinsicOpenMetric |
| 5 | import Mathlib.Topology.Connected.Clopen |
| 6 | |
| 7 | /-! |
| 8 | # Finite intrinsic diameter of the literal recut |
| 9 | |
| 10 | A uniform ambient bound is converted to confined paths through the |
| 11 | interior selected sphere. The actual interval-region connector treats |
| 12 | all added collar points, including arbitrarily near its open boundary. |
| 13 | Source: Morgan--Tian Proposition 10.7 and Claim 10.8, pp. 253-254; |
| 14 | M28 derivation 92, final intrinsic confinement. |
| 15 | -/ |
| 16 | |
| 17 | set_option autoImplicit false |
| 18 | set_option backward.isDefEq.respectTransparency false |
| 19 | |
| 20 | open Set |
| 21 | open scoped Manifold ContDiff Topology ENNReal Bundle |
| 22 | |
| 23 | namespace PoincareMT.M28 |
| 24 | |
| 25 | variable {M : Type*} [TopologicalSpace M] [T2Space M] |
| 26 | [ChartedSpace (EuclideanSpace ℝ (Fin 3)) M] [IsManifold (𝓡 3) ∞ M] |
| 27 | {g : RiemannianMetric 3 M} |
| 28 | |
| 29 | /-- The actual open recut has finite intrinsic diameter when its points |
| 30 | have a uniform ambient distance bound. Its exact component closure and |
| 31 | literal collar produce all confined paths; completeness is not assumed. |
| 32 | Source: Proposition 10.7 and Claim 10.8; M28 derivation 92. -/ |
| 33 | theorem exists_intrinsicDiameter_bound_of_neck_recut (N : EpsilonNeck g) |
| 34 | {P : Set M} (hPo : IsOpen P) (hPS : P ⊆ N.central_sphereᶜ) |
| 35 | (hPcl : closure P = P ∪ N.central_sphere) |
| 36 | {a b : ℝ} (ha : a < 0) (hb : 0 < b) |
| 37 | (V : TopologicalSpace.Opens M) (hV : (V : Set M) = P ∪ N.region a b) |
| 38 | (base : M) {D : ℝ} (hD : 0 < D) |
| 39 | (hbound : ∀ x ∈ (V : Set M), g.edist base x ≤ ENNReal.ofReal D) : |
| 40 | ∃ B : ℝ, 0 < B ∧ intrinsicDiameter g (V : Set M) ≤ ENNReal.ofReal B := by |
| 41 | let : Bundle.RiemannianBundle (TangentSpace (𝓡 3) : M → Type _) := |
| 42 | ⟨g.toRiemannianMetric⟩ |
| 43 | let h := intrinsicOpenMetric g V |
| 44 | let : Bundle.RiemannianBundle (TangentSpace (𝓡 3) : V → Type _) := |
| 45 | ⟨h.toRiemannianMetric⟩ |
| 46 | have hPV : P ⊆ (V : Set M) := by rw [hV]; exact subset_union_left |
| 47 | have hRV : N.region a b ⊆ (V : Set M) := by rw [hV]; exact subset_union_right |
| 48 | have hSV : N.central_sphere ⊆ (V : Set M) := |
| 49 | (N.central_sphere_subset_region ha hb).trans hRV |
| 50 | let z : V := ⟨N.center, hSV N.center_on_central_sphere⟩ |
| 51 | have hcomponent : ∀ q ∈ P, connectedComponentIn N.central_sphereᶜ q ⊆ P := by |
| 52 | intro q hq |
| 53 | apply isPreconnected_connectedComponentIn.subset_of_closure_inter_subset hPo |
| 54 | ⟨q, mem_connectedComponentIn (hPS hq), hq⟩ |
| 55 | rintro x ⟨hxcl, hxcomp⟩ |
| 56 | rcases hPcl ▸ hxcl with hxP | hxS |
| 57 | · exact hxP |
| 58 | · exact False.elim (connectedComponentIn_subset _ q hxcomp hxS) |
| 59 | let Dpositive := (4 * standardSpherePathCeiling) * N.scale + (2 * D + 1) |
| 60 | let Dcollar := (2 * N.epsilon⁻¹ + 4 * standardSpherePathCeiling) * N.scale |
| 61 | let R := Dpositive + Dcollar |
| 62 | have hSpherePos : 0 < standardSpherePathCeiling := standardSpherePathCeiling_pos |
| 63 | have hscale : 0 < N.scale := N.scale_pos |
| 64 | have heps : 0 < N.epsilon⁻¹ := inv_pos.mpr N.epsilon_pos |
| 65 | have hDpositive : 0 < Dpositive := by dsimp [Dpositive]; positivity |
| 66 | have hDcollar : 0 < Dcollar := by dsimp [Dcollar]; positivity |
| 67 | have hR : 0 < R := add_pos hDpositive hDcollar |
| 68 | have hcenterBound : g.edist N.center base ≤ ENNReal.ofReal D := by |
| 69 | rw [show g.edist N.center base = g.edist base N.center from |
| 70 | Manifold.riemannianEDist_comm] |
| 71 | exact hbound N.center z.property |
| 72 | have hradial (q : V) : h.edist z q ≤ ENNReal.ofReal R := by |
| 73 | have hq : (q : M) ∈ P ∪ N.region a b := by |
| 74 | rw [← hV] |
| 75 | exact q.property |
| 76 | rcases hq with hqP | hqRegion |
| 77 | · have hambient : g.edist N.center (q : M) < ENNReal.ofReal (2 * D + 1) := by |
| 78 | apply (Manifold.riemannianEDist_triangle.trans |
| 79 | (add_le_add hcenterBound (hbound q q.property))).trans_lt |
| 80 | rw [← ENNReal.ofReal_add hD.le hD.le] |
| 81 | apply (ENNReal.ofReal_lt_ofReal_iff (by positivity)).mpr |
| 82 | linarith |
| 83 | have hh := intrinsicEDist_to_positive_component_le N V hSV hPV hcomponent hqP |
| 84 | (by positivity : 0 < 2 * D + 1) hambient |
| 85 | rw [← intrinsicOpenMetric_edist g V z q] at hh |
| 86 | exact hh.trans (ENNReal.ofReal_le_ofReal |
| 87 | (le_add_of_nonneg_right hDcollar.le)) |
| 88 | · obtain ⟨gamma, h0, h1, hgamma, hregion, hlength⟩ := |
| 89 | exists_neck_region_center_connector N ha hb hqRegion |
| 90 | have hh := intrinsicEDist_le_pathELength g zero_le_one hgamma |
| 91 | (fun t ht => hRV (hregion ht)) |
| 92 | rw [h0, h1, ← intrinsicOpenMetric_edist g V q z] at hh |
| 93 | have hcomm : h.edist z q = h.edist q z := Manifold.riemannianEDist_comm |
| 94 | rw [hcomm] |
| 95 | exact (hh.trans hlength.le).trans (ENNReal.ofReal_le_ofReal |
| 96 | (le_add_of_nonneg_left hDpositive.le)) |
| 97 | refine ⟨2 * R, by positivity, ?_⟩ |
| 98 | unfold intrinsicDiameter |
| 99 | apply sSup_le |
| 100 | rintro _ ⟨⟨x, y⟩, rfl⟩ |
| 101 | change intrinsicEDist g (V : Set M) x y ≤ ENNReal.ofReal (2 * R) |
| 102 | rw [← intrinsicOpenMetric_edist g V x y] |
| 103 | have hleft : h.edist x z ≤ ENNReal.ofReal R := by |
| 104 | rw [show h.edist x z = h.edist z x from Manifold.riemannianEDist_comm] |
| 105 | exact hradial x |
| 106 | calc |
| 107 | h.edist x y ≤ h.edist x z + h.edist z y := Manifold.riemannianEDist_triangle |
| 108 | _ ≤ ENNReal.ofReal R + ENNReal.ofReal R := add_le_add hleft (hradial y) |
| 109 | _ = ENNReal.ofReal (2 * R) := by |
| 110 | rw [← ENNReal.ofReal_add hR.le hR.le] |
| 111 | congr 1 |
| 112 | ring |
| 113 | |
| 114 | end PoincareMT.M28 |