import Euler.PacketInitializedUniformBounds import Euler.PacketCorrectionOutputPolynomial import Euler.PacketInitializedRadiusPolynomial import Euler.PacketWeightedPhysicalErrors import Euler.PacketExactGlobalShear import Euler.PacketInitializedHessianError import Euler.PacketLiftedFlowData /-! One fixed polynomial controls both correction admissibility and every source multiplier in the same-Q shear/Hessian and graph-flow estimates. -/ /-! ## From `Euler/PacketPhysicalCostPolynomial.lean` The text of `Euler/PacketPhysicalCostPolynomial.lean`, folded into this file, which was its only importer. -/ section /-! Fixed polynomial envelopes for the physical remainder, correction error and lifted-flow input costs. All spatial derivative orders here are fixed (H6 and one physical derivative). -/ noncomputable section namespace EulerPacketPhysicalCost open EulerSmoothLimit EulerPacketTerminalDatum EulerPacketProfileRecursion EulerPacketCylinderField EulerPacketCorrectionConstants EulerPacketCorrectionScalar EulerPacketCorrectionOutput EulerPacketFiveCost EulerCylinderSobolevSpace EulerCylinderCoordinates EulerPacketPhysicalGevrey EulerPacketInverseFlowGevrey EulerAllOrderDriftCorrection EulerPacketGraphHessian EulerPolynomialCost EulerParameterWordGevrey def coordinateCost : ℝ := ‖coordinateEquiv.symm.toContinuousLinearMap‖ def physicalEnvelope (X S : ℝ) : ℝ := 3*X*((1+18*X^2*X)*(9*X^2*(X+coordinateCost*2*S)+2)) def shearEnvelope (X : ℝ) : ℝ := coordinateCost*(sobolevEmbeddingConstant period 3*fixedVelocityGradeCost X X 1*(4*X))*X+ (8*coordinateCost*sobolevEmbeddingConstant period 3*X*(fixedVelocityGradeCost X X 2+2))*X def hessianEnvelope (X : ℝ) : ℝ := sobolevEmbeddingConstant period 3*fixedVelocityGradeCost X X 1*X^2*(X+coordinateCost*(4*X))+ 9*X*physicalEnvelope X (4*X)*sobolevEmbeddingConstant period 3*(fixedVelocityGradeCost X X 2+2) def timeEnvelope (X : ℝ) : ℝ := 6*EulerPacketRadiusPolynomial.normalEnvelope X* (fixedVelocityGradeCost X X 1+fixedVelocityGradeCost X X 2+1) def radiusEnvelope (X : ℝ) : ℝ := 1+coordinateCost*(4*X+4*inverseRadiusEnvelope X) def velocityInputEnvelope (X : ℝ) : ℝ := liftedInputConstant period*(velocity X X X+normal X X X) def errorInputEnvelope (X : ℝ) : ℝ := 2*liftedInputConstant period*outputEnvelope period X def timeInputEnvelope (X : ℝ) : ℝ := 2*liftedInputConstant period*(timeEnvelope X+outputEnvelope period X) def weightedErrorEnvelope (X : ℝ) : ℝ := (1+9*X)*physicalEnvelope X (4*inverseRadiusEnvelope X)*sobolevEmbeddingConstant period 3* outputEnvelope period X def extraEnvelope (X : ℝ) : ℝ := 1+outputEnvelope period X+radiusEnvelope X+velocityInputEnvelope X+errorInputEnvelope X+ timeInputEnvelope X+weightedErrorEnvelope X+shearEnvelope X+hessianEnvelope X def extraPolynomial : Polynomial ℝ := let X : Polynomial ℝ := Polynomial.X let c := Polynomial.C coordinateCost let e := Polynomial.C (sobolevEmbeddingConstant period 3) let l := Polynomial.C (liftedInputConstant period) let o := outputPolynomial period let i := 1+8*X+4*X^2+X let a1 := gradePolynomial 1 let a2 := gradePolynomial 2 let v := velocityPolynomial let n := X*(a2+2) let nb := coefficientPolynomial 6 (5*X+1) (1+X+6*X^2+729*X^6) let ti := 6*nb*(a1+a2+1) let pp := fun S : Polynomial ℝ => 3*X*((1+18*X^2*X)*(9*X^2*(X+c*2*S)+2)) let sh := c*(e*a1*(4*X))*X+(8*c*e*X*(a2+2))*X let he := e*a1*X^2*(X+c*(4*X))+9*X*pp (4*X)*e*(a2+2) 1+o+(1+c*(4*X+4*i))+l*(v+n)+2*l*o+2*l*(ti+o)+(1+9*X)*pp (4*i)*e*o+sh+he theorem extraPolynomial_eval (X : ℝ) : extraPolynomial.eval X=extraEnvelope X := by unfold extraPolynomial extraEnvelope radiusEnvelope velocityInputEnvelope errorInputEnvelope timeInputEnvelope weightedErrorEnvelope shearEnvelope hessianEnvelope physicalEnvelope timeEnvelope EulerPacketRadiusPolynomial.normalEnvelope EulerPacketRadiusPolynomial.coeff inverseRadiusEnvelope normal dsimp only simp only [Polynomial.eval_add,Polynomial.eval_mul,Polynomial.eval_one, Polynomial.eval_ofNat,Polynomial.eval_C,Polynomial.eval_pow,Polynomial.eval_X, outputPolynomial_eval,gradePolynomial_eval,velocityPolynomial_eval,coefficientPolynomial_eval] theorem physicalEnvelope_nonneg (X S : ℝ) (hX : 0 ≤ X) (hS : 0 ≤ S) : 0 ≤ physicalEnvelope X S := by have hc : 0 ≤ coordinateCost := norm_nonneg _ unfold physicalEnvelope positivity theorem extra_components (X : ℝ) (hX : 0 ≤ X) : outputEnvelope period X ≤ extraEnvelope X ∧ radiusEnvelope X ≤ extraEnvelope X ∧ velocityInputEnvelope X ≤ extraEnvelope X ∧ errorInputEnvelope X ≤ extraEnvelope X ∧ timeInputEnvelope X ≤ extraEnvelope X ∧ weightedErrorEnvelope X ≤ extraEnvelope X ∧ shearEnvelope X ≤ extraEnvelope X ∧ hessianEnvelope X ≤ extraEnvelope X := by have hc : 0 ≤ coordinateCost := norm_nonneg _ have he := sobolevEmbeddingConstant_nonneg period 3 have hl := zero_le_one.trans (liftedInputConstant_one_le period) have ho := zero_le_one.trans (output_components period X hX).1 have hi : 0 ≤ inverseRadiusEnvelope X := by unfold inverseRadiusEnvelope; positivity have hr : 0 ≤ radiusEnvelope X := by unfold radiusEnvelope; positivity have hv := velocity_nonneg X X X hX hX have hn := normal_nonneg X X X hX hX have hvi : 0 ≤ velocityInputEnvelope X := by unfold velocityInputEnvelope; positivity have hei : 0 ≤ errorInputEnvelope X := by unfold errorInputEnvelope; positivity have ha1 := fixedVelocityGradeCost_nonneg X X hX 1 have ha2 := fixedVelocityGradeCost_nonneg X X hX 2 have hb := EulerPacketRadiusPolynomial.normalEnvelope_nonneg X hX have ht : 0 ≤ timeEnvelope X := by unfold timeEnvelope; positivity have hti : 0 ≤ timeInputEnvelope X := by unfold timeInputEnvelope; positivity have hpp1 := physicalEnvelope_nonneg X (4*X) hX (by positivity) have hpp2 := physicalEnvelope_nonneg X (4*inverseRadiusEnvelope X) hX (by positivity) have hw : 0 ≤ weightedErrorEnvelope X := by unfold weightedErrorEnvelope; positivity have hsh : 0 ≤ shearEnvelope X := by unfold shearEnvelope; positivity have hhe : 0 ≤ hessianEnvelope X := by unfold hessianEnvelope; positivity unfold extraEnvelope refine ⟨?_,?_,?_,?_,?_,?_,?_,?_⟩ <;> linarith theorem gradeCost_mono (R H X : ℝ) (hR : 0 ≤ R) (hH : 0 ≤ H) (hRX : R ≤ X) (hHX : H ≤ X) (n : ℕ) : fixedVelocityGradeCost R H n ≤ fixedVelocityGradeCost X X n := by have hX := hR.trans hRX unfold fixedVelocityGradeCost gcongr variable {U : Type*} [NormedAddCommGroup U] [InnerProductSpace ℝ U] (D : EulerTransversePacketProvider.Data U) theorem physicalFixedCost_one_le (R C S X Y : ℝ) (hR : 0 ≤ R) (hC : 0 ≤ C) (hS : 0 ≤ S) (hRX : R ≤ X) (hCX : C ≤ X) (hSY : S ≤ Y) : physicalFixedCost D R C S 1 ≤ physicalEnvelope X Y := by have hX := hR.trans hRX have hY := hS.trans hSY have hc : 0 ≤ coordinateCost := norm_nonneg _ simp only [physicalFixedCost,physicalRadiusCost,sourceInverseRadius,physicalEnvelope, coordinateCost,D.m₀_unit,Nat.factorial_one,Nat.cast_one,pow_one,one_pow,mul_one] norm_num only gcongr theorem shearCost_le (R H C X : ℝ) (hR : 0 ≤ R) (hH : 0 ≤ H) (hC : 0 ≤ C) (hRX : R ≤ X) (hHX : H ≤ X) (hCX : C ≤ X) : initializedGlobalShearCost R H C ≤ shearEnvelope X := by have hX := hR.trans hRX have he := sobolevEmbeddingConstant_nonneg period 3 have hc : 0 ≤ coordinateCost := norm_nonneg _ have ha1 := gradeCost_mono R H X hR hH hRX hHX 1 have ha2 := gradeCost_mono R H X hR hH hRX hHX 2 have hg1 := fixedVelocityGradeCost_nonneg R H hR 1 have hg2 := fixedVelocityGradeCost_nonneg R H hR 2 have hg1X := hg1.trans ha1 have hg2X := hg2.trans ha2 have hrem : 0 ≤ initializedRemainderDerivativeCost R H := by unfold initializedRemainderDerivativeCost positivity unfold initializedGlobalShearCost shearEnvelope rw [abs_of_nonneg hrem] unfold initializedRemainderDerivativeCost coordinateCost gcongr theorem hessianCost_le {q : ℕ} {R₀ : ℝ} (N : EulerTransversePacketJoin.NormalBudget D q R₀) (R H Rc C X : ℝ) (hR : 0 ≤ R) (hH : 0 ≤ H) (hRc : 0 ≤ Rc) (hC : 0 ≤ C) (hRX : R ≤ X) (hHX : H ≤ X) (hRcX : Rc ≤ X) (hCX : C ≤ X) (hNR : N.Rc ≤ X) (hNC : N.C ≤ X) : initializedPressureHessianCost N R H Rc C ≤ hessianEnvelope X := by have hX := hR.trans hRX have he := sobolevEmbeddingConstant_nonneg period 3 have hc : 0 ≤ coordinateCost := norm_nonneg _ have ha1 := gradeCost_mono R H X hR hH hRX hHX 1 have ha2 := gradeCost_mono R H X hR hH hRX hHX 2 have hg1 := fixedVelocityGradeCost_nonneg R H hR 1 have hg2 := fixedVelocityGradeCost_nonneg R H hR 2 have hg1X := hg1.trans ha1 have hg2X := hg2.trans ha2 have hpp := physicalFixedCost_one_le D Rc C (4*R) X (4*X) hRc hC (by positivity) hRcX hCX (by gcongr) have hp0 := physicalFixedCost_nonneg D Rc C (4*R) 1 hRc hC (by positivity) have hpX := hp0.trans hpp have hNC0 := N.C_nonneg have hNR0 := N.Rc_nonneg unfold initializedPressureHessianCost fastHessianCost hessianEnvelope coordinateCost gcongr end EulerPacketPhysicalCost end end noncomputable section namespace EulerPacketInitializedOutputCost open EulerPacketTerminalDatum EulerPacketProfileRecursion EulerPacketCylinderField EulerPacketCorrectionConstants EulerPacketCorrectionScalar EulerPacketCorrectionCoefficients EulerPacketPhysicalCost EulerPacketFiveCost EulerPolynomialCost EulerAllOrderDriftCorrection EulerPacketCorrectionOutput def envelope (W : ℝ) : ℝ := 1+ EulerPacketInitializedCost.uniformConstant*W^EulerPacketInitializedCost.uniformPower+ extraEnvelope (EulerPacketInitializedCost.envelope W) def polynomial : Polynomial ℝ := 1+ Polynomial.C EulerPacketInitializedCost.uniformConstant* Polynomial.X^EulerPacketInitializedCost.uniformPower+ extraPolynomial.comp (1+Polynomial.X+EulerPacketRadiusPolynomial.radiusPolynomial+ EulerPacketCorrectionPrimitive.primitivePolynomial period) def uniformConstant : ℝ := coefficientCost polynomial def uniformPower : ℕ := polynomial.natDegree theorem polynomial_eval (W : ℝ) : polynomial.eval W=envelope W := by unfold polynomial envelope EulerPacketInitializedCost.envelope simp only [Polynomial.eval_add,Polynomial.eval_one,Polynomial.eval_mul, Polynomial.eval_C,Polynomial.eval_pow,Polynomial.eval_X,Polynomial.eval_comp, EulerPacketRadiusPolynomial.radiusPolynomial_eval, EulerPacketCorrectionPrimitive.primitivePolynomial_eval,extraPolynomial_eval] theorem envelope_bound (W : ℝ) (hW : 1 ≤ W) : envelope W ≤ uniformConstant*W^uniformPower := by rw [← polynomial_eval] exact (le_abs_self _).trans (eval_bound polynomial W hW) theorem envelope_components (W : ℝ) (hW : 0 ≤ W) : EulerPacketInitializedCost.uniformConstant*W^EulerPacketInitializedCost.uniformPower ≤ envelope W ∧ extraEnvelope (EulerPacketInitializedCost.envelope W) ≤ envelope W := by have hC := EulerPacketInitializedCost.uniformConstant_pos.le have hE0 := zero_le_one.trans (EulerPacketInitializedCost.envelope_bounds W hW).1 have hO := zero_le_one.trans (output_components period _ hE0).1 have he := (extra_components (EulerPacketInitializedCost.envelope W) hE0).1 have hE := hO.trans he have hp : 0 ≤ EulerPacketInitializedCost.uniformConstant*W^EulerPacketInitializedCost.uniformPower := mul_nonneg hC (pow_nonneg hW _) unfold envelope exact ⟨by linarith,by linarith⟩ variable {U : Type*} [NormedAddCommGroup U] [InnerProductSpace ℝ U] [CompleteSpace U] {D : EulerTransversePacketProvider.Data U} {τ : ℝ} {hτ : 0 < τ} {hτT : τ < D.T} {B : EulerTransversePacketProvider.HistoryData (D.initial τ hτ hτT.le)} {M : EulerMeanPacketProvider.Data} {Rm Tc : ℝ} {O : Operators} {C : CoefficientData period Tc O} (LM : EulerMeanPacketProvider.Budget M 6 Rm) (L : EulerTransversePacketJoin.Budget D τ hτ hτT B (Fin 4) 6) (NB : EulerTransversePacketJoin.NormalBudget D 6 L.R) (BC : CoefficientBudget C) (δ : ℝ) (ξ : U) theorem actual_output_costs (W H0 : ℝ) (hδ : 0 < δ) (H : EulerPacketRadiusPolynomial.RadiusPrimitives LM L NB BC δ ξ W) (hH0 : 0 ≤ H0) (hHW : H0 ≤ W) : let R := initializedRadius LM L NB BC δ ξ let Kc := L.correctionCoefficients NB period let ρ := initialRadius R Kc.M Kc.Rc/4 let Z := EulerPacketInitializedCost.envelope W EulerPacketInitializedCost.weightSize W ≤ extraEnvelope Z ∧ physicalInputRadius (4*R) (4*R) ρ ≤ extraEnvelope Z ∧ liftedInputConstant period*(velocity R H0 BC.multiplierCost+normal R H0 BC.multiplierCost) ≤ extraEnvelope Z ∧ 2*liftedInputConstant period*EulerPacketInitializedCost.weightSize W ≤ extraEnvelope Z ∧ 2*liftedInputConstant period*(6*NB.blockAmplitude* (fixedVelocityGradeCost R H0 1+fixedVelocityGradeCost R H0 2+1)+ EulerPacketInitializedCost.weightSize W) ≤ extraEnvelope Z ∧ weightedPhysicalGradientCost D period L.Rc L.C₀ ρ (EulerPacketInitializedCost.weightSize W) ≤ extraEnvelope Z ∧ initializedGlobalShearCost R H0 NB.C ≤ extraEnvelope Z ∧ initializedPressureHessianCost NB R H0 L.Rc L.C₀ ≤ extraEnvelope Z := by let R := initializedRadius LM L NB BC δ ξ let Kc := L.correctionCoefficients NB period let ρ := initialRadius R Kc.M Kc.Rc/4 let Z := EulerPacketInitializedCost.envelope W obtain ⟨hZ1,hRZ,hHZ,hCZ,hK⟩ := EulerPacketInitializedCost.actual_parameters LM L NB BC δ ξ W H0 hδ H hHW change R ≤ Z at hRZ change H0 ≤ Z at hHZ change BC.multiplierCost ≤ Z at hCZ have hZ : 0 ≤ Z := zero_le_one.trans hZ1 have hWZ := (EulerPacketInitializedCost.envelope_bounds W (zero_le_one.trans H.one)).2.1 have hR0 : 0 ≤ R := zero_le_one.trans (initializedJoinedBudget LM L NB BC δ ξ).radius_bounds.1 have hC0 := BC.multiplierCost_nonneg have hLR := H.joined_radius.trans hWZ have hLC := H.joined_frame.trans hWZ have hNR := H.normal_radius.trans hWZ have hNC := H.normal_amplitude.trans hWZ have hNI := H.normal_inverse.trans hWZ have hρ0 : 0 < ρ := div_pos (initialRadius_bounds R Kc.M Kc.Rc hR0 (zero_le_one.trans Kc.M_one_le) Kc.Rc_nonneg).1 (by norm_num) have hiR : (initialRadius R Kc.M Kc.Rc)⁻¹ ≤ inverseRadiusEnvelope Z := by simp only [initialRadius,one_div,inv_inv] unfold inverseRadiusEnvelope have hm : Kc.M ≤ Z := hK.pressure have hr : Kc.Rc ≤ Z := hK.radius have hp := mul_le_mul hm hr Kc.Rc_nonneg hZ linarith only [hp,hRZ,hr] have hρinv : ρ⁻¹ ≤ 4*inverseRadiusEnvelope Z := by change (initialRadius R Kc.M Kc.Rc/4)⁻¹ ≤ _ rw [inv_div,div_eq_mul_inv] gcongr have hiZ : 0 ≤ inverseRadiusEnvelope Z := by unfold inverseRadiusEnvelope; positivity have hrf : physicalInputRadius (4*R) (4*R) ρ ≤ radiusEnvelope Z := by simp only [physicalInputRadius,max_self] change 1+coordinateCost*(4*R+ρ⁻¹) ≤ 1+coordinateCost*(4*Z+4*inverseRadiusEnvelope Z) have hc : 0 ≤ coordinateCost := norm_nonneg _ gcongr have hv := velocity_mono hR0 hH0 hC0 hRZ hHZ hCZ have ha1 := gradeCost_mono R H0 Z hR0 hH0 hRZ hHZ 1 have ha2 := gradeCost_mono R H0 Z hR0 hH0 hRZ hHZ 2 have hg1 := fixedVelocityGradeCost_nonneg R H0 hR0 1 have hg2 := fixedVelocityGradeCost_nonneg R H0 hR0 2 have hg1Z := hg1.trans ha1 have hg2Z := hg2.trans ha2 have hn : normal R H0 BC.multiplierCost ≤ normal Z Z Z := by unfold normal; gcongr have hl := zero_le_one.trans (liftedInputConstant_one_le period) have hav : liftedInputConstant period*(velocity R H0 BC.multiplierCost+normal R H0 BC.multiplierCost) ≤ velocityInputEnvelope Z := by unfold velocityInputEnvelope; gcongr have hb := EulerPacketRadiusPolynomial.normal_block_le NB Z hZ hNR hNC hNI have hb0 := NB.blockAmplitude_nonneg have hbZ := hb0.trans hb have ht : 6*NB.blockAmplitude*(fixedVelocityGradeCost R H0 1+fixedVelocityGradeCost R H0 2+1) ≤ timeEnvelope Z := by unfold timeEnvelope; gcongr have hat : 2*liftedInputConstant period*(6*NB.blockAmplitude* (fixedVelocityGradeCost R H0 1+fixedVelocityGradeCost R H0 2+1)+ EulerPacketInitializedCost.weightSize W) ≤ timeInputEnvelope Z := by unfold timeInputEnvelope EulerPacketInitializedCost.weightSize gcongr have hphys := physicalFixedCost_one_le D L.Rc L.C₀ ρ⁻¹ Z (4*inverseRadiusEnvelope Z) L.Rc_nonneg L.C₀_nonneg (inv_nonneg.mpr hρ0.le) hLR hLC hρinv have hphys0 := EulerPacketPhysicalGevrey.physicalFixedCost_nonneg D L.Rc L.C₀ ρ⁻¹ 1 L.Rc_nonneg L.C₀_nonneg (inv_nonneg.mpr hρ0.le) have hphysZ := hphys0.trans hphys have he := EulerCylinderSobolevSpace.sobolevEmbeddingConstant_nonneg period 3 have ho := zero_le_one.trans (output_components period Z hZ).1 have herr : weightedPhysicalGradientCost D period L.Rc L.C₀ ρ (EulerPacketInitializedCost.weightSize W) ≤ weightedErrorEnvelope Z := by calc _ = ((1+9*L.C₀)*EulerPacketPhysicalGevrey.physicalFixedCost D L.Rc L.C₀ ρ⁻¹ 1* EulerCylinderSobolevSpace.sobolevEmbeddingConstant period 3)*outputEnvelope period Z := by unfold weightedPhysicalGradientCost EulerPacketInitializedCost.weightSize ring _ ≤ ((1+9*Z)*physicalEnvelope Z (4*inverseRadiusEnvelope Z)* EulerCylinderSobolevSpace.sobolevEmbeddingConstant period 3)*outputEnvelope period Z := by gcongr _ = _ := rfl have hshear := shearCost_le R H0 NB.C Z hR0 hH0 NB.C_nonneg hRZ hHZ hNC have hhess := hessianCost_le D NB R H0 L.Rc L.C₀ Z hR0 hH0 L.Rc_nonneg L.C₀_nonneg hRZ hHZ hLR hLC hNR hNC obtain ⟨hwe,hr,ha,hb,ht',he',hs,hp⟩ := extra_components Z hZ exact ⟨hwe,hrf.trans hr,hav.trans ha,hb,hat.trans ht',herr.trans he',hshear.trans hs,hhess.trans hp⟩ end EulerPacketInitializedOutputCost