Circuit dependency graphs #
This module exposes the circuit DAG as a finite directed graph. Vertices are primary inputs, internal gates, and output gates. Edges point from each referenced wire to the gate that reads it.
Main results #
Circuit.dependencyGraph_adj_val_lt-- every edge follows the circuit's canonical index order.Circuit.dependencyGraph_isAcyclic-- the dependency graph is acyclic.Circuit.dependencyGraph_edge_card_le_totalFanIn-- distinct edges are bounded by total fan-in.
theorem
Complexity.Circuit.dependencyGraph_edge_card_le_totalFanIn
{B : Basis}
{N M G : ℕ}
[NeZero N]
[NeZero M]
(c : Circuit B N M G)
:
The number of distinct dependency edges is at most total fan-in.
The inequality can be strict because multiple inputs of one gate may read the same wire, while a digraph stores only one copy of an edge.