Buckets:
| import Mathlib.Tactic.Linarith | |
| import OAI.Computability.UniqueGames.Foundations.FiniteTrialsLemmas | |
| namespace OAI | |
| section | |
| /-! Finite shared randomness is an actual convex mixture of distributions. -/ | |
| namespace UniqueGamesTheorem.Foundations.Games.FiniteDistribution | |
| open scoped BigOperators | |
| noncomputable section | |
| variable {Seed Ω : Type*} [Fintype Seed] [Fintype Ω] | |
| def mixture (seedLaw : FiniteDistribution Seed) | |
| (laws : Seed → FiniteDistribution Ω) : FiniteDistribution Ω where | |
| weight x := ∑ seed, seedLaw.weight seed * (laws seed).weight x | |
| nonnegative x := Finset.sum_nonneg fun seed _ => | |
| mul_nonneg (seedLaw.nonnegative seed) ((laws seed).nonnegative x) | |
| normalized := by | |
| rw [Finset.sum_comm] | |
| simp_rw [← Finset.mul_sum, (laws _).normalized, mul_one] | |
| exact seedLaw.normalized | |
| theorem probability_mixture (seedLaw : FiniteDistribution Seed) | |
| (laws : Seed → FiniteDistribution Ω) (event : Ω → Bool) : | |
| (seedLaw.mixture laws).probability event = | |
| ∑ seed, seedLaw.weight seed * (laws seed).probability event := by | |
| unfold probability mixture | |
| calc | |
| _ = ∑ x, ∑ seed, | |
| seedLaw.weight seed * (if event x then (laws seed).weight x else 0) := by | |
| apply Finset.sum_congr rfl | |
| intro x _ | |
| cases event x <;> simp | |
| _ = _ := by | |
| rw [Finset.sum_comm] | |
| apply Finset.sum_congr rfl | |
| intro seed _ | |
| rw [Finset.mul_sum] | |
| theorem probability_mixture_le (seedLaw : FiniteDistribution Seed) | |
| (laws : Seed → FiniteDistribution Ω) (event : Ω → Bool) (bound : ℝ) | |
| (h : ∀ seed, (laws seed).probability event ≤ bound) : | |
| (seedLaw.mixture laws).probability event ≤ bound := by | |
| rw [probability_mixture] | |
| calc | |
| _ ≤ ∑ seed, seedLaw.weight seed * bound := | |
| Finset.sum_le_sum fun seed _ => | |
| mul_le_mul_of_nonneg_left (h seed) (seedLaw.nonnegative seed) | |
| _ = bound := by rw [← Finset.sum_mul, seedLaw.normalized, one_mul] | |
| end | |
| end UniqueGamesTheorem.Foundations.Games.FiniteDistribution | |
| end | |
| section | |
| /-! Exact finite total variation and its event-probability bound. -/ | |
| namespace UniqueGamesTheorem.Foundations.Games.FiniteDistribution | |
| open scoped BigOperators | |
| noncomputable section | |
| variable {Ω : Type*} [Fintype Ω] | |
| def totalVariation (μ ν : FiniteDistribution Ω) : ℝ := | |
| (∑ x, |μ.weight x - ν.weight x|) / 2 | |
| theorem totalVariation_nonnegative (μ ν : FiniteDistribution Ω) : | |
| 0 ≤ μ.totalVariation ν := | |
| div_nonneg (Finset.sum_nonneg fun _ _ => abs_nonneg _) (by norm_num) | |
| theorem totalVariation_comm (μ ν : FiniteDistribution Ω) : | |
| μ.totalVariation ν = ν.totalVariation μ := by | |
| unfold totalVariation | |
| congr 1 | |
| apply Finset.sum_congr rfl | |
| intro x _ | |
| exact abs_sub_comm _ _ | |
| /-- A one-sided event difference is bounded by half the total absolute mass | |
| difference. Normalization is used; the full absolute-mass sum would lose a | |
| factor of two needed in the repetition argument. -/ | |
| theorem probability_sub_le_totalVariation (μ ν : FiniteDistribution Ω) | |
| (event : Ω → Bool) : | |
| μ.probability event - ν.probability event ≤ μ.totalVariation ν := by | |
| have pointwise (x : Ω) : | |
| 2 * ((if event x then μ.weight x else 0) - | |
| (if event x then ν.weight x else 0)) ≤ | |
| |μ.weight x - ν.weight x| + (μ.weight x - ν.weight x) := by | |
| have h₁ := le_abs_self (μ.weight x - ν.weight x) | |
| have h₂ := neg_le_abs (μ.weight x - ν.weight x) | |
| cases event x <;> simp only [Bool.false_eq_true, ↓reduceIte] <;> linarith | |
| have summed := Finset.sum_le_sum (s := Finset.univ) fun x _ => pointwise x | |
| simp only [← Finset.mul_sum, Finset.sum_add_distrib, Finset.sum_sub_distrib, | |
| μ.normalized, ν.normalized, sub_self, add_zero] at summed | |
| unfold probability totalVariation | |
| linarith | |
| theorem probability_abs_sub_le_totalVariation (μ ν : FiniteDistribution Ω) | |
| (event : Ω → Bool) : | |
| |μ.probability event - ν.probability event| ≤ μ.totalVariation ν := by | |
| apply abs_le.mpr | |
| constructor | |
| · have h := ν.probability_sub_le_totalVariation μ event | |
| rw [totalVariation_comm] at h | |
| linarith | |
| · exact μ.probability_sub_le_totalVariation ν event | |
| theorem probability_le_add_totalVariation (μ ν : FiniteDistribution Ω) | |
| (event : Ω → Bool) : | |
| μ.probability event ≤ ν.probability event + μ.totalVariation ν := by | |
| have h := μ.probability_sub_le_totalVariation ν event | |
| linarith | |
| end | |
| end UniqueGamesTheorem.Foundations.Games.FiniteDistribution | |
| end | |
| end OAI | |
Xet Storage Details
- Size:
- 4.51 kB
- Xet hash:
- 02f272991fc93ead7e70151bc0044eef4b1d6fab186614075cb5eb9640d143bd
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.