TCSLib

178 Complexity — Universal Startup

178.1 Overview

This module builds the startup layer of the universal Turing machine (Arora–Barak, §1.4.1, Theorem 1.9): it parses the doubled-bit code region of the self-delimiting pairing \(\langle \alpha , x\rangle \) of a program code \(\alpha \) and an input \(x\), runs the coding scheme’s canonizer on the extracted code, embeds a virtual input head into the verbatim suffix region, and captures the resulting canonical transition table on a dedicated work tape before control transfers to the table interpreter. Throughout, bit strings are written over \(\{ 0,1\} \) (\(1\) for true, \(0\) for false), and \(\langle \alpha , x\rangle \) lists each bit of \(\alpha \) twice, then the separator pair \(01\), then \(x\) verbatim.

178.2 Declarations

Lemma 178.1 Length of the paired encoding
✓
#

For all bit strings \(\alpha \) and \(x\), the self-delimiting pairing \(\langle \alpha , x\rangle \) — each bit of \(\alpha \) written twice, followed by the separator pair \(01\), followed by \(x\) verbatim — has length exactly \(2\left\lvert \alpha \right\rvert + 2 + \left\lvert x\right\rvert \). In particular the extent of the code region is independent of the suffix \(x\).

Lemma 178.2 Aligned cells of a doubled code bit
✓
#

Let \(\alpha \) and \(x\) be bit strings and let \(j \lt \left\lvert \alpha \right\rvert \). In the self-delimiting pairing \(\langle \alpha , x\rangle \) (each bit of \(\alpha \) doubled, then the separator pair \(01\), then \(x\) verbatim), the cells of index \(2j\) and \(2j+1\) (zero-indexed) both contain the \(j\)-th bit of \(\alpha \); both cells of a doubled code bit therefore lie before the separator.

Lemma 178.3 Location of the separator
✓
#

For all bit strings \(\alpha \) and \(x\), the cells of index \(2\left\lvert \alpha \right\rvert \) and \(2\left\lvert \alpha \right\rvert +1\) in the self-delimiting pairing \(\langle \alpha , x\rangle \) (each bit of \(\alpha \) doubled, then the separator pair \(01\), then \(x\) verbatim) contain the bits \(0\) and \(1\) respectively: the separator begins immediately after the doubled code region.

Definition 178.4 The doubled-bit prefix parser
✓
#

A Turing machine over the binary alphabet with no work tapes and two kinds of live control states: “expecting the first half of a doubled pair” and “having just read a first half \(b\)”. In the expecting state it records the scanned bit and moves right (halting if it scans a blank); in the state remembering \(b\) it compares the scanned cell with \(b\) — on a match it emits the single bit \(b\), moves right, and returns to the expecting state, while on a mismatch (which on a valid paired encoding occurs exactly at the separator’s second bit) it moves right and halts without emitting.

Definition 178.5 Configurations of the prefix parser
✓

Given bit strings \(\alpha \) and \(x\), a control state, an input-head position on the self-delimiting pairing \(\langle \alpha , x\rangle \), and an output word, this assembles the corresponding full configuration of the doubled-bit prefix parser; since that parser has no work tapes, the work-tape and work-head components are vacuous.

Let the doubled-bit prefix parser stand, on the self-delimiting pairing \(\langle \alpha , x\rangle \) of bit strings \(\alpha \) and \(x\), in a live control state \(q\) at input-head position \(p\) with output word \(w\) emitted so far, and suppose the symbol scanned at \(p\) is \(b\). Then one transition produces again a configuration with no work-tape content: its control state and head movement are those prescribed by the parser’s transition function on \((q, b)\), and the bit emitted by that transition (if any) is appended to \(w\).

Let \(\alpha \) and \(x\) be bit strings and let \(j \le \left\lvert \alpha \right\rvert \). Started on the self-delimiting pairing \(\langle \alpha , x\rangle \) (each bit of \(\alpha \) doubled, then the separator pair \(01\), then \(x\) verbatim), the doubled-bit prefix parser is, after exactly \(2j\) transitions, in the “expecting a first half” state with its input head at position \(2j+1\) — head positions count the left boundary blank as position \(0\), so the head stands on the cell of index \(2j\) — having emitted precisely the first \(j\) bits of \(\alpha \).

For all bit strings \(\alpha \) and \(x\), the doubled-bit prefix parser, started on the self-delimiting pairing \(\langle \alpha , x\rangle \), halts after exactly \(2\left\lvert \alpha \right\rvert +2\) transitions with output exactly \(\alpha \) and with its input head parked at position \(2\left\lvert \alpha \right\rvert +3\), that is, on the first cell of the verbatim suffix \(x\) (the right blank when \(x\) is empty). Both the step count and the emitted word are independent of \(x\).

For all bit strings \(\alpha \) and \(x\), after exactly \(2\left\lvert \alpha \right\rvert +1\) transitions on the self-delimiting pairing \(\langle \alpha , x\rangle \), the doubled-bit prefix parser is in the live state recording the separator’s first bit \(0\), its input head is at position \(2\left\lvert \alpha \right\rvert +2\), and it has emitted exactly \(\alpha \).

Lemma 178.10 Liveness propagates backwards
✓

Let \(M\) be a multi-tape Turing machine, \(c\) one of its configurations on some input, and \(s \le t\) natural numbers. If the configuration reached from \(c\) after \(t\) steps is not halted, then neither is the configuration reached after \(s\) steps: since halting is absorbing, a live later configuration excludes all earlier halts.

Lemma 178.11 Liveness of prefix extraction
✓

For all bit strings \(\alpha \) and \(x\) and every \(s \lt 2\left\lvert \alpha \right\rvert +2\), the doubled-bit prefix parser, started on the self-delimiting pairing \(\langle \alpha , x\rangle \), has not halted after \(s\) transitions.

Definition 178.12 Prefix extraction composed with the canonizer
✓

Given an effective machine-coding scheme — a representation of machines by bit strings equipped with a canonizer machine that computes, from any code, the serialization of the canonical transition table of the decoded machine within a stated time bound — this is the buffered composition of the doubled-bit prefix parser with that canonizer: the word emitted by the parser (the extracted code) is stored in a buffer, and the canonizer then runs with its input served from that buffer while the physical input head stays put.

Let \(c\) be an effective machine-coding scheme and let \(\alpha \) and \(x\) be bit strings. Started on the self-delimiting pairing \(\langle \alpha , x\rangle \), the buffered composition of the doubled-bit prefix parser with the canonizer of \(c\) reaches, after exactly \(3\left\lvert \alpha \right\rvert +4\) transitions, the second-phase buffered configuration in which the canonizer stands at its initial configuration on input \(\alpha \), the virtual-boundary flag is set, and the physical input head is parked at position \(2\left\lvert \alpha \right\rvert +3\), on the first cell of the verbatim suffix. This step count does not depend on \(x\).

Let \(c\) be an effective machine-coding scheme, \(\alpha \) and \(x\) bit strings, and \(t\) a natural number. Then there is a Boolean boundary flag \(b\) such that, after \(3\left\lvert \alpha \right\rvert +4+t\) transitions on the self-delimiting pairing \(\langle \alpha , x\rangle \), the buffered composition of the doubled-bit prefix parser with the canonizer of \(c\) is in the second-phase buffered configuration embedding the configuration reached by the canonizer after \(t\) steps on input \(\alpha \), with flag \(b\) and with the physical input head still parked at position \(2\left\lvert \alpha \right\rvert +3\).

Let \(c\) be an effective machine-coding scheme with canonizer time bound \(T_c\), and let \(\alpha \) and \(x\) be bit strings. After exactly \(3\left\lvert \alpha \right\rvert +4+T_c(\left\lvert \alpha \right\rvert )\) transitions on the self-delimiting pairing \(\langle \alpha , x\rangle \), the buffered composition of the doubled-bit prefix parser with the canonizer of \(c\) has halted, its output is the serialization of the canonical transition table of the machine that \(c\) decodes from \(\alpha \), and its input head is at position \(2\left\lvert \alpha \right\rvert +3\). In particular this time depends only on the code, not on the suffix \(x\).

Lemma 178.16 Suffix lookups in the paired encoding
✓

For all bit strings \(\alpha \) and \(x\) and every natural number \(j\), the optional cell lookup at index \(2\left\lvert \alpha \right\rvert +2+j\) in the self-delimiting pairing \(\langle \alpha , x\rangle \) agrees with the optional lookup at index \(j\) in \(x\); both are simultaneously undefined when \(j \ge \left\lvert x\right\rvert \).

Definition 178.17 Embedding of the virtual suffix head
✓
#

Given bit strings \(\alpha \) and \(x\), this maps a virtual input-head position \(p \in \{ 0, 1, \dots , \left\lvert x\right\rvert +1\} \) on the suffix \(x\) (including both boundary blanks) to the physical head position \(2\left\lvert \alpha \right\rvert +2+p\) on the self-delimiting pairing \(\langle \alpha , x\rangle \). Virtual position \(0\) lands on the separator’s last cell.

Definition 178.18 Configuration embedding along the suffix
✓

Given a bit string \(\alpha \) and a configuration of a machine with \(k\) work tapes on input \(x\), this forms the configuration on the self-delimiting pairing \(\langle \alpha , x\rangle \) that keeps the control state, work tapes, work-head positions, and output unchanged and translates only the input-head position by the offset \(2\left\lvert \alpha \right\rvert +2\) of the verbatim suffix.

Lemma 178.19 Reading the left-boundary marker tape
✓
#

Consider the tape that carries the single-cell word \(1\) at coordinate \(0\) and is blank at every other coordinate, including all negative ones. For every natural number \(p\), the cell of this tape at coordinate \(p\) contains the mark \(1\) if \(p = 0\) and is blank otherwise.

Let \(\alpha \) be a bit string and let \(c\) be a configuration of a machine with \(k\) work tapes on input \(x\); embed \(c\) into the self-delimiting pairing \(\langle \alpha , x\rangle \) by shifting its input head by the suffix offset \(2\left\lvert \alpha \right\rvert +2\). Mask the embedded read as follows: if the marker tape carrying a single mark at coordinate \(0\) shows its mark at the coordinate equal to \(c\)’s virtual head position — that is, exactly at virtual position \(0\) — declare the read blank; otherwise take the symbol physically scanned by the embedded configuration. This masked read equals the input symbol that \(c\) scans natively on \(x\), including at the left and right boundary blanks (and for an empty suffix).

Lemma 178.21 The marker yields a valid boundary tag
✓

For every head position \(p \in \{ 0, 1, \dots , n+1\} \) on an input of length \(n\) (with its two boundary blanks), the Boolean flag “the marker tape carrying a single mark at coordinate \(0\) does not show its mark at coordinate \(p\)” satisfies the boundary-tag contract of the clamped virtual-move operation: the flag is false at the left boundary \(p = 0\) and true at the right blank \(p = n+1\), including when the input is empty.

Lemma 178.22 Virtual motion commutes with the suffix embedding
✓

Let \(\alpha \) be a bit string, let \(c\) be a configuration of a machine with \(k\) work tapes on input \(x\) whose input head is at position \(p\), and let \(d \in \{ -1, 0, +1\} \) be a direction. Let \(b\) be the marker-derived boundary flag at \(p\) (false exactly at \(p = 0\)) and let \(m\) be the clamped virtual move determined by \(b\), the symbol under \(c\)’s input head, and \(d\), which suppresses stepping outward from a boundary blank. Then moving the physical head from the embedded position \(2\left\lvert \alpha \right\rvert +2+p\) on the self-delimiting pairing \(\langle \alpha , x\rangle \) by \(m\) lands exactly on the embedding of the position reached from \(p\) by the clamped move in direction \(d\), and, as integers, \(p + m\) equals that new virtual position.

Definition 178.23 The output-capture wrapper
✓

Given a machine \(M\) over the binary alphabet with \(k\) work tapes and a four-tape machine \(D\) (the interpreter), the wrapper machine with \(k+4\) work tapes and two-phase control. In the first phase it runs \(M\) on the first \(k\) work tapes and the real input, except that every bit \(M\) emits is written onto a dedicated table tape — the first of the four extra tapes — instead of the real output. When \(M\) halts, a single administrative transition passes control to \(D\), which then runs on the four extra tapes, reads the original physical input, and emits output for real; the three extra tapes other than the table tape start blank.

Definition 178.24 First-phase configurations of the capture wrapper
✓

For a configuration \(c\) of a machine \(M\) with \(k\) work tapes on input \(x\), the corresponding first-phase configuration of the output-capture wrapper of \(M\) and an interpreter \(D\): the control records phase one together with \(c\)’s control state, the input head and the first \(k\) work tapes are those of \(c\), the table tape holds the word output by \(c\) so far (written from coordinate \(0\)) with its head one cell past the end of that word, the remaining three tapes are blank with heads at \(0\), and the wrapper’s real output is empty.

Lemma 178.25 Initialization of the capture wrapper
✓

For every machine \(M\), four-tape interpreter \(D\), and input \(x\), the initial configuration of the output-capture wrapper of \(M\) and \(D\) on \(x\) coincides with the first-phase embedding of the initial configuration of \(M\) on \(x\): blank table tape, blank interpreter tapes, and empty output.

Let \(c\) be a configuration of a machine \(M\) on input \(x\) whose control state is live (not halted). Then one transition of the output-capture wrapper of \(M\) and a four-tape interpreter \(D\), applied to the first-phase embedding of \(c\), equals the first-phase embedding of the configuration obtained from \(c\) by one transition of \(M\). In particular any bit emitted by that transition of \(M\) — including a bit emitted on \(M\)’s halting transition — is appended on the table tape, and the wrapper itself remains live.

Let \(c\) be a configuration of a machine \(M\) on input \(x\) and let \(t\) be a natural number such that \(M\) has not halted after any \(s \lt t\) steps from \(c\). Then \(t\) transitions of the output-capture wrapper of \(M\) and a four-tape interpreter \(D\), started from the first-phase embedding of \(c\), produce exactly the first-phase embedding of the configuration of \(M\) after \(t\) steps from \(c\).

Definition 178.28 Interpreter-entry configuration
✓

For a configuration \(c\) of a machine \(M\) on input \(x\), the configuration of the output-capture wrapper of \(M\) and a four-tape interpreter \(D\) that agrees with the first-phase embedding of \(c\) in every component except that its control state is the interpreter’s initial state. The halted source configuration is thereby preserved as inactive data, with its output stored on the table tape.

Let \(c\) be a halted configuration of a machine \(M\) on input \(x\). Then one transition of the output-capture wrapper of \(M\) and a four-tape interpreter \(D\), applied to the first-phase embedding of \(c\), yields the interpreter-entry configuration for \(c\): every component of \(c\) is preserved and the control becomes the interpreter’s initial state.

Let \(M\) be a machine, \(D\) a four-tape interpreter, \(x\) an input, and \(T\) a natural number such that \(M\) has halted within \(T\) steps on \(x\). Then there exists \(t \le T+1\) such that, after exactly \(t\) transitions on \(x\), the output-capture wrapper of \(M\) and \(D\) stands in the interpreter-entry configuration corresponding to the configuration of \(M\) after \(T\) steps: the control is the interpreter’s initial state, the full halted configuration of \(M\) — including its parked input head — is preserved, and the output of \(M\) is captured on the table tape.

Let \(c\) be an effective machine-coding scheme with canonizer time bound \(T_c\), let \(D\) be a four-tape interpreter, and let \(\alpha \) and \(x\) be bit strings. Start the output-capture wrapper of the composed prefix-extraction/canonizer machine of \(c\), with interpreter \(D\), on the self-delimiting pairing \(\langle \alpha , x\rangle \). Then there is a \(t \le 3\left\lvert \alpha \right\rvert +5+T_c(\left\lvert \alpha \right\rvert )\) such that after \(t\) transitions the control is the interpreter’s initial state, the physical input head is at position \(2\left\lvert \alpha \right\rvert +3\) (the start of the verbatim suffix), the interpreter’s first work tape holds — written from coordinate \(0\) and blank elsewhere — the serialization of the canonical transition table of the machine that \(c\) decodes from \(\alpha \), and the real output is still empty.