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.Spacetime.Geometry.OrdinaryNeckVolume |
| 3 | import PoincareLib.Geometry.RicciFlow.Generalized.BoundedDistance.Tube.NeckGeometry.NeckPrecompactBalls |
| 4 | import PoincareLib.Geometry.Riemannian.Comparison.Covering |
| 5 | |
| 6 | /-! |
| 7 | # Compact containment of bounded-scalar neck centers |
| 8 | |
| 9 | In the actual ambient metric, a scalar bound gives a common neck scale |
| 10 | floor. Local volume and precompact balls then give a finite covering of |
| 11 | those centers. No completeness or cylinder end is assumed. Source: |
| 12 | Morgan--Tian Claim 10.8, p. 254; M28 derivation 128. |
| 13 | -/ |
| 14 | |
| 15 | set_option autoImplicit false |
| 16 | |
| 17 | open Set MeasureTheory |
| 18 | open scoped Manifold ContDiff Bundle ENNReal |
| 19 | |
| 20 | universe u |
| 21 | |
| 22 | namespace PoincareMT.M28 |
| 23 | |
| 24 | variable {M : Type u} [TopologicalSpace M] |
| 25 | [MeasurableSpace M] [BorelSpace M] [T3Space M] |
| 26 | [ChartedSpace (EuclideanSpace ℝ (Fin 3)) M] [IsManifold (𝓡 3) ∞ M] |
| 27 | {g : RiemannianMetric 3 M} |
| 28 | |
| 29 | /-- Bounded scalar centers in an actual neck cover lie in one compact |
| 30 | ambient set. The compact set is chosen after the scalar bound and before |
| 31 | every tested center. Source: Claim 10.8, p. 254; M28 derivation 128. -/ |
| 32 | theorem exists_compact_bounded_scalar_neck_cover |
| 33 | (K : NeckOnlyCover g) (D : LeviCivitaData g) |
| 34 | (hD : ∀ N ∈ K.necks, N.connection = D) |
| 35 | (hfinite : g.volumeMeasure univ ≠ ⊤) {B : ℝ} (hB : 0 < B) : |
| 36 | ∃ C : Set M, IsCompact C ∧ {x | x ∈ K.X ∧ D.scalarCurvature x ≤ B} ⊆ C := by |
| 37 | classical |
| 38 | let : Bundle.RiemannianBundle (TangentSpace (𝓡 3) : M → Type _) := |
| 39 | ⟨g.toRiemannianMetric⟩ |
| 40 | let : IsContinuousRiemannianBundle (EuclideanSpace ℝ (Fin 3)) |
| 41 | (TangentSpace (𝓡 3) : M → Type _) := |
| 42 | ⟨⟨g.inner, g.toContinuousRiemannianMetric.continuous, fun _ _ _ => rfl⟩⟩ |
| 43 | let : EMetricSpace M := EMetricSpace.ofRiemannianMetric (𝓡 3) M |
| 44 | let S : Set M := {x | x ∈ K.X ∧ D.scalarCurvature x ≤ B} |
| 45 | let δ := B ^ (-1 / 2 : ℝ) / 16 |
| 46 | let v := normalizedNeckVolumeLowerConstant * δ ^ 3 |
| 47 | have hδ : 0 < δ := div_pos (Real.rpow_pos_of_pos hB _) (by norm_num) |
| 48 | have hv : 0 < v := mul_pos normalizedNeckVolumeLowerConstant_pos (pow_pos hδ 3) |
| 49 | have hball (q : M) (s : ℝ) : Metric.eball q (ENNReal.ofReal s) = g.ball q s := by |
| 50 | ext y |
| 51 | change g.edist y q < ENNReal.ofReal s ↔ g.edist q y < ENNReal.ofReal s |
| 52 | rw [show g.edist y q = g.edist q y from Manifold.riemannianEDist_comm] |
| 53 | have hlocal (x : M) (hx : x ∈ S) : |
| 54 | ENNReal.ofReal v ≤ g.volumeMeasure (g.ball x δ) ∧ |
| 55 | IsCompact (closure (g.ball x (2 * δ))) := by |
| 56 | obtain ⟨N, hN, hcenter⟩ := K.pointwise_center_cover x hx.1 |
| 57 | have hsmall : N.epsilon ≤ (1 / 200 : ℝ) := by |
| 58 | rw [K.neck_epsilon N hN] |
| 59 | exact K.epsilon_le_threshold.trans K.epsilon_threshold_le_one_two_hundred |
| 60 | have hR : 0 < D.scalarCurvature x := by |
| 61 | simpa only [hD N hN, hcenter] using N.scalar_center_pos |
| 62 | have hscale : B ^ (-1 / 2 : ℝ) ≤ N.scale := by |
| 63 | rw [N.scale_eq_scalar, hD N hN, hcenter] |
| 64 | exact Real.rpow_le_rpow_of_nonpos hR hx.2 (by norm_num) |
| 65 | have hδscale : δ ≤ N.scale / 8 := by dsimp only [δ]; linarith [N.scale_pos] |
| 66 | have htwo : 2 * δ ≤ N.scale / 8 := by dsimp only [δ]; linarith |
| 67 | have hinv : 1 ≤ N.epsilon⁻¹ := (one_le_inv₀ N.epsilon_pos).mpr (by |
| 68 | linarith [N.epsilon_lt_half]) |
| 69 | have hradius : 2 * δ ≤ N.scale * N.epsilon⁻¹ / 8 := by |
| 70 | nlinarith [mul_le_mul_of_nonneg_left hinv N.scale_pos.le] |
| 71 | constructor |
| 72 | · simpa only [hcenter] using ordinary_neck_center_ball_volume_lower N hsmall hδ hδscale |
| 73 | · have hc := (N.precompact_ball_of_central_sphere N.center_on_central_sphere).1 |
| 74 | rw [hcenter] at hc |
| 75 | apply hc.of_isClosed_subset isClosed_closure |
| 76 | apply closure_mono |
| 77 | intro y hy |
| 78 | exact hy.trans_le (ENNReal.ofReal_le_ofReal hradius) |
| 79 | obtain ⟨F, hFS, _hcard, _hsep, hcover⟩ := |
| 80 | Poincare.exists_finset_cover_of_separated_card_le S |
| 81 | (ENNReal.ofReal_pos.mpr (show 0 < 2 * δ by positivity)) |
| 82 | ⌈(g.volumeMeasure univ).toReal / v⌉₊ (by |
| 83 | intro F hFS hsep |
| 84 | have hbound := Poincare.MeasureTheory.card_le_measure_div_of_separated_balls |
| 85 | g.volumeMeasure F (r := ENNReal.ofReal δ) (U := univ) hv hfinite |
| 86 | (by |
| 87 | intro x hx y hy hxy |
| 88 | rw [← ENNReal.ofReal_add hδ.le hδ.le, |
| 89 | show δ + δ = 2 * δ by ring] |
| 90 | exact hsep hx hy hxy) |
| 91 | (fun _ _ => subset_univ _) (by |
| 92 | intro x hx |
| 93 | rw [hball] |
| 94 | exact (hlocal x (hFS hx)).1) |
| 95 | exact_mod_cast hbound.trans (Nat.le_ceil ((g.volumeMeasure univ).toReal / v))) |
| 96 | refine ⟨⋃ x ∈ F, closure (g.ball x (2 * δ)), |
| 97 | F.finite_toSet.isCompact_biUnion (fun x hx => (hlocal x (hFS hx)).2), ?_⟩ |
| 98 | intro x hx |
| 99 | obtain ⟨y, hy, hxy⟩ := hcover x hx |
| 100 | apply mem_iUnion₂.mpr |
| 101 | refine ⟨y, hy, subset_closure ?_⟩ |
| 102 | change g.edist y x < ENNReal.ofReal (2 * δ) |
| 103 | change g.edist x y < ENNReal.ofReal (2 * δ) at hxy |
| 104 | simpa only [RiemannianMetric.edist, Manifold.riemannianEDist_comm] using hxy |
| 105 | |
| 106 | /-- A finite-volume neck-covered region with noncompact closure has |
| 107 | unbounded scalar curvature. Source: Claim 10.8, p. 254; derivations |
| 108 | 120 and 128. All neck connections are the specified ambient connection. -/ |
| 109 | theorem exists_scalar_gt_of_neck_cover_noncompact_closure |
| 110 | (K : NeckOnlyCover g) (D : LeviCivitaData g) |
| 111 | (hD : ∀ N ∈ K.necks, N.connection = D) |
| 112 | (hfinite : g.volumeMeasure univ ≠ ⊤) (hcompact : ¬ IsCompact (closure K.X)) |
| 113 | (B : ℝ) : ∃ x ∈ K.X, B < D.scalarCurvature x := by |
| 114 | let : T2Space M := @T25Space.t2Space M _ (@T3Space.t25Space M _ inferInstance) |
| 115 | by_contra! hbound |
| 116 | obtain ⟨C, hC, hsub⟩ := exists_compact_bounded_scalar_neck_cover K D hD hfinite |
| 117 | (show 0 < max B 1 from lt_of_lt_of_le zero_lt_one (le_max_right _ _)) |
| 118 | apply hcompact |
| 119 | apply hC.of_isClosed_subset isClosed_closure |
| 120 | apply closure_minimal _ hC.isClosed |
| 121 | intro x hx |
| 122 | exact hsub ⟨hx, (hbound x hx).trans (le_max_left _ _)⟩ |
| 123 | |
| 124 | end PoincareMT.M28 |