Words #
A proper prefix is shorter.
The longest common prefix #
The longest common prefix v ∧ w of two words: their wedge point in 𝒩(N).
Equations
Instances For
Of the three wedges of a triple, the two shortest agree; in the form the triangle
inequality consumes, |u ∧ v| + |v ∧ w| ≤ |v| + |u ∧ w|.
The metric of the ambient tree #
The graph metric of 𝒩(N): the path distance
d(v,w) = |v| + |w| - 2|v ∧ w|.
Equations
- BranchingProcess.treeDist v w = List.length v + List.length w - 2 * List.length (BranchingProcess.wedge v w)
Instances For
The subtraction defining treeDist does not truncate.
The truncation-free form of the metric.
Along a chain of prefixes the metric is the difference of the lengths.
Parents and children #
Subtrees #
A subtree of 𝒩(N): a prefix-closed set of words, taken as a term of
Descriptive.tree (Fin N). That type carries the SetLike membership v ∈ T and the
complete-lattice structure on prefix-closed sets, so intersections, unions and the
extreme elements come for free.
Equations
- BranchingProcess.Subtree N = ↥(Descriptive.tree (Fin N))
Instances For
The residual subtree at a node v, Descriptive.Tree.subAt, read off in the
notation of 𝒩(N): it consists of the words w with v ++ w in T.
The residual subtree at a vertex of T contains the root.