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.Calculus.TangentCone.Prod |
| 2 | import NavierStokes.ProblemStatement |
| 3 | import NavierStokes.PeriodicIntegration |
| 4 | import Mathlib.Analysis.InnerProductSpace.Calculus |
| 5 | import Mathlib.Analysis.Calculus.Deriv.MeanValue |
| 6 | import Mathlib.Analysis.SpecialFunctions.ExpDeriv |
| 7 | import Mathlib.Algebra.Ring.Periodic |
| 8 | import Mathlib.Algebra.Order.Floor.Ring |
| 9 | import Mathlib.Tactic.Abel |
| 10 | import Mathlib.Tactic.Linarith |
| 11 | import Mathlib.Tactic.Ring |
| 12 | |
| 13 | /-! |
| 14 | # Classical uniqueness for periodic Navier--Stokes fields |
| 15 | |
| 16 | The differential operators are those of `ProblemStatement`. The energy |
| 17 | estimate is derived from the equations and periodic integration by parts. |
| 18 | -/ |
| 19 | |
| 20 | noncomputable section |
| 21 | |
| 22 | open Set Filter |
| 23 | open scoped Topology BigOperators ContDiff InnerProductSpace |
| 24 | |
| 25 | namespace NavierStokes.PeriodicUniqueness |
| 26 | |
| 27 | open ProblemStatement |
| 28 | |
| 29 | private theorem nat_le_infty (n : ℕ) : (n : WithTop ℕ∞) ≤ ∞ := |
| 30 | (ENat.natCast_lt_of_coe_top_le_withTop le_rfl n).le |
| 31 | |
| 32 | private theorem infty_add_one_le : (∞ : WithTop ℕ∞) + 1 ≤ ∞ := by |
| 33 | simpa only [ENat.coe_top_add_one] using (le_rfl : (∞ : WithTop ℕ∞) ≤ ∞) |
| 34 | |
| 35 | noncomputable def slab (a b : ℝ) : Set SpaceTime := Icc a b ×ˢ univ |
| 36 | |
| 37 | theorem spatial_smooth {V : Type*} [NormedAddCommGroup V] [NormedSpace ℝ V] |
| 38 | {a b t : ℝ} {u : SpaceTime → V} (hu : ContDiffOn ℝ ∞ u (slab a b)) |
| 39 | (ht : t ∈ Icc a b) : ContDiff ℝ ∞ (fun x : Space => u (t, x)) := |
| 40 | hu.comp_contDiff (contDiff_const.prodMk contDiff_id) |
| 41 | (fun x => show (t, x) ∈ slab a b from ⟨ht, mem_univ x⟩) |
| 42 | |
| 43 | theorem smooth_at_interior {V : Type*} [NormedAddCommGroup V] [NormedSpace ℝ V] |
| 44 | {a b t : ℝ} {u : SpaceTime → V} (hu : ContDiffOn ℝ ∞ u (slab a b)) |
| 45 | (ht : t ∈ Ioo a b) (x : Space) : ContDiffAt ℝ ∞ u (t, x) := |
| 46 | hu.contDiffAt (prod_mem_nhds (Icc_mem_nhds ht.1 ht.2) Filter.univ_mem) |
| 47 | |
| 48 | theorem spatialDerivative_sub {u v : VelocityField} {t : ℝ} |
| 49 | (hu : ContDiff ℝ ∞ (fun x : Space => u (t, x))) |
| 50 | (hv : ContDiff ℝ ∞ (fun x : Space => v (t, x))) (x : Space) : |
| 51 | spatialDerivative (u - v) t x = spatialDerivative u t x - spatialDerivative v t x := |
| 52 | fderiv_fun_sub (hu.differentiable (by simp) x) |
| 53 | (hv.differentiable (by simp) x) |
| 54 | |
| 55 | theorem spatialDivergence_sub {u v : VelocityField} {t : ℝ} |
| 56 | (hu : ContDiff ℝ ∞ (fun x : Space => u (t, x))) |
| 57 | (hv : ContDiff ℝ ∞ (fun x : Space => v (t, x))) (x : Space) : |
| 58 | spatialDivergence (u - v) t x = spatialDivergence u t x - spatialDivergence v t x := by |
| 59 | simp only [spatialDivergence, spatialDerivative_sub hu hv, |
| 60 | _root_.sub_apply, PiLp.sub_apply, Finset.sum_sub_distrib] |
| 61 | |
| 62 | theorem advection_difference {u v : VelocityField} {t : ℝ} |
| 63 | (hu : ContDiff ℝ ∞ (fun x : Space => u (t, x))) |
| 64 | (hv : ContDiff ℝ ∞ (fun x : Space => v (t, x))) (x : Space) : |
| 65 | advection u t x - advection v t x = |
| 66 | spatialDerivative u t x ((u - v) (t, x)) + |
| 67 | spatialDerivative (u - v) t x (v (t, x)) := by |
| 68 | simp only [advection, spatialDerivative_sub hu hv, Pi.sub_apply, |
| 69 | map_sub, _root_.sub_apply] |
| 70 | abel |
| 71 | |
| 72 | theorem spatialLaplacian_sub {u v : VelocityField} {t : ℝ} |
| 73 | (hu : ContDiff ℝ ∞ (fun x : Space => u (t, x))) |
| 74 | (hv : ContDiff ℝ ∞ (fun x : Space => v (t, x))) (x : Space) : |
| 75 | spatialLaplacian (u - v) t x = spatialLaplacian u t x - spatialLaplacian v t x := by |
| 76 | unfold spatialLaplacian |
| 77 | simp_rw [spatialDerivative_sub hu hv, _root_.sub_apply] |
| 78 | rw [← Finset.sum_sub_distrib] |
| 79 | apply Finset.sum_congr rfl |
| 80 | intro i _ |
| 81 | have hdu := ((hu.fderiv_right infty_add_one_le).clm_apply |
| 82 | (contDiff_const : ContDiff ℝ ∞ (fun _ : Space => coordinateVector i))).differentiable |
| 83 | (by simp) x |
| 84 | have hdv := ((hv.fderiv_right infty_add_one_le).clm_apply |
| 85 | (contDiff_const : ContDiff ℝ ∞ (fun _ : Space => coordinateVector i))).differentiable |
| 86 | (by simp) x |
| 87 | dsimp only [spatialDerivative] |
| 88 | rw [fderiv_fun_sub hdu hdv] |
| 89 | rfl |
| 90 | |
| 91 | theorem pressureGradient_sub {p q : PressureField} {t : ℝ} |
| 92 | (hp : ContDiff ℝ ∞ (fun x : Space => p (t, x))) |
| 93 | (hq : ContDiff ℝ ∞ (fun x : Space => q (t, x))) (x : Space) : |
| 94 | pressureGradient (p - q) t x = pressureGradient p t x - pressureGradient q t x := by |
| 95 | unfold pressureGradient |
| 96 | have hderiv := fderiv_fun_sub (hp.differentiable (by simp) x) |
| 97 | (hq.differentiable (by simp) x) |
| 98 | simp only [Pi.sub_apply, hderiv, _root_.sub_apply, sub_smul, |
| 99 | Finset.sum_sub_distrib] |
| 100 | |
| 101 | theorem temporalDerivative_sub {u v : VelocityField} {t : ℝ} {x : Space} |
| 102 | (hu : DifferentiableAt ℝ (fun s : ℝ => u (s, x)) t) |
| 103 | (hv : DifferentiableAt ℝ (fun s : ℝ => v (s, x)) t) : |
| 104 | temporalDerivative (u - v) t x = temporalDerivative u t x - temporalDerivative v t x := by |
| 105 | unfold temporalDerivative |
| 106 | rw [show (fun s => (u - v) (s, x)) = (fun s => u (s, x) - v (s, x)) from rfl, |
| 107 | fderiv_fun_sub hu hv] |
| 108 | rfl |
| 109 | |
| 110 | /-- Subtract the actual Navier--Stokes residuals, retaining the favorable |
| 111 | transport decomposition `Du(w) + Dw(v)`. -/ |
| 112 | theorem difference_equation {u v : VelocityField} {p q : PressureField} {t : ℝ} {x : Space} |
| 113 | (hu : ContDiff ℝ ∞ (fun y : Space => u (t, y))) |
| 114 | (hv : ContDiff ℝ ∞ (fun y : Space => v (t, y))) |
| 115 | (hp : ContDiff ℝ ∞ (fun y : Space => p (t, y))) |
| 116 | (hq : ContDiff ℝ ∞ (fun y : Space => q (t, y))) |
| 117 | (htu : DifferentiableAt ℝ (fun s : ℝ => u (s, x)) t) |
| 118 | (htv : DifferentiableAt ℝ (fun s : ℝ => v (s, x)) t) |
| 119 | (hNS : navierStokesResidual u p t x = navierStokesResidual v q t x) : |
| 120 | temporalDerivative (u - v) t x = spatialLaplacian (u - v) t x - |
| 121 | spatialDerivative u t x ((u - v) (t, x)) - |
| 122 | spatialDerivative (u - v) t x (v (t, x)) - pressureGradient (p - q) t x := by |
| 123 | have ha := advection_difference hu hv x |
| 124 | rw [temporalDerivative_sub htu htv, spatialLaplacian_sub hu hv, |
| 125 | pressureGradient_sub hp hq] |
| 126 | unfold navierStokesResidual at hNS |
| 127 | have heq := sub_eq_zero.mpr hNS |
| 128 | rw [show temporalDerivative u t x + advection u t x - spatialLaplacian u t x + |
| 129 | pressureGradient p t x - |
| 130 | (temporalDerivative v t x + advection v t x - spatialLaplacian v t x + |
| 131 | pressureGradient q t x) = |
| 132 | temporalDerivative u t x - temporalDerivative v t x + |
| 133 | (advection u t x - advection v t x) - |
| 134 | (spatialLaplacian u t x - spatialLaplacian v t x) + |
| 135 | (pressureGradient p t x - pressureGradient q t x) by abel, ha] at heq |
| 136 | apply sub_eq_zero.mp |
| 137 | convert! heq using 1 |
| 138 | abel |
| 139 | |
| 140 | /-- The only indefinite energy term is controlled by the operator norm of |
| 141 | the first velocity gradient. -/ |
| 142 | theorem nonlinear_energy_bound (A : Space →L[ℝ] Space) (w : Space) {B : ℝ} |
| 143 | (hB : ‖A‖ ≤ B) : -⟪w, A w⟫_ℝ ≤ B * ‖w‖ ^ 2 := by |
| 144 | calc |
| 145 | -⟪w, A w⟫_ℝ ≤ |⟪w, A w⟫_ℝ| := neg_le_abs _ |
| 146 | _ ≤ ‖w‖ * ‖A w‖ := abs_real_inner_le_norm _ _ |
| 147 | _ ≤ ‖w‖ * (‖A‖ * ‖w‖) := mul_le_mul_of_nonneg_left (A.le_opNorm w) (norm_nonneg w) |
| 148 | _ ≤ ‖w‖ * (B * ‖w‖) := mul_le_mul_of_nonneg_left |
| 149 | (mul_le_mul_of_nonneg_right hB (norm_nonneg w)) (norm_nonneg w) |
| 150 | _ = B * ‖w‖ ^ 2 := by ring |
| 151 | |
| 152 | /-- The zero-initial-data Gronwall conclusion, proved by the integrating |
| 153 | factor and mean-value theorem. Only interior derivatives are required. -/ |
| 154 | theorem gronwall_zero {a b K : ℝ} {E E' : ℝ → ℝ} (hab : a ≤ b) |
| 155 | (hcont : ContinuousOn E (Icc a b)) (hinitial : E a = 0) |
| 156 | (hnonneg : ∀ t ∈ Icc a b, 0 ≤ E t) |
| 157 | (hderiv : ∀ t ∈ Ioo a b, HasDerivAt E (E' t) t) |
| 158 | (hbound : ∀ t ∈ Ioo a b, E' t ≤ K * E t) : |
| 159 | ∀ t ∈ Icc a b, E t = 0 := by |
| 160 | let G : ℝ → ℝ := fun t => Real.exp (-K * t) * E t |
| 161 | let G' : ℝ → ℝ := fun t => Real.exp (-K * t) * (E' t - K * E t) |
| 162 | have hgcont : ContinuousOn G (Icc a b) := |
| 163 | (Real.continuous_exp.comp (continuous_const.mul continuous_id)).continuousOn.mul hcont |
| 164 | have hgderiv (t : ℝ) (ht : t ∈ Ioo a b) : HasDerivAt G (G' t) t := by |
| 165 | have hexp := ((hasDerivAt_id t).const_mul (-K)).exp |
| 166 | convert! hexp.mul (hderiv t ht) using 1 |
| 167 | dsimp [G, G'] |
| 168 | ring |
| 169 | have hG : AntitoneOn G (Icc a b) := by |
| 170 | apply antitoneOn_of_hasDerivWithinAt_nonpos (convex_Icc a b) hgcont |
| 171 | · intro t ht |
| 172 | exact (hgderiv t (by simpa only [interior_Icc] using ht)).hasDerivWithinAt |
| 173 | · intro t ht |
| 174 | exact mul_nonpos_of_nonneg_of_nonpos (Real.exp_pos _).le |
| 175 | (sub_nonpos.mpr (hbound t (by simpa only [interior_Icc] using ht))) |
| 176 | intro t ht |
| 177 | have hle := hG ⟨le_rfl, hab⟩ ht ht.1 |
| 178 | have hGzero : G a = 0 := by simp [G, hinitial] |
| 179 | rw [hGzero] at hle |
| 180 | have hE : E t ≤ 0 := by |
| 181 | dsimp only [G] at hle |
| 182 | nlinarith [Real.exp_pos (-K * t)] |
| 183 | exact le_antisymm hE (hnonneg t ht) |
| 184 | |
| 185 | /-- The ordinary spatial derivative at a time endpoint is the restriction |
| 186 | of the joint within-derivative to spatial directions. -/ |
| 187 | theorem spatialDerivative_eq_within_comp {a b t : ℝ} {u : VelocityField} |
| 188 | (hu : ContDiffOn ℝ ∞ u (slab a b)) (ht : t ∈ Icc a b) (x : Space) : |
| 189 | spatialDerivative u t x = |
| 190 | (fderivWithin ℝ u (slab a b) (t, x)).comp (ContinuousLinearMap.inr ℝ ℝ Space) := by |
| 191 | have hd := (hu.differentiableOn (by simp) (t, x) ⟨ht, mem_univ x⟩).hasFDerivWithinAt |
| 192 | have hs := hd.comp x (s := univ) (hasFDerivAt_prodMk_right t x).hasFDerivWithinAt |
| 193 | (fun y _ => show (t, y) ∈ slab a b from ⟨ht, mem_univ y⟩) |
| 194 | have hs' : HasFDerivAt (fun y : Space => u (t, y)) |
| 195 | ((fderivWithin ℝ u (slab a b) (t, x)).comp |
| 196 | (ContinuousLinearMap.inr ℝ ℝ Space)) x := by |
| 197 | simpa only [Function.comp_def, hasFDerivWithinAt_univ] using hs |
| 198 | exact hs'.fderiv |
| 199 | |
| 200 | /-- Compactness supplies the spatial-gradient bound used by the energy |
| 201 | estimate; it is a conclusion from smoothness, not an input to uniqueness. -/ |
| 202 | theorem exists_gradient_bound {a b : ℝ} (hab : a < b) {u : VelocityField} |
| 203 | (hu : ContDiffOn ℝ ∞ u (slab a b)) {K : Set Space} (hK : IsCompact K) : |
| 204 | ∃ B : ℝ, 0 < B ∧ ∀ t ∈ Icc a b, ∀ x ∈ K, ‖spatialDerivative u t x‖ ≤ B := by |
| 205 | have hs : UniqueDiffOn ℝ (slab a b) := (uniqueDiffOn_Icc hab).prod uniqueDiffOn_univ |
| 206 | have hD := (hu.fderivWithin hs infty_add_one_le).continuousOn |
| 207 | have hDK : ContinuousOn (fderivWithin ℝ u (slab a b)) (Icc a b ×ˢ K) := |
| 208 | hD.mono (fun z hz => ⟨hz.1, mem_univ z.2⟩) |
| 209 | obtain ⟨B, hBpos, hB⟩ := ((isCompact_Icc.prod hK).image_of_continuousOn hDK).isBounded.exists_pos_norm_le |
| 210 | refine ⟨B, hBpos, ?_⟩ |
| 211 | intro t ht x hx |
| 212 | apply ContinuousLinearMap.opNorm_le_bound _ hBpos.le |
| 213 | intro w |
| 214 | rw [spatialDerivative_eq_within_comp hu ht x, ContinuousLinearMap.comp_apply, |
| 215 | ContinuousLinearMap.inr_apply] |
| 216 | calc |
| 217 | ‖(fderivWithin ℝ u (slab a b) (t, x)) (0, w)‖ ≤ |
| 218 | ‖fderivWithin ℝ u (slab a b) (t, x)‖ * ‖((0 : ℝ), w)‖ := |
| 219 | (fderivWithin ℝ u (slab a b) (t, x)).le_opNorm _ |
| 220 | _ ≤ B * ‖((0 : ℝ), w)‖ := mul_le_mul_of_nonneg_right |
| 221 | (hB _ ⟨(t, x), ⟨ht, hx⟩, rfl⟩) (norm_nonneg _) |
| 222 | _ = B * ‖w‖ := by simp |
| 223 | |
| 224 | /-- Reconstruction in the standard Euclidean coordinate basis. -/ |
| 225 | theorem sum_coordinates (x : Space) : |
| 226 | (∑ i : Fin 3, x i • coordinateVector i) = x := by |
| 227 | apply (EuclideanSpace.equiv (Fin 3) ℝ).injective |
| 228 | ext j |
| 229 | change (EuclideanSpace.proj j) (∑ i : Fin 3, x i • coordinateVector i) = x j |
| 230 | simp only [map_sum, map_smul] |
| 231 | simp [coordinateVector] |
| 232 | |
| 233 | /-- Unit coordinate periods imply invariance under every integer lattice |
| 234 | translation; no quotient or fundamental-domain claim is assumed. -/ |
| 235 | theorem periodic_lattice {W : Type*} {f : Space → W} |
| 236 | (hf : ∀ i : Fin 3, Function.Periodic f (coordinateVector i)) |
| 237 | (n : Fin 3 → ℤ) : Function.Periodic f (∑ i : Fin 3, n i • coordinateVector i) := by |
| 238 | have hsum (s : Finset (Fin 3)) : Function.Periodic f (∑ i ∈ s, n i • coordinateVector i) := by |
| 239 | induction s using Finset.induction_on with |
| 240 | | empty => simp [Function.Periodic] |
| 241 | | @insert i s his ih => |
| 242 | simpa only [Finset.sum_insert his] using ((hf i).zsmul (n i)).add_period ih |
| 243 | simpa using hsum Finset.univ |
| 244 | |
| 245 | /-- Each point has a representative in the unit cube with the same value |
| 246 | under every function having the three unit coordinate periods. -/ |
| 247 | theorem exists_cube_representative {W : Type*} {f : Space → W} |
| 248 | (hf : ∀ i : Fin 3, Function.Periodic f (coordinateVector i)) (x : Space) : |
| 249 | ∃ y : Space, (∀ i : Fin 3, y i ∈ Icc (0 : ℝ) 1) ∧ f y = f x := by |
| 250 | let y : Space := (EuclideanSpace.equiv (Fin 3) ℝ).symm (fun i => Int.fract (x i)) |
| 251 | have hy : ∀ i : Fin 3, y i ∈ Icc (0 : ℝ) 1 := fun i => |
| 252 | ⟨Int.fract_nonneg (x i), (Int.fract_lt_one (x i)).le⟩ |
| 253 | refine ⟨y, hy, ?_⟩ |
| 254 | have hxy : x = y + ∑ i : Fin 3, (⌊x i⌋ : ℤ) • coordinateVector i := by |
| 255 | apply (EuclideanSpace.equiv (Fin 3) ℝ).injective |
| 256 | ext j |
| 257 | change x j = (EuclideanSpace.proj j) (y + ∑ i : Fin 3, (⌊x i⌋ : ℤ) • coordinateVector i) |
| 258 | simp only [map_add, map_sum, map_zsmul] |
| 259 | simp [y, coordinateVector, Int.fract_add_floor] |
| 260 | have hp := periodic_lattice hf (fun i => ⌊x i⌋) |
| 261 | rw [hxy] |
| 262 | exact (hp y).symm |
| 263 | |
| 264 | theorem periodic_fderiv {V : Type*} [NormedAddCommGroup V] [NormedSpace ℝ V] |
| 265 | {f : Space → V} (hp : ∀ x : Space, ∀ i : Fin 3, f (x + coordinateVector i) = f x) |
| 266 | (x : Space) (i : Fin 3) : |
| 267 | fderiv ℝ f (x + coordinateVector i) = fderiv ℝ f x := by |
| 268 | rw [← fderiv_comp_add_right (coordinateVector i)] |
| 269 | exact congrArg (fun g : Space → V => fderiv ℝ g x) (funext (fun y => hp y i)) |
| 270 | |
| 271 | theorem spatial_partial_contDiff {V : Type*} [NormedAddCommGroup V] [NormedSpace ℝ V] |
| 272 | {f : Space → V} (hf : ContDiff ℝ ∞ f) (i : Fin 3) : |
| 273 | ContDiff ℝ ∞ (fun x => fderiv ℝ f x (coordinateVector i)) := |
| 274 | (hf.fderiv_right infty_add_one_le).clm_apply contDiff_const |
| 275 | |
| 276 | theorem component_contDiff {f : Space → Space} (hf : ContDiff ℝ ∞ f) (j : Fin 3) : |
| 277 | ContDiff ℝ ∞ (fun x => f x j) := |
| 278 | (EuclideanSpace.proj j : Space →L[ℝ] ℝ).contDiff.comp hf |
| 279 | |
| 280 | theorem fderiv_component {f : Space → Space} (hf : ContDiff ℝ ∞ f) |
| 281 | (j : Fin 3) (x v : Space) : |
| 282 | fderiv ℝ (fun y => f y j) x v = fderiv ℝ f x v j := by |
| 283 | have h := ((EuclideanSpace.proj j : Space →L[ℝ] ℝ).hasFDerivAt.comp x |
| 284 | (hf.differentiable (by simp) x).hasFDerivAt).fderiv |
| 285 | exact congrArg (fun A : Space →L[ℝ] ℝ => A v) h |
| 286 | |
| 287 | theorem fderiv_apply_eq_sum (f : Space → ℝ) (x v : Space) : |
| 288 | fderiv ℝ f x v = ∑ i : Fin 3, v i * fderiv ℝ f x (coordinateVector i) := by |
| 289 | conv_lhs => rw [← sum_coordinates v] |
| 290 | simp only [map_sum, map_smul, smul_eq_mul] |
| 291 | |
| 292 | theorem fderiv_normsq {f : Space → Space} (hf : ContDiff ℝ ∞ f) (x v : Space) : |
| 293 | fderiv ℝ (fun y => ‖f y‖ ^ 2) x v = 2 * ⟪f x, fderiv ℝ f x v⟫_ℝ := by |
| 294 | rw [((hf.differentiable (by simp) x).hasFDerivAt.norm_sq).fderiv] |
| 295 | simp |
| 296 | |
| 297 | theorem fderiv_inner {f g : Space → Space} (hf : ContDiff ℝ ∞ f) (hg : ContDiff ℝ ∞ g) |
| 298 | (x v : Space) : |
| 299 | fderiv ℝ (fun y => ⟪f y, g y⟫_ℝ) x v = |
| 300 | ⟪f x, fderiv ℝ g x v⟫_ℝ + ⟪fderiv ℝ f x v, g x⟫_ℝ := by |
| 301 | rw [((hf.differentiable (by simp) x).hasFDerivAt.inner ℝ |
| 302 | (hg.differentiable (by simp) x).hasFDerivAt).fderiv] |
| 303 | rfl |
| 304 | |
| 305 | /-- The pressure term paired with a vector is its scalar directional |
| 306 | derivative. This uses exactly the gradient definition in the target. -/ |
| 307 | theorem inner_pressureGradient (p : PressureField) (t : ℝ) (x w : Space) : |
| 308 | ⟪w, pressureGradient p t x⟫_ℝ = fderiv ℝ (fun y => p (t, y)) x w := by |
| 309 | rw [fderiv_apply_eq_sum] |
| 310 | simp only [pressureGradient, inner_sum, inner_smul_right, coordinateVector, |
| 311 | EuclideanSpace.inner_single_right, RCLike.conj_to_real, one_mul] |
| 312 | apply Finset.sum_congr rfl |
| 313 | intro i _ |
| 314 | ring |
| 315 | |
| 316 | theorem energy_density_derivative {u : VelocityField} {t : ℝ} {x : Space} |
| 317 | (hu : DifferentiableAt ℝ (fun s => u (s, x)) t) : |
| 318 | HasDerivAt (fun s : ℝ => ‖u (s, x)‖ ^ 2) |
| 319 | (2 * ⟪u (t, x), temporalDerivative u t x⟫_ℝ) t := |
| 320 | hu.hasDerivAt.norm_sq |
| 321 | |
| 322 | open PeriodicIntegration |
| 323 | |
| 324 | theorem component_periodic {f : Space → Space} (hf : UnitPeriods f) (j : Fin 3) : |
| 325 | UnitPeriods (fun x => f x j) := by |
| 326 | intro x i |
| 327 | exact congrArg (fun v : Space => v j) (hf x i) |
| 328 | |
| 329 | theorem spatial_partial_periodic {V : Type*} [NormedAddCommGroup V] [NormedSpace ℝ V] |
| 330 | {f : Space → V} (hf : UnitPeriods f) (i : Fin 3) : UnitPeriods (spatialPartial i f) := by |
| 331 | intro x j |
| 332 | exact congrArg (fun A : Space →L[ℝ] V => A (coordinateVector i)) (periodic_fderiv hf x j) |
| 333 | |
| 334 | theorem normsq_periodic {f : Space → Space} (hf : UnitPeriods f) : |
| 335 | UnitPeriods (fun x => ‖f x‖ ^ 2) := by |
| 336 | intro x i |
| 337 | exact congrArg (fun v : Space => ‖v‖ ^ 2) (hf x i) |
| 338 | |
| 339 | /-- Scalar transport integration by parts, derived from the three |
| 340 | coordinate identities on the unit cube. -/ |
| 341 | theorem cubeIntegral_fderiv_apply {f : Space → ℝ} {v : Space → Space} |
| 342 | (hf : ContDiff ℝ ∞ f) (hv : ContDiff ℝ ∞ v) |
| 343 | (hpf : UnitPeriods f) (hpv : UnitPeriods v) : |
| 344 | cubeIntegral (fun x => fderiv ℝ f x (v x)) = |
| 345 | -cubeIntegral (fun x => f x * ∑ i : Fin 3, spatialPartial i v x i) := by |
| 346 | have hleft : (fun x => fderiv ℝ f x (v x)) = |
| 347 | (fun x => ∑ i : Fin 3, v x i * spatialPartial i f x) := by |
| 348 | funext x |
| 349 | exact fderiv_apply_eq_sum f x (v x) |
| 350 | have hright : (fun x => f x * ∑ i : Fin 3, spatialPartial i v x i) = |
| 351 | (fun x => ∑ i : Fin 3, f x * spatialPartial i v x i) := by |
| 352 | funext x |
| 353 | exact Finset.mul_sum _ _ _ |
| 354 | rw [hleft, hright] |
| 355 | dsimp only [spatialPartial] |
| 356 | rw [cubeIntegral_sum Finset.univ _ (fun i _ => |
| 357 | (component_contDiff hv i).continuous.fun_mul (spatial_partial_contDiff hf i).continuous), |
| 358 | cubeIntegral_sum Finset.univ _ (fun i _ => |
| 359 | hf.continuous.fun_mul (component_contDiff (spatial_partial_contDiff hv i) i).continuous), |
| 360 | ← Finset.sum_neg_distrib] |
| 361 | apply Finset.sum_congr rfl |
| 362 | intro i _ |
| 363 | have h := cubeIntegral_mul_partial ((component_contDiff hv i).of_le (nat_le_infty 1)) |
| 364 | (hf.of_le (nat_le_infty 1)) (component_periodic hpv i) hpf i |
| 365 | simpa only [spatialPartial, fderiv_component hv] using h |
| 366 | |
| 367 | theorem cubeIntegral_fderiv_apply_zero {f : Space → ℝ} {v : Space → Space} |
| 368 | (hf : ContDiff ℝ ∞ f) (hv : ContDiff ℝ ∞ v) |
| 369 | (hpf : UnitPeriods f) (hpv : UnitPeriods v) |
| 370 | (hdiv : ∀ x, (∑ i : Fin 3, spatialPartial i v x i) = 0) : |
| 371 | cubeIntegral (fun x => fderiv ℝ f x (v x)) = 0 := by |
| 372 | rw [cubeIntegral_fderiv_apply hf hv hpf hpv] |
| 373 | simp only [hdiv, mul_zero, cubeIntegral_zero, neg_zero] |
| 374 | |
| 375 | /-- Divergence-free transport has zero contribution to the energy. -/ |
| 376 | theorem cubeIntegral_transport_energy_zero {w v : Space → Space} |
| 377 | (hw : ContDiff ℝ ∞ w) (hv : ContDiff ℝ ∞ v) |
| 378 | (hpw : UnitPeriods w) (hpv : UnitPeriods v) |
| 379 | (hdiv : ∀ x, (∑ i : Fin 3, spatialPartial i v x i) = 0) : |
| 380 | cubeIntegral (fun x => ⟪w x, fderiv ℝ w x (v x)⟫_ℝ) = 0 := by |
| 381 | have h := cubeIntegral_fderiv_apply_zero (hw.norm_sq ℝ) hv (normsq_periodic hpw) hpv hdiv |
| 382 | have hfun : (fun x => fderiv ℝ (fun y => ‖w y‖ ^ 2) x (v x)) = |
| 383 | (fun x => 2 * ⟪w x, fderiv ℝ w x (v x)⟫_ℝ) := by |
| 384 | funext x |
| 385 | exact fderiv_normsq hw x (v x) |
| 386 | rw [hfun, cubeIntegral_const_mul] at h |
| 387 | linarith |
| 388 | |
| 389 | /-- Vector integration by parts follows from the scalar derivative of |
| 390 | the Euclidean inner product; it is not assumed as an energy identity. -/ |
| 391 | theorem cubeIntegral_inner_partial {f g : Space → Space} |
| 392 | (hf : ContDiff ℝ ∞ f) (hg : ContDiff ℝ ∞ g) |
| 393 | (hpf : UnitPeriods f) (hpg : UnitPeriods g) (i : Fin 3) : |
| 394 | cubeIntegral (fun x => ⟪f x, spatialPartial i g x⟫_ℝ) = |
| 395 | -cubeIntegral (fun x => ⟪spatialPartial i f x, g x⟫_ℝ) := by |
| 396 | have hp : UnitPeriods (fun x => ⟪f x, g x⟫_ℝ) := by |
| 397 | intro x j |
| 398 | change ⟪f (x + coordinateVector j), g (x + coordinateVector j)⟫_ℝ = _ |
| 399 | rw [hpf x j, hpg x j] |
| 400 | have h := cubeIntegral_partial_eq_zero ((hf.inner ℝ hg).of_le (nat_le_infty 1)) hp i |
| 401 | have hfun : spatialPartial i (fun x => ⟪f x, g x⟫_ℝ) = |
| 402 | (fun x => ⟪f x, spatialPartial i g x⟫_ℝ + ⟪spatialPartial i f x, g x⟫_ℝ) := by |
| 403 | funext x |
| 404 | exact fderiv_inner hf hg x (coordinateVector i) |
| 405 | rw [hfun] at h |
| 406 | dsimp only [spatialPartial] at h ⊢ |
| 407 | rw [cubeIntegral_add |
| 408 | (hf.inner ℝ (spatial_partial_contDiff hg i)).continuous |
| 409 | ((spatial_partial_contDiff hf i).inner ℝ hg).continuous] at h |
| 410 | exact eq_neg_of_add_eq_zero_left h |
| 411 | |
| 412 | /-- The viscosity term is minus the actual integrated sum of squared |
| 413 | coordinate derivatives of the difference field. -/ |
| 414 | theorem cubeIntegral_laplacian_energy {w : VelocityField} {t : ℝ} |
| 415 | (hw : ContDiff ℝ ∞ (fun x : Space => w (t, x))) |
| 416 | (hpw : UnitPeriods (fun x : Space => w (t, x))) : |
| 417 | cubeIntegral (fun x => ⟪w (t, x), spatialLaplacian w t x⟫_ℝ) = |
| 418 | -(∑ i : Fin 3, cubeIntegral (fun x => ‖spatialPartial i (fun y => w (t, y)) x‖ ^ 2)) := by |
| 419 | have hsum : cubeIntegral (fun x => ⟪w (t, x), spatialLaplacian w t x⟫_ℝ) = |
| 420 | ∑ i : Fin 3, cubeIntegral (fun x => |
| 421 | ⟪w (t, x), spatialPartial i (spatialPartial i (fun y => w (t, y))) x⟫_ℝ) := by |
| 422 | simp only [spatialLaplacian, inner_sum] |
| 423 | exact cubeIntegral_sum Finset.univ _ (fun i _ => |
| 424 | (hw.inner ℝ (spatial_partial_contDiff (spatial_partial_contDiff hw i) i)).continuous) |
| 425 | rw [hsum, ← Finset.sum_neg_distrib] |
| 426 | apply Finset.sum_congr rfl |
| 427 | intro i _ |
| 428 | unfold spatialPartial |
| 429 | simpa only [spatialPartial, real_inner_self_eq_norm_sq] using |
| 430 | cubeIntegral_inner_partial hw (spatial_partial_contDiff hw i) hpw |
| 431 | (spatial_partial_periodic hpw i) i |
| 432 | |
| 433 | /-- Pressure has zero energy contribution when the difference velocity |
| 434 | is divergence free. -/ |
| 435 | theorem cubeIntegral_pressure_energy_zero {w : VelocityField} {p : PressureField} {t : ℝ} |
| 436 | (hw : ContDiff ℝ ∞ (fun x : Space => w (t, x))) |
| 437 | (hp : ContDiff ℝ ∞ (fun x : Space => p (t, x))) |
| 438 | (hpw : UnitPeriods (fun x : Space => w (t, x))) |
| 439 | (hpp : UnitPeriods (fun x : Space => p (t, x))) |
| 440 | (hdiv : ∀ x, spatialDivergence w t x = 0) : |
| 441 | cubeIntegral (fun x => ⟪w (t, x), pressureGradient p t x⟫_ℝ) = 0 := by |
| 442 | have hfun : (fun x => ⟪w (t, x), pressureGradient p t x⟫_ℝ) = |
| 443 | (fun x => fderiv ℝ (fun y => p (t, y)) x (w (t, x))) := by |
| 444 | funext x |
| 445 | exact inner_pressureGradient p t x (w (t, x)) |
| 446 | rw [hfun] |
| 447 | exact cubeIntegral_fderiv_apply_zero hp hw hpp hpw hdiv |
| 448 | |
| 449 | theorem spatialLaplacian_contDiff {w : VelocityField} {t : ℝ} |
| 450 | (hw : ContDiff ℝ ∞ (fun x : Space => w (t, x))) : |
| 451 | ContDiff ℝ ∞ (spatialLaplacian w t) := by |
| 452 | change ContDiff ℝ ∞ (fun x => ∑ i : Fin 3, |
| 453 | spatialPartial i (spatialPartial i (fun y => w (t, y))) x) |
| 454 | exact ContDiff.sum fun i _ => spatial_partial_contDiff (spatial_partial_contDiff hw i) i |
| 455 | |
| 456 | theorem pressureGradient_contDiff {p : PressureField} {t : ℝ} |
| 457 | (hp : ContDiff ℝ ∞ (fun x : Space => p (t, x))) : |
| 458 | ContDiff ℝ ∞ (pressureGradient p t) := by |
| 459 | change ContDiff ℝ ∞ (fun x => ∑ i : Fin 3, |
| 460 | spatialPartial i (fun y => p (t, y)) x • coordinateVector i) |
| 461 | exact ContDiff.sum fun i _ => (spatial_partial_contDiff hp i).smul contDiff_const |
| 462 | |
| 463 | theorem unitPeriods_sub {V : Type*} [Sub V] {f g : Space → V} |
| 464 | (hf : UnitPeriods f) (hg : UnitPeriods g) : UnitPeriods (f - g) := by |
| 465 | intro x i |
| 466 | change f (x + coordinateVector i) - g (x + coordinateVector i) = f x - g x |
| 467 | rw [hf x i, hg x i] |
| 468 | |
| 469 | /-- Squared `L²` distance, using the actual unit-cube Lebesgue integral. -/ |
| 470 | noncomputable def energy (u v : VelocityField) (t : ℝ) : ℝ := |
| 471 | cubeIntegral (fun x => ‖(u - v) (t, x)‖ ^ 2) |
| 472 | |
| 473 | noncomputable def energyRate (u v : VelocityField) (t : ℝ) : ℝ := |
| 474 | cubeIntegral (fun x => 2 * ⟪(u - v) (t, x), temporalDerivative (u - v) t x⟫_ℝ) |
| 475 | |
| 476 | noncomputable def dissipation (w : VelocityField) (t : ℝ) : ℝ := |
| 477 | ∑ i : Fin 3, cubeIntegral (fun x => ‖spatialPartial i (fun y => w (t, y)) x‖ ^ 2) |
| 478 | |
| 479 | noncomputable def coupling (u w : VelocityField) (t : ℝ) : ℝ := |
| 480 | cubeIntegral (fun x => ⟪w (t, x), spatialDerivative u t x (w (t, x))⟫_ℝ) |
| 481 | |
| 482 | theorem energy_nonneg (u v : VelocityField) (t : ℝ) : 0 ≤ energy u v t := |
| 483 | cubeIntegral_nonneg (fun _ => sq_nonneg _) |
| 484 | |
| 485 | theorem dissipation_nonneg (w : VelocityField) (t : ℝ) : 0 ≤ dissipation w t := |
| 486 | Finset.sum_nonneg (fun _ _ => cubeIntegral_nonneg (fun _ => sq_nonneg _)) |
| 487 | |
| 488 | /-- The exact difference-energy balance, derived from the actual PDE, |
| 489 | pressure cancellation, divergence-free transport, and viscous integration |
| 490 | by parts. No energy inequality is an input. -/ |
| 491 | theorem energy_balance {u v : VelocityField} {p q : PressureField} {t : ℝ} |
| 492 | (hu : ContDiff ℝ ∞ (fun x : Space => u (t, x))) |
| 493 | (hv : ContDiff ℝ ∞ (fun x : Space => v (t, x))) |
| 494 | (hp : ContDiff ℝ ∞ (fun x : Space => p (t, x))) |
| 495 | (hq : ContDiff ℝ ∞ (fun x : Space => q (t, x))) |
| 496 | (hpu : UnitPeriods (fun x : Space => u (t, x))) |
| 497 | (hpv : UnitPeriods (fun x : Space => v (t, x))) |
| 498 | (hpp : UnitPeriods (fun x : Space => p (t, x))) |
| 499 | (hpq : UnitPeriods (fun x : Space => q (t, x))) |
| 500 | (hdu : ∀ x, spatialDivergence u t x = 0) |
| 501 | (hdv : ∀ x, spatialDivergence v t x = 0) |
| 502 | (htu : ∀ x, DifferentiableAt ℝ (fun s : ℝ => u (s, x)) t) |
| 503 | (htv : ∀ x, DifferentiableAt ℝ (fun s : ℝ => v (s, x)) t) |
| 504 | (hNS : ∀ x, navierStokesResidual u p t x = navierStokesResidual v q t x) : |
| 505 | energyRate u v t = -2 * dissipation (u - v) t - 2 * coupling u (u - v) t := by |
| 506 | have hw : ContDiff ℝ ∞ (fun x : Space => (u - v) (t, x)) := hu.sub hv |
| 507 | have hpw : UnitPeriods (fun x : Space => (u - v) (t, x)) := unitPeriods_sub hpu hpv |
| 508 | have hdw : ∀ x, spatialDivergence (u - v) t x = 0 := by |
| 509 | intro x |
| 510 | rw [spatialDivergence_sub hu hv, hdu x, hdv x, sub_self] |
| 511 | have hL := (hw.inner ℝ (spatialLaplacian_contDiff hw)).continuous |
| 512 | have hN := (hw.inner ℝ ((hu.fderiv_right infty_add_one_le).clm_apply hw)).continuous |
| 513 | have hT := (hw.inner ℝ ((hw.fderiv_right infty_add_one_le).clm_apply hv)).continuous |
| 514 | have hP := (hw.inner ℝ (pressureGradient_contDiff (p := p - q) (t := t) (hp.sub hq))).continuous |
| 515 | have hEq : (fun x => ⟪(u - v) (t, x), temporalDerivative (u - v) t x⟫_ℝ) = |
| 516 | (fun x => ⟪(u - v) (t, x), spatialLaplacian (u - v) t x⟫_ℝ - |
| 517 | ⟪(u - v) (t, x), spatialDerivative u t x ((u - v) (t, x))⟫_ℝ - |
| 518 | ⟪(u - v) (t, x), spatialDerivative (u - v) t x (v (t, x))⟫_ℝ - |
| 519 | ⟪(u - v) (t, x), pressureGradient (p - q) t x⟫_ℝ) := by |
| 520 | funext x |
| 521 | rw [difference_equation hu hv hp hq (htu x) (htv x) (hNS x)] |
| 522 | simp only [inner_sub_right] |
| 523 | unfold energyRate |
| 524 | rw [cubeIntegral_const_mul, hEq] |
| 525 | change 2 * cubeIntegral (fun x => |
| 526 | ⟪(u - v) (t, x), spatialLaplacian (u - v) t x⟫_ℝ - |
| 527 | ⟪(u - v) (t, x), fderiv ℝ (fun y => u (t, y)) x ((u - v) (t, x))⟫_ℝ - |
| 528 | ⟪(u - v) (t, x), fderiv ℝ (fun y => (u - v) (t, y)) x (v (t, x))⟫_ℝ - |
| 529 | ⟪(u - v) (t, x), pressureGradient (p - q) t x⟫_ℝ) = _ |
| 530 | rw [cubeIntegral_sub ((hL.fun_sub hN).fun_sub hT) hP, cubeIntegral_sub (hL.fun_sub hN) hT, |
| 531 | cubeIntegral_sub hL hN, cubeIntegral_laplacian_energy hw hpw, |
| 532 | cubeIntegral_transport_energy_zero hw hv hpw hpv hdv, |
| 533 | cubeIntegral_pressure_energy_zero hw (hp.sub hq) hpw (unitPeriods_sub hpp hpq) hdw] |
| 534 | simp only [sub_zero, dissipation, coupling, spatialDerivative] |
| 535 | ring |
| 536 | |
| 537 | /-- Integrating the pointwise nonlinear bound only needs a gradient bound |
| 538 | on the compact unit cube. -/ |
| 539 | theorem neg_coupling_le_energy {u v : VelocityField} {t B : ℝ} |
| 540 | (hu : ContDiff ℝ ∞ (fun x : Space => u (t, x))) |
| 541 | (hv : ContDiff ℝ ∞ (fun x : Space => v (t, x))) |
| 542 | (hB : ∀ y ∈ cube, ‖spatialDerivative u t (toSpace y)‖ ≤ B) : |
| 543 | -coupling u (u - v) t ≤ B * energy u v t := by |
| 544 | have hw : ContDiff ℝ ∞ (fun x : Space => (u - v) (t, x)) := hu.sub hv |
| 545 | unfold coupling energy |
| 546 | rw [← cubeIntegral_neg, ← cubeIntegral_const_mul] |
| 547 | apply cubeIntegral_mono_on_cube |
| 548 | (hw.inner ℝ ((hu.fderiv_right infty_add_one_le).clm_apply hw)).continuous.neg |
| 549 | (continuous_const.mul (hw.norm_sq ℝ).continuous) |
| 550 | intro y hy |
| 551 | exact nonlinear_energy_bound _ _ (hB y hy) |
| 552 | |
| 553 | theorem energy_rate_le {u v : VelocityField} {p q : PressureField} {t B : ℝ} |
| 554 | (hu : ContDiff ℝ ∞ (fun x : Space => u (t, x))) |
| 555 | (hv : ContDiff ℝ ∞ (fun x : Space => v (t, x))) |
| 556 | (hp : ContDiff ℝ ∞ (fun x : Space => p (t, x))) |
| 557 | (hq : ContDiff ℝ ∞ (fun x : Space => q (t, x))) |
| 558 | (hpu : UnitPeriods (fun x : Space => u (t, x))) |
| 559 | (hpv : UnitPeriods (fun x : Space => v (t, x))) |
| 560 | (hpp : UnitPeriods (fun x : Space => p (t, x))) |
| 561 | (hpq : UnitPeriods (fun x : Space => q (t, x))) |
| 562 | (hdu : ∀ x, spatialDivergence u t x = 0) |
| 563 | (hdv : ∀ x, spatialDivergence v t x = 0) |
| 564 | (htu : ∀ x, DifferentiableAt ℝ (fun s : ℝ => u (s, x)) t) |
| 565 | (htv : ∀ x, DifferentiableAt ℝ (fun s : ℝ => v (s, x)) t) |
| 566 | (hNS : ∀ x, navierStokesResidual u p t x = navierStokesResidual v q t x) |
| 567 | (hB : ∀ y ∈ cube, ‖spatialDerivative u t (toSpace y)‖ ≤ B) : |
| 568 | energyRate u v t ≤ (2 * B) * energy u v t := by |
| 569 | rw [energy_balance hu hv hp hq hpu hpv hpp hpq hdu hdv htu htv hNS] |
| 570 | have hc := neg_coupling_le_energy hu hv hB |
| 571 | have hd := dissipation_nonneg (u - v) t |
| 572 | nlinarith |
| 573 | |
| 574 | theorem time_differentiable_at_interior {V : Type*} [NormedAddCommGroup V] [NormedSpace ℝ V] |
| 575 | {a b t : ℝ} {u : SpaceTime → V} (hu : ContDiffOn ℝ ∞ u (slab a b)) |
| 576 | (ht : t ∈ Ioo a b) (x : Space) : |
| 577 | DifferentiableAt ℝ (fun s : ℝ => u (s, x)) t := |
| 578 | ((smooth_at_interior hu ht x).comp t |
| 579 | (contDiffAt_id.prodMk contDiffAt_const)).differentiableAt (by simp) |
| 580 | |
| 581 | theorem energy_continuousOn {a b : ℝ} {u v : VelocityField} |
| 582 | (hu : ContDiffOn ℝ ∞ u (slab a b)) (hv : ContDiffOn ℝ ∞ v (slab a b)) : |
| 583 | ContinuousOn (energy u v) (Icc a b) := by |
| 584 | have hF : ContDiffOn ℝ ∞ (fun z : SpaceTime => ‖(u - v) z‖ ^ 2) |
| 585 | (Icc a b ×ˢ univ) := (hu.sub hv).norm_sq ℝ |
| 586 | exact cubeIntegral_continuousOn_Icc hF.continuousOn |
| 587 | |
| 588 | /-- Differentiation under the genuine spatial integral is justified by |
| 589 | joint smoothness and compactness of the cube. -/ |
| 590 | theorem energy_hasDerivAt {a b t : ℝ} {u v : VelocityField} |
| 591 | (hu : ContDiffOn ℝ ∞ u (slab a b)) (hv : ContDiffOn ℝ ∞ v (slab a b)) |
| 592 | (ht : t ∈ Ioo a b) : HasDerivAt (energy u v) (energyRate u v t) t := by |
| 593 | have hF : ContDiffOn ℝ 1 (fun z : SpaceTime => ‖(u - v) z‖ ^ 2) |
| 594 | (Ioo a b ×ˢ univ) := |
| 595 | (((hu.sub hv).norm_sq ℝ).of_le (nat_le_infty 1)).mono |
| 596 | (fun z hz => ⟨⟨hz.1.1.le, hz.1.2.le⟩, hz.2⟩) |
| 597 | have h := hasDerivAt_cubeIntegral_of_contDiffOn isOpen_Ioo hF ht |
| 598 | have hrate : (fun x => deriv (fun s : ℝ => ‖(u - v) (s, x)‖ ^ 2) t) = |
| 599 | (fun x => 2 * ⟪(u - v) (t, x), temporalDerivative (u - v) t x⟫_ℝ) := by |
| 600 | funext x |
| 601 | exact (energy_density_derivative |
| 602 | (time_differentiable_at_interior (u := u - v) (hu.sub hv) ht x)).deriv |
| 603 | rw [hrate] at h |
| 604 | exact h |
| 605 | |
| 606 | theorem energy_initial_zero {u v : VelocityField} {a : ℝ} |
| 607 | (hinitial : ∀ x : Space, u (a, x) = v (a, x)) : energy u v a = 0 := by |
| 608 | have hzero : (fun x => ‖(u - v) (a, x)‖ ^ 2) = (fun _ : Space => (0 : ℝ)) := by |
| 609 | funext x |
| 610 | simp only [Pi.sub_apply, hinitial x, sub_self, norm_zero, zero_pow (by decide : 2 ≠ 0)] |
| 611 | unfold energy |
| 612 | rw [hzero, cubeIntegral_zero] |
| 613 | |
| 614 | /-- Zero squared `L²` difference implies equality everywhere, using |
| 615 | continuity on the cube and the explicitly proved periodic representatives. -/ |
| 616 | theorem eq_of_energy_zero {u v : VelocityField} {t : ℝ} |
| 617 | (hu : Continuous (fun x : Space => u (t, x))) |
| 618 | (hv : Continuous (fun x : Space => v (t, x))) |
| 619 | (hpu : UnitPeriods (fun x : Space => u (t, x))) |
| 620 | (hpv : UnitPeriods (fun x : Space => v (t, x))) |
| 621 | (hzero : energy u v t = 0) (x : Space) : u (t, x) = v (t, x) := by |
| 622 | have hc := eq_zero_on_cube_of_integral_norm_sq_eq_zero (hu.sub hv) hzero |
| 623 | have hpw : UnitPeriods (fun z : Space => (u - v) (t, z)) := unitPeriods_sub hpu hpv |
| 624 | obtain ⟨z, hz, hzx⟩ := exists_cube_representative |
| 625 | (f := fun z : Space => (u - v) (t, z)) (fun i y => hpw y i) x |
| 626 | let y : Coords := toSpace.symm z |
| 627 | have hy : y ∈ cube := by |
| 628 | constructor |
| 629 | · intro i |
| 630 | exact (hz i).1 |
| 631 | · intro i |
| 632 | exact (hz i).2 |
| 633 | have hzy : toSpace y = z := toSpace.apply_symm_apply z |
| 634 | have hcz := hc y hy |
| 635 | rw [hzy] at hcz |
| 636 | exact sub_eq_zero.mp (hzx.symm.trans hcz) |
| 637 | |
| 638 | /-- Classical uniqueness on a compact time interval for the exact periodic |
| 639 | Navier--Stokes equation of `ProblemStatement`, with viscosity one. Both |
| 640 | solutions have the same force and initial datum. The energy inequality, |
| 641 | uniform gradient bound, and spatial integration identities are conclusions |
| 642 | of the preceding proofs, not assumptions of this theorem. -/ |
| 643 | theorem classical_uniqueness_on_Icc {a b : ℝ} |
| 644 | {u v : VelocityField} {p q : PressureField} {f : VelocityField} |
| 645 | (hu : ContDiffOn ℝ ∞ u (slab a b)) |
| 646 | (hv : ContDiffOn ℝ ∞ v (slab a b)) |
| 647 | (hp : ContDiffOn ℝ ∞ p (slab a b)) |
| 648 | (hq : ContDiffOn ℝ ∞ q (slab a b)) |
| 649 | (hpu : UnitSpatialPeriodsOn (Icc a b) u) |
| 650 | (hpv : UnitSpatialPeriodsOn (Icc a b) v) |
| 651 | (hpp : UnitSpatialPeriodsOn (Icc a b) p) |
| 652 | (hpq : UnitSpatialPeriodsOn (Icc a b) q) |
| 653 | (hdu : ∀ t ∈ Ioo a b, ∀ x : Space, spatialDivergence u t x = 0) |
| 654 | (hdv : ∀ t ∈ Ioo a b, ∀ x : Space, spatialDivergence v t x = 0) |
| 655 | (hNSu : ∀ t ∈ Ioo a b, ∀ x : Space, navierStokesResidual u p t x = f (t, x)) |
| 656 | (hNSv : ∀ t ∈ Ioo a b, ∀ x : Space, navierStokesResidual v q t x = f (t, x)) |
| 657 | (hinitial : ∀ x : Space, u (a, x) = v (a, x)) : |
| 658 | ∀ t ∈ Icc a b, ∀ x : Space, u (t, x) = v (t, x) := by |
| 659 | by_cases hab : a < b |
| 660 | · have hcompact : IsCompact (toSpace '' cube) := |
| 661 | (show IsCompact cube from isCompact_Icc).image toSpace.continuous |
| 662 | obtain ⟨B, _, hB⟩ := exists_gradient_bound hab hu hcompact |
| 663 | have hbound : ∀ t ∈ Ioo a b, energyRate u v t ≤ (2 * B) * energy u v t := by |
| 664 | intro t ht |
| 665 | have ht' : t ∈ Icc a b := ⟨ht.1.le, ht.2.le⟩ |
| 666 | exact energy_rate_le (spatial_smooth hu ht') (spatial_smooth hv ht') |
| 667 | (spatial_smooth hp ht') (spatial_smooth hq ht') |
| 668 | (hpu t ht') (hpv t ht') (hpp t ht') (hpq t ht') (hdu t ht) (hdv t ht) |
| 669 | (time_differentiable_at_interior hu ht) (time_differentiable_at_interior hv ht) |
| 670 | (fun x => (hNSu t ht x).trans (hNSv t ht x).symm) |
| 671 | (fun y hy => hB t ht' (toSpace y) ⟨y, hy, rfl⟩) |
| 672 | have hzero := gronwall_zero hab.le (energy_continuousOn hu hv) |
| 673 | (energy_initial_zero hinitial) (fun t _ => energy_nonneg u v t) |
| 674 | (fun t ht => energy_hasDerivAt hu hv ht) hbound |
| 675 | intro t ht x |
| 676 | exact eq_of_energy_zero (spatial_smooth hu ht).continuous (spatial_smooth hv ht).continuous |
| 677 | (hpu t ht) (hpv t ht) (hzero t ht) x |
| 678 | · intro t ht x |
| 679 | have ht' : t = a := le_antisymm (ht.2.trans (le_of_not_gt hab)) ht.1 |
| 680 | simpa only [ht'] using hinitial x |
| 681 | |
| 682 | /-- Direct application to the exact candidate specification: any other |
| 683 | classical periodic solution with its force and zero initial velocity must |
| 684 | agree on every compact interval strictly before time one. The comparison |
| 685 | solution is not assumed to satisfy the candidate blow-up condition. -/ |
| 686 | theorem candidate_unique_on_Icc {u : VelocityField} {p : PressureField} {f : VelocityField} |
| 687 | (h : CandidateProperties u p f) {T : ℝ} (hT : T < 1) |
| 688 | {v : VelocityField} {q : PressureField} |
| 689 | (hv : ContDiffOn ℝ ∞ v (slab 0 T)) (hq : ContDiffOn ℝ ∞ q (slab 0 T)) |
| 690 | (hpv : UnitSpatialPeriodsOn (Icc (0 : ℝ) T) v) |
| 691 | (hpq : UnitSpatialPeriodsOn (Icc (0 : ℝ) T) q) |
| 692 | (hdv : ∀ t ∈ Ioo (0 : ℝ) T, ∀ x : Space, spatialDivergence v t x = 0) |
| 693 | (hNSv : ∀ t ∈ Ioo (0 : ℝ) T, ∀ x : Space, navierStokesResidual v q t x = f (t, x)) |
| 694 | (hvzero : ∀ x : Space, v (0, x) = 0) : |
| 695 | ∀ t ∈ Icc (0 : ℝ) T, ∀ x : Space, u (t, x) = v (t, x) := by |
| 696 | have hsub : slab 0 T ⊆ preSingularDomain := by |
| 697 | intro z hz |
| 698 | exact ⟨⟨hz.1.1, hz.1.2.trans_lt hT⟩, hz.2⟩ |
| 699 | apply classical_uniqueness_on_Icc (h.velocity_smooth.mono hsub) hv |
| 700 | (h.pressure_smooth.mono hsub) hq |
| 701 | · intro t ht x i |
| 702 | exact h.velocity_periodic t ⟨ht.1, ht.2.trans_lt hT⟩ x i |
| 703 | · exact hpv |
| 704 | · intro t ht x i |
| 705 | exact h.pressure_periodic t ⟨ht.1, ht.2.trans_lt hT⟩ x i |
| 706 | · exact hpq |
| 707 | · intro t ht x |
| 708 | exact h.divergence_free t ⟨ht.1.le, ht.2.trans hT⟩ x |
| 709 | · exact hdv |
| 710 | · intro t ht x |
| 711 | exact h.navier_stokes t ⟨ht.1, ht.2.trans hT⟩ x |
| 712 | · exact hNSv |
| 713 | · intro x |
| 714 | exact (h.zero_initial_velocity x).trans (hvzero x).symm |
| 715 | |
| 716 | end NavierStokes.PeriodicUniqueness |