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
|