Enumerating bit strings #
The list BitString.enum n enumerates all n-bit strings once in binary order, least significant
bit first. This is an executable enumeration; generating its 2 ^ n entries is not asserted to
be polynomial in n.
Main definitions #
Cslib.BitString.enum: enumerate bit strings by prepending both bits to every shorter string.Cslib.BitString.enumList: the same enumeration as ordinary lists of bits.
Main results #
Cslib.BitString.mem_enum,Cslib.BitString.length_enum,Cslib.BitString.nodup_enum: the enumeration contains each bit string exactly once and has2 ^ nentries.Cslib.BitString.enum_eq_ofFn,Cslib.BitString.enumList_eq_ofFn: the enumeration lists the bit strings in the order of their numbersCslib.BitString.equivFin.
References #
Adapted from Crypto/Computational/GoldreichLevin/{Reduction,WordDecoder}.lean on the cslib
crypto branch at 5ff69ca93402e7c947208dc56396d6d86203ccd8.
Enumerate bitstrings by prepending each possible bit. This fixes an executable order.
Instances For
Each bit string occurs exactly once.