Documentation

CslibFrontier.Probability.BitString.UniformSplit

Multi-segment and block-row splitting of uniform bit lists #

Saved-coin evaluators parse one flat uniform tape into sequential segments with List.take and List.drop, and into fixed-width blocks with BitString.listRows. This module lifts BitString.uniformList_bind_split and BitString.uniformList_listRows directly to PMF.map and PMF.iid, avoiding manual unfolding of PMF.map into PMF.pure binds:

Main results #

theorem Cslib.BitString.uniformList_map_split {α : Type u_1} (n₁ n₂ : ℕ) (f : List Bool → List Bool → α) :
PMF.map (fun (tape : List Bool) => f (List.take n₁ tape) (List.drop n₁ tape)) (uniformList (n₁ + n₂)) = (uniformList n₁).bind fun (s₁ : List Bool) => PMF.map (f s₁) (uniformList n₂)

Mapping a two-argument evaluator across the n₁-bit prefix and n₂-bit suffix of a uniform (n₁ + n₂)-bit tape gives two independent uniform segments, including when either width is zero.

Dropping a k-bit prefix from a uniform (k + n)-bit word leaves a uniform n-bit word, with no condition on the discarded prefix.

theorem Cslib.BitString.uniformList_map_split3 {α : Type u_1} (n₁ n₂ n₃ : ℕ) (f : List Bool → List Bool → List Bool → α) :
PMF.map (fun (tape : List Bool) => f (List.take n₁ tape) (List.take n₂ (List.drop n₁ tape)) (List.drop n₂ (List.drop n₁ tape))) (uniformList (n₁ + (n₂ + n₃))) = (uniformList n₁).bind fun (s₁ : List Bool) => (uniformList n₂).bind fun (s₂ : List Bool) => PMF.map (f s₁ s₂) (uniformList n₃)

Mapping a three-argument evaluator across sequential take/drop slices of widths n₁, n₂, and n₃ gives three independent uniform segments.

theorem Cslib.BitString.uniformList_map_listRows {α : Type u_1} (count width : ℕ) (f : List Bool → α) :
PMF.map (fun (w : List Bool) => List.map f (listRows count width w)) (uniformList (count * width)) = PMF.map List.ofFn (Probability.PMF.iid (PMF.map f (uniformList width)) count)

Mapping an evaluator f over the count fixed-width width-bit rows of a uniform (count * width)-bit tape realizes count independent draws from (uniformList width).map f, including at zero rows or zero width and without requiring α to be finite.