import OAI.NumberTheory.GaussianMoat.CommonBlocks namespace OAI namespace GaussianMoat open scoped BigOperators Classical open Filter lemma eventually_length_smoothing : ∀ᶠ X : ℝ in atTop, ∀ p L N : ℝ, 0

(hJ i hi k hk).2.1) have herrors : (91*accurateGrid m)*s.meanLog≤ min (1/1024:ℝ) (Real.exp (-100)/(512*640000)) := by have hh := mul_le_mul_of_nonneg_left hm.2 (by have := accurateGrid_pos m; positivity : 0≤91*accurateGrid m) exact hh.trans (by simpa only [mul_assoc] using herr) have hcoverage := coverage_from_scalar_guards s D X (windowSmoothing W m) (middleBlocks a m w J) (accurateBlock m (1/20)) _ _ _ qmid qbot (by linarith only [hm.1]) (by have := windowSmoothing_pos W m; omega) (by linarith only [hX]) hprime (herrors.trans (min_le_right _ _)) (herrors.trans (min_le_left _ _)) (hccost _ _ hbotcost hbmid) (fun i => hhazard _ ((Real.exp_pos X).trans_le (hprime i).1) (hprime i).2) obtain ⟨hn,hshort,hnL,hnL',hnmax,hLmax⟩ := hint j hdata.1 hdata.2.1 have hN : Real.exp (20*X)≤(windowSmoothing W m:ℝ) := by apply le_trans _ (windowSmoothing_bounds W m).1 apply Real.exp_le_exp.mpr have hh := mul_le_mul_of_nonneg_right (pow_le_pow_right₀ (by norm_num : (1:ℝ)≤100) hw.le) (Real.exp_nonneg (m:ℝ)) dsimp only [X] nlinarith only [hh] have hNLength : batchWordLength j≤windowSmoothing W m := by have h := hsmooth ((2:ℝ)^j) (batchWordLength j) (windowSmoothing W m) hTpos (by have hh : (2:ℝ)^j≤Real.exp (21/20*X) := by rw [←Real.exp_log hTpos,Real.log_pow] exact Real.exp_le_exp.mpr hdata.2.1 linarith only [hh,Real.exp_nonneg (21/20*X)]) (Nat.cast_nonneg _) hLmax hN exact_mod_cast h.1 refine ⟨{ pre := pre++topBlocks a (J w) rest := middleBlocks a m w J++accurateBlock m (1/20) schedule := by simp only [commonBlocks,middleBlocks,hpre,List.append_assoc] T := (2:ℝ)^j nonempty := hne prime_scale := hpj large := by linarith only [hT,Real.add_one_le_exp X,hX] mean := hm.1 b := bandSize s topParameter (a*(2:ℝ)^j) topIterations n := packageRepetitions j τ := 1/4 A := X/400 η := 1/100 δ := 1/10000 u := fun i => (s.signedPrime i:ℝ)*Real.exp (-X/200) band := qtop coverage := hcoverage cap := qtop.size_cap (by linarith only [hm.1]) repetitions := hn length := batchWordLength_pos j floor := by norm_num gain := by linarith only [hX] exceptions := fun i => by positivity short := fun i => hshort.trans_le (hpj _ (s.enumeration i.2).property).1 smooth_length := hNLength smooth_error := fun i => (hsmooth _ _ _ ((Real.exp_pos X).trans_le (hprime i).1) (hprime i).2 (Nat.cast_nonneg _) hLmax hN).2 list := ?_ rate := ?_ }⟩ · intro i have hh := package_list_arithmetic hX hT ((Real.exp_pos X).trans_le (hprime i).1) (hpj _ (s.enumeration i.2).property).2 hnL dsimp only [s] at hh convert hh using 1; congr 2; ring_nf · apply package_rate_arithmetic (by linarith only [hX]) hTpos hc (by simpa only [Real.log_pow] using hdata.1) (by simpa only [Real.log_pow] using hdata.2.1) hm.2 (by convert hbsize using 1; ring) hnL' (hpcost _ _ _ (Nat.cast_nonneg _) hnmax hrestcost hT) hE end GaussianMoat end OAI