import Euler.PacketStageGuards import Euler.ParentRenewalScaleApplication import Euler.PacketInductionStage /-! The actual stage guards satisfy the fixed pressure, initial-gradient and frame-renewal budgets used by the induction. -/ /-! ## From `Euler/PacketStageLowPropagation.lean` The text of `Euler/PacketStageLowPropagation.lean`, folded into this file, which was its only importer. -/ section /-! The summable scalar budgets propagate the genuine low source guards and absorb the absolute geometric errors. -/ noncomputable section namespace EulerPacketInduction.Stage open Set Finset Real EulerSmoothLimit EulerParentPacketFrames EulerBaseDatum EulerPacketInductionScales EulerPacketLowConstants EulerPacketSourceScaleChoice EulerPacketSourceScaleSequence EulerPacketSourceScaleActual EulerPacketBaseGuardScales EulerPacketPressureScale EulerPacketGeometryLowBounds EulerParentRenewalScale EulerParentRenewalPrefix EulerMeanHarmonic variable {c B : ℝ} {S : Scales c B} {n : ℕ} (P : Stage S n) theorem initial_step_bound (e : ℝ) (he : e ≤ initialIncrement S.J S.X n) : P.low.Be+e ≤ initialCoefficientCost+∑ i ∈ range (n+1), initialIncrement S.J S.X i ∧ P.low.Bc+e ≤ gradientConstant*S.X^1000+∑ i ∈ range (n+1), initialIncrement S.J S.X i := by rw [sum_range_succ] constructor <;> linarith only [P.exterior_bound,P.core_bound,he] theorem pressure_step_bound (e : ℝ) (he : e ≤ pressureIncrement S.J S.X n) : P.low.K+e ≤ initialCoefficientCost+literalInitialPressureCost S.D S.X+ ∑ i ∈ range (n+1), pressureIncrement S.J S.X i := by rw [sum_range_succ] linarith only [P.pressure_bound,he] theorem next_localized (T ei ep : ℝ) (hT : 0 ≤ T) (hTcap : T ≤ baseHorizon S.J S.X) (hi0 : 0 ≤ ei) (hp0 : 0 ≤ ep) (hi : ei ≤ initialIncrement S.J S.X n) (hp : ep ≤ pressureIncrement S.J S.X n) : (P.low.K+ep)*(T^2/2)+(P.low.Be+ei)*T+ boundaryLocalizationC2*(P.low.Bc+ei)*P.low.r^3*T ≤ 1/2 := by have hib := P.initial_step_bound ei hi have hpb := P.pressure_step_bound ep hp have his := S.initial_partial_sum (n+1) have hps := S.pressure_partial_sum (n+1) have hd := S.delta_small have hb := S.first.pressure_small rw [P.radius_eq] apply S.localized_guard T (P.low.K+ep) (P.low.Be+ei) (P.low.Bc+ei) hT (add_nonneg P.low.K_nonneg hp0) (add_nonneg P.low.Be_nonneg hi0) (add_nonneg P.low.Bc_nonneg hi0) · linarith only [hpb,hps,hd,hb] · linarith only [hib.1,his,hd] · linarith only [hib.2,his,hd] · exact hTcap theorem ratio_absorption (r : ℝ) (hr : 0 ≤ r) (hbad : 2*gradientConstant*previousShear S.J S.X n*shear S.J S.X n*r ≤ badCost S.J 4 gradientConstant gradientConstant hessianConstant 80 (scaleSequence S.J S.X) n) : gradientConstant*previousShear S.J S.X n+shear S.J S.X n*(goodRatio+r)+ (frequency S.J S.X n)^(-(1/4 : ℝ)) ≤ gradientConstant*shear S.J S.X n ∧ hessianConstant*previousShear S.J S.X n*olderShear S.J S.X n+ 2*gradientConstant*previousShear S.J S.X n*shear S.J S.X n*(goodRatio+r)+ (frequency S.J S.X n)^(-(1/4 : ℝ)) ≤ hessianConstant*shear S.J S.X n*previousShear S.J S.X n := by have hsum : badCost S.J 4 gradientConstant gradientConstant hessianConstant 80 (scaleSequence S.J S.X) n+(frequency S.J S.X n)^(-(1/4 : ℝ)) ≤ 1 := by have h := S.initial_series.term_le n change initialIncrement S.J S.X n ≤ _ exact h.trans (by linarith only [S.delta_small]) have hM : 1 ≤ 2*gradientConstant*previousShear S.J S.X n := by have h := mul_le_mul_of_nonneg_left (S.previousShear_one n) gradient_nonneg linarith only [gradient_properties.1,h] have hgrad : shear S.J S.X n*r ≤ 2*gradientConstant*previousShear S.J S.X n*shear S.J S.X n*r := by have h := mul_le_mul_of_nonneg_right hM (mul_nonneg (zero_le_one.trans (S.shear_one n)) hr) linarith only [h] have hg : shear S.J S.X n*r+(frequency S.J S.X n)^(-(1/4 : ℝ)) ≤ 1 := by linarith only [hgrad,hbad,hsum] have hh : 2*gradientConstant*previousShear S.J S.X n*shear S.J S.X n*r+ (frequency S.J S.X n)^(-(1/4 : ℝ)) ≤ 1 := by linarith only [hbad,hsum] exact ⟨EulerPacketLowBoundPropagation.gradient_bound _ _ _ _ _ _ gradient_properties.1 (S.previousShear_one n) (S.shear_one n) (S.shear_separation n) gradient_properties.2.2 hg, EulerPacketLowBoundPropagation.hessian_bound _ _ _ _ _ _ _ _ hessian_properties.1 (S.previousShear_one n) (S.shear_one n) (S.olderShear_le n) (S.shear_separation n) hessian_properties.2.2 hh⟩ theorem next_frame_bounds : 1 ≤ frameConstant*(1+previousShear S.J S.X n) ∧ gradientConstant*previousShear S.J S.X n ≤ frameConstant*(1+previousShear S.J S.X n) ∧ (gradientConstant*previousShear S.J S.X n)^2+ hessianConstant*previousShear S.J S.X n*olderShear S.J S.X n ≤ (frameConstant*(1+previousShear S.J S.X n))^2 := by have hp := S.previousShear_one n have hp0 := zero_le_one.trans hp have hf0 := zero_le_one.trans frame_properties.1 have hold := S.olderShear_le n have hcf := frame_properties.2.1 have hCH := frame_properties.2.2 refine ⟨one_le_mul_of_one_le_of_one_le frame_properties.1 (by linarith only [hp]),?_,?_⟩ · exact (mul_le_mul_of_nonneg_right hcf hp0).trans (mul_le_mul_of_nonneg_left (le_add_of_nonneg_left zero_le_one) hf0) · have h1 := mul_le_mul_of_nonneg_left hold (mul_nonneg hessian_nonneg hp0) have h2 := mul_le_mul_of_nonneg_right hCH (sq_nonneg (previousShear S.J S.X n)) have h3 := mul_nonneg (sq_nonneg frameConstant) (show 0 ≤ 1+2*previousShear S.J S.X n by positivity) linarith only [h1,h2,h3] theorem coupling_step (a : ℝ) (h : |a/P.frame.a-1| ≤ renewalCost S.J S.D 4 c frameConstant S.X n) : |a-1| ≤ 2*∑ i ∈ range (n+1), renewalCost S.J S.D 4 c frameConstant S.X i := by have he := S.renewal_series.nonneg n have hd := relative_step_error P.coupling_pos P.coupling_bounds.2 he h have ht := abs_add_le (a-P.frame.a) (P.frame.a-1) rw [show a-P.frame.a+(P.frame.a-1)=a-1 by ring] at ht rw [sum_range_succ] linarith only [hd,ht,P.coupling_error] end EulerPacketInduction.Stage namespace EulerParentPacketFrames.RenewalAtTarget open InnerProductSpace EulerPacketMovingFrame EulerPacketSourceGeometry EulerPacketNormalizedPrimary theorem background_compression_of_error_le_one {ι V : Type} [NormedAddCommGroup V] [InnerProductSpace ℝ V] {D : EulerTransversePacketProvider.Data V} {G : PhysicalGeometryData ι} {P : ParentFrame D G.targetTime} (J : RenewalAtTarget G P) (e : ℝ) (he : e ≤ 1) : ⟪P.B G.targetTime (unit (P.m G.targetTime)),unit (P.m G.targetTime)⟫_ℝ+e < 0 := by rw [J.background_compression_eq] have hm := G.compression_margin he have hc := G.nextCompression_le linarith only [hm,hc] end EulerParentPacketFrames.RenewalAtTarget end end noncomputable section namespace EulerPacketInduction.Stage open Set Real EulerSmoothLimit EulerParentPacketFrames EulerPacketSourceGeometry EulerTransverseFrameCoordinates EulerPacketInductionScales EulerPacketSourceScaleChoice EulerPacketSourceScaleSequence EulerPacketSourceScaleActual EulerPacketSourceScales EulerPacketLowConstants EulerPacketPressureScale EulerPacketGeometryLowBounds EulerParentRenewalScale EulerParentNeighborThreshold EulerPacketSupport section Joined variable {q : ℕ} {B : ℝ} {S : Scales (q : ℝ) B} {n : ℕ} (P : Stage S n) (hn : n ≠ 0) (hq : requiredExponent ≤ q) (hB : commonThreshold gradientConstant hessianConstant ≤ B) local notation "G" => P.joinedGuards hn hq hB local notation "R" => LinearIsometryEquiv.refl ℝ (referencePlane (P.joinedNormal hn)) theorem joined_horizon_bound : (P.joinedFrame hn).horizon ≤ sourceTheta S.J 4 (scaleSequence S.J S.X) n := by rw [P.joinedFrame_horizon,P.restrictedFrame_horizon] exact P.source_stage.horizon_le_Theta include hn in theorem history_inverse_shear : P.time⁻¹ ≤ previousShear S.J S.X n := by rw [← one_div] exact (div_le_iff₀ (P.time_pos hn)).mpr (P.history_layer hn) theorem joined_bad_cost : 2*(gradientConstant*previousShear S.J S.X n)*(G).hchild*(G).badRatio ≤ badCost S.J 4 gradientConstant gradientConstant hessianConstant 80 (scaleSequence S.J S.X) n := P.restrictedState.labels.joined_bad_pressure_cost_bound (P.joinedNormal hn) (P.joinedNormal_unit hn) R support compact P.restrictedLow P.time (P.time_pos hn) P.time_lt_nextHorizon (P.joinedFrame hn) G P.time⁻¹ P.time_one le_rfl S.J S.D S.stage_large S.X 4 gradientConstant gradientConstant hessianConstant 80 S.x_one (by norm_num) gradient_nonneg gradient_nonneg hessian_nonneg (by norm_num) S.actual.initial_shear S.actual.initial_frequency n (gradientConstant*previousShear S.J S.X n) (by rw [rpow_ofNat]; exact P.label_eq.le) (P.history_inverse_shear hn) (P.joinedGuards_CM hn hq hB).le (P.joinedGuards_CH hn hq hB).le (P.joined_horizon_bound hn) (by erw [P.joinedFrame_sigma]; exact P.normalized_sigma) (P.joinedGuards_shear hn hq hB).le le_rfl theorem joined_initial_cost : (G).hchild*(G).badRatio+(frequency S.J S.X n)^(-(1/4 : ℝ)) ≤ initialIncrement S.J S.X n := by have hb := P.joined_bad_cost hn hq hB have hm : 1 ≤ 2*(gradientConstant*previousShear S.J S.X n) := by have h := mul_le_mul_of_nonneg_left (S.previousShear_one n) gradient_nonneg linarith only [gradient_properties.1,h] have hn0 := mul_nonneg (G).child_nonneg (G).badRatio_nonneg have hh := mul_le_mul_of_nonneg_right hm hn0 unfold initialIncrement linarith only [hb,hh] theorem joined_pressure_cost : 2*(gradientConstant*previousShear S.J S.X n)*(G).hchild*((G).δ*goodRatio+(G).badRatio)+ (frequency S.J S.X n)^(-(1/4 : ℝ)) ≤ pressureIncrement S.J S.X n := by have h := P.restrictedState.labels.joined_upper_pressure_cost_bound (P.joinedNormal hn) (P.joinedNormal_unit hn) R support compact P.restrictedLow P.time (P.time_pos hn) P.time_lt_nextHorizon (P.joinedFrame hn) G P.time⁻¹ P.time_one le_rfl S.J S.D S.stage_large S.X 4 gradientConstant gradientConstant hessianConstant 80 S.x_one (by norm_num) gradient_nonneg gradient_nonneg hessian_nonneg (by norm_num) S.actual.initial_shear S.actual.initial_frequency n (gradientConstant*previousShear S.J S.X n) (by rw [rpow_ofNat]; exact P.label_eq.le) (P.history_inverse_shear hn) (P.joinedGuards_CM hn hq hB).le (P.joinedGuards_CH hn hq hB).le (P.joined_horizon_bound hn) (by erw [P.joinedFrame_sigma]; exact P.normalized_sigma) (P.joinedGuards_shear hn hq hB).le le_rfl (P.joinedGuards_delta hn hq hB).le unfold pressureIncrement initialIncrement exact (add_le_add h (le_refl ((frequency S.J S.X n)^(-(1/4 : ℝ))))).trans_eq (add_assoc _ _ _) theorem joined_renewal_errors : (P.joinedGeometry hn hq hB).couplingError ≤ renewalCost S.J S.D 4 (q : ℝ) frameConstant S.X n ∧ (P.joinedGeometry hn hq hB).tiltError ≤ renewalCost S.J S.D 4 (q : ℝ) frameConstant S.X n := by exact (G).renewal_errors_on_scales (by change (1/2 : ℝ) ≤ 1; norm_num) S.J S.D (by have h := S.stage_large; omega) 4 (q : ℝ) frameConstant S.X P.frame.a (by norm_num) frame_properties.1 S.x_one P.coupling_bounds.2 n (P.joinedFrame_a hn) ((P.joinedFrame_shear hn).trans P.frame_shear) (P.joined_horizon_bound hn) ((P.joinedFrame_G hn).le.trans P.frame_bound) ((P.joinedFrame_error hn).le.trans P.frame_error) (P.joined_source_neighbor hn hq hB) (P.joinedGuards_y hn hq hB) (by erw [P.joinedFrame_sigma]; exact P.tilt_upper) end Joined section Forward variable {q : ℕ} {B : ℝ} {S : Scales (q : ℝ) B} (P : Stage S 0) (hq : requiredExponent ≤ q) (hB : commonThreshold gradientConstant hessianConstant ≤ B) local notation "G" => P.forwardGuards hq hB theorem forward_horizon_bound : P.forwardFrame.horizon ≤ sourceTheta S.J 4 (scaleSequence S.J S.X) 0 := by rw [P.forwardFrame_horizon,P.restrictedFrame_horizon] exact P.source_stage.horizon_le_Theta theorem forward_bad_cost : 2*(gradientConstant*previousShear S.J S.X 0)*(G).hchild*(G).earlyRatio ≤ badCost S.J 4 gradientConstant gradientConstant hessianConstant 80 (scaleSequence S.J S.X) 0 := by apply (G).bad_pressure_cost_bound S.J S.stage_large S.X 4 gradientConstant gradientConstant hessianConstant 80 S.x_one (by norm_num) gradient_nonneg gradient_nonneg hessian_nonneg (by norm_num) S.actual.initial_shear 0 (gradientConstant*previousShear S.J S.X 0) P.forward_horizon_bound _ le_rfl le_rfl rw [P.forwardFrame_sigma] exact P.normalized_sigma theorem forward_initial_cost : (G).hchild*(G).earlyRatio+(frequency S.J S.X 0)^(-(1/4 : ℝ)) ≤ initialIncrement S.J S.X 0 := by have hb := P.forward_bad_cost hq hB have hm : 1 ≤ 2*(gradientConstant*previousShear S.J S.X 0) := by have h := mul_le_mul_of_nonneg_left (S.previousShear_one 0) gradient_nonneg linarith only [gradient_properties.1,h] have hn0 := mul_nonneg (G).child_nonneg (G).earlyRatio_nonneg have hh := mul_le_mul_of_nonneg_right hm hn0 unfold initialIncrement linarith only [hb,hh] theorem forward_pressure_cost : 2*(gradientConstant*previousShear S.J S.X 0)*(G).hchild*((G).δ*goodRatio+(G).earlyRatio)+ (frequency S.J S.X 0)^(-(1/4 : ℝ)) ≤ pressureIncrement S.J S.X 0 := by have h := (G).upper_pressure_cost_bound S.J S.stage_large S.X 4 gradientConstant gradientConstant hessianConstant 80 S.x_one (by norm_num) gradient_nonneg gradient_nonneg hessian_nonneg (by norm_num) S.actual.initial_shear 0 (gradientConstant*previousShear S.J S.X 0) P.forward_horizon_bound (by rw [P.forwardFrame_sigma]; exact P.normalized_sigma) le_rfl le_rfl le_rfl unfold pressureIncrement initialIncrement linarith only [h] theorem forward_renewal_errors : (P.forwardGeometry hq hB).couplingError ≤ renewalCost S.J S.D 4 (q : ℝ) frameConstant S.X 0 ∧ (P.forwardGeometry hq hB).tiltError ≤ renewalCost S.J S.D 4 (q : ℝ) frameConstant S.X 0 := by exact (G).renewal_errors_on_scales (by change (1/2 : ℝ) ≤ 1; norm_num) S.J S.D (by have h := S.stage_large; omega) 4 (q : ℝ) frameConstant S.X P.frame.a (by norm_num) frame_properties.1 S.x_one P.coupling_bounds.2 0 P.forwardFrame_a (P.forwardFrame_shear.trans P.frame_shear) P.forward_horizon_bound (P.forwardFrame_G.le.trans P.frame_bound) (P.forwardFrame_error.le.trans P.frame_error) (P.forward_source_neighbor hq hB) rfl (by rw [P.forwardFrame_sigma]; exact P.tilt_upper) end Forward end EulerPacketInduction.Stage