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.RadiusSelection |
| 2 | import PoincareLib.Topology.MetricSpace.GromovHausdorff.Pointed.Distance |
| 3 | |
| 4 | /-! |
| 5 | # Restricting local distance ascent to open subsets |
| 6 | |
| 7 | Strict local distance ascent is monotone in the requested rate and unchanged |
| 8 | by restriction to an open subset containing the center and the point. Closed |
| 9 | balls that stay inside a pointed open-ball model retain ambient compactness. |
| 10 | -/ |
| 11 | |
| 12 | noncomputable section |
| 13 | set_option autoImplicit false |
| 14 | set_option backward.isDefEq.respectTransparency false |
| 15 | |
| 16 | open Set |
| 17 | |
| 18 | namespace Poincare.CurvatureIntegral |
| 19 | |
| 20 | variable {X : Type*} [MetricSpace X] |
| 21 | |
| 22 | /-- A strict local ascent rate also supplies every smaller requested rate. -/ |
| 23 | theorem HasLocalDistanceAscent.mono {c c' : ℝ} {p y : X} |
| 24 | (h : HasLocalDistanceAscent c' p y) (hcc' : c ≤ c') : |
| 25 | HasLocalDistanceAscent c p y := by |
| 26 | intro s hs |
| 27 | obtain ⟨z, hz, hgain⟩ := h s hs |
| 28 | exact ⟨z, hz, (mul_le_mul_of_nonneg_right hcc' dist_nonneg).trans_lt hgain⟩ |
| 29 | |
| 30 | /-- Local distance ascent in a subspace gives the same ambient ascent. -/ |
| 31 | theorem HasLocalDistanceAscent.of_subtype {U : Set X} {c : ℝ} {p y : U} |
| 32 | (h : HasLocalDistanceAscent c p y) : |
| 33 | HasLocalDistanceAscent c p.val y.val := by |
| 34 | intro s hs |
| 35 | obtain ⟨z, hz, hgain⟩ := h s hs |
| 36 | exact ⟨z.val, hz, hgain⟩ |
| 37 | |
| 38 | /-- Restriction to an open subset preserves local distance ascent. -/ |
| 39 | theorem hasLocalDistanceAscent_subtype_iff {U : Set X} (hU : IsOpen U) |
| 40 | (c : ℝ) (p y : U) : |
| 41 | HasLocalDistanceAscent c p y ↔ HasLocalDistanceAscent c p.val y.val := by |
| 42 | refine ⟨HasLocalDistanceAscent.of_subtype, ?_⟩ |
| 43 | intro h s hs |
| 44 | obtain ⟨ε, hε, hball⟩ := Metric.isOpen_iff.mp hU y.val y.property |
| 45 | obtain ⟨z, hz, hgain⟩ := h (min s ε) (lt_min hs hε) |
| 46 | have hzU : z ∈ U := hball (by |
| 47 | rw [Metric.mem_ball, dist_comm] |
| 48 | exact hz.trans_le (min_le_right _ _)) |
| 49 | exact ⟨⟨z, hzU⟩, hz.trans_le (min_le_left _ _), hgain⟩ |
| 50 | |
| 51 | /-- A pointed open-ball model has the ambient local distance-ascent condition. -/ |
| 52 | theorem hasLocalDistanceAscent_ballModel_iff |
| 53 | (X : Poincare.GromovHausdorff.BasedMetricSpaceBundle) {L : ℝ} (hL : 0 < L) |
| 54 | (c : ℝ) (p y : (Poincare.GromovHausdorff.ballModel X L hL).carrier) : |
| 55 | HasLocalDistanceAscent c p y ↔ HasLocalDistanceAscent c p.val y.val := |
| 56 | hasLocalDistanceAscent_subtype_iff Metric.isOpen_ball c p y |
| 57 | |
| 58 | end Poincare.CurvatureIntegral |
| 59 | |
| 60 | namespace Poincare.GromovHausdorff |
| 61 | |
| 62 | /-- A closed ball with room inside an open-ball model is compact whenever |
| 63 | the ambient metric space is proper. The open-ball model need not be proper. -/ |
| 64 | theorem isCompact_closedBall_ballModel |
| 65 | (X : BasedMetricSpaceBundle) [ProperSpace X.carrier] |
| 66 | {L : ℝ} (hL : 0 < L) (x : (ballModel X L hL).carrier) {δ : ℝ} |
| 67 | (hroom : dist X.base x.val + δ < L) : |
| 68 | IsCompact (Metric.closedBall x δ) := by |
| 69 | apply Subtype.isCompact_iff.mpr |
| 70 | have himage : (Subtype.val : (ballModel X L hL).carrier → X.carrier) '' |
| 71 | Metric.closedBall x δ = Metric.closedBall x.val δ := by |
| 72 | ext z |
| 73 | constructor |
| 74 | · rintro ⟨w, hw, rfl⟩ |
| 75 | exact hw |
| 76 | · intro hz |
| 77 | have hdist : dist x.val z ≤ δ := by |
| 78 | simpa only [Metric.mem_closedBall, dist_comm] using hz |
| 79 | have hzball : z ∈ Metric.ball X.base L := by |
| 80 | rw [Metric.mem_ball, dist_comm] |
| 81 | exact (dist_triangle X.base x.val z).trans_lt |
| 82 | ((add_le_add le_rfl hdist).trans_lt hroom) |
| 83 | exact ⟨⟨z, hzball⟩, hz, rfl⟩ |
| 84 | rw [himage] |
| 85 | exact isCompact_closedBall x.val δ |
| 86 | |
| 87 | end Poincare.GromovHausdorff |