Documentation

CslibFrontier.Computability.Complexity.Reduction.LogSpaceTruthTable

Logspace truth-table reductions and restricted variants #

A logspace truth-table reduction (LogSpaceTruthTableReducible, $A \le_{tt}^L B$) is a nonadaptive oracle reduction in logarithmic space: on input a : α, a logspace count map r : α → ℕ (with unary output encUnary) and a logspace indexed query generator q : α × ℕ → β determine the queries q (a, 0), …, q (a, r a - 1) before any oracle answer is seen, and a logspace evaluator d : α × List Bool → Bool combines a and the answer bit vector truthTableAnswers (q ⁻¹' B) r a into the decision for a (adapting the polynomial-time scheme of Ladner, Lynch and Selman to logarithmic space).

Design choice. The literature uses two inequivalent conventions for logspace truth-table evaluation: requiring the evaluator d to be computable in logarithmic space (L), or restricting truth tables to Boolean formulas / NC¹ evaluators. This module adopts the L-evaluator convention so that both query generation and truth-table evaluation lie in L, ensuring that bounded-query truth-table reductions preserve membership in L and compose in L. No equivalence with the formula/NC¹ convention is claimed.

This module also defines the standard restricted logspace truth-table notions mirroring TruthTableVariants. As there, each definition is by definition an instance of a resource-free kernel of CslibFrontier.Computability.Reduction.TruthTable, whose lemmas prove the inclusions, embeddings, complementation and duality below:

Main definitions #

Main results #

References #

Definitions #

def Cslib.Complexity.LogSpaceTruthTableReducible {α β : Type} (encA : α ↪ List Bool) (encB : β ↪ List Bool) (A : Set α) (B : Set β) :

A truth-table reduces to B in logarithmic space: a logspace query count r (with unary output encUnary), a logspace indexed query generator q producing q (a, i) for i < r a, and a logspace evaluator d decide a ∈ A from a and the answer word truthTableAnswers (q ⁻¹' B) r a.

def Cslib.Complexity.LogSpaceKTruthTableReducible {α β : Type} (k : ℕ) (encA : α ↪ List Bool) (encB : β ↪ List Bool) (A : Set α) (B : Set β) :

A k-truth-table reduces to B in logarithmic space: a logspace truth-table reduction asking at most k queries on every input.

def Cslib.Complexity.LogSpaceBTTReducible {α β : Type} (encA : α ↪ List Bool) (encB : β ↪ List Bool) (A : Set α) (B : Set β) :

A bounded-truth-table reduces to B in logarithmic space: it k-truth-table reduces to B in logarithmic space for some constant k.

def Cslib.Complexity.LogSpaceDTTReducible {α β : Type} (encA : α ↪ List Bool) (encB : β ↪ List Bool) (A : Set α) (B : Set β) :

A disjunctive-truth-table reduces to B in logarithmic space: a logspace query generator q (a, i) for i < r a such that a ∈ A iff at least one query is in B.

def Cslib.Complexity.LogSpaceCTTReducible {α β : Type} (encA : α ↪ List Bool) (encB : β ↪ List Bool) (A : Set α) (B : Set β) :

A conjunctive-truth-table reduces to B in logarithmic space: a logspace query generator q (a, i) for i < r a such that a ∈ A iff every query is in B.

def Cslib.Complexity.LogSpacePTTReducible {α β : Type} (encA : α ↪ List Bool) (encB : β ↪ List Bool) (A : Set α) (B : Set β) :

A positive-truth-table reduces to B in logarithmic space: a logspace truth-table reduction whose evaluator is monotone in the answer word with respect to List.Forall₂ (· ≤ ·).

Inclusions within logarithmic space #

theorem Cslib.Complexity.LogSpaceReducible.logSpaceKTruthTableReducible_one {α β : Type} {encA : α ↪ List Bool} {encB : β ↪ List Bool} {A : Set α} {B : Set β} (h : LogSpaceReducible encA encB A B) :

A logspace many-one reduction is a 1-truth-table reduction: one query f a, with the first answer bit returned directly.

theorem Cslib.Complexity.LogSpaceKTruthTableReducible.mono {α β : Type} {encA : α ↪ List Bool} {encB : β ↪ List Bool} {A : Set α} {B : Set β} {k k' : ℕ} (h : LogSpaceKTruthTableReducible k encA encB A B) (hk : k ≤ k') :

k-truth-table reducibility in logarithmic space is monotone in the query bound k.

theorem Cslib.Complexity.LogSpaceKTruthTableReducible.logSpaceBTTReducible {α β : Type} {encA : α ↪ List Bool} {encB : β ↪ List Bool} {A : Set α} {B : Set β} {k : ℕ} (h : LogSpaceKTruthTableReducible k encA encB A B) :
LogSpaceBTTReducible encA encB A B

A k-truth-table reduction in logarithmic space is a bounded-truth-table reduction.

theorem Cslib.Complexity.LogSpaceBTTReducible.logSpaceTruthTableReducible {α β : Type} {encA : α ↪ List Bool} {encB : β ↪ List Bool} {A : Set α} {B : Set β} (h : LogSpaceBTTReducible encA encB A B) :

A bounded-truth-table reduction in logarithmic space is a truth-table reduction.

theorem Cslib.Complexity.LogSpaceReducible.logSpaceBTTReducible {α β : Type} {encA : α ↪ List Bool} {encB : β ↪ List Bool} {A : Set α} {B : Set β} (h : LogSpaceReducible encA encB A B) :
LogSpaceBTTReducible encA encB A B

A logspace many-one reduction is a logspace bounded-truth-table reduction.

theorem Cslib.Complexity.LogSpaceReducible.logSpaceTruthTableReducible {α β : Type} {encA : α ↪ List Bool} {encB : β ↪ List Bool} {A : Set α} {B : Set β} (h : LogSpaceReducible encA encB A B) :

A logspace many-one reduction is a logspace truth-table reduction.

theorem Cslib.Complexity.LogSpaceReducible.logSpaceDTTReducible {α β : Type} {encA : α ↪ List Bool} {encB : β ↪ List Bool} {A : Set α} {B : Set β} (h : LogSpaceReducible encA encB A B) :
LogSpaceDTTReducible encA encB A B

A logspace many-one reduction is a logspace disjunctive truth-table reduction.

theorem Cslib.Complexity.LogSpaceReducible.logSpaceCTTReducible {α β : Type} {encA : α ↪ List Bool} {encB : β ↪ List Bool} {A : Set α} {B : Set β} (h : LogSpaceReducible encA encB A B) :
LogSpaceCTTReducible encA encB A B

A logspace many-one reduction is a logspace conjunctive truth-table reduction.

theorem Cslib.Complexity.LogSpaceDTTReducible.logSpacePTTReducible {α β : Type} {encA : α ↪ List Bool} {encB : β ↪ List Bool} {A : Set α} {B : Set β} (h : LogSpaceDTTReducible encA encB A B) :
LogSpacePTTReducible encA encB A B

A logspace disjunctive truth-table reduction is a logspace positive truth-table reduction, evaluated by List.any id.

theorem Cslib.Complexity.LogSpaceCTTReducible.logSpacePTTReducible {α β : Type} {encA : α ↪ List Bool} {encB : β ↪ List Bool} {A : Set α} {B : Set β} (h : LogSpaceCTTReducible encA encB A B) :
LogSpacePTTReducible encA encB A B

A logspace conjunctive truth-table reduction is a logspace positive truth-table reduction, evaluated by List.all id.

theorem Cslib.Complexity.LogSpacePTTReducible.logSpaceTruthTableReducible {α β : Type} {encA : α ↪ List Bool} {encB : β ↪ List Bool} {A : Set α} {B : Set β} (h : LogSpacePTTReducible encA encB A B) :

A logspace positive truth-table reduction is a logspace truth-table reduction.

theorem Cslib.Complexity.LogSpaceDTTReducible.logSpaceTruthTableReducible {α β : Type} {encA : α ↪ List Bool} {encB : β ↪ List Bool} {A : Set α} {B : Set β} (h : LogSpaceDTTReducible encA encB A B) :

A logspace disjunctive truth-table reduction is a logspace truth-table reduction.

theorem Cslib.Complexity.LogSpaceCTTReducible.logSpaceTruthTableReducible {α β : Type} {encA : α ↪ List Bool} {encB : β ↪ List Bool} {A : Set α} {B : Set β} (h : LogSpaceCTTReducible encA encB A B) :

A logspace conjunctive truth-table reduction is a logspace truth-table reduction.

Embeddings into polynomial-time reductions and P-closure #

theorem Cslib.Complexity.LogSpaceTruthTableReducible.polyTimeTruthTableReducible {α β : Type} {encA : α ↪ List Bool} {encB : β ↪ List Bool} {A : Set α} {B : Set β} (h : LogSpaceTruthTableReducible encA encB A B) :

Every logspace truth-table reduction is a polynomial-time truth-table reduction.

theorem Cslib.Complexity.LogSpaceKTruthTableReducible.polyTimeKTruthTableReducible {α β : Type} {encA : α ↪ List Bool} {encB : β ↪ List Bool} {A : Set α} {B : Set β} {k : ℕ} (h : LogSpaceKTruthTableReducible k encA encB A B) :

Every logspace k-truth-table reduction is a polynomial-time k-truth-table reduction.

theorem Cslib.Complexity.LogSpaceBTTReducible.polyTimeBTTReducible {α β : Type} {encA : α ↪ List Bool} {encB : β ↪ List Bool} {A : Set α} {B : Set β} (h : LogSpaceBTTReducible encA encB A B) :
PolyTimeBTTReducible encA encB A B

Every logspace bounded-truth-table reduction is a polynomial-time bounded-truth-table reduction.

theorem Cslib.Complexity.LogSpaceDTTReducible.polyTimeDTTReducible {α β : Type} {encA : α ↪ List Bool} {encB : β ↪ List Bool} {A : Set α} {B : Set β} (h : LogSpaceDTTReducible encA encB A B) :
PolyTimeDTTReducible encA encB A B

Every logspace disjunctive truth-table reduction is a polynomial-time disjunctive truth-table reduction.

theorem Cslib.Complexity.LogSpaceCTTReducible.polyTimeCTTReducible {α β : Type} {encA : α ↪ List Bool} {encB : β ↪ List Bool} {A : Set α} {B : Set β} (h : LogSpaceCTTReducible encA encB A B) :
PolyTimeCTTReducible encA encB A B

Every logspace conjunctive truth-table reduction is a polynomial-time conjunctive truth-table reduction.

theorem Cslib.Complexity.LogSpacePTTReducible.polyTimePTTReducible {α β : Type} {encA : α ↪ List Bool} {encB : β ↪ List Bool} {A : Set α} {B : Set β} (h : LogSpacePTTReducible encA encB A B) :
PolyTimePTTReducible encA encB A B

Every logspace positive truth-table reduction is a polynomial-time positive truth-table reduction.

theorem Cslib.Complexity.LogSpaceTruthTableReducible.mem_P {α β : Type} {encA : α ↪ List Bool} {encB : β ↪ List Bool} {A : Set α} {B : Set β} (h : LogSpaceTruthTableReducible encA encB A B) (hB : B ∈ P encB) :
A ∈ P encA

P is closed under logspace truth-table reductions.

theorem Cslib.Complexity.LogSpaceKTruthTableReducible.mem_P {α β : Type} {encA : α ↪ List Bool} {encB : β ↪ List Bool} {A : Set α} {B : Set β} {k : ℕ} (h : LogSpaceKTruthTableReducible k encA encB A B) (hB : B ∈ P encB) :
A ∈ P encA

P is closed under logspace k-truth-table reductions.

theorem Cslib.Complexity.LogSpaceBTTReducible.mem_P {α β : Type} {encA : α ↪ List Bool} {encB : β ↪ List Bool} {A : Set α} {B : Set β} (h : LogSpaceBTTReducible encA encB A B) (hB : B ∈ P encB) :
A ∈ P encA

P is closed under logspace bounded-truth-table reductions.

theorem Cslib.Complexity.LogSpaceDTTReducible.mem_P {α β : Type} {encA : α ↪ List Bool} {encB : β ↪ List Bool} {A : Set α} {B : Set β} (h : LogSpaceDTTReducible encA encB A B) (hB : B ∈ P encB) :
A ∈ P encA

P is closed under logspace disjunctive truth-table reductions.

theorem Cslib.Complexity.LogSpaceCTTReducible.mem_P {α β : Type} {encA : α ↪ List Bool} {encB : β ↪ List Bool} {A : Set α} {B : Set β} (h : LogSpaceCTTReducible encA encB A B) (hB : B ∈ P encB) :
A ∈ P encA

P is closed under logspace conjunctive truth-table reductions.

theorem Cslib.Complexity.LogSpacePTTReducible.mem_P {α β : Type} {encA : α ↪ List Bool} {encB : β ↪ List Bool} {A : Set α} {B : Set β} (h : LogSpacePTTReducible encA encB A B) (hB : B ∈ P encB) :
A ∈ P encA

P is closed under logspace positive truth-table reductions.

Reflexivity and complementation #

Every problem truth-table reduces to itself in logarithmic space.

theorem Cslib.Complexity.LogSpaceBTTReducible.refl {α : Type} (encA : α ↪ List Bool) (A : Set α) :
LogSpaceBTTReducible encA encA A A

Every problem bounded-truth-table reduces to itself in logarithmic space.

theorem Cslib.Complexity.LogSpaceDTTReducible.refl {α : Type} (encA : α ↪ List Bool) (A : Set α) :
LogSpaceDTTReducible encA encA A A

Every problem disjunctive-truth-table reduces to itself in logarithmic space.

theorem Cslib.Complexity.LogSpaceCTTReducible.refl {α : Type} (encA : α ↪ List Bool) (A : Set α) :
LogSpaceCTTReducible encA encA A A

Every problem conjunctive-truth-table reduces to itself in logarithmic space.

theorem Cslib.Complexity.LogSpacePTTReducible.refl {α : Type} (encA : α ↪ List Bool) (A : Set α) :
LogSpacePTTReducible encA encA A A

Every problem positive-truth-table reduces to itself in logarithmic space.

theorem Cslib.Complexity.LogSpaceTruthTableReducible.compl_left {α β : Type} {encA : α ↪ List Bool} {encB : β ↪ List Bool} {A : Set α} {B : Set β} (h : LogSpaceTruthTableReducible encA encB A B) :

Negating the evaluator turns a logspace truth-table reduction from A to B into one from Aᶜ to B.

theorem Cslib.Complexity.LogSpaceTruthTableReducible.compl_right {α β : Type} {encA : α ↪ List Bool} {encB : β ↪ List Bool} {A : Set α} {B : Set β} (h : LogSpaceTruthTableReducible encA encB A B) :

Negating the answer bits before evaluation turns a logspace truth-table reduction from A to B into one from A to Bᶜ.

theorem Cslib.Complexity.LogSpaceTruthTableReducible.compl {α β : Type} {encA : α ↪ List Bool} {encB : β ↪ List Bool} {A : Set α} {B : Set β} (h : LogSpaceTruthTableReducible encA encB A B) :

A logspace truth-table reduction from A to B gives one from Aᶜ to Bᶜ.

theorem Cslib.Complexity.LogSpaceKTruthTableReducible.compl_left {α β : Type} {encA : α ↪ List Bool} {encB : β ↪ List Bool} {A : Set α} {B : Set β} {k : ℕ} (h : LogSpaceKTruthTableReducible k encA encB A B) :

Negating the evaluator turns a logspace k-truth-table reduction from A to B into one from Aᶜ to B.

theorem Cslib.Complexity.LogSpaceKTruthTableReducible.compl_right {α β : Type} {encA : α ↪ List Bool} {encB : β ↪ List Bool} {A : Set α} {B : Set β} {k : ℕ} (h : LogSpaceKTruthTableReducible k encA encB A B) :

Negating the answer bits before evaluation turns a logspace k-truth-table reduction from A to B into one from A to Bᶜ.

theorem Cslib.Complexity.LogSpaceKTruthTableReducible.compl {α β : Type} {encA : α ↪ List Bool} {encB : β ↪ List Bool} {A : Set α} {B : Set β} {k : ℕ} (h : LogSpaceKTruthTableReducible k encA encB A B) :

A logspace k-truth-table reduction from A to B gives one from Aᶜ to Bᶜ.

theorem Cslib.Complexity.LogSpaceBTTReducible.compl_left {α β : Type} {encA : α ↪ List Bool} {encB : β ↪ List Bool} {A : Set α} {B : Set β} (h : LogSpaceBTTReducible encA encB A B) :

Negating the evaluator turns a logspace bounded-truth-table reduction from A to B into one from Aᶜ to B.

theorem Cslib.Complexity.LogSpaceBTTReducible.compl_right {α β : Type} {encA : α ↪ List Bool} {encB : β ↪ List Bool} {A : Set α} {B : Set β} (h : LogSpaceBTTReducible encA encB A B) :

Negating the answer bits before evaluation turns a logspace bounded-truth-table reduction from A to B into one from A to Bᶜ.

theorem Cslib.Complexity.LogSpaceBTTReducible.compl {α β : Type} {encA : α ↪ List Bool} {encB : β ↪ List Bool} {A : Set α} {B : Set β} (h : LogSpaceBTTReducible encA encB A B) :

A logspace bounded-truth-table reduction from A to B gives one from Aᶜ to Bᶜ.

theorem Cslib.Complexity.logSpaceDTTReducible_iff_logSpaceCTTReducible_compl {α β : Type} {encA : α ↪ List Bool} {encB : β ↪ List Bool} {A : Set α} {B : Set β} :

De Morgan duality for logspace disjunctive and conjunctive truth-table reductions: A disjunctively reduces to B iff Aᶜ conjunctively reduces to Bᶜ, by the same queries.

Closure of L and transitivity for bounded-query truth-table reductions #

theorem Cslib.Complexity.kTruthTable_mem_L {α β : Type} {encA : α ↪ List Bool} {encB : β ↪ List Bool} {A : Set α} {B : Set β} {k : ℕ} {r : α → ℕ} {q : α × ℕ → β} {d : α × List Bool → Bool} (hr : Turing.MultiTapeTM.ComputableInLogSpace r encA Turing.MultiTapeTM.encUnary) (hq : Turing.MultiTapeTM.ComputableInLogSpace q (Turing.MultiTapeTM.encPair encA Turing.MultiTapeTM.encUnary) encB) (hd : Turing.MultiTapeTM.ComputableInLogSpace d (Turing.MultiTapeTM.encPair encA Turing.MultiTapeTM.encBits) Turing.MultiTapeTM.encBool) (hrk : ∀ (a : α), r a ≤ k) (hA : ∀ (a : α), a ∈ A ↔ d (a, truthTableAnswers (q ⁻¹' B) r a) = true) (hB : B ∈ L encB) :
A ∈ L encA

Kernel for L-closure under k-query logspace truth-table reductions: evaluating at most k queries of a language in L and combining the answers in logspace keeps the language in L.

theorem Cslib.Complexity.LogSpaceKTruthTableReducible.mem_L {α β : Type} {encA : α ↪ List Bool} {encB : β ↪ List Bool} {A : Set α} {B : Set β} {k : ℕ} (h : LogSpaceKTruthTableReducible k encA encB A B) (hB : B ∈ L encB) :
A ∈ L encA

L is closed under logspace k-truth-table reductions.

theorem Cslib.Complexity.LogSpaceBTTReducible.mem_L {α β : Type} {encA : α ↪ List Bool} {encB : β ↪ List Bool} {A : Set α} {B : Set β} (h : LogSpaceBTTReducible encA encB A B) (hB : B ∈ L encB) :
A ∈ L encA

L is closed under logspace bounded-truth-table reductions.

theorem Cslib.Complexity.LogSpaceKTruthTableReducible.trans {α β γ : Type} {encA : α ↪ List Bool} {encB : β ↪ List Bool} {encC : γ ↪ List Bool} {A : Set α} {B : Set β} {C : Set γ} {k₁ k₂ : ℕ} (hAB : LogSpaceKTruthTableReducible k₁ encA encB A B) (hBC : LogSpaceKTruthTableReducible k₂ encB encC B C) :
LogSpaceKTruthTableReducible (k₁ * k₂) encA encC A C

Logspace k-truth-table reductions compose, multiplying the query bounds: a k₁-query reduction followed by a k₂-query reduction yields a (k₁ * k₂)-query reduction. Each of the r₁ a outer queries is expanded into a block of k₂ inner queries, and the outer evaluator combines the r₁ a inner decisions computed from the corresponding slices of the oracle answer vector.

theorem Cslib.Complexity.LogSpaceBTTReducible.trans {α β γ : Type} {encA : α ↪ List Bool} {encB : β ↪ List Bool} {encC : γ ↪ List Bool} {A : Set α} {B : Set β} {C : Set γ} (hAB : LogSpaceBTTReducible encA encB A B) (hBC : LogSpaceBTTReducible encB encC B C) :
LogSpaceBTTReducible encA encC A C

Logspace bounded-truth-table reductions compose.