Documentation

Complexity.Probability.BitString.List

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 #

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.

theorem Cslib.BitString.uniformList_blocks (count width : ℕ) :
PMF.map (fun (word : List Bool) => (ofList (count * width) word).block) (uniformList (count * width)) = Probability.PMF.uniformOfFintype (Fin count → BitString width)

Disjoint fixed-width blocks of a uniform list are jointly uniform.

theorem Cslib.BitString.uniformList_listRows (count width : ℕ) :
PMF.map (listRows count width) (uniformList (count * width)) = PMF.map (fun (rows : Fin count → BitString width) => List.ofFn fun (i : Fin count) => List.ofFn (rows i)) (Probability.PMF.uniformOfFintype (Fin count → BitString width))

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.