163 Complexity — Oracle
163.1 Overview
This module defines oracle Turing machines in the sense of Arora–Barak (Definition 3.4): multi-tape machines with one designated query tape and three designated states, where entering the query state submits the query tape’s contents to an oracle language and moves, in a single step, to a positive- or negative-answer state. It provides the step and run semantics relative to an oracle, a time-bounded computation predicate, basic locality invariants of initialized runs (head positions and blank cells, bounding the query length), and two lockstep sanity checks for the architecture: every plain machine embeds as an oracle machine whose behavior is oracle-independent, and conversely every oracle machine run with the empty oracle is eliminated into a plain machine.
163.2 Declarations
An oracle Turing machine with \(k\) ordinary work tapes over a symbol alphabet \(\Sigma \) and state set \(Q\) consists of an initial state \(q_0\), a designated query state \(q_{\mathrm{query}}\), a designated positive-answer state \(q_{\mathrm{yes}}\), a designated negative-answer state \(q_{\mathrm{no}}\), and a transition function that assigns to every state, scanned input symbol (possibly blank), and family of scanned symbols on the \(k+1\) work tapes (the last of which serves as the query tape) a one-step action on the \(k+1\) work tapes. The transition function governs every state except the query state, whose behavior is instead determined by the oracle. The structure itself does not require the three special states to be distinct; that is imposed separately by well-formedness.
An oracle Turing machine with \(k\) ordinary work tapes is well formed when its three special states are pairwise distinct: the query state differs from the positive-answer state, the query state differs from the negative-answer state, and the two answer states differ from each other. The initial state is allowed to coincide with the query state (such a machine submits the empty query on its first step).
For an oracle machine with \(k\) ordinary work tapes, the index of the query tape among the \(k+1\) work tapes: the last index, \(k\).
For a configuration of a machine with \(k+1\) work tapes over an alphabet \(\Sigma \), the query string is the word read off the query tape (the last work tape) from cell \(0\) rightward, up to but excluding the first blank cell. If no cell at a nonnegative position of the query tape is blank — possible for an arbitrary configuration, though not for one reachable from an initial configuration — the query string is defined to be the empty word.
One step of an oracle machine \(M\) with \(k\) ordinary work tapes relative to an oracle language \(O\) over the alphabet \(\Sigma \), acting on a configuration \(c\) with \(k+1\) work tapes. A halted configuration is left fixed. If the current state is the query state, the machine moves to the positive-answer state when the query string of \(c\) belongs to \(O\) and to the negative-answer state otherwise, with all tapes, head positions, and the output left unchanged. In every other state, the machine applies the action prescribed by its transition function for the current state and the scanned input and work-tape symbols, exactly like a plain multi-tape machine.
The initial configuration of an oracle machine with \(k\) ordinary work tapes on a given input word: the machine is in its initial state, the input head is at the origin, all \(k+1\) work tapes (including the query tape) are blank with their heads at the origin, and the output is empty.
The configuration reached by running an oracle machine \(M\) with oracle \(O\) for \(t\) steps from a configuration \(c\): the \(t\)-fold iterate of the one-step function of \(M\) relative to \(O\), applied to \(c\).
An oracle machine \(M\) with oracle \(O\) computes the word \(y\) on input \(x\) within \(t\) steps when, after running \(M\) relative to \(O\) for \(t\) steps from its initial configuration on \(x\), the machine has halted and its output tape holds exactly \(y\). This is a time-only notion; space is not constrained.
Let \(M\) be an oracle machine with \(k\) ordinary work tapes and let \(c\) be a configuration whose current state is not the query state of \(M\) (in particular, \(c\) may be halted). Then for any two oracle languages \(O_1\) and \(O_2\), one step of \(M\) from \(c\) relative to \(O_1\) equals one step of \(M\) from \(c\) relative to \(O_2\).
Let \(a\) be a one-step action of a machine with \(k'\) work tapes, let \(c\) be a configuration of such a machine, let \(i\) be a work-tape index, and let \(z\) be an integer cell position different from the position of the \(i\)-th work head in \(c\). Then after applying \(a\) to \(c\), the content of cell \(z\) of the \(i\)-th work tape is unchanged.
Let \(M\) be an oracle machine with \(k\) ordinary work tapes, \(O\) an oracle language, \(c\) a configuration, and \(i\) one of the \(k+1\) work-tape indices. Then the position of the \(i\)-th work head after one step of \(M\) relative to \(O\) differs from its position in \(c\) by at most \(1\) in absolute value.
Let \(M\) be an oracle machine with \(k\) ordinary work tapes, \(O\) an oracle language, \(c\) a configuration, \(i\) one of the \(k+1\) work-tape indices, and \(z\) an integer cell position different from the position of the \(i\)-th work head in \(c\). Then after one step of \(M\) relative to \(O\), the content of cell \(z\) of the \(i\)-th work tape is unchanged.
Let \(M\) be an oracle machine with \(k\) ordinary work tapes, \(O\) an oracle language, and \(x\) an input word. Then for every \(t \in \mathbb {N}\), in the configuration reached by running \(M\) with oracle \(O\) for \(t\) steps from its initial configuration on \(x\): every one of the \(k+1\) work heads is at a position of absolute value at most \(t\), and every work-tape cell at an integer position \(z\) with \(t \le \left\lvert z\right\rvert \) is blank.
Let \(M\) be an oracle machine with \(k\) ordinary work tapes, \(O\) an oracle language, \(x\) an input word, and \(t \in \mathbb {N}\). In the configuration reached by running \(M\) with oracle \(O\) for \(t\) steps from its initial configuration on \(x\), the query string — the contents of the query tape from cell \(0\) up to the first blank cell — has length at most \(t\).
Let \(M\) be an oracle machine with \(k\) ordinary work tapes, \(O\) an oracle language, \(x\) an input word, and \(t \in \mathbb {N}\). Then in the configuration reached by running \(M\) with oracle \(O\) for \(t\) steps from its initial configuration on \(x\), every work-tape cell at an integer position \(z\) with \(t \le \left\lvert z\right\rvert \) is blank. In particular, the query tape always contains a blank cell at a nonnegative position, so the empty-word fallback in the definition of the query string is never invoked in an initialized run.
The extension of a one-step action on \(k\) work tapes to an action on \(k+1\) work tapes: on the first \(k\) tapes it writes and moves exactly as before, and on the extra last tape it writes nothing and does not move the head. The input-head move, the output emission, and the next state are unchanged.
The embedding of a configuration of a machine with \(k\) work tapes and state set \(Q\) into a configuration of a machine with \(k+1\) work tapes over the extended state set \(Q \sqcup \{ 0,1,2\} \): the state (if the machine has not halted) is renamed along the left inclusion, the input head, the first \(k\) work tapes with their head positions, and the output are unchanged, and the extra last work tape is blank with its head at the origin.
For any configuration \(c\) of a machine with \(k\) work tapes, the input symbol scanned in the embedding of \(c\) into the \((k+1)\)-tape oracle model equals the input symbol scanned in \(c\).
For any configuration \(c\) of a machine with \(k\) work tapes and any of the \(k\) original tape indices \(i\), the symbol scanned on tape \(i\) in the embedding of \(c\) into the \((k+1)\)-tape oracle model equals the symbol scanned on tape \(i\) in \(c\).
A configuration of a machine with \(k\) work tapes is halted if and only if its embedding into the \((k+1)\)-tape oracle model is halted.
For any configuration \(c\) of a machine with \(k\) work tapes, the output tape of the embedding of \(c\) into the \((k+1)\)-tape oracle model equals the output tape of \(c\).
Let \(a\) be a one-step action of a machine with \(k\) work tapes and state set \(Q\), and let \(c\) be a configuration of such a machine. Rename the states of \(a\) along the left inclusion \(Q \to Q \sqcup \{ 0,1,2\} \) and extend the result by an inert \((k+1)\)-st tape. Applying this extended, renamed action to the embedding of \(c\) into the \((k+1)\)-tape oracle model yields exactly the embedding of the configuration obtained by applying \(a\) to \(c\).
For any state \(q_0\) of a machine with \(k\) work tapes and any input word \(x\), the embedding into the \((k+1)\)-tape oracle model of the initial configuration in state \(q_0\) on input \(x\) is the initial configuration on input \(x\) whose state is the image of \(q_0\) under the left inclusion into the extended state set \(Q \sqcup \{ 0,1,2\} \).
The embedding of a plain multi-tape machine with \(k\) work tapes and state set \(Q\) as an oracle machine over the extended state set \(Q \sqcup \{ 0,1,2\} \): the three fresh states serve as the query, positive-answer, and negative-answer states, the initial state is the image of the original initial state, and on original states the transition function is the original transition (renamed along the left inclusion and extended by an inert query tape), so that the machine never moves into a fresh state and ignores the query tape. From each of the three fresh states the transition table halts immediately.
For every plain multi-tape machine with \(k\) work tapes, the oracle machine obtained by embedding it into the oracle model is well formed: its three fresh special states (query, positive answer, negative answer) are pairwise distinct.
Let \(M_0\) be a plain multi-tape machine with \(k\) work tapes, let \(O\) be any oracle language, and let \(c\) be a configuration of \(M_0\). One step, relative to \(O\), of the oracle machine obtained by embedding \(M_0\), taken from the embedding of \(c\) into the \((k+1)\)-tape oracle model, equals the embedding of the configuration obtained by one step of \(M_0\) from \(c\).
Let \(M_0\) be a plain multi-tape machine with \(k\) work tapes, let \(O\) be any oracle language, let \(c\) be a configuration of \(M_0\), and let \(t \in \mathbb {N}\). Running the oracle machine obtained by embedding \(M_0\) for \(t\) steps relative to \(O\) from the embedding of \(c\) yields the embedding of the configuration obtained by running \(M_0\) for \(t\) steps from \(c\).
Let \(M_0\) be a plain multi-tape machine with \(k\) work tapes, let \(O\) be any oracle language, let \(x\) and \(y\) be words, and let \(t \in \mathbb {N}\). The oracle machine obtained by embedding \(M_0\) computes \(y\) on input \(x\) within \(t\) steps relative to \(O\) if and only if, after running \(M_0\) for \(t\) steps from its initial configuration on \(x\), the machine has halted and its output tape holds exactly \(y\). In particular, the input/output behavior and time bounds of the embedded machine do not depend on the oracle.
Given an oracle machine \(M\) with \(k\) ordinary work tapes and state set \(Q\), the plain multi-tape machine with \(k+1\) work tapes over the same state set \(Q\) that simulates \(M\) run with the empty oracle: it has the same initial state, and its transition function agrees with that of \(M\) in every state except the query state, where it instead performs a stationary move (no writes, no head movement, no output) directly into the negative-answer state, since the empty oracle always answers no.
Let \(M\) be an oracle machine with \(k\) ordinary work tapes and let \(c\) be a configuration with \(k+1\) work tapes. One step of the plain machine obtained from \(M\) by the empty-oracle elimination, taken from \(c\), equals one step of \(M\) relative to the empty oracle, taken from \(c\).
Let \(M\) be an oracle machine with \(k\) ordinary work tapes, let \(c\) be a configuration with \(k+1\) work tapes, and let \(t \in \mathbb {N}\). Running the plain machine obtained from \(M\) by the empty-oracle elimination for \(t\) steps from \(c\) yields exactly the configuration obtained by running \(M\) for \(t\) steps from \(c\) relative to the empty oracle.