Documentation

CslibFrontier.Computability.Complexity.FineGrained.CountingTreeBound

Discharging CountingTreeBound for Counting Sparsification #

We discharge the quantitative depth and leaf-count hypothesis CountingSparsify.CountingTreeBound of CountingSparsification from the actual path budgets and binomial leaf-word bounds in CountingBounds and the first-success threshold base countingThresholdBase in CountingParameters (Appendix A.2–A.3, Lemmas A.2–A.3, printed pp. 46–47 of [OAI26k]).

Specifically:

We then specialize the correctness and native ComputableInO transfer theorems of CountingSparsification and ThreeOccurrenceReduction both for any budget-satisfying M and unconditionally at M = countingThresholdBase K B.

Main results #

References #

Discharging CountingTreeBound from the integer parameter budget. For 2 ≤ M, 1 ≤ K, and 1 ≤ B, if 2 ≤ K implies countingBChoiceCoeff K ≤ M and B * countingBChoiceCoeff K * Nat.clog 2 (4 * countingDepthCoeff K M * M) ≤ M, then CountingTreeBound M K B (countingDepthCoeff K M) hM hK holds (Appendix A.3, Lemma A.3, printed p. 47 [OAI26k]).

Unconditional CountingTreeBound at countingThresholdBase K B. For any 1 ≤ K and 1 ≤ B, the first-success dyadic base countingThresholdBase K B satisfies CountingTreeBound with linear depth coefficient countingDepthCoeff K (countingThresholdBase K B).

Model-count correctness of search under the integer parameter budget. If g computes ψ.modelCount on sparse formulas ψ of width at most k, then search M K k B g φ returns φ.modelCount on formulas of width at most k and 0 otherwise.

Model-count correctness of search on width-≤ k formulas under the integer parameter budget.

Unconditional model-count correctness of search at countingThresholdBase K B.

theorem Cslib.Complexity.CountingSparsify.exists_computableInO_search_of_budget {M K : ℕ} (hM : 1 ≤ M) (hK : 1 ≤ K) (hM2 : 2 ≤ M) {k B : ℕ} (hkK : k ≤ K) (hB : 1 ≤ B) (hbudget : 2 ≤ K → Logic.PL.ClauseSet.Sparsification.countingBChoiceCoeff K ≤ M ∧ B * Logic.PL.ClauseSet.Sparsification.countingBChoiceCoeff K * Nat.clog 2 (4 * Logic.PL.ClauseSet.Sparsification.countingDepthCoeff K M * M) ≤ M) {g t : Logic.PL.CNF ℕ → ℕ} (hg : Turing.MultiTapeTM.ComputableInO g encCNF Turing.MultiTapeTM.encNat t t) (hg_le : ∀ (ψ : Logic.PL.CNF ℕ), (∀ c ∈ ψ, List.length c ≤ k) → Logic.PL.CNF.Sparsification.isSparse (Logic.PL.CNF.Sparsification.countingThreshold M) K ψ = true → g ψ ≤ 2 ^ ψ.numVars) {δ : ℝ} (hδ : 0 ≤ δ) {c e : ℕ} (ht : ∀ (ψ : Logic.PL.CNF ℕ), ↑(t ψ) ≤ ↑c * (2 ^ (δ * ↑(List.length ψ)) * (↑(encCNF ψ).length + 1) ^ e) + ↑c) :
∃ (T : Logic.PL.CNF ℕ → ℕ) (C₀ : ℕ) (E : ℕ), Turing.MultiTapeTM.ComputableInO (search M K k B g) encCNF Turing.MultiTapeTM.encNat T T ∧ ∀ (φ : Logic.PL.CNF ℕ), ↑(T φ) ≤ ↑C₀ * (2 ^ ((1 / ↑B + ↑(occBound K M) * δ) * ↑φ.numVars) * (↑(encCNF φ).length + 1) ^ E) + ↑C₀

Time and space of search under the integer parameter budget. Given a total leaf routine g with hg : ComputableInO g encCNF encNat t t satisfying the global bound ht (O(2 ^ (δ * ψ.length) * (|encCNF ψ| + 1) ^ e)) for every ψ : CNF ℕ and bounded by 2 ^ ψ.numVars on sparse width-≤ k formulas, search M K k B g has a combined time-and-space certificate ComputableInO (search M K k B g) encCNF encNat T T with fixed-parameter transfer bound T φ ≤ C₀ * (2 ^ ((1 / B + occBound K M * δ) * φ.numVars) * (|encCNF φ| + 1) ^ E) + C₀.

theorem Cslib.Complexity.CountingSparsify.exists_computableInO_search_countingThresholdBase {K : ℕ} (hK : 1 ≤ K) {k B : ℕ} (hkK : k ≤ K) (hB : 1 ≤ B) {g t : Logic.PL.CNF ℕ → ℕ} (hg : Turing.MultiTapeTM.ComputableInO g encCNF Turing.MultiTapeTM.encNat t t) (hg_le : ∀ (ψ : Logic.PL.CNF ℕ), (∀ c ∈ ψ, List.length c ≤ k) → Logic.PL.CNF.Sparsification.isSparse (Logic.PL.CNF.Sparsification.countingThreshold (Logic.PL.ClauseSet.Sparsification.countingThresholdBase K B)) K ψ = true → g ψ ≤ 2 ^ ψ.numVars) {δ : ℝ} (hδ : 0 ≤ δ) {c e : ℕ} (ht : ∀ (ψ : Logic.PL.CNF ℕ), ↑(t ψ) ≤ ↑c * (2 ^ (δ * ↑(List.length ψ)) * (↑(encCNF ψ).length + 1) ^ e) + ↑c) :

Unconditional time and space of search at countingThresholdBase K B.

theorem Cslib.Complexity.CountingSparsify.exists_computableInO_search_threeOccurrence_promise_of_budget {M K : ℕ} (hM : 1 ≤ M) (hK : 1 ≤ K) (hM2 : 2 ≤ M) {k B : ℕ} (hk2 : 2 ≤ k) (hkK : k ≤ K) (hB : 1 ≤ B) (hbudget : 2 ≤ K → Logic.PL.ClauseSet.Sparsification.countingBChoiceCoeff K ≤ M ∧ B * Logic.PL.ClauseSet.Sparsification.countingBChoiceCoeff K * Nat.clog 2 (4 * Logic.PL.ClauseSet.Sparsification.countingDepthCoeff K M * M) ≤ M) {f tf : Logic.PL.CNF ℕ → ℕ} (hf : Turing.MultiTapeTM.ComputableInO f encCNF Turing.MultiTapeTM.encNat tf tf) (hf_eq : ∀ (χ : Logic.PL.CNF ℕ), (∀ c ∈ χ, List.length c ≤ k) → (∀ (v : ℕ), List.count v χ.vars ≤ 3) → χ.vars.toFinset = Finset.range χ.numVars → f χ = χ.modelCount) {δ : ℝ} (hδ : 0 ≤ δ) {c e : ℕ} (ht : ∀ (χ : Logic.PL.CNF ℕ), (∀ c ∈ χ, List.length c ≤ k) → (∀ (v : ℕ), List.count v χ.vars ≤ 3) → χ.vars.toFinset = Finset.range χ.numVars → ↑(tf χ) ≤ ↑c * (2 ^ (δ * ↑χ.numVars) * (↑(encCNF χ).length + 1) ^ e) + ↑c) :
(∀ (φ : Logic.PL.CNF ℕ), (∀ c ∈ φ, List.length c ≤ k) → search M K k B (guardOccurrenceCounter k f) φ = φ.modelCount) ∧ ∃ (T : Logic.PL.CNF ℕ → ℕ) (C₀ : ℕ) (E : ℕ), Turing.MultiTapeTM.ComputableInO (search M K k B (guardOccurrenceCounter k f)) encCNF Turing.MultiTapeTM.encNat T T ∧ ∀ (φ : Logic.PL.CNF ℕ), ↑(T φ) ≤ ↑C₀ * (2 ^ ((1 / ↑B + ↑(occBound K M) * (↑k * δ)) * ↑φ.numVars) * (↑(encCNF φ).length + 1) ^ E) + ↑C₀

End-to-end counting sparsification from a dense 3-occurrence model counter under the integer parameter budget (promised runtime). Given 2 ≤ k ≤ K and a total model counter f : CNF ℕ → ℕ with a combined time-and-space certificate ComputableInO f encCNF encNat tf tf that on every dense formula χ of width ≤ k and variable occurrence ≤ 3 computes χ.modelCount and satisfies (tf χ : ℝ) ≤ c * (2 ^ (δ * χ.numVars) * (|encCNF χ| + 1) ^ e) + c, the search search M K k B (guardOccurrenceCounter k f) computes φ.modelCount on every formula φ of width ≤ k and has a combined time-and-space certificate with fixed-parameter transfer bound O(2 ^ ((1 / B + occBound K M * (k * δ)) * φ.numVars) * (|encCNF φ| + 1) ^ E).

theorem Cslib.Complexity.CountingSparsify.exists_computableInO_search_threeOccurrence_of_budget {M K : ℕ} (hM : 1 ≤ M) (hK : 1 ≤ K) (hM2 : 2 ≤ M) {k B : ℕ} (hk2 : 2 ≤ k) (hkK : k ≤ K) (hB : 1 ≤ B) (hbudget : 2 ≤ K → Logic.PL.ClauseSet.Sparsification.countingBChoiceCoeff K ≤ M ∧ B * Logic.PL.ClauseSet.Sparsification.countingBChoiceCoeff K * Nat.clog 2 (4 * Logic.PL.ClauseSet.Sparsification.countingDepthCoeff K M * M) ≤ M) {f tf : Logic.PL.CNF ℕ → ℕ} (hf : Turing.MultiTapeTM.ComputableInO f encCNF Turing.MultiTapeTM.encNat tf tf) (hf_eq : ∀ (χ : Logic.PL.CNF ℕ), (∀ c ∈ χ, List.length c ≤ k) → (∀ (v : ℕ), List.count v χ.vars ≤ 3) → χ.vars.toFinset = Finset.range χ.numVars → f χ = χ.modelCount) {δ : ℝ} (hδ : 0 ≤ δ) {c e : ℕ} (ht : ∀ (χ : Logic.PL.CNF ℕ), ↑(tf χ) ≤ ↑c * (2 ^ (δ * ↑χ.numVars) * (↑(encCNF χ).length + 1) ^ e) + ↑c) :
(∀ (φ : Logic.PL.CNF ℕ), (∀ c ∈ φ, List.length c ≤ k) → search M K k B (guardOccurrenceCounter k f) φ = φ.modelCount) ∧ ∃ (T : Logic.PL.CNF ℕ → ℕ) (C₀ : ℕ) (E : ℕ), Turing.MultiTapeTM.ComputableInO (search M K k B (guardOccurrenceCounter k f)) encCNF Turing.MultiTapeTM.encNat T T ∧ ∀ (φ : Logic.PL.CNF ℕ), ↑(T φ) ≤ ↑C₀ * (2 ^ ((1 / ↑B + ↑(occBound K M) * (↑k * δ)) * ↑φ.numVars) * (↑(encCNF φ).length + 1) ^ E) + ↑C₀

End-to-end counting sparsification from a dense 3-occurrence model counter under the integer parameter budget. Given 2 ≤ k ≤ K and a total model counter f : CNF ℕ → ℕ that computes χ.modelCount on every dense formula χ of width ≤ k and variable occurrence ≤ 3 and has a combined time-and-space certificate ComputableInO f encCNF encNat tf tf with global bound (tf χ : ℝ) ≤ c * (2 ^ (δ * χ.numVars) * (|encCNF χ| + 1) ^ e) + c, the search search M K k B (guardOccurrenceCounter k f) computes φ.modelCount on every formula φ of width ≤ k and has a combined time-and-space certificate with fixed-parameter transfer bound O(2 ^ ((1 / B + occBound K M * (k * δ)) * φ.numVars) * (|encCNF φ| + 1) ^ E).

theorem Cslib.Complexity.CountingSparsify.exists_computableInO_search_threeOccurrence_thresholdBase {K : ℕ} (hK : 1 ≤ K) {k B : ℕ} (hk2 : 2 ≤ k) (hkK : k ≤ K) (hB : 1 ≤ B) {f tf : Logic.PL.CNF ℕ → ℕ} (hf : Turing.MultiTapeTM.ComputableInO f encCNF Turing.MultiTapeTM.encNat tf tf) (hf_eq : ∀ (χ : Logic.PL.CNF ℕ), (∀ c ∈ χ, List.length c ≤ k) → (∀ (v : ℕ), List.count v χ.vars ≤ 3) → χ.vars.toFinset = Finset.range χ.numVars → f χ = χ.modelCount) {δ : ℝ} (hδ : 0 ≤ δ) {c e : ℕ} (ht : ∀ (χ : Logic.PL.CNF ℕ), (∀ c ∈ χ, List.length c ≤ k) → (∀ (v : ℕ), List.count v χ.vars ≤ 3) → χ.vars.toFinset = Finset.range χ.numVars → ↑(tf χ) ≤ ↑c * (2 ^ (δ * ↑χ.numVars) * (↑(encCNF χ).length + 1) ^ e) + ↑c) :

Unconditional end-to-end counting sparsification from a dense 3-occurrence model counter at countingThresholdBase K B (promised runtime).

theorem Cslib.Complexity.CountingSparsify.exists_computableInO_search_polySpace_countingThresholdBase {K : ℕ} (hK : 1 ≤ K) {k B : ℕ} (hkK : k ≤ K) (hB : 1 ≤ B) {g t s : Logic.PL.CNF ℕ → ℕ} (hg : Turing.MultiTapeTM.ComputableInO g encCNF Turing.MultiTapeTM.encNat t s) (hg_le : ∀ (ψ : Logic.PL.CNF ℕ), (∀ c ∈ ψ, List.length c ≤ k) → Logic.PL.CNF.Sparsification.isSparse (Logic.PL.CNF.Sparsification.countingThreshold (Logic.PL.ClauseSet.Sparsification.countingThresholdBase K B)) K ψ = true → g ψ ≤ 2 ^ ψ.numVars) {δ : ℝ} (hδ : 0 ≤ δ) {c e a b : ℕ} (ht : ∀ (ψ : Logic.PL.CNF ℕ), (∀ C ∈ ψ, List.length C ≤ k) → Logic.PL.CNF.Sparsification.isSparse (Logic.PL.CNF.Sparsification.countingThreshold (Logic.PL.ClauseSet.Sparsification.countingThresholdBase K B)) K ψ = true → ↑(t ψ) ≤ ↑c * (2 ^ (δ * ↑(List.length ψ)) * (↑(encCNF ψ).length + 1) ^ e) + ↑c) (hs : ∀ (ψ : Logic.PL.CNF ℕ), (∀ C ∈ ψ, List.length C ≤ k) → Logic.PL.CNF.Sparsification.isSparse (Logic.PL.CNF.Sparsification.countingThreshold (Logic.PL.ClauseSet.Sparsification.countingThresholdBase K B)) K ψ = true → s ψ ≤ a * ((encCNF ψ).length + 1) ^ b) :

Unconditional polynomial-workspace counting sparsification at countingThresholdBase K B.

theorem Cslib.Complexity.CountingSparsify.exists_computableInO_search_threeOccurrence_polySpace_thresholdBase {K : ℕ} (hK : 1 ≤ K) {k B : ℕ} (hk2 : 2 ≤ k) (hkK : k ≤ K) (hB : 1 ≤ B) {f tf sf : Logic.PL.CNF ℕ → ℕ} (hf : Turing.MultiTapeTM.ComputableInO f encCNF Turing.MultiTapeTM.encNat tf sf) (hf_eq : ∀ (χ : Logic.PL.CNF ℕ), (∀ c ∈ χ, List.length c ≤ k) → (∀ (v : ℕ), List.count v χ.vars ≤ 3) → χ.vars.toFinset = Finset.range χ.numVars → f χ = χ.modelCount) {δ : ℝ} (hδ : 0 ≤ δ) {c e a b : ℕ} (ht : ∀ (χ : Logic.PL.CNF ℕ), (∀ c ∈ χ, List.length c ≤ k) → (∀ (v : ℕ), List.count v χ.vars ≤ 3) → χ.vars.toFinset = Finset.range χ.numVars → ↑(tf χ) ≤ ↑c * (2 ^ (δ * ↑χ.numVars) * (↑(encCNF χ).length + 1) ^ e) + ↑c) (hs : ∀ (χ : Logic.PL.CNF ℕ), (∀ c ∈ χ, List.length c ≤ k) → (∀ (v : ℕ), List.count v χ.vars ≤ 3) → χ.vars.toFinset = Finset.range χ.numVars → sf χ ≤ a * ((encCNF χ).length + 1) ^ b) :

Unconditional polynomial-workspace counting sparsification from a dense 3-occurrence counter at countingThresholdBase K B.

Unconditional declared-variable correctness of searchDeclaredWith at countingThresholdBase K (BOf p).

theorem Cslib.Complexity.CountingSparsify.searchDeclaredWith_eq_modelCountOn_countingThresholdBase {K : ℕ} (hK : 1 ≤ K) {P : Type u_1} {NOf BOf : P → ℕ} {k : ℕ} (hkK : k ≤ K) {p : P} (hB : 1 ≤ BOf p) {g : P × Logic.PL.CNF ℕ → ℕ} (hg : ∀ (ψ : Logic.PL.CNF ℕ), (∀ c ∈ ψ, List.length c ≤ k) → Logic.PL.CNF.Sparsification.isSparse (Logic.PL.CNF.Sparsification.countingThreshold (Logic.PL.ClauseSet.Sparsification.countingThresholdBase K (BOf p))) K ψ = true → ψ.vars.toFinset ⊆ Finset.range (NOf p) → g (p, ψ) = ψ.modelCount) {φ : Logic.PL.CNF ℕ} (hw : ∀ c ∈ φ, List.length c ≤ k) (hsub : φ.vars.toFinset ⊆ Finset.range (NOf p)) :

Unconditional declared-variable correctness of searchDeclaredWith on valid inputs at countingThresholdBase K (BOf p).

Unconditional declared-variable correctness of searchDeclaredWith composed with normalizeDeclaredLeaf at countingThresholdBase K (BOf p).

Unconditional declared-variable correctness of searchDeclaredWith composed with normalizeDeclaredLeaf on valid inputs at countingThresholdBase K (BOf p).