Documentation

CslibFrontier.Computability.Complexity.Classes.Constructible.Space

Closure of space-constructible bounds #

Space-constructible bounds (Cslib.Complexity.SpaceConstructible) are closed under sums and constant multiples, adding the two values in binary. A bound computed in logarithmic space is space-constructible when it is at least ⌊log₂ n⌋; so ⌊log₂ n⌋ and its powers are space-constructible, the bounds of the space hierarchy at the logarithmic threshold.

Main results #

References #

theorem Cslib.Complexity.SpaceConstructible.add {s₁ s₂ : ℕ → ℕ} (h₁ : SpaceConstructible s₁) (h₂ : SpaceConstructible s₂) :
SpaceConstructible fun (n : ℕ) => s₁ n + s₂ n

Sums of space-constructible bounds are space-constructible: compute both values in binary and add them.

Constant multiples of space-constructible bounds are space-constructible.

A bound computed in logarithmic space is space-constructible when it is at least ⌊log₂ n⌋: the logarithmic work space is then within O(s n).

⌊log₂ n⌋ ^ (k + 1) is space-constructible: compute ⌊log₂ n⌋ in unary from the length, multiply in unary and convert to binary, in logarithmic space.

⌊log₂ n⌋ is space-constructible.