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.Uniqueness.Imports |
| 2 | import PoincareLib.Geometry.Riemannian.Coordinates.Transition.JetBounds |
| 3 | |
| 4 | /-! |
| 5 | # Finite bounds at moving coordinate centers |
| 6 | |
| 7 | The actual cap-end coordinates in Morgan-Tian Theorem 12.28, pp. 323-324, |
| 8 | need derivative estimates at points approaching an open axial endpoint. |
| 9 | These are the pointwise versions of the lower M07 finite-jet operations; |
| 10 | each map is smooth near its own actual evaluation point. |
| 11 | -/ |
| 12 | |
| 13 | set_option autoImplicit false |
| 14 | |
| 15 | open Set Filter |
| 16 | open scoped ContDiff Topology |
| 17 | |
| 18 | namespace PoincareMT.M35 |
| 19 | |
| 20 | variable {ι E F G H : Type*} |
| 21 | [NormedAddCommGroup E] [NormedSpace ℝ E] |
| 22 | [NormedAddCommGroup F] [NormedSpace ℝ F] |
| 23 | [NormedAddCommGroup G] [NormedSpace ℝ G] |
| 24 | [NormedAddCommGroup H] [NormedSpace ℝ H] |
| 25 | |
| 26 | /-- Finite coordinate jets are bounded at the actual member-dependent |
| 27 | points; no common neighborhood or endpoint extension is part of this bound. -/ |
| 28 | def HasUniformJetBoundsAt (n : ℕ) (f : ι → E → F) (p : ι → E) : Prop := |
| 29 | ∀ m ≤ n, ∃ C : ℝ, ∀ i, ‖iteratedFDeriv ℝ m (f i) (p i)‖ ≤ C |
| 30 | |
| 31 | theorem HasUniformJetBoundsAt.mono_order {m n : ℕ} {f : ι → E → F} {p : ι → E} |
| 32 | (h : HasUniformJetBoundsAt n f p) (hmn : m ≤ n) : HasUniformJetBoundsAt m f p := |
| 33 | fun _ hj => h _ (hj.trans hmn) |
| 34 | |
| 35 | theorem HasUniformJetBoundsAt.bound_all {n : ℕ} {f : ι → E → F} {p : ι → E} |
| 36 | (h : HasUniformJetBoundsAt n f p) : |
| 37 | ∃ C : ℝ, 0 ≤ C ∧ ∀ m ≤ n, ∀ i, ‖iteratedFDeriv ℝ m (f i) (p i)‖ ≤ C := by |
| 38 | classical |
| 39 | choose c hc using fun j : Fin (n + 1) => h j.1 (by omega) |
| 40 | let C := ∑ j, max (c j) 0 |
| 41 | refine ⟨C, Finset.sum_nonneg (fun _ _ => le_max_right _ _), ?_⟩ |
| 42 | intro m hm i |
| 43 | let j : Fin (n + 1) := ⟨m, by omega⟩ |
| 44 | exact (hc j i).trans ((le_max_left _ _).trans |
| 45 | (Finset.single_le_sum (fun _ _ => le_max_right _ _) (Finset.mem_univ j))) |
| 46 | |
| 47 | theorem HasUniformJetBoundsAt.congr {n : ℕ} {f g : ι → E → F} {p : ι → E} |
| 48 | (h : HasUniformJetBoundsAt n f p) (heq : ∀ i, f i =ᶠ[𝓝 (p i)] g i) : |
| 49 | HasUniformJetBoundsAt n g p := by |
| 50 | intro m hm |
| 51 | obtain ⟨C, hC⟩ := h m hm |
| 52 | refine ⟨C, fun i => ?_⟩ |
| 53 | rw [← ((heq i).iteratedFDeriv ℝ m).eq_of_nhds] |
| 54 | exact hC i |
| 55 | |
| 56 | theorem HasUniformJetBoundsAt.prodMk {n : ℕ} {f : ι → E → F} {g : ι → E → G} |
| 57 | {p : ι → E} (hf : HasUniformJetBoundsAt n f p) (hg : HasUniformJetBoundsAt n g p) |
| 58 | (hcf : ∀ i, ContDiffAt ℝ ∞ (f i) (p i)) (hcg : ∀ i, ContDiffAt ℝ ∞ (g i) (p i)) : |
| 59 | HasUniformJetBoundsAt n (fun i x => (f i x, g i x)) p := by |
| 60 | intro m hm |
| 61 | obtain ⟨Cf, hCf⟩ := hf m hm |
| 62 | obtain ⟨Cg, hCg⟩ := hg m hm |
| 63 | refine ⟨max Cf Cg, fun i => ?_⟩ |
| 64 | rw [iteratedFDeriv_prodMk (hcf i) (hcg i) |
| 65 | (by exact_mod_cast le_top (a := (m : ℕ∞))), ContinuousMultilinearMap.opNorm_prod] |
| 66 | exact max_le_max (hCf i) (hCg i) |
| 67 | |
| 68 | theorem HasUniformJetBoundsAt.sub {n : ℕ} {f g : ι → E → F} {p : ι → E} |
| 69 | (hf : HasUniformJetBoundsAt n f p) (hg : HasUniformJetBoundsAt n g p) |
| 70 | (hcf : ∀ i, ContDiffAt ℝ ∞ (f i) (p i)) (hcg : ∀ i, ContDiffAt ℝ ∞ (g i) (p i)) : |
| 71 | HasUniformJetBoundsAt n (fun i x => f i x - g i x) p := by |
| 72 | intro m hm |
| 73 | obtain ⟨Cf, hCf⟩ := hf m hm |
| 74 | obtain ⟨Cg, hCg⟩ := hg m hm |
| 75 | refine ⟨Cf + Cg, fun i => ?_⟩ |
| 76 | have hr : (m : ℕ∞ω) ≤ ∞ := by exact_mod_cast le_top (a := (m : ℕ∞)) |
| 77 | rw [fun_iteratedFDeriv_sub_apply ((hcf i).of_le hr) ((hcg i).of_le hr)] |
| 78 | exact (norm_sub_le _ _).trans (add_le_add (hCf i) (hCg i)) |
| 79 | |
| 80 | theorem HasUniformJetBoundsAt.clm {n : ℕ} {f : ι → E → F} {p : ι → E} |
| 81 | (hf : HasUniformJetBoundsAt n f p) (hcf : ∀ i, ContDiffAt ℝ ∞ (f i) (p i)) |
| 82 | (L : F →L[ℝ] G) : HasUniformJetBoundsAt n (fun i x => L (f i x)) p := by |
| 83 | intro m hm |
| 84 | obtain ⟨C, hC⟩ := hf m hm |
| 85 | refine ⟨‖L‖ * C, fun i => ?_⟩ |
| 86 | exact (L.norm_iteratedFDeriv_comp_left (hcf i) |
| 87 | (by exact_mod_cast le_top (a := (m : ℕ∞)))).trans |
| 88 | (mul_le_mul_of_nonneg_left (hC i) (norm_nonneg L)) |
| 89 | |
| 90 | private theorem local_bilinear_jet_bound (B : F →L[ℝ] G →L[ℝ] H) |
| 91 | {f : E → F} {g : E → G} {p : E} (r : ℕ) |
| 92 | (hf : ContDiffAt ℝ ∞ f p) (hg : ContDiffAt ℝ ∞ g p) : |
| 93 | ‖iteratedFDeriv ℝ r (fun y => B (f y) (g y)) p‖ ≤ |
| 94 | ‖B‖ * ∑ j ∈ Finset.range (r + 1), (r.choose j : ℝ) * |
| 95 | ‖iteratedFDeriv ℝ j f p‖ * ‖iteratedFDeriv ℝ (r - j) g p‖ := by |
| 96 | have hr : (r : ℕ∞ω) ≤ ∞ := by exact_mod_cast le_top (a := (r : ℕ∞)) |
| 97 | obtain ⟨Sf, hSf, hfs⟩ := hf.contDiffOn (m := r) hr (by simp) |
| 98 | obtain ⟨Sg, hSg, hgs⟩ := hg.contDiffOn (m := r) hr (by simp) |
| 99 | obtain ⟨U, hUsub, hU, hpU⟩ := mem_nhds_iff.mp (inter_mem hSf hSg) |
| 100 | have h := B.norm_iteratedFDerivWithin_le_of_bilinear |
| 101 | (hfs.mono (hUsub.trans inter_subset_left)) |
| 102 | (hgs.mono (hUsub.trans inter_subset_right)) hU.uniqueDiffOn hpU (le_refl (r : ℕ∞ω)) |
| 103 | simpa only [iteratedFDerivWithin_of_isOpen _ hU hpU] using h |
| 104 | |
| 105 | theorem HasUniformJetBoundsAt.bilinear {n : ℕ} {f : ι → E → F} {g : ι → E → G} |
| 106 | {p : ι → E} (hf : HasUniformJetBoundsAt n f p) (hg : HasUniformJetBoundsAt n g p) |
| 107 | (hcf : ∀ i, ContDiffAt ℝ ∞ (f i) (p i)) (hcg : ∀ i, ContDiffAt ℝ ∞ (g i) (p i)) |
| 108 | (B : F →L[ℝ] G →L[ℝ] H) : |
| 109 | HasUniformJetBoundsAt n (fun i x => B (f i x) (g i x)) p := by |
| 110 | obtain ⟨Cf, hCf, hfbound⟩ := hf.bound_all |
| 111 | obtain ⟨Cg, hCg, hgbound⟩ := hg.bound_all |
| 112 | intro m hm |
| 113 | refine ⟨‖B‖ * ∑ j ∈ Finset.range (m + 1), (m.choose j : ℝ) * Cf * Cg, fun i => ?_⟩ |
| 114 | apply (local_bilinear_jet_bound B m (hcf i) (hcg i)).trans |
| 115 | apply mul_le_mul_of_nonneg_left _ (norm_nonneg B) |
| 116 | apply Finset.sum_le_sum |
| 117 | intro j hj |
| 118 | have hjm : j ≤ m := Nat.le_of_lt_succ (Finset.mem_range.mp hj) |
| 119 | exact mul_le_mul (mul_le_mul_of_nonneg_left (hfbound j (hjm.trans hm) i) |
| 120 | (Nat.cast_nonneg _)) (hgbound (m - j) ((Nat.sub_le _ _).trans hm) i) |
| 121 | (norm_nonneg _) (mul_nonneg (Nat.cast_nonneg _) hCf) |
| 122 | |
| 123 | theorem HasUniformJetBoundsAt.clm_comp {n : ℕ} |
| 124 | {f : ι → E → G →L[ℝ] H} {g : ι → E → F →L[ℝ] G} {p : ι → E} |
| 125 | (hf : HasUniformJetBoundsAt n f p) (hg : HasUniformJetBoundsAt n g p) |
| 126 | (hcf : ∀ i, ContDiffAt ℝ ∞ (f i) (p i)) (hcg : ∀ i, ContDiffAt ℝ ∞ (g i) (p i)) : |
| 127 | HasUniformJetBoundsAt n (fun i x => (f i x).comp (g i x)) p := |
| 128 | hf.bilinear hg hcf hcg (ContinuousLinearMap.compL ℝ F G H) |
| 129 | |
| 130 | theorem HasUniformJetBoundsAt.comp {n : ℕ} {f : ι → E → F} {g : ι → F → G} |
| 131 | {p : ι → E} (hf : HasUniformJetBoundsAt n f p) |
| 132 | (hg : HasUniformJetBoundsAt n g (fun i => f i (p i))) |
| 133 | (hcf : ∀ i, ContDiffAt ℝ ∞ (f i) (p i)) |
| 134 | (hcg : ∀ i, ContDiffAt ℝ ∞ (g i) (f i (p i))) : |
| 135 | HasUniformJetBoundsAt n (fun i => g i ∘ f i) p := by |
| 136 | obtain ⟨Cf, _, hfbound⟩ := hf.bound_all |
| 137 | obtain ⟨Cg, _, hgbound⟩ := hg.bound_all |
| 138 | intro m hm |
| 139 | refine ⟨Nat.factorial m * Cg * (max Cf 1) ^ m, fun i => ?_⟩ |
| 140 | have hr : (m : ℕ∞ω) ≤ ∞ := by exact_mod_cast le_top (a := (m : ℕ∞)) |
| 141 | apply CoordinateTransition.norm_iteratedFDeriv_comp_le_of_contDiffAt |
| 142 | ((hcg i).of_le hr) ((hcf i).of_le hr) |
| 143 | (fun j hj => hgbound j (hj.trans hm) i) |
| 144 | intro j hj hjm |
| 145 | exact (hfbound j (hjm.trans hm) i).trans ((le_max_left _ _).trans |
| 146 | (le_self_pow₀ (le_max_right _ _) (Nat.ne_of_gt hj))) |
| 147 | |
| 148 | theorem HasUniformJetBoundsAt.comp_fixed {n : ℕ} {f : ι → E → F} {p : ι → E} |
| 149 | {g : F → G} {K : Set F} (hf : HasUniformJetBoundsAt n f p) |
| 150 | (hcf : ∀ i, ContDiffAt ℝ ∞ (f i) (p i)) (hK : IsCompact K) |
| 151 | (hcg : ∀ y ∈ K, ContDiffAt ℝ ∞ g y) (hmap : ∀ i, f i (p i) ∈ K) : |
| 152 | HasUniformJetBoundsAt n (fun i => g ∘ f i) p := by |
| 153 | have hg : HasUniformJetBoundsAt n (fun _ : ι => g) (fun i => f i (p i)) := by |
| 154 | intro m _ |
| 155 | obtain ⟨C, hC⟩ := hK.exists_bound_of_continuousOn (fun y hy => |
| 156 | ((hcg y hy).continuousAt_iteratedFDeriv |
| 157 | (by exact_mod_cast le_top (a := (m : ℕ∞)))).continuousWithinAt) |
| 158 | exact ⟨C, fun i => hC (f i (p i)) (hmap i)⟩ |
| 159 | exact hf.comp hg hcf (fun i => hcg _ (hmap i)) |
| 160 | |
| 161 | theorem HasUniformJetBoundsAt.fderiv {n : ℕ} {f : ι → E → F} {p : ι → E} |
| 162 | (h : HasUniformJetBoundsAt (n + 1) f p) : |
| 163 | HasUniformJetBoundsAt n (fun i => fderiv ℝ (f i)) p := by |
| 164 | intro m hm |
| 165 | obtain ⟨C, hC⟩ := h (m + 1) (by omega) |
| 166 | exact ⟨C, fun i => by rw [norm_iteratedFDeriv_fderiv]; exact hC i⟩ |
| 167 | |
| 168 | theorem HasUniformJetBoundsAt.succ_of_fderiv {n : ℕ} {f : ι → E → F} {p : ι → E} |
| 169 | (hzero : ∃ C : ℝ, ∀ i, ‖f i (p i)‖ ≤ C) |
| 170 | (h : HasUniformJetBoundsAt n (fun i => _root_.fderiv ℝ (f i)) p) : |
| 171 | HasUniformJetBoundsAt (n + 1) f p := by |
| 172 | intro m hm |
| 173 | cases m with |
| 174 | | zero => simpa only [norm_iteratedFDeriv_zero] using hzero |
| 175 | | succ m => |
| 176 | obtain ⟨C, hC⟩ := h m (by omega) |
| 177 | exact ⟨C, fun i => by rw [← norm_iteratedFDeriv_fderiv]; exact hC i⟩ |
| 178 | |
| 179 | end PoincareMT.M35 |