import Mathlib import OAI.Probability.Ballisticity.Geometry.WindowWeak import OAI.Probability.Ballisticity.Estimates.BadOccupationLimit import OAI.Probability.Ballisticity.Stationary.BadArraySampling namespace OAI section open MeasureTheory ProbabilityTheory InformationTheory Filter open scoped ENNReal NNReal Classical Topology namespace DirectionalTransience namespace OperationalConstants variable {d : ℕ} {ν : Measure (Row d)} {e f : Direction d} {D : ℝ} lemma paddedTimes_stopping [IsProbabilityMeasure ν] (C : OperationalConstants ν e f D) (hef : e.1≠f.1) (N : ℕ) (i : ℤ) (n : ℕ) : MeasurableSet[rowSigma (BelowHeight (realPosition (step e)) n)] {ω | C.paddedTimes hef N ω i=n} := episodeBoundary_height_event (k:=C.k) e f hef (episodeScaleRadius ν e f) C.fexp C.g C.χ C.b C.sfloor C.radius_nonneg N i.toNat n lemma paddedTimes_mono [IsProbabilityMeasure ν] (C : OperationalConstants ν e f D) (hef : e.1≠f.1) (N : ℕ) (ω : Environment d) : Monotone (fun i : ℕ => C.paddedTimes hef N ω i) := by simpa only [paddedTimes,EpisodeChainLedger.arrayTime_nat] using episodeBoundary_mono (k:=C.k) e f hef (episodeScaleRadius ν e f) C.fexp C.g C.χ C.b C.sfloor C.radius_nonneg N ω lemma paddedTimes_active [IsProbabilityMeasure ν] (C : OperationalConstants ν e f D) (hef : e.1≠f.1) (N i : ℕ) (ω : Environment d) : C.paddedTimes hef N ω i C.occupation hef (Ns n) ((environmentLaw ν)[|badCrossingEvent e (Ns n) (1/2)])) atTop (𝓝 ρ)) (m : ℕ) : klDiv (actualCurrentLaw e m ρ : Measure (CurrentWindow e)) (currentReferenceLaw e ν (actualCurrentLaw e m ρ) : Measure (CurrentWindow e)) ≤ ENNReal.ofReal ((m:ℝ)*C.windowEntropyConstant) := actualCurrentLaw_kl_weak_limit e ν m _ ρ hlim (fun n => C.bad_occupation_currentOffsets hef (Ns n) (hN n) (hmass n)) ((m:ℝ)*C.windowEntropyConstant) (mul_nonneg (Nat.cast_nonneg m) (C.windowEntropyConstant_nonneg hD)) (fun n => C.bad_window_kl_le hef hD (Ns n) m (hN n) (hlarge n) (hmass n)) end OperationalConstants end DirectionalTransience end end OAI