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 | # Smooth convergence under fixed linear precomposition |
| 5 | |
| 6 | Unlike an invertible coordinate change, precomposition by a projection needs |
| 7 | local smoothness for the exact jet formula. This includes lifting a spatial |
| 8 | coordinate correction to a time-space domain. |
| 9 | -/ |
| 10 | |
| 11 | set_option autoImplicit false |
| 12 | open Set Filter |
| 13 | open scoped ContDiff Topology |
| 14 | |
| 15 | namespace Poincare.Analysis.Calculus |
| 16 | |
| 17 | variable {E F G : Type*} |
| 18 | [NormedAddCommGroup E] [NormedSpace ℝ E] |
| 19 | [NormedAddCommGroup F] [NormedSpace ℝ F] |
| 20 | [NormedAddCommGroup G] [NormedSpace ℝ G] |
| 21 | |
| 22 | theorem iteratedFDeriv_comp_continuousLinearMap_of_contDiffAt |
| 23 | (L : G →L[ℝ] E) {f : E → F} {x : G} |
| 24 | (hf : ContDiffAt ℝ ∞ f (L x)) (m : ℕ) : |
| 25 | iteratedFDeriv ℝ m (f ∘ L) x = |
| 26 | (iteratedFDeriv ℝ m f (L x)).compContinuousLinearMap (fun _ => L) := by |
| 27 | obtain ⟨s, hs, hfs⟩ := hf.contDiffOn (m := (m : ℕ∞ω)) |
| 28 | (by exact_mod_cast le_top) (by simp) |
| 29 | obtain ⟨v, hv, hvo, hxv⟩ := mem_nhds_iff.mp hs |
| 30 | have hpre := hvo.preimage L.continuous |
| 31 | have h := L.iteratedFDerivWithin_comp_right (hfs.mono hv) |
| 32 | hvo.uniqueDiffOn hpre.uniqueDiffOn hxv (le_refl (m : ℕ∞ω)) |
| 33 | simpa only [iteratedFDerivWithin_of_isOpen _ hpre hxv, |
| 34 | iteratedFDerivWithin_of_isOpen _ hvo hxv] using h |
| 35 | |
| 36 | /-- Local eventual bounds for all derivatives restrict along a fixed linear |
| 37 | map. In particular, mixed time-space bounds give spatial bounds at time zero. -/ |
| 38 | theorem locallyEventuallyBoundedDerivatives_comp_continuousLinearMap |
| 39 | {d : ℕ} (L : EuclideanSpace ℝ (Fin d) →L[ℝ] E) |
| 40 | {U : Set E} (hU : IsOpen U) {Ω : Set (EuclideanSpace ℝ (Fin d))} |
| 41 | (hmap : MapsTo L Ω U) {f : ℕ → E → F} |
| 42 | (hf : ∀ k, ContDiffOn ℝ ∞ (f k) U) |
| 43 | (hbound : ∀ K, IsCompact K → K ⊆ U → ∀ m : ℕ, ∃ B : ℝ, |
| 44 | ∀ᶠ k in atTop, ∀ x ∈ K, ‖iteratedFDeriv ℝ m (f k) x‖ ≤ B) : |
| 45 | LocallyEventuallyBoundedDerivatives Ω (fun k => f k ∘ L) := by |
| 46 | intro K hK hKΩ m |
| 47 | obtain ⟨B, hB⟩ := hbound (L '' K) (hK.image L.continuous) |
| 48 | (image_subset_iff.mpr (fun x hx => hmap (hKΩ hx))) m |
| 49 | refine ⟨B * ∏ _ : Fin m, ‖L‖, ?_⟩ |
| 50 | filter_upwards [hB] with k hk x hx |
| 51 | rw [iteratedFDeriv_comp_continuousLinearMap_of_contDiffAt L |
| 52 | ((hf k).contDiffAt (hU.mem_nhds (hmap (hKΩ hx)))) m] |
| 53 | exact ((iteratedFDeriv ℝ m (f k) (L x)).norm_compContinuousLinearMap_le |
| 54 | (fun _ : Fin m => L)).trans |
| 55 | (mul_le_mul_of_nonneg_right (hk (L x) (mem_image_of_mem L hx)) |
| 56 | (Finset.prod_nonneg fun _ _ => norm_nonneg _)) |
| 57 | |
| 58 | theorem smooth_convergence_comp_continuousLinearMap |
| 59 | (L : G →L[ℝ] E) {U : Set E} (hU : IsOpen U) |
| 60 | {f : ℕ → E → F} {f₀ : E → F} (hf₀ : ContDiffOn ℝ ∞ f₀ U) |
| 61 | (hlocal : ∀ x ∈ U, ∃ W, IsOpen W ∧ x ∈ W ∧ |
| 62 | ∀ᶠ k in atTop, ContDiffOn ℝ ∞ (f k) W) |
| 63 | (hjet : ∀ m K, IsCompact K → K ⊆ U → TendstoUniformlyOn |
| 64 | (fun k => iteratedFDeriv ℝ m (f k)) (iteratedFDeriv ℝ m f₀) atTop K) : |
| 65 | (∀ x ∈ L ⁻¹' U, ∃ W, IsOpen W ∧ x ∈ W ∧ |
| 66 | ∀ᶠ k in atTop, ContDiffOn ℝ ∞ (f k ∘ L) W) ∧ |
| 67 | ∀ m K, IsCompact K → K ⊆ L ⁻¹' U → TendstoUniformlyOn |
| 68 | (fun k => iteratedFDeriv ℝ m (f k ∘ L)) |
| 69 | (iteratedFDeriv ℝ m (f₀ ∘ L)) atTop K := by |
| 70 | refine ⟨?_, ?_⟩ |
| 71 | · intro x hx |
| 72 | obtain ⟨W, hW, hxW, hks⟩ := hlocal (L x) hx |
| 73 | exact ⟨L ⁻¹' W, hW.preimage L.continuous, hxW, |
| 74 | hks.mono fun _ hk => hk.comp_continuousLinearMap L⟩ |
| 75 | · intro m K hK hKU |
| 76 | have hI := hK.image L.continuous |
| 77 | have hIU : L '' K ⊆ U := image_subset_iff.mpr hKU |
| 78 | have hcomp := ((hjet m (L '' K) hI hIU).comp L).mono (subset_preimage_image L K) |
| 79 | have h := (ContinuousMultilinearMap.compContinuousLinearMapL |
| 80 | (F := F) (fun _ : Fin m => L)).uniformContinuous.comp_tendstoUniformlyOn hcomp |
| 81 | apply (h.congr ?_).congr_right ?_ |
| 82 | · filter_upwards [eventually_contDiffAt_on_compact hI hIU hlocal] with k hk x hx |
| 83 | exact (iteratedFDeriv_comp_continuousLinearMap_of_contDiffAt L |
| 84 | (hk (L x) (mem_image_of_mem L hx)) m).symm |
| 85 | · intro x hx |
| 86 | exact (iteratedFDeriv_comp_continuousLinearMap_of_contDiffAt L |
| 87 | (hf₀.contDiffAt (hU.mem_nhds (hKU hx))) m).symm |
| 88 | |
| 89 | end Poincare.Analysis.Calculus |