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.FuturePressureBounds |
| 2 | import NavierStokes.TransportPrimitive |
| 3 | |
| 4 | /-! |
| 5 | # Pressure through the actual angular reset |
| 6 | |
| 7 | The corrected pressure is the improper integral of the actual corrected field. |
| 8 | The difference from the clean pressure is an explicit finite partial-reset |
| 9 | integral. Bounds use the first angular coefficient jet supplied by the proved |
| 10 | reset witness; no parity or second-jet estimate is assumed. |
| 11 | -/ |
| 12 | |
| 13 | noncomputable section |
| 14 | |
| 15 | open Set Filter MeasureTheory |
| 16 | open scoped Topology ContDiff |
| 17 | open NavierStokes.OutgoingSchedule NavierStokes.OutgoingTail |
| 18 | open NavierStokes.AngularMomentReset NavierStokes.UniformAngularReset |
| 19 | open NavierStokes.FuturePressureBounds |
| 20 | |
| 21 | namespace NavierStokes.CorrectedPressureBounds |
| 22 | |
| 23 | noncomputable def correctedPi {d : TailData} {K : ℝ} |
| 24 | (w : ResetWitness d K) (y eta : ℝ) : ℝ := |
| 25 | -(1 / 2 : ℝ) * ∫ t in Ioi y, correctedAngular d w.coefficients (t, eta) ^ 2 |
| 26 | |
| 27 | noncomputable def editDensity {d : TailData} {K : ℝ} |
| 28 | (w : ResetWitness d K) (p : ℝ × ℝ) : ℝ := |
| 29 | correctedAngular d w.coefficients p ^ 2 - finalAngular d p ^ 2 |
| 30 | |
| 31 | noncomputable def releaseSquare (d : TailData) : ℝ := |
| 32 | finalAngular d (d.releaseStart, 0) ^ 2 |
| 33 | |
| 34 | noncomputable def editSize (d : TailData) (K : ℝ) : ℝ := K * d.core.lam ^ (28 : ℕ) |
| 35 | |
| 36 | theorem releaseSquare_pos (d : TailData) : 0 < releaseSquare d := |
| 37 | sq_pos_of_pos (finalAngular_pos d _) |
| 38 | |
| 39 | theorem editSize_nonneg {d : TailData} {K : ℝ} (w : ResetWitness d K) : |
| 40 | 0 ≤ editSize d K := |
| 41 | (norm_nonneg (w.coefficients 0)).trans (w.coefficient_bound 0) |
| 42 | |
| 43 | theorem witness_K_nonneg {d : TailData} {K : ℝ} (w : ResetWitness d K) : 0 ≤ K := by |
| 44 | have he := editSize_nonneg w |
| 45 | dsimp [editSize] at he |
| 46 | exact nonneg_of_mul_nonneg_left he (pow_pos d.core.lam_pos 28) |
| 47 | |
| 48 | theorem relative_abs_le_two_norm (c : Coeff) (t : ℝ) : |relative c t| ≤ 2 * ‖c‖ := by |
| 49 | have h0 : |c 0| ≤ ‖c‖ := by simpa only [Real.norm_eq_abs] using norm_le_pi_norm c 0 |
| 50 | have h1 : |c 1| ≤ ‖c‖ := by simpa only [Real.norm_eq_abs] using norm_le_pi_norm c 1 |
| 51 | have hb (j : Fin 2) : |bump j t| ≤ 1 := by |
| 52 | rw [abs_of_nonneg (bump_nonneg j t)] |
| 53 | exact bump_le_one j t |
| 54 | calc |
| 55 | _ ≤ |c 0| * |bump 0 t| + |c 1| * |bump 1 t| := by |
| 56 | simpa only [relative, abs_mul] using abs_add_le (c 0 * bump 0 t) (c 1 * bump 1 t) |
| 57 | _ ≤ ‖c‖ * 1 + ‖c‖ * 1 := add_le_add |
| 58 | (mul_le_mul h0 (hb 0) (abs_nonneg _) (norm_nonneg _)) |
| 59 | (mul_le_mul h1 (hb 1) (abs_nonneg _) (norm_nonneg _)) |
| 60 | _ = _ := by ring |
| 61 | |
| 62 | theorem relative_coefficient_bound {d : TailData} {K : ℝ} |
| 63 | (w : ResetWitness d K) (eta t : ℝ) : |
| 64 | |relative (w.coefficients eta) t| ≤ 2 * editSize d K := |
| 65 | (relative_abs_le_two_norm _ _).trans |
| 66 | (mul_le_mul_of_nonneg_left (w.coefficient_bound eta) (by norm_num)) |
| 67 | |
| 68 | theorem relative_eta_hasDerivAt {d : TailData} {K : ℝ} |
| 69 | (w : ResetWitness d K) (eta t : ℝ) : |
| 70 | HasDerivAt (fun q => relative (w.coefficients q) t) |
| 71 | (relative (deriv w.coefficients eta) t) eta := by |
| 72 | have hc := (w.smooth.differentiable (by simp) eta).hasDerivAt |
| 73 | simpa only [relative] using |
| 74 | ((hasDerivAt_pi.mp hc 0).mul_const (bump 0 t)).fun_add |
| 75 | ((hasDerivAt_pi.mp hc 1).mul_const (bump 1 t)) |
| 76 | |
| 77 | theorem relative_eta_bound {d : TailData} {K : ℝ} |
| 78 | (w : ResetWitness d K) (eta t : ℝ) : |
| 79 | |relative (deriv w.coefficients eta) t| ≤ 2 * editSize d K := |
| 80 | (relative_abs_le_two_norm _ _).trans |
| 81 | (mul_le_mul_of_nonneg_left (w.eta_derivative_bound eta) (by norm_num)) |
| 82 | |
| 83 | theorem corrected_square_comparison {d : TailData} {K : ℝ} |
| 84 | (w : ResetWitness d K) (p : ℝ × ℝ) : |
| 85 | (1 / 4) * finalAngular d p ^ 2 ≤ correctedAngular d w.coefficients p ^ 2 ∧ |
| 86 | correctedAngular d w.coefficients p ^ 2 ≤ (9 / 4) * finalAngular d p ^ 2 := by |
| 87 | have hr := abs_le.mp (w.small_jets p.2 (p.1 - correctionCenter d)).1 |
| 88 | have hsq : (1 / 4 : ℝ) ≤ (1 + relative (w.coefficients p.2) |
| 89 | (p.1 - correctionCenter d)) ^ 2 ∧ |
| 90 | (1 + relative (w.coefficients p.2) (p.1 - correctionCenter d)) ^ 2 ≤ 9 / 4 := by |
| 91 | constructor <;> nlinarith |
| 92 | simp only [correctedAngular, mul_pow] |
| 93 | constructor |
| 94 | · simpa only [mul_comm (1 / 4 : ℝ)] using |
| 95 | mul_le_mul_of_nonneg_left hsq.1 (sq_nonneg (finalAngular d p)) |
| 96 | · simpa only [mul_comm (9 / 4 : ℝ)] using |
| 97 | mul_le_mul_of_nonneg_left hsq.2 (sq_nonneg (finalAngular d p)) |
| 98 | |
| 99 | theorem baseE_square_ratio (lam amp t r : ℝ) : |
| 100 | baseE lam amp t ^ 2 = baseE lam amp r ^ 2 * Real.exp ((1 + 2 * lam) * (r - t)) := by |
| 101 | simp only [baseE, mul_pow, ← Real.exp_nat_mul] |
| 102 | rw [mul_assoc, ← Real.exp_add] |
| 103 | congr 2 |
| 104 | ring |
| 105 | |
| 106 | theorem window_square_bounds (d : TailData) {t : ℝ} |
| 107 | (ht : t ∈ Icc (d.releaseStart - 4) d.releaseStart) (eta : ℝ) : |
| 108 | releaseSquare d ≤ finalAngular d (t, eta) ^ 2 ∧ |
| 109 | finalAngular d (t, eta) ^ 2 ≤ Real.exp 5 * releaseSquare d := by |
| 110 | have hdt : 0 ≤ d.releaseStart - t := sub_nonneg.mpr ht.2 |
| 111 | have hdt4 : d.releaseStart - t ≤ 4 := by linarith [ht.1] |
| 112 | have h0 : 0 ≤ (1 + 2 * d.core.lam) * (d.releaseStart - t) := |
| 113 | mul_nonneg (by linarith [d.core.lam_pos]) hdt |
| 114 | have h5 : (1 + 2 * d.core.lam) * (d.releaseStart - t) ≤ 5 := by |
| 115 | have hm := mul_le_mul (show 1 + 2 * d.core.lam ≤ (6 / 5 : ℝ) by linarith [d.core.lam_lt]) |
| 116 | hdt4 hdt (by norm_num) |
| 117 | linarith |
| 118 | have htR : d.releaseStart ∈ Icc (d.releaseStart - 4) d.releaseStart := by |
| 119 | constructor <;> linarith |
| 120 | rw [original_matches_reference d eta ht, baseE_square_ratio _ _ t d.releaseStart] |
| 121 | have hR : releaseSquare d = baseE d.core.lam (referenceAmplitude d) d.releaseStart ^ 2 := by |
| 122 | rw [releaseSquare, original_matches_reference d 0 htR] |
| 123 | rw [← hR] |
| 124 | constructor |
| 125 | · exact le_mul_of_one_le_right (releaseSquare_pos d).le (Real.one_le_exp_iff.mpr h0) |
| 126 | · simpa only [mul_comm (Real.exp 5)] using |
| 127 | mul_le_mul_of_nonneg_left (Real.exp_le_exp.mpr h5) (releaseSquare_pos d).le |
| 128 | |
| 129 | theorem editDensity_contDiff {d : TailData} {K : ℝ} (w : ResetWitness d K) : |
| 130 | ContDiff ℝ ∞ (editDensity w) := |
| 131 | ((correctedAngular_contDiff d w.coefficients w.smooth).pow 2).sub |
| 132 | ((finalAngular_contDiff d).pow 2) |
| 133 | |
| 134 | theorem editDensity_eq {d : TailData} {K : ℝ} (w : ResetWitness d K) (t eta : ℝ) : |
| 135 | editDensity w (t, eta) = baseE d.core.lam (referenceAmplitude d) t ^ 2 * |
| 136 | ((1 + relative (w.coefficients eta) (t - correctionCenter d)) ^ 2 - 1) := by |
| 137 | rw [editDensity, corrected_pressure_reference] |
| 138 | unfold modifiedE |
| 139 | ring |
| 140 | |
| 141 | theorem editDensity_zero_outside {d : TailData} {K : ℝ} |
| 142 | (w : ResetWitness d K) (eta : ℝ) {t : ℝ} |
| 143 | (ht : t ∉ Ioo (d.releaseStart - 4) d.releaseStart) : editDensity w (t, eta) = 0 := by |
| 144 | rw [editDensity, correctedAngular_unchanged d w.coefficients eta ht, sub_self] |
| 145 | |
| 146 | noncomputable def editDensityEta {d : TailData} {K : ℝ} |
| 147 | (w : ResetWitness d K) (p : ℝ × ℝ) : ℝ := |
| 148 | 2 * baseE d.core.lam (referenceAmplitude d) p.1 ^ 2 * |
| 149 | (1 + relative (w.coefficients p.2) (p.1 - correctionCenter d)) * |
| 150 | relative (deriv w.coefficients p.2) (p.1 - correctionCenter d) |
| 151 | |
| 152 | theorem editDensity_hasDerivAt_eta {d : TailData} {K : ℝ} |
| 153 | (w : ResetWitness d K) (t eta : ℝ) : |
| 154 | HasDerivAt (fun q => editDensity w (t, q)) (editDensityEta w (t, eta)) eta := by |
| 155 | have heq : (fun q => editDensity w (t, q)) = fun q => |
| 156 | baseE d.core.lam (referenceAmplitude d) t ^ 2 * |
| 157 | ((1 + relative (w.coefficients q) (t - correctionCenter d)) ^ 2 - 1) := |
| 158 | funext (editDensity_eq w t) |
| 159 | rw [heq] |
| 160 | convert! ((((relative_eta_hasDerivAt w eta (t - correctionCenter d)).const_add 1).pow 2).sub_const 1).const_mul |
| 161 | (baseE d.core.lam (referenceAmplitude d) t ^ 2) using 1 |
| 162 | dsimp [editDensityEta] |
| 163 | ring |
| 164 | |
| 165 | theorem editDensityEta_zero_outside {d : TailData} {K : ℝ} |
| 166 | (w : ResetWitness d K) (eta : ℝ) {t : ℝ} |
| 167 | (ht : t ∉ Ioo (d.releaseStart - 4) d.releaseStart) : editDensityEta w (t, eta) = 0 := by |
| 168 | simp only [editDensityEta, relative_zero_outside d _ ht, mul_zero] |
| 169 | |
| 170 | theorem editDensityEta_continuous_t {d : TailData} {K : ℝ} |
| 171 | (w : ResetWitness d K) (eta : ℝ) : Continuous (fun t => editDensityEta w (t, eta)) := by |
| 172 | apply Continuous.mul |
| 173 | · apply Continuous.mul |
| 174 | · exact continuous_const.mul (((baseE_contDiff _ _).continuous).pow 2) |
| 175 | · exact continuous_const.add ((relative_contDiff (w.coefficients eta)).continuous.comp |
| 176 | (continuous_id.sub continuous_const)) |
| 177 | · exact (relative_contDiff (deriv w.coefficients eta)).continuous.comp |
| 178 | (continuous_id.sub continuous_const) |
| 179 | |
| 180 | theorem editDensity_abs_le {d : TailData} {K : ℝ} |
| 181 | (w : ResetWitness d K) (t eta : ℝ) : |
| 182 | |editDensity w (t, eta)| ≤ 5 * editSize d K * Real.exp 5 * releaseSquare d := by |
| 183 | have hR := releaseSquare_pos d |
| 184 | by_cases ht : t ∈ Ioo (d.releaseStart - 4) d.releaseStart |
| 185 | · have hs := (w.small_jets eta (t - correctionCenter d)).1 |
| 186 | have hr := relative_coefficient_bound w eta (t - correctionCenter d) |
| 187 | have hsize := editSize_nonneg w |
| 188 | have hprod : |(1 + relative (w.coefficients eta) (t - correctionCenter d)) ^ 2 - 1| ≤ |
| 189 | 5 * editSize d K := by |
| 190 | rw [show (1 + relative (w.coefficients eta) (t - correctionCenter d)) ^ 2 - 1 = |
| 191 | relative (w.coefficients eta) (t - correctionCenter d) * |
| 192 | (2 + relative (w.coefficients eta) (t - correctionCenter d)) by ring, abs_mul] |
| 193 | have ha : |2 + relative (w.coefficients eta) (t - correctionCenter d)| ≤ 5 / 2 := by |
| 194 | have h := abs_add_le (2 : ℝ) (relative (w.coefficients eta) (t - correctionCenter d)) |
| 195 | norm_num at h |
| 196 | linarith |
| 197 | have hh := mul_le_mul hr ha (abs_nonneg _) (by positivity : 0 ≤ 2 * editSize d K) |
| 198 | nlinarith |
| 199 | rw [editDensity_eq, abs_mul, abs_of_nonneg (sq_nonneg _)] |
| 200 | have hbase : baseE d.core.lam (referenceAmplitude d) t ^ 2 ≤ Real.exp 5 * releaseSquare d := by |
| 201 | rw [← original_matches_reference d eta ⟨ht.1.le, ht.2.le⟩] |
| 202 | exact (window_square_bounds d ⟨ht.1.le, ht.2.le⟩ eta).2 |
| 203 | have hb := mul_le_mul hbase hprod (abs_nonneg _) (by positivity : 0 ≤ Real.exp 5 * releaseSquare d) |
| 204 | nlinarith |
| 205 | · rw [editDensity_zero_outside w eta ht, abs_zero] |
| 206 | exact mul_nonneg (mul_nonneg (mul_nonneg (by norm_num) (editSize_nonneg w)) |
| 207 | (Real.exp_pos _).le) (releaseSquare_pos d).le |
| 208 | |
| 209 | theorem editDensityEta_abs_le {d : TailData} {K : ℝ} |
| 210 | (w : ResetWitness d K) (t eta : ℝ) : |
| 211 | |editDensityEta w (t, eta)| ≤ 6 * editSize d K * Real.exp 5 * releaseSquare d := by |
| 212 | have hR := releaseSquare_pos d |
| 213 | by_cases ht : t ∈ Ioo (d.releaseStart - 4) d.releaseStart |
| 214 | · have hs := (w.small_jets eta (t - correctionCenter d)).1 |
| 215 | have hr := relative_eta_bound w eta (t - correctionCenter d) |
| 216 | have hsize := editSize_nonneg w |
| 217 | have ha : |1 + relative (w.coefficients eta) (t - correctionCenter d)| ≤ 3 / 2 := by |
| 218 | have h := abs_add_le (1 : ℝ) (relative (w.coefficients eta) (t - correctionCenter d)) |
| 219 | norm_num at h |
| 220 | linarith |
| 221 | have hbase : baseE d.core.lam (referenceAmplitude d) t ^ 2 ≤ Real.exp 5 * releaseSquare d := by |
| 222 | rw [← original_matches_reference d eta ⟨ht.1.le, ht.2.le⟩] |
| 223 | exact (window_square_bounds d ⟨ht.1.le, ht.2.le⟩ eta).2 |
| 224 | rw [editDensityEta, abs_mul, abs_mul, abs_mul, |
| 225 | abs_of_nonneg (sq_nonneg (baseE d.core.lam (referenceAmplitude d) t))] |
| 226 | norm_num |
| 227 | have h1 := mul_le_mul_of_nonneg_left hbase (show (0 : ℝ) ≤ 2 by norm_num) |
| 228 | have h2 := mul_le_mul h1 ha (abs_nonneg _) (by positivity : 0 ≤ 2 * (Real.exp 5 * releaseSquare d)) |
| 229 | have h3 := mul_le_mul h2 hr (abs_nonneg _) |
| 230 | (by positivity : 0 ≤ 2 * (Real.exp 5 * releaseSquare d) * (3 / 2)) |
| 231 | nlinarith |
| 232 | · rw [editDensityEta_zero_outside w eta ht, abs_zero] |
| 233 | exact mul_nonneg (mul_nonneg (mul_nonneg (by norm_num) (editSize_nonneg w)) |
| 234 | (Real.exp_pos _).le) (releaseSquare_pos d).le |
| 235 | |
| 236 | theorem integral_Ioi_increment {f : ℝ → ℝ} (hf : Integrable f) (a y : ℝ) : |
| 237 | (∫ t in Ioi y, f t) = (∫ t in Ioi a, f t) - ∫ t in a..y, f t := by |
| 238 | have ha := intervalIntegral.integral_Iic_add_Ioi (b := a) hf.integrableOn hf.integrableOn |
| 239 | have hy := intervalIntegral.integral_Iic_add_Ioi (b := y) hf.integrableOn hf.integrableOn |
| 240 | have hd := intervalIntegral.integral_Iic_sub_Iic (a := a) (b := y) |
| 241 | hf.integrableOn hf.integrableOn |
| 242 | linarith |
| 243 | |
| 244 | theorem correctedPi_increment {d : TailData} {K : ℝ} |
| 245 | (w : ResetWitness d K) (a y eta : ℝ) : |
| 246 | correctedPi w y eta = correctedPi w a eta + |
| 247 | (1 / 2) * ∫ t in a..y, correctedAngular d w.coefficients (t, eta) ^ 2 := by |
| 248 | rw [correctedPi, integral_Ioi_increment (corrected_square_integrable w eta) a y, |
| 249 | correctedPi] |
| 250 | ring |
| 251 | |
| 252 | theorem correctedPi_eq_before {d : TailData} {K : ℝ} |
| 253 | (w : ResetWitness d K) {y : ℝ} (hy : y ≤ d.releaseStart - 4) (eta : ℝ) : |
| 254 | correctedPi w y eta = Pi d y eta := corrected_future_pressure_eq w hy eta |
| 255 | |
| 256 | theorem correctedPi_eq_after {d : TailData} {K : ℝ} |
| 257 | (w : ResetWitness d K) {y : ℝ} (hy : d.releaseStart ≤ y) (eta : ℝ) : |
| 258 | correctedPi w y eta = Pi d y eta := by |
| 259 | unfold correctedPi Pi |
| 260 | congr 1 |
| 261 | apply integral_congr_ae |
| 262 | filter_upwards [ae_restrict_mem measurableSet_Ioi] with t ht |
| 263 | rw [correctedAngular_unchanged d w.coefficients eta] |
| 264 | intro hmem |
| 265 | exact (not_lt_of_ge (hy.trans ht.le)) hmem.2 |
| 266 | |
| 267 | theorem correctedPi_eq_partial {d : TailData} {K : ℝ} |
| 268 | (w : ResetWitness d K) (y eta : ℝ) : |
| 269 | correctedPi w y eta = Pi d y eta + |
| 270 | (1 / 2) * ∫ t in (d.releaseStart - 4)..y, editDensity w (t, eta) := by |
| 271 | have hn : IntervalIntegrable (fun t => correctedAngular d w.coefficients (t, eta) ^ 2) |
| 272 | volume (d.releaseStart - 4) y := |
| 273 | (corrected_square_integrable w eta).intervalIntegrable |
| 274 | have ho : IntervalIntegrable (fun t => finalAngular d (t, eta) ^ 2) |
| 275 | volume (d.releaseStart - 4) y := |
| 276 | (SchedulePressure.angular_square_integrable d eta).intervalIntegrable |
| 277 | rw [correctedPi_increment w (d.releaseStart - 4) y eta, |
| 278 | correctedPi_eq_before w le_rfl eta, Pi_increment d (d.releaseStart - 4) y eta] |
| 279 | simp only [editDensity] |
| 280 | rw [intervalIntegral.integral_sub hn ho] |
| 281 | ring |
| 282 | |
| 283 | noncomputable def pressureChange {d : TailData} {K : ℝ} |
| 284 | (w : ResetWitness d K) (y eta : ℝ) : ℝ := correctedPi w y eta - Pi d y eta |
| 285 | |
| 286 | theorem pressureChange_eq_partial {d : TailData} {K : ℝ} |
| 287 | (w : ResetWitness d K) (y eta : ℝ) : |
| 288 | pressureChange w y eta = (1 / 2) * ∫ t in (d.releaseStart - 4)..y, editDensity w (t, eta) := by |
| 289 | rw [pressureChange, correctedPi_eq_partial] |
| 290 | ring |
| 291 | |
| 292 | theorem pressureChange_zero_before {d : TailData} {K : ℝ} |
| 293 | (w : ResetWitness d K) {y : ℝ} (hy : y ≤ d.releaseStart - 4) (eta : ℝ) : |
| 294 | pressureChange w y eta = 0 := by rw [pressureChange, correctedPi_eq_before w hy, sub_self] |
| 295 | |
| 296 | theorem pressureChange_zero_after {d : TailData} {K : ℝ} |
| 297 | (w : ResetWitness d K) {y : ℝ} (hy : d.releaseStart ≤ y) (eta : ℝ) : |
| 298 | pressureChange w y eta = 0 := by rw [pressureChange, correctedPi_eq_after w hy, sub_self] |
| 299 | |
| 300 | /-- Joint smoothness of a finite integral with a variable upper limit. -/ |
| 301 | theorem intervalPrimitive_contDiff {f : ℝ × ℝ → ℝ} (hf : ContDiff ℝ ∞ f) (a : ℝ) : |
| 302 | ContDiff ℝ ∞ (fun p : ℝ × ℝ => ∫ t in a..p.1, f (t, p.2)) := by |
| 303 | let g : (ℝ × ℝ) × ℝ → ℝ := fun z => f (a + (z.1.1 - a) * z.2, z.1.2) |
| 304 | have hg : ContDiff ℝ ∞ g := hf.comp |
| 305 | ((contDiff_const.add ((contDiff_fst.fst.sub contDiff_const).mul contDiff_snd)).prodMk |
| 306 | contDiff_fst.snd) |
| 307 | have heq : (fun p : ℝ × ℝ => ∫ t in a..p.1, f (t, p.2)) = |
| 308 | fun p : ℝ × ℝ => (p.1 - a) * ∫ u in (0 : ℝ)..1, g (p, u) := by |
| 309 | funext p |
| 310 | have h := intervalIntegral.smul_integral_comp_mul_add |
| 311 | (f := fun t => f (t, p.2)) (a := (0 : ℝ)) (b := 1) (p.1 - a) a |
| 312 | simpa [g, smul_eq_mul, add_comm] using h.symm |
| 313 | rw [heq] |
| 314 | exact (contDiff_fst.sub contDiff_const).mul |
| 315 | (TransportPrimitive.parameterIntegral_contDiff hg 0 1) |
| 316 | |
| 317 | theorem cleanPi_joint_contDiff (d : TailData) : |
| 318 | ContDiff ℝ ∞ (fun p : ℝ × ℝ => Pi d p.1 p.2) := by |
| 319 | have heq : (fun p : ℝ × ℝ => Pi d p.1 p.2) = fun p : ℝ × ℝ => |
| 320 | Pi d 0 p.2 + (1 / 2) * ∫ t in (0 : ℝ)..p.1, finalAngular d (t, p.2) ^ 2 := by |
| 321 | funext p |
| 322 | exact Pi_increment d 0 p.1 p.2 |
| 323 | rw [heq] |
| 324 | exact ((Pi_contDiff_eta d 0).comp contDiff_snd).add |
| 325 | (contDiff_const.mul (intervalPrimitive_contDiff ((finalAngular_contDiff d).pow 2) 0)) |
| 326 | |
| 327 | theorem pressureChange_joint_contDiff {d : TailData} {K : ℝ} (w : ResetWitness d K) : |
| 328 | ContDiff ℝ ∞ (fun p : ℝ × ℝ => pressureChange w p.1 p.2) := by |
| 329 | have heq : (fun p : ℝ × ℝ => pressureChange w p.1 p.2) = fun p : ℝ × ℝ => |
| 330 | (1 / 2) * ∫ t in (d.releaseStart - 4)..p.1, editDensity w (t, p.2) := by |
| 331 | funext p |
| 332 | exact pressureChange_eq_partial w p.1 p.2 |
| 333 | rw [heq] |
| 334 | exact contDiff_const.mul (intervalPrimitive_contDiff (editDensity_contDiff w) _) |
| 335 | |
| 336 | theorem correctedPi_joint_contDiff {d : TailData} {K : ℝ} (w : ResetWitness d K) : |
| 337 | ContDiff ℝ ∞ (fun p : ℝ × ℝ => correctedPi w p.1 p.2) := by |
| 338 | convert! (cleanPi_joint_contDiff d).add (pressureChange_joint_contDiff w) using 1 |
| 339 | funext p |
| 340 | simp [pressureChange] |
| 341 | |
| 342 | theorem correctedPi_hasDerivAt_y {d : TailData} {K : ℝ} |
| 343 | (w : ResetWitness d K) (y eta : ℝ) : |
| 344 | HasDerivAt (fun t => correctedPi w t eta) |
| 345 | ((1 / 2) * correctedAngular d w.coefficients (y, eta) ^ 2) y := by |
| 346 | have hc : Continuous (fun t => correctedAngular d w.coefficients (t, eta) ^ 2) := |
| 347 | (((correctedAngular_contDiff d w.coefficients w.smooth).continuous.comp |
| 348 | (continuous_id.prodMk continuous_const)).pow 2) |
| 349 | have heq : (fun t => correctedPi w t eta) = fun t => correctedPi w 0 eta + |
| 350 | (1 / 2) * primitive (fun v => correctedAngular d w.coefficients (v, eta) ^ 2) t := by |
| 351 | funext t |
| 352 | exact correctedPi_increment w 0 t eta |
| 353 | rw [heq] |
| 354 | exact ((primitive_hasDerivAt hc y).const_mul (1 / 2)).const_add _ |
| 355 | |
| 356 | theorem pressureChange_hasDerivAt_eta {d : TailData} {K : ℝ} |
| 357 | (w : ResetWitness d K) (y eta : ℝ) : |
| 358 | HasDerivAt (pressureChange w y) |
| 359 | ((1 / 2) * ∫ t in (d.releaseStart - 4)..y, editDensityEta w (t, eta)) eta := by |
| 360 | have hc (q : ℝ) : Continuous (fun t => editDensity w (t, q)) := |
| 361 | (editDensity_contDiff w).continuous.comp (continuous_id.prodMk continuous_const) |
| 362 | have h := intervalIntegral.hasDerivAt_integral_of_dominated_loc_of_deriv_le |
| 363 | (F := fun q t => editDensity w (t, q)) (F' := fun q t => editDensityEta w (t, q)) |
| 364 | (x₀ := eta) (μ := volume) (a := d.releaseStart - 4) (b := y) |
| 365 | (bound := fun _ => 6 * editSize d K * Real.exp 5 * releaseSquare d) |
| 366 | (Metric.ball_mem_nhds eta (show (0 : ℝ) < 1 by norm_num)) |
| 367 | (Eventually.of_forall fun q => (hc q).aestronglyMeasurable) |
| 368 | ((hc eta).intervalIntegrable _ _) |
| 369 | ((editDensityEta_continuous_t w eta).aestronglyMeasurable) |
| 370 | (Eventually.of_forall fun t _ q _ => by |
| 371 | simpa only [Real.norm_eq_abs] using editDensityEta_abs_le w t q) |
| 372 | intervalIntegrable_const |
| 373 | (Eventually.of_forall fun t _ q _ => editDensity_hasDerivAt_eta w t q) |
| 374 | have heq : pressureChange w y = fun q => |
| 375 | (1 / 2) * ∫ t in (d.releaseStart - 4)..y, editDensity w (t, q) := |
| 376 | funext (pressureChange_eq_partial w y) |
| 377 | rw [heq] |
| 378 | exact h.2.const_mul (1 / 2) |
| 379 | |
| 380 | theorem correctedPi_hasDerivAt_eta {d : TailData} {K : ℝ} |
| 381 | (w : ResetWitness d K) (y eta : ℝ) : |
| 382 | HasDerivAt (correctedPi w y) |
| 383 | (deriv (Pi d y) eta + (1 / 2) * |
| 384 | ∫ t in (d.releaseStart - 4)..y, editDensityEta w (t, eta)) eta := by |
| 385 | have heq : correctedPi w y = fun q => Pi d y q + pressureChange w y q := by |
| 386 | funext q |
| 387 | simp [pressureChange] |
| 388 | rw [heq] |
| 389 | exact ((Pi_contDiff_eta d y).differentiable (by simp) eta).hasDerivAt.add |
| 390 | (pressureChange_hasDerivAt_eta w y eta) |
| 391 | |
| 392 | theorem correctedPi_deriv_eta {d : TailData} {K : ℝ} |
| 393 | (w : ResetWitness d K) (y eta : ℝ) : |
| 394 | deriv (correctedPi w y) eta = deriv (Pi d y) eta + deriv (pressureChange w y) eta := by |
| 395 | rw [(correctedPi_hasDerivAt_eta w y eta).deriv, |
| 396 | (pressureChange_hasDerivAt_eta w y eta).deriv] |
| 397 | |
| 398 | theorem pressureChange_deriv_zero_before {d : TailData} {K : ℝ} |
| 399 | (w : ResetWitness d K) {y : ℝ} (hy : y ≤ d.releaseStart - 4) (eta : ℝ) : |
| 400 | deriv (pressureChange w y) eta = 0 := by |
| 401 | have heq : pressureChange w y = fun _ => 0 := funext (pressureChange_zero_before w hy) |
| 402 | rw [heq] |
| 403 | simp |
| 404 | |
| 405 | theorem pressureChange_deriv_zero_after {d : TailData} {K : ℝ} |
| 406 | (w : ResetWitness d K) {y : ℝ} (hy : d.releaseStart ≤ y) (eta : ℝ) : |
| 407 | deriv (pressureChange w y) eta = 0 := by |
| 408 | have heq : pressureChange w y = fun _ => 0 := funext (pressureChange_zero_after w hy) |
| 409 | rw [heq] |
| 410 | simp |
| 411 | |
| 412 | theorem cleanPi_eta_independent_after_flatten (d : TailData) {y : ℝ} |
| 413 | (hy : d.flattenEnd ≤ y) (eta eta' : ℝ) : Pi d y eta = Pi d y eta' := by |
| 414 | unfold Pi |
| 415 | congr 1 |
| 416 | apply integral_congr_ae |
| 417 | filter_upwards [ae_restrict_mem measurableSet_Ioi] with t ht |
| 418 | rw [finalAngular_eta_independent d eta eta' (hy.trans ht.le)] |
| 419 | |
| 420 | theorem correctedPi_eta_independent_after {d : TailData} {K : ℝ} |
| 421 | (w : ResetWitness d K) {y : ℝ} (hy : d.releaseStart ≤ y) (eta eta' : ℝ) : |
| 422 | correctedPi w y eta = correctedPi w y eta' := by |
| 423 | rw [correctedPi_eq_after w hy, correctedPi_eq_after w hy] |
| 424 | exact cleanPi_eta_independent_after_flatten d ((releaseStart_gt_flattenEnd d).le.trans hy) _ _ |
| 425 | |
| 426 | theorem correctedPi_deriv_eta_zero_after {d : TailData} {K : ℝ} |
| 427 | (w : ResetWitness d K) {y : ℝ} (hy : d.releaseStart ≤ y) (eta : ℝ) : |
| 428 | deriv (correctedPi w y) eta = 0 := by |
| 429 | have heq : correctedPi w y = fun _ => correctedPi w y 0 := |
| 430 | funext (fun q => correctedPi_eta_independent_after w hy q 0) |
| 431 | rw [heq] |
| 432 | simp |
| 433 | |
| 434 | theorem half_partial_integral_abs_le {f : ℝ → ℝ} {B r y : ℝ} |
| 435 | (hB : 0 ≤ B) (hy : y ∈ Icc (r - 4) r) (hbound : ∀ t, |f t| ≤ B) : |
| 436 | |(1 / 2 : ℝ) * ∫ t in (r - 4)..y, f t| ≤ 2 * B := by |
| 437 | have hi := intervalIntegral.norm_integral_le_of_norm_le_const |
| 438 | (a := r - 4) (b := y) (f := f) |
| 439 | (fun t _ => by simpa only [Real.norm_eq_abs] using hbound t) |
| 440 | have hlen : |y - (r - 4)| ≤ 4 := by |
| 441 | rw [abs_of_nonneg (by linarith [hy.1])] |
| 442 | linarith [hy.2] |
| 443 | rw [Real.norm_eq_abs] at hi |
| 444 | rw [abs_mul] |
| 445 | rw [abs_of_nonneg (by norm_num : (0 : ℝ) ≤ 1 / 2)] |
| 446 | nlinarith [mul_le_mul_of_nonneg_left hlen hB] |
| 447 | |
| 448 | theorem pressureChange_abs_le {d : TailData} {K : ℝ} |
| 449 | (w : ResetWitness d K) (y eta : ℝ) : |
| 450 | |pressureChange w y eta| ≤ 10 * editSize d K * Real.exp 5 * releaseSquare d := by |
| 451 | have hsize := editSize_nonneg w |
| 452 | have hR := releaseSquare_pos d |
| 453 | by_cases hl : y ≤ d.releaseStart - 4 |
| 454 | · rw [pressureChange_zero_before w hl, abs_zero] |
| 455 | positivity |
| 456 | by_cases hr : d.releaseStart ≤ y |
| 457 | · rw [pressureChange_zero_after w hr, abs_zero] |
| 458 | positivity |
| 459 | rw [pressureChange_eq_partial] |
| 460 | have h := half_partial_integral_abs_le |
| 461 | (B := 5 * editSize d K * Real.exp 5 * releaseSquare d) |
| 462 | (by positivity) ⟨(le_of_not_ge hl), (le_of_not_ge hr)⟩ |
| 463 | (fun t => editDensity_abs_le w t eta) |
| 464 | convert! h using 1 |
| 465 | ring |
| 466 | |
| 467 | theorem pressureChange_deriv_abs_le {d : TailData} {K : ℝ} |
| 468 | (w : ResetWitness d K) (y eta : ℝ) : |
| 469 | |deriv (pressureChange w y) eta| ≤ |
| 470 | 12 * editSize d K * Real.exp 5 * releaseSquare d := by |
| 471 | have hsize := editSize_nonneg w |
| 472 | have hR := releaseSquare_pos d |
| 473 | by_cases hl : y ≤ d.releaseStart - 4 |
| 474 | · rw [pressureChange_deriv_zero_before w hl, abs_zero] |
| 475 | positivity |
| 476 | by_cases hr : d.releaseStart ≤ y |
| 477 | · rw [pressureChange_deriv_zero_after w hr, abs_zero] |
| 478 | positivity |
| 479 | rw [(pressureChange_hasDerivAt_eta w y eta).deriv] |
| 480 | have h := half_partial_integral_abs_le |
| 481 | (B := 6 * editSize d K * Real.exp 5 * releaseSquare d) |
| 482 | (by positivity) ⟨(le_of_not_ge hl), (le_of_not_ge hr)⟩ |
| 483 | (fun t => editDensityEta_abs_le w t eta) |
| 484 | convert! h using 1 |
| 485 | ring |
| 486 | |
| 487 | theorem clean_square_le_corrected {d : TailData} {K : ℝ} |
| 488 | (w : ResetWitness d K) (p : ℝ × ℝ) : |
| 489 | finalAngular d p ^ 2 ≤ 4 * correctedAngular d w.coefficients p ^ 2 := by |
| 490 | linarith [(corrected_square_comparison w p).1] |
| 491 | |
| 492 | /-- The edit derivative is controlled by the actual local corrected field. -/ |
| 493 | theorem pressureChange_deriv_abs_le_corrected {d : TailData} {K : ℝ} |
| 494 | (w : ResetWitness d K) (y eta : ℝ) : |
| 495 | |deriv (pressureChange w y) eta| ≤ |
| 496 | (48 * Real.exp 5 * editSize d K) * correctedAngular d w.coefficients (y, eta) ^ 2 := by |
| 497 | have hsize := editSize_nonneg w |
| 498 | by_cases hl : y ≤ d.releaseStart - 4 |
| 499 | · rw [pressureChange_deriv_zero_before w hl, abs_zero] |
| 500 | positivity |
| 501 | by_cases hr : d.releaseStart ≤ y |
| 502 | · rw [pressureChange_deriv_zero_after w hr, abs_zero] |
| 503 | positivity |
| 504 | have hR : releaseSquare d ≤ 4 * correctedAngular d w.coefficients (y, eta) ^ 2 := |
| 505 | ((window_square_bounds d ⟨le_of_not_ge hl, le_of_not_ge hr⟩ eta).1).trans |
| 506 | (clean_square_le_corrected w _) |
| 507 | apply (pressureChange_deriv_abs_le w y eta).trans |
| 508 | have h := mul_le_mul_of_nonneg_left hR |
| 509 | (show 0 ≤ 12 * editSize d K * Real.exp 5 by positivity) |
| 510 | convert! h using 1 |
| 511 | ring |
| 512 | |
| 513 | theorem correctedPi_nonpos {d : TailData} {K : ℝ} |
| 514 | (w : ResetWitness d K) (y eta : ℝ) : correctedPi w y eta ≤ 0 := by |
| 515 | unfold correctedPi |
| 516 | exact mul_nonpos_of_nonpos_of_nonneg (by norm_num) (integral_nonneg fun _ => sq_nonneg _) |
| 517 | |
| 518 | theorem correctedPi_abs_eq {d : TailData} {K : ℝ} |
| 519 | (w : ResetWitness d K) (y eta : ℝ) : |
| 520 | |correctedPi w y eta| = (1 / 2) * |
| 521 | ∫ t in Ioi y, correctedAngular d w.coefficients (t, eta) ^ 2 := by |
| 522 | rw [abs_of_nonpos (correctedPi_nonpos w y eta)] |
| 523 | unfold correctedPi |
| 524 | ring |
| 525 | |
| 526 | theorem correctedPi_abs_le {d : TailData} {K : ℝ} |
| 527 | (w : ResetWitness d K) {y eta : ℝ} (hy : 0 ≤ y) (heta : |eta| ≤ 1) : |
| 528 | |correctedPi w y eta| ≤ ((9 / 2) * envelopeConstant) * |
| 529 | correctedAngular d w.coefficients (y, eta) ^ 2 := by |
| 530 | have hi : (∫ t in Ioi y, correctedAngular d w.coefficients (t, eta) ^ 2) ≤ |
| 531 | (9 / 4) * ∫ t in Ioi y, finalAngular d (t, eta) ^ 2 := by |
| 532 | rw [← integral_const_mul] |
| 533 | exact setIntegral_mono_on (corrected_square_integrable w eta).integrableOn |
| 534 | ((SchedulePressure.angular_square_integrable d eta).const_mul (9 / 4)).integrableOn |
| 535 | measurableSet_Ioi (fun t _ => (corrected_square_comparison w (t, eta)).2) |
| 536 | have hI := hi.trans (mul_le_mul_of_nonneg_left (future_square_integral_le d hy heta) |
| 537 | (show (0 : ℝ) ≤ 9 / 4 by norm_num)) |
| 538 | have he := mul_le_mul_of_nonneg_left (clean_square_le_corrected w (y, eta)) |
| 539 | envelopeConstant_pos.le |
| 540 | have hI' := hI.trans (mul_le_mul_of_nonneg_left he (show (0 : ℝ) ≤ 9 / 4 by norm_num)) |
| 541 | rw [correctedPi_abs_eq] |
| 542 | have h := mul_le_mul_of_nonneg_left hI' (show (0 : ℝ) ≤ 1 / 2 by norm_num) |
| 543 | convert! h using 1 |
| 544 | ring |
| 545 | |
| 546 | theorem correctedPi_deriv_abs_le {d : TailData} {K : ℝ} |
| 547 | (w : ResetWitness d K) {y eta : ℝ} (hy : 0 ≤ y) (heta : |eta| ≤ 1) : |
| 548 | |deriv (correctedPi w y) eta| ≤ |
| 549 | (8 * envelopeConstant * |eta| + 48 * Real.exp 5 * editSize d K) * |
| 550 | correctedAngular d w.coefficients (y, eta) ^ 2 := by |
| 551 | have hc : |deriv (Pi d y) eta| ≤ (8 * envelopeConstant * |eta|) * |
| 552 | correctedAngular d w.coefficients (y, eta) ^ 2 := by |
| 553 | apply (Pi_deriv_abs_le d hy heta).trans |
| 554 | have h := mul_le_mul_of_nonneg_left (clean_square_le_corrected w (y, eta)) |
| 555 | (show 0 ≤ (2 * envelopeConstant) * |eta| by |
| 556 | exact mul_nonneg (mul_nonneg (by norm_num) envelopeConstant_pos.le) (abs_nonneg eta)) |
| 557 | convert! h using 1 |
| 558 | ring |
| 559 | rw [correctedPi_deriv_eta] |
| 560 | apply (abs_add_le _ _).trans |
| 561 | calc |
| 562 | _ ≤ (8 * envelopeConstant * |eta|) * correctedAngular d w.coefficients (y, eta) ^ 2 + |
| 563 | (48 * Real.exp 5 * editSize d K) * correctedAngular d w.coefficients (y, eta) ^ 2 := |
| 564 | add_le_add hc (pressureChange_deriv_abs_le_corrected w y eta) |
| 565 | _ = _ := by ring |
| 566 | |
| 567 | noncomputable def correctedConstant : ℝ := 13 * envelopeConstant + 48 * Real.exp 5 |
| 568 | |
| 569 | theorem correctedConstant_pos : 0 < correctedConstant := by |
| 570 | have h := envelopeConstant_pos |
| 571 | unfold correctedConstant |
| 572 | positivity |
| 573 | |
| 574 | theorem corrected_bounds {d : TailData} {K : ℝ} |
| 575 | (w : ResetWitness d K) {y eta : ℝ} (hy : 0 ≤ y) (heta : |eta| ≤ 1) : |
| 576 | |correctedPi w y eta| ≤ correctedConstant * (1 + editSize d K) * |
| 577 | correctedAngular d w.coefficients (y, eta) ^ 2 ∧ |
| 578 | |deriv (correctedPi w y) eta| ≤ correctedConstant * (1 + editSize d K) * |
| 579 | correctedAngular d w.coefficients (y, eta) ^ 2 := by |
| 580 | have hsize := editSize_nonneg w |
| 581 | have hM := envelopeConstant_pos |
| 582 | have he := Real.exp_pos (5 : ℝ) |
| 583 | have hfirst : (9 / 2 : ℝ) * envelopeConstant ≤ correctedConstant * (1 + editSize d K) := by |
| 584 | unfold correctedConstant |
| 585 | nlinarith [mul_nonneg hM.le hsize, mul_nonneg he.le hsize] |
| 586 | have hderiv : 8 * envelopeConstant * |eta| + 48 * Real.exp 5 * editSize d K ≤ |
| 587 | correctedConstant * (1 + editSize d K) := by |
| 588 | have hη := mul_le_mul_of_nonneg_left heta (show 0 ≤ 8 * envelopeConstant by positivity) |
| 589 | unfold correctedConstant |
| 590 | nlinarith [mul_nonneg hM.le hsize] |
| 591 | exact ⟨(correctedPi_abs_le w hy heta).trans |
| 592 | (mul_le_mul_of_nonneg_right hfirst (sq_nonneg _)), |
| 593 | (correctedPi_deriv_abs_le w hy heta).trans |
| 594 | (mul_le_mul_of_nonneg_right hderiv (sq_nonneg _))⟩ |
| 595 | |
| 596 | theorem corrected_bounds_of_small {d : TailData} {K : ℝ} |
| 597 | (w : ResetWitness d K) (hsmall : editSize d K ≤ 1) {y eta : ℝ} |
| 598 | (hy : 0 ≤ y) (heta : |eta| ≤ 1) : |
| 599 | |correctedPi w y eta| ≤ correctedConstant * correctedAngular d w.coefficients (y, eta) ^ 2 ∧ |
| 600 | |deriv (correctedPi w y) eta| ≤ correctedConstant * correctedAngular d w.coefficients (y, eta) ^ 2 := by |
| 601 | have hM := envelopeConstant_pos |
| 602 | have he := Real.exp_pos (5 : ℝ) |
| 603 | have hfirst : (9 / 2 : ℝ) * envelopeConstant ≤ correctedConstant := by |
| 604 | unfold correctedConstant |
| 605 | nlinarith |
| 606 | have hderiv : 8 * envelopeConstant * |eta| + 48 * Real.exp 5 * editSize d K ≤ |
| 607 | correctedConstant := by |
| 608 | have hη := mul_le_mul_of_nonneg_left heta (show 0 ≤ 8 * envelopeConstant by positivity) |
| 609 | have hs := mul_le_mul_of_nonneg_left hsmall (show 0 ≤ 48 * Real.exp 5 by positivity) |
| 610 | unfold correctedConstant |
| 611 | nlinarith |
| 612 | exact ⟨(correctedPi_abs_le w hy heta).trans |
| 613 | (mul_le_mul_of_nonneg_right hfirst (sq_nonneg _)), |
| 614 | (correctedPi_deriv_abs_le w hy heta).trans |
| 615 | (mul_le_mul_of_nonneg_right hderiv (sq_nonneg _))⟩ |
| 616 | |
| 617 | /-- The smallness condition follows from an explicit threshold depending only on K. -/ |
| 618 | theorem exists_editSize_small_threshold (K : ℝ) (hK : 0 ≤ K) : |
| 619 | ∃ lam0 : ℝ, 0 < lam0 ∧ ∀ d : TailData, d.core.lam < lam0 → editSize d K ≤ 1 := by |
| 620 | refine ⟨1 / (K + 1), by positivity, ?_⟩ |
| 621 | intro d hd |
| 622 | have hLamOne : d.core.lam ≤ 1 := by linarith [d.core.lam_lt] |
| 623 | have hp : d.core.lam ^ 28 ≤ d.core.lam := by |
| 624 | rw [show (28 : ℕ) = 27 + 1 by rfl, pow_succ] |
| 625 | simpa only [one_mul] using mul_le_mul_of_nonneg_right |
| 626 | (pow_le_one₀ (n := 27) d.core.lam_pos.le hLamOne) d.core.lam_pos.le |
| 627 | have hprod : d.core.lam * (K + 1) ≤ 1 := |
| 628 | (le_div_iff₀ (by positivity : 0 < K + 1)).mp hd.le |
| 629 | have h := mul_le_mul_of_nonneg_left hp hK |
| 630 | unfold editSize |
| 631 | nlinarith [d.core.lam_pos] |
| 632 | |
| 633 | theorem releaseSquare_le_core_endpoint (d : TailData) {eta : ℝ} (heta : |eta| ≤ 1) : |
| 634 | releaseSquare d ≤ (4 * Real.exp (6 / 5)) * finalAngular d (d.core.endpoint, eta) ^ 2 := by |
| 635 | have hER : d.core.endpoint ≤ d.releaseStart := |
| 636 | ((flattenEnd_gt_core d).trans (releaseStart_gt_flattenEnd d)).le |
| 637 | have hclock := clock_future_bound d (SchedulePressure.endpoint_pos d).le hER |
| 638 | have hexp : Real.exp (-(4 / 5) * (d.releaseStart - d.core.endpoint)) ≤ 1 := by |
| 639 | apply Real.exp_le_one_iff.mpr |
| 640 | exact mul_nonpos_of_nonpos_of_nonneg (by norm_num) (sub_nonneg.mpr hER) |
| 641 | change SchedulePressure.clockWeight d d.releaseStart ≤ _ |
| 642 | calc |
| 643 | _ ≤ SchedulePressure.clockWeight d d.core.endpoint * Real.exp (6 / 5) := |
| 644 | hclock.trans (mul_le_of_le_one_right |
| 645 | (mul_nonneg (SchedulePressure.clockWeight_pos d _).le (Real.exp_pos _).le) hexp) |
| 646 | _ ≤ (4 * finalAngular d (d.core.endpoint, eta) ^ 2) * Real.exp (6 / 5) := |
| 647 | mul_le_mul_of_nonneg_right (clock_le_four_angular_square d _ heta) (Real.exp_pos _).le |
| 648 | _ = _ := by ring |
| 649 | |
| 650 | theorem pressureChange_core_endpoint_bounds {d : TailData} {K : ℝ} |
| 651 | (w : ResetWitness d K) (y : ℝ) {eta : ℝ} (heta : |eta| ≤ 1) : |
| 652 | |pressureChange w y eta| ≤ |
| 653 | (40 * Real.exp 5 * Real.exp (6 / 5) * editSize d K) * |
| 654 | finalAngular d (d.core.endpoint, eta) ^ 2 ∧ |
| 655 | |deriv (pressureChange w y) eta| ≤ |
| 656 | (48 * Real.exp 5 * Real.exp (6 / 5) * editSize d K) * |
| 657 | finalAngular d (d.core.endpoint, eta) ^ 2 := by |
| 658 | have hsize := editSize_nonneg w |
| 659 | constructor |
| 660 | · apply (pressureChange_abs_le w y eta).trans |
| 661 | have h := mul_le_mul_of_nonneg_left (releaseSquare_le_core_endpoint d heta) |
| 662 | (show 0 ≤ 10 * editSize d K * Real.exp 5 by positivity) |
| 663 | convert! h using 1 |
| 664 | ring |
| 665 | · apply (pressureChange_deriv_abs_le w y eta).trans |
| 666 | have h := mul_le_mul_of_nonneg_left (releaseSquare_le_core_endpoint d heta) |
| 667 | (show 0 ≤ 12 * editSize d K * Real.exp 5 by positivity) |
| 668 | convert! h using 1 |
| 669 | ring |
| 670 | |
| 671 | /-- Canonical forward pressure with the unchanged whole-axis pressure datum. -/ |
| 672 | theorem correctedPi_eq_axisPressure_add {d : TailData} {K : ℝ} |
| 673 | (w : ResetWitness d K) (y eta : ℝ) : |
| 674 | correctedPi w y eta = SchedulePressure.axisPressure d eta + (1 / 2) * |
| 675 | ∫ t in Iic y, correctedAngular d w.coefficients (t, eta) ^ 2 := by |
| 676 | have hi := corrected_square_integrable w eta |
| 677 | have hz := w.pressure_neutral eta |
| 678 | rw [integral_sub hi (SchedulePressure.angular_square_integrable d eta)] at hz |
| 679 | have hsum := intervalIntegral.integral_Iic_add_Ioi (b := y) hi.integrableOn hi.integrableOn |
| 680 | unfold correctedPi SchedulePressure.axisPressure |
| 681 | linarith |
| 682 | |
| 683 | theorem pressureChange_hasDerivAt_y {d : TailData} {K : ℝ} |
| 684 | (w : ResetWitness d K) (y eta : ℝ) : |
| 685 | HasDerivAt (fun t => pressureChange w t eta) ((1 / 2) * editDensity w (y, eta)) y := by |
| 686 | convert! (correctedPi_hasDerivAt_y w y eta).sub (Pi_hasDerivAt_y d y eta) using 1 |
| 687 | dsimp [editDensity] |
| 688 | ring |
| 689 | |
| 690 | end NavierStokes.CorrectedPressureBounds |