import Euler.PacketInitializedRadiusPolynomial import Euler.PacketCorrectionPrimitiveBounds import Euler.PacketJoinedCoefficientBudgets import Euler.PacketForwardCoefficientBudgets import Euler.PacketFiveCostPolynomial /-! A fixed polynomial bounds all five costs for the literal canonical initialized packet radius. No arbitrary radius witness is used. -/ /-! ## From `Euler/PacketFiveCostGuards.lean` The text of `Euler/PacketFiveCostGuards.lean`, folded into this file, which was its only importer. -/ section /-! Uniform, explicit frequency guards for the actual packet correction. A single polynomial source bound suffices simultaneously for all five requirements. No eventual threshold is hidden in this statement. -/ noncomputable section namespace EulerPacketFiveCost open EulerPacketCorrectionConstants EulerPacketCorrectionCoefficients EulerPacketCorrectionScalar EulerPacketCoarseMajorant EulerPacketCylinderField EulerGevreyCorrectionBound EulerH6Nonlinear EulerCylinderSobolevSpace variable (P : ℝ) [Fact (0 < P)] theorem growthEnvelope_nonneg (X : ℝ) (hX : 0 ≤ X) : 0 ≤ growthEnvelope P X := by have hv := velocity_nonneg X X X hX hX have hp := productConstant_nonneg P 3 have hs := sourceConstant_nonneg hX hX have ht := transportConstant_nonneg P hX hX have hl := lossConstant_nonneg P hX have he := sobolevEmbeddingConstant_nonneg P 6 unfold growthEnvelope rawGrowth dsimp only positivity theorem fiveEnvelope_components (X : ℝ) (hX : 0 ≤ X) : tailPolynomialConstant X X X ≤ fiveEnvelope P X ∧ X ≤ fiveEnvelope P X ∧ 12*growthEnvelope P X*X ≤ fiveEnvelope P X ∧ 8*growthEnvelope P X*X*drift X X X*inverseRadiusEnvelope X ≤ fiveEnvelope P X ∧ 8*growthEnvelope P X*X*inverseRadiusEnvelope X ≤ fiveEnvelope P X := by have ht := tailPolynomialConstant_nonneg X X X hX have hg := growthEnvelope_nonneg P X hX have hd := drift_nonneg X X X hX hX have hi : 0 ≤ inverseRadiusEnvelope X := by unfold inverseRadiusEnvelope; positivity have h₁ : 0 ≤ 12*growthEnvelope P X*X := by positivity have h₂ : 0 ≤ 8*growthEnvelope P X*X*drift X X X*inverseRadiusEnvelope X := by positivity have h₃ : 0 ≤ 8*growthEnvelope P X*X*inverseRadiusEnvelope X := by positivity unfold fiveEnvelope exact ⟨by linarith,by linarith,by linarith,by linarith,by linarith⟩ variable {U : Type*} [NormedAddCommGroup U] [InnerProductSpace ℝ U] (D : EulerTransversePacketProvider.Data U) (Kc : CorrectionCoefficientBudget D P) (R H C CT X : ℝ) (hX : 1 ≤ X) (hR : 0 ≤ R) (hH : 0 ≤ H) (hC : 0 ≤ C) (hRX : R ≤ X) (hHX : H ≤ X) (hCX : C ≤ X) (hCTX : CT ≤ X) (hi : D.inverseBound ≤ X) (hm : inverseMetricBound D ≤ X) (hf : inverseMetricFirstBound D ≤ X) (ht : inverseMetricTimeBound D ≤ X) (hB : Kc.B ≤ X) (hM : Kc.M ≤ X) (hA0 : Kc.A0 ≤ X) (hA2 : Kc.A2 ≤ X) (hRc : Kc.Rc ≤ X) (hT : D.T ≤ X) include hX hR hH hC hRX hHX hCX hCTX hi hm hf ht hB hM hA0 hA2 hRc hT theorem five_costs_bound : tailPolynomialConstant R H CT ≤ costConstant P*X^(costPower P) ∧ C ≤ costConstant P*X^(costPower P) ∧ 12*growth D P Kc R H C*D.T ≤ costConstant P*X^(costPower P) ∧ 8*growth D P Kc R H C*D.T*drift R H C/initialRadius R Kc.M Kc.Rc ≤ costConstant P*X^(costPower P) ∧ 8*growth D P Kc R H C*D.T/initialRadius R Kc.M Kc.Rc ≤ costConstant P*X^(costPower P) := by have hX0 : 0 ≤ X := zero_le_one.trans hX have hT0 : 0 ≤ D.T := D.T_pos.le have hg := growth_le_envelope P D Kc R H C X hR hH hC hRX hHX hCX hi hm hf ht hB hM hA0 hA2 have hgp := (growth_pos D P Kc R H C hR hC).le have hgX := growthEnvelope_nonneg P X hX0 have hd := drift_mono hR hH hC hRX hHX hCX have hdp := drift_nonneg R H C hR hC have hdX := drift_nonneg X X X hX0 hX0 have hρ := (initialRadius_bounds R Kc.M Kc.Rc hR (zero_le_one.trans Kc.M_one_le) Kc.Rc_nonneg).1 have hiR : (initialRadius R Kc.M Kc.Rc)⁻¹ ≤ inverseRadiusEnvelope X := by simp only [initialRadius,one_div,inv_inv] unfold inverseRadiusEnvelope have hprod := mul_le_mul hM hRc Kc.Rc_nonneg hX0 linarith have hp := fiveEnvelope_power P X hX obtain ⟨hc₁,hc₂,hc₃,hc₄,hc₅⟩ := fiveEnvelope_components P X hX0 refine ⟨?_,hCX.trans (hc₂.trans hp),?_,?_,?_⟩ · apply le_trans _ (hc₁.trans hp) unfold tailPolynomialConstant gcongr · apply le_trans _ (hc₃.trans hp) gcongr · apply le_trans _ (hc₄.trans hp) rw [div_eq_mul_inv] gcongr · apply le_trans _ (hc₅.trans hp) rw [div_eq_mul_inv] gcongr end EulerPacketFiveCost end end /-! ## From `Euler/PacketSourcePrimitiveBounds.lean` The text of `Euler/PacketSourcePrimitiveBounds.lean`, folded into this file, which was its only importer. -/ section /-! The actual joined and forward source budgets retain the polynomial correction envelope. Only their original coefficient leaves enter it. -/ noncomputable section namespace EulerTransversePacketJoin.Budget open EulerTransversePacketProvider EulerPacketCorrectionPrimitive variable {U : Type*} [NormedAddCommGroup U] [InnerProductSpace ℝ U] [CompleteSpace U] {D : Data U} {τ : ℝ} {hτ : 0 < τ} {hτT : τ < D.T} {B : HistoryData (D.initial τ hτ hτT.le)} (L : Budget D τ hτ hτT B (Fin 4) 6) (NB : NormalBudget D 6 L.R) (P : ℝ) [Fact (0 < P)] theorem correctionCoefficients_primitive_bound (X : ℝ) (hX : 1 ≤ X) (hLR : L.Rc ≤ X) (hNR : NB.Rc ≤ X) (hC0 : L.C₀ ≤ X) (hC1 : L.C₁ ≤ X) (hCI : NB.C ≤ X) : CorrectionBounds D P (L.correctionCoefficients NB P) (primitiveEnvelope P X) := by unfold correctionCoefficients apply correctionBudget_bounds · exact hX · exact max_le hLR hNR · exact hC0 · exact hC1 · exact hCI end EulerTransversePacketJoin.Budget namespace EulerTransversePacketForward.Budget open EulerTransversePacketProvider EulerPacketCorrectionPrimitive variable {U : Type*} [NormedAddCommGroup U] [InnerProductSpace ℝ U] [CompleteSpace U] {D : Data U} (L : Budget D (Fin 4) 6) (NB : EulerTransversePacketJoin.NormalBudget D 6 L.R) (P : ℝ) [Fact (0 < P)] theorem correctionCoefficients_primitive_bound (X : ℝ) (hX : 1 ≤ X) (hLR : L.Rc ≤ X) (hNR : NB.Rc ≤ X) (hC0 : L.C₀ ≤ X) (hC1 : L.C₁ ≤ X) (hCI : NB.C ≤ X) : CorrectionBounds D P (L.correctionCoefficients NB P) (primitiveEnvelope P X) := by unfold correctionCoefficients apply correctionBudget_bounds · exact hX · exact max_le hLR hNR · exact hC0 · exact hC1 · exact hCI end EulerTransversePacketForward.Budget end end noncomputable section namespace EulerPacketInitializedCost open EulerPacketTerminalDatum EulerPacketProfileRecursion EulerPacketCylinderField EulerPacketCorrectionCoefficients EulerPacketCorrectionConstants EulerPacketCorrectionScalar EulerPacketCoarseMajorant EulerPolynomialCost def envelope (W : ℝ) : ℝ := 1+W+EulerPacketRadiusPolynomial.radiusEnvelope W+ EulerPacketCorrectionPrimitive.primitiveEnvelope period W def polynomial : Polynomial ℝ := Polynomial.C (EulerPacketFiveCost.costConstant period)* (1+Polynomial.X+EulerPacketRadiusPolynomial.radiusPolynomial+ EulerPacketCorrectionPrimitive.primitivePolynomial period)^(EulerPacketFiveCost.costPower period) def uniformConstant : ℝ := coefficientCost polynomial def uniformPower : ℕ := polynomial.natDegree theorem uniformConstant_pos : 0 < uniformConstant := coefficientCost_pos _ theorem polynomial_eval (W : ℝ) : polynomial.eval W= EulerPacketFiveCost.costConstant period*(envelope W)^EulerPacketFiveCost.costPower period := by unfold polynomial envelope simp only [Polynomial.eval_mul,Polynomial.eval_C,Polynomial.eval_pow, Polynomial.eval_add,Polynomial.eval_one,Polynomial.eval_X, EulerPacketRadiusPolynomial.radiusPolynomial_eval, EulerPacketCorrectionPrimitive.primitivePolynomial_eval] theorem envelope_bound (W : ℝ) (hW : 1 ≤ W) : EulerPacketFiveCost.costConstant period*(envelope W)^EulerPacketFiveCost.costPower period ≤ uniformConstant*W^uniformPower := by rw [← polynomial_eval] exact (le_abs_self _).trans (eval_bound polynomial W hW) 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 initialized_five_costs_bound (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 tailPolynomialConstant R H0 BC.termCost ≤ uniformConstant*W^uniformPower ∧ BC.multiplierCost ≤ uniformConstant*W^uniformPower ∧ 12*growth D period Kc R H0 BC.multiplierCost*D.T ≤ uniformConstant*W^uniformPower ∧ 8*growth D period Kc R H0 BC.multiplierCost*D.T*drift R H0 BC.multiplierCost/ initialRadius R Kc.M Kc.Rc ≤ uniformConstant*W^uniformPower ∧ 8*growth D period Kc R H0 BC.multiplierCost*D.T/ initialRadius R Kc.M Kc.Rc ≤ uniformConstant*W^uniformPower := by have hW0 := zero_le_one.trans H.one have hR1 : 1 ≤ initializedRadius LM L NB BC δ ξ := (initializedJoinedBudget LM L NB BC δ ξ).radius_bounds.1 have hR := EulerPacketRadiusPolynomial.initializedRadius_le_envelope LM L NB BC δ ξ W hδ H have hRE : 0 ≤ EulerPacketRadiusPolynomial.radiusEnvelope W := (zero_le_one.trans hR1).trans hR have hPE := (EulerPacketCorrectionPrimitive.primitive_components period W hW0).1 have hEW : W ≤ envelope W := by unfold envelope; linarith have hER : EulerPacketRadiusPolynomial.radiusEnvelope W ≤ envelope W := by unfold envelope linarith have hEP : EulerPacketCorrectionPrimitive.primitiveEnvelope period W ≤ envelope W := by unfold envelope linarith have hE : 1 ≤ envelope W := H.one.trans hEW have hK := (L.correctionCoefficients_primitive_bound NB period W H.one H.joined_radius H.normal_radius H.joined_frame H.joined_first H.normal_amplitude).mono D period hEP have hmult : BC.multiplierCost ≤ W := by have ht := BC.twice_multiplierCost_le have hn := BC.multiplierCost_nonneg linarith only [ht,hn,H.coefficient_cost] obtain ⟨h₁,h₂,h₃,h₄,h₅⟩ := EulerPacketFiveCost.five_costs_bound period D (L.correctionCoefficients NB period) (initializedRadius LM L NB BC δ ξ) H0 BC.multiplierCost BC.termCost (envelope W) hE (zero_le_one.trans hR1) hH0 BC.multiplierCost_nonneg (hR.trans hER) (hHW.trans hEW) (hmult.trans hEW) (H.coefficient_cost.trans hEW) hK.inverse hK.metric hK.first hK.time hK.base hK.pressure hK.linear hK.quadratic hK.radius (H.total_time.trans (H.one.trans hEW)) have he := envelope_bound W H.one exact ⟨h₁.trans he,h₂.trans he,h₃.trans he,h₄.trans he,h₅.trans he⟩ end EulerPacketInitializedCost