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: #593 perf(NavierStokes/Reference): 3 files cheaper to elaborate (−22.8%, measured)
1 commit
+14 −14 NavierStokes/ReferenceBounds.lean View file
| @@ -288,14 +288,14 @@ theorem lower_comparison_preserves {X a L b q : ℝ} | ||
| 288 | 288 | have hX : 0 < X := ha.trans_le haX |
| 289 | 289 | have hfac : 0 ≤ q * (X + a) - 2 * b * L := by |
| 290 | 290 | have hm := mul_le_mul_of_nonneg_left haX hq |
| 291 | - nlinarith | |
| 291 | + linarith | |
| 292 | 292 | have hprod := mul_nonneg (sub_nonneg.mpr haX) hfac |
| 293 | 293 | have heq : b * a / X + q / (2 * L) * (X - a ^ 2 / X) = |
| 294 | 294 | (2 * L * b * a + q * (X ^ 2 - a ^ 2)) / (2 * L * X) := by |
| 295 | 295 | field_simp |
| 296 | 296 | rw [heq] |
| 297 | 297 | apply (le_div_iff₀ (by positivity : 0 < 2 * L * X)).mpr |
| 298 | - nlinarith | |
| 298 | + linarith | |
| 299 | 299 | |
| 300 | 300 | theorem p1_preserves_lower {p : Point} (hp : p ∈ D.carrier) (hX : 0 < p.1) |
| 301 | 301 | (h : ℝ) (hL : 0 < NaturalAxisData.L h p.2) {a b q : ℝ} |
| @@ -318,7 +318,7 @@ theorem p1_at_hundred_gt_three {η h : ℝ} (hp : (100, η) ∈ D.carrier) | ||
| 318 | 318 | (by norm_num : (0 : ℝ) ≤ 12 / 5) hf hmono hsource |
| 319 | 319 | have hn : (3 : ℝ) < (12 / 5) * 100 / (2 * NaturalAxisData.L h η) := by |
| 320 | 320 | apply (lt_div_iff₀ (mul_pos (by norm_num) hL)).mpr |
| 321 | - nlinarith | |
| 321 | + linarith | |
| 322 | 322 | exact hn.trans_le hb |
| 323 | 323 | |
| 324 | 324 | theorem p2_large_of_small_f {p : Point} (hX : 0 < p.1) (hX110 : p.1 ≤ 110) |
| @@ -328,7 +328,7 @@ theorem p2_large_of_small_f {p : Point} (hX : 0 < p.1) (hX110 : p.1 ≤ 110) | ||
| 328 | 328 | (hn : ν ≤ |ns P h p|) (hlarge : 18 * K / (a * ν) < C) : |
| 329 | 329 | (6 / 5 : ℝ) < |p2 P h p| := by |
| 330 | 330 | have hs : Real.sqrt (2 * p.1) ≤ 15 := |
| 331 | - (Real.sqrt_le_iff).mpr ⟨by norm_num, by nlinarith⟩ | |
| 331 | + (Real.sqrt_le_iff).mpr ⟨by norm_num, by linarith⟩ | |
| 332 | 332 | have hE : 0 < P.E p := mul_pos (Real.sqrt_pos.mpr (by positivity)) hf |
| 333 | 333 | have hEb : P.E p ≤ 15 * K / C := by |
| 334 | 334 | change Real.sqrt (2 * p.1) * P.f p ≤ _ |
| @@ -338,7 +338,7 @@ theorem p2_large_of_small_f {p : Point} (hX : 0 < p.1) (hX110 : p.1 ≤ 110) | ||
| 338 | 338 | have hc : 18 * K / C < a * ν := by |
| 339 | 339 | apply (div_lt_iff₀ hC).mpr |
| 340 | 340 | have hh := (div_lt_iff₀ (mul_pos ha hν)).mp hlarge |
| 341 | - nlinarith | |
| 341 | + linarith | |
| 342 | 342 | have hnprod : a * ν ≤ p.1 * |ns P h p| := |
| 343 | 343 | mul_le_mul haX hn hν.le hX.le |
| 344 | 344 | rw [p2, abs_div, abs_mul, abs_of_pos hX, abs_of_pos hE] |
| @@ -358,7 +358,7 @@ theorem cone_margin_of_dichotomy {a b : ℝ} (ha : 0 < a) | ||
| 358 | 358 | have habs := sq_lt_sq₀ (by norm_num : (0 : ℝ) ≤ 6 / 5) (abs_nonneg b) |>.mpr hsecond |
| 359 | 359 | simpa only [sq_abs] using habs |
| 360 | 360 | have hm : (12 / 5 : ℝ) * a < a ^ 2 + b ^ 2 := by |
| 361 | - nlinarith [sq_nonneg (a - 6 / 5)] | |
| 361 | + linarith [sq_nonneg (a - 6 / 5)] | |
| 362 | 362 | have hd : (12 / 5 : ℝ) < a + b ^ 2 / a := by |
| 363 | 363 | calc |
| 364 | 364 | (12 / 5 : ℝ) < (a ^ 2 + b ^ 2) / a := (lt_div_iff₀ ha).mpr hm |
| @@ -483,15 +483,15 @@ theorem qModel_uniform_lower {h j σ : ℝ} {P0 : ℝ → ℝ} | ||
| 483 | 483 | have hmul := (div_lt_iff₀ hδ).mp hΛ' |
| 484 | 484 | have ht : |1 / Λ| < δ := by |
| 485 | 485 | rw [abs_of_pos (one_div_pos.mpr hΛ0), div_lt_iff₀ hΛ0] |
| 486 | - nlinarith | |
| 486 | + linarith | |
| 487 | 487 | have he' : |e| < δ := he.trans_lt (by |
| 488 | 488 | apply (div_lt_iff₀ hΛ0).mpr |
| 489 | - nlinarith) | |
| 489 | + linarith) | |
| 490 | 490 | have hnorm : ‖((1 / Λ), e)‖ < δ := by |
| 491 | 491 | simpa only [Prod.norm_def, Real.norm_eq_abs, max_lt_iff] using And.intro ht he' |
| 492 | 492 | have herror := (abs_lt.mp (hpert p ((1 / Λ), e) hnorm)).1 |
| 493 | 493 | have hb := hmain Λ ((le_max_left _ _).trans hΛ) p |
| 494 | - nlinarith | |
| 494 | + linarith | |
| 495 | 495 | |
| 496 | 496 | abbrev AxialSourceParameter (B : ℝ) := Icc (-1 : ℝ) 1 × BoundedJets B |
| 497 | 497 | |
| @@ -595,7 +595,7 @@ theorem sourceQ_model (h j σ : ℝ) {Λ φ Y θ r : ℝ} (hΛ : Λ ≠ 0) | ||
| 595 | 595 | qRemainder h j σ (Y, p.2) θ (qJets P j σ h Λ φ p) (1 / Λ) r := by |
| 596 | 596 | have hg := NaturalProfile.gradient_identity h j σ p.2 |
| 597 | 597 | simp only [qRemainder, qJets, Matrix.cons_val_zero, Matrix.cons_val_one, |
| 598 | - Matrix.cons_val, Fin.isValue, max_eq_right hφ] | |
| 598 | + Matrix.cons_val, max_eq_right hφ] | |
| 599 | 599 | rw [← hrad] |
| 600 | 600 | unfold sourceQ logSlope Profiles.W |
| 601 | 601 | unfold NaturalAxisData.W NaturalAxisData.H at hg ⊢ |
| @@ -792,7 +792,7 @@ theorem reference_p1_natural {δ : ℝ} (hδ : 0 < δ) (hδT : 2 * δ < rampLimi | ||
| 792 | 792 | p1 (referenceProfiles F hΛ hδ hδT hP0) h p = NaturalEntrance.p1 F.family.f p := by |
| 793 | 793 | let N := Input.ofNatural hΛ F.family |
| 794 | 794 | let P := referenceProfiles F hΛ hδ hδT hP0 |
| 795 | - have hY : Λ * p.1 ≤ 4 := by nlinarith [(le_div_iff₀ hΛ).mp ha] | |
| 795 | + have hY : Λ * p.1 ≤ 4 := by linarith [(le_div_iff₀ hΛ).mp ha] | |
| 796 | 796 | have hpoint : rescalePoint Λ p ∈ NaturalEntrance.entranceSet := |
| 797 | 797 | ⟨⟨mul_nonneg hΛ.le hX.le, by change Λ * p.1 ≤ 41 / 10; linarith⟩, hη⟩ |
| 798 | 798 | have hp := NaturalEntrance.entrance_mem_strip hpoint |
| @@ -951,7 +951,7 @@ theorem pressureJets_small {p : Point} (hp : p ∈ D.carrier) | ||
| 951 | 951 | have hinv : |1 / Λ| < ε := by |
| 952 | 952 | rw [abs_of_pos (one_div_pos.mpr hΛ0), div_lt_iff₀ hΛ0] |
| 953 | 953 | have hmul := (div_lt_iff₀ hε).mp (show 1 / ε < Λ by linarith) |
| 954 | - nlinarith | |
| 954 | + linarith | |
| 955 | 955 | have hsize : 220 * K ^ 2 / C ^ 2 < ε := by |
| 956 | 956 | apply (div_lt_iff₀ (sq_pos_of_pos hC0)).mpr |
| 957 | 957 | have hb := (div_lt_iff₀ hε).mp (show 220 * K ^ 2 / ε < C by linarith) |
| @@ -1224,7 +1224,7 @@ theorem exists_reference_bounds {h j σ ν : ℝ} {P0 : ℝ → ℝ} | ||
| 1224 | 1224 | (47 / 50 : ℝ) * NaturalAxisData.L h p.2 * Λ * NaturalAxisData.chi h j σ p.2 + 12 / 5 < |
| 1225 | 1225 | sourceQ P h p := by |
| 1226 | 1226 | by_cases hnat : p.1 ≤ 4 / Λ |
| 1227 | - · have hY : Λ * p.1 ≤ 4 := by nlinarith [(le_div_iff₀ hΛ).mp hnat] | |
| 1227 | + · have hY : Λ * p.1 ≤ 4 := by linarith [(le_div_iff₀ hΛ).mp hnat] | |
| 1228 | 1228 | have hpoint : NaturalProfile.rescalePoint Λ p ∈ NaturalEntrance.entranceSet := |
| 1229 | 1229 | ⟨⟨mul_nonneg hΛ.le hp.1.1, by change Λ * p.1 ≤ 41 / 10; linarith⟩, hp.2⟩ |
| 1230 | 1230 | have he := reference_sourceQ_natural E.profile hΛ hδ hc.length_bound hP0 |
| @@ -1235,7 +1235,7 @@ theorem exists_reference_bounds {h j σ ν : ℝ} {P0 : ℝ → ℝ} | ||
| 1235 | 1235 | have hnonneg : 0 ≤ NaturalAxisData.L h p.2 * Λ * NaturalAxisData.chi h j σ p.2 := |
| 1236 | 1236 | mul_nonneg (mul_nonneg (NaturalAxisData.L_pos hsmall hp.2).le hΛ.le) |
| 1237 | 1237 | (NaturalAxisData.chi_bounds h j hσ p.2).1 |
| 1238 | - nlinarith | |
| 1238 | + linarith | |
| 1239 | 1239 | · obtain ⟨s⟩ := hsamples p hp (le_of_lt (lt_of_not_ge hnat)) |
| 1240 | 1240 | exact hqmodel Λ hscaleq P p s.Y s.theta s.phi s.error s.point_mem s.theta_mem |
| 1241 | 1241 | s.phi_lower s.phi_upper s.error_bound (hJ.axial_value p hp) |
+2 −2 NavierStokes/ReferenceJetBounds.lean View file
| @@ -218,13 +218,13 @@ theorem natural_amplitude_bounds (hσ : 0 < σ) (hΛ : 0 < Λ) (hC : 0 < C) | ||
| 218 | 218 | · apply hf0.trans |
| 219 | 219 | have hb := mul_le_mul_of_nonneg_left |
| 220 | 220 | (show (1 : ℝ) ≤ 1 + Λ * G + 8 * jetConstant d.coefficients 0 1 by |
| 221 | - nlinarith [mul_nonneg hΛ.le hG]) hbase | |
| 221 | + linarith [mul_nonneg hΛ.le hG]) hbase | |
| 222 | 222 | simpa only [mul_one, amplitudeConstant, mul_div_assoc, div_mul_eq_mul_div, mul_assoc] using hb |
| 223 | 223 | · apply hfη.trans |
| 224 | 224 | have hb := mul_le_mul_of_nonneg_left |
| 225 | 225 | (show Λ * G + 8 * jetConstant d.coefficients 0 1 ≤ |
| 226 | 226 | 1 + Λ * G + 8 * jetConstant d.coefficients 0 1 by linarith) hbase |
| 227 | - simpa only [amplitudeConstant, mul_div_assoc, div_mul_eq_mul_div, mul_assoc] using hb | |
| 227 | + simpa only [amplitudeConstant, div_mul_eq_mul_div, mul_assoc] using hb | |
| 228 | 228 | |
| 229 | 229 | end Natural |
| 230 | 230 | |
+3 −3 NavierStokes/ReferencePath.lean View file
| @@ -225,11 +225,11 @@ theorem continuation_eq_master_hold {T δ : ℝ} (hT : 0 < T) (hδ : 0 < δ) (h | ||
| 225 | 225 | {t η : ℝ} (hη : η ∈ J) (_ : 0 ≤ t) : |
| 226 | 226 | continuation δ G (t, η) = master G ((δ, holdTime δ t), η) := by |
| 227 | 227 | by_cases hsmall : t ≤ 2 * δ |
| 228 | - · have htdiv : t / δ ≤ 2 := (div_le_iff₀ hδ).2 (by nlinarith) | |
| 228 | + · have htdiv : t / δ ≤ 2 := (div_le_iff₀ hδ).2 (by linarith) | |
| 229 | 229 | rw [holdTime, min_eq_left htdiv, ← continuation_rescaled G hδ.ne'] |
| 230 | 230 | rw [mul_div_cancel₀ _ hδ.ne'] |
| 231 | 231 | · have hbig : 2 * δ ≤ t := (lt_of_not_ge hsmall).le |
| 232 | - have htdiv : 2 ≤ t / δ := (le_div_iff₀ hδ).2 (by nlinarith) | |
| 232 | + have htdiv : 2 ≤ t / δ := (le_div_iff₀ hδ).2 (by linarith) | |
| 233 | 233 | rw [continuation_frozen hT hδ hδT hJ hG hη hbig, |
| 234 | 234 | holdTime, min_eq_right htdiv, ← continuation_rescaled G hδ.ne'] |
| 235 | 235 | rw [mul_comm δ 2] |
| @@ -389,7 +389,7 @@ theorem fromLog_mem {p : Point} | ||
| 389 | 389 | rw [N.fromLog_scaled] |
| 390 | 390 | have hupper : Real.exp p.1 < 41 / 40 := by |
| 391 | 391 | simpa only [rampLimit, Real.exp_log (by norm_num : (0 : ℝ) < 41 / 40)] using Real.exp_lt_exp.mpr hp.1 |
| 392 | - refine ⟨⟨?_, ?_⟩, hp.2⟩ <;> nlinarith [Real.exp_pos p.1] | |
| 392 | + refine ⟨⟨?_, ?_⟩, hp.2⟩ <;> linarith [Real.exp_pos p.1] | |
| 393 | 393 | |
| 394 | 394 | theorem fromLog_f_pos {p : Point} |
| 395 | 395 | (hp : p ∈ (earlyStrip rampLimit rampLimit_pos parameterInterval parameterInterval_open).carrier) : |
+18 −0 routes/s2-ns-reference-1/README.md added View file
| @@ -0,0 +1,18 @@ | ||
| 1 | +--- | |
| 2 | +issue: 11 | |
| 3 | +status: working | |
| 4 | +--- | |
| 5 | +# s2-ns-reference-1 | |
| 6 | + | |
| 7 | +The family `NavierStokes/Reference*` — `ReferenceBounds.lean`, `ReferenceJetBounds.lean`, | |
| 8 | +`ReferencePath.lean`. I make these three files cheaper to elaborate with proof-only edits: | |
| 9 | +`nlinarith` becomes `linarith` where the goal is linear, a `simp only` list loses the entries | |
| 10 | +that do not change the goal (19 lines out, 19 in). No statement, import or docstring changes, | |
| 11 | +and no `maxHeartbeats`. The edits are Treant's `speedup_trials` stage carried onto main at | |
| 12 | +`d956c7c`, with the per-file counts in the pull request. | |
| 13 | + | |
| 14 | +## Next | |
| 15 | + | |
| 16 | +Open the pull request for the unit and let the `build` check say whether the three files | |
| 17 | +elaborate. After it lands, the next unit of S-2 would be another family from | |
| 18 | +`docs/build-profile.md`'s list of ten. | |