SAT-specialized guess-and-verify NTM #
This file implements the concrete SAT route to NP. It avoids the still-open
generic NP.WitnessNTMConstruction by using the proved linear counter
subroutine for SAT witnesses, whose length is bounded by |x| + 1. The final
theorems prove the composed machine decides language in polynomial time from a
polynomial-time verifier.
The machine is parameterized by a verifier DTM M : TM k for
pairLang Witness. Its work-tape layout is:
0 .. k-1: verifier-internal work tapes,k: pair tape, used as the virtual input forM,k+1: guessed witness tape,k+2: unary counter tape.
The state space is a direct sequence of the existing subroutine phases: counter setup, input rewind, bounded guessing, pair building, and verifier simulation.
Deterministic setup budget for the SAT-specialized machine before pair
construction starts: build the |x|+1 counter, rewind the input, and run
the bounded guessing subroutine through its phase exit.
Equations
- One or more equations did not get rendered due to their size.
Instances For
A uniform verifier-time window for all witnesses of length at most
n + 1. We take a finite maximum because the verifier bound f is not
assumed monotone.
Equations
- Complexity.SAT.satVerifierWindowTime f n = (Finset.range (n + 2)).sup fun (m : ℕ) => f (2 * n + 2 + m)
Instances For
SAT-specialized witness-independent run budget induced by a verifier bound
f.
Equations
Instances For
Evaluation of a natural-coefficient polynomial is monotone in its argument.
Work-tape index for the pair/virtual-input tape.
Equations
- Complexity.SAT.satPairIdx k = ⟨k, ⋯⟩
Instances For
Work-tape index for the guessed witness tape.
Equations
- Complexity.SAT.satWitnessIdx k = ⟨k + 1, ⋯⟩
Instances For
Work-tape index for the unary guess-bound counter.
Equations
- Complexity.SAT.satCounterIdx k = ⟨k + 2, ⋯⟩
Instances For
Embed a verifier-internal work-tape index into the SAT machine layout.
Equations
- Complexity.SAT.satVerifierWorkIdx i = ⟨↑i, ⋯⟩
Instances For
The witness tape and the pair tape are distinct work tapes.
The counter tape and the pair tape are distinct work tapes.
The counter tape and the witness tape are distinct work tapes.
Embedded verifier work tapes are distinct from the pair tape.
Embedded verifier work tapes are distinct from the witness tape.
Embedded verifier work tapes are distinct from the counter tape.
Control states for the SAT-specialized guess-and-verify machine.
- counter
{Q : Type}
: TM.LinearCounterPhase → GuessVerifyPhase Q
Building the
|x| + 1unary counter on the counter tape. - rewindInput
{Q : Type}
: TM.RewindPhase → GuessVerifyPhase Q
Rewinding the input head back to the start marker.
- guess
{Q : Type}
: NTM.GuessBoundedPhase → GuessVerifyPhase Q
Nondeterministically guessing a counter-bounded witness.
- pair
{Q : Type}
: TM.PairBuildPhase → GuessVerifyPhase Q
Writing
pair x yof input and witness onto the pair tape. - verify
{Q : Type}
: Q → GuessVerifyPhase Q
Simulating the verifier
Min stateQon the pair tape.
Instances For
Equations
- One or more equations did not get rendered due to their size.
- Complexity.SAT.instDecidableEqGuessVerifyPhase.decEq (Complexity.SAT.GuessVerifyPhase.counter a) (Complexity.SAT.GuessVerifyPhase.counter b) = if h : a = b then h ▸ isTrue ⋯ else isFalse ⋯
- Complexity.SAT.instDecidableEqGuessVerifyPhase.decEq (Complexity.SAT.GuessVerifyPhase.counter a) (Complexity.SAT.GuessVerifyPhase.rewindInput a_1) = isFalse ⋯
- Complexity.SAT.instDecidableEqGuessVerifyPhase.decEq (Complexity.SAT.GuessVerifyPhase.counter a) (Complexity.SAT.GuessVerifyPhase.guess a_1) = isFalse ⋯
- Complexity.SAT.instDecidableEqGuessVerifyPhase.decEq (Complexity.SAT.GuessVerifyPhase.counter a) (Complexity.SAT.GuessVerifyPhase.pair a_1) = isFalse ⋯
- Complexity.SAT.instDecidableEqGuessVerifyPhase.decEq (Complexity.SAT.GuessVerifyPhase.counter a) (Complexity.SAT.GuessVerifyPhase.verify a_1) = isFalse ⋯
- Complexity.SAT.instDecidableEqGuessVerifyPhase.decEq (Complexity.SAT.GuessVerifyPhase.rewindInput a) (Complexity.SAT.GuessVerifyPhase.counter a_1) = isFalse ⋯
- Complexity.SAT.instDecidableEqGuessVerifyPhase.decEq (Complexity.SAT.GuessVerifyPhase.rewindInput a) (Complexity.SAT.GuessVerifyPhase.guess a_1) = isFalse ⋯
- Complexity.SAT.instDecidableEqGuessVerifyPhase.decEq (Complexity.SAT.GuessVerifyPhase.rewindInput a) (Complexity.SAT.GuessVerifyPhase.pair a_1) = isFalse ⋯
- Complexity.SAT.instDecidableEqGuessVerifyPhase.decEq (Complexity.SAT.GuessVerifyPhase.rewindInput a) (Complexity.SAT.GuessVerifyPhase.verify a_1) = isFalse ⋯
- Complexity.SAT.instDecidableEqGuessVerifyPhase.decEq (Complexity.SAT.GuessVerifyPhase.guess a) (Complexity.SAT.GuessVerifyPhase.counter a_1) = isFalse ⋯
- Complexity.SAT.instDecidableEqGuessVerifyPhase.decEq (Complexity.SAT.GuessVerifyPhase.guess a) (Complexity.SAT.GuessVerifyPhase.rewindInput a_1) = isFalse ⋯
- Complexity.SAT.instDecidableEqGuessVerifyPhase.decEq (Complexity.SAT.GuessVerifyPhase.guess a) (Complexity.SAT.GuessVerifyPhase.guess b) = if h : a = b then h ▸ isTrue ⋯ else isFalse ⋯
- Complexity.SAT.instDecidableEqGuessVerifyPhase.decEq (Complexity.SAT.GuessVerifyPhase.guess a) (Complexity.SAT.GuessVerifyPhase.pair a_1) = isFalse ⋯
- Complexity.SAT.instDecidableEqGuessVerifyPhase.decEq (Complexity.SAT.GuessVerifyPhase.guess a) (Complexity.SAT.GuessVerifyPhase.verify a_1) = isFalse ⋯
- Complexity.SAT.instDecidableEqGuessVerifyPhase.decEq (Complexity.SAT.GuessVerifyPhase.pair a) (Complexity.SAT.GuessVerifyPhase.counter a_1) = isFalse ⋯
- Complexity.SAT.instDecidableEqGuessVerifyPhase.decEq (Complexity.SAT.GuessVerifyPhase.pair a) (Complexity.SAT.GuessVerifyPhase.rewindInput a_1) = isFalse ⋯
- Complexity.SAT.instDecidableEqGuessVerifyPhase.decEq (Complexity.SAT.GuessVerifyPhase.pair a) (Complexity.SAT.GuessVerifyPhase.guess a_1) = isFalse ⋯
- Complexity.SAT.instDecidableEqGuessVerifyPhase.decEq (Complexity.SAT.GuessVerifyPhase.pair a) (Complexity.SAT.GuessVerifyPhase.pair b) = if h : a = b then h ▸ isTrue ⋯ else isFalse ⋯
- Complexity.SAT.instDecidableEqGuessVerifyPhase.decEq (Complexity.SAT.GuessVerifyPhase.pair a) (Complexity.SAT.GuessVerifyPhase.verify a_1) = isFalse ⋯
- Complexity.SAT.instDecidableEqGuessVerifyPhase.decEq (Complexity.SAT.GuessVerifyPhase.verify a) (Complexity.SAT.GuessVerifyPhase.counter a_1) = isFalse ⋯
- Complexity.SAT.instDecidableEqGuessVerifyPhase.decEq (Complexity.SAT.GuessVerifyPhase.verify a) (Complexity.SAT.GuessVerifyPhase.rewindInput a_1) = isFalse ⋯
- Complexity.SAT.instDecidableEqGuessVerifyPhase.decEq (Complexity.SAT.GuessVerifyPhase.verify a) (Complexity.SAT.GuessVerifyPhase.guess a_1) = isFalse ⋯
- Complexity.SAT.instDecidableEqGuessVerifyPhase.decEq (Complexity.SAT.GuessVerifyPhase.verify a) (Complexity.SAT.GuessVerifyPhase.pair a_1) = isFalse ⋯
- Complexity.SAT.instDecidableEqGuessVerifyPhase.decEq (Complexity.SAT.GuessVerifyPhase.verify a) (Complexity.SAT.GuessVerifyPhase.verify b) = if h : a = b then h ▸ isTrue ⋯ else isFalse ⋯
Instances For
GuessVerifyPhase Q is finite whenever Q is.
Equations
- One or more equations did not get rendered due to their size.
State reached when entering the verifier phase from already-started tapes.
This is the state component of M's forced first step from its true initial
configuration, where every tape reads ▷.
Equations
- Complexity.SAT.verifierStartedState M = (M.δ M.qstart Complexity.Γ.start (fun (x : Fin k) => Complexity.Γ.start) Complexity.Γ.start).1
Instances For
SAT-specialized guess-and-verify NTM parameterized by a verifier M.
It is a concrete composed machine. The proof layer below shows that, when M
decides pairLang Witness, this machine decides language in polynomial time.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The deterministic machine simulated during the verifier phase of
satGuessVerifyNTM. It runs M with M's input head retargeted to the
SAT pair tape, while the real input tape and the setup-only work tapes are
idled.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Project a SAT verifier-phase configuration to the corresponding
configuration of the underlying verifier M: the SAT pair tape becomes
M's input tape, and the first k SAT work tapes become M's work
tapes.
Equations
- One or more equations did not get rendered due to their size.
Instances For
If the SAT verifier wrapper has just entered the verifier state with the
pair tape as virtual input and blank started verifier work/output tapes,
its projection is exactly M's post-start configuration on that pair.
A verifier that decides a language also halts from its post-start
configuration. This is the verifier suffix shape used by the composed SAT
machine, whose phase boundary has already performed the first move off
▷.
Output-carrying version of
verifier_started_trace_halts_of_decidesInTime.
One verifier-phase step projects to one ordinary verifier step, provided
the virtual-input/pair tape is structurally stable for the no-op
readBackWrite.
Multi-step projection from the SAT verifier phase back to M.toNTM,
assuming the virtual-input/pair tape is stable for each proper verifier
prefix.
Halting transfers from the projected verifier trace back to the SAT verifier phase.
One verifier-phase step preserves the invariant that the SAT pair tape has no start markers outside cell zero.
The SAT pair tape stays free of start markers outside cell zero throughout the verifier phase.
A clean SAT pair tape supplies the structural guard needed by the verifier projection: if the pair head is away from cell zero, it cannot be reading a start marker.
Wrap a counter-subroutine configuration into the composed machine.
Equations
- Complexity.SAT.satCounterWrap M c = { state := Complexity.SAT.GuessVerifyPhase.counter c.state, input := c.input, work := c.work, output := c.output }
Instances For
Wrap an input-rewind configuration into the composed machine.
Equations
- Complexity.SAT.satRewindInputWrap M c = { state := Complexity.SAT.GuessVerifyPhase.rewindInput c.state, input := c.input, work := c.work, output := c.output }
Instances For
Wrap a bounded-guess configuration into the composed machine.
Equations
- Complexity.SAT.satGuessWrap M c = { state := Complexity.SAT.GuessVerifyPhase.guess c.state, input := c.input, work := c.work, output := c.output }
Instances For
Wrap a pair-builder configuration into the composed machine.
Equations
- Complexity.SAT.satPairWrap M c = { state := Complexity.SAT.GuessVerifyPhase.pair c.state, input := c.input, work := c.work, output := c.output }
Instances For
Wrap a verifier configuration into the composed machine.
Equations
- Complexity.SAT.satVerifyWrap M c = { state := Complexity.SAT.GuessVerifyPhase.verify c.state, input := c.input, work := c.work, output := c.output }
Instances For
Tape effect of a SAT phase boundary on the real input tape.
Equations
- Complexity.SAT.satBoundaryInput inp = inp.move (Complexity.TM.idleDir inp.read)
Instances For
Tape effect of a SAT phase boundary on the work tapes.
Equations
- Complexity.SAT.satBoundaryWork work i = (work i).writeAndMove (Complexity.TM.readBackWrite (work i).read).toΓ (Complexity.TM.idleDir (work i).read)
Instances For
Tape effect of a SAT phase boundary on the output tape.
Equations
- Complexity.SAT.satBoundaryOutput out = out.writeAndMove (Complexity.TM.readBackWrite out.read).toΓ (Complexity.TM.idleDir out.read)
Instances For
Exact initialized Boolean contents on the SAT pair tape imply the clean-tape invariant required by the verifier phase.
A phase boundary leaves every work tape unchanged when all heads are past cell zero and no start markers occur beyond cell zero.
A phase boundary leaves the output tape unchanged when it is not currently reading a start marker.
One composed-machine step on a non-done counter configuration simulates one step of the counter subroutine.
Multi-step counter-phase simulation up to, but not across, the counter subroutine's halt state.
If the counter subroutine first reaches done at time T, then the
composed machine exits the counter phase on the next step.
From the actual composed-machine initial configuration, the counter setup phase reaches the input-rewind phase within the counter bound plus the one boundary step.
One composed-machine step on a non-done rewind configuration simulates one step of the input-rewind subroutine.
Multi-step input-rewind simulation up to, but not across, the rewind subroutine's halt state.
If the input-rewind subroutine first reaches done at time T, then the
composed machine exits the rewind phase on the next step.
From a standard input-rewind phase start, the composed machine reaches bounded guessing within the input-rewind bound plus the one boundary step.
Rich input-rewind exit theorem: in addition to reaching the guess phase
with the input head restored, preserve all work tapes and output through
the boundary when their heads are already past ▷.
Exact-input corollary of the rich rewind exit, specialized for an input
tape whose cells are the initialized encoding of x.
One composed-machine step on a non-done guess configuration simulates one step of the bounded-guessing subroutine with the same choice bit.
Multi-step bounded-guess simulation up to, but not across, the guess subroutine's halt state.
If the bounded-guess subroutine first reaches done at time T, then
the composed machine exits the guess phase on the next step.
From a standard bounded-guess phase start, the composed machine reaches pair building within the guess bound plus the one boundary step.
Arbitrary-choice guess exit with the frame facts needed by pair building: the produced witness is bounded by the counter, while the real input, pair tape, output, and verifier work tapes are preserved through the boundary.
Completeness-oriented guess exit: for any requested witness within the unary counter bound, there is a nondeterministic choice sequence that exits the guess phase with exactly that witness and leaves the pair tape blank.
Started-input strengthening of satGuessVerify_guess_generates_with_pair_frame.
Besides producing the requested witness and preserving the blank pair tape,
the phase exit keeps the exact started input tape needed by pair building.
Compose input rewind with the completeness-oriented guess phase. Starting from a rewind configuration whose work/output frames already satisfy the guess preconditions, there is a choice sequence reaching pair-building with exact input, witness, and blank pair tapes.
Compose counter setup, input rewind, and the completeness-oriented guess phase from the actual composed-machine initial configuration. The result is a pair-phase configuration with exact input, requested witness, and a blank pair tape.
Arbitrary-choice setup composition from the real initial configuration. Within the setup budget, every setup choice prefix reaches pair building with some bounded witness, exact started input, blank pair/output tapes, and blank verifier work tapes.
One composed-machine step on a non-done pair configuration simulates one step of the pair-builder subroutine.
Multi-step pair-builder simulation up to, but not across, the pair subroutine's halt state.
If the pair-builder subroutine first reaches done at time T, then the
composed machine exits the pair phase on the next step.
From a standard pair-builder phase start, the composed machine reaches verifier simulation within the pair-builder bound plus the one boundary step.
Pair-builder exit with the verifier frame exposed. Besides the exact pair tape, this packages preservation of the output tape and every internal verifier work tape through pair construction and the boundary step.
One composed-machine step on a non-halted verifier configuration simulates one step of the verifier-phase machine.
Multi-step verifier-phase simulation up to, but not across, M's halt
state.
If the verifier phase has halted by time T, then the composed SAT
machine, started in verifier phase, is halted by time T as well.
If the projected verifier computation halts, then the full SAT machine started in verifier phase halts under the same time bound.
If the projected verifier computation halts and the SAT pair tape is clean, then the full SAT machine started in verifier phase halts under the same time bound.
If the projected verifier computation halts with accepting output and the SAT pair tape is clean, then the full SAT machine started in verifier phase also halts with accepting output.
If the projected verifier computation halts with accepting output and the SAT pair tape is clean, then the full SAT machine started in verifier phase also halts with accepting output.
If a composed SAT trace prefix has reached the verifier phase, then any halting projected verifier suffix gives a halting full composed trace.
If a composed SAT trace prefix has reached the verifier phase, then any accepting projected verifier suffix gives an accepting full composed trace.
If a composed SAT trace prefix has reached the verifier phase, then any projected verifier suffix preserves its final output cell through the composed machine.
Generic trace composition for the composed SAT machine: if a prefix reaches a configuration whose suffix trace halts, then the combined trace halts.
Generic trace composition for the composed SAT machine: if a prefix reaches a configuration whose suffix trace accepts, then the combined trace accepts.
Guess-phase exit followed by any halting pair/verifier suffix gives a halting combined run.
Input-rewind exit followed by any halting guess/pair/verifier suffix gives a halting combined run.
Counter-setup exit followed by any halting rewind/guess/pair/verifier suffix gives a halting combined run.
Pair-builder-to-verifier composition: once a SAT trace prefix has exited the
pair phase with the exact encoded (x, y) pair tape, a halting projected
verifier suffix makes the full composed machine halt.
Pair-builder-to-verifier composition with accepting output.
Pair-builder-to-verifier composition preserving the projected verifier's final output cell.
Bounded pair-building followed by a halting verifier suffix gives a bounded
halting run of the composed machine. The existential t is the first
pair-builder halt time supplied by satGuessVerify_pair_exits.
Pair-start completeness with a real deciding verifier. If the pair phase starts from exact input/witness/pair tapes and blank verifier frame tapes, then pair construction followed by verifier simulation halts.
Pair-start all-path halting under the uniform SAT witness bound. Once the
witness tape contains any y with |y| ≤ |x|+1, every remaining choice
sequence reaches a halt within the pair-builder worst-case plus verifier
window budget.
Pair-start bounded deciding suffix under the uniform SAT witness bound.
Once setup has produced a bounded witness y, every remaining choice
sequence halts within the pair/verifier window and outputs the correct
verifier bit for pair x y.
Pair-start completeness with accepting output from a real deciding verifier.
End-to-end SAT-specialized completeness spine. If a target witness y
fits the SAT linear witness bound and the projected verifier suffix halts
from every possible pair-builder first halt for the exact (x, y) pair
setup, then there is a full nondeterministic run of satGuessVerifyNTM M
from the real initial configuration that halts.
End-to-end completeness halting from a real deciding verifier. For any SAT
witness candidate y within the linear bound, the SAT-specialized
guess-and-verify machine has a nondeterministic run from its real initial
configuration that reaches a halted state.
End-to-end accepting completeness from a real deciding verifier. For any
SAT witness candidate y within the linear bound whose encoded pair is in
the verifier language, the SAT-specialized guess-and-verify machine has a
nondeterministic accepting run from its real initial configuration.
The end-to-end accepting completeness theorem packaged in the standard
NTM.AcceptsInTime interface, using the concrete witness-dependent run
budget from the phase construction.
The accepting witness run under the uniform SAT-specialized bound depending
only on |x| and the verifier time window.
SAT-specific accepting run from any concrete satisfying assignment, assuming
M decides the SAT verifier pair language.
SAT-specific accepting run from any concrete satisfying assignment under the uniform SAT-specialized bound.
Timed yes-instance half for language under the uniform SAT-specialized bound,
assuming M decides the SAT verifier pair language.
Yes-instances of language are accepted by the SAT-specialized
guess-and-verify machine, assuming M decides the SAT verifier pair
language. This is the unbounded acceptance half of the final NP decision
theorem.
All computation paths of the SAT-specialized machine halt within the uniform bound induced by the setup budget and the verifier time window.
Every full SAT-specialized run within the uniform bound factors through
some bounded guessed witness y, and the final output bit matches the
verifier's decision on pair x y.
No SAT instance outside language has an accepting run within the uniform
SAT-specialized bound, assuming the verifier decides pairLang Witness.
The SAT-specialized machine decides language within the uniform bound
satGuessVerifyTime, assuming M decides the SAT verifier pair language.
If the verifier time bound is polynomial, then the SAT-specialized
witness-independent runtime satGuessVerifyTime is pointwise bounded by
an explicit polynomial.
If the verifier time bound is polynomial, then the SAT-specialized
runtime satGuessVerifyTime is polynomial too.
Direct SAT route: if the deterministic verifier for Witness is in P,
then the completed SAT-specialized guess-and-verify machine puts language
in NP. This bypasses the still-open generic witness-language interface
and packages the concrete construction proved in this file.
The full boundary step from counter setup into input rewind.
The full boundary step from input rewind into bounded guessing.
The full boundary step from bounded guessing into pair building.
The full boundary step from pair building into verifier simulation.
State-only form of the boundary step from a finished counter phase into input rewinding.
State-only form of the boundary step from a finished rewind phase into bounded guessing.
State-only form of the boundary step from a finished guess phase into pair building.