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.R3SpaceTimeCalculus |
| 2 | import NavierStokes.R3CompactEnergy |
| 3 | import NavierStokes.R3CompactParametricIntegral |
| 4 | |
| 5 | /-! |
| 6 | # Cutoff vector tests and continuity of the physical flux |
| 7 | -/ |
| 8 | |
| 9 | noncomputable section |
| 10 | namespace NavierStokes.R3CutoffTestFields |
| 11 | |
| 12 | open Set Filter MeasureTheory ProblemStatement |
| 13 | open R3SpaceTime R3WeakPressure R3SpaceTimeCalculus R3CompactEnergy |
| 14 | open scoped ContDiff |
| 15 | |
| 16 | def weightedVelocity (χ : Space → ℝ) (w : VelocityField) : VelocityField := |
| 17 | fun tx => χ tx.2 • w tx |
| 18 | |
| 19 | theorem weightedVelocity_smooth {s : Set ℝ} {χ : Space → ℝ} {w : VelocityField} |
| 20 | (hχ : ContDiff ℝ ∞ χ) (hw : ContDiffOn ℝ ∞ w (s ×ˢ (univ : Set Space))) : |
| 21 | ContDiffOn ℝ ∞ (weightedVelocity χ w) (s ×ˢ (univ : Set Space)) := |
| 22 | (hχ.comp contDiff_snd).contDiffOn.smul hw |
| 23 | |
| 24 | theorem divergence_weighted {χ : Space → ℝ} {w : VelocityField} {t : ℝ} |
| 25 | (hχ : ContDiff ℝ ∞ χ) (hw : ContDiff ℝ ∞ (fun x : Space => w (t, x))) (x : Space) : |
| 26 | spatialDivergence (weightedVelocity χ w) t x = |
| 27 | fderiv ℝ χ x (w (t, x)) + χ x * spatialDivergence w t x := by |
| 28 | have he : spatialDerivative (weightedVelocity χ w) t x = |
| 29 | χ x • fderiv ℝ (fun y => w (t, y)) x + (fderiv ℝ χ x).smulRight (w (t, x)) := |
| 30 | ((hχ.differentiable (by simp) x).hasFDerivAt.smul (hw.differentiable (by simp) x).hasFDerivAt).fderiv |
| 31 | unfold spatialDivergence |
| 32 | rw [PeriodicUniqueness.fderiv_apply_eq_sum] |
| 33 | simp only [he, add_apply, smul_apply, ContinuousLinearMap.smulRight_apply, |
| 34 | PiLp.add_apply, PiLp.smul_apply, smul_eq_mul, Finset.sum_add_distrib, ← Finset.mul_sum] |
| 35 | have hh : (∑ i : Fin 3, fderiv ℝ χ x (coordinateVector i) * w (t, x) i) = |
| 36 | ∑ i : Fin 3, w (t, x) i * fderiv ℝ χ x (coordinateVector i) := by |
| 37 | apply Finset.sum_congr rfl |
| 38 | intro i _ |
| 39 | ring |
| 40 | rw [hh] |
| 41 | dsimp only [spatialDerivative] |
| 42 | ring |
| 43 | |
| 44 | theorem test_divergence {s : Set ℝ} (hs : IsOpen s) {χ : Space → ℝ} {w : VelocityField} |
| 45 | (hχ : ContDiff ℝ ∞ χ) (hw : ContDiffOn ℝ ∞ w (s ×ˢ (univ : Set Space))) |
| 46 | (hd : ∀ t ∈ s, ∀ x, spatialDivergence w t x = 0) {t : ℝ} (ht : t ∈ s) (x : Space) : |
| 47 | functionDivergence (liftVelocity (weightedVelocity χ w)) (pack t x) = |
| 48 | (fderiv ℝ χ x (w (t, x)) : ℝ) := by |
| 49 | rw [liftVelocity_divergence hs (weightedVelocity_smooth hχ hw) ht, |
| 50 | divergence_weighted hχ (slice_smooth hw ht), hd t ht x, mul_zero, add_zero] |
| 51 | |
| 52 | theorem test_support (χ : Space → ℝ) (w : VelocityField) (i : Fin 3) (z : Domain) |
| 53 | (hx : spaceProj z ∉ tsupport χ) : liftVelocity (weightedVelocity χ w) i z = 0 := by |
| 54 | simp [liftVelocity, liftScalar, weightedVelocity, image_eq_zero_of_notMem_tsupport hx] |
| 55 | |
| 56 | theorem spatialDerivative_joint {w : VelocityField} {t : ℝ} {x : Space} |
| 57 | (hw : DifferentiableAt ℝ w (t, x)) : |
| 58 | spatialDerivative w t x = (fderiv ℝ w (t, x)).comp (ContinuousLinearMap.inr ℝ ℝ Space) := |
| 59 | (hw.hasFDerivAt.comp x (hasFDerivAt_prodMk_right t x)).fderiv |
| 60 | |
| 61 | theorem spatialPartial_continuousOn {s : Set ℝ} (hs : IsOpen s) {w : VelocityField} |
| 62 | (hw : ContDiffOn ℝ ∞ w (s ×ˢ (univ : Set Space))) (i : Fin 3) : |
| 63 | ContinuousOn (fun tx : SpaceTime => spatialDerivative w tx.1 tx.2 (coordinateVector i)) |
| 64 | (s ×ˢ (univ : Set Space)) := by |
| 65 | have hc := (hw.continuousOn_fderiv_of_isOpen (hs.prod isOpen_univ) (by simp)).clm_apply |
| 66 | (show ContinuousOn (fun _ : SpaceTime => ((0 : ℝ), coordinateVector i)) (s ×ˢ univ) from continuousOn_const) |
| 67 | apply hc.congr |
| 68 | intro tx htx |
| 69 | have hd := (hw.contDiffAt ((hs.prod isOpen_univ).mem_nhds htx)).differentiableAt (by simp) |
| 70 | dsimp only |
| 71 | rw [spatialDerivative_joint hd] |
| 72 | rfl |
| 73 | |
| 74 | theorem dissipation_continuousOn {s : Set ℝ} (hs : IsOpen s) {χ : Space → ℝ} {w : VelocityField} |
| 75 | (hχ : Continuous χ) (hc : HasCompactSupport χ) |
| 76 | (hw : ContDiffOn ℝ ∞ w (s ×ˢ (univ : Set Space))) : |
| 77 | ContinuousOn (fun t => dissipation χ (fun x => w (t, x))) s := by |
| 78 | apply continuousOn_finsetSum |
| 79 | intro i _ |
| 80 | apply R3CompactParametricIntegral.integral_continuousOn_open hs hc |
| 81 | ((hχ.comp continuous_snd).continuousOn.mul ((spatialPartial_continuousOn hs hw i).norm.pow 2)) |
| 82 | intro t ht x hx |
| 83 | simp [image_eq_zero_of_notMem_tsupport hx] |
| 84 | |
| 85 | theorem pressureFlux_continuousOn {s : Set ℝ} (hs : IsOpen s) {χ : Space → ℝ} |
| 86 | {w : VelocityField} {p : PressureField} (hχ : ContDiff ℝ ∞ χ) (hc : HasCompactSupport χ) |
| 87 | (hw : ContDiffOn ℝ ∞ w (s ×ˢ (univ : Set Space))) |
| 88 | (hp : ContDiffOn ℝ ∞ p (s ×ˢ (univ : Set Space))) : |
| 89 | ContinuousOn (fun t => pressureFlux χ (fun x => w (t, x)) (fun x => p (t, x))) s := by |
| 90 | have hD : ContinuousOn (fun tx : SpaceTime => fderiv ℝ χ tx.2 (w tx)) (s ×ˢ univ) := |
| 91 | (((hχ.continuous_fderiv (by simp)).comp continuous_snd).continuousOn).clm_apply hw.continuousOn |
| 92 | apply R3CompactParametricIntegral.integral_continuousOn_open hs hc (hD.mul hp.continuousOn) |
| 93 | intro t ht x hx |
| 94 | simp [fderiv_of_notMem_tsupport ℝ hx] |
| 95 | |
| 96 | end NavierStokes.R3CutoffTestFields |