Documentation

CslibFrontier.Computability.Complexity.Classes.RangeAvoidance

Range Avoidance (Empty) and APEPP #

Range Avoidance — named Empty in Korten, Section 2, Definition 3 — is the total search problem: given a stretching Boolean circuit C : {0, 1} ^ n → {0, 1} ^ m with n < m, find an m-bit string outside the range of C. Totality follows from the dual weak pigeonhole principle (2 ^ n < 2 ^ m), and verifying a candidate y requires checking C(u) ≠ y for all n-bit inputs u, placing RangeAvoidance in TFΣ₂^P Korten, Section 2, Observation 1.

Admitted instances (Cslib.Complexity.RangeAvoidanceInstance) are encoded as the validity subtype of Cslib.Complexity.RangeAvoidanceData enforcing both inputLen < outputLen and the exact De Morgan circuit contract (Circuit.ofCode inputLen outputLen code is some), so every admitted instance decodes to a well-formed De Morgan circuit with exactly inputLen inputs and outputLen outputs (Cslib.Complexity.RangeAvoidanceInstance.toCircuit, Cslib.Complexity.RangeAvoidance_iff_toCircuit) without silent padding of malformed codes.

The class APEPP (Abundant Polynomial Empty Pigeonhole Principle) consists of the search problems polynomial-time search-reducible to RangeAvoidance Kleinberg, Korten, Mitropolsky and Papadimitriou, Korten, Section 2. Defining APEPP directly by reduction to RangeAvoidance makes RangeAvoidance complete for APEPP immediately by reflexivity; the companion module CslibFrontier.Computability.Complexity.Classes.RangeAvoidance.Uniform compiles uniform polynomial-time stretching families into admitted RangeAvoidanceInstance values with exact widths and explicit polynomial circuit-size bounds, characterizing APEPP via uniform stretching families.

No algorithmic upper bound (APEPP ⊆ FPSearch) or circuit lower bound is claimed here.

Main definitions #

Main results #

References #

Generic range-avoidance relation and counting totality #

def Cslib.Complexity.avoidRel {α : Type} (n m : α → ℕ) (F : α × List Bool → List Bool) (a : α) (y : List Bool) :

The generic range-avoidance search relation for a family of maps F : α × List Bool → List Bool from {0, 1} ^ (n a) to {0, 1} ^ (m a): a candidate y is a solution iff y.length = m a and no n a-bit string u satisfies F (a, u) = y.

theorem Cslib.Complexity.exists_avoid {α : Type} {n m : α → ℕ} {F : α × List Bool → List Bool} {a : α} (h : n a < m a) :
∃ (y : List Bool), avoidRel n m F a y

Dual weak pigeonhole principle (finite counting): whenever n a < m a, there is an m a-bit string outside the image of F (a, ·) on {0, 1} ^ (n a).

theorem Cslib.Complexity.isTotalSearch_avoidRel {α : Type} {n m : α → ℕ} {F : α × List Bool → List Bool} (h : ∀ (a : α), n a < m a) :

avoidRel n m F is a total search problem whenever n a < m a for every instance a.

Any polynomial-time stretching family defines a TFΣ₂^P search problem.

Circuit-presented Range Avoidance (Empty) #

Raw data fields of a circuit range-avoidance instance: input width, output width, and De Morgan circuit code.

  • inputLen : ℕ

    The input bit-length n.

  • outputLen : ℕ

    The output bit-length m.

  • The De Morgan circuit code.

theorem Cslib.Complexity.encRangeAvoidanceData_outputLen_budget {γ✝ : Type} {encIn✝ : γ✝ ↪ List Bool} {S✝ : γ✝ → ℕ} {g✝ : γ✝ → RangeAvoidanceData} :
theorem Cslib.Complexity.encRangeAvoidanceData_mk_inO {γ : Type} {encIn : γ ↪ List Bool} {x0 T0 S0 x1 T1 S1 : γ → ℕ} {x2 : γ → List (Circuits.Boolean.Op × List ℕ) × List ℕ} {T2 S2 : γ → ℕ} (h0 : Turing.MultiTapeTM.ComputableInO x0 encIn Turing.MultiTapeTM.encUnary T0 S0) (h1 : Turing.MultiTapeTM.ComputableInO x1 encIn Turing.MultiTapeTM.encUnary T1 S1) (h2 : Turing.MultiTapeTM.ComputableInO x2 encIn Circuits.Boolean.encCode T2 S2) :
Turing.MultiTapeTM.ComputableInO (fun (x : γ) => { inputLen := x0 x, outputLen := x1 x, code := x2 x }) encIn encRangeAvoidanceData (fun (x : γ) => T0 x + (T1 x + T2 x)) fun (x : γ) => S0 x + (S1 x + S2 x)
theorem Cslib.Complexity.encRangeAvoidanceData_inputLen_budget {γ✝ : Type} {encIn✝ : γ✝ ↪ List Bool} {S✝ : γ✝ → ℕ} {g✝ : γ✝ → RangeAvoidanceData} :
theorem Cslib.Complexity.encRangeAvoidanceData_code_budget {γ✝ : Type} {encIn✝ : γ✝ ↪ List Bool} {S✝ : γ✝ → ℕ} {g✝ : γ✝ → RangeAvoidanceData} :
theorem Cslib.Complexity.encRangeAvoidanceData_mk_budget {γ : Type} {encIn : γ ↪ List Bool} {budget x0 x1 : γ → ℕ} {x2 : γ → List (Circuits.Boolean.Op × List ℕ) × List ℕ} (h0 : Turing.MultiTapeTM.ComputableInSpace x0 encIn Turing.MultiTapeTM.encUnary budget) (h1 : Turing.MultiTapeTM.ComputableInSpace x1 encIn Turing.MultiTapeTM.encUnary budget) (h2 : Turing.MultiTapeTM.ComputableInSpace x2 encIn Circuits.Boolean.encCode budget) :
Turing.MultiTapeTM.ComputableInSpace (fun (x : γ) => { inputLen := x0 x, outputLen := x1 x, code := x2 x }) encIn encRangeAvoidanceData budget

Validity contract of Korten, Section 2, Definition 3: inputLen < outputLen and code decodes to a well-formed De Morgan circuit with exactly inputLen inputs and outputLen outputs.

@[reducible, inline]

An admitted instance of circuit Range Avoidance (Empty in Korten, Section 2, Definition 3): a RangeAvoidanceData record satisfying both inputLen < outputLen and exact Circuit.ofCode well-formedness.

Explicit binary encoding of admitted RangeAvoidanceInstance values as the subtype restriction of encRangeAvoidanceData.

@[simp]

The code of a.toCircuit recovers a.val.code identically.

Construct an admitted RangeAvoidanceInstance from a typed stretching De Morgan circuit.

Range Avoidance (Empty in Korten, Section 2, Definition 3): given an admitted stretching De Morgan circuit instance a, find an a.val.outputLen-bit string outside the range of evalCircuitCode a.val.outputLen a.val.code on {0, 1} ^ a.val.inputLen.

Every admitted RangeAvoidanceInstance evaluates exactly according to its decoded De Morgan circuit a.toCircuit, with no padding of mismatched output lists.

On a typed stretching De Morgan circuit c : Circuit signature n m, RangeAvoidance asks for an m-bit string outside the range of c.eval interpretation.

APEPP #

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

APEPP (Abundant Polynomial Empty Pigeonhole Principle): the class of search problems polynomial-time search-reducible to RangeAvoidance Kleinberg, Korten, Mitropolsky and Papadimitriou, Korten, Section 2.

theorem Cslib.Complexity.SearchReducible.mem_APEPP {α β : Type} {encA : α ↪ List Bool} {encB : β ↪ List Bool} {R : α → List Bool → Prop} {T : β → List Bool → Prop} (hRT : SearchReducible encA encB R T) (hT : T ∈ APEPP encB) :
R ∈ APEPP encA

APEPP is closed downward under polynomial-time search reductions.

theorem Cslib.Complexity.APEPP.isTotalSearch {α : Type} {enc : α ↪ List Bool} {R : α → List Bool → Prop} (hR : R ∈ APEPP enc) :

Every search problem in APEPP is total.

RangeAvoidance is complete for APEPP under polynomial-time search reductions (directly from the reduction-based definition of APEPP).