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.MeanCurlTensor |
| 2 | import Euler.MeanHarmonicDerivatives |
| 3 | |
| 4 | /-! Ordinary smooth vector-calculus identities with the canonical Mathlib Laplacian. -/ |
| 5 | |
| 6 | noncomputable section |
| 7 | |
| 8 | namespace EulerMeanVectorIdentities |
| 9 | |
| 10 | open MeasureTheory InnerProductSpace Laplacian EulerSmoothLimit EulerVectorCalculus |
| 11 | EulerMeanSolenoidal EulerMeanCutoffCurl EulerMeanGradientTest EulerMeanHarmonic |
| 12 | open scoped ContDiff |
| 13 | |
| 14 | def vectorPartial (f : Space → Space) (i : Fin 3) (x : Space) : Space := |
| 15 | fderiv ℝ f x (EuclideanSpace.single i 1) |
| 16 | |
| 17 | theorem vectorPartial_smooth (f : Space → Space) (hf : ContDiff ℝ ∞ f) (i : Fin 3) : |
| 18 | ContDiff ℝ ∞ (vectorPartial f i) := |
| 19 | (hf.fderiv_right (m := ∞) (by simp)).clm_apply contDiff_const |
| 20 | |
| 21 | theorem vectorPartial_compact (f : Space → Space) (hc : HasCompactSupport f) (i : Fin 3) : |
| 22 | HasCompactSupport (vectorPartial f i) := hc.fderiv_apply ℝ (EuclideanSpace.single i 1) |
| 23 | |
| 24 | theorem vectorPartial_apply (f : Space → Space) (hf : ContDiff ℝ ∞ f) |
| 25 | (i j : Fin 3) (x : Space) : |
| 26 | vectorPartial f i x j = partialDerivative (fun y => f y j) i x := |
| 27 | (fderiv_coordinate f x ((hf.differentiable (by simp)).differentiableAt) |
| 28 | j (EuclideanSpace.single i 1)).symm |
| 29 | |
| 30 | theorem vector_laplacian_coordinate (f : Space → Space) (hf : ContDiff ℝ ∞ f) |
| 31 | (x : Space) (i : Fin 3) : |
| 32 | (Δ f x) i = Δ (fun y => f y i) x := by |
| 33 | have h2 : ContDiffAt ℝ 2 f x := (hf.of_le (by simp)).contDiffAt |
| 34 | exact (h2.laplacian_CLM_comp_left (l := EuclideanSpace.proj i)).symm |
| 35 | |
| 36 | theorem vector_laplacian_eq_sum (f : Space → Space) (hf : ContDiff ℝ ∞ f) : |
| 37 | Δ f = fun x => ∑ i : Fin 3, vectorPartial (vectorPartial f i) i x := by |
| 38 | funext x |
| 39 | rw [laplacian_eq_iteratedFDeriv_orthonormalBasis f (EuclideanSpace.basisFun (Fin 3) ℝ)] |
| 40 | apply Finset.sum_congr rfl |
| 41 | intro i _ |
| 42 | have hdf : DifferentiableAt ℝ (fderiv ℝ f) x := |
| 43 | ((hf.fderiv_right (m := ∞) (by simp)).differentiable (by simp)).differentiableAt |
| 44 | simp only [EuclideanSpace.basisFun_apply, iteratedFDeriv_two_apply, Matrix.cons_val_zero, |
| 45 | Matrix.cons_val_one, vectorPartial] |
| 46 | change _ = (fderiv ℝ (fun y => fderiv ℝ f y (EuclideanSpace.single i 1)) x) |
| 47 | (EuclideanSpace.single i 1) |
| 48 | rw [fderiv_clm_apply hdf (differentiableAt_const _)] |
| 49 | simp |
| 50 | |
| 51 | theorem vector_laplacian_smooth (f : Space → Space) (hf : ContDiff ℝ ∞ f) : |
| 52 | ContDiff ℝ ∞ (Δ f) := by |
| 53 | rw [vector_laplacian_eq_sum f hf] |
| 54 | exact ContDiff.sum (fun i _ => vectorPartial_smooth _ (vectorPartial_smooth f hf i) i) |
| 55 | |
| 56 | theorem vector_laplacian_compact (f : Space → Space) (hf : ContDiff ℝ ∞ f) |
| 57 | (hc : HasCompactSupport f) : HasCompactSupport (Δ f) := by |
| 58 | rw [vector_laplacian_eq_sum f hf] |
| 59 | simp only [Fin.sum_univ_three] |
| 60 | exact ((vectorPartial_compact _ (vectorPartial_compact f hc 0) 0).add |
| 61 | (vectorPartial_compact _ (vectorPartial_compact f hc 1) 1)).add |
| 62 | (vectorPartial_compact _ (vectorPartial_compact f hc 2) 2) |
| 63 | |
| 64 | theorem vectorCurl_smooth (f : Space → Space) (hf : ContDiff ℝ ∞ f) : |
| 65 | ContDiff ℝ ∞ (vectorCurl f) := contDiff_curl _ ((contDiff_piLp 2).mp hf) |
| 66 | |
| 67 | theorem vectorCurl_support (f : Space → Space) : tsupport (vectorCurl f) ⊆ tsupport f := |
| 68 | tsupport_curl_subset _ _ (isClosed_tsupport f) |
| 69 | (fun i => tsupport_comp_subset (g := fun v : Space => v i) rfl f) |
| 70 | |
| 71 | theorem vectorCurl_compact (f : Space → Space) (hc : HasCompactSupport f) : |
| 72 | HasCompactSupport (vectorCurl f) := hc.of_isClosed_subset |
| 73 | (isClosed_tsupport _) (vectorCurl_support f) |
| 74 | |
| 75 | def curlTest (f : Test) : Test := |
| 76 | ⟨vectorCurl (f : Space → Space), vectorCurl_smooth f f.smooth, vectorCurl_compact f f.compact⟩ |
| 77 | |
| 78 | def laplacianTest (f : Test) : Test := |
| 79 | ⟨Δ (f : Space → Space), vector_laplacian_smooth f f.smooth, |
| 80 | vector_laplacian_compact f f.smooth f.compact⟩ |
| 81 | |
| 82 | theorem divergence_coordinate_sum (f : Space → Space) (hf : ContDiff ℝ ∞ f) : |
| 83 | divergence f = fun x => ∑ i : Fin 3, partialDerivative (fun y => f y i) i x := by |
| 84 | funext x |
| 85 | rw [divergence_eq_coordinate_sum] |
| 86 | apply Finset.sum_congr rfl |
| 87 | intro i _ |
| 88 | exact (fderiv_coordinate f x ((hf.differentiable (by simp)).differentiableAt) |
| 89 | i (EuclideanSpace.single i 1)).symm |
| 90 | |
| 91 | theorem divergence_smooth (f : Space → Space) (hf : ContDiff ℝ ∞ f) : |
| 92 | ContDiff ℝ ∞ (divergence f) := by |
| 93 | rw [divergence_coordinate_sum f hf] |
| 94 | exact ContDiff.sum (fun i _ => contDiff_partialDerivative _ ((contDiff_piLp 2).mp hf i) i) |
| 95 | |
| 96 | theorem partialDerivative_sub (f g : Space → ℝ) (hf : ContDiff ℝ ∞ f) |
| 97 | (hg : ContDiff ℝ ∞ g) (i : Fin 3) (x : Space) : |
| 98 | partialDerivative (fun y => f y - g y) i x = partialDerivative f i x - partialDerivative g i x := by |
| 99 | unfold partialDerivative |
| 100 | rw [fderiv_fun_sub ((hf.differentiable (by simp)).differentiableAt) |
| 101 | ((hg.differentiable (by simp)).differentiableAt)] |
| 102 | rfl |
| 103 | |
| 104 | /-- The classical curl-curl identity, with genuine Fréchet derivatives and canonical Laplacian. -/ |
| 105 | theorem vectorCurl_vectorCurl (f : Space → Space) (hf : ContDiff ℝ ∞ f) : |
| 106 | vectorCurl (vectorCurl f) = gradient (divergence f) - Δ f := by |
| 107 | have hc (i : Fin 3) : ContDiff ℝ ∞ (fun y => f y i) := (contDiff_piLp 2).mp hf i |
| 108 | have hsub (a b c d e : Fin 3) (x : Space) : |
| 109 | partialDerivative (fun y => partialDerivative (fun z => f z a) b y - |
| 110 | partialDerivative (fun z => f z c) d y) e x = |
| 111 | partialDerivative (partialDerivative (fun z => f z a) b) e x - |
| 112 | partialDerivative (partialDerivative (fun z => f z c) d) e x := |
| 113 | partialDerivative_sub _ _ (contDiff_partialDerivative _ (hc a) b) |
| 114 | (contDiff_partialDerivative _ (hc c) d) e x |
| 115 | have hcomm (a i j : Fin 3) (x : Space) : |
| 116 | partialDerivative (partialDerivative (fun z => f z a) i) j x = |
| 117 | partialDerivative (partialDerivative (fun z => f z a) j) i x := |
| 118 | partialDerivative_comm _ ((hc a).of_le (by simp)) i j x |
| 119 | funext x |
| 120 | let d (a i j : Fin 3) := partialDerivative (partialDerivative (fun z => f z a) i) j x |
| 121 | ext i |
| 122 | simp only [Pi.sub_apply, PiLp.sub_apply, gradient_coordinate, vector_laplacian_coordinate f hf, |
| 123 | divergence_coordinate_sum f hf, |
| 124 | partialDerivative_sum _ (fun j => contDiff_partialDerivative _ (hc j) j), |
| 125 | laplacian_eq_coordinate_sum _ (hc i), vectorCurl, curl_apply, hsub] |
| 126 | fin_cases i |
| 127 | · norm_num [Fin.sum_univ_three, Fin.add_def] |
| 128 | change d 1 0 1 - d 0 1 1 - (d 0 2 2 - d 2 0 2) = |
| 129 | d 0 0 0 + d 1 1 0 + d 2 2 0 - (d 0 0 0 + d 0 1 1 + d 0 2 2) |
| 130 | have h₁ : d 1 0 1 = d 1 1 0 := hcomm 1 0 1 x |
| 131 | have h₂ : d 2 0 2 = d 2 2 0 := hcomm 2 0 2 x |
| 132 | linarith |
| 133 | · norm_num [Fin.sum_univ_three, Fin.add_def] |
| 134 | change d 2 1 2 - d 1 2 2 - (d 1 0 0 - d 0 1 0) = |
| 135 | d 0 0 1 + d 1 1 1 + d 2 2 1 - (d 1 0 0 + d 1 1 1 + d 1 2 2) |
| 136 | have h₁ : d 0 1 0 = d 0 0 1 := hcomm 0 1 0 x |
| 137 | have h₂ : d 2 1 2 = d 2 2 1 := hcomm 2 1 2 x |
| 138 | linarith |
| 139 | · norm_num [Fin.sum_univ_three, Fin.add_def] |
| 140 | change d 0 2 0 - d 2 0 0 - (d 2 1 1 - d 1 2 1) = |
| 141 | d 0 0 2 + d 1 1 2 + d 2 2 2 - (d 2 0 0 + d 2 1 1 + d 2 2 2) |
| 142 | have h₁ : d 0 2 0 = d 0 0 2 := hcomm 0 2 0 x |
| 143 | have h₂ : d 1 2 1 = d 1 1 2 := hcomm 1 2 1 x |
| 144 | linarith |
| 145 | |
| 146 | theorem divergence_compact (f : Space → Space) (hf : ContDiff ℝ ∞ f) |
| 147 | (hc : HasCompactSupport f) : HasCompactSupport (divergence f) := by |
| 148 | rw [divergence_coordinate_sum f hf] |
| 149 | have hpart (i : Fin 3) : HasCompactSupport (partialDerivative (fun y => f y i) i) := |
| 150 | (hc.comp_left (g := fun v : Space => v i) rfl).fderiv_apply ℝ (EuclideanSpace.single i 1) |
| 151 | simp only [Fin.sum_univ_three] |
| 152 | change HasCompactSupport (partialDerivative (fun y => f y 0) 0 + |
| 153 | partialDerivative (fun y => f y 1) 1 + partialDerivative (fun y => f y 2) 2) |
| 154 | exact ((hpart 0).add (hpart 1)).add (hpart 2) |
| 155 | |
| 156 | /-- The ordinary curl commutes with the canonical vector-valued Laplacian. -/ |
| 157 | theorem laplacian_vectorCurl (f : Space → Space) (hf : ContDiff ℝ ∞ f) : |
| 158 | Δ (vectorCurl f) = vectorCurl (Δ f) := by |
| 159 | have hc (i : Fin 3) : ContDiff ℝ ∞ (fun y => f y i) := (contDiff_piLp 2).mp hf i |
| 160 | have heq (i : Fin 3) : (fun y => (Δ f y) i) = Δ (fun y => f y i) := |
| 161 | funext fun y => vector_laplacian_coordinate f hf y i |
| 162 | funext x |
| 163 | ext i |
| 164 | rw [vector_laplacian_coordinate _ (vectorCurl_smooth f hf)] |
| 165 | change Δ (partialDerivative (fun y => f y (i+2)) (i+1) - |
| 166 | partialDerivative (fun y => f y (i+1)) (i+2)) x = |
| 167 | partialDerivative (fun y => (Δ f y) (i+2)) (i+1) x - |
| 168 | partialDerivative (fun y => (Δ f y) (i+1)) (i+2) x |
| 169 | rw [((contDiff_partialDerivative _ (hc (i+2)) (i+1)).of_le (by simp)).contDiffAt.laplacian_sub |
| 170 | ((contDiff_partialDerivative _ (hc (i+1)) (i+2)).of_le (by simp)).contDiffAt] |
| 171 | simp only [laplacian_partialDerivative _ (hc _), heq] |
| 172 | |
| 173 | end EulerMeanVectorIdentities |