Binary lengths of natural numbers #
The binary encoding encNat of a number has Nat.size digits. Numbers at most N have at most
log₂ N + 1 digits, and numbers at most (N + 1) ^ d at most (d + 1) * (log₂ N + 1): counters
bounded by a polynomial in the length of the input are stored in logarithmic space.
Main results #
Turing.MultiTapeTM.length_encNat_le_log2: numbers at mostNhave at mostlog₂ N + 1digits.Turing.MultiTapeTM.length_encNat_le_log2_add_two: numbers at mostN + 1have at mostlog₂ N + 2digits.Turing.MultiTapeTM.length_encNat_le_of_le_pow: numbers at most(N + 1) ^ dhave at most(d + 1) * (log₂ N + 1)digits.Turing.MultiTapeTM.length_encNat_le_of_le_mul_pow: the corresponding bound with a constant coefficient.