Documentation

CslibFrontier.Computability.WordRAM.Realization.Function

Functions computed by realized memory clients #

Realizes.uniformComputableInPolyTime turns one realization certificate into UniformComputableInPolyTime. The flat program is the certificate's emitted body, preceded by the charged argument-installation prefix inputPrefix and followed by a halt on one result coordinate; it is chosen before every width and input. The client supplies the input layout, an entry width, and a fitting admitted width for every instance. At every admitted width that the input fits, it shows that the input has at least k words and that its length plus one (the frontier) fits a word, and supplies the program's domain, its admissible history, its answer and a polynomial bound on its memory charge plus local work. A basis simulation carries the exact-basis code to the target basis.

Main results #

theorem Cslib.WordRAM.Realization.Realizes.uniformComputableInPolyTime {δ α : Type} {k l : ℕ} {p : δ → DataStructure.Memory.Prog α} {input : δ ↪ Fin k → ℕ} {output : α ↪ Fin l → ℕ} {safe : ℕ → δ → DataStructure.Memory.State → Prop} {work : δ → DataStructure.Memory.State → ℕ} {B : Basis} (φ : Basis.exact.Simulates B) (h : Realizes Basis.exact p input output safe work) (i : Fin l) {f : δ → ℕ} {encode : ℕ → δ → List ℕ} {size : δ → ℕ} {T : ℕ → ℕ} (hT : PolynomiallyBounded T) (c : ℕ) (hc : 0 < c) (hadmit : InputAdmissible encode fun (d : δ) (w : ℕ) => logWidth c (size d) ≤ w) (hlayout : ∀ (w : ℕ) (d : δ) (j : Fin k), (encode w d).getD (↑j) 0 = input d j) (hspec : ∀ (d : δ) (w : ℕ), logWidth c (size d) ≤ w → InputFits w (encode w d) → k ≤ (encode w d).length ∧ Fits w ((encode w d).length + 1) ∧ safe w d (DataStructure.Memory.State.init (encode w d)) ∧ (DataStructure.Memory.spec w).ValidHistory (DataStructure.Memory.State.init (encode w d)) ((DataStructure.Memory.spec w).clientHistory (DataStructure.Memory.State.init (encode w d)) (p d)) ∧ output ((DataStructure.Memory.spec w).clientResult (DataStructure.Memory.State.init (encode w d)) (p d)) i = f d ∧ memoryCost (p d) (DataStructure.Memory.State.init (encode w d)) + work d (DataStructure.Memory.State.init (encode w d)) ≤ T (size d)) :

Uniform polynomial time from a realization. If the first k input words encode the argument, every instance admits a fitting width, and at every width admitted by logWidth c that the input fits, the input has at least k words, its length plus one (the frontier) fits a word, the program's domain and admissible history hold, result coordinate i is the function's value, and the memory charge plus local work is at most T (size d) for a polynomially bounded T, then one flat program computes the function in polynomial time. Argument installation and the halt are charged.