How statement and proof provenance work
The first chip identifies the source of the statement or construction; the second identifies the source of its local proof or verification.
- Literature-sourced: the exact statement appears in a cited source; only wording and notation differ.
- AI-adapted: a semantically identical restatement of literature-sourced material, modulo indexing, notation, and boundary cases adopted by the library.
- AI-generated: a genuinely novel statement formulated by AI, with no source for the claim itself.
These labels describe origin, not correctness: citations and verification chips remain separate evidence.
Resource Bounds and Machine Invariance
1 · Prerequisites
- Construction of the Natural Numbers
- Countability and Uncountability
- Finite Counting, Factorials and Binomial Coefficients
- Formal Languages, Encodings, and Decision Problems
- Linear Recurrences and Rational Generating Functions
- Relations, Functions, and Quotients
- Robust Machine Models and Universal Computation
- The ZFC Axioms and the Basic Set Constructions
- Turing Machines, Configurations, and Computation
2 · Summary
This page fixes the standard quantitative conventions of complexity theory: worst-case time and space, asymptotic comparison, constructible bounds, and the basic deterministic and nondeterministic resource classes. With those definitions in place, it separates three different quantitative phenomena that are often blurred together in loose exposition: time controls space for a fixed machine, multitape simulation can cost a quadratic slowdown on one tape, and efficient universal simulation still needs only logarithmic overhead per step.
The closing propositions explain what invariance does and does not mean. It does mean that polynomial-time and polynomial-space classes survive passage between the standard deterministic tape models, and that reasonable encoding changes preserve those classes when the translations are themselves polynomial. It does not mean literal equality of step counts, and it does not let one drop constructibility from arguments that must actually realize a time budget.
3 · Logical flowchart
4 · Definitions, theorems and proofs
Worst-case time and space complexity of a machine
Definition
Let be a deterministic -tape Turing machine. For an input word , let be the number of steps in the computation of on when that computation halts, and let be the total number of tape cells that are ever visited during that computation across all tapes.
If halts on every input of length , its worst-case time complexity and worst-case space complexity at that length are Thus both values are when the input alphabet has no words of length .
For a nondeterministic machine , a maximal branch either is infinite, ends in an accepting or rejecting state, or ends at a nonhalting configuration with no allowed transition. Suppose that every maximal branch on ends in an accepting or rejecting state. Since the computation tree is finitely branching, it then has finitely many nodes: if it had arbitrarily large depth, repeatedly taking the first child with descendants at arbitrarily large depths would produce an infinite branch. Define and as the maxima over these finitely many halting branches. The worst-case values and use the same input maxima with adjoined as above, provided the branch condition holds for every input of length .
We say that a machine runs in time at most when its worst-case time is bounded by , and runs in space at most when its worst-case space is bounded by .
Remarks
-
The time and space functions are attached to machines that halt on all inputs under consideration, which is the regime needed for complexity classes.
-
Space counts visited cells, not merely cells that happen to be nonblank in the initial input configuration.
Asymptotic comparison of resource bounds
Definition
Let . We say that is asymptotically bounded by , and write when there exist constants and such that
We say that two bounds are of the same asymptotic order when each is -bounded by the other. Fix further bounds .
If is a machine in the sense of Worst-case time and space complexity of a machine and halts on every input, then its worst-case resource functions are defined at every input length, and:
- has time complexity when ;
- has space complexity when .
Remarks
-
These comparisons forget constant factors and finite prefixes.
-
Later invariance statements are about preservation of classes under this asymptotic relation, not equality of exact running times.
Time-constructible and space-constructible functions
Definition
Let .
The function is time-constructible when there exists a deterministic machine such that, on unary input , the machine halts within steps and outputs the binary numeral .
The function is space-constructible when there exists a deterministic machine such that, on unary input , the machine halts while using tape cells and outputs the binary numeral .
On this page, whenever a constructible bound is used to clock another machine, we also require the evident size condition for large enough , so that the budget is at least large enough to read an input of length .
Remarks
-
The definition records that the bound can itself be written down within the same asymptotic resource scale.
-
Standard polynomial and exponential time bounds that are eventually at least linear are time-constructible in this sense. Under the all-tapes space convention used here, no logarithmic-space claim is made: for example, a unary-input constructor for must reach the endmarker whenever it distinguishes the relevant input lengths, and therefore visits input-tape cells. The same input-reading obstruction makes an unbounded logarithmic bound non-time-constructible here.
The classes DTIME, NTIME, DSPACE, and NSPACE
Definition
Let .
For nonnegative resource functions , the notation means that some constants and satisfy for every . Every resource bound below uses constants fixed for the machine, uniformly over all its inputs and branches. Time counts transitions; space counts all cells visited on all tapes, including the input tape, with each distinct tape/cell pair counted once. No constructibility assumption on or is needed to define these classes.
A language belongs to DTIME when there exists a deterministic multitape Turing machine deciding in time .
A nondeterministic -tape Turing machine is obtained from the deterministic -tape model of Multitape and nondeterministic Turing machine variants by replacing its transition function with a finite-valued transition map One branch chooses one instruction from the finite set at each step.
A language belongs to NTIME when there exists such a nondeterministic -tape machine for which:
- every branch of on every input of length halts within steps, and
- some branch of accepts exactly on the words of , in the same existential sense as Accepting computations of a nondeterministic machine.
A language belongs to DSPACE when a deterministic multitape decider uses worst-case space . It belongs to NSPACE when a nondeterministic multitape machine accepts exactly the words in , every branch halts, and the maximum number of visited cells over all branches and inputs of length is .
Remarks
-
These are language classes. Function classes are expressed separately by saying that a machine computing the function does so within a stated bound.
-
The chosen machine model is multitape because it is convenient for programming; later theorems show that polynomial-time and polynomial-space notions do not depend on that choice.
Any machine that fully reads every input of length n needs at least linear time
Statement
Let be a -tape machine, and suppose that at least one input word of length exists and that halts on every input of that length. If, on every such input, the accepting or rejecting branch of scans each of the first input cells before halting, then
Facts & Assumptions
Given: A halting machine , an inhabited length- input set, and the input-reading property stated above.
Worst-case running time is the maximum number of steps over inputs of length , by Worst-case time and space complexity of a machine.
Proof
For the claimed lower bound is immediate. For , the input head starts at cell and moves at most one cell per transition. Reaching cell therefore takes at least transitions. The hypothesis says the machine scans that cell before halting, so it must make a further transition from a nonhalting configuration scanning the cell before it can enter an accepting or rejecting state. Thus every such halting branch takes at least steps.
The hypothesis says this lower bound applies on every input of length , and the input set is nonempty. By [L1], its worst-case maximum is at least the time on any one such input, so . Without the nonemptiness premise the claim fails for an empty input alphabet and , because the revised worst-case convention gives value zero.
An eventually positive time bound yields the same-order space bound
Statement
Let be a fixed -tape machine that halts on every input, and let be eventually at least at every length for which an input word exists. If then
Facts & Assumptions
Given: A fixed halting -tape machine and a bound with , eventually on inhabited input lengths.
Worst-case time and space count machine steps and visited tape cells, respectively, by Worst-case time and space complexity of a machine.
Big- means eventual domination up to a constant factor, by Asymptotic comparison of resource bounds.
Proof
During one step, each of the heads can enter at most one new cell on its own tape. Therefore after steps, the total number of visited cells across all tapes is at most the initial cells plus . By [L1], every halting computation using steps uses at most space.
If there are no length- inputs, the revised convention in [L1] makes both worst-case values zero. At an inhabited length, applying step 1.1 to the worst halting run gives . For sufficiently large inhabited lengths the hypothesis absorbs the additive constant, and [L2] converts the time bound into .
Every multitape time-T computation has a single-tape simulation in O((n+T(n))^2) time
Statement
Let be a fixed deterministic multitape Turing machine. If then there exists a deterministic one-tape Turing machine deciding the same language and satisfying
Facts & Assumptions
Given: A fixed deterministic multitape machine with .
Every fixed multitape machine has an equivalent deterministic one-tape simulator, by Every fixed multitape Turing machine has an equivalent one-tape simulation.
On an input , if the fixed multitape machine runs for steps, the standard simulator runs for at most steps, by The standard one-tape simulation of a fixed multitape machine has quadratic overhead.
Big- compares functions up to eventual constant factors, by Asymptotic comparison of resource bounds.
The class notation DTIME records deterministic decision procedures within an asymptotic time bound, by The classes DTIME, NTIME, DSPACE, and NSPACE.
Proof
By [L1], choose the one-tape simulator that reproduces the accept, reject, and divergence behavior of on every input.
For an input of length , let . The quadratic-overhead lemma [L2] gives for a constant depending only on . Because and , the hypothesis and [L3] imply . Taking the maximum over all of length yields .
The simulator from step 1.1 decides the same language as , and step 2.1 gives the quantitative bound. Therefore the language decided by also lies in the one-tape deterministic time class described by [L4].
Every multitape space-S computation has a single-tape simulation in O(n+S(n)) space
Statement
Let be a fixed deterministic multitape Turing machine. If then there exists a deterministic one-tape Turing machine deciding the same language and satisfying
Facts & Assumptions
Given: A fixed deterministic multitape machine with .
Every fixed multitape machine has an equivalent deterministic one-tape simulator, by Every fixed multitape Turing machine has an equivalent one-tape simulation.
Worst-case space counts the total number of tape cells ever visited during a halting computation, by Worst-case time and space complexity of a machine.
Big- compares functions up to eventual constant factors, by Asymptotic comparison of resource bounds.
The class notation DSPACE records deterministic decision procedures within an asymptotic space bound, by The classes DTIME, NTIME, DSPACE, and NSPACE.
Proof
Use the standard simulator from [L1] that stores the simulated tapes as marked blocks on one tape. On an input of length , the first simulated tape block initially records the whole input word, contributing cells up to a constant factor. Beyond that initial block, the simulator records only cells that the multitape computation has visited, together with only constant-size bookkeeping per recorded cell and a fixed number of delimiters depending on . If the simulated computation has visited at most cells altogether, [L2] therefore bounds the one-tape encoding length by .
Therefore there exists a constant such that every halting run of the simulator on an input of length visits at most cells. By [L3], this is . Taking maxima over all length- inputs gives .
The simulator still decides the same language as , and step 2.1 places it in the deterministic single-tape space class described by [L4].
A universal simulator can realize T steps with machine-dependent O(T log T) overhead
Statement
There exists a deterministic multitape universal simulator for the chosen machine coding with the following property: for every valid machine code there is a constant such that, for every input word and every integer , if halts on within at most steps with output word , then halts on input with output within steps; if diverges on , then diverges as well. The constant may depend on the finite alphabet, states, and transition table encoded by , but not on or .
Facts & Assumptions
Given: A valid machine code , an input word , and a time bound .
Machine codes are effectively decodable finite tuples, by A fixed effective binary encoding of deterministic one-tape Turing machines and The chosen machine coding is injective and has a total decoder.
The definition of a universal Turing machine is to reproduce halting outputs and divergence for the coded machine/input pair, by A universal Turing machine relative to a fixed machine encoding.
Worst-case time counts simulation steps of the simulator itself, by Worst-case time and space complexity of a machine.
Proof
By [L1], the simulator can first decode into the finite control data of and copy those data to a read-only program track. It then stores the current simulated configuration in a geometrically blocked tape layout whose block sizes double outward from the simulated heads. This representation keeps recently accessed cells near the center while allowing farther regions to be reached after only logarithmically many block crossings.
One simulated step of changes only the current state, one scanned tape symbol, and one head position. In the blocked layout from step 1.1, finding the current symbol, updating it, and recentering after a head move costs amortized over the first simulated steps: most steps touch only the central blocks, and a level- reblocking costs but occurs only once per simulated head moves. Summing over the occupied levels gives the asserted amortized bound. The subscript records the fixed cost of interpreting the finite alphabet, state set, and transition table encoded by ; the cited efficient-universality theorem permits exactly this machine dependence. No constructibility hypothesis on the integer is used.
Summing the amortized cost over at most simulated steps gives total simulation time . The initial decode-and-load work contributes . If the simulation halts with output word , at most simulated tape cells can belong to its visited output segment. A final scan therefore converts to the self-delimiting word in time, which is absorbed by the displayed bound. By [L2], the simulator is universal because it emits exactly and, when diverges, continues simulating forever rather than entering a halting state.
Therefore, for each fixed valid code , the machine has the claimed universal behavior with total running time bounded by for a suitable constant independent of and .
Polynomial-time and polynomial-space computation are invariant across standard machine models
Statement
For deterministic single-tape and fixed-multitape Turing-machine models, the notions of polynomial-time computation and polynomial-space computation define the same language classes.
Facts & Assumptions
Given: A language decided on one of the two standard deterministic Turing-machine models named in the statement.
Multitape time- computations have single-tape simulations in time, by Every multitape time-T computation has a single-tape simulation in O((n+T(n))^2) time.
Multitape space- computations have single-tape simulations in space, by Every multitape space-S computation has a single-tape simulation in O(n+S(n)) space.
Proof
Suppose a language is decided by a deterministic multitape machine in time bounded by a polynomial . By [L1], there is a single-tape decider running in time , and is still a polynomial. Thus polynomial time on multitape machines implies polynomial time on one tape.
Conversely, every one-tape machine is already a special case of a multitape machine, so any one-tape polynomial-time algorithm is automatically a multitape polynomial-time algorithm.
For space, [L2] shows that a multitape polynomial-space decider has a single-tape decider using space, which is still polynomial whenever is polynomial. The reverse implication is immediate because one tape is a special multitape case.
Steps 1.1 and 1.2 prove model invariance for polynomial time, and step 1.3 proves it for polynomial space. Therefore the two standard models define the same polynomial-time and polynomial-space language classes.
A constructible time bound yields a uniformly clocked simulator
Statement
Let be time-constructible, and assume for all sufficiently large . Then for every coded deterministic machine there exists a deterministic machine such that, on each input :
- if halts within at most steps, then halts with the same output;
- if has not halted by time , then halts and rejects.
Facts & Assumptions
Given: A time-constructible function and a coded deterministic machine .
Time-constructibility means that a machine can compute the binary numeral of within time on input , by Time-constructible and space-constructible functions.
A universal simulator reproduces the halting outputs and divergence of the coded machine on the coded input, by A universal Turing machine relative to a fixed machine encoding.
The machine code is an effective binary description of , by A fixed effective binary encoding of deterministic one-tape Turing machines.
Any machine that must fully read an input of length needs at least linear time, by Any machine that fully reads every input of length n needs at least linear time.
Proof
On input , the machine first scans the whole input once to learn . The lower bound hypothesis together with [L4] ensures that this preliminary scan fits inside the intended asymptotic budget. It then runs the constructor from [L1] on unary input to obtain the binary numeral of and writes a counter of that size on a work tape.
Next, using the fixed code from [L3], the machine initializes the simulated configuration of on . It first checks whether that configuration is already halting. Otherwise, while the counter is positive it simulates one transition, decrements the counter, and checks whether the new configuration is halting. If so, it outputs exactly what outputs, including when this was the -th transition. If the counter is zero and the simulated configuration is still nonhalting, it rejects. This is the standard clocked simulation built from the effective transition table [L3] and universal behavior in [L2].
Step 2.1 proves the two clauses of the statement: runs of halting in at most transitions are preserved, and overlong runs are cut off by a halting reject state.
FALSE: machine invariance means equivalent models perform exactly the same number of steps
Statement
False claim: whenever one translates a computation between standard machine models with the same computability power, the translated computation takes exactly the same number of steps.
Facts & Assumptions
Given: The false claim above.
Whenever one translates a computation between standard machine models with the same computability power, the translated computation takes exactly the same number of steps.
Polynomial-time and polynomial-space computation are model-invariant only up to asymptotic overhead, by Polynomial-time and polynomial-space computation are invariant across standard machine models.
A one-tape machine is the case of the deterministic multitape model, whose transitions read, write, and move each tape head once per step (Multitape and nondeterministic Turing machine variants).
Refutation
Let be a one-tape scanning machine, regarded by [L2] as a multitape machine with one tape. Translate it to an equivalent one-tape machine by inserting, before every original transition, a two-step right-then-left excursion that changes no tape symbol and records the finitely many encountered symbols in the control state. The third step performs the original transition. Thus has exactly the same behavior as but uses three steps for every nonhalting step of .
On every input for which takes a positive number of steps, the translated computation takes three times as many, contradicting [A1]. This is consistent with [L1]: robustness preserves asymptotic complexity classes, not literal equality of running times.
FALSE: clocked-simulation and time-hierarchy arguments never need constructibility hypotheses
Statement
False claim: every total time bound with can be uniformly materialized and enforced as a same-scale machine clock without a constructibility assumption.
Facts & Assumptions
Given: The false claim above.
Every total time bound with can be uniformly materialized and enforced as a same-scale machine clock without a constructibility assumption.
A constructible time bound is one whose value can itself be written down within the same asymptotic scale, by Time-constructible and space-constructible functions.
A constructible time bound that also satisfies for all sufficiently large yields a uniformly clocked simulator, by A constructible time bound yields a uniformly clocked simulator.
There exists a total noncomputable function . Indeed, the total computable binary-valued functions form a countable family because machines have finite descriptions, and the diagonal function differs from every at input .
Refutation
Define the total bound using [F1]. Then . If a uniform constructor could materialize on input , subtracting from its output would compute , contradicting [F1]. Hence this total bound is not time-constructible in the sense of [L1].
The construction in [L2] works precisely by first computing the bound and then enforcing it as a timeout. Step 1.1 exhibits a total bound satisfying the size condition for which that first operation is impossible. Therefore [A1] is false: a uniform same-scale clock cannot be obtained for every total bound without a constructibility hypothesis.
5 · Examples, counterexamples and false statements
None yet.
Sources
- John Watrous, Introduction to the Theory of Computing, Lecture 19: Time-bounded computations
- Sanjeev Arora and Boaz Barak, Computational Complexity: A Modern Approach
- Eric Blais, Models of Computation, 7. Time Complexity
- Eric Blais, Models of Computation, 17. Space Complexity
- Julian Panetta, ECS 120 Theory of Computation: Asymptotic analysis (cont'd) and time complexity