openAI-math-dataset / lean /OAI /NumberTheory /Jacobsthal /Conclusions /JacobsthalSourceScale.lean
roseking's picture
Add lean source and binary files (part 104)
f89a930 verified
Raw History Blame Contribute Delete
4.08 kB
import OAI.NumberTheory.Jacobsthal.Estimates.MovingLocalReference
namespace OAI
namespace Erdos970
open scoped _root_.Erdos970
section
namespace NumberTheoryLean.JacobsthalSourceScale
open _root_.Filter Asymptotics
open scoped Topology
noncomputable def sourceW (L : ℝ) : ℝ := L/(Real.log L)^2
noncomputable def sourceB (L : ℝ) : ℝ := L/Real.log (sourceW L)
theorem log_square_le_sqrt_eventually : ∀ᶠ L : ℝ in atTop,(Real.log L)^2 ≤ Real.sqrt L := by
have h := (isLittleO_log_rpow_rpow_atTop (2:ℝ) (s:=1/2) (by norm_num)).bound (by norm_num : (0:ℝ)<1)
filter_upwards [h,eventually_gt_atTop (1:ℝ)] with L hL hpos
have hr : 0 ≤ L^((1/2:ℝ)) := Real.rpow_nonneg (by linarith) _
simpa only [Real.rpow_ofNat,Real.norm_eq_abs,abs_of_nonneg (sq_nonneg (Real.log L)),
abs_of_nonneg hr,one_mul,← Real.sqrt_eq_rpow,abs_of_nonneg (Real.sqrt_nonneg L)] using hL
theorem sourceW_bounds_eventually : ∀ᶠ L : ℝ in atTop,
1 < sourceW L ∧ Real.sqrt L ≤ sourceW L ∧ sourceW L ≤ L := by
filter_upwards [log_square_le_sqrt_eventually,eventually_gt_atTop (1:ℝ),
Real.tendsto_log_atTop.eventually (eventually_ge_atTop (1:ℝ))] with L hsmall hL hlog
have hL0 : 0 < L := by linarith
have hden : 0 < (Real.log L)^2 := sq_pos_of_pos (by linarith)
have hsq : Real.sqrt L ≤ sourceW L := by
apply (le_div_iff₀ hden).mpr
have hm := mul_le_mul_of_nonneg_left hsmall (Real.sqrt_nonneg L)
simpa only [Real.mul_self_sqrt hL0.le] using hm
have hlow : 1 < Real.sqrt L := by
simpa only [Real.sqrt_one] using Real.sqrt_lt_sqrt (by norm_num : (0:ℝ) ≤ 1) hL
refine ⟨hlow.trans_le hsq,hsq,?_⟩
exact div_le_self hL0.le (by nlinarith : 1 ≤ (Real.log L)^2)
theorem sourceW_tendsto : Tendsto sourceW atTop atTop := by
apply tendsto_atTop.mpr
intro R
filter_upwards [sourceW_bounds_eventually,Real.tendsto_sqrt_atTop.eventually (eventually_ge_atTop R)] with L hW hR
exact hR.trans hW.2.1
theorem source_scale_eventually : ∀ᶠ L : ℝ in atTop,
1 < sourceW L ∧ 0 < sourceB L ∧ Real.sqrt L ≤ sourceB L ∧ sourceB L ≤ L ∧
Real.log (sourceB L) ≤ 2*Real.log (sourceW L) := by
filter_upwards [sourceW_bounds_eventually,log_square_le_sqrt_eventually,eventually_gt_atTop (1:ℝ),
Real.tendsto_log_atTop.eventually (eventually_ge_atTop (1:ℝ)),
sourceW_tendsto.eventually (eventually_ge_atTop (Real.exp 1))] with L hW hsmall hL hlog hWexp
have hL0 : 0 < L := by linarith
have hW0 : 0 < sourceW L := by linarith [hW.1]
have hlogW : 1 ≤ Real.log (sourceW L) := by simpa only [Real.log_exp] using Real.log_le_log (Real.exp_pos 1) hWexp
have hlogWL : Real.log (sourceW L) ≤ Real.log L := Real.log_le_log hW0 hW.2.2
have hlogSmall : Real.log (sourceW L) ≤ Real.sqrt L := by
have hh : Real.log L ≤ (Real.log L)^2 := by nlinarith
exact hlogWL.trans (hh.trans hsmall)
have hBpos : 0 < sourceB L := div_pos hL0 (by linarith)
have hBsq : Real.sqrt L ≤ sourceB L := by
apply (le_div_iff₀ (show 0 < Real.log (sourceW L) by linarith)).mpr
have hm := mul_le_mul_of_nonneg_left hlogSmall (Real.sqrt_nonneg L)
simpa only [Real.mul_self_sqrt hL0.le] using hm
have hBL : sourceB L ≤ L := div_le_self hL0.le hlogW
have hLWsq : L ≤ (sourceW L)^2 := by
have hh := mul_self_le_mul_self (Real.sqrt_nonneg L) hW.2.1
nlinarith [Real.sq_sqrt hL0.le]
have hcomp := Real.log_le_log hBpos (hBL.trans hLWsq)
refine ⟨hW.1,hBpos,hBsq,hBL,?_⟩
simpa only [Real.log_pow,Nat.cast_ofNat] using hcomp
theorem sourceB_tendsto : Tendsto sourceB atTop atTop := by
apply tendsto_atTop.mpr
intro R
filter_upwards [source_scale_eventually,Real.tendsto_sqrt_atTop.eventually (eventually_ge_atTop R)] with L h hR
exact hR.trans h.2.2.1
theorem sourceW_pow_sourceB {L : ℝ} (hW : 1 < sourceW L) :
(sourceW L)^(sourceB L)=Real.exp L := by
rw [sourceB,Real.rpow_def_of_pos (by linarith : 0 < sourceW L)]
congr 1
field_simp [ne_of_gt (Real.log_pos hW)]
end NumberTheoryLean.JacobsthalSourceScale
end
end Erdos970
end OAI