Bud generating systems #
A bud generating system consists of colored operations, the rules, and sets of initial and terminal colors. One operation derives another when the second is reached from the first by grafting rules onto inputs of matching color, and the system generates the operations derivable from the unit of an initial color whose inputs are all terminal. This file develops bud generating systems over the free binary operad, whose operations are binary trees and whose partial composition grafts a tree onto a leaf.
Main definitions #
Bud.Tree: binary trees with a color at every vertex.Bud.Tree.graft: grafting onto thei-th leaf, the partial composition of the operad.Bud.System.Derives,Bud.System.language: derivability and the generated language.Bud.System.ofCherries: the system whose rules are the cherries, single binary vertices, with colors in a given relation.
Main statements #
Bud.System.Derives.graft: a derivation can be carried out at any input of a larger tree.Bud.System.Derives.node: joining derivable trees under a cherry rule is derivable.Bud.System.ofCherries_derives_leaf_iff: in a system of cherries, a tree is derivable from the unit of its root color iff every vertex and its two children form a rule.
Implementation notes #
Derives is the reflexive transitive closure of one grafting step, as ContextFreeGrammar.Derives
is of one rewriting step. An element of a bud operad records the output and input colors of a
tree but not the colors at its internal vertices; a Bud.Tree records those too, as in the
vertex colorings of Marcolli and Larson, so that a tree derived from cherries is also its own
decomposition into generators.
References #
Equations
- One or more equations did not get rendered due to their size.
- Bud.instDecidableEqTree.decEq (Bud.Tree.leaf a) (Bud.Tree.leaf b) = if h : a = b then h ▸ isTrue ⋯ else isFalse ⋯
- Bud.instDecidableEqTree.decEq (Bud.Tree.leaf c) (Bud.Tree.node c_1 l r) = isFalse ⋯
- Bud.instDecidableEqTree.decEq (Bud.Tree.node c l r) (Bud.Tree.leaf c_1) = isFalse ⋯
Instances For
Equations
- Bud.instReprTree = { reprPrec := Bud.instReprTree.repr }
Equations
- One or more equations did not get rendered due to their size.
Instances For
The output color, at the root.
Equations
- (Bud.Tree.leaf c).out = c
- (Bud.Tree.node c l r).out = c
Instances For
The input colors, at the leaves from left to right.
Equations
- (Bud.Tree.leaf c).inputs = [c]
- (Bud.Tree.node c l r).inputs = l.inputs ++ r.inputs
Instances For
The number of inputs.
Equations
- (Bud.Tree.leaf c).numInputs = 1
- (Bud.Tree.node c l r).numInputs = l.numInputs + r.numInputs
Instances For
The cherry of color c over the inputs a and b, a single binary vertex.
Equations
- Bud.Tree.cherry c a b = Bud.Tree.node c (Bud.Tree.leaf a) (Bud.Tree.leaf b)
Instances For
Graft s onto the i-th leaf of x, the partial composition x ∘ᵢ s of the free binary
operad. An index out of range leaves x unchanged.
Equations
- (Bud.Tree.leaf c).graft 0 x✝ = x✝
- (Bud.Tree.leaf c).graft n.succ x✝ = Bud.Tree.leaf c
- (Bud.Tree.node c l r).graft x✝¹ x✝ = if x✝¹ < l.numInputs then Bud.Tree.node c (l.graft x✝¹ x✝) r else Bud.Tree.node c l (r.graft (x✝¹ - l.numInputs) x✝)
Instances For
Nested insertions compose, the inner index offset by the outer insertion point: the sequential composition axiom of the operad.
P holds at every internal vertex, of its color and the output colors of its children.
Equations
- Bud.Tree.NodeLocal P (Bud.Tree.leaf c) = True
- Bud.Tree.NodeLocal P (Bud.Tree.node c l r) = (P c l.out r.out ∧ Bud.Tree.NodeLocal P l ∧ Bud.Tree.NodeLocal P r)
Instances For
Grafting at a leaf of the matching color preserves vertex-local properties: the host's vertices keep their colors, and the inserted tree brings its own.
A bud generating system over the free binary operad, with colors in Ω.
- rules : Set (Tree Ω)
The rules, grafted one at a time in a derivation.
- initial : Set Ω
The colors whose units begin the derivations of generated trees.
- terminal : Set Ω
The colors allowed at the inputs of generated trees.
Instances For
B.Produces x y means that grafting a rule of B onto an input of x of the matching color
gives y.
Equations
Instances For
A tree is in the language generated by B when its output color is initial, it is derivable
from the unit of that color, and its inputs are all terminal.
Equations
Instances For
Joining derivable trees under a cherry rule is derivable: derivability is closed under the colored Merge of the cherry's colors.
A vertex-local property of every rule is preserved by derivation.
A tree whose every vertex and its children form a cherry rule is derivable from the unit of its root color.
The system whose rules are the cherries with colors in the relation R, with initial colors
I and terminal colors T.
Equations
- Bud.System.ofCherries R I T = { rules := {t : Bud.Tree Ω | ∃ (c : Ω), ∃ (a : Ω), ∃ (b : Ω), R c a b ∧ Bud.Tree.cherry c a b = t}, initial := I, terminal := T }
Instances For
In a system of cherries, a tree is derivable from the unit of c iff c is its root color
and every vertex and its two children form a rule.
The language of a system of cherries consists of the trees with an initial root color, terminal input colors, and every vertex and its two children forming a rule.