import Euler.ConstantCorrectionData import Euler.PacketFieldSobolevBudget /-! The literal spatial convection of a small smooth cylinder field has a quadratic residual envelope at every Sobolev order. No residual estimate or differential equation is postulated. -/ /-! ## From `Euler/SmallCorrectionScales.lean` The text of `Euler/SmallCorrectionScales.lean`, folded into this file, which was its only importer. -/ section /-! An explicit positive amplitude puts any finite Gevrey datum and quadratic residual envelope in the all-order correction regime. The growth constant belongs to the identity-metric equation, not to an assumed solution. -/ noncomputable section namespace EulerSmallCorrection open Set EulerConstantCorrection EulerNonlinearEnergyConstants variable (P : ℝ) [Fact (0 < P)] def growth : ℝ := energyConstant P 0 0 1 1 pressureBound 1 1 0 0 1 theorem growth_pos : 0 < growth P := energyConstant_pos P 0 0 1 1 pressureBound 1 1 0 0 1 le_rfl le_rfl zero_le_one zero_le_one (zero_le_one.trans pressureBound_one_le) zero_le_one zero_le_one le_rfl le_rfl zero_lt_one def initialRadius (R : ℝ) : ℝ := 1/(2*(R+1)) theorem initialRadius_pos (R : ℝ) (hR : 0 ≤ R) : 0 < initialRadius R := by unfold initialRadius positivity theorem initialRadius_mul (R : ℝ) (hR : 0 ≤ R) : initialRadius R*R ≤ 1/2 := by unfold initialRadius have hd : 0 < 2*(R+1) := by positivity apply (le_div_iff₀ (by norm_num : (0 : ℝ) < 2)).mpr calc _ = R/(R+1) := by field_simp _ ≤ 1 := (div_le_one (by positivity)).mpr (by linarith) /-- These are scalar smallness inequalities, obtained explicitly below. -/ structure Scale (C R E : ℝ) where value : ℝ positive : 0 < value one : value ≤ 1 background : 2*value*C ≤ 1 derivative : 12*value*C*R ≤ 1 shrink : 2*growth P*(8*value*C+value) ≤ initialRadius R/2 residual : 2*(value^2*E)*Real.exp (3*growth P) ≤ value/2 def scale (C R E : ℝ) (hC : 0 ≤ C) (hR : 0 ≤ R) (hE : 0 < E) : Scale P C R E := by let a := 1/(2*C+1) let b := 1/(12*C*R+1) let c := initialRadius R/(4*growth P*(8*C+1)+1) let d := 1/(4*E*Real.exp (3*growth P)+1) let v := min 1 (min a (min b (min c d))) have hG := growth_pos P have hr := initialRadius_pos R hR have ha : 0 < a := by dsimp [a]; positivity have hb : 0 < b := by dsimp [b]; positivity have hc : 0 < c := by dsimp [c]; positivity have hd : 0 < d := by dsimp [d]; positivity have hv : 0 < v := lt_min zero_lt_one (lt_min ha (lt_min hb (lt_min hc hd))) have h1 : v ≤ 1 := min_le_left _ _ have h2 : v ≤ a := (min_le_right _ _).trans (min_le_left _ _) have h3 : v ≤ b := (min_le_right _ _).trans ((min_le_right _ _).trans (min_le_left _ _)) have h4 : v ≤ c := (min_le_right _ _).trans ((min_le_right _ _).trans ((min_le_right _ _).trans (min_le_left _ _))) have h5 : v ≤ d := (min_le_right _ _).trans ((min_le_right _ _).trans ((min_le_right _ _).trans (min_le_right _ _))) have ha' : v*(2*C+1) ≤ 1 := (le_div_iff₀ (by positivity)).mp h2 have hb' : v*(12*C*R+1) ≤ 1 := (le_div_iff₀ (by positivity)).mp h3 have hc' : v*(4*growth P*(8*C+1)+1) ≤ initialRadius R := (le_div_iff₀ (by positivity)).mp h4 have hd' : v*(4*E*Real.exp (3*growth P)+1) ≤ 1 := (le_div_iff₀ (by positivity)).mp h5 refine ⟨v,hv,h1,?_,?_,?_,?_⟩ · nlinarith only [ha',hv] · nlinarith only [hb',hv] · nlinarith only [hc',hv] · have hh := mul_le_mul_of_nonneg_left hd' hv.le nlinarith only [hh,sq_nonneg v] def Scale.radius {C R E : ℝ} (S : Scale P C R E) : C(Icc (0 : ℝ) 1,ℝ) := ⟨fun t => initialRadius R-2*growth P*(8*S.value*C+S.value)*t.val, continuous_const.sub (continuous_const.mul continuous_subtype_val)⟩ theorem Scale.radius_bounds {C R E : ℝ} (S : Scale P C R E) (hC : 0 ≤ C) (t : Icc (0 : ℝ) 1) : initialRadius R/2 ≤ S.radius P t ∧ S.radius P t ≤ initialRadius R := by have hG := growth_pos P have hv := S.positive have ha : 0 ≤ 2*growth P*(8*S.value*C+S.value) := by positivity have hb := mul_le_mul_of_nonneg_left t.property.2 ha have hc := mul_nonneg ha t.property.1 have hd := S.shrink change initialRadius R/2 ≤ initialRadius R-2*growth P*(8*S.value*C+S.value)*t.val ∧ initialRadius R-2*growth P*(8*S.value*C+S.value)*t.val ≤ initialRadius R constructor <;> linarith only [hb,hc,hd] theorem Scale.radius_positive {C R E : ℝ} (S : Scale P C R E) (hC : 0 ≤ C) (hR : 0 ≤ R) (t : Icc (0 : ℝ) 1) : 0 < S.radius P t := (half_pos (initialRadius_pos R hR)).trans_le (S.radius_bounds P hC t).1 theorem Scale.radius_small {C R E : ℝ} (S : Scale P C R E) (hC : 0 ≤ C) (hR : 0 ≤ R) (t : Icc (0 : ℝ) 1) : S.radius P t*R ≤ 1/2 := (mul_le_mul_of_nonneg_right (S.radius_bounds P hC t).2 hR).trans (initialRadius_mul R hR) end EulerSmallCorrection end end noncomputable section namespace EulerSmallCorrection open Set Finset EulerSmoothLimit EulerLiftedGradientSpace EulerCylinderSobolevSpace EulerPacketCylinderField EulerPacketProfileRecursion EulerGevrey EulerPacketWeights EulerH6Pressure EulerSobolevGevreyOperators EulerCylinderPathProduct EulerConstantCorrection EulerAllOrderCorrectionData variable (P : ℝ) [Fact (0 < P)] def residualCost (C R : ℝ) : ℝ := 1+108*productBlockConstant P*C^2*R theorem residualCost_pos (C R : ℝ) (hR : 0 ≤ R) : 0 < residualCost P C R := by have hp := productBlockConstant_nonneg P unfold residualCost positivity variable {P} {T : ℝ} {raw : VectorField} (G : Field P T raw) def residual (ε : ℝ) := (G.smul ε).spatialTransport (G.smul ε) def input (ε : ℝ) : Data P T := data P (G.smul ε).toFieldTower (residual G ε).toFieldTower theorem weighted_shift_one {q : ℕ} {R A : ℝ} (hG : G.WordBound q R A 1) (hR : 0 ≤ R) (hA : 0 ≤ A) (s N : ℕ) (hN : N+q ≤ s) (ρ : ℝ) (hρ : 0 < ρ) (hsmall : ρ*R ≤ 1/2) (t : Icc (0 : ℝ) T) : weightedNorm P q N ρ (G.toFieldTower.realization s t) ≤ 12*A*R := by have h := hG.toFieldTower_weightedNorm_le s N hN ρ hρ t simp_rw [Field.weight_majorant_one] at h rw [← mul_sum] at h exact h.trans ((mul_le_mul_of_nonneg_left (mul_le_mul_of_nonneg_left (Field.square_geometric_le_twelve (ρ*R) (mul_nonneg hρ.le hR) hsmall (N+1)) hR) hA).trans_eq (by ring)) theorem scaled_word {C R : ℝ} (hG : G.WordBound 6 R C 0) (ε : ℝ) (hε : 0 ≤ ε) : (G.smul ε).WordBound 6 R (ε*C) 0 := by simpa only [abs_of_nonneg hε] using hG.smul ε theorem residual_word {C R : ℝ} (hG : G.WordBound 6 R C 0) (hC : 0 ≤ C) (hR : 0 ≤ R) (ε : ℝ) (hε : 0 ≤ ε) : (residual G ε).WordBound 6 R (9*productBlockConstant P*(ε*C)*(ε*C)) 1 := (scaled_word G hG ε hε).spatialTransport (scaled_word G hG ε hε) hR (mul_nonneg hε hC) (mul_nonneg hε hC) theorem residual_weighted {C R : ℝ} (hG : G.WordBound 6 R C 0) (hC : 0 ≤ C) (hR : 0 ≤ R) (ε : ℝ) (hε : 0 ≤ ε) (s N : ℕ) (hN : N+6 ≤ s) (ρ : ℝ) (hρ : 0 < ρ) (hsmall : ρ*R ≤ 1/2) (t : Icc (0 : ℝ) T) : weightedNorm P 6 N ρ ((residual G ε).toFieldTower.realization s t) ≤ ε^2*residualCost P C R := by have hp := productBlockConstant_nonneg P have hh := weighted_shift_one (residual G ε) (residual_word G hG hC hR ε hε) hR (by positivity) s N hN ρ hρ hsmall t apply hh.trans unfold residualCost linarith only [sq_nonneg ε] end EulerSmallCorrection