Independent blocks of uniform bit lists #
Reading a uniform list of count * width bits as fixed-width rows gives exactly count
independent uniform bit strings. This includes zero-width rows and zero rows.
Main results #
Cslib.BitString.uniformList_ofList: a uniform list gives a uniform finite bit string.Cslib.BitString.uniformList_blocks: fixed-width blocks are jointly uniform.Cslib.BitString.uniformList_listRows: the same law for the ordinary list-of-lists program.Cslib.BitString.uniformList_replaceRow: replacing one row with an independent uniform row preserves uniformity.Cslib.BitString.uniformList_map_listXor,Cslib.BitString.uniformList_map_listXor_length,Cslib.BitString.uniformList_map_zipWith_xor,Cslib.BitString.uniformList_map_take_zipWith_xor: XOR with a fixed word preserves uniformity (both inlistXor m [y, r]and directList.zipWith Bool.xor y rforms).
References #
Adapted from Probability/WordBits.lean on the cslib crypto branch at
5ff69ca93402e7c947208dc56396d6d86203ccd8, using the shared block representation.
A uniform list gives exactly a uniform finite bit string.
Disjoint fixed-width blocks of a uniform list are jointly uniform.
Extracting fixed-width rows realizes the joint law of independent uniform seeds.
XORing a uniform m-bit word with any word r preserves the uniform distribution; see
uniformList_map_zipWith_xor and uniformList_map_take_zipWith_xor for the direct
List.zipWith Bool.xor y r form alongside listXor m [y, r].
Pointwise List.zipWith Bool.xor of a uniform msg.length-bit word with a fixed word msg
preserves uniformList msg.length (the direct List.zipWith Bool.xor y r counterpart to
uniformList_map_listXor's listXor m [y, r]).
Pointwise List.zipWith Bool.xor of pad.take n for a uniform n-bit word pad with an
n-bit word msg preserves uniformList n.
Replacing row j < count of a uniform count * width-bit string with an independent uniform
width-bit string preserves the uniform distribution uniformList (count * width).