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:
- Sequential heterogeneous segments (
uniformList_map_split,uniformList_map_split3, and suffix projectionuniformList_drop): splitting a uniform tape of total lengthn₁ + n₂orn₁ + (n₂ + n₃)along nestedtake/dropoffsets yields independent uniform segments, including when any segment has width zero. - Homogeneous block rows (
uniformList_map_listRows): mapping any evaluatorf : List Bool → αoverlistRows count widthof acount * width-bit uniform tape realizescountindependent draws from(uniformList width).map f(PMF.iid), without requiringαto be finite.
Main results #
Cslib.BitString.uniformList_map_split,Cslib.BitString.uniformList_map_split3: two- and three-segmentPMF.mapsplitting laws foruniformList.Cslib.BitString.uniformList_drop: dropping ak-bit prefix fromuniformList (k + n)givesuniformList n.Cslib.BitString.uniformList_map_listRows: mapping an evaluator overlistRows count widthgives(PMF.iid ((uniformList width).map f) count).map List.ofFn.
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.
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.