Dominance and dependency trees #
This file defines dominance as the reflexive-transitive closure of the arc relation, the projection (yield) it induces, tree well-formedness, and the order theory of dominance on trees.
Main definitions #
Dominatesis the reflexive-transitive closure of the arc relation.Graph.IsTreeis tree well-formedness: no arc into the root, a unique head elsewhere, and acyclicity. It is decidable.DominanceOrderisFin nreordered by dominance. On a tree it is a partial order with the root as bottom, the head as predecessor, and the lowest common governor as meet, bundled as mathlib'sRootedTreebyGraph.toRootedTree.Tree nis a graph bundled with its tree-hood, so the dominance-order instances hold with no side conditions.
Main results #
IsTree.root_dominates: the root of a tree dominates every position.Dominates.antisymmandDominates.comparable: on trees dominance is a partial order under which the dominators of any position form a chain.
Implementation notes #
Dominates is an abbrev for Relation.ReflTransGen g.Adj, so
mathlib's closure API (.refl, .tail, .trans, .single,
cases_tail, total_of_right_unique, …) applies to dominance facts
directly; this file adds only what mentions the dependency carrier.
Decidability comes from Core/Relation/ReflTransGen.lean.
References #
[KN06] — Mildly non-projective dependency structures, source of the dominance and projection definitions
v dominates x if a (possibly empty) chain of arcs leads from v
to x ([KN06] §2).
Equations
- DependencyGrammar.Dominates g = Relation.ReflTransGen g.Adj
Instances For
The positions v dominates, v itself included — the yield of v in
the source terminology.
Equations
- g.dominated v = {x : Fin n | DependencyGrammar.Dominates g v x}
Instances For
The yield of v in ascending position order, the projection π(v) of
[KN06] §2.
Equations
- g.projection v = List.filter (fun (x : Fin n) => decide (x ∈ g.dominated v)) (List.finRange n)
Instances For
Well-formedness #
The graph is a dependency tree: nothing points at the root, every other
position has exactly one head, and no position dominates itself. On
Fin n these imply rootedness and connectivity — every non-root
position's head chain terminates at the unique headless position.
- acyclic (v : Fin n) : ¬Relation.TransGen g.Adj v v
Instances For
Equations
- One or more equations did not get rendered due to their size.
Dominance as an order on trees #
In a tree, a position has at most one head.
The root's projection is the whole sentence.
Paths across a boundary #
If v dominates a position inside S and one outside it, some link below
v crosses the boundary of S.
The head function #
The dominance order #
Fin n carrying the dominance order of g instead of the
positional order. With [Fact g.IsTree] this is a partial order
with the root as bottom, the head as predecessor, and finite
descent — the order-theoretic reading of a rooted dependency tree
(cf. mathlib's RootedTree).
Equations
- DependencyGrammar.DominanceOrder _g = Fin n
Instances For
Equations
- DependencyGrammar.DominanceOrder.instFintype = { elems := DependencyGrammar.DominanceOrder.instFintype._aux_1, complete := ⋯ }
Equations
- One or more equations did not get rendered due to their size.
Equations
- DependencyGrammar.DominanceOrder.instOrderBot = { bot := g.root, bot_le := ⋯ }
Equations
- DependencyGrammar.DominanceOrder.instPredOrder = { pred := g.headOf, pred_le := ⋯, min_of_le_pred := ⋯, le_pred_of_lt := ⋯ }
Lowest common governor as the meet: the first head-iterate of one argument that dominates the other.
A well-formed dependency graph, as mathlib's rooted tree: positions
ordered by dominance, the root as ⊥, the head as Order.pred,
and the lowest common governor as ⊓.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Bundled trees #
A dependency tree: a graph bundled with its tree-hood, so that the
dominance-order structure holds with no side conditions. Parent
projections give direct access to the graph API (t.root,
t.label, t.gapDegree, …).
- words : Fin n → Morphology.Word
- root : Fin n
- isTree : self.IsTree
Well-formedness of the underlying graph.
Instances For
Equations
Bundle a graph with decide-checked tree-hood.
Equations
- DependencyGrammar.Tree.mk' g h = { toGraph := g, isTree := h }
Instances For
A bundled tree's tree-hood, available to instance search: the
Fact-gated dominance-order instances fire unconditionally.