import Euler.PacketPrimaryGradeBounds import Euler.TransversePacketPrimaryRadius import Euler.PacketCommonRadius /-! One source-dependent radius accommodates the literal terminal wave, the primary endpoint solve, all later linear solves, and every recursive grade. -/ /-! ## From `Euler/PacketPrimaryCommonRadius.lean` The text of `Euler/PacketPrimaryCommonRadius.lean`, folded into this file, which was its only importer. -/ section /-! The primary grade imposes only finitely many fixed lower bounds on the external radius. Enlarging it leaves the time profile and every source cost unchanged, including the terminal amplitude before its scalar multiplier. -/ noncomputable section namespace EulerTransversePacketPrimary.Budget open EulerTransversePacketProvider variable {P : ℝ} {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 : EulerTransversePacketJoin.Budget D τ hτ hτT B (Fin 4) 6} (H : Budget L) (N : EulerTransversePacketJoin.NormalBudget D 6 L.R) (C : ℝ) def gradeRadius : ℝ := max L.R (max (H.commonCost*C) (max (H.correctorAmplitude (P := P) N*C) (max (H.correctorTimeAmplitude (P := P) N*C) (3*H.pressureAmplitude (P := P) N*C)))) theorem gradeRadius_bounds : L.R ≤ H.gradeRadius (P := P) N C ∧ H.commonCost*C ≤ H.gradeRadius (P := P) N C ∧ H.correctorAmplitude (P := P) N*C ≤ H.gradeRadius (P := P) N C ∧ H.correctorTimeAmplitude (P := P) N*C ≤ H.gradeRadius (P := P) N C ∧ 3*H.pressureAmplitude (P := P) N*C ≤ H.gradeRadius (P := P) N C := by unfold gradeRadius exact ⟨le_max_left _ _, (le_max_left _ _).trans (le_max_right _ _), (le_max_left _ _).trans ((le_max_right _ _).trans (le_max_right _ _)), (le_max_left _ _).trans ((le_max_right _ _).trans ((le_max_right _ _).trans (le_max_right _ _))), (le_max_right _ _).trans ((le_max_right _ _).trans ((le_max_right _ _).trans (le_max_right _ _)))⟩ theorem gradeRadius_guards (hC : 0 ≤ C) (R' : ℝ) (hR : H.gradeRadius (P := P) N C ≤ R') : ∃ h : L.R ≤ R', GradeGuards (P := P) (H.enlargeRadius R' h) (N.enlargeRadius R' h) C := by have hb := H.gradeRadius_bounds (P := P) N C refine ⟨hb.1.trans hR, ?_⟩ exact ⟨hC, hb.2.1.trans hR, hb.2.2.1.trans hR, hb.2.2.2.1.trans hR, hb.2.2.2.2.trans hR⟩ namespace GradeGuards variable {H N C} end GradeGuards end EulerTransversePacketPrimary.Budget end end noncomputable section namespace EulerPacketTerminalDatum open EulerPacketCylinderField EulerPacketProfileRecursion EulerParameterWordGevrey 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) include LM NB /-- The terminal amplitude and the recursive grade do not enter this radius choice. The original time profile is preserved exactly. -/ theorem exists_initialized_budgets : ∃ (L' : EulerTransversePacketJoin.Budget D τ hτ hτT B (Fin 4) 6) (H' : EulerTransversePacketPrimary.Budget L') (N' : EulerTransversePacketJoin.NormalBudget D 6 L'.R) (M' : EulerMeanPacketProvider.Budget M 6 L'.R), L'.fullProfile = L.fullProfile ∧ EulerTransversePacketJoin.Budget.GradeGuards (P := period) L' N' ∧ EulerMeanPacketProvider.Budget.GradeGuards M' ∧ EulerTransversePacketPrimary.Budget.GradeGuards (P := period) H' N' (wordCost (Fin 4) 6 δ*‖ξ‖) ∧ wordRadius (Fin 4) δ ≤ L'.R ∧ BC.termCost ≤ L'.R ∧ sobolevCoefficientRadius (Fin 4) BC.Rc ≤ L'.R := by let Lp := EulerTransversePacketPrimary.enlargeForPrimary L (wordRadius (Fin 4) δ) have hLp : L.R ≤ Lp.R := EulerTransversePacketPrimary.le_requiredRadius L _ let Np := NB.enlargeRadius Lp.R hLp let Hp := EulerTransversePacketPrimary.requiredBudget L (wordRadius (Fin 4) δ) let terminalCost := wordCost (Fin 4) 6 δ*‖ξ‖ have ht : 0 ≤ terminalCost := mul_nonneg (wordCost_nonneg 6 δ) (norm_nonneg ξ) let R' := max (EulerPacketCommonRadius.commonRadius LM Lp Np BC) (Hp.gradeRadius (P := period) Np terminalCost) obtain ⟨hm,hl,wm,wl,hc,hrc⟩ := EulerPacketCommonRadius.commonRadius_guards LM Lp Np BC R' (le_max_left _ _) obtain ⟨hl',wp⟩ := Hp.gradeRadius_guards Np terminalCost ht R' (le_max_right _ _) refine ⟨Lp.enlargeRadius R' hl, Hp.enlargeRadius R' hl, Np.enlargeRadius R' hl, LM.enlargeRadius R' hm, rfl, wl, wm, ?_, ?_, hc, hrc⟩ · exact wp · exact (EulerTransversePacketPrimary.extra_le_requiredRadius L (wordRadius (Fin 4) δ)).trans hl end EulerPacketTerminalDatum