The configuration graph of a log-space machine is polynomially sized #
⚠️ Unreviewed by Bolton
A machine using O(log n) space has only polynomially many configurations: each of the
4 ^ O(log n) tape contents is n ^ O(1), and the head positions contribute a further
polynomial factor. This is what turns the graph reachability of
Complexitylib.Classes.Containments.Internal.ConfigGraph into a polynomial-time search.
Main results #
exists_log_bound— anO(log n)bound holds everywhere after adding a constantfour_pow_log_le—4 ^ (C · log₂ n + D)is polynomially boundedexists_config_bound— the configuration count isA · (n + 1) ^ B
theorem
Complexity.PolyBounded.mono
{g h : ℕ → ℕ}
(hg : PolyBounded g)
(hle : ∀ (n : ℕ), h n ≤ g n)
:
Transfer along a pointwise bound.
theorem
Complexity.PolyBounded.mul
{g h : ℕ → ℕ}
(hg : PolyBounded g)
(hh : PolyBounded h)
:
PolyBounded fun (n : ℕ) => g n * h n
theorem
Complexity.PolyBounded.add
{g h : ℕ → ℕ}
(hg : PolyBounded g)
(hh : PolyBounded h)
:
PolyBounded fun (n : ℕ) => g n + h n
theorem
Complexity.PolyBounded.pow
{g : ℕ → ℕ}
(hg : PolyBounded g)
(m : ℕ)
:
PolyBounded fun (n : ℕ) => g n ^ m
theorem
Complexity.exists_config_bound
{k : ℕ}
(Q : Type)
[Fintype Q]
{f : ℕ → ℕ}
(hf : BigO f fun (n : ℕ) => Nat.log 2 n)
:
PolyBounded fun (n : ℕ) => Fintype.card (Code Q k n (f n))
The configuration count of a log-space machine is polynomial.