import Mathlib import OAI.Probability.Ballisticity.Entropy.OccupationEntropy2 namespace OAI section open MeasureTheory ProbabilityTheory InformationTheory open scoped ENNReal Classical BigOperators namespace DirectionalTransience lemma actualCurrentWindow_restricted_law {d : ℕ} (e : Direction d) (ν : Measure (Row d)) [IsProbabilityMeasure ν] (Q : Measure (Environment d)) [IsFiniteMeasure Q] (t : Environment d → ℤ → ℕ) (ht : ∀ i, Measurable fun ω => t ω i) (i : ℤ) (m N : ℕ) (hi : ∀ n : ℕ, MeasurableSet[rowSigma (BelowHeight (realPosition (step e)) n)] {ω | t ω i=n}) (him : ∀ n : ℕ, MeasurableSet[rowSigma (BelowHeight (realPosition (step e)) n)] {ω | t ω (i+m)=n}) (filler : Environment d) : ((rawCurrentWindow e ν Q (fun ω => t ω i) (fun ω => t ω (i+m)) (ht i) filler).restrict {p | p.1.1 t ω i) (hst : ∀ (i : ℤ) (n : ℕ), MeasurableSet[rowSigma (BelowHeight (realPosition (step e)) n)] {ω | t ω i=n}) (filler : Environment d) (N m : ℕ) : (rawCurrentOccupation e ν Q (fun i ω => t ω i) (fun i => ht i) filler N m).map (rawCurrentProjection e) = ∑ i ∈ Finset.range N, ((episodeInputLaw e ν Q t ht).restrict {X | t X.1.1 i