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.PulseAmplitude |
| 2 | import NavierStokes.ResetEnergyBounds |
| 3 | |
| 4 | /-! |
| 5 | # Pulse amplitude after the actual angular-moment reset |
| 6 | |
| 7 | The scalar energy equation here uses `UniformAngularReset.correctedAngular`. |
| 8 | Its signed reset energy is retained in the constant coefficient, and the |
| 9 | reset witness and amplitude are constructed together for small `lam`. |
| 10 | -/ |
| 11 | |
| 12 | noncomputable section |
| 13 | |
| 14 | open Set Filter Function MeasureTheory |
| 15 | open scoped ContDiff Topology |
| 16 | open NavierStokes.OutgoingSchedule NavierStokes.OutgoingTail |
| 17 | open NavierStokes.AngularMomentReset NavierStokes.UniformAngularReset |
| 18 | |
| 19 | namespace NavierStokes.CorrectedPulseAmplitude |
| 20 | |
| 21 | def energyIntegrand (d : TailData) (c : ℝ → Coeff) (A eta y : ℝ) : ℝ := |
| 22 | Real.exp y * (axial d.core (fun _ => A) (y, eta) ^ 2 - correctedAngular d c (y, eta) ^ 2 / 2) |
| 23 | |
| 24 | def totalEnergy (d : TailData) (c : ℝ → Coeff) (A eta : ℝ) : ℝ := |
| 25 | ∫ y, energyIntegrand d c A eta y |
| 26 | |
| 27 | theorem energyIntegrand_eq (d : TailData) (c : ℝ → Coeff) (A eta y : ℝ) : |
| 28 | energyIntegrand d c A eta y = PulseAmplitude.energyIntegrand d A eta y - |
| 29 | ResetEnergyBounds.resetDensity d c eta y / 2 := by |
| 30 | unfold energyIntegrand PulseAmplitude.energyIntegrand ResetEnergyBounds.resetDensity |
| 31 | ring |
| 32 | |
| 33 | theorem energyIntegrand_integrable (d : TailData) (c : ℝ → Coeff) (A eta : ℝ) : |
| 34 | Integrable (energyIntegrand d c A eta) := by |
| 35 | have he : energyIntegrand d c A eta = (fun y => PulseAmplitude.energyIntegrand d A eta y - |
| 36 | ResetEnergyBounds.resetDensity d c eta y / 2) := funext (energyIntegrand_eq d c A eta) |
| 37 | rw [he] |
| 38 | exact (PulseAmplitude.energyIntegrand_integrable d A eta).sub |
| 39 | ((ResetEnergyBounds.resetDensity_integrable d c eta).div_const 2) |
| 40 | |
| 41 | theorem totalEnergy_eq (d : TailData) (c : ℝ → Coeff) (A eta : ℝ) : |
| 42 | totalEnergy d c A eta = PulseAmplitude.totalEnergy d A eta - ResetEnergyBounds.resetEnergy d c eta / 2 := by |
| 43 | unfold totalEnergy |
| 44 | simp_rw [energyIntegrand_eq] |
| 45 | rw [integral_sub (PulseAmplitude.energyIntegrand_integrable d A eta) |
| 46 | ((ResetEnergyBounds.resetDensity_integrable d c eta).div_const 2), integral_div] |
| 47 | rfl |
| 48 | |
| 49 | def energyShift (d : TailData) (c : ℝ → Coeff) (eta : ℝ) : ℝ := |
| 50 | ResetEnergyBounds.normalizedResetEnergy d c eta / 2 |
| 51 | |
| 52 | def constantTerm (d : TailData) (c : ℝ → Coeff) (eta : ℝ) : ℝ := |
| 53 | PulseAmplitude.constantTerm d eta - energyShift d c eta |
| 54 | |
| 55 | def energyPolynomial (d : TailData) (c : ℝ → Coeff) (A eta : ℝ) : ℝ := |
| 56 | PulseAmplitude.quadraticCoefficient d.core * A ^ 2 + |
| 57 | PulseAmplitude.linearTerm d.core eta * A + constantTerm d c eta |
| 58 | |
| 59 | theorem totalEnergy_normalized (d : TailData) (c : ℝ → Coeff) (A eta : ℝ) : |
| 60 | d.core.lam * totalEnergy d c A eta / (PulseAmplitude.normalization d.core * shape eta ^ 2) = |
| 61 | energyPolynomial d c A eta := by |
| 62 | rw [totalEnergy_eq, mul_sub, sub_div, PulseAmplitude.totalEnergy_normalized] |
| 63 | unfold energyPolynomial constantTerm energyShift PulseAmplitude.energyPolynomial |
| 64 | ResetEnergyBounds.normalizedResetEnergy ResetEnergyBounds.pulseNormalization PulseAmplitude.normalization |
| 65 | ring |
| 66 | |
| 67 | theorem energyShift_contDiff (d : TailData) {c : ℝ → Coeff} (hc : ContDiff ℝ ∞ c) : |
| 68 | ContDiff ℝ ∞ (energyShift d c) := |
| 69 | (ResetEnergyBounds.normalizedResetEnergy_contDiff d hc).div_const 2 |
| 70 | |
| 71 | theorem constantTerm_contDiff (d : TailData) {c : ℝ → Coeff} (hc : ContDiff ℝ ∞ c) : |
| 72 | ContDiff ℝ ∞ (constantTerm d c) := |
| 73 | (PulseAmplitude.constantTerm_contDiff d).sub (energyShift_contDiff d hc) |
| 74 | |
| 75 | def discriminant (d : TailData) (c : ℝ → Coeff) (eta : ℝ) : ℝ := |
| 76 | PulseAmplitude.linearTerm d.core eta ^ 2 - 4 * PulseAmplitude.quadraticCoefficient d.core * |
| 77 | PulseAmplitude.negativeClamp (constantTerm d c eta) |
| 78 | |
| 79 | theorem discriminant_pos (d : TailData) (c : ℝ → Coeff) (eta : ℝ) : 0 < discriminant d c eta := by |
| 80 | unfold discriminant |
| 81 | have ha := PulseAmplitude.quadraticCoefficient_pos d.core |
| 82 | have hc := PulseAmplitude.negativeClamp_neg (constantTerm d c eta) |
| 83 | nlinarith [sq_nonneg (PulseAmplitude.linearTerm d.core eta), mul_neg_of_pos_of_neg ha hc] |
| 84 | |
| 85 | def amplitude (d : TailData) (c : ℝ → Coeff) (eta : ℝ) : ℝ := |
| 86 | (-PulseAmplitude.linearTerm d.core eta + Real.sqrt (discriminant d c eta)) / |
| 87 | (2 * PulseAmplitude.quadraticCoefficient d.core) |
| 88 | |
| 89 | theorem amplitude_contDiff (d : TailData) {c : ℝ → Coeff} (hc : ContDiff ℝ ∞ c) : |
| 90 | ContDiff ℝ ∞ (amplitude d c) := by |
| 91 | have hd : ContDiff ℝ ∞ (discriminant d c) := |
| 92 | ((PulseAmplitude.linearTerm_contDiff d.core).pow 2).sub (contDiff_const.mul |
| 93 | (PulseAmplitude.negativeClamp_contDiff.comp (constantTerm_contDiff d hc))) |
| 94 | exact ((PulseAmplitude.linearTerm_contDiff d.core).neg.add |
| 95 | (hd.sqrt (fun eta => (discriminant_pos d c eta).ne'))).div_const _ |
| 96 | |
| 97 | theorem amplitude_pos (d : TailData) (c : ℝ → Coeff) (eta : ℝ) : 0 < amplitude d c eta := by |
| 98 | have ha := PulseAmplitude.quadraticCoefficient_pos d.core |
| 99 | have hc := PulseAmplitude.negativeClamp_neg (constantTerm d c eta) |
| 100 | have hd := Real.sq_sqrt (discriminant_pos d c eta).le |
| 101 | have hs := Real.sqrt_nonneg (discriminant d c eta) |
| 102 | have hb : PulseAmplitude.linearTerm d.core eta < Real.sqrt (discriminant d c eta) := by |
| 103 | dsimp only [discriminant] at hd hs ⊢ |
| 104 | nlinarith [mul_neg_of_pos_of_neg ha hc] |
| 105 | exact div_pos (by linarith) (mul_pos (by norm_num) ha) |
| 106 | |
| 107 | theorem amplitude_clamped_equation (d : TailData) (c : ℝ → Coeff) (eta : ℝ) : |
| 108 | PulseAmplitude.quadraticCoefficient d.core * amplitude d c eta ^ 2 + |
| 109 | PulseAmplitude.linearTerm d.core eta * amplitude d c eta + |
| 110 | PulseAmplitude.negativeClamp (constantTerm d c eta) = 0 := by |
| 111 | have hs := Real.sq_sqrt (discriminant_pos d c eta).le |
| 112 | have hp : Real.sqrt (discriminant d c eta) ^ 2 - PulseAmplitude.linearTerm d.core eta ^ 2 + |
| 113 | 4 * PulseAmplitude.quadraticCoefficient d.core * |
| 114 | PulseAmplitude.negativeClamp (constantTerm d c eta) = 0 := by |
| 115 | rw [hs] |
| 116 | unfold discriminant |
| 117 | ring |
| 118 | unfold amplitude |
| 119 | field_simp [(PulseAmplitude.quadraticCoefficient_pos d.core).ne'] |
| 120 | linear_combination hp |
| 121 | |
| 122 | theorem amplitude_energy_equation (d : TailData) (c : ℝ → Coeff) (eta : ℝ) |
| 123 | (hc : constantTerm d c eta ≤ -(1 / 5)) : energyPolynomial d c (amplitude d c eta) eta = 0 := by |
| 124 | have h := amplitude_clamped_equation d c eta |
| 125 | rwa [PulseAmplitude.negativeClamp_eq hc] at h |
| 126 | |
| 127 | theorem amplitude_totalEnergy_zero (d : TailData) (c : ℝ → Coeff) (eta : ℝ) |
| 128 | (hc : constantTerm d c eta ≤ -(1 / 5)) : totalEnergy d c (amplitude d c eta) eta = 0 := by |
| 129 | have h := totalEnergy_normalized d c (amplitude d c eta) eta |
| 130 | rw [amplitude_energy_equation d c eta hc] at h |
| 131 | rcases div_eq_zero_iff.mp h with hmul | hz |
| 132 | · exact (mul_eq_zero.mp hmul).resolve_left d.core.lam_pos.ne' |
| 133 | · exact False.elim ((mul_pos (PulseAmplitude.normalization_pos d.core) |
| 134 | (sq_pos_of_pos (shape_pos eta))).ne' hz) |
| 135 | |
| 136 | def combinedConstant (P m K : ℝ) : ℝ := PulseAmplitude.errorConstant P m + 36 * K + 1 |
| 137 | def combinedScale (d : TailData) (K : ℝ) : ℝ := |
| 138 | combinedConstant d.core.P d.core.m K * PulseAmplitude.logarithmicRate d.core.lam |
| 139 | |
| 140 | theorem combinedConstant_pos {P : ℝ} (hP : 0 < P) (m K : ℝ) (hK : 0 < K) : |
| 141 | 0 < combinedConstant P m K := by |
| 142 | unfold combinedConstant |
| 143 | linarith [PulseAmplitude.errorConstant_pos hP m] |
| 144 | |
| 145 | theorem oldScale_le (d : TailData) (K : ℝ) (hK : 0 < K) : |
| 146 | PulseAmplitude.errorScale d.core ≤ combinedScale d K := by |
| 147 | apply mul_le_mul_of_nonneg_right _ (PulseAmplitude.logarithmicRate_pos d.core).le |
| 148 | unfold combinedConstant |
| 149 | linarith |
| 150 | |
| 151 | theorem power29_le_lambda (d : TailData) : d.core.lam ^ (29 : ℕ) ≤ d.core.lam := by |
| 152 | have hpow : d.core.lam ^ (28 : ℕ) ≤ 1 := |
| 153 | pow_le_one₀ d.core.lam_pos.le (by linarith [d.core.lam_lt]) |
| 154 | calc |
| 155 | _ = d.core.lam * d.core.lam ^ (28 : ℕ) := by ring |
| 156 | _ ≤ _ := by nlinarith [mul_le_mul_of_nonneg_left hpow d.core.lam_pos.le] |
| 157 | |
| 158 | theorem energyShift_bounds {d : TailData} {K : ℝ} (w : ResetWitness d K) (hK : 0 < K) (eta : ℝ) |
| 159 | (heta : eta ^ 2 ≤ 1) : |
| 160 | |energyShift d w.coefficients eta| ≤ combinedScale d K ∧ |
| 161 | |deriv (energyShift d w.coefficients) eta| ≤ combinedScale d K := by |
| 162 | have h0 := ResetEnergyBounds.normalizedResetEnergy_abs_le w eta heta |
| 163 | have h1 := ResetEnergyBounds.normalizedResetEnergy_deriv_abs_le w eta heta |
| 164 | have hpow := power29_le_lambda d |
| 165 | have hcap : 36 * K * d.core.lam ^ (29 : ℕ) ≤ combinedScale d K := by |
| 166 | calc |
| 167 | _ ≤ 36 * K * d.core.lam := mul_le_mul_of_nonneg_left hpow (by positivity) |
| 168 | _ ≤ 36 * K * PulseAmplitude.logarithmicRate d.core.lam := |
| 169 | mul_le_mul_of_nonneg_left (PulseAmplitude.lambda_le_logarithmicRate d.core) (by positivity) |
| 170 | _ ≤ combinedScale d K := by |
| 171 | apply mul_le_mul_of_nonneg_right _ (PulseAmplitude.logarithmicRate_pos d.core).le |
| 172 | unfold combinedConstant |
| 173 | linarith [PulseAmplitude.errorConstant_pos d.core.P_pos d.core.m] |
| 174 | have hd := (((ResetEnergyBounds.normalizedResetEnergy_contDiff d w.smooth).differentiable |
| 175 | (by simp) eta).hasDerivAt.div_const 2).deriv |
| 176 | constructor |
| 177 | · unfold energyShift |
| 178 | rw [abs_div, abs_of_pos (by norm_num : (0 : ℝ) < 2)] |
| 179 | nlinarith [mul_nonneg hK.le (pow_nonneg d.core.lam_pos.le (29 : ℕ))] |
| 180 | · change |deriv (fun t => ResetEnergyBounds.normalizedResetEnergy d w.coefficients t / 2) eta| ≤ _ |
| 181 | rw [hd, abs_div, abs_of_pos (by norm_num : (0 : ℝ) < 2)] |
| 182 | nlinarith |
| 183 | |
| 184 | theorem old_error_bounds (d : TailData) (K : ℝ) (hK : 0 < K) |
| 185 | (hsmall : d.core.lam ≤ 1 / 120) (hwait : d.core.wait = 60 * Real.log (1 / d.core.lam)) |
| 186 | (eta : ℝ) (heta : eta ^ 2 ≤ 1) : PulseAmplitude.EnergyErrorBounds d eta (combinedScale d K) := by |
| 187 | have h := PulseAmplitude.actual_energy_error_bounds d hsmall hwait eta heta |
| 188 | have hm := oldScale_le d K hK |
| 189 | exact ⟨h.scale_nonneg.trans hm, h.quadratic_error.trans hm, h.linear_error.trans hm, |
| 190 | h.correction_nonneg, h.correction_error.trans hm, h.prefix_axial_nonneg, |
| 191 | h.prefix_axial_error.trans hm, h.prefix_angular_nonneg, h.prefix_angular_error.trans hm, |
| 192 | h.tail_nonneg, h.tail_error.trans hm⟩ |
| 193 | |
| 194 | theorem numerical_coefficient_bounds (d : TailData) (c : ℝ → Coeff) (eta e : ℝ) |
| 195 | (heta : eta ^ 2 ≤ 1) (h : PulseAmplitude.EnergyErrorBounds d eta e) |
| 196 | (hshift : |energyShift d c eta| ≤ e) (he : e ≤ 1 / 1000) : |
| 197 | 1 / 5 ≤ PulseAmplitude.quadraticCoefficient d.core ∧ |
| 198 | PulseAmplitude.quadraticCoefficient d.core ≤ 13 / 50 ∧ |
| 199 | |PulseAmplitude.linearTerm d.core eta| ≤ 1 / 100 ∧ |
| 200 | -(13 / 50) ≤ constantTerm d c eta ∧ constantTerm d c eta ≤ -(23 / 100) := by |
| 201 | obtain ⟨ha, ha', hb, _, _⟩ := PulseAmplitude.numerical_coefficient_bounds d eta e heta h he |
| 202 | have hq := (PulseAmplitude.etaPolynomial_bounds heta).1 |
| 203 | have hq2 : PulseAmplitude.etaPolynomial eta ^ 2 ≤ 4 := by |
| 204 | have hbq := abs_le.mp hq |
| 205 | nlinarith |
| 206 | have hprod0 : 0 ≤ (PulseAmplitude.constantCorrection d.core + |
| 207 | PulseAmplitude.normalizedPrefixAxial d.core) * PulseAmplitude.etaPolynomial eta ^ 2 := |
| 208 | mul_nonneg (add_nonneg h.correction_nonneg h.prefix_axial_nonneg) (sq_nonneg _) |
| 209 | have hprod : (PulseAmplitude.constantCorrection d.core + PulseAmplitude.normalizedPrefixAxial d.core) * |
| 210 | PulseAmplitude.etaPolynomial eta ^ 2 ≤ 8 * e := by |
| 211 | have hm := mul_le_mul (add_le_add h.correction_error h.prefix_axial_error) hq2 |
| 212 | (sq_nonneg (PulseAmplitude.etaPolynomial eta)) (by linarith [h.scale_nonneg]) |
| 213 | nlinarith |
| 214 | have hD := RadialSchedule.pulse_energy_debt_bounds |
| 215 | obtain ⟨hsl, hsu⟩ := abs_le.mp hshift |
| 216 | refine ⟨ha, ha', hb, ?_, ?_⟩ |
| 217 | · unfold constantTerm PulseAmplitude.constantTerm |
| 218 | linarith [h.prefix_angular_error, h.tail_error] |
| 219 | · unfold constantTerm PulseAmplitude.constantTerm |
| 220 | linarith [h.prefix_angular_nonneg, h.tail_nonneg] |
| 221 | |
| 222 | theorem amplitude_spec_of_bounds (d : TailData) (c : ℝ → Coeff) (eta e : ℝ) |
| 223 | (heta : eta ^ 2 ≤ 1) (h : PulseAmplitude.EnergyErrorBounds d eta e) |
| 224 | (hshift : |energyShift d c eta| ≤ e) (he : e ≤ 1 / 1000) : |
| 225 | 9 / 10 < amplitude d c eta ∧ amplitude d c eta < 6 / 5 ∧ totalEnergy d c (amplitude d c eta) eta = 0 := by |
| 226 | obtain ⟨ha, ha', hb, hc, hc'⟩ := numerical_coefficient_bounds d c eta e heta h hshift he |
| 227 | have hneg : constantTerm d c eta ≤ -(1 / 5) := by linarith |
| 228 | have hr := PulseAmplitude.quadratic_root_bracket ha ha' hb hc hc' (amplitude_pos d c eta) |
| 229 | (amplitude_energy_equation d c eta hneg) |
| 230 | exact ⟨hr.1, hr.2, amplitude_totalEnergy_zero d c eta hneg⟩ |
| 231 | |
| 232 | theorem amplitude_derivative_identity (d : TailData) {c : ℝ → Coeff} |
| 233 | (hc : ContDiff ℝ ∞ c) (eta : ℝ) (hneg : constantTerm d c eta < -(1 / 5)) : |
| 234 | (2 * PulseAmplitude.quadraticCoefficient d.core * amplitude d c eta + |
| 235 | PulseAmplitude.linearTerm d.core eta) * deriv (amplitude d c) eta + |
| 236 | deriv (PulseAmplitude.linearTerm d.core) eta * amplitude d c eta + |
| 237 | deriv (constantTerm d c) eta = 0 := by |
| 238 | let F : ℝ → ℝ := fun t => energyPolynomial d c (amplitude d c t) t |
| 239 | have he : F =ᶠ[𝓝 eta] (fun _ => 0) := by |
| 240 | filter_upwards [(isOpen_lt (constantTerm_contDiff d hc).continuous continuous_const).mem_nhds hneg] |
| 241 | with t ht |
| 242 | exact amplitude_energy_equation d c t ht.le |
| 243 | have hz : deriv F eta = 0 := by rw [he.deriv_eq]; exact deriv_const _ _ |
| 244 | have hA := ((amplitude_contDiff d hc).differentiable (by simp) eta).hasDerivAt |
| 245 | have hb := ((PulseAmplitude.linearTerm_contDiff d.core).differentiable (by simp) eta).hasDerivAt |
| 246 | have hcc := ((constantTerm_contDiff d hc).differentiable (by simp) eta).hasDerivAt |
| 247 | have hd := (((hA.pow 2).const_mul (PulseAmplitude.quadraticCoefficient d.core)).add (hb.mul hA)).add hcc |
| 248 | change HasDerivAt F _ eta at hd |
| 249 | rw [hd.deriv] at hz |
| 250 | convert! hz using 1 |
| 251 | ring |
| 252 | |
| 253 | theorem coefficient_derivative_bounds (d : TailData) {c : ℝ → Coeff} |
| 254 | (hc : ContDiff ℝ ∞ c) (eta e : ℝ) (heta : eta ^ 2 ≤ 1) |
| 255 | (h : PulseAmplitude.EnergyErrorBounds d eta e) |
| 256 | (hT : |deriv (PulseAmplitude.normalizedTail d) eta| ≤ e) |
| 257 | (hs : |deriv (energyShift d c) eta| ≤ e) : |
| 258 | |deriv (PulseAmplitude.linearTerm d.core) eta| ≤ 4 * e ∧ |
| 259 | |deriv (constantTerm d c) eta| ≤ 34 * e := by |
| 260 | have hb := PulseAmplitude.coefficient_derivative_bounds d eta e heta h hT |
| 261 | refine ⟨hb.1, ?_⟩ |
| 262 | have hd := (((PulseAmplitude.constantTerm_contDiff d).differentiable (by simp) eta).hasDerivAt).sub |
| 263 | (((energyShift_contDiff d hc).differentiable (by simp) eta).hasDerivAt) |
| 264 | change HasDerivAt (constantTerm d c) _ eta at hd |
| 265 | rw [hd.deriv] |
| 266 | have ha := abs_sub (deriv (PulseAmplitude.constantTerm d) eta) (deriv (energyShift d c) eta) |
| 267 | linarith |
| 268 | |
| 269 | theorem amplitude_derivative_bound (d : TailData) {c : ℝ → Coeff} |
| 270 | (hc : ContDiff ℝ ∞ c) (eta e : ℝ) (heta : eta ^ 2 ≤ 1) |
| 271 | (h : PulseAmplitude.EnergyErrorBounds d eta e) (hshift : |energyShift d c eta| ≤ e) |
| 272 | (he : e ≤ 1 / 1000) (hT : |deriv (PulseAmplitude.normalizedTail d) eta| ≤ e) |
| 273 | (hs : |deriv (energyShift d c) eta| ≤ e) : |deriv (amplitude d c) eta| ≤ 128 * e := by |
| 274 | obtain ⟨ha, _, hb, _, hconst⟩ := numerical_coefficient_bounds d c eta e heta h hshift he |
| 275 | obtain ⟨hr, hr', _⟩ := amplitude_spec_of_bounds d c eta e heta h hshift he |
| 276 | obtain ⟨hdb, hdc⟩ := coefficient_derivative_bounds d hc eta e heta h hT hs |
| 277 | have hden : 1 / 3 ≤ 2 * PulseAmplitude.quadraticCoefficient d.core * amplitude d c eta + |
| 278 | PulseAmplitude.linearTerm d.core eta := by |
| 279 | have hm := mul_le_mul_of_nonneg_right ha (amplitude_pos d c eta).le |
| 280 | have hbl := (abs_le.mp hb).1 |
| 281 | nlinarith |
| 282 | have hid := amplitude_derivative_identity d hc eta (by linarith) |
| 283 | have heq : (2 * PulseAmplitude.quadraticCoefficient d.core * amplitude d c eta + |
| 284 | PulseAmplitude.linearTerm d.core eta) * deriv (amplitude d c) eta = |
| 285 | -(deriv (PulseAmplitude.linearTerm d.core) eta * amplitude d c eta + |
| 286 | deriv (constantTerm d c) eta) := by linarith |
| 287 | have hbound : (2 * PulseAmplitude.quadraticCoefficient d.core * amplitude d c eta + |
| 288 | PulseAmplitude.linearTerm d.core eta) * |deriv (amplitude d c) eta| ≤ |
| 289 | |deriv (PulseAmplitude.linearTerm d.core) eta| * amplitude d c eta + |
| 290 | |deriv (constantTerm d c) eta| := by |
| 291 | calc |
| 292 | _ = |(2 * PulseAmplitude.quadraticCoefficient d.core * amplitude d c eta + |
| 293 | PulseAmplitude.linearTerm d.core eta) * deriv (amplitude d c) eta| := by |
| 294 | rw [abs_mul, abs_of_nonneg (show 0 ≤ 2 * PulseAmplitude.quadraticCoefficient d.core * |
| 295 | amplitude d c eta + PulseAmplitude.linearTerm d.core eta by linarith)] |
| 296 | _ = |deriv (PulseAmplitude.linearTerm d.core) eta * amplitude d c eta + |
| 297 | deriv (constantTerm d c) eta| := by rw [heq, abs_neg] |
| 298 | _ ≤ |deriv (PulseAmplitude.linearTerm d.core) eta * amplitude d c eta| + |
| 299 | |deriv (constantTerm d c) eta| := abs_add_le _ _ |
| 300 | _ = _ := by rw [abs_mul, abs_of_pos (amplitude_pos d c eta)] |
| 301 | have hupper := mul_le_mul hdb hr'.le (amplitude_pos d c eta).le |
| 302 | (by linarith [h.scale_nonneg] : 0 ≤ 4 * e) |
| 303 | have hlower := mul_le_mul_of_nonneg_right hden (abs_nonneg (deriv (amplitude d c) eta)) |
| 304 | nlinarith [h.scale_nonneg] |
| 305 | |
| 306 | theorem energyPolynomial_strictMonoOn (d : TailData) (c : ℝ → Coeff) (eta e : ℝ) |
| 307 | (heta : eta ^ 2 ≤ 1) (h : PulseAmplitude.EnergyErrorBounds d eta e) |
| 308 | (hshift : |energyShift d c eta| ≤ e) (he : e ≤ 1 / 1000) : |
| 309 | StrictMonoOn (fun A => energyPolynomial d c A eta) (Ici (9 / 10 : ℝ)) := by |
| 310 | obtain ⟨ha, _, hb, _, _⟩ := numerical_coefficient_bounds d c eta e heta h hshift he |
| 311 | intro A hA B hB hAB |
| 312 | have hsum : 0 ≤ A + B := by simp only [mem_Ici] at hA hB; linarith |
| 313 | have hm := mul_le_mul_of_nonneg_right ha hsum |
| 314 | have hcoef : 0 < PulseAmplitude.quadraticCoefficient d.core * (A + B) + |
| 315 | PulseAmplitude.linearTerm d.core eta := by |
| 316 | have hbl := (abs_le.mp hb).1 |
| 317 | simp only [mem_Ici] at hA hB |
| 318 | nlinarith |
| 319 | have hp := mul_pos (sub_pos.mpr hAB) hcoef |
| 320 | change PulseAmplitude.quadraticCoefficient d.core * A ^ 2 + |
| 321 | PulseAmplitude.linearTerm d.core eta * A + constantTerm d c eta < |
| 322 | PulseAmplitude.quadraticCoefficient d.core * B ^ 2 + |
| 323 | PulseAmplitude.linearTerm d.core eta * B + constantTerm d c eta |
| 324 | nlinarith only [hp] |
| 325 | |
| 326 | theorem amplitude_unique (d : TailData) (c : ℝ → Coeff) (eta e : ℝ) |
| 327 | (heta : eta ^ 2 ≤ 1) (h : PulseAmplitude.EnergyErrorBounds d eta e) |
| 328 | (hshift : |energyShift d c eta| ≤ e) (he : e ≤ 1 / 1000) |
| 329 | (A : ℝ) (hA : A ∈ Icc (9 / 10 : ℝ) (6 / 5)) (hz : totalEnergy d c A eta = 0) : |
| 330 | A = amplitude d c eta := by |
| 331 | have hr := amplitude_spec_of_bounds d c eta e heta h hshift he |
| 332 | have hn := totalEnergy_normalized d c A eta |
| 333 | rw [hz, mul_zero, zero_div] at hn |
| 334 | have hn' := totalEnergy_normalized d c (amplitude d c eta) eta |
| 335 | rw [hr.2.2, mul_zero, zero_div] at hn' |
| 336 | exact (energyPolynomial_strictMonoOn d c eta e heta h hshift he).injOn hA.1 hr.1.le |
| 337 | (hn.symm.trans hn') |
| 338 | |
| 339 | theorem realized_energy_eq (d : TailData) (c : ℝ → Coeff) (eta : ℝ) : |
| 340 | (∫ y, Real.exp y * (axial d.core (amplitude d c) (y, eta) ^ 2 - |
| 341 | correctedAngular d c (y, eta) ^ 2 / 2)) = totalEnergy d c (amplitude d c eta) eta := by |
| 342 | unfold totalEnergy energyIntegrand |
| 343 | apply integral_congr_ae |
| 344 | exact Eventually.of_forall (fun y => by |
| 345 | dsimp only |
| 346 | rw [PulseAmplitude.axial_eq_of_amplitude_eq d.core (amplitude d c) |
| 347 | (fun _ => amplitude d c eta) eta y rfl]) |
| 348 | |
| 349 | def radialEnergyIntegrand (d : TailData) (c : ℝ → Coeff) (amp : ℝ → ℝ) (eta XR X : ℝ) : ℝ := |
| 350 | axial d.core amp (Real.log (X / XR), eta) ^ 2 - correctedAngular d c (Real.log (X / XR), eta) ^ 2 / 2 |
| 351 | |
| 352 | private theorem radialCoordinate_image (XR : ℝ) (hXR : 0 < XR) : |
| 353 | (fun y : ℝ => XR * Real.exp y) '' univ = Ioi 0 := by |
| 354 | ext X |
| 355 | constructor |
| 356 | · rintro ⟨y, _, rfl⟩ |
| 357 | exact mul_pos hXR (Real.exp_pos _) |
| 358 | · intro hX |
| 359 | refine ⟨Real.log (X / XR), mem_univ _, ?_⟩ |
| 360 | dsimp only |
| 361 | rw [Real.exp_log (div_pos hX hXR)] |
| 362 | field_simp [hXR.ne'] |
| 363 | |
| 364 | private theorem radialCoordinate_transform (d : TailData) (c : ℝ → Coeff) (amp : ℝ → ℝ) |
| 365 | (eta XR : ℝ) (hXR : 0 < XR) : |
| 366 | (fun y => |XR * Real.exp y| • radialEnergyIntegrand d c amp eta XR (XR * Real.exp y)) = |
| 367 | (fun y => XR * energyIntegrand d c (amp eta) eta y) := by |
| 368 | funext y |
| 369 | have hlog : Real.log (XR * Real.exp y / XR) = y := by |
| 370 | rw [mul_comm XR, mul_div_cancel_right₀ _ hXR.ne', Real.log_exp] |
| 371 | simp only [radialEnergyIntegrand, hlog, abs_of_pos (mul_pos hXR (Real.exp_pos _)), smul_eq_mul, |
| 372 | energyIntegrand] |
| 373 | rw [PulseAmplitude.axial_eq_of_amplitude_eq d.core amp (fun _ => amp eta) eta y rfl] |
| 374 | ring |
| 375 | |
| 376 | theorem radialEnergy_integrable (d : TailData) (c : ℝ → Coeff) (amp : ℝ → ℝ) |
| 377 | (eta XR : ℝ) (hXR : 0 < XR) : |
| 378 | IntegrableOn (radialEnergyIntegrand d c amp eta XR) (Ioi 0) := by |
| 379 | have hd : ∀ y ∈ (univ : Set ℝ), HasDerivWithinAt (fun y => XR * Real.exp y) |
| 380 | (XR * Real.exp y) univ y := fun y _ => ((Real.hasDerivAt_exp y).const_mul XR).hasDerivWithinAt |
| 381 | have hinj : InjOn (fun y : ℝ => XR * Real.exp y) univ := by |
| 382 | intro x _ y _ h |
| 383 | exact Real.exp_injective (mul_left_cancel₀ hXR.ne' h) |
| 384 | have h := integrableOn_image_iff_integrableOn_abs_deriv_smul MeasurableSet.univ hd hinj |
| 385 | (radialEnergyIntegrand d c amp eta XR) |
| 386 | rw [radialCoordinate_image XR hXR, radialCoordinate_transform d c amp eta XR hXR, |
| 387 | integrableOn_univ] at h |
| 388 | exact h.mpr ((energyIntegrand_integrable d c (amp eta) eta).const_mul XR) |
| 389 | |
| 390 | theorem radialEnergy_integral (d : TailData) (c : ℝ → Coeff) (amp : ℝ → ℝ) |
| 391 | (eta XR : ℝ) (hXR : 0 < XR) : |
| 392 | (∫ X in Ioi 0, radialEnergyIntegrand d c amp eta XR X) = XR * totalEnergy d c (amp eta) eta := by |
| 393 | have hd : ∀ y ∈ (univ : Set ℝ), HasDerivWithinAt (fun y => XR * Real.exp y) |
| 394 | (XR * Real.exp y) univ y := fun y _ => ((Real.hasDerivAt_exp y).const_mul XR).hasDerivWithinAt |
| 395 | have hinj : InjOn (fun y : ℝ => XR * Real.exp y) univ := by |
| 396 | intro x _ y _ h |
| 397 | exact Real.exp_injective (mul_left_cancel₀ hXR.ne' h) |
| 398 | have h := integral_image_eq_integral_abs_deriv_smul MeasurableSet.univ hd hinj |
| 399 | (radialEnergyIntegrand d c amp eta XR) |
| 400 | rw [radialCoordinate_image XR hXR, radialCoordinate_transform d c amp eta XR hXR, |
| 401 | setIntegral_univ, integral_const_mul] at h |
| 402 | exact h |
| 403 | |
| 404 | /-- The actual reset coefficients and the actual energy estimates suffice; |
| 405 | the scalar amplitude has no assumed root or sign-change hypothesis. -/ |
| 406 | theorem amplitude_spec {d : TailData} {K : ℝ} (w : ResetWitness d K) (hK : 0 < K) |
| 407 | (hsmall : d.core.lam ≤ 1 / 120) (hwait : d.core.wait = 60 * Real.log (1 / d.core.lam)) |
| 408 | (hscale : combinedScale d K ≤ 1 / 1000) : |
| 409 | ContDiff ℝ ∞ (amplitude d w.coefficients) ∧ ∀ eta : ℝ, eta ^ 2 ≤ 1 → |
| 410 | 9 / 10 < amplitude d w.coefficients eta ∧ amplitude d w.coefficients eta < 6 / 5 ∧ |
| 411 | totalEnergy d w.coefficients (amplitude d w.coefficients eta) eta = 0 ∧ |
| 412 | |deriv (amplitude d w.coefficients) eta| ≤ 128 * combinedScale d K ∧ |
| 413 | (∀ A ∈ Icc (9 / 10 : ℝ) (6 / 5), totalEnergy d w.coefficients A eta = 0 → |
| 414 | A = amplitude d w.coefficients eta) := by |
| 415 | refine ⟨amplitude_contDiff d w.smooth, fun eta heta => ?_⟩ |
| 416 | have h := old_error_bounds d K hK hsmall hwait eta heta |
| 417 | have hs := energyShift_bounds w hK eta heta |
| 418 | have hr := amplitude_spec_of_bounds d w.coefficients eta (combinedScale d K) heta h hs.1 hscale |
| 419 | have hT := (PulseAmplitude.normalizedTail_derivative_bound d eta heta).trans (oldScale_le d K hK) |
| 420 | exact ⟨hr.1, hr.2.1, hr.2.2, |
| 421 | amplitude_derivative_bound d w.smooth eta (combinedScale d K) heta h hs.1 hscale hT hs.2, |
| 422 | fun A hA hz => amplitude_unique d w.coefficients eta (combinedScale d K) heta h hs.1 hscale A hA hz⟩ |
| 423 | |
| 424 | /-- The scheduled angular reset and pulse amplitude are constructed together. |
| 425 | The exact radial energy uses the corrected angular profile. The common |
| 426 | threshold is uniform over every terminal parameter `0 < h < lam/2`. -/ |
| 427 | theorem exists_corrected_amplitude (P m : ℝ) (hP : 0 < P) : |
| 428 | ∃ lam₀ K C : ℝ, 0 < lam₀ ∧ 0 < K ∧ 0 < C ∧ ∀ d : TailData, |
| 429 | d.core.P = P → d.core.m = m → d.core.wait = 60 * Real.log (1 / d.core.lam) → |
| 430 | d.core.lam < lam₀ → ∃ w : ResetWitness d K, |
| 431 | ContDiff ℝ ∞ (amplitude d w.coefficients) ∧ ∀ eta : ℝ, eta ^ 2 ≤ 1 → |
| 432 | 9 / 10 < amplitude d w.coefficients eta ∧ amplitude d w.coefficients eta < 6 / 5 ∧ |
| 433 | totalEnergy d w.coefficients (amplitude d w.coefficients eta) eta = 0 ∧ |
| 434 | |deriv (amplitude d w.coefficients) eta| ≤ C * d.core.lam * (1 + Real.log (1 / d.core.lam)) ∧ |
| 435 | (∀ XR : ℝ, 0 < XR → |
| 436 | IntegrableOn (radialEnergyIntegrand d w.coefficients (amplitude d w.coefficients) eta XR) (Ioi 0) ∧ |
| 437 | (∫ X in Ioi 0, radialEnergyIntegrand d w.coefficients (amplitude d w.coefficients) eta XR X) = 0) ∧ |
| 438 | (∀ A ∈ Icc (9 / 10 : ℝ) (6 / 5), totalEnergy d w.coefficients A eta = 0 → |
| 439 | A = amplitude d w.coefficients eta) := by |
| 440 | obtain ⟨resetLam, K, hresetLam, hK, hreset⟩ := exists_scheduled_reset |
| 441 | obtain ⟨delta, hd, hsmall⟩ := PulseAmplitude.exists_rate_threshold (combinedConstant P m K) |
| 442 | refine ⟨min resetLam (min delta (1 / 120)), K, 128 * combinedConstant P m K, |
| 443 | lt_min hresetLam (lt_min hd (by norm_num)), hK, |
| 444 | mul_pos (by norm_num) (combinedConstant_pos hP m K hK), ?_⟩ |
| 445 | intro d hdP hdm hwait hlam |
| 446 | have hr : d.core.lam < resetLam := lt_of_lt_of_le hlam (min_le_left _ _) |
| 447 | have hright : d.core.lam < min delta (1 / 120) := lt_of_lt_of_le hlam (min_le_right _ _) |
| 448 | have hl : d.core.lam ≤ 1 / 120 := (lt_of_lt_of_le hright (min_le_right _ _)).le |
| 449 | have hscale : combinedScale d K ≤ 1 / 1000 := by |
| 450 | unfold combinedScale |
| 451 | rw [hdP, hdm] |
| 452 | exact hsmall _ d.core.lam_pos (lt_of_lt_of_le hright (min_le_left _ _)) |
| 453 | obtain ⟨w⟩ := hreset d hr |
| 454 | obtain ⟨hs, hspec⟩ := amplitude_spec w hK hl hwait hscale |
| 455 | refine ⟨w, hs, fun eta heta => ?_⟩ |
| 456 | obtain ⟨ha, ha', hz, hderiv, huniq⟩ := hspec eta heta |
| 457 | refine ⟨ha, ha', hz, ?_, ?_, huniq⟩ |
| 458 | · convert! hderiv using 1 |
| 459 | unfold combinedScale PulseAmplitude.logarithmicRate |
| 460 | rw [hdP, hdm] |
| 461 | ring |
| 462 | · intro XR hXR |
| 463 | refine ⟨radialEnergy_integrable d w.coefficients (amplitude d w.coefficients) eta XR hXR, ?_⟩ |
| 464 | rw [radialEnergy_integral d w.coefficients (amplitude d w.coefficients) eta XR hXR, hz, mul_zero] |
| 465 | |
| 466 | end NavierStokes.CorrectedPulseAmplitude |