Correctness of row-major stack lookup
ProvedTensorAdjacencyLookup8.lookupProg_execcomplexity-theorycomputation
Let be a natural number and let . Given a length- list representing a matrix in row-major order, the fixed eight-stack program prepends the entry at offset to an arbitrary output tail. It preserves the matrix and unary dimension and index stacks, clears all scratch stacks, and terminates within structured-program steps.
Preamble
import Definitions.Def_TensorAdjacencyLookup8 open CookPvsNP ProjSchedTW.Complexity
Formal statement
theorem TensorAdjacencyLookup8.lookupProg_exec (v i j : ℕ) (data tail : List BSym)
(hi : i < v) (hj : j < v) (hlen : data.length = v*v) :
∃ steps, steps ≤ 50*(v+1)^2 ∧
TensorAdjacencyLookup8.lookupProg.Exec
(TensorAdjacencyLookup8.store data (List.replicate v .one)
(List.replicate i .one) (List.replicate j .one) tail [] [] [])
(TensorAdjacencyLookup8.store data (List.replicate v .one)
(List.replicate i .one) (List.replicate j .one)
(data.getD (i*v+j) .zero :: tail) [] [] []) steps := by
sorry