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.Generalized.BoundedDistance.GeometryImports |
| 2 | import PoincareLib.Geometry.RicciFlow.Generalized.BoundedDistance.PartialLimits.Geometry.LocalNormalCharts |
| 3 | import PoincareLib.Geometry.RicciFlow.Compactness.GeometricLimit.BoundaryCoverage |
| 4 | |
| 5 | /-! |
| 6 | # Intrinsic regular points and their base components |
| 7 | |
| 8 | This is the literal compact-ball definition of Morgan--Tian Definition 5.1 |
| 9 | and the closedness assertion of Lemma 5.2, printed pp. 83-84. Radius loss |
| 10 | and component inclusions are proved for the actual Riemannian distance, |
| 11 | without completeness. See the regular-set partial-compactness derivation |
| 12 | dated 2026-09-23 under tasks/M28/review-endpoints. |
| 13 | -/ |
| 14 | |
| 15 | set_option autoImplicit false |
| 16 | |
| 17 | open Set |
| 18 | open scoped Manifold ContDiff Bundle ENNReal Topology |
| 19 | |
| 20 | universe u |
| 21 | |
| 22 | namespace PoincareMT.M28 |
| 23 | |
| 24 | variable {n : ℕ} {M : Type u} [TopologicalSpace M] |
| 25 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] [IsManifold (𝓡 n) ∞ M] |
| 26 | |
| 27 | /-- Points whose every smaller intrinsic ball has compact closure, exactly |
| 28 | as in Morgan--Tian Definition 5.1, printed p. 83. -/ |
| 29 | def regularPoints (g : RiemannianMetric n M) (δ : ℝ) : Set M := |
| 30 | {p | ∀ r : ℝ, r < δ → IsCompact (closure (g.ball p r))} |
| 31 | |
| 32 | /-- The component of the regular set containing the specified basepoint; |
| 33 | it is empty when the base is not regular. Definition 5.1, printed p. 83. -/ |
| 34 | def regularComponent (g : RiemannianMetric n M) (p : M) (δ : ℝ) : Set M := |
| 35 | connectedComponentIn (regularPoints g δ) p |
| 36 | |
| 37 | /-- Decreasing the regularity radius enlarges the regular set; |
| 38 | Definition 5.1, printed p. 83. -/ |
| 39 | theorem regularPoints_antitone (g : RiemannianMetric n M) : |
| 40 | Antitone (regularPoints g) := by |
| 41 | intro δ ε hδε p hp r hr |
| 42 | exact hp r (hr.trans_le hδε) |
| 43 | |
| 44 | /-- Regular base components are monotone under loss of radius; |
| 45 | Definition 5.1, printed p. 83. -/ |
| 46 | theorem regularComponent_antitone (g : RiemannianMetric n M) (p : M) : |
| 47 | Antitone (regularComponent g p) := by |
| 48 | intro δ ε hδε |
| 49 | exact connectedComponentIn_mono p (regularPoints_antitone g hδε) |
| 50 | |
| 51 | /-- Membership in the base component retains literal regularity; |
| 52 | Definition 5.1, printed p. 83. -/ |
| 53 | theorem regularComponent_subset (g : RiemannianMetric n M) (p : M) (δ : ℝ) : |
| 54 | regularComponent g p δ ⊆ regularPoints g δ := |
| 55 | connectedComponentIn_subset _ _ |
| 56 | |
| 57 | /-- The regular base component contains the base precisely when the base |
| 58 | is regular; Definition 5.1, printed p. 83. -/ |
| 59 | theorem mem_regularComponent (g : RiemannianMetric n M) {p : M} {δ : ℝ} |
| 60 | (hp : p ∈ regularPoints g δ) : p ∈ regularComponent g p δ := |
| 61 | mem_connectedComponentIn hp |
| 62 | |
| 63 | /-- A regular base component is preconnected even when empty; |
| 64 | Definition 5.1, printed p. 83. -/ |
| 65 | theorem isPreconnected_regularComponent (g : RiemannianMetric n M) (p : M) (δ : ℝ) : |
| 66 | IsPreconnected (regularComponent g p δ) := |
| 67 | isPreconnected_connectedComponentIn |
| 68 | |
| 69 | /-- Base regularity makes the actual regular component connected; |
| 70 | Definition 5.1, printed p. 83. -/ |
| 71 | theorem isConnected_regularComponent (g : RiemannianMetric n M) {p : M} {δ : ℝ} |
| 72 | (hp : p ∈ regularPoints g δ) : IsConnected (regularComponent g p δ) := |
| 73 | isConnected_connectedComponentIn_iff.mpr hp |
| 74 | |
| 75 | private theorem ball_eq_empty_of_nonpos (g : RiemannianMetric n M) |
| 76 | (p : M) {r : ℝ} (hr : r ≤ 0) : g.ball p r = ∅ := by |
| 77 | ext x |
| 78 | simp [RiemannianMetric.ball, ENNReal.ofReal_eq_zero.mpr hr] |
| 79 | |
| 80 | /-- Moving the center less than `a` loses at most `a` of regularity. |
| 81 | This is the ball-inclusion mechanism of Lemma 5.2, printed p. 84. -/ |
| 82 | theorem mem_regularPoints_of_mem_ball (g : RiemannianMetric n M) |
| 83 | {p q : M} {δ a : ℝ} (hp : p ∈ regularPoints g δ) (ha : 0 ≤ a) |
| 84 | (hq : q ∈ g.ball p a) : q ∈ regularPoints g (δ - a) := by |
| 85 | intro r hr |
| 86 | by_cases hr0 : r ≤ 0 |
| 87 | · rw [ball_eq_empty_of_nonpos g q hr0, closure_empty] |
| 88 | exact isCompact_empty |
| 89 | · have hrpos : 0 < r := lt_of_not_ge hr0 |
| 90 | have hsub := riemannian_ball_subset_of_margin g ha hrpos.le hq |
| 91 | (le_refl (a + r)) |
| 92 | exact (hp (a + r) (by linarith)).of_isClosed_subset isClosed_closure |
| 93 | (closure_mono hsub) |
| 94 | |
| 95 | /-- A small ball stays in the lower-regularity base component, not merely |
| 96 | in its ambient regular set. Theorem 5.6, printed p. 86. -/ |
| 97 | theorem ball_subset_regularComponent (g : RiemannianMetric n M) |
| 98 | {p q : M} {δ ε a : ℝ} (hq : q ∈ regularComponent g p δ) |
| 99 | (ha : 0 < a) (hmargin : a + ε ≤ δ) : |
| 100 | g.ball q a ⊆ regularComponent g p ε := by |
| 101 | let : Bundle.RiemannianBundle (TangentSpace (𝓡 n) : M → Type _) := |
| 102 | ⟨g.toRiemannianMetric⟩ |
| 103 | have hqε : q ∈ regularComponent g p ε := |
| 104 | regularComponent_antitone g p (by linarith) hq |
| 105 | have hqball : q ∈ g.ball q a := by |
| 106 | change g.edist q q < ENNReal.ofReal a |
| 107 | rw [show g.edist q q = 0 from Manifold.riemannianEDist_self] |
| 108 | exact ENNReal.ofReal_pos.mpr ha |
| 109 | have hreg : g.ball q a ⊆ regularPoints g ε := by |
| 110 | intro x hx |
| 111 | apply regularPoints_antitone g (show ε ≤ δ - a by linarith) |
| 112 | exact mem_regularPoints_of_mem_ball g (regularComponent_subset g p δ hq) ha.le hx |
| 113 | have hsub := (g.isPreconnected_ball q a).subset_connectedComponentIn hqball hreg |
| 114 | have heq := connectedComponentIn_eq hqε |
| 115 | change g.ball q a ⊆ connectedComponentIn (regularPoints g ε) p |
| 116 | rw [heq] |
| 117 | exact hsub |
| 118 | |
| 119 | /-- The regular set is closed in the original manifold topology; |
| 120 | Morgan--Tian Lemma 5.2, printed p. 84. -/ |
| 121 | theorem isClosed_regularPoints [T3Space M] (g : RiemannianMetric n M) (δ : ℝ) : |
| 122 | IsClosed (regularPoints g δ) := by |
| 123 | let : Bundle.RiemannianBundle (TangentSpace (𝓡 n) : M → Type _) := |
| 124 | ⟨g.toRiemannianMetric⟩ |
| 125 | let : IsContinuousRiemannianBundle (EuclideanSpace ℝ (Fin n)) |
| 126 | (TangentSpace (𝓡 n) : M → Type _) := |
| 127 | ⟨⟨g.inner, g.toContinuousRiemannianMetric.continuous, fun _ _ _ => rfl⟩⟩ |
| 128 | let : EMetricSpace M := EMetricSpace.ofRiemannianMetric (𝓡 n) M |
| 129 | have hball (q : M) (s : ℝ) : Metric.eball q (ENNReal.ofReal s) = g.ball q s := by |
| 130 | ext x |
| 131 | change g.edist x q < ENNReal.ofReal s ↔ g.edist q x < ENNReal.ofReal s |
| 132 | rw [show g.edist x q = g.edist q x from Manifold.riemannianEDist_comm] |
| 133 | apply closure_subset_iff_isClosed.mp |
| 134 | intro p hp r hr |
| 135 | by_cases hr0 : r ≤ 0 |
| 136 | · rw [ball_eq_empty_of_nonpos g p hr0, closure_empty] |
| 137 | exact isCompact_empty |
| 138 | · have hrpos : 0 < r := lt_of_not_ge hr0 |
| 139 | let a := (δ - r) / 4 |
| 140 | have ha : 0 < a := by dsimp [a]; linarith |
| 141 | have hopen : IsOpen (g.ball p a) := by rw [← hball]; exact Metric.isOpen_eball |
| 142 | have hmem : p ∈ g.ball p a := by |
| 143 | rw [← hball] |
| 144 | exact Metric.mem_eball_self (ENNReal.ofReal_pos.mpr ha) |
| 145 | obtain ⟨q, hq, hqreg⟩ := mem_closure_iff.mp hp (g.ball p a) hopen hmem |
| 146 | have hpq : p ∈ g.ball q a := by |
| 147 | change g.edist q p < ENNReal.ofReal a |
| 148 | change g.edist p q < ENNReal.ofReal a at hq |
| 149 | simpa only [RiemannianMetric.edist, Manifold.riemannianEDist_comm] using hq |
| 150 | have hsub := riemannian_ball_subset_of_margin g ha.le hrpos.le hpq |
| 151 | (show a + r ≤ r + 2 * a by linarith) |
| 152 | exact (hqreg (r + 2 * a) (by dsimp [a]; linarith)).of_isClosed_subset |
| 153 | isClosed_closure (closure_mono hsub) |
| 154 | |
| 155 | /-- A regular base component is closed, including when the base is not |
| 156 | regular. Definition 5.1 and Lemma 5.2, printed pp. 83-84. -/ |
| 157 | theorem isClosed_regularComponent [T3Space M] (g : RiemannianMetric n M) |
| 158 | (p : M) (δ : ℝ) : IsClosed (regularComponent g p δ) := by |
| 159 | by_cases hp : p ∈ regularPoints g δ |
| 160 | · apply closure_subset_iff_isClosed.mp |
| 161 | exact isPreconnected_connectedComponentIn.closure.subset_connectedComponentIn |
| 162 | (subset_closure (mem_connectedComponentIn hp)) |
| 163 | (closure_minimal (regularComponent_subset g p δ) (isClosed_regularPoints g δ)) |
| 164 | · change IsClosed (connectedComponentIn (regularPoints g δ) p) |
| 165 | rw [connectedComponentIn_eq_empty hp] |
| 166 | exact isClosed_empty |
| 167 | |
| 168 | /-- A closed small ball remains in the lower regular component whenever |
| 169 | the open ball does; Theorem 5.6, printed pp. 85-86. -/ |
| 170 | theorem closure_ball_subset_regularComponent [T3Space M] (g : RiemannianMetric n M) |
| 171 | {p q : M} {δ ε a : ℝ} (hq : q ∈ regularComponent g p δ) |
| 172 | (ha : 0 < a) (hmargin : a + ε ≤ δ) : |
| 173 | closure (g.ball q a) ⊆ regularComponent g p ε := |
| 174 | closure_minimal (ball_subset_regularComponent g hq ha hmargin) |
| 175 | (isClosed_regularComponent g p ε) |
| 176 | |
| 177 | end PoincareMT.M28 |