Documentation

CslibFrontier.Foundations.Data.BitString.List.LowBits

Injectivity of fixed-width low-order bits #

Two naturals below 2 ^ w with the same w low-order bits (lowBits) are equal. Encodings that write a bounded number into a fixed-width field use this to decode the field uniquely.

Main results #

theorem Cslib.BitString.lowBits_injective_of_lt {w a b : ℕ} (ha : a < 2 ^ w) (hb : b < 2 ^ w) (h : lowBits w a = lowBits w b) :
a = b

lowBits w is injective on naturals strictly below 2 ^ w.