Navier–Stokes: the Lean blow-up proof, cleaned up together
OpenAI's 2026 Lean proofs of blowup for forced Navier–Stokes and Euler, rerun by others, not refereed, no ruling from Clay; cleaned up together: more readable, faster to build

| 1 | import NavierStokes.UniformAngularReset |
| 2 | import NavierStokes.HeatTailEdit |
| 3 | import Mathlib.Tactic.FinCases |
| 4 | |
| 5 | /-! |
| 6 | # Three exact terminal compensation moments |
| 7 | |
| 8 | Three constructed, separated additive bumps in a positive interval repair the |
| 9 | pressure, energy, and angular moments. Factoring out the positive shaped-wait |
| 10 | amplitude leaves one fixed quadratic map, so its smooth inverse and estimates |
| 11 | are uniform in the transverse parameter. |
| 12 | -/ |
| 13 | |
| 14 | noncomputable section |
| 15 | |
| 16 | open Set Function Filter MeasureTheory |
| 17 | open scoped BigOperators ContDiff Topology |
| 18 | |
| 19 | namespace NavierStokes.TerminalCompensation |
| 20 | |
| 21 | abbrev Coeff := Fin 3 → ℝ |
| 22 | |
| 23 | /-- An arbitrary reserved interval in the normalized positive radial coordinate. -/ |
| 24 | structure Patch where |
| 25 | left : ℝ |
| 26 | right : ℝ |
| 27 | left_pos : 0 < left |
| 28 | ordered : left < right |
| 29 | |
| 30 | noncomputable def lower (P : Patch) (j : Fin 3) : ℝ := |
| 31 | P.left + (2 * (j.val : ℝ) + 1) * (P.right - P.left) / 7 |
| 32 | |
| 33 | noncomputable def upper (P : Patch) (j : Fin 3) : ℝ := |
| 34 | P.left + (2 * (j.val : ℝ) + 2) * (P.right - P.left) / 7 |
| 35 | |
| 36 | theorem lower_gt_left (P : Patch) (j : Fin 3) : P.left < lower P j := by |
| 37 | fin_cases j <;> simp only [lower] <;> |
| 38 | norm_num <;> linarith [P.ordered] |
| 39 | |
| 40 | theorem lower_lt_upper (P : Patch) (j : Fin 3) : lower P j < upper P j := by |
| 41 | dsimp [lower, upper] |
| 42 | linarith [P.ordered] |
| 43 | |
| 44 | theorem upper_lt_right (P : Patch) (j : Fin 3) : upper P j < P.right := by |
| 45 | fin_cases j <;> simp only [upper] <;> |
| 46 | norm_num <;> linarith [P.ordered] |
| 47 | |
| 48 | theorem intervals_separated (P : Patch) (i j : Fin 3) (hij : i < j) : |
| 49 | upper P i ≤ lower P j := by |
| 50 | fin_cases i <;> fin_cases j <;> norm_num at hij <;> norm_num <;> |
| 51 | dsimp [upper, lower] <;> norm_num <;> linarith [P.ordered] |
| 52 | |
| 53 | noncomputable def bump (P : Patch) (j : Fin 3) : ℝ → ℝ := |
| 54 | LocalizedMomentRepair.bump (lower P j) (upper P j) |
| 55 | |
| 56 | theorem bump_contDiff (P : Patch) (j : Fin 3) : ContDiff ℝ ∞ (bump P j) := |
| 57 | LocalizedMomentRepair.bump_contDiff _ _ |
| 58 | |
| 59 | theorem bump_tsupport (P : Patch) (j : Fin 3) : |
| 60 | tsupport (bump P j) ⊆ Ioo (lower P j) (upper P j) := |
| 61 | LocalizedMomentRepair.bump_tsupport_subset_open _ _ (lower_lt_upper P j) |
| 62 | |
| 63 | theorem bump_support_patch (P : Patch) (j : Fin 3) : |
| 64 | support (bump P j) ⊆ Icc P.left P.right := by |
| 65 | intro x hx |
| 66 | have ht := bump_tsupport P j (subset_tsupport _ hx) |
| 67 | exact ⟨(lower_gt_left P j).le.trans ht.1.le, |
| 68 | ht.2.le.trans (upper_lt_right P j).le⟩ |
| 69 | |
| 70 | theorem bumps_disjoint (P : Patch) (i j : Fin 3) (hij : i ≠ j) (x : ℝ) : |
| 71 | bump P i x * bump P j x = 0 := by |
| 72 | by_cases hi : bump P i x = 0 |
| 73 | · simp [hi] |
| 74 | by_cases hj : bump P j x = 0 |
| 75 | · simp [hj] |
| 76 | have hix := bump_tsupport P i (subset_tsupport _ hi) |
| 77 | have hjx := bump_tsupport P j (subset_tsupport _ hj) |
| 78 | rcases lt_or_gt_of_ne hij with h | h |
| 79 | · have hs := intervals_separated P i j h |
| 80 | linarith [hix.2, hjx.1] |
| 81 | · have hs := intervals_separated P j i h |
| 82 | linarith [hjx.2, hix.1] |
| 83 | |
| 84 | noncomputable def correction (P : Patch) (c : Coeff) (x : ℝ) : ℝ := |
| 85 | ∑ j, c j * bump P j x |
| 86 | |
| 87 | theorem correction_contDiff (P : Patch) (c : Coeff) : |
| 88 | ContDiff ℝ ∞ (correction P c) := |
| 89 | ContDiff.sum (fun j _ => contDiff_const.mul (bump_contDiff P j)) |
| 90 | |
| 91 | theorem correction_support (P : Patch) (c : Coeff) : |
| 92 | support (correction P c) ⊆ Icc P.left P.right := by |
| 93 | intro x hx |
| 94 | by_contra hnot |
| 95 | apply hx |
| 96 | apply Finset.sum_eq_zero |
| 97 | intro j _ |
| 98 | have hb : bump P j x = 0 := by |
| 99 | by_contra hn |
| 100 | exact hnot (bump_support_patch P j hn) |
| 101 | simp [hb] |
| 102 | |
| 103 | theorem correction_tsupport (P : Patch) (c : Coeff) : |
| 104 | tsupport (correction P c) ⊆ Ioo P.left P.right := by |
| 105 | have hs : support (correction P c) ⊆ LocalizedMomentRepair.repairRegion (lower P) (upper P) := by |
| 106 | intro x hx |
| 107 | by_contra hnot |
| 108 | apply hx |
| 109 | apply Finset.sum_eq_zero |
| 110 | intro j _ |
| 111 | have hb : bump P j x = 0 := by |
| 112 | by_contra hn |
| 113 | exact hnot (mem_iUnion.mpr ⟨j, |
| 114 | LocalizedMomentRepair.bump_support_subset _ _ (lower_lt_upper P j) hn⟩) |
| 115 | simp [hb] |
| 116 | have ht := closure_minimal hs |
| 117 | (LocalizedMomentRepair.repairRegion_isCompact (lower P) (upper P)).isClosed |
| 118 | intro x hx |
| 119 | have hm := LocalizedMomentRepair.repairRegion_subset_open (lower P) (upper P) |
| 120 | (lower_lt_upper P) (ht hx) |
| 121 | obtain ⟨j, hj⟩ := mem_iUnion.mp hm |
| 122 | exact ⟨(lower_gt_left P j).trans hj.1, hj.2.trans (upper_lt_right P j)⟩ |
| 123 | |
| 124 | theorem weighted_integrable (P : Patch) (s : ℝ) (g : ℝ → ℝ) |
| 125 | (hg : Continuous g) (hs : support g ⊆ Icc P.left P.right) : |
| 126 | Integrable (fun x => x ^ s * g x) := by |
| 127 | have hsupport : support (fun x => x ^ s * g x) ⊆ Icc P.left P.right := by |
| 128 | intro x hx |
| 129 | apply hs |
| 130 | intro hz |
| 131 | exact hx (by simp [hz]) |
| 132 | apply (integrableOn_iff_integrable_of_support_subset hsupport).mp |
| 133 | apply ContinuousOn.integrableOn_Icc |
| 134 | apply ContinuousOn.mul _ hg.continuousOn |
| 135 | apply continuousOn_id.rpow_const |
| 136 | intro x hx |
| 137 | exact Or.inl (ne_of_gt (P.left_pos.trans_le hx.1)) |
| 138 | |
| 139 | theorem weighted_bump_integrable (P : Patch) (s : ℝ) (j : Fin 3) : |
| 140 | Integrable (fun x => x ^ s * bump P j x) := |
| 141 | weighted_integrable P s _ (bump_contDiff P j).continuous (bump_support_patch P j) |
| 142 | |
| 143 | theorem weighted_bump_sq_integrable (P : Patch) (s : ℝ) (j : Fin 3) : |
| 144 | Integrable (fun x => x ^ s * (bump P j x) ^ 2) := by |
| 145 | apply weighted_integrable P s _ ((bump_contDiff P j).continuous.pow 2) |
| 146 | intro x hx |
| 147 | apply bump_support_patch P j |
| 148 | intro hz |
| 149 | exact hx (by simp [hz]) |
| 150 | |
| 151 | theorem correction_square (P : Patch) (c : Coeff) (x : ℝ) : |
| 152 | (correction P c x) ^ 2 = ∑ j, (c j) ^ 2 * (bump P j x) ^ 2 := by |
| 153 | have h01 := bumps_disjoint P 0 1 (by decide) x |
| 154 | have h02 := bumps_disjoint P 0 2 (by decide) x |
| 155 | have h12 := bumps_disjoint P 1 2 (by decide) x |
| 156 | simp only [correction, Fin.sum_univ_three] |
| 157 | calc |
| 158 | _ = c 0 ^ 2 * bump P 0 x ^ 2 + c 1 ^ 2 * bump P 1 x ^ 2 + |
| 159 | c 2 ^ 2 * bump P 2 x ^ 2 + |
| 160 | 2 * c 0 * c 1 * (bump P 0 x * bump P 1 x) + |
| 161 | 2 * c 0 * c 2 * (bump P 0 x * bump P 2 x) + |
| 162 | 2 * c 1 * c 2 * (bump P 1 x * bump P 2 x) := by ring |
| 163 | _ = _ := by rw [h01, h02, h12]; ring |
| 164 | |
| 165 | noncomputable def bumpMoment (P : Patch) (s : ℝ) (j : Fin 3) : ℝ := |
| 166 | ∫ x, x ^ s * bump P j x |
| 167 | |
| 168 | noncomputable def squareMoment (P : Patch) (s : ℝ) (j : Fin 3) : ℝ := |
| 169 | ∫ x, x ^ s * (bump P j x) ^ 2 |
| 170 | |
| 171 | theorem correction_moment (P : Patch) (s : ℝ) (c : Coeff) : |
| 172 | (∫ x, x ^ s * correction P c x) = ∑ j, c j * bumpMoment P s j := by |
| 173 | have hf : (fun x => x ^ s * correction P c x) = |
| 174 | (fun x => ∑ j, c j * (x ^ s * bump P j x)) := by |
| 175 | funext x |
| 176 | simp only [correction, Finset.mul_sum] |
| 177 | apply Finset.sum_congr rfl |
| 178 | intro j _ |
| 179 | ring |
| 180 | rw [hf, MeasureTheory.integral_finsetSum] |
| 181 | · simp only [integral_const_mul, bumpMoment] |
| 182 | · intro j _ |
| 183 | exact (weighted_bump_integrable P s j).const_mul _ |
| 184 | |
| 185 | theorem correction_square_moment (P : Patch) (s : ℝ) (c : Coeff) : |
| 186 | (∫ x, x ^ s * (correction P c x) ^ 2) = ∑ j, (c j) ^ 2 * squareMoment P s j := by |
| 187 | have hf : (fun x => x ^ s * (correction P c x) ^ 2) = |
| 188 | (fun x => ∑ j, (c j) ^ 2 * (x ^ s * (bump P j x) ^ 2)) := by |
| 189 | funext x |
| 190 | rw [correction_square, Finset.mul_sum] |
| 191 | apply Finset.sum_congr rfl |
| 192 | intro j _ |
| 193 | ring |
| 194 | rw [hf, MeasureTheory.integral_finsetSum] |
| 195 | · simp only [integral_const_mul, squareMoment] |
| 196 | · intro j _ |
| 197 | exact (weighted_bump_sq_integrable P s j).const_mul _ |
| 198 | |
| 199 | noncomputable def slope (lam : ℝ) : ℝ := -1 / 2 - lam |
| 200 | |
| 201 | noncomputable def powers (lam : ℝ) : Coeff := ![-1 + slope lam, slope lam, 1 / 2] |
| 202 | |
| 203 | theorem powers_injective (lam : ℝ) (hlam : 0 ≤ lam) : Injective (powers lam) := by |
| 204 | intro i j hij |
| 205 | fin_cases i <;> fin_cases j <;> norm_num [powers, slope] at hij <;> norm_num <;> linarith |
| 206 | |
| 207 | noncomputable def linearMatrix (P : Patch) (lam : ℝ) : Matrix (Fin 3) (Fin 3) ℝ := |
| 208 | LocalizedMomentRepair.matrix (powers lam) (lower P) (upper P) |
| 209 | |
| 210 | theorem linearMatrix_entry (P : Patch) (lam : ℝ) (i j : Fin 3) : |
| 211 | linearMatrix P lam i j = bumpMoment P (powers lam i) j := rfl |
| 212 | |
| 213 | /-- The three powers are those of pressure, energy, and angular momentum. -/ |
| 214 | theorem linearMatrix_det_ne_zero (P : Patch) (lam : ℝ) (hlam : 0 ≤ lam) : |
| 215 | (linearMatrix P lam).det ≠ 0 := |
| 216 | LocalizedMomentRepair.matrix_det_ne_zero (powers lam) (lower P) (upper P) |
| 217 | (powers_injective lam hlam) (fun j => P.left_pos.trans (lower_gt_left P j)) |
| 218 | (lower_lt_upper P) (intervals_separated P) |
| 219 | |
| 220 | noncomputable def linearEquiv (P : Patch) (lam : ℝ) (hlam : 0 ≤ lam) : |
| 221 | Coeff ≃L[ℝ] Coeff := |
| 222 | LinearEquiv.toContinuousLinearEquiv |
| 223 | { toFun := (linearMatrix P lam).mulVec |
| 224 | invFun := (linearMatrix P lam)⁻¹.mulVec |
| 225 | map_add' := Matrix.mulVec_add _ |
| 226 | map_smul' := fun r c => Matrix.mulVec_smul _ r c |
| 227 | left_inv := fun c => by |
| 228 | rw [Matrix.mulVec_mulVec, Matrix.nonsing_inv_mul _ |
| 229 | (isUnit_iff_ne_zero.mpr (linearMatrix_det_ne_zero P lam hlam)), Matrix.one_mulVec] |
| 230 | right_inv := fun c => by |
| 231 | rw [Matrix.mulVec_mulVec, Matrix.mul_nonsing_inv _ |
| 232 | (isUnit_iff_ne_zero.mpr (linearMatrix_det_ne_zero P lam hlam)), Matrix.one_mulVec] } |
| 233 | |
| 234 | theorem linearEquiv_apply (P : Patch) (lam : ℝ) (hlam : 0 ≤ lam) (c : Coeff) : |
| 235 | linearEquiv P lam hlam c = (linearMatrix P lam).mulVec c := rfl |
| 236 | |
| 237 | noncomputable def quadraticBilin (P : Patch) : Coeff →ₗ[ℝ] Coeff →ₗ[ℝ] Coeff where |
| 238 | toFun c := |
| 239 | { toFun := fun d => |
| 240 | ![(1 / 2) * ∑ j, squareMoment P (-1) j * c j * d j, |
| 241 | (1 / 2) * ∑ j, squareMoment P 0 j * c j * d j, 0] |
| 242 | map_add' := fun d e => by |
| 243 | ext i |
| 244 | fin_cases i <;> simp [Pi.add_apply, Fin.sum_univ_three] <;> ring |
| 245 | map_smul' := fun r d => by |
| 246 | ext i |
| 247 | fin_cases i <;> simp [Pi.smul_apply, smul_eq_mul, Fin.sum_univ_three] <;> ring } |
| 248 | map_add' c d := by |
| 249 | ext e i |
| 250 | fin_cases i <;> simp [Pi.add_apply, Fin.sum_univ_three] <;> ring |
| 251 | map_smul' r c := by |
| 252 | ext e i |
| 253 | fin_cases i <;> simp [Pi.smul_apply, smul_eq_mul, Fin.sum_univ_three] <;> ring |
| 254 | |
| 255 | noncomputable def quadraticCLM (P : Patch) : Coeff →L[ℝ] Coeff →L[ℝ] Coeff := |
| 256 | LinearMap.toContinuousLinearMap |
| 257 | ((LinearMap.toContinuousLinearMap (𝕜 := ℝ) (E := Coeff) (F' := Coeff)).toLinearMap.comp |
| 258 | (quadraticBilin P)) |
| 259 | |
| 260 | theorem quadraticCLM_apply (P : Patch) (c d : Coeff) : |
| 261 | quadraticCLM P c d = |
| 262 | ![(1 / 2) * ∑ j, squareMoment P (-1) j * c j * d j, |
| 263 | (1 / 2) * ∑ j, squareMoment P 0 j * c j * d j, 0] := rfl |
| 264 | |
| 265 | noncomputable def baseProfile (lam x : ℝ) : ℝ := x ^ slope lam |
| 266 | |
| 267 | /-- One half of a squared-profile change, against a power weight. -/ |
| 268 | noncomputable def weightedChange (P : Patch) (lam : ℝ) (c : Coeff) (w x : ℝ) : ℝ := |
| 269 | x ^ w * ((baseProfile lam x + correction P c x) ^ 2 - (baseProfile lam x) ^ 2) / 2 |
| 270 | |
| 271 | theorem weightedChange_identity (P : Patch) (lam : ℝ) (c : Coeff) (w x : ℝ) : |
| 272 | weightedChange P lam c w x = |
| 273 | x ^ (w + slope lam) * correction P c x + x ^ w * (correction P c x) ^ 2 / 2 := by |
| 274 | by_cases hc : correction P c x = 0 |
| 275 | · simp [weightedChange, hc] |
| 276 | have hx : 0 < x := P.left_pos.trans_le (correction_support P c hc).1 |
| 277 | rw [Real.rpow_add hx] |
| 278 | unfold weightedChange baseProfile |
| 279 | ring |
| 280 | |
| 281 | theorem weighted_correction_integrable (P : Patch) (s : ℝ) (c : Coeff) : |
| 282 | Integrable (fun x => x ^ s * correction P c x) := |
| 283 | weighted_integrable P s _ (correction_contDiff P c).continuous (correction_support P c) |
| 284 | |
| 285 | theorem weighted_correction_sq_integrable (P : Patch) (s : ℝ) (c : Coeff) : |
| 286 | Integrable (fun x => x ^ s * (correction P c x) ^ 2) := by |
| 287 | apply weighted_integrable P s _ ((correction_contDiff P c).continuous.pow 2) |
| 288 | intro x hx |
| 289 | apply correction_support P c |
| 290 | intro hz |
| 291 | exact hx (by simp [hz]) |
| 292 | |
| 293 | theorem weightedChange_integrable (P : Patch) (lam : ℝ) (c : Coeff) (w : ℝ) : |
| 294 | Integrable (weightedChange P lam c w) := by |
| 295 | simp only [funext (weightedChange_identity P lam c w)] |
| 296 | exact (weighted_correction_integrable P (w + slope lam) c).add |
| 297 | ((weighted_correction_sq_integrable P w c).div_const 2) |
| 298 | |
| 299 | theorem weightedChange_integral (P : Patch) (lam : ℝ) (c : Coeff) (w : ℝ) : |
| 300 | (∫ x, weightedChange P lam c w x) = |
| 301 | (∑ j, c j * bumpMoment P (w + slope lam) j) + |
| 302 | (∑ j, (c j) ^ 2 * squareMoment P w j) / 2 := by |
| 303 | simp only [funext (weightedChange_identity P lam c w)] |
| 304 | rw [integral_add (weighted_correction_integrable P (w + slope lam) c) |
| 305 | ((weighted_correction_sq_integrable P w c).div_const 2), integral_div, |
| 306 | correction_moment, correction_square_moment] |
| 307 | |
| 308 | /-- Actual normalized pressure, energy, and angular moment changes. -/ |
| 309 | noncomputable def momentMap (P : Patch) (lam : ℝ) (c : Coeff) : Coeff := |
| 310 | ![∫ x, weightedChange P lam c (-1) x, |
| 311 | ∫ x, weightedChange P lam c 0 x, |
| 312 | ∫ x, x ^ (1 / 2 : ℝ) * correction P c x] |
| 313 | |
| 314 | theorem momentMap_identity (P : Patch) (lam : ℝ) (hlam : 0 ≤ lam) (c : Coeff) : |
| 315 | linearEquiv P lam hlam c + quadraticCLM P c c = momentMap P lam c := by |
| 316 | rw [linearEquiv_apply, quadraticCLM_apply] |
| 317 | ext i |
| 318 | fin_cases i <;> |
| 319 | simp [momentMap, weightedChange_integral, correction_moment, Matrix.mulVec, dotProduct, |
| 320 | linearMatrix_entry, powers, Fin.sum_univ_three] <;> ring |
| 321 | |
| 322 | theorem correction_iteratedDeriv (P : Patch) (c : Coeff) (k : ℕ) (x : ℝ) : |
| 323 | iteratedDeriv k (correction P c) x = ∑ j, c j * iteratedDeriv k (bump P j) x := by |
| 324 | change iteratedDeriv k (fun y => ∑ j, c j * bump P j y) x = _ |
| 325 | rw [LocalizedMomentRepair.iteratedDeriv_finite_sum Finset.univ |
| 326 | (fun j x => c j * bump P j x) |
| 327 | (fun j => contDiff_const.mul (bump_contDiff P j)) k x] |
| 328 | apply Finset.sum_congr rfl |
| 329 | intro j _ |
| 330 | exact iteratedDeriv_const_mul |
| 331 | (c j) ((bump_contDiff P j).of_le |
| 332 | (by exact_mod_cast (le_top : (k : ℕ∞) ≤ ⊤))).contDiffAt |
| 333 | |
| 334 | theorem correction_derivative_bound (P : Patch) (k : ℕ) : |
| 335 | ∃ C : ℝ, 0 ≤ C ∧ ∀ (c : Coeff) (x : ℝ), |
| 336 | |iteratedDeriv k (correction P c) x| ≤ C * ‖c‖ := by |
| 337 | have hb : ∀ j : Fin 3, ∃ C : ℝ, 0 ≤ C ∧ ∀ x, |
| 338 | |iteratedDeriv k (bump P j) x| ≤ C := fun j => |
| 339 | LocalizedMomentRepair.smooth_compact_derivative_bound _ (bump_contDiff P j) |
| 340 | (HasCompactSupport.of_support_subset_isCompact isCompact_Icc (bump_support_patch P j)) k |
| 341 | choose C hC hbound using hb |
| 342 | refine ⟨∑ j, C j, Finset.sum_nonneg (fun j _ => hC j), fun c x => ?_⟩ |
| 343 | rw [correction_iteratedDeriv] |
| 344 | calc |
| 345 | |∑ j, c j * iteratedDeriv k (bump P j) x| ≤ |
| 346 | ∑ j, |c j * iteratedDeriv k (bump P j) x| := Finset.abs_sum_le_sum_abs _ _ |
| 347 | _ ≤ ∑ j, ‖c‖ * C j := by |
| 348 | apply Finset.sum_le_sum |
| 349 | intro j _ |
| 350 | rw [abs_mul] |
| 351 | apply mul_le_mul _ (hbound j x) (abs_nonneg _) (norm_nonneg _) |
| 352 | simpa only [Real.norm_eq_abs] using norm_le_pi_norm c j |
| 353 | _ = (∑ j, C j) * ‖c‖ := by rw [← Finset.mul_sum, mul_comm] |
| 354 | |
| 355 | theorem correction_first_jet_bound (P : Patch) : |
| 356 | ∃ D : ℝ, 0 < D ∧ ∀ (c : Coeff) (x : ℝ), |
| 357 | |correction P c x| ≤ D * ‖c‖ ∧ |deriv (correction P c) x| ≤ D * ‖c‖ := by |
| 358 | obtain ⟨C₀, hC₀, hb₀⟩ := correction_derivative_bound P 0 |
| 359 | obtain ⟨C₁, hC₁, hb₁⟩ := correction_derivative_bound P 1 |
| 360 | refine ⟨C₀ + C₁ + 1, by linarith, fun c x => ⟨?_, ?_⟩⟩ |
| 361 | · exact (hb₀ c x).trans (mul_le_mul_of_nonneg_right (by linarith) (norm_nonneg c)) |
| 362 | · have ht : |iteratedDeriv 1 (correction P c) x| ≤ (C₀ + C₁ + 1) * ‖c‖ := |
| 363 | (hb₁ c x).trans (mul_le_mul_of_nonneg_right (by linarith) (norm_nonneg c)) |
| 364 | simpa only [iteratedDeriv_one] using ht |
| 365 | |
| 366 | theorem baseProfile_positive (lam : ℝ) {x : ℝ} (hx : 0 < x) : |
| 367 | 0 < baseProfile lam x := Real.rpow_pos_of_pos hx _ |
| 368 | |
| 369 | theorem baseProfile_lower_bound (P : Patch) (lam : ℝ) : |
| 370 | ∃ m : ℝ, 0 < m ∧ ∀ x ∈ Icc P.left P.right, m ≤ baseProfile lam x := by |
| 371 | apply isCompact_Icc.exists_forall_le' |
| 372 | · apply continuousOn_id.rpow_const |
| 373 | intro x hx |
| 374 | exact Or.inl (ne_of_gt (P.left_pos.trans_le hx.1)) |
| 375 | · intro x hx |
| 376 | exact baseProfile_positive lam (P.left_pos.trans_le hx.1) |
| 377 | |
| 378 | /-- A single smooth inverse repairs all three actual moments and has uniform |
| 379 | value, derivative, and spatial first-jet bounds. Smallness also preserves positivity. -/ |
| 380 | theorem exists_normalized_compensation (P : Patch) (lam : ℝ) (hlam : 0 ≤ lam) : |
| 381 | ∃ (g : Coeff → Coeff) (ε C : ℝ), 0 < ε ∧ 0 < C ∧ |
| 382 | ContDiffOn ℝ ∞ g (Metric.ball 0 ε) ∧ g 0 = 0 ∧ |
| 383 | ∀ d ∈ Metric.ball (0 : Coeff) ε, |
| 384 | momentMap P lam (g d) = d ∧ ‖g d‖ ≤ C * ‖d‖ ∧ ‖fderiv ℝ g d‖ ≤ C ∧ |
| 385 | ∀ x : ℝ, |
| 386 | (|correction P (g d) x| ≤ C * ‖d‖ ∧ |
| 387 | |deriv (correction P (g d)) x| ≤ C * ‖d‖) ∧ |
| 388 | (0 < x → 0 < baseProfile lam x + correction P (g d) x) := by |
| 389 | let B := linearEquiv P lam hlam |
| 390 | let A := quadraticCLM P |
| 391 | let β : ℝ := ‖B.symm.toContinuousLinearMap‖ + 1 |
| 392 | let K : ℝ := ‖A‖ + 1 |
| 393 | let r : ℝ := 1 / (4 * β * K) |
| 394 | have hβ : 0 < β := by dsimp [β]; positivity |
| 395 | have hK : 0 < K := by dsimp [K]; positivity |
| 396 | have hr : 0 < r := by dsimp [r]; positivity |
| 397 | have hinv : ∀ v, ‖B.symm v‖ ≤ β * ‖v‖ := by |
| 398 | intro v |
| 399 | exact (B.symm.toContinuousLinearMap.le_opNorm v).trans |
| 400 | (mul_le_mul_of_nonneg_right (by dsimp [β]; linarith) (norm_nonneg v)) |
| 401 | have hA : ‖A‖ ≤ K := by dsimp [K]; linarith |
| 402 | have hsmall : 4 * β * K * r ≤ 1 := by dsimp [r]; field_simp ; rfl |
| 403 | obtain ⟨g, hg, hgeq, hglip⟩ := UniformAngularReset.exists_smooth_solver_on_ball |
| 404 | B A β K r hβ hK.le hr hinv hA hsmall |
| 405 | obtain ⟨D, hD, hjet⟩ := correction_first_jet_bound P |
| 406 | obtain ⟨m, hm, hmin⟩ := baseProfile_lower_bound P lam |
| 407 | let C : ℝ := (1 + D) * (2 * β) |
| 408 | let ε : ℝ := min (r / (4 * β)) (m / (2 * C)) |
| 409 | have hC : 0 < C := mul_pos (by linarith) (by positivity) |
| 410 | have hε : 0 < ε := lt_min (div_pos hr (by positivity)) (div_pos hm (by positivity)) |
| 411 | have hsub : Metric.ball (0 : Coeff) ε ⊆ Metric.ball 0 (r / (4 * β)) := |
| 412 | Metric.ball_subset_ball (min_le_left _ _) |
| 413 | have hC₀ : 2 * β ≤ C := by dsimp [C]; nlinarith |
| 414 | have hC₁ : D * (2 * β) ≤ C := by dsimp [C]; linarith |
| 415 | have hzero : g 0 = 0 := by |
| 416 | have hz := (hgeq 0 (Metric.mem_ball_self (div_pos hr (by positivity)))).2 |
| 417 | simpa only [norm_zero, mul_zero, norm_le_zero_iff] using hz |
| 418 | refine ⟨g, ε, C, hε, hC, hg.mono hsub, hzero, ?_⟩ |
| 419 | intro d hd |
| 420 | have hnorm : ‖g d‖ ≤ (2 * β) * ‖d‖ := (hgeq d (hsub hd)).2 |
| 421 | have hbound : D * ‖g d‖ ≤ C * ‖d‖ := |
| 422 | (mul_le_mul_of_nonneg_left hnorm hD.le).trans |
| 423 | (by simpa only [mul_assoc] using mul_le_mul_of_nonneg_right hC₁ (norm_nonneg d)) |
| 424 | have heq := (hgeq d (hsub hd)).1 |
| 425 | change linearEquiv P lam hlam (g d) + quadraticCLM P (g d) (g d) = d at heq |
| 426 | rw [momentMap_identity] at heq |
| 427 | refine ⟨heq, hnorm.trans (mul_le_mul_of_nonneg_right hC₀ (norm_nonneg d)), ?_, ?_⟩ |
| 428 | · apply le_trans _ hC₀ |
| 429 | apply norm_fderiv_le_of_lip' ℝ (by positivity : 0 ≤ 2 * β) |
| 430 | filter_upwards [Metric.isOpen_ball.mem_nhds (hsub hd)] with e he |
| 431 | exact hglip e he d (hsub hd) |
| 432 | · intro x |
| 433 | have hval := (hjet (g d) x).1.trans hbound |
| 434 | refine ⟨⟨hval, (hjet (g d) x).2.trans hbound⟩, ?_⟩ |
| 435 | intro hx |
| 436 | by_cases hc : correction P (g d) x = 0 |
| 437 | · simpa only [hc, add_zero] using baseProfile_positive lam hx |
| 438 | have hbase := hmin x (correction_support P (g d) hc) |
| 439 | have hd' : ‖d‖ < ε := by simpa only [Metric.mem_ball, dist_zero_right] using hd |
| 440 | have hsize : C * ‖d‖ < m / 2 := by |
| 441 | have ht := mul_lt_mul_of_pos_left (hd'.trans_le (min_le_right _ _)) hC |
| 442 | have hcancel : C * (m / (2 * C)) = m / 2 := by field_simp |
| 443 | rwa [hcancel] at ht |
| 444 | have hlow := neg_abs_le (correction P (g d) x) |
| 445 | linarith |
| 446 | |
| 447 | /-- Evaluation of the finite bump combination is an actual bounded linear map. -/ |
| 448 | noncomputable def correctionCLM (P : Patch) (x : ℝ) : Coeff →L[ℝ] ℝ := |
| 449 | LinearMap.toContinuousLinearMap |
| 450 | { toFun := fun c => correction P c x |
| 451 | map_add' := fun c d => by |
| 452 | simp only [correction, Pi.add_apply, add_mul, Finset.sum_add_distrib] |
| 453 | map_smul' := fun r c => by |
| 454 | simp only [correction, Pi.smul_apply, smul_eq_mul, mul_assoc, Finset.mul_sum, |
| 455 | RingHom.id_apply] } |
| 456 | |
| 457 | theorem correction_family_contDiffOn (P : Patch) {U : Set ℝ} {c : ℝ → Coeff} |
| 458 | (hc : ContDiffOn ℝ ∞ c U) : |
| 459 | ContDiffOn ℝ ∞ (fun z : ℝ × ℝ => correction P (c z.1) z.2) (U ×ˢ univ) := by |
| 460 | apply ContDiffOn.sum |
| 461 | intro j _ |
| 462 | exact ((contDiffOn_pi.mp hc j).comp contDiffOn_fst (fun z hz => hz.1)).mul |
| 463 | ((bump_contDiff P j).comp_contDiffOn contDiffOn_snd) |
| 464 | |
| 465 | /-- The physical profile uses the actual additive bumps at scale `R`. -/ |
| 466 | noncomputable def physicalProfile (P : Patch) (lam R a : ℝ) (c : Coeff) (X : ℝ) : ℝ := |
| 467 | a * (baseProfile lam (X / R) + correction P c (X / R)) |
| 468 | |
| 469 | noncomputable def cleanProfile (lam R a X : ℝ) : ℝ := a * baseProfile lam (X / R) |
| 470 | |
| 471 | noncomputable def physicalMoments (P : Patch) (lam R a : ℝ) (c : Coeff) : Coeff := |
| 472 | ![∫ X, ((physicalProfile P lam R a c X) ^ 2 - (cleanProfile lam R a X) ^ 2) / X, |
| 473 | ∫ X, (physicalProfile P lam R a c X) ^ 2 - (cleanProfile lam R a X) ^ 2, |
| 474 | ∫ X, Real.sqrt (2 * X) * (physicalProfile P lam R a c X - cleanProfile lam R a X)] |
| 475 | |
| 476 | theorem integral_rescale (R : ℝ) (hR : 0 < R) (F : ℝ → ℝ) : |
| 477 | (∫ X, F X) = R * ∫ x, F (R * x) := by |
| 478 | rw [Measure.integral_comp_mul_left, abs_of_pos (inv_pos.mpr hR), smul_eq_mul] |
| 479 | field_simp |
| 480 | |
| 481 | theorem pressure_density_rescale (P : Patch) (lam R a : ℝ) (hR : 0 < R) |
| 482 | (c : Coeff) (x : ℝ) : |
| 483 | ((physicalProfile P lam R a c (R * x)) ^ 2 - (cleanProfile lam R a (R * x)) ^ 2) / |
| 484 | (R * x) = (2 * a ^ 2 / R) * weightedChange P lam c (-1) x := by |
| 485 | simp only [physicalProfile, cleanProfile, mul_div_cancel_left₀ x hR.ne', |
| 486 | weightedChange, Real.rpow_neg_one, div_eq_mul_inv, mul_inv_rev] |
| 487 | ring |
| 488 | |
| 489 | theorem energy_density_rescale (P : Patch) (lam R a : ℝ) (hR : 0 < R) |
| 490 | (c : Coeff) (x : ℝ) : |
| 491 | (physicalProfile P lam R a c (R * x)) ^ 2 - (cleanProfile lam R a (R * x)) ^ 2 = |
| 492 | (2 * a ^ 2) * weightedChange P lam c 0 x := by |
| 493 | simp only [physicalProfile, cleanProfile, mul_div_cancel_left₀ x hR.ne', |
| 494 | weightedChange, Real.rpow_zero] |
| 495 | ring |
| 496 | |
| 497 | theorem angular_density_rescale (P : Patch) (lam R a : ℝ) (hR : 0 < R) |
| 498 | (c : Coeff) (x : ℝ) : |
| 499 | Real.sqrt (2 * (R * x)) * |
| 500 | (physicalProfile P lam R a c (R * x) - cleanProfile lam R a (R * x)) = |
| 501 | (Real.sqrt (2 * R) * a) * (x ^ (1 / 2 : ℝ) * correction P c x) := by |
| 502 | simp only [physicalProfile, cleanProfile, mul_div_cancel_left₀ x hR.ne'] |
| 503 | rw [← mul_assoc, Real.sqrt_mul (by positivity : 0 ≤ 2 * R)] |
| 504 | simp only [Real.sqrt_eq_rpow] |
| 505 | ring |
| 506 | |
| 507 | /-- The normalization constants follow from the actual change of variable `X=R*x`. -/ |
| 508 | theorem physicalMoments_eq (P : Patch) (lam R a : ℝ) (hR : 0 < R) (c : Coeff) : |
| 509 | physicalMoments P lam R a c = |
| 510 | ![2 * a ^ 2 * momentMap P lam c 0, |
| 511 | 2 * R * a ^ 2 * momentMap P lam c 1, |
| 512 | R * Real.sqrt (2 * R) * a * momentMap P lam c 2] := by |
| 513 | ext i |
| 514 | fin_cases i |
| 515 | · change (∫ X, ((physicalProfile P lam R a c X) ^ 2 - (cleanProfile lam R a X) ^ 2) / X) = |
| 516 | 2 * a ^ 2 * ∫ x, weightedChange P lam c (-1) x |
| 517 | rw [integral_rescale R hR] |
| 518 | simp only [pressure_density_rescale P lam R a hR c, integral_const_mul] |
| 519 | field_simp |
| 520 | · change (∫ X, (physicalProfile P lam R a c X) ^ 2 - (cleanProfile lam R a X) ^ 2) = |
| 521 | 2 * R * a ^ 2 * ∫ x, weightedChange P lam c 0 x |
| 522 | rw [integral_rescale R hR] |
| 523 | simp only [energy_density_rescale P lam R a hR c, integral_const_mul] |
| 524 | ring |
| 525 | · change (∫ X, Real.sqrt (2 * X) * |
| 526 | (physicalProfile P lam R a c X - cleanProfile lam R a X)) = |
| 527 | R * Real.sqrt (2 * R) * a * ∫ x, x ^ (1 / 2 : ℝ) * correction P c x |
| 528 | rw [integral_rescale R hR] |
| 529 | simp only [angular_density_rescale P lam R a hR c, integral_const_mul] |
| 530 | ring |
| 531 | |
| 532 | noncomputable def normalizationFactors (R a : ℝ) : Coeff := |
| 533 | ![(2 * a ^ 2)⁻¹, (2 * R * a ^ 2)⁻¹, (R * Real.sqrt (2 * R) * a)⁻¹] |
| 534 | |
| 535 | /-- Signed debts are negated so that their sum with the patch changes is zero. -/ |
| 536 | noncomputable def normalizedDebt (R a : ℝ) (d : Coeff) : Coeff := |
| 537 | -(normalizationFactors R a * d) |
| 538 | |
| 539 | theorem physicalMoments_cancel (P : Patch) (lam R a : ℝ) (hR : 0 < R) (ha : 0 < a) |
| 540 | (c d : Coeff) (heq : momentMap P lam c = normalizedDebt R a d) : |
| 541 | physicalMoments P lam R a c + d = 0 := by |
| 542 | have hs : Real.sqrt (2 * R) ≠ 0 := ne_of_gt (Real.sqrt_pos.2 (by positivity)) |
| 543 | have cancel (t y : ℝ) (ht : t ≠ 0) : t * (-(t⁻¹ * y)) + y = 0 := by |
| 544 | rw [mul_neg, ← mul_assoc, mul_inv_cancel₀ ht, one_mul, neg_add_cancel] |
| 545 | rw [physicalMoments_eq P lam R a hR c, heq] |
| 546 | ext i |
| 547 | fin_cases i |
| 548 | · exact cancel (2 * a ^ 2) (d 0) (by positivity) |
| 549 | · exact cancel (2 * R * a ^ 2) (d 1) (by positivity) |
| 550 | · exact cancel (R * Real.sqrt (2 * R) * a) (d 2) (by positivity) |
| 551 | |
| 552 | /-- Radial normalization, independent of the shaped-wait amplitude. -/ |
| 553 | noncomputable def scaledDebt (R : ℝ) (d : Coeff) : Coeff := |
| 554 | ![d 0, d 1 / R, d 2 / (R * Real.sqrt (2 * R))] |
| 555 | |
| 556 | noncomputable def amplitudeFactors (a : ℝ) : Coeff := |
| 557 | ![(2 * a ^ 2)⁻¹, (2 * a ^ 2)⁻¹, a⁻¹] |
| 558 | |
| 559 | noncomputable def amplitudeDebt (a : ℝ) (v : Coeff) : Coeff := -(amplitudeFactors a * v) |
| 560 | |
| 561 | theorem normalizedDebt_eq (R a : ℝ) (d : Coeff) : |
| 562 | normalizedDebt R a d = amplitudeDebt a (scaledDebt R d) := by |
| 563 | ext i |
| 564 | fin_cases i <;> simp [normalizedDebt, normalizationFactors, amplitudeDebt, amplitudeFactors, |
| 565 | scaledDebt, div_eq_mul_inv, mul_comm, mul_left_comm, mul_assoc] |
| 566 | |
| 567 | theorem amplitudeFactors_contDiffOn {U : Set ℝ} {a : ℝ → ℝ} |
| 568 | (ha : ContDiffOn ℝ ∞ a U) (hpos : ∀ η ∈ U, 0 < a η) : |
| 569 | ContDiffOn ℝ ∞ (fun η => amplitudeFactors (a η)) U := by |
| 570 | apply contDiffOn_pi.mpr |
| 571 | intro i |
| 572 | fin_cases i |
| 573 | · exact (contDiffOn_const.mul (ha.pow 2)).inv (fun η hη => by have := hpos η hη; positivity) |
| 574 | · exact (contDiffOn_const.mul (ha.pow 2)).inv (fun η hη => by have := hpos η hη; positivity) |
| 575 | · exact ha.inv (fun η hη => (hpos η hη).ne') |
| 576 | |
| 577 | /-- The value, normalized radial derivative, and parameter derivative of the |
| 578 | actual additive profile perturbation are all small. -/ |
| 579 | noncomputable def FirstJetBound (P : Patch) (a : ℝ → ℝ) (c : ℝ → Coeff) |
| 580 | (η L : ℝ) : Prop := |
| 581 | ∀ x : ℝ, |a η * correction P (c η) x| ≤ L ∧ |
| 582 | |a η * deriv (correction P (c η)) x| ≤ L ∧ |
| 583 | |deriv (fun θ => a θ * correction P (c θ) x) η| ≤ L |
| 584 | |
| 585 | theorem physicalProfile_eq_clean_outside (P : Patch) (lam R a : ℝ) (c : Coeff) (X : ℝ) |
| 586 | (hX : X / R ∉ Ioo P.left P.right) : |
| 587 | physicalProfile P lam R a c X = cleanProfile lam R a X := by |
| 588 | have hz : correction P c (X / R) = 0 := by |
| 589 | by_contra hn |
| 590 | exact hX (correction_tsupport P c (subset_tsupport _ hn)) |
| 591 | simp only [physicalProfile, cleanProfile, hz, add_zero] |
| 592 | |
| 593 | theorem FirstJetBound.mono {P : Patch} {a : ℝ → ℝ} {c : ℝ → Coeff} {η L M : ℝ} |
| 594 | (h : FirstJetBound P a c η L) (hLM : L ≤ M) : FirstJetBound P a c η M := by |
| 595 | intro x |
| 596 | exact ⟨(h x).1.trans hLM, (h x).2.1.trans hLM, (h x).2.2.trans hLM⟩ |
| 597 | |
| 598 | /-- All three physical moment changes are genuine integrable functions. -/ |
| 599 | theorem physicalMoments_integrable (P : Patch) (lam R a : ℝ) (hR : 0 < R) (c : Coeff) : |
| 600 | Integrable (fun X => ((physicalProfile P lam R a c X) ^ 2 - |
| 601 | (cleanProfile lam R a X) ^ 2) / X) ∧ |
| 602 | Integrable (fun X => (physicalProfile P lam R a c X) ^ 2 - |
| 603 | (cleanProfile lam R a X) ^ 2) ∧ |
| 604 | Integrable (fun X => Real.sqrt (2 * X) * |
| 605 | (physicalProfile P lam R a c X - cleanProfile lam R a X)) := by |
| 606 | refine ⟨?_, ?_, ?_⟩ |
| 607 | · apply (integrable_comp_mul_left_iff _ hR.ne').mp |
| 608 | simp only [pressure_density_rescale P lam R a hR c] |
| 609 | exact (weightedChange_integrable P lam c (-1)).const_mul _ |
| 610 | · apply (integrable_comp_mul_left_iff _ hR.ne').mp |
| 611 | simp only [energy_density_rescale P lam R a hR c] |
| 612 | exact (weightedChange_integrable P lam c 0).const_mul _ |
| 613 | · apply (integrable_comp_mul_left_iff _ hR.ne').mp |
| 614 | simp only [angular_density_rescale P lam R a hR c] |
| 615 | exact (weighted_correction_integrable P (1 / 2) c).const_mul _ |
| 616 | |
| 617 | theorem physicalProfile_eq_clean_of_nonpos (P : Patch) (lam R a : ℝ) (hR : 0 < R) |
| 618 | (c : Coeff) {X : ℝ} (hX : X ≤ 0) : |
| 619 | physicalProfile P lam R a c X = cleanProfile lam R a X := by |
| 620 | apply physicalProfile_eq_clean_outside |
| 621 | intro hx |
| 622 | have hdiv := div_nonpos_of_nonpos_of_nonneg hX hR.le |
| 623 | linarith [hx.1, P.left_pos] |
| 624 | |
| 625 | /-- The whole-line definitions equal the usual positive-radius moment integrals. -/ |
| 626 | theorem physicalMoments_positive_radius (P : Patch) (lam R a : ℝ) (hR : 0 < R) (c : Coeff) : |
| 627 | physicalMoments P lam R a c = |
| 628 | ![∫ X in Ioi 0, ((physicalProfile P lam R a c X) ^ 2 - (cleanProfile lam R a X) ^ 2) / X, |
| 629 | ∫ X in Ioi 0, (physicalProfile P lam R a c X) ^ 2 - (cleanProfile lam R a X) ^ 2, |
| 630 | ∫ X in Ioi 0, Real.sqrt (2 * X) * |
| 631 | (physicalProfile P lam R a c X - cleanProfile lam R a X)] := by |
| 632 | ext i |
| 633 | fin_cases i <;> symm <;> |
| 634 | apply setIntegral_eq_integral_of_forall_compl_eq_zero <;> |
| 635 | intro X hX <;> |
| 636 | rw [physicalProfile_eq_clean_of_nonpos P lam R a hR c (le_of_not_gt hX)] <;> simp |
| 637 | |
| 638 | end NavierStokes.TerminalCompensation |