Documentation

DescriptiveComplexity.Problems.OneInSat.Reduction

3SAT ordered-FO-reduces to 1-in-SAT #

The classical gadget, with the width case analysis removed by the three slots of DescriptiveComplexity.Problems.OneInSat.Slots. Every clause c of the input gets

Since a slot is true exactly when the corresponding literal is (DescriptiveComplexity.OneInRed.exists_litTrue_iff_slot), the output is exactly-one satisfiable iff the input is satisfiable. Clauses of width 0, 1 and 2 need no special treatment: their missing slots are false, and an empty clause correctly yields an unsatisfiable gadget.

The whole construction is gated on the width check ThreeSatToSat.wideOrdF, as the reduction of 3SAT to SAT is: on a wide input every element becomes a clause with no literal at all, and a clause with no literal has no true literal, let alone exactly one. The order is used only to say i-th occurrence, so this is an ordered reduction; the dimension is 1, all the fresh variables being carried by tags.

Tags of the gadget: the copy of a variable, the three slots and four fresh variables of a clause, and its three link and three gadget clauses.

  • var : OITag

    The copy of a propositional variable.

  • slot (i : Ix3) : OITag

    The i-th slot variable of a clause.

  • fresh (j : Ix4) : OITag

    The j-th fresh variable of a clause.

  • piece (i : Ix3) : OITag

    The i-th gadget clause of a clause.

Instances For
    Equations
    Instances For
      @[instance_reducible]
      Equations
      • One or more equations did not get rendered due to their size.

      The pairs of tags joined by a positive literal, on the same element: the gadget clauses containing a fresh variable, and the second gadget clause containing its slot.

      Equations
      Instances For

        The pairs of tags joined by a negative literal, on the same element: the first and third gadget clauses contain their slot negatively, and so does every link clause.

        Equations
        Instances For

          The interpretation #

          The literal joining two tags on the same element, if there is one.

          Equations
          Instances For
            noncomputable def DescriptiveComplexity.OneInRed.linkLitF (t₁ t₂ : OITag) (s : Bool) :

            The literal of a link clause coming from the i-th occurrence of its clause, with sign s.

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

              Defining formula for “is a clause”: link and gadget clauses sit on the clauses of the input, and on a wide input everything is a clause.

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

                Defining formula for “occurs positively in”.

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

                  Defining formula for “occurs negatively in”.

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

                    The interpretation of 1-in-SAT instances in ordered CNF instances.

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

                      The vertices of the gadget #

                      The point of tag t over the element x.

                      Equations
                      Instances For
                        theorem DescriptiveComplexity.OneInRed.pt_eq_iff {A : Type} {t t' : OITag} {x x' : A} :
                        pt t x = pt t' x' t = t' x = x'
                        theorem DescriptiveComplexity.OneInRed.pt_eta {A : Type} {t : OITag} {w : Fin 1A} :
                        (t, w) = pt t (w 0)
                        theorem DescriptiveComplexity.OneInRed.pt_surj {A : Type} (q : oiInterp.Map A) :
                        ∃ (t : OITag) (x : A), q = pt t x

                        Characterization of the three relations #

                        theorem DescriptiveComplexity.OneInRed.posIn_pt {A : Type} [FirstOrder.Language.sat.Structure A] [LinearOrder A] (t₁ t₂ : OITag) (x y : A) :
                        SatOcc.PosIn (pt t₁ x) (pt t₂ y) ¬ThreeSatToSat.Wide A (posPair t₁ t₂ = true x = y ∃ (i : Ix3), (t₁ = OITag.link i t₂ = OITag.var) NthOcc i x y true)

                        The positive literals of the gadget.

                        theorem DescriptiveComplexity.OneInRed.negIn_pt {A : Type} [FirstOrder.Language.sat.Structure A] [LinearOrder A] (t₁ t₂ : OITag) (x y : A) :
                        SatOcc.NegIn (pt t₁ x) (pt t₂ y) ¬ThreeSatToSat.Wide A (negPair t₁ t₂ = true x = y ∃ (i : Ix3), (t₁ = OITag.link i t₂ = OITag.var) NthOcc i x y false)

                        The negative literals of the gadget.

                        The literals of a gadget clause #

                        theorem DescriptiveComplexity.OneInRed.occIn_pt_cases {A : Type} [FirstOrder.Language.sat.Structure A] [LinearOrder A] {tc : OITag} {c : A} {q : oiInterp.Map A} {u : Bool} (h : SatOcc.OccIn (pt tc c) q u) :
                        (∃ (t : OITag), (if u = true then posPair tc t else negPair tc t) = true q = pt t c) ∃ (i : Ix3) (y : A), tc = OITag.link i NthOcc i c y u q = pt OITag.var y

                        Every literal of a gadget clause is either prescribed by the pair of tags, on the same element, or is the copy of the i-th literal of the clause of a link clause.

                        The link and gadget clauses of a clause of the input are clauses.

                        theorem DescriptiveComplexity.OneInRed.occIn_same_pos {A : Type} [FirstOrder.Language.sat.Structure A] [LinearOrder A] {t₁ t₂ : OITag} {c : A} (hw : ¬ThreeSatToSat.Wide A) (ht : clauseTag t₁ = true) (hc : SatOcc.IsCl c) (hp : posPair t₁ t₂ = true) :
                        SatOcc.OccIn (pt t₁ c) (pt t₂ c) true

                        A same-element positive literal of a gadget clause.

                        theorem DescriptiveComplexity.OneInRed.occIn_same_neg {A : Type} [FirstOrder.Language.sat.Structure A] [LinearOrder A] {t₁ t₂ : OITag} {c : A} (hw : ¬ThreeSatToSat.Wide A) (ht : clauseTag t₁ = true) (hc : SatOcc.IsCl c) (hp : negPair t₁ t₂ = true) :
                        SatOcc.OccIn (pt t₁ c) (pt t₂ c) false

                        A same-element negative literal of a gadget clause.

                        The assignment carried by the gadget #

                        The assignment of the gadget induced by an assignment of the input: the slots take the values of the literals they link, and the four fresh variables of a clause are the explicit witnesses of the gadget.

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

                          Which tags carry which literals #

                          Correctness #

                          The literals of the i-th gadget clause of c.

                          theorem DescriptiveComplexity.OneInRed.oneInProper_oiAssign {A : Type} [FirstOrder.Language.sat.Structure A] [LinearOrder A] [Finite A] (hw : ¬ThreeSatToSat.Wide A) (hwidth : WidthAtMostThree A) {ν : AProp} ( : ∀ (c : A), SatOcc.IsCl c∃ (x : A) (s : Bool), SatOcc.OccIn c x s SatOcc.LitTrue ν x s) :

                          The gadget of a satisfiable input is exactly-one satisfiable.

                          theorem DescriptiveComplexity.OneInRed.litTrue_var_gen {A : Type} {μ : oiInterp.Map AProp} (x : A) (s : Bool) :
                          SatOcc.LitTrue (fun (z : A) => μ (pt OITag.var z)) x s SatOcc.LitTrue μ (pt OITag.var x) s
                          theorem DescriptiveComplexity.OneInRed.satisfiable_of_oneInProper {A : Type} [FirstOrder.Language.sat.Structure A] [LinearOrder A] (hw : ¬ThreeSatToSat.Wide A) {μ : oiInterp.Map AProp} ( : OneInProper μ) (c : A) (hc : SatOcc.IsCl c) :
                          ∃ (x : A) (s : Bool), SatOcc.OccIn c x s SatOcc.LitTrue (fun (z : A) => μ (pt OITag.var z)) x s

                          A gadget that is exactly-one satisfiable comes from a satisfiable input.

                          Correctness of the reduction: a CNF structure is a yes-instance of 3SAT iff its gadget is exactly-one satisfiable.

                          3SAT ordered-FO-reduces to 1-in-SAT: the three-slot gadget.

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