Documentation

CslibFrontier.Computability.Complexity.Classes.Time.WordRAM

Deterministic time on the word RAM #

Cslib.WordRAM.RAMTIME B enc T is the class of problems decided by one fixed word-RAM program over the basis B within c * T n + c instructions, for a constant c, on instances whose encoding under enc has length n, at every word size of at least the logarithmic threshold logWidth k n, for a constant k > 0. The conventions are those of Cslib.WordRAM.UniformPolynomialTime in CslibFrontier.Computability.Complexity.Classes.P.WordRAM: the input words are the bits (enc a).map Bool.toNat, and the size is |enc a|. The program may read the word size; the time bound does not depend on it.

The two simulations between the word RAM and multi-tape Turing machines relate RAMTIME to Cslib.Complexity.DTIME:

Main definitions #

Main results #

References #

def Cslib.WordRAM.RAMTIME {α : Type} (B : Basis) (enc : α ↪ List Bool) (T : ℕ → ℕ) :
Set (Set α)

Deterministic time on the word RAM. The problems decided by one fixed program over the basis B within c * T n + c instructions, for a constant c, on the bits of an instance whose encoding under enc has length n, at every word size of at least logWidth k n, for a constant k > 0.

theorem Cslib.WordRAM.RAMTIME_mono {α : Type} {enc : α ↪ List Bool} {B : Basis} {T₁ T₂ : ℕ → ℕ} (h : ∀ (n : ℕ), T₁ n ≤ T₂ n) :
RAMTIME B enc T₁ ⊆ RAMTIME B enc T₂

RAMTIME is monotone in the time bound.

theorem Cslib.WordRAM.RAMTIME_subset_of_hom {α : Type} {enc : α ↪ List Bool} {B B' : Basis} (φ : B.Hom B') {T : ℕ → ℕ} :
RAMTIME B enc T ⊆ RAMTIME B' enc T

RAMTIME grows with the basis.

Word-RAM time in deterministic time #

theorem Cslib.WordRAM.RAMTIME_additive_subset_DTIME {α : Type} {enc : α ↪ List Bool} {T : ℕ → ℕ} (hT : Complexity.TimeConstructible T) :
RAMTIME Basis.additive enc T ⊆ Complexity.DTIME enc fun (n : ℕ) => (n + T n + 1) ^ 4 * (n.size + 1) ^ 3

Word-RAM time in deterministic time. For a time-constructible T, a problem decided by a fixed program over Basis.additive in time O(T n) at logarithmic word sizes is in DTIME ((n + T n + 1) ^ 4 * (Nat.size n + 1) ^ 3). For n ≤ T n this is O(T(n) ^ 4 log³ n).

Deterministic time in word-RAM time #

Deterministic time in word-RAM time. For a polynomially bounded g, a problem in DTIME g is decided by one fixed program over Basis.additive within O(g n) instructions at every word size above a logarithmic threshold: the simulator of a machine deciding it (Cslib.WordRAM.OfTuring.simProgram), run on the bits of the instance.