cfahlgren1's picture
download
raw
5.01 kB
import Mathlib
namespace OAI
open Asymptotics Filter
open scoped Topology
namespace CylinderCovering.RationalPadding
theorem rpow_littleO_at_zero {p q : ℝ} (hpq : p < q) :
(fun x : ℝ => x ^ q) =o[𝓝[>] 0] (fun x => x ^ p) := by
apply (isLittleO_iff_tendsto' ?_).2
Β· have hlim : Tendsto (fun x : ℝ => x ^ (q - p)) (𝓝 0) (𝓝 ((0 : ℝ) ^ (q - p))) :=
(Real.continuous_rpow_const (sub_nonneg.mpr hpq.le)).continuousAt.tendsto
have hzero : (0 : ℝ) ^ (q - p) = 0 := Real.zero_rpow (sub_pos.mpr hpq).ne'
rw [hzero] at hlim
apply (hlim.mono_left nhdsWithin_le_nhds).congr'
filter_upwards [self_mem_nhdsWithin] with x hx
exact Real.rpow_sub hx q p
Β· filter_upwards [self_mem_nhdsWithin] with x hx
exact fun h => False.elim ((Real.rpow_pos_of_pos hx p).ne' h)
theorem vanishing_padding_rates :
(fun x : ℝ => x ^ (5 / 2 : ℝ)) =o[𝓝[>] 0] (fun x => x ^ (2 : β„•)) ∧
(fun x : ℝ => x ^ (3 : β„•)) =o[𝓝[>] 0] (fun x => x ^ (5 / 2 : ℝ)) := by
constructor
Β· simpa only [Real.rpow_two] using rpow_littleO_at_zero (p := 2) (q := 5 / 2) (by norm_num)
Β· simpa only [show (3 : ℝ) = (3 : β„•) by norm_num, Real.rpow_natCast] using
rpow_littleO_at_zero (p := 5 / 2) (q := 3) (by norm_num)
theorem eventually_cost_lt_of_littleO {C : ℝ β†’ ℝ} {A Ξ” : ℝ} (hΞ” : 0 < Ξ”)
(hrem : (fun x => C x - (A - Ξ” * x ^ 2)) =o[𝓝[>] 0] (fun x => x ^ (2 : β„•))) :
βˆ€αΆ  x : ℝ in 𝓝[>] 0, C x < A := by
filter_upwards [self_mem_nhdsWithin, hrem.bound (show 0 < Ξ” / 2 by positivity)] with x hx hr
rw [Real.norm_eq_abs, Real.norm_eq_abs, abs_of_nonneg (sq_nonneg x)] at hr
have hb := (abs_le.mp hr).2
have hp : 0 < Ξ” * x ^ 2 := mul_pos hΞ” (sq_pos_of_pos hx)
nlinarith
theorem eventually_cost_lt_of_fourth_order {C : ℝ β†’ ℝ} {A Ξ” : ℝ} (hΞ” : 0 < Ξ”)
(hrem : (fun x => C x - (A - Ξ” * x ^ 2)) =O[𝓝[>] 0] (fun x => x ^ (4 : β„•))) :
βˆ€αΆ  x : ℝ in 𝓝[>] 0, C x < A := by
apply eventually_cost_lt_of_littleO hΞ”
exact hrem.trans_isLittleO ((isLittleO_pow_pow (π•œ := ℝ) (show 2 < 4 by norm_num)).mono nhdsWithin_le_nhds)
theorem eventually_cost_lt_vanishing_padding {C q : ℝ β†’ ℝ} {A Ξ” : ℝ}
(hΞ” : 0 < Ξ”) (hq : q =o[𝓝[>] 0] (fun x => x ^ (2 : β„•)))
(hrem : (fun x => C x - (A - Ξ” * x ^ 2 + q x / 2)) =O[𝓝[>] 0]
(fun x => x ^ (4 : β„•))) :
βˆ€αΆ  x : ℝ in 𝓝[>] 0, C x < A := by
apply eventually_cost_lt_of_littleO hΞ”
have hr := hrem.trans_isLittleO
((isLittleO_pow_pow (π•œ := ℝ) (show 2 < 4 by norm_num)).mono nhdsWithin_le_nhds)
have hsum := hr.add (hq.const_mul_left (1 / 2 : ℝ))
have heq : (fun x => C x - (A - Ξ” * x ^ 2 + q x / 2) + (1 / 2 : ℝ) * q x) =
(fun x => C x - (A - Ξ” * x ^ 2)) := by funext x; ring
rw [heq] at hsum
exact hsum
theorem quadratic_padding_rates {Ξ· : ℝ} (hΞ· : 0 < Ξ·) :
(fun x : ℝ => Ξ· * x ^ (2 : β„•)) =O[𝓝[>] 0] (fun x => x ^ (2 : β„•)) ∧
(fun x : ℝ => x ^ (3 : β„•)) =o[𝓝[>] 0] (fun x => Ξ· * x ^ (2 : β„•)) := by
refine ⟨(isBigO_refl (fun x : ℝ => x ^ (2 : β„•)) _).const_mul_left Ξ·, ?_⟩
exact Asymptotics.IsLittleO.const_mul_right hΞ·.ne'
((isLittleO_pow_pow (π•œ := ℝ) (show 2 < 3 by norm_num)).mono nhdsWithin_le_nhds)
theorem eventually_cost_lt_quadratic_padding {C : ℝ β†’ ℝ} {A Ξ” Ξ· : ℝ}
(hgap : Ξ· / 2 < Ξ”)
(hrem : (fun x => C x - (A - Ξ” * x ^ 2 + Ξ· * x ^ 2 / 2)) =O[𝓝[>] 0]
(fun x => x ^ (4 : β„•))) :
βˆ€αΆ  x : ℝ in 𝓝[>] 0, C x < A := by
apply eventually_cost_lt_of_fourth_order (sub_pos.mpr hgap)
exact hrem.congr_left (fun x => by ring)
theorem eventually_cost_lt_five_halves {C : ℝ β†’ ℝ} {A Ξ” : ℝ}
(hgap : 0 < Ξ”)
(hrem : (fun x => C x - (A - Ξ” * x ^ 2 + x ^ (5 / 2 : ℝ) / 2)) =O[𝓝[>] 0]
(fun x => x ^ (4 : β„•))) :
βˆ€αΆ  x : ℝ in 𝓝[>] 0, C x < A :=
eventually_cost_lt_vanishing_padding hgap vanishing_padding_rates.1 hrem
theorem exists_eventual_quadratic_control {q : ℝ β†’ ℝ}
(hq0 : βˆ€αΆ  x : ℝ in 𝓝[>] 0, 0 ≀ q x)
(hq : q =O[𝓝[>] 0] (fun x => x ^ (2 : β„•))) :
βˆƒ Q : ℝ, 0 < Q ∧ βˆ€αΆ  x : ℝ in 𝓝[>] 0,
0 ≀ q x ∧ q x ≀ Q * x ^ 2 ∧ x ^ 2 ≀ 1 ∧ x ^ 2 + q x ≀ 1 / 4 := by
obtain ⟨Q, hQ, hb⟩ := hq.exists_pos
refine ⟨Q, hQ, ?_⟩
have ht : Tendsto (fun x : ℝ => x ^ (2 : β„•)) (𝓝[>] 0) (𝓝 0) := by
simpa using ((continuous_pow 2).tendsto (0 : ℝ)).mono_left nhdsWithin_le_nhds
have hΞ΄ : Tendsto (fun x : ℝ => (1 + Q) * x ^ 2) (𝓝[>] 0) (𝓝 0) := by
simpa using ht.const_mul (1 + Q)
filter_upwards [hq0, hb.bound, ht.eventually (gt_mem_nhds (show (0 : ℝ) < 1 by norm_num)),
hΞ΄.eventually (gt_mem_nhds (show (0 : ℝ) < 1 / 4 by norm_num))] with x hx0 hxb hx1 hxΞ΄
simp only [Real.norm_eq_abs, abs_of_nonneg hx0, abs_of_nonneg (sq_nonneg x)] at hxb
exact ⟨hx0, hxb, hx1.le, by nlinarith⟩
end CylinderCovering.RationalPadding
end OAI

Xet Storage Details

Size:
5.01 kB
Β·
Xet hash:
0adffd0112291303a4c619734f72fc327944a09d4d5165e3e583528b7f1b22bf

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.