Documentation

CslibFrontier.Computability.Machines.Turing.MultiTape.Counting.Space

Accepting counts of counting machines within a space bound #

Turing.MultiTapeCTM.CountsInSpace M enc f s says that the counting machine M realizes the accepting count f within work space s. On every encoded instance each computation prefix visits at most s a work-tape cells, some clock bounds every branch, and f a is the number of accepting transition-occurrence traces at that clock. The space bound is an arbitrary function of the instance; input and output are uncharged, as in Turing.MultiTapeNTM.RunsInSpace.

Forgetting transition multiplicity turns such a witness into a nondeterministic decider, within the same space, for the instances whose count is positive.

Main definitions #

Main results #

def Turing.MultiTapeCTM.CountsInSpace {α : Type} {k : ℕ} {State : Type} (M : MultiTapeCTM k Bool State) (enc : α ↪ List Bool) (f s : α → ℕ) :

The counting machine M realizes the accepting count f within work space s: on each encoded instance every computation prefix visits at most s a work-tape cells, and at a clock bounding every branch the number of accepting occurrence traces is f a. The clock is chosen for each instance, because the count is stable once every branch has halted.

theorem Turing.MultiTapeCTM.CountsInSpace.mono {α : Type} {k : ℕ} {State : Type} {M : MultiTapeCTM k Bool State} {enc : α ↪ List Bool} {f s s' : α → ℕ} (h : M.CountsInSpace enc f s) (hs : ∀ (a : α), s a ≤ s' a) :
M.CountsInSpace enc f s'

Space bounds can be increased.

theorem Turing.MultiTapeCTM.CountsInSpace.decidesInSpace {α : Type} {k : ℕ} {State : Type} {M : MultiTapeCTM k Bool State} {enc : α ↪ List Bool} {f s : α → ℕ} {A : Set α} (h : M.CountsInSpace enc f s) (hA : ∀ (a : α), a ∈ A ↔ 0 < f a) :

Forgetting multiplicity gives a nondeterministic decider. If M realizes the count f within space s, then the machine without transition multiplicities decides, within space s and with every branch halting, the instances whose count is positive.