Custom Hypergraph Categories via Generalized Relations
Dan Marsden, Fabrizio Genovese

TL;DR
This paper introduces a flexible, parameterized framework for constructing process theoretic models using generalized relations, enabling diverse applications across quantum computation, NLP, and network theory.
Contribution
It generalizes relational models along four axes, creating a unifying, functorial approach for building process theories in various domains.
Findings
Categories are preorder-enriched with relational analogues.
Framework unifies existing models from literature.
New models suggest avenues for further research.
Abstract
Process theories combine a graphical language for compositional reasoning with an underlying categorical semantics. They have been successfully applied to fields such as quantum computation, natural language processing, linear dynamical systems and network theory. When investigating a new application, the question arises of how to identify a suitable process theoretic model. We present a conceptually motivated parameterized framework for the construction of models for process theories. Our framework generalizes the notion of binary relation along four axes of variation, the truth values, a choice of algebraic structure, the ambient mathematical universe and the choice of proof relevance or provability. The resulting categories are preorder-enriched and provide analogues of relational converse and taking graphs of maps. Our constructions are functorial in the parameter choices,…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Custom Hypergraph Categories via Generalized Relations
Dan Marsden and Fabrizio Genovese
Department of Computer Science, University of Oxford
Abstract
Process theories combine a graphical language for compositional reasoning with an underlying categorical semantics. They have been successfully applied to fields such as quantum computation, natural language processing, linear dynamical systems and network theory. When investigating a new application, the question arises of how to identify a suitable process theoretic model.
We present a conceptually motivated parameterized framework for the construction of models for process theories. Our framework generalizes the notion of binary relation along four axes of variation, the truth values, a choice of algebraic structure, the ambient mathematical universe and the choice of proof relevance or provability. The resulting categories are preorder-enriched and provide analogues of relational converse and taking graphs of maps. Our constructions are functorial in the parameter choices, establishing mathematical connections between different application domains. We illustrate our techniques by constructing many existing models from the literature, and new models that open up ground for further development.
I Introduction
The term “process theory” has recently been introduced [1] to describe compositional theories of abstract processes. These process theories typically consist of a graphical language for reasoning about composite systems, and a categorical semantics tailored to the application domain. This compositional perspective has been incredibly successful in reasoning about questions in quantum computation and quantum foundations. The scope of the process theoretic perspective encompasses many other application domains, including natural language processing [2], signal flow graphs [3], control theory [4], Markov processes [5], electrical circuits [6] and even linear algebra [7].
When considering a new application of the process theoretic approach, the question arises of how to find a suitable categorical setting capturing the phenomena of interest. Dagger compact closed categories are of particular importance as they have an elegant graphical calculus, and many of the examples cited above live in compact closed categories.
We illustrate the process of constructing new dagger compact closed categories with two examples in the theory of human cognition, as developed in [8, 9]. This is an unconventional application area, and therefore highlights clearly the challenges faced when trying to model a new problem domain in a process theoretic manner.
As our first example, we consider how the notion of convexity can be incorporated into a compact closed setting. Convexity is important in mathematical models of cognition, where it is argued that the meaningful concepts should be closed under forming mixtures. Informally, if we have a space representing animals, then if two points describe dogs, we would expect any points “in between” should also be models of the concept of being a dog.
An algebraic model of convexity is given by the Eilenberg-Moore algebras of the finite distribution monad. These algebras, referred to as convex algebras, are sets equipped with a well behaved operation for forming convex mixtures of elements. Informally, we denote such a convex mixture as
[TABLE]
where the are positive reals summing to one, and the are elements of the algebra. This notation is not intended to imply there are independent addition and scaling operations that can be applied to the individual elements.
The Eilenberg-Moore category of any monad on , or in fact any regular category, is itself a regular category. Therefore the category of convex algebras is regular and we can form its category of relations, denoted . It is well known that the category of relations over a regular category is a dagger compact closed category [10]. Concretely, a convex relation is an ordinary binary relation which is closed under forming convex mixtures, in the sense that implications of the following form hold
[TABLE]
A state of an object in a monoidal category is a morphism of type where is the monoidal unit. The states in are the convex subsets, as we may have hoped. This model was used as the mathematical basis for a compositional model of cognition [11].
As our second example, we return to the mathematics of cognition. It is natural to think about notions of nearness and distance for models of reasoning, a wolf is nearly a dog, a squirrel is closer to being a rat than an elephant. We would therefore like to capture metrics within our model. We now consider how to introduce metrics into a compact closed setting. The construction used in the previous example is not applicable as the various natural categories of metric spaces are not regular. Therefore, we will require a new approach, which will entail a small detour. We begin by introducing the notion of a quantale.
Definition I.1** (Quantale).**
A quantale is a join complete partial order with a monoid structure satisfying the following distributivity axioms, for all and
[TABLE]
A quantale is said to be commutative if its monoid structure is commutative.
Example I.2**.**
Every locale [12] is a commutative quantale, and in particular any complete chain is a commutative quantale with
[TABLE]
- •
The Boolean quantale is given by the chain with its usual ordering
- •
The interval quantale is given by the chain with its usual ordering
- •
The quantale is given by the chain of extended positive reals with the reverse ordering
An important example of a commutative quantale that does not correspond to a locale is the Lawvere quantale with underlying set the extended positive reals with reverse order and algebraic structure
[TABLE]
A binary relation between two sets and can be described by its characteristic function
[TABLE]
where is the two element set of Boolean truth values. We can generalize the notion of binary relation by allowing the truth values to be taken in a suitable choice of quantale , as a function of the form
[TABLE]
We can see this as a potentially infinite matrix of truth values. These binary relations form a category , with identities and composition given by suitable generalizations of their matrix theoretic analogues. If the quantale of truth values is commutative, is in fact dagger compact closed. So we have found another dagger compact closed category, but what has this got to do with metrics? In order to establish the required connection, we note that we can order relations pointwise in the quantale order, as follows:
[TABLE]
This order structure makes into a poset-enriched symmetric monoidal category. This means we can consider internal monads, in the sense of formal category theory [13]. These identify important “structured objects” within our categories as follows.
- •
The internal monads of are endo-relations such that
[TABLE]
That is, they are preorders.
- •
The internal monads of are endo-relations where
[TABLE]
We can see these as a fuzzy generalization of the notion of a preorder.
- •
The key example is the internal monads of . These are endo-relations satisfying
[TABLE]
If we read the relation as a distance function, we see that they are generalized metric spaces [14].
- •
The internal monads of are endo-relations satisfying
[TABLE]
Again, if we regard as a distance function, these can be seen to be generalized ultrametric spaces.
So in particular, gives us a partial order enriched dagger compact closed category in which the internal monads are generalized metric spaces. Such categories of relations have been proposed as a unifying categorical setting for investigating various topological notions, see [15, 16]. Multi-valued relations have also been investigated for compositional models of natural language [17].
To recap, we have constructed two compact closed categories using differing techniques that can be found in the literature:
- •
By exploiting relations respecting algebraic structure, standard monad and regular category theory provided us with a category where the states are exactly convex subsets.
- •
Generalizing the notion of relations in a different direction, we produced a category where the internal monads are generalized metric spaces.
So, using rather ad-hoc methods, we have solved two modelling problems using generalizations of binary relations. This prompts several questions:
- •
How do these constructions relate to each other? In particular, can we simultaneously work with convexity and metrics in an appropriate setting?
- •
Can they be seen as instances of a general construction?
- •
Does the notion of binary relation permit further axes of variation, producing additional examples of compact closed categories?
- •
As the parameters of our constructions vary, can the resulting categories be related? Formally, this is a question of functoriality in a suitable sense.
These questions provide the starting point for our investigations. We also observe that the categories we identified in our examples are both in fact instances of Fong and Kissinger’s hypergraph categories [18]. These are a particularly well behaved class of dagger compact closed categories, and this will be our technical setting for the remainder of the paper.
We summarize our contributions as follows
- •
We provide parameterized constructions of hypergraph categories of generalized relations and spans in theorems III.7, IV.3 and IV.8.
- •
We introduce analogues of the notion of converse of a generalized relation, and taking the graph of an underlying morphism. Many further aspects are shown to commute with this important structure.
- •
In section V the resulting categories are shown to be appropriately order enriched.
- •
In section VI we show that generalized spans can be functorially mapped to generalized relations in a manner respecting all the important structure.
- •
In section VII we show that homomorphisms of truth values functorially induce functors between models, preserving all the important structure.
- •
In section VIII we show that our constructions are functorial in the choices of algebraic structure. We also describe how the algebraic and truth value structures interact, providing connections with notions resource sensitivity in the sense of linear logic.
- •
In section IX we show that our constructions are also functorial in the choice of ambient topos, with the quantale structure being transferred along a logical functor.
- •
In theorem X.1 we show that the functors induced by changes of parameters commute with each other.
- •
Our methods give explicit concrete descriptions of the mathematical objects of interest, suitable for use in applications.
- •
We provide many examples illustrating the flexibility of our techniques, particularly to the construction of new and existing models of natural language processing and cognition applications.
Related Work
Categories of relations have been studied in the form of allegories [19]. This work is somewhat removed from our approach, the heavy use of the modular law does not directly yield the graphical phenomena of interest. Of more direct relevance is the concept of cartesian bicategory of [20]. Although graphical notation is not used directly in this work, these categories can be seen as close relatives of the hypergraph categories resulting from our constructions. The emphasis in the study of cartesian bicategories was characterization rather than construction of models.
A somewhat syntactic approach to constructing categories with graphical calculi is the use of PROPs [21, 22]. They have recently been used to construct various categorical models relating to control theory [3, 23, 24]. These methods begin with syntax and equations, and freely derive a resulting category. This style is most effective when the application under consideration has well understood calculational properties. Our approach instead emphasizes the direct construction of models which can then be investigated for their suitability to a given application.
The beautiful work on decorated cospans and correlations of [25, 18], motivated by the program of network theory initiated in [26], is of most direct relevance to our approach. In a precise sense, the decorated corelation construction is completely generic, every hypergraph category is produced by that construction. Our emphasis is different, we do not aim for maximum generality. Instead, our aim is conceptually motivated parameterization. By providing four clearly motivated features that can be adjusted to application needs, we aim for a practical construction with which investigators using process theories can construct new models with desirable features.
II Mathematical Background
We will be interested in particular types of symmetric monoidal categories, and will make use of their corresponding graphical languages [27]. Technical background on monoidal categories and general categorical notions can be found in [28]. We will also refer to toposes and their internal languages in places, standard references are [29, 30, 31, 32]. The paper has been written with the intention that it should be readable without any detailed knowledge of topos theory. For such readers, definitions should be read as if they pertain to ordinary sets, functions and predicate logic. In this section we briefly describe some standard mathematical background and conventions.
Definition II.1** (Compact Closed Category).**
An object in a symmetric monoidal category is said to have dual if there exist unit and counit morphisms. These morphisms are depicted in the graphical calculus using special notation as
[TABLE]
They are required to satisfy the following snake equations.
[TABLE]
A compact closed category is a symmetric monoidal category in which every object has a dual. A compact closed category , equipped with an identity on objects involution coherently with the symmetric monoidal compact closed structure, is referred to as a dagger compact closed category [33]. The older term strongly compact closed category is also occasionally used.
Example II.2**.**
The canonical example of a dagger compact closed category of relevance to the current work is the category of sets and binary relations between them. The symmetric monoidal structure is given by cartesian products of sets, and the dagger by the usual converse of relations. Objects are self-dual, with the unit on a set given by the relation
[TABLE]
and the counit is its converse.
Definition II.3** (Hypergraph Category).**
A hypergraph category is a symmetric monoidal category such that every object carries a commutative monoid structure
[TABLE]
and a cocommutative comonoid structure
[TABLE]
We depict these morphisms graphically as follows:
[TABLE]
The choice of monoid structure on each object is required to satisfy the following coherence condition with respect to the monoidal structure.
[TABLE]
Here, we overload the use of the symbol to avoid cluttering our diagrams with indices or subscripts. We will exploit similar overloading of names in many places in what follows. The monoid structure is also required to satisfy the dual coherence condition. The multiplication and comultiplication must also satisfy the Frobenius axiom
[TABLE]
and the special axiom
[TABLE]
More briefly, a hypergraph category is a symmetric monoidal category with a chosen special commutative Frobenius algebra structure on every object, coherent with the tensor product.
Example II.4**.**
The category is also an example of a hypergraph category. The cocommutative comonoid is given by the relations
[TABLE]
The monoid is the relational converse of the comonoid structure. The induced dagger compact closed structure is exactly that of example II.2.
Our interest in hypergraph categories is that they are a particularly pleasant form of dagger compact closed category, as established by the following well known observation.
Proposition II.5**.**
Every hypergraph category is a dagger compact closed category, with the cup and cap given by
[TABLE]
The dagger of a morphism is given by its transpose
[TABLE]
As a final technical point, we will be working with various categories with finite products. Throughout, we will implicitly assume a choice of terminal object and binary products has been given. To reduce clutter, we therefore resist repeating this assumption in the statements of our subsequent theorems.
III Relations
The aim in this section is to broadly generalize the notion of binary relation between sets, in order to support our motivating examples, and to provide scope for many other variations. We observed, for sets and , and quantale , that we can consider a function as a relation, with truth values taken in the quantale. For such generalized relations, we define the composition of relations and by analogy with the usual composition of relations
[TABLE]
With this notion of composition, the following relation, with truth values in , serves as an identity on set :
[TABLE]
We then observe that all of these definitions actually make sense in the internal language of an arbitrary elementary topos. This leads us to the following definition.
Definition III.1** (-relation).**
Let be a topos, and an internal quantale. A -relation between objects and is a -morphism of type
[TABLE]
-objects and -relations between them form a category , with identities and composition as described above.
Definition III.1 is a first step in the right direction, but in order to capture convexity, as discussed in the introduction, we must find a way of incorporating algebraic structure. If we consider an algebraic signature with set of operations and equations , the general form of equation (1), for -ary operation , is
[TABLE]
We will require throughout that all operation symbols have finite arity, as is conventional in universal algebra.
It is then natural to consider replacing the logical components of this definition with the structure of our chosen quantale. This leads to the definition we require.
Definition III.2** (Algebraic -relation).**
Let be a topos, and an internal quantale. Let be an algebraic variety in . An algebraic -relation between -algebras and is a -relation between their underlying -objects such that for each the following axiom holds
[TABLE]
-algebras and algebraic -relations form a category , with identities and composition as for their underlying -relations.
There is some subtlety to the interaction between truth values and algebraic structure, we will return to this topic in section VIII. We now continue studying the categorical structure of algebraic -relations.
Proposition III.3**.**
Let be a topos, a variety in , and an internal commutative quantale. The category is a symmetric monoidal category. The symmetric monoidal structure is inherited from the finite products in .
We can take the converse of an ordinary binary relation, simply by reversing its arguments. The notion of converse generalizes smoothly to algebraic -relations, in a manner that respects all the relevant categorical structure.
Proposition III.4**.**
*[Converse]
Let be a topos, a variety in , and an internal commutative quantale. There is an identity on objects strict symmetric monoidal functor*
[TABLE]
given by reversing arguments:
[TABLE]
For ordinary sets and functions, given a function
[TABLE]
we can form a binary relation using the graph of
[TABLE]
The next proposition establishes that we can take graphs of morphisms in our underlying category of algebras, in a manner respecting all the relevant categorical structure.
Proposition III.5**.**
[Graph] Let be a topos, a variety in , and an internal commutative quantale. There is an identity on objects strict symmetric monoidal functor
[TABLE]
defined on morphism by
[TABLE]
The symmetric monoidal structure on is the finite product structure.
The graph functor allows us to lift structures from the underlying category of algebras. The following canonical comonoids are of particular conceptual importance.
Proposition III.6**.**
Let be a category with finite products. Each object carries a cocommutative comonoid structure via the canonical morphisms
[TABLE]
These morphisms satisfy the coherence condition (II.3).
Finally, we are in a position to establish that our categories of algebraic -relations are hypergraph categories.
Theorem III.7**.**
Let be a topos, a variety in , and an internal commutative quantale. The category is a hypergraph category. The cocommutative comonoid structure is given by the graphs of the canonical comonoids described in proposition III.6, and the monoid structure is given by their converses.
We quickly return to one of the examples discussed in the introduction.
Example III.8**.**
The convex algebras discussed in the introduction can be presented by a family of binary operations for forming pairwise convex combinations
[TABLE]
satisfying suitable equations. Writing for this signature, we can construct as , where is the two element set.
IV Spans
Generalizing the truth values, algebraic structure and ambient category has provided three degrees of freedom for describing custom hypergraph categories. Currently we can vary the underlying topos, quantale and choice of algebraic structure. We now investigate a fourth, final direction of variation.
If we consider a span of sets
[TABLE]
we can consider an element as a proof witness relating and . Two spans are composed by forming the pullback
[TABLE]
Recall that pullbacks in are given explicitly by
[TABLE]
Therefore, a pair relates and exactly if relates to some and this is related to by . So, at least for the category , we can think of spans as proof relevant relations. This is the intuition we now pursue, starting by adjusting the notion of -relation in definition III.1 to the setting of spans.
Definition IV.1** (-span).**
Let be a finitely complete category, and an internal monoid. A -span of type is a quadruple where
- •
is a span in
- •
is a -morphism, referred to as the characteristic morphism.
Two -spans are composed by composing their underlying spans by pullback, and taking the resulting characteristic morphism to be
[TABLE]
where and are the pullback projections.
A morphism of -spans between two -spans of type
[TABLE]
is a -morphism such that
[TABLE]
Remark IV.2*.*
When discussing -spans in the remainder of this paper, we actually intend isomorphism classes of spans with respect to the homomorphisms of definition IV.1. This convention is common when considering categories of ordinary spans, where composition of spans via pullback is only defined up to isomorphism. All definitions and calculations using representatives will respect this isomorphism structure. These isomorphism classes of -spans form a category . If we write for the constant morphism
[TABLE]
then the identity at is given by the -span .
These spans with configurable truth values provide another construction of hypergraph categories.
Theorem IV.3**.**
Let be a finitely complete category, and an internal commutative monoid. The category is a hypergraph category.
We will not dwell on the explicit symmetric monoidal and hypergraph structures claimed in theorem IV.3. Once we have incorporated algebraic structure into our span constructions, the required details can be found in proposition IV.5 and theorem IV.8.
The key step now is incorporate algebraic structure into the picture, paralleling the ideas of definition III.2. In this case, things are slightly more complicated as we have to explicitly administer the proof witnesses in the spans. We also must introduce an ordering on our truth values in order to specify the necessary axiom.
Definition IV.4**.**
Let be a topos, a variety in , and an internal partially ordered commutative monoid. For -algebras and , an algebraic -span is a quadruple which is a -span between the underlying -objects satisfying the following axiom.
For every if
[TABLE]
then there exists such that
[TABLE]
and
[TABLE]
-algebras and algebraic -spans form a category with identities and composition given as for the underlying -spans.
As with the algebraic -relations in section III, we obtain a symmetric monoidal category with analogues of relational converse and taking graphs.
Proposition IV.5**.**
Let be a topos, a variety in , and an internal partially ordered commutative monoid. The category is a symmetric monoidal category. The symmetric monoidal structure is inherited from the finite product structure in .
Proposition IV.6**.**
*[Converse]
Let be a topos, a variety in , and an internal partially ordered commutative monoid. There is an identity on objects strict symmetric monoidal functor*
[TABLE]
given by reversing the legs of the underlying span:
[TABLE]
Proposition IV.7**.**
[Graph] Let be a topos, and an internal partially ordered commutative monoid. There is an identity on objects strict symmetric monoidal functor
[TABLE]
with the action on morphism given by
[TABLE]
As before, we can exploit the graph construction and the canonical comonoids of proposition III.6 to establish the existence of a hypergraph structure.
Theorem IV.8**.**
Let be a topos, a variety in , and an internal partially ordered commutative monoid. The category is a hypergraph category. The cocommutative comonoid structure is given by the graphs of the canonical comonoids described in proposition III.6, and the monoid structure is given by their converses.
This construction presents new modelling possibilities, that can be combined with other features, opening fresh directions for investigation that may not have been immediately apparent.
Example IV.9**.**
The span construction allows us to construct variations on the models we are already interested in. For example, we can now construct a proof relevant version of the model III.8. From a practical perspective, this presents the possibility of models in which we can describe the interaction of cognitive phenomena, and provide quantitative evidence for any relationships that we conclude hold.
Example IV.10**.**
Instead of using as our base topos in our models, we could consider using a presheaf topos for a small category . This allows us to construct models using “sets varying with context”, incorporating all the features discussed in the previous examples. In linguistic or cognitive examples, contexts could describe time, the agents involved or the broader setting in which meaning should be interpreted. These context sensitive models present a lot of new expressive potential, and will be investigated in future work.
V Order Enrichment
In order to meaningfully discuss internal monads, we require some 2-categorical structure on our relational constructions. Specifically, we introduce an appropriate ordering on our morphisms. Order enrichment is also important from a practical perspective when modelling real world applications. For example, in natural language applications, we are often interested in phenomena such as ambiguity [34, 35] and lexical entailment [36], and these are best studied from an order theoretic perspective.
Generalizing the situation for ordinary set theoretic binary relations, we introduce an ordering on -relations.
Definition V.1**.**
Let be a topos and an internal quantale. We define a partial order on -relations as follows
[TABLE]
Algebraic -relations are ordered similarly, by comparing their underlying -relations.
Theorem V.2**.**
Let be a topos, a variety in , and an internal commutative quantale. The category is a partially ordered symmetric monoidal category.
-spans can also be ordered, in a manner analogous to that for relations, but explicitly taking into account the proof witnesses.
Definition V.3**.**
For topos and internal partially ordered monoid , we define a preorder on -spans as follow.
[TABLE]
if there is a -monomorphism such that
[TABLE]
Algebraic -spans are ordered similarly, by comparing their underlying -spans.
Theorem V.4**.**
Let be a topos, a variety in , and an internal partially ordered commutative monoid. The category is a preordered symmetric monoidal category.
The orders are respected by the important converse operation
Proposition V.5**.**
Let be a topos, and a variety in . Converses respect order structure, in that
- •
If is an internal quantale, the converse functor of proposition III.4 is a partially ordered functor
- •
If is an internal partially order monoid, the converse functor of proposition IV.6 is a preordered functor
The order enrichment of -relations and -spans is crucial for us to be able to consider the internal monads central to the second example of the introduction.
Example V.6**.**
The model incorporating metric spaces as internal monads, as discussed in the introduction, can be constructed with base topos , the empty algebraic signature and using the Lawvere quantale as the choice of truth values.
Now we have both algebraic and order structure available to us within the same construction, we can consider combining the features we are interested in, by making appropriate choices for the parameters used in the construction.
Example V.7**.**
We now see that we can combine both the convex and metric features in a single model. With underlying topos , we take our algebraic structure as in example III.8 and our quantale as in example V.6. In this case we find the internal monads are distance measures satisfying
[TABLE]
These are generalized metric spaces that respect convex structure. The usual metric on is an example of such a metric.
VI From Spans to Relations
We now begin our study of the relationship between the different parameter choices we can take. We start with the simplest case, the binary choice between proof relevance and provability.
The next theorem shows that the orders on relations and spans are compatible, in the sense that we can collapse spans to relations using the join of a quantale to choose optimal truth values, and this mapping is functorial and respects the order structure.
Theorem VI.1**.**
Let be a topos, a variety in and an internal commutative quantale. There is an identity on objects, strict symmetric monoidal -functor
[TABLE]
As we would expect, this extensional collapse of proof witnesses interacts well with the graph and converse operations, and therefore preserves our chosen hypergraph structure on the nose.
Proposition VI.2**.**
With the same assumptions, the functor of theorem VI.1 commutes with graphs and converses. That is, the following diagrams commute:
[TABLE]
[TABLE]
VII Changing Truth Values
We would expect that homomorphisms between our structures of truth values lead to functorial relationships between models. This all goes through very smoothly, as we now elaborate.
Firstly, for algebraic -relations, it is natural to consider internal quantale homomorphisms.
Theorem VII.1**.**
Let be a topos, a variety in , and a morphism of internal commutative quantales. There is an identity on objects, strict symmetric monoidal -functor
[TABLE]
The assignment is functorial.
As with the extensional collapse functor of section VI, the induced functor respects graphs and converses, and therefore preserves the hypergraph structure on the nose.
Proposition VII.2**.**
With the same assumptions, the functor of theorem VII.1 commutes with graphs and converses. That is, the following diagrams commute:
[TABLE]
[TABLE]
In the case of the span constructions, morphisms of partially ordered monoids are the appropriate notion of homomorphism to consider.
Theorem VII.3**.**
Let be a topos, a variety in , and a morphism of internal partially ordered commutative monoids. There is an identity on objects, strict symmetric monoidal -functor
[TABLE]
The assignment is functorial.
Again, the induced functor commutes with graphs and converses.
Proposition VII.4**.**
With the same assumptions, the functor of theorem VII.3 commutes with graphs and converses. That is, the following diagrams commute:
[TABLE]
[TABLE]
Example VII.5**.**
For any commutative quantale there is a partially ordered monoid morphism , induced by the monoid unit. Here, is the terminal quantale. Therefore there is a strict symmetric monoidal functor
[TABLE]
This example motivates our use of partially ordered monoids, rather than simply restricting to the quantales of interest in our primary applications, as the required morphism is not a quantale morphism.
Example VII.6**.**
There is a quantale morphism from the Boolean to the Lawvere quantale. The induced functor identifies the ordinary binary relations as living within the category that we introduced to capture metric spaces as internal monads.
VIII Algebraic Structure
We now investigate the interaction between truth values and algebraic structure. Again, this will lead to functorial relationships between models, but the subject is more delicate than in the previous sections. The essential detail is that inequation (III.2) is only required to hold for the operations in our signature. It does not directly say anything about derived terms and operations. We will require several definitions in order to make the situation precise.
Definition VIII.1**.**
Let be an algebraic signature. We say that a term over a finite set of variables is
- •
Linear if it uses each variable is used exactly once
- •
Affine if it uses each variable at most once
- •
Relevant if it uses each variable at least once
- •
Cartesian to emphasize that its use of variables is unrestricted
We use the same terminology for the derived operation associated to .
Definition VIII.2** (Interpretation).**
An interpretation of signature in signature is a mapping assigning each to a derived term of of the same arity, such that the equations can be proved in equational logic from . We say that an interpretation is linear (affine, relevant, cartesian) if all the derived terms used in the interpretation are linear (affine, relevant, cartesian). We write (, , ) for the corresponding categories with objects signatures and morphisms linear (affine, relevant, cartesian) interpretations.
Definition VIII.3**.**
Let be a topos, and an internal partially ordered monoid. We say that is
- •
Linear to emphasize that no additional axioms are assumed to hold
- •
Affine if the axiom
[TABLE]
is valid
- •
Relevant if the axiom
[TABLE]
is valid
- •
Cartesian if it is both affine and relevant
We note the following important special case.
Example VIII.4**.**
A cartesian commutative quantale is a locale.
So in the case where our truth values have a genuine locale structure, everything becomes very well behaved.
Definition VIII.5**.**
Let be a topos, and an internal commutative quantale. We say that a -relation is
- •
Linear to emphasize that no additional axioms are assumed to hold
- •
Affine if the axiom
[TABLE]
is valid
- •
Relevant if the axiom
[TABLE]
is valid
- •
Cartesian if it is both affine and relevant
We write , , and for the corresponding subcategories of algebraic Q-relations.
Our terminology is derived from that sometimes used for variants of linear logic. If we view truth values as resources, the question is when can these resources be “copied” or “deleted”. We have adopted a naming convention that is slightly redundant, for example is the same thing as . We permit this redundancy in order to allow uniform statements of the subsequent theorems. We begin with important closure properties of our various classes of morphisms.
Proposition VIII.6**.**
The subcategories of linear (affine, relevant, cartesian) algebraic -relations are closed under tensors, converses and the functors induced by quantale homomorphisms. Also, the algebraic -relations in the image of the graph functor are all cartesian.
A straightforward corollary of the closure properties of proposition VIII.6 is
Theorem VIII.7**.**
For a topos , variety in and internal commutative quantale , the categories , , and are sub-hypergraph categories of .
Our restricted classes of relations respect the corresponding classes of terms.
Proposition VIII.8**.**
Let be a topos, a variety in and an internal commutative quantale. For linear (affine, relevant, cartesian) algebraic -relation the axiom
[TABLE]
holds for every linear (affine, relevant, cartesian) -ary derived operation .
The next proposition is straightforward, it establishes that once our truth values are sufficiently nice, all our relations inherit the same property.
Proposition VIII.9**.**
Let be a topos, a variety in and an internal commutative quantale. If is linear (affine, relevant, cartesian), every morphism in is linear (affine, relevant, cartesian).
In particular, if our quantale is in fact a locale, proposition VIII.9 tells us that everything becomes as straightforward as we might hope.
Finally, we can establish a contravariant functorial relationship between interpretations and functors between models.
Theorem VIII.10**.**
Let be a topos and an internal commutative quantale. Let be a linear interpretation of signatures. There is a strict monoidal functor
[TABLE]
The assignment extends to a contravariant functor.
Similar results hold for affine, relevant and cartesian interpretations and relations.
As usual, the induced functors respect the essential graph and converse structure.
Proposition VIII.11**.**
With the same assumptions, the induced functor of theorem VIII.10 commutes with graphs and converses. That is, the following diagrams commute:
[TABLE]
[TABLE]
The bottom functor in these diagrams is the obvious induced functor between categories of algebras. Similar diagrams commute for affine, relevant and cartesian interpretations and relations.
We now introduce similar definitions for the setting of spans, in order to proceed with a similar analysis.
Definition VIII.12**.**
Let be a topos, and an internal partially ordered monoid. We say that a -span is
- •
Linear to emphasize that no additional axioms are assumed to hold
- •
Affine if the axiom is valid
- •
Relevant if the axiom is valid
- •
Cartesian if it is both affine and relevant
We write , , and for the corresponding subcategories of algebraic Q-spans.
Spans with sufficient structure respect the corresponding types of terms.
Proposition VIII.13**.**
Let be a topos, a variety in , and an internal partially ordered commutative monoid. For -algebras and , and linear (affine, relevant, cartesian) algebraic -span and -ary linear (affine, relevant, cartesian) term if
[TABLE]
then there exists such that
[TABLE]
and
[TABLE]
Again, we have good closure of our various classes of morphisms.
Proposition VIII.14**.**
The subcategories of linear (affine, relevant, cartesian) algebraic -spans are closed under tensors, converses and the functors induced by quantale homomorphisms. Also, the algebraic -spans in the image of the graph functor are all cartesian.
As with relations, the closure properties of proposition VIII.14 yield a straightforward corollary about our subcategories of algebraic -spans.
Theorem VIII.15**.**
For a topos , variety in and internal partially ordered monoid , the categories , , and are sub-hypergraph categories of .
As with relations, algebraic -spans inherit good properties from their underlying quantale.
Proposition VIII.16**.**
Let be a topos, a variety in and an internal partially ordered monoid. If is linear (affine, relevant, cartesian), every morphism in is linear (affine, relevant, cartesian).
Again, we can now establish a contravariant functorial relationship between interpretations and functors between models.
Theorem VIII.17**.**
Let be a topos and an internal partially ordered commutative monoid. Let be a linear interpretation of signatures. There is a strict monoidal functor
[TABLE]
The assignment extends to a contravariant functor.
Similar results hold for affine, relevant and cartesian interpretations and spans.
The induced functors respect the usual essential structure.
Proposition VIII.18**.**
For the same assumptions, the induced functor of theorem VIII.17 commutes with graphs and converses. That is, the following diagrams commute
[TABLE]
[TABLE]
The bottom functor in these diagrams is the obvious induced functor between categories of algebras. Similar diagrams commute for affine, relevant and cartesian interpretations and relations.
The extensional collapse functor of section VI also respects our different classes of spans and relations.
Proposition VIII.19**.**
Let be a topos, a variety in and an internal commutative quantale. The functor of theorem VI.1 maps linear (affine, relevant, cartesian) algebraic -spans to linear (affine, relevant, cartesian) algebraic -relations.
We briefly discuss some examples.
Example VIII.20**.**
Let denote the signature with no operations or equations. For any signature there is a trivial linear interpretation . We therefore have, for every choice of internal quantale , strict symmetric monoidal forgetful functors
[TABLE]
Example VIII.21**.**
We can present real vector spaces by a signature with a constant element representing the origin, and a family of binary mixing operations, indexed by the scalars involved, satisfying suitable equations. We denote this signature as . There is an interpretation in of type . For any commutative quantale , this interpretation induces a functor
[TABLE]
So, as we would expect, we can find the vector spaces in the convex algebras, in a manner respecting all the relevant categorical structure.
Example VIII.22**.**
An affine join semilattice is a set with an associative, commutative, idempotent binary operation. From an information theoretic perspective, we think of convex algebras as describing probabilistic ambiguity. Affine join semilattices can then be thought of as modelling unquantified ambiguity. If we denote the signature for affine join semilattices as there is an interpretation in of type inducing a functor
[TABLE]
relating these two different models of epistemic phenomena. This exhibits another interesting subcategory of .
IX Changing Topos
We now explore the last axis of variation, the topos structure. We would expect that, if and are elementary toposes, given a suitable functor it would be possible to lift it to a functor between their respective relation and span constructions. Since the definitions of these categories make wide use of the internal language, it should not be surprising that by “suitable” we actually mean that behaves well with respect to the logical properties of .
Definition IX.1**.**
Given toposes , a functor is called logical if:
- •
preserves products
- •
preserves exponentials
- •
preserves the subobject classifier.
Logical functors are the right functors to consider, since they preserve the validity of internal formulas: If in , then in for every formula written in the language of first order intuitionistic logic.
To make the following results more readable, we will have to slightly refine our notation, writing and to explicitly indicate that the constructions are performed on topos . If is a logical functor and is an internal quantale in , then the fact that preserves models of first order intuitionistic theories implies that is an internal quantale in . It makes sense, then, to consider how and are related. The main result of the section is the following:
Theorem IX.2**.**
Let be toposes, and be a logical functor. Let be an internal commutative quantale in and be a signature. There is a symmetric monoidal functor
[TABLE]
The assignment is functorial.
As in the previous cases, graph and converse functors are preserved.
Proposition IX.3**.**
With the same assumptions, the induced functor of theorem IX.2 commutes with graphs and converses. That is, the following diagrams commute:
[TABLE]
[TABLE]
As with relations, morphisms between toposes extend functorially to morphisms between spans.
Theorem IX.4**.**
Let be toposes, and be a logical functor. Let be an internal partially ordered commutative monoid in and be a signature. There is a symmetric monoidal functor
[TABLE]
The assignment is functorial.
The essential structure is again respected by the induced functors.
Proposition IX.5**.**
With the same assumptions, the induced functor of theorem IX.4 commutes with graphs and converses. That is, the following diagrams commute:
[TABLE]
[TABLE]
Example IX.6**.**
Given any category we can form a corresponding presheaf category, having representable functors from to as objects and natural transformations between them as morphisms. Presheaves constitute one of the most important examples of toposes, and it makes sense to ask how Theorems IX.2, IX.4 behave in these circumstances.
In general, given arbitrary categories it is difficult to say when a functor lifts to a logical functor between the corresponding presheaves. Nevertheless, the following result holds: If are groupoids (categories in which every arrow is an isomorphism), then any functor lifts to a logical functor . This is because truth values in presheaf toposes are defined in terms of sieves (subfunctors of the homset functor) and these sieves trivialize when the only arrows at our disposal are isos. This in turn trivializes the structure of truth values in the presheaf itself, that ends up to be defined pointwise from .
Theorems IX.2, IX.4 then ensure that can be lifted to the relational and span structures built on and , respectively.
Example IX.7**.**
If is a topos, and is a morphism of , then pulling back along induces a logical functor . Theorem IX.2 guarantees the existence of a functor . In particular, this means that there is always a functor , where is any slice topos of .
X Independence of the axes of variation
Finally, we establish that our various induced functors between models are independent, in that they all commute with each other.Unfortunately, the commutativity of the functors induced by interpretations between algebras, order structure and quantale morphisms with will hold only up to isomorphism. This depends intrinsicly on the definition of logical functor, that is, in turn, defined to preserve validity of formulas in the internal language only up to natural isomorphism.
Theorem X.1**.**
Let be a topos, a morphism of internal commutative quantales, a linear interpretation and a logical functor. For the induced functors of theorems VII.1, VII.3, VIII.10, VIII.17, IX.2 and IX.4, the following diagram commutes (be aware that in the hypercube below commutative squares involving only commute up to isomorphism. Other squares commute up to equality):
[TABLE]
Where the inner cube is
[TABLE]
and the outer cube is
[TABLE]
In both cases the vertical arrows are the functors of theorem VI.1. Similar diagrams commute for affine, relevant and cartesian interpretations, relations and spans.
XI Conclusion
We have developed a parameterized scheme for constructing hypergraph categories, by generalizing the notion of binary relation along four axes of variation:
- •
The ambient mathematical background via the choice of underlying category
- •
The truth values via a choice of internal quantale
- •
The choice of algebraic structure
- •
The choice between proof relevance and provability
This construction provides a conceptually motivated approach for producing models of process theories when investigating new applications. Many existing examples in the literature are covered by our approach, including examples used for linguistics, cognition, linear dynamical systems and non-deterministic computation.
We showed that the resulting categories are preorder enriched, providing more flexible modelling possibilities. It was also established that varying each of the parameters is functorial, preserving all the important hypergraph and order structure. In the case of the algebraic structure, this functoriality exhibited an interesting relationship between algebra and resource sensitivity in the sense of linear logic. Our constructions were also shown to have well behaved functorial analogues of the notions of taking the converse of a relations, and taking the graph of a map to construct a new relation.
Interestingly, our framework points to new models in which features can be combined. This was a key objective of this direction of research. For example the model incorporating both convexity and metrics of example V.7, the proof relevant models of cognition of example IV.9 and the possibility of incorporating contexts as discussed in example IV.10. The application of these constructions to models of cognition and natural language will be explored in forthcoming work.
In order to gain a strict composition operation, in section IV we used isomorphism classes of spans, and then introduced an analogue of the usual order structure for relations in section V. If we use spans, rather than their equivalence classes, they should form a symmetric monoidal bicategory, sacrificing strict composition for a richer 2-cell structure. This is of practical interest as internal monads have been important in our examples. The internal monads in categories of spans correspond to internal categories [37], which would open up further interesting possibilities. Some related work on bicategorical aspects of the decorated cospan construction appears in [38]. In fact, the resulting categories should be an appropriate bicategorical generalization of a hypergraph category. Such bicategorical aspects are left to later work.
Acknowledgments
The authors would like to thank Bob Coecke, Ignacio Funke, Kohei Kishida and Martha Lewis for feedback and discussions. This work was partially funded by the AFSOR grant “Algorithmic and Logical Aspects when Composing Meanings” and the FQXi grant “Categorical Compositional Physics”.
The reference list from the paper itself. Each links out to its DOI / PubMed record.
- 1[1] B. Coecke and A. Kissinger, Picturing Quantum Processes. A First Course in Quantum Theory and Diagrammatic Reasoning . Cambridge University Press, 2017, forthcoming.
- 2[2] B. Coecke, M. Sadrzadeh, and S. Clark, “Mathematical foundations for distributed compositional model of meaning. Lambek festschrift,” Linguistic Analysis , vol. 36, pp. 345–384, 2010.
- 3[3] F. Bonchi, P. Sobocinski, and F. Zanasi, “Full abstraction for signal flow graphs,” ACM SIGPLAN Notices , vol. 50, no. 1, pp. 515–526, 2015.
- 4[4] J. C. Baez and J. Erbele, “Categories in control,” Theory and Applications of Categories , vol. 30, no. 24, pp. 836–881, 2015.
- 5[5] J. C. Baez, B. Fong, and B. S. Pollard, “A compositional framework for Markov processes,” Journal of Mathematical Physics , vol. 57, no. 3, p. 033301, 2016.
- 6[6] J. C. Baez and B. Fong, “A compositional framework for passive linear networks,” ar Xiv preprint ar Xiv:1504.05625 , 2015.
- 7[7] P. Sobocinski, “Graphical linear algebra,” mathematical blog. [Online]. Available: https://graphicallinearalgebra.net/
- 8[8] P. Gärdenfors, Conceptual spaces: The geometry of thought . MIT press, 2004.
