Basic digraph definitions #
General-purpose definitions on top of Mathlib's Digraph: directed walks
and simple paths, depth (longest walk length), IsAcyclic, the
edgeFinset of a digraph with decidable adjacency on a finite vertex
type, and deleteEdges.
Depth-reduction-specific machinery (canonical labeling, acyclicity
arguments, edge partitions by first-differing bit, etc.) lives in
Circ.Internal.Valiant.
G.IsDirectedPath p says that p : Fin m → V is a directed walk
in the digraph G: consecutive vertices are joined by an edge.
Instances For
G.IsSimplePath p says that p : Fin m → V is a simple directed
path: an injective directed walk.
Equations
- G.IsSimplePath p = (G.IsDirectedPath p ∧ Function.Injective p)
Instances For
The depth of a digraph is the length — number of nodes — of a
longest directed walk in it. Walks are not required to be injective,
so cyclic graphs have depth = 0 by the Nat.sSup convention on
unbounded sets.
Instances For
The directed edge set of a digraph with decidable adjacency on a finite vertex type.
Equations
- G.edgeFinset = {p : V × V | G.Adj p.1 p.2}
Instances For
Equations
The directed-walk set of G.deleteEdges ∅ agrees with that of G,
so the two graphs have the same depth.