lemmacommonBlocks_length {a : ℝ} {m W : ℕ} (J : ℕ→Finsetℕ) (hm : 2≤Real.exp m)
(hJ : ∀ w<W, ∀ j∈J w, (j:ℝ)*Real.log 2≤21/20*((100:ℝ)^w*Real.exp m)) :
((commonBlocks a m WJ).length:ℝ)+2≤
(W:ℝ)*(60*(100:ℝ)^W*Real.exp m+4*(m:ℝ)^2)+4*(m:ℝ)^2+2:=by
proof · 4
lines
have hh := windowBlocks_length_bound_of_bins (a := a) J hm hJ
simp only [commonBlocks,List.length_append,accurateBlock,List.length_ofFn,
accurateIterations,Nat.cast_add,Nat.cast_mul,Nat.cast_pow,Nat.cast_ofNat]
linarith only [hh]
theoremeventually_window_tail_bounds {Da : ℝ} (hD : 1≤D) (ha : 0≤a) (ha1 : a≤1)
(Ww : ℕ) (hw : w<W) :
∀ᶠ m : ℕin atTop, ∀J : ℕ→Finsetℕ,
(∀ i<W, ∀ j∈J i, (j:ℝ)*Real.log 2≤21/20*((100:ℝ)^i*Real.exp m)) →
((commonBlocks a m WJ).length:ℝ)+2≤Real.exp (Real.exp m) ∧
(windowSmoothing Wm:ℝ)≤Real.exp (Real.exp ((1/100)*Real.exp m)) ∧
((windowBlocks a m J w).length+2:ℝ)≤Real.exp (Real.exp (((100:ℝ)^w/50)*Real.exp m)) ∧Real.log 36+2*Real.log (D*((accurateBlock m (1/20)).sum+windowSmoothing W m))≤Real.exp (3/50*((100:ℝ)^w*Real.exp m)) ∧Real.log 36+2*Real.log (D*((middleBlocks a m w J++accurateBlock m (1/20)).sum+windowSmoothing W m))≤Real.exp (13/50*((100:ℝ)^w*Real.exp m)) :=by
proof · 53
lines
have hN := eventually_mul_le_double_exp (a :=1/100) (by norm_num) (20*(100:ℝ)^W+2)
have hlen := eventually_mul_le_double_exp (a :=1/100) (by norm_num) 1have ht := windowScale_tendsto w
have hbot := ht.eventually (eventually_suffix_cost (D:=D) (a :=1/20) (b :=3/50)
(C:=20*(100:ℝ)^W+2) (by linarith only [hD]) (by norm_num) (by norm_num))
have hrest := ht.eventually (eventually_suffix_cost (D:=D) (a :=1/4) (b :=13/50)
(C:=20*(100:ℝ)^W+2) (by linarith only [hD]) (by norm_num) (by norm_num))
have hm2 := (windowScale_tendsto 0).eventually (eventually_ge_atTop (2:ℝ))
filter_upwards [eventually_window_length W,hN,hlen,hbot,hrest,hm2] with m hm hN hlen hbot hrest hm2
intro J hJ
simp only [one_mul] at hlen
simp only [pow_zero,one_mul] at hm2
have hl := (commonBlocks_length (a := a) J hm2 hJ).trans hm
have hpow := window_power_one w
havehX : Real.exp (m:ℝ)≤(100:ℝ)^w*Real.exp m :=by nlinarith only [hpow,Real.exp_pos (m:ℝ)]
havehNsmall : (windowSmoothing Wm:ℝ)≤Real.exp (Real.exp ((1/100)*Real.exp m)) :=byhave hN' := (windowSmoothing_bounds W m).2.trans (Real.exp_le_exp.mpr hN)
linarith only [hN']
havehlw : ((windowBlocks a m J w).length+2:ℝ)≤Real.exp (Real.exp (((100:ℝ)^w/50)*Real.exp m)) :=byhavehh : (windowBlocks a m J w).length≤(commonBlocks a m WJ).length :=by
obtain ⟨pre,he⟩ := windowBlocks_split a m J hw
simp only [commonBlocks,he,List.length_append]; omega
haveharg : Real.exp (m:ℝ)≤Real.exp (((100:ℝ)^w/50)*Real.exp m) :=by
apply hlen.trans (Real.exp_le_exp.mpr _)
nlinarith only [hpow,Real.exp_pos (m:ℝ)]
exact (add_le_add (byexact_mod_cast hh : ((windowBlocks a m J w).length:ℝ)≤(commonBlocks a m WJ).length) (le_refl (2:ℝ))) |>.trans (hl.trans (Real.exp_le_exp.mpr harg))
havehNs : (windowSmoothing Wm:ℝ)+1≤Real.exp ((20*(100:ℝ)^W+2)*((100:ℝ)^w*Real.exp m)) :=
(windowSmoothing_bounds W m).2.trans (Real.exp_le_exp.mpr (mul_le_mul_of_nonneg_left hX (by positivity)))
havehbLen : ((accurateBlock m (1/20)).length+2:ℝ)≤Real.exp ((100:ℝ)^w*Real.exp m) :=byhavehh : (accurateBlock m (1/20)).length≤(commonBlocks a m WJ).length :=by simp [commonBlocks]
exact (add_le_add (byexact_mod_cast hh : ((accurateBlock m (1/20)).length:ℝ)≤(commonBlocks a m WJ).length) (le_refl (2:ℝ))) |>.trans (hl.trans (Real.exp_le_exp.mpr hX))
havehrLen : ((middleBlocks a m w J++accurateBlock m (1/20)).length+2:ℝ)≤Real.exp ((100:ℝ)^w*Real.exp m) :=byhave hh := middleBlocks_length_le (a := a) (m := m) J hw
havehh' : (middleBlocks a m w J++accurateBlock m (1/20)).length≤(commonBlocks a m WJ).length :=by
simp only [commonBlocks,List.length_append]; omega
exact (add_le_add (byexact_mod_cast hh' : ((middleBlocks a m w J++accurateBlock m (1/20)).length:ℝ)≤(commonBlocks a m WJ).length) (le_refl (2:ℝ))) |>.trans (hl.trans (Real.exp_le_exp.mpr hX))
havehbOps : ∀ n∈accurateBlock m (1/20), (n:ℝ)≤Real.exp (Real.exp ((1/20)*((100:ℝ)^w*Real.exp m))) :=by
apply accurateBlock_bound (accurateGrid_le_one m)
exact (mul_le_of_le_one_left (Real.exp_nonneg _) (accurateGrid_le_one m)).trans
(Real.exp_le_exp.mpr (by linarith only [hX]))
havehrOps : ∀ n∈middleBlocks a m w J++accurateBlock m (1/20), (n:ℝ)≤Real.exp (Real.exp ((1/4)*((100:ℝ)^w*Real.exp m))) :=by
intro n hn
rcases List.mem_append.mp hn with hn|hn
· rcases List.mem_append.mp hn with hn|hn
· apply accurateBlock_bound (accurateGrid_le_one m) _ n hn
simpa only [div_mul_eq_mul_div,mul_assoc,one_mul] using
(mul_le_of_le_one_left (Real.exp_nonneg (((100:ℝ)^w/4)*Real.exp m)) (accurateGrid_le_one m))
· exact (smaller_window_operations ha ha1 m w J (fun i hi => hJ i (hi.trans hw)) n hn).trans
(Real.exp_le_exp.mpr (Real.exp_le_exp.mpr (by nlinarith only [show0≤(100:ℝ)^w*Real.exp m by positivity] : ((100:ℝ)^w/50)*Real.exp m≤(1/4)*((100:ℝ)^w*Real.exp m))))
· exact (hbOps n hn).trans (Real.exp_le_exp.mpr (Real.exp_le_exp.mpr (by nlinarith only [show0≤(100:ℝ)^w*Real.exp m by positivity] : (1/20)*((100:ℝ)^w*Real.exp m)≤(1/4)*((100:ℝ)^w*Real.exp m))))
exact ⟨hl,hNsmall,hlw,
hbot _ _ (byhave:= windowSmoothing_pos W m; omega) hbLen hbOps hNs,
hrest _ _ (byhave:= windowSmoothing_pos W m; omega) hrLen hrOps hNs⟩
lemmafloor_size_lower {s : SplitSieve} {g UX : ℝ} {l : ℕ}
(hX : 0<X) (hm : 0<s.meanLog) (hm' : s.meanLog≤2*X)
(hscale : Real.exp (X/8)≤bandScale g U l) (hlarge : 4*X≤Real.exp (X/8)) :
Real.exp (X/8)/(4*X)≤(bandSize s g Ul:ℝ) :=by
proof · 7
lines
have hf :=Nat.lt_floor_add_one (bandScale g U l/s.meanLog)
have hh := mul_lt_mul_of_pos_right hf hm
rw [div_mul_cancel₀ _ hm.ne',add_mul,one_mul] at hh
have hb := mul_le_mul_of_nonneg_left hm' (Nat.cast_nonneg (bandSize s g U l))
change (bandScale g U l)<((bandSize s g Ul:ℝ)*s.meanLog)+s.meanLog at hh
apply (div_le_iff₀ (by positivity)).mpr
nlinarith only [hf,hh,hb,hscale,hlarge,hm']
theoremeventually_window_bands {Da δ : ℝ} (hD : 1≤D) (ha : 0≤a) (ha1 : a≤1)
(hδ : 0<δ) (Ww : ℕ) (hw : w<W) :
∀ᶠ m : ℕin atTop, ∀J : ℕ→Finsetℕ,
(∀ i<W, ∀ j∈J i, ((100:ℝ)^i*Real.exp m)≤j*Real.log 2∧
j*Real.log 2≤21/20*((100:ℝ)^i*Real.exp m) ∧
δ*(2:ℝ)^j/Real.log ((2:ℝ)^(j+1))≤(PrimeLogMass.dyadicBatch j).card) →∀ j∈J w,
Nonempty (EntropyBand (dyadicSieve j) D (middleBlocks a m w J) 0
(bandSize (dyadicSieve j) (accurateGrid m) (Real.exp (((100:ℝ)^w/4)*Real.exp m)) (accurateIterations m))
(91*accurateGrid m)) ∧Nonempty (EntropyBand (dyadicSieve j) D (accurateBlock m (1/20)) (windowSmoothing W m)
(bandSize (dyadicSieve j) (accurateGrid m) (Real.exp ((1/20)*Real.exp m)) (accurateIterations m))
(91*accurateGrid m)) ∧Real.exp (((100:ℝ)^w*Real.exp m)/8)/(4*((100:ℝ)^w*Real.exp m))≤
(bandSize (dyadicSieve j) (accurateGrid m) (Real.exp (((100:ℝ)^w/4)*Real.exp m)) (accurateIterations m):ℝ) :=by
proof · 47
lines
have hwp := window_power_one w
havehp : (0:ℝ)<100^w :=by positivity
have hmid := eventually_accurate_band (D:=D) (A:= (100:ℝ)^w) (B:=2*(100:ℝ)^w)
(a := (100:ℝ)^w/4) (b := (100:ℝ)^w/50) hD hp (by positivity) (by linarith only [hp])
(by linarith only [hp]) hδ
have hbot := eventually_accurate_band (D:=D) (A:=1) (B:=2*(100:ℝ)^w)
(a :=1/20) (b :=1/100) hD (by norm_num) (by norm_num) (by norm_num) (by norm_num) hδ
have hscale := eventually_accurate_scale (a := (100:ℝ)^w/4) (by positivity) 0have hlarge := eventually_mul_le_double_exp (a := (100:ℝ)^w/8) (by positivity) (4*(100:ℝ)^w)
have hm2 := (windowScale_tendsto 0).eventually (eventually_ge_atTop (2:ℝ))
filter_upwards [hmid,hbot,hscale,hlarge,eventually_window_tail_bounds hD ha ha1 W w hw,hm2]
with m hmid hbot hscale hlarge htail hm2
intro J hJ j hj
simp only [pow_zero,one_mul] at hm2
have hdata := hJ w hw j hj
have hne := dyadic_dense_nonempty hδ hdata.2.2havehX2 : 2≤(100:ℝ)^w*Real.exp m :=by nlinarith only [hm2,hwp]
have hm := dyadic_mean_bounds hX2 hne hdata.1 hdata.2.1have hpj := dyadic_prime_bounds j
havehdense : δ*(2:ℝ)^j/Real.log (2*(2:ℝ)^j)≤(dyadicSieve j).primes.card :=by
change δ*(2:ℝ)^j/Real.log (2*(2:ℝ)^j)≤(PrimeLogMass.dyadicBatch j).card
simpa only [pow_succ,mul_comm] using hdata.2.2havehT : Real.exp ((100:ℝ)^w*Real.exp m)≤(2:ℝ)^j :=by
rw [←Real.exp_log (bypositivity : (0:ℝ)<2^j),Real.log_pow]
exact Real.exp_le_exp.mpr hdata.1havehThi : Real.log ((2:ℝ)^j)≤(2*(100:ℝ)^w)*Real.exp m :=by
rw [Real.log_pow]
nlinarith only [hdata.2.1,hX2]
obtain ⟨_,hN,hlen,_,_⟩ := htail J (fun i hi k hk => (hJ i hi k hk).2.1)
have hmid' := hmid (dyadicSieve j) ((2:ℝ)^j) [] (windowBlocks a m J w) 0
hne hpj hdense hT hThi
(smaller_window_operations ha ha1 m w J (fun i hi k hk => (hJ i (hi.trans hw) k hk).2.1))
(by simp only [Nat.cast_zero]; positivity) hlen
havehTwo : (2:ℝ)≤Real.exp (Real.exp ((1/100)*Real.exp m)) :=byhavehe : 1≤Real.exp ((1/100)*Real.exp (m:ℝ)) :=Real.one_le_exp_iff.mpr (by positivity)
linarith only [Real.add_one_le_exp (Real.exp ((1/100)*Real.exp (m:ℝ))),he]
have hbot' := hbot (dyadicSieve j) ((2:ℝ)^j) [] [] (windowSmoothing W m)
hne hpj hdense
((Real.exp_le_exp.mpr (by nlinarith only [hwp,Real.exp_pos (m:ℝ)] : 1*Real.exp m≤(100:ℝ)^w*Real.exp m)).trans hT)
hThi (by simp only [List.not_mem_nil,IsEmpty.forall_iff,implies_true]) hN
(by simpa only [List.length_nil,Nat.cast_zero,zero_add] using hTwo)
refine ⟨?_,?_,?_⟩
· simpa only [List.nil_append,accurateBlock,middleBlocks] using hmid'
· simpa only [List.nil_append,List.append_nil,accurateBlock] using hbot'
· apply floor_size_lower (by linarith only [hX2]) (by linarith only [hm.1]) hm.2
· simpa only [pow_zero,one_mul,div_div,show (4:ℝ)*2=8by norm_num,div_mul_eq_mul_div] using hscale
· simpa only [mul_assoc,div_mul_eq_mul_div] using hlarge