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.StandardCap.Persistence.SourceNames.Normalization |
| 3 | import PoincareLib.Geometry.RicciFlow.Surgery.StandardCap.Persistence.Removal.Neck.NeckHeight |
| 4 | import PoincareLib.Geometry.RicciFlow.Surgery.StandardCap.Persistence.Limit.Coordinates.LengthBarrier |
| 5 | import PoincareLib.Geometry.Riemannian.Normalization.Scaling.Distance |
| 6 | |
| 7 | /-! |
| 8 | # An ambient distance buffer about the later surgery sphere |
| 9 | |
| 10 | Every sufficiently short ambient path from a central-sphere point |
| 11 | stays within the actual neck. The first-exit argument uses the |
| 12 | compact middle band and its exact height boundary. |
| 13 | Morgan--Tian, Claim 16.10, pp. 374-375; M44 derivation 71. |
| 14 | -/ |
| 15 | |
| 16 | set_option autoImplicit false |
| 17 | set_option backward.isDefEq.respectTransparency false |
| 18 | |
| 19 | open Set |
| 20 | open scoped Manifold ContDiff Topology ENNReal |
| 21 | |
| 22 | namespace PoincareMT.M44 |
| 23 | |
| 24 | open M36 |
| 25 | |
| 26 | local notation "E" => EuclideanSpace ℝ (Fin 3) |
| 27 | |
| 28 | variable {M : Type*} [TopologicalSpace M] [ChartedSpace E M] |
| 29 | [IsManifold (𝓡 3) ∞ M] [T2Space M] {g : RiemannianMetric 3 M} |
| 30 | |
| 31 | /-- A positive metric ball about any point of the central sphere |
| 32 | is confined in the actual middle band, including against paths |
| 33 | leaving the neck. Source: Claim 16.10; M44 derivation 71. -/ |
| 34 | theorem neck_ball_subset_middle_band (N : EpsilonNeck g) |
| 35 | (hsmall : N.epsilon ≤ 1 / 12) {b : ℝ} (hb0 : 0 < b) (hb : b < N.epsilon⁻¹) |
| 36 | {p : M} (hp : p ∈ N.central_sphere) : |
| 37 | g.ball p (Real.sqrt ((1 - 6 * N.epsilon) / N.connection.scalarCurvature N.center) * b) ⊆ |
| 38 | N.region (-b) b := by |
| 39 | let c := (1 - 6 * N.epsilon) / N.connection.scalarCurvature N.center |
| 40 | have hc : 0 < c := div_pos (by linarith) N.scalar_center_pos |
| 41 | let k := m01RescaledMetric (RiemannianMetric.euclideanMetric 3) c hc |
| 42 | obtain ⟨hpN, hpH⟩ := (neck_central_iff N).mp hp |
| 43 | have hpU : p ∈ N.region (-b) b := ⟨hpN, by rw [hpH]; exact ⟨neg_neg_of_pos hb0, hb0⟩⟩ |
| 44 | have hcl := neck_closure_region_subset N hb0 hb |
| 45 | apply g.ball_subset_of_inverse_length_barrier k (neckHeightVector N) |
| 46 | (neck_region_isOpen N (-b) b) hpU |
| 47 | · intro x hx |
| 48 | exact neckHeightVector_contMDiffAt N (hcl hx) |
| 49 | · intro x hx w |
| 50 | exact neckHeightVector_quadratic N hsmall (hcl hx) w |
| 51 | · intro x hx |
| 52 | obtain ⟨_hxN, hxH⟩ := neck_frontier_region_height N hb0 hb hx |
| 53 | have he (v w : E) : (RiemannianMetric.euclideanMetric 3).edist v w = edist v w := |
| 54 | (IsRiemannianManifold.out (I := 𝓡 3) v w).symm |
| 55 | have hdist : (RiemannianMetric.euclideanMetric 3).edist |
| 56 | (neckHeightVector N p) (neckHeightVector N x) = ENNReal.ofReal b := by |
| 57 | rw [he] |
| 58 | simp only [neckHeightVector, hpH, zero_smul, edist_dist, dist_zero_left, |
| 59 | norm_smul, Real.norm_eq_abs, OrthonormalBasis.norm_eq_one, mul_one, hxH] |
| 60 | change ENNReal.ofReal (Real.sqrt c * b) ≤ |
| 61 | (m01RescaledMetric (RiemannianMetric.euclideanMetric 3) c hc).edist |
| 62 | (neckHeightVector N p) (neckHeightVector N x) |
| 63 | rw [m01RescaledMetric_edist, hdist, ENNReal.ofReal_mul (Real.sqrt_nonneg c)] |
| 64 | |
| 65 | /-- The half-width middle band gives an explicit ambient neck |
| 66 | buffer at every point of the surgery sphere. Source: Claim 16.10, |
| 67 | pp. 374-375; M44 derivation 71. -/ |
| 68 | theorem neck_ball_subset_carrier (N : EpsilonNeck g) |
| 69 | (hsmall : N.epsilon ≤ 1 / 12) {p : M} (hp : p ∈ N.central_sphere) : |
| 70 | g.ball p (Real.sqrt ((1 - 6 * N.epsilon) / N.connection.scalarCurvature N.center) * |
| 71 | (N.epsilon⁻¹ / 2)) ⊆ N.carrier := |
| 72 | (neck_ball_subset_middle_band N hsmall (half_pos (inv_pos.mpr N.epsilon_pos)) |
| 73 | (half_lt_self (inv_pos.mpr N.epsilon_pos)) hp).trans (neck_region_subset N _ _) |
| 74 | |
| 75 | end PoincareMT.M44 |