TCSLib

170 Complexity — Oblivious Setup

170.1 Overview

This module analyses the initialization (setup) phase of the length-only oblivious schedule machine attached to a Turing machine \(W\) over the Boolean alphabet and a padding parameter \(a\). The explicit configuration isolates the machine’s three controller tapes — the binary budget tape, the unary macrostep counter, and the sweep guide — and phase-by-phase run identities give the exact cost of the input reset, the copy of the input onto the guide, the fixed-width binary-to-unary budget conversion, and the two-sided guide-zone allocation. They compose into , the complete initialization run with its exact duration.

170.2 Declarations

Definition 170.1 Explicit setup configuration
✓

Let \(W\) be a Turing machine over the Boolean alphabet with \(k\) work tapes and let \(a \in \mathbb {N}\) be a padding parameter; the oblivious schedule machine built from \(W\) and \(a\) has \(k+3\) work tapes over the schedule alphabet. Given an input word \(x\) of schedule symbols, a base configuration \(c\) on \(x\), a controller phase \(q\) (possibly the halting state), an input-head position \(p \in \{ 0,\dots ,|x|+1\} \), integers \(b, u, g \in \mathbb {Z}\), and tape contents \(\beta , \mu , \gamma \colon \mathbb {Z}\to \Sigma \cup \{ \text{blank}\} \) (where \(\Sigma \) is the schedule alphabet), the associated setup configuration is the configuration with state \(q\) and input head at \(p\), whose first \(k\) work tapes and head positions agree with those of \(c\), whose last three (controller) tapes — the binary budget, unary macrostep counter, and sweep guide — have contents \(\beta , \mu , \gamma \) with heads at \(b, u, g\) respectively, and whose output agrees with that of \(c\).

Definition 170.2 Optional write on one tape
✓
#

Given a tape \(t \colon \mathbb {Z}\to A \cup \{ \text{blank}\} \), a cell \(z \in \mathbb {Z}\), and an optional write instruction, the resulting tape is \(t\) itself when no write is requested, and otherwise \(t\) updated at cell \(z\) with the requested (possibly blank) symbol.

Consider a setup configuration of the oblivious schedule machine built from a Boolean machine \(W\) with \(k\) work tapes and padding parameter \(a\), with input head at \(p\) and controller tapes \(\beta , \mu , \gamma \) with heads at \(b, u, g\). Applying a schedule action with next phase \(q'\), input-head move \(d \in \{ -1,0,+1\} \), and one (optional write, move) pair for each controller tape yields exactly the setup configuration with phase \(q'\), input head moved by \(d\) (clamped to \(\{ 0,\dots ,|x|+1\} \)), each controller tape updated by its optional write at the old head position, and each controller head shifted by its move; the first \(k\) work tapes and the output are untouched.

Lemma 170.4 Input symbol read in a setup configuration
✓

In a setup configuration on input \(x\) with input head at position \(p \in \{ 0,\dots ,|x|+1\} \), the symbol read from the input tape is blank when \(p = 0\), and otherwise it is the \((p-1)\)-st symbol of \(x\) (in \(0\)-indexed order), which is blank when \(p - 1 \ge |x|\).

Lemma 170.5 Controller tape reads in a setup configuration
✓

In a setup configuration with controller tapes \(\beta , \mu , \gamma \) and heads at \(b, u, g\), the symbols read from the three controller tapes are \(\beta (b)\), \(\mu (u)\), and \(\gamma (g)\) respectively.

Suppose the oblivious schedule machine is in a setup configuration in the reset-scan phase with input head at an interior position \(j \le |x|\); the controller tapes and heads are arbitrary. Then after exactly \(j\) steps the machine is in the same setup configuration except that the input head is at the left boundary (position \(0\)): the phase, all tapes, and all work heads are unchanged.

From a setup configuration in the reset-start phase with input head at an arbitrary position \(p \in \{ 0,\dots ,|x|+1\} \), running exactly \(\max (p,1)+1\) steps of the oblivious schedule machine leads to the setup configuration in the copy-left phase with input head at position \(1\); all controller tapes and heads are unchanged. (The reset begins with a mandatory left move, so even the right blank boundary and the empty input reach the left boundary before the final right move.)

Definition 170.8 Partially copied guide tape
✓
#

For \(j \in \mathbb {N}\), the partial guide after copying \(j\) input cells is the tape whose cell \(-1\) carries an interior mark (the virtual left boundary), whose cells \(z\) with \(0 \le z \lt j\) carry the origin mark at \(z = 0\) and interior marks otherwise, and whose remaining cells are blank.

Lemma 170.9 Extending the partial guide by one cell
✓
#

Updating the partial guide with \(j\) copied cells at cell \(j\) — writing the origin mark when \(j = 0\) and an interior mark otherwise — yields the partial guide with \(j+1\) copied cells.

Lemma 170.10 Origin uniqueness in the partial guide
✓
#

For \(j \gt 0\), a cell of the partial guide with \(j\) copied cells carries the origin mark if and only if it is cell \(0\).

Definition 170.11 Copy loop phase
✓
#

The controller phase of the copy loop after \(j\) copied symbols: the first-copy phase when \(j = 0\) (the origin mark has not yet been written) and the further-copy phase otherwise.

From a setup configuration in the copy-left phase with guide head at \(0\) and entirely blank guide tape, exactly two steps of the oblivious schedule machine write the virtual left boundary (an interior mark at guide cell \(-1\)) and reach the first-copy phase with guide head back at \(0\) over the partial guide with \(0\) copied cells; the input head, the budget and unary tapes, and their heads are unchanged. This holds for every input-head position, including the empty input.

Let \(j \le |x|\). From a setup configuration in the first-copy phase with input head at position \(1\) and guide head at \(0\) over the partial guide with \(0\) copied cells, exactly \(j\) steps lead to the copy phase for \(j\) copied symbols with input head at \(j+1\), guide head at \(j\), and guide tape the partial guide with \(j\) copied cells; the budget and unary tapes and heads are unchanged. In particular the input and guide heads make exactly the same number of right moves, and no data value influences a movement.

From a setup configuration in the copy phase for \(|x|\) copied symbols, with input head parked at the right boundary \(|x|+1\) (reading blank) and guide head at \(|x|\), a single step enters the copy-return phase, leaves both heads in place, and closes the copied zone by writing one more mark, producing the partial guide with \(|x|+1\) cells.

For all \(n, j \in \mathbb {N}\): from a setup configuration in the copy-return phase with guide head at \(j\) over the partial guide with \(n+1\) copied cells, exactly \(j+1\) steps reach the budget-start phase with guide head at the origin (cell \(0\)); all tapes and all other heads are unchanged.

Definition 170.16 Unary macrostep counter tape
✓
#

For \(N \in \mathbb {N}\), the unary tape with \(N\) markers has the origin sentinel at cell \(0\), unit markers on cells \(1,\dots ,N\), and blanks elsewhere.

Lemma 170.17 Appending one unary marker
✓
#

Updating the unary tape with \(N\) markers at cell \(N+1\) with a unit marker yields the unary tape with \(N+1\) markers.

Lemma 170.18 Origin uniqueness on the captured clock tape
✓

Let \(w\) be a bit word and consider its captured clock tape: the tape with the origin sentinel at cell \(0\), the \(i\)-th bit of \(w\) at cell \(i+1\) for \(0 \le i \lt |w|\), and blanks elsewhere. A cell of this tape carries the origin mark if and only if it is cell \(0\).

Lemma 170.19 Blank cell after the captured word
✓
#

On the captured clock tape of a bit word \(w\) (origin sentinel at cell \(0\), the bits of \(w\) on cells \(1,\dots ,|w|\)), cell \(|w|+1\) is blank.

For every \(j \in \mathbb {N}\): from a setup configuration in the budget-back phase with budget head at cell \(j\) over the captured clock tape of a bit word \(w\), exactly \(j+1\) steps reach the sentinel at the origin and move right once, entering the first append phase with budget head at cell \(1\); all tapes and all other heads are unchanged.

From a setup configuration in the budget-start phase with budget head at cell \(|w|+1\) (one cell beyond the captured clock tape of the bit word \(w\)), exactly \(|w|+2\) steps reach the first append phase with budget head at cell \(1\); the cost depends only on the width of \(w\), not on its bits, and all tapes and all other heads are unchanged.

Let \(j \le a+1\), where \(a\) is the padding parameter. From a setup configuration in append phase \(0\) with unary head at cell \(N+1\) over the unary tape with \(N\) markers, exactly \(j\) steps reach append phase \(j\) with unary head at cell \(N+j+1\) over the unary tape with \(N+j\) markers; each step writes exactly one unit marker, and all other tapes and heads are unchanged.

From a setup configuration in append phase \(0\) with unary head at cell \(N+1\) over the unary tape with \(N\) markers, exactly \(a+2\) steps append exactly \(a+1\) unit markers and enter the borrow phase with incoming borrow set: the unary head is then at cell \(N+(a+1)+1\) over the unary tape with \(N+a+1\) markers, and all other tapes and heads are unchanged.

Lemma 170.24 Shifting a tape zipper past a fixed word
✓

Present a tape as a zipper with frontier \(z \in \mathbb {Z}\), a list \(l\) of the (possibly blank) cells to the left of \(z\) listed nearest-first, and a list of the cells at and to the right of \(z\). If the right list decomposes as \(w \mathbin {+\! \! +} r\), then the same tape is presented by the zipper with frontier \(z + |w|\), left list \(\mathrm{reverse}(w) \mathbin {+\! \! +} l\), and right list \(r\).

Lemma 170.25 The captured clock tape as a zipper
✓

For every bit word \(w\), the captured clock tape of \(w\) (origin sentinel at cell \(0\), the bits of \(w\) on cells \(1,\dots ,|w|\), blanks elsewhere) equals the zipper tape with frontier at cell \(1\), left list consisting of the single origin sentinel, and right list the bits of \(w\), each encoded as a budget-bit symbol.

Lemma 170.26 The end zipper of a captured word
✓

For every bit word \(w\), the zipper tape with frontier \(1+|w|\), empty right list, and left list consisting of the reversed encoded bits of \(w\) followed by the origin sentinel equals the captured clock tape of \(w\).

Take a setup configuration and focus its budget lane: replace the state by \(q'\), the budget tape by the zipper tape with frontier \(z\), left list \(l\), and right list \(r\), and move the budget head to \(z\), keeping every other tape and head. The result is again a setup configuration, with the same base configuration, input head, unary and guide data, state \(q'\), budget head \(z\), and budget tape given by that zipper.

Let \(w\) be a bit word and \(c\) a Boolean incoming borrow, and recall the fixed-width borrow pass: it processes all of \(w\), subtracting the incoming borrow from its little-endian value while preserving its length, and returns an outgoing borrow flag together with the rewritten word. From a setup configuration in the borrow phase with flag \(c\) and budget head at cell \(1\) over the captured clock tape of \(w\), exactly \(|w|\) steps reach the borrow phase whose flag is the outgoing borrow, with budget head at \(1+|w|\) over the captured clock tape of the rewritten word; all other tapes and heads, and the parked input head, remain fixed.

From a setup configuration in the borrow phase with flag \(c\) and budget head at cell \(|w|+1\) (the blank cell after the captured clock tape of the bit word \(w\)), one step keeps every tape and head fixed and moves to the unary-start phase when \(c\) is true (the budget underflowed, i.e. is exhausted) and back to the budget-start phase otherwise.

One complete round of the budget controller — full rewind, append block of \(a+1\) unary markers, fixed-width borrow pass, and end test — costs exactly \(2|w| + (a+1) + 4\) steps, independently of the bits of the budget word \(w\). Starting in the budget-start phase with budget head at \(|w|+1\) over the captured clock tape of \(w\) and unary head at \(N+1\) over the unary tape with \(N\) markers, the round ends with the captured clock tape of the borrowed word (incoming borrow set), the unary tape with \(N + a + 1\) markers, and phase unary-start or budget-start according to the borrow’s underflow flag.

Let \(w\) be a bit word of little-endian value \(v\) and let \(N \in \mathbb {N}\). From a setup configuration in the budget-start phase with budget head at \(|w|+1\) over the captured clock tape of \(w\) and unary head at \(N+1\) over the unary tape with \(N\) markers, exactly \((v+1)\, \bigl(2|w| + (a+1) + 4\bigr)\) steps reach the unary-start phase with unary head at \(N + (a+1)(v+1) + 1\) over the unary tape with \(N + (a+1)(v+1)\) markers, the budget tape being the captured clock tape of some bit word \(w'\) with \(|w'| = |w|\) (the word keeps its full width as its high bits become zero); the guide tape and head and the input head are unchanged.

Lemma 170.32 Origin uniqueness on the unary tape
✓
#

A cell of the unary tape with \(N\) markers carries the origin mark if and only if it is cell \(0\).

Lemma 170.33 Unit markers of the unary tape
✓
#

For every \(j \lt N\), cell \(j+1\) of the unary tape with \(N\) markers carries a unit marker.

Lemma 170.34 Blank cell terminating the unary segment
✓
#

Cell \(N+1\) of the unary tape with \(N\) markers is blank.

Definition 170.35 Common phase of the two unary rewinds
✓
#

The controller phase used to rewind the unary counter: the unary-reset phase when the Boolean flag marks the final rewind, and the unary-back phase otherwise. Both rewinds follow the same path and differ only in their successor phase.

For every \(j \in \mathbb {N}\) and either rewind variant: from a setup configuration in the corresponding unary rewind phase with unary head at cell \(j\) over the unary tape with \(N\) markers, exactly \(j+1\) steps reach the successor phase — the start-center phase for the final rewind, the first rightward layout phase otherwise — with unary head at cell \(1\); no tape is written and all other heads are unchanged.

From a setup configuration in the unary-start phase with unary head at cell \(N+1\) over the unary tape with \(N\) markers, exactly \(N+2\) steps rewind the entire newly constructed unary segment and reach the first rightward layout phase with unary head at cell \(1\); all tapes and all other heads are unchanged.

Definition 170.38 Interior guide mark
✓
#

The symbol written to guide cell \(z\) during allocation: the origin mark when \(z = 0\) and an interior mark otherwise.

Definition 170.39 Partially allocated guide tape
✓
#

Given a direction (rightward or leftward), a guide tape \(\gamma \), and \(j \in \mathbb {N}\), the \(j\)-cell filled version of \(\gamma \) is the tape agreeing with \(\gamma \) except that each cell \(z\) with \(0 \le z \lt j\) (rightward) respectively \(0 \le -z \lt j\) (leftward) is overwritten with the guide mark of \(z\): the origin mark at \(0\) and interior marks elsewhere, independently of the previous contents.

Lemma 170.40 Empty allocation prefix
✓

Filling zero cells of a guide tape, in either direction, leaves the tape unchanged.

Lemma 170.41 Origin preservation under allocation
✓

If a guide tape carries the origin mark exactly at cell \(0\), then for every \(j\) and either direction, its \(j\)-cell filled version also carries the origin mark exactly at cell \(0\).

Lemma 170.42 One more allocated cell
✓

Updating the \(j\)-cell filled version of a guide tape at cell \(j\) (rightward) respectively \(-j\) (leftward) with the corresponding guide mark yields the \((j+1)\)-cell filled version.

Definition 170.43 Phases of the outward allocation passes
✓
#

The finite controller phase of an outward allocation pass, indexed by \(i \in \{ 0,1,2\} \): the rightward layout phases when the direction flag is set and the leftward layout phases otherwise. The two passes are symmetric.

Definition 170.44 Allocation head movement
✓
#

The guide-head movement of an allocation pass: one cell to the right for the rightward pass and one cell to the left for the leftward pass, independently of the cell contents.

Consider a setup configuration in layout phase \(i \in \{ 0,1,2\} \) of either direction, and suppose the unary tape reads a unit marker at the unary head and the guide tape reads the origin mark at the guide head exactly when that head is at cell \(0\). Then one step moves to layout phase \(i+1 \bmod 3\), writes the guide mark at the guide head, moves the guide head one cell in the chosen direction, and advances the unary head by one exactly when \(i = 2\); everything else is unchanged. Thus the controller spends three guide cells per unary marker.

Let \(\gamma \) be a guide tape carrying the origin mark exactly at cell \(0\), and suppose the unary tape reads a unit marker at the unary head. Then one step from layout phase \(i\) (of either direction) with guide head at \(\pm j\) over the \(j\)-cell filled version of \(\gamma \) leads to layout phase \(i+1 \bmod 3\) with guide head at \(\pm (j+1)\) over the \((j+1)\)-cell filled version, incrementing the unary head exactly when \(i = 2\).

Lemma 170.47 Cyclic phase as a remainder
✓
#

For every \(j \in \mathbb {N}\), the cyclic successor on \(\{ 0,1,2\} \) of \(j \bmod 3\) is \((j+1) \bmod 3\). Hence the finite allocation phase is the remainder modulo three of the number of guide cells already written.

Let \(\gamma \) be a guide tape carrying the origin mark exactly at cell \(0\), and let \(j \le 3B\). From layout phase \(0\) (of either direction) with unary head at cell \(1\) over the unary tape with \(B\) markers and guide head at cell \(0\) over \(\gamma \), exactly \(j\) steps lead to layout phase \(j \bmod 3\) with unary head at \(\lfloor j/3 \rfloor + 1\), guide head at \(\pm j\), and guide tape the \(j\)-cell filled version of \(\gamma \): the elapsed time equals the number of written guide cells, and the unary head moves once every three cells.

From layout phase \(0\) (of either direction) with unary head at cell \(B+1\) — the blank cell terminating the unary tape with \(B\) markers — and guide head at cell \(g\), one step writes an interior mark at guide cell \(g\), moves the guide head one further cell outward, keeps the unary head in place, and enters the right-edge or left-edge phase according to the direction.

Definition 170.50 Right half of the completed guide
✓
#

For \(R \in \mathbb {N}\), the right guide of radius \(R\) is the tape obtained from the partial guide with \(R+1\) copied cells by writing the right outer boundary marker at cell \(R+1\).

Lemma 170.51 Rightward filling extends the copied guide
✓

If \(n + 1 \le R\), then filling \(R\) cells rightward starting from the partial guide with \(n+1\) copied cells yields exactly the partial guide with \(R\) cells: only the positive prefix is overwritten.

Lemma 170.52 Origin uniqueness on the right guide
✓

A cell of the right guide of radius \(R\) carries the origin mark if and only if it is cell \(0\); the right-boundary write cannot alter the origin.

Lemma 170.53 Completion of the guide by the left pass
✓

Let \(R \gt 0\). Starting from the right guide of radius \(R\), filling \(R\) cells leftward and then writing an interior mark at cell \(-R\) and the left outer boundary marker at cell \(-R-1\) produces the completed guide of radius \(R\): origin mark at \(0\), interior marks at all \(z\) with \(0 \lt |z| \le R\), boundary markers at \(\pm (R+1)\), and blanks elsewhere.

From a setup configuration in the right-edge phase with unary head at cell \(B+1\) over the unary tape with \(B\) markers and guide head at cell \(R+1\) over the partial guide with \(R+1\) copied cells, one step writes the right outer boundary marker at guide cell \(R+1\), moves the unary and guide heads one cell left (to \(B\) and \(R\)), and enters the first layout-return phase; the resulting guide tape is the right guide of radius \(R\).

Suppose a setup configuration is in layout-return phase \(i \in \{ 0,1,2\} \) and the unary tape does not read the origin sentinel at the unary head. Then one step moves to layout-return phase \(i+1 \bmod 3\), moves the guide head one cell left, decrements the unary head exactly when \(i = 2\), and writes nothing on any tape.

Let \(j \le 3B\). From layout-return phase \(0\) with unary head at cell \(B\) over the unary tape with \(B\) markers and guide head at cell \(3B\) (over an arbitrary guide tape), exactly \(j\) steps lead to layout-return phase \(j \bmod 3\) with unary head at \(B - \lfloor j/3 \rfloor \) and guide head at \(3B - j\); no tape is written and all guide marks are unchanged.

From layout-return phase \(0\) with unary head at cell \(B\) over the unary tape with \(B\) markers and guide head at cell \(3B\) (over an arbitrary guide tape), exactly \(3B+1\) steps reach the origin and enter the first leftward layout phase with unary head at cell \(1\) and guide head at cell \(0\); no tape is written.

Let \(n + 1 \le B\). From the first rightward layout phase with unary head at cell \(1\) over the unary tape with \(B\) markers and guide head at cell \(0\) over the partial guide with \(n+1\) copied cells, exactly \(3B + 2\) steps reach radius \(3B\), install the right outer boundary marker, and enter the first layout-return phase with unary head at \(B\), guide head at \(3B\), and guide tape the right guide of radius \(3B\).

Let \(B \gt 0\). From the first leftward layout phase with unary head at cell \(1\) over the unary tape with \(B\) markers and guide head at cell \(0\) over the right guide of radius \(3B\), exactly \(3B + 2\) steps complete the fixed guide and enter the unary-reset phase with unary head at \(B\), guide head at the left outer boundary \(-3B - 1\), and guide tape the completed guide of radius \(3B\).

For every \(j \in \mathbb {N}\): from a setup configuration in the start-center phase with guide head at cell \(-j\) over the completed guide of radius \(R\), exactly \(j+1\) steps reach the origin and enter the macrostep-check phase with guide head at cell \(0\); all tapes and all other heads are unchanged.

Let \(n + 1 \le B\). From a setup configuration in the unary-start phase with unary head at cell \(B+1\) over the unary tape with \(B\) markers and guide head at cell \(0\) over the partial guide with \(n+1\) copied cells, exactly \(14B + 10\) steps produce the completed guide of radius \(3B\) and enter the macrostep-check phase with unary head at cell \(1\) and guide head at cell \(0\); the budget tape and head and the parked input head are unchanged.

From a setup configuration in the copy-left phase with input head at position \(1\), guide head at cell \(0\), and entirely blank guide tape, exactly \(2|x| + 4\) steps — covering both virtual boundary cells and the return to the origin — reach the budget-start phase with input head parked at position \(|x|+1\), guide head at cell \(0\), and guide tape the partial guide with \(|x|+1\) copied cells; the budget and unary tapes and heads are unchanged, and the native input stays parked from then on.

Lemma 170.63 Empty clock word equals empty unary budget
✓

The captured clock tape of the empty bit word equals the unary tape with zero markers: both consist of the origin sentinel at cell \(0\) and blanks everywhere else.

Lemma 170.64 Setup form of a halted clock configuration
✓

Let \(c\) be a configuration of the \(k\)-tape Boolean machine \(W\) on a Boolean input that has halted (its state is the halting state). Then the clock-stage embedding of \(c\) into the oblivious schedule machine — which keeps the work block of \(c\) and captures its entire output word on the budget tape — is itself a setup configuration: base the embedded configuration itself, phase reset-start, the embedded input-head position, budget head at cell \(m+1\) over the captured clock tape of the output word of \(c\) (where \(m\) is that word’s length), unary head at cell \(1\) over the unary tape with zero markers, and guide head at cell \(0\) over the blank tape.

Lemma 170.65 Macrostep retargeting of a setup configuration
✓

Modifying a setup configuration by changing only its phase to \(q'\) and its unary and guide head positions to \(u'\) and \(g'\) — keeping every tape, the budget head, and the input head fixed — again yields a setup configuration with the same remaining data.

From a setup configuration in the macrostep-check phase with unary head at cell \(1\) over the unary tape with \(B\) markers and guide head at cell \(0\) over the completed guide of radius \(3B\), exactly \(B\, \bigl(6\, (3B) + 8\bigr) + 1\) steps execute one full sweep per unary marker and reach the halted configuration with unary head at cell \(B+1\) and guide head at cell \(0\); every tape, the budget head, and the input head are unchanged.

Let \(w\) be a bit word of little-endian value \(v\), and suppose the input satisfies \(|x| + 1 \le (a+1)(v+1)\), where \(a\) is the padding parameter. Consider a setup configuration in the reset-start phase with input head at an arbitrary position \(p\), budget head at cell \(|w|+1\) over the captured clock tape of \(w\), unary head at cell \(1\) over the unary tape with zero markers, and guide head at cell \(0\) over the blank guide tape. Then there is a bit word \(w'\) with \(|w'| = |w|\) such that after exactly

\[ \bigl(\max (p,1)+1\bigr) + \bigl(2|x| + 4\bigr) + (v+1)\bigl(2|w| + (a+1) + 4\bigr) + \bigl(14\, (a+1)(v+1) + 10\bigr) \]

steps the machine is in the macrostep-check phase with input head parked at position \(|x|+1\), budget head at cell \(|w|+1\) over the captured clock tape of \(w'\), unary head at cell \(1\) over the unary tape with \((a+1)(v+1)\) markers, and guide head at cell \(0\) over the completed guide of radius \(3\, (a+1)(v+1)\): the binary counter retains its full width throughout.