Documentation

CslibFrontier.Computability.Complexity.Classes.LogSpace.Counting

Counting and unambiguous logarithmic space #

SharpL counts first-halting accepting occurrence traces of one finite native counting machine. The work-tape space bound applies to every computation prefix. On each encoded input an all-branches clock guarantees that the count includes every accepting occurrence. Identical transitions at one configuration can still contribute distinct occurrences.

UL consists of the languages whose membership bit is represented by such an accepting count. Forgetting transition multiplicities retains acceptance and the same space bound, giving the inclusion in NL.

Main definitions #

Main results #

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

A given counting machine realizes the accepting count in logarithmic workspace: Turing.MultiTapeCTM.CountsInSpace at a bound c * (Nat.log2 n + 1) in the encoded length n.

def Cslib.Complexity.SharpL {α : Type} (enc : α ↪ List Bool) :
Set (α → ℕ)

The accepting branch counts of finite logspace counting machines.

def Cslib.Complexity.UL {α : Type} (enc : α ↪ List Bool) :
Set (Set α)

Unambiguous logarithmic space. There is one accepting branch on members and none on nonmembers.

theorem Cslib.Complexity.UL_subset_NL {α : Type} {enc : α ↪ List Bool} :
UL enc ⊆ NL enc

An unambiguous logspace witness yields an NL witness by forgetting transition multiplicity. Its accepting count is positive exactly when the resulting machine accepts.

theorem Cslib.Complexity.UL_eq_USPACE {α : Type} {enc : α ↪ List Bool} :

UL is USPACE(log₂ n): the bounds c * (log₂ n + 1) and c₁ * log₂ n + c₂ give the same problems.