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 | Source: https://github.com/qinz1yang/differential-geometry |
| 4 | DifferentialGeometry/Analysis/Sobolev/Nirenberg/SubstitutionIdentity/Substitution.lean |
| 5 | Comparison revision: 1b535dd102b94cc42b107cca27059687888f08b3. |
| 6 | Changes: Imports, module paths, and namespaces were adapted to the subject-organized PoincareLib library. |
| 7 | License: Apache-2.0. Source licenses and notices are retained under |
| 8 | PoincareConjecture/provenance/2026-09-29/licenses/. |
| 9 | See PoincareConjecture/MODIFICATIONS.md for the reviewed source mapping. |
| 10 | -/ |
| 11 | |
| 12 | import PoincareLib.Analysis.Elliptic.Regularity.EnergyEstimate.TestFunction.Smooth |
| 13 | |
| 14 | /-! |
| 15 | # Local elliptic energy estimates |
| 16 | |
| 17 | Adapted from Chow--Liao--Qin, `Analysis/Sobolev/Nirenberg/SubstitutionIdentity/Substitution.lean`, |
| 18 | revision `1b535dd102b94cc42b107cca27059687888f08b3`. |
| 19 | Copyright 2026 The DifferentialGeometry contributors. Apache-2.0. |
| 20 | The adaptation changes imports and namespaces and uses smooth cutoffs. |
| 21 | -/ |
| 22 | |
| 23 | noncomputable section |
| 24 | |
| 25 | open MeasureTheory Metric Filter Topology Set Function |
| 26 | open Poincare.Analysis.Sobolev |
| 27 | open Poincare.Analysis.Sobolev.NirenbergEuclidean |
| 28 | open Poincare.Analysis.Sobolev.NirenbergTestFunction |
| 29 | open scoped ENNReal NNReal Convolution Pointwise BigOperators InnerProductSpace |
| 30 | |
| 31 | namespace Poincare.Analysis.Sobolev.NirenbergSubstitution |
| 32 | |
| 33 | variable {d : ℕ} [NeZero d] |
| 34 | |
| 35 | local notation "E" => EuclideanSpace ℝ (Fin d) |
| 36 | |
| 37 | omit [NeZero d] in |
| 38 | theorem integral_diffQuot_mul_eq_neg_integral_mul_diffQuot_locally_supported |
| 39 | {f g : E → ℝ} (k : Fin d) {h : ℝ} (hh : h ≠ 0) |
| 40 | (hf_continuous : Continuous f) (hg_smooth : ContDiff ℝ (⊤ : ℕ∞) g) |
| 41 | (hg_supp : HasCompactSupport g) : |
| 42 | ∫ x, diffQuot k h f x * g x ∂(volume : Measure E) = |
| 43 | -∫ x, f x * diffQuot k (-h) g x ∂(volume : Measure E) := by |
| 44 | set e : E := EuclideanSpace.single k (1 : ℝ) with he |
| 45 | have hnh : (-h) ≠ 0 := neg_ne_zero.mpr hh |
| 46 | have hg_cont : Continuous g := hg_smooth.continuous |
| 47 | have h_diffQuot_neg_g_cont : Continuous (diffQuot k (-h) g) := |
| 48 | continuous_diffQuot_of_continuous (d := d) k (-h) hg_cont |
| 49 | have h_diffQuot_neg_g_supp : HasCompactSupport (diffQuot k (-h) g) := |
| 50 | hasCompactSupport_diffQuot_of_hasCompactSupport (d := d) hg_supp k (-h) |
| 51 | have h_translate_h_f_cont : Continuous (translate k h f) := |
| 52 | continuous_translate (d := d) k h hf_continuous |
| 53 | have h_translate_neg_h_g_cont : Continuous (translate k (-h) g) := |
| 54 | continuous_translate (d := d) k (-h) hg_cont |
| 55 | have h_translate_neg_h_g_supp : HasCompactSupport (translate k (-h) g) := |
| 56 | hasCompactSupport_translate_of_hasCompactSupport (d := d) hg_supp k (-h) |
| 57 | have hfg_int : Integrable (fun x => f x * g x) volume := by |
| 58 | have hcont : Continuous (fun x : E => f x * g x) := hf_continuous.mul hg_cont |
| 59 | have hsupp : HasCompactSupport (fun x : E => f x * g x) := |
| 60 | hg_supp.mul_left |
| 61 | exact hcont.integrable_of_hasCompactSupport hsupp |
| 62 | have h_translate_f_g_int : |
| 63 | Integrable (fun x => translate k h f x * g x) volume := by |
| 64 | have hcont : Continuous (fun x : E => translate k h f x * g x) := |
| 65 | h_translate_h_f_cont.mul hg_cont |
| 66 | have hsupp : HasCompactSupport (fun x : E => translate k h f x * g x) := |
| 67 | hg_supp.mul_left |
| 68 | exact hcont.integrable_of_hasCompactSupport hsupp |
| 69 | have h_f_translate_g_int : |
| 70 | Integrable (fun x => f x * translate k (-h) g x) volume := by |
| 71 | have hcont : Continuous (fun x : E => f x * translate k (-h) g x) := |
| 72 | hf_continuous.mul h_translate_neg_h_g_cont |
| 73 | have hsupp : HasCompactSupport (fun x : E => f x * translate k (-h) g x) := |
| 74 | h_translate_neg_h_g_supp.mul_left |
| 75 | exact hcont.integrable_of_hasCompactSupport hsupp |
| 76 | have hLHS_pointwise : ∀ x : E, |
| 77 | diffQuot k h f x * g x = |
| 78 | (translate k h f x * g x - f x * g x) / h := by |
| 79 | intro x |
| 80 | rw [diffQuot_apply_of_ne (d := d) k hh f x] |
| 81 | change (f (x + h • e) - f x) / h * g x = |
| 82 | (translate k h f x * g x - f x * g x) / h |
| 83 | change (f (x + h • e) - f x) / h * g x = |
| 84 | (f (x + h • e) * g x - f x * g x) / h |
| 85 | rw [div_mul_eq_mul_div, sub_mul] |
| 86 | have hRHS_pointwise : ∀ x : E, |
| 87 | f x * diffQuot k (-h) g x = |
| 88 | (f x * translate k (-h) g x - f x * g x) / (-h) := by |
| 89 | intro x |
| 90 | rw [diffQuot_apply_of_ne (d := d) k hnh g x] |
| 91 | change f x * ((g (x + (-h) • e) - g x) / (-h)) = |
| 92 | (f x * translate k (-h) g x - f x * g x) / (-h) |
| 93 | change f x * ((g (x + (-h) • e) - g x) / (-h)) = |
| 94 | (f x * g (x + (-h) • e) - f x * g x) / (-h) |
| 95 | rw [mul_div_assoc', mul_sub] |
| 96 | have hLHS_decomp : |
| 97 | ∫ x, diffQuot k h f x * g x ∂(volume : Measure E) = |
| 98 | ((∫ x, translate k h f x * g x ∂(volume : Measure E)) - |
| 99 | ∫ x, f x * g x ∂(volume : Measure E)) / h := by |
| 100 | have heq_fun : (fun x => diffQuot k h f x * g x) = |
| 101 | (fun x => (translate k h f x * g x - f x * g x) / h) := by |
| 102 | ext x; exact hLHS_pointwise x |
| 103 | rw [heq_fun, integral_div, integral_sub h_translate_f_g_int hfg_int] |
| 104 | have hRHS_decomp : |
| 105 | ∫ x, f x * diffQuot k (-h) g x ∂(volume : Measure E) = |
| 106 | ((∫ x, f x * translate k (-h) g x ∂(volume : Measure E)) - |
| 107 | ∫ x, f x * g x ∂(volume : Measure E)) / (-h) := by |
| 108 | have heq_fun : (fun x => f x * diffQuot k (-h) g x) = |
| 109 | (fun x => (f x * translate k (-h) g x - f x * g x) / (-h)) := by |
| 110 | ext x; exact hRHS_pointwise x |
| 111 | rw [heq_fun, integral_div, integral_sub h_f_translate_g_int hfg_int] |
| 112 | have h_subst : |
| 113 | ∫ x, f (x + h • e) * g x ∂(volume : Measure E) = |
| 114 | ∫ x, f x * g (x + (-h) • e) ∂(volume : Measure E) := by |
| 115 | have hint := |
| 116 | integral_add_right_eq_self |
| 117 | (μ := (volume : Measure E)) |
| 118 | (f := fun x : E => f (x + h • e) * g x) |
| 119 | ((-h) • e) |
| 120 | have hsimp : ∀ x : E, |
| 121 | f ((x + (-h) • e) + h • e) * g (x + (-h) • e) = |
| 122 | f x * g (x + (-h) • e) := by |
| 123 | intro x |
| 124 | have hsmul : (-h) • e + h • e = (0 : E) := by |
| 125 | rw [← add_smul]; simp |
| 126 | have hcoll : (x + (-h) • e) + h • e = x := by |
| 127 | rw [add_assoc, hsmul, add_zero] |
| 128 | rw [hcoll] |
| 129 | rw [show (∫ x, f (x + h • e) * g x ∂(volume : Measure E)) = |
| 130 | ∫ x, f ((x + (-h) • e) + h • e) * g (x + (-h) • e) |
| 131 | ∂(volume : Measure E) from hint.symm] |
| 132 | refine integral_congr_ae ?_ |
| 133 | filter_upwards with x using hsimp x |
| 134 | have hLHS_subst : |
| 135 | ∫ x, translate k h f x * g x ∂(volume : Measure E) = |
| 136 | ∫ x, f x * translate k (-h) g x ∂(volume : Measure E) := by |
| 137 | have h1 : |
| 138 | ∫ x, translate k h f x * g x ∂(volume : Measure E) = |
| 139 | ∫ x, f (x + h • e) * g x ∂(volume : Measure E) := by |
| 140 | refine integral_congr_ae ?_ |
| 141 | filter_upwards with x |
| 142 | change f (x + h • EuclideanSpace.single k 1) * g x = f (x + h • e) * g x |
| 143 | rfl |
| 144 | have h2 : |
| 145 | ∫ x, f x * translate k (-h) g x ∂(volume : Measure E) = |
| 146 | ∫ x, f x * g (x + (-h) • e) ∂(volume : Measure E) := by |
| 147 | refine integral_congr_ae ?_ |
| 148 | filter_upwards with x |
| 149 | change f x * g (x + (-h) • EuclideanSpace.single k 1) = |
| 150 | f x * g (x + (-h) • e) |
| 151 | rfl |
| 152 | rw [h1, h2, h_subst] |
| 153 | rw [hLHS_decomp, hRHS_decomp, hLHS_subst] |
| 154 | rw [div_neg, neg_neg] |
| 155 | |
| 156 | omit [NeZero d] in |
| 157 | theorem nirenbergTestFunction_is_admissible_test |
| 158 | {η u : E → ℝ} (hη : ContDiff ℝ (⊤ : ℕ∞) η) (hη_supp : HasCompactSupport η) |
| 159 | (hu : ContDiff ℝ (⊤ : ℕ∞) u) |
| 160 | {Ω : Set E} |
| 161 | (k : Fin d) {h : ℝ} (hh : h ≠ 0) |
| 162 | (hh_supp : Metric.cthickening |h| (tsupport η) ⊆ Ω) : |
| 163 | ContDiff ℝ (⊤ : ℕ∞) (nirenbergTestFunction k h η u) ∧ |
| 164 | HasCompactSupport (nirenbergTestFunction k h η u) ∧ |
| 165 | tsupport (nirenbergTestFunction k h η u) ⊆ Ω := by |
| 166 | refine ⟨?_, ?_, ?_⟩ |
| 167 | · exact contDiff_nirenbergTestFunction (d := d) hη hu k hh |
| 168 | · exact hasCompactSupport_nirenbergTestFunction (d := d) hη_supp k h |
| 169 | · exact (tsupport_nirenbergTestFunction_subset (d := d) η u k h).trans hh_supp |
| 170 | |
| 171 | omit [NeZero d] in |
| 172 | private lemma fderiv_diffQuot_pointwise |
| 173 | {g : E → ℝ} (hg : ContDiff ℝ (⊤ : ℕ∞) g) |
| 174 | (k j : Fin d) {h : ℝ} (hh : h ≠ 0) : |
| 175 | (fun x : E => |
| 176 | (fderiv ℝ (diffQuot k h g) x) (EuclideanSpace.single j 1)) = |
| 177 | diffQuot k h |
| 178 | (fun y : E => (fderiv ℝ g y) (EuclideanSpace.single j 1)) := by |
| 179 | funext x |
| 180 | exact fderiv_diffQuot_apply_eq_diffQuot_partial (d := d) hg k j hh x |
| 181 | |
| 182 | theorem integral_a_partial_u_partial_diffQuot_eq |
| 183 | {Ω : Set E} (B : SmoothEllipticBilinearForm d Ω) |
| 184 | {u : E → ℝ} (hu : ContDiff ℝ (⊤ : ℕ∞) u) |
| 185 | {η : E → ℝ} (hη : ContDiff ℝ (⊤ : ℕ∞) η) (hη_supp : HasCompactSupport η) |
| 186 | (i j k : Fin d) {h : ℝ} (hh : h ≠ 0) : |
| 187 | ∫ x, B.a x i j * |
| 188 | ((fderiv ℝ u x) (EuclideanSpace.single i 1)) * |
| 189 | ((fderiv ℝ (nirenbergTestFunction k h η u) x) |
| 190 | (EuclideanSpace.single j 1)) |
| 191 | ∂(volume : Measure E) = |
| 192 | -∫ x, diffQuot k h (fun y => B.a y i j * |
| 193 | ((fderiv ℝ u y) (EuclideanSpace.single i 1))) x * |
| 194 | ((fderiv ℝ (fun y : E => η y ^ 2 * diffQuot k h u y) x) |
| 195 | (EuclideanSpace.single j 1)) |
| 196 | ∂(volume : Measure E) := by |
| 197 | set g : E → ℝ := fun y : E => η y ^ 2 * diffQuot k h u y with hg_def |
| 198 | have hnh : (-h) ≠ 0 := neg_ne_zero.mpr hh |
| 199 | have hg_smooth : ContDiff ℝ (⊤ : ℕ∞) g := by |
| 200 | have h_eta_sq : ContDiff ℝ (⊤ : ℕ∞) (fun y : E => η y ^ 2) := hη.pow 2 |
| 201 | have h_diffQuot_u : ContDiff ℝ (⊤ : ℕ∞) (diffQuot k h u) := |
| 202 | contDiff_diffQuot_of_contDiff (d := d) hu k hh |
| 203 | exact h_eta_sq.mul h_diffQuot_u |
| 204 | have hg_supp : HasCompactSupport g := by |
| 205 | have h_eta_sq_supp : HasCompactSupport (fun y : E => η y ^ 2) := by |
| 206 | have heq : (fun y : E => η y ^ 2) = (fun y : E => η y * η y) := by |
| 207 | funext y; ring |
| 208 | rw [heq] |
| 209 | exact hη_supp.mul_right |
| 210 | exact h_eta_sq_supp.mul_right |
| 211 | set f : E → ℝ := fun y : E => |
| 212 | B.a y i j * ((fderiv ℝ u y) (EuclideanSpace.single i 1)) with hf_def |
| 213 | have hf_cont : Continuous f := by |
| 214 | have h_a_cont : Continuous (fun y : E => B.a y i j) := B.continuous_a i j |
| 215 | have h_partial_u_cont : |
| 216 | Continuous (fun y : E => (fderiv ℝ u y) (EuclideanSpace.single i 1)) := |
| 217 | (hu.continuous_fderiv (by simp)).clm_apply continuous_const |
| 218 | exact h_a_cont.mul h_partial_u_cont |
| 219 | have h_test_eq : nirenbergTestFunction k h η u = diffQuot k (-h) g := rfl |
| 220 | have h_LHS_rewrite : |
| 221 | (fun x : E => |
| 222 | B.a x i j * |
| 223 | ((fderiv ℝ u x) (EuclideanSpace.single i 1)) * |
| 224 | ((fderiv ℝ (nirenbergTestFunction k h η u) x) |
| 225 | (EuclideanSpace.single j 1))) = |
| 226 | fun x : E => |
| 227 | f x * diffQuot k (-h) |
| 228 | (fun y : E => (fderiv ℝ g y) (EuclideanSpace.single j 1)) x := by |
| 229 | funext x |
| 230 | rw [h_test_eq] |
| 231 | rw [fderiv_diffQuot_apply_eq_diffQuot_partial (d := d) hg_smooth k j hnh x] |
| 232 | have hG_smooth : |
| 233 | ContDiff ℝ (⊤ : ℕ∞) |
| 234 | (fun y : E => (fderiv ℝ g y) (EuclideanSpace.single j 1)) := by |
| 235 | have h_fderiv_smooth : ContDiff ℝ (⊤ : ℕ∞) (fderiv ℝ g) := by |
| 236 | exact hg_smooth.fderiv_right (m := (⊤ : ℕ∞)) (by simp) |
| 237 | have h_apply_smooth : |
| 238 | ContDiff ℝ (⊤ : ℕ∞) |
| 239 | (fun T : E →L[ℝ] ℝ => T (EuclideanSpace.single j 1)) := by |
| 240 | exact (ContinuousLinearMap.apply ℝ ℝ |
| 241 | (EuclideanSpace.single j (1 : ℝ))).contDiff |
| 242 | exact h_apply_smooth.comp h_fderiv_smooth |
| 243 | have hG_supp : |
| 244 | HasCompactSupport |
| 245 | (fun y : E => (fderiv ℝ g y) (EuclideanSpace.single j 1)) := |
| 246 | hg_supp.fderiv_apply (𝕜 := ℝ) _ |
| 247 | have h_IBP : |
| 248 | ∫ x, diffQuot k h f x * |
| 249 | (fun y : E => (fderiv ℝ g y) (EuclideanSpace.single j 1)) x |
| 250 | ∂(volume : Measure E) = |
| 251 | -∫ x, f x * diffQuot k (-h) |
| 252 | (fun y : E => (fderiv ℝ g y) (EuclideanSpace.single j 1)) x |
| 253 | ∂(volume : Measure E) := by |
| 254 | exact integral_diffQuot_mul_eq_neg_integral_mul_diffQuot_locally_supported |
| 255 | (d := d) k hh hf_cont hG_smooth hG_supp |
| 256 | rw [h_LHS_rewrite] |
| 257 | have hLHS_eq : |
| 258 | ∫ x, f x * diffQuot k (-h) |
| 259 | (fun y : E => (fderiv ℝ g y) (EuclideanSpace.single j 1)) x |
| 260 | ∂(volume : Measure E) = |
| 261 | -∫ x, diffQuot k h f x * |
| 262 | (fun y : E => (fderiv ℝ g y) (EuclideanSpace.single j 1)) x |
| 263 | ∂(volume : Measure E) := by |
| 264 | linarith |
| 265 | rw [hLHS_eq] |
| 266 | |
| 267 | theorem integral_principalIntegrand_eq_sum_integral |
| 268 | {Ω : Set E} (B : SmoothEllipticBilinearForm d Ω) |
| 269 | {u v : E → ℝ} (hu : ContDiff ℝ (⊤ : ℕ∞) u) (hv : ContDiff ℝ (⊤ : ℕ∞) v) |
| 270 | (hv_supp : HasCompactSupport v) : |
| 271 | ∫ x, B.principalIntegrand u v x ∂(volume : Measure E) = |
| 272 | ∑ i : Fin d, ∑ j : Fin d, ∫ x, B.a x i j * |
| 273 | ((fderiv ℝ u x) (EuclideanSpace.single i 1)) * |
| 274 | ((fderiv ℝ v x) (EuclideanSpace.single j 1)) |
| 275 | ∂(volume : Measure E) := by |
| 276 | classical |
| 277 | have hu_C1 : ContDiff ℝ 1 u := hu.of_le (by norm_cast) |
| 278 | have hv_C1 : ContDiff ℝ 1 v := hv.of_le (by norm_cast) |
| 279 | have h_partial_u_cont : ∀ i : Fin d, |
| 280 | Continuous (fun x : E => (fderiv ℝ u x) (EuclideanSpace.single i 1)) := |
| 281 | fun i => (hu_C1.continuous_fderiv (by norm_num)).clm_apply continuous_const |
| 282 | have h_partial_v_cont : ∀ j : Fin d, |
| 283 | Continuous (fun x : E => (fderiv ℝ v x) (EuclideanSpace.single j 1)) := |
| 284 | fun j => (hv_C1.continuous_fderiv (by norm_num)).clm_apply continuous_const |
| 285 | have h_partial_v_supp : ∀ j : Fin d, |
| 286 | HasCompactSupport |
| 287 | (fun x : E => (fderiv ℝ v x) (EuclideanSpace.single j 1)) := |
| 288 | fun j => hv_supp.fderiv_apply (𝕜 := ℝ) _ |
| 289 | have h_pair_int : ∀ i j : Fin d, |
| 290 | Integrable (fun x : E => |
| 291 | B.a x i j * ((fderiv ℝ u x) (EuclideanSpace.single i 1)) * |
| 292 | ((fderiv ℝ v x) (EuclideanSpace.single j 1))) volume := by |
| 293 | intro i j |
| 294 | have h_a_cont : Continuous (fun x : E => B.a x i j) := B.continuous_a i j |
| 295 | have h1 : Continuous |
| 296 | (fun x : E => B.a x i j * ((fderiv ℝ u x) (EuclideanSpace.single i 1))) := |
| 297 | h_a_cont.mul (h_partial_u_cont i) |
| 298 | have h2 : Continuous |
| 299 | (fun x : E => |
| 300 | B.a x i j * ((fderiv ℝ u x) (EuclideanSpace.single i 1)) * |
| 301 | ((fderiv ℝ v x) (EuclideanSpace.single j 1))) := |
| 302 | h1.mul (h_partial_v_cont j) |
| 303 | have h_supp : HasCompactSupport |
| 304 | (fun x : E => |
| 305 | B.a x i j * ((fderiv ℝ u x) (EuclideanSpace.single i 1)) * |
| 306 | ((fderiv ℝ v x) (EuclideanSpace.single j 1))) := by |
| 307 | exact (h_partial_v_supp j).mul_left |
| 308 | exact h2.integrable_of_hasCompactSupport h_supp |
| 309 | have h_eq_fun : |
| 310 | (fun x : E => B.principalIntegrand u v x) = |
| 311 | fun x : E => |
| 312 | ∑ i : Fin d, ∑ j : Fin d, |
| 313 | B.a x i j * ((fderiv ℝ u x) (EuclideanSpace.single i 1)) * |
| 314 | ((fderiv ℝ v x) (EuclideanSpace.single j 1)) := by |
| 315 | funext x |
| 316 | rfl |
| 317 | rw [h_eq_fun] |
| 318 | have h_inner_int : ∀ i : Fin d, |
| 319 | Integrable (fun x : E => |
| 320 | ∑ j : Fin d, |
| 321 | B.a x i j * ((fderiv ℝ u x) (EuclideanSpace.single i 1)) * |
| 322 | ((fderiv ℝ v x) (EuclideanSpace.single j 1))) volume := |
| 323 | fun i => integrable_finsetSum _ (fun j _ => h_pair_int i j) |
| 324 | rw [show (fun x : E => |
| 325 | ∑ i : Fin d, ∑ j : Fin d, |
| 326 | B.a x i j * ((fderiv ℝ u x) (EuclideanSpace.single i 1)) * |
| 327 | ((fderiv ℝ v x) (EuclideanSpace.single j 1))) = |
| 328 | fun x : E => |
| 329 | ∑ i : Fin d, (fun y : E => |
| 330 | ∑ j : Fin d, |
| 331 | B.a y i j * ((fderiv ℝ u y) (EuclideanSpace.single i 1)) * |
| 332 | ((fderiv ℝ v y) (EuclideanSpace.single j 1))) x from rfl] |
| 333 | rw [integral_finsetSum _ (fun i _ => h_inner_int i)] |
| 334 | refine Finset.sum_congr rfl ?_ |
| 335 | intro i _ |
| 336 | rw [show (fun y : E => |
| 337 | ∑ j : Fin d, |
| 338 | B.a y i j * ((fderiv ℝ u y) (EuclideanSpace.single i 1)) * |
| 339 | ((fderiv ℝ v y) (EuclideanSpace.single j 1))) = |
| 340 | fun y : E => |
| 341 | ∑ j : Fin d, (fun z : E => |
| 342 | B.a z i j * ((fderiv ℝ u z) (EuclideanSpace.single i 1)) * |
| 343 | ((fderiv ℝ v z) (EuclideanSpace.single j 1))) y from rfl] |
| 344 | rw [integral_finsetSum _ (fun j _ => h_pair_int i j)] |
| 345 | |
| 346 | theorem nirenberg_substitution_identity |
| 347 | {Ω : Set E} (B : SmoothEllipticBilinearForm d Ω) |
| 348 | {u f : E → ℝ} |
| 349 | (h_weak : B.IsSmoothWeakSolution u f) |
| 350 | {η : E → ℝ} (hη : ContDiff ℝ (⊤ : ℕ∞) η) (hη_supp : HasCompactSupport η) |
| 351 | (k : Fin d) {h : ℝ} (hh : h ≠ 0) |
| 352 | (hh_supp : Metric.cthickening |h| (tsupport η) ⊆ Ω) : |
| 353 | -∑ i : Fin d, ∑ j : Fin d, ∫ x, diffQuot k h (fun y => B.a y i j * |
| 354 | ((fderiv ℝ u y) (EuclideanSpace.single i 1))) x * |
| 355 | ((fderiv ℝ (fun y : E => η y ^ 2 * diffQuot k h u y) x) |
| 356 | (EuclideanSpace.single j 1)) |
| 357 | ∂(volume : Measure E) |
| 358 | + ∫ x in Ω, B.c x * u x * nirenbergTestFunction k h η u x |
| 359 | = ∫ x in Ω, f x * nirenbergTestFunction k h η u x := by |
| 360 | classical |
| 361 | have hu : ContDiff ℝ (⊤ : ℕ∞) u := h_weak.1 |
| 362 | obtain ⟨h_v_smooth, h_v_supp, h_v_tsupp⟩ := |
| 363 | nirenbergTestFunction_is_admissible_test (d := d) hη hη_supp hu k hh hh_supp |
| 364 | have h_bilin : B.bilin u (nirenbergTestFunction k h η u) = |
| 365 | ∫ x in Ω, f x * nirenbergTestFunction k h η u x := |
| 366 | h_weak.2 (nirenbergTestFunction k h η u) h_v_smooth h_v_supp h_v_tsupp |
| 367 | have h_bilin_unfold : |
| 368 | B.bilin u (nirenbergTestFunction k h η u) = |
| 369 | ∫ x in Ω, B.principalIntegrand u (nirenbergTestFunction k h η u) x + |
| 370 | B.c x * u x * (nirenbergTestFunction k h η u) x := rfl |
| 371 | have h_v_C1 : ContDiff ℝ 1 (nirenbergTestFunction k h η u) := |
| 372 | h_v_smooth.of_le (by norm_cast) |
| 373 | have hu_C1 : ContDiff ℝ 1 u := hu.of_le (by norm_cast) |
| 374 | have h_principal_cont : |
| 375 | Continuous (B.principalIntegrand u (nirenbergTestFunction k h η u)) := |
| 376 | B.continuous_principalIntegrand hu_C1 h_v_C1 |
| 377 | have h_partial_v_supp : ∀ j : Fin d, |
| 378 | HasCompactSupport |
| 379 | (fun x : E => |
| 380 | (fderiv ℝ (nirenbergTestFunction k h η u) x) |
| 381 | (EuclideanSpace.single j 1)) := |
| 382 | fun j => h_v_supp.fderiv_apply (𝕜 := ℝ) _ |
| 383 | have h_principal_supp : |
| 384 | HasCompactSupport (B.principalIntegrand u (nirenbergTestFunction k h η u)) := by |
| 385 | unfold SmoothEllipticBilinearForm.principalIntegrand |
| 386 | refine HasCompactSupport.intro (K := tsupport (nirenbergTestFunction k h η u)) |
| 387 | (h_v_supp) ?_ |
| 388 | intro x hx |
| 389 | have h_fderiv_v_zero : fderiv ℝ (nirenbergTestFunction k h η u) x = 0 := |
| 390 | fderiv_of_notMem_tsupport (𝕜 := ℝ) hx |
| 391 | refine Finset.sum_eq_zero ?_ |
| 392 | intro i _ |
| 393 | refine Finset.sum_eq_zero ?_ |
| 394 | intro j _ |
| 395 | rw [h_fderiv_v_zero] |
| 396 | simp |
| 397 | have h_c_u_v_cont : |
| 398 | Continuous |
| 399 | (fun x : E => B.c x * u x * (nirenbergTestFunction k h η u) x) := |
| 400 | (B.continuous_c.mul hu.continuous).mul h_v_smooth.continuous |
| 401 | have h_c_u_v_supp : |
| 402 | HasCompactSupport |
| 403 | (fun x : E => B.c x * u x * (nirenbergTestFunction k h η u) x) := |
| 404 | h_v_supp.mul_left |
| 405 | have h_bilin_integrand_cont : |
| 406 | Continuous |
| 407 | (fun x : E => |
| 408 | B.principalIntegrand u (nirenbergTestFunction k h η u) x + |
| 409 | B.c x * u x * (nirenbergTestFunction k h η u) x) := |
| 410 | h_principal_cont.add h_c_u_v_cont |
| 411 | have h_bilin_integrand_supp : |
| 412 | HasCompactSupport |
| 413 | (fun x : E => |
| 414 | B.principalIntegrand u (nirenbergTestFunction k h η u) x + |
| 415 | B.c x * u x * (nirenbergTestFunction k h η u) x) := |
| 416 | h_principal_supp.add h_c_u_v_supp |
| 417 | have h_bilin_integrand_tsupport : |
| 418 | tsupport |
| 419 | (fun x : E => |
| 420 | B.principalIntegrand u (nirenbergTestFunction k h η u) x + |
| 421 | B.c x * u x * (nirenbergTestFunction k h η u) x) ⊆ Ω := by |
| 422 | refine subset_trans ?_ h_v_tsupp |
| 423 | refine closure_minimal ?_ isClosed_closure |
| 424 | intro x hx |
| 425 | have h_or : |
| 426 | B.principalIntegrand u (nirenbergTestFunction k h η u) x ≠ 0 ∨ |
| 427 | B.c x * u x * (nirenbergTestFunction k h η u) x ≠ 0 := by |
| 428 | by_contra hboth |
| 429 | rw [not_or] at hboth |
| 430 | obtain ⟨hb1, hb2⟩ := hboth |
| 431 | apply hx |
| 432 | change B.principalIntegrand u (nirenbergTestFunction k h η u) x + |
| 433 | B.c x * u x * (nirenbergTestFunction k h η u) x = 0 |
| 434 | rw [not_not.mp hb1, not_not.mp hb2, add_zero] |
| 435 | cases h_or with |
| 436 | | inl hP => |
| 437 | by_contra hx_not |
| 438 | apply hP |
| 439 | unfold SmoothEllipticBilinearForm.principalIntegrand |
| 440 | have h_fderiv_v_zero : fderiv ℝ (nirenbergTestFunction k h η u) x = 0 := |
| 441 | fderiv_of_notMem_tsupport (𝕜 := ℝ) hx_not |
| 442 | refine Finset.sum_eq_zero ?_ |
| 443 | intro i _ |
| 444 | refine Finset.sum_eq_zero ?_ |
| 445 | intro j _ |
| 446 | rw [h_fderiv_v_zero] |
| 447 | simp |
| 448 | | inr hQ => |
| 449 | have hv_ne : (nirenbergTestFunction k h η u) x ≠ 0 := by |
| 450 | intro hv0 |
| 451 | apply hQ |
| 452 | rw [hv0, mul_zero] |
| 453 | have hv_supp : x ∈ Function.support (nirenbergTestFunction k h η u) := hv_ne |
| 454 | exact subset_closure hv_supp |
| 455 | have h_bilin_to_univ : |
| 456 | ∫ x in Ω, B.principalIntegrand u (nirenbergTestFunction k h η u) x + |
| 457 | B.c x * u x * (nirenbergTestFunction k h η u) x = |
| 458 | ∫ x, B.principalIntegrand u (nirenbergTestFunction k h η u) x + |
| 459 | B.c x * u x * (nirenbergTestFunction k h η u) x |
| 460 | ∂(volume : Measure E) := by |
| 461 | have h_zero_compl : ∀ x ∉ Ω, |
| 462 | B.principalIntegrand u (nirenbergTestFunction k h η u) x + |
| 463 | B.c x * u x * (nirenbergTestFunction k h η u) x = 0 := by |
| 464 | intro x hx |
| 465 | have hx_not : x ∉ tsupport (nirenbergTestFunction k h η u) := by |
| 466 | intro hx_in; exact hx (h_v_tsupp hx_in) |
| 467 | have hv_zero : (nirenbergTestFunction k h η u) x = 0 := |
| 468 | image_eq_zero_of_notMem_tsupport hx_not |
| 469 | have h_fderiv_v_zero : fderiv ℝ (nirenbergTestFunction k h η u) x = 0 := |
| 470 | fderiv_of_notMem_tsupport (𝕜 := ℝ) hx_not |
| 471 | change B.principalIntegrand u (nirenbergTestFunction k h η u) x + |
| 472 | B.c x * u x * (nirenbergTestFunction k h η u) x = 0 |
| 473 | unfold SmoothEllipticBilinearForm.principalIntegrand |
| 474 | rw [h_fderiv_v_zero, hv_zero] |
| 475 | simp |
| 476 | have h := setIntegral_eq_integral_of_forall_compl_eq_zero |
| 477 | (μ := (volume : Measure E)) (s := Ω) |
| 478 | (f := fun x => B.principalIntegrand u (nirenbergTestFunction k h η u) x + |
| 479 | B.c x * u x * (nirenbergTestFunction k h η u) x) h_zero_compl |
| 480 | exact h |
| 481 | have h_f_v_to_univ : |
| 482 | ∫ x in Ω, f x * nirenbergTestFunction k h η u x = |
| 483 | ∫ x, f x * nirenbergTestFunction k h η u x ∂(volume : Measure E) := by |
| 484 | have h_zero_compl : ∀ x ∉ Ω, |
| 485 | f x * nirenbergTestFunction k h η u x = 0 := by |
| 486 | intro x hx |
| 487 | have hx_not : x ∉ tsupport (nirenbergTestFunction k h η u) := by |
| 488 | intro hx_in; exact hx (h_v_tsupp hx_in) |
| 489 | have hv_zero : (nirenbergTestFunction k h η u) x = 0 := |
| 490 | image_eq_zero_of_notMem_tsupport hx_not |
| 491 | rw [hv_zero, mul_zero] |
| 492 | exact setIntegral_eq_integral_of_forall_compl_eq_zero |
| 493 | (μ := (volume : Measure E)) (s := Ω) |
| 494 | (f := fun x => f x * nirenbergTestFunction k h η u x) h_zero_compl |
| 495 | have h_c_u_v_to_univ : |
| 496 | ∫ x in Ω, B.c x * u x * nirenbergTestFunction k h η u x = |
| 497 | ∫ x, B.c x * u x * nirenbergTestFunction k h η u x |
| 498 | ∂(volume : Measure E) := by |
| 499 | have h_zero_compl : ∀ x ∉ Ω, |
| 500 | B.c x * u x * nirenbergTestFunction k h η u x = 0 := by |
| 501 | intro x hx |
| 502 | have hx_not : x ∉ tsupport (nirenbergTestFunction k h η u) := by |
| 503 | intro hx_in; exact hx (h_v_tsupp hx_in) |
| 504 | have hv_zero : (nirenbergTestFunction k h η u) x = 0 := |
| 505 | image_eq_zero_of_notMem_tsupport hx_not |
| 506 | rw [hv_zero, mul_zero] |
| 507 | exact setIntegral_eq_integral_of_forall_compl_eq_zero |
| 508 | (μ := (volume : Measure E)) (s := Ω) |
| 509 | (f := fun x => B.c x * u x * nirenbergTestFunction k h η u x) h_zero_compl |
| 510 | have h_principal_int : |
| 511 | Integrable (B.principalIntegrand u (nirenbergTestFunction k h η u)) |
| 512 | volume := |
| 513 | h_principal_cont.integrable_of_hasCompactSupport h_principal_supp |
| 514 | have h_c_u_v_int : |
| 515 | Integrable |
| 516 | (fun x => B.c x * u x * nirenbergTestFunction k h η u x) volume := |
| 517 | h_c_u_v_cont.integrable_of_hasCompactSupport h_c_u_v_supp |
| 518 | have h_bilin_split : |
| 519 | ∫ x, B.principalIntegrand u (nirenbergTestFunction k h η u) x + |
| 520 | B.c x * u x * (nirenbergTestFunction k h η u) x |
| 521 | ∂(volume : Measure E) = |
| 522 | (∫ x, B.principalIntegrand u (nirenbergTestFunction k h η u) x |
| 523 | ∂(volume : Measure E)) + |
| 524 | ∫ x, B.c x * u x * nirenbergTestFunction k h η u x |
| 525 | ∂(volume : Measure E) := |
| 526 | integral_add h_principal_int h_c_u_v_int |
| 527 | have h_sum_int : |
| 528 | ∫ x, B.principalIntegrand u (nirenbergTestFunction k h η u) x |
| 529 | ∂(volume : Measure E) = |
| 530 | ∑ i : Fin d, ∑ j : Fin d, ∫ x, B.a x i j * |
| 531 | ((fderiv ℝ u x) (EuclideanSpace.single i 1)) * |
| 532 | ((fderiv ℝ (nirenbergTestFunction k h η u) x) |
| 533 | (EuclideanSpace.single j 1)) |
| 534 | ∂(volume : Measure E) := |
| 535 | integral_principalIntegrand_eq_sum_integral (d := d) B hu h_v_smooth h_v_supp |
| 536 | have h_pair_IBP : ∀ i j : Fin d, |
| 537 | ∫ x, B.a x i j * |
| 538 | ((fderiv ℝ u x) (EuclideanSpace.single i 1)) * |
| 539 | ((fderiv ℝ (nirenbergTestFunction k h η u) x) |
| 540 | (EuclideanSpace.single j 1)) |
| 541 | ∂(volume : Measure E) = |
| 542 | -∫ x, diffQuot k h (fun y => B.a y i j * |
| 543 | ((fderiv ℝ u y) (EuclideanSpace.single i 1))) x * |
| 544 | ((fderiv ℝ (fun y : E => η y ^ 2 * diffQuot k h u y) x) |
| 545 | (EuclideanSpace.single j 1)) |
| 546 | ∂(volume : Measure E) := by |
| 547 | intro i j |
| 548 | exact integral_a_partial_u_partial_diffQuot_eq (d := d) B hu hη hη_supp |
| 549 | i j k hh |
| 550 | have hSwap_sum_neg : |
| 551 | ∑ i : Fin d, ∑ j : Fin d, ∫ x, B.a x i j * |
| 552 | ((fderiv ℝ u x) (EuclideanSpace.single i 1)) * |
| 553 | ((fderiv ℝ (nirenbergTestFunction k h η u) x) |
| 554 | (EuclideanSpace.single j 1)) |
| 555 | ∂(volume : Measure E) = |
| 556 | -∑ i : Fin d, ∑ j : Fin d, |
| 557 | ∫ x, diffQuot k h (fun y => B.a y i j * |
| 558 | ((fderiv ℝ u y) (EuclideanSpace.single i 1))) x * |
| 559 | ((fderiv ℝ (fun y : E => η y ^ 2 * diffQuot k h u y) x) |
| 560 | (EuclideanSpace.single j 1)) |
| 561 | ∂(volume : Measure E) := by |
| 562 | rw [show |
| 563 | (∑ i : Fin d, ∑ j : Fin d, ∫ x, B.a x i j * |
| 564 | ((fderiv ℝ u x) (EuclideanSpace.single i 1)) * |
| 565 | ((fderiv ℝ (nirenbergTestFunction k h η u) x) |
| 566 | (EuclideanSpace.single j 1)) |
| 567 | ∂(volume : Measure E)) = |
| 568 | ∑ i : Fin d, ∑ j : Fin d, |
| 569 | -∫ x, diffQuot k h (fun y => B.a y i j * |
| 570 | ((fderiv ℝ u y) (EuclideanSpace.single i 1))) x * |
| 571 | ((fderiv ℝ (fun y : E => η y ^ 2 * diffQuot k h u y) x) |
| 572 | (EuclideanSpace.single j 1)) |
| 573 | ∂(volume : Measure E) from ?_] |
| 574 | · rw [← Finset.sum_neg_distrib] |
| 575 | refine Finset.sum_congr rfl ?_ |
| 576 | intro i _ |
| 577 | rw [← Finset.sum_neg_distrib] |
| 578 | · refine Finset.sum_congr rfl ?_ |
| 579 | intro i _ |
| 580 | refine Finset.sum_congr rfl ?_ |
| 581 | intro j _ |
| 582 | exact h_pair_IBP i j |
| 583 | have h_chain : |
| 584 | ∫ x in Ω, f x * nirenbergTestFunction k h η u x = |
| 585 | -∑ i : Fin d, ∑ j : Fin d, |
| 586 | ∫ x, diffQuot k h (fun y => B.a y i j * |
| 587 | ((fderiv ℝ u y) (EuclideanSpace.single i 1))) x * |
| 588 | ((fderiv ℝ (fun y : E => η y ^ 2 * diffQuot k h u y) x) |
| 589 | (EuclideanSpace.single j 1)) |
| 590 | ∂(volume : Measure E) + |
| 591 | ∫ x in Ω, B.c x * u x * nirenbergTestFunction k h η u x := by |
| 592 | rw [← h_bilin, h_bilin_unfold, h_bilin_to_univ, h_bilin_split, h_sum_int, |
| 593 | hSwap_sum_neg, h_c_u_v_to_univ] |
| 594 | linarith |
| 595 | |
| 596 | end Poincare.Analysis.Sobolev.NirenbergSubstitution |