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.EventualUniqueness |
| 2 | import Mathlib.Geometry.Manifold.ContMDiff.Atlas |
| 3 | import Mathlib.Geometry.Manifold.ContMDiff.NormedSpace |
| 4 | import Mathlib.Geometry.Manifold.Instances.Real |
| 5 | |
| 6 | /-! |
| 7 | # Smooth compactness of functions on a manifold |
| 8 | |
| 9 | A countable chart cover provides a common smooth subsequence. Uniqueness of |
| 10 | pointwise limits glues the coordinate limits and then upgrades convergence to |
| 11 | compact-uniform convergence of every jet in every chart. |
| 12 | -/ |
| 13 | |
| 14 | set_option autoImplicit false |
| 15 | set_option backward.isDefEq.respectTransparency false |
| 16 | open Set Filter |
| 17 | open scoped ContDiff Manifold Topology |
| 18 | |
| 19 | namespace Poincare.Manifold |
| 20 | |
| 21 | open Poincare.Analysis.Calculus |
| 22 | |
| 23 | /-- Local eventual smoothness and bounds for all derivatives in charts give |
| 24 | a global smooth subsequential limit, with compact convergence of every jet |
| 25 | in every extended chart. -/ |
| 26 | theorem exists_smooth_subsequence_of_locallyEventuallyBounded_chart_derivatives |
| 27 | {n : ℕ} {M : Type*} [TopologicalSpace M] |
| 28 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] [IsManifold (𝓡 n) ∞ M] |
| 29 | [SecondCountableTopology M] |
| 30 | (f : ℕ → M → ℝ) |
| 31 | (hsmooth : ∀ a : M, LocallyEventuallyContDiff (extChartAt (𝓡 n) a).target |
| 32 | (fun k => f k ∘ (extChartAt (𝓡 n) a).symm)) |
| 33 | (hbound : ∀ a : M, LocallyEventuallyBoundedDerivatives |
| 34 | (extChartAt (𝓡 n) a).target (fun k => f k ∘ (extChartAt (𝓡 n) a).symm)) : |
| 35 | ∃ σ : ℕ → ℕ, StrictMono σ ∧ ∃ b : M → ℝ, |
| 36 | ContMDiff (𝓡 n) 𝓘(ℝ, ℝ) ∞ b ∧ |
| 37 | (∀ x, Tendsto (fun k => f (σ k) x) atTop (𝓝 (b x))) ∧ |
| 38 | ∀ (a : M) (m : ℕ) (K : Set (EuclideanSpace ℝ (Fin n))), |
| 39 | IsCompact K → K ⊆ (extChartAt (𝓡 n) a).target → |
| 40 | TendstoUniformlyOn |
| 41 | (fun k => iteratedFDeriv ℝ m (f (σ k) ∘ (extChartAt (𝓡 n) a).symm)) |
| 42 | (iteratedFDeriv ℝ m (b ∘ (extChartAt (𝓡 n) a).symm)) atTop K := by |
| 43 | classical |
| 44 | rcases isEmpty_or_nonempty M with hM | hM |
| 45 | · exact ⟨id, strictMono_id, fun _ => 0, contMDiff_const, |
| 46 | fun x => isEmptyElim x, fun a => isEmptyElim a⟩ |
| 47 | obtain ⟨S, hS, hcover⟩ := TopologicalSpace.countable_cover_nhds |
| 48 | (fun x : M => extChartAt_source_mem_nhds (I := 𝓡 n) x) |
| 49 | obtain ⟨a, ha⟩ := countable_iff_exists_subset_range.mp hS |
| 50 | have hcover' (x : M) : ∃ i, x ∈ (extChartAt (𝓡 n) (a i)).source := by |
| 51 | have hx : x ∈ ⋃ y ∈ S, (extChartAt (𝓡 n) y).source := hcover.symm ▸ mem_univ x |
| 52 | obtain ⟨y, hy, hxy⟩ := mem_iUnion₂.mp hx |
| 53 | obtain ⟨i, rfl⟩ := ha hy |
| 54 | exact ⟨i, hxy⟩ |
| 55 | let c := fun i : ℕ => extChartAt (𝓡 n) (a i) |
| 56 | obtain ⟨σ, hσ, u, hu, hjet⟩ := |
| 57 | exists_common_smoothSubsequenceExtraction_finiteDimensional_of_locallyEventuallyContDiff |
| 58 | (X := fun _ => EuclideanSpace ℝ (Fin n)) (Y := fun _ => ℝ) |
| 59 | (fun i => isOpen_extChartAt_target (a i)) |
| 60 | (fun i k => f k ∘ (c i).symm) (fun i => hsmooth (a i)) (fun i => hbound (a i)) |
| 61 | have hp (i : ℕ) (z : EuclideanSpace ℝ (Fin n)) (hz : z ∈ (c i).target) : |
| 62 | Tendsto (fun k => f (σ k) ((c i).symm z)) atTop (𝓝 (u i z)) := by |
| 63 | have he := (ContinuousMultilinearMap.uniformContinuous_eval_const |
| 64 | (0 : Fin 0 → EuclideanSpace ℝ (Fin n))).comp_tendstoUniformlyOn |
| 65 | (hjet i 0 {z} isCompact_singleton (singleton_subset_iff.mpr hz)) |
| 66 | simpa only [Function.comp_def, iteratedFDeriv_zero_apply] using |
| 67 | he.tendsto_at (mem_singleton z) |
| 68 | choose j hj using hcover' |
| 69 | let b : M → ℝ := fun x => u (j x) (c (j x) x) |
| 70 | have hbpoint (x : M) : Tendsto (fun k => f (σ k) x) atTop (𝓝 (b x)) := by |
| 71 | have he := hp (j x) (c (j x) x) ((c (j x)).map_source (hj x)) |
| 72 | simpa only [(c (j x)).left_inv (hj x), b] using he |
| 73 | have hbeq (i : ℕ) (x : M) (hx : x ∈ (c i).source) : b x = u i (c i x) := by |
| 74 | have he := hp i (c i x) ((c i).map_source hx) |
| 75 | rw [(c i).left_inv hx] at he |
| 76 | exact tendsto_nhds_unique (hbpoint x) he |
| 77 | have hbsmooth : ContMDiff (𝓡 n) 𝓘(ℝ, ℝ) ∞ b := by |
| 78 | intro x |
| 79 | have hx : x ∈ (c (j x)).source := hj x |
| 80 | have hc : ContMDiffAt (𝓡 n) (𝓡 n) ∞ (c (j x)) x := by |
| 81 | apply (contMDiffOn_extChartAt (I := 𝓡 n) (x := a (j x))).contMDiffAt |
| 82 | simpa only [extChartAt_source] using extChartAt_source_mem_nhds' hx |
| 83 | have huat : ContDiffAt ℝ ∞ (u (j x)) (c (j x) x) := |
| 84 | (hu (j x)).contDiffAt (extChartAt_target_mem_nhds' ((c (j x)).map_source hx)) |
| 85 | apply (huat.contMDiffAt.comp x hc).congr_of_eventuallyEq |
| 86 | filter_upwards [extChartAt_source_mem_nhds' hx] with y hy |
| 87 | exact hbeq (j x) y hy |
| 88 | refine ⟨σ, hσ, b, hbsmooth, hbpoint, ?_⟩ |
| 89 | intro p m K hK hKp |
| 90 | apply tendstoUniformlyOn_iteratedFDeriv_of_locallyEventuallyContDiff |
| 91 | (isOpen_extChartAt_target p) |
| 92 | (fun z _ => hbpoint ((extChartAt (𝓡 n) p).symm z)) |
| 93 | (fun A hA hAp => hσ.tendsto_atTop.eventually (hsmooth p A hA hAp)) |
| 94 | (fun A hA hAp l => ?_) m hK hKp |
| 95 | obtain ⟨B, hB⟩ := hbound p A hA hAp l |
| 96 | exact ⟨B, hσ.tendsto_atTop.eventually hB⟩ |
| 97 | |
| 98 | end Poincare.Manifold |