import Euler.CorrectionDifferencePDE import Euler.SobolevDifferenceEnergy /-! Concrete coefficient and inverse-metric data for actual vanishing-viscosity stability. -/ /-! ## From `Euler/CorrectionDifferenceMetric.lean` The text of `Euler/CorrectionDifferenceMetric.lean`, folded into this file, which was its only importer. -/ section /-! The actual nonlinear viscosity-difference PDE implies a fixed squared metric energy inequality. -/ noncomputable section namespace EulerCorrectionDifferenceMetric open MeasureTheory Set InnerProductSpace EulerLiftedGradientSpace EulerLiftedPressure EulerSpatialSobolevInverse EulerCylinderSobolevSpace EulerCorrectionOperators EulerCorrectionDifference EulerCorrectionDifferencePDE EulerCorrectionStabilityConstants EulerSobolevTransport EulerSobolevMetricTransport EulerSobolevHeatGenerator EulerMetricHeatEnergy EulerSobolevL2Product EulerSquaredMetricStability EulerSobolevDifferenceEnergy open scoped Topology variable (period : ℝ) [Fact (0 < period)] /-- The existing Sobolev normed-group instance for the literal metric difference equation. -/ local instance metricSobolevGroup (q : ℕ) : NormedAddCommGroup (SobolevSpace period q) := inferInstance /-- The existing real Sobolev module instance for the literal metric difference equation. -/ local instance metricSobolevSpace (q : ℕ) : NormedSpace ℝ (SobolevSpace period q) := inferInstance /-- The actual correction-difference PDE gives the quantitative squared L² metric bound, with no assumed energy inequality. -/ theorem difference_metric_deriv_bound {q : ℕ} {T : Type*} [TopologicalSpace T] (D : CorrectionData period q T) (hq : 6 ≤ q) (τ : T) (u v : SobolevSpace period (q+1)) (A : SmoothCoefficient period) (K : ℝ → LiftL2 period →L[ℝ] LiftL2 period) (e : ℝ → LiftL2 period) (t ν μ c Kb Kx Kt A0 A2 Z R : ℝ) (K' : LiftL2 period →L[ℝ] LiftL2 period) (hc : 0 < c) (hν : 0 ≤ ν) (hν1 : ν ≤ 1) (hKv : K t=A.operator) (hev : e t=value period (u-v)) (hK : HasDerivAt K K' t) (he : HasDerivAt e (differenceRhs period D hq ν μ τ u v) t) (hKb : ‖A.operator‖ ≤ Kb) (hKx : (A.firstBound : ℝ) ≤ Kx) (hKt : ‖K'‖ ≤ Kt) (hA0 : ((D.linear.coefficient τ).bound : ℝ) ≤ A0) (hA2 : (∑ i : Fin 3, (((D.quadratic i).coefficient τ).bound : ℝ)) ≤ A2) (hZ : ‖D.approximation τ‖ ≤ Z) (hu : ‖u‖ ≤ R) (hv : ‖v‖ ≤ R) (hsym : ∀ x a b, ⟪A.coefficient x a,b⟫_ℝ=⟪a,A.coefficient x b⟫_ℝ) (hpos : ∀ x a, c^2*‖a‖^2 ≤ ⟪A.coefficient x a,a⟫_ℝ) (hinv : ∀ x a, A.coefficient x ((D.metric.coefficient τ).coefficient x a)=a) (hz : value period (D.approximation τ) ∈ divergenceFreeSpace period D.κ D.direction) (hud : value period u ∈ divergenceFreeSpace period D.κ D.direction) (hvd : value period v ∈ divergenceFreeSpace period D.κ D.direction) : deriv (fun s => ⟪K s (e s),e s⟫_ℝ) t ≤ growthConstant c Kb Kx Kt (velocityBound period q Z R) (lowerConstant period q A0 A2 Z R)* ⟪K t (e t),e t⟫_ℝ+defectConstant Kb R*|ν-μ|^2 := by let d := u-v let top := value period (transportBilinear period hq (velocityComponents D.κ D.direction) (velocityComponents_norm D.κ D.direction D.scale_bound D.direction_bound) (D.approximation τ+u) d) let p := value period (D.pressure period hq τ u)-value period (D.pressure period hq τ v) let F := -value period (differenceRemainder period D hq τ u v)+ (ν-μ) • laplacianEvaluation period (q+1) (by omega) v let L := lowerConstant period q A0 A2 Z R let V := velocityBound period q Z R have hr0 := (norm_nonneg u).trans hu have hz0 := (norm_nonneg (D.approximation τ)).trans hZ have ha00 := (D.linear.coefficient τ).bound.coe_nonneg.trans hA0 have ha20 := (Finset.sum_nonneg (fun i _ => ((D.quadratic i).coefficient τ).bound.coe_nonneg)).trans hA2 have hL : 0 ≤ L := lowerConstant_nonneg period q A0 A2 Z R ha00 ha20 hz0 hr0 have hV : 0 ≤ V := velocityBound_nonneg period q Z R hz0 hr0 have hkx0 := A.firstBound.coe_nonneg.trans hKx have hkb0 := (norm_nonneg A.operator).trans hKb have hkt0 := (norm_nonneg K').trans hKt have heq : differenceRhs period D hq ν μ τ u v+top+(D.metric.coefficient τ).operator p = F+ν • laplacianEvaluation period (q+1) (by omega) d := by dsimp only [differenceRhs,p,F,d] abel have hdiv : value period d ∈ divergenceFreeSpace period D.κ D.direction := (divergenceFreeSpace period D.κ D.direction).sub_mem hud hvd have hpgrad : p ∈ gradientSpace period D.κ D.direction := (gradientSpace period D.κ D.direction).sub_mem (D.pressure_mem_gradient period hq τ u) (D.pressure_mem_gradient period hq τ v) have hp : ⟪K t (e t),(D.metric.coefficient τ).operator p⟫_ℝ=0 := by rw [hKv,hev] exact metric_pressure_cancellation period D.κ D.direction A.coefficient (D.metric.coefficient τ).coefficient A.measurable (D.metric.coefficient τ).measurable A.bound (D.metric.coefficient τ).bound A.norm_bound (D.metric.coefficient τ).norm_bound hsym hinv hdiv hpgrad have ht : |⟪K t (e t),top⟫_ℝ| ≤ (Kx*V)*‖e t‖^2 := by rw [hKv,hev] exact difference_transport_bound period D hq τ A u v Kx Z R hKx hZ hu hsym hz hud have hheat : ⟪K t (e t),laplacianEvaluation period (q+1) (by omega) d⟫_ℝ ≤ (2*Kx^2/c^2)*‖e t‖^2 := by rw [hKv,hev] exact difference_heat_bound period (by omega : 2 ≤ q+1) A d c Kx hc hKx hpos have hforce : ‖F‖ ≤ L*‖e t‖+|ν-μ| *(4*R) := by rw [hev] have hrem := differenceRemainder_uniform period D hq τ u v A0 A2 Z R hA0 hA2 hZ hu hv have hlap := (laplacianEvaluation_bound period (by omega : 2 ≤ q+1) v).trans (mul_le_mul_of_nonneg_left hv (by norm_num : (0 : ℝ) ≤ 4)) have hh := norm_add_le (-value period (differenceRemainder period D hq τ u v)) ((ν-μ) • laplacianEvaluation period (q+1) (by omega) v) rw [norm_neg,norm_smul,Real.norm_eq_abs] at hh exact hh.trans (add_le_add hrem (mul_le_mul_of_nonneg_left hlap (abs_nonneg _))) have hcoer : c^2*‖e t‖^2 ≤ ⟪K t (e t),e t⟫_ℝ := by rw [hKv] exact coefficientOperator_coercive A.coefficient A.measurable A.bound A.norm_bound (c^2) hpos (e t) have hsymL : ∀ a b, ⟪K t a,b⟫_ℝ=⟪a,K t b⟫_ℝ := by rw [hKv] exact coefficientOperator_inner_swap A.coefficient A.measurable A.bound A.norm_bound hsym have hgen := metric_derivative_bound K e t ν c (Kx*V) (2*Kx^2/c^2) L |ν-μ| (4*R) K' (differenceRhs period D hq ν μ τ u v) top ((D.metric.coefficient τ).operator p) F (laplacianEvaluation period (q+1) (by omega) d) hc hν (mul_nonneg hkx0 hV) (by positivity) hL hK he hsymL hcoer heq hp ht hheat hforce have he0 : 0 ≤ ⟪K t (e t),e t⟫_ℝ := (mul_nonneg (sq_nonneg c) (sq_nonneg ‖e t‖)).trans hcoer have hkn : ‖K t‖ ≤ Kb := by rw [hKv]; exact hKb have hg : (‖K'‖+2*(Kx*V)+2*ν*(2*Kx^2/c^2)+2*‖K t‖*L+1)/c^2 ≤ growthConstant c Kb Kx Kt V L := by unfold growthConstant apply div_le_div_of_nonneg_right _ (sq_nonneg c) have hh : 2*ν*(2*Kx^2/c^2) ≤ 4*Kx^2/c^2 := by calc _ = ν*(4*Kx^2/c^2) := by ring _ ≤ 1*(4*Kx^2/c^2) := mul_le_mul_of_nonneg_right hν1 (by positivity) _ = _ := one_mul _ have hk : 2*‖K t‖*L ≤ 2*Kb*L := by have h := mul_le_mul_of_nonneg_right hkn (mul_nonneg (by norm_num : (0 : ℝ) ≤ 2) hL) linarith only [h] have hsum := add_le_add (add_le_add (add_le_add hKt (le_refl (2*(Kx*V)))) hh) hk exact (add_le_add hsum (le_refl 1)).trans_eq (by ring) have hd : (‖K t‖*(4*R))^2 ≤ defectConstant Kb R := by have h := mul_le_mul_of_nonneg_right hkn (mul_nonneg (by norm_num : (0 : ℝ) ≤ 4) hr0) exact pow_le_pow_left₀ (mul_nonneg (norm_nonneg (K t)) (mul_nonneg (by norm_num : (0 : ℝ) ≤ 4) hr0)) h 2 exact hgen.trans (add_le_add (mul_le_mul_of_nonneg_right hg he0) (mul_le_mul_of_nonneg_right hd (sq_nonneg _))) end EulerCorrectionDifferenceMetric end end noncomputable section namespace EulerCorrectionStabilityBudget open MeasureTheory Set InnerProductSpace EulerLiftedGradientSpace EulerCylinderSobolevSpace EulerSpatialSobolevInverse EulerCorrectionOperators EulerCorrectionStabilityConstants EulerVolterraConvolution open scoped Topology variable (period : ℝ) [Fact (0 < period)] /-- Actual coefficient and inverse-metric budgets for L² comparison; no PDE estimate or solution comparison is a field. -/ structure StabilityBudget {q : ℕ} {T : ℝ} (hT : 0 ≤ T) (D : CorrectionData period q (Icc (0 : ℝ) T)) where /-- The actual inverse metric coefficient. -/ metric : Icc (0 : ℝ) T → SmoothCoefficient period /-- The actual metric multiplier is continuous in time. -/ continuous : Continuous (fun t => (metric t).operator) /-- The genuine time derivative of the metric multiplier. -/ derivative : C(Icc (0 : ℝ) T,LiftL2 period →L[ℝ] LiftL2 period) /-- Interior differentiation of the actual metric path. -/ hasDeriv : ∀ t ∈ Ioo 0 T, HasDerivAt (fun s => (metric (projIcc 0 T hT s)).operator) (extendPath T hT derivative t) t /-- Positive square-root coercivity constant. -/ c : ℝ /-- Strict coercivity. -/ c_pos : 0 < c /-- Pointwise metric symmetry. -/ symmetric : ∀ t x a b, ⟪(metric t).coefficient x a,b⟫_ℝ=⟪a,(metric t).coefficient x b⟫_ℝ /-- Pointwise positive lower bound. -/ coercive : ∀ t x a, c^2*‖a‖^2 ≤ ⟪(metric t).coefficient x a,a⟫_ℝ /-- The actual metric inverts the pressure coefficient. -/ inverse : ∀ t x a, (metric t).coefficient x ((D.metric.coefficient t).coefficient x a)=a /-- Uniform metric operator bound. -/ bound : ℝ /-- Uniform metric first spatial derivative bound. -/ first : ℝ /-- Uniform metric time derivative bound. -/ time : ℝ /-- Uniform linear-coefficient bound. -/ linear : ℝ /-- Uniform sum of quadratic-coefficient bounds. -/ quadratic : ℝ /-- The actual metric operator satisfies its budget. -/ bound_le : ∀ t, ‖(metric t).operator‖ ≤ bound /-- The actual first spatial derivative witness satisfies its budget. -/ first_le : ∀ t, ((metric t).firstBound : ℝ) ≤ first /-- The actual time derivative satisfies its budget. -/ time_le : ∀ t, ‖derivative t‖ ≤ time /-- The actual linear coefficient satisfies its budget. -/ linear_le : ∀ t, ((D.linear.coefficient t).bound : ℝ) ≤ linear /-- The actual quadratic coefficients satisfy their common budget. -/ quadratic_le : ∀ t, (∑ i : Fin 3, (((D.quadratic i).coefficient t).bound : ℝ)) ≤ quadratic /-- The actual continuous metric multiplier path determined by the concrete budget. -/ def StabilityBudget.operatorPath {q : ℕ} {T : ℝ} {hT : 0 ≤ T} {D : CorrectionData period q (Icc (0 : ℝ) T)} (B : StabilityBudget period hT D) : C(Icc (0 : ℝ) T,LiftL2 period →L[ℝ] LiftL2 period) := ⟨fun t => (B.metric t).operator,B.continuous⟩ /-- The fixed squared-energy growth coefficient obtained from the actual background path and a solution norm bound. -/ def StabilityBudget.growth {q : ℕ} {T : ℝ} {hT : 0 ≤ T} {D : CorrectionData period q (Icc (0 : ℝ) T)} (B : StabilityBudget period hT D) (R : ℝ) : ℝ := growthConstant B.c B.bound B.first B.time (velocityBound period q ‖D.approximation‖ R) (lowerConstant period q B.linear B.quadratic ‖D.approximation‖ R) /-- The explicit finite-interval Lipschitz coefficient for viscosity in continuous L². -/ def StabilityBudget.comparisonConstant {q : ℕ} {T : ℝ} {hT : 0 ≤ T} {D : CorrectionData period q (Icc (0 : ℝ) T)} (B : StabilityBudget period hT D) (R : ℝ) : ℝ := Real.sqrt (defectConstant B.bound R*T*Real.exp (B.growth period R*T))/B.c /-- All budget signs follow from the actual norm bounds on the nonempty time interval. -/ theorem StabilityBudget.nonneg {q : ℕ} {T : ℝ} {hT : 0 ≤ T} {D : CorrectionData period q (Icc (0 : ℝ) T)} (B : StabilityBudget period hT D) : 0 ≤ B.bound ∧ 0 ≤ B.first ∧ 0 ≤ B.time ∧ 0 ≤ B.linear ∧ 0 ≤ B.quadratic := by let t : Icc (0 : ℝ) T := ⟨0,le_rfl,hT⟩ exact ⟨(norm_nonneg _).trans (B.bound_le t), (B.metric t).firstBound.coe_nonneg.trans (B.first_le t), (norm_nonneg _).trans (B.time_le t), (D.linear.coefficient t).bound.coe_nonneg.trans (B.linear_le t), (Finset.sum_nonneg (fun i _ => ((D.quadratic i).coefficient t).bound.coe_nonneg)).trans (B.quadratic_le t)⟩ /-- The actual fixed growth coefficient is nonnegative for every nonnegative solution bound. -/ theorem StabilityBudget.growth_nonneg {q : ℕ} {T : ℝ} {hT : 0 ≤ T} {D : CorrectionData period q (Icc (0 : ℝ) T)} (B : StabilityBudget period hT D) (R : ℝ) (hR : 0 ≤ R) : 0 ≤ B.growth period R := by obtain ⟨hb,hf,ht,hl,hq⟩ := B.nonneg period exact growthConstant_nonneg B.c B.bound B.first B.time _ _ hb hf ht (velocityBound_nonneg period q ‖D.approximation‖ R (norm_nonneg D.approximation) hR) (lowerConstant_nonneg period q B.linear B.quadratic ‖D.approximation‖ R hl hq (norm_nonneg D.approximation) hR) /-- The explicit comparison coefficient is nonnegative. -/ theorem StabilityBudget.comparisonConstant_nonneg {q : ℕ} {T : ℝ} {hT : 0 ≤ T} {D : CorrectionData period q (Icc (0 : ℝ) T)} (B : StabilityBudget period hT D) (R : ℝ) : 0 ≤ B.comparisonConstant period R := div_nonneg (Real.sqrt_nonneg _) B.c_pos.le end EulerCorrectionStabilityBudget