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.OutgoingTail |
| 2 | import NavierStokes.ParametricRephase |
| 3 | import Mathlib.Analysis.SpecialFunctions.ImproperIntegrals |
| 4 | import Mathlib.Analysis.Calculus.ParametricIntervalIntegral |
| 5 | |
| 6 | /-! |
| 7 | # Energy of the constructed outgoing tail |
| 8 | |
| 9 | The integrands in this file are the actual `OutgoingTail.finalAngular`. |
| 10 | The long release plateau is retained in the estimates; bounding the release |
| 11 | only by its terminal slope would give an incorrect uniformity claim in `h`. |
| 12 | -/ |
| 13 | |
| 14 | noncomputable section |
| 15 | |
| 16 | open Set Filter MeasureTheory |
| 17 | open scoped Topology ContDiff |
| 18 | open NavierStokes.OutgoingSchedule NavierStokes.OutgoingTail |
| 19 | |
| 20 | namespace NavierStokes.TailEnergyBounds |
| 21 | |
| 22 | noncomputable def energyDensity (d : TailData) (eta y : ℝ) : ℝ := |
| 23 | Real.exp y * finalAngular d (y, eta) ^ 2 |
| 24 | |
| 25 | theorem energyDensity_pos (d : TailData) (eta y : ℝ) : |
| 26 | 0 < energyDensity d eta y := |
| 27 | mul_pos (Real.exp_pos _) (sq_pos_of_pos (finalAngular_pos d _)) |
| 28 | |
| 29 | theorem energyDensity_continuous (d : TailData) (eta : ℝ) : |
| 30 | Continuous (energyDensity d eta) := |
| 31 | Real.continuous_exp.mul |
| 32 | (((finalAngular_contDiff d).continuous.comp |
| 33 | (continuous_id.prodMk continuous_const)).pow 2) |
| 34 | |
| 35 | noncomputable def releasePrimitive (d : TailData) : ℝ → ℝ := |
| 36 | primitive (releaseSlope d) |
| 37 | |
| 38 | theorem releaseAdjustment_eq (d : TailData) (t : ℝ) : |
| 39 | releaseAdjustment d t = releasePrimitive d t + d.core.lam * t := by |
| 40 | unfold releaseAdjustment releasePrimitive primitive |
| 41 | rw [intervalIntegral.integral_add |
| 42 | ((releaseSlope_contDiff d).continuous.intervalIntegrable 0 t) |
| 43 | (continuous_const.intervalIntegrable 0 t)] |
| 44 | simp [mul_comm] |
| 45 | |
| 46 | theorem primitive_increment_le {g : ℝ → ℝ} (hg : Continuous g) |
| 47 | {a b c : ℝ} (hab : a ≤ b) (hc : ∀ t ∈ Icc a b, g t ≤ c) : |
| 48 | primitive g b ≤ primitive g a + (b - a) * c := by |
| 49 | have hi : (∫ t in a..b, g t) ≤ ∫ _t in a..b, c := intervalIntegral.integral_mono_on hab |
| 50 | (hg.intervalIntegrable a b) (continuous_const.intervalIntegrable a b) hc |
| 51 | have hadd := intervalIntegral.integral_add_adjacent_intervals (μ := volume) |
| 52 | (hg.intervalIntegrable 0 a) (hg.intervalIntegrable a b) |
| 53 | simp only [intervalIntegral.integral_const, smul_eq_mul] at hi |
| 54 | unfold primitive |
| 55 | linarith |
| 56 | |
| 57 | theorem releasePrimitive_increment_le (d : TailData) {a b : ℝ} (hab : a ≤ b) : |
| 58 | releasePrimitive d b ≤ releasePrimitive d a - d.h * (b - a) := by |
| 59 | have h := primitive_increment_le (releaseSlope_contDiff d).continuous hab |
| 60 | (c := -d.h) (fun t _ => (releaseSlope_bounds d t).2) |
| 61 | change primitive (releaseSlope d) b ≤ primitive (releaseSlope d) a - d.h * (b - a) |
| 62 | linarith |
| 63 | |
| 64 | @[simp] theorem releasePrimitive_zero (d : TailData) : releasePrimitive d 0 = 0 := by |
| 65 | simp [releasePrimitive, primitive] |
| 66 | |
| 67 | theorem releasePrimitive_nonpos (d : TailData) {t : ℝ} (ht : 0 ≤ t) : |
| 68 | releasePrimitive d t ≤ 0 := by |
| 69 | have h := releasePrimitive_increment_le d ht |
| 70 | simp only [releasePrimitive_zero, sub_zero, zero_sub] at h |
| 71 | exact h.trans (neg_nonpos.mpr (mul_nonneg d.h_pos.le ht)) |
| 72 | |
| 73 | theorem releasePrimitive_plateau_le (d : TailData) {t : ℝ} |
| 74 | (ht : 0 ≤ t) (ht' : t ≤ d.secondRampStart) : |
| 75 | releasePrimitive d t ≤ 1 - t := by |
| 76 | by_cases h1 : t ≤ 1 |
| 77 | · exact (releasePrimitive_nonpos d ht).trans (sub_nonneg.mpr h1) |
| 78 | · have h1' : 1 ≤ t := le_of_not_ge h1 |
| 79 | have hinc := primitive_increment (releaseSlope_contDiff d).continuous 1 t (-1) |
| 80 | (fun v hv => releaseSlope_plateau d (uIcc_of_le h1' ▸ hv).1 |
| 81 | ((uIcc_of_le h1' ▸ hv).2.trans ht')) |
| 82 | change releasePrimitive d t = releasePrimitive d 1 + (t - 1) * (-1) at hinc |
| 83 | linarith [releasePrimitive_nonpos d (by norm_num : (0 : ℝ) ≤ 1)] |
| 84 | |
| 85 | theorem releasePrimitive_late_le (d : TailData) {t : ℝ} |
| 86 | (ht : d.secondRampStart ≤ t) : |
| 87 | releasePrimitive d t ≤ -d.longHold - d.h * (t - d.secondRampStart) := by |
| 88 | have hb : 0 ≤ d.secondRampStart := by |
| 89 | dsimp [TailData.secondRampStart] |
| 90 | linarith [d.longHold_pos] |
| 91 | have hp := releasePrimitive_plateau_le d hb le_rfl |
| 92 | have hi := releasePrimitive_increment_le d ht |
| 93 | have hb' : 1 - d.secondRampStart = -d.longHold := by |
| 94 | dsimp [TailData.secondRampStart] |
| 95 | ring |
| 96 | rw [hb'] at hp |
| 97 | linarith |
| 98 | |
| 99 | theorem plateau_suppression (d : TailData) : |
| 100 | Real.exp (-2 * d.longHold) = d.h ^ 8 := by |
| 101 | have he : Real.exp (Real.log d.h) = d.h := Real.exp_log d.h_pos |
| 102 | calc |
| 103 | Real.exp (-2 * d.longHold) = Real.exp (8 * Real.log d.h) := by |
| 104 | congr 1 |
| 105 | simp only [TailData.longHold, one_div, Real.log_inv] |
| 106 | ring |
| 107 | _ = (Real.exp (Real.log d.h)) ^ 8 := by |
| 108 | simpa using Real.exp_nat_mul (Real.log d.h) 8 |
| 109 | _ = _ := by rw [he] |
| 110 | |
| 111 | theorem h_secondRampStart_le (d : TailData) : d.h * d.secondRampStart ≤ 4 := by |
| 112 | have hi := Real.log_le_sub_one_of_pos (one_div_pos.mpr d.h_pos) |
| 113 | have hi' := mul_le_mul_of_nonneg_left hi d.h_pos.le |
| 114 | have hn : d.h ≠ 0 := d.h_pos.ne' |
| 115 | have hid : d.h * (1 / d.h - 1) = 1 - d.h := by field_simp |
| 116 | rw [hid] at hi' |
| 117 | dsimp [TailData.secondRampStart, TailData.longHold] |
| 118 | nlinarith [d.h_pos] |
| 119 | |
| 120 | theorem release_exp_bound (d : TailData) {t : ℝ} (ht : 0 ≤ t) : |
| 121 | Real.exp (2 * releasePrimitive d t) ≤ |
| 122 | Real.exp 2 * Real.exp (-2 * t) + |
| 123 | d.h ^ 8 * Real.exp 8 * Real.exp (-(2 * d.h) * t) := by |
| 124 | by_cases hb : t ≤ d.secondRampStart |
| 125 | · have hp := Real.exp_le_exp.mpr (show 2 * releasePrimitive d t ≤ 2 + -2 * t by |
| 126 | linarith [releasePrimitive_plateau_le d ht hb]) |
| 127 | rw [Real.exp_add] at hp |
| 128 | exact hp.trans (le_add_of_nonneg_right (by positivity)) |
| 129 | · have hp := Real.exp_le_exp.mpr (show 2 * releasePrimitive d t ≤ |
| 130 | (-2 * d.longHold) + 2 * (d.h * d.secondRampStart) + -(2 * d.h) * t by |
| 131 | nlinarith [releasePrimitive_late_le d (le_of_not_ge hb)]) |
| 132 | rw [Real.exp_add, Real.exp_add, plateau_suppression] at hp |
| 133 | have he : Real.exp (2 * (d.h * d.secondRampStart)) ≤ Real.exp 8 := |
| 134 | Real.exp_le_exp.mpr (by linarith [h_secondRampStart_le d]) |
| 135 | have hm := mul_le_mul_of_nonneg_right |
| 136 | (mul_le_mul_of_nonneg_left he (pow_nonneg d.h_pos.le 8)) |
| 137 | (Real.exp_pos (-(2 * d.h) * t)).le |
| 138 | exact (hp.trans hm).trans (le_add_of_nonneg_left (by positivity)) |
| 139 | |
| 140 | theorem energyDensity_release_eq (d : TailData) (eta : ℝ) {y : ℝ} |
| 141 | (hy : d.releaseStart ≤ y) : |
| 142 | energyDensity d eta y = energyDensity d eta d.releaseStart * |
| 143 | Real.exp (2 * releasePrimitive d (y - d.releaseStart)) * |
| 144 | (tailShape d (y - tailStart d) / (1 - d.rho)) ^ 2 := by |
| 145 | have hR : d.core.holdStart ≤ d.releaseStart := by |
| 146 | linarith [coreEndpoint_ge_hold d, flattenEnd_gt_core d, releaseStart_gt_flattenEnd d] |
| 147 | have hrad := radialAmplitude_hold d.core.dropLength_pos.le hR hy |
| 148 | (P := d.core.P) (lam := d.core.lam) |
| 149 | have hf : d.flattenEnd ≤ y := (releaseStart_gt_flattenEnd d).le.trans hy |
| 150 | unfold energyDensity |
| 151 | rw [finalAngular_uniform d eta hf, |
| 152 | finalAngular_uniform_wait d eta (releaseStart_gt_flattenEnd d).le le_rfl, |
| 153 | carrier, hrad, releaseAdjustment_eq] |
| 154 | have hex : Real.exp y * |
| 155 | (Real.exp (-(1 / 2 + d.core.lam) * (y - d.releaseStart)) * |
| 156 | Real.exp (releasePrimitive d (y - d.releaseStart) + |
| 157 | d.core.lam * (y - d.releaseStart))) ^ 2 = |
| 158 | Real.exp d.releaseStart * Real.exp (2 * releasePrimitive d (y - d.releaseStart)) := by |
| 159 | simp only [pow_two, ← Real.exp_add] |
| 160 | congr 1 |
| 161 | ring |
| 162 | calc |
| 163 | _ = (radialAmplitude d.core.P d.core.dropLength d.core.lam d.releaseStart / 2) ^ 2 * |
| 164 | (Real.exp y * |
| 165 | (Real.exp (-(1 / 2 + d.core.lam) * (y - d.releaseStart)) * |
| 166 | Real.exp (releasePrimitive d (y - d.releaseStart) + |
| 167 | d.core.lam * (y - d.releaseStart))) ^ 2) * |
| 168 | (tailShape d (y - tailStart d) / (1 - d.rho)) ^ 2 := by ring |
| 169 | _ = _ := by rw [hex]; ring |
| 170 | |
| 171 | theorem tailShape_ratio_sq_le (d : TailData) (t : ℝ) : |
| 172 | (tailShape d t / (1 - d.rho)) ^ 2 ≤ 4 := by |
| 173 | have hden : 0 < 1 - d.rho := by linarith [d.rho_lt_half] |
| 174 | have hlo := div_nonneg (tailShape_pos d t).le hden.le |
| 175 | have hup : tailShape d t / (1 - d.rho) ≤ 2 := by |
| 176 | apply (div_le_iff₀ hden).mpr |
| 177 | linarith [(tailShape_bounds d t).2, d.rho_lt_half] |
| 178 | nlinarith |
| 179 | |
| 180 | theorem energyDensity_release_bound (d : TailData) (eta : ℝ) {y : ℝ} |
| 181 | (hy : d.releaseStart ≤ y) : |
| 182 | energyDensity d eta y ≤ 4 * energyDensity d eta d.releaseStart * |
| 183 | (Real.exp 2 * Real.exp (-2 * (y - d.releaseStart)) + |
| 184 | d.h ^ 8 * Real.exp 8 * Real.exp (-(2 * d.h) * (y - d.releaseStart))) := by |
| 185 | rw [energyDensity_release_eq d eta hy] |
| 186 | have hE := (energyDensity_pos d eta d.releaseStart).le |
| 187 | have h1 := mul_le_mul_of_nonneg_left (tailShape_ratio_sq_le d (y - tailStart d)) |
| 188 | (mul_nonneg hE (Real.exp_pos (2 * releasePrimitive d (y - d.releaseStart))).le) |
| 189 | have h2 := mul_le_mul_of_nonneg_left |
| 190 | (release_exp_bound d (sub_nonneg.mpr hy)) (mul_nonneg (by norm_num : (0 : ℝ) ≤ 4) hE) |
| 191 | nlinarith |
| 192 | |
| 193 | /-! ## The improper release integral -/ |
| 194 | |
| 195 | theorem integrableOn_shift_exp {a : ℝ} (ha : 0 < a) (R : ℝ) : |
| 196 | IntegrableOn (fun y : ℝ => Real.exp (-a * (y - R))) (Ioi R) := by |
| 197 | have he : (fun y : ℝ => Real.exp (-a * (y - R))) = |
| 198 | (fun y => Real.exp (a * R) * Real.exp (-a * y)) := by |
| 199 | funext y |
| 200 | rw [← Real.exp_add] |
| 201 | congr 1 |
| 202 | ring |
| 203 | rw [he] |
| 204 | exact (integrableOn_exp_mul_Ioi (neg_neg_of_pos ha) R).const_mul _ |
| 205 | |
| 206 | theorem integral_shift_exp {a : ℝ} (ha : 0 < a) (R : ℝ) : |
| 207 | (∫ y in Ioi R, Real.exp (-a * (y - R))) = 1 / a := by |
| 208 | have he : (fun y : ℝ => Real.exp (-a * (y - R))) = |
| 209 | (fun y => Real.exp (a * R) * Real.exp (-a * y)) := by |
| 210 | funext y |
| 211 | rw [← Real.exp_add] |
| 212 | congr 1 |
| 213 | ring |
| 214 | rw [he, integral_const_mul, integral_exp_mul_Ioi (neg_neg_of_pos ha)] |
| 215 | rw [neg_mul, Real.exp_neg] |
| 216 | field_simp |
| 217 | |
| 218 | noncomputable def releaseEnvelope (d : TailData) (y : ℝ) : ℝ := |
| 219 | Real.exp 2 * Real.exp (-2 * (y - d.releaseStart)) + |
| 220 | d.h ^ 8 * Real.exp 8 * Real.exp (-(2 * d.h) * (y - d.releaseStart)) |
| 221 | |
| 222 | theorem releaseEnvelope_integrable (d : TailData) : |
| 223 | IntegrableOn (releaseEnvelope d) (Ioi d.releaseStart) := |
| 224 | ((integrableOn_shift_exp (by norm_num : (0 : ℝ) < 2) d.releaseStart).const_mul _).add |
| 225 | ((integrableOn_shift_exp (mul_pos (by norm_num) d.h_pos) d.releaseStart).const_mul _) |
| 226 | |
| 227 | theorem integral_releaseEnvelope (d : TailData) : |
| 228 | (∫ y in Ioi d.releaseStart, releaseEnvelope d y) = |
| 229 | Real.exp 2 / 2 + d.h ^ 7 * Real.exp 8 / 2 := by |
| 230 | unfold releaseEnvelope |
| 231 | rw [integral_add |
| 232 | ((integrableOn_shift_exp (by norm_num : (0 : ℝ) < 2) d.releaseStart).const_mul _) |
| 233 | ((integrableOn_shift_exp (mul_pos (by norm_num) d.h_pos) d.releaseStart).const_mul _)] |
| 234 | rw [integral_const_mul, integral_const_mul, |
| 235 | integral_shift_exp (by norm_num : (0 : ℝ) < 2), |
| 236 | integral_shift_exp (mul_pos (by norm_num) d.h_pos)] |
| 237 | field_simp [d.h_pos.ne'] |
| 238 | |
| 239 | noncomputable def releaseConstant : ℝ := 2 * (Real.exp 2 + Real.exp 8) |
| 240 | |
| 241 | theorem releaseConstant_pos : 0 < releaseConstant := by |
| 242 | unfold releaseConstant |
| 243 | positivity |
| 244 | |
| 245 | theorem energyDensity_integrable_release (d : TailData) (eta : ℝ) : |
| 246 | IntegrableOn (energyDensity d eta) (Ioi d.releaseStart) := by |
| 247 | have hm := (releaseEnvelope_integrable d).const_mul (4 * energyDensity d eta d.releaseStart) |
| 248 | refine hm.mono' (energyDensity_continuous d eta).aestronglyMeasurable ?_ |
| 249 | filter_upwards [ae_restrict_mem measurableSet_Ioi] with y hy |
| 250 | rw [Real.norm_eq_abs, abs_of_pos (energyDensity_pos d eta y)] |
| 251 | exact energyDensity_release_bound d eta hy.le |
| 252 | |
| 253 | /-- The release cost is independent of both `h` and `lam`. -/ |
| 254 | theorem integral_energyDensity_release_le (d : TailData) (eta : ℝ) : |
| 255 | (∫ y in Ioi d.releaseStart, energyDensity d eta y) ≤ |
| 256 | releaseConstant * energyDensity d eta d.releaseStart := by |
| 257 | have hm := (releaseEnvelope_integrable d).const_mul (4 * energyDensity d eta d.releaseStart) |
| 258 | have h := setIntegral_mono_on (energyDensity_integrable_release d eta) hm |
| 259 | measurableSet_Ioi (fun y hy => energyDensity_release_bound d eta hy.le) |
| 260 | rw [integral_const_mul, integral_releaseEnvelope] at h |
| 261 | have hp : d.h ^ 7 ≤ 1 := pow_le_one₀ d.h_pos.le (by linarith [d.h_lt_half]) |
| 262 | have hE := (energyDensity_pos d eta d.releaseStart).le |
| 263 | have he := (Real.exp_pos (8 : ℝ)).le |
| 264 | have hp' := mul_le_mul_of_nonneg_right hp he |
| 265 | have hp'' := mul_le_mul_of_nonneg_left hp' hE |
| 266 | dsimp [releaseConstant] |
| 267 | nlinarith |
| 268 | |
| 269 | /-! ## Flattening and the uniform wait -/ |
| 270 | |
| 271 | theorem finalAngular_before_release (d : TailData) (eta : ℝ) {y : ℝ} |
| 272 | (hy : y ≤ d.releaseStart) : finalAngular d (y, eta) = flattened d (y, eta) := by |
| 273 | have ht : y - tailStart d ≤ 1 := by linarith [tailStart_gt_release d] |
| 274 | have hn : 1 - d.rho ≠ 0 := by linarith [d.rho_lt_half] |
| 275 | simp [finalAngular, releaseAdjustment_early d (sub_nonpos.mpr hy), tailShape_early d ht, hn] |
| 276 | |
| 277 | theorem flattenFactor_le_one (d : TailData) (eta y : ℝ) (heta : eta ^ 2 ≤ 1) : |
| 278 | flattenFactor d (y, eta) ≤ 1 := by |
| 279 | have hlog : logShape eta ≤ Real.log 2 := |
| 280 | Real.log_le_log (by positivity) (by nlinarith) |
| 281 | apply Real.exp_le_one_iff.mpr |
| 282 | exact mul_nonpos_of_nonneg_of_nonpos (sigma_nonneg _) (sub_nonpos.mpr hlog) |
| 283 | |
| 284 | theorem core_energy_hold (d : TailData) (eta : ℝ) {y : ℝ} |
| 285 | (hy : d.core.endpoint ≤ y) : |
| 286 | Real.exp y * angular d.core.P d.core.dropLength d.core.lam (y, eta) ^ 2 = |
| 287 | energyDensity d eta d.core.endpoint * Real.exp (-2 * d.core.lam * (y - d.core.endpoint)) := by |
| 288 | have hr := radialAmplitude_hold d.core.dropLength_pos.le (coreEndpoint_ge_hold d) hy |
| 289 | (P := d.core.P) (lam := d.core.lam) |
| 290 | unfold energyDensity |
| 291 | rw [finalAngular_before d eta le_rfl] |
| 292 | simp only [angular] |
| 293 | rw [hr] |
| 294 | have he : Real.exp y * Real.exp (-(1 / 2 + d.core.lam) * (y - d.core.endpoint)) ^ 2 = |
| 295 | Real.exp d.core.endpoint * Real.exp (-2 * d.core.lam * (y - d.core.endpoint)) := by |
| 296 | simp only [pow_two, ← Real.exp_add] |
| 297 | congr 1 |
| 298 | ring |
| 299 | calc |
| 300 | _ = (radialAmplitude d.core.P d.core.dropLength d.core.lam d.core.endpoint * shape eta) ^ 2 * |
| 301 | (Real.exp y * Real.exp (-(1 / 2 + d.core.lam) * (y - d.core.endpoint)) ^ 2) := by ring |
| 302 | _ = _ := by rw [he]; ring |
| 303 | |
| 304 | theorem energyDensity_prefix_le (d : TailData) (eta : ℝ) (heta : eta ^ 2 ≤ 1) |
| 305 | {y : ℝ} (hy : d.core.endpoint ≤ y) (hy' : y ≤ d.releaseStart) : |
| 306 | energyDensity d eta y ≤ energyDensity d eta d.core.endpoint := by |
| 307 | have hf0 : 0 ≤ flattenFactor d (y, eta) := (Real.exp_pos _).le |
| 308 | have hf1 := flattenFactor_le_one d eta y heta |
| 309 | have hf2 : flattenFactor d (y, eta) ^ 2 ≤ 1 := by nlinarith |
| 310 | have he0 := (Real.exp_pos (-2 * d.core.lam * (y - d.core.endpoint))).le |
| 311 | have he1 : Real.exp (-2 * d.core.lam * (y - d.core.endpoint)) ≤ 1 := by |
| 312 | apply Real.exp_le_one_iff.mpr |
| 313 | nlinarith [d.core.lam_pos, sub_nonneg.mpr hy] |
| 314 | have hE := (energyDensity_pos d eta d.core.endpoint).le |
| 315 | have hid : energyDensity d eta y = energyDensity d eta d.core.endpoint * |
| 316 | Real.exp (-2 * d.core.lam * (y - d.core.endpoint)) * flattenFactor d (y, eta) ^ 2 := by |
| 317 | change Real.exp y * finalAngular d (y, eta) ^ 2 = _ |
| 318 | rw [finalAngular_before_release d eta hy'] |
| 319 | dsimp only [flattened] |
| 320 | rw [mul_pow, ← mul_assoc, core_energy_hold d eta hy] |
| 321 | rw [hid] |
| 322 | calc |
| 323 | _ ≤ energyDensity d eta d.core.endpoint * Real.exp (-2 * d.core.lam * (y - d.core.endpoint)) := by |
| 324 | nlinarith [mul_nonneg hE he0] |
| 325 | _ ≤ energyDensity d eta d.core.endpoint := by nlinarith |
| 326 | |
| 327 | theorem endpoint_le_releaseStart (d : TailData) : d.core.endpoint ≤ d.releaseStart := |
| 328 | (flattenEnd_gt_core d).le.trans (releaseStart_gt_flattenEnd d).le |
| 329 | |
| 330 | theorem energyDensity_integrable_postPulse (d : TailData) (eta : ℝ) : |
| 331 | IntegrableOn (energyDensity d eta) (Ioi d.core.endpoint) := by |
| 332 | rw [← Ioc_union_Ioi_eq_Ioi (endpoint_le_releaseStart d)] |
| 333 | exact integrableOn_union.mpr |
| 334 | ⟨(energyDensity_continuous d eta).integrableOn_Ioc, energyDensity_integrable_release d eta⟩ |
| 335 | |
| 336 | noncomputable def postPulseEnergy (d : TailData) (eta : ℝ) : ℝ := |
| 337 | ∫ y in Ioi d.core.endpoint, energyDensity d eta y |
| 338 | |
| 339 | theorem postPulseEnergy_nonneg (d : TailData) (eta : ℝ) : 0 ≤ postPulseEnergy d eta := |
| 340 | integral_nonneg (fun y => (energyDensity_pos d eta y).le) |
| 341 | |
| 342 | theorem postPulseEnergy_split (d : TailData) (eta : ℝ) {a : ℝ} |
| 343 | (ha : d.core.endpoint ≤ a) : |
| 344 | postPulseEnergy d eta = (∫ y in d.core.endpoint..a, energyDensity d eta y) + |
| 345 | ∫ y in Ioi a, energyDensity d eta y := by |
| 346 | have hdis : Disjoint (Ioc d.core.endpoint a) (Ioi a) := by |
| 347 | rw [disjoint_left] |
| 348 | intro y hy hy' |
| 349 | exact (not_lt_of_ge hy.2) hy' |
| 350 | have hint := (energyDensity_integrable_postPulse d eta).mono_set |
| 351 | (show Ioi a ⊆ Ioi d.core.endpoint from fun y hy => lt_of_le_of_lt ha hy) |
| 352 | rw [postPulseEnergy, ← Ioc_union_Ioi_eq_Ioi ha, |
| 353 | setIntegral_union hdis measurableSet_Ioi (energyDensity_continuous d eta).integrableOn_Ioc hint, |
| 354 | intervalIntegral.integral_of_le ha] |
| 355 | |
| 356 | theorem postPulseEnergy_le_length (d : TailData) (eta : ℝ) (heta : eta ^ 2 ≤ 1) : |
| 357 | postPulseEnergy d eta ≤ |
| 358 | (d.releaseStart - d.core.endpoint + releaseConstant) * energyDensity d eta d.core.endpoint := by |
| 359 | have hle := endpoint_le_releaseStart d |
| 360 | have hp := intervalIntegral.integral_mono_on (μ := volume) hle |
| 361 | ((energyDensity_continuous d eta).intervalIntegrable _ _) |
| 362 | (continuous_const.intervalIntegrable _ _) |
| 363 | (fun y hy => energyDensity_prefix_le d eta heta hy.1 hy.2) |
| 364 | simp only [intervalIntegral.integral_const, smul_eq_mul] at hp |
| 365 | have hr := integral_energyDensity_release_le d eta |
| 366 | have hR := mul_le_mul_of_nonneg_left (energyDensity_prefix_le d eta heta hle le_rfl) |
| 367 | releaseConstant_pos.le |
| 368 | rw [postPulseEnergy_split d eta hle] |
| 369 | nlinarith |
| 370 | |
| 371 | noncomputable def tailConstant : ℝ := flattenLength + 30 + releaseConstant |
| 372 | |
| 373 | theorem tailConstant_pos : 0 < tailConstant := by |
| 374 | unfold tailConstant |
| 375 | linarith [flattenLength_pos, releaseConstant_pos] |
| 376 | |
| 377 | /-- Actual outgoing energy, with a constant independent of every parameter. -/ |
| 378 | theorem postPulseEnergy_le (d : TailData) (eta : ℝ) (heta : eta ^ 2 ≤ 1) : |
| 379 | postPulseEnergy d eta ≤ tailConstant * (1 + Real.log (1 / d.core.lam)) * |
| 380 | energyDensity d eta d.core.endpoint := by |
| 381 | have hlog : 0 ≤ Real.log (1 / d.core.lam) := by |
| 382 | have := d.uniformWait_pos |
| 383 | dsimp [TailData.uniformWait] at this |
| 384 | linarith |
| 385 | have hc : d.releaseStart - d.core.endpoint + releaseConstant ≤ |
| 386 | tailConstant * (1 + Real.log (1 / d.core.lam)) := by |
| 387 | dsimp [TailData.releaseStart, TailData.flattenEnd, TailData.uniformWait, tailConstant] |
| 388 | nlinarith [mul_nonneg (add_nonneg flattenLength_pos.le releaseConstant_pos.le) hlog] |
| 389 | exact (postPulseEnergy_le_length d eta heta).trans |
| 390 | (mul_le_mul_of_nonneg_right hc (energyDensity_pos d eta d.core.endpoint).le) |
| 391 | |
| 392 | /-! ## Genuine parameter regularity and derivative bounds -/ |
| 393 | |
| 394 | theorem energyDensity_contDiff (d : TailData) : |
| 395 | ContDiff ℝ ∞ (fun p : ℝ × ℝ => energyDensity d p.1 p.2) := |
| 396 | contDiff_snd.exp.mul |
| 397 | (((finalAngular_contDiff d).comp (contDiff_snd.prodMk contDiff_fst)).pow 2) |
| 398 | |
| 399 | theorem postPulseEnergy_split_flattenEnd (d : TailData) (eta : ℝ) : |
| 400 | postPulseEnergy d eta = |
| 401 | (∫ y in d.core.endpoint..d.flattenEnd, energyDensity d eta y) + |
| 402 | ∫ y in Ioi d.flattenEnd, energyDensity d 0 y := by |
| 403 | rw [postPulseEnergy_split d eta (flattenEnd_gt_core d).le] |
| 404 | congr 1 |
| 405 | apply setIntegral_congr_fun measurableSet_Ioi |
| 406 | intro y hy |
| 407 | unfold energyDensity |
| 408 | rw [finalAngular_eta_independent d eta 0 hy.le] |
| 409 | |
| 410 | theorem postPulseEnergy_contDiff (d : TailData) : ContDiff ℝ ∞ (postPulseEnergy d) := by |
| 411 | have hi := ParametricRephase.intervalIntegral_contDiffOn_of_joint |
| 412 | (fun p : ℝ × ℝ => energyDensity d p.1 p.2) univ isOpen_univ |
| 413 | (energyDensity_contDiff d).contDiffOn d.core.endpoint d.flattenEnd (flattenEnd_gt_core d).le |
| 414 | have hi' : ContDiff ℝ ∞ (fun eta => ∫ y in d.core.endpoint..d.flattenEnd, energyDensity d eta y) := |
| 415 | contDiffOn_univ.mp hi |
| 416 | have heq : postPulseEnergy d = (fun eta => |
| 417 | (∫ y in d.core.endpoint..d.flattenEnd, energyDensity d eta y) + |
| 418 | ∫ y in Ioi d.flattenEnd, energyDensity d 0 y) := |
| 419 | funext (postPulseEnergy_split_flattenEnd d) |
| 420 | rw [heq] |
| 421 | exact hi'.add contDiff_const |
| 422 | |
| 423 | noncomputable def etaCoefficient (d : TailData) (eta y : ℝ) : ℝ := |
| 424 | -(4 * (1 - sigma ((y - d.core.endpoint) / flattenLength)) * eta / (1 + eta ^ 2)) |
| 425 | |
| 426 | theorem etaCoefficient_continuous (d : TailData) (eta : ℝ) : |
| 427 | Continuous (etaCoefficient d eta) := by |
| 428 | have hs := sigma_contDiff.continuous |
| 429 | unfold etaCoefficient |
| 430 | fun_prop |
| 431 | |
| 432 | theorem finalAngular_hasDerivAt_eta (d : TailData) (eta y : ℝ) : |
| 433 | HasDerivAt (fun q => finalAngular d (y, q)) |
| 434 | (-(2 * (1 - sigma ((y - d.core.endpoint) / flattenLength)) * eta / (1 + eta ^ 2)) * |
| 435 | finalAngular d (y, eta)) eta := by |
| 436 | have hq : HasDerivAt (fun q : ℝ => 1 + q ^ 2) (2 * eta) eta := by |
| 437 | simpa using ((hasDerivAt_id eta).pow 2).const_add 1 |
| 438 | have hn : 1 + eta ^ 2 ≠ 0 := by positivity |
| 439 | have hrho : 1 - d.rho ≠ 0 := by linarith [d.rho_lt_half] |
| 440 | have hs := hq.inv hn |
| 441 | have hl := ((hq.log hn).sub_const (Real.log 2)).const_mul |
| 442 | (sigma ((y - d.core.endpoint) / flattenLength)) |
| 443 | have hf := ((hs.const_mul (radialAmplitude d.core.P d.core.dropLength d.core.lam y)).mul hl.exp) |
| 444 | have hE := (hf.mul_const (Real.exp (releaseAdjustment d (y - d.releaseStart)))).mul_const |
| 445 | (tailShape d (y - tailStart d) / (1 - d.rho)) |
| 446 | convert! hE using 1 |
| 447 | dsimp [finalAngular, flattened, angular, shape, flattenFactor, logShape] |
| 448 | field_simp [hn, hrho] ; ring |
| 449 | |
| 450 | theorem energyDensity_hasDerivAt_eta (d : TailData) (eta y : ℝ) : |
| 451 | HasDerivAt (fun q => energyDensity d q y) |
| 452 | (etaCoefficient d eta y * energyDensity d eta y) eta := by |
| 453 | convert! ((finalAngular_hasDerivAt_eta d eta y).pow 2).const_mul (Real.exp y) using 1 |
| 454 | dsimp [etaCoefficient, energyDensity] |
| 455 | ring |
| 456 | |
| 457 | theorem etaCoefficient_abs_le (d : TailData) (eta y : ℝ) : |etaCoefficient d eta y| ≤ 2 := by |
| 458 | have hs0 := sigma_nonneg ((y - d.core.endpoint) / flattenLength) |
| 459 | have hs1 := sigma_le_one ((y - d.core.endpoint) / flattenLength) |
| 460 | have hp : 0 < 1 + eta ^ 2 := by positivity |
| 461 | have heta : 2 * |eta| ≤ 1 + eta ^ 2 := by |
| 462 | nlinarith [sq_nonneg (|eta| - 1), sq_abs eta] |
| 463 | have hprod : 4 * (1 - sigma ((y - d.core.endpoint) / flattenLength)) * |eta| ≤ |
| 464 | 4 * |eta| := by nlinarith [abs_nonneg eta] |
| 465 | dsimp [etaCoefficient] |
| 466 | rw [abs_neg, abs_div, abs_mul, abs_mul, abs_of_nonneg (by norm_num : (0 : ℝ) ≤ 4), |
| 467 | abs_of_nonneg (sub_nonneg.mpr hs1), abs_of_pos hp] |
| 468 | exact (div_le_iff₀ hp).mpr (by linarith) |
| 469 | |
| 470 | theorem energyDensity_eta_bound (d : TailData) (eta y : ℝ) : |
| 471 | |etaCoefficient d eta y * energyDensity d eta y| ≤ 2 * energyDensity d eta y := by |
| 472 | rw [abs_mul, abs_of_pos (energyDensity_pos d eta y)] |
| 473 | exact mul_le_mul_of_nonneg_right (etaCoefficient_abs_le d eta y) (energyDensity_pos d eta y).le |
| 474 | |
| 475 | theorem integral_energyDensity_hasDerivAt (d : TailData) (eta a b : ℝ) : |
| 476 | HasDerivAt (fun q => ∫ y in a..b, energyDensity d q y) |
| 477 | (∫ y in a..b, etaCoefficient d eta y * energyDensity d eta y) eta := by |
| 478 | have hc : Continuous (fun p : ℝ × ℝ => |
| 479 | etaCoefficient d p.1 p.2 * energyDensity d p.1 p.2) := by |
| 480 | apply Continuous.mul _ (energyDensity_contDiff d).continuous |
| 481 | unfold etaCoefficient |
| 482 | have hs : Continuous (fun p : ℝ × ℝ => sigma ((p.2 - d.core.endpoint) / flattenLength)) := |
| 483 | sigma_contDiff.continuous.comp ((continuous_snd.sub continuous_const).div_const _) |
| 484 | exact (((continuous_const.mul (continuous_const.sub hs)).mul continuous_fst).div |
| 485 | (continuous_const.fun_add (continuous_fst.fun_pow 2)) (fun p => by positivity)).neg |
| 486 | obtain ⟨C, hC⟩ := ((isCompact_closedBall eta 1).prod |
| 487 | (isCompact_uIcc : IsCompact (uIcc a b))).exists_bound_of_continuousOn hc.continuousOn |
| 488 | exact (intervalIntegral.hasDerivAt_integral_of_dominated_loc_of_deriv_le |
| 489 | (μ := volume) (F := energyDensity d) |
| 490 | (F' := fun q y => etaCoefficient d q y * energyDensity d q y) |
| 491 | (bound := fun _ => C) (Metric.ball_mem_nhds eta (by norm_num : (0 : ℝ) < 1)) |
| 492 | (Eventually.of_forall fun q => (energyDensity_continuous d q).aestronglyMeasurable) |
| 493 | ((energyDensity_continuous d eta).intervalIntegrable a b) |
| 494 | ((etaCoefficient_continuous d eta).mul (energyDensity_continuous d eta)).aestronglyMeasurable |
| 495 | (Eventually.of_forall fun t ht q hq => |
| 496 | hC (q, t) ⟨Metric.mem_closedBall.mpr (Metric.mem_ball.mp hq).le, uIoc_subset_uIcc ht⟩) |
| 497 | intervalIntegrable_const |
| 498 | (Eventually.of_forall fun t _ q _ => energyDensity_hasDerivAt_eta d q t)).2 |
| 499 | |
| 500 | theorem postPulseEnergy_hasDerivAt (d : TailData) (eta : ℝ) : |
| 501 | HasDerivAt (postPulseEnergy d) |
| 502 | (∫ y in d.core.endpoint..d.flattenEnd, |
| 503 | etaCoefficient d eta y * energyDensity d eta y) eta := by |
| 504 | have heq : postPulseEnergy d = (fun q => |
| 505 | (∫ y in d.core.endpoint..d.flattenEnd, energyDensity d q y) + |
| 506 | ∫ y in Ioi d.flattenEnd, energyDensity d 0 y) := |
| 507 | funext (postPulseEnergy_split_flattenEnd d) |
| 508 | rw [heq] |
| 509 | exact (integral_energyDensity_hasDerivAt d eta d.core.endpoint d.flattenEnd).add_const _ |
| 510 | |
| 511 | /-- Parameter variation occurs only on the fixed flattening interval. -/ |
| 512 | theorem abs_deriv_postPulseEnergy_le (d : TailData) (eta : ℝ) (heta : eta ^ 2 ≤ 1) : |
| 513 | |deriv (postPulseEnergy d) eta| ≤ |
| 514 | 2 * flattenLength * energyDensity d eta d.core.endpoint := by |
| 515 | rw [(postPulseEnergy_hasDerivAt d eta).deriv] |
| 516 | have hbound : ∀ y ∈ uIoc d.core.endpoint d.flattenEnd, |
| 517 | ‖etaCoefficient d eta y * energyDensity d eta y‖ ≤ |
| 518 | 2 * energyDensity d eta d.core.endpoint := by |
| 519 | intro y hy |
| 520 | have hy' := uIoc_of_le (flattenEnd_gt_core d).le ▸ hy |
| 521 | have hE := energyDensity_prefix_le d eta heta hy'.1.le |
| 522 | (hy'.2.trans (releaseStart_gt_flattenEnd d).le) |
| 523 | simpa only [Real.norm_eq_abs] using (energyDensity_eta_bound d eta y).trans |
| 524 | (mul_le_mul_of_nonneg_left hE (by norm_num : (0 : ℝ) ≤ 2)) |
| 525 | have h := intervalIntegral.norm_integral_le_of_norm_le_const hbound |
| 526 | rw [Real.norm_eq_abs, abs_of_nonneg (sub_nonneg.mpr (flattenEnd_gt_core d).le)] at h |
| 527 | have hlen : d.flattenEnd - d.core.endpoint = flattenLength := by |
| 528 | dsimp [TailData.flattenEnd] |
| 529 | ring |
| 530 | rw [hlen] at h |
| 531 | nlinarith |
| 532 | |
| 533 | /-! ## Relation to the pulse normalization -/ |
| 534 | |
| 535 | theorem energyDensity_endpoint_eq (d : TailData) (eta : ℝ) : |
| 536 | energyDensity d eta d.core.endpoint = |
| 537 | (Real.exp d.core.pulseStart * pulseAmplitude d.core ^ 2 * shape eta ^ 2) * Real.exp (-26) := by |
| 538 | have hy : d.core.pulseStart ≤ d.core.endpoint := by |
| 539 | dsimp [OutgoingSchedule.Parameters.endpoint] |
| 540 | linarith [d.core.pulseLength_pos] |
| 541 | unfold energyDensity |
| 542 | rw [finalAngular_before d eta le_rfl, angular_pulse d.core eta hy] |
| 543 | have he : Real.exp d.core.endpoint * |
| 544 | Real.exp (-(1 / 2 + d.core.lam) * (d.core.endpoint - d.core.pulseStart)) ^ 2 = |
| 545 | Real.exp d.core.pulseStart * Real.exp (-26) := by |
| 546 | simp only [pow_two, ← Real.exp_add] |
| 547 | congr 1 |
| 548 | dsimp [OutgoingSchedule.Parameters.endpoint, OutgoingSchedule.Parameters.pulseLength] |
| 549 | field_simp [d.core.lam_pos.ne'] ; ring |
| 550 | calc |
| 551 | _ = (pulseAmplitude d.core ^ 2 * shape eta ^ 2) * |
| 552 | (Real.exp d.core.endpoint * |
| 553 | Real.exp (-(1 / 2 + d.core.lam) * (d.core.endpoint - d.core.pulseStart)) ^ 2) := by ring |
| 554 | _ = _ := by rw [he]; ring |
| 555 | |
| 556 | theorem energyDensity_endpoint_le (d : TailData) (eta : ℝ) : |
| 557 | energyDensity d eta d.core.endpoint ≤ |
| 558 | Real.exp d.core.pulseStart * pulseAmplitude d.core ^ 2 * shape eta ^ 2 := by |
| 559 | rw [energyDensity_endpoint_eq] |
| 560 | have he : Real.exp (-26 : ℝ) ≤ 1 := Real.exp_le_one_iff.mpr (by norm_num) |
| 561 | have hp : 0 ≤ Real.exp d.core.pulseStart * pulseAmplitude d.core ^ 2 * shape eta ^ 2 := by |
| 562 | positivity |
| 563 | nlinarith |
| 564 | |
| 565 | theorem normalized_postPulseEnergy_le (d : TailData) (eta : ℝ) (heta : eta ^ 2 ≤ 1) : |
| 566 | d.core.lam * postPulseEnergy d eta / |
| 567 | (Real.exp d.core.pulseStart * pulseAmplitude d.core ^ 2 * shape eta ^ 2) ≤ |
| 568 | tailConstant * d.core.lam * (1 + Real.log (1 / d.core.lam)) := by |
| 569 | have hpos : 0 < Real.exp d.core.pulseStart * pulseAmplitude d.core ^ 2 * shape eta ^ 2 := |
| 570 | mul_pos (mul_pos (Real.exp_pos _) (sq_pos_of_pos (pulseAmplitude_pos d.core))) |
| 571 | (sq_pos_of_pos (shape_pos eta)) |
| 572 | apply (div_le_iff₀ hpos).mpr |
| 573 | have hlog : 0 ≤ 1 + Real.log (1 / d.core.lam) := by |
| 574 | have := d.uniformWait_pos |
| 575 | dsimp [TailData.uniformWait] at this |
| 576 | linarith |
| 577 | have hbase := (postPulseEnergy_le d eta heta).trans |
| 578 | (mul_le_mul_of_nonneg_left (energyDensity_endpoint_le d eta) |
| 579 | (mul_nonneg tailConstant_pos.le hlog)) |
| 580 | have h := mul_le_mul_of_nonneg_left hbase d.core.lam_pos.le |
| 581 | nlinarith |
| 582 | |
| 583 | /-- Normalization of the derivative of the energy. The derivative of the |
| 584 | normalized quotient also has the elementary derivative of `shape eta ^ 2`. -/ |
| 585 | theorem normalized_deriv_postPulseEnergy_le (d : TailData) (eta : ℝ) (heta : eta ^ 2 ≤ 1) : |
| 586 | d.core.lam * |deriv (postPulseEnergy d) eta| / |
| 587 | (Real.exp d.core.pulseStart * pulseAmplitude d.core ^ 2 * shape eta ^ 2) ≤ |
| 588 | 2 * flattenLength * d.core.lam := by |
| 589 | have hpos : 0 < Real.exp d.core.pulseStart * pulseAmplitude d.core ^ 2 * shape eta ^ 2 := |
| 590 | mul_pos (mul_pos (Real.exp_pos _) (sq_pos_of_pos (pulseAmplitude_pos d.core))) |
| 591 | (sq_pos_of_pos (shape_pos eta)) |
| 592 | apply (div_le_iff₀ hpos).mpr |
| 593 | have hbase := (abs_deriv_postPulseEnergy_le d eta heta).trans |
| 594 | (mul_le_mul_of_nonneg_left (energyDensity_endpoint_le d eta) |
| 595 | (mul_nonneg (by norm_num : (0 : ℝ) ≤ 2) flattenLength_pos.le)) |
| 596 | have h := mul_le_mul_of_nonneg_left hbase d.core.lam_pos.le |
| 597 | nlinarith |
| 598 | |
| 599 | /-! ## Differentiating the fully normalized quotient -/ |
| 600 | |
| 601 | noncomputable def normalizedPostPulseEnergy (d : TailData) (eta : ℝ) : ℝ := |
| 602 | d.core.lam * postPulseEnergy d eta / |
| 603 | (Real.exp d.core.pulseStart * pulseAmplitude d.core ^ 2 * shape eta ^ 2) |
| 604 | |
| 605 | theorem normalizedPostPulseEnergy_eq (d : TailData) (eta : ℝ) : |
| 606 | normalizedPostPulseEnergy d eta = |
| 607 | (d.core.lam / (Real.exp d.core.pulseStart * pulseAmplitude d.core ^ 2)) * |
| 608 | postPulseEnergy d eta * (1 + eta ^ 2) ^ 2 := by |
| 609 | have hp : 1 + eta ^ 2 ≠ 0 := by positivity |
| 610 | simp only [normalizedPostPulseEnergy, shape] |
| 611 | field_simp [hp] |
| 612 | |
| 613 | theorem normalizedPostPulseEnergy_nonneg (d : TailData) (eta : ℝ) : |
| 614 | 0 ≤ normalizedPostPulseEnergy d eta := by |
| 615 | unfold normalizedPostPulseEnergy |
| 616 | exact div_nonneg (mul_nonneg d.core.lam_pos.le (postPulseEnergy_nonneg d eta)) (by positivity) |
| 617 | |
| 618 | theorem normalizedPostPulseEnergy_contDiff (d : TailData) : |
| 619 | ContDiff ℝ ∞ (normalizedPostPulseEnergy d) := by |
| 620 | have he : normalizedPostPulseEnergy d = (fun eta => |
| 621 | (d.core.lam / (Real.exp d.core.pulseStart * pulseAmplitude d.core ^ 2)) * |
| 622 | postPulseEnergy d eta * (1 + eta ^ 2) ^ 2) := |
| 623 | funext (normalizedPostPulseEnergy_eq d) |
| 624 | rw [he] |
| 625 | exact (contDiff_const.mul (postPulseEnergy_contDiff d)).mul |
| 626 | ((contDiff_const.add (contDiff_id.pow 2)).pow 2) |
| 627 | |
| 628 | theorem normalizedPostPulseEnergy_hasDerivAt (d : TailData) (eta : ℝ) : |
| 629 | HasDerivAt (normalizedPostPulseEnergy d) |
| 630 | (d.core.lam * deriv (postPulseEnergy d) eta / |
| 631 | (Real.exp d.core.pulseStart * pulseAmplitude d.core ^ 2 * shape eta ^ 2) + |
| 632 | (4 * eta / (1 + eta ^ 2)) * normalizedPostPulseEnergy d eta) eta := by |
| 633 | have hE := ((postPulseEnergy_contDiff d).differentiable (by simp) eta).hasDerivAt |
| 634 | have hp : HasDerivAt (fun q : ℝ => (1 + q ^ 2) ^ 2) (4 * eta * (1 + eta ^ 2)) eta := by |
| 635 | convert! (((hasDerivAt_id eta).fun_pow 2).const_add 1).fun_pow 2 using 1 |
| 636 | simp only [id_eq] |
| 637 | ring |
| 638 | have hd := (hE.const_mul |
| 639 | (d.core.lam / (Real.exp d.core.pulseStart * pulseAmplitude d.core ^ 2))).fun_mul hp |
| 640 | have he : normalizedPostPulseEnergy d = (fun eta => |
| 641 | (d.core.lam / (Real.exp d.core.pulseStart * pulseAmplitude d.core ^ 2)) * |
| 642 | postPulseEnergy d eta * (1 + eta ^ 2) ^ 2) := |
| 643 | funext (normalizedPostPulseEnergy_eq d) |
| 644 | rw [he] |
| 645 | convert! hd using 1 |
| 646 | have hp0 : 1 + eta ^ 2 ≠ 0 := by positivity |
| 647 | have hN : Real.exp d.core.pulseStart * pulseAmplitude d.core ^ 2 ≠ 0 := |
| 648 | (mul_pos (Real.exp_pos _) (sq_pos_of_pos (pulseAmplitude_pos d.core))).ne' |
| 649 | simp only [shape] |
| 650 | field_simp [hp0, hN] |
| 651 | |
| 652 | /-- This is the derivative of the full quotient, including its shape factor. -/ |
| 653 | theorem abs_deriv_normalizedPostPulseEnergy_le (d : TailData) (eta : ℝ) |
| 654 | (heta : eta ^ 2 ≤ 1) : |
| 655 | |deriv (normalizedPostPulseEnergy d) eta| ≤ |
| 656 | (2 * flattenLength + 4 * tailConstant) * d.core.lam * |
| 657 | (1 + Real.log (1 / d.core.lam)) := by |
| 658 | have hden : 0 < Real.exp d.core.pulseStart * pulseAmplitude d.core ^ 2 * shape eta ^ 2 := |
| 659 | mul_pos (mul_pos (Real.exp_pos _) (sq_pos_of_pos (pulseAmplitude_pos d.core))) |
| 660 | (sq_pos_of_pos (shape_pos eta)) |
| 661 | have hp : 0 < 1 + eta ^ 2 := by positivity |
| 662 | have habs : |eta| ≤ 1 := by |
| 663 | apply abs_le.mpr |
| 664 | constructor <;> nlinarith [sq_nonneg (eta + 1), sq_nonneg (eta - 1)] |
| 665 | have hcoef : |4 * eta / (1 + eta ^ 2)| ≤ 4 := by |
| 666 | rw [abs_div, abs_mul, abs_of_pos (by norm_num : (0 : ℝ) < 4), abs_of_pos hp] |
| 667 | apply (div_le_iff₀ hp).mpr |
| 668 | nlinarith [sq_nonneg eta] |
| 669 | have hE0 := normalizedPostPulseEnergy_nonneg d eta |
| 670 | have hE := normalized_postPulseEnergy_le d eta heta |
| 671 | change normalizedPostPulseEnergy d eta ≤ _ at hE |
| 672 | have hEd := normalized_deriv_postPulseEnergy_le d eta heta |
| 673 | have hfirst : |
| 674 | |d.core.lam * deriv (postPulseEnergy d) eta / |
| 675 | (Real.exp d.core.pulseStart * pulseAmplitude d.core ^ 2 * shape eta ^ 2)| ≤ |
| 676 | 2 * flattenLength * d.core.lam := by |
| 677 | simpa only [abs_div, abs_mul, abs_of_pos d.core.lam_pos, abs_of_pos hden] using hEd |
| 678 | have hsecond : |(4 * eta / (1 + eta ^ 2)) * normalizedPostPulseEnergy d eta| ≤ |
| 679 | 4 * (tailConstant * d.core.lam * (1 + Real.log (1 / d.core.lam))) := by |
| 680 | rw [abs_mul, abs_of_nonneg hE0] |
| 681 | exact (mul_le_mul_of_nonneg_right hcoef hE0).trans |
| 682 | (mul_le_mul_of_nonneg_left hE (by norm_num)) |
| 683 | have hlog : 1 ≤ 1 + Real.log (1 / d.core.lam) := by |
| 684 | have := d.uniformWait_pos |
| 685 | dsimp [TailData.uniformWait] at this |
| 686 | linarith |
| 687 | have hpad := mul_le_mul_of_nonneg_left hlog |
| 688 | (mul_nonneg (mul_nonneg (by norm_num : (0 : ℝ) ≤ 2) flattenLength_pos.le) d.core.lam_pos.le) |
| 689 | rw [(normalizedPostPulseEnergy_hasDerivAt d eta).deriv] |
| 690 | calc |
| 691 | _ ≤ |d.core.lam * deriv (postPulseEnergy d) eta / |
| 692 | (Real.exp d.core.pulseStart * pulseAmplitude d.core ^ 2 * shape eta ^ 2)| + |
| 693 | |(4 * eta / (1 + eta ^ 2)) * normalizedPostPulseEnergy d eta| := abs_add_le _ _ |
| 694 | _ ≤ 2 * flattenLength * d.core.lam + |
| 695 | 4 * (tailConstant * d.core.lam * (1 + Real.log (1 / d.core.lam))) := |
| 696 | add_le_add hfirst hsecond |
| 697 | _ ≤ _ := by nlinarith |
| 698 | |
| 699 | theorem abs_deriv_normalized_postPulseEnergy_le (d : TailData) (eta : ℝ) |
| 700 | (heta : eta ^ 2 ≤ 1) : |
| 701 | |deriv (fun q => d.core.lam * postPulseEnergy d q / |
| 702 | (Real.exp d.core.pulseStart * pulseAmplitude d.core ^ 2 * shape q ^ 2)) eta| ≤ |
| 703 | (2 * flattenLength + 4 * tailConstant) * d.core.lam * |
| 704 | (1 + Real.log (1 / d.core.lam)) := |
| 705 | abs_deriv_normalizedPostPulseEnergy_le d eta heta |
| 706 | |
| 707 | end NavierStokes.TailEnergyBounds |