Documentation

CslibFrontier.Computability.Complexity.FineGrained.CountingSparsificationUniform

Uniform resources for counting sparsification #

Resource composition for the existing captured-context search. The threshold and leaf machines are fixed before the runtime context and formula. The original occurring-support accumulator is retained; the declared-variable wrapper applies its final correction exactly once.

The polynomial numerical-depth premise is explicit. A short binary parameter encoding alone does not establish that premise. This module does not construct the leaf counter or establish the final subexponential counting endpoint of [OAI26k], Section 6.4 (pp. 43–44).

Main results #

References #

Compute the existing search clock with a runtime binary divisor. Saturating the divisor at the unary support size plus one preserves the quotient, so no unary exponential is produced.

Normalize one total declared-count leaf implementation. The intermediate declared count is charged explicitly in both resource bounds; semantic correctness still requires the support and counting promises of Cslib.Logic.PL.CNF.normalizeDeclaredLeaf_eq_modelCount.

theorem Cslib.Complexity.CountingSparsify.length_encNat_searchDeclaredWith_le {P : Type} {NOf MOf BOf : P → ℕ} {K k D : ℕ} {p : P} (hM : 1 ≤ MOf p) (hK : 1 ≤ K) (hM2 : 2 ≤ MOf p) (hkK : k ≤ K) (hTB : CountingTreeBound (MOf p) K (BOf p) D hM hK) (g : P × Logic.PL.CNF ℕ → ℕ) (φ : Logic.PL.CNF ℕ) :
(Turing.MultiTapeTM.encNat (searchDeclaredWith NOf MOf BOf K k g p φ)).length ≤ NOf p + 1

The declared wrapper's binary output fits in NOf p + 1 bits, even when the supplied leaf routine is only a diagnostic. The old accumulator cap and the support guard suffice.

theorem Cslib.Complexity.CountingSparsify.exists_computableInO_searchDeclaredWith {C : Type} {encC : C ↪ List Bool} {MOf BOf D : C × ℕ → ℕ} {K k : ℕ} (hB : Turing.MultiTapeTM.ComputableInPolyTime BOf (Turing.MultiTapeTM.encPair encC Turing.MultiTapeTM.encUnary) Turing.MultiTapeTM.encNat) (hθ : Turing.MultiTapeTM.ComputableInPolyTime (fun (x : (C × ℕ) × ℕ × ℕ) => decide (Logic.PL.CNF.Sparsification.countingThreshold (MOf x.1) x.2.1 ≤ x.2.2)) (Turing.MultiTapeTM.encPair (Turing.MultiTapeTM.encPair encC Turing.MultiTapeTM.encUnary) (Turing.MultiTapeTM.encPair Turing.MultiTapeTM.encUnary Turing.MultiTapeTM.encUnary)) Turing.MultiTapeTM.encBool) (hM : ∀ (p : C × ℕ), 1 ≤ MOf p) (hK : 1 ≤ K) (hM2 : ∀ (p : C × ℕ), 2 ≤ MOf p) (hkK : k ≤ K) (hTB : ∀ (p : C × ℕ), CountingTreeBound (MOf p) K (BOf p) (D p) ⋯ hK) (hD : Turing.MultiTapeTM.PolyBounded (fun (x : C × ℕ × Logic.PL.CNF ℕ) => ((Turing.MultiTapeTM.encPair encC (Turing.MultiTapeTM.encPair Turing.MultiTapeTM.encUnary encCNF)) x).length) fun (x : C × ℕ × Logic.PL.CNF ℕ) => D (x.1, x.2.1)) {g t s : (C × ℕ) × Logic.PL.CNF ℕ → ℕ} {R Q : C × ℕ × Logic.PL.CNF ℕ → ℕ} (hcounter : Turing.MultiTapeTM.ComputableInO g (Turing.MultiTapeTM.encPair (Turing.MultiTapeTM.encPair encC Turing.MultiTapeTM.encUnary) encCNF) Turing.MultiTapeTM.encNat t s) (hg : ∀ (x : C × ℕ × Logic.PL.CNF ℕ), Logic.PL.CNF.validDeclaredInput k x.2.1 x.2.2 = true → ∀ i ≤ Sparsify.rounds (BOf (x.1, x.2.1)) x.2.2, have p := (x.1, x.2.1); have st := (step (MOf p) K fun (ψ : Logic.PL.CNF ℕ) => g (p, ψ))^[i] (init k x.2.2); st.2.1.isEmpty = false ∧ Logic.PL.CNF.Sparsification.isSparse (Logic.PL.CNF.Sparsification.countingThreshold (MOf p)) K (st.2.1.headD []) = true → g (p, st.2.1.headD []) ≤ 2 ^ (st.2.1.headD []).numVars) (ht : ∀ (x : C × ℕ × Logic.PL.CNF ℕ), Logic.PL.CNF.validDeclaredInput k x.2.1 x.2.2 = true → ∀ i ≤ Sparsify.rounds (BOf (x.1, x.2.1)) x.2.2, have p := (x.1, x.2.1); have st := (step (MOf p) K fun (ψ : Logic.PL.CNF ℕ) => g (p, ψ))^[i] (init k x.2.2); st.2.1.isEmpty = false ∧ Logic.PL.CNF.Sparsification.isSparse (Logic.PL.CNF.Sparsification.countingThreshold (MOf p)) K (st.2.1.headD []) = true → t (p, st.2.1.headD []) ≤ R x) (hs : ∀ (x : C × ℕ × Logic.PL.CNF ℕ), Logic.PL.CNF.validDeclaredInput k x.2.1 x.2.2 = true → ∀ i ≤ Sparsify.rounds (BOf (x.1, x.2.1)) x.2.2, have p := (x.1, x.2.1); have st := (step (MOf p) K fun (ψ : Logic.PL.CNF ℕ) => g (p, ψ))^[i] (init k x.2.2); st.2.1.isEmpty = false ∧ Logic.PL.CNF.Sparsification.isSparse (Logic.PL.CNF.Sparsification.countingThreshold (MOf p)) K (st.2.1.headD []) = true → s (p, st.2.1.headD []) ≤ Q x) :

Independent resources for the existing declared-variable search on one full runtime input. The threshold-comparison and leaf certificates precede every input (context, N, formula); N is encoded in unary. The numerical depth envelope is polynomial in that complete encoded input, and the leaf promises concern every active prefix i ≤ rounds, including the terminal prefix. The original occurring-support state and cap are unchanged.

The time bound charges a polynomial in the encoded input and, on valid inputs, the round count times a per-step allowance. The workspace bound contains the independent leaf-workspace allowance and a polynomial for initialization, retained context, all prefix states, binary clock, leaf output and final declared-variable scaling. It has no factor of the number of rounds or the leaf time, and is polynomial if the leaf-workspace allowance is polynomial. Any prior preparation of a larger context must be composed separately and charged against its own original external input.