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: #575 perf(NavierStokes/Matching): 2 files cheaper to elaborate (−16.5%, measured)
1 commit
+12 −12 NavierStokes/MatchingConeBounds.lean View file
| @@ -35,7 +35,7 @@ theorem shape_axis_lower {h j eta ell theta : ℝ} | ||
| 35 | 35 | theta * H h j eta * OutgoingEntranceCone.shapeGradient eta := by |
| 36 | 36 | have heta : |eta| ≤ 1 := abs_le.mpr hη |
| 37 | 37 | have hd0 := d_nonneg hη |
| 38 | - have hd1 : d eta ≤ 1 := by unfold d; nlinarith [sq_nonneg eta] | |
| 38 | + have hd1 : d eta ≤ 1 := by unfold d; linarith [sq_nonneg eta] | |
| 39 | 39 | have hD := D_pos hs |
| 40 | 40 | have hu : |U j eta| ≤ 4001 / 1000 := by |
| 41 | 41 | calc |
| @@ -62,7 +62,7 @@ theorem shape_axis_lower {h j eta ell theta : ℝ} | ||
| 62 | 62 | (mul_le_of_le_one_left hs.j_pos.le hd1).trans hs.j_le |
| 63 | 63 | have herr : -(1 / 500 : ℝ) ≤ d eta * j * OutgoingEntranceCone.shapeGradient eta := by |
| 64 | 64 | have hm := mul_le_mul_of_nonneg_left (abs_le.mp hgabs).1 hdj |
| 65 | - nlinarith | |
| 65 | + linarith | |
| 66 | 66 | have hid : H h j eta * OutgoingEntranceCone.shapeGradient eta = |
| 67 | 67 | (D h + 4 * d eta) * (eta * OutgoingEntranceCone.shapeGradient eta) + |
| 68 | 68 | d eta * j * OutgoingEntranceCone.shapeGradient eta := by |
| @@ -73,7 +73,7 @@ theorem shape_axis_lower {h j eta ell theta : ℝ} | ||
| 73 | 73 | linarith |
| 74 | 74 | have htheta : -(1 / 500 : ℝ) ≤ theta * H h j eta * OutgoingEntranceCone.shapeGradient eta := by |
| 75 | 75 | have hm := mul_le_mul_of_nonneg_left hH ht.1 |
| 76 | - nlinarith [ht.2] | |
| 76 | + linarith [ht.2] | |
| 77 | 77 | have hW := neg_W_lower_bound hs hη |
| 78 | 78 | have hbase : (2991 / 1000 : ℝ) * (11 / 20) ≤ -W h j eta * ell := |
| 79 | 79 | mul_le_mul hW hl (by norm_num) (by linarith) |
| @@ -153,7 +153,7 @@ theorem shapeModel_uniform_lower {h j sigma : ℝ} (hs : SmallParameters h j) | ||
| 153 | 153 | have hm := (div_lt_iff₀ htau).mp (show 1 / tau < Λ by |
| 154 | 154 | have := (le_max_right M0 (1 + 1 / tau)).trans hΛ |
| 155 | 155 | linarith) |
| 156 | - nlinarith | |
| 156 | + linarith | |
| 157 | 157 | have he := (abs_lt.mp (hpert p (1 / Λ) ht)).1 |
| 158 | 158 | have hm := hmain Λ ((le_max_left _ _).trans hΛ) p |
| 159 | 159 | linarith |
| @@ -258,7 +258,7 @@ theorem angular_barrier {D : RadialDomain} (P : Profiles D) {h eta a X : ℝ} | ||
| 258 | 258 | have he := ReferenceBounds.angularSource_eq P (hmem s hs) (hf s hs).ne' h |
| 259 | 259 | have hterm : 2 * L h eta * ReferenceBounds.logSlope P (s, eta) ≤ 2 := by |
| 260 | 260 | have hh := mul_le_mul_of_nonneg_left (hl s hs) (show 0 ≤ 2 * L h eta by positivity) |
| 261 | - nlinarith | |
| 261 | + linarith | |
| 262 | 262 | have hsq : 2 < s * ReferenceBounds.sourceQ P h (s, eta) := by |
| 263 | 263 | have hh := mul_lt_mul_of_pos_left (hq s hs) (hspos s hs) |
| 264 | 264 | linarith [hs.1] |
| @@ -279,12 +279,12 @@ theorem angular_barrier {D : RadialDomain} (P : Profiles D) {h eta a X : ℝ} | ||
| 279 | 279 | rw [ReferenceBounds.p1_primitive P (hspos a ⟨le_rfl, haX⟩).ne' h] at hinit |
| 280 | 280 | have hi := (lt_div_iff₀ (mul_pos hL (hHpos a ⟨le_rfl, haX⟩))).mp hinit |
| 281 | 281 | unfold angularGap |
| 282 | - nlinarith | |
| 282 | + linarith | |
| 283 | 283 | have hout : 0 < angularGap P h eta X := hini.trans_le (hm ⟨le_rfl, haX⟩ ⟨haX, le_rfl⟩ haX) |
| 284 | 284 | rw [ReferenceBounds.p1_primitive P (hspos X ⟨haX, le_rfl⟩).ne' h] |
| 285 | 285 | apply (lt_div_iff₀ (mul_pos hL (hHpos X ⟨haX, le_rfl⟩))).mpr |
| 286 | 286 | unfold angularGap at hout |
| 287 | - nlinarith | |
| 287 | + linarith | |
| 288 | 288 | |
| 289 | 289 | theorem axial_error_jet {J K : Set ℝ} (R : TransitionRamp.StockReference J) |
| 290 | 290 | (hJ : IsOpen J) (hKJ : K ⊆ J) {N : ℕ} {eps T kappa wU wE y eta : ℝ} |
| @@ -320,7 +320,7 @@ theorem seedU_error_jets {N : ℕ} {eps X eta : ℝ} | ||
| 320 | 320 | · have hxn : X ≤ 4 / A.scale := by simpa only [c.reference_radius] using hx |
| 321 | 321 | have hY : A.scale * X ∈ Ioo (-20 : ℝ) 20 := by |
| 322 | 322 | have hb := (le_div_iff₀ A.scale_pos).mp hxn |
| 323 | - constructor <;> nlinarith [mul_nonneg A.scale_pos.le hX] | |
| 323 | + constructor <;> linarith [mul_nonneg A.scale_pos.le hX] | |
| 324 | 324 | have he : (fun e => c.seedU (X, e) - U A.j e) = |
| 325 | 325 | (fun e => A.natural.profile.family.U (X, e) - U A.j e) := by |
| 326 | 326 | funext e |
| @@ -330,7 +330,7 @@ theorem seedU_error_jets {N : ℕ} {eps X eta : ℝ} | ||
| 330 | 330 | have hY5 : |A.scale * X| ≤ 5 := by |
| 331 | 331 | rw [abs_of_nonneg (mul_nonneg A.scale_pos.le hX)] |
| 332 | 332 | have hb := (le_div_iff₀ A.scale_pos).mp hxn |
| 333 | - nlinarith | |
| 333 | + linarith | |
| 334 | 334 | have hb := (ReferenceJetBounds.coefficient_jet_bound A.preparation.inputs.coefficients |
| 335 | 335 | A.natural.profile.coefficients A.natural.profile.norm_ball 0 n (p := (A.scale * X, eta)) hY5).2 |
| 336 | 336 | have hh := mul_le_mul_of_nonneg_left hb (one_div_nonneg.mpr A.scale_pos.le) |
| @@ -566,7 +566,7 @@ theorem shapeValue_hasDerivAt_x (C T : ℝ) (li : ℝ → ℝ) {X : ℝ} (hX : 0 | ||
| 566 | 566 | have hroot := Real.sqrt_pos.mpr (show 0 < 2 * X by positivity) |
| 567 | 567 | have hsq := Real.sq_sqrt (show 0 ≤ 2 * X by positivity) |
| 568 | 568 | convert! ha.div hr hroot.ne' using 1 |
| 569 | - dsimp only [shapeValue, ShapeTransition.angular, Function.comp_def, Function.comp_apply] | |
| 569 | + dsimp only [shapeValue, ShapeTransition.angular, Function.comp_def] | |
| 570 | 570 | generalize hk : Real.exp (ShapeTransition.logProfile C T li |
| 571 | 571 | (Real.log (X / NominalProfile.Xi), eta)) = k |
| 572 | 572 | generalize hr' : Real.sqrt (2 * X) = r at hroot hsq ⊢ |
| @@ -861,7 +861,7 @@ theorem exists_ordered_prepared_continuation (F : OutgoingProfile.Profile) (N : | ||
| 861 | 861 | have hm := (le_div_iff₀ (show 0 < 2 * K by positivity)).mp (min_le_right |
| 862 | 862 | (min 1 (NominalProfile.resetSolver.radius / 2)) (delta / (2 * K))) |
| 863 | 863 | change tau * (2 * K) ≤ delta at hm |
| 864 | - nlinarith [mul_nonneg hK.le htau.le] | |
| 864 | + linarith [mul_nonneg hK.le htau.le] | |
| 865 | 865 | let rho := tau ^ (N + 1) |
| 866 | 866 | have hrho : 0 < rho := pow_pos htau _ |
| 867 | 867 | have hpow : rho ≤ tau := by |
| @@ -891,7 +891,7 @@ theorem exists_ordered_prepared_continuation (F : OutgoingProfile.Profile) (N : | ||
| 891 | 891 | ReferenceJetBounds.jetConstant prep.inputs.coefficients 0 n / Λ ≤ delta / 3 := by |
| 892 | 892 | apply (div_le_iff₀ hΛ).mpr |
| 893 | 893 | have hmul := (div_le_iff₀ hdelta).mp hLD |
| 894 | - nlinarith [hDb n hn] | |
| 894 | + linarith [hDb n hn] | |
| 895 | 895 | obtain ⟨T, hT, Cmatch, hCmatch, hnorm⟩ := hmatch Λ hΛ hLm |
| 896 | 896 | obtain ⟨Cgeo, hgeo⟩ := eventually_atTop.mp |
| 897 | 897 | (NominalProfile.eventually_matching_geometry F T radiusFloor Cmatch) |
+6 −6 NavierStokes/MatchingDebtBounds.lean View file
| @@ -90,7 +90,7 @@ theorem radialClamp_mem {scale : ℝ} (hscale : 0 < scale) (X : ℝ) : | ||
| 90 | 90 | have hm : scale * X ≤ scale * X * OutgoingSchedule.sigma (scale * X + 2) := by |
| 91 | 91 | nlinarith [mul_nonpos_of_nonneg_of_nonpos hscale.le hXn] |
| 92 | 92 | dsimp [radialClamp] |
| 93 | - nlinarith | |
| 93 | + linarith | |
| 94 | 94 | |
| 95 | 95 | noncomputable def strip (scale : ℝ) : Set Point := |
| 96 | 96 | {p | -20 < scale * p.1 ∧ p.2 ∈ ReferencePath.parameterInterval} |
| @@ -172,7 +172,7 @@ theorem iteratedDeriv_component {d : ℝ → Debt} (hd : ContDiff ℝ ∞ d) | ||
| 172 | 172 | have he := (ContinuousLinearMap.proj i : Debt →L[ℝ] ℝ).iteratedFDeriv_comp_left (x := eta) |
| 173 | 173 | hd.contDiffAt (nat_le_infty n) |
| 174 | 174 | have h := (congrArg (fun L => L (fun _ : Fin n => (1 : ℝ))) he).symm |
| 175 | - simp only [ContinuousLinearMap.compContinuousMultilinearMap_coe, Function.comp_def] at h | |
| 175 | + simp only [Function.comp_def] at h | |
| 176 | 176 | exact h |
| 177 | 177 | |
| 178 | 178 | theorem vector_jet_le_sum {d : ℝ → Debt} (hd : ContDiff ℝ ∞ d) (n : ℕ) (eta : ℝ) : |
| @@ -554,7 +554,7 @@ theorem driftBudget_weighted {F : OutgoingProfile.Profile} {N : ℕ} | ||
| 554 | 554 | have hm := (le_div_iff₀ (mul_pos (by norm_num : (0 : ℝ) < 4) (mul_pos q.normalizer_pos hd))).mp |
| 555 | 555 | (min_le_right 1 (rho / (4 * (q.normalizer * driftFactor N q.axial q.angular)))) |
| 556 | 556 | change driftBudget q rho * (4 * (q.normalizer * driftFactor N q.axial q.angular)) ≤ rho at hm |
| 557 | - nlinarith | |
| 557 | + linarith | |
| 558 | 558 | |
| 559 | 559 | theorem normalized_debt_small_of_budgets {F : OutgoingProfile.Profile} {A : NominalProfile.AxisStage F} |
| 560 | 560 | (c : NominalProfile.Controls A) {N : ℕ} (q : FixedBounds F N) {B K BJ rho : ℝ} |
| @@ -570,10 +570,10 @@ theorem normalized_debt_small_of_budgets {F : OutgoingProfile.Profile} {A : Nomi | ||
| 570 | 570 | (driftBudget_pos q hrho).le (driftBudget_le_one q rho) hC hsep hdef |
| 571 | 571 | have hpre : q.normalizer * prefixBudget q B K BJ c.shapeTime A.normalization < rho / 4 := by |
| 572 | 572 | have hh := (lt_div_iff₀ (mul_pos (by norm_num : (0 : ℝ) < 4) q.normalizer_pos)).mp hp |
| 573 | - nlinarith | |
| 573 | + linarith | |
| 574 | 574 | have hrest := driftBudget_weighted q rho |
| 575 | 575 | intro n hn eta hη |
| 576 | - exact (hb n hn eta hη).trans_lt (by nlinarith) | |
| 576 | + exact (hb n hn eta hη).trans_lt (by linarith) | |
| 577 | 577 | |
| 578 | 578 | structure MatchingBounds {F : OutgoingProfile.Profile} {A : NominalProfile.AxisStage F} |
| 579 | 579 | (c : NominalProfile.Controls A) (N : ℕ) (rho : ℝ) : Prop where |
| @@ -688,7 +688,7 @@ theorem exists_ordered_matching_threshold (F : OutgoingProfile.Profile) (N : ℕ | ||
| 688 | 688 | ReferenceJetBounds.jetConstant prep.inputs.coefficients 0 n / Λ ≤ delta / 3 := by |
| 689 | 689 | apply (div_le_iff₀ hΛ).mpr |
| 690 | 690 | have hm := (div_le_iff₀ hd).mp hLD |
| 691 | - nlinarith [hDb n hn] | |
| 691 | + linarith [hDb n hn] | |
| 692 | 692 | obtain ⟨B, hB, K, hK, BJ0, hBJ0, hseed⟩ := TransitionRamp.ordered_seed_bounds |
| 693 | 693 | prep.inputs hΛ hj prep.sigma_pos hnatural F.axisDatum_contDiff N |
| 694 | 694 | let BJ := max BJ0 q.logarithm |
+29 −0 routes/s2-ns-matching-1/README.md added View file
| @@ -0,0 +1,29 @@ | ||
| 1 | +--- | |
| 2 | +issue: 11 | |
| 3 | +status: working | |
| 4 | +--- | |
| 5 | +# s2-ns-matching-1 | |
| 6 | + | |
| 7 | +S-2's first unit on the family `NavierStokes/Matching*`: make `NavierStokes/MatchingConeBounds.lean` | |
| 8 | +and `NavierStokes/MatchingDebtBounds.lean` cheaper to elaborate, with edits inside proofs only. | |
| 9 | +The edits are Treant's `speedup_trials` stage (TitiSkywalker/NavierStokesAndEuler, the run of | |
| 10 | +2026-12-03 at upstream `f9e8bc5`), carried onto main at `d956c7c` and counted again there: a `simp` | |
| 11 | +argument list loses the entries that do not change the goal, and `nlinarith` becomes `linarith` | |
| 12 | +where the goal is linear. No statement, import line or docstring changes, and there is no | |
| 13 | +`maxHeartbeats`. | |
| 14 | + | |
| 15 | +The count is instructions retired in user space by `lean` elaborating the one file alone, on one | |
| 16 | +thread with synchronous elaboration (`lean -j1 -DElab.async=false`, the lakefile's options, under | |
| 17 | +`perf stat -e instructions:u`), against main at `d956c7c` and the same commit with the edits. Both | |
| 18 | +files are at least 0.5% cheaper: | |
| 19 | + | |
| 20 | +| file | before | after | change | | |
| 21 | +|---|---|---|---| | |
| 22 | +| `NavierStokes/MatchingConeBounds.lean` | 57.16 G | 46.30 G | −19.0% | | |
| 23 | +| `NavierStokes/MatchingDebtBounds.lean` | 29.35 G | 25.90 G | −11.7% | | |
| 24 | + | |
| 25 | +## Next | |
| 26 | + | |
| 27 | +The pull request is up; `build` decides whether the shortened proofs still elaborate. If it fails on | |
| 28 | +one of the two files, that file's edits are dropped rather than repaired by hand. Other files of the | |
| 29 | +`Matching*` family are left to other units of #11. | |