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.Riemannian.Comparison.Injectivity.Radius.CompactLocal |
| 2 | import PoincareLib.Geometry.Riemannian.Compactness.IntrinsicMetric |
| 3 | |
| 4 | /-! |
| 5 | # Outermost bad-ascent radii and center selection |
| 6 | |
| 7 | The supremum of actual bad-point distances is the least inner radius beyond |
| 8 | which distance has local ascent up to the fixed outer cutoff. Compact local |
| 9 | injectivity bounds keep its positive values away from zero. This permits |
| 10 | factor-two center selection without a continuity assumption on the radius. |
| 11 | |
| 12 | Reference: Petrunin (2009), Section 3.7, author manuscript p. 7. |
| 13 | -/ |
| 14 | |
| 15 | noncomputable section |
| 16 | set_option autoImplicit false |
| 17 | set_option backward.isDefEq.respectTransparency false |
| 18 | |
| 19 | open Set |
| 20 | open scoped Manifold ContDiff |
| 21 | |
| 22 | namespace Poincare.CurvatureIntegral |
| 23 | |
| 24 | variable {X : Type*} [MetricSpace X] |
| 25 | |
| 26 | /-- Strict distance ascent at arbitrarily small scales. -/ |
| 27 | def HasLocalDistanceAscent (c : ℝ) (p y : X) : Prop := |
| 28 | ∀ s : ℝ, 0 < s → ∃ z : X, |
| 29 | dist y z < s ∧ c * dist y z < dist p z - dist p y |
| 30 | |
| 31 | /-- The outermost bad-point distance below a fixed cutoff, with value zero |
| 32 | when every positive distance below that cutoff has local ascent. -/ |
| 33 | def badAscentRadius (c b : ℝ) (p : X) : ℝ := |
| 34 | sSup (insert 0 ((fun y : X => dist p y) '' |
| 35 | {y | 0 < dist p y ∧ dist p y ≤ b ∧ ¬ HasLocalDistanceAscent c p y})) |
| 36 | |
| 37 | private theorem badAscentRadii_bddAbove (c b : ℝ) (p : X) : |
| 38 | BddAbove (insert 0 ((fun y : X => dist p y) '' |
| 39 | {y | 0 < dist p y ∧ dist p y ≤ b ∧ ¬ HasLocalDistanceAscent c p y})) := by |
| 40 | refine ⟨max 0 b, ?_⟩ |
| 41 | rintro r (rfl | ⟨y, hy, rfl⟩) |
| 42 | · exact le_max_left _ _ |
| 43 | · exact hy.2.1.trans (le_max_right _ _) |
| 44 | |
| 45 | theorem badAscentRadius_nonneg (c b : ℝ) (p : X) : |
| 46 | 0 ≤ badAscentRadius c b p := |
| 47 | le_csSup (badAscentRadii_bddAbove c b p) (mem_insert _ _) |
| 48 | |
| 49 | theorem badAscentRadius_le {c b : ℝ} (hb : 0 ≤ b) (p : X) : |
| 50 | badAscentRadius c b p ≤ b := by |
| 51 | apply csSup_le (insert_nonempty _ _) |
| 52 | rintro r (rfl | ⟨y, hy, rfl⟩) |
| 53 | · exact hb |
| 54 | · exact hy.2.1 |
| 55 | |
| 56 | theorem dist_le_badAscentRadius {c b : ℝ} {p y : X} |
| 57 | (hpos : 0 < dist p y) (hcap : dist p y ≤ b) |
| 58 | (hbad : ¬ HasLocalDistanceAscent c p y) : |
| 59 | dist p y ≤ badAscentRadius c b p := |
| 60 | le_csSup (badAscentRadii_bddAbove c b p) |
| 61 | (mem_insert_of_mem _ ⟨y, ⟨hpos, hcap, hbad⟩, rfl⟩) |
| 62 | |
| 63 | /-- Every distance strictly beyond the bad radius and below the cutoff has |
| 64 | the required local ascent. -/ |
| 65 | theorem hasLocalDistanceAscent_of_badAscentRadius_lt {c b : ℝ} {p y : X} |
| 66 | (hinner : badAscentRadius c b p < dist p y) (houter : dist p y ≤ b) : |
| 67 | HasLocalDistanceAscent c p y := by |
| 68 | by_contra hbad |
| 69 | exact (not_le_of_gt hinner) (dist_le_badAscentRadius |
| 70 | ((badAscentRadius_nonneg c b p).trans_lt hinner) houter hbad) |
| 71 | |
| 72 | /-- The supremum is approached by actual bad points. No compactness or |
| 73 | closedness of the bad-point set is needed. -/ |
| 74 | theorem exists_bad_point_of_lt_badAscentRadius {c b r : ℝ} {p : X} |
| 75 | (hr : 0 ≤ r) (hsmall : r < badAscentRadius c b p) : |
| 76 | ∃ y : X, r < dist p y ∧ dist p y ≤ badAscentRadius c b p ∧ |
| 77 | dist p y ≤ b ∧ ¬ HasLocalDistanceAscent c p y := by |
| 78 | obtain ⟨d, hd, hrd⟩ := exists_lt_of_lt_csSup (insert_nonempty _ _) hsmall |
| 79 | rcases hd with rfl | ⟨y, hy, rfl⟩ |
| 80 | · exact False.elim ((not_lt_of_ge hr) hrd) |
| 81 | · exact ⟨y, hrd, dist_le_badAscentRadius hy.1 hy.2.1 hy.2.2, hy.2.1, hy.2.2⟩ |
| 82 | |
| 83 | theorem badAscentRadius_le_of_annular_ascent {c b r : ℝ} {p : X} |
| 84 | (hr : 0 ≤ r) |
| 85 | (hascent : ∀ y : X, r < dist p y → dist p y ≤ b → |
| 86 | HasLocalDistanceAscent c p y) : |
| 87 | badAscentRadius c b p ≤ r := by |
| 88 | apply csSup_le (insert_nonempty _ _) |
| 89 | rintro d (rfl | ⟨y, hy, rfl⟩) |
| 90 | · exact hr |
| 91 | · by_contra! hlt |
| 92 | exact hy.2.2 (hascent y hlt hy.2.1) |
| 93 | |
| 94 | theorem badAscentRadius_eq_zero_iff (c b : ℝ) (p : X) : |
| 95 | badAscentRadius c b p = 0 ↔ |
| 96 | ∀ y : X, 0 < dist p y → dist p y ≤ b → HasLocalDistanceAscent c p y := by |
| 97 | constructor |
| 98 | · intro h y hy hb |
| 99 | apply hasLocalDistanceAscent_of_badAscentRadius_lt _ hb |
| 100 | rwa [h] |
| 101 | · intro h |
| 102 | exact le_antisymm (badAscentRadius_le_of_annular_ascent (le_refl 0) h) |
| 103 | (badAscentRadius_nonneg c b p) |
| 104 | |
| 105 | end Poincare.CurvatureIntegral |
| 106 | |
| 107 | namespace PoincareMT.RiemannianMetric |
| 108 | |
| 109 | open Poincare.CurvatureIntegral |
| 110 | |
| 111 | variable {n : ℕ} {M : Type*} [TopologicalSpace M] [T3Space M] [PreconnectedSpace M] |
| 112 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] [IsManifold (𝓡 n) ∞ M] |
| 113 | |
| 114 | /-- Nonzero bad-ascent radii on a compact set have a common positive lower |
| 115 | bound, obtained from the actual injectivity radii. -/ |
| 116 | theorem exists_pos_le_badAscentRadius_of_pos_on_isCompact |
| 117 | (g : RiemannianMetric n M) (hc : MetricComplete g) {c b : ℝ} |
| 118 | (hc1 : c < 1) {K : Set M} (hK : IsCompact K) : |
| 119 | letI := g.toMetricSpace |
| 120 | ∃ r : ℝ, 0 < r ∧ ∀ p ∈ K, |
| 121 | 0 < badAscentRadius c b p → r ≤ badAscentRadius c b p := by |
| 122 | let := g.toMetricSpace |
| 123 | obtain ⟨r, hr, hbound⟩ := |
| 124 | g.exists_pos_le_truncatedInjectivityRadius_on_isCompact_of_complete hc |
| 125 | (by norm_num : (0 : ℝ) < 1) hK |
| 126 | refine ⟨r, hr, ?_⟩ |
| 127 | intro p hp hapos |
| 128 | obtain ⟨y, hypos, hybound, _, hybad⟩ := |
| 129 | exists_bad_point_of_lt_badAscentRadius (le_refl (0 : ℝ)) hapos |
| 130 | have hrle : r ≤ dist p y := by |
| 131 | by_contra! hlt |
| 132 | apply hybad |
| 133 | exact g.exists_local_distance_ascent_of_lt_truncatedInjectivityRadius hc |
| 134 | (by norm_num : (0 : ℝ) ≤ 1) hc1 p y hypos (hlt.trans_le (hbound p hp)) |
| 135 | exact hrle.trans hybound |
| 136 | |
| 137 | /-- A compact set contains a center whose actual bad-ascent radius does not |
| 138 | exceed a prescribed value and is within a factor two of every other value. -/ |
| 139 | theorem exists_near_min_badAscentRadius_on_isCompact |
| 140 | (g : RiemannianMetric n M) (hc : MetricComplete g) |
| 141 | {c b : ℝ} (hc1 : c < 1) (hb : 0 < b) |
| 142 | {K : Set M} (hK : IsCompact K) {p₀ : M} (hp₀ : p₀ ∈ K) : |
| 143 | letI := g.toMetricSpace |
| 144 | ∃ p ∈ K, badAscentRadius c b p ≤ badAscentRadius c b p₀ ∧ |
| 145 | ∀ q ∈ K, badAscentRadius c b p ≤ 2 * badAscentRadius c b q := by |
| 146 | classical |
| 147 | let := g.toMetricSpace |
| 148 | by_cases hzero : ∃ p ∈ K, badAscentRadius c b p = 0 |
| 149 | · obtain ⟨p, hp, hzero⟩ := hzero |
| 150 | refine ⟨p, hp, ?_, ?_⟩ |
| 151 | · rw [hzero] |
| 152 | exact badAscentRadius_nonneg c b p₀ |
| 153 | · intro q _ |
| 154 | rw [hzero] |
| 155 | positivity [badAscentRadius_nonneg c b q] |
| 156 | obtain ⟨r, hr, hgap⟩ := g.exists_pos_le_badAscentRadius_of_pos_on_isCompact hc hc1 hK |
| 157 | let V := badAscentRadius c b '' K |
| 158 | have hV : V.Nonempty := ⟨_, p₀, hp₀, rfl⟩ |
| 159 | have hVbound : Bornology.IsBounded V := by |
| 160 | apply (Metric.isBounded_Icc (0 : ℝ) b).subset |
| 161 | rintro _ ⟨p, hp, rfl⟩ |
| 162 | exact ⟨badAscentRadius_nonneg c b p, badAscentRadius_le hb.le p⟩ |
| 163 | have hinf : r ≤ sInf V := by |
| 164 | apply le_csInf hV |
| 165 | rintro _ ⟨p, hp, rfl⟩ |
| 166 | apply hgap p hp |
| 167 | exact lt_of_le_of_ne (badAscentRadius_nonneg c b p) |
| 168 | (fun h => hzero ⟨p, hp, h.symm⟩) |
| 169 | have hinfpos : 0 < sInf V := hr.trans_le hinf |
| 170 | obtain ⟨v, ⟨p, hp, rfl⟩, hpnear⟩ := exists_lt_of_csInf_lt hV |
| 171 | (by linarith : sInf V < 2 * sInf V) |
| 172 | have hbound (q : M) (hq : q ∈ K) : badAscentRadius c b p ≤ 2 * badAscentRadius c b q := by |
| 173 | have h := csInf_le hVbound.bddBelow (show badAscentRadius c b q ∈ V from ⟨q, hq, rfl⟩) |
| 174 | linarith |
| 175 | by_cases hpp₀ : badAscentRadius c b p ≤ badAscentRadius c b p₀ |
| 176 | · exact ⟨p, hp, hpp₀, hbound⟩ |
| 177 | · exact ⟨p₀, hp₀, le_rfl, fun q hq => (le_of_not_ge hpp₀).trans (hbound q hq)⟩ |
| 178 | |
| 179 | end PoincareMT.RiemannianMetric |