Exponentials of polynomial-time exponents #
For an exponent L x computable in unary in polynomial time, 2 ^ L x is computable in unary
within time O(2 ^ |x| + 4 ^ L x) and space O(2 ^ |x| + 2 ^ L x)
(Turing.MultiTapeTM.ComputableInPolyTime.exists_computableInO_unary_two_pow): compute L x,
then double L x times (Turing.MultiTapeTM.ComputableInO.unary_two_pow). The polynomial cost
of computing the exponent is absorbed by 2 ^ |x|
(Turing.MultiTapeTM.PolyBounded.exists_le_mul_two_pow).
Padding. If f is polynomial-time on pairs (a, N) with N in unary, then
a ↦ f (a, 2 ^ ν a) is computable within time and space C 2 ^ (D ν a) (|a| + 1) ^ D, for an
exponent ν computable in unary in polynomial time
(Turing.MultiTapeTM.ComputableInPolyTime.exists_computableInO_pad). This turns a polynomial-time
algorithm on padded inputs into a 2 ^ O(ν a)-time algorithm on the original input.
Main results #
Turing.MultiTapeTM.ComputableInPolyTime.exists_computableInO_unary_two_pow:2 ^ L xin unary within exponential time and space.Turing.MultiTapeTM.ComputableInPolyTime.exists_computableInO_pad: polynomial time on inputs padded by2 ^ ν agives time and space2 ^ O(ν a)times a polynomial in|a|.
2 ^ L x in unary, for an exponent L x computable in unary in polynomial time, within
time O(2 ^ |x| + 4 ^ L x) and space O(2 ^ |x| + 2 ^ L x).
Polynomial time on padded inputs. If f is polynomial-time on pairs (a, N) with N in
unary, then a ↦ f (a, 2 ^ ν a) is computable within time and space C 2 ^ (D ν a) (|a| + 1) ^ D,
for an exponent ν computable in unary in polynomial time: write the padding 2 ^ ν a in unary,
then run f.