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.Uniqueness.Imports |
| 2 | import PoincareLib.Geometry.RicciFlow.Surgery.StandardCap.Uniqueness.Blowup.Caps.CapCompactness |
| 3 | |
| 4 | /-! |
| 5 | # Exact scalar-curvature radii in the complete cap geometry |
| 6 | |
| 7 | Morgan-Tian Definition 9.72, pp. 230-231, in Theorem 12.28, |
| 8 | pp. 323-324. Properness and approximate radial projection for the actual |
| 9 | Riemannian distance make the scalar supremum continuous in the radius. |
| 10 | The resulting intermediate-value argument retains an upper radius. |
| 11 | -/ |
| 12 | |
| 13 | set_option autoImplicit false |
| 14 | |
| 15 | open Set Metric |
| 16 | open scoped Manifold ContDiff Bundle ENNReal Topology |
| 17 | |
| 18 | universe u |
| 19 | |
| 20 | namespace PoincareMT.M35 |
| 21 | |
| 22 | private theorem continuousOn_closedBall_sup {X : Type*} [MetricSpace X] |
| 23 | [ProperSpace X] (x : X) (f : X → ℝ) (hf : Continuous f) |
| 24 | (hproject : ∀ (R r e : ℝ), 0 ≤ r → r ≤ R → 0 < e → |
| 25 | closedBall x R ⊆ thickening (R - r + e) (closedBall x r)) : |
| 26 | ContinuousOn (fun r => sSup (f '' closedBall x r)) (Ici 0) := by |
| 27 | have hbounded (r : ℝ) : BddAbove (f '' closedBall x r) := |
| 28 | (isCompact_closedBall x r).bddAbove_image hf.continuousOn |
| 29 | have hnonempty (r : ℝ) (hr : 0 ≤ r) : (f '' closedBall x r).Nonempty := |
| 30 | (nonempty_closedBall.mpr hr).image f |
| 31 | intro r hr |
| 32 | apply Metric.continuousWithinAt_iff.mpr |
| 33 | intro e he |
| 34 | obtain ⟨d, hd, hclose⟩ := Metric.uniformContinuousOn_iff.mp |
| 35 | ((isCompact_closedBall x (r + 1)).uniformContinuousOn_of_continuous hf.continuousOn) |
| 36 | (e / 2) (half_pos he) |
| 37 | let a := min 1 (d / 4) |
| 38 | have ha : 0 < a := lt_min (by norm_num) (by positivity) |
| 39 | have ha1 : a ≤ 1 := min_le_left _ _ |
| 40 | have had : a ≤ d / 4 := min_le_right _ _ |
| 41 | refine ⟨a, ha, ?_⟩ |
| 42 | intro s hs hsr |
| 43 | have hsr' : |s - r| < a := by simpa only [Real.dist_eq] using hsr |
| 44 | have hsR : s ≤ r + 1 := by linarith [(abs_lt.mp hsr').2] |
| 45 | have hcompare (R q : ℝ) (hq : 0 ≤ q) (hqR : q ≤ R) |
| 46 | (hR : R ≤ r + 1) (hgap : R - q < a) : |
| 47 | sSup (f '' closedBall x R) ≤ sSup (f '' closedBall x q) + e / 2 := by |
| 48 | apply csSup_le (hnonempty R (hq.trans hqR)) |
| 49 | rintro _ ⟨y, hy, rfl⟩ |
| 50 | obtain ⟨z, hz, hyz⟩ := Metric.mem_thickening_iff.mp |
| 51 | (hproject R q a hq hqR ha hy) |
| 52 | have hyK : y ∈ closedBall x (r + 1) := closedBall_subset_closedBall hR hy |
| 53 | have hzK : z ∈ closedBall x (r + 1) := |
| 54 | closedBall_subset_closedBall (hqR.trans hR) hz |
| 55 | have hyzd : dist y z < d := by linarith |
| 56 | have hfv := hclose y hyK z hzK hyzd |
| 57 | have hvalue : f z ≤ sSup (f '' closedBall x q) := |
| 58 | le_csSup (hbounded q) (mem_image_of_mem f hz) |
| 59 | rw [Real.dist_eq] at hfv |
| 60 | linarith [(abs_lt.mp hfv).2] |
| 61 | have hmono (R q : ℝ) (hq : 0 ≤ q) (hqR : q ≤ R) : |
| 62 | sSup (f '' closedBall x q) ≤ sSup (f '' closedBall x R) := |
| 63 | csSup_le_csSup (hbounded R) (hnonempty q hq) |
| 64 | (image_mono (closedBall_subset_closedBall hqR)) |
| 65 | rw [Real.dist_eq] |
| 66 | apply abs_lt.mpr |
| 67 | rcases le_total s r with h | h |
| 68 | · have hc := hcompare r s hs h (by linarith) (by linarith [(abs_lt.mp hsr').1]) |
| 69 | have hm := hmono r s hs h |
| 70 | constructor <;> linarith |
| 71 | · have hc := hcompare s r hr h hsR (by linarith [(abs_lt.mp hsr').2]) |
| 72 | have hm := hmono s r hr h |
| 73 | constructor <;> linarith |
| 74 | |
| 75 | private theorem closure_ball_eq_of_radial_projection {X : Type*} [MetricSpace X] |
| 76 | (x : X) {r : ℝ} (hr : 0 < r) |
| 77 | (hproject : ∀ (R q e : ℝ), 0 ≤ q → q ≤ R → 0 < e → |
| 78 | closedBall x R ⊆ thickening (R - q + e) (closedBall x q)) : |
| 79 | closure (ball x r) = closedBall x r := by |
| 80 | apply Subset.antisymm closure_ball_subset_closedBall |
| 81 | intro y hy |
| 82 | apply Metric.mem_closure_iff.mpr |
| 83 | intro e he |
| 84 | let a := min (r / 2) (e / 4) |
| 85 | have ha : 0 < a := lt_min (half_pos hr) (by positivity) |
| 86 | have har : a ≤ r / 2 := min_le_left _ _ |
| 87 | have hae : a ≤ e / 4 := min_le_right _ _ |
| 88 | obtain ⟨z, hz, hyz⟩ := Metric.mem_thickening_iff.mp |
| 89 | (hproject r (r - a) a (by linarith) (by linarith) ha hy) |
| 90 | refine ⟨z, ?_, ?_⟩ |
| 91 | · exact lt_of_le_of_lt (mem_closedBall.mp hz) (by linarith) |
| 92 | · simpa only [dist_comm] using (show dist y z < e by linarith) |
| 93 | |
| 94 | variable {M : Type u} [TopologicalSpace M] |
| 95 | [ChartedSpace (EuclideanSpace ℝ (Fin 3)) M] [IsManifold (𝓡 3) ∞ M] |
| 96 | [T3Space M] [ConnectedSpace M] |
| 97 | |
| 98 | /-- Definition 9.72 in Theorem 12.28: in the selected Riemannian |
| 99 | metric, every positive closed ball is the closure of its open ball. -/ |
| 100 | theorem riemannian_closure_ball (g : RiemannianMetric 3 M) (x : M) |
| 101 | {r : ℝ} (hr : 0 < r) : |
| 102 | letI : MetricSpace M := Proofs.M09.selectedMetricSpace g |
| 103 | closure (g.ball x r) = Metric.closedBall x r := by |
| 104 | let : MetricSpace M := Proofs.M09.selectedMetricSpace g |
| 105 | have hball : g.ball x r = Metric.ball x r := by |
| 106 | ext y |
| 107 | change g.edist x y < ENNReal.ofReal r ↔ dist y x < r |
| 108 | rw [← Proofs.M09.selectedMetricSpace_edist g, edist_dist, dist_comm] |
| 109 | exact ENNReal.ofReal_lt_ofReal_iff hr |
| 110 | rw [hball] |
| 111 | exact closure_ball_eq_of_radial_projection x hr |
| 112 | (Proofs.M09.selectedMetricSpace_radial_projection g x) |
| 113 | |
| 114 | /-- Definition 9.72 in Theorem 12.28: the actual scalar supremum |
| 115 | on closed Riemannian balls is continuous for nonnegative radii. -/ |
| 116 | theorem continuousOn_scalar_closedBall_sup (g : RiemannianMetric 3 M) |
| 117 | (D : LeviCivitaData g) (hcomplete : MetricComplete g) |
| 118 | (hR : Continuous D.scalarCurvature) (x : M) : |
| 119 | letI : MetricSpace M := Proofs.M09.selectedMetricSpace g |
| 120 | ContinuousOn (fun r => sSup (D.scalarCurvature '' Metric.closedBall x r)) (Ici 0) := by |
| 121 | let : MetricSpace M := Proofs.M09.selectedMetricSpace g |
| 122 | have : ProperSpace M := Proofs.M09.selectedMetricSpace_proper g hcomplete |
| 123 | exact continuousOn_closedBall_sup x D.scalarCurvature hR |
| 124 | (Proofs.M09.selectedMetricSpace_radial_projection g x) |
| 125 | |
| 126 | /-- Definition 9.72 in Theorem 12.28: the frozen supremum on an |
| 127 | open Riemannian ball equals the scalar supremum on its compact closure. -/ |
| 128 | theorem scalar_ball_sup_eq_closedBall (g : RiemannianMetric 3 M) |
| 129 | (D : LeviCivitaData g) (hcomplete : MetricComplete g) |
| 130 | (hR : Continuous D.scalarCurvature) (x : M) {r : ℝ} (hr : 0 < r) : |
| 131 | letI : MetricSpace M := Proofs.M09.selectedMetricSpace g |
| 132 | scalarCurvatureSupOn g D (g.ball x r) = |
| 133 | sSup (D.scalarCurvature '' Metric.closedBall x r) := by |
| 134 | let : MetricSpace M := Proofs.M09.selectedMetricSpace g |
| 135 | have : ProperSpace M := Proofs.M09.selectedMetricSpace_proper g hcomplete |
| 136 | have hclosure := riemannian_closure_ball g x hr |
| 137 | have hsub : g.ball x r ⊆ Metric.closedBall x r := by |
| 138 | rw [← hclosure] |
| 139 | exact subset_closure |
| 140 | have hclosed : BddAbove (D.scalarCurvature '' Metric.closedBall x r) := |
| 141 | (isCompact_closedBall x r).bddAbove_image hR.continuousOn |
| 142 | have hbounded : BddAbove (D.scalarCurvature '' g.ball x r) := |
| 143 | hclosed.mono (image_mono hsub) |
| 144 | have hx : x ∈ g.ball x r := by |
| 145 | change g.edist x x < ENNReal.ofReal r |
| 146 | rw [← Proofs.M09.selectedMetricSpace_edist g, edist_self] |
| 147 | exact ENNReal.ofReal_pos.mpr hr |
| 148 | have hnonempty : (D.scalarCurvature '' g.ball x r).Nonempty := |
| 149 | (show (g.ball x r).Nonempty from ⟨x, hx⟩).image _ |
| 150 | have hbound : ∀ y ∈ g.ball x r, |
| 151 | D.scalarCurvature y ≤ sSup (D.scalarCurvature '' g.ball x r) := |
| 152 | fun y hy => le_csSup hbounded (mem_image_of_mem _ hy) |
| 153 | have hboundClosure : ∀ y ∈ closure (g.ball x r), |
| 154 | D.scalarCurvature y ≤ sSup (D.scalarCurvature '' g.ball x r) := |
| 155 | closure_minimal hbound (isClosed_le hR continuous_const) |
| 156 | change sSup (range fun z : g.ball x r => D.scalarCurvature z.1) = _ |
| 157 | rw [← image_eq_range] |
| 158 | apply le_antisymm (csSup_le_csSup hclosed hnonempty (image_mono hsub)) |
| 159 | apply csSup_le ((nonempty_closedBall.mpr hr.le).image _) |
| 160 | rintro _ ⟨y, hy, rfl⟩ |
| 161 | exact hboundClosure y (hclosure.symm ▸ hy) |
| 162 | |
| 163 | /-- Definition 9.72 in Theorem 12.28: a scalar-supremum crossing |
| 164 | inside an outer radius gives an exact positive curvature radius no larger |
| 165 | than that radius. Both the ball and its closure use the actual metric. -/ |
| 166 | theorem exists_scalar_curvature_radius_le (g : RiemannianMetric 3 M) |
| 167 | (D : LeviCivitaData g) (hcomplete : MetricComplete g) |
| 168 | (hR : Continuous D.scalarCurvature) (x : M) {b : ℝ} (hb : 0 < b) |
| 169 | (hcross : 1 ≤ b ^ 2 * scalarCurvatureSupOn g D (g.ball x b)) : |
| 170 | ∃ r : ℝ, 0 < r ∧ r ≤ b ∧ |
| 171 | scalarCurvatureSupOn g D (g.ball x r) = r⁻¹ ^ 2 ∧ |
| 172 | IsCompact (closure (g.ball x r)) := by |
| 173 | let : MetricSpace M := Proofs.M09.selectedMetricSpace g |
| 174 | let S (r : ℝ) := sSup (D.scalarCurvature '' Metric.closedBall x r) |
| 175 | have hS : ContinuousOn S (Ici 0) := |
| 176 | continuousOn_scalar_closedBall_sup g D hcomplete hR x |
| 177 | have hF : ContinuousOn (fun r => r ^ 2 * S r) (Icc 0 b) := |
| 178 | (continuousOn_id.pow 2).mul (hS.mono Icc_subset_Ici_self) |
| 179 | have htarget : (1 : ℝ) ∈ Icc ((0 : ℝ) ^ 2 * S 0) (b ^ 2 * S b) := by |
| 180 | constructor |
| 181 | · norm_num |
| 182 | · simpa only [S, ← scalar_ball_sup_eq_closedBall g D hcomplete hR x hb] using hcross |
| 183 | obtain ⟨r, hr, heq⟩ := intermediate_value_Icc hb.le hF htarget |
| 184 | have hrpos : 0 < r := by |
| 185 | apply lt_of_le_of_ne hr.1 |
| 186 | intro h |
| 187 | simp only [← h, zero_pow (by omega : (2 : ℕ) ≠ 0), zero_mul] at heq |
| 188 | norm_num at heq |
| 189 | refine ⟨r, hrpos, hr.2, ?_, Proofs.M09.isCompact_closure_metric_ball g hcomplete x r⟩ |
| 190 | rw [scalar_ball_sup_eq_closedBall g D hcomplete hR x hrpos] |
| 191 | change S r = r⁻¹ ^ 2 |
| 192 | have hmul : r ^ 2 * S r = 1 := heq |
| 193 | apply (mul_left_cancel₀ (pow_ne_zero 2 hrpos.ne')) |
| 194 | rw [hmul, ← mul_pow, mul_inv_cancel₀ hrpos.ne', one_pow] |
| 195 | |
| 196 | end PoincareMT.M35 |