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.StandardCap.Persistence.Analysis.Compactness.CompactSmoothConvergence |
| 2 | import PoincareLib.Analysis.Calculus.SmoothCompactness.DomainChange |
| 3 | |
| 4 | /-! |
| 5 | # Compact smooth convergence under varying coordinate pullback |
| 6 | |
| 7 | These are adapters to the published M07 smooth-compactness operations. |
| 8 | Compact eventual smoothness supplies their local neighborhood premise. |
| 9 | Used for the actual exact-ball adjustment in Morgan--Tian, |
| 10 | Corollary 16.7, p. 372; see derivation 23. |
| 11 | -/ |
| 12 | |
| 13 | set_option autoImplicit false |
| 14 | set_option backward.isDefEq.respectTransparency false |
| 15 | |
| 16 | open Set Filter |
| 17 | open scoped ContDiff Topology |
| 18 | |
| 19 | namespace CompactSmoothConvergenceOn |
| 20 | |
| 21 | variable {E F : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] |
| 22 | [FiniteDimensional ℝ E] [NormedAddCommGroup F] [NormedSpace ℝ F] |
| 23 | |
| 24 | noncomputable local instance : NormedAddCommGroup (E →L[ℝ] E →L[ℝ] ℝ) := |
| 25 | ContinuousLinearMap.toNormedAddCommGroup |
| 26 | |
| 27 | noncomputable local instance : NormedSpace ℝ (E →L[ℝ] E →L[ℝ] ℝ) := |
| 28 | ContinuousLinearMap.toNormedSpace |
| 29 | |
| 30 | /-- Compact eventual smoothness supplies one open neighborhood on |
| 31 | which every sufficiently late map is smooth. -/ |
| 32 | theorem locally_eventually_smooth |
| 33 | {ι : Type*} {l : Filter ι} {fseq : ι → E → F} {f : E → F} {U : Set E} |
| 34 | (h : CompactSmoothConvergenceOn fseq f l U) {x : E} (hx : x ∈ U) : |
| 35 | ∃ W, IsOpen W ∧ x ∈ W ∧ ∀ᶠ i in l, ContDiffOn ℝ ∞ (fseq i) W := by |
| 36 | obtain ⟨K, hK, hxK, hKU⟩ := exists_compact_between isCompact_singleton h.isOpen |
| 37 | (singleton_subset_iff.mpr hx) |
| 38 | refine ⟨interior K, isOpen_interior, hxK (mem_singleton x), ?_⟩ |
| 39 | filter_upwards [h.eventually_smooth K hK hKU] with i hi |
| 40 | exact fun y hy => (hi y (interior_subset hy)).contDiffWithinAt |
| 41 | |
| 42 | /-- Varying smooth coordinate composition preserves compact smooth |
| 43 | convergence, by the published M07 composition theorem. -/ |
| 44 | theorem comp [FiniteDimensional ℝ F] |
| 45 | {fseq : ℕ → E → F} {f : E → F} {gseq : ℕ → E → E} {g : E → E} {U V : Set E} |
| 46 | (hf : CompactSmoothConvergenceOn fseq f atTop U) |
| 47 | (hg : CompactSmoothConvergenceOn gseq g atTop V) (hgU : MapsTo g V U) : |
| 48 | CompactSmoothConvergenceOn (fun n => fseq n ∘ gseq n) (f ∘ g) atTop V := by |
| 49 | obtain ⟨hlocal, hjet⟩ := |
| 50 | Poincare.Analysis.Calculus.smooth_convergence_comp_on_finiteDimensional |
| 51 | hf.isOpen hg.isOpen hf.smooth hg.smooth hgU |
| 52 | (fun _ hx => hf.locally_eventually_smooth hx) |
| 53 | (fun _ hx => hg.locally_eventually_smooth hx) hf.jets hg.jets |
| 54 | refine ⟨hg.isOpen, hf.smooth.comp hg.smooth hgU, ?_, hjet⟩ |
| 55 | intro K hK hKV |
| 56 | exact Poincare.Analysis.Calculus.eventually_contDiffAt_on_compact hK hKV |
| 57 | (fun x hx => let ⟨W, hW, hxW, _, hs⟩ := hlocal x hx; ⟨W, hW, hxW, hs⟩) |
| 58 | |
| 59 | /-- Bilinear coordinate pullbacks preserve all compact finite-jet |
| 60 | limits. Both tangent slots use the derivative of the same actual map. -/ |
| 61 | theorem pullback_bilinear |
| 62 | {Bseq : ℕ → E → E →L[ℝ] E →L[ℝ] ℝ} {B : E → E →L[ℝ] E →L[ℝ] ℝ} |
| 63 | {aseq : ℕ → E → E} {a : E → E} {U V : Set E} |
| 64 | (hB : CompactSmoothConvergenceOn Bseq B atTop U) |
| 65 | (ha : CompactSmoothConvergenceOn aseq a atTop V) (haU : MapsTo a V U) : |
| 66 | CompactSmoothConvergenceOn |
| 67 | (fun n x => (Bseq n (aseq n x)).bilinearComp |
| 68 | (_root_.fderiv ℝ (aseq n) x) (_root_.fderiv ℝ (aseq n) x)) |
| 69 | (fun x => (B (a x)).bilinearComp (_root_.fderiv ℝ a x) (_root_.fderiv ℝ a x)) atTop V := by |
| 70 | obtain ⟨hlocal, hjet⟩ := |
| 71 | Poincare.Analysis.Calculus.smooth_convergence_pullback_bilinear_on_finiteDimensional |
| 72 | hB.isOpen ha.isOpen hB.smooth ha.smooth haU |
| 73 | (fun _ hx => hB.locally_eventually_smooth hx) |
| 74 | (fun _ hx => ha.locally_eventually_smooth hx) hB.jets ha.jets |
| 75 | have hbase : ContDiffOn ℝ ∞ (fun x => B (a x)) V := hB.smooth.comp ha.smooth haU |
| 76 | have hd : ContDiffOn ℝ ∞ (_root_.fderiv ℝ a) V := |
| 77 | ha.smooth.fderiv_of_isOpen ha.isOpen (by simp) |
| 78 | have hsmooth : ContDiffOn ℝ ∞ |
| 79 | (fun x => (B (a x)).bilinearComp (_root_.fderiv ℝ a x) (_root_.fderiv ℝ a x)) V := by |
| 80 | have hf : ContDiff ℝ ∞ (fun L : E →L[ℝ] E →L[ℝ] ℝ => L.flip) := |
| 81 | (ContinuousLinearMap.flipₗᵢ ℝ E E ℝ).contDiff |
| 82 | simpa only [ContinuousLinearMap.bilinearComp, Function.comp_def] using |
| 83 | hf.comp_contDiffOn ((hf.comp_contDiffOn (hbase.clm_comp hd)).clm_comp hd) |
| 84 | refine ⟨ha.isOpen, hsmooth, ?_, hjet⟩ |
| 85 | intro K hK hKV |
| 86 | exact Poincare.Analysis.Calculus.eventually_contDiffAt_on_compact hK hKV |
| 87 | (fun x hx => let ⟨W, hW, hxW, _, hs⟩ := hlocal x hx; ⟨W, hW, hxW, hs⟩) |
| 88 | |
| 89 | end CompactSmoothConvergenceOn |