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.SourceTransition |
| 2 | |
| 3 | /-! |
| 4 | # Extraction of local overlaps from source-chart distances |
| 5 | |
| 6 | This constructs the local overlap maps and their closed graphs before any |
| 7 | quotient or ambient limit manifold is supplied. Smoothness and metric |
| 8 | compatibility can subsequently be obtained by extracting source transitions. |
| 9 | -/ |
| 10 | |
| 11 | set_option autoImplicit false |
| 12 | open Set Filter Metric |
| 13 | open scoped Topology NNReal |
| 14 | |
| 15 | namespace PoincareMT.ChartDistance |
| 16 | |
| 17 | theorem exists_overlap_limits |
| 18 | {X : ℕ → Type*} [∀ i, MetricSpace (X i)] [∀ i, Nonempty (X i)] |
| 19 | [∀ i, LocallyCompactSpace (X i)] [∀ i, SigmaCompactSpace (X i)] |
| 20 | {M : ℕ → Type*} [∀ k, MetricSpace (M k)] |
| 21 | (e : ∀ k i, X i → M k) (L : ℕ → ℝ≥0) |
| 22 | (he : ∀ k i, LipschitzWith (L i) (e k i)) |
| 23 | (c : ℕ → ℝ) (hc : ∀ i, 0 < c i) |
| 24 | (hlower : ∀ k i x y, c i * dist x y ≤ dist (e k i x) (e k i y)) |
| 25 | (hopen : ∀ k i, Topology.IsOpenEmbedding (e k i)) |
| 26 | (hconn : ∀ k (p : M k) r, IsPreconnected (ball p r)) |
| 27 | (hb : ∀ i j (x : X i) (y : X j), ∃ B : ℝ, |
| 28 | ∀ k, dist (e k i x) (e k j y) ≤ B) : |
| 29 | ∃ σ : ℕ → ℕ, StrictMono σ ∧ ∃ D : ∀ i j, C(X i × X j, ℝ), |
| 30 | (∀ i j, TendstoLocallyUniformly |
| 31 | (fun k (p : X i × X j) => dist (e (σ k) i p.1) (e (σ k) j p.2)) |
| 32 | (D i j) atTop) ∧ |
| 33 | ∃ τ : ∀ i j, OpenPartialHomeomorph (X i) (X j), |
| 34 | (∀ i j (x : X i) (y : X j), |
| 35 | x ∈ (τ i j).source ∧ τ i j x = y ↔ D i j (x, y) = 0) ∧ |
| 36 | (∀ i, (τ i i).source = univ) ∧ |
| 37 | (∀ i x, τ i i x = x) ∧ |
| 38 | (∀ i j l x, x ∈ (τ i j).source → τ i j x ∈ (τ j l).source → |
| 39 | x ∈ (τ i l).source ∧ τ j l (τ i j x) = τ i l x) ∧ |
| 40 | (∀ i j, IsClosed {p : X i × X j | |
| 41 | p.1 ∈ (τ i j).source ∧ τ i j p.1 = p.2}) ∧ |
| 42 | ∀ i j x, x ∈ (τ i j).source → |
| 43 | Tendsto (fun k => Function.invFun (e (σ k) j) (e (σ k) i x)) |
| 44 | atTop (𝓝 (τ i j x)) := by |
| 45 | obtain ⟨σ, hσ, D, hD⟩ := exists_pairwise_limits e L he hb |
| 46 | have hpoint (i j : ℕ) (x : X i) (y : X j) : |
| 47 | Tendsto (fun k => dist (e (σ k) i x) (e (σ k) j y)) atTop |
| 48 | (𝓝 (D i j (x, y))) := |
| 49 | (hD i j).tendstoLocallyUniformlyOn.tendsto_at (mem_univ (x, y)) |
| 50 | let τ := overlapHomeomorph hpoint L (fun k => he (σ k)) c hc |
| 51 | (fun k => hlower (σ k)) (fun k => hopen (σ k)) (fun k => hconn (σ k)) |
| 52 | refine ⟨σ, hσ, D, hD, τ, ?_, ?_, ?_, ?_, ?_, ?_⟩ |
| 53 | · intro i j x y |
| 54 | exact (zero_iff_transition hpoint c hc (fun k => hlower (σ k))).symm |
| 55 | · intro i |
| 56 | exact overlap_self hpoint i |
| 57 | · intro i x |
| 58 | exact transition_self hpoint c hc (fun k => hlower (σ k)) i x |
| 59 | · intro i j l x hx hy |
| 60 | exact transition_cocycle hpoint c hc (fun k => hlower (σ k)) hx hy |
| 61 | · intro i j |
| 62 | have hset : {p : X i × X j | p.1 ∈ (τ i j).source ∧ τ i j p.1 = p.2} = |
| 63 | {p | D i j p = 0} := by |
| 64 | ext p |
| 65 | exact (zero_iff_transition hpoint c hc (fun k => hlower (σ k))).symm |
| 66 | rw [hset] |
| 67 | exact isClosed_zero (D i j) |
| 68 | · intro i j x hx |
| 69 | exact tendsto_source_transition hpoint L (fun k => he (σ k)) c hc |
| 70 | (fun k => hlower (σ k)) (fun k => hopen (σ k)) (fun k => hconn (σ k)) hx |
| 71 | |
| 72 | end PoincareMT.ChartDistance |