Documentation

CslibFrontier.Computability.Complexity.Classes.LogCFL

Auxiliary pushdown complexity classes: LogCFL, UAuxPDA, and coUAuxPDA #

This module defines the time- and space-bounded auxiliary pushdown complexity classes Cslib.Complexity.AuxPDATimeSpace and Cslib.Complexity.UAuxPDATimeSpace, together with their logarithmic-space, polynomial-time specializations:

This is original library development for cslib-frontier #7920 (Work Package 3); the equivalence between Sudborough's AuxPDA(log n, poly) characterization and logspace reducibility to context-free languages, as well as the uniform equality LogCFL = UAuxPDA = coUAuxPDA, remain tracked in #7920.

Main definitions #

Main results #

References #

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

Problems decided by one finite-state, finite-stack-alphabet binary AuxPDA within work space O(s n) (stack uncharged) and all-branches clock O(t n) on encoded instances of length n.

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

Problems decided unambiguously by one finite-state, finite-stack-alphabet binary CountingAuxPDA within work space O(s n) (stack uncharged) and all-branches clock O(t n): exactly one accepting branch on members and zero on nonmembers.

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

LogCFL via AuxPDA(O(log n), poly) (Sudborough's characterization): problems decided by one finite-state, finite-stack-alphabet binary AuxPDA within logarithmic work space c * (Nat.log2 n + 1) (stack uncharged) and a polynomial all-branches clock.

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

Unambiguous AuxPDA(O(log n), poly): problems decided by one finite-state, finite-stack-alphabet binary CountingAuxPDA within logarithmic work space c * (Nat.log2 n + 1) and a polynomial all-branches clock, having one accepting branch on members and zero on nonmembers.

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

Complements of problems in UAuxPDA enc, under the same encoding.

Monotone resource closure #

theorem Cslib.Complexity.AuxPDATimeSpace_mono_of_le_mul_add {α : Type} {enc : α ↪ List Bool} {s₁ s₂ t₁ t₂ : ℕ → ℕ} {Cs Ct : ℕ} (hs : ∀ (n : ℕ), s₁ n ≤ Cs * s₂ n + Cs) (ht : ∀ (n : ℕ), t₁ n ≤ Ct * t₂ n + Ct) :
AuxPDATimeSpace enc s₁ t₁ ⊆ AuxPDATimeSpace enc s₂ t₂

AuxPDATimeSpace absorbs affine factors in both space and time bounds.

theorem Cslib.Complexity.AuxPDATimeSpace_mono {α : Type} {enc : α ↪ List Bool} {s₁ s₂ t₁ t₂ : ℕ → ℕ} (hs : ∀ (n : ℕ), s₁ n ≤ s₂ n) (ht : ∀ (n : ℕ), t₁ n ≤ t₂ n) :
AuxPDATimeSpace enc s₁ t₁ ⊆ AuxPDATimeSpace enc s₂ t₂

AuxPDATimeSpace is monotone in both space and time bounds.

theorem Cslib.Complexity.UAuxPDATimeSpace_mono_of_le_mul_add {α : Type} {enc : α ↪ List Bool} {s₁ s₂ t₁ t₂ : ℕ → ℕ} {Cs Ct : ℕ} (hs : ∀ (n : ℕ), s₁ n ≤ Cs * s₂ n + Cs) (ht : ∀ (n : ℕ), t₁ n ≤ Ct * t₂ n + Ct) :
UAuxPDATimeSpace enc s₁ t₁ ⊆ UAuxPDATimeSpace enc s₂ t₂

UAuxPDATimeSpace absorbs affine factors in both space and time bounds.

theorem Cslib.Complexity.UAuxPDATimeSpace_mono {α : Type} {enc : α ↪ List Bool} {s₁ s₂ t₁ t₂ : ℕ → ℕ} (hs : ∀ (n : ℕ), s₁ n ≤ s₂ n) (ht : ∀ (n : ℕ), t₁ n ≤ t₂ n) :
UAuxPDATimeSpace enc s₁ t₁ ⊆ UAuxPDATimeSpace enc s₂ t₂

UAuxPDATimeSpace is monotone in both space and time bounds.

Unambiguous-to-nondeterministic inclusions and union characterizations #

Forgetting transition multiplicity places UAuxPDATimeSpace inside AuxPDATimeSpace.

theorem Cslib.Complexity.UAuxPDA_subset_LogCFL {α : Type} {enc : α ↪ List Bool} :
UAuxPDA enc ⊆ LogCFL enc

UAuxPDA ⊆ LogCFL: forgetting branch multiplicity turns an unambiguous logarithmic-space, polynomial-time counting AuxPDA into a nondeterministic one with the same bounds.

theorem Cslib.Complexity.mem_LogCFL_iff_exists_mem_AuxPDATimeSpace {α : Type} {enc : α ↪ List Bool} {A : Set α} :
A ∈ LogCFL enc ↔ ∃ (d : ℕ), A ∈ AuxPDATimeSpace enc Nat.log2 fun (x : ℕ) => x ^ d

LogCFL is the union of AuxPDATimeSpace enc Nat.log2 (· ^ d) over all polynomial degrees d.

theorem Cslib.Complexity.mem_UAuxPDA_iff_exists_mem_UAuxPDATimeSpace {α : Type} {enc : α ↪ List Bool} {A : Set α} :
A ∈ UAuxPDA enc ↔ ∃ (d : ℕ), A ∈ UAuxPDATimeSpace enc Nat.log2 fun (x : ℕ) => x ^ d

UAuxPDA is the union of UAuxPDATimeSpace enc Nat.log2 (· ^ d) over all polynomial degrees d.

Complement duality for coUAuxPDA #

theorem Cslib.Complexity.mem_coUAuxPDA {α : Type} {enc : α ↪ List Bool} {A : Set α} :

A problem belongs to coUAuxPDA iff its complement belongs to UAuxPDA.

theorem Cslib.Complexity.compl_mem_coUAuxPDA_iff {α : Type} {enc : α ↪ List Bool} {A : Set α} :

Complementing a problem in UAuxPDA gives a problem in coUAuxPDA, and conversely.

theorem Cslib.Complexity.coUAuxPDA_eq_UAuxPDA_iff {α : Type} {enc : α ↪ List Bool} :
coUAuxPDA enc = UAuxPDA enc ↔ ∀ A ∈ UAuxPDA enc, Aᶜ ∈ UAuxPDA enc

coUAuxPDA equals UAuxPDA iff UAuxPDA is closed under complement.

Embeddings of NL and UL #

theorem Cslib.Complexity.NL_subset_LogCFL {α : Type} {enc : α ↪ List Bool} :
NL enc ⊆ LogCFL enc

NL ⊆ LogCFL: every nondeterministic logarithmic-space decider embeds into an AuxPDA with an unused stack, inheriting a uniform polynomial all-branches clock from Turing.MultiTapeNTM.exists_runsInTime_polynomial_of_runsInSpace_log.

theorem Cslib.Complexity.UL_subset_UAuxPDA {α : Type} {enc : α ↪ List Bool} :
UL enc ⊆ UAuxPDA enc

UL ⊆ UAuxPDA: every unambiguous logarithmic-space counting machine embeds into a CountingAuxPDA with an unused stack, preserving exact accepting branch counts at the uniform polynomial clock.