File size: 7,584 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 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 | import Mathlib.Analysis.SpecialFunctions.Pow.Asymptotics
import Mathlib.Analysis.SpecificLimits.Normed
import Mathlib.Tactic
namespace OAI
open Filter
open scoped Topology BigOperators
namespace Balanced.LocalAsymptotics
theorem summable_polynomial_mul_pow_div_factorial (a : β) (C : β) (hC : 0 β€ C) :
Summable (fun b : β => (b : β) ^ a * C ^ b / (b.factorial : β)) := by
apply (Real.summable_pow_div_factorial (2 * C)).of_norm_bounded_eventually_nat
have h := (tendsto_pow_const_div_const_pow_of_one_lt a (by norm_num : (1 : β) < 2)).eventually
(gt_mem_nhds (by norm_num : (0 : β) < 1))
filter_upwards [h] with b hb
have hb' : (b : β) ^ a β€ (2 : β) ^ b := by
exact le_of_lt ((div_lt_one (by positivity : (0 : β) < 2 ^ b)).mp hb)
rw [Real.norm_of_nonneg (by positivity), mul_pow]
exact div_le_div_of_nonneg_right (mul_le_mul_of_nonneg_right hb' (pow_nonneg hC b))
(by positivity)
theorem tendsto_log_pow_div (a : β) :
Tendsto (fun x : β => (Real.log x) ^ a / x) atTop (π 0) := by
have h := isLittleO_log_rpow_rpow_atTop (a : β) (by norm_num : (0 : β) < 1)
simpa only [Real.rpow_natCast, Real.rpow_one] using h.tendsto_div_nhds_zero
theorem tendsto_ceil_log_pow_div (a : β) :
Tendsto (fun x : β => (βReal.log xββ : β) ^ a / x) atTop (π 0) := by
have hlog : βαΆ x : β in atTop, 1 β€ Real.log x :=
Real.tendsto_log_atTop.eventually_ge_atTop 1
have hx : βαΆ x : β in atTop, 0 β€ x := eventually_ge_atTop 0
apply squeeze_zero' (hx.mono fun x hx => by positivity)
(g := fun x : β => (2 : β) ^ a * ((Real.log x) ^ a / x))
Β· filter_upwards [hlog, hx] with x hlog hx
have hceil : (βReal.log xββ : β) β€ 2 * Real.log x := by
have h := Nat.ceil_lt_add_one (le_trans (by norm_num : (0 : β) β€ 1) hlog)
linarith
calc
(βReal.log xββ : β) ^ a / x β€ (2 * Real.log x) ^ a / x := by gcongr
_ = (2 : β) ^ a * ((Real.log x) ^ a / x) := by rw [mul_pow]; ring
Β· simpa using (tendsto_log_pow_div a).const_mul ((2 : β) ^ a)
theorem tendsto_ceil_log_cube_div_nat :
Tendsto (fun q : β => (βReal.log (q : β)ββ : β) ^ 3 / (q : β))
atTop (π 0) :=
(tendsto_ceil_log_pow_div 3).comp tendsto_natCast_atTop_atTop
theorem large_pencil_tail_le_inv (C x : β) (hC : 0 β€ C) (hx : 0 < x)
(hlog : 1 β€ Real.log x)
(hlarge : C * Real.exp 3 β€ (βReal.log xββ : β)) :
x ^ 2 * (C / (βReal.log xββ : β)) ^ βReal.log xββ β€ xβ»ΒΉ := by
have hceil := Nat.le_ceil (Real.log x)
have hB : (0 : β) < (βReal.log xββ : β) := by linarith
have hratio : C / (βReal.log xββ : β) β€ Real.exp (-3) := by
apply (div_le_iffβ hB).2
calc
C = (C * Real.exp 3) * Real.exp (-3) := by
rw [mul_assoc, β Real.exp_add]
norm_num
_ β€ (βReal.log xββ : β) * Real.exp (-3) :=
mul_le_mul_of_nonneg_right hlarge (Real.exp_pos _).le
_ = Real.exp (-3) * (βReal.log xββ : β) := mul_comm _ _
have hexp : Real.exp (-3 * Real.log x) = (x ^ 3)β»ΒΉ := by
rw [show -3 * Real.log x = -(3 * Real.log x) by ring, Real.exp_neg]
congr 1
simpa [Real.exp_log hx] using Real.exp_nat_mul (Real.log x) 3
calc
x ^ 2 * (C / (βReal.log xββ : β)) ^ βReal.log xββ
β€ x ^ 2 * Real.exp (-3) ^ βReal.log xββ := by gcongr
_ = x ^ 2 * Real.exp (-3 * (βReal.log xββ : β)) := by
rw [mul_comm (-3), Real.exp_nat_mul]
_ β€ x ^ 2 * Real.exp (-3 * Real.log x) := by
apply mul_le_mul_of_nonneg_left _ (sq_nonneg x)
apply Real.exp_le_exp.mpr
linarith
_ = xβ»ΒΉ := by rw [hexp]; field_simp
theorem tendsto_large_pencil_tail (C : β) (hC : 0 β€ C) :
Tendsto (fun x : β => x ^ 2 *
(C / (βReal.log xββ : β)) ^ βReal.log xββ) atTop (π 0) := by
apply squeeze_zero' (Eventually.of_forall fun x => by positivity)
(g := fun x : β => xβ»ΒΉ)
Β· filter_upwards [eventually_gt_atTop (0 : β),
Real.tendsto_log_atTop.eventually_ge_atTop 1,
Real.tendsto_log_atTop.eventually_ge_atTop (C * Real.exp 3)] with x hx hlog hlarge
exact large_pencil_tail_le_inv C x hC hx hlog
(hlarge.trans (Nat.le_ceil (Real.log x)))
Β· exact tendsto_inv_atTop_zero
theorem tendsto_large_pencil_tail_nat (C : β) (hC : 0 β€ C) :
Tendsto (fun q : β => (q : β) ^ 2 *
(C / (βReal.log (q : β)ββ : β)) ^ βReal.log (q : β)ββ)
atTop (π 0) :=
(tendsto_large_pencil_tail C hC).comp tendsto_natCast_atTop_atTop
theorem sum_polynomial_mul_pow_div_factorial_le (a : β) (C : β) (hC : 0 β€ C)
(s : Finset β) :
(β b β s, (b : β) ^ a * C ^ b / (b.factorial : β)) β€
β' b : β, (b : β) ^ a * C ^ b / (b.factorial : β) := by
exact (summable_polynomial_mul_pow_div_factorial a C hC).sum_le_tsum s
(fun b _ => by positivity)
theorem tendsto_weighted_log_bound (a : β) (C : β) (hC : 0 β€ C)
(s : β β Finset β) :
Tendsto (fun q : β =>
(β b β s q, (b : β) ^ a * C ^ b / (b.factorial : β)) *
((βReal.log (q : β)ββ : β) ^ 3 / (q : β))) atTop (π 0) := by
apply squeeze_zero (fun q => by positivity)
(g := fun q : β => (β' b : β, (b : β) ^ a * C ^ b / (b.factorial : β)) *
((βReal.log (q : β)ββ : β) ^ 3 / (q : β)))
Β· intro q
apply mul_le_mul_of_nonneg_right
(sum_polynomial_mul_pow_div_factorial_le a C hC (s q))
positivity
Β· simpa using tendsto_ceil_log_cube_div_nat.const_mul
(β' b : β, (b : β) ^ a * C ^ b / (b.factorial : β))
theorem tendsto_plane_weighted_pencil_sum (a : β) (C : β) (hC : 0 β€ C)
(s : β β Finset β) :
Tendsto (fun q : β => (q : β) ^ 2 *
β b β s q, ((b : β) ^ a * C ^ b / (b.factorial : β)) *
((βReal.log (q : β)ββ : β) ^ 3 / (q : β) ^ 3)) atTop (π 0) := by
apply (tendsto_weighted_log_bound a C hC s).congr'
filter_upwards [eventually_gt_atTop (0 : β)] with q hq
have hq' : (q : β) β 0 := by exact_mod_cast (Nat.ne_of_gt hq)
rw [β Finset.sum_mul]
field_simp
theorem pencil_common_factor_le (q K : β) (b ΞΊ : β)
(hq : 1 β€ q) (hK : 0 β€ K) (hΞΊ : ΞΊ β€ 5 * b) :
(32 : β) ^ b * (q + 1) ^ (5 * b - ΞΊ) * (K / q) ^ b / q ^ (4 * b) β€
(1024 * K) ^ b / q ^ ΞΊ := by
have hqpos : 0 < q := lt_of_lt_of_le zero_lt_one hq
have hqne : q β 0 := ne_of_gt hqpos
have hp : (q + 1) ^ (5 * b - ΞΊ) β€ (2 : β) ^ (5 * b) * q ^ (5 * b - ΞΊ) := by
calc
(q + 1) ^ (5 * b - ΞΊ) β€ (2 * q) ^ (5 * b - ΞΊ) := by gcongr; linarith
_ = (2 : β) ^ (5 * b - ΞΊ) * q ^ (5 * b - ΞΊ) := mul_pow _ _ _
_ β€ (2 : β) ^ (5 * b) * q ^ (5 * b - ΞΊ) :=
mul_le_mul_of_nonneg_right
(pow_le_pow_rightβ (by norm_num : (1 : β) β€ 2) (Nat.sub_le _ _))
(pow_nonneg hqpos.le _)
have hqp : q ^ (5 * b) = q ^ b * q ^ (4 * b) := by
rw [β pow_add]
congr 1
omega
have hc : (32 : β) ^ b * (2 : β) ^ (5 * b) * K ^ b = (1024 * K) ^ b := by
rw [pow_mul, β mul_pow, β mul_pow]
norm_num
calc
(32 : β) ^ b * (q + 1) ^ (5 * b - ΞΊ) * (K / q) ^ b / q ^ (4 * b)
β€ (32 : β) ^ b * ((2 : β) ^ (5 * b) * q ^ (5 * b - ΞΊ)) *
(K / q) ^ b / q ^ (4 * b) := by gcongr
_ = (1024 * K) ^ b / q ^ ΞΊ := by
rw [div_pow, pow_subβ q hqne hΞΊ, hqp]
field_simp
nlinarith [hc]
end Balanced.LocalAsymptotics
end OAI
|