Digit sums for fixed-position digits #
Lemmas about the fixed-position, zero-padded digits Cslib.Radix.digit of
CslibFrontier/Foundations/Data/Nat/Radix.lean: a digit is below a positive radix, the first k
digits recover x modulo B ^ k, and the base-2 digits are the bits of Nat.testBit.
Main results #
Cslib.Radix.digit_lt: a digit is below a positive radix.Cslib.Radix.sum_digit_mul_pow:∑ i < k, B ^ i * digit B x i = x % B ^ k.Cslib.Radix.toNat_testBit_eq_digit: bitjofxis its base-2digitj.Nat.sum_two_pow_mul_testBit: summing the binary place values recovers a bounded natural.
The first k base-B digits of x recover x modulo B ^ k.