theoremTimeLaw.run_entropy (P : TimeLaw) (s : SplitSieve) (hne : s.primes.Nonempty)
(z : ββGaussianInt) (hinj : Function.Injective z) {DTg : β}
(hD : 1β€D) (hT : 5β€T) (hstep : β t, dist (z t:β) (z (t+1):β) β€D)
(hpT : β p β s.primes, Tβ€ (p:β) β§ (p:β) β€2*T)
(hg : 0 < g) (hg1 : g β€1/100) (hL : 1β€ s.meanLog)
(n q : βββ) (l : β) (hm : β j<l, EnrichmentMargins s D g (n j) (q (j+1)) (q j)) :
(1-(1/2:β)^l-40*g)*(q l:β)*s.meanLog β€
s.pointEntropy (P.run z n l).law (fun a => z a.val) (q l) :=by
proof Β· 16
lines
induction l with
| zero =>have hh := s.pointEntropy_nonneg P.law (fun a => z a.val) (q 0)
simp only [pow_zero,sub_self,zero_sub,TimeLaw.run_zero]
havehneg : -(40*g)*(q 0:β)*s.meanLog β€0:=by
apply mul_nonpos_of_nonpos_of_nonneg
Β· exact mul_nonpos_of_nonpos_of_nonneg (by linarith only [hg]) (Nat.cast_nonneg (q 0))
Β· linarith only [hL]
exact hneg.trans hh
| succ l ih =>have hi := ih (fun j hj => hm j (by omega))
have hh := (P.run z n l).geometric_step_deficit s hne z hinj hD hT hstep hpT
hg hg1 hL (hm l (by omega)) (e := (1/2:β)^l+40*g) (by
convert hi using1; ring)
rw [TimeLaw.run_succ]
convert hh using1; ring
theoremTimeLaw.advance_entropy (P : TimeLaw) (K : ForwardKernel) (s : SplitSieve)
(z : ββGaussianInt) {D : β} (hD : 1β€D)
(hstep : β t, dist (z t:β) (z (t+1):β) β€D) (hK : 1β€K.bound) (b : β) :
s.pointEntropy P.law (fun a => z a.val) b -
(Real.log 36+2*Real.log (D*K.bound)) β€
s.pointEntropy (P.advance K).law (fun a => z a.val) b :=by
proof Β· 14
lines
letQ:=P.law.joint (fun a =>K.law a.val)
have hh := s.pointEntropy_shift Q (fun v => z v.1.val)
(fun v => z (v.1.val+v.2.val)) b
have hfst := s.pointEntropy_joint_fst P.law (fun a =>K.law a.val) (fun a => z a.val) b
change s.pointEntropy Q (fun v => z v.1.val) b = _ at hfst
rw [hfst] at hh
havehe : s.pointEntropy (P.advance K).law (fun a => z a.val) b =
s.pointEntropy Q (fun v => z (v.1.val+v.2.val)) b :=by
unfold TimeLaw.advance
rw [s.pointEntropy_map]
rfl
rw [he]
have hc :=P.advance_displacement_entropy K z hD hstep hK
linarith only [hh,hc]
theoremTimeLaw.run_future_entropy (P : TimeLaw) (K : ForwardKernel) (s : SplitSieve)
(hne : s.primes.Nonempty) (z : ββGaussianInt) (hinj : Function.Injective z)
{DTg : β} (hD : 1β€D) (hT : 5β€T)
(hstep : β t, dist (z t:β) (z (t+1):β) β€D)
(hpT : β p β s.primes, Tβ€ (p:β) β§ (p:β) β€2*T)
(hg : 0 < g) (hg1 : g β€1/100) (hL : 1β€ s.meanLog)
(n q : βββ) (l : β) (hm : β j<l, EnrichmentMargins s D g (n j) (q (j+1)) (q j))
(hK : 1β€K.bound) {e : β}
(hcost : Real.log 36+2*Real.log (D*K.bound) β€ e*(q l:β)*s.meanLog) :
(1-(1/2:β)^l-40*g-e)*(q l:β)*s.meanLog β€
s.pointEntropy ((P.run z n l).advance K).law (fun a => z a.val) (q l) :=by
proof Β· 3
lines
have h1 :=P.run_entropy s hne z hinj hD hT hstep hpT hg hg1 hL n q l hm
have h2 := (P.run z n l).advance_entropy K s z hD hstep hK (q l)
nlinarith only [h1,h2,hcost]
lemmaForwardKernel.then_observe {Ξ± : Type uAlpha} [Fintype Ξ±]
(KR : ForwardKernel) (a : β) (f : ββ Ξ±) :
((K.thenR).law a).map (fun t => f (a+t.val))=
(K.law a).mix (fun t => (R.law (a+t.val)).map (fun u => f (a+t.val+u.val))) :=by
proof Β· 7
lines
unfold ForwardKernel.then
rw [FinLaw.map_comp,FinLaw.joint_observation_fun]
congr 1
funext t
congr 1
funext u
simp only [Function.comp_def,addOffsets,Nat.add_assoc]
apply TimeLaw.ext_observe
Β· exact (Nat.add_assoc _ _ _).symm
Β· intro Ξ± _ f
rw [TimeLaw.observe_advance,TimeLaw.observe_advance]
change P.law.mix _ = (((P.law.joint (fun a =>K.law a.val)).map
(addOffsets P.last K.bound))).mix (funa : Fin (P.last+K.bound+1) =>
(R.law a.val).map (fun t => f (a.val+t.val)))
rw [FinLaw.mix_map_left]
have hj :=FinLaw.joint_observation (P.law) (fun a =>K.law a.val)
(fun a t => (a,t))
clear hj
havehmix : ((P.law.joint (fun a =>K.law a.val))).mix
(fun v => (R.law (v.1.val+v.2.val)).map (fun u => f (v.1.val+v.2.val+u.val))) =
P.law.mix (fun a => (K.law a.val).mix
(fun t => (R.law (a.val+t.val)).map (fun u => f (a.val+t.val+u.val)))) :=by
ext x
simp only [FinLaw.mix_mass,FinLaw.joint_mass,Fintype.sum_prod_type,Finset.mul_sum,mul_assoc]
change P.law.mix _ = (P.law.joint (fun a =>K.law a.val)).mix
(fun v => (R.law (v.1.val+v.2.val)).map (fun u => f (v.1.val+v.2.val+u.val)))
rw [hmix]
congr 1
funext a
exact K.then_observe R a.val f
lemmaTimeLaw.advance_common_append (P : TimeLaw) (z : ββGaussianInt)
(ns ms : Listβ) (N : β) :
P.advance (commonSchedule z (ns++ms) N)=
(ns.foldl (funQ k =>Q.step z k) P).advance (commonSchedule z ms N) :=by
proof Β· 4
lines
induction ns generalizing Pwith
| nil => rfl
| cons k ks hk =>
rw [List.cons_append,TimeLaw.advance_common_cons,hk,List.foldl_cons]
lemmaTimeLaw.foldl_ofFn (P : TimeLaw) (z : ββGaussianInt)
(n : βββ) (l : β) :
(List.ofFn (funi : Fin l => n i.val)).foldl (funQ k =>Q.step z k) P=P.run z n l :=by
proof Β· 6
lines
induction l with
| zero => rfl
| succ l hl =>
rw [List.ofFn_succ_last,List.foldl_append,List.foldl_cons,List.foldl_nil]
simp only [Fin.val_castSucc,Fin.val_last]
rw [hl,TimeLaw.run_succ]
lemmaTimeLaw.run_common (P : TimeLaw) (z : ββGaussianInt)
(n : βββ) (l N : β) :
P.advance (commonSchedule z (List.ofFn (funi : Fin l => n i.val)) N)=
(P.run z n l).advance (smoothingKernel N) :=by
proof Β· 2
lines
have h :=P.advance_common_append z (List.ofFn (funi : Fin l => n i.val)) [] N
simpa only [List.append_nil,TimeLaw.foldl_ofFn,commonSchedule,List.foldr_nil] using h
theoremgeometric_band_margins (s : SplitSieve) {DUg : β} {l : β}
(hD : 1β€D) (hg : 0<g) (hg1 : gβ€1/200) (hL : 1β€ s.meanLog) (hU : 0<U)
(hlog : 2*(1+Real.log 18) β€ g*bandScale g U l)
(hlarge : 640*s.meanLog β€ g^5*bandScale g U l)
(hsize : Real.log 16+Real.log (max D ((latticeBall (4*D)).card:β)) β€ g^2*bandScale g U l)
(hdisp : 4*Real.log D+2*Real.log 36β€4*g*bandScale g U l)
(hgeom : 2*Real.log 16+4*Real.log Dβ€ bandScale g U l/4)
(hcap : βU/s.meanLogββ β€ s.primes.card) :
β j<l, EnrichmentMargins s D (2*g) (bandLength g U j)
(bandSize s g U (j+1)) (bandSize s g U j) :=by
proof Β· 14
lines
intro j hj
have hmono := bandScale_antitone hg.le (show gβ€1by linarith only [hg1]) hU.le
have hlow := hmono hj.le
have hhigh := hmono (Nat.zero_le j)
simp only [bandScale,pow_zero,one_mul] at hhigh
unfold bandLength bandSize
rw [bandScale_succ]
apply EnrichmentMargins.from_scale s hD hg hg1 hL (bandScale_pos hg hU j)
Β· exact hlog.trans (mul_le_mul_of_nonneg_left hlow hg.le)
Β· exact hlarge.trans (mul_le_mul_of_nonneg_left hlow (pow_nonneg hg.le _))
Β· exact hsize.trans (mul_le_mul_of_nonneg_left hlow (sq_nonneg g))
Β· exact hdisp.trans (mul_le_mul_of_nonneg_left hlow (by positivity))
Β· exact hgeom.trans (div_le_div_of_nonneg_right hlow (by norm_num))
Β· exact (Nat.floor_mono (div_le_div_of_nonneg_right hhigh (by linarith only [hL]))).trans hcap
theoremTimeLaw.geometric_band_entropy (P : TimeLaw) (s : SplitSieve)
(hne : s.primes.Nonempty) (z : ββGaussianInt) (hinj : Function.Injective z)
{DTUg : β} {l : β} (hD : 1β€D) (hT : 5β€T)
(hs : β t, dist (z t:β) (z (t+1):β)β€D)
(hpT : β pβs.primes, Tβ€(p:β) β§ (p:β)β€2*T)
(hg : 0<g) (hg1 : gβ€1/200) (hL : 1β€ s.meanLog) (hU : 0<U)
(hlog : 2*(1+Real.log 18) β€ g*bandScale g U l)
(hlarge : 640*s.meanLog β€ g^5*bandScale g U l)
(hsize : Real.log 16+Real.log (max D ((latticeBall (4*D)).card:β)) β€ g^2*bandScale g U l)
(hdisp : 4*Real.log D+2*Real.log 36β€4*g*bandScale g U l)
(hgeom : 2*Real.log 16+4*Real.log Dβ€ bandScale g U l/4)
(hcap : βU/s.meanLogββ β€ s.primes.card) :
(1-(1/2:β)^l-80*g)*(bandSize s g Ul:β)*s.meanLog β€
s.pointEntropy (P.run z (bandLength g U) l).law (fun a => z a.val) (bandSize s g U l) :=by
proof Β· 4
lines
have hm := geometric_band_margins s hD hg hg1 hL hU hlog hlarge hsize hdisp hgeom hcap
have hh :=P.run_entropy s hne z hinj hD hT hs hpT (bypositivity : 0<2*g)
(by linarith only [hg1] : 2*gβ€1/100) hL (bandLength g U) (bandSize s g U) l hm
convert hh using1; ring
havehsum : (ns.sum:β)β€(ns.length:β)*Real.exp x :=by
induction ns with
| nil => simp
| cons n ns ih =>have hn := hns n (by simp)
have ht := ih (fun k hk => hns k (by simp [hk]))
(by simp only [List.length_cons,Nat.cast_add,Nat.cast_one] at hlen; linarith only [hlen])
simp only [List.sum_cons,List.length_cons,Nat.cast_add,Nat.cast_one]
nlinarith only [hn,ht]
havehx : (1:β)β€Real.exp x :=byhavehlen0 : (0:β)β€ns.length :=Nat.cast_nonneg _
linarith only [hlen,hlen0]
havehall : (1+(commonSchedule z ns N).bound:β)β€Real.exp (2*x) :=by
rw [commonSchedule_bound,Nat.cast_add]
have hm := mul_le_mul_of_nonneg_right hlen (Real.exp_nonneg x)
rw [show2*x=x+x by ring,Real.exp_add]
nlinarith only [hsum,hN,hm,hx]
have hlog :=Real.log_le_log (bypositivity : (0:β)<1+(commonSchedule z ns N).bound) hall
simpa only [Real.log_exp] using hlog