Documentation

Complexity.Logics.Propositional.CNF.Planar.PairedWire

Paired implication wires #

Each cell has two lanes, each with an entry and an exit. Local constraints must equate all four port values. Across a gap, lane zero implies the next entry from the previous exit; lane one implies the previous exit from the next entry. These implications use separate ports. Under the local equalities, they force the representative values of consecutive cells to agree. Thus every port of a nonempty wire has the value of its first lane-zero entry.

This module uses ordinary CNF semantics. It supplies no local cell constraints or geometry. The two clauses and four literal positions per gap are counted with multiplicity, without distinctness assumptions on the port variables.

Main definitions #

Main results #

References #

The paired-port composition and equality argument are original.

@[reducible, inline]

Two lanes of entry/exit variables. Lane zero's entry represents the cell's value.

Instances For
    def Cslib.Logic.PL.CNF.PairedWire.Cell.Agree {V : Type u_1} (cell : Cell V) (σ : V → Bool) :

    All four port values agree with the lane-zero entry. Local cell constraints must provide this property; the wire clauses alone do not impose it.

    Instances For
      def Cslib.Logic.PL.CNF.PairedWire.gapClauses {V : Type u_1} (previous next : Cell V) :
      CNF V

      Across one gap, lane zero points forward and lane one points backward.

      Instances For
        theorem Cslib.Logic.PL.CNF.PairedWire.eval_gapClauses_iff {V : Type u_1} (σ : V → Bool) (previous next : Cell V) (hp : previous.Agree σ) (hn : next.Agree σ) :
        eval σ (gapClauses previous next) = true ↔ σ (previous 0).fst = σ (next 0).fst

        With local agreement, the two implications equate the neighboring cell values.

        theorem Cslib.Logic.PL.CNF.PairedWire.agree_head {V : Type u_1} (σ : V → Bool) (first : Cell V) (rest : List (Cell V)) (hcells : ∀ (c : Cell V), c ∈ first :: rest → c.Agree σ) (hlinks : eval σ (links (first :: rest)) = true) (c : Cell V) :
        c ∈ first :: rest → ∀ (lane : Fin 2), σ (c lane).fst = σ (first 0).fst ∧ σ (c lane).snd = σ (first 0).fst

        Under local agreement and satisfied links, all entries and exits have the value of the first lane-zero entry, including for a singleton wire.

        theorem Cslib.Logic.PL.CNF.PairedWire.agree_head_of_ne_nil {V : Type u_1} (σ : V → Bool) (fallback : Cell V) (cells : List (Cell V)) (hne : cells ≠ []) (hcells : ∀ (c : Cell V), c ∈ cells → c.Agree σ) (hlinks : eval σ (links cells) = true) (c : Cell V) :
        c ∈ cells → ∀ (lane : Fin 2), σ (c lane).fst = σ (cells.headD fallback 0).fst ∧ σ (c lane).snd = σ (cells.headD fallback 0).fst

        The head-agreement rule for a list with an explicit nonemptiness hypothesis. The fallback only makes headD total and does not affect the result.

        theorem Cslib.Logic.PL.CNF.PairedWire.length_gapClauses {V : Type u_1} (previous next : Cell V) :
        List.length (gapClauses previous next) = 2

        There are exactly two clauses per gap.

        theorem Cslib.Logic.PL.CNF.PairedWire.length_of_mem_gapClauses {V : Type u_1} (previous next : Cell V) {c : Clause V} (hc : c ∈ gapClauses previous next) :

        Each gap clause is binary, even if some port variables coincide.

        theorem Cslib.Logic.PL.CNF.PairedWire.length_vars_gapClauses {V : Type u_1} (previous next : Cell V) :
        (gapClauses previous next).vars.length = 4

        A gap contributes four literal positions, counted with multiplicity.