Documentation

CslibFrontier.Foundations.Data.BitString.AgreeExpect

Uniformly random bits on a set of positions #

A uniformly random word ι → Bool agrees with a given word on a set S of positions, that is, lies in a subcube of codimension |S|, with probability 2 ^ (-|S|) (BitString.expect_ite_forall_mem_eq), by the count of functions agreeing on a set (Fintype.card_filter_forall_mem_eq); this is the density half of O'Donnell, Proposition 5.24. So some bit on S takes a given value with probability 1 - 2 ^ (-|S|) (BitString.expect_ite_exists_mem_eq). Exactly m of the bits on S are true with probability C(|S|, m) / 2 ^ |S| (BitString.expect_ite_card_filter_eq).

Main results #

References #

theorem Cslib.BitString.expect_ite_forall_mem_eq {ι : Type u_1} [Fintype ι] [DecidableEq ι] (S : Finset ι) (b : ι → Bool) [DecidablePred fun (x : ι → Bool) => ∀ i ∈ S, x i = b i] :
(Finset.univ.expect fun (x : ι → Bool) => if ∀ i ∈ S, x i = b i then 1 else 0) = 2⁻¹ ^ S.card

The density of a subcube O'Donnell, Proposition 5.24: a uniformly random word agrees with b on a set S of positions with probability 2 ^ (-|S|), for every S, including S = ∅, and for any decision procedure of the event.

theorem Cslib.BitString.expect_ite_exists_mem_eq {ι : Type u_1} [Fintype ι] [DecidableEq ι] (S : Finset ι) (b : Bool) [DecidablePred fun (x : ι → Bool) => ∃ i ∈ S, x i = b] :
(Finset.univ.expect fun (x : ι → Bool) => if ∃ i ∈ S, x i = b then 1 else 0) = 1 - 2⁻¹ ^ S.card

Some bit of a set S of uniformly random bits equals b with probability 1 - 2 ^ (-|S|), for any decision procedure of the event.

theorem Cslib.BitString.expect_ite_card_filter_eq {ι : Type u_1} [Fintype ι] [DecidableEq ι] (S : Finset ι) (m : ℕ) :
(Finset.univ.expect fun (x : ι → Bool) => if {i ∈ S | x i = true}.card = m then 1 else 0) = ↑(S.card.choose m) / 2 ^ S.card

Exactly m of the bits of a set S of uniformly random bits are true with probability C(|S|, m) / 2 ^ |S|.