Submitted:
12 May 2023
Posted:
17 May 2023
You are already at the latest version
Abstract
We revise the definition of graph operations in [WDK2018] and adapt correspondingly the construction of graph term algebras.
As a first contribution to a prospective research field Universal Graph Algebra, we generalize some basic concepts and results from algebras to graph algebras.
To tackle this generalization task, we revise and reformulate traditional set-theoretic definitions, constructions and proofs in Universal Algebra by means of more category-theoretic concepts and constructions. Especially, we generalize the concept generated subalgebra and prove that all monomorphic homomorphisms between graph algebras are regular.
Derived graph operations are the other main topic.
After an in depth analysis of terms as representations of derived operations in traditional algebras, we identify three basic mechanisms to construct new graph operations out of given ones: parallel composition, instantiation, and sequential composition.
As a counterpart of terms, we introduce graph operation expressions with a structure as close as possible to the structure of terms.
We show that the three mechanisms allow us to construct for any graph operation expression a corresponding derived graph operation in any graph algebra.
Keywords:
Graph operation
; graph algebra
; graph term algebra
; Lawvere theory
; derived graph operation
; graph operation expression
; universal graph algebra
; string diagrams
1. Introduction
The paper is a relatively independent part of a broader long-term project to develop a proper foundation of diagrammatic specification formalisms and diagrammatic logics. The project is centered around and extends the concept of generalized sketches. We use the term “diagrammatic” as a synonym for “graph-based” in a very broad sense including arbitrary presheaf topoi.
One of the objectives of our project is to lift up traditional first-order logic to a wide range of arbitrary categories. In [2] we only addressed predicates and showed how to define corresponding first-order logics of statements in context without operations in arbitrary categories. The present paper is also meant to be a first step towards an abstract notion of operation allowing us to define fully fledged first-order logics of statements in context, at least, in arbitrary topoi.
Generalized sketches have been developed in the 90s independently by Michael Makkai, motivated by his work on an abstract formulation of Completeness Theorems in Logic [3], and a group in Latvia around Zinovy Diskin, motivated by their work on data bases and data modeling [4,5,6]. Our concept of graph operation has its seeds in the concept of sketch operation. Sketch operations do not appear in the work of Makkai, while they have been an integral part of Diskin’s pioneering work from the very beginning.
Graph operations (and their prospective generalizations) are vital in software engineering. Moreover, they provide a conceptual tool with many potential and useful applications in mathematics, logics, and computer science.
Software models are often diagrammatic structures. To keep software models comprehensible for humans, we should, however, avoid to overload them with auxiliary items and redundant information. Nonetheless, to formulate and integrate relevant constraints in software models, it is necessary to refer to items that are not present in a model but that can be derived, like the composition of references, for example. Graph operations are an appropriate tool to refer to and reason about those derivable items in diagrammatic artifacts.
Graph operations are also vital for the definition of query languages for diagrammatic data models, for example. The crucial idea is to formalize queries as derived graph operations built up from basic operations like the operations of Codd’s relational algebra, for example. The potential to formalize query languages for diagrammatic data models was one of Diskin’s main motivations to introduce sketch operations [5].
An example par excellence for the conceptual potential of graph operations in mathematics are categories. Categories can be described as graphs plus an identity and a composition operation. It is not common yet, but quite natural, to consider these operations as graph operations. The identity operation introduces for each vertex in a graph a loop while the composition operation generates for any two successive edges in a graph a corresponding composite edge. Even statements like “we assume a category with chosen pullbacks”, for example, can be adequately made precise by means of corresponding graph operations. [7] seems to be the first paper outlining the potential of graph operations in category theory. Since categories are nowadays widely used in computer science, logic, mathematics, and physics, we will use them as our running example.
In traditional string-based formalisms and logics, terms are the standard tool to represent and reason about “derivable data”. At the same time, terms give us an adequate tool at hand to represent derived operations, i.e., operations that can be built up from the basic operations in an algebra. Therefore, we generalized in [1] the construction of terms from traditional algebras to graph algebras. The construction of graph term algebras and their characterization as a free construction is the main result in [1]. Unfortunately, our expectation that graph terms will give us a universal and appropriate concept of derived graph operations and substitutions at hand, vanished. We realized that the strong interconnection between “representation of data” and “representation of derived operations” breaks down in the case of graph operations.
After Section 2 where we list some basic notations, concepts, conventions, and results, the paper presents a further development of the theory of graph operations and graph algebras in two directions - model theory (including term algebras) and derived graph operations.
- Model theory:
-
In [1] we coined the concept of graph algebra, introduced graph terms and showed that graph term algebras are free graph algebras. There was, however, no model theory in the sense of traditional Universal Algebra. As a kind of “proof of concept”, we generalize therefore some basic model-theoretic concepts and results from traditional algebras to graph algebras. We concentrate on the concept “generated subalgebra” and the related problem of characterizing monomorphic and epimorphic homomorphisms, respectively.To tackle this task, we make some substantial effort in Section 3 to revise and reformulate traditional set-theoretic definitions, constructions and proofs in Universal Algebra by means of more category-theoretic concepts and constructions. Relying on this reformulation, we can in Section 4 smoothly transfer concepts, definitions and results from traditional algebras to graph algebras. Especially, we prove that all monomorphic homomorphisms between graph algebras are regular.In [1] we adapted the original idea of sketch operations [5] and defined the arity of a graph operation as a single graph inclusion. This definition does not allow us, however, to consider projections as legal graph operations. To be closer to the traditional concept of operation in Universal Algebra, and to be able to define an appropriate concept of derived graph operation, we declare therefore in this paper the arity of a graph operation as a span of graph inclusions. In Section 4.2 we clarify the relation between both versions and discuss to what extent they are equivalent.To prove that all monomorphic homomorphisms between graph algebras are regular, we also introduce in Section 4.4 partial graph algebras. We define a so-called term completion procedure transforming partial graph algebras into total graph algebras. This procedure provides for each signature a free functor from the corresponding category of partial graph algebras to the corresponding category of graph algebras. The construction of graph term algebras turns out to be just a special case of this new procedure.
- Derived graph operations:
-
To understand why the strong interconnection between “representation of data” and “representation of derived operations” breaks down in the case of graph operations and to find out how to define derived graph operations in an appropriate way, we include in the paper a more in-depth analysis of the concept term and discuss in Section 3.4 substitution calculi in general.In Section 3.7 we recall the construction of syntactic Lawvere theories as it is described in [8], for example. In Section 5.1 we discuss finite product categories and elucidate that terms can be characterized as normal forms for finite product expressions, thus Lawvere’s original slogan “composition is substitution” can be turned into the slogan “substitution is symbolic composition plus normalization”.Reviewing the relationship between finite products and tensor products, we identify in Section 5.2 copying as the cause of the problem. We argue that, in case of graph operations, “copying of data”, as a computation of its own, has to be replaced by “soldering” of input and (!) output ports of computations.In such a way, we end up in Section 5.3 with three mechanisms to construct new graph operations out of given ones: parallel composition, instantiation (“soldering” of input and output ports), and sequential composition.Finally, we introduce in Section 5.4 graph operation expressions with a structure as close as possible to the structure of terms. We define their semantics, i.e., the derived graph operations we have been looking for, by means of the three mechanisms parallel composition, instantiation and sequential composition.
2. Notations and Preliminaries
denotes the collection of objects of a category and the collection of morphisms of , respectively. is the collection of all morphisms from object A to object B in . If the category is clear from the context, we will often use the more compact notation instead of . We use the diagrammatic notation for the composition of morphisms and in . states that category is a subcategory of category . A category is small if the collection , and thus also the collection , is a set. is the category of all small categories. A category is locally small if is a set for all objects A and B in . denotes the category of all sets and all (total) maps. and are not small but locally small.
A (directed multi) graph is given by a collection of vertices, a collection of edges and maps , assigning to each edge its source and target vertex, respectively [9]. is the empty graph. A graph is small if and are sets. A graph homomorphism between two graphs and is a pair of maps , such that the following diagrams commute.

The identity graph homomorphism on a graph is the pair of identity maps and composition of graph homomorphisms and is done componentwise, i.e . is the category of all small graphs and all graph homomorphims between them. The empty graph is the initial object in . For convenience and uniformity reasons, we will often consider a set A as a graph without edges.
The category comprising as well finite and small graphs as the underlying graphs of categories like , , and , for example, is denoted by , while is the category containing all the corresponding collections of vertices and edges, respectively. Correspondingly, we denote the category with all small categories and categories like , , and as objects by .
denotes the underlying graph of a category , i.e., we have and . Note, that a functor is just a graph homomorphism preserving also identities and composition. In other words: The assignments , define a faithful forgetful functor . It is well-known that there is a functor left-adjoint to assigning to any graph the corresponging path category .
In practical applications, it is often more convenient to work with interpretation categories instead of functor categories. An interpretation of a graph in a category , denoted by , is a graph homomorphism from to . A natural transformation between two interpretations and is a family , of morphism in such that for all edges in . All interpretations of in and all natural transformations between them constitute the interpretation category with composition the vertical composition of natural transformations. (In [10] interpretations are called “models of in ” and the notation is used instead of . For our purposes the more neutral and general term “interpretation” is more convenient.) For any categories , the assignments define a full embedding of the traditional functor category into the interpretation category .
Obviously, the category is, by definition, isomorphic to the interpretation category with the graph
. On the other side, the adjunction ensures that for any small graph the interpretation category is isomorphic to the functor category and thus a presheaf topos.
. On the other side, the adjunction ensures that for any small graph the interpretation category is isomorphic to the functor category and thus a presheaf topos.For any set I and any set A the set of all maps from I into A is a categorical product in with the family of projections defined by for all . If I is finite with n elements (indices), is therefore isomorphic to the n-ary Cartesian product of A. In case, we equip a finite set with a fixed total order , we can reuse the traditional tuple notation for elements in the Cartesian product to represent also the elements in : A map is represented by the tuple . In the paper, we will often describe a map by simply declaring , i.e., for all . In case , i.e., , we will consequently represent the only map by the empty tuple . For any finite set A we denote its cardinality by .
For any inclusion of sets we denote by the corresponding inclusion map with for all . A graph is a subgraph of a graph , in symbols, if , and the inclusion maps and establish a graph homomorphism . is also called an inclusion graph homomorphism or graph inclusion, shortly.
A partial map is given by a domain of definition and a total map from into B. The composition of two partial maps and is defined by
- and
- for all .
We consider any (total) map as a partial map with
3. Algebras and Term Algebras
Traditional expositions of Universal Algebra are based on finite Cartesian products. As a first step of a smooth transition from traditional algebras to graph algebras, we reformulate in this section some very basic concepts and results of Universal Algebra utilizing sets of maps instead of finite Cartesian products .
In parallel, we try to lift the traditional set-theoretic definitions, constructions and proofs in Universal Algebra to a more general and abstract level utilizing category-theoretic concepts and constructions. The objective is to pave the way from traditional operations and algebras via graph operations and graph algebras to operations and algebras in topoi.
3.1. Signatures, Algebras and Homomorphisms
To declare the arities of operation symbols we use canonical finite indexing sets
For all we assume to be equipped with a fixed total order thus we can reuse the tuple notation to represent maps as discussed in Section 2.
Definition 1
(Signature). A signature is given by
- a set ofoperation symbols,
- a map assigning to each operation symbol as its arity a pair of finite sets with for some , and .
We say that is ann-ary operation symbol if . If for , we say also that is aconstant symbol.
Remark 1
(Sets as Arities). There can be arbitrary many finite separeted inputs for an algebraic operation. We decide to work with explicit sets of names for the “input positions”. In contrast to possibly multiple inputs, it is usually assumed that an algebraic operation has exactly one single output. For conformity reasons we introduce also a name for the single output position. This brings us closer to graph algebras where the single-output paradigm will be given up. As well the input as the output arity of a graph operation can be an arbitrary finite graph (see Definition 15).
Definition 2
(Algebra). Let Σ be a signature. A Σ-algebra given by
- a set A, called the carrier of , and
- a family of maps called .
We say that is ann-ary operation if . If , we say also that is a constant operation, or simply aconstant.
In the case where the signature has no constant symbols, the empty set constitutes a -algebra, called the empty Σ-algebra.
Now we reformulate the traditional concept of homomorphism.
Definition 3
(Homomorphism). Let Σ be a signature. A -homomorphism between two Σ-algebras and is a map satisfying the following homomorphism condition

For any sets A, B, I each map induces a map thus we can, more abstractly but equivalently, express the homomorphism condition (HC) by the requirement that the above right square of maps commutes. Note, that in case of constant symbols , the homomorphism condition turns into the equation if we apply our conventions in Section 2 concerning the tuple notation.
Given any -algebra , the identity map on the carrier set induces an identity -homomorphism . Similarly, given any -homomorphisms , , the composition of the underlying maps induces a -homomorphism . This defines the category with all -algebras as objects and all -homomorphisms as morphisms.
Proposition 1
(Forgetful Functor). The assignments and define a faithful forgetful functor
Characteristic for any incarnation of the concept algebra is that the corresponding categories of algebras inherit all limits from the respective underlying category. For the abstract concept of -algebra for an arbitrary functor , for example, the category of all -algebras inherits all limits from the category [11].
It is well-known that the category inherits all limits from the category . Following our methodological intention to lift things up to a more categorical element-free level, we demonstrate that the decision to work with sets of maps instead of Cartesian products enables us to give a pure categorical concise proof of this classical result. Since we want to do all later constructions and argumentations within , we restrict ourselves to small limits.
Theorem 1
(Limits). inherits any small limit from the category , i.e., the functor reflects small limits. has therefore all small limits since does.
Proof.
Let be a small graph and be a diagram in where for all vertices v in . We have to show that any limit cone over the translated diagram induces a limit cone over in such that is a -algebra with L as its carrier.
To define the operations in , we note that for any operation symbol in and any map we get a commutative cone in with for all v in . Applying the respective operations to the maps gives us a new cone in with for all vertices v in . Now, for any edge in , we have that is a -homomorphism from to and thus, by the homomorphism condition and commutativity of we have
which encapsulates that the cone is commutative. By the universal property of , there is a unique map which satisfies
for all v in . By defining , we ensure that each map induces a -homomorphism for all v in . Thus, we get indeed a commutative cone in .
It remains to show that is a limit cone, i.e. for any other commutative cone in , we have to show that there is a -homomorphism such that for all v in . Note that p induces a commutative cone in with for all v in . As is a limit cone over , there exists a unique map such that for all v in . We claim that extends to the desired -homomorphism, by showing that
for any in and . By definition, is the unique map such that holds for all v in . Indeed, the map also satisfies this equality for all v in as
By uniqueness of mediating morphisms we get (5), which shows that is indeed a -homomorphism from . Moreover, it is the unique homomorphism such that and thus, is a limit cone. □
Remark 2
(Hom-sets). The proof of Theorem 1 is based on the convention in Section 2 that we consider as a shorthand notation for the collection (hom-set) of all morphisms in from I to A. is a set since is locally small. is isomorphic to a corresponding exponential object in , but this isomorphism does not play any role in the paper.
3.2. Subalgebras
As in the traditional approach, we can define subalgebras by means of set inclusions.
Definition 4
(Subalgebras). Let be a signature. A Σ-algebra is a -subalgebra of a Σ-algebra , in symbols, if and for all and the following diagram commutes:

Here is the corresponding inclusion map from A into B.
A comparison of Definition 3 and Definition 4 makes, however, obvious that we can also simply describe -subalgebras as special kinds of -homomorphisms.
Corollary 1
(Subalgebras as Inclusion Homomorphisms). For Σ-algebras and such that we have that is a Σ-subalgebra of if, and only if, the inclusion map establishes a Σ-homomorphism .
Since one of our objectives is to lift the traditional set-theoretic exposition of Universal Algebra to a more category-theoretic one, we will use, from now on, the concepts “-subalgebra” and “inclusion -homomorphism” interchangeably.
We know that the monomorphisms (epimorphisms) in are exactly the injective (surjective) maps, respectively. Any faithful functor reflects monomorphisms and epimorphisms. The forgetful functor is faithful thus we obtain
Corollary 2
(Injective and surjective Homomorphisms). If the underlying map of a Σ-homomorphism is injective (surjective) then is a monomorphism (epimorphism) in .
In the traditional set-theoretic approach to Universal Algebra, a preferred tool to describe, construct and reason about subalgebras are subsets of the carrier which are closed w.r.t. to applications of the operations in the algebra.
Definition 5
(Closedness). Let be a Σ-algebra. We say a subset isclosed in if for all and the result of applying the operation in to the input factors through the inclusion map , i.e., there exists a map such that the following diagram commutes:

If is a -subalgebra of then the carrier A of is obviously closed w.r.t. all the operations in . On the other side, the inclusion map is a monomorphism in . Therefore the map in Definition 5 is unique if it exists. In such a way, the assignments define a total operation from to if A is closed, and we obtain the following result.
Proposition 2
(Subalgebra ≅ Closed Subset). There is a one-to-one correspondence between Σ-subalgebras of and closed subsets of .
Proposition 2 suggests that there may be actually no need for the auxiliary concept closed subset in a more category-theoretic approach. This conjecture is supported by the observation that we can reconstruct the standard result that closed subsets are closed w.r.t. intersection, reformulated in terms of inclusion homomorphisms, as a special case of Theorem 1. To see this, we have to realize that the intersection of subsets can be described as a special limit construction, namely multiple pullbacks, in .
Remark 3
(Multiple Pullbacks). Let I be a set and M be an I-indexed family of subsets of a set B. We can describe this situation by a diagram with a small graph given by , , and δ defined by for all , and inclusion maps for all .
It is well-known and straightforward to prove that the intersection together with the inclusion maps , and is a limit cone of the diagram in .
Limits of this shape are also calledmultiple pullbacks and they reflect monomorphisms: For any category , any diagram and any limit cone all the morphisms , are monomorphisms in as as long as all the morphisms , are.
Due to Remark 3 we can now replace and enhance the traditional statement
“If M is a family of closed subsets in , then its intersection is closed as well”
by the following corollary of Theorem 1.
Corollary 3
(Intersection of Subalgebras). For any set I, any Σ-algebra , and any diagram of Σ-subalgebras , of there is a unique Σ-subalgebra of with that is a Σ-subalgebra of for all .
Moreover, the inclusion Σ-homomorphisms , and constitute a multiple pullback, i.e., a limit cone of the diagram in .
We call also the intersection of the I-indexed family of Σ-subalgebras of and may use the notations , or, simply, to denote .
Traditionally, the -subalgebra of a -algebra generated by a subset can be defined as the -subalgebra with the carrier constructed as the intersection of the following family of closed sets in :
Since, the collection of all subsets of a set B is a set as well, this definition matches the pattern of Corollary 3. We only have to choose for I the set itself or any isomorphic set.
Using this sleight of hand, we can take full advantage of the universal property of the intersection of subalgebras in , as stated in Corollary 3, and lift up the concept “generated by a subset” to the concept “accessible via a map”.
Definition 6
(Subalgebra accessible via a Map). For any Σ-algebra and any map let be the set of all Σ-subalgebras of such that f factors through the inclusion map , i.e., there exists a map such that .
We denote by the intersection of , according to Corollary 3. Especially, the carrier of is the intersection of sets. We call the-subalgebra of accessible (reachable) via for thehomomorphic image of A w.r.t. f.
In case of inclusion maps we also use the traditional notation instead of and also call the-subalgebra of generated by A.
Note, that the map in Definition 6 is unique, if it exists, since the inclusion map is a monomorphism in .
Corollary 4
(Homomorphic image includes Image). For any Σ-algebra and any map we have for the(set-theoretic) image of A w.r.t. the map f.
Proof.
Follows immediately from the observation that for the set of all subsets Y of B such that f factors through the inclusion map and that due to the definition of and in Definition 6 and the definition of . □
Remark 4
(Well-powered). In category theory the adjective well-powered is used for categories where for all objects A in the collection of all subobjects of A is a set.
Of course, we do have the traditional concept of generated algebra and corresponding results available.
Definition 7
(Accessible and Generated Algebras). Let be a Σ-algebra.
- isaccessible via a map if.
- If is accessible via an inclusion map , i.e., if, we say also that isgenerated by A.
- is said to be generated if it is generated by the empty set, i.e., accessible via the unique map from the initial object ∅ in to B.
Corollary 5.
A Σ-algebra is generated if, and only if, there are no proper Σ-subalgebras of .
Corollary 6.
If a signature Σ has no constant symbols, then the empty Σ-algebra is the only generated Σ-algebra.
The concept accessible via a map can be utilized to find a characterization of epimorphisms in . First, we observe that “accessible via a map” implies “epic”.
Lemma 1
(Accessible implies Epic). A Σ-homomorphism is an epimorphism in if is accessible via the underlying map , i.e., if .
Proof.
We consider arbitrary Σ-homomorphisms such that .
We know that the set together with the inclusion map is an equalizer of the maps in . According to 1, there is a unique Σ-algebra such that becomes an inclusion Σ-homomorphism which is, moreover, the equalizer of the Σ-homomorphisms . Assumption ensures that there exists a unique map with . Due to the construction of in Definition 6, we have an inclusion Σ-homomorphism . Accessibility of means thus we get, finally, . This means, however, that the equalizer of g and h is the identity on B thus we have as required. □
To show that, on the other side, epic implies accessible we can take advantage of the following result.
Proposition 3
(Subalgebras are Regular Monos). For any Σ-subalgebra of a Σ-algebra there exists a Σ-algebra and parallel Σ-homomorphisms such that is the equalizer of g and h.
Proof.
We construct the pushout of the span
of inclusion maps (see the left diagram below). We set , , and . Since is injective both maps are injective too and, moreover, the pushout square is as well a pullback square. This ensures, especially, that is the equalizer of the maps in . The pushout property of the square provides a unique map such that
of inclusion maps (see the left diagram below). We set , , and . Since is injective both maps are injective too and, moreover, the pushout square is as well a pullback square. This ensures, especially, that is the equalizer of the maps in . The pushout property of the square provides a unique map such that

Operations on C: We extend now C to a Σ-algebra by defining for each in a corresponding operation . For any in we do have four possible cases.
- Case 1
-
factors through : There exists a map such that (see the right diagram above). is unique since is a monomorphism. We simply set

- Case 2
- factors through : Analogously to Case 1.
- Case 3
- Overlapping of Case 1 and 2: There exist maps such that . Due to the pullback property of the square there exists a unique such that . The homomorphism property of ensures thus we get, finally, . That is, in the event of an overlapping, Case 1 and Case 2 define the same output . Note, that there will always be an overlapping for constant symbols!
- Case 4
-
factors neither through nor through : This can only happen if with . Utilizing the operations in to a maximal extent, Cases 1 and 2 define a partial map from to . However, since we restrict ourselves to total operations, we have to find an ad hoc totalization trick to turn into a total operation. Employing (7), we may decide to utilize the operations in to produce outputs in the left copy of B in . We set

The operations in are defined by (8) exactly in a way that the maps and become Σ-homomorphisms . Note, that Case 4 has no relevance for the homomorphism property of and ! Theorem 1 ensures, finally, that the inclusion Σ-homomorphism is the equalizer of the Σ-homomorphisms . □
Regularity of entails that the concepts accessible and epic are equivalent.
Proposition 4
(Accessible ≅ Epic). For any Σ-homomorphism it holds that is accessible via the underlying map , i.e., in other words is equal to the homomorphic image of w.r.t. f, if, and only if, is an epimorphism in .
Proof.
“Accessible implies epic” has been shown in Lemma 1. We show now “epic implies accessible”: We consider an arbitrary Σ-subalgebra of such that there exists a map with . Due to Proposition 3 there exist Σ-homomorphisms such that is the equalizer of g and h. Due to the assumption , we get and thus since f is epic. This means, however, and, finally, due to the construction of in Definition 6. □
The axiom of choice is equivalent to the statement that all epimorphisms in the category are split, i.e., there exists a map such that . As a consequence each homomorphism between -algebras maps closed subsets to closed subsets. Especially, we have
Lemma 2
(Closed Images). For any Σ-homomorphism the (set-theoretic) image of the carrier A of is closed in . We denote by the unique Σ-subalgebra of with carrier and call it the(set-theoretic) image of w.r.t. the -homomorphism f.
Lemma 2 is the last brick we need to conclude that the epic -homomorphisms are exactly the surjective one.
Corollary 7
(Epic ≅ Surjective). For any Σ-homomorphism we have thus is an epimorphism in if, and only if, the map is surjective.
Proof.
By Corollary 4 we have . Lemma 2 gives us the Σ-subalgebra of at hand and ensures due to the construction of in Definition 6. This gives us since two Σ-subalgebras of a Σ-algebra are equal if, and only if, they do have the same carrier. By Proposition 4 we get epic if, and only if, . , however, means that f is surjective. □
Remark 5
(Stepwise Generation of Closed Subsets). There is another, more constructive, way to construct the closed sets . We start with A and add all the elements from B that we can reach by applying successively the operations in to elements that have already been reached. A categorical analysis, formalization, and generalization of this stepwise iterative construction can be found in [12], for example.
3.3. Terms and Term Algebras
We define terms as strings of symbols. To distinguish terms from metalevel expressions, such as , we will use angle bracket symbols , instead of parenthesis , to build terms. Moreover, we will use delimiter signs ⌜…⌝ to indicate that the expression between the delimiters is a string. So, the delimiter signs are not constituents of terms and we may just drop them if convenient. The following is a traditional inductive definition of terms similar to [13,14]:
Definition 8
(Terms). The set of all -terms over a set X of variables is the smallest set of strings of symbols such that
- Variables:
- , for all ;
- Constants:
- , for all with ;
- Operations:
- , for all with , and all maps in .
Note that the assignments , assigning to each variable the string consisting only of a single symbol denoting this variable, define an injective map : . Note, moreover, that in case each operation symbol is reborn as the -term .
A term can be seen as a “tree-like computation scheme” and if we assign to variables certain values in an algebra we can compute a value in this algebra following this computation scheme. Terms are constructed inductively thus we can define this kind of evaluation of terms also inductively.
Definition 9
(Evaluation of terms). For any set X of variables, any Σ-algebra and any map (called a variable assignment ) we can define inductively a map :
- Variables:
- , for all ;
- Constants:
- , for all ;
- Operations:
- , for all .
All three cases in Definition 9 are disjoint and terms are only equal if, and only if, they are equal as strings thus is uniquely defined.
There is no indication in Definition 8 and Definition 9, respectively, where the sets of -terms live and where the evaluation of -terms takes place. A very common and powerful practice in Universal Algebra is to internalize -terms as elements of carriers of -algebras and to encode term evaluation by -homomorphisms: First, we observe that the stepwise construction of terms in Definition 8 can be reflected by defining for each operation symbol in a corresponding (constructor) operation on :
Definition 10
(Term algebra). For a set X of variables we define the term -algebra over X by
- Constants:
- , for all with , and
- Operations:
- , for all with , and all maps in .
Note that the term -algebra is generated by . This is implicitly ensured by the statement of being the smallest set satisfying the conditions in Definition 8. We say that the elements in are the generators of .
Second, we observe that the introduction of term -algebras allows us to encode the defining equations for the cases Constants and Operations in Definition 9 by the requirement that the map should establish a -homomorphism :
- Constants:
- , for all ;
- Operations:
- , for all where is the map in defined by .
The third case Variables in Definition 9 simply requires that the map is an extension of the map thus the statement “Definition 9 defines uniquely” is transformed into the statement that the term -algebra is a -algebra freely generated by X.
Proposition 5
(Term Algebras as Free Construction). Given a set X of variables, the Σ-term algebra has the following universal property: For any Σ-algebra and any map there exists a unique Σ-homomorphism such that .

The universal property in Proposition 5 characterizes uniquely up to isomorphism and the case gives us initial -algebras at hand.
Corollary 8.
is initial in the category .
It is a standard result for free constructions that the assignments and define a (free) functor that is left-adjoint to the forgetful functor (see [15]).

3.4. Substitutions
The very appealing advantage of internalizing terms as elements of carriers of algebras, encoding term evaluations as homomorphisms and thus having the adjunction at hand, is that we get a fully fledged, well-defined and well-behaved substitution calculus for free relying on general results in Category Theory. We insert an informal exposition what we mean by a substitution calculus and what the expected features of such a calculus could be. The advantages of the “internal view of terms” will be discussed afterwards.
3.4.1. Substitution Calculi
The concept substitution is a kind of conceptual descendant of the concept variable. A variable in an expression is a “free location” where we can put in expressions of a certain kind. The basic constituent of a substitution calculus is its specific way to describe a
- (1)
- substitution (declaration), i.e., an assignment of expressions to variables.
In Universal Algebra, we can formalize substitutions as maps . For finite sets we may simply declare a substitution by listing the corresponding assignments .
The second constituent of a substitution calculus is the specific mechanism for
- (2)
- substitution application, i.e., the replacement of occurrences of variables in a given expression by the expressions assigned to the variables by a substitution.
A common practice in Universal Algebra [14] is to denote the resulting term in of applying a finite substitution to a term t in by
An obvious, but not always trivial, requirement for substitution application is
- (3)
- preservation of well-formedness, i.e., replacing variables in a well-formed expression by well-formed expressions should result in a well-formed expression.
In case of terms, “well-formedness” simply means that we consider only those strings of symbols as terms which can be generated inductively by the three rules in Definition 8.
Lets assume we have three collections of expressions and two linkable substitutions. The first substitution replaces variables in expressions from the first collection by expressions from the second collection thus its application produces expressions in the second collection. Analogously, the second substitution replaces variables in expressions from the second collection by expressions from the third collection and its application results in expressions from the third collection. In this situation, we do have two possibilities to transform expressions from the first collection into expressions from the third collection. First, we can apply both substitutions successively. Second, we can compose both “small step” substitutions into a single “big step” substitution. That is, we apply the second substitution to all the expressions appearing in the definition of the first substitution and obtain a new substitution replacing variables in expressions from the first collection by expressions from the third collection. This puts another feature of substitution calculi on the agenda:
- (4)
- composition of linkable substitutions.
The composition of the two linkable finite substitutions from to and from to results, for example, in the finite substitution
from X to .
Obviously, we would like that the application of the “big step” substitution produces always the same result as the successive application of the two linkable “small step” substitutions, i.e., for a substitution calculus we require that
- (5)
- composition of substitutions is compatible with substitution application.
For the two linkable finite substitutions above this requirement can be expressed by the equation
Compatibility of composition of substitutions with substitution application ensures usually another useful property:
- (6)
- composition of substitutions is associative.
These are the six syntactic features we would claim to be the essential characteristics of a substitution calculus as such. If a substitution calculus is, however, part of a bigger logic formalism where also semantic structures are considered, we will have some additional features concerning the interplay of syntax and semantics.
In analogy to substitutions, we have first to choose a way to describe
- (7)
- variable assignments, i.e., assignments of semantic items to variables.
In Universal Algebra, we work exclusively with variables ranging over elements in sets thus variable assignments can be defined as maps from a set of variables into the carrier set of a -algebra , as we have done in Definition 9.
In analogy to the step from substitution (declaration) to substitution application, each variable assignment should induce a corresponding
- (8)
- evaluation of expressions, computing for each expression a unique semantic item or truth value, respectively.
Definition 9 presents, for example, an inductive definition of the evaluation of -terms into elements in the carrier A of a -algebra induced by a variable assignment .
Since variable assignments establish a bridge from syntax to semantics, there is no composition of variable assignments in a substitution calculus. We should, however, have
- (9)
- composition of substitutions with variable assignments as well as composition of variable assignments with homomorphisms.
For both new kinds of composition it is desirable to have
- (10)
- compatibility w.r.t. substitution application and/or evaluation, respectively.
Finally, it would be reasonable to require
- (11)
- associativity for the three new possible combinations of the four kinds of composition, i.e., substitution-substitution-assignment, substitution-assignment-homomorphism, and assignment-homomorphism-homomorphism, respectively.
3.4.2. Substitutions by Algebraic Extensions
We discuss now the specialties of the “internalization approach” in view of the informal concept of a substitution calculus outlined in the last subsection.
Features (7) & (8): Variable assignments are formalized as maps from a set of variables into the carrier set A of a -algebra and the corresponding unique term evaluations are inductively defined maps according to Definition 9.
Introducing term -algebras and realizing that the inductive definition of unique term evaluations can be described as unique algebraic extensions of variable assignments , as stated in Proposition 5, has three immediate consequences.
- Feature (1):
- Substitutions become simply a special case of variable assignments and
- Feature (2):
- Substitution applications appear as a special case of term evaluations namely as algebraic extensions . Applying a substitution to a -term means nothing but to compute the -term . As mentioned before, it is common to use instead of also the more informative notation in (10) in case of finite sets of variables.
- Feature (3):
- Preservation of well-formedness is implicitly ensured by the fact that the structures, we define in Definition 10 (Term algebra), are indeed -algebras.
Feature (9): The composition of a substitution with a variable assignment , is the variable assignment while Feature (10), i.e., the compatibility of substitution application and evaluation, is ensured by the uniqueness of algebraic extensions: (see the left diagram below).

Feature (4) composition of linkable substitutions becomes a special case of feature (9): The composition of a substitution and a substitution is the substitution . In such a way, Feature (5) composition of substitutions is compatible with substitution application becomes a special case of feature (10): (see the right diagram above). Equation 12 is spelling out this equation for the finite case.
Also the remaining part of feature (9) and (10), respectively, is ensured by Proposition 5: The composition of a variable assignment with a -homomorphism , for example, is the variable assignment and the uniqueness of algebraic extensions ensures compatibility: .
Finally, all the compatibilities together with the associativity of composition of maps gives us also the three kinds of associativity required by feature (11). The proof of the associativity
substitution; (substitution; assignment) = (substitution; substitution); assignment,
for example, is simply given by compatibility of substitution application and evaluation as well as associativity of map composition: for arbitrary substitutions , and assigments .
Remark 6
(No Internalization). Of course there is no need to utilize internalization of terms and uniqueness of algebraic extensions to establish a fully-fledged substitution calculus for Universal Algebra! Instead, we could just work out separately each of the necessary definitions and proofs based on the inductive definition of terms analogously to Definition 9 (Evaluation of Terms). Internalization simply saves us a lot of work if it comes to substitutions!
On the other side, internalization is obviously not helpful in establishing substitution calculi for pure syntactic logic frameworks and/or for logic frameworks without operations. Also in logic frameworks, where some variables may range over logic formulas, internalization of terms will be of restricted help.
As an example of a definition that is independent of Proposition 5, we give an explicit inductive definition of substitution application.
Definition 11
(Substitution Application). For any sets X, Y of variables and any substitution we can define inductively a corresponding substitution application such that :
- Variables:
- , for all ;
- Constants:
- , for all ;
- Operations:
- , for all .
Remark 7
(Kleisli Category). The composition of substitutions defined above, together with as the identity substitution for every set X gives us a category of substitutions. In more abstract categorical terms, this is exactly the Kleisli category of the adjunction , which is equivalent to the full subcategory of of all term Σ-algebras (see, for example, [15]).
3.5. Two Model-Theoretic Implications of the Existence of a Free Functor
Before we turn to our actual topic “derived operations”, it is maybe worth to round up our discussion of monomorphisms and epimorphisms in . We mentioned already in Corollary 2 that injective -homomorphisms are monomorphisms in since the functor is faithful and reflects therefore monomorphisms. The first observation is that the existence of the free functor now provides the implication in the other direction.
Lemma 3
(Monic implies Injective). For every monic Σ-homomorphism the underlying map is a monomorphism in , i.e., injective.
Proof.
We consider an arbitrary set X and arbitrary maps such that .

By uniqueness of algebraic extensions we have and (feature (10) compatibility of substitution application and evaluation) thus the assumption entails . monic implies and by pre-composition with we obtain as required. □
Second, the free functor helps to elucidate the intuition behind the choice of the adjectives “accessible”/“reachable” in Definition 6, namely that each element in can be accessed/reached by first applying the map f and then applying successively the operations in .
Lemma 4
(Accessible via Map ≅ Accessible via Extension). For any Σ-algebra and any map we have for the algebraic extension . In such a way, is accessible via if, and only if, is accessible via .
Proof.
Feature (10) compatibility of substitution application and evaluation ensures for any Σ-subalgebras of that f factors through if, and only if, factors through . □
By Lemma 4, Proposition 4, and Corollary 7 we obtain the following equivalences.
Corollary 9.
For any Σ-algebra and any map the following statements are equivalent
- is accessible via .
- is accessible via .
- is an epimorphisms in .
- is an epimorphism in , i.e., surjective.
3.6. Terms and Derived Operations
For any set X and any -algebra the evaluation of -terms over X in is actually a map from into A. In Definition 9 we fix an arbitrary element and define a corresponding map by varying inductively over . That is, we describe the map from into A by an -indexed family of maps . This kind of splitting is the basis for the internalization trick.
We can, however, also proceed the other way around. We can represent the map from into A by a -indexed family of maps from into A or . is the singleton used in Definition 1 to declare the output arity of operation symbols.
Definition 12
(Derived Operations). For any set X of variables, any Σ-algebra and any Σ-term we define a corresponding derived operation , i.e., the map
We call the maps derived operations since they are built up from the basic operations in (compare Definition 14 below). Derived operations live on the same “external level” as the basic operations, i.e., outside of carrier sets of algebras. Terms represent those derived operations, thus it is opportune to also have a complementary external view on terms and consider them as syntactic entities living together with operation symbols on the same external level. Especially, we can consider terms as entities existing independent of and prior to algebras.
To support and validate the external view on terms, we should avoid the sleight of hand in Definition 12 and define derived operations, independent of Definition 9, simply by constructing new maps from given maps.
The only two constructions we need for this purpose are available in any category with finite products: Composition of maps (morphisms) and tupling of maps (morphisms). Since we use non-traditional finite products , instead of traditional Cartesian products , to define domains and codomains of operations, it is probably worth to spell out the corresponding version of tupling we will rely on.
Definition 13
(Tupling of Maps). For any family of maps with we can construct a map , defined by
For an empty family of maps, denotes the constant map assigning to all the only element in represented by the empty tuple .
Now we are prepared to give an inductive definition of derived operations. The base cases are projection maps, represented by variables, and constant maps. The induction step is implicitly divided into two steps: first tupling and then composition with a basic operation.
Definition 14
(Construction of Derived Operations). For any set X and any Σ-algebra we define inductively for all Σ-terms a corresponding derived operation as follows
- Variables:
- for all the (projection) map is defined by for all ;
- Constants:
- , for all ;
- Operations:
- , for all , .
3.7. Syntactic Lawvere Theories
As long as we restrict to finite sets of variables, syntactic Lawvere theories are the ultimate implementation of the external view on terms while also incorporating the internal view as we will see soon. We will not give a fully detailed exposition but just enough to be prepared for the discussion and definition of derived graph operations in Section 5 (the interested reader may consult [8] for more details).
3.7.1. Construction of Lawvere Theories
Relying on the concept of -term and a substitution calculus, as discussed in the last section, we can define for any signature a syntactic category as follows:
- Objects:
-
As objects we chose canonical finite sets of variablesFor all we assume to be equipped with a fixed total order thus we can reuse the tuple notation to represent maps as discussed in Section 2.
- Morphisms:
- Morphisms are all tuples representing a substitution (declaration) .
- Identities:
- The identity on is the tuple representing the substitution .
- Composition:
- The composition of two tuples and is the tuple representing the substitution where is the application of the substitution according to Definition 11 (compare also (11)).
- Laws:
- Identity and associativity law are ensured by feature (5) composition of substitutions is compatible with substitution application (compare also (12))
3.7.2. Properties of Lawvere Theories
The category has all finite products. We describe binary products:
- The product of two objects and is defined by with projections and .
- The tuple of two morphisms and in is given by
.
Remark 8
(Product versus Sum). The tentative reader has surely realized that is not the product but the sum of and in the category and that represents the cotuple of the two maps and in . However, by choosing the direction of the morphisms in in accordance with the direction of there semantics , becomes indeed the categorical product of and in . In other words, for us it is much more convenient to describe as a category with finite products instead of a category with finite sums. In this way, we avoid, especially, the needless use of opposite categories.
Nevertheless, the reader should keep in mind that syntactic entities are usually and most conveniently constructed by colimits in while the semantics as interpretation paradigm turns those colimits on the syntactic level into corresponding limits on the semantic level. We do have, for example, the exponential law with “” denoting this time the Cartesian product of sets.
The construction of syntactic Lawvere theories for signatures is a free construction on the “external meta-level”. More specific, there is for any signature an equivalence between the category and the category of all finite product preserving functors from into : For every finite product preserving functor there is a corresponding -algebra with carrier and operations defined for each n-ary operation symbol in by with the isomorphisms , provided by the assumption that preserves finite products, and the obvious isomorphism .
Conversely, for every -algebra the assignments , for all , and give rise to a unique finite limit preserving functor such that . This is ensured by Definition 13 and Definition 14.
Finally, comprises all finite term -algebras, in the following sense: It is well-known that hom-functors preserve limits and thus, especially, finite products. In such a way, for all the hom-functor preserves finite limits. According to the above equivalence of categories and the Yoneda Lemma, the corresponding -algebra satisfies the universal property stated in Proposition 5. This means, however, nothing but the -algebras and being isomorphic.
4. Graph Algebras and Graph Term Algebras
Relying on the categorical reconstruction of concepts, constructions and results of traditional Universal Algebra in Section 3, we present in this section a generalization of those concepts, constructions and results to graph algebras.
4.1. Graph Signatures, Graph Algebras and Homomorphisms
We consider the composition of two morphisms in a category as a graph operation. The arity of a corresponding operation symbol could be declared in the following way.
Compared to traditional algebraic operations we can presently infer some essential differences [1]:
- Two different kinds of input items.
- This is evident due to working with graphs which consists of both vertices and edges. Instead of a single set, we declare therefore a graph as the input arity.
- Arbitrary many output items.
- A single output is assumed for algebraic operations, but graph operations can produce arbitrarily large finite graphs as output. Similar to the input, the output arity is chosen to be a graph.
- Output is often related to the input.
- In the case of the composition operation above, the relation between the two arity graphs and is clear from the labelling: the output edge ’’ has the same source and target as the input edges ’’ and ’’, respectively. Instead of always requiring coherent labelling, we introduce a third arity graph , called the boundary of , to encompass the connection between input and output in a fitting way.
We summarise the previous discussion as the following definition.
Definition 15
(Graph signature). A graph signature is given by
- a set of operation symbols,
- a map assigning to each operation symbol in its arity span, i.e., a span of inclusion graph homomorphisms between finite graphs such that the sets and as well as the sets and are disjoint. The graphs , , are referred to as theinput arity,boundary arity, and output arity of , respectively.
If is the empty graph for , we also say that is a constant symbol. Note, that also in this case.
It is maybe worth to mention that the disjointedness condition is equivalent to the condition that is the componentwise set intersection of the graphs and , i.e.
Remark 9
(Arity Renamings). In contrast to traditional operations we use explicit names to identify the input and output “positions” of a graph operation. Names can, however, be chosen arbitrary and we should be prepared to rename, if necessary, the arities of a graph operation.
An arity renaming ϱ from an arity span to another arity span is simply a triple of graph isomorphisms , , such that the following diagram commutes

Remark 10
(Notational Conventions). For all finite graphs , used in arity spans, we assume that the corresponding sets and are equipped with a fixed total order. Relying on our conventions in Section 2, this allows us to represent any graph homomorphism as a pair of tuples , where , and () the image of the i-th (j-th) element in (), , . For any arity span we assume that inherits the order from and , respectively.
We impose the disjointness condition in Definition 15 to distinguish syntatctically between input items of a graph operation and the new output items produced by a graph operation. Another objective is to be able to infer later the arity of a “graph operation expression” only based on the expression itself and the arities of the operations symbols defined in the corresponding signature.
To achieve this goal we will use “canonical arity spans” to describe the arities of operation symbols and graph operation expressions, respectively. In a canonical arity span we use canonical sets of input vertices and of input edges, respectively, with and . In the same way, we use canonical sets of output vertices and of output edges, respectively, with and .
Example 1
(Signature for Categories). We define a signature with an operation symbol to denote operations composing two edges and an operation symbol to denote operations assigning to vertices corresponding identity edges.
As per Definition 15, we extend the arity of proposed in (14) to the span of graph homomorphisms shown in Figure 1 with a boundary graph consisting of only two vertices, and . This encapsulates exactly the desired requirements for a composition operation with regards to sources and targets.
Analogously, the arity of , shown in Figure 2, encapsulates the requirements for an identity operation with regards to sources and targets.
is a locally small category and we employ here the same exponential notation for hom-sets as we did for sets in Section 3. That is, for any graphs and , denotes the set of all graph homomorphisms from into .
Graph operations are maps, i.e., morphisms in ! Specifically, an operation on a graph should take as input a graph homomorphism in and return as output a graph homomorphism in . This procedure needs to respect the boundary which is ensured by requiring the resulting square being commutative.
Definition 16
(Graph Algebra). Let be a graph signature. A(graph) -algebra is given
- by a graph , called the carrier of , and
- a family of maps such that the following diagram commutes for all in and all graph homomorphisms .
The maps in are referred to asgraph operations.
The specific case where is the empty graph , the set becomes a singleton as there is exactly one graph homomorphism , represented by a pair of empty tuples . Thus, for any constant symbol in , with , the corresponding graph operation returns a subgraph of , i.e., it returns the image of under .
In the case where the signature has no constant symbols, the empty graph constitutes a -algebra, called the empty Γ-algebra.
Example 2
(Categories as Graph Algebras). We consider the graph signature in 1.

Obviously, any small category gives rise to a -algebra with the underlying graph of as carrier: The graph operation is defined by the single equation for all where “” denotes the composition in . For the two vertices in the images w.r.t. are always fixed due to the commutativity condition in Definition 16: and .
Not every -algebra, however, can be seen as a category since it may fail to satisfy the identity and/or the associativity law. In [1] we presented some ideas concerning equations for graph algebras but the development of a full equational calculus is a topic of future research.
Example 3
(Chosen Pullbacks). Graph algebras can serve as a conceptual tool to give a precise meaning to statements like “let be a category with chosen pullbacks”.
We define the arity of an operation symbol as the span of inclusion graph homomorphisms given in Figure 3. To choose pullbacks for a small category means then nothing but to define a graph operation assigning to each cospan in a corresponding pullback span .
Remark 11
(Built-in Projections). Given a “set of indices” I and a “carrier set” A, we do have a projection map at hand for any index , as described in Section 2.
Analougously, we obtain for a “graph of indices” and a “carrier graph” a projection map for any subgraph of by simple pre-composition with the inclusion graph homomorphism :
In such a way, we do have for any Γ-algebra and any arity span (as in Definition 15) with exactly one map from to satisfying the commutativity condition for graph operations in Definition 16, namely the projection . In case , is simply the identity on .
We call those projections built-in since their semantics is completely determined by their arity! After the choice of the carrier of a graph algebra we do have these projections available independent of and prior to the choice of the semantics of the operation symbols .
A crucial methodological point is that we can use these built-in projections without being forced to include corresponding auxiliary operational symbols in and/or without any need to define their semantics when defining graph algebras. In the traditional approach we are forced to do this because there is no idea of boundaries at all or, in other words, all boundaries in our sense are per default empty in traditional Universal Algebra.
Our reformulation of the definition of homomorphisms for traditional algebras in Definition 3 applies analogously to graph algebras.
Definition 17
(Graph Algebra Homomorphism). Let Γ be a graph signature. A -homomorphism between two Γ-algebras and is a graph homomorphism satisfying the following homomorphism condition

For any graphs , , each graph homomorphism induces by post-composition a map thus we can, more abstractly but equivalently, express the homomorphism condition (HC) by the requirement that the above right square of maps commutes. Note, that in case of constant symbols , the homomorphism condition turns into the equation if we apply our conventions in Section 2 and and Remark 10 concerning the tuple notation.
Example 4
(Functors as Homomorphisms). In case of -algebras as defined in Example 2, the homomorphism conditions for the operation symbols and , according to Definition 3, are nothing but the usual requirements for functors to be compatible with composition and identities, respectively.
Graph -algebras and -homomorphisms together constitute a category : Composition of two -homomorphisms and is given by the composition of the underlying graph homomorphisms and . Lastly, the identity -homomorphism for any -algebra is given by the identity graph homomorphism .
Proposition 6
(Forgetful Functor). The assignments and define a faithful forgetful functor
The homomorphism condition for -homorphisms between -algebras in Definition 3 has exactly the same structure as the homomorphism condition for -homomorphisms between graph -algebras in Definition 17. In such a way, the pure categorical proof of Theorem 1 can be directly transformed into a proof of the corresponding statement for graph algebras thus we get the following theorem “for free”.
Theorem 2
(Limits of Graph Algebras). inherits any small limit from the category , i.e., the functor reflects small limits. has therefore all small limits since does.
4.2. Comparison with the old definitions
Guided by the pioneering generalized sketch framework developed in the 90s by a group around Zinovy Diskin [4,5,6], we introduced in [1] a different definition of graph signatures and graph algebras, respectively. [1] considers a graph inclusion as the arity of an operation symbol and defines an operation on a graph as a map from to making the following triangle commute for any .
The need for projection operations, among other issues, advised us to introduce explicit output arities. At that point, we could have also chosen cospans to declare the arities of graph operations instead of the spans in Definition 15. The choice of spans has, however, many advantages that we will try to point at later in the paper.
In this subsection we discuss that the new variant and the old variant in [1] are semantically equivalent as either definition of arity, algebra, or homomorphism, respectively, can be obtained from the other.
4.2.1. Comparison of Arity Declarations
For any arity span in Definition 15 we can simply construct a pushout to obtain the result arity

The pushout of the arities of the operation symbol is visualized in Figure 4.
Pushouts in (as in any topos) preserve monomorphisms and, moreover, pushouts with a monomorphism involved are also pullbacks ([16], 13.3). Equation 15 ensures that we can choose the specific pushout , which makes the resulting into a graph inclusion, matching the definition in [1]. Note, that implies .
Conversely, given a cospan of graph inclusions, we can construct the intersection , i.e., the componentwise intersection of the vertex and edge sets. This is well-defined as both and are subgraphs of the same graph . The resulting commutative square of inclusion graph homomorphisms is a pullback in where the span satisfies the condition in Definition 15. In the case where , the square is also a pushout!
Arities of graph operations are, however, defined in [1] by a single graph inclusion only. In this situation, we can construct a cospan of graph inclusion with the smallest subgraph of containing all vertices in and all edges in . By construction, we have . As for cospans, in general, is defined to be the graph . However, the crucial observation is that will always be a discrete graph, i.e., a graph without edges! Note, that this construction is a special case of the construction of so-called initial pushouts in ([9], 6.1).
Since for a pushout of arities implies , this means, especially, that the original definition of arities of graph operations in [1] does not allow us to consider built-in projections (see Remark 11) as legal graph operations. This was one of the main reasons that we introduced spans of graph inclusions as arities in this paper.
In conclusion, the span and cospan version are inverse to each other (at least in ) while the original version in [1] is a special case of the cospan version which is less expressive than the other two versions. All three variants give us, however, a pushout of arities and inclusion graph homomorphisms at hand.
4.2.2. Equivalence of graph operations
Given a pushout of arities we consider an arbitrary .

For any with there exists, due to the pushout property, a unique with and . Conversely, for any with we have trivially .
The uniqueness of mediating morphisms ensures that the assignments and are inverse to each other. This observation ensures that there is a one-to-one correspondence between maps from to satisfying commutativity condition (19) and maps from to satisfying the commutativity condition in Definition 16.
4.2.3. Equivalence of homomorphism conditions
Extending the equivalence of graph operations, also the equivalence of the respective homomorphism conditions can be shown straightforwardly utilizing the uniqueness of mediating morphisms for the pushout of arities, as the interest reader may check.
Remark 12
(Graph of a Graph Operation). For any map its graph is usually defined as the binary relation . Often the story is even turned and maps are introduced as those binary relations which are left-total andright-unique.
Given a pushout of arities and a graph operation we could, anologously, consider the set as the graph of the graph operation . Utilizing the projections from into and , respectively, we could even lift up properties likeleft-total and right-unique to characterize those subsets of that correspond to graph operations.
This observation may be a basis to define Skolemization in Logics of Statements in Context [2] once we have integrated operations into those logics.
has also another important role which was probably one of the reasons that the original definition of sketch operations in [4,5,6] relies on graph inclusions . is the only place where the input items of a graph operation and the new items, created by the graph operation, can be related. In such a way, we have to use if we want to describe and specify properties of the output of a graph operation that depend on properties of the input.
Example 5
(Graph of Pullback Operation). Figure 5 shows the pushout of arity declarations for the operation symbol . Constructing the graph of pullback operations, as described in Example 3, considers for any chosen pullback the whole pullback square, and not just the pullback span.
Example 6
(Chosen In general, any chosen (co)limits of diagrams of a fixed shape in a category give rise to a corresponding graph operation on where arity is simply given by all the vertices in while arity represents the shape of the corresponding (co)cones.
In such a way, the pushout combines the fixed shape of diagrams with the shape of corresponding (co)cones thus the elements in the graph of the corresponding graph operation on represent, at the same time, a diagram and a (co)cone for this diagram.
Remark 13
(Advantages of Spans of Arities). Starting with a span of arities as in Definition 15 we get a corresponding commutative square of arities by a simple pushout construction. That this square becomes, moreover, in any topos a pullback is a necessary side effect.
If we start, in contrast, with a cospan we could construct a pullback to get a commutative square of arities. In the case of graphs (and probably in arbitrary pre-sheaf topoi) it is sufficient to require that the cospan of inclusion morphisms is jointly epic to make the pullback square simultaneously a pushout square. We are, however, not sure that this condition is sufficient for arbitrary topoi.
The tricky construction of initial pushouts for a single arity inclusion (and not a cospan!) may also generalize to arbitrary pre-sheaf topoi but probably not to arbitrary topoi.
The original definition of arities and graph operations in [1] turned out to be not appropriate to define derived graph operations. On one side, projections are necessary to define an appropriate notion of derived graph operations. The original definition excludes, however, projections. On the other side, our later construction of derived operations, by means of epi-mono factorizations and pushouts, can not be equivalently mimicked by means of the original definition. Even the universal property of initial pushouts is not of help in establishing an equivalence.
4.3. Graph Subalgebras
The definitions and results for graph algebras, presented in this subsection, are new and can not be found in [1].
The effort, we spent in Section 3, to lift up the traditional exposition of algebras to a more categorical one, pays now off. We can directly transfer most of the definitions and results from algebras to graph algebras. The only difference is that the "ad hoc totalization trick" in the proof of 3 does not work in case of graph algebras and that there is no axiom of choice in .
In contrast to Section 3, we do not distinguish between “subalgebras” and “inclusion homomorphisms”. We define “subalgebras” simply as “inclusions”.
Definition 18
(Graph Subalgebra). Let be a graph signature. A Γ-algebra is a -subalgebra of a Γ-algebra if and and the inclusion graph homomorphism establishes a Γ-homomorphism .
We know that the monomorphisms (epimorphisms) in are exactly the injective (surjective) graph homomorphisms, respectively. Faithful functors reflect monomorphisms and epimorphisms. The forgetful functor is faithful thus we obtain
Corollary 10
(Injective and surjective Homomorphisms). If the underlying graph homomorphism of a Γ-homomorphism is injective (surjective) then is a monomorphism (epimorphism) in .
The category has all small limits and colimits and those are obtained by componentwise limits and colimits, respectively, in . This means, especially, that has all small multiple pullbacks (see Remark 3). Due to Theorem 2 we can define, in such a way, the intersection of graph subalgebras analogously to the intersection of subalgebras in Corollary 3.
Corollary 11
(Intersection of Graph Subalgebras). For any set I, any Γ-algebra , and any diagram of Γ-subalgebras , of there is a unique Γ-subalgebra of with , i.e., and , that is a Γ-subalgebra of for all .
Moreover, the inclusion Γ-homomorphisms , and constitute a multiple pullback, i.e., a limit cone of the diagram .
We call also the intersection of the I-indexed family of Γ-subalgebras of and may use the notations , or, simply, to denote .
The category is well-powered, i.e., the collection of all graph subalgebras of a graph algebra is a set, thus we can define a concept “accessible via a graph homomorphism”.
Definition 19
(Graph Subalgebra accessible via a Graph Homomorphism). For any Γ-algebra and any graph homomorphism let be the set of all Γ-subalgebras of such that φ factors through the inclusion graph homomorphism , i.e., there exists a graph homomorphism such that .
We denote by the intersection of , according to Corollary 11. Especially, the carrier of is the intersection of graphs. We call the-subalgebra of accessible (reachable) via or thehomomorphic image of w.r.t. .
In case of inclusion graph homomorphisms we use also the notation instead of and call also the-subalgebra of generated by .
Note, that the graph homomorphism in Definition 19 is unique, if it exists, since the inclusion graph homomorphism is a monomorphism in .
We can also transfer Corollary 4 to graph algebras since for any graph homomorphism the set-theoretic image of w.r.t. constitutes a subgraph of . Moreover, we have for the set of all subgraphs of .
Corollary 12
(Homomorphic image includes Image). For any Γ-algebra and any graph homomorphism we have for the set-theoretic image of w.r.t. φ.
Definition 20
(Accessible and Generated Graph Algebras). Let be a Γ-algebra.
- isaccessible via a graph homomorphism if .
- If is accessible via an inclusion graph homomorphism , i.e., if , we say also that isgenerated by .
- is said to be generated if it is generated by the empty graph, i.e., accessible via the unique graph homomorphism from the initial object in to .
Corollary 13.
A Γ-algebra is generated if, and only if, there are no proper Γ-subalgebras of .
Corollary 14.
If a signature Γ has no constant symbols, then the empty Γ-algebra is the only generated Γ-algebra.
The concept accessible via a graph homomorphism can be utilized to find a characterization of epimorphisms in . First, we observe that “accessible” implies “epic”.
Lemma 5
(Accessible implies Epic). A Γ-homomorphism is an epimorphism in if is accessible via the underlying graph homomorphism , i.e., if .
Proof.
We consider arbitrary Γ-homomorphsms such that .
We know that the subgraph of with , together with the inclusion graph homomorphism is an equalizer of the graph homomorphisms in . According to Theorem 2, there is a unique Γ-algebra such that becomes an inclusion Γ-homomorphism which is, moreover, the equalizer of the Γ-homomorphisms .
Assumption ensures that there exists a unique graph homomorphism with . Due to the construction of in Definition 19, we have an inclusion Γ-homomorphism . Accessibility of means thus we get, finally, . This means, however, that the equalizer of ψ and ϕ in is the identity on thus we have as required. □
We can also show that graph subalgebras are regular monomorphisms. Unfortunately, the “ad hoc totalization trick”, used in the proof of Proposition 3, does not work for arbitrary graph operations since we may have, in contrast to traditional operations, non-empty boundaries and a corresponding commutativity requirement for graph operations. The simplest example, where this trick fails, is an operation that simply outputs a chosen edge between two distinct nodes.
What we need is a more well-behaved procedure of transforming partial graph algebras into total graph algebras. We develop therefore in Section 4.4 a corresponding free construction called term completion.
Proposition 7
(Graph Subalgebras are Regular Monos). For any Γ-subalgebra of a Γ-algebra there exists a Γ-algebra and parallel Γ-homomorphisms such that is the equalizer of ψ and ϕ in .
Proof.
Utilizing th term completion construction and its characterization as a free construction, as presented in Section 4.4, we will sketch a proof varying the proof of Proposition 3.
We construct the pushout of the span of inclusion graph homomorphisms (see the left diagram below). We set . Since is monic in both graph homomorphisms are monic too and, moreover, the pushout square is as well a pullback square. This ensures, especially, that is the equalizer of the graph homomorphisms in .

Graph Operations on : We extend to a partial Γ-algebra (see Definition 21) by defining for each in a corresponding partial graph operation according to Case 1, Case 2 and Case 3.
The operations in are defined exactly in a way that the graph homomorphisms and become Γ-homomorphisms , in the sense of Definition 22, thus we obtain a commutative square in (see the middle diagram above).
Applying the functor we transform this commutative square in into a commutative square in . Taking into account Corollary 15 and (23) we get the commutative diagram on the right above.
The underlying square of graph homomorphisms is again a pullback in since the inclusion graph homomorphism is monic in .
Theorem 2 ensures, finally, that the Γ-homomorphism is the equalizer of the Γ-homomorphisms . □
Regularity of entails that the concepts accessible and epic are equivalent.
Proposition 8
(Accessible ≅ Epic). For any Γ-homomorphism it holds that is accessible via the underlying graph homomorphism , i.e., in other words is equal to the homomorphic image of w.r.t. φ, if, and only if, is an epimorphism in .
Proof.
“Accessible implies epic” has been shown in 5. We show now “epic implies accessible”: We consider an arbitrary Γ-subalgebra of such that there exists a graph homomorphism with . Due to Proposition 7 there exist Γ-homomorphisms such that is the equalizer of ψ and ϕ. Due to the assumption , we get and thus since φ is epic. This means, however, and, finally, due to the construction of in Definition 19. □
The axiom of choice is not valid in . Therefore, the set-theoretic image of the carrier of a -algebra w.r.t. a - homomorphism is, in general, not closed w.r.t. operations in . As a consequence, not every epic -homomorphism needs to be surjective. We adapt the standard example of the composition of morphisms in categories.
Example 7
(Epic ≇ Surjective). We consider a -homomorphism between two finite -algebras and , as depicted below.

is empty while has exactly one element given by the assignments , . α and β are in the set-theoretic image while the result of applying to , namely , is not. is not surjective but epic since .
4.4. Partial Graph Algebras and their Term Completion
In practice, graph operations are often partial graph operations. The sketch operations introduced in [5,6], for example, can be seen as partial graph operations where the domain of definition is specified by diagrammatic predicates. Therefore we decided to present in this paper also the very basic definitions for partial graph algebras.
This decision was also triggered by the observation that we could prove Proposition 7 for arbitrary graph signatures based on a well-behaved completion procedure transforming partial (graph) algebras into total (graph) algebras. To our little surprise the construction of (graph) term algebras turns out to be just a special case of this new procedure.
Definition 21
(Partial Graph algebra). Apartial (graph) -algebra is a pair given
- by a graph , called the carrier of , and
- a family of partial maps such that the following diagram commutes for all in and all graph homomorphisms .
The partial maps in are referred to aspartial graph operations.
Be aware that also constants can be partial! For any constant symbol in , with , we do have exactly two possibilities since is a singleton: Either, , i.e., the constant is defined, or , i.e., the constant is not defined.
Definition 22
(Partial Graph Algebra Homomorphism). A -homomorphism between two partial Γ-algebras and is a graph homomorphism satisfying the following homomorphism condition

In other words, definedness of partial operations has to be preserved by a homomorphism but does not need to be reflected!
Partial graph -algebras and -homomorphisms between them constitute a category : Composition of two -homomorphisms and is given by the composition of the underlying graph homomorphisms and . The identity -homomorphism for any partial -algebra is given by the identity graph homomorphism . We consider graph -algebras as special partial -algebras thus is a full subcategory of .
Proposition 9
(Forgetful Functor). The assignments and define a faithful forgetful functor
By introducing a fresh new element whenever an operation is not defined for a certain input, we can transform any partial (graph) algebra into a total (graph) algebra.
Remark 14
(Syntactic Representaion of Inputs). In addition to our notational conventions in Section 2 and Remark 10 we will rely on the following syntactic representation of inputs of graph operations: For any graph and any in an input is represented by two strings, representing the vertices and the edges in , respectively, separated by the symbol “|”
where and . In case , the only input is represented, in such a way, by two separated empty sequences: .
Of course, we could work with any other syntactic representation as long as the following two important properties are satisfied: (1) Uniqueness, i.e., for all we have if, and only if, . (2) is indeed a representation, i.e. we are able to reconstruct from the corresponding graph homomorphism with help of the information about in the signature Γ. In case has no isolated vertices, for example, we can represent uniquely any by the string only!
Definition 23
(Term Completion). Let be a graph signature and be a partial Γ-algebra. We define the -term completion of the graph w.r.t. the partial Γ-algebra as the smallest graph satisfying the following three conditions:
- Generators:
- Constants:
-
For all constants in , such that the graph contains
- as a vertex, for each vertex in ;
-
as an edge, for each edge in ,where and
- Operations:
-
For all in with and any such that there is no with , contains
- as a vertex, for each vertex in ;
- as an edge, for each edge in , where
Obviously, we have
Remark 15
(Term Construction by Pushouts). The construction of Γ-terms in Definition 23 can be organized as a successive application of term construction steps: A term construction step in the case Constants means that we construct, in parallel, for a constant symbol the terms for all vertices and edges in . Analogously, a term construction step in the case Operations means that we construct for an operation symbol and an input , in parallel, the terms for all vertices and edges in . We start with the graph and each term construction step extends a given graph to a graph . This extension is, however, nothing but the construction of the following pushout

where the definition of is spelled out, explicitly, in Definition 24. In the light of this observation, one can look at the term notation as a means to solve two problems:
- The term notation provides a uniform mechanism to create unique identifiers for the new graph items introduced by applying a non-deleting injective graph transformation rule.
- At the same time, the term notation encodes all the information necessary to identify uniquely the pushout that has been creating the new items.
The following term completion construction is new and has even never been defined even for traditional partial algebras. Utilizing the operations in to the greatest possible extend, we can straightforwardly extend to a total -algebra with carrier .
Definition 24
(Term Completion Algebra). We can extend any partial Γ-algebra to a total Γ-algebra as follows:
- Constants:
-
For all constants in :
- Utilizing:
- If is defined, we simply reuse it:
- Completion:
-
If is not defined, i.e., we set
- for each vertex in and
- for each edge in .
- Operations:
-
For all in with and any :
- Utilizing:
- If there is a with , we reuse :
- Completion:
- If there is no with , we set
The definitions ensure that the constructed pairs of maps are indeed graph homomorphisms and that the operations in satisfy the commutativity condition in Definition 16. Moreover, the cases “Utilizing ” are defined in such a way that we get
Corollary 15
(Embedding). For any partial Γ-algebra the inclusion graph homomorphism constitutes a Γ-homomorphism in thus, due to (21), if is a total Γ-algebra.
We can adapt and generalize the proof of Proposition 2 (Free graph algebras) in [1] to a proof that term completion is a free construction.
Proposition 10
(Term Completion as Free Construction). For any partial Γ-algebra , the total Γ-algebra has the following universal property: For any total Γ-algebra and any Γ-homomorphism there exists a unique Γ-homomorphism such that the defining condition is satisfied.

Proof.
We prove by structural induction according to Definition 23 and Remark 15.
- Generators:
- In this basic case the defining condition forces for all and for all .
- Constants:
-
In the second basic case we have for all constants in :
- Utilizing:
- If is defined, the definition of operations in , the defining condition and the assumption that φ is a Γ-homomorphism ensure that satisfies the homorphism condition for the constant :
- Completion:
-
If is not defined, the definition of operations in and the required homomorphism condition for forces for each vertex inFor each edge in we get, analogously, .
- Operations:
-
We have for all in with and any :
- Utilizing:
- If there is a with , the definition of operations in , the defining condition and the assumption that φ is a Γ-homomorphism ensure that satisfies the homomorphism condition for :
- Completion:
-
If there is no with , the induction hypothesis is that is already defined on a subgraph and that . This ensures . In the induction step we extend to the graph . The definition of operations in and the required homomorphism condition for forces for each vertex inFor each edge in we get, analogously, .
□
The assignments and define, as usual for free constructions, a functor , and this functor is left-adjoint to the inclusion functor .
Due to Corollary 15 we even have , i.e., is a full reflective subcategory of . Especially, we have for any -homomorphism in
4.5. Graph Terms and Graph Term Algebras
Graph term algebras are just the special case of term completion algebras where all the graph operations in are completely undefined, i.e., where everything is determined by the carrier only.
Definition 25
(Graph Term Algebras). Let be a graph and be the corresponding unique partial Γ-algebra where all graph operations are completely undefined.
- Graph terms
- We denote the graph , according to Definition 23, also by and call it thegraph of all (graph) -terms on .
- Graph term algebra
- We denote the term completion Γ-algebra , according to Definition 24, also by and call it the-term graph algebra on .
Assigning to any graph the corresponding unique partial -algebra where all graph operations are completely undefined, defines a functor from to that is left-adjoint to the forgetful functor in Proposition 9. Combining this adjunction with the adjunction in (22) gives us the desired universal property of graph term algebras at hand.
Proposition 11
(Graph Term Algebra as Free Construction). Given a graph the Γ-term graph algebra has the following universal property: For any total Γ-algebra and any graph homomorphism there exists a unique Γ-homomorphism such that the defining condition is satisfied.

It might be worth to mention that Proposition 11 enables us to also transfer Lemma 3 and Lemma 4 in Section 3.5 straightforwardly to the graph algebra setting.
The definition of graph term algebras and their characterization as a free construction is the main result in [1]. We claimed: “The Kleisli category of the new adjunction provides an appropriate substitution calculus.” However, time passed and we realized that this claim is only true with some reservations.
- Substition Calculus:
- Graph term algebras manifest the “internalization approach” in the case of graph algebras. Relying on Proposition 11, we can indeed obtain a fully fledge substitution calculus, meeting the requirements formulated in Section 3.4.1. Based on the idea that a substitution (declaration) is now given by a graph homomorphism and that a variable assignment is a graph homomorphism for a -algebra , we can simply transfer all the discussion, definitions and results from Section 3.4.2 to graph algebras. We will spare the reader this copy-paste exercise.
- No appropriate concept of Derived Operation:
- In traditional Universal Algebra we do have a one-to-one correspondence between the “internal view” of terms as elements of free algebras and the “external view” of terms as an appropriate representation of derived operations (compare Definition 12 and Definition 14). It took us a while to understand that and why this one-to-one correspondence breaks down if it comes to graph algebras. We discuss and address this problem in the next section.
5. Derived Graph Operations
We now discuss the reasons why graph terms are, in our opinion, not providing a fully adequate and appropriate concept of derived graph operation. First, each graph term, interpreted as an operation in a given graph algebra, will only produce isolated single vertices or single edges (without source and target), respectively. What we do need, however, are graphs as outputs of derived graph operations! This flaw could be repaired by considering not single graph terms but subgraphs of graphs of graph terms.
Lemma 6
(Operations by Subgraphs). For a given graph , any subgraph defines a span of graph inclusions with . Moreover, we obtain for all graphs a map defined by for all and satisfying the commutativity requirement for graph operations in 16.
However, this solution is also not quite satisfactory. Each item in is given by a separate term expression and the different term expressions may represent, in general, different “computation schemes”. What we want and need, especially in practical applications, is a single graph operation expression built up from variables and the symbols in such that the corresponding derived operation for a -algebra produces, in parallel, for any input all (!) output items simultaneously by the same computation. Moreover, we would like to be able to define the semantics of those graph operation expressions, i.e., the corresponding derived graph operations in -algebras, independent of graph term algebras and in a comparably easy, well-structured inductive way as we did it for terms in Definition 14.
Unfortunately, traditional terms are not providing a fully appropriate blueprint to define such graph operation expressions. In Definition 8 terms are constructed by the following steps: The two basic steps Variables and Constants, and the induction step Operations which is implicitly split into two steps - (1) Tupling and (2) Symbolic Sequential Composition of a tuple with an operation symbol. This splitting becomes apparent in Definition 14 (Construction of Derived Operations).
In the case of graph operations the step Variables turns into a step (Built-in) Projections. Besides this, there is nothing wrong with any of the steps except the step Tupling.
Example 8
(Composition of four Edges). To illustrate the problems with tupling we consider the composition of four edges. We are interested in a “graph operation expression” built up of three copies of the operation symbol , as defined in Example 1. The input arity of the expression should be the graph 2 3 4 5 and the output arity should be the graph 1 5 with representing the composition of the four edges in the input arity.
An obvious idea is that in a first step two parallel applications of produce the graph 1 3 5 with representing the composition of the edges , and representing the composition of the edges , , respectively. In a second final step, the third application of should produce then the edge 1 5.
If we describe the first step by a tuple we will not get 1 3 5 as output arity but only a pair of separated edges. This pair of edges, however, does not match the input arity of thus the second step can not be performed.
One could argue that we can repair this flaw a posteriori by “gluing” the two separated graphs on the overlapping part, i.e., on the vertex in the example. This construction, however, would be rather complicated and pathological as it would consist of a mixture of colimit and limit constructions. In the next subsections we will propose a more systematic well-behaved mechanism based on a priori “soldering”.
5.1. Reconstruction of syntactic Lawvere Theories
In this section we analyze the construction of syntactic Lawvere theories in more detail to better understand the “nature of tupling” and to find a way to solve the problems with tupling pointed at in Example 8.
In Section 3.7 we defined syntactic Lawvere categories relying on a given concept of term and a corresponding substitution calculus. Moreover, we have seen that syntactic Lawvere categories can be characterized as finite product categories freely generated by a signature. Following this observation, we will now turn the story and reconstruct the concept of term by means of the language of finite products and a corresponding axiomatization of finite products.
5.1.1. Categories with Finite Products
We start with a standard definition of finite products. A category has finite products if, and only if, the following ingredients are present:
- has an empty product (terminal object) , i.e., for any object A in there is a morphism such that
- For any family , of objects there is an object together with projections , such that
-
for any object B and any family , of morphisms there is a morphism withMoreover, we have and .
- Finally, for all morphisms the following equation holds
5.1.2. Categories based on Finite Product Expressions
To reconstruct syntactic Lawvere categories, we define, in a first step, reflexive graphs with finite product expressions as edges and an associative composition. A finite product expression (or fp-expression for short) is a string of symbols built up of variable symbols, operation symbols, angle bracket symbols to denote tupling, the semicolon symbol “” to denote symbolic composition and the auxiliary comma symbol “” to separate substrings.
In a second step, we generate out of fp-expression graphs finite product categories with equivalence classes of fp-expressions as morphisms.
We will only outline the definitions, constructions and results. One possibility to do it completely formal and precise is to reuse, for example, the well-developed theory of specifications of partial algebras with conditional existence equations [17,18] and to construct the finite product categories as “partial quotient term algebras” freely generated by signatures (compare [19]).
First, we define for any signature a reflexive graph with an associative composition as follows:
- Objects:
- As objects we choose the same canonical finite sets of variables as for
- Morphisms:
-
Morphisms are all finite product expressions defined inductively as follows
- Symbolic Projections:
- is an fp-expression for all , .
- Constant and Operation Symbols:
- with is an fp-expression if is an n-ary operation symbol in .
- Empty Symbolic Tuples:
- is an fp-expression for all .
- Non-empty Symbolic Tuples:
- is an fp-expression for all , and all families , of fp-expressions.
- Symbolic Sequential Composition:
- is an fp-expression for all and all fp-expressions , .
- Symbolic Identities:
- is the identity on for all and is the identity on .
Remark 16
(Computation Diagrams). Inspired by logic circuit diagrams, term graphs [20], andstring diagrams [21], we will use informal computation diagrams to visualize the computations represented by fp-expressions. A computation diagram consists of “computation units”, “(data-flow) edges”, and input and output “ports”.
Each n-ary operation symbol is seen as a “computation unit” with n input ports and a single output port. Variable symbols appear, however, in two different roles: As “ports”, i.e., as elements of the objects , and as “computation units”, i.e., as identifiers for projections. To distinguish these two roles we simply denote ports by i instead of . As a “computation unit”, a variable simply copies values from a single input port to an arbitrary finite number of output ports.
Example 9
(Finite Product Expressions). Let Σ be a signature with two binary operation symbols “+” and “*”. Both fp-expressions and are equivalent, according to the equations (24) – (26), and represent simple “tree-like” computation diagrams as depicted below. The picture below visualizes also the effect of symbolic composition.

The equations (24) – (26) do not enforce that the unary symbolic tuple is equivalent to the fp-expression even if both fp-expressions represent “essentially” the same computation and are therefore depicted by the same computation diagram!
The first fp-expressions represent the addition of two numbers. We can, of course, derive expressions, representing the doubling of a number, as the expression , for example. The picture below shows how the corresponding dag-like computation diagram is obtained by composing a “copying unit” with a computation unit.

More generally, fp-expressions allow us to represent arbitrary “sharing of sub-computations”. The fp-expression , for example, represents the square of the sum of two numbers. The corresponding dag-like computation diagram is depicted below

Relying on the identity and associativity law as well as the axioms of finite products, according to the equations (24) – (26), we generate a family of equivalence relations in for all that is compatible with symbolic composition and symbolic tupling. We construct the corresponding equivalence classes of fp-expressions and define composition, identity and tupling operations on these equivalence classes in the usual way by representatives. What we obtain, finally, is a finite product category with equivalence classes of symbolic tuples as morphisms.
Adapting the recipe from Definition 14, we can obviously translate every -term into an fp-expression .
Definition 26
(Translation of Terms into Finite Product Expressions). For any set , we define inductively for all Σ-terms a corresponding finite product expression as follows
- Variables:
- , for all , .
- Constants:
- , for all ;
- Operations:
- , for all , .
We call all the fp-expressions , obtained by Definition 26, fp-expressions in normal form. Correspondingly, all the fp-expressions are called symbolic tuples in normal form. We use the term “normal form” since they are in normal form w.r.t. a rewrite system consisting of the rewriting rules given by the equations (24) – (26) read from the left to the right [14].
Example 10
(Finite Product Expressions - Normal Forms). From the five fp-expressions in 9 the two expressions and are fp-expressions in normal form while is a symbolic tuple in normal form.
None of the rules (24) – (26) can be applied to +! However, applying these rules we can transfer the fp-expression , that is the symbolic composition of a symbolic tuple in normal form with an fp-expression in normal form, into normal form:
The picture below shows the result of this transformation into normal form for the relevant sub-expression .

The general effect of normalization is that all “value copying” is moved to the beginning while we have to “clone computations units” to get rid of “value copying” happening elsewhere.
The crucial observation is that every equivalence class of symbolic tuples, constituting a morphism in , contains exactly one symbolic tuple in normal form! Based on this observation it can be shown that the category is isomorphic to the syntactic Lawvere category .
5.1.3. Substitutions Revisited
Since every equivalence class of symbolic tuples in contains exactly one symbolic tuple in normal form, we can define a corresponding representation category with morphisms all symbolic tuples in normal form.
However, symbolic composition of a symbolic tuple in normal form with an fp-expression in normal formal or a symbolic tuple in normal form does not result, in general, in an fp-expression in normal form or a symbolic tuple in normal form, respectively. We have to normalize this composite fp-expression to define composition in .
The rules, given by the equations (24) – (26), are not sufficient to transform any fp-expression in its normal form. They are, however, sufficient to compute the normal form of all symbolic compositions of a symbolic tuple in normal form with an fp-expression in normal formal and thus, due to equation (26), of all symbolic compositions of symbolic tuples in normal form! We described an example of a normalization of a symbolic composition of a symbolic tuple in normal form with an fp-expression in normal formal in Example 10.
We do have now a chain of isomorphisms between categories . The morphisms in are tuples of terms representing substitution declarations while composition is nothing but substitution application. The tuples of terms in are transformed into symbolic tuples in normal form in while composition in is given by symbolic composition plus normalization. So, in the light of substitution calculi, as discussed in Section 3.4.1, we get the following correspondence of concepts: “substitution declaration” ≅ “symbolic tuple in normal form”. Moreover, Lawvere’s original slogan “composition is substitution” turns into the slogan
substitution application ≅ symbolic composition plus normalization.
This perception may open a path to develop, once in the future, an appropriate substitution calculus for derived graph operations!?
5.2. Analysis of Finite Product Expressions
After we transformed the syntactic Lawvere category into the isomorphic categories and , we can now attack the problems, pointed at in Example 8, by analyzing in more detail finite product expressions.
5.2.1. Finite Products vs. Tensor Products
It is well-known that finite products give us also tensor products at hand [21]. We will use the term parallel composition of morphisms instead of tensor product of morphisms and we will use the bar symbol “|” instead of “⊗” to denote parallel composition of morphisms. The picture below visualizes the parallel composition of the fp-expression with itself.

The other way around, tensor products together with copying allow us to define finite products [21]. In our present setting copying is represented by symbolic tuples of symbolic projections thus each non-empty symbolic tuple can be equivalently described by a symbolic composition of a symbolic tuple of symbolic projections with a parallel composition of expressions. The picture below shows the result of this transformation for the fp-expression , discussed in Example 10. To exemplify that we do not have always , we show also the result for the variant .

In conclusion, in case of traditional operations tupling can be equivalently replaced by parallel composition plus copying. There are no problems concerning parallel composition of graph operations thus the problem with tupling can be, finally, encircled to be a problem with copying. We have to replace, eventually, copying by another mechanism that does not cause problems!
5.2.2. Copying vs. Soldering
How can we explain, in terms of computation diagrams, the effect of pre-composing an expression with a symbolic tuple of symbolic projections? We construct out of a computation diagram with n input ports and m output ports a new computation diagram with with k input ports and the same m output ports.
To explain this construction, we have to leave the pure world of expressions and remember that a symbolic tuple of symbolic projections encodes a map between ports (!). If is not surjective, the construction adds each element in as a “dummy input port”. In addition, each original input port is soldered with all other input ports with to a single input port in . Relying on our conventions in Section 2 concerning the notation of maps, we will use a new type of expression to denote the new operation from to defined by the newly constructed computation diagram and call it the instance of w.r.t. . The left picture in Figure 6 visualizes the construction of .
In the case of computation units and non-injective, surjective maps , we could even interpret the construction of as the construction of a new computation unit computing, for example, the square of a number (see the right picture in Figure 6).
In case of traditional operations, soldering of input ports has no effect on output ports since the boundaries are empty! In case of graph operations, however, soldering of input ports may cause soldering of items in the boundary and thus, potentially, also of output ports. This is exactly the mechanism, we have been looking for to solve the problems with tupling exemplified in Example 8 as we will demonstrate in the next Section 5.3.
5.3. Three Mechanisms to construct new Graph Operations
Our analysis in the last subsection suggests that we should try to define “derived graph operations” by means of three basic constructions on graph operations - parallel composition, instantiation, and sequential composition, respectively.
5.3.1. Parallel Composition
Given a graph and a family , , of graph operations with arity spans we can construct a new graph operation
called the parallel composition of , where the arity graphs are given by sums of graphs , , and the inclusion graph homomorphims are sums of graph homomorphisms , .
The sum comes along with a family , of injections and for any the uniqueness of mediating morphisms entails the equation
Applying the given operations , we obtain a family of graph homomorphisms satisfying the commutativity requirement for graph operations in Definition 16:
We define the result of applying to an input as the unique cotuple of the single results
The algebraic laws of cotuples and sums ensure that the commutativity requirement for graph operations is satisfied:
Remark 17
(Parallel Composition - Index Shifting). In case that all the arity spans are canonical arity spans, in the sense of Remark 10, we can construct the arity also as a canonical arity span.
We construct the sums of sets and , respectively, utilizing the technique of “index shifting” we used in SubSection 3.7.2 to define finite products in Lawvere theories. The sum of boundary graphs can be chosen to be a corresponding subgraph of . Finally, we can construct a sum with and , respectively, where both sums of sets and are again constructed by means of “index shifting”.
The technique of “index shifting” allows us to define sums of canonical arities in such a way that the formation of these sums becomes associative. This means, especially, that there is no need to work with “nested parallel compositions”.
Example 11
(Parallel Composition). We consider a -algebra given by a category as described in Example 2. The upper part of Figure 7 is the same as the upper part of Figure 14 and shows the arity of the parallel composition of the composition operation in with itself.
Analogously, the upper part of Figure 8 shows the arity of the parallel composition of the composition operation in with the built-in projection (identity map) , as defined in Remark 11, where is the canonical input arity graph 1 2. (The notations for “graph operation expressions”, like and , will be defined in Section 5.4.)
5.3.2. Instantiation
Given a graph and a graph operation with arity , we can construct for any finite graph and any graph homomorphism a new graph operation
called the instance of ω w.r.t. φ, where and is constructed as a pushout of the span with such that and are disjoint as depicted in the picture below. For any input we can apply the given graph operation to and obtain a result such that . Since by construction, we obtain thus the pushout property of the right square entails the existence of a unique such that and .

It is probably worth to mention that it is sufficient to require that . is an epimorphism by construction such that also becomes an epimorphism since pushouts preserve epimorphisms. Therefore, is uniquely determined by the requirement . Moreover, this requirement also implies since is an epimorphism. In other words: factors uniquely through thus the term “instance” is indeed appropriate.
For any input we define . This ensures, especially, the required commutativity.
Remark 18
(Instantiation - Canonical Arities). For a canonical arity span and a canonical input arity graph we do have that and are disjoint. In such a way, we can simply define and such that ’ ’ becomes a canonical arity span as well.
Example 12
(Instances of the Composition Operation). There are four different instances of the composition operation in a -algebra as described in Example 2.
Example 13
(Tupling versus Soldering). The lower part of Figure 7 visualizes the arity of the instance of the parallel composition in Example 11. It shows that instantiation provides indeed the “soldering effect” we need to solve the problems with “tupling” as exemplified in 8! The output arity of the graph operation consists of two successive arrows thus we can indeed compose it with (see Example 14).
Analogously, the lower part of Figure 8 visualizes the arity of the instance of the parallel composition in Example 11. This example shows that we need also “soldering” to describe the composition of three arrows by means of “derived graph operations”.
Remark 19
(Transfer of Items). Note, that φ is not required to be surjective! The items in have no influence on the output produced by and are ignored. Specifically, they do not appear in and thus not in either.
Any transfer of items from the input to the output has to be done explicitly! If we need to transfer, in addition, also items from to the output, we have to construct first a parallel composition of ω with appropriate built-in projections before we define a corresponding extended that also comprises the items in we wish to transfer. An example for such a “need of transfer” is the successive composition of three arrows (compare Figure 8).
Corollary 16
(Instantiation). Let be given a graph and a graph operation with a canonical arity span . For any canonical input arity graphs , and any graph homomorphisms , we have
Proof.
Follows immediately from the fact and the fact that the composition of two pushouts is a pushout again. The choice of canonical arities insures, especially, and by construction. □
Conjecture 1
(Parallel Composition and Instantiation). It should not be a problem to prove a more general result about the interplay of parallel composition and instantiation.
Let be given a graph and a family , , of graph operations with canonical arity spans together with a family , of homomorphisms where all the are canonical input arity graphs. For any graph homomorphism with a canonical input arity graph we have
5.3.3. Sequential Composition
At first glance, it should not be a problem to sequentially compose two graph operations with arity and with arity . We simply require and define, as usual, composition by successive application: for all while the arity of the sequential composition is given by a standard pullback based composition of spans (see the picture below).

There are, however, at least two problems with this obvious proposal:
- For canonical arity spans and , we can have an equality only if is a built-in projection.
- There are two kinds of output items produced by the sequential composition of two graph operations. First, the output items produced by . Second, the output items produced by and implicitly transferred by , i.e., the items in . In other words, the resulting arity will not satisfy the disjointness condition in 15 if is non-empty!
Since we intend to later define graph operation expressions with canonical arity spans only, we consider canonical arity spans and . To solve the first problem, we introduce sequential composition via arity renaming, i.e., instead of we assume a graph isomorphism and define a graph operation with arity where is isomorphic to and constructed by means of in such a way that becomes a canonical arity span. This also solves the second problem.
We now describe the rather involved step-wise construction of the canonical arity of the graph operation obtained by sequential composition of two given graph operations and via a graph isomorphism . The reader can follow the construction in Figure 11.
- We obtain an epi-mono factorization of by constructing the image of w.r.t. . The resulting restriction of becomes an isomorphism since is an isomorphism.
- The boundary arity of can now be constructed by simple intersection (pullback): and .
- To be able to define as an extension of such that consists of canonical sets of output vertices and output edges, according to Remark 10, we first have to reindex the output vertices/edges in . We construct a graph , isomorphic to with and where and for and .
- We can define an isomorphism that is the identity on and, in addition, restricted to is an order-preserving map from to while restricted to is an order-preserving map from to . The construction ensures that becomes an inclusion graph homomorphism .
- We construct by a pushout of the span
with where is constructed by “index shifting” and where is also constructed by “index shifting”. - The construction ensures and that becomes an isomorphism. We set and obtain a canonical arity span as required.
After the arity of the graph operation has been constructed, we can straightforwardly define by successive application of the given graph operations plus two intermediate arity-based isomorphic transformations:
The commutativity condition in Definition 16 is trivially satisfied since the diagram in Figure 11 is commutative by construction and definition.
Example 14
(Composition of four and three Arrows). The output arity of the graph operation in Example 13 is the graph (see Figure 7) while the input arity of the graph operation is the graph . In such a way, both graph operations can be composed via the arity renaming defined by the assignments . The resulting graph operation with the canonical arity span shown in Figure 12 describes then the way of composing four successive arrows we discussed in Example 8.
Analogously, the output arity of the graph operation in Example 13 is the graph (see Figure 8) while the input arity of the graph operation is the graph . In such a way, both graph operations can be composed via the arity renaming defined by the assignments . The resulting graph operation with the canonical arity span shown in Figure 13 describes then the way of composing three successive arrows in a -algebra that corresponds to the left-hand side of the associativity law for the composition of morphisms in categories
With the obvious changes we can also construct a graph operation with the same canonical arity span but representing the right-hand side of the associativity law.
Conjecture 2
(Associativity of Sequential Composition). We consider three graph operations with two arity renamings as depicted below

What kind of associativity we can gain? Constructing, first, the composition we transfer the diagram of arities above into the diagram

This means, that we can sequentially compose and via . We obtain a graph operation with input arity and output arity .
In contrast, we can not compose and via since the output arity of is and not as required. Fortunately, we can bridge the gap using (see Figure 11 and the diagram below) and construct the sequential composition with input arity and output arity .

We are convinced that one can prove and an associativity law like , but leave this as a topic for future research.
Remark 20
(Constructions and Built-in Projections). For any graph the collection of all built-in projections , as described in Remark 11, is closed w.r.t. any of the three constructions – parallel composition, instantiation, or sequential composition, respectively. That is, applying any of these constructions only to built-in projections will result in a built-in projection.
We made some effort to define the arity spans of resulting graph operations in such a way that the result of applying any of the three constructions to graph operations with canonical arity spans, has a canonical arity span as well.
In such a way, the sub-collection of all built-in projections with a finite canonical input arity becomes also closed w.r.t. any of the three constructions. This fact may cause some redundancy when defining “graph operation expressions” and corresponding “derived graph operations”. We will, however, try to avoid unnecessary redundancy.
5.4. Graph Operation Expressions and Derived Graph Operations
Now, we finally have everything at hand to define graph operation expressions and their semantics, i.e., the derived graph operations we have been looking for. We define graph operation expressions with canonical arities and with a structure as close as possible to the structure of terms. Instead of “terms” we have “single expressions” while “multi expressions” correspond to “tuples of terms”.
Definition 27
(Graph Operation Expressions). For any graph signature we define inductively the set of all(graph operation) -expressions with canonical arity spans.
- Projections:
-
with arity span for any finite canonical input arity graph and any subgraph .is called aprojection expression.
- Constants:
-
with arity for any constant symbol and any finite canonical input arity graph .Moreover, with arity for any non-empty subgraph .Both expressions and are declared assingle -expressions.
- Operations:
-
for any operation symbol , any finite canonical input arity graph , and any graph homomorphism where the arity is constructed as an instance of the arity by means of and a pushout as done in (31).Moreover, for any non-empty subgraph such that non-empty with arity .Both expressions and are calledbasic -expressions and are declared as single -expressions.
- Multi expressions:
-
for any family , , of single Γ-expressions or projection expressions with, at least, one single Γ-expression. The arity is constructed as described in Remark 17.Moreover, for any finite canonical input arity graph , and any graph homomorphism with arity constructed as an instance of the arity by means of and a pushout as done in (31).Both expressions and are declared asmulti -expressions.
- Symbolic composition:
-
for any single or multi Γ-expression with arity , any basic Γ-expression with arity , and any graph isomorphism .The arity with isomorphic to is constructed as described in Section 5.3.3.is declared as asingle -expressions.
Remark 21
(Notational Convention: Trivial Instances). In case of trivial instances, we will just drop the corresponding substring “”:
- Constants:
- In the case , we will just write instead of and instead of .
- Operations:
- In the case , we will just write instead of and instead of .
Since we utilize sequential composition via arity renaming, we could even require φ to be a non-isomorphism in the cases Operations and Multi expressions.
Example 15
(Graph Operation Expressions). The graph operation in 13 is represented by the -expression . By Symbolic compositionwe obtain then the -expression representing the graph operation in Example 14.
The graph operation in Example 14 is represented by the -expression while corresponds to the -expression . Both -expressions share the same canonical arity span shown in Figure 13 and thus, we can express the associativity law (33) for the composition of morphisms in categories by an equation between -expressions:
In (34) we do have a twofold - syntactic and semantic - equality between graph operation expressions: equal arity and equal semantics. A future equational calculus for graph operation expressions should, however, also reflect arity renamings, as defined in Remark 9, and deal with semantic equality of graph operation expressions “up to arity renamings”.
Generalizing the examples of the correspondence between graph operation expressions and graph operations in Example 15 and relying on the inductive definition of graph operation expressions in Definition 27, we define now “derived graph operations” as those graph operations that can be represented by graph operation expressions.
Definition 28
(Derived Graph Operations). Let be a graph signature and a Γ-algebra. For all Γ-expressions with we can inductively define a map satisfying the commutativity condition in (16). is called thederived graph operation in represented by .
- Projections:
- , according to (17), for all .
- Constants:
-
for all .for all .
- Operations:
-
, according to Section 5.3.2, for all .for all .
- Multi expressions:
-
, according to Section 5.3.1, for all ., according to Section 5.3.1 and Section 5.3.2, for all .
- Symbolic composition:
- , according to Section 5.3.3, for all .
Conjecture 3
(Substitutions Revisited). In light of the discussion in Section 5.1.3, it may be possible to develop in the future a substitution calculus for graph operation expressions along the following lines: A substitution is given by a single or multi Γ-expression with arity . The substitution can be applied to a Γ-expression with arity if there is a graph isomorphism . Substitution application is then done in two steps: (1) We build the expression by symbolic composition. If is not a basic Γ-expression, this expression will be not a Γ-expression in the sense of Definition 27! (2) We transform the expression into an equivalent Γ-expression in the sense of Definition 27.
To illustrate this idea, we outline for the graph signature an example of an equivalence between a symbolic-composition expression , that is not a -expression in the sense of Definition 27, and a -expression .
To begin with a feasible visualization, we consider the -expression where ϕ and the arity are described in Figure 14.
Figure 14.
Parallel application of two composition operations on overlapping pairs of arrows.

The sample substitution is given by the extended -expression
with arity depicted in Figure 15. is the canonical input arity graph 1 2. The input arity of extends the input arity of by the arrows 7 8 9 10 while extends ϕ by the assignments .
As -expression we consider with arity shown in Figure 16. φ is given by the assignments .
By means of the isomorphism that is the identity on nodes, we can build the following symbolic-composition expression that is not a -expression
Using the two -expressions in (34), we can, however, construct a -expression given by
All four expressions share the same canonical input arity graph in Figure 14 and θ is defined as the cotuple .
and do have the same arity and are equivalent, that is, for all -algebras we have .
Conjecture 4
(Operations by Subgraphs). At the beginning of this section we discussed that any subgraph of a graph of graph terms defines a graph operation (see Lemma 6). A reasonable question is to what extent this method of defining graph operations can be simulated by means of “graph operation expressions” and “derived graph operations”. We claim that it is possible to prove inductively a statement like the following:
For any finite canonical input arity graph and any finite subgraph there exist a graph operation expression with input arity and an output arity isomorphic to such that for all Γ-algebras we have (up to arity renaming) for the graph operation defined in Lemma 6.
There are two essential means that should allow us to prove such a statement:
- By means of the restriction expressions and we can simulate the “pseudo operation symbols” , , , and their semantics by chosing to be the single output vertex or the single output edge (together with its source and target), respectively.
- Once, we have been able to represent all the single vertices and edges in a subgraph by corresponding graph operation expressions, we can combine them into one graph operation expression by the trick used in Conjecture 3 to define the graph operation expression . All the single output arities will be soldered together resulting in a graph isomorphic to .
6. Operations in Topoi
When we started to write the paper, we intended to round it up with a longer section to summarize the results and findings, and to lift them up to a more abstract level.
On the way, we discovered, however, too many new things and results, that we simply had to investigate and include in the paper, thus it became a bit too long and overloaded. Therefore, we reserve a detailed categorical analysis of the results and findings of the paper and the development of a general theory of operations in topoi as a topic of future research. We already spent, however, some essential effort to revise traditional concepts and results, and to lift them up to a more categorical level thus we want to include, at least, some few remarks concerning this topic.
We are quite sure that all (!) the definitions, constructions and results, including term algebras and the result that subalgebras are regular monic, can be generalized to presheaf topoi (-sets) with a simple category in the sense of [22]. Simple categories are a special class of “finite categories with no cycles of non-identity morphisms” and play a role in the foundation of Homotopy Type Theory.
There is no problem to define signatures and algebras in arbitrary topoi, analogously to graph signatures and graph algebras. However, terms and term algebras will be, in general, not available. A main outcome of the paper is, that there is no need for term algebras to define derived operations. It is sufficient to define “operation expressions” and their semantics, and this can be done in arbitrary topoi (as long as we drop the request that operation expressions should be represented “syntactically”)!
We hope that even a prospective substitution calculus for graph operation expressions (along the ideas in Conjecture 3) can be generalized to operation expressions in arbitrary topoi.
7. Related Work
The work presented in this paper has its seeds in the pioneering work on generalized sketches of a group around Zinovy Diskin in the 90’s [4,5,6]. The concept of sketch operation in [5] was the starting point for the joint paper [1] on graph operations and free graph algebras. As discussed in Section 4.2 it turned out, however, that the original definition of arities and graph operations in [1] is not appropriated to define graph operation expressions representing derived graph operations in analogy to the role of terms as representations of derived operations in traditional Universal Algebra.
Being about to finish the paper and by a chain of accidents, we have been notified of a paper about graph operations (only available in French!) [7] from Albert Burroni a former PhD-student of Charles Ehresmann. The ambition of [7] is very much in accordance with the intentions behind our paper. Graph operations are also defined as maps from to . There are, however, essential conceptual and technical differences between both papers:
- Input and output arity graphs are not described with concrete syntactic identifiers, but are implicitly considered as being given by “equivalence up to arity renaming”.
- There are no boundaries and thus no systematic treatment of “preservation conditions” as we formalized them by means of the commutativity condition in (16).
- In the examples, preservation conditions are expressed by means of ad-hoc equations between vertices and/or edges, respectively.
- There is no explicit notion of “derived graph operation” and the issue of “graph operation expressions” is not addressed at all.
- Derived graph operations, in our sense, appear only implicit when properties of graph operations are described by means of equations between vertices and/or edges.
Since we use parallel and sequential composition of maps to define derived graph operations, there is of course a certain overlap with monoidal categories, term graphs [20] and string diagrams [21]. However, our approach to derived graph operations deviates essentially from traditional monoidal categories and string diagrams:
- Traditional monoidal categories and string diagrams deal only with single isolated items as input and output of operations.
- This becomes manifested in the absence of boundaries.
- The essential difference is that the presence of boundaries forces us to replace “copying of items” internal in a diagram by “soldering of input and output ports”, i.e., by constructing an instance of a diagram as a whole.
It is an interesting and open question to what extend it might be useful and feasible to define categories with (equivalence classes of) graph operation expressions as morphisms. A more exotic question would be if those hypothetical categories can be characterized and axiomatized in analogy to the different kinds of monoidal categories and string diagrams.
8. Conclusions
One of the roles of terms in Universal Algebra is to represent derived operations, i.e., operations that can be build up from the basic operations in an algebra. Relying on a revised version of graph operations we defined graph operation expressions as a counterpart to terms. We identified three basic mechanisms to construct new graph operations out of given ones: parallel composition, instantiation and sequential composition. These mechanisms allowed us to construct for all graph operation expressions a corresponding derived graph operation in any graph algebra.
In another direction, we made a first step towards “Universal Graph Algebra”, i.e., we generalized some basic model-theoretic concepts and results from algebras to graph algebras. Especially, we generalized the concept generated subalgebra and proved that all monomorphic homomorphisms between graph algebras are regular.
We made an overall and essential effort to present definitions, concepts, constructions, results, and proofs in a more categorical a way that we can lift them up, once in the future, straightforwardly to the level of topoi.
Besides the missing proofs of the conjectures, there are many open ends and many things that can or should be done. Especially, an equational calculus for graph operations relying on the equality of graphs (and not of single vertices and/or edges) is very much demanded. Such a calculus is expected to provide also a basis to define an equivalence relation for graph operation expressions and, in turn, for a semantic preserving rewriting of graph operation expressions.
Author Contributions
All authors have read and agreed to the published version of the manuscript.
Funding
This research received no external funding.
Institutional Review Board Statement
Not applicable.
Data Availability Statement
Data sharing is not applicable.
Acknowledgments
We want to thank the guest editor of this special volume for encouraging us to write this paper.
Conflicts of Interest
The authors declare no conflict of interest.
References
- Wolter, U.; Diskin, Z.; König, H. Graph Operations and Free Graph Algebras. In Proceedings of the Graph Transformation, Specifications, and Nets - In Memory of Hartmut Ehrig. Springer, LNCS 1 0800, 2018, pp. 313–331. [Google Scholar] [CrossRef]
- Wolter, U. Logics of Statements in Context - Category Independent Basics. Mathematics 2022, 10. [Google Scholar] [CrossRef]
- Makkai, M. Generalized Sketches as a Framework for Completeness Theorems. Journal of Pure and Applied Algebra 1997, 115, 49–79. [Google Scholar] [CrossRef]
- Cadish, B.; Diskin, Z. Heterogeneous View Integration via Sketches and Equations. In Proceedings of the ISMIS; 1996; Vol. 1079, pp. 603–612.
- Diskin, Z. Databases as Diagram Algebras: Specifying Queries and Views Via the Graph-Based Logic of Sketches. Technical Report 9602, Latvia, 1996. [Google Scholar]
- Diskin, Z.; Kadish, B. A Graphical Yet Formalized Framework for Specifying View Systems. In Proceedings of the First East-European Symposium on Advances in Databases and Information Systems. Nevsky Dialect; 1997; pp. 123–132. [Google Scholar]
- Burroni, A. Algèbres graphiques (sur un concept de dimension dans les langages formels). Cahiers de topologie et géométrie différentielle catégoriques 1981, 22, 249–265. [Google Scholar]
- Poigné, A. , Guildford, U.K. September 16–20, 1985 Proceedings; Pitt, D.; Abramsky, S.; Poigné, A.; Rydeheard, D., Eds.; Springer Berlin Heidelberg: Berlin, Heidelberg, 1986; pp. 76–102. https://doi.org/10.1007/3-540-17162-2_118.categorically. In Category Theory and Computer Programming: Tutorial and Workshop, Guildford, U.K. September 16–20, 1985 Proceedings; Pitt, D., Abramsky, S., Poigné, A., Rydeheard, D., Eds.; Springer Berlin Heidelberg: Berlin, Heidelberg, 1986; Springer Berlin Heidelberg: Berlin, Heidelberg, 1986; pp. 76–102. [Google Scholar] [CrossRef]
- Ehrig, H.; Ehrig, K.; Prange, U.; Taentzer, G. Fundamentals of Algebraic Graph Transformation; Monographs in Theoretical Computer Science. An EATCS Series, Springer, 2006.
- Barr, M.; Wells, C. Category Theory for Computing Science; Series in Computer Science; Prentice Hall International: London, 1990. [Google Scholar]
- Pierce, B.C. Basic Category Theory for Computer Scientists; The MIT Press Cambridge, Massachusetts London, England, 1991.
- Wolter, U. Cogenerated Quotient Coalgebras. Technical Report Report No 299, Department of Informatics, University of Bergen, 2005.
- Ehrig, H.; Mahr, B. Fundamentals of Algebraic Specification 1: Equations and Initial Semantics; EATCS Monographs on Theoretical Computer Science 6, Springer, 1985.
- Wolfgang Wechler. Universal Algebra for Computer Scientists. In Proceedings of the Monographs in Theoretical Computer Science. An EATCS Series. Springer-Verlag, Berlin Heidelberg, 1992, Vol. 25, p. 339. [CrossRef]
- MacLane, S. Categories for the Working Mathematician; Springer-Verlag: New York, 1971. [Google Scholar]
- Goldblatt, R. Topoi: The Categorial Analysis of Logic; Dover Publications, 1984.
- Reichel, H. Initial Computability, Algebraic Specifications, and Partial Algebras; Oxford University Press, 1987.
- Wolter, U. An Algebraic Approach to Deduction in Equational Partial Horn Theories. J. Inf. Process. Cybern. EIK 1990, 27, 85–128. [Google Scholar]
- Claßen, I.; Große-Rhode, M.; Wolter, U. Categorical concepts for parameterized partial specifications. Math. Struct. in Comp. Science 1995, 5, 153–188. [Google Scholar] [CrossRef]
- Corradini, A.; Gadducci, F. An Algebraic Presentation of Term Graphs, via GS-Monoidal Categories. Applied Categorical Structures 1999, 7, 299–331. [Google Scholar] [CrossRef]
- Selinger, P. , B., Ed.; Springer Berlin Heidelberg: Berlin, Heidelberg, 2011; pp. 289–355. https://doi.org/10.1007/978-3-642-12821-9_4.Categories. In New Structures for Physics; Coecke, B., Ed.; Springer Berlin Heidelberg: Berlin, Heidelberg, 2011; Springer Berlin Heidelberg: Berlin, Heidelberg, 2011; pp. 289–355. [Google Scholar] [CrossRef]
- Makkai, M. First Order Logic with Dependent Sorts, with Applications to Category Theory. available from Makkai’s homepage http://www.math.mcgill.ca/makkai/.
Figure 1.
Arity declaration for the operation symbol .

Figure 2.
Arity declaration for the operation symbol .

Figure 3.
Arity declaration for the operation symbol .

Figure 4.
The pushout of arities declarations for the operation symbol .

Figure 5.
The pushout of arity declarations for the operation symbol .

Figure 6.
Instances of computation diagrams.

Figure 7.
Parallel application of two composition operations on successive pairs of arrows.

Figure 8.
Parallel application of a composition operation and an identity map on arrows.

Figure 9.
Composition of two loops.

Figure 10.
Composition of a loop with itself.

Figure 11.
Sequential Composition via a graph isomorphism .

Figure 12.
Arity of the composition of four arrows.

Figure 13.
Arity of the composition of three arrows.

Figure 15.
Arity of the -expression .

Figure 16.
Arity of the -expression .

Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2023 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (http://creativecommons.org/licenses/by/4.0/).
Copyright: This open access article is published under a Creative Commons CC BY 4.0 license, which permit the free download, distribution, and reuse, provided that the author and preprint are cited in any reuse.