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.AxisymmetricFields |
| 2 | import Mathlib.Tactic.Ring |
| 3 | |
| 4 | /-! |
| 5 | # Cartesian Navier--Stokes residual in regular axisymmetric coordinates |
| 6 | |
| 7 | Every derivative below is an ordinary Fréchet derivative. The coordinate is |
| 8 | `s=(x₀²+x₁²)/2`, so none of the formulas divide by the cylindrical radius. |
| 9 | -/ |
| 10 | |
| 11 | noncomputable section |
| 12 | |
| 13 | namespace NavierStokes.AxisymmetricResidual |
| 14 | |
| 15 | open ProblemStatement AxisymmetricFields |
| 16 | open scoped BigOperators ContDiff |
| 17 | |
| 18 | def pack (a b c : ℝ) : Space := |
| 19 | a • coordinateVector 0 + b • coordinateVector 1 + c • coordinateVector 2 |
| 20 | |
| 21 | @[simp] theorem pack_zero (a b c : ℝ) : pack a b c 0 = a := by |
| 22 | simp [pack, coordinateVector] |
| 23 | @[simp] theorem pack_one (a b c : ℝ) : pack a b c 1 = b := by |
| 24 | simp [pack, coordinateVector] |
| 25 | @[simp] theorem pack_two (a b c : ℝ) : pack a b c 2 = c := by |
| 26 | simp [pack, coordinateVector] |
| 27 | |
| 28 | def packDerivative {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] |
| 29 | (a b c : E →L[ℝ] ℝ) : E →L[ℝ] Space := |
| 30 | a.smulRight (coordinateVector 0) + b.smulRight (coordinateVector 1) + |
| 31 | c.smulRight (coordinateVector 2) |
| 32 | |
| 33 | @[simp] theorem packDerivative_apply {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] |
| 34 | (a b c : E →L[ℝ] ℝ) (v : E) : packDerivative a b c v = pack (a v) (b v) (c v) := rfl |
| 35 | |
| 36 | theorem hasFDerivAt_pack {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] |
| 37 | {a b c : E → ℝ} {da db dc : E →L[ℝ] ℝ} {x : E} |
| 38 | (ha : HasFDerivAt a da x) (hb : HasFDerivAt b db x) (hc : HasFDerivAt c dc x) : |
| 39 | HasFDerivAt (fun y => pack (a y) (b y) (c y)) (packDerivative da db dc) x := |
| 40 | ((ha.smul_const _).add (hb.smul_const _)).add (hc.smul_const _) |
| 41 | |
| 42 | theorem fderiv_pack_apply {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] |
| 43 | {a b c : E → ℝ} {x : E} (ha : DifferentiableAt ℝ a x) |
| 44 | (hb : DifferentiableAt ℝ b x) (hc : DifferentiableAt ℝ c x) (v : E) : |
| 45 | fderiv ℝ (fun y => pack (a y) (b y) (c y)) x v = |
| 46 | pack (fderiv ℝ a x v) (fderiv ℝ b x v) (fderiv ℝ c x v) := by |
| 47 | rw [(hasFDerivAt_pack ha.hasFDerivAt hb.hasFDerivAt hc.hasFDerivAt).fderiv] |
| 48 | rfl |
| 49 | |
| 50 | def direction (g : Space → ℝ) (i : Fin 3) (x : Space) : ℝ := |
| 51 | fderiv ℝ g x (coordinateVector i) |
| 52 | |
| 53 | def scalarLaplacian (g : Space → ℝ) (x : Space) : ℝ := |
| 54 | ∑ i : Fin 3, direction (fun y => direction g i y) i x |
| 55 | |
| 56 | def vectorLaplacian (g : Space → Space) (x : Space) : Space := |
| 57 | ∑ i : Fin 3, fderiv ℝ (fun y => fderiv ℝ g y (coordinateVector i)) x (coordinateVector i) |
| 58 | |
| 59 | theorem direction_add {a b : Space → ℝ} (ha : Differentiable ℝ a) |
| 60 | (hb : Differentiable ℝ b) (i : Fin 3) (x : Space) : |
| 61 | direction (fun y => a y + b y) i x = direction a i x + direction b i x := by |
| 62 | unfold direction |
| 63 | rw [fderiv_fun_add (ha x) (hb x)] |
| 64 | rfl |
| 65 | |
| 66 | theorem direction_neg (a : Space → ℝ) (i : Fin 3) (x : Space) : |
| 67 | direction (fun y => -a y) i x = -direction a i x := by |
| 68 | simp [direction] |
| 69 | |
| 70 | theorem scalarLaplacian_neg (a : Space → ℝ) (x : Space) : |
| 71 | scalarLaplacian (fun y => -a y) x = -scalarLaplacian a x := by |
| 72 | simp only [scalarLaplacian, direction_neg, Finset.sum_neg_distrib] |
| 73 | |
| 74 | def lift (G : Profile) (t : ℝ) (x : Space) : ℝ := G (profilePoint t x) |
| 75 | |
| 76 | /-- Joint differentiability is needed only along the spatial slice being evaluated. -/ |
| 77 | def SliceDifferentiable (G : Profile) (t : ℝ) : Prop := |
| 78 | ∀ x : Space, DifferentiableAt ℝ G (profilePoint t x) |
| 79 | |
| 80 | /-- No smooth extension across the singular time is required by this hypothesis. -/ |
| 81 | def SliceC2 (G : Profile) (t : ℝ) : Prop := |
| 82 | ∀ x : Space, ContDiffAt ℝ 2 G (profilePoint t x) |
| 83 | |
| 84 | theorem SliceC2.differentiable {G : Profile} {t : ℝ} (hG : SliceC2 G t) : |
| 85 | SliceDifferentiable G t := fun x => (hG x).differentiableAt (by norm_num) |
| 86 | |
| 87 | def partialT (G : Profile) (p : ProfilePoint) : ℝ := fderiv ℝ G p (1, (0, 0)) |
| 88 | def laplaceScalar (G : Profile) (p : ProfilePoint) : ℝ := |
| 89 | 2 * p.2.1 * partialS (partialS G) p + 2 * partialS G p + partialZ (partialZ G) p |
| 90 | def laplaceWeighted (G : Profile) (p : ProfilePoint) : ℝ := |
| 91 | 2 * p.2.1 * partialS (partialS G) p + 4 * partialS G p + partialZ (partialZ G) p |
| 92 | |
| 93 | def componentX (B F : Profile) (t : ℝ) (x : Space) : ℝ := |
| 94 | -(x 0 * lift B t x + x 1 * lift F t x) |
| 95 | def componentY (B F : Profile) (t : ℝ) (x : Space) : ℝ := |
| 96 | x 0 * lift F t x - x 1 * lift B t x |
| 97 | |
| 98 | /-- Convention: radial velocity `-r B`, angular velocity `r F`, axial velocity `U`. -/ |
| 99 | def velocity (B F U : Profile) : VelocityField := |
| 100 | fun w => pack (componentX B F w.1 w.2) (componentY B F w.1 w.2) (lift U w.1 w.2) |
| 101 | def pressure (P : Profile) : PressureField := fun w => lift P w.1 w.2 |
| 102 | |
| 103 | def velocityJacobian (B F U : Profile) (t : ℝ) (x : Space) : Space →L[ℝ] Space := |
| 104 | packDerivative |
| 105 | (-(x 0 • profileDerivative B t x + lift B t x • projection 0 + |
| 106 | (x 1 • profileDerivative F t x + lift F t x • projection 1))) |
| 107 | ((x 0 • profileDerivative F t x + lift F t x • projection 0) - |
| 108 | (x 1 • profileDerivative B t x + lift B t x • projection 1)) |
| 109 | (profileDerivative U t x) |
| 110 | |
| 111 | def advectionRadial (B F U : Profile) (p : ProfilePoint) : ℝ := |
| 112 | (B p) ^ 2 - (F p) ^ 2 + 2 * p.2.1 * B p * partialS B p - U p * partialZ B p |
| 113 | def advectionAngular (B F U : Profile) (p : ProfilePoint) : ℝ := |
| 114 | 2 * B p * F p + 2 * p.2.1 * B p * partialS F p - U p * partialZ F p |
| 115 | def advectionAxial (B U : Profile) (p : ProfilePoint) : ℝ := |
| 116 | -2 * p.2.1 * B p * partialS U p + U p * partialZ U p |
| 117 | |
| 118 | def timeProfileJacobian : ℝ →L[ℝ] ProfilePoint := |
| 119 | (ContinuousLinearMap.id ℝ ℝ).prod (0 : ℝ →L[ℝ] ℝ × ℝ) |
| 120 | def timeProfileDerivative (G : Profile) (p : ProfilePoint) : ℝ →L[ℝ] ℝ := |
| 121 | (fderiv ℝ G p).comp timeProfileJacobian |
| 122 | |
| 123 | @[simp] theorem timeProfileDerivative_one (G : Profile) (p : ProfilePoint) : |
| 124 | timeProfileDerivative G p 1 = partialT G p := rfl |
| 125 | |
| 126 | def residualRadial (B F U P : Profile) (p : ProfilePoint) : ℝ := |
| 127 | -partialT B p + advectionRadial B F U p + laplaceWeighted B p + partialS P p |
| 128 | def residualAngular (B F U : Profile) (p : ProfilePoint) : ℝ := |
| 129 | -partialT F p + advectionAngular B F U p + laplaceWeighted F p |
| 130 | def residualAxial (B U P : Profile) (p : ProfilePoint) : ℝ := |
| 131 | partialT U p + advectionAxial B U p - laplaceScalar U p + partialZ P p |
| 132 | |
| 133 | def fromPotentialB (H : Profile) (p : ProfilePoint) : ℝ := partialZ H p / 2 |
| 134 | def fromPotentialF (K : Profile) (p : ProfilePoint) : ℝ := -partialS K p |
| 135 | def fromPotentialU (H : Profile) (p : ProfilePoint) : ℝ := H p + p.2.1 * partialS H p |
| 136 | |
| 137 | /-- Connect the residual convention to the already constructed curl field. -/ |
| 138 | theorem velocity_from_potential_at (H K : Profile) (t : ℝ) (x : Space) |
| 139 | (hH : DifferentiableAt ℝ H (profilePoint t x)) |
| 140 | (hK : DifferentiableAt ℝ K (profilePoint t x)) : |
| 141 | AxisymmetricFields.velocity H K (t, x) = |
| 142 | velocity (fromPotentialB H) (fromPotentialF K) (fromPotentialU H) (t, x) := by |
| 143 | ext i |
| 144 | fin_cases i |
| 145 | · change AxisymmetricFields.velocity H K (t, x) 0 = _ |
| 146 | rw [AxisymmetricFields.velocity_zero H K t x hH hK] |
| 147 | simp [velocity, componentX, lift, fromPotentialB, fromPotentialF] |
| 148 | ring |
| 149 | · change AxisymmetricFields.velocity H K (t, x) 1 = _ |
| 150 | rw [AxisymmetricFields.velocity_one H K t x hH hK] |
| 151 | simp [velocity, componentY, lift, fromPotentialB, fromPotentialF] |
| 152 | ring |
| 153 | · change AxisymmetricFields.velocity H K (t, x) 2 = _ |
| 154 | rw [AxisymmetricFields.velocity_two H K t x hH hK] |
| 155 | simp [velocity, lift, fromPotentialU, profilePoint] |
| 156 | |
| 157 | end NavierStokes.AxisymmetricResidual |