File size: 6,021 Bytes
180bc03
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
import Mathlib
import OAI.Probability.Ballisticity.Geometry.WindowProjection
import OAI.Probability.Ballisticity.Estimates.OwnMarginalOccupation

namespace OAI

section

open MeasureTheory ProbabilityTheory InformationTheory
open scoped ENNReal Classical BigOperators
namespace DirectionalTransience

lemma rawCurrentWindow_probability {d : ℕ} (e : Direction d)
    (ν : Measure (Row d)) [IsProbabilityMeasure ν]
    (Q : Measure (Environment d)) [IsProbabilityMeasure Q]
    (τ σ : Environment d → ℕ) (hτm : Measurable τ)
    (hτ : ∀ n : ℕ, MeasurableSet[rowSigma (BelowHeight (realPosition (step e)) n)] {ω | τ ω=n})
    (hσ : ∀ n : ℕ, MeasurableSet[rowSigma (BelowHeight (realPosition (step e)) n)] {ω | σ ω=n})
    (filler : Environment d) :
    IsProbabilityMeasure (rawCurrentWindow e ν Q τ σ hτm filler) := by
  unfold rawCurrentWindow
  exact (Measure.isProbabilityMeasure_map_iff
    (rawCurrentWindow_measurable e τ σ hτ hσ filler).aemeasurable).2 inferInstance

noncomputable def rawCurrentOccupation {d : ℕ} (e : Direction d)
    (ν : Measure (Row d)) (Q : Measure (Environment d))
    (t : ℕ → Environment d → ℕ) (ht : ∀ i, Measurable (t i))
    (filler : Environment d) (N m : ℕ) : Measure (RawCurrentData e × LocalUpperField e) :=
  Entropy.activeSum (Finset.range N)
    (fun i => rawCurrentWindow e ν Q (t i) (t (i+m)) (ht i) filler)
    (fun _ => {p | p.1.1 < N})

instance rawCurrentOccupation_finite {d : ℕ} (e : Direction d)
    (ν : Measure (Row d)) [IsProbabilityMeasure ν]
    (Q : Measure (Environment d)) [IsFiniteMeasure Q]
    (t : ℕ → Environment d → ℕ) (ht : ∀ i, Measurable (t i))
    (filler : Environment d) (N m : ℕ) :
    IsFiniteMeasure (rawCurrentOccupation e ν Q t ht filler N m) := by
  unfold rawCurrentOccupation rawCurrentWindow
  infer_instance

theorem rawCurrentOccupation_kl_le {d : ℕ} (e : Direction d)
    (ν : Measure (Row d)) [IsProbabilityMeasure ν]
    (Q : Measure (Environment d)) [IsProbabilityMeasure Q]
    (hfin : klDiv Q (environmentLaw ν) ≠ ∞)
    (t : ℕ → Environment d → ℕ) (htm : ∀ i, Measurable (t i))
    (ht : ∀ i n : ℕ, MeasurableSet[rowSigma (BelowHeight (realPosition (step e)) n)] {ω | t i ω=n})
    (hmono : ∀ ω, Monotone (fun i => t i ω))
    (filler : Environment d) (N m : ℕ)
    (hpos : 0 < (rawCurrentOccupation e ν Q t htm filler N m).real Set.univ) :
    haveI : Nonempty (Row d) := nonempty_of_isProbabilityMeasure ν
    let μs : FiniteMeasure (RawCurrentData e × LocalUpperField e) :=
      ⟨rawCurrentOccupation e ν Q t htm filler N m,inferInstance⟩
    klDiv (μs.normalize : Measure (RawCurrentData e × LocalUpperField e))
      ((μs.normalize : Measure (RawCurrentData e × LocalUpperField e)).fst.prod
        (Measure.infinitePi (fun _ : ℕ × HorizontalSpace e => ν))) ≤
      ENNReal.ofReal ((m:ℝ)*(klDiv Q (environmentLaw ν)).toReal /
        (rawCurrentOccupation e ν Q t htm filler N m).real Set.univ) := by
  have : Nonempty (Row d) := nonempty_of_isProbabilityMeasure ν
  let μ : ℕ → Measure (RawCurrentData e × LocalUpperField e) :=
    fun i => rawCurrentWindow e ν Q (t i) (t (i+m)) (htm i) filler
  let π := Measure.infinitePi (fun _ : ℕ × HorizontalSpace e => ν)
  let A : ℕ → Set (RawCurrentData e) := fun _ => {z | z.1 < N}
  have (i : ℕ) : IsProbabilityMeasure (μ i) :=
    rawCurrentWindow_probability e ν Q (t i) (t (i+m)) (htm i) (ht i) (ht (i+m)) filler
  have hle (i : ℕ) : klDiv (μ i) ((μ i).fst.prod π) ≤
      ownedWindowEntropy e ν Q (t i) (t (i+m)) filler :=
    rawCurrentWindow_kl_le e ν Q (t i) (t (i+m))
      (fun ω => hmono ω (Nat.le_add_right i m)) (ht i) (ht (i+m)) filler
  have hf (i : ℕ) := (ownedWindowEntropy_finite_budget e ν Q hfin (t i) (t (i+m))
    (fun ω => hmono ω (Nat.le_add_right i m)) (ht i) (ht (i+m)) filler).1
  have hkl (i : ℕ) : klDiv (μ i) ((μ i).fst.prod π) ≠ ∞ := ne_top_of_le_ne_top (hf i) (hle i)
  have h := Entropy.own_normalized_activeSum_kl_le (Finset.range N) μ π A
    (fun _ _ => measurableSet_lt measurable_fst measurable_const) (fun i _ => hkl i) hpos
  refine h.trans (ENNReal.ofReal_le_ofReal ?_)
  apply div_le_div_of_nonneg_right _ hpos.le
  calc
    _ ≤ ∑ i ∈ Finset.range N, (ownedWindowEntropy e ν Q (t i) (t (i+m)) filler).toReal :=
      Finset.sum_le_sum fun i _ => ENNReal.toReal_mono (hf i) (hle i)
    _ ≤ _ := sum_actual_stopped_window_entropy e ν Q hfin t ht hmono filler N m

theorem currentOccupation_kl_le {d : ℕ} (e : Direction d)
    (ν : Measure (Row d)) [IsProbabilityMeasure ν]
    (Q : Measure (Environment d)) [IsProbabilityMeasure Q]
    (hfin : klDiv Q (environmentLaw ν) ≠ ∞)
    (t : ℕ → Environment d → ℕ) (htm : ∀ i, Measurable (t i))
    (ht : ∀ i n : ℕ, MeasurableSet[rowSigma (BelowHeight (realPosition (step e)) n)] {ω | t i ω=n})
    (hmono : ∀ ω, Monotone (fun i => t i ω))
    (filler : Environment d) (N m : ℕ)
    (hpos : 0 < (rawCurrentOccupation e ν Q t htm filler N m).real Set.univ) :
    let μs : FiniteMeasure (RawCurrentData e × LocalUpperField e) :=
      ⟨rawCurrentOccupation e ν Q t htm filler N m,inferInstance⟩
    haveI : Nonempty (Row d) := nonempty_of_isProbabilityMeasure ν
    let out := (μs.normalize : Measure (RawCurrentData e × LocalUpperField e)).map (rawCurrentProjection e)
    klDiv out (out.fst.compProd (currentWindowReference e ν)) ≤
      ENNReal.ofReal ((m:ℝ)*(klDiv Q (environmentLaw ν)).toReal /
        (rawCurrentOccupation e ν Q t htm filler N m).real Set.univ) := by
  have : Nonempty (Row d) := nonempty_of_isProbabilityMeasure ν
  let μs : FiniteMeasure (RawCurrentData e × LocalUpperField e) :=
    ⟨rawCurrentOccupation e ν Q t htm filler N m,inferInstance⟩
  exact (rawCurrentProjection_kl_le e ν (μs.normalize : Measure _)).trans
    (rawCurrentOccupation_kl_le e ν Q hfin t htm ht hmono filler N m hpos)

end DirectionalTransience

end

end OAI