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.ParentRenewalParameters |
| 2 | import Euler.PacketCommonScaleChoice |
| 3 | |
| 4 | /-! Fixed summable envelopes for actual geometric renewal. The analytic |
| 5 | envelope uses the constant sequence a=2, so its summability does not assume |
| 6 | bounds for the future, not-yet-constructed geometric couplings. -/ |
| 7 | |
| 8 | noncomputable section |
| 9 | |
| 10 | namespace EulerParentRenewalScale |
| 11 | |
| 12 | open Set Real Filter EulerScale EulerPacketMovingFrame EulerPacketSourceScales |
| 13 | EulerPacketSourceScaleChoice EulerPacketSourceScaleSequence EulerPacketSourceScaleActual |
| 14 | EulerPacketSourceScaleGuards EulerPacketSourceScaleBounds EulerPacketPressureScale |
| 15 | open scoped Topology |
| 16 | |
| 17 | def maximumError (J D : ℕ) (C c X : ℝ) : ℕ → ℝ := |
| 18 | geometryErrorCost J D C c X (fun _ => 2) |
| 19 | |
| 20 | def errorConstant (CF : ℝ) : ℝ := 30000000*neighborStabilityConstant*CF^2 |
| 21 | |
| 22 | def renewalCost (J D : ℕ) (C c CF X : ℝ) (n : ℕ) : ℝ := |
| 23 | 3000/scaleSequence J X n+errorConstant CF*maximumError J D C c X n |
| 24 | |
| 25 | theorem errorConstant_nonneg (CF : ℝ) : 0 ≤ errorConstant CF := by |
| 26 | unfold errorConstant |
| 27 | positivity [neighborStabilityConstant_ge] |
| 28 | |
| 29 | theorem maximumError_series {J D : ℕ} {C c X δ : ℝ} |
| 30 | (hb : ActualBounds J D C c X δ) : SmallSeries (maximumError J D C c X) δ := |
| 31 | hb.coefficient (fun _ => 2) (fun _ => by norm_num) (fun _ => le_rfl) |
| 32 | |
| 33 | theorem scaleSequence_double (J : ℕ) (hJ : 2 ≤ J) (X : ℝ) (hX : 0 < X) (n : ℕ) : |
| 34 | 2*scaleSequence J X n ≤ scaleSequence J X (n+1) := by |
| 35 | have hx := quadratic_growth_pos J (by omega) (scaleSequence J X) hX (scaleSequence_succ J X) n |
| 36 | have hj : (2 : ℝ) ≤ (J+n : ℕ) := by exact_mod_cast (show 2 ≤ J+n by omega) |
| 37 | have hs : (2 : ℝ) ≤ ((J+n : ℕ) : ℝ)^2 := by nlinarith only [hj] |
| 38 | rw [scaleSequence_succ] |
| 39 | exact mul_le_mul_of_nonneg_right hs hx.le |
| 40 | |
| 41 | theorem reciprocal_geometric (J : ℕ) (hJ : 2 ≤ J) (X : ℝ) (hX : 0 < X) (n : ℕ) : |
| 42 | 1/scaleSequence J X n ≤ (1/X)*(1/2 : ℝ)^n := by |
| 43 | have hx := quadratic_growth_pos J (by omega) (scaleSequence J X) hX (scaleSequence_succ J X) |
| 44 | induction n with |
| 45 | | zero => simp only [scaleSequence_zero,pow_zero,mul_one,le_refl] |
| 46 | | succ n ih => |
| 47 | have hrec := one_div_le_one_div_of_le (by positivity [hx n] : 0 < 2*scaleSequence J X n) |
| 48 | (scaleSequence_double J hJ X hX n) |
| 49 | calc |
| 50 | _ ≤ 1/(2*scaleSequence J X n) := hrec |
| 51 | _ = (1/2)*(1/scaleSequence J X n) := by ring |
| 52 | _ ≤ (1/2)*((1/X)*(1/2 : ℝ)^n) := mul_le_mul_of_nonneg_left ih (by norm_num) |
| 53 | _ = _ := by rw [pow_succ]; ring |
| 54 | |
| 55 | theorem reciprocal_series (J : ℕ) (hJ : 2 ≤ J) (X : ℝ) (hX : 0 < X) : |
| 56 | SmallSeries (fun n => 1/scaleSequence J X n) (2/X) := by |
| 57 | have hs : SmallSeries (fun n => (1/X)*(1/2 : ℝ)^n) (2/X) := by |
| 58 | refine ⟨fun n => by positivity,summable_geometric_two.mul_left (1/X),?_⟩ |
| 59 | rw [tsum_mul_left,tsum_geometric_two] |
| 60 | exact le_of_eq (by ring) |
| 61 | apply hs.mono |
| 62 | · intro n |
| 63 | have hx := quadratic_growth_pos J (by omega) (scaleSequence J X) hX (scaleSequence_succ J X) n |
| 64 | positivity |
| 65 | · exact reciprocal_geometric J hJ X hX |
| 66 | |
| 67 | theorem scale_series {f : ℕ → ℝ} {δ : ℝ} (hf : SmallSeries f δ) (C : ℝ) (hC : 0 ≤ C) : |
| 68 | SmallSeries (fun n => C*f n) (C*δ) := by |
| 69 | refine ⟨fun n => mul_nonneg hC (hf.nonneg n),hf.summable.mul_left C,?_⟩ |
| 70 | rw [tsum_mul_left] |
| 71 | exact mul_le_mul_of_nonneg_left hf.total_le hC |
| 72 | |
| 73 | theorem renewal_series {J D : ℕ} (hJ : 2 ≤ J) {C c CF X δ : ℝ} (hX : 0 < X) |
| 74 | (hb : ActualBounds J D C c X δ) : |
| 75 | SmallSeries (renewalCost J D C c CF X) (6000/X+errorConstant CF*δ) := by |
| 76 | have h := add_series (scale_series (reciprocal_series J hJ X hX) 3000 (by norm_num)) |
| 77 | (scale_series (maximumError_series hb) (errorConstant CF) (errorConstant_nonneg CF)) |
| 78 | convert h using 1 |
| 79 | · funext n |
| 80 | unfold renewalCost |
| 81 | ring |
| 82 | · ring |
| 83 | |
| 84 | /-- Enlarge only the final base scale; the starting index and every |
| 85 | previously chosen cost specification remain unchanged. -/ |
| 86 | theorem renewal_series_small {J D : ℕ} (hJ : 2 ≤ J) {C c CF X δ η : ℝ} |
| 87 | (hX : 0 < X) (hδ : 0 ≤ δ) (hη : 0 < η) (hb : ActualBounds J D C c X δ) |
| 88 | (hfloor : 12000/η ≤ X) (hsmall : 2*(1+errorConstant CF)*δ ≤ η) : |
| 89 | SmallSeries (renewalCost J D C c CF X) η := by |
| 90 | have hf := (div_le_iff₀ hη).mp hfloor |
| 91 | have hfirst : 6000/X ≤ η/2 := (div_le_iff₀ hX).mpr (by nlinarith only [hf]) |
| 92 | have hc : errorConstant CF*δ ≤ η/2 := by nlinarith only [hsmall,hδ] |
| 93 | exact (renewal_series hJ hX hb).weaken (by linarith only [hfirst,hc]) |
| 94 | |
| 95 | /-- This uses only the coupling at the present stage. -/ |
| 96 | theorem physical_error_le_maximum {ι : Type*} (G : PhysicalGeometryData ι) |
| 97 | (J D : ℕ) (hJ : 1 ≤ J) (C c CF X a : ℝ) (hC : 1 ≤ C) (hCF : 1 ≤ CF) |
| 98 | (hX : 1 ≤ X) (ha : a ≤ 2) (n : ℕ) |
| 99 | (heps : G.ε=epsilon J X a n) |
| 100 | (htheta : G.Θ ≤ sourceTheta J C (scaleSequence J X) n) |
| 101 | (hG : G.G ≤ CF*(1+olderShear J X n)) |
| 102 | (hd : G.d ≤ priorError J D X n+neighborError J D X c n) : |
| 103 | G.error*G.Θ^40 ≤ CF^2*maximumError J D C c X n := by |
| 104 | have hXp : 0 < X := zero_lt_one.trans_le hX |
| 105 | have hx := quadratic_growth_one_le J hJ (scaleSequence J X) hX (scaleSequence_succ J X) |
| 106 | have hthetaOne := (sourceTheta_bounds hJ hC hx n).1 |
| 107 | have htheta0 : 0 ≤ sourceTheta J C (scaleSequence J X) n := zero_le_one.trans hthetaOne |
| 108 | have he : G.ε ≤ epsilon J X 2 n := by |
| 109 | rw [heps] |
| 110 | apply Real.sqrt_le_sqrt |
| 111 | exact div_le_div_of_nonneg_right ha (previousShear_pos J hXp n).le |
| 112 | have he0 : 0 ≤ epsilon J X 2 n := Real.sqrt_nonneg _ |
| 113 | have hmain : G.ε*G.Θ*(4*G.G)^2 ≤ |
| 114 | CF^2*(epsilon J X 2 n*sourceTheta J C (scaleSequence J X) n* |
| 115 | (4*(1+olderShear J X n))^2) := by |
| 116 | calc |
| 117 | _ ≤ epsilon J X 2 n*sourceTheta J C (scaleSequence J X) n* |
| 118 | (4*(CF*(1+olderShear J X n)))^2 := |
| 119 | mul_le_mul (mul_le_mul he htheta G.Theta_pos.le he0) |
| 120 | (pow_le_pow_left₀ (by positivity [G.G_lower]) |
| 121 | (mul_le_mul_of_nonneg_left hG (by norm_num : (0 : ℝ) ≤ 4)) 2) |
| 122 | (sq_nonneg _) (mul_nonneg he0 htheta0) |
| 123 | _ = _ := by ring |
| 124 | have hds : G.d ≤ CF^2*(priorError J D X n+neighborError J D X c n) := |
| 125 | hd.trans (le_mul_of_one_le_left (G.d_nonneg.trans hd) (one_le_pow₀ hCF)) |
| 126 | have herr : G.error ≤ CF^2*geometryError J D C c X (fun _ => 2) n := by |
| 127 | unfold PhysicalGeometryData.error geometryError |
| 128 | dsimp only |
| 129 | nlinarith only [hmain,hds] |
| 130 | have hpow : G.Θ^40 ≤ sourceTheta J C (scaleSequence J X) n^60 := |
| 131 | (pow_le_pow_left₀ G.Theta_pos.le htheta 40).trans (pow_le_pow_right₀ hthetaOne (by omega)) |
| 132 | have hmax0 := geometryError_nonneg J D C c X (fun _ => 2) n (zero_le_one.trans hC) hXp |
| 133 | have hm := mul_le_mul herr hpow (pow_nonneg G.Theta_pos.le 40) (mul_nonneg (sq_nonneg CF) hmax0) |
| 134 | simpa only [maximumError,geometryErrorCost,mul_assoc] using hm |
| 135 | |
| 136 | theorem coupling_polynomial_le {ι : Type*} (G : PhysicalGeometryData ι) : |
| 137 | G.y^4+G.σ^2*G.y^2+8*G.σ*G.y^3 ≤ 10*G.y := by |
| 138 | have hy1 : G.y ≤ 1 := G.y_small.trans (by norm_num) |
| 139 | have hs1 : G.σ ≤ 1 := G.sigma_small.trans (by norm_num) |
| 140 | have hy2 : G.y^2 ≤ G.y := by nlinarith only [G.y_pos,hy1] |
| 141 | have hy3 : G.y^3 ≤ G.y := by |
| 142 | have h := mul_le_mul_of_nonneg_right (pow_le_one₀ G.y_pos.le hy1 (n := 2)) G.y_pos.le |
| 143 | simpa only [pow_succ,one_mul] using h |
| 144 | have hy4 : G.y^4 ≤ G.y := by |
| 145 | have h := mul_le_mul_of_nonneg_right (pow_le_one₀ G.y_pos.le hy1 (n := 3)) G.y_pos.le |
| 146 | simpa only [pow_succ,one_mul] using h |
| 147 | have hs2 : G.σ^2 ≤ 1 := pow_le_one₀ G.sigma_pos.le hs1 |
| 148 | have h2 := mul_le_mul hs2 hy2 (sq_nonneg G.y) (by norm_num : (0 : ℝ) ≤ 1) |
| 149 | have h3 := mul_le_mul hs1 hy3 (pow_nonneg G.y_pos.le 3) (by norm_num : (0 : ℝ) ≤ 1) |
| 150 | nlinarith only [hy4,h2,h3] |
| 151 | |
| 152 | theorem actual_errors_le_cost {ι : Type*} (G : PhysicalGeometryData ι) |
| 153 | (J D : ℕ) (hJ : 2 ≤ J) (C c CF X a : ℝ) (hC : 1 ≤ C) (hCF : 1 ≤ CF) |
| 154 | (hX : 1 ≤ X) (ha : a ≤ 2) (n : ℕ) |
| 155 | (heps : G.ε=epsilon J X a n) |
| 156 | (htheta : G.Θ ≤ sourceTheta J C (scaleSequence J X) n) |
| 157 | (hG : G.G ≤ CF*(1+olderShear J X n)) |
| 158 | (hd : G.d ≤ priorError J D X n+neighborError J D X c n) |
| 159 | (hy : G.y=(scaleSequence J X (n+1))⁻¹) |
| 160 | (hsigma : G.σ*scaleSequence J X n ≤ 2) : |
| 161 | G.couplingError ≤ renewalCost J D C c CF X n ∧ |
| 162 | G.tiltError ≤ renewalCost J D C c CF X n := by |
| 163 | have hXp : 0 < X := zero_lt_one.trans_le hX |
| 164 | have hx := quadratic_growth_pos J (by omega) (scaleSequence J X) hXp (scaleSequence_succ J X) n |
| 165 | have hxx : scaleSequence J X n ≤ scaleSequence J X (n+1) := |
| 166 | (by linarith only [hx] : scaleSequence J X n ≤ 2*scaleSequence J X n).trans |
| 167 | (scaleSequence_double J hJ X hXp n) |
| 168 | have hy' : G.y ≤ 1/scaleSequence J X n := by |
| 169 | rw [hy,← one_div] |
| 170 | exact one_div_le_one_div_of_le hx hxx |
| 171 | have hs : G.σ ≤ 2/scaleSequence J X n := (le_div_iff₀ hx).mpr hsigma |
| 172 | have herr := physical_error_le_maximum G J D (by omega) C c CF X a hC hCF hX ha n |
| 173 | heps htheta hG hd |
| 174 | have hK : 0 ≤ 30000000*neighborStabilityConstant := by positivity [neighborStabilityConstant_ge] |
| 175 | have hm := mul_le_mul_of_nonneg_left herr hK |
| 176 | have hnorm : 30000000*neighborStabilityConstant*G.error*G.Θ^40 ≤ |
| 177 | errorConstant CF*maximumError J D C c X n := by |
| 178 | unfold errorConstant |
| 179 | nlinarith only [hm] |
| 180 | have hp := coupling_polynomial_le G |
| 181 | have hyp := mul_le_mul_of_nonneg_left hy' (by norm_num : (0 : ℝ) ≤ 10) |
| 182 | have hsp := mul_le_mul_of_nonneg_left hs (by norm_num : (0 : ℝ) ≤ 1500) |
| 183 | have hi : 0 ≤ 1/scaleSequence J X n := (one_div_pos.mpr hx).le |
| 184 | constructor |
| 185 | · unfold PhysicalGeometryData.couplingError renewalCost |
| 186 | simp only [div_eq_mul_inv,one_mul] at hyp hi ⊢ |
| 187 | nlinarith only [hp,hyp,hnorm,hi] |
| 188 | · unfold PhysicalGeometryData.tiltError renewalCost |
| 189 | simp only [div_eq_mul_inv] at hsp ⊢ |
| 190 | nlinarith only [hsp,hnorm] |
| 191 | |
| 192 | /-- Optional explicit extra cost for the next activation. The existing |
| 193 | parent-square cost also controls it after multiplication by 2*CF+1. -/ |
| 194 | def activationCostSpec (CF : ℝ) (hCF : 1 ≤ CF) : CostSpec where |
| 195 | d := 1 |
| 196 | B := 7 |
| 197 | N := 5 |
| 198 | a := 5 |
| 199 | b := 1 |
| 200 | c := 2 |
| 201 | C := 2*CF+1 |
| 202 | p := 0 |
| 203 | q := 0 |
| 204 | d_le_two := by norm_num |
| 205 | a_nonneg := by norm_num |
| 206 | a_lt_B := by norm_num |
| 207 | a_le_N := by norm_num |
| 208 | b_pos := zero_lt_one |
| 209 | C_pos := by linarith |
| 210 | |
| 211 | theorem activationCost_eq (J : ℕ) (CF : ℝ) (hCF : 1 ≤ CF) (x : ℕ → ℝ) (n : ℕ) : |
| 212 | (activationCostSpec CF hCF).cost J x n=(2*CF+1)*parentSquareRatio J x n := by |
| 213 | unfold parentSquareRatio |
| 214 | rw [sourceParentSquareRatio_eq] |
| 215 | simp only [activationCostSpec,CostSpec.cost,monomialCost,pow_zero,mul_one,one_mul] |
| 216 | |
| 217 | theorem previousShear_one_le (J : ℕ) (hJ : 1 ≤ J) (X : ℝ) (hX : 1 ≤ X) (n : ℕ) : |
| 218 | 1 ≤ previousShear J X n := by |
| 219 | cases n with |
| 220 | | zero => exact one_le_pow₀ hX |
| 221 | | succ n => |
| 222 | apply Real.one_le_exp |
| 223 | have hx := quadratic_growth_one_le J hJ (scaleSequence J X) hX (scaleSequence_succ J X) n |
| 224 | exact div_nonneg (zero_le_one.trans hx) (pow_nonneg (Nat.cast_nonneg _) 5) |
| 225 | |
| 226 | theorem activation_ratio_le {J D : ℕ} (hJ : 1 ≤ J) {C c CF X δ : ℝ} |
| 227 | (hCF : 1 ≤ CF) (hX : 1 ≤ X) (hb : ActualBounds J D C c X δ) |
| 228 | (e : ℝ) (he : e ≤ 1) (n : ℕ) : |
| 229 | (CF*(1+previousShear J X n)+e)/shear J X n ≤ |
| 230 | (activationCostSpec CF hCF).cost J (scaleSequence J X) n := by |
| 231 | have hp := previousShear_one_le J hJ X hX n |
| 232 | have h1 : 1+previousShear J X n ≤ 2*(previousShear J X n)^2 := by |
| 233 | nlinarith only [hp,sq_nonneg (previousShear J X n-1)] |
| 234 | have h2 := mul_le_mul_of_nonneg_left h1 (zero_le_one.trans hCF) |
| 235 | have he' : e ≤ (previousShear J X n)^2 := he.trans (one_le_pow₀ hp) |
| 236 | have hn : CF*(1+previousShear J X n)+e ≤ (2*CF+1)*(previousShear J X n)^2 := by |
| 237 | nlinarith only [h2,he'] |
| 238 | have hd := div_le_div_of_nonneg_right hn (show 0 ≤ shear J X n from (Real.exp_pos _).le) |
| 239 | have hb' := mul_le_mul_of_nonneg_left |
| 240 | (actualParentRatio_le J hJ X (zero_lt_one.trans_le hX) hb.initial_shear n) |
| 241 | (by positivity : 0 ≤ 2*CF+1) |
| 242 | rw [activationCost_eq] |
| 243 | have heq : (2*CF+1)*(previousShear J X n)^2/shear J X n= |
| 244 | (2*CF+1)*((previousShear J X n)^2/shear J X n) := by ring |
| 245 | rw [heq] at hd |
| 246 | exact hd.trans hb' |
| 247 | |
| 248 | theorem activation_smallness {J D : ℕ} (hJ : 1 ≤ J) {C c CF X δ ζ : ℝ} |
| 249 | (hCF : 1 ≤ CF) (hX : 1 ≤ X) (hb : ActualBounds J D C c X δ) |
| 250 | (hs : SmallSeries ((activationCostSpec CF hCF).cost J (scaleSequence J X)) ζ) |
| 251 | (e : ℝ) (he : e ≤ 1) (n : ℕ) : |
| 252 | CF*(1+previousShear J X n)+e ≤ ζ*shear J X n := by |
| 253 | have h := (activation_ratio_le hJ hCF hX hb e he n).trans (hs.term_le n) |
| 254 | exact (div_le_iff₀ (Real.exp_pos _)).mp h |
| 255 | |
| 256 | end EulerParentRenewalScale |