import Euler.PacketInductionScales import Euler.PacketLowBoundPropagation import Euler.ParentStageHorizon import Euler.ParentStageDirection import Euler.BaseFirstPacketFrame /-! The invariant for a finite, actually constructed packet stage. All fields refer to its genuine Euler state, source guards and frame. The cumulative bounds use only earlier indices. -/ /-! ## From `Euler/PacketInductionScaleBounds.lean` The text of `Euler/PacketInductionScaleBounds.lean`, folded into this file, which was its only importer. -/ section /-! Pointwise and partial-sum consequences of the one global scale choice, ready for a finite-prefix packet induction. -/ noncomputable section namespace EulerPacketInductionScales.Scales open Real Finset EulerScale EulerBaseDatum EulerPacketLowConstants EulerPacketSourceScaleChoice EulerPacketSourceScaleSequence EulerPacketSourceScaleActual EulerPacketSourceScaleGuards EulerPacketBaseGuardScales EulerPacketPressureScale EulerParentRenewalScale EulerPacketUniformSource EulerPacketSourceFrequency variable {c B : ℝ} (S : Scales c B) theorem x_one : 1 ≤ S.X := (by norm_num : (1 : ℝ) ≤ 8).trans S.x_large theorem x_pos : 0 < S.X := zero_lt_one.trans_le S.x_one theorem j_one : 1 ≤ S.J := by have h := S.stage_large; omega theorem sequence_one (n : ℕ) : 1 ≤ scaleSequence S.J S.X n := quadratic_growth_one_le S.J S.j_one (scaleSequence S.J S.X) S.x_one (scaleSequence_succ S.J S.X) n theorem previousShear_one (n : ℕ) : 1 ≤ previousShear S.J S.X n := EulerNormalPacketParameters.previousShear_one S.J S.j_one S.X S.x_one n theorem shear_one (n : ℕ) : 1 ≤ shear S.J S.X n := S.previousShear_one (n+1) theorem spike_pos (n : ℕ) : 0 < spike S.J S.X n := exp_pos _ theorem spike_one (n : ℕ) : spike S.J S.X n ≤ 1 := by unfold spike apply exp_le_one_iff.mpr exact div_nonpos_of_nonpos_of_nonneg (neg_nonpos.mpr (zero_le_one.trans (S.sequence_one n))) (pow_nonneg (Nat.cast_nonneg _) _) theorem support_pos (n : ℕ) : 0 < supportScale S.J S.X n := exp_pos _ theorem support_one (n : ℕ) : supportScale S.J S.X n ≤ 1 := by unfold supportScale apply exp_le_one_iff.mpr exact div_nonpos_of_nonpos_of_nonneg (neg_nonpos.mpr (zero_le_one.trans (S.sequence_one n))) (rpow_nonneg (Nat.cast_nonneg _) _) theorem previousFrequency_one (n : ℕ) : 1 ≤ previousFrequency S.J S.D S.X n := by cases n with | zero => exact S.first.frequency.one_le | succ n => exact (S.normal_frequency n).one_le theorem priorError_one (n : ℕ) : priorError S.J S.D S.X n ≤ 1 := by cases n with | zero => exact S.first.error_small | succ n => exact (S.correction_series.term_le n).trans (S.delta_small.trans (by norm_num)) theorem shear_separation (n : ℕ) : previousShear S.J S.X n^2 ≤ shear S.J S.X n/4 := by have hp := (actualParentRatio_le S.J S.j_one S.X S.x_pos S.actual.initial_shear n).trans ((S.actual.normal.parent.term_le n).trans (S.delta_small.trans (by norm_num : (1 : ℝ)/16 ≤ 1/4))) have hh : 0 < shear S.J S.X n := exp_pos _ have h := (div_le_iff₀ hh).mp hp linarith only [h] theorem olderShear_le (n : ℕ) : olderShear S.J S.X n ≤ previousShear S.J S.X n := by cases n with | zero => exact S.previousShear_one 0 | succ n => have hp := S.previousShear_one n have hs := S.shear_separation n change previousShear S.J S.X n ≤ shear S.J S.X n linarith only [hp,hs,sq_nonneg (previousShear S.J S.X n-1)] theorem frequency_cost (n : ℕ) : (EulerNormalPacketParameters.frequencySpec 4).cost S.J (scaleSequence S.J S.X) n ≤ 1 := (S.frequency_series.term_le n).trans (S.delta_small.trans (by norm_num)) theorem source_frequency (n : ℕ) (P : ℝ) (hP : 1 ≤ P) (hPE : P ≤ EulerNormalPacketParameters.envelope S.J 4 S.X n) : frequencyConstant*P^frequencyPower ≤ smallPower (frequency S.J S.X n) := EulerNormalPacketParameters.frequency_guard S.J 4 S.X P n hP hPE (S.frequency_cost n) theorem secondary_frequency (n : ℕ) (K : ℝ) (hK : K ≤ previousFrequency S.J S.D S.X n^80) : K ≤ frequency S.J S.X n ∧ (supportScale S.J S.X n)⁻¹ ≤ (frequency S.J S.X n)^(3/4 : ℝ) := EulerNormalPacketParameters.secondary_frequency_guards S.J S.D (by have h := S.stage_large; omega) 4 S.X K S.x_one n S.actual.initial_frequency hK (S.frequency_cost n) (S.normal_frequency n).one_le theorem initial_partial_sum (n : ℕ) : ∑ i ∈ range n, initialIncrement S.J S.X i ≤ 2*S.δ := finite_sum_le S.initial_series n theorem pressure_partial_sum (n : ℕ) : ∑ i ∈ range n, pressureIncrement S.J S.X i ≤ 3*S.δ := finite_sum_le S.pressure_series n theorem activation_small {n : ℕ} (hn : n ≠ 0) : frameConstant*(1+olderShear S.J S.X n)+priorError S.J S.D S.X n ≤ activationMargin*previousShear S.J S.X n := by cases n with | zero => exact (hn rfl).elim | succ n => exact activation_smallness S.j_one frame_properties.1 S.x_one S.actual (S.activation_series.weaken S.delta_activation) (priorError S.J S.D S.X (n+1)) (S.priorError_one (n+1)) n theorem localized_guard (T K Be Bc : ℝ) (hT : 0 ≤ T) (hK : 0 ≤ K) (hBe : 0 ≤ Be) (hBc : 0 ≤ Bc) (hKcap : K ≤ initialCoefficientCost+1) (hBecap : Be ≤ initialCoefficientCost+1) (hBccap : Bc ≤ gradientConstant*S.X^1000+2) (hTcap : T ≤ baseHorizon S.J S.X) : K*(T^2/2)+Be*T+EulerMeanHarmonic.boundaryLocalizationC2*Bc*(baseRadius S.X)^3*T ≤ 1/2 := EulerPacketLowBoundPropagation.localized_guard S.J S.X K Be Bc (initialCoefficientCost+1) (initialCoefficientCost+1) gradientConstant EulerMeanHarmonic.boundaryLocalizationC2 T hK hBe hBc hT EulerMeanHarmonic.boundaryLocalizationC2_nonneg (baseRadius_pos S.x_pos).le hKcap hBecap hBccap hTcap S.localized end EulerPacketInductionScales.Scales end end noncomputable section namespace EulerPacketInduction open Set Finset Real InnerProductSpace EulerSmoothLimit EulerParentPacketFrames EulerBaseDatum EulerPacketSupport EulerPacketSourceGeometry EulerPacketNormalizedPrimary EulerPacketLowConstants EulerPacketInductionScales EulerPacketSourceScaleChoice EulerPacketSourceScaleSequence EulerPacketSourceScaleActual EulerPacketBaseGuardScales EulerParentRenewalScale EulerMeanHarmonic def frameData (A : Parent) : EulerTransversePacketProvider.Data FirstPlane := A.transverseData firstNormal firstNormal_unit firstFrame support compact structure Stage {c B : ℝ} (S : Scales c B) (n : ℕ) where parent : Parent state : SmoothState parent low : LowBounds parent time : ℝ time_nonneg : 0 ≤ time time_zero : n=0 → time=0 time_lower : n ≠ 0 → baseHorizon S.J S.X/12 ≤ time horizon_eq : parent.T=time+2*timeWidth S.J S.X n horizon_le : parent.T ≤ baseHorizon S.J S.X scale_eq : parent.ell=supportScale S.J S.X n label_eq : state.labels.K=(previousFrequency S.J S.D S.X n)^80 gradient_bound : ∀ (t : Icc (0 : ℝ) parent.T) x, ‖fderiv ℝ (fun y => state.evolution.velocity (t,y)) x‖ ≤ gradientConstant*previousShear S.J S.X n hessian_bound : ∀ (t : Icc (0 : ℝ) parent.T) x, ‖fderiv ℝ (state.evolution.force t) x‖ ≤ hessianConstant*previousShear S.J S.X n*olderShear S.J S.X n exterior_bound : low.Be ≤ initialCoefficientCost+∑ i ∈ range n, initialIncrement S.J S.X i core_bound : low.Bc ≤ gradientConstant*S.X^1000+∑ i ∈ range n, initialIncrement S.J S.X i pressure_bound : low.K ≤ initialCoefficientCost+literalInitialPressureCost S.D S.X+ ∑ i ∈ range n, pressureIncrement S.J S.X i boundary_eq : low.L=boundaryLocalizationC1*low.Bc+1 radius_eq : low.r=baseRadius S.X frame : ParentFrame (frameData parent) time frame_shear : frame.shear=previousShear S.J S.X n frame_bound : frame.G ≤ frameConstant*(1+olderShear S.J S.X n) frame_error : frame.error ≤ priorError S.J S.D S.X n coupling_error : |frame.a-1| ≤ 2*∑ i ∈ range n, renewalCost S.J S.D 4 c frameConstant S.X i tilt_lower : 1/2 ≤ frame.sigma^2*(scaleSequence S.J S.X n)^2 tilt_upper : frame.sigma^2*(scaleSequence S.J S.X n)^2 ≤ 2 compression : n ≠ 0 → ⟪frame.B time (unit (frame.m time)),unit (frame.m time)⟫_ℝ+priorError S.J S.D S.X n < 0 namespace Stage variable {c B : ℝ} {S : Scales c B} {n : ℕ} (P : Stage S n) theorem coupling_bounds : 1/2 ≤ P.frame.a ∧ P.frame.a ≤ 2 := EulerParentRenewalPrefix.bounds_of_accumulated_error S.renewal_series le_rfl n P.coupling_error theorem coupling_pos : 0 < P.frame.a := by linarith only [P.coupling_bounds.1] theorem sigma_nonneg : 0 ≤ P.frame.sigma := sqrt_nonneg _ theorem sigma_pos : 0 < P.frame.sigma := by by_contra h have hz := le_antisymm (le_of_not_gt h) P.sigma_nonneg have ht := P.tilt_lower rw [hz,zero_pow (by decide : 2 ≠ 0),zero_mul] at ht norm_num at ht theorem time_lt : P.time < P.parent.T := by rw [P.horizon_eq] exact lt_add_of_pos_right _ (mul_pos (by norm_num) (timeWidth_pos S.J S.j_one S.x_pos n)) theorem time_one : P.time ≤ 1 := P.time_lt.le.trans (P.horizon_le.trans S.time_small) theorem horizon_lower : baseHorizon S.J S.X/12 < P.parent.T := by by_cases hn : n=0 · have ht := P.time_zero hn have heq : P.parent.T=baseHorizon S.J S.X := by rw [P.horizon_eq,ht,zero_add,hn,← baseHorizon_eq_timeWidth S.J S.x_pos] rw [heq] have hp := baseHorizon_pos S.J S.j_one S.x_pos linarith only [hp] · exact (P.time_lower hn).trans_lt P.time_lt theorem time_pos (hn : n ≠ 0) : 0 < P.time := (div_pos (baseHorizon_pos S.J S.j_one S.x_pos) (by norm_num)).trans_le (P.time_lower hn) theorem time_reciprocal (hn : n ≠ 0) : P.time⁻¹ ≤ 12/baseHorizon S.J S.X := by have hp := div_pos (baseHorizon_pos S.J S.j_one S.x_pos) (by norm_num : (0 : ℝ) < 12) have h := one_div_le_one_div_of_le hp (P.time_lower hn) simpa only [one_div,inv_div] using h theorem core_cap : P.low.Bc ≤ gradientConstant*S.X^1000+2 := by have h := P.core_bound have hs := S.initial_partial_sum n have hd := S.delta_small linarith only [h,hs,hd] theorem source_stage : EulerPacketSourceScaleGuards.StageGuards S.J S.D 4 c S.X geometryConstant (fun _ => P.frame.a) (fun _ => P.frame.sigma^2) n := S.stage _ _ n P.coupling_bounds.1 P.coupling_bounds.2 P.tilt_lower P.tilt_upper theorem normalized_sigma : P.frame.sigma*scaleSequence S.J S.X n ≤ 2 := by have h := P.tilt_upper have hx := S.sequence_one n have hp := mul_nonneg P.sigma_nonneg (zero_le_one.trans hx) linarith only [h,hp,sq_nonneg (P.frame.sigma*scaleSequence S.J S.X n-1)] theorem strain_bound (t : Icc (0 : ℝ) P.parent.T) (x : Space) : ‖P.parent.strain.field t x‖ ≤ gradientConstant*previousShear S.J S.X n := by rw [P.state.evolution.strain_eq] exact P.gradient_bound _ _ theorem curvature_bound (t : Icc (0 : ℝ) P.parent.T) (x : Space) : ‖P.parent.curvature.field t x‖ ≤ hessianConstant*previousShear S.J S.X n*olderShear S.J S.X n := by rw [P.state.evolution.curvature_eq] exact P.hessian_bound _ _ end Stage end EulerPacketInduction