NP witness characterization #
This file states and (up to a single TM-engineering lemma) proves the
textbook characterization of NP via FNP witness relations:
A language
Lis inNPiff there is an FNP relationRsuch thatx ∈ L ↔ ∃ y, R x y.
The forward direction (NP ⊆ witness form) is a computation-path witness
argument and is left for a later pass.
The reverse direction — the FNP ⇒ NP bridge used by SAT ∈ NP — is
captured here by mem_NP_of_FNP_witness, parameterized by the single
TM-engineering construction interface WitnessNTMConstruction: build the
nondeterministic "guess-and-verify" machine from a deterministic verifier
of pairLang R. Everything above that construction — unpacking FNP,
computing polynomial bounds, and packaging the result as membership in
NP — is proved here unconditionally.
Proof strategy for WitnessNTMConstruction #
Given:
- a DTM
MdecidingpairLang Rin polynomial time, and - a polynomial
pbounding witness length (PolyBalanced R),
construct an NTM N that, on input x:
- Guess phase. Reads
p.eval |x|nondeterministic bits and writes them onto a dedicated work tape as a guessed witnessy. - Pair construction. Copies
pair(x, y)onto another work tape usingxfrom the input tape and the guessedyfrom the witness tape. - Verification. Simulates
Mon the constructed pair (reading from the work tape that holdspair(x, y)instead of the input tape).
The total running time is polynomial: O(p(n) + n + T(2n + p(n) + 2))
where T(n) = n^c bounds M.
The construction is mechanical but substantial — analogous in size to the
existing unionTM/seqTM combinators — and is deferred to a later pass.
All downstream consequences (including SAT ∈ NP conditional on the SAT
verifier being in P) rest only on that single lemma.
The witness language of a relation R — the set of inputs x that
admit some witness. Isolated as a definition so the statement of
mem_NP_of_FNP_witness reads cleanly.
Instances For
Membership in witnessLang R unfolds to the existence of a witness:
x ∈ witnessLang R ↔ ∃ y, R x y.
Guess-and-verify NTM construction interface. Given a DTM M deciding
pairLang R within a time bound T(n) ≤ O(n^c) and a polynomial p
bounding witness length, there exists an NTM deciding
witnessLang R = {x | ∃ y, R x y} in polynomial time.
The construction is the standard Arora-Barak guess-and-verify:
nondeterministically write a witness of length ≤ p(|x|) onto a work
tape, build pair(x, y) on another work tape, then simulate M.
This is isolated as a named proposition so results can state precisely when they rely on the still-to-be-built machine construction, instead of importing an unproved theorem.
Supporting utilities #
When implementing this construction, the following lemmas from
Complexitylib.Asymptotics will be useful for packaging the running-time
bound of the constructed NTM:
BigO.pow_polynomial_bound— turn the hypothesisf =O (·^c)into an explicitPolynomial ℕbound onf.BigO.of_polynomial_bound— turn the computed polynomial bound on the constructed NTM's running time back intog =O (·^d). Thepair_lengthsimp lemma inComplexitylib.Classes.Pairinggives|pair x y| = 2·|x| + 2 + |y|, needed when substituting the simulated verifier's input length.
Equations
- One or more equations did not get rendered due to their size.
Instances For
FNP ⇒ NP via witnesses. If the generic guess-and-verify construction
has been implemented, R ∈ FNP, and x ∈ L ↔ ∃ y, R x y, then
L ∈ NP. Proof: unpack FNP to get a polynomial-time DTM verifier
M for pairLang R and a polynomial witness-length bound, apply the
construction to build the guess-and-verify NTM, and package the result as
NP membership.
Restatement in terms of witnessLang. If R ∈ FNP, then
witnessLang R ∈ NP. This is the useful form for applying to
concrete relations like Witness.