Documentation

CslibFrontier.Computability.PCP.Encoded.Count

Counting violated edges of an executable constraint graph #

The edge list counts occurrences, including loops and parallel edges. These identities connect its executable Boolean tests to the finite-edge semantics used by ConstraintGraph.unsatVal.

Main results #

theorem Cslib.PCP.Encoded.Graph.card_unsatEdges_toGraph {C α : Type} (g : Graph C) (eval : C → α → α → Bool) (σ : ℕ → α) :
((g.toGraph eval).unsatEdges σ).card = List.countP (fun (d : Edge C) => !eval d.constraint (σ d.src) (σ d.dst)) g.edges

Violated edge occurrences counted along the stored edge list.

theorem Cslib.PCP.Encoded.Graph.unsatFrac_toGraph {C α : Type} (g : Graph C) (eval : C → α → α → Bool) (σ : ℕ → α) :
(g.toGraph eval).unsatFrac σ = ↑(List.countP (fun (d : Edge C) => !eval d.constraint (σ d.src) (σ d.dst)) g.edges) / ↑g.edges.length

The semantic violated fraction is the executable count divided by the edge-list length.