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

Comparing changes
Choose two branches to see what changed, then open a pull request to bring the work across.
Able to merge. These branches can be merged automatically.
A pull request is already open: #601 perf(NavierStokes/Shaped): 1 file cheaper to elaborate (−20.6%, measured)
1 commit
+25 −25 NavierStokes/ShapedWaitBounds.lean View file
| @@ -26,7 +26,7 @@ theorem linearLag_le_constant {r b : ℝ → ℝ} (hr : Continuous r) (hb : Cont | ||
| 26 | 26 | {q₀ B y : ℝ} (hy : 0 ≤ y) (hq : q₀ ≤ B) |
| 27 | 27 | (hs : ∀ t ∈ Icc (0 : ℝ) y, b t ≤ r t * B) : linearLag r b q₀ y ≤ B := by |
| 28 | 28 | have h := linearLag_lower_barrier hr hb.fun_neg (q₀ := -q₀) (β := -B) (κ := 0) hy |
| 29 | - (by linarith) (fun t ht => by have := hs t ht; nlinarith) | |
| 29 | + (by linarith) (fun t ht => by have := hs t ht; linarith) | |
| 30 | 30 | rw [linearLag_neg] at h |
| 31 | 31 | linarith |
| 32 | 32 | |
| @@ -39,7 +39,7 @@ theorem linearLag_abs_le {r b : ℝ → ℝ} (hr : Continuous r) (hb : Continuou | ||
| 39 | 39 | have h := linearLag_lower_barrier hr hb (β := -B) (κ := 0) hy |
| 40 | 40 | (by have := (abs_le.mp hq).1; linarith) (fun t ht => by |
| 41 | 41 | have := (abs_le.mp (hs t ht)).1 |
| 42 | - nlinarith) | |
| 42 | + linarith) | |
| 43 | 43 | linarith |
| 44 | 44 | |
| 45 | 45 | theorem angularSource_abs_bound (c : Parameters) {h y η : ℝ} (hh : 0 ≤ h) |
| @@ -54,26 +54,26 @@ theorem angularSource_abs_bound (c : Parameters) {h y η : ℝ} (hh : 0 ≤ h) | ||
| 54 | 54 | (transportW_bounds c hh hh1 hy hη).2.trans (by norm_num)⟩ |
| 55 | 55 | have hk := dropCoefficient_bounds c.m y |
| 56 | 56 | have hsq := parameter_square_le_one hη |
| 57 | - have hd : 0 ≤ d η ∧ d η ≤ 1 := by unfold d; constructor <;> nlinarith [sq_nonneg η] | |
| 57 | + have hd : 0 ≤ d η ∧ d η ≤ 1 := by unfold d; constructor <;> linarith [sq_nonneg η] | |
| 58 | 58 | have hD : 0 ≤ D h ∧ D h ≤ 1 / 2 := by unfold D; constructor <;> linarith |
| 59 | 59 | have hJ := eta_shapeGradient_bounds hη |
| 60 | 60 | have hcoef : |1 - 2 * dropCoefficient c.m y * η ^ 2| ≤ 9 := by |
| 61 | 61 | have hp := mul_le_mul hk.2 hsq (sq_nonneg η) (by norm_num : (0 : ℝ) ≤ 4) |
| 62 | 62 | apply abs_le.mpr |
| 63 | - constructor <;> nlinarith [mul_nonneg hk.1 (sq_nonneg η)] | |
| 63 | + constructor <;> linarith [mul_nonneg hk.1 (sq_nonneg η)] | |
| 64 | 64 | have hfirst : |-slope c.dropLength c.lam y * transportW c h y η| ≤ 3 := by |
| 65 | 65 | rw [abs_mul, abs_neg] |
| 66 | 66 | exact (mul_le_mul hl hW (abs_nonneg _) (by norm_num : (0 : ℝ) ≤ 1)).trans_eq (by ring) |
| 67 | 67 | have hsecond : |h * (1 - 2 * dropCoefficient c.m y * η ^ 2)| ≤ 9 / 100 := by |
| 68 | 68 | rw [abs_mul, abs_of_nonneg hh] |
| 69 | 69 | have hb := mul_le_mul hh1 hcoef (abs_nonneg _) (by norm_num : (0 : ℝ) ≤ 1 / 100) |
| 70 | - nlinarith | |
| 70 | + linarith | |
| 71 | 71 | have hbase : 0 ≤ D h + d η * dropCoefficient c.m y ∧ D h + d η * dropCoefficient c.m y ≤ 9 / 2 := by |
| 72 | 72 | have hb := mul_le_mul hd.2 hk.2 hk.1 (by norm_num : (0 : ℝ) ≤ 1) |
| 73 | - constructor <;> nlinarith [mul_nonneg hd.1 hk.1] | |
| 73 | + constructor <;> linarith [mul_nonneg hd.1 hk.1] | |
| 74 | 74 | have hthird : |(D h + d η * dropCoefficient c.m y) * η * shapeGradient η| ≤ 9 / 2 := by |
| 75 | - rw [mul_assoc, abs_mul, abs_of_nonneg hbase.1, abs_of_nonneg (by nlinarith [sq_nonneg η] : 0 ≤ η * shapeGradient η)] | |
| 76 | - exact (mul_le_mul hbase.2 hJ.2 (by nlinarith [sq_nonneg η]) (by norm_num : (0 : ℝ) ≤ 9 / 2)).trans_eq (by ring) | |
| 75 | + rw [mul_assoc, abs_mul, abs_of_nonneg hbase.1, abs_of_nonneg (by linarith [sq_nonneg η] : 0 ≤ η * shapeGradient η)] | |
| 76 | + exact (mul_le_mul hbase.2 hJ.2 (by linarith [sq_nonneg η]) (by norm_num : (0 : ℝ) ≤ 9 / 2)).trans_eq (by ring) | |
| 77 | 77 | unfold angularSource |
| 78 | 78 | have hs : |-slope c.dropLength c.lam y * transportW c h y η - |
| 79 | 79 | h * (1 - 2 * dropCoefficient c.m y * η ^ 2) + |
| @@ -190,13 +190,13 @@ theorem equilibrium_bounds (v : TailData) {η : ℝ} (hh1 : v.h ≤ 1 / 100) (h | ||
| 190 | 190 | have hr := hold_rate_pos v.core |
| 191 | 191 | have hj := eta_shapeGradient_bounds hη |
| 192 | 192 | have hD : 0 ≤ D v.h ∧ D v.h ≤ 1 / 2 := by unfold D; constructor <;> linarith [v.h_pos] |
| 193 | - have hprod := mul_le_mul hD.2 hj.2 (by nlinarith [sq_nonneg η]) (by norm_num : (0 : ℝ) ≤ 1 / 2) | |
| 194 | - have hprod0 := mul_nonneg hD.1 (show 0 ≤ η * shapeGradient η by nlinarith [sq_nonneg η]) | |
| 193 | + have hprod := mul_le_mul hD.2 hj.2 (by linarith [sq_nonneg η]) (by norm_num : (0 : ℝ) ≤ 1 / 2) | |
| 194 | + have hprod0 := mul_nonneg hD.1 (show 0 ≤ η * shapeGradient η by linarith [sq_nonneg η]) | |
| 195 | 195 | unfold equilibrium |
| 196 | 196 | constructor |
| 197 | - · exact div_nonneg (by nlinarith [v.h_small, v.h_pos]) hr.le | |
| 197 | + · exact div_nonneg (by linarith [v.h_small, v.h_pos]) hr.le | |
| 198 | 198 | · apply (div_le_iff₀ hr).mpr |
| 199 | - nlinarith [v.core.lam_lt, v.h_pos] | |
| 199 | + linarith [v.core.lam_lt, v.h_pos] | |
| 200 | 200 | |
| 201 | 201 | theorem holdCoefficient_bounds (c : Parameters) {h η : ℝ} (hh : 0 ≤ h) |
| 202 | 202 | (hh1 : h ≤ 1 / 100) (hη : |η| ≤ 1) : 0 ≤ holdCoefficient c h η ∧ holdCoefficient c h η ≤ 4 := by |
| @@ -221,7 +221,7 @@ theorem angularLag_hold_error (v : TailData) {η t : ℝ} (hh1 : v.h ≤ 1 / 100 | ||
| 221 | 221 | (holdCoefficient v.core v.h η)).trans (add_le_add_left (abs_sub _ _) _) |
| 222 | 222 | linarith |
| 223 | 223 | have hex : Real.exp (-t) ≤ Real.exp (-(1 - v.core.lam) * t) := |
| 224 | - Real.exp_le_exp.mpr (by nlinarith [mul_nonneg v.core.lam_pos.le ht]) | |
| 224 | + Real.exp_le_exp.mpr (by linarith [mul_nonneg v.core.lam_pos.le ht]) | |
| 225 | 225 | rw [angularLag_hold_formula v.core v.h η ht] |
| 226 | 226 | have hf : holdFormula v.core v.h η t - equilibrium v.core v.h η = |
| 227 | 227 | (angularLag v.core v.h η v.core.holdStart - equilibrium v.core v.h η - holdCoefficient v.core v.h η) * |
| @@ -253,7 +253,7 @@ theorem decay_le_power (c : Parameters) (n : ℕ) (ht : waitForPower c n ≤ c.w | ||
| 253 | 253 | Real.exp (-(1 - c.lam) * c.wait) ≤ c.lam ^ n := by |
| 254 | 254 | have hmul := (div_le_iff₀ (hold_rate_pos c)).mp ht |
| 255 | 255 | calc |
| 256 | - _ ≤ Real.exp ((n : ℝ) * Real.log c.lam) := Real.exp_le_exp.mpr (by nlinarith) | |
| 256 | + _ ≤ Real.exp ((n : ℝ) * Real.log c.lam) := Real.exp_le_exp.mpr (by linarith) | |
| 257 | 257 | _ = _ := by rw [Real.exp_nat_mul, Real.exp_log c.lam_pos] |
| 258 | 258 | |
| 259 | 259 | theorem canonical_Qs_pulseStart_power_error {v : TailData} {K : ℝ} |
| @@ -283,7 +283,7 @@ theorem holdFloor_bounds (m : ℝ) : holdFloor m ≤ coneFloor ∧ holdFloor m | ||
| 283 | 283 | linarith) |
| 284 | 284 | have hc := coneFloor_pos |
| 285 | 285 | refine ⟨?_, min_le_right _ _, by linarith⟩ |
| 286 | - nlinarith [mul_le_mul_of_nonneg_left he hc.le] | |
| 286 | + linarith [mul_le_mul_of_nonneg_left he hc.le] | |
| 287 | 287 | |
| 288 | 288 | theorem holdSource_lower (v : TailData) {η t : ℝ} (hh1 : v.h ≤ 1 / 100) |
| 289 | 289 | (hhlam : v.h ≤ v.core.lam / 4) (hη : |η| ≤ 1) (ht : 0 ≤ t) : |
| @@ -298,14 +298,14 @@ theorem holdSource_lower (v : TailData) {η t : ℝ} (hh1 : v.h ≤ 1 / 100) | ||
| 298 | 298 | rw [← angularSource_hold v.core v.h η ht, angularSource, |
| 299 | 299 | slope_hold v.core.dropLength_pos.le hy, dropCoefficient_hold v.core ht] |
| 300 | 300 | simp only [mul_zero, add_zero, neg_neg] |
| 301 | - nlinarith [mul_le_mul_of_nonneg_left hW v.core.lam_pos.le] | |
| 301 | + linarith [mul_le_mul_of_nonneg_left hW v.core.lam_pos.le] | |
| 302 | 302 | |
| 303 | 303 | theorem holdFormula_eq_linearLag (c : Parameters) (h η t : ℝ) : |
| 304 | 304 | holdFormula c h η t = |
| 305 | 305 | linearLag (fun _ => 1 - c.lam) (holdSource c h η) (angularLag c h η c.holdStart) t := by |
| 306 | 306 | apply linearLag_eq_of_solution continuous_const |
| 307 | 307 | (continuous_const.sub (continuous_const.mul (Real.continuous_exp.comp continuous_neg))) |
| 308 | - · simp only [holdFormula, mul_zero, neg_zero, Real.exp_zero, mul_one] | |
| 308 | + · simp only [holdFormula, mul_zero, neg_zero, Real.exp_zero] | |
| 309 | 309 | ring |
| 310 | 310 | · intro u _ |
| 311 | 311 | exact holdFormula_hasDerivAt c h η u |
| @@ -325,7 +325,7 @@ theorem angularLag_hold_lower (v : TailData) {η t : ℝ} (hh1 : v.h ≤ 1 / 100 | ||
| 325 | 325 | angularLag v.core v.h η v.core.holdStart := by |
| 326 | 326 | have hs := mul_le_mul_of_nonneg_right hb.1 (sq_nonneg η) |
| 327 | 327 | have hl := mul_le_mul_of_nonneg_left v.core.lam_lt.le hc.le |
| 328 | - nlinarith | |
| 328 | + linarith | |
| 329 | 329 | have hsource : ∀ u ∈ Icc (0 : ℝ) t, |
| 330 | 330 | (1 - v.core.lam) * (holdFloor v.core.m * (η ^ 2 + v.core.lam)) ≤ holdSource v.core v.h η u := by |
| 331 | 331 | intro u hu |
| @@ -334,16 +334,16 @@ theorem angularLag_hold_lower (v : TailData) {η t : ℝ} (hh1 : v.h ≤ 1 / 100 | ||
| 334 | 334 | v.core.lam / 4 + (49 / 100) * η ^ 2 := by |
| 335 | 335 | have hbη := mul_le_mul_of_nonneg_right hb.2.1 (sq_nonneg η) |
| 336 | 336 | have hbLam := mul_le_mul_of_nonneg_right hb.2.1 v.core.lam_pos.le |
| 337 | - nlinarith [sq_nonneg η, v.core.lam_pos] | |
| 337 | + linarith [sq_nonneg η, v.core.lam_pos] | |
| 338 | 338 | have hn : 0 ≤ holdFloor v.core.m * (η ^ 2 + v.core.lam) := |
| 339 | 339 | mul_nonneg hc.le (add_nonneg (sq_nonneg η) v.core.lam_pos.le) |
| 340 | - nlinarith [mul_nonneg v.core.lam_pos.le hn] | |
| 340 | + linarith [mul_nonneg v.core.lam_pos.le hn] | |
| 341 | 341 | have hlo := linearLag_lower_barrier continuous_const |
| 342 | 342 | (continuous_const.sub (continuous_const.mul (Real.continuous_exp.comp continuous_neg))) |
| 343 | 343 | ht hinit hsource |
| 344 | 344 | rw [angularLag_hold_formula v.core v.h η ht, holdFormula_eq_linearLag] |
| 345 | 345 | have hp : -OutgoingSchedule.primitive (fun _ : ℝ => 1 - v.core.lam) t = -(1 - v.core.lam) * t := by |
| 346 | - simp only [OutgoingSchedule.primitive, intervalIntegral.integral_const, sub_zero, smul_eq_mul] | |
| 346 | + simp only [OutgoingSchedule.primitive, intervalIntegral.integral_const, sub_zero] | |
| 347 | 347 | ring |
| 348 | 348 | rw [hp] at hlo |
| 349 | 349 | convert! hlo using 1 |
| @@ -393,7 +393,7 @@ theorem axialLag_hold_history (v : TailData) (η : ℝ) {t : ℝ} (ht : 0 ≤ t) | ||
| 393 | 393 | have hu0 := (uIcc_of_le ht ▸ hu).1 |
| 394 | 394 | have hd := (axialLag_hasDerivAt v (v.core.holdStart + u) η).comp u |
| 395 | 395 | ((hasDerivAt_id u).const_add v.core.holdStart) |
| 396 | - simp only [Function.comp_def, mul_one, one_mul, axialSource, | |
| 396 | + simp only [mul_one, one_mul, axialSource, | |
| 397 | 397 | geometricAxialSource_hold v.core v.h η hu0, zero_add] at hd ⊢ |
| 398 | 398 | exact hd |
| 399 | 399 | |
| @@ -501,12 +501,12 @@ theorem weighted_pressure_source_bound (v : TailData) {η t : ℝ} | ||
| 501 | 501 | Real.exp (-2 * v.core.lam * t)) := by rw [weighted_angular_square_hold v.core η ht] |
| 502 | 502 | _ ≤ _ := by |
| 503 | 503 | have he : Real.exp (-2 * v.core.lam * t) ≤ 1 := |
| 504 | - Real.exp_le_one_iff.mpr (by nlinarith [mul_nonneg v.core.lam_pos.le ht]) | |
| 504 | + Real.exp_le_one_iff.mpr (by linarith [mul_nonneg v.core.lam_pos.le ht]) | |
| 505 | 505 | have hp := mul_le_mul_of_nonneg_left he |
| 506 | 506 | (show 0 ≤ pressureSourceBound * |η| * angular v.core.P v.core.dropLength v.core.lam (v.core.holdStart, η) ^ 2 by |
| 507 | 507 | have := pressureSourceBound_pos |
| 508 | 508 | positivity) |
| 509 | - nlinarith | |
| 509 | + linarith | |
| 510 | 510 | |
| 511 | 511 | theorem axialLag_hold_bound (v : TailData) {η t : ℝ} |
| 512 | 512 | (hh1 : v.h ≤ 1 / 100) (hη : |η| ≤ 1) (ht : 0 ≤ t) (htw : t ≤ v.core.wait) : |
| @@ -537,7 +537,7 @@ theorem axialLag_hold_ratio_bound (v : TailData) {η t : ℝ} | ||
| 537 | 537 | have hsecond : pressureSourceBound * E₀ ^ 2 ≤ |
| 538 | 538 | (pressureSourceBound * initialEnergyUpper v.core.P v.core.m) * E₀ := by |
| 539 | 539 | have hp := mul_le_mul_of_nonneg_right hE.2 (mul_pos hC hE₀).le |
| 540 | - nlinarith | |
| 540 | + linarith | |
| 541 | 541 | have hinside : initialAxialBound v.core.P v.core.m + t * (pressureSourceBound * E₀ ^ 2) ≤ |
| 542 | 542 | axialWaitConstant v.core.P v.core.m * (1 + t) * E₀ := by |
| 543 | 543 | have hm := mul_le_mul_of_nonneg_left hsecond ht |
+23 −0 routes/s2-ns-shaped-1/README.md added View file
| @@ -0,0 +1,23 @@ | ||
| 1 | +--- | |
| 2 | +issue: 11 | |
| 3 | +status: working | |
| 4 | +--- | |
| 5 | +# s2-ns-shaped-1 | |
| 6 | + | |
| 7 | +One unit of S-2 (issue #11), on the family `NavierStokes/Shaped*`: one file, | |
| 8 | +`NavierStokes/ShapedWaitBounds.lean`, made cheaper to elaborate. The edits are | |
| 9 | +inside proofs only (25 lines out, 25 in): `nlinarith` becomes `linarith`, and | |
| 10 | +several `simp only` argument lists lose entries that do not change the goal. | |
| 11 | +No statement, import line or docstring changes, and there is no | |
| 12 | +`maxHeartbeats`. The edits are Treant's `speedup_trials` edits | |
| 13 | +(TitiSkywalker/NavierStokesAndEuler, run of 2026-12-03 at upstream `f9e8bc5`), | |
| 14 | +carried onto main at `d956c7c` and counted there: 187.90 G to 149.17 G | |
| 15 | +instructions retired, −20.6%. The count and how it was taken are in the pull | |
| 16 | +request's description. | |
| 17 | + | |
| 18 | +## Next | |
| 19 | + | |
| 20 | +Push, let the `challenge` and `build` checks run, and reply to the maintainer's | |
| 21 | +review. If `build` rejects one of the `linarith` or `simp only` lines, restore | |
| 22 | +that line's original form, re-count the file and report the new number in the | |
| 23 | +description. | |