Dominance, dependency forests and dependency trees #
A position of a dependency graph dominates another when a chain of arcs leads from the first to the second. The graph is a forest when no position dominates its own head and no position has two heads, and a tree when in addition its root dominates every position. On a forest dominance is a partial order in which the dominators of a position form a chain, so positions neither of which dominates the other have disjoint yields.
Main definitions #
Dominates: the reflexive-transitive closure of the arc relation.Graph.yieldis the set of positions a position dominates, andGraph.projectionlists it in ascending order.Graph.IsForest: no position dominates its own head, and no position has two heads.Graph.IsTree: a forest whose root dominates every position.DominanceOrder: the positions ordered by dominance, on a forest a partial order with the head as predecessor and on a tree one with the root as bottom.Tree: a graph bundled with a proof that it is a tree.
Main statements #
Graph.isTree_iff_forall_not_adj_iff: a tree is a forest whose only headless position is its root.Graph.isTree_iff_leftUnique_adj: a graph is a tree when no position has two heads, the root has none, and the root dominates every position, so that acyclicity need not be assumed.Graph.IsForest.disjoint_yield: on a forest, positions neither of which dominates the other have disjoint yields.exists_adj_adj_of_not_dominates: positions under a common dominator, neither dominating the other, lie under distinct dependents of one position.
Implementation notes #
Dominatesis anabbrevforRelation.ReflTransGen g.Adj, so mathlib's closure API applies to dominance directly and decidability comes fromCore/Relation/ReflTransGen.lean. Dot notation on a dominance hypothesis therefore resolves inRelation.ReflTransGen.Decidable g.IsTreegoes throughGraph.isTree_iff_leftUnique_adj, which searches from the root alone instead of looking for a cycle from every position.DominanceOrder gcarries the instances that mathlib'sOrder/SuccPred/Tree.leanand the command relations ofSyntax/Command.leanare stated over. Its archimedean property is inferred from finiteness.
References #
Dominance #
v dominates x when a possibly empty chain of arcs leads from v to x.
Equations
- DependencyGrammar.Dominates g = Relation.ReflTransGen g.Adj
Instances For
The yield of v is the set of positions v dominates, v itself included.
Equations
- g.yield v = {x : Fin n | DependencyGrammar.Dominates g v x}
Instances For
The projection of v is its yield in ascending order of position.
Equations
- g.projection v = List.filter (fun (x : Fin n) => decide (x ∈ g.yield v)) (List.finRange n)
Instances For
If v dominates a position inside S and one outside it, some link below v crosses the
boundary of S.
Positions under a common dominator, neither of which dominates the other, lie under distinct dependents of one position, their lowest common governor.
Forests and trees #
A dependency graph is a tree when it is a forest whose root dominates every position.
- leftUnique_adj : Relator.LeftUnique g.Adj
The root dominates every position.
Instances For
Equations
- One or more equations did not get rendered due to their size.
No position of a forest lies on a cycle.
A graph in which enhancement gives a position a second head is not a forest, as when the embedded verb of a control or raising structure gains the matrix subject.
A graph is a tree when no position has two heads, the root has none, and the root dominates every position: a cycle would have to be entered from the root's side through a second head.
Equations
- One or more equations did not get rendered due to their size.
The head function #
The least head of v, and v itself when it has none. In a forest it is the head of every
position that has one.
Instances For
The dominance order #
The positions of g ordered by dominance instead of by position.
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
The predecessor of a position is its head, and a headless position is its own.
Equations
- DependencyGrammar.DominanceOrder.instPredOrder = { pred := g.headOf, pred_le := ⋯, min_of_le_pred := ⋯, le_pred_of_lt := ⋯ }
Equations
- DependencyGrammar.DominanceOrder.instOrderBot = { bot := g.root, bot_le := ⋯ }
Bundled trees #
A dependency tree is a graph bundled with a proof that it is a tree.
- words : Fin n → Morphology.Word
- root : Fin n
- isTree : self.IsTree
The underlying graph is a tree.
Instances For
Equations
Bundle a graph with its tree-hood, decided by default.
Equations
- DependencyGrammar.Tree.mk' g h = { toGraph := g, isTree := h }
Instances For
A bundled tree's tree-hood, which makes the instances of its dominance order available.