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 | /- |
| 2 | Provenance and modification notice (recorded 2026-09-29). |
| 3 | Notices for the adapted source: |
| 4 | Copyright 2026 The DifferentialGeometry contributors |
| 5 | Source: https://github.com/qinz1yang/differential-geometry |
| 6 | DifferentialGeometry/Analysis/Sobolev/Euclidean/Multiplication/Multiply.lean |
| 7 | Comparison revision: 1b535dd102b94cc42b107cca27059687888f08b3. |
| 8 | Changes: Imports, module paths, and namespaces were adapted to the subject-organized PoincareLib library. |
| 9 | License: Apache-2.0. Source licenses and notices are retained under |
| 10 | PoincareConjecture/provenance/2026-09-29/licenses/. |
| 11 | See PoincareConjecture/MODIFICATIONS.md for the reviewed source mapping. |
| 12 | -/ |
| 13 | |
| 14 | import PoincareLib.Analysis.Elliptic.Regularity.Sobolev.Iterated.Basic |
| 15 | |
| 16 | /-! |
| 17 | Adapted from Chow--Liao--Qin, revision `1b535dd102b94cc42b107cca27059687888f08b3`, |
| 18 | `DifferentialGeometry/Analysis/Sobolev/Euclidean/Multiplication/Multiply.lean`. |
| 19 | Apache-2.0; see `PoincareConjecture/provenance/2026-09-29/licenses/DifferentialGeometry/LICENSE`. |
| 20 | -/ |
| 21 | |
| 22 | |
| 23 | noncomputable section |
| 24 | |
| 25 | open MeasureTheory Set Filter Topology |
| 26 | open scoped ENNReal NNReal |
| 27 | |
| 28 | namespace Poincare |
| 29 | namespace Analysis |
| 30 | namespace Sobolev |
| 31 | namespace Euclidean |
| 32 | |
| 33 | variable {d : ℕ} |
| 34 | |
| 35 | local notation "E" => EuclideanSpace ℝ (Fin d) |
| 36 | |
| 37 | lemma norm_iteratedFDeriv_partial_le |
| 38 | {η : E → ℝ} |
| 39 | (hη : ContDiff ℝ (⊤ : ℕ∞) η) |
| 40 | (i : Fin d) (j : ℕ) (x : E) : |
| 41 | ‖iteratedFDeriv ℝ j (fun y : E => (fderiv ℝ η y) (EuclideanSpace.single i 1)) x‖ ≤ |
| 42 | ‖iteratedFDeriv ℝ (j + 1) η x‖ := by |
| 43 | have hη_succ : ContDiff ℝ ((j + 1 : ℕ) : ℕ∞) η := by |
| 44 | refine hη.of_le ?_ |
| 45 | exact_mod_cast (le_top : ((j + 1 : ℕ) : ℕ∞) ≤ ⊤) |
| 46 | have hf : ContDiff ℝ ((j : ℕ) : ℕ∞) (fderiv ℝ η) := by |
| 47 | refine hη_succ.fderiv_right (m := ((j : ℕ) : ℕ∞)) ?_ |
| 48 | push_cast; exact le_refl _ |
| 49 | have h1 : ‖iteratedFDeriv ℝ j (fun y : E => (fderiv ℝ η y) (EuclideanSpace.single i 1)) x‖ |
| 50 | ≤ ‖(EuclideanSpace.single i (1 : ℝ))‖ * |
| 51 | ‖iteratedFDeriv ℝ j (fderiv ℝ η) x‖ := by |
| 52 | refine norm_iteratedFDeriv_clm_apply_const (𝕜 := ℝ) (f := fderiv ℝ η) |
| 53 | (c := EuclideanSpace.single i (1 : ℝ)) (n := j) |
| 54 | (x := x) hf.contDiffAt ?_ |
| 55 | exact le_refl _ |
| 56 | have h2 : ‖iteratedFDeriv ℝ j (fderiv ℝ η) x‖ = ‖iteratedFDeriv ℝ (j + 1) η x‖ := |
| 57 | norm_iteratedFDeriv_fderiv (𝕜 := ℝ) (f := η) (n := j) (x := x) |
| 58 | calc |
| 59 | ‖iteratedFDeriv ℝ j (fun y : E => (fderiv ℝ η y) (EuclideanSpace.single i 1)) x‖ |
| 60 | ≤ ‖(EuclideanSpace.single i (1 : ℝ))‖ * |
| 61 | ‖iteratedFDeriv ℝ j (fderiv ℝ η) x‖ := h1 |
| 62 | _ = 1 * ‖iteratedFDeriv ℝ (j + 1) η x‖ := by |
| 63 | rw [h2] |
| 64 | congr 1 |
| 65 | simp |
| 66 | _ = ‖iteratedFDeriv ℝ (j + 1) η x‖ := one_mul _ |
| 67 | |
| 68 | lemma contDiff_partial_eta |
| 69 | {η : E → ℝ} (hη : ContDiff ℝ (⊤ : ℕ∞) η) (i : Fin d) : |
| 70 | ContDiff ℝ (⊤ : ℕ∞) |
| 71 | (fun x : E => (fderiv ℝ η x) (EuclideanSpace.single i 1)) := by |
| 72 | have h : ContDiff ℝ ((⊤ : ℕ∞) : WithTop ℕ∞) η := by |
| 73 | simpa using hη |
| 74 | have hfd : ContDiff ℝ ((⊤ : ℕ∞) : WithTop ℕ∞) (fderiv ℝ η) := by |
| 75 | refine h.fderiv_right (m := (⊤ : ℕ∞)) ?_ |
| 76 | simp |
| 77 | have hfd' : ContDiff ℝ (⊤ : ℕ∞) (fderiv ℝ η) := by |
| 78 | simpa using hfd |
| 79 | exact hfd'.clm_apply contDiff_const |
| 80 | |
| 81 | theorem MemW1p.mulSmoothBounded |
| 82 | {p : ℝ≥0∞} (hp : 1 ≤ p) {Ω : Set E} (hΩ : IsOpen Ω) |
| 83 | {η u : E → ℝ} |
| 84 | (hη : ContDiff ℝ (⊤ : ℕ∞) η) |
| 85 | {C : ℝ} |
| 86 | (hη_bound : ∀ x ∈ Ω, ‖η x‖ ≤ C) |
| 87 | (hη_grad_bound : ∀ x ∈ Ω, ‖fderiv ℝ η x‖ ≤ C) |
| 88 | (hu : Poincare.Analysis.Sobolev.Weak.MemW1p (d := d) p u Ω) : |
| 89 | Poincare.Analysis.Sobolev.Weak.MemW1p (d := d) p (fun x => η x * u x) Ω := by |
| 90 | classical |
| 91 | refine ⟨?_, ?_⟩ |
| 92 | · refine MemLp.of_le_mul (g := u) (c := C) hu.1 ?_ ?_ |
| 93 | · exact hη.continuous.aestronglyMeasurable.mul hu.1.aestronglyMeasurable |
| 94 | · refine (ae_restrict_iff' hΩ.measurableSet).mpr ?_ |
| 95 | exact Filter.Eventually.of_forall fun x hx => by |
| 96 | calc |
| 97 | ‖η x * u x‖ = ‖η x‖ * ‖u x‖ := norm_mul _ _ |
| 98 | _ ≤ C * ‖u x‖ := by |
| 99 | gcongr |
| 100 | exact hη_bound x hx |
| 101 | · intro i |
| 102 | obtain ⟨g, hg_memLp, hg_weak⟩ := hu.2 i |
| 103 | refine ⟨fun x => η x * g x + (fderiv ℝ η x) (EuclideanSpace.single i 1) * u x, ?_, ?_⟩ |
| 104 | · have h1 : MemLp (fun x => η x * g x) p (volume.restrict Ω) := by |
| 105 | refine MemLp.of_le_mul (g := g) (c := C) hg_memLp ?_ ?_ |
| 106 | · exact hη.continuous.aestronglyMeasurable.mul hg_memLp.aestronglyMeasurable |
| 107 | · refine (ae_restrict_iff' hΩ.measurableSet).mpr ?_ |
| 108 | exact Filter.Eventually.of_forall fun x hx => by |
| 109 | calc |
| 110 | ‖η x * g x‖ = ‖η x‖ * ‖g x‖ := norm_mul _ _ |
| 111 | _ ≤ C * ‖g x‖ := by |
| 112 | gcongr |
| 113 | exact hη_bound x hx |
| 114 | have hderiv_cont : |
| 115 | Continuous (fun x => (fderiv ℝ η x) (EuclideanSpace.single i 1)) := |
| 116 | (hη.continuous_fderiv (by simp : ((⊤ : ℕ∞) : WithTop ℕ∞) ≠ 0)).clm_apply |
| 117 | continuous_const |
| 118 | have h2 : MemLp (fun x => (fderiv ℝ η x) (EuclideanSpace.single i 1) * u x) |
| 119 | p (volume.restrict Ω) := by |
| 120 | refine MemLp.of_le_mul (g := u) (c := C) hu.1 ?_ ?_ |
| 121 | · exact hderiv_cont.aestronglyMeasurable.mul hu.1.aestronglyMeasurable |
| 122 | · refine (ae_restrict_iff' hΩ.measurableSet).mpr ?_ |
| 123 | exact Filter.Eventually.of_forall fun x hx => by |
| 124 | calc |
| 125 | ‖(fderiv ℝ η x) (EuclideanSpace.single i 1) * u x‖ |
| 126 | = ‖(fderiv ℝ η x) (EuclideanSpace.single i 1)‖ * ‖u x‖ := norm_mul _ _ |
| 127 | _ ≤ ‖fderiv ℝ η x‖ * ‖u x‖ := by |
| 128 | gcongr |
| 129 | exact ContinuousLinearMap.le_opNorm _ _ |>.trans (by |
| 130 | rw [show ‖(EuclideanSpace.single i (1 : ℝ))‖ = 1 by simp, |
| 131 | mul_one]) |
| 132 | _ ≤ C * ‖u x‖ := by |
| 133 | gcongr |
| 134 | exact hη_grad_bound x hx |
| 135 | exact MemLp.ae_eq (Filter.Eventually.of_forall fun _ ↦ rfl) (h1.add h2) |
| 136 | · have hu_loc : LocallyIntegrable u (volume.restrict Ω) := |
| 137 | hu.1.locallyIntegrable hp |
| 138 | have hg_loc : LocallyIntegrable g (volume.restrict Ω) := |
| 139 | hg_memLp.locallyIntegrable hp |
| 140 | exact Poincare.Analysis.Sobolev.Weak.HasWeakPartialDeriv.mul_smooth hΩ hg_weak hη hu_loc hg_loc |
| 141 | |
| 142 | theorem chosenWeakPartial'_smul_smooth_bounded_ae |
| 143 | {p : ℝ≥0∞} (hp : 1 ≤ p) {Ω : Set E} (hΩ : IsOpen Ω) |
| 144 | {η u : E → ℝ} |
| 145 | (hη : ContDiff ℝ (⊤ : ℕ∞) η) |
| 146 | {C : ℝ} |
| 147 | (hη_bound : ∀ x ∈ Ω, ‖η x‖ ≤ C) |
| 148 | (hη_grad_bound : ∀ x ∈ Ω, ‖fderiv ℝ η x‖ ≤ C) |
| 149 | (hu : Poincare.Analysis.Sobolev.Weak.MemW1p (d := d) p u Ω) (i : Fin d) : |
| 150 | chosenWeakPartial' (d := d) p i (fun x => η x * u x) Ω |
| 151 | =ᵐ[volume.restrict Ω] |
| 152 | (fun x => η x * chosenWeakPartial' (d := d) p i u Ω x + |
| 153 | (fderiv ℝ η x) (EuclideanSpace.single i 1) * u x) := by |
| 154 | classical |
| 155 | have hηu : Poincare.Analysis.Sobolev.Weak.MemW1p (d := d) p (fun x => η x * u x) Ω := |
| 156 | MemW1p.mulSmoothBounded (d := d) hp hΩ hη hη_bound hη_grad_bound hu |
| 157 | have hLHS : Poincare.Analysis.Sobolev.Weak.HasWeakPartialDeriv (d := d) i |
| 158 | (chosenWeakPartial' p i (fun x => η x * u x) Ω) (fun x => η x * u x) Ω := |
| 159 | chosenWeakPartial'_isWeakPartial_of_mem hηu i |
| 160 | have hu_loc : LocallyIntegrable u (volume.restrict Ω) := |
| 161 | hu.1.locallyIntegrable hp |
| 162 | have hcwp_loc : LocallyIntegrable (chosenWeakPartial' p i u Ω) (volume.restrict Ω) := |
| 163 | (chosenWeakPartial'_memLp_of_mem hu i).locallyIntegrable hp |
| 164 | have hcwp_weak : Poincare.Analysis.Sobolev.Weak.HasWeakPartialDeriv (d := d) i |
| 165 | (chosenWeakPartial' p i u Ω) u Ω := |
| 166 | chosenWeakPartial'_isWeakPartial_of_mem hu i |
| 167 | have hRHS : Poincare.Analysis.Sobolev.Weak.HasWeakPartialDeriv (d := d) i |
| 168 | (fun x => η x * chosenWeakPartial' p i u Ω x + |
| 169 | (fderiv ℝ η x) (EuclideanSpace.single i 1) * u x) |
| 170 | (fun x => η x * u x) Ω := |
| 171 | Poincare.Analysis.Sobolev.Weak.HasWeakPartialDeriv.mul_smooth hΩ hcwp_weak hη hu_loc hcwp_loc |
| 172 | have hLHS_loc : LocallyIntegrable |
| 173 | (chosenWeakPartial' p i (fun x => η x * u x) Ω) (volume.restrict Ω) := |
| 174 | (chosenWeakPartial'_memLp_of_mem hηu i).locallyIntegrable hp |
| 175 | have hηcwp_memLp : |
| 176 | MemLp (fun x => η x * chosenWeakPartial' p i u Ω x) p (volume.restrict Ω) := by |
| 177 | refine MemLp.of_le_mul (g := chosenWeakPartial' p i u Ω) (c := C) |
| 178 | (chosenWeakPartial'_memLp_of_mem hu i) ?_ ?_ |
| 179 | · exact hη.continuous.aestronglyMeasurable.mul |
| 180 | (chosenWeakPartial'_memLp_of_mem hu i).aestronglyMeasurable |
| 181 | · refine (ae_restrict_iff' hΩ.measurableSet).mpr ?_ |
| 182 | exact Filter.Eventually.of_forall fun x hx => by |
| 183 | calc |
| 184 | ‖η x * chosenWeakPartial' p i u Ω x‖ |
| 185 | = ‖η x‖ * ‖chosenWeakPartial' p i u Ω x‖ := norm_mul _ _ |
| 186 | _ ≤ C * ‖chosenWeakPartial' p i u Ω x‖ := by |
| 187 | gcongr |
| 188 | exact hη_bound x hx |
| 189 | have hderiv_cont : |
| 190 | Continuous (fun x => (fderiv ℝ η x) (EuclideanSpace.single i 1)) := |
| 191 | (hη.continuous_fderiv (by simp : ((⊤ : ℕ∞) : WithTop ℕ∞) ≠ 0)).clm_apply |
| 192 | continuous_const |
| 193 | have hdηu_memLp : |
| 194 | MemLp (fun x => (fderiv ℝ η x) (EuclideanSpace.single i 1) * u x) |
| 195 | p (volume.restrict Ω) := by |
| 196 | refine MemLp.of_le_mul (g := u) (c := C) hu.1 ?_ ?_ |
| 197 | · exact hderiv_cont.aestronglyMeasurable.mul hu.1.aestronglyMeasurable |
| 198 | · refine (ae_restrict_iff' hΩ.measurableSet).mpr ?_ |
| 199 | exact Filter.Eventually.of_forall fun x hx => by |
| 200 | calc |
| 201 | ‖(fderiv ℝ η x) (EuclideanSpace.single i 1) * u x‖ |
| 202 | = ‖(fderiv ℝ η x) (EuclideanSpace.single i 1)‖ * ‖u x‖ := norm_mul _ _ |
| 203 | _ ≤ ‖fderiv ℝ η x‖ * ‖u x‖ := by |
| 204 | gcongr |
| 205 | exact ContinuousLinearMap.le_opNorm _ _ |>.trans (by |
| 206 | rw [show ‖(EuclideanSpace.single i (1 : ℝ))‖ = 1 by simp, mul_one]) |
| 207 | _ ≤ C * ‖u x‖ := by |
| 208 | gcongr |
| 209 | exact hη_grad_bound x hx |
| 210 | have hRHS_loc : LocallyIntegrable |
| 211 | (fun x => η x * chosenWeakPartial' p i u Ω x + |
| 212 | (fderiv ℝ η x) (EuclideanSpace.single i 1) * u x) (volume.restrict Ω) := |
| 213 | (hηcwp_memLp.add hdηu_memLp).locallyIntegrable hp |
| 214 | exact Poincare.Analysis.Sobolev.Weak.HasWeakPartialDeriv.ae_eq hΩ hLHS hRHS hLHS_loc hRHS_loc |
| 215 | |
| 216 | theorem MemWkp.smul_smooth_bounded |
| 217 | (k : ℕ) {p : ℝ≥0∞} (hp : 1 ≤ p) |
| 218 | {Ω : Set E} (hΩ : IsOpen Ω) |
| 219 | {η : E → ℝ} |
| 220 | (hη : ContDiff ℝ (⊤ : ℕ∞) η) |
| 221 | {C : ℝ} |
| 222 | (hη_bound : ∀ j ≤ k, ∀ x ∈ Ω, ‖iteratedFDeriv ℝ j η x‖ ≤ C) |
| 223 | {u : E → ℝ} (hu : MemWkp (d := d) k p u Ω) : |
| 224 | MemWkp (d := d) k p (fun x => η x * u x) Ω := by |
| 225 | induction k generalizing η u with |
| 226 | | zero => |
| 227 | rw [MemWkp_zero] at hu ⊢ |
| 228 | have h0 : ∀ x ∈ Ω, ‖η x‖ ≤ C := by |
| 229 | intro x hx |
| 230 | have h := hη_bound 0 (le_refl 0) x hx |
| 231 | rwa [norm_iteratedFDeriv_zero] at h |
| 232 | refine MemLp.of_le_mul (g := u) (c := C) hu ?_ ?_ |
| 233 | · exact hη.continuous.aestronglyMeasurable.mul hu.aestronglyMeasurable |
| 234 | · refine (ae_restrict_iff' hΩ.measurableSet).mpr ?_ |
| 235 | exact Filter.Eventually.of_forall fun x hx => by |
| 236 | calc |
| 237 | ‖η x * u x‖ = ‖η x‖ * ‖u x‖ := norm_mul _ _ |
| 238 | _ ≤ C * ‖u x‖ := by |
| 239 | gcongr |
| 240 | exact h0 x hx |
| 241 | | succ k ih => |
| 242 | rw [MemWkp_succ] at hu ⊢ |
| 243 | have h0 : ∀ x ∈ Ω, ‖η x‖ ≤ C := by |
| 244 | intro x hx |
| 245 | have h := hη_bound 0 (Nat.zero_le _) x hx |
| 246 | rwa [norm_iteratedFDeriv_zero] at h |
| 247 | have h1 : ∀ x ∈ Ω, ‖fderiv ℝ η x‖ ≤ C := by |
| 248 | intro x hx |
| 249 | have h := hη_bound 1 (Nat.succ_le_succ (Nat.zero_le _)) x hx |
| 250 | rwa [norm_iteratedFDeriv_one] at h |
| 251 | refine ⟨MemW1p.mulSmoothBounded (d := d) hp hΩ hη h0 h1 hu.1, ?_⟩ |
| 252 | intro i |
| 253 | have hae : chosenWeakPartial' p i (fun x => η x * u x) Ω |
| 254 | =ᵐ[volume.restrict Ω] |
| 255 | (fun x => η x * chosenWeakPartial' p i u Ω x + |
| 256 | (fderiv ℝ η x) (EuclideanSpace.single i 1) * u x) := |
| 257 | chosenWeakPartial'_smul_smooth_bounded_ae (d := d) hp hΩ hη h0 h1 hu.1 i |
| 258 | have hRHS_in_Wk : MemWkp (d := d) k p |
| 259 | (fun x => η x * chosenWeakPartial' p i u Ω x + |
| 260 | (fderiv ℝ η x) (EuclideanSpace.single i 1) * u x) Ω := by |
| 261 | have hT1 : MemWkp (d := d) k p |
| 262 | (fun x => η x * chosenWeakPartial' p i u Ω x) Ω := by |
| 263 | have hbnd : ∀ j ≤ k, ∀ x ∈ Ω, ‖iteratedFDeriv ℝ j η x‖ ≤ C := |
| 264 | fun j hj x hx => hη_bound j (hj.trans (Nat.le_succ _)) x hx |
| 265 | exact ih (η := η) hη hbnd (hu.2 i) |
| 266 | have hT2 : MemWkp (d := d) k p |
| 267 | (fun x => (fderiv ℝ η x) (EuclideanSpace.single i 1) * u x) Ω := by |
| 268 | have h_inner_smooth : ContDiff ℝ (⊤ : ℕ∞) |
| 269 | (fun x => (fderiv ℝ η x) (EuclideanSpace.single i 1)) := |
| 270 | contDiff_partial_eta (d := d) hη i |
| 271 | have h_inner_bound : ∀ j ≤ k, ∀ x ∈ Ω, |
| 272 | ‖iteratedFDeriv ℝ j |
| 273 | (fun x => (fderiv ℝ η x) (EuclideanSpace.single i 1)) x‖ ≤ C := by |
| 274 | intro j hj x hx |
| 275 | calc |
| 276 | ‖iteratedFDeriv ℝ j |
| 277 | (fun x => (fderiv ℝ η x) (EuclideanSpace.single i 1)) x‖ |
| 278 | ≤ ‖iteratedFDeriv ℝ (j + 1) η x‖ := |
| 279 | norm_iteratedFDeriv_partial_le (d := d) hη i j x |
| 280 | _ ≤ C := hη_bound (j + 1) (Nat.succ_le_succ hj) x hx |
| 281 | have hu_succ : MemWkp (d := d) (k + 1) p u Ω := by |
| 282 | rw [MemWkp_succ]; exact hu |
| 283 | have hu_inner : MemWkp (d := d) k p u Ω := hu_succ.le_succ |
| 284 | exact ih (η := fun x => (fderiv ℝ η x) (EuclideanSpace.single i 1)) |
| 285 | h_inner_smooth h_inner_bound hu_inner |
| 286 | exact MemWkp.add (d := d) hp hΩ hT1 hT2 |
| 287 | exact (MemWkp_congr_ae (d := d) hp hΩ hae).mpr hRHS_in_Wk |
| 288 | |
| 289 | theorem wkpNorm_smul_smooth_bounded_lt_top |
| 290 | (k : ℕ) {p : ℝ≥0∞} (hp : 1 ≤ p) |
| 291 | {Ω : Set E} (hΩ : IsOpen Ω) |
| 292 | {η : E → ℝ} |
| 293 | (hη : ContDiff ℝ (⊤ : ℕ∞) η) |
| 294 | {C : ℝ} |
| 295 | (hη_bound : ∀ j ≤ k, ∀ x ∈ Ω, ‖iteratedFDeriv ℝ j η x‖ ≤ C) |
| 296 | {u : E → ℝ} (hu : MemWkp (d := d) k p u Ω) : |
| 297 | iteratedWeakSobolevNorm (d := d) k p (fun x => η x * u x) Ω < (⊤ : ℝ≥0∞) := |
| 298 | wkpNorm_lt_top_of_memWkp |
| 299 | (MemWkp.smul_smooth_bounded (d := d) k hp hΩ hη hη_bound hu) |
| 300 | |
| 301 | end Euclidean |
| 302 | end Sobolev |
| 303 | end Analysis |
| 304 | end Poincare |