import YM.OPE.Log.Grid import YM.RG05Readout.Aligned.Lengths /-! # Procurement for WM observation geometry Λ=2+log(hatBeta) is NOT a power of the physical spacing logarithm and observations must not be moved by polynomial powers of inverse coupling at will. `brackets` supplies the spatial capture geometry at the ACTUAL admitted WM radii, with constants for finite fixed shapes. Need an extra step relative to the enclosing cell in this version of `Ballet`. Doesn't yet purchase the analytic (e.g. log-price for the overshoot) bounds then needed for qpta. The `Plot` estimate is for *aligned* offset in this first version; scale and hull calculations here useful for both. -/ set_option autoImplicit false noncomputable section namespace YM.RG05Readout open Filter Topology Set Function open scoped Topology BigOperators ContDiff Classical variable {ι : Type} {l:Filter ι} {m j:ι→ℕ} {S:Schedule} {T r : ι→ℝ} open OPE private lemma spacing_inf (S:Schedule) (e:ℝ) : ∃ i:ℕ,e < S.scale i:= (S.divergent.eventually_gt_atTop e).exists /-- least stop with spacing BELOW a given positive physical length. -/ def crossLevel (S:Schedule)(r:ℝ):ℕ:= Nat.find (spacing_inf S (-Real.log r)) lemma pace_crossing (hp:S.Gentle)(ht:Tendsto T l atTop)(hr:RateIs l T r (-1)) : let p i:=crossLevel S (r i) Height S l T p 1 ∧ ∀ᶠ i in l, S.a (p i)< r i ∧ r i ≤ S.a (p i-1):=by intro p; let a i := -Real.log (r i) have h : Tendsto r l (𝓝[>] 0) := tendsto_nhdsWithin_iff.mpr ⟨hr.tends neg_one_lt_zero ht, hr.pos⟩ have he := run_towards h have hz : Tendsto (fun i=>a i/T i) l (𝓝 1):=by simp only [a,neg_div]; simpa only [neg_neg] using hr.rate.neg -- inspect have hv(i): a i < S.scale (p i):= Nat.find_spec (spacing_inf S (a i)) have hξ := found_up he hz S hp obtain ⟨q,hq,hQ⟩:= hξ have hx:Tendsto p l atTop:=tendsto_atTop.mpr fun j=>by filter_upwards [he.eventually_ge_atTop (S.scale j)] with i hi exact (scale_mono S).le_iff_le.mp (le_trans hi (hv i).le) constructor · exact ⟨hx, tendsto_of_tendsto_of_tendsto_of_le_of_le' hz hq.pace ((ht.eventually_gt_atTop 0).mono (fun i hi=> div_le_div_of_nonneg_right (hv i).le hi.le)) ((ht.eventually_gt_atTop 0).mono (fun i hi=> div_le_div_of_nonneg_right ((scale_mono S).monotone (show p i ≤ q i from Nat.find_min' _ (hQ i))) hi.le))⟩ filter_upwards [hr.pos,hx.eventually_gt_atTop 0] with i hi hJ constructor · apply (Real.log_lt_log_iff (S.a_pos _) hi).mp apply neg_lt_neg_iff.mp rw [← Real.log_inv (S.a (p i))]; exact hv _ apply (Real.log_le_log_iff hi (S.a_pos _)).mp apply neg_le_neg_iff.mp; rw [← Real.log_inv] exact not_lt.mp (Nat.find_min (spacing_inf S (a i)) (show p i-1
Lambda X (j i)) 0 := by
-- hat budget from schedule, not from un-hatted representation
have hx : RateLE l T (fun i=> X.clock.hatBeta (j i)) 0 := by
have hr : RateIs l T (fun i=>X.clock.hatBeta (j i)) 0:= by
let u:= X.clock.hatBeta; have he:Tendsto (fun i=>Real.log (u i)/X.S.scale i) atTop (𝓝 0):= (Work.I04.hat_receipt X hG).tendsto_div_nhds_zero
have hp : MergeProof.Ribbons.Note X.S u 0:= ⟨fun i=>zero_lt_one.trans (X.fits.delayed _),he⟩
exact height0 hp hj
exact hr.pays ht
refine RateIs.of_sandwich (RateIs.const ht two_pos)
((RateLE.const (2:ℝ) ht).add hx ht) (Eventually.of_forall fun i=> (lambda_gt X _).le) ?_ ht
exact Eventually.of_forall fun i=> add_le_add_right (Real.log_le_self (zero_le_one.trans (X.fits.delayed _).le)) _
lemma budgetW (X:Levels G)(m:ℕ): ((X.budget m).B : ℝ) < Lambda X m ^ (2:ℕ):=by
let x:= Real.log (X.clock.hatBeta m)
have hh:0