Documentation

DescriptiveComplexity.Problems.NaeSat

NAE-SAT is NP-complete #

NOT-ALL-EQUAL SAT: is there a truth assignment giving every clause both a true and a false literal? It lives on the very same vocabulary as SAT, FirstOrder.Language.sat, and only its notion of satisfaction differs (DescriptiveComplexity.NAEProper), so this file adds a problem rather than a language.

NAE-SAT is the first of the Schaefer-style variants of satisfiability (Schaefer 1978) in the catalog. Their value is as reduction sources: their symmetry makes gadgets far more local than SAT's, which is what the classical reduction to Max Cut runs on.

The symmetry, and the fresh variable #

The defining feature is that DescriptiveComplexity.NAEProper is closed under flipping the assignment (DescriptiveComplexity.NAEProper.not): swapping true and false swaps the two conjuncts of the condition. That symmetry is exactly what the reduction from SAT exploits. Given a CNF formula, add one fresh variable s occurring positively in every clause; then a NAE-assignment can be normalized (by flipping, if needed) to one with s false, and once s is false the “some true literal” half is a satisfying assignment of the original formula.

“One fresh variable” is what makes this an ordered reduction (DescriptiveComplexity.sat_ordered_fo_reduction_naeSat, tag Bool, dimension 1): an interpretation adds elements only by tags, and a tag contributes a whole copy of the universe, so the single fresh variable has to be picked out inside its copy – as the minimum, via DescriptiveComplexity.minF. One fresh variable per clause would not do: with its own private s, every clause could be satisfied by choosing s opposite to one of its literals, and the reduction would be false.

Membership reuses SAT's kernel verbatim (DescriptiveComplexity.realize_satKernel): the NAE kernel is that one conjoined with its mirror image, the clause stating that every clause also has a false literal.

The problem #

An assignment is not-all-equal proper when every clause contains both a true and a false literal.

Equations
  • One or more equations did not get rendered due to their size.
Instances For
    Dependency graph
    theorem DescriptiveComplexity.NAEProper.not {A : Type} [FirstOrder.Language.sat.Structure A] {ν : AProp} (h : NAEProper ν) :
    NAEProper fun (x : A) => ¬ν x

    The defining symmetry: flipping a not-all-equal proper assignment gives a not-all-equal proper assignment, the two halves of the condition exchanging roles.

    Dependency graph
    theorem DescriptiveComplexity.litTrue_compl {A : Type} {ν : AProp} {x : A} {s : Bool} :
    SatOcc.LitTrue (fun (a : A) => ¬ν a) x s ¬SatOcc.LitTrue ν x s

    Flipping the assignment flips the truth of every literal.

    Dependency graph

    Occurrence form of not-all-equal properness: every clause has a true and a false literal occurrence.

    Dependency graph

    Not-all-equal properness from the occurrence form.

    Dependency graph

    A Language.sat-structure is not-all-equal satisfiable if some assignment gives every clause both a true and a false literal.

    Equations
    Instances For
      Dependency graph
      Dependency graph

      NAE-SAT, as a problem on CNF instances: is there an assignment giving every clause both a true and a false literal?

      Equations
      Instances For
        Dependency graph

        SAT reduces to NAE-SAT #

        @[reducible, inline]

        The “is a clause” symbol over the ordered expansion.

        Equations
        Instances For
          Dependency graph
          @[reducible, inline]

          The “occurs positively in” symbol over the ordered expansion.

          Equations
          Instances For
            Dependency graph
            @[reducible, inline]

            The “occurs negatively in” symbol over the ordered expansion.

            Equations
            Instances For
              Dependency graph

              The interpretation of SAT into NAE-SAT: keep the formula on the copy of tag true, and let the minimum of the copy of tag false be a fresh variable occurring positively in every clause.

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

                The copy of an element carrying the original formula.

                Equations
                Instances For
                  Dependency graph

                  The copy of an element carrying the fresh variable (only its minimum is used).

                  Equations
                  Instances For
                    Dependency graph
                    theorem DescriptiveComplexity.oPt_eta {A : Type} (w : Fin 1A) :
                    (true, w) = oPt (w 0)
                    Dependency graph
                    theorem DescriptiveComplexity.xPt_eta {A : Type} (w : Fin 1A) :
                    (false, w) = xPt (w 0)
                    Dependency graph
                    theorem DescriptiveComplexity.eq_oPt_or_xPt {A : Type} (p : naeInterp.Map A) :
                    (∃ (v : A), p = oPt v) ∃ (v : A), p = xPt v

                    Every element of the interpreted universe is a copy of an element.

                    Dependency graph
                    Dependency graph
                    Dependency graph
                    Dependency graph
                    Dependency graph
                    Dependency graph
                    Dependency graph
                    Dependency graph
                    Dependency graph

                    Correctness of the interpretation: a CNF formula is satisfiable iff the formula obtained by adding one fresh variable positively to every clause is not-all-equal satisfiable.

                    Dependency graph

                    SAT ordered-FO-reduces to NAE-SAT: add one fresh variable, the minimum of a spare copy of the universe, positively to every clause.

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

                      Membership #

                      The mirror of DescriptiveComplexity.satKernel: every clause contains a false literal. Together they say that no clause is all-equal.

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

                        The first-order kernel of the Σ₁ definition of NAE-SAT: SAT's kernel conjoined with its mirror image.

                        Equations
                        Instances For
                          Dependency graph

                          NAE-SAT is Σ₁-definable: guess the assignment, then check first-order that every clause has a true literal – SAT's kernel – and a false one.

                          Dependency graph

                          NP-completeness #

                          NAE-SAT is in NP: it is Σ₁-definable.

                          Dependency graph

                          NAE-SAT is NP-hard: SAT, which is NP-hard, ordered-FO-reduces to it.

                          Dependency graph

                          NAE-SAT is NP-complete, derived from the first-order reductions of this library and the Cook–Levin theorem.

                          Dependency graph