The reduction emitter, assembled #
emitTM N p computes the Cook–Levin reduction: bump the tapes, measure
the input, evaluate the time polynomial, initialize the radix and fuel
registers, and emit the seven encoded clause families of
tableauCNFFlat N (p.eval |x|) x.
The file then proves the running time polynomially bounded (via the
PolyBnd closure kit), concluding reductionFn N (p.eval ·) ∈ FP, the
Cook–Levin reductions cookLevin_reduction_singleTape /
cookLevin_reduction, and the headlines NPHard_language and
NPComplete_language for the SAT language language.
The corresponding tape file.
Equations
- Complexity.SAT.Tape.inits n steps P Qc tf i = Complexity.TM.regTape (Complexity.SAT.initVals n steps P Qc tf i)
Instances For
The register initialization chain: input length, time polynomial, tableau width, radices, and position fuels.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Budget of the initialization chain: the polynomial evaluation plus sixteen register operations.
Equations
- One or more equations did not get rendered due to their size.
Instances For
emitInitTM Hoare specification. From the bumped all-zero register
file, reach the initialized file; Mp caps the Horner evaluation,
M the tableau values.
Overwriting tFuel in an initialized register file just changes the
fuel parameter.
Zeroing the scratch registers tmp/tmp2 of an initialized register
file is a no-op: they already hold 0.
The family chain: fuel setups, the seven families, counter resets.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Budget of the family chain.
Equations
- One or more equations did not get rendered due to their size.
Instances For
emitBodyTM Hoare specification: from the initialized register file
and empty accumulator, emit the encoded flat tableau.
The Cook–Levin reduction machine: bump, initialize, emit.
Equations
Instances For
The Horner-evaluation value cap.
Equations
Instances For
The tableau value cap.
Equations
- Complexity.SAT.emitM N p n = 4 * (Polynomial.eval n p + 1) * max (Fintype.card N.Q) 3 * (Polynomial.eval n p + n + 1 + 2) * 4
Instances For
The reduction machine's running time.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The reduction machine computes the reduction function.
Dominated by a Polynomial ℕ evaluation.
Equations
- Complexity.SAT.PolyBnd f = ∃ (q : Polynomial ℕ), ∀ (n : ℕ), f n ≤ Polynomial.eval n q
Instances For
Constant functions are polynomially bounded.
The identity function is polynomially bounded.
Evaluating a Polynomial ℕ is polynomially bounded (by itself).
Budget compositions preserve polynomial boundedness.
layerBudget of a polynomially bounded value cap is polynomially
bounded.
loadBudget of a polynomially bounded value cap is polynomially
bounded.
emitVarBudget of a polynomially bounded value cap is polynomially
bounded.
clauseBudget with polynomially bounded length and value cap is
polynomially bounded.
loopBudget with polynomially bounded iteration count and body budget
is polynomially bounded.
The running time is polynomially bounded. A mechanical walk over the
budget definitions with the PolyBnd closure kit.
The reduction is polynomial-time computable — for an explicit
polynomial time bound n ↦ p.eval n. The tableau has size polynomial in
p.eval |x| (hence in |x|), and emitTM emits its encoding in
polynomial time.
Single-tape Cook–Levin reduction. A single-work-tape machine deciding
L in polynomial time yields a polynomial-time many-one reduction to
language. The abstract bound T is first replaced by a dominating explicit
polynomial (BigO.pow_polynomial_bound), since the reduction function is
only computable for explicit bounds; deciding transfers by
monotonicity.
Per-machine Cook–Levin reduction. If a nondeterministic machine N
decides L within a polynomial time bound, then L polynomial-time
many-one reduces to language. Reduces to the single-work-tape case
(NTM.exists_singleTape_decidesInTime) and then builds the tableau formula.
NP-hardness of SAT. Every language in NP polynomial-time reduces to
language.
Cook–Levin theorem: SAT is NP-complete.