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.RegularSets.CountableCharts |
| 3 | import PoincareLib.Geometry.RicciFlow.Compactness.GeometricLimit.Overlap.Connectedness |
| 4 | |
| 5 | /-! |
| 6 | # Connectedness from actual regular-component covers |
| 7 | |
| 8 | Compact coordinate cores split a clopen quotient partition into eventually |
| 9 | disjoint source sets. Each tested representative and the base lie in one |
| 10 | actual regular component, so its preconnectedness excludes the partition. |
| 11 | This replaces radial-ball coverage in Morgan--Tian Theorem 5.6, pp. 86-87; |
| 12 | see the regular-set diagonal derivation dated 2026-09-23. |
| 13 | -/ |
| 14 | |
| 15 | set_option autoImplicit false |
| 16 | |
| 17 | open Set Filter Metric |
| 18 | open scoped Topology NNReal Manifold ContDiff |
| 19 | |
| 20 | universe u v |
| 21 | |
| 22 | namespace PoincareMT.ChartDistance |
| 23 | |
| 24 | /-- Finite compact covers of actual regular base components transfer |
| 25 | their connectedness to the distance quotient. Theorem 5.6, pp. 86-87. -/ |
| 26 | theorem quotient_preconnected_of_regular_component_covers |
| 27 | {ι : Type v} {X : ι → Type*} [∀ i, MetricSpace (X i)] |
| 28 | {n : ℕ} {M : ℕ → Type u} [∀ k, MetricSpace (M k)] |
| 29 | [∀ k, ChartedSpace (EuclideanSpace ℝ (Fin n)) (M k)] |
| 30 | [∀ k, IsManifold (𝓡 n) ∞ (M k)] |
| 31 | {e : ∀ k i, X i → M k} {D : ∀ i j, C(X i × X j, ℝ)} |
| 32 | (hD : ∀ i j, TendstoLocallyUniformly |
| 33 | (fun k (p : X i × X j) => dist (e k i p.1) (e k j p.2)) (D i j) atTop) |
| 34 | (O : Poincare.Gluing.OverlapSystem X) |
| 35 | (hrel : ∀ i j (x : X i) (y : X j), O.Rel ⟨i, x⟩ ⟨j, y⟩ ↔ D i j (x, y) = 0) |
| 36 | (L : ι → ℝ≥0) (he : ∀ k i, LipschitzWith (L i) (e k i)) |
| 37 | (g : ∀ k, RiemannianMetric n (M k)) (r : ℕ → ℝ) |
| 38 | {i₀ : ι} (p : X i₀) |
| 39 | (hcover : ∀ j, ∃ s : Finset ι, ∃ K : ∀ i, Set (X i), |
| 40 | (∀ i ∈ s, IsCompact (K i)) ∧ |
| 41 | ∀ᶠ k in atTop, M28.regularComponent (g k) (e k i₀ p) (r j) ⊆ |
| 42 | ⋃ i ∈ s, e k i '' K i) |
| 43 | (hregular : ∀ i (x : X i), ∃ j, |
| 44 | ∀ᶠ k in atTop, e k i x ∈ M28.regularComponent (g k) (e k i₀ p) (r j)) : |
| 45 | PreconnectedSpace (Quotient O.setoid) := by |
| 46 | classical |
| 47 | have hpoint := fun i j x y => |
| 48 | (hD i j).tendstoLocallyUniformlyOn.tendsto_at (mem_univ (x, y)) |
| 49 | have hfull : ∀ S : Set (Quotient O.setoid), IsClopen S → O.include i₀ p ∈ S → S = univ := by |
| 50 | intro S hS hp |
| 51 | apply eq_univ_of_forall |
| 52 | intro q |
| 53 | induction q using Quotient.inductionOn with |
| 54 | | h q => |
| 55 | by_contra hq |
| 56 | obtain ⟨j, hqcomponent⟩ := hregular q.1 q.2 |
| 57 | obtain ⟨s, K, hK, hcov⟩ := hcover j |
| 58 | let A := fun i => K i ∩ O.include i ⁻¹' S |
| 59 | let B := fun i => K i ∩ O.include i ⁻¹' Sᶜ |
| 60 | have hA (i) (hi : i ∈ s) : IsCompact (A i) := |
| 61 | (hK i hi).inter_right (hS.isClosed.preimage (O.include_isOpenEmbedding i).continuous) |
| 62 | have hB (i) (hi : i ∈ s) : IsCompact (B i) := |
| 63 | (hK i hi).inter_right (hS.compl.isClosed.preimage (O.include_isOpenEmbedding i).continuous) |
| 64 | let a := fun k => ⋃ i ∈ s, e k i '' A i |
| 65 | let b := fun k => ⋃ i ∈ s, e k i '' B i |
| 66 | have hdisj : ∀ᶠ k in atTop, Disjoint (a k) (b k) := by |
| 67 | have hh : ∀ i ∈ s, ∀ᶠ k in atTop, ∀ l ∈ s, |
| 68 | Disjoint (e k i '' A i) (e k l '' B l) := by |
| 69 | intro i hi |
| 70 | apply s.eventually_all.mpr |
| 71 | intro l hl |
| 72 | apply eventually_disjoint_source_images hD (hA i hi) (hB l hl) |
| 73 | intro x hx y hy hzero |
| 74 | have heq : O.include i x = O.include l y := |
| 75 | Quotient.sound ((hrel i l x y).mpr hzero) |
| 76 | exact hy.2 (heq ▸ hx.2) |
| 77 | filter_upwards [s.eventually_all.mpr hh] with k hk |
| 78 | simp only [a, b, disjoint_iUnion_left, disjoint_iUnion_right] |
| 79 | exact fun l hl i hi => hk i hi l hl |
| 80 | have hnot (i : ι) (x : X i) (C : ∀ l, Set (X l)) |
| 81 | (hC : ∀ l ∈ s, IsCompact (C l)) |
| 82 | (hzero : ∀ l ∈ s, ∀ y ∈ C l, D i l (x, y) ≠ 0) : |
| 83 | ∀ᶠ k in atTop, e k i x ∉ ⋃ l ∈ s, e k l '' C l := by |
| 84 | apply not_frequently.mp |
| 85 | intro hf |
| 86 | simp only [mem_iUnion, exists_prop] at hf |
| 87 | obtain ⟨l, hl, hfreq⟩ := s.frequently_exists.mp hf |
| 88 | obtain ⟨y, hy, hz⟩ := exists_zero_of_frequently_mem_image hpoint L he (hC l hl) hfreq |
| 89 | exact hzero l hl y hy hz |
| 90 | have hpnot : ∀ᶠ k in atTop, e k i₀ p ∉ b k := by |
| 91 | apply hnot i₀ p B hB |
| 92 | intro l _ y hy hz |
| 93 | have heq : O.include i₀ p = O.include l y := |
| 94 | Quotient.sound ((hrel i₀ l p y).mpr hz) |
| 95 | exact hy.2 (heq ▸ hp) |
| 96 | have hqnot : ∀ᶠ k in atTop, e k q.1 q.2 ∉ a k := by |
| 97 | apply hnot q.1 q.2 A hA |
| 98 | intro l _ y hy hz |
| 99 | have heq : O.include q.1 q.2 = O.include l y := |
| 100 | Quotient.sound ((hrel q.1 l q.2 y).mpr hz) |
| 101 | apply hq |
| 102 | change O.include q.1 q.2 ∈ S |
| 103 | rw [heq] |
| 104 | exact hy.2 |
| 105 | obtain ⟨k, hcovk, hdisjk, hpk, hqk, hqcomponentk⟩ := |
| 106 | (hcov.and (hdisj.and (hpnot.and (hqnot.and hqcomponent)))).exists |
| 107 | have hpcomponent : e k i₀ p ∈ M28.regularComponent (g k) (e k i₀ p) (r j) := |
| 108 | M28.mem_regularComponent (g k) |
| 109 | (connectedComponentIn_nonempty_iff.mp ⟨e k q.1 q.2, hqcomponentk⟩) |
| 110 | have hab : M28.regularComponent (g k) (e k i₀ p) (r j) ⊆ a k ∪ b k := by |
| 111 | intro z hz |
| 112 | obtain ⟨i, hi, x, hx, rfl⟩ := by |
| 113 | simpa only [mem_iUnion, exists_prop, mem_image] using hcovk hz |
| 114 | by_cases hxS : O.include i x ∈ S |
| 115 | · exact Or.inl (mem_iUnion.mpr ⟨i, mem_iUnion.mpr ⟨hi, x, ⟨hx, hxS⟩, rfl⟩⟩) |
| 116 | · exact Or.inr (mem_iUnion.mpr ⟨i, mem_iUnion.mpr ⟨hi, x, ⟨hx, hxS⟩, rfl⟩⟩) |
| 117 | have haClosed : IsClosed (a k) := |
| 118 | (s.finite_toSet.isCompact_biUnion fun i hi => |
| 119 | (hA i hi).image (he k i).continuous).isClosed |
| 120 | have hbClosed : IsClosed (b k) := |
| 121 | (s.finite_toSet.isCompact_biUnion fun i hi => |
| 122 | (hB i hi).image (he k i).continuous).isClosed |
| 123 | rcases isPreconnected_iff_subset_of_disjoint_closed.mp |
| 124 | (M28.isPreconnected_regularComponent (g k) (e k i₀ p) (r j)) |
| 125 | (a k) (b k) haClosed hbClosed hab |
| 126 | (by rw [hdisjk.inter_eq, inter_empty]) with ha | hb |
| 127 | · exact hqk (ha hqcomponentk) |
| 128 | · exact hpk (hb hpcomponent) |
| 129 | apply preconnectedSpace_iff_clopen.mpr |
| 130 | intro S hS |
| 131 | by_cases hp : O.include i₀ p ∈ S |
| 132 | · exact Or.inr (hfull S hS hp) |
| 133 | · left |
| 134 | have h := congrArg compl (hfull Sᶜ hS.compl hp) |
| 135 | simpa only [compl_compl, compl_univ] using h |
| 136 | |
| 137 | end PoincareMT.ChartDistance |
| 138 | |
| 139 | namespace PoincareMT.M28 |
| 140 | |
| 141 | /-- The actual enumerated regular charts instantiate quotient |
| 142 | connectedness after any further strict extraction. The later covering |
| 143 | level is the unpaired stage plus one. Theorem 5.6, printed pp. 86-87. -/ |
| 144 | theorem regularChartQuotient_preconnected |
| 145 | {n : ℕ} {M : ℕ → Type u} [∀ k, MetricSpace (M k)] |
| 146 | [∀ k, ChartedSpace (EuclideanSpace ℝ (Fin n)) (M k)] |
| 147 | [∀ k, IsManifold (𝓡 n) ∞ (M k)] |
| 148 | {g : ∀ k, RiemannianMetric n (M k)} {p : ∀ k, M k} |
| 149 | {δ R ρ : ℕ → ℝ} {N : ℕ → ℕ} |
| 150 | (cover : ∀ k j, j ≤ k → RegularNormalChartCover (g k) (p k) |
| 151 | (δ j) (R j) (ρ j) (N j)) |
| 152 | (hρ : ∀ j, 0 < ρ j) (hρR : ∀ j, ρ j / 2 ≤ R j) |
| 153 | (hstep : ∀ j, 4 * δ (j + 1) ≤ 2 * δ j) |
| 154 | {φ : ℕ → ℕ} (hφ : StrictMono φ) |
| 155 | {D : ∀ _i _j : ℕ, C(ball (0 : EuclideanSpace ℝ (Fin n)) 1 × |
| 156 | ball (0 : EuclideanSpace ℝ (Fin n)) 1, ℝ)} |
| 157 | (hD : ∀ i j, TendstoLocallyUniformly |
| 158 | (fun k (x : ball (0 : EuclideanSpace ℝ (Fin n)) 1 × |
| 159 | ball (0 : EuclideanSpace ℝ (Fin n)) 1) => |
| 160 | dist (regularUnitBallMap cover (φ k) i x.1) |
| 161 | (regularUnitBallMap cover (φ k) j x.2)) (D i j) atTop) |
| 162 | (O : Poincare.Gluing.OverlapSystem |
| 163 | (fun _ : ℕ => ball (0 : EuclideanSpace ℝ (Fin n)) 1)) |
| 164 | (hrel : ∀ i j x y, O.Rel ⟨i, x⟩ ⟨j, y⟩ ↔ D i j (x, y) = 0) |
| 165 | (L : ℕ → ℝ≥0) |
| 166 | (he : ∀ k i, LipschitzWith (L i) (regularUnitBallMap cover (φ k) i)) : |
| 167 | PreconnectedSpace (Quotient O.setoid) := by |
| 168 | apply ChartDistance.quotient_preconnected_of_regular_component_covers hD O hrel L he |
| 169 | (fun k => g (φ k)) (fun j => 4 * δ j) (i₀ := 0) ⟨0, by simp⟩ |
| 170 | · intro j |
| 171 | obtain ⟨S, K, hK, hcover⟩ := regularUnitBallMap_compact_cover cover hρ j |
| 172 | refine ⟨S, K, hK, ?_⟩ |
| 173 | simpa only [regularUnitBallMap_zero] using hφ.tendsto_atTop.eventually hcover |
| 174 | · intro i x |
| 175 | refine ⟨(Nat.unpair i).1 + 1, ?_⟩ |
| 176 | filter_upwards [hφ.tendsto_atTop.eventually |
| 177 | (regularUnitBallMap_eventually_mem_regularComponent cover hρ hρR i)] with k hk |
| 178 | rw [regularUnitBallMap_zero] |
| 179 | exact regularComponent_antitone (g (φ k)) (p (φ k)) (hstep _) (hk x) |
| 180 | |
| 181 | end PoincareMT.M28 |