Polynomial-time construction of zig-zag tower tables #
The input size is unary: construction is polynomial in the number of vertices, rather than in its bit length. The invariant charges every entry of every intermediate table, including its unary neighbor, finite return label and framing. Fixed base rotations use finite case analysis.
Main results #
Cslib.RotationMap.TowerTable.polytime_next,Cslib.RotationMap.TowerTable.polytime_nextRow: constructing next level and rows in polytime.Cslib.RotationMap.TowerTable.polytime_build: a uniform certificate for the complete table.Cslib.RotationMap.TowerTable.polytime_lookup: read both components of a stored rotation.Cslib.RotationMap.TowerTable.length_encoding_le: bound all rows and encoded entries.
References #
theorem Cslib.RotationMap.TowerTable.polytime_lookup {D : Type} [Fintype D] (label : D ↪ List Bool) :
Turing.MultiTapeTM.ComputableInPolyTime (fun (p : TowerTable D × ℕ × D × D) => p.1.lookup p.2.1 p.2.2)
(Turing.MultiTapeTM.encPair (encoding label)
(Turing.MultiTapeTM.encPair Turing.MultiTapeTM.encUnary (Turing.MultiTapeTM.encPair label label)))
(Turing.MultiTapeTM.encPair Turing.MultiTapeTM.encUnary (Turing.MultiTapeTM.encPair label label))
A table lookup charges its complete stored prefix and its returned entry.
theorem Cslib.RotationMap.TowerTable.polytime_nextRow {D : Type} {b : ℕ} [Fintype D] (H : RotationMap (Fin b) D) (e : Fin b ≃ (Fin 2 → D × D)) (hb : 0 < b) (label : D ↪ List Bool) :
Turing.MultiTapeTM.ComputableInPolyTime (fun (p : TowerTable D × ℕ) => nextRow H e hb p.1 p.2)
(Turing.MultiTapeTM.encPair (encoding label) Turing.MultiTapeTM.encUnary)
(Turing.MultiTapeTM.encPi
(Turing.MultiTapeTM.encPair Turing.MultiTapeTM.encUnary (Turing.MultiTapeTM.encPair label label)))
Each new row uses two stored rotations and fixed finite base operations.
theorem Cslib.RotationMap.TowerTable.length_encoding_le {D : Type} [Fintype D] (label : D ↪ List Bool) {table : TowerTable D} (h : table.Valid) {size : ℕ} (hsize : List.length table ≤ size) :
Every stored word, finite table, and row delimiter contributes to the size bound.
theorem Cslib.RotationMap.TowerTable.polytime_build {D : Type} {b : ℕ} [Fintype D] (H : RotationMap (Fin b) D) (e : Fin b ≃ (Fin 2 → D × D)) (hb : 1 < b) (label : D ↪ List Bool) :
Building the selected tower table is polynomial in the unary requested vertex count. The invariant bounds complete intermediate tables, not only their numbers of rows.