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.MeanVectorIdentities |
| 2 | import Euler.MeanScalarProductDerivatives |
| 3 | |
| 4 | /-! The ordinary curl identity for the Euler convection term on ℝ³. -/ |
| 5 | |
| 6 | noncomputable section |
| 7 | |
| 8 | namespace EulerComparatorCurlTransport |
| 9 | |
| 10 | open InnerProductSpace EulerSmoothLimit EulerVectorCalculus EulerMeanCutoffCurl |
| 11 | EulerMeanHarmonic EulerMeanVectorIdentities EulerMeanBoundary |
| 12 | open scoped ContDiff |
| 13 | |
| 14 | theorem fderiv_apply_coordinate_sum (f : Space → Space) (hf : ContDiff ℝ ∞ f) |
| 15 | (x v : Space) (i : Fin 3) : |
| 16 | (fderiv ℝ f x v) i = |
| 17 | ∑ j : Fin 3, v j * partialDerivative (fun y => f y i) j x := by |
| 18 | rw [← fderiv_coordinate f x (hf.differentiable (by simp)).differentiableAt i v] |
| 19 | have hre : ∑ j : Fin 3, v j • (EuclideanSpace.single j 1 : Space) = v := by |
| 20 | simpa only [EuclideanSpace.basisFun_repr, EuclideanSpace.basisFun_apply] using |
| 21 | (EuclideanSpace.basisFun (Fin 3) ℝ).sum_repr v |
| 22 | calc |
| 23 | _ = fderiv ℝ (fun y => f y i) x |
| 24 | (∑ j : Fin 3, v j • EuclideanSpace.single j 1) := |
| 25 | congrArg (fderiv ℝ (fun y => f y i) x) hre.symm |
| 26 | _ = _ := by simp only [map_sum, map_smul, smul_eq_mul, partialDerivative] |
| 27 | |
| 28 | /-- Curl of the material convection term, including the compressible correction. -/ |
| 29 | theorem vectorCurl_convection (u : Space → Space) (hu : ContDiff ℝ ∞ u) (x : Space) : |
| 30 | vectorCurl (fun y => fderiv ℝ u y (u y)) x = |
| 31 | fderiv ℝ (vectorCurl u) x (u x) - fderiv ℝ u x (vectorCurl u x) + |
| 32 | divergence u x • vectorCurl u x := by |
| 33 | have hc (i : Fin 3) : ContDiff ℝ ∞ (fun y => u y i) := (contDiff_piLp 2).mp hu i |
| 34 | have hp (i j : Fin 3) : ContDiff ℝ ∞ (partialDerivative (fun y => u y i) j) := |
| 35 | contDiff_partialDerivative _ (hc i) j |
| 36 | have hconv (i : Fin 3) : |
| 37 | (fun y => (fderiv ℝ u y (u y)) i) = |
| 38 | fun y => ∑ j : Fin 3, u y j * partialDerivative (fun z => u z i) j y := by |
| 39 | funext y |
| 40 | exact fderiv_apply_coordinate_sum u hu y (u y) i |
| 41 | have hconvpart (i k : Fin 3) : |
| 42 | partialDerivative (fun y => (fderiv ℝ u y (u y)) i) k x = |
| 43 | ∑ j : Fin 3, |
| 44 | (partialDerivative (fun y => u y i) j x * |
| 45 | partialDerivative (fun y => u y j) k x + |
| 46 | u x j * partialDerivative (partialDerivative (fun y => u y i) j) k x) := by |
| 47 | rw [hconv i, partialDerivative_sum _ (fun j => (hc j).mul (hp i j))] |
| 48 | apply Finset.sum_congr rfl |
| 49 | intro j _ |
| 50 | exact EulerMeanHarmonic.partialDerivative_mul |
| 51 | ((hc j).differentiable (by simp)).differentiableAt |
| 52 | ((hp i j).differentiable (by simp)).differentiableAt k |
| 53 | have hcurlpart (i k : Fin 3) : |
| 54 | partialDerivative (fun y => vectorCurl u y i) k x = |
| 55 | partialDerivative (partialDerivative (fun y => u y (i+2)) (i+1)) k x - |
| 56 | partialDerivative (partialDerivative (fun y => u y (i+1)) (i+2)) k x := by |
| 57 | simp only [vectorCurl, curl_apply] |
| 58 | exact EulerMeanVectorIdentities.partialDerivative_sub _ _ (hp _ _) (hp _ _) k x |
| 59 | have hcomm01 (a : Fin 3) : |
| 60 | partialDerivative (partialDerivative (fun y => u y a) 0) 1 x = |
| 61 | partialDerivative (partialDerivative (fun y => u y a) 1) 0 x := |
| 62 | partialDerivative_comm _ ((hc a).of_le (by simp)) 0 1 x |
| 63 | have hcomm02 (a : Fin 3) : |
| 64 | partialDerivative (partialDerivative (fun y => u y a) 0) 2 x = |
| 65 | partialDerivative (partialDerivative (fun y => u y a) 2) 0 x := |
| 66 | partialDerivative_comm _ ((hc a).of_le (by simp)) 0 2 x |
| 67 | have hcomm12 (a : Fin 3) : |
| 68 | partialDerivative (partialDerivative (fun y => u y a) 1) 2 x = |
| 69 | partialDerivative (partialDerivative (fun y => u y a) 2) 1 x := |
| 70 | partialDerivative_comm _ ((hc a).of_le (by simp)) 1 2 x |
| 71 | ext i |
| 72 | simp only [PiLp.add_apply, PiLp.sub_apply, PiLp.smul_apply, smul_eq_mul] |
| 73 | rw [fderiv_apply_coordinate_sum (vectorCurl u) (vectorCurl_smooth u hu) x (u x) i, |
| 74 | fderiv_apply_coordinate_sum u hu x (vectorCurl u x) i] |
| 75 | simp only [hcurlpart, divergence_coordinate_sum u hu] |
| 76 | conv_lhs => simp only [vectorCurl, curl_apply] |
| 77 | rw [hconvpart, hconvpart] |
| 78 | simp only [vectorCurl, curl_apply] |
| 79 | fin_cases i <;> |
| 80 | norm_num [Fin.sum_univ_three, Fin.add_def] <;> |
| 81 | simp only [show (⟨2, by decide⟩ : Fin 3) = 2 from rfl] <;> |
| 82 | simp only [hcomm01, hcomm02, hcomm12] <;> ring! |
| 83 | |
| 84 | /-- The form of curl transport used for incompressible Euler. -/ |
| 85 | theorem vectorCurl_convection_of_divergence_zero (u : Space → Space) |
| 86 | (hu : ContDiff ℝ ∞ u) (x : Space) (hdiv : divergence u x = 0) : |
| 87 | vectorCurl (fun y => fderiv ℝ u y (u y)) x = |
| 88 | fderiv ℝ (vectorCurl u) x (u x) - fderiv ℝ u x (vectorCurl u x) := by |
| 89 | simpa only [hdiv, zero_smul, add_zero] using vectorCurl_convection u hu x |
| 90 | |
| 91 | /-- Ordinary gradients have zero ordinary curl. -/ |
| 92 | theorem vectorCurl_gradient_zero (p : Space → ℝ) (hp : ContDiff ℝ ∞ p) (x : Space) : |
| 93 | vectorCurl (gradient p) x = 0 := by |
| 94 | ext i |
| 95 | simp only [vectorCurl, curl_apply, gradient_coordinate, PiLp.zero_apply] |
| 96 | exact sub_eq_zero.mpr (partialDerivative_comm p (hp.of_le (by simp)) (i+2) (i+1) x) |
| 97 | |
| 98 | theorem vectorCurl_neg (f : Space → Space) (hf : Differentiable ℝ f) : |
| 99 | vectorCurl (-f) = -vectorCurl f := by |
| 100 | simpa only [neg_one_smul] using vectorCurl_smul (-1) f hf |
| 101 | |
| 102 | theorem vectorCurl_sub (f g : Space → Space) |
| 103 | (hf : Differentiable ℝ f) (hg : Differentiable ℝ g) : |
| 104 | vectorCurl (f-g) = vectorCurl f - vectorCurl g := by |
| 105 | rw [sub_eq_add_neg, vectorCurl_add f (-g) hf hg.neg, vectorCurl_neg g hg, |
| 106 | sub_eq_add_neg] |
| 107 | |
| 108 | /-- Taking curl removes pressure and gives the Euler vorticity right-hand side. -/ |
| 109 | theorem vectorCurl_euler_rhs (u : Space → Space) (p : Space → ℝ) |
| 110 | (hu : ContDiff ℝ ∞ u) (hp : ContDiff ℝ ∞ p) (x : Space) |
| 111 | (hdiv : divergence u x = 0) : |
| 112 | vectorCurl (fun y => -fderiv ℝ u y (u y) - gradient p y) x = |
| 113 | fderiv ℝ u x (vectorCurl u x) - fderiv ℝ (vectorCurl u) x (u x) := by |
| 114 | have hc : Differentiable ℝ (fun y => fderiv ℝ u y (u y)) := |
| 115 | ((hu.fderiv_right (m := ∞) (by simp)).clm_apply hu).differentiable (by simp) |
| 116 | have hpg : Differentiable ℝ (gradient p) := |
| 117 | (EulerMeanSolenoidal.contDiff_gradient hp).differentiable (by simp) |
| 118 | change vectorCurl (-(fun y => fderiv ℝ u y (u y)) - gradient p) x = _ |
| 119 | rw [vectorCurl_sub _ _ hc.neg hpg, vectorCurl_neg _ hc] |
| 120 | simp only [Pi.sub_apply, Pi.neg_apply, vectorCurl_gradient_zero p hp x, |
| 121 | vectorCurl_convection_of_divergence_zero u hu x hdiv, sub_zero, neg_sub] |
| 122 | |
| 123 | end EulerComparatorCurlTransport |