theoremTimeLaw.geometric_step_deficit (P : TimeLaw) (s : SplitSieve)
(hne : s.primes.Nonempty) (z : ℕ→GaussianInt) (hinj : Function.Injective z)
{DTg e : ℝ} (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 b q : ℕ}
(hm : EnrichmentMargins s D g n b q)
(hE : (1-e)*(q:ℝ)*s.meanLog ≤ s.pointEntropy P.law (fun a => z a.val) q) :
(1-e/2-20*g)*(b:ℝ)*s.meanLog ≤
s.pointEntropy (P.step z n).law (fun a => z a.val) b :=by
proof · 8
lines
apply P.step_deficit s z hD hstep hm.length_pos hm.output_pos hm.decreases
hm.input_cap hg.le hg1 (by linarith only [hL]) hm.ratio ?_ hE hm.displacement_cost
intro a
obtain ⟨hb,hh⟩ := s.walk_fresh_lower hne (fun t => z (a.val+t)) hm.length_pos
(shifted_walk_injective z hinj a.val) hD hT
(fun t _ =>by simpa only [Nat.add_assoc] using hstep (a.val+t)) hpT hg hg1 hL
hm.log_pos hm.rounding hm.large hm.output_cost hm.lattice_cost hm.geometry_cap
exact hh
lemmaSplitSieve.pointEntropy_nonneg {Ω : Type uOmega} [Fintype Ω]
(s : SplitSieve) (p : FinLaw Ω) (Z : Ω →GaussianInt) (b : ℕ) :
0≤ s.pointEntropy p Z b :=by
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]
cases Pwith | mk n p =>
cases Qwith | mk m q =>
dsimp only at hl
subst m
congr 1letf : ℕ→Fin (n+1) :=fun t => ⟨min t n,by omega⟩
have hh := h f
havehe : (funt : Fin (n+1) => f t.val)=id :=by
funext t
apply Fin.ext
exact Nat.min_eq_left (by omega)
unfold observe at hh
simpa only [he,FinLaw.map_id] using hh
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