Soundness of the Cook–Levin tableau #
A satisfying assignment of the tableau formula comes from an accepting run
(acceptsIn_of_tableau_sat), and the equivalence tableau_sat_iff
(planning/succinct-cook-levin.md, S1).
- The successor part of a locally consistent window is a function of its time-
tpart (post_of_pre): two locally consistent local configurations with the same cells, heads and state at timet, one of them with at most one head per tape, agree on the cell and head at timet + 1of every tape whose head is far, and on everything when every head is in the window. - The free input strings are read off the time-
0rows (freeString): the symbols from cell3up to the first blank, which the free-tape clauses make well defined (FreeFacts.cell_eq). - The rows encode the run (
rows_of_sat), by induction on time: the window centered at a cell, with the other windows centered at the heads, determines the cell and head at the next time; the window centered at every head determines the state and the emission bits.
The successor part of a window is determined #
Two windows satisfying the full-step check at the same offsets, with the same time-t
part, have the same time-t + 1 part.
The successor part of a locally consistent window is determined by its time-t
part. For every tape whose head is far the cell and head at time t + 1, and when every
head is in the window everything.
The free input strings #
The blank bit of cell k + 3 of input tape j at time 0 (true past the last cell).
Equations
- MIPRE.TM.CookLevin.blankBit a j k = if h : k + 3 < MIPRE.TM.CookLevin.numCells S then a (MIPRE.TM.CookLevin.TabVar.cell 0 (Sum.inl j) ⟨k + 3, h⟩ MIPRE.TM.CookLevin.CellVal.blank) else true
Instances For
The s bit of cell k + 3 of input tape j at time 0.
Equations
- MIPRE.TM.CookLevin.symBit a j s k = if h : k + 3 < MIPRE.TM.CookLevin.numCells S then a (MIPRE.TM.CookLevin.TabVar.cell 0 (Sum.inl j) ⟨k + 3, h⟩ (MIPRE.TM.CookLevin.CellVal.sym s)) else false
Instances For
The string on free tape j, read off row 0: s₀ where the s₀ bit is set, else
s₁, up to the first blank.
Equations
- MIPRE.TM.CookLevin.freeString a j s₀ s₁ = List.ofFn fun (k : Fin (MIPRE.TM.CookLevin.freeLen a j)) => if MIPRE.TM.CookLevin.symBit a j s₀ ↑k = true then s₀ else s₁
Instances For
What the free-tape clauses say about tape j at time 0.
- bdry (p : Pos S) (v : CellVal Symbol) : p.IsBdry → a (TabVar.cell 0 (Sum.inl j) p v) = decide (v = CellVal.bdry)
- other (p : Pos S) (v : CellVal Symbol) : ¬p.IsBdry → v ≠ CellVal.sym s₀ → v ≠ CellVal.sym s₁ → v ≠ CellVal.blank → a (TabVar.cell 0 (Sum.inl j) p v) = false
- some (p : Pos S) : ¬p.IsBdry → a (TabVar.cell 0 (Sum.inl j) p (CellVal.sym s₀)) = true ∨ a (TabVar.cell 0 (Sum.inl j) p (CellVal.sym s₁)) = true ∨ a (TabVar.cell 0 (Sum.inl j) p CellVal.blank) = true
- mono (p p' : Pos S) : 2 < ↑p → ¬p'.IsBdry → p < p' → a (TabVar.cell 0 (Sum.inl j) p CellVal.blank) = true → a (TabVar.cell 0 (Sum.inl j) p' CellVal.blank) = true
Instances For
An interior cell carrying one value carries no other.
The time-0 row of a free tape is the encoding of the string read off it.
The rows encode the run #
Row t of the assignment a encodes the configuration c.
Instances For
A locally consistent window of a at step t whose time-t part is that of c.
Windows centered at the heads and at a cell #
The center putting the head of d at offset 2.
Equations
- MIPRE.TM.CookLevin.headCenter c hin d = ⟨(MIPRE.TM.CookLevin.headCell c d - 2).toNat, ⋯⟩
Instances For
The centers putting the cell p of tape d at the middle of its window and the head of
every other tape at offset 2.
Equations
- MIPRE.TM.CookLevin.cellCenter c hin d p hnb d' = if d' = d then ⟨↑p - 2, ⋯⟩ else MIPRE.TM.CookLevin.headCenter c hin d'
Instances For
Every head is in its window when the windows are centered at the heads.
At the window of a cell, either every head is in its window or the head of the cell's tape is far.
The step #
A row encoding c is followed by a row encoding M.step c, when every window is
locally consistent; the emission bits of the step are those of c.
From a satisfying assignment to an accepting run #
The inputs read off a satisfying assignment: the fixed strings, and on the free tapes
the strings on the time-0 rows.
Equations
- MIPRE.TM.CookLevin.inputOf s₀ s₁ fixed chk a j = (fixed j).getD (MIPRE.TM.CookLevin.freeString a j s₀ s₁)
Instances For
The window clauses force, through the check circuit, local consistency of every window.
Row 0 encodes the initial configuration on the inputs read off the assignment.
The rows of a satisfying assignment encode the run on the inputs read off it, with
the emission bookkeeping: emitted t iff something was output before time t, at most one
symbol, and only acc.
Soundness of the tableau. A satisfying assignment reads, on its time-0 rows, the
inputs inputOf, which extend the fixed strings by strings over {s₀, s₁}, and M
accepts them within S steps.
The equivalence #
Correctness of the Cook–Levin tableau (lem:correct-tableau): the tableau formula
of S steps is satisfiable iff M accepts, within S steps, some inputs that extend the
fixed strings by strings over {s₀, s₁} on the free tapes.