Documentation

CslibFrontier.Computability.Complexity.Problems.Graph.RotationSystem.VertexParityWords

Incidence parity from exact dart words #

A duplicate-free word listing precisely one vertex's indexed darts computes its existing incidence parity. Repeated edge records and the two ends of a loop remain separate darts.

Incidence parity needs to be checked only at actual indexed dart endpoints. Every other name, including isolated or undeclared names, has an empty incidence sum.

theorem Cslib.Complexity.Graph.vertexParity_eq_sum_word {G : Graph} (x : Fin G.edges.length → Bool) (v : ℕ) (word : List G.Dart) (hn : word.Nodup) (hw : ∀ (d : G.Dart), d ∈ word ↔ d.vertex = v) :
G.vertexParity x v = (List.map (fun (d : G.Dart) => x d.1) word).sum

Compute actual incidence parity from any exact duplicate-free vertex word. Empty words compute zero, including undeclared or isolated names.