TCSLib

159 Complexity — Deterministic

159.1 Overview

This module defines deterministic multi-tape Turing machines with a read-only input tape, \(k\) work tapes, and a write-only output tape, together with their step semantics: the one-step transition on configurations, the configuration reached after \(t\) steps, and the halting behaviour. Space usage is measured as the total number of work-tape cells visited by the heads, and on top of the run semantics the module defines what it means for a machine to compute an output, a function, or the indicator of a set within given time and space bounds, including monotonicity of these notions in the bounds and uniqueness of the halting time.

159.2 Declarations

Definition 159.1 Multi-tape Turing machine
✓
#

A deterministic Turing machine with a read-only input tape, \(k\) work tapes, and a write-only output tape, over an alphabet of symbols extended by a blank. It consists of an initial state \(q_0\) and a transition function that, given the current state, the (possibly blank) symbol under the input head, and the \(k\) symbols under the work-tape heads, returns a one-step action: a movement of the input head, a write-and-move instruction for each work tape, an optional symbol to append to the output, and a successor state or the decision to halt. Neither the alphabet nor the state set is required to be finite.

Definition 159.2 One computation step
✓

The successor of a configuration \(c\) of a multi-tape Turing machine \(M\): if \(c\) is halted (its state component is empty), the step returns \(c\) unchanged; otherwise it applies to \(c\) the action that the transition function of \(M\) prescribes for the current state, the symbol under the input head, and the symbols under the \(k\) work-tape heads.

Definition 159.3 Symbol emitted by one step
✓

The symbol, if any, that a multi-tape Turing machine \(M\) appends to its output tape when executing one step from a configuration \(c\): the optional output component of the action prescribed by the transition function for the current state and scanned symbols, and no symbol at all when \(c\) is halted.

Definition 159.4 Initial configuration
✓

The starting configuration of a multi-tape Turing machine \(M\) on an input word: the machine is in its initial state \(q_0\), the input head is at the first input symbol, all work tapes are blank with heads at the origin, and the output is empty.

Lemma 159.5 A halted configuration is a fixed point of the step
✓

Let \(M\) be a multi-tape Turing machine and \(c\) a configuration whose state component is empty (the machine has halted). Then one computation step of \(M\) leaves \(c\) unchanged.

Definition 159.6 Configuration reached after \(t\) steps
✓

The configuration reached by iterating the one-step function of a multi-tape Turing machine \(t\) times starting from a configuration \(c\). Since halted configurations are fixed points of the step function, a machine that halts stays in its halting configuration.

Lemma 159.7 Running zero steps
✓

For every multi-tape Turing machine \(M\) and configuration \(c\), running \(M\) for \(0\) steps from \(c\) yields \(c\) itself.

Lemma 159.8 Unfolding a run at the first step
✓

For every multi-tape Turing machine \(M\), configuration \(c\), and \(t \in \mathbb {N}\), running \(M\) for \(t + 1\) steps from \(c\) equals running \(M\) for \(t\) steps from the configuration obtained by one step of \(M\) from \(c\).

Lemma 159.9 Unfolding a run at the last step
✓

For every multi-tape Turing machine \(M\), configuration \(c\), and \(t \in \mathbb {N}\), running \(M\) for \(t + 1\) steps from \(c\) equals applying one step of \(M\) to the configuration reached after running \(M\) for \(t\) steps from \(c\).

Lemma 159.10 Splitting a run
✓

For every multi-tape Turing machine \(M\), configuration \(c\), and \(a, b \in \mathbb {N}\), running \(M\) for \(a + b\) steps from \(c\) equals running \(M\) for \(b\) steps from the configuration reached after \(a\) steps from \(c\).

Lemma 159.11 A step-commuting map commutes with runs
✓

Let \(M\) and \(M'\) be multi-tape Turing machines over the same alphabet, with \(k\) and \(k'\) work tapes and running on inputs \(x\) and \(x'\) respectively, and let \(f\) map configurations of \(M\) to configurations of \(M'\) so that one step of \(M'\) after \(f\) agrees with \(f\) after one step of \(M\) on every configuration. Then for every configuration \(c\) of \(M\) and every \(n \in \mathbb {N}\), running \(M'\) for \(n\) steps from \(f(c)\) yields the image under \(f\) of the configuration \(M\) reaches in \(n\) steps from \(c\).

Lemma 159.12 Runs from a halted configuration are constant
✓

Let \(M\) be a multi-tape Turing machine and \(c\) a configuration whose state component is empty (the machine has halted). Then running \(M\) for any number of steps from \(c\) yields \(c\) itself.

Lemma 159.13 A halted configuration emits no output
✓

Let \(M\) be a multi-tape Turing machine and \(c\) a configuration whose state component is empty. Then the step of \(M\) from \(c\) emits no output symbol.

Lemma 159.14 Work-tape heads move at most one cell per step
✓

Let \(M\) be a multi-tape Turing machine with \(k\) work tapes, \(c\) a configuration, and \(i\) one of the \(k\) work-tape indices. Then the position of the \(i\)-th work-tape head after one step of \(M\) from \(c\) differs from its position in \(c\) by at most \(1\) in absolute value.

Definition 159.15 Cells visited by a work-tape head
✓

The finite set of integer positions occupied by the head of work tape \(i\) during the computation of a multi-tape Turing machine from a configuration \(c\), over steps \(0\) through \(t\) inclusive.

Definition 159.16 Space used by one tape
✓

The number of distinct work-tape cells touched by the head of work tape \(i\) in the computation of a multi-tape Turing machine from a configuration \(c\) up to step \(t\), i.e. the cardinality of the set of positions visited by that head.

Definition 159.17 Total space used
✓

The total number of work-tape cells touched by the computation of a multi-tape Turing machine with \(k\) work tapes from a configuration \(c\) up to step \(t\): the sum over the \(k\) work tapes of the number of distinct cells visited by each head. This is the space measure used throughout; the read-only input tape and the write-only output tape do not count.

Lemma 159.18 A machine without work tapes uses no space
✓

Let \(M\) be a multi-tape Turing machine with \(k\) work tapes where \(k = 0\). Then for every configuration \(c\) and every step count \(t\), the total space used by \(M\) from \(c\) up to step \(t\) is \(0\).

Lemma 159.19 Per-tape space is at most the total space
✓

For every multi-tape Turing machine \(M\), configuration \(c\), step count \(t\), and work-tape index \(i\), the number of cells touched by the head of tape \(i\) up to step \(t\) is at most the total space used by \(M\) from \(c\) up to step \(t\).

Lemma 159.20 Space used equals the space of the computation trace
✓

Let \(M\) be a multi-tape Turing machine, \(c\) a configuration, and \(t \in \mathbb {N}\). The total space used by \(M\) from \(c\) up to step \(t\) equals the space touched by the list of configurations that \(M\) traverses in steps \(0, 1, \dots , t\) from \(c\), where the space touched by a list of configurations is the sum over the work tapes of the number of distinct head positions occurring in the list.

Lemma 159.21 One step appends the emitted symbol to the output
✓

For every multi-tape Turing machine \(M\) and configuration \(c\), the output component after one step of \(M\) from \(c\) equals the output of \(c\) followed by the symbol emitted by that step, if any (and equals the output of \(c\) unchanged when no symbol is emitted).

Lemma 159.22 The output is stable after halting
✓

Let \(M\) be a multi-tape Turing machine, \(c\) a configuration, and \(\tau \le t\) natural numbers such that the configuration reached by \(M\) after \(\tau \) steps from \(c\) is halted. Then the output after \(t\) steps from \(c\) equals the output after \(\tau \) steps from \(c\).

Definition 159.23 Computing an output in given time and space
✓

The proposition that a multi-tape Turing machine \(M\), started in its initial configuration on an input word, is halted after \(t\) steps (hence halts within \(t\) steps, since halting is absorbing), that its output tape then holds exactly the given output word, and that the computation up to step \(t\) touches exactly \(s\) work-tape cells. Neither the alphabet nor the state set is required to be finite.

Definition 159.24 Computing a function within input-indexed bounds
✓

Given injective encodings of the domain and codomain into words over the machine’s alphabet, a multi-tape Turing machine \(M\) computes a function \(f\) within time bound \(t\) and space bound \(s\) (both functions of the input) if for every input \(a\) there are \(t' \le t(a)\) and \(s' \le s(a)\) such that \(M\), on the encoding of \(a\), halts within \(t'\) steps with output the encoding of \(f(a)\), touching exactly \(s'\) work-tape cells. The alphabet and state set need not be finite.

Definition 159.25 Computability within time and space bounds
✓

A function \(f\) is computable within input-indexed time bound \(t\) and space bound \(s\), with respect to injective encodings of its domain and codomain into binary words, if there exist a number \(k\) of work tapes, a finite state set, and a multi-tape Turing machine over the binary alphabet with those tapes and states that computes \(f\) between the given encodings within the bounds \(t\) and \(s\).

Definition 159.26 Computability within bounds on the input length
✓

A function \(f\) is computable within time bound \(t\) and space bound \(s\), where \(t, s : \mathbb {N} \to \mathbb {N}\) are functions of the encoded input length, if there is a binary Turing machine with finitely many states that, for every input \(a\), computes the encoding of \(f(a)\) from the encoding of \(a\) in at most \(t(n)\) steps and touching at most \(s(n)\) work-tape cells, where \(n\) is the length of the encoding of \(a\).

Theorem 159.27 Weakening the bounds of a computation
✓

Let \(M\) be a multi-tape Turing machine that computes a function \(f\) between given injective encodings within input-indexed time bound \(t\) and space bound \(s\), and let \(t'\) and \(s'\) be bounds with \(t(a) \le t'(a)\) and \(s(a) \le s'(a)\) for every input \(a\). Then \(M\) also computes \(f\) between the same encodings within the bounds \(t'\) and \(s'\).

Theorem 159.28 Computability is monotone in the bounds
✓

Let \(f\) be a function computable within input-indexed time bound \(t\) and space bound \(s\) with respect to given binary encodings, and let \(t'\) and \(s'\) be bounds with \(t(a) \le t'(a)\) and \(s(a) \le s'(a)\) for every input \(a\). Then \(f\) is computable within the bounds \(t'\) and \(s'\) with respect to the same encodings.

Definition 159.29 Boolean indicator of a set
✓
#

The Boolean indicator function of a set \(L \subseteq \alpha \): the function mapping \(x\) to true when \(x \in L\) and to false otherwise.

Definition 159.30 Decidability within time and space bounds
✓

A set \(L \subseteq \alpha \) is decidable within input-indexed time bound \(t\) and space bound \(s\), with respect to an injective binary encoding of \(\alpha \), if the Boolean indicator function of \(L\) is computable within these bounds, the one-bit answer being encoded as the single-symbol output word.

Definition 159.31 Halting at exactly step \(t\)
✓

The Boolean predicate stating that a multi-tape Turing machine \(M\) on a given input halts after exactly \(t\) steps: started from its initial configuration, \(M\) is halted after \(t\) steps but not after \(t - 1\) steps (truncated subtraction). In particular the predicate is never true at \(t = 0\): a machine must perform at least one step to halt.

Lemma 159.32 Uniqueness of the halting step
✓

Let \(M\) be a multi-tape Turing machine and fix an input word. If \(M\) halts on that input after exactly \(t_1\) steps and also after exactly \(t_2\) steps, then \(t_1 = t_2\).

Lemma 159.33 A repeated non-halting configuration precludes halting
✓

Let \(M\) be a multi-tape Turing machine and let \(c\) be a configuration that is not halted. If running \(M\) for \(t + 1\) steps from \(c\) returns to \(c\) itself, then the computation of \(M\) from \(c\) never halts: for every number of steps \(t'\), the configuration reached after \(t'\) steps from \(c\) is not halted.

159.3 Additional declarations

Lemma 159.34 Input head moves right at most one cell per step
✓

Let \(M\) be a multi-tape Turing machine on an input word \(x\), whose input-head position ranges over \(\{ 0, 1, \dots , |x| + 1\} \), and let \(c\) be a configuration of \(M\) with input-head position \(p\). Then for every \(t \in \mathbb {N}\), the input-head position in the configuration reached by running \(M\) for \(t\) steps from \(c\) is at most \(p + t\).