# Subsumptions of Algebraic Rewrite Rules

Thierry Boy de la Tour

► To cite this version:

Thierry Boy de la Tour. Subsumptions of Algebraic Rewrite Rules. Electronic Proceedings in Theoretical Computer Science, 2023, 397, pp.20-38. 10.4204/EPTCS.397.2. hal-04087851v3

HAL Id: hal-04087851

https://hal.univ-grenoble-alpes.fr/hal-04087851v3

Submitted on 27 Sep 2023

HAL is a multi-disciplinary open access
archive for the deposit and dissemination of sci-
entific research documents, whether they are pub-
lished or not. The documents may come from
teaching and research institutions in France or
abroad, or from public or private research centers.

L'archive ouverte pluridisciplinaire HAL, est
destinée au dépôt et à la diffusion de documents
scientifiques de niveau recherche, publiés ou non,
émanant des établissements d'enseignement et de
recherche français ou étrangers, des laboratoires
publics ou privés.

<figure><img src="image_1.png" /></figure>

Distributed under a Creative Commons Attribution 4.0 International License
# Subsumptions of Algebraic Rewrite Rules

Thierry Boy de la Tour

Univ. Grenoble Alpes, CNRS, Grenoble INP, LIG, 38000 Grenoble, France

thierry dot boy-de-la-tour at imag.fr

## Abstract

What does it mean for an algebraic rewrite rule to subsume another rule (that may then be called a subrule)? We view subsumptions as rule morphisms such that the simultaneous application of a rule and a subrule (i.e. the application of a subsumption morphism) yields the same result as a single application of the subsuming rule. Simultaneous applications of categories of rules are obtained by Global Coherent Transformations and illustrated on graphs in the DPO approach. Other approaches are possible since these transformations are formulated in an abstract Rewriting Environment, and such environments exist for various approaches to Algebraic Rewriting, including DPO, SqPO and PBPO.

## 1 Introduction

In Global Transformations [16] rules may be seen as pairs $(L, R)$ of graphs (or objects in a category $C$) that are applied simultaneously to an input graph (as in L-systems [10] and cellular automata [9]). Such rules are related by pairs of $C$-morphisms. These morphisms come from representing possible overlaps of rules as subrules whose applications are induced by the overlapping applications of rules, therefore establishing a link between these. By computing a colimit of a diagram involving the morphisms between occurrences of right-hand sides, Global Transformations offer the possibility to merge items (vertices or edges) in these occurrences of right-hand sides.

This form of rules has the advantage of simplicity, first because rule morphisms are those of the product category $C \times C$, and second because the input object is completely removed. Indeed, when all occurrences of $L$ have been found in the input graph $G$, the output graph $H$ is produced solely from the corresponding occurrences of $R$, thus effectively removing $G$. In particular, if no $L$ has any match in $G$ then $H$ is the empty graph. If $G$ is, say, a relational database, this may be inconvenient.

More standard approaches to algebraic rewriting use rules for *replacing* matched parts of the input object by new parts. These substitutions are performed by first removing the matched part and then adding the new part, this last operation being performed by a pushout. But since there is no general algebraic way of removing parts of a $C$-object, several approaches have been devised, from DPO [7] to PBPO [4] rules, for defining the *context* (*a C*-object) in which $R$ can be “pushed”. These rules always have an interface $K$ with a pair of $C$-morphisms from $K$ to $L$ and $R$ (a span), but can be more complicated. Hence the necessity of a general notion of morphism between rules that does not depend on a specific shape of rules.

In Section 3 an intuitive analysis of rule subsumptions on a simple example with DPO-rules leads to a natural definition of subsumption morphisms between DPO-rules, and of corresponding subsumption morphisms between direct DPO-transformations. This leads in Section 4 to a general notion of *Rewriting Environment* that provides the relevant categories of rules and of direct transformations, and functors between them and to a category of *partial transformations*.

Section 5 is devoted to the Global Coherent Transformation. It derives from the Parallel Coherent Transformations defined in [2] (only for a variant of DPO-rules), where sets or rules can be applied
simultaneously on an input object. The first step defines the global context as a limit of a diagram that involves the subsumption morphisms.

One important problem is that overlapping applications of rules (i.e., overlapping direct transformations) may conflict as one transformation deletes an item of $G$ that another transformation preserves. Note that conflicts cannot happen with Global Transformations since they preserve nothing. Only non conflicting, so called coherent transformations can be applied simultaneously, hence the notion of Parallel Coherence from [2] must be adapted in order to embrace subsumption morphisms. The adapted definition ensures that the right-hand sides of the rules can be pushed in the global context by means of a colimit.

Section 6 is devoted to the analysis of Rewriting Environments, and yields natural definitions of environments for the SqPO and PBPO approaches. Future work and open questions are found in Section 7.

## 2 Notations

Embeddings are injective functors, all other notions are compatible with [15]. We also use meets and sums of functors, see [12].

For any category $\mathcal{C}$, we write $G \in \mathcal{C}$ to indicate that $G$ is a $\mathcal{C}$-object, and $|\mathcal{C}|$ is the discrete category on $\mathcal{C}$-objects. Then $G$ also denotes the functor from the terminal category $1$ to $|\mathcal{C}|$ that maps the object of $1$ to $G$. $\emptyset$ denotes the initial object of $\mathcal{C}$, if any. The slice category $\mathcal{C} \setminus G$ has as objects $\mathcal{C}$-morphisms of codomain $G$, and as morphisms $h: f \to g \mathcal{C}$-morphisms such that $g \circ h = f$. The coslice category $G \setminus \mathcal{C}$ has as objects $\mathcal{C}$-morphisms of domain $G$, and as morphisms $h: f \to g \mathcal{C}$-morphisms such that $h \circ f = g$.

We will use the standard notion of graphs with multiple directed edges. In the running example we will use graphs with 2 to 3 vertices and 0 to 4 edges denoted directly by their drawings, as in $\bullet \bullet$ and $\circled{2}$. In order to avoid naming vertices, they will always be depicted from left to right, and we will use at most two monomorphisms from one graph to another: one (depicted as a plain arrow) that maps the leftmost (resp. rightmost) vertex of the domain graph to the leftmost (resp. rightmost) vertex of the codomain graph, and one (dotted arrow) that swaps these vertices. For example we consider only two possible morphisms:

<figure><img src="image_2.png" /></figure>

The two morphisms from $\bullet \to \bullet$ to $\circled{2}$ will be distinguished similarly:

<figure><img src="image_3.png" /></figure>

## 3 Subrules in DPO Graph Transformations

The notion of a rule $\rho$ being a subrule of a rule $\rho'$, or more generally of a subsumption morphism $\sigma: \rho \to \rho'$, covers the idea that $\rho$ represents a part (specified by $\sigma$) of what $\rho'$ achieves, and therefore that any application of $\rho'$ entails and subsumes a particular application (obtained through $\sigma$) of $\rho$. We first try to make this idea more precise with DPO-rules.

**Definition 3.1** (DPO rules and direct transformations, gluing condition). A DPO-rule $\rho$ in a category $\mathcal{C}$ is a span diagram

$$L \leftarrow \stackrel{l}{\rightleftarrows} K \stackrel{r}{\rightarrow} R$$
in $\mathcal{C}$, where $l$ is monic. Diagrams in $\mathcal{C}$ are functors from an index category to $\mathcal{C}$, and it will sometime be convenient to refer to the objects and morphisms of this index category; they will be denoted by the corresponding roman letters (here $\rho L = L$, $\rho l = l$, etc.)

We say that an item (edge or vertex) of a graph $G$ is marked for removal by a matching $m: L \to G$ for a rule $\rho$ if it has a preimage by $m$ that has none by $l$ (see [3]). The gluing condition for $m$, $\rho$ states that

$$ \text{all items marked for removal have only one preimage by } m, \quad (\text{GC1}) $$

if a vertex adjacent to an edge is marked for removal, then so is this edge. (GC2)

A direct DPO-transformation $\delta$ in $\mathcal{C}$ is a diagram

<figure><img src="image_4.png" /></figure>

in $\mathcal{C}$ such that $l$ is monic and the two squares are pushouts.

It is well known (see [8, 6]) that in the category of graphs, given $\rho$ and $m: L \to G$, there exists a direct DPO-transformation $\delta$ with $\rho$ and $m$ iff the gluing condition holds. The pushout complement $D$ is then a subgraph of $G$ ($f$ is monic) and contains all the items of $G$ that are not marked for removal.

**Example 3.2.** In the running example we transform every directed edge in a graph into a pair of consecutive edges. This can be expressed as the following rule

<figure><img src="image_5.png" /></figure>

We do not wish to transform loops in this way, hence we adopt the DPO approach restricted to monic matchings. We also wish to create only one middle vertex for parallel edges, so that the input graph $G = \bullet \Leftrightarrow \bullet$ in our running example shall be transformed into $H = \bullet \Leftrightarrow \bullet \Leftrightarrow \bullet$. In order to merge the two vertices created by the two simultaneous applications of $\rho'$ on $G$ we need to link them through the application of a common subrule on their overlap. Consider the rule

<figure><img src="image_6.png" /></figure>

The right hand side expresses the fact that the middle vertex is created depending on the overlap $\bullet$ and not on the edges of $G$. Thus we need to link the middle vertices from $\rho$ and $\rho'$ right-hand sides through a morphism $\sigma^+: \rho \to \rho'$, given as three $\mathcal{C}$-morphisms:

<figure><img src="image_7.png" /></figure>

The two square diagrams commute, and we easily understand that this is necessary for $\rho$ to be a subrule of $\rho'$. But commutation would also hold if the interface graph of $\rho$ were $\emptyset$, and then $\rho$ would remove the overlap $\bullet$ and $\bullet$. This would conflict with $\rho'$ that preserves this part of $G$. We need the two rules to behave similarly on the overlap, which means that the interface of the subrule $\rho$ is determined by the way the interface of $\rho'$ intersects the overlap. This can be expressed by stating that the left square should be a pullback.
**Definition 3.3** (categories $\mathcal{R}_{\text{DPO}}$, $\mathcal{R}_{\text{DPOm}}$). For any category $\mathcal{C}$, let $\mathcal{R}_{\text{DPO}}$ be the category whose objects are the DPO-rules and morphisms (or subsumptions) $\sigma : \rho \to \rho'$ are triples $\sigma = (\sigma_1, \sigma_2, \sigma_3)$ of $\mathcal{C}$-morphisms such that

<figure><img src="image_8.png" /></figure>

(where $L' = \rho'L$ etc.) commutes in $\mathcal{C}$ and the left square is a pullback. Composition is componentwise and the obvious identities are $1_\rho = (1_L, 1_K, 1_R)$ (this is a subcategory of $\mathcal{C}^{\leftarrow\leftarrow\rightarrow}$). Let $\mathcal{R}_{\text{DPOm}}$ be the subcategory of $\mathcal{R}_{\text{DPO}}$ with all rules and all morphisms $\sigma$ such that $\sigma_1$ and $\sigma_2$ are monics.

**Example 3.4.** We consider two morphisms of rules, $\sigma^+$ above and $\sigma^- : \rho \to \rho'$ that swaps the left and right vertices:

<figure><img src="image_9.png" /></figure>

We now see that the gluing condition is inherited (backward) along the morphisms of $\mathcal{R}_{\text{DPOm}}$.

**Proposition 3.5.** If $\mathcal{C}$ is the category of graphs, $\sigma : \rho \to \rho'$ is a morphism in $\mathcal{R}_{\text{DPO}}$ such that $\sigma_1$ is monic and $m' : L' \to G$ satisfies the gluing condition for $\rho'$ then so does $m' \circ \sigma_1 : L \to G$ for $\rho$.

**Example 3.6.** There are two obvious matchings $m'_1$ and $m'_2$ of $\rho'$ in $G$, and they induce two matchings of $\rho$ in $G$, say $m^+ = m'_1 \circ \sigma_1^+ = m'_2 \circ \sigma_1^+$ and $m^- = m'_1 \circ \sigma_1^- = m'_2 \circ \sigma_1^-$. We see that $m'_1$ and $m'_2$ satisfy the gluing condition, hence they have a pushout complement by $l'$ and so do $m^+$ and $m^-$ by $l$. We therefore get two DPO-transformations of $G$ by $\rho$ (below left), one with $(m^+, k^+, n^+, f, g)$ and the other with $(m^-, k^-, n^-, f, g)$, and two DPO-transformations of $G$ by $\rho'$ (below right), one with $(m'_1, k', n', f'_1, g')$ and the other with $(m'_2, k', n', f'_2, g')$.

<figure><img src="image_10.png" /></figure>

The following result reveals the relationship induced by morphisms $\sigma : \rho \to \rho'$ on the corresponding direct DPO-transformations.

**Proposition 3.7.** If $\mathcal{C}$ is the category of graphs, $\sigma : \rho \to \rho'$ is a morphism in $\mathcal{R}_{\text{DPO}}$, $m' : L' \to G$ and $m' \circ \sigma_1 : L \to G$ have pushout complements as below, then there is a unique graph morphism $d$ such that
<figure><img src="image_11.png" /></figure>

commutes.

The existence of $d$ means that all items marked for removal by $m' \circ \sigma_1$, i.e., removed by the subrule $\rho$, are also removed by $\rho'$. In Example 3.6 we have $f = 1_G$, hence with $m' = m'_i$ we get $d = f'_i$. We also see that there are no morphisms between the results of the transformations of $G$ by $\rho$ and $\rho'$, in either direction. This is due to the fact that subrules remove less, but also add less. Subsumptions of rules cannot be deduced from the properties of the transformation functions (from $|C|$ to $|C|$) they induce.

**Definition 3.8** (categories $\mathcal{D}_{\text{DPO}}$, $\mathcal{D}_{\text{DPOm}}$, functors $\text{R}_{\text{DPO}}$, $\text{R}_{\text{DPOm}}$). Let $\mathcal{D}_{\text{DPO}}$ be the category whose objects are direct DPO-transformations in a category $\mathcal{C}$ and whose morphisms (or *subsumptions*) $\mu : \delta \to \delta'$ are 4-tuples $(\mu_1, \mu_2, \mu_3, \mu_4)$ of $\mathcal{C}$-morphisms such that the following diagram

<figure><img src="image_12.png" /></figure>

commutes and the top left square is a pullback, with componentwise composition (but due to the con-
travariance of $\mu_4$ we are not in a functor category anymore). Let $\text{R}_{\text{DPO}}$ be the obvious functor from
$\mathcal{D}_{\text{DPO}}$ to $\mathcal{R}_{\text{DPO}}$, i.e. such that $(\text{R}_{\text{DPO}}\delta)L = \delta L$ etc. and $\text{R}_{\text{DPO}}\mu = (\mu_1, \mu_2, \mu_3)$. Let $\mathcal{D}_{\text{DPOm}}$ be the
full subcategory of $\mathcal{D}_{\text{DPO}}$ whose objects are the direct transformations $\delta$ such that $\delta m$ is monic, and let
$\text{R}_{\text{DPOm}} : \mathcal{D}_{\text{DPOm}} \to \mathcal{R}_{\text{DPOm}}$ be the corresponding restriction of $\text{R}_{\text{DPO}}$.

4 Rewriting Environments

Given an input object $G$ and a category of rules, we are left with the problem of finding all relevant transformations of $G$ by these rules. We cannot simply rely on the matchings of their left-hand sides in $G$ (as in [16]) since they may not have pushout complements, or they may have several non isomorphic ones. We will therefore use the relevant direct transformations, albeit in an abbreviated version that do not contain $L$, since we don't use matchings, nor $H$ since they are not relevant to subsumption.

**Definition 4.1** (category $C_{\text{pt}}$, functors $\text{ln}$, $\text{P}_{\text{DPOm}}$). A *partial transformation* $\tau$ in $\mathcal{C}$ is a diagram

$$
G \leftarrow f \quad D \leftarrow k \quad K \longrightarrow r \quad R
$$

For any category $\mathcal{C}$, let $C_{\text{pt}}$ be the category whose objects are partial transformations and morphisms $\nu : \tau \to \tau'$ are triples $(\nu_1, \nu_2, \nu_3)$ such that
<figure><img src="image_13.png" /></figure>

commutes in $\mathcal{C}$, with obvious composition and identities.

Let $\ln: \mathcal{C}_{\text{pt}} \to |\mathcal{C}|$ be the *input functor* defined as $\ln\tau = G$. Let $\mathbb{P}_{\text{DPO}}: \mathcal{D}_{\text{DPO}} \to \mathcal{C}_{\text{pt}}$ and $\mathbb{P}_{\text{DPOm}}: \mathcal{D}_{\text{DPOm}} \to \mathcal{C}_{\text{pt}}$ be the obvious functors (such that $(\mathbb{P}_{\text{DPO}}\delta)G = \delta G$ etc. and $\mathbb{P}_{\text{DPO}}\mu = (\mu_4, \mu_2, \mu_3)$).

Using inverse images along $\mathbb{P}_{\text{DPOm}}$ and $\mathbb{R}_{\text{DPOm}}$ we can easily focus on the direct transformations of concern (and the morphisms between them), i.e., the transformations of a graph by a rule.

**Definition 4.2** (Rewriting Environments, rule systems, notations $D_\delta$, $\pi_1\mu$ ...). For any category $\mathcal{C}$, a *Rewriting Environment* for $\mathcal{C}$ consists of a category $\mathcal{D}$ of direct transformations, a category $\mathcal{R}$ of rules and two functors

$$ \mathcal{R} \leftarrow \mathcal{R} \quad \mathcal{D} \rightarrow \mathcal{D} \quad \mathcal{P} \rightarrow \mathcal{P} \quad \mathcal{C}_{\text{pt}} $$

A *rule system* in a *Rewriting Environment* is a category $\mathcal{S}$ with an embedding $\iota: \mathcal{S} \to \mathcal{R}$ (alternately, $\mathcal{S}$ is a subcategory of $\mathcal{R}$ and $\iota$ is the inclusion functor).

Given a rule system and an *input* $\mathcal{C}$-object $G$, we build the categories $\mathcal{D}|_G$, $\mathcal{D}|_G^S$ and functors $\mathbb{I}_G$, $\mathbb{I}_S$, $\mathbb{R}|_G^S$ as meets of previous functors:

<figure><img src="image_14.png" /></figure>

For any $\delta \in \mathcal{D}|_G^S$ we write $D_\delta$ for $(\mathbb{P}_G|_S\delta)D$ and similarly $f_\delta$ etc. For any $\mu: \delta \to \delta'$ in $\mathcal{D}|_G^S$ we write $\pi_1\mu$ for the first coordinate of $\mathbb{P}_G|_S\mu$ and similarly $\pi_2\mu, \pi_3\mu$.

**Example 4.3.** For $\mathcal{S}$ we take the subcategory $\rho \underset{\sigma^-}{\stackrel{\sigma^+}{\rightleftharpoons}} \rho'$ of $\mathcal{R}_{\text{DPO}}$. To the matchings $m'_1$ and $m'_2$

of $\rho'$ in $G$ correspond two<fnref n="1" /> transformations in $\mathcal{D}_{\text{DPOm}}$ that will be denoted $\delta'_1$ and $\delta'_2$ (depicted on the right in Example 3.6). To the matchings $m^+$ and $m^-$ of $\rho$ in $G$ correspond another two transformations denoted $\delta^+$ and $\delta^-$ (on the left in Example 3.6). To each $i = 1, 2$ correspond one morphism $\mu_i^+ : \delta^+ \to \delta'_i$ such that $\mathbb{R}_{\text{DPOm}}\mu_i^+ = \sigma^+$ and one morphism $\mu_i^- : \delta^- \to \delta'_i$ such that $\mathbb{R}_{\text{DPOm}}\mu_i^- = \sigma^-$. Thus $\mathcal{D}_{\text{DPOm}}|_G^S$ is the following subcategory of $\mathcal{D}_{\text{DPOm}}$.

<figure><img src="image_15.png" /></figure>

<footnote n="1">¹We consider transformations only up to isomorphisms, see Footnote 2.</footnote>
# 5 Global Coherent Transformations

As stated above we will use the partial transformations that are accessible from $\mathcal{D}|_G^S$ through $P \circ I_G \circ I_S$ (a restriction of $P$). We first need to build a context between the input $G$ and the expected output $H$. In Parallel Coherent Transformation [2] the context is obtained as a limit of the morphisms $f_\delta : D_\delta \to G$ (that need not be monics) for all $\delta$ in a set $\Delta$ of direct transformations, hence of a diagram that is a sink to $G$ and thus corresponds to a discrete diagram in $C \setminus G$. In Global Coherent Transformations the global context (denoted $C_\Delta$ below) is obtained similarly, but now $\Delta$ is a category and the diagram contains the morphisms $\pi_1\mu : f_{\delta'} \to f_\delta$ for all $\mu : \delta \to \delta'$ in $\Delta$ (since $f_\delta \circ \pi_1\mu = f_{\delta'}$).

**Definition 5.1** (functor $P_\Delta^\leftarrow$, limit $f_\Delta : C_\Delta \to G$, limit cone $\gamma_\Delta$). For any subcategory $\Delta$ of $\mathcal{D}|_G^S$ let $P_\Delta^\leftarrow : \Delta^{OP} \to C \setminus G$ be the contravariant functor that maps every $\delta \in \Delta$ to $f_\delta : D_\delta \to G$ and every morphism $\mu$ of $\Delta$ to $\pi_1\mu : f_{\delta'} \to f_\delta$. Let $f_\Delta : C_\Delta \to G$ be the limit of $P_\Delta^\leftarrow$ and $\gamma_\Delta$ be the limit cone from $f_\Delta$ to $P_\Delta^\leftarrow$.

Note that if $\Delta$ is empty then the limit $f_\Delta$ of the empty diagram is the terminal object of $C \setminus G$, that is $1_G$, hence $C_\Delta = G$.

**Example 5.2.** Let $\Delta = \mathcal{D}_{\text{DPOm}}|_G^S$. The diagram on the left below corresponds to the functor $P_\Delta^\leftarrow$ together with the morphisms $f_\delta^\pm : D_\delta^\pm \to G$ (objects in $C \setminus G$). The limit of this diagram yields $C_\Delta = \bullet$ and the limit cone is represented on the right.

<figure><img src="image_16.png" /></figure>

We next need to check that the transformations in $\Delta$ do not conflict with each other, i.e., that for all $\delta \in \Delta$ the image of $K_\delta$ in $G$ is not only preserved by $\delta$ (in $D_\delta$) but also by all other transformations $\delta' \in \Delta$. This is ensured by finding (natural) cones from these $K_\delta$ to the $D_{\delta'}$, which we shall formulate with $P_\Delta^\leftarrow$, hence in $C \setminus G$.

**Definition 5.3** (coherent system of cones, morphisms $c_\delta$, global coherence). A coherent system of cones for $\Delta$ is a set of cones $\gamma_\delta$ from $f_\delta \circ k_\delta$ to $P_\Delta^\leftarrow$ such that $\gamma_\delta\delta = k_\delta$ for all $\delta \in \Delta$, and $\gamma_\delta = \gamma_{\delta'} \circ \pi_2\mu$ for all $\mu : \delta \to \delta'$ in $\Delta$. $\Delta$ is globally coherent if there exists a coherent system of cones for $\Delta$. We then let $c_\delta : f_\delta \circ k_\delta \to f_\Delta$ be the unique morphism in $C \setminus G$ such that $\gamma_\delta = \gamma_\Delta \circ c_\delta$.

Note that if $\gamma_{\delta'}$ is a cone from $f_{\delta'} \circ k_{\delta'}$ to $P_\Delta^\leftarrow$ then $\gamma_{\delta'} \circ \pi_2\mu$ is a cone from $f_\delta \circ k_\delta$ to $P_\Delta^\leftarrow$, hence global coherence means that we should find cones for overlapping direct transformations (say $\delta'_1$ and $\delta'_2$), with the constraint that they should be compatible on their common subtransformations $\delta'_1 \leftarrow \delta \to \delta'_2$. If $S$ and therefore $\Delta$ are discrete, this amounts to parallel coherence (that generalizes parallel independence in DPO, see [2]).

**Example 5.4.** On our example the four graphs $K_{\delta_i^\pm}$ are equal to $\bullet$ $\bullet$. It is easy to build the four cones from the four morphisms from $K_{\delta_i'}$ to $D_{\delta_i'}$ depicted below, by composing them with the $\pi_1\mu_i^\pm$ on the left and the $\pi_2\mu_i^\pm$ on the right. On the right are also depicted the morphisms $c_{\delta_i^\pm}$.
<figure><img src="image_17.png" /></figure>

The reader may check that $\gamma_{\delta'_1} \circ \pi_2 \mu_1^+ = \gamma_{\delta'_2} \circ \pi_2 \mu_2^+$ (this is $\gamma_{\delta^+}$) and $\gamma_{\delta'_1} \circ \pi_2 \mu_1^- = \gamma_{\delta'_2} \circ \pi_2 \mu_2^-$ ($= \gamma_{\delta^-}$).

The morphisms $c_\delta$ specify where the right-hand sides $R_\delta$ should be pushed in the global context.

**Definition 5.5** (morphisms $h_\delta : C_\Delta \to H_\delta$). If $\Delta$ is globally coherent for all $\delta \in \Delta$ then $c_\delta$ can be viewed as a $C$-morphism $c_\delta : K_\delta \to C_\Delta$, and we consider the following pushout in $C$.

<figure><img src="image_18.png" /></figure>

**Example 5.6.** On our example we get:

<figure><img src="image_19.png" /></figure>

Thanks to the coherent system of cones we can turn $h$ into a functor.

**Proposition 5.7.** For every $\mu : \delta \to \delta'$ in $\Delta$ there exists a unique $h_\mu$ such that

<figure><img src="image_20.png" /></figure>

commutes.

**Corollary 5.8.** By unicity we get $h_{\mu' \circ \mu} = h_{\mu'} \circ h_\mu$.

**Example 5.9.** For instance the morphisms $\mu_i^- : \delta^- \to \delta_i'$ yield the morphisms $h_{\mu_i^-}$ depicted below.

<figure><img src="image_21.png" /></figure>
The final step of the Global Coherent Transformation, symmetric to the first step, consists in taking the colimit in the coslice category $C_\Delta \setminus \mathcal{C}$ of the covariant diagram of index $\Delta$ with objects $h_\delta$ and morphisms $h_\mu : h_\delta \to h_{\delta'}$ for all $\mu : \delta \to \delta'$ in $\Delta$.

**Definition 5.10** (functor $P_\Delta^\to$, colimit $h_\Delta : C_\Delta \to H_\Delta$). If $\Delta$ is globally coherent let $P_\Delta^\to : \Delta \to C_\Delta \setminus \mathcal{C}$ be the functor defined by $P_\Delta^\to \delta = h_\delta$ (interpreted as an object of $C_\Delta \setminus \mathcal{C}$) and $P_\Delta^\to \mu = h_\mu$ for all $\mu : \delta \to \delta'$ in $\Delta$. Let $h_\Delta : C_\Delta \to H_\Delta$ be the colimit<fnref n="2" /> of $P_\Delta^\to$, then the $\mathcal{C}$-span $G \stackrel{f_\Delta}{\leftarrow} C_\Delta \stackrel{h_\Delta}{\longrightarrow} H_\Delta$ is a Global Coherent Transformation by $\Delta$.

If $\Delta$ is empty then the colimit $h_\Delta$ of the empty diagram is the initial object of $C_\Delta \setminus \mathcal{C}$, that is $1_{C_\Delta}$, hence $H_\Delta = C_\Delta = G$. Generally, the functor $P_\Delta^\to$ depends on the choice of cones $\gamma_\delta$ for $\delta \in \Delta$, hence $h_\Delta$ is not determined by $\Delta$.

**Example 5.11.** The functor $P_\Delta^\to$ applied to $\Delta$ yields the following diagram

<figure><img src="image_22.png" /></figure>

The leftmost vertices of these five graphs are connected as images or preimages of each other, and similarly for the five right vertices, and the four middle vertices. The four edges are not likewise connected, hence the colimit of this diagram is the expected result $H = \mathcal{G}$. We therefore see that the two middle vertices created in $\delta'_1$ and $\delta'_2$ are merged by their common subtransformation $\delta^+$ (or $\delta^-$), but also that the two middle vertices created in $\delta^+$ and $\delta^-$ are merged by their common subsuming transformation $\delta'_1$ (or $\delta'_2$).

If we apply $S$ to the graph $G' = \bullet$ then rule $\rho'$ does not apply to $G'$ and hence the two matchings of $\rho$ in $G'$ apply independently, thus adding two vertices to $G'$. We can merge them by adding to $S$ the following rule morphism $\sigma : \rho \to \rho'$ that swaps the left and right vertices:

<figure><img src="image_23.png" /></figure>

We have $\sigma^2 = 1_\rho$ hence $\sigma$ is an automorphism of $\rho$. Adding $\sigma$ to $S$ means that the symmetric applications of $\rho$, i.e., direct transformations with matchings $m$ and $m \circ \sigma$, shall be merged (this seems to generalize to the algebraic context the notion of Parallel Rewriting Modulo Automorphism devised in an algorithmic approach in [1]). Since $\sigma^+ \circ \sigma = \sigma^-$ and $\sigma^- \circ \sigma = \sigma^+$, the new rule system is

$$S' = \sigma \mathcal{C} \rho \underset{\sigma^-}{\stackrel{\sigma^+}{\rightleftharpoons}} \rho'$$

<footnote n="2">² Global Coherent Transformations are obtained as limits and colimits of diagrams whose index category is $\Delta$, hence are not affected by isomorphisms in $\Delta$, which can therefore be replaced by its skeleton.</footnote>
If we apply $S'$ to $G$, we add two new morphisms in $\mathcal{D}_{\text{DPOm}}|_{G}^{S}$, i.e,

$$ \Delta' = \mathcal{D}_{\text{DPOm}}|_{G}^{S'} = \begin{tikzpicture}[baseline={([yshift=-.5ex]current bounding box.center)}, scale=0.75, every node/.style={scale=0.75}]
  \node (u1) at (0,0) {$\delta_1'$};
  \node (u2) at (0,1) {$\delta_2'$};
  \node (d1) at (1,0) {$\mu_1'$};
  \node (d2) at (1,1) {$\mu_2'$};
  \node (d3) at (2,0) {$\delta^+$};
  \node (d4) at (2,1) {$\delta^-$};
  \draw[->] (u1) -- (d1);
  \draw[->] (u2) -- (d2);
  \draw[->] (d3) -- (d4);
  \node at (0.5,0.2) {$\mu_1^+$};
  \node at (0.5,1.2) {$\mu_1^-$};
  \node at (1.5,0.2) {$\mu_2^+$};
  \node at (1.5,1.2) {$\mu_2^-$};
  \node at (2.5,0.2) {$\delta^+$};
  \node at (2.5,1.2) {$\delta^-$};
  \node at (0.25,0.5) {$\delta_1'$};
  \node at (0.25,1.5) {$\delta_2'$};
\end{tikzpicture} $$

It is easy to see that the Global Coherent Transformation by $\Delta'$ is the same as above with $\Delta$. This is due to the fact that $\delta^+$ and $\delta^-$ are already related in $\Delta$ through $\delta'_1$ (or $\delta'_2$).

We finally prove that, apart from this mechanism of sharing common subtransformations, isolated transformations always subsume their subtransformations, so that morphisms in $\mathcal{R}$ are rule subsumptions as intended.

**Proposition 5.12.** If $\Delta'$ is restricted to $\delta'$ and $\Delta$ to $\mu: \delta \to \delta'$ (or more generally if $\delta'$ is terminal in $\Delta$) then $\Delta$ and $\Delta'$ are globally coherent and $H_{\Delta} \simeq H_{\Delta'}$.

# 6 Some Rewriting Environments and Their Properties

An obvious property of Rewriting Environments is that they can be combined: if $\mathcal{R}_1 \stackrel{\mathcal{R}_1}{\rightleftarrows} \mathcal{D}_1 \stackrel{\mathcal{P}_1}{\rightarrow} \mathcal{C}_{\text{pt}}$ and $\mathcal{R}_2 \stackrel{\mathcal{R}_2}{\rightleftarrows} \mathcal{D}_2 \stackrel{\mathcal{P}_2}{\rightarrow} \mathcal{C}_{\text{pt}}$ are Rewriting Environments for $\mathcal{C}$ then so is $\mathcal{R}_1 + \mathcal{R}_2 \stackrel{\mathcal{R}_1+\mathcal{R}_2}{\rightleftarrows} \mathcal{D}_1 + \mathcal{D}_2 \stackrel{[\mathcal{P}_1, \mathcal{P}_2]}{\rightarrow} \mathcal{C}_{\text{pt}}$. It is therefore possible to mix rules of different approaches to transform a graph, though of course rules of distinct approaches cannot subsume each other.

A property that one might reasonably expect is that when a rule applies and yields a direct transformation then its subrules also apply and yield subtransformations. We express this by means of the following notion.

**Definition 6.1 (right-full).** A functor $F: \mathcal{A} \to \mathcal{B}$ is right-full$^3$ if for all $a' \in \mathcal{A}$, all $b \in \mathcal{B}$ and all $g: b \to Fa'$, there exist $a \in \mathcal{A}$ and $f: a \to a'$ such that $Ff = g$.

It is obvious that right-fullness is closed by composition.

**Lemma 6.2.** $|_{G}$ is a full and right-full embedding.

**Proposition 6.3.** If $\mathcal{R}$ is right-full (resp. faithful) then so is $\mathcal{R}|_{G}^{S}$ for every rule system $\mathcal{S}$ and $G \in \mathcal{C}$.

Hence when $\mathcal{R}$ is right-full and faithful every morphism $\sigma: \rho \to \rho'$ in $\mathcal{S}$ is reflected by a morphism in $\mathcal{D}|_{G}^{S}$ whenever $\rho'$ is reflected by a direct transformation $\delta'$ (i.e., whenever $\rho'$ applies to $G$), and this morphism is uniquely determined by $\sigma$ and $\delta'$.

## 6.1 Double-Pushouts

Definitions 3.3, 3.8 and 4.1 provide two Rewriting Environments that we may call DPO and DPOm. By Proposition 3.7 it is obvious that $\mathcal{R}_{\text{DPO}}$ and $\mathcal{R}_{\text{DPOm}}$ are faithful when $\mathcal{C}$ is the category of graphs. This is easily seen to generalize to all adhesive categories [11]. Proposition 3.7 generalizes as follows:

**Proposition 6.4.** If $\mathcal{C}$ is adhesive, $\delta, \delta' \in \mathcal{D}_{\text{DPO}}$ and $\sigma: \mathcal{R}_{\text{DPO}}\delta \to \mathcal{R}_{\text{DPO}}\delta'$ such that $m = m' \circ \sigma_1$ then there exists a unique $\mu: \delta \to \delta'$ such that $\mathcal{R}_{\text{DPO}}\mu = \sigma$.

<footnote>$^3$This is named after the symmetric definition of left-full functors in [17, p. 63].</footnote>
According to Proposition 3.5 it is obvious that $R_{DPOm}$ is right-full (when $C$ is the category of graphs). It is easy to see that $R_{DPO}$ is not right-full (with $\sigma_1$ not monic, see Proposition 3.5).

One drawback with span rules is that every item matched by $m$ that is not removed must be preserved in the result, hence cannot be removed by an overlapping rule, by the requirement of global coherence. In [2] we have defined weak DPO-rules by inserting a second interface $I$ between $K$ and $L$. A weak DPO transformation is a diagram

<figure><img src="image_24.png" /></figure>

so that the images of items in $I$ are not removed by this transformation, but only images of items in $K$ may not be removed by any simultaneous transformation. In cellular automata we need items in $I$ that match the states of the neighbour cells, but there should be none in $K$ since these states may be modified by overlapping rules (see [2, Example 3], note that $K$ and $I$ are swapped).

It is easy to define subsumption morphisms between weak DPO-rules (as 4-tuples of $C$-morphisms with commuting properties and a pullback as in Definition 3.3), and corresponding morphisms between direct transformations of weak DPO-rules (as 5-tuples of $C$-morphisms with commuting properties and a pullback as in Definition 3.8). This yields a Rewriting Environment for weak double-pushouts.

## 6.2 Sesqui-Pushouts

We now consider the case of Sesqui-Pushouts [5]. It is based on the notion of final pullback complement that allows not only to remove parts of the input $G$ but also to make copies of parts of $G$.

**Definition 6.5** (category $\mathcal{R}_{\text{SqPO}}$, direct SqPO-transformations). A SqPO-rule $\rho$ in $C$ is a span diagram $L \stackrel{l}{\leftarrow} K \stackrel{r}{\rightarrow} R$. Let $\mathcal{R}_{\text{SqPO}}$ be the category whose objects are the SqPO-rules and morphisms $\sigma : \rho \rightarrow \rho'$ are triples $\sigma = (\sigma_1, \sigma_2, \sigma_3)$ such that

<figure><img src="image_25.png" /></figure>

commutes in $C$ and the left square is a pullback, with obvious composition and identities. Let $\mathcal{R}_{\text{SqPOm}}$ be the subcategory with morphisms $\sigma$ such that $\sigma_1$ and $\sigma_2$ are monics.

A final pullback complement of $(m, l)$ is a pair $(f, k)$ such that $(k, l)$ is a pullback of $(f, m)$ and for every pullback $(k', l \circ c)$ of any $(f', m)$ there exists a unique $d$ such that

<figure><img src="image_26.png" /></figure>
commutes.

A direct SqPO-transformation in $\mathcal{C}$ is a diagram

<figure><img src="image_27.png" /></figure>

such that $(f, k)$ is a final pullback complement of $(m, l)$ and the right square is a pushout.

**Proposition 6.6.** For every direct SqPO-transformations $\delta, \delta'$ with corresponding SqPO-rules $\rho, \rho'$, every $\sigma : \rho \to \rho'$ in $\mathcal{R}_{\text{SqPO}}$ such that $m = m' \circ \sigma_1$, there exists a unique $\mathcal{C}$-morphism $d$ such that

<figure><img src="image_28.png" /></figure>

commutes.

Here the existence of $d$ means not only that $\rho'$ removes at least as much as its subrule $\rho$, but also that it makes at least as many copies of the items of $G$. Note that when, among two simultaneous transformations, one makes $p$ copies of an item and the other makes $q$ copies of the same item, the global context must contain $pq$ copies of this item, unless there is a subsumption morphism between them. In such a case all the copies made by the subsumed transformation are simply merged with those made by the subsuming one (as witnessed by Proposition 5.12). Hence the necessary symmetry between the first and last steps of the Global Coherent Transformation.

It is then easy to define the category $\mathcal{D}_{\text{SqPO}}$ of direct SqPO-transformations, the category $\mathcal{D}_{\text{SqPOm}}$ of direct SqPO-transformations with monic matches and faithful functors $R_{\text{SqPO}} : \mathcal{D}_{\text{SqPO}} \to \mathcal{R}_{\text{SqPO}}$ and $R_{\text{SqPOm}} : \mathcal{D}_{\text{SqPOm}} \to \mathcal{R}_{\text{SqPOm}}$, as in Definition 3.8. We leave this to the reader.

**Proposition 6.7.** In the category of graphs $R_{\text{SqPOm}}$ is right-full.

Another notion of subrule in the Sesqui-Pushout approach can be found in [14, Definition 8], where a rule $\rho'$ is defined as a $(\sigma_1, \sigma_3)$-extension of $\rho$ if two conditions are met. The first is that $\sigma_3 \circ \rho = \rho' \circ \sigma_1$, where $\sigma_1$ stands for the span $L \stackrel{1_L}{\leftarrow} L \xrightarrow{\sigma_1} L'$ (and similarly for $\sigma_3$) and $\circ$ is the standard composition of spans (using pullbacks, see [14, Definition 3]). The products $\sigma_3 \circ \rho, \rho' \circ \sigma_1$ yield

<figure><img src="image_29.png" /></figure>

<figure><img src="image_30.png" /></figure>
hence the equality between these two bottom spans is equivalent to the existence of $(\sigma_1, \sigma_2, \sigma_3) : \rho \to \rho'$,
i.e. that the left square in Definition 6.5 is a pullback and the right square commutes. This means that
any extension of a rule according to [14, Definition 8] subsumes this rule according to Definition 6.5.
The converse is false since the extension requires a second condition, namely that $(\sigma_1, l)$ has a final
pullback complement. This ensures that the extension can be decomposed as a product of two spans [14,
Proposition 9], but this is relevant to sequential rewriting and not to the present notion of subsumption.

## 6.3 Pullback-Pushouts

We next consider the case of PBPO-rules [4], that also enables copies of parts of $G$ but with better control of the way they are linked together and to the rest of $G$. The drawback is that matchings of the left-hand side of a rule into $G$ should be completed with a co-match from $G$ to a given “type” of the left-hand side.

**Definition 6.8** (category $\mathcal{D}_{\text{PBPO}}$, direct PBPO-transformations). A PBPO-rule $\rho$ in $C$ is a commuting diagram

<figure><img src="image_31.png" /></figure>

A morphism $\sigma : \rho \to \rho'$ is a 5-tuple $(\sigma_1, \sigma_2, \sigma_3, \sigma_4, \sigma_5)$ of $C$-morphisms such that

<figure><img src="image_32.png" /></figure>

commutes. Let $\mathcal{D}_{\text{PBPO}}$ be the category of PBPO-rules on $C$ and their morphisms, with obvious composition and identities.

A direct PBPO-transformation in $C$ is a commuting diagram

<figure><img src="image_33.png" /></figure>

with lower left pullback and upper right pushout.

To every direct PBPO-transformation obviously corresponds a PBPO-rule and a partial transformation.
**Proposition 6.9.** For every direct PBPO-transformations $\delta, \delta'$ with corresponding PBPO-rules $\rho, \rho'$, every $\sigma: \rho \to \rho'$ in $\mathcal{D}_{\text{PBPO}}$ such that $m = m' \circ \sigma_1$ and $t_G = \sigma_4 \circ t_{G'}$, there exists a unique $C$-morphism $d$ such that

<figure><img src="image_34.png" /></figure>

commutes.

We leave it to the reader to define a Rewriting Environment for PBPO-rules and transformations, with a right-full faithful functor $R_{\text{PBPO}} : \mathcal{D}_{\text{PBPO}} \to \mathcal{R}_{\text{PBPO}}$ (provided $C$ has pushouts and pullbacks).

# 7 Conclusion and Future Work

Global Coherent Transformations are built from partial transformations in a way pertaining both to Parallel Coherent Transformations [2], by the use of limits on local contexts, and to Global Transformations [16] by applying categories of rules. The partial transformations involved in a Global Coherent Transformation are extracted from a Rewriting Environment that provide a category of rules and a corresponding category of direct transformations. Their morphisms can be understood as subsumptions due to Property 5.12, i.e., that any subsumed transformation as defined by a morphism removes or adds nothing more than the subsuming transformation. This is valid even when rules are able to make multiple copies of parts of the input.

We have provided Rewriting Environments for the most common approaches to algebraic rewriting, except the Single Pushout [13], which will be done in a future paper (where we will see that the interface and right-hand side provided in a partial transformation are not necessarily those of the applied rule). We also intend to show that Global Transformations can be obtained as Global Coherent Transformations in a suitable environment (except when $\Delta$ is empty). Expressiveness of Global Coherent Transformations should be investigated further, and possibly enhanced.

The notion of Rewriting Environment is as simple as required to define Global Coherent Transformations, but does not guarantee some properties that the user might reasonably expect. In particular it does not prevent the categories $\mathcal{R}$ and $\mathcal{D}$ from being discrete. Of course this is correct if no subsumption is possible, but is there a way to characterize such properties? It may also seem strange that, through $C_{\text{pt}}$, rules are not assumed to have left-hand sides and direct transformations are not assumed to use matchings. Thus we may need to enhance Rewriting Environments with a notion of matching in order to better understand their structure. We also need to further analyze the properties of the Rewriting Environments in Section 6: when $C$ is an adhesive category it is an open question whether $R_{\text{DPOm}}$ is right-full.

**Acknowledgements** We thank Rachid Echahed for helpful discussions and an anonymous reviewer in particular for suggesting the generalization of Proposition 5.12.
References

[1] T. Boy de la Tour & R. Echahed (2020): *Parallel Rewriting of Attributed Graphs*. Theoretical Computer Science 848, pp. 106–132, doi:10.1016/j.tcs.2020.09.025.

[2] T. Boy de la Tour & R. Echahed (2021): *Parallel Coherent Graph Transformations*. In: Recent Trends in Algebraic Development Techniques, 25th International Workshop, WADT 2020, Revised Selected Papers, LNCS 12669, Springer, pp. 75–97, doi:10.1007/978-3-030-73785-6_5.

[3] Thierry Boy de la Tour (2023): *Algebraic Monograph Transformations*, doi:10.48550/ARXIV.2303.01137.

[4] Andrea Corradini, Dominique Duval, Rachid Echahed, Frédéric Prost & Leila Ribeiro (2019): *The PBPO graph transformation approach*. *J. Log. Algebr. Meth. Program.* 103, pp. 213–231, doi:10.1016/j.jlamp.2018.12.003.

[5] Andrea Corradini, Tobias Heindel, Frank Hermann & Barbara König (2006): *Sesqui-Pushout Rewriting*. In: *ICGT 2006*, LNCS 4178, Springer, pp. 30–45, doi:10.1007/118418834.

[6] Andrea Corradini, Ugo Montanari, Francesca Rossi, Hartmut Ehrig, Reiko Heckel & Michael Löwe (1997): *Algebraic Approaches to Graph Transformation - Part I: Basic Concepts and Double Pushout Approach*. In Grzegorz Rozenberg, editor: *Handbook of Graph Grammars and Computing by Graph Transformations, Volume 1: Foundations*, World Scientific, pp. 163–246, doi:10.1142/9789812384720_0003.

[7] Hartmut Ehrig (1979): *Introduction to the algebraic theory of graph grammars (a survey)*. In Volker Claus, Hartmut Ehrig & Grzegorz Rozenberg, editors: *Graph-Grammars and Their Application to Computer Science and Biology*, Springer Berlin Heidelberg, Berlin, Heidelberg, pp. 1–69, doi:10.1007/BFb0025714.

[8] Hartmut Ehrig, Karsten Ehrig, Ulrike Prange & Gabriele Taentzer (2006): *Fundamentals of Algebraic Graph Transformation*. Monographs in Theoretical Computer Science. An EATCS Series, Springer, doi:10.1007/3-540-31188-2.

[9] Alexandre Fernandez, Luidnel Maignan & Antoine Spicher (2021): *Cellular Automata and Kan Extensions*. In Alonso Castillo-Ramirez, Pierre Guillon & Kévin Perrot, editors: *27th IFIP WG 1.5 International Workshop on Cellular Automata and Discrete Complex Systems, AUTOMATA 2021, OASICS 90*, Schloss Dagstuhl - Leibniz-Zentrum für Informatik, pp. 7:1–7:12, doi:10.4230/OASICS.AUTOMATA.2021.7.

[10] Alexandre Fernandez, Luidnel Maignan & Antoine Spicher (2022): *Non-Determinism in Lindenmayer Systems and Global Transformations*. In Stefan Szeider, Robert Ganian & Alexandra Silva, editors: *47th International Symposium on Mathematical Foundations of Computer Science, MFCS 2022, LIPIcs 241*, Schloss Dagstuhl - Leibniz-Zentrum für Informatik, pp. 49:1–49:13, doi:10.4230/LIPIcs.MFCS.2022.49.

[11] Stephen Lack & Pawel Sobocinski (2005): *Adhesive and quasiadhesive categories*. Informatique Théorique et Applications 39(3), pp. 511–545, doi:10.1051/ita:2005028.

[12] F. W. Lawvere (1963): *Functorial Semantics of Algebraic Theories*. Ph.D. thesis, Columbia University, doi:10.1073/pnas.50.5.869. Available at http://www.tac.mta.ca/tac/reprints/articles/5/tr5abs.html.

[13] Michael Löwe (1993): *Algebraic Approach to Single-Pushout Graph Transformation*. Theoretical Computer Science 109, pp. 181–224, doi:10.1016/0304-3975(93)90068-5.

[14] Michael Löwe (2015): *Polymorphic Sesqui-Pushout Graph Rewriting*. In Francesco Parisi-Presicce & Bernhard Westfechtel, editors: *Graph Transformation - 8th International Conference, ICGT 2015, Lecture Notes in Computer Science* 9151, Springer, pp. 3–18, doi:10.1007/978-3-319-21145-9_1.

[15] Saunders Mac Lane (1997): *Categories for the Working Mathematician*, 2nd edition. Graduate Texts in Mathematics 5, Springer-Verlag, New York, doi:10.1007/978-1-4757-4721-8. (1st ed., 1971).

[16] Luidnel Maignan & Antoine Spicher (2015): *Global Graph Transformations*. In Detlef Plump, editor: *Proceedings of the 6th International Workshop on Graph Computation Models, CEUR Workshop Proceedings* 1403, CEUR-WS.org, pp. 34–49. Available at http://ceur-ws.org/Vol-1403/paper4.pdf.

[17] Peter Selinger (1997): *Functionality, Polymorphism, and Concurrency: a Mathematical Investigation of Programming Paradigms*. Ph.D. thesis, University of Pennsylvania. Technical Report No. IRCS-97-17.
# Appendix: Proofs

*Proof of Proposition 3.5.* If $\sigma : \rho \to \rho'$ in $\mathcal{R}_{\text{DPO}}$ such that $\sigma_1$ is monic and $m' : L' \to G$ satisfies the gluing condition for $\rho'$ then so does $m' \circ \sigma_1 : L \to G$ for $\rho$.

We use the fact that the pullback $K$ of $l'$, $\sigma_1$ is isomorphic to an equalizer in $L \times K'$.

(GC1) Let $x$ be an item in $L$ such that $m' \circ \sigma_1(x)$ is marked for removal for $\rho$, hence such that $x$ has no preimage by $l$, and let $x'$ in $L$ such that $m' \circ \sigma_1(x) = m' \circ \sigma_1(x')$. If $\sigma_1(x)$ had a preimage $y$ by $l'$ then $x$ and $y$ would have a common preimage in the pullback $K$, a contradiction. Hence $\sigma_1(x)$ has no preimage by $l'$ so that $m'(\sigma_1(x))$ is marked for removal by $m'$, hence $\sigma_1(x) = \sigma_1(x')$ by the (GC1) for $m'$, $\rho'$, hence $x = x'$.

(GC2) Let $v$ be a vertex of $L$ that has no preimage by $l$ and is adjacent to an edge $e$ in $L$, then as above $\sigma_1(v)$ has no preimage by $l'$. If $e$ had a preimage $e'$ by $l$ then $l' \circ \sigma_2(e') = \sigma_1 \circ l(e') = \sigma_1(e)$, i.e., $\sigma_1(e)$ would have a preimage by $l'$ in contradiction with (GC2) for $m'$, $\rho'$. Hence $m' \circ \sigma_1(e)$ is marked for removal by $m' \circ \sigma_1$ for $\rho'$.

*Proof of Proposition 3.7.* If $\sigma : \rho \to \rho'$ in $\mathcal{R}_{\text{DPO}}$, $m' : L' \to G$ and $m' \circ \sigma_1 : L \to G$ have pushout complements as below, then there is a unique $d$ such that

<figure><img src="image_35.png" /></figure>

commutes.

The front and back faces are pushouts. For all item $x$ in $D'$, $f'(x)$ is not marked for removal by $m'$ and we show that is also the case by $m' \circ \sigma_1$. Suppose otherwise, then $f'(x)$ has a preimage $y$ by $m' \circ \sigma_1$ that has no preimage by $l$. However, $\sigma_1(y)$ has a preimage $y'$ by $l'$, and since the top face is a pullback there should be a common preimage of $y$ and $y'$ in $K$, a contradiction. Thus we let $d(x)$ be the unique preimage of $f'(x)$ by $f$, so that $d$ is unique such that $f \circ d = f'$. We easily see that $f \circ k = f \circ d \circ k' \circ \sigma_2$ hence the right face of the cube commutes. $\square$

*Proof of Proposition 5.7.* For every $\mu : \delta \to \delta'$ in $\Delta$ there exists a unique $h_\mu$ such that

<figure><img src="image_36.png" /></figure>

commutes.

Since $\gamma_\Delta \circ c_\delta = \gamma_\delta = \gamma_{\delta'} \circ \pi_2\mu = \gamma_\Delta \circ c_{\delta'} \circ \pi_2\mu$ then by the unicity of $c_\delta$ the left face of the following cube commutes.
<figure><img src="image_37.png" /></figure>

Since the top and front faces also commute then $n_{\delta'} \circ \pi_3\mu \circ r_{\delta} = h_{\delta'} \circ c_{\delta}$, and since the back face is a pushout we get the result. □

*Proof of Proposition 5.12. If $\Delta'$ is restricted to $\delta'$ and $\delta'$ is terminal in $\Delta$ then $\Delta$ and $\Delta'$ are globally coherent and $H_{\Delta} \simeq H_{\Delta'}$.*

For any $\delta \in \Delta$ let $\delta'!$ be the unique morphism $\delta' : \delta \to \delta'$. Since $(\pi_1\delta!, \pi_2\delta!, \pi_3\delta!): \mathrm{PI}_G|_S\delta \to \mathrm{PI}_G|_S\delta'$ is a morphism in $C_{\mathrm{pt}}$, then $f_{\delta} \circ \pi_1\delta! = f_{\delta'}$ and hence $\pi_1\delta' : f_{\delta'} \to f_{\delta}$ is a morphism in $C \setminus G$.

Since $\delta'$ is initial in $\Delta^{\mathrm{op}}$ there is a unique cone $\gamma_{\Delta}$ from $P_{\Delta}^{\leftarrow} \delta' = f_{\delta'}$ to $P_{\Delta}^{\leftarrow}$ (defined by $\gamma_{\Delta}\delta = \pi_1\delta!$ for all $\delta \in \Delta$) and any cone $\gamma$ from any $f \in C \setminus G$ to $P_{\Delta}^{\leftarrow}$ can be written $\gamma = \gamma_{\Delta} \circ \gamma\delta'$, hence $\gamma_{\Delta}$ is a limit cone of $P_{\Delta}^{\leftarrow}$ (see [15, Exercise III.4.3]), so that $f_{\Delta} \simeq f_{\delta'}$ and $C_{\Delta} \simeq D_{\delta'}$.

Let $\gamma_{\delta} = \gamma_{\Delta} \circ k_{\delta'} \circ \pi_2\delta!$ (where $\pi_2\delta' : f_{\delta} \circ k_{\delta} \to f_{\delta'} \circ k_{\delta'}$ and $k_{\delta'} : f_{\delta'} \circ k_{\delta'} \to f_{\delta'}$ are morphisms in $C \setminus G$ as above), this is a cone from $f_{\delta} \circ k_{\delta}$ to $P_{\Delta}^{\leftarrow}$ such that $\gamma_{\delta}\delta = \pi_1\delta! \circ k_{\delta'} \circ \pi_2\delta! = k_{\delta}$. Besides, for every $\mu : \delta_1 \to \delta_2$ we have $\gamma_{\delta_1} = \gamma_{\delta_2} \circ \pi_2\mu$ since $\delta_2! \circ \mu = \delta_1!$. Hence $(\gamma_{\delta})_{\delta \in \Delta}$ is a coherent system of cones for $\Delta$, which is therefore globally coherent.

Since $\delta'$ is terminal in $\Delta$ there is as above a colimit cone from $P_{\Delta}^{\leftarrow}$ to $P_{\Delta}^{\leftarrow} \delta' = h_{\delta'} : C_{\Delta} \to H_{\delta'}$, hence $H_{\Delta} \simeq H_{\delta'}$ (the pushout of $r_{\delta'}$ and $c_{\delta'} = k_{\delta'} \circ \pi_2\delta'! = k_{\delta'}$). We finally note that $\delta'$ is terminal in $\Delta'$. □

*Proof of Lemma 6.2. $l_G$ is a full and right-full embedding.*

The functor $G : 1 \to |C|$ is a full embedding hence so is $l_G$. For all $\delta' \in D|_G$, $\delta \in D$ and $\mu : \delta \to l_G\delta'$ we have $\ln P\delta = l_G \ln P\delta' = G$ hence $\ln P\mu = 1_G$. Since $G$ and $l_G$ also have preimages by functor $G$ there must be preimages $\delta'_1 \in D|_G$ and $\mu_1 : \delta'_1 \to \delta'$ in $D|_G$ such that $l_G\mu_1 = \mu$, hence $l_G$ is right-full. □

*Proof of Proposition 6.3. If $R$ is right-full (resp. faithful) then so is $R|_G^S$.*

For all $\delta' \in D|_G^S$, $\rho \in S$ and $\sigma : \rho \to \rho'$, where $\rho' = R|_G^S\delta'$, we have $l\rho' = Rl_G|_S\delta'$ and $l\sigma : l\rho \to l\rho'$ in $R$, and since by Lemma 6.2 $R \circ l_G$ is right-full then there exists $\delta'_1 \in D|_G$ and $\mu_1 : \delta'_1 \to l_S\delta'$ such that $Rl_G\mu_1 = l\sigma$. Thus $l\rho$ and $l\sigma$ have preimages by $l$ and $R \circ l_G$, hence they must have preimages $\delta \in D|_G^S$ and $\mu : \delta \to \delta'$ such that $l_G\mu = \mu_1$ and $R|_G^S\mu = \sigma$.

If $R$ is faithful, since $l_G$ is faithful then so is $R \circ l_G$, and hence so is $R|_G^S$. □

*Proof of Proposition 6.4. If $C$ is adhesive, $\delta, \delta' \in D_{\mathrm{DPO}}$ and $\sigma : R_{\mathrm{DPO}}\delta \to R_{\mathrm{DPO}}\delta'$ such that $m = m' \circ \sigma_1$ then there exists a unique $\mu : \delta \to \delta'$ such that $R_{\mathrm{DPO}}\mu = \sigma$.*

Let $G = \ln P\delta = \ln P\delta'$, we consider the following diagram
<figure><img src="image_38.png" /></figure>

where the bottom face is a pullback. By [11, Lemma 4.2] monics are stable under pushouts hence $f$ and $f'$ are monics and therefore also $x$ and $y$. By the commuting properties we have $f \circ k = f' \circ k' \circ \sigma_2$, hence there exists a unique $z$ such that $y \circ z = k$ and $x \circ z = k' \circ \sigma_2$.

The front face is a pushout along the monic $l$, hence it is a pullback [11, Lemma 4.3], as is the top face, hence by composition the square formed by $l, m, f', k' \circ \sigma_2$ is also a pullback.

The back face is a pushout along the monic $l$, hence it is a VK-square and bottom face of the commuting cube below

<figure><img src="image_39.png" /></figure>

Its front and right faces are pullbacks. Since $l$ is monic then its left face is a pullback, and since $y$ is monic its back face is also a pullback. Hence its top face is a pushout, and since isomorphisms are preserved by pushouts, $x$ is an isomorphism.

Let $d = y \circ x^{-1}$, we see that $f \circ d = f'$ and $d \circ k' \circ \sigma_2 = y \circ z = k$, so that $\mu = (\sigma_1, \sigma_2, \sigma_3, d)$ is a morphism from $\delta$ to $\delta'$ in $\mathcal{D}_{\text{DPO}}$ such that $R_{\text{DPO}}\mu = \sigma$. Its unicity is obvious. $\square$

*Proof of Proposition 6.6.* For every direct *SqPO*-transformations $\delta, \delta'$ with corresponding *SqPO*-rules $\rho, \rho'$, every $\sigma : \rho \to \rho'$ in $\mathcal{R}_{\text{SqPO}}$ such that $m = m' \circ \sigma_1$, there exists a unique $d$ such that

<figure><img src="image_40.png" /></figure>

commutes.

By composition of pullbacks $(k' \circ \sigma_2, l)$ is a pullback of $(f', m)$, and since $(f, k)$ is a final pullback complement of $(m, l)$ then there is a unique $d : D' \to D$ such that $f' = f \circ d$ and $k = d \circ k' \circ \sigma_2$. $\square$
*Proof of Proposition 6.7. In the category of graphs $R_{\text{SqPOm}}$ is right-full.*

For all $\delta' \in \mathcal{D}_{\text{SqPOm}}$ and $\sigma : \rho \to R_{\text{SqPOm}}\delta'$ in $\mathcal{R}_{\text{SqPOm}}$, the matching $m' \circ \sigma_1 : L \to G$ is monic hence by [5, Construction 6] ($m' \circ \sigma_1, l$) has a final pullback complement, hence there is a $\delta \in \mathcal{D}_{\text{SqPOm}}$ with $m = m' \circ \sigma_1$ and $R_{\text{SqPOm}}\delta = \rho$, and by Proposition 6.6 there is a (unique) $\mu : \delta \to \delta'$ in $\mathcal{D}_{\text{SqPOm}}$ such that $R_{\text{SqPOm}}\mu = \sigma$. $\square$

*Proof of Proposition 6.9. For every direct PBPO-transformations $\delta, \delta'$ with corresponding PBPO-rules $\rho, \rho'$, every $\sigma : \rho \to \rho'$ in $\mathcal{D}_{\text{PBPO}}$ such that $m = m' \circ \sigma_1$ and $t_G = \sigma_4 \circ t_{G'}$, there exists a unique $d$ such that*

<figure><img src="image_41.png" /></figure>

commutes.

By hypothesis the two front, back, left faces commute, as well as the top and bottom faces. Thus

$$u \circ \sigma_5 \circ t_{D'} = \sigma_4 \circ u' \circ t_{D'} = \sigma_4 \circ t_{G'} \circ f' = t_G \circ f'$$

and since $D$ is a pullback then there exists a unique $d$ such that the right and top face of the bottom cube commute. This also means that $(D, f, t_D)$ is a mono-source, and since

$$\left\{ \begin{array}{l} f \circ d \circ k' \circ \sigma_2 = f' \circ k' \circ \sigma_2 = m' \circ l' \circ \sigma_2 = m' \circ \sigma_1 \circ l = m \circ l = f \circ k \\ t_D \circ d \circ k' \circ \sigma_2 = \sigma_5 \circ t_{D'} \circ k' \circ \sigma_2 = \sigma_5 \circ t_{K'} \circ \sigma_2 = t_K = t_D \circ k \end{array} \right.$$

then $d \circ k' \circ \sigma_2 = k$. $\square$