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

| 1 | import Euler.PacketSourceScaleActual |
| 2 | |
| 3 | /-! Numerical guard consequences for the literal scale sequences. -/ |
| 4 | |
| 5 | noncomputable section |
| 6 | |
| 7 | |
| 8 | namespace EulerPacketSourceScaleGuards |
| 9 | |
| 10 | open Real Filter EulerScale EulerPacketScaleGeometry EulerPacketScaleActivation |
| 11 | EulerPacketSourceScales EulerPacketSourceTime EulerPacketSourceScaleChoice |
| 12 | EulerPacketSourceScaleSequence EulerPacketSourceScaleActual |
| 13 | |
| 14 | open scoped Topology |
| 15 | |
| 16 | theorem actualTimeRatio_le (J : ℕ) (hJ : 1 ≤ J) (X : ℝ) (hX : 0 < X) |
| 17 | (hbase : X^1000 ≤ exp (X/((J-1:ℕ):ℝ)^7)) (n : ℕ) : |
| 18 | timeWidth J X (n+1)/timeWidth J X n ≤ sourceTimeRatio J (scaleSequence J X) n := by |
| 19 | apply (div_le_iff₀ (timeWidth_pos J hJ hX n)).mpr |
| 20 | rw [timeWidth_succ_eq, source_time_ratio_identity] |
| 21 | apply mul_le_mul_of_nonneg_left (sourceTimeWidth_le J hJ X hX hbase n) |
| 22 | unfold sourceTimeRatio |
| 23 | positivity |
| 24 | |
| 25 | theorem actualExtraTime_le (J : ℕ) (hJ : 1 ≤ J) (X : ℝ) (hX : 0 < X) |
| 26 | (hbase : X^1000 ≤ exp (X/((J-1:ℕ):ℝ)^7)) (n : ℕ) (a : ℝ) (ha : 0 ≤ a) : |
| 27 | 2*sqrt (a*previousShear J X n)*timeWidth J X (n+1) ≤ |
| 28 | 2*sqrt (a*exp (scaleSequence J X n/((J-1+n:ℕ):ℝ)^7))* |
| 29 | sourceNextTimeWidth J (scaleSequence J X) n := by |
| 30 | have hh := sqrt_le_sqrt (mul_le_mul_of_nonneg_left (previousShear_le_normal J hJ X hbase n) ha) |
| 31 | have hm := mul_le_mul_of_nonneg_right (mul_le_mul_of_nonneg_left hh (by norm_num : (0:ℝ) ≤ 2)) |
| 32 | (timeWidth_pos J hJ hX (n+1)).le |
| 33 | simpa only [timeWidth_succ_eq] using hm |
| 34 | |
| 35 | theorem actualParentRatio_le (J : ℕ) (hJ : 1 ≤ J) (X : ℝ) (hX : 0 < X) |
| 36 | (hbase : X^1000 ≤ exp (X/((J-1:ℕ):ℝ)^7)) (n : ℕ) : |
| 37 | previousShear J X n^2/shear J X n ≤ parentSquareRatio J (scaleSequence J X) n := by |
| 38 | have hh := pow_le_pow_left₀ (previousShear_pos J hX n).le (previousShear_le_normal J hJ X hbase n) 2 |
| 39 | have he : exp (scaleSequence J X n/((J-1+n:ℕ):ℝ)^7)^2 = |
| 40 | exp (2*scaleSequence J X n/((J-1+n:ℕ):ℝ)^7) := by |
| 41 | rw [pow_two, ← exp_add] |
| 42 | congr 1 |
| 43 | ring |
| 44 | rw [he] at hh |
| 45 | exact div_le_div_of_nonneg_right hh (exp_pos _).le |
| 46 | |
| 47 | theorem actualGoodCost_le (J : ℕ) (hJ : 1 ≤ J) (X : ℝ) |
| 48 | (hbase : X^1000 ≤ exp (X/((J-1:ℕ):ℝ)^7)) (n : ℕ) : |
| 49 | spike J X n*shear J X n*previousShear J X n ≤ goodCost J (scaleSequence J X) n := by |
| 50 | exact mul_le_mul_of_nonneg_left (previousShear_le_normal J hJ X hbase n) |
| 51 | (mul_nonneg (exp_pos _).le (exp_pos _).le) |
| 52 | |
| 53 | def actualExtraTime (J : ℕ) (X a : ℝ) (n : ℕ) : ℝ := |
| 54 | 2*sqrt (a*previousShear J X n)*timeWidth J X (n+1) |
| 55 | |
| 56 | theorem actualExtraTime_small (J D : ℕ) (hJ : 3 ≤ J) (C c X δ : ℝ) |
| 57 | (hC : 1 ≤ C) (hX : 8 ≤ X) (hb : ActualBounds J D C c X δ) |
| 58 | (n : ℕ) (a : ℝ) (ha : 0 ≤ a) (ha₂ : a ≤ 2) : |
| 59 | actualExtraTime J X a n * sourceTheta J C (scaleSequence J X) n^60 ≤ δ := by |
| 60 | have hx1 := quadratic_growth_one_le J (by omega) (scaleSequence J X) (by change 1 ≤ X; linarith only [hX]) |
| 61 | (scaleSequence_succ J X) |
| 62 | have hθ : 0 ≤ sourceTheta J C (scaleSequence J X) n := |
| 63 | le_trans zero_le_one (sourceTheta_bounds (by omega : 1 ≤ J) hC hx1 n).1 |
| 64 | have hfirst := mul_le_mul_of_nonneg_right |
| 65 | (actualExtraTime_le J (by omega) X (by linarith only [hX]) hb.initial_shear n a ha) |
| 66 | (pow_nonneg hθ 60) |
| 67 | exact hfirst.trans ((hb.normal.extraTime (fun _ => a) (fun _ => ha) (fun _ => ha₂)).term_le n) |
| 68 | |
| 69 | theorem actualWidths_contract (J D : ℕ) (hJ : 3 ≤ J) (C c X δ : ℝ) |
| 70 | (hX : 8 ≤ X) (hb : ActualBounds J D C c X δ) (hδ : δ ≤ 1/2) (n : ℕ) : |
| 71 | timeWidth J X (n+1) ≤ timeWidth J X n/2 := by |
| 72 | have hh := (actualTimeRatio_le J (by omega) X (by linarith only [hX]) hb.initial_shear n).trans |
| 73 | ((hb.normal.width.term_le n).trans hδ) |
| 74 | have hmul := (div_le_iff₀ (timeWidth_pos J (by omega) (by linarith only [hX]) n)).mp hh |
| 75 | nlinarith only [hmul] |
| 76 | |
| 77 | theorem coefficient_small (J D : ℕ) (hJ : 3 ≤ J) (C c X δ : ℝ) |
| 78 | (hC : 1 ≤ C) (hX : 8 ≤ X) (hb : ActualBounds J D C c X δ) |
| 79 | (a : ℕ → ℝ) (ha : ∀ n, 0 ≤ a n) (ha₂ : ∀ n, a n ≤ 2) |
| 80 | (A : ℕ) (hA : A ≤ 60) (n : ℕ) : |
| 81 | geometryError J D C c X a n * sourceTheta J C (scaleSequence J X) n^A ≤ δ := by |
| 82 | have hx1 := quadratic_growth_one_le J (by omega) (scaleSequence J X) (by change 1 ≤ X; linarith only [hX]) |
| 83 | (scaleSequence_succ J X) |
| 84 | have hθ := (sourceTheta_bounds (by omega : 1 ≤ J) hC hx1 n).1 |
| 85 | have hh := mul_le_mul_of_nonneg_left (pow_le_pow_right₀ hθ hA) |
| 86 | (geometryError_nonneg J D C c X a n (le_trans zero_le_one hC) (by linarith only [hX])) |
| 87 | exact hh.trans ((hb.coefficient a ha ha₂).term_le n) |
| 88 | |
| 89 | /-- The strong coefficient-error guard already implies compression |
| 90 | domination; no independent scale choice is required for it. -/ |
| 91 | theorem compression_of_error_small {a ε Θ target G d : ℝ} |
| 92 | (ha : 1/2 ≤ a) (hε : 0 ≤ ε) (hΘ : 0 ≤ Θ) (htarget : target ≤ Θ) |
| 93 | (hG : 1 ≤ G) (hd : 0 ≤ d) |
| 94 | (herr : 16*(ε*Θ*(4*G)^2+d) ≤ 1) : 60*(G+d)*target*ε < a := by |
| 95 | have hprod : 0 ≤ ε*Θ*G^2 := mul_nonneg (mul_nonneg hε hΘ) (sq_nonneg G) |
| 96 | have hd1 : d ≤ 1 := by nlinarith only [herr, hprod] |
| 97 | have hG₀ : 0 ≤ G := le_trans zero_le_one hG |
| 98 | have hGsq : G+d ≤ 2*G^2 := by nlinarith only [hG, hd1, sq_nonneg (G-1)] |
| 99 | have htargetmul := mul_le_mul_of_nonneg_right htarget hε |
| 100 | have hfull := mul_le_mul_of_nonneg_left htargetmul (show 0 ≤ 60*(G+d) by positivity) |
| 101 | have hscale := mul_le_mul_of_nonneg_right hGsq (mul_nonneg hΘ hε) |
| 102 | nlinarith only [herr, hd, hfull, hscale, ha] |
| 103 | |
| 104 | theorem scaleSequence_ge_initial (J : ℕ) (hJ : 1 ≤ J) (X : ℝ) (hX : 0 ≤ X) (n : ℕ) : |
| 105 | X ≤ scaleSequence J X n := by |
| 106 | induction n with |
| 107 | | zero => exact le_rfl |
| 108 | | succ n ih => |
| 109 | have hj : (1:ℝ) ≤ (J+n:ℕ) := by exact_mod_cast (show 1 ≤ J+n by omega) |
| 110 | rw [scaleSequence_succ] |
| 111 | exact ih.trans (le_mul_of_one_le_left (hX.trans ih) (one_le_pow₀ hj)) |
| 112 | |
| 113 | def targetTime (J : ℕ) (X β : ℝ) (n : ℕ) : ℝ := scaleSequence J X (n+1)/sqrt β |
| 114 | |
| 115 | def horizon (J : ℕ) (X a β : ℝ) (n : ℕ) : ℝ := targetTime J X β n+actualExtraTime J X a n |
| 116 | |
| 117 | structure StageGuards (J D : ℕ) (C c X K : ℝ) (a β : ℕ → ℝ) (n : ℕ) : Prop where |
| 118 | epsilon_pos : 0 < epsilon J X (a n) n |
| 119 | epsilon_small : epsilon J X (a n) n ≤ 1 |
| 120 | sigma_pos : 0 < sqrt (β n) |
| 121 | sigma_small : sqrt (β n) ≤ 1/4 |
| 122 | reciprocal_pos : 0 < (scaleSequence J X (n+1))⁻¹ |
| 123 | reciprocal_small : (scaleSequence J X (n+1))⁻¹ ≤ 1/2 |
| 124 | target_from_sigma : 1/sqrt (β n) ≤ targetTime J X (β n) n |
| 125 | target_le_horizon : targetTime J X (β n) n ≤ horizon J X (a n) (β n) n |
| 126 | horizon_le_Theta : horizon J X (a n) (β n) n ≤ sourceTheta J C (scaleSequence J X) n |
| 127 | extra_time : horizon J X (a n) (β n) n-targetTime J X (β n) n ≤ |
| 128 | 1/sourceTheta J C (scaleSequence J X) n^60 |
| 129 | next_width : timeWidth J X (n+1) ≤ timeWidth J X n/2 |
| 130 | geometry_small : 1000000*K*geometryError J D C c X a n*sourceTheta J C (scaleSequence J X) n^40 ≤ 1 |
| 131 | compression : 60*((1+olderShear J X n)+(priorError J D X n+neighborError J D X c n))* |
| 132 | targetTime J X (β n) n*epsilon J X (a n) n < a n |
| 133 | |
| 134 | theorem stage_guards (J D : ℕ) (hJ : 3 ≤ J) (C c X K δ : ℝ) |
| 135 | (hC : 4 ≤ C) (hX : 8 ≤ X) (hK : 1 ≤ K) (hδ : δ ≤ 1/2) |
| 136 | (hδK : 1000000*K*δ ≤ 1) (hb : ActualBounds J D C c X δ) |
| 137 | (a β : ℕ → ℝ) (ha : ∀ n, 1/2 ≤ a n) (ha₂ : ∀ n, a n ≤ 2) |
| 138 | (hβ : ∀ n, 1/2 ≤ β n*scaleSequence J X n^2) |
| 139 | (hβ₂ : ∀ n, β n*scaleSequence J X n^2 ≤ 2) (n : ℕ) : |
| 140 | StageGuards J D C c X K a β n := by |
| 141 | have hJ1 : 1 ≤ J := by omega |
| 142 | have hC1 : 1 ≤ C := by linarith only [hC] |
| 143 | have hXp : 0 < X := by linarith only [hX] |
| 144 | have hxn : 8 ≤ scaleSequence J X n := hX.trans (scaleSequence_ge_initial J hJ1 X hXp.le n) |
| 145 | have hj : (3:ℝ) ≤ (J+n:ℕ) := by exact_mod_cast (show 3 ≤ J+n by omega) |
| 146 | have hact := source_activation_ode_guards hj hxn (hβ n) (hβ₂ n) |
| 147 | have ht : targetTime J X (β n) n ≤ 2*((J+n:ℕ):ℝ)^2*scaleSequence J X n^2 := by |
| 148 | simpa only [targetTime, scaleSequence_succ] using hact.2.2.2.2.2.1 |
| 149 | have hx1 : ∀ m, 1 ≤ scaleSequence J X m := fun m => |
| 150 | (by linarith only [hX] : 1 ≤ X).trans (scaleSequence_ge_initial J hJ1 X hXp.le m) |
| 151 | have hθ := (sourceTheta_bounds hJ1 hC1 hx1 n).1 |
| 152 | have hθp : 0 < sourceTheta J C (scaleSequence J X) n := lt_of_lt_of_le zero_lt_one hθ |
| 153 | have ha₀ : ∀ m, 0 ≤ a m := fun m => by linarith only [ha m] |
| 154 | have heps : 0 < epsilon J X (a n) n := |
| 155 | sqrt_pos.mpr (div_pos (by linarith only [ha n]) (previousShear_pos J hXp n)) |
| 156 | have hextra₀ : 0 ≤ actualExtraTime J X (a n) n := by |
| 157 | exact mul_nonneg (mul_nonneg (by norm_num) (sqrt_nonneg _)) (timeWidth_pos J hJ1 hXp (n+1)).le |
| 158 | have hextra := actualExtraTime_small J D hJ C c X δ hC1 hX hb n (a n) (ha₀ n) (ha₂ n) |
| 159 | have hextra1 : actualExtraTime J X (a n) n ≤ 1 := by |
| 160 | have hh := mul_le_mul_of_nonneg_left (one_le_pow₀ hθ : 1 ≤ sourceTheta J C (scaleSequence J X) n^60) hextra₀ |
| 161 | nlinarith only [hh, hextra, hδ] |
| 162 | have hpow : 0 < sourceTheta J C (scaleSequence J X) n^60 := pow_pos hθp 60 |
| 163 | have hextraSharp : actualExtraTime J X (a n) n ≤ 1/sourceTheta J C (scaleSequence J X) n^60 := |
| 164 | (le_div_iff₀ hpow).mpr (hextra.trans (by linarith only [hδ])) |
| 165 | have hg : 1 ≤ 1+olderShear J X n := by |
| 166 | cases n with |
| 167 | | zero => norm_num [olderShear] |
| 168 | | succ m => |
| 169 | change 1 ≤ 1+previousShear J X m |
| 170 | linarith only [previousShear_pos J hXp m] |
| 171 | have hd : 0 ≤ priorError J D X n+neighborError J D X c n := by |
| 172 | have hp := (previousShear_pos J hXp n).le |
| 173 | have hk := (previousFrequency_pos J D hXp n).le |
| 174 | unfold priorError neighborError supportScale |
| 175 | positivity |
| 176 | have he0 : geometryError J D C c X a n ≤ 1 := by |
| 177 | have hh := coefficient_small J D hJ C c X δ hC1 hX hb a ha₀ ha₂ 0 (by omega) n |
| 178 | norm_num only [pow_zero, mul_one] at hh |
| 179 | linarith only [hh, hδ] |
| 180 | have heps1 : epsilon J X (a n) n ≤ 1 := by |
| 181 | have hG : 1 ≤ (4*(1+olderShear J X n))^2 := by nlinarith only [hg, sq_nonneg (1+olderShear J X n-1)] |
| 182 | have htG : 1 ≤ sourceTheta J C (scaleSequence J X) n*(4*(1+olderShear J X n))^2 := |
| 183 | one_le_mul_of_one_le_of_one_le hθ hG |
| 184 | have hh := mul_le_mul_of_nonneg_left htG heps.le |
| 185 | unfold geometryError at he0 |
| 186 | nlinarith only [he0, hh, hd] |
| 187 | have htθ : targetTime J X (β n) n ≤ sourceTheta J C (scaleSequence J X) n := by |
| 188 | have hnonneg : 0 ≤ ((J+n:ℕ):ℝ)^2*scaleSequence J X n^2 := by positivity |
| 189 | have hm := mul_le_mul_of_nonneg_right hC (by linarith only [hnonneg] : 0 ≤ 1+((J+n:ℕ):ℝ)^2*scaleSequence J X n^2) |
| 190 | unfold sourceTheta |
| 191 | nlinarith only [hm, hnonneg, ht] |
| 192 | refine ⟨heps, heps1, hact.2.2.1, hact.2.2.2.1, ?_, ?_, ?_, ?_, ?_, ?_, |
| 193 | actualWidths_contract J D hJ C c X δ hX hb hδ n, ?_, ?_⟩ |
| 194 | · simpa only [one_div, scaleSequence_succ] using hact.2.2.2.2.2.2.1 |
| 195 | · simpa only [one_div, scaleSequence_succ] using hact.2.2.2.2.2.2.2 |
| 196 | · simpa only [targetTime, scaleSequence_succ] using hact.2.2.2.2.1 |
| 197 | · exact le_add_of_nonneg_right hextra₀ |
| 198 | · have hnonneg : 0 ≤ ((J+n:ℕ):ℝ)^2*scaleSequence J X n^2 := by positivity |
| 199 | have hm := mul_le_mul_of_nonneg_right hC (by linarith only [hnonneg] : 0 ≤ 1+((J+n:ℕ):ℝ)^2*scaleSequence J X n^2) |
| 200 | unfold horizon sourceTheta |
| 201 | nlinarith only [hm, hnonneg, ht, hextra1] |
| 202 | · simpa only [horizon, add_sub_cancel_left] using hextraSharp |
| 203 | · have hh := mul_le_mul_of_nonneg_left |
| 204 | (coefficient_small J D hJ C c X δ hC1 hX hb a ha₀ ha₂ 40 (by omega) n) |
| 205 | (show 0 ≤ 1000000*K by positivity) |
| 206 | nlinarith only [hh, hδK] |
| 207 | · exact compression_of_error_small (ha n) heps.le hθp.le htθ hg hd |
| 208 | (by simpa only [geometryError, add_assoc] using he0) |
| 209 | |
| 210 | /-- All numerical geometry guards are achieved by one fixed stage, then one |
| 211 | base scale, uniformly over every frame satisfying the induction invariants. -/ |
| 212 | theorem exists_guarded_sequence (D : ℕ) (hD : 1000 ≤ D) (C c K : ℝ) |
| 213 | (hC : 4 ≤ C) (hc : 0 ≤ c) (hK : 1 ≤ K) : |
| 214 | ∃ J : ℕ, 3 ≤ J ∧ ∀ η : ℝ, 0 < η → ∃ X₀ δ : ℝ, 8 ≤ X₀ ∧ 0 < δ ∧ δ ≤ η ∧ |
| 215 | ∀ X : ℝ, X₀ ≤ X → ActualBounds J D C c X δ ∧ |
| 216 | ∀ a β : ℕ → ℝ, (∀ n, 1/2 ≤ a n) → (∀ n, a n ≤ 2) → |
| 217 | (∀ n, 1/2 ≤ β n*scaleSequence J X n^2) → |
| 218 | (∀ n, β n*scaleSequence J X n^2 ≤ 2) → |
| 219 | ∀ n, StageGuards J D C c X K a β n := by |
| 220 | obtain ⟨J, hJ, hchoice⟩ := actual_uniform_choice D hD C c (by linarith only [hC]) hc |
| 221 | refine ⟨J, hJ, ?_⟩ |
| 222 | intro η hη |
| 223 | let δ : ℝ := min η (min (1/2) (1/(1000000*K))) |
| 224 | have hδpos : 0 < δ := by dsimp [δ]; positivity |
| 225 | have hδη : δ ≤ η := min_le_left _ _ |
| 226 | have hδhalf : δ ≤ 1/2 := (min_le_right _ _).trans (min_le_left _ _) |
| 227 | have hδinv : δ ≤ 1/(1000000*K) := (min_le_right _ _).trans (min_le_right _ _) |
| 228 | have hδK : 1000000*K*δ ≤ 1 := by |
| 229 | have hh := (le_div_iff₀ (show 0 < 1000000*K by positivity)).mp hδinv |
| 230 | nlinarith only [hh] |
| 231 | obtain ⟨X₀, hX₀, hX⟩ := hchoice δ hδpos |
| 232 | refine ⟨X₀, δ, hX₀, hδpos, hδη, ?_⟩ |
| 233 | intro X hXX |
| 234 | have hb := hX X hXX |
| 235 | exact ⟨hb, fun a β ha ha₂ hβ hβ₂ n => stage_guards J D hJ C c X K δ hC (hX₀.trans hXX) |
| 236 | hK hδhalf hδK hb a β ha ha₂ hβ hβ₂ n⟩ |
| 237 | |
| 238 | /-- Equation (39) gives the actual packet power inequality for the |
| 239 | constructed sequence, for every fixed polynomial degree and positive |
| 240 | frequency exponent. The aggregate includes any fixed base constants. -/ |
| 241 | theorem parameter_packet_bound_eventually (J : ℕ) (hJ : 3 ≤ J) (X Cbase Cstar : ℝ) |
| 242 | (hX : 1 ≤ X) (hCbase : 1 ≤ Cbase) (hCstar : 0 ≤ Cstar) |
| 243 | (Q : ℕ) (θ : ℝ) (hθ : 0 < θ) : |
| 244 | ∀ᶠ n in atTop, |
| 245 | sourceParameterAggregate J Cbase Cstar (scaleSequence J X) n^Q ≤ frequency J X n^θ := by |
| 246 | have hlim := (source_parameters_separated J (by omega) Cbase Cstar hCbase hCstar |
| 247 | (scaleSequence J X) hX (scaleSequence_succ J X)).const_mul (Q:ℝ) |
| 248 | simp only [mul_zero] at hlim |
| 249 | have hxp := quadratic_growth_pos J (by omega) (scaleSequence J X) |
| 250 | (show 0 < scaleSequence J X 0 from lt_of_lt_of_le zero_lt_one hX) (scaleSequence_succ J X) |
| 251 | filter_upwards [hlim.eventually_le_const hθ] with n hn |
| 252 | have hj : (0:ℝ) < (J+n:ℕ) := by exact_mod_cast (show 0 < J+n by omega) |
| 253 | have hscale : 0 < scaleSequence J X n/((J+n:ℕ):ℝ)^2 := div_pos (hxp n) (pow_pos hj 2) |
| 254 | have hq : ((Q:ℝ)*log (sourceParameterAggregate J Cbase Cstar (scaleSequence J X) n))/ |
| 255 | (scaleSequence J X n/((J+n:ℕ):ℝ)^2) ≤ θ := by |
| 256 | convert! hn using 1 |
| 257 | ring |
| 258 | have hb := (div_le_iff₀ hscale).mp hq |
| 259 | have hP : 0 < sourceParameterAggregate J Cbase Cstar (scaleSequence J X) n := |
| 260 | Finset.sum_pos (fun i _ => exp_pos _) Finset.univ_nonempty |
| 261 | calc |
| 262 | _ = exp ((Q:ℝ)*log (sourceParameterAggregate J Cbase Cstar (scaleSequence J X) n)) := by |
| 263 | rw [exp_nat_mul, exp_log hP] |
| 264 | _ ≤ exp (θ*(scaleSequence J X n/((J+n:ℕ):ℝ)^2)) := exp_le_exp.mpr hb |
| 265 | _ = _ := by |
| 266 | unfold frequency |
| 267 | rw [← exp_mul] |
| 268 | congr 1 |
| 269 | ring |
| 270 | |
| 271 | end EulerPacketSourceScaleGuards |