Documentation

Complexitylib.SAT.Rename

Variable renaming and satisfiability transport #

Renaming the variables of a CNF along an injective map preserves satisfiability. This justifies re-indexing the Cook–Levin tableau variables from the Nat.pair-based scheme (convenient for injectivity bookkeeping in the correctness proof) to a flat mixed-radix scheme computable by a Turing machine with unary multiplication and addition only — the form the reduction machine actually emits (docs/A5-ReductionEmitter.md).

Main definitions #

Main results #

def Complexity.SAT.Lit.mapVar (f : ) ( : Lit) :

Rename a literal's variable along f.

Equations
Instances For

    Rename every variable of a clause along f.

    Equations
    Instances For
      def Complexity.SAT.CNF.mapVar (f : ) (φ : CNF) :

      Rename every variable of a CNF along f.

      Equations
      Instances For
        @[simp]

        Renaming the empty CNF yields the empty CNF.

        theorem Complexity.SAT.CNF.mapVar_cons (f : ) (c : Clause) (φ : CNF) :
        mapVar f (c :: φ) = Clause.mapVar f c :: mapVar f φ

        Renaming distributes over cons: rename the head clause and the tail CNF.

        theorem Complexity.SAT.CNF.mapVar_append (f : ) (φ ψ : CNF) :
        mapVar f (φ ++ ψ) = mapVar f φ ++ mapVar f ψ

        Renaming distributes over CNF concatenation.

        Out-of-range variables read false.

        Tabulate the first M values of a Boolean function as an assignment.

        Equations
        Instances For
          @[simp]

          The tabulated assignment Assignment.ofFn M g has length M.

          theorem Complexity.SAT.Assignment.ofFn_get {M v : } (g : Bool) (h : v < M) :
          (ofFn M g).get v = g v

          Reading Assignment.ofFn M g at an in-range variable v < M returns g v.

          theorem Complexity.SAT.Clause.eval_mapVar_eq (α β : Assignment) (f : ) (c : Clause) (h : c, α.get (f .var) = β.get .var) :
          eval α (mapVar f c) = eval β c

          Clause evaluation commutes with renaming, given assignments that agree pointwise (through f) on the clause's variables.

          theorem Complexity.SAT.CNF.eval_mapVar_eq (α β : Assignment) (f : ) (φ : CNF) (h : cφ, c, α.get (f .var) = β.get .var) :
          eval α (mapVar f φ) = eval β φ

          CNF evaluation commutes with renaming, given assignments that agree pointwise (through f) on the formula's variables.

          Renaming preserves satisfiability, forward direction: push the satisfying assignment along the (injective) renaming.

          Renaming reflects satisfiability, backward direction: pull the satisfying assignment back through the renaming (no injectivity needed).

          Satisfiability is invariant under injective variable renaming.