202 Complexity — SAT
202.1 Overview
This module defines the languages \(\mathrm{SAT}\) and \(\mathrm{3SAT}\) over the audited binary string encoding of CNF formulas, and proves the membership half of the Cook–Levin plan: \(\mathrm{SAT} \in \mathrm{NP}\) and \(\mathrm{3SAT} \in \mathrm{NP}\) (the satisfying assignment is the certificate), together with the clause-splitting reduction \(\mathrm{SAT} \le _p \mathrm{3SAT}\) [AB09, §2.3.1, Theorem 2.10, Lemma 2.14]. Decoding of strings is total, with the empty (satisfiable, vacuously 3CNF) formula as fallback, so every non-well-formed string lies in both languages. The bulk of the module is a private layer of concrete machine constructions: a finite-state syntax scanner for the CNF grammar, a streaming formula evaluator, a clause-splitting transform with fresh-variable allocation and its equisatisfiability proof, and a modular streaming transducer (pairing, suffix extraction, append, padding, call-stopping, and host-loop combinators) realizing the reduction in polynomial time.
Throughout this chapter, a CNF formula over \(\mathbb {N}\)-indexed variables is a list of clauses, each clause a list of literals \((v,b)\) with variable index \(v \in \mathbb {N}\) and polarity \(b \in \{ 0,1\} \). The serialization of a formula writes each clause as a leading \(1\) followed by its serialized literals — a literal \((v,b)\) becomes \(1^{v+1}\, 0\, b\) — and a closing \(0\), with one final \(0\) terminating the formula. The pair encoding \(\mathrm{pair}(u,v)\) of two words doubles every bit of \(u\), then appends the separator \(01\) followed by \(v\).
202.2 Declarations
Let \(f\) be a function from binary strings to binary strings. If there exist a finite multi-tape Turing machine over the binary alphabet and a constant \(C\) such that the machine computes \(f\) within \(C\cdot (n+1)\) steps on every input of length \(n\), then \(f\) is polynomial-time computable.
For every fixed binary word \(w\), the constant function sending every binary string to \(w\) is polynomial-time computable.
Let \(p\) be a Boolean predicate on binary strings and \(f, g\) functions on binary strings. If the single-bit function \(x \mapsto [p(x)]\) and both \(f\) and \(g\) are polynomial-time computable, then so is the function mapping \(x\) to \(f(x)\) when \(p(x)\) holds and to \(g(x)\) otherwise.
Let \(p\) and \(q\) be Boolean predicates on binary strings. If the single-bit functions \(x \mapsto [p(x)]\) and \(x \mapsto [q(x)]\) are both polynomial-time computable, then so is \(x \mapsto [p(x) \wedge q(x)]\).
Let \(M\) and \(U\) be finite multi-tape Turing machines over the binary alphabet, let \(f, g\) be functions on binary strings and \(T_1, T_2 : \mathbb {N} \to \mathbb {N}\) time bounds. If \(M\) computes \(f\) within \(T_1\), and for every input \(x\) the machine \(U\) run on \(f(x)\) halts within \(T_2(|x|)\) steps with output \(g(x)\), then some finite machine computes \(g\) within time \(n \mapsto 2\, T_1(n) + T_2(n) + 2\).
The language \(\mathrm{SAT}\) over the binary alphabet is the set of all strings whose total CNF decoding is a satisfiable formula [AB09, Section 2.3.1]. Decoding is total, with the empty (satisfiable) formula as fallback, so every non-well-formed string belongs to \(\mathrm{SAT}\).
The language \(\mathrm{3SAT}\) over the binary alphabet is the set of all strings whose decoded CNF formula has width at most three (every clause carries at most three literal occurrences) and is satisfiable [AB09, Section 2.3.1]. The fallback formula has no clauses, so non-well-formed strings belong to \(\mathrm{3SAT}\) as well.
Given a binary word \(u\), the associated truth assignment \(\mathbb {N} \to \{ 0,1\} \) maps a variable index \(v\) to the \(v\)-th bit of \(u\), and to \(0\) (false) whenever \(v \ge |u|\).
For every binary string \(x\), the CNF formula decoded from \(x\) is satisfiable if and only if there exists a word \(u\) of length exactly \(|x| + 1\) such that the decoded formula evaluates to true under the assignment that reads variable \(v\) off the \(v\)-th bit of \(u\) (default false). [AB09, Theorem 2.10, membership]
If the certificate-split solver with parameters \((1,1)\), searching for a split of a total length \(N\), returns the value \(i\), then \(i + (i + 1) = N\).
If natural numbers \(i\) and \(N\) satisfy \(i + (i + 1) = N\), then the certificate-split solver with parameters \((1,1)\) on total length \(N\) succeeds and returns exactly \(i\); in particular this covers \(N = 1\), \(i = 0\).
The Boolean test on a CNF formula that checks that every clause has at most three literal occurrences; repeated literals count as distinct occurrences.
For every CNF formula \(\varphi \), the Boolean width scan returns true if and only if \(\varphi \) has width at most \(3\), i.e. every clause of \(\varphi \) has at most three literals.
Given a flag (plain SAT or 3SAT mode) and a binary string \(z\), the verifier verdict: split \(|z|\) as \(i + (i+1)\) and reject outright if no such split exists; otherwise decode the first \(i\) bits of \(z\) to a formula \(\varphi \) and read an assignment off the remaining \(i + 1\) bits, and accept exactly when (in 3SAT mode) \(\varphi \) passes the width-three test and (in both modes) \(\varphi \) evaluates to true under that assignment.
For each mode flag, the language of all binary strings on which the total verifier verdict accepts; these are the two verifier languages for the prescribed certificate parameters \((1,1)\).
Let \(x\) and \(u\) be binary words with \(|u| = |x| + 1\). Then the verifier verdict on the concatenation \(x \mathbin {+\! \! +} u\) equals the conjunction of the (mode-guarded) width-three test of the formula decoded from \(x\) with the evaluation of that formula under the assignment read off \(u\).
A binary string \(x\) belongs to \(\mathrm{SAT}\) if and only if there exists a certificate \(u\) with \(|u| = |x| + 1\) such that the concatenation \(x \mathbin {+\! \! +} u\) belongs to the plain-mode verifier language.
A binary string \(x\) belongs to \(\mathrm{3SAT}\) if and only if there exists a certificate \(u\) with \(|u| = |x| + 1\) such that \(x \mathbin {+\! \! +} u\) belongs to the 3SAT-mode verifier language. The width condition depends only on the instance \(x\), so the same certificate as for \(\mathrm{SAT}\) suffices.
For every binary string \(x\), if the leading-ones scanner returns the count \(k\) and suffix \(s\), then \(x = 1^{k} \mathbin {+\! \! +} s\): the scanner partitions its input into the counted run of ones and the remaining suffix.
If the literal parser succeeds on a binary string \(x\), returning a literal \(\ell \) and a remainder \(r\), then \(x\) is exactly the serialization of \(\ell \) followed by \(r\).
If the fuel-indexed clause parser succeeds on a binary string \(x\), returning a clause \(C\) and a remainder \(r\), then \(x\) is exactly the serialization of \(C\) (including its terminator) followed by \(r\).
If the fuel-indexed formula parser succeeds on a binary string \(x\), returning a formula \(\varphi \) and a remainder \(r\), then \(x\) is exactly the serialization of \(\varphi \) — every clause marker and the final terminator — followed by \(r\).
If the exact-consumption CNF parser succeeds on a binary string \(x\), returning the formula \(\varphi \), then \(x\) equals the serialization of \(\varphi \).
The transition function of the six-state CNF syntax automaton over \(\{ 0,1\} \) is defined on the positions formula, clause, unary index, polarity, exact end, and error as follows. At formula level a \(1\) leads to clause level and a \(0\) to exact end; at clause level a \(1\) leads to the index position and a \(0\) back to formula level; the index position stays on \(1\) and moves to polarity on \(0\); polarity returns to clause level on either bit; exact end and error move to error on every bit.
For each of the six scanner positions, the residual grammar of that position is the set of binary strings that may legally remain to be read: at formula level, the serializations of CNF formulas; at clause level, a serialized clause followed by a serialized formula; at index level, a unary run \(1^v\) followed by \(0\), a polarity bit, a serialized clause, and a serialized formula; at polarity level, one arbitrary bit followed by a serialized clause and a serialized formula; at exact end, only the empty string; at the error position, no string at all.
For every scanner position \(q\), bit \(b\), and binary string \(x\): the string \(b :: x\) lies in the residual grammar of \(q\) if and only if \(x\) lies in the residual grammar of the position reached from \(q\) on reading \(b\).
The empty string lies in the residual grammar of a scanner position \(q\) if and only if \(q\) is the exact-end position.
For every scanner position \(q\) and binary string \(x\): \(x\) lies in the residual grammar of \(q\) if and only if folding the grammar transition over \(x\) starting at \(q\) ends in the exact-end position.
The Boolean result of the complete syntax scan of a binary string: fold the six-state grammar transition over the whole string starting at the formula position and test whether the exact-end position is reached.
For every binary string \(x\), the Boolean syntax scan of \(x\) returns true exactly when the exact-consumption CNF parser succeeds on \(x\). This holds on every string, including the empty input, unfinished literals, and strings with trailing garbage.
Given a finite state set \(S\) with a transition \(S \times \{ 0,1\} \to S\), a start state, and an accepting predicate on \(S\), the one-way scanner is the finite Turing machine with no work tapes that reads its input left to right applying the transition, and upon reaching the right boundary emits the single bit given by the accepting predicate at the final state and halts.
For an input word \(x\), a control state \(q\), and a position \(i \le |x|\), the scanner configuration is the configuration of a zero-work-tape machine on input \(x\) in control state \(q\), with the input head just before position \(i\) and empty output.
Let a one-way scanner read input \(x\) in state \(q\) at position \(i \lt |x|\). One machine step moves silently to the state obtained by applying the transition to the \(i\)-th input bit, with the head advanced to position \(i+1\).
Let the input decompose as \(x = p \mathbin {+\! \! +} r\). Started in any state \(q\) at position \(|p|\), the one-way scanner halts after exactly \(|r| + 1\) steps with output the single bit obtained by applying the accepting predicate to the fold of the transition over \(r\) from \(q\); no earlier step emits.
Let \(S\) be a finite set with transition function \(\delta : S \times \{ 0,1\} \to S\), start state \(s_0 \in S\), and accepting predicate \(\alpha \) on \(S\). On every input \(x\) of length \(n\), the one-way scanner built from these data halts within \(n + 1\) steps, and its output is the single bit \(\alpha (\delta ^*(s_0, x))\), where \(\delta ^*(s_0, x)\) is the state reached by folding \(\delta \) over \(x\) from \(s_0\).
The single-bit function returning the Boolean result of the complete CNF syntax scan is polynomial-time computable; the witnessing machine is a one-way finite-state scanner, and the result concerns every input string, not merely serialized formulas.
The control-state type of the streaming formula evaluator: either one of four administrative states (capture return, input rewind, dispatch, certificate rewind), or a semantic phase — one of five streaming positions (formula, clause, unary index, polarity, rewind) — together with a formula truth bit, a clause truth bit, and a flag indicating that the second copy of a doubled input bit is to be skipped.
The embedding of a streaming phase, two accumulator bits, and a skip flag as a semantic control state of the evaluator, with the input poised at a doubled bit unless the skip flag is set.
Let \(M\) be a base machine with \(k\) work tapes. Given an input move \(m\), a certificate-head move \(d\), an optional output bit \(b\), and an optional target state \(q\), the administrative evaluation action is the action of the evaluator over \(M\) that writes nothing, keeps the first \(k\) work heads stationary, moves the input head by \(m\) and the last (certificate) head by \(d\), emits \(b\) when present, and switches to \(q\) (halting when \(q\) is absent).
Given a certificate-extractor machine \(M\) with \(k\) work tapes, the evaluator is a finite machine with \(k + 1\) work tapes that first simulates \(M\), capturing its output (the certificate) on the fresh last tape, then rewinds the native input and the certificate buffer, and finally streams a previously validated doubled serialized formula, evaluating it clause by clause against the certificate: unary index walks advance the certificate head, the polarity bit is compared with the certificate cell, and clause and formula truth bits are accumulated in finite control. No physical output occurs before the single final verdict bit. [AB09, Theorem 2.10, membership]
The canonical configuration of the evaluator during its streaming phase: the first \(k\) work tapes hold a saved configuration of the extractor machine, the last tape holds the immutable certificate word \(u\) with its head at a stated integer offset, the control is a stated semantic state, the input head sits before a stated position, and the output is empty.
In the canonical evaluation configuration at input position \(i\) on input \(w\), the symbol read by the input head is the optional \(i\)-th entry of \(w\); it does not depend on the saved extractor bank.
Let \(u\) be a certificate word and \(j \in \mathbb {Z}\). In every canonical evaluation configuration with certificate \(u\) and certificate head at offset \(j\), the symbol read by the last work head is the cell of the buffer tape of \(u\) at offset \(j\), that is, the \(j\)-th bit of \(u\) when \(0 \le j \lt |u|\) and the blank otherwise.
Applying a non-emitting administrative evaluator action to a canonical evaluation configuration yields the canonical configuration with the prescribed new control state, the input position moved as stated, and the certificate head displaced by the stated amount; the saved extractor bank and the empty output are preserved.
Let \(w\) be an input and \(i \lt |w|\). From a canonical evaluation configuration at input position \(i\) in a semantic state with phase \(q\), accumulator bits \(a\) and \(c\), and the skip flag set, one evaluator step yields the canonical configuration at position \(i + 1\) in the same phase with the same accumulator bits and the skip flag cleared; the certificate head, the saved bank, and the empty output are unchanged.
Suppose the evaluator’s transition at a semantic state on the current input bit is the administrative action moving right, displacing the certificate head by \(d\), and entering a new semantic state with the skip flag set. Then two machine steps — the semantic transition followed by its silent skip — consume the doubled input bit: the input position advances by two, the certificate head by \(d\), and the control reaches the new semantic state with the skip flag cleared. The certificate head moves only on the first of the two physical transitions.
Let \(q\) be an evaluator control state whose transition moves the certificate head left while its cell is occupied and otherwise steps right into a destination state. For every \(n \le |u|\), starting from the canonical configuration with certificate head at offset \(n - 1\), exactly \(n + 1\) steps return the head to offset \(0\) in the destination state, preserving all native input and output fields.
The word operation that doubles every bit of a binary string: each bit \(b\) is replaced by the two bits \(b\, b\). This is the prefix format used by the native pair encoding.
For every binary string \(x\), the doubled word has length exactly \(2\, |x|\).
Suppose the evaluator’s input contains, at the current position, the doubling of a unary run \(1^n\). In the index phase, exactly \(2n\) steps consume the doubled run, advancing the input position by \(2n\) and the certificate head by \(n\), leaving the phase and both accumulator bits unchanged. (The first one of a literal is consumed by the clause phase, so this scan counts the variable index itself.)
Suppose the evaluator’s input contains, at the current position, the doubling of a serialized literal \((v, b)\) with \(v \lt |u|\) for the certificate \(u\). Starting in the clause phase with clause bit \(c\), exactly \(3v + 8\) steps process the literal: the input advances by \(2(v + 3)\), the certificate head walks to position \(v\), the polarity is compared with the \(v\)-th certificate bit, the clause bit becomes \(c \vee (u_v = b)\), and the certificate head returns to \(0\).
Let \(u\) be the certificate word on the evaluator’s last tape and \(C\) a clause all of whose variable indices are below \(|u|\), with serialization \(\mathrm{ser}(C)\). Suppose the evaluator’s input is a word \(p\), followed by the doubling of \(\mathrm{ser}(C)\), followed by a word \(r\). Started at input position \(|p|\) in the clause phase with formula bit \(a\), clause bit \(c\), and certificate head at \(0\), there is a number \(t \le 3\, |\mathrm{ser}(C)|\) of steps after which the evaluator is in the formula phase with formula bit \(a \wedge (c \vee C(u))\), where \(C(u)\) is the truth value of \(C\) under the assignment read off \(u\), with the clause bit reset, input position \(|p| + 2\, |\mathrm{ser}(C)|\), and certificate head at \(0\). No output bit is emitted by this pass, even for an empty or false clause.
Let \(u\) be the certificate word on the evaluator’s last tape and \(\varphi \) a CNF formula all of whose variable indices are below \(|u|\), with serialization \(\mathrm{ser}(\varphi )\). Suppose the evaluator’s input is a word \(p\), followed by the doubling of \(\mathrm{ser}(\varphi )\), followed by a word \(r\). Started at input position \(|p|\) in the formula phase with formula bit \(a\), clause bit false, and certificate head at \(0\), there is a number \(t \le 3\, |\mathrm{ser}(\varphi )|\) of steps after which the evaluator is halted and its output is the single bit \(a \wedge \varphi (u)\), where \(\varphi (u)\) is the truth value of \(\varphi \) under the assignment read off \(u\); only the final formula terminator emits.
Let a finite multi-tape machine \(M\) compute output \(y\) on input \(x\) within \(T\) steps. Then there is a time \(t \le T\) such that \(M\) is still live at every time before \(t\), halts exactly at time \(t\), and its output at time \(t\) is \(y\): the first halting transition can be selected while retaining the final emission.
Let the extractor machine \(M\) compute the certificate \(u\) on input \(w\) within \(T\) steps. Then within \(T + |w| + |u| + 5\) steps from its initial configuration, the evaluator built over \(M\) reaches the canonical evaluation configuration: some saved bank of \(M\), the certificate \(u\) on the last tape with head at \(0\), the input head at \(0\), formula phase with formula bit true, and empty output.
There exist a single finite machine \(E\) and a constant \(A\) such that for every CNF formula \(\varphi \) and every certificate word \(u\) covering all variables of \(\varphi \) (each literal index below \(|u|\)), the machine \(E\), run on the pair encoding of the serialization of \(\varphi \) with \(u\), halts within \(A \cdot (\ell + 1)\) steps — \(\ell \) the length of that paired input — and outputs the single bit giving the truth value of \(\varphi \) under the assignment read off \(u\).
Given a binary string \(z\): if \(|z|\) splits as \(i + (i + 1)\) for some \(i\), return the pair encoding of the first \(i\) bits with the remaining \(i + 1\) bits; otherwise return the empty word as failure result.
For a binary string \(z\), the recovered instance of \(z\) is the first component of the decoded catalog split of \(z\), and is the empty word when the split or its decoding fails.
For a binary string \(z\), the recovered certificate of \(z\) is the second component of the decoded catalog split of \(z\) (the certificate region), and is the empty word when the split or its decoding fails.
The Boolean test that the catalog split of a string succeeds and decodes as a pair; in particular this is false for every string of even length.
For a binary string \(z\), the full validity guard of \(z\) is the Boolean conjunction of the split validity of \(z\) with the complete CNF syntax scan of the instance recovered from \(z\); in particular it is false whenever the split of \(z\) fails.
The safe input handed to the evaluator: the catalog split of the string when the full validity guard holds, and otherwise the pair encoding of the serialized empty formula with the empty certificate. Thus malformed formulas are replaced before the evaluator runs, and no semantic rejection can precede validation.
The Boolean value of the evaluation after the syntax pass: when the full validity guard holds, the truth value of the decoded instance under the assignment read off the recovered certificate; otherwise true (the fallback empty formula evaluates to true).
Let \(\varphi \) be a CNF formula, \(C\) a clause of \(\varphi \), and \(\ell \) a literal of \(C\). Then the variable index of \(\ell \) is strictly below the variable bound of \(\varphi \) (the maximum over all occurring indices \(v\) of \(v + 1\)).
For every binary string \(z\) there exist a CNF formula \(\varphi \) and a word \(u\) such that the safe evaluator request on \(z\) is exactly the pair encoding of the serialization of \(\varphi \) with \(u\), every variable index occurring in \(\varphi \) is below \(|u|\), and the truth value of \(\varphi \) under the assignment read off \(u\) equals the safe evaluation value of \(z\). This holds also on failed splits and failed parses.
The following four functions on binary strings are polynomial-time computable: the single-bit split-validity test, the instance projection, the single-bit syntax scan of the projected instance, and the safe evaluator request assembly.
The single-bit function sending a binary string \(z\) to its safe evaluation value is polynomial-time computable: the uniform evaluator is applied only on safe requests, which are certified serializations with covering certificates.
The single-bit function computing the plain-mode (SAT) verifier verdict on a binary string is polynomial-time computable: failed splits are rejected, failed parses take the accepting fallback branch, and all remaining inputs go through the safe evaluation pipeline.
For either mode flag: if the single-bit function computing the verifier verdict is polynomial-time computable, then the corresponding verifier language belongs to the class \(\mathrm{P}\).
The language \(\mathrm{SAT}\) — binary strings whose total CNF decoding is satisfiable — belongs to \(\mathrm{NP}\): a satisfying assignment, encoded as a certificate of exactly \(|x| + 1\) bits, is verified in polynomial time. [AB09, Theorem 2.10, membership]
For every \(n \in \mathbb {N}\), the saturated width counter of \(n\) is \(\min (n, 3)\), viewed as one of the four values \(0, 1, 2, 3\); the width scanner keeps this counter in finite control.
The transition of the separate width pass, which is run only after the complete syntax pass, acts on triples consisting of a position of the six-state syntax automaton, a saturated literal counter in \(\{ 0,1,2,3\} \), and a goodness flag. At formula level it follows the syntax automaton and resets the counter; at clause level a \(1\) (the start of a literal) moves to the index position, increments the saturated counter, and clears the flag if the counter was already \(3\), while a \(0\) returns to formula level with the counter reset; at every other position it follows the syntax automaton and leaves counter and flag unchanged. The pass never emits.
For every \(n \in \mathbb {N}\), every counter value \(c\), and every flag \(g\), folding the width-pass transition over the unary run \(1^n\) from the index position with counter \(c\) and flag \(g\) returns exactly the same state: index bits change neither the position, nor the counter, nor the flag.
Let \(\ell \) be a literal, \(c \in \{ 0,1,2,3\} \) a counter value, and \(g\) a Boolean flag. Folding the width-pass transition over the serialization of \(\ell \), from the clause position with counter \(c\) and flag \(g\), returns the clause position with counter \(\min (c + 1, 3)\) and flag \(g \wedge [c \lt 3]\), independently of the variable index and polarity of \(\ell \).
Let \(C\) be a clause, \(c \in \{ 0,1,2,3\} \) a counter value, and \(g\) a Boolean flag. Folding the width-pass transition over the serialization of \(C\), from the clause position with counter \(c\) and flag \(g\), returns the formula position with counter \(0\) and flag \(g \wedge [c + |C| \le 3]\), where \(|C|\) counts literal occurrences including repetitions.
Folding the width-pass transition over the serialization of a CNF formula \(\varphi \) from the initial state ends at the exact-end position with counter zero and the goodness flag conjoined with the Boolean width-three test of \(\varphi \); every clause is checked and the empty formula passes vacuously.
For a binary string \(x\), the width scan of \(x\) is the final goodness flag obtained by folding the width-pass transition over \(x\) from the initial state (formula position, counter \(0\), flag true).
For every CNF formula \(\varphi \), the width scan of the serialization of \(\varphi \) equals the Boolean width-three test of \(\varphi \), which is true exactly when every clause of \(\varphi \) has at most three literal occurrences.
The single-bit width-scan function is polynomial-time computable, realized by a one-way finite-state scanner with no work tapes and time exactly \(n + 1\).
The single-bit function computing the 3SAT-mode verifier verdict on a binary string is polynomial-time computable: the machine validates the entire syntax before running the width pass, and runs the evaluation pass only after width success; split failure rejects, while syntax failure accepts the empty fallback.
The language \(\mathrm{3SAT}\) — binary strings whose decoded formula is a satisfiable 3CNF — belongs to \(\mathrm{NP}\), with the same certificate parameters as \(\mathrm{SAT}\): a satisfying assignment of exactly \(|x| + 1\) bits, verified in polynomial time after an additional width check. [AB09, Theorem 2.10, membership]
Let \(C\) be a clause and \(a, b\) two truth assignments that agree on the variable index of every literal occurring in \(C\). Then \(C\) evaluates identically under \(a\) and under \(b\).
Given a head literal \(h\), a list \(R\) of remaining literals, and a fresh-variable cursor \(n \in \mathbb {N}\), the clause-splitting chain is defined by recursion on \(R\) and returns a CNF formula together with the next unused cursor. If \(R\) has at least three literals \(b, c, d, \dots \), the chain is the link clause \([h,\, b,\, (n,\mathrm{true})]\) followed by the chain on head \((n,\mathrm{false})\), remaining literals \(c, d, \dots \), and cursor \(n + 1\), whose returned cursor is kept. Otherwise the chain is the single clause consisting of \(h\) followed by \(R\), with the cursor \(n\) unchanged. [AB09, Section 2.3.5, proof of Lemma 2.14]
Splitting of a single clause at a fresh-variable cursor: the empty clause is preserved as the formula containing just the empty clause (which must remain false), and a nonempty clause is split by the chain construction.
For every head literal, remaining clause, and starting cursor \(n\), the cursor returned by the chain construction is at least \(n\): the fresh-variable allocator never moves backwards.
Every clause of the formula emitted by the chain construction has at most three literals.
Let \(a\) be a truth assignment satisfying the formula emitted by the chain construction on a head literal, remaining clause, and cursor. Then \(a\) satisfies the original clause (head followed by the remaining literals). No freshness hypothesis is needed in this direction.
Let a clause with head literal, a second literal \(b\), and a tail have all its variable indices below \(n\), and let \(a\) be an assignment satisfying it. Then there is an assignment \(a'\) agreeing with \(a\) below \(n\) such that \(a'\) satisfies both the link clause \([\mathrm{head},\, b,\, (n,\mathrm{true})]\) and the continuation clause headed by \((n,\mathrm{false})\) followed by the tail; the fresh value \(a'(n)\) is the truth of the tail under \(a\).
Let a clause (head plus remaining literals) have all variable indices below \(n\), and let \(a\) be an assignment satisfying it. Then there is an assignment \(a'\) agreeing with \(a\) on all indices below \(n\) that satisfies the formula emitted by the chain construction at cursor \(n\).
If every variable index of the input clause (head plus remaining literals) is below the starting cursor \(n\), then every variable index occurring in the formula emitted by the chain construction is below the returned cursor.
For every clause \(C\) and cursor \(n\), the cursor returned by splitting \(C\) at \(n\) is at least \(n\); this includes the empty clause.
For every clause \(C\) and cursor \(n\), every clause of the formula obtained by splitting \(C\) at \(n\) has at most three literals.
If every variable index of a clause \(C\) is below the cursor \(n\), then every variable index occurring in the formula obtained by splitting \(C\) at \(n\) is below the returned cursor.
Every truth assignment satisfying the formula obtained by splitting a clause \(C\) at some cursor also satisfies \(C\) itself.
Let a clause \(C\) have all variable indices below \(n\) and let \(a\) be an assignment satisfying \(C\). Then some assignment agreeing with \(a\) below \(n\) satisfies the formula obtained by splitting \(C\) at \(n\).
For a CNF formula \(\varphi \) and a fresh-variable cursor \(n\), the threaded clause transform of \(\varphi \) at \(n\) is obtained by splitting each clause of \(\varphi \) in order, threading one global fresh-variable cursor from clause to clause starting at \(n\), and concatenating the resulting 3CNF pieces; the final cursor is returned alongside. [AB09, Section 2.3.5, proof of Lemma 2.14]
If every variable index occurring in a CNF formula \(\varphi \) is strictly below \(n\), then the variable bound of \(\varphi \) (the maximum of \(v + 1\) over occurring indices \(v\)) is at most \(n\).
For every CNF formula \(\varphi \) and cursor \(n\), the formula produced by the threaded clause transform of \(\varphi \) at \(n\) has width at most three.
Every truth assignment satisfying the threaded clause transform of a CNF formula \(\varphi \) also satisfies \(\varphi \) itself, with the same assignment.
Let a CNF formula \(\varphi \) have all variable indices below \(n\), and let \(a\) be an assignment satisfying \(\varphi \). Then some assignment agreeing with \(a\) on all indices below \(n\) satisfies the threaded clause transform of \(\varphi \) at cursor \(n\).
The formula-level SAT-to-3SAT transform: run the threaded clause transform starting the fresh-variable cursor at exactly the variable bound of the input formula, so that all allocated variables are genuinely fresh.
For every CNF formula \(\varphi \), the clause-splitting transform of \(\varphi \) is satisfiable if and only if \(\varphi \) is satisfiable. [AB09, Lemma 2.14]
The string-level SAT-to-3SAT reduction is the map on binary strings that decodes its input to a CNF formula (with the empty formula as fallback for malformed inputs), applies the clause-splitting transform (fresh variables allocated from the decoded formula’s variable bound upwards), and serializes the result. [AB09, Lemma 2.14]
For every binary string \(x\) — with no well-formedness hypothesis — \(x\) belongs to \(\mathrm{SAT}\) if and only if the image of \(x\) under the string-level reduction belongs to \(\mathrm{3SAT}\).
If the exact CNF parser fails on a binary string \(x\), then the string-level reduction maps \(x\) to the serialization of the (unchanged) empty formula.
For every clause \(C\), the serialization of \(C\) has length at least \(|C| + 1\), where \(|C|\) counts literal occurrences: there is room for every literal and the terminator.
Given an input move \(m\), optional writes \(w_0, w_1\) and head moves \(d_0, d_1\) for the two work tapes, an optional output bit \(b\), and an optional next state \(q\), the two-tape reduction action is the action of the 35-state clause-splitting transducer performing exactly these operations; work tape \(0\) is a unary fresh-variable counter and work tape \(1\) a temporary literal buffer.
A 35-state, two-tape candidate transducer for the clause-splitting reduction on previously validated serialized CNF words: states 0–1 install a permanent left marker on the literal buffer, states 2–6 silently compute the maximum unary literal length on the counter tape, states 7–8 rewind the native input, and states 9–34 form a proposed streaming serializer. Only the initialization, the maximum pass, and the rewind are verified for this machine; it is not itself a polynomial-time witness.
For every \(n \in \mathbb {N}\), the canonical unary counter tape of length \(n\) is the tape content holding a one at each offset \(0, \dots , n - 1\) and a blank at every other integer offset; its occupied length \(n\) represents the next unused variable index.
The literal-buffer tape content determined by a word and a cut position: cells before the cut have been erased, cells from the cut onwards carry the word’s remaining bits, and the cell at offset \(-1\) carries a permanent marker allowing return even after the payload has been completely erased.
Given an input \(x\), an optional control state \(q\), a position \(i \le |x|\), a counter length \(n\), a buffer tape \(B\), head offsets \(a, b \in \mathbb {Z}\), and an output word \(o\), the canonical reduction frame is the configuration of the 35-state transducer in control \(q\), with the input head just before position \(i\), the unary counter tape of length \(n\) on work tape \(0\) with head at \(a\), the buffer tape \(B\) on work tape \(1\) with head at \(b\), and accumulated output \(o\).
Let \(x\) be an input and \(i \le |x|\). In every canonical reduction frame on input \(x\) at input position \(i\), the symbol read by the input head is the \(i\)-th bit of \(x\) when \(i \lt |x|\), and the blank when \(i = |x|\).
The unary counter tape of length \(n\) holds a one at every nonnegative offset \(j \lt n\) and a blank at every offset \(j \ge n\): its occupied cells are exactly its unary prefix.
The unary counter tape of any length is blank at offset \(-1\).
Let \(n, j \in \mathbb {N}\) with \(j \le n\). Writing a one at offset \(j\) of the unary counter tape of length \(n\) yields the unary counter tape of length \(\max (n, j + 1)\): writing within the current prefix preserves it, while writing its right blank extends the length by one.
Applying a two-tape reduction action to a canonical reduction frame yields the canonical frame whose input position, counter tape, buffer tape, both head offsets, and appended output are exactly as prescribed by the action’s components; this frame-level calculus is shared by the maximum pass and the streaming serializer.
If the transducer’s transition at the current state, input symbol, and work symbols is a silent action with no writes, then one machine step from the canonical reduction frame changes only the control state and the three head positions, as prescribed; the counter length, buffer, and output are unchanged.
Running the clause-splitting transducer for exactly one step from any configuration coincides with applying its single-step transition.
Let \(q\) be a transducer state whose transition moves the counter head left while its cell is occupied and otherwise steps right into a destination state. For every \(r \le n\), starting from the canonical frame with counter length \(n\) and counter head at offset \(r - 1\), exactly \(r + 1\) silent transitions reach the destination state with the counter head at \(0\); input position, buffer, and output are untouched.
Suppose the input contains a unary run \(1^v\) at the current position and the transducer is in its index-scanning state with counter length \(n\) and counter head at \(j \le n\). Then exactly \(v\) steps consume the run, advancing the input by \(v\), moving the counter head to \(j + v\), and extending the counter length to \(\max (n,\, j + v)\).
Suppose the input contains a serialized literal \((v,\mathrm{pol})\) at the current position and the transducer is in its clause-level maximum state with counter length \(n\) and counter head at \(0\). Then exactly \(2v + 5\) transitions consume the literal, record the counter length \(\max (n,\, v + 1)\), restore the counter head to \(0\), and return to the same state with the input advanced by \(v + 3\).
For lists of natural numbers \(a\) and \(b\), folding the maximum (with base \(0\)) over the concatenation \(a \mathbin {+\! \! +} b\) equals the maximum of the two separate folds.
The maximum, over all literals of a clause, of the literal’s variable index plus one (with base \(0\)); this is the clause-level accumulator of the scanner invariant.
The variable bound of a formula with first clause \(C\) and remaining clauses \(\varphi \) equals the maximum of the clause variable maximum of \(C\) with the variable bound of \(\varphi \).
Let \(C\) be a clause with serialization \(\mathrm{ser}(C)\), and let \(m_C\) be the maximum of \(v + 1\) over the literals \((v, b)\) of \(C\) (or \(0\) if \(C\) is empty). Suppose the input is \(x = p \mathbin {+\! \! +} \mathrm{ser}(C) \mathbin {+\! \! +} r\), and the transducer is in its clause-level maximum state at input position \(|p|\), with counter length \(n\), counter head at \(0\), and arbitrary buffer, buffer head, and output. Then there is a number \(t \le 2\, |\mathrm{ser}(C)|\) of silent steps after which the transducer is in formula-level maximum control at input position \(|p| + |\mathrm{ser}(C)|\), with counter length \(\max (n, m_C)\), counter head back at \(0\), and buffer, buffer head, and output unchanged.
Let \(\varphi \) be a CNF formula with serialization \(\mathrm{ser}(\varphi )\) and its variable bound \(N(\varphi )\) (one more than the largest variable index occurring in \(\varphi \), or \(0\) if no variable occurs). Suppose the input is \(x = p \mathbin {+\! \! +} \mathrm{ser}(\varphi ) \mathbin {+\! \! +} r\), and the transducer is in formula-level maximum control at input position \(|p|\), with counter length \(n\), counter head at \(0\), and arbitrary buffer, buffer head, and output. Then there is a number \(t \le 2\, |\mathrm{ser}(\varphi )|\) of silent steps after which the transducer is at its rewind seam at input position \(|p| + |\mathrm{ser}(\varphi )| - 1\), with counter length \(\max (n, N(\varphi ))\), counter head at \(0\), and buffer, buffer head, and output unchanged.
The literal buffer holding the empty word with cut \(0\) is the all-blank tape updated with the permanent marker at offset \(-1\).
For every input \(x\), the first two steps of the clause-splitting transducer from its initial configuration on \(x\) are silent and yield the canonical frame in the maximum-pass entry state with input head at \(0\), empty counter, the empty marked buffer (blank except for the permanent marker at offset \(-1\)), both work heads at \(0\), and empty output.
Let \(\varphi \) be a CNF formula with serialization \(\mathrm{ser}(\varphi )\) and its variable bound \(N(\varphi )\) (one more than the largest variable index occurring in \(\varphi \), or \(0\) if no variable occurs). There is a time \(t \le 3\, |\mathrm{ser}(\varphi )| + 5\) at which the clause-splitting transducer, started on \(\mathrm{ser}(\varphi )\), is in its streaming entry state with exactly \(1^{N(\varphi )}\) on the counter tape, the buffer empty apart from its permanent marker, the input head back at \(0\), both work heads at \(0\), and empty output.
A streaming seam state is a triple consisting of a fresh-variable cursor in \(\mathbb {N}\), a number of consumed input bits in \(\mathbb {N}\), and one of five grammar phases (formula, first literal, second literal, tail, finished); it is the persistent state carried across one round of the normalized streaming schedule.
For every literal \(\ell \) and remainder word \(r\), the literal parser applied to the serialization of \(\ell \) followed by \(r\) succeeds and returns exactly \((\ell , r)\).
One round of the streaming clause-splitting schedule on an input string and a seam state: the finished phase is absorbing with empty output; an exhausted input emits the fallback terminator \(0\) and finishes; a terminator bit \(0\) is copied, closing a clause or the whole formula; a clause marker \(1\) at formula phase is copied; and otherwise a complete literal is parsed together with a one-bit lookahead — in the tail phase with more literals pending, the round allocates one fresh variable and emits the positive link, two clause markers, the fresh negative literal, and the consumed original literal, while in all other literal positions the literal is copied verbatim. Local parse failures terminate silently.
Execution of a prescribed number of normalized streaming rounds from a seam state, returning the final state together with the concatenation of all emitted chunks in emission order. This is a pure schedule, not a time-computability claim.
Running \(m + n\) streaming rounds from a state equals running \(m\) rounds, then \(n\) further rounds from the intermediate state, with the two output words concatenated.
For every input \(x\), every \(k \in \mathbb {N}\), and every seam state in the finished phase, running \(k\) streaming rounds returns the same state and the empty output: padding after the formula terminator contributes no further output.
For a remaining clause tail and a fresh cursor \(j\), the pending tail output is the output still to be emitted after the first two literals of a clause, together with the final cursor. An empty tail emits just the clause terminator \(0\); a single literal is copied and followed by the terminator; otherwise one link is closed with the fresh positive literal \((j,\mathrm{true})\), a new clause is opened with \((j,\mathrm{false})\), the next original literal is copied, and the recursion continues on the rest of the tail at cursor \(j + 1\). [AB09, Section 2.3.5, proof of Lemma 2.14]
For a clause \(C\) and fresh cursor \(j\): the part of the transformed clause’s serialization emitted after the initial clause marker (which is handled by the formula phase), including its final terminator, together with the final cursor. Up to two leading literals are copied verbatim before the pending tail output takes over.
For literals \(a, b\), a clause tail \(C\), and a cursor \(j\): concatenating a clause marker with the serialization of each clause of the chain construction on \(a\), \(b :: C\), \(j\) yields exactly one marker followed by the serializations of \(a\) and \(b\) and the pending tail output of \(C\) at \(j\); moreover the chain’s returned cursor equals the tail’s final cursor.
For every clause \(C\) and cursor \(j\): concatenating a clause marker with the serialization of each clause of the split of \(C\) at \(j\) yields exactly one marker followed by the emitted clause body of \(C\) at \(j\), and the split’s returned cursor equals the body’s final cursor. This includes the empty clause and all clauses of width at most three.
Let the input be \(p \mathbin {+\! \! +} 0 :: r\) and the seam state have consumed \(|p|\) bits in a non-finished phase \(q\). The round emits \([0]\), consumes one bit, and moves to the finished phase when \(q\) was the formula phase and back to the formula phase otherwise.
Let the input be \(p \mathbin {+\! \! +} 1 :: r\) and the seam state have consumed \(|p|\) bits in the formula phase. The round emits \([1]\), consumes one bit, and moves to the first-literal phase.
Let the input be \(p\) followed by a serialized literal \(\ell \) and a remainder \(r\), and let the seam state have consumed \(|p|\) bits in a literal phase (neither formula nor finished). If the phase is the tail phase and \(r\) starts with a clause bit \(1\), the round allocates the fresh cursor \(j\): it emits the positive link \((j,\mathrm{true})\), two markers, the negative literal \((j,\mathrm{false})\), and \(\ell \), incrementing the cursor; otherwise it emits \(\ell \) verbatim and advances the phase. In both cases the consumed length advances by the serialized literal length, so no literal buffer survives a round boundary.
Let the input contain a serialized clause tail \(C\) at the consumed position, with the seam in the tail phase at cursor \(j\). Then exactly \(|C| + 1\) rounds — one per remaining literal plus one for the clause terminator — consume the serialized tail, emit exactly the pending tail output of \(C\) at \(j\), return to the formula phase, and leave the cursor at the tail’s final value.
Let the input contain a serialized clause \(C\) at the consumed position, with the seam in the first-literal phase at cursor \(j\). Then exactly \(|C| + 1\) rounds consume the serialized clause, emit exactly the emitted clause body of \(C\) at \(j\), return to the formula phase, and leave the cursor at the body’s final value.
For a CNF formula \(\varphi \) with clauses \(C_1, \dots , C_m\), the round count of \(\varphi \) is \(1 + \sum _{k=1}^{m} (|C_k| + 2)\): per clause one marker round, one round per literal occurrence, and one terminator round, plus one final formula-terminator round.
Let the input contain the serialization of a formula \(\varphi \) at the consumed position, with the seam in the formula phase at cursor \(j\). Then exactly the round count of \(\varphi \) many rounds consume the serialized formula, emit exactly the serialization of the threaded clause transform of \(\varphi \) at \(j\), reach the finished phase, and leave the cursor at the transform’s final value.
For every CNF formula \(\varphi \), the round count of \(\varphi \) is at most the length of the serialization of \(\varphi \): every non-finished round consumes at least one input bit, including for empty clauses and the empty formula.
Let \(\varphi \) be a CNF formula with serialization \(\mathrm{ser}(\varphi )\) and its variable bound \(N(\varphi )\) (one more than the largest variable index occurring in \(\varphi \), or \(0\) if no variable occurs). Running \(|\mathrm{ser}(\varphi )| + 1\) streaming rounds on input \(\mathrm{ser}(\varphi )\), starting from the formula phase with fresh cursor \(N(\varphi )\) and nothing consumed, emits a word equal to the serialization of the clause-splitting transform of \(\varphi \): the semantic schedule finishes within the budget and all remaining rounds are empty.
For every input \(x\), round count \(k\), and seam state \(s\), the output of \(k\) streaming rounds equals the concatenation over \(i \lt k\) of the chunk emitted by the round applied to the \(i\)-fold iterate of the next-state map on \(s\) — the range-indexed form required by the emitting-loop contract.
The pair-encoded word representing a seam state: the unary fresh cursor paired with the pair of the unary consumed length and a bounded unary phase tag. It contains no round-local literal buffer.
For a word \(w\), the first pair projection of \(w\) is the first component of \(w\) decoded as a pair encoding, and is the empty word when \(w\) is not a valid pair encoding.
For a word \(w\), the second pair projection of \(w\) is the second component of \(w\) decoded as a pair encoding, and is the empty word when \(w\) is not a valid pair encoding.
The total decoding of a word into a seam state: the lengths of the two unary counter fields give the fresh cursor and consumed length, and the length of the phase field is reduced modulo five. The modulus only totalizes malformed words and is the identity on all reachable tags.
For every seam state \(s\), decoding the encoded seam word of \(s\) returns exactly \(s\): the fresh cursor, the consumed length, and the phase are all recovered.
For every seam state with fresh cursor \(f\), consumed length \(c\), and phase \(q \in \{ 0, \dots , 4\} \), the encoded seam word has length exactly \(2f + 2c + q + 4\); in particular it is linear in the two unary counters.
The length-only loop invariant on an input \(x\) and a seam state: the consumed length is at most \(|x|\), and the fresh cursor is at most \(|x|\) plus the consumed length — at most one fresh variable is allocated per consumed bit.
If a seam state satisfies the length invariant on an input \(x\), then so does the state after one streaming round — including on malformed local inputs, where finished and failure cases preserve the counters.
If a seam state satisfies the length invariant on an input \(x\), then its fresh cursor is at most \(2\, |x|\) and its encoded seam word has length at most \(6\, |x| + 8\).
The seam state selected before any emission: if the complete syntax scan of the input accepts, start in the formula phase with the fresh cursor at the decoded formula’s variable bound and nothing consumed; otherwise start in the formula phase at the right input boundary, whose first round emits only the fallback terminator and then finishes — even at input length zero.
For every input string \(x\), the startup seam state of \(x\) satisfies the length invariant on \(x\); this holds both for the valid and for the fallback startup state.
Any positive number of streaming rounds from the right-boundary fallback state emits exactly the single bit \(0\): no prefix of the malformed string is emitted, including on trailing-data failures.
For every binary string \(x\), running \(|x| + 1\) streaming rounds from the startup seam state of \(x\) emits exactly the image of \(x\) under the string-level SAT-to-3SAT reduction. This is an exact output identity on every string, prior to any machine-computability claim.
For an input \(x\) and a word \(w\), the encoded next-state function returns the encoded seam word of the state obtained by decoding \(w\) and applying one streaming round on input \(x\).
The word-level chunk function consumed by the audited emitter interface: decode a seam word, apply one streaming round, and return the emitted chunk.
The loop invariant on an input \(x\) and a word \(w\): \(w\) is the canonical encoding of some seam state satisfying the length invariant on \(x\). Arbitrary malformed state words are not admitted as seams.
For every input string \(x\), the encoded startup seam word of \(x\) satisfies the encoded loop invariant.
If a word satisfies the encoded loop invariant on an input \(x\), then so does its image under the encoded next-state function.
For every input \(x\), seam state \(s\), and \(k\), the \(k\)-fold iterate of the encoded next-state function on the encoded word of \(s\) equals the encoded word of the \(k\)-fold iterate of the structured round map on \(s\).
For every binary string \(x\), concatenating over \(i \lt |x| + 1\) the chunks produced by the encoded chunk function at the \(i\)-fold iterate of the encoded next-state function on the encoded startup word equals the image of \(x\) under the string-level SAT-to-3SAT reduction — exactly the expression returned by the emitting-loop constructor with round budget \(R(n) = n\).
Let \(M\) be a base machine with \(k\) work tapes. Given an input move \(m\), a capture-head move \(d\), an optional output bit \(b\), and an optional target state \(q\), the pairing administrative action is the action of the pairing machine over \(M\) that writes nothing, keeps the completed source bank (the first \(k\) work heads) stationary, moves the input head by \(m\) and the last (capture) head by \(d\), emits \(b\) when present, and switches to \(q\).
Given a machine \(M\) computing a function \(f\), the pairing machine with one extra tape: it runs \(M\), capturing its output onto the fresh last tape, rewinds the native input and the captured word, replays each captured bit twice, emits the pairing separator \(01\), and finally copies the native input. On input \(x\) its output is therefore the pair encoding of \(f(x)\) with \(x\).
Let \(M\) be a finite machine with \(k\) work tapes and \(x\) an input. Given a configuration \(s\) of \(M\) on \(x\) (the saved source bank), a captured word \(u\), an optional control state \(q\), a position \(i \le |x|\), an offset \(j \in \mathbb {Z}\), and an output word \(o\), the canonical pairing configuration is the configuration of the pairing machine over \(M\) whose first \(k\) work tapes and heads are those of \(s\), whose last tape holds \(u\) with head at \(j\), whose control is \(q\) (halted when \(q\) is absent), whose input head is just before position \(i\), and whose output is \(o\).
Let \(M\) be a finite machine, \(x\) an input, and \(i \le |x|\). In every canonical pairing configuration over \(M\) on input \(x\) at input position \(i\), the symbol read by the input head is the \(i\)-th bit of \(x\) when \(i \lt |x|\), and the blank when \(i = |x|\).
Let \(M\) be a finite machine, \(u\) a captured word, and \(j \in \mathbb {Z}\). In every canonical pairing configuration over \(M\) with captured word \(u\) and capture head at offset \(j\), the symbol under the last work head is the cell of the buffer tape of \(u\) at \(j\), that is, the \(j\)-th bit of \(u\) when \(0 \le j \lt |u|\) and the blank otherwise.
Applying a pairing administrative action to a canonical pairing configuration changes only the control state, the two displayed head positions, and the output (appending the optionally emitted bit); the saved source bank and the captured word are preserved.
For every \(n \le |u|\): from the canonical pairing configuration in the capture-rewind state with the capture head at offset \(n - 1\) and empty output, exactly \(n + 1\) steps return the head to the origin and enter the replay state, with all other fields unchanged.
Let the source machine \(M\) compute the word \(u\) on input \(x\) within \(T\) steps. Then within \(T + |x| + |u| + 5\) steps from its initial configuration, the pairing machine over \(M\) reaches the canonical pairing configuration at the replay entry: some saved bank of \(M\), the captured word \(u\) with head at the origin, the input head at the origin, and all startup output suppressed.
Let the captured word decompose as \(u = p \mathbin {+\! \! +} r\) with the capture head at offset \(|p|\) in the replay state. Then exactly \(2\, |r| + 2\) steps emit the doubling of \(r\) followed by the separator \(01\), move the capture head to \(|u|\), and enter the native-copy state; the source bank and the native input head remain fixed.
Let the native input decompose as \(x = p \mathbin {+\! \! +} r\) with the pairing machine in its native-copy state at input position \(|p|\). Then exactly \(|r| + 1\) steps emit every bit of \(r\) and halt on the right blank, leaving all work tapes and the capture head unchanged.
Let the machine \(M\) compute a function \(f\) within time \(T\). Then the pairing machine over \(M\) computes the function \(x \mapsto \mathrm{pair}(f(x), x)\) within time \(n \mapsto 4\, T(n) + 2n + 8\): retaining a computed result next to its original input has a uniform overhead, the capture output length being paid by the source time.
If a function \(f\) on binary strings is polynomial-time computable, then so is the function \(x \mapsto \mathrm{pair}(f(x), x)\) pairing the computed value with the original input.
If a function \(g\) on binary strings is polynomial-time computable, then so is the function that decodes its input as a pair \((a, b)\), returns the pair encoding of \(a\) with \(g(b)\), and returns the empty word when the input is not a valid pair encoding.
If \(f\) and \(g\) are polynomial-time computable functions on binary strings, then so is \(x \mapsto \mathrm{pair}(f(x), g(x))\): independently computed fields can be paired without losing the original input needed by the second computation.
If \(f\) and \(g\) are polynomial-time computable functions on binary strings, then so is \(x \mapsto f(x) \mathbin {+\! \! +} g(x)\).
Given a state set \(S\), a transition \(\delta \), a per-bit optional emission \(\varepsilon \), and an optional final emission \(\phi \), the transducer semantics is the word function defined by recursion on the input: on the empty word from state \(q\) it returns the final emission \(\phi (q)\) (zero or one bit), and on a bit \(b\) followed by a word \(r\) from state \(q\) it returns the emission \(\varepsilon (q, b)\) followed by the semantics of \(r\) from state \(\delta (q, b)\).
Given a finite state set \(S\) with a transition \(\delta \), a per-bit optional emission, an optional final emission, and a start state, the word-transducer machine is the finite Turing machine with no work tapes that, on each input bit, applies \(\delta \), emits the per-bit optional output, and moves right, and at the right boundary emits the optional final bit and halts.
For an input word \(x\), a control state \(q\), a position \(i \le |x|\), and an output word \(o\), the transducer configuration is the configuration of a zero-work-tape machine on input \(x\) with control state \(q\), input head just before position \(i\), and already-emitted output \(o\).
Let the input decompose as \(x = p \mathbin {+\! \! +} r\). From any state \(q\) at position \(|p|\) with emitted prefix \(o\), the word-transducer machine halts after exactly \(|r| + 1\) steps with output \(o\) followed by the transducer semantics applied to \(q\) and \(r\).
For every finite state set with transition, per-bit emission, final emission, and start state, the associated word-transducer function on binary strings is polynomial-time computable, with the exact time bound \(n + 1\).
The function replacing every bit of its input by \(1\) — computing the exact unary representation of the input length — is polynomial-time computable.
The function removing the first bit of a binary string (returning the empty word on the empty string) is polynomial-time computable, as a two-state finite transduction.
The function extracting at most the first bit of a binary string (the length-one prefix) is polynomial-time computable, as a two-state finite transduction.
Let \(f\) be a polynomial-time computable function on binary strings and \(w\) a fixed word. Then the single-bit function testing whether \(f(x) = w\) is polynomial-time computable.
Let \(A\) and \(B\) be multi-tape machines with the same tape count and state type, \(c\) a configuration, and \(t\) a time such that at every time \(i \lt t\) the one-step transitions of \(B\) and \(A\) agree on the configuration reached by \(A\) after \(i\) steps. Then the \(t\)-step runs of \(B\) and \(A\) from \(c\) coincide. No eventual halt is assumed.
If the clause-splitting transducer, run for \(t\) steps from its initial configuration, has empty output, then at no earlier time was its control in the streaming entry state: that state necessarily emits a bit, which output-prefix monotonicity would make visible at time \(t\).
The machine obtained from the clause-splitting transducer by intercepting its streaming entry state: instead of streaming, it copies the unary counter to the output (one bit per occupied cell) and halts at the first blank. All other transitions are taken verbatim from the transducer, so the verified initialization and maximum pass apply unchanged.
Let \(\varphi \) be a CNF formula with serialization \(\mathrm{ser}(\varphi )\) and its variable bound \(N(\varphi )\) (one more than the largest variable index occurring in \(\varphi \), or \(0\) if no variable occurs). There is a time \(t \le 3\, |\mathrm{ser}(\varphi )| + 5\) at which the intercepted maximum-pass machine, started on \(\mathrm{ser}(\varphi )\), is in its streaming entry state with the counter tape holding \(1^{N(\varphi )}\), the buffer empty apart from its permanent marker, the input head and both work heads at \(0\), and empty output. This is the same endpoint as for the unmodified clause-splitting transducer.
For every \(r \le n\): from the streaming entry frame with counter length \(n\), exactly \(r\) transitions of the intercepted machine copy the first \(r\) unary counter cells to the output, moving only the counter head; no native input or buffer movement occurs during the replay.
Let \(x\) be an input, \(n \in \mathbb {N}\), and \(B\) any buffer tape. Started in the streaming entry state with the input head at \(0\), a unary counter of length \(n\) with head at \(0\), the buffer \(B\) with head at \(0\), and empty output, the intercepted maximum-pass machine after exactly \(n + 1\) steps is halted with output \(1^n\) and counter head at \(n\), all other fields unchanged; in particular the first blank after the counter halts the machine without an extra output bit.
Let \(\varphi \) be a CNF formula with serialization \(\mathrm{ser}(\varphi )\) and its variable bound \(N(\varphi )\) (one more than the largest variable index occurring in \(\varphi \), or \(0\) if no variable occurs). The intercepted maximum-pass machine, run on \(\mathrm{ser}(\varphi )\), halts within \(4\, |\mathrm{ser}(\varphi )| + 6\) steps, and its output is the unary word \(1^{N(\varphi )}\).
For a binary string \(x\), the canonicalization of \(x\) is \(x\) itself when the complete syntax scan accepts \(x\), and is the one-bit word \(0\) (the serialization of the empty fallback formula) otherwise.
For every binary string \(x\), the canonicalization of \(x\) equals the serialization of the formula decoded from \(x\) — on every input, including trailing-data failures.
The canonicalization function is polynomial-time computable, as a conditional over the verified complete syntax scanner between the identity and a constant.
For a binary string \(x\), let \(\varphi _x\) be the CNF formula decoded from \(x\) and \(N(\varphi _x)\) its variable bound (one more than the largest variable index occurring in \(\varphi _x\), or \(0\) if no variable occurs). The function sending every binary string \(x\) to the unary word \(1^{N(\varphi _x)}\) is polynomial-time computable, on all strings including malformed ones.
The function sending a binary string to the encoded seam word of its startup state — including the right-boundary offset on invalid inputs — is polynomial-time computable, before any clause emission.
For an input \(x\) and an offset \(i \in \mathbb {N}\), the clamped input offset is the native input-head position at index \(\min (i, |x|)\); offsets beyond the right boundary are clamped to it.
If a configuration’s input position equals the clamped offset \(i\) on input \(x\), then its input symbol is the optional \(i\)-th entry of \(x\) (blank beyond the boundary).
Moving the input head right from the clamped offset \(i\) yields the clamped offset \(i + 1\) — including repeated requests beyond the native right boundary, which stay clamped.
Given an input-head move \(m\), a counter-head move \(d\), an optional counter write, an optional output bit, and an optional next state among six control states, the dropper action is the one-tape action performing exactly these operations; these are the actions of the length-controlled suffix extractor.
The suffix-extraction machine is a six-state finite machine with one work tape. Given binary words \(u\) and \(v\) and the input the pair encoding \(\mathrm{pair}(u,v)\) (every bit of \(u\) doubled, then the separator \(01\), then \(v\)), it counts the doubled prefix on a unary counter tape, recognizes the separator, rewinds the counter, skips exactly \(|u|\) payload positions (clamping at the right boundary), and copies the remaining suffix of \(v\). No output precedes recognition of the separator.
For an input \(x\), an optional control state \(q\), natural numbers \(i\) and \(n\), an offset \(h \in \mathbb {Z}\), and an output word \(o\), the canonical dropper configuration is the configuration of the suffix extractor in control \(q\), with the input head at the clamped offset \(\min (i, |x|)\), the unary counter tape of length \(n\) with head at \(h\), and emitted output \(o\).
Let \(x\) be an input, and consider a dropper action with no counter write, input move \(m\), counter-head move \(d\), optional output bit \(b\), and target state \(q'\). If the move \(m\) takes the clamped offset \(i\) to the clamped offset \(i'\), and \(h + d = h'\), then applying the action to the canonical dropper configuration at offset \(i\) with counter length \(n\), counter head \(h\), and output \(o\) yields the canonical configuration in state \(q'\) at offset \(i'\) with the same counter, head at \(h'\), and output \(o\) followed by \(b\) when present.
Let \(x\) be an input, \(i\) a natural offset, and \(n \in \mathbb {N}\). Applying the dropper action that writes a one under the counter head, moves the input head and the counter head right, and enters the counting state, to a canonical dropper configuration on \(x\) at clamped offset \(i\) whose unary counter has length \(n\) and head at \(n\) (with empty output), yields the canonical configuration in the counting state at clamped offset \(i + 1\) with counter length \(n + 1\) and counter head at \(n + 1\): writing the counter’s right blank appends exactly one unary cell.
Let \(x\) be an input of the form \(p\), followed by two copies of a bit \(b\), followed by a word \(r\), and let \(n \in \mathbb {N}\). From the counting state at offset \(|p|\) with a unary counter of length \(n\), counter head at \(n\), and empty output, two steps of the suffix extractor yield the counting state at offset \(|p| + 2\) with counter length \(n + 1\) and counter head at \(n + 1\); nothing is emitted.
Let \(u\) and \(v\) be binary words, with \(u = p \mathbin {+\! \! +} r\) split into a prefix \(p\) and a suffix \(r\), and consider the input the pair encoding \(\mathrm{pair}(u,v)\) (every bit of \(u\) doubled, then the separator \(01\), then \(v\)). Started in its counting state at input offset \(2|p|\), with a unary counter of length \(|p|\) and counter head at \(|p|\) and empty output, the suffix extractor after exactly \(2|r|\) steps is again in its counting state, at input offset \(2|u|\), with a unary counter of length \(|u|\) and counter head at \(|u|\); nothing is emitted.
Let \(u\) and \(v\) be binary words and consider the input the pair encoding \(\mathrm{pair}(u,v)\) (every bit of \(u\) doubled, then the separator \(01\), then \(v\)). Started in its counting state at input offset \(2|u|\), with a unary counter of length \(|u|\), counter head at \(|u|\), and empty output, the suffix extractor after exactly two steps is in its counter-rewind state at input offset \(2|u| + 2\) (the first payload bit, just past the separator), with the counter unchanged, counter head at \(|u| - 1\), and nothing emitted.
For every \(r \le n\): from the rewind state with counter length \(n\) and counter head at offset \(r - 1\), exactly \(r + 1\) steps return the counter head to \(0\) and enter the skip state, without disturbing the payload head or emitting.
For every \(r \le n\): in the skip state with counter length \(n\), \(r\) steps advance the clamped payload offset by \(r\) while walking the counter head to \(r\). Native clamping makes this total even when the stored length exceeds the payload.
Let \(x\) be an input and \(p, n \in \mathbb {N}\). From the skip state at clamped offset \(p\), with a unary counter of length \(n\) whose head is at the first blank \(n\) and empty output, one step of the suffix extractor yields the configuration in the copy state with every other field unchanged; in particular the input head does not move past the first unconsumed payload bit.
Let the native input decompose as \(x = p \mathbin {+\! \! +} r\) with the suffix extractor in its copy state at clamped offset \(|p|\). Then exactly \(|r| + 1\) steps emit every bit of \(r\) and halt on the right blank, with the counter untouched.
For all binary words \(u\) and \(v\), the suffix extractor run on the pair encoding \(\mathrm{pair}(u,v)\) (every bit of \(u\) doubled, then the separator \(01\), then \(v\)) halts within \(3(\ell + 1)\) steps, where \(\ell \) is the length of that paired input, and its output is the suffix of \(v\) obtained by dropping its first \(|u|\) bits.
Both total pair projections — first and second component of a pair-encoded word, defaulting to the empty word on malformed inputs — are polynomial-time computable.
The function sending a word \(z\) to the suffix of its second pair projection obtained by dropping as many bits as the length of its first pair projection is polynomial-time computable on every word, malformed pair inputs being interpreted through the empty-default projections.
For every literal \(\ell = (v, b)\) and remainder \(r\), the unary token splitter applied to the serialization of \(\ell \) followed by \(r\) returns the token \(1^{v+1}0\) together with the suffix \(b :: r\): the delimiter is consumed and the polarity bit remains the first bit of the returned suffix.
For every binary string \(x\): the unary token splitter returns the leading run of ones together with at most one following bit as the token, and the rest as the suffix; moreover the residue after the leading run never starts with another one.
If the literal parser fails on a string starting with a one (a literal marker), then the unary token splitter on that string returns an empty suffix: there is no polarity bit, which keeps the total round implementation faithful even on locally malformed state–input combinations.
A round request is the pair encoding of an encoded seam word with a fresh copy of the native input. For a word \(z\), the fresh field of \(z\) is the first component of the first component of \(z\) (each projection defaulting to the empty word on malformed inputs); on a canonical request it is the unary fresh cursor.
For a word \(z\), the consumed field of \(z\) is the first component of the second component of the first component of \(z\) (each projection defaulting to the empty word on malformed inputs); on a canonical round request it is the unary consumed length.
For a word \(z\), the phase field of \(z\) is the second component of the second component of the first component of \(z\) (each projection defaulting to the empty word on malformed inputs); on a canonical round request it is the unary phase tag.
For a word \(z\), the unread input of \(z\) is the second component of \(z\) with as many leading bits dropped as the length of the consumed field of \(z\).
The suffix returned by the unary token splitter on the unread input of a round request; its first bit, when present, is the polarity bit of the literal being read.
For a word \(z\), the current literal of \(z\) is the token returned by the unary token splitter on the unread input of \(z\), extended by at most the first bit of the polarity suffix of \(z\).
The Boolean deciding whether the current round performs a fresh-variable tail link: the phase field equals the tail tag (\(1^3\)) and the bit after the polarity bit is a one (another literal follows in the clause).
The canonical packing of a fresh field, a consumed field, and a fixed phase tag \(q\) into an encoded seam word: the first field paired with the pair of the second field and the unary word \(1^q\). No round-local scratch is involved.
The one larger output chunk of a tail-link round, assembled from the request fields: the positive fresh link (\(1\) followed by the unary fresh field, then \(01\)), two clause markers, the negative fresh link, and the consumed original literal, in that order.
A total straight-line word program computing the chunk emitted by one streaming round from a round request: finished phase emits nothing; exhausted input or a terminator bit emits \(0\); a clause marker at formula phase emits \(1\); a missing polarity bit emits nothing; a tail link emits the assembled fragment; otherwise the current literal is copied. Only the grammar phase and the complete-literal lookahead are tested locally — full validation belongs to startup.
A total straight-line word program installing the next encoded seam word from a round request, by the same local tests as the chunk program: the consumed field advances by the whole current literal length (or by one for markers and terminators), the phase tag is updated, and the fresh field grows by one exactly on a tail link.
For every binary string \(x\), the length-one prefix of \(x\) equals \([1]\) if and only if the optional first bit of \(x\) is a one.
Let \(x\) be a binary word and \(s\) a seam state with fresh cursor \(f\), consumed length \(c\), and phase \(q\), and let \(w_s\) be the encoded seam word of \(s\). On the canonical round request \(\mathrm{pair}(w_s, x)\), the fresh, consumed, phase, and unread-input projections return exactly \(1^f\), \(1^c\), \(1^q\), and the word \(x\) with its first \(c\) bits dropped.
On every canonical round request — the pair encoding of the encoded seam word of any state \(s\) (not only reachable ones) with the input \(x\) — the word-level next-state program returns the encoded word of the state after one streaming round, and the word-level chunk program returns exactly the chunk emitted by that round.
All six read-only request projections — fresh field, consumed field, phase field, unread input, polarity suffix, and current literal — are polynomial-time computable.
If two word functions are polynomial-time computable, then for every fixed phase tag so is the function packing their values into an encoded seam word.
The single-bit tail-link decision on round requests is polynomial-time computable, as a conjunction of two finite-word equality tests.
The tail-link fragment function on round requests is polynomial-time computable, built by a fixed number of polynomial-time concatenations.
The word-level per-round chunk program is polynomial-time computable — including the empty finished chunks and the invalid-input fallback — with an actual finite machine witness.
The word-level next-state program is polynomial-time computable; all branch tests are computed and captured on the original round request.
A five-state, one-tape administrative machine that appends the native input to the word already on its work tape and then rewinds both heads: seek the first blank after the existing word, copy the input, rewind the work head over the occupied prefix, and rewind the input head. The only occupied tape is the data tape; no origin marker is introduced. It is used to form a round request and at startup of the streaming host.
The complete configuration of the appender: a control state, an input position, the buffer tape of a stated word with its head at a stated offset, and empty output; there is no hidden scratch.
Let the work tape hold a word \(w = p \mathbin {+\! \! +} r\) with the head at offset \(|p|\) in the seek state. Then exactly \(|r| + 1\) steps bring the head to the first blank at offset \(|w|\) and enter the copy state, without moving the native input head.
Let the native input decompose as \(x = p \mathbin {+\! \! +} r\), with the appender in its copy state at clamped input offset \(|p|\) and work tape holding \(w \mathbin {+\! \! +} p\) with the head at its right blank. Then exactly \(|r| + 1\) steps append the remaining suffix \(r\) to the work tape and enter the work-tape rewind with the head on the last occupied cell of \(w \mathbin {+\! \! +} x\).
For every \(r \le |w|\): from the rewind state with the work head at offset \(r - 1\) over a tape holding \(w\), exactly \(r + 1\) steps return the head to the origin and enter the input-rewind state; the blank at offset \(-1\) is used only locally and never written.
Let a multi-tape machine, started in a live configuration, be halted after \(t\) steps. Then there is a positive time \(u \le t\) such that the machine is not halted at any earlier time, and the \(u\)-step run equals the \(t\)-step run in every field: a padded halting run can be cut at its first halt without changing any endpoint.
For every native input \(x\) and existing word \(w\) on the data tape, there is a positive time \(t \le 2|w| + 3|x| + 6\) such that the appender, started at its canonical entry over the state word of \(w\), is not halted before \(t\) and at time \(t\) halts in the canonical configuration holding the state word of \(w \mathbin {+\! \! +} x\), with both the input and work heads returned to their origins and no output.
The embedding of an action over \(k\) work tapes into an action over \(K \ge k\) work tapes: the extra tapes are neither written nor moved.
The embedding of a finite machine with \(k\) work tapes into one with \(K \ge k\) work tapes by padding every transition; all modules of the streaming host share tape zero, with each source bank padded on the right.
The embedding of a configuration over \(k\) work tapes into one over \(K \ge k\) work tapes: the padding tapes are genuinely blank with heads at the origin.
Applying the padded version of an action to the padded version of a configuration equals padding the result of applying the original action — including writes at arbitrary cells.
For every machine \(M\), tape bound \(K \ge k\), configuration \(c\), and time \(t\): running the padded machine for \(t\) steps from the padded configuration equals padding the \(t\)-step run of \(M\) from \(c\) — the padded source observes exactly its original work symbols.
For a positive source tape count, padding the canonical configuration built from a state word (data word on tape zero, other tapes blank) yields the canonical configuration over the larger tape count built from the same state word, with the same output.
Given a machine \(C\) with designated entry and exit states, the wrapper machine whose states carry an additional Boolean release flag: it simulates \(C\), raising the flag after the first step, and halts silently as soon as the flag is raised and the control is at the designated exit. The flag ensures that even an entry equal to the exit executes at least once.
The embedding of a configuration of a machine into the call-stopping wrapper with a given release-flag value; all physical fields (tapes, heads, output) are preserved.
If the embedded configuration is live and not (with the flag raised) at the designated exit, then one step of the call-stopping wrapper performs the same physical step as the wrapped machine and raises the release flag.
If a multi-tape machine is live (not halted) after \(t\) steps from a configuration, then it is live after every earlier number of steps.
Let a machine \(C\), started at its entry over the state word of an argument, avoid its designated exit at all intermediate positive times before \(t \gt 0\) and reach at time \(t\) the exit over the state word of a result with a given output. Then the call-stopping wrapper, started with the flag down, runs for \(t + 1\) steps and halts in that same physical configuration (flag raised, state halted), retaining every emitted bit.
The control-state space of the streaming host: a single anchor state plus the disjoint union of the state spaces of six finite modules (startup append and install, then the recurring pack, append, emit, and install calls).
The return destination of each of the six modules: the startup appender continues to the startup installer, and the pack, append, and emit calls continue to the next module; the two installers return to the unique loop anchor.
Given six finite modules and an index \(i \in \{ 0, \dots , 5\} \), the entry state of module \(i\) is the host control state corresponding to the initial state of the \(i\)-th module inside the finite body.
The host control state to which the \(i\)-th module returns: the entry of its successor module, or the loop anchor when there is none. No additional tape operation is performed on return.
The finite controller hosting the six modules on one shared padded work bank: the anchor dispatches into the recurring call sequence, and inside a module every transition (including the halting one) is forwarded by the output-emitting embedding, redirecting halts to the module’s return state. The clean-call contracts restore the shared scratch before each next call.
For a module with positive tape count: forwarding a padded canonical configuration of the module (built from a state word, with a given output) through the emitting embedding produces the host’s canonical seam over the same state word, with the supplied prefix prepended to the output; a halted module state maps to the module’s return state.
Let the \(i\)-th module (with positive tape count), started at its own entry over the state word of an argument, stay live before time \(t\) and halt at time \(t\) over the state word of a result with output \(o\). Then the host, started at that module’s entry over the same argument with output prefix \(p\): (i) never visits the loop anchor before time \(t\), and (ii) at time \(t\) reaches the module’s return state over the state word of the result with output \(p \mathbin {+\! \! +} o\).
Let a machine avoid a designated anchor state for \(a\) steps from \(c\), reach \(d\) at time \(a\), and avoid the anchor for \(b\) further steps from \(d\). Then it avoids the anchor at every time below \(a + b\) from \(c\).
The uniform contract for a host module \(M\) with result and emission functions and a budget \(B\): \(M\) has a positive tape count, and for every native input and argument word there is a positive time within \(B\) of the argument length at which \(M\), started at its entry over the state word of the argument, first halts — in the canonical configuration over the state word of the result, having emitted exactly the prescribed chunk, with the native input untouched.
Let a machine \(C\) with entry and exit states satisfy a first-positive-exit bridge contract: on every input and argument it reaches, within budget \(B\), the exit over the state word of the result with the prescribed emission, avoiding the exit at intermediate positive times. Then the call-stopping wrapper of \(C\) satisfies the uniform clean-module contract with budget \(B + 1\).
For all naturals \(c, A, d, n\) and any length \(\mathrm{len} \le A\, (n+1)^d\):
i.e. the bridge overhead is bounded by one monomial of degree one higher.
For every polynomial-time computable word function \(f\) there exist a module \(M\) and constants \(A, d\) such that \(M\) satisfies the clean-module contract with result function \(f\), empty emission, and budget \(n \mapsto A\, (n+1)^d\) on the argument length: every polynomial word computation has a clean first-halting install module.
For every polynomial-time computable word function \(f\) there exist a module \(M\) and constants \(A, d\) such that \(M\) satisfies the clean-module contract with the identity as result function, emission \(f\), and budget \(n \mapsto A\, (n+1)^d\): the emit-mode module preserves its argument and forwards the exact computed chunk, with cleanup and the final halt inside the polynomial budget.
For all binary words \(u\) and \(v\), the pair encoding of \(u\) with \(v\) has length exactly \(2|u| + |v| + 2\); this charges every round request to the original input.
For naturals \(A, d, D, n, m\) with \(d \le D\) and \(m + 1 \le 32\, (n+1)\):
Every polynomial on a linearly bounded request length fits the common power in the original input length.
Let the \(i\)-th module of the host satisfy the clean-module contract with result \(f\), emission \(g\), and budget \(B\). Then for every native input, argument, and output prefix, there is a positive time within \(B\) of the argument length during which the host, started at that module’s entry, avoids the loop anchor and then reaches the module’s return state over the state word of \(f\) of the argument, with \(g\) of the argument appended to the output.
The string-level SAT-to-3SAT reduction — decode, apply the clause-splitting transform, and serialize, with the empty-formula fallback on malformed inputs — is polynomial-time computable: a finite host of six clean modules (startup append and install, then the recurring pack, append, emit, and install calls) drives the normalized streaming schedule through an emitting loop with round budget \(R(n) = n\), every request being linearly bounded in the original input.
\(\mathrm{SAT} \le _p \mathrm{3SAT}\): there is a polynomial-time computable map on binary strings — clause splitting with fresh variables — under which membership in \(\mathrm{SAT}\) of any string is equivalent to membership in \(\mathrm{3SAT}\) of its image. [AB09, Lemma 2.14]