Documentation

Complexity.Logics.Propositional.CNF.ExactOne.Blocks

Exact block indexing for positive clause replacements #

The positive compiler numbers auxiliaries by the position of their signed source clause. When signed clauses are themselves emitted in blocks, local drawings use local clause indices. Shifting those indices by the preceding signed block lengths gives exactly the original compiler's formula, including its variable names and clause order.

Main definitions #

Main results #

References #

These are original indexing identities for the two local compilers.

Add the signed-clause offset to new positive auxiliaries, fixing source variables.

Instances For

    Compile a signed formula whose first clause has the given global index.

    Instances For
      theorem Cslib.Logic.PL.CNF.PositiveExactOne.positiveLiteral_shift {V : Type u_1} (offset i j : ℕ) (l : Literal V) :
      (shift offset (positiveLiteral i j l).1, (positiveLiteral i j l).2) = positiveLiteral (offset + i) j l

      Shifting preserves the source role of every terminal and shifts each private slot.

      theorem Cslib.Logic.PL.CNF.PositiveExactOne.complementBlock_shift {V : Type u_1} (offset i j : ℕ) (l : Literal V) :
      relabel (shift offset) (complementBlock i j l) = complementBlock (offset + i) j l

      A complement block is equivariant under shifting its signed-clause index.

      theorem Cslib.Logic.PL.CNF.PositiveExactOne.clauseClauses_shift {V : Type u_1} (offset i : ℕ) (c : Clause V) :
      relabel (shift offset) (clauseClauses i c) = clauseClauses (offset + i) c

      The entire local clause replacement shifts to its actual global clause index.

      theorem Cslib.Logic.PL.CNF.PositiveExactOne.formulaFrom_eq_relabel {V : Type u_1} (start : ℕ) (φ : CNF V) :
      formulaFrom start φ = relabel (shift start) (formula φ)

      Starting a compiler at a nonzero index renames just its fresh auxiliaries.

      theorem Cslib.Logic.PL.CNF.PositiveExactOne.formulaFrom_append {V : Type u_1} (start : ℕ) (φ ψ : CNF V) :
      formulaFrom start (φ ++ ψ) = formulaFrom start φ ++ formulaFrom (start + List.length φ) ψ

      Compiling a concatenation gives the second part its exact signed-clause offset.

      Compile consecutive signed blocks with their true cumulative signed-clause offsets.

      Instances For

        Number of signed clauses before one block.

        Instances For
          theorem Cslib.Logic.PL.CNF.PositiveExactOne.compileBlocks_eq_flatMap {V : Type u_1} (start : ℕ) (bs : List (CNF V)) :
          compileBlocks start bs = List.flatMap (fun (b : CNF V × ℕ) => relabel (shift (start + blockOffset bs b.2)) (formula b.1)) bs.zipIdx

          The recursive partition is also an indexed concatenation with explicit prefix offsets.

          The blockwise compiler is exactly the indexed compiler on the flattened signed input.

          Exact formula and fresh-variable names for the block partition at index zero.

          The actual positive formula is the concatenation of locally compiled source-clause profiles, with outer auxiliaries shifted by signed-block lengths.

          The actual signed-clause offset of the replacement of original clause i.

          Instances For

            Exact original-clause partition, in source order, with actual global auxiliary names.