File size: 4,147 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 | import Mathlib
import OAI.Computability.VertexCover.Information.Finite
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
namespace UniqueGames.Foundations.Information
open scoped BigOperators
variable {α β : Type*} [Fintype α] [Fintype β]
theorem totalVariation_joint_common_weights (w : α → ℝ) (p q : α → β → ℝ)
(hw : ∀ a, 0 ≤ w a) :
totalVariation (fun ab : α × β => w ab.1 * p ab.1 ab.2)
(fun ab : α × β => w ab.1 * q ab.1 ab.2) =
∑ a, w a * totalVariation (p a) (q a) := by
have hpoint : ∀ a b, |w a * p a b - w a * q a b| = w a * |p a b - q a b| := by
intro a b
rw [← mul_sub, abs_mul, abs_of_nonneg (hw a)]
simp only [totalVariation, Fintype.sum_prod_type, hpoint, ← Finset.mul_sum,
div_eq_mul_inv, Finset.sum_mul, mul_assoc]
theorem totalVariation_joint_common_kernel (p q : α → ℝ) (k : α → β → ℝ)
(hk : ∀ a, IsProbability (k a)) :
totalVariation (fun ab : α × β => p ab.1 * k ab.1 ab.2)
(fun ab : α × β => q ab.1 * k ab.1 ab.2) = totalVariation p q := by
have hpoint : ∀ a b, |p a * k a b - q a * k a b| = |p a - q a| * k a b := by
intro a b
rw [← sub_mul, abs_mul, abs_of_nonneg ((hk a).1 b)]
simp only [totalVariation, Fintype.sum_prod_type, hpoint, ← Finset.mul_sum,
(hk _).2, mul_one]
theorem totalVariation_condition_le (p q : α → ℝ) (event : α → Prop)
[DecidablePred event] {«c» : ℝ} (hc : 0 < «c») :
totalVariation (fun a => if event a then p a / «c» else 0)
(fun a => if event a then q a / «c» else 0) ≤ totalVariation p q / «c» := by
have hpoint : ∀ a, |(if event a then p a / «c» else 0) -
(if event a then q a / «c» else 0)| ≤ |p a - q a| / «c» := by
intro a
by_cases he : event a
· simp only [ite_eq_left he, ← sub_div, abs_div, abs_of_pos hc, le_refl]
· simp only [ite_eq_right he, sub_self, abs_zero]
exact div_nonneg (abs_nonneg _) hc.le
have hsum := Finset.sum_le_sum (fun a (_ : a ∈ (Finset.univ : Finset α)) => hpoint a)
simp only [div_eq_mul_inv, ← Finset.sum_mul] at hsum
have hd := div_le_div_of_nonneg_right hsum (show (0 : ℝ) ≤ 2 by norm_num)
have hreorder : ((∑ a, |p a - q a|) * «c»⁻¹) / 2 =
((∑ a, |p a - q a|) / 2) / «c» := by ring
rw [hreorder] at hd
simpa only [totalVariation, div_eq_mul_inv] using hd
theorem weighted_coordinate_sum_sq_le
(w : α → ℝ) (d : α → β → ℝ) (C : α → ℝ)
(hw : IsProbability w)
(hbudget : ∀ a, w a * (∑ b, d a b ^ 2) ≤ w a * C a) :
(∑ b, ∑ a, w a * d a b)^2 ≤
(Fintype.card β : ℝ) * (∑ a, w a * C a) := by
have hv := Finset.sum_le_sum
(fun b (_ : b ∈ (Finset.univ : Finset β)) =>
weighted_sum_sq_le w (fun a => d a b) hw)
have he :
(∑ b, ∑ a, w a * d a b ^ 2) =
∑ a, w a * (∑ b, d a b ^ 2) := by
rw [Finset.sum_comm]
simp only [Finset.mul_sum]
rw [he] at hv
have hb := Finset.sum_le_sum
(fun a (_ : a ∈ (Finset.univ : Finset α)) => hbudget a)
have hs := hv.trans hb
have hcs := Finset.sum_mul_sq_le_sq_mul_sq
(Finset.univ : Finset β)
(fun b => ∑ a, w a * d a b) (fun _ => (1 : ℝ))
simp only [mul_one, one_pow, Finset.sum_const,
Finset.card_univ, nsmul_eq_mul, mul_one] at hcs
calc
(∑ b, ∑ a, w a * d a b)^2
≤ (∑ b, (∑ a, w a * d a b)^2) *
(Fintype.card β : ℝ) := hcs
_ = (Fintype.card β : ℝ) *
(∑ b, (∑ a, w a * d a b)^2) := mul_comm _ _
_ ≤ (Fintype.card β : ℝ) * (∑ a, w a * C a) :=
mul_le_mul_of_nonneg_left hs (Nat.cast_nonneg _)
end UniqueGames.Foundations.Information
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
|