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.OutgoingHistories |
| 2 | import NavierStokes.PulseLag |
| 3 | |
| 4 | /-! |
| 5 | # Actual outgoing energy histories during the pulse |
| 6 | |
| 7 | The history and its parameter derivative retain the actual incoming prefix. |
| 8 | Bounds come from their source integrals and the explicit pulse energy weight. |
| 9 | -/ |
| 10 | |
| 11 | namespace NavierStokes.PulseEnergyHistory |
| 12 | |
| 13 | noncomputable section |
| 14 | |
| 15 | open Set Filter Function MeasureTheory |
| 16 | open scoped Topology ContDiff |
| 17 | open OutgoingSchedule OutgoingTail UniformAngularReset OutgoingHistories |
| 18 | |
| 19 | variable {d : TailData} {K : ℝ} |
| 20 | |
| 21 | noncomputable def pulseNormalization (c : Parameters) (eta : ℝ) : ℝ := |
| 22 | PulseAmplitude.normalization c * shape eta ^ 2 |
| 23 | |
| 24 | theorem pulseNormalization_pos (c : Parameters) (eta : ℝ) : |
| 25 | 0 < pulseNormalization c eta := |
| 26 | mul_pos (PulseAmplitude.normalization_pos c) (sq_pos_of_pos (shape_pos eta)) |
| 27 | |
| 28 | theorem pulse_time_le_endpoint (c : Parameters) {y : ℝ} (hy : y ≤ c.pulseLength) : |
| 29 | c.pulseStart + y ≤ c.endpoint := by |
| 30 | change c.pulseStart + y ≤ c.pulseStart + c.pulseLength |
| 31 | linarith |
| 32 | |
| 33 | /-- The actual reset leaves the pulse angular field unchanged. -/ |
| 34 | theorem pulse_weight (w : ResetWitness d K) (eta : ℝ) {y : ℝ} |
| 35 | (hy : 0 ≤ y) (hy' : y ≤ d.core.pulseLength) : |
| 36 | X (d.core.pulseStart + y, eta) * E w (d.core.pulseStart + y, eta) ^ 2 = |
| 37 | pulseNormalization d.core eta * PulseAmplitude.pulseWeight d.core y := by |
| 38 | rw [E_before w eta (pulse_time_le_endpoint d.core hy'), |
| 39 | angular_pulse d.core eta (by linarith)] |
| 40 | rw [show d.core.pulseStart + y - d.core.pulseStart = y by ring] |
| 41 | have he : Real.exp (d.core.pulseStart + y) * |
| 42 | Real.exp (-(1 / 2 + d.core.lam) * y) ^ 2 = |
| 43 | Real.exp d.core.pulseStart * Real.exp (-2 * d.core.lam * y) := by |
| 44 | rw [pow_two, ← Real.exp_add, ← Real.exp_add, ← Real.exp_add] |
| 45 | congr 1 |
| 46 | ring |
| 47 | unfold X pulseNormalization PulseAmplitude.normalization PulseAmplitude.pulseWeight |
| 48 | calc |
| 49 | _ = pulseAmplitude d.core ^ 2 * shape eta ^ 2 * |
| 50 | (Real.exp (d.core.pulseStart + y) * Real.exp (-(1 / 2 + d.core.lam) * y) ^ 2) := by ring |
| 51 | _ = _ := by rw [he]; ring |
| 52 | |
| 53 | theorem pulse_U_eq (w : ResetWitness d K) (amp : ℝ → ℝ) (eta : ℝ) {y : ℝ} |
| 54 | (hy : 0 ≤ y) (hy' : y ≤ d.core.pulseLength) : |
| 55 | U d amp (d.core.pulseStart + y, eta) = E w (d.core.pulseStart + y, eta) * |
| 56 | pulseRatio d.core amp (y, eta) := by |
| 57 | unfold U |
| 58 | rw [axial_pulse d.core amp eta (by linarith), radialPulse_exp, |
| 59 | E_before w eta (pulse_time_le_endpoint d.core hy')] |
| 60 | rw [show d.core.pulseStart + y - d.core.pulseStart = y by ring] |
| 61 | |
| 62 | /-- Exact source of the actual energy history throughout the pulse. -/ |
| 63 | theorem energyWeight_pulse (w : ResetWitness d K) (amp : ℝ → ℝ) (eta : ℝ) {y : ℝ} |
| 64 | (hy : 0 ≤ y) (hy' : y ≤ d.core.pulseLength) : |
| 65 | energyWeight w amp (d.core.pulseStart + y, eta) = |
| 66 | pulseNormalization d.core eta * PulseAmplitude.pulseWeight d.core y * |
| 67 | (pulseRatio d.core amp (y, eta) ^ 2 - 1 / 2) := by |
| 68 | unfold energyWeight energyDensity |
| 69 | rw [pulse_U_eq w amp eta hy hy'] |
| 70 | calc |
| 71 | _ = (X (d.core.pulseStart + y, eta) * E w (d.core.pulseStart + y, eta) ^ 2) * |
| 72 | (pulseRatio d.core amp (y, eta) ^ 2 - 1 / 2) := by ring |
| 73 | _ = _ := by rw [pulse_weight w eta hy hy'] |
| 74 | |
| 75 | /-- Exact parameter derivative of the pulse energy source. -/ |
| 76 | theorem dEta_energyWeight_pulse (w : ResetWitness d K) {amp : ℝ → ℝ} |
| 77 | (ha : ContDiff ℝ ∞ amp) (eta : ℝ) {y : ℝ} |
| 78 | (hy : 0 ≤ y) (hy' : y ≤ d.core.pulseLength) : |
| 79 | dEta (energyWeight w amp) (d.core.pulseStart + y, eta) = |
| 80 | pulseNormalization d.core eta * PulseAmplitude.pulseWeight d.core y * |
| 81 | (2 * pulseRatio d.core amp (y, eta) * deriv (fun t => pulseRatio d.core amp (y, t)) eta - |
| 82 | 2 * shapeRate eta * (pulseRatio d.core amp (y, eta) ^ 2 - 1 / 2)) := by |
| 83 | have hr : HasDerivAt (fun t => pulseRatio d.core amp (y, t)) |
| 84 | (deriv (fun t => pulseRatio d.core amp (y, t)) eta) eta := |
| 85 | (((pulseRatio_contDiff d.core ha).comp (contDiff_const.prodMk contDiff_id)).differentiable |
| 86 | (by simp) eta).hasDerivAt |
| 87 | have hprod := ((((UniformAngularReset.shape_hasDerivAt eta).fun_pow 2).const_mul |
| 88 | (PulseAmplitude.normalization d.core)).mul_const (PulseAmplitude.pulseWeight d.core y)).fun_mul |
| 89 | ((hr.fun_pow 2).sub_const (1 / 2)) |
| 90 | have hact := dEta_hasDerivAt (energyWeight_smooth w ha) (d.core.pulseStart + y, eta) |
| 91 | have heq : (fun t => energyWeight w amp (d.core.pulseStart + y, t)) = |
| 92 | (fun t => PulseAmplitude.normalization d.core * shape t ^ 2 * |
| 93 | PulseAmplitude.pulseWeight d.core y * (pulseRatio d.core amp (y, t) ^ 2 - 1 / 2)) := by |
| 94 | funext t |
| 95 | exact energyWeight_pulse w amp t hy hy' |
| 96 | rw [heq] at hact |
| 97 | calc |
| 98 | _ = _ := hact.unique hprod |
| 99 | _ = _ := by unfold pulseNormalization shapeRate; ring |
| 100 | |
| 101 | /-- The pulse starts with the actual incoming energy, including the ideal past. -/ |
| 102 | theorem S_at_pulseStart (w : ResetWitness d K) {amp : ℝ → ℝ} |
| 103 | (ha : ContDiff ℝ ∞ amp) (eta : ℝ) : |
| 104 | S w amp (d.core.pulseStart, eta) = PulseAmplitude.prefixEnergy d.core eta := by |
| 105 | rw [S_eq_integral w ha] |
| 106 | calc |
| 107 | _ = ∫ t in Iic d.core.pulseStart, PulseAmplitude.energyIntegrand d (amp eta) eta t := by |
| 108 | apply setIntegral_congr_fun measurableSet_Iic |
| 109 | intro t ht |
| 110 | have htend : t ≤ d.core.endpoint := |
| 111 | ht.trans (PulseAmplitude.pulseStart_le_endpoint d.core) |
| 112 | unfold PulseAmplitude.energyIntegrand U |
| 113 | dsimp only |
| 114 | rw [E_before w eta htend, finalAngular_before d eta htend, |
| 115 | PulseAmplitude.axial_eq_of_amplitude_eq d.core amp (fun _ => amp eta) eta t rfl] |
| 116 | _ = _ := PulseAmplitude.energyIntegrand_integral_prefix d (amp eta) eta |
| 117 | |
| 118 | theorem prefixEnergy_hasDerivAt (c : Parameters) (eta : ℝ) : |
| 119 | HasDerivAt (PulseAmplitude.prefixEnergy c) |
| 120 | (2 * PulseAmplitude.prefixAxialEnergy c * eta + |
| 121 | 2 * PulseAmplitude.prefixAngularEnergy c * shape eta ^ 2 * shapeRate eta) eta := by |
| 122 | convert! (((hasDerivAt_id eta).pow 2).const_mul (PulseAmplitude.prefixAxialEnergy c)).sub |
| 123 | (((UniformAngularReset.shape_hasDerivAt eta).fun_pow 2).const_mul |
| 124 | (PulseAmplitude.prefixAngularEnergy c)) using 1 |
| 125 | unfold shapeRate |
| 126 | simp only [id_eq] |
| 127 | ring |
| 128 | |
| 129 | theorem dEta_S_at_pulseStart (w : ResetWitness d K) {amp : ℝ → ℝ} |
| 130 | (ha : ContDiff ℝ ∞ amp) (eta : ℝ) : |
| 131 | dEta (S w amp) (d.core.pulseStart, eta) = |
| 132 | 2 * PulseAmplitude.prefixAxialEnergy d.core * eta + |
| 133 | 2 * PulseAmplitude.prefixAngularEnergy d.core * shape eta ^ 2 * shapeRate eta := by |
| 134 | rw [dEta_eq_deriv (S_smooth w ha)] |
| 135 | have heq : (fun t => S w amp (d.core.pulseStart, t)) = PulseAmplitude.prefixEnergy d.core := |
| 136 | funext (S_at_pulseStart w ha) |
| 137 | rw [heq, (prefixEnergy_hasDerivAt d.core eta).deriv] |
| 138 | |
| 139 | theorem logarithmicRate_le_one (c : Parameters) : PulseAmplitude.logarithmicRate c.lam ≤ 1 := by |
| 140 | have h := Real.log_le_sub_one_of_pos (one_div_pos.mpr c.lam_pos) |
| 141 | have hm := mul_le_mul_of_nonneg_left h c.lam_pos.le |
| 142 | have he : c.lam * (1 / c.lam - 1) = 1 - c.lam := by field_simp [c.lam_pos.ne'] |
| 143 | rw [he] at hm |
| 144 | unfold PulseAmplitude.logarithmicRate |
| 145 | nlinarith |
| 146 | |
| 147 | theorem prefix_sum_bound (c : Parameters) |
| 148 | (hwait : c.wait = 60 * Real.log (1 / c.lam)) : |
| 149 | PulseAmplitude.prefixAxialEnergy c + PulseAmplitude.prefixAngularEnergy c ≤ |
| 150 | PulseAmplitude.normalization c * PulseAmplitude.prefixBoundConstant c.P c.m / c.lam := by |
| 151 | have hb := (PulseAmplitude.normalizedPrefix_bound c hwait).trans |
| 152 | (mul_le_of_le_one_right (PulseAmplitude.prefixBoundConstant_pos c.P c.m).le |
| 153 | (logarithmicRate_le_one c)) |
| 154 | have he : PulseAmplitude.normalizedPrefixAxial c + PulseAmplitude.normalizedPrefixAngular c = |
| 155 | c.lam * (PulseAmplitude.prefixAxialEnergy c + PulseAmplitude.prefixAngularEnergy c) / |
| 156 | PulseAmplitude.normalization c := by |
| 157 | unfold PulseAmplitude.normalizedPrefixAxial PulseAmplitude.normalizedPrefixAngular |
| 158 | ring |
| 159 | rw [he] at hb |
| 160 | have h := (div_le_iff₀ (PulseAmplitude.normalization_pos c)).mp hb |
| 161 | apply (le_div_iff₀ c.lam_pos).mpr |
| 162 | nlinarith |
| 163 | |
| 164 | theorem shape_bounds {eta : ℝ} (heta : |eta| ≤ 1) : |
| 165 | (1 / 4 : ℝ) ≤ shape eta ^ 2 ∧ shape eta ^ 2 ≤ 1 ∧ |shapeRate eta| ≤ 2 := by |
| 166 | have hs : eta ^ 2 ≤ 1 := by |
| 167 | nlinarith [sq_le_sq₀ (abs_nonneg eta) (by norm_num : (0 : ℝ) ≤ 1) |>.mpr heta, sq_abs eta] |
| 168 | have hlo : (1 / 2 : ℝ) ≤ shape eta := by |
| 169 | change 1 / 2 ≤ (1 + eta ^ 2)⁻¹ |
| 170 | rw [← one_div] |
| 171 | exact one_div_le_one_div_of_le (by positivity) (by linarith) |
| 172 | have hhi := UniformAngularReset.shape_le_one eta |
| 173 | refine ⟨by nlinarith, by nlinarith [shape_pos eta], ?_⟩ |
| 174 | rw [shapeRate, abs_div, abs_mul, abs_of_pos (by norm_num : (0 : ℝ) < 2), |
| 175 | abs_of_pos (by positivity : 0 < 1 + eta ^ 2)] |
| 176 | apply (div_le_iff₀ (by positivity : 0 < 1 + eta ^ 2)).mpr |
| 177 | nlinarith [sq_nonneg eta] |
| 178 | |
| 179 | /-- One bound covers both normalized source factors. -/ |
| 180 | theorem source_factor_bounds {R Reta rate B : ℝ} (hB : 0 ≤ B) |
| 181 | (hR : |R| ≤ B) (hReta : |Reta| ≤ B) (hrate : |rate| ≤ 2) : |
| 182 | |R ^ 2 - 1 / 2| ≤ 6 * B ^ 2 + 2 ∧ |
| 183 | |2 * R * Reta - 2 * rate * (R ^ 2 - 1 / 2)| ≤ 6 * B ^ 2 + 2 := by |
| 184 | have hRsq : R ^ 2 ≤ B ^ 2 := by |
| 185 | nlinarith [sq_le_sq₀ (abs_nonneg R) hB |>.mpr hR, sq_abs R] |
| 186 | have hbase : |R ^ 2 - 1 / 2| ≤ B ^ 2 + 1 / 2 := by |
| 187 | apply (abs_sub _ _).trans |
| 188 | rw [abs_of_nonneg (sq_nonneg R), abs_of_pos (by norm_num : (0 : ℝ) < 1 / 2)] |
| 189 | linarith |
| 190 | have hproduct : |R * Reta| ≤ B ^ 2 := by |
| 191 | rw [abs_mul, pow_two] |
| 192 | exact mul_le_mul hR hReta (abs_nonneg _) hB |
| 193 | have hfirst : |2 * R * Reta| ≤ 2 * B ^ 2 := by |
| 194 | rw [show 2 * R * Reta = 2 * (R * Reta) by ring, abs_mul, |
| 195 | abs_of_pos (by norm_num : (0 : ℝ) < 2)] |
| 196 | linarith |
| 197 | have hsecond : |2 * rate * (R ^ 2 - 1 / 2)| ≤ 4 * (B ^ 2 + 1 / 2) := by |
| 198 | rw [abs_mul, abs_mul, abs_of_pos (by norm_num : (0 : ℝ) < 2)] |
| 199 | nlinarith [mul_le_mul hrate hbase (abs_nonneg _) (by norm_num : (0 : ℝ) ≤ 2)] |
| 200 | exact ⟨hbase.trans (by nlinarith [sq_nonneg B]), |
| 201 | (abs_sub _ _).trans (by linarith)⟩ |
| 202 | |
| 203 | /-- The actual energy source and its actual parameter derivative have a common bound. -/ |
| 204 | theorem energy_sources_bound (w : ResetWitness d K) {amp : ℝ → ℝ} |
| 205 | (ha : ContDiff ℝ ∞ amp) {eta y B : ℝ} (heta : |eta| ≤ 1) (hB : 0 ≤ B) |
| 206 | (hy : 0 ≤ y) (hy' : y ≤ d.core.pulseLength) |
| 207 | (hR : |pulseRatio d.core amp (y, eta)| ≤ B) |
| 208 | (hReta : |deriv (fun t => pulseRatio d.core amp (y, t)) eta| ≤ B) : |
| 209 | |energyWeight w amp (d.core.pulseStart + y, eta)| ≤ |
| 210 | pulseNormalization d.core eta * (6 * B ^ 2 + 2) ∧ |
| 211 | |dEta (energyWeight w amp) (d.core.pulseStart + y, eta)| ≤ |
| 212 | pulseNormalization d.core eta * (6 * B ^ 2 + 2) := by |
| 213 | have hfactor := source_factor_bounds hB hR hReta (shape_bounds heta).2.2 |
| 214 | have hN := pulseNormalization_pos d.core eta |
| 215 | have hw : 0 < PulseAmplitude.pulseWeight d.core y := Real.exp_pos _ |
| 216 | have hweight : pulseNormalization d.core eta * PulseAmplitude.pulseWeight d.core y ≤ |
| 217 | pulseNormalization d.core eta := |
| 218 | mul_le_of_le_one_right hN.le (PulseAmplitude.pulseWeight_le_one d.core hy) |
| 219 | rw [energyWeight_pulse w amp eta hy hy', dEta_energyWeight_pulse w ha eta hy hy'] |
| 220 | constructor |
| 221 | · rw [abs_mul, abs_of_pos (mul_pos hN hw)] |
| 222 | exact mul_le_mul hweight hfactor.1 (abs_nonneg _) hN.le |
| 223 | · rw [abs_mul, abs_of_pos (mul_pos hN hw)] |
| 224 | exact mul_le_mul hweight hfactor.2 (abs_nonneg _) hN.le |
| 225 | |
| 226 | /-- Prefix bounds include the incoming ideal history and its parameter derivative. -/ |
| 227 | theorem initial_history_bounds (w : ResetWitness d K) {amp : ℝ → ℝ} |
| 228 | (ha : ContDiff ℝ ∞ amp) |
| 229 | (hwait : d.core.wait = 60 * Real.log (1 / d.core.lam)) {eta : ℝ} (heta : |eta| ≤ 1) : |
| 230 | |S w amp (d.core.pulseStart, eta)| ≤ |
| 231 | pulseNormalization d.core eta * (16 * PulseAmplitude.prefixBoundConstant d.core.P d.core.m) / |
| 232 | d.core.lam ∧ |
| 233 | |dEta (S w amp) (d.core.pulseStart, eta)| ≤ |
| 234 | pulseNormalization d.core eta * (16 * PulseAmplitude.prefixBoundConstant d.core.P d.core.m) / |
| 235 | d.core.lam := by |
| 236 | let A := PulseAmplitude.prefixAxialEnergy d.core |
| 237 | let G := PulseAmplitude.prefixAngularEnergy d.core |
| 238 | have hA : 0 ≤ A := PulseAmplitude.prefixAxialEnergy_nonneg d.core |
| 239 | have hG : 0 ≤ G := PulseAmplitude.prefixAngularEnergy_nonneg d.core |
| 240 | have hs := shape_bounds heta |
| 241 | have heta2 : eta ^ 2 ≤ 1 := by |
| 242 | nlinarith [sq_le_sq₀ (abs_nonneg eta) (by norm_num : (0 : ℝ) ≤ 1) |>.mpr heta, sq_abs eta] |
| 243 | have hval : |S w amp (d.core.pulseStart, eta)| ≤ 4 * (A + G) := by |
| 244 | rw [S_at_pulseStart w ha] |
| 245 | change |A * eta ^ 2 - G * shape eta ^ 2| ≤ _ |
| 246 | apply (abs_sub _ _).trans |
| 247 | rw [abs_of_nonneg (mul_nonneg hA (sq_nonneg _)), |
| 248 | abs_of_nonneg (mul_nonneg hG (sq_nonneg _))] |
| 249 | nlinarith [mul_le_of_le_one_right hA heta2, mul_le_of_le_one_right hG hs.2.1] |
| 250 | have hder : |dEta (S w amp) (d.core.pulseStart, eta)| ≤ 4 * (A + G) := by |
| 251 | rw [dEta_S_at_pulseStart w ha] |
| 252 | change |2 * A * eta + 2 * G * shape eta ^ 2 * shapeRate eta| ≤ _ |
| 253 | apply (abs_add_le _ _).trans |
| 254 | have hfirst : |2 * A * eta| ≤ 2 * A := by |
| 255 | rw [abs_mul, abs_of_nonneg (mul_nonneg (by norm_num) hA)] |
| 256 | nlinarith [mul_le_of_le_one_right (show 0 ≤ 2 * A by positivity) heta] |
| 257 | have hsecond : |2 * G * shape eta ^ 2 * shapeRate eta| ≤ 4 * G := by |
| 258 | rw [abs_mul, abs_of_nonneg (by positivity : 0 ≤ 2 * G * shape eta ^ 2)] |
| 259 | have hh := mul_le_mul hs.2.1 hs.2.2 (abs_nonneg _) (by norm_num : (0 : ℝ) ≤ 1) |
| 260 | nlinarith [mul_le_mul_of_nonneg_left hh (show 0 ≤ 2 * G by positivity)] |
| 261 | linarith |
| 262 | have hscale : 4 * (A + G) ≤ |
| 263 | pulseNormalization d.core eta * (16 * PulseAmplitude.prefixBoundConstant d.core.P d.core.m) / |
| 264 | d.core.lam := by |
| 265 | calc |
| 266 | _ ≤ 4 * (PulseAmplitude.normalization d.core * |
| 267 | PulseAmplitude.prefixBoundConstant d.core.P d.core.m / d.core.lam) := |
| 268 | mul_le_mul_of_nonneg_left (prefix_sum_bound d.core hwait) (by norm_num) |
| 269 | _ ≤ _ := by |
| 270 | have hh := mul_le_mul_of_nonneg_right hs.1 |
| 271 | (show 0 ≤ 16 * PulseAmplitude.normalization d.core * |
| 272 | PulseAmplitude.prefixBoundConstant d.core.P d.core.m / d.core.lam by |
| 273 | have h1 := (PulseAmplitude.normalization_pos d.core).le |
| 274 | have h2 := (PulseAmplitude.prefixBoundConstant_pos d.core.P d.core.m).le |
| 275 | have h3 := d.core.lam_pos.le |
| 276 | positivity) |
| 277 | unfold pulseNormalization |
| 278 | convert! hh using 1 <;> ring |
| 279 | exact ⟨hval.trans hscale, hder.trans hscale⟩ |
| 280 | |
| 281 | /-- Integrating an actual history source over a pulse of length `13 / lam`. |
| 282 | The final denominator is its exponentially decaying pulse energy weight. -/ |
| 283 | theorem normalized_history_bound {H g : ℝ → ℝ} {lam N C M y : ℝ} |
| 284 | (hlam : 0 < lam) (hN : 0 < N) (hC : 0 ≤ C) (hM : 0 ≤ M) |
| 285 | (hy : 0 ≤ y) (hy' : y ≤ 13 / lam) |
| 286 | (hg : Continuous g) (hd : ∀ t ∈ Icc (0 : ℝ) y, HasDerivAt H (g t) t) |
| 287 | (hsource : ∀ t ∈ Icc (0 : ℝ) y, |g t| ≤ N * M) |
| 288 | (hinit : |H 0| ≤ N * C / lam) : |
| 289 | |H y| / (N * Real.exp (-2 * lam * y)) ≤ (C + 13 * M) * Real.exp 26 / lam := by |
| 290 | have hi := intervalIntegral.integral_eq_sub_of_hasDerivAt |
| 291 | (fun t ht => hd t (uIcc_of_le hy ▸ ht)) (hg.intervalIntegrable 0 y) |
| 292 | have hint : |∫ t in (0 : ℝ)..y, g t| ≤ N * M * y := by |
| 293 | have h := intervalIntegral.norm_integral_le_of_norm_le_const |
| 294 | (a := 0) (b := y) (C := N * M) (f := g) (fun t ht => by |
| 295 | rw [Real.norm_eq_abs] |
| 296 | exact hsource t (uIcc_of_le hy ▸ uIoc_subset_uIcc ht)) |
| 297 | simpa only [Real.norm_eq_abs, sub_zero, abs_of_nonneg hy] using h |
| 298 | have heq : H y = H 0 + ∫ t in (0 : ℝ)..y, g t := by linarith |
| 299 | have hvalue : |H y| ≤ N * (C + 13 * M) / lam := by |
| 300 | calc |
| 301 | _ ≤ |H 0| + |∫ t in (0 : ℝ)..y, g t| := by rw [heq]; exact abs_add_le _ _ |
| 302 | _ ≤ N * C / lam + N * M * y := add_le_add hinit hint |
| 303 | _ ≤ N * C / lam + N * M * (13 / lam) := |
| 304 | add_le_add_right (mul_le_mul_of_nonneg_left hy' (mul_nonneg hN.le hM)) _ |
| 305 | _ = _ := by ring |
| 306 | have hfactor : 1 ≤ Real.exp 26 * Real.exp (-2 * lam * y) := by |
| 307 | rw [← Real.exp_add] |
| 308 | apply Real.one_le_exp |
| 309 | nlinarith [(le_div_iff₀ hlam).mp hy'] |
| 310 | apply (div_le_iff₀ (mul_pos hN (Real.exp_pos _))).mpr |
| 311 | calc |
| 312 | _ ≤ N * (C + 13 * M) / lam := hvalue |
| 313 | _ ≤ (C + 13 * M) * Real.exp 26 / lam * (N * Real.exp (-2 * lam * y)) := by |
| 314 | have h := mul_le_mul_of_nonneg_left hfactor |
| 315 | (show 0 ≤ N * (C + 13 * M) / lam by positivity) |
| 316 | convert! h using 1 <;> ring |
| 317 | |
| 318 | /-- Genuine normalized energy-history bounds from explicit pulse-ratio data. |
| 319 | No energy-history estimate appears among the hypotheses. -/ |
| 320 | theorem pulse_history_bounds_of_ratio_bounds (w : ResetWitness d K) {amp : ℝ → ℝ} |
| 321 | (ha : ContDiff ℝ ∞ amp) |
| 322 | (hwait : d.core.wait = 60 * Real.log (1 / d.core.lam)) {eta B y : ℝ} |
| 323 | (heta : |eta| ≤ 1) (hB : 0 ≤ B) (hy : 0 ≤ y) (hy' : y ≤ d.core.pulseLength) |
| 324 | (hR : ∀ t ∈ Icc (0 : ℝ) d.core.pulseLength, |pulseRatio d.core amp (t, eta)| ≤ B) |
| 325 | (hReta : ∀ t ∈ Icc (0 : ℝ) d.core.pulseLength, |
| 326 | |deriv (fun e => pulseRatio d.core amp (t, e)) eta| ≤ B) : |
| 327 | |S w amp (d.core.pulseStart + y, eta)| / |
| 328 | (X (d.core.pulseStart + y, eta) * E w (d.core.pulseStart + y, eta) ^ 2) ≤ |
| 329 | (16 * PulseAmplitude.prefixBoundConstant d.core.P d.core.m + 13 * (6 * B ^ 2 + 2)) * |
| 330 | Real.exp 26 / d.core.lam ∧ |
| 331 | |dEta (S w amp) (d.core.pulseStart + y, eta)| / |
| 332 | (X (d.core.pulseStart + y, eta) * E w (d.core.pulseStart + y, eta) ^ 2) ≤ |
| 333 | (16 * PulseAmplitude.prefixBoundConstant d.core.P d.core.m + 13 * (6 * B ^ 2 + 2)) * |
| 334 | Real.exp 26 / d.core.lam := by |
| 335 | have hinit := initial_history_bounds w ha hwait heta |
| 336 | have harg : Continuous (fun t : ℝ => (d.core.pulseStart + t, eta)) := |
| 337 | (continuous_const.add continuous_id).prodMk continuous_const |
| 338 | have hg := (energyWeight_smooth w ha).continuous.comp harg |
| 339 | have hgp := (dEta_smooth (energyWeight_smooth w ha)).continuous.comp harg |
| 340 | have hs t (ht : t ∈ Icc (0 : ℝ) y) := energy_sources_bound w ha heta hB ht.1 |
| 341 | (ht.2.trans hy') (hR t ⟨ht.1, ht.2.trans hy'⟩) (hReta t ⟨ht.1, ht.2.trans hy'⟩) |
| 342 | have hd : ∀ t ∈ Icc (0 : ℝ) y, |
| 343 | HasDerivAt (fun u => S w amp (d.core.pulseStart + u, eta)) |
| 344 | (energyWeight w amp (d.core.pulseStart + t, eta)) t := by |
| 345 | intro t _ |
| 346 | have h := (S_hasDerivAt w ha (d.core.pulseStart + t, eta)).comp t |
| 347 | ((hasDerivAt_id t).const_add d.core.pulseStart) |
| 348 | simp only [Function.comp_def, mul_one] at h |
| 349 | exact h |
| 350 | have hdp : ∀ t ∈ Icc (0 : ℝ) y, |
| 351 | HasDerivAt (fun u => dEta (S w amp) (d.core.pulseStart + u, eta)) |
| 352 | (dEta (energyWeight w amp) (d.core.pulseStart + t, eta)) t := by |
| 353 | intro t _ |
| 354 | have h := (dEta_prefix_hasDerivAt (initialS_smooth d) (energyWeight_smooth w ha) |
| 355 | (d.core.pulseStart + t, eta)).comp t ((hasDerivAt_id t).const_add d.core.pulseStart) |
| 356 | simp only [Function.comp_def, mul_one] at h |
| 357 | exact h |
| 358 | rw [pulse_weight w eta hy hy'] |
| 359 | constructor |
| 360 | · apply normalized_history_bound d.core.lam_pos (pulseNormalization_pos d.core eta) |
| 361 | (by have h := (PulseAmplitude.prefixBoundConstant_pos d.core.P d.core.m).le; positivity) |
| 362 | (by positivity) hy hy' hg hd (fun t ht => (hs t ht).1) |
| 363 | simpa only [add_zero] using hinit.1 |
| 364 | · apply normalized_history_bound d.core.lam_pos (pulseNormalization_pos d.core eta) |
| 365 | (by have h := (PulseAmplitude.prefixBoundConstant_pos d.core.P d.core.m).le; positivity) |
| 366 | (by positivity) hy hy' hgp hdp (fun t ht => (hs t ht).2) |
| 367 | simpa only [add_zero] using hinit.2 |
| 368 | |
| 369 | /-- A common bound for the main pulse and its actual affine moment repair. -/ |
| 370 | noncomputable def forceConstant (P m : ℝ) : ℝ := |
| 371 | OutgoingPulseBounds.mainBound + OutgoingPulseBounds.correctionJetBound P m 0 |
| 372 | |
| 373 | theorem forceConstant_pos {P : ℝ} (hP : 0 < P) (m : ℝ) : 0 < forceConstant P m := |
| 374 | add_pos OutgoingPulseBounds.mainBound_pos (OutgoingPulseBounds.correctionJetBound_pos hP m 0) |
| 375 | |
| 376 | theorem forcing_abs_bound (c : Parameters) (hsmall : c.lam ≤ 1 / 120) (q A y : ℝ) : |
| 377 | |PulseLag.forcing c q A y| ≤ forceConstant c.P c.m * (|q| + |A|) := by |
| 378 | have hc := OutgoingPulseBounds.affineProfile_jet_bound c hsmall q A 0 y |
| 379 | simp only [iteratedDeriv_zero] at hc |
| 380 | have he : Real.exp (-(1 / (4 * c.lam))) ≤ 1 := |
| 381 | Real.exp_le_one_iff.mpr (neg_nonpos.mpr (by have h := c.lam_pos; positivity)) |
| 382 | have hc' : |OutgoingPulseBounds.affineProfile c q A y| ≤ |
| 383 | OutgoingPulseBounds.correctionJetBound c.P c.m 0 * (|q| + |A|) := by |
| 384 | refine hc.trans ?_ |
| 385 | have h := mul_le_mul_of_nonneg_right |
| 386 | (mul_le_mul_of_nonneg_left he (OutgoingPulseBounds.correctionJetBound_pos c.P_pos c.m 0).le) |
| 387 | (show 0 ≤ |q| + |A| by positivity) |
| 388 | simpa only [mul_one] using h |
| 389 | have hm : |A * mainPulse (c.lam * y)| ≤ OutgoingPulseBounds.mainBound * |A| := by |
| 390 | rw [abs_mul] |
| 391 | nlinarith [mul_le_mul_of_nonneg_left (OutgoingPulseBounds.mainPulse_abs_le (c.lam * y)) |
| 392 | (abs_nonneg A)] |
| 393 | calc |
| 394 | _ ≤ |A * mainPulse (c.lam * y)| + |OutgoingPulseBounds.affineProfile c q A y| := abs_add_le _ _ |
| 395 | _ ≤ OutgoingPulseBounds.mainBound * |A| + |
| 396 | OutgoingPulseBounds.correctionJetBound c.P c.m 0 * (|q| + |A|) := add_le_add hm hc' |
| 397 | _ ≤ _ := by |
| 398 | unfold forceConstant |
| 399 | nlinarith [mul_nonneg OutgoingPulseBounds.mainBound_pos.le (abs_nonneg q)] |
| 400 | |
| 401 | /-- The parameter derivative includes the derivative of the actual moment repair. -/ |
| 402 | theorem pulseRatio_eta_hasDerivAt (c : Parameters) {amp : ℝ → ℝ} {eta amp' : ℝ} |
| 403 | (ha : HasDerivAt amp amp' eta) (y : ℝ) : |
| 404 | HasDerivAt (fun t => pulseRatio c amp (y, t)) |
| 405 | (PulseLag.forcing c (1 + 3 * eta ^ 2) amp' y) eta := by |
| 406 | have hlin (q A : ℝ) : PulseLag.forcing c q A y = |
| 407 | q * PulseLag.forcing c 1 0 y + A * PulseLag.forcing c 0 1 y := by |
| 408 | simpa only [iteratedDeriv_zero] using PulseLag.forcing_jet_decomposition c q A 0 y |
| 409 | have heq : (fun t => pulseRatio c amp (y, t)) = |
| 410 | (fun t => OutgoingPulseBounds.parameterPolynomial t * PulseLag.forcing c 1 0 y + |
| 411 | amp t * PulseLag.forcing c 0 1 y) := by |
| 412 | funext t |
| 413 | rw [← PulseLag.forcing_eq_pulseRatio c amp t y, hlin] |
| 414 | rw [heq, hlin (1 + 3 * eta ^ 2) amp'] |
| 415 | exact ((OutgoingPulseBounds.parameterPolynomial_hasDerivAt eta).mul_const _).add |
| 416 | (ha.mul_const _) |
| 417 | |
| 418 | theorem pulse_ratio_bounds (c : Parameters) (hsmall : c.lam ≤ 1 / 120) |
| 419 | {amp : ℝ → ℝ} {eta amp' : ℝ} (ha : HasDerivAt amp amp' eta) |
| 420 | (heta : |eta| ≤ 1) (hamp : |amp eta| ≤ 6 / 5) (hamp' : |amp'| ≤ 1) (y : ℝ) : |
| 421 | |pulseRatio c amp (y, eta)| ≤ 6 * forceConstant c.P c.m ∧ |
| 422 | |deriv (fun t => pulseRatio c amp (y, t)) eta| ≤ 6 * forceConstant c.P c.m := by |
| 423 | have hq := OutgoingPulseBounds.parameterPolynomial_bound heta |
| 424 | have hq' : |1 + 3 * eta ^ 2| ≤ 4 := by |
| 425 | simpa only [(OutgoingPulseBounds.parameterPolynomial_hasDerivAt eta).deriv] using |
| 426 | OutgoingPulseBounds.parameterPolynomial_derivative_bound heta |
| 427 | have hF := (forceConstant_pos c.P_pos c.m).le |
| 428 | constructor |
| 429 | · rw [← PulseLag.forcing_eq_pulseRatio c amp eta y] |
| 430 | apply (forcing_abs_bound c hsmall _ _ y).trans |
| 431 | nlinarith [mul_le_mul_of_nonneg_left |
| 432 | (show |OutgoingPulseBounds.parameterPolynomial eta| + |amp eta| ≤ 6 by linarith) hF] |
| 433 | · rw [(pulseRatio_eta_hasDerivAt c ha y).deriv] |
| 434 | apply (forcing_abs_bound c hsmall _ _ y).trans |
| 435 | nlinarith [mul_le_mul_of_nonneg_left |
| 436 | (show |1 + 3 * eta ^ 2| + |amp'| ≤ 6 by linarith) hF] |
| 437 | |
| 438 | /-- This constant depends only on the fixed parameters `P,m`. -/ |
| 439 | noncomputable def historyConstant (P m : ℝ) : ℝ := |
| 440 | 16 * PulseAmplitude.prefixBoundConstant P m + 13 * (6 * (6 * forceConstant P m) ^ 2 + 2) |
| 441 | |
| 442 | theorem historyConstant_pos (P m : ℝ) : 0 < historyConstant P m := by |
| 443 | have h := PulseAmplitude.prefixBoundConstant_pos P m |
| 444 | unfold historyConstant |
| 445 | positivity |
| 446 | |
| 447 | /-- Both requested actual history bounds, with the actual repaired pulse source. -/ |
| 448 | theorem pulse_history_bounds (w : ResetWitness d K) {amp : ℝ → ℝ} |
| 449 | (ha : ContDiff ℝ ∞ amp) |
| 450 | (hwait : d.core.wait = 60 * Real.log (1 / d.core.lam)) |
| 451 | (hsmall : d.core.lam ≤ 1 / 120) {eta y : ℝ} (heta : |eta| ≤ 1) |
| 452 | (hamp : |amp eta| ≤ 6 / 5) (hamp' : |deriv amp eta| ≤ 1) |
| 453 | (hy : 0 ≤ y) (hy' : y ≤ d.core.pulseLength) : |
| 454 | |S w amp (d.core.pulseStart + y, eta)| / |
| 455 | (X (d.core.pulseStart + y, eta) * E w (d.core.pulseStart + y, eta) ^ 2) ≤ |
| 456 | historyConstant d.core.P d.core.m * Real.exp 26 / d.core.lam ∧ |
| 457 | |dEta (S w amp) (d.core.pulseStart + y, eta)| / |
| 458 | (X (d.core.pulseStart + y, eta) * E w (d.core.pulseStart + y, eta) ^ 2) ≤ |
| 459 | historyConstant d.core.P d.core.m * Real.exp 26 / d.core.lam := by |
| 460 | have hdata := pulse_ratio_bounds d.core hsmall |
| 461 | ((ha.differentiable (by simp) eta).hasDerivAt) heta hamp hamp' |
| 462 | exact pulse_history_bounds_of_ratio_bounds w ha hwait heta |
| 463 | (mul_nonneg (by norm_num) (forceConstant_pos d.core.P_pos d.core.m).le) hy hy' |
| 464 | (fun t _ => (hdata t).1) (fun t _ => (hdata t).2) |
| 465 | |
| 466 | /-- Specialization to the corrected amplitude supplied by the proved energy solve. -/ |
| 467 | theorem corrected_pulse_history_bounds (w : ResetWitness d K) (hK : 0 < K) |
| 468 | (hwait : d.core.wait = 60 * Real.log (1 / d.core.lam)) |
| 469 | (hsmall : d.core.lam ≤ 1 / 120) |
| 470 | (hscale : CorrectedPulseAmplitude.combinedScale d K ≤ 1 / 1000) |
| 471 | {eta y : ℝ} (heta : |eta| ≤ 1) (hy : 0 ≤ y) (hy' : y ≤ d.core.pulseLength) : |
| 472 | |S w (CorrectedPulseAmplitude.amplitude d w.coefficients) (d.core.pulseStart + y, eta)| / |
| 473 | (X (d.core.pulseStart + y, eta) * E w (d.core.pulseStart + y, eta) ^ 2) ≤ |
| 474 | historyConstant d.core.P d.core.m * Real.exp 26 / d.core.lam ∧ |
| 475 | |dEta (S w (CorrectedPulseAmplitude.amplitude d w.coefficients)) |
| 476 | (d.core.pulseStart + y, eta)| / |
| 477 | (X (d.core.pulseStart + y, eta) * E w (d.core.pulseStart + y, eta) ^ 2) ≤ |
| 478 | historyConstant d.core.P d.core.m * Real.exp 26 / d.core.lam := by |
| 479 | obtain ⟨ha, hspec⟩ := CorrectedPulseAmplitude.amplitude_spec w hK hsmall hwait hscale |
| 480 | have heta2 : eta ^ 2 ≤ 1 := by |
| 481 | nlinarith [sq_le_sq₀ (abs_nonneg eta) (by norm_num : (0 : ℝ) ≤ 1) |>.mpr heta, sq_abs eta] |
| 482 | obtain ⟨hlo, hhi, _, hd, _⟩ := hspec eta heta2 |
| 483 | apply pulse_history_bounds w ha hwait hsmall heta _ _ hy hy' |
| 484 | · rw [abs_of_pos (by linarith : 0 < CorrectedPulseAmplitude.amplitude d w.coefficients eta)] |
| 485 | exact hhi.le |
| 486 | · exact hd.trans (by linarith) |
| 487 | |
| 488 | end |
| 489 | |
| 490 | end NavierStokes.PulseEnergyHistory |