Documentation

CslibFrontier.Computability.Complexity.FineGrained.CircuitCounting

Subexponential #Circuit-SAT and circuit satisfiability over bounded-arity Boolean signatures #

Combines the frontier CSP/CNF reduction (Cslib.Circuits.Frontier.Compiler.toCSP, Compiler.toCNF, Compiler.freeShift, Compiler.acceptCount_eq_two_pow_freeShift_mul_modelCount) with bounded-arity Boolean #CSP compilation (Cslib.Complexity.CSP.computableInPolyTime_toCNFBounded_of_finite) and the shifted bounded-width #SAT wrapper (CountingNativeEndpoint.exists_shiftedCounter_of_polyTime_toCNF) to obtain deterministic subexponential-time, polynomial-space exact counting and decision for bounded-fan-in Boolean circuits.

Source relation and library extensions #

Main definitions #

Main results #

References #

@[reducible, inline]

Binary encoding of the circuit constraint relation alphabet Compiler.CircuitRel σ m.

Syntactic fan-in and linear-size checks on serialized circuits #

Polynomial-time certificates for Compiler.toCSP, Compiler.toCNF, and freeShift #

Compiling a circuit over σ to its reachable-wire Boolean CSP Compiler.toCSP c.2 takes polynomial time.

Compiling a circuit over a finite Boolean signature to its exact-multiplicity frontier CNF formula Compiler.toCNF c.2 I acc takes polynomial time, obtained by composing computableInPolyTime_toCSP with CSP.computableInPolyTime_toCNFBounded_of_finite.

Computing the unread-input / unconstrained-wire shift Compiler.freeShift c.2 I acc in unary takes polynomial time.

Compiling a 1-output circuit over a finite Boolean signature to Compiler.toSatCNF c.2 I takes polynomial time.

Exact #Circuit-SAT counting at interpolationScale #

theorem Cslib.Complexity.CircuitCounting.exists_circuitAcceptCounter {σ : Circuits.Signature} [Finite σ.Op] (encOp : σ.Op ↪ List Bool) (I : Circuits.Interpretation σ Bool) {m : ℕ} (acc : Fin m → Bool → Bool) (k : ℕ) :
∃ (count : (n : ℕ) × Circuits.Circuit σ n m → ℕ) (A : ℕ) (e : ℕ) (b : ℕ), (∀ (c : (n : ℕ) × Circuits.Circuit σ n m), c.snd.FanInAtMost k → count c = c.snd.acceptCount I acc) ∧ Turing.MultiTapeTM.ComputableInO count (Circuits.Circuit.encCircuit encOp m) Turing.MultiTapeTM.encNat (fun (c : (n : ℕ) × Circuits.Circuit σ n m) => ⌈2 ^ (↑A * SubexponentialSAT.interpolationScale c.snd.size)⌉₊ * (((Circuits.Circuit.encCircuit encOp m) c).length + 1) ^ e) fun (c : (n : ℕ) × Circuits.Circuit σ n m) => (((Circuits.Circuit.encCircuit encOp m) c).length + 1) ^ b

Subexponential acceptance counting for bounded-fan-in circuits over any finite Boolean signature. For every finite signature σ, operation encoding encOp, Boolean interpretation I, output predicate acc : Fin m → Bool → Bool, and fan-in bound k, a single native machine computes c.2.acceptCount I acc on every circuit c with c.2.FanInAtMost k, running in time 2 ^ (A * interpolationScale c.2.size) times a polynomial in the encoded circuit length and in polynomial space.

theorem Cslib.Complexity.CircuitCounting.exists_circuitSatCounter {σ : Circuits.Signature} [Finite σ.Op] (encOp : σ.Op ↪ List Bool) (I : Circuits.Interpretation σ Bool) (k : ℕ) :
∃ (count : (n : ℕ) × Circuits.Circuit σ n 1 → ℕ) (A : ℕ) (e : ℕ) (b : ℕ), (∀ (c : (n : ℕ) × Circuits.Circuit σ n 1), c.snd.FanInAtMost k → count c = c.snd.satCount I) ∧ Turing.MultiTapeTM.ComputableInO count (Circuits.Circuit.encCircuit encOp 1) Turing.MultiTapeTM.encNat (fun (c : (n : ℕ) × Circuits.Circuit σ n 1) => ⌈2 ^ (↑A * SubexponentialSAT.interpolationScale c.snd.size)⌉₊ * (((Circuits.Circuit.encCircuit encOp 1) c).length + 1) ^ e) fun (c : (n : ℕ) × Circuits.Circuit σ n 1) => (((Circuits.Circuit.encCircuit encOp 1) c).length + 1) ^ b

Subexponential #Circuit-SAT over any finite Boolean signature of bounded arity. For every finite signature σ, operation encoding encOp, Boolean interpretation I, and fan-in bound k, one native machine computes the exact number of satisfying inputs c.2.satCount I of every circuit c : Σ n, Circuit σ n 1 with c.2.FanInAtMost k, in time 2 ^ (A * interpolationScale c.2.size) times a polynomial in the encoding length and in polynomial space.

Unconditional subexponential De Morgan #Circuit-SAT. One native machine computes the exact number of satisfying inputs c.2.satCount Boolean.interpretation of every De Morgan circuit c (encoded via Boolean.encCircuit 1) in time 2 ^ (A * interpolationScale c.2.size) times a polynomial in the encoding length and in polynomial space.

theorem Cslib.Complexity.CircuitCounting.exists_linearSizeCircuitSatCounter {σ : Circuits.Signature} [Finite σ.Op] (encOp : σ.Op ↪ List Bool) (I : Circuits.Interpretation σ Bool) (k C : ℕ) :
∃ (count : (n : ℕ) × Circuits.Circuit σ n 1 → ℕ) (A : ℕ) (e : ℕ) (b : ℕ), (∀ (c : (n : ℕ) × Circuits.Circuit σ n 1), c.snd.FanInAtMost k → c.snd.size ≤ C * c.fst + C → count c = c.snd.satCount I) ∧ Turing.MultiTapeTM.ComputableInO count (Circuits.Circuit.encCircuit encOp 1) Turing.MultiTapeTM.encNat (fun (c : (n : ℕ) × Circuits.Circuit σ n 1) => ⌈2 ^ (↑A * SubexponentialSAT.interpolationScale c.fst)⌉₊ * (((Circuits.Circuit.encCircuit encOp 1) c).length + 1) ^ e) fun (c : (n : ℕ) × Circuits.Circuit σ n 1) => (((Circuits.Circuit.encCircuit encOp 1) c).length + 1) ^ b

Exact-counting extension of Appendix C.1 of [OAI26k] (general bounded-arity signatures). Whereas Appendix C.1 (p. 51) states only decision for linear-size De Morgan circuits, this theorem strengthens the result to exact #Circuit-SAT over any finite signature σ: for every fan-in bound k and size constant C, one native machine computes c.2.satCount I on every circuit c with c.2.FanInAtMost k and c.2.size ≤ C * c.1 + C, in time 2 ^ (A * interpolationScale c.1) times a polynomial in the encoding length and in polynomial space.

Exact-counting analogue of Appendix C.1 of [OAI26k] on linear-size De Morgan circuits (c.2.size ≤ C * c.1 + C), running in time 2 ^ (A * interpolationScale c.1) times a polynomial in the encoding length and in polynomial space.

Subexponential-time decision corollaries #

Bounded-fan-in SignatureCircuitSAT I over any finite Boolean signature σ satisfies DecidableInSubexpTime with respect to gate count c.2.size (for every δ > 0, some decider runs in time O(2 ^ (δ * c.2.size) * (|c| + 1) ^ e); see exists_circuitSatCounter for a single machine at the interpolationScale rate).

When every operation in a finite signature σ has arity at most k, full SignatureCircuitSAT I satisfies DecidableInSubexpTime with respect to c.2.size (for every δ > 0, some decider runs in O(2 ^ (δ * c.2.size) * (|c| + 1) ^ e)).

De Morgan CircuitSAT satisfies DecidableInSubexpTime with respect to gate count c.2.size (for every δ > 0, some decider runs in O(2 ^ (δ * c.2.size) * (|c| + 1) ^ e); see exists_booleanCircuitSatCounter for a single machine at the interpolationScale rate).

General-signature extension of Appendix C.1 of [OAI26k] (p. 51): satisfiability of linear-size circuits (c.2.size ≤ C * n + C) of fan-in at most k over any finite Boolean signature σ satisfies DecidableInSubexpTime in the input count n = c.1 (for every δ > 0, some decider runs in O(2 ^ (δ * n) * (|c| + 1) ^ e); see exists_linearSizeCircuitSatCounter for a single machine at the interpolationScale rate).

Appendix C.1 of [OAI26k] (p. 51): satisfiability of linear-size De Morgan circuits (c.2.size ≤ C * n + C) satisfies DecidableInSubexpTime in the input count n = c.1 (for every δ > 0, some decider runs in O(2 ^ (δ * n) * (|c| + 1) ^ e); see exists_linearSizeBooleanCircuitSatCounter for a single machine at the interpolationScale rate).