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 | Adapted from AxelWorkspace revision f1cdb30cabdc8781d2d3dec86d3d99ab1820f30e. |
| 3 | Source and SHA-256: references/analysis/axel-workspace/weak-parabolic-regularity-sources.json. |
| 4 | Apache-2.0; see the license in that source directory. |
| 5 | -/ |
| 6 | import PoincareLib.Analysis.Parabolic.WeakRegularity.Interior.ConstantEnergy |
| 7 | |
| 8 | /-! |
| 9 | # The differentiated weak parabolic equation |
| 10 | |
| 11 | Constant directional differentiation of the canonical distributional equation |
| 12 | produces explicit coefficient-derivative forcing from the actual weak jets. |
| 13 | No smoothness of the solution or of its weak derivatives is assumed. |
| 14 | |
| 15 | References: Morgan--Tian, Proposition 9.20, pp. 207-208; Evans, second |
| 16 | edition, Section 5.2.1, pp. 256-257. |
| 17 | -/ |
| 18 | |
| 19 | open Set Filter MeasureTheory |
| 20 | open scoped ContDiff Topology |
| 21 | |
| 22 | noncomputable section |
| 23 | |
| 24 | namespace Poincare.Analysis.Parabolic.WeakRegularity.Canonical |
| 25 | |
| 26 | variable {n : ℕ} {U : Set (Spacetime n)} |
| 27 | |
| 28 | private def D (v : Spacetime n) (f : Spacetime n → ℝ) : Spacetime n → ℝ := |
| 29 | fun y => fderiv ℝ f y v |
| 30 | |
| 31 | private structure Test (U : Set (Spacetime n)) (f : Spacetime n → ℝ) : Prop where |
| 32 | smooth : ContDiff ℝ ∞ f |
| 33 | compact : HasCompactSupport f |
| 34 | subset : tsupport f ⊆ U |
| 35 | |
| 36 | private theorem D_smooth {f : Spacetime n → ℝ} (hf : ContDiff ℝ ∞ f) (v : Spacetime n) : |
| 37 | ContDiff ℝ ∞ (D v f) := (hf.fderiv_right (by simp)).clm_apply contDiff_const |
| 38 | |
| 39 | private theorem D_smoothOn (hU : IsOpen U) {f : Spacetime n → ℝ} |
| 40 | (hf : ContDiffOn ℝ ∞ f U) (v : Spacetime n) : |
| 41 | ContDiffOn ℝ ∞ (D v f) U := (hf.fderiv_of_isOpen hU (by simp)).clm_apply contDiffOn_const |
| 42 | |
| 43 | private theorem Test.deriv {f : Spacetime n → ℝ} (hf : Test U f) (v : Spacetime n) : |
| 44 | Test U (D v f) := |
| 45 | ⟨D_smooth hf.smooth v, hf.compact.fderiv_apply ℝ v, |
| 46 | (tsupport_fderiv_apply_subset ℝ v).trans hf.subset⟩ |
| 47 | |
| 48 | private theorem smooth_of_support (hU : IsOpen U) {f : Spacetime n → ℝ} |
| 49 | (hf : ContDiffOn ℝ ∞ f U) (hs : tsupport f ⊆ U) : ContDiff ℝ ∞ f := by |
| 50 | rw [contDiff_iff_contDiffAt] |
| 51 | intro y |
| 52 | by_cases hy : y ∈ tsupport f |
| 53 | · exact (hf y (hs hy)).contDiffAt (hU.mem_nhds (hs hy)) |
| 54 | · exact contDiffAt_const.congr_of_eventuallyEq (notMem_tsupport_iff_eventuallyEq.mp hy) |
| 55 | |
| 56 | private theorem Test.mul (hU : IsOpen U) {q f : Spacetime n → ℝ} |
| 57 | (hq : ContDiffOn ℝ ∞ q U) (hf : Test U f) : Test U (fun y => q y * f y) := by |
| 58 | have hs : tsupport (fun y => q y * f y) ⊆ U := tsupport_mul_subset_right.trans hf.subset |
| 59 | exact ⟨smooth_of_support hU (hq.mul hf.smooth.contDiffOn) hs, hf.compact.mul_left, hs⟩ |
| 60 | |
| 61 | private theorem Test.add {f g : Spacetime n → ℝ} (hf : Test U f) (hg : Test U g) : |
| 62 | Test U (fun y => f y + g y) := by |
| 63 | refine ⟨hf.smooth.add hg.smooth, hf.compact.add hg.compact, ?_⟩ |
| 64 | apply (closure_minimal ?_ ((isClosed_tsupport f).union (isClosed_tsupport g))).trans |
| 65 | (union_subset hf.subset hg.subset) |
| 66 | intro y hy |
| 67 | by_contra hn |
| 68 | simp only [mem_union, not_or] at hn |
| 69 | exact hy (by change f y + g y = 0; rw [image_eq_zero_of_notMem_tsupport hn.1, |
| 70 | image_eq_zero_of_notMem_tsupport hn.2]; ring) |
| 71 | |
| 72 | private theorem Test.neg {f : Spacetime n → ℝ} (hf : Test U f) : |
| 73 | Test U (fun y => -f y) := by |
| 74 | refine ⟨hf.smooth.neg, hf.compact.neg, ?_⟩ |
| 75 | change tsupport (-f) ⊆ U |
| 76 | simpa only [tsupport_neg] using hf.subset |
| 77 | |
| 78 | private theorem Test.sub {f g : Spacetime n → ℝ} (hf : Test U f) (hg : Test U g) : |
| 79 | Test U (fun y => f y - g y) := by |
| 80 | simpa only [sub_eq_add_neg] using hf.add hg.neg |
| 81 | |
| 82 | private theorem Test.sum {ι : Type*} (s : Finset ι) {f : ι → Spacetime n → ℝ} |
| 83 | (hf : ∀ i ∈ s, Test U (f i)) : Test U (fun y => ∑ i ∈ s, f i y) := by |
| 84 | classical |
| 85 | induction s using Finset.induction_on with |
| 86 | | empty => simpa using (show Test U (fun _ : Spacetime n => (0 : ℝ)) from |
| 87 | ⟨contDiff_const, HasCompactSupport.zero, by simp⟩) |
| 88 | | @insert i s hi ih => |
| 89 | simpa only [Finset.sum_insert hi] using |
| 90 | (hf i (Finset.mem_insert_self _ _)).add (ih (fun j hj => hf j (Finset.mem_insert_of_mem hj))) |
| 91 | |
| 92 | private theorem Test.integrable_mul {f ψ : Spacetime n → ℝ} |
| 93 | (hψ : Test U ψ) (hf : LocallyIntegrableOn f U volume) : |
| 94 | Integrable (fun y => f y * ψ y) := by |
| 95 | apply (integrableOn_iff_integrable_of_support_subset |
| 96 | ((Function.support_mul_subset_right f ψ).trans (subset_tsupport ψ))).mp |
| 97 | exact (hf.integrableOn_compact_subset hψ.subset hψ.compact).mul_continuousOn |
| 98 | hψ.smooth.continuous.continuousOn hψ.compact |
| 99 | |
| 100 | private theorem Test.restrict_pair {f ψ : Spacetime n → ℝ} (hψ : Test U ψ) : |
| 101 | (∫ y in U, f y * ψ y) = ∫ y, f y * ψ y := by |
| 102 | apply setIntegral_eq_integral_of_forall_compl_eq_zero |
| 103 | intro y hy |
| 104 | rw [image_eq_zero_of_notMem_tsupport (fun h => hy (hψ.subset h)), mul_zero] |
| 105 | |
| 106 | private theorem D_neg {f : Spacetime n → ℝ} (v : Spacetime n) : |
| 107 | D v (fun y => -f y) = fun y => -D v f y := by |
| 108 | funext y |
| 109 | change fderiv ℝ (-f) y v = -fderiv ℝ f y v |
| 110 | rw [fderiv_neg] |
| 111 | rfl |
| 112 | |
| 113 | private theorem D_add {f g : Spacetime n → ℝ} (hf : ContDiff ℝ ∞ f) |
| 114 | (hg : ContDiff ℝ ∞ g) (v : Spacetime n) : |
| 115 | D v (fun y => f y + g y) = fun y => D v f y + D v g y := by |
| 116 | funext y |
| 117 | simp only [D, fderiv_fun_add (hf.differentiable (by simp) y) |
| 118 | (hg.differentiable (by simp) y), add_apply] |
| 119 | |
| 120 | private theorem D_sub {f g : Spacetime n → ℝ} (hf : ContDiff ℝ ∞ f) |
| 121 | (hg : ContDiff ℝ ∞ g) (v : Spacetime n) : |
| 122 | D v (fun y => f y - g y) = fun y => D v f y - D v g y := by |
| 123 | funext y |
| 124 | simp only [D, fderiv_fun_sub (hf.differentiable (by simp) y) |
| 125 | (hg.differentiable (by simp) y), sub_apply] |
| 126 | |
| 127 | private theorem D_sum {ι : Type*} (s : Finset ι) {f : ι → Spacetime n → ℝ} |
| 128 | (hf : ∀ i ∈ s, ContDiff ℝ ∞ (f i)) (v : Spacetime n) : |
| 129 | D v (fun y => ∑ i ∈ s, f i y) = fun y => ∑ i ∈ s, D v (f i) y := by |
| 130 | funext y |
| 131 | simp only [D, fderiv_fun_sum (fun i hi => (hf i hi).differentiable (by simp) y), |
| 132 | sum_apply] |
| 133 | |
| 134 | private theorem D_comm {f : Spacetime n → ℝ} (hf : ContDiff ℝ ∞ f) |
| 135 | (v w : Spacetime n) : D v (D w f) = D w (D v f) := by |
| 136 | funext y |
| 137 | exact directionalSecond_comm f hf v w y |
| 138 | |
| 139 | private theorem D_mul_test (hU : IsOpen U) {q f : Spacetime n → ℝ} |
| 140 | (hq : ContDiffOn ℝ ∞ q U) (hf : Test U f) (v : Spacetime n) : |
| 141 | D v (fun y => q y * f y) = fun y => D v q y * f y + q y * D v f y := by |
| 142 | funext y |
| 143 | by_cases hy : y ∈ U |
| 144 | · dsimp only [D] |
| 145 | rw [fderiv_fun_mul (((hq y hy).contDiffAt (hU.mem_nhds hy)).differentiableAt (by simp)) |
| 146 | (hf.smooth.differentiable (by simp) y)] |
| 147 | simp only [add_apply, smul_apply, smul_eq_mul] |
| 148 | ring |
| 149 | · have hz : f y = 0 := image_eq_zero_of_notMem_tsupport (fun h => hy (hf.subset h)) |
| 150 | have hd : D v f y = 0 := image_eq_zero_of_notMem_tsupport |
| 151 | (fun h => hy ((hf.deriv v).subset h)) |
| 152 | have hp : D v (fun y => q y * f y) y = 0 := image_eq_zero_of_notMem_tsupport |
| 153 | (fun h => hy (((hf.mul hU hq).deriv v).subset h)) |
| 154 | simp only [hz, hd, hp, mul_zero, add_zero] |
| 155 | |
| 156 | private theorem Test.adjoint (hU : IsOpen U) {C : Coefficients n} |
| 157 | (hC : C.IsSmoothOn U) {φ : Spacetime n → ℝ} (hφ : Test U φ) : |
| 158 | Test U (C.adjoint φ) := by |
| 159 | exact (((hφ.deriv (0, 1)).neg.sub |
| 160 | (Test.sum Finset.univ (fun i _ => Test.sum Finset.univ (fun j _ => |
| 161 | (((hφ.mul hU (hC.1 i j)).deriv (spatialDirection i)).deriv (spatialDirection j)))))).sub |
| 162 | (Test.sum Finset.univ (fun i _ => (hφ.mul hU (hC.2.1 i)).deriv (spatialDirection i)))).add |
| 163 | (hφ.mul hU hC.2.2) |
| 164 | |
| 165 | private theorem D_adjoint (hU : IsOpen U) {C : Coefficients n} |
| 166 | (hC : C.IsSmoothOn U) {φ : Spacetime n → ℝ} (hφ : Test U φ) (v : Spacetime n) : |
| 167 | D v (C.adjoint φ) = fun y => C.adjoint (D v φ) y - |
| 168 | (∑ i, ∑ j, spatialDeriv j (spatialDeriv i |
| 169 | (fun x => D v (C.principal i j) x * φ x)) y) - |
| 170 | (∑ i, spatialDeriv i (fun x => D v (C.drift i) x * φ x) y) + |
| 171 | D v C.zeroth y * φ y := by |
| 172 | let A := fun i j y => C.principal i j y * φ y |
| 173 | let B := fun i y => C.drift i y * φ y |
| 174 | let Z := fun y => C.zeroth y * φ y |
| 175 | let A0 := fun i j y => C.principal i j y * D v φ y |
| 176 | let A1 := fun i j y => D v (C.principal i j) y * φ y |
| 177 | let B0 := fun i y => C.drift i y * D v φ y |
| 178 | let B1 := fun i y => D v (C.drift i) y * φ y |
| 179 | have hA (i j) : Test U (A i j) := hφ.mul hU (hC.1 i j) |
| 180 | have hB (i) : Test U (B i) := hφ.mul hU (hC.2.1 i) |
| 181 | have hZ : Test U Z := hφ.mul hU hC.2.2 |
| 182 | have hA0 (i j) : Test U (A0 i j) := (hφ.deriv v).mul hU (hC.1 i j) |
| 183 | have hA1 (i j) : Test U (A1 i j) := hφ.mul hU (D_smoothOn hU (hC.1 i j) v) |
| 184 | have hB0 (i) : Test U (B0 i) := (hφ.deriv v).mul hU (hC.2.1 i) |
| 185 | have hB1 (i) : Test U (B1 i) := hφ.mul hU (D_smoothOn hU (hC.2.1 i) v) |
| 186 | have hDA (i j) : D v (D (spatialDirection j) (D (spatialDirection i) (A i j))) = |
| 187 | fun y => D (spatialDirection j) (D (spatialDirection i) (A0 i j)) y + |
| 188 | D (spatialDirection j) (D (spatialDirection i) (A1 i j)) y := by |
| 189 | rw [D_comm ((hA i j).deriv (spatialDirection i)).smooth v (spatialDirection j), |
| 190 | D_comm (hA i j).smooth v (spatialDirection i)] |
| 191 | have he : D v (A i j) = fun y => A1 i j y + A0 i j y := |
| 192 | D_mul_test hU (hC.1 i j) hφ v |
| 193 | rw [he, D_add (hA1 i j).smooth (hA0 i j).smooth (spatialDirection i), |
| 194 | D_add ((hA1 i j).deriv (spatialDirection i)).smooth |
| 195 | ((hA0 i j).deriv (spatialDirection i)).smooth (spatialDirection j)] |
| 196 | funext y |
| 197 | ring |
| 198 | have hDB (i) : D v (D (spatialDirection i) (B i)) = |
| 199 | fun y => D (spatialDirection i) (B0 i) y + D (spatialDirection i) (B1 i) y := by |
| 200 | rw [D_comm (hB i).smooth v (spatialDirection i)] |
| 201 | have he : D v (B i) = fun y => B1 i y + B0 i y := |
| 202 | D_mul_test hU (hC.2.1 i) hφ v |
| 203 | rw [he, D_add (hB1 i).smooth (hB0 i).smooth (spatialDirection i)] |
| 204 | funext y |
| 205 | ring |
| 206 | have hDZ : D v Z = fun y => C.zeroth y * D v φ y + D v C.zeroth y * φ y := by |
| 207 | rw [show D v Z = fun y => D v C.zeroth y * φ y + C.zeroth y * D v φ y from |
| 208 | D_mul_test hU hC.2.2 hφ v] |
| 209 | funext y |
| 210 | ring |
| 211 | let SA := fun y => ∑ i, ∑ j, D (spatialDirection j) (D (spatialDirection i) (A i j)) y |
| 212 | let SB := fun y => ∑ i, D (spatialDirection i) (B i) y |
| 213 | have hSA : Test U SA := Test.sum Finset.univ (fun i _ => Test.sum Finset.univ |
| 214 | (fun j _ => ((hA i j).deriv (spatialDirection i)).deriv (spatialDirection j))) |
| 215 | have hSB : Test U SB := Test.sum Finset.univ (fun i _ => (hB i).deriv (spatialDirection i)) |
| 216 | have he : C.adjoint φ = fun y => -D (0, 1) φ y - SA y - SB y + Z y := rfl |
| 217 | rw [he, D_add ((((hφ.deriv (0, 1)).neg.sub hSA).sub hSB).smooth) hZ.smooth v, |
| 218 | D_sub (((hφ.deriv (0, 1)).neg.sub hSA).smooth) hSB.smooth v, |
| 219 | D_sub (hφ.deriv (0, 1)).neg.smooth hSA.smooth v, |
| 220 | D_neg, D_comm hφ.smooth v (0, 1), hDZ] |
| 221 | have hDSA : D v SA = fun y => |
| 222 | (∑ i, ∑ j, D (spatialDirection j) (D (spatialDirection i) (A0 i j)) y) + |
| 223 | (∑ i, ∑ j, D (spatialDirection j) (D (spatialDirection i) (A1 i j)) y) := by |
| 224 | rw [show D v SA = fun y => ∑ i, D v |
| 225 | (fun x => ∑ j, D (spatialDirection j) (D (spatialDirection i) (A i j)) x) y from |
| 226 | D_sum Finset.univ (fun i _ => (Test.sum Finset.univ |
| 227 | (fun j _ => ((hA i j).deriv (spatialDirection i)).deriv (spatialDirection j))).smooth) v] |
| 228 | simp_rw [D_sum Finset.univ (fun j _ => |
| 229 | (((hA _ j).deriv (spatialDirection _)).deriv (spatialDirection j)).smooth) v, hDA] |
| 230 | funext y |
| 231 | simp only [Finset.sum_add_distrib] |
| 232 | have hDSB : D v SB = fun y => (∑ i, D (spatialDirection i) (B0 i) y) + |
| 233 | (∑ i, D (spatialDirection i) (B1 i) y) := by |
| 234 | rw [show D v SB = fun y => ∑ i, D v (D (spatialDirection i) (B i)) y from |
| 235 | D_sum Finset.univ (fun i _ => ((hB i).deriv (spatialDirection i)).smooth) v] |
| 236 | simp_rw [hDB] |
| 237 | funext y |
| 238 | simp only [Finset.sum_add_distrib] |
| 239 | rw [hDSA, hDSB] |
| 240 | funext y |
| 241 | unfold Coefficients.adjoint A0 A1 B0 B1 D timeDeriv spatialDeriv |
| 242 | ring |
| 243 | |
| 244 | private def pair (f ψ : Spacetime n → ℝ) : ℝ := ∫ y, f y * ψ y |
| 245 | |
| 246 | private theorem pair_add {f ψ θ : Spacetime n → ℝ} |
| 247 | (hf : LocallyIntegrableOn f U volume) (hψ : Test U ψ) (hθ : Test U θ) : |
| 248 | pair f (fun y => ψ y + θ y) = pair f ψ + pair f θ := by |
| 249 | simp only [pair, mul_add] |
| 250 | exact integral_add (hψ.integrable_mul hf) (hθ.integrable_mul hf) |
| 251 | |
| 252 | private theorem pair_sub {f ψ θ : Spacetime n → ℝ} |
| 253 | (hf : LocallyIntegrableOn f U volume) (hψ : Test U ψ) (hθ : Test U θ) : |
| 254 | pair f (fun y => ψ y - θ y) = pair f ψ - pair f θ := by |
| 255 | simp only [pair, mul_sub] |
| 256 | exact integral_sub (hψ.integrable_mul hf) (hθ.integrable_mul hf) |
| 257 | |
| 258 | private theorem pair_sum {ι : Type*} (s : Finset ι) |
| 259 | {f : Spacetime n → ℝ} {ψ : ι → Spacetime n → ℝ} |
| 260 | (hf : LocallyIntegrableOn f U volume) (hψ : ∀ i ∈ s, Test U (ψ i)) : |
| 261 | pair f (fun y => ∑ i ∈ s, ψ i y) = ∑ i ∈ s, pair f (ψ i) := by |
| 262 | simp only [pair, Finset.mul_sum] |
| 263 | exact integral_finsetSum s (fun i hi => (hψ i hi).integrable_mul hf) |
| 264 | |
| 265 | private theorem weak_pair {f g : Spacetime n → ℝ} (v : Spacetime n) |
| 266 | (hweak : ∀ ψ : Spacetime n → ℝ, ContDiff ℝ ∞ ψ → HasCompactSupport ψ → |
| 267 | tsupport ψ ⊆ U → (∫ y in U, ψ y * g y) = -(∫ y in U, D v ψ y * f y)) |
| 268 | {ψ : Spacetime n → ℝ} (hψ : Test U ψ) : pair g ψ = -pair f (D v ψ) := by |
| 269 | have hh := hweak ψ hψ.smooth hψ.compact hψ.subset |
| 270 | simp only [mul_comm] at hh |
| 271 | rw [hψ.restrict_pair, (hψ.deriv v).restrict_pair] at hh |
| 272 | exact hh |
| 273 | |
| 274 | /-- The weak directional derivative solves the equation with actual |
| 275 | coefficient-derivative forcing expressed through the existing weak jets. -/ |
| 276 | theorem differentiated_inhomogeneous_pairing |
| 277 | {n : ℕ} {U : Set (Spacetime n)} (hU : IsOpen U) |
| 278 | {C : Coefficients n} (hC : C.IsSmoothOn U) |
| 279 | {u w f f_v : Spacetime n → ℝ} |
| 280 | (hu : LocallyIntegrableOn u U volume) |
| 281 | (hf : LocallyIntegrableOn f U volume) |
| 282 | (hf_v : LocallyIntegrableOn f_v U volume) |
| 283 | (heq : ∀ ψ : Spacetime n → ℝ, ContDiff ℝ ∞ ψ → HasCompactSupport ψ → |
| 284 | tsupport ψ ⊆ U → (∫ y, u y * C.adjoint ψ y) = ∫ y, ψ y * f y) |
| 285 | {g : Fin n → Spacetime n → ℝ} |
| 286 | {H : Fin n → Fin n → Spacetime n → ℝ} (v : Spacetime n) |
| 287 | (hg : ∀ i, LocallyIntegrableOn (g i) U volume) |
| 288 | (hH : ∀ i j, LocallyIntegrableOn (H i j) U volume) |
| 289 | (hw : LocallyIntegrableOn w U volume) |
| 290 | (hgweak : ∀ i (ψ : Spacetime n → ℝ), ContDiff ℝ ∞ ψ → |
| 291 | HasCompactSupport ψ → tsupport ψ ⊆ U → |
| 292 | (∫ y in U, ψ y * g i y) = -(∫ y in U, spatialDeriv i ψ y * u y)) |
| 293 | (hHweak : ∀ i j (ψ : Spacetime n → ℝ), ContDiff ℝ ∞ ψ → |
| 294 | HasCompactSupport ψ → tsupport ψ ⊆ U → |
| 295 | (∫ y in U, ψ y * H i j y) = -(∫ y in U, spatialDeriv i ψ y * g j y)) |
| 296 | (hwweak : ∀ ψ : Spacetime n → ℝ, ContDiff ℝ ∞ ψ → |
| 297 | HasCompactSupport ψ → tsupport ψ ⊆ U → |
| 298 | (∫ y in U, ψ y * w y) = -(∫ y in U, fderiv ℝ ψ y v * u y)) |
| 299 | (hfweak : ∀ ψ : Spacetime n → ℝ, ContDiff ℝ ∞ ψ → |
| 300 | HasCompactSupport ψ → tsupport ψ ⊆ U → |
| 301 | (∫ y in U, ψ y * f_v y) = -(∫ y in U, fderiv ℝ ψ y v * f y)) |
| 302 | {φ : Spacetime n → ℝ} (hφ : ContDiff ℝ ∞ φ) |
| 303 | (hφc : HasCompactSupport φ) (hφU : tsupport φ ⊆ U) : |
| 304 | (∫ y, w y * C.adjoint φ y) = |
| 305 | ∫ y, φ y * (f_v y + |
| 306 | (∑ i, ∑ j, fderiv ℝ (C.principal i j) y v * H i j y) - |
| 307 | (∑ i, fderiv ℝ (C.drift i) y v * g i y) - fderiv ℝ C.zeroth y v * u y) := by |
| 308 | have Tφ : Test U φ := ⟨hφ, hφc, hφU⟩ |
| 309 | let A := fun i j y => D v (C.principal i j) y * φ y |
| 310 | let B := fun i y => D v (C.drift i) y * φ y |
| 311 | let Z := fun y => D v C.zeroth y * φ y |
| 312 | have TA (i j) : Test U (A i j) := Tφ.mul hU (D_smoothOn hU (hC.1 i j) v) |
| 313 | have TB (i) : Test U (B i) := Tφ.mul hU (D_smoothOn hU (hC.2.1 i) v) |
| 314 | have TZ : Test U Z := Tφ.mul hU (D_smoothOn hU hC.2.2 v) |
| 315 | let SA := fun y => ∑ i, ∑ j, D (spatialDirection j) (D (spatialDirection i) (A i j)) y |
| 316 | let SB := fun y => ∑ i, D (spatialDirection i) (B i) y |
| 317 | have TSA : Test U SA := Test.sum Finset.univ (fun i _ => Test.sum Finset.univ |
| 318 | (fun j _ => ((TA i j).deriv (spatialDirection i)).deriv (spatialDirection j))) |
| 319 | have TSB : Test U SB := Test.sum Finset.univ (fun i _ => (TB i).deriv (spatialDirection i)) |
| 320 | have Tadj : Test U (C.adjoint (D v φ)) := (Tφ.deriv v).adjoint hU hC |
| 321 | have hcancel : pair u (C.adjoint (D v φ)) = pair f (D v φ) := by |
| 322 | simpa only [pair, mul_comm] using |
| 323 | heq (D v φ) (Tφ.deriv v).smooth (Tφ.deriv v).compact (Tφ.deriv v).subset |
| 324 | have hfderiv := weak_pair v hfweak Tφ |
| 325 | have hwtest := weak_pair v hwweak (Tφ.adjoint hU hC) |
| 326 | have hexpand : pair u (D v (C.adjoint φ)) = |
| 327 | pair u (C.adjoint (D v φ)) - pair u SA - pair u SB + pair u Z := by |
| 328 | rw [D_adjoint hU hC Tφ v] |
| 329 | exact (pair_add hu ((Tadj.sub TSA).sub TSB) TZ).trans |
| 330 | (by rw [pair_sub hu (Tadj.sub TSA) TSB, pair_sub hu Tadj TSA]) |
| 331 | have hAweak (i j) : pair u (D (spatialDirection j) (D (spatialDirection i) (A i j))) = |
| 332 | pair (H i j) (A i j) := by |
| 333 | have h1 := weak_pair (spatialDirection j) (hgweak j) ((TA i j).deriv (spatialDirection i)) |
| 334 | have h2 := weak_pair (spatialDirection i) (hHweak i j) (TA i j) |
| 335 | linarith only [h1, h2] |
| 336 | have hBweak (i) : pair u (D (spatialDirection i) (B i)) = -pair (g i) (B i) := by |
| 337 | have h1 := weak_pair (spatialDirection i) (hgweak i) (TB i) |
| 338 | linarith only [h1] |
| 339 | have hSA : pair u SA = ∑ i, ∑ j, pair (H i j) (A i j) := by |
| 340 | rw [show pair u SA = ∑ i, pair u (fun y => |
| 341 | ∑ j, D (spatialDirection j) (D (spatialDirection i) (A i j)) y) from |
| 342 | pair_sum Finset.univ hu (fun i _ => Test.sum Finset.univ |
| 343 | (fun j _ => ((TA i j).deriv (spatialDirection i)).deriv (spatialDirection j)))] |
| 344 | simp_rw [pair_sum Finset.univ hu (fun j _ => |
| 345 | ((TA _ j).deriv (spatialDirection _)).deriv (spatialDirection j)), hAweak] |
| 346 | have hSB : pair u SB = -(∑ i, pair (g i) (B i)) := by |
| 347 | rw [show pair u SB = ∑ i, pair u (D (spatialDirection i) (B i)) from |
| 348 | pair_sum Finset.univ hu (fun i _ => (TB i).deriv (spatialDirection i))] |
| 349 | simp only [hBweak, Finset.sum_neg_distrib] |
| 350 | rw [hexpand, hcancel, hSA, hSB] at hwtest |
| 351 | have hHA (i j) : Integrable (fun y => H i j y * A i j y) := (TA i j).integrable_mul (hH i j) |
| 352 | have hgB (i) : Integrable (fun y => g i y * B i y) := (TB i).integrable_mul (hg i) |
| 353 | have huZ : Integrable (fun y => u y * Z y) := TZ.integrable_mul hu |
| 354 | have hHAs : Integrable (fun y => ∑ i, ∑ j, H i j y * A i j y) := |
| 355 | integrable_finsetSum _ (fun i _ => integrable_finsetSum _ (fun j _ => hHA i j)) |
| 356 | have hgBs : Integrable (fun y => ∑ i, g i y * B i y) := |
| 357 | integrable_finsetSum _ (fun i _ => hgB i) |
| 358 | have hpoint (y) : φ y * ((∑ i, ∑ j, fderiv ℝ (C.principal i j) y v * H i j y) - |
| 359 | (∑ i, fderiv ℝ (C.drift i) y v * g i y) - fderiv ℝ C.zeroth y v * u y) = |
| 360 | (∑ i, ∑ j, H i j y * A i j y) - (∑ i, g i y * B i y) - u y * Z y := by |
| 361 | simp only [A, B, Z, D, mul_sub, Finset.mul_sum] |
| 362 | congr 1 |
| 363 | · congr 1 |
| 364 | · apply Finset.sum_congr rfl |
| 365 | intro i hi |
| 366 | apply Finset.sum_congr rfl |
| 367 | intro j hj |
| 368 | ring |
| 369 | · apply Finset.sum_congr rfl |
| 370 | intro i hi |
| 371 | ring |
| 372 | · ring |
| 373 | have hright : (∫ y, φ y * ((∑ i, ∑ j, fderiv ℝ (C.principal i j) y v * H i j y) - |
| 374 | (∑ i, fderiv ℝ (C.drift i) y v * g i y) - fderiv ℝ C.zeroth y v * u y)) = |
| 375 | (∑ i, ∑ j, pair (H i j) (A i j)) - (∑ i, pair (g i) (B i)) - pair u Z := by |
| 376 | calc |
| 377 | _ = ∫ y, (∑ i, ∑ j, H i j y * A i j y) - (∑ i, g i y * B i y) - u y * Z y := by |
| 378 | apply integral_congr_ae |
| 379 | filter_upwards [] with y |
| 380 | exact hpoint y |
| 381 | _ = _ := by |
| 382 | have h1 := integral_sub (hHAs.sub hgBs) huZ |
| 383 | have h2 := integral_sub hHAs hgBs |
| 384 | simp only [Pi.sub_apply] at h1 h2 |
| 385 | rw [h1, h2, |
| 386 | integral_finsetSum _ (fun i _ => integrable_finsetSum _ (fun j _ => hHA i j)), |
| 387 | integral_finsetSum _ (fun i _ => hgB i)] |
| 388 | simp_rw [integral_finsetSum _ (fun j _ => hHA _ j)] |
| 389 | rfl |
| 390 | have hcommI : Integrable (fun y => φ y * |
| 391 | ((∑ i, ∑ j, fderiv ℝ (C.principal i j) y v * H i j y) - |
| 392 | (∑ i, fderiv ℝ (C.drift i) y v * g i y) - fderiv ℝ C.zeroth y v * u y)) := |
| 393 | ((hHAs.sub hgBs).sub huZ).congr (Filter.Eventually.of_forall fun y => (hpoint y).symm) |
| 394 | have hfull : (∫ y, φ y * (f_v y + |
| 395 | (∑ i, ∑ j, fderiv ℝ (C.principal i j) y v * H i j y) - |
| 396 | (∑ i, fderiv ℝ (C.drift i) y v * g i y) - fderiv ℝ C.zeroth y v * u y)) = |
| 397 | pair f_v φ + ∫ y, φ y * |
| 398 | ((∑ i, ∑ j, fderiv ℝ (C.principal i j) y v * H i j y) - |
| 399 | (∑ i, fderiv ℝ (C.drift i) y v * g i y) - fderiv ℝ C.zeroth y v * u y) := by |
| 400 | calc |
| 401 | _ = ∫ y, f_v y * φ y + φ y * |
| 402 | ((∑ i, ∑ j, fderiv ℝ (C.principal i j) y v * H i j y) - |
| 403 | (∑ i, fderiv ℝ (C.drift i) y v * g i y) - fderiv ℝ C.zeroth y v * u y) := by |
| 404 | apply integral_congr_ae |
| 405 | filter_upwards [] with y |
| 406 | ring |
| 407 | _ = _ := integral_add (Tφ.integrable_mul hf_v) hcommI |
| 408 | rw [hfull, hright] |
| 409 | change pair w (C.adjoint φ) = _ |
| 410 | linarith only [hwtest, hfderiv] |
| 411 | |
| 412 | /-- The homogeneous specialization retains only the coefficient-derivative forcing. -/ |
| 413 | theorem WeakSolutionOn.differentiated_pairing |
| 414 | {n : ℕ} {U : Set (Spacetime n)} (hU : IsOpen U) |
| 415 | {C : Coefficients n} (hC : C.IsSmoothOn U) |
| 416 | {u w : Spacetime n → ℝ} (hu : WeakSolutionOn C u U) |
| 417 | {g : Fin n → Spacetime n → ℝ} |
| 418 | {H : Fin n → Fin n → Spacetime n → ℝ} (v : Spacetime n) |
| 419 | (hg : ∀ i, LocallyIntegrableOn (g i) U volume) |
| 420 | (hH : ∀ i j, LocallyIntegrableOn (H i j) U volume) |
| 421 | (hw : LocallyIntegrableOn w U volume) |
| 422 | (hgweak : ∀ i (ψ : Spacetime n → ℝ), ContDiff ℝ ∞ ψ → |
| 423 | HasCompactSupport ψ → tsupport ψ ⊆ U → |
| 424 | (∫ y in U, ψ y * g i y) = -(∫ y in U, spatialDeriv i ψ y * u y)) |
| 425 | (hHweak : ∀ i j (ψ : Spacetime n → ℝ), ContDiff ℝ ∞ ψ → |
| 426 | HasCompactSupport ψ → tsupport ψ ⊆ U → |
| 427 | (∫ y in U, ψ y * H i j y) = -(∫ y in U, spatialDeriv i ψ y * g j y)) |
| 428 | (hwweak : ∀ ψ : Spacetime n → ℝ, ContDiff ℝ ∞ ψ → |
| 429 | HasCompactSupport ψ → tsupport ψ ⊆ U → |
| 430 | (∫ y in U, ψ y * w y) = -(∫ y in U, fderiv ℝ ψ y v * u y)) |
| 431 | {φ : Spacetime n → ℝ} (hφ : ContDiff ℝ ∞ φ) |
| 432 | (hφc : HasCompactSupport φ) (hφU : tsupport φ ⊆ U) : |
| 433 | (∫ y, w y * C.adjoint φ y) = |
| 434 | ∫ y, φ y * ((∑ i, ∑ j, fderiv ℝ (C.principal i j) y v * H i j y) - |
| 435 | (∑ i, fderiv ℝ (C.drift i) y v * g i y) - fderiv ℝ C.zeroth y v * u y) := by |
| 436 | simpa only [zero_add] using differentiated_inhomogeneous_pairing hU hC hu.1 |
| 437 | (f := fun _ => 0) (f_v := fun _ => 0) locallyIntegrableOn_zero locallyIntegrableOn_zero |
| 438 | (fun ψ hψ hψc hψU => by simpa using hu.2 ψ hψ hψc hψU) |
| 439 | v hg hH hw hgweak hHweak hwweak (fun ψ _ _ _ => by simp) hφ hφc hφU |
| 440 | |
| 441 | end Poincare.Analysis.Parabolic.WeakRegularity.Canonical |
| 442 |