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 Mathlib.Analysis.SpecificLimits.Basic |
| 2 | import Mathlib.Order.Filter.AtTopBot.CountablyGenerated |
| 3 | import Mathlib.Topology.MetricSpace.Pseudo.Lemmas |
| 4 | import Mathlib.Topology.Sequences |
| 5 | |
| 6 | /-! |
| 7 | # Continuity from one retained approximation pool |
| 8 | |
| 9 | Simultaneous approximation and uniqueness of subsequential limits give |
| 10 | continuity of the selected family. MT2007 Claim 19.1, p. 437, and |
| 11 | Lemma 19.17, pp. 449-450; `2026-09-23-retained-pool-diagonal-continuity.md`. |
| 12 | -/ |
| 13 | |
| 14 | set_option autoImplicit false |
| 15 | |
| 16 | open Filter |
| 17 | open scoped Topology |
| 18 | |
| 19 | universe u v w z |
| 20 | |
| 21 | namespace PoincareMT.M63 |
| 22 | |
| 23 | /-- A selected family is continuous when one fixed pool approximates its |
| 24 | initial data and values, and every pool sequence approaching those initial |
| 25 | data has a subsequence approaching the selected value. -/ |
| 26 | theorem continuous_of_approximating_pool_subsequences |
| 27 | {K : Type u} [TopologicalSpace K] [SequentialSpace K] |
| 28 | {J : Type v} [PseudoMetricSpace J] |
| 29 | {Y : Type w} [PseudoMetricSpace Y] {I : Type z} |
| 30 | (Q : K → J) (hQ : Continuous Q) (p : I → J) (f : I → Y) (G : K → Y) |
| 31 | (happrox : ∀ k, ∃ j : ℕ → I, |
| 32 | Tendsto (fun n => p (j n)) atTop (𝓝 (Q k)) ∧ |
| 33 | Tendsto (fun n => f (j n)) atTop (𝓝 (G k))) |
| 34 | (hsubseq : ∀ k, ∀ j : ℕ → I, |
| 35 | Tendsto (fun n => p (j n)) atTop (𝓝 (Q k)) → |
| 36 | ∃ sigma : ℕ → ℕ, StrictMono sigma ∧ |
| 37 | Tendsto (fun n => f (j (sigma n))) atTop (𝓝 (G k))) : |
| 38 | Continuous G := by |
| 39 | classical |
| 40 | have happ : ∀ k (eps : ℝ), 0 < eps → |
| 41 | ∃ i, dist (p i) (Q k) < eps ∧ dist (f i) (G k) < eps := by |
| 42 | intro k eps heps |
| 43 | obtain ⟨j, hp, hf⟩ := happrox k |
| 44 | obtain ⟨n, hpn, hfn⟩ := |
| 45 | ((Metric.tendsto_nhds.mp hp eps heps).and |
| 46 | (Metric.tendsto_nhds.mp hf eps heps)).exists |
| 47 | exact ⟨j n, hpn, hfn⟩ |
| 48 | apply continuous_iff_seqContinuous.mpr |
| 49 | intro seq k hseq |
| 50 | apply Filter.tendsto_of_subseq_tendsto |
| 51 | intro ns hns |
| 52 | have heps : ∀ n : ℕ, (0 : ℝ) < 1 / ((n : ℝ) + 1) := by |
| 53 | intro n |
| 54 | positivity |
| 55 | choose alpha hap haf using fun n => happ (seq (ns n)) _ (heps n) |
| 56 | have hpd : Tendsto (fun n => dist (p (alpha n)) (Q (seq (ns n)))) |
| 57 | atTop (𝓝 (0 : ℝ)) := |
| 58 | squeeze_zero (fun _ => dist_nonneg) (fun n => (hap n).le) |
| 59 | tendsto_one_div_add_atTop_nhds_zero_nat |
| 60 | have hfd : Tendsto (fun n => dist (f (alpha n)) (G (seq (ns n)))) |
| 61 | atTop (𝓝 (0 : ℝ)) := |
| 62 | squeeze_zero (fun _ => dist_nonneg) (fun n => (haf n).le) |
| 63 | tendsto_one_div_add_atTop_nhds_zero_nat |
| 64 | have hQseq : Tendsto (fun n => Q (seq (ns n))) atTop (𝓝 (Q k)) := |
| 65 | (hQ.tendsto k).comp (hseq.comp hns) |
| 66 | have hpseq : Tendsto (fun n => p (alpha n)) atTop (𝓝 (Q k)) := |
| 67 | hQseq.congr_dist (by simpa only [dist_comm] using hpd) |
| 68 | obtain ⟨sigma, hsigma, hlimit⟩ := hsubseq k alpha hpseq |
| 69 | exact ⟨sigma, hlimit.congr_dist (hfd.comp hsigma.tendsto_atTop)⟩ |
| 70 | |
| 71 | end PoincareMT.M63 |