import Euler.MeanWeakCurl import Euler.CanonicalGraphPotential import Euler.MeanCoefficientMultipliers import Mathlib.LinearAlgebra.BilinearForm.Properties import Euler.MeanSmoothRepresentative /-! Classical divergence and pressure identities for the reconstructed mean fields. -/ /-! ## From `Euler/MeanPressurePotential.lean` The text of `Euler/MeanPressurePotential.lean`, folded into this file, which was its only importer. -/ section /-! A canonically normalized actual scalar potential for ordinary mean pressure gradients. -/ noncomputable section namespace EulerMeanPressure open MeasureTheory InnerProductSpace EulerSmoothLimit EulerMeanSolenoidal EulerCanonicalGraphPotential EulerMeanCoefficients open scoped ContDiff theorem symmetry_of_coordinates (L : Space →L[ℝ] Space) (hL : ∀ i j, (L (EuclideanSpace.single i 1)) j = (L (EuclideanSpace.single j 1)) i) (a b : Space) : ⟪L a, b⟫_ℝ = ⟪L b, a⟫_ℝ := by let B : LinearMap.BilinForm ℝ Space := (innerₗ Space).comp L.toLinearMap have hB : LinearMap.BilinForm.IsSymm B := (LinearMap.BilinForm.isSymm_iff_basis (EuclideanSpace.basisFun (Fin 3) ℝ).toBasis).2 (fun i j => by change ⟪L ((EuclideanSpace.basisFun (Fin 3) ℝ).toBasis i), (EuclideanSpace.basisFun (Fin 3) ℝ).toBasis j⟫_ℝ = ⟪L ((EuclideanSpace.basisFun (Fin 3) ℝ).toBasis j), (EuclideanSpace.basisFun (Fin 3) ℝ).toBasis i⟫_ℝ simpa only [OrthonormalBasis.coe_toBasis, EuclideanSpace.basisFun_apply, EuclideanSpace.inner_single_right, RCLike.conj_to_real, one_mul] using hL i j) exact hB.eq a b /-- Smooth representatives of the actual closed gradient space have a genuine scalar potential. -/ theorem gradientSpace_has_potential (p : L2) (hp : p ∈ gradientSpace) (g : Space → Space) (hrep : p =ᵐ[volume] g) (hg : ContDiff ℝ ∞ g) : ∃ q : Space → ℝ, ContDiff ℝ ∞ q ∧ ∀ x, gradient q x = g x := by apply EulerGraphPullback.smooth_gradient_potential g hg intro x a b exact symmetry_of_coordinates (fderiv ℝ g x) (gradientSpace_classical_curl_zero p hp g hrep hg x) a b /-- The concrete radial integral gives a fixed additive normalization, not just an existential pressure. -/ theorem gradientSpace_radial_potential (p : L2) (hp : p ∈ gradientSpace) (g : Space → Space) (hrep : p =ᵐ[volume] g) (hg : ContDiff ℝ ∞ g) : ContDiff ℝ ∞ (radialPotential g) ∧ radialPotential g 0 = 0 ∧ ∀ x, gradient (radialPotential g) x = g x := by obtain ⟨q, hq, hgrad⟩ := gradientSpace_has_potential p hp g hrep hg exact ⟨radialPotential_smooth g hg.continuous q hq hgrad, radialPotential_zero g, radialPotential_gradient g hg.continuous q hq hgrad⟩ /-- An F-adjoint pressure residual is the actual pullback of a scalar gradient. -/ theorem weighted_pressure_has_potential (F FT : Field) (hFT : ∀ x, FT x = (F x).adjoint) (r : L2) (hr : (multiplier F).adjoint r ∈ gradientSpace) (g : Space → Space) (hrep : r =ᵐ[volume] g) (hg : ContDiff ℝ ∞ (fun x => (F x).adjoint (g x))) : ContDiff ℝ ∞ (radialPotential (fun x => (F x).adjoint (g x))) ∧ radialPotential (fun x => (F x).adjoint (g x)) 0 = 0 ∧ ∀ x, gradient (radialPotential (fun x => (F x).adjoint (g x))) x = (F x).adjoint (g x) := by apply gradientSpace_radial_potential ((multiplier F).adjoint r) hr (fun x => (F x).adjoint (g x)) ?_ hg rw [← multiplier_adjoint F FT hFT] filter_upwards [multiplier_ae FT r, hrep] with x hx hrx rw [hx, hrx, hFT] end EulerMeanPressure end end noncomputable section namespace EulerMeanClassical open MeasureTheory InnerProductSpace EulerSmoothLimit EulerVectorCalculus EulerMeanSolenoidal EulerMeanSmoothRepresentative EulerMeanPressure EulerCanonicalGraphPotential open scoped ContDiff theorem solenoidal_representative_divergence (u : L2) (hu : u ∈ solenoidalSpace) (f : Space → Space) (hf : ContDiff ℝ ∞ f) (hrep : u =ᵐ[volume] f) : ∀ x, divergence f x = 0 := by have he : divergence f = coordinateTrace ∘ fderiv ℝ f := by funext x exact (coordinateTrace_eq_linearTrace (fderiv ℝ f x)).symm have hc : Continuous (divergence f) := by rw [he] exact coordinateTrace.continuous.comp (hf.fderiv_right (m := ∞) (by simp)).continuous have hz : divergence f =ᵐ[volume] 0 := ae_eq_zero_of_integral_contDiff_smul_eq_zero hc.locallyIntegrable (fun φ hφ hcφ => by have hw := weak_divergence_test hu φ hcφ hφ have hi := gradient_test_integration_by_parts f hf φ hcφ hφ have heq : (∫ x, ⟪gradient φ x, u x⟫_ℝ) = ∫ x, ⟪gradient φ x, f x⟫_ℝ := by apply integral_congr_ae filter_upwards [hrep] with x hx rw [hx] change (∫ x, φ x * divergence f x) = 0 rw [heq, hi] at hw exact neg_eq_zero.mp hw) intro x exact congrFun (Measure.eq_of_ae_eq hz hc continuous_const) x /-- The actual smooth representative inherits the weak solenoidal constraint pointwise. -/ theorem representative_divergence (u : L2) (hu : u ∈ solenoidalSpace) (hs : SmoothOrbit u) : ∀ x, divergence (representative u hs) x = 0 := solenoidal_representative_divergence u hu (representative u hs) (representative_smooth u hs) (representative_ae u hs) end EulerMeanClassical