File size: 5,744 Bytes
92416a2
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
import Mathlib
import OAI.Computability.VertexCover.Analysis.VarianceProduct

namespace OAI

section
section
section
section
section
section
section
section
section
section
section
section
section
section
section
section
section
section
section
section
section
section
section
section
section
section
section
section
section
section
section
section
namespace VertexCover.Product
open MeasureTheory ProbabilityTheory
open scoped ENNReal

variable {X : Type*} [MeasurableSpace X]
variable (μ : Measure X) [IsProbabilityMeasure μ]

theorem cons_measurePreserving (n : ℕ) :
    MeasurePreserving (fun p : X × (Fin n → X) => Fin.cons p.1 p.2)
      (μ.prod (Measure.pi (fun _ : Fin n => μ))) (Measure.pi (fun _ : Fin (n+1) => μ)) := by
  simpa [MeasurableEquiv.piFinSuccAbove_symm_apply, Fin.insertNthEquiv,
    Fin.insertNth_zero', Fin.zero_succAbove] using
    (measurePreserving_piFinSuccAbove (fun _ : Fin (n+1) => μ) 0).symm

theorem integral_cons (n : ℕ) (f : (Fin (n+1) → X) → ℝ)
    (hi : Integrable f (Measure.pi (fun _ => μ))) :
    ∫ v, f v ∂Measure.pi (fun _ : Fin (n+1) => μ) =
      ∫ x, ∫ s, f (Fin.cons x s) ∂Measure.pi (fun _ : Fin n => μ) ∂μ := by
  have hp := cons_measurePreserving μ n
  calc
    _ = ∫ p : X × (Fin n → X), f (Fin.cons p.1 p.2) ∂μ.prod (Measure.pi (fun _ => μ)) := by
      rw [← hp.map_eq]
      exact integral_map hp.aemeasurable (by rw [hp.map_eq]; exact hi.aestronglyMeasurable)
    _ = _ := integral_prod _ (hp.integrable_comp_of_integrable hi)

noncomputable def coordinateVariance {n : ℕ} (f : (Fin n → X) → ℝ)
    (j : Fin n) (s : Fin n → X) : ℝ :=
  variance (fun x => f (Function.update s j x)) μ

theorem update_joint_measurable {n : ℕ} (j : Fin n) :
    Measurable (fun p : (Fin n → X) × X => Function.update p.1 j p.2) := by
  apply Measurable.of_eval
  intro k
  by_cases hk : k = j
  · subst k; simpa using measurable_snd
  · simpa only [Function.update_of_ne hk, Function.comp_def] using (measurable_pi_apply k).comp measurable_fst

theorem coordinateVariance_integrable {n : ℕ} (f : (Fin n → X) → ℝ)
    (hf : Measurable f) {C : ℝ} (hb : ∀ s, ‖f s‖ ≤ C) (j : Fin n) :
    Integrable (coordinateVariance μ f j) (Measure.pi (fun _ : Fin n => μ)) :=
  section_variance_integrable _ μ _ (hf.comp (update_joint_measurable j)) (fun _s _x => hb _)

theorem variance_pi_le (n : ℕ) (f : (Fin n → X) → ℝ) (hf : Measurable f)
    {C : ℝ} (hb : ∀ s, ‖f s‖ ≤ C) :
    variance f (Measure.pi (fun _ : Fin n => μ)) ≤
      ∑ j, ∫ s, coordinateVariance μ f j s ∂Measure.pi (fun _ : Fin n => μ) := by
  induction n with
  | zero =>
      have he : f = fun _ => f (fun i => Fin.elim0 i) := by
        funext s
        exact congrArg f (Subsingleton.elim _ _)
      rw [he, variance_eq_integral measurable_const.aemeasurable]
      simp
  | succ n ih =>
      let P := Measure.pi (fun _ : Fin n => μ)
      let F : X → (Fin n → X) → ℝ := fun x s => f (Fin.cons x s)
      have hF : Measurable (Function.uncurry F) := hf.comp (cons_measurePreserving μ n).measurable
      have hFb : ∀ x s, ‖F x s‖ ≤ C := fun x s => hb _
      have hsec : ∀ x, Measurable (F x) := fun x => hF.comp (measurable_const.prodMk measurable_id)
      have hpre : variance f (Measure.pi (fun _ : Fin (n+1) => μ)) ≤
          (∫ x, variance (F x) P ∂μ) + ∫ s, variance (fun x => F x s) μ ∂P := by
        rw [← (cons_measurePreserving μ n).variance_fun_comp hf.aemeasurable]
        exact variance_product_le μ P F hF hFb
      have hci := fun j : Fin (n+1) => coordinateVariance_integrable μ f hf hb j
      have hstep : ∀ x s (j : Fin n),
          coordinateVariance μ (F x) j s = coordinateVariance μ f j.succ (Fin.cons x s) := by
        intro x s j
        unfold coordinateVariance F
        simp only [Fin.cons_update]
      have hIi : ∀ j : Fin n, Integrable
          (fun x => ∫ s, coordinateVariance μ (F x) j s ∂P) μ := by
        intro j
        simp_rw [hstep]
        exact ((cons_measurePreserving μ n).integrable_comp_of_integrable (hci j.succ)).integral_prod_left
      have ht : (∫ x, variance (F x) P ∂μ) ≤
          ∑ j : Fin n, ∫ s, coordinateVariance μ f j.succ s ∂Measure.pi (fun _ => μ) := by
        calc
          _ ≤ ∫ x, ∑ j : Fin n, ∫ s, coordinateVariance μ (F x) j s ∂P ∂μ := by
            apply integral_mono (section_variance_integrable μ P F hF hFb)
              (integrable_finsetSum _ (fun j _ => hIi j))
            intro x
            exact ih (F x) (hsec x) (hFb x)
          _ = _ := by
            rw [integral_finsetSum _ (fun j _ => hIi j)]
            apply Finset.sum_congr rfl
            intro j hj
            simp_rw [hstep]
            exact (integral_cons μ n _ (hci j.succ)).symm
      have hz : (∫ s, variance (fun x => F x s) μ ∂P) =
          ∫ s, coordinateVariance μ f 0 s ∂Measure.pi (fun _ : Fin (n+1) => μ) := by
        rw [integral_cons μ n _ (hci 0)]
        simp only [coordinateVariance, Fin.update_cons_zero]
        simp only [F, integral_const, probReal_univ, one_smul]
        rfl
      calc
        _ ≤ (∫ x, variance (F x) P ∂μ) + ∫ s, variance (fun x => F x s) μ ∂P := hpre
        _ ≤ (∑ j : Fin n, ∫ s, coordinateVariance μ f j.succ s ∂Measure.pi (fun _ => μ)) +
            ∫ s, coordinateVariance μ f 0 s ∂Measure.pi (fun _ => μ) := by
          rw [← hz]
          exact add_le_add ht le_rfl
        _ = _ := by rw [Fin.sum_univ_succ]; exact add_comm _ _

end VertexCover.Product


end
end
end
end
end
end
end
end
end
end
end
end
end
end
end
end
end
end
end
end
end
end
end
end
end
end
end
end
end
end
end
end

end OAI