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.SchedulePressure |
| 2 | import NavierStokes.ProfileHistories |
| 3 | import NavierStokes.OutgoingPulseBounds |
| 4 | import NavierStokes.FuturePressureBounds |
| 5 | import NavierStokes.OutgoingHistories |
| 6 | import NavierStokes.UniformCone |
| 7 | |
| 8 | /-! |
| 9 | # Actual outgoing histories through the axial drop |
| 10 | |
| 11 | All lags below include the ideal incoming history. The scalar averages are |
| 12 | integrals of the constructed schedule, and no cone estimate is assumed. |
| 13 | -/ |
| 14 | |
| 15 | noncomputable section |
| 16 | |
| 17 | namespace NavierStokes.OutgoingEntranceCone |
| 18 | |
| 19 | open Set Filter MeasureTheory |
| 20 | open scoped Topology ContDiff |
| 21 | open OutgoingSchedule OutgoingTail NaturalAxisData |
| 22 | |
| 23 | /-- Exponential averaging with the actual incoming history at clock zero. -/ |
| 24 | noncomputable def historyAverage (b : ℝ → ℝ) (b₀ y : ℝ) : ℝ := |
| 25 | linearLag (fun _ => 1) b b₀ y |
| 26 | |
| 27 | theorem historyAverage_formula (b : ℝ → ℝ) (b₀ y : ℝ) : |
| 28 | historyAverage b b₀ y = Real.exp (-y) * |
| 29 | (b₀ + ∫ t in (0 : ℝ)..y, Real.exp t * b t) := by |
| 30 | simp [historyAverage, linearLag, OutgoingSchedule.primitive] |
| 31 | |
| 32 | theorem historyAverage_initial (b : ℝ → ℝ) (b₀ : ℝ) : historyAverage b b₀ 0 = b₀ := by |
| 33 | simp [historyAverage, linearLag_initial] |
| 34 | |
| 35 | theorem historyAverage_hasDerivAt {b : ℝ → ℝ} (hb : Continuous b) (b₀ y : ℝ) : |
| 36 | HasDerivAt (historyAverage b b₀) (b y - historyAverage b b₀ y) y := by |
| 37 | unfold historyAverage |
| 38 | simpa only [one_mul] using |
| 39 | linearLag_hasDerivAt (a := fun _ : ℝ => (1 : ℝ)) continuous_const hb b₀ y |
| 40 | |
| 41 | theorem historyAverage_contDiff {b : ℝ → ℝ} (hb : ContDiff ℝ ∞ b) (b₀ : ℝ) : |
| 42 | ContDiff ℝ ∞ (historyAverage b b₀) := |
| 43 | linearLag_contDiff contDiff_const hb b₀ |
| 44 | |
| 45 | theorem historyAverage_constant {b : ℝ → ℝ} {b₀ y : ℝ} |
| 46 | (hb : ∀ t ∈ uIcc (0 : ℝ) y, b t = b₀) : historyAverage b b₀ y = b₀ := by |
| 47 | rw [historyAverage_formula] |
| 48 | have he : (∫ t in (0 : ℝ)..y, Real.exp t * b t) = (Real.exp y - 1) * b₀ := by |
| 49 | calc |
| 50 | _ = ∫ t in (0 : ℝ)..y, Real.exp t * b₀ := |
| 51 | intervalIntegral.integral_congr (fun t ht => by rw [hb t ht]) |
| 52 | _ = _ := by rw [intervalIntegral.integral_mul_const, integral_exp]; simp |
| 53 | rw [he] |
| 54 | have hx : Real.exp (-y) * Real.exp y = 1 := by rw [← Real.exp_add]; simp |
| 55 | calc |
| 56 | _ = (Real.exp (-y) * Real.exp y) * b₀ := by ring |
| 57 | _ = b₀ := by rw [hx, one_mul] |
| 58 | |
| 59 | theorem historyAverage_nonneg {b : ℝ → ℝ} {b₀ y : ℝ} |
| 60 | (h₀ : 0 ≤ b₀) (hy : 0 ≤ y) (hb : ∀ t ∈ Icc (0 : ℝ) y, 0 ≤ b t) : |
| 61 | 0 ≤ historyAverage b b₀ y := by |
| 62 | rw [historyAverage_formula] |
| 63 | apply mul_nonneg (Real.exp_pos _).le |
| 64 | exact add_nonneg h₀ (intervalIntegral.integral_nonneg hy |
| 65 | (fun t ht => mul_nonneg (Real.exp_pos _).le (hb t ht))) |
| 66 | |
| 67 | theorem historyAverage_le {b : ℝ → ℝ} (hbc : Continuous b) {b₀ K y : ℝ} |
| 68 | (h₀ : b₀ ≤ K) (hy : 0 ≤ y) (hb : ∀ t ∈ Icc (0 : ℝ) y, b t ≤ K) : |
| 69 | historyAverage b b₀ y ≤ K := by |
| 70 | have hi := intervalIntegral.integral_mono_on (μ := volume) hy |
| 71 | ((Real.continuous_exp.fun_mul hbc).intervalIntegrable 0 y) |
| 72 | ((Real.continuous_exp.fun_mul continuous_const).intervalIntegrable 0 y) |
| 73 | (fun t ht => mul_le_mul_of_nonneg_left (hb t ht) (Real.exp_pos _).le) |
| 74 | rw [intervalIntegral.integral_mul_const, integral_exp] at hi |
| 75 | simp only [Real.exp_zero] at hi |
| 76 | rw [historyAverage_formula] |
| 77 | have he : Real.exp (-y) * Real.exp y = 1 := by rw [← Real.exp_add]; simp |
| 78 | calc |
| 79 | _ ≤ Real.exp (-y) * (K + (Real.exp y - 1) * K) := by gcongr |
| 80 | _ = (Real.exp (-y) * Real.exp y) * K := by ring |
| 81 | _ = K := by rw [he, one_mul] |
| 82 | |
| 83 | theorem historyAverage_late {b : ℝ → ℝ} (hbc : Continuous b) {b₀ a y : ℝ} |
| 84 | (hay : a ≤ y) (hb : ∀ t, a ≤ t → b t = 0) : |
| 85 | historyAverage b b₀ y = Real.exp (-(y - a)) * historyAverage b b₀ a := by |
| 86 | have hi := OutgoingPulseBounds.integral_stops (Real.continuous_exp.fun_mul hbc) hay |
| 87 | (fun t ht => by rw [hb t ht, mul_zero]) |
| 88 | rw [historyAverage_formula, hi, historyAverage_formula] |
| 89 | have he : Real.exp (-(y - a)) * Real.exp (-a) = Real.exp (-y) := by |
| 90 | rw [← Real.exp_add] |
| 91 | congr 1 |
| 92 | ring |
| 93 | rw [← mul_assoc, he] |
| 94 | |
| 95 | /-- The actual average axial coefficient; the incoming value integrates `k=4`. -/ |
| 96 | noncomputable def averagedDrop (c : Parameters) : ℝ → ℝ := |
| 97 | historyAverage (dropCoefficient c.m) 4 |
| 98 | |
| 99 | /-- The squared axial history; the incoming value integrates `k²=16`. -/ |
| 100 | noncomputable def averagedDropSquare (c : Parameters) : ℝ → ℝ := |
| 101 | historyAverage (fun y => dropCoefficient c.m y ^ 2) 16 |
| 102 | |
| 103 | theorem averagedDrop_contDiff (c : Parameters) : ContDiff ℝ ∞ (averagedDrop c) := |
| 104 | historyAverage_contDiff (dropCoefficient_contDiff c.m_pos) 4 |
| 105 | |
| 106 | theorem averagedDrop_hasDerivAt (c : Parameters) (y : ℝ) : |
| 107 | HasDerivAt (averagedDrop c) (dropCoefficient c.m y - averagedDrop c y) y := |
| 108 | historyAverage_hasDerivAt (dropCoefficient_contDiff c.m_pos).continuous 4 y |
| 109 | |
| 110 | theorem averagedDrop_early (c : Parameters) {y : ℝ} (hy : y ≤ 1) : |
| 111 | averagedDrop c y = 4 := by |
| 112 | apply historyAverage_constant |
| 113 | intro t ht |
| 114 | exact dropCoefficient_early c.m (ht.2.trans (max_le (by norm_num) hy)) |
| 115 | |
| 116 | theorem averagedDrop_bounds (c : Parameters) {y : ℝ} (hy : 0 ≤ y) : |
| 117 | 0 ≤ averagedDrop c y ∧ averagedDrop c y ≤ 4 := by |
| 118 | exact ⟨historyAverage_nonneg (by norm_num) hy (fun t _ => (dropCoefficient_bounds c.m t).1), |
| 119 | historyAverage_le (dropCoefficient_contDiff c.m_pos).continuous le_rfl hy |
| 120 | (fun t _ => (dropCoefficient_bounds c.m t).2)⟩ |
| 121 | |
| 122 | theorem averagedDropSquare_bounds (c : Parameters) {y : ℝ} (hy : 0 ≤ y) : |
| 123 | 0 ≤ averagedDropSquare c y ∧ averagedDropSquare c y ≤ 16 := by |
| 124 | refine ⟨historyAverage_nonneg (by norm_num) hy (fun t _ => sq_nonneg _), |
| 125 | historyAverage_le ((dropCoefficient_contDiff c.m_pos).pow 2).continuous le_rfl hy ?_⟩ |
| 126 | intro t _ |
| 127 | nlinarith [(dropCoefficient_bounds c.m t).1, (dropCoefficient_bounds c.m t).2] |
| 128 | |
| 129 | theorem averagedDrop_is_mass_history (c : Parameters) (amp : ℝ → ℝ) (η : ℝ) |
| 130 | {y : ℝ} (hy : y ≤ c.pulseStart) : |
| 131 | massMoment c amp η y / Real.exp y = averagedDrop c y * η := by |
| 132 | have hi : (∫ t in (0 : ℝ)..y, Real.exp t * axial c amp (t, η)) = |
| 133 | (∫ t in (0 : ℝ)..y, Real.exp t * dropCoefficient c.m t) * η := by |
| 134 | rw [← intervalIntegral.integral_mul_const] |
| 135 | apply intervalIntegral.integral_congr |
| 136 | intro t ht |
| 137 | dsimp only |
| 138 | rw [axial_before_pulse c amp η (ht.2.trans (max_le c.pulseStart_pos.le hy))] |
| 139 | ring |
| 140 | rw [massMoment, hi, averagedDrop, historyAverage_formula, Real.exp_neg] |
| 141 | ring |
| 142 | |
| 143 | theorem averagedDrop_small_on_second_ramp (c : Parameters) {y : ℝ} |
| 144 | (hy : c.dropLength + 1 ≤ y) : averagedDrop c y ≤ 1 / 2 := by |
| 145 | have he : Real.exp c.m ≤ y := by dsimp [Parameters.dropLength] at hy; linarith |
| 146 | have hlate := historyAverage_late (dropCoefficient_contDiff c.m_pos).continuous he |
| 147 | (fun t ht => dropCoefficient_late c.m_pos ht) (b₀ := (4 : ℝ)) |
| 148 | change averagedDrop c y = Real.exp (-(y - Real.exp c.m)) * averagedDrop c (Real.exp c.m) at hlate |
| 149 | rw [hlate] |
| 150 | have hbar := (averagedDrop_bounds c (Real.exp_pos c.m).le).2 |
| 151 | have hex : Real.exp (-(y - Real.exp c.m)) ≤ (1 / 8 : ℝ) := by |
| 152 | rw [Real.exp_neg] |
| 153 | rw [← one_div] |
| 154 | apply (div_le_iff₀ (Real.exp_pos _)).mpr |
| 155 | have hlin := Real.add_one_le_exp (y - Real.exp c.m) |
| 156 | dsimp [Parameters.dropLength] at hy |
| 157 | norm_num |
| 158 | linarith |
| 159 | nlinarith [Real.exp_pos (-(y - Real.exp c.m))] |
| 160 | |
| 161 | noncomputable def shapeGradient (η : ℝ) : ℝ := 2 * η / (1 + η ^ 2) |
| 162 | |
| 163 | theorem shapeGradient_contDiff : ContDiff ℝ ∞ shapeGradient := |
| 164 | (contDiff_const.mul contDiff_id).div (contDiff_const.add (contDiff_id.pow 2)) |
| 165 | (fun η => by positivity) |
| 166 | |
| 167 | theorem parameter_square_le_one {η : ℝ} (hη : |η| ≤ 1) : η ^ 2 ≤ 1 := by |
| 168 | have h := sq_le_sq₀ (abs_nonneg η) (by norm_num : (0 : ℝ) ≤ 1) |>.mpr hη |
| 169 | simpa using h |
| 170 | |
| 171 | theorem eta_shapeGradient_bounds {η : ℝ} (hη : |η| ≤ 1) : |
| 172 | η ^ 2 ≤ η * shapeGradient η ∧ η * shapeGradient η ≤ 1 := by |
| 173 | have hsq := parameter_square_le_one hη |
| 174 | have hp : 0 < 1 + η ^ 2 := by positivity |
| 175 | unfold shapeGradient |
| 176 | rw [← mul_div_assoc] |
| 177 | constructor |
| 178 | · apply (le_div_iff₀ hp).mpr |
| 179 | nlinarith [sq_nonneg η, mul_nonneg (sq_nonneg η) (sub_nonneg.mpr hsq)] |
| 180 | · apply (div_le_one hp).mpr |
| 181 | nlinarith |
| 182 | |
| 183 | theorem abs_shapeGradient_le (η : ℝ) : |shapeGradient η| ≤ 2 * |η| := by |
| 184 | rw [shapeGradient, abs_div, abs_mul, abs_of_nonneg (by norm_num : (0 : ℝ) ≤ 2), |
| 185 | abs_of_pos (by positivity : 0 < 1 + η ^ 2)] |
| 186 | exact div_le_self (by positivity) (by nlinarith [sq_nonneg η]) |
| 187 | |
| 188 | theorem dropCoefficient_hasDerivAt {m y : ℝ} (hm : 0 < m) (hy : 0 < y) : |
| 189 | HasDerivAt (dropCoefficient m) |
| 190 | (-(4 * deriv sigma (Real.log y / m) / (m * y))) y := by |
| 191 | have hd := ((sigma_contDiff.differentiable (by simp) (Real.log y / m)).hasDerivAt.comp y |
| 192 | ((Real.hasDerivAt_log hy.ne').div_const m)).const_sub 1 |
| 193 | have he : dropCoefficient m =ᶠ[𝓝 y] (fun t => 4 * (1 - sigma (Real.log t / m))) := by |
| 194 | filter_upwards [Ioi_mem_nhds hy] with t ht |
| 195 | exact dropCoefficient_eq hm ht |
| 196 | convert! (hd.const_mul 4).congr_of_eventuallyEq he using 1 |
| 197 | simp only [div_eq_mul_inv, mul_inv_rev] |
| 198 | ring |
| 199 | |
| 200 | noncomputable def dropSpeed (m : ℝ) : ℝ := 4 * stepBound / m |
| 201 | |
| 202 | theorem dropSpeed_pos {m : ℝ} (hm : 0 < m) : 0 < dropSpeed m := by |
| 203 | unfold dropSpeed |
| 204 | have := stepBound_ge_one |
| 205 | positivity |
| 206 | |
| 207 | theorem dropCoefficient_deriv_bound {m y : ℝ} (hm : 0 < m) (hy : 0 < y) : |
| 208 | |deriv (dropCoefficient m) y| ≤ dropSpeed m / y := by |
| 209 | rw [(dropCoefficient_hasDerivAt hm hy).deriv, abs_neg, |
| 210 | abs_of_nonneg (div_nonneg (mul_nonneg (by norm_num) (sigma_derivative_nonneg _)) |
| 211 | (mul_pos hm hy).le)] |
| 212 | unfold dropSpeed |
| 213 | rw [div_div] |
| 214 | exact div_le_div_of_nonneg_right |
| 215 | (mul_le_mul_of_nonneg_left (sigma_derivative_le _) (by norm_num)) (mul_pos hm hy).le |
| 216 | |
| 217 | theorem exists_small_dropSpeed {e : ℝ} (he : 0 < e) : |
| 218 | ∃ M : ℝ, 0 < M ∧ ∀ m : ℝ, M ≤ m → dropSpeed m ≤ e := by |
| 219 | refine ⟨4 * stepBound / e + 1, by have := stepBound_ge_one; positivity, ?_⟩ |
| 220 | intro m hm |
| 221 | have hM : 0 < 4 * stepBound / e := by have := stepBound_ge_one; positivity |
| 222 | have hmp : 0 < m := by linarith |
| 223 | apply (div_le_iff₀ hmp).mpr |
| 224 | have hh := (div_le_iff₀ he).mp (show 4 * stepBound / e ≤ m by linarith) |
| 225 | linarith |
| 226 | |
| 227 | /-! ## The actual angular source and its ideal incoming lag -/ |
| 228 | |
| 229 | noncomputable def transportW (c : Parameters) (h y η : ℝ) : ℝ := |
| 230 | 1 - L h η * averagedDrop c y |
| 231 | |
| 232 | noncomputable def angularRate (c : Parameters) (y : ℝ) : ℝ := |
| 233 | 1 + slope c.dropLength c.lam y |
| 234 | |
| 235 | noncomputable def angularSource (c : Parameters) (h η y : ℝ) : ℝ := |
| 236 | -slope c.dropLength c.lam y * transportW c h y η - |
| 237 | h * (1 - 2 * dropCoefficient c.m y * η ^ 2) + |
| 238 | (D h + d η * dropCoefficient c.m y) * η * shapeGradient η |
| 239 | |
| 240 | noncomputable def idealAngularSource (h η : ℝ) : ℝ := |
| 241 | (3 / 5) * (4 * L h η - 1) - h * (1 - 8 * η ^ 2) + |
| 242 | (D h + 4 * d η) * η * shapeGradient η |
| 243 | |
| 244 | noncomputable def idealAngularLag (h η : ℝ) : ℝ := idealAngularSource h η / (8 / 5) |
| 245 | |
| 246 | noncomputable def angularLag (c : Parameters) (h η : ℝ) : ℝ → ℝ := |
| 247 | linearLag (angularRate c) (angularSource c h η) (idealAngularLag h η) |
| 248 | |
| 249 | theorem angularRate_contDiff (c : Parameters) : ContDiff ℝ ∞ (angularRate c) := |
| 250 | contDiff_const.add (slope_contDiff _ _) |
| 251 | |
| 252 | theorem angularSource_contDiff (c : Parameters) (h η : ℝ) : |
| 253 | ContDiff ℝ ∞ (angularSource c h η) := by |
| 254 | unfold angularSource transportW |
| 255 | have hk := dropCoefficient_contDiff c.m_pos |
| 256 | have hb := averagedDrop_contDiff c |
| 257 | exact (((slope_contDiff _ _).neg.mul |
| 258 | (contDiff_const.sub (contDiff_const.mul hb))).sub |
| 259 | (contDiff_const.mul (contDiff_const.sub |
| 260 | ((contDiff_const.mul hk).mul contDiff_const)))).add |
| 261 | (((contDiff_const.add (contDiff_const.mul hk)).mul contDiff_const).mul contDiff_const) |
| 262 | |
| 263 | theorem angularLag_hasDerivAt (c : Parameters) (h η y : ℝ) : |
| 264 | HasDerivAt (angularLag c h η) |
| 265 | (angularSource c h η y - angularRate c y * angularLag c h η y) y := |
| 266 | linearLag_hasDerivAt (angularRate_contDiff c).continuous |
| 267 | (angularSource_contDiff c h η).continuous (idealAngularLag h η) y |
| 268 | |
| 269 | theorem angularSource_ideal (c : Parameters) (h η : ℝ) {y : ℝ} (hy : y ≤ 0) : |
| 270 | angularSource c h η y = idealAngularSource h η := by |
| 271 | simp only [angularSource, transportW, slope_ideal c.dropLength_pos.le hy, |
| 272 | averagedDrop_early c (show y ≤ 1 by linarith), |
| 273 | dropCoefficient_early c.m (show y ≤ 1 by linarith), idealAngularSource] |
| 274 | ring |
| 275 | |
| 276 | theorem idealAngularLag_is_incoming_integral (h η : ℝ) : |
| 277 | (∫ t in Iic (0 : ℝ), Real.exp ((8 / 5 : ℝ) * t) * idealAngularSource h η) = |
| 278 | idealAngularLag h η := by |
| 279 | rw [integral_mul_const, integral_exp_mul_Iic (by norm_num : (0 : ℝ) < 8 / 5)] |
| 280 | simp [idealAngularLag] |
| 281 | ring |
| 282 | |
| 283 | theorem natural_L_bounds {h η : ℝ} (hh : 0 ≤ h) (hh1 : h ≤ 1 / 100) (hη : |η| ≤ 1) : |
| 284 | 49 / 50 ≤ L h η ∧ L h η ≤ 1 := by |
| 285 | have hs := parameter_square_le_one hη |
| 286 | unfold L |
| 287 | constructor <;> nlinarith [mul_nonneg hh (sq_nonneg η), |
| 288 | mul_nonneg hh (sub_nonneg.mpr hs)] |
| 289 | |
| 290 | theorem idealAngularLag_lower {h η : ℝ} (hh : 0 ≤ h) (hh1 : h ≤ 1 / 100) |
| 291 | (hη : |η| ≤ 1) : 1 ≤ idealAngularLag h η := by |
| 292 | have hL := (natural_L_bounds hh hh1 hη).1 |
| 293 | have hJ := (eta_shapeGradient_bounds hη).1 |
| 294 | have hpos : 0 ≤ (D h + 4 * d η) * (η * shapeGradient η) := by |
| 295 | have hd : 0 ≤ d η := by unfold d; linarith [parameter_square_le_one hη] |
| 296 | have hD : 0 ≤ D h := by unfold D; linarith |
| 297 | exact mul_nonneg (by positivity) (le_trans (sq_nonneg η) hJ) |
| 298 | unfold idealAngularLag idealAngularSource |
| 299 | apply (le_div_iff₀ (by norm_num : (0 : ℝ) < 8 / 5)).mpr |
| 300 | nlinarith [mul_nonneg hh (sq_nonneg η)] |
| 301 | |
| 302 | theorem angularRate_bounds (c : Parameters) (y : ℝ) : |
| 303 | 9 / 10 ≤ angularRate c y ∧ angularRate c y ≤ 8 / 5 := by |
| 304 | unfold angularRate |
| 305 | have hb := OutgoingPulseBounds.slope_bounds c y |
| 306 | constructor <;> linarith [c.lam_lt] |
| 307 | |
| 308 | theorem slope_nonneg_before_dropEnd (c : Parameters) {y : ℝ} |
| 309 | (hy : y ≤ c.dropLength + 1) : 0 ≤ slope c.dropLength c.lam y := by |
| 310 | simp only [OutgoingSchedule.slope, sigma_zero (show y - (c.dropLength + 1) ≤ 0 by linarith), |
| 311 | mul_zero, sub_zero] |
| 312 | exact mul_nonneg (by norm_num) (sub_nonneg.mpr (sigma_le_one y)) |
| 313 | |
| 314 | theorem slope_nonpos_after_first_ramp (c : Parameters) {y : ℝ} |
| 315 | (hy : 1 ≤ y) : slope c.dropLength c.lam y ≤ 0 := by |
| 316 | simp only [OutgoingSchedule.slope, sigma_one hy, sub_self, mul_zero, zero_sub] |
| 317 | exact neg_nonpos.mpr (mul_nonneg c.lam_pos.le (sigma_nonneg _)) |
| 318 | |
| 319 | theorem transportW_bounds (c : Parameters) {h y η : ℝ} (hh : 0 ≤ h) (hh1 : h ≤ 1 / 100) |
| 320 | (hy : 0 ≤ y) (hη : |η| ≤ 1) : -3 ≤ transportW c h y η ∧ transportW c h y η ≤ 1 := by |
| 321 | have hL := natural_L_bounds hh hh1 hη |
| 322 | have hk := averagedDrop_bounds c hy |
| 323 | unfold transportW |
| 324 | constructor <;> nlinarith [mul_nonneg (by linarith : 0 ≤ L h η) hk.1, |
| 325 | mul_le_mul hL.2 hk.2 hk.1 (by norm_num : (0 : ℝ) ≤ 1)] |
| 326 | |
| 327 | theorem transportW_second_ramp (c : Parameters) {h y η : ℝ} (hh : 0 ≤ h) |
| 328 | (hh1 : h ≤ 1 / 100) (hy : c.dropLength + 1 ≤ y) (hη : |η| ≤ 1) : |
| 329 | 1 / 2 ≤ transportW c h y η := by |
| 330 | have hL := (natural_L_bounds hh hh1 hη).2 |
| 331 | have hk0 := (averagedDrop_bounds c (y := y) (by linarith [c.dropLength_pos])).1 |
| 332 | have hk := averagedDrop_small_on_second_ramp c hy |
| 333 | unfold transportW |
| 334 | nlinarith [mul_le_mul_of_nonneg_right hL hk0] |
| 335 | |
| 336 | theorem angularSource_lower (c : Parameters) {h η y : ℝ} (hh : 0 ≤ h) |
| 337 | (hh1 : h ≤ 1 / 100) (_hy : 0 ≤ y) (hη : |η| ≤ 1) : |
| 338 | (49 / 100) * η ^ 2 - h ≤ angularSource c h η y := by |
| 339 | have hlW : 0 ≤ -slope c.dropLength c.lam y * transportW c h y η := by |
| 340 | by_cases hy1 : y ≤ 1 |
| 341 | · have hW : transportW c h y η ≤ 0 := by |
| 342 | rw [transportW, averagedDrop_early c hy1] |
| 343 | linarith [(natural_L_bounds hh hh1 hη).1] |
| 344 | have hl := slope_nonneg_before_dropEnd c (hy1.trans (by linarith [c.dropLength_pos])) |
| 345 | exact mul_nonneg_of_nonpos_of_nonpos (neg_nonpos.mpr hl) hW |
| 346 | · by_cases hy2 : y ≤ c.dropLength + 1 |
| 347 | · rw [slope_drop (by linarith) hy2, neg_zero, zero_mul] |
| 348 | · exact mul_nonneg (neg_nonneg.mpr (slope_nonpos_after_first_ramp c (by linarith))) |
| 349 | (by linarith [transportW_second_ramp c hh hh1 (le_of_not_ge hy2) hη]) |
| 350 | have hk := dropCoefficient_bounds c.m y |
| 351 | have hd : 0 ≤ d η := by unfold d; linarith [parameter_square_le_one hη] |
| 352 | have hJ := (eta_shapeGradient_bounds hη).1 |
| 353 | have hD : 49 / 100 ≤ D h := by unfold D; linarith |
| 354 | have hDJ : (49 / 100) * η ^ 2 ≤ (D h + d η * dropCoefficient c.m y) * (η * shapeGradient η) := |
| 355 | mul_le_mul (by nlinarith [mul_nonneg hd hk.1]) hJ (sq_nonneg η) |
| 356 | (by nlinarith [mul_nonneg hd hk.1]) |
| 357 | unfold angularSource |
| 358 | nlinarith [mul_nonneg hh (mul_nonneg hk.1 (sq_nonneg η))] |
| 359 | |
| 360 | theorem primitive_continuous_of_continuous {r : ℝ → ℝ} (hr : Continuous r) : |
| 361 | Continuous (OutgoingSchedule.primitive r) := |
| 362 | continuous_iff_continuousAt.mpr (fun y => (primitive_hasDerivAt hr y).continuousAt) |
| 363 | |
| 364 | theorem integral_integratingFactor_rate {r : ℝ → ℝ} (hr : Continuous r) (y : ℝ) : |
| 365 | (∫ t in (0 : ℝ)..y, Real.exp (OutgoingSchedule.primitive r t) * r t) = |
| 366 | Real.exp (OutgoingSchedule.primitive r y) - 1 := by |
| 367 | have hd : ∀ t, HasDerivAt (fun x => Real.exp (OutgoingSchedule.primitive r x)) |
| 368 | (Real.exp (OutgoingSchedule.primitive r t) * r t) t := by |
| 369 | intro t |
| 370 | exact (primitive_hasDerivAt hr t).exp |
| 371 | simpa [OutgoingSchedule.primitive] using intervalIntegral.integral_eq_sub_of_hasDerivAt |
| 372 | (fun t _ => hd t) (((Real.continuous_exp.comp (primitive_continuous_of_continuous hr)).mul hr).intervalIntegrable 0 y) |
| 373 | |
| 374 | theorem linearLag_constant {r b : ℝ → ℝ} (hr : Continuous r) {q₀ y : ℝ} |
| 375 | (hb : ∀ t ∈ uIcc (0 : ℝ) y, b t = r t * q₀) : linearLag r b q₀ y = q₀ := by |
| 376 | have hi : (∫ t in (0 : ℝ)..y, Real.exp (OutgoingSchedule.primitive r t) * b t) = |
| 377 | (Real.exp (OutgoingSchedule.primitive r y) - 1) * q₀ := by |
| 378 | calc |
| 379 | _ = ∫ t in (0 : ℝ)..y, (Real.exp (OutgoingSchedule.primitive r t) * r t) * q₀ := by |
| 380 | apply intervalIntegral.integral_congr |
| 381 | intro t ht |
| 382 | dsimp only |
| 383 | rw [hb t ht] |
| 384 | ring |
| 385 | _ = _ := by rw [intervalIntegral.integral_mul_const, integral_integratingFactor_rate hr] |
| 386 | unfold linearLag |
| 387 | change Real.exp (-OutgoingSchedule.primitive r y) * |
| 388 | (q₀ + (∫ t in (0 : ℝ)..y, Real.exp (OutgoingSchedule.primitive r t) * b t)) = q₀ |
| 389 | rw [hi] |
| 390 | have he : Real.exp (-OutgoingSchedule.primitive r y) * Real.exp (OutgoingSchedule.primitive r y) = 1 := by |
| 391 | rw [← Real.exp_add]; simp |
| 392 | calc |
| 393 | _ = (Real.exp (-OutgoingSchedule.primitive r y) * Real.exp (OutgoingSchedule.primitive r y)) * q₀ := by ring |
| 394 | _ = q₀ := by rw [he, one_mul] |
| 395 | |
| 396 | theorem angularLag_ideal (c : Parameters) (h η : ℝ) {y : ℝ} (hy : y ≤ 0) : |
| 397 | angularLag c h η y = idealAngularLag h η := by |
| 398 | apply linearLag_constant (angularRate_contDiff c).continuous |
| 399 | intro t ht |
| 400 | have ht0 : t ≤ 0 := ht.2.trans (max_le le_rfl hy) |
| 401 | rw [angularSource_ideal c h η ht0] |
| 402 | simp only [angularRate, slope_ideal c.dropLength_pos.le ht0, idealAngularLag] |
| 403 | ring |
| 404 | |
| 405 | theorem linearLag_lower_barrier {r b : ℝ → ℝ} (hr : Continuous r) (hb : Continuous b) |
| 406 | {q₀ β κ y : ℝ} (hy : 0 ≤ y) (hq : β + κ ≤ q₀) |
| 407 | (hsource : ∀ t ∈ Icc (0 : ℝ) y, r t * β ≤ b t) : |
| 408 | β + κ * Real.exp (-OutgoingSchedule.primitive r y) ≤ linearLag r b q₀ y := by |
| 409 | have hE := Real.continuous_exp.comp (primitive_continuous_of_continuous hr) |
| 410 | have hi := intervalIntegral.integral_mono_on (μ := volume) hy |
| 411 | ((hE.fun_mul (hr.fun_mul continuous_const)).intervalIntegrable 0 y) |
| 412 | ((hE.fun_mul hb).intervalIntegrable 0 y) |
| 413 | (fun t ht => mul_le_mul_of_nonneg_left (hsource t ht) (Real.exp_pos _).le) |
| 414 | have heq : (∫ t in (0 : ℝ)..y, Real.exp (OutgoingSchedule.primitive r t) * (r t * β)) = |
| 415 | (Real.exp (OutgoingSchedule.primitive r y) - 1) * β := by |
| 416 | simp_rw [← mul_assoc] |
| 417 | rw [intervalIntegral.integral_mul_const, integral_integratingFactor_rate hr] |
| 418 | simp only [Function.comp_apply] at hi |
| 419 | rw [heq] at hi |
| 420 | unfold linearLag |
| 421 | change _ ≤ Real.exp (-OutgoingSchedule.primitive r y) * |
| 422 | (q₀ + ∫ t in (0 : ℝ)..y, Real.exp (OutgoingSchedule.primitive r t) * b t) |
| 423 | have hc : Real.exp (-OutgoingSchedule.primitive r y) * Real.exp (OutgoingSchedule.primitive r y) = 1 := by |
| 424 | rw [← Real.exp_add]; simp |
| 425 | calc |
| 426 | _ = Real.exp (-OutgoingSchedule.primitive r y) * |
| 427 | (β + κ + (Real.exp (OutgoingSchedule.primitive r y) - 1) * β) := by |
| 428 | nlinarith [congrArg (fun t : ℝ => t * β) hc] |
| 429 | _ ≤ _ := mul_le_mul_of_nonneg_left (add_le_add hq hi) (Real.exp_pos _).le |
| 430 | |
| 431 | theorem slope_integral_upper (c : Parameters) {y : ℝ} (hy : 0 ≤ y) : |
| 432 | OutgoingSchedule.primitive (slope c.dropLength c.lam) y ≤ 3 / 5 := by |
| 433 | have hc := (slope_contDiff c.dropLength c.lam).continuous |
| 434 | have hlocal : ∀ z : ℝ, 0 ≤ z → z ≤ 1 → |
| 435 | (∫ t in (0 : ℝ)..z, slope c.dropLength c.lam t) ≤ 3 / 5 := by |
| 436 | intro z hz hz1 |
| 437 | have hi := intervalIntegral.integral_mono_on (μ := volume) hz |
| 438 | (hc.intervalIntegrable 0 z) (continuous_const.intervalIntegrable 0 z) |
| 439 | (fun t _ => (OutgoingPulseBounds.slope_bounds c t).2) |
| 440 | simp only [intervalIntegral.integral_const, sub_zero, smul_eq_mul] at hi |
| 441 | linarith |
| 442 | by_cases hy1 : y ≤ 1 |
| 443 | · exact hlocal y hy hy1 |
| 444 | · have h1y : 1 ≤ y := le_of_not_ge hy1 |
| 445 | have hi := intervalIntegral.integral_mono_on (μ := volume) h1y |
| 446 | (hc.intervalIntegrable 1 y) (continuous_const.intervalIntegrable 1 y) |
| 447 | (fun t ht => slope_nonpos_after_first_ramp c ht.1) |
| 448 | simp only [intervalIntegral.integral_const, smul_eq_mul, mul_zero] at hi |
| 449 | have hadd := intervalIntegral.integral_add_adjacent_intervals (μ := volume) |
| 450 | (hc.intervalIntegrable 0 1) (hc.intervalIntegrable 1 y) |
| 451 | have h0 := hlocal 1 (by norm_num) le_rfl |
| 452 | change (∫ t in (0 : ℝ)..y, slope c.dropLength c.lam t) ≤ 3 / 5 |
| 453 | linarith |
| 454 | |
| 455 | theorem angularRate_primitive (c : Parameters) (y : ℝ) : |
| 456 | OutgoingSchedule.primitive (angularRate c) y = |
| 457 | y + OutgoingSchedule.primitive (slope c.dropLength c.lam) y := by |
| 458 | unfold OutgoingSchedule.primitive angularRate |
| 459 | rw [intervalIntegral.integral_add (continuous_const.intervalIntegrable 0 y) |
| 460 | ((slope_contDiff c.dropLength c.lam).continuous.intervalIntegrable 0 y)] |
| 461 | simp |
| 462 | |
| 463 | theorem angularRate_primitive_upper (c : Parameters) {y : ℝ} (hy : 0 ≤ y) : |
| 464 | OutgoingSchedule.primitive (angularRate c) y ≤ y + 3 / 5 := by |
| 465 | rw [angularRate_primitive] |
| 466 | linarith [slope_integral_upper c hy] |
| 467 | |
| 468 | theorem angularSource_barrier (c : Parameters) {h η y : ℝ} (hh : 0 ≤ h) |
| 469 | (hh1 : h ≤ 1 / 100) (hy : 0 ≤ y) (hη : |η| ≤ 1) : |
| 470 | angularRate c y * (η ^ 2 / 4 - 2 * h) ≤ angularSource c h η y := by |
| 471 | have hr := angularRate_bounds c y |
| 472 | have hs := angularSource_lower c hh hh1 hy hη |
| 473 | have h₁ := mul_le_mul_of_nonneg_right hr.2 (sq_nonneg η) |
| 474 | have h₂ := mul_le_mul_of_nonneg_right hr.1 hh |
| 475 | nlinarith [sq_nonneg η] |
| 476 | |
| 477 | theorem angularLag_barrier (c : Parameters) {h η y : ℝ} (hh : 0 ≤ h) |
| 478 | (hh1 : h ≤ 1 / 100) (hy : 0 ≤ y) (hη : |η| ≤ 1) : |
| 479 | η ^ 2 / 4 - 2 * h + (1 / 2) * Real.exp (-(y + 3 / 5)) ≤ angularLag c h η y := by |
| 480 | have hinit : η ^ 2 / 4 - 2 * h + (1 / 2 : ℝ) ≤ idealAngularLag h η := by |
| 481 | have hq := idealAngularLag_lower hh hh1 hη |
| 482 | have hs := parameter_square_le_one hη |
| 483 | linarith |
| 484 | have hq := linearLag_lower_barrier (angularRate_contDiff c).continuous |
| 485 | (angularSource_contDiff c h η).continuous hy hinit |
| 486 | (fun t ht => angularSource_barrier c hh hh1 ht.1 hη) |
| 487 | have he := Real.exp_le_exp.mpr (neg_le_neg (angularRate_primitive_upper c hy)) |
| 488 | exact (by linarith : η ^ 2 / 4 - 2 * h + (1 / 2) * Real.exp (-(y + 3 / 5)) ≤ |
| 489 | η ^ 2 / 4 - 2 * h + (1 / 2) * Real.exp (-OutgoingSchedule.primitive (angularRate c) y)).trans hq |
| 490 | |
| 491 | noncomputable def coneFloor : ℝ := Real.exp (-(3 / 5 : ℝ)) / 4 |
| 492 | |
| 493 | theorem coneFloor_pos : 0 < coneFloor := div_pos (Real.exp_pos _) (by norm_num) |
| 494 | |
| 495 | theorem coneFloor_le_quarter : coneFloor ≤ 1 / 4 := by |
| 496 | have he : Real.exp (-(3 / 5 : ℝ)) ≤ 1 := Real.exp_le_one_iff.mpr (by norm_num) |
| 497 | unfold coneFloor |
| 498 | linarith |
| 499 | |
| 500 | /-- The positive angular lag is derived from its incoming ideal integral and |
| 501 | the true source. The constant is absolute and uniform in `P, λ, h, m`. -/ |
| 502 | theorem angularLag_lower (c : Parameters) {h η y T : ℝ} (hh : 0 ≤ h) |
| 503 | (hh1 : h ≤ 1 / 100) (hy : 0 ≤ y) (hyT : y ≤ T) (hη : |η| ≤ 1) |
| 504 | (hhT : h ≤ Real.exp (-(T + 3 / 5)) / 8) : |
| 505 | coneFloor * (η ^ 2 + Real.exp (-y)) ≤ angularLag c h η y := by |
| 506 | have hq := angularLag_barrier c hh hh1 hy hη |
| 507 | have hT : Real.exp (-(T + 3 / 5)) ≤ Real.exp (-(y + 3 / 5)) := |
| 508 | Real.exp_le_exp.mpr (by linarith) |
| 509 | have he : Real.exp (-(y + 3 / 5)) = Real.exp (-(3 / 5 : ℝ)) * Real.exp (-y) := by |
| 510 | rw [← Real.exp_add] |
| 511 | congr 1 |
| 512 | ring |
| 513 | have hηc := mul_le_mul_of_nonneg_right coneFloor_le_quarter (sq_nonneg η) |
| 514 | rw [he] at hq hT |
| 515 | unfold coneFloor at hηc ⊢ |
| 516 | nlinarith |
| 517 | |
| 518 | theorem angularLag_pos (c : Parameters) {h η y T : ℝ} (hh : 0 ≤ h) |
| 519 | (hh1 : h ≤ 1 / 100) (hy : 0 ≤ y) (hyT : y ≤ T) (hη : |η| ≤ 1) |
| 520 | (hhT : h ≤ Real.exp (-(T + 3 / 5)) / 8) : 0 < angularLag c h η y := |
| 521 | (mul_pos coneFloor_pos (add_pos_of_nonneg_of_pos (sq_nonneg η) (Real.exp_pos _))).trans_le |
| 522 | (angularLag_lower c hh hh1 hy hyT hη hhT) |
| 523 | |
| 524 | /-! ## The actual angular-energy history -/ |
| 525 | |
| 526 | noncomputable def clockEnergy (c : Parameters) (y : ℝ) : ℝ := |
| 527 | radialAmplitude c.P c.dropLength c.lam y ^ 2 |
| 528 | |
| 529 | noncomputable def weightedClockEnergy (c : Parameters) (y : ℝ) : ℝ := |
| 530 | Real.exp y * clockEnergy c y |
| 531 | |
| 532 | noncomputable def averagedClockEnergy (c : Parameters) : ℝ → ℝ := |
| 533 | historyAverage (clockEnergy c) ((5 / 6) * c.P ^ 2) |
| 534 | |
| 535 | noncomputable def averagedEnergy (c : Parameters) (y η : ℝ) : ℝ := |
| 536 | shape η ^ 2 * averagedClockEnergy c y |
| 537 | |
| 538 | theorem clockEnergy_contDiff (c : Parameters) : ContDiff ℝ ∞ (clockEnergy c) := |
| 539 | (radialAmplitude_contDiff _ _ _).pow 2 |
| 540 | |
| 541 | theorem clockEnergy_pos (c : Parameters) (y : ℝ) : 0 < clockEnergy c y := |
| 542 | sq_pos_of_pos (mul_pos c.P_pos (Real.exp_pos _)) |
| 543 | |
| 544 | theorem clockEnergy_initial (c : Parameters) : clockEnergy c 0 = c.P ^ 2 := by |
| 545 | simp [clockEnergy, radialAmplitude, logAmplitude, OutgoingSchedule.primitive] |
| 546 | |
| 547 | theorem clockEnergy_hasDerivAt (c : Parameters) (y : ℝ) : |
| 548 | HasDerivAt (clockEnergy c) |
| 549 | ((2 * slope c.dropLength c.lam y - 1) * clockEnergy c y) y := by |
| 550 | convert! (radialAmplitude_hasDerivAt c.P c.dropLength c.lam y).pow 2 using 1 |
| 551 | simp only [clockEnergy] |
| 552 | ring |
| 553 | |
| 554 | theorem weightedClockEnergy_hasDerivAt (c : Parameters) (y : ℝ) : |
| 555 | HasDerivAt (weightedClockEnergy c) |
| 556 | (2 * slope c.dropLength c.lam y * weightedClockEnergy c y) y := by |
| 557 | convert! (Real.hasDerivAt_exp y).mul (clockEnergy_hasDerivAt c y) using 1 |
| 558 | simp only [weightedClockEnergy] |
| 559 | ring |
| 560 | |
| 561 | theorem weightedClockEnergy_monotone (c : Parameters) : |
| 562 | MonotoneOn (weightedClockEnergy c) (Iic (c.dropLength + 1)) := by |
| 563 | apply monotoneOn_of_hasDerivWithinAt_nonneg (convex_Iic _) |
| 564 | ((Real.continuous_exp.fun_mul (clockEnergy_contDiff c).continuous).continuousOn) |
| 565 | (fun y _ => (weightedClockEnergy_hasDerivAt c y).hasDerivWithinAt) |
| 566 | intro y hy |
| 567 | have hy' : y ∈ Iic (c.dropLength + 1) := interior_subset hy |
| 568 | have hs := slope_nonneg_before_dropEnd c hy' |
| 569 | exact mul_nonneg (mul_nonneg (by norm_num) hs) |
| 570 | (mul_nonneg (Real.exp_pos y).le (clockEnergy_pos c y).le) |
| 571 | |
| 572 | theorem clockEnergy_lower (c : Parameters) {y : ℝ} (hy : 0 ≤ y) |
| 573 | (hy' : y ≤ c.dropLength + 1) : c.P ^ 2 * Real.exp (-y) ≤ clockEnergy c y := by |
| 574 | have hm := weightedClockEnergy_monotone c |
| 575 | (show (0 : ℝ) ≤ c.dropLength + 1 by linarith [c.dropLength_pos]) hy' hy |
| 576 | simp only [weightedClockEnergy, Real.exp_zero, one_mul, clockEnergy_initial] at hm |
| 577 | have he : Real.exp (-y) * Real.exp y = 1 := by rw [← Real.exp_add]; simp |
| 578 | have hh := mul_le_mul_of_nonneg_left hm (Real.exp_pos (-y)).le |
| 579 | nlinarith [congrArg (fun t : ℝ => t * clockEnergy c y) he] |
| 580 | |
| 581 | theorem averagedClockEnergy_nonneg (c : Parameters) {y : ℝ} (hy : 0 ≤ y) : |
| 582 | 0 ≤ averagedClockEnergy c y := |
| 583 | historyAverage_nonneg (by positivity) hy (fun t _ => (clockEnergy_pos c t).le) |
| 584 | |
| 585 | theorem averagedClockEnergy_upper (c : Parameters) {y : ℝ} (hy : 0 ≤ y) |
| 586 | (hy' : y ≤ c.dropLength + 1) : |
| 587 | averagedClockEnergy c y ≤ (y + 5 / 6) * clockEnergy c y := by |
| 588 | have hw := weightedClockEnergy_monotone c |
| 589 | have hzero := hw (show (0 : ℝ) ≤ c.dropLength + 1 by linarith [c.dropLength_pos]) hy' hy |
| 590 | simp only [weightedClockEnergy, Real.exp_zero, one_mul, clockEnergy_initial] at hzero |
| 591 | have hi := intervalIntegral.integral_mono_on (μ := volume) hy |
| 592 | ((Real.continuous_exp.fun_mul (clockEnergy_contDiff c).continuous).intervalIntegrable 0 y) |
| 593 | (continuous_const.intervalIntegrable 0 y) |
| 594 | (fun t ht => hw (ht.2.trans hy') hy' ht.2) |
| 595 | simp only [intervalIntegral.integral_const, sub_zero, smul_eq_mul, weightedClockEnergy] at hi |
| 596 | rw [averagedClockEnergy, historyAverage_formula] |
| 597 | have he : Real.exp (-y) * Real.exp y = 1 := by rw [← Real.exp_add]; simp |
| 598 | calc |
| 599 | _ ≤ Real.exp (-y) * ((5 / 6) * (Real.exp y * clockEnergy c y) + |
| 600 | y * (Real.exp y * clockEnergy c y)) := by gcongr |
| 601 | _ = (Real.exp (-y) * Real.exp y) * ((y + 5 / 6) * clockEnergy c y) := by ring |
| 602 | _ = _ := by rw [he, one_mul] |
| 603 | |
| 604 | theorem averagedEnergy_upper (c : Parameters) {y : ℝ} (hy : 0 ≤ y) |
| 605 | (hy' : y ≤ c.dropLength + 1) (η : ℝ) : |
| 606 | averagedEnergy c y η ≤ (y + 5 / 6) * angular c.P c.dropLength c.lam (y, η) ^ 2 := by |
| 607 | have hb := mul_le_mul_of_nonneg_left (averagedClockEnergy_upper c hy hy') (sq_nonneg (shape η)) |
| 608 | simpa only [averagedEnergy, angular, clockEnergy, mul_pow, mul_comm, mul_left_comm, mul_assoc] using hb |
| 609 | |
| 610 | theorem angular_square_lower (c : Parameters) {y η : ℝ} (hy : 0 ≤ y) |
| 611 | (hy' : y ≤ c.dropLength + 1) (hη : |η| ≤ 1) : |
| 612 | (c.P ^ 2 / 4) * Real.exp (-y) ≤ angular c.P c.dropLength c.lam (y, η) ^ 2 := by |
| 613 | have hs : (1 / 2 : ℝ) ≤ shape η := by |
| 614 | unfold shape |
| 615 | rw [← one_div] |
| 616 | apply (le_div_iff₀ (by positivity : 0 < 1 + η ^ 2)).mpr |
| 617 | linarith [parameter_square_le_one hη] |
| 618 | have hss : (1 / 4 : ℝ) ≤ shape η ^ 2 := by nlinarith [shape_pos η] |
| 619 | have hm := mul_le_mul (clockEnergy_lower c hy hy') hss (by norm_num : (0 : ℝ) ≤ 1 / 4) |
| 620 | (clockEnergy_pos c y).le |
| 621 | simpa only [angular, clockEnergy, mul_pow, div_eq_mul_inv, one_mul, mul_comm, mul_left_comm, mul_assoc] using hm |
| 622 | |
| 623 | theorem integral_exp_mul_real {a : ℝ} (ha : a ≠ 0) (y : ℝ) : |
| 624 | (∫ t in (0 : ℝ)..y, Real.exp (a * t)) = (Real.exp (a * y) - 1) / a := by |
| 625 | have hd : ∀ t, HasDerivAt (fun x => Real.exp (a * x) / a) (Real.exp (a * t)) t := by |
| 626 | intro t |
| 627 | convert! (((hasDerivAt_id t).const_mul a).exp).div_const a using 1 |
| 628 | simp only [id_eq] |
| 629 | field_simp |
| 630 | have hi := intervalIntegral.integral_eq_sub_of_hasDerivAt (fun t _ => hd t) |
| 631 | ((Real.continuous_exp.comp (continuous_const.mul continuous_id)).intervalIntegrable 0 y) |
| 632 | simpa only [mul_zero, Real.exp_zero, sub_div] using hi |
| 633 | |
| 634 | theorem clockEnergy_ideal (c : Parameters) {y : ℝ} (hy : y ≤ 0) : |
| 635 | clockEnergy c y = c.P ^ 2 * Real.exp ((1 / 5 : ℝ) * y) := by |
| 636 | simp only [clockEnergy, radialAmplitude, logAmplitude_ideal c.dropLength_pos.le hy, mul_pow, |
| 637 | ← Real.exp_nat_mul] |
| 638 | congr 2 |
| 639 | norm_num |
| 640 | ring |
| 641 | |
| 642 | theorem averagedClockEnergy_ideal (c : Parameters) {y : ℝ} (hy : y ≤ 0) : |
| 643 | averagedClockEnergy c y = (5 / 6) * clockEnergy c y := by |
| 644 | have hi : (∫ t in (0 : ℝ)..y, Real.exp t * clockEnergy c t) = |
| 645 | c.P ^ 2 * ((Real.exp ((6 / 5 : ℝ) * y) - 1) / (6 / 5)) := by |
| 646 | calc |
| 647 | _ = ∫ t in (0 : ℝ)..y, c.P ^ 2 * Real.exp ((6 / 5 : ℝ) * t) := by |
| 648 | apply intervalIntegral.integral_congr |
| 649 | intro t ht |
| 650 | dsimp only |
| 651 | rw [clockEnergy_ideal c (ht.2.trans (max_le le_rfl hy))] |
| 652 | rw [mul_left_comm, ← Real.exp_add] |
| 653 | congr 2 |
| 654 | ring |
| 655 | _ = _ := by rw [intervalIntegral.integral_const_mul, integral_exp_mul_real (by norm_num)] |
| 656 | rw [averagedClockEnergy, historyAverage_formula, hi, clockEnergy_ideal c hy] |
| 657 | have he : Real.exp (-y) * Real.exp ((6 / 5 : ℝ) * y) = Real.exp ((1 / 5 : ℝ) * y) := by |
| 658 | rw [← Real.exp_add] |
| 659 | congr 1 |
| 660 | ring |
| 661 | calc |
| 662 | _ = (5 / 6) * c.P ^ 2 * (Real.exp (-y) * Real.exp ((6 / 5 : ℝ) * y)) := by ring |
| 663 | _ = _ := by rw [he]; ring |
| 664 | |
| 665 | /-! ## Pressure and the axial lag with the full ideal incoming history -/ |
| 666 | |
| 667 | noncomputable def pressureClock (c : Parameters) (y : ℝ) : ℝ := |
| 668 | (5 / 2) * c.P ^ 2 + (1 / 2) * OutgoingSchedule.primitive (clockEnergy c) y |
| 669 | |
| 670 | noncomputable def entrancePressure (v : TailData) (y η : ℝ) : ℝ := |
| 671 | SchedulePressure.axisPressure v η + shape η ^ 2 * pressureClock v.core y |
| 672 | |
| 673 | noncomputable def pressureGradient (v : TailData) (y η : ℝ) : ℝ := |
| 674 | deriv (SchedulePressure.axisPressure v) η - |
| 675 | 2 * shapeGradient η * shape η ^ 2 * pressureClock v.core y |
| 676 | |
| 677 | theorem shape_hasDerivAt (η : ℝ) : |
| 678 | HasDerivAt shape (-shapeGradient η * shape η) η := by |
| 679 | have hd := ((hasDerivAt_const η (1 : ℝ)).fun_add ((hasDerivAt_id η).fun_pow 2)).fun_inv |
| 680 | (by positivity : (1 : ℝ) + η ^ 2 ≠ 0) |
| 681 | convert! hd using 1 |
| 682 | unfold shape shapeGradient |
| 683 | field_simp |
| 684 | ring_nf |
| 685 | simp ; ring |
| 686 | |
| 687 | theorem shapeSquare_hasDerivAt (η : ℝ) : |
| 688 | HasDerivAt (fun t => shape t ^ 2) (-2 * shapeGradient η * shape η ^ 2) η := by |
| 689 | convert! (shape_hasDerivAt η).pow 2 using 1 |
| 690 | ring |
| 691 | |
| 692 | theorem pressureClock_hasDerivAt (c : Parameters) (y : ℝ) : |
| 693 | HasDerivAt (pressureClock c) ((1 / 2) * clockEnergy c y) y := |
| 694 | ((primitive_hasDerivAt (clockEnergy_contDiff c).continuous y).const_mul (1 / 2)).const_add _ |
| 695 | |
| 696 | theorem entrancePressure_hasDerivAt_eta (v : TailData) (y η : ℝ) : |
| 697 | HasDerivAt (entrancePressure v y) (pressureGradient v y η) η := by |
| 698 | have hp := ((SchedulePressure.axisPressure_contDiff v).differentiable (by simp) η).hasDerivAt |
| 699 | convert! hp.add ((shapeSquare_hasDerivAt η).mul_const (pressureClock v.core y)) using 1 |
| 700 | unfold pressureGradient |
| 701 | ring |
| 702 | |
| 703 | theorem entrancePressure_hasDerivAt_y (v : TailData) (y η : ℝ) : |
| 704 | HasDerivAt (fun t => entrancePressure v t η) |
| 705 | ((1 / 2) * angular v.core.P v.core.dropLength v.core.lam (y, η) ^ 2) y := by |
| 706 | convert! ((pressureClock_hasDerivAt v.core y).const_mul (shape η ^ 2)).const_add |
| 707 | (SchedulePressure.axisPressure v η) using 1 |
| 708 | unfold angular clockEnergy |
| 709 | ring |
| 710 | |
| 711 | theorem pressureGradient_hasDerivAt_y (v : TailData) (y η : ℝ) : |
| 712 | HasDerivAt (fun t => pressureGradient v t η) |
| 713 | (-shapeGradient η * angular v.core.P v.core.dropLength v.core.lam (y, η) ^ 2) y := by |
| 714 | convert! ((pressureClock_hasDerivAt v.core y).const_mul |
| 715 | (2 * shapeGradient η * shape η ^ 2)).const_sub (deriv (SchedulePressure.axisPressure v) η) using 1 |
| 716 | unfold angular clockEnergy |
| 717 | ring |
| 718 | |
| 719 | theorem pressureClock_ideal (c : Parameters) {y : ℝ} (hy : y ≤ 0) : |
| 720 | pressureClock c y = (5 / 2) * clockEnergy c y := by |
| 721 | have hi : (∫ t in (0 : ℝ)..y, clockEnergy c t) = |
| 722 | c.P ^ 2 * ((Real.exp ((1 / 5 : ℝ) * y) - 1) / (1 / 5)) := by |
| 723 | calc |
| 724 | _ = ∫ t in (0 : ℝ)..y, c.P ^ 2 * Real.exp ((1 / 5 : ℝ) * t) := by |
| 725 | apply intervalIntegral.integral_congr |
| 726 | intro t ht |
| 727 | exact clockEnergy_ideal c (ht.2.trans (max_le le_rfl hy)) |
| 728 | _ = _ := by rw [intervalIntegral.integral_const_mul, integral_exp_mul_real (by norm_num)] |
| 729 | rw [pressureClock, OutgoingSchedule.primitive, hi, clockEnergy_ideal c hy] |
| 730 | ring |
| 731 | |
| 732 | theorem averagedDropSquare_early (c : Parameters) {y : ℝ} (hy : y ≤ 1) : |
| 733 | averagedDropSquare c y = 16 := by |
| 734 | apply historyAverage_constant |
| 735 | intro t ht |
| 736 | rw [dropCoefficient_early c.m (ht.2.trans (max_le (by norm_num) hy))] |
| 737 | norm_num |
| 738 | |
| 739 | theorem averagedDropSquare_hasDerivAt (c : Parameters) (y : ℝ) : |
| 740 | HasDerivAt (averagedDropSquare c) |
| 741 | (dropCoefficient c.m y ^ 2 - averagedDropSquare c y) y := |
| 742 | historyAverage_hasDerivAt ((dropCoefficient_contDiff c.m_pos).pow 2).continuous 16 y |
| 743 | |
| 744 | theorem averagedEnergy_hasDerivAt_y (c : Parameters) (y η : ℝ) : |
| 745 | HasDerivAt (fun t => averagedEnergy c t η) |
| 746 | (angular c.P c.dropLength c.lam (y, η) ^ 2 - averagedEnergy c y η) y := by |
| 747 | convert! (historyAverage_hasDerivAt (clockEnergy_contDiff c).continuous |
| 748 | ((5 / 6) * c.P ^ 2) y).const_mul (shape η ^ 2) using 1 |
| 749 | unfold averagedEnergy averagedClockEnergy angular clockEnergy |
| 750 | ring |
| 751 | |
| 752 | theorem averagedEnergy_hasDerivAt_eta (c : Parameters) (y η : ℝ) : |
| 753 | HasDerivAt (averagedEnergy c y) (-2 * shapeGradient η * averagedEnergy c y η) η := by |
| 754 | convert! (shapeSquare_hasDerivAt η).mul_const (averagedClockEnergy c y) using 1 |
| 755 | unfold averagedEnergy |
| 756 | ring |
| 757 | |
| 758 | theorem transportW_hasDerivAt (c : Parameters) (h y η : ℝ) : |
| 759 | HasDerivAt (fun t => transportW c h t η) |
| 760 | (-L h η * (dropCoefficient c.m y - averagedDrop c y)) y := by |
| 761 | convert! ((averagedDrop_hasDerivAt c y).const_mul (L h η)).const_sub 1 using 1 |
| 762 | ring |
| 763 | |
| 764 | /-- The part of the axial lag arising from the actual mass and squared-axial histories. -/ |
| 765 | noncomputable def geometricAxialLag (c : Parameters) (h y η : ℝ) : ℝ := |
| 766 | -transportW c h y η * dropCoefficient c.m y * η + |
| 767 | (4 * h * η ^ 3 - 2 * d η * η) * averagedDropSquare c y |
| 768 | |
| 769 | /-- The pressure and angular-energy part of the integrated axial lag. -/ |
| 770 | noncomputable def pressureAxialLag (v : TailData) (y η : ℝ) : ℝ := |
| 771 | -(2 * v.h * η + d η * shapeGradient η) * averagedEnergy v.core y η + |
| 772 | 4 * A v.h * η * entrancePressure v y η - d η * pressureGradient v y η |
| 773 | |
| 774 | noncomputable def axialLag (v : TailData) (y η : ℝ) : ℝ := |
| 775 | geometricAxialLag v.core v.h y η + pressureAxialLag v y η |
| 776 | |
| 777 | noncomputable def geometricAxialSource (c : Parameters) (h y η : ℝ) : ℝ := |
| 778 | -transportW c h y η * deriv (dropCoefficient c.m) y * η - |
| 779 | A h * (1 - 2 * dropCoefficient c.m y * η ^ 2) * (dropCoefficient c.m y * η) - |
| 780 | (D h + d η * dropCoefficient c.m y) * η * dropCoefficient c.m y |
| 781 | |
| 782 | noncomputable def pressureAxialSource (v : TailData) (y η : ℝ) : ℝ := |
| 783 | -d η * pressureGradient v y η + 4 * A v.h * η * entrancePressure v y η + |
| 784 | η * angular v.core.P v.core.dropLength v.core.lam (y, η) ^ 2 |
| 785 | |
| 786 | noncomputable def axialSource (v : TailData) (y η : ℝ) : ℝ := |
| 787 | geometricAxialSource v.core v.h y η + pressureAxialSource v y η |
| 788 | |
| 789 | theorem geometricAxialLag_hasDerivAt (c : Parameters) (h y η : ℝ) : |
| 790 | HasDerivAt (fun t => geometricAxialLag c h t η) |
| 791 | (geometricAxialSource c h y η - geometricAxialLag c h y η) y := by |
| 792 | have hk := ((dropCoefficient_contDiff c.m_pos).differentiable (by simp) y).hasDerivAt |
| 793 | have hd := (((transportW_hasDerivAt c h y η).fun_neg.fun_mul hk).mul_const η).fun_add |
| 794 | ((averagedDropSquare_hasDerivAt c y).const_mul (4 * h * η ^ 3 - 2 * d η * η)) |
| 795 | convert! hd using 1 |
| 796 | unfold geometricAxialSource geometricAxialLag transportW A D L d |
| 797 | ring |
| 798 | |
| 799 | theorem pressureAxialLag_hasDerivAt (v : TailData) (y η : ℝ) : |
| 800 | HasDerivAt (fun t => pressureAxialLag v t η) |
| 801 | (pressureAxialSource v y η - pressureAxialLag v y η) y := by |
| 802 | have hd := (((averagedEnergy_hasDerivAt_y v.core y η).const_mul |
| 803 | (-(2 * v.h * η + d η * shapeGradient η))).add |
| 804 | ((entrancePressure_hasDerivAt_y v y η).const_mul (4 * A v.h * η))).sub |
| 805 | ((pressureGradient_hasDerivAt_y v y η).const_mul (d η)) |
| 806 | convert! hd using 1 |
| 807 | unfold pressureAxialSource pressureAxialLag A |
| 808 | ring |
| 809 | |
| 810 | theorem axialLag_hasDerivAt (v : TailData) (y η : ℝ) : |
| 811 | HasDerivAt (fun t => axialLag v t η) (axialSource v y η - axialLag v y η) y := by |
| 812 | convert! (geometricAxialLag_hasDerivAt v.core v.h y η).add |
| 813 | (pressureAxialLag_hasDerivAt v y η) using 1 |
| 814 | unfold axialSource axialLag |
| 815 | ring |
| 816 | |
| 817 | /-- Normalized energy history `S/X`, including both ideal-prefix integrals. -/ |
| 818 | noncomputable def normalizedEnergyHistory (c : Parameters) (y η : ℝ) : ℝ := |
| 819 | η ^ 2 * averagedDropSquare c y - (1 / 2) * averagedEnergy c y η |
| 820 | |
| 821 | theorem normalizedEnergyHistory_hasDerivAt_eta (c : Parameters) (y η : ℝ) : |
| 822 | HasDerivAt (normalizedEnergyHistory c y) |
| 823 | (2 * η * averagedDropSquare c y + shapeGradient η * averagedEnergy c y η) η := by |
| 824 | convert! (((hasDerivAt_id η).pow 2).mul_const (averagedDropSquare c y)).sub |
| 825 | ((averagedEnergy_hasDerivAt_eta c y η).const_mul (1 / 2)) using 1 |
| 826 | simp only [id_eq] |
| 827 | ring |
| 828 | |
| 829 | /-- This is precisely the axial integrated-history formula (9); the linear |
| 830 | mass-history contribution `D(M-η Mη)/X` vanishes for `U=k(y)η`. -/ |
| 831 | theorem axialLag_integrated_history (v : TailData) (y η : ℝ) : |
| 832 | axialLag v y η = -transportW v.core v.h y η * (dropCoefficient v.core.m y * η) + |
| 833 | 4 * v.h * η * normalizedEnergyHistory v.core y η - |
| 834 | d η * deriv (normalizedEnergyHistory v.core y) η + |
| 835 | 4 * A v.h * η * entrancePressure v y η - |
| 836 | d η * deriv (entrancePressure v y) η := by |
| 837 | rw [(normalizedEnergyHistory_hasDerivAt_eta v.core y η).deriv, |
| 838 | (entrancePressure_hasDerivAt_eta v y η).deriv] |
| 839 | unfold axialLag geometricAxialLag pressureAxialLag normalizedEnergyHistory |
| 840 | ring |
| 841 | |
| 842 | theorem geometricAxialLag_ideal (c : Parameters) (h η : ℝ) {y : ℝ} (hy : y ≤ 0) : |
| 843 | geometricAxialLag c h y η = -20 * η + (32 + 32 * h) * η ^ 3 := by |
| 844 | unfold geometricAxialLag transportW |
| 845 | rw [averagedDrop_early c (by linarith), dropCoefficient_early c.m (by linarith), |
| 846 | averagedDropSquare_early c (by linarith)] |
| 847 | unfold L d |
| 848 | ring |
| 849 | |
| 850 | theorem pressureAxialLag_ideal (v : TailData) (η : ℝ) {y : ℝ} (hy : y ≤ 0) : |
| 851 | pressureAxialLag v y η = |
| 852 | 4 * A v.h * η * SchedulePressure.axisPressure v η - |
| 853 | d η * deriv (SchedulePressure.axisPressure v) η + |
| 854 | (5 / 6) * (5 * d η * shapeGradient η + (10 * A v.h + 1) * η) * |
| 855 | angular v.core.P v.core.dropLength v.core.lam (y, η) ^ 2 := by |
| 856 | unfold pressureAxialLag averagedEnergy entrancePressure pressureGradient |
| 857 | rw [averagedClockEnergy_ideal v.core hy, pressureClock_ideal v.core hy] |
| 858 | unfold angular clockEnergy A |
| 859 | ring |
| 860 | |
| 861 | theorem entrancePressure_eq_future (v : TailData) {y : ℝ} (hy : 0 ≤ y) |
| 862 | (hyend : y ≤ v.core.endpoint) : entrancePressure v y = FuturePressureBounds.Pi v y := by |
| 863 | funext η |
| 864 | exact (FuturePressureBounds.Pi_eq_radial_history v hy hyend η).symm |
| 865 | |
| 866 | theorem pressureGradient_eq_future (v : TailData) {y : ℝ} (hy : 0 ≤ y) |
| 867 | (hyend : y ≤ v.core.endpoint) : pressureGradient v y = deriv (FuturePressureBounds.Pi v y) := by |
| 868 | funext η |
| 869 | rw [← entrancePressure_eq_future v hy hyend] |
| 870 | exact (entrancePressure_hasDerivAt_eta v y η).deriv.symm |
| 871 | |
| 872 | noncomputable def pressureBound : ℝ := 10 * FuturePressureBounds.envelopeConstant |
| 873 | |
| 874 | theorem pressureBound_pos : 0 < pressureBound := |
| 875 | mul_pos (by norm_num) FuturePressureBounds.envelopeConstant_pos |
| 876 | |
| 877 | theorem actual_pressure_bounds (v : TailData) {y η : ℝ} (hy : 0 ≤ y) |
| 878 | (hyend : y ≤ v.core.endpoint) (hη : |η| ≤ 1) : |
| 879 | |entrancePressure v y η| ≤ pressureBound * angular v.core.P v.core.dropLength v.core.lam (y, η) ^ 2 ∧ |
| 880 | |pressureGradient v y η| ≤ pressureBound * |η| * angular v.core.P v.core.dropLength v.core.lam (y, η) ^ 2 ∧ |
| 881 | |deriv (pressureGradient v y) η| ≤ pressureBound * angular v.core.P v.core.dropLength v.core.lam (y, η) ^ 2 := by |
| 882 | rw [entrancePressure_eq_future v hy hyend, pressureGradient_eq_future v hy hyend] |
| 883 | have hb := FuturePressureBounds.uniform_pressure_bounds v hy hη |
| 884 | rw [finalAngular_before v η hyend] at hb |
| 885 | have hC := FuturePressureBounds.envelopeConstant_pos |
| 886 | unfold pressureBound |
| 887 | refine ⟨hb.1.trans ?_, hb.2.1.trans ?_, hb.2.2⟩ |
| 888 | · gcongr |
| 889 | linarith |
| 890 | · gcongr |
| 891 | linarith |
| 892 | |
| 893 | theorem geometricAxialLag_bound (c : Parameters) {h y η : ℝ} (hh : 0 ≤ h) |
| 894 | (hh1 : h ≤ 1 / 100) (hy : 0 ≤ y) (hη : |η| ≤ 1) : |
| 895 | |geometricAxialLag c h y η| ≤ 64 * |η| := by |
| 896 | have hk := dropCoefficient_bounds c.m y |
| 897 | have hK := averagedDropSquare_bounds c hy |
| 898 | have hW : |transportW c h y η| ≤ 3 := by |
| 899 | exact abs_le.mpr (transportW_bounds c hh hh1 hy hη |>.imp_right (fun h => h.trans (by norm_num))) |
| 900 | have hsq := parameter_square_le_one hη |
| 901 | have hd : 0 ≤ d η ∧ d η ≤ 1 := by unfold d; constructor <;> nlinarith [sq_nonneg η] |
| 902 | have hc : |4 * h * η ^ 2 - 2 * d η| ≤ 3 := by |
| 903 | apply abs_le.mpr |
| 904 | have hm := mul_le_mul_of_nonneg_left hsq hh |
| 905 | constructor <;> nlinarith [mul_nonneg hh (sq_nonneg η)] |
| 906 | have hfirst : |-(transportW c h y η) * dropCoefficient c.m y * η| ≤ 12 * |η| := by |
| 907 | rw [abs_mul, abs_mul, abs_neg, abs_of_nonneg hk.1] |
| 908 | have hm := mul_le_mul hW hk.2 hk.1 (by norm_num : (0 : ℝ) ≤ 3) |
| 909 | nlinarith [mul_le_mul_of_nonneg_right hm (abs_nonneg η)] |
| 910 | have hsecond : |(4 * h * η ^ 3 - 2 * d η * η) * averagedDropSquare c y| ≤ 48 * |η| := by |
| 911 | have he : 4 * h * η ^ 3 - 2 * d η * η = (4 * h * η ^ 2 - 2 * d η) * η := by ring |
| 912 | rw [he, abs_mul, abs_mul, abs_of_nonneg hK.1] |
| 913 | calc |
| 914 | _ ≤ (3 * |η|) * 16 := mul_le_mul |
| 915 | (mul_le_mul_of_nonneg_right hc (abs_nonneg η)) hK.2 hK.1 (by positivity) |
| 916 | _ = _ := by ring |
| 917 | exact (abs_add_le _ _).trans (by |
| 918 | change _ ≤ 64 * |η| |
| 919 | nlinarith [abs_nonneg η]) |
| 920 | |
| 921 | theorem pressure_coefficient_bound {h η : ℝ} (hh : 0 ≤ h) (hh1 : h ≤ 1 / 100) |
| 922 | (hη : |η| ≤ 1) : |2 * h * η + d η * shapeGradient η| ≤ 3 * |η| := by |
| 923 | have hd : 0 ≤ d η ∧ d η ≤ 1 := by |
| 924 | unfold d |
| 925 | constructor <;> nlinarith [parameter_square_le_one hη, sq_nonneg η] |
| 926 | calc |
| 927 | _ ≤ |2 * h * η| + |d η * shapeGradient η| := abs_add_le _ _ |
| 928 | _ = 2 * h * |η| + d η * |shapeGradient η| := by |
| 929 | rw [abs_mul, abs_mul, abs_mul, abs_of_nonneg (by norm_num : (0 : ℝ) ≤ 2), |
| 930 | abs_of_nonneg hh, abs_of_nonneg hd.1] |
| 931 | _ ≤ 2 * h * |η| + 2 * |η| := by |
| 932 | apply add_le_add_right |
| 933 | simpa only [one_mul] using |
| 934 | mul_le_mul hd.2 (abs_shapeGradient_le η) (abs_nonneg _) (by norm_num : (0 : ℝ) ≤ 1) |
| 935 | _ ≤ _ := by nlinarith [abs_nonneg η, mul_le_mul_of_nonneg_right hh1 (abs_nonneg η)] |
| 936 | |
| 937 | theorem pressureAxialLag_bound (v : TailData) {y η : ℝ} (hh1 : v.h ≤ 1 / 100) |
| 938 | (hy : 0 ≤ y) (hy' : y ≤ v.core.dropLength + 1) (hη : |η| ≤ 1) : |
| 939 | |pressureAxialLag v y η| ≤ (3 * (y + 1) + 4 * pressureBound) * |η| * |
| 940 | angular v.core.P v.core.dropLength v.core.lam (y, η) ^ 2 := by |
| 941 | have hend : y ≤ v.core.endpoint := by |
| 942 | have h0 := v.core.pulseStart_ge_hold |
| 943 | have h1 := v.core.pulseLength_pos |
| 944 | dsimp [Parameters.endpoint, Parameters.holdStart] at * |
| 945 | linarith |
| 946 | have hp := actual_pressure_bounds v hy hend hη |
| 947 | have hd : 0 ≤ d η ∧ d η ≤ 1 := by |
| 948 | unfold d |
| 949 | constructor <;> nlinarith [parameter_square_le_one hη, sq_nonneg η] |
| 950 | have hA : 0 ≤ 4 * A v.h ∧ 4 * A v.h ≤ 3 := by |
| 951 | unfold A |
| 952 | constructor <;> linarith [v.h_pos] |
| 953 | have hE : 0 ≤ averagedEnergy v.core y η := |
| 954 | mul_nonneg (sq_nonneg _) (averagedClockEnergy_nonneg v.core hy) |
| 955 | have hEb : averagedEnergy v.core y η ≤ (y + 1) * angular v.core.P v.core.dropLength v.core.lam (y, η) ^ 2 := by |
| 956 | exact (averagedEnergy_upper v.core hy hy' η).trans |
| 957 | (mul_le_mul_of_nonneg_right (by linarith) (sq_nonneg _)) |
| 958 | have hcoef := pressure_coefficient_bound v.h_pos.le hh1 hη |
| 959 | unfold pressureAxialLag |
| 960 | calc |
| 961 | _ ≤ |-(2 * v.h * η + d η * shapeGradient η) * averagedEnergy v.core y η| + |
| 962 | |4 * A v.h * η * entrancePressure v y η| + |d η * pressureGradient v y η| := |
| 963 | (abs_sub _ _).trans (add_le_add_left (abs_add_le _ _) _) |
| 964 | _ = |2 * v.h * η + d η * shapeGradient η| * averagedEnergy v.core y η + |
| 965 | (4 * A v.h * |η|) * |entrancePressure v y η| + d η * |pressureGradient v y η| := by |
| 966 | simp only [abs_mul, abs_neg, abs_of_nonneg hE, abs_of_nonneg hd.1] |
| 967 | rw [← abs_mul 4 (A v.h), abs_of_nonneg hA.1] |
| 968 | _ ≤ (3 * |η|) * ((y + 1) * angular v.core.P v.core.dropLength v.core.lam (y, η) ^ 2) + |
| 969 | (3 * |η|) * (pressureBound * angular v.core.P v.core.dropLength v.core.lam (y, η) ^ 2) + |
| 970 | pressureBound * |η| * angular v.core.P v.core.dropLength v.core.lam (y, η) ^ 2 := by |
| 971 | apply add_le_add |
| 972 | · exact add_le_add (mul_le_mul hcoef hEb hE (by positivity)) |
| 973 | (mul_le_mul (mul_le_mul_of_nonneg_right hA.2 (abs_nonneg η)) hp.1 |
| 974 | (abs_nonneg _) (by positivity)) |
| 975 | · simpa only [one_mul] using |
| 976 | mul_le_mul hd.2 hp.2.1 (abs_nonneg _) (by norm_num : (0 : ℝ) ≤ 1) |
| 977 | _ = _ := by ring |
| 978 | |
| 979 | noncomputable def axialBound : ℝ := 259 + 4 * pressureBound |
| 980 | |
| 981 | theorem axialBound_pos : 0 < axialBound := by unfold axialBound; linarith [pressureBound_pos] |
| 982 | |
| 983 | /-- The actual full axial lag has the required normalized drop bound. The |
| 984 | geometric part is suppressed by choosing the fixed prefix amplitude first. -/ |
| 985 | theorem axialLag_drop_bound (v : TailData) {y η : ℝ} (hh1 : v.h ≤ 1 / 100) |
| 986 | (hy : 0 ≤ y) (hy' : y ≤ v.core.dropLength + 1) (hη : |η| ≤ 1) |
| 987 | (hP : Real.exp (v.core.dropLength + 1) ≤ v.core.P ^ 2) : |
| 988 | |axialLag v y η| ≤ axialBound * |η| * (1 + y) * |
| 989 | angular v.core.P v.core.dropLength v.core.lam (y, η) ^ 2 := by |
| 990 | have hEp : (1 / 4 : ℝ) ≤ angular v.core.P v.core.dropLength v.core.lam (y, η) ^ 2 := by |
| 991 | have hP' : Real.exp y ≤ v.core.P ^ 2 := (Real.exp_le_exp.mpr hy').trans hP |
| 992 | have he : Real.exp y * Real.exp (-y) = 1 := by rw [← Real.exp_add]; simp |
| 993 | have hmul := mul_le_mul_of_nonneg_right hP' (Real.exp_pos (-y)).le |
| 994 | rw [he] at hmul |
| 995 | have hlow := angular_square_lower v.core hy hy' hη |
| 996 | nlinarith |
| 997 | have hg := geometricAxialLag_bound v.core v.h_pos.le hh1 hy hη |
| 998 | have hp := pressureAxialLag_bound v hh1 hy hy' hη |
| 999 | have hg' : |geometricAxialLag v.core v.h y η| ≤ |
| 1000 | 256 * |η| * angular v.core.P v.core.dropLength v.core.lam (y, η) ^ 2 := by |
| 1001 | apply hg.trans |
| 1002 | nlinarith [mul_le_mul_of_nonneg_left hEp (show 0 ≤ 256 * |η| by positivity)] |
| 1003 | unfold axialLag |
| 1004 | apply (abs_add_le _ _).trans |
| 1005 | apply (add_le_add hg' hp).trans |
| 1006 | unfold axialBound |
| 1007 | have hC : 0 ≤ (256 + 4 * pressureBound) * |η| * y * |
| 1008 | angular v.core.P v.core.dropLength v.core.lam (y, η) ^ 2 := by |
| 1009 | have := pressureBound_pos |
| 1010 | positivity |
| 1011 | nlinarith |
| 1012 | |
| 1013 | /-! ## The two small shear quantities in the cone test -/ |
| 1014 | |
| 1015 | noncomputable def shear (c : Parameters) (y η : ℝ) : ℝ := |
| 1016 | 2 * deriv (dropCoefficient c.m) y * η / angular c.P c.dropLength c.lam (y, η) |
| 1017 | |
| 1018 | noncomputable def directionRatio (v : TailData) (y η : ℝ) : ℝ := |
| 1019 | axialLag v y η / |
| 1020 | (angular v.core.P v.core.dropLength v.core.lam (y, η) * angularLag v.core v.h η y) |
| 1021 | |
| 1022 | noncomputable def radialA (c : Parameters) (y : ℝ) : ℝ := |
| 1023 | 2 - 2 * slope c.dropLength c.lam y |
| 1024 | |
| 1025 | theorem shear_is_actual (c : Parameters) (amp : ℝ → ℝ) {y : ℝ} |
| 1026 | (hy : y < c.pulseStart) (η : ℝ) : |
| 1027 | shear c y η = 2 * deriv (fun t => axial c amp (t, η)) y / |
| 1028 | angular c.P c.dropLength c.lam (y, η) := by |
| 1029 | have heq : (fun t => axial c amp (t, η)) =ᶠ[𝓝 y] (fun t => dropCoefficient c.m t * η) := by |
| 1030 | filter_upwards [Iio_mem_nhds hy] with t ht |
| 1031 | exact axial_before_pulse c amp η ht.le |
| 1032 | rw [heq.deriv_eq, |
| 1033 | ((((dropCoefficient_contDiff c.m_pos).differentiable (by simp) y).hasDerivAt).mul_const η).deriv] |
| 1034 | unfold shear |
| 1035 | ring |
| 1036 | |
| 1037 | theorem angular_square_ge_quarter (c : Parameters) {y η : ℝ} (hy : 0 ≤ y) |
| 1038 | (hy' : y ≤ c.dropLength + 1) (hη : |η| ≤ 1) |
| 1039 | (hP : Real.exp (c.dropLength + 1) ≤ c.P ^ 2) : |
| 1040 | (1 / 4 : ℝ) ≤ angular c.P c.dropLength c.lam (y, η) ^ 2 := by |
| 1041 | have hP' : Real.exp y ≤ c.P ^ 2 := (Real.exp_le_exp.mpr hy').trans hP |
| 1042 | have he : Real.exp y * Real.exp (-y) = 1 := by rw [← Real.exp_add]; simp |
| 1043 | have hm := mul_le_mul_of_nonneg_right hP' (Real.exp_pos (-y)).le |
| 1044 | rw [he] at hm |
| 1045 | have hlow := angular_square_lower c hy hy' hη |
| 1046 | nlinarith |
| 1047 | |
| 1048 | theorem shear_drop_abs (c : Parameters) {y η : ℝ} (hy : 1 ≤ y) |
| 1049 | (hy' : y ≤ c.dropLength + 1) (hη : |η| ≤ 1) |
| 1050 | (hP : Real.exp (c.dropLength + 1) ≤ c.P ^ 2) : |
| 1051 | |shear c y η| ≤ 4 * dropSpeed c.m := by |
| 1052 | have hy0 : 0 < y := by linarith |
| 1053 | have hd := dropCoefficient_deriv_bound c.m_pos hy0 |
| 1054 | have he := angular_pos c.P_pos c.dropLength c.lam (y, η) |
| 1055 | have he2 := angular_square_ge_quarter c hy0.le hy' hη hP |
| 1056 | have hhalf : (1 / 2 : ℝ) ≤ angular c.P c.dropLength c.lam (y, η) := by nlinarith |
| 1057 | have hd' : |deriv (dropCoefficient c.m) y| ≤ dropSpeed c.m := |
| 1058 | hd.trans (div_le_self (dropSpeed_pos c.m_pos).le hy) |
| 1059 | unfold shear |
| 1060 | rw [abs_div, abs_mul, abs_mul, abs_of_pos he] |
| 1061 | norm_num |
| 1062 | apply (div_le_iff₀ he).mpr |
| 1063 | have hprod := mul_le_mul hd' hη (abs_nonneg η) (dropSpeed_pos c.m_pos).le |
| 1064 | have hden := mul_le_mul_of_nonneg_left hhalf |
| 1065 | (mul_nonneg (by norm_num : (0 : ℝ) ≤ 4) (dropSpeed_pos c.m_pos).le) |
| 1066 | nlinarith |
| 1067 | |
| 1068 | theorem shear_drop_square (c : Parameters) {y η : ℝ} (hy : 1 ≤ y) |
| 1069 | (hy' : y ≤ c.dropLength + 1) (hη : |η| ≤ 1) |
| 1070 | (hP : Real.exp (c.dropLength + 1) ≤ c.P ^ 2) : |
| 1071 | shear c y η ^ 2 ≤ 16 * dropSpeed c.m ^ 2 := by |
| 1072 | have hb := shear_drop_abs c hy hy' hη hP |
| 1073 | have hd := dropSpeed_pos c.m_pos |
| 1074 | nlinarith [sq_abs (shear c y η), abs_nonneg (shear c y η)] |
| 1075 | |
| 1076 | theorem shear_direction_identity (v : TailData) (y η : ℝ) |
| 1077 | (hQ : 0 < angularLag v.core v.h η y) : |
| 1078 | |shear v.core y η * directionRatio v y η| = |
| 1079 | (2 * |deriv (dropCoefficient v.core.m) y| * |η| * |axialLag v y η|) / |
| 1080 | (angular v.core.P v.core.dropLength v.core.lam (y, η) ^ 2 * angularLag v.core v.h η y) := by |
| 1081 | have hE := angular_pos v.core.P_pos v.core.dropLength v.core.lam (y, η) |
| 1082 | simp only [shear, directionRatio, abs_mul, abs_div, abs_of_pos hE, abs_of_pos hQ] |
| 1083 | norm_num |
| 1084 | simp only [div_eq_mul_inv, mul_inv_rev, pow_two] |
| 1085 | ring |
| 1086 | |
| 1087 | theorem shear_direction_drop_bound (v : TailData) {y η : ℝ} |
| 1088 | (hh1 : v.h ≤ 1 / 100) (hy : 1 ≤ y) (hy' : y ≤ v.core.dropLength + 1) |
| 1089 | (hη : |η| ≤ 1) (hP : Real.exp (v.core.dropLength + 1) ≤ v.core.P ^ 2) |
| 1090 | (hhT : v.h ≤ Real.exp (-(v.core.holdStart + 3 / 5)) / 8) : |
| 1091 | |shear v.core y η * directionRatio v y η| ≤ |
| 1092 | (4 * axialBound / coneFloor) * dropSpeed v.core.m := by |
| 1093 | have hy0 : 0 < y := by linarith |
| 1094 | have hyT : y ≤ v.core.holdStart := by dsimp [Parameters.holdStart]; linarith |
| 1095 | have hE := angular_pos v.core.P_pos v.core.dropLength v.core.lam (y, η) |
| 1096 | have hQ := angularLag_pos v.core v.h_pos.le hh1 hy0.le hyT hη hhT |
| 1097 | have hQb := angularLag_lower v.core v.h_pos.le hh1 hy0.le hyT hη hhT |
| 1098 | have hQη : coneFloor * η ^ 2 ≤ angularLag v.core v.h η y := by |
| 1099 | nlinarith [mul_pos coneFloor_pos (Real.exp_pos (-y))] |
| 1100 | have hd := dropCoefficient_deriv_bound v.core.m_pos hy0 |
| 1101 | have hdy : |deriv (dropCoefficient v.core.m) y| * (1 + y) ≤ 2 * dropSpeed v.core.m := by |
| 1102 | have hmul := (le_div_iff₀ hy0).mp hd |
| 1103 | have h1 : |deriv (dropCoefficient v.core.m) y| ≤ |
| 1104 | |deriv (dropCoefficient v.core.m) y| * y := |
| 1105 | le_mul_of_one_le_right (abs_nonneg _) hy |
| 1106 | linarith |
| 1107 | have hN := axialLag_drop_bound v hh1 hy0.le hy' hη hP |
| 1108 | rw [shear_direction_identity v y η hQ] |
| 1109 | apply (div_le_iff₀ (mul_pos (sq_pos_of_pos hE) hQ)).mpr |
| 1110 | have hnum : 2 * |deriv (dropCoefficient v.core.m) y| * |η| * |axialLag v y η| ≤ |
| 1111 | 4 * axialBound * dropSpeed v.core.m * η ^ 2 * |
| 1112 | angular v.core.P v.core.dropLength v.core.lam (y, η) ^ 2 := by |
| 1113 | calc |
| 1114 | _ ≤ 2 * |deriv (dropCoefficient v.core.m) y| * |η| * |
| 1115 | (axialBound * |η| * (1 + y) * angular v.core.P v.core.dropLength v.core.lam (y, η) ^ 2) := |
| 1116 | mul_le_mul_of_nonneg_left hN (by positivity) |
| 1117 | _ = (2 * axialBound * η ^ 2 * angular v.core.P v.core.dropLength v.core.lam (y, η) ^ 2) * |
| 1118 | (|deriv (dropCoefficient v.core.m) y| * (1 + y)) := by rw [← sq_abs η]; ring |
| 1119 | _ ≤ _ := by |
| 1120 | have h := mul_le_mul_of_nonneg_left hdy |
| 1121 | (show 0 ≤ 2 * axialBound * η ^ 2 * angular v.core.P v.core.dropLength v.core.lam (y, η) ^ 2 by |
| 1122 | have := axialBound_pos |
| 1123 | positivity) |
| 1124 | convert! h using 1 |
| 1125 | ring |
| 1126 | apply hnum.trans |
| 1127 | have hc : 0 ≤ (4 * axialBound / coneFloor) * dropSpeed v.core.m * |
| 1128 | angular v.core.P v.core.dropLength v.core.lam (y, η) ^ 2 := by |
| 1129 | have := axialBound_pos |
| 1130 | have := coneFloor_pos |
| 1131 | have := dropSpeed_pos v.core.m_pos |
| 1132 | positivity |
| 1133 | have h := mul_le_mul_of_nonneg_left hQη hc |
| 1134 | convert! h using 1 <;> field_simp [coneFloor_pos.ne'] |
| 1135 | |
| 1136 | theorem radialA_drop (c : Parameters) {y : ℝ} (hy : 1 ≤ y) |
| 1137 | (hy' : y ≤ c.dropLength + 1) : radialA c y = 2 := by |
| 1138 | simp [radialA, slope_drop hy hy'] |
| 1139 | |
| 1140 | /-- Quantified strict margins in the preliminary drop cone. -/ |
| 1141 | theorem drop_cone_margins (v : TailData) {y η : ℝ} |
| 1142 | (hh1 : v.h ≤ 1 / 100) (hy : 1 ≤ y) (hy' : y ≤ v.core.dropLength + 1) |
| 1143 | (hη : |η| ≤ 1) (hP : Real.exp (v.core.dropLength + 1) ≤ v.core.P ^ 2) |
| 1144 | (hhT : v.h ≤ Real.exp (-(v.core.holdStart + 3 / 5)) / 8) |
| 1145 | (he : dropSpeed v.core.m ≤ min (1 / 8) (coneFloor / (16 * axialBound))) : |
| 1146 | (7 / 4 : ℝ) ≤ radialA v.core y - shear v.core y η * directionRatio v y η ∧ |
| 1147 | 2 * shear v.core y η * directionRatio v y η + shear v.core y η ^ 2 / radialA v.core y + |
| 1148 | (radialA v.core y - 2) * directionRatio v y η ^ 2 ≤ 5 / 8 := by |
| 1149 | have he1 := he.trans (min_le_left _ _) |
| 1150 | have he2 := he.trans (min_le_right _ _) |
| 1151 | have hsw := shear_direction_drop_bound v hh1 hy hy' hη hP hhT |
| 1152 | have hsq := shear_drop_square v.core hy hy' hη hP |
| 1153 | have hS : shear v.core y η * directionRatio v y η ≤ 1 / 4 := by |
| 1154 | have hc : (4 * axialBound / coneFloor) * dropSpeed v.core.m ≤ 1 / 4 := by |
| 1155 | have hmul := (le_div_iff₀ (mul_pos (by norm_num) axialBound_pos)).mp he2 |
| 1156 | calc |
| 1157 | _ = 4 * axialBound * dropSpeed v.core.m / coneFloor := by ring |
| 1158 | _ ≤ 1 / 4 := (div_le_iff₀ coneFloor_pos).mpr (by nlinarith) |
| 1159 | exact (le_abs_self _).trans (hsw.trans hc) |
| 1160 | have hsq' : shear v.core y η ^ 2 ≤ 1 / 4 := by |
| 1161 | have he0 := (dropSpeed_pos v.core.m_pos).le |
| 1162 | nlinarith |
| 1163 | rw [radialA_drop v.core hy hy'] |
| 1164 | constructor <;> nlinarith |
| 1165 | |
| 1166 | theorem linearLag_pos_after {r b : ℝ → ℝ} (hr : Continuous r) (hb : Continuous b) |
| 1167 | {q₀ a y : ℝ} (hay : a ≤ y) (ha : 0 < linearLag r b q₀ a) |
| 1168 | (hs : ∀ t ∈ Icc a y, 0 ≤ b t) : 0 < linearLag r b q₀ y := by |
| 1169 | let F := fun t => Real.exp (OutgoingSchedule.primitive r t) * b t |
| 1170 | have hF : Continuous F := (Real.continuous_exp.comp (primitive_continuous_of_continuous hr)).mul hb |
| 1171 | have hinit : 0 < q₀ + OutgoingSchedule.primitive F a := by |
| 1172 | exact (mul_pos_iff_of_pos_left (Real.exp_pos (-OutgoingSchedule.primitive r a))).mp ha |
| 1173 | have hi : 0 ≤ ∫ t in a..y, F t := intervalIntegral.integral_nonneg hay |
| 1174 | (fun t ht => mul_nonneg (Real.exp_pos _).le (hs t ht)) |
| 1175 | have hadd := intervalIntegral.integral_add_adjacent_intervals (μ := volume) |
| 1176 | (hF.intervalIntegrable 0 a) (hF.intervalIntegrable a y) |
| 1177 | have hfin : 0 < q₀ + OutgoingSchedule.primitive F y := by |
| 1178 | unfold OutgoingSchedule.primitive at hinit ⊢ |
| 1179 | linarith |
| 1180 | exact mul_pos (Real.exp_pos _) hfin |
| 1181 | |
| 1182 | theorem angularSource_hold_lower (v : TailData) {y η : ℝ} |
| 1183 | (hh1 : v.h ≤ 1 / 100) (hy : v.core.holdStart ≤ y) (hη : |η| ≤ 1) : |
| 1184 | v.core.lam / 2 - v.h ≤ angularSource v.core v.h η y := by |
| 1185 | have hy' : v.core.dropLength + 2 ≤ y := hy |
| 1186 | have hk : dropCoefficient v.core.m y = 0 := |
| 1187 | dropCoefficient_late v.core.m_pos (by |
| 1188 | dsimp [Parameters.dropLength] at hy' |
| 1189 | linarith) |
| 1190 | have hl := slope_hold (lam := v.core.lam) v.core.dropLength_pos.le hy' |
| 1191 | have hW := transportW_second_ramp v.core (y := y) v.h_pos.le hh1 (by linarith) hη |
| 1192 | have hD : 0 ≤ D v.h := by unfold D; linarith [v.h_pos] |
| 1193 | have hJ : 0 ≤ η * shapeGradient η := (sq_nonneg η).trans (eta_shapeGradient_bounds hη).1 |
| 1194 | rw [angularSource, hl, hk] |
| 1195 | simp only [mul_zero, add_zero, neg_neg] |
| 1196 | nlinarith [mul_le_mul_of_nonneg_left hW v.core.lam_pos.le, mul_nonneg hD hJ] |
| 1197 | |
| 1198 | /-- Positive incoming angular lag at every point of the unedited shaped hold. -/ |
| 1199 | theorem angularLag_pos_on_hold (v : TailData) {y η : ℝ} |
| 1200 | (hh1 : v.h ≤ 1 / 100) (hhT : v.h ≤ Real.exp (-(v.core.holdStart + 3 / 5)) / 8) |
| 1201 | (hy : v.core.holdStart ≤ y) (hη : |η| ≤ 1) : |
| 1202 | 0 < angularLag v.core v.h η y := by |
| 1203 | have hstart := angularLag_pos v.core v.h_pos.le hh1 v.core.holdStart_pos.le le_rfl hη hhT |
| 1204 | apply linearLag_pos_after (angularRate_contDiff v.core).continuous |
| 1205 | (angularSource_contDiff v.core v.h η).continuous hy hstart |
| 1206 | intro t ht |
| 1207 | have hsource := angularSource_hold_lower v hh1 ht.1 hη |
| 1208 | linarith [v.h_small] |
| 1209 | |
| 1210 | theorem angularLag_pos_at_pulseStart (v : TailData) {η : ℝ} |
| 1211 | (hh1 : v.h ≤ 1 / 100) (hhT : v.h ≤ Real.exp (-(v.core.holdStart + 3 / 5)) / 8) |
| 1212 | (hη : |η| ≤ 1) : 0 < angularLag v.core v.h η v.core.pulseStart := |
| 1213 | angularLag_pos_on_hold v hh1 hhT v.core.pulseStart_ge_hold hη |
| 1214 | |
| 1215 | /-! ## A parameter-uniform bound at the shaped-wait entrance -/ |
| 1216 | |
| 1217 | theorem shape_interval {η : ℝ} (hη : |η| ≤ 1) : (1 / 2 : ℝ) ≤ shape η ∧ shape η ≤ 1 := by |
| 1218 | have hs := parameter_square_le_one hη |
| 1219 | unfold shape |
| 1220 | rw [← one_div] |
| 1221 | constructor |
| 1222 | · apply (le_div_iff₀ (by positivity : 0 < 1 + η ^ 2)).mpr |
| 1223 | linarith |
| 1224 | · exact div_le_self (by norm_num) (by nlinarith [sq_nonneg η]) |
| 1225 | |
| 1226 | noncomputable def entranceTime (m : ℝ) : ℝ := Real.exp m + 12 |
| 1227 | |
| 1228 | theorem holdStart_eq_entranceTime (c : Parameters) : c.holdStart = entranceTime c.m := by |
| 1229 | unfold Parameters.holdStart Parameters.dropLength entranceTime |
| 1230 | ring |
| 1231 | |
| 1232 | noncomputable def energyEnvelope (P T : ℝ) : ℝ := P ^ 2 * Real.exp (2 * T) |
| 1233 | |
| 1234 | theorem clockEnergy_le_envelope (c : Parameters) {y T : ℝ} (hy : 0 ≤ y) (hyT : y ≤ T) : |
| 1235 | clockEnergy c y ≤ energyEnvelope c.P T := by |
| 1236 | have hb := (OutgoingPulseBounds.radialAmplitude_bounds c hy).2 |
| 1237 | have he := mul_le_mul_of_nonneg_left (Real.exp_le_exp.mpr hyT) c.P_pos.le |
| 1238 | have ha : 0 ≤ radialAmplitude c.P c.dropLength c.lam y := |
| 1239 | (mul_pos c.P_pos (Real.exp_pos _)).le |
| 1240 | have hsq := pow_le_pow_left₀ ha (hb.trans he) 2 |
| 1241 | simpa only [clockEnergy, energyEnvelope, mul_pow, ← Real.exp_nat_mul, Nat.cast_ofNat] using hsq |
| 1242 | |
| 1243 | theorem angular_square_le_envelope (c : Parameters) {y T η : ℝ} (hy : 0 ≤ y) |
| 1244 | (hyT : y ≤ T) (hη : |η| ≤ 1) : |
| 1245 | angular c.P c.dropLength c.lam (y, η) ^ 2 ≤ energyEnvelope c.P T := by |
| 1246 | have hs := shape_interval hη |
| 1247 | have hss : shape η ^ 2 ≤ 1 := by nlinarith [shape_pos η] |
| 1248 | have hb := clockEnergy_le_envelope c hy hyT |
| 1249 | have h := mul_le_mul hb hss (sq_nonneg _) (by unfold energyEnvelope; positivity) |
| 1250 | simpa only [angular, clockEnergy, mul_pow, mul_one] using h |
| 1251 | |
| 1252 | theorem averagedEnergy_le_envelope (c : Parameters) {y T η : ℝ} (hy : 0 ≤ y) |
| 1253 | (hyT : y ≤ T) (hη : |η| ≤ 1) : averagedEnergy c y η ≤ energyEnvelope c.P T := by |
| 1254 | have hT : 0 ≤ T := hy.trans hyT |
| 1255 | have hK : 0 ≤ energyEnvelope c.P T := by unfold energyEnvelope; positivity |
| 1256 | have he : 1 ≤ Real.exp (2 * T) := Real.one_le_exp_iff.mpr (by linarith) |
| 1257 | have hinit : (5 / 6 : ℝ) * c.P ^ 2 ≤ energyEnvelope c.P T := by |
| 1258 | unfold energyEnvelope |
| 1259 | nlinarith [sq_nonneg c.P, mul_le_mul_of_nonneg_left he (sq_nonneg c.P)] |
| 1260 | have hb := historyAverage_le (clockEnergy_contDiff c).continuous hinit hy |
| 1261 | (fun t ht => clockEnergy_le_envelope c ht.1 (ht.2.trans hyT)) |
| 1262 | have hs := shape_interval hη |
| 1263 | have hss : shape η ^ 2 ≤ 1 := by nlinarith [shape_pos η] |
| 1264 | have hp := mul_le_mul hss hb (averagedClockEnergy_nonneg c hy) (by norm_num : (0 : ℝ) ≤ 1) |
| 1265 | unfold averagedEnergy |
| 1266 | simp only [one_mul] at hp |
| 1267 | exact hp |
| 1268 | |
| 1269 | theorem angular_lower_envelope (c : Parameters) {y T η : ℝ} (hy : 0 ≤ y) |
| 1270 | (hyT : y ≤ T) (hη : |η| ≤ 1) : |
| 1271 | c.P * Real.exp (-T) / 2 ≤ angular c.P c.dropLength c.lam (y, η) := by |
| 1272 | have hb := (OutgoingPulseBounds.radialAmplitude_bounds c hy).1 |
| 1273 | have he := mul_le_mul_of_nonneg_left (Real.exp_le_exp.mpr (neg_le_neg hyT)) c.P_pos.le |
| 1274 | have hp := mul_le_mul (he.trans hb) (shape_interval hη).1 (by norm_num : (0 : ℝ) ≤ 1 / 2) |
| 1275 | (by exact (mul_pos c.P_pos (Real.exp_pos _)).le) |
| 1276 | simpa only [angular, div_eq_mul_inv, one_div, mul_one, one_mul] using hp |
| 1277 | |
| 1278 | theorem pressureAxialLag_le_envelope (v : TailData) {y T η : ℝ} (hh1 : v.h ≤ 1 / 100) |
| 1279 | (hy : 0 ≤ y) (hyT : y ≤ T) (hyend : y ≤ v.core.endpoint) (hη : |η| ≤ 1) : |
| 1280 | |pressureAxialLag v y η| ≤ (3 + 4 * pressureBound) * |η| * energyEnvelope v.core.P T := by |
| 1281 | have hp := actual_pressure_bounds v hy hyend hη |
| 1282 | have hEE := angular_square_le_envelope v.core hy hyT hη |
| 1283 | have hB := averagedEnergy_le_envelope v.core hy hyT hη |
| 1284 | have hB0 : 0 ≤ averagedEnergy v.core y η := |
| 1285 | mul_nonneg (sq_nonneg _) (averagedClockEnergy_nonneg v.core hy) |
| 1286 | have hK : 0 ≤ energyEnvelope v.core.P T := by unfold energyEnvelope; positivity |
| 1287 | have hC := pressureBound_pos.le |
| 1288 | have hd : 0 ≤ d η ∧ d η ≤ 1 := by |
| 1289 | unfold d |
| 1290 | constructor <;> nlinarith [parameter_square_le_one hη, sq_nonneg η] |
| 1291 | have hA : 0 ≤ 4 * A v.h ∧ 4 * A v.h ≤ 3 := by |
| 1292 | unfold A |
| 1293 | constructor <;> linarith [v.h_pos] |
| 1294 | have hcoef := pressure_coefficient_bound v.h_pos.le hh1 hη |
| 1295 | have hp' := hp.1.trans (mul_le_mul_of_nonneg_left hEE hC) |
| 1296 | have hg' := hp.2.1.trans (mul_le_mul_of_nonneg_left hEE (mul_nonneg hC (abs_nonneg η))) |
| 1297 | unfold pressureAxialLag |
| 1298 | calc |
| 1299 | _ ≤ |-(2 * v.h * η + d η * shapeGradient η) * averagedEnergy v.core y η| + |
| 1300 | |4 * A v.h * η * entrancePressure v y η| + |d η * pressureGradient v y η| := |
| 1301 | (abs_sub _ _).trans (add_le_add_left (abs_add_le _ _) _) |
| 1302 | _ = |2 * v.h * η + d η * shapeGradient η| * averagedEnergy v.core y η + |
| 1303 | (4 * A v.h * |η|) * |entrancePressure v y η| + d η * |pressureGradient v y η| := by |
| 1304 | simp only [abs_mul, abs_neg, abs_of_nonneg hB0, abs_of_nonneg hd.1] |
| 1305 | rw [← abs_mul 4 (A v.h), abs_of_nonneg hA.1] |
| 1306 | _ ≤ (3 * |η|) * energyEnvelope v.core.P T + |
| 1307 | (3 * |η|) * (pressureBound * energyEnvelope v.core.P T) + |
| 1308 | pressureBound * |η| * energyEnvelope v.core.P T := by |
| 1309 | apply add_le_add |
| 1310 | · exact add_le_add (mul_le_mul hcoef hB hB0 (by positivity)) |
| 1311 | (mul_le_mul (mul_le_mul_of_nonneg_right hA.2 (abs_nonneg η)) hp' |
| 1312 | (abs_nonneg _) (by positivity)) |
| 1313 | · simpa only [one_mul] using mul_le_mul hd.2 hg' (abs_nonneg _) (by norm_num : (0 : ℝ) ≤ 1) |
| 1314 | _ = _ := by ring |
| 1315 | |
| 1316 | theorem axialLag_le_envelope (v : TailData) {y T η : ℝ} (hh1 : v.h ≤ 1 / 100) |
| 1317 | (hy : 0 ≤ y) (hyT : y ≤ T) (hyend : y ≤ v.core.endpoint) (hη : |η| ≤ 1) : |
| 1318 | |axialLag v y η| ≤ 64 + (3 + 4 * pressureBound) * energyEnvelope v.core.P T := by |
| 1319 | have hg := geometricAxialLag_bound v.core v.h_pos.le hh1 hy hη |
| 1320 | have hp := pressureAxialLag_le_envelope v hh1 hy hyT hyend hη |
| 1321 | have hK : 0 ≤ (3 + 4 * pressureBound) * energyEnvelope v.core.P T := by |
| 1322 | have := pressureBound_pos |
| 1323 | unfold energyEnvelope |
| 1324 | positivity |
| 1325 | unfold axialLag |
| 1326 | apply (abs_add_le _ _).trans |
| 1327 | have hsum := add_le_add hg hp |
| 1328 | have hg1 := mul_le_mul_of_nonneg_left hη (by norm_num : (0 : ℝ) ≤ 64) |
| 1329 | have hp1 := mul_le_mul_of_nonneg_left hη hK |
| 1330 | nlinarith |
| 1331 | |
| 1332 | noncomputable def entranceRatioBound (P m : ℝ) : ℝ := |
| 1333 | (64 + (3 + 4 * pressureBound) * energyEnvelope P (entranceTime m)) / |
| 1334 | ((P * Real.exp (-entranceTime m) / 2) * (coneFloor * Real.exp (-entranceTime m))) |
| 1335 | |
| 1336 | theorem entranceRatioBound_pos {P : ℝ} (hP : 0 < P) (m : ℝ) : 0 < entranceRatioBound P m := by |
| 1337 | unfold entranceRatioBound energyEnvelope |
| 1338 | have := pressureBound_pos |
| 1339 | have := coneFloor_pos |
| 1340 | positivity |
| 1341 | |
| 1342 | /-- A fixed pre-`λ` bound on the ratio throughout the first ramp, drop, and |
| 1343 | shaped-wait entrance. It depends only on the already fixed `P,m`. -/ |
| 1344 | theorem directionRatio_entrance_bound (v : TailData) {y η : ℝ} (hh1 : v.h ≤ 1 / 100) |
| 1345 | (hy : 0 ≤ y) (hyT : y ≤ v.core.holdStart) (hη : |η| ≤ 1) |
| 1346 | (hhT : v.h ≤ Real.exp (-(v.core.holdStart + 3 / 5)) / 8) : |
| 1347 | |directionRatio v y η| ≤ entranceRatioBound v.core.P v.core.m := by |
| 1348 | have hend : y ≤ v.core.endpoint := by |
| 1349 | have h0 := v.core.pulseStart_ge_hold |
| 1350 | have h1 := v.core.pulseLength_pos |
| 1351 | dsimp [Parameters.endpoint] |
| 1352 | linarith |
| 1353 | have hN := axialLag_le_envelope v hh1 hy hyT hend hη |
| 1354 | have hE := angular_lower_envelope v.core hy hyT hη |
| 1355 | have hQ := angularLag_lower v.core v.h_pos.le hh1 hy hyT hη hhT |
| 1356 | have hQ' : coneFloor * Real.exp (-v.core.holdStart) ≤ angularLag v.core v.h η y := by |
| 1357 | have he := mul_le_mul_of_nonneg_left (Real.exp_le_exp.mpr (neg_le_neg hyT)) coneFloor_pos.le |
| 1358 | nlinarith [mul_nonneg coneFloor_pos.le (sq_nonneg η)] |
| 1359 | have hden := mul_le_mul hE hQ' (mul_pos coneFloor_pos (Real.exp_pos _)).le |
| 1360 | (angular_pos v.core.P_pos v.core.dropLength v.core.lam (y, η)).le |
| 1361 | have hlo : 0 < (v.core.P * Real.exp (-v.core.holdStart) / 2) * |
| 1362 | (coneFloor * Real.exp (-v.core.holdStart)) := by |
| 1363 | have := v.core.P_pos |
| 1364 | have := coneFloor_pos |
| 1365 | positivity |
| 1366 | have hD : 0 < angular v.core.P v.core.dropLength v.core.lam (y, η) * angularLag v.core v.h η y := |
| 1367 | hlo.trans_le hden |
| 1368 | have hnum : 0 ≤ 64 + (3 + 4 * pressureBound) * energyEnvelope v.core.P v.core.holdStart := by |
| 1369 | have := pressureBound_pos |
| 1370 | unfold energyEnvelope |
| 1371 | positivity |
| 1372 | unfold directionRatio |
| 1373 | rw [abs_div, abs_of_pos hD] |
| 1374 | calc |
| 1375 | _ ≤ (64 + (3 + 4 * pressureBound) * energyEnvelope v.core.P v.core.holdStart) / |
| 1376 | (angular v.core.P v.core.dropLength v.core.lam (y, η) * angularLag v.core v.h η y) := |
| 1377 | div_le_div_of_nonneg_right hN hD.le |
| 1378 | _ ≤ (64 + (3 + 4 * pressureBound) * energyEnvelope v.core.P v.core.holdStart) / |
| 1379 | ((v.core.P * Real.exp (-v.core.holdStart) / 2) * (coneFloor * Real.exp (-v.core.holdStart))) := |
| 1380 | div_le_div_of_nonneg_left hnum hlo hden |
| 1381 | _ = _ := by rw [holdStart_eq_entranceTime]; rfl |
| 1382 | |
| 1383 | /-! ## Identification with the canonical, incoming-history fields -/ |
| 1384 | |
| 1385 | theorem linearLag_eq_of_solution {r b f : ℝ → ℝ} (hr : Continuous r) |
| 1386 | (hb : Continuous b) {q₀ y : ℝ} (hf₀ : f 0 = q₀) |
| 1387 | (hf : ∀ t ∈ uIcc (0 : ℝ) y, HasDerivAt f (b t - r t * f t) t) : |
| 1388 | f y = linearLag r b q₀ y := by |
| 1389 | have hd : ∀ t ∈ uIcc (0 : ℝ) y, |
| 1390 | HasDerivAt (fun t => Real.exp (OutgoingSchedule.primitive r t) * f t) |
| 1391 | (Real.exp (OutgoingSchedule.primitive r t) * b t) t := by |
| 1392 | intro t ht |
| 1393 | convert! ((primitive_hasDerivAt hr t).exp.mul (hf t ht)) using 1 |
| 1394 | ring |
| 1395 | have hi := intervalIntegral.integral_eq_sub_of_hasDerivAt hd |
| 1396 | (((Real.continuous_exp.comp (primitive_continuous_of_continuous hr)).mul hb).intervalIntegrable 0 y) |
| 1397 | simp only [OutgoingSchedule.primitive, intervalIntegral.integral_same, Real.exp_zero, |
| 1398 | one_mul, hf₀] at hi |
| 1399 | change (∫ t in (0 : ℝ)..y, Real.exp (OutgoingSchedule.primitive r t) * b t) = |
| 1400 | Real.exp (OutgoingSchedule.primitive r y) * f y - q₀ at hi |
| 1401 | unfold linearLag |
| 1402 | have he : Real.exp (-OutgoingSchedule.primitive r y) * |
| 1403 | Real.exp (OutgoingSchedule.primitive r y) = 1 := by rw [← Real.exp_add]; simp |
| 1404 | change f y = Real.exp (-OutgoingSchedule.primitive r y) * |
| 1405 | (q₀ + ∫ t in (0 : ℝ)..y, Real.exp (OutgoingSchedule.primitive r t) * b t) |
| 1406 | rw [hi] |
| 1407 | calc |
| 1408 | f y = (Real.exp (-OutgoingSchedule.primitive r y) * |
| 1409 | Real.exp (OutgoingSchedule.primitive r y)) * f y := by rw [he, one_mul] |
| 1410 | _ = _ := by ring |
| 1411 | |
| 1412 | theorem canonical_Ubar_before (v : TailData) (Amp : ℝ → ℝ) {y : ℝ} |
| 1413 | (hy : y ≤ v.core.pulseStart) (η : ℝ) : |
| 1414 | OutgoingHistories.Ubar v Amp (y, η) = averagedDrop v.core y * η := by |
| 1415 | exact averagedDrop_is_mass_history v.core Amp η hy |
| 1416 | |
| 1417 | theorem canonical_Ubar_parameter_before (v : TailData) {Amp : ℝ → ℝ} |
| 1418 | (ha : ContDiff ℝ ∞ Amp) {y : ℝ} (hy : y ≤ v.core.pulseStart) (η : ℝ) : |
| 1419 | OutgoingHistories.dEta (OutgoingHistories.Ubar v Amp) (y, η) = averagedDrop v.core y := by |
| 1420 | have he : (fun η => OutgoingHistories.Ubar v Amp (y, η)) = |
| 1421 | fun η => averagedDrop v.core y * η := funext (canonical_Ubar_before v Amp hy) |
| 1422 | rw [OutgoingHistories.dEta_eq_deriv (OutgoingHistories.Ubar_smooth v ha), he] |
| 1423 | simp |
| 1424 | |
| 1425 | theorem canonical_W_before (v : TailData) {Amp : ℝ → ℝ} (ha : ContDiff ℝ ∞ Amp) |
| 1426 | {y : ℝ} (hy : y ≤ v.core.pulseStart) (η : ℝ) : |
| 1427 | OutgoingHistories.W v Amp (y, η) = transportW v.core v.h y η := by |
| 1428 | rw [OutgoingHistories.W_formula v ha, canonical_Ubar_before v Amp hy, |
| 1429 | canonical_Ubar_parameter_before v ha hy] |
| 1430 | simp only [transportW, L, StressAlgebra.axialExponent, StressAlgebra.coordinateFactor] |
| 1431 | ring |
| 1432 | |
| 1433 | theorem canonical_E_parameter_ratio {v : TailData} {K : ℝ} |
| 1434 | (w : UniformAngularReset.ResetWitness v K) {y : ℝ} (hy : y ≤ v.core.endpoint) (η : ℝ) : |
| 1435 | OutgoingHistories.dEta (OutgoingHistories.E w) (y, η) / |
| 1436 | OutgoingHistories.E w (y, η) = -shapeGradient η := by |
| 1437 | have he : (fun η => OutgoingHistories.E w (y, η)) = |
| 1438 | fun η => radialAmplitude v.core.P v.core.dropLength v.core.lam y * shape η := |
| 1439 | funext (fun η => OutgoingHistories.E_before w η hy) |
| 1440 | have hd := (shape_hasDerivAt η).const_mul |
| 1441 | (radialAmplitude v.core.P v.core.dropLength v.core.lam y) |
| 1442 | have he' : OutgoingHistories.dEta (OutgoingHistories.E w) (y, η) = |
| 1443 | -shapeGradient η * OutgoingHistories.E w (y, η) := by |
| 1444 | rw [OutgoingHistories.dEta_eq_deriv (OutgoingHistories.E_smooth w), he, hd.deriv, |
| 1445 | OutgoingHistories.E_before w η hy] |
| 1446 | simp only [angular] |
| 1447 | ring |
| 1448 | rw [he', mul_div_cancel_right₀ _ (OutgoingHistories.E_pos w (y, η)).ne'] |
| 1449 | |
| 1450 | theorem canonical_H_radial_ratio {v : TailData} {K : ℝ} |
| 1451 | (w : UniformAngularReset.ResetWitness v K) {y : ℝ} (hy : y < v.core.endpoint) (η : ℝ) : |
| 1452 | OutgoingHistories.dY (OutgoingHistories.H w) (y, η) / |
| 1453 | OutgoingHistories.H w (y, η) = slope v.core.dropLength v.core.lam y := by |
| 1454 | have he : (fun t => OutgoingHistories.H w (t, η)) =ᶠ[𝓝 y] |
| 1455 | (fun t => Real.exp (t / 2) * (radialAmplitude v.core.P v.core.dropLength v.core.lam t * shape η)) := by |
| 1456 | filter_upwards [Iio_mem_nhds hy] with t ht |
| 1457 | simp only [OutgoingHistories.H, OutgoingHistories.E_before w η ht.le, angular] |
| 1458 | have hd := (((hasDerivAt_id y).div_const 2).exp).mul |
| 1459 | ((radialAmplitude_hasDerivAt v.core.P v.core.dropLength v.core.lam y).mul_const (shape η)) |
| 1460 | have hd' := hd.congr_of_eventuallyEq he |
| 1461 | have hx := (OutgoingHistories.dY_hasDerivAt (OutgoingHistories.H_smooth w) (y, η)).unique hd' |
| 1462 | have hp : OutgoingHistories.dY (OutgoingHistories.H w) (y, η) = |
| 1463 | slope v.core.dropLength v.core.lam y * OutgoingHistories.H w (y, η) := by |
| 1464 | rw [hx, OutgoingHistories.H, OutgoingHistories.E_before w η hy.le] |
| 1465 | simp only [angular, id_eq] |
| 1466 | ring |
| 1467 | rw [hp, mul_div_cancel_right₀ _ (OutgoingHistories.H_pos w (y, η)).ne'] |
| 1468 | |
| 1469 | theorem canonical_Sq_before {v : TailData} {K : ℝ} |
| 1470 | (w : UniformAngularReset.ResetWitness v K) {Amp : ℝ → ℝ} |
| 1471 | (ha : ContDiff ℝ ∞ Amp) {y : ℝ} (hy : y ≤ v.core.pulseStart) (η : ℝ) : |
| 1472 | OutgoingHistories.Sq w Amp (y, η) = angularSource v.core v.h η y := by |
| 1473 | have hyend : y < v.core.endpoint := by |
| 1474 | dsimp [Parameters.endpoint] |
| 1475 | linarith [v.core.pulseLength_pos] |
| 1476 | rw [OutgoingHistories.Sq_formula, canonical_W_before v ha hy, |
| 1477 | canonical_H_radial_ratio w hyend, OutgoingHistories.U_before_pulse v Amp η hy, |
| 1478 | canonical_E_parameter_ratio w hyend.le] |
| 1479 | simp only [angularSource, StressAlgebra.axialExponent, StressAlgebra.coordinateFactor, D, d] |
| 1480 | ring |
| 1481 | |
| 1482 | /-- The positive scalar lag is exactly the canonical integrated angular stress. |
| 1483 | No positivity or cone assumption is used in this identification. -/ |
| 1484 | theorem canonical_Qs_before {v : TailData} {K : ℝ} |
| 1485 | (w : UniformAngularReset.ResetWitness v K) {Amp : ℝ → ℝ} |
| 1486 | (ha : ContDiff ℝ ∞ Amp) {y : ℝ} (hy : 0 ≤ y) (hy' : y ≤ v.core.pulseStart) (η : ℝ) : |
| 1487 | OutgoingHistories.Qs w Amp (y, η) = angularLag v.core v.h η y := by |
| 1488 | unfold angularLag |
| 1489 | apply linearLag_eq_of_solution (f := fun t => OutgoingHistories.Qs w Amp (t, η)) |
| 1490 | (angularRate_contDiff v.core).continuous (angularSource_contDiff v.core v.h η).continuous |
| 1491 | · rw [OutgoingHistories.Qs_initial w ha] |
| 1492 | simp only [idealAngularLag, idealAngularSource, L, D, d, shapeGradient, |
| 1493 | StressAlgebra.axialExponent, StressAlgebra.coordinateFactor] |
| 1494 | · intro t ht |
| 1495 | have ht' : t ≤ v.core.pulseStart := ((uIcc_of_le hy ▸ ht).2).trans hy' |
| 1496 | have htend : t < v.core.endpoint := by |
| 1497 | dsimp [Parameters.endpoint] |
| 1498 | linarith [v.core.pulseLength_pos] |
| 1499 | have hd := OutgoingHistories.Qs_hasDerivAt w ha (t, η) |
| 1500 | rw [canonical_Sq_before w ha ht', canonical_H_radial_ratio w htend] at hd |
| 1501 | exact hd |
| 1502 | |
| 1503 | theorem canonical_Qs_pos_at_pulseStart {v : TailData} {K : ℝ} |
| 1504 | (w : UniformAngularReset.ResetWitness v K) {Amp : ℝ → ℝ} |
| 1505 | (ha : ContDiff ℝ ∞ Amp) (hh1 : v.h ≤ 1 / 100) |
| 1506 | (hhT : v.h ≤ Real.exp (-(v.core.holdStart + 3 / 5)) / 8) |
| 1507 | {η : ℝ} (hη : |η| ≤ 1) : |
| 1508 | 0 < OutgoingHistories.Qs w Amp (v.core.pulseStart, η) := by |
| 1509 | rw [canonical_Qs_before w ha v.core.pulseStart_pos.le le_rfl] |
| 1510 | exact angularLag_pos_at_pulseStart v hh1 hhT hη |
| 1511 | |
| 1512 | theorem canonical_Pi_before {v : TailData} {K : ℝ} |
| 1513 | (w : UniformAngularReset.ResetWitness v K) {y : ℝ} |
| 1514 | (hy : y ≤ v.core.endpoint) (η : ℝ) : |
| 1515 | OutgoingHistories.Pi w (y, η) = entrancePressure v y η := by |
| 1516 | have hi : (∫ t in (0 : ℝ)..y, OutgoingHistories.pressureWeight w (t, η)) = |
| 1517 | (shape η ^ 2 / 2) * ∫ t in (0 : ℝ)..y, clockEnergy v.core t := by |
| 1518 | rw [← intervalIntegral.integral_const_mul] |
| 1519 | apply intervalIntegral.integral_congr |
| 1520 | intro t ht |
| 1521 | have ht' : t ≤ v.core.endpoint := |
| 1522 | ht.2.trans (max_le (SchedulePressure.endpoint_pos v).le hy) |
| 1523 | simp only [OutgoingHistories.pressureWeight, OutgoingHistories.E_before w η ht', |
| 1524 | angular, clockEnergy] |
| 1525 | ring |
| 1526 | change OutgoingHistories.initialPi v η + |
| 1527 | (∫ t in (0 : ℝ)..y, OutgoingHistories.pressureWeight w (t, η)) = _ |
| 1528 | rw [hi] |
| 1529 | unfold OutgoingHistories.initialPi entrancePressure pressureClock OutgoingSchedule.primitive |
| 1530 | ring |
| 1531 | |
| 1532 | theorem canonical_S_before {v : TailData} {K : ℝ} |
| 1533 | (w : UniformAngularReset.ResetWitness v K) (Amp : ℝ → ℝ) {y : ℝ} |
| 1534 | (hy : y ≤ v.core.pulseStart) (η : ℝ) : |
| 1535 | OutgoingHistories.S w Amp (y, η) / Real.exp y = normalizedEnergyHistory v.core y η := by |
| 1536 | have hk : IntervalIntegrable (fun t => Real.exp t * dropCoefficient v.core.m t ^ 2) volume 0 y := |
| 1537 | (Real.continuous_exp.fun_mul ((dropCoefficient_contDiff v.core.m_pos).continuous.pow 2)).intervalIntegrable 0 y |
| 1538 | have he : IntervalIntegrable (fun t => Real.exp t * clockEnergy v.core t) volume 0 y := |
| 1539 | (Real.continuous_exp.fun_mul (clockEnergy_contDiff v.core).continuous).intervalIntegrable 0 y |
| 1540 | have hi : (∫ t in (0 : ℝ)..y, OutgoingHistories.energyWeight w Amp (t, η)) = |
| 1541 | η ^ 2 * (∫ t in (0 : ℝ)..y, Real.exp t * dropCoefficient v.core.m t ^ 2) - |
| 1542 | (shape η ^ 2 / 2) * ∫ t in (0 : ℝ)..y, Real.exp t * clockEnergy v.core t := by |
| 1543 | rw [← intervalIntegral.integral_const_mul, ← intervalIntegral.integral_const_mul, |
| 1544 | ← intervalIntegral.integral_sub (hk.const_mul _) (he.const_mul _)] |
| 1545 | apply intervalIntegral.integral_congr |
| 1546 | intro t ht |
| 1547 | have ht' : t ≤ v.core.pulseStart := |
| 1548 | ht.2.trans (max_le v.core.pulseStart_pos.le hy) |
| 1549 | have htend : t ≤ v.core.endpoint := by |
| 1550 | dsimp [Parameters.endpoint] |
| 1551 | linarith [v.core.pulseLength_pos] |
| 1552 | simp only [OutgoingHistories.energyWeight, OutgoingHistories.energyDensity, |
| 1553 | OutgoingHistories.X, OutgoingHistories.U_before_pulse v Amp η ht', |
| 1554 | OutgoingHistories.E_before w η htend, angular, clockEnergy] |
| 1555 | ring |
| 1556 | change (OutgoingHistories.initialS v η + |
| 1557 | (∫ t in (0 : ℝ)..y, OutgoingHistories.energyWeight w Amp (t, η))) / Real.exp y = _ |
| 1558 | rw [hi] |
| 1559 | unfold normalizedEnergyHistory averagedDropSquare averagedEnergy averagedClockEnergy |
| 1560 | rw [historyAverage_formula, historyAverage_formula] |
| 1561 | unfold OutgoingHistories.initialS |
| 1562 | rw [Real.exp_neg] |
| 1563 | ring |
| 1564 | |
| 1565 | theorem canonical_M_before (v : TailData) (Amp : ℝ → ℝ) {y : ℝ} |
| 1566 | (hy : y ≤ v.core.pulseStart) (η : ℝ) : |
| 1567 | OutgoingHistories.M v Amp (y, η) = Real.exp y * (averagedDrop v.core y * η) := by |
| 1568 | have he := canonical_Ubar_before v Amp hy η |
| 1569 | change OutgoingHistories.M v Amp (y, η) / Real.exp y = _ at he |
| 1570 | exact (div_eq_iff (Real.exp_pos y).ne').mp he |>.trans (by ring) |
| 1571 | |
| 1572 | theorem canonical_Ns_before {v : TailData} {K : ℝ} |
| 1573 | (w : UniformAngularReset.ResetWitness v K) {Amp : ℝ → ℝ} |
| 1574 | (ha : ContDiff ℝ ∞ Amp) {y : ℝ} (hy : y ≤ v.core.pulseStart) (η : ℝ) : |
| 1575 | OutgoingHistories.Ns w Amp (y, η) = axialLag v y η := by |
| 1576 | have hyend : y ≤ v.core.endpoint := by |
| 1577 | dsimp [Parameters.endpoint] |
| 1578 | linarith [v.core.pulseLength_pos] |
| 1579 | have hM : (fun η => OutgoingHistories.M v Amp (y, η)) = |
| 1580 | fun η => Real.exp y * (averagedDrop v.core y * η) := |
| 1581 | funext (canonical_M_before v Amp hy) |
| 1582 | have hMd : OutgoingHistories.dEta (OutgoingHistories.M v Amp) (y, η) = |
| 1583 | Real.exp y * averagedDrop v.core y := by |
| 1584 | rw [OutgoingHistories.dEta_eq_deriv (OutgoingHistories.M_smooth v ha), hM] |
| 1585 | simp |
| 1586 | have hS : (fun η => OutgoingHistories.S w Amp (y, η)) = |
| 1587 | fun η => Real.exp y * normalizedEnergyHistory v.core y η := by |
| 1588 | funext η |
| 1589 | have hs := (div_eq_iff (Real.exp_pos y).ne').mp (canonical_S_before w Amp hy η) |
| 1590 | exact hs.trans (by ring) |
| 1591 | have hSd : OutgoingHistories.dEta (OutgoingHistories.S w Amp) (y, η) = |
| 1592 | Real.exp y * deriv (normalizedEnergyHistory v.core y) η := by |
| 1593 | rw [OutgoingHistories.dEta_eq_deriv (OutgoingHistories.S_smooth w ha), hS, |
| 1594 | ((normalizedEnergyHistory_hasDerivAt_eta v.core y η).const_mul (Real.exp y)).deriv, |
| 1595 | (normalizedEnergyHistory_hasDerivAt_eta v.core y η).deriv] |
| 1596 | have hP : (fun η => OutgoingHistories.Pi w (y, η)) = entrancePressure v y := |
| 1597 | funext (canonical_Pi_before w hyend) |
| 1598 | have hPd : OutgoingHistories.dEta (OutgoingHistories.Pi w) (y, η) = |
| 1599 | deriv (entrancePressure v y) η := by |
| 1600 | rw [OutgoingHistories.dEta_eq_deriv (OutgoingHistories.Pi_smooth w), hP] |
| 1601 | rw [OutgoingHistories.Ns_integrated, canonical_W_before v ha hy, |
| 1602 | OutgoingHistories.U_before_pulse v Amp η hy, canonical_M_before v Amp hy, |
| 1603 | hMd, congrFun hS η, hSd, canonical_Pi_before w hyend, hPd, |
| 1604 | axialLag_integrated_history] |
| 1605 | simp only [OutgoingHistories.X, StressAlgebra.axialExponent, |
| 1606 | StressAlgebra.coordinateFactor, StressAlgebra.velocityExponent, d, A] |
| 1607 | field_simp [(Real.exp_pos y).ne'] ; ring |
| 1608 | |
| 1609 | /-! ## The first and last preliminary ramps -/ |
| 1610 | |
| 1611 | theorem dropCoefficient_deriv_early {m y : ℝ} (hm : 0 < m) (hy : y ≤ 1) : |
| 1612 | deriv (dropCoefficient m) y = 0 := by |
| 1613 | have he : Set.EqOn (deriv (dropCoefficient m)) (fun _ => 0) (Iio 1) := by |
| 1614 | intro t ht |
| 1615 | have hf : dropCoefficient m =ᶠ[𝓝 t] (fun _ => 4) := by |
| 1616 | filter_upwards [Iio_mem_nhds ht] with x hx |
| 1617 | exact dropCoefficient_early m hx.le |
| 1618 | exact ((hasDerivAt_const t (4 : ℝ)).congr_of_eventuallyEq hf).deriv |
| 1619 | have hc := he.closure ((dropCoefficient_contDiff hm).continuous_deriv (by simp)) continuous_const |
| 1620 | exact hc (by rw [closure_Iio]; exact hy) |
| 1621 | |
| 1622 | theorem dropCoefficient_deriv_late {m y : ℝ} (hm : 0 < m) (hy : Real.exp m < y) : |
| 1623 | deriv (dropCoefficient m) y = 0 := by |
| 1624 | have hf : dropCoefficient m =ᶠ[𝓝 y] (fun _ => 0) := by |
| 1625 | filter_upwards [Ioi_mem_nhds hy] with t ht |
| 1626 | exact dropCoefficient_late hm ht.le |
| 1627 | exact ((hasDerivAt_const y (0 : ℝ)).congr_of_eventuallyEq hf).deriv |
| 1628 | |
| 1629 | theorem shear_early (c : Parameters) {y : ℝ} (hy : y ≤ 1) (η : ℝ) : shear c y η = 0 := by |
| 1630 | simp only [shear, dropCoefficient_deriv_early c.m_pos hy, mul_zero, zero_mul, zero_div] |
| 1631 | |
| 1632 | theorem shear_second_ramp (c : Parameters) {y : ℝ} (hy : c.dropLength + 1 ≤ y) (η : ℝ) : |
| 1633 | shear c y η = 0 := by |
| 1634 | have he : Real.exp c.m < y := by dsimp [Parameters.dropLength] at hy; linarith |
| 1635 | simp only [shear, dropCoefficient_deriv_late c.m_pos he, mul_zero, zero_mul, zero_div] |
| 1636 | |
| 1637 | theorem radialA_bounds (c : Parameters) (y : ℝ) : (4 / 5 : ℝ) ≤ radialA c y ∧ radialA c y ≤ 11 / 5 := by |
| 1638 | have hb := angularRate_bounds c y |
| 1639 | unfold angularRate at hb |
| 1640 | unfold radialA |
| 1641 | constructor <;> linarith |
| 1642 | |
| 1643 | theorem radialA_upper_lam (c : Parameters) {y : ℝ} (hy : 1 ≤ y) : |
| 1644 | radialA c y ≤ 2 + 2 * c.lam := by |
| 1645 | have hs : slope c.dropLength c.lam y = -c.lam * sigma (y - (c.dropLength + 1)) := by |
| 1646 | simp [OutgoingSchedule.slope, sigma_one hy] |
| 1647 | unfold radialA |
| 1648 | rw [hs] |
| 1649 | nlinarith [sigma_le_one (y - (c.dropLength + 1)), c.lam_pos] |
| 1650 | |
| 1651 | theorem first_ramp_cone_margins (v : TailData) {y : ℝ} (hy : y ≤ 1) (η : ℝ) : |
| 1652 | (4 / 5 : ℝ) ≤ radialA v.core y - shear v.core y η * directionRatio v y η ∧ |
| 1653 | 2 * shear v.core y η * directionRatio v y η + shear v.core y η ^ 2 / radialA v.core y + |
| 1654 | (radialA v.core y - 2) * directionRatio v y η ^ 2 ≤ 0 := by |
| 1655 | have ha : radialA v.core y ≤ 2 := by |
| 1656 | have hs := slope_nonneg_before_dropEnd v.core (hy.trans (by linarith [v.core.dropLength_pos])) |
| 1657 | unfold radialA |
| 1658 | linarith |
| 1659 | rw [shear_early v.core hy] |
| 1660 | simp only [zero_mul, mul_zero, sub_zero, zero_pow (by decide : (2 : ℕ) ≠ 0), zero_div, zero_add, add_zero] |
| 1661 | refine ⟨(radialA_bounds v.core y).1, ?_⟩ |
| 1662 | exact mul_nonpos_of_nonpos_of_nonneg (sub_nonpos.mpr ha) (sq_nonneg _) |
| 1663 | |
| 1664 | theorem second_ramp_cone_margins (v : TailData) {y η : ℝ} (hh1 : v.h ≤ 1 / 100) |
| 1665 | (hy : v.core.dropLength + 1 ≤ y) (hyT : y ≤ v.core.holdStart) (hη : |η| ≤ 1) |
| 1666 | (hhT : v.h ≤ Real.exp (-(v.core.holdStart + 3 / 5)) / 8) |
| 1667 | (hlam : v.core.lam * entranceRatioBound v.core.P v.core.m ^ 2 ≤ 1 / 4) : |
| 1668 | (2 : ℝ) ≤ radialA v.core y - shear v.core y η * directionRatio v y η ∧ |
| 1669 | 2 * shear v.core y η * directionRatio v y η + shear v.core y η ^ 2 / radialA v.core y + |
| 1670 | (radialA v.core y - 2) * directionRatio v y η ^ 2 ≤ 1 / 2 := by |
| 1671 | have hy1 : 1 ≤ y := by linarith [v.core.dropLength_pos] |
| 1672 | have hs := slope_nonpos_after_first_ramp v.core hy1 |
| 1673 | have ha : 2 ≤ radialA v.core y := by unfold radialA; linarith |
| 1674 | have ha' := radialA_upper_lam v.core hy1 |
| 1675 | have hw := directionRatio_entrance_bound v hh1 (by linarith) hyT hη hhT |
| 1676 | have hw2 : directionRatio v y η ^ 2 ≤ entranceRatioBound v.core.P v.core.m ^ 2 := by |
| 1677 | simpa only [sq_abs] using pow_le_pow_left₀ (abs_nonneg _) hw 2 |
| 1678 | rw [shear_second_ramp v.core hy] |
| 1679 | simp only [zero_mul, mul_zero, sub_zero, zero_pow (by decide : (2 : ℕ) ≠ 0), zero_div, zero_add, add_zero] |
| 1680 | refine ⟨ha, ?_⟩ |
| 1681 | have hmul := mul_le_mul (show radialA v.core y - 2 ≤ 2 * v.core.lam by linarith) |
| 1682 | hw2 (sq_nonneg _) (by linarith [v.core.lam_pos]) |
| 1683 | nlinarith |
| 1684 | |
| 1685 | /-! ## Uniform pressure-source estimates -/ |
| 1686 | |
| 1687 | theorem pressureGradient_contDiff_eta (v : TailData) (y : ℝ) : |
| 1688 | ContDiff ℝ ∞ (pressureGradient v y) := by |
| 1689 | exact (contDiff_infty_iff_deriv.mp (SchedulePressure.axisPressure_contDiff v)).2.sub |
| 1690 | ((((contDiff_const.mul shapeGradient_contDiff).mul (shape_contDiff.pow 2))).mul contDiff_const) |
| 1691 | |
| 1692 | theorem angularSquare_hasDerivAt_eta (c : Parameters) (y η : ℝ) : |
| 1693 | HasDerivAt (fun t => angular c.P c.dropLength c.lam (y, t) ^ 2) |
| 1694 | (-2 * shapeGradient η * angular c.P c.dropLength c.lam (y, η) ^ 2) η := by |
| 1695 | convert! ((shape_hasDerivAt η).const_mul (radialAmplitude c.P c.dropLength c.lam y)).pow 2 using 1 |
| 1696 | simp only [angular] |
| 1697 | ring |
| 1698 | |
| 1699 | theorem pressureAxialSource_hasDerivAt_eta (v : TailData) (y η : ℝ) : |
| 1700 | HasDerivAt (pressureAxialSource v y) |
| 1701 | ((2 + 4 * A v.h) * η * pressureGradient v y η - |
| 1702 | d η * deriv (pressureGradient v y) η + 4 * A v.h * entrancePressure v y η + |
| 1703 | (1 - 2 * η * shapeGradient η) * angular v.core.P v.core.dropLength v.core.lam (y, η) ^ 2) η := by |
| 1704 | have hd : HasDerivAt d (-2 * η) η := by |
| 1705 | convert! (hasDerivAt_const η (1 : ℝ)).fun_sub ((hasDerivAt_id η).fun_pow 2) using 1 |
| 1706 | simp [] |
| 1707 | have hp := ((pressureGradient_contDiff_eta v y).differentiable (by simp) η).hasDerivAt |
| 1708 | convert! ((hd.fun_neg.fun_mul hp).fun_add |
| 1709 | (((hasDerivAt_id η).const_mul (4 * A v.h)).fun_mul (entrancePressure_hasDerivAt_eta v y η))).fun_add |
| 1710 | ((hasDerivAt_id η).fun_mul (angularSquare_hasDerivAt_eta v.core y η)) using 1 |
| 1711 | simp only [id_eq] |
| 1712 | ring |
| 1713 | |
| 1714 | noncomputable def pressureSourceBound : ℝ := 10 * pressureBound + 10 |
| 1715 | |
| 1716 | theorem pressureSourceBound_pos : 0 < pressureSourceBound := by |
| 1717 | unfold pressureSourceBound |
| 1718 | linarith [pressureBound_pos] |
| 1719 | |
| 1720 | theorem pressureAxialSource_bound (v : TailData) {y η : ℝ} (hh1 : v.h ≤ 1 / 100) |
| 1721 | (hy : 0 ≤ y) (hyend : y ≤ v.core.endpoint) (hη : |η| ≤ 1) : |
| 1722 | |pressureAxialSource v y η| ≤ pressureSourceBound * |η| * |
| 1723 | angular v.core.P v.core.dropLength v.core.lam (y, η) ^ 2 := by |
| 1724 | have hp := actual_pressure_bounds v hy hyend hη |
| 1725 | have hd : 0 ≤ d η ∧ d η ≤ 1 := by |
| 1726 | unfold d |
| 1727 | constructor <;> nlinarith [sq_nonneg η, parameter_square_le_one hη] |
| 1728 | have hA : 0 ≤ 4 * A v.h ∧ 4 * A v.h ≤ 3 := by |
| 1729 | unfold A |
| 1730 | constructor <;> linarith [v.h_pos] |
| 1731 | have hfirst : |-d η * pressureGradient v y η| ≤ |
| 1732 | pressureBound * |η| * angular v.core.P v.core.dropLength v.core.lam (y, η) ^ 2 := by |
| 1733 | rw [abs_mul, abs_neg, abs_of_nonneg hd.1] |
| 1734 | simpa only [one_mul] using mul_le_mul hd.2 hp.2.1 (abs_nonneg _) (by norm_num : (0 : ℝ) ≤ 1) |
| 1735 | have hsecond : |4 * A v.h * η * entrancePressure v y η| ≤ |
| 1736 | 3 * pressureBound * |η| * angular v.core.P v.core.dropLength v.core.lam (y, η) ^ 2 := by |
| 1737 | rw [abs_mul, abs_mul, abs_of_nonneg hA.1] |
| 1738 | have hb := mul_le_mul (mul_le_mul_of_nonneg_right hA.2 (abs_nonneg η)) hp.1 |
| 1739 | (abs_nonneg _) (by positivity : 0 ≤ 3 * |η|) |
| 1740 | nlinarith |
| 1741 | have hthird : |η * angular v.core.P v.core.dropLength v.core.lam (y, η) ^ 2| = |
| 1742 | |η| * angular v.core.P v.core.dropLength v.core.lam (y, η) ^ 2 := by |
| 1743 | simp only [abs_mul, abs_pow, sq_abs] |
| 1744 | unfold pressureAxialSource |
| 1745 | have hs : |-d η * pressureGradient v y η + 4 * A v.h * η * entrancePressure v y η + |
| 1746 | η * angular v.core.P v.core.dropLength v.core.lam (y, η) ^ 2| ≤ |
| 1747 | |-d η * pressureGradient v y η| + |4 * A v.h * η * entrancePressure v y η| + |
| 1748 | |η * angular v.core.P v.core.dropLength v.core.lam (y, η) ^ 2| := |
| 1749 | (abs_add_le _ _).trans (add_le_add_left (abs_add_le _ _) _) |
| 1750 | rw [hthird] at hs |
| 1751 | unfold pressureSourceBound |
| 1752 | have hn := mul_nonneg (abs_nonneg η) (sq_nonneg (angular v.core.P v.core.dropLength v.core.lam (y, η))) |
| 1753 | nlinarith [mul_nonneg pressureBound_pos.le hn] |
| 1754 | |
| 1755 | theorem pressureAxialSource_deriv_bound (v : TailData) {y η : ℝ} (hh1 : v.h ≤ 1 / 100) |
| 1756 | (hy : 0 ≤ y) (hyend : y ≤ v.core.endpoint) (hη : |η| ≤ 1) : |
| 1757 | |deriv (pressureAxialSource v y) η| ≤ pressureSourceBound * |
| 1758 | angular v.core.P v.core.dropLength v.core.lam (y, η) ^ 2 := by |
| 1759 | have hp := actual_pressure_bounds v hy hyend hη |
| 1760 | have hE := sq_nonneg (angular v.core.P v.core.dropLength v.core.lam (y, η)) |
| 1761 | have hd : 0 ≤ d η ∧ d η ≤ 1 := by |
| 1762 | unfold d |
| 1763 | constructor <;> nlinarith [sq_nonneg η, parameter_square_le_one hη] |
| 1764 | have hA : 0 ≤ 4 * A v.h ∧ 4 * A v.h ≤ 3 := by |
| 1765 | unfold A |
| 1766 | constructor <;> linarith [v.h_pos] |
| 1767 | have hp1 : |pressureGradient v y η| ≤ pressureBound * angular v.core.P v.core.dropLength v.core.lam (y, η) ^ 2 := by |
| 1768 | apply hp.2.1.trans |
| 1769 | nlinarith [mul_le_mul_of_nonneg_right hη (mul_nonneg pressureBound_pos.le hE)] |
| 1770 | have hfirst : |(2 + 4 * A v.h) * η * pressureGradient v y η| ≤ |
| 1771 | 5 * pressureBound * angular v.core.P v.core.dropLength v.core.lam (y, η) ^ 2 := by |
| 1772 | rw [abs_mul, abs_mul, abs_of_nonneg (by linarith : 0 ≤ 2 + 4 * A v.h)] |
| 1773 | have hc : (2 + 4 * A v.h) * |η| ≤ 5 := by |
| 1774 | nlinarith [mul_le_mul_of_nonneg_left hη (by linarith : 0 ≤ 2 + 4 * A v.h)] |
| 1775 | have hb := mul_le_mul hc hp1 (abs_nonneg _) (by norm_num : (0 : ℝ) ≤ 5) |
| 1776 | nlinarith |
| 1777 | have hsecond : |d η * deriv (pressureGradient v y) η| ≤ |
| 1778 | pressureBound * angular v.core.P v.core.dropLength v.core.lam (y, η) ^ 2 := by |
| 1779 | rw [abs_mul, abs_of_nonneg hd.1] |
| 1780 | simpa only [one_mul] using mul_le_mul hd.2 hp.2.2 (abs_nonneg _) (by norm_num : (0 : ℝ) ≤ 1) |
| 1781 | have hthird : |4 * A v.h * entrancePressure v y η| ≤ |
| 1782 | 3 * pressureBound * angular v.core.P v.core.dropLength v.core.lam (y, η) ^ 2 := by |
| 1783 | rw [abs_mul, abs_of_nonneg hA.1] |
| 1784 | have hb := mul_le_mul hA.2 hp.1 (abs_nonneg _) (by norm_num : (0 : ℝ) ≤ 3) |
| 1785 | nlinarith |
| 1786 | have hc : |1 - 2 * η * shapeGradient η| ≤ 1 := by |
| 1787 | apply abs_le.mpr |
| 1788 | have hb := eta_shapeGradient_bounds hη |
| 1789 | constructor <;> nlinarith [sq_nonneg η] |
| 1790 | have hfourth : |(1 - 2 * η * shapeGradient η) * angular v.core.P v.core.dropLength v.core.lam (y, η) ^ 2| ≤ |
| 1791 | angular v.core.P v.core.dropLength v.core.lam (y, η) ^ 2 := by |
| 1792 | rw [abs_mul, abs_of_nonneg hE] |
| 1793 | exact (mul_le_mul_of_nonneg_right hc hE).trans_eq (one_mul _) |
| 1794 | rw [(pressureAxialSource_hasDerivAt_eta v y η).deriv] |
| 1795 | have hs : |(2 + 4 * A v.h) * η * pressureGradient v y η - |
| 1796 | d η * deriv (pressureGradient v y) η + 4 * A v.h * entrancePressure v y η + |
| 1797 | (1 - 2 * η * shapeGradient η) * angular v.core.P v.core.dropLength v.core.lam (y, η) ^ 2| ≤ |
| 1798 | |(2 + 4 * A v.h) * η * pressureGradient v y η| + |
| 1799 | |d η * deriv (pressureGradient v y) η| + |4 * A v.h * entrancePressure v y η| + |
| 1800 | |(1 - 2 * η * shapeGradient η) * angular v.core.P v.core.dropLength v.core.lam (y, η) ^ 2| := |
| 1801 | (abs_add_le _ _).trans (add_le_add_left |
| 1802 | ((abs_add_le _ _).trans (add_le_add_left (abs_sub _ _) _)) _) |
| 1803 | unfold pressureSourceBound |
| 1804 | nlinarith [mul_nonneg pressureBound_pos.le hE] |
| 1805 | |
| 1806 | /-! ## A single ordered choice of the preliminary parameters -/ |
| 1807 | |
| 1808 | noncomputable def dropThreshold : ℝ := min (1 / 8) (coneFloor / (16 * axialBound)) |
| 1809 | noncomputable def amplitudeThreshold (m : ℝ) : ℝ := Real.exp (Real.exp m + 11) + 1 |
| 1810 | noncomputable def lambdaThreshold (P m : ℝ) : ℝ := |
| 1811 | min (1 / 20) (1 / (4 * (entranceRatioBound P m ^ 2 + 1))) |
| 1812 | noncomputable def heightThreshold (m lam : ℝ) : ℝ := |
| 1813 | min (1 / 100) (min (lam / 4) (Real.exp (-(entranceTime m + 3 / 5)) / 8)) |
| 1814 | |
| 1815 | theorem dropThreshold_pos : 0 < dropThreshold := by |
| 1816 | exact lt_min (by norm_num) (div_pos coneFloor_pos (mul_pos (by norm_num) axialBound_pos)) |
| 1817 | theorem amplitudeThreshold_pos (m : ℝ) : 0 < amplitudeThreshold m := by |
| 1818 | unfold amplitudeThreshold |
| 1819 | positivity |
| 1820 | theorem lambdaThreshold_pos (P m : ℝ) : 0 < lambdaThreshold P m := by |
| 1821 | unfold lambdaThreshold |
| 1822 | positivity |
| 1823 | theorem heightThreshold_pos (m : ℝ) {lam : ℝ} (hlam : 0 < lam) : 0 < heightThreshold m lam := by |
| 1824 | unfold heightThreshold |
| 1825 | positivity |
| 1826 | |
| 1827 | theorem preliminary_cone_margins (v : TailData) {y η : ℝ} |
| 1828 | (hh1 : v.h ≤ 1 / 100) (_hy : 0 ≤ y) (hyT : y ≤ v.core.holdStart) (hη : |η| ≤ 1) |
| 1829 | (hP : Real.exp (v.core.dropLength + 1) ≤ v.core.P ^ 2) |
| 1830 | (hhT : v.h ≤ Real.exp (-(v.core.holdStart + 3 / 5)) / 8) |
| 1831 | (he : dropSpeed v.core.m ≤ dropThreshold) |
| 1832 | (hlam : v.core.lam * entranceRatioBound v.core.P v.core.m ^ 2 ≤ 1 / 4) : |
| 1833 | (4 / 5 : ℝ) ≤ radialA v.core y - shear v.core y η * directionRatio v y η ∧ |
| 1834 | 2 * shear v.core y η * directionRatio v y η + shear v.core y η ^ 2 / radialA v.core y + |
| 1835 | (radialA v.core y - 2) * directionRatio v y η ^ 2 ≤ 5 / 8 := by |
| 1836 | by_cases hfirst : y ≤ 1 |
| 1837 | · have hm := first_ramp_cone_margins v hfirst η |
| 1838 | exact ⟨hm.1, hm.2.trans (by norm_num)⟩ |
| 1839 | by_cases hdrop : y ≤ v.core.dropLength + 1 |
| 1840 | · have hm := drop_cone_margins v hh1 (le_of_not_ge hfirst) hdrop hη hP hhT he |
| 1841 | exact ⟨(by norm_num : (4 / 5 : ℝ) ≤ 7 / 4).trans hm.1, hm.2⟩ |
| 1842 | · have hm := second_ramp_cone_margins v hh1 (le_of_not_ge hdrop) hyT hη hhT hlam |
| 1843 | exact ⟨(by norm_num : (4 / 5 : ℝ) ≤ 2).trans hm.1, hm.2.trans (by norm_num)⟩ |
| 1844 | |
| 1845 | theorem chosen_parameters_bounds (v : TailData) |
| 1846 | (hP : amplitudeThreshold v.core.m ≤ v.core.P) |
| 1847 | (hlam : v.core.lam ≤ lambdaThreshold v.core.P v.core.m) |
| 1848 | (hh : v.h ≤ heightThreshold v.core.m v.core.lam) : |
| 1849 | Real.exp (v.core.dropLength + 1) ≤ v.core.P ^ 2 ∧ |
| 1850 | v.core.lam * entranceRatioBound v.core.P v.core.m ^ 2 ≤ 1 / 4 ∧ |
| 1851 | v.h ≤ 1 / 100 ∧ v.h ≤ Real.exp (-(v.core.holdStart + 3 / 5)) / 8 := by |
| 1852 | have hp : Real.exp (Real.exp v.core.m + 11) + 1 ≤ v.core.P := hP |
| 1853 | have hp' : Real.exp (v.core.dropLength + 1) ≤ v.core.P ^ 2 := by |
| 1854 | have he := Real.exp_pos (Real.exp v.core.m + 11) |
| 1855 | have harg : v.core.dropLength + 1 = Real.exp v.core.m + 11 := by |
| 1856 | simp only [Parameters.dropLength] |
| 1857 | ring |
| 1858 | rw [harg] |
| 1859 | nlinarith |
| 1860 | have hl : v.core.lam ≤ 1 / (4 * (entranceRatioBound v.core.P v.core.m ^ 2 + 1)) := |
| 1861 | hlam.trans (min_le_right _ _) |
| 1862 | have hl' := (le_div_iff₀ (show 0 < 4 * (entranceRatioBound v.core.P v.core.m ^ 2 + 1) by positivity)).mp hl |
| 1863 | refine ⟨hp', (by nlinarith [v.core.lam_pos]), hh.trans (min_le_left _ _), ?_⟩ |
| 1864 | rw [holdStart_eq_entranceTime] |
| 1865 | exact hh.trans ((min_le_right _ _).trans (min_le_right _ _)) |
| 1866 | |
| 1867 | /-- The drop is chosen first. All subsequent cutoffs display precisely which |
| 1868 | earlier parameters they depend on; the cone constants are absolute. -/ |
| 1869 | theorem exists_ordered_preliminary_bounds : |
| 1870 | ∃ M : ℝ, 0 < M ∧ ∀ v : TailData, M ≤ v.core.m → |
| 1871 | amplitudeThreshold v.core.m ≤ v.core.P → |
| 1872 | v.core.lam ≤ lambdaThreshold v.core.P v.core.m → |
| 1873 | v.h ≤ heightThreshold v.core.m v.core.lam → |
| 1874 | ∀ y η : ℝ, 0 ≤ y → y ≤ v.core.holdStart → |η| ≤ 1 → |
| 1875 | coneFloor * (η ^ 2 + Real.exp (-y)) ≤ angularLag v.core v.h η y ∧ |
| 1876 | (4 / 5 : ℝ) ≤ radialA v.core y - shear v.core y η * directionRatio v y η ∧ |
| 1877 | 2 * shear v.core y η * directionRatio v y η + shear v.core y η ^ 2 / radialA v.core y + |
| 1878 | (radialA v.core y - 2) * directionRatio v y η ^ 2 ≤ 5 / 8 := by |
| 1879 | obtain ⟨M, hM, hsmall⟩ := exists_small_dropSpeed dropThreshold_pos |
| 1880 | refine ⟨M, hM, ?_⟩ |
| 1881 | intro v hm hP hlam hh y η hy hyT hη |
| 1882 | have hb := chosen_parameters_bounds v hP hlam hh |
| 1883 | exact ⟨angularLag_lower v.core v.h_pos.le hb.2.2.1 hy hyT hη hb.2.2.2, |
| 1884 | preliminary_cone_margins v hb.2.2.1 hy hyT hη hb.1 hb.2.2.2 (hsmall _ hm) hb.2.1⟩ |
| 1885 | |
| 1886 | /-! ## The actual stress-cone fields and finite amplitude -/ |
| 1887 | |
| 1888 | noncomputable def coneA {v : TailData} {K : ℝ} |
| 1889 | (w : UniformAngularReset.ResetWitness v K) (p : ℝ × ℝ) : ℝ := |
| 1890 | 2 - 2 * (OutgoingHistories.dY (OutgoingHistories.H w) p / OutgoingHistories.H w p) |
| 1891 | |
| 1892 | noncomputable def coneB {v : TailData} {K : ℝ} |
| 1893 | (w : UniformAngularReset.ResetWitness v K) (Amp : ℝ → ℝ) (p : ℝ × ℝ) : ℝ := |
| 1894 | 2 * OutgoingHistories.dY (OutgoingHistories.U v Amp) p / OutgoingHistories.E w p |
| 1895 | |
| 1896 | noncomputable def coneRatio {v : TailData} {K : ℝ} |
| 1897 | (w : UniformAngularReset.ResetWitness v K) (Amp : ℝ → ℝ) (p : ℝ × ℝ) : ℝ := |
| 1898 | OutgoingHistories.Ns w Amp p / (OutgoingHistories.E w p * OutgoingHistories.Qs w Amp p) |
| 1899 | |
| 1900 | noncomputable def preliminaryWindow (v : TailData) : Set (ℝ × ℝ) := |
| 1901 | Icc 0 v.core.holdStart ×ˢ Icc (-1) 1 |
| 1902 | |
| 1903 | theorem coneA_before {v : TailData} {K : ℝ} (w : UniformAngularReset.ResetWitness v K) |
| 1904 | {y : ℝ} (hy : y < v.core.endpoint) (η : ℝ) : coneA w (y, η) = radialA v.core y := by |
| 1905 | unfold coneA radialA |
| 1906 | rw [canonical_H_radial_ratio w hy] |
| 1907 | |
| 1908 | theorem coneB_before {v : TailData} {K : ℝ} (w : UniformAngularReset.ResetWitness v K) |
| 1909 | {Amp : ℝ → ℝ} (ha : ContDiff ℝ ∞ Amp) {y : ℝ} (hy : y < v.core.pulseStart) (η : ℝ) : |
| 1910 | coneB w Amp (y, η) = shear v.core y η := by |
| 1911 | have hyend : y ≤ v.core.endpoint := by |
| 1912 | dsimp [Parameters.endpoint] |
| 1913 | linarith [v.core.pulseLength_pos] |
| 1914 | rw [coneB, OutgoingHistories.dY_eq_deriv (OutgoingHistories.U_smooth v ha), |
| 1915 | OutgoingHistories.E_before w η hyend] |
| 1916 | exact (shear_is_actual v.core Amp hy η).symm |
| 1917 | |
| 1918 | theorem coneRatio_before {v : TailData} {K : ℝ} (w : UniformAngularReset.ResetWitness v K) |
| 1919 | {Amp : ℝ → ℝ} (ha : ContDiff ℝ ∞ Amp) {y : ℝ} (hy : 0 ≤ y) |
| 1920 | (hy' : y ≤ v.core.pulseStart) (η : ℝ) : |
| 1921 | coneRatio w Amp (y, η) = directionRatio v y η := by |
| 1922 | have hyend : y ≤ v.core.endpoint := by |
| 1923 | dsimp [Parameters.endpoint] |
| 1924 | linarith [v.core.pulseLength_pos] |
| 1925 | rw [coneRatio, canonical_Ns_before w ha hy', canonical_Qs_before w ha hy hy', |
| 1926 | OutgoingHistories.E_before w η hyend] |
| 1927 | rfl |
| 1928 | |
| 1929 | theorem canonical_Qs_lower {v : TailData} {K : ℝ} |
| 1930 | (w : UniformAngularReset.ResetWitness v K) {Amp : ℝ → ℝ} |
| 1931 | (ha : ContDiff ℝ ∞ Amp) {y η : ℝ} (hh1 : v.h ≤ 1 / 100) |
| 1932 | (hy : 0 ≤ y) (hyT : y ≤ v.core.holdStart) (hη : |η| ≤ 1) |
| 1933 | (hhT : v.h ≤ Real.exp (-(v.core.holdStart + 3 / 5)) / 8) : |
| 1934 | coneFloor * (η ^ 2 + Real.exp (-y)) ≤ OutgoingHistories.Qs w Amp (y, η) := by |
| 1935 | rw [canonical_Qs_before w ha hy (hyT.trans v.core.pulseStart_ge_hold)] |
| 1936 | exact angularLag_lower v.core v.h_pos.le hh1 hy hyT hη hhT |
| 1937 | |
| 1938 | theorem canonical_Qs_pos {v : TailData} {K : ℝ} |
| 1939 | (w : UniformAngularReset.ResetWitness v K) {Amp : ℝ → ℝ} |
| 1940 | (ha : ContDiff ℝ ∞ Amp) {y η : ℝ} (hh1 : v.h ≤ 1 / 100) |
| 1941 | (hy : 0 ≤ y) (hyT : y ≤ v.core.holdStart) (hη : |η| ≤ 1) |
| 1942 | (hhT : v.h ≤ Real.exp (-(v.core.holdStart + 3 / 5)) / 8) : |
| 1943 | 0 < OutgoingHistories.Qs w Amp (y, η) := |
| 1944 | (mul_pos coneFloor_pos (add_pos_of_nonneg_of_pos (sq_nonneg η) (Real.exp_pos _))).trans_le |
| 1945 | (canonical_Qs_lower w ha hh1 hy hyT hη hhT) |
| 1946 | |
| 1947 | theorem coneA_continuous {v : TailData} {K : ℝ} (w : UniformAngularReset.ResetWitness v K) : |
| 1948 | Continuous (coneA w) := by |
| 1949 | exact continuous_const.sub (continuous_const.mul |
| 1950 | ((OutgoingHistories.dY_smooth (OutgoingHistories.H_smooth w)).continuous.div |
| 1951 | (OutgoingHistories.H_smooth w).continuous (fun p => (OutgoingHistories.H_pos w p).ne'))) |
| 1952 | |
| 1953 | theorem coneB_continuous {v : TailData} {K : ℝ} (w : UniformAngularReset.ResetWitness v K) |
| 1954 | {Amp : ℝ → ℝ} (ha : ContDiff ℝ ∞ Amp) : Continuous (coneB w Amp) := by |
| 1955 | exact (continuous_const.mul (OutgoingHistories.dY_smooth (OutgoingHistories.U_smooth v ha)).continuous).div |
| 1956 | (OutgoingHistories.E_smooth w).continuous (fun p => (OutgoingHistories.E_pos w p).ne') |
| 1957 | |
| 1958 | theorem coneRatio_continuousOn {v : TailData} {K : ℝ} |
| 1959 | (w : UniformAngularReset.ResetWitness v K) {Amp : ℝ → ℝ} |
| 1960 | (ha : ContDiff ℝ ∞ Amp) (hh1 : v.h ≤ 1 / 100) |
| 1961 | (hhT : v.h ≤ Real.exp (-(v.core.holdStart + 3 / 5)) / 8) : |
| 1962 | ContinuousOn (coneRatio w Amp) (preliminaryWindow v) := by |
| 1963 | apply (OutgoingHistories.Ns_smooth w ha).continuous.continuousOn.div |
| 1964 | ((OutgoingHistories.E_smooth w).continuous.mul (OutgoingHistories.Qs_smooth w ha).continuous).continuousOn |
| 1965 | rintro ⟨y, η⟩ ⟨hy, hη⟩ |
| 1966 | exact (mul_pos (OutgoingHistories.E_pos w (y, η)) |
| 1967 | (canonical_Qs_pos w ha hh1 hy.1 hy.2 (abs_le.mpr hη) hhT)).ne' |
| 1968 | |
| 1969 | theorem actual_preliminary_margins {v : TailData} {K : ℝ} |
| 1970 | (w : UniformAngularReset.ResetWitness v K) {Amp : ℝ → ℝ} |
| 1971 | (ha : ContDiff ℝ ∞ Amp) (hh1 : v.h ≤ 1 / 100) |
| 1972 | (hP : Real.exp (v.core.dropLength + 1) ≤ v.core.P ^ 2) |
| 1973 | (hhT : v.h ≤ Real.exp (-(v.core.holdStart + 3 / 5)) / 8) |
| 1974 | (he : dropSpeed v.core.m ≤ dropThreshold) |
| 1975 | (hlam : v.core.lam * entranceRatioBound v.core.P v.core.m ^ 2 ≤ 1 / 4) |
| 1976 | {p : ℝ × ℝ} (hp : p ∈ preliminaryWindow v) : |
| 1977 | (4 / 5 : ℝ) ≤ coneA w p - coneB w Amp p * coneRatio w Amp p ∧ |
| 1978 | 2 * coneB w Amp p * coneRatio w Amp p + coneB w Amp p ^ 2 / coneA w p + |
| 1979 | (coneA w p - 2) * coneRatio w Amp p ^ 2 ≤ 5 / 8 := by |
| 1980 | rcases p with ⟨y, η⟩ |
| 1981 | rcases hp with ⟨hy, hη⟩ |
| 1982 | have hyp : y < v.core.pulseStart := by |
| 1983 | dsimp [Parameters.pulseStart] |
| 1984 | linarith [hy.2, v.core.wait_gt] |
| 1985 | have hye : y < v.core.endpoint := by |
| 1986 | dsimp [Parameters.endpoint] |
| 1987 | linarith [v.core.pulseLength_pos] |
| 1988 | rw [coneA_before w hye, coneB_before w ha hyp, coneRatio_before w ha hy.1 hyp.le] |
| 1989 | exact preliminary_cone_margins v hh1 hy.1 hy.2 (abs_le.mpr hη) hP hhT he hlam |
| 1990 | |
| 1991 | /-- Uniform finite-amplitude relaxed cone for the actual history stresses on |
| 1992 | the whole preliminary interval. Both root inequalities have a common gap. -/ |
| 1993 | theorem compact_actual_preliminary_cone {v : TailData} {K : ℝ} |
| 1994 | (w : UniformAngularReset.ResetWitness v K) {Amp : ℝ → ℝ} |
| 1995 | (ha : ContDiff ℝ ∞ Amp) (hh1 : v.h ≤ 1 / 100) |
| 1996 | (hP : Real.exp (v.core.dropLength + 1) ≤ v.core.P ^ 2) |
| 1997 | (hhT : v.h ≤ Real.exp (-(v.core.holdStart + 3 / 5)) / 8) |
| 1998 | (he : dropSpeed v.core.m ≤ dropThreshold) |
| 1999 | (hlam : v.core.lam * entranceRatioBound v.core.P v.core.m ^ 2 ≤ 1 / 4) : |
| 2000 | ∃ gap p₀ : ℝ, 0 < gap ∧ 0 ≤ p₀ ∧ ∀ s : ℝ, p₀ < s → |
| 2001 | ∀ p ∈ preliminaryWindow v, |
| 2002 | 2 + gap < s * (1 - coneB w Amp p * coneRatio w Amp p / coneA w p) ∧ |
| 2003 | coneA w p * (1 + (coneB w Amp p / coneA w p) ^ 2) + gap < |
| 2004 | ConeAlgebra.coneBound (s * (1 - coneB w Amp p * coneRatio w Amp p / coneA w p)) |
| 2005 | (s * (coneRatio w Amp p + coneB w Amp p / coneA w p)) := by |
| 2006 | apply UniformCone.compact_equation_eleven_gap (isCompact_Icc.prod isCompact_Icc) |
| 2007 | (coneA_continuous w).continuousOn (coneB_continuous w ha).continuousOn |
| 2008 | (coneRatio_continuousOn w ha hh1 hhT) |
| 2009 | · rintro ⟨y, η⟩ ⟨hy, _⟩ |
| 2010 | have hye : y < v.core.endpoint := by |
| 2011 | have hyp := v.core.pulseStart_ge_hold |
| 2012 | dsimp [Parameters.endpoint] |
| 2013 | linarith [hy.2, v.core.pulseLength_pos] |
| 2014 | rw [coneA_before w hye] |
| 2015 | exact (by norm_num : (0 : ℝ) < 4 / 5).trans_le (radialA_bounds v.core y).1 |
| 2016 | · intro p hp |
| 2017 | exact (by norm_num : (0 : ℝ) < 4 / 5).trans_le |
| 2018 | (actual_preliminary_margins w ha hh1 hP hhT he hlam hp).1 |
| 2019 | · intro p hp |
| 2020 | exact (actual_preliminary_margins w ha hh1 hP hhT he hlam hp).2.trans_lt (by norm_num) |
| 2021 | |
| 2022 | theorem actual_stress_amplitude_lower {v : TailData} {K : ℝ} |
| 2023 | (w : UniformAngularReset.ResetWitness v K) {Amp : ℝ → ℝ} |
| 2024 | (ha : ContDiff ℝ ∞ Amp) (hh1 : v.h ≤ 1 / 100) |
| 2025 | (hhT : v.h ≤ Real.exp (-(v.core.holdStart + 3 / 5)) / 8) |
| 2026 | {XR : ℝ} (hXR : 0 ≤ XR) {p : ℝ × ℝ} (hp : p ∈ preliminaryWindow v) : |
| 2027 | XR * coneFloor ≤ OutgoingHistories.p1 XR w Amp p := by |
| 2028 | rcases p with ⟨y, η⟩ |
| 2029 | rcases hp with ⟨hy, hη⟩ |
| 2030 | have hq := canonical_Qs_lower w ha hh1 hy.1 hy.2 (abs_le.mpr hη) hhT |
| 2031 | have hL := natural_L_bounds v.h_pos.le hh1 (abs_le.mpr hη) |
| 2032 | have hL0 : 0 < L v.h η := (by norm_num : (0 : ℝ) < 49 / 50).trans_le hL.1 |
| 2033 | have hx : Real.exp y * Real.exp (-y) = 1 := by rw [← Real.exp_add]; simp |
| 2034 | have hq' : coneFloor ≤ Real.exp y * OutgoingHistories.Qs w Amp (y, η) := by |
| 2035 | have hb := mul_le_mul_of_nonneg_left hq (Real.exp_pos y).le |
| 2036 | have he : Real.exp y * (coneFloor * Real.exp (-y)) = coneFloor := by |
| 2037 | calc |
| 2038 | _ = coneFloor * (Real.exp y * Real.exp (-y)) := by ring |
| 2039 | _ = _ := by rw [hx, mul_one] |
| 2040 | have heta := mul_nonneg (Real.exp_pos y).le (mul_nonneg coneFloor_pos.le (sq_nonneg η)) |
| 2041 | nlinarith |
| 2042 | change XR * coneFloor ≤ XR * Real.exp y * OutgoingHistories.Qs w Amp (y, η) / L v.h η |
| 2043 | apply (le_div_iff₀ hL0).mpr |
| 2044 | have hleft := mul_le_mul_of_nonneg_left hL.2 (mul_nonneg hXR coneFloor_pos.le) |
| 2045 | have hright := mul_le_mul_of_nonneg_left hq' hXR |
| 2046 | nlinarith |
| 2047 | |
| 2048 | /-- A single large physical radial scale gives the actual relaxed cone, |
| 2049 | uniformly in the complete first-ramp/drop/entrance region. -/ |
| 2050 | theorem exists_actual_preliminary_cone_scale {v : TailData} {K : ℝ} |
| 2051 | (w : UniformAngularReset.ResetWitness v K) {Amp : ℝ → ℝ} |
| 2052 | (ha : ContDiff ℝ ∞ Amp) (hh1 : v.h ≤ 1 / 100) |
| 2053 | (hP : Real.exp (v.core.dropLength + 1) ≤ v.core.P ^ 2) |
| 2054 | (hhT : v.h ≤ Real.exp (-(v.core.holdStart + 3 / 5)) / 8) |
| 2055 | (he : dropSpeed v.core.m ≤ dropThreshold) |
| 2056 | (hlam : v.core.lam * entranceRatioBound v.core.P v.core.m ^ 2 ≤ 1 / 4) : |
| 2057 | ∃ gap XR₀ : ℝ, 0 < gap ∧ 0 < XR₀ ∧ ∀ XR : ℝ, XR₀ < XR → |
| 2058 | ∀ p ∈ preliminaryWindow v, |
| 2059 | 2 + gap < OutgoingHistories.p1 XR w Amp p * |
| 2060 | (1 - coneB w Amp p * coneRatio w Amp p / coneA w p) ∧ |
| 2061 | coneA w p * (1 + (coneB w Amp p / coneA w p) ^ 2) + gap < |
| 2062 | ConeAlgebra.coneBound |
| 2063 | (OutgoingHistories.p1 XR w Amp p * (1 - coneB w Amp p * coneRatio w Amp p / coneA w p)) |
| 2064 | (OutgoingHistories.p1 XR w Amp p * (coneRatio w Amp p + coneB w Amp p / coneA w p)) := by |
| 2065 | obtain ⟨gap, p₀, hg, hp₀, hcone⟩ := compact_actual_preliminary_cone w ha hh1 hP hhT he hlam |
| 2066 | refine ⟨gap, (p₀ + 1) / coneFloor, hg, div_pos (by linarith) coneFloor_pos, ?_⟩ |
| 2067 | intro XR hXR p hp |
| 2068 | have hXR0 : 0 < XR := (div_pos (by linarith : 0 < p₀ + 1) coneFloor_pos).trans hXR |
| 2069 | have hs : p₀ < OutgoingHistories.p1 XR w Amp p := by |
| 2070 | have hx := (div_lt_iff₀ coneFloor_pos).mp hXR |
| 2071 | exact (by linarith : p₀ < XR * coneFloor).trans_le |
| 2072 | (actual_stress_amplitude_lower w ha hh1 hhT hXR0.le hp) |
| 2073 | exact hcone _ hs p hp |
| 2074 | |
| 2075 | /-- The same canonical identification is valid to the left of clock zero. -/ |
| 2076 | theorem canonical_Qs_before_all {v : TailData} {K : ℝ} |
| 2077 | (w : UniformAngularReset.ResetWitness v K) {Amp : ℝ → ℝ} |
| 2078 | (ha : ContDiff ℝ ∞ Amp) {y : ℝ} (hy : y ≤ v.core.pulseStart) (η : ℝ) : |
| 2079 | OutgoingHistories.Qs w Amp (y, η) = angularLag v.core v.h η y := by |
| 2080 | unfold angularLag |
| 2081 | apply linearLag_eq_of_solution (f := fun t => OutgoingHistories.Qs w Amp (t, η)) |
| 2082 | (angularRate_contDiff v.core).continuous (angularSource_contDiff v.core v.h η).continuous |
| 2083 | · rw [OutgoingHistories.Qs_initial w ha] |
| 2084 | simp only [idealAngularLag, idealAngularSource, L, D, d, shapeGradient, |
| 2085 | StressAlgebra.axialExponent, StressAlgebra.coordinateFactor] |
| 2086 | · intro t ht |
| 2087 | have ht' : t ≤ v.core.pulseStart := ht.2.trans (max_le v.core.pulseStart_pos.le hy) |
| 2088 | have htend : t < v.core.endpoint := by |
| 2089 | dsimp [Parameters.endpoint] |
| 2090 | linarith [v.core.pulseLength_pos] |
| 2091 | have hd := OutgoingHistories.Qs_hasDerivAt w ha (t, η) |
| 2092 | rw [canonical_Sq_before w ha ht', canonical_H_radial_ratio w htend] at hd |
| 2093 | exact hd |
| 2094 | |
| 2095 | theorem canonical_Qs_ideal {v : TailData} {K : ℝ} |
| 2096 | (w : UniformAngularReset.ResetWitness v K) {Amp : ℝ → ℝ} |
| 2097 | (ha : ContDiff ℝ ∞ Amp) {y : ℝ} (hy : y ≤ 0) (η : ℝ) : |
| 2098 | OutgoingHistories.Qs w Amp (y, η) = idealAngularLag v.h η := by |
| 2099 | rw [canonical_Qs_before_all w ha (hy.trans v.core.pulseStart_pos.le), angularLag_ideal v.core v.h η hy] |
| 2100 | |
| 2101 | theorem canonical_Qs_ideal_lower {v : TailData} {K : ℝ} |
| 2102 | (w : UniformAngularReset.ResetWitness v K) {Amp : ℝ → ℝ} |
| 2103 | (ha : ContDiff ℝ ∞ Amp) (hh1 : v.h ≤ 1 / 100) {y η : ℝ} (hy : y ≤ 0) (hη : |η| ≤ 1) : |
| 2104 | 1 ≤ OutgoingHistories.Qs w Amp (y, η) := by |
| 2105 | rw [canonical_Qs_ideal w ha hy] |
| 2106 | exact idealAngularLag_lower v.h_pos.le hh1 hη |
| 2107 | |
| 2108 | theorem canonical_Ns_ideal {v : TailData} {K : ℝ} |
| 2109 | (w : UniformAngularReset.ResetWitness v K) {Amp : ℝ → ℝ} |
| 2110 | (ha : ContDiff ℝ ∞ Amp) {y : ℝ} (hy : y ≤ 0) (η : ℝ) : |
| 2111 | OutgoingHistories.Ns w Amp (y, η) = -20 * η + (32 + 32 * v.h) * η ^ 3 + |
| 2112 | (4 * A v.h * η * SchedulePressure.axisPressure v η - |
| 2113 | d η * deriv (SchedulePressure.axisPressure v) η + |
| 2114 | (5 / 6) * (5 * d η * shapeGradient η + (10 * A v.h + 1) * η) * |
| 2115 | angular v.core.P v.core.dropLength v.core.lam (y, η) ^ 2) := by |
| 2116 | rw [canonical_Ns_before w ha (hy.trans v.core.pulseStart_pos.le)] |
| 2117 | exact congrArg₂ (· + ·) (geometricAxialLag_ideal v.core v.h η hy) (pressureAxialLag_ideal v η hy) |
| 2118 | |
| 2119 | theorem actual_ideal_cone_margins {v : TailData} {K : ℝ} |
| 2120 | (w : UniformAngularReset.ResetWitness v K) {Amp : ℝ → ℝ} |
| 2121 | (ha : ContDiff ℝ ∞ Amp) {y : ℝ} (hy : y ≤ 0) (η : ℝ) : |
| 2122 | coneA w (y, η) = 4 / 5 ∧ coneB w Amp (y, η) = 0 ∧ |
| 2123 | 0 < coneA w (y, η) - coneB w Amp (y, η) * coneRatio w Amp (y, η) ∧ |
| 2124 | 2 * coneB w Amp (y, η) * coneRatio w Amp (y, η) + |
| 2125 | coneB w Amp (y, η) ^ 2 / coneA w (y, η) + |
| 2126 | (coneA w (y, η) - 2) * coneRatio w Amp (y, η) ^ 2 ≤ 0 := by |
| 2127 | have hpulse : y < v.core.pulseStart := hy.trans_lt v.core.pulseStart_pos |
| 2128 | have hend : y < v.core.endpoint := by |
| 2129 | dsimp [Parameters.endpoint] |
| 2130 | linarith [v.core.pulseLength_pos] |
| 2131 | have hA : coneA w (y, η) = 4 / 5 := by |
| 2132 | rw [coneA_before w hend] |
| 2133 | norm_num [radialA, slope_ideal v.core.dropLength_pos.le hy] |
| 2134 | have hB : coneB w Amp (y, η) = 0 := by |
| 2135 | rw [coneB_before w ha hpulse, shear_early v.core (by linarith)] |
| 2136 | rw [hA, hB] |
| 2137 | norm_num |
| 2138 | nlinarith [sq_nonneg (coneRatio w Amp (y, η))] |
| 2139 | |
| 2140 | /-- The radial normal coefficient agrees with the logarithmic derivative of |
| 2141 | the true angular field `E`, rather than a declared slope proxy. -/ |
| 2142 | theorem coneA_eq_E_derivative {v : TailData} {K : ℝ} |
| 2143 | (w : UniformAngularReset.ResetWitness v K) (p : ℝ × ℝ) : |
| 2144 | coneA w p = 1 - 2 * OutgoingHistories.dY (OutgoingHistories.E w) p / OutgoingHistories.E w p := by |
| 2145 | rcases p with ⟨y, η⟩ |
| 2146 | have hd := (((hasDerivAt_id y).div_const 2).exp).mul |
| 2147 | (OutgoingHistories.dY_hasDerivAt (OutgoingHistories.E_smooth w) (y, η)) |
| 2148 | have hh := (OutgoingHistories.dY_hasDerivAt (OutgoingHistories.H_smooth w) (y, η)).unique hd |
| 2149 | unfold coneA |
| 2150 | rw [hh] |
| 2151 | simp only [OutgoingHistories.H, id_eq] |
| 2152 | field_simp [(Real.exp_pos (y / 2)).ne', (OutgoingHistories.E_pos w (y, η)).ne'] ; ring |
| 2153 | |
| 2154 | /-- Ordered parameter selection for actual histories, followed by the final |
| 2155 | physical radial-scale choice. All thresholds before `XR` are explicit. -/ |
| 2156 | theorem exists_ordered_actual_preliminary_cone : |
| 2157 | ∃ M : ℝ, 0 < M ∧ ∀ v : TailData, M ≤ v.core.m → |
| 2158 | amplitudeThreshold v.core.m ≤ v.core.P → |
| 2159 | v.core.lam ≤ lambdaThreshold v.core.P v.core.m → |
| 2160 | v.h ≤ heightThreshold v.core.m v.core.lam → |
| 2161 | ∀ {K : ℝ} (w : UniformAngularReset.ResetWitness v K) {Amp : ℝ → ℝ}, |
| 2162 | ContDiff ℝ ∞ Amp → |
| 2163 | (∀ y η : ℝ, 0 ≤ y → y ≤ v.core.holdStart → |η| ≤ 1 → |
| 2164 | coneFloor * (η ^ 2 + Real.exp (-y)) ≤ OutgoingHistories.Qs w Amp (y, η)) ∧ |
| 2165 | ∃ gap XR₀ : ℝ, 0 < gap ∧ 0 < XR₀ ∧ ∀ XR : ℝ, XR₀ < XR → |
| 2166 | ∀ p ∈ preliminaryWindow v, |
| 2167 | 2 + gap < OutgoingHistories.p1 XR w Amp p * |
| 2168 | (1 - coneB w Amp p * coneRatio w Amp p / coneA w p) ∧ |
| 2169 | coneA w p * (1 + (coneB w Amp p / coneA w p) ^ 2) + gap < |
| 2170 | ConeAlgebra.coneBound |
| 2171 | (OutgoingHistories.p1 XR w Amp p * (1 - coneB w Amp p * coneRatio w Amp p / coneA w p)) |
| 2172 | (OutgoingHistories.p1 XR w Amp p * (coneRatio w Amp p + coneB w Amp p / coneA w p)) := by |
| 2173 | obtain ⟨M, hM, hsmall⟩ := exists_small_dropSpeed dropThreshold_pos |
| 2174 | refine ⟨M, hM, ?_⟩ |
| 2175 | intro v hm hP hlam hh K w Amp ha |
| 2176 | have hb := chosen_parameters_bounds v hP hlam hh |
| 2177 | refine ⟨fun y η hy hyT hη => canonical_Qs_lower w ha hb.2.2.1 hy hyT hη hb.2.2.2, ?_⟩ |
| 2178 | exact exists_actual_preliminary_cone_scale w ha hb.2.2.1 hb.1 hb.2.2.2 (hsmall _ hm) hb.2.1 |
| 2179 | |
| 2180 | end NavierStokes.OutgoingEntranceCone |