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.PulseGrowth |
| 2 | import Mathlib.Analysis.Calculus.Deriv.MeanValue |
| 3 | import Mathlib.Analysis.SpecialFunctions.Integrals.Basic |
| 4 | import Mathlib.Analysis.SpecialFunctions.Sqrt |
| 5 | |
| 6 | /-! |
| 7 | # Gaussian bounds from a decreasing instantaneous rate |
| 8 | |
| 9 | The integral is oriented: a point before the midpoint reverses the integration |
| 10 | limits. The main theorem proves the same quadratic bounds on both sides, |
| 11 | under local differentiability and derivative bounds on a convex domain. |
| 12 | -/ |
| 13 | |
| 14 | namespace NavierStokes.GaussianEnvelope |
| 15 | |
| 16 | open Set MeasureTheory |
| 17 | |
| 18 | /-- Envelope normalized to one at the midpoint. -/ |
| 19 | noncomputable def envelope (rate : ℝ → ℝ) (midpoint time : ℝ) : ℝ := |
| 20 | Real.exp (∫ x in midpoint..time, rate x) |
| 21 | |
| 22 | /-- Exact integral of a centered affine rate, for either order of the endpoints. -/ |
| 23 | theorem integral_centered_linear (k midpoint a b : ℝ) : |
| 24 | (∫ x in a..b, k * (x - midpoint)) = |
| 25 | k * ((b - midpoint) ^ 2 - (a - midpoint) ^ 2) / 2 := by |
| 26 | rw [intervalIntegral.integral_const_mul] |
| 27 | rw [intervalIntegral.integral_sub (f := fun x : ℝ => x) |
| 28 | (g := fun _ : ℝ => midpoint) |
| 29 | (continuous_id.intervalIntegrable a b) (continuous_const.intervalIntegrable a b)] |
| 30 | rw [integral_id, intervalIntegral.integral_const] |
| 31 | simp only [smul_eq_mul] |
| 32 | ring |
| 33 | |
| 34 | /-- Local derivative bounds integrate to a quadratic sandwich around a zero of the rate. |
| 35 | |
| 36 | No ordering of `midpoint` and `time` is assumed. In the backwards case, both the |
| 37 | pointwise comparison and the oriented integral reverse order. |
| 38 | -/ |
| 39 | theorem integral_quadratic_bounds {D : Set ℝ} {rate : ℝ → ℝ} |
| 40 | {midpoint time lower upper : ℝ} (hD : Convex ℝ D) |
| 41 | (hcont : ContinuousOn rate D) |
| 42 | (hdiff : DifferentiableOn ℝ rate (interior D)) |
| 43 | (hderiv : ∀ x ∈ interior D, lower ≤ deriv rate x ∧ deriv rate x ≤ upper) |
| 44 | (hm : midpoint ∈ D) (ht : time ∈ D) (hzero : rate midpoint = 0) : |
| 45 | lower * (time - midpoint) ^ 2 / 2 ≤ (∫ x in midpoint..time, rate x) ∧ |
| 46 | (∫ x in midpoint..time, rate x) ≤ upper * (time - midpoint) ^ 2 / 2 := by |
| 47 | have hlo := hD.mul_sub_le_image_sub_of_le_deriv hcont hdiff |
| 48 | (fun x hx => (hderiv x hx).1) |
| 49 | have hhi := hD.image_sub_le_mul_sub_of_deriv_le hcont hdiff |
| 50 | (fun x hx => (hderiv x hx).2) |
| 51 | have hlin (k : ℝ) : Continuous (fun x : ℝ => k * (x - midpoint)) := |
| 52 | continuous_const.mul (continuous_id.sub continuous_const) |
| 53 | rcases le_total midpoint time with hmt | htm |
| 54 | · have hsub : Icc midpoint time ⊆ D := hD.ordConnected.out hm ht |
| 55 | have hint : IntervalIntegrable rate volume midpoint time := |
| 56 | (hcont.mono hsub).intervalIntegrable_of_Icc hmt |
| 57 | have hl : (∫ x in midpoint..time, lower * (x - midpoint)) ≤ |
| 58 | ∫ x in midpoint..time, rate x := by |
| 59 | apply intervalIntegral.integral_mono_on hmt |
| 60 | ((hlin lower).intervalIntegrable midpoint time) hint |
| 61 | intro x hx |
| 62 | simpa only [hzero, sub_zero] using hlo midpoint hm x (hsub hx) hx.1 |
| 63 | have hu : (∫ x in midpoint..time, rate x) ≤ |
| 64 | ∫ x in midpoint..time, upper * (x - midpoint) := by |
| 65 | apply intervalIntegral.integral_mono_on hmt hint |
| 66 | ((hlin upper).intervalIntegrable midpoint time) |
| 67 | intro x hx |
| 68 | simpa only [hzero, sub_zero] using hhi midpoint hm x (hsub hx) hx.1 |
| 69 | rw [integral_centered_linear] at hl hu |
| 70 | simpa only [sub_self, zero_pow (by decide : 2 ≠ 0), sub_zero] using And.intro hl hu |
| 71 | · have hsub : Icc time midpoint ⊆ D := hD.ordConnected.out ht hm |
| 72 | have hint : IntervalIntegrable rate volume time midpoint := |
| 73 | (hcont.mono hsub).intervalIntegrable_of_Icc htm |
| 74 | have hl : (∫ x in time..midpoint, upper * (x - midpoint)) ≤ |
| 75 | ∫ x in time..midpoint, rate x := by |
| 76 | apply intervalIntegral.integral_mono_on htm |
| 77 | ((hlin upper).intervalIntegrable time midpoint) hint |
| 78 | intro x hx |
| 79 | have h := hhi x (hsub hx) midpoint hm hx.2 |
| 80 | rw [hzero] at h |
| 81 | nlinarith |
| 82 | have hu : (∫ x in time..midpoint, rate x) ≤ |
| 83 | ∫ x in time..midpoint, lower * (x - midpoint) := by |
| 84 | apply intervalIntegral.integral_mono_on htm hint |
| 85 | ((hlin lower).intervalIntegrable time midpoint) |
| 86 | intro x hx |
| 87 | have h := hlo x (hsub hx) midpoint hm hx.2 |
| 88 | rw [hzero] at h |
| 89 | nlinarith |
| 90 | rw [integral_centered_linear] at hl hu |
| 91 | rw [intervalIntegral.integral_symm time midpoint] |
| 92 | constructor <;> nlinarith |
| 93 | |
| 94 | /-- Gaussian upper and lower bounds with the manuscript's slot-length normalization. -/ |
| 95 | theorem gaussian_envelope_bounds {D : Set ℝ} {rate : ℝ → ℝ} |
| 96 | {midpoint time c C ell : ℝ} (hD : Convex ℝ D) |
| 97 | (hcont : ContinuousOn rate D) |
| 98 | (hdiff : DifferentiableOn ℝ rate (interior D)) |
| 99 | (hderiv : ∀ x ∈ interior D, |
| 100 | -C / ell ≤ deriv rate x ∧ deriv rate x ≤ -c / ell) |
| 101 | (hm : midpoint ∈ D) (ht : time ∈ D) (hzero : rate midpoint = 0) : |
| 102 | Real.exp (-C * (time - midpoint) ^ 2 / (2 * ell)) ≤ envelope rate midpoint time ∧ |
| 103 | envelope rate midpoint time ≤ Real.exp (-c * (time - midpoint) ^ 2 / (2 * ell)) := by |
| 104 | obtain ⟨hl, hu⟩ := integral_quadratic_bounds hD hcont hdiff hderiv hm ht hzero |
| 105 | constructor |
| 106 | · apply Real.exp_le_exp.2 |
| 107 | convert! hl using 1 |
| 108 | ring |
| 109 | · apply Real.exp_le_exp.2 |
| 110 | convert! hu using 1 |
| 111 | ring |
| 112 | |
| 113 | @[simp] theorem envelope_at_midpoint (rate : ℝ → ℝ) (midpoint : ℝ) : |
| 114 | envelope rate midpoint midpoint = 1 := by |
| 115 | simp [envelope] |
| 116 | |
| 117 | theorem envelope_pos (rate : ℝ → ℝ) (midpoint time : ℝ) : |
| 118 | 0 < envelope rate midpoint time := Real.exp_pos _ |
| 119 | |
| 120 | /-- For positive `c` and slot length the midpoint is the unique maximum on the domain. -/ |
| 121 | theorem envelope_lt_one_away_from_midpoint {D : Set ℝ} {rate : ℝ → ℝ} |
| 122 | {midpoint time c C ell : ℝ} (hD : Convex ℝ D) |
| 123 | (hcont : ContinuousOn rate D) |
| 124 | (hdiff : DifferentiableOn ℝ rate (interior D)) |
| 125 | (hderiv : ∀ x ∈ interior D, |
| 126 | -C / ell ≤ deriv rate x ∧ deriv rate x ≤ -c / ell) |
| 127 | (hm : midpoint ∈ D) (ht : time ∈ D) (hzero : rate midpoint = 0) |
| 128 | (hc : 0 < c) (hell : 0 < ell) (hne : time ≠ midpoint) : |
| 129 | envelope rate midpoint time < 1 := by |
| 130 | have hu := (gaussian_envelope_bounds hD hcont hdiff hderiv hm ht hzero).2 |
| 131 | have hsq : 0 < (time - midpoint) ^ 2 := sq_pos_of_ne_zero (sub_ne_zero.2 hne) |
| 132 | have he : -c * (time - midpoint) ^ 2 / (2 * ell) < 0 := |
| 133 | div_neg_of_neg_of_pos (mul_neg_of_neg_of_pos (neg_neg_of_pos hc) hsq) |
| 134 | (mul_pos (by norm_num) hell) |
| 135 | exact lt_of_le_of_lt hu (by simpa only [Real.exp_zero] using Real.exp_lt_exp.2 he) |
| 136 | |
| 137 | /-- Derivative of the manuscript's scalar reference rate in its magnitude variable. -/ |
| 138 | noncomputable def referenceSlope (lam u s : ℝ) : ℝ := |
| 139 | -lam * s / ((1 + s ^ 2) * Real.sqrt (1 + s ^ 2)) - |
| 140 | 2 * lam * s / ((1 + u ^ 2) * Real.sqrt (1 + u ^ 2)) |
| 141 | |
| 142 | /-- The displayed rate derivative is an actual derivative, including at zero. -/ |
| 143 | theorem hasDerivAt_netGrowth (lam u s : ℝ) : |
| 144 | HasDerivAt (PulseGrowth.netGrowth lam u) (referenceSlope lam u s) s := by |
| 145 | have hp : HasDerivAt (fun x : ℝ => 1 + x ^ 2) (2 * s) s := by |
| 146 | simpa using ((hasDerivAt_id s).pow 2).const_add 1 |
| 147 | have hr := hp.sqrt (ne_of_gt (PulseGrowth.one_add_sq_pos s)) |
| 148 | have hd := ((hasDerivAt_const s lam).div hr (ne_of_gt (PulseGrowth.radius_pos s))).sub |
| 149 | ((hp.const_mul lam).div_const ((1 + u ^ 2) * Real.sqrt (1 + u ^ 2))) |
| 150 | convert! hd using 1 |
| 151 | unfold referenceSlope |
| 152 | rw [Real.sq_sqrt (le_of_lt (PulseGrowth.one_add_sq_pos s))] |
| 153 | field_simp [ne_of_gt (PulseGrowth.radius_pos s), |
| 154 | ne_of_gt (PulseGrowth.one_add_sq_pos s), |
| 155 | ne_of_gt (PulseGrowth.dampingDenominator_pos u)] |
| 156 | ring |
| 157 | |
| 158 | /-- A positive lower bound on the magnitude of the rate derivative in the slot. -/ |
| 159 | noncomputable def referenceMinSlope (lam u : ℝ) : ℝ := |
| 160 | lam * u / ((1 + u ^ 2) * Real.sqrt (1 + u ^ 2)) |
| 161 | |
| 162 | /-- An upper bound on the magnitude of the rate derivative in the slot. -/ |
| 163 | noncomputable def referenceMaxSlope (lam u : ℝ) : ℝ := |
| 164 | 3 * lam * u / 2 + 3 * lam * u / ((1 + u ^ 2) * Real.sqrt (1 + u ^ 2)) |
| 165 | |
| 166 | theorem referenceMinSlope_pos {lam u : ℝ} (hlam : 0 < lam) (hu : 0 < u) : |
| 167 | 0 < referenceMinSlope lam u := by |
| 168 | unfold referenceMinSlope |
| 169 | exact div_pos (mul_pos hlam hu) (PulseGrowth.dampingDenominator_pos u) |
| 170 | |
| 171 | theorem referenceMaxSlope_pos {lam u : ℝ} (hlam : 0 < lam) (hu : 0 < u) : |
| 172 | 0 < referenceMaxSlope lam u := by |
| 173 | unfold referenceMaxSlope |
| 174 | exact add_pos (div_pos (mul_pos (mul_pos (by norm_num) hlam) hu) (by norm_num)) |
| 175 | (div_pos (mul_pos (mul_pos (by norm_num) hlam) hu) (PulseGrowth.dampingDenominator_pos u)) |
| 176 | |
| 177 | /-- Explicit, slot-length-independent bounds on the reference derivative. -/ |
| 178 | theorem referenceSlope_bounds {lam u s : ℝ} (hlam : 0 < lam) (hu : 0 < u) |
| 179 | (hs : s ∈ Icc (u / 2) (3 * u / 2)) : |
| 180 | -referenceMaxSlope lam u ≤ referenceSlope lam u s ∧ |
| 181 | referenceSlope lam u s ≤ -referenceMinSlope lam u := by |
| 182 | have hspos : 0 < s := by linarith [hs.1] |
| 183 | have hn : 0 ≤ lam * s := le_of_lt (mul_pos hlam hspos) |
| 184 | have hS : 1 ≤ 1 + s ^ 2 := by nlinarith [sq_nonneg s] |
| 185 | have hroot : 1 ≤ Real.sqrt (1 + s ^ 2) := Real.one_le_sqrt.2 hS |
| 186 | have hden : 1 ≤ (1 + s ^ 2) * Real.sqrt (1 + s ^ 2) := by |
| 187 | calc |
| 188 | 1 = (1 : ℝ) * 1 := by ring |
| 189 | _ ≤ (1 + s ^ 2) * Real.sqrt (1 + s ^ 2) := |
| 190 | mul_le_mul hS hroot (by norm_num) (le_of_lt (PulseGrowth.one_add_sq_pos s)) |
| 191 | have hfirst : lam * s / ((1 + s ^ 2) * Real.sqrt (1 + s ^ 2)) ≤ lam * s := by |
| 192 | apply (div_le_iff₀ (PulseGrowth.dampingDenominator_pos s)).2 |
| 193 | nlinarith [mul_le_mul_of_nonneg_left hden hn] |
| 194 | have hfirst0 : 0 ≤ lam * s / ((1 + s ^ 2) * Real.sqrt (1 + s ^ 2)) := |
| 195 | div_nonneg hn (le_of_lt (PulseGrowth.dampingDenominator_pos s)) |
| 196 | have hfirstUpper : lam * s ≤ 3 * lam * u / 2 := by nlinarith [hs.2] |
| 197 | have hsecondUpper : 2 * lam * s / ((1 + u ^ 2) * Real.sqrt (1 + u ^ 2)) ≤ |
| 198 | 3 * lam * u / ((1 + u ^ 2) * Real.sqrt (1 + u ^ 2)) := by |
| 199 | apply (div_le_div_iff_of_pos_right (PulseGrowth.dampingDenominator_pos u)).2 |
| 200 | nlinarith [hs.2] |
| 201 | have hsecondLower : lam * u / ((1 + u ^ 2) * Real.sqrt (1 + u ^ 2)) ≤ |
| 202 | 2 * lam * s / ((1 + u ^ 2) * Real.sqrt (1 + u ^ 2)) := by |
| 203 | apply (div_le_div_iff_of_pos_right (PulseGrowth.dampingDenominator_pos u)).2 |
| 204 | nlinarith [hs.1] |
| 205 | unfold referenceSlope referenceMaxSlope referenceMinSlope |
| 206 | rw [neg_mul, neg_div] |
| 207 | constructor <;> linarith |
| 208 | |
| 209 | /-- The reference rate expressed in slot time. -/ |
| 210 | noncomputable def referenceRate (lam u ell time : ℝ) : ℝ := |
| 211 | PulseGrowth.netGrowth lam u (PulseGrowth.slotMagnitude u ell time) |
| 212 | |
| 213 | theorem hasDerivAt_referenceRate (lam u ell time : ℝ) : |
| 214 | HasDerivAt (referenceRate lam u ell) |
| 215 | (referenceSlope lam u (PulseGrowth.slotMagnitude u ell time) * (u / ell)) time := by |
| 216 | have hs : HasDerivAt (PulseGrowth.slotMagnitude u ell) (u / ell) time := by |
| 217 | change HasDerivAt (fun x : ℝ => u / 2 + u * x / ell) (u / ell) time |
| 218 | convert! (((hasDerivAt_id time).const_mul u).div_const ell).const_add (u / 2) using 1 |
| 219 | simp |
| 220 | exact (hasDerivAt_netGrowth lam u (PulseGrowth.slotMagnitude u ell time)).comp time hs |
| 221 | |
| 222 | theorem slotMagnitude_mem_interval {u ell time : ℝ} (hu : 0 ≤ u) (hell : 0 < ell) |
| 223 | (ht : time ∈ Icc 0 ell) : |
| 224 | PulseGrowth.slotMagnitude u ell time ∈ Icc (u / 2) (3 * u / 2) := by |
| 225 | have hq0 : 0 ≤ u * time / ell := div_nonneg (mul_nonneg hu ht.1) (le_of_lt hell) |
| 226 | have hq1 : u * time / ell ≤ u := by |
| 227 | apply (div_le_iff₀ hell).2 |
| 228 | exact mul_le_mul_of_nonneg_left ht.2 hu |
| 229 | unfold PulseGrowth.slotMagnitude |
| 230 | constructor <;> linarith |
| 231 | |
| 232 | /-- Bounds on the derivative in slot time, uniformly for all positive slot lengths. -/ |
| 233 | theorem referenceRate_deriv_bounds {lam u ell time : ℝ} |
| 234 | (hlam : 0 < lam) (hu : 0 < u) (hell : 0 < ell) (ht : time ∈ Icc 0 ell) : |
| 235 | -(u * referenceMaxSlope lam u) / ell ≤ deriv (referenceRate lam u ell) time ∧ |
| 236 | deriv (referenceRate lam u ell) time ≤ -(u * referenceMinSlope lam u) / ell := by |
| 237 | have hb := referenceSlope_bounds hlam hu (slotMagnitude_mem_interval (le_of_lt hu) hell ht) |
| 238 | have hpos : 0 ≤ u / ell := le_of_lt (div_pos hu hell) |
| 239 | rw [(hasDerivAt_referenceRate lam u ell time).deriv] |
| 240 | constructor |
| 241 | · convert! mul_le_mul_of_nonneg_right hb.1 hpos using 1 |
| 242 | ring |
| 243 | · convert! mul_le_mul_of_nonneg_right hb.2 hpos using 1 |
| 244 | ring |
| 245 | |
| 246 | /-- Two-sided Gaussian bounds for the actual scalar reference envelope. |
| 247 | |
| 248 | All analytic hypotheses of `gaussian_envelope_bounds` are proved here from the |
| 249 | explicit reference formula. The constants depend on `lam` and `u`, not `ell`. |
| 250 | -/ |
| 251 | theorem reference_gaussian_bounds {lam u ell time : ℝ} |
| 252 | (hlam : 0 < lam) (hu : 0 < u) (hell : 0 < ell) (ht : time ∈ Icc 0 ell) : |
| 253 | Real.exp (-(u * referenceMaxSlope lam u) * (time - ell / 2) ^ 2 / (2 * ell)) ≤ |
| 254 | envelope (referenceRate lam u ell) (ell / 2) time ∧ |
| 255 | envelope (referenceRate lam u ell) (ell / 2) time ≤ |
| 256 | Real.exp (-(u * referenceMinSlope lam u) * (time - ell / 2) ^ 2 / (2 * ell)) := by |
| 257 | have hdiff : Differentiable ℝ (referenceRate lam u ell) := |
| 258 | fun x => (hasDerivAt_referenceRate lam u ell x).differentiableAt |
| 259 | apply gaussian_envelope_bounds (convex_Icc (0 : ℝ) ell) |
| 260 | hdiff.continuous.continuousOn hdiff.differentiableOn |
| 261 | · intro x hx |
| 262 | exact referenceRate_deriv_bounds hlam hu hell (interior_subset hx) |
| 263 | · constructor <;> linarith |
| 264 | · exact ht |
| 265 | · exact PulseGrowth.netGrowth_slot_midpoint lam u ell (ne_of_gt hell) |
| 266 | |
| 267 | /-- The reference envelope has positive Gaussian constants uniform in slot length. -/ |
| 268 | theorem reference_uniform_gaussian_bounds {lam u : ℝ} (hlam : 0 < lam) (hu : 0 < u) : |
| 269 | ∃ c C : ℝ, 0 < c ∧ 0 < C ∧ ∀ ell : ℝ, 0 < ell → ∀ time ∈ Icc 0 ell, |
| 270 | Real.exp (-C * (time - ell / 2) ^ 2 / ell) ≤ |
| 271 | envelope (referenceRate lam u ell) (ell / 2) time ∧ |
| 272 | envelope (referenceRate lam u ell) (ell / 2) time ≤ |
| 273 | Real.exp (-c * (time - ell / 2) ^ 2 / ell) := by |
| 274 | refine ⟨u * referenceMinSlope lam u / 2, u * referenceMaxSlope lam u / 2, |
| 275 | div_pos (mul_pos hu (referenceMinSlope_pos hlam hu)) (by norm_num), |
| 276 | div_pos (mul_pos hu (referenceMaxSlope_pos hlam hu)) (by norm_num), ?_⟩ |
| 277 | intro ell hell time ht |
| 278 | have hmax : -(u * referenceMaxSlope lam u / 2) * (time - ell / 2) ^ 2 / ell = |
| 279 | -(u * referenceMaxSlope lam u) * (time - ell / 2) ^ 2 / (2 * ell) := by ring |
| 280 | have hmin : -(u * referenceMinSlope lam u / 2) * (time - ell / 2) ^ 2 / ell = |
| 281 | -(u * referenceMinSlope lam u) * (time - ell / 2) ^ 2 / (2 * ell) := by ring |
| 282 | rw [hmax, hmin] |
| 283 | exact reference_gaussian_bounds hlam hu hell ht |
| 284 | |
| 285 | end NavierStokes.GaussianEnvelope |