File size: 6,181 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
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
import Mathlib
import OAI.Computability.VertexCover.Fourier.SourceOccurrences
import OAI.Computability.VertexCover.Analysis.OwnPrivateListsDecoding

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.LabelCover
open MeasureTheory

theorem listHitMaximum_measurable {E : Type*} [MeasurableSpace E]
    (Φ : LabelCover) {d : ℕ} (L : E → Φ.PrivateLists d)
    (hL : ∀ i (a : i.LocalLabel), MeasurableSet {x | a ∈ L x i})
    (seed : Φ.Seeds d) (J : Finset (Fin d)) :
    Measurable (fun x => Φ.listHitMaximum (L x) seed J) := by
  classical
  have hhit : ∀ I : Finset (Φ.Coordinate d), ∀ j : Fin d,
      MeasurableSet {x | Φ.ListHit (L x) seed I j} := by
    intro I j
    change MeasurableSet {x | ∃ a : (Φ.query seed j).LocalLabel,
      a ∈ L x (Φ.query seed j) ∧ (⟨Φ.query seed j, a⟩ : Φ.Coordinate d) ∈ I}
    simp only [Set.ofPred_exists]
    apply MeasurableSet.iUnion
    intro a
    exact (hL _ a).inter (MeasurableSet.const _)
  have hcard : ∀ I : Finset (Φ.Coordinate d),
      Measurable (fun x => (Φ.hitPositions (L x) seed I J).card) := by
    intro I
    simp only [hitPositions, Finset.card_filter]
    apply Finset.measurable_sum
    intro j _
    exact Measurable.ite (hhit I j) measurable_const measurable_const
  have hsup : ∀ S : Finset (Finset (Φ.Coordinate d)),
      Measurable (fun x => S.sup (fun I => (Φ.hitPositions (L x) seed I J).card)) := by
    intro S
    induction S using Finset.induction_on with
    | empty => simp
    | @insert I S hi ih =>
      simp only [Finset.sup_insert]
      exact (hcard I).sup ih
  exact hsup _

theorem ownPrivateLists_hits_integrable (Φ : LabelCover) {d : ℕ}
    (J : Finset (Fin d)) (frozen seed : Φ.Seeds d) (c0 : Φ.Coordinate d → ℝ)
    (A : Finset (Φ.Coordinate d → ℝ)) (hA : A.Nonempty) (β : ℝ) :
    Integrable (fun s => (Φ.listHitMaximum
      (Φ.ownPrivateLists J frozen c0 A hA s β) seed J : ℝ)) (Φ.batchLaw J) := by
  classical
  have hmeas := Φ.listHitMaximum_measurable
    (fun s => Φ.ownPrivateLists J frozen c0 A hA s β)
    (Φ.ownPrivateLists_membership_measurable J frozen c0 A hA β) seed J
  have hcast : Measurable (fun s => (Φ.listHitMaximum
      (Φ.ownPrivateLists J frozen c0 A hA s β) seed J : ℝ)) :=
    (measurable_of_countable (fun n : ℕ => (n : ℝ))).comp hmeas
  apply Integrable.of_bound hcast.aestronglyMeasurable (J.card : ℝ)
  filter_upwards [] with s
  rw [Real.norm_eq_abs, abs_of_nonneg (Nat.cast_nonneg _)]
  apply Nat.cast_le.mpr
  apply Finset.sup_le
  intro I _
  exact Finset.card_le_card (Finset.filter_subset _ _)

end VertexCover.LabelCover

namespace VertexCover.Product
open MeasureTheory

theorem update_measurePreserving {ι E : Type*} [Fintype ι] [DecidableEq ι]
    [MeasurableSpace E] (μ : Measure E) [IsProbabilityMeasure μ] (j : ι) :
    MeasurePreserving (fun p : E × (ι → E) => Function.update p.2 j p.1)
      (μ.prod (Measure.pi (fun _ : ι => μ))) (Measure.pi (fun _ : ι => μ)) := by
  have hm : Measurable (fun p : E × (ι → E) => Function.update p.2 j p.1) :=
    Measurable.of_eval (fun k => by
      by_cases hk : k = j
      · subst k; simpa using measurable_fst
      · simpa only [Function.update_of_ne hk, Function.comp_def] using
          (measurable_pi_apply k).comp measurable_snd)
  refine ⟨hm, (Measure.pi_eq (fun S hS => ?_)).symm⟩
  rw [Measure.map_apply hm (MeasurableSet.univ_pi hS)]
  have hpre : (fun p : E × (ι → E) => Function.update p.2 j p.1) ⁻¹' Set.univ.pi S =
      S j ×ˢ Set.univ.pi (Function.update S j Set.univ) := by
    ext p
    simp only [Set.mem_preimage, Set.mem_univ_pi, Set.mem_prod]
    constructor
    · intro hp
      refine ⟨?_, ?_⟩
      · simpa using hp j
      · intro k
        by_cases hk : k = j
        · subst k; simp
        · simpa [Function.update_of_ne hk] using hp k
    · rintro ⟨hp, hq⟩ k
      by_cases hk : k = j
      · subst k; simpa using hp
      · simpa [Function.update_of_ne hk] using hq k
  rw [hpre, Measure.prod_prod, Measure.pi_pi]
  have hfun : (fun k => μ (Function.update S j Set.univ k)) =
      Function.update (fun k => μ (S k)) j 1 := by
    funext k
    by_cases hk : k = j <;> simp [hk]
  rw [hfun, Finset.prod_update_of_mem (Finset.mem_univ j), one_mul]
  simpa only [Finset.sdiff_singleton_eq_erase] using
    Finset.mul_prod_erase Finset.univ (fun k => μ (S k)) (Finset.mem_univ j)

theorem update_ae {ι E : Type*} [Fintype ι] [DecidableEq ι]
    [MeasurableSpace E] (μ : Measure E) [IsProbabilityMeasure μ] (j : ι)
    {P : (ι → E) → Prop} (hP : ∀ᵐ s ∂Measure.pi (fun _ : ι => μ), P s) :
    ∀ᵐ x ∂μ, ∀ᵐ s ∂Measure.pi (fun _ : ι => μ), P (Function.update s j x) := by
  exact Measure.ae_ae_of_ae_prod ((update_measurePreserving μ j).quasiMeasurePreserving.ae hP)

theorem integral_update {ι E : Type*} [Fintype ι] [DecidableEq ι]
    [MeasurableSpace E] (μ : Measure E) [IsProbabilityMeasure μ] (j : ι)
    {f : (ι → E) → ℝ} (hf : Integrable f (Measure.pi (fun _ : ι => μ))) :
    (∫ x, ∫ s, f (Function.update s j x) ∂Measure.pi (fun _ : ι => μ) ∂μ) =
      ∫ s, f s ∂Measure.pi (fun _ : ι => μ) := by
  have hp := update_measurePreserving μ j
  calc
    _ = ∫ p, f (Function.update p.2 j p.1)
        ∂(μ.prod (Measure.pi (fun _ : ι => μ))) := by
      simpa only [Function.comp_apply] using
        (integral_prod _ (hp.integrable_comp_of_integrable hf)).symm
    _ = ∫ s, f s ∂Measure.map (fun p : E × (ι → E) => Function.update p.2 j p.1)
        (μ.prod (Measure.pi (fun _ : ι => μ))) := by
      exact (integral_map hp.measurable.aemeasurable
        (by simpa only [hp.map_eq] using hf.aestronglyMeasurable)).symm
    _ = _ := by rw [hp.map_eq]

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