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.Compactness.GeometricLimit.Overlap.Gluing |
| 2 | |
| 3 | /-! |
| 4 | # Compact coverage retained from source charts |
| 5 | |
| 6 | Finite covers by compact coordinate pieces pass to the zero-distance |
| 7 | quotient. The chart representing a source point may change with the sequence |
| 8 | index; a finite pigeonhole argument and compactness identify a limiting one. |
| 9 | -/ |
| 10 | |
| 11 | set_option autoImplicit false |
| 12 | open Set Filter Metric |
| 13 | open scoped Topology NNReal |
| 14 | |
| 15 | namespace PoincareMT.ChartDistance |
| 16 | |
| 17 | variable {ι : Type*} {X : ι → Type*} [∀ i, MetricSpace (X i)] |
| 18 | {M : ℕ → Type*} [∀ k, MetricSpace (M k)] |
| 19 | {e : ∀ k i, X i → M k} {D : ∀ i j, X i × X j → ℝ} |
| 20 | (hD : ∀ i j x y, Tendsto (fun k => dist (e k i x) (e k j y)) atTop |
| 21 | (𝓝 (D i j (x, y)))) |
| 22 | (L : ι → ℝ≥0) (he : ∀ k i, LipschitzWith (L i) (e k i)) |
| 23 | |
| 24 | include hD he |
| 25 | |
| 26 | theorem exists_zero_of_frequently_mem_image |
| 27 | {i j : ι} {x : X i} {K : Set (X j)} (hK : IsCompact K) |
| 28 | (himage : ∃ᶠ k in atTop, e k i x ∈ e k j '' K) : |
| 29 | ∃ y ∈ K, D i j (x, y) = 0 := by |
| 30 | obtain ⟨k, y, hy, _⟩ := himage.exists |
| 31 | obtain ⟨σ, hσ, hrep⟩ := subseq_forall_of_frequently |
| 32 | (x := id) (p := fun k => e k i x ∈ e k j '' K) tendsto_id himage |
| 33 | exact exists_zero_of_eventually_mem_image |
| 34 | (M := fun k => M (σ k)) (e := fun k => e (σ k)) |
| 35 | (fun i j x y => (hD i j x y).comp hσ) L (fun k => he (σ k)) hK ⟨y, hy⟩ |
| 36 | (Eventually.of_forall hrep) |
| 37 | |
| 38 | theorem exists_zero_of_eventually_mem_finite_images |
| 39 | (s : Finset ι) (K : ∀ j, Set (X j)) (hK : ∀ j ∈ s, IsCompact (K j)) |
| 40 | {i : ι} {x : X i} |
| 41 | (himage : ∀ᶠ k in atTop, ∃ j ∈ s, e k i x ∈ e k j '' K j) : |
| 42 | ∃ j ∈ s, ∃ y ∈ K j, D i j (x, y) = 0 := by |
| 43 | obtain ⟨j, hjs, hj⟩ := s.frequently_exists.mp himage.frequently |
| 44 | obtain ⟨y, hy, hzero⟩ := exists_zero_of_frequently_mem_image hD L he (hK j hjs) hj |
| 45 | exact ⟨j, hjs, y, hy, hzero⟩ |
| 46 | |
| 47 | theorem compact_cover_of_eventual_source_ball_cover |
| 48 | (O : Poincare.Gluing.OverlapSystem X) |
| 49 | (hrel : ∀ i j (x : X i) (y : X j), O.Rel ⟨i, x⟩ ⟨j, y⟩ ↔ D i j (x, y) = 0) |
| 50 | (s : Finset ι) (K : ∀ j, Set (X j)) (hK : ∀ j ∈ s, IsCompact (K j)) |
| 51 | {i₀ : ι} (p : X i₀) (R : ℝ) |
| 52 | (hcover : ∀ᶠ k in atTop, ball (e k i₀ p) R ⊆ ⋃ j ∈ s, e k j '' K j) : |
| 53 | IsCompact (⋃ j ∈ s, O.include j '' K j) ∧ |
| 54 | ∀ i (x : X i), D i₀ i (p, x) < R → |
| 55 | O.include i x ∈ ⋃ j ∈ s, O.include j '' K j := by |
| 56 | constructor |
| 57 | · exact s.finite_toSet.isCompact_biUnion fun j hj => |
| 58 | (hK j hj).image (O.include_isOpenEmbedding j).continuous |
| 59 | · intro i x hx |
| 60 | have hdist : ∀ᶠ k in atTop, dist (e k i x) (e k i₀ p) < R := by |
| 61 | simpa only [dist_comm] using (hD i₀ i p x).eventually (gt_mem_nhds hx) |
| 62 | have hrep : ∀ᶠ k in atTop, ∃ j ∈ s, e k i x ∈ e k j '' K j := by |
| 63 | filter_upwards [hcover, hdist] with k hk hd |
| 64 | simpa only [mem_iUnion, exists_prop] using hk hd |
| 65 | obtain ⟨j, hjs, y, hy, hzero⟩ := |
| 66 | exists_zero_of_eventually_mem_finite_images hD L he s K hK hrep |
| 67 | have heq : O.include i x = O.include j y := Quotient.sound ((hrel i j x y).mpr hzero) |
| 68 | exact mem_iUnion.mpr ⟨j, mem_iUnion.mpr ⟨hjs, y, hy, heq.symm⟩⟩ |
| 69 | |
| 70 | end PoincareMT.ChartDistance |