Explicit Calculation of Structural Commutation Relations for Stochastic and Dynamical Graph Grammar Rule Operators in Biological Morphodynamics

Many emergent, non-fundamental models of complex systems can be described naturally by the temporal evolution of spatial structures with some nontrivial discretized topology, such as a graph with suitable parameter vectors labeling its vertices. For example, the cytoskeleton of a single cell, such as the cortical microtubule network in a plant cell or the actin filaments in a synapse, comprises many interconnected polymers whose topology is naturally graph-like and dynamic. The same can be said for cells connected dynamically in a developing tissue. There is a mathematical framework suitable for expressing such emergent dynamics, “stochastic parameterized graph grammars,” composed of a collection of the graph- and parameter-altering rules, each of which has a time-evolution operator that suitably moves probability. These rule-level operators form an operator algebra, much like particle creation/annihilation operators or Lie group generators. Here, we present an explicit and constructive calculation, in terms of elementary basis operators and standard component notation, of what turns out to be a general combinatorial expression for the operator algebra that reduces products and, therefore, commutators of graph grammar rule operators to equivalent integer-weighted sums of such operators. We show how these results extend to “dynamical graph grammars,” which include rules that bear local differential equation dynamics for some continuous-valued parameters. Commutators of such time-evolution operators have analytic uses, including deriving efficient simulation algorithms and approximations and estimating their errors. The resulting formalism is complementary to spatial models in the form of partial differential equations or stochastic reaction-diffusion processes. We discuss the potential application of this framework to the remodeling dynamics of the microtubule cytoskeleton in cortical microtubule networks relevant to plant development and of the actin cytoskeleton in, for example, a growing or shrinking synaptic spine head. Both cytoskeletal systems underlie biological morphodynamics.


Appendix A Supplementary Material: Detailed calculation for graph grammars
Here we record detailed calculations that prove Theorem 1 and Theorem 2. Four corollaries of each of Theorems 1 and 2 are shown in Section 3 and are not repeated here.

SA.1 Diagonal context factors
Another useful form for Equation (5) is to factor out any graph K that is completely unchanged, having graph node labels λ 1 v " λ v and graph edges that are all the same in labeled graphs G and G 1 . Then: dµ r pXq ρ r pλpXq, λ 1 pXqq ÿ xi 1 ,...i k y ‰â i 1 ,...i k pG r out zK r qN i 1 ,...i k pK r qa i 1 ,...i k pG r in zK r q where N α "â α a α is an elementary diagonal 0/1-valued number operator and N i 1 ,...i k pK r q is the product of such elementary diagonal operators for of the nodes and edges in graph K. Set GzK is the set difference of two graphs, i.e. the set (not necessarily a graph) of nodes and edges in G after removing those that are also in K. Because theâ, N, and a operators are nonoverlapping products of nonoverlapping elementary node/label and edgeâ, N, and a operators, the corresponding diagonal operator D r of Equation (1), required to conserve probability, is now easy to compute: globally, a becomes N, N remains N, andâ becomes Z " I´N as in Equation (19). Thus: D r " 1 C r pN max free q ż dµ r pXq ρ r pλpXq, λ 1 pXqq ÿ xi 1 ,...i k y ‰ Z i 1 ,...i k pG r out zK r qN i 1 ,...i k pK r qN i 1 ,...i k pG r in zK r q In the special case of Equation (53) for which G r out " G r in and the node labels λpXq are all constrained by ρ to be unchanged, then K " G r out " G r in and the off-diagonal factors disappear, leaving only the diagonal operator. By substituting Z " I´N and expanding, the D r of Equation (54) appearing in the master equation to conserve probability for any rule r can be expanded out into an integer-weighted sum of such diagonalŴ r 1 operator expressions.

SA.2 Normalization
The factor of 1{C r pN max free q in Equation (5) accounts for a large number of equivalent states that could result from a rule firing, whose weight should add up to Op1q. It reflects the fact that in operator algebra formalism reaction rates naturally follow the law of mass action, so that if (as one would hope) a large number N max free of unallocated node indices are available for creating new graph content then the net rate of creation for that content is proportionately very high; yet this factor should instead be unimportant, so we scale it out. Roughly, C r pN max free q should be N max free !{ppN max free q´m r q! where m r is the number of new nodes |G r out nodes zG r in nodes | appearing in the output graph but not the input graph. However, N max free should be much larger than m r so that it does not change appreciably when graph nodes are created or destroyed, in which case C r pN max free q » pN max free q m r with equality in the N max free Ñ`8 limit. Then in the limit C r is "multiplicative" for additive m r (i.e. pN max free q m r 1 pN max free q m r 2 " pN max free q m r 1`m r 2 ) as we assume for Theorems 1 and 2 below.
Another possible formula, C r pNq " pNq m r " N!{pN´m r q!, is "multiplicative" : C r 2 ;r 1 pN max free q " C r 2 pN max free´mr 1 qC r 1 pN max free q (55) but requires dynamic tracking of N max free . Alternatively, C r could be held constant by an index allocation mechanism such as that described in Section SA.4.2. (Thus, one could invent a memory gatekeeping mechanism similar to "malloc" in C, "new" in C++, and "cons" in Lisp, but expressed in operator algebraic notation for allocating one block of indices at a time, at the risk of some degree of unnecessary serialization.) A useful limit of this route is to set N max free " 1, C r " 1 (also multiplicative) by imposing a unique choice of new, unique index value for each new node generated in each rule firing; this method requires a suitable choice function. A hash function on the left hand side indices i k and the rule number r would go much of the way towards defining such a choice function, but some occupancy state information may also be needed as input. Occupancy state information is discussed in Section SA.4.2 below.

SA.3 Operator algebra techniques
The expressions r. . .s in square brackets in Equation (11) need to be restored to normal order, with annihilators a α to the right of (preceding) creation operatorsâ α .

SA.3.1 Elementary operators' algebra
To do this systematically we need various operator rules for 2x2 elementary operators: a "ˆ0 0 1 0˙, a "ˆ0 1 0 0˙i mplies (56a) aa " N "ˆ0 0 0 1˙, aâ " Z " I´N "ˆ1 0 0 0˙, and (56b) ra α ,â β s " δ αβ pI α´2 N α qI Alternative for normal form calcs: (56c) a αâβ "â β a α´2 δ αβâα a α`δαβ I α (56d) a αâβ " p1´δ αβ qâ β a α`δαβ Z α (56e) Then for calculational purposes we record these elementary relationships: In addition, an extra multiplicative algebra sector governs the erasure operator E " Z`a: In order to control the signs of integer-valued weights in operator products, we observe the following: For creation/annihilation operators pertaining to graph edges, including those making up the edge erasure operators E i p i and E i i q , using e.g. Equation (56e) rather than (56d) removes the explicit negative signs from the algebra by introducing matrix Z i p i q which has nonnegative entries.
This algebra governs the graph edge creation and annihilation operators, for which α " pi, jq. It does not apply directly to the node label creation and annihilation operators, except as targets of an operator homomorphism to be described next. For this homomorphism the elementary bitwise operators obeying the algebra above will be denoted "b" rather than "a".

SA.4 Operator Algebra homomorphisms
A homomorphism of operator algebras is defined here as a mapping from one operator algebra to another that preserves the basic algebraic operations: finite sums, scalar multiplication, and finite products of operators. It is thus a ring homomorphism, for a ring of linear operators that act on a vector space. In our case the vector space is a Fock space capable of hosting classical probability distributions [1,2,3] If the operator algebra homomorphism is also injective, it could be called an "embedding".

SA.4.1 Winner Take All (WTA or 1-Hot) Encoding of Labels
We can enforce a winner-might-take-all logic of labels either by fiat using axioms: where N paq i, λ 1 and Y i, λ 1 are diagonal in the number basis and idempotent, satisfying for α " pi, λq as appropriate for node labels, just as Z does in Equation (57). Likewise for N: Alternatively, we can ground this WTA algebra in terms of the usual elementary 0/1-valued states using the 0/1-winner mapping in which the b,b operators obey the bitwise algebra of Equation (56) above, and they also by induction obey the WTA/one-hot subspace constraint imposed by initial condition and preserved by operators constructed from a,â: In the number basis for b, these equivalences follow from the initialization and inductive preservation of so that n i, ∅ n pbq i, λ " 0 and λ ‰ λ 1 ùñ n pbq i, λ n pbq i, λ 1 " 0; then use b α | . . . n α . . .y " n pbq α | . . . pn α´1 q . . .y . Using this algebra for b,b and the operator algebra homomorphism to a,â induced by Equation (62), then the a,â algebra of Equations (59),(60), and (61) (interpreting N in (59)-(61) as N paq below, not as N pbq ) can be verified by direct computation. We find the additional homomorphism mappings to the bitwise "b" algebra for Y and N paq : Of course operators indexed by nodes i ‰ j all commute. Combined with the last line of Equation (59), this fact produces a major calculational tool for nodes in the form of the following key commutation relation simply repeating Equation (22) : This relation differs from Equation (56e) in producing fewer nonzero results, so it is more constraining, and a slightly different diagonal operator Y obeying the same algebra for node labels (in Equation (60)) as Z (in Equation (57)) does for edges. Equation (56e) however still governs edge operators.
Thus we reach sufficient multiplicative information on ta,â, N, Z, Y, E, Π 1 u in principle to compute all products ofŴ operators.

SA.4.2 Controlled index allocation
Each graph rewrite rule may introduce new graph nodes not already present. The graph rewrite rule algebra will be simpler if these can be modeled with fresh node indices i not previously used -even if some further algebra homomorphism and remapping not undertaken here actually reuses old, deallocated graph node indices. (Edge index pairs will necessarily be fresh -heretofore unused -if at least one of their node indices is fresh.) Here we just seek to express algebraically a continual, parallelism-compatible supply of fresh indices. Choose an index block size B that is large enough to encompass the new nodes of any rule we consider. The chosen B could even be countably infinite, e.g. if we use a diagonal raster traversal of B and the infinite collection of blocks needed; however in Theorem 2 we will assume B is finite. Index the blocks needed by µ P M where M is a countably infinite tree of finite maximum branching degree, and let φ Ď M denote a frontier in M: the collection of next blocks available for allocation, whose ancestors have all been allocated.
As a special case, if M is a graph isomorphic to the integers with succession (N`) as the tree relationship, then this scheme will force serial computation; but an average branching degree even slightly greater than 1 permits parallelism.
Each block τ has binary variables A τ P t0, 1u taking the value 1 if and only if block τ is "allocated" or "alive" (in which case all of τ's ancestors mush also be alive), and F τ P t0, 1u taking the value 1 if and only if block τ is in the current frontier φ, in which case A τ " 1 but all of τ's children must be unallocated (A σPchildrenpτq " 0). These binary variables F have creation/annihilation operatorsb ind τ and b ind τ . Then |φ| " ř τPM F τ . We will assume that nodes i which have never been allocated in a memory block all obey the initial condition that n i ,∅ " 1 and n i ,λ " 0 for other labels λ and inductively have no way of changing until the memory block τ containing i is allocated; and likewise all the edge numbers n ij and n ji involving node i are all initialized to zero and inductively have no way of changing until the memory blocks σ, τ containing i and j respectively are both allocated.
Let Chpτq be the set of child blocks of memory block τ in M. Then the combined operator could be used to advance the frontier φ of allocated memory under a single rule firing. (M could even be permitted to be a directed acyclic graph, if the child operatorb ind σ in the product in Equation (67) is replaced by pb ind σ`N ind σ q. Then child memory blocks that are already alive and in the frontier are permitted, and remain that way.) If we initialize the aliveness and frontier at the root of the tree and maintain it by Equation (67) inductively, then we can take More conservatively we could continually check that old memory is not about to be reused incorrectly: The index allocation frontier maps to parallel computational architectures in which time can be local, for example time can be a spacelike foliation of spacetime that respects signal propagation delays. Now the idea is that rule-firing operatorsŴ r will act also in the index allocation space, using and then advancing the frontier φ of blocks τ from which newly allocated graph nodes i can be drawn. Denoting byŴ r,τ the variant ofŴ r that draws all newly allocated nodes i from block τ (the block size B being always large enough for this), then where all such expressions as τ varies are regarded as equivalent owing to index permutation invariance and operator linearity. In the special case M " N`, φ " tτu, |φ| " 1 and this operator becomeŝ (cf. [4], a quantum version that adds in the time-reversal Hermitian conjugate of all transitions) which is the form we will assume. Parallel computational implementations with a large frontier should be equivalent, in the sense of Equation (8), to this simplest case.
With more complex dynamics one could try to ensure that in Equation (70) the |φ|, size of the frontier, is constant or nearly constant in time, and move its inverse to the left of the ř τ above. For example M could be a root node connected to the zero nodes of |φ| half-infinite chains each isomorphic to the integers under succession. Alternatively one could track the relationship between simulated and computational time. In what follows we'll assume one of these options has been taken, so that the factor of 1{|φ| is the same for all rules, treat the general M case as equivalent (using » as previously defined) to the special case M " N`, φ " tτu, |φ| " 1 that we assume in the calculations that follow. Similar "aliveness" variables in quantitative grammar models have been used in [5] and [6], along with winner-take-all variable subset constraints, though without the operator algebra framework. Controlled index allocation could be related in a computational implementation to controlled memory allocation.

SA.4.3 Hanging edge cleanup
Another elaboration of rule operatorsŴ r can clean up hanging edges that may otherwise be left behind by a rule firing: where S is the set of indices specified by S " rpL r zR r qˆU A˚s where U A˚= all node indices that have ever been allocated in a memory block, hence all memorylive node indices, and U = the whole universe of node indices, so that U A˚Ď U . The second line in Equation (72) is equivalent, » to the first because as discussed above, unallocated k 2 indices inductively have n k 1 k 2 " 0 " n k 2 k 1 , and the erasure operator does nothing (is equivalent to the identity operator) in that case. The reason for including this restriction in the definition of S is that, for rules with finite graphs and index allocation with finite block size and after any finite number of rule firings, U A˚i s finite and both factors of the set S are finite, so S itself is finite; only a finite amount of cleanup work needs to be done for each rule firing. We will use this assumption in the proof of Theorem 2.
In the next section we will use the notation P χ " rpL χ zR χ qˆU s for the predicate that designates the possibly infinite superset of index set S above, that pertains to the top line of Equation (72).
In greater detail the hanging-edge removal semantics as specified less formally in the top line of Equation (72) above, is given by Equations (23) and (24) of Section 3.2.
Also, index notation will be used as specified by Equations (23)-(29) of Section 3.3. (In connection with Equation (29), we add here that any of these alternative formulations of P would be equivalent: However, we will use Equation (29) = case I above, since it is the easiest to work with.) Denote the sought-after "compound rule" for rules r 1 followed by r 2 as Then we have these compound rule index set definitions: The index sets ∆ and D above will turn up in the calculation of the next section. From a 2 " 0 "â 2 , we have:

SA.5 Commutation calculation -no edge cleanup
The product of two such operators is (omitting for now the integral over parameters X) Grouping the node operators together at the end, and grouping together terms that need to be commuted next as . . .
( 2 , this is: Strategically rewriting the sum over J , In the controlled index model the sum over maps J will simplify because T and πpTq will both be the null set. In any case, note that The more constraining form to commute is . . .
and thus #« ź since on S, J´1 " h˝I´1. The last line implements label-checking in the node correspondence portion of graph matching between a subgraph HpS, hq of the output graph of rule r 1 and a corresponding subgraph of the input graph of rule r 2 .
To this end, using Equation (56) and the conditions ImpIq X ImpJ q " IpSq Y IpTq, and (from Equation (80) ) IpTq X R 1 " ∅^J pπpTqq X L 2 " ∅, we compute: Thus in our case, Here IpH links q " L 2 X R 1 , or equivalently H links " G r 1 out links X I´1pJ pG r 2 in links qq " G r 1 out links X h´1pG r 2 in links q; likewise H nodes " G r 1 out nodes X h´1pG r 2 in nodes q. Thus we have established Lemma 1, which we restate here: Lemma 1 HpS, hq must be the maximal common subgraph of both G r 1 out and G r 2 in , for any given choice of nodes S in G r 1 out and 1-1 corresponding nodes hpSq in G r 2 in . From factor 2 we can restrict S to sets of nodes whose labels match in G r 2 in nodes and G r 1 out nodes . For any such H, we can commute the link operators as follows: The last factor above augments the graph matching of Equation (83) by implementing the edge-checking or link correspondence portion of graph matching between a subgraph HpS, hq of the output graph of rule r 1 and a corresponding subgraph of the input graph of rule r 2 .
Note that the 1-1 and onto node map h : H ÑH preserves edges and labels of labeled subgraphs H andH, and thus is also an isomorphism of labeled subgraphs.
No proper subsets of L 2 X R 1 from commuting creation and annihilation operators need to be considered, because the Z factor in the last term, arising from Equation (79), is already a sum of two terms: I and´N corresponding to commutation with index miss and hit.
Thus, the "CommonpG 1 , G 2 q" set of shared subgraphs H that we sum over in the graph rewrite commutator is: Definition CommonpG 1 , G 2 q = An isomorphic pair of (edge-maximal) labeled subgraphs From IpSq " IppH nodes q " L 2 X R 1 and edge-maximality we conclude IpH links q " L 2 X R 1 , whence Equation (86) We now assemble partial results of Equations (79), (83), and (87):  ( 2 , and using the identities Z α a α " a α , Y α a α " a α , and pa α q 2 " 0 " pâ α q 2 , and regrouping, we get to the point of maximum intermediate expression swell: Then, using Equation (75) to redefine the index set domains, along with extended indices i ‹ n with ‹ superscripts to run over them (according to the index map I ‹ which extends I with nonoverlapping assignments from J as appropriate); and using the index allocation scheme to force T " ∅; we havê W r 2Ŵ r 1 " 1 C r 1 pN max free q 1 C r 2 pN max free q ρ r 1 pλ p1q , λ 1 p1q qρ r 2 pλ p2q , λ 1 p2q q ÿ SĎG r 1 out nodes Here, by the indexed form for graph grammar rules of Equation (26), as in the non-indexed semantics form of Equation (5). Furthermore, the idempotent factors of Y and Z (diagonal in the number basis, multiplying each pure graph state by 0 or 1 ) just require sufficient free memory to operate the "churn" of memory used in rule 1 and released in rule 2; assuming index allocation works as designed from a countably infinite store, it is equivalent in the sense of Equation (8) to drop these factors. The Kronecker delta functions are interpreted as label-matching conditions in labeled graph matching as in Lemma 1, constraining the 1-1 correspondence map h to respect the node labels and thus (again by Lemma 1) to be an isomorphism of labeled graphs; and they also help to ensure that the normalization for number of equivalent outcome graphs is correct. Thus in order to compute the labeled, numbered graph rewrite rule in each summand over S and h, one needs to find a labeled subgraph H of G r 1 out that is isomorphic as a labeled graph to a labeled subgraphH of G r 2 in , and do this in an edge-maximal way; then one needs to pick an isomorphism h between H andH; then using H,H and h to map between the rule r 1 and r 2 node numberings, one needs to compute the left hand side and right hand labeled graphs as numbered and labeled node sets and link sets. Thus by careful interpretation of terms we arrive at the main result, except limited to the case in which hanging edges are not removed by the rule semantics: for the hanging-edge permissive semantics of Equations (5) and (6), or equivalently Equation (26), YpG r 2 in zHqÑ h G r 2 out 9 YpG r 1 out zHq (92) In more detail, the summand graph rewrite rule is then defined by the disjoint unions 9 Y (re-flecting time-reversal L Ø R duality): G 1;2 in nodes pH nodes q " G r 1 in nodes 9 YpG r 2 in nodes zH nodes q G 1;2 out nodes pH nodes q " G r 2 out nodes 9 YpG r 1 out nodes zH nodes q " G r 1 in nodes Y h´1 ‹ pG r 2 in nodes zH nodes q " G r 2 out nodes Y h ‹ pG r 1 out nodes zH nodes q G 1;2 in links pH nodes q " G r 1 in links Y h´1 ‹ pG r 2 in links zH links q G 1;2 out links pH nodes q " G r 2 out links Y h ‹ pG r 1 out links zH links q where 9 Y denotes disjoint union, and where h ‹ : extends the labeled graph isomorphism h : H Ď G r 1 out ÑH Ď G r 2 in to a map on nodes and links (not necessarily a graph homomorphism) h ‹ : G r 1 out Ñ G 1;2 out by remapping the nodes of G r 1 along h if possible, and to the disjoint union nodes if not, and preserving all possible links except those in H links since they are subject to editing by rule r 2 ; and likewise for h´1 :H Ď G r 2 in Ñ H Ď G r 1 out and h´1 ‹ : G r 2 in Ñ G 1;2 in . The conserved core graphs are determined by shared node labels on the left and right of a rule: K a " G r a in nodes X G r a out nodes K 1;2 " pK 1 zH nodes q Y h´1pK 2 zH nodes q Y pK 1 X h´1 ‹ pK 2 qq (94) The exact mechanics of graph numbering and disjoint union are discussed in [3], and examples are given in Section 3.7.
Recall that Equations (12), (13), and (14) take care of updating the integrals over parameters that we have omitted from the composition of semantics calculation starting in Section 3.4, by using up all the commutator-derived delta functions on extra label parameters. Then, given the definitions of the compound label graphs in Equations (93) and (94), one can write the graph rewrite rule algebra as announced in Section 2.4 and Theorem 1: Theorem 1 For the hanging-edge-permissive semantics of Equations (5) and (6), or equivalently Equation (26), and assuming multiplicative normalization C r , then where the compound labeled graphs G 1;2 in pHq and G 1;2 out pHq, and their label overlaps K 1;2 , are defined by Equations (93) and (94) above. The coefficients in this expression are all nonnegative integers (as the same graph grammar rule could arise several times by different means). Rate factors ρ multiply with parameter substitution, as in Equation (14).
From this theorem we derived a series of corollaries in Section 3, which comprise key conclusions of this paper.

SA.6 Commutation calculation -with edge cleanup
We now turn to the hanging-edge cleanup semantics, and prove (Theorem 2) that the same algebra as in Theorem 1 and Equations (93), (94), and (95), above still applies.
The semantics is now (restating Equation (96)) W r χ " 1 C r χ pN max free q ż dµ r χ pXq ρ r χ pλrXs, λ 1 rXsq The product of two such operators is (omitting for now the integral over parameters X) The problem is to treat the potentially very high degree factors of ś P 1 YP1 E that have been inserted into the middle of this semantics.

SA.6.1 Edge cleanup asymptotics
We now work to replace the product of E ij factors above with the exponential of a sum.
First we note an application of the Euler formula for the matrix exponential. Defining Using E 2 α " E α and grouping α˚s into partition blocks of equal α value, where k l ( are Stirling numbers of the second kind and where the last line uses a generating function for these numbers.
Then asymptotically as τ " ρ erase t Ñ`8, and defining |S| pmq " |S|!{p|S|´mq!, where m`l " |S|, So, complete erasure is the limiting behavior of this edge-by-edge stochastic erasure process, and it can be achieved simply by taking the limit ρ erase Ñ`8. Now we apply these calculations to the actual hanging-edge erasure operator: Here the node operator Z i checks for unallocated nodes i with no label: whence Z i Z i " Z i . Also N i " ř λ N i ,λ counts the number of active labels for node i which by WTA constraint is 0 or 1; we have again N i N i " N i and N i`Zi " I and N i Z i " 0. We note here that the operator Z as defined above doesn't quite fit within the graph grammar rule semantics we have defined so far because it checks for nonexistence. Nonexistence checks are identified as a more general kind of semantics in [1] and [3], which we do not treat in the present work except for this particular technical example. Of course, Equation (105) doesn't need to fit within the rule semantics, as it is not explicitly accessible at the level of stochastic parameterized graph grammar rules -it is just substructure.
Again defining " τ{m, another expression for the exponential in Equation (105)   where as before k l ( are Stirling numbers of the second kind and where the last line uses a generating function for these numbers. Then asymptotically as τ " ρ erase t Ñ`8, and defining |S| pmq " |S|!{p|S|´mq!, The final expression above is a key step prepared for by the discussion in Section SA.4.3, and it is justified by the fact that inductively the operator N j produces a zero value unless node j has been allocated at some point in the history of rule-firings .
So again we get the product of forward edge erasures by an incremental process of deletion, run for a long effective time τ.

SA.6.2 Commutation with edge cleanup
In Equation (97), as in (72), The core calculation withinŴ cleaned r 2¨Ŵ cleaned r 1 is thus: Now calculate components: Graph Nodes: Likewise Z k " I´N k ùñ N k " I´Z k and " ź Together, then, Graph Links: We continue to calculate and " ź pi 1 ,i 2 qPR 2â # N k 1 ,k 2 r ś pi 1 ,i 2 qPR 2 zpi 1 ,i 2 qâ i 1 i 2 s if pk 1 , k 2 q P R 2 a k 1 ,k 2 r ś pi 1 ,i 2 qPR 2â i 1 i 2 s if pk 1 , k 2 q R R 2 (123) Next, and since Z α a α " a α , so from Equations (122) and (125), Likewise: " ź pi 1 ,i 2 qPR 2â so from Equations (123) and (126), Combining, Next we argue: If pk 1 , k 2 q P R 2 X L 2 as in the third line of the right hand side of Equation (129) above then the commutation was successful, and the factor of a´N simply joins the infinite supply of such factors to the left. That leaves two cases in Equation (129). If pk 1 , k 2 q P L 2 (as in the first line of the right hand side of Equation (129) above) then k 1 P L 2^k2 P L 2 so in Equation (121) the first line applies and the term is zero; it doesn't contribute. That leaves one case: pk 1 , k 2 q P R 2 zL 2 , in which case k 1 P R 2^k2 P R 2 . Then either the first line the right hand side of in Equation (121) again applies and eliminates the present term, or else neither of its alternative conditions apply and k 1 P R 2 zL 2^k2 P R 2 X L 2 ; thus the condition for a surviving prefactor of N k 1 ,k 2 is: pk 1 , k 2 q P rR 2 zL 2ˆL2 X R 2 s X pR 2 zL 2 q (130) ... a condition excluded by the index allocation scheme, which implies k 1 R R 2 zL 2 . So, all surviving terms behave as in the third line of Equation (129), and the factor of a´N to the right of the second rule firing simply joins the infinite supply of such factors to its left. Intuitively, this means that hanging edges can be eliminated nonspecifically by an overactive syntax-checking process, rather than surgically in a way that depends on the details of each rule firing, because the assumed form of the graph rewrite rules does not recognize or respond to hanging edges.
Thus we find no change to the algebraic formula of Theorem 1 (i.e. Theorem 1) for the hangingedge removal semantics: Theorem 2 For the hanging-edges removal semantics of Equations (23) and (24), or equivalently Equation (96), and assuming finiteness of rules, index allocation blocks, and number of rule firings, and assuming multiplicative normalization C r , then where the compound labeled graphs G 1;2 in pHq and G 1;2 out pHq, and their label overlaps K 1;2 , are defined by Equations (93) and (94) above. The coefficients in this expression are all nonnegative integers (as the same graph grammar rule could arise several times by different means). Rate factors ρ multiply with parameter substitution, as in Equation (90).
From this theorem we derived a series of corollaries in Section 3 above, which comprise key conclusions of this paper.

Appendix B Supplementary Material : Stochastic graph grammar examples
This section expands on the cortical microtubule graph grammar of the main text, and calculates more commutators.
In working out the commutators we will drop the propensity functions ρ, but they just multiply the results, with appropriate variable identifications.

SB.2 Selected MT commutator calculations
The commutator calculations for the minimal MT graph grammar's Lie algebra can be outlined as follows.
rŴ 2 ,Ŵ 1 s: H " ∅ always cancels in the commutator. More detailed work lets us calculate rŴ 2 ,Ŵ 1 s " by abusing notation slightly: rŴ 2 ,Ŵ 1 s " rp 1 1 -2 1 q ÝÑ p 2 1 q , p 1 q ÝÑ p 1 -2 qs which is just a renumbering of the same graph, which provided that the model-specific rules of MT representation are respected by the other grammar rules, should be equivalent to the identity operator. The corresponding full W "Ŵ´D operator should therefore (by Corollary 1 to Theorem 1) be equivalent to the zero operator, using this model-specific extension of the equivalence relation in Equation (8). H " ∅ always cancels in the commutator.
H " ∅ always cancels in the commutator. Other cancellations are possible, since the scalar propensity functions multiply commutatively, leaving at most 24`33 " 57 terms. As before, many of these terms will have no effect within a grammar that preserves inductively valid MT representation structures.

SB.3 ODE Commutators
Here we illustrate Proposition 1 by exhibiting products and commutators involving differential equation rule operators, first among themselves and then with conventional SPG (non-DE) graph grammar rule operators.

SB.3.1 [ODE, ODE] commutators
In like manner to Section SB.2 above and as a check, we can compute the commutator of two differential equation rules that affect the same one-node graph with the same type parameter and a continuous vector variable x. Other ODE rules can be reduced to this case by parameter replication across objects, and this case is easier to calculate. Similarly we will assume for simplicity dµ r pxq " dx and dµ r pyq " dy in Euclidean space.
If the two differential equations are dx{dt " v 1 pxq and dx{dt " v 2 pxq , then there is an H " ∅ commutator miss term that cancels out and a H " the one node term that contributes to the commutator. We assume that v 1 , v 2 and their derivatives fall off at infinity sufficiently fast that we may drop all boundary terms upon integration by parts. Then an exercise in Dirac delta function integration shows that the commutator of these two graph grammar variants of differential operators, rO DE 2 , O DE 1 s, corresponds to another such operator O DE r2 , 1s with differential equation right hand side: v r2 , 1s pxq " pv 1¨∇x qv 2 pxq´pv 2¨∇x qv 1 pxq .
we can adjust e tpO DE 2`ODE 2 q to equal e tO DE 2 e tO DE 1 if we move the v 2 contribution forwards in time evolution under v 1 , and also move the v 1 contribution backwards in time evolution under v 2 . As a check, the same result arises by letting e tO DE χ act on probability densities ρpxq as O DE χ "´D χ = v χ pxq¨∇ x , and computing the commutator. The operator product O DE 2¨ODE 1 can be expressed as an O DE plus additional symmetric diffusion term [2] which cancels out in the commutator.

SB.3.2 [ODE, SPG] commutators
The operators we want to multiply are again For simplicity only, we will make the same assumptions as in Section SB.3.1 above, that the ODE rule operates on a one-node graph G p2q , with parameter x going in to the rule and parameter y coming out of it, so that the subgraphs H are either H " G p2q or H " ∅. Since H " ∅ cancels out of the commutator we will just calculate the "main" H " G p2q contribution to the products. Also dµ r pxq " dx and dµ r pyq " dy in Euclidean space. Since the ODE rule doesn't change N max free , the normalization will be unchanged as well.
InŴ SPG 1 we can factor the independent parameter vector X into a parameter vector z h of continuous-valued parameters which labels the node matched by h to the singleton node of G p2q , and a parameter vector X hK which captures all other floating parameters of G p1q . In the notation of Equation (14) of the main text, z h will play the role of Z, the vector of matched label parameter values, which get matched by appropriate Dirac delta functions and substituted into both ρ functions, except that Z may also have additional discrete "user-defined type" information involved in matching but not in ODE dynamics. z h will match either x or y, depending on whetherŴ SPG 1 comes before (acts to the right of) W ODE 2 or after (to the left). Now for any given match h we can split the integral over the independent parts of X, possibly at the expense of re-expressing ρ 1 pXq: dµ p1qh pX hK q ż dz h ρ 1 pz h , X hK q ÿ xi 1 ,...i k y ‰â i 1 ,...i k pG p1q out qa i 1 ,...i k pG p1q in q (140) Then using the notation of Theorem 1 to combine G p1q and G p2q into G 2;1 in and G 2;1 out , and adding label substitution information to those labeled graphs as G 2;1 in pH, x, z hK q and G 2;1 out pH, y, z hK q respectively, W SPG p1q W ODE p2q " 1 C 1 pN max free q ÿ h:H"G p2q ÑHPG p1q ż dµ p1qh pX hK q ż dz h ż dx ż dy ρ 1 pz h " y, X hK qρ 2 py, xqŴ G 2;1 in pH,x,z hK qÑ h G 2;1 out pH,y,z hK q , where again ρ 2 py, xq "´∇ y¨p vpyqδpy´xqq "´ÿ a ∇ y a pv a pyq ź b δpy b´xb qq .
Finally, the commutator is the difference which factors if we abuse notation a bit and let h stand also for h´1, since it is a 1-1 onto map: rW ODE p2q ,Ŵ SPG p1q s " 1 C 1 pN max free q ÿ h:HÑH ż dµ p1qh pX hK q ż dz h ż dx ż dy ρ 2 py, xq ! ρ 1 pz h " x, X hK qŴ G 1;2 in pH,x,z hK qÑ h G 1;2 out pH,y,z hK q ρ 1 pz h " y, X hK qŴ G 2;1 in pH,x,z hK qÑ h G 2;1 out pH,y,z hK q ) ,