The Cook–Levin tableau #
Given a deterministic multi-tape machine tm over the binary alphabet, a fixed input prefix u,
a certificate length L and a number of steps T, tableau tm u L T is a formula in
conjunctive normal form that is satisfiable exactly when some certificate w of length L
makes tm, started on u ++ w, halt within T steps with output [true]
(Cslib.Complexity.CookLevin.tableau_satisfiable_iff, in
CslibFrontier/Computability/Complexity/CookLevin/Correctness.lean). It has
exactly one satisfying assignment (of its variables) for each such certificate
(Cslib.Complexity.CookLevin.modelCount_tableau, in
CslibFrontier/Computability/Complexity/CookLevin/Parsimonious.lean).
The formula describes the first T + 1 configurations of the run directly, in the model of
Turing.MultiTapeTM: a read-only input tape, k two-way infinite work tapes, and a write-only
output tape. Its variables say which features (Turing.MultiTapeTM.Feature) hold at which time:
the state, the input head, the work heads and work cells in the window |z| ≤ T (a head moves at
most one cell per step), the view of the output, the symbols read and the situation of a step.
The only other variables are the certificate bits.
The clauses fix the initial configuration, ask that exactly one basic feature of each group hold
at each time (Turing.MultiTapeTM.Feature.groups), force the symbols read and the situation that
actually hold to be true, and impose the step equation: each term of
Turing.MultiTapeTM.Feature.stepTerms at time t implies its feature at time t + 1. For
satisfiability, forcing the symbols read and the situations in one direction suffices, because
situations occur only positively in the terms
(Turing.MultiTapeTM.Feature.mem_basic_of_mem_stepTerms). The uniqueness clauses force the
converse: each head reads at most one symbol, and a true situation has its state and symbols read
true. Every variable of the tableau is then determined by the certificate bits, which makes the
reduction parsimonious (Cslib.Complexity.CookLevin.modelCount_tableau, in
CslibFrontier/Computability/Complexity/CookLevin/Parsimonious.lean). No conversion to a
single-tape
or oblivious machine is needed: the
action of a step depends on the situation only, and every tape applies its part of the action
locally.
The definitions are noncomputable: the transition function of Turing.MultiTapeTM is chosen from
its transition relation, and the states and situations are enumerated through Finset.toList in
an arbitrary order. Both depend on the machine only, so a machine producing the tableau can store
them in a table; the enumerations that depend on the input (Turing.windowList, List.range) are
explicit lists. Only the set of satisfying assignments matters for correctness.
Main definitions #
References #
- S. Arora, B. Barak, Computational Complexity: A Modern Approach, Section 2.3.
- C. H. Papadimitriou, Computational Complexity, Theorem 8.2.
Instances For
Clauses #
The initial configuration: state q₀, input head on the first input cell, every work head
on cell 0, blank work tapes, empty output.
Instances For
Exactly one basic feature of each group holds at time t.
Instances For
The input head at position j reads the input symbol there: a fixed symbol of u or a blank
end marker, or a certificate bit.
Instances For
The symbols under the heads at time t: the symbol a head reads, from its position and the
cell there, is true.
Instances For
The situation at time t: a situation whose state and symbols read are true is true.
Instances For
The symbols read and the situation at time t are unique: each work head and the input head
read at most one symbol, and a true situation has its state and symbols read true. With the read
and situation clauses, the symbols read and the situation that are true are then exactly those
that hold.
Instances For
The step equation from time t to time t + 1: each term of the step equation of a basic
feature, at time t, implies the feature at time t + 1.
Instances For
The run has halted by time T with output [true].
Instances For
The Cook–Levin tableau of tm on inputs u ++ w with |w| = L, unrolled for T steps.