Transition clauses force the next label to The three depth regions cover every depth exactly once
TheoremTransition clauses force the next label#✓fully proved
Let \(L\) be a layout with \(K\) stacks and window depth \(d\), let \(\mathrm{la}, \mathrm{na} : \mathbb{N} \to \mathbb{N}\) and \(\mathrm{wa} : \mathbb{N} \to \mathbb{N} \to \mathbb{N} \to \mathbb{N}\) be tables, and let \(a\) be an assignment satisfying the transition clause family of \(L\), \(\mathrm{la}\), \(\mathrm{na}\) and \(\mathrm{wa}\) for bounds \(T\), \(H\) and \(N\). Write \(X[t, b]\) and \(C[t, k, j, x]\) for the label/state and cell variables at height \(H\). Suppose \(t < T\), \(i < N\), \(X[t, \mathrm{la}(i)]\) is true under \(a\), and for every \(n < Kd\), writing \(q = \lfloor n / d \rfloor\) and \(r = n \bmod d\), the variable \(C[t, q, r, \mathrm{wa}(i, q, r)]\) is true under \(a\). Then \(X[t + 1, \mathrm{na}(i)]\) is true under \(a\).
The window literals are indexed by \(n\) exactly as in the clause, and no one-hot hypothesis on \(a\) is needed.
theorem fam_force {L : Family.Layout} {la na : ℕ → ℕ} {wa : ℕ → ℕ → ℕ → ℕ} {N T H : ℕ}
{a : List Bool} (ha : cnfSat (Family.family L la na wa T H N) a) {t i : ℕ} (ht : t < T)
(hi : i < N) (hX : Tr a (L.xIdx H t (la i)))
(hW : ∀ n < L.KK * L.d, Tr a (L.cIdx H t (n / L.d) (n % L.d) (wa i (n / L.d) (n % L.d)))) :
Tr a (L.xIdx H (t + 1) (na i))
structure Layout where
/-- Size of the label/state block of a row. -/
A : ℕ
/-- Number of stacks. -/
KK : ℕ
/-- Number of symbol codes (code `0` is the empty cell). -/
g : ℕ
/-- Window depth. -/
d : ℕ
CSLibExt/Computability/Complexity/CookLevin/Family.lean:78
def cnfSat (φ : CNF) (a : List Bool) : Prop :=
∀ c ∈ φ, clauseSat c a
CSLibExt/Computability/Complexity/DenseSAT.lean:67
def family (T H N : ℕ) : CNF :=
(List.range T).flatMap fun t =>
(List.range N).map fun i => denseClause (L.numVars T H) (lits L la na wa H t i)
CSLibExt/Computability/Complexity/CookLevin/Family.lean:132
def Tr (a : List Bool) (v : ℕ) : Prop := a[v]? = some true
CSLibExt/Computability/Complexity/CookLevin/Situation.lean:1064
Uses 14 · Used by 1
TheoremTransition clauses force the next label, stack-and-depth form#✓fully proved
Let \(L\) be a layout with \(K\) stacks and window depth \(d\), let \(\mathrm{la}, \mathrm{na} : \mathbb{N} \to \mathbb{N}\) and \(\mathrm{wa} : \mathbb{N} \to \mathbb{N} \to \mathbb{N} \to \mathbb{N}\) be tables, and let \(a\) be an assignment satisfying the transition clause family of \(L\), \(\mathrm{la}\), \(\mathrm{na}\) and \(\mathrm{wa}\) for bounds \(T\), \(H\) and \(N\). Write \(X[t, b]\) and \(C[t, k, j, x]\) for the label/state and cell variables at height \(H\). If \(t < T\), \(i < N\), \(X[t, \mathrm{la}(i)]\) is true under \(a\), and \(C[t, k, j, \mathrm{wa}(i, k, j)]\) is true under \(a\) for all \(k < K\) and \(j < d\), then \(X[t + 1, \mathrm{na}(i)]\) is true under \(a\).
theorem fam_force_kj {L : Family.Layout} {la na : ℕ → ℕ} {wa : ℕ → ℕ → ℕ → ℕ} {N T H : ℕ}
{a : List Bool} (ha : cnfSat (Family.family L la na wa T H N) a) {t i : ℕ} (ht : t < T)
(hi : i < N) (hX : Tr a (L.xIdx H t (la i)))
(hW : ∀ k < L.KK, ∀ j < L.d, Tr a (L.cIdx H t k j (wa i k j))) :
Tr a (L.xIdx H (t + 1) (na i))
structure Layout where
/-- Size of the label/state block of a row. -/
A : ℕ
/-- Number of stacks. -/
KK : ℕ
/-- Number of symbol codes (code `0` is the empty cell). -/
g : ℕ
/-- Window depth. -/
d : ℕ
CSLibExt/Computability/Complexity/CookLevin/Family.lean:78
def cnfSat (φ : CNF) (a : List Bool) : Prop :=
∀ c ∈ φ, clauseSat c a
CSLibExt/Computability/Complexity/DenseSAT.lean:67
def family (T H N : ℕ) : CNF :=
(List.range T).flatMap fun t =>
(List.range N).map fun i => denseClause (L.numVars T H) (lits L la na wa H t i)
CSLibExt/Computability/Complexity/CookLevin/Family.lean:132
def Tr (a : List Bool) (v : ℕ) : Prop := a[v]? = some true
CSLibExt/Computability/Complexity/CookLevin/Situation.lean:1064
Uses 7 · Used by 2
DefinitionThe code of a configuration holds in a row#✓fully proved
Given an encoding of a machine \(M\), an assignment \(a\), a height \(H\), a time \(t\) and a configuration \(c\) of \(M\), the code of \(c\) holds in row \(t\) when the label/state variable of row \(t\) (at height \(H\)) whose index is the combined (label, state) code of \(c\) is true under \(a\).
def CodeHolds (a : List Bool) (H t : ℕ) (c : M.Cfg) : Prop :=
Tr a (E.layout.xIdx H t (E.code c))
def Tr (a : List Bool) (v : ℕ) : Prop := a[v]? = some true
CSLibExt/Computability/Complexity/CookLevin/Situation.lean:1064
Uses 5 · Used by 15
TheoremL2 (S-definition, positive)#✓fully proved
Let \(E\) be an encoding of the machine \(M\) with \(K\) stacks and layout \(L\), let \(d\) be the window depth of \(M\), let \(H \in \mathbb{N}\) with \(d \le H\), let \(W\) be the row width of \(L\) at height \(H\), and write \(X[t, x] = tW + x\) for the label/state variables and \(C[t, k, j, x]\) for the cell variable of row \(t\), stack \(k\), depth \(j\) and symbol code \(x\). For a configuration \(c\) write \(\kappa(c)\) for its (label, state) code and \(\gamma_c(k, j)\) for the code of its cell at stack \(k\) and depth \(j\). Let \(T, t \in \mathbb{N}\) with \(t < T\), and let the assignment \(a\) satisfy the transition clause family of \(L\) for \(T\), \(H\) and the number \(N\) of situations, with the current-label table \(\mathrm{la}\) and the window table \(\mathrm{wa}\) of \(E\), and with the table \(\mathrm{sa}\) of \(E\) (where \(\mathrm{sa}(i)\) is the position of the variable of situation \(i\) in the label/state block) in place of the next-label table. Let \(c\) be a good configuration with situation index \(i\) such that \(X[t, \kappa(c)]\) is true under \(a\) and \(C[t, k, j, \gamma_c(k, j)]\) is true under \(a\) for all \(k < K\) and \(j < H\). Then the variable \(X[t + 1, \mathrm{sa}(i)]\) is true under \(a\).
theorem sd_hold {T H t : ℕ} {a : List Bool}
(ha : cnfSat (Family.family E.layout E.la E.sa E.wa T H E.N) a) (ht : t < T)
(c : M.Cfg) (hc : E.Good c) (hdH : depth M ≤ H)
(hcode : E.CodeHolds a H t c) (hrow : E.CellsHold a H t (E.cell c)) :
Tr a (E.layout.xIdx H (t + 1) (E.sa (E.sitIdx c)))
def cnfSat (φ : CNF) (a : List Bool) : Prop :=
∀ c ∈ φ, clauseSat c a
CSLibExt/Computability/Complexity/DenseSAT.lean:67
def family (T H N : ℕ) : CNF :=
(List.range T).flatMap fun t =>
(List.range N).map fun i => denseClause (L.numVars T H) (lits L la na wa H t i)
CSLibExt/Computability/Complexity/CookLevin/Family.lean:132
def depth (M : FinTM2) : ℕ :=
letI := M.ΛFin
Finset.univ.sup fun l => ops (M.m l)
CSLibExt/Computability/Complexity/CookLevin/Situation.lean:231
def Tr (a : List Bool) (v : ℕ) : Prop := a[v]? = some true
CSLibExt/Computability/Complexity/CookLevin/Situation.lean:1064
Uses 21 · Used by 1
TheoremL3 (S-definition, real run)#✓fully proved
Let \(E\) be an encoding of the machine \(M\) with \(K\) stacks and layout \(L\), let \(d\) be the window depth of \(M\), let \(H \in \mathbb{N}\) with \(d \le H\), let \(W\) be the row width of \(L\) at height \(H\), and write \(X[t, x] = tW + x\) for the label/state variables and \(C[t, k, j, x]\) for the cell variable of row \(t\), stack \(k\), depth \(j\) and symbol code \(x\). For a configuration \(c\) write \(\kappa(c)\) for its (label, state) code and \(\gamma_c(k, j)\) for the code of its cell at stack \(k\) and depth \(j\). Fix an input list \(s\), let \(c_n\) be the configuration after \(n\) steps of the idle-extended run of \(M\) from the initial configuration on \(s\), let \(T, t \in \mathbb{N}\) with \(t < T\), and let \(i\) be the situation index of \(c_t\). Let the assignment \(a\) satisfy the transition clause family of \(L\) for \(T\), \(H\) and the number \(N\) of situations, with the current-label table \(\mathrm{la}\) and the window table \(\mathrm{wa}\) of \(E\), and with the table \(\mathrm{sa}\) of \(E\) (where \(\mathrm{sa}(i)\) is the position of the variable of situation \(i\) in the label/state block) in place of the next-label table. If \(X[t, \kappa(c_t)]\) is true under \(a\) and \(C[t, k, j, \gamma_{c_t}(k, j)]\) is true under \(a\) for all \(k < K\) and \(j < H\), then the variable \(X[t + 1, \mathrm{sa}(i)]\) is true under \(a\).
theorem sd_step_run {T H t : ℕ} {a : List Bool} (s : List (M.Γ M.k₀))
(ha : cnfSat (Family.family E.layout E.la E.sa E.wa T H E.N) a) (ht : t < T)
(hdH : depth M ≤ H) (hcode : E.CodeHolds a H t (runI M (initList M s) t))
(hrow : E.CellsHold a H t (E.cell (runI M (initList M s) t))) :
Tr a (E.layout.xIdx H (t + 1) (E.sa (E.sitIdx (runI M (initList M s) t))))
def cnfSat (φ : CNF) (a : List Bool) : Prop :=
∀ c ∈ φ, clauseSat c a
CSLibExt/Computability/Complexity/DenseSAT.lean:67
def family (T H N : ℕ) : CNF :=
(List.range T).flatMap fun t =>
(List.range N).map fun i => denseClause (L.numVars T H) (lits L la na wa H t i)
CSLibExt/Computability/Complexity/CookLevin/Family.lean:132
def depth (M : FinTM2) : ℕ :=
letI := M.ΛFin
Finset.univ.sup fun l => ops (M.m l)
CSLibExt/Computability/Complexity/CookLevin/Situation.lean:231
def runI (M : FinTM2) (c : M.Cfg) : ℕ → M.Cfg
| 0 => c
| t + 1 => stepI M (runI M c t)
CSLibExt/Computability/Complexity/CookLevin/Situation.lean:691
def Tr (a : List Bool) (v : ℕ) : Prop := a[v]? = some true
CSLibExt/Computability/Complexity/CookLevin/Situation.lean:1064
Uses 19 · Used by 2
TheoremComposition with the shift family#✓fully proved
Let \(E\) be an encoding of the machine \(M\) with \(K\) stacks, layout \(L\), \(N\) situations and situation tables \(\mathrm{la}\), \(\mathrm{wa}\), \(\mathrm{sa}\), \(\mathrm{pl}\), \(\mathrm{cn}\) and \(\mathrm{pu}\), let \(d\) be the window depth of \(M\), let \(H \in \mathbb{N}\) with \(d \le H\), and let \(T, t \in \mathbb{N}\) with \(t < T\). Call a variable true under an assignment \(a\) when its index is less than the length of \(a\) and \(a\) is true there. Write \(X[r, x]\) for the label/state variable \(x\) of row \(r\) and \(C[r, k, j, x]\) for the cell variable of row \(r\), stack \(k\), depth \(j\) and symbol code \(x\) (both at height \(H\)). For a configuration \(c\) write \(\kappa(c)\) for its (label, state) code and \(\gamma_c(k, j)\) for the code of its cell at stack \(k\) and depth \(j\) (\(0\) if there is none). Fix an input list \(s\), let \(c_n\) be the configuration after \(n\) steps of the idle-extended run of \(M\) from the initial configuration on \(s\), and let \(i\) be the situation index of \(c_t\). Let \(a\) satisfy both the transition clause family of \(L\) for \(T\), \(H\) and \(N\) with the tables \(\mathrm{la}\) and \(\mathrm{wa}\) and with \(\mathrm{sa}\) in place of the next-label table, and the cell-shift clause family of \(L\) with the tables \(\mathrm{sa}\), \(\mathrm{pl}\), \(\mathrm{cn}\), \(\mathrm{pu}\) for \(N\), \(T\) and \(H\). Suppose that every stack of \(c_t\) has length at most \(H - d\), that \(X[t, \kappa(c_t)]\) is true, and that \(C[t, k', j', \gamma_{c_t}(k', j')]\) is true for all \(k' < K\) and \(j' < H\). Then for every \(k < K\) and every \(j\) with \(\mathrm{pl}(i, k) \le j < H - \max(\mathrm{pl}(i, k), \mathrm{cn}(i, k)) + \mathrm{pl}(i, k)\), the variable \(C[t + 1, k, j, \gamma_{c_{t+1}}(k, j)]\) is true. Subtraction is truncated at \(0\).
theorem sdsh_step_run_pos {T H t : ℕ} {a : List Bool} (s : List (M.Γ M.k₀))
(hs : cnfSat (Family.family E.layout E.la E.sa E.wa T H E.N) a)
(ha : cnfSat (Shift.shFamily E.layout E.sa E.pl E.cn E.pu E.N T H) a) (ht : t < T)
(hh : ∀ k, ((runI M (initList M s) t).stk k).length ≤ H - depth M) (hdH : depth M ≤ H)
(hcode : E.CodeHolds a H t (runI M (initList M s) t))
(hrow : E.CellsHold a H t (E.cell (runI M (initList M s) t)))
{k j : ℕ} (hk : k < E.KK) (hj1 : E.pl (E.sitIdx (runI M (initList M s) t)) k ≤ j)
(hj2 : j < H - max (E.pl (E.sitIdx (runI M (initList M s) t)) k)
(E.cn (E.sitIdx (runI M (initList M s) t)) k) + E.pl (E.sitIdx (runI M (initList M s) t)) k) :
Tr a (E.layout.cIdx H (t + 1) k j (E.cell (runI M (initList M s) (t + 1)) k j))
def cnfSat (φ : CNF) (a : List Bool) : Prop :=
∀ c ∈ φ, clauseSat c a
CSLibExt/Computability/Complexity/DenseSAT.lean:67
def family (T H N : ℕ) : CNF :=
(List.range T).flatMap fun t =>
(List.range N).map fun i => denseClause (L.numVars T H) (lits L la na wa H t i)
CSLibExt/Computability/Complexity/CookLevin/Family.lean:132
def shFamily (N T H : ℕ) : CNF :=
(List.range T).flatMap fun t => (List.range N).flatMap fun i =>
(List.range L.KK).flatMap fun k => shBlk L sa pl cn pu T H t i k
CSLibExt/Computability/Complexity/CookLevin/Shift.lean:100
def runI (M : FinTM2) (c : M.Cfg) : ℕ → M.Cfg
| 0 => c
| t + 1 => stepI M (runI M c t)
CSLibExt/Computability/Complexity/CookLevin/Situation.lean:691
def depth (M : FinTM2) : ℕ :=
letI := M.ΛFin
Finset.univ.sup fun l => ops (M.m l)
CSLibExt/Computability/Complexity/CookLevin/Situation.lean:231
def Tr (a : List Bool) (v : ℕ) : Prop := a[v]? = some true
CSLibExt/Computability/Complexity/CookLevin/Situation.lean:1064
Uses 22
TheoremUpdate forcing (positive)#✓fully proved
Let \(E\) be an encoding of the machine \(M\) with \(K\) stacks and layout \(L\), let \(d\) be the window depth of \(M\), let \(H \in \mathbb{N}\) with \(d \le H\), let \(W\) be the row width of \(L\) at height \(H\), and write \(X[t, x] = tW + x\) for the label/state variables and \(C[t, k, j, x]\) for the cell variable of row \(t\), stack \(k\), depth \(j\) and symbol code \(x\). For a configuration \(c\) write \(\kappa(c)\) for its (label, state) code and \(\gamma_c(k, j)\) for the code of its cell at stack \(k\) and depth \(j\). Let \(T, t \in \mathbb{N}\) with \(t < T\), and let the assignment \(a\) satisfy the transition clause family of \(L\) with the current-label table \(\mathrm{la}\), the next-label table \(\mathrm{na}\) and the window table \(\mathrm{wa}\) of \(E\), for \(T\), \(H\) and the number \(N\) of situations. Let \(c\) be a good configuration with situation index \(i\) such that \(X[t, \kappa(c)]\) is true under \(a\) and \(C[t, k, j, \gamma_c(k, j)]\) is true under \(a\) for all \(k < K\) and \(j < H\). Then the variable \(X[t + 1, \mathrm{na}(i)]\) is true under \(a\).
theorem upd_hold {T H t : ℕ} {a : List Bool}
(ha : cnfSat (Family.family E.layout E.la E.na E.wa T H E.N) a) (ht : t < T)
(c : M.Cfg) (hc : E.Good c) (hdH : depth M ≤ H)
(hcode : E.CodeHolds a H t c) (hrow : E.CellsHold a H t (E.cell c)) :
Tr a (E.layout.xIdx H (t + 1) (E.na (E.sitIdx c)))
def cnfSat (φ : CNF) (a : List Bool) : Prop :=
∀ c ∈ φ, clauseSat c a
CSLibExt/Computability/Complexity/DenseSAT.lean:67
def family (T H N : ℕ) : CNF :=
(List.range T).flatMap fun t =>
(List.range N).map fun i => denseClause (L.numVars T H) (lits L la na wa H t i)
CSLibExt/Computability/Complexity/CookLevin/Family.lean:132
def depth (M : FinTM2) : ℕ :=
letI := M.ΛFin
Finset.univ.sup fun l => ops (M.m l)
CSLibExt/Computability/Complexity/CookLevin/Situation.lean:231
def Tr (a : List Bool) (v : ℕ) : Prop := a[v]? = some true
CSLibExt/Computability/Complexity/CookLevin/Situation.lean:1064
Uses 21 · Used by 1
TheoremUpdate forcing, real run#✓fully proved
Let \(E\) be an encoding of the machine \(M\) with \(K\) stacks and layout \(L\), let \(d\) be the window depth of \(M\), let \(H \in \mathbb{N}\) with \(d \le H\), let \(W\) be the row width of \(L\) at height \(H\), and write \(X[t, x] = tW + x\) for the label/state variables and \(C[t, k, j, x]\) for the cell variable of row \(t\), stack \(k\), depth \(j\) and symbol code \(x\). For a configuration \(c\) write \(\kappa(c)\) for its (label, state) code and \(\gamma_c(k, j)\) for the code of its cell at stack \(k\) and depth \(j\). Fix an input list \(s\), let \(c_n\) be the configuration after \(n\) steps of the idle-extended run of \(M\) from the initial configuration on \(s\), let \(T, t \in \mathbb{N}\) with \(t < T\), and suppose every stack of \(c_t\) has length at most \(H - d\). Let the assignment \(a\) satisfy the transition clause family of \(L\) with the current-label table \(\mathrm{la}\), the next-label table \(\mathrm{na}\) and the window table \(\mathrm{wa}\) of \(E\), for \(T\), \(H\) and the number \(N\) of situations. If \(X[t, \kappa(c_t)]\) is true under \(a\) and \(C[t, k, j, \gamma_{c_t}(k, j)]\) is true under \(a\) for all \(k < K\) and \(j < H\), then the variable \(X[t + 1, \kappa(c_{t+1})]\) is true under \(a\).
theorem upd_step_run {T H t : ℕ} {a : List Bool} (s : List (M.Γ M.k₀))
(ha : cnfSat (Family.family E.layout E.la E.na E.wa T H E.N) a) (ht : t < T)
(hh : ∀ k, ((runI M (initList M s) t).stk k).length ≤ H - depth M) (hdH : depth M ≤ H)
(hcode : E.CodeHolds a H t (runI M (initList M s) t))
(hrow : E.CellsHold a H t (E.cell (runI M (initList M s) t))) :
E.CodeHolds a H (t + 1) (runI M (initList M s) (t + 1))
def cnfSat (φ : CNF) (a : List Bool) : Prop :=
∀ c ∈ φ, clauseSat c a
CSLibExt/Computability/Complexity/DenseSAT.lean:67
def family (T H N : ℕ) : CNF :=
(List.range T).flatMap fun t =>
(List.range N).map fun i => denseClause (L.numVars T H) (lits L la na wa H t i)
CSLibExt/Computability/Complexity/CookLevin/Family.lean:132
def runI (M : FinTM2) (c : M.Cfg) : ℕ → M.Cfg
| 0 => c
| t + 1 => stepI M (runI M c t)
CSLibExt/Computability/Complexity/CookLevin/Situation.lean:691
def depth (M : FinTM2) : ℕ :=
letI := M.ΛFin
Finset.univ.sup fun l => ops (M.m l)
CSLibExt/Computability/Complexity/CookLevin/Situation.lean:231
Uses 22 · Used by 1
TheoremPushed-fill forcing#✓fully proved
Let \(L\) be a layout with \(A\) label/state variables, \(K\) stacks and \(g\) symbol codes, let \(\mathrm{sa}, \mathrm{pl}, \mathrm{cn}, \mathrm{pu}\) be situation tables and \(N, T, H \in \mathbb{N}\), and write \(W = A + KHg\), \(X[t, x] = tW + x\) and \(C[t, k, j, x] = tW + A + (kH + j)g + x\). If the assignment \(a\) satisfies the cell-shift family of these data, \(t < T\), \(i < N\), \(k < K\), \(j < \mathrm{pl}(i, k)\) and the variable \(X[t + 1, \mathrm{sa}(i)]\) is true under \(a\), then the variable \(C[t + 1, k, j, \mathrm{pu}(i, k, j)]\) is true under \(a\).
Only the situation literal is read.
theorem pf_force {L : Family.Layout} {sa : ℕ → ℕ} {pl cn : ℕ → ℕ → ℕ} {pu : ℕ → ℕ → ℕ → ℕ}
{N T H : ℕ} {a : List Bool} (ha : cnfSat (Shift.shFamily L sa pl cn pu N T H) a)
{t i k j : ℕ} (ht : t < T) (hi : i < N) (hk : k < L.KK) (hj : j < pl i k)
(hS : Tr a (L.xIdx H (t + 1) (sa i))) : Tr a (L.cIdx H (t + 1) k j (pu i k j))
structure Layout where
/-- Size of the label/state block of a row. -/
A : ℕ
/-- Number of stacks. -/
KK : ℕ
/-- Number of symbol codes (code `0` is the empty cell). -/
g : ℕ
/-- Window depth. -/
d : ℕ
CSLibExt/Computability/Complexity/CookLevin/Family.lean:78
def cnfSat (φ : CNF) (a : List Bool) : Prop :=
∀ c ∈ φ, clauseSat c a
CSLibExt/Computability/Complexity/DenseSAT.lean:67
def shFamily (N T H : ℕ) : CNF :=
(List.range T).flatMap fun t => (List.range N).flatMap fun i =>
(List.range L.KK).flatMap fun k => shBlk L sa pl cn pu T H t i k
CSLibExt/Computability/Complexity/CookLevin/Shift.lean:100
def Tr (a : List Bool) (v : ℕ) : Prop := a[v]? = some true
CSLibExt/Computability/Complexity/CookLevin/Situation.lean:1064
Uses 15 · Used by 1
TheoremOverflow forcing#✓fully proved
Let \(L\) be a layout with \(K\) stacks, let \(\mathrm{sa}\), \(\mathrm{pl}\), \(\mathrm{cn}\) and \(\mathrm{pu}\) be situation tables, and let \(a\) be an assignment satisfying the cell-shift clause family of \(L\) and these tables for bounds \(N\), \(T\) and \(H\). Write \(X[t, b]\) and \(C[t, k, j, x]\) for the label/state and cell variables at height \(H\). If \(t < T\), \(i < N\), \(k < K\), \(r < \mathrm{cn}(i, k) - \mathrm{pl}(i, k)\) and the situation variable \(X[t + 1, \mathrm{sa}(i)]\) is true under \(a\), then the variable \(C[t + 1, k, H - \mathrm{cn}(i, k) + \mathrm{pl}(i, k) + r, 0]\) is true under \(a\), where symbol code \(0\) is the empty cell. Subtraction is truncated at zero.
theorem ov_force {L : Family.Layout} {sa : ℕ → ℕ} {pl cn : ℕ → ℕ → ℕ} {pu : ℕ → ℕ → ℕ → ℕ}
{N T H : ℕ} {a : List Bool} (ha : cnfSat (Shift.shFamily L sa pl cn pu N T H) a)
{t i k r : ℕ} (ht : t < T) (hi : i < N) (hk : k < L.KK) (hr : r < cn i k - pl i k)
(hS : Tr a (L.xIdx H (t + 1) (sa i))) :
Tr a (L.cIdx H (t + 1) k (H - cn i k + pl i k + r) 0)
structure Layout where
/-- Size of the label/state block of a row. -/
A : ℕ
/-- Number of stacks. -/
KK : ℕ
/-- Number of symbol codes (code `0` is the empty cell). -/
g : ℕ
/-- Window depth. -/
d : ℕ
CSLibExt/Computability/Complexity/CookLevin/Family.lean:78
def cnfSat (φ : CNF) (a : List Bool) : Prop :=
∀ c ∈ φ, clauseSat c a
CSLibExt/Computability/Complexity/DenseSAT.lean:67
def shFamily (N T H : ℕ) : CNF :=
(List.range T).flatMap fun t => (List.range N).flatMap fun i =>
(List.range L.KK).flatMap fun k => shBlk L sa pl cn pu T H t i k
CSLibExt/Computability/Complexity/CookLevin/Shift.lean:100
def Tr (a : List Bool) (v : ℕ) : Prop := a[v]? = some true
CSLibExt/Computability/Complexity/CookLevin/Situation.lean:1064
Uses 15 · Used by 1
TheoremPushed-fill forcing for a good configuration#✓fully proved
Let \(E\) be an encoding of the machine \(M\) with \(K\) stacks and layout \(L\), let \(H \in \mathbb{N}\), let \(W\) be the row width of \(L\) at height \(H\), and write \(X[t, x] = tW + x\) for the label/state variables and \(C[t, k, j, x]\) for the cell variable of row \(t\), stack \(k\), depth \(j\) and symbol code \(x\). Let \(T, t \in \mathbb{N}\) with \(t < T\), let the assignment \(a\) satisfy the cell-shift family of \(E\) (tables \(\mathrm{sa}\), \(\mathrm{pl}\), \(\mathrm{cn}\), \(\mathrm{pu}\) and \(N\) situations) for \(T\) and \(H\), and let \(c\) be a good configuration with situation index \(i\) such that \(X[t + 1, \mathrm{sa}(i)]\) is true under \(a\). Then for all \(k < K\) and \(j < \mathrm{pl}(i, k)\) the variable \(C[t + 1, k, j, r]\) is true under \(a\), where \(r\) is the entry at stack \(k\) and depth \(j\) of the table-driven row update, at height \(H\) and for situation \(i\), of the cell codes of \(c\).
theorem pf_hold {T H t : ℕ} {a : List Bool}
(ha : cnfSat (Shift.shFamily E.layout E.sa E.pl E.cn E.pu E.N T H) a) (ht : t < T)
(c : M.Cfg) (hc : E.Good c) (hS : Tr a (E.layout.xIdx H (t + 1) (E.sa (E.sitIdx c))))
{k j : ℕ} (hk : k < E.KK) (hj : j < E.pl (E.sitIdx c) k) :
Tr a (E.layout.cIdx H (t + 1) k j (E.tabRow H (E.sitIdx c) (E.cell c) k j))
def cnfSat (φ : CNF) (a : List Bool) : Prop :=
∀ c ∈ φ, clauseSat c a
CSLibExt/Computability/Complexity/DenseSAT.lean:67
def shFamily (N T H : ℕ) : CNF :=
(List.range T).flatMap fun t => (List.range N).flatMap fun i =>
(List.range L.KK).flatMap fun k => shBlk L sa pl cn pu T H t i k
CSLibExt/Computability/Complexity/CookLevin/Shift.lean:100
def Tr (a : List Bool) (v : ℕ) : Prop := a[v]? = some true
CSLibExt/Computability/Complexity/CookLevin/Situation.lean:1064
Uses 22 · Used by 1
TheoremOverflow cells of the next row hold the table value#✓fully proved
Let \(E\) be an encoding of a machine \(M\) with \(K\) stacks and window depth \(d\), and let \(a\) be an assignment satisfying the cell-shift clause family of \(E\)'s layout and tables \(\mathrm{sa}\), \(\mathrm{pl}\), \(\mathrm{cn}\), \(\mathrm{pu}\) for \(E\)'s number of situations and bounds \(T\) and \(H\). Write \(X[t, b]\) and \(C[t, k, j, x]\) for the label/state and cell variables at height \(H\). Let \(t < T\), let \(c\) be a configuration of \(M\) all of whose stack symbols have codes, suppose \(d \le H\), let \(i\) be the situation index of \(c\), and suppose \(X[t + 1, \mathrm{sa}(i)]\) is true under \(a\). Then for every \(k < K\) and every \(j\) with \(H - \max(\mathrm{pl}(i, k), \mathrm{cn}(i, k)) + \mathrm{pl}(i, k) \le j < H\), the variable \(C[t + 1, k, j, x]\) is true under \(a\), where \(x\) is the value at \((k, j)\) of the table-driven row update at height \(H\) of the cells of \(c\) for situation \(i\). Subtraction is truncated at zero.
At these depths the table-driven row update is \(0\), the empty cell.
theorem ov_hold {T H t : ℕ} {a : List Bool}
(ha : cnfSat (Shift.shFamily E.layout E.sa E.pl E.cn E.pu E.N T H) a) (ht : t < T)
(c : M.Cfg) (hc : E.Good c) (hdH : depth M ≤ H)
(hS : Tr a (E.layout.xIdx H (t + 1) (E.sa (E.sitIdx c))))
{k j : ℕ} (hk : k < E.KK)
(hj1 : H - max (E.pl (E.sitIdx c) k) (E.cn (E.sitIdx c) k) + E.pl (E.sitIdx c) k ≤ j)
(hj2 : j < H) :
Tr a (E.layout.cIdx H (t + 1) k j (E.tabRow H (E.sitIdx c) (E.cell c) k j))
def cnfSat (φ : CNF) (a : List Bool) : Prop :=
∀ c ∈ φ, clauseSat c a
CSLibExt/Computability/Complexity/DenseSAT.lean:67
def shFamily (N T H : ℕ) : CNF :=
(List.range T).flatMap fun t => (List.range N).flatMap fun i =>
(List.range L.KK).flatMap fun k => shBlk L sa pl cn pu T H t i k
CSLibExt/Computability/Complexity/CookLevin/Shift.lean:100
def depth (M : FinTM2) : ℕ :=
letI := M.ΛFin
Finset.univ.sup fun l => ops (M.m l)
CSLibExt/Computability/Complexity/CookLevin/Situation.lean:231
def Tr (a : List Bool) (v : ℕ) : Prop := a[v]? = some true
CSLibExt/Computability/Complexity/CookLevin/Situation.lean:1064
Uses 28 · Used by 1
TheoremPushed-fill forcing on a real run#✓fully proved
Let \(E\) be an encoding of the machine \(M\) with \(K\) stacks and layout \(L\), let \(d\) be the window depth of \(M\), let \(H \in \mathbb{N}\) with \(d \le H\), let \(W\) be the row width of \(L\) at height \(H\), and write \(X[t, x] = tW + x\) for the label/state variables and \(C[t, k, j, x]\) for the cell variable of row \(t\), stack \(k\), depth \(j\) and symbol code \(x\). Fix an input list \(s\), let \(c_n\) be the configuration after \(n\) steps of the idle-extended run of \(M\) from the initial configuration on \(s\), let \(T, t \in \mathbb{N}\) with \(t < T\), let \(i\) be the situation index of \(c_t\), and suppose every stack of \(c_t\) has length at most \(H - d\). Let the assignment \(a\) satisfy the cell-shift family of \(E\) (tables \(\mathrm{sa}\), \(\mathrm{pl}\), \(\mathrm{cn}\), \(\mathrm{pu}\) and \(N\) situations) for \(T\) and \(H\), and suppose \(X[t + 1, \mathrm{sa}(i)]\) is true under \(a\). Then for all \(k < K\) and \(j < \mathrm{pl}(i, k)\) the variable \(C[t + 1, k, j, x]\) is true under \(a\), where \(x\) is the code of the cell of \(c_{t+1}\) at stack \(k\) and depth \(j\) (code \(0\) if that cell is empty).
theorem pf_step_run {T H t : ℕ} {a : List Bool} (s : List (M.Γ M.k₀))
(ha : cnfSat (Shift.shFamily E.layout E.sa E.pl E.cn E.pu E.N T H) a) (ht : t < T)
(hh : ∀ k, ((runI M (initList M s) t).stk k).length ≤ H - depth M) (hdH : depth M ≤ H)
(hS : Tr a (E.layout.xIdx H (t + 1) (E.sa (E.sitIdx (runI M (initList M s) t)))))
{k j : ℕ} (hk : k < E.KK) (hj : j < E.pl (E.sitIdx (runI M (initList M s) t)) k) :
Tr a (E.layout.cIdx H (t + 1) k j (E.cell (runI M (initList M s) (t + 1)) k j))
def cnfSat (φ : CNF) (a : List Bool) : Prop :=
∀ c ∈ φ, clauseSat c a
CSLibExt/Computability/Complexity/DenseSAT.lean:67
def shFamily (N T H : ℕ) : CNF :=
(List.range T).flatMap fun t => (List.range N).flatMap fun i =>
(List.range L.KK).flatMap fun k => shBlk L sa pl cn pu T H t i k
CSLibExt/Computability/Complexity/CookLevin/Shift.lean:100
def runI (M : FinTM2) (c : M.Cfg) : ℕ → M.Cfg
| 0 => c
| t + 1 => stepI M (runI M c t)
CSLibExt/Computability/Complexity/CookLevin/Situation.lean:691
def depth (M : FinTM2) : ℕ :=
letI := M.ΛFin
Finset.univ.sup fun l => ops (M.m l)
CSLibExt/Computability/Complexity/CookLevin/Situation.lean:231
def Tr (a : List Bool) (v : ℕ) : Prop := a[v]? = some true
CSLibExt/Computability/Complexity/CookLevin/Situation.lean:1064
Uses 31 · Used by 1
TheoremOverflow cells of the next row on a real run#✓fully proved
Let \(E\) be an encoding of a machine \(M\) with \(K\) stacks and window depth \(d\), let \(s\) be an input, and let \(c_t\) be the configuration at step \(t\) of the idle-extended run of \(M\) from the initial configuration on input \(s\). Let \(a\) be an assignment satisfying the cell-shift clause family of \(E\)'s layout and tables \(\mathrm{sa}\), \(\mathrm{pl}\), \(\mathrm{cn}\), \(\mathrm{pu}\) for \(E\)'s number of situations and bounds \(T\) and \(H\), and write \(X[t, b]\) and \(C[t, k, j, x]\) for the label/state and cell variables at height \(H\). Suppose \(t < T\), every stack of \(c_t\) has length at most \(H - d\), \(d \le H\), and \(X[t + 1, \mathrm{sa}(i)]\) is true under \(a\), where \(i\) is the situation index of \(c_t\). Then for every \(k < K\) and every \(j\) with \(H - \max(\mathrm{pl}(i, k), \mathrm{cn}(i, k)) + \mathrm{pl}(i, k) \le j < H\), the variable \(C[t + 1, k, j, x]\) is true under \(a\), where \(x\) is the code of the cell of stack number \(k\) at depth \(j\) from the top in \(c_{t+1}\) (\(0\) if that cell is empty). Subtraction is truncated at zero.
theorem ov_step_run {T H t : ℕ} {a : List Bool} (s : List (M.Γ M.k₀))
(ha : cnfSat (Shift.shFamily E.layout E.sa E.pl E.cn E.pu E.N T H) a) (ht : t < T)
(hh : ∀ k, ((runI M (initList M s) t).stk k).length ≤ H - depth M) (hdH : depth M ≤ H)
(hS : Tr a (E.layout.xIdx H (t + 1) (E.sa (E.sitIdx (runI M (initList M s) t)))))
{k j : ℕ} (hk : k < E.KK)
(hj1 : H - max (E.pl (E.sitIdx (runI M (initList M s) t)) k)
(E.cn (E.sitIdx (runI M (initList M s) t)) k) +
E.pl (E.sitIdx (runI M (initList M s) t)) k ≤ j) (hj2 : j < H) :
Tr a (E.layout.cIdx H (t + 1) k j (E.cell (runI M (initList M s) (t + 1)) k j))
def cnfSat (φ : CNF) (a : List Bool) : Prop :=
∀ c ∈ φ, clauseSat c a
CSLibExt/Computability/Complexity/DenseSAT.lean:67
def shFamily (N T H : ℕ) : CNF :=
(List.range T).flatMap fun t => (List.range N).flatMap fun i =>
(List.range L.KK).flatMap fun k => shBlk L sa pl cn pu T H t i k
CSLibExt/Computability/Complexity/CookLevin/Shift.lean:100
def runI (M : FinTM2) (c : M.Cfg) : ℕ → M.Cfg
| 0 => c
| t + 1 => stepI M (runI M c t)
CSLibExt/Computability/Complexity/CookLevin/Situation.lean:691
def depth (M : FinTM2) : ℕ :=
letI := M.ΛFin
Finset.univ.sup fun l => ops (M.m l)
CSLibExt/Computability/Complexity/CookLevin/Situation.lean:231
def Tr (a : List Bool) (v : ℕ) : Prop := a[v]? = some true
CSLibExt/Computability/Complexity/CookLevin/Situation.lean:1064
Uses 25 · Used by 1
DefinitionStack cap#✓fully proved
For natural numbers \(m\), \(T\) and \(d\) (an input bound, a run length and a per-step growth), the stack cap is \(H = m + (T + 1) d + 1\).
It is used with \(d\) the window depth of the machine.
def capH (m T d : ℕ) : ℕ := m + (T + 1) * d + 1
Used by 23
TheoremStack heights along a run#✓fully proved
Let \(M\) be a finite TM2 machine with window depth \(d\), let \(c\) be a configuration and \(k\) a stack. For every \(t \in \mathbb{N}\), stack \(k\) of the configuration reached from \(c\) after \(t\) steps of the idle-extended run has length at most the length of stack \(k\) of \(c\) plus \(t \cdot d\).
theorem runI_height {M : FinTM2} (c : M.Cfg) (k : M.K) :
∀ t, ((runI M c t).stk k).length ≤ (c.stk k).length + t * depth M
def runI (M : FinTM2) (c : M.Cfg) : ℕ → M.Cfg
| 0 => c
| t + 1 => stepI M (runI M c t)
CSLibExt/Computability/Complexity/CookLevin/Situation.lean:691
def depth (M : FinTM2) : ℕ :=
letI := M.ΛFin
Finset.univ.sup fun l => ops (M.m l)
CSLibExt/Computability/Complexity/CookLevin/Situation.lean:231
Uses 4 · Used by 2
TheoremStack heights are at most the cap minus the window depth#✓fully proved
Let \(M\) be a finite multi-stack Turing machine with window depth \(d\), let \(m\), \(T\) and \(t\) be natural numbers with \(t \le T\), and let \(s\) be an input of length at most \(m\). In the idle-extended run of \(M\) from the initial configuration on input \(s\), every stack of the configuration at step \(t\) has length at most \(H - d\), where \(H = m + (T + 1) d + 1\) is the stack cap for input bound \(m\), run length \(T\) and per-step growth \(d\).
theorem capH_height {M : FinTM2} {m T t : ℕ} (s : List (M.Γ M.k₀)) (hs : s.length ≤ m)
(ht : t ≤ T) (k : M.K) :
((runI M (initList M s) t).stk k).length ≤ capH m T (depth M) - depth M
def runI (M : FinTM2) (c : M.Cfg) : ℕ → M.Cfg
| 0 => c
| t + 1 => stepI M (runI M c t)
CSLibExt/Computability/Complexity/CookLevin/Situation.lean:691
def capH (m T d : ℕ) : ℕ := m + (T + 1) * d + 1
CSLibExt/Computability/Complexity/CookLevin/Situation.lean:1420
def depth (M : FinTM2) : ℕ :=
letI := M.ΛFin
Finset.univ.sup fun l => ops (M.m l)
CSLibExt/Computability/Complexity/CookLevin/Situation.lean:231
Uses 4 · Used by 3
TheoremStack-cap constraint 1#✓fully proved
For natural numbers \(\ell\), \(m\), \(T\) and \(d\) with \(\ell \le m\), we have \(\ell + (T + 1) d \le H\), where \(H = m + (T + 1) d + 1\) is the stack cap for input bound \(m\), run length \(T\) and per-step growth \(d\).
theorem capH_c1 {l m T d : ℕ} (hl : l ≤ m) : l + (T + 1) * d ≤ capH m T d
def capH (m T d : ℕ) : ℕ := m + (T + 1) * d + 1
CSLibExt/Computability/Complexity/CookLevin/Situation.lean:1420
Uses 1
TheoremStack-cap constraint 2#✓fully proved
For natural numbers \(m\), \(T\) and \(d\) with \(T \ge 1\), the stack cap \(H = m + (T + 1) d + 1\) for input bound \(m\), run length \(T\) and per-step growth \(d\) satisfies \(2d \le H\).
theorem capH_c2 {m T d : ℕ} (hT : 1 ≤ T) : 2 * d ≤ capH m T d
def capH (m T d : ℕ) : ℕ := m + (T + 1) * d + 1
CSLibExt/Computability/Complexity/CookLevin/Situation.lean:1420
Uses 1
TheoremThe three depth regions cover every depth exactly once#✓fully proved
Let \(p, q, H, j\) be natural numbers with \(j < H\), and let \(m = H - \max(p, q) + p\), where the subtraction is truncated at \(0\). Then \(j\) lies in exactly one of the ranges \(j < p\) (pushed fill), \(p \le j < m\) (in-range shift) and \(m \le j < H\) (overflow).
These are the depth hypotheses of the pushed-fill, in-range shift and overflow lemmas; nothing is assumed about \(p\), \(q\) and \(H\).
theorem region_cover (p q H j : ℕ) (hj : j < H) :
(j < p ∨ (p ≤ j ∧ j < H - max p q + p) ∨ (H - max p q + p ≤ j ∧ j < H)) ∧
¬ (j < p ∧ p ≤ j) ∧ ¬ (j < p ∧ H - max p q + p ≤ j) ∧
¬ (j < H - max p q + p ∧ H - max p q + p ≤ j)
Used by 1
Loading dependency explorer…
The dependency explorer needs JavaScript and its graph data.