Download data/lean/OAI/NumberTheory/GaussianMoat/MultiscaleSchedule.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 20.3 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/NumberTheory/GaussianMoat/MultiscaleSchedule.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/NumberTheory/GaussianMoat/MultiscaleSchedule.lean
-
curl -L -o MultiscaleSchedule.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/NumberTheory/GaussianMoat/MultiscaleSchedule.lean
20.3 kB
Lean 4 Β· 30
declarations statementsfull
| import OAI.NumberTheory.GaussianMoat.Information | |
| namespace OAI | |
| universe uOmega uAlpha | |
| namespace GaussianMoat | |
| open scoped BigOperators Classical | |
| structure EnrichmentMargins (s : SplitSieve) (D g : β) (n b q : β) : Prop where | |
| length_pos : 1 β€ n | |
| output_pos : 0 < b | |
| decreases : b < q | |
| input_cap : q β€ s.primes.card | |
| ratio : (b:β) β€ g*q | |
| log_pos : 0 < Real.log n-Real.log 18 | |
| rounding : s.meanLog β€ g*(Real.log n-Real.log 18) | |
| large : 5120*s.meanLog β€ g^4*(Real.log n-Real.log 18) | |
| output_cost : (b:β)*s.meanLog β€ g*(Real.log n-Real.log 18) | |
| lattice_cost : Real.log 16+Real.log (max D ((latticeBall (4*D)).card:β)) β€ | |
| g*(Real.log n-Real.log 18) | |
| geometry_cap : 2*(2*Real.log n+Real.log 16+2*Real.log D) β€ s.primes.card*s.meanLog | |
| displacement_cost : 2*(Real.log 36+2*Real.log (D*n)) β€ 8*g*q*s.meanLog | |
| theorem TimeLaw.geometric_step_deficit (P : TimeLaw) (s : SplitSieve) | |
| (hne : s.primes.Nonempty) (z : β β GaussianInt) (hinj : Function.Injective z) | |
| {D T g 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 | |
| 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 | |
| lemma SplitSieve.pointEntropy_nonneg {Ξ© : Type uOmega} [Fintype Ξ©] | |
| (s : SplitSieve) (p : FinLaw Ξ©) (Z : Ξ© β GaussianInt) (b : β) : | |
| 0 β€ s.pointEntropy p Z b := by | |
| unfold pointEntropy FinLaw.signedEntropy | |
| exact Finset.expect_nonneg (fun _ _ => p.orderedEntropy_nonneg _ _) | |
| noncomputable def TimeLaw.run (P : TimeLaw) (z : β β GaussianInt) (n : β β β) : β β TimeLaw | |
| | 0 => P | |
| | j+1 => (P.run z n j).step z (n j) | |
| lemma TimeLaw.run_zero (P : TimeLaw) (z : β β GaussianInt) (n : β β β) : | |
| P.run z n 0=P := rfl | |
| lemma TimeLaw.run_succ (P : TimeLaw) (z : β β GaussianInt) (n : β β β) (j : β) : | |
| P.run z n (j+1)=(P.run z n j).step z (n j) := rfl | |
| theorem TimeLaw.run_entropy (P : TimeLaw) (s : SplitSieve) (hne : s.primes.Nonempty) | |
| (z : β β GaussianInt) (hinj : Function.Injective z) {D T g : β} | |
| (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 | |
| 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] | |
| have hneg : -(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 using 1; ring) | |
| rw [TimeLaw.run_succ] | |
| convert hh using 1; ring | |
| theorem TimeLaw.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 | |
| let Q := 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 | |
| have he : 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] | |
| theorem TimeLaw.run_future_entropy (P : TimeLaw) (K : ForwardKernel) (s : SplitSieve) | |
| (hne : s.primes.Nonempty) (z : β β GaussianInt) (hinj : Function.Injective z) | |
| {D T g : β} (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 | |
| 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] | |
| noncomputable def TimeLaw.observe {Ξ± : Type uAlpha} [Fintype Ξ±] (P : TimeLaw) (f : β β Ξ±) : FinLaw Ξ± := | |
| P.law.map (fun t => f t.val) | |
| lemma TimeLaw.ext_observe (P Q : TimeLaw) (hl : P.last=Q.last) | |
| (h : β {Ξ± : Type} [Fintype Ξ±] (f : β β Ξ±), P.observe f=Q.observe f) : P=Q := by | |
| cases P with | mk n p => | |
| cases Q with | mk m q => | |
| dsimp only at hl | |
| subst m | |
| congr 1 | |
| let f : β β Fin (n+1) := fun t => β¨min t n,by omegaβ© | |
| have hh := h f | |
| have he : (fun t : 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 | |
| lemma TimeLaw.observe_advance {Ξ± : Type uAlpha} [Fintype Ξ±] | |
| (P : TimeLaw) (K : ForwardKernel) (f : β β Ξ±) : | |
| (P.advance K).observe f=P.law.mix (fun a => (K.law a.val).map (fun t => f (a.val+t.val))) := by | |
| unfold observe advance | |
| rw [FinLaw.map_comp,FinLaw.joint_observation_fun] | |
| rfl | |
| lemma ForwardKernel.then_observe {Ξ± : Type uAlpha} [Fintype Ξ±] | |
| (K R : ForwardKernel) (a : β) (f : β β Ξ±) : | |
| ((K.then R).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 | |
| 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] | |
| lemma TimeLaw.advance_then (P : TimeLaw) (K R : ForwardKernel) : | |
| P.advance (K.then R)=(P.advance K).advance R := by | |
| 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 (fun a : 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 | |
| have hmix : ((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 | |
| lemma TimeLaw.advance_common_cons (P : TimeLaw) (z : β β GaussianInt) | |
| (n : β) (ns : List β) (N : β) : | |
| P.advance (commonSchedule z (n::ns) N)=(P.step z n).advance (commonSchedule z ns N) := by | |
| rw [commonSchedule_cons,TimeLaw.advance_then,TimeLaw.advance_difference] | |
| lemma TimeLaw.advance_common_append (P : TimeLaw) (z : β β GaussianInt) | |
| (ns ms : List β) (N : β) : | |
| P.advance (commonSchedule z (ns++ms) N)= | |
| (ns.foldl (fun Q k => Q.step z k) P).advance (commonSchedule z ms N) := by | |
| induction ns generalizing P with | |
| | nil => rfl | |
| | cons k ks hk => | |
| rw [List.cons_append,TimeLaw.advance_common_cons,hk,List.foldl_cons] | |
| lemma TimeLaw.foldl_ofFn (P : TimeLaw) (z : β β GaussianInt) | |
| (n : β β β) (l : β) : | |
| (List.ofFn (fun i : Fin l => n i.val)).foldl (fun Q k => Q.step z k) P=P.run z n l := by | |
| 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] | |
| lemma TimeLaw.run_common (P : TimeLaw) (z : β β GaussianInt) | |
| (n : β β β) (l N : β) : | |
| P.advance (commonSchedule z (List.ofFn (fun i : Fin l => n i.val)) N)= | |
| (P.run z n l).advance (smoothingKernel N) := by | |
| have h := P.advance_common_append z (List.ofFn (fun i : Fin l => n i.val)) [] N | |
| simpa only [List.append_nil,TimeLaw.foldl_ofFn,commonSchedule,List.foldr_nil] using h | |
| lemma log_floor_exp {x : β} (hx : 2 β€ x) : | |
| 1 β€ βReal.exp xββ β§ x-1 β€ Real.log (βReal.exp xββ:β) β§ | |
| Real.log (βReal.exp xββ:β) β€ x := by | |
| have he : 2 β€ Real.exp x := by linarith only [Real.add_one_le_exp x,hx] | |
| have hn : 1 β€ βReal.exp xββ := Nat.floor_pos.mpr (by linarith only [he]) | |
| have hnp : (0:β)<βReal.exp xββ := by exact_mod_cast hn | |
| have hlow : Real.exp x/2 β€ (βReal.exp xββ:β) := by | |
| have h := Nat.lt_floor_add_one (Real.exp x) | |
| linarith only [he,h] | |
| have hlo := Real.log_le_log (div_pos (Real.exp_pos x) (by norm_num : (0:β)<2)) hlow | |
| rw [Real.log_div (Real.exp_ne_zero x) (by norm_num : (2:β)β 0),Real.log_exp] at hlo | |
| have hl2 : Real.log 2 β€ 1 := by | |
| have h := Real.log_le_sub_one_of_pos (by norm_num : (0:β)<2) | |
| linarith only [h] | |
| have hhi := Real.log_le_log hnp (Nat.floor_le (Real.exp_nonneg x)) | |
| rw [Real.log_exp] at hhi | |
| exact β¨hn,by linarith only [hlo,hl2],hhiβ© | |
| theorem EnrichmentMargins.from_scale (s : SplitSieve) {D U g : β} | |
| (hD : 1 β€ D) (hg : 0 < g) (hg1 : g β€ 1/200) (hL : 1 β€ s.meanLog) | |
| (hU : 0 < U) | |
| (hlog : 2*(1+Real.log 18) β€ g*U) | |
| (hlarge : 640*s.meanLog β€ g^5*U) | |
| (hsize : Real.log 16+Real.log (max D ((latticeBall (4*D)).card:β)) β€ g^2*U) | |
| (hdisp : 4*Real.log D+2*Real.log 36 β€ 4*g*U) | |
| (hgeom : 2*Real.log 16+4*Real.log D β€ U/4) | |
| (hcap : βU/s.meanLogββ β€ s.primes.card) : | |
| EnrichmentMargins s D (2*g) βReal.exp (g*U)ββ | |
| βg^2*U/s.meanLogββ βU/s.meanLogββ := by | |
| let L := s.meanLog | |
| let n := βReal.exp (g*U)ββ | |
| let q := βU/Lββ | |
| let b := βg^2*U/Lββ | |
| have hLp : 0 < L := by dsimp [L]; linarith only [hL] | |
| have hg_le : g β€ 1 := by linarith only [hg1] | |
| have hg2 : g^2 β€ 1 := pow_le_oneβ hg.le hg_le | |
| have hg3 : g^3 β€ 1 := pow_le_oneβ hg.le hg_le | |
| have h52 : g^5*U β€ g^2*U := by | |
| have hpow : g^5=g^2*g^3 := by ring | |
| rw [hpow] | |
| nlinarith only [hg3,mul_nonneg (sq_nonneg g) hU.le] | |
| have h2U : g^2*U β€ U := by nlinarith only [hg2,hU] | |
| have hLU : L β€ U/2 := by | |
| change 640*L β€ g^5*U at hlarge | |
| linarith only [hlarge,h52,h2U,hLp] | |
| have hbL : L β€ g^2*U := by | |
| change 640*L β€ g^5*U at hlarge | |
| linarith only [hlarge,h52,hLp] | |
| have he2 : 2 β€ g*U := by | |
| have hh := Real.log_nonneg (by norm_num : (1:β)β€18) | |
| linarith only [hh,hlog] | |
| obtain β¨hn,hnlo,hnhiβ© := log_floor_exp he2 | |
| have hnlo' : g*U/2 β€ Real.log n-Real.log 18 := by | |
| change g*U-1 β€ Real.log n at hnlo | |
| linarith only [hnlo,hlog] | |
| have hu : 0 < Real.log n-Real.log 18 := | |
| lt_of_lt_of_le (div_pos (mul_pos hg hU) (by norm_num)) hnlo' | |
| have hqL : U-L β€ (q:β)*L := by | |
| have hf := Nat.lt_floor_add_one (U/L) | |
| have hm := mul_lt_mul_of_pos_right hf hLp | |
| rw [div_mul_cancelβ _ hLp.ne',add_mul,one_mul] at hm | |
| linarith only [hm] | |
| have hqU : U/2 β€ (q:β)*L := by linarith only [hqL,hLU] | |
| have hqpos : 0 < q := by | |
| have : (0:β)<q := by nlinarith only [hqU,hU,hLp] | |
| exact_mod_cast this | |
| have hbpos : 0 < b := by | |
| apply Nat.floor_pos.mpr | |
| exact (le_div_iffβ hLp).mpr (by simpa only [one_mul] using hbL) | |
| have hbup : (b:β)*L β€ g^2*U := by | |
| exact (le_div_iffβ hLp).mp (Nat.floor_le (by positivity : 0 β€ g^2*U/L)) | |
| have hratio : (b:β) β€ (2*g)*q := by | |
| have h1 := mul_le_mul_of_nonneg_left hqU (show 0 β€ 2*g by positivity) | |
| have h2 : g^2*U β€ g*U := by | |
| have hh := mul_le_mul_of_nonneg_right | |
| (mul_le_mul_of_nonneg_left hg_le hg.le) hU.le | |
| simpa only [mul_one,pow_two] using hh | |
| apply (mul_le_mul_iff_leftβ hLp).mp | |
| nlinarith only [hbup,h1,h2] | |
| have hbq : b < q := by | |
| have hqr : (0:β)<q := by exact_mod_cast hqpos | |
| have : (b:β)<q := by nlinarith only [hratio,hg1,hqr] | |
| exact_mod_cast this | |
| refine β¨hn,hbpos,hbq,hcap,hratio,hu,?_,?_,?_,?_,?_,?_β© | |
| Β· have hm := mul_le_mul_of_nonneg_left hnlo' (show 0 β€ 2*g by positivity) | |
| dsimp only [L] at hbL | |
| nlinarith only [hbL,hm] | |
| Β· have hm := mul_le_mul_of_nonneg_left hnlo' (show 0 β€ (2*g)^4 by positivity) | |
| nlinarith only [hlarge,hm] | |
| Β· have hm := mul_le_mul_of_nonneg_left hnlo' (show 0 β€ 2*g by positivity) | |
| change (b:β)*L β€ _ | |
| nlinarith only [hbup,hm] | |
| Β· have hm := mul_le_mul_of_nonneg_left hnlo' (show 0 β€ 2*g by positivity) | |
| linarith only [hsize,hm] | |
| Β· have hqcap : (q:β)*L β€ s.primes.card*L := | |
| mul_le_mul_of_nonneg_right (by exact_mod_cast hcap) hLp.le | |
| have hgU := mul_le_mul_of_nonneg_right hg1 hU.le | |
| change 2*(2*Real.log n+Real.log 16+2*Real.log D) β€ s.primes.card*L | |
| change Real.log n β€ g*U at hnhi | |
| nlinarith only [hnhi,hgeom,hqU,hqcap,hgU,hU] | |
| Β· have hm := mul_le_mul_of_nonneg_left hqU (show 0 β€ 16*g by positivity) | |
| have hDn : Dβ 0 := by linarith only [hD] | |
| have hnR : (n:β)β 0 := by exact_mod_cast (show nβ 0 by omega) | |
| rw [Real.log_mul hDn hnR] | |
| change Real.log n β€ g*U at hnhi | |
| change 2*(Real.log 36+2*(Real.log D+Real.log n)) β€ 8*(2*g)*q*L | |
| nlinarith only [hnhi,hdisp,hm] | |
| noncomputable def bandScale (g U : β) (j : β) : β := (g^2)^j*U | |
| noncomputable def bandLength (g U : β) (j : β) : β := βReal.exp (g*bandScale g U j)ββ | |
| noncomputable def bandSize (s : SplitSieve) (g U : β) (j : β) : β := βbandScale g U j/s.meanLogββ | |
| lemma bandScale_pos {g U : β} (hg : 0<g) (hU : 0<U) (j : β) : | |
| 0<bandScale g U j := mul_pos (pow_pos (sq_pos_of_pos hg) _) hU | |
| lemma bandScale_antitone {g U : β} (hg : 0β€g) (hg1 : gβ€1) (hU : 0β€U) : | |
| Antitone (bandScale g U) := by | |
| intro i j hij | |
| exact mul_le_mul_of_nonneg_right | |
| (pow_le_pow_of_le_one (sq_nonneg g) (pow_le_oneβ hg hg1) hij) hU | |
| lemma bandScale_succ (g U : β) (j : β) : | |
| bandScale g U (j+1)=g^2*bandScale g U j := by | |
| unfold bandScale | |
| rw [pow_succ] | |
| ring | |
| theorem geometric_band_margins (s : SplitSieve) {D U g : β} {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 | |
| intro j hj | |
| have hmono := bandScale_antitone hg.le (show gβ€1 by 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 | |
| theorem TimeLaw.geometric_band_entropy (P : TimeLaw) (s : SplitSieve) | |
| (hne : s.primes.Nonempty) (z : β β GaussianInt) (hinj : Function.Injective z) | |
| {D T U g : β} {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 U l:β)*s.meanLog β€ | |
| s.pointEntropy (P.run z (bandLength g U) l).law (fun a => z a.val) (bandSize s g U l) := by | |
| 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 (by positivity : 0<2*g) | |
| (by linarith only [hg1] : 2*gβ€1/100) hL (bandLength g U) (bandSize s g U) l hm | |
| convert hh using 1; ring | |
| lemma commonSchedule_log_bound (z : β β GaussianInt) (ns : List β) (N : β) {x : β} | |
| (hns : β nβns, (n:β)β€Real.exp x) (hN : (N:β)β€Real.exp x) | |
| (hlen : (ns.length+2:β)β€Real.exp x) : | |
| Real.log (1+(commonSchedule z ns N).bound:β) β€ 2*x := by | |
| have hsum : (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] | |
| have hx : (1:β)β€Real.exp x := by | |
| have hlen0 : (0:β)β€ns.length := Nat.cast_nonneg _ | |
| linarith only [hlen,hlen0] | |
| have hall : (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 [show 2*x=x+x by ring,Real.exp_add] | |
| nlinarith only [hsum,hN,hm,hx] | |
| have hlog := Real.log_le_log (by positivity : (0:β)<1+(commonSchedule z ns N).bound) hall | |
| simpa only [Real.log_exp] using hlog | |
| lemma suffix_entropy_cost {D g V L : β} {q S : β} | |
| (hD : 1β€D) (hg : 0β€g) (hS : 1β€S) | |
| (hq : V/2β€(q:β)*L) (hlog : Real.log (1+(S:β))β€2*g*V) | |
| (hconst : Real.log 36+2*Real.log Dβ€g*V) : | |
| Real.log 36+2*Real.log (D*S)β€10*g*q*L := by | |
| have hSp : (0:β)<S := by exact_mod_cast hS | |
| have hSl := Real.log_le_log hSp (show (S:β)β€1+S by linarith) | |
| rw [Real.log_mul (by linarith only [hD] : Dβ 0) hSp.ne'] | |
| have hq' := mul_le_mul_of_nonneg_left hq (show 0β€10*g by positivity) | |
| nlinarith only [hSl,hlog,hconst,hq'] | |
| end GaussianMoat | |
| end OAI | |
Outline
- structure
EnrichmentMargins10 - theorem
TimeLaw.geometric_step_deficit25 - lemma
SplitSieve.pointEntropy_nonneg44 - def
TimeLaw.run50 - lemma
TimeLaw.run_zero54 - lemma
TimeLaw.run_succ56 - theorem
TimeLaw.run_entropy59 - theorem
TimeLaw.advance_entropy84 - theorem
TimeLaw.run_future_entropy105 - def
TimeLaw.observe120 - lemma
TimeLaw.ext_observe123 - lemma
TimeLaw.observe_advance139 - lemma
ForwardKernel.then_observe146 - lemma
TimeLaw.advance_then158 - lemma
TimeLaw.advance_common_cons184 - lemma
TimeLaw.advance_common_append189 - lemma
TimeLaw.foldl_ofFn198 - lemma
TimeLaw.run_common208 - lemma
log_floor_exp215 - theorem
EnrichmentMargins.from_scale233 - def
bandScale323 - def
bandLength324 - def
bandSize325 - lemma
bandScale_pos327 - lemma
bandScale_antitone330 - lemma
bandScale_succ336 - theorem
geometric_band_margins342 - theorem
TimeLaw.geometric_band_entropy367 - lemma
commonSchedule_log_bound386 - lemma
suffix_entropy_cost410