File size: 5,462 Bytes
4a56cd6
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
110
111
112
113
114
115
116
117
118
import OAI.Probability.GaussianRegression.Stream
import OAI.Probability.GaussianRegression.Sphere

namespace OAI

/-!
Spherical cap mass bounds along sequential routes.
-/

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

noncomputable section

universe u

namespace NoiselessRegression

section StreamCaps
variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E]
  [FiniteDimensional ℝ E] [MeasurableSpace E] [BorelSpace E] [Nontrivial E]
variable {J : Type*} [Fintype J] [MeasurableSpace J] [MeasurableSingletonClass J] [Nonempty J]

def capWeight (y : E) (Ξ΅ : ℝ) : E β†’ ℝβ‰₯0∞ :=
  (Metric.closedBall y Ξ΅).indicator (fun _ => 1)

omit [InnerProductSpace ℝ E] [FiniteDimensional ℝ E] [Nontrivial E] in
lemma measurable_capWeight (y : E) (Ξ΅ : ℝ) : Measurable (capWeight y Ξ΅) :=
  measurable_const.indicator Metric.isClosed_closedBall.measurableSet

omit [InnerProductSpace ℝ E] [FiniteDimensional ℝ E] [MeasurableSpace E] [BorelSpace E] [Nontrivial E] in
lemma capWeight_le_one (y s : E) (Ξ΅ : ℝ) : capWeight y Ξ΅ s ≀ 1 := by
  classical
  simp only [capWeight, Set.indicator_apply]
  split <;> simp

lemma capWeight_mass (y : E) {Ξ΅ : ℝ} (hΞ΅ : 0 < Ξ΅) (a : β„•)
    (ha : 2*a ≀ Module.finrank ℝ E - 1) :
    PolynomialMass ((ambientSphereLaw (E := E)).withDensity (capWeight y Ξ΅)) a
      (ENNReal.ofReal ((3 : ℝ)*4^Module.finrank ℝ E) * ENNReal.ofReal (Ξ΅^a)) := by
  change PolynomialMass ((ambientSphereLaw (E := E)).withDensity ((Metric.closedBall y Ξ΅).indicator 1)) a _
  rw [withDensity_indicator_one Metric.isClosed_closedBall.measurableSet]
  exact fun z r hr => terminal_cap_mass y z hΞ΅ hr a ha

lemma ambient_mass_bound {f : E β†’ ℝβ‰₯0∞} {a : β„•} {C : ℝβ‰₯0∞}
    (h : PolynomialMass ((ambientSphereLaw (E := E)).withDensity f) a C) :
    (∫⁻ s, f s βˆ‚ambientSphereLaw) ≀ C := by
  rw [← setLIntegral_univ, ← withDensity_apply _ MeasurableSet.univ]
  apply (measure_mono_ae ?_).trans (by simpa using h 0 1 zero_lt_one)
  filter_upwards [(withDensity_absolutelyContinuous (ambientSphereLaw (E := E)) f).ae_le
    (ambientSphereLaw_ae_norm (E := E))] with s hs
  intro _
  change dist s 0 ≀ 1
  simp [dist_zero_right, hs]

lemma continuation_cap_integral_bound {Ξ΄ : β„• β†’ J β†’ (E Γ— ℝ) β†’ J}
    (hΞ΄ : βˆ€ n j, Measurable (Ξ΄ n j)) (y : β„• β†’ J β†’ E)
    {Ξ΅ : ℝ} (hΞ΅ : 0 < Ξ΅) {a q : β„•} (ha : 2*a ≀ Module.finrank ℝ E - 1)
    (hq : 2 ≀ q) (hqa : 2*q ≀ a) (n k : β„•) (j : J) :
    (∫⁻ s, continuation Ξ΄ (fun n j => capWeight (y n j) Ξ΅) n k j s βˆ‚ambientSphereLaw) ≀
      (ENNReal.ofReal ((3 : ℝ)*4^Module.finrank ℝ E) * ENNReal.ofReal (Ξ΅^a)) *
        streamFactor (E := E) (J := J) q ^ (k/q+1) := by
  apply ambient_mass_bound
  apply continuation_mass_bound _ hΞ΄ (fun n j => measurable_capWeight _ _)
    (fun n j s => capWeight_le_one _ _ _)
    (mul_ne_zero (by positivity) (by positivity)) (ENNReal.mul_ne_top ENNReal.ofReal_ne_top ENNReal.ofReal_ne_top)
    (fun n j => capWeight_mass (y n j) hΞ΅ a ha)
    (Module.finrank_pos (R := ℝ) (M := E)) (by omega) hq hqa

lemma route_cap_bound {Ξ΄ : β„• β†’ J β†’ (E Γ— ℝ) β†’ J}
    (hΞ΄ : βˆ€ n j, Measurable (Ξ΄ n j)) (y : J β†’ E)
    {Ξ΅ : ℝ} (hΞ΅ : 0 < Ξ΅) {a q : β„•} (ha : 2*a ≀ Module.finrank ℝ E - 1)
    (hq : 2 ≀ q) (hqa : 2*q ≀ a) (k : β„•) (j : J) :
    ((sphereLaw (E := E)).prod (Measure.pi (fun _ : Fin k => stdGaussian E)))
      {z | dist z.1.val (y (streamRoute Ξ΄ 0 k j (z.2,fun i => βŸͺz.1.val,z.2 i⟫))) ≀ Ξ΅} ≀
      (ENNReal.ofReal ((3 : ℝ)*4^Module.finrank ℝ E) * ENNReal.ofReal (Ξ΅^a)) *
        streamFactor (E := E) (J := J) q ^ (k/q+1) := by
  let w : β„• β†’ J β†’ E β†’ ℝβ‰₯0∞ := fun _ j => capWeight (y j) Ξ΅
  have hV := measurable_continuation (w := w) hΞ΄ (fun _ j => measurable_capWeight (y j) Ξ΅) 0 k j
  have he (s : E) : continuation Ξ΄ w 0 k j s =
      ∫⁻ A : Fin k β†’ E, capWeight (y (streamRoute Ξ΄ 0 k j (A,fun i => βŸͺs,A i⟫))) Ξ΅ s
        βˆ‚Measure.pi (fun _ => stdGaussian E) := by
    simpa [w, blockValue, continuation] using continuation_unroll (w := w) hΞ΄ 0 k 0 j s
  let S : Set ((Metric.sphere (0 : E) 1) Γ— (Fin k β†’ E)) :=
    {z | dist z.1.val (y (streamRoute Ξ΄ 0 k j (z.2,fun i => βŸͺz.1.val,z.2 i⟫))) ≀ Ξ΅}
  have hS : MeasurableSet S := by
    apply measurableSet_le _ measurable_const
    exact measurable_subtype_coe.comp measurable_fst |>.dist
      ((measurable_of_finite y).comp ((measurable_streamRoute hΞ΄ 0 k j).comp (by fun_prop)))
  change ((sphereLaw (E := E)).prod _) S ≀ _
  rw [← one_mul (((sphereLaw (E := E)).prod _) S), ← lintegral_indicator_const hS 1,
    lintegral_prod _ (measurable_const.indicator hS).aemeasurable]
  have hf : βˆ€ s : Metric.sphere (0 : E) 1,
      (∫⁻ A, S.indicator (fun _ => (1 : ℝβ‰₯0∞)) (s,A) βˆ‚Measure.pi (fun _ => stdGaussian E)) =
        continuation Ξ΄ w 0 k j s.val := by
    intro s
    rw [he]
    apply lintegral_congr
    intro A
    classical
    change (if dist s.val (y (streamRoute Ξ΄ 0 k j (A,fun i => βŸͺs.val,A i⟫))) ≀ Ξ΅ then 1 else 0) = _
    unfold capWeight
    rw [Set.indicator_apply]
    rfl
  simp_rw [hf]
  rw [← lintegral_map hV measurable_subtype_coe]
  exact continuation_cap_integral_bound hΞ΄ (fun _ => y) hΞ΅ ha hq hqa 0 k j

end StreamCaps

end NoiselessRegression

end

end OAI