Binary lengths of natural numbers #
The binary encoding encNat of a number has Nat.size digits, so numbers below 2 ^ p have at
most p 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_of_lt_two_pow: numbers below2 ^ phave at mostpdigits.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_pow_add_two: the shifted bound for(N + 2) ^ d, including an empty original input.Turing.MultiTapeTM.length_encNat_le_of_le_mul_pow: the corresponding bound with a constant coefficient.