import Euler.PacketPhysicalStage import Euler.PacketNeighborControlled import Euler.EulerProof import Euler.PacketNeighborStability import Euler.PacketPhysicalNormBounds /-! The arbitrary physical tangent propagator has polynomial loss relative to the actual primary scalar profile. All scaled coefficients and tangency properties are derived from the physical ODEs and parent decomposition. -/ /-! ## From `Euler/PacketVelocityPropagator.lean` The text of `Euler/PacketVelocityPropagator.lean`, folded into this file, which was its only importer. -/ section /-! Relative propagator estimates on arbitrary subintervals for actual velocity states. -/ noncomputable section namespace EulerPacketMovingFrame open Set EulerPacketBridge EulerPacketPerturbation EulerClosedIntervalDerivativeExtension theorem velocity_propagator_bound {σ Θ s t δ : ℝ} {F F₁ G G₁ U U₁ V V₁ : ℝ → ℝ} (hσ : 0 < σ) (hσsmall : σ ≤ 1/4) (hΘ : 1 ≤ Θ) (hs : 0 ≤ s) (hst : s ≤ t) (ht : t ≤ Θ) (hδ : 0 ≤ δ) (hsmall : 20*Θ^8*δ*(t-s) ≤ 1/2) (hF : ∀ x, 0 ≤ x → HasDerivAt F (F₁ x) x) (hG : ∀ x, 0 ≤ x → HasDerivAt G (G₁ x) x) (hfluxF : ∀ x, 0 ≤ x → HasDerivAt (fun u => (1+(σ^2*u^2)^2)*F₁ u) (2*(1-σ^2*(σ^2*x^2))*F x) x) (hfluxG : ∀ x, 0 ≤ x → HasDerivAt (fun u => (1+(σ^2*u^2)^2)*G₁ u) (2*(1-σ^2*(σ^2*x^2))*G x) x) (hF0 : F 0 = 1) (hF₁0 : F₁ 0 = 0) (hG₁0 : G₁ 0 = 1) (hU : ∀ x ∈ Icc s t, HasDerivAt U (U₁ x) x) (hV : ∀ x ∈ Icc s t, HasDerivAt V (V₁ x) x) (hU₁c : ContinuousOn U₁ (Icc s t)) (hV₁c : ContinuousOn V₁ (Icc s t)) (herror : ∀ x ∈ Icc s t, |U₁ x-idealVelocityFirst (σ^2) x (U x) (V x)|+|V₁ x+U x| ≤ δ*(|U x|+|V x|)) : |U t|+|V t| ≤ 40*Θ^8*(F t/F s)*(|U s|+|V s|) := by let f : ℝ → ℝ := fun x => V₁ x+U x let g : ℝ → ℝ := fun x => -U₁ x+idealVelocityFirst (σ^2) x (U x) (V x) have hUc : ContinuousOn U (Icc s t) := fun x hx => (hU x hx).continuousAt.continuousWithinAt have hVc : ContinuousOn V (Icc s t) := fun x hx => (hV x hx).continuousAt.continuousWithinAt have hfc : ContinuousOn f (Icc s t) := hV₁c.add hUc have hgc : ContinuousOn g (Icc s t) := hU₁c.neg.add (continuousOn_idealVelocityFirst hUc hVc) have hY : ∀ x ∈ Icc s t, HasDerivAt V (-U x+f x) x := by intro x hx exact (velocity_scalar_flux (β := σ^2) (hU x hx) (hV x hx)).1 have hfluxY : ∀ x ∈ Icc s t, HasDerivAt (fun u => (1+(σ^2*u^2)^2)*(-U u)) (2*(1-σ^2*(σ^2*x^2))*V x+(1+(σ^2*x^2)^2)*g x) x := by intro x hx exact (velocity_scalar_flux (β := σ^2) (hU x hx) (hV x hx)).2 have hforcing : ∀ x ∈ Icc s t, |f x|+|g x| ≤ δ*(|V x|+|-U x|) := by intro x hx have hg : |g x| = |U₁ x-idealVelocityFirst (σ^2) x (U x) (V x)| := by dsimp [g] rw [neg_add_eq_sub, abs_sub_comm] rw [hg, abs_neg] dsimp [f] linarith only [herror x hx] have hb := equation30_perturbed_bound hσ hσsmall hΘ hs hst ht hδ hsmall hF hG hfluxF hfluxG hF0 hF₁0 hG₁0 hY hfluxY hfc hgc hforcing t ⟨hst, le_rfl⟩ simpa only [abs_neg, add_comm] using hb theorem velocity_propagator_bound_within {σ Θ T e : ℝ} {F F₁ G G₁ U U₁ V V₁ : ℝ → ℝ} (hσ : 0 < σ) (hσsmall : σ ≤ 1/4) (hΘ : 1 ≤ Θ) (hT0 : 0 < T) (hT : T ≤ Θ) (he : 0 ≤ e) (hsmall : 40*e*Θ^21 ≤ 1) (hF : ∀ x, 0 ≤ x → HasDerivAt F (F₁ x) x) (hG : ∀ x, 0 ≤ x → HasDerivAt G (G₁ x) x) (hfluxF : ∀ x, 0 ≤ x → HasDerivAt (fun u => (1+(σ^2*u^2)^2)*F₁ u) (2*(1-σ^2*(σ^2*x^2))*F x) x) (hfluxG : ∀ x, 0 ≤ x → HasDerivAt (fun u => (1+(σ^2*u^2)^2)*G₁ u) (2*(1-σ^2*(σ^2*x^2))*G x) x) (hF0 : F 0 = 1) (hF₁0 : F₁ 0 = 0) (hG₁0 : G₁ 0 = 1) (hU : ∀ x ∈ Icc 0 T, HasDerivWithinAt U (U₁ x) (Icc 0 T) x) (hV : ∀ x ∈ Icc 0 T, HasDerivWithinAt V (V₁ x) (Icc 0 T) x) (hU₁c : ContinuousOn U₁ (Icc 0 T)) (hV₁c : ContinuousOn V₁ (Icc 0 T)) (herror : ∀ x ∈ Icc 0 T, |U₁ x-idealVelocityFirst (σ^2) x (U x) (V x)|+|V₁ x+U x| ≤ (e*Θ^12)*(|U x|+|V x|)) : ∀ s t, 0 ≤ s → s ≤ t → t ≤ T → |U t|+|V t| ≤ 40*Θ^8*(F t/F s)*(|U s|+|V s|) := by obtain ⟨U', hUeq, hU'⟩ := exists_extension hT0 hU obtain ⟨V', hVeq, hV'⟩ := exists_extension hT0 hV intro s t hs hst ht have hsub : Icc s t ⊆ Icc 0 T := fun x hx => ⟨hs.trans hx.1, hx.2.trans ht⟩ have hδ : 0 ≤ e*Θ^12 := by positivity have hspan : t-s ≤ Θ := by linarith only [ht, hT, hs] have hsmall' : 20*Θ^8*(e*Θ^12)*(t-s) ≤ 1/2 := by have hh := mul_le_mul_of_nonneg_left hspan (show 0 ≤ 20*e*Θ^20 by positivity) linarith only [hh, hsmall] have he' : ∀ x ∈ Icc s t, |U₁ x-idealVelocityFirst (σ^2) x (U' x) (V' x)|+|V₁ x+U' x| ≤ (e*Θ^12)*(|U' x|+|V' x|) := by intro x hx simpa only [hUeq (hsub hx), hVeq (hsub hx)] using herror x (hsub hx) have hb := velocity_propagator_bound hσ hσsmall hΘ hs hst (ht.trans hT) hδ hsmall' hF hG hfluxF hfluxG hF0 hF₁0 hG₁0 (fun x hx => hU' x (hsub hx)) (fun x hx => hV' x (hsub hx)) (hU₁c.mono hsub) (hV₁c.mono hsub) he' have hsT : s ∈ Icc 0 T := ⟨hs, hst.trans ht⟩ have htT : t ∈ Icc 0 T := ⟨hs.trans hst, ht⟩ simpa only [hUeq htT, hVeq htT, hUeq hsT, hVeq hsT] using hb end EulerPacketMovingFrame end end /-! ## From `Euler/PacketReferenceRatio.lean` The text of `Euler/PacketReferenceRatio.lean`, folded into this file, which was its only importer. -/ section /-! Relative growth of the primary scalar reference dominates zero slope. -/ noncomputable section namespace EulerPacketMovingFrame open Set EulerPacketGrowth theorem equation30_slope_ratio_dominates {σ lam s t : ℝ} {F F₁ Z Z₁ : ℝ → ℝ} (hσ : 0 < σ) (hσsmall : σ ≤ 1/4) (hlam : 0 ≤ lam) (hF : ∀ x, 0 ≤ x → HasDerivAt F (F₁ x) x) (hZ : ∀ x, 0 ≤ x → HasDerivAt Z (Z₁ x) x) (hfluxF : ∀ x, 0 ≤ x → HasDerivAt (fun u => (1+(σ^2*u^2)^2)*F₁ u) (2*(1-σ^2*(σ^2*x^2))*F x) x) (hfluxZ : ∀ x, 0 ≤ x → HasDerivAt (fun u => (1+(σ^2*u^2)^2)*Z₁ u) (2*(1-σ^2*(σ^2*x^2))*Z x) x) (hF0 : F 0 = 1) (hF₁0 : F₁ 0 = 0) (hZ0 : Z 0 = 1) (hZ₁0 : Z₁ 0 = lam) (hs : 0 ≤ s) (hst : s ≤ t) : F t/F s ≤ Z t/Z s := by have hFp := equation30_global_positive hσ hσsmall hF hfluxF hF0 (by rw [hF₁0]) have hZp := equation30_global_positive hσ hσsmall hZ hfluxZ hZ0 (by rw [hZ₁0]; exact hlam) have ht : 0 ≤ t := hs.trans hst let D : ℝ → ℝ := fun x => 1+(σ^2*x^2)^2 have hquotient : ∀ x ∈ Icc 0 t, HasDerivAt (fun u => Z u/F u) (lam/(D x*(F x)^2)) x := by have hh := quotient_derivative_of_flux (D := D) (c := fun x => 2*(1-σ^2*(σ^2*x^2))) (fun x (hx : x ∈ Icc 0 t) => hF x hx.1) (fun x hx => hZ x hx.1) (fun x hx => hfluxF x hx.1) (fun x hx => hfluxZ x hx.1) (fun _ _ => by dsimp [D]; positivity) (fun x hx => ne_of_gt (hFp x hx.1)) intro x hx simpa only [hF0, hF₁0, hZ₁0, D, zero_pow (by decide : 2 ≠ 0), mul_zero, zero_mul, add_zero, one_mul, sub_zero] using hh x hx have hmono : MonotoneOn (fun x => Z x/F x) (Icc 0 t) := by apply monotoneOn_of_hasDerivWithinAt_nonneg (convex_Icc (0:ℝ) t) (fun x hx => (hquotient x hx).continuousAt.continuousWithinAt) (fun x hx => (hquotient x (interior_subset hx)).hasDerivWithinAt) intro x _ exact div_nonneg hlam (by dsimp [D]; positivity) have hr := hmono ⟨hs, hst⟩ ⟨ht, le_rfl⟩ hst have hp := (div_le_div_iff₀ (hFp s hs) (hFp t ht)).mp hr apply (div_le_div_iff₀ (hFp s hs) (hZp s hs)).mpr linarith only [hp] end EulerPacketMovingFrame end end /-! ## From `Euler/PacketControlledPropagator.lean` The text of `Euler/PacketControlledPropagator.lean`, folded into this file, which was its only importer. -/ section /-! The actual controlled velocity system has polynomial relative propagation. -/ noncomputable section namespace EulerPacketMovingFrame open Set EulerPacketRay EulerPacketBridge EulerPacketExistence /-- No initial velocity restriction is imposed. The reference can have any nonnegative initial slope, and the bound retains its ratio. -/ theorem controlled_velocity_propagator_within {σ Θ T e ε : ℝ} {Z Z₁ U V P Q N : ℝ → ℝ} {R A C : ℝ → Fin 3 → Fin 3 → ℝ} (hσ : 0 < σ) (hσsmall : σ ≤ 1/4) (hΘ : 1 ≤ Θ) (hT0 : 0 < T) (hT : T ≤ Θ) (he : 0 ≤ e) (hε : 0 ≤ ε) (hεe : ε ≤ e) (hsmall : 8000000*e*Θ^21 ≤ 1) (hRc : ∀ i j, ContinuousOn (fun t => R t i j) (Icc 0 T)) (hAc : ∀ i j, ContinuousOn (fun t => A t i j) (Icc 0 T)) (hCc : ∀ i j, ContinuousOn (fun t => C t i j) (Icc 0 T)) (hP : ∀ t ∈ Icc 0 T, HasDerivWithinAt P (R t 0 0*P t+R t 0 1*Q t+R t 0 2*N t) (Icc 0 T) t) (hQ : ∀ t ∈ Icc 0 T, HasDerivWithinAt Q (R t 1 0*P t+R t 1 1*Q t+R t 1 2*N t) (Icc 0 T) t) (hN : ∀ t ∈ Icc 0 T, HasDerivWithinAt N (R t 2 0*P t+R t 2 1*Q t+R t 2 2*N t) (Icc 0 T) t) (hU : ∀ t ∈ Icc 0 T, HasDerivWithinAt U (velocityFirstRhs (A t) (C t) ε (P t) (Q t) (N t) (U t) (V t)) (Icc 0 T) t) (hV : ∀ t ∈ Icc 0 T, HasDerivWithinAt V (velocitySecondRhs (A t) (C t) ε (P t) (Q t) (N t) (U t) (V t)) (Icc 0 T) t) (hRclose : ∀ t ∈ Icc 0 T, ∀ i j, |R t i j-idealRayEntry (σ^2) i j| ≤ 4*e) (hAclose : ∀ t ∈ Icc 0 T, ∀ i j, |A t i j-idealVelocityEntry (σ^2) i j| ≤ 3*e) (hCclose : ∀ t ∈ Icc 0 T, ∀ j, |C t 0 j-idealUnprojectedEntry 0 j| ≤ 5*e ∧ |C t 1 j-idealUnprojectedEntry 1 j| ≤ 5*e) (hrayInitial : norm3 (P 0) (Q 0) (N 0-1) ≤ e) (hZ : ∀ t, 0 ≤ t → HasDerivAt Z (Z₁ t) t) (hfluxZ : ∀ t, 0 ≤ t → HasDerivAt (fun s => (1+(σ^2*s^2)^2)*Z₁ s) (2*(1-σ^2*(σ^2*t^2))*Z t) t) (hZ0 : Z 0 = 1) (hZ₁0 : 0 ≤ Z₁ 0) : ∀ s t, 0 ≤ s → s ≤ t → t ≤ T → |U t|+|V t| ≤ 40*Θ^8*(Z t/Z s)*(|U s|+|V s|) := by have hσ2 : σ^2 ≤ 1 := by nlinarith only [hσ, hσsmall] obtain ⟨F, F₁, G, G₁, hF0, hF₁0, _, hG₁0, hF, hG, hfluxF, hfluxG⟩ := equation30_exists_fundamental_system (sq_nonneg σ) hσ2 have hΘ0 : 0 ≤ Θ := by linarith only [hΘ] have hgeom : 10000*e*Θ^5 ≤ 1 := by have hh := mul_le_mul_of_nonneg_left (pow_le_pow_right₀ hΘ (by decide : 5 ≤ 21)) he linarith only [hsmall, hh, mul_nonneg he (pow_nonneg hΘ0 21)] have hcontrol := ray_controlled_velocity_error_within (sq_nonneg σ) hσ2 hΘ hT0 hT he hε hεe hgeom hRc hP hQ hN hRclose hAclose hCclose hrayInitial have hPc : ContinuousOn P (Icc 0 T) := fun t ht => (hP t ht).continuousWithinAt have hQc : ContinuousOn Q (Icc 0 T) := fun t ht => (hQ t ht).continuousWithinAt have hNc : ContinuousOn N (Icc 0 T) := fun t ht => (hN t ht).continuousWithinAt have hUc : ContinuousOn U (Icc 0 T) := fun t ht => (hU t ht).continuousWithinAt have hVc : ContinuousOn V (Icc 0 T) := fun t ht => (hV t ht).continuousWithinAt have hNne : ∀ t ∈ Icc 0 T, N t ≠ 0 := by intro t ht linarith only [(hcontrol t ht).1.2] obtain ⟨hU₁c, hV₁c⟩ := continuousOn_velocity_rhs (ε := ε) hAc hCc hPc hQc hNc hUc hVc hNne have hs : 40*(200000*e)*Θ^21 ≤ 1 := by linarith only [hsmall] have hprop := velocity_propagator_bound_within hσ hσsmall hΘ hT0 hT (show 0 ≤ 200000*e by positivity) hs (fun t _ => hF t) (fun t _ => hG t) (fun t _ => hfluxF t) (fun t _ => hfluxG t) hF0 hF₁0 hG₁0 hU hV hU₁c hV₁c (fun t ht => (hcontrol t ht).2 (U t) (V t)) intro s t hstart hst ht have hratio := equation30_slope_ratio_dominates hσ hσsmall hZ₁0 (fun x _ => hF x) hZ (fun x _ => hfluxF x) hfluxZ hF0 hF₁0 hZ0 rfl hstart hst have hcompare := mul_le_mul_of_nonneg_right (mul_le_mul_of_nonneg_left hratio (show 0 ≤ 40*Θ^8 by positivity)) (add_nonneg (abs_nonneg (U s)) (abs_nonneg (V s))) exact (hprop s t hstart hst ht).trans hcompare end EulerPacketMovingFrame end end /-! ## From `Euler/PacketTangentNorm.lean` The text of `Euler/PacketTangentNorm.lean`, folded into this file, which was its only importer. -/ section /-! Polynomial conversion between physical tangent vectors and the two-state system. -/ noncomputable section namespace EulerPacketMovingFrame open EulerSmoothLimit EulerPacketNormalizedPrimary EulerPacketRay InnerProductSpace theorem scaled_pair_le_physical_norm (m v w : ℝ → Space) {t₀ a ε τ : ℝ} (hε : 0 < ε) (hε1 : ε ≤ 1) (hm : m (physicalTime t₀ a ε τ) ≠ 0) (hv : v (physicalTime t₀ a ε τ) ≠ 0) (hmv : ⟪m (physicalTime t₀ a ε τ),v (physicalTime t₀ a ε τ)⟫_ℝ = 0) : |scaledVelocity m v w t₀ a ε τ 0|+|scaledVelocity m v w t₀ a ε τ 1| ≤ (2/ε)*‖w (physicalTime t₀ a ε τ)‖ := by have hU := frame_coordinate_abs_le_norm (unit (m (physicalTime t₀ a ε τ))) (unit (v (physicalTime t₀ a ε τ))) (w (physicalTime t₀ a ε τ)) (unit_inner_self hm) (unit_inner_self hv) (unit_inner_zero hmv) 0 have hV := frame_coordinate_abs_le_norm (unit (m (physicalTime t₀ a ε τ))) (unit (v (physicalTime t₀ a ε τ))) (w (physicalTime t₀ a ε τ)) (unit_inner_self hm) (unit_inner_self hv) (unit_inner_zero hmv) 1 change |movingVelocity m v w (physicalTime t₀ a ε τ) 0| ≤ _ at hU change |movingVelocity m v w (physicalTime t₀ a ε τ) 1| ≤ _ at hV rw [← scaledVelocity_restore m v w (ne_of_gt hε) 0] at hU rw [← scaledVelocity_restore m v w (ne_of_gt hε) 1] at hV norm_num [velocityScale, Fin.ext_iff, abs_mul, abs_of_pos hε] at hU hV have hεV := mul_le_mul_of_nonneg_left hV hε.le have hεnorm := mul_le_mul_of_nonneg_right hε1 (norm_nonneg (w (physicalTime t₀ a ε τ))) have hh : |scaledVelocity m v w t₀ a ε τ 0|+|scaledVelocity m v w t₀ a ε τ 1| ≤ (2*‖w (physicalTime t₀ a ε τ)‖)/ε := by apply (le_div_iff₀ hε).mpr linarith only [hU, hεV, hεnorm] convert! hh using 1 ring theorem physical_velocity_le_scaled_state (m v r w : ℝ → Space) {s₀ t₀ a ε τ Θ ρ P₀ Q₀ : ℝ} (hs₀ : s₀ ≠ 0) (hε : 0 < ε) (hε1 : ε ≤ 1) (hm : m (physicalTime t₀ a ε τ) ≠ 0) (hv : v (physicalTime t₀ a ε τ) ≠ 0) (hmv : ⟪m (physicalTime t₀ a ε τ),v (physicalTime t₀ a ε τ)⟫_ℝ = 0) (hrw : ⟪r (physicalTime t₀ a ε τ),w (physicalTime t₀ a ε τ)⟫_ℝ = 0) (hΘ : 1 ≤ Θ) (hρ0 : 0 ≤ ρ) (hρ : ρ ≤ 1/2) (hP₀ : |P₀| ≤ Θ^2) (hQ₀ : |Q₀| ≤ 2*Θ^2) (hP : |scaledRay m v r s₀ t₀ a ε τ 0-P₀| ≤ ρ) (hQ : |scaledRay m v r s₀ t₀ a ε τ 1-Q₀| ≤ ρ) (hN : |scaledRay m v r s₀ t₀ a ε τ 2-1| ≤ ρ) : ‖w (physicalTime t₀ a ε τ)‖ ≤ 7*Θ^2*(|scaledVelocity m v w t₀ a ε τ 0|+|scaledVelocity m v w t₀ a ε τ 1|) := by let R := scaledRay m v r s₀ t₀ a ε τ let V := scaledVelocity m v w t₀ a ε τ have hpair := scaled_pairing_zero m v r w hs₀ (ne_of_gt hε) hm hv hmv hrw obtain ⟨hn, _, _, _, hw, _, _⟩ := ray_geometric_bounds (ε := ε) (U := V 0) (V := V 1) hΘ hρ0 hρ hP₀ hQ₀ hP hQ hN have hNne : R 2 ≠ 0 := by linarith only [hn] have hthird := thirdVelocity_of_pairing R V hNne hpair rw [← hthird] at hw have hΘ2 : 1 ≤ Θ^2 := one_le_pow₀ hΘ have hV : norm3 (V 0) (V 1) (V 2) ≤ 7*Θ^2*(|V 0|+|V 1|) := by dsimp [norm3] have ht := mul_le_mul_of_nonneg_right hΘ2 (add_nonneg (abs_nonneg (V 0)) (abs_nonneg (V 1))) linarith only [hw, ht] exact (scaledVelocity_norm_le_norm3 m v w hε hε1 hm hv hmv).trans hV end EulerPacketMovingFrame end end noncomputable section namespace EulerPacketMovingFrame open Set EulerSmoothLimit EulerPacketNormalizedPrimary EulerPacketRay EulerPacketStage EulerPacketPerturbation InnerProductSpace ContinuousLinearMap theorem physical_tangent_propagator {B B₁ M E : ℝ → Space →L[ℝ] Space} {m v r w : ℝ → Space} {c s₀ t₀ a ε σ Θ T G d : ℝ} {S : Set ℝ} (hσ : 0 < σ) (hσsmall : σ ≤ 1/4) (hT0 : 0 < T) (hT : T ≤ Θ) (ha : 1/2 ≤ a) (hε : 0 < ε) (hΘ : 1 ≤ Θ) (hG : 1 ≤ G) (hd : 0 ≤ d) (hs₀ : s₀ ≠ 0) (hsmall : 8000000*(16*(ε*Θ*(4*G)^2+d))*Θ^21 ≤ 1) (hmap : MapsTo (physicalTime t₀ a ε) (Icc 0 Θ) S) (hMc : ContinuousOn M S) (hBd : ∀ t ∈ S, HasDerivWithinAt B (B₁ t) S t) (hmd : ∀ t ∈ S, HasDerivWithinAt m (-(B t).adjoint (m t)) S t) (hvd : ∀ t ∈ S, HasDerivWithinAt v (-(B t) (v t)+ (2*⟪m t,(B t) (v t)⟫_ℝ/‖m t‖^2) • m t) S t) (hrd : ∀ t ∈ S, HasDerivWithinAt r (-(M t).adjoint (r t)) S t) (hwd : ∀ t ∈ S, HasDerivWithinAt w (-(M t) (w t)+ (2*⟪r t,(M t) (w t)⟫_ℝ/‖r t‖^2) • r t) S t) (hm0 : ∀ t ∈ S, m t ≠ 0) (hv0 : ∀ t ∈ S, v t ≠ 0) (hmv : ∀ t ∈ S, ⟪m t,v t⟫_ℝ = 0) (hrw0 : ⟪r t₀,w t₀⟫_ℝ = 0) (hB : ∀ t ∈ S, ‖B t‖ ≤ G) (hB₁ : ∀ t ∈ S, ‖B₁ t‖ ≤ G^2) (hE : ∀ t ∈ S, ‖E t‖ ≤ d) (hparent : ∀ t ∈ S, M t = B t+ primaryShear c m v t • rankOne ℝ (unit (v t)) (unit (m t))+E t) (hb0 : rescaledFrame B m v t₀ a ε 0 0 1 = a) (hk0 : rescaledFrame B m v t₀ a ε 0 2 1 = a*σ^2) (hh0 : rescaledShear c m v t₀ a ε 0 = a/ε^2) (hrInitial : norm3 (scaledRay m v r s₀ t₀ a ε 0 0) (scaledRay m v r s₀ t₀ a ε 0 1) (scaledRay m v r s₀ t₀ a ε 0 2-1) ≤ 16*(ε*Θ*(4*G)^2+d)) {Z Z₁ : ℝ → ℝ} (hZ : ∀ t, 0 ≤ t → HasDerivAt Z (Z₁ t) t) (hfluxZ : ∀ t, 0 ≤ t → HasDerivAt (fun s => (1+(σ^2*s^2)^2)*Z₁ s) (2*(1-σ^2*(σ^2*t^2))*Z t) t) (hZ0 : Z 0 = 1) (hZ₁0 : 0 ≤ Z₁ 0) : ContinuousOn Z (Icc 0 T) ∧ (∀ t ∈ Icc 0 T, 0 < Z t) ∧ ∀ s t, 0 ≤ s → s ≤ t → t ≤ T → ‖w (physicalTime t₀ a ε t)‖ ≤ (560*Θ^10/ε)*(Z t/Z s)*‖w (physicalTime t₀ a ε s)‖ := by let e := 16*(ε*Θ*(4*G)^2+d) let Rp := scaledRay m v r s₀ t₀ a ε let Vp := scaledVelocity m v w t₀ a ε let Mf := rescaledFrame M m v t₀ a ε let Bf := rescaledFrame B m v t₀ a ε let Rmat : ℝ → Fin 3 → Fin 3 → ℝ := fun τ => scaledRayEntry a ε (Mf τ) (frameSkew (Bf τ)) let Amat : ℝ → Fin 3 → Fin 3 → ℝ := fun τ => scaledVelocityEntry a ε (Mf τ) let Cmat : ℝ → Fin 3 → Fin 3 → ℝ := fun τ => scaledVelocityEntry a ε (fun i j => Mf τ i j+frameSkew (Bf τ) i j) have he : 0 ≤ e := by dsimp [e]; positivity have hΘ0 : 0 ≤ Θ := by linarith change 8000000*e*Θ^21 ≤ 1 at hsmall have heΘ : e ≤ e*Θ^21 := by simpa only [mul_one] using mul_le_mul_of_nonneg_left (one_le_pow₀ hΘ : 1 ≤ Θ^21) he have heSmall : e ≤ 1 := by linarith only [hsmall, heΘ, he] have hpow : e*Θ^5 ≤ e*Θ^21 := mul_le_mul_of_nonneg_left (pow_le_pow_right₀ hΘ (by decide : 5 ≤ 21)) he have hsmallRay : 400*(4*e)*Θ^5 ≤ 1 := by linarith only [hsmall, hpow, mul_nonneg he (pow_nonneg hΘ0 5)] have ha0 : 0 < a := by linarith have hσsq : σ^2 ≤ 1 := by nlinarith only [hσ, hσsmall] have herr := physical_matrix_errors ha hε hΘ hG hd heSmall hmap hBd hmd hvd hm0 hv0 hmv hB hB₁ hE hparent hb0 hk0 hh0 have hsub : Icc (0:ℝ) T ⊆ Icc 0 Θ := fun _ ht => ⟨ht.1, ht.2.trans hT⟩ have hmapT : MapsTo (physicalTime t₀ a ε) (Icc 0 T) S := fun _ ht => hmap (hsub ht) have hMf : ∀ i j, ContinuousOn (fun τ => Mf τ i j) (Icc 0 T) := rescaledFrame_continuousOn B M hmapT hMc hmd hvd hm0 hv0 hmv have hBf : ∀ i j, ContinuousOn (fun τ => Bf τ i j) (Icc 0 T) := rescaledFrame_continuousOn B B hmapT (fun t ht => (hBd t ht).continuousWithinAt) hmd hvd hm0 hv0 hmv have hSf := frameSkew_continuousOn hBf have hRmc : ∀ i j, ContinuousOn (fun τ => Rmat τ i j) (Icc 0 T) := scaledRayEntry_continuousOn a ε hMf hSf have hAmc : ∀ i j, ContinuousOn (fun τ => Amat τ i j) (Icc 0 T) := scaledVelocityEntry_continuousOn a ε hMf have hCmc : ∀ i j, ContinuousOn (fun τ => Cmat τ i j) (Icc 0 T) := scaledVelocityEntry_continuousOn a ε (fun i j => (hMf i j).add (hSf i j)) have hRode : ∀ i τ, τ ∈ Icc 0 T → HasDerivWithinAt (fun s => Rp s i) (∑ j : Fin 3, Rmat τ i j*Rp τ j) (Icc 0 T) τ := by intro i τ hτ have ht := hmapT hτ exact scaledRay_hasDerivWithinAt (B (physicalTime t₀ a ε τ)) (M (physicalTime t₀ a ε τ)) (ne_of_gt ha0) (ne_of_gt hε) hs₀ hmapT (hmd _ ht) (hvd _ ht) (hrd _ ht) (hm0 _ ht) (hv0 _ ht) (hmv _ ht) i have hP : ∀ τ ∈ Icc 0 T, HasDerivWithinAt (fun s => Rp s 0) (Rmat τ 0 0*Rp τ 0+Rmat τ 0 1*Rp τ 1+Rmat τ 0 2*Rp τ 2) (Icc 0 T) τ := by intro τ hτ simpa only [Fin.sum_univ_three] using hRode 0 τ hτ have hQ : ∀ τ ∈ Icc 0 T, HasDerivWithinAt (fun s => Rp s 1) (Rmat τ 1 0*Rp τ 0+Rmat τ 1 1*Rp τ 1+Rmat τ 1 2*Rp τ 2) (Icc 0 T) τ := by intro τ hτ simpa only [Fin.sum_univ_three] using hRode 1 τ hτ have hN : ∀ τ ∈ Icc 0 T, HasDerivWithinAt (fun s => Rp s 2) (Rmat τ 2 0*Rp τ 0+Rmat τ 2 1*Rp τ 1+Rmat τ 2 2*Rp τ 2) (Icc 0 T) τ := by intro τ hτ simpa only [Fin.sum_univ_three] using hRode 2 τ hτ have hRclose : ∀ τ ∈ Icc 0 T, ∀ i j, |Rmat τ i j-idealRayEntry (σ^2) i j| ≤ 4*e := fun τ hτ => (herr.2 τ (hsub hτ)).1 have hnear := ray_closeness_within (sq_nonneg σ) hσsq hΘ hT0 hT (mul_nonneg (by norm_num : (0:ℝ) ≤ 4) he) hsmallRay hRmc hP hQ hN hRclose (hrInitial.trans (show e ≤ 4*e by linarith)) have hrnonzero : ∀ τ ∈ Icc 0 T, r (physicalTime t₀ a ε τ) ≠ 0 := by intro τ hτ hzero have hNne : Rp τ 2 ≠ 0 := by linarith only [(hnear τ hτ).2] apply hNne simp only [Rp, scaledRay, movingRay, hzero, inner_zero_right, zero_div] have hpair := rescaled_tangentPairing_zero M hmapT hrd hwd hrnonzero hrw0 have hUV : ∀ τ ∈ Icc 0 T, HasDerivWithinAt (fun s => Vp s 0) (velocityFirstRhs (Amat τ) (Cmat τ) ε (Rp τ 0) (Rp τ 1) (Rp τ 2) (Vp τ 0) (Vp τ 1)) (Icc 0 T) τ ∧ HasDerivWithinAt (fun s => Vp s 1) (velocitySecondRhs (Amat τ) (Cmat τ) ε (Rp τ 0) (Rp τ 1) (Rp τ 2) (Vp τ 0) (Vp τ 1)) (Icc 0 T) τ := by intro τ hτ have ht := hmapT hτ have hNne : Rp τ 2 ≠ 0 := by linarith only [(hnear τ hτ).2] exact scaledVelocity_firstTwo_hasDerivWithinAt (B (physicalTime t₀ a ε τ)) (M (physicalTime t₀ a ε τ)) (ne_of_gt ha0) (ne_of_gt hε) hs₀ hmapT (hmd _ ht) (hvd _ ht) (hwd _ ht) (hm0 _ ht) (hv0 _ ht) (hmv _ ht) (hrnonzero τ hτ) (hpair τ hτ) hNne have hprop := controlled_velocity_propagator_within hσ hσsmall hΘ hT0 hT he hε.le herr.1 hsmall hRmc hAmc hCmc hP hQ hN (fun τ hτ => (hUV τ hτ).1) (fun τ hτ => (hUV τ hτ).2) hRclose (fun τ hτ => (herr.2 τ (hsub hτ)).2.1) (fun τ hτ => (herr.2 τ (hsub hτ)).2.2) hrInitial hZ hfluxZ hZ0 hZ₁0 have hZpos := EulerPacketGrowth.equation30_global_positive hσ hσsmall hZ hfluxZ hZ0 hZ₁0 refine ⟨(fun τ hτ => (hZ τ hτ.1).continuousAt.continuousWithinAt), (fun τ hτ => hZpos τ hτ.1), ?_⟩ intro s t hs hst ht have hsT : s ∈ Icc 0 T := ⟨hs, hst.trans ht⟩ have htT : t ∈ Icc 0 T := ⟨hs.trans hst, ht⟩ have htimeS := hmapT hsT have htimeT := hmapT htT have hε1 : ε ≤ 1 := herr.1.trans heSmall have hρ0 : 0 ≤ 800*e*Θ^5 := by positivity have hρ : 800*e*Θ^5 ≤ 1/2 := by linarith only [hsmall, hpow, mul_nonneg he (pow_nonneg hΘ0 5)] have hrt : norm3 (Rp t 0-σ^2*t^2) (Rp t 1+2*σ^2*t) (Rp t 2-1) ≤ 800*e*Θ^5 := by linarith only [(hnear t htT).1] have hPt : |Rp t 0-σ^2*t^2| ≤ 800*e*Θ^5 := by dsimp [norm3] at hrt linarith only [hrt, abs_nonneg (Rp t 1+2*σ^2*t), abs_nonneg (Rp t 2-1)] have hQt : |Rp t 1-(-2*σ^2*t)| ≤ 800*e*Θ^5 := by rw [show Rp t 1-(-2*σ^2*t) = Rp t 1+2*σ^2*t by ring] dsimp [norm3] at hrt linarith only [hrt, abs_nonneg (Rp t 0-σ^2*t^2), abs_nonneg (Rp t 2-1)] have hNt : |Rp t 2-1| ≤ 800*e*Θ^5 := by dsimp [norm3] at hrt linarith only [hrt, abs_nonneg (Rp t 0-σ^2*t^2), abs_nonneg (Rp t 1+2*σ^2*t)] have htΘ : t ≤ Θ := ht.trans hT have ht2 : t^2 ≤ Θ^2 := (sq_le_sq₀ htT.1 hΘ0).mpr htΘ have hP₀ : |σ^2*t^2| ≤ Θ^2 := by rw [abs_of_nonneg (by positivity : 0 ≤ σ^2*t^2)] linarith only [mul_le_mul_of_nonneg_right hσsq (sq_nonneg t), ht2] have hQ₀ : |-2*σ^2*t| ≤ 2*Θ^2 := by rw [abs_mul, abs_mul, abs_of_nonneg (sq_nonneg σ), abs_of_nonneg htT.1] norm_num only [abs_neg, abs_of_nonneg (by norm_num : (0:ℝ) ≤ 2)] linarith only [mul_le_mul_of_nonneg_right hσsq htT.1, htΘ, hΘ, sq_nonneg (Θ-1)] have hfinish := physical_velocity_le_scaled_state m v r w hs₀ hε hε1 (hm0 _ htimeT) (hv0 _ htimeT) (hmv _ htimeT) (hpair t htT) hΘ hρ0 hρ hP₀ hQ₀ hPt hQt hNt have hstart := scaled_pair_le_physical_norm m v w hε hε1 (hm0 _ htimeS) (hv0 _ htimeS) (hmv _ htimeS) have hratio : 0 ≤ Z t/Z s := div_nonneg (hZpos t htT.1).le (hZpos s hs).le have h1 := mul_le_mul_of_nonneg_left (hprop s t hs hst ht) (show 0 ≤ 7*Θ^2 by positivity) have h2 := mul_le_mul_of_nonneg_left hstart (show 0 ≤ 280*Θ^10*(Z t/Z s) by positivity) calc _ ≤ 7*Θ^2*(|Vp t 0|+|Vp t 1|) := hfinish _ ≤ 7*Θ^2*(40*Θ^8*(Z t/Z s)*(|Vp s 0|+|Vp s 1|)) := h1 _ = 280*Θ^10*(Z t/Z s)*(|Vp s 0|+|Vp s 1|) := by ring _ ≤ 280*Θ^10*(Z t/Z s)*((2/ε)*‖w (physicalTime t₀ a ε s)‖) := h2 _ = _ := by ring end EulerPacketMovingFrame