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