import Euler.OrdinaryGradientProducts import Euler.OrdinaryTameEnergy import Euler.OrdinaryEulerL2Stability import Euler.ContinuousTimeIntegral import Euler.OrdinaryEulerHigherEnergy /-! Actual gradient-supremum control of Euler Sobolev norms. The gradient norm is a constructed continuous path, its time integral controls H³, and the checked H³-tame estimate then propagates every higher order on the same time interval. -/ /-! ## From `Euler/OrdinaryGradientEnergy.lean` The text of `Euler/OrdinaryGradientEnergy.lean`, folded into this file, which was its only importer. -/ section /-! Sharp H³ transport energy with the actual L-infinity norm of the velocity gradient. The pressure and undifferentiated transport cancel before the cubic-test interpolation estimate is used. -/ noncomputable section namespace EulerOrdinarySobolev open MeasureTheory InnerProductSpace ContinuousLinearMap EulerSmoothLimit EulerLpTranslation EulerLpTranslation.SmoothL2Field EulerMeanSolenoidal Finset theorem gradientSup_advection_outer (A : SmoothL2Field Space) (K N : ℝ) (hK : ∀ x, ‖fderiv ℝ A.field x‖ ≤ K) (hN : WordBound 3 N A) {n k l : ℕ} (hk : 1 ≤ k) (horder : n+k+l ≤ 3) (a : Fin n → Fin 3) (w : Fin k → Fin 3) (v : Fin l → Fin 3) : ‖(wordField (advectionField (wordField A w) (wordField A v)) a).toLp‖ ≤ 27*(2 : ℝ)^n*K*N := by rw [advectionField,wordField_sum,toLp_sumField] apply (norm_sum_le _ _).trans calc _ ≤ ∑ _i : Fin 3, (2 : ℝ)^n*9*K*N := by apply sum_le_sum intro i _ simpa only [wordField_cons] using gradient_tame_outer_product A K N hK hN hk (by omega : 1 ≤ l+1) (by omega : n+k+(l+1) ≤ 4) a w (Fin.cons i v) i _ = _ := by simp only [sum_const,card_univ,Fintype.card_fin,nsmul_eq_mul]; ring theorem gradient_transportCommutator_word (A : SmoothL2Field Space) (K N : ℝ) (hK : ∀ x, ‖fderiv ℝ A.field x‖ ≤ K) (hN : WordBound 3 N A) {n l : ℕ} (horder : n+l ≤ 3) (a : Fin n → Fin 3) (v : Fin l → Fin 3) : ‖(transportCommutator A (wordField A v) a).toLp‖ ≤ 27*((2 : ℝ)^n-1)*K*N := by induction n generalizing l with | zero => simp only [transportCommutator_zero,norm_zero,pow_zero,sub_self,mul_zero,zero_mul,le_refl] | succ n ih => have he : transportCommutator A (wordField A v) a = addField (wordField (advectionField (A.directionalField (axis (a (Fin.last n)))) (wordField A v)) (Fin.init a)) (transportCommutator A (wordField A (Fin.cons (a (Fin.last n)) v)) (Fin.init a)) := by simpa only [Fin.snoc_init_self,wordField_cons] using transportCommutator_snoc A (wordField A v) (Fin.init a) (a (Fin.last n)) rw [he,toLp_addField] apply (norm_add_le _ _).trans have h1 := gradientSup_advection_outer A K N hK hN (by norm_num : 1 ≤ 1) (by omega : n+1+l ≤ 3) (Fin.init a) (Fin.cons (a (Fin.last n)) Fin.elim0) v have h2 := ih (by omega : n+(l+1) ≤ 3) (Fin.init a) (Fin.cons (a (Fin.last n)) v) simp only [wordField_cons,wordField_zero] at h1 exact (add_le_add h1 h2).trans_eq (by rw [pow_succ]; ring) theorem gradient_transportCommutator (A : SmoothL2Field Space) (K N : ℝ) (hK : ∀ x, ‖fderiv ℝ A.field x‖ ≤ K) (hN : WordBound 3 N A) {n : ℕ} (hn : n ≤ 3) (w : Fin n → Fin 3) : ‖(transportCommutator A A w).toLp‖ ≤ 27*((2 : ℝ)^n-1)*K*N := by simpa only [wordField_zero] using gradient_transportCommutator_word A K N hK hN (by simpa only [Nat.add_zero] using hn) w Fin.elim0 def gradientEnergyConstant : ℝ := 54*(∑ n ∈ range 4, (6 : ℝ)^n) theorem gradientEnergyConstant_nonneg : 0 ≤ gradientEnergyConstant := by exact mul_nonneg (by norm_num) (sum_nonneg (fun _ _ => by positivity)) theorem eulerRhs_word_gradient (A P : SmoothL2Field Space) (K : ℝ) (hK : ∀ x, ‖fderiv ℝ A.field x‖ ≤ K) (hdiv : ∀ x, divergence A.field x=0) (hA : A.toLp ∈ solenoidalSpace) (hP : P.toLp ∈ gradientSpace) {n : ℕ} (hn : n ≤ 3) (w : Fin n → Fin 3) : ⟪(wordField A w).toLp,(wordField (eulerRhs A P) w).toLp⟫_ℝ ≤ 27*(2 : ℝ)^n*K*wordEnergy 3 A := by let X := Real.sqrt (wordEnergy 3 A) have hx : X^2=wordEnergy 3 A := Real.sq_sqrt (wordEnergy_nonneg 3 A) have hN : WordBound 3 X A := wordBound_sqrt_energy 3 A have hb := gradient_transportCommutator A K X hK hN hn w have hK0 : 0 ≤ K := (norm_nonneg (fderiv ℝ A.field 0)).trans (hK 0) have hX : 0 ≤ X := Real.sqrt_nonneg _ have hb' : ‖(transportCommutator A A w).toLp‖ ≤ 27*(2 : ℝ)^n*K*X := by apply hb.trans have hcoef : 27*((2 : ℝ)^n-1) ≤ 27*(2 : ℝ)^n := by linarith exact mul_le_mul_of_nonneg_right (mul_le_mul_of_nonneg_right hcoef hK0) hX rw [eulerRhs_pairing A P hdiv hA hP w] calc _ ≤ |⟪(transportCommutator A A w).toLp,(wordField A w).toLp⟫_ℝ| := neg_le_abs _ _ ≤ ‖(transportCommutator A A w).toLp‖*‖(wordField A w).toLp‖ := abs_real_inner_le_norm _ _ _ ≤ (27*(2 : ℝ)^n*K*X)*X := mul_le_mul hb' (hN n hn w) (norm_nonneg _) (by positivity) _ = 27*(2 : ℝ)^n*K*wordEnergy 3 A := by rw [← hx]; ring theorem h3_energy_gradient (A P : SmoothL2Field Space) (K : ℝ) (hK : ∀ x, ‖fderiv ℝ A.field x‖ ≤ K) (hdiv : ∀ x, divergence A.field x=0) (hA : A.toLp ∈ solenoidalSpace) (hP : P.toLp ∈ gradientSpace) : integerEnergyProduction 3 A (eulerRhs A P) ≤ gradientEnergyConstant*K*wordEnergy 3 A := by have hs : (∑ n ∈ range 4, ∑ w : Fin n → Fin 3, ⟪(wordField A w).toLp,(wordField (eulerRhs A P) w).toLp⟫_ℝ) ≤ ∑ n ∈ range 4, (3 : ℝ)^n*(27*(2 : ℝ)^n*K*wordEnergy 3 A) := by apply sum_le_sum intro n hn calc _ ≤ ∑ _w : Fin n → Fin 3, 27*(2 : ℝ)^n*K*wordEnergy 3 A := sum_le_sum (fun w _ => eulerRhs_word_gradient A P K hK hdiv hA hP (by have := mem_range.mp hn; omega) w) _ = _ := by simp have hp (n : ℕ) : (3 : ℝ)^n*(27*(2 : ℝ)^n*K*wordEnergy 3 A) = (6 : ℝ)^n*(27*K*wordEnergy 3 A) := by rw [show (6 : ℝ)=3*2 by norm_num,mul_pow] ring simp_rw [hp] at hs rw [← sum_mul] at hs exact (mul_le_mul_of_nonneg_left hs (by norm_num : (0 : ℝ) ≤ 2)).trans_eq (by unfold gradientEnergyConstant; ring) end EulerOrdinarySobolev end end /-! ## From `Euler/OrdinaryVariableGronwall.lean` The text of `Euler/OrdinaryVariableGronwall.lean`, folded into this file, which was its only importer. -/ section /-! A variable-coefficient Gronwall estimate from a genuine one-sided time derivative. The integrating factor uses the actual time integral. -/ noncomputable section namespace EulerOrdinarySobolev open Set EulerVolterraConvolution EulerContinuousTimeIntegral open scoped Topology theorem variable_linear_stability (T : ℝ) (hT : 0 ≤ T) (X X' : ℝ → ℝ) (C : ℝ) (K : C(Icc (0 : ℝ) T,ℝ)) (hcont : ContinuousOn X (Icc 0 T)) (hder : ∀ t ∈ Ico 0 T, HasDerivWithinAt X (X' t) (Icc 0 T) t) (hineq : ∀ t ∈ Ico 0 T, X' t ≤ C*extendPath T hT K t*X t) (t : Icc (0 : ℝ) T) : X t ≤ X 0*Real.exp (C*realIntegral T hT K t) := by let I := realIntegral T hT K let Y := fun r => X r*Real.exp (-C*I r) let Y' := fun r => Real.exp (-C*I r)*(X' r-C*extendPath T hT K r*X r) have hI (r : ℝ) : HasDerivAt I (extendPath T hT K r) r := realIntegral_hasDerivAt T hT K r have hcI : Continuous I := (show Differentiable ℝ I from fun r => (hI r).differentiableAt).continuous have hcY : ContinuousOn Y (Icc 0 T) := hcont.mul ((Real.continuous_exp.comp (hcI.const_mul (-C))).continuousOn) have hdY (r : ℝ) (hr : r ∈ Ico 0 T) : HasDerivWithinAt Y (Y' r) (Icc 0 T) r := by have h := (hder r hr).mul (((hI r).const_mul (-C)).exp.hasDerivWithinAt) have he : Y' r = X' r*Real.exp (-C*I r)+ X r*(Real.exp (-C*I r)*(-C*extendPath T hT K r)) := by dsimp [Y'] ring rw [he] exact h have hbY (r : ℝ) (hr : r ∈ Ico 0 T) : Y' r ≤ 0*Y r := by dsimp [Y'] rw [zero_mul] exact mul_nonpos_of_nonneg_of_nonpos (Real.exp_pos _).le (sub_nonpos.mpr (hineq r hr)) have hy := linear_stability_within Y Y' 0 T hcY hdY hbY t t.property have hI0 : I 0=0 := intervalIntegral.integral_same have hY0 : Y 0=X 0 := by simp only [Y,hI0,mul_zero,Real.exp_zero,mul_one] simp only [hY0,zero_mul,Real.exp_zero,mul_one] at hy have he : (X 0*Real.exp (C*I t))*Real.exp (-C*I t)=X 0 := by rw [mul_assoc,← Real.exp_add] simp only [show C*I t+-C*I t=0 by ring,Real.exp_zero,mul_one] apply (mul_le_mul_iff_left₀ (Real.exp_pos (-C*I t))).mp change Y t ≤ (X 0*Real.exp (C*I t))*Real.exp (-C*I t) rw [he] exact hy end EulerOrdinarySobolev end end noncomputable section namespace EulerOrdinarySobolev.Evolution open Set MeasureTheory EulerSmoothLimit EulerLpTranslation EulerLpTranslation.SmoothL2Field EulerMeanSolenoidal EulerMeanClassical EulerMeanSobolevBoundedField EulerVolterraConvolution EulerContinuousTimeIntegral variable {T : ℝ} {hT : 0 ≤ T} def gradientNormPath (U : Evolution T hT) : C(Icc (0 : ℝ) T,ℝ) := ⟨fun t => ‖finiteField (U.velocity t).derivative‖, (continuous_finiteField (fun t => (U.velocity t).derivative) (continuous_jetLp_derivative U.velocity U.velocity_continuous)).norm⟩ theorem gradientNormPath_nonneg (U : Evolution T hT) (t : Icc (0 : ℝ) T) : 0 ≤ U.gradientNormPath t := by change 0 ≤ ‖finiteField (U.velocity t).derivative‖ exact norm_nonneg _ theorem gradientNormPath_le_iff (U : Evolution T hT) (t : Icc (0 : ℝ) T) (K : ℝ) : U.gradientNormPath t ≤ K ↔ ∀ x, ‖fderiv ℝ (U.velocity t).field x‖ ≤ K := by change ‖finiteField (U.velocity t).derivative‖ ≤ K ↔ _ rw [BoundedContinuousFunction.norm_le_of_nonempty] simp only [finiteField_apply] rfl theorem pointwise_gradient_le (U : Evolution T hT) (t : Icc (0 : ℝ) T) (x : Space) : ‖fderiv ℝ (U.velocity t).field x‖ ≤ U.gradientNormPath t := (U.gradientNormPath_le_iff t _).mp le_rfl x def gradientIntegral (U : Evolution T hT) (t : Icc (0 : ℝ) T) : ℝ := realIntegral T hT U.gradientNormPath t theorem gradientIntegral_nonneg (U : Evolution T hT) (t : Icc (0 : ℝ) T) : 0 ≤ U.gradientIntegral t := intervalIntegral.integral_nonneg_of_forall t.property.1 (fun r => U.gradientNormPath_nonneg (projIcc 0 T hT r)) theorem gradientIntegral_le_const (U : Evolution T hT) (K : ℝ) (hK : ∀ t x, ‖fderiv ℝ (U.velocity t).field x‖ ≤ K) (t : Icc (0 : ℝ) T) : U.gradientIntegral t ≤ K*(t : ℝ) := by have hc := extendPath_continuous T hT U.gradientNormPath calc _ ≤ ∫ _r in (0 : ℝ)..(t : ℝ), K := intervalIntegral.integral_mono_on t.property.1 (hc.intervalIntegrable 0 t) (continuous_const.intervalIntegrable 0 t) (fun r _ => (U.gradientNormPath_le_iff (projIcc 0 T hT r) K).mpr (hK _)) _ = _ := by simp only [intervalIntegral.integral_const,sub_zero,smul_eq_mul]; ring theorem integerEnergyDerivative_gradient (U : Evolution T hT) (K : ℝ) (t : Icc (0 : ℝ) T) (hK : ∀ x, ‖fderiv ℝ (U.velocity t).field x‖ ≤ K) : U.integerEnergyDerivative 3 t ≤ gradientEnergyConstant*K*U.integerEnergyPath 3 t := by rw [integerEnergyDerivative,derivative_eq_eulerRhs] apply h3_energy_gradient _ _ K hK _ (U.solenoidal t) (U.gradient t) exact solenoidal_representative_divergence _ (U.solenoidal t) _ (U.velocity t).smooth (U.velocity t).toLp_ae theorem h3_energy_gradientIntegral (U : Evolution T hT) (t : Icc (0 : ℝ) T) : wordEnergy 3 (U.velocity t) ≤ wordEnergy 3 (U.velocity ⟨0,le_rfl,hT⟩)* Real.exp (gradientEnergyConstant*U.gradientIntegral t) := by have hd (r : ℝ) (hr : r ∈ Ico 0 T) : HasDerivWithinAt (extendPath T hT (U.integerEnergyPath 3)) (U.integerEnergyDerivative 3 (projIcc 0 T hT r)) (Icc 0 T) r := by have h := U.integerEnergy_hasDerivWithinAt 3 ⟨r,hr.1,hr.2.le⟩ simpa only [projIcc_of_mem hT (show r ∈ Icc 0 T from ⟨hr.1,hr.2.le⟩)] using h have hb (r : ℝ) (_hr : r ∈ Ico 0 T) : U.integerEnergyDerivative 3 (projIcc 0 T hT r) ≤ gradientEnergyConstant*extendPath T hT U.gradientNormPath r* extendPath T hT (U.integerEnergyPath 3) r := U.integerEnergyDerivative_gradient _ _ (U.pointwise_gradient_le _) have h := variable_linear_stability T hT (extendPath T hT (U.integerEnergyPath 3)) (fun r => U.integerEnergyDerivative 3 (projIcc 0 T hT r)) gradientEnergyConstant U.gradientNormPath ((U.integerEnergyPath 3).continuous.comp continuous_projIcc).continuousOn hd hb t simpa only [extendPath,projIcc_of_mem hT t.property, projIcc_of_mem hT (show (0 : ℝ) ∈ Icc 0 T from ⟨le_rfl,hT⟩), integerEnergyPath,ContinuousMap.coe_mk,gradientIntegral] using h def gradientH3Bound (U : Evolution T hT) (G : ℝ) : ℝ := Real.sqrt (wordEnergy 3 (U.velocity ⟨0,le_rfl,hT⟩)*Real.exp (gradientEnergyConstant*G)) theorem wordBound_of_gradientIntegral (U : Evolution T hT) (G : ℝ) (hG : ∀ t, U.gradientIntegral t ≤ G) (t : Icc (0 : ℝ) T) : WordBound 3 (U.gradientH3Bound G) (U.velocity t) := by intro n hn w apply (wordBound_sqrt_energy 3 (U.velocity t) n hn w).trans apply Real.sqrt_le_sqrt exact (U.h3_energy_gradientIntegral t).trans (mul_le_mul_of_nonneg_left (Real.exp_le_exp.mpr (mul_le_mul_of_nonneg_left (hG t) gradientEnergyConstant_nonneg)) (wordEnergy_nonneg _ _)) theorem h3_tensorNorm_of_gradientIntegral (U : Evolution T hT) (G : ℝ) (hG : ∀ t, U.gradientIntegral t ≤ G) (t : Icc (0 : ℝ) T) : tensorNorm 3 (U.velocity t) ≤ wordCount 3*U.gradientH3Bound G := tensorNorm_le_wordCount _ 3 _ (U.wordBound_of_gradientIntegral G hG t) end EulerOrdinarySobolev.Evolution