Documentation

CslibFrontier.Computability.Complexity.FineGrained.DensityBranchCounting

One model counter with the fixed-density bound of Theorem 1.1 and the interpolation-scale bound #

For every fixed clause width k, one machine computes the number of satisfying assignments CNF.modelCount φ of every formula φ whose clauses have at most k literals, in polynomial space, with a single time function T that satisfies three bounds at once (DensityBranchCounting.exists_modelCounter). Write n for the number of variables, m for the number of clauses, L for the encoding length and ν = ⌈log₂ ⌈log₂ n⌉⌉.

The machine is the single algorithm in the last paragraph of Appendix D.3 of [OAI26k] (p. 57): it tests m ≤ n ν (DensityBranchCounting.threshold), runs the tensor-contraction counter ContractionCounting.exists_modelCounter when the test passes, and otherwise runs a dense counter. In the paper the dense branch is the parity-query proof of the arbitrary-density bound (p. 57), with exponent O_k(n log log n / √log n). It evaluates its queries by Lemma D.2 (pp. 54–56), which applies Theorem D.1 with truncation order ℓ = n + 1. That is not formalized, so the dense branch here is the Section 6.4 counter CountingNativeEndpoint.exists_modelCounter, and the bound on every formula stays at the interpolation scale ρ(n). The arbitrary-density bound of Theorem 1.1 remains open.

As in the two counters it combines, n is the number of variables occurring in φ (CNF.numVars); the paper counts declared variables, with n ≥ 20.

Main definitions #

Main results #

References #

The clause-count threshold of the single algorithm, n ⌈log₂ ⌈log₂ n⌉⌉ for n variables. Formulas with at most this many clauses are counted by tensor contraction.

Arithmetic of the exponents #

The counter #

theorem Cslib.Complexity.DensityBranchCounting.exists_modelCounter (k : ℕ) :
∃ (count : Logic.PL.CNF ℕ → ℕ) (T : Logic.PL.CNF ℕ → ℕ) (S : Logic.PL.CNF ℕ → ℕ) (A : ℕ) (e : ℕ) (b : ℕ), (∀ (φ : Logic.PL.CNF ℕ), (∀ c ∈ φ, List.length c ≤ k) → count φ = φ.modelCount) ∧ Turing.MultiTapeTM.ComputableInO count encCNF Turing.MultiTapeTM.encNat T S ∧ (∀ (φ : Logic.PL.CNF ℕ), S φ = ((encCNF φ).length + 1) ^ b) ∧ (∀ (φ : Logic.PL.CNF ℕ), T φ ≤ ⌈2 ^ (↑A * SubexponentialSAT.interpolationScale φ.numVars)⌉₊ * ((encCNF φ).length + 1) ^ e) ∧ (∀ (φ : Logic.PL.CNF ℕ), List.length φ ≤ threshold φ.numVars → T φ ≤ 2 ^ (A * threshold φ.numVars / (Nat.log 2 (φ.numVars + 2)).sqrt) * ((encCNF φ).length + 1) ^ e) ∧ ∀ (D : ℕ), ∃ (A' : ℕ), ∀ (φ : Logic.PL.CNF ℕ), List.length φ ≤ D * φ.numVars → T φ ≤ 2 ^ (A' * φ.numVars / (Nat.log 2 (φ.numVars + 2)).sqrt) * ((encCNF φ).length + 1) ^ e

One model counter with the fixed-density bound of Theorem 1.1 and the interpolation-scale bound. For each clause width k, one machine computes φ.modelCount on every formula φ whose clauses have at most k literals, in polynomial space, and its time function T satisfies, for n variables, m clauses and encoding length L:

  • on every formula, T φ ≤ ⌈2 ^ (A ρ(n))⌉ (L + 1) ^ e, where ρ = interpolationScale;
  • when m ≤ threshold n = n ⌈log₂ ⌈log₂ n⌉⌉, T φ ≤ 2 ^ (A · threshold n / √⌊log₂ (n + 2)⌋) (L + 1) ^ e;
  • for each density bound D, when m ≤ D n, T φ ≤ 2 ^ (A' n / √⌊log₂ (n + 2)⌋) (L + 1) ^ e for a constant A' depending on D.

The machine, T, S and the constants A, e, b are fixed before D; only A' depends on D.