Documentation

DescriptiveComplexity.Problems.Sat.CountingHardness

#SAT is parsimoniously #P-complete #

The counting form of the Cook–Levin theorem: every #P-definable counting problem reduces to DescriptiveComplexity.SharpSAT by an ordered parsimonious reduction (DescriptiveComplexity.sharpSat_parsimoniousHard_of_sharpPDefinable), so #SAT is parsimoniously #P-complete (DescriptiveComplexity.sharpSat_sharpP_parsimoniousComplete).

The reduction is the Tseitin interpretation of DescriptiveComplexity.Problems.Sat.Hardness, and the reason it preserves the number of solutions is the classical one: the gate variables of a Tseitin encoding are functionally determined by the input variables (DescriptiveComplexity.Tseitin.gates_unique), and every variable of the encoding sits at a canonically padded tuple (DescriptiveComplexity.Tseitin.litSem_varCanon), so a model of the encoding is exactly an assignment of the block satisfying the kernel.

One thing has to be added to the decision reduction. A block variable at a tuple that the kernel never mentions occurs in no clause of the encoding, so it is not a variable of the CNF formula, while the witness count ranges over all assignments of the block. The interpretation DescriptiveComplexity.sharpTseitinInterp therefore adds one tautological clause R(ā) ∨ ¬R(ā) per block variable and tuple, which makes each of them occur without constraining anything.

@[reducible, inline]

The tags of the parsimonious Tseitin interpretation: those of the Tseitin interpretation, and one tautological clause per block variable.

Equations
Instances For
    Dependency graph

    The defining formula of satPosIn (s = true) and satNegIn (s = false): the literals of the Tseitin interpretation, and the block variable i at the tuple of its tautological clause, with both signs.

    Equations
    Instances For
      Dependency graph

      The parsimonious Tseitin interpretation: the CNF instance of the Tseitin encoding of φ, with one tautological clause per block variable and canonically padded tuple.

      Equations
      • One or more equations did not get rendered due to their size.
      Instances For
        Dependency graph

        The points of the interpreted instance #

        A point of the Tseitin instance, as a point of the parsimonious one.

        Equations
        Instances For
          Dependency graph
          def DescriptiveComplexity.tseitinVarPt {L : FirstOrder.Language} {B : SOBlock} {φ : (L.sum B.lang).Sentence} {A : Type} (vt : B.ι ⊕ (m : ℕ) × Tseitin.NodeAt φ m) (x : Fin (tseitinDim B φ) → A) :

          The propositional variable indexed by vt at the tuple x, as a point of the Tseitin instance.

          Equations
          Instances For
            Dependency graph

            Characterization of the interpreted relations #

            Models of the interpreted instance are assignments of the block #

            theorem DescriptiveComplexity.sharp_occurs_canon {L : FirstOrder.Language} {B : SOBlock} {φ : (L.sum B.lang).Sentence} {A : Type} [L.Structure A] [LinearOrder A] {e : (sharpTseitinInterp B φ).Map A} (he : SatOccurs ((sharpTseitinInterp B φ).Map A) e) :
            ∃ (vt : B.ι ⊕ (m : ℕ) × Tseitin.NodeAt φ m) (x : Fin (tseitinDim B φ) → A), e = sharpOldPt (tseitinVarPt vt x) ∧ Tseitin.VarCanon vt x

            Variables of the interpreted instance: an element occurring in a clause is a propositional variable of the encoding at a tuple canonical for it.

            Dependency graph
            theorem DescriptiveComplexity.sharp_occurs_block {L : FirstOrder.Language} {B : SOBlock} {φ : (L.sum B.lang).Sentence} {A : Type} [L.Structure A] [LinearOrder A] (i : B.ι) {u : Fin (tseitinDim B φ) → A} (hu : Canon (B.arity i) u) :

            Every block variable at a canonically padded tuple is a variable of the interpreted instance: it occurs in its tautological clause.

            Dependency graph

            The truth assignment of the interpreted instance determined by an assignment of the block, before its restriction to the variables of the instance.

            Equations
            Instances For
              Dependency graph
              theorem DescriptiveComplexity.sharpVal_varPt {L : FirstOrder.Language} {B : SOBlock} {φ : (L.sum B.lang).Sentence} {A : Type} [L.Structure A] (μ : B.Assignment A) (vt : B.ι ⊕ (m : ℕ) × Tseitin.NodeAt φ m) (x : Fin (tseitinDim B φ) → A) :
              sharpVal μ (sharpOldPt (tseitinVarPt vt x)) ↔ tseitinVal B φ μ vt x
              Dependency graph
              Dependency graph

              The truth assignment determined by an assignment of the block realizing the kernel satisfies every clause of the parsimonious instance.

              Dependency graph
              noncomputable def DescriptiveComplexity.sharpModelEquiv {L : FirstOrder.Language} (B : SOBlock) (φ : (L.sum B.lang).Sentence) (A : Type) [L.Structure A] [LinearOrder A] {a₀ : A} (ha₀ : IsBot a₀) :

              Models of the interpreted instance are the assignments of the block realizing the kernel, bijectively: a model induces a block assignment through canonical padding, and is recovered from it because gates determine the position variables and every variable of the instance sits at a canonical tuple.

              Equations
              • One or more equations did not get rendered due to their size.
              Instances For
                Dependency graph

                Correctness of the reduction #

                Correctness of the parsimonious Tseitin interpretation: the interpreted CNF instance has as many models as the kernel has witnesses.

                Dependency graph

                The counting Cook–Levin theorem #

                The vocabulary map identifying the two order symbols of a doubly ordered expansion. The kernel of a #P definition reads the order of the instance as part of its vocabulary, and the Tseitin interpretation reads it again to pad its tuples; both are the one order of the instance.

                Equations
                Instances For
                  Dependency graph
                  Dependency graph

                  The generic parsimonious Tseitin reduction: an ordered parsimonious reduction to #SAT from any counting problem that counts, on nonempty finite ordered structures, the witnesses of an existential second-order sentence.

                  Equations
                  • One or more equations did not get rendered due to their size.
                  Instances For
                    Dependency graph

                    The hardness half of the counting Cook–Levin theorem: every #P-definable counting problem admits an ordered parsimonious reduction to #SAT.

                    Dependency graph
                    Dependency graph

                    #SAT is parsimoniously #P-complete: the counting form of the Cook–Levin theorem (Valiant 1979). Membership is DescriptiveComplexity.sharpSat_mem_sharpP; hardness is the generic parsimonious Tseitin reduction DescriptiveComplexity.sharpTseitinReduction. Registered in the Lax archive as Lax366625.SharpSatComplete.sharpSat_sharpP_parsimoniousComplete.

                    Dependency graph

                    SharpSAT is #P-complete: parsimoniously, hence under subtractive reductions.

                    Dependency graph