import NavierStokes.R3SpaceTimePressure import NavierStokes.SchwartzCompactApproximation import Mathlib.Analysis.Calculus.LineDeriv.IntegrationByParts import Mathlib.Analysis.Calculus.FDeriv.Symmetric /-! # Recovering the physical pressure gradient A distribution represented on compact tests by a smooth pressure gradient is curl-free. The finite-energy momentum equation places that gradient in negative Sobolev space, where its Poisson equation determines it uniquely. No growth condition on the physical pressure is assumed. -/ noncomputable section namespace NavierStokes.R3WeakPressure open Set Filter MeasureTheory TemperedDistribution FourierTransform open R3SpaceTime R3SpaceTimePressure open scoped SchwartzMap LineDeriv Topology ContDiff ENNReal def Represents (T : ๐“ข'(Domain, โ„‚)) (f : Domain โ†’ โ„‚) : Prop := โˆ€ ฯ† : ๐“ข(Domain, โ„‚), HasCompactSupport (ฯ† : Domain โ†’ โ„‚) โ†’ T ฯ† = โˆซ z : Domain, ฯ† z * f z theorem represents_lp {q : โ„โ‰ฅ0โˆž} [Fact (1 โ‰ค q)] {f : Domain โ†’ โ„‚} (hf : MemLp f q) : Represents (hf.toLp f : ๐“ข'(Domain, โ„‚)) f := by intro ฯ† _ rw [Lp.toTemperedDistribution_apply] apply integral_congr_ae filter_upwards [hf.coeFn_toLp] with z hz simp only [hz, smul_eq_mul] theorem Represents.ext {S T : ๐“ข'(Domain, โ„‚)} {f : Domain โ†’ โ„‚} (hS : Represents S f) (hT : Represents T f) : S = T := SchwartzCompactApproximation.tempered_eq_of_compact_tests fun ฯ† hฯ† => (hS ฯ† hฯ†).trans (hT ฯ† hฯ†).symm def directional (m : Domain) (f : Domain โ†’ โ„‚) (z : Domain) : โ„‚ := fderiv โ„ f z m theorem partial_contDiff {f : Domain โ†’ โ„‚} (hf : ContDiff โ„ โˆž f) (m : Domain) : ContDiff โ„ โˆž (directional m f) := by exact (hf.fderiv_right (by simp)).clm_apply contDiff_const theorem compact_lineDeriv (ฯ† : ๐“ข(Domain, โ„‚)) (hฯ† : HasCompactSupport (ฯ† : Domain โ†’ โ„‚)) (m : Domain) : HasCompactSupport ((โˆ‚_{m} ฯ† : ๐“ข(Domain, โ„‚)) : Domain โ†’ โ„‚) := by convert! hฯ†.fderiv_apply โ„ m using 1 theorem integration_by_parts {f : Domain โ†’ โ„‚} (hf : ContDiff โ„ 1 f) (ฯ† : ๐“ข(Domain, โ„‚)) (hฯ† : HasCompactSupport (ฯ† : Domain โ†’ โ„‚)) (m : Domain) : (โˆซ z : Domain, ฯ† z * directional m f z) = -(โˆซ z : Domain, (โˆ‚_{m} ฯ†) z * f z) := by apply integral_mul_fderiv_eq_neg_fderiv_mul_of_integrable ยท exact ((โˆ‚_{m} ฯ†).continuous.mul hf.continuous).integrable_of_hasCompactSupport (compact_lineDeriv ฯ† hฯ† m).mul_right ยท exact (ฯ†.continuous.mul ((hf.continuous_fderiv (by norm_num)).clm_apply continuous_const)).integrable_of_hasCompactSupport hฯ†.mul_right ยท exact (ฯ†.continuous.mul hf.continuous).integrable_of_hasCompactSupport hฯ†.mul_right ยท intro z _ exact ฯ†.differentiableAt ยท intro z _ exact hf.differentiable (by norm_num) z theorem Represents.lineDeriv {T : ๐“ข'(Domain, โ„‚)} {f : Domain โ†’ โ„‚} (hT : Represents T f) (hf : ContDiff โ„ 1 f) (m : Domain) : Represents (โˆ‚_{m} T) (directional m f) := by intro ฯ† hฯ† rw [TemperedDistribution.lineDerivOp_apply_apply, map_neg, hT (โˆ‚_{m} ฯ†) (compact_lineDeriv ฯ† hฯ† m)] exact (integration_by_parts hf ฯ† hฯ† m).symm theorem schwartz_derivatives_commute (ฯ† : ๐“ข(Domain, โ„‚)) (m n : Domain) : โˆ‚_{m} (โˆ‚_{n} ฯ†) = โˆ‚_{n} (โˆ‚_{m} ฯ†) := by ext z change (โˆ‚^{![m, n]} ฯ†) z = (โˆ‚^{![n, m]} ฯ†) z rw [SchwartzMap.iteratedLineDerivOp_eq_iteratedFDeriv, SchwartzMap.iteratedLineDerivOp_eq_iteratedFDeriv] exact IsSymmSndFDerivAt.iteratedFDeriv_cons (hf := (ฯ†.smooth โŠค).contDiffAt.isSymmSndFDerivAt (by simp)) theorem derivatives_commute (T : ๐“ข'(Domain, โ„‚)) (m n : Domain) : โˆ‚_{m} (โˆ‚_{n} T) = โˆ‚_{n} (โˆ‚_{m} T) := by ext ฯ† simp only [TemperedDistribution.lineDerivOp_apply_apply, map_neg, neg_neg, schwartz_derivatives_commute ฯ† n m] def divergence (U : Fin 3 โ†’ ๐“ข'(Domain, โ„‚)) : ๐“ข'(Domain, โ„‚) := โˆ‘ i, โˆ‚_{spaceDirection i} (U i) def momentumGradient (U V : Fin 3 โ†’ Lp โ„‚ 2 (volume : Measure Domain)) (G : Fin 3 โ†’ Fin 3 โ†’ Lp โ„‚ 1 (volume : Measure Domain)) (i : Fin 3) : ๐“ข'(Domain, โ„‚) := spatialLaplacian (U i) - โˆ‚_{timeDirection} (U i : ๐“ข'(Domain, โ„‚)) + V i - โˆ‘ j, โˆ‚_{spaceDirection j} (G i j : ๐“ข'(Domain, โ„‚)) theorem lp_two_memSobolev (u : Lp โ„‚ 2 (volume : Measure Domain)) : MemSobolev 0 2 (u : ๐“ข'(Domain, โ„‚)) := by use u simp theorem momentumGradient_memSobolev (U V : Fin 3 โ†’ Lp โ„‚ 2 (volume : Measure Domain)) (G : Fin 3 โ†’ Fin 3 โ†’ Lp โ„‚ 1 (volume : Measure Domain)) (i : Fin 3) : MemSobolev (-5) 2 (momentumGradient U V G i) := by apply MemSobolev.sub ยท apply MemSobolev.add ยท apply MemSobolev.sub ยท unfold spatialLaplacian apply memSobolev_finset_sum intro j _ exact MemSobolev.mono (by norm_num) (lp_two_memSobolev (U i)).lineDerivOp.lineDerivOp ยท exact MemSobolev.mono (by norm_num) (lp_two_memSobolev (U i)).lineDerivOp ยท exact MemSobolev.mono (by norm_num) (lp_two_memSobolev (V i)) ยท apply memSobolev_finset_sum intro j _ convert! (lp_memSobolev (G i j)).lineDerivOp using 1 norm_num theorem spatialLaplacian_sum {ฮน : Type*} (s : Finset ฮน) (f : ฮน โ†’ ๐“ข'(Domain, โ„‚)) : spatialLaplacian (โˆ‘ i โˆˆ s, f i) = โˆ‘ i โˆˆ s, spatialLaplacian (f i) := spatialLaplacian_finset_sum s f theorem momentumGradient_divergence (U V : Fin 3 โ†’ Lp โ„‚ 2 (volume : Measure Domain)) (G : Fin 3 โ†’ Fin 3 โ†’ Lp โ„‚ 1 (volume : Measure Domain)) (hU : divergence (fun i => (U i : ๐“ข'(Domain, โ„‚))) = 0) (hV : divergence (fun i => (V i : ๐“ข'(Domain, โ„‚))) = 0) : divergence (momentumGradient U V G) = -(โˆ‘ i, โˆ‘ j, โˆ‚_{spaceDirection i} (โˆ‚_{spaceDirection j} (G i j : ๐“ข'(Domain, โ„‚)))) := by have hLap : (โˆ‘ i, โˆ‚_{spaceDirection i} (spatialLaplacian (U i))) = 0 := by simp_rw [โ† spatialLaplacian_lineDeriv] rw [โ† spatialLaplacian_sum] change spatialLaplacian (divergence (fun i => (U i : ๐“ข'(Domain, โ„‚)))) = 0 rw [hU] simp [spatialLaplacian, LineDeriv.lineDerivOp_zero] have hTime : (โˆ‘ i, โˆ‚_{spaceDirection i} (โˆ‚_{timeDirection} (U i : ๐“ข'(Domain, โ„‚)))) = 0 := by simp_rw [derivatives_commute (U _) (spaceDirection _) timeDirection] rw [โ† LineDeriv.lineDerivOp_sum] change โˆ‚_{timeDirection} (divergence (fun i => (U i : ๐“ข'(Domain, โ„‚)))) = 0 rw [hU, LineDeriv.lineDerivOp_zero] unfold divergence momentumGradient simp only [sub_eq_add_neg, LineDeriv.lineDerivOp_add, LineDeriv.lineDerivOp_neg, LineDeriv.lineDerivOp_sum, Finset.sum_add_distrib, Finset.sum_neg_distrib] change (โˆ‘ i, โˆ‚_{spaceDirection i} (spatialLaplacian (U i))) + -(โˆ‘ i, โˆ‚_{spaceDirection i} (โˆ‚_{timeDirection} (U i : ๐“ข'(Domain, โ„‚)))) + divergence (fun i => (V i : ๐“ข'(Domain, โ„‚))) + _ = _ rw [hLap, hTime, hV] simp /-- A physical pressure specified only through compact tests gives a curl-free tempered gradient. -/ theorem curl_free_of_pressure (P : Fin 3 โ†’ ๐“ข'(Domain, โ„‚)) (p : Domain โ†’ โ„‚) (hP : โˆ€ i (ฯ† : ๐“ข(Domain, โ„‚)), HasCompactSupport (ฯ† : Domain โ†’ โ„‚) โ†’ P i ฯ† = -(โˆซ z : Domain, (โˆ‚_{spaceDirection i} ฯ†) z * p z)) (i j : Fin 3) : โˆ‚_{spaceDirection j} (P i) = โˆ‚_{spaceDirection i} (P j) := by apply SchwartzCompactApproximation.tempered_eq_of_compact_tests intro ฯ† hฯ† simp only [TemperedDistribution.lineDerivOp_apply_apply, map_neg] rw [hP i _ (compact_lineDeriv ฯ† hฯ† _), hP j _ (compact_lineDeriv ฯ† hฯ† _), schwartz_derivatives_commute ฯ† (spaceDirection i) (spaceDirection j)] /-- The physical pressure gradient in the finite-energy equation equals the canonical Fourier pressure gradient. -/ theorem pressure_gradient_unique (U V : Fin 3 โ†’ Lp โ„‚ 2 (volume : Measure Domain)) (G : Fin 3 โ†’ Fin 3 โ†’ Lp โ„‚ 1 (volume : Measure Domain)) (p : Domain โ†’ โ„‚) (hU : divergence (fun i => (U i : ๐“ข'(Domain, โ„‚))) = 0) (hV : divergence (fun i => (V i : ๐“ข'(Domain, โ„‚))) = 0) (hP : โˆ€ i (ฯ† : ๐“ข(Domain, โ„‚)), HasCompactSupport (ฯ† : Domain โ†’ โ„‚) โ†’ momentumGradient U V G i ฯ† = -(โˆซ z : Domain, (โˆ‚_{spaceDirection i} ฯ†) z * p z)) (m : Fin 3) : momentumGradient U V G m = โˆ‚_{spaceDirection m} (stressPressure G) := by apply stressPressure_gradient_unique G (spaceDirection m) (momentumGradient_memSobolev U V G m) calc spatialLaplacian (momentumGradient U V G m) = โˆ‘ i, โˆ‚_{spaceDirection i} (โˆ‚_{spaceDirection m} (momentumGradient U V G i)) := by unfold spatialLaplacian apply Finset.sum_congr rfl intro i _ rw [curl_free_of_pressure _ p hP m i] _ = โˆ‚_{spaceDirection m} (divergence (momentumGradient U V G)) := by simp only [divergence, LineDeriv.lineDerivOp_sum] exact Finset.sum_congr rfl fun i _ => derivatives_commute _ _ _ _ = _ := by rw [momentumGradient_divergence U V G hU hV, LineDeriv.lineDerivOp_neg] end NavierStokes.R3WeakPressure