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.Analysis.Calculus.SmoothCompactness.Eventual |
| 2 | |
| 3 | /-! |
| 4 | # Smooth convergence from an eventual smoothness hypothesis |
| 5 | |
| 6 | Uniform bounds on all coordinate derivatives and a unique pointwise limit |
| 7 | force compact-uniform convergence of every derivative, even when smoothness |
| 8 | is only eventual near each compact subset. |
| 9 | -/ |
| 10 | |
| 11 | set_option autoImplicit false |
| 12 | open Set Filter |
| 13 | open scoped ContDiff Topology |
| 14 | |
| 15 | namespace Poincare.Analysis.Calculus |
| 16 | |
| 17 | /-- Pointwise uniqueness upgrades eventual smooth compactness to convergence |
| 18 | of every jet of the original sequence. -/ |
| 19 | theorem tendstoUniformlyOn_iteratedFDeriv_of_locallyEventuallyContDiff |
| 20 | {X Y : Type*} [NormedAddCommGroup X] [NormedSpace ℝ X] |
| 21 | [FiniteDimensional ℝ X] [NormedAddCommGroup Y] [NormedSpace ℝ Y] |
| 22 | [FiniteDimensional ℝ Y] |
| 23 | {Ω : Set X} (hΩ : IsOpen Ω) {f : ℕ → X → Y} {F : X → Y} |
| 24 | (hpoint : ∀ x ∈ Ω, Tendsto (fun k => f k x) atTop (𝓝 (F x))) |
| 25 | (hsmooth : LocallyEventuallyContDiff Ω f) |
| 26 | (hbound : ∀ K, IsCompact K → K ⊆ Ω → |
| 27 | ∀ m : ℕ, ∃ B : ℝ, ∀ᶠ k in atTop, ∀ x ∈ K, |
| 28 | ‖iteratedFDeriv ℝ m (f k) x‖ ≤ B) |
| 29 | (m : ℕ) {K : Set X} (hK : IsCompact K) (hKΩ : K ⊆ Ω) : |
| 30 | TendstoUniformlyOn (fun k => iteratedFDeriv ℝ m (f k)) |
| 31 | (iteratedFDeriv ℝ m F) atTop K := by |
| 32 | let fs := fun k => UniformFun.ofFun (fun x : K => iteratedFDeriv ℝ m (f k) x) |
| 33 | let Fs := UniformFun.ofFun (fun x : K => iteratedFDeriv ℝ m F x) |
| 34 | have ht : Tendsto fs atTop (𝓝 Fs) := by |
| 35 | apply tendsto_of_subseq_tendsto |
| 36 | intro ns hns |
| 37 | obtain ⟨σ, hσ, G, hG, hjet⟩ := |
| 38 | exists_smoothSubsequenceExtraction_finiteDimensional_of_locallyEventuallyContDiff |
| 39 | hΩ (fun k => f (ns k)) |
| 40 | (fun A hA hAΩ => hns.eventually (hsmooth A hA hAΩ)) |
| 41 | (fun A hA hAΩ l => by |
| 42 | obtain ⟨B, hB⟩ := hbound A hA hAΩ l |
| 43 | exact ⟨B, hns.eventually hB⟩) |
| 44 | have heq : EqOn G F Ω := by |
| 45 | intro x hx |
| 46 | have hz := (ContinuousMultilinearMap.uniformContinuous_eval_const |
| 47 | (0 : Fin 0 → X)).comp_tendstoUniformlyOn |
| 48 | (hjet 0 {x} isCompact_singleton (singleton_subset_iff.mpr hx)) |
| 49 | have hp : Tendsto (fun k => f (ns (σ k)) x) atTop (𝓝 (G x)) := by |
| 50 | simpa only [Function.comp_def, iteratedFDeriv_zero_apply] using |
| 51 | hz.tendsto_at (mem_singleton x) |
| 52 | exact tendsto_nhds_unique hp ((hpoint x hx).comp (hns.comp hσ.tendsto_atTop)) |
| 53 | have hjetEq : EqOn (iteratedFDeriv ℝ m G) (iteratedFDeriv ℝ m F) K := by |
| 54 | intro x hx |
| 55 | have hnear : G =ᶠ[𝓝 x] F := |
| 56 | Filter.eventuallyEq_of_mem (hΩ.mem_nhds (hKΩ hx)) (fun y hy => heq hy) |
| 57 | exact (hnear.iteratedFDeriv ℝ m).self_of_nhds |
| 58 | refine ⟨σ, UniformFun.tendsto_iff_tendstoUniformly.mpr ?_⟩ |
| 59 | exact tendstoUniformlyOn_iff_restrict.mp ((hjet m K hK hKΩ).congr_right hjetEq) |
| 60 | exact tendstoUniformlyOn_iff_restrict.mpr (UniformFun.tendsto_iff_tendstoUniformly.mp ht) |
| 61 | |
| 62 | end Poincare.Analysis.Calculus |