Documentation

Complexity.Logics.Propositional.ClauseSet.Sparsification.CountingList

Counting sparsification on CNF formulas #

List-level operations for the counting sparsification refinement of Appendix A.1 [OAI26c]: tautology removal (removeTautologies), nontautological normalization (countingNormalize), singleton negated-heart unit clauses (negatedHeartUnits), the disjoint counting children (countingChild), and one deterministic counting-sparsification step (countingNext).

Initial preprocessing (countingNormalize φ = normalize (removeTautologies φ)) removes tautologies, deduplicates literals and clauses, and reduces to a subset-minimal antichain. At each branching step on a heavy heart H satisfying deg_c(H) ≥ θ_{c - |H|} (equation (A.1), p. 44, with the unnumbered threshold schedule θ j = M ^ j), the false (A) branch adds H while the true (B) branch adds both the petals petals ψ c H and the singleton negated-heart units negatedHeartUnits H [OpenAI2026ETH, Appendix A.1, equation (A.2), pp. 44–45]. Applying dedupClauses before reduce restores the duplicate-free antichain (CountingNormalized) across steps without re-running tautology removal, while computing the exact clause-set operation ClauseSet.Sparsification.countingChild (toClauseSet_countingChild) and conserving the declared-variable model count (modelCountOn_countingChild).

Main definitions #

Main results #

References #

Tautology removal and counting normalization #

Whether a clause contains both a literal and its negation.

Instances For

    Remove tautological clauses from a CNF formula.

    Instances For

      Bring a formula into nontautological normal form: remove tautological clauses, deduplicate literals and clauses, and reduce by strict subset containment.

      Instances For

        Singleton clauses [-l] for each literal l of a heart H.

        Instances For
          def Cslib.Logic.PL.CNF.Sparsification.countingIntro {V : Type u_1} [DecidableEq V] (ψ : CNF V) (c : ℕ) (H : Clause V) (b : Bool) :
          CNF V

          The clauses introduced by a counting-sparsification branch: the heart (false) or the petals together with the singleton negated-heart units (true).

          Instances For
            def Cslib.Logic.PL.CNF.Sparsification.countingChild {V : Type u_1} [DecidableEq V] (ψ : CNF V) (c : ℕ) (H : Clause V) (b : Bool) :
            CNF V

            A counting child of a branching node: append the introduced clauses, deduplicate clauses with identical literal sets, and reduce by strict subset containment.

            Instances For
              def Cslib.Logic.PL.CNF.Sparsification.countingNext {V : Type u_1} [DecidableEq V] (θ : ℕ → ℕ) (k : ℕ) (ψ : CNF V) (b : Bool) :
              CNF V

              One deterministic counting-sparsification step using the computed choice choice θ k ψ.

              Instances For

                The counting-sparsification threshold schedule θ j = M ^ j (defined on p. 44 of [OpenAI2026ETH, Appendix A.1] for 0 ≤ j < k, extended here to a total function on ℕ, and used in the heavy-heart branching inequality deg_c(H) ≥ θ_{c - |H|} of equation (A.1)).

                Instances For

                  For 1 ≤ M, every counting threshold is positive.

                  Nontautological normal form #

                  A CNF formula is nontautological if no clause contains both a literal and its negation.

                  Instances For

                    The normal form for list-level counting sparsification at width k: Normalized k ψ together with Nontautological ψ.

                    Instances For

                      Any tautological clause evaluates to true under every assignment.

                      @[simp]

                      Removing tautological clauses preserves evaluation under every assignment.

                      @[simp]

                      Removing tautological clauses preserves the declared-variable model count.

                      The clause set of countingNormalize φ has the same satisfying assignments as φ.

                      @[simp]

                      countingNormalize φ evaluates identically to φ under every assignment.

                      @[simp]

                      countingNormalize φ preserves the declared-variable model count.

                      Every clause of countingNormalize φ has the literals of a nontautological clause of φ.

                      The number of clauses of countingNormalize φ is at most that of φ.

                      Every variable occurring in countingNormalize φ occurs in φ.

                      Every formula of width k is brought into nontautological normal form by countingNormalize.

                      Agreement with clause-set counting operations #

                      The list-level counting children compute the clause-set counting children.

                      The clause set of countingNext θ k ψ b equals the clause-set counting child for the computed choice.

                      theorem Cslib.Logic.PL.CNF.Sparsification.modelCountOn_countingChild {V : Type u_1} [DecidableEq V] {ψ : CNF V} (hnd : ∀ C ∈ ψ, List.Nodup C) (c : ℕ) (H : Clause V) (declared : Finset V) :
                      ψ.modelCountOn declared = (countingChild ψ c H false).modelCountOn declared + (countingChild ψ c H true).modelCountOn declared

                      Additive model-count conservation for countingChild. On any formula ψ without repeated literals in its clauses, the declared-variable model count equals the sum of the counts of its two counting children.

                      theorem Cslib.Logic.PL.CNF.Sparsification.modelCountOn_countingNext {V : Type u_1} [DecidableEq V] {θ : ℕ → ℕ} {k : ℕ} {ψ : CNF V} (h : Normalized k ψ) (declared : Finset V) :
                      ψ.modelCountOn declared = (countingNext θ k ψ false).modelCountOn declared + (countingNext θ k ψ true).modelCountOn declared

                      Additive model-count conservation for countingNext. On any k-normalized formula ψ, one deterministic counting-sparsification step splits the declared-variable model count additively across its false and true branches.

                      Preservation of normal form under the counting step #

                      theorem Cslib.Logic.PL.CNF.Sparsification.countingNormalized_countingChild {V : Type u_1} [DecidableEq V] {k : ℕ} {ψ : CNF V} (hk : 1 ≤ k) (h : CountingNormalized k ψ) {c : ℕ} {H : Clause V} (hH_nodup : List.Nodup H) (hH_len : List.length H ≤ k) (hH_nontaut : ∀ l ∈ H, Std.Sat.Literal.negate l ∉ H) (b : Bool) :

                      The counting children preserve CountingNormalized k whenever 1 ≤ k and the heart H is a duplicate-free nontautological clause of width at most k.

                      theorem Cslib.Logic.PL.CNF.Sparsification.countingNormalized_countingNext {V : Type u_1} [DecidableEq V] (θ : ℕ → ℕ) {k : ℕ} (hk : 1 ≤ k) {ψ : CNF V} (h : CountingNormalized k ψ) (b : Bool) :

                      One counting-sparsification step preserves CountingNormalized k.

                      theorem Cslib.Logic.PL.CNF.Sparsification.support_countingChild {V : Type u_1} [DecidableEq V] {ψ : CNF V} {c : ℕ} {H : Clause V} {declared : Finset V} (hψ : ∀ C ∈ ψ, ∀ l ∈ C, l.1 ∈ declared) (hH : ∀ l ∈ H, l.1 ∈ declared) (b : Bool) (C : Clause V) :
                      C ∈ countingChild ψ c H b → ∀ l ∈ C, l.1 ∈ declared

                      Every literal occurring in countingChild ψ c H b occurs in ψ or has its variable in H.

                      theorem Cslib.Logic.PL.CNF.Sparsification.support_countingNext {V : Type u_1} [DecidableEq V] (θ : ℕ → ℕ) (k : ℕ) {ψ : CNF V} {declared : Finset V} (hψ : ∀ C ∈ ψ, ∀ l ∈ C, l.1 ∈ declared) (b : Bool) (C : Clause V) :
                      C ∈ countingNext θ k ψ b → ∀ l ∈ C, l.1 ∈ declared

                      Every literal occurring in countingNext θ k ψ b has its variable in declared whenever ψ does.