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.RegularRadius |
| 2 | |
| 3 | /-! |
| 4 | # Maximal punctured radii |
| 5 | |
| 6 | An open-ball condition holds at the supremum of its admissible radii. |
| 7 | This order calculation supplies the maximal choice in Petrunin (2009), |
| 8 | Section 3.4, author manuscript p. 6. |
| 9 | -/ |
| 10 | |
| 11 | noncomputable section |
| 12 | set_option autoImplicit false |
| 13 | |
| 14 | open Set |
| 15 | |
| 16 | namespace Poincare.CurvatureIntegral |
| 17 | |
| 18 | /-- A predicate valid on some punctured ball has a greatest capped radius |
| 19 | on whose doubled open punctured ball it remains valid. -/ |
| 20 | theorem exists_greatest_punctured_radius |
| 21 | {X : Type*} [MetricSpace X] (p : X) (P : X → Prop) |
| 22 | {R : ℝ} (hR : 0 < R) |
| 23 | (hsmall : ∃ s : ℝ, 0 < s ∧ ∀ y : X, 0 < dist p y → dist p y < s → P y) : |
| 24 | ∃ b : ℝ, 0 < b ∧ 2 * b ≤ R ∧ |
| 25 | (∀ y : X, 0 < dist p y → dist p y < 2 * b → P y) ∧ |
| 26 | ∀ a : ℝ, 0 ≤ a → 2 * a ≤ R → |
| 27 | (∀ y : X, 0 < dist p y → dist p y < 2 * a → P y) → a ≤ b := by |
| 28 | let S : Set ℝ := {a | 0 ≤ a ∧ 2 * a ≤ R ∧ |
| 29 | ∀ y : X, 0 < dist p y → dist p y < 2 * a → P y} |
| 30 | have hzero : 0 ∈ S := by |
| 31 | refine ⟨le_rfl, by linarith, ?_⟩ |
| 32 | intro y hy hy' |
| 33 | linarith |
| 34 | have hbounded : BddAbove S := ⟨R / 2, fun a ha => by linarith [ha.2.1]⟩ |
| 35 | have hnonempty : S.Nonempty := ⟨0, hzero⟩ |
| 36 | have hpos : 0 < sSup S := by |
| 37 | obtain ⟨s, hs, hp⟩ := hsmall |
| 38 | have hr : 0 < min s R / 2 := half_pos (lt_min hs hR) |
| 39 | apply hr.trans_le (le_csSup hbounded ?_) |
| 40 | refine ⟨hr.le, by linarith [min_le_right s R], ?_⟩ |
| 41 | intro y hy hy' |
| 42 | exact hp y hy (by linarith [min_le_left s R]) |
| 43 | refine ⟨sSup S, hpos, ?_, ?_, ?_⟩ |
| 44 | · have hsup : sSup S ≤ R / 2 := csSup_le hnonempty (fun a ha => by linarith [ha.2.1]) |
| 45 | linarith |
| 46 | · intro y hy hy' |
| 47 | obtain ⟨a, ha, hya⟩ := exists_lt_of_lt_csSup hnonempty |
| 48 | (show dist p y / 2 < sSup S by linarith) |
| 49 | exact ha.2.2 y hy (by linarith) |
| 50 | · intro a ha haR hP |
| 51 | exact le_csSup hbounded ⟨ha, haR, hP⟩ |
| 52 | |
| 53 | /-- The constructed punctured ascent radii can be chosen greatest among |
| 54 | all radii with the same cap and ascent rate. -/ |
| 55 | theorem exists_maximal_regular_radius_function |
| 56 | {X : Type*} [MetricSpace X] |
| 57 | (hX : Poincare.Alexandrov.CurvatureGEnegOne X) |
| 58 | (hgeo : ∀ x y : X, ∃ γ : ℝ → X, γ 0 = x ∧ γ 1 = y ∧ |
| 59 | ∀ s ∈ Icc (0 : ℝ) 1, ∀ t ∈ Icc (0 : ℝ) 1, |
| 60 | dist (γ s) (γ t) = |s - t| * dist x y) |
| 61 | (hpacking : ∀ α : ℝ, 0 < α → ∃ N : ℕ, |
| 62 | Poincare.Alexandrov.ComparisonAnglePackingBound X α N) |
| 63 | {c R : ℝ} (hc0 : 0 ≤ c) (hc1 : c < 1) (hR : 0 < R) : |
| 64 | ∃ b : X → ℝ, (∀ p, 0 < b p ∧ 2 * b p ≤ R) ∧ |
| 65 | (∀ p y : X, 0 < dist p y → dist p y < 2 * b p → |
| 66 | ∀ s : ℝ, 0 < s → ∃ z : X, |
| 67 | dist y z < s ∧ c * dist y z < dist p z - dist p y) ∧ |
| 68 | ∀ p : X, ∀ a : ℝ, 0 ≤ a → 2 * a ≤ R → |
| 69 | (∀ y : X, 0 < dist p y → dist p y < 2 * a → |
| 70 | ∀ s : ℝ, 0 < s → ∃ z : X, |
| 71 | dist y z < s ∧ c * dist y z < dist p z - dist p y) → a ≤ b p := by |
| 72 | have hp (p : X) := exists_greatest_punctured_radius p |
| 73 | (fun y => ∀ s : ℝ, 0 < s → ∃ z : X, |
| 74 | dist y z < s ∧ c * dist y z < dist p z - dist p y) hR |
| 75 | (Poincare.Alexandrov.exists_pos_punctured_distance_ascent |
| 76 | hX hgeo hpacking hc0 hc1 p) |
| 77 | choose b hb hcap hascent hmax using hp |
| 78 | exact ⟨b, fun p => ⟨hb p, hcap p⟩, hascent, hmax⟩ |
| 79 | |
| 80 | /-- Maximal regular radii retain the exact finite spire set and finite |
| 81 | punctured cover on every compact set. -/ |
| 82 | theorem exists_maximal_regular_radius_finite_punctured_cover |
| 83 | {X : Type*} [MetricSpace X] |
| 84 | (hX : Poincare.Alexandrov.CurvatureGEnegOne X) |
| 85 | (hgeo : ∀ x y : X, ∃ γ : ℝ → X, γ 0 = x ∧ γ 1 = y ∧ |
| 86 | ∀ s ∈ Icc (0 : ℝ) 1, ∀ t ∈ Icc (0 : ℝ) 1, |
| 87 | dist (γ s) (γ t) = |s - t| * dist x y) |
| 88 | (hpacking : ∀ α : ℝ, 0 < α → ∃ N : ℕ, |
| 89 | Poincare.Alexandrov.ComparisonAnglePackingBound X α N) |
| 90 | {c R : ℝ} (hc0 : 0 ≤ c) (hc1 : c < 1) (hR : 0 < R) |
| 91 | {K : Set X} (hK : IsCompact K) : |
| 92 | ∃ b : X → ℝ, ∃ F S : Finset X, |
| 93 | (∀ p, 0 < b p ∧ 2 * b p ≤ R) ∧ |
| 94 | (∀ p y : X, 0 < dist p y → dist p y < 2 * b p → |
| 95 | ∀ s : ℝ, 0 < s → ∃ z : X, |
| 96 | dist y z < s ∧ c * dist y z < dist p z - dist p y) ∧ |
| 97 | (∀ p : X, ∀ a : ℝ, 0 ≤ a → 2 * a ≤ R → |
| 98 | (∀ y : X, 0 < dist p y → dist p y < 2 * a → |
| 99 | ∀ s : ℝ, 0 < s → ∃ z : X, |
| 100 | dist y z < s ∧ c * dist y z < dist p z - dist p y) → a ≤ b p) ∧ |
| 101 | (S : Set X) = {x | x ∈ K ∧ ∀ y, y ≠ x → b y ≤ dist y x} ∧ |
| 102 | K \ (S : Set X) ⊆ ⋃ y ∈ F, Metric.ball y (b y) \ {y} := by |
| 103 | obtain ⟨b, hb, hascent, hmax⟩ := |
| 104 | exists_maximal_regular_radius_function hX hgeo hpacking hc0 hc1 hR |
| 105 | obtain ⟨F, S, hS, hcover⟩ := exists_finite_punctured_ball_cover hK b (fun p => (hb p).1) |
| 106 | exact ⟨b, F, S, hb, hascent, hmax, hS, hcover⟩ |
| 107 | |
| 108 | end Poincare.CurvatureIntegral |