cfahlgren1's picture
download
raw
2.35 kB
import Mathlib
import OAI.Computability.VertexCover.Games.Basic
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.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 UniqueGames.Foundations.Games.FiniteDistribution
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

Xet Storage Details

Size:
2.35 kB
·
Xet hash:
e91409396ddc8692c2dc1e7168a953f48b5798f887399782acd9c0fd804ff172

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.