Documentation

CslibFrontier.Computability.Complexity.Parameterized.WHierarchy

The W-hierarchy #

Weighted circuit satisfiability asks whether a Boolean circuit has a satisfying input with exactly k ones, with k as the parameter Cygan et al., Section 13.3. The circuits are those of the unbounded fan-in basis (negation, and conjunction and disjunction of any number of arguments). WCS t d is the restriction to circuits of weft at most t (Circuit.weft: at most t gates of more than two arguments on a path to the output) and depth at most d. The class W t is the class W[t]: the parameterized problems that fpt-reduce (FPTReducible) to WCS t d for some depth d Cygan et al., Section 13.3 [DF99]. A problem is W[t]-hard (WHard) when every problem of W[t] fpt-reduces to it.

The instances of WCS t d are restricted to the circuits of the class, as in the cited definition; a reduction to WCS t d must produce such circuits. The weight k is written in binary, and the input count of a circuit in unary.

The circuits are straight-line programs rather than the source's DAGs. A gate's fan-in is its arity, counted with multiplicity, so a conjunction reading one wire three times is large. The basis also has the constants (the conjunction and disjunction of no arguments) and unary conjunctions and disjunctions. Neither difference changes the classes: merging repeated arguments only lowers the weft, and constants propagate without raising weft or depth.

Main definitions #

Main results #

References #

c has a satisfying input with exactly k ones under the interpretation I.

Weighted circuit satisfiability #

An instance of weighted circuit satisfiability over the unbounded fan-in basis: a one-output circuit packaged with its input count and a target Hamming weight.

theorem Cslib.Complexity.encWeightedCircuitSAT_weight_budget {γ✝ : Type} {encIn✝ : γ✝ ↪ List Bool} {S✝ : γ✝ → ℕ} {g✝ : γ✝ → WeightedCircuitSATInstance} :
theorem Cslib.Complexity.encWeightedCircuitSAT_mk_budget {γ : Type} {encIn : γ ↪ List Bool} {budget : γ → ℕ} {x0 : γ → (n : ℕ) × Circuits.Circuit Circuits.Boolean.Unbounded.signature n 1} {x1 : γ → ℕ} (h0 : Turing.MultiTapeTM.ComputableInSpace x0 encIn (Circuits.Boolean.Unbounded.encCircuit 1) budget) (h1 : Turing.MultiTapeTM.ComputableInSpace x1 encIn Turing.MultiTapeTM.encNat budget) :
Turing.MultiTapeTM.ComputableInSpace (fun (x : γ) => { circuit := x0 x, weight := x1 x }) encIn encWeightedCircuitSAT budget
theorem Cslib.Complexity.encWeightedCircuitSAT_mk_inO {γ : Type} {encIn : γ ↪ List Bool} {x0 : γ → (n : ℕ) × Circuits.Circuit Circuits.Boolean.Unbounded.signature n 1} {T0 S0 x1 T1 S1 : γ → ℕ} (h0 : Turing.MultiTapeTM.ComputableInO x0 encIn (Circuits.Boolean.Unbounded.encCircuit 1) T0 S0) (h1 : Turing.MultiTapeTM.ComputableInO x1 encIn Turing.MultiTapeTM.encNat T1 S1) :
Turing.MultiTapeTM.ComputableInO (fun (x : γ) => { circuit := x0 x, weight := x1 x }) encIn encWeightedCircuitSAT (fun (x : γ) => T0 x + T1 x) fun (x : γ) => S0 x + S1 x

The binary encoding of WeightedCircuitSAT instances: the circuit, then the weight in binary.

Weighted circuit satisfiability Cygan et al., Section 13.3: the circuits over the unbounded fan-in basis, with one output, that have a satisfying input with exactly k ones.

The circuits over the unbounded fan-in basis with one output, weft at most t and depth at most d.

theorem Cslib.Complexity.WeftCircuit.ext {t d : ℕ} {x y : WeftCircuit t d} (toCircuit : x.toCircuit = y.toCircuit) :
x = y

Two bounded circuits with equal underlying circuits are equal.

The encoding of circuits of weft at most t and depth at most d: their encoding as circuits (Unbounded.encCircuit).

A circuit of the class is encoded as a circuit.

Projecting the input count of a WeftCircuit in unary is polynomial-time.

Projecting the output wires of a WeftCircuit is polynomial-time.

An instance of bounded-weft, bounded-depth weighted circuit satisfiability WCS[C_{t,d}] Cygan et al., Section 13.3.

  • circuit : WeftCircuit t d

    The circuit of weft at most t and depth at most d.

  • weight : ℕ

    The target Hamming weight of a satisfying input.

theorem Cslib.Complexity.WCSInstance.ext {t d : ℕ} {x y : WCSInstance t d} (circuit : x.circuit = y.circuit) (weight : x.weight = y.weight) :
x = y

Weighted circuit satisfiability for circuits of weft at most t and depth at most d, the problem WCS[C_{t,d}] Cygan et al., Section 13.3.

The encoding of the instances of WCS t d: the circuit, then the weight in binary. (enc_structure currently requires an unparameterized structure, so this parameterized instance defines the same field-pair embedding directly.)

@[simp]

A WCS t d instance is encoded as the pair of its circuit and binary weight.

theorem Cslib.Complexity.encWCS_circuit_polyTime {t d : ℕ} {γ : Type} {encIn : γ ↪ List Bool} {g : γ → WCSInstance t d} (h : Turing.MultiTapeTM.ComputableInPolyTime g encIn (encWCS t d)) :

Projecting WCSInstance.circuit is polynomial-time.

Projecting WCSInstance.weight is polynomial-time.

theorem Cslib.Complexity.encWCS_mk_polyTime {t d : ℕ} {γ : Type} {encIn : γ ↪ List Bool} {circuit : γ → WeftCircuit t d} {weight : γ → ℕ} (hcircuit : Turing.MultiTapeTM.ComputableInPolyTime circuit encIn (encWeftCircuit t d)) (hweight : Turing.MultiTapeTM.ComputableInPolyTime weight encIn Turing.MultiTapeTM.encNat) :
Turing.MultiTapeTM.ComputableInPolyTime (fun (a : γ) => { circuit := circuit a, weight := weight a }) encIn (encWCS t d)

Constructing a WCSInstance is polynomial-time.

The classes W[t] #

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

The class W[t] Cygan et al., Section 13.3: the parameterized problems that fpt-reduce to weighted satisfiability of circuits of weft at most t and depth at most d, for some d.

@[reducible, inline]
abbrev Cslib.Complexity.WHard (t : ℕ) {β : Type} (enc : β ↪ List Bool) (κ : β → ℕ) (B : Set β) :

W[t]-hardness: every problem of W[t] fpt-reduces to B. The general lemmas, such as FPTHard.trans and FPTHard.subset_FPT, apply through dot notation.

theorem Cslib.Complexity.mem_W {α : Type} {encA : α ↪ List Bool} {κA : α → ℕ} {A : Set α} {t : ℕ} :
A ∈ W t encA κA ↔ ∃ (d : ℕ), FPTReducible encA (encWCS t d) κA WCSInstance.weight A (WCS t d)

Membership in W t.

theorem Cslib.Complexity.FPTReducible.mem_W {α β : Type} {encA : α ↪ List Bool} {encB : β ↪ List Bool} {κA : α → ℕ} {κB : β → ℕ} {A : Set α} {B : Set β} {t : ℕ} (hAB : FPTReducible encA encB κA κB A B) (hB : B ∈ W t encB κB) :
A ∈ W t encA κA

W[t] is closed under fpt-reductions.

Weighted satisfiability of circuits of weft at most t and depth at most d is in W[t].

theorem Cslib.Complexity.fptReducible_WCS_of_le {t t' d d' : ℕ} (ht : t ≤ t') (hd : d ≤ d') :

Raising the bounds on the weft and the depth is an fpt-reduction, by the identity on circuits.

theorem Cslib.Complexity.W_mono {α : Type} {encA : α ↪ List Bool} {κA : α → ℕ} {t t' : ℕ} (h : t ≤ t') :
W t encA κA ⊆ W t' encA κA

The W-hierarchy is increasing: W[t] ⊆ W[t'] for t ≤ t'.

FPT ⊆ W[t] #

The circuit with no inputs whose one gate is the conjunction of no arguments, true.

The circuit with no inputs whose one gate is the disjunction of no arguments, false.

A yes-instance of WCS t 1: trueCircuit with weight 0.

A no-instance of WCS t 1: falseCircuit with weight 0.

yesInstance t is a yes-instance: the empty input has weight 0 and satisfies true.

noInstance t is a no-instance: no input satisfies false.

theorem Cslib.Complexity.FPT_subset_W {α : Type} {encA : α ↪ List Bool} {κA : α → ℕ} (t : ℕ) :
FPT encA κA ⊆ W t encA κA

FPT ⊆ W[t]: a problem decided in fpt time reduces to a fixed yes-instance or a fixed no-instance of WCS t 1.

Hardness #

theorem Cslib.Complexity.wHard_iff {β : Type} {encB : β ↪ List Bool} {κB : β → ℕ} {B : Set β} {t : ℕ} :
WHard t encB κB B ↔ ∀ (d : ℕ), FPTReducible (encWCS t d) encB WCSInstance.weight κB (WCS t d) B

W[t]-hardness is hardness for weighted circuit satisfiability: B is W[t]-hard exactly when WCS t d fpt-reduces to it for every depth d.