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 pulseAmplitude_split (c : Parameters) : |
| 193 | pulseAmplitude c = holdAmplitude c * Real.exp (-(1 / 2 + c.lam) * c.wait) := by |
| 194 | have h := radialAmplitude_hold (P := c.P) (lam := c.lam) c.dropLength_pos.le |
| 195 | (show c.dropLength + 2 ≤ c.holdStart from le_rfl) c.pulseStart_ge_hold |
| 196 | simpa [pulseAmplitude, holdAmplitude, Parameters.pulseStart] using h |
| 197 | |
| 198 | noncomputable def holdScale (c : Parameters) (i : Fin 2) : ℝ := |
| 199 | if i = 0 then Real.exp c.holdStart * holdAmplitude c |
| 200 | else Real.sqrt 2 * Real.exp (3 * c.holdStart / 2) * holdAmplitude c ^ 2 |
| 201 | |
| 202 | noncomputable def scaleFloor (P m : ℝ) (i : Fin 2) : ℝ := |
| 203 | if i = 0 then P else |
| 204 | Real.sqrt 2 * P ^ 2 * Real.exp (-(Real.exp m + 12) / 2) |
| 205 | |
| 206 | theorem scaleFloor_pos {P : ℝ} (hP : 0 < P) (m : ℝ) (i : Fin 2) : |
| 207 | 0 < scaleFloor P m i := by |
| 208 | unfold scaleFloor |
| 209 | split_ifs <;> positivity |
| 210 | |
| 211 | theorem holdScale_lower (c : Parameters) (i : Fin 2) : |
| 212 | scaleFloor c.P c.m i ≤ holdScale c i := by |
| 213 | have he := (radialAmplitude_bounds c c.holdStart_pos.le).1 |
| 214 | change c.P * Real.exp (-c.holdStart) ≤ holdAmplitude c at he |
| 215 | have hexp : Real.exp c.holdStart * Real.exp (-c.holdStart) = 1 := by |
| 216 | rw [← Real.exp_add]; simp |
| 217 | fin_cases i |
| 218 | · norm_num [scaleFloor, holdScale] |
| 219 | calc |
| 220 | c.P = Real.exp c.holdStart * (c.P * Real.exp (-c.holdStart)) := by |
| 221 | calc |
| 222 | _ = c.P * (Real.exp c.holdStart * Real.exp (-c.holdStart)) := by rw [hexp]; ring |
| 223 | _ = _ := by ring |
| 224 | _ ≤ _ := mul_le_mul_of_nonneg_left he (Real.exp_pos _).le |
| 225 | · simp only [scaleFloor, holdScale] |
| 226 | have hs := mul_le_mul_of_nonneg_left |
| 227 | (pow_le_pow_left₀ (mul_nonneg c.P_pos.le (Real.exp_pos _).le) he 2) |
| 228 | (mul_nonneg (Real.sqrt_nonneg 2) (Real.exp_pos (3 * c.holdStart / 2)).le) |
| 229 | calc |
| 230 | _ = Real.sqrt 2 * Real.exp (3 * c.holdStart / 2) * |
| 231 | (c.P * Real.exp (-c.holdStart)) ^ 2 := by |
| 232 | rw [mul_pow, ← Real.exp_nat_mul] |
| 233 | have hex : Real.exp (3 * c.holdStart / 2) * Real.exp (2 * -c.holdStart) = |
| 234 | Real.exp (-(Real.exp c.m + 12) / 2) := by |
| 235 | rw [← Real.exp_add] |
| 236 | congr 1 |
| 237 | dsimp [Parameters.holdStart, Parameters.dropLength] |
| 238 | ring |
| 239 | rw [← hex] |
| 240 | ring_nf ; norm_num |
| 241 | _ ≤ _ := hs |
| 242 | |
| 243 | theorem momentScale_split (c : Parameters) (i : Fin 2) : |
| 244 | momentScale c i = holdScale c i * Real.exp (beta c i * c.wait) := by |
| 245 | rw [momentScale, pulseAmplitude_split] |
| 246 | fin_cases i <;> norm_num [holdScale, beta, Parameters.exponents, Parameters.pulseStart] |
| 247 | · rw [Real.exp_add] |
| 248 | have he : Real.exp c.wait * Real.exp (-(1 / 2 + c.lam) * c.wait) = |
| 249 | Real.exp ((-(1 / 2 + c.lam) + 1) * c.wait) := by |
| 250 | rw [← Real.exp_add]; congr 1; ring |
| 251 | calc |
| 252 | _ = (Real.exp c.holdStart * holdAmplitude c) * |
| 253 | (Real.exp c.wait * Real.exp (-(1 / 2 + c.lam) * c.wait)) := by ring_nf |
| 254 | _ = _ := by rw [he]; congr 2 ; ring |
| 255 | · rw [mul_pow, ← Real.exp_nat_mul] |
| 256 | have he : Real.exp (3 * (c.holdStart + c.wait) / 2) * |
| 257 | Real.exp (2 * (-(1 / 2 + c.lam) * c.wait)) = |
| 258 | Real.exp (3 * c.holdStart / 2) * |
| 259 | Real.exp ((-(1 / 2 + 2 * c.lam) + 1) * c.wait) := by |
| 260 | rw [← Real.exp_add, ← Real.exp_add]; congr 1; ring |
| 261 | calc |
| 262 | _ = Real.sqrt 2 * holdAmplitude c ^ 2 * |
| 263 | (Real.exp (3 * (c.holdStart + c.wait) / 2) * |
| 264 | Real.exp (2 * (-(1 / 2 + c.lam) * c.wait))) := by ring_nf |
| 265 | _ = _ := by rw [he]; ring_nf |
| 266 | |
| 267 | theorem exp_log_inverse_nat {lam : ℝ} (hlam : 0 < lam) (n : ℕ) : |
| 268 | Real.exp (-(n : ℝ) * Real.log (1 / lam)) = lam ^ n := by |
| 269 | rw [one_div, Real.log_inv] |
| 270 | rw [neg_mul_neg, Real.exp_nat_mul, Real.exp_log hlam] |
| 271 | |
| 272 | theorem wait_decay (c : Parameters) (hwait : c.wait = 60 * Real.log (1 / c.lam)) |
| 273 | (hsmall : c.lam ≤ 1 / 120) (i : Fin 2) : |
| 274 | Real.exp (-(beta c i * c.wait)) ≤ c.lam ^ 29 := by |
| 275 | have hlog : 0 ≤ Real.log (1 / c.lam) := Real.log_nonneg (by |
| 276 | apply (le_div_iff₀ c.lam_pos).mpr |
| 277 | linarith [c.lam_lt]) |
| 278 | rw [← exp_log_inverse_nat c.lam_pos 29] |
| 279 | apply Real.exp_le_exp.mpr |
| 280 | rw [hwait] |
| 281 | have h := mul_le_mul_of_nonneg_right (beta_small_bounds c hsmall i).2 hlog |
| 282 | nlinarith |
| 283 | |
| 284 | theorem pulseAmplitude_small (c : Parameters) |
| 285 | (hwait : c.wait = 60 * Real.log (1 / c.lam)) : |
| 286 | pulseAmplitude c ≤ c.P * Real.exp (Real.exp c.m + 12) * c.lam ^ 30 := by |
| 287 | rw [pulseAmplitude_split] |
| 288 | have hhold := (radialAmplitude_bounds c c.holdStart_pos.le).2 |
| 289 | change holdAmplitude c ≤ c.P * Real.exp c.holdStart at hhold |
| 290 | have hw : 0 ≤ c.wait := by linarith [c.wait_gt] |
| 291 | have hdec : Real.exp (-(1 / 2 + c.lam) * c.wait) ≤ c.lam ^ 30 := by |
| 292 | rw [← exp_log_inverse_nat c.lam_pos 30] |
| 293 | apply Real.exp_le_exp.mpr |
| 294 | have hprod := mul_nonneg c.lam_pos.le hw |
| 295 | rw [hwait] at hprod ⊢ |
| 296 | nlinarith |
| 297 | have h := mul_le_mul hhold hdec (Real.exp_pos _).le |
| 298 | (mul_nonneg c.P_pos.le (Real.exp_pos _).le) |
| 299 | convert! h using 1 ; dsimp [Parameters.holdStart, Parameters.dropLength] ; congr 2 ; ring_nf |
| 300 | |
| 301 | noncomputable def prefixNumeratorBound (P m : ℝ) (i : Fin 2) : ℝ := |
| 302 | if i = 0 then 4 + 4 * Real.exp m * Real.exp (Real.exp m) else |
| 303 | (5 / 2) * Real.sqrt 2 * P + 4 * Real.sqrt 2 * P * Real.exp m * Real.exp (3 * Real.exp m) |
| 304 | |
| 305 | noncomputable def prefixBound (P m : ℝ) (i : Fin 2) : ℝ := |
| 306 | prefixNumeratorBound P m i / scaleFloor P m i |
| 307 | |
| 308 | theorem prefixNumeratorBound_pos {P : ℝ} (hP : 0 < P) (m : ℝ) (i : Fin 2) : |
| 309 | 0 < prefixNumeratorBound P m i := by |
| 310 | unfold prefixNumeratorBound |
| 311 | split_ifs <;> positivity |
| 312 | |
| 313 | theorem prefixBound_pos {P : ℝ} (hP : 0 < P) (m : ℝ) (i : Fin 2) : |
| 314 | 0 < prefixBound P m i := |
| 315 | div_pos (prefixNumeratorBound_pos hP m i) (scaleFloor_pos hP m i) |
| 316 | |
| 317 | theorem prefixCoefficient_nonneg (c : Parameters) (i : Fin 2) : |
| 318 | 0 ≤ prefixCoefficient c i := by |
| 319 | apply div_nonneg _ (momentScale_pos c i).le |
| 320 | split_ifs |
| 321 | · exact (prefixM_bounds c).1 |
| 322 | · exact (prefixJ_bounds c).1 |
| 323 | |
| 324 | theorem prefixCoefficient_decay (c : Parameters) (i : Fin 2) : |
| 325 | prefixCoefficient c i ≤ prefixBound c.P c.m i * Real.exp (-(beta c i * c.wait)) := by |
| 326 | have hn : (if i = 0 then prefixM c else prefixJ c) ≤ prefixNumeratorBound c.P c.m i := by |
| 327 | unfold prefixNumeratorBound |
| 328 | split_ifs |
| 329 | · exact (prefixM_bounds c).2 |
| 330 | · exact (prefixJ_bounds c).2 |
| 331 | have hfloor := scaleFloor_pos c.P_pos c.m i |
| 332 | have hsc : scaleFloor c.P c.m i * Real.exp (beta c i * c.wait) ≤ momentScale c i := by |
| 333 | rw [momentScale_split] |
| 334 | exact mul_le_mul_of_nonneg_right (holdScale_lower c i) (Real.exp_pos _).le |
| 335 | calc |
| 336 | prefixCoefficient c i ≤ prefixNumeratorBound c.P c.m i / momentScale c i := |
| 337 | div_le_div_of_nonneg_right hn (momentScale_pos c i).le |
| 338 | _ ≤ prefixNumeratorBound c.P c.m i / |
| 339 | (scaleFloor c.P c.m i * Real.exp (beta c i * c.wait)) := |
| 340 | div_le_div_of_nonneg_left (prefixNumeratorBound_pos c.P_pos c.m i).le |
| 341 | (mul_pos hfloor (Real.exp_pos _)) hsc |
| 342 | _ = _ := by rw [Real.exp_neg]; unfold prefixBound; field_simp |
| 343 | |
| 344 | theorem prefixCoefficient_small (c : Parameters) |
| 345 | (hwait : c.wait = 60 * Real.log (1 / c.lam)) |
| 346 | (hsmall : c.lam ≤ 1 / 120) (i : Fin 2) : |
| 347 | |prefixCoefficient c i| ≤ prefixBound c.P c.m i * c.lam ^ 29 := by |
| 348 | rw [abs_of_nonneg (prefixCoefficient_nonneg c i)] |
| 349 | exact (prefixCoefficient_decay c i).trans |
| 350 | (mul_le_mul_of_nonneg_left (wait_decay c hwait hsmall i) |
| 351 | (prefixBound_pos c.P_pos c.m i).le) |
| 352 | |
| 353 | /-! The mass average is divided by the actual angular profile, including its |
| 354 | parameter shape. These bounds therefore include the shape's first derivative. -/ |
| 355 | |
| 356 | noncomputable def parameterPolynomial (eta : ℝ) : ℝ := eta * (1 + eta ^ 2) |
| 357 | |
| 358 | theorem parameterPolynomial_bound {eta : ℝ} (heta : |eta| ≤ 1) : |
| 359 | |parameterPolynomial eta| ≤ 2 := by |
| 360 | have hs : eta ^ 2 ≤ 1 := by |
| 361 | have h := sq_le_sq₀ (abs_nonneg eta) (by norm_num : (0 : ℝ) ≤ 1) |>.mpr heta |
| 362 | simpa using h |
| 363 | rw [parameterPolynomial, abs_mul, abs_of_nonneg (by positivity : 0 ≤ 1 + eta ^ 2)] |
| 364 | nlinarith [abs_nonneg eta] |
| 365 | |
| 366 | theorem parameterPolynomial_hasDerivAt (eta : ℝ) : |
| 367 | HasDerivAt parameterPolynomial (1 + 3 * eta ^ 2) eta := by |
| 368 | convert! (hasDerivAt_id eta).mul ((hasDerivAt_const eta (1 : ℝ)).add |
| 369 | ((hasDerivAt_id eta).pow 2)) using 1 ; dsimp [parameterPolynomial] ; ring |
| 370 | |
| 371 | theorem parameterPolynomial_derivative_bound {eta : ℝ} (heta : |eta| ≤ 1) : |
| 372 | |deriv parameterPolynomial eta| ≤ 4 := by |
| 373 | rw [(parameterPolynomial_hasDerivAt eta).deriv, |
| 374 | abs_of_nonneg (by positivity : 0 ≤ 1 + 3 * eta ^ 2)] |
| 375 | have hs : eta ^ 2 ≤ 1 := by |
| 376 | have h := sq_le_sq₀ (abs_nonneg eta) (by norm_num : (0 : ℝ) ≤ 1) |>.mpr heta |
| 377 | simpa using h |
| 378 | nlinarith |
| 379 | |
| 380 | theorem normalized_mass_prefix (c : Parameters) (amp : ℝ → ℝ) (eta : ℝ) : |
| 381 | massMoment c amp eta c.pulseStart / |
| 382 | (Real.exp c.pulseStart * angular c.P c.dropLength c.lam (c.pulseStart, eta)) = |
| 383 | prefixCoefficient c 0 * parameterPolynomial eta := by |
| 384 | rw [massMoment_at_pulseStart] |
| 385 | simp only [angular, shape, prefixCoefficient, momentScale, ↓reduceIte, |
| 386 | pulseAmplitude, parameterPolynomial] |
| 387 | have he := Real.exp_pos c.pulseStart |
| 388 | have hr : 0 < radialAmplitude c.P c.dropLength c.lam c.pulseStart := pulseAmplitude_pos c |
| 389 | have hp : 0 < 1 + eta ^ 2 := by positivity |
| 390 | field_simp |
| 391 | |
| 392 | /-! ## The actual bump is one fixed template in log coordinates -/ |
| 393 | |
| 394 | noncomputable def templateLower : ℝ := Real.exp (-(3 / 20 : ℝ)) |
| 395 | noncomputable def templateUpper : ℝ := Real.exp (3 / 20 : ℝ) |
| 396 | noncomputable def radialTemplate : ℝ → ℝ := |
| 397 | LocalizedMomentRepair.bump templateLower templateUpper |
| 398 | noncomputable def logTemplate (z : ℝ) : ℝ := radialTemplate (Real.exp z) |
| 399 | |
| 400 | theorem templateLower_pos : 0 < templateLower := Real.exp_pos _ |
| 401 | theorem templateLower_lt_upper : templateLower < templateUpper := by |
| 402 | apply Real.exp_lt_exp.mpr |
| 403 | norm_num |
| 404 | |
| 405 | theorem radialTemplate_contDiff : ContDiff ℝ ∞ radialTemplate := |
| 406 | LocalizedMomentRepair.bump_contDiff _ _ |
| 407 | |
| 408 | theorem radialTemplate_hasCompactSupport : HasCompactSupport radialTemplate := |
| 409 | LocalizedMomentRepair.bump_hasCompactSupport _ _ templateLower_lt_upper |
| 410 | |
| 411 | theorem radialTemplate_nonneg (x : ℝ) : 0 ≤ radialTemplate x := |
| 412 | LocalizedMomentRepair.bump_nonneg _ _ _ |
| 413 | |
| 414 | theorem radialTemplate_support (x : ℝ) (hx : radialTemplate x ≠ 0) : |
| 415 | templateLower < x ∧ x < templateUpper := |
| 416 | LocalizedMomentRepair.bump_tsupport_subset_open _ _ templateLower_lt_upper (subset_closure hx) |
| 417 | |
| 418 | theorem logTemplate_contDiff : ContDiff ℝ ∞ logTemplate := |
| 419 | radialTemplate_contDiff.comp contDiff_id.exp |
| 420 | |
| 421 | theorem logTemplate_support : support logTemplate ⊆ Icc (-1 : ℝ) 1 := by |
| 422 | intro z hz |
| 423 | have h := radialTemplate_support (Real.exp z) hz |
| 424 | change Real.exp (-(3 / 20 : ℝ)) < Real.exp z ∧ Real.exp z < Real.exp (3 / 20 : ℝ) at h |
| 425 | have hl := Real.exp_lt_exp.mp h.1 |
| 426 | have hu := Real.exp_lt_exp.mp h.2 |
| 427 | constructor <;> linarith |
| 428 | |
| 429 | theorem logTemplate_hasCompactSupport : HasCompactSupport logTemplate := |
| 430 | HasCompactSupport.of_support_subset_isCompact isCompact_Icc logTemplate_support |
| 431 | |
| 432 | theorem logTemplate_jet_bound (k : ℕ) : |
| 433 | ∃ C : ℝ, 0 ≤ C ∧ ∀ y, |iteratedDeriv k logTemplate y| ≤ C := |
| 434 | LocalizedMomentRepair.smooth_compact_derivative_bound logTemplate |
| 435 | logTemplate_contDiff logTemplate_hasCompactSupport k |
| 436 | |
| 437 | theorem bump_scale {k : ℝ} (hk : k ≠ 0) (l u x : ℝ) : |
| 438 | LocalizedMomentRepair.bump (k * l) (k * u) (k * x) = |
| 439 | LocalizedMomentRepair.bump l u x := by |
| 440 | unfold LocalizedMomentRepair.bump |
| 441 | congr 1 |
| 442 | calc |
| 443 | _ = (k * (x - (l + u) / 2)) / (k * ((u - l) / 4)) := by |
| 444 | congr 1 <;> ring |
| 445 | _ = _ := mul_div_mul_left _ _ hk |
| 446 | |
| 447 | noncomputable def center (c : Parameters) (j : Fin 2) : ℝ := |
| 448 | c.pulseLength - if j = 0 then 3 else 1 |
| 449 | |
| 450 | theorem lower_scale (c : Parameters) (j : Fin 2) : |
| 451 | c.lower j = Real.exp (center c j) * templateLower := by |
| 452 | change Real.exp (c.pulseLength - if j = 0 then 63 / 20 else 23 / 20) = |
| 453 | Real.exp (center c j) * Real.exp (-(3 / 20 : ℝ)) |
| 454 | rw [← Real.exp_add] |
| 455 | apply congrArg Real.exp |
| 456 | fin_cases j <;> norm_num [center] <;> ring |
| 457 | |
| 458 | theorem upper_scale (c : Parameters) (j : Fin 2) : |
| 459 | c.upper j = Real.exp (center c j) * templateUpper := by |
| 460 | change Real.exp (c.pulseLength - if j = 0 then 57 / 20 else 17 / 20) = |
| 461 | Real.exp (center c j) * Real.exp (3 / 20 : ℝ) |
| 462 | rw [← Real.exp_add] |
| 463 | apply congrArg Real.exp |
| 464 | fin_cases j <;> norm_num [center] <;> ring |
| 465 | |
| 466 | theorem bump_log_translate (c : Parameters) (j : Fin 2) (y : ℝ) : |
| 467 | LocalizedMomentRepair.bump (c.lower j) (c.upper j) (Real.exp y) = |
| 468 | logTemplate (y - center c j) := by |
| 469 | rw [lower_scale, upper_scale] |
| 470 | have he : Real.exp y = Real.exp (center c j) * Real.exp (y - center c j) := by |
| 471 | rw [← Real.exp_add] |
| 472 | congr 1 |
| 473 | ring |
| 474 | rw [he, bump_scale (Real.exp_ne_zero _)] |
| 475 | rfl |
| 476 | |
| 477 | noncomputable def templateMass : ℝ := ∫ x, radialTemplate x |
| 478 | noncomputable def rowMoment (a : ℝ) : ℝ := ∫ x, x ^ a * radialTemplate x |
| 479 | noncomputable def rowFloor : ℝ := Real.exp (-1) * templateMass |
| 480 | |
| 481 | theorem templateMass_pos : 0 < templateMass := by |
| 482 | apply integral_pos_of_integrable_nonneg_nonzero radialTemplate_contDiff.continuous |
| 483 | (radialTemplate_contDiff.continuous.integrable_of_hasCompactSupport |
| 484 | radialTemplate_hasCompactSupport) radialTemplate_nonneg |
| 485 | (x := (templateLower + templateUpper) / 2) |
| 486 | rw [radialTemplate, LocalizedMomentRepair.bump_at_center] |
| 487 | norm_num |
| 488 | |
| 489 | theorem rowFloor_pos : 0 < rowFloor := mul_pos (Real.exp_pos _) templateMass_pos |
| 490 | |
| 491 | theorem rowMoment_integrable (a : ℝ) : Integrable (fun x => x ^ a * radialTemplate x) := |
| 492 | LocalizedMomentRepair.integrable_power_mul_bump a _ _ templateLower_pos templateLower_lt_upper |
| 493 | |
| 494 | theorem rowMoment_bounds {a : ℝ} (ha : -1 ≤ a) (ha' : a ≤ 0) : |
| 495 | rowFloor ≤ rowMoment a ∧ rowMoment a ≤ Real.exp 1 * templateMass := by |
| 496 | have hm : Integrable radialTemplate := radialTemplate_contDiff.continuous.integrable_of_hasCompactSupport |
| 497 | radialTemplate_hasCompactSupport |
| 498 | have hp : ∀ x, radialTemplate x ≠ 0 → Real.exp (-1) ≤ x ^ a ∧ x ^ a ≤ Real.exp 1 := by |
| 499 | intro x hx |
| 500 | have hs := radialTemplate_support x hx |
| 501 | have hxpos := templateLower_pos.trans hs.1 |
| 502 | have hl : -(3 / 20 : ℝ) < Real.log x := by |
| 503 | simpa only [templateLower, Real.log_exp] using Real.log_lt_log templateLower_pos hs.1 |
| 504 | have hu : Real.log x < (3 / 20 : ℝ) := by |
| 505 | simpa only [templateUpper, Real.log_exp] using Real.log_lt_log hxpos hs.2 |
| 506 | have hab : |a| ≤ 1 := abs_le.mpr ⟨ha, by linarith⟩ |
| 507 | have hlb : |Real.log x| ≤ 1 := abs_le.mpr ⟨by linarith, by linarith⟩ |
| 508 | have hh : |Real.log x * a| ≤ 1 := by |
| 509 | rw [abs_mul] |
| 510 | nlinarith [abs_nonneg a, abs_nonneg (Real.log x)] |
| 511 | rw [Real.rpow_def_of_pos hxpos] |
| 512 | exact ⟨Real.exp_le_exp.mpr (abs_le.mp hh).1, |
| 513 | Real.exp_le_exp.mpr (abs_le.mp hh).2⟩ |
| 514 | constructor |
| 515 | · have h := integral_mono (hm.const_mul (Real.exp (-1))) (rowMoment_integrable a) |
| 516 | (fun x => show Real.exp (-1) * radialTemplate x ≤ x ^ a * radialTemplate x from by |
| 517 | by_cases hx : radialTemplate x = 0 |
| 518 | · simp [hx] |
| 519 | · exact mul_le_mul_of_nonneg_right (hp x hx).1 (radialTemplate_nonneg x)) |
| 520 | simpa only [integral_const_mul, rowFloor, templateMass, rowMoment] using h |
| 521 | · have h := integral_mono (rowMoment_integrable a) (hm.const_mul (Real.exp 1)) |
| 522 | (fun x => show x ^ a * radialTemplate x ≤ Real.exp 1 * radialTemplate x from by |
| 523 | by_cases hx : radialTemplate x = 0 |
| 524 | · simp [hx] |
| 525 | · exact mul_le_mul_of_nonneg_right (hp x hx).2 (radialTemplate_nonneg x)) |
| 526 | simpa only [integral_const_mul, templateMass, rowMoment] using h |
| 527 | |
| 528 | theorem power_bump_integral_scale (a : ℝ) {k l u : ℝ} |
| 529 | (hk : 0 < k) (hl : 0 < l) (hlu : l < u) : |
| 530 | (∫ t : ℝ, t ^ a * LocalizedMomentRepair.bump (k * l) (k * u) t) = |
| 531 | (k * k ^ a) * ∫ t : ℝ, t ^ a * LocalizedMomentRepair.bump l u t := by |
| 532 | let g := fun t : ℝ => t ^ a * LocalizedMomentRepair.bump (k * l) (k * u) t |
| 533 | have hcomp : (fun x => g (k * x)) = |
| 534 | (fun x : ℝ => k ^ a * (x ^ a * LocalizedMomentRepair.bump l u x)) := by |
| 535 | funext x |
| 536 | dsimp [g] |
| 537 | rw [bump_scale hk.ne'] |
| 538 | by_cases hb : LocalizedMomentRepair.bump l u x = 0 |
| 539 | · simp [hb] |
| 540 | · have hx := LocalizedMomentRepair.bump_tsupport_subset_open l u hlu (subset_closure hb) |
| 541 | rw [Real.mul_rpow hk.le (hl.trans hx.1).le] |
| 542 | ring |
| 543 | have h := Measure.integral_comp_mul_left g k |
| 544 | rw [hcomp, integral_const_mul, abs_of_pos (inv_pos.mpr hk), smul_eq_mul] at h |
| 545 | calc |
| 546 | _ = k * (k⁻¹ * ∫ t, g t) := by rw [← mul_assoc, mul_inv_cancel₀ hk.ne', one_mul] |
| 547 | _ = k * (k ^ a * ∫ t : ℝ, t ^ a * LocalizedMomentRepair.bump l u t) := by rw [← h] |
| 548 | _ = _ := by ring |
| 549 | |
| 550 | theorem actual_matrix_entry (c : Parameters) (i j : Fin 2) : |
| 551 | LocalizedMomentRepair.matrix c.exponents c.lower c.upper i j = |
| 552 | rowMoment (c.exponents i) * Real.exp (beta c i * center c j) := by |
| 553 | change (∫ t : ℝ, t ^ c.exponents i * LocalizedMomentRepair.bump (c.lower j) (c.upper j) t) = _ |
| 554 | rw [lower_scale, upper_scale, |
| 555 | power_bump_integral_scale (c.exponents i) (Real.exp_pos _) templateLower_pos templateLower_lt_upper] |
| 556 | rw [Real.rpow_def_of_pos (Real.exp_pos _), Real.log_exp, ← Real.exp_add] |
| 557 | dsimp [rowMoment, radialTemplate, beta] |
| 558 | rw [mul_comm] |
| 559 | congr 2 |
| 560 | ring |
| 561 | |
| 562 | /-- The actual moment matrix, with each row normalized at the first center. -/ |
| 563 | noncomputable def normalizedMatrix (c : Parameters) : Matrix (Fin 2) (Fin 2) ℝ := |
| 564 | fun i j => Real.exp (-(beta c i * center c 0)) * |
| 565 | LocalizedMomentRepair.matrix c.exponents c.lower c.upper i j |
| 566 | |
| 567 | theorem normalizedMatrix_entry (c : Parameters) (i j : Fin 2) : |
| 568 | normalizedMatrix c i j = rowMoment (c.exponents i) * |
| 569 | (if j = 0 then 1 else Real.exp (2 * beta c i)) := by |
| 570 | rw [normalizedMatrix, actual_matrix_entry] |
| 571 | calc |
| 572 | _ = rowMoment (c.exponents i) * |
| 573 | Real.exp (beta c i * (center c j - center c 0)) := by |
| 574 | rw [show beta c i * (center c j - center c 0) = |
| 575 | -(beta c i * center c 0) + beta c i * center c j by ring, Real.exp_add] |
| 576 | ring |
| 577 | _ = _ := by fin_cases j <;> norm_num [center, mul_comm] |
| 578 | |
| 579 | theorem rowMoment_lower (c : Parameters) (i : Fin 2) : rowFloor ≤ rowMoment (c.exponents i) := by |
| 580 | apply (rowMoment_bounds ?_ ?_).1 |
| 581 | all_goals fin_cases i <;> norm_num [Parameters.exponents] <;> linarith [c.lam_pos, c.lam_lt] |
| 582 | |
| 583 | theorem separation_exponential_bounds (c : Parameters) (i : Fin 2) : |
| 584 | 1 ≤ Real.exp (2 * beta c i) ∧ Real.exp (2 * beta c i) ≤ Real.exp 1 := by |
| 585 | constructor |
| 586 | · exact Real.one_le_exp_iff.mpr (by linarith [(beta_bounds c i).1]) |
| 587 | · exact Real.exp_le_exp.mpr (by linarith [(beta_bounds c i).2]) |
| 588 | |
| 589 | theorem separation_exponential_gap (c : Parameters) : |
| 590 | 2 * c.lam ≤ Real.exp (2 * beta c 0) - Real.exp (2 * beta c 1) := by |
| 591 | have hid : 2 * beta c 0 = 2 * beta c 1 + 2 * c.lam := by |
| 592 | norm_num [beta, Parameters.exponents] |
| 593 | ring |
| 594 | rw [hid, Real.exp_add] |
| 595 | have he := Real.add_one_le_exp (2 * c.lam) |
| 596 | have hb := (separation_exponential_bounds c 1).1 |
| 597 | nlinarith [mul_nonneg (by linarith : 0 ≤ Real.exp (2 * beta c 1) - 1) |
| 598 | (by linarith [c.lam_pos] : 0 ≤ Real.exp (2 * c.lam) - 1)] |
| 599 | |
| 600 | /-- A uniform inverse estimate from the actual exponential column separation. -/ |
| 601 | noncomputable def inverseBound : ℝ := (1 + Real.exp 1) / rowFloor |
| 602 | |
| 603 | theorem inverseBound_pos : 0 < inverseBound := div_pos (by positivity) rowFloor_pos |
| 604 | |
| 605 | theorem two_row_solution_bound {k lam A0 A1 r0 r1 x0 x1 d0 d1 : ℝ} |
| 606 | (hk : 0 < k) (hlam : 0 < lam) (hlam' : lam ≤ 1) |
| 607 | (hA0 : k ≤ A0) (hA1 : k ≤ A1) |
| 608 | (hr0 : 0 ≤ r0) (hr0' : r0 ≤ Real.exp 1) |
| 609 | (hgap : lam ≤ r0 - r1) |
| 610 | (h0 : A0 * (x0 + r0 * x1) = d0) (h1 : A1 * (x0 + r1 * x1) = d1) : |
| 611 | lam * |x0| ≤ ((1 + Real.exp 1) / k) * (|d0| + |d1|) ∧ |
| 612 | lam * |x1| ≤ ((1 + Real.exp 1) / k) * (|d0| + |d1|) := by |
| 613 | have hA0p := hk.trans_le hA0 |
| 614 | have hA1p := hk.trans_le hA1 |
| 615 | have h0' : x0 + r0 * x1 = d0 / A0 := (eq_div_iff hA0p.ne').mpr (by nlinarith [h0]) |
| 616 | have h1' : x0 + r1 * x1 = d1 / A1 := (eq_div_iff hA1p.ne').mpr (by nlinarith [h1]) |
| 617 | have ha0 : |d0 / A0| ≤ |d0| / k := by |
| 618 | rw [abs_div, abs_of_pos hA0p] |
| 619 | exact div_le_div_of_nonneg_left (abs_nonneg _) hk hA0 |
| 620 | have ha1 : |d1 / A1| ≤ |d1| / k := by |
| 621 | rw [abs_div, abs_of_pos hA1p] |
| 622 | exact div_le_div_of_nonneg_left (abs_nonneg _) hk hA1 |
| 623 | have hdx : (r0 - r1) * x1 = d0 / A0 - d1 / A1 := by nlinarith [h0', h1'] |
| 624 | have hdiff := abs_sub (d0 / A0) (d1 / A1) |
| 625 | rw [← hdx, abs_mul, abs_of_pos (hlam.trans_le hgap)] at hdiff |
| 626 | have hx1 : lam * |x1| ≤ (|d0| + |d1|) / k := by |
| 627 | have hx := mul_le_mul_of_nonneg_right hgap (abs_nonneg x1) |
| 628 | rw [add_div] |
| 629 | linarith |
| 630 | have hx0eq : x0 = d0 / A0 - r0 * x1 := by linarith [h0'] |
| 631 | have hx0 : |x0| ≤ |d0 / A0| + r0 * |x1| := by |
| 632 | rw [hx0eq] |
| 633 | simpa only [abs_mul, abs_of_nonneg hr0] using abs_sub (d0 / A0) (r0 * x1) |
| 634 | have hd : 0 ≤ (|d0| + |d1|) / k := div_nonneg (by positivity) hk.le |
| 635 | have he : 0 ≤ Real.exp (1 : ℝ) := (Real.exp_pos _).le |
| 636 | have h0d : |d0| / k ≤ (|d0| + |d1|) / k := |
| 637 | div_le_div_of_nonneg_right (by linarith [abs_nonneg d1]) hk.le |
| 638 | have hsmall : lam * |d0 / A0| ≤ (|d0| + |d1|) / k := by |
| 639 | have hmul := mul_le_mul_of_nonneg_right hlam' (abs_nonneg (d0 / A0)) |
| 640 | linarith |
| 641 | have hscaled := mul_le_mul_of_nonneg_left hx0 hlam.le |
| 642 | have hrscaled : r0 * (lam * |x1|) ≤ Real.exp 1 * ((|d0| + |d1|) / k) := |
| 643 | mul_le_mul hr0' hx1 (mul_nonneg hlam.le (abs_nonneg x1)) he |
| 644 | have hid : ((1 + Real.exp 1) / k) * (|d0| + |d1|) = |
| 645 | (|d0| + |d1|) / k + Real.exp 1 * ((|d0| + |d1|) / k) := by ring |
| 646 | constructor <;> rw [hid] |
| 647 | · nlinarith |
| 648 | · nlinarith |
| 649 | |
| 650 | theorem normalized_solution_bound (c : Parameters) (x d : Fin 2 → ℝ) |
| 651 | (h : (normalizedMatrix c).mulVec x = d) (j : Fin 2) : |
| 652 | c.lam * |x j| ≤ inverseBound * (|d 0| + |d 1|) := by |
| 653 | have h0 := congrFun h 0 |
| 654 | have h1 := congrFun h 1 |
| 655 | simp only [Matrix.mulVec, dotProduct, Fin.sum_univ_two, normalizedMatrix_entry] at h0 h1 |
| 656 | norm_num at h0 h1 |
| 657 | have hb := two_row_solution_bound rowFloor_pos c.lam_pos (by linarith [c.lam_lt]) |
| 658 | (rowMoment_lower c 0) (rowMoment_lower c 1) |
| 659 | (Real.exp_pos _).le (separation_exponential_bounds c 0).2 |
| 660 | (show c.lam ≤ Real.exp (2 * beta c 0) - Real.exp (2 * beta c 1) by |
| 661 | linarith [separation_exponential_gap c, c.lam_pos]) |
| 662 | (show rowMoment (c.exponents 0) * (x 0 + Real.exp (2 * beta c 0) * x 1) = d 0 by |
| 663 | nlinarith [h0]) |
| 664 | (show rowMoment (c.exponents 1) * (x 0 + Real.exp (2 * beta c 1) * x 1) = d 1 by |
| 665 | nlinarith [h1]) |
| 666 | fin_cases j |
| 667 | · exact hb.1 |
| 668 | · exact hb.2 |
| 669 | |
| 670 | noncomputable def normalizedDebt (c : Parameters) (d : Fin 2 → ℝ) (i : Fin 2) : ℝ := |
| 671 | Real.exp (-(beta c i * center c 0)) * d i |
| 672 | |
| 673 | theorem actual_coefficients_normalized_system (c : Parameters) (d : Fin 2 → ℝ) : |
| 674 | (normalizedMatrix c).mulVec |
| 675 | (LocalizedMomentRepair.coefficients c.exponents c.lower c.upper d) = |
| 676 | normalizedDebt c d := by |
| 677 | have h := MomentRepair.matrix_mul_coefficients |
| 678 | (LocalizedMomentRepair.matrix c.exponents c.lower c.upper) |
| 679 | (LocalizedMomentRepair.matrix_det_ne_zero c.exponents c.lower c.upper |
| 680 | c.exponents_injective c.lower_pos c.lower_lt_upper c.intervals_separated) d |
| 681 | ext i |
| 682 | have hi := congrFun h i |
| 683 | change (∑ j : Fin 2, (Real.exp (-(beta c i * center c 0)) * |
| 684 | LocalizedMomentRepair.matrix c.exponents c.lower c.upper i j) * |
| 685 | LocalizedMomentRepair.coefficients c.exponents c.lower c.upper d j) = _ |
| 686 | simp_rw [mul_assoc] |
| 687 | rw [← Finset.mul_sum] |
| 688 | exact congrArg (fun x => Real.exp (-(beta c i * center c 0)) * x) hi |
| 689 | |
| 690 | theorem actual_coefficients_bound (c : Parameters) (d : Fin 2 → ℝ) (j : Fin 2) : |
| 691 | c.lam * |LocalizedMomentRepair.coefficients c.exponents c.lower c.upper d j| ≤ |
| 692 | inverseBound * (|normalizedDebt c d 0| + |normalizedDebt c d 1|) := |
| 693 | normalized_solution_bound c _ _ (actual_coefficients_normalized_system c d) j |
| 694 | |
| 695 | /-! ## Actual normalized debts -/ |
| 696 | |
| 697 | theorem mainPulse_hasCompactSupport : HasCompactSupport mainPulse := by |
| 698 | have hs : support mainPulse ⊆ Icc (0 : ℝ) 11 := by |
| 699 | intro z hz |
| 700 | constructor |
| 701 | · by_contra h |
| 702 | exact hz (mainPulse_zero_left (by linarith)) |
| 703 | · by_contra h |
| 704 | exact hz (mainPulse_zero_right (by linarith)) |
| 705 | exact HasCompactSupport.of_support_subset_isCompact isCompact_Icc hs |
| 706 | |
| 707 | theorem exists_mainPulse_bound : ∃ C : ℝ, 0 < C ∧ ∀ z, |mainPulse z| ≤ C := by |
| 708 | obtain ⟨C, hC, hb⟩ := LocalizedMomentRepair.smooth_compact_derivative_bound mainPulse |
| 709 | mainPulse_contDiff mainPulse_hasCompactSupport 0 |
| 710 | refine ⟨C + 1, by linarith, fun z => ?_⟩ |
| 711 | have h := hb z |
| 712 | simpa only [iteratedDeriv_zero] using h.trans (by linarith : C ≤ C + 1) |
| 713 | |
| 714 | noncomputable def mainBound : ℝ := Classical.choose exists_mainPulse_bound |
| 715 | theorem mainBound_pos : 0 < mainBound := (Classical.choose_spec exists_mainPulse_bound).1 |
| 716 | theorem mainPulse_abs_le (z : ℝ) : |mainPulse z| ≤ mainBound := |
| 717 | (Classical.choose_spec exists_mainPulse_bound).2 z |
| 718 | |
| 719 | theorem mainMoment_log (c : Parameters) (i : Fin 2) : |
| 720 | mainMoment c i = ∫ y in (0 : ℝ)..c.pulseLength, |
| 721 | Real.exp (beta c i * y) * mainPulse (c.lam * y) := by |
| 722 | have hlog : ContinuousOn Real.log (Ioi (0 : ℝ)) := |
| 723 | continuousOn_id.log (fun _ hx => ne_of_gt hx) |
| 724 | have hR : ContinuousOn (fun x => mainPulse (c.lam * Real.log x)) (Ioi 0) := |
| 725 | mainPulse_contDiff.continuous.comp_continuousOn (continuousOn_const.mul hlog) |
| 726 | have h := exp_weight_substitution hR (c.exponents i) 0 c.pulseLength |
| 727 | simpa only [mainMoment, beta, zero_add, sub_zero, Real.log_exp] using h.symm |
| 728 | |
| 729 | theorem mainMoment_log_short (c : Parameters) (i : Fin 2) : |
| 730 | mainMoment c i = ∫ y in (0 : ℝ)..11 / c.lam, |
| 731 | Real.exp (beta c i * y) * mainPulse (c.lam * y) := by |
| 732 | rw [mainMoment_log] |
| 733 | apply integral_stops |
| 734 | ((Real.continuous_exp.comp (continuous_const.mul continuous_id)).mul |
| 735 | (mainPulse_contDiff.continuous.comp (continuous_const.mul continuous_id))) |
| 736 | (show 11 / c.lam ≤ c.pulseLength by |
| 737 | exact div_le_div_of_nonneg_right (by norm_num) c.lam_pos.le) |
| 738 | intro y hy |
| 739 | have hp : 11 ≤ c.lam * y := by |
| 740 | have h := (div_le_iff₀ c.lam_pos).mp hy |
| 741 | nlinarith |
| 742 | simp only [Pi.mul_apply, Function.comp_apply, id_eq] |
| 743 | rw [mainPulse_zero_right hp, mul_zero] |
| 744 | |
| 745 | theorem center_gap_bound (c : Parameters) (hsmall : c.lam ≤ 1 / 120) (i : Fin 2) : |
| 746 | 1 / (2 * c.lam) ≤ beta c i * (center c 0 - 11 / c.lam) := by |
| 747 | have hb := (beta_small_bounds c hsmall i).1 |
| 748 | have hp : 0 ≤ 2 - 3 * c.lam := by linarith [c.lam_pos] |
| 749 | have hm := mul_le_mul_of_nonneg_right hb hp |
| 750 | have hnum : (1 / 2 : ℝ) ≤ beta c i * (2 - 3 * c.lam) := by nlinarith |
| 751 | have hdiv := div_le_div_of_nonneg_right hnum c.lam_pos.le |
| 752 | have he : beta c i * (center c 0 - 11 / c.lam) = |
| 753 | (beta c i * (2 - 3 * c.lam)) / c.lam := by |
| 754 | simp only [center, Parameters.pulseLength] |
| 755 | field_simp [c.lam_pos.ne'] ; ring_nf ; simp |
| 756 | rw [he] |
| 757 | convert! hdiv using 1 ; ring |
| 758 | |
| 759 | theorem normalized_mainMoment_bound (c : Parameters) (hsmall : c.lam ≤ 1 / 120) (i : Fin 2) : |
| 760 | |Real.exp (-(beta c i * center c 0)) * mainMoment c i| ≤ |
| 761 | (11 * mainBound / c.lam) * Real.exp (-(1 / (2 * c.lam))) := by |
| 762 | have heq : Real.exp (-(beta c i * center c 0)) * mainMoment c i = |
| 763 | ∫ y in (0 : ℝ)..11 / c.lam, |
| 764 | Real.exp (beta c i * (y - center c 0)) * mainPulse (c.lam * y) := by |
| 765 | rw [mainMoment_log_short, ← intervalIntegral.integral_const_mul] |
| 766 | apply intervalIntegral.integral_congr |
| 767 | intro y _ |
| 768 | dsimp only |
| 769 | rw [show beta c i * (y - center c 0) = |
| 770 | -(beta c i * center c 0) + beta c i * y by ring, Real.exp_add] |
| 771 | ring |
| 772 | rw [heq] |
| 773 | have hlen : 0 ≤ 11 / c.lam := div_nonneg (by norm_num) c.lam_pos.le |
| 774 | have h := intervalIntegral.norm_integral_le_of_norm_le_const |
| 775 | (a := (0 : ℝ)) (b := 11 / c.lam) |
| 776 | (f := fun y => Real.exp (beta c i * (y - center c 0)) * mainPulse (c.lam * y)) |
| 777 | (C := mainBound * Real.exp (-(1 / (2 * c.lam)))) ?_ |
| 778 | · rw [Real.norm_eq_abs, sub_zero, abs_of_nonneg hlen] at h |
| 779 | convert! h using 1 ; ring |
| 780 | · intro y hy |
| 781 | have hy' : y ≤ 11 / c.lam := (uIoc_of_le hlen ▸ hy).2 |
| 782 | have harg : beta c i * (y - center c 0) ≤ -(1 / (2 * c.lam)) := by |
| 783 | have hb := mul_le_mul_of_nonneg_left hy' (beta_bounds c i).1.le |
| 784 | linarith [center_gap_bound c hsmall i] |
| 785 | rw [Real.norm_eq_abs, abs_mul, abs_of_pos (Real.exp_pos _)] |
| 786 | calc |
| 787 | _ ≤ Real.exp (-(1 / (2 * c.lam))) * mainBound := |
| 788 | mul_le_mul (Real.exp_le_exp.mpr harg) (mainPulse_abs_le _) |
| 789 | (abs_nonneg _) (Real.exp_pos _).le |
| 790 | _ = _ := by ring |
| 791 | |
| 792 | theorem prefixCoefficient_le_bound (c : Parameters) (i : Fin 2) : |
| 793 | |prefixCoefficient c i| ≤ prefixBound c.P c.m i := by |
| 794 | rw [abs_of_nonneg (prefixCoefficient_nonneg c i)] |
| 795 | have he : Real.exp (-(beta c i * c.wait)) ≤ 1 := by |
| 796 | apply Real.exp_le_one_iff.mpr |
| 797 | have hw : 0 ≤ c.wait := by linarith [c.wait_gt] |
| 798 | nlinarith [(beta_bounds c i).1] |
| 799 | exact (prefixCoefficient_decay c i).trans (by |
| 800 | nlinarith [prefixBound_pos c.P_pos c.m i]) |
| 801 | |
| 802 | theorem normalized_prefixCoefficient_bound (c : Parameters) (hsmall : c.lam ≤ 1 / 120) |
| 803 | (i : Fin 2) : |
| 804 | |Real.exp (-(beta c i * center c 0)) * prefixCoefficient c i| ≤ |
| 805 | prefixBound c.P c.m i * Real.exp (-(1 / (2 * c.lam))) := by |
| 806 | have hgap := center_gap_bound c hsmall i |
| 807 | have hmain : 0 ≤ beta c i * (11 / c.lam) := |
| 808 | mul_nonneg (beta_bounds c i).1.le (div_nonneg (by norm_num) c.lam_pos.le) |
| 809 | have he : Real.exp (-(beta c i * center c 0)) ≤ Real.exp (-(1 / (2 * c.lam))) := by |
| 810 | apply Real.exp_le_exp.mpr |
| 811 | nlinarith |
| 812 | rw [abs_mul, abs_of_pos (Real.exp_pos _)] |
| 813 | calc |
| 814 | _ ≤ Real.exp (-(1 / (2 * c.lam))) * prefixBound c.P c.m i := |
| 815 | mul_le_mul he (prefixCoefficient_le_bound c i) (abs_nonneg _) (Real.exp_pos _).le |
| 816 | _ = _ := by ring |
| 817 | |
| 818 | noncomputable def affineDebt (c : Parameters) (q A : ℝ) (i : Fin 2) : ℝ := |
| 819 | -(q * prefixCoefficient c i + A * mainMoment c i) |
| 820 | |
| 821 | noncomputable def affineCoefficients (c : Parameters) (q A : ℝ) : Fin 2 → ℝ := |
| 822 | LocalizedMomentRepair.coefficients c.exponents c.lower c.upper (affineDebt c q A) |
| 823 | |
| 824 | noncomputable def debtBound (P m : ℝ) (i : Fin 2) : ℝ := |
| 825 | prefixBound P m i + 11 * mainBound |
| 826 | |
| 827 | theorem debtBound_pos {P : ℝ} (hP : 0 < P) (m : ℝ) (i : Fin 2) : 0 < debtBound P m i := by |
| 828 | have hp := prefixBound_pos hP m i |
| 829 | have hm := mainBound_pos |
| 830 | unfold debtBound |
| 831 | positivity |
| 832 | |
| 833 | theorem affineDebt_normalized_bound (c : Parameters) (hsmall : c.lam ≤ 1 / 120) |
| 834 | (q A : ℝ) (i : Fin 2) : |
| 835 | |normalizedDebt c (affineDebt c q A) i| ≤ |
| 836 | (debtBound c.P c.m i / c.lam) * Real.exp (-(1 / (2 * c.lam))) * (|q| + |A|) := by |
| 837 | have hD0 : prefixBound c.P c.m i ≤ debtBound c.P c.m i / c.lam := by |
| 838 | apply (le_div_iff₀ c.lam_pos).mpr |
| 839 | have hp := prefixBound_pos c.P_pos c.m i |
| 840 | have hm := mainBound_pos |
| 841 | dsimp [debtBound] |
| 842 | nlinarith [c.lam_lt] |
| 843 | have hD1 : 11 * mainBound / c.lam ≤ debtBound c.P c.m i / c.lam := by |
| 844 | apply div_le_div_of_nonneg_right _ c.lam_pos.le |
| 845 | have hp := prefixBound_pos c.P_pos c.m i |
| 846 | dsimp [debtBound] |
| 847 | linarith |
| 848 | have hp := (normalized_prefixCoefficient_bound c hsmall i).trans |
| 849 | (mul_le_mul_of_nonneg_right hD0 (Real.exp_pos _).le) |
| 850 | have hm := (normalized_mainMoment_bound c hsmall i).trans |
| 851 | (mul_le_mul_of_nonneg_right hD1 (Real.exp_pos _).le) |
| 852 | have heq : normalizedDebt c (affineDebt c q A) i = |
| 853 | -(q * (Real.exp (-(beta c i * center c 0)) * prefixCoefficient c i) + |
| 854 | A * (Real.exp (-(beta c i * center c 0)) * mainMoment c i)) := by |
| 855 | unfold normalizedDebt affineDebt |
| 856 | ring |
| 857 | rw [heq, abs_neg] |
| 858 | calc |
| 859 | _ ≤ |q * (Real.exp (-(beta c i * center c 0)) * prefixCoefficient c i)| + |
| 860 | |A * (Real.exp (-(beta c i * center c 0)) * mainMoment c i)| := abs_add_le _ _ |
| 861 | _ ≤ |q| * ((debtBound c.P c.m i / c.lam) * Real.exp (-(1 / (2 * c.lam)))) + |
| 862 | |A| * ((debtBound c.P c.m i / c.lam) * Real.exp (-(1 / (2 * c.lam)))) := by |
| 863 | simp only [abs_mul] at hp hm ⊢ |
| 864 | exact add_le_add (mul_le_mul_of_nonneg_left hp (abs_nonneg q)) |
| 865 | (mul_le_mul_of_nonneg_left hm (abs_nonneg A)) |
| 866 | _ = _ := by ring |
| 867 | |
| 868 | theorem inverse_square_exp_absorption {lam : ℝ} (hlam : 0 < lam) : |
| 869 | Real.exp (-(1 / (2 * lam))) / lam ^ 2 ≤ 64 * Real.exp (-(1 / (4 * lam))) := by |
| 870 | have ht : 0 ≤ 1 / (8 * lam) := by positivity |
| 871 | have hex : 1 / (8 * lam) ≤ Real.exp (1 / (8 * lam)) := by |
| 872 | linarith [Real.add_one_le_exp (1 / (8 * lam))] |
| 873 | have hsq := pow_le_pow_left₀ ht hex 2 |
| 874 | rw [← Real.exp_nat_mul] at hsq |
| 875 | have hfac : 1 / lam ^ 2 ≤ 64 * Real.exp (1 / (4 * lam)) := by |
| 876 | apply (div_le_iff₀ (sq_pos_of_pos hlam)).mpr |
| 877 | have ht' : (1 / (8 * lam)) ^ 2 = 1 / (64 * lam ^ 2) := by ring |
| 878 | have he' : (2 : ℝ) * (1 / (8 * lam)) = 1 / (4 * lam) := by ring |
| 879 | norm_num only [Nat.cast_ofNat] at hsq |
| 880 | rw [ht', he'] at hsq |
| 881 | have h := (div_le_iff₀ (by positivity : 0 < 64 * lam ^ 2)).mp hsq |
| 882 | nlinarith |
| 883 | have hprod := mul_le_mul_of_nonneg_right hfac (Real.exp_pos (-(1 / (2 * lam)))).le |
| 884 | have hsum : 1 / (4 * lam) + -(1 / (2 * lam)) = -(1 / (4 * lam)) := by ring |
| 885 | calc |
| 886 | _ = (1 / lam ^ 2) * Real.exp (-(1 / (2 * lam))) := by ring |
| 887 | _ ≤ _ := hprod |
| 888 | _ = _ := by rw [mul_assoc, ← Real.exp_add, hsum] |
| 889 | |
| 890 | noncomputable def coefficientBound (P m : ℝ) : ℝ := |
| 891 | 64 * inverseBound * (debtBound P m 0 + debtBound P m 1) |
| 892 | |
| 893 | theorem coefficientBound_pos {P : ℝ} (hP : 0 < P) (m : ℝ) : 0 < coefficientBound P m := by |
| 894 | have h0 := debtBound_pos hP m 0 |
| 895 | have h1 := debtBound_pos hP m 1 |
| 896 | have hi := inverseBound_pos |
| 897 | unfold coefficientBound |
| 898 | positivity |
| 899 | |
| 900 | theorem affineCoefficients_exp_bound (c : Parameters) (hsmall : c.lam ≤ 1 / 120) |
| 901 | (q A : ℝ) (j : Fin 2) : |
| 902 | |affineCoefficients c q A j| ≤ |
| 903 | coefficientBound c.P c.m * Real.exp (-(1 / (4 * c.lam))) * (|q| + |A|) := by |
| 904 | have h0 := affineDebt_normalized_bound c hsmall q A 0 |
| 905 | have h1 := affineDebt_normalized_bound c hsmall q A 1 |
| 906 | have hc := actual_coefficients_bound c (affineDebt c q A) j |
| 907 | change c.lam * |affineCoefficients c q A j| ≤ _ at hc |
| 908 | have hsum := mul_le_mul_of_nonneg_left (add_le_add h0 h1) inverseBound_pos.le |
| 909 | have hbase : |affineCoefficients c q A j| ≤ |
| 910 | (inverseBound * (debtBound c.P c.m 0 + debtBound c.P c.m 1)) * |
| 911 | (Real.exp (-(1 / (2 * c.lam))) / c.lam ^ 2) * (|q| + |A|) := by |
| 912 | apply (mul_le_mul_iff_right₀ c.lam_pos).mp |
| 913 | refine hc.trans (hsum.trans_eq ?_) |
| 914 | field_simp [c.lam_pos.ne'] |
| 915 | have hK : 0 ≤ inverseBound * (debtBound c.P c.m 0 + debtBound c.P c.m 1) := |
| 916 | mul_nonneg inverseBound_pos.le (add_nonneg (debtBound_pos c.P_pos c.m 0).le |
| 917 | (debtBound_pos c.P_pos c.m 1).le) |
| 918 | calc |
| 919 | _ ≤ _ := hbase |
| 920 | _ ≤ (inverseBound * (debtBound c.P c.m 0 + debtBound c.P c.m 1)) * |
| 921 | (64 * Real.exp (-(1 / (4 * c.lam)))) * (|q| + |A|) := |
| 922 | mul_le_mul_of_nonneg_right |
| 923 | (mul_le_mul_of_nonneg_left (inverse_square_exp_absorption c.lam_pos) hK) |
| 924 | (by positivity) |
| 925 | _ = _ := by unfold coefficientBound; ring |
| 926 | |
| 927 | /-! ## Fixed radial jets and first parameter derivatives -/ |
| 928 | |
| 929 | theorem affineCoefficients_decomposition (c : Parameters) (q A : ℝ) (j : Fin 2) : |
| 930 | affineCoefficients c q A j = q * affineCoefficients c 1 0 j + |
| 931 | A * affineCoefficients c 0 1 j := by |
| 932 | simp only [affineCoefficients, LocalizedMomentRepair.coefficients, Matrix.mulVec, |
| 933 | dotProduct, Fin.sum_univ_two, affineDebt] |
| 934 | ring |
| 935 | |
| 936 | theorem debt_eq_affine (c : Parameters) (amp : ℝ → ℝ) (eta : ℝ) : |
| 937 | debt c amp eta = affineDebt c (parameterPolynomial eta) (amp eta) := by |
| 938 | ext i |
| 939 | unfold debt affineDebt parameterPolynomial |
| 940 | ring |
| 941 | |
| 942 | noncomputable def affineProfile (c : Parameters) (q A y : ℝ) : ℝ := |
| 943 | ∑ j : Fin 2, affineCoefficients c q A j * logTemplate (y - center c j) |
| 944 | |
| 945 | theorem affineProfile_contDiff (c : Parameters) (q A : ℝ) : ContDiff ℝ ∞ (affineProfile c q A) := by |
| 946 | apply ContDiff.sum |
| 947 | intro j _ |
| 948 | exact contDiff_const.mul (logTemplate_contDiff.comp (contDiff_id.sub contDiff_const)) |
| 949 | |
| 950 | theorem correction_log_eq_affineProfile (c : Parameters) (amp : ℝ → ℝ) (eta y : ℝ) : |
| 951 | correction c amp eta (Real.exp y) = affineProfile c (parameterPolynomial eta) (amp eta) y := by |
| 952 | unfold correction LocalizedMomentRepair.repair affineProfile |
| 953 | apply Finset.sum_congr rfl |
| 954 | intro j _ |
| 955 | rw [bump_log_translate, debt_eq_affine] |
| 956 | rfl |
| 957 | |
| 958 | theorem affineProfile_jet_formula (c : Parameters) (q A : ℝ) (k : ℕ) (y : ℝ) : |
| 959 | iteratedDeriv k (affineProfile c q A) y = |
| 960 | ∑ j : Fin 2, affineCoefficients c q A j * iteratedDeriv k logTemplate (y - center c j) := by |
| 961 | unfold affineProfile |
| 962 | rw [LocalizedMomentRepair.iteratedDeriv_finite_sum Finset.univ |
| 963 | (fun j x => affineCoefficients c q A j * logTemplate (x - center c j)) |
| 964 | (fun j => contDiff_const.mul (logTemplate_contDiff.comp (contDiff_id.sub contDiff_const)))] |
| 965 | apply Finset.sum_congr rfl |
| 966 | intro j _ |
| 967 | have hj : ContDiffAt ℝ k (fun x => logTemplate (x - center c j)) y := |
| 968 | ((logTemplate_contDiff.comp (contDiff_id.sub contDiff_const)).of_le |
| 969 | (by exact_mod_cast (le_top : (k : ℕ∞) ≤ ⊤))).contDiffAt |
| 970 | rw [iteratedDeriv_const_mul _ hj] |
| 971 | have heq : (fun x => logTemplate (x - center c j)) = |
| 972 | (fun x => logTemplate (x + (-center c j))) := by |
| 973 | funext x |
| 974 | rw [sub_eq_add_neg] |
| 975 | rw [heq, iteratedDeriv_comp_add_const] |
| 976 | rfl |
| 977 | |
| 978 | noncomputable def templateJetBound (k : ℕ) : ℝ := 1 + Classical.choose (logTemplate_jet_bound k) |
| 979 | |
| 980 | theorem templateJetBound_pos (k : ℕ) : 0 < templateJetBound k := by |
| 981 | have h := (Classical.choose_spec (logTemplate_jet_bound k)).1 |
| 982 | unfold templateJetBound |
| 983 | linarith |
| 984 | |
| 985 | theorem logTemplate_jet_le (k : ℕ) (y : ℝ) : |iteratedDeriv k logTemplate y| ≤ templateJetBound k := by |
| 986 | have h := (Classical.choose_spec (logTemplate_jet_bound k)).2 y |
| 987 | unfold templateJetBound |
| 988 | linarith |
| 989 | |
| 990 | noncomputable def correctionJetBound (P m : ℝ) (k : ℕ) : ℝ := |
| 991 | 2 * coefficientBound P m * templateJetBound k |
| 992 | |
| 993 | theorem correctionJetBound_pos {P : ℝ} (hP : 0 < P) (m : ℝ) (k : ℕ) : |
| 994 | 0 < correctionJetBound P m k := by |
| 995 | have hc := coefficientBound_pos hP m |
| 996 | have hj := templateJetBound_pos k |
| 997 | unfold correctionJetBound |
| 998 | positivity |
| 999 | |
| 1000 | theorem affineProfile_jet_bound (c : Parameters) (hsmall : c.lam ≤ 1 / 120) |
| 1001 | (q A : ℝ) (k : ℕ) (y : ℝ) : |
| 1002 | |iteratedDeriv k (affineProfile c q A) y| ≤ |
| 1003 | correctionJetBound c.P c.m k * Real.exp (-(1 / (4 * c.lam))) * (|q| + |A|) := by |
| 1004 | rw [affineProfile_jet_formula, Fin.sum_univ_two] |
| 1005 | have hC : 0 ≤ coefficientBound c.P c.m * Real.exp (-(1 / (4 * c.lam))) * (|q| + |A|) := |
| 1006 | mul_nonneg (mul_nonneg (coefficientBound_pos c.P_pos c.m).le (Real.exp_pos _).le) |
| 1007 | (by positivity) |
| 1008 | have hb : ∀ j : Fin 2, |
| 1009 | |affineCoefficients c q A j * iteratedDeriv k logTemplate (y - center c j)| ≤ |
| 1010 | (coefficientBound c.P c.m * Real.exp (-(1 / (4 * c.lam))) * (|q| + |A|)) * |
| 1011 | templateJetBound k := by |
| 1012 | intro j |
| 1013 | rw [abs_mul] |
| 1014 | exact mul_le_mul (affineCoefficients_exp_bound c hsmall q A j) |
| 1015 | (logTemplate_jet_le k _) (abs_nonneg _) hC |
| 1016 | calc |
| 1017 | _ ≤ |affineCoefficients c q A 0 * iteratedDeriv k logTemplate (y - center c 0)| + |
| 1018 | |affineCoefficients c q A 1 * iteratedDeriv k logTemplate (y - center c 1)| := abs_add_le _ _ |
| 1019 | _ ≤ _ := add_le_add (hb 0) (hb 1) |
| 1020 | _ = _ := by unfold correctionJetBound; ring |
| 1021 | |
| 1022 | theorem affineProfile_jet_decomposition (c : Parameters) (q A : ℝ) (k : ℕ) (y : ℝ) : |
| 1023 | iteratedDeriv k (affineProfile c q A) y = |
| 1024 | q * iteratedDeriv k (affineProfile c 1 0) y + |
| 1025 | A * iteratedDeriv k (affineProfile c 0 1) y := by |
| 1026 | rw [affineProfile_jet_formula, affineProfile_jet_formula, affineProfile_jet_formula] |
| 1027 | simp only [Fin.sum_univ_two] |
| 1028 | rw [affineCoefficients_decomposition c q A 0, affineCoefficients_decomposition c q A 1] |
| 1029 | ring |
| 1030 | |
| 1031 | end NavierStokes.OutgoingPulseBounds |