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.Curvature.Integral.Concentration.WeightedAnnuli |
| 2 | import PoincareLib.Geometry.Curvature.Integral.Concentration.WeightedScalar |
| 3 | import PoincareLib.Geometry.Curvature.Integral.Concentration.WeightedFiniteCover |
| 4 | |
| 5 | /-! |
| 6 | # Weighted scalar concentration in a critical ball |
| 7 | |
| 8 | Actual buffered-annulus estimates force concentration at one critical center. |
| 9 | Both positive and signed scalar mass use the critical ball, while the local |
| 10 | error is integrated on the doubled ball. |
| 11 | |
| 12 | Reference: Petrunin (2009), Theorem 4.2 and Section 4.6, pp. 8 and 12-14. |
| 13 | -/ |
| 14 | |
| 15 | noncomputable section |
| 16 | set_option autoImplicit false |
| 17 | set_option backward.isDefEq.respectTransparency false |
| 18 | open Set Filter MeasureTheory |
| 19 | open scoped Manifold ContDiff Bundle Topology BigOperators |
| 20 | |
| 21 | namespace PoincareMT.LeviCivitaData |
| 22 | |
| 23 | /-- Enlarging only the error domain preserves the uniform normalized scalar |
| 24 | correction. The numerator uses the original geometric domain. -/ |
| 25 | theorem normalized_integral_scalarCurvature_posPart_le_add_of_subset |
| 26 | {n : ℕ} {M : Type*} [TopologicalSpace M] |
| 27 | [MeasurableSpace M] [BorelSpace M] [T3Space M] |
| 28 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] [IsManifold (𝓡 n) ∞ M] |
| 29 | {g : RiemannianMetric n M} (D : LeviCivitaData g) |
| 30 | {s t : Set M} (hs : MeasurableSet s) (hst : s ⊆ t) {K : M → ℝ} |
| 31 | (hK : ∀ x, 0 ≤ K x) |
| 32 | (hsec : ∀ x ∈ s, ∀ v w : TangentSpace (𝓡 n) x, |
| 33 | -K x ≤ D.sectionalCurvature x v w) |
| 34 | (hR : IntegrableOn D.scalarCurvature s g.volumeMeasure) |
| 35 | (hKi : IntegrableOn K t g.volumeMeasure) : |
| 36 | (∫ x in s, max 0 (D.scalarCurvature x) ∂g.volumeMeasure) / |
| 37 | (1 + ∫ x in t, K x ∂g.volumeMeasure) ≤ |
| 38 | (∫ x in s, D.scalarCurvature x ∂g.volumeMeasure) / |
| 39 | (1 + ∫ x in t, K x ∂g.volumeMeasure) + (n : ℝ) ^ 2 := by |
| 40 | have hI : 0 ≤ ∫ x in t, K x ∂g.volumeMeasure := integral_nonneg hK |
| 41 | have hp : 0 < 1 + ∫ x in t, K x ∂g.volumeMeasure := by linarith |
| 42 | have hb := D.integral_scalarCurvature_posPart_le_integral_add_weight hs |
| 43 | (fun x _ => hK x) hsec hR (hKi.mono_set hst) |
| 44 | have hi := setIntegral_mono_set hKi (Filter.Eventually.of_forall hK) |
| 45 | (Filter.Eventually.of_forall hst) |
| 46 | change (∫ x in s, K x ∂g.volumeMeasure) ≤ _ at hi |
| 47 | have hc := mul_le_mul_of_nonneg_left hi (sq_nonneg (n : ℝ)) |
| 48 | apply (div_le_iff₀ hp).mpr |
| 49 | rw [add_mul, div_mul_cancel₀ _ hp.ne'] |
| 50 | nlinarith [sq_nonneg (n : ℝ)] |
| 51 | |
| 52 | end PoincareMT.LeviCivitaData |
| 53 | |
| 54 | namespace PoincareMT |
| 55 | |
| 56 | theorem exists_subseq_critical_ball_weighted_scalar_integral_tendsto_atTop_of_mixed_annuli |
| 57 | {n : ℕ} {M : ℕ → Type*} |
| 58 | [∀ j, TopologicalSpace (M j)] [∀ j, T3Space (M j)] |
| 59 | [∀ j, MeasurableSpace (M j)] [∀ j, BorelSpace (M j)] |
| 60 | [∀ j, ChartedSpace (EuclideanSpace ℝ (Fin n)) (M j)] |
| 61 | [∀ j, IsManifold (𝓡 n) ∞ (M j)] [∀ j, PreconnectedSpace (M j)] |
| 62 | {ι κ : Type*} [Fintype ι] [Fintype κ] |
| 63 | (g : ∀ j, RiemannianMetric n (M j)) (D : ∀ j, LeviCivitaData (g j)) |
| 64 | (p : ∀ j, M j) (o : ∀ j, κ → M j) (s C₀ D₀ : κ → ℝ) |
| 65 | (q : ∀ j, ι → M j) (a : ℕ → ι → ℝ) (r₀ R C : ι → ℝ) |
| 66 | (W : ∀ j, Set (M j)) (K : ∀ j, M j → ℝ) |
| 67 | (hn : 0 < n) {m : ℕ} (hm : 1 ≤ m) |
| 68 | (hcomplete : ∀ j, MetricComplete (g j)) |
| 69 | (hsec : ∀ j x (v w : TangentSpace (𝓡 n) x), |
| 70 | -(K j x) ≤ (D j).sectionalCurvature x v w) |
| 71 | (hW : ∀ j, MeasurableSet (W j)) |
| 72 | (hKi : ∀ j, IntegrableOn (K j) (W j) (g j).volumeMeasure) |
| 73 | (hKn : ∀ j x, 0 ≤ K j x) |
| 74 | (ha : ∀ j i, 0 ≤ a j i) |
| 75 | (hr₀ : ∀ i, 0 < r₀ i) (hR : ∀ i, R i < 19 * r₀ i / 16) |
| 76 | (hC : ∀ i, 0 ≤ C i) (hD₀ : ∀ i, 0 ≤ D₀ i) |
| 77 | (hOrdBuffer : ∀ j i, |
| 78 | {x : M j | ((g j).edist (o j i) x).toReal ∈ Icc (s i / 2) (3 * s i)} ⊆ W j) |
| 79 | (hCritBuffer : ∀ j i, |
| 80 | {x : M j | ((g j).edist (q j i) x).toReal ≤ 3 * r₀ i} ⊆ W j) |
| 81 | (hDoubleBuffer : ∀ j i, (g j).ball (q j i) (8 * a j i) ⊆ W j) |
| 82 | (hevent : ∀ᶠ j in atTop, |
| 83 | ((g j).ball (p j) 1 ⊆ |
| 84 | (⋃ i, {x : M j | ((g j).edist (o j i) x).toReal ∈ |
| 85 | Icc (113 * s i / 96) (19 * s i / 16)}) ∪ |
| 86 | ⋃ i, (g j).ball (q j i) (R i)) ∧ |
| 87 | (∀ i, (∫ x in {x : M j | ((g j).edist (o j i) x).toReal ∈ |
| 88 | Icc (113 * s i / 96) (19 * s i / 16)}, |
| 89 | max 0 ((D j).scalarCurvature x) ∂(g j).volumeMeasure) ≤ C₀ i + D₀ i * |
| 90 | ∫ x in {x : M j | ((g j).edist (o j i) x).toReal ∈ |
| 91 | Icc (s i / 2) (3 * s i)}, K j x ∂(g j).volumeMeasure) ∧ |
| 92 | (∀ i, ∀ r : ℝ, 0 < r → 2 * a j i ≤ r → r ≤ r₀ i → |
| 93 | (∫ x in {x : M j | ((g j).edist (q j i) x).toReal ∈ |
| 94 | Icc (113 * r / 96) (19 * r / 16)}, |
| 95 | max 0 ((D j).scalarCurvature x) ∂(g j).volumeMeasure) ≤ C i * |
| 96 | (r ^ m + ∫ x in {x : M j | ((g j).edist (q j i) x).toReal ∈ |
| 97 | Icc (r / 2) (3 * r)}, K j x ∂(g j).volumeMeasure))) |
| 98 | (hlarge : Tendsto (fun j => |
| 99 | (∫ x in (g j).ball (p j) 1, max 0 ((D j).scalarCurvature x) ∂(g j).volumeMeasure) / |
| 100 | (1 + ∫ x in W j, K j x ∂(g j).volumeMeasure)) atTop atTop) : |
| 101 | ∃ i : ι, ∃ φ : ℕ → ℕ, StrictMono φ ∧ |
| 102 | (∀ j, 0 < a (φ j) i) ∧ |
| 103 | Tendsto (fun j => |
| 104 | (∫ x in (g (φ j)).ball (q (φ j) i) (4 * a (φ j) i), |
| 105 | max 0 ((D (φ j)).scalarCurvature x) ∂(g (φ j)).volumeMeasure) / |
| 106 | (1 + ∫ x in (g (φ j)).ball (q (φ j) i) (8 * a (φ j) i), |
| 107 | K (φ j) x ∂(g (φ j)).volumeMeasure)) atTop atTop ∧ |
| 108 | Tendsto (fun j => |
| 109 | (∫ x in (g (φ j)).ball (q (φ j) i) (4 * a (φ j) i), |
| 110 | (D (φ j)).scalarCurvature x ∂(g (φ j)).volumeMeasure) / |
| 111 | (1 + ∫ x in (g (φ j)).ball (q (φ j) i) (8 * a (φ j) i), |
| 112 | K (φ j) x ∂(g (φ j)).volumeMeasure)) atTop atTop := by |
| 113 | classical |
| 114 | let : ∀ j, ConnectedSpace (M j) := fun j => { toNonempty := ⟨p j⟩ } |
| 115 | let : ∀ j, MetricSpace (M j) := fun j => (g j).toMetricSpace |
| 116 | obtain ⟨L, _, hL⟩ := Poincare.CurvatureIntegral.exists_buffered_annulus_overlap |
| 117 | obtain ⟨J, hJ⟩ := eventually_atTop.mp hevent |
| 118 | let A := (∑ i, C₀ i) + ∑ i, C i * r₀ i ^ m / (1 - (227 / 228 : ℝ) ^ m) |
| 119 | let B := (∑ i, D₀ i) + (L : ℝ) * ∑ i, C i |
| 120 | let μ := fun j => (g (j + J)).volumeMeasure |
| 121 | let U := fun j => (g (j + J)).ball (p (j + J)) 1 |
| 122 | let V := fun j i => (g (j + J)).ball (q (j + J) i) (4 * a (j + J) i) |
| 123 | let E := fun j i => (g (j + J)).ball (q (j + J) i) (8 * a (j + J) i) |
| 124 | let h := fun j x => max 0 ((D (j + J)).scalarCurvature x) |
| 125 | let d := fun j => 1 + ∫ x in W (j + J), K (j + J) x ∂μ j |
| 126 | let w := fun j i => 1 + ∫ x in E j i, K (j + J) x ∂μ j |
| 127 | have hmeas (j : ℕ) (x : M j) (r : ℝ) : MeasurableSet ((g j).ball x r) := by |
| 128 | rw [← (g j).toMetricSpace_ball] |
| 129 | exact Metric.isOpen_ball.measurableSet |
| 130 | have hd (j : ℕ) : 0 < d j := by |
| 131 | have hnK : 0 ≤ ∫ x in W (j + J), K (j + J) x ∂μ j := integral_nonneg (hKn _) |
| 132 | dsimp [d] |
| 133 | linarith |
| 134 | have hw (j : ℕ) (i : ι) : 0 < w j i := by |
| 135 | have hnK : 0 ≤ ∫ x in E j i, K (j + J) x ∂μ j := integral_nonneg (hKn _) |
| 136 | dsimp [w] |
| 137 | linarith |
| 138 | have hwd (j : ℕ) (i : ι) : w j i ≤ d j := by |
| 139 | apply add_le_add_right |
| 140 | exact setIntegral_mono_set (hKi _) (Filter.Eventually.of_forall (hKn _)) |
| 141 | (Filter.Eventually.of_forall (hDoubleBuffer _ i)) |
| 142 | have houtside (j : ℕ) : |
| 143 | (∫ x in U j \ ⋃ i, V j i, h j x ∂μ j) ≤ (|A| + |B|) * d j := by |
| 144 | obtain ⟨hcov, hord, hcrit⟩ := hJ (j + J) (by omega) |
| 145 | have hb := (D (j + J)).integral_scalarCurvature_posPart_outside_iUnion_ball_le_of_weighted_mixed_annuli |
| 146 | hn (hcomplete _) (p _) (o _) s C₀ D₀ (q _) (a _) r₀ R C |
| 147 | (ha _) hr₀ hR hC hm (hW _) (hKi _) (hKn _) hL hD₀ |
| 148 | (hOrdBuffer _) (hCritBuffer _) hcov hord hcrit |
| 149 | change (∫ x in U j \ ⋃ i, V j i, h j x ∂μ j) ≤ |
| 150 | A + B * ∫ x in W (j + J), K (j + J) x ∂μ j at hb |
| 151 | have hI : 0 ≤ ∫ x in W (j + J), K (j + J) x ∂μ j := integral_nonneg (hKn _) |
| 152 | apply hb.trans |
| 153 | dsimp [d] |
| 154 | have hBA := mul_le_mul_of_nonneg_right (le_abs_self B) hI |
| 155 | have hpos := mul_nonneg (abs_nonneg A) hI |
| 156 | nlinarith [le_abs_self A, abs_nonneg B] |
| 157 | have hlarge' : ∀ T : ℝ, ∃ j, T < (∫ x in U j, h j x ∂μ j) / d j := by |
| 158 | intro T |
| 159 | exact ((hlarge.comp (tendsto_add_atTop_nat J)).eventually (eventually_gt_atTop T)).exists |
| 160 | obtain ⟨i, φ, hφ, hdiv⟩ := |
| 161 | Poincare.CurvatureIntegral.exists_subseq_fixed_member_integral_ratio_tendsto_atTop |
| 162 | μ U V h (fun j => hmeas _ _ _) (fun j i => hmeas _ _ _) |
| 163 | (fun _ _ => le_max_left _ _) |
| 164 | (fun j => (g (j + J)).integrableOn_ball_of_continuous (hcomplete _) |
| 165 | (continuous_const.max (D (j + J)).continuous_scalarCurvature) _ _) |
| 166 | (fun j i => (g (j + J)).integrableOn_ball_of_continuous (hcomplete _) |
| 167 | (continuous_const.max (D (j + J)).continuous_scalarCurvature) _ _) |
| 168 | d hd w hw hwd (|A| + |B|) houtside hlarge' |
| 169 | obtain ⟨J', hJ'⟩ := eventually_atTop.mp (hdiv.eventually (eventually_gt_atTop 0)) |
| 170 | let ψ := fun j => φ (j + J') + J |
| 171 | have hψ : StrictMono ψ := fun x y hxy => |
| 172 | Nat.add_lt_add_right (hφ (Nat.add_lt_add_right hxy J')) J |
| 173 | have hpos (j : ℕ) : 0 < a (ψ j) i := by |
| 174 | by_contra hnpos |
| 175 | have haz : a (ψ j) i = 0 := le_antisymm (le_of_not_gt hnpos) (ha _ _) |
| 176 | have hball : V (φ (j + J')) i = ∅ := by |
| 177 | dsimp [V] |
| 178 | change (g (ψ j)).ball (q (ψ j) i) (4 * a (ψ j) i) = ∅ |
| 179 | rw [haz, mul_zero, ← (g (ψ j)).toMetricSpace_ball, Metric.ball_zero] |
| 180 | have ht := hJ' (j + J') (by omega) |
| 181 | rw [hball, setIntegral_empty, zero_div] at ht |
| 182 | exact (lt_irrefl 0) ht |
| 183 | have hposdiv : Tendsto (fun j => |
| 184 | (∫ x in (g (ψ j)).ball (q (ψ j) i) (4 * a (ψ j) i), |
| 185 | max 0 ((D (ψ j)).scalarCurvature x) ∂(g (ψ j)).volumeMeasure) / |
| 186 | (1 + ∫ x in (g (ψ j)).ball (q (ψ j) i) (8 * a (ψ j) i), |
| 187 | K (ψ j) x ∂(g (ψ j)).volumeMeasure)) atTop atTop := |
| 188 | hdiv.comp (tendsto_add_atTop_nat J') |
| 189 | refine ⟨i, ψ, hψ, hpos, hposdiv, ?_⟩ |
| 190 | apply tendsto_atTop.2 |
| 191 | intro T |
| 192 | filter_upwards [(tendsto_atTop.1 hposdiv) (T + (n : ℝ) ^ 2)] with j hj |
| 193 | have hsub : (g (ψ j)).ball (q (ψ j) i) (4 * a (ψ j) i) ⊆ |
| 194 | (g (ψ j)).ball (q (ψ j) i) (8 * a (ψ j) i) := by |
| 195 | rw [← (g (ψ j)).toMetricSpace_ball, ← (g (ψ j)).toMetricSpace_ball] |
| 196 | exact Metric.ball_subset_ball (by nlinarith [ha (ψ j) i]) |
| 197 | have hb := (D (ψ j)).normalized_integral_scalarCurvature_posPart_le_add_of_subset |
| 198 | (hmeas _ _ _) hsub (hKn _) (fun x _ => hsec _ x) |
| 199 | ((g (ψ j)).integrableOn_ball_of_continuous (hcomplete _) |
| 200 | (D (ψ j)).continuous_scalarCurvature _ _) |
| 201 | ((hKi _).mono_set (hDoubleBuffer _ i)) |
| 202 | linarith |
| 203 | |
| 204 | end PoincareMT |
| 205 |