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.Existence.Analysis.CanonicalGeometry.CapPersistenceBallSupremum |
| 2 | import Mathlib.Analysis.SpecialFunctions.Pow.Real |
| 3 | import Mathlib.Topology.Order.IntermediateValue |
| 4 | |
| 5 | /-! |
| 6 | # Actual scalar-normalized metric radii |
| 7 | |
| 8 | Continuous scalar curvature, compact balls and approximate radial |
| 9 | projection supply a positive radius at which the actual open-ball scalar |
| 10 | supremum equals the inverse radius squared. The intermediate value |
| 11 | argument fills the normalization condition in Morgan-Tian Definition 9.72, |
| 12 | pp. 230-231, as used in Theorem 12.28, pp. 323-324. |
| 13 | -/ |
| 14 | |
| 15 | set_option autoImplicit false |
| 16 | |
| 17 | open Set Metric |
| 18 | |
| 19 | namespace Metric |
| 20 | |
| 21 | /-- A positive scalar value admits an actual normalized open-ball radius. |
| 22 | No global positivity or bound on the scalar function is assumed |
| 23 | (normalized core balls, Definition 9.72, pp. 230-231). -/ |
| 24 | theorem exists_pos_sSup_image_ball_eq_inv_sq_of_approximate_radial_projection |
| 25 | {X : Type*} [PseudoMetricSpace X] [ProperSpace X] (x : X) |
| 26 | (hproject : ∀ R r ε : ℝ, 0 ≤ r → r ≤ R → 0 < ε → |
| 27 | closedBall x R ⊆ thickening (R - r + ε) (closedBall x r)) |
| 28 | {f : X → ℝ} (hf : Continuous f) (hfx : 0 < f x) : |
| 29 | ∃ r : ℝ, 0 < r ∧ r ≤ (Real.sqrt (f x))⁻¹ ∧ |
| 30 | sSup (f '' ball x r) = r⁻¹ ^ 2 := by |
| 31 | let R := (Real.sqrt (f x))⁻¹ |
| 32 | have hR : 0 < R := inv_pos.mpr (Real.sqrt_pos.mpr hfx) |
| 33 | let S := fun r : ℝ => sSup (f '' closedBall x r) |
| 34 | have hc : ContinuousOn S (Ici 0) := |
| 35 | continuousOn_sSup_image_closedBall_of_approximate_radial_projection hproject hf |
| 36 | have hproduct : ContinuousOn (fun r => r ^ 2 * S r) (Icc 0 R) := |
| 37 | (continuousOn_id.pow 2).mul (hc.mono (fun _ h => h.1)) |
| 38 | have hbase : f x ≤ S R := le_csSup |
| 39 | ((isCompact_closedBall x R).bddAbove_image hf.continuousOn) |
| 40 | (mem_image_of_mem f (mem_closedBall_self hR.le)) |
| 41 | have hscale : R ^ 2 * f x = 1 := by |
| 42 | dsimp [R] |
| 43 | rw [inv_pow, Real.sq_sqrt hfx.le, inv_mul_cancel₀ hfx.ne'] |
| 44 | have hupper : 1 ≤ R ^ 2 * S R := by |
| 45 | rw [← hscale] |
| 46 | exact mul_le_mul_of_nonneg_left hbase (sq_nonneg R) |
| 47 | obtain ⟨r, hr, hlevel⟩ := intermediate_value_Icc hR.le hproduct |
| 48 | (show (1 : ℝ) ∈ Icc (0 ^ 2 * S 0) (R ^ 2 * S R) from ⟨by simp, hupper⟩) |
| 49 | have hrpos : 0 < r := by |
| 50 | apply lt_of_le_of_ne hr.1 |
| 51 | intro he |
| 52 | subst r |
| 53 | norm_num at hlevel |
| 54 | refine ⟨r, hrpos, hr.2, ?_⟩ |
| 55 | rw [sSup_image_ball_eq_closedBall_of_approximate_radial_projection hproject hf hrpos] |
| 56 | change S r = r⁻¹ ^ 2 |
| 57 | apply (mul_left_cancel₀ (pow_ne_zero 2 hrpos.ne')) |
| 58 | calc |
| 59 | r ^ 2 * S r = 1 := hlevel |
| 60 | _ = r ^ 2 * r⁻¹ ^ 2 := by field_simp |
| 61 | |
| 62 | end Metric |