Documentation

CslibFrontier.Computability.Complexity.Problems.CSP.RotationSystem.VertexParity

Incidence parity in positional CSP coordinates #

Filtering the existing typed occurrence scan gives exactly a variable or constraint endpoint fiber. Its edge-bit sum is the original graph incidence parity, retaining all repeated positions.

theorem Cslib.Complexity.CSP.vertexParity_eq_sum_incidenceWord {Rel V : Type} [DecidableEq V] {F : Logic.PL.CSP Rel V} (x : Fin (incidenceGraph F).edges.length → Bool) (o : F.Occurrence) (word : List ℕ) (hn : word.Nodup) (hw : ∀ (i : ℕ), i ∈ word ↔ ∃ (p : F.Occurrence), incidenceEdgeIndex p = i ∧ p.var = o.var) :

Any exact duplicate-free word of occurrence indices at a variable computes its graph incidence parity. The edge bits are read by bounded finite-list lookup at those actual indices.

theorem Cslib.Complexity.CSP.sum_eq_false_of_vertexEven_word {Rel V : Type} [DecidableEq V] {F : Logic.PL.CSP Rel V} (x : Fin (incidenceGraph F).edges.length → Bool) (hx : (incidenceGraph F).VertexEven x) (word : List ℕ) (hn : word.Nodup) (label fallback : V) (hf : ∀ (i : ℕ), i ∈ word ↔ i < F.vars.length ∧ F.vars.getD i fallback = label) :
(List.map (fun (i : ℕ) => (List.ofFn x).getD i false) word).sum = false

Every exact variable-fiber word of a vertex-even labeling has zero sum. Empty fibers are included, without requiring that their label occurs in the body.

theorem Cslib.Complexity.CSP.vertexParity_incidenceDart {Rel V : Type} [DecidableEq V] {F : Logic.PL.CSP Rel V} (x : Fin (incidenceGraph F).edges.length → Bool) (o : F.Occurrence) (side : Bool) :
(incidenceGraph F).vertexParity x (incidenceDart o side).vertex = (List.map (fun (p : F.Occurrence) => x (incidenceDart p side).1) (List.filter (fun (p : F.Occurrence) => decide (if side = true then p.fst = o.fst else p.var = o.var)) F.incidenceList)).sum

The actual graph parity at an occurrence endpoint is the sum over its complete positional fiber. The two endpoint sides use original variable equality and constraint-index equality.