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.ReleaseMoments |
| 2 | import NavierStokes.CorrectedPulseAmplitude |
| 3 | import NavierStokes.FuturePressureBounds |
| 4 | import NavierStokes.UniformCone |
| 5 | import NavierStokes.CoordinateAlgebra |
| 6 | import NavierStokes.OutgoingHistories |
| 7 | import NavierStokes.CorrectedPressureBounds |
| 8 | import NavierStokes.PulseCone |
| 9 | |
| 10 | /-! |
| 11 | # The actual outgoing tail and its cone estimates |
| 12 | |
| 13 | The controller below is identified with an actual corrected angular history |
| 14 | by `ReleaseMoments`. Bounds never assume an amplitude small relative to `h`: |
| 15 | the prescribed long release plateau supplies that suppression. |
| 16 | -/ |
| 17 | |
| 18 | noncomputable section |
| 19 | |
| 20 | open Set Filter Function MeasureTheory |
| 21 | open scoped Topology ContDiff |
| 22 | open NavierStokes.OutgoingSchedule NavierStokes.OutgoingTail |
| 23 | open NavierStokes.AngularMomentReset NavierStokes.UniformAngularReset |
| 24 | open NavierStokes.TailEnergyBounds |
| 25 | |
| 26 | namespace NavierStokes.TailCone |
| 27 | |
| 28 | theorem initialLag_ge_half_lambda (d : TailData) : d.core.lam / 2 ≤ initialLag d := by |
| 29 | have hd : 0 < 1 - d.core.lam := by linarith [d.core.lam_lt] |
| 30 | apply (le_div_iff₀ hd).mpr |
| 31 | linarith [d.h_small, sq_nonneg d.core.lam] |
| 32 | |
| 33 | theorem release_rate_integral_bound_all (d : TailData) {t : ℝ} |
| 34 | (_ht : 0 ≤ t) (ht' : t ≤ d.rampEnd) : primitive (releaseRate d) t ≤ 2 := by |
| 35 | have hc := (releaseRate_contDiff d).continuous |
| 36 | have hadd := intervalIntegral.integral_add_adjacent_intervals (μ := volume) |
| 37 | (hc.intervalIntegrable 0 t) (hc.intervalIntegrable t d.rampEnd) |
| 38 | have hn : 0 ≤ ∫ s in t..d.rampEnd, releaseRate d s := |
| 39 | intervalIntegral.integral_nonneg ht' (fun s _ => (release_rate_bounds d s).1) |
| 40 | have hb := release_rate_integral_bound d |
| 41 | unfold primitive at hb ⊢ |
| 42 | linarith |
| 43 | |
| 44 | theorem releaseLag_lower_all (d : TailData) {t : ℝ} |
| 45 | (ht : 0 ≤ t) (ht' : t ≤ d.rampEnd) : |
| 46 | Real.exp (-2) * (d.core.lam / 2) ≤ releaseLag d t := by |
| 47 | have hsource : 0 ≤ primitive |
| 48 | (fun s => Real.exp (primitive (releaseRate d) s) * releaseSource d s) t := |
| 49 | intervalIntegral.integral_nonneg ht |
| 50 | (fun s _ => mul_nonneg (Real.exp_pos _).le (release_source_nonneg d s)) |
| 51 | have he : Real.exp (-2) ≤ Real.exp (-primitive (releaseRate d) t) := |
| 52 | Real.exp_le_exp.mpr (by linarith [release_rate_integral_bound_all d ht ht']) |
| 53 | have hq := initialLag_ge_half_lambda d |
| 54 | have hq0 : 0 ≤ initialLag d := d.h_pos.le.trans (initialLag_gt_h d).le |
| 55 | unfold releaseLag linearLag |
| 56 | have h1 := mul_le_mul_of_nonneg_right he hq0 |
| 57 | have h2 := mul_le_mul_of_nonneg_left hq (Real.exp_pos (-2)).le |
| 58 | linarith [mul_nonneg (Real.exp_pos (-primitive (releaseRate d) t)).le hsource] |
| 59 | |
| 60 | theorem tailDebt_ge_coefficient (d : TailData) : tailCoefficient * d.h ≤ tailDebt d := by |
| 61 | have hd : 0 < 1 - d.rho := by linarith [d.rho_lt_half] |
| 62 | have h : d.rho ≤ d.rho / (1 - d.rho) := by |
| 63 | apply (le_div_iff₀ hd).mpr |
| 64 | linarith [sq_nonneg d.rho] |
| 65 | exact h.trans (tailDebt_bounds d).1 |
| 66 | |
| 67 | theorem holdLag_lower (d : TailData) {t : ℝ} (ht : t ≤ decayHold d) : |
| 68 | tailCoefficient * d.h ≤ holdLag d t := by |
| 69 | have hq : 0 ≤ releaseLag d d.rampEnd := |
| 70 | (tailDebt_pos d).le.trans (releaseLag_gt_tailDebt d).le |
| 71 | have he : Real.exp (-(1 - d.h) * decayHold d) ≤ Real.exp (-(1 - d.h) * t) := |
| 72 | Real.exp_le_exp.mpr (by nlinarith [d.one_sub_h_pos]) |
| 73 | have h := mul_le_mul_of_nonneg_left he hq |
| 74 | rw [decayHold_hits_target] at h |
| 75 | exact (tailDebt_ge_coefficient d).trans h |
| 76 | |
| 77 | theorem tailLag_first_half (d : TailData) {t : ℝ} (ht : 0 ≤ t) (ht' : t ≤ 1 / 2) : |
| 78 | tailLag d t = tailDebt d * Real.exp (-(1 - d.h) * t) := by |
| 79 | have hi : primitive (weightedTailDerivative d) t = 0 := by |
| 80 | unfold primitive |
| 81 | calc |
| 82 | _ = ∫ _s in (0 : ℝ)..t, (0 : ℝ) := by |
| 83 | apply intervalIntegral.integral_congr |
| 84 | intro s hs |
| 85 | have hs' := uIcc_of_le ht ▸ hs |
| 86 | have harg : (s - 1) / 2 < 0 := by linarith [hs'.2] |
| 87 | simp [weightedTailDerivative, tailShapeDeriv, sigma_derivative_zero_left harg] |
| 88 | _ = 0 := by simp |
| 89 | unfold tailLag tailNumerator |
| 90 | rw [hi, sub_zero, tailShape_early d (show t ≤ 1 by linarith)] |
| 91 | unfold tailDebt primitive weightedTailDerivative |
| 92 | ring |
| 93 | |
| 94 | theorem tailLag_first_half_lower (d : TailData) {t : ℝ} (ht : 0 ≤ t) (ht' : t ≤ 1 / 2) : |
| 95 | Real.exp (-1) * tailCoefficient * d.h ≤ tailLag d t := by |
| 96 | rw [tailLag_first_half d ht ht'] |
| 97 | have he : Real.exp (-1) ≤ Real.exp (-(1 - d.h) * t) := |
| 98 | Real.exp_le_exp.mpr (by nlinarith [d.h_pos]) |
| 99 | have h := mul_le_mul (tailDebt_ge_coefficient d) he (Real.exp_pos (-1)).le (tailDebt_pos d).le |
| 100 | linarith |
| 101 | |
| 102 | noncomputable def releaseLowerConstant : ℝ := min (Real.exp (-2)) (Real.exp (-1) * tailCoefficient) |
| 103 | |
| 104 | theorem releaseLowerConstant_pos : 0 < releaseLowerConstant := |
| 105 | lt_min (Real.exp_pos _) (mul_pos (Real.exp_pos _) tailCoefficient_pos) |
| 106 | |
| 107 | theorem normalizedLag_release_lower {d : TailData} {K : ℝ} (w : ResetWitness d K) |
| 108 | (eta : ℝ) {y : ℝ} (hy : d.releaseStart ≤ y) (hy' : y ≤ d.releaseStart + d.rampEnd) : |
| 109 | Real.exp (-2) * (d.core.lam / 2) ≤ ReleaseMoments.normalizedLag d w.coefficients eta y := by |
| 110 | rw [ReleaseMoments.ResetWitness.normalizedLag_release w eta hy hy'] |
| 111 | exact releaseLag_lower_all d (by linarith) (by linarith) |
| 112 | |
| 113 | /-- Positivity of the actual angular-history lag through the first half tail unit. -/ |
| 114 | theorem normalizedLag_lower {d : TailData} {K : ℝ} (w : ResetWitness d K) |
| 115 | (eta : ℝ) {y : ℝ} (hy : d.releaseStart ≤ y) (hy' : y ≤ tailStart d + 1 / 2) : |
| 116 | releaseLowerConstant * d.h ≤ ReleaseMoments.normalizedLag d w.coefficients eta y := by |
| 117 | by_cases h1 : y ≤ d.releaseStart + d.rampEnd |
| 118 | · have h := normalizedLag_release_lower w eta hy h1 |
| 119 | have hc : releaseLowerConstant ≤ Real.exp (-2) := min_le_left _ _ |
| 120 | have hmul := mul_le_mul_of_nonneg_right hc d.h_pos.le |
| 121 | linarith [mul_le_mul_of_nonneg_left d.h_small.le (Real.exp_pos (-2)).le] |
| 122 | · by_cases h2 : y ≤ tailStart d |
| 123 | · rw [ReleaseMoments.ResetWitness.normalizedLag_hold w eta (le_of_not_ge h1) h2] |
| 124 | have ht : y - (d.releaseStart + d.rampEnd) ≤ decayHold d := by |
| 125 | dsimp [tailStart] at h2 |
| 126 | linarith |
| 127 | have h := holdLag_lower d ht |
| 128 | have he : Real.exp (-1 : ℝ) ≤ 1 := Real.exp_le_one_iff.mpr (by norm_num) |
| 129 | have hc : releaseLowerConstant ≤ tailCoefficient := |
| 130 | (min_le_right _ _).trans (by nlinarith [tailCoefficient_pos]) |
| 131 | exact (mul_le_mul_of_nonneg_right hc d.h_pos.le).trans h |
| 132 | · rw [ReleaseMoments.ResetWitness.normalizedLag_tail w eta (le_of_not_ge h2)] |
| 133 | exact (mul_le_mul_of_nonneg_right (min_le_right _ _) d.h_pos.le).trans |
| 134 | (tailLag_first_half_lower d (by linarith) (by linarith)) |
| 135 | |
| 136 | theorem normalizedLag_pos {d : TailData} {K : ℝ} (w : ResetWitness d K) |
| 137 | (eta : ℝ) {y : ℝ} (hy : d.releaseStart ≤ y) (hy' : y ≤ tailStart d + 1 / 2) : |
| 138 | 0 < ReleaseMoments.normalizedLag d w.coefficients eta y := |
| 139 | (mul_pos releaseLowerConstant_pos d.h_pos).trans_le (normalizedLag_lower w eta hy hy') |
| 140 | |
| 141 | /-! ## The designed suppression of the actual field -/ |
| 142 | |
| 143 | theorem finalAngular_release_formula (d : TailData) (eta : ℝ) {y : ℝ} |
| 144 | (hy : d.releaseStart ≤ y) : |
| 145 | finalAngular d (y, eta) = finalAngular d (d.releaseStart, eta) * |
| 146 | Real.exp (releasePrimitive d (y - d.releaseStart) - (y - d.releaseStart) / 2) * |
| 147 | (tailShape d (y - tailStart d) / (1 - d.rho)) := by |
| 148 | have hR : d.core.holdStart ≤ d.releaseStart := by |
| 149 | linarith [coreEndpoint_ge_hold d, flattenEnd_gt_core d, releaseStart_gt_flattenEnd d] |
| 150 | have hrad := radialAmplitude_hold d.core.dropLength_pos.le hR hy |
| 151 | (P := d.core.P) (lam := d.core.lam) |
| 152 | rw [finalAngular_uniform d eta ((releaseStart_gt_flattenEnd d).le.trans hy), |
| 153 | finalAngular_uniform_wait d eta (releaseStart_gt_flattenEnd d).le le_rfl, |
| 154 | carrier, hrad, releaseAdjustment_eq] |
| 155 | have hex : Real.exp (-(1 / 2 + d.core.lam) * (y - d.releaseStart)) * |
| 156 | Real.exp (releasePrimitive d (y - d.releaseStart) + d.core.lam * (y - d.releaseStart)) = |
| 157 | Real.exp (releasePrimitive d (y - d.releaseStart) - (y - d.releaseStart) / 2) := by |
| 158 | rw [← Real.exp_add] |
| 159 | congr 1 |
| 160 | ring |
| 161 | calc |
| 162 | _ = (radialAmplitude d.core.P d.core.dropLength d.core.lam d.releaseStart / 2) * |
| 163 | (Real.exp (-(1 / 2 + d.core.lam) * (y - d.releaseStart)) * |
| 164 | Real.exp (releasePrimitive d (y - d.releaseStart) + d.core.lam * (y - d.releaseStart))) * |
| 165 | (tailShape d (y - tailStart d) / (1 - d.rho)) := by ring |
| 166 | _ = _ := by rw [hex] |
| 167 | |
| 168 | theorem tailShape_ratio_le_two (d : TailData) (t : ℝ) : tailShape d t / (1 - d.rho) ≤ 2 := by |
| 169 | apply (div_le_iff₀ (show 0 < 1 - d.rho by linarith [d.rho_lt_half])).mpr |
| 170 | linarith [(tailShape_bounds d t).2, d.rho_lt_half] |
| 171 | |
| 172 | theorem plateau_amplitude_suppression (d : TailData) : Real.exp (-d.longHold) = d.h ^ 4 := by |
| 173 | have he := OutgoingPulseBounds.exp_log_inverse_nat d.h_pos 4 |
| 174 | simpa [TailData.longHold] using he |
| 175 | |
| 176 | theorem finalAngular_suppressed (d : TailData) (eta : ℝ) {y : ℝ} |
| 177 | (hy : d.releaseStart + d.secondRampStart ≤ y) : |
| 178 | finalAngular d (y, eta) ≤ 2 * finalAngular d (d.releaseStart, eta) * d.h ^ 4 := by |
| 179 | have ht : d.secondRampStart ≤ y - d.releaseStart := by linarith |
| 180 | have h0 : 0 ≤ y - d.releaseStart := by |
| 181 | dsimp [TailData.secondRampStart] at ht |
| 182 | linarith [d.longHold_pos] |
| 183 | have hp := releasePrimitive_late_le d ht |
| 184 | have hex : Real.exp (releasePrimitive d (y - d.releaseStart) - (y - d.releaseStart) / 2) ≤ |
| 185 | d.h ^ 4 := by |
| 186 | rw [← plateau_amplitude_suppression] |
| 187 | apply Real.exp_le_exp.mpr |
| 188 | linarith [mul_nonneg d.h_pos.le (sub_nonneg.mpr ht)] |
| 189 | have hratio0 : 0 ≤ tailShape d (y - tailStart d) / (1 - d.rho) := |
| 190 | div_nonneg (tailShape_pos d _).le (by linarith [d.rho_lt_half]) |
| 191 | rw [finalAngular_release_formula d eta (by linarith)] |
| 192 | have h := mul_le_mul hex (tailShape_ratio_le_two d (y - tailStart d)) hratio0 |
| 193 | (pow_nonneg d.h_pos.le 4) |
| 194 | have h' := mul_le_mul_of_nonneg_left h (finalAngular_pos d (d.releaseStart, eta)).le |
| 195 | linarith |
| 196 | |
| 197 | theorem profileSlope_bounds (d : TailData) (y : ℝ) : |
| 198 | -1 ≤ profileSlope d y ∧ profileSlope d y ≤ -(3 * d.h / 4) := by |
| 199 | have hs := releaseSlope_bounds d (y - d.releaseStart) |
| 200 | have ht := tail_taper_log_derivative d (y - tailStart d) |
| 201 | dsimp [profileSlope] |
| 202 | constructor <;> linarith |
| 203 | |
| 204 | noncomputable def releaseA (d : TailData) (y : ℝ) : ℝ := 2 - 2 * profileSlope d y |
| 205 | |
| 206 | theorem releaseA_bounds (d : TailData) (y : ℝ) : 2 < releaseA d y ∧ releaseA d y ≤ 4 := by |
| 207 | have h := profileSlope_bounds d y |
| 208 | dsimp [releaseA] |
| 209 | constructor <;> linarith [d.h_pos] |
| 210 | |
| 211 | theorem releaseA_eq_derivative (d : TailData) (eta : ℝ) {y : ℝ} |
| 212 | (hy : d.releaseStart ≤ y) : |
| 213 | releaseA d y = 1 - 2 * deriv (fun t => Real.log (finalAngular d (t, eta))) y := by |
| 214 | rw [(finalAngular_log_hasDerivAt_on_release d eta hy).deriv] |
| 215 | dsimp [releaseA] |
| 216 | ring |
| 217 | |
| 218 | /-! ## Future integrals on the uniform release -/ |
| 219 | |
| 220 | theorem finalAngular_release_decay (d : TailData) (eta : ℝ) {y t : ℝ} |
| 221 | (hy : d.releaseStart ≤ y) (hyt : y ≤ t) : |
| 222 | finalAngular d (t, eta) ≤ finalAngular d (y, eta) * |
| 223 | Real.exp (-(1 / 2 + 3 * d.h / 4) * (t - y)) := by |
| 224 | have hf : ContDiff ℝ ∞ (fun s => Real.log (finalAngular d (s, eta))) := |
| 225 | ((finalAngular_contDiff d).comp (contDiff_id.prodMk contDiff_const)).log |
| 226 | (fun s => (finalAngular_pos d (s, eta)).ne') |
| 227 | have hi := (convex_Ici d.releaseStart).image_sub_le_mul_sub_of_deriv_le |
| 228 | hf.continuous.continuousOn (hf.differentiable (by simp)).differentiableOn |
| 229 | (fun z hz => show deriv (fun s => Real.log (finalAngular d (s, eta))) z ≤ |
| 230 | -(1 / 2 + 3 * d.h / 4) by |
| 231 | rw [(finalAngular_log_hasDerivAt_on_release d eta (interior_subset hz)).deriv] |
| 232 | linarith [(profileSlope_bounds d z).2]) y hy t (hy.trans hyt) hyt |
| 233 | have he := Real.exp_le_exp.mpr hi |
| 234 | rw [Real.exp_sub, Real.exp_log (finalAngular_pos d _), Real.exp_log (finalAngular_pos d _)] at he |
| 235 | have he' := (div_le_iff₀ (finalAngular_pos d (y, eta))).mp he |
| 236 | simpa only [mul_comm] using he' |
| 237 | |
| 238 | theorem weighted_square_release_decay (d : TailData) (eta : ℝ) {y t : ℝ} |
| 239 | (hy : d.releaseStart ≤ y) (hyt : y ≤ t) : |
| 240 | Real.exp (t - y) * finalAngular d (t, eta) ^ 2 ≤ |
| 241 | finalAngular d (y, eta) ^ 2 * Real.exp (-(3 * d.h / 2) * (t - y)) := by |
| 242 | have he := finalAngular_release_decay d eta hy hyt |
| 243 | have hs := pow_le_pow_left₀ (finalAngular_pos d (t, eta)).le he 2 |
| 244 | have hm := mul_le_mul_of_nonneg_left hs (Real.exp_pos (t - y)).le |
| 245 | have hex : Real.exp (t - y) * Real.exp (-(1 / 2 + 3 * d.h / 4) * (t - y)) ^ 2 = |
| 246 | Real.exp (-(3 * d.h / 2) * (t - y)) := by |
| 247 | simp only [pow_two, ← Real.exp_add] |
| 248 | congr 1 |
| 249 | ring |
| 250 | calc |
| 251 | _ ≤ Real.exp (t - y) * |
| 252 | (finalAngular d (y, eta) * Real.exp (-(1 / 2 + 3 * d.h / 4) * (t - y))) ^ 2 := hm |
| 253 | _ = finalAngular d (y, eta) ^ 2 * |
| 254 | (Real.exp (t - y) * Real.exp (-(1 / 2 + 3 * d.h / 4) * (t - y)) ^ 2) := by ring |
| 255 | _ = _ := by rw [hex] |
| 256 | |
| 257 | theorem weighted_square_release_integrable (d : TailData) (eta : ℝ) {y : ℝ} |
| 258 | (hy : d.releaseStart ≤ y) : |
| 259 | IntegrableOn (fun t => Real.exp (t - y) * finalAngular d (t, eta) ^ 2) (Ioi y) := by |
| 260 | have ha : 0 < 3 * d.h / 2 := div_pos (mul_pos (by norm_num) d.h_pos) (by norm_num) |
| 261 | have hm := (integrableOn_shift_exp ha y).const_mul (finalAngular d (y, eta) ^ 2) |
| 262 | have hc : Continuous (fun t => Real.exp (t - y) * finalAngular d (t, eta) ^ 2) := |
| 263 | (Real.continuous_exp.comp (continuous_id.sub continuous_const)).mul |
| 264 | (((finalAngular_contDiff d).continuous.comp (continuous_id.prodMk continuous_const)).pow 2) |
| 265 | apply hm.mono' hc.aestronglyMeasurable |
| 266 | filter_upwards [ae_restrict_mem measurableSet_Ioi] with t ht |
| 267 | rw [Real.norm_eq_abs, abs_of_nonneg (by positivity)] |
| 268 | exact weighted_square_release_decay d eta hy ht.le |
| 269 | |
| 270 | theorem weighted_square_release_integral_le (d : TailData) (eta : ℝ) {y : ℝ} |
| 271 | (hy : d.releaseStart ≤ y) : |
| 272 | d.h * (∫ t in Ioi y, Real.exp (t - y) * finalAngular d (t, eta) ^ 2) ≤ |
| 273 | finalAngular d (y, eta) ^ 2 := by |
| 274 | have ha : 0 < 3 * d.h / 2 := div_pos (mul_pos (by norm_num) d.h_pos) (by norm_num) |
| 275 | have hm := (integrableOn_shift_exp ha y).const_mul (finalAngular d (y, eta) ^ 2) |
| 276 | have hi := setIntegral_mono_on (weighted_square_release_integrable d eta hy) hm |
| 277 | measurableSet_Ioi (fun t ht => weighted_square_release_decay d eta hy ht.le) |
| 278 | rw [integral_const_mul, integral_shift_exp ha] at hi |
| 279 | have h := mul_le_mul_of_nonneg_left hi d.h_pos.le |
| 280 | have heq : d.h * (finalAngular d (y, eta) ^ 2 * (1 / (3 * d.h / 2))) = |
| 281 | (2 / 3) * finalAngular d (y, eta) ^ 2 := by field_simp [d.h_pos.ne'] |
| 282 | rw [heq] at h |
| 283 | linarith [sq_nonneg (finalAngular d (y, eta))] |
| 284 | |
| 285 | noncomputable def releaseFutureEnergy (d : TailData) (y : ℝ) : ℝ := |
| 286 | ∫ t in Ioi y, Real.exp (t - y) * finalAngular d (t, 0) ^ 2 |
| 287 | |
| 288 | noncomputable def releaseFutureMass (d : TailData) (y : ℝ) : ℝ := |
| 289 | ∫ t in Ioi y, finalAngular d (t, 0) ^ 2 |
| 290 | |
| 291 | /-- The backward-energy numerator in the uniform region. Its identification |
| 292 | with the source primitive uses the actual zero total energy. -/ |
| 293 | noncomputable def releaseNumerator (d : TailData) (eta y : ℝ) : ℝ := |
| 294 | 2 * eta * (d.h * releaseFutureEnergy d y - (1 / 2 + d.h) * releaseFutureMass d y) |
| 295 | |
| 296 | noncomputable def numeratorConstant : ℝ := 2 * (1 + FuturePressureBounds.envelopeConstant) |
| 297 | |
| 298 | theorem numeratorConstant_pos : 0 < numeratorConstant := by |
| 299 | dsimp [numeratorConstant] |
| 300 | linarith [FuturePressureBounds.envelopeConstant_pos] |
| 301 | |
| 302 | theorem releaseNumerator_abs_le (d : TailData) {eta y : ℝ} |
| 303 | (heta : |eta| ≤ 1) (hy : d.releaseStart ≤ y) : |
| 304 | |releaseNumerator d eta y| ≤ numeratorConstant * finalAngular d (y, 0) ^ 2 := by |
| 305 | have he0 : 0 ≤ releaseFutureEnergy d y := integral_nonneg (fun t => by positivity) |
| 306 | have hm0 : 0 ≤ releaseFutureMass d y := integral_nonneg (fun t => sq_nonneg _) |
| 307 | have he : d.h * releaseFutureEnergy d y ≤ finalAngular d (y, 0) ^ 2 := |
| 308 | weighted_square_release_integral_le d 0 hy |
| 309 | have hy0 : 0 ≤ y := (UniformAngularReset.flattenEnd_pos d).le.trans |
| 310 | ((releaseStart_gt_flattenEnd d).le.trans hy) |
| 311 | have hm : releaseFutureMass d y ≤ |
| 312 | FuturePressureBounds.envelopeConstant * finalAngular d (y, 0) ^ 2 := |
| 313 | FuturePressureBounds.future_square_integral_le d hy0 (by norm_num) |
| 314 | have hA : 0 ≤ 1 / 2 + d.h := by linarith [d.h_pos] |
| 315 | have hA' : 1 / 2 + d.h ≤ 1 := by linarith [d.h_lt_half] |
| 316 | have hmass := mul_le_mul_of_nonneg_right hA' hm0 |
| 317 | have hs : |d.h * releaseFutureEnergy d y - (1 / 2 + d.h) * releaseFutureMass d y| ≤ |
| 318 | (1 + FuturePressureBounds.envelopeConstant) * finalAngular d (y, 0) ^ 2 := by |
| 319 | have h := abs_sub_le (d.h * releaseFutureEnergy d y) 0 ((1 / 2 + d.h) * releaseFutureMass d y) |
| 320 | simp only [sub_zero, zero_sub, abs_neg, abs_of_nonneg (mul_nonneg d.h_pos.le he0), |
| 321 | abs_of_nonneg (mul_nonneg hA hm0)] at h |
| 322 | linarith |
| 323 | dsimp [releaseNumerator, numeratorConstant] |
| 324 | rw [abs_mul, abs_mul, abs_of_pos (by norm_num : (0 : ℝ) < 2)] |
| 325 | have h := mul_le_mul (mul_le_mul_of_nonneg_left heta (by norm_num : (0 : ℝ) ≤ 2)) hs |
| 326 | (abs_nonneg _) (by norm_num : (0 : ℝ) ≤ 2 * 1) |
| 327 | linarith |
| 328 | |
| 329 | /-! ## Uniform smallness after dividing by the actual controller -/ |
| 330 | |
| 331 | theorem releaseAmplitude_le_pulse (d : TailData) (eta : ℝ) : |
| 332 | finalAngular d (d.releaseStart, eta) ≤ pulseAmplitude d.core := by |
| 333 | have hy : d.core.pulseStart ≤ d.releaseStart := by |
| 334 | have hs := endpoint_le_releaseStart d |
| 335 | dsimp [OutgoingSchedule.Parameters.endpoint] at hs |
| 336 | linarith [d.core.pulseLength_pos] |
| 337 | have hr := radialAmplitude_hold d.core.dropLength_pos.le d.core.pulseStart_ge_hold hy |
| 338 | (P := d.core.P) (lam := d.core.lam) |
| 339 | rw [finalAngular_uniform_wait d eta (releaseStart_gt_flattenEnd d).le le_rfl, hr] |
| 340 | change pulseAmplitude d.core * Real.exp (-(1 / 2 + d.core.lam) * |
| 341 | (d.releaseStart - d.core.pulseStart)) / 2 ≤ pulseAmplitude d.core |
| 342 | have he : Real.exp (-(1 / 2 + d.core.lam) * (d.releaseStart - d.core.pulseStart)) ≤ 1 := |
| 343 | Real.exp_le_one_iff.mpr (by nlinarith [d.core.lam_pos]) |
| 344 | nlinarith [pulseAmplitude_pos d.core] |
| 345 | |
| 346 | theorem releaseAmplitude_small (d : TailData) |
| 347 | (hwait : d.core.wait = 60 * Real.log (1 / d.core.lam)) (eta : ℝ) : |
| 348 | finalAngular d (d.releaseStart, eta) ≤ |
| 349 | (d.core.P * Real.exp (Real.exp d.core.m + 12)) * d.core.lam ^ (30 : ℕ) := |
| 350 | (releaseAmplitude_le_pulse d eta).trans (OutgoingPulseBounds.pulseAmplitude_small d.core hwait) |
| 351 | |
| 352 | theorem finalAngular_le_releaseAmplitude (d : TailData) (eta : ℝ) {y : ℝ} |
| 353 | (hy : d.releaseStart ≤ y) : finalAngular d (y, eta) ≤ finalAngular d (d.releaseStart, eta) := by |
| 354 | have he := finalAngular_release_decay d eta le_rfl hy |
| 355 | have hex : Real.exp (-(1 / 2 + 3 * d.h / 4) * (y - d.releaseStart)) ≤ 1 := |
| 356 | Real.exp_le_one_iff.mpr (by nlinarith [d.h_pos]) |
| 357 | nlinarith [finalAngular_pos d (d.releaseStart, eta)] |
| 358 | |
| 359 | noncomputable def releaseVelocityRatio (d : TailData) (c : ℝ → Coeff) (eta y : ℝ) : ℝ := |
| 360 | releaseNumerator d eta y / (finalAngular d (y, 0) * ReleaseMoments.normalizedLag d c eta y) |
| 361 | |
| 362 | theorem releaseVelocityRatio_abs_le {d : TailData} {K : ℝ} (w : ResetWitness d K) |
| 363 | {eta y : ℝ} (heta : |eta| ≤ 1) (hy : d.releaseStart ≤ y) (hy' : y ≤ tailStart d + 1 / 2) : |
| 364 | |releaseVelocityRatio d w.coefficients eta y| ≤ |
| 365 | numeratorConstant * finalAngular d (y, 0) / ReleaseMoments.normalizedLag d w.coefficients eta y := by |
| 366 | have hQ := normalizedLag_pos w eta hy hy' |
| 367 | have hden := mul_pos (finalAngular_pos d (y, 0)) hQ |
| 368 | rw [releaseVelocityRatio, abs_div, abs_of_pos hden] |
| 369 | apply (div_le_iff₀ hden).mpr |
| 370 | calc |
| 371 | _ ≤ numeratorConstant * finalAngular d (y, 0) ^ 2 := releaseNumerator_abs_le d heta hy |
| 372 | _ = _ := by field_simp [hQ.ne'] |
| 373 | |
| 374 | noncomputable def earlyRatioConstant : ℝ := 2 * numeratorConstant / Real.exp (-2) |
| 375 | noncomputable def lateRatioConstant : ℝ := 2 * numeratorConstant / releaseLowerConstant |
| 376 | |
| 377 | theorem earlyRatioConstant_pos : 0 < earlyRatioConstant := |
| 378 | div_pos (mul_pos (by norm_num) numeratorConstant_pos) (Real.exp_pos _) |
| 379 | |
| 380 | theorem lateRatioConstant_pos : 0 < lateRatioConstant := |
| 381 | div_pos (mul_pos (by norm_num) numeratorConstant_pos) releaseLowerConstant_pos |
| 382 | |
| 383 | theorem releaseVelocityRatio_early {d : TailData} {K : ℝ} (w : ResetWitness d K) |
| 384 | (hwait : d.core.wait = 60 * Real.log (1 / d.core.lam)) |
| 385 | {eta y : ℝ} (heta : |eta| ≤ 1) (hy : d.releaseStart ≤ y) |
| 386 | (hy' : y ≤ d.releaseStart + d.rampEnd) : |
| 387 | |releaseVelocityRatio d w.coefficients eta y| ≤ |
| 388 | earlyRatioConstant * (d.core.P * Real.exp (Real.exp d.core.m + 12)) * d.core.lam ^ (29 : ℕ) := by |
| 389 | have hyend : y ≤ tailStart d + 1 / 2 := by |
| 390 | dsimp [tailStart] |
| 391 | linarith [decayHold_pos d] |
| 392 | have hQ := normalizedLag_pos w eta hy hyend |
| 393 | have hQl := normalizedLag_release_lower w eta hy hy' |
| 394 | have hcl : 0 < Real.exp (-2) * (d.core.lam / 2) := by |
| 395 | exact mul_pos (Real.exp_pos _) (div_pos d.core.lam_pos (by norm_num)) |
| 396 | calc |
| 397 | _ ≤ numeratorConstant * finalAngular d (y, 0) / ReleaseMoments.normalizedLag d w.coefficients eta y := |
| 398 | releaseVelocityRatio_abs_le w heta hy hyend |
| 399 | _ ≤ numeratorConstant * finalAngular d (d.releaseStart, 0) / |
| 400 | ReleaseMoments.normalizedLag d w.coefficients eta y := |
| 401 | div_le_div_of_nonneg_right |
| 402 | (mul_le_mul_of_nonneg_left (finalAngular_le_releaseAmplitude d 0 hy) numeratorConstant_pos.le) hQ.le |
| 403 | _ ≤ numeratorConstant * finalAngular d (d.releaseStart, 0) / (Real.exp (-2) * (d.core.lam / 2)) := |
| 404 | div_le_div_of_nonneg_left (mul_nonneg numeratorConstant_pos.le (finalAngular_pos d _).le) hcl hQl |
| 405 | _ ≤ numeratorConstant * ((d.core.P * Real.exp (Real.exp d.core.m + 12)) * d.core.lam ^ (30 : ℕ)) / |
| 406 | (Real.exp (-2) * (d.core.lam / 2)) := |
| 407 | div_le_div_of_nonneg_right |
| 408 | (mul_le_mul_of_nonneg_left (releaseAmplitude_small d hwait 0) numeratorConstant_pos.le) hcl.le |
| 409 | _ = _ := by |
| 410 | dsimp [earlyRatioConstant] |
| 411 | field_simp [d.core.lam_pos.ne'] |
| 412 | |
| 413 | theorem releaseVelocityRatio_late {d : TailData} {K : ℝ} (w : ResetWitness d K) |
| 414 | (hwait : d.core.wait = 60 * Real.log (1 / d.core.lam)) |
| 415 | {eta y : ℝ} (heta : |eta| ≤ 1) (hy : d.releaseStart + d.secondRampStart ≤ y) |
| 416 | (hy' : y ≤ tailStart d + 1 / 2) : |
| 417 | |releaseVelocityRatio d w.coefficients eta y| ≤ |
| 418 | lateRatioConstant * (d.core.P * Real.exp (Real.exp d.core.m + 12)) * d.core.lam ^ (29 : ℕ) := by |
| 419 | have hyR : d.releaseStart ≤ y := by |
| 420 | dsimp [TailData.secondRampStart] at hy |
| 421 | linarith [d.longHold_pos] |
| 422 | have hQ := normalizedLag_pos w eta hyR hy' |
| 423 | have hQl := normalizedLag_lower w eta hyR hy' |
| 424 | have hcl := mul_pos releaseLowerConstant_pos d.h_pos |
| 425 | have hh : d.h ^ (3 : ℕ) ≤ 1 := pow_le_one₀ d.h_pos.le (by linarith [d.h_lt_half]) |
| 426 | have hlam : d.core.lam ^ (30 : ℕ) ≤ d.core.lam ^ (29 : ℕ) := by |
| 427 | have h := mul_le_mul_of_nonneg_left (show d.core.lam ≤ 1 by linarith [d.core.lam_lt]) |
| 428 | (pow_nonneg d.core.lam_pos.le 29) |
| 429 | simpa only [← pow_succ, mul_one] using h |
| 430 | calc |
| 431 | _ ≤ numeratorConstant * finalAngular d (y, 0) / ReleaseMoments.normalizedLag d w.coefficients eta y := |
| 432 | releaseVelocityRatio_abs_le w heta hyR hy' |
| 433 | _ ≤ numeratorConstant * (2 * finalAngular d (d.releaseStart, 0) * d.h ^ 4) / |
| 434 | ReleaseMoments.normalizedLag d w.coefficients eta y := |
| 435 | div_le_div_of_nonneg_right |
| 436 | (mul_le_mul_of_nonneg_left (finalAngular_suppressed d 0 hy) numeratorConstant_pos.le) hQ.le |
| 437 | _ ≤ numeratorConstant * (2 * finalAngular d (d.releaseStart, 0) * d.h ^ 4) / |
| 438 | (releaseLowerConstant * d.h) := |
| 439 | div_le_div_of_nonneg_left (mul_nonneg numeratorConstant_pos.le |
| 440 | (mul_nonneg (mul_nonneg (by norm_num) (finalAngular_pos d _).le) (pow_nonneg d.h_pos.le 4))) hcl hQl |
| 441 | _ = lateRatioConstant * finalAngular d (d.releaseStart, 0) * d.h ^ 3 := by |
| 442 | dsimp [lateRatioConstant] |
| 443 | field_simp [d.h_pos.ne', releaseLowerConstant_pos.ne'] |
| 444 | _ ≤ lateRatioConstant * finalAngular d (d.releaseStart, 0) := by |
| 445 | exact mul_le_of_le_one_right (mul_nonneg lateRatioConstant_pos.le (finalAngular_pos d _).le) hh |
| 446 | _ ≤ lateRatioConstant * |
| 447 | ((d.core.P * Real.exp (Real.exp d.core.m + 12)) * d.core.lam ^ (30 : ℕ)) := |
| 448 | mul_le_mul_of_nonneg_left (releaseAmplitude_small d hwait 0) lateRatioConstant_pos.le |
| 449 | _ ≤ _ := by |
| 450 | have h := mul_le_mul_of_nonneg_left hlam |
| 451 | (mul_nonneg lateRatioConstant_pos.le |
| 452 | (mul_nonneg d.core.P_pos.le (Real.exp_pos (Real.exp d.core.m + 12)).le)) |
| 453 | simpa only [mul_assoc] using h |
| 454 | |
| 455 | noncomputable def releaseConeConstant (P m : ℝ) : ℝ := |
| 456 | (earlyRatioConstant + lateRatioConstant) * (P * Real.exp (Real.exp m + 12)) |
| 457 | |
| 458 | theorem releaseConeConstant_pos {P m : ℝ} (hP : 0 < P) : 0 < releaseConeConstant P m := |
| 459 | mul_pos (add_pos earlyRatioConstant_pos lateRatioConstant_pos) (mul_pos hP (Real.exp_pos _)) |
| 460 | |
| 461 | theorem releaseVelocityRatio_uniform {d : TailData} {K : ℝ} (w : ResetWitness d K) |
| 462 | (hwait : d.core.wait = 60 * Real.log (1 / d.core.lam)) |
| 463 | {eta y : ℝ} (heta : |eta| ≤ 1) (hy : d.releaseStart ≤ y) (hy' : y ≤ tailStart d + 1 / 2) : |
| 464 | |releaseVelocityRatio d w.coefficients eta y| ≤ |
| 465 | releaseConeConstant d.core.P d.core.m * d.core.lam ^ (29 : ℕ) := by |
| 466 | have hP : 0 ≤ (d.core.P * Real.exp (Real.exp d.core.m + 12)) * d.core.lam ^ (29 : ℕ) := by |
| 467 | exact mul_nonneg (mul_nonneg d.core.P_pos.le (Real.exp_pos _).le) (pow_nonneg d.core.lam_pos.le _) |
| 468 | dsimp [releaseConeConstant] |
| 469 | by_cases h1 : y ≤ d.releaseStart + d.rampEnd |
| 470 | · have h := releaseVelocityRatio_early w hwait heta hy h1 |
| 471 | linarith [mul_nonneg lateRatioConstant_pos.le hP] |
| 472 | · have hb : d.releaseStart + d.secondRampStart ≤ y := by |
| 473 | dsimp [TailData.rampEnd] at h1 |
| 474 | linarith |
| 475 | have h := releaseVelocityRatio_late w hwait heta hb hy' |
| 476 | linarith [mul_nonneg earlyRatioConstant_pos.le hP] |
| 477 | |
| 478 | /-! ## Actual slopes and the finite stress cone -/ |
| 479 | |
| 480 | theorem corrected_release_eventuallyEq (d : TailData) (c : ℝ → Coeff) (eta : ℝ) {y : ℝ} |
| 481 | (hy : d.releaseStart ≤ y) : |
| 482 | (fun t => correctedAngular d c (t, eta)) =ᶠ[𝓝 y] (fun t => finalAngular d (t, eta)) := by |
| 483 | have hcut : correctionCenter d + 43 / 20 < y := by |
| 484 | dsimp [correctionCenter] |
| 485 | linarith |
| 486 | filter_upwards [lt_mem_nhds hcut] with t ht |
| 487 | have hr : relative (c eta) (t - correctionCenter d) = 0 := by |
| 488 | by_contra hn |
| 489 | have h := relative_support (c eta) hn |
| 490 | linarith [h.2] |
| 491 | simp [correctedAngular, hr] |
| 492 | |
| 493 | theorem corrected_releaseA (d : TailData) (c : ℝ → Coeff) (eta : ℝ) {y : ℝ} |
| 494 | (hy : d.releaseStart ≤ y) : |
| 495 | 1 - 2 * deriv (fun t => Real.log (correctedAngular d c (t, eta))) y = releaseA d y := by |
| 496 | have he := (corrected_release_eventuallyEq d c eta hy).fun_comp Real.log |
| 497 | dsimp only [Function.comp_def] at he |
| 498 | rw [he.deriv_eq] |
| 499 | exact (releaseA_eq_derivative d eta hy).symm |
| 500 | |
| 501 | theorem cone_of_zero_bs {a r p : ℝ} (ha : 2 < a) (ha' : a ≤ 4) |
| 502 | (hr : |r| ≤ 1 / 2) (hp : 16 < p) : |
| 503 | 2 < p ∧ 2 < a ∧ a < ConeAlgebra.coneBound p (p * r) := by |
| 504 | have hr2 : r ^ 2 ≤ 1 / 4 := by |
| 505 | have h := abs_le.mp hr |
| 506 | nlinarith |
| 507 | have hmargin : 3 / 2 ≤ 2 - (a - 2) * r ^ 2 := by |
| 508 | linarith [mul_nonneg (sub_nonneg.mpr ha') (sq_nonneg r)] |
| 509 | refine ⟨by linarith, ha, ?_⟩ |
| 510 | have h := ConeAlgebra.finite_amplitude_cone (c := 1) (j := r) (v := a) (p := p) |
| 511 | (by linarith) (by linarith) (by linarith) ?_ |
| 512 | · simpa using h |
| 513 | · have hmul := mul_le_mul_of_nonneg_left hmargin (show 0 ≤ p by linarith) |
| 514 | linarith |
| 515 | |
| 516 | noncomputable def releaseP1 (d : TailData) (c : ℝ → Coeff) (XR eta y : ℝ) : ℝ := |
| 517 | XR * Real.exp y * ReleaseMoments.normalizedLag d c eta y / CoordinateAlgebra.L d.h eta |
| 518 | |
| 519 | noncomputable def releaseRadiusThreshold (d : TailData) : ℝ := |
| 520 | 16 / (Real.exp d.releaseStart * (releaseLowerConstant * d.h)) |
| 521 | |
| 522 | theorem releaseRadiusThreshold_pos (d : TailData) : 0 < releaseRadiusThreshold d := |
| 523 | div_pos (by norm_num) (mul_pos (Real.exp_pos _) (mul_pos releaseLowerConstant_pos d.h_pos)) |
| 524 | |
| 525 | theorem releaseP1_large {d : TailData} {K : ℝ} (w : ResetWitness d K) {XR eta y : ℝ} |
| 526 | (hXR : releaseRadiusThreshold d < XR) (heta : eta ^ 2 ≤ 1) |
| 527 | (hy : d.releaseStart ≤ y) (hy' : y ≤ tailStart d + 1 / 2) : |
| 528 | 16 < releaseP1 d w.coefficients XR eta y := by |
| 529 | have hL := CoordinateAlgebra.L_pos d.h_pos.le d.h_lt_half heta |
| 530 | have hL1 : CoordinateAlgebra.L d.h eta ≤ 1 := by |
| 531 | dsimp [CoordinateAlgebra.L] |
| 532 | linarith [mul_nonneg d.h_pos.le (sq_nonneg eta)] |
| 533 | have hXR0 := (releaseRadiusThreshold_pos d).trans hXR |
| 534 | have hscale : 16 < XR * (Real.exp d.releaseStart * (releaseLowerConstant * d.h)) := by |
| 535 | exact (div_lt_iff₀ (mul_pos (Real.exp_pos _) (mul_pos releaseLowerConstant_pos d.h_pos))).mp hXR |
| 536 | have he := Real.exp_le_exp.mpr hy |
| 537 | have hq := normalizedLag_lower w eta hy hy' |
| 538 | have hprod := mul_le_mul he hq (mul_pos releaseLowerConstant_pos d.h_pos).le (Real.exp_pos y).le |
| 539 | have hprod' := mul_le_mul_of_nonneg_left hprod hXR0.le |
| 540 | unfold releaseP1 |
| 541 | apply (lt_div_iff₀ hL).mpr |
| 542 | linarith |
| 543 | |
| 544 | theorem exists_release_cone_threshold (P m : ℝ) (hP : 0 < P) : |
| 545 | ∃ lam0 : ℝ, 0 < lam0 ∧ ∀ d : TailData, d.core.P = P → d.core.m = m → |
| 546 | d.core.lam < lam0 → releaseConeConstant d.core.P d.core.m * d.core.lam ^ (29 : ℕ) < 1 / 2 := by |
| 547 | have hC := releaseConeConstant_pos (m := m) hP |
| 548 | refine ⟨(1 / 2) / releaseConeConstant P m, div_pos (by norm_num) hC, ?_⟩ |
| 549 | intro d hdP hdm hd |
| 550 | rw [hdP, hdm] |
| 551 | have hp : d.core.lam ^ (29 : ℕ) ≤ d.core.lam := by |
| 552 | have h := pow_le_one₀ d.core.lam_pos.le (show d.core.lam ≤ 1 by linarith [d.core.lam_lt]) |
| 553 | (n := 28) |
| 554 | calc |
| 555 | _ = d.core.lam * d.core.lam ^ (28 : ℕ) := by ring |
| 556 | _ ≤ d.core.lam * 1 := mul_le_mul_of_nonneg_left h d.core.lam_pos.le |
| 557 | _ = _ := mul_one _ |
| 558 | have hsmall := (lt_div_iff₀ hC).mp hd |
| 559 | have h := mul_le_mul_of_nonneg_left hp hC.le |
| 560 | linarith |
| 561 | |
| 562 | /-! ## Identification with the actual global histories -/ |
| 563 | |
| 564 | theorem actualI_eq_releaseHistory {d : TailData} {K : ℝ} (w : ResetWitness d K) |
| 565 | (eta : ℝ) {y : ℝ} (hy : 0 ≤ y) : |
| 566 | OutgoingHistories.I w (y, eta) = ReleaseMoments.history d w.coefficients eta y := by |
| 567 | rw [OutgoingHistories.I_eq_integral, ReleaseMoments.ResetWitness.history_eq_integral w eta hy] |
| 568 | rfl |
| 569 | |
| 570 | theorem actualI_eta_zero {d : TailData} {K : ℝ} (w : ResetWitness d K) |
| 571 | (eta : ℝ) {y : ℝ} (hy : d.releaseStart ≤ y) : |
| 572 | OutgoingHistories.dEta (OutgoingHistories.I w) (y, eta) = 0 := by |
| 573 | have hy0 : 0 ≤ y := (UniformAngularReset.flattenEnd_pos d).le.trans |
| 574 | ((releaseStart_gt_flattenEnd d).le.trans hy) |
| 575 | rw [OutgoingHistories.dEta_eq_deriv (OutgoingHistories.I_smooth w)] |
| 576 | have he : (fun q => OutgoingHistories.I w (y, q)) = |
| 577 | (fun q => ReleaseMoments.history d w.coefficients q y) := |
| 578 | funext (fun q => actualI_eq_releaseHistory w q hy0) |
| 579 | rw [he] |
| 580 | exact ReleaseMoments.ResetWitness.history_deriv_eta_zero w hy eta |
| 581 | |
| 582 | theorem actualQs_eq_normalizedLag {d : TailData} {K : ℝ} (w : ResetWitness d K) |
| 583 | {Amp : ℝ → ℝ} (ha : ContDiff ℝ ∞ Amp) (eta : ℝ) {y : ℝ} (hy : d.releaseStart ≤ y) : |
| 584 | OutgoingHistories.Qs w Amp (y, eta) = ReleaseMoments.normalizedLag d w.coefficients eta y := by |
| 585 | have hyS := (endpoint_le_releaseStart d).trans hy |
| 586 | have hy0 : 0 ≤ y := (UniformAngularReset.flattenEnd_pos d).le.trans |
| 587 | ((releaseStart_gt_flattenEnd d).le.trans hy) |
| 588 | rw [OutgoingHistories.Qs_after_endpoint w ha eta hyS, actualI_eta_zero w eta hy, |
| 589 | mul_zero, sub_zero, actualI_eq_releaseHistory w eta hy0] |
| 590 | change -1 + (1 - d.h) * ReleaseMoments.history d w.coefficients eta y / |
| 591 | (Real.exp (3 * y / 2) * correctedAngular d w.coefficients (y, eta)) = _ |
| 592 | rw [ReleaseMoments.corrected_eq_release d w.coefficients eta hy] |
| 593 | unfold ReleaseMoments.normalizedLag ReleaseMoments.releaseWeight |
| 594 | ring |
| 595 | |
| 596 | theorem actual_energyWeight_eq {d : TailData} {K : ℝ} (w : ResetWitness d K) |
| 597 | (Amp : ℝ → ℝ) (eta t : ℝ) : |
| 598 | Real.exp t * (OutgoingHistories.U d Amp (t, eta) ^ 2 - OutgoingHistories.E w (t, eta) ^ 2 / 2) = |
| 599 | CorrectedPulseAmplitude.energyIntegrand d w.coefficients (Amp eta) eta t := by |
| 600 | dsimp [OutgoingHistories.U, OutgoingHistories.E, CorrectedPulseAmplitude.energyIntegrand] |
| 601 | rw [PulseAmplitude.axial_eq_of_amplitude_eq d.core Amp (fun _ => Amp eta) eta t rfl] |
| 602 | |
| 603 | /-- Zero actual total energy fixes the future energy term, including the reset. -/ |
| 604 | theorem actualS_backward {d : TailData} {K : ℝ} (w : ResetWitness d K) |
| 605 | {Amp : ℝ → ℝ} (ha : ContDiff ℝ ∞ Amp) (eta : ℝ) {y : ℝ} |
| 606 | (hy : d.core.endpoint ≤ y) |
| 607 | (hz : CorrectedPulseAmplitude.totalEnergy d w.coefficients (Amp eta) eta = 0) : |
| 608 | OutgoingHistories.S w Amp (y, eta) = |
| 609 | (1 / 2 : ℝ) * ∫ t in Ioi y, Real.exp t * correctedAngular d w.coefficients (t, eta) ^ 2 := by |
| 610 | have hS : OutgoingHistories.S w Amp (y, eta) = |
| 611 | ∫ t in Iic y, CorrectedPulseAmplitude.energyIntegrand d w.coefficients (Amp eta) eta t := by |
| 612 | rw [OutgoingHistories.S_eq_integral w ha] |
| 613 | apply setIntegral_congr_fun measurableSet_Iic |
| 614 | intro t _ |
| 615 | exact actual_energyWeight_eq w Amp eta t |
| 616 | have hf : (∫ t in Ioi y, CorrectedPulseAmplitude.energyIntegrand d w.coefficients (Amp eta) eta t) = |
| 617 | -(1 / 2 : ℝ) * ∫ t in Ioi y, Real.exp t * correctedAngular d w.coefficients (t, eta) ^ 2 := by |
| 618 | rw [← integral_const_mul] |
| 619 | apply setIntegral_congr_fun measurableSet_Ioi |
| 620 | intro t ht |
| 621 | unfold CorrectedPulseAmplitude.energyIntegrand |
| 622 | rw [axial_after_pulse d.core (fun _ => Amp eta) eta (hy.trans ht.le)] |
| 623 | ring |
| 624 | have hsplit := integral_add_compl measurableSet_Iic |
| 625 | (CorrectedPulseAmplitude.energyIntegrand_integrable d w.coefficients (Amp eta) eta) |
| 626 | (s := Iic y) |
| 627 | rw [compl_Iic, ← hS, hf] at hsplit |
| 628 | change _ = CorrectedPulseAmplitude.totalEnergy d w.coefficients (Amp eta) eta at hsplit |
| 629 | rw [hz] at hsplit |
| 630 | linarith |
| 631 | |
| 632 | theorem actualS_uniform {d : TailData} {K : ℝ} (w : ResetWitness d K) |
| 633 | {Amp : ℝ → ℝ} (ha : ContDiff ℝ ∞ Amp) (eta : ℝ) {y : ℝ} |
| 634 | (hy : d.releaseStart ≤ y) |
| 635 | (hz : CorrectedPulseAmplitude.totalEnergy d w.coefficients (Amp eta) eta = 0) : |
| 636 | OutgoingHistories.S w Amp (y, eta) = |
| 637 | (Real.exp y / 2) * releaseFutureEnergy d y := by |
| 638 | rw [actualS_backward w ha eta ((endpoint_le_releaseStart d).trans hy) hz] |
| 639 | unfold releaseFutureEnergy |
| 640 | have he : (∫ t in Ioi y, Real.exp t * correctedAngular d w.coefficients (t, eta) ^ 2) = |
| 641 | Real.exp y * ∫ t in Ioi y, Real.exp (t - y) * finalAngular d (t, 0) ^ 2 := by |
| 642 | rw [← integral_const_mul] |
| 643 | apply setIntegral_congr_fun measurableSet_Ioi |
| 644 | intro t ht |
| 645 | dsimp only |
| 646 | rw [ReleaseMoments.corrected_eq_release d w.coefficients eta (hy.trans ht.le)] |
| 647 | have hex : Real.exp y * Real.exp (t - y) = Real.exp t := by |
| 648 | rw [← Real.exp_add] |
| 649 | congr 1 |
| 650 | ring |
| 651 | rw [← mul_assoc, hex] |
| 652 | rw [he] |
| 653 | ring |
| 654 | |
| 655 | theorem actualS_eta_zero {d : TailData} {K : ℝ} (w : ResetWitness d K) |
| 656 | {Amp : ℝ → ℝ} (ha : ContDiff ℝ ∞ Amp) (eta : ℝ) {y : ℝ} |
| 657 | (hy : d.releaseStart ≤ y) |
| 658 | (hz : ∀ᶠ q in 𝓝 eta, CorrectedPulseAmplitude.totalEnergy d w.coefficients (Amp q) q = 0) : |
| 659 | OutgoingHistories.dEta (OutgoingHistories.S w Amp) (y, eta) = 0 := by |
| 660 | have he : (fun q => OutgoingHistories.S w Amp (y, q)) =ᶠ[𝓝 eta] |
| 661 | (fun _ => (Real.exp y / 2) * releaseFutureEnergy d y) := by |
| 662 | filter_upwards [hz] with q hq |
| 663 | exact actualS_uniform w ha q hy hq |
| 664 | rw [OutgoingHistories.dEta_eq_deriv (OutgoingHistories.S_smooth w ha), he.deriv_eq] |
| 665 | simp |
| 666 | |
| 667 | theorem actualPi_eq_correctedPi {d : TailData} {K : ℝ} (w : ResetWitness d K) (y eta : ℝ) : |
| 668 | OutgoingHistories.Pi w (y, eta) = CorrectedPressureBounds.correctedPi w y eta := by |
| 669 | rw [OutgoingHistories.Pi_eq_past_integral, CorrectedPressureBounds.correctedPi_eq_axisPressure_add] |
| 670 | rw [integral_div] |
| 671 | dsimp [OutgoingHistories.E] |
| 672 | ring |
| 673 | |
| 674 | theorem actualPi_uniform {d : TailData} {K : ℝ} (w : ResetWitness d K) |
| 675 | (eta : ℝ) {y : ℝ} (hy : d.releaseStart ≤ y) : |
| 676 | OutgoingHistories.Pi w (y, eta) = -(1 / 2 : ℝ) * releaseFutureMass d y := by |
| 677 | rw [actualPi_eq_correctedPi, CorrectedPressureBounds.correctedPi_eta_independent_after w hy eta 0, |
| 678 | CorrectedPressureBounds.correctedPi_eq_after w hy] |
| 679 | rfl |
| 680 | |
| 681 | theorem actualPi_eta_zero {d : TailData} {K : ℝ} (w : ResetWitness d K) |
| 682 | (eta : ℝ) {y : ℝ} (hy : d.releaseStart ≤ y) : |
| 683 | OutgoingHistories.dEta (OutgoingHistories.Pi w) (y, eta) = 0 := by |
| 684 | rw [OutgoingHistories.dEta_eq_deriv (OutgoingHistories.Pi_smooth w)] |
| 685 | have he : (fun q => OutgoingHistories.Pi w (y, q)) = CorrectedPressureBounds.correctedPi w y := |
| 686 | funext (fun q => actualPi_eq_correctedPi w y q) |
| 687 | rw [he] |
| 688 | exact CorrectedPressureBounds.correctedPi_deriv_eta_zero_after w hy eta |
| 689 | |
| 690 | theorem actualNs_eq_releaseNumerator {d : TailData} {K : ℝ} (w : ResetWitness d K) |
| 691 | {Amp : ℝ → ℝ} (ha : ContDiff ℝ ∞ Amp) (eta : ℝ) {y : ℝ} |
| 692 | (hy : d.releaseStart ≤ y) |
| 693 | (hz : ∀ᶠ q in 𝓝 eta, CorrectedPulseAmplitude.totalEnergy d w.coefficients (Amp q) q = 0) : |
| 694 | OutgoingHistories.Ns w Amp (y, eta) = releaseNumerator d eta y := by |
| 695 | have hz0 : CorrectedPulseAmplitude.totalEnergy d w.coefficients (Amp eta) eta = 0 := |
| 696 | Filter.Eventually.self_of_nhds (x := eta) |
| 697 | (p := fun q => CorrectedPulseAmplitude.totalEnergy d w.coefficients (Amp q) q = 0) hz |
| 698 | rw [OutgoingHistories.Ns_after_endpoint w ha eta ((endpoint_le_releaseStart d).trans hy), |
| 699 | actualS_uniform w ha eta hy hz0, actualS_eta_zero w ha eta hy hz, |
| 700 | actualPi_uniform w eta hy, actualPi_eta_zero w eta hy] |
| 701 | dsimp [releaseNumerator, StressAlgebra.velocityExponent] |
| 702 | field_simp ; ring |
| 703 | |
| 704 | theorem amplitude_energy_zero_germ {d : TailData} {K : ℝ} (w : ResetWitness d K) (eta : ℝ) |
| 705 | (hneg : CorrectedPulseAmplitude.constantTerm d w.coefficients eta < -(1 / 5)) : |
| 706 | ∀ᶠ q in 𝓝 eta, CorrectedPulseAmplitude.totalEnergy d w.coefficients |
| 707 | (CorrectedPulseAmplitude.amplitude d w.coefficients q) q = 0 := by |
| 708 | have hc : ContinuousAt (CorrectedPulseAmplitude.constantTerm d w.coefficients) eta := |
| 709 | (CorrectedPulseAmplitude.constantTerm_contDiff d w.smooth).continuous.continuousAt |
| 710 | filter_upwards [hc.eventually (gt_mem_nhds hneg)] with q hq |
| 711 | exact CorrectedPulseAmplitude.amplitude_totalEnergy_zero d w.coefficients q hq.le |
| 712 | |
| 713 | theorem actualRatio_eq_releaseVelocityRatio {d : TailData} {K : ℝ} (w : ResetWitness d K) |
| 714 | {Amp : ℝ → ℝ} (ha : ContDiff ℝ ∞ Amp) (eta : ℝ) {y : ℝ} |
| 715 | (hy : d.releaseStart ≤ y) |
| 716 | (hz : ∀ᶠ q in 𝓝 eta, CorrectedPulseAmplitude.totalEnergy d w.coefficients (Amp q) q = 0) : |
| 717 | OutgoingHistories.Ns w Amp (y, eta) / |
| 718 | (OutgoingHistories.E w (y, eta) * OutgoingHistories.Qs w Amp (y, eta)) = |
| 719 | releaseVelocityRatio d w.coefficients eta y := by |
| 720 | rw [actualNs_eq_releaseNumerator w ha eta hy hz, actualQs_eq_normalizedLag w ha eta hy] |
| 721 | change releaseNumerator d eta y / |
| 722 | (correctedAngular d w.coefficients (y, eta) * ReleaseMoments.normalizedLag d w.coefficients eta y) = _ |
| 723 | rw [ReleaseMoments.corrected_eq_release d w.coefficients eta hy] |
| 724 | rfl |
| 725 | |
| 726 | /-! ## Actual logarithmic derivatives through flattening and reset -/ |
| 727 | |
| 728 | noncomputable def resetRelative {d : TailData} {K : ℝ} (w : ResetWitness d K) (eta y : ℝ) : ℝ := |
| 729 | relative (w.coefficients eta) (y - correctionCenter d) |
| 730 | |
| 731 | noncomputable def resetRadialDerivative {d : TailData} {K : ℝ} (w : ResetWitness d K) |
| 732 | (eta y : ℝ) : ℝ := deriv (relative (w.coefficients eta)) (y - correctionCenter d) |
| 733 | |
| 734 | noncomputable def resetEtaDerivative {d : TailData} {K : ℝ} (w : ResetWitness d K) |
| 735 | (eta y : ℝ) : ℝ := relative (deriv w.coefficients eta) (y - correctionCenter d) |
| 736 | |
| 737 | noncomputable def correctedFlatSlope {d : TailData} {K : ℝ} (w : ResetWitness d K) |
| 738 | (eta y : ℝ) : ℝ := flatteningSlope d y eta + resetRadialDerivative w eta y / (1 + resetRelative w eta y) |
| 739 | |
| 740 | noncomputable def correctedEtaSlope {d : TailData} {K : ℝ} (w : ResetWitness d K) |
| 741 | (eta y : ℝ) : ℝ := etaRate d eta y + resetEtaDerivative w eta y / (1 + resetRelative w eta y) |
| 742 | |
| 743 | theorem resetFactor_ge_half {d : TailData} {K : ℝ} (w : ResetWitness d K) (eta y : ℝ) : |
| 744 | 1 / 2 ≤ 1 + resetRelative w eta y := by |
| 745 | have h := (abs_le.mp (w.small_jets eta (y - correctionCenter d)).1).1 |
| 746 | dsimp [resetRelative] |
| 747 | linarith |
| 748 | |
| 749 | theorem correctedFlat_hasDerivAt {d : TailData} {K : ℝ} (w : ResetWitness d K) |
| 750 | (eta : ℝ) {y : ℝ} (hy : d.core.endpoint ≤ y) (hy' : y < d.releaseStart) : |
| 751 | HasDerivAt (fun t => OutgoingHistories.E w (t, eta)) |
| 752 | (OutgoingHistories.E w (y, eta) * (correctedFlatSlope w eta y - 1 / 2)) y := by |
| 753 | have he : (fun t => finalAngular d (t, eta)) =ᶠ[𝓝 y] (fun t => flattened d (t, eta)) := by |
| 754 | filter_upwards [gt_mem_nhds hy'] with t ht |
| 755 | exact UniformAngularReset.finalAngular_before_release d eta ht.le |
| 756 | have hc : HasDerivAt (fun t => finalAngular d (t, eta)) |
| 757 | (finalAngular d (y, eta) * (flatteningSlope d y eta - 1 / 2)) y := by |
| 758 | rw [UniformAngularReset.finalAngular_before_release d eta hy'.le] |
| 759 | exact (flattened_hasDerivAt d eta hy).congr_of_eventuallyEq he |
| 760 | have hr := (((relative_contDiff (w.coefficients eta)).differentiable (by simp) |
| 761 | (y - correctionCenter d)).hasDerivAt).comp y ((hasDerivAt_id y).sub_const (correctionCenter d)) |
| 762 | have hd := hc.mul (hr.const_add 1) |
| 763 | have hn : 1 + resetRelative w eta y ≠ 0 := by linarith [resetFactor_ge_half w eta y] |
| 764 | convert! hd using 1 |
| 765 | dsimp [OutgoingHistories.E, correctedAngular, correctedFlatSlope, resetRelative, resetRadialDerivative] at * |
| 766 | field_simp [hn] ; ring |
| 767 | |
| 768 | theorem correctedEta_hasDerivAt {d : TailData} {K : ℝ} (w : ResetWitness d K) (eta y : ℝ) : |
| 769 | HasDerivAt (fun q => OutgoingHistories.E w (y, q)) |
| 770 | (OutgoingHistories.E w (y, eta) * correctedEtaSlope w eta y) eta := by |
| 771 | have hc : HasDerivAt (fun q => finalAngular d (y, q)) |
| 772 | (finalAngular d (y, eta) * etaRate d eta y) eta := by |
| 773 | convert! finalAngular_hasDerivAt_eta d eta y using 1 |
| 774 | dsimp [etaRate] |
| 775 | ring |
| 776 | have hr := ResetEnergyBounds.relative_coeff_hasDerivAt |
| 777 | ((w.smooth.differentiable (by simp) eta).hasDerivAt) (y - correctionCenter d) |
| 778 | have hd := hc.mul (hr.const_add 1) |
| 779 | have hn : 1 + resetRelative w eta y ≠ 0 := by linarith [resetFactor_ge_half w eta y] |
| 780 | convert! hd using 1 |
| 781 | dsimp [OutgoingHistories.E, correctedAngular, correctedEtaSlope, resetRelative, resetEtaDerivative] at * |
| 782 | field_simp [hn] |
| 783 | |
| 784 | theorem correctedFlat_dY_H {d : TailData} {K : ℝ} (w : ResetWitness d K) |
| 785 | (eta : ℝ) {y : ℝ} (hy : d.core.endpoint ≤ y) (hy' : y < d.releaseStart) : |
| 786 | OutgoingHistories.dY (OutgoingHistories.H w) (y, eta) = |
| 787 | OutgoingHistories.H w (y, eta) * correctedFlatSlope w eta y := by |
| 788 | have hh := (((hasDerivAt_id y).div_const 2).exp).mul (correctedFlat_hasDerivAt w eta hy hy') |
| 789 | have he : HasDerivAt (fun t => OutgoingHistories.H w (t, eta)) |
| 790 | (OutgoingHistories.H w (y, eta) * correctedFlatSlope w eta y) y := by |
| 791 | convert! hh using 1 |
| 792 | dsimp [OutgoingHistories.H] |
| 793 | ring |
| 794 | exact (OutgoingHistories.dY_hasDerivAt (OutgoingHistories.H_smooth w) (y, eta)).unique he |
| 795 | |
| 796 | theorem corrected_dEta_H {d : TailData} {K : ℝ} (w : ResetWitness d K) (eta y : ℝ) : |
| 797 | OutgoingHistories.dEta (OutgoingHistories.H w) (y, eta) = |
| 798 | OutgoingHistories.H w (y, eta) * correctedEtaSlope w eta y := by |
| 799 | have hh := (correctedEta_hasDerivAt w eta y).const_mul (Real.exp (y / 2)) |
| 800 | have he : HasDerivAt (fun q => OutgoingHistories.H w (y, q)) |
| 801 | (OutgoingHistories.H w (y, eta) * correctedEtaSlope w eta y) eta := by |
| 802 | convert! hh using 1 |
| 803 | dsimp [OutgoingHistories.H] |
| 804 | ring |
| 805 | exact (OutgoingHistories.dEta_hasDerivAt (OutgoingHistories.H_smooth w) (y, eta)).unique he |
| 806 | |
| 807 | theorem correctedFlat_Sq {d : TailData} {K : ℝ} (w : ResetWitness d K) |
| 808 | {Amp : ℝ → ℝ} (ha : ContDiff ℝ ∞ Amp) (eta : ℝ) {y : ℝ} |
| 809 | (hy : d.core.endpoint ≤ y) (hy' : y < d.releaseStart) : |
| 810 | OutgoingHistories.Sq w Amp (y, eta) = -correctedFlatSlope w eta y - d.h - |
| 811 | StressAlgebra.axialExponent d.h * eta * correctedEtaSlope w eta y := by |
| 812 | unfold OutgoingHistories.Sq OutgoingHistories.angularSource |
| 813 | rw [OutgoingHistories.W_after_endpoint d ha eta hy, OutgoingHistories.U_after_endpoint d Amp eta hy, |
| 814 | correctedFlat_dY_H w eta hy hy', corrected_dEta_H] |
| 815 | dsimp only |
| 816 | field_simp [(OutgoingHistories.H_pos w (y, eta)).ne'] ; ring |
| 817 | |
| 818 | noncomputable def resetJetConstant : ℝ := Classical.choose relative_first_jet_bound |
| 819 | |
| 820 | theorem resetJetConstant_pos : 0 < resetJetConstant := (Classical.choose_spec relative_first_jet_bound).1 |
| 821 | |
| 822 | theorem relative_radial_bound (c : Coeff) (y : ℝ) : |
| 823 | |deriv (relative c) y| ≤ resetJetConstant * ‖c‖ := |
| 824 | ((Classical.choose_spec relative_first_jet_bound).2 c y).2 |
| 825 | |
| 826 | noncomputable def resetSourceError (d : TailData) (K : ℝ) : ℝ := |
| 827 | (2 * resetJetConstant + 2) * (K * d.core.lam ^ (28 : ℕ)) |
| 828 | |
| 829 | theorem reset_radial_ratio_bound {d : TailData} {K : ℝ} (w : ResetWitness d K) (eta y : ℝ) : |
| 830 | |resetRadialDerivative w eta y / (1 + resetRelative w eta y)| ≤ |
| 831 | 2 * resetJetConstant * (K * d.core.lam ^ (28 : ℕ)) := by |
| 832 | have hden : 0 < 1 + resetRelative w eta y := by linarith [resetFactor_ge_half w eta y] |
| 833 | have hr := (relative_radial_bound (w.coefficients eta) (y - correctionCenter d)).trans |
| 834 | (mul_le_mul_of_nonneg_left (w.coefficient_bound eta) resetJetConstant_pos.le) |
| 835 | change |resetRadialDerivative w eta y| ≤ _ at hr |
| 836 | rw [abs_div, abs_of_pos hden] |
| 837 | apply (div_le_iff₀ hden).mpr |
| 838 | have hprod := mul_le_mul_of_nonneg_left (resetFactor_ge_half w eta y) |
| 839 | (mul_nonneg (mul_nonneg (by norm_num : (0 : ℝ) ≤ 2) resetJetConstant_pos.le) |
| 840 | (ResetEnergyBounds.coefficient_scale_nonneg w)) |
| 841 | linarith |
| 842 | |
| 843 | theorem reset_eta_ratio_bound {d : TailData} {K : ℝ} (w : ResetWitness d K) (eta y : ℝ) : |
| 844 | |resetEtaDerivative w eta y / (1 + resetRelative w eta y)| ≤ 4 * (K * d.core.lam ^ (28 : ℕ)) := by |
| 845 | have hden : 0 < 1 + resetRelative w eta y := by linarith [resetFactor_ge_half w eta y] |
| 846 | have hr := ResetEnergyBounds.relative_eta_bound w eta (y - correctionCenter d) |
| 847 | change |resetEtaDerivative w eta y| ≤ _ at hr |
| 848 | rw [abs_div, abs_of_pos hden] |
| 849 | apply (div_le_iff₀ hden).mpr |
| 850 | have hprod := mul_le_mul_of_nonneg_left (resetFactor_ge_half w eta y) |
| 851 | (mul_nonneg (by norm_num : (0 : ℝ) ≤ 4) (ResetEnergyBounds.coefficient_scale_nonneg w)) |
| 852 | linarith |
| 853 | |
| 854 | theorem eta_times_etaRate_nonpos (d : TailData) (eta y : ℝ) : eta * etaRate d eta y ≤ 0 := by |
| 855 | have hp : 0 ≤ 2 * eta ^ 2 / (1 + eta ^ 2) := by positivity |
| 856 | have hs := sigma_le_one ((y - d.core.endpoint) / flattenLength) |
| 857 | calc |
| 858 | eta * etaRate d eta y = (sigma ((y - d.core.endpoint) / flattenLength) - 1) * |
| 859 | (2 * eta ^ 2 / (1 + eta ^ 2)) := by dsimp [etaRate]; ring |
| 860 | _ ≤ 0 := mul_nonpos_of_nonpos_of_nonneg (by linarith) hp |
| 861 | |
| 862 | theorem correctedFlatSlope_bounds {d : TailData} {K : ℝ} (w : ResetWitness d K) |
| 863 | (eta y : ℝ) (heta : eta ^ 2 ≤ 1) : |
| 864 | -d.core.lam - 1 / 10 - resetSourceError d K ≤ correctedFlatSlope w eta y ∧ |
| 865 | correctedFlatSlope w eta y ≤ -d.core.lam + resetSourceError d K := by |
| 866 | have hf := flatteningSlope_bounds d y eta heta |
| 867 | have hr := abs_le.mp (reset_radial_ratio_bound w eta y) |
| 868 | have hs := ResetEnergyBounds.coefficient_scale_nonneg w |
| 869 | dsimp [correctedFlatSlope, resetSourceError] |
| 870 | constructor <;> linarith |
| 871 | |
| 872 | theorem correctedFlat_source_lower {d : TailData} {K : ℝ} (w : ResetWitness d K) |
| 873 | {Amp : ℝ → ℝ} (ha : ContDiff ℝ ∞ Amp) (eta : ℝ) (heta : |eta| ≤ 1) {y : ℝ} |
| 874 | (hy : d.core.endpoint ≤ y) (hy' : y < d.releaseStart) : |
| 875 | d.core.lam / 2 - resetSourceError d K ≤ OutgoingHistories.Sq w Amp (y, eta) := by |
| 876 | have heta2 : eta ^ 2 ≤ 1 := by have h := abs_le.mp heta; nlinarith |
| 877 | have hf := flatteningSlope_bounds d y eta heta2 |
| 878 | have hr := abs_le.mp (reset_radial_ratio_bound w eta y) |
| 879 | have hD : 0 ≤ StressAlgebra.axialExponent d.h := by |
| 880 | dsimp [StressAlgebra.axialExponent] |
| 881 | linarith [d.h_lt_half] |
| 882 | have hD' : StressAlgebra.axialExponent d.h ≤ 1 / 2 := by |
| 883 | dsimp [StressAlgebra.axialExponent] |
| 884 | linarith [d.h_pos] |
| 885 | have hbase := mul_nonpos_of_nonneg_of_nonpos hD (eta_times_etaRate_nonpos d eta y) |
| 886 | have hDEta : |StressAlgebra.axialExponent d.h * eta| ≤ 1 / 2 := by |
| 887 | rw [abs_mul, abs_of_nonneg hD] |
| 888 | linarith [mul_le_mul_of_nonneg_left heta hD] |
| 889 | have he := mul_le_mul hDEta (reset_eta_ratio_bound w eta y) (abs_nonneg _) (by norm_num : (0 : ℝ) ≤ 1 / 2) |
| 890 | rw [← abs_mul] at he |
| 891 | have he' := (le_abs_self _).trans he |
| 892 | rw [correctedFlat_Sq w ha eta hy hy'] |
| 893 | dsimp [correctedFlatSlope, correctedEtaSlope, resetSourceError] |
| 894 | linarith [d.h_small] |
| 895 | |
| 896 | theorem correctedFlat_geometry {d : TailData} {K : ℝ} (w : ResetWitness d K) |
| 897 | (hsmall : resetSourceError d K ≤ d.core.lam / 4) (eta y : ℝ) (heta : eta ^ 2 ≤ 1) : |
| 898 | 2 < 2 - 2 * correctedFlatSlope w eta y ∧ 2 - 2 * correctedFlatSlope w eta y ≤ 4 ∧ |
| 899 | 1 + correctedFlatSlope w eta y ≤ 1 := by |
| 900 | have h := correctedFlatSlope_bounds w eta y heta |
| 901 | constructor |
| 902 | · linarith [d.core.lam_pos] |
| 903 | constructor |
| 904 | · linarith [d.core.lam_lt] |
| 905 | · linarith [d.core.lam_pos] |
| 906 | |
| 907 | theorem ode_constant_barrier {q a b : ℝ → ℝ} (hq : Continuous q) (ha : Continuous a) |
| 908 | {lo hi B : ℝ} (hlh : lo ≤ hi) (hinit : B ≤ q lo) |
| 909 | (hODE : ∀ t ∈ Ioo lo hi, HasDerivAt q (b t - a t * q t) t) |
| 910 | (hsource : ∀ t ∈ Ioo lo hi, a t * B ≤ b t) : B ≤ q hi := by |
| 911 | let g : ℝ → ℝ := fun t => Real.exp (primitive a t) * (q t - B) |
| 912 | have hp : Continuous (primitive a) := continuous_iff_continuousAt.mpr |
| 913 | (fun t => (primitive_hasDerivAt ha t).continuousAt) |
| 914 | have hg : Continuous g := (Real.continuous_exp.comp hp).mul (hq.sub continuous_const) |
| 915 | have hgd : ∀ t ∈ Ioo lo hi, |
| 916 | HasDerivAt g (Real.exp (primitive a t) * (b t - a t * B)) t := by |
| 917 | intro t ht |
| 918 | have hd := ((primitive_hasDerivAt ha t).exp).mul ((hODE t ht).sub_const B) |
| 919 | convert! hd using 1 |
| 920 | ring |
| 921 | have hm : MonotoneOn g (Icc lo hi) := by |
| 922 | apply monotoneOn_of_deriv_nonneg (convex_Icc lo hi) hg.continuousOn |
| 923 | · intro t ht |
| 924 | have ht' : t ∈ Ioo lo hi := by simpa only [interior_Icc] using ht |
| 925 | exact (hgd t ht').differentiableAt.differentiableWithinAt |
| 926 | · intro t ht |
| 927 | have ht' : t ∈ Ioo lo hi := by simpa only [interior_Icc] using ht |
| 928 | rw [(hgd t ht').deriv] |
| 929 | exact mul_nonneg (Real.exp_pos _).le (sub_nonneg.mpr (hsource t ht')) |
| 930 | have hg0 : 0 ≤ g lo := mul_nonneg (Real.exp_pos _).le (sub_nonneg.mpr hinit) |
| 931 | have hg1 : 0 ≤ g hi := hg0.trans (hm ⟨le_rfl, hlh⟩ ⟨hlh, le_rfl⟩ hlh) |
| 932 | change 0 ≤ Real.exp (primitive a hi) * (q hi - B) at hg1 |
| 933 | exact sub_nonneg.mp ((mul_nonneg_iff_of_pos_left (Real.exp_pos _)).mp hg1) |
| 934 | |
| 935 | theorem flatten_Qs_lower_of_endpoint {d : TailData} {K : ℝ} (w : ResetWitness d K) |
| 936 | {Amp : ℝ → ℝ} (ha : ContDiff ℝ ∞ Amp) |
| 937 | (hsmall : resetSourceError d K ≤ d.core.lam / 4) (eta : ℝ) (heta : |eta| ≤ 1) |
| 938 | (hinit : d.core.lam / 4 ≤ OutgoingHistories.Qs w Amp (d.core.endpoint, eta)) |
| 939 | {y : ℝ} (hy : d.core.endpoint ≤ y) (hy' : y ≤ d.releaseStart) : |
| 940 | d.core.lam / 4 ≤ OutgoingHistories.Qs w Amp (y, eta) := by |
| 941 | have heta2 : eta ^ 2 ≤ 1 := by have h := abs_le.mp heta; nlinarith |
| 942 | let rate : ℝ → ℝ := fun t => 1 + OutgoingHistories.dY (OutgoingHistories.H w) (t, eta) / |
| 943 | OutgoingHistories.H w (t, eta) |
| 944 | have hr : Continuous rate := by |
| 945 | apply continuous_const.add |
| 946 | exact ((OutgoingHistories.dY_smooth (OutgoingHistories.H_smooth w)).continuous.comp |
| 947 | (continuous_id.prodMk continuous_const)).div |
| 948 | ((OutgoingHistories.H_smooth w).continuous.comp (continuous_id.prodMk continuous_const)) |
| 949 | (fun t => (OutgoingHistories.H_pos w (t, eta)).ne') |
| 950 | apply ode_constant_barrier (b := fun t => OutgoingHistories.Sq w Amp (t, eta)) |
| 951 | ((OutgoingHistories.Qs_smooth w ha).continuous.comp (continuous_id.prodMk continuous_const)) hr hy hinit |
| 952 | · intro t _ |
| 953 | exact OutgoingHistories.Qs_hasDerivAt w ha (t, eta) |
| 954 | · intro t ht |
| 955 | have htR : t < d.releaseStart := ht.2.trans_le hy' |
| 956 | have hr_eq : rate t = 1 + correctedFlatSlope w eta t := by |
| 957 | dsimp [rate] |
| 958 | rw [correctedFlat_dY_H w eta ht.1.le htR] |
| 959 | field_simp [(OutgoingHistories.H_pos w (t, eta)).ne'] |
| 960 | rw [hr_eq] |
| 961 | have hrate := (correctedFlat_geometry w hsmall eta t heta2).2.2 |
| 962 | have hsource := correctedFlat_source_lower w ha eta heta ht.1.le htR |
| 963 | have hm := mul_le_mul_of_nonneg_right hrate (div_nonneg d.core.lam_pos.le (by norm_num : (0 : ℝ) ≤ 4)) |
| 964 | linarith |
| 965 | |
| 966 | theorem corrected_flatten_Qs_lower {d : TailData} {K : ℝ} (w : ResetWitness d K) |
| 967 | (hK : 0 < K) (hwait : d.core.wait = 60 * Real.log (1 / d.core.lam)) |
| 968 | (hsmall : d.core.lam ≤ 1 / 120) (hscale : CorrectedPulseAmplitude.combinedScale d K ≤ 1 / 1000) |
| 969 | (hpulse : PulseCone.sourceConstant d.core.P d.core.m * d.core.lam ^ (29 : ℕ) ≤ 1 / 8) |
| 970 | (hh1 : d.h ≤ 1 / 100) (hhT : d.h ≤ Real.exp (-(d.core.holdStart + 3 / 5)) / 8) |
| 971 | (hreset : resetSourceError d K ≤ d.core.lam / 4) |
| 972 | (eta : ℝ) (heta : |eta| ≤ 1) {y : ℝ} (hy : d.core.endpoint ≤ y) (hy' : y ≤ d.releaseStart) : |
| 973 | d.core.lam / 4 ≤ OutgoingHistories.Qs w |
| 974 | (CorrectedPulseAmplitude.amplitude d w.coefficients) (y, eta) := by |
| 975 | exact flatten_Qs_lower_of_endpoint w (CorrectedPulseAmplitude.amplitude_contDiff d w.smooth) |
| 976 | hreset eta heta |
| 977 | (PulseCone.corrected_Qs_endpoint_lower w hK hwait hsmall hscale hpulse hh1 hhT heta) hy hy' |
| 978 | |
| 979 | /-! ## Energy and its parameter derivative on the finite post-pulse interval -/ |
| 980 | |
| 981 | theorem corrected_density_prefix_le {d : TailData} {K : ℝ} (w : ResetWitness d K) |
| 982 | (eta : ℝ) (heta : eta ^ 2 ≤ 1) {y : ℝ} (hy : d.core.endpoint ≤ y) |
| 983 | (hy' : y ≤ d.releaseStart) : |
| 984 | Real.exp y * OutgoingHistories.E w (y, eta) ^ 2 ≤ |
| 985 | (9 / 4 : ℝ) * energyDensity d eta d.core.endpoint := by |
| 986 | have hr := abs_le.mp (w.small_jets eta (y - correctionCenter d)).1 |
| 987 | have hr2 : (1 + relative (w.coefficients eta) (y - correctionCenter d)) ^ 2 ≤ 9 / 4 := by |
| 988 | nlinarith |
| 989 | have h := mul_le_mul_of_nonneg_left hr2 (energyDensity_pos d eta y).le |
| 990 | have he := energyDensity_prefix_le d eta heta hy hy' |
| 991 | change Real.exp y * (finalAngular d (y, eta) * |
| 992 | (1 + relative (w.coefficients eta) (y - correctionCenter d))) ^ 2 ≤ _ |
| 993 | dsimp [energyDensity] at h he ⊢ |
| 994 | linarith |
| 995 | |
| 996 | theorem corrected_square_prefix_le {d : TailData} {K : ℝ} (w : ResetWitness d K) |
| 997 | (eta : ℝ) (heta : eta ^ 2 ≤ 1) {y : ℝ} (hy : d.core.endpoint ≤ y) |
| 998 | (hy' : y ≤ d.releaseStart) : |
| 999 | OutgoingHistories.E w (y, eta) ^ 2 ≤ (9 / 4 : ℝ) * finalAngular d (d.core.endpoint, eta) ^ 2 := by |
| 1000 | have hd := corrected_density_prefix_le w eta heta hy hy' |
| 1001 | have hm := mul_le_mul_of_nonneg_right (Real.exp_le_exp.mpr hy) |
| 1002 | (sq_nonneg (OutgoingHistories.E w (y, eta))) |
| 1003 | dsimp [energyDensity] at hd |
| 1004 | nlinarith [Real.exp_pos d.core.endpoint] |
| 1005 | |
| 1006 | theorem correctedEtaSlope_abs_le {d : TailData} {K : ℝ} (w : ResetWitness d K) |
| 1007 | (hsmall : K * d.core.lam ^ (28 : ℕ) ≤ 1) (eta y : ℝ) : |
| 1008 | |correctedEtaSlope w eta y| ≤ 5 := by |
| 1009 | exact (abs_add_le _ _).trans (by |
| 1010 | have h1 := etaRate_bound d eta y |
| 1011 | have h2 := reset_eta_ratio_bound w eta y |
| 1012 | linarith) |
| 1013 | |
| 1014 | theorem actualS_endpoint {d : TailData} {K : ℝ} (w : ResetWitness d K) |
| 1015 | {Amp : ℝ → ℝ} (ha : ContDiff ℝ ∞ Amp) (eta : ℝ) |
| 1016 | (hz : CorrectedPulseAmplitude.totalEnergy d w.coefficients (Amp eta) eta = 0) : |
| 1017 | OutgoingHistories.S w Amp (d.core.endpoint, eta) = |
| 1018 | (1 / 2 : ℝ) * (postPulseEnergy d eta + ResetEnergyBounds.resetEnergy d w.coefficients eta) := by |
| 1019 | rw [actualS_backward w ha eta le_rfl hz, ResetEnergyBounds.integral_corrected_energy] |
| 1020 | |
| 1021 | theorem actualS_eta_endpoint {d : TailData} {K : ℝ} (w : ResetWitness d K) |
| 1022 | {Amp : ℝ → ℝ} (ha : ContDiff ℝ ∞ Amp) (eta : ℝ) |
| 1023 | (hz : ∀ᶠ q in 𝓝 eta, CorrectedPulseAmplitude.totalEnergy d w.coefficients (Amp q) q = 0) : |
| 1024 | OutgoingHistories.dEta (OutgoingHistories.S w Amp) (d.core.endpoint, eta) = |
| 1025 | (1 / 2 : ℝ) * (deriv (postPulseEnergy d) eta + |
| 1026 | deriv (ResetEnergyBounds.resetEnergy d w.coefficients) eta) := by |
| 1027 | have he : (fun q => OutgoingHistories.S w Amp (d.core.endpoint, q)) =ᶠ[𝓝 eta] |
| 1028 | (fun q => (1 / 2 : ℝ) * (postPulseEnergy d q + ResetEnergyBounds.resetEnergy d w.coefficients q)) := by |
| 1029 | filter_upwards [hz] with q hq |
| 1030 | exact actualS_endpoint w ha q hq |
| 1031 | have hd := (((postPulseEnergy_contDiff d).differentiable (by simp) eta).hasDerivAt.fun_add |
| 1032 | (((ResetEnergyBounds.resetEnergy_contDiff d w.smooth).differentiable (by simp) eta).hasDerivAt)).const_mul |
| 1033 | (1 / 2 : ℝ) |
| 1034 | rw [OutgoingHistories.dEta_eq_deriv (OutgoingHistories.S_smooth w ha), he.deriv_eq, hd.deriv] |
| 1035 | |
| 1036 | theorem actualS_after_hasDerivAt {d : TailData} {K : ℝ} (w : ResetWitness d K) |
| 1037 | {Amp : ℝ → ℝ} (ha : ContDiff ℝ ∞ Amp) (eta : ℝ) {y : ℝ} (hy : d.core.endpoint ≤ y) : |
| 1038 | HasDerivAt (fun t => OutgoingHistories.S w Amp (t, eta)) |
| 1039 | (-(Real.exp y * OutgoingHistories.E w (y, eta) ^ 2) / 2) y := by |
| 1040 | have hd := OutgoingHistories.S_hasDerivAt w ha (y, eta) |
| 1041 | dsimp [OutgoingHistories.X, OutgoingHistories.energyDensity] at hd |
| 1042 | rw [OutgoingHistories.U_after_endpoint d Amp eta hy] at hd |
| 1043 | convert! hd using 1 |
| 1044 | ring |
| 1045 | |
| 1046 | theorem actualS_eta_after_hasDerivAt {d : TailData} {K : ℝ} (w : ResetWitness d K) |
| 1047 | {Amp : ℝ → ℝ} (ha : ContDiff ℝ ∞ Amp) (eta : ℝ) {y : ℝ} (hy : d.core.endpoint ≤ y) : |
| 1048 | HasDerivAt (fun t => OutgoingHistories.dEta (OutgoingHistories.S w Amp) (t, eta)) |
| 1049 | (-(Real.exp y * OutgoingHistories.E w (y, eta) ^ 2) * correctedEtaSlope w eta y) y := by |
| 1050 | have hd := OutgoingHistories.dEta_S_hasDerivAt w ha (y, eta) |
| 1051 | have he : OutgoingHistories.dEta (OutgoingHistories.E w) (y, eta) = |
| 1052 | OutgoingHistories.E w (y, eta) * correctedEtaSlope w eta y := |
| 1053 | (OutgoingHistories.dEta_hasDerivAt (OutgoingHistories.E_smooth w) (y, eta)).unique |
| 1054 | (correctedEta_hasDerivAt w eta y) |
| 1055 | rw [OutgoingHistories.U_after_endpoint d Amp eta hy, he] at hd |
| 1056 | dsimp [OutgoingHistories.X] at hd |
| 1057 | convert! hd using 1 |
| 1058 | ring |
| 1059 | |
| 1060 | theorem abs_increment_le {f f' : ℝ → ℝ} {a b C : ℝ} (hab : a ≤ b) |
| 1061 | (hf : ∀ t ∈ Icc a b, HasDerivAt f (f' t) t) |
| 1062 | (hb : ∀ t ∈ Icc a b, |f' t| ≤ C) : |f b - f a| ≤ C * (b - a) := by |
| 1063 | have h := norm_image_sub_le_of_norm_deriv_le_segment' |
| 1064 | (fun t ht => (hf t ht).hasDerivWithinAt) |
| 1065 | (fun t ht => by simpa only [Real.norm_eq_abs] using hb t ⟨ht.1, ht.2.le⟩) b ⟨hab, le_rfl⟩ |
| 1066 | simpa only [Real.norm_eq_abs] using h |
| 1067 | |
| 1068 | noncomputable def finiteEnergyBudget (d : TailData) : ℝ := |
| 1069 | flattenLength + releaseConstant + 40 + 20 * (d.releaseStart - d.core.endpoint) |
| 1070 | |
| 1071 | theorem finiteEnergyBudget_pos (d : TailData) : 0 < finiteEnergyBudget d := by |
| 1072 | dsimp [finiteEnergyBudget] |
| 1073 | linarith [flattenLength_pos, releaseConstant_pos, endpoint_le_releaseStart d] |
| 1074 | |
| 1075 | theorem actualS_finite_bounds {d : TailData} {K : ℝ} (w : ResetWitness d K) |
| 1076 | {Amp : ℝ → ℝ} (ha : ContDiff ℝ ∞ Amp) |
| 1077 | (hsmall : K * d.core.lam ^ (28 : ℕ) ≤ 1) (eta : ℝ) (heta : eta ^ 2 ≤ 1) |
| 1078 | (hz : ∀ᶠ q in 𝓝 eta, CorrectedPulseAmplitude.totalEnergy d w.coefficients (Amp q) q = 0) |
| 1079 | {y : ℝ} (hy : d.core.endpoint ≤ y) (hy' : y ≤ d.releaseStart) : |
| 1080 | |OutgoingHistories.S w Amp (y, eta)| ≤ finiteEnergyBudget d * energyDensity d eta d.core.endpoint ∧ |
| 1081 | |OutgoingHistories.dEta (OutgoingHistories.S w Amp) (y, eta)| ≤ |
| 1082 | finiteEnergyBudget d * energyDensity d eta d.core.endpoint := by |
| 1083 | have hz0 : CorrectedPulseAmplitude.totalEnergy d w.coefficients (Amp eta) eta = 0 := |
| 1084 | Filter.Eventually.self_of_nhds (x := eta) |
| 1085 | (p := fun q => CorrectedPulseAmplitude.totalEnergy d w.coefficients (Amp q) q = 0) hz |
| 1086 | have hD := (energyDensity_pos d eta d.core.endpoint).le |
| 1087 | have hL : 0 ≤ d.releaseStart - d.core.endpoint := sub_nonneg.mpr (endpoint_le_releaseStart d) |
| 1088 | have hSI : |OutgoingHistories.S w Amp (d.core.endpoint, eta)| ≤ |
| 1089 | ((d.releaseStart - d.core.endpoint + releaseConstant) / 2 + 12) * energyDensity d eta d.core.endpoint := by |
| 1090 | rw [actualS_endpoint w ha eta hz0, abs_mul, abs_of_pos (by norm_num : (0 : ℝ) < 1 / 2)] |
| 1091 | have hsum := abs_add_le (postPulseEnergy d eta) (ResetEnergyBounds.resetEnergy d w.coefficients eta) |
| 1092 | rw [abs_of_nonneg (postPulseEnergy_nonneg d eta)] at hsum |
| 1093 | have hR := ResetEnergyBounds.resetEnergy_abs_le w eta heta |
| 1094 | have hs := mul_le_mul_of_nonneg_right hsmall hD |
| 1095 | linarith [postPulseEnergy_le_length d eta heta] |
| 1096 | have hSEI : |OutgoingHistories.dEta (OutgoingHistories.S w Amp) (d.core.endpoint, eta)| ≤ |
| 1097 | (flattenLength + 12) * energyDensity d eta d.core.endpoint := by |
| 1098 | rw [actualS_eta_endpoint w ha eta hz, abs_mul, abs_of_pos (by norm_num : (0 : ℝ) < 1 / 2)] |
| 1099 | have hsum := abs_add_le (deriv (postPulseEnergy d) eta) |
| 1100 | (deriv (ResetEnergyBounds.resetEnergy d w.coefficients) eta) |
| 1101 | have hs := mul_le_mul_of_nonneg_right hsmall hD |
| 1102 | linarith [abs_deriv_postPulseEnergy_le d eta heta, ResetEnergyBounds.resetEnergy_deriv_abs_le w eta heta] |
| 1103 | have hSD := abs_increment_le hy (fun t ht => actualS_after_hasDerivAt w ha eta ht.1) |
| 1104 | (C := 2 * energyDensity d eta d.core.endpoint) (fun t ht => by |
| 1105 | rw [abs_div, abs_neg, abs_of_nonneg (mul_nonneg (Real.exp_pos _).le (sq_nonneg _))] |
| 1106 | norm_num |
| 1107 | have hd := corrected_density_prefix_le w eta heta ht.1 (ht.2.trans hy') |
| 1108 | linarith) |
| 1109 | have hSED := abs_increment_le hy (fun t ht => actualS_eta_after_hasDerivAt w ha eta ht.1) |
| 1110 | (C := 12 * energyDensity d eta d.core.endpoint) (fun t ht => by |
| 1111 | rw [abs_mul, abs_neg, abs_of_nonneg (mul_nonneg (Real.exp_pos _).le (sq_nonneg _))] |
| 1112 | have hd := corrected_density_prefix_le w eta heta ht.1 (ht.2.trans hy') |
| 1113 | have hs := mul_le_mul_of_nonneg_left (correctedEtaSlope_abs_le w hsmall eta t) |
| 1114 | (mul_nonneg (Real.exp_pos t).le (sq_nonneg (OutgoingHistories.E w (t, eta)))) |
| 1115 | linarith) |
| 1116 | have hlen := mul_le_mul_of_nonneg_right (show y - d.core.endpoint ≤ d.releaseStart - d.core.endpoint by linarith) hD |
| 1117 | have hS := abs_sub_le (OutgoingHistories.S w Amp (y, eta)) |
| 1118 | (OutgoingHistories.S w Amp (d.core.endpoint, eta)) 0 |
| 1119 | have hSE := abs_sub_le (OutgoingHistories.dEta (OutgoingHistories.S w Amp) (y, eta)) |
| 1120 | (OutgoingHistories.dEta (OutgoingHistories.S w Amp) (d.core.endpoint, eta)) 0 |
| 1121 | simp only [sub_zero] at hS hSE |
| 1122 | dsimp [finiteEnergyBudget] |
| 1123 | constructor <;> nlinarith [mul_nonneg flattenLength_pos.le hD, mul_nonneg releaseConstant_pos.le hD, |
| 1124 | mul_nonneg hL hD] |
| 1125 | |
| 1126 | noncomputable def finiteNumeratorBudget (d : TailData) : ℝ := |
| 1127 | 5 * finiteEnergyBudget d + 12 * CorrectedPressureBounds.correctedConstant |
| 1128 | |
| 1129 | theorem actualNs_finite_bound {d : TailData} {K : ℝ} (w : ResetWitness d K) |
| 1130 | {Amp : ℝ → ℝ} (ha : ContDiff ℝ ∞ Amp) |
| 1131 | (hsmall : K * d.core.lam ^ (28 : ℕ) ≤ 1) (eta : ℝ) (heta : |eta| ≤ 1) |
| 1132 | (hz : ∀ᶠ q in 𝓝 eta, CorrectedPulseAmplitude.totalEnergy d w.coefficients (Amp q) q = 0) |
| 1133 | {y : ℝ} (hy : d.core.endpoint ≤ y) (hy' : y ≤ d.releaseStart) : |
| 1134 | |OutgoingHistories.Ns w Amp (y, eta)| ≤ |
| 1135 | finiteNumeratorBudget d * finalAngular d (d.core.endpoint, eta) ^ 2 := by |
| 1136 | have heta2 : eta ^ 2 ≤ 1 := by have h := abs_le.mp heta; nlinarith |
| 1137 | have hS := actualS_finite_bounds w ha hsmall eta heta2 hz hy hy' |
| 1138 | have hB := (finiteEnergyBudget_pos d).le |
| 1139 | have hF := sq_nonneg (finalAngular d (d.core.endpoint, eta)) |
| 1140 | have hdiv : ∀ z : ℝ, |z| ≤ finiteEnergyBudget d * energyDensity d eta d.core.endpoint → |
| 1141 | |z / Real.exp y| ≤ finiteEnergyBudget d * finalAngular d (d.core.endpoint, eta) ^ 2 := by |
| 1142 | intro z hz |
| 1143 | rw [abs_div, abs_of_pos (Real.exp_pos y)] |
| 1144 | apply (div_le_iff₀ (Real.exp_pos y)).mpr |
| 1145 | have hm := mul_le_mul_of_nonneg_left (Real.exp_le_exp.mpr hy) (mul_nonneg hB hF) |
| 1146 | dsimp [energyDensity] at hz |
| 1147 | linarith |
| 1148 | have hs0 := hdiv _ hS.1 |
| 1149 | have hs1 := hdiv _ hS.2 |
| 1150 | have hP := CorrectedPressureBounds.corrected_bounds_of_small w hsmall |
| 1151 | ((SchedulePressure.endpoint_pos d).le.trans hy) heta |
| 1152 | have hP0 : |OutgoingHistories.Pi w (y, eta)| ≤ |
| 1153 | CorrectedPressureBounds.correctedConstant * OutgoingHistories.E w (y, eta) ^ 2 := by |
| 1154 | rw [actualPi_eq_correctedPi] |
| 1155 | exact hP.1 |
| 1156 | have hP1 : |OutgoingHistories.dEta (OutgoingHistories.Pi w) (y, eta)| ≤ |
| 1157 | CorrectedPressureBounds.correctedConstant * OutgoingHistories.E w (y, eta) ^ 2 := by |
| 1158 | rw [OutgoingHistories.dEta_eq_deriv (OutgoingHistories.Pi_smooth w)] |
| 1159 | have he : (fun q => OutgoingHistories.Pi w (y, q)) = CorrectedPressureBounds.correctedPi w y := |
| 1160 | funext (actualPi_eq_correctedPi w y) |
| 1161 | rw [he] |
| 1162 | exact hP.2 |
| 1163 | have hE := mul_le_mul_of_nonneg_left (corrected_square_prefix_le w eta heta2 hy hy') |
| 1164 | CorrectedPressureBounds.correctedConstant_pos.le |
| 1165 | have hd : |StressAlgebra.coordinateFactor eta| ≤ 1 := by |
| 1166 | dsimp [StressAlgebra.coordinateFactor] |
| 1167 | rw [abs_of_nonneg (by linarith : 0 ≤ 1 - eta ^ 2)] |
| 1168 | linarith [sq_nonneg eta] |
| 1169 | have hh : |4 * d.h * eta| ≤ 2 := by |
| 1170 | rw [abs_mul, abs_mul, abs_of_pos (by norm_num : (0 : ℝ) < 4), abs_of_pos d.h_pos] |
| 1171 | have hm := mul_le_mul_of_nonneg_left heta (show 0 ≤ 4 * d.h by linarith [d.h_pos]) |
| 1172 | linarith [d.h_lt_half] |
| 1173 | have ha0 : 0 ≤ StressAlgebra.velocityExponent d.h := by |
| 1174 | dsimp [StressAlgebra.velocityExponent]; linarith [d.h_pos] |
| 1175 | have ha1 : StressAlgebra.velocityExponent d.h ≤ 1 := by |
| 1176 | dsimp [StressAlgebra.velocityExponent]; linarith [d.h_lt_half] |
| 1177 | have hav : |4 * StressAlgebra.velocityExponent d.h * eta| ≤ 4 := by |
| 1178 | rw [abs_mul, abs_mul, abs_of_pos (by norm_num : (0 : ℝ) < 4), abs_of_nonneg ha0] |
| 1179 | have hm := mul_le_mul_of_nonneg_left heta (show 0 ≤ 4 * StressAlgebra.velocityExponent d.h by positivity) |
| 1180 | linarith |
| 1181 | have h1 := mul_le_mul hh hs0 (abs_nonneg _) (by norm_num : (0 : ℝ) ≤ 2) |
| 1182 | have h2 := mul_le_mul hd hs1 (abs_nonneg _) (by norm_num : (0 : ℝ) ≤ 1) |
| 1183 | have h3 := mul_le_mul hav (hP0.trans hE) (abs_nonneg _) (by norm_num : (0 : ℝ) ≤ 4) |
| 1184 | have h4 := mul_le_mul hd (hP1.trans hE) (abs_nonneg _) (by norm_num : (0 : ℝ) ≤ 1) |
| 1185 | rw [← abs_mul] at h1 h2 h3 h4 |
| 1186 | rw [OutgoingHistories.Ns_after_endpoint w ha eta hy] |
| 1187 | rw [show (4 * d.h * eta * OutgoingHistories.S w Amp (y, eta) - |
| 1188 | StressAlgebra.coordinateFactor eta * OutgoingHistories.dEta (OutgoingHistories.S w Amp) (y, eta)) / |
| 1189 | Real.exp y = 4 * d.h * eta * (OutgoingHistories.S w Amp (y, eta) / Real.exp y) - |
| 1190 | StressAlgebra.coordinateFactor eta * (OutgoingHistories.dEta (OutgoingHistories.S w Amp) (y, eta) / |
| 1191 | Real.exp y) by ring] |
| 1192 | have ht1 := abs_sub_le |
| 1193 | (4 * d.h * eta * (OutgoingHistories.S w Amp (y, eta) / Real.exp y)) 0 |
| 1194 | (StressAlgebra.coordinateFactor eta * (OutgoingHistories.dEta (OutgoingHistories.S w Amp) (y, eta) / Real.exp y)) |
| 1195 | have ht2 := abs_add_le |
| 1196 | (4 * d.h * eta * (OutgoingHistories.S w Amp (y, eta) / Real.exp y) - |
| 1197 | StressAlgebra.coordinateFactor eta * (OutgoingHistories.dEta (OutgoingHistories.S w Amp) (y, eta) / Real.exp y)) |
| 1198 | (4 * StressAlgebra.velocityExponent d.h * eta * OutgoingHistories.Pi w (y, eta)) |
| 1199 | have ht3 := abs_sub_le |
| 1200 | (4 * d.h * eta * (OutgoingHistories.S w Amp (y, eta) / Real.exp y) - |
| 1201 | StressAlgebra.coordinateFactor eta * (OutgoingHistories.dEta (OutgoingHistories.S w Amp) (y, eta) / Real.exp y) + |
| 1202 | 4 * StressAlgebra.velocityExponent d.h * eta * OutgoingHistories.Pi w (y, eta)) 0 |
| 1203 | (StressAlgebra.coordinateFactor eta * OutgoingHistories.dEta (OutgoingHistories.Pi w) (y, eta)) |
| 1204 | simp only [sub_zero, zero_sub, abs_neg] at ht1 ht3 |
| 1205 | dsimp [finiteNumeratorBudget] |
| 1206 | linarith [mul_nonneg hB hF, mul_nonneg CorrectedPressureBounds.correctedConstant_pos.le hF] |
| 1207 | |
| 1208 | theorem lambda_log_bound (d : TailData) : d.core.lam * Real.log (1 / d.core.lam) ≤ 1 := by |
| 1209 | have h := Real.log_le_sub_one_of_pos (one_div_pos.mpr d.core.lam_pos) |
| 1210 | have hm := mul_le_mul_of_nonneg_left h d.core.lam_pos.le |
| 1211 | have hid : d.core.lam * (1 / d.core.lam - 1) = 1 - d.core.lam := by |
| 1212 | field_simp [d.core.lam_pos.ne'] |
| 1213 | rw [hid] at hm |
| 1214 | linarith [d.core.lam_pos] |
| 1215 | |
| 1216 | theorem lambda_finite_length_bound (d : TailData) : |
| 1217 | d.core.lam * (d.releaseStart - d.core.endpoint) ≤ flattenLength + 30 := by |
| 1218 | have hf := mul_le_mul_of_nonneg_right (show d.core.lam ≤ 1 by linarith [d.core.lam_lt]) flattenLength_pos.le |
| 1219 | have hl := lambda_log_bound d |
| 1220 | dsimp [TailData.releaseStart, TailData.flattenEnd, TailData.uniformWait] |
| 1221 | linarith |
| 1222 | |
| 1223 | noncomputable def finiteNumeratorConstant : ℝ := |
| 1224 | 5 * (flattenLength + releaseConstant + 40 + 20 * (flattenLength + 30)) + |
| 1225 | 12 * CorrectedPressureBounds.correctedConstant |
| 1226 | |
| 1227 | theorem finiteNumeratorConstant_pos : 0 < finiteNumeratorConstant := by |
| 1228 | dsimp [finiteNumeratorConstant] |
| 1229 | have := flattenLength_pos |
| 1230 | have := releaseConstant_pos |
| 1231 | have := CorrectedPressureBounds.correctedConstant_pos |
| 1232 | positivity |
| 1233 | |
| 1234 | theorem finiteNumeratorBudget_bound (d : TailData) : |
| 1235 | d.core.lam * finiteNumeratorBudget d ≤ finiteNumeratorConstant := by |
| 1236 | have hl : d.core.lam ≤ 1 := by linarith [d.core.lam_lt] |
| 1237 | have hbase := mul_le_mul_of_nonneg_right hl |
| 1238 | (show 0 ≤ flattenLength + releaseConstant + 40 by linarith [flattenLength_pos, releaseConstant_pos]) |
| 1239 | have hP := mul_le_mul_of_nonneg_right hl CorrectedPressureBounds.correctedConstant_pos.le |
| 1240 | have hlen := lambda_finite_length_bound d |
| 1241 | dsimp [finiteNumeratorBudget, finiteEnergyBudget, finiteNumeratorConstant] |
| 1242 | linarith |
| 1243 | |
| 1244 | /-! ## A lower amplitude bound up to release |
| 1245 | |
| 1246 | The finite waiting interval loses only eighteen powers of `lam`, whereas the |
| 1247 | earlier scheduled wait has already supplied thirty powers. |
| 1248 | -/ |
| 1249 | |
| 1250 | theorem flattenFactor_ge_half (d : TailData) (eta y : ℝ) : 1 / 2 ≤ flattenFactor d (y, eta) := by |
| 1251 | have hJ : 0 ≤ logShape eta := Real.log_nonneg (by linarith [sq_nonneg eta]) |
| 1252 | have hlog : 0 ≤ Real.log (2 : ℝ) := Real.log_nonneg (by norm_num) |
| 1253 | have hm := mul_le_mul_of_nonneg_right (sigma_le_one ((y - d.core.endpoint) / flattenLength)) hlog |
| 1254 | have hp := mul_nonneg (sigma_nonneg ((y - d.core.endpoint) / flattenLength)) hJ |
| 1255 | have hh : -Real.log 2 ≤ sigma ((y - d.core.endpoint) / flattenLength) * (logShape eta - Real.log 2) := by |
| 1256 | linarith |
| 1257 | have he := Real.exp_le_exp.mpr hh |
| 1258 | simp only [Real.exp_neg, Real.exp_log (by norm_num : (0 : ℝ) < 2), inv_eq_one_div] at he |
| 1259 | exact he |
| 1260 | |
| 1261 | noncomputable def finiteAmplitudeConstant : ℝ := Real.exp (-(3 / 5 : ℝ) * flattenLength) / 4 |
| 1262 | |
| 1263 | theorem finiteAmplitudeConstant_pos : 0 < finiteAmplitudeConstant := div_pos (Real.exp_pos _) (by norm_num) |
| 1264 | |
| 1265 | theorem corrected_amplitude_finite_lower {d : TailData} {K : ℝ} (w : ResetWitness d K) |
| 1266 | (eta : ℝ) {y : ℝ} (hy : d.core.endpoint ≤ y) (hy' : y ≤ d.releaseStart) : |
| 1267 | finiteAmplitudeConstant * finalAngular d (d.core.endpoint, eta) * d.core.lam ^ (18 : ℕ) ≤ |
| 1268 | OutgoingHistories.E w (y, eta) := by |
| 1269 | have hE := finalAngular_pos d (d.core.endpoint, eta) |
| 1270 | have hr := radialAmplitude_hold d.core.dropLength_pos.le (coreEndpoint_ge_hold d) hy |
| 1271 | (P := d.core.P) (lam := d.core.lam) |
| 1272 | have hang : angular d.core.P d.core.dropLength d.core.lam (y, eta) = |
| 1273 | finalAngular d (d.core.endpoint, eta) * Real.exp (-(1 / 2 + d.core.lam) * (y - d.core.endpoint)) := by |
| 1274 | rw [finalAngular_before d eta le_rfl] |
| 1275 | dsimp [angular] |
| 1276 | rw [hr] |
| 1277 | ring |
| 1278 | have hpow : Real.exp (-(3 / 5 : ℝ) * (d.releaseStart - d.core.endpoint)) = |
| 1279 | Real.exp (-(3 / 5 : ℝ) * flattenLength) * d.core.lam ^ (18 : ℕ) := by |
| 1280 | have h18 : Real.exp (-(18 : ℝ) * Real.log (1 / d.core.lam)) = d.core.lam ^ (18 : ℕ) := by |
| 1281 | simpa using OutgoingPulseBounds.exp_log_inverse_nat d.core.lam_pos 18 |
| 1282 | rw [show -(3 / 5 : ℝ) * (d.releaseStart - d.core.endpoint) = |
| 1283 | -(3 / 5 : ℝ) * flattenLength + -(18 : ℝ) * Real.log (1 / d.core.lam) by |
| 1284 | dsimp [TailData.releaseStart, TailData.flattenEnd, TailData.uniformWait]; ring, |
| 1285 | Real.exp_add, h18] |
| 1286 | have hrate : -(3 / 5 : ℝ) * (d.releaseStart - d.core.endpoint) ≤ |
| 1287 | -(1 / 2 + d.core.lam) * (y - d.core.endpoint) := by |
| 1288 | have hm := mul_le_mul_of_nonneg_right (show 1 / 2 + d.core.lam ≤ (3 / 5 : ℝ) by linarith [d.core.lam_lt]) |
| 1289 | (sub_nonneg.mpr hy) |
| 1290 | linarith |
| 1291 | have he := Real.exp_le_exp.mpr hrate |
| 1292 | rw [hpow] at he |
| 1293 | have hflat := flattenFactor_ge_half d eta y |
| 1294 | have hrel := resetFactor_ge_half w eta y |
| 1295 | have he1 := mul_le_mul_of_nonneg_left he hE.le |
| 1296 | have he2 := mul_le_mul he1 hflat (by norm_num : (0 : ℝ) ≤ 1 / 2) |
| 1297 | (mul_nonneg hE.le (Real.exp_pos _).le) |
| 1298 | have he3 := mul_le_mul he2 hrel (by norm_num : (0 : ℝ) ≤ 1 / 2) |
| 1299 | (mul_nonneg (mul_nonneg hE.le (Real.exp_pos _).le) (by linarith : 0 ≤ flattenFactor d (y, eta))) |
| 1300 | change _ ≤ finalAngular d (y, eta) * (1 + resetRelative w eta y) |
| 1301 | rw [TailEnergyBounds.finalAngular_before_release d eta hy'] |
| 1302 | dsimp only [flattened] |
| 1303 | rw [hang] |
| 1304 | dsimp [finiteAmplitudeConstant] |
| 1305 | linarith |
| 1306 | |
| 1307 | theorem endpointAmplitude_le_pulse (d : TailData) (eta : ℝ) : |
| 1308 | finalAngular d (d.core.endpoint, eta) ≤ pulseAmplitude d.core := by |
| 1309 | have hy : d.core.pulseStart ≤ d.core.endpoint := by |
| 1310 | dsimp [OutgoingSchedule.Parameters.endpoint] |
| 1311 | linarith [d.core.pulseLength_pos] |
| 1312 | have hr := radialAmplitude_hold d.core.dropLength_pos.le d.core.pulseStart_ge_hold hy |
| 1313 | (P := d.core.P) (lam := d.core.lam) |
| 1314 | rw [finalAngular_before d eta le_rfl] |
| 1315 | dsimp [angular] |
| 1316 | rw [hr] |
| 1317 | change pulseAmplitude d.core * Real.exp (-(1 / 2 + d.core.lam) * (d.core.endpoint - d.core.pulseStart)) * |
| 1318 | shape eta ≤ pulseAmplitude d.core |
| 1319 | have he : Real.exp (-(1 / 2 + d.core.lam) * (d.core.endpoint - d.core.pulseStart)) ≤ 1 := |
| 1320 | Real.exp_le_one_iff.mpr (by nlinarith [d.core.lam_pos]) |
| 1321 | have hs : shape eta ≤ 1 := by |
| 1322 | dsimp [shape] |
| 1323 | rw [← one_div] |
| 1324 | apply (div_le_one (by positivity)).mpr |
| 1325 | linarith [sq_nonneg eta] |
| 1326 | have hm := mul_le_mul he hs (shape_pos eta).le (by norm_num : (0 : ℝ) ≤ 1) |
| 1327 | have hp := mul_le_mul_of_nonneg_left hm (pulseAmplitude_pos d.core).le |
| 1328 | linarith |
| 1329 | |
| 1330 | noncomputable def finiteConeConstant (P m : ℝ) : ℝ := |
| 1331 | (4 * finiteNumeratorConstant / finiteAmplitudeConstant) * (P * Real.exp (Real.exp m + 12)) |
| 1332 | |
| 1333 | theorem finiteConeConstant_pos {P : ℝ} (hP : 0 < P) (m : ℝ) : 0 < finiteConeConstant P m := by |
| 1334 | dsimp [finiteConeConstant] |
| 1335 | exact mul_pos (div_pos (mul_pos (by norm_num) finiteNumeratorConstant_pos) finiteAmplitudeConstant_pos) |
| 1336 | (mul_pos hP (Real.exp_pos _)) |
| 1337 | |
| 1338 | theorem actual_finite_ratio_bound {d : TailData} {K : ℝ} (w : ResetWitness d K) |
| 1339 | {Amp : ℝ → ℝ} (ha : ContDiff ℝ ∞ Amp) |
| 1340 | (hwait : d.core.wait = 60 * Real.log (1 / d.core.lam)) |
| 1341 | (hsmall : K * d.core.lam ^ (28 : ℕ) ≤ 1) (eta : ℝ) (heta : |eta| ≤ 1) |
| 1342 | (hz : ∀ᶠ q in 𝓝 eta, CorrectedPulseAmplitude.totalEnergy d w.coefficients (Amp q) q = 0) |
| 1343 | {y : ℝ} (hy : d.core.endpoint ≤ y) (hy' : y ≤ d.releaseStart) |
| 1344 | (hQ : d.core.lam / 4 ≤ OutgoingHistories.Qs w Amp (y, eta)) : |
| 1345 | |OutgoingHistories.Ns w Amp (y, eta) / |
| 1346 | (OutgoingHistories.E w (y, eta) * OutgoingHistories.Qs w Amp (y, eta))| ≤ |
| 1347 | finiteConeConstant d.core.P d.core.m * d.core.lam ^ (10 : ℕ) := by |
| 1348 | have he := corrected_amplitude_finite_lower w eta hy hy' |
| 1349 | have hq : 0 < OutgoingHistories.Qs w Amp (y, eta) := lt_of_lt_of_le (by linarith [d.core.lam_pos]) hQ |
| 1350 | have hden := mul_pos (OutgoingHistories.E_pos w (y, eta)) hq |
| 1351 | have hnum := actualNs_finite_bound w ha hsmall eta heta hz hy hy' |
| 1352 | have hbud : finiteNumeratorBudget d ≤ finiteNumeratorConstant / d.core.lam := |
| 1353 | (le_div_iff₀ d.core.lam_pos).mpr (by linarith [finiteNumeratorBudget_bound d]) |
| 1354 | have hend := (endpointAmplitude_le_pulse d eta).trans (OutgoingPulseBounds.pulseAmplitude_small d.core hwait) |
| 1355 | have hE := finalAngular_pos d (d.core.endpoint, eta) |
| 1356 | have he0 : 0 < finiteAmplitudeConstant * finalAngular d (d.core.endpoint, eta) * d.core.lam ^ (18 : ℕ) := |
| 1357 | mul_pos (mul_pos finiteAmplitudeConstant_pos hE) (pow_pos d.core.lam_pos _) |
| 1358 | have hdl := mul_le_mul he hQ (by linarith [d.core.lam_pos] : (0 : ℝ) ≤ d.core.lam / 4) |
| 1359 | (OutgoingHistories.E_pos w (y, eta)).le |
| 1360 | have hdl0 : 0 < finiteAmplitudeConstant * finalAngular d (d.core.endpoint, eta) * |
| 1361 | d.core.lam ^ (18 : ℕ) * (d.core.lam / 4) := mul_pos he0 (by linarith [d.core.lam_pos]) |
| 1362 | rw [abs_div, abs_of_pos hden] |
| 1363 | calc |
| 1364 | _ ≤ (finiteNumeratorConstant / d.core.lam * finalAngular d (d.core.endpoint, eta) ^ 2) / |
| 1365 | (finiteAmplitudeConstant * finalAngular d (d.core.endpoint, eta) * d.core.lam ^ (18 : ℕ) * (d.core.lam / 4)) := |
| 1366 | div_le_div₀ (mul_nonneg (div_nonneg finiteNumeratorConstant_pos.le d.core.lam_pos.le) (sq_nonneg _)) |
| 1367 | (hnum.trans (mul_le_mul_of_nonneg_right hbud (sq_nonneg _))) hdl0 hdl |
| 1368 | _ = (4 * finiteNumeratorConstant / finiteAmplitudeConstant) * |
| 1369 | (finalAngular d (d.core.endpoint, eta) / d.core.lam ^ (20 : ℕ)) := by |
| 1370 | field_simp [d.core.lam_pos.ne', hE.ne', finiteAmplitudeConstant_pos.ne'] |
| 1371 | _ ≤ (4 * finiteNumeratorConstant / finiteAmplitudeConstant) * |
| 1372 | ((d.core.P * Real.exp (Real.exp d.core.m + 12)) * d.core.lam ^ (30 : ℕ) / d.core.lam ^ (20 : ℕ)) := |
| 1373 | mul_le_mul_of_nonneg_left (div_le_div_of_nonneg_right hend (pow_pos d.core.lam_pos _).le) |
| 1374 | (div_nonneg (mul_nonneg (by norm_num) finiteNumeratorConstant_pos.le) finiteAmplitudeConstant_pos.le) |
| 1375 | _ = _ := by |
| 1376 | have hp : d.core.lam ^ (30 : ℕ) / d.core.lam ^ (20 : ℕ) = d.core.lam ^ (10 : ℕ) := by |
| 1377 | field_simp [d.core.lam_pos.ne'] |
| 1378 | rw [show (d.core.P * Real.exp (Real.exp d.core.m + 12)) * d.core.lam ^ (30 : ℕ) / |
| 1379 | d.core.lam ^ (20 : ℕ) = (d.core.P * Real.exp (Real.exp d.core.m + 12)) * |
| 1380 | (d.core.lam ^ (30 : ℕ) / d.core.lam ^ (20 : ℕ)) by ring, hp] |
| 1381 | dsimp [finiteConeConstant] |
| 1382 | ring |
| 1383 | |
| 1384 | /-! ## Cone quantities of the actual corrected profile -/ |
| 1385 | |
| 1386 | noncomputable def actualA {d : TailData} {K : ℝ} (w : ResetWitness d K) (y eta : ℝ) : ℝ := |
| 1387 | 1 - 2 * deriv (fun t => Real.log (OutgoingHistories.E w (t, eta))) y |
| 1388 | |
| 1389 | noncomputable def actualBs {d : TailData} {K : ℝ} (w : ResetWitness d K) |
| 1390 | (Amp : ℝ → ℝ) (y eta : ℝ) : ℝ := |
| 1391 | 2 * deriv (fun t => OutgoingHistories.U d Amp (t, eta)) y / OutgoingHistories.E w (y, eta) |
| 1392 | |
| 1393 | theorem actualA_finite {d : TailData} {K : ℝ} (w : ResetWitness d K) (eta : ℝ) {y : ℝ} |
| 1394 | (hy : d.core.endpoint ≤ y) (hy' : y < d.releaseStart) : |
| 1395 | actualA w y eta = 2 - 2 * correctedFlatSlope w eta y := by |
| 1396 | have hd := (correctedFlat_hasDerivAt w eta hy hy').log (OutgoingHistories.E_pos w (y, eta)).ne' |
| 1397 | unfold actualA |
| 1398 | rw [hd.deriv] |
| 1399 | change 1 - 2 * (OutgoingHistories.E w (y, eta) * (correctedFlatSlope w eta y - 1 / 2) / |
| 1400 | OutgoingHistories.E w (y, eta)) = _ |
| 1401 | field_simp [(OutgoingHistories.E_pos w (y, eta)).ne'] ; ring |
| 1402 | |
| 1403 | theorem actualA_release {d : TailData} {K : ℝ} (w : ResetWitness d K) (eta : ℝ) {y : ℝ} |
| 1404 | (hy : d.releaseStart ≤ y) : actualA w y eta = releaseA d y := |
| 1405 | corrected_releaseA d w.coefficients eta hy |
| 1406 | |
| 1407 | theorem actualBs_zero {d : TailData} {K : ℝ} (w : ResetWitness d K) |
| 1408 | {Amp : ℝ → ℝ} (ha : ContDiff ℝ ∞ Amp) (eta : ℝ) {y : ℝ} (hy : d.core.endpoint ≤ y) : |
| 1409 | actualBs w Amp y eta = 0 := by |
| 1410 | have hf : Differentiable ℝ (fun t => OutgoingHistories.U d Amp (t, eta)) := |
| 1411 | ((OutgoingHistories.U_smooth d ha).comp (contDiff_id.prodMk contDiff_const)).differentiable (by simp) |
| 1412 | have hz : HasDerivWithinAt (fun t => OutgoingHistories.U d Amp (t, eta)) 0 (Ici y) y := by |
| 1413 | apply (hasDerivWithinAt_const y (Ici y) (0 : ℝ)).congr |
| 1414 | · intro t ht |
| 1415 | exact OutgoingHistories.U_after_endpoint d Amp eta (hy.trans ht) |
| 1416 | · exact OutgoingHistories.U_after_endpoint d Amp eta hy |
| 1417 | have hd : deriv (fun t => OutgoingHistories.U d Amp (t, eta)) y = 0 := |
| 1418 | (uniqueDiffOn_Ici y y (show y ∈ Ici y from le_refl y)).eq_deriv _ (hf y).hasDerivAt.hasDerivWithinAt hz |
| 1419 | simp [actualBs, hd] |
| 1420 | |
| 1421 | theorem actualP2_eq {d : TailData} {K : ℝ} (w : ResetWitness d K) |
| 1422 | (Amp : ℝ → ℝ) (XR eta y : ℝ) (heta : eta ^ 2 ≤ 1) |
| 1423 | (hQ : 0 < OutgoingHistories.Qs w Amp (y, eta)) : |
| 1424 | OutgoingHistories.p2 XR w Amp (y, eta) = OutgoingHistories.p1 XR w Amp (y, eta) * |
| 1425 | (OutgoingHistories.Ns w Amp (y, eta) / |
| 1426 | (OutgoingHistories.E w (y, eta) * OutgoingHistories.Qs w Amp (y, eta))) := by |
| 1427 | have hL := CoordinateAlgebra.L_pos d.h_pos.le d.h_lt_half heta |
| 1428 | change 0 < 1 - 2 * d.h * eta ^ 2 at hL |
| 1429 | dsimp [OutgoingHistories.p1, OutgoingHistories.p2] |
| 1430 | field_simp [hL.ne', hQ.ne', (OutgoingHistories.E_pos w (y, eta)).ne'] |
| 1431 | |
| 1432 | noncomputable def finiteRadiusThreshold (d : TailData) : ℝ := |
| 1433 | 16 / (Real.exp d.core.endpoint * (d.core.lam / 4)) |
| 1434 | |
| 1435 | theorem finiteRadiusThreshold_pos (d : TailData) : 0 < finiteRadiusThreshold d := |
| 1436 | div_pos (by norm_num) (mul_pos (Real.exp_pos _) (div_pos d.core.lam_pos (by norm_num))) |
| 1437 | |
| 1438 | theorem actualP1_finite_large {d : TailData} {K : ℝ} (w : ResetWitness d K) |
| 1439 | (Amp : ℝ → ℝ) {XR eta y : ℝ} (hXR : finiteRadiusThreshold d < XR) (heta : eta ^ 2 ≤ 1) |
| 1440 | (hy : d.core.endpoint ≤ y) (hQ : d.core.lam / 4 ≤ OutgoingHistories.Qs w Amp (y, eta)) : |
| 1441 | 16 < OutgoingHistories.p1 XR w Amp (y, eta) := by |
| 1442 | have hL := CoordinateAlgebra.L_pos d.h_pos.le d.h_lt_half heta |
| 1443 | have hL1 : CoordinateAlgebra.L d.h eta ≤ 1 := by |
| 1444 | dsimp [CoordinateAlgebra.L] |
| 1445 | linarith [mul_nonneg d.h_pos.le (sq_nonneg eta)] |
| 1446 | have hXR0 := (finiteRadiusThreshold_pos d).trans hXR |
| 1447 | have hscale : 16 < XR * (Real.exp d.core.endpoint * (d.core.lam / 4)) := |
| 1448 | (div_lt_iff₀ (mul_pos (Real.exp_pos _) (div_pos d.core.lam_pos (by norm_num)))).mp hXR |
| 1449 | have hprod := mul_le_mul (Real.exp_le_exp.mpr hy) hQ |
| 1450 | (div_nonneg d.core.lam_pos.le (by norm_num : (0 : ℝ) ≤ 4)) (Real.exp_pos y).le |
| 1451 | have hp := mul_le_mul_of_nonneg_left hprod hXR0.le |
| 1452 | change 16 < XR * Real.exp y * OutgoingHistories.Qs w Amp (y, eta) / CoordinateAlgebra.L d.h eta |
| 1453 | apply (lt_div_iff₀ hL).mpr |
| 1454 | linarith |
| 1455 | |
| 1456 | theorem corrected_amplitude_energy_zero_germ {d : TailData} {K : ℝ} (w : ResetWitness d K) |
| 1457 | (hK : 0 < K) (hwait : d.core.wait = 60 * Real.log (1 / d.core.lam)) |
| 1458 | (hsmall : d.core.lam ≤ 1 / 120) (hscale : CorrectedPulseAmplitude.combinedScale d K ≤ 1 / 1000) |
| 1459 | (eta : ℝ) (heta : eta ^ 2 ≤ 1) : |
| 1460 | ∀ᶠ q in 𝓝 eta, CorrectedPulseAmplitude.totalEnergy d w.coefficients |
| 1461 | (CorrectedPulseAmplitude.amplitude d w.coefficients q) q = 0 := by |
| 1462 | have h := CorrectedPulseAmplitude.numerical_coefficient_bounds d w.coefficients eta |
| 1463 | (CorrectedPulseAmplitude.combinedScale d K) heta |
| 1464 | (CorrectedPulseAmplitude.old_error_bounds d K hK hsmall hwait eta heta) |
| 1465 | (CorrectedPulseAmplitude.energyShift_bounds w hK eta heta).1 hscale |
| 1466 | apply amplitude_energy_zero_germ w eta |
| 1467 | linarith [h.2.2.2.2] |
| 1468 | |
| 1469 | theorem reset_scale_le_one {d : TailData} {K : ℝ} (w : ResetWitness d K) |
| 1470 | (hreset : resetSourceError d K ≤ d.core.lam / 4) : K * d.core.lam ^ (28 : ℕ) ≤ 1 := by |
| 1471 | have h0 := ResetEnergyBounds.coefficient_scale_nonneg w |
| 1472 | have hp := mul_nonneg resetJetConstant_pos.le h0 |
| 1473 | dsimp [resetSourceError] at hreset |
| 1474 | linarith [d.core.lam_lt] |
| 1475 | |
| 1476 | noncomputable def tailRadiusThreshold (d : TailData) : ℝ := |
| 1477 | max (finiteRadiusThreshold d) (releaseRadiusThreshold d) |
| 1478 | |
| 1479 | /-- All quantities are those of the corrected profile and its actual integral |
| 1480 | histories. The scalar smallness conditions are arranged by the thresholds below. -/ |
| 1481 | theorem corrected_tail_cone {d : TailData} {K : ℝ} (w : ResetWitness d K) |
| 1482 | (hK : 0 < K) (hwait : d.core.wait = 60 * Real.log (1 / d.core.lam)) |
| 1483 | (hsmall : d.core.lam ≤ 1 / 120) (hscale : CorrectedPulseAmplitude.combinedScale d K ≤ 1 / 1000) |
| 1484 | (hpulse : PulseCone.sourceConstant d.core.P d.core.m * d.core.lam ^ (29 : ℕ) ≤ 1 / 8) |
| 1485 | (hh1 : d.h ≤ 1 / 100) (hhT : d.h ≤ Real.exp (-(d.core.holdStart + 3 / 5)) / 8) |
| 1486 | (hreset : resetSourceError d K ≤ d.core.lam / 4) |
| 1487 | (hfinite : finiteConeConstant d.core.P d.core.m * d.core.lam ^ (10 : ℕ) ≤ 1 / 2) |
| 1488 | (hrelease : releaseConeConstant d.core.P d.core.m * d.core.lam ^ (29 : ℕ) ≤ 1 / 2) |
| 1489 | {XR eta y : ℝ} (hXR : tailRadiusThreshold d < XR) (heta : |eta| ≤ 1) |
| 1490 | (hy : d.core.endpoint ≤ y) (hy' : y ≤ tailStart d + 1 / 2) : |
| 1491 | 0 < OutgoingHistories.Qs w (CorrectedPulseAmplitude.amplitude d w.coefficients) (y, eta) ∧ |
| 1492 | actualBs w (CorrectedPulseAmplitude.amplitude d w.coefficients) y eta = 0 ∧ |
| 1493 | 2 < actualA w y eta ∧ actualA w y eta ≤ 4 ∧ |
| 1494 | 2 < OutgoingHistories.p1 XR w (CorrectedPulseAmplitude.amplitude d w.coefficients) (y, eta) ∧ |
| 1495 | actualA w y eta < ConeAlgebra.coneBound |
| 1496 | (OutgoingHistories.p1 XR w (CorrectedPulseAmplitude.amplitude d w.coefficients) (y, eta)) |
| 1497 | (OutgoingHistories.p2 XR w (CorrectedPulseAmplitude.amplitude d w.coefficients) (y, eta)) := by |
| 1498 | let Amp := CorrectedPulseAmplitude.amplitude d w.coefficients |
| 1499 | have ha : ContDiff ℝ ∞ Amp := CorrectedPulseAmplitude.amplitude_contDiff d w.smooth |
| 1500 | have heta2 : eta ^ 2 ≤ 1 := by have h := abs_le.mp heta; nlinarith |
| 1501 | have hz := corrected_amplitude_energy_zero_germ w hK hwait hsmall hscale eta heta2 |
| 1502 | have hb := actualBs_zero w ha eta hy |
| 1503 | by_cases hyr : y < d.releaseStart |
| 1504 | · have hQ := corrected_flatten_Qs_lower w hK hwait hsmall hscale hpulse hh1 hhT hreset eta heta hy hyr.le |
| 1505 | have hQ0 : 0 < OutgoingHistories.Qs w Amp (y, eta) := by |
| 1506 | change 0 < OutgoingHistories.Qs w (CorrectedPulseAmplitude.amplitude d w.coefficients) (y, eta) |
| 1507 | linarith [d.core.lam_pos] |
| 1508 | have har := correctedFlat_geometry w hreset eta y heta2 |
| 1509 | have hAw := actualA_finite w eta hy hyr |
| 1510 | have hratio := (actual_finite_ratio_bound w ha hwait (reset_scale_le_one w hreset) eta heta hz hy hyr.le hQ).trans hfinite |
| 1511 | have hp := actualP1_finite_large w Amp ((le_max_left _ _).trans_lt hXR) heta2 hy hQ |
| 1512 | have hc := cone_of_zero_bs (a := actualA w y eta) (by rw [hAw]; exact har.1) |
| 1513 | (by rw [hAw]; exact har.2.1) hratio hp |
| 1514 | refine ⟨hQ0, hb, hc.2.1, ?_, hc.1, ?_⟩ |
| 1515 | · rw [hAw]; exact har.2.1 |
| 1516 | · rw [actualP2_eq w Amp XR eta y heta2 hQ0] |
| 1517 | exact hc.2.2 |
| 1518 | · have hR : d.releaseStart ≤ y := le_of_not_gt hyr |
| 1519 | have hQ : 0 < OutgoingHistories.Qs w Amp (y, eta) := by |
| 1520 | rw [actualQs_eq_normalizedLag w ha eta hR] |
| 1521 | exact normalizedLag_pos w eta hR hy' |
| 1522 | have hratio : |OutgoingHistories.Ns w Amp (y, eta) / |
| 1523 | (OutgoingHistories.E w (y, eta) * OutgoingHistories.Qs w Amp (y, eta))| ≤ 1 / 2 := by |
| 1524 | rw [actualRatio_eq_releaseVelocityRatio w ha eta hR hz] |
| 1525 | exact (releaseVelocityRatio_uniform w hwait heta hR hy').trans hrelease |
| 1526 | have hp : 16 < OutgoingHistories.p1 XR w Amp (y, eta) := by |
| 1527 | change 16 < XR * Real.exp y * OutgoingHistories.Qs w Amp (y, eta) / CoordinateAlgebra.L d.h eta |
| 1528 | rw [actualQs_eq_normalizedLag w ha eta hR] |
| 1529 | exact releaseP1_large w ((le_max_right _ _).trans_lt hXR) heta2 hR hy' |
| 1530 | have har := releaseA_bounds d y |
| 1531 | have hAw := actualA_release w eta hR |
| 1532 | have hc := cone_of_zero_bs (a := actualA w y eta) (by rw [hAw]; exact har.1) |
| 1533 | (by rw [hAw]; exact har.2) hratio hp |
| 1534 | refine ⟨hQ, hb, hc.2.1, ?_, hc.1, ?_⟩ |
| 1535 | · rw [hAw]; exact har.2 |
| 1536 | · rw [actualP2_eq w Amp XR eta y heta2 hQ] |
| 1537 | exact hc.2.2 |
| 1538 | |
| 1539 | /-! ## Simultaneous parameter choice, uniform in the terminal parameter -/ |
| 1540 | |
| 1541 | theorem lambda_power_le_self (d : TailData) (n : ℕ) : d.core.lam ^ (n + 1) ≤ d.core.lam := by |
| 1542 | have hp := pow_le_one₀ d.core.lam_pos.le (show d.core.lam ≤ 1 by linarith [d.core.lam_lt]) (n := n) |
| 1543 | rw [pow_succ] |
| 1544 | nlinarith [d.core.lam_pos] |
| 1545 | |
| 1546 | theorem exists_finite_cone_threshold (P m : ℝ) (hP : 0 < P) : |
| 1547 | ∃ lam0 : ℝ, 0 < lam0 ∧ ∀ d : TailData, d.core.P = P → d.core.m = m → |
| 1548 | d.core.lam < lam0 → finiteConeConstant d.core.P d.core.m * d.core.lam ^ (10 : ℕ) < 1 / 2 := by |
| 1549 | have hC := finiteConeConstant_pos hP m |
| 1550 | refine ⟨(1 / 2) / finiteConeConstant P m, div_pos (by norm_num) hC, ?_⟩ |
| 1551 | intro d hdP hdm hlam |
| 1552 | rw [hdP, hdm] |
| 1553 | have hpow : d.core.lam ^ (10 : ℕ) ≤ d.core.lam := lambda_power_le_self d 9 |
| 1554 | have hsmall := (lt_div_iff₀ hC).mp hlam |
| 1555 | have hp := mul_le_mul_of_nonneg_left hpow hC.le |
| 1556 | nlinarith |
| 1557 | |
| 1558 | theorem exists_reset_source_threshold (K : ℝ) (hK : 0 < K) : |
| 1559 | ∃ lam0 : ℝ, 0 < lam0 ∧ ∀ d : TailData, d.core.lam < lam0 → |
| 1560 | resetSourceError d K ≤ d.core.lam / 4 := by |
| 1561 | let C : ℝ := (2 * resetJetConstant + 2) * K |
| 1562 | have hC : 0 < C := mul_pos (by linarith [resetJetConstant_pos]) hK |
| 1563 | refine ⟨(1 / 4) / C, div_pos (by norm_num) hC, ?_⟩ |
| 1564 | intro d hlam |
| 1565 | have hpow : d.core.lam ^ (27 : ℕ) ≤ d.core.lam := lambda_power_le_self d 26 |
| 1566 | have hc := (lt_div_iff₀ hC).mp hlam |
| 1567 | have hp := mul_le_mul_of_nonneg_left hpow hC.le |
| 1568 | have hb : C * d.core.lam ^ (27 : ℕ) ≤ 1 / 4 := by linarith |
| 1569 | calc |
| 1570 | resetSourceError d K = d.core.lam * (C * d.core.lam ^ (27 : ℕ)) := by |
| 1571 | dsimp [resetSourceError, C]; ring |
| 1572 | _ ≤ d.core.lam * (1 / 4) := mul_le_mul_of_nonneg_left hb d.core.lam_pos.le |
| 1573 | _ = _ := by ring |
| 1574 | |
| 1575 | theorem exists_tail_smallness_threshold (P m K : ℝ) (hP : 0 < P) (hK : 0 < K) : |
| 1576 | ∃ lam0 : ℝ, 0 < lam0 ∧ ∀ d : TailData, d.core.P = P → d.core.m = m → d.core.lam < lam0 → |
| 1577 | d.core.lam ≤ 1 / 120 ∧ CorrectedPulseAmplitude.combinedScale d K ≤ 1 / 1000 ∧ |
| 1578 | PulseCone.sourceConstant d.core.P d.core.m * d.core.lam ^ (29 : ℕ) ≤ 1 / 8 ∧ |
| 1579 | d.h ≤ 1 / 100 ∧ d.h ≤ Real.exp (-(d.core.holdStart + 3 / 5)) / 8 ∧ |
| 1580 | resetSourceError d K ≤ d.core.lam / 4 ∧ |
| 1581 | finiteConeConstant d.core.P d.core.m * d.core.lam ^ (10 : ℕ) ≤ 1 / 2 ∧ |
| 1582 | releaseConeConstant d.core.P d.core.m * d.core.lam ^ (29 : ℕ) ≤ 1 / 2 := by |
| 1583 | obtain ⟨rate, hrate, Hrate⟩ := PulseAmplitude.exists_rate_threshold (CorrectedPulseAmplitude.combinedConstant P m K) |
| 1584 | obtain ⟨finite, hfinite, Hfinite⟩ := exists_finite_cone_threshold P m hP |
| 1585 | obtain ⟨release, hrelease, Hrelease⟩ := exists_release_cone_threshold P m hP |
| 1586 | obtain ⟨reset, hreset, Hreset⟩ := exists_reset_source_threshold K hK |
| 1587 | let source : ℝ := (1 / 8) / PulseCone.sourceConstant P m |
| 1588 | let incoming : ℝ := Real.exp (-(Real.exp m + 12 + 3 / 5)) / 4 |
| 1589 | have hsource : 0 < source := div_pos (by norm_num) (PulseCone.sourceConstant_pos hP m) |
| 1590 | have hincoming : 0 < incoming := div_pos (Real.exp_pos _) (by norm_num) |
| 1591 | refine ⟨min rate (min finite (min release (min reset (min source (min (1 / 120) incoming))))), |
| 1592 | lt_min hrate (lt_min hfinite (lt_min hrelease (lt_min hreset (lt_min hsource (lt_min (by norm_num) hincoming))))), ?_⟩ |
| 1593 | intro d hdP hdm hlam |
| 1594 | rcases lt_min_iff.mp hlam with ⟨hlrate, hlam⟩ |
| 1595 | rcases lt_min_iff.mp hlam with ⟨hlfinite, hlam⟩ |
| 1596 | rcases lt_min_iff.mp hlam with ⟨hlrelease, hlam⟩ |
| 1597 | rcases lt_min_iff.mp hlam with ⟨hlreset, hlam⟩ |
| 1598 | rcases lt_min_iff.mp hlam with ⟨hlsource, hlam⟩ |
| 1599 | rcases lt_min_iff.mp hlam with ⟨hlnum, hlincoming⟩ |
| 1600 | refine ⟨hlnum.le, ?_, ?_, ?_, ?_, Hreset d hlreset, (Hfinite d hdP hdm hlfinite).le, |
| 1601 | (Hrelease d hdP hdm hlrelease).le⟩ |
| 1602 | · unfold CorrectedPulseAmplitude.combinedScale |
| 1603 | rw [hdP, hdm] |
| 1604 | exact Hrate _ d.core.lam_pos hlrate |
| 1605 | · rw [hdP, hdm] |
| 1606 | have hs : d.core.lam * PulseCone.sourceConstant P m < 1 / 8 := |
| 1607 | (lt_div_iff₀ (PulseCone.sourceConstant_pos hP m)).mp hlsource |
| 1608 | have hp : d.core.lam ^ (29 : ℕ) ≤ d.core.lam := lambda_power_le_self d 28 |
| 1609 | have hm := mul_le_mul_of_nonneg_left hp (PulseCone.sourceConstant_pos hP m).le |
| 1610 | linarith |
| 1611 | · linarith [d.h_small] |
| 1612 | · have hhold : d.core.holdStart = Real.exp m + 12 := by |
| 1613 | dsimp [OutgoingSchedule.Parameters.holdStart, OutgoingSchedule.Parameters.dropLength] |
| 1614 | rw [hdm] |
| 1615 | ring |
| 1616 | rw [hhold] |
| 1617 | dsimp [incoming] at hlincoming |
| 1618 | linarith [d.h_small] |
| 1619 | |
| 1620 | end NavierStokes.TailCone |