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 NavierStokes.WeightedQuotients |
| 2 | import Mathlib.Analysis.Calculus.MeanValue |
| 3 | |
| 4 | noncomputable section |
| 5 | |
| 6 | namespace NavierStokes.ClosedIntervalJetAlgebra |
| 7 | |
| 8 | open Set |
| 9 | open scoped ContDiff BigOperators |
| 10 | |
| 11 | abbrev J : Set ℝ := Icc (-1 : ℝ) 1 |
| 12 | |
| 13 | theorem uniqueDiff : UniqueDiffOn ℝ J := uniqueDiffOn_Icc (by norm_num) |
| 14 | |
| 15 | def Bound (k : ℕ) (f : ℝ → ℝ) (B : ℝ) : Prop := |
| 16 | ∀ n ≤ k, ∀ η ∈ J, ‖iteratedFDerivWithin ℝ n f J η‖ ≤ B |
| 17 | |
| 18 | theorem Bound.mono {k : ℕ} {f : ℝ → ℝ} {B C : ℝ} |
| 19 | (hf : Bound k f B) (hBC : B ≤ C) : Bound k f C := |
| 20 | fun n hn η hη => (hf n hn η hη).trans hBC |
| 21 | |
| 22 | theorem Bound.nonneg {k : ℕ} {f : ℝ → ℝ} {B : ℝ} (hf : Bound k f B) : 0 ≤ B := |
| 23 | (norm_nonneg _).trans (hf 0 (Nat.zero_le _) 0 (by constructor <;> norm_num)) |
| 24 | |
| 25 | theorem Bound.value {k : ℕ} {f : ℝ → ℝ} {B η : ℝ} |
| 26 | (hf : Bound k f B) (hη : η ∈ J) : |f η| ≤ B := by |
| 27 | simpa only [norm_iteratedFDerivWithin_zero, Real.norm_eq_abs] using hf 0 (Nat.zero_le _) η hη |
| 28 | |
| 29 | theorem Bound.const (k : ℕ) (c : ℝ) : Bound k (fun _ => c) |c| := by |
| 30 | intro n hn η hη |
| 31 | by_cases hn0 : n = 0 |
| 32 | · subst n; simp |
| 33 | · rw [iteratedFDerivWithin_const_of_ne hn0] |
| 34 | simpa only [Pi.zero_apply, norm_zero] using abs_nonneg c |
| 35 | |
| 36 | theorem Bound.add {k : ℕ} {f g : ℝ → ℝ} {A B : ℝ} |
| 37 | (hf : ContDiffOn ℝ ∞ f J) (hg : ContDiffOn ℝ ∞ g J) |
| 38 | (ha : Bound k f A) (hb : Bound k g B) : Bound k (fun η => f η + g η) (A + B) := by |
| 39 | intro n hn η hη |
| 40 | rw [fun_iteratedFDerivWithin_add_apply ((hf η hη).of_le (WeightedQuotients.nat_le_infty n)) |
| 41 | ((hg η hη).of_le (WeightedQuotients.nat_le_infty n)) uniqueDiff hη] |
| 42 | exact (norm_add_le _ _).trans (add_le_add (ha n hn η hη) (hb n hn η hη)) |
| 43 | |
| 44 | theorem Bound.sub {k : ℕ} {f g : ℝ → ℝ} {A B : ℝ} |
| 45 | (hf : ContDiffOn ℝ ∞ f J) (hg : ContDiffOn ℝ ∞ g J) |
| 46 | (ha : Bound k f A) (hb : Bound k g B) : Bound k (fun η => f η - g η) (A + B) := by |
| 47 | intro n hn η hη |
| 48 | rw [fun_iteratedFDerivWithin_sub_apply ((hf η hη).of_le (WeightedQuotients.nat_le_infty n)) |
| 49 | ((hg η hη).of_le (WeightedQuotients.nat_le_infty n)) uniqueDiff hη] |
| 50 | exact (norm_sub_le _ _).trans (add_le_add (ha n hn η hη) (hb n hn η hη)) |
| 51 | |
| 52 | theorem Bound.congr {k : ℕ} {f g : ℝ → ℝ} {B : ℝ} |
| 53 | (hf : Bound k f B) (he : EqOn g f J) : Bound k g B := by |
| 54 | intro n hn η hη |
| 55 | rw [iteratedFDerivWithin_congr he hη] |
| 56 | exact hf n hn η hη |
| 57 | |
| 58 | theorem Bound.mul {k : ℕ} {f g : ℝ → ℝ} {A B : ℝ} |
| 59 | (hf : ContDiffOn ℝ ∞ f J) (hg : ContDiffOn ℝ ∞ g J) |
| 60 | (ha : Bound k f A) (hb : Bound k g B) : |
| 61 | Bound k (fun η => f η * g η) ((2 : ℝ)^k * A * B) := by |
| 62 | intro n hn η hη |
| 63 | refine (norm_iteratedFDerivWithin_mul_le hf hg uniqueDiff hη |
| 64 | (WeightedQuotients.nat_le_infty n)).trans ?_ |
| 65 | calc |
| 66 | _ ≤ ∑ i ∈ Finset.range (n+1), (n.choose i : ℝ) * A * B := by |
| 67 | apply Finset.sum_le_sum |
| 68 | intro i hi |
| 69 | have hin : i ≤ n := Nat.le_of_lt_succ (Finset.mem_range.mp hi) |
| 70 | exact mul_le_mul (mul_le_mul_of_nonneg_left (ha i (hin.trans hn) η hη) |
| 71 | (Nat.cast_nonneg _)) (hb (n-i) ((Nat.sub_le _ _).trans hn) η hη) |
| 72 | (norm_nonneg _) (mul_nonneg (Nat.cast_nonneg _) ha.nonneg) |
| 73 | _ = (2 : ℝ)^n * A * B := by |
| 74 | rw [← Finset.sum_mul, ← Finset.sum_mul] |
| 75 | congr 2 |
| 76 | exact_mod_cast Nat.sum_range_choose n |
| 77 | _ ≤ (2 : ℝ)^k * A * B := |
| 78 | mul_le_mul_of_nonneg_right (mul_le_mul_of_nonneg_right |
| 79 | (pow_le_pow_right₀ (by norm_num) hn) ha.nonneg) hb.nonneg |
| 80 | |
| 81 | /-- The inverse bound depends only on the positive lower bound and the input jet bound. -/ |
| 82 | theorem inverse_bound (k : ℕ) (μ B : ℝ) (hμ : 0 < μ) : |
| 83 | ∃ C : ℝ, 0 ≤ C ∧ ∀ f : ℝ → ℝ, ContDiffOn ℝ ∞ f J → |
| 84 | (∀ η ∈ J, μ ≤ f η) → Bound k f B → Bound k (fun η => (f η)⁻¹) C := by |
| 85 | let R := max 1 (max B μ⁻¹) |
| 86 | have hR : 1 ≤ R := le_max_left _ _ |
| 87 | have hR0 : 0 ≤ R := zero_le_one.trans hR |
| 88 | let C := (k.factorial : ℝ) * WeightedQuotients.coeffBound (-1) k * R^(2*k+1) |
| 89 | have hcoef := WeightedQuotients.coeffBound_nonneg (-1) k |
| 90 | refine ⟨C, mul_nonneg (mul_nonneg (Nat.cast_nonneg _) hcoef) (pow_nonneg hR0 _), ?_⟩ |
| 91 | intro f hf hp hb n hn η hη |
| 92 | have hfpos : ∀ η ∈ J, 0 < f η := fun η hη => hμ.trans_le (hp η hη) |
| 93 | have hg : ContDiffOn ℝ ∞ (fun t : ℝ => t ^ (-1 : ℝ)) (Ioi 0) := by |
| 94 | intro t ht |
| 95 | exact (Real.contDiffAt_rpow_const_of_ne (show 0 < t from ht).ne').contDiffWithinAt |
| 96 | have hinv : (f η)⁻¹ ≤ R := (inv_anti₀ hμ (hp η hη)).trans |
| 97 | ((le_max_right _ _).trans (le_max_right _ _)) |
| 98 | have hc := norm_iteratedFDerivWithin_comp_le hg hf (WeightedQuotients.nat_le_infty n) |
| 99 | isOpen_Ioi.uniqueDiffOn uniqueDiff hfpos hη (C := WeightedQuotients.coeffBound (-1) k * R^(k+1)) |
| 100 | (D := R) (by |
| 101 | intro i hi |
| 102 | rw [iteratedFDerivWithin_of_isOpen i isOpen_Ioi (hfpos η hη)] |
| 103 | apply WeightedQuotients.rpow_jet_bound (-1) hR (hfpos η hη) _ hinv (hi.trans hn) |
| 104 | simpa only [Real.rpow_neg_one] using hinv) (by |
| 105 | intro i hi hik |
| 106 | exact (hb i (hik.trans hn) η hη).trans |
| 107 | (((le_max_left _ _).trans (le_max_right _ _)).trans |
| 108 | (by simpa only [pow_one] using pow_le_pow_right₀ hR hi))) |
| 109 | simp only [Function.comp_def, Real.rpow_neg_one] at hc |
| 110 | refine hc.trans ?_ |
| 111 | dsimp [C] |
| 112 | calc |
| 113 | (n.factorial : ℝ) * (WeightedQuotients.coeffBound (-1) k * R^(k+1)) * R^n |
| 114 | = n.factorial * WeightedQuotients.coeffBound (-1) k * R^(k+1+n) := by rw [pow_add]; ring |
| 115 | _ ≤ k.factorial * WeightedQuotients.coeffBound (-1) k * R^(2*k+1) := by |
| 116 | exact mul_le_mul (mul_le_mul_of_nonneg_right (by exact_mod_cast Nat.factorial_le hn) hcoef) |
| 117 | (pow_le_pow_right₀ hR (by omega)) (pow_nonneg hR0 _) |
| 118 | (mul_nonneg (Nat.cast_nonneg _) hcoef) |
| 119 | |
| 120 | /-- Uniform algebraic control of a pair and a linear bound for its difference. -/ |
| 121 | structure PairBound (k : ℕ) (f g : ℝ → ℝ) (B C ε : ℝ) : Prop where |
| 122 | smooth_left : ContDiffOn ℝ ∞ f J |
| 123 | smooth_right : ContDiffOn ℝ ∞ g J |
| 124 | left : Bound k f B |
| 125 | right : Bound k g B |
| 126 | difference : Bound k (fun η => g η - f η) (C * ε) |
| 127 | |
| 128 | |
| 129 | |
| 130 | namespace PairBound |
| 131 | |
| 132 | variable {k : ℕ} {f g u v : ℝ → ℝ} {A B C D ε : ℝ} |
| 133 | |
| 134 | theorem mono (h : PairBound k f g A C ε) {A' C' : ℝ} |
| 135 | (ha : A ≤ A') (hc : C ≤ C') (hε : 0 ≤ ε) : PairBound k f g A' C' ε := |
| 136 | ⟨h.smooth_left, h.smooth_right, h.left.mono ha, h.right.mono ha, |
| 137 | h.difference.mono (mul_le_mul_of_nonneg_right hc hε)⟩ |
| 138 | |
| 139 | theorem same (hf : ContDiffOn ℝ ∞ f J) (hb : Bound k f A) (ε : ℝ) : |
| 140 | PairBound k f f A 0 ε := by |
| 141 | refine ⟨hf, hf, hb, hb, ?_⟩ |
| 142 | simpa only [sub_self, zero_mul, abs_zero] using Bound.const k 0 |
| 143 | |
| 144 | theorem const (k : ℕ) (c ε : ℝ) : PairBound k (fun _ => c) (fun _ => c) |c| 0 ε := |
| 145 | same contDiffOn_const (Bound.const k c) ε |
| 146 | |
| 147 | theorem add (h : PairBound k f g A C ε) (i : PairBound k u v B D ε) : |
| 148 | PairBound k (fun η => f η + u η) (fun η => g η + v η) (A+B) (C+D) ε := by |
| 149 | refine ⟨h.smooth_left.add i.smooth_left, h.smooth_right.add i.smooth_right, |
| 150 | h.left.add h.smooth_left i.smooth_left i.left, |
| 151 | h.right.add h.smooth_right i.smooth_right i.right, ?_⟩ |
| 152 | have hd := h.difference.add (h.smooth_right.sub h.smooth_left) |
| 153 | (i.smooth_right.sub i.smooth_left) i.difference |
| 154 | rw [← add_mul] at hd |
| 155 | exact hd.congr (fun η _ => by ring) |
| 156 | |
| 157 | theorem sub (h : PairBound k f g A C ε) (i : PairBound k u v B D ε) : |
| 158 | PairBound k (fun η => f η - u η) (fun η => g η - v η) (A+B) (C+D) ε := by |
| 159 | refine ⟨h.smooth_left.sub i.smooth_left, h.smooth_right.sub i.smooth_right, |
| 160 | h.left.sub h.smooth_left i.smooth_left i.left, |
| 161 | h.right.sub h.smooth_right i.smooth_right i.right, ?_⟩ |
| 162 | have hd := h.difference.sub (h.smooth_right.sub h.smooth_left) |
| 163 | (i.smooth_right.sub i.smooth_left) i.difference |
| 164 | rw [← add_mul] at hd |
| 165 | exact hd.congr (fun η _ => by ring) |
| 166 | |
| 167 | theorem mul (h : PairBound k f g A C ε) (i : PairBound k u v B D ε) : |
| 168 | PairBound k (fun η => f η * u η) (fun η => g η * v η) |
| 169 | ((2 : ℝ)^k*A*B) ((2 : ℝ)^k*(C*B+A*D)) ε := by |
| 170 | refine ⟨h.smooth_left.mul i.smooth_left, h.smooth_right.mul i.smooth_right, |
| 171 | h.left.mul h.smooth_left i.smooth_left i.left, |
| 172 | h.right.mul h.smooth_right i.smooth_right i.right, ?_⟩ |
| 173 | have h₁ := h.difference.mul (h.smooth_right.sub h.smooth_left) i.smooth_right i.right |
| 174 | have h₂ := h.left.mul h.smooth_left (i.smooth_right.sub i.smooth_left) i.difference |
| 175 | have hd := h₁.add ((h.smooth_right.sub h.smooth_left).mul i.smooth_right) |
| 176 | (h.smooth_left.mul (i.smooth_right.sub i.smooth_left)) h₂ |
| 177 | convert hd.congr (fun η _ => show g η * v η - f η * u η = |
| 178 | (g η-f η)*v η+f η*(v η-u η) by ring) using 1; ring |
| 179 | |
| 180 | theorem inverse (h : PairBound k f g A C ε) {μ T : ℝ} (hμ : 0 < μ) |
| 181 | (hf : ∀ η ∈ J, μ ≤ f η) (hg : ∀ η ∈ J, μ ≤ g η) |
| 182 | (hb : ∀ z : ℝ → ℝ, ContDiffOn ℝ ∞ z J → |
| 183 | (∀ η ∈ J, μ ≤ z η) → Bound k z A → Bound k (fun η => (z η)⁻¹) T) : |
| 184 | PairBound k (fun η => (f η)⁻¹) (fun η => (g η)⁻¹) T |
| 185 | ((2 : ℝ)^k*((2 : ℝ)^k*C*T)*T) ε := by |
| 186 | have hfn : ∀ η ∈ J, f η ≠ 0 := fun η hη => (hμ.trans_le (hf η hη)).ne' |
| 187 | have hgn : ∀ η ∈ J, g η ≠ 0 := fun η hη => (hμ.trans_le (hg η hη)).ne' |
| 188 | have hfs := h.smooth_left.inv hfn |
| 189 | have hgs := h.smooth_right.inv hgn |
| 190 | have hfb := hb f h.smooth_left hf h.left |
| 191 | have hgb := hb g h.smooth_right hg h.right |
| 192 | refine ⟨hfs, hgs, hfb, hgb, ?_⟩ |
| 193 | have hd := ((h.difference.mul (h.smooth_right.sub h.smooth_left) hgs hgb).mul |
| 194 | ((h.smooth_right.sub h.smooth_left).mul hgs) hfs hfb) |
| 195 | have hd' : Bound k (fun η => -((g η-f η)*(g η)⁻¹*(f η)⁻¹)) |
| 196 | ((2 : ℝ)^k*((2 : ℝ)^k*C*T)*T*ε) := by |
| 197 | have hz := (Bound.const k 0).sub contDiffOn_const |
| 198 | (((h.smooth_right.sub h.smooth_left).mul hgs).mul hfs) hd |
| 199 | convert hz using 1 <;> first | (ext η; simp) | ring |
| 200 | exact hd'.congr (fun η hη => by field_simp [hfn η hη, hgn η hη]; ring) |
| 201 | |
| 202 | end PairBound |
| 203 | |
| 204 | theorem Bound.derivWithin {k : ℕ} {f : ℝ → ℝ} {B : ℝ} |
| 205 | (hf : Bound (k+1) f B) : Bound k (derivWithin f J) B := by |
| 206 | intro n hn η hη |
| 207 | rw [norm_iteratedFDerivWithin_eq_norm_iteratedDerivWithin, |
| 208 | ← iteratedDerivWithin_succ', ← norm_iteratedFDerivWithin_eq_norm_iteratedDerivWithin] |
| 209 | exact hf (n+1) (by omega) η hη |
| 210 | |
| 211 | theorem PairBound.derivWithin {k : ℕ} {f g : ℝ → ℝ} {B C ε : ℝ} |
| 212 | (h : PairBound (k+1) f g B C ε) : |
| 213 | PairBound k (derivWithin f J) (derivWithin g J) B C ε := by |
| 214 | refine ⟨h.smooth_left.derivWithin uniqueDiff (by simp), |
| 215 | h.smooth_right.derivWithin uniqueDiff (by simp), h.left.derivWithin, |
| 216 | h.right.derivWithin, ?_⟩ |
| 217 | apply h.difference.derivWithin.congr |
| 218 | intro η hη |
| 219 | symm |
| 220 | exact derivWithin_sub ((h.smooth_right.differentiableOn (by simp)) η hη) |
| 221 | ((h.smooth_left.differentiableOn (by simp)) η hη) |
| 222 | |
| 223 | |
| 224 | |
| 225 | theorem Bound.id (k : ℕ) : Bound k (fun η => η) 1 := by |
| 226 | intro n hn η hη |
| 227 | rw [norm_iteratedFDerivWithin_eq_norm_iteratedDerivWithin, |
| 228 | iteratedDerivWithin_fun_id hη uniqueDiff] |
| 229 | split_ifs <;> simp only [Real.norm_eq_abs, abs_one, abs_zero] |
| 230 | · exact abs_le.mpr hη |
| 231 | · exact le_rfl |
| 232 | · norm_num |
| 233 | |
| 234 | theorem Bound.of_le {k l : ℕ} {f : ℝ → ℝ} {B : ℝ} |
| 235 | (hf : Bound l f B) (hkl : k ≤ l) : Bound k f B := |
| 236 | fun n hn η hη => hf n (hn.trans hkl) η hη |
| 237 | |
| 238 | theorem PairBound.of_le {k l : ℕ} {f g : ℝ → ℝ} {B C ε : ℝ} |
| 239 | (hf : PairBound l f g B C ε) (hkl : k ≤ l) : PairBound k f g B C ε := |
| 240 | ⟨hf.smooth_left, hf.smooth_right, hf.left.of_le hkl, hf.right.of_le hkl, |
| 241 | hf.difference.of_le hkl⟩ |
| 242 | |
| 243 | /-- A finite expression made from the exact scalar additions and products. -/ |
| 244 | inductive PolynomialExpression (ι : Type) |
| 245 | | input : ι → PolynomialExpression ι |
| 246 | | constant : ℝ → PolynomialExpression ι |
| 247 | | add : PolynomialExpression ι → PolynomialExpression ι → PolynomialExpression ι |
| 248 | | sub : PolynomialExpression ι → PolynomialExpression ι → PolynomialExpression ι |
| 249 | | mul : PolynomialExpression ι → PolynomialExpression ι → PolynomialExpression ι |
| 250 | |
| 251 | namespace PolynomialExpression |
| 252 | |
| 253 | variable {ι : Type} |
| 254 | |
| 255 | def eval (x : ι → ℝ → ℝ) : PolynomialExpression ι → ℝ → ℝ |
| 256 | | input i => x i |
| 257 | | constant c => fun _ => c |
| 258 | | add p q => fun η => eval x p η + eval x q η |
| 259 | | sub p q => fun η => eval x p η - eval x q η |
| 260 | | mul p q => fun η => eval x p η * eval x q η |
| 261 | |
| 262 | def bounds (k : ℕ) (B C : ι → ℝ) : PolynomialExpression ι → ℝ × ℝ |
| 263 | | input i => (B i, C i) |
| 264 | | constant c => (|c|, 0) |
| 265 | | add p q | sub p q => ((bounds k B C p).1+(bounds k B C q).1, |
| 266 | (bounds k B C p).2+(bounds k B C q).2) |
| 267 | | mul p q => ((2 : ℝ)^k*(bounds k B C p).1*(bounds k B C q).1, |
| 268 | (2 : ℝ)^k*((bounds k B C p).2*(bounds k B C q).1+ |
| 269 | (bounds k B C p).1*(bounds k B C q).2)) |
| 270 | |
| 271 | theorem bounds_nonneg (k : ℕ) {B C : ι → ℝ} (hB : ∀ i, 0 ≤ B i) |
| 272 | (hC : ∀ i, 0 ≤ C i) (p : PolynomialExpression ι) : |
| 273 | 0 ≤ (bounds k B C p).1 ∧ 0 ≤ (bounds k B C p).2 := by |
| 274 | induction p with |
| 275 | | input i => exact ⟨hB i, hC i⟩ |
| 276 | | constant c => exact ⟨abs_nonneg c, le_rfl⟩ |
| 277 | | add p q hp hq | sub p q hp hq => exact ⟨add_nonneg hp.1 hq.1, add_nonneg hp.2 hq.2⟩ |
| 278 | | mul p q hp hq => exact ⟨mul_nonneg (mul_nonneg (by positivity) hp.1) hq.1, |
| 279 | mul_nonneg (by positivity) (add_nonneg (mul_nonneg hp.2 hq.1) (mul_nonneg hp.1 hq.2))⟩ |
| 280 | |
| 281 | theorem eval_pairBound {k : ℕ} {f g : ι → ℝ → ℝ} {B C : ι → ℝ} {ε : ℝ} |
| 282 | (h : ∀ i, PairBound k (f i) (g i) (B i) (C i) ε) (p : PolynomialExpression ι) : |
| 283 | PairBound k (p.eval f) (p.eval g) (bounds k B C p).1 (bounds k B C p).2 ε := by |
| 284 | induction p with |
| 285 | | input i => exact h i |
| 286 | | constant c => exact PairBound.const k c ε |
| 287 | | add p q hp hq => exact hp.add hq |
| 288 | | sub p q hp hq => exact hp.sub hq |
| 289 | | mul p q hp hq => exact hp.mul hq |
| 290 | |
| 291 | end PolynomialExpression |
| 292 | |
| 293 | end NavierStokes.ClosedIntervalJetAlgebra |