Documentation

CslibFrontier.Computability.Complexity.Problems.STCON.Header

Reading the header of an encoded connectivity instance #

Logarithmic-space reductions from directed s–t connectivity read the unary header 1^n 0 1^s 0 1^t 0 of the encoding Cslib.Complexity.encSTCON into three registers before they read the adjacency matrix by address. Cslib.Complexity.STCONInstance.headerCode is that code, for counter programs with output, and Cslib.Complexity.STCONInstance.reachesOut_headerCode says that it stores n, s and t in the registers 0, 1 and 2, emitting nothing.

Main definitions #

Main results #

The code reading the header, placed at the label b: it counts the three unary blocks into the registers 0, 1 and 2, which start at 0, and continues at b + 6.

theorem Cslib.Complexity.STCONInstance.regs_le (I : STCONInstance) {B r c : ℕ} (hn : I.n ≤ B) (hr : r ≤ B) (hc : c ≤ B) (x : ℕ) :
x ∈ [I.n, ↑I.s, ↑I.t, r, c] → x ≤ B

The registers [n, s, t, r, c] of a writer are bounded by B once n, the row r and the column c are, since the terminals are below n.

theorem Cslib.Complexity.STCONInstance.reachesOut_headerCode (I : STCONInstance) {P : Turing.CounterProgram} {B b : ℕ} (hP : P.CodeAt b (headerCode b)) {rest : List ℕ} (hB : I.n ≤ B) (hrest : ∀ r ∈ rest, r ≤ B) :
P.ReachesOut I.encode (P.Active B) (b, 0 :: 0 :: 0 :: rest) (b + 6, I.n :: ↑I.s :: ↑I.t :: rest) []

The header is read: from the registers 0, 0, 0 followed by rest, the code stores n, s and t in the registers 0, 1 and 2, emitting nothing, while every register stays at most B.