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.Elliptic.Regularity.EnergyEstimate.Substitution.Weak |
| 2 | import PoincareLib.Analysis.Elliptic.Regularity.EnergyEstimate.Substitution.WeakEquation |
| 3 | import PoincareLib.Analysis.Elliptic.Regularity.DifferenceQuotient.NirenbergBound |
| 4 | import PoincareLib.Analysis.Elliptic.Regularity.DifferenceQuotient.WeakDerivative |
| 5 | |
| 6 | /-! |
| 7 | # Energy assembly for divergence-form weak equations |
| 8 | |
| 9 | Expand the weak Nirenberg test identity using the discrete product rule. All |
| 10 | products are integrable by the compact support of the smooth cutoff and the |
| 11 | original L2 bounds. No classical derivatives of the solution are required. |
| 12 | -/ |
| 13 | |
| 14 | noncomputable section |
| 15 | |
| 16 | open MeasureTheory Metric Filter Topology Set Function |
| 17 | open scoped ENNReal NNReal BigOperators |
| 18 | |
| 19 | namespace Poincare.Analysis.Sobolev.NirenbergAssembly |
| 20 | |
| 21 | open NirenbergEuclidean NirenbergCrossBoundsNonSmooth NirenbergStandardTest |
| 22 | open NirenbergSubstitutionNonSmooth |
| 23 | |
| 24 | variable {d : ℕ} [NeZero d] |
| 25 | local notation "E" => EuclideanSpace ℝ (Fin d) |
| 26 | |
| 27 | omit [NeZero d] in |
| 28 | private theorem integrable_cutoff_mul_mul |
| 29 | {a v w : E → ℝ} (ha : Continuous a) (hac : HasCompactSupport a) |
| 30 | (hv : MemLp v 2 volume) (hw : MemLp w 2 volume) : |
| 31 | Integrable (fun x => a x * v x * w x) volume := by |
| 32 | obtain ⟨C, _, hC⟩ := exists_bound_of_continuous_compactSupport ha hac |
| 33 | have ham := memLp_bounded_mul ha.aestronglyMeasurable hC hv |
| 34 | simpa only [Pi.mul_def] using ham.integrable_mul hw |
| 35 | |
| 36 | omit [NeZero d] in |
| 37 | private theorem diffQuot_flux |
| 38 | (A : E → Fin d → Fin d → ℝ) (p : Fin d → E → ℝ) |
| 39 | (k j : Fin d) {h : ℝ} (hh : h ≠ 0) (x : E) : |
| 40 | diffQuot k h (fun y => ∑ i, A y i j * p i y) x = |
| 41 | ∑ i, (translate k h (fun y => A y i j) x * diffQuot k h (p i) x + |
| 42 | diffQuot k h (fun y => A y i j) x * p i x) := by |
| 43 | simp only [diffQuot_apply_of_ne k hh] |
| 44 | rw [← Finset.sum_sub_distrib, Finset.sum_div] |
| 45 | apply Finset.sum_congr rfl |
| 46 | intro i _ |
| 47 | simp only [translate] |
| 48 | ring |
| 49 | |
| 50 | /-- Expansion of the flux pairing into the principal energy and three cross terms. -/ |
| 51 | theorem flux_pairing_expansion |
| 52 | {Ω : Set E} (B : SmoothEllipticBilinearForm d Ω) |
| 53 | {u : E → ℝ} (hu : MemLp u 2 volume) |
| 54 | {p : Fin d → E → ℝ} (hp : ∀ i, MemLp (p i) 2 volume) |
| 55 | {η : E → ℝ} (hη : ContDiff ℝ (⊤ : ℕ∞) η) (hηc : HasCompactSupport η) |
| 56 | (k : Fin d) {h : ℝ} (hh : h ≠ 0) : |
| 57 | (∑ j : Fin d, ∫ x, |
| 58 | diffQuot k h (fun y => ∑ i : Fin d, B.a y i j * p i y) x * |
| 59 | (η x ^ 2 * diffQuot k h (p j) x + |
| 60 | 2 * η x * (fderiv ℝ η x) (EuclideanSpace.single j 1) * diffQuot k h u x)) = |
| 61 | (∫ x, ∑ i : Fin d, ∑ j : Fin d, |
| 62 | translate k h (fun y => B.a y i j) x * η x ^ 2 * |
| 63 | diffQuot k h (p i) x * diffQuot k h (p j) x) + |
| 64 | (∑ i : Fin d, ∑ j : Fin d, ∫ x, |
| 65 | 2 * translate k h (fun y => B.a y i j) x * η x * |
| 66 | (fderiv ℝ η x) (EuclideanSpace.single j 1) * |
| 67 | diffQuot k h (p i) x * diffQuot k h u x) + |
| 68 | (∑ i : Fin d, ∑ j : Fin d, ∫ x, |
| 69 | diffQuot k h (fun y => B.a y i j) x * η x ^ 2 * p i x * |
| 70 | diffQuot k h (p j) x) + |
| 71 | (∑ i : Fin d, ∑ j : Fin d, ∫ x, |
| 72 | 2 * diffQuot k h (fun y => B.a y i j) x * η x * |
| 73 | (fderiv ℝ η x) (EuclideanSpace.single j 1) * p i x * diffQuot k h u x) := by |
| 74 | classical |
| 75 | let P := fun (i j : Fin d) (x : E) => |
| 76 | translate k h (fun y => B.a y i j) x * η x ^ 2 * |
| 77 | diffQuot k h (p i) x * diffQuot k h (p j) x |
| 78 | let C1 := fun (i j : Fin d) (x : E) => |
| 79 | 2 * translate k h (fun y => B.a y i j) x * η x * |
| 80 | (fderiv ℝ η x) (EuclideanSpace.single j 1) * |
| 81 | diffQuot k h (p i) x * diffQuot k h u x |
| 82 | let C2 := fun (i j : Fin d) (x : E) => |
| 83 | diffQuot k h (fun y => B.a y i j) x * η x ^ 2 * p i x * diffQuot k h (p j) x |
| 84 | let C3 := fun (i j : Fin d) (x : E) => |
| 85 | 2 * diffQuot k h (fun y => B.a y i j) x * η x * |
| 86 | (fderiv ℝ η x) (EuclideanSpace.single j 1) * p i x * diffQuot k h u x |
| 87 | have hη2c : HasCompactSupport (fun x => η x ^ 2) := by |
| 88 | simp only [pow_two] |
| 89 | exact hηc.mul_right |
| 90 | have hDη (j : Fin d) : Continuous |
| 91 | (fun x => (fderiv ℝ η x) (EuclideanSpace.single j 1)) := |
| 92 | (hη.continuous_fderiv (by simp)).clm_apply continuous_const |
| 93 | have hτ (i j : Fin d) : Continuous (translate k h (fun y => B.a y i j)) := |
| 94 | continuous_translate k h (B.continuous_a i j) |
| 95 | have hδ (i j : Fin d) : Continuous (diffQuot k h (fun y => B.a y i j)) := |
| 96 | continuous_diffQuot_of_continuous k h (B.continuous_a i j) |
| 97 | have hdp (i : Fin d) := memLp_diffQuot_two k h (hp i) |
| 98 | have hdu := memLp_diffQuot_two k h hu |
| 99 | have hP (i j : Fin d) : Integrable (P i j) volume := |
| 100 | integrable_cutoff_mul_mul ((hτ i j).mul (hη.continuous.pow 2)) |
| 101 | hη2c.mul_left (hdp i) (hdp j) |
| 102 | have hC1 (i j : Fin d) : Integrable (C1 i j) volume := |
| 103 | integrable_cutoff_mul_mul |
| 104 | (((continuous_const.mul (hτ i j)).mul hη.continuous).mul (hDη j)) |
| 105 | (hηc.mul_left.mul_right) (hdp i) hdu |
| 106 | have hC2 (i j : Fin d) : Integrable (C2 i j) volume := |
| 107 | integrable_cutoff_mul_mul ((hδ i j).mul (hη.continuous.pow 2)) |
| 108 | hη2c.mul_left (hp i) (hdp j) |
| 109 | have hC3 (i j : Fin d) : Integrable (C3 i j) volume := |
| 110 | integrable_cutoff_mul_mul |
| 111 | (((continuous_const.mul (hδ i j)).mul hη.continuous).mul (hDη j)) |
| 112 | (hηc.mul_left.mul_right) (hp i) hdu |
| 113 | have hrow (j : Fin d) : |
| 114 | (fun x => diffQuot k h (fun y => ∑ i : Fin d, B.a y i j * p i y) x * |
| 115 | (η x ^ 2 * diffQuot k h (p j) x + |
| 116 | 2 * η x * (fderiv ℝ η x) (EuclideanSpace.single j 1) * diffQuot k h u x)) = |
| 117 | fun x => ∑ i : Fin d, (P i j x + C1 i j x + C2 i j x + C3 i j x) := by |
| 118 | funext x |
| 119 | rw [diffQuot_flux B.a p k j hh x, Finset.sum_mul] |
| 120 | apply Finset.sum_congr rfl |
| 121 | intro i _ |
| 122 | dsimp [P, C1, C2, C3] |
| 123 | ring |
| 124 | simp_rw [hrow] |
| 125 | have hsumP : (∫ x, ∑ i : Fin d, ∑ j : Fin d, P i j x) = |
| 126 | ∑ i : Fin d, ∑ j : Fin d, ∫ x, P i j x := by |
| 127 | rw [integral_finsetSum _ (fun i _ => |
| 128 | integrable_finsetSum _ (fun j _ => hP i j))] |
| 129 | apply Finset.sum_congr rfl |
| 130 | intro i _ |
| 131 | exact integral_finsetSum _ (fun j _ => hP i j) |
| 132 | change (∑ j : Fin d, ∫ x, ∑ i : Fin d, (P i j x + C1 i j x + C2 i j x + C3 i j x)) = |
| 133 | (∫ x, ∑ i : Fin d, ∑ j : Fin d, P i j x) + |
| 134 | (∑ i : Fin d, ∑ j : Fin d, ∫ x, C1 i j x) + |
| 135 | (∑ i : Fin d, ∑ j : Fin d, ∫ x, C2 i j x) + |
| 136 | (∑ i : Fin d, ∑ j : Fin d, ∫ x, C3 i j x) |
| 137 | rw [hsumP] |
| 138 | have hsplit (j : Fin d) : |
| 139 | (∫ x, ∑ i : Fin d, (P i j x + C1 i j x + C2 i j x + C3 i j x)) = |
| 140 | ∑ i : Fin d, ((∫ x, P i j x) + (∫ x, C1 i j x) + |
| 141 | (∫ x, C2 i j x) + (∫ x, C3 i j x)) := by |
| 142 | have hint (i : Fin d) : |
| 143 | Integrable (fun x => P i j x + C1 i j x + C2 i j x + C3 i j x) volume := by |
| 144 | simpa only [Pi.add_def] using |
| 145 | (((hP i j).add (hC1 i j)).add (hC2 i j)).add (hC3 i j) |
| 146 | rw [integral_finsetSum _ (fun i _ => hint i)] |
| 147 | apply Finset.sum_congr rfl |
| 148 | intro i _ |
| 149 | have h01 : Integrable (fun x => P i j x + C1 i j x) volume := |
| 150 | (hP i j).add (hC1 i j) |
| 151 | have h012 : Integrable (fun x => P i j x + C1 i j x + C2 i j x) volume := |
| 152 | h01.add (hC2 i j) |
| 153 | rw [integral_add h012 (hC3 i j), integral_add h01 (hC2 i j), |
| 154 | integral_add (hP i j) (hC1 i j)] |
| 155 | simp_rw [hsplit] |
| 156 | rw [Finset.sum_comm] |
| 157 | simp_rw [Finset.sum_add_distrib] |
| 158 | |
| 159 | private theorem energy_le_of_flux_identity {L P C1 C2 C3 R Q : ℝ} |
| 160 | (hcoer : L ≤ P) (hid : -(P + C1 + C2 + C3) = R) : |
| 161 | L ≤ |C1| + |C2| + |C3| + |R| + |Q| := by |
| 162 | linarith [neg_le_abs C1, neg_le_abs C2, neg_le_abs C3, neg_le_abs R, abs_nonneg Q] |
| 163 | |
| 164 | /-- A uniform local bound for difference quotients of the weak gradient, derived |
| 165 | from the divergence-form weak equation and the original global H1 data. |
| 166 | |
| 167 | The coefficient ellipticity domain `Ω` and weak equation domain `V` may differ. |
| 168 | The intermediate set `Ω'` lies in both, allowing global coefficient extensions |
| 169 | while retaining a local equation. The potential is included in `f`. |
| 170 | -/ |
| 171 | theorem diffQuot_weakGradient_localL2_bound |
| 172 | {Ω V : Set E} (B : SmoothEllipticBilinearForm d Ω) (hV : IsOpen V) |
| 173 | {u f : E → ℝ} {p : Fin d → E → ℝ} |
| 174 | (hu : MemLp u 2 volume) (hf : MemLp f 2 volume) |
| 175 | (hp : ∀ i, MemLp (p i) 2 volume) |
| 176 | (hw : ∀ i, Weak.HasWeakPartialDeriv i (p i) u univ) |
| 177 | (hF : ∀ j, MemLp (fun x => ∑ i : Fin d, B.a x i j * p i x) 2 volume) |
| 178 | (heq : ∀ φ : E → ℝ, ContDiff ℝ (⊤ : ℕ∞) φ → HasCompactSupport φ → |
| 179 | tsupport φ ⊆ V → |
| 180 | (∫ x in V, ∑ j : Fin d, |
| 181 | (∑ i : Fin d, B.a x i j * p i x) * |
| 182 | fderiv ℝ φ x (EuclideanSpace.single j 1)) = ∫ x in V, f x * φ x) |
| 183 | {η : E → ℝ} (hη : ContDiff ℝ (⊤ : ℕ∞) η) (hηc : HasCompactSupport η) |
| 184 | (hηrange : range η ⊆ Icc (0 : ℝ) 1) |
| 185 | {N : ℝ} (hN : 0 ≤ N) (hDη : ∀ x : E, ‖fderiv ℝ η x‖ ≤ N) |
| 186 | {Ω' Ω'' : Set E} (hΩ' : IsOpen Ω') (hΩ'Ω : closure Ω' ⊆ Ω) |
| 187 | (hΩ'c : IsCompact (closure Ω')) (hΩ'V : Ω' ⊆ V) |
| 188 | {R₀ : ℝ} (hR₀ : 0 < R₀) |
| 189 | (hthick : ∀ {h : ℝ}, |h| ≤ R₀ → Metric.cthickening |h| (tsupport η) ⊆ Ω') |
| 190 | (hηone : ∀ x ∈ Ω'', η x = 1) (hΩ'' : MeasurableSet Ω'') (k : Fin d) : |
| 191 | ∃ C : ℝ, 0 ≤ C ∧ ∀ {h : ℝ}, h ≠ 0 → |h| ≤ R₀ → |
| 192 | (B.lam / 2) * (∫ x in Ω'', ∑ i : Fin d, (diffQuot k h (p i) x) ^ 2) ≤ |
| 193 | C * ((∫ x in Ω', ∑ i : Fin d, (p i x) ^ 2) + |
| 194 | (∫ x in Ω', (u x) ^ 2) + (∫ x in Ω', (f x) ^ 2)) := by |
| 195 | classical |
| 196 | refine nirenberg_diffQuot_g_localL2_bound B hu (fun {_} _ => hf.restrict _) hp |
| 197 | hη hηc hηrange hN hDη hΩ' hΩ'Ω hΩ'c hthick hηone hΩ'' k ?_ ?_ ?_ |
| 198 | · intro h hh hh_le |
| 199 | have hthick' : Metric.cthickening R₀ (closure (tsupport η)) ⊆ Ω' := by |
| 200 | simpa only [(isClosed_tsupport η).closure_eq, abs_of_pos hR₀] using |
| 201 | hthick (h := R₀) (by rw [abs_of_pos hR₀]) |
| 202 | have hFK := integral_sq_diffQuot_le_integral_sq_weakPartial_meas hu (hp k) k |
| 203 | (hw k) hΩ'.measurableSet (isClosed_tsupport η).measurableSet |
| 204 | (by simpa only [(isClosed_tsupport η).closure_eq] using hηc.isCompact) |
| 205 | hR₀ hthick' hh hh_le |
| 206 | refine hFK.trans (integral_mono ?_ ?_ ?_) |
| 207 | · exact ((hp k).integrable_sq).restrict |
| 208 | · exact integrable_finsetSum _ (fun i _ => (hp i).integrable_sq.restrict) |
| 209 | · intro x |
| 210 | exact Finset.single_le_sum (fun i _ => sq_nonneg (p i x)) (Finset.mem_univ k) |
| 211 | · intro h hh _ |
| 212 | exact nirenbergTestFunction_sq_integral_le_weak hu (hp k) k (hw k) |
| 213 | hη hηc hηrange hDη hh |
| 214 | · intro h hh hh_le |
| 215 | have hcoer := principal_term_ge_lambda_norm_sq_nonsmooth B hp hη hηc |
| 216 | hΩ'Ω hthick k hh_le |
| 217 | have htestΩ' : tsupport (standardNirenbergTest k h η u) ⊆ Ω' := |
| 218 | (NirenbergTestFunction.tsupport_nirenbergTestFunction_subset η u k h).trans |
| 219 | (hthick hh_le) |
| 220 | have hzero (x : E) (hx : x ∉ Ω') : f x * standardNirenbergTest k h η u x = 0 := by |
| 221 | rw [image_eq_zero_of_notMem_tsupport (fun hmem => hx (htestΩ' hmem)), mul_zero] |
| 222 | have hR : (∫ x in V, f x * standardNirenbergTest k h η u x) = |
| 223 | ∫ x in Ω, f x * NirenbergTestFunction.nirenbergTestFunction k h η u x := by |
| 224 | rw [setIntegral_eq_integral_of_forall_compl_eq_zero |
| 225 | (fun x hx => hzero x (fun hmem => hx (hΩ'V hmem)))] |
| 226 | exact (setIntegral_eq_integral_of_forall_compl_eq_zero |
| 227 | (fun x hx => hzero x (fun hmem => hx (hΩ'Ω (subset_closure hmem))))).symm |
| 228 | have hid := Poincare.Analysis.Elliptic.nirenberg_weakEquation_identity hV |
| 229 | hF (hf.restrict V) hu hp hw heq hη hηc k hh ((hthick hh_le).trans hΩ'V) |
| 230 | simp only [Poincare.Analysis.Elliptic.nirenbergTestPartial] at hid |
| 231 | rw [flux_pairing_expansion B hu hp hη hηc k hh, hR] at hid |
| 232 | exact energy_le_of_flux_identity hcoer hid |
| 233 | |
| 234 | end Poincare.Analysis.Sobolev.NirenbergAssembly |