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

perf(NavierStokes/Activation): 4 files cheaper to elaborate (−47.5%, measured) #549
Merged
+4 −5 NavierStokes/ActivationBounds.lean View file
| @@ -29,7 +29,7 @@ noncomputable def parameterFactor (B : E × Point → ℝ) (q : E × Point) : | ||
| 29 | 29 | omit [NormedAddCommGroup E] [NormedSpace ℝ E] [FiniteDimensional ℝ E] in |
| 30 | 30 | theorem parameterFactor_eq (B : E × Point → ℝ) (q : E) (p : Point) : |
| 31 | 31 | parameterFactor B (q, p) = primitiveFactor 1 (fun z => B (q, z)) p := by |
| 32 | - simp only [parameterFactor, primitiveFactor, one_pow] | |
| 32 | + simp only [primitiveFactor, one_pow] | |
| 33 | 33 | rfl |
| 34 | 34 | |
| 35 | 35 | theorem parameterFactor_smooth {S : Set E} (hS : IsOpen S) {J : Set ℝ} (hJ : IsOpen J) |
| @@ -277,7 +277,7 @@ theorem width_uniform_jet_bound {J K : Set ℝ} (hJ : IsOpen J) (hK : IsCompact | ||
| 277 | 277 | have hm := mul_le_mul_of_nonneg_left |
| 278 | 278 | (hb (κ, T) ⟨hκ, hT.1.le, hT.2⟩ u hu η hη) |
| 279 | 279 | (mul_nonneg hy.1 (activation_nonneg T κ y hκ.2)) |
| 280 | - nlinarith | |
| 280 | + linarith | |
| 281 | 281 | |
| 282 | 282 | /-! ## Width-uniform factors for the actual five histories -/ |
| 283 | 283 | |
| @@ -419,7 +419,7 @@ theorem etaLinear_hasDerivAt {J : Set ℝ} (hJ : IsOpen J) {H : ScaledPoint → | ||
| 419 | 419 | have h := hd.hasFDerivAt.comp_hasDerivAt q.2.2 |
| 420 | 420 | ((hasDerivAt_const q.2.2 q.1).prodMk |
| 421 | 421 | ((hasDerivAt_const q.2.2 q.2.1).prodMk (hasDerivAt_id q.2.2))) |
| 422 | - simp only [Function.comp_def, id_eq] at h | |
| 422 | + simp only [Function.comp_def] at h | |
| 423 | 423 | exact h |
| 424 | 424 | |
| 425 | 425 | theorem etaD_eq_etaLinear {J : Set ℝ} (hJ : IsOpen J) {H : ScaledPoint → ℝ} |
| @@ -440,8 +440,7 @@ theorem etaD_hasDerivAt {J : Set ℝ} (hJ : IsOpen J) {H : ScaledPoint → ℝ} | ||
| 440 | 440 | exact etaLinear_hasDerivAt hJ hH hq |
| 441 | 441 | |
| 442 | 442 | theorem etaD_scaledDistance_mul (H : ScaledPoint → ℝ) (q : ScaledPoint) : |
| 443 | - etaD (fun z => scaledDistance z * H z) q = scaledDistance q * etaD H q := by | |
| 444 | - exact deriv_const_mul_field (scaledDistance q) | |
| 443 | + etaD (fun z => scaledDistance z * H z) q = scaledDistance q * etaD H q := deriv_const_mul_field (scaledDistance q) | |
| 445 | 444 | |
| 446 | 445 | theorem etaD_congr {J : Set ℝ} (hJ : IsOpen J) {H G : ScaledPoint → ℝ} |
| 447 | 446 | (h : ∀ q ∈ scaledDomain J, H q = G q) {q : ScaledPoint} (hq : q ∈ scaledDomain J) : |
+17 −17 NavierStokes/ActivationCone.lean View file
| @@ -83,26 +83,26 @@ theorem ramp_cone_of_errors {c B r e s P J v : ℝ} | ||
| 83 | 83 | have hrgap : 1 ≤ r - 2 * s := by linarith |
| 84 | 84 | have hgap : e ≤ P - v := by |
| 85 | 85 | have h := mul_le_mul_of_nonneg_left hrgap he.le |
| 86 | - nlinarith | |
| 86 | + linarith | |
| 87 | 87 | have hPgt : 2 + c / 4 < P := by linarith |
| 88 | 88 | have hvB : v - 2 ≤ B := by |
| 89 | 89 | have h := mul_nonneg he.le hrpos.le |
| 90 | - nlinarith | |
| 90 | + linarith | |
| 91 | 91 | have hJsq : J ^ 2 ≤ s ^ 2 * e ^ 2 := by |
| 92 | 92 | have h := mul_nonneg (show 0 ≤ s * e - J by linarith) |
| 93 | 93 | (show 0 ≤ s * e + J by linarith) |
| 94 | - nlinarith | |
| 95 | - have hBs : B * s ≤ 1 / 4 := by nlinarith | |
| 94 | + linarith | |
| 95 | + have hBs : B * s ≤ 1 / 4 := by linarith | |
| 96 | 96 | have hBss : B * s ^ 2 ≤ 1 / 16 := by |
| 97 | 97 | have h := mul_le_mul_of_nonneg_right hBs hs |
| 98 | - nlinarith | |
| 98 | + linarith | |
| 99 | 99 | have he2 : 0 < e ^ 2 := sq_pos_of_pos he |
| 100 | 100 | have hquad : (v - 2) * J ^ 2 < 2 * (P - v) ^ 2 := calc |
| 101 | 101 | (v - 2) * J ^ 2 ≤ B * J ^ 2 := mul_le_mul_of_nonneg_right hvB (sq_nonneg J) |
| 102 | 102 | _ ≤ B * (s ^ 2 * e ^ 2) := mul_le_mul_of_nonneg_left hJsq hBpos.le |
| 103 | 103 | _ = (B * s ^ 2) * e ^ 2 := by ring |
| 104 | 104 | _ ≤ (1 / 16 : ℝ) * e ^ 2 := mul_le_mul_of_nonneg_right hBss he2.le |
| 105 | - _ < 2 * e ^ 2 := by nlinarith | |
| 105 | + _ < 2 * e ^ 2 := by linarith | |
| 106 | 106 | _ ≤ 2 * (P - v) ^ 2 := by nlinarith |
| 107 | 107 | exact ⟨hgap, hPgt, hquad⟩ |
| 108 | 108 | |
| @@ -115,7 +115,7 @@ theorem collar_lower_of_errors {c B r e s v : ℝ} | ||
| 115 | 115 | 2 + c / 2 < v := by |
| 116 | 116 | have hl := (abs_le.mp hv).1 |
| 117 | 117 | have hm := mul_le_mul_of_nonneg_left (show r + s ≤ B + 1 by linarith) he |
| 118 | - nlinarith | |
| 118 | + linarith | |
| 119 | 119 | |
| 120 | 120 | /-- A single error tolerance is chosen from the fixed reference bounds. -/ |
| 121 | 121 | noncomputable def errorTolerance (c B : ℝ) : ℝ := |
| @@ -135,7 +135,7 @@ theorem errorTolerance_bounds {c B s : ℝ} (hB : 0 ≤ B) (hs : s ≤ errorTole | ||
| 135 | 135 | have hp : 0 < 4 * (B + 1) := by positivity |
| 136 | 136 | have hm := (le_div_iff₀ hp).mp h3 |
| 137 | 137 | refine ⟨h1, h2, ?_⟩ |
| 138 | - nlinarith | |
| 138 | + linarith | |
| 139 | 139 | |
| 140 | 140 | /-- Positivity of the actual flat activation on the nonzero ramp. -/ |
| 141 | 141 | theorem activation_pos {T κ y : ℝ} (hT : 0 < T) (hκ : κ < 1) (hy : 0 < y) : |
| @@ -224,7 +224,7 @@ theorem uniform_ramp_from_comparison {K : Set ℝ} {r : Field} | ||
| 224 | 224 | have hsmall := hsmallactivation T hT.1 κ ⟨hκ.1.le, hκ.2.le⟩ y ⟨hy.1.le, hycollar⟩ |
| 225 | 225 | have heB : activation T κ y * (B + 1) ≤ c / 4 := by |
| 226 | 226 | have h := (lt_div_iff₀ hBp).mp hsmall |
| 227 | - nlinarith | |
| 227 | + linarith | |
| 228 | 228 | exact collar_lower_of_errors hc hr.1 hr.2 he.le (by linarith) heB hve |
| 229 | 229 | |
| 230 | 230 | /-- Exact stress factorization when stock and shear-ratio errors carry the |
| @@ -327,7 +327,7 @@ theorem cone_error_bounds {κ A B z dA dB dR M : ℝ} | ||
| 327 | 327 | |sizeError κ A B z dR| = |κ| * |B ^ 2 / A| * |dR| * |2 + z * dR| := by |
| 328 | 328 | simp only [sizeError, abs_mul] |
| 329 | 329 | _ ≤ 1 * M * M * (2 + M) := by gcongr |
| 330 | - _ ≤ comparisonConstant M := by unfold comparisonConstant; nlinarith | |
| 330 | + _ ≤ comparisonConstant M := by unfold comparisonConstant; linarith | |
| 331 | 331 | |
| 332 | 332 | private theorem bounded_error_factor {M z x : ℝ} (hM : 0 ≤ M) (hz : 0 ≤ z) |
| 333 | 333 | (hx : |x| ≤ M * z) : ∃ d : ℝ, |d| ≤ M ∧ x = z * d := by |
| @@ -362,9 +362,9 @@ theorem cone_comparison_from_stock_bounds {κ A B z p q R M : ℝ} | ||
| 362 | 362 | (by simpa only [abs_of_nonneg hz] using hz1) hB hBA hB2A hdA hdB hdR |
| 363 | 363 | rw [hfP, hfJ, hfv] |
| 364 | 364 | simp only [abs_mul, abs_of_nonneg hz] |
| 365 | - exact ⟨by nlinarith [mul_le_mul_of_nonneg_left hbP hz], | |
| 366 | - by nlinarith [mul_le_mul_of_nonneg_left hbv hz], | |
| 367 | - by nlinarith [mul_le_mul_of_nonneg_left hbJ hz]⟩ | |
| 365 | + exact ⟨by linarith [mul_le_mul_of_nonneg_left hbP hz], | |
| 366 | + by linarith [mul_le_mul_of_nonneg_left hbv hz], | |
| 367 | + by linarith [mul_le_mul_of_nonneg_left hbJ hz]⟩ | |
| 368 | 368 | |
| 369 | 369 | /-- The genuine derivative-defined shear size has the cancellation form used |
| 370 | 370 | in the error transport. -/ |
| @@ -378,7 +378,7 @@ theorem shearSize_eq (T : ℝ) {κ X0 : ℝ} (hκ : κ ∈ Ioc (0 : ℝ) 1) (hX0 | ||
| 378 | 378 | (referenceAngular L (y, η) / activatedAngular T κ L (y, η)) ^ 2) := by |
| 379 | 379 | have h := shearSize_error T hκ hX0 hJ hL hU y hη hA |
| 380 | 380 | unfold referenceSize at h |
| 381 | - nlinarith | |
| 381 | + linarith | |
| 382 | 382 | |
| 383 | 383 | noncomputable def activatedStockOne (h X0 : ℝ) (initial : HistoryRow → ℝ → ℝ) |
| 384 | 384 | (L U : Field) (T κ : ℝ) : Field := |
| @@ -554,15 +554,15 @@ theorem actual_comparisons (h : ℝ) {X0 : ℝ} (hX0 : 0 < X0) | ||
| 554 | 554 | simp only [iteratedDeriv_zero, hm1, hm2] at hsval |
| 555 | 555 | have hpbound : |activatedStockOne h X0 initial L U T κ (y, η) - referenceP1 L (y, η)| ≤ |
| 556 | 556 | M * (y * activation T κ y) := by |
| 557 | - exact hsval.1.trans (by nlinarith [mul_le_mul_of_nonneg_right hsM hz]) | |
| 557 | + exact hsval.1.trans (by linarith [mul_le_mul_of_nonneg_right hsM hz]) | |
| 558 | 558 | have hqbound : |activatedStockTwo h X0 initial L U T κ (y, η) - referenceP2 X0 L U (y, η)| ≤ |
| 559 | 559 | M * (y * activation T κ y) := by |
| 560 | - exact hsval.2.trans (by nlinarith [mul_le_mul_of_nonneg_right hsM hz]) | |
| 560 | + exact hsval.2.trans (by linarith [mul_le_mul_of_nonneg_right hsM hz]) | |
| 561 | 561 | have hrval := hr T hT κ hκcc y hy η hη |
| 562 | 562 | simp only [iteratedDeriv_zero] at hrval |
| 563 | 563 | have hrbound : |referenceAngular L (y, η) / activatedAngular T κ L (y, η) - 1| ≤ |
| 564 | 564 | M * (y * activation T κ y) := |
| 565 | - hrval.trans (by nlinarith [mul_le_mul_of_nonneg_right hrM hz]) | |
| 565 | + hrval.trans (by linarith [mul_le_mul_of_nonneg_right hrM hz]) | |
| 566 | 566 | have hcomp := cone_comparison_from_stock_bounds hM ha hdamp hz hz1 |
| 567 | 567 | (hb.trans hrefM) (hba.trans hrefM) (hb2.trans hrefM) hpbound hqbound hrbound |
| 568 | 568 | unfold activatedProjection activatedCross |
+8 −8 NavierStokes/ActivationContinuation.lean View file
| @@ -319,10 +319,10 @@ theorem holdModel_uniform_lower {h j σ : ℝ} (hsmall : NaturalAxisData.SmallPa | ||
| 319 | 319 | have hnorm : ‖1 / Λ‖ < τ := by |
| 320 | 320 | rw [Real.norm_eq_abs, abs_of_pos (one_div_pos.mpr hΛ0), div_lt_iff₀ hΛ0] |
| 321 | 321 | have hm := (div_lt_iff₀ hτ).mp (show 1 / τ < Λ by linarith) |
| 322 | - nlinarith | |
| 322 | + linarith | |
| 323 | 323 | have hp := (abs_lt.mp (hpert p (1 / Λ) hnorm)).1 |
| 324 | 324 | have hm := habsorb Λ ((le_max_left _ _).trans hΛ) p |
| 325 | - nlinarith | |
| 325 | + linarith | |
| 326 | 326 | |
| 327 | 327 | theorem hold_source_identity {D : RadialDomain} (P : Profiles D) (h j σ : ℝ) |
| 328 | 328 | {Λ : ℝ} (hΛ : Λ ≠ 0) (p : Point) |
| @@ -702,7 +702,7 @@ theorem stockJet_uniform_bound {B B0 : ℝ} (hB : 0 ≤ B) (hB0 : 0 ≤ B0) : | ||
| 702 | 702 | obtain ⟨K0, hK0, hb⟩ := uniform_density_bound B |
| 703 | 703 | let K := 1 + B + B0 + 110 * K0 |
| 704 | 704 | have hK : 0 < K := by dsimp [K]; positivity |
| 705 | - have hBK : B ≤ K := by dsimp [K]; nlinarith | |
| 705 | + have hBK : B ≤ K := by dsimp [K]; linarith | |
| 706 | 706 | have hHK : B0 + 110 * K0 ≤ K := by dsimp [K]; linarith |
| 707 | 707 | refine ⟨K, hK, ?_⟩ |
| 708 | 708 | intro D P p hp hX hp0 hp0' hfield |
| @@ -712,7 +712,7 @@ theorem stockJet_uniform_bound {B B0 : ℝ} (hB : 0 ≤ B) (hB0 : 0 ≤ B0) : | ||
| 712 | 712 | have hini : |profileInitial P r p.2| ≤ B0 := by |
| 713 | 713 | cases r <;> simpa only [profileInitial, abs_zero] using (by assumption) |
| 714 | 714 | have hini' : |deriv (profileInitial P r) p.2| ≤ B0 := by |
| 715 | - cases r <;> simpa only [profileInitial, deriv_const, abs_zero] using (by assumption) | |
| 715 | + cases r <;> simpa only [profileInitial, deriv_const] using (by assumption) | |
| 716 | 716 | have hv : |primitive (profileDensity P r) p| ≤ 110 * K0 := by |
| 717 | 717 | apply integral_bounded_length hX hK0 |
| 718 | 718 | intro t ht |
| @@ -837,12 +837,12 @@ theorem comparison_tolerances {M : ℝ} (hM : 0 ≤ M) : | ||
| 837 | 837 | exact one_div_mul_cancel hkden.ne' |
| 838 | 838 | refine ⟨ε, κstar, lt_min zero_lt_one (one_div_pos.mpr (mul_pos (by norm_num) hp)), |
| 839 | 839 | min_le_left _ _, hk, ?_, ?_, ?_, ?_⟩ |
| 840 | - · nlinarith [mul_nonneg hk.le hv, mul_nonneg hk.le hM] | |
| 840 | + · linarith [mul_nonneg hk.le hv, mul_nonneg hk.le hM] | |
| 841 | 841 | · have hh := (le_div_iff₀ (mul_pos (by norm_num : (0 : ℝ) < 8) hp)).mp (min_le_right 1 (1 / (8 * projectionConstant M))) |
| 842 | 842 | dsimp [ε] |
| 843 | 843 | nlinarith |
| 844 | - · nlinarith [mul_nonneg hk.le hM] | |
| 845 | - · nlinarith [mul_nonneg hk.le hv] | |
| 844 | + · linarith [mul_nonneg hk.le hM] | |
| 845 | + · linarith [mul_nonneg hk.le hv] | |
| 846 | 846 | |
| 847 | 847 | theorem reference_fieldJet_bound {D : RadialDomain} (P : Profiles D) |
| 848 | 848 | {h j σ Λ C B K : ℝ} (hsmall : NaturalAxisData.SmallParameters h j) |
| @@ -1742,7 +1742,7 @@ theorem exists_comparable_ramp {h j σ Λ C B K r0 : ℝ} {P0 : ℝ → ℝ} | ||
| 1742 | 1742 | have hu : εU ≤ 1 / (4 * Λ) := min_le_right _ _ |
| 1743 | 1743 | have hid : 1 / (4 * Λ) = (1 / Λ) / 4 := by ring |
| 1744 | 1744 | rw [hid] at hu |
| 1745 | - nlinarith [one_div_pos.mpr hΛ] | |
| 1745 | + linarith [one_div_pos.mpr hΛ] | |
| 1746 | 1746 | have hUraw : εU + εU < c.fieldTolerance := by |
| 1747 | 1747 | have hu : εU ≤ εF := min_le_left _ _ |
| 1748 | 1748 | dsimp [εF] at hu |
+1 −1 NavierStokes/ActivationStocks.lean View file
| @@ -709,7 +709,7 @@ theorem log_stocks_uniform_jets {K : Set ℝ} (hK : IsCompact K) (hKJ : K ⊆ J) | ||
| 709 | 709 | have ha : 0 ≤ y * activation T κ y := mul_nonneg hy.1 (activation_nonneg T κ y hκ.2) |
| 710 | 710 | have hinc1 := mul_nonneg (sub_nonneg.mpr (le_max_left M₁ M₂)) ha |
| 711 | 711 | have hinc2 := mul_nonneg (sub_nonneg.mpr (le_max_right M₁ M₂)) ha |
| 712 | - constructor <;> nlinarith | |
| 712 | + constructor <;> linarith | |
| 713 | 713 | |
| 714 | 714 | end ConstructedFactors |
| 715 | 715 | |
+20 −0 routes/s2-ns-activation-1/README.md added View file
| @@ -0,0 +1,20 @@ | ||
| 1 | +--- | |
| 2 | +issue: 11 | |
| 3 | +status: working | |
| 4 | +--- | |
| 5 | +# s2-ns-activation-1 | |
| 6 | + | |
| 7 | +One unit of S-2: the family `NavierStokes/Activation*` — `ActivationBounds.lean`, | |
| 8 | +`ActivationCone.lean`, `ActivationContinuation.lean` and `ActivationStocks.lean`. The four | |
| 9 | +files are made cheaper to elaborate by edits inside proofs only: `nlinarith` becomes | |
| 10 | +`linarith` where linear reasoning suffices, `simp only` lists lose entries that do not | |
| 11 | +change the goal, and one `by exact` becomes the term directly. No statement, import line | |
| 12 | +or docstring changes, and no `maxHeartbeats`. The edits are Treant's `speedup_trials` | |
| 13 | +stage (TitiSkywalker/NavierStokesAndEuler, the run of 2026-12-03 at upstream `f9e8bc5`), | |
| 14 | +carried onto main at `d956c7c` and counted there; the before/after counts and how they | |
| 15 | +were taken are in the pull request. | |
| 16 | + | |
| 17 | +## Next | |
| 18 | + | |
| 19 | +Push, open the pull request into `main`, let `challenge` and `build` report, and reply to | |
| 20 | +the maintainer's review. | |