P is uniform polynomial time on the word RAM #
A problem decided by a fixed word-RAM program in polynomially many instructions is in P, through
the simulation of the word RAM by multi-tape Turing machines
(Cslib.WordRAM.Program.ComputesInTime.turingComputableInPolyTime_of_width). The instance is the
bit string encIn a; its word list must be computable from it in polynomial time, and the size
measure must be polynomially bounded in its length. The conventions are those of the simulation:
unit-cost instructions on w-bit words, the input placed as in State.init, and a word size
computed by the simulating machine.
Conversely, every problem in P is decided by one fixed word-RAM program over Basis.additive, in
polynomially many instructions, at every word size above a logarithmic threshold, through the
simulation of multi-tape Turing machines by the word RAM (Cslib.WordRAM.OfTuring). The instance
is given as its bits, (encIn a).map Bool.toNat, and its size is |encIn a|. So P is
Cslib.WordRAM.UniformPolynomialTime for these conventions, over Basis.additive,
Basis.arithmetic and Basis.standard alike: the class does not depend on the machine model.
Main results #
Cslib.WordRAM.Program.DecidesInTime.mem_P_of_width: a decider at a polynomial-time width schedule.Cslib.WordRAM.Program.DecidesInTime.mem_P: a decider withinT (size a)instructions at every word size abovelogWidth k (size a).Cslib.WordRAM.UniformPolynomialTime.mem_P: uniform polynomial word-RAM time is inP.Cslib.WordRAM.uniformPolynomialTime_of_mem_P:Pis uniform polynomial time overBasis.additive, on the input bits.Cslib.WordRAM.mem_P_iff_uniformPolynomialTime:Pis uniform polynomial time over any basis containingBasis.additivewhose operations are polynomial-time;Cslib.WordRAM.mem_P_iff_uniformPolynomialTime_additive,Cslib.WordRAM.mem_P_iff_uniformPolynomialTime_arithmeticandCslib.WordRAM.mem_P_iff_uniformPolynomialTime_standardinstantiate it.
A word-RAM decider at a polynomial-time width schedule places its problem in P. The
width width a must be computable in unary in polynomial time and admitted, the input must fit
it, its word list must be computable in polynomial time, and the time bound at that width must be
polynomial in |encIn a|.
A polynomial-time word-RAM decider places its problem in P. The program decides A
within T (size a) instructions at every fitting word size above logWidth k (size a), the word
list encode a is computable in polynomial time from encIn a, and size a is polynomially
bounded in |encIn a|.
Uniform polynomial word-RAM time is in P, for a width-independent word encoding
computable in polynomial time and a size measure polynomially bounded in the encoded input
length.
P on the word RAM #
A problem in P is decided in uniform polynomial time on the word RAM. The decider is
the simulator (Cslib.WordRAM.OfTuring.simProgram) of a polynomial-time machine deciding the
problem, over Basis.additive, run on the bits (encIn a).map Bool.toNat of the instance. It
answers within simTime of the machine's time bound, a polynomial in |encIn a|, at every word
size above logWidth K |encIn a| for a constant K: the words then hold the addresses of the
simulated tapes and the one-bit output.
P is uniform polynomial time on the word RAM, over any basis B containing
Basis.additive whose checked operations are polynomial-time: a problem is in P exactly when
one fixed word-RAM program over B decides it on the bits of its instances, within polynomially
many instructions in |encIn a|, at every word size above a logarithmic threshold.
P is uniform polynomial time over Basis.additive.
P is uniform polynomial time over Basis.arithmetic.
P is uniform polynomial time over Basis.standard.