The local check of the Cook–Levin tableau #
The window of the tableau at a step t and a choice of a position on every tape
(planning/succinct-cook-levin.md, S1; answer_reduction.tex def:local-check-circuit):
for each tape the five cells and heads around the position at time t, the cell and head
at the position at time t + 1, the states at t and t + 1 and the emission flags of
the step. Five cells rather than the paper's three, because the input heads of the
repository's machine model clamp at both ends of the input (Turing.moveInputPos), and
deciding whether a head one cell off the center moves or stays needs the cell beyond it.
The window's bits are one-hot: one variable per cell and cell value, per state. A window
is locally consistent (LocallyConsistent) if it is the encoding of a local
configuration in which, wherever the local information suffices, the time-t + 1 values are
the transition of the time-t ones: if every tape has its head in the central three cells
the whole transition is checked, including the state and the emission; a tape whose head is
not near the center keeps its cell and has no head at the center; a tape with two heads in
the window is accepted unconditionally, an invariant of the tableau excluding it. The
predicate checkPred on window bits is what the check circuit computes.
Equations
- MIPRE.TM.CookLevin.instDecidableEqCellVal.decEq (MIPRE.TM.CookLevin.CellVal.sym a) (MIPRE.TM.CookLevin.CellVal.sym b) = if h : a = b then h ▸ isTrue ⋯ else isFalse ⋯
- MIPRE.TM.CookLevin.instDecidableEqCellVal.decEq (MIPRE.TM.CookLevin.CellVal.sym s) MIPRE.TM.CookLevin.CellVal.blank = isFalse ⋯
- MIPRE.TM.CookLevin.instDecidableEqCellVal.decEq (MIPRE.TM.CookLevin.CellVal.sym s) MIPRE.TM.CookLevin.CellVal.bdry = isFalse ⋯
- MIPRE.TM.CookLevin.instDecidableEqCellVal.decEq MIPRE.TM.CookLevin.CellVal.blank (MIPRE.TM.CookLevin.CellVal.sym s) = isFalse ⋯
- MIPRE.TM.CookLevin.instDecidableEqCellVal.decEq MIPRE.TM.CookLevin.CellVal.blank MIPRE.TM.CookLevin.CellVal.blank = isTrue ⋯
- MIPRE.TM.CookLevin.instDecidableEqCellVal.decEq MIPRE.TM.CookLevin.CellVal.blank MIPRE.TM.CookLevin.CellVal.bdry = isFalse ⋯
- MIPRE.TM.CookLevin.instDecidableEqCellVal.decEq MIPRE.TM.CookLevin.CellVal.bdry (MIPRE.TM.CookLevin.CellVal.sym s) = isFalse ⋯
- MIPRE.TM.CookLevin.instDecidableEqCellVal.decEq MIPRE.TM.CookLevin.CellVal.bdry MIPRE.TM.CookLevin.CellVal.blank = isFalse ⋯
- MIPRE.TM.CookLevin.instDecidableEqCellVal.decEq MIPRE.TM.CookLevin.CellVal.bdry MIPRE.TM.CookLevin.CellVal.bdry = isTrue ⋯
Instances For
Equations
- One or more equations did not get rendered due to their size.
The cell value of a tape symbol (none the blank).
Equations
Instances For
The tape symbol of a non-boundary cell value (the boundary reads as blank).
Equations
Instances For
The tapes: i input tapes and w work tapes.
Equations
- MIPRE.TM.CookLevin.Tape i w = (Fin i ⊕ Fin w)
Instances For
The variables of a window: for each tape, the five cells and heads at offsets 0..4
around the position at time t, the cell and head at the position at time t + 1; the
states at t and t + 1; the emission flags of the step.
- cellPre {i w : ℕ} {Symbol : Type u_1} {State : Type u_2} (d : Tape i w) (δ : Fin 5) (v : CellVal Symbol) : WinVar i w Symbol State
- headPre {i w : ℕ} {Symbol : Type u_1} {State : Type u_2} (d : Tape i w) (δ : Fin 5) : WinVar i w Symbol State
- cellPost {i w : ℕ} {Symbol : Type u_1} {State : Type u_2} (d : Tape i w) (v : CellVal Symbol) : WinVar i w Symbol State
- headPost {i w : ℕ} {Symbol : Type u_1} {State : Type u_2} (d : Tape i w) : WinVar i w Symbol State
- statePre {i w : ℕ} {Symbol : Type u_1} {State : Type u_2} (q : Option State) : WinVar i w Symbol State
- statePost {i w : ℕ} {Symbol : Type u_1} {State : Type u_2} (q : Option State) : WinVar i w Symbol State
- emitOne {i w : ℕ} {Symbol : Type u_1} {State : Type u_2} : WinVar i w Symbol State
- emitBad {i w : ℕ} {Symbol : Type u_1} {State : Type u_2} : WinVar i w Symbol State
Instances For
Equations
- One or more equations did not get rendered due to their size.
- MIPRE.TM.CookLevin.instDecidableEqWinVar.decEq (MIPRE.TM.CookLevin.WinVar.cellPre d δ v) (MIPRE.TM.CookLevin.WinVar.headPre d_1 δ_1) = isFalse ⋯
- MIPRE.TM.CookLevin.instDecidableEqWinVar.decEq (MIPRE.TM.CookLevin.WinVar.cellPre d δ v) (MIPRE.TM.CookLevin.WinVar.cellPost d_1 v_1) = isFalse ⋯
- MIPRE.TM.CookLevin.instDecidableEqWinVar.decEq (MIPRE.TM.CookLevin.WinVar.cellPre d δ v) (MIPRE.TM.CookLevin.WinVar.headPost d_1) = isFalse ⋯
- MIPRE.TM.CookLevin.instDecidableEqWinVar.decEq (MIPRE.TM.CookLevin.WinVar.cellPre d δ v) (MIPRE.TM.CookLevin.WinVar.statePre q) = isFalse ⋯
- MIPRE.TM.CookLevin.instDecidableEqWinVar.decEq (MIPRE.TM.CookLevin.WinVar.cellPre d δ v) (MIPRE.TM.CookLevin.WinVar.statePost q) = isFalse ⋯
- MIPRE.TM.CookLevin.instDecidableEqWinVar.decEq (MIPRE.TM.CookLevin.WinVar.cellPre d δ v) MIPRE.TM.CookLevin.WinVar.emitOne = isFalse ⋯
- MIPRE.TM.CookLevin.instDecidableEqWinVar.decEq (MIPRE.TM.CookLevin.WinVar.cellPre d δ v) MIPRE.TM.CookLevin.WinVar.emitBad = isFalse ⋯
- MIPRE.TM.CookLevin.instDecidableEqWinVar.decEq (MIPRE.TM.CookLevin.WinVar.headPre d δ) (MIPRE.TM.CookLevin.WinVar.cellPre d_1 δ_1 v) = isFalse ⋯
- MIPRE.TM.CookLevin.instDecidableEqWinVar.decEq (MIPRE.TM.CookLevin.WinVar.headPre d δ) (MIPRE.TM.CookLevin.WinVar.cellPost d_1 v) = isFalse ⋯
- MIPRE.TM.CookLevin.instDecidableEqWinVar.decEq (MIPRE.TM.CookLevin.WinVar.headPre d δ) (MIPRE.TM.CookLevin.WinVar.headPost d_1) = isFalse ⋯
- MIPRE.TM.CookLevin.instDecidableEqWinVar.decEq (MIPRE.TM.CookLevin.WinVar.headPre d δ) (MIPRE.TM.CookLevin.WinVar.statePre q) = isFalse ⋯
- MIPRE.TM.CookLevin.instDecidableEqWinVar.decEq (MIPRE.TM.CookLevin.WinVar.headPre d δ) (MIPRE.TM.CookLevin.WinVar.statePost q) = isFalse ⋯
- MIPRE.TM.CookLevin.instDecidableEqWinVar.decEq (MIPRE.TM.CookLevin.WinVar.headPre d δ) MIPRE.TM.CookLevin.WinVar.emitOne = isFalse ⋯
- MIPRE.TM.CookLevin.instDecidableEqWinVar.decEq (MIPRE.TM.CookLevin.WinVar.headPre d δ) MIPRE.TM.CookLevin.WinVar.emitBad = isFalse ⋯
- MIPRE.TM.CookLevin.instDecidableEqWinVar.decEq (MIPRE.TM.CookLevin.WinVar.cellPost d v) (MIPRE.TM.CookLevin.WinVar.cellPre d_1 δ v_1) = isFalse ⋯
- MIPRE.TM.CookLevin.instDecidableEqWinVar.decEq (MIPRE.TM.CookLevin.WinVar.cellPost d v) (MIPRE.TM.CookLevin.WinVar.headPre d_1 δ) = isFalse ⋯
- MIPRE.TM.CookLevin.instDecidableEqWinVar.decEq (MIPRE.TM.CookLevin.WinVar.cellPost d v) (MIPRE.TM.CookLevin.WinVar.headPost d_1) = isFalse ⋯
- MIPRE.TM.CookLevin.instDecidableEqWinVar.decEq (MIPRE.TM.CookLevin.WinVar.cellPost d v) (MIPRE.TM.CookLevin.WinVar.statePre q) = isFalse ⋯
- MIPRE.TM.CookLevin.instDecidableEqWinVar.decEq (MIPRE.TM.CookLevin.WinVar.cellPost d v) (MIPRE.TM.CookLevin.WinVar.statePost q) = isFalse ⋯
- MIPRE.TM.CookLevin.instDecidableEqWinVar.decEq (MIPRE.TM.CookLevin.WinVar.cellPost d v) MIPRE.TM.CookLevin.WinVar.emitOne = isFalse ⋯
- MIPRE.TM.CookLevin.instDecidableEqWinVar.decEq (MIPRE.TM.CookLevin.WinVar.cellPost d v) MIPRE.TM.CookLevin.WinVar.emitBad = isFalse ⋯
- MIPRE.TM.CookLevin.instDecidableEqWinVar.decEq (MIPRE.TM.CookLevin.WinVar.headPost d) (MIPRE.TM.CookLevin.WinVar.cellPre d_1 δ v) = isFalse ⋯
- MIPRE.TM.CookLevin.instDecidableEqWinVar.decEq (MIPRE.TM.CookLevin.WinVar.headPost d) (MIPRE.TM.CookLevin.WinVar.headPre d_1 δ) = isFalse ⋯
- MIPRE.TM.CookLevin.instDecidableEqWinVar.decEq (MIPRE.TM.CookLevin.WinVar.headPost d) (MIPRE.TM.CookLevin.WinVar.cellPost d_1 v) = isFalse ⋯
- MIPRE.TM.CookLevin.instDecidableEqWinVar.decEq (MIPRE.TM.CookLevin.WinVar.headPost a) (MIPRE.TM.CookLevin.WinVar.headPost b) = if h : a = b then h ▸ isTrue ⋯ else isFalse ⋯
- MIPRE.TM.CookLevin.instDecidableEqWinVar.decEq (MIPRE.TM.CookLevin.WinVar.headPost d) (MIPRE.TM.CookLevin.WinVar.statePre q) = isFalse ⋯
- MIPRE.TM.CookLevin.instDecidableEqWinVar.decEq (MIPRE.TM.CookLevin.WinVar.headPost d) (MIPRE.TM.CookLevin.WinVar.statePost q) = isFalse ⋯
- MIPRE.TM.CookLevin.instDecidableEqWinVar.decEq (MIPRE.TM.CookLevin.WinVar.headPost d) MIPRE.TM.CookLevin.WinVar.emitOne = isFalse ⋯
- MIPRE.TM.CookLevin.instDecidableEqWinVar.decEq (MIPRE.TM.CookLevin.WinVar.headPost d) MIPRE.TM.CookLevin.WinVar.emitBad = isFalse ⋯
- MIPRE.TM.CookLevin.instDecidableEqWinVar.decEq (MIPRE.TM.CookLevin.WinVar.statePre q) (MIPRE.TM.CookLevin.WinVar.cellPre d δ v) = isFalse ⋯
- MIPRE.TM.CookLevin.instDecidableEqWinVar.decEq (MIPRE.TM.CookLevin.WinVar.statePre q) (MIPRE.TM.CookLevin.WinVar.headPre d δ) = isFalse ⋯
- MIPRE.TM.CookLevin.instDecidableEqWinVar.decEq (MIPRE.TM.CookLevin.WinVar.statePre q) (MIPRE.TM.CookLevin.WinVar.cellPost d v) = isFalse ⋯
- MIPRE.TM.CookLevin.instDecidableEqWinVar.decEq (MIPRE.TM.CookLevin.WinVar.statePre q) (MIPRE.TM.CookLevin.WinVar.headPost d) = isFalse ⋯
- MIPRE.TM.CookLevin.instDecidableEqWinVar.decEq (MIPRE.TM.CookLevin.WinVar.statePre a) (MIPRE.TM.CookLevin.WinVar.statePre b) = if h : a = b then h ▸ isTrue ⋯ else isFalse ⋯
- MIPRE.TM.CookLevin.instDecidableEqWinVar.decEq (MIPRE.TM.CookLevin.WinVar.statePre q) (MIPRE.TM.CookLevin.WinVar.statePost q_1) = isFalse ⋯
- MIPRE.TM.CookLevin.instDecidableEqWinVar.decEq (MIPRE.TM.CookLevin.WinVar.statePre q) MIPRE.TM.CookLevin.WinVar.emitOne = isFalse ⋯
- MIPRE.TM.CookLevin.instDecidableEqWinVar.decEq (MIPRE.TM.CookLevin.WinVar.statePre q) MIPRE.TM.CookLevin.WinVar.emitBad = isFalse ⋯
- MIPRE.TM.CookLevin.instDecidableEqWinVar.decEq (MIPRE.TM.CookLevin.WinVar.statePost q) (MIPRE.TM.CookLevin.WinVar.cellPre d δ v) = isFalse ⋯
- MIPRE.TM.CookLevin.instDecidableEqWinVar.decEq (MIPRE.TM.CookLevin.WinVar.statePost q) (MIPRE.TM.CookLevin.WinVar.headPre d δ) = isFalse ⋯
- MIPRE.TM.CookLevin.instDecidableEqWinVar.decEq (MIPRE.TM.CookLevin.WinVar.statePost q) (MIPRE.TM.CookLevin.WinVar.cellPost d v) = isFalse ⋯
- MIPRE.TM.CookLevin.instDecidableEqWinVar.decEq (MIPRE.TM.CookLevin.WinVar.statePost q) (MIPRE.TM.CookLevin.WinVar.headPost d) = isFalse ⋯
- MIPRE.TM.CookLevin.instDecidableEqWinVar.decEq (MIPRE.TM.CookLevin.WinVar.statePost q) (MIPRE.TM.CookLevin.WinVar.statePre q_1) = isFalse ⋯
- MIPRE.TM.CookLevin.instDecidableEqWinVar.decEq (MIPRE.TM.CookLevin.WinVar.statePost a) (MIPRE.TM.CookLevin.WinVar.statePost b) = if h : a = b then h ▸ isTrue ⋯ else isFalse ⋯
- MIPRE.TM.CookLevin.instDecidableEqWinVar.decEq (MIPRE.TM.CookLevin.WinVar.statePost q) MIPRE.TM.CookLevin.WinVar.emitOne = isFalse ⋯
- MIPRE.TM.CookLevin.instDecidableEqWinVar.decEq (MIPRE.TM.CookLevin.WinVar.statePost q) MIPRE.TM.CookLevin.WinVar.emitBad = isFalse ⋯
- MIPRE.TM.CookLevin.instDecidableEqWinVar.decEq MIPRE.TM.CookLevin.WinVar.emitOne (MIPRE.TM.CookLevin.WinVar.cellPre d δ v) = isFalse ⋯
- MIPRE.TM.CookLevin.instDecidableEqWinVar.decEq MIPRE.TM.CookLevin.WinVar.emitOne (MIPRE.TM.CookLevin.WinVar.headPre d δ) = isFalse ⋯
- MIPRE.TM.CookLevin.instDecidableEqWinVar.decEq MIPRE.TM.CookLevin.WinVar.emitOne (MIPRE.TM.CookLevin.WinVar.cellPost d v) = isFalse ⋯
- MIPRE.TM.CookLevin.instDecidableEqWinVar.decEq MIPRE.TM.CookLevin.WinVar.emitOne (MIPRE.TM.CookLevin.WinVar.headPost d) = isFalse ⋯
- MIPRE.TM.CookLevin.instDecidableEqWinVar.decEq MIPRE.TM.CookLevin.WinVar.emitOne (MIPRE.TM.CookLevin.WinVar.statePre q) = isFalse ⋯
- MIPRE.TM.CookLevin.instDecidableEqWinVar.decEq MIPRE.TM.CookLevin.WinVar.emitOne (MIPRE.TM.CookLevin.WinVar.statePost q) = isFalse ⋯
- MIPRE.TM.CookLevin.instDecidableEqWinVar.decEq MIPRE.TM.CookLevin.WinVar.emitOne MIPRE.TM.CookLevin.WinVar.emitOne = isTrue ⋯
- MIPRE.TM.CookLevin.instDecidableEqWinVar.decEq MIPRE.TM.CookLevin.WinVar.emitOne MIPRE.TM.CookLevin.WinVar.emitBad = isFalse ⋯
- MIPRE.TM.CookLevin.instDecidableEqWinVar.decEq MIPRE.TM.CookLevin.WinVar.emitBad (MIPRE.TM.CookLevin.WinVar.cellPre d δ v) = isFalse ⋯
- MIPRE.TM.CookLevin.instDecidableEqWinVar.decEq MIPRE.TM.CookLevin.WinVar.emitBad (MIPRE.TM.CookLevin.WinVar.headPre d δ) = isFalse ⋯
- MIPRE.TM.CookLevin.instDecidableEqWinVar.decEq MIPRE.TM.CookLevin.WinVar.emitBad (MIPRE.TM.CookLevin.WinVar.cellPost d v) = isFalse ⋯
- MIPRE.TM.CookLevin.instDecidableEqWinVar.decEq MIPRE.TM.CookLevin.WinVar.emitBad (MIPRE.TM.CookLevin.WinVar.headPost d) = isFalse ⋯
- MIPRE.TM.CookLevin.instDecidableEqWinVar.decEq MIPRE.TM.CookLevin.WinVar.emitBad (MIPRE.TM.CookLevin.WinVar.statePre q) = isFalse ⋯
- MIPRE.TM.CookLevin.instDecidableEqWinVar.decEq MIPRE.TM.CookLevin.WinVar.emitBad (MIPRE.TM.CookLevin.WinVar.statePost q) = isFalse ⋯
- MIPRE.TM.CookLevin.instDecidableEqWinVar.decEq MIPRE.TM.CookLevin.WinVar.emitBad MIPRE.TM.CookLevin.WinVar.emitOne = isFalse ⋯
- MIPRE.TM.CookLevin.instDecidableEqWinVar.decEq MIPRE.TM.CookLevin.WinVar.emitBad MIPRE.TM.CookLevin.WinVar.emitBad = isTrue ⋯
Instances For
Equations
- One or more equations did not get rendered due to their size.
A local configuration: the decoded content of a window.
Instances For
The one-hot bits of a local configuration.
Equations
- L.encode (MIPRE.TM.CookLevin.WinVar.cellPre a a_1 a_2) = decide (L.cellPre a a_1 = a_2)
- L.encode (MIPRE.TM.CookLevin.WinVar.headPre a a_1) = L.headPre a a_1
- L.encode (MIPRE.TM.CookLevin.WinVar.cellPost a a_1) = decide (L.cellPost a = a_1)
- L.encode (MIPRE.TM.CookLevin.WinVar.headPost a) = L.headPost a
- L.encode (MIPRE.TM.CookLevin.WinVar.statePre a) = decide (L.statePre = a)
- L.encode (MIPRE.TM.CookLevin.WinVar.statePost a) = decide (L.statePost = a)
- L.encode MIPRE.TM.CookLevin.WinVar.emitOne = L.emitOne
- L.encode MIPRE.TM.CookLevin.WinVar.emitBad = L.emitBad
Instances For
The new offset of a head at offset δ ∈ {1, 2, 3} after a move m, on an input tape
(clamped: a move left from the first position, whose left neighbor is the boundary, and a
move right from the position after the input, a blank whose left neighbor is not the
boundary, stay) or a work tape (never clamped).
Equations
- One or more equations did not get rendered due to their size.
- MIPRE.TM.CookLevin.newOffset isInput cells δ SignType.zero = ↑δ
- MIPRE.TM.CookLevin.newOffset isInput cells δ SignType.neg = if isInput = true ∧ cells ⟨↑δ - 1, ⋯⟩ = MIPRE.TM.CookLevin.CellVal.bdry then ↑δ else ↑δ - 1
Instances For
The full transition check, when every tape has its head at the offset δ d of the
central three cells: the time-t + 1 values are those of the machine's transition.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Local consistency of a decoded window.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The check predicate on window bits: the bits encode a locally consistent local configuration.
Equations
- MIPRE.TM.CookLevin.checkPred M acc win = ∃ (L : MIPRE.TM.CookLevin.LocalCfg i w Symbol State), L.encode = win ∧ MIPRE.TM.CookLevin.LocallyConsistent M acc L