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.Pullback |
| 2 | |
| 3 | /-! |
| 4 | # Subtracting a smooth convergence limit |
| 5 | |
| 6 | Compact-uniform convergence of all derivatives is equivalently expressed as |
| 7 | vanishing of the derivatives of the source-minus-limit difference. |
| 8 | -/ |
| 9 | |
| 10 | set_option autoImplicit false |
| 11 | open Set Filter |
| 12 | open scoped ContDiff Topology |
| 13 | |
| 14 | namespace Poincare.Analysis.Calculus |
| 15 | |
| 16 | theorem smooth_convergence_sub_limit |
| 17 | {E F : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] |
| 18 | [NormedAddCommGroup F] [NormedSpace ℝ F] |
| 19 | {U : Set E} (hU : IsOpen U) {f : ℕ → E → F} {f₀ : E → F} |
| 20 | (hf₀ : ContDiffOn ℝ ∞ f₀ U) |
| 21 | (hlocal : ∀ x ∈ U, ∃ W, IsOpen W ∧ x ∈ W ∧ |
| 22 | ∀ᶠ i in atTop, ContDiffOn ℝ ∞ (f i) W) |
| 23 | (hjet : ∀ m K, IsCompact K → K ⊆ U → TendstoUniformlyOn |
| 24 | (fun i => iteratedFDeriv ℝ m (f i)) (iteratedFDeriv ℝ m f₀) atTop K) : |
| 25 | (∀ x ∈ U, ∃ W, IsOpen W ∧ x ∈ W ∧ |
| 26 | ∀ᶠ i in atTop, ContDiffOn ℝ ∞ (fun y => f i y - f₀ y) W) ∧ |
| 27 | ∀ m K, IsCompact K → K ⊆ U → TendstoUniformlyOn |
| 28 | (fun i => iteratedFDeriv ℝ m (fun y => f i y - f₀ y)) (fun _ => 0) atTop K := by |
| 29 | constructor |
| 30 | · intro x hx |
| 31 | obtain ⟨W, hW, hxW, hi⟩ := hlocal x hx |
| 32 | refine ⟨U ∩ W, hU.inter hW, ⟨hx, hxW⟩, ?_⟩ |
| 33 | exact hi.mono fun i h => (h.mono inter_subset_right).sub (hf₀.mono inter_subset_left) |
| 34 | · intro m K hK hKU |
| 35 | have hc : TendstoUniformlyOn (fun _ : ℕ => iteratedFDeriv ℝ m f₀) |
| 36 | (iteratedFDeriv ℝ m f₀) atTop K := by |
| 37 | apply Metric.tendstoUniformlyOn_iff.mpr |
| 38 | intro ε hε |
| 39 | exact Eventually.of_forall fun _ _ _ => by simpa using hε |
| 40 | have h := (hjet m K hK hKU).sub hc |
| 41 | apply (h.congr ?_).congr_right ?_ |
| 42 | · filter_upwards [eventually_contDiffAt_on_compact hK hKU hlocal] with i hi x hx |
| 43 | exact (iteratedFDeriv_sub_apply |
| 44 | ((hi x hx).of_le (by exact_mod_cast le_top)) |
| 45 | ((hf₀.contDiffAt (hU.mem_nhds (hKU hx))).of_le |
| 46 | (by exact_mod_cast le_top))).symm |
| 47 | · intro x hx |
| 48 | simp |
| 49 | |
| 50 | end Poincare.Analysis.Calculus |