CausalGraph: Acyclicity, Ancestor Relation #
IsDAG is a Prop mixin class on CausalGraph V (mirroring
IsMarkovKernel from Mathlib/Probability/Kernel/Defs.lean): required
only by operations that genuinely need acyclicity (topological sort,
well-founded fixpoint induction).
The ancestor relation uses Relation.ReflTransGen directly (no
intermediate adapter); consumers can use mathlib's existing API for
reflexive-transitive closures.
Acyclicity certificates come bundled as Ranking (parents rank strictly
below children) and its strict-successor refinement TimeIndex (parents
immediately precede children, the time-indexed causal models of
[CWL25]); IsDAG.of_depth passes the loose form.
IsAncestor G u v iff there is a chain v ← w₁ ← ... ← u via parents.
Defined via mathlib's Relation.ReflTransGen over the inlined
"is-parent-of" relation.
Equations
- G.IsAncestor = Relation.ReflTransGen fun (u v : V) => u ∈ G.parents v
Instances For
IsStrictAncestor G u v iff there is a nonempty chain via parents.
Defined via mathlib's Relation.TransGen.
Equations
- G.IsStrictAncestor = Relation.TransGen fun (u v : V) => u ∈ G.parents v
Instances For
Decidable (G.IsAncestor u v) via the Core.Relation.ReflTransGen
substrate's Fintype headline. The relation fun u v => u ∈ G.parents v
has decidable successors G.children u (already defined as
Finset.univ.filter (v ∈ G.parents ·) in Defs.lean).
Equations
Decidable (G.IsStrictAncestor u v) via the substrate's TransGen
Fintype headline.
Acyclicity: the strict-ancestor relation is well-founded — no
infinite chain of parents. An abbrev for mathlib's IsWellFounded
class, so its API (IsWellFounded.wf, induction, fix) applies
directly; required by the develop fixpoint and well-founded
recursion over the parent relation.
Equations
- G.IsDAG = IsWellFounded V G.IsStrictAncestor
Instances For
A ranking of a causal graph is a relation homomorphism from the
parent relation into < on ℕ — mathlib's RelHom, so the bundled
form of the depth certificate consumed by IsDAG.of_depth and, per
model, by the fuel bridges.
Instances For
A ranking certifies acyclicity: well-foundedness transfers along the
homomorphism (RelHomClass.wellFounded) and lifts to the transitive
closure (WellFounded.transGen).
A graph is acyclic if every edge strictly decreases some ℕ-valued
depth function — Ranking.isDAG with the certificate passed loose.
The ranking underlying a time index.
Instances For
A time index certifies acyclicity.