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 Mathlib.Analysis.Real.Sqrt |
| 2 | import Mathlib.LinearAlgebra.Matrix.NonsingularInverse |
| 3 | import Mathlib.Tactic.FieldSimp |
| 4 | import Mathlib.Tactic.FinCases |
| 5 | import Mathlib.Tactic.Linarith |
| 6 | import Mathlib.Tactic.Positivity |
| 7 | import Mathlib.Tactic.Ring |
| 8 | |
| 9 | /-! |
| 10 | # Two signed covariance slots |
| 11 | |
| 12 | The finite-dimensional algebra underlying Lemma 8.7 and equation (29) of the |
| 13 | candidate manuscript. In the orthonormal `(N,K)` coordinates, the two normalized |
| 14 | columns are `(-a,-b)` and `(-a,b)`, with positive column scales. A target `(-m,t)` |
| 15 | lies strictly between them precisely when `|a*t| < b*m`. |
| 16 | |
| 17 | The actual integrated columns in the manuscript include approximation errors. |
| 18 | This file does not identify those columns with the exact model, or prove the |
| 19 | Gaussian, parameter-derivative, or flat-edge estimates. |
| 20 | -/ |
| 21 | |
| 22 | noncomputable section |
| 23 | |
| 24 | namespace NavierStokes.Covariance |
| 25 | |
| 26 | open Matrix |
| 27 | |
| 28 | /-- The two columns, with their individual positive size factors. -/ |
| 29 | def signedMatrix (a b scaleMinus scalePlus : ℝ) : Matrix (Fin 2) (Fin 2) ℝ := |
| 30 | !![-a * scaleMinus, -a * scalePlus; |
| 31 | -b * scaleMinus, b * scalePlus] |
| 32 | |
| 33 | /-- The stress target in normal and transverse coordinates. -/ |
| 34 | def target (m t : ℝ) : Fin 2 → ℝ := ![-m, t] |
| 35 | |
| 36 | /-- Explicit squared amplitudes for the two signed slots. -/ |
| 37 | def coefficients (a b scaleMinus scalePlus m t : ℝ) : Fin 2 → ℝ := |
| 38 | ![(b * m - a * t) / (2 * a * b * scaleMinus), |
| 39 | (b * m + a * t) / (2 * a * b * scalePlus)] |
| 40 | |
| 41 | theorem determinant_formula (a b scaleMinus scalePlus : ℝ) : |
| 42 | (signedMatrix a b scaleMinus scalePlus).det = |
| 43 | -(2 * a * b * scaleMinus * scalePlus) := by |
| 44 | simp [signedMatrix, Matrix.det_fin_two] |
| 45 | ring |
| 46 | |
| 47 | theorem determinant_neg {a b scaleMinus scalePlus : ℝ} |
| 48 | (ha : 0 < a) (hb : 0 < b) |
| 49 | (hMinus : 0 < scaleMinus) (hPlus : 0 < scalePlus) : |
| 50 | (signedMatrix a b scaleMinus scalePlus).det < 0 := by |
| 51 | rw [determinant_formula] |
| 52 | have : 0 < 2 * a * b * scaleMinus * scalePlus := by positivity |
| 53 | linarith |
| 54 | |
| 55 | theorem determinant_ne_zero {a b scaleMinus scalePlus : ℝ} |
| 56 | (ha : 0 < a) (hb : 0 < b) |
| 57 | (hMinus : 0 < scaleMinus) (hPlus : 0 < scalePlus) : |
| 58 | (signedMatrix a b scaleMinus scalePlus).det ≠ 0 := |
| 59 | ne_of_lt (determinant_neg ha hb hMinus hPlus) |
| 60 | |
| 61 | /-- The explicit coefficients solve the two covariance equations exactly. -/ |
| 62 | theorem reconstruct {a b scaleMinus scalePlus : ℝ} (m t : ℝ) |
| 63 | (ha : a ≠ 0) (hb : b ≠ 0) |
| 64 | (hMinus : scaleMinus ≠ 0) (hPlus : scalePlus ≠ 0) : |
| 65 | (signedMatrix a b scaleMinus scalePlus).mulVec |
| 66 | (coefficients a b scaleMinus scalePlus m t) = target m t := by |
| 67 | ext i |
| 68 | fin_cases i <;> |
| 69 | simp [signedMatrix, coefficients, target, Matrix.mulVec, dotProduct, |
| 70 | Fin.sum_univ_two] <;> |
| 71 | field_simp <;> ring |
| 72 | |
| 73 | /-- Thus the explicit formula is the matrix inverse applied to the stress. -/ |
| 74 | theorem inverse_formula {a b scaleMinus scalePlus : ℝ} (m t : ℝ) |
| 75 | (ha : 0 < a) (hb : 0 < b) |
| 76 | (hMinus : 0 < scaleMinus) (hPlus : 0 < scalePlus) : |
| 77 | (signedMatrix a b scaleMinus scalePlus)⁻¹.mulVec (target m t) = |
| 78 | coefficients a b scaleMinus scalePlus m t := by |
| 79 | have hdet : IsUnit (signedMatrix a b scaleMinus scalePlus).det := |
| 80 | isUnit_iff_ne_zero.mpr (determinant_ne_zero ha hb hMinus hPlus) |
| 81 | rw [← reconstruct m t (ne_of_gt ha) (ne_of_gt hb) |
| 82 | (ne_of_gt hMinus) (ne_of_gt hPlus)] |
| 83 | rw [Matrix.mulVec_mulVec, Matrix.nonsing_inv_mul _ hdet, Matrix.one_mulVec] |
| 84 | |
| 85 | theorem solution_unique {a b scaleMinus scalePlus m t : ℝ} |
| 86 | (ha : 0 < a) (hb : 0 < b) |
| 87 | (hMinus : 0 < scaleMinus) (hPlus : 0 < scalePlus) |
| 88 | (y : Fin 2 → ℝ) |
| 89 | (hy : (signedMatrix a b scaleMinus scalePlus).mulVec y = target m t) : |
| 90 | y = coefficients a b scaleMinus scalePlus m t := by |
| 91 | have hdet : IsUnit (signedMatrix a b scaleMinus scalePlus).det := |
| 92 | isUnit_iff_ne_zero.mpr (determinant_ne_zero ha hb hMinus hPlus) |
| 93 | calc |
| 94 | y = (signedMatrix a b scaleMinus scalePlus)⁻¹.mulVec |
| 95 | ((signedMatrix a b scaleMinus scalePlus).mulVec y) := by |
| 96 | rw [Matrix.mulVec_mulVec, Matrix.nonsing_inv_mul _ hdet, Matrix.one_mulVec] |
| 97 | _ = (signedMatrix a b scaleMinus scalePlus)⁻¹.mulVec (target m t) := by rw [hy] |
| 98 | _ = coefficients a b scaleMinus scalePlus m t := |
| 99 | inverse_formula m t ha hb hMinus hPlus |
| 100 | |
| 101 | /-- A strict geometric cone condition makes both squared amplitudes positive. -/ |
| 102 | theorem coefficients_pos {a b scaleMinus scalePlus m t : ℝ} |
| 103 | (ha : 0 < a) (hb : 0 < b) |
| 104 | (hMinus : 0 < scaleMinus) (hPlus : 0 < scalePlus) |
| 105 | (hcone : |a * t| < b * m) : |
| 106 | ∀ i, 0 < coefficients a b scaleMinus scalePlus m t i := by |
| 107 | have hc := abs_lt.mp hcone |
| 108 | intro i |
| 109 | fin_cases i |
| 110 | · change 0 < (b * m - a * t) / (2 * a * b * scaleMinus) |
| 111 | exact div_pos (by linarith) (by positivity) |
| 112 | · change 0 < (b * m + a * t) / (2 * a * b * scalePlus) |
| 113 | exact div_pos (by linarith) (by positivity) |
| 114 | |
| 115 | /-- The same strict cone condition is necessary as well as sufficient. -/ |
| 116 | theorem coefficients_pos_iff {a b scaleMinus scalePlus m t : ℝ} |
| 117 | (ha : 0 < a) (hb : 0 < b) |
| 118 | (hMinus : 0 < scaleMinus) (hPlus : 0 < scalePlus) : |
| 119 | (∀ i, 0 < coefficients a b scaleMinus scalePlus m t i) ↔ |a * t| < b * m := by |
| 120 | constructor |
| 121 | · intro hy |
| 122 | have hm : 0 < 2 * a * b * scaleMinus := by positivity |
| 123 | have hp : 0 < 2 * a * b * scalePlus := by positivity |
| 124 | have hnMinus : 0 < b * m - a * t := |
| 125 | (div_pos_iff_of_pos_right hm).mp (by simpa [coefficients] using hy 0) |
| 126 | have hnPlus : 0 < b * m + a * t := |
| 127 | (div_pos_iff_of_pos_right hp).mp (by simpa [coefficients] using hy 1) |
| 128 | exact abs_lt.mpr ⟨by linarith, by linarith⟩ |
| 129 | · exact coefficients_pos ha hb hMinus hPlus |
| 130 | |
| 131 | /-- The primary velocity amplitudes are positive square roots of the solve. -/ |
| 132 | def amplitudes (a b scaleMinus scalePlus m t : ℝ) : Fin 2 → ℝ := |
| 133 | fun i => Real.sqrt (coefficients a b scaleMinus scalePlus m t i) |
| 134 | |
| 135 | theorem amplitudes_pos {a b scaleMinus scalePlus m t : ℝ} |
| 136 | (ha : 0 < a) (hb : 0 < b) |
| 137 | (hMinus : 0 < scaleMinus) (hPlus : 0 < scalePlus) |
| 138 | (hcone : |a * t| < b * m) : |
| 139 | ∀ i, 0 < amplitudes a b scaleMinus scalePlus m t i := by |
| 140 | intro i |
| 141 | exact Real.sqrt_pos.mpr (coefficients_pos ha hb hMinus hPlus hcone i) |
| 142 | |
| 143 | theorem amplitudes_sq {a b scaleMinus scalePlus m t : ℝ} |
| 144 | (ha : 0 < a) (hb : 0 < b) |
| 145 | (hMinus : 0 < scaleMinus) (hPlus : 0 < scalePlus) |
| 146 | (hcone : |a * t| < b * m) : |
| 147 | (fun i => (amplitudes a b scaleMinus scalePlus m t i) ^ 2) = |
| 148 | coefficients a b scaleMinus scalePlus m t := by |
| 149 | funext i |
| 150 | exact Real.sq_sqrt (le_of_lt (coefficients_pos ha hb hMinus hPlus hcone i)) |
| 151 | |
| 152 | /-- Squared positive velocity amplitudes reproduce the exact model covariance. -/ |
| 153 | theorem reconstruct_from_amplitudes {a b scaleMinus scalePlus m t : ℝ} |
| 154 | (ha : 0 < a) (hb : 0 < b) |
| 155 | (hMinus : 0 < scaleMinus) (hPlus : 0 < scalePlus) |
| 156 | (hcone : |a * t| < b * m) : |
| 157 | (signedMatrix a b scaleMinus scalePlus).mulVec |
| 158 | (fun i => (amplitudes a b scaleMinus scalePlus m t i) ^ 2) = target m t := by |
| 159 | rw [amplitudes_sq ha hb hMinus hPlus hcone] |
| 160 | exact reconstruct m t (ne_of_gt ha) (ne_of_gt hb) (ne_of_gt hMinus) (ne_of_gt hPlus) |
| 161 | |
| 162 | /-- The square-root viscosity factor and any common partition mask in (29) |
| 163 | produce precisely the expected factor `ε * mask^2` in covariance. -/ |
| 164 | theorem scaled_primary_covariance {a b scaleMinus scalePlus m t ε : ℝ} |
| 165 | (mask : ℝ) (hε : 0 ≤ ε) |
| 166 | (ha : 0 < a) (hb : 0 < b) |
| 167 | (hMinus : 0 < scaleMinus) (hPlus : 0 < scalePlus) |
| 168 | (hcone : |a * t| < b * m) : |
| 169 | (signedMatrix a b scaleMinus scalePlus).mulVec |
| 170 | (fun i => (Real.sqrt ε * amplitudes a b scaleMinus scalePlus m t i * mask) ^ 2) = |
| 171 | (ε * mask ^ 2) • target m t := by |
| 172 | have hsq : |
| 173 | (fun i => (Real.sqrt ε * amplitudes a b scaleMinus scalePlus m t i * mask) ^ 2) = |
| 174 | (ε * mask ^ 2) • (fun i => (amplitudes a b scaleMinus scalePlus m t i) ^ 2) := by |
| 175 | funext i |
| 176 | simp only [Pi.smul_apply, smul_eq_mul, mul_pow, Real.sq_sqrt hε] |
| 177 | ring |
| 178 | rw [hsq, Matrix.mulVec_smul, reconstruct_from_amplitudes ha hb hMinus hPlus hcone] |
| 179 | |
| 180 | /-- Positive normal magnitude in the manuscript's signed directions. -/ |
| 181 | def normalMagnitude (c u : ℝ) : ℝ := -c * Real.sqrt (1 + u ^ 2) |
| 182 | |
| 183 | theorem normalMagnitude_pos {c u : ℝ} (hc : c < 0) : 0 < normalMagnitude c u := by |
| 184 | unfold normalMagnitude |
| 185 | exact mul_pos (neg_pos.mpr hc) (Real.sqrt_pos.mpr (by nlinarith [sq_nonneg u])) |
| 186 | |
| 187 | /-- The manuscript's strict ratio choice for `u_*` implies the exact cone test. -/ |
| 188 | theorem cone_of_ratio {c u m t : ℝ} (hm : 0 < m) |
| 189 | (hratio : |c * t / m| < u / Real.sqrt (1 + u ^ 2)) : |
| 190 | |normalMagnitude c u * t| < u * m := by |
| 191 | have hs : 0 < Real.sqrt (1 + u ^ 2) := |
| 192 | Real.sqrt_pos.mpr (by nlinarith [sq_nonneg u]) |
| 193 | have hr : |c * t| / m < u / Real.sqrt (1 + u ^ 2) := by |
| 194 | simpa only [abs_div, abs_of_pos hm] using hratio |
| 195 | have hcross : |c * t| * Real.sqrt (1 + u ^ 2) < u * m := |
| 196 | (div_lt_div_iff₀ hm hs).mp hr |
| 197 | calc |
| 198 | |normalMagnitude c u * t| = |c * t| * Real.sqrt (1 + u ^ 2) := by |
| 199 | rw [show normalMagnitude c u * t = -(c * t) * Real.sqrt (1 + u ^ 2) by |
| 200 | unfold normalMagnitude |
| 201 | ring] |
| 202 | rw [abs_mul, abs_neg, abs_of_pos hs] |
| 203 | _ < u * m := hcross |
| 204 | |
| 205 | /-- The exact signed-slot model has positive primary amplitudes under the |
| 206 | ratio condition stated in Section 8.3. This asserts no analytic error bound. -/ |
| 207 | theorem positive_primary {c u scaleMinus scalePlus m t : ℝ} |
| 208 | (hc : c < 0) (hu : 0 < u) (hm : 0 < m) |
| 209 | (hMinus : 0 < scaleMinus) (hPlus : 0 < scalePlus) |
| 210 | (hratio : |c * t / m| < u / Real.sqrt (1 + u ^ 2)) : |
| 211 | ∃ velocity : Fin 2 → ℝ, |
| 212 | (∀ i, 0 < velocity i) ∧ |
| 213 | (signedMatrix (normalMagnitude c u) u scaleMinus scalePlus).mulVec |
| 214 | (fun i => (velocity i) ^ 2) = target m t := by |
| 215 | refine ⟨amplitudes (normalMagnitude c u) u scaleMinus scalePlus m t, ?_, ?_⟩ |
| 216 | · exact amplitudes_pos (normalMagnitude_pos hc) hu hMinus hPlus |
| 217 | (cone_of_ratio hm hratio) |
| 218 | · exact reconstruct_from_amplitudes (normalMagnitude_pos hc) hu hMinus hPlus |
| 219 | (cone_of_ratio hm hratio) |
| 220 | |
| 221 | end NavierStokes.Covariance |