Documentation

CslibFrontier.Probability.PMF.UniformPoint

Hitting a point with a draw #

Testing a draw from p with an arbitrary decidable predicate P accepts with probability p.toOuterMeasure {x | P x} (bind_pure_decide_apply_true). Testing a draw from μ for equality with a fixed point a accepts with probability μ a (bind_pure_decide_eq_apply_true, map_decide_eq_apply_true). The unprimed bind form and the uniform form test a = x; bind_pure_decide_eq_apply_true' and the map form test x = a. For a uniform draw from a nonempty finite type α this is (Fintype.card α)⁻¹ (uniformOfFintype_bind_decide_eq_apply_true). More generally, a Boolean test that accepts at most one value accepts a uniform draw with probability at most (Fintype.card α)⁻¹ (uniformOfFintype_bind_pure_apply_true_le), and so does a set with at most one member (toOuterMeasure_uniformOfFintype_le_of_subsingleton). Guessing games use this bound: an adversary whose view is independent of a uniform secret guesses it with probability at most 1 / |α|, and so does any test comparing the secret with an injective image of the draw.

Main results #

theorem Cslib.Probability.PMF.bind_pure_decide_apply_true {β : Type u_1} (p : PMF β) (P : β → Prop) [DecidablePred P] :
(p.bind fun (x : β) => PMF.pure (decide (P x))) true = p.toOuterMeasure {x : β | P x}

The probability that decide (P x) is true is the measure of {x | P x}.

theorem Cslib.Probability.PMF.bind_pure_decide_eq_apply_true {β : Type u_1} [DecidableEq β] (μ : PMF β) (a : β) :
(μ.bind fun (x : β) => PMF.pure (decide (a = x))) true = μ a

Testing a draw from μ for equality with a fixed a accepts with probability μ a.

theorem Cslib.Probability.PMF.bind_pure_decide_eq_apply_true' {β : Type u_1} [DecidableEq β] (μ : PMF β) (a : β) :
(μ.bind fun (x : β) => PMF.pure (decide (x = a))) true = μ a

bind_pure_decide_eq_apply_true with the comparison written the other way round.

theorem Cslib.Probability.PMF.map_decide_eq_apply_true {β : Type u_1} [DecidableEq β] (μ : PMF β) (a : β) :
(PMF.map (fun (x : β) => decide (x = a)) μ) true = μ a

bind_pure_decide_eq_apply_true for the pushforward of μ under the equality test.

A uniform draw from α equals a fixed a with probability (Fintype.card α)⁻¹.

theorem Cslib.Probability.PMF.uniformOfFintype_bind_pure_apply_true_le {α : Type u_1} [Fintype α] [Nonempty α] {E : α → Bool} (hE : {x : α | E x = true}.Subsingleton) :
((uniformOfFintype α).bind fun (x : α) => PMF.pure (E x)) true ≤ (↑(Fintype.card α))⁻¹

A Boolean test that accepts at most one value accepts a uniform draw from α with probability at most (Fintype.card α)⁻¹.

A uniform draw from α lands in a set with at most one member with probability at most (Fintype.card α)⁻¹.