File size: 4,700 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
import Mathlib

namespace OAI

noncomputable section

open Set MeasureTheory

open scoped BigOperators

namespace SparseWitness

attribute [local instance] Classical.propDecidable

lemma joint_witness_bound {Ξ© E I : Type*} [MeasurableSpace Ξ©]
    [Fintype I] [DecidableEq E] {T : I β†’ Type*} [βˆ€ i, Fintype (T i)]
    (ΞΌ : Measure Ξ©) [IsFiniteMeasure ΞΌ] (test : E β†’ Set Ξ©)
    (edges : βˆ€ i, T i β†’ Finset E) (q : ℝ) (_hq : 0 ≀ q)
    (joint : βˆ€ F : Finset E, ΞΌ.real {Ο‰ | βˆ€ e ∈ F, Ο‰ ∈ test e} ≀ q^F.card)
    (disj : βˆ€ i j, i β‰  j β†’ βˆ€ s t, Disjoint (edges i s) (edges j t)) :
    ΞΌ.real {Ο‰ | βˆ€ i, βˆƒ t, βˆ€ e ∈ edges i t, Ο‰ ∈ test e} ≀
      ∏ i, βˆ‘ t, q^(edges i t).card := by
  classical
  have hsub : {Ο‰ | βˆ€ i, βˆƒ t, βˆ€ e ∈ edges i t, Ο‰ ∈ test e} βŠ†
      ⋃ t : βˆ€ i, T i, {Ο‰ | βˆ€ e ∈ Finset.univ.biUnion (fun i => edges i (t i)), Ο‰ ∈ test e} := by
    intro ω hω
    choose t ht using hω
    refine Set.mem_iUnion.mpr ⟨t,?_⟩
    intro e he
    obtain ⟨i,hi,he⟩ := Finset.mem_biUnion.mp he
    exact ht i e he
  calc
    _ ≀ ΞΌ.real (⋃ t : βˆ€ i, T i, {Ο‰ | βˆ€ e ∈ Finset.univ.biUnion (fun i => edges i (t i)), Ο‰ ∈ test e}) :=
      measureReal_mono hsub
    _ ≀ βˆ‘ t : βˆ€ i, T i, ΞΌ.real {Ο‰ | βˆ€ e ∈ Finset.univ.biUnion (fun i => edges i (t i)), Ο‰ ∈ test e} :=
      measureReal_iUnion_fintype_le _
    _ ≀ βˆ‘ t : βˆ€ i, T i, q^(Finset.univ.biUnion (fun i => edges i (t i))).card :=
      Finset.sum_le_sum (fun t _ => joint _)
    _ = βˆ‘ t : βˆ€ i, T i, ∏ i, q^(edges i (t i)).card := by
      apply Finset.sum_congr rfl
      intro t _
      rw [Finset.card_biUnion (fun i _ j _ hij => disj i j hij (t i) (t j))]
      exact (Finset.prod_pow_eq_pow_sum _ _ _).symm
    _ = _ := by simpa using (Finset.prod_univ_sum (fun i => (Finset.univ : Finset (T i)))
      (fun i t => q^(edges i t).card)).symm

lemma large_fiber {I J : Type*} [Fintype I] [Fintype J] [Nonempty J]
    (f : I β†’ J) : βˆƒ j, Fintype.card I ≀ Fintype.card J *
      (Finset.univ.filter (fun i => f i = j)).card := by
  classical
  obtain ⟨j,hj,hmax⟩ := Finset.exists_max_image Finset.univ
    (fun j => (Finset.univ.filter (fun i => f i = j)).card) Finset.univ_nonempty
  refine ⟨j,?_⟩
  calc
    Fintype.card I = βˆ‘ c : J, (Finset.univ.filter (fun i => f i = c)).card := by
      simpa using (Finset.card_eq_sum_card_fiberwise (s := (Finset.univ : Finset I))
        (t := Finset.univ) (f := f) (fun _ _ => Finset.mem_univ _))
    _ ≀ βˆ‘ _c : J, (Finset.univ.filter (fun i => f i = j)).card :=
      Finset.sum_le_sum (fun c hc => hmax c hc)
    _ = _ := by simp

lemma alternative_sparse_bound {Ξ© I J : Type*} [MeasurableSpace Ξ©]
    [Fintype I] [Fintype J] [Nonempty J]
    (ΞΌ : Measure Ξ©) [IsFiniteMeasure ΞΌ] (test : J β†’ I β†’ Set Ξ©)
    (q : ℝ) (hq : 0 < q) (hq1 : q ≀ 1)
    (joint : βˆ€ j (A : Finset I), ΞΌ.real {Ο‰ | βˆ€ i ∈ A, Ο‰ ∈ test j i} ≀ q^A.card) :
    ΞΌ.real {Ο‰ | βˆ€ i, βˆƒ j, Ο‰ ∈ test j i} ≀
      (Fintype.card J : ℝ)^(Fintype.card I) *
        q^((Fintype.card I : ℝ)/(Fintype.card J : ℝ)) := by
  classical
  have hsub : {Ο‰ | βˆ€ i, βˆƒ j, Ο‰ ∈ test j i} βŠ†
      ⋃ f : I β†’ J, {Ο‰ | βˆ€ i, Ο‰ ∈ test (f i) i} := by
    intro ω hω
    choose f hf using hω
    exact Set.mem_iUnion.mpr ⟨f,hf⟩
  have each (f : I β†’ J) : ΞΌ.real {Ο‰ | βˆ€ i, Ο‰ ∈ test (f i) i} ≀
      q^((Fintype.card I : ℝ)/(Fintype.card J : ℝ)) := by
    obtain ⟨j,hj⟩ := large_fiber f
    let A := Finset.univ.filter (fun i => f i = j)
    have hb : {Ο‰ | βˆ€ i, Ο‰ ∈ test (f i) i} βŠ† {Ο‰ | βˆ€ i ∈ A, Ο‰ ∈ test j i} := by
      intro ω hω i hi
      simpa only [(Finset.mem_filter.mp hi).2] using hω i
    have hJ : (0 : ℝ) < Fintype.card J := Nat.cast_pos.mpr Fintype.card_pos
    have hsize : (Fintype.card I : ℝ)/(Fintype.card J : ℝ) ≀ A.card := by
      apply (div_le_iffβ‚€ hJ).mpr
      have hh : (Fintype.card I : ℝ) ≀ (Fintype.card J : ℝ)*A.card := by exact_mod_cast hj
      nlinarith
    calc
      _ ≀ ΞΌ.real {Ο‰ | βˆ€ i ∈ A, Ο‰ ∈ test j i} := measureReal_mono hb
      _ ≀ q^A.card := joint j A
      _ = q^(A.card : ℝ) := (Real.rpow_natCast _ _).symm
      _ ≀ _ := Real.rpow_le_rpow_of_exponent_ge hq hq1 hsize
  calc
    _ ≀ ΞΌ.real (⋃ f : I β†’ J, {Ο‰ | βˆ€ i, Ο‰ ∈ test (f i) i}) := measureReal_mono hsub
    _ ≀ βˆ‘ f : I β†’ J, ΞΌ.real {Ο‰ | βˆ€ i, Ο‰ ∈ test (f i) i} := measureReal_iUnion_fintype_le _
    _ ≀ βˆ‘ _ : I β†’ J, q^((Fintype.card I : ℝ)/(Fintype.card J : ℝ)) :=
      Finset.sum_le_sum (fun f _ => each f)
    _ = _ := by simp

end SparseWitness

end

end OAI