File size: 2,923 Bytes
a2ee19a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
import Mathlib
import OAI.Probability.GaussianRegression.Main
import OAI.Probability.MemoryPrecision.KernelEvaluation

namespace OAI

open MeasureTheory ProbabilityTheory Set Filter EuclideanGeometry
open scoped ENNReal NNReal RealInnerProductSpace Topology Pointwise

noncomputable section
universe u v


open MeasureTheory ProbabilityTheory Set Filter
open scoped ENNReal NNReal RealInnerProductSpace Topology Pointwise
namespace MemoryPrecision.Kernel

lemma seed_average_bound {X Y : Type*} {Ω : Type u} [MeasurableSpace X] [MeasurableSpace Y]
    [MeasurableSpace Ω] (π : Measure X) [SFinite π] (ν : Measure Y) [SFinite ν]
    (ρ : Measure Ω) [IsProbabilityMeasure ρ]
    {f : X × (Ω × Y) → ℝ≥0∞}
    (hf : AEMeasurable f (π.prod (ρ.prod ν))) {B : ℝ≥0∞}
    (hb : ∀ᵐ ω ∂ρ, (∫⁻ z : X × Y, f (z.1,(ω,z.2)) ∂π.prod ν) ≤ B) :
    (∫⁻ z, f z ∂π.prod (ρ.prod ν)) ≤ B := by
  have hp := ((MeasurePreserving.id π).prod
      (Measure.measurePreserving_swap (μ := ν) (ν := ρ))).comp
    (measurePreserving_prodAssoc π ν ρ)
  let g : (X × Y) × Ω → ℝ≥0∞ := fun z => f (z.1.1,(z.2,z.1.2))
  have hg : AEMeasurable g ((π.prod ν).prod ρ) :=
    hf.comp_quasiMeasurePreserving hp.quasiMeasurePreserving
  have he : (∫⁻ z, g z ∂(π.prod ν).prod ρ) = ∫⁻ z, f z ∂π.prod (ρ.prod ν) := by
    rw [← hp.map_eq]
    exact (lintegral_map' (by simpa only [hp.map_eq] using hf) hp.measurable.aemeasurable).symm
  rw [← he, lintegral_prod_symm _ hg]
  exact (lintegral_mono_ae hb).trans_eq (by simp)

namespace Policy
variable {d M T : ℕ}
lemma success_le_one {Ω : Type u} [MeasurableSpace Ω] (L : Ω → Policy d M T)
    (ρ : Measure Ω) [IsProbabilityMeasure ρ] (π : Measure (Sphere d)) [IsProbabilityMeasure π]
    (ε : ℝ) : Success L ρ π ε ≤ 1 := by
  have : IsProbabilityMeasure (RowLaw d T) := by unfold RowLaw; infer_instance
  unfold Success experiment
  calc
    _ ≤ ∫⁻ _z : Sphere d × (Ω × Rows d T), (1 : ℝ≥0∞) ∂π.prod (ρ.prod (RowLaw d T)) :=
      lintegral_mono (fun z => (L z.2.1).pathValue_le_one _
        ((L z.2.1).outputTest_le_one (angleTest_le_one ε)) z.1 (records z.1 z.2.2))
    _ = 1 := by simp
lemma chordSuccess_le_one {Ω : Type u} [MeasurableSpace Ω] (L : Ω → Policy d M T)
    (ρ : Measure Ω) [IsProbabilityMeasure ρ] (π : Measure (Sphere d)) [IsProbabilityMeasure π]
    (ε : ℝ) : ChordSuccess L ρ π ε ≤ 1 := by
  have : IsProbabilityMeasure (RowLaw d T) := by unfold RowLaw; infer_instance
  unfold ChordSuccess experiment
  calc
    _ ≤ ∫⁻ _z : Sphere d × (Ω × Rows d T), (1 : ℝ≥0∞) ∂π.prod (ρ.prod (RowLaw d T)) :=
      lintegral_mono (fun z => (L z.2.1).pathValue_le_one _
        ((L z.2.1).outputTest_le_one (chordTest_le_one ε)) z.1 (records z.1 z.2.2))
    _ = 1 := by simp
end Policy
end MemoryPrecision.Kernel


end

end OAI