Binary values, prefixes and the order of words #
Facts relating the most-significant-first value Cslib.BitString.binaryValue of a word to
concatenation, prefixes and the lexicographic order of words of equal length.
Main definitions #
Cslib.BitString.predWord: the word of the same length whose value is one less.
Main results #
Cslib.BitString.binaryValue_append: the value of a concatenation.Cslib.BitString.binaryValue_lt_iff_lt,Cslib.BitString.binaryValue_le_iff_le: on words of equal length, the numeric order is the lexicographic order.Cslib.BitString.isPrefix_iff_binaryValue: the words with prefixhamong the words of lengthNare those whose values lie in the block[v(h) 2^(N-|h|), (v(h) + 1) 2^(N-|h|)).Cslib.BitString.binaryValue_succ_carry,Cslib.BitString.exists_carry_cut,Cslib.BitString.carry_cut_unique: big-endian+ 1carry-cut decomposition before the rightmostfalsebit (adapted from VP ≠ VNP over every field [AnthropicVPVNP2026],Nc.Uni.Bin).
The value of a concatenation: the first word is shifted by the length of the second.
The value of a word with a leading bit.
Padding a word with k ones: the value plus one is multiplied by 2 ^ k.
Prefix blocks. Among words of length at least |h|, the words with prefix h are those
whose value lies in [v(h) 2^(N-|h|), (v(h) + 1) 2^(N-|h|)), for N their length.
An all-false binary word has value 0.
Re-encoding a word's binaryValue at its own width recovers the word.
Zero padded to width L is List.replicate L false.
Adding 1 to a big-endian word flips trailing false :: true^k to true :: false^k.