import Euler.PacketFiniteCoarseBounds import Euler.PacketFiniteSumBounds import Euler.PacketApproximationNormalization /-! The literal packet differs from its primary wave by a quadratic-frequency remainder. -/ /-! ## From `Euler/PacketFiniteApproximationBounds.lean` The text of `Euler/PacketFiniteApproximationBounds.lean`, folded into this file, which was its only importer. -/ section /-! Quantitative bounds for the literal finite approximate velocity and its time derivative. -/ noncomputable section namespace EulerPacketCylinderField.ProfileRegularity open Set EulerSmoothLimit EulerPacketProfileRecursion EulerPacketTimeProfile EulerFiniteGrades EulerPacketCoarseMajorant variable {P T : ℝ} [Fact (0 < P)] {N : ℕ} {a : ℕ → Profile} {support : Set Space} (hT : 0 < T) (G : ∀ i, i ≤ N → ProfileRegularity P T hT.le support (a i)) {S : Scales (Icc (0 : ℝ) T)} {R : ℝ} (hG : ∀ i (hi : i ≤ N), 1 ≤ i → ProfileBudget (G i hi) S R i) (hR : 1 ≤ R) (ha : a 0=0) (hN : 1 ≤ N) (C : ℝ) (hC : 1 ≤ C) include hG hR ha hN hC theorem velocity_bound (κ : ℝ) (hκ : 0 ≤ κ) (hsmall : κ*tailBase R S.H0 C N ≤ 1/2) : (velocityField hT G κ).WordBound 6 (4*R) (κ*fixedVelocityGradeCost R S.H0 1+κ^2*fixedVelocityGradeCost R S.H0 2+ 2*tailBase R S.H0 C N*(κ*tailBase R S.H0 C N)^3) 0 := by have hf : (a 0).high+(a 0).mean=0 := by rw [ha] change (0 : VectorField)+0=0 exact zero_add 0 have hz : assembledVelocity N a 0=0 := assemble_zero N _ _ hf exact Field.wordBound_evaluate_low_high N hN κ (tailBase R S.H0 C N) (fixedVelocityGradeCost R S.H0 1) (fixedVelocityGradeCost R S.H0 2) hκ (tailBase_nonneg R S.H0 C (zero_le_one.trans hC) N) hsmall (assembledVelocity N a) (velocityGradeField hT G) 6 (4*R) (by linarith) (fun _ _ _ => by rw [hz]; rfl) ((velocityGrade_bound hT G hG hR ha 1).fixed_velocity_grade (zero_le_one.trans hR) S.H0_pos.le) ((velocityGrade_bound hT G hG hR ha 2).fixed_velocity_grade (zero_le_one.trans hR) S.H0_pos.le) (fun n _ hn => (velocityGrade_bound hT G hG hR ha n).coarse_velocity_grade hR S.H0_one_le C hC N hN (by omega)) theorem velocityDerivative_bound (κ : ℝ) (hκ : 0 ≤ κ) (hsmall : κ*tailBase R S.H0 C N ≤ 1/2) : (velocityDerivativeField hT G κ).WordBound 6 (4*R) (κ*fixedVelocityGradeCost R S.H0 1+κ^2*fixedVelocityGradeCost R S.H0 2+ 2*tailBase R S.H0 C N*(κ*tailBase R S.H0 C N)^3) 0 := by have hf : (a 0).high+(a 0).mean=0 := by rw [ha] change (0 : VectorField)+0=0 exact zero_add 0 have hf' : rawTimeDerivative T ((a 0).high+(a 0).mean)=0 := by rw [hf,rawTimeDerivative_zero] have hz : velocityTimeCoefficients (T := T) (N := N) (a := a) 0=0 := assemble_zero N _ _ hf' exact Field.wordBound_evaluate_low_high N hN κ (tailBase R S.H0 C N) (fixedVelocityGradeCost R S.H0 1) (fixedVelocityGradeCost R S.H0 2) hκ (tailBase_nonneg R S.H0 C (zero_le_one.trans hC) N) hsmall (velocityTimeCoefficients (T := T) (N := N) (a := a)) (velocityGradeDerivativeField hT G) 6 (4*R) (by linarith) (fun _ _ _ => by rw [hz]; rfl) ((velocityGradeDerivative_bound hT G hG hR ha 1).fixed_velocity_grade (zero_le_one.trans hR) S.H0_pos.le) ((velocityGradeDerivative_bound hT G hG hR ha 2).fixed_velocity_grade (zero_le_one.trans hR) S.H0_pos.le) (fun n _ hn => (velocityGradeDerivative_bound hT G hG hR ha n).coarse_velocity_grade hR S.H0_one_le C hC N hN (by omega)) end EulerPacketCylinderField.ProfileRegularity end end /-! ## From `Euler/PacketFiniteRemainderBounds.lean` The text of `Euler/PacketFiniteRemainderBounds.lean`, folded into this file, which was its only importer. -/ section /-! Removing the literal leading coefficient before bounding the packet remainder. -/ noncomputable section namespace EulerPacketCylinderField.Field open Set Finset EulerPacketPointJets EulerPacketProfileRecursion EulerFiniteGrades variable {P T : ℝ} [Fact (0 < P)] def evaluateRemainder (M : ℕ) (hM : 1 ≤ M) (κ : ℝ) (f : ℕ → VectorField) (G : ∀ i, Field P T (f i)) : Field P T (fieldSum M κ f-κ • f 1) := by let W := Field.finsetSum ((range (M+1)).erase 1) (fun i => κ^i • f i) (fun i => (G i).smul (κ^i)) refine W.congr ?_ intro t x θ change fieldSum M κ f (t,(x,θ))-κ • f 1 (t,(x,θ)) = _ have hm : 1 ∈ range (M+1) := mem_range.mpr (by omega) have he := Finset.sum_erase_add (range (M+1)) (fun i => κ^i • f i (t,(x,θ))) hm rw [pow_one] at he change (∑ i ∈ range (M+1), κ^i • f i (t,(x,θ)))-κ • f 1 (t,(x,θ)) = _ simp only [Finset.sum_apply,Pi.smul_apply] exact (eq_sub_iff_add_eq.mpr he).symm theorem wordBound_evaluateRemainder (N : ℕ) (hN : 1 ≤ N) (κ B C₂ : ℝ) (hκ : 0 ≤ κ) (hB : 0 ≤ B) (hsmall : κ*B ≤ 1/2) (f : ℕ → VectorField) (G : ∀ i, Field P T (f i)) (q : ℕ) (R : ℝ) (hR : 0 ≤ R) (hzero : ∀ (t : Icc (0 : ℝ) T) x θ, f 0 (t,(x,θ))=0) (htwo : (G 2).WordBound q R C₂ 0) (htail : ∀ n, 3 ≤ n → n ≤ N+1 → (G n).WordBound q R (B^(n+1)) 0) : (evaluateRemainder (N+1) (by omega) κ f G).WordBound q R (κ^2*C₂+2*B*(κ*B)^3) 0 := by have hG : ∀ i ∈ (range (N+1+1)).erase 1, (G i).WordBound q R (lowHighEnvelope B 0 C₂ i) 0 := by intro i hi have hi1 := (mem_erase.mp hi).1 have him := mem_range.mp (mem_erase.mp hi).2 by_cases hi0 : i=0 · subst i simpa only [lowHighEnvelope,ite_true] using wordBound_of_zero (G 0) hzero q R 0 · by_cases hi2 : i=2 · subst i simpa only [lowHighEnvelope,show ¬(2:ℕ)=0 by omega,show ¬(2:ℕ)=1 by omega, ite_false,ite_true] using htwo · simpa only [lowHighEnvelope,ite_eq_right hi0,ite_eq_right hi1,ite_eq_right hi2] using htail i (by omega) (by omega) have hs := wordBound_finsetSum ((range (N+1+1)).erase 1) (fun i => κ^i • f i) (fun i => (G i).smul (κ^i)) (fun i => κ^i*lowHighEnvelope B 0 C₂ i) (fun i hi => by simpa only [abs_of_nonneg (pow_nonneg hκ i)] using (hG i hi).smul (κ^i)) have he : (∑ i ∈ (range (N+1+1)).erase 1, κ^i*lowHighEnvelope B 0 C₂ i) = ∑ i ∈ range (N+1+1), κ^i*lowHighEnvelope B 0 C₂ i := Finset.sum_erase (range (N+1+1)) (by simp [lowHighEnvelope]) rw [he] at hs have hb := weighted_low_high_sum_le N hN κ B 0 C₂ hκ hB hsmall (lowHighEnvelope B 0 C₂) (by simp [lowHighEnvelope]) (by simp [lowHighEnvelope]) (by simp [lowHighEnvelope]) (fun n hn _ => by simp [lowHighEnvelope,show n≠0 by omega,show n≠1 by omega,show n≠2 by omega]) simp only [mul_zero,zero_add] at hb exact (hs.mono_amplitude hR hb).of_path_eq _ rfl end EulerPacketCylinderField.Field end end /-! ## From `Euler/PacketApproximationBounds.lean` The text of `Euler/PacketApproximationBounds.lean`, folded into this file, which was its only importer. -/ section /-! Actual inverse-frame approximate fields have bounds independent of packet length. -/ noncomputable section namespace EulerPacketCylinderField.ProfileRegularity open Set EulerSmoothLimit EulerPacketProfileRecursion EulerPacketTimeProfile EulerPacketCoarseMajorant EulerParameterWordGevrey variable {P T : ℝ} [Fact (0 < P)] {N : ℕ} {a : ℕ → Profile} {support : Set Space} (hT : 0 < T) (G : ∀ i, i ≤ N → ProfileRegularity P T hT.le support (a i)) {S : Scales (Icc (0 : ℝ) T)} {R : ℝ} (hG : ∀ i (hi : i ≤ N), 1 ≤ i → ProfileBudget (G i hi) S R i) (hR : 1 ≤ R) (ha : a 0=0) (hN : 1 ≤ N) {O : Operators} {C : CoefficientData P T O} (BC : CoefficientBudget C) (hRc : sobolevCoefficientRadius (Fin 4) BC.Rc ≤ R) include hG hR ha hN hRc theorem normalizedVelocity_bound (k : ℝ) (hk : 4 ≤ k) (hbase : tailBase R S.H0 BC.termCost N ≤ k^(1/100 : ℝ)) : ((C.inverse.multiply (velocityField hT G k⁻¹)).smul k).WordBound 6 (4*R) (BC.multiplierCost*(fixedVelocityGradeCost R S.H0 1+fixedVelocityGradeCost R S.H0 2+1)) 0 := by have hk0 : 0 ≤ k := by linarith have hsmall : k⁻¹*tailBase R S.H0 BC.termCost N ≤ 1/2 := by simpa only [div_eq_mul_inv,mul_comm] using EulerPacketTailBound.grade_ratio_le_half k (tailBase R S.H0 BC.termCost N) hk hbase have h := velocity_bound hT G hG hR ha hN BC.termCost BC.one_le_termCost k⁻¹ (inv_nonneg.mpr hk0) hsmall exact BC.normalized_approximation_bound (velocityField hT G k⁻¹) h (by linarith) (hRc.trans (by linarith)) hk (tailBase_nonneg R S.H0 BC.termCost BC.termCost_nonneg N) hbase (fixedVelocityGradeCost_nonneg R S.H0 (zero_le_one.trans hR) 1) (fixedVelocityGradeCost_nonneg R S.H0 (zero_le_one.trans hR) 2) end EulerPacketCylinderField.ProfileRegularity end end noncomputable section namespace EulerPacketCylinderField.ProfileRegularity open Set EulerSmoothLimit EulerPacketPointJets EulerPacketProfileRecursion EulerPacketTimeProfile EulerFiniteGrades EulerPacketCoarseMajorant EulerPacketFiniteFrequency variable {P T : ℝ} [Fact (0 < P)] {N : ℕ} {a : ℕ → Profile} {support : Set Space} (hT : 0 < T) (G : ∀ i, i ≤ N → ProfileRegularity P T hT.le support (a i)) theorem assembledVelocity_one (hN : 1 ≤ N) (ha : a 0=0) (hb : (a 1).mean=0) : assembledVelocity N a 1=(a 1).high := by rw [assembledVelocity,assemble_interior N 1 le_rfl hN] simp only [Nat.sub_self,hb,ha] change (a 1).high+0+0=(a 1).high simp only [add_zero] def primaryRemainderField (hN : 1 ≤ N) (ha : a 0=0) (hb : (a 1).mean=0) (κ : ℝ) : Field P T (fieldSum (N+1) κ (assembledVelocity N a)-κ • (a 1).high) := (Field.evaluateRemainder (N+1) (by omega) κ (assembledVelocity N a) (velocityGradeField hT G)).congr (fun _ _ _ => by rw [assembledVelocity_one hN ha hb]) variable {S : Scales (Icc (0 : ℝ) T)} {R : ℝ} (hG : ∀ i (hi : i ≤ N), 1 ≤ i → ProfileBudget (G i hi) S R i) (hR : 1 ≤ R) (ha : a 0=0) (hb : (a 1).mean=0) (hN : 1 ≤ N) {O : Operators} {C : CoefficientData P T O} (BC : CoefficientBudget C) include hG hR theorem primaryRemainder_bound (k : ℝ) (hk : 4 ≤ k) (hbase : tailBase R S.H0 BC.termCost N ≤ k^(1/100 : ℝ)) : (primaryRemainderField hT G hN ha hb k⁻¹).WordBound 6 (4*R) ((fixedVelocityGradeCost R S.H0 2+2)/k^2) 0 := by have hk0 : 0 < k := by linarith let B := tailBase R S.H0 BC.termCost N have hB : 0 ≤ B := tailBase_nonneg R S.H0 BC.termCost BC.termCost_nonneg N have hsmall : k⁻¹*B ≤ 1/2 := by simpa only [div_eq_mul_inv,mul_comm] using EulerPacketTailBound.grade_ratio_le_half k B hk hbase have hf : (a 0).high+(a 0).mean=0 := by rw [ha] change (0 : VectorField)+0=0 exact zero_add 0 have hz : assembledVelocity N a 0=0 := assemble_zero N _ _ hf have h := Field.wordBound_evaluateRemainder N hN k⁻¹ B (fixedVelocityGradeCost R S.H0 2) (inv_nonneg.mpr hk0.le) hB hsmall (assembledVelocity N a) (velocityGradeField hT G) 6 (4*R) (by linarith) (fun _ _ _ => by rw [hz]; rfl) ((velocityGrade_bound hT G hG hR ha 2).fixed_velocity_grade (zero_le_one.trans hR) S.H0_pos.le) (fun n _ hn => (velocityGrade_bound hT G hG hR ha n).coarse_velocity_grade hR S.H0_one_le BC.termCost BC.one_le_termCost N hN (by omega)) exact (h.mono_amplitude (by linarith) (remainder_low_high_le k B (fixedVelocityGradeCost R S.H0 2) hk0 (fourth_power_le_frequency k B (by linarith) hB hbase))).of_path_eq _ rfl theorem normalizedRemainder_bound (hRc : EulerParameterWordGevrey.sobolevCoefficientRadius (Fin 4) BC.Rc ≤ R) (k : ℝ) (hk : 4 ≤ k) (hbase : tailBase R S.H0 BC.termCost N ≤ k^(1/100 : ℝ)) : ((C.inverse.multiply (primaryRemainderField hT G hN ha hb k⁻¹)).smul k).WordBound 6 (4*R) (BC.multiplierCost*(fixedVelocityGradeCost R S.H0 2+2)/k) 0 := by have hk0 : 0 < k := by linarith have hA : 0 ≤ (fixedVelocityGradeCost R S.H0 2+2)/k^2 := div_nonneg (by have := fixedVelocityGradeCost_nonneg R S.H0 (zero_le_one.trans hR) 2; linarith) (sq_nonneg k) have h := BC.normalized_inverse_bound (primaryRemainderField hT G hN ha hb k⁻¹) (primaryRemainder_bound hT G hG hR ha hb hN BC k hk hbase) hA (hRc.trans (by linarith)) k hk0.le have he : k*BC.multiplierCost*((fixedVelocityGradeCost R S.H0 2+2)/k^2) = BC.multiplierCost*(fixedVelocityGradeCost R S.H0 2+2)/k := by field_simp simpa only [he] using h end EulerPacketCylinderField.ProfileRegularity