File size: 2,784 Bytes
4a56cd6 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 | import Mathlib
namespace OAI
noncomputable section
open Filter Asymptotics
namespace BinaryCoordinateSweeps.Sparse
lemma nat_pow_le_exp_of_le {x A : β} (hx : 0β€x) (h : xβ€Real.exp A) (n : β) :
x^nβ€Real.exp ((n:β)*A) := by
simpa only [βReal.exp_nat_mul] using pow_le_pow_leftβ hx h n
lemma log_le_small_rpow_eventually {Ξ΅ : β} (hΞ΅ : 0<Ξ΅) : βαΆ s : β in atTop,
Real.log (s:β)β€(s:β)^Ξ΅ := by
have hh := (isLittleO_log_rpow_rpow_atTop (1:β) hΞ΅).bound (by norm_num : (0:β)<1)
have hc : Tendsto (fun s : β => (s:β)) atTop atTop := tendsto_natCast_atTop_atTop
filter_upwards [hc.eventually hh,eventually_ge_atTop (1:β)] with s hs hs1
have hl : 0β€Real.log (s:β) := Real.log_nonneg (by exact_mod_cast hs1)
simpa only [Real.rpow_one,Real.norm_of_nonneg hl,
Real.norm_of_nonneg (Real.rpow_nonneg (Nat.cast_nonneg s) Ξ΅),one_mul] using hs
lemma many_hs_scalar (b h k : β) {L x : β} (hb : 1β€b)
(hh : (h:β)β€100000*k) (hL : 4000000000*(b:β)β€L)
(hx0 : 0β€x) (hx : xβ€Real.exp (-L/4000)) :
((2:β)^k*Real.exp ((b:β)*(h+k)+Real.log 4*k*b))^2 *
((2:β)^k*x^((k+1)/2)) β€ Real.exp (-(k:β)*L/16000) := by
have hL0 : 0β€L := (by positivity : (0:β)β€4000000000*b).trans hL
have hbk : (1:β)β€b := by exact_mod_cast hb
have hkt : (k:β)β€2*(((k+1)/2:β):β) := by exact_mod_cast (show kβ€2*((k+1)/2) from by omega)
have hal : x^((k+1)/2)β€Real.exp (-(k:β)*L/8000) := by
apply (nat_pow_le_exp_of_le hx0 hx _).trans
apply Real.exp_le_exp.mpr
nlinarith [mul_le_mul_of_nonneg_right hkt hL0]
have hlog2 : Real.log 2β€2 := (Real.log_le_sub_one_of_pos (by norm_num : (0:β)<2)).trans (by norm_num)
have hlog4 : Real.log 4β€4 := (Real.log_le_sub_one_of_pos (by norm_num : (0:β)<4)).trans (by norm_num)
have hp (n : β) : (2:β)^n=Real.exp ((n:β)*Real.log 2) := by
rw [Real.exp_nat_mul,Real.exp_log (by norm_num)]
calc
_ β€ ((2:β)^k*Real.exp ((b:β)*(h+k)+Real.log 4*k*b))^2 *
((2:β)^k*Real.exp (-(k:β)*L/8000)) := by gcongr
_ = Real.exp (3*(k:β)*Real.log 2+2*((b:β)*(h+k)+Real.log 4*k*b)-(k:β)*L/8000) := by
simp only [hp,βReal.exp_add,βReal.exp_nat_mul]
congr 1
ring
_ β€ _ := by
apply Real.exp_le_exp.mpr
have hh' := mul_le_mul_of_nonneg_left hh (show (0:β)β€b by positivity)
have h2 := mul_le_mul_of_nonneg_left hlog2 (show (0:β)β€k by positivity)
have h4 := mul_le_mul_of_nonneg_right hlog4 (show (0:β)β€k*b by positivity)
have hkb := mul_le_mul_of_nonneg_left hbk (show (0:β)β€k by positivity)
have hLc := mul_le_mul_of_nonneg_right hL (show (0:β)β€k by positivity)
nlinarith
end BinaryCoordinateSweeps.Sparse
end
end OAI
|