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.Surgery.StandardCap.Persistence.SourceNames.Metric |
| 2 | import PoincareLib.Geometry.RicciFlow.Surgery.Induction.Schedules.StandardGeometry.CapNeckTopology |
| 3 | |
| 4 | /-! |
| 5 | # Uniform separation of a cap collar from a compact middle neck |
| 6 | |
| 7 | Morgan--Tian Definition 9.72 and Remark 9.73, pp. 230-231. Compactness of |
| 8 | the central sphere supplies one thin collar avoiding a closed set, and |
| 9 | the end neck's compact middle strip separates its two open quarters. |
| 10 | -/ |
| 11 | |
| 12 | set_option autoImplicit false |
| 13 | |
| 14 | open Set |
| 15 | open scoped Manifold ContDiff Topology |
| 16 | |
| 17 | universe u |
| 18 | |
| 19 | open PoincareMT.MetricSurgery |
| 20 | |
| 21 | namespace PoincareMT.M45 |
| 22 | |
| 23 | variable {M : Type u} [TopologicalSpace M] |
| 24 | [ChartedSpace (EuclideanSpace ℝ (Fin 3)) M] [IsManifold (𝓡 3) ∞ M] |
| 25 | {g : RiemannianMetric 3 M} |
| 26 | |
| 27 | /-- One uniform thin collar avoids any closed set disjoint from the |
| 28 | entire central sphere. Definition 9.72(3), p. 230, and Remark 9.73. -/ |
| 29 | theorem neck_exists_collar_avoiding (N : EpsilonNeck g) {H : Set M} |
| 30 | (hH : IsClosed H) (hNH : Disjoint N.central_sphere H) : |
| 31 | ∃ delta : ℝ, 0 < delta ∧ delta ≤ N.epsilon⁻¹ ∧ |
| 32 | N.region (-delta) delta ⊆ Hᶜ := by |
| 33 | let D : Set RoundCylinderSpace := univ ×ˢ Ioo (-N.epsilon⁻¹) N.epsilon⁻¹ |
| 34 | let W := D ∩ N.coordinate_map ⁻¹' Hᶜ |
| 35 | have hW : IsOpen W := N.coordinate_map_smooth.continuousOn.isOpen_inter_preimage |
| 36 | (isOpen_univ.prod isOpen_Ioo) hH.isOpen_compl |
| 37 | have hpos := inv_pos.mpr N.epsilon_pos |
| 38 | have hcentral : (univ ×ˢ ({0} : Set ℝ) : Set RoundCylinderSpace) ⊆ W := by |
| 39 | intro z hz |
| 40 | have hz0 : z.2 = 0 := hz.2 |
| 41 | refine ⟨⟨mem_univ _, ?_⟩, ?_⟩ |
| 42 | · change -N.epsilon⁻¹ < z.2 ∧ z.2 < N.epsilon⁻¹ |
| 43 | rw [hz0] |
| 44 | exact ⟨neg_lt_zero.mpr hpos, hpos⟩ |
| 45 | · apply Set.disjoint_left.mp hNH |
| 46 | rw [N.central_sphere_eq] |
| 47 | exact ⟨z, hz, rfl⟩ |
| 48 | obtain ⟨u, v, _hu, hv, hsu, htv, huv⟩ := |
| 49 | generalized_tube_lemma isCompact_univ isCompact_singleton hW hcentral |
| 50 | obtain ⟨rho, hrho, hball⟩ := |
| 51 | Metric.mem_nhds_iff.mp (hv.mem_nhds (htv (mem_singleton 0))) |
| 52 | refine ⟨min rho N.epsilon⁻¹, lt_min hrho hpos, min_le_right _ _, ?_⟩ |
| 53 | intro x hx |
| 54 | have hzv : (N.coordinate_inverse x).2 ∈ v := by |
| 55 | apply hball |
| 56 | rw [Metric.mem_ball, Real.dist_eq, sub_zero, abs_lt] |
| 57 | exact ⟨by linarith [hx.2.1, min_le_left rho N.epsilon⁻¹], |
| 58 | lt_of_lt_of_le hx.2.2 (min_le_left _ _)⟩ |
| 59 | have h := (huv ⟨hsu (mem_univ _), hzv⟩).2 |
| 60 | simpa only [mem_preimage, M36.neck_coordinate_inverse N hx.1] using h |
| 61 | |
| 62 | /-- The actual middle closed strip of a neck is compact. Definition 2.18, |
| 63 | p. 31, used for the orientation in Remark 9.73, p. 231. -/ |
| 64 | theorem neck_middle_strip_compact (N : EpsilonNeck g) : |
| 65 | IsCompact (N.coordinate_map '' |
| 66 | (univ ×ˢ Icc (-N.epsilon⁻¹ / 2) (N.epsilon⁻¹ / 2))) := by |
| 67 | have hpos := inv_pos.mpr N.epsilon_pos |
| 68 | apply (isCompact_univ.prod isCompact_Icc).image_of_continuousOn |
| 69 | apply N.coordinate_map_smooth.continuousOn.mono |
| 70 | intro z hz |
| 71 | exact ⟨hz.1, by linarith [hz.2.1], by linarith [hz.2.2]⟩ |
| 72 | |
| 73 | /-- The compact middle strip stays inside the open end neck. |
| 74 | Definition 2.18, p. 31, used in Remark 9.73, p. 231. -/ |
| 75 | theorem neck_middle_strip_subset (N : EpsilonNeck g) : |
| 76 | N.coordinate_map '' (univ ×ˢ Icc (-N.epsilon⁻¹ / 2) (N.epsilon⁻¹ / 2)) ⊆ |
| 77 | N.carrier := by |
| 78 | have hpos := inv_pos.mpr N.epsilon_pos |
| 79 | rintro x ⟨z, hz, rfl⟩ |
| 80 | exact M36.neck_coordinate_mem N z |
| 81 | ⟨hz.1, by linarith [hz.2.1], by linarith [hz.2.2]⟩ |
| 82 | |
| 83 | /-- Removing the actual middle strip leaves the two open end quarters. |
| 84 | Remark 9.73, p. 231. -/ |
| 85 | theorem neck_outside_middle (N : EpsilonNeck g) {x : M} (hx : x ∈ N.carrier) |
| 86 | (hmid : x ∉ N.coordinate_map '' |
| 87 | (univ ×ˢ Icc (-N.epsilon⁻¹ / 2) (N.epsilon⁻¹ / 2))) : |
| 88 | x ∈ N.region (-N.epsilon⁻¹) (-N.epsilon⁻¹ / 2) ∪ |
| 89 | N.region (N.epsilon⁻¹ / 2) N.epsilon⁻¹ := by |
| 90 | have hz := (N.coordinate_inverse_mem x hx).2 |
| 91 | by_cases hneg : (N.coordinate_inverse x).2 < -N.epsilon⁻¹ / 2 |
| 92 | · exact Or.inl ⟨hx, hz.1, hneg⟩ |
| 93 | · apply Or.inr |
| 94 | refine ⟨hx, ?_, hz.2⟩ |
| 95 | by_contra h |
| 96 | apply hmid |
| 97 | exact ⟨N.coordinate_inverse x, ⟨mem_univ _, le_of_not_gt hneg, le_of_not_gt h⟩, |
| 98 | M36.neck_coordinate_inverse N hx⟩ |
| 99 | |
| 100 | end PoincareMT.M45 |