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.Surgery.Continuation.Construction.Terminal.Event.LimitSource |
| 2 | import PoincareLib.Analysis.Calculus.SmoothCompactness.Pullback |
| 3 | import Mathlib.Analysis.Normed.Module.ContinuousInverse |
| 4 | |
| 5 | /-! |
| 6 | # Compact-uniform jets for terminal metric identifications |
| 7 | |
| 8 | The terminal limit uses a left-neighborhood time filter. Coordinate pullback |
| 9 | convergence follows from the existing sequential smooth-convergence theorem, |
| 10 | since this filter is countably generated. Finite scalar components determine |
| 11 | the jets of the corresponding bilinear coefficient field. |
| 12 | -/ |
| 13 | |
| 14 | noncomputable section |
| 15 | set_option autoImplicit false |
| 16 | set_option backward.isDefEq.respectTransparency false |
| 17 | |
| 18 | open Set Filter |
| 19 | open scoped Manifold ContDiff Topology |
| 20 | |
| 21 | universe u |
| 22 | |
| 23 | namespace Poincare.Analysis.Calculus |
| 24 | |
| 25 | theorem tendstoUniformlyOn_of_finite_linear_evaluations |
| 26 | {ι α β E F : Type*} [Fintype ι] |
| 27 | [NormedAddCommGroup E] [NormedSpace ℝ E] |
| 28 | [NormedAddCommGroup F] [NormedSpace ℝ F] [FiniteDimensional ℝ F] |
| 29 | (e : ι → E →L[ℝ] F) |
| 30 | (hsep : ∀ x y, (∀ i, e i x = e i y) → x = y) |
| 31 | {l : Filter α} {K : Set β} {f : α → β → E} {g : β → E} |
| 32 | (h : ∀ i, TendstoUniformlyOn (fun t x => e i (f t x)) |
| 33 | (fun x => e i (g x)) l K) : TendstoUniformlyOn f g l K := by |
| 34 | let P : E →L[ℝ] (ι → F) := ContinuousLinearMap.pi e |
| 35 | have hP : Function.Injective P := fun x y hxy => |
| 36 | hsep x y (fun i => congrFun hxy i) |
| 37 | obtain ⟨R, hR⟩ := |
| 38 | ContinuousLinearMap.HasLeftInverse.of_injective_of_finiteDimensional hP |
| 39 | have hc : TendstoUniformlyOn (fun t x => P (f t x)) (fun x => P (g x)) l K := by |
| 40 | apply Metric.tendstoUniformlyOn_iff.mpr |
| 41 | intro ε hε |
| 42 | have he : ∀ᶠ t in l, ∀ i, ∀ x ∈ K, dist (e i (g x)) (e i (f t x)) < ε := |
| 43 | eventually_all.mpr fun i => (Metric.tendstoUniformlyOn_iff.mp (h i)) ε hε |
| 44 | filter_upwards [he] with t ht x hx |
| 45 | exact (dist_pi_lt_iff hε).mpr fun i => ht i x hx |
| 46 | have hR' (x : E) : R (P x) = x := hR x |
| 47 | simpa only [Function.comp_def, hR'] using R.uniformContinuous.comp_tendstoUniformlyOn hc |
| 48 | |
| 49 | theorem smooth_convergence_pullback_bilinear_filter |
| 50 | {α : Type*} {l : Filter α} [l.IsCountablyGenerated] |
| 51 | {d : ℕ} {U V : Set (EuclideanSpace ℝ (Fin d))} |
| 52 | (hU : IsOpen U) (hV : IsOpen V) |
| 53 | {B : α → EuclideanSpace ℝ (Fin d) → EuclideanSpace ℝ (Fin d) →L[ℝ] |
| 54 | EuclideanSpace ℝ (Fin d) →L[ℝ] ℝ} |
| 55 | {B₀ : EuclideanSpace ℝ (Fin d) → EuclideanSpace ℝ (Fin d) →L[ℝ] |
| 56 | EuclideanSpace ℝ (Fin d) →L[ℝ] ℝ} |
| 57 | {a : EuclideanSpace ℝ (Fin d) → EuclideanSpace ℝ (Fin d)} |
| 58 | (hB₀ : ContDiffOn ℝ ∞ B₀ U) (ha : ContDiffOn ℝ ∞ a V) |
| 59 | (haU : MapsTo a V U) |
| 60 | (hB : ∀ t, ContDiffOn ℝ ∞ (B t) U) |
| 61 | (hjet : ∀ m K, IsCompact K → K ⊆ U → TendstoUniformlyOn |
| 62 | (fun t => iteratedFDeriv ℝ m (B t)) (iteratedFDeriv ℝ m B₀) l K) |
| 63 | (m : ℕ) (K : Set (EuclideanSpace ℝ (Fin d))) |
| 64 | (hK : IsCompact K) (hKV : K ⊆ V) : |
| 65 | TendstoUniformlyOn |
| 66 | (fun t => iteratedFDeriv ℝ m (fun y => (B t (a y)).bilinearComp |
| 67 | (fderiv ℝ a y) (fderiv ℝ a y))) |
| 68 | (iteratedFDeriv ℝ m (fun y => (B₀ (a y)).bilinearComp |
| 69 | (fderiv ℝ a y) (fderiv ℝ a y))) l K := by |
| 70 | apply tendstoUniformlyOn_of_seq_tendstoUniformlyOn |
| 71 | intro s hs |
| 72 | exact (smooth_convergence_pullback_bilinear_on_open hU hV hB₀ ha haU |
| 73 | (fun x hx => ⟨U, hU, hx, Eventually.of_forall fun k => hB (s k)⟩) |
| 74 | (fun x hx => ⟨V, hV, hx, Eventually.of_forall fun _ => ha⟩) |
| 75 | (fun m C hC hCU => (hjet m C hC hCU).seq_tendstoUniformlyOn s hs) |
| 76 | (fun _ _ _ _ => Metric.tendstoUniformlyOn_iff.mpr fun ε hε => |
| 77 | Eventually.of_forall fun _ _ _ => by simpa using hε)).2 m K hK hKV |
| 78 | |
| 79 | end Poincare.Analysis.Calculus |
| 80 | |
| 81 | namespace PoincareMT |
| 82 | |
| 83 | theorem CompactSingularMetricLimit.tendstoUniformlyOn |
| 84 | {G : GeneralizedRicciFlowData.{u}} {T : ℝ} |
| 85 | {M X : Type u} [TopologicalSpace M] |
| 86 | [ChartedSpace (EuclideanSpace ℝ (Fin 3)) M] [IsManifold (𝓡 3) ∞ M] |
| 87 | [TopologicalSpace X] |
| 88 | [ChartedSpace (EuclideanSpace ℝ (Fin 3)) X] [IsManifold (𝓡 3) ∞ X] |
| 89 | {R : SingularTimeReference G T M} {gT : RiemannianMetric 3 X} {i : X → M} |
| 90 | (h : CompactSingularMetricLimit R gT i) (q : X) (a b : Fin 3) (k : ℕ) |
| 91 | (K : Set (EuclideanSpace ℝ (Fin 3))) (hK : IsCompact K) |
| 92 | (hKt : K ⊆ (extChartAt (𝓡 3) q).target) : |
| 93 | TendstoUniformlyOn |
| 94 | (fun t => iteratedFDeriv ℝ k |
| 95 | (singularTensorCoefficient (singularMetricPullback (R.flow.metric t) i) q a b)) |
| 96 | (iteratedFDeriv ℝ k (singularMetricCoefficient gT q a b)) (𝓝[<] T) K := by |
| 97 | apply Metric.tendstoUniformlyOn_iff.mpr |
| 98 | intro ε hε |
| 99 | obtain ⟨t₀, _, ht₀, hbound⟩ := h q a b k K hK hKt ε hε |
| 100 | filter_upwards [Ioo_mem_nhdsLT ht₀] with t ht x hx |
| 101 | simpa only [dist_eq_norm, norm_sub_rev] using hbound t ht.1 ht.2 x hx |
| 102 | |
| 103 | end PoincareMT |