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/Outgoing): 5 files cheaper to elaborate (−28.6%, measured) #596
Open
+9 −9 NavierStokes/OutgoingCone.lean View file
| @@ -48,7 +48,7 @@ theorem hold_Qs_pos {d : TailData} {K : ℝ} (w : ResetWitness d K) | ||
| 48 | 48 | have hl := ShapedWaitBounds.canonical_Qs_hold_lower w ha hh1 hhlam hhT heta ht htw |
| 49 | 49 | have hp : 0 < ShapedWaitBounds.holdFloor d.core.m * |
| 50 | 50 | (eta ^ 2 + d.core.lam + Real.exp (-(1 - d.core.lam) * t)) := by |
| 51 | - exact mul_pos hf (by nlinarith [sq_nonneg eta, d.core.lam_pos, Real.exp_pos (-(1 - d.core.lam) * t)]) | |
| 51 | + exact mul_pos hf (by linarith [sq_nonneg eta, d.core.lam_pos, Real.exp_pos (-(1 - d.core.lam) * t)]) | |
| 52 | 52 | exact hp.trans_le hl |
| 53 | 53 | |
| 54 | 54 | noncomputable def holdRatioConstant (P m : ℝ) : ℝ := |
| @@ -80,11 +80,11 @@ theorem hold_ratio_bound {d : TailData} {K : ℝ} (w : ResetWitness d K) | ||
| 80 | 80 | ring |
| 81 | 81 | have hsq : 2 * |eta| * s ≤ eta ^ 2 + Real.exp (-(1 - d.core.lam) * t) := by |
| 82 | 82 | have hb := sq_nonneg (|eta| - s) |
| 83 | - nlinarith [hs, sq_abs eta] | |
| 83 | + linarith [hs, sq_abs eta] | |
| 84 | 84 | have hmul := mul_le_mul_of_nonneg_left hsq hc.le |
| 85 | 85 | have hqeta : 2 * ShapedWaitBounds.holdFloor d.core.m * |eta| * s ≤ |
| 86 | 86 | OutgoingHistories.Qs w Amp (d.core.holdStart + t, eta) := by |
| 87 | - nlinarith [mul_pos hc d.core.lam_pos] | |
| 87 | + linarith [mul_pos hc d.core.lam_pos] | |
| 88 | 88 | have hfac : 0 ≤ holdRatioConstant d.core.P d.core.m * (1 + t) * Real.exp (d.core.lam * t / 2) := |
| 89 | 89 | mul_nonneg (mul_nonneg (holdRatioConstant_pos d.core.P_pos d.core.m).le (by linarith)) (Real.exp_pos _).le |
| 90 | 90 | have hb := mul_le_mul_of_nonneg_left hqeta hfac |
| @@ -124,7 +124,7 @@ theorem hold_sqrt_ratio_bound {d : TailData} {K : ℝ} (w : ResetWitness d K) | ||
| 124 | 124 | have htlog : t ≤ 60 * Real.log (1 / d.core.lam) := by rwa [hwait] at htw |
| 125 | 125 | have hlin : 1 + t ≤ 60 * (1 + Real.log (1 / d.core.lam)) := by linarith |
| 126 | 126 | have hlambda := mul_le_mul_of_nonneg_left htlog d.core.lam_pos.le |
| 127 | - have harg : d.core.lam * t / 2 ≤ 30 := by nlinarith [TailCone.lambda_log_bound d] | |
| 127 | + have harg : d.core.lam * t / 2 ≤ 30 := by linarith [TailCone.lambda_log_bound d] | |
| 128 | 128 | have hex := Real.exp_le_exp.mpr harg |
| 129 | 129 | have hb := hold_ratio_bound w ha hh1 hhlam hhT heta ht htw |
| 130 | 130 | have hC := (holdRatioConstant_pos d.core.P_pos d.core.m).le |
| @@ -133,11 +133,11 @@ theorem hold_sqrt_ratio_bound {d : TailData} {K : ℝ} (w : ResetWitness d K) | ||
| 133 | 133 | have hraw : |coneRatio w Amp (d.core.holdStart + t, eta)| ≤ |
| 134 | 134 | holdSmallConstant d.core.P d.core.m * (1 + Real.log (1 / d.core.lam)) := by |
| 135 | 135 | dsimp [holdSmallConstant] |
| 136 | - nlinarith | |
| 136 | + linarith | |
| 137 | 137 | have hs := mul_le_mul_of_nonneg_left hraw (Real.sqrt_nonneg d.core.lam) |
| 138 | 138 | have hr := (PulseCone.coneRate_parts d.core.lam_pos (by linarith [d.core.lam_lt])).2.2 |
| 139 | 139 | have hr' := mul_le_mul_of_nonneg_left hr (holdSmallConstant_pos d.core.P_pos d.core.m).le |
| 140 | - nlinarith | |
| 140 | + linarith | |
| 141 | 141 | |
| 142 | 142 | theorem exists_hold_threshold (P m : ℝ) : |
| 143 | 143 | ∃ lam0 : ℝ, 0 < lam0 ∧ ∀ lam : ℝ, 0 < lam → lam < lam0 → |
| @@ -207,7 +207,7 @@ theorem hold_source_criterion {d : TailData} {K : ℝ} (w : ResetWitness d K) | ||
| 207 | 207 | · simp only [zero_mul, sub_zero] |
| 208 | 208 | linarith [d.core.lam_pos] |
| 209 | 209 | · norm_num only [zero_mul, mul_zero, zero_pow, zero_div, zero_add, add_zero] |
| 210 | - nlinarith | |
| 210 | + linarith | |
| 211 | 211 | · linarith [d.core.lam_pos] |
| 212 | 212 | |
| 213 | 213 | /-! ## Common actual cone coordinates and source tests -/ |
| @@ -247,7 +247,7 @@ theorem normalV_gt_two_of_radial {d : TailData} {K : ℝ} (w : ResetWitness d K) | ||
| 247 | 247 | (Amp : ℝ → ℝ) (p : ℝ × ℝ) (ha : 2 < coneA w p) : 2 < normalV w Amp p := by |
| 248 | 248 | have hm := mul_nonneg (show 0 ≤ coneA w p by linarith) (sq_nonneg (coneB w Amp p / coneA w p)) |
| 249 | 249 | unfold normalV |
| 250 | - nlinarith | |
| 250 | + linarith | |
| 251 | 251 | |
| 252 | 252 | theorem sourceCriterion_before_endpoint {d : TailData} {K : ℝ} (w : ResetWitness d K) |
| 253 | 253 | {Amp : ℝ → ℝ} (ha : ContDiff ℝ ∞ Amp) |
| @@ -544,7 +544,7 @@ theorem leading_gap_of_finite {s c j v : ℝ} (hs : 0 < s) (hv : 2 < v) | ||
| 544 | 544 | apply (sq_lt_sq₀ (by linarith : 0 ≤ s * c - v) (mul_pos hs hc).le).mpr |
| 545 | 545 | linarith |
| 546 | 546 | have hgap : s ^ 2 * ((v - 2) * j ^ 2) < s ^ 2 * (2 * c ^ 2) := by |
| 547 | - nlinarith only [hquad, hd] | |
| 547 | + linarith only [hquad, hd] | |
| 548 | 548 | exact ⟨hc, sub_pos.mpr ((mul_lt_mul_iff_right₀ (sq_pos_of_pos hs)).mp hgap)⟩ |
| 549 | 549 | |
| 550 | 550 | theorem clean_true_source_positive {d : TailData} {K : ℝ} (w : ResetWitness d K) |
+41 −42 NavierStokes/OutgoingEntranceCone.lean View file
| @@ -173,14 +173,14 @@ theorem eta_shapeGradient_bounds {η : ℝ} (hη : |η| ≤ 1) : | ||
| 173 | 173 | rw [← mul_div_assoc] |
| 174 | 174 | constructor |
| 175 | 175 | · apply (le_div_iff₀ hp).mpr |
| 176 | - nlinarith [sq_nonneg η, mul_nonneg (sq_nonneg η) (sub_nonneg.mpr hsq)] | |
| 176 | + linarith [sq_nonneg η, mul_nonneg (sq_nonneg η) (sub_nonneg.mpr hsq)] | |
| 177 | 177 | · apply (div_le_one hp).mpr |
| 178 | - nlinarith | |
| 178 | + linarith | |
| 179 | 179 | |
| 180 | 180 | theorem abs_shapeGradient_le (η : ℝ) : |shapeGradient η| ≤ 2 * |η| := by |
| 181 | 181 | rw [shapeGradient, abs_div, abs_mul, abs_of_nonneg (by norm_num : (0 : ℝ) ≤ 2), |
| 182 | 182 | abs_of_pos (by positivity : 0 < 1 + η ^ 2)] |
| 183 | - exact div_le_self (by positivity) (by nlinarith [sq_nonneg η]) | |
| 183 | + exact div_le_self (by positivity) (by linarith [sq_nonneg η]) | |
| 184 | 184 | |
| 185 | 185 | theorem dropCoefficient_hasDerivAt {m y : ℝ} (hm : 0 < m) (hy : 0 < y) : |
| 186 | 186 | HasDerivAt (dropCoefficient m) |
| @@ -287,7 +287,7 @@ theorem idealAngularLag_lower {h η : ℝ} (hh : 0 ≤ h) (hh1 : h ≤ 1 / 100) | ||
| 287 | 287 | exact mul_nonneg (by positivity) (le_trans (sq_nonneg η) hJ) |
| 288 | 288 | unfold idealAngularLag idealAngularSource |
| 289 | 289 | apply (le_div_iff₀ (by norm_num : (0 : ℝ) < 8 / 5)).mpr |
| 290 | - nlinarith [mul_nonneg hh (sq_nonneg η)] | |
| 290 | + linarith [mul_nonneg hh (sq_nonneg η)] | |
| 291 | 291 | |
| 292 | 292 | theorem angularRate_bounds (c : Parameters) (y : ℝ) : |
| 293 | 293 | 9 / 10 ≤ angularRate c y ∧ angularRate c y ≤ 8 / 5 := by |
| @@ -321,7 +321,7 @@ theorem transportW_second_ramp (c : Parameters) {h y η : ℝ} (hh : 0 ≤ h) | ||
| 321 | 321 | have hk0 := (averagedDrop_bounds c (y := y) (by linarith [c.dropLength_pos])).1 |
| 322 | 322 | have hk := averagedDrop_small_on_second_ramp c hy |
| 323 | 323 | unfold transportW |
| 324 | - nlinarith [mul_le_mul_of_nonneg_right hL hk0] | |
| 324 | + linarith [mul_le_mul_of_nonneg_right hL hk0] | |
| 325 | 325 | |
| 326 | 326 | theorem angularSource_lower (c : Parameters) {h η y : ℝ} (hh : 0 ≤ h) |
| 327 | 327 | (hh1 : h ≤ 1 / 100) (_hy : 0 ≤ y) (hη : |η| ≤ 1) : |
| @@ -342,10 +342,10 @@ theorem angularSource_lower (c : Parameters) {h η y : ℝ} (hh : 0 ≤ h) | ||
| 342 | 342 | have hJ := (eta_shapeGradient_bounds hη).1 |
| 343 | 343 | have hD : 49 / 100 ≤ D h := by unfold D; linarith |
| 344 | 344 | have hDJ : (49 / 100) * η ^ 2 ≤ (D h + d η * dropCoefficient c.m y) * (η * shapeGradient η) := |
| 345 | - mul_le_mul (by nlinarith [mul_nonneg hd hk.1]) hJ (sq_nonneg η) | |
| 346 | - (by nlinarith [mul_nonneg hd hk.1]) | |
| 345 | + mul_le_mul (by linarith [mul_nonneg hd hk.1]) hJ (sq_nonneg η) | |
| 346 | + (by linarith [mul_nonneg hd hk.1]) | |
| 347 | 347 | unfold angularSource |
| 348 | - nlinarith [mul_nonneg hh (mul_nonneg hk.1 (sq_nonneg η))] | |
| 348 | + linarith [mul_nonneg hh (mul_nonneg hk.1 (sq_nonneg η))] | |
| 349 | 349 | |
| 350 | 350 | theorem primitive_continuous_of_continuous {r : ℝ → ℝ} (hr : Continuous r) : |
| 351 | 351 | Continuous (OutgoingSchedule.primitive r) := |
| @@ -415,7 +415,7 @@ theorem linearLag_lower_barrier {r b : ℝ → ℝ} (hr : Continuous r) (hb : Co | ||
| 415 | 415 | calc |
| 416 | 416 | _ = Real.exp (-OutgoingSchedule.primitive r y) * |
| 417 | 417 | (β + κ + (Real.exp (OutgoingSchedule.primitive r y) - 1) * β) := by |
| 418 | - nlinarith [congrArg (fun t : ℝ => t * β) hc] | |
| 418 | + linarith [congrArg (fun t : ℝ => t * β) hc] | |
| 419 | 419 | _ ≤ _ := mul_le_mul_of_nonneg_left (add_le_add hq hi) (Real.exp_pos _).le |
| 420 | 420 | |
| 421 | 421 | theorem slope_integral_upper (c : Parameters) {y : ℝ} (hy : 0 ≤ y) : |
| @@ -462,7 +462,7 @@ theorem angularSource_barrier (c : Parameters) {h η y : ℝ} (hh : 0 ≤ h) | ||
| 462 | 462 | have hs := angularSource_lower c hh hh1 hy hη |
| 463 | 463 | have h₁ := mul_le_mul_of_nonneg_right hr.2 (sq_nonneg η) |
| 464 | 464 | have h₂ := mul_le_mul_of_nonneg_right hr.1 hh |
| 465 | - nlinarith [sq_nonneg η] | |
| 465 | + linarith [sq_nonneg η] | |
| 466 | 466 | |
| 467 | 467 | theorem angularLag_barrier (c : Parameters) {h η y : ℝ} (hh : 0 ≤ h) |
| 468 | 468 | (hh1 : h ≤ 1 / 100) (hy : 0 ≤ y) (hη : |η| ≤ 1) : |
| @@ -503,7 +503,7 @@ theorem angularLag_lower (c : Parameters) {h η y T : ℝ} (hh : 0 ≤ h) | ||
| 503 | 503 | have hηc := mul_le_mul_of_nonneg_right coneFloor_le_quarter (sq_nonneg η) |
| 504 | 504 | rw [he] at hq hT |
| 505 | 505 | unfold coneFloor at hηc ⊢ |
| 506 | - nlinarith | |
| 506 | + linarith | |
| 507 | 507 | |
| 508 | 508 | theorem angularLag_pos (c : Parameters) {h η y T : ℝ} (hh : 0 ≤ h) |
| 509 | 509 | (hh1 : h ≤ 1 / 100) (hy : 0 ≤ y) (hyT : y ≤ T) (hη : |η| ≤ 1) |
| @@ -566,7 +566,7 @@ theorem clockEnergy_lower (c : Parameters) {y : ℝ} (hy : 0 ≤ y) | ||
| 566 | 566 | simp only [weightedClockEnergy, Real.exp_zero, one_mul, clockEnergy_initial] at hm |
| 567 | 567 | have he : Real.exp (-y) * Real.exp y = 1 := by rw [← Real.exp_add]; simp |
| 568 | 568 | have hh := mul_le_mul_of_nonneg_left hm (Real.exp_pos (-y)).le |
| 569 | - nlinarith [congrArg (fun t : ℝ => t * clockEnergy c y) he] | |
| 569 | + linarith [congrArg (fun t : ℝ => t * clockEnergy c y) he] | |
| 570 | 570 | |
| 571 | 571 | theorem averagedClockEnergy_nonneg (c : Parameters) {y : ℝ} (hy : 0 ≤ y) : |
| 572 | 572 | 0 ≤ averagedClockEnergy c y := |
| @@ -807,15 +807,15 @@ theorem geometricAxialLag_bound (c : Parameters) {h y η : ℝ} (hh : 0 ≤ h) | ||
| 807 | 807 | have hW : |transportW c h y η| ≤ 3 := by |
| 808 | 808 | exact abs_le.mpr (transportW_bounds c hh hh1 hy hη |>.imp_right (fun h => h.trans (by norm_num))) |
| 809 | 809 | have hsq := parameter_square_le_one hη |
| 810 | - have hd : 0 ≤ d η ∧ d η ≤ 1 := by unfold d; constructor <;> nlinarith [sq_nonneg η] | |
| 810 | + have hd : 0 ≤ d η ∧ d η ≤ 1 := by unfold d; constructor <;> linarith [sq_nonneg η] | |
| 811 | 811 | have hc : |4 * h * η ^ 2 - 2 * d η| ≤ 3 := by |
| 812 | 812 | apply abs_le.mpr |
| 813 | 813 | have hm := mul_le_mul_of_nonneg_left hsq hh |
| 814 | - constructor <;> nlinarith [mul_nonneg hh (sq_nonneg η)] | |
| 814 | + constructor <;> linarith [mul_nonneg hh (sq_nonneg η)] | |
| 815 | 815 | have hfirst : |-(transportW c h y η) * dropCoefficient c.m y * η| ≤ 12 * |η| := by |
| 816 | 816 | rw [abs_mul, abs_mul, abs_neg, abs_of_nonneg hk.1] |
| 817 | 817 | have hm := mul_le_mul hW hk.2 hk.1 (by norm_num : (0 : ℝ) ≤ 3) |
| 818 | - nlinarith [mul_le_mul_of_nonneg_right hm (abs_nonneg η)] | |
| 818 | + linarith [mul_le_mul_of_nonneg_right hm (abs_nonneg η)] | |
| 819 | 819 | have hsecond : |(4 * h * η ^ 3 - 2 * d η * η) * averagedDropSquare c y| ≤ 48 * |η| := by |
| 820 | 820 | have he : 4 * h * η ^ 3 - 2 * d η * η = (4 * h * η ^ 2 - 2 * d η) * η := by ring |
| 821 | 821 | rw [he, abs_mul, abs_mul, abs_of_nonneg hK.1] |
| @@ -825,13 +825,13 @@ theorem geometricAxialLag_bound (c : Parameters) {h y η : ℝ} (hh : 0 ≤ h) | ||
| 825 | 825 | _ = _ := by ring |
| 826 | 826 | exact (abs_add_le _ _).trans (by |
| 827 | 827 | change _ ≤ 64 * |η| |
| 828 | - nlinarith [abs_nonneg η]) | |
| 828 | + linarith [abs_nonneg η]) | |
| 829 | 829 | |
| 830 | 830 | theorem pressure_coefficient_bound {h η : ℝ} (hh : 0 ≤ h) (hh1 : h ≤ 1 / 100) |
| 831 | 831 | (hη : |η| ≤ 1) : |2 * h * η + d η * shapeGradient η| ≤ 3 * |η| := by |
| 832 | 832 | have hd : 0 ≤ d η ∧ d η ≤ 1 := by |
| 833 | 833 | unfold d |
| 834 | - constructor <;> nlinarith [parameter_square_le_one hη, sq_nonneg η] | |
| 834 | + constructor <;> linarith [parameter_square_le_one hη, sq_nonneg η] | |
| 835 | 835 | calc |
| 836 | 836 | _ ≤ |2 * h * η| + |d η * shapeGradient η| := abs_add_le _ _ |
| 837 | 837 | _ = 2 * h * |η| + d η * |shapeGradient η| := by |
| @@ -841,7 +841,7 @@ theorem pressure_coefficient_bound {h η : ℝ} (hh : 0 ≤ h) (hh1 : h ≤ 1 / | ||
| 841 | 841 | apply add_le_add_right |
| 842 | 842 | simpa only [one_mul] using |
| 843 | 843 | mul_le_mul hd.2 (abs_shapeGradient_le η) (abs_nonneg _) (by norm_num : (0 : ℝ) ≤ 1) |
| 844 | - _ ≤ _ := by nlinarith [abs_nonneg η, mul_le_mul_of_nonneg_right hh1 (abs_nonneg η)] | |
| 844 | + _ ≤ _ := by linarith [abs_nonneg η, mul_le_mul_of_nonneg_right hh1 (abs_nonneg η)] | |
| 845 | 845 | |
| 846 | 846 | theorem pressureAxialLag_bound (v : TailData) {y η : ℝ} (hh1 : v.h ≤ 1 / 100) |
| 847 | 847 | (hy : 0 ≤ y) (hy' : y ≤ v.core.dropLength + 1) (hη : |η| ≤ 1) : |
| @@ -855,7 +855,7 @@ theorem pressureAxialLag_bound (v : TailData) {y η : ℝ} (hh1 : v.h ≤ 1 / 10 | ||
| 855 | 855 | have hp := actual_pressure_bounds v hy hend hη |
| 856 | 856 | have hd : 0 ≤ d η ∧ d η ≤ 1 := by |
| 857 | 857 | unfold d |
| 858 | - constructor <;> nlinarith [parameter_square_le_one hη, sq_nonneg η] | |
| 858 | + constructor <;> linarith [parameter_square_le_one hη, sq_nonneg η] | |
| 859 | 859 | have hA : 0 ≤ 4 * A v.h ∧ 4 * A v.h ≤ 3 := by |
| 860 | 860 | unfold A |
| 861 | 861 | constructor <;> linarith [v.h_pos] |
| @@ -902,13 +902,13 @@ theorem axialLag_drop_bound (v : TailData) {y η : ℝ} (hh1 : v.h ≤ 1 / 100) | ||
| 902 | 902 | have hmul := mul_le_mul_of_nonneg_right hP' (Real.exp_pos (-y)).le |
| 903 | 903 | rw [he] at hmul |
| 904 | 904 | have hlow := angular_square_lower v.core hy hy' hη |
| 905 | - nlinarith | |
| 905 | + linarith | |
| 906 | 906 | have hg := geometricAxialLag_bound v.core v.h_pos.le hh1 hy hη |
| 907 | 907 | have hp := pressureAxialLag_bound v hh1 hy hy' hη |
| 908 | 908 | have hg' : |geometricAxialLag v.core v.h y η| ≤ |
| 909 | 909 | 256 * |η| * angular v.core.P v.core.dropLength v.core.lam (y, η) ^ 2 := by |
| 910 | 910 | apply hg.trans |
| 911 | - nlinarith [mul_le_mul_of_nonneg_left hEp (show 0 ≤ 256 * |η| by positivity)] | |
| 911 | + linarith [mul_le_mul_of_nonneg_left hEp (show 0 ≤ 256 * |η| by positivity)] | |
| 912 | 912 | unfold axialLag |
| 913 | 913 | apply (abs_add_le _ _).trans |
| 914 | 914 | apply (add_le_add hg' hp).trans |
| @@ -917,7 +917,7 @@ theorem axialLag_drop_bound (v : TailData) {y η : ℝ} (hh1 : v.h ≤ 1 / 100) | ||
| 917 | 917 | angular v.core.P v.core.dropLength v.core.lam (y, η) ^ 2 := by |
| 918 | 918 | have := pressureBound_pos |
| 919 | 919 | positivity |
| 920 | - nlinarith | |
| 920 | + linarith | |
| 921 | 921 | |
| 922 | 922 | /-! ## The two small shear quantities in the cone test -/ |
| 923 | 923 | |
| @@ -952,7 +952,7 @@ theorem angular_square_ge_quarter (c : Parameters) {y η : ℝ} (hy : 0 ≤ y) | ||
| 952 | 952 | have hm := mul_le_mul_of_nonneg_right hP' (Real.exp_pos (-y)).le |
| 953 | 953 | rw [he] at hm |
| 954 | 954 | have hlow := angular_square_lower c hy hy' hη |
| 955 | - nlinarith | |
| 955 | + linarith | |
| 956 | 956 | |
| 957 | 957 | theorem shear_drop_abs (c : Parameters) {y η : ℝ} (hy : 1 ≤ y) |
| 958 | 958 | (hy' : y ≤ c.dropLength + 1) (hη : |η| ≤ 1) |
| @@ -972,7 +972,7 @@ theorem shear_drop_abs (c : Parameters) {y η : ℝ} (hy : 1 ≤ y) | ||
| 972 | 972 | have hprod := mul_le_mul hd' hη (abs_nonneg η) (dropSpeed_pos c.m_pos).le |
| 973 | 973 | have hden := mul_le_mul_of_nonneg_left hhalf |
| 974 | 974 | (mul_nonneg (by norm_num : (0 : ℝ) ≤ 4) (dropSpeed_pos c.m_pos).le) |
| 975 | - nlinarith | |
| 975 | + linarith | |
| 976 | 976 | |
| 977 | 977 | theorem shear_drop_square (c : Parameters) {y η : ℝ} (hy : 1 ≤ y) |
| 978 | 978 | (hy' : y ≤ c.dropLength + 1) (hη : |η| ≤ 1) |
| @@ -990,7 +990,7 @@ theorem shear_direction_identity (v : TailData) (y η : ℝ) | ||
| 990 | 990 | have hE := angular_pos v.core.P_pos v.core.dropLength v.core.lam (y, η) |
| 991 | 991 | simp only [shear, directionRatio, abs_mul, abs_div, abs_of_pos hE, abs_of_pos hQ] |
| 992 | 992 | norm_num |
| 993 | - simp only [div_eq_mul_inv, mul_inv_rev, pow_two] | |
| 993 | + simp only [div_eq_mul_inv, pow_two] | |
| 994 | 994 | ring |
| 995 | 995 | |
| 996 | 996 | theorem shear_direction_drop_bound (v : TailData) {y η : ℝ} |
| @@ -1005,7 +1005,7 @@ theorem shear_direction_drop_bound (v : TailData) {y η : ℝ} | ||
| 1005 | 1005 | have hQ := angularLag_pos v.core v.h_pos.le hh1 hy0.le hyT hη hhT |
| 1006 | 1006 | have hQb := angularLag_lower v.core v.h_pos.le hh1 hy0.le hyT hη hhT |
| 1007 | 1007 | have hQη : coneFloor * η ^ 2 ≤ angularLag v.core v.h η y := by |
| 1008 | - nlinarith [mul_pos coneFloor_pos (Real.exp_pos (-y))] | |
| 1008 | + linarith [mul_pos coneFloor_pos (Real.exp_pos (-y))] | |
| 1009 | 1009 | have hd := dropCoefficient_deriv_bound v.core.m_pos hy0 |
| 1010 | 1010 | have hdy : |deriv (dropCoefficient v.core.m) y| * (1 + y) ≤ 2 * dropSpeed v.core.m := by |
| 1011 | 1011 | have hmul := (le_div_iff₀ hy0).mp hd |
| @@ -1064,13 +1064,13 @@ theorem drop_cone_margins (v : TailData) {y η : ℝ} | ||
| 1064 | 1064 | have hmul := (le_div_iff₀ (mul_pos (by norm_num) axialBound_pos)).mp he2 |
| 1065 | 1065 | calc |
| 1066 | 1066 | _ = 4 * axialBound * dropSpeed v.core.m / coneFloor := by ring |
| 1067 | - _ ≤ 1 / 4 := (div_le_iff₀ coneFloor_pos).mpr (by nlinarith) | |
| 1067 | + _ ≤ 1 / 4 := (div_le_iff₀ coneFloor_pos).mpr (by linarith) | |
| 1068 | 1068 | exact (le_abs_self _).trans (hsw.trans hc) |
| 1069 | 1069 | have hsq' : shear v.core y η ^ 2 ≤ 1 / 4 := by |
| 1070 | 1070 | have he0 := (dropSpeed_pos v.core.m_pos).le |
| 1071 | 1071 | nlinarith |
| 1072 | 1072 | rw [radialA_drop v.core hy hy'] |
| 1073 | - constructor <;> nlinarith | |
| 1073 | + constructor <;> linarith | |
| 1074 | 1074 | |
| 1075 | 1075 | theorem linearLag_pos_after {r b : ℝ → ℝ} (hr : Continuous r) (hb : Continuous b) |
| 1076 | 1076 | {q₀ a y : ℝ} (hay : a ≤ y) (ha : 0 < linearLag r b q₀ a) |
| @@ -1102,7 +1102,7 @@ theorem angularSource_hold_lower (v : TailData) {y η : ℝ} | ||
| 1102 | 1102 | have hJ : 0 ≤ η * shapeGradient η := (sq_nonneg η).trans (eta_shapeGradient_bounds hη).1 |
| 1103 | 1103 | rw [angularSource, hl, hk] |
| 1104 | 1104 | simp only [mul_zero, add_zero, neg_neg] |
| 1105 | - nlinarith [mul_le_mul_of_nonneg_left hW v.core.lam_pos.le, mul_nonneg hD hJ] | |
| 1105 | + linarith [mul_le_mul_of_nonneg_left hW v.core.lam_pos.le, mul_nonneg hD hJ] | |
| 1106 | 1106 | |
| 1107 | 1107 | /-- Positive incoming angular lag at every point of the unedited shaped hold. -/ |
| 1108 | 1108 | theorem angularLag_pos_on_hold (v : TailData) {y η : ℝ} |
| @@ -1130,7 +1130,7 @@ theorem shape_interval {η : ℝ} (hη : |η| ≤ 1) : (1 / 2 : ℝ) ≤ shape | ||
| 1130 | 1130 | constructor |
| 1131 | 1131 | · apply (le_div_iff₀ (by positivity : 0 < 1 + η ^ 2)).mpr |
| 1132 | 1132 | linarith |
| 1133 | - · exact div_le_self (by norm_num) (by nlinarith [sq_nonneg η]) | |
| 1133 | + · exact div_le_self (by norm_num) (by linarith [sq_nonneg η]) | |
| 1134 | 1134 | |
| 1135 | 1135 | noncomputable def entranceTime (m : ℝ) : ℝ := Real.exp m + 12 |
| 1136 | 1136 | |
| @@ -1165,7 +1165,7 @@ theorem averagedEnergy_le_envelope (c : Parameters) {y T η : ℝ} (hy : 0 ≤ y | ||
| 1165 | 1165 | have he : 1 ≤ Real.exp (2 * T) := Real.one_le_exp_iff.mpr (by linarith) |
| 1166 | 1166 | have hinit : (5 / 6 : ℝ) * c.P ^ 2 ≤ energyEnvelope c.P T := by |
| 1167 | 1167 | unfold energyEnvelope |
| 1168 | - nlinarith [sq_nonneg c.P, mul_le_mul_of_nonneg_left he (sq_nonneg c.P)] | |
| 1168 | + linarith [sq_nonneg c.P, mul_le_mul_of_nonneg_left he (sq_nonneg c.P)] | |
| 1169 | 1169 | have hb := historyAverage_le (clockEnergy_contDiff c).continuous hinit hy |
| 1170 | 1170 | (fun t ht => clockEnergy_le_envelope c ht.1 (ht.2.trans hyT)) |
| 1171 | 1171 | have hs := shape_interval hη |
| @@ -1196,7 +1196,7 @@ theorem pressureAxialLag_le_envelope (v : TailData) {y T η : ℝ} (hh1 : v.h | ||
| 1196 | 1196 | have hC := pressureBound_pos.le |
| 1197 | 1197 | have hd : 0 ≤ d η ∧ d η ≤ 1 := by |
| 1198 | 1198 | unfold d |
| 1199 | - constructor <;> nlinarith [parameter_square_le_one hη, sq_nonneg η] | |
| 1199 | + constructor <;> linarith [parameter_square_le_one hη, sq_nonneg η] | |
| 1200 | 1200 | have hA : 0 ≤ 4 * A v.h ∧ 4 * A v.h ≤ 3 := by |
| 1201 | 1201 | unfold A |
| 1202 | 1202 | constructor <;> linarith [v.h_pos] |
| @@ -1236,7 +1236,7 @@ theorem axialLag_le_envelope (v : TailData) {y T η : ℝ} (hh1 : v.h ≤ 1 / 10 | ||
| 1236 | 1236 | have hsum := add_le_add hg hp |
| 1237 | 1237 | have hg1 := mul_le_mul_of_nonneg_left hη (by norm_num : (0 : ℝ) ≤ 64) |
| 1238 | 1238 | have hp1 := mul_le_mul_of_nonneg_left hη hK |
| 1239 | - nlinarith | |
| 1239 | + linarith | |
| 1240 | 1240 | |
| 1241 | 1241 | noncomputable def entranceRatioBound (P m : ℝ) : ℝ := |
| 1242 | 1242 | (64 + (3 + 4 * pressureBound) * energyEnvelope P (entranceTime m)) / |
| @@ -1258,7 +1258,7 @@ theorem directionRatio_entrance_bound (v : TailData) {y η : ℝ} (hh1 : v.h ≤ | ||
| 1258 | 1258 | have hQ := angularLag_lower v.core v.h_pos.le hh1 hy hyT hη hhT |
| 1259 | 1259 | have hQ' : coneFloor * Real.exp (-v.core.holdStart) ≤ angularLag v.core v.h η y := by |
| 1260 | 1260 | have he := mul_le_mul_of_nonneg_left (Real.exp_le_exp.mpr (neg_le_neg hyT)) coneFloor_pos.le |
| 1261 | - nlinarith [mul_nonneg coneFloor_pos.le (sq_nonneg η)] | |
| 1261 | + linarith [mul_nonneg coneFloor_pos.le (sq_nonneg η)] | |
| 1262 | 1262 | have hden := mul_le_mul hE hQ' (mul_pos coneFloor_pos (Real.exp_pos _)).le |
| 1263 | 1263 | (angular_pos v.core.P_pos v.core.dropLength v.core.lam (y, η)).le |
| 1264 | 1264 | have hlo : 0 < (v.core.P * Real.exp (-v.core.holdStart) / 2) * |
| @@ -1505,8 +1505,7 @@ theorem canonical_Ns_before {v : TailData} {K : ℝ} | ||
| 1505 | 1505 | OutgoingHistories.U_before_pulse v Amp η hy, canonical_M_before v Amp hy, |
| 1506 | 1506 | hMd, congrFun hS η, hSd, canonical_Pi_before w hyend, hPd, |
| 1507 | 1507 | axialLag_integrated_history] |
| 1508 | - simp only [OutgoingHistories.X, StressAlgebra.axialExponent, | |
| 1509 | - StressAlgebra.coordinateFactor, StressAlgebra.velocityExponent, d, A] | |
| 1508 | + simp only [OutgoingHistories.X, StressAlgebra.coordinateFactor, StressAlgebra.velocityExponent, d, A] | |
| 1510 | 1509 | field_simp [(Real.exp_pos y).ne'] ; ring |
| 1511 | 1510 | |
| 1512 | 1511 | /-! ## The first and last preliminary ramps -/ |
| @@ -1583,7 +1582,7 @@ theorem second_ramp_cone_margins (v : TailData) {y η : ℝ} (hh1 : v.h ≤ 1 / | ||
| 1583 | 1582 | refine ⟨ha, ?_⟩ |
| 1584 | 1583 | have hmul := mul_le_mul (show radialA v.core y - 2 ≤ 2 * v.core.lam by linarith) |
| 1585 | 1584 | hw2 (sq_nonneg _) (by linarith [v.core.lam_pos]) |
| 1586 | - nlinarith | |
| 1585 | + linarith | |
| 1587 | 1586 | |
| 1588 | 1587 | /-! ## Uniform pressure-source estimates -/ |
| 1589 | 1588 | |
| @@ -1627,7 +1626,7 @@ theorem pressureAxialSource_bound (v : TailData) {y η : ℝ} (hh1 : v.h ≤ 1 / | ||
| 1627 | 1626 | have hp := actual_pressure_bounds v hy hyend hη |
| 1628 | 1627 | have hd : 0 ≤ d η ∧ d η ≤ 1 := by |
| 1629 | 1628 | unfold d |
| 1630 | - constructor <;> nlinarith [sq_nonneg η, parameter_square_le_one hη] | |
| 1629 | + constructor <;> linarith [sq_nonneg η, parameter_square_le_one hη] | |
| 1631 | 1630 | have hA : 0 ≤ 4 * A v.h ∧ 4 * A v.h ≤ 3 := by |
| 1632 | 1631 | unfold A |
| 1633 | 1632 | constructor <;> linarith [v.h_pos] |
| @@ -1640,7 +1639,7 @@ theorem pressureAxialSource_bound (v : TailData) {y η : ℝ} (hh1 : v.h ≤ 1 / | ||
| 1640 | 1639 | rw [abs_mul, abs_mul, abs_of_nonneg hA.1] |
| 1641 | 1640 | have hb := mul_le_mul (mul_le_mul_of_nonneg_right hA.2 (abs_nonneg η)) hp.1 |
| 1642 | 1641 | (abs_nonneg _) (by positivity : 0 ≤ 3 * |η|) |
| 1643 | - nlinarith | |
| 1642 | + linarith | |
| 1644 | 1643 | have hthird : |η * angular v.core.P v.core.dropLength v.core.lam (y, η) ^ 2| = |
| 1645 | 1644 | |η| * angular v.core.P v.core.dropLength v.core.lam (y, η) ^ 2 := by |
| 1646 | 1645 | simp only [abs_mul, abs_pow, sq_abs] |
| @@ -1653,7 +1652,7 @@ theorem pressureAxialSource_bound (v : TailData) {y η : ℝ} (hh1 : v.h ≤ 1 / | ||
| 1653 | 1652 | rw [hthird] at hs |
| 1654 | 1653 | unfold pressureSourceBound |
| 1655 | 1654 | have hn := mul_nonneg (abs_nonneg η) (sq_nonneg (angular v.core.P v.core.dropLength v.core.lam (y, η))) |
| 1656 | - nlinarith [mul_nonneg pressureBound_pos.le hn] | |
| 1655 | + linarith [mul_nonneg pressureBound_pos.le hn] | |
| 1657 | 1656 | |
| 1658 | 1657 | theorem pressureAxialSource_deriv_bound (v : TailData) {y η : ℝ} (hh1 : v.h ≤ 1 / 100) |
| 1659 | 1658 | (hy : 0 ≤ y) (hyend : y ≤ v.core.endpoint) (hη : |η| ≤ 1) : |
| @@ -1763,7 +1762,7 @@ theorem chosen_parameters_bounds (v : TailData) | ||
| 1763 | 1762 | have hl : v.core.lam ≤ 1 / (4 * (entranceRatioBound v.core.P v.core.m ^ 2 + 1)) := |
| 1764 | 1763 | hlam.trans (min_le_right _ _) |
| 1765 | 1764 | have hl' := (le_div_iff₀ (show 0 < 4 * (entranceRatioBound v.core.P v.core.m ^ 2 + 1) by positivity)).mp hl |
| 1766 | - refine ⟨hp', (by nlinarith [v.core.lam_pos]), hh.trans (min_le_left _ _), ?_⟩ | |
| 1765 | + refine ⟨hp', (by linarith [v.core.lam_pos]), hh.trans (min_le_left _ _), ?_⟩ | |
| 1767 | 1766 | rw [holdStart_eq_entranceTime] |
| 1768 | 1767 | exact hh.trans ((min_le_right _ _).trans (min_le_right _ _)) |
| 1769 | 1768 | |
| @@ -1913,7 +1912,7 @@ theorem actual_ideal_cone_margins {v : TailData} {K : ℝ} | ||
| 1913 | 1912 | rw [coneB_before w ha hpulse, shear_early v.core (by linarith)] |
| 1914 | 1913 | rw [hA, hB] |
| 1915 | 1914 | norm_num |
| 1916 | - nlinarith [sq_nonneg (coneRatio w Amp (y, η))] | |
| 1915 | + linarith [sq_nonneg (coneRatio w Amp (y, η))] | |
| 1917 | 1916 | |
| 1918 | 1917 | /-- The radial normal coefficient agrees with the logarithmic derivative of |
| 1919 | 1918 | the true angular field `E`, rather than a declared slope proxy. -/ |
+16 −16 NavierStokes/OutgoingPulseBounds.lean View file
| @@ -29,7 +29,7 @@ theorem slope_bounds (c : Parameters) (y : ℝ) : | ||
| 29 | 29 | have ha := mul_nonneg c.lam_pos.le h2 |
| 30 | 30 | have hb := mul_nonneg c.lam_pos.le (sub_nonneg.mpr h3) |
| 31 | 31 | dsimp [OutgoingSchedule.slope] |
| 32 | - constructor <;> nlinarith | |
| 32 | + constructor <;> linarith | |
| 33 | 33 | |
| 34 | 34 | theorem logAmplitude_bounds (c : Parameters) {y : ℝ} (hy : 0 ≤ y) : |
| 35 | 35 | -y ≤ logAmplitude c.dropLength c.lam y ∧ |
| @@ -125,7 +125,7 @@ theorem prefixM_bounds (c : Parameters) : | ||
| 125 | 125 | (dropCoefficient_bounds c.m y).1 (Real.exp_pos _).le |
| 126 | 126 | _ = _ := by ring) |
| 127 | 127 | simp only [intervalIntegral.integral_const, sub_zero, smul_eq_mul] at hup |
| 128 | - constructor <;> nlinarith | |
| 128 | + constructor <;> linarith | |
| 129 | 129 | |
| 130 | 130 | theorem prefixJ_bounds (c : Parameters) : |
| 131 | 131 | 0 ≤ prefixJ c ∧ |
| @@ -171,7 +171,7 @@ theorem prefixJ_bounds (c : Parameters) : | ||
| 171 | 171 | · have hP := c.P_pos |
| 172 | 172 | exact add_nonneg (by positivity) hpos |
| 173 | 173 | · dsimp [K] at hup |
| 174 | - nlinarith | |
| 174 | + linarith | |
| 175 | 175 | |
| 176 | 176 | /-! ## Decay along the explicitly timed shaped wait -/ |
| 177 | 177 | |
| @@ -279,7 +279,7 @@ theorem wait_decay (c : Parameters) (hwait : c.wait = 60 * Real.log (1 / c.lam)) | ||
| 279 | 279 | apply Real.exp_le_exp.mpr |
| 280 | 280 | rw [hwait] |
| 281 | 281 | have h := mul_le_mul_of_nonneg_right (beta_small_bounds c hsmall i).2 hlog |
| 282 | - nlinarith | |
| 282 | + linarith | |
| 283 | 283 | |
| 284 | 284 | theorem pulseAmplitude_small (c : Parameters) |
| 285 | 285 | (hwait : c.wait = 60 * Real.log (1 / c.lam)) : |
| @@ -293,7 +293,7 @@ theorem pulseAmplitude_small (c : Parameters) | ||
| 293 | 293 | apply Real.exp_le_exp.mpr |
| 294 | 294 | have hprod := mul_nonneg c.lam_pos.le hw |
| 295 | 295 | rw [hwait] at hprod ⊢ |
| 296 | - nlinarith | |
| 296 | + linarith | |
| 297 | 297 | have h := mul_le_mul hhold hdec (Real.exp_pos _).le |
| 298 | 298 | (mul_nonneg c.P_pos.le (Real.exp_pos _).le) |
| 299 | 299 | convert! h using 1 ; dsimp [Parameters.holdStart, Parameters.dropLength] ; congr 2 ; ring_nf |
| @@ -375,7 +375,7 @@ theorem parameterPolynomial_derivative_bound {eta : ℝ} (heta : |eta| ≤ 1) : | ||
| 375 | 375 | have hs : eta ^ 2 ≤ 1 := by |
| 376 | 376 | have h := sq_le_sq₀ (abs_nonneg eta) (by norm_num : (0 : ℝ) ≤ 1) |>.mpr heta |
| 377 | 377 | simpa using h |
| 378 | - nlinarith | |
| 378 | + linarith | |
| 379 | 379 | |
| 380 | 380 | theorem normalized_mass_prefix (c : Parameters) (amp : ℝ → ℝ) (eta : ℝ) : |
| 381 | 381 | massMoment c amp eta c.pulseStart / |
| @@ -612,15 +612,15 @@ theorem two_row_solution_bound {k lam A0 A1 r0 r1 x0 x1 d0 d1 : ℝ} | ||
| 612 | 612 | lam * |x1| ≤ ((1 + Real.exp 1) / k) * (|d0| + |d1|) := by |
| 613 | 613 | have hA0p := hk.trans_le hA0 |
| 614 | 614 | have hA1p := hk.trans_le hA1 |
| 615 | - have h0' : x0 + r0 * x1 = d0 / A0 := (eq_div_iff hA0p.ne').mpr (by nlinarith [h0]) | |
| 616 | - have h1' : x0 + r1 * x1 = d1 / A1 := (eq_div_iff hA1p.ne').mpr (by nlinarith [h1]) | |
| 615 | + have h0' : x0 + r0 * x1 = d0 / A0 := (eq_div_iff hA0p.ne').mpr (by linarith [h0]) | |
| 616 | + have h1' : x0 + r1 * x1 = d1 / A1 := (eq_div_iff hA1p.ne').mpr (by linarith [h1]) | |
| 617 | 617 | have ha0 : |d0 / A0| ≤ |d0| / k := by |
| 618 | 618 | rw [abs_div, abs_of_pos hA0p] |
| 619 | 619 | exact div_le_div_of_nonneg_left (abs_nonneg _) hk hA0 |
| 620 | 620 | have ha1 : |d1 / A1| ≤ |d1| / k := by |
| 621 | 621 | rw [abs_div, abs_of_pos hA1p] |
| 622 | 622 | exact div_le_div_of_nonneg_left (abs_nonneg _) hk hA1 |
| 623 | - have hdx : (r0 - r1) * x1 = d0 / A0 - d1 / A1 := by nlinarith [h0', h1'] | |
| 623 | + have hdx : (r0 - r1) * x1 = d0 / A0 - d1 / A1 := by linarith [h0', h1'] | |
| 624 | 624 | have hdiff := abs_sub (d0 / A0) (d1 / A1) |
| 625 | 625 | rw [← hdx, abs_mul, abs_of_pos (hlam.trans_le hgap)] at hdiff |
| 626 | 626 | have hx1 : lam * |x1| ≤ (|d0| + |d1|) / k := by |
| @@ -644,7 +644,7 @@ theorem two_row_solution_bound {k lam A0 A1 r0 r1 x0 x1 d0 d1 : ℝ} | ||
| 644 | 644 | have hid : ((1 + Real.exp 1) / k) * (|d0| + |d1|) = |
| 645 | 645 | (|d0| + |d1|) / k + Real.exp 1 * ((|d0| + |d1|) / k) := by ring |
| 646 | 646 | constructor <;> rw [hid] |
| 647 | - · nlinarith | |
| 647 | + · linarith | |
| 648 | 648 | · nlinarith |
| 649 | 649 | |
| 650 | 650 | theorem normalized_solution_bound (c : Parameters) (x d : Fin 2 → ℝ) |
| @@ -660,9 +660,9 @@ theorem normalized_solution_bound (c : Parameters) (x d : Fin 2 → ℝ) | ||
| 660 | 660 | (show c.lam ≤ Real.exp (2 * beta c 0) - Real.exp (2 * beta c 1) by |
| 661 | 661 | linarith [separation_exponential_gap c, c.lam_pos]) |
| 662 | 662 | (show rowMoment (c.exponents 0) * (x 0 + Real.exp (2 * beta c 0) * x 1) = d 0 by |
| 663 | - nlinarith [h0]) | |
| 663 | + linarith [h0]) | |
| 664 | 664 | (show rowMoment (c.exponents 1) * (x 0 + Real.exp (2 * beta c 1) * x 1) = d 1 by |
| 665 | - nlinarith [h1]) | |
| 665 | + linarith [h1]) | |
| 666 | 666 | fin_cases j |
| 667 | 667 | · exact hb.1 |
| 668 | 668 | · exact hb.2 |
| @@ -738,7 +738,7 @@ theorem mainMoment_log_short (c : Parameters) (i : Fin 2) : | ||
| 738 | 738 | intro y hy |
| 739 | 739 | have hp : 11 ≤ c.lam * y := by |
| 740 | 740 | have h := (div_le_iff₀ c.lam_pos).mp hy |
| 741 | - nlinarith | |
| 741 | + linarith | |
| 742 | 742 | simp only [Pi.mul_apply, Function.comp_apply, id_eq] |
| 743 | 743 | rw [mainPulse_zero_right hp, mul_zero] |
| 744 | 744 | |
| @@ -747,7 +747,7 @@ theorem center_gap_bound (c : Parameters) (hsmall : c.lam ≤ 1 / 120) (i : Fin | ||
| 747 | 747 | have hb := (beta_small_bounds c hsmall i).1 |
| 748 | 748 | have hp : 0 ≤ 2 - 3 * c.lam := by linarith [c.lam_pos] |
| 749 | 749 | have hm := mul_le_mul_of_nonneg_right hb hp |
| 750 | - have hnum : (1 / 2 : ℝ) ≤ beta c i * (2 - 3 * c.lam) := by nlinarith | |
| 750 | + have hnum : (1 / 2 : ℝ) ≤ beta c i * (2 - 3 * c.lam) := by linarith | |
| 751 | 751 | have hdiv := div_le_div_of_nonneg_right hnum c.lam_pos.le |
| 752 | 752 | have he : beta c i * (center c 0 - 11 / c.lam) = |
| 753 | 753 | (beta c i * (2 - 3 * c.lam)) / c.lam := by |
| @@ -808,7 +808,7 @@ theorem normalized_prefixCoefficient_bound (c : Parameters) (hsmall : c.lam ≤ | ||
| 808 | 808 | mul_nonneg (beta_bounds c i).1.le (div_nonneg (by norm_num) c.lam_pos.le) |
| 809 | 809 | have he : Real.exp (-(beta c i * center c 0)) ≤ Real.exp (-(1 / (2 * c.lam))) := by |
| 810 | 810 | apply Real.exp_le_exp.mpr |
| 811 | - nlinarith | |
| 811 | + linarith | |
| 812 | 812 | rw [abs_mul, abs_of_pos (Real.exp_pos _)] |
| 813 | 813 | calc |
| 814 | 814 | _ ≤ Real.exp (-(1 / (2 * c.lam))) * prefixBound c.P c.m i := |
| @@ -879,7 +879,7 @@ theorem inverse_square_exp_absorption {lam : ℝ} (hlam : 0 < lam) : | ||
| 879 | 879 | norm_num only [Nat.cast_ofNat] at hsq |
| 880 | 880 | rw [ht', he'] at hsq |
| 881 | 881 | have h := (div_le_iff₀ (by positivity : 0 < 64 * lam ^ 2)).mp hsq |
| 882 | - nlinarith | |
| 882 | + linarith | |
| 883 | 883 | have hprod := mul_le_mul_of_nonneg_right hfac (Real.exp_pos (-(1 / (2 * lam)))).le |
| 884 | 884 | have hsum : 1 / (4 * lam) + -(1 / (2 * lam)) = -(1 / (4 * lam)) := by ring |
| 885 | 885 | calc |
+4 −4 NavierStokes/OutgoingSchedule.lean View file
| @@ -73,7 +73,7 @@ theorem sigma_monotone : Monotone sigma := by | ||
| 73 | 73 | have ha := edge_monotone hxy |
| 74 | 74 | have hb := edge_monotone (show 1 - y ≤ 1 - x by linarith) |
| 75 | 75 | have hcross := mul_le_mul ha hb (FlatCutoff.edge_nonneg 1 _) (FlatCutoff.edge_nonneg 1 _) |
| 76 | - nlinarith | |
| 76 | + linarith | |
| 77 | 77 | |
| 78 | 78 | /-! ## Smooth primitives and the single global slope -/ |
| 79 | 79 | |
| @@ -354,7 +354,7 @@ theorem intervals_separated (c : Parameters) (i j : Fin 2) (hij : i < j) : | ||
| 354 | 354 | theorem one_lt_lower (c : Parameters) (i : Fin 2) : 1 < c.lower i := by |
| 355 | 355 | have hL : 4 < c.pulseLength := by |
| 356 | 356 | apply (lt_div_iff₀ c.lam_pos).mpr |
| 357 | - nlinarith [c.lam_lt] | |
| 357 | + linarith [c.lam_lt] | |
| 358 | 358 | change 1 < Real.exp _ |
| 359 | 359 | rw [← Real.exp_zero] |
| 360 | 360 | apply Real.exp_lt_exp.mpr |
| @@ -368,7 +368,7 @@ theorem upper_lt_end (c : Parameters) (i : Fin 2) : | ||
| 368 | 368 | theorem main_end_lt_lower (c : Parameters) (i : Fin 2) : |
| 369 | 369 | Real.exp (11 / c.lam) < c.lower i := by |
| 370 | 370 | apply Real.exp_lt_exp.mpr |
| 371 | - have hgap : (63 / 20 : ℝ) * c.lam < 2 := by nlinarith [c.lam_lt] | |
| 371 | + have hgap : (63 / 20 : ℝ) * c.lam < 2 := by linarith [c.lam_lt] | |
| 372 | 372 | have hgap' := (lt_div_iff₀ c.lam_pos).mpr hgap |
| 373 | 373 | have hid : 13 / c.lam - 11 / c.lam = 2 / c.lam := by ring |
| 374 | 374 | dsimp [lower, pulseLength] |
| @@ -488,7 +488,7 @@ theorem pulseRatio_zero_late (c : Parameters) (amp : ℝ → ℝ) (eta : ℝ) {y | ||
| 488 | 488 | (hy : c.pulseLength ≤ y) : pulseRatio c amp (y, eta) = 0 := by |
| 489 | 489 | have h13 : 13 ≤ c.lam * y := by |
| 490 | 490 | have h := (div_le_iff₀ c.lam_pos).mp hy |
| 491 | - nlinarith | |
| 491 | + linarith | |
| 492 | 492 | simp only [pulseRatio] |
| 493 | 493 | rw [mainPulse_zero_right (by linarith : 11 ≤ c.lam * y), |
| 494 | 494 | correction_zero_late c amp eta hy] |
+20 −20 NavierStokes/OutgoingTail.lean View file
| @@ -61,7 +61,7 @@ theorem exists_sigma_derivative_bound : | ||
| 61 | 61 | (sigma_contDiff.continuous_deriv (by simp)).continuousOn |
| 62 | 62 | refine ⟨max C 1, le_max_right _ _, fun x => ?_⟩ |
| 63 | 63 | by_cases hx : x ∈ Icc (0 : ℝ) 1 |
| 64 | - · exact (le_abs_self _).trans ((by simpa using hC x hx : |deriv sigma x| ≤ C).trans | |
| 64 | + · exact (le_abs_self _).trans ((hC x hx : |deriv sigma x| ≤ C).trans | |
| 65 | 65 | (le_max_left _ _)) |
| 66 | 66 | · have hx' : x < 0 ∨ 1 < x := by simpa only [mem_Icc, not_and_or, not_le] using hx |
| 67 | 67 | rcases hx' with hx' | hx' |
| @@ -89,12 +89,12 @@ def tailCoefficient : ℝ := Real.exp (-5) / (16 * (stepBound + 1)) | ||
| 89 | 89 | |
| 90 | 90 | theorem tailCoefficient_pos : 0 < tailCoefficient := by |
| 91 | 91 | apply div_pos (Real.exp_pos _) |
| 92 | - nlinarith [stepBound_ge_one] | |
| 92 | + linarith [stepBound_ge_one] | |
| 93 | 93 | |
| 94 | 94 | theorem tailCoefficient_le : tailCoefficient ≤ Real.exp (-5) / 16 := by |
| 95 | 95 | unfold tailCoefficient |
| 96 | 96 | apply div_le_div_of_nonneg_left (Real.exp_pos _).le (by norm_num) |
| 97 | - nlinarith [stepBound_ge_one] | |
| 97 | + linarith [stepBound_ge_one] | |
| 98 | 98 | |
| 99 | 99 | theorem tailCoefficient_lt_one : tailCoefficient < 1 := by |
| 100 | 100 | have he : Real.exp (-5 : ℝ) ≤ 1 := Real.exp_le_one_iff.mpr (by norm_num) |
| @@ -235,7 +235,7 @@ theorem tailDebt_bounds (d : TailData) : | ||
| 235 | 235 | exact mul_le_mul_of_nonneg_right he (tailShapeDeriv_nonneg d t) |
| 236 | 236 | · have he : 1 ≤ Real.exp ((1 - d.h) * t) := |
| 237 | 237 | Real.one_le_exp_iff.mpr (mul_nonneg d.one_sub_h_pos.le ht.1) |
| 238 | - nlinarith [mul_le_mul_of_nonneg_right he (tailShapeDeriv_nonneg d t)] | |
| 238 | + linarith [mul_le_mul_of_nonneg_right he (tailShapeDeriv_nonneg d t)] | |
| 239 | 239 | |
| 240 | 240 | theorem tailDebt_pos (d : TailData) : 0 < tailDebt d := |
| 241 | 241 | (div_pos d.rho_pos (by linarith [d.rho_lt_half])).trans_le (tailDebt_bounds d).1 |
| @@ -245,7 +245,7 @@ theorem tailDebt_small (d : TailData) : tailDebt d < Real.exp (-2) * d.h := by | ||
| 245 | 245 | have hp : 0 ≤ Real.exp 3 * d.rho := mul_nonneg (Real.exp_pos _).le d.rho_pos.le |
| 246 | 246 | have hdiv : Real.exp 3 * d.rho / (1 - d.rho) ≤ 2 * Real.exp 3 * d.rho := by |
| 247 | 247 | apply (div_le_iff₀ hden).mpr |
| 248 | - nlinarith [mul_nonneg hp (show 0 ≤ 1 - 2 * d.rho by linarith [d.rho_lt_half])] | |
| 248 | + linarith [mul_nonneg hp (show 0 ≤ 1 - 2 * d.rho by linarith [d.rho_lt_half])] | |
| 249 | 249 | have hr : d.rho ≤ (Real.exp (-5) / 16) * d.h := |
| 250 | 250 | mul_le_mul_of_nonneg_right tailCoefficient_le d.h_pos.le |
| 251 | 251 | have hb : tailDebt d ≤ Real.exp (-2) * d.h / 8 := by |
| @@ -256,7 +256,7 @@ theorem tailDebt_small (d : TailData) : tailDebt d < Real.exp (-2) * d.h := by | ||
| 256 | 256 | mul_le_mul_of_nonneg_left hr (by positivity) |
| 257 | 257 | _ = (Real.exp 3 * Real.exp (-5)) * d.h / 8 := by ring |
| 258 | 258 | _ = Real.exp (-2) * d.h / 8 := by rw [← Real.exp_add]; norm_num |
| 259 | - exact hb.trans_lt (by nlinarith [mul_pos (Real.exp_pos (-2)) d.h_pos]) | |
| 259 | + exact hb.trans_lt (by linarith [mul_pos (Real.exp_pos (-2)) d.h_pos]) | |
| 260 | 260 | |
| 261 | 261 | theorem tail_taper_log_derivative (d : TailData) (t : ℝ) : |
| 262 | 262 | 0 ≤ tailShapeDeriv d t / tailShape d t ∧ |
| @@ -265,20 +265,20 @@ theorem tail_taper_log_derivative (d : TailData) (t : ℝ) : | ||
| 265 | 265 | have hcoef : tailCoefficient * stepBound ≤ 1 / 16 := by |
| 266 | 266 | unfold tailCoefficient |
| 267 | 267 | rw [div_mul_eq_mul_div] |
| 268 | - apply (div_le_iff₀ (show 0 < 16 * (stepBound + 1) by nlinarith)).mpr | |
| 268 | + apply (div_le_iff₀ (show 0 < 16 * (stepBound + 1) by linarith)).mpr | |
| 269 | 269 | have he : Real.exp (-5 : ℝ) ≤ 1 := Real.exp_le_one_iff.mpr (by norm_num) |
| 270 | - nlinarith [mul_le_mul_of_nonneg_right he hS] | |
| 270 | + linarith [mul_le_mul_of_nonneg_right he hS] | |
| 271 | 271 | have hder : tailShapeDeriv d t ≤ d.rho / 2 * stepBound := |
| 272 | - mul_le_mul_of_nonneg_left (sigma_derivative_le _) (by exact div_nonneg d.rho_pos.le (by norm_num)) | |
| 272 | + mul_le_mul_of_nonneg_left (sigma_derivative_le _) (div_nonneg d.rho_pos.le (by norm_num)) | |
| 273 | 273 | have hrS : d.rho * stepBound ≤ d.h / 16 := by |
| 274 | 274 | have h := mul_le_mul_of_nonneg_right hcoef d.h_pos.le |
| 275 | 275 | unfold TailData.rho |
| 276 | - nlinarith | |
| 276 | + linarith | |
| 277 | 277 | have hhalf : 1 / 2 ≤ tailShape d t := by |
| 278 | 278 | linarith [(tailShape_bounds d t).1, d.rho_lt_half] |
| 279 | 279 | have hratio : tailShapeDeriv d t / tailShape d t ≤ d.rho * stepBound := by |
| 280 | 280 | apply (div_le_iff₀ (tailShape_pos d t)).mpr |
| 281 | - nlinarith [mul_le_mul_of_nonneg_left hhalf (mul_nonneg d.rho_pos.le hS)] | |
| 281 | + linarith [mul_le_mul_of_nonneg_left hhalf (mul_nonneg d.rho_pos.le hS)] | |
| 282 | 282 | exact ⟨div_nonneg (tailShapeDeriv_nonneg d t) (tailShape_pos d t).le, |
| 283 | 283 | hratio.trans_lt (by linarith [d.h_pos])⟩ |
| 284 | 284 | |
| @@ -329,7 +329,7 @@ theorem releaseSlope_bounds (d : TailData) (t : ℝ) : | ||
| 329 | 329 | have hba := mul_le_mul_of_nonneg_left hab hh |
| 330 | 330 | have hgap := mul_le_mul_of_nonneg_left ha1 (sub_nonneg.mpr d.h_lt_lam.le) |
| 331 | 331 | unfold releaseSlope |
| 332 | - constructor <;> nlinarith | |
| 332 | + constructor <;> linarith | |
| 333 | 333 | |
| 334 | 334 | def releaseRate (d : TailData) (t : ℝ) : ℝ := 1 + releaseSlope d t |
| 335 | 335 | def releaseSource (d : TailData) (t : ℝ) : ℝ := -releaseSlope d t - d.h |
| @@ -337,7 +337,7 @@ def initialLag (d : TailData) : ℝ := (d.core.lam - d.h) / (1 - d.core.lam) | ||
| 337 | 337 | |
| 338 | 338 | theorem initialLag_gt_h (d : TailData) : d.h < initialLag d := by |
| 339 | 339 | apply (lt_div_iff₀ (show 0 < 1 - d.core.lam by linarith [d.core.lam_lt])).mpr |
| 340 | - nlinarith [d.h_small, mul_pos d.h_pos d.core.lam_pos] | |
| 340 | + linarith [d.h_small, mul_pos d.h_pos d.core.lam_pos] | |
| 341 | 341 | |
| 342 | 342 | theorem releaseRate_contDiff (d : TailData) : ContDiff ℝ ∞ (releaseRate d) := |
| 343 | 343 | contDiff_const.add (releaseSlope_contDiff d) |
| @@ -369,7 +369,7 @@ theorem linearLag_hasDerivAt {a b : ℝ → ℝ} (ha : Continuous a) (hb : Conti | ||
| 369 | 369 | simp |
| 370 | 370 | convert! h using 1 |
| 371 | 371 | dsimp [linearLag] |
| 372 | - nlinarith [congrArg (fun v : ℝ => v * b t) he] | |
| 372 | + linarith [congrArg (fun v : ℝ => v * b t) he] | |
| 373 | 373 | |
| 374 | 374 | def releaseLag (d : TailData) : ℝ → ℝ := |
| 375 | 375 | linearLag (releaseRate d) (releaseSource d) (initialLag d) |
| @@ -682,7 +682,7 @@ theorem tailNumerator_hasDerivAt (d : TailData) (t : ℝ) : | ||
| 682 | 682 | convert! Real.exp_zero using 1 ; ring_nf |
| 683 | 683 | convert! h using 1 |
| 684 | 684 | dsimp [tailNumerator, weightedTailDerivative] |
| 685 | - nlinarith [congrArg (fun x : ℝ => x * tailShapeDeriv d t) he] | |
| 685 | + linarith [congrArg (fun x : ℝ => x * tailShapeDeriv d t) he] | |
| 686 | 686 | |
| 687 | 687 | theorem tailLag_hasDerivAt (d : TailData) (t : ℝ) : |
| 688 | 688 | HasDerivAt (tailLag d) |
| @@ -722,9 +722,9 @@ def flatteningSlope (d : TailData) (y eta : ℝ) : ℝ := | ||
| 722 | 722 | theorem flatteningSlope_bounds (d : TailData) (y eta : ℝ) (heta : eta ^ 2 ≤ 1) : |
| 723 | 723 | -d.core.lam - 1 / 10 ≤ flatteningSlope d y eta ∧ |
| 724 | 724 | flatteningSlope d y eta ≤ -d.core.lam := by |
| 725 | - have hJ0 : 0 ≤ logShape eta := Real.log_nonneg (by nlinarith [sq_nonneg eta]) | |
| 725 | + have hJ0 : 0 ≤ logShape eta := Real.log_nonneg (by linarith [sq_nonneg eta]) | |
| 726 | 726 | have hJ1 : logShape eta ≤ Real.log 2 := |
| 727 | - Real.log_le_log (by positivity) (by nlinarith) | |
| 727 | + Real.log_le_log (by positivity) (by linarith) | |
| 728 | 728 | have hD0 := sigma_derivative_nonneg ((y - d.core.endpoint) / flattenLength) |
| 729 | 729 | have hD1 := sigma_derivative_le ((y - d.core.endpoint) / flattenLength) |
| 730 | 730 | have hS : 0 ≤ stepBound := le_trans (by norm_num) stepBound_ge_one |
| @@ -732,10 +732,10 @@ theorem flatteningSlope_bounds (d : TailData) (y eta : ℝ) (heta : eta ^ 2 ≤ | ||
| 732 | 732 | have hprod : deriv sigma ((y - d.core.endpoint) / flattenLength) * |
| 733 | 733 | (Real.log 2 - logShape eta) ≤ stepBound * Real.log 2 := by |
| 734 | 734 | have h := mul_le_mul_of_nonneg_right hD1 (sub_nonneg.mpr hJ1) |
| 735 | - nlinarith [mul_nonneg hS hJ0] | |
| 735 | + linarith [mul_nonneg hS hJ0] | |
| 736 | 736 | have hlen : stepBound * Real.log 2 ≤ flattenLength / 10 := by |
| 737 | 737 | unfold flattenLength |
| 738 | - nlinarith | |
| 738 | + linarith | |
| 739 | 739 | have hquot : (deriv sigma ((y - d.core.endpoint) / flattenLength) * |
| 740 | 740 | (Real.log 2 - logShape eta)) / flattenLength ≤ 1 / 10 := by |
| 741 | 741 | apply (div_le_iff₀ flattenLength_pos).mpr |
| @@ -831,7 +831,7 @@ theorem uniformWait_gt_twentyseven (d : TailData) : 27 < d.uniformWait := by | ||
| 831 | 831 | simp only [one_div, inv_inv] at h |
| 832 | 832 | dsimp [TailData.uniformWait] |
| 833 | 833 | simp only [one_div] |
| 834 | - nlinarith [d.core.lam_lt] | |
| 834 | + linarith [d.core.lam_lt] | |
| 835 | 835 | |
| 836 | 836 | |
| 837 | 837 | end NavierStokes.OutgoingTail |
+20 −0 routes/s2-ns-outgoing-1/README.md added View file
| @@ -0,0 +1,20 @@ | ||
| 1 | +--- | |
| 2 | +issue: 11 | |
| 3 | +status: working | |
| 4 | +--- | |
| 5 | +# s2-ns-outgoing-1 | |
| 6 | + | |
| 7 | +S-2, the `NavierStokes/Outgoing*` family: `OutgoingCone.lean`, `OutgoingEntranceCone.lean`, | |
| 8 | +`OutgoingPulseBounds.lean`, `OutgoingSchedule.lean` and `OutgoingTail.lean`. Each file is made | |
| 9 | +cheaper to elaborate by edits inside proofs only: a `nlinarith` becomes `linarith`, one `simpa` | |
| 10 | +becomes the term that closes its goal, and two `simp only` lists lose entries that do not change | |
| 11 | +the goal. No statement, import line or docstring changes, and there is no `maxHeartbeats`. The | |
| 12 | +edits are Treant's `speedup_trials` edits from upstream `f9e8bc5` | |
| 13 | +(TitiSkywalker/NavierStokesAndEuler, run of 2026-12-03), carried onto main `d956c7c` and counted | |
| 14 | +there, file by file; the five files together are 28.6% cheaper, and how the count was taken is in | |
| 15 | +the pull request's description. `docs/build-profile.md` holds S-2's list of the ten costliest | |
| 16 | +files. | |
| 17 | + | |
| 18 | +## Next | |
| 19 | + | |
| 20 | +Push, let the `challenge` and `build` checks run, and reply to the maintainer's review. | |