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.OutgoingSchedule |
| 2 | import Mathlib.Analysis.Calculus.IteratedDeriv.Lemmas |
| 3 | import Mathlib.MeasureTheory.Measure.Haar.NormedSpace |
| 4 | |
| 5 | /-! |
| 6 | # Quantitative bounds for the constructed outgoing pulse |
| 7 | |
| 8 | All profiles and moments in this file are those of `OutgoingSchedule` and |
| 9 | `LocalizedMomentRepair`. In particular the correction bumps are not an |
| 10 | additional choice. Their log-coordinate translates are identified below. |
| 11 | -/ |
| 12 | |
| 13 | noncomputable section |
| 14 | |
| 15 | open Set Filter Function MeasureTheory |
| 16 | open scoped Topology ContDiff BigOperators |
| 17 | |
| 18 | namespace NavierStokes.OutgoingPulseBounds |
| 19 | |
| 20 | open OutgoingSchedule |
| 21 | |
| 22 | theorem slope_bounds (c : Parameters) (y : ℝ) : |
| 23 | -c.lam ≤ slope c.dropLength c.lam y ∧ |
| 24 | slope c.dropLength c.lam y ≤ 3 / 5 := by |
| 25 | have h0 := sigma_nonneg y |
| 26 | have h1 := sigma_le_one y |
| 27 | have h2 := sigma_nonneg (y - (c.dropLength + 1)) |
| 28 | have h3 := sigma_le_one (y - (c.dropLength + 1)) |
| 29 | have ha := mul_nonneg c.lam_pos.le h2 |
| 30 | have hb := mul_nonneg c.lam_pos.le (sub_nonneg.mpr h3) |
| 31 | dsimp [OutgoingSchedule.slope] |
| 32 | constructor <;> nlinarith |
| 33 | |
| 34 | theorem logAmplitude_bounds (c : Parameters) {y : ℝ} (hy : 0 ≤ y) : |
| 35 | -y ≤ logAmplitude c.dropLength c.lam y ∧ |
| 36 | logAmplitude c.dropLength c.lam y ≤ y := by |
| 37 | have hc : Continuous (fun t => slope c.dropLength c.lam t - 1 / 2) := |
| 38 | (slope_contDiff _ _).continuous.sub continuous_const |
| 39 | have hl : ∀ t, (-1 : ℝ) ≤ slope c.dropLength c.lam t - 1 / 2 := by |
| 40 | intro t |
| 41 | linarith [(slope_bounds c t).1, c.lam_lt] |
| 42 | have hu : ∀ t, slope c.dropLength c.lam t - 1 / 2 ≤ (1 : ℝ) := by |
| 43 | intro t |
| 44 | linarith [(slope_bounds c t).2] |
| 45 | constructor |
| 46 | · have h := intervalIntegral.integral_mono_on (μ := volume) hy |
| 47 | (continuous_const.intervalIntegrable 0 y) (hc.intervalIntegrable 0 y) |
| 48 | (fun t _ => hl t) |
| 49 | simpa [logAmplitude, primitive] using h |
| 50 | · have h := intervalIntegral.integral_mono_on (μ := volume) hy |
| 51 | (hc.intervalIntegrable 0 y) (continuous_const.intervalIntegrable 0 y) |
| 52 | (fun t _ => hu t) |
| 53 | simpa [logAmplitude, primitive] using h |
| 54 | |
| 55 | theorem radialAmplitude_bounds (c : Parameters) {y : ℝ} (hy : 0 ≤ y) : |
| 56 | c.P * Real.exp (-y) ≤ radialAmplitude c.P c.dropLength c.lam y ∧ |
| 57 | radialAmplitude c.P c.dropLength c.lam y ≤ c.P * Real.exp y := by |
| 58 | obtain ⟨hl, hu⟩ := logAmplitude_bounds c hy |
| 59 | exact ⟨mul_le_mul_of_nonneg_left (Real.exp_le_exp.mpr hl) c.P_pos.le, |
| 60 | mul_le_mul_of_nonneg_left (Real.exp_le_exp.mpr hu) c.P_pos.le⟩ |
| 61 | |
| 62 | theorem integral_stops {g : ℝ → ℝ} (hg : Continuous g) {a b : ℝ} |
| 63 | (hab : a ≤ b) (hz : ∀ t, a ≤ t → g t = 0) : |
| 64 | (∫ t in (0 : ℝ)..b, g t) = ∫ t in (0 : ℝ)..a, g t := by |
| 65 | have hzero : (∫ t in a..b, g t) = 0 := by |
| 66 | calc |
| 67 | _ = ∫ _t in a..b, (0 : ℝ) := by |
| 68 | apply intervalIntegral.integral_congr |
| 69 | intro t ht |
| 70 | exact hz t (uIcc_of_le hab ▸ ht).1 |
| 71 | _ = 0 := by simp |
| 72 | have h := intervalIntegral.integral_add_adjacent_intervals (μ := volume) |
| 73 | (hg.intervalIntegrable 0 a) (hg.intervalIntegrable a b) |
| 74 | rw [hzero, add_zero] at h |
| 75 | exact h.symm |
| 76 | |
| 77 | theorem dropEnd_le_pulseStart (c : Parameters) : Real.exp c.m ≤ c.pulseStart := by |
| 78 | have h := c.pulseStart_ge_hold |
| 79 | dsimp [Parameters.holdStart, Parameters.dropLength] at h |
| 80 | linarith |
| 81 | |
| 82 | theorem prefixM_fixed_interval (c : Parameters) : |
| 83 | prefixM c = 4 + ∫ y in (0 : ℝ)..Real.exp c.m, |
| 84 | Real.exp y * dropCoefficient c.m y := by |
| 85 | unfold prefixM |
| 86 | congr 1 |
| 87 | apply integral_stops |
| 88 | (Real.continuous_exp.mul (dropCoefficient_contDiff c.m_pos).continuous) |
| 89 | (dropEnd_le_pulseStart c) |
| 90 | intro t ht |
| 91 | simp only [Pi.mul_apply] |
| 92 | rw [dropCoefficient_late c.m_pos ht, mul_zero] |
| 93 | |
| 94 | theorem prefixJ_fixed_interval (c : Parameters) : |
| 95 | prefixJ c = (5 / 2) * Real.sqrt 2 * c.P + |
| 96 | ∫ y in (0 : ℝ)..Real.exp c.m, |
| 97 | Real.sqrt 2 * Real.exp (3 * y / 2) * |
| 98 | radialAmplitude c.P c.dropLength c.lam y * dropCoefficient c.m y := by |
| 99 | unfold prefixJ |
| 100 | congr 1 |
| 101 | apply integral_stops |
| 102 | (((continuous_const.mul (Real.continuous_exp.comp |
| 103 | ((continuous_const.mul continuous_id).div_const 2))).mul |
| 104 | (radialAmplitude_contDiff _ _ _).continuous).mul |
| 105 | (dropCoefficient_contDiff c.m_pos).continuous) |
| 106 | (dropEnd_le_pulseStart c) |
| 107 | intro t ht |
| 108 | simp only [Pi.mul_apply, Function.comp_apply, id_eq] |
| 109 | rw [dropCoefficient_late c.m_pos ht, mul_zero] |
| 110 | |
| 111 | theorem prefixM_bounds (c : Parameters) : |
| 112 | 0 ≤ prefixM c ∧ prefixM c ≤ 4 + 4 * Real.exp c.m * Real.exp (Real.exp c.m) := by |
| 113 | rw [prefixM_fixed_interval] |
| 114 | have hc : Continuous (fun y => Real.exp y * dropCoefficient c.m y) := |
| 115 | Real.continuous_exp.mul (dropCoefficient_contDiff c.m_pos).continuous |
| 116 | have hpos := intervalIntegral.integral_nonneg (μ := volume) (Real.exp_pos c.m).le |
| 117 | (fun y _ => mul_nonneg (Real.exp_pos y).le (dropCoefficient_bounds c.m y).1) |
| 118 | have hup := intervalIntegral.integral_mono_on (μ := volume) (Real.exp_pos c.m).le |
| 119 | (hc.intervalIntegrable 0 _) (continuous_const.intervalIntegrable 0 _) |
| 120 | (fun y hy => show Real.exp y * dropCoefficient c.m y ≤ |
| 121 | 4 * Real.exp (Real.exp c.m) from by |
| 122 | calc |
| 123 | _ ≤ Real.exp (Real.exp c.m) * 4 := mul_le_mul |
| 124 | (Real.exp_le_exp.mpr hy.2) (dropCoefficient_bounds c.m y).2 |
| 125 | (dropCoefficient_bounds c.m y).1 (Real.exp_pos _).le |
| 126 | _ = _ := by ring) |
| 127 | simp only [intervalIntegral.integral_const, sub_zero, smul_eq_mul] at hup |
| 128 | constructor <;> nlinarith |
| 129 | |
| 130 | theorem prefixJ_bounds (c : Parameters) : |
| 131 | 0 ≤ prefixJ c ∧ |
| 132 | prefixJ c ≤ (5 / 2) * Real.sqrt 2 * c.P + |
| 133 | 4 * Real.sqrt 2 * c.P * Real.exp c.m * Real.exp (3 * Real.exp c.m) := by |
| 134 | rw [prefixJ_fixed_interval] |
| 135 | let K := Real.exp c.m |
| 136 | have hK : 0 < K := Real.exp_pos _ |
| 137 | have hs : 0 ≤ Real.sqrt (2 : ℝ) := Real.sqrt_nonneg _ |
| 138 | have he : ∀ y, 0 ≤ radialAmplitude c.P c.dropLength c.lam y := |
| 139 | fun y => (mul_pos c.P_pos (Real.exp_pos _)).le |
| 140 | have hc : Continuous (fun y => Real.sqrt 2 * Real.exp (3 * y / 2) * |
| 141 | radialAmplitude c.P c.dropLength c.lam y * dropCoefficient c.m y) := |
| 142 | (((continuous_const.mul (Real.continuous_exp.comp |
| 143 | ((continuous_const.mul continuous_id).div_const 2))).mul |
| 144 | (radialAmplitude_contDiff _ _ _).continuous).mul |
| 145 | (dropCoefficient_contDiff c.m_pos).continuous) |
| 146 | have hpos := intervalIntegral.integral_nonneg (μ := volume) hK.le |
| 147 | (fun y _ => mul_nonneg (mul_nonneg (mul_nonneg hs (Real.exp_pos (3 * y / 2)).le) |
| 148 | (he y)) (dropCoefficient_bounds c.m y).1) |
| 149 | have hup := intervalIntegral.integral_mono_on (μ := volume) hK.le |
| 150 | (hc.intervalIntegrable 0 K) (continuous_const.intervalIntegrable 0 K) |
| 151 | (fun y hy => show Real.sqrt 2 * Real.exp (3 * y / 2) * |
| 152 | radialAmplitude c.P c.dropLength c.lam y * dropCoefficient c.m y ≤ |
| 153 | 4 * Real.sqrt 2 * c.P * Real.exp (3 * K) from by |
| 154 | have hr := (radialAmplitude_bounds c hy.1).2 |
| 155 | have hE : radialAmplitude c.P c.dropLength c.lam y ≤ c.P * Real.exp K := |
| 156 | hr.trans (mul_le_mul_of_nonneg_left (Real.exp_le_exp.mpr hy.2) c.P_pos.le) |
| 157 | have hpow : Real.exp (3 * y / 2) ≤ Real.exp (2 * K) := |
| 158 | Real.exp_le_exp.mpr (by linarith [hy.2]) |
| 159 | calc |
| 160 | _ ≤ (Real.sqrt 2 * Real.exp (2 * K)) * (c.P * Real.exp K) * 4 := |
| 161 | mul_le_mul (mul_le_mul (mul_le_mul_of_nonneg_left hpow hs) hE |
| 162 | (he y) (mul_nonneg hs (Real.exp_pos _).le)) |
| 163 | (dropCoefficient_bounds c.m y).2 (dropCoefficient_bounds c.m y).1 |
| 164 | (mul_nonneg (mul_nonneg hs (Real.exp_pos _).le) |
| 165 | (mul_nonneg c.P_pos.le (Real.exp_pos _).le)) |
| 166 | _ = 4 * Real.sqrt 2 * c.P * (Real.exp (2 * K) * Real.exp K) := by ring |
| 167 | _ = _ := by rw [← Real.exp_add]; congr 3 ; ring) |
| 168 | simp only [intervalIntegral.integral_const, sub_zero, smul_eq_mul] at hup |
| 169 | change 0 ≤ (5 / 2) * Real.sqrt 2 * c.P + _ ∧ _ |
| 170 | constructor |
| 171 | · have hP := c.P_pos |
| 172 | exact add_nonneg (by positivity) hpos |
| 173 | · dsimp [K] at hup |
| 174 | nlinarith |
| 175 | |
| 176 | /-! ## Decay along the explicitly timed shaped wait -/ |
| 177 | |
| 178 | noncomputable def beta (c : Parameters) (i : Fin 2) : ℝ := c.exponents i + 1 |
| 179 | |
| 180 | theorem beta_bounds (c : Parameters) (i : Fin 2) : |
| 181 | 0 < beta c i ∧ beta c i ≤ 1 / 2 := by |
| 182 | fin_cases i <;> norm_num [beta, Parameters.exponents] <;> |
| 183 | constructor <;> linarith [c.lam_pos, c.lam_lt] |
| 184 | |
| 185 | theorem beta_small_bounds (c : Parameters) (hc : c.lam ≤ 1 / 120) (i : Fin 2) : |
| 186 | 2 / 5 ≤ beta c i ∧ 29 ≤ 60 * beta c i := by |
| 187 | fin_cases i <;> norm_num [beta, Parameters.exponents] <;> constructor <;> linarith |
| 188 | |
| 189 | noncomputable def holdAmplitude (c : Parameters) : ℝ := |
| 190 | radialAmplitude c.P c.dropLength c.lam c.holdStart |
| 191 | |
| 192 | theorem holdAmplitude_pos (c : Parameters) : 0 < holdAmplitude c := |
| 193 | mul_pos c.P_pos (Real.exp_pos _) |
| 194 | |
| 195 | theorem pulseAmplitude_split (c : Parameters) : |
| 196 | pulseAmplitude c = holdAmplitude c * Real.exp (-(1 / 2 + c.lam) * c.wait) := by |
| 197 | have h := radialAmplitude_hold (P := c.P) (lam := c.lam) c.dropLength_pos.le |
| 198 | (show c.dropLength + 2 ≤ c.holdStart from le_rfl) c.pulseStart_ge_hold |
| 199 | simpa [pulseAmplitude, holdAmplitude, Parameters.pulseStart] using h |
| 200 | |
| 201 | noncomputable def holdScale (c : Parameters) (i : Fin 2) : ℝ := |
| 202 | if i = 0 then Real.exp c.holdStart * holdAmplitude c |
| 203 | else Real.sqrt 2 * Real.exp (3 * c.holdStart / 2) * holdAmplitude c ^ 2 |
| 204 | |
| 205 | noncomputable def scaleFloor (P m : ℝ) (i : Fin 2) : ℝ := |
| 206 | if i = 0 then P else |
| 207 | Real.sqrt 2 * P ^ 2 * Real.exp (-(Real.exp m + 12) / 2) |
| 208 | |
| 209 | theorem scaleFloor_pos {P : ℝ} (hP : 0 < P) (m : ℝ) (i : Fin 2) : |
| 210 | 0 < scaleFloor P m i := by |
| 211 | unfold scaleFloor |
| 212 | split_ifs <;> positivity |
| 213 | |
| 214 | theorem holdScale_lower (c : Parameters) (i : Fin 2) : |
| 215 | scaleFloor c.P c.m i ≤ holdScale c i := by |
| 216 | have he := (radialAmplitude_bounds c c.holdStart_pos.le).1 |
| 217 | change c.P * Real.exp (-c.holdStart) ≤ holdAmplitude c at he |
| 218 | have hexp : Real.exp c.holdStart * Real.exp (-c.holdStart) = 1 := by |
| 219 | rw [← Real.exp_add]; simp |
| 220 | fin_cases i |
| 221 | · norm_num [scaleFloor, holdScale] |
| 222 | calc |
| 223 | c.P = Real.exp c.holdStart * (c.P * Real.exp (-c.holdStart)) := by |
| 224 | calc |
| 225 | _ = c.P * (Real.exp c.holdStart * Real.exp (-c.holdStart)) := by rw [hexp]; ring |
| 226 | _ = _ := by ring |
| 227 | _ ≤ _ := mul_le_mul_of_nonneg_left he (Real.exp_pos _).le |
| 228 | · simp only [scaleFloor, holdScale] |
| 229 | have hs := mul_le_mul_of_nonneg_left |
| 230 | (pow_le_pow_left₀ (mul_nonneg c.P_pos.le (Real.exp_pos _).le) he 2) |
| 231 | (mul_nonneg (Real.sqrt_nonneg 2) (Real.exp_pos (3 * c.holdStart / 2)).le) |
| 232 | calc |
| 233 | _ = Real.sqrt 2 * Real.exp (3 * c.holdStart / 2) * |
| 234 | (c.P * Real.exp (-c.holdStart)) ^ 2 := by |
| 235 | rw [mul_pow, ← Real.exp_nat_mul] |
| 236 | have hex : Real.exp (3 * c.holdStart / 2) * Real.exp (2 * -c.holdStart) = |
| 237 | Real.exp (-(Real.exp c.m + 12) / 2) := by |
| 238 | rw [← Real.exp_add] |
| 239 | congr 1 |
| 240 | dsimp [Parameters.holdStart, Parameters.dropLength] |
| 241 | ring |
| 242 | rw [← hex] |
| 243 | ring_nf ; norm_num |
| 244 | _ ≤ _ := hs |
| 245 | |
| 246 | theorem momentScale_split (c : Parameters) (i : Fin 2) : |
| 247 | momentScale c i = holdScale c i * Real.exp (beta c i * c.wait) := by |
| 248 | rw [momentScale, pulseAmplitude_split] |
| 249 | fin_cases i <;> norm_num [holdScale, beta, Parameters.exponents, Parameters.pulseStart] |
| 250 | · rw [Real.exp_add] |
| 251 | have he : Real.exp c.wait * Real.exp (-(1 / 2 + c.lam) * c.wait) = |
| 252 | Real.exp ((-(1 / 2 + c.lam) + 1) * c.wait) := by |
| 253 | rw [← Real.exp_add]; congr 1; ring |
| 254 | calc |
| 255 | _ = (Real.exp c.holdStart * holdAmplitude c) * |
| 256 | (Real.exp c.wait * Real.exp (-(1 / 2 + c.lam) * c.wait)) := by ring_nf |
| 257 | _ = _ := by rw [he]; congr 2 ; ring |
| 258 | · rw [mul_pow, ← Real.exp_nat_mul] |
| 259 | have he : Real.exp (3 * (c.holdStart + c.wait) / 2) * |
| 260 | Real.exp (2 * (-(1 / 2 + c.lam) * c.wait)) = |
| 261 | Real.exp (3 * c.holdStart / 2) * |
| 262 | Real.exp ((-(1 / 2 + 2 * c.lam) + 1) * c.wait) := by |
| 263 | rw [← Real.exp_add, ← Real.exp_add]; congr 1; ring |
| 264 | calc |
| 265 | _ = Real.sqrt 2 * holdAmplitude c ^ 2 * |
| 266 | (Real.exp (3 * (c.holdStart + c.wait) / 2) * |
| 267 | Real.exp (2 * (-(1 / 2 + c.lam) * c.wait))) := by ring_nf |
| 268 | _ = _ := by rw [he]; ring_nf |
| 269 | |
| 270 | theorem exp_log_inverse_nat {lam : ℝ} (hlam : 0 < lam) (n : ℕ) : |
| 271 | Real.exp (-(n : ℝ) * Real.log (1 / lam)) = lam ^ n := by |
| 272 | rw [one_div, Real.log_inv] |
| 273 | rw [neg_mul_neg, Real.exp_nat_mul, Real.exp_log hlam] |
| 274 | |
| 275 | theorem wait_decay (c : Parameters) (hwait : c.wait = 60 * Real.log (1 / c.lam)) |
| 276 | (hsmall : c.lam ≤ 1 / 120) (i : Fin 2) : |
| 277 | Real.exp (-(beta c i * c.wait)) ≤ c.lam ^ 29 := by |
| 278 | have hlog : 0 ≤ Real.log (1 / c.lam) := Real.log_nonneg (by |
| 279 | apply (le_div_iff₀ c.lam_pos).mpr |
| 280 | linarith [c.lam_lt]) |
| 281 | rw [← exp_log_inverse_nat c.lam_pos 29] |
| 282 | apply Real.exp_le_exp.mpr |
| 283 | rw [hwait] |
| 284 | have h := mul_le_mul_of_nonneg_right (beta_small_bounds c hsmall i).2 hlog |
| 285 | nlinarith |
| 286 | |
| 287 | theorem pulseAmplitude_small (c : Parameters) |
| 288 | (hwait : c.wait = 60 * Real.log (1 / c.lam)) : |
| 289 | pulseAmplitude c ≤ c.P * Real.exp (Real.exp c.m + 12) * c.lam ^ 30 := by |
| 290 | rw [pulseAmplitude_split] |
| 291 | have hhold := (radialAmplitude_bounds c c.holdStart_pos.le).2 |
| 292 | change holdAmplitude c ≤ c.P * Real.exp c.holdStart at hhold |
| 293 | have hw : 0 ≤ c.wait := by linarith [c.wait_gt] |
| 294 | have hdec : Real.exp (-(1 / 2 + c.lam) * c.wait) ≤ c.lam ^ 30 := by |
| 295 | rw [← exp_log_inverse_nat c.lam_pos 30] |
| 296 | apply Real.exp_le_exp.mpr |
| 297 | have hprod := mul_nonneg c.lam_pos.le hw |
| 298 | rw [hwait] at hprod ⊢ |
| 299 | nlinarith |
| 300 | have h := mul_le_mul hhold hdec (Real.exp_pos _).le |
| 301 | (mul_nonneg c.P_pos.le (Real.exp_pos _).le) |
| 302 | convert! h using 1 ; dsimp [Parameters.holdStart, Parameters.dropLength] ; congr 2 ; ring_nf |
| 303 | |
| 304 | noncomputable def prefixNumeratorBound (P m : ℝ) (i : Fin 2) : ℝ := |
| 305 | if i = 0 then 4 + 4 * Real.exp m * Real.exp (Real.exp m) else |
| 306 | (5 / 2) * Real.sqrt 2 * P + 4 * Real.sqrt 2 * P * Real.exp m * Real.exp (3 * Real.exp m) |
| 307 | |
| 308 | noncomputable def prefixBound (P m : ℝ) (i : Fin 2) : ℝ := |
| 309 | prefixNumeratorBound P m i / scaleFloor P m i |
| 310 | |
| 311 | theorem prefixNumeratorBound_pos {P : ℝ} (hP : 0 < P) (m : ℝ) (i : Fin 2) : |
| 312 | 0 < prefixNumeratorBound P m i := by |
| 313 | unfold prefixNumeratorBound |
| 314 | split_ifs <;> positivity |
| 315 | |
| 316 | theorem prefixBound_pos {P : ℝ} (hP : 0 < P) (m : ℝ) (i : Fin 2) : |
| 317 | 0 < prefixBound P m i := |
| 318 | div_pos (prefixNumeratorBound_pos hP m i) (scaleFloor_pos hP m i) |
| 319 | |
| 320 | theorem prefixCoefficient_nonneg (c : Parameters) (i : Fin 2) : |
| 321 | 0 ≤ prefixCoefficient c i := by |
| 322 | apply div_nonneg _ (momentScale_pos c i).le |
| 323 | split_ifs |
| 324 | · exact (prefixM_bounds c).1 |
| 325 | · exact (prefixJ_bounds c).1 |
| 326 | |
| 327 | theorem prefixCoefficient_decay (c : Parameters) (i : Fin 2) : |
| 328 | prefixCoefficient c i ≤ prefixBound c.P c.m i * Real.exp (-(beta c i * c.wait)) := by |
| 329 | have hn : (if i = 0 then prefixM c else prefixJ c) ≤ prefixNumeratorBound c.P c.m i := by |
| 330 | unfold prefixNumeratorBound |
| 331 | split_ifs |
| 332 | · exact (prefixM_bounds c).2 |
| 333 | · exact (prefixJ_bounds c).2 |
| 334 | have hfloor := scaleFloor_pos c.P_pos c.m i |
| 335 | have hsc : scaleFloor c.P c.m i * Real.exp (beta c i * c.wait) ≤ momentScale c i := by |
| 336 | rw [momentScale_split] |
| 337 | exact mul_le_mul_of_nonneg_right (holdScale_lower c i) (Real.exp_pos _).le |
| 338 | calc |
| 339 | prefixCoefficient c i ≤ prefixNumeratorBound c.P c.m i / momentScale c i := |
| 340 | div_le_div_of_nonneg_right hn (momentScale_pos c i).le |
| 341 | _ ≤ prefixNumeratorBound c.P c.m i / |
| 342 | (scaleFloor c.P c.m i * Real.exp (beta c i * c.wait)) := |
| 343 | div_le_div_of_nonneg_left (prefixNumeratorBound_pos c.P_pos c.m i).le |
| 344 | (mul_pos hfloor (Real.exp_pos _)) hsc |
| 345 | _ = _ := by rw [Real.exp_neg]; unfold prefixBound; field_simp |
| 346 | |
| 347 | theorem prefixCoefficient_small (c : Parameters) |
| 348 | (hwait : c.wait = 60 * Real.log (1 / c.lam)) |
| 349 | (hsmall : c.lam ≤ 1 / 120) (i : Fin 2) : |
| 350 | |prefixCoefficient c i| ≤ prefixBound c.P c.m i * c.lam ^ 29 := by |
| 351 | rw [abs_of_nonneg (prefixCoefficient_nonneg c i)] |
| 352 | exact (prefixCoefficient_decay c i).trans |
| 353 | (mul_le_mul_of_nonneg_left (wait_decay c hwait hsmall i) |
| 354 | (prefixBound_pos c.P_pos c.m i).le) |
| 355 | |
| 356 | /-! The mass average is divided by the actual angular profile, including its |
| 357 | parameter shape. These bounds therefore include the shape's first derivative. -/ |
| 358 | |
| 359 | noncomputable def parameterPolynomial (eta : ℝ) : ℝ := eta * (1 + eta ^ 2) |
| 360 | |
| 361 | theorem parameterPolynomial_bound {eta : ℝ} (heta : |eta| ≤ 1) : |
| 362 | |parameterPolynomial eta| ≤ 2 := by |
| 363 | have hs : eta ^ 2 ≤ 1 := by |
| 364 | have h := sq_le_sq₀ (abs_nonneg eta) (by norm_num : (0 : ℝ) ≤ 1) |>.mpr heta |
| 365 | simpa using h |
| 366 | rw [parameterPolynomial, abs_mul, abs_of_nonneg (by positivity : 0 ≤ 1 + eta ^ 2)] |
| 367 | nlinarith [abs_nonneg eta] |
| 368 | |
| 369 | theorem parameterPolynomial_hasDerivAt (eta : ℝ) : |
| 370 | HasDerivAt parameterPolynomial (1 + 3 * eta ^ 2) eta := by |
| 371 | convert! (hasDerivAt_id eta).mul ((hasDerivAt_const eta (1 : ℝ)).add |
| 372 | ((hasDerivAt_id eta).pow 2)) using 1 ; dsimp [parameterPolynomial] ; ring |
| 373 | |
| 374 | theorem parameterPolynomial_derivative_bound {eta : ℝ} (heta : |eta| ≤ 1) : |
| 375 | |deriv parameterPolynomial eta| ≤ 4 := by |
| 376 | rw [(parameterPolynomial_hasDerivAt eta).deriv, |
| 377 | abs_of_nonneg (by positivity : 0 ≤ 1 + 3 * eta ^ 2)] |
| 378 | have hs : eta ^ 2 ≤ 1 := by |
| 379 | have h := sq_le_sq₀ (abs_nonneg eta) (by norm_num : (0 : ℝ) ≤ 1) |>.mpr heta |
| 380 | simpa using h |
| 381 | nlinarith |
| 382 | |
| 383 | theorem normalized_mass_prefix (c : Parameters) (amp : ℝ → ℝ) (eta : ℝ) : |
| 384 | massMoment c amp eta c.pulseStart / |
| 385 | (Real.exp c.pulseStart * angular c.P c.dropLength c.lam (c.pulseStart, eta)) = |
| 386 | prefixCoefficient c 0 * parameterPolynomial eta := by |
| 387 | rw [massMoment_at_pulseStart] |
| 388 | simp only [angular, shape, prefixCoefficient, momentScale, ↓reduceIte, |
| 389 | pulseAmplitude, parameterPolynomial] |
| 390 | have he := Real.exp_pos c.pulseStart |
| 391 | have hr : 0 < radialAmplitude c.P c.dropLength c.lam c.pulseStart := pulseAmplitude_pos c |
| 392 | have hp : 0 < 1 + eta ^ 2 := by positivity |
| 393 | field_simp |
| 394 | |
| 395 | theorem normalized_mass_prefix_small (c : Parameters) |
| 396 | (hwait : c.wait = 60 * Real.log (1 / c.lam)) (hsmall : c.lam ≤ 1 / 120) |
| 397 | (amp : ℝ → ℝ) {eta : ℝ} (heta : |eta| ≤ 1) : |
| 398 | |massMoment c amp eta c.pulseStart / |
| 399 | (Real.exp c.pulseStart * angular c.P c.dropLength c.lam (c.pulseStart, eta))| ≤ |
| 400 | (2 * prefixBound c.P c.m 0) * c.lam ^ 29 := by |
| 401 | rw [normalized_mass_prefix, abs_mul] |
| 402 | have h := mul_le_mul (prefixCoefficient_small c hwait hsmall 0) |
| 403 | (parameterPolynomial_bound heta) (abs_nonneg _) |
| 404 | (mul_nonneg (prefixBound_pos c.P_pos c.m 0).le (pow_nonneg c.lam_pos.le 29)) |
| 405 | nlinarith |
| 406 | |
| 407 | /-! ## The actual bump is one fixed template in log coordinates -/ |
| 408 | |
| 409 | noncomputable def templateLower : ℝ := Real.exp (-(3 / 20 : ℝ)) |
| 410 | noncomputable def templateUpper : ℝ := Real.exp (3 / 20 : ℝ) |
| 411 | noncomputable def radialTemplate : ℝ → ℝ := |
| 412 | LocalizedMomentRepair.bump templateLower templateUpper |
| 413 | noncomputable def logTemplate (z : ℝ) : ℝ := radialTemplate (Real.exp z) |
| 414 | |
| 415 | theorem templateLower_pos : 0 < templateLower := Real.exp_pos _ |
| 416 | theorem templateLower_lt_upper : templateLower < templateUpper := by |
| 417 | apply Real.exp_lt_exp.mpr |
| 418 | norm_num |
| 419 | |
| 420 | theorem radialTemplate_contDiff : ContDiff ℝ ∞ radialTemplate := |
| 421 | LocalizedMomentRepair.bump_contDiff _ _ |
| 422 | |
| 423 | theorem radialTemplate_hasCompactSupport : HasCompactSupport radialTemplate := |
| 424 | LocalizedMomentRepair.bump_hasCompactSupport _ _ templateLower_lt_upper |
| 425 | |
| 426 | theorem radialTemplate_nonneg (x : ℝ) : 0 ≤ radialTemplate x := |
| 427 | LocalizedMomentRepair.bump_nonneg _ _ _ |
| 428 | |
| 429 | theorem radialTemplate_support (x : ℝ) (hx : radialTemplate x ≠ 0) : |
| 430 | templateLower < x ∧ x < templateUpper := |
| 431 | LocalizedMomentRepair.bump_tsupport_subset_open _ _ templateLower_lt_upper (subset_closure hx) |
| 432 | |
| 433 | theorem logTemplate_contDiff : ContDiff ℝ ∞ logTemplate := |
| 434 | radialTemplate_contDiff.comp contDiff_id.exp |
| 435 | |
| 436 | theorem logTemplate_support : support logTemplate ⊆ Icc (-1 : ℝ) 1 := by |
| 437 | intro z hz |
| 438 | have h := radialTemplate_support (Real.exp z) hz |
| 439 | change Real.exp (-(3 / 20 : ℝ)) < Real.exp z ∧ Real.exp z < Real.exp (3 / 20 : ℝ) at h |
| 440 | have hl := Real.exp_lt_exp.mp h.1 |
| 441 | have hu := Real.exp_lt_exp.mp h.2 |
| 442 | constructor <;> linarith |
| 443 | |
| 444 | theorem logTemplate_hasCompactSupport : HasCompactSupport logTemplate := |
| 445 | HasCompactSupport.of_support_subset_isCompact isCompact_Icc logTemplate_support |
| 446 | |
| 447 | theorem logTemplate_jet_bound (k : ℕ) : |
| 448 | ∃ C : ℝ, 0 ≤ C ∧ ∀ y, |iteratedDeriv k logTemplate y| ≤ C := |
| 449 | LocalizedMomentRepair.smooth_compact_derivative_bound logTemplate |
| 450 | logTemplate_contDiff logTemplate_hasCompactSupport k |
| 451 | |
| 452 | theorem bump_scale {k : ℝ} (hk : k ≠ 0) (l u x : ℝ) : |
| 453 | LocalizedMomentRepair.bump (k * l) (k * u) (k * x) = |
| 454 | LocalizedMomentRepair.bump l u x := by |
| 455 | unfold LocalizedMomentRepair.bump |
| 456 | congr 1 |
| 457 | calc |
| 458 | _ = (k * (x - (l + u) / 2)) / (k * ((u - l) / 4)) := by |
| 459 | congr 1 <;> ring |
| 460 | _ = _ := mul_div_mul_left _ _ hk |
| 461 | |
| 462 | noncomputable def center (c : Parameters) (j : Fin 2) : ℝ := |
| 463 | c.pulseLength - if j = 0 then 3 else 1 |
| 464 | |
| 465 | theorem lower_scale (c : Parameters) (j : Fin 2) : |
| 466 | c.lower j = Real.exp (center c j) * templateLower := by |
| 467 | change Real.exp (c.pulseLength - if j = 0 then 63 / 20 else 23 / 20) = |
| 468 | Real.exp (center c j) * Real.exp (-(3 / 20 : ℝ)) |
| 469 | rw [← Real.exp_add] |
| 470 | apply congrArg Real.exp |
| 471 | fin_cases j <;> norm_num [center] <;> ring |
| 472 | |
| 473 | theorem upper_scale (c : Parameters) (j : Fin 2) : |
| 474 | c.upper j = Real.exp (center c j) * templateUpper := by |
| 475 | change Real.exp (c.pulseLength - if j = 0 then 57 / 20 else 17 / 20) = |
| 476 | Real.exp (center c j) * Real.exp (3 / 20 : ℝ) |
| 477 | rw [← Real.exp_add] |
| 478 | apply congrArg Real.exp |
| 479 | fin_cases j <;> norm_num [center] <;> ring |
| 480 | |
| 481 | theorem bump_log_translate (c : Parameters) (j : Fin 2) (y : ℝ) : |
| 482 | LocalizedMomentRepair.bump (c.lower j) (c.upper j) (Real.exp y) = |
| 483 | logTemplate (y - center c j) := by |
| 484 | rw [lower_scale, upper_scale] |
| 485 | have he : Real.exp y = Real.exp (center c j) * Real.exp (y - center c j) := by |
| 486 | rw [← Real.exp_add] |
| 487 | congr 1 |
| 488 | ring |
| 489 | rw [he, bump_scale (Real.exp_ne_zero _)] |
| 490 | rfl |
| 491 | |
| 492 | noncomputable def templateMass : ℝ := ∫ x, radialTemplate x |
| 493 | noncomputable def rowMoment (a : ℝ) : ℝ := ∫ x, x ^ a * radialTemplate x |
| 494 | noncomputable def rowFloor : ℝ := Real.exp (-1) * templateMass |
| 495 | |
| 496 | theorem templateMass_pos : 0 < templateMass := by |
| 497 | apply integral_pos_of_integrable_nonneg_nonzero radialTemplate_contDiff.continuous |
| 498 | (radialTemplate_contDiff.continuous.integrable_of_hasCompactSupport |
| 499 | radialTemplate_hasCompactSupport) radialTemplate_nonneg |
| 500 | (x := (templateLower + templateUpper) / 2) |
| 501 | rw [radialTemplate, LocalizedMomentRepair.bump_at_center] |
| 502 | norm_num |
| 503 | |
| 504 | theorem rowFloor_pos : 0 < rowFloor := mul_pos (Real.exp_pos _) templateMass_pos |
| 505 | |
| 506 | theorem rowMoment_integrable (a : ℝ) : Integrable (fun x => x ^ a * radialTemplate x) := |
| 507 | LocalizedMomentRepair.integrable_power_mul_bump a _ _ templateLower_pos templateLower_lt_upper |
| 508 | |
| 509 | theorem rowMoment_bounds {a : ℝ} (ha : -1 ≤ a) (ha' : a ≤ 0) : |
| 510 | rowFloor ≤ rowMoment a ∧ rowMoment a ≤ Real.exp 1 * templateMass := by |
| 511 | have hm : Integrable radialTemplate := radialTemplate_contDiff.continuous.integrable_of_hasCompactSupport |
| 512 | radialTemplate_hasCompactSupport |
| 513 | have hp : ∀ x, radialTemplate x ≠ 0 → Real.exp (-1) ≤ x ^ a ∧ x ^ a ≤ Real.exp 1 := by |
| 514 | intro x hx |
| 515 | have hs := radialTemplate_support x hx |
| 516 | have hxpos := templateLower_pos.trans hs.1 |
| 517 | have hl : -(3 / 20 : ℝ) < Real.log x := by |
| 518 | simpa only [templateLower, Real.log_exp] using Real.log_lt_log templateLower_pos hs.1 |
| 519 | have hu : Real.log x < (3 / 20 : ℝ) := by |
| 520 | simpa only [templateUpper, Real.log_exp] using Real.log_lt_log hxpos hs.2 |
| 521 | have hab : |a| ≤ 1 := abs_le.mpr ⟨ha, by linarith⟩ |
| 522 | have hlb : |Real.log x| ≤ 1 := abs_le.mpr ⟨by linarith, by linarith⟩ |
| 523 | have hh : |Real.log x * a| ≤ 1 := by |
| 524 | rw [abs_mul] |
| 525 | nlinarith [abs_nonneg a, abs_nonneg (Real.log x)] |
| 526 | rw [Real.rpow_def_of_pos hxpos] |
| 527 | exact ⟨Real.exp_le_exp.mpr (abs_le.mp hh).1, |
| 528 | Real.exp_le_exp.mpr (abs_le.mp hh).2⟩ |
| 529 | constructor |
| 530 | · have h := integral_mono (hm.const_mul (Real.exp (-1))) (rowMoment_integrable a) |
| 531 | (fun x => show Real.exp (-1) * radialTemplate x ≤ x ^ a * radialTemplate x from by |
| 532 | by_cases hx : radialTemplate x = 0 |
| 533 | · simp [hx] |
| 534 | · exact mul_le_mul_of_nonneg_right (hp x hx).1 (radialTemplate_nonneg x)) |
| 535 | simpa only [integral_const_mul, rowFloor, templateMass, rowMoment] using h |
| 536 | · have h := integral_mono (rowMoment_integrable a) (hm.const_mul (Real.exp 1)) |
| 537 | (fun x => show x ^ a * radialTemplate x ≤ Real.exp 1 * radialTemplate x from by |
| 538 | by_cases hx : radialTemplate x = 0 |
| 539 | · simp [hx] |
| 540 | · exact mul_le_mul_of_nonneg_right (hp x hx).2 (radialTemplate_nonneg x)) |
| 541 | simpa only [integral_const_mul, templateMass, rowMoment] using h |
| 542 | |
| 543 | theorem power_bump_integral_scale (a : ℝ) {k l u : ℝ} |
| 544 | (hk : 0 < k) (hl : 0 < l) (hlu : l < u) : |
| 545 | (∫ t : ℝ, t ^ a * LocalizedMomentRepair.bump (k * l) (k * u) t) = |
| 546 | (k * k ^ a) * ∫ t : ℝ, t ^ a * LocalizedMomentRepair.bump l u t := by |
| 547 | let g := fun t : ℝ => t ^ a * LocalizedMomentRepair.bump (k * l) (k * u) t |
| 548 | have hcomp : (fun x => g (k * x)) = |
| 549 | (fun x : ℝ => k ^ a * (x ^ a * LocalizedMomentRepair.bump l u x)) := by |
| 550 | funext x |
| 551 | dsimp [g] |
| 552 | rw [bump_scale hk.ne'] |
| 553 | by_cases hb : LocalizedMomentRepair.bump l u x = 0 |
| 554 | · simp [hb] |
| 555 | · have hx := LocalizedMomentRepair.bump_tsupport_subset_open l u hlu (subset_closure hb) |
| 556 | rw [Real.mul_rpow hk.le (hl.trans hx.1).le] |
| 557 | ring |
| 558 | have h := Measure.integral_comp_mul_left g k |
| 559 | rw [hcomp, integral_const_mul, abs_of_pos (inv_pos.mpr hk), smul_eq_mul] at h |
| 560 | calc |
| 561 | _ = k * (k⁻¹ * ∫ t, g t) := by rw [← mul_assoc, mul_inv_cancel₀ hk.ne', one_mul] |
| 562 | _ = k * (k ^ a * ∫ t : ℝ, t ^ a * LocalizedMomentRepair.bump l u t) := by rw [← h] |
| 563 | _ = _ := by ring |
| 564 | |
| 565 | theorem actual_matrix_entry (c : Parameters) (i j : Fin 2) : |
| 566 | LocalizedMomentRepair.matrix c.exponents c.lower c.upper i j = |
| 567 | rowMoment (c.exponents i) * Real.exp (beta c i * center c j) := by |
| 568 | change (∫ t : ℝ, t ^ c.exponents i * LocalizedMomentRepair.bump (c.lower j) (c.upper j) t) = _ |
| 569 | rw [lower_scale, upper_scale, |
| 570 | power_bump_integral_scale (c.exponents i) (Real.exp_pos _) templateLower_pos templateLower_lt_upper] |
| 571 | rw [Real.rpow_def_of_pos (Real.exp_pos _), Real.log_exp, ← Real.exp_add] |
| 572 | dsimp [rowMoment, radialTemplate, beta] |
| 573 | rw [mul_comm] |
| 574 | congr 2 |
| 575 | ring |
| 576 | |
| 577 | /-- The actual moment matrix, with each row normalized at the first center. -/ |
| 578 | noncomputable def normalizedMatrix (c : Parameters) : Matrix (Fin 2) (Fin 2) ℝ := |
| 579 | fun i j => Real.exp (-(beta c i * center c 0)) * |
| 580 | LocalizedMomentRepair.matrix c.exponents c.lower c.upper i j |
| 581 | |
| 582 | theorem normalizedMatrix_entry (c : Parameters) (i j : Fin 2) : |
| 583 | normalizedMatrix c i j = rowMoment (c.exponents i) * |
| 584 | (if j = 0 then 1 else Real.exp (2 * beta c i)) := by |
| 585 | rw [normalizedMatrix, actual_matrix_entry] |
| 586 | calc |
| 587 | _ = rowMoment (c.exponents i) * |
| 588 | Real.exp (beta c i * (center c j - center c 0)) := by |
| 589 | rw [show beta c i * (center c j - center c 0) = |
| 590 | -(beta c i * center c 0) + beta c i * center c j by ring, Real.exp_add] |
| 591 | ring |
| 592 | _ = _ := by fin_cases j <;> norm_num [center, mul_comm] |
| 593 | |
| 594 | theorem rowMoment_lower (c : Parameters) (i : Fin 2) : rowFloor ≤ rowMoment (c.exponents i) := by |
| 595 | apply (rowMoment_bounds ?_ ?_).1 |
| 596 | all_goals fin_cases i <;> norm_num [Parameters.exponents] <;> linarith [c.lam_pos, c.lam_lt] |
| 597 | |
| 598 | theorem rowMoment_pos (c : Parameters) (i : Fin 2) : 0 < rowMoment (c.exponents i) := |
| 599 | rowFloor_pos.trans_le (rowMoment_lower c i) |
| 600 | |
| 601 | theorem separation_exponential_bounds (c : Parameters) (i : Fin 2) : |
| 602 | 1 ≤ Real.exp (2 * beta c i) ∧ Real.exp (2 * beta c i) ≤ Real.exp 1 := by |
| 603 | constructor |
| 604 | · exact Real.one_le_exp_iff.mpr (by linarith [(beta_bounds c i).1]) |
| 605 | · exact Real.exp_le_exp.mpr (by linarith [(beta_bounds c i).2]) |
| 606 | |
| 607 | theorem separation_exponential_gap (c : Parameters) : |
| 608 | 2 * c.lam ≤ Real.exp (2 * beta c 0) - Real.exp (2 * beta c 1) := by |
| 609 | have hid : 2 * beta c 0 = 2 * beta c 1 + 2 * c.lam := by |
| 610 | norm_num [beta, Parameters.exponents] |
| 611 | ring |
| 612 | rw [hid, Real.exp_add] |
| 613 | have he := Real.add_one_le_exp (2 * c.lam) |
| 614 | have hb := (separation_exponential_bounds c 1).1 |
| 615 | nlinarith [mul_nonneg (by linarith : 0 ≤ Real.exp (2 * beta c 1) - 1) |
| 616 | (by linarith [c.lam_pos] : 0 ≤ Real.exp (2 * c.lam) - 1)] |
| 617 | |
| 618 | theorem normalizedMatrix_det_ne_zero (c : Parameters) : (normalizedMatrix c).det ≠ 0 := by |
| 619 | rw [Matrix.det_fin_two] |
| 620 | simp only [normalizedMatrix_entry] |
| 621 | norm_num |
| 622 | have h0 := rowMoment_pos c 0 |
| 623 | have h1 := rowMoment_pos c 1 |
| 624 | have hg := separation_exponential_gap c |
| 625 | have hgap : Real.exp (2 * beta c 1) - Real.exp (2 * beta c 0) < 0 := by |
| 626 | linarith [c.lam_pos] |
| 627 | have hprod := mul_neg_of_pos_of_neg (mul_pos h0 h1) hgap |
| 628 | nlinarith |
| 629 | |
| 630 | /-- A uniform inverse estimate from the actual exponential column separation. -/ |
| 631 | noncomputable def inverseBound : ℝ := (1 + Real.exp 1) / rowFloor |
| 632 | |
| 633 | theorem inverseBound_pos : 0 < inverseBound := div_pos (by positivity) rowFloor_pos |
| 634 | |
| 635 | theorem two_row_solution_bound {k lam A0 A1 r0 r1 x0 x1 d0 d1 : ℝ} |
| 636 | (hk : 0 < k) (hlam : 0 < lam) (hlam' : lam ≤ 1) |
| 637 | (hA0 : k ≤ A0) (hA1 : k ≤ A1) |
| 638 | (hr0 : 0 ≤ r0) (hr0' : r0 ≤ Real.exp 1) |
| 639 | (hgap : lam ≤ r0 - r1) |
| 640 | (h0 : A0 * (x0 + r0 * x1) = d0) (h1 : A1 * (x0 + r1 * x1) = d1) : |
| 641 | lam * |x0| ≤ ((1 + Real.exp 1) / k) * (|d0| + |d1|) ∧ |
| 642 | lam * |x1| ≤ ((1 + Real.exp 1) / k) * (|d0| + |d1|) := by |
| 643 | have hA0p := hk.trans_le hA0 |
| 644 | have hA1p := hk.trans_le hA1 |
| 645 | have h0' : x0 + r0 * x1 = d0 / A0 := (eq_div_iff hA0p.ne').mpr (by nlinarith [h0]) |
| 646 | have h1' : x0 + r1 * x1 = d1 / A1 := (eq_div_iff hA1p.ne').mpr (by nlinarith [h1]) |
| 647 | have ha0 : |d0 / A0| ≤ |d0| / k := by |
| 648 | rw [abs_div, abs_of_pos hA0p] |
| 649 | exact div_le_div_of_nonneg_left (abs_nonneg _) hk hA0 |
| 650 | have ha1 : |d1 / A1| ≤ |d1| / k := by |
| 651 | rw [abs_div, abs_of_pos hA1p] |
| 652 | exact div_le_div_of_nonneg_left (abs_nonneg _) hk hA1 |
| 653 | have hdx : (r0 - r1) * x1 = d0 / A0 - d1 / A1 := by nlinarith [h0', h1'] |
| 654 | have hdiff := abs_sub (d0 / A0) (d1 / A1) |
| 655 | rw [← hdx, abs_mul, abs_of_pos (hlam.trans_le hgap)] at hdiff |
| 656 | have hx1 : lam * |x1| ≤ (|d0| + |d1|) / k := by |
| 657 | have hx := mul_le_mul_of_nonneg_right hgap (abs_nonneg x1) |
| 658 | rw [add_div] |
| 659 | linarith |
| 660 | have hx0eq : x0 = d0 / A0 - r0 * x1 := by linarith [h0'] |
| 661 | have hx0 : |x0| ≤ |d0 / A0| + r0 * |x1| := by |
| 662 | rw [hx0eq] |
| 663 | simpa only [abs_mul, abs_of_nonneg hr0] using abs_sub (d0 / A0) (r0 * x1) |
| 664 | have hd : 0 ≤ (|d0| + |d1|) / k := div_nonneg (by positivity) hk.le |
| 665 | have he : 0 ≤ Real.exp (1 : ℝ) := (Real.exp_pos _).le |
| 666 | have h0d : |d0| / k ≤ (|d0| + |d1|) / k := |
| 667 | div_le_div_of_nonneg_right (by linarith [abs_nonneg d1]) hk.le |
| 668 | have hsmall : lam * |d0 / A0| ≤ (|d0| + |d1|) / k := by |
| 669 | have hmul := mul_le_mul_of_nonneg_right hlam' (abs_nonneg (d0 / A0)) |
| 670 | linarith |
| 671 | have hscaled := mul_le_mul_of_nonneg_left hx0 hlam.le |
| 672 | have hrscaled : r0 * (lam * |x1|) ≤ Real.exp 1 * ((|d0| + |d1|) / k) := |
| 673 | mul_le_mul hr0' hx1 (mul_nonneg hlam.le (abs_nonneg x1)) he |
| 674 | have hid : ((1 + Real.exp 1) / k) * (|d0| + |d1|) = |
| 675 | (|d0| + |d1|) / k + Real.exp 1 * ((|d0| + |d1|) / k) := by ring |
| 676 | constructor <;> rw [hid] |
| 677 | · nlinarith |
| 678 | · nlinarith |
| 679 | |
| 680 | theorem normalized_solution_bound (c : Parameters) (x d : Fin 2 → ℝ) |
| 681 | (h : (normalizedMatrix c).mulVec x = d) (j : Fin 2) : |
| 682 | c.lam * |x j| ≤ inverseBound * (|d 0| + |d 1|) := by |
| 683 | have h0 := congrFun h 0 |
| 684 | have h1 := congrFun h 1 |
| 685 | simp only [Matrix.mulVec, dotProduct, Fin.sum_univ_two, normalizedMatrix_entry] at h0 h1 |
| 686 | norm_num at h0 h1 |
| 687 | have hb := two_row_solution_bound rowFloor_pos c.lam_pos (by linarith [c.lam_lt]) |
| 688 | (rowMoment_lower c 0) (rowMoment_lower c 1) |
| 689 | (Real.exp_pos _).le (separation_exponential_bounds c 0).2 |
| 690 | (show c.lam ≤ Real.exp (2 * beta c 0) - Real.exp (2 * beta c 1) by |
| 691 | linarith [separation_exponential_gap c, c.lam_pos]) |
| 692 | (show rowMoment (c.exponents 0) * (x 0 + Real.exp (2 * beta c 0) * x 1) = d 0 by |
| 693 | nlinarith [h0]) |
| 694 | (show rowMoment (c.exponents 1) * (x 0 + Real.exp (2 * beta c 1) * x 1) = d 1 by |
| 695 | nlinarith [h1]) |
| 696 | fin_cases j |
| 697 | · exact hb.1 |
| 698 | · exact hb.2 |
| 699 | |
| 700 | theorem normalized_inverse_entry_bound (c : Parameters) (i j : Fin 2) : |
| 701 | c.lam * |(normalizedMatrix c)⁻¹ i j| ≤ inverseBound := by |
| 702 | let e : Fin 2 → ℝ := Pi.single j 1 |
| 703 | have h := MomentRepair.matrix_mul_coefficients (normalizedMatrix c) |
| 704 | (normalizedMatrix_det_ne_zero c) e |
| 705 | have hb := normalized_solution_bound c _ e h i |
| 706 | have he : |e 0| + |e 1| = 1 := by fin_cases j <;> norm_num [e, Pi.single_apply] |
| 707 | rw [he, mul_one] at hb |
| 708 | have hc : MomentRepair.coefficients (normalizedMatrix c) e i = (normalizedMatrix c)⁻¹ i j := by |
| 709 | fin_cases j <;> simp [MomentRepair.coefficients, Matrix.mulVec, dotProduct, |
| 710 | e, Pi.single_apply] |
| 711 | simpa only [hc] using hb |
| 712 | |
| 713 | theorem normalized_inverse_norm_bound (c : Parameters) : |
| 714 | c.lam * ‖fun i : Fin 2 => fun j : Fin 2 => (normalizedMatrix c)⁻¹ i j‖ ≤ inverseBound := by |
| 715 | have hb : ‖fun i : Fin 2 => fun j : Fin 2 => c.lam * (normalizedMatrix c)⁻¹ i j‖ ≤ |
| 716 | inverseBound := by |
| 717 | apply (pi_norm_le_iff_of_nonneg inverseBound_pos.le).mpr |
| 718 | intro i |
| 719 | apply (pi_norm_le_iff_of_nonneg inverseBound_pos.le).mpr |
| 720 | intro j |
| 721 | simpa only [Real.norm_eq_abs, abs_mul, abs_of_pos c.lam_pos] using |
| 722 | normalized_inverse_entry_bound c i j |
| 723 | have he : (fun i : Fin 2 => fun j : Fin 2 => c.lam * (normalizedMatrix c)⁻¹ i j) = |
| 724 | c.lam • (fun i : Fin 2 => fun j : Fin 2 => (normalizedMatrix c)⁻¹ i j) := rfl |
| 725 | rwa [he, norm_smul, Real.norm_eq_abs, abs_of_pos c.lam_pos] at hb |
| 726 | |
| 727 | noncomputable def normalizedDebt (c : Parameters) (d : Fin 2 → ℝ) (i : Fin 2) : ℝ := |
| 728 | Real.exp (-(beta c i * center c 0)) * d i |
| 729 | |
| 730 | theorem actual_coefficients_normalized_system (c : Parameters) (d : Fin 2 → ℝ) : |
| 731 | (normalizedMatrix c).mulVec |
| 732 | (LocalizedMomentRepair.coefficients c.exponents c.lower c.upper d) = |
| 733 | normalizedDebt c d := by |
| 734 | have h := MomentRepair.matrix_mul_coefficients |
| 735 | (LocalizedMomentRepair.matrix c.exponents c.lower c.upper) |
| 736 | (LocalizedMomentRepair.matrix_det_ne_zero c.exponents c.lower c.upper |
| 737 | c.exponents_injective c.lower_pos c.lower_lt_upper c.intervals_separated) d |
| 738 | ext i |
| 739 | have hi := congrFun h i |
| 740 | change (∑ j : Fin 2, (Real.exp (-(beta c i * center c 0)) * |
| 741 | LocalizedMomentRepair.matrix c.exponents c.lower c.upper i j) * |
| 742 | LocalizedMomentRepair.coefficients c.exponents c.lower c.upper d j) = _ |
| 743 | simp_rw [mul_assoc] |
| 744 | rw [← Finset.mul_sum] |
| 745 | exact congrArg (fun x => Real.exp (-(beta c i * center c 0)) * x) hi |
| 746 | |
| 747 | theorem actual_coefficients_bound (c : Parameters) (d : Fin 2 → ℝ) (j : Fin 2) : |
| 748 | c.lam * |LocalizedMomentRepair.coefficients c.exponents c.lower c.upper d j| ≤ |
| 749 | inverseBound * (|normalizedDebt c d 0| + |normalizedDebt c d 1|) := |
| 750 | normalized_solution_bound c _ _ (actual_coefficients_normalized_system c d) j |
| 751 | |
| 752 | /-! ## Actual normalized debts -/ |
| 753 | |
| 754 | theorem mainPulse_hasCompactSupport : HasCompactSupport mainPulse := by |
| 755 | have hs : support mainPulse ⊆ Icc (0 : ℝ) 11 := by |
| 756 | intro z hz |
| 757 | constructor |
| 758 | · by_contra h |
| 759 | exact hz (mainPulse_zero_left (by linarith)) |
| 760 | · by_contra h |
| 761 | exact hz (mainPulse_zero_right (by linarith)) |
| 762 | exact HasCompactSupport.of_support_subset_isCompact isCompact_Icc hs |
| 763 | |
| 764 | theorem exists_mainPulse_bound : ∃ C : ℝ, 0 < C ∧ ∀ z, |mainPulse z| ≤ C := by |
| 765 | obtain ⟨C, hC, hb⟩ := LocalizedMomentRepair.smooth_compact_derivative_bound mainPulse |
| 766 | mainPulse_contDiff mainPulse_hasCompactSupport 0 |
| 767 | refine ⟨C + 1, by linarith, fun z => ?_⟩ |
| 768 | have h := hb z |
| 769 | simpa only [iteratedDeriv_zero] using h.trans (by linarith : C ≤ C + 1) |
| 770 | |
| 771 | noncomputable def mainBound : ℝ := Classical.choose exists_mainPulse_bound |
| 772 | theorem mainBound_pos : 0 < mainBound := (Classical.choose_spec exists_mainPulse_bound).1 |
| 773 | theorem mainPulse_abs_le (z : ℝ) : |mainPulse z| ≤ mainBound := |
| 774 | (Classical.choose_spec exists_mainPulse_bound).2 z |
| 775 | |
| 776 | theorem mainMoment_log (c : Parameters) (i : Fin 2) : |
| 777 | mainMoment c i = ∫ y in (0 : ℝ)..c.pulseLength, |
| 778 | Real.exp (beta c i * y) * mainPulse (c.lam * y) := by |
| 779 | have hlog : ContinuousOn Real.log (Ioi (0 : ℝ)) := |
| 780 | continuousOn_id.log (fun _ hx => ne_of_gt hx) |
| 781 | have hR : ContinuousOn (fun x => mainPulse (c.lam * Real.log x)) (Ioi 0) := |
| 782 | mainPulse_contDiff.continuous.comp_continuousOn (continuousOn_const.mul hlog) |
| 783 | have h := exp_weight_substitution hR (c.exponents i) 0 c.pulseLength |
| 784 | simpa only [mainMoment, beta, zero_add, sub_zero, Real.log_exp] using h.symm |
| 785 | |
| 786 | theorem mainMoment_log_short (c : Parameters) (i : Fin 2) : |
| 787 | mainMoment c i = ∫ y in (0 : ℝ)..11 / c.lam, |
| 788 | Real.exp (beta c i * y) * mainPulse (c.lam * y) := by |
| 789 | rw [mainMoment_log] |
| 790 | apply integral_stops |
| 791 | ((Real.continuous_exp.comp (continuous_const.mul continuous_id)).mul |
| 792 | (mainPulse_contDiff.continuous.comp (continuous_const.mul continuous_id))) |
| 793 | (show 11 / c.lam ≤ c.pulseLength by |
| 794 | exact div_le_div_of_nonneg_right (by norm_num) c.lam_pos.le) |
| 795 | intro y hy |
| 796 | have hp : 11 ≤ c.lam * y := by |
| 797 | have h := (div_le_iff₀ c.lam_pos).mp hy |
| 798 | nlinarith |
| 799 | simp only [Pi.mul_apply, Function.comp_apply, id_eq] |
| 800 | rw [mainPulse_zero_right hp, mul_zero] |
| 801 | |
| 802 | theorem center_gap_bound (c : Parameters) (hsmall : c.lam ≤ 1 / 120) (i : Fin 2) : |
| 803 | 1 / (2 * c.lam) ≤ beta c i * (center c 0 - 11 / c.lam) := by |
| 804 | have hb := (beta_small_bounds c hsmall i).1 |
| 805 | have hp : 0 ≤ 2 - 3 * c.lam := by linarith [c.lam_pos] |
| 806 | have hm := mul_le_mul_of_nonneg_right hb hp |
| 807 | have hnum : (1 / 2 : ℝ) ≤ beta c i * (2 - 3 * c.lam) := by nlinarith |
| 808 | have hdiv := div_le_div_of_nonneg_right hnum c.lam_pos.le |
| 809 | have he : beta c i * (center c 0 - 11 / c.lam) = |
| 810 | (beta c i * (2 - 3 * c.lam)) / c.lam := by |
| 811 | simp only [center, Parameters.pulseLength] |
| 812 | field_simp [c.lam_pos.ne'] ; ring_nf ; simp |
| 813 | rw [he] |
| 814 | convert! hdiv using 1 ; ring |
| 815 | |
| 816 | theorem normalized_mainMoment_bound (c : Parameters) (hsmall : c.lam ≤ 1 / 120) (i : Fin 2) : |
| 817 | |Real.exp (-(beta c i * center c 0)) * mainMoment c i| ≤ |
| 818 | (11 * mainBound / c.lam) * Real.exp (-(1 / (2 * c.lam))) := by |
| 819 | have heq : Real.exp (-(beta c i * center c 0)) * mainMoment c i = |
| 820 | ∫ y in (0 : ℝ)..11 / c.lam, |
| 821 | Real.exp (beta c i * (y - center c 0)) * mainPulse (c.lam * y) := by |
| 822 | rw [mainMoment_log_short, ← intervalIntegral.integral_const_mul] |
| 823 | apply intervalIntegral.integral_congr |
| 824 | intro y _ |
| 825 | dsimp only |
| 826 | rw [show beta c i * (y - center c 0) = |
| 827 | -(beta c i * center c 0) + beta c i * y by ring, Real.exp_add] |
| 828 | ring |
| 829 | rw [heq] |
| 830 | have hlen : 0 ≤ 11 / c.lam := div_nonneg (by norm_num) c.lam_pos.le |
| 831 | have h := intervalIntegral.norm_integral_le_of_norm_le_const |
| 832 | (a := (0 : ℝ)) (b := 11 / c.lam) |
| 833 | (f := fun y => Real.exp (beta c i * (y - center c 0)) * mainPulse (c.lam * y)) |
| 834 | (C := mainBound * Real.exp (-(1 / (2 * c.lam)))) ?_ |
| 835 | · rw [Real.norm_eq_abs, sub_zero, abs_of_nonneg hlen] at h |
| 836 | convert! h using 1 ; ring |
| 837 | · intro y hy |
| 838 | have hy' : y ≤ 11 / c.lam := (uIoc_of_le hlen ▸ hy).2 |
| 839 | have harg : beta c i * (y - center c 0) ≤ -(1 / (2 * c.lam)) := by |
| 840 | have hb := mul_le_mul_of_nonneg_left hy' (beta_bounds c i).1.le |
| 841 | linarith [center_gap_bound c hsmall i] |
| 842 | rw [Real.norm_eq_abs, abs_mul, abs_of_pos (Real.exp_pos _)] |
| 843 | calc |
| 844 | _ ≤ Real.exp (-(1 / (2 * c.lam))) * mainBound := |
| 845 | mul_le_mul (Real.exp_le_exp.mpr harg) (mainPulse_abs_le _) |
| 846 | (abs_nonneg _) (Real.exp_pos _).le |
| 847 | _ = _ := by ring |
| 848 | |
| 849 | theorem prefixCoefficient_le_bound (c : Parameters) (i : Fin 2) : |
| 850 | |prefixCoefficient c i| ≤ prefixBound c.P c.m i := by |
| 851 | rw [abs_of_nonneg (prefixCoefficient_nonneg c i)] |
| 852 | have he : Real.exp (-(beta c i * c.wait)) ≤ 1 := by |
| 853 | apply Real.exp_le_one_iff.mpr |
| 854 | have hw : 0 ≤ c.wait := by linarith [c.wait_gt] |
| 855 | nlinarith [(beta_bounds c i).1] |
| 856 | exact (prefixCoefficient_decay c i).trans (by |
| 857 | nlinarith [prefixBound_pos c.P_pos c.m i]) |
| 858 | |
| 859 | theorem normalized_prefixCoefficient_bound (c : Parameters) (hsmall : c.lam ≤ 1 / 120) |
| 860 | (i : Fin 2) : |
| 861 | |Real.exp (-(beta c i * center c 0)) * prefixCoefficient c i| ≤ |
| 862 | prefixBound c.P c.m i * Real.exp (-(1 / (2 * c.lam))) := by |
| 863 | have hgap := center_gap_bound c hsmall i |
| 864 | have hmain : 0 ≤ beta c i * (11 / c.lam) := |
| 865 | mul_nonneg (beta_bounds c i).1.le (div_nonneg (by norm_num) c.lam_pos.le) |
| 866 | have he : Real.exp (-(beta c i * center c 0)) ≤ Real.exp (-(1 / (2 * c.lam))) := by |
| 867 | apply Real.exp_le_exp.mpr |
| 868 | nlinarith |
| 869 | rw [abs_mul, abs_of_pos (Real.exp_pos _)] |
| 870 | calc |
| 871 | _ ≤ Real.exp (-(1 / (2 * c.lam))) * prefixBound c.P c.m i := |
| 872 | mul_le_mul he (prefixCoefficient_le_bound c i) (abs_nonneg _) (Real.exp_pos _).le |
| 873 | _ = _ := by ring |
| 874 | |
| 875 | noncomputable def affineDebt (c : Parameters) (q A : ℝ) (i : Fin 2) : ℝ := |
| 876 | -(q * prefixCoefficient c i + A * mainMoment c i) |
| 877 | |
| 878 | noncomputable def affineCoefficients (c : Parameters) (q A : ℝ) : Fin 2 → ℝ := |
| 879 | LocalizedMomentRepair.coefficients c.exponents c.lower c.upper (affineDebt c q A) |
| 880 | |
| 881 | noncomputable def debtBound (P m : ℝ) (i : Fin 2) : ℝ := |
| 882 | prefixBound P m i + 11 * mainBound |
| 883 | |
| 884 | theorem debtBound_pos {P : ℝ} (hP : 0 < P) (m : ℝ) (i : Fin 2) : 0 < debtBound P m i := by |
| 885 | have hp := prefixBound_pos hP m i |
| 886 | have hm := mainBound_pos |
| 887 | unfold debtBound |
| 888 | positivity |
| 889 | |
| 890 | theorem affineDebt_normalized_bound (c : Parameters) (hsmall : c.lam ≤ 1 / 120) |
| 891 | (q A : ℝ) (i : Fin 2) : |
| 892 | |normalizedDebt c (affineDebt c q A) i| ≤ |
| 893 | (debtBound c.P c.m i / c.lam) * Real.exp (-(1 / (2 * c.lam))) * (|q| + |A|) := by |
| 894 | have hD0 : prefixBound c.P c.m i ≤ debtBound c.P c.m i / c.lam := by |
| 895 | apply (le_div_iff₀ c.lam_pos).mpr |
| 896 | have hp := prefixBound_pos c.P_pos c.m i |
| 897 | have hm := mainBound_pos |
| 898 | dsimp [debtBound] |
| 899 | nlinarith [c.lam_lt] |
| 900 | have hD1 : 11 * mainBound / c.lam ≤ debtBound c.P c.m i / c.lam := by |
| 901 | apply div_le_div_of_nonneg_right _ c.lam_pos.le |
| 902 | have hp := prefixBound_pos c.P_pos c.m i |
| 903 | dsimp [debtBound] |
| 904 | linarith |
| 905 | have hp := (normalized_prefixCoefficient_bound c hsmall i).trans |
| 906 | (mul_le_mul_of_nonneg_right hD0 (Real.exp_pos _).le) |
| 907 | have hm := (normalized_mainMoment_bound c hsmall i).trans |
| 908 | (mul_le_mul_of_nonneg_right hD1 (Real.exp_pos _).le) |
| 909 | have heq : normalizedDebt c (affineDebt c q A) i = |
| 910 | -(q * (Real.exp (-(beta c i * center c 0)) * prefixCoefficient c i) + |
| 911 | A * (Real.exp (-(beta c i * center c 0)) * mainMoment c i)) := by |
| 912 | unfold normalizedDebt affineDebt |
| 913 | ring |
| 914 | rw [heq, abs_neg] |
| 915 | calc |
| 916 | _ ≤ |q * (Real.exp (-(beta c i * center c 0)) * prefixCoefficient c i)| + |
| 917 | |A * (Real.exp (-(beta c i * center c 0)) * mainMoment c i)| := abs_add_le _ _ |
| 918 | _ ≤ |q| * ((debtBound c.P c.m i / c.lam) * Real.exp (-(1 / (2 * c.lam)))) + |
| 919 | |A| * ((debtBound c.P c.m i / c.lam) * Real.exp (-(1 / (2 * c.lam)))) := by |
| 920 | simp only [abs_mul] at hp hm ⊢ |
| 921 | exact add_le_add (mul_le_mul_of_nonneg_left hp (abs_nonneg q)) |
| 922 | (mul_le_mul_of_nonneg_left hm (abs_nonneg A)) |
| 923 | _ = _ := by ring |
| 924 | |
| 925 | theorem inverse_square_exp_absorption {lam : ℝ} (hlam : 0 < lam) : |
| 926 | Real.exp (-(1 / (2 * lam))) / lam ^ 2 ≤ 64 * Real.exp (-(1 / (4 * lam))) := by |
| 927 | have ht : 0 ≤ 1 / (8 * lam) := by positivity |
| 928 | have hex : 1 / (8 * lam) ≤ Real.exp (1 / (8 * lam)) := by |
| 929 | linarith [Real.add_one_le_exp (1 / (8 * lam))] |
| 930 | have hsq := pow_le_pow_left₀ ht hex 2 |
| 931 | rw [← Real.exp_nat_mul] at hsq |
| 932 | have hfac : 1 / lam ^ 2 ≤ 64 * Real.exp (1 / (4 * lam)) := by |
| 933 | apply (div_le_iff₀ (sq_pos_of_pos hlam)).mpr |
| 934 | have ht' : (1 / (8 * lam)) ^ 2 = 1 / (64 * lam ^ 2) := by ring |
| 935 | have he' : (2 : ℝ) * (1 / (8 * lam)) = 1 / (4 * lam) := by ring |
| 936 | norm_num only [Nat.cast_ofNat] at hsq |
| 937 | rw [ht', he'] at hsq |
| 938 | have h := (div_le_iff₀ (by positivity : 0 < 64 * lam ^ 2)).mp hsq |
| 939 | nlinarith |
| 940 | have hprod := mul_le_mul_of_nonneg_right hfac (Real.exp_pos (-(1 / (2 * lam)))).le |
| 941 | have hsum : 1 / (4 * lam) + -(1 / (2 * lam)) = -(1 / (4 * lam)) := by ring |
| 942 | calc |
| 943 | _ = (1 / lam ^ 2) * Real.exp (-(1 / (2 * lam))) := by ring |
| 944 | _ ≤ _ := hprod |
| 945 | _ = _ := by rw [mul_assoc, ← Real.exp_add, hsum] |
| 946 | |
| 947 | noncomputable def coefficientBound (P m : ℝ) : ℝ := |
| 948 | 64 * inverseBound * (debtBound P m 0 + debtBound P m 1) |
| 949 | |
| 950 | theorem coefficientBound_pos {P : ℝ} (hP : 0 < P) (m : ℝ) : 0 < coefficientBound P m := by |
| 951 | have h0 := debtBound_pos hP m 0 |
| 952 | have h1 := debtBound_pos hP m 1 |
| 953 | have hi := inverseBound_pos |
| 954 | unfold coefficientBound |
| 955 | positivity |
| 956 | |
| 957 | theorem affineCoefficients_exp_bound (c : Parameters) (hsmall : c.lam ≤ 1 / 120) |
| 958 | (q A : ℝ) (j : Fin 2) : |
| 959 | |affineCoefficients c q A j| ≤ |
| 960 | coefficientBound c.P c.m * Real.exp (-(1 / (4 * c.lam))) * (|q| + |A|) := by |
| 961 | have h0 := affineDebt_normalized_bound c hsmall q A 0 |
| 962 | have h1 := affineDebt_normalized_bound c hsmall q A 1 |
| 963 | have hc := actual_coefficients_bound c (affineDebt c q A) j |
| 964 | change c.lam * |affineCoefficients c q A j| ≤ _ at hc |
| 965 | have hsum := mul_le_mul_of_nonneg_left (add_le_add h0 h1) inverseBound_pos.le |
| 966 | have hbase : |affineCoefficients c q A j| ≤ |
| 967 | (inverseBound * (debtBound c.P c.m 0 + debtBound c.P c.m 1)) * |
| 968 | (Real.exp (-(1 / (2 * c.lam))) / c.lam ^ 2) * (|q| + |A|) := by |
| 969 | apply (mul_le_mul_iff_right₀ c.lam_pos).mp |
| 970 | refine hc.trans (hsum.trans_eq ?_) |
| 971 | field_simp [c.lam_pos.ne'] |
| 972 | have hK : 0 ≤ inverseBound * (debtBound c.P c.m 0 + debtBound c.P c.m 1) := |
| 973 | mul_nonneg inverseBound_pos.le (add_nonneg (debtBound_pos c.P_pos c.m 0).le |
| 974 | (debtBound_pos c.P_pos c.m 1).le) |
| 975 | calc |
| 976 | _ ≤ _ := hbase |
| 977 | _ ≤ (inverseBound * (debtBound c.P c.m 0 + debtBound c.P c.m 1)) * |
| 978 | (64 * Real.exp (-(1 / (4 * c.lam)))) * (|q| + |A|) := |
| 979 | mul_le_mul_of_nonneg_right |
| 980 | (mul_le_mul_of_nonneg_left (inverse_square_exp_absorption c.lam_pos) hK) |
| 981 | (by positivity) |
| 982 | _ = _ := by unfold coefficientBound; ring |
| 983 | |
| 984 | theorem pulse_coefficients_exp_bound (c : Parameters) (hsmall : c.lam ≤ 1 / 120) |
| 985 | (amp : ℝ → ℝ) {eta : ℝ} (heta : |eta| ≤ 1) (j : Fin 2) : |
| 986 | |LocalizedMomentRepair.coefficients c.exponents c.lower c.upper (debt c amp eta) j| ≤ |
| 987 | (2 * coefficientBound c.P c.m) * Real.exp (-(1 / (4 * c.lam))) * (1 + |amp eta|) := by |
| 988 | have heq : debt c amp eta = affineDebt c (parameterPolynomial eta) (amp eta) := by |
| 989 | ext i |
| 990 | unfold debt affineDebt parameterPolynomial |
| 991 | ring |
| 992 | rw [heq] |
| 993 | have h := affineCoefficients_exp_bound c hsmall (parameterPolynomial eta) (amp eta) j |
| 994 | have hq := parameterPolynomial_bound heta |
| 995 | have he := Real.exp_pos (-(1 / (4 * c.lam))) |
| 996 | have hC := coefficientBound_pos c.P_pos c.m |
| 997 | change |affineCoefficients c (parameterPolynomial eta) (amp eta) j| ≤ _ |
| 998 | refine h.trans ?_ |
| 999 | calc |
| 1000 | _ ≤ (coefficientBound c.P c.m * Real.exp (-(1 / (4 * c.lam)))) * |
| 1001 | (2 * (1 + |amp eta|)) := |
| 1002 | mul_le_mul_of_nonneg_left (by linarith [abs_nonneg (amp eta)]) |
| 1003 | (mul_nonneg hC.le he.le) |
| 1004 | _ = _ := by ring |
| 1005 | |
| 1006 | /-! ## Fixed radial jets and first parameter derivatives -/ |
| 1007 | |
| 1008 | theorem affineCoefficients_decomposition (c : Parameters) (q A : ℝ) (j : Fin 2) : |
| 1009 | affineCoefficients c q A j = q * affineCoefficients c 1 0 j + |
| 1010 | A * affineCoefficients c 0 1 j := by |
| 1011 | simp only [affineCoefficients, LocalizedMomentRepair.coefficients, Matrix.mulVec, |
| 1012 | dotProduct, Fin.sum_univ_two, affineDebt] |
| 1013 | ring |
| 1014 | |
| 1015 | theorem debt_eq_affine (c : Parameters) (amp : ℝ → ℝ) (eta : ℝ) : |
| 1016 | debt c amp eta = affineDebt c (parameterPolynomial eta) (amp eta) := by |
| 1017 | ext i |
| 1018 | unfold debt affineDebt parameterPolynomial |
| 1019 | ring |
| 1020 | |
| 1021 | theorem pulse_coefficients_hasDerivAt (c : Parameters) {amp : ℝ → ℝ} |
| 1022 | {eta amp' : ℝ} (ha : HasDerivAt amp amp' eta) (j : Fin 2) : |
| 1023 | HasDerivAt (fun t => LocalizedMomentRepair.coefficients c.exponents c.lower c.upper |
| 1024 | (debt c amp t) j) (affineCoefficients c (1 + 3 * eta ^ 2) amp' j) eta := by |
| 1025 | have heq : (fun t => LocalizedMomentRepair.coefficients c.exponents c.lower c.upper |
| 1026 | (debt c amp t) j) = (fun t => parameterPolynomial t * affineCoefficients c 1 0 j + |
| 1027 | amp t * affineCoefficients c 0 1 j) := by |
| 1028 | funext t |
| 1029 | rw [debt_eq_affine] |
| 1030 | exact affineCoefficients_decomposition c _ _ j |
| 1031 | rw [heq, affineCoefficients_decomposition c (1 + 3 * eta ^ 2) amp' j] |
| 1032 | exact ((parameterPolynomial_hasDerivAt eta).mul_const _).add (ha.mul_const _) |
| 1033 | |
| 1034 | noncomputable def affineProfile (c : Parameters) (q A y : ℝ) : ℝ := |
| 1035 | ∑ j : Fin 2, affineCoefficients c q A j * logTemplate (y - center c j) |
| 1036 | |
| 1037 | theorem affineProfile_contDiff (c : Parameters) (q A : ℝ) : ContDiff ℝ ∞ (affineProfile c q A) := by |
| 1038 | apply ContDiff.sum |
| 1039 | intro j _ |
| 1040 | exact contDiff_const.mul (logTemplate_contDiff.comp (contDiff_id.sub contDiff_const)) |
| 1041 | |
| 1042 | theorem correction_log_eq_affineProfile (c : Parameters) (amp : ℝ → ℝ) (eta y : ℝ) : |
| 1043 | correction c amp eta (Real.exp y) = affineProfile c (parameterPolynomial eta) (amp eta) y := by |
| 1044 | unfold correction LocalizedMomentRepair.repair affineProfile |
| 1045 | apply Finset.sum_congr rfl |
| 1046 | intro j _ |
| 1047 | rw [bump_log_translate, debt_eq_affine] |
| 1048 | rfl |
| 1049 | |
| 1050 | theorem affineProfile_jet_formula (c : Parameters) (q A : ℝ) (k : ℕ) (y : ℝ) : |
| 1051 | iteratedDeriv k (affineProfile c q A) y = |
| 1052 | ∑ j : Fin 2, affineCoefficients c q A j * iteratedDeriv k logTemplate (y - center c j) := by |
| 1053 | unfold affineProfile |
| 1054 | rw [LocalizedMomentRepair.iteratedDeriv_finite_sum Finset.univ |
| 1055 | (fun j x => affineCoefficients c q A j * logTemplate (x - center c j)) |
| 1056 | (fun j => contDiff_const.mul (logTemplate_contDiff.comp (contDiff_id.sub contDiff_const)))] |
| 1057 | apply Finset.sum_congr rfl |
| 1058 | intro j _ |
| 1059 | have hj : ContDiffAt ℝ k (fun x => logTemplate (x - center c j)) y := |
| 1060 | ((logTemplate_contDiff.comp (contDiff_id.sub contDiff_const)).of_le |
| 1061 | (by exact_mod_cast (le_top : (k : ℕ∞) ≤ ⊤))).contDiffAt |
| 1062 | rw [iteratedDeriv_const_mul _ hj] |
| 1063 | have heq : (fun x => logTemplate (x - center c j)) = |
| 1064 | (fun x => logTemplate (x + (-center c j))) := by |
| 1065 | funext x |
| 1066 | rw [sub_eq_add_neg] |
| 1067 | rw [heq, iteratedDeriv_comp_add_const] |
| 1068 | rfl |
| 1069 | |
| 1070 | noncomputable def templateJetBound (k : ℕ) : ℝ := 1 + Classical.choose (logTemplate_jet_bound k) |
| 1071 | |
| 1072 | theorem templateJetBound_pos (k : ℕ) : 0 < templateJetBound k := by |
| 1073 | have h := (Classical.choose_spec (logTemplate_jet_bound k)).1 |
| 1074 | unfold templateJetBound |
| 1075 | linarith |
| 1076 | |
| 1077 | theorem logTemplate_jet_le (k : ℕ) (y : ℝ) : |iteratedDeriv k logTemplate y| ≤ templateJetBound k := by |
| 1078 | have h := (Classical.choose_spec (logTemplate_jet_bound k)).2 y |
| 1079 | unfold templateJetBound |
| 1080 | linarith |
| 1081 | |
| 1082 | noncomputable def correctionJetBound (P m : ℝ) (k : ℕ) : ℝ := |
| 1083 | 2 * coefficientBound P m * templateJetBound k |
| 1084 | |
| 1085 | theorem correctionJetBound_pos {P : ℝ} (hP : 0 < P) (m : ℝ) (k : ℕ) : |
| 1086 | 0 < correctionJetBound P m k := by |
| 1087 | have hc := coefficientBound_pos hP m |
| 1088 | have hj := templateJetBound_pos k |
| 1089 | unfold correctionJetBound |
| 1090 | positivity |
| 1091 | |
| 1092 | theorem affineProfile_jet_bound (c : Parameters) (hsmall : c.lam ≤ 1 / 120) |
| 1093 | (q A : ℝ) (k : ℕ) (y : ℝ) : |
| 1094 | |iteratedDeriv k (affineProfile c q A) y| ≤ |
| 1095 | correctionJetBound c.P c.m k * Real.exp (-(1 / (4 * c.lam))) * (|q| + |A|) := by |
| 1096 | rw [affineProfile_jet_formula, Fin.sum_univ_two] |
| 1097 | have hC : 0 ≤ coefficientBound c.P c.m * Real.exp (-(1 / (4 * c.lam))) * (|q| + |A|) := |
| 1098 | mul_nonneg (mul_nonneg (coefficientBound_pos c.P_pos c.m).le (Real.exp_pos _).le) |
| 1099 | (by positivity) |
| 1100 | have hb : ∀ j : Fin 2, |
| 1101 | |affineCoefficients c q A j * iteratedDeriv k logTemplate (y - center c j)| ≤ |
| 1102 | (coefficientBound c.P c.m * Real.exp (-(1 / (4 * c.lam))) * (|q| + |A|)) * |
| 1103 | templateJetBound k := by |
| 1104 | intro j |
| 1105 | rw [abs_mul] |
| 1106 | exact mul_le_mul (affineCoefficients_exp_bound c hsmall q A j) |
| 1107 | (logTemplate_jet_le k _) (abs_nonneg _) hC |
| 1108 | calc |
| 1109 | _ ≤ |affineCoefficients c q A 0 * iteratedDeriv k logTemplate (y - center c 0)| + |
| 1110 | |affineCoefficients c q A 1 * iteratedDeriv k logTemplate (y - center c 1)| := abs_add_le _ _ |
| 1111 | _ ≤ _ := add_le_add (hb 0) (hb 1) |
| 1112 | _ = _ := by unfold correctionJetBound; ring |
| 1113 | |
| 1114 | theorem affineProfile_jet_decomposition (c : Parameters) (q A : ℝ) (k : ℕ) (y : ℝ) : |
| 1115 | iteratedDeriv k (affineProfile c q A) y = |
| 1116 | q * iteratedDeriv k (affineProfile c 1 0) y + |
| 1117 | A * iteratedDeriv k (affineProfile c 0 1) y := by |
| 1118 | rw [affineProfile_jet_formula, affineProfile_jet_formula, affineProfile_jet_formula] |
| 1119 | simp only [Fin.sum_univ_two] |
| 1120 | rw [affineCoefficients_decomposition c q A 0, affineCoefficients_decomposition c q A 1] |
| 1121 | ring |
| 1122 | |
| 1123 | noncomputable def correctionJet (c : Parameters) (amp : ℝ → ℝ) (k : ℕ) (eta y : ℝ) : ℝ := |
| 1124 | iteratedDeriv k (fun t => correction c amp eta (Real.exp t)) y |
| 1125 | |
| 1126 | theorem correctionJet_eq (c : Parameters) (amp : ℝ → ℝ) (k : ℕ) (eta y : ℝ) : |
| 1127 | correctionJet c amp k eta y = |
| 1128 | iteratedDeriv k (affineProfile c (parameterPolynomial eta) (amp eta)) y := by |
| 1129 | unfold correctionJet |
| 1130 | congr 2 |
| 1131 | funext t |
| 1132 | exact correction_log_eq_affineProfile c amp eta t |
| 1133 | |
| 1134 | theorem correctionJet_bound (c : Parameters) (hsmall : c.lam ≤ 1 / 120) |
| 1135 | (amp : ℝ → ℝ) (k : ℕ) {eta : ℝ} (heta : |eta| ≤ 1) (y : ℝ) : |
| 1136 | |correctionJet c amp k eta y| ≤ |
| 1137 | (2 * correctionJetBound c.P c.m k) * Real.exp (-(1 / (4 * c.lam))) * (1 + |amp eta|) := by |
| 1138 | rw [correctionJet_eq] |
| 1139 | refine (affineProfile_jet_bound c hsmall _ _ k y).trans ?_ |
| 1140 | have hq := parameterPolynomial_bound heta |
| 1141 | calc |
| 1142 | _ ≤ (correctionJetBound c.P c.m k * Real.exp (-(1 / (4 * c.lam)))) * |
| 1143 | (2 * (1 + |amp eta|)) := |
| 1144 | mul_le_mul_of_nonneg_left (by linarith [abs_nonneg (amp eta)]) |
| 1145 | (mul_nonneg (correctionJetBound_pos c.P_pos c.m k).le (Real.exp_pos _).le) |
| 1146 | _ = _ := by ring |
| 1147 | |
| 1148 | theorem correctionJet_eta_hasDerivAt (c : Parameters) {amp : ℝ → ℝ} |
| 1149 | {eta amp' : ℝ} (ha : HasDerivAt amp amp' eta) (k : ℕ) (y : ℝ) : |
| 1150 | HasDerivAt (fun t => correctionJet c amp k t y) |
| 1151 | (iteratedDeriv k (affineProfile c (1 + 3 * eta ^ 2) amp') y) eta := by |
| 1152 | have heq : (fun t => correctionJet c amp k t y) = |
| 1153 | (fun t => parameterPolynomial t * iteratedDeriv k (affineProfile c 1 0) y + |
| 1154 | amp t * iteratedDeriv k (affineProfile c 0 1) y) := by |
| 1155 | funext t |
| 1156 | rw [correctionJet_eq, affineProfile_jet_decomposition] |
| 1157 | rw [heq, affineProfile_jet_decomposition c (1 + 3 * eta ^ 2) amp' k y] |
| 1158 | exact ((parameterPolynomial_hasDerivAt eta).mul_const _).add (ha.mul_const _) |
| 1159 | |
| 1160 | theorem correctionJet_eta_bound (c : Parameters) (hsmall : c.lam ≤ 1 / 120) |
| 1161 | {amp : ℝ → ℝ} {eta amp' : ℝ} (ha : HasDerivAt amp amp' eta) |
| 1162 | (heta : |eta| ≤ 1) (k : ℕ) (y : ℝ) : |
| 1163 | |deriv (fun t => correctionJet c amp k t y) eta| ≤ |
| 1164 | (4 * correctionJetBound c.P c.m k) * Real.exp (-(1 / (4 * c.lam))) * (1 + |amp'|) := by |
| 1165 | rw [(correctionJet_eta_hasDerivAt c ha k y).deriv] |
| 1166 | refine (affineProfile_jet_bound c hsmall _ _ k y).trans ?_ |
| 1167 | have hq : |1 + 3 * eta ^ 2| ≤ 4 := by |
| 1168 | simpa only [(parameterPolynomial_hasDerivAt eta).deriv] using parameterPolynomial_derivative_bound heta |
| 1169 | calc |
| 1170 | _ ≤ (correctionJetBound c.P c.m k * Real.exp (-(1 / (4 * c.lam)))) * |
| 1171 | (4 * (1 + |amp'|)) := |
| 1172 | mul_le_mul_of_nonneg_left (by linarith [abs_nonneg amp']) |
| 1173 | (mul_nonneg (correctionJetBound_pos c.P_pos c.m k).le (Real.exp_pos _).le) |
| 1174 | _ = _ := by ring |
| 1175 | |
| 1176 | theorem normalized_mass_prefix_hasDerivAt (c : Parameters) (amp : ℝ → ℝ) (eta : ℝ) : |
| 1177 | HasDerivAt (fun t => massMoment c amp t c.pulseStart / |
| 1178 | (Real.exp c.pulseStart * angular c.P c.dropLength c.lam (c.pulseStart, t))) |
| 1179 | (prefixCoefficient c 0 * (1 + 3 * eta ^ 2)) eta := by |
| 1180 | have heq : (fun t => massMoment c amp t c.pulseStart / |
| 1181 | (Real.exp c.pulseStart * angular c.P c.dropLength c.lam (c.pulseStart, t))) = |
| 1182 | (fun t => prefixCoefficient c 0 * parameterPolynomial t) := by |
| 1183 | funext t |
| 1184 | exact normalized_mass_prefix c amp t |
| 1185 | rw [heq] |
| 1186 | exact (parameterPolynomial_hasDerivAt eta).const_mul _ |
| 1187 | |
| 1188 | theorem normalized_mass_prefix_derivative_small (c : Parameters) |
| 1189 | (hwait : c.wait = 60 * Real.log (1 / c.lam)) (hsmall : c.lam ≤ 1 / 120) |
| 1190 | (amp : ℝ → ℝ) {eta : ℝ} (heta : |eta| ≤ 1) : |
| 1191 | |deriv (fun t => massMoment c amp t c.pulseStart / |
| 1192 | (Real.exp c.pulseStart * angular c.P c.dropLength c.lam (c.pulseStart, t))) eta| ≤ |
| 1193 | (4 * prefixBound c.P c.m 0) * c.lam ^ 29 := by |
| 1194 | rw [(normalized_mass_prefix_hasDerivAt c amp eta).deriv, abs_mul] |
| 1195 | have hq : |1 + 3 * eta ^ 2| ≤ 4 := by |
| 1196 | simpa only [(parameterPolynomial_hasDerivAt eta).deriv] using parameterPolynomial_derivative_bound heta |
| 1197 | have hb := mul_le_mul (prefixCoefficient_small c hwait hsmall 0) hq |
| 1198 | (abs_nonneg _) (mul_nonneg (prefixBound_pos c.P_pos c.m 0).le (pow_nonneg c.lam_pos.le _)) |
| 1199 | nlinarith |
| 1200 | |
| 1201 | theorem individual_correction_jet_formula (c : Parameters) (amp : ℝ → ℝ) |
| 1202 | (eta : ℝ) (j : Fin 2) (k : ℕ) (y : ℝ) : |
| 1203 | iteratedDeriv k (fun t => |
| 1204 | LocalizedMomentRepair.coefficients c.exponents c.lower c.upper (debt c amp eta) j * |
| 1205 | LocalizedMomentRepair.bump (c.lower j) (c.upper j) (Real.exp t)) y = |
| 1206 | affineCoefficients c (parameterPolynomial eta) (amp eta) j * |
| 1207 | iteratedDeriv k logTemplate (y - center c j) := by |
| 1208 | have heq : (fun t => |
| 1209 | LocalizedMomentRepair.coefficients c.exponents c.lower c.upper (debt c amp eta) j * |
| 1210 | LocalizedMomentRepair.bump (c.lower j) (c.upper j) (Real.exp t)) = |
| 1211 | (fun t => affineCoefficients c (parameterPolynomial eta) (amp eta) j * |
| 1212 | logTemplate (t - center c j)) := by |
| 1213 | funext t |
| 1214 | rw [bump_log_translate, debt_eq_affine] |
| 1215 | rfl |
| 1216 | rw [heq] |
| 1217 | have hj : ContDiffAt ℝ k (fun t => logTemplate (t - center c j)) y := |
| 1218 | ((logTemplate_contDiff.comp (contDiff_id.sub contDiff_const)).of_le |
| 1219 | (by exact_mod_cast (le_top : (k : ℕ∞) ≤ ⊤))).contDiffAt |
| 1220 | rw [iteratedDeriv_const_mul _ hj] |
| 1221 | congr 1 |
| 1222 | simpa only [sub_eq_add_neg] using |
| 1223 | congrFun (iteratedDeriv_comp_add_const k logTemplate (-center c j)) y |
| 1224 | |
| 1225 | theorem individual_correction_jet_bound (c : Parameters) (hsmall : c.lam ≤ 1 / 120) |
| 1226 | (amp : ℝ → ℝ) {eta : ℝ} (heta : |eta| ≤ 1) (j : Fin 2) (k : ℕ) (y : ℝ) : |
| 1227 | |iteratedDeriv k (fun t => |
| 1228 | LocalizedMomentRepair.coefficients c.exponents c.lower c.upper (debt c amp eta) j * |
| 1229 | LocalizedMomentRepair.bump (c.lower j) (c.upper j) (Real.exp t)) y| ≤ |
| 1230 | correctionJetBound c.P c.m k * Real.exp (-(1 / (4 * c.lam))) * (1 + |amp eta|) := by |
| 1231 | rw [individual_correction_jet_formula, abs_mul] |
| 1232 | have hc := pulse_coefficients_exp_bound c hsmall amp heta j |
| 1233 | rw [debt_eq_affine] at hc |
| 1234 | change |affineCoefficients c (parameterPolynomial eta) (amp eta) j| ≤ _ at hc |
| 1235 | have hpos : 0 ≤ (2 * coefficientBound c.P c.m) * |
| 1236 | Real.exp (-(1 / (4 * c.lam))) * (1 + |amp eta|) := by |
| 1237 | have hp := coefficientBound_pos c.P_pos c.m |
| 1238 | positivity |
| 1239 | have h := mul_le_mul hc (logTemplate_jet_le k (y - center c j)) (abs_nonneg _) hpos |
| 1240 | refine h.trans_eq ?_ |
| 1241 | unfold correctionJetBound |
| 1242 | ring |
| 1243 | |
| 1244 | theorem individual_correction_jet_eta_bound (c : Parameters) (hsmall : c.lam ≤ 1 / 120) |
| 1245 | {amp : ℝ → ℝ} {eta amp' : ℝ} (ha : HasDerivAt amp amp' eta) (heta : |eta| ≤ 1) |
| 1246 | (j : Fin 2) (k : ℕ) (y : ℝ) : |
| 1247 | |deriv (fun s => iteratedDeriv k (fun t => |
| 1248 | LocalizedMomentRepair.coefficients c.exponents c.lower c.upper (debt c amp s) j * |
| 1249 | LocalizedMomentRepair.bump (c.lower j) (c.upper j) (Real.exp t)) y) eta| ≤ |
| 1250 | (2 * correctionJetBound c.P c.m k) * Real.exp (-(1 / (4 * c.lam))) * (1 + |amp'|) := by |
| 1251 | have heq : (fun s => iteratedDeriv k (fun t => |
| 1252 | LocalizedMomentRepair.coefficients c.exponents c.lower c.upper (debt c amp s) j * |
| 1253 | LocalizedMomentRepair.bump (c.lower j) (c.upper j) (Real.exp t)) y) = |
| 1254 | (fun s => LocalizedMomentRepair.coefficients c.exponents c.lower c.upper (debt c amp s) j * |
| 1255 | iteratedDeriv k logTemplate (y - center c j)) := by |
| 1256 | funext s |
| 1257 | rw [individual_correction_jet_formula, debt_eq_affine] |
| 1258 | rfl |
| 1259 | rw [heq, ((pulse_coefficients_hasDerivAt c ha j).mul_const |
| 1260 | (iteratedDeriv k logTemplate (y - center c j))).deriv, abs_mul] |
| 1261 | have hq : |1 + 3 * eta ^ 2| ≤ 4 := by |
| 1262 | simpa only [(parameterPolynomial_hasDerivAt eta).deriv] using parameterPolynomial_derivative_bound heta |
| 1263 | have hc := affineCoefficients_exp_bound c hsmall (1 + 3 * eta ^ 2) amp' j |
| 1264 | have hp : 0 ≤ coefficientBound c.P c.m * Real.exp (-(1 / (4 * c.lam))) * |
| 1265 | (|1 + 3 * eta ^ 2| + |amp'|) := by |
| 1266 | have hP := coefficientBound_pos c.P_pos c.m |
| 1267 | positivity |
| 1268 | have h := mul_le_mul hc (logTemplate_jet_le k (y - center c j)) (abs_nonneg _) hp |
| 1269 | refine h.trans ?_ |
| 1270 | have hfac := mul_le_mul_of_nonneg_left |
| 1271 | (show |1 + 3 * eta ^ 2| + |amp'| ≤ 4 * (1 + |amp'|) by linarith [abs_nonneg amp']) |
| 1272 | (mul_nonneg (mul_nonneg (coefficientBound_pos c.P_pos c.m).le |
| 1273 | (Real.exp_pos (-(1 / (4 * c.lam)))).le) |
| 1274 | (templateJetBound_pos k).le) |
| 1275 | unfold correctionJetBound |
| 1276 | convert! hfac using 1 <;> ring |
| 1277 | |
| 1278 | /-- One constant controls the two prefix estimates and the first parameter |
| 1279 | derivative for the exact family specified in the manuscript. -/ |
| 1280 | theorem paper_prefix_bounds (P m : ℝ) (hP : 0 < P) (hm : 0 < m) : |
| 1281 | ∃ C : ℝ, 0 < C ∧ ∀ (lam : ℝ) (hlam : 0 < lam) (hsmall : lam ≤ 1 / 120), |
| 1282 | let c := paperParameters P m lam hP hm hlam (by linarith) |
| 1283 | pulseAmplitude c ≤ C * lam ^ 30 ∧ |
| 1284 | ∀ (amp : ℝ → ℝ) (eta : ℝ), |eta| ≤ 1 → |
| 1285 | |massMoment c amp eta c.pulseStart / |
| 1286 | (Real.exp c.pulseStart * angular c.P c.dropLength c.lam (c.pulseStart, eta))| ≤ C * lam ^ 29 ∧ |
| 1287 | |deriv (fun t => massMoment c amp t c.pulseStart / |
| 1288 | (Real.exp c.pulseStart * angular c.P c.dropLength c.lam (c.pulseStart, t))) eta| ≤ C * lam ^ 29 := by |
| 1289 | let C := P * Real.exp (Real.exp m + 12) + 4 * prefixBound P m 0 |
| 1290 | have hb := prefixBound_pos hP m 0 |
| 1291 | have he : 0 < P * Real.exp (Real.exp m + 12) := mul_pos hP (Real.exp_pos _) |
| 1292 | refine ⟨C, by dsimp [C]; positivity, ?_⟩ |
| 1293 | intro lam hlam hsmall |
| 1294 | let c := paperParameters P m lam hP hm hlam (by linarith) |
| 1295 | change pulseAmplitude c ≤ C * lam ^ 30 ∧ _ |
| 1296 | have hwait : c.wait = 60 * Real.log (1 / c.lam) := rfl |
| 1297 | have hl : c.lam ≤ 1 / 120 := hsmall |
| 1298 | constructor |
| 1299 | · have h := pulseAmplitude_small c hwait |
| 1300 | refine h.trans ?_ |
| 1301 | apply mul_le_mul_of_nonneg_right _ (pow_nonneg hlam.le _) |
| 1302 | dsimp [C, c, paperParameters] |
| 1303 | linarith |
| 1304 | · intro amp eta heta |
| 1305 | constructor |
| 1306 | · refine (normalized_mass_prefix_small c hwait hl amp heta).trans ?_ |
| 1307 | apply mul_le_mul_of_nonneg_right _ (pow_nonneg hlam.le _) |
| 1308 | change 2 * prefixBound P m 0 ≤ C |
| 1309 | dsimp [C] |
| 1310 | linarith |
| 1311 | · refine (normalized_mass_prefix_derivative_small c hwait hl amp heta).trans ?_ |
| 1312 | apply mul_le_mul_of_nonneg_right _ (pow_nonneg hlam.le _) |
| 1313 | change 4 * prefixBound P m 0 ≤ C |
| 1314 | dsimp [C] |
| 1315 | linarith |
| 1316 | |
| 1317 | /-- For every fixed radial derivative order there is a single constant independent |
| 1318 | of `lam`, the amplitude function, the parameter, and the radial coordinate. -/ |
| 1319 | theorem paper_correction_bounds (P m : ℝ) (hP : 0 < P) (hm : 0 < m) (k : ℕ) : |
| 1320 | ∃ C : ℝ, 0 < C ∧ ∀ (lam : ℝ) (hlam : 0 < lam) (hsmall : lam ≤ 1 / 120), |
| 1321 | let c := paperParameters P m lam hP hm hlam (by linarith) |
| 1322 | ∀ (amp : ℝ → ℝ) (eta y : ℝ), |eta| ≤ 1 → |
| 1323 | |correctionJet c amp k eta y| ≤ C * Real.exp (-(1 / (4 * lam))) * (1 + |amp eta|) ∧ |
| 1324 | ∀ amp' : ℝ, HasDerivAt amp amp' eta → |
| 1325 | |deriv (fun t => correctionJet c amp k t y) eta| ≤ |
| 1326 | C * Real.exp (-(1 / (4 * lam))) * (1 + |amp'|) := by |
| 1327 | refine ⟨4 * correctionJetBound P m k, mul_pos (by norm_num) (correctionJetBound_pos hP m k), ?_⟩ |
| 1328 | intro lam hlam hsmall |
| 1329 | let c := paperParameters P m lam hP hm hlam (by linarith) |
| 1330 | dsimp only |
| 1331 | intro amp eta y heta |
| 1332 | constructor |
| 1333 | · have h := correctionJet_bound c hsmall amp k heta y |
| 1334 | refine h.trans ?_ |
| 1335 | apply mul_le_mul_of_nonneg_right _ (by positivity) |
| 1336 | apply mul_le_mul_of_nonneg_right _ (Real.exp_pos _).le |
| 1337 | change 2 * correctionJetBound P m k ≤ 4 * correctionJetBound P m k |
| 1338 | linarith [correctionJetBound_pos hP m k] |
| 1339 | · intro amp' ha |
| 1340 | exact correctionJet_eta_bound c hsmall ha heta k y |
| 1341 | |
| 1342 | end NavierStokes.OutgoingPulseBounds |