CausalGraph: Bare Directed Graph over a Vertex Type (V2) #
A CausalGraph V is the underlying DAG topology of a structural causal
model: just parents : V → Finset V. No mechanisms, no value types, no
acyclicity hypothesis (that lives in Graph/Basic.lean as the IsDAG mixin).
This separation mirrors mathlib's Mathlib/Combinatorics/Digraph/Basic.lean
(structure Digraph V where adj : V → V → Prop) but uses Finset V parents
because Pearl SEM API consumes parent enumerations directly (mechanisms
fold over parents v).
A directed graph over V represented by parent finsets. The graph
structure is value-type-agnostic: mechanisms and values layer on top
via Mechanism and Valuation.
- parents : V → Finset V
The set of parents of each vertex.
Instances For
The empty graph: every vertex is a root.
Equations
- Core.Causal.CausalGraph.empty = { parents := fun (x : V) => ∅ }
Instances For
Equations
- Core.Causal.CausalGraph.instInhabited = { default := Core.Causal.CausalGraph.empty }
A vertex is a root iff it has no parents.
Instances For
The children of a vertex: vertices u for which v ∈ parents u.
Requires [DecidableEq V] [Fintype V] to enumerate candidates.