File size: 5,252 Bytes
9b6e014
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
import Mathlib
import OAI.Probability.Ballisticity.Entropy.WindowEntropy
import OAI.Probability.Ballisticity.Estimates.ClosedEmbeddingWeak
import OAI.Probability.Ballisticity.Estimates.ReferenceFeller
import OAI.Probability.Ballisticity.Entropy.EntropyContinuousTests

namespace OAI

section

open MeasureTheory ProbabilityTheory InformationTheory TopologicalSpace Filter
open scoped ENNReal Classical Topology
namespace DirectionalTransience

instance currentDataProfiles_secondCountable {d : ℕ} (e : Direction d) :
    SecondCountableTopology (ReferenceClasses.Data (HorizontalSpace e) × CurrentProfiles e) := inferInstance
instance currentDataProfiles_compact {d : ℕ} (e : Direction d) :
    CompactSpace (ReferenceClasses.Data (HorizontalSpace e) × CurrentProfiles e) := inferInstance
instance currentFields_compact {d : ℕ} (e : Direction d) :
    CompactSpace (ReferenceClasses.AllFields (HorizontalSpace e) (Row d)) := inferInstance
instance currentWindow_compact {d : ℕ} (e : Direction d) : CompactSpace (CurrentWindow e) := inferInstance
instance currentWindow_secondCountable {d : ℕ} (e : Direction d) : SecondCountableTopology (CurrentWindow e) := inferInstance

instance currentWindow_opens {d : ℕ} (e : Direction d) : OpensMeasurableSpace (CurrentWindow e) := inferInstance
instance currentDataProfiles_borel {d : ℕ} (e : Direction d) :
    BorelSpace (ReferenceClasses.Data (HorizontalSpace e) × CurrentProfiles e) := inferInstance
instance currentDataProfiles_opens {d : ℕ} (e : Direction d) :
    OpensMeasurableSpace (ReferenceClasses.Data (HorizontalSpace e) × CurrentProfiles e) := inferInstance

lemma actualCurrentLaw_include {d : ℕ} (e : Direction d) (m : ℕ)
    (L : ProbabilityMeasure (ActualEpisodeArray e))
    (hc : ∀ᵐ Y ∂(L : Measure (ActualEpisodeArray e)), ReferenceClasses.Consistent (currentOffsets e 0 Y)) :
    (actualCurrentLaw e m L).map (currentWindowInclude e) =
      L.map (currentArrayWindow e 0 m) := by
  apply Subtype.ext
  change ((L : Measure _).map (typedCurrentArrayWindow e 0 m)).map (currentWindowInclude e) = _
  rw [Measure.map_map (currentWindowInclude_continuous e).measurable (typedCurrentArrayWindow_measurable e 0 m)]
  apply Measure.map_congr
  filter_upwards [hc] with Y hY
  exact currentWindowInclude_typed e 0 m Y hY

lemma actualCurrentLaw_tendsto {d : ℕ} (e : Direction d) (m : ℕ)
    (Ls : ℕ → ProbabilityMeasure (ActualEpisodeArray e)) (L : ProbabilityMeasure (ActualEpisodeArray e))
    (hlim : Tendsto Ls atTop (𝓝 L))
    (hc : ∀ n, ∀ᵐ Y ∂(Ls n : Measure (ActualEpisodeArray e)), ∀ j, ReferenceClasses.Consistent (currentOffsets e j Y)) :
    Tendsto (fun n => actualCurrentLaw e m (Ls n)) atTop (𝓝 (actualCurrentLaw e m L)) := by
  have hL := closed_support_weak_limit Ls L hlim _ (currentOffsets_closed e) hc
  apply Entropy.tendsto_of_map_closedEmbedding (currentWindowInclude e)
    ((currentWindowInclude_continuous e).isClosedEmbedding (currentWindowInclude_injective e))
  have hi (n : ℕ) := actualCurrentLaw_include e m (Ls n) ((hc n).mono fun _ h => h 0)
  simp_rw [hi,actualCurrentLaw_include e m L (hL.mono fun _ h => h 0)]
  exact ProbabilityMeasure.tendsto_map_of_tendsto_of_continuous Ls L hlim
    (currentArrayWindow_continuous e 0 m)

noncomputable def currentReferenceLaw {d : ℕ} (e : Direction d)
    (ν : Measure (Row d)) [IsProbabilityMeasure ν] (W : ProbabilityMeasure (CurrentWindow e)) :
    ProbabilityMeasure (CurrentWindow e) :=
  Entropy.compProdProb (W.map Prod.fst) (currentWindowReference e ν)

lemma currentReferenceLaw_tendsto {d : ℕ} (e : Direction d)
    (ν : Measure (Row d)) [IsProbabilityMeasure ν]
    {I : Type*} {l : Filter I} {Ws : I → ProbabilityMeasure (CurrentWindow e)} {W : ProbabilityMeasure (CurrentWindow e)}
    (h : Tendsto Ws l (𝓝 W)) :
    Tendsto (fun n => currentReferenceLaw e ν (Ws n)) l (𝓝 (currentReferenceLaw e ν W)) := by
  have hK : Continuous (Entropy.kernelProb (currentWindowReference e ν)) :=
    (ReferenceClasses.referenceProb_continuous ν).comp continuous_fst
  exact Entropy.compProdProb_tendsto (currentWindowReference e ν) hK
    (ProbabilityMeasure.tendsto_map_of_tendsto_of_continuous Ws W h continuous_fst)

theorem actualCurrentLaw_kl_weak_limit {d : ℕ} (e : Direction d)
    (ν : Measure (Row d)) [IsProbabilityMeasure ν] (m : ℕ)
    (Ls : ℕ → ProbabilityMeasure (ActualEpisodeArray e)) (L : ProbabilityMeasure (ActualEpisodeArray e))
    (hlim : Tendsto Ls atTop (𝓝 L))
    (hc : ∀ n, ∀ᵐ Y ∂(Ls n : Measure (ActualEpisodeArray e)), ∀ j, ReferenceClasses.Consistent (currentOffsets e j Y))
    (C : ℝ) (hC : 0≤C)
    (hb : ∀ n, klDiv (actualCurrentLaw e m (Ls n) : Measure (CurrentWindow e))
      (currentReferenceLaw e ν (actualCurrentLaw e m (Ls n)) : Measure (CurrentWindow e)) ≤ ENNReal.ofReal C) :
    klDiv (actualCurrentLaw e m L : Measure (CurrentWindow e))
      (currentReferenceLaw e ν (actualCurrentLaw e m L) : Measure (CurrentWindow e)) ≤ ENNReal.ofReal C := by
  have ht := actualCurrentLaw_tendsto e m Ls L hlim hc
  exact Entropy.kl_le_of_weak_limit _ _ _ _ ht (currentReferenceLaw_tendsto e ν ht) hC (Filter.Eventually.of_forall hb)

end DirectionalTransience

end

end OAI