import Euler.PacketInitializedInitial import Euler.PacketInitializedParameterBounds import Euler.PacketSourceUniformEnvelope import Euler.PacketInitializedInitialExact import Euler.PacketInitializedUniformBudget /-! Fixed-order source polynomial bounds for the literal initial increments. These use the same finite frequency guard as the constructed exact packet. -/ /-! ## From `Euler/PacketInitialCostPolynomial.lean` The text of `Euler/PacketInitialCostPolynomial.lean`, folded into this file, which was its only importer. -/ section /-! At each fixed Sobolev order, the two actual initial-increment costs are fixed polynomials in the source primitives. Frequency and amplitude are kept outside these polynomials. -/ noncomputable section namespace EulerPacketInitialCost open Finset EulerPhysicalL2Scaling EulerPacketTerminalDatum EulerPacketInitial EulerPacketPhysicalCost EulerPacketFiveCost EulerPacketCorrectionOutput EulerPolynomialCost def jetPolynomialMap (R : Polynomial ℝ) (s : ℕ) : Polynomial ℝ := ∑ n ∈ range (s+1), R^n*Polynomial.C ((n.factorial : ℝ)^2) theorem jetPolynomialMap_eval (R : Polynomial ℝ) (s : ℕ) (X : ℝ) : (jetPolynomialMap R s).eval X=jetPolynomial (R.eval X) s := by simp only [jetPolynomialMap,jetPolynomial,Polynomial.eval_finsetSum,Polynomial.eval_mul, Polynomial.eval_pow,Polynomial.eval_C] def physicalPolynomial (R : Polynomial ℝ) (C : ℝ) (s : ℕ) : Polynomial ℝ := ∑ n ∈ range (s+1), Polynomial.C ((4*C)^n*Real.sqrt (2/period+2*period))* jetPolynomialMap R (n+1) theorem physicalPolynomial_eval (R : Polynomial ℝ) (C : ℝ) (s : ℕ) (X : ℝ) : (physicalPolynomial R C s).eval X=physicalDerivativeCost period (R.eval X) C s := by simp only [physicalPolynomial,physicalDerivativeCost,Polynomial.eval_finsetSum, Polynomial.eval_mul,Polynomial.eval_C,jetPolynomialMap_eval] theorem jetPolynomial_mono {R S : ℝ} (hR : 0 ≤ R) (hRS : R ≤ S) (s : ℕ) : jetPolynomial R s ≤ jetPolynomial S s := by unfold jetPolynomial apply sum_le_sum intro n _ exact mul_le_mul_of_nonneg_right (pow_le_pow_left₀ hR hRS n) (sq_nonneg _) theorem physicalDerivativeCost_mono {R S C D : ℝ} (hR : 0 ≤ R) (hC : 0 ≤ C) (hRS : R ≤ S) (hCD : C ≤ D) (s : ℕ) : physicalDerivativeCost period R C s ≤ physicalDerivativeCost period S D s := by unfold physicalDerivativeCost apply sum_le_sum intro n _ have hj := jetPolynomial_mono hR hRS (n+1) have hj0 := jetPolynomial_nonneg R hR (n+1) have hj1 := hj0.trans hj have hD := hC.trans hCD have hs := Real.sqrt_nonneg (2/period+2*period) gcongr def envelope (s : ℕ) (X : ℝ) : ℝ := 1+(highCost X X+meanCost X X)*physicalDerivativeCost period (4*X) (coordinateCost*2) s def polynomial (s : ℕ) : Polynomial ℝ := 1+(gradePolynomial 1+2*gradePolynomial 2+3)* physicalPolynomial (4*Polynomial.X) (coordinateCost*2) s theorem polynomial_eval (s : ℕ) (X : ℝ) : (polynomial s).eval X=envelope s X := by unfold polynomial envelope highCost meanCost simp only [Polynomial.eval_add,Polynomial.eval_mul, Polynomial.eval_one,Polynomial.eval_ofNat,physicalPolynomial_eval, Polynomial.eval_X,gradePolynomial_eval] ring theorem costs_le_envelope (s : ℕ) (R H X : ℝ) (hR : 0 ≤ R) (hH : 0 ≤ H) (hRX : R ≤ X) (hHX : H ≤ X) : highCost R H*physicalDerivativeCost period (4*R) (coordinateCost*2) s ≤ envelope s X ∧ meanCost R H*physicalDerivativeCost period (4*R) coordinateCost s ≤ envelope s X := by have hX := hR.trans hRX have hc : 0 ≤ coordinateCost := norm_nonneg _ have h1 := gradeCost_mono R H X hR hH hRX hHX 1 have h2 := gradeCost_mono R H X hR hH hRX hHX 2 have hhigh : highCost R H ≤ highCost X X := by unfold highCost; linarith have hmean : meanCost R H ≤ meanCost X X := by unfold meanCost; linarith have hd1 := physicalDerivativeCost_mono (by positivity : 0 ≤ 4*R) (by positivity : 0 ≤ coordinateCost*2) (by linarith : 4*R ≤ 4*X) le_rfl s have hd2 := physicalDerivativeCost_mono (by positivity : 0 ≤ 4*R) hc (by linarith : 4*R ≤ 4*X) (by linarith : coordinateCost ≤ coordinateCost*2) s have hv := highCost_nonneg X X hX have hm := meanCost_nonneg X X hX have hd := physicalDerivativeCost_nonneg period (4*X) (coordinateCost*2) (by positivity) (by positivity) s have hh := mul_le_mul hhigh hd1 (physicalDerivativeCost_nonneg period (4*R) (coordinateCost*2) (by positivity) (by positivity) s) hv have hm' := mul_le_mul hmean hd2 (physicalDerivativeCost_nonneg period (4*R) coordinateCost (by positivity) hc s) hm unfold envelope constructor · linarith only [hh,mul_nonneg hm hd] · linarith only [hm',mul_nonneg hv hd] def sourcePolynomial (s : ℕ) : Polynomial ℝ := (polynomial s).comp ((1+Polynomial.X+EulerPacketRadiusPolynomial.radiusPolynomial+ EulerPacketCorrectionPrimitive.primitivePolynomial period).comp EulerPacketUniformSource.profilePolynomial) def sourceConstant (s : ℕ) : ℝ := coefficientCost (sourcePolynomial s) def sourcePower (s : ℕ) : ℕ := (sourcePolynomial s).natDegree theorem sourceConstant_pos (s : ℕ) : 0 < sourceConstant s := coefficientCost_pos _ theorem sourcePolynomial_eval (s : ℕ) (X : ℝ) : (sourcePolynomial s).eval X= envelope s (EulerPacketInitializedCost.envelope (EulerPacketUniformSource.profileEnvelope X)) := by simp only [sourcePolynomial,Polynomial.eval_comp,polynomial_eval,Polynomial.eval_add, Polynomial.eval_one,Polynomial.eval_X,EulerPacketRadiusPolynomial.radiusPolynomial_eval, EulerPacketCorrectionPrimitive.primitivePolynomial_eval, EulerPacketUniformSource.profilePolynomial_eval,EulerPacketInitializedCost.envelope] theorem source_bound (s : ℕ) (X : ℝ) (hX : 1 ≤ X) : envelope s (EulerPacketInitializedCost.envelope (EulerPacketUniformSource.profileEnvelope X)) ≤ sourceConstant s*X^sourcePower s := by rw [← sourcePolynomial_eval] exact (le_abs_self _).trans (eval_bound (sourcePolynomial s) X hX) end EulerPacketInitialCost end end /-! ## From `Euler/PacketUniformInitialBounds.lean` The text of `Euler/PacketUniformInitialBounds.lean`, folded into this file, which was its only importer. -/ section /-! The actual initial increments for the canonical uniformly selected packet satisfy source (22), with fixed-order polynomial costs. -/ noncomputable section namespace EulerPacketTerminalDatum open Set EulerSmoothLimit EulerSpatialCutoffs EulerTransversePacketProvider EulerPacketCylinderField EulerPacketProfileRecursion EulerPacketTimeProfile EulerPacketCorrectionConstants EulerPacketCorrectionScalar EulerPacketSourceFrequency EulerPacketCorrectionCoefficients open scoped ContDiff variable (M : EulerMeanPacketProvider.Data) {U : Type*} [NormedAddCommGroup U] [InnerProductSpace ℝ U] [CompleteSpace U] (D : Data U) (hTime : M.T=D.T) (τ : ℝ) (hτ : 0 < τ) (hτT : τ < D.T) (B : HistoryData (D.initial τ hτ hτT.le)) (δ : ℝ) (hδ : 0 < δ) (hδ1 : δ ≤ 1) (ξ : U) (hs : tsupport innerCutoff ⊆ D.support) (α : ℝ) (hα : 0 < α) (L : EulerTransversePacketJoin.Budget D τ hτ hτT B (Fin 4) 6) (NB : EulerTransversePacketJoin.NormalBudget D 6 L.R) {Rm : ℝ} (LM : EulerMeanPacketProvider.Budget M 6 Rm) (W : ℝ) (hW : EulerPacketRadiusPolynomial.RadiusPrimitives LM L NB (joinedCoefficientBudget period M D hTime τ hτ hτT B NB) δ ξ W) (hprofile : ∀ t, α*L.fullProfile t ≤ W) (k : ℝ) (hk : 4 ≤ k) (hfrequency : EulerPacketInitializedCost.uniformConstant*W^EulerPacketInitializedCost.uniformPower ≤ smallPower k) open EulerPhysicalL2Scaling EulerPacketPhysicalCost EulerCylinderCoordinates include hδ1 hα L NB LM hW hprofile hk hfrequency theorem initialized_uniform_initial_bounds (s : ℕ) : derivativeSum s (initializedInitialHigh M D τ hτ hτT B δ hδ ξ hs α (truncation k) k) ≤ (M.ℓ⁻¹)^s*k^s*α*EulerPacketInitialCost.envelope s (EulerPacketInitializedCost.envelope W) ∧ derivativeSum s (initializedInitialMean M D τ hτ hτT B δ hδ ξ hs α (truncation k) k) ≤ (M.ℓ⁻¹)^s/k^2*EulerPacketInitialCost.envelope s (EulerPacketInitializedCost.envelope W) := by let BC := joinedCoefficientBudget period M D hTime τ hτ hτT B NB let L' := initializedJoinedBudget LM L NB BC δ ξ let H' := initializedPrimaryBudget LM L NB BC δ ξ let NB' := initializedNormalBudget LM L NB BC δ ξ let LM' := initializedMeanBudget LM L NB BC δ ξ have guards := initializedRadius_guards LM L NB BC δ ξ let S := Scales.ofTimeProfile L.fullProfile L.fullProfile_pos hTime.symm α hα have hH0 : S.H0 ≤ W := Scales.ofTimeProfile_H0_le L.fullProfile L.fullProfile_pos hTime.symm α hα W hW.one hprofile have hgrowth : timeProfileChange S.growth hTime=α • L'.fullProfile := Scales.ofTimeProfile_growth L.fullProfile L.fullProfile_pos hTime.symm α hα have costs := EulerPacketInitializedCost.initialized_five_costs_bound LM L NB BC δ ξ W S.H0 hδ hW S.H0_pos.le hH0 have hbase : EulerPacketCoarseMajorant.tailBase L'.R S.H0 BC.termCost (truncation k) ≤ k^(1/100 : ℝ) := tailBase_frequency L'.R S.H0 BC.termCost k BC.termCost_nonneg (by linarith) (costs.1.trans hfrequency) have hn := (truncation_bounds k (by linarith)).1 have hh := initializedInitialHigh_Hm M D hTime τ hτ hτT B δ hδ ξ hs α L' H' NB' guards.1 LM' guards.2.1 BC guards.2.2.2.2.2 guards.2.2.2.2.1 hδ1 hα guards.2.2.2.1 guards.2.2.1 S hgrowth (truncation k) hn k hk hbase s have hm := initializedInitialMean_Hm M D hTime τ hτ hτT B δ hδ ξ hs α L' H' NB' guards.1 LM' guards.2.1 BC guards.2.2.2.2.2 guards.2.2.2.2.1 hδ1 hα guards.2.2.2.1 guards.2.2.1 S hgrowth (truncation k) hn k hk hbase s have hb := EulerPacketInitializedCost.actual_parameters LM L NB BC δ ξ W S.H0 hδ hW hH0 have hp := EulerPacketInitialCost.costs_le_envelope s L'.R S.H0 (EulerPacketInitializedCost.envelope W) (zero_le_one.trans L'.radius_bounds.1) S.H0_pos.le hb.2.1 hb.2.2.1 have hhigh : EulerPacketInitial.highCost L'.R S.H0* physicalDerivativeCost period (4*L'.R) (‖coordinateEquiv.symm.toContinuousLinearMap‖*(1+‖D.m₀‖)) s ≤ EulerPacketInitialCost.envelope s (EulerPacketInitializedCost.envelope W) := by simpa only [D.m₀_unit,show (1 : ℝ)+1=2 by norm_num,coordinateCost] using hp.1 have hell : 0 ≤ M.ℓ⁻¹ := (inv_pos.mpr M.ℓ_pos).le have hk0 : 0 ≤ k := by linarith exact ⟨hh.trans (mul_le_mul_of_nonneg_left hhigh (by positivity)), hm.trans (mul_le_mul_of_nonneg_left hp.2 (by positivity))⟩ variable (Cagree : SourceCoefficientAgreement M D) (hX : 64 ≤ expansion k) (hlog : 1 ≤ Real.log k) (Ξ : Icc (0 : ℝ) D.T → Space → Space) (hΞ : ∀ t, ContDiff ℝ ∞ (Ξ t)) (hF : ∀ t x, fderiv ℝ (Ξ t) x=D.F.field t x) (hdet : ∀ t x, (EulerPacketPiola.operatorMatrix (D.F.field t x)).det=1) local notation "Q" => initializedUniformBudget M D hTime τ hτ hτT B δ hδ hδ1 ξ hs α hα L NB LM Cagree W hW hprofile k hk hX hlog hfrequency Ξ hΞ hF hdet end EulerPacketTerminalDatum end end noncomputable section namespace EulerPacketUniformSource theorem initial_frequency_guard (X k : ℝ) (hX : 1 ≤ X) (h : frequencyConstant*X^frequencyPower ≤ EulerPacketSourceFrequency.smallPower k) : EulerPacketInitializedCost.uniformConstant* (profileEnvelope X)^EulerPacketInitializedCost.uniformPower ≤ EulerPacketSourceFrequency.smallPower k := by have hW := (profileEnvelope_bounds X hX).1 exact (EulerPacketInitializedOutputCost.envelope_components _ (zero_le_one.trans hW)).1.trans ((EulerPacketInitializedOutputCost.envelope_bound _ hW).trans ((frequency_bound X hX).trans h)) end EulerPacketUniformSource namespace EulerPacketTerminalDatum open Set EulerSmoothLimit EulerSpatialCutoffs EulerTransversePacketProvider EulerPacketCylinderField EulerPacketCorrectionCoefficients EulerPhysicalL2Scaling EulerPacketUniformSource EulerPacketInitialCost EulerPacketSourceFrequency variable (M : EulerMeanPacketProvider.Data) {U : Type*} [NormedAddCommGroup U] [InnerProductSpace ℝ U] [CompleteSpace U] (D : Data U) (hTime : M.T=D.T) (τ : ℝ) (hτ : 0 < τ) (hτT : τ < D.T) (B : HistoryData (D.initial τ hτ hτT.le)) (δ : ℝ) (hδ : 0 < δ) (hδ1 : δ ≤ 1) (ξ : U) (hs : tsupport innerCutoff ⊆ D.support) (α : ℝ) (hα : 0 < α) (L : EulerTransversePacketJoin.Budget D τ hτ hτT B (Fin 4) 6) (NB : EulerTransversePacketJoin.NormalBudget D 6 L.R) {Rm : ℝ} (LM : EulerMeanPacketProvider.Budget M 6 Rm) (X : ℝ) (hX : 1 ≤ X) (hW : EulerPacketRadiusPolynomial.RadiusPrimitives LM L NB (joinedCoefficientBudget period M D hTime τ hτ hτT B NB) δ ξ (profileEnvelope X)) (hprofile : ∀ t, α*L.fullProfile t ≤ profileEnvelope X) (k : ℝ) (hk : 4 ≤ k) (hfrequency : frequencyConstant*X^frequencyPower ≤ smallPower k) include hδ1 hα L NB LM hX hW hprofile hk hfrequency theorem initialized_initial_polynomial_bounds (s : ℕ) : derivativeSum s (initializedInitialHigh M D τ hτ hτT B δ hδ ξ hs α (truncation k) k) ≤ (M.ℓ⁻¹)^s*k^s*α*(sourceConstant s*X^sourcePower s) ∧ derivativeSum s (initializedInitialMean M D τ hτ hτT B δ hδ ξ hs α (truncation k) k) ≤ (M.ℓ⁻¹)^s/k^2*(sourceConstant s*X^sourcePower s) := by have h := initialized_uniform_initial_bounds M D hTime τ hτ hτT B δ hδ hδ1 ξ hs α hα L NB LM (profileEnvelope X) hW hprofile k hk (initial_frequency_guard X k hX hfrequency) s have hc := source_bound s X hX have hell : 0 ≤ M.ℓ⁻¹ := (inv_pos.mpr M.ℓ_pos).le have hk0 : 0 ≤ k := by linarith only [hk] exact ⟨h.1.trans (mul_le_mul_of_nonneg_left hc (by positivity)), h.2.trans (mul_le_mul_of_nonneg_left hc (by positivity))⟩ end EulerPacketTerminalDatum