1 Introduction

Convolution is an ubiquitous operation in mathematics and computing. For instance, let \((\Sigma ^*,\odot ,\varepsilon )\) be the free monoid over the finite alphabet \(\Sigma \) and \((S,+,\cdot ,0,1)\) a semiring. The convolution of \(f,g:\Sigma ^*\rightarrow S\) is defined as

$$\begin{aligned} (f*g) (x) = \sum _{x=y\odot z}f(y)\cdot g(z), \end{aligned}$$

where \(\sum \) represents finitary addition in S. The maps f and g associate a value or weight in S with any word in \(\Sigma ^*\). The weight of the convolution \(f*g\) at word x is computed by splitting x into all possible words y and z related by \(x=y\odot z\), multiplying their values f(y) and g(z) in S, and adding up the results. In fact, a finite addition suffices as only finitely many y and z satisfy \(x=y\odot z\) for any x. If \(S=2\), the semiring of booleans with \(\max \) as \(+\) and \(\min \) as \(\cdot \), then \(f:\Sigma ^*\rightarrow 2\) becomes a characteristic function for a set, \(f(x)=1\) can be read as \(x\in f\) and convolution becomes language product. The generalisation to arbitrary semirings yields languages weighted in S. It is known that convolution algebras \(S^{\Sigma ^*}\) of weighted languages form again semirings with convolution as multiplication.

We may generalise \(\Sigma ^*\) to a multisemigroup \((X,\odot )\) with multioperation \(\odot :X\times X \rightarrow {\mathcal {P}}X\) satisfying a suitable associativity law [31], or to a multimonoid with many units. We may also replace S by a quantale Q, a complete lattice with a monoidal composition and unit satisfying sup-preservation laws. Arbitrary sups in Q then compensate for the lack of finite decomposability in X. For \(f,g:X\rightarrow Q\), convolution becomes

$$\begin{aligned} (f*g)(x) = \bigvee _{x\in y\odot z}f(y)\cdot g(z), \end{aligned}$$

where \(\bigvee \) indicates a supremum and \(\cdot \) the multiplication in Q; the convolution algebra \(Q^X\) becomes a quantale [12]. For \(Q=2\) it becomes a powerset quantale, for \(X=\Sigma ^*\) the quantale of all Q-weighted languages. Further examples for this construction are the convolution quantales of binary and Q-valued binary relations [20], as well as those of boolean and Q-valued matrices. These lift from instances of multimonoids known as pair groupoids.

The relation between multimonoids, value quantales and convolution quantales, however, is not just a lifting. Multimonoids are isomorphic to relational monoids formed by ternary relations with suitable monoidal laws, where R(xyz) holds if and only if \(x\in y\odot z\). The construction of convolution algebras can therefore be seen in light of Jónsson and Tarski’s duality between boolean algebras with n-ary operators and \(n+1\)-ary relations [21, 29], and of the associated modal correspondences. Convolution can be seen as a generalised binary modality on \(Q^X\) and X as a ternary frame. So we may ask about correspondences between relations in X and equations in Q and \(Q^X\).

Such correspondence triangles between X, Q and \(Q^X\) have already been studied, and adapted to cases where Q is merely a semiring [5]. For \(Q=2\), they are known from substructural logics. They have also been extended to correspondences between concurrent relational monoids and concurrent semirings and quantales [5], where two quantalic compositions interact via a weak interchange law akin to that of higher categories [27].

Here, our main motivation is the study of correspondences between the source and target maps that arise in multimonoids and the domain and codomain maps that are present in many convolution quantales, in particular powerset quantales. On one hand, every element of a multimonoid has a unique left and a unique right unit, which gives rise to source and target maps like in categories [4], and every small category can be modelled as a partial semigroup equipped with such maps [32]. On the other hand, quantales of binary relations, for instance, have non-trivial domain and codomain structures, which has led to more abstract definitions of modal semirings and quantales [7, 8, 15]. Yet what is the precise correspondence between the source and target structure of the pair groupoid, say, and these relational domain and codomain operations? And how does it generalise to source and target maps in arbitrary multisemigroups and to domain and codomain operations in arbitrary convolution quantales?

As a first step towards answers, we introduce catoids: multisemigroups \((X,\odot )\) with source and target operations \(s,t:X\rightarrow X\) inspired by similar operations in Schweizer and Sklar’s function systems [38] and by the source and target maps of single-set categories [32]. We study the basic algebra of catoids and present a series of examples, including categories and non-categories. Most of these results have been formalised with the Isabelle/HOL proof assistant. (See https://github.com/gstruth/catoids.) It turns out that the locality laws \(s(x\odot s(y)) = s(x\odot y)\) and \(t(t(x)\odot y) = t(x\odot y)\) of catoids, which have previously been studied at the level of modal semigroups, semirings and quantales [6,7,8, 15], are equivalent to the composition pattern of categories, namely that \(x\odot y\) is defined, and hence not \(\emptyset \), if and only if \(t(x)= s(y)\) (for categories, the order of composition is usually reversed). Indeed, local catoids based on partial semigroups are (small) categories.

As a second step, we generalise the standard definitions of domain and codomain for modal semirings and quantales to convolution algebras. When relations are represented as 2-valued matrices, for instance, domain elements in \(2^X\) are diagonal matrices in which the value of each diagonal element is 1 if there is a 1 in the respective row of the matrix, and 0 otherwise. More generally, for Q-valued relations represented as Q-valued matrices, a domain element in \(Q^X\) can be seen as a diagonal matrix in which the value of each diagonal element is the domain of the supremum of the respective row values of the matrix, taken in Q.

Equipped with catoids and domain and codomain operations for \(Q^X\), we prove our main results: correspondence triangles between equational properties of source and target operations in catoids X and those of domain and codomain operations in the modal quantales Q and \(Q^X\). We develop them in full generality, but keep an eye on the \(Q=2\) instance, which has been formalised with Isabelle. From the point of view of boolean algebras with operators, this yields a multimodal setting where the quantalic composition in \(Q^X\) is a generalised binary modality associated with a ternary frame in X, whereas the domain and codomain operations in \(Q^X\) are generalised unary modalities that can be associated with binary frames in X based on \(s\) and \(t\).

These results show, in particular, how the equational axioms for modal semirings and quantales, as powerset or proper convolution algebras, originate in the much simpler catoid axioms and how the composition pattern of categories translates into the locality axioms of modal algebras. For the (forward) modal operators present in these modal algebras, locality means that the standard properties \(\langle \alpha \cdot \beta \rangle = \langle \alpha \rangle \circ \langle \beta \rangle \) and \([\alpha \cdot \beta ] = [\alpha ]\cdot [\beta ]\) hold.

More generally, the lifting from X and Q to \(Q^X\) yields a generic construction recipe for modal quantales. Any category, for instance, can be lifted like that, but we present other examples, such as generalised effect algebras or shuffle algebras, where locality laws are absent or multioperations are proper. Conversely, by our correspondences, before constructing a modal quantale one should ask what the underlying catoid might be. The benefit is that the catoid laws are much easier to check than those of modal quantales. Proof assistants can benefit particularly from such a generic construction.

The relevance of our construction is underpinned by many examples. Most of the catoids presented are categories, for instance categories of paths in digraphs or Moore paths in topology, pair groupoids, segments and intervals of posets or pomsets, simplices and cubical sets with interfaces, but some others are neither local nor partial. For all of them we get modal convolution quantales for free, and even modal convolution semirings, if the underlying catoid is finitely decomposable. This is the case for \(\Sigma ^*\) above or for Rota’s incidence algebras constructed over locally finite posets [36]. Well-known constructions from algebra, such as matrix rings, group rings, or category algebras, are closely related.

Beyond the results mentioned, we discuss the relationship between the domain and codomain operations in modal convolution quantales and the diamond and box operators defined using them. This opens the door to convolution algebras of quantitative predicate transformer semantics for programs, including probabilistic or fuzzy ones, just like in the qualitative case, using for instance the Lawvere quantale or related quantales over the unit interval as instances of Q. Yet our definitions of domain and codomain in \(Q^X\), despite being natural for correspondences, turn out to be too strict for stochastic matrices or Markov chains. We outline how more liberal definitions of domain and codomain in \(Q^X\) can be used instead, but leave details to future work.

2 Multisemigroups

Categories can be axiomatised in single-set style [32] as partial monoids with many units that satisfy a certain locality condition. Their correspondence to relational monoids, which are sets X equipped with ternary relations \(R\subseteq X\times X\times X\) with many relational units that satisfy relational associativity and unit laws, have already been studied [4]. Here we use an isomorphic representation, namely multioperations of type \(X\times X\rightarrow {\mathcal {P}}X\), which relate pairs in \(X\times X\) with a set of elements of X, including \(\emptyset \). This encompasses partial and total operations, where each such pair is related to at most one or precisely one element, respectively. Multioperations have a long history in mathematics. See [31] for a discussion, references and additional material.

Dealing with general categories requires classes in some of our examples. In the tradition of single-set categories, we tacitly extend the following definitions to classes, but do not formally distinguish them from sets. Our constructions are not likely to lead to paradoxes.

Let \(\odot :X\times X\rightarrow {\mathcal {P}}X\) be a multioperation on set X. We write \(D_{xy}\) for \(x\odot y \ne \emptyset \) to indicate that the composition \(x\odot y\) is non-empty (intuitively: defined) and extend \(\odot \) to \({\mathcal {P}}X\times {\mathcal {P}}X\rightarrow {\mathcal {P}}X\) for all \(A,B\subseteq X\) as

$$\begin{aligned} A\odot B =\bigcup \{x\odot y\mid x\in A \text { and } y\in B\}. \end{aligned}$$

We write \(x\odot B\) instead of \(\{x\}\odot B\), \(A\odot x\) instead of \(A\odot \{x\}\) and f(A) instead of \(\{f(a)\mid a\in A\}\). Note that \(A\odot \emptyset =\emptyset \odot B=\emptyset \).

A multimagma \((X,\odot )\) is a non-empty set X with a multioperation \(\odot :X\times X\rightarrow {\mathcal {P}}X\).

  • The multioperation \(\odot \) is associative if \(x\odot (y\odot z) = (x\odot y)\odot z\).

  • It is local if \(u\in x\odot y\wedge D_{yz} \Rightarrow D_{uz}\) for all \(u,x,y,z\in X\).

  • It is functional if \(x,x' \in y\odot z\) imply \(x=y\) for all \(x,x',y,z \in X\).

  • Element \(e\in X\) is a left unit if \(\exists x.\ x \in e\odot x\) and \( \forall x,y.\ x\in e\odot y \Rightarrow x=y\); it is a right unit if \(\exists x.\ x \in x\odot e\) and \(\forall x,y.\ x\in y\odot e\Rightarrow x=y\). We write E for the set of all units in X, left or right.

Functional multioperations are nothing but partial operations, where partiality is captured by mapping to \(\emptyset \).

Remark 2.1

Intuitively, locality states that if x can be composed with y and y with z, then each element in the composition of x and y can be composed with z. For partial operations this reduces to the composition pattern of categories, binary relations, paths in digraphs and many other examples, as explained below. Locality has previously been called coherence [4]. It will become clear below why we now prefer another name.

A multimagma X is unital if for every \(x\in X\) there exist \(e,e'\in E\) such that \(D_{ex}\) and \(D_{xe'}\). This definition follows that for single-set categories. Equivalently, we may require that there exists a set \(E\subseteq X\) such that, for all \(x\in X\), \(E\odot x = \{x\}\) and \(x\odot E = \{x\}\).

A multisemigroup is an associative multimagma; a multimonoid a unital multisemigroup.

These definitions imply that a multisemigroup \((X,\odot )\) is a partial semigroup if \(\odot \) is functional and a semigroup if \(\odot \) is total—and likewise for partial monoids and monoids.

Multimagmas and relatives form categories in several ways. A multimagma morphism \(f:X\rightarrow Y\) satisfies \(f(x\odot _X y) \subseteq f(x) \odot _Yf(y)\). The morphism is bounded if, in addition, \(f(x)\in u \odot _Y v\) implies that \(x \in y\odot _X z\), \(u=f(y)\) and \(v=f(z)\) for some \(y,z\in X\).

Obviously, f is a multimagma morphism if and only if \(x\in y \odot _X z\) implies \(f(x) \in f(y) \odot _Y f(z)\). This is a natural generalisation of the fact that \(x=y\odot _X z\) implies \(f(x) = f(y)\odot _Y f(z)\) and hence of \(f(x\odot _X y) = f(x)\odot _Y f(y)\), for total operations. For partial operations, it implies that the right-hand side of the inclusion is defined whenever the left-hand side is, and, in the bounded case, that the left-hand side is defined whenever the right-hand side is.

A morphism \(f:X\rightarrow Y\) of unital multimagmas needs to preserve units as well: \(f(e) \in E_Y\) holds for all \(e\in E_X\), and \(e\in E_Y\) implies that there is an \(e'\in E_X\) such that \(f(e')= e\) holds if f is bounded. Morphisms of single-set categories are of course functors. More generally, bounded morphisms are standard in modal logic as functional bisimulations or open maps.

In every multimagma, every unit e satisfies \(e\odot e=\{e\}\) and \(D_{ee}\). If \(e,e'\in E\), then \(D_{ee'}\) if and only if \(e=e'\); for if \(D_{ee'}\) holds, then \(e\odot e'=\{x\}\) for some \(x\in X\) and hence \(e=x=e'\) by the unit axioms. Units are therefore, in some sense, orthogonal idempotents.

In every multimonoid, each element has precisely one left and one right unit: if \(e,e'\in E\) both satisfy \(e\odot x = \{x\}=e'\odot x\) for some \(x\in X\), then \(\emptyset \ne e\odot x = e\odot (e'\odot x) = (e\odot e')\odot x\), which is only the case when \(e=e'\), as explained above (the argument for right units is similar). This functional correspondence allows defining source and target maps \(s,t:X\rightarrow X\) such that \(s(x) \) denotes the unique left unit and \(t(x)\) the unique right unit of x. Then \(D_{xy}\) implies \(t(x) =s(y)\) and the converse implication is equivalent to locality. These properties have been proved for relational structures [4], but hold in the corresponding multialgebras via the isomorphism.

Example 2.2

(Multimonoids). (1) Single-set categories, as in Mac Lane’s book [32, Chapter I.1], and local partial monoids are the same class, as already mentioned. The category of such categories and that of local partial monoids (with bounded or unbounded morphisms) are isomorphic. Local partial monoids are small categories. They are categories if the partial monoid is built on a class.

(2) Every monoid \((X,\cdot ,1)\), as a one-object category, is local. The digraph with vertex 1 and edge \(1{\mathop {\rightarrow }\limits ^{a}} 1\), for instance, corresponds to a partial monoid \(X=\{1,a\}\) with multiplication defined by \(11=\{1\}\) and \(1a=\{a\}=a1\). In addition we can impose \(aa=\{a\}\). Locality is trivial: composition is total and \(s(x)=1=t(x)\) for all \(x\in X\).

(3) The pair groupoid \((X\times X,\odot , Id _X)\) over any set X with

$$\begin{aligned} (w,x)\odot (y,z)= {\left\{ \begin{array}{ll} \{(w,z)\}&{} \text { if } x=y,\\ \emptyset &{}\text { otherwise} \end{array}\right. } \qquad \quad \text { and }\qquad E= Id _X, \end{aligned}$$

where \( Id _X\) is the identity relation on X, is a local partial monoid, hence a category, and in fact a groupoid as its name indicates. Source and target maps are \(s((x,y))= (x,x)\) and \(t((x,y)) = (y,y)\). This category is equivalent to a trivial category.

(4) The pair groupoid generalises from \(X\times X\) to relations \(R\subseteq X\times X\). If R is transitive, then \(\odot \) is well-defined and \((R,\odot )\) a local partial semigroup. If R is also reflexive, and hence a preorder, then \((R,\odot , Id _X)\) is a partial monoid; it is a groupoid if and only if R is symmetric. Finally, if R is a partial order, then (XR) is a poset category.

(5) The shuffle multimonoid \((\Sigma ^*,\parallel ,\{\varepsilon \})\), where \(\Sigma ^*\) is the free monoid over the (finite) alphabet \(\Sigma \) with unit \(\varepsilon \), has a composition \({\parallel }:\Sigma ^*\times \Sigma ^*\rightarrow {\mathcal {P}}\Sigma ^*\) defined, for \(a,b\in \Sigma \), \(v,w\in \Sigma ^*\), as

$$\begin{aligned} v\parallel \varepsilon = \{v\}=\varepsilon \parallel v,\qquad (av)\parallel (bw) = a (v\parallel (bw))\cup b ((av)\parallel w). \end{aligned}$$

It is not a category because \(\parallel \) is a proper multioperation. Locality is trivial because \(v\parallel w \ne \emptyset \) and \(s(v)=\varepsilon = t(v)\) for all \(v,w\in \Sigma ^*\).

(6) The monoid in (2) becomes functional and non-local when we break composition and impose \(aa=\emptyset \), because \(s(a) = t(a)\) still holds. Instead of a one-object category, it is now a plain digraph.

(7) The partial abelian monoid of heaplets \((H,\odot ,\varepsilon )\) used in separation logic is formed by the set H of partial functions between two sets. The partial operation \(\odot \) is defined as

$$\begin{aligned} f\odot g = {\left\{ \begin{array}{ll} \{f\cup g\} &{} \text { if } {{\,\mathrm{\textit{dom}}\,}}(f)\cap {{\,\mathrm{\textit{dom}}\,}}(g)=\emptyset ,\\ \emptyset &{}\text { otherwise}. \end{array}\right. } \end{aligned}$$

Its unit is the partial function \(\varepsilon \) with empty domain. Locality fails because \(s(f)=\varepsilon =t(g)\) for all \(f,g\in H\), but \(f\odot g=\emptyset \) when domains of f and g overlap. This algebra of heaplets is a non-local instance of a generalised effect algebra, used for modelling unsharp measurements in quantum mechanics: a partial abelian monoid with a single unit (which in addition is cancellative and positive) [25].

(8) In the unital multimagma \((\{a,e,e'\},\odot ,\{e,e'\})\) with composition \(x\odot x = \{x\}\), \(x\odot a = \{a\}\), \(e\odot e'= e'\odot e = a \odot e =\emptyset \) and \(a\odot e'= \{a\}\), element a has left units e, \(e'\) and right unit \(e'\). Associativity fails because \((e\odot e')\odot a\ne e\odot (e'\odot a)\). This shows that units need not be uniquely defined in multimagmas. \(\square \)

Additional examples can be found in Section 9.

3 Catoids

The correspondence between units in relational monoids and multimonoids and source/target functions motivates alternative axiomatisations of these structures and thus of single-set categories that generalise the function systems of Schweizer and Sklar [38]. Such categories can be found inMac Lane’s book [32, Chapter XII.5]. We define catoids, which are multisemigroups with such functions. An isomorphic alternative based on relational semigroups has been outlined in [4].

An st-multimagma is a structure \((X,\odot ,s,t)\) such that \((X,\odot )\) is a multimagma and the operations \(s,t:X\rightarrow X\) satisfy, for all \(x,y\in X\),

$$\begin{aligned} D_{xy} \Rightarrow t(x) =s(y),\qquad s(x)\odot x = \{x\},\qquad x\odot t(x) = \{x\}. \end{aligned}$$

We refer to the second and third of these axioms as unit or absorption axioms. Henceforth we often write xy instead of \(x\odot y\) and AB instead of \(A\odot B\).

A catoid is an associative \(st\)-multimagma. An \(st\)-multimagma is \(st\)-local if \(t(x) = s(y) \Rightarrow D_{xy}\) and hence \(D_{xy} \Leftrightarrow t(x) = s(y)\). Locality in the sense of multimonoids and \(st\)-locality coincide in catoids, so we can simply refer to locality of catoids.

Duality for \(st\)-multimagmas arises by interchanging \(s\) and \(t\) as well as the arguments of \(\odot \). The classes of \(st\)-multimagmas and catoids are closed under this transformation; locality and functionality are self-dual. The dual of any property that holds in any of these classes, obtained by making these replacements, therefore holds as well. This generalises opposition in categories.

Lemma 3.1

In any \(st\)-multimagma, the following laws hold:

  1. (1)

    the compatibility laws \(s\circ t= t\), \(t\circ s= s\) and retraction laws \(s\circ s= s\), \(t\circ t=t\),

  2. (2)

    the idempotency law \(s(x)s(x) = \{s(x)\}\),

  3. (3)

    the commutativity law \(t(x)s(y) = s(y)t(x)\),

  4. (4)

    the export laws \(s(s(x)y) = s(x)s(y)\) and \(t(xt(y)) = t(x)t(y)\),

  5. (5)

    the weak twisted laws \(s(xy) x \subseteq x s(y)\) and \(x t(yx) \subseteq t(y)x\).

All proofs have been checked with Isabelle.

Remark 3.2

We compare our axioms and derived laws with those of Schweizer and Sklar’s function systems [38] (see Appendix A for a list). The associativity axiom of multisemigroups generalises that of function systems. The compatibility laws are their Axioms (2a), the absorption axioms their Axioms (2b); the commutativity law is their Axiom (3b). The export laws are Axioms (D3) and its opposite (R3) of modal semigroups [6]. The relationship between \(st\)-algebras, function systems and modal semigroups is summarised in Remark 3.4 below.

The compatibility laws imply that \(s(x) = x\Leftrightarrow t(x) = x\) and further that \(X_s= \{x\mid s(x) = x\} = \{x\mid t(x)=x\} = X_t\). Moreover, by the retraction laws, \(X_s= s(X)\) and \(X_t= t(X)\).

Lemma 3.1 implies further laws, including \(s(x)s(y) = s(y)s(x)\) and \(t(x) t(y)=t(y) t(x)\), the idempotency law \(t(x) t(x)= \{t(x)\}\) and the orthogonality laws \(D_{s(x)s(y)} \Leftrightarrow s(x)=s(y)\), \(D_{t(x)t(y)} \Leftrightarrow t(x)=t(y)\). Every \(st\)-multimagma is unital with \(E=X_s=X_t\).

Lemma 3.3

In any catoid,

  1. (1)

    \(s(xy) \subseteq s(xs(y))\) and \(t(xy) \subseteq t(t(x)y)\) (weak locality),

  2. (2)

    \(D_{xy}\Rightarrow s(xy) = s(xs(y))\) and \( D_{xy}\Rightarrow t(xy) = t(t(x)y)\) (cond. locality),

  3. (3)

    \(s(xy)\subseteq \{s(x)\}\) and \(t(xy)\subseteq \{t(y)\}\),

  4. (4)

    \(D_{xy} \Rightarrow s(xy) = \{s(x)\}\) and \(D_{xy} \Rightarrow t(xy) = \{t(y)\}\),

  5. (5)

    \(D_{xy}\Rightarrow s(xy)x = xs(y)\) and \(D_{xy}\Rightarrow y t(xy) = t(x)y\) (cond. twisted).

The proofs have again been checked with Isabelle.

Remark 3.4

The two locality laws generalise Axioms (3a) for function systems [38]. The twisted laws generalise Axiom (3c) and law (D3c), in this order. Function semigroups without (3c) and law (D3c) axiomatise modal semigroups [6], which relate to semigroups of binary relations. Adding Axiom (3c) to both classes axiomatises domain and codomain of functions. Law (D3c) is relevant for function systems with so-called subinverses [38]. These are related to inverse semigroups and irrelevant here. In sum, catoids generalise function systems and modal semigroups beyond totality. For a discussion of related semigroups and applications see [6].

Lemma 3.5

In any local catoid, the following laws hold:

  1. (1)

    the equational locality laws \(s(xy) =s(xs(y))\) and \(t(xy) = t(t(x)y)\),

  2. (2)

    the twisted laws \(s(xy)x = xs(y)\) and \(y t(xy) = t(x)y\).

Once again, all proofs have been checked with Isabelle. Locality is in fact an equational property.

Proposition 3.6

An catoid is \(st\)-local if and only if

$$\begin{aligned} s(xs(y)) \subseteq s(xy)\qquad \text { and }\qquad t(t(x)y) \subseteq t(xy). \end{aligned}$$

Proof

Isabelle confirms that the equational locality laws imply \(st\)-locality in any \(st\)-multimagma. Equality in catoids holds by Lemma 3.5. \(\square \)

Remark 3.7

Locality and weak locality have been studied in the context of predomain, precodomain, domain and codomain operations for semirings [7]. There, predomain and precodomain operations satisfy the weak locality axioms, but not the strong ones. Relative to catoids, these variants of domain and codomain axioms are at powerset level. Our results in Sections 68 explain how they originate from locality in catoids

Remark 3.8

It seems natural to ask whether the axiom \(D_{xy}\Rightarrow t(x)=s(y)\) in the definition of \(st\)-multimagmas could be replaced, like locality, by equational axioms. Experiments with Isabelle show that adding the equational properties derived in Lemmas 3.13.5 does not suffice. We leave this question open.

The final lemma on catoids yields a more fine-grained view on definedness conditions and \(st\)-locality.

Lemma 3.9

In any \(st\)-multimagma,

  1. (1)

    \(t(x) = s(y) \Leftrightarrow D_{t(x)s(y) }\) and \(D_{xy} \Rightarrow D_{t(x)s(y)}\),

  2. (2)

    \(D_{t(x)s(y)} \Rightarrow D_{xy}\) if the \(st\)-multimagma is a local catoid.

The proofs have again been obtained by Isabelle. The correspondence between multimonoids and catoids can now be summarised.

Proposition 3.10

Every multimonoid \((X,\odot ,E)\) forms a catoid \((X,\odot ,s, t)\) in which \(s(x)\) and \(t(x)\) indicate the unique left and right units of each \(x\in X\). Conversely, every catoid \((X,\odot ,s,t)\) forms a multimonoid \((X,\odot ,E)\) in which \(E=X_s=X_t\).

This result carries over to local structures and extends to isomorphisms between categories of catooids and relational monoids with suitable morphisms. A morphism f of \(st\)-multimagmas X and Y is a multimagma morphism that satisfies \(f\circ s_X = s_Y\circ f\) and \(f\circ t_X=t_Y\circ f\).

Example 3.11

(Catoids). All structures in Example 2.2 are catoids by Proposition 3.10. We reconsider some of them.

(1) Local function catoids and the single-set categories mentioned in Mac Lane’s book [32, Chapter XII.5] are the same class. The categories of such single-set categories and local partial functional catoids (with bounded or unbounded morphisms) are isomorphic: local functional catoids are categories. We briefly recall the relationship with standard two-sorted categories based on objects and morphisms.

A (small) category consists of a set O of objects and a set M of morphisms with source and target maps \(s,t:M\rightarrow O\), an operation \(\textit{id}:O\rightarrow M\) associating an identity arrow with each object, and a partial operation of composition ;  of morphisms such that fg is defined whenever \(t(f) = s(g)\), where \(f;g=g\circ f\). The following axioms hold for all \(X\in O\) and \(f,g,h\in M\) (for Kleene equality, that is, whenever compositions are defined):

$$\begin{aligned}&s(\textit{id}(X)) = X,\qquad t(\textit{id}(X)) = X,\qquad s (f; g) = s(f),\qquad t (f;g) = t(g),\\&f ; (g;h) = (f; g); h,\qquad \textit{id}(s (f)) ; f = f,\qquad f ; \textit{id}(t (f)) = f. \end{aligned}$$

In a category, defining \(s= \textit{id}\circ s\) and \(t= \textit{id}\circ t\) yields local functional catoids (source and target maps of categories on the right, those of catoids on the left). Conversely, the set of units of a local functional catoid defines the set of objects of a category.

(2) The pair groupoid is a local functional catoid.

(3) Locality of \(s\) and \(t\) fail in the broken monoid from Example 2.2 because \(s(aa) =s(\emptyset )=\emptyset \subset \{1\} = s(a1) = s(as(a))\). The proof for \(t\) is dual.

(4) In the functional abelian catoid of heaplets from Example 2.2, locality fails, too: \(s(fg)=s(\emptyset ) = \emptyset \subset \{\varepsilon \} = s(f)=s(f\varepsilon ) = s(fs(g))\) if the domains of \(f,g\in H\) overlap. Locality of \(t\) fails by duality.

(5) The set \(\smash [b]{{\mathbb {M}}S= \bigcup _{ n, m\ge 0} S^{ n\times m}}\) of matrices over a semiring S forms a partial monoid with matrix multiplication as composition. \({\mathbb {M}}S\) is a local functional catoid with \(s\) and \(t\) defined, for any \(M\in S^{ n\times m}\), by \(s( M)= I_n\) and \(t( M)= I_m\), the identity matrices of appropriate dimension. This category is isomorphic to the standard category of matrices, which has natural numbers as objects and \(n\times m\)-matrices as elements of the hom-set [nm]. \(\square \)

4 Convolution quantales

We have already extended the multioperation \(\odot :X\times X\rightarrow {\mathcal {P}}X\) to type \({\mathcal {P}}X\times {\mathcal {P}}X\rightarrow {\mathcal {P}}X\) and the maps \(s,t:X\rightarrow X\) to type \({\mathcal {P}}X\rightarrow {\mathcal {P}}X\) by taking images. We wish to explore the algebraic structure of such powerset liftings over \(st\)-multimagmas and their relatives. Powerset liftings of relational monoids yield quantales [12, 35]. Yet the precise lifting of source and target operations remains to be explored. This requires some preparation.

A quantale \((Q,\le ,\cdot ,1)\) is a complete lattice \((Q,\le )\) with a monoidal composition \(\cdot \) with unit 1 that preserves all sups in both arguments [34].

We write \(\bigvee \) for the sup and \(\bigwedge \) for the inf operator, and \(\vee \), \(\wedge \) for binary variants. We write \(\bot =\bigwedge Q=\bigvee \emptyset \) for the least and \(\top = \bigvee Q=\bigwedge \emptyset \) for the greatest element of Q. We write \(Q_1=\{\alpha \in Q\mid \alpha \le 1\}\) for the set of subidentities of quantale Q.

A quantale is boolean if its lattice reduct is a complete boolean algebra—a complete lattice and a boolean algebra. We write − for boolean complementation. In a boolean quantale Q, the set of subidentities \(Q_1\) forms a complete boolean subalgebra with complementation \(x'= 1 - x\) restricted to this subalgebra, and in which composition is meet [15].

Our examples in Section 9 require weaker kinds of quantales. A prequantale is a quantale in which the associativity law is absent [34].

Proposition 4.1

Let \((X,\odot ,s,t)\) be a catoid. Then \(({\mathcal {P}}X,\subseteq ,\odot ,E)\) forms a boolean quantale in which the complete boolean algebra is atomic.

Proof

If \((X,\odot ,s,t)\) is a catoid, then \((X,\odot ,E)\) is a multimonoid by Proposition 3.10, hence isomorphic to a relational monoid, and its powerset algebra a quantale [12, 35], in fact a boolean atomic one. \(\square \)

Remark 4.2

If X is merely an \(st\)-multimagma, then \({\mathcal {P}}X\) forms a prequantale instead of a quantale [5, 12]. This weaker result is needed in Section 6.

Remark 4.3

Dualities between \(n+1\)-ary relational structures and boolean algebras with n-ary (modal) operators have been studied by Jónsson and Tarski [29]; correspondences between relational associativity laws and those at powerset level are well-known from substructural logics. Here we consider ternary relations—as binary multioperations—and the quantalic composition as a binary (modal) operation.

Example 4.4

(Powerset quantales over catoids). While lifting works for arbitrary catoids we restrict our attention to categories.

(1) Let \(C=(O,M)\) be a category. Then \(({\mathcal {P}}C,\subseteq ,\odot ,1)\) is an atomic boolean quantale with the operations from Section 4 and \(1=\{\textit{id}_X\mid X\in O\}\). This holds by Proposition 4.1, as categories are catoids (Example 2.2).

(2) Lifting the pair groupoid on X yields the quantale of binary relations over X. The quantalic composition is relational composition, the monoidal unit the identity relation, set union is sup and set inclusion the partial order. Relations are possibly infinite-dimensional boolean-valued square matrices with matrix multiplication as quantalic composition (Example  3.11). \(\square \)

The fact that groupoids can be lifted to algebras of binary relations with an additional operation of converse, \(R^\smallsmile =\{(y,x)\mid (x,y)\in R\}\), was known to Jónsson and Tarski [30]. It includes in particular groups as single-object groupoids. Further examples of powerset liftings of categories and other catoids can be found in Section 9.

The powerset lifting can be seen as a lifting to the function space \(2^X\), where 2 is the quantale of booleans. It generalises to function spaces \(Q^X\) for arbitrary quantales Q [12]. We present a multioperational version.

Let \((X,\odot ,s,t)\) be an \(st\)-multimagma and \((Q,\le ,\cdot ,1)\) a quantale. For functions \(f,g:X\rightarrow Q\), we define the convolution \(*: Q^X\times Q^X\rightarrow Q^X\) as

$$\begin{aligned} (f*g) (x) = \bigvee _{x\in y\odot z} f (y) \cdot g (z)=\bigvee \{f (y) \cdot g (z) \mid x\in y\odot z\}. \end{aligned}$$

For any predicate P we define

$$\begin{aligned}{}[P]= {\left\{ \begin{array}{ll} 1 &{} \text { if } P,\\ \bot &{} \text { otherwise}, \end{array}\right. } \end{aligned}$$

and then \(\textit{id}_{E}:X\rightarrow Q\) as

$$\begin{aligned} \textit{id}_E (x) = [x\in E]. \end{aligned}$$

In addition, we extend sups and \(\le \) pointwise from Q to \(Q^X\). This leads to the following generalisation of Proposition 4.1.

Theorem 4.5

If X is a catoid and Q a quantale, then \((Q^X,\le ,*,\textit{id}_E)\) is a quantale.

Proof

If \((X,\odot ,s,t)\) is a catoid and Q a quantale, then \((X,\odot ,E)\) is a multimonoid by Proposition 3.10 and a relational monoid up-to isomorphism. Hence \(Q^X\) is a quantale [12] (shown for slightly different, but equivalent relational monoid axioms). \(\square \)

Further, \(Q^X\) is distributive (as a lattice) if Q is, and boolean if Q is [12]. We call \(Q^X\) from Theorem 4.5 the convolution quantale of X and Q.

Remark 4.6

If X is an \(st\)-multimagma and Q a prequantale, then the convolution algebra \(Q^X\)is a prequantale [5, 12]. This result is needed in Section 7.

The following laws help working with convolutions. Using the notation \(\delta _x(y)=[x=y]\) we can write \(f(x) = \bigvee _{y\in X} f(y)\cdot \delta _{y}(x)\) for any \(f\in Q^X\), and

$$\begin{aligned} f = \bigvee _{x\in X} f(x)\cdot \delta _x, \end{aligned}$$

if we regard \(f(x)\cdot \delta _x\) and \(\alpha \cdot f\), for any \(\alpha \in Q\) and \(f:X\rightarrow Q\), as a scalar product in a Q-module on \(Q^X\). We can then rewrite convolution as

$$\begin{aligned} (f *g)(x)&= \bigvee _{y,z\in X} f(y)\cdot g(z) \cdot [x\in y\odot z],\\ f *g&= \bigvee _{x,y,z\in X} f(y)\cdot g(z) \cdot [x\in y\odot z]\cdot \delta _x, \end{aligned}$$

sups as \(\bigvee F= \bigvee _{x\in X} \bigvee \{f(x)\mid f\in F\}\cdot \delta _x\) and \( (f+ g) = \bigvee _{x\in X} (f(x)+g(x))\cdot \delta _x\), and finally the identity function as \(\textit{id}_E = \bigvee _{e\in E}\delta _e\).

Example 4.7

(Convolution quantales over catoids). Once again we restrict our attention to categories.

(1) A category algebra is the convolution algebra of a small category with values in a commutative unital ring. This generalises group algebras such as group rings. Similarly, Theorem 4.5 constructs category quantales, evaluating small categories in quantales and yielding quantales as convolution algebras.

(2) An instance are Q-fuzzy relations [20], which are Q-valued binary relations. The associated quantales are convolution quantales over pair groupoids. If Q is the Lawvere quantale described in Example 4.8 below, this yields t-norms. Q-valued relations correspond to possibly infinite-dimensional Q-valued square matrices. If the base set is finite, we recover the matrix theories of Example 3.11. Heisenberg’s original formalisation of quantum mechanics [26] is based on a similar convolution algebra over the pair groupoid [3] with values in the field \({\mathbb {C}}\). \(\square \)

Other relational or partial monoids and convolution algebras are discussed in [5, 11, 12]. For examples based on categories and non-local catoids see Section 9. Finally, we recall some well-known value-quantales.

Example 4.8

(Quantales).

(1) We have already mentioned the quantale of booleans \((2,\le ,\wedge ,1)\). It has carrier set \(\{0,1\}\) and \(\wedge \), in fact \(\min \), as composition.

(2) The Lawvere quantale \(({\mathbb {R}}_+^\infty ,\ge ,+,0)\) has \(\bigwedge \) as supremum, \(+\) as quantalic composition, extended by \(x+\infty =\infty =\infty +x\), and 0 as its unit. It is important for defining generalised metric spaces and t-norms.

(3) The unit interval \(([0,1],\le ,\cdot ,1)\) forms a quantale with \(\bigvee \) as supremum. It is isomorphic to the Lawvere quantale via \(x\mapsto -\ln x\) and its inverse, and important in probability applications.

(4) The structures \(([0,1],\le ,\min ,1)\) and \(([0,1],\ge ,\max ,0)\), and their variants with [0, 1] replaced by \({\mathbb {R}}_+^\infty \) (and unit \(\infty \) for the first), form further quantales over [0, 1]. They are examples of max-plus algebras and similar semirings. \(\square \)

5 Modal quantales

The results of Section 4 do not lift the source and target structure of catoids to \(Q^X\) faithfully: all relational units are mapped to the unit in Q by \(\textit{id}_E\) rather bluntly. A refinement, in which different elements of E may map to different elements in \({\mathcal {P}}X\) or different values in Q, is possible.

Example 5.1

(Relational domain and codomain). The relational domain and codomain operations in a relation quantale are, for \(R\subseteq X\times X\),

$$\begin{aligned} {{\,\mathrm{\textit{dom}}\,}}(R) = \{(a,a)\mid \exists b.\ (a,b)\in R\},\qquad {{\,\mathrm{\textit{cod}}\,}}(R) = \{(b,b)\mid \exists a.\ (a,b) \in R\}. \end{aligned}$$

Thus \({{\,\mathrm{\textit{dom}}\,}}(R) = s(R)\) and \({{\,\mathrm{\textit{cod}}\,}}(R)= t(R)\), taking images on the right and computing s and t in the pair groupoid on X. \(\square \)

This can be captured more abstractly. A domain quantale [15] is a quantale \((Q,\le ,\cdot ,1)\) with an operation \({{\,\mathrm{\textit{dom}}\,}}:Q\rightarrow Q\) such that, for all \(\alpha ,\beta \in Q\),

$$\begin{aligned}&\alpha \le {{\,\mathrm{\textit{dom}}\,}}(\alpha )\cdot \alpha ,\qquad {{\,\mathrm{\textit{dom}}\,}}\, (\alpha \cdot {{\,\mathrm{\textit{dom}}\,}}(\beta )) = {{\,\mathrm{\textit{dom}}\,}}(\alpha \cdot \beta ),\qquad {{\,\mathrm{\textit{dom}}\,}}(\alpha ) \le 1,\\&{{\,\mathrm{\textit{dom}}\,}}(\bot ) = \bot ,\qquad {{\,\mathrm{\textit{dom}}\,}}(\alpha \vee \beta ) = {{\,\mathrm{\textit{dom}}\,}}(\alpha )\vee {{\,\mathrm{\textit{dom}}\,}}(\beta ). \end{aligned}$$

We refer to the domain axioms as absorption, locality, subidentity, strictness and (binary) sup preservation, respectively. In fact, \({{\,\mathrm{\textit{dom}}\,}}(\alpha ) \alpha = \alpha \). Henceforth we often continue to omit \(\cdot \).

The domain axioms are those of domain semirings [8]. Domain quantales are thus domain semirings with addition as binary sup. Properties of domain semirings are therefore inherited, for instance the export law \({{\,\mathrm{\textit{dom}}\,}}({{\,\mathrm{\textit{dom}}\,}}(\alpha ) \beta ) = {{\,\mathrm{\textit{dom}}\,}}(\alpha ) {{\,\mathrm{\textit{dom}}\,}}(\beta )\), order preservation of \({{\,\mathrm{\textit{dom}}\,}}\) the weak twisted law: \(\alpha {{\,\mathrm{\textit{dom}}\,}}(\beta ) \le {{\,\mathrm{\textit{dom}}\,}}(\alpha \beta ) \alpha \), least left absorption (lla), \({{\,\mathrm{\textit{dom}}\,}}(\alpha ) \le \rho \Leftrightarrow \alpha \le \rho \alpha \) and the adjunction \({{\,\mathrm{\textit{dom}}\,}}(\alpha ) \le \rho \Leftrightarrow \alpha \le \rho \top \). In the last two laws, we have assumed that \(\rho \in Q_{{{\,\mathrm{\textit{dom}}\,}}}=\{\alpha \mid {{\,\mathrm{\textit{dom}}\,}}(\alpha )=\alpha \}\).

Domain axioms for finite sups suffice [15]. In any domain quantale, \({{\,\mathrm{\textit{dom}}\,}}\) preserves arbitrary sups, \({{\,\mathrm{\textit{dom}}\,}}\left( \bigvee A\right) = \bigvee {{\,\mathrm{\textit{dom}}\,}}(A)\), hence in particular \({{\,\mathrm{\textit{dom}}\,}}(\top ) = 1\), and \({{\,\mathrm{\textit{dom}}\,}}\left( \bigwedge A\right) \le \bigwedge {{\,\mathrm{\textit{dom}}\,}}(A)\). Domain elements also left-distribute over non-empty infs, \({{\,\mathrm{\textit{dom}}\,}}(\alpha ) \cdot \bigwedge A = \bigwedge ({{\,\mathrm{\textit{dom}}\,}}(\alpha ) A)\) for all \(A\ne \emptyset \).

Much of the structure of the domain algebra induced by \({{\,\mathrm{\textit{dom}}\,}}\) is inherited from domain semirings as well. It holds that \(Q_{{{\,\mathrm{\textit{dom}}\,}}} = {{\,\mathrm{\textit{dom}}\,}}(Q)\). The domain algebra \((Q_{{{\,\mathrm{\textit{dom}}\,}}},\le ,\cdot ,1)\) is therefore a subquantale of Q that forms a bounded distributive lattice with \(\cdot \) as binary inf. It contains the largest boolean subalgebra of Q bounded by \(\bot \) and 1 [8]. The elements of \(Q_{{{\,\mathrm{\textit{dom}}\,}}}\) are called domain elements of Q. Yet, in the quantalic case, the lattice \(Q_{{{\,\mathrm{\textit{dom}}\,}}}\) is complete [15]: \({{\,\mathrm{\textit{dom}}\,}}(\bigvee {{\,\mathrm{\textit{dom}}\,}}(A)) = \bigvee {{\,\mathrm{\textit{dom}}\,}}(A)\) follows from sup-preservation of \({{\,\mathrm{\textit{dom}}\,}}\). All sups of domain elements are therefore again domain elements, but sups and infs in \(Q_{{{\,\mathrm{\textit{dom}}\,}}}\) need not coincide with those in Q.

Quantales are closed under opposition: interchanging the order of composition in quantale Q yields the quantale \(Q^\textit{op}\); properties translate under this duality. The opposite of the domain operation is a codomain operation.

A codomain quantale is the opposite of a domain quantale, just like a codomain semiring is the opposite of a domain semiring. Codomain quantales can be axiomatised using a codomain operation \({{\,\mathrm{\textit{cod}}\,}}:Q\rightarrow Q\) that satisfies the dual domain axioms, making \((Q^\textit{op},{{\,\mathrm{\textit{cod}}\,}})\) a domain quantale.

A modal quantale \((Q,\le ,\cdot ,1,{{\,\mathrm{\textit{dom}}\,}},{{\,\mathrm{\textit{cod}}\,}})\) is a domain and codomain quantale that satisfies the following compatibility axioms, which make the domain and codomain algebras \(Q_{{{\,\mathrm{\textit{dom}}\,}}}\) and \(Q_{{{\,\mathrm{\textit{cod}}\,}}}\) coincide:

$$\begin{aligned} {{\,\mathrm{\textit{dom}}\,}}\circ {{\,\mathrm{\textit{cod}}\,}}= {{\,\mathrm{\textit{cod}}\,}}\qquad \text { and }\qquad {{\,\mathrm{\textit{cod}}\,}}\circ {{\,\mathrm{\textit{dom}}\,}}= {{\,\mathrm{\textit{dom}}\,}}. \end{aligned}$$

Remark 5.2

In modal semirings, \({{\,\mathrm{\textit{dom}}\,}}\) and \({{\,\mathrm{\textit{cod}}\,}}\) can be modelled through their boolean complements in the subalgebras of subidentities—by antidomain and antirange operations. This allows expressing boolean complementation in \(Q_{{{\,\mathrm{\textit{dom}}\,}}}\), which becomes the largest complete boolean subalgebra of Q bounded by \(\bot \), 1 [8]. We lift from catoids, where complements of \(s\) and \(t\) may not exist, into arbitrary quantales, hence do not follow this approach.

In a boolean quantale Q, the subalgebra \(Q_1\) of subidentities is a complete boolean algebra with quantalic composition as binary inf, hence in particular \(Q_{{{\,\mathrm{\textit{dom}}\,}}} =Q_1\). One can then axiomatise domain using the adjunction \({{\,\mathrm{\textit{dom}}\,}}(\alpha ) \le \rho \Leftrightarrow \alpha \le \rho \top \), for all \(\rho \in Q_1\) together with weak locality \({{\,\mathrm{\textit{dom}}\,}}(\alpha \beta ) \le {{\,\mathrm{\textit{dom}}\,}}(\alpha {{\,\mathrm{\textit{dom}}\,}}(\beta ))\) [15]. Dual results hold for codomain. The adjunction alone yields only predomain and precodomain operations without locality [7]. Finally, in a boolean quantale, antidomain and anticodomain operations can be defined as \(\textit{adom}= (\lambda x.\ x')\circ {{\,\mathrm{\textit{dom}}\,}}\) and its dual. The axioms of antidomain and anticodomain semirings [8] can then be derived [15].

Some of the \(st\)-multimagmas and catoids in the examples in Section 9 fail to yield associativity or locality laws when lifted. This requires more fine-grained axiomatisations.

(1) A modal prequantale is based on a prequantale and, in its modal axioms, the two locality axioms are replaced by the export axioms

$$\begin{aligned} {{\,\mathrm{\textit{dom}}\,}}({{\,\mathrm{\textit{dom}}\,}}(\alpha )\beta )) = {{\,\mathrm{\textit{dom}}\,}}(\alpha ){{\,\mathrm{\textit{dom}}\,}}(\beta ),\qquad {{\,\mathrm{\textit{cod}}\,}}(\alpha {{\,\mathrm{\textit{cod}}\,}}(\beta )) = {{\,\mathrm{\textit{cod}}\,}}(\alpha ){{\,\mathrm{\textit{cod}}\,}}(\beta ). \end{aligned}$$

Then \(Q_{{{\,\mathrm{\textit{dom}}\,}}}={{\,\mathrm{\textit{dom}}\,}}(Q)={{\,\mathrm{\textit{cod}}\,}}(Q)=Q_{{{\,\mathrm{\textit{cod}}\,}}}\) is still a complete distributive lattice, but even inequational locality laws for \({{\,\mathrm{\textit{dom}}\,}}\) or \({{\,\mathrm{\textit{cod}}\,}}\) are no longer derivable.

(2) A weakly local modal quantale is a modal quantale in which the locality axioms for \({{\,\mathrm{\textit{dom}}\,}}\) and \({{\,\mathrm{\textit{cod}}\,}}\) have been replaced by the export axioms above. In the presence of associativity, the weak locality laws

$$\begin{aligned} {{\,\mathrm{\textit{dom}}\,}}(\alpha \beta ) \le {{\,\mathrm{\textit{dom}}\,}}(\alpha {{\,\mathrm{\textit{dom}}\,}}(\beta )) \qquad \text { and }\qquad {{\,\mathrm{\textit{cod}}\,}}(\alpha \beta ) \le {{\,\mathrm{\textit{cod}}\,}}({{\,\mathrm{\textit{cod}}\,}}(\alpha )\beta ) \end{aligned}$$

are then derivable, but locality still fails.

As mentioned before, this hierarchy of definitions is reflected by lifting and modal correspondence properties in Sections 68 and justified by mathematically meaningful examples in Section 9.

All definitions and properties mentioned have been checked with Isabelle. They also hold of dioids, but have not been worked out in detail.

6 Modal powerset quantales

We outline how catoids lift to powerset algebras, using the lifted operations \(s,t:{\mathcal {P}}X\rightarrow {\mathcal {P}}X\) defined, for all \(A\subseteq X\), by

$$\begin{aligned} s(A) = \{s(x) \mid x\in A\}\qquad \text { and }\qquad t(A) = \{t(x) \mid x\in A\}. \end{aligned}$$

Remark 6.1

To relate this with the lifting of the ternary relation R to a binary modality \(\odot \) on the powerset quantale in the sense of Jónsson and Tarski, consider \({\mathcal {R}}(s) = \{(x,y)\mid y = s(x)\}\), the graph of \(s\), which is a functional binary relation, and likewise the graph \({\mathcal {R}}(t)\) of \(t\). Then

$$\begin{aligned} s(A) = \{y\mid \exists x\in A.\ (x,y)\in {\mathcal {R}}(s)\},\qquad t(A) = \{y\mid \exists x\in A.\ (x,y)\in {\mathcal {R}}(t) \}, \end{aligned}$$

which shows that \(s\) and \(t\) are indeed modal diamonds on \({\mathcal {P}}X\) with respect to the standard Kripke semantics. The next lemmas show that they satisfy the laws for operators on boolean algebras.

Our main aim is to verify the domain quantale axioms and then use properties of domain and codomain to infer that local catoids can be lifted to boolean modal power set quantales. We develop this theorem step-by-step, starting from \(st\)-multimagmas to clarify correspondences.

Lemma 6.2

Let X be an \(st\)-multimagma. For \(A,B\subseteq X\) and \({\mathcal {A}}\subseteq {\mathcal {P}}X\), the following laws hold:

  1. (1)

    the compatibility laws \(s(t(A)) = t(A)\) and \(t(s(A)) = s(A)\),

  2. (2)

    the absorption laws \(s(A) A = A\) and \(A t(A)= A\),

  3. (3)

    the sup-preservation laws

    $$\begin{aligned} s\left( \bigcup {\mathcal {A}}\right) = \bigcup \{s(A)\mid A \in {\mathcal {A}}\}\quad \text { and }\quad t\left( \bigcup {\mathcal {A}}\right) = \bigcup \{t(A)\mid A \in {\mathcal {A}}\}, \end{aligned}$$
  4. (4)

    the binary sup-preservation laws \(s(A\cup B)= s(A) \cup s(B)\) as well as \(t(A\cup B)= t(A) \cup t(B)\), and the zero laws \(s(\emptyset ) = \emptyset = t(\emptyset )\),

  5. (5)

    the commutativity laws \(f (A) g (B) = g (B) f (A)\), for \(f,g\in \{s,t\}\),

  6. (6)

    the subidentity laws \(s(A) \subseteq X_s\) and \(t(A) \subseteq X_t\),

  7. (7)

    the export laws \(s(s(A) B) = s(A) s(B)\) and \(t(A t(B)) = t(A)t(B)\).

The proof has been verified with Isabelle. It is subsumed by Theorem 7.1. As powerset liftings are important and the proof may be instructive, we present details in [14]. Lemma 6.2 shows that the domain axioms, except locality, can already be lifted from \(st\)-multimagmas. The identities in (4) are subsumed by those in (3) in powerset quantales, but needed for lifting to modal semirings; see Section 7. This is why we list them.

Lifting weak variants of locality for \(s\) and \(t\) requires catoids. Lifting locality, in addition, requires local catoids.

Lemma 6.3

Let X be a catoid and \(A,B\subseteq X\). Then

$$\begin{aligned} s(AB) \subseteq s(A s(B))\qquad \text { and }\qquad t(AB)\subseteq t(t(A)B). \end{aligned}$$

The converse inclusions hold if X is local.

The proofs have again been checked with Isabelle. Weak locality holds in any weakly local modal semiring and quantale (which satisfy export axioms, see Section 5).

The results of the previous two lemmas can be summarised as follows.

Theorem 6.4

Let X be an \(st\)-multimagma.

  1. (1)

    Then \(({\mathcal {P}}X,\subseteq ,\odot ,E,{{\,\mathrm{\textit{dom}}\,}},{{\,\mathrm{\textit{cod}}\,}})\) is a boolean modal prequantale in which \({{\,\mathrm{\textit{dom}}\,}}(A) = s(A)\), \({{\,\mathrm{\textit{cod}}\,}}(A)= t(A)\), for all \(A\subseteq X\), and the complete boolean algebra is atomic.

  2. (2)

    It is a weakly local modal quantale if X is a catoid.

  3. (3)

    It is a modal quantale if X is local.

Proof

We have derived the respective variants of modal prequantale and quantale axioms in Lemmas 6.2 and  6.3 for \(st\)-multimagmas, catoids and local catoids. They hold with the boolean prequantale and quantale axioms lifted via Proposition 4.1 and the remark following it. \(\square \)

The three items in Theorem 6.4 emphasise the role of locality in the three stages of lifting. The construction follows one direction of Jónsson-Tarski duality between relational structures and boolean algebras with operators [29], which generalises to categories of relational structures and boolean algebras with operators [21]. Theorem 6.4 is an instance of this duality. Like in modal logic, there are correspondences between relational structures and boolean algebras with operators. The identities lifted in Lemma 6.2 and 6.3 are one direction of these. They are generalised in Section 8.

Example 6.5

(Modal powerset quantales over catoids).

(1) Any category lifts to a modal powerset quantale. It is boolean and has the arrows of the category as atoms. The domain algebra is the entire boolean subalgebra of subidentities, the set of all objects of the category (or its identity arrows). A modal powerset algebra can thus be constructed from any category.

(2) In the modal powerset quantale over the pair groupoid on X, the modal quantale of binary relations, domain and codomain elements are the relational domains and codomains from Example 5.1. The domain algebra is formed by the relations below \( Id _X\). In the associated matrix algebras, these correspond to (boolean-valued) subidentity matrices and further to predicates (Example 3.11). The consideration of domain refines Jónsson and Tarski’s classical lifting result from pair groupoids to relation algebras, while we ignore the converse structure.

(3) In this and the next example, locality at powerset-level fails. Recall that the functional catoid of the broken monoid (Example 3.11) is only weakly local. The powerset quantale is therefore only weakly local, too. To check this, we simply replay the non-locality proof for the functional catoid with \(A=\{a\}\): \({{\,\mathrm{\textit{dom}}\,}}(AA) = {{\,\mathrm{\textit{dom}}\,}}(\emptyset ) = \emptyset \subset \{1\} = {{\,\mathrm{\textit{dom}}\,}}(A \{1\}) = {{\,\mathrm{\textit{dom}}\,}}(A {{\,\mathrm{\textit{dom}}\,}}(A))\). Locality of codomain is ruled out by duality.

(4) Locality of domain and codomain of the powerset algebra over the non-local partial abelian monoid of heaplets is ruled out with singleton sets as above, using the non-locality argument from Example 3.11. The powerset quantale of heaplets is an assertion quantale for separation logic with separating conjunction as quantalic composition. In separation logic, another notion of locality relates to a frame rule of its inference system. It is completely unrelated to the notion used in this article. \(\square \)

In these examples, antidomain and anticodomain can be defined along the lines of Section 5. Most models of domain and modal semirings considered previously are in fact powerset structures lifted from categories. Theorem 6.4 yields a uniform construction recipe for all of them. Further examples of modal prequantales, weakly local modal quantales and modal quantales lifted from underlying \(st\)-structures can be found in Section 9.

The two final examples of this section show that Axioms (3c) and (D3c) for function systems (shown in Appendix A) do not lift to powersets.

Example 6.6

(1) The category \(1{\mathop {\rightarrow }\limits ^{a}}2\) is a local functional catoid with \(X=\{1,a,2\}\), \(s\) and \(t\) defined by \(s(1) = t(1) = 1 =s(a)\) and \(s(2) = t(2) =2 = t(a)\) and composition \(11=1\), \(1a=a= a2\) and \(22=2\). Then, for \(A=\{1,a\}\) and \(B=\{2\}\), \(A\cdot {{\,\mathrm{\textit{dom}}\,}}(B) = A\cdot B = \{a\} \subset A = \{1\}\cdot A = {{\,\mathrm{\textit{dom}}\,}}(A\cdot B)\cdot A\) refutes (3c) in \({\mathcal {P}}X\). The opposite law (D3c) for \({{\,\mathrm{\textit{cod}}\,}}\) is refuted by a dual example.

(2) Axiom (3c) also fails in modal quantales of relations. Encoding \(1{\mathop {\rightarrow }\limits ^{a}}2\) on the set \(X=\{1,2\}\) using the relations \(R=\{(1,1),(1,2)\}\) and \(S=\{2,2\}\) yields \(R{{\,\mathrm{\textit{dom}}\,}}(S) = RS= \{(1,2)\} \subset R = \{(1,1)\}R = {{\,\mathrm{\textit{dom}}\,}}(RS)R\) in \({\mathcal {P}}(X\times X)\). Then \({{\,\mathrm{\textit{dom}}\,}}(RS)={{\,\mathrm{\textit{dom}}\,}}(R{{\,\mathrm{\textit{dom}}\,}}(S))\) models the relational preimage of \({{\,\mathrm{\textit{dom}}\,}}(S)\) under R. Executing R from all those inputs that may lead into \({{\,\mathrm{\textit{dom}}\,}}(S)\) and restricting the outputs of R to \({{\,\mathrm{\textit{dom}}\,}}(S)\) is only the same when R is a function.

A dual example for \({{\,\mathrm{\textit{cod}}\,}}\) and (D3c) uses the converses of R and S. The discussion above implies that (D3c) does not hold for general functions, but it does for monos in \(\textsf{Rel}\). \(\square \)

We thus remain within the realm of modal quantales as opposed to function systems. Weak variants of Schweizer and Sklar’s axioms (3c) and (D3c), \(\alpha {{\,\mathrm{\textit{dom}}\,}}(\beta ) \le {{\,\mathrm{\textit{dom}}\,}}(\alpha \beta ) \alpha \) and \({{\,\mathrm{\textit{cod}}\,}}(\alpha ) \beta \le \beta {{\,\mathrm{\textit{cod}}\,}}(\alpha \beta )\), can be derived in any modal semiring, as already mentioned. Yet they need not hold in modal prequantales. The equational catoid variants of Axioms (3c) and (D3c) do not lift to powersets. A theorem by Gautam [19] shows that identities lift to the powerset level if and only if all variables in the identity occur precisely once on each side. Neither the generalisations of (3c) and (D3c) satisfy this condition, nor their equational specialisations.

Remark 6.7

The functor \(G:\textbf{Set}\rightarrow \textbf{Rel}\) that maps functions to their graph associates convolutions of (graphs of) functions with function composition \(G(f)\odot G(g)= G(f; g)=G(g\circ f)\) and distributes over \({{\,\mathrm{\textit{dom}}\,}}\):

$$\begin{aligned} G({{\,\mathrm{\textit{dom}}\,}}(f))= \textit{Id}_{{{\,\mathrm{\textit{dom}}\,}}(G(f))} = {{\,\mathrm{\textit{dom}}\,}}(G(f)). \end{aligned}$$

Axiom (3c) can then be derived in the convolution algebra:

$$\begin{aligned} G(f)\odot {{\,\mathrm{\textit{dom}}\,}}(G(g))&= G(f;{{\,\mathrm{\textit{dom}}\,}}(g)) = G({{\,\mathrm{\textit{dom}}\,}}(f;g);f)\\&= {{\,\mathrm{\textit{dom}}\,}}(G(f)\odot G(g))\odot G(f) \end{aligned}$$

It depends on the form of convolution for (graphs of) functions and is beyond the general lifting by convolution. The case of (D3c) is analogous.

An asymmetry between catoids and modal quantales remains. While the domain quantale axioms are equations, we do now know an finitary equational axiomatisation for catoids.

7 Modal convolution quantales

We now prove our first main theorem, and perhaps the most useful one. It refines both the lifting from catoids to convolution quantales in Theorem 4.5 and the lifting from catoids to modal powerset quantales Theorem 6.4, namely to modal convolution quantales.

Once again we aim to spell out the conditions on the algebras used in the lifting. Yet first we generalise the definitions of domain and codomain at powerset level to convolution quantales. For every \(st\)-multimagma X, modal prequantale Q and \(f:X\rightarrow Q\) we define

$$\begin{aligned} {{\,\mathrm{\textit{Dom}}\,}}(f) = \bigvee _{x\in X} {{\,\mathrm{\textit{dom}}\,}}(f(x))\cdot \delta _{s(x)}\qquad \text { and }\qquad {{\,\mathrm{\textit{Cod}}\,}}(f)= \bigvee _{x\in X} {{\,\mathrm{\textit{cod}}\,}}(f(x))\cdot \delta _{t(x)}. \end{aligned}$$

It follows that \({{\,\mathrm{\textit{Dom}}\,}}(f)(x)= {{\,\mathrm{\textit{Cod}}\,}}(f)(x)= \bot \) for \(x\notin E\). Restricted to functions \(E\rightarrow Q\), we have \({{\,\mathrm{\textit{Dom}}\,}}(f)\circ s= {{\,\mathrm{\textit{dom}}\,}}\circ f\) and \({{\,\mathrm{\textit{Cod}}\,}}(f)\circ t= {{\,\mathrm{\textit{cod}}\,}}\circ f\).

Theorem 7.1

Let \((X,\odot ,s,t)\) be an \(st\)-multimagma, Q a modal prequantale.

(1):

Then \((Q^X,\le ,*,\textit{id}_E,{{\,\mathrm{\textit{Dom}}\,}},{{\,\mathrm{\textit{Cod}}\,}})\) is a modal prequantale.

(2):

It is a weakly local modal quantale if X is a catoid and Q a weakly local modal quantale.

(3):

It is a modal quantale if X is also local and Q a modal quantale.

Proof

Relative to Theorem 4.5 and the remark following it we need to check the domain and codomain axioms. We show proofs up-to duality. We point out where an \(st\)-multimagma X together with a modal prequantale Q or a catoid together with a weakly local modal quantale suffices for the lifting: this is the case in (1)–(5) below. It is convenient to view \(\alpha \cdot \delta _x\) as an element of the convolution algebra or a Q-module.

(1) First we show sup-preservation in \(Q^X\), assuming this law in Q:

$$\begin{aligned} {{\,\mathrm{\textit{Dom}}\,}}\left( \bigvee F\right)&= \bigvee _{x} {{\,\mathrm{\textit{dom}}\,}}\left( \bigvee \{f(x) \mid f\in F\}\right) \delta _{s(x)}\\&= \bigvee \left\{ \bigvee _{x} {{\,\mathrm{\textit{dom}}\,}}(f(x))\delta _{s(x)} \mid f\in F\right\} \\&=\bigvee \{{{\,\mathrm{\textit{Dom}}\,}}(f)\mid f \in F\}. \end{aligned}$$

The first step unfolds the definition of \({{\,\mathrm{\textit{Dom}}\,}}\). The second uses its sup-preservation in modal quantales. The third folds back its definition. Preservation of binary sups and domain strictness, \({{\,\mathrm{\textit{Dom}}\,}}(\lambda x.\ \bot ) =\bot \), follow.

(2) For the first compatibility axiom in \(Q^X\), assuming such laws in X and Q,

$$\begin{aligned} ({{\,\mathrm{\textit{Dom}}\,}}\circ {{\,\mathrm{\textit{Cod}}\,}})(f)&= \bigvee _{x} {{\,\mathrm{\textit{dom}}\,}}\left( \bigvee _{y}{{\,\mathrm{\textit{cod}}\,}}\left( f(y)\right) \delta _{t(y)}(x)\right) \delta _{s(x)}\\&= {{\,\mathrm{\textit{dom}}\,}}\left( \bigvee _{y}{{\,\mathrm{\textit{cod}}\,}}(f(y))\delta _{s(t(y))}\right) \\&= \bigvee _{y}{{\,\mathrm{\textit{dom}}\,}}({{\,\mathrm{\textit{cod}}\,}}(f(y)))\delta _{s(t(y))}\\&= \bigvee _{y}{{\,\mathrm{\textit{cod}}\,}}(f(y)) \delta _{t(y)}\\&= {{\,\mathrm{\textit{Cod}}\,}}(f). \end{aligned}$$

The first step unfolds the definitions of \({{\,\mathrm{\textit{Dom}}\,}}\) and \({{\,\mathrm{\textit{Cod}}\,}}\). The second one uses \(x = t(y)\), the third sup-preservation of \({{\,\mathrm{\textit{dom}}\,}}\) and the fourth compatibility for \({{\,\mathrm{\textit{dom}}\,}}\) and \({{\,\mathrm{\textit{cod}}\,}}\), \(s\) and \(t\). The last step folds back the definition of \({{\,\mathrm{\textit{Cod}}\,}}\).

(3) For the domain subidentity axiom in \(Q^X\), assuming this law in Q,

$$\begin{aligned} {{\,\mathrm{\textit{Dom}}\,}}(f) = \bigvee _{x}{{\,\mathrm{\textit{dom}}\,}}(f (x))\delta _{s(x)} \le \bigvee _{x \in E} 1\delta _x = \textit{id}_E. \end{aligned}$$

The second step uses the domain subidentity axioms in Q and the fact that \(x\in E\) if and only if \(x=s(x)\). The last step uses one of the Q-module-style laws following Remark 4.6.

(4) For domain absorption in \(Q^X\), assuming such laws in X and Q,

$$\begin{aligned} {{\,\mathrm{\textit{Dom}}\,}}(f) *f&= \bigvee _{w,x,y} \left( \bigvee _{z}{{\,\mathrm{\textit{dom}}\,}}(f(z)) \delta _{s(z)}(x)\right) f(y) [w \in x\odot y]\delta _w\\&= \bigvee _{w,y,z} {{\,\mathrm{\textit{dom}}\,}}(f(z)) f(y) [w\in s(z)\odot y]\delta _w\\&= \bigvee _{w,y} {{\,\mathrm{\textit{dom}}\,}}(f(y)) f(y) [w\in s(y)\odot y]\delta _w\\&= \bigvee _{y} f(y) \delta _{y}\\&= f. \end{aligned}$$

The first step unfolds the definition of \({{\,\mathrm{\textit{Dom}}\,}}\) and convolution. The second uses \(x = s(z)\) and sup-preservation of composition in Q. The third holds because \([w \in s(z)\odot y]\) is \(\bot \) unless \(y=z\), in which case it is 1, and because \(s(z)\odot y = s(z)\odot s(y) \odot y = \emptyset \) unless \(y=z\) by the orthogonality law for \(s\) preceding Lemma 3.3. The fourth follows from the absorption laws for \(s\) and \({{\,\mathrm{\textit{dom}}\,}}\). The final one uses a Q-module-style property following Remark 4.6.

(5) For domain export in \(Q^X\), assuming such laws in X and Q,

$$\begin{aligned}&{{\,\mathrm{\textit{Dom}}\,}}({{\,\mathrm{\textit{Dom}}\,}}(f) *g)\\&\quad = \bigvee _{x} {{\,\mathrm{\textit{dom}}\,}}\left( \bigvee _{y,z}\left( \bigvee _w{{\,\mathrm{\textit{dom}}\,}}(f(w))\delta _{s(w)}(y)\right) g(z) [x\in y\odot z]\right) \delta _{s(x)}\\&\quad =\bigvee _{x,z,w} {{\,\mathrm{\textit{dom}}\,}}({{\,\mathrm{\textit{dom}}\,}}(f(w)) g(z)) [s(x)\in s(s(w)\odot z)]\delta _{s(x)}\\&\quad =\bigvee _{x,z,w} {{\,\mathrm{\textit{dom}}\,}}(f(w)) {{\,\mathrm{\textit{dom}}\,}}(g(z)) [s(x)\in s(w) s(z)]\delta _{s(x)}\\&\quad =\left( \bigvee _w{{\,\mathrm{\textit{dom}}\,}}(f(w)) \delta _{s(w)}\right) *\left( \bigvee _z{{\,\mathrm{\textit{dom}}\,}}(g(z)) \delta _{s(z)}\right) \\&\quad ={{\,\mathrm{\textit{Dom}}\,}}(f)*{{\,\mathrm{\textit{Dom}}\,}}(g). \end{aligned}$$

The first step unfolds the definitions of \({{\,\mathrm{\textit{Dom}}\,}}\) and convolution. The second applies the distributivity laws for \({{\,\mathrm{\textit{dom}}\,}}\) and quantalic composition; at the same time it uses \(y=s(w)\) and \(x=s(x)\) and the fact that therefore \(x\in y\odot z\) if and only if \(s(x)\in s(y\odot z)\). The third uses the export laws for \({{\,\mathrm{\textit{dom}}\,}}\) and \(s\). The fourth uses \(x=s(x)\) and the definition of convolution with respect to x. The final step folds back the definitions of \({{\,\mathrm{\textit{Dom}}\,}}\).

This is a domain axiom for prequantales, as already mentioned.

(6) For weak domain locality in \(Q^X\), assuming such laws in X and Q,

$$\begin{aligned} {{\,\mathrm{\textit{Dom}}\,}}(f *g)&= \bigvee _x {{\,\mathrm{\textit{dom}}\,}}\left( \bigvee _{y,z}f(y)g(z) \cdot [x\in y\odot z]\right) \delta _{s(x)}\\&= \bigvee _{x,y,z}{{\,\mathrm{\textit{dom}}\,}}(f(y) g(z)) [s(x)\in s(y\odot z)]\delta _{s(x)}\\&\le \bigvee _{x,y,z}{{\,\mathrm{\textit{dom}}\,}}(f(y){{\,\mathrm{\textit{dom}}\,}}(g(z))) [s(x)\in s(y\odot s(z))]\delta _{s(x)}\\&=\bigvee _x {{\,\mathrm{\textit{dom}}\,}}\left( \bigvee _{y,z}f(y) \left( \bigvee _w{{\,\mathrm{\textit{dom}}\,}}(g(w)) \delta _{s(w)}(z)\right) [x\in y\odot z]\right) \delta _{s(x)}\\&= {{\,\mathrm{\textit{Dom}}\,}}(f *{{\,\mathrm{\textit{Dom}}\,}}(g)). \end{aligned}$$

After the usual unfoldings in the first step, the second uses sup-preservation of \({{\,\mathrm{\textit{dom}}\,}}\), the fact that \(x=s(x)\) and that therefore \(x \in y\odot z\) if and only if \(s(x)\in s(y\odot z)\). The third uses locality of \({{\,\mathrm{\textit{dom}}\,}}\) and \(s\). The fourth uses sup-preservation of \({{\,\mathrm{\textit{dom}}\,}}\), the fact that \(x \in y\odot s(z)\) if and only if \(s(x) \in s(y \odot s(z))\), and it introduces a new variable w such that \(s(w) =z\) to bring the innermost \({{\,\mathrm{\textit{dom}}\,}}\) in shape for the last step. Finally, we can then fold back definitions.

(7) For domain locality, we replay the weak locality proof with equations. This requires locality in X and Q. \(\square \)

Remark 7.2

Theorem 7.1 comprises the case where Q is merely a quantale, that is, \({{\,\mathrm{\textit{dom}}\,}}\) and \({{\,\mathrm{\textit{cod}}\,}}\) map \(\bot \) to \(\bot \) and all other elements to \(1\ne \bot \) (or another fixed element \(\alpha \ne \bot \)). A further specialisation leads to the quantale 2 of booleans and hence Theorem 6.4.

Full modal correspondence results for Q-valued functions are more complicated than for powersets. They are investigated in the next section. Examples for all three cases of Theorem 7.1 are presented in Section 9.

Next we return to our two running examples.

Example 7.3

(Modal convolution quantales over catoids).

(1) In the construction of category quantales, the \(st\)-structure of the underlying category lifts to the modal structure of the convolution quantale. Any category can therefore be lifted to a Q-valued modal convolution quantale.

(2) As an instance, for any modal quantale Q, the convolution algebra \(Q^X\) over the pair groupoid X forms a modal quantale. In this algebra,

$$\begin{aligned} {{\,\mathrm{\textit{Dom}}\,}}(f)(a,b) = \bigvee _c {{\,\mathrm{\textit{dom}}\,}}(f(a,c))\cdot \delta _a(b)={{\,\mathrm{\textit{dom}}\,}}\left( \bigvee _cf(a,c)\right) \cdot \delta _a(b), \end{aligned}$$

and likewise for \({{\,\mathrm{\textit{Cod}}\,}}\). The subalgebra of weighted domain and codomain elements is then the algebra of all weighted elements below the identity relation. These can be identified with Q-valued predicates. For \(Q=2\), this reduces to the standard definitions of \({{\,\mathrm{\textit{dom}}\,}}\) and \({{\,\mathrm{\textit{cod}}\,}}\) in the quantale of binary relations. We may view Q-valued relations as possibly infinite dimensional matrices. Domain and codomain elements then correspond to diagonal matrices with values given by domain and codomain elements below 1 in Q along the diagonal and \(\bot \) everywhere else. For instance,

$$\begin{aligned} {{\,\mathrm{\textit{Dom}}\,}}\left( \begin{pmatrix} \alpha &{} \beta \\ \gamma &{} \delta \end{pmatrix} \right)&= \begin{pmatrix} {{\,\mathrm{\textit{dom}}\,}}(\alpha \vee \beta ) &{} \bot \\ \bot &{} {{\,\mathrm{\textit{dom}}\,}}(\gamma \vee \delta ) \end{pmatrix},\\ {{\,\mathrm{\textit{Cod}}\,}}\left( \begin{pmatrix} \alpha &{} \beta \\ \gamma &{} \delta \end{pmatrix} \right)&= \begin{pmatrix} {{\,\mathrm{\textit{cod}}\,}}(\alpha \vee \gamma ) &{} \bot \\ \bot &{} {{\,\mathrm{\textit{cod}}\,}}(\beta \vee \delta ) \end{pmatrix}. \end{aligned}$$

This refines the matrix theories from Example 3.11. \(\square \)

The matrix example does not actually require a quantale as value algebra: in a finite weighted relation, the summation used in relational composition, that is, matrix multiplication, is over a finite set and can be represented by a finite supremum. In the absence of domain and codomain in the value algebra, even a semiring can be used. More generally, we can require that the multioperation of the catoid satisfies a finite decomposition property. Here are two classical examples beyond matrices.

(1) Schützenberger and Eilenberg’s approach to weighted languages, discussed in the Introduction, generalises language products to convolutions of functions \(\Sigma ^*\rightarrow S\) from \(\Sigma ^*\) into a semiring S [13]. A semiring suffices for convolutions because the number of prefix/suffix pairs into which any finite word in \(\Sigma ^*\) can be split is obviously finite. The resulting convolution algebra is then a semiring.

(2) Rota’s incidence algebra [36] of functions \(P\rightarrow R\) from a poset P to a commutative ring R requires P to be locally finite, that is, every closed segment \([x,y]=\{z\mid x\le z\le y\}\) must be finite. The incidence algebra is then an associative algebra in which the sup of the convolution is replaced by a summation in R. See also Section 9.

Alternatively, in group rings, it is usually assumed that functions \(G\rightarrow R\) have finite support, yet we focus on the property used for matrices, formal powerseries and incidence algebras in this article.

A multimagma \((X,\odot )\) is finitely decomposable if for each \(x\in X\) the fibre \(\odot ^{-1}(x)=\{(y,z)\mid x \in y\odot z\}\) is finite. The following variant of Theorem 4.5 is then immediate from corresponding results for relational monoids [5].

Theorem 7.4

Let X be a finitely decomposable catoid and \((S,+,\cdot ,0,1)\) a semi-ring. The convolution algebra \(S^X\) is then a semiring.

A direct proof requires verifying that all sups in the proof of Theorem 4.5 remain finite if X is finitely decomposable. The operation \(+\) of semirings corresponds to \(\vee \) in quantales, 0 corresponds to \(\bot \).

This result extends to domain semirings. Formally, a domain semiring [8] is a semiring \((S,+,\cdot ,0,1)\) with a domain operation \({{\,\mathrm{\textit{dom}}\,}}:S\rightarrow S\) that satisfies the same domain axioms as those of domain quantales, replacing \(\bot \) by 0 and \(\vee \) by \(+\). Every domain semiring is additively idempotent. The relation \(\le \), defined as \(\lambda x,y.\ x+y = y\), is thus a partial order. A modal semiring is a domain semiring and a codomain semiring, defined as for quantales by opposition, which satisfies \({{\,\mathrm{\textit{cod}}\,}}\circ {{\,\mathrm{\textit{dom}}\,}}= {{\,\mathrm{\textit{dom}}\,}}\) and \({{\,\mathrm{\textit{dom}}\,}}\circ {{\,\mathrm{\textit{cod}}\,}}= {{\,\mathrm{\textit{cod}}\,}}\).

Verifying finiteness of sups in the proof of Theorem 7.1 then extends Theorem 7.4 as follows.

Proposition 7.5

If X is a finitely decomposable catoid and S a modal semiring, then the convolution algebra \(S^X\) is a modal semiring.

The small sup-preservation properties of Lemma 6.2(4) are needed in the proof. The result can be adapted to \(st\)-multimagmas and modal presemirings, and to catoids and weakly modal semirings, as in previous sections.

8 From liftings to correspondences

In Section 7 we have presented liftings from \(st\)-multimagmas to modal convolution prequantales. These yield one direction of a modal correspondence triangle formed by two-out-of-three properties for \(st\)-multimagmas X, modal prequantales Q and modal prequantales \(Q^X\). For relational semigroups and monoids, the triangles from [5] show that certain properties in any two of a relational magma X, a prequantale Q and a prequantale \(Q^X\) induce corresponding properties in the remaining algebra, for instance associativity. They include the following results for units, translated to multimagmas by isomorphism.

Proposition 8.1

Let X be a multimagma and Q a prequantale, not necessarily unital.

  1. (1)

    If \(Q^X\) is a unital prequantale and \(1\ne \bot \) in Q, then X is an \(st\)-multi-magma.

  2. (2)

    If \(Q^X\) is a unital prequantale and X an \(st\)-multimagma, then Q is unital.

Proof

The results are known for relational magmas [5, Proposition 4.1] and thus hold for multimagmas. Proposition 3.10 translates them to \(st\)-multimagmas. \(\square \)

The restriction \(\bot \ne 1\) in Proposition 8.1 is weak: \(\bot = 1\Rightarrow Q=\{ \bot \}\).

We now complete the correspondence triangle, refining Proposition 8.1 to variants of modal quantales. Relative to Proposition 8.1 we only consider the \(st\)-axioms and the modal ones for prequantales and quantales while assuming the multimagma and prequantale ones. We use a technique from [5] which in turn comes from representation theory.

In the following, we assume that \(s\), \({{\,\mathrm{\textit{dom}}\,}}\) and \({{\,\mathrm{\textit{Dom}}\,}}\), and similarly \(t\), \({{\,\mathrm{\textit{cod}}\,}}\) and \({{\,\mathrm{\textit{Cod}}\,}}\), are related as in Theorem 7.1. Thus

$$\begin{aligned} {{\,\mathrm{\textit{Dom}}\,}}(\alpha \delta _x) = \bigvee _y {{\,\mathrm{\textit{dom}}\,}}(\alpha \delta _x(y))\delta _{s(y)} = {{\,\mathrm{\textit{dom}}\,}}(\alpha ) \delta _{s(x)} \end{aligned}$$

and therefore \({{\,\mathrm{\textit{Dom}}\,}}(\delta _x) =\delta _{s(x)}\) with dual laws for \({{\,\mathrm{\textit{Cod}}\,}}\). Moreover,

$$\begin{aligned} (\alpha \delta _x*\beta \delta _y)(z)= \bigvee _{u,v} \alpha \delta _x(u)\beta \delta _y(v)[z\in u\odot v]= \alpha \beta [z\in x\odot y] \end{aligned}$$

and in particular \((\delta _x*\delta _y)(z)=[z\in x\odot y]\).

We first link properties of X with those of Q and \(Q^X\) via \(\delta \)-functions.

Lemma 8.2

Let X be a multimagma with \(s,t:X\rightarrow X\), let Q and \(Q^X\) be prequantales with \({{\,\mathrm{\textit{dom}}\,}},{{\,\mathrm{\textit{cod}}\,}}:Q\rightarrow Q\) and \({{\,\mathrm{\textit{Dom}}\,}},{{\,\mathrm{\textit{Cod}}\,}}:Q^X\rightarrow Q^X\). Then, for all \(\alpha ,\beta \in Q\) and \(x,y,z\in X\),

  1. (1)

    \({{\,\mathrm{\textit{Dom}}\,}}(\alpha \delta _x) *(\alpha \delta _x) = \bigvee _y {{\,\mathrm{\textit{dom}}\,}}(\alpha )\alpha [y \in s(x)\odot x] \delta _y\),

  2. (2)

    \({{\,\mathrm{\textit{Dom}}\,}}({{\,\mathrm{\textit{Dom}}\,}}(\alpha \delta _x)*(\beta \delta _y)) = \bigvee _z{{\,\mathrm{\textit{dom}}\,}}({{\,\mathrm{\textit{dom}}\,}}(\alpha ) \beta ) [z \in s(s(x) \odot y)] \delta _{s(z)}\),

  3. (3)

    \({{\,\mathrm{\textit{Dom}}\,}}(\alpha \delta _x)*{{\,\mathrm{\textit{Dom}}\,}}(\beta \delta _y) = \bigvee _z{{\,\mathrm{\textit{dom}}\,}}(\alpha ) {{\,\mathrm{\textit{dom}}\,}}(\beta ) [z\in s(x)\odot s(y)]\delta _z\),

  4. (4)

    \({{\,\mathrm{\textit{Dom}}\,}}((\alpha \delta _x) *{{\,\mathrm{\textit{Dom}}\,}}\left( \beta \delta _y)\right) = \bigvee _z{{\,\mathrm{\textit{dom}}\,}}(\alpha {{\,\mathrm{\textit{dom}}\,}}(\beta )) [ z \in s(x \odot s(y))] \delta _{s(z)}\),

  5. (5)

    \({{\,\mathrm{\textit{Dom}}\,}}((\alpha \delta _x) *(\beta \delta _y)) = \bigvee _z{{\,\mathrm{\textit{dom}}\,}}(\alpha \beta ) [z \in s(x \odot y)] \delta _{s(z)}\).

  6. (6)

    Corresponding properties hold for \({{\,\mathrm{\textit{Cod}}\,}}\), \({{\,\mathrm{\textit{cod}}\,}}\) and \(t\).

Proof

We write \(\delta ^\alpha _x\) for \(\alpha \delta _x\) and drop multiplication symbols as convenient.

(1) The first proof uses the above law for \({{\,\mathrm{\textit{Dom}}\,}}(\delta ^\alpha _x)\) together with the usual conditions imposed by \(\delta \):

$$\begin{aligned} {{\,\mathrm{\textit{Dom}}\,}}(\delta ^\alpha _x) \delta ^\alpha _x =\bigvee _{y,u,v}\delta ^{{{\,\mathrm{\textit{dom}}\,}}(\alpha )}_{s(x)}(u) \delta ^\alpha _x(v) [y\in uv]\delta _y =\bigvee _y{{\,\mathrm{\textit{dom}}\,}}(\alpha )\alpha [y \in s(x)x]\delta _y. \end{aligned}$$

(2)

$$\begin{aligned} {{\,\mathrm{\textit{Dom}}\,}}({{\,\mathrm{\textit{Dom}}\,}}(\delta ^\alpha _x)\delta ^\beta _y)&=\bigvee _z {{\,\mathrm{\textit{dom}}\,}}\left( \bigvee _{v,w}\delta ^{{{\,\mathrm{\textit{dom}}\,}}(\alpha )}_{s(x)}(v) \delta ^\beta _y(w)[z\in vw]\right) \delta _{s(z)}\\&=\bigvee _z {{\,\mathrm{\textit{dom}}\,}}({{\,\mathrm{\textit{dom}}\,}}(\alpha )\beta )[z\in s(x)y]) \delta _{s(z)}\\&=\bigvee _z{{\,\mathrm{\textit{dom}}\,}}({{\,\mathrm{\textit{dom}}\,}}(\alpha )\beta )[z\in s(s(x)y)]\delta _{s(z)}. \end{aligned}$$

The first step uses the law for \({{\,\mathrm{\textit{Dom}}\,}}\) and unfolds the definition of convolution. The second uses sup-preservation of \({{\,\mathrm{\textit{dom}}\,}}\) and simplifications based on \(\delta \). The third uses \(z=s(z)\) and that \(z\in s(x)y\) if and only if \(z=s(z)\in s(s(x)y)\).

(3) The following proof uses the law for \({{\,\mathrm{\textit{Dom}}\,}}\) and properties of \(\delta \).

$$\begin{aligned} {{\,\mathrm{\textit{Dom}}\,}}(\delta ^\alpha _x){{\,\mathrm{\textit{Dom}}\,}}(\delta ^\beta _y)&=\bigvee _{z,v,w} \delta ^{{{\,\mathrm{\textit{dom}}\,}}(\alpha )}_{s(x)}(v) \delta ^{{{\,\mathrm{\textit{dom}}\,}}(\beta )}_{s(y)}(w)[z\in vw]\delta _z\\&=\bigvee _z{{\,\mathrm{\textit{dom}}\,}}(\alpha ){{\,\mathrm{\textit{dom}}\,}}(\beta )[z\in s(x)s(y)]\delta _z. \end{aligned}$$

(4) The steps in the following proof should now be clear.

$$\begin{aligned} {{\,\mathrm{\textit{Dom}}\,}}\left( (\delta ^\alpha _x) {{\,\mathrm{\textit{Dom}}\,}}(\delta ^\beta _y)\right)&=\bigvee _z {{\,\mathrm{\textit{dom}}\,}}\left( \bigvee _{u,v}\delta ^\alpha _x(u)\delta ^{{{\,\mathrm{\textit{dom}}\,}}(\beta )}_{s(y)}(v)[z \in uv]\right) \delta _{s(z)}\\&=\bigvee _z {{\,\mathrm{\textit{dom}}\,}}(\alpha {{\,\mathrm{\textit{dom}}\,}}(\beta )[z \in xs(y)]) \delta _{s(z)}\\&= \bigvee _z{{\,\mathrm{\textit{dom}}\,}}(\alpha {{\,\mathrm{\textit{dom}}\,}}(\beta ))[ z \in s(xs(y))]\delta _{s(z)}. \end{aligned}$$

(5) And likewise in the next one:

$$\begin{aligned} Dom(\delta ^\alpha _x\delta ^\beta _y)&=\bigvee _z {{\,\mathrm{\textit{dom}}\,}}\left( \bigvee _{v,w}\delta ^\alpha _x(v) \delta ^\beta _y(w) [z\in vw]\right) \delta _{s(z)}\\&=\bigvee _z {{\,\mathrm{\textit{dom}}\,}}\left( \alpha \beta [z\in xy]\right) \delta _{s(z)}\\&= \bigvee _z{{\,\mathrm{\textit{dom}}\,}}(\alpha \beta )[z \in s(xy)]\delta _{s(z)}. \end{aligned}$$

(6) Proofs for \({{\,\mathrm{\textit{Cod}}\,}}\), \({{\,\mathrm{\textit{cod}}\,}}\) and \(t\) are dual. \(\square \)

The following statements add structure to Proposition 8.1(1). They expose the laws in Q and \(Q^X\) needed to derive the catoid axioms, with and without locality. The catoid structure comes from [5, Corollary 4.7] for relational semigroups together with Proposition 3.10, which translates it to catoids. Proving them requires mild assumptions on X and Q or \(Q^X\).

Proposition 8.3

Let \(Q^X\) and Q be quantales with \(1\ne \bot \) in Q. Then X is a catoid.

The catoid X is therefore completely determined by elements below \(\textit{id}_E\), more specifically, functions \(\delta _{s(x)}\) and their relations to the elements in X. We calculate the absorption law for \(s\) explicitly as an example of the technique used: with Lemma 8.2(1),

$$\begin{aligned} \delta _{x} = {{\,\mathrm{\textit{Dom}}\,}}(\delta _x)*\delta _x= \bigvee _y[y\in s(x)\odot x]\delta _y. \end{aligned}$$

Hence \(s(x)\odot x = \{x\}\) whenever the corresponding domain absorption law holds in \(Q^X\) and \(1\ne \bot \) in Q. The fact that \({{\,\mathrm{\textit{Dom}}\,}}\) appears in the calculation does not go beyond Proposition 8.3: \({{\,\mathrm{\textit{Dom}}\,}}(\delta _x) = \delta _{s(x)}\) is below \(\textit{id}_E\) in \(Q^X\).

The next statement adds locality to the picture.

Theorem 8.4

Let \(Q^X\) and Q be modal quantales, with \(1\ne \bot \) in Q. Then X is a local catoid.

Proof

It remains to consider locality. Lemma 8.2 yields

$$\begin{aligned} {{\,\mathrm{\textit{Dom}}\,}}(\delta _x *{{\,\mathrm{\textit{Dom}}\,}}\left( \delta _y)\right)&= \bigvee _z[z \in s(x\odot s(y))]\delta _{s(z)},\\ {{\,\mathrm{\textit{Dom}}\,}}(\delta _x *\delta _y)&= \bigvee _z[z \in s(x\odot y)]\delta _{s(z)}. \end{aligned}$$

So \({{\,\mathrm{\textit{Dom}}\,}}(\delta _x *{{\,\mathrm{\textit{Dom}}\,}}\left( \delta _y)\right) (z) ={{\,\mathrm{\textit{Dom}}\,}}(\delta _x *\delta _y)(z)\) implies \(s(x\odot s(y)) = s(x\odot y)\). \(\square \)

Finally, we turn to the correspondences from X and \(Q^X\) to Q. We first consider modal axioms in Q that do not depend on catoids. Similarly to the assumption that \(1\ne \bot \) in Q above, we need to assume the existence of certain elements in X.

Theorem 8.5

Let X be an \(st\)-multimagma in which there exist \(x,y,z,w\in X\), not necessarily distinct, such that \(s(x)\odot s(y)\ne \emptyset \) and \(z\odot w\ne \emptyset \), let Q be a prequantale and \(Q^X\) a modal prequantale such that \(\textit{id}_E\ne \bot \).

  1. (1)

    Then Q is a modal prequantale.

  2. (2)

    It is a weakly modal quantale if X is a catoid and \(Q^X\) a weakly local quantale.

  3. (3)

    It is a modal quantale if X is also local and \(Q^X\) a modal quantale.

Proof

By definition, \(\emptyset \ne E\subseteq X\). We verify the modal quantale axioms in Q, using in each case the corresponding axiom in X and \(Q^X\). Suppose X is an \(st\)-multimagma and \(Q^X\) a modal prequantale with \(\textit{id}_E\ne \bot \).

For domain absorption, using Lemma 8.2(1) with \(s(x)\odot x = \{x\}\),

$$\begin{aligned} {{\,\mathrm{\textit{dom}}\,}}(\alpha )\alpha = ({{\,\mathrm{\textit{Dom}}\,}}(\delta ^\alpha _x)*(\delta ^\alpha _x))(x) = \delta ^\alpha _{x}(x) =\alpha . \end{aligned}$$

For domain export, Lemma 8.2(2),(3) and hypothesis \(s(x)\odot s(y)\ne \emptyset \) yield \(z\in s(x)\odot s(y) = s(s(x)\odot y)\) for some z and therefore

$$\begin{aligned} {{\,\mathrm{\textit{dom}}\,}}({{\,\mathrm{\textit{dom}}\,}}(\alpha )\beta )&= {{\,\mathrm{\textit{Dom}}\,}}({{\,\mathrm{\textit{Dom}}\,}}(\delta ^\alpha _x)*\delta ^\beta _y)(z)\\&=({{\,\mathrm{\textit{Dom}}\,}}(\delta ^\alpha _x)*{{\,\mathrm{\textit{Dom}}\,}}(\delta ^\beta _y))(z)\\&= {{\,\mathrm{\textit{dom}}\,}}(\alpha )\cdot {{\,\mathrm{\textit{dom}}\,}}(\beta ). \end{aligned}$$

For the subidentity axiom, \({{\,\mathrm{\textit{dom}}\,}}(\alpha ) = {{\,\mathrm{\textit{Dom}}\,}}(\delta ^\alpha _{x})(s(x))\le \textit{id}_E(s(x)) = 1\) and for domain strictness, \({{\,\mathrm{\textit{dom}}\,}}(\bot ) ={{\,\mathrm{\textit{Dom}}\,}}(\delta ^\bot _x)(s(x))={{\,\mathrm{\textit{Dom}}\,}}(\bot )(s(x))=\bot \).

For binary sup-preservation of domain,

$$\begin{aligned} {{\,\mathrm{\textit{dom}}\,}}(\alpha \vee \beta )&={{\,\mathrm{\textit{Dom}}\,}}(\delta ^{\alpha \vee \beta }_x)(s(x))\\&={{\,\mathrm{\textit{Dom}}\,}}(\delta ^\alpha _x\vee \delta ^\beta _x)(s(x))\\&={{\,\mathrm{\textit{Dom}}\,}}(\delta ^\alpha _x)(s(x))\vee {{\,\mathrm{\textit{Dom}}\,}}(\delta ^\beta _x)(s(x))\\&= {{\,\mathrm{\textit{dom}}\,}}(\alpha )\vee {{\,\mathrm{\textit{dom}}\,}}(\beta ). \end{aligned}$$

For weak domain locality Lemma 8.2(5),(4) with hypothesis \(z \odot w \ne \emptyset \) yields \(x\in s(z\odot w) \subseteq s(z\odot s(w))\) for some x and therefore

$$\begin{aligned} {{\,\mathrm{\textit{dom}}\,}}(\alpha \beta )&= {{\,\mathrm{\textit{Dom}}\,}}(\delta ^\alpha _z*\delta ^\beta _w)(x)\\&\le {{\,\mathrm{\textit{Dom}}\,}}((\delta ^\alpha _z) *{{\,\mathrm{\textit{Dom}}\,}}(\delta ^\beta _w))(x)\\&= {{\,\mathrm{\textit{dom}}\,}}(\alpha {{\,\mathrm{\textit{dom}}\,}}(\beta )). \end{aligned}$$

For domain locality, replay the previous proof with identities, and for compatibility,

$$\begin{aligned} {{\,\mathrm{\textit{dom}}\,}}({{\,\mathrm{\textit{cod}}\,}}(\alpha )) = {{\,\mathrm{\textit{Dom}}\,}}({{\,\mathrm{\textit{Cod}}\,}}(\delta ^\alpha _x))(s(t(x))) = {{\,\mathrm{\textit{Cod}}\,}}(\delta ^\alpha _x)(t(x)) = {{\,\mathrm{\textit{cod}}\,}}(\alpha ). \end{aligned}$$

The remaining proofs follow by duality. \(\square \)

9 Examples

In this section we list additional examples of modal convolution quantales. We start with those related to categories.

Example 9.1

(Modal convolution quantales over path categories).

(1) A digraph K is a pair \(s, t: E\rightarrow V\) of source and target maps from a set E of edges into a set V of vertices. The path category on K has elements V as objects and sequences \(\pi = (v_1,e_1,v_2,\dots , v_{n-1},e_{n-1},v_n):v_1\rightarrow v_n\), in which vertices and edges alternate, as arrows. Composition (as usual, we reverse the order of the standard composition) \(\pi _1\cdot \pi _2\) of \(\pi _1:v_1\rightarrow v_2\) and \(\pi _2:v_3\rightarrow v_4\) is defined whenever \(v_2=v_3\), and it concatenates the two paths while gluing the common end. Sequences (v) of length 1, considered as paths of length 0, are identities. Path categories are local functional catoids with \(s(\pi )= (v_1)\) and \(t(\pi )=(v_n)\). By Theorem 7.1, the convolution algebra or category algebra over the path category of any digraph with values in Q is a modal quantale for any modal quantale Q. As paths are finitely decomposable, Q could be a modal semiring.

(2) A special path category is generated by the one-point digraph with n arrows, the free monoid with n generators. The \(st\)-structure and hence the modal structure is then trivial. Lifting along Theorem 7.1 yields the quantale or semiring of weighted languages.

(3) Forgetting edges yields paths modelled as lists of vertices. Lifting results transfer.

(4) Forgetting the internal structure of paths and keeping only their ends, brings us back to the pair groupoid and weighted binary relations. \(\square \)

In applications, paths could be execution sequences of programs, automata or transition systems. Sets of paths might model the behaviours of concurrent or distributed computing systems. Lifting along Theorem 6.4 constructs modal path quantales at powerset level; lifting along Theorem 7.1 the associated modal convolution quantales of Q-weighted paths. Once again, for finite paths, semirings suffice as weight algebras. Algebras of weighted paths are generally important for quantitative analyses of systems or the design of algorithms. The construction of the modal powerset quantale over the path category of a digraph has recently been extended to higher-dimensional modal Kleene algebras and higher-dimensional (poly)graphs [2], which applications in higher rewriting.

Example 9.2

(Modal incidence algebras over categories of segments). The arrows or pairs in poset categories, as in Example 2.2(4), represent (closed) segments of posets; those of linear orders represent (closed) intervals. By Theorem 6.4, for any modal quantale Q, the convolution algebra or category algebra over a poset category with values in Q forms a modal quantale.

Without the modal structure, such convolution quantales have been studied [12]. When the underlying total orders are locally finite, that is, all segments and intervals are finite (all arrows in the poset category are finitely decomposable), values can be taken in (semi)rings and the convolution algebras become incidence algebras à la Rota [36]. The general setting supports algebraic generalisations of duration calculi [12, 41]. It specialises to interval and interval temporal logics [24, 33] for powerset liftings. The additional modal structure enriches algebras for reasoning about states as well as intervals and supports mixed modalities over weighted intervals and their endpoints. This, and applications to weighted and probabilistic interval temporal logics and duration calculi, remains to be explored. \(\square \)

Our next example considers catoids that arise from composing digraphs, but we specialise to finite posets. We show how locality can be obtained by introducing interfaces.

Example 9.3

(Weighted poset languages).

(1) Finite posets form functional catoids (based on classes) with respect to serial composition, which is the disjoint union of posets with all elements of the first poset preceding that of the second one in the order of composition. This yields partial monoids with the empty poset as unit and hence functional catois in which \(s\) and \(t\) map every poset to the empty poset. The algebra is thus not local and does not form a category. The convolution algebras are therefore weakly local quantales, but the modal structure is trivial as \({{\,\mathrm{\textit{Dom}}\,}}\) and \({{\,\mathrm{\textit{Cod}}\,}}\) map the empty poset to \(\bot \) and any other element to \(\textit{id}_{\{1\}}\). The powerset lifting yields poset languages.

(2) The points of finite posets can be labelled with letters from some alphabet. Equivalence classes of such labelled posets can be taken with respect to the isomorphism that preserves the order and labels, but forgets the names of nodes. This leads to partial words [22], also called pomsets in concurrency theory. The serial composition becomes total on equivalence classes, making the resulting catoid a monoid and hence a category.

(3) Winkowski has equipped finite pomsets with interfaces [40]. The source interface of a pomset consists of all its minimal elements (with their labels); its target interface of all its maximal elements (again with their labels). Pomsets with interfaces form a functional catoid with \(s\) mapping every pomset to its source interface, \(t\) mapping every poset to its target interface. Composition glues pomsets on their interfaces whenever they match, the order is extended as in the previous example. The functional catoid of such pomsets with interfaces is local and thus a category. Winkowski also defines a parallel composition that turns pomsets with interfaces into a partial monoidal category (parallel composition is a partial tensor). \(\square \)

Winkowski’s pomsets with interfaces have been generalised to posets in which interfaces may be arbitrary subsets of minimal or maximal elements of posets [16]. Our lifting results extend to the resulting categories. Digraphs with interfaces can alternatively be composed by juxtaposing these objects and then making interface nodes disappear in the composition. This yields again categories, yet with different units given by identity relations [18, 28]. The usual liftings apply. In all these examples one considers an additional operation of parallel composition, which is simply the coproduct of posets or digraphs. For these, the powerset lifting yields standard models of concurrency.

The next example lifts a local \(st\)-multimagma to a modal prequantale.

Example 9.4

(Weighted path languages in topology).

(1) A path on set X is a map \(f:[0,1]\rightarrow X\), where one usually assumes that X is a topological space and f continuous. The source of path f is \(s(f)=f(0)\), its target \(t(f)=f(1)\). Two paths f and g in X can be composed whenever \(t(f)=f (1) = g (0)=s(g)\), and then

$$\begin{aligned} (f\cdot g) (x) = {\left\{ \begin{array}{ll} f (2x) &{} \text { if } 0\le x\le \frac{1}{2},\\ g(2x-1) &{} \text { if } \frac{1}{2}\le x\le 1. \end{array}\right. } \end{aligned}$$

The parameterisation destroys associativity of composition. Consequently, \((X^{[0,1]},\cdot ,s,t)\) is only a functional \(st\)-multimagma. The lifting to \({\mathcal {P}}(X^{[0,1]})\) satisfies the properties of Lemma 6.2, but even weak locality fails due to the absence of associativity in \(X^{[0,1]}\) and, accordingly, \({\mathcal {P}}(X^{[0,1]})\). The same failure occurs when lifting to a convolution quantale \(Q^{X^{[0,1]}}\) along Theorem 7.1: associativity of the modal (pre)quantale Q of weights makes no difference; the convolution algebra forms merely a modal prequantale whenever Q does.

(2) Path composition is of course associative up-to homotopy. The associated local functional catoid can then be lifted to a modal convolution quantale like any other category. Associativity can also be enforced by considering paths up-to reparametrisation equivalence [17].

(3) Alternatively, categories of Moore paths can be defined on intervals of arbitrary length [1]. A path is then a (continuous) map \(f:[0,n]\rightarrow X\) and, writing |f| instead of n and likewise,

$$\begin{aligned} (f\cdot g) (x) = {\left\{ \begin{array}{ll} f (x) &{} \text { if } 0\le x\le |f|,\\ g (x-|f|) &{} \text { if } |f|\le x\le |f|+|g|. \end{array}\right. } \end{aligned}$$

Lifting along Theorem 6.4 now yields modal convolution quantales appropriate, for instance, for interval temporal logics [33] or durational calculi [41] for hybrid or continuous dynamical systems (paths could correspond to trajectories for initial value problems for vector fields or systems of differential equations). Lifting along Theorem 7.1 might yield algebraic models of weighted, probabilistic or stochastic systems with continuous dynamics. \(\square \)

Example 9.5

(\(\Delta \)-sets). A presimplicial set [37] K is a sequence of sets \((K_n)_{n\ge 0}\) equipped with face maps \(d_i:K_n\rightarrow K_{n-1}\), \(i\in \{0,\dotsc ,n\}\), satisfying the simplicial identities \(d_i\circ d_j=d_{j-1}\circ d_i\) for all \(i<j\). Elements of \(K_n\) are n-simplices. Presimplicial sets generalise digraphs: \(K_0\), \(K_1\) are the sets of vertices and edges of a digraph, respectively; \(d_0,d_1:K_1\rightarrow K_0\) are the source and target maps. Higher simplices represent compositions of edges. For edges \(x,y\in X_1\), for example, a 2-simplex \(z\in K_2\) with \(d_2(z)=x\) and \(d_0(z)=y\) reflects the fact that the edge \(d_1(z)\) is a composition of x and y. For given x and y there may be many such 2-simplices z, or none at all.

There are several ways of constructing a catoid from a presimplicial set K [14]. For \(0\le i\le n\) and \(x\in K_n\), let

$$\begin{aligned} s_i(x)=(d_{i+1}\circ d_{i+2}\circ \dots \circ d_{n})(x)\quad \text { and }\quad t_i(x)=(d_{0}\circ d_{1}\circ \dots \circ d_{n-i-1})(x). \end{aligned}$$

By definition, \(s_i(x),t_i(x)\in K_i\). The coproduct of simplices \(K=\bigsqcup _{n\ge 0} K_n\) forms a graded catoid \((K, \odot ,s,t)\) with \(x\in y\odot z\) if and only if \(y=s_i(x)\) and \(z=t_{n-i}(x)\) for some i and \(s(x)=s_0(x)\), \(t(x)=t_0(x)\). Associativity follows from the relationship \(t_j(s_i(x))=s_j ( t_k(x))\) that holds for all \(x\in X_n\) and \(0\le i,j,k\le n\) such that \(i+k=n+j\).

In general, the graded catoid \((K,\odot )\) is neither local nor functional. These properties hold if K is the nerve of a category C (we omit degeneracies). In this case, elements of \(K_n\) are sequences of morphisms

$$\begin{aligned} x=(c_0 \xrightarrow {\alpha _1} c_1\xrightarrow {\alpha _2} \cdots \xrightarrow {\alpha _n} c_n) \end{aligned}$$

with \(s(x)=(c_0)\) and \(t(x)=(c_n)\), while \(\odot \) is sequence concatenation. \(\square \)

Example 9.6

(Precubical sets). A precubical set X [23, 39] is a sequence of sets \((X_n)_{n\ge 0}\) equipped with face maps \(d^\varepsilon _{i}:X_n\rightarrow X_{n-1}\), \(1\le i\le n\), \(\varepsilon \in \{0,1\}\), satisfying the identities \(d^\varepsilon _i\circ d^\eta _j = d^\eta _{j-1}\circ d^\varepsilon _i\) for \(i<j\) and \(\varepsilon ,\eta \in \{0,1\}\). Like presimplicial sets, precubical sets generalise digraphs: \(X_0\) and \(X_1\) may be regarded as sets of vertices and edges, respectively, and \(d^0_1,d^1_1:X_1\rightarrow X_0\) as source and target maps. Higher cells represent homotopies between paths. A square \(x\in X_2\), for example, reflects the fact that the paths \((d^0_1(x),d^1_2(x))\) and \((d^0_1(x),d^1_1(x))\) are homotopic.

For a subset \(A=\{a_1<\cdots<a_k\}\subseteq [n]=\{1<\dots <n\}\), \(n>0\) and \(\varepsilon \in \{0,1\}\), define the iterated face map \(d^\varepsilon _A:X_n\rightarrow X_{n-|A|}\) as \(d^\varepsilon _A(x)=d^\varepsilon _{a_1}\circ \cdots \circ d^\varepsilon _{a_k}(x)\). The precubical set X then forms catoid \((X,\odot ,s,t)\) where

$$\begin{aligned} x\in y\odot z \Leftrightarrow \exists A\subseteq [n].\ y=d^0_A(x) \wedge z=d^1_{[n]\setminus A}(x) \end{aligned}$$

and \(s(x)=d^0_{[n]}(x)\in X_0\), \(t(x)=d^1_{[n]}(x)\in X_0\) for all \(x\in X_n\). Like in the previous example, the catoid X is neither local nor functional.

A special case of this example is the shuffle multimonoid from Example 2.2. Let \(\Sigma \) be a finite alphabet, \(X_n\) the set of all words of length n, and \(d^\varepsilon _i:X_n\rightarrow X_{n-1}\) the map that removes the i–th letter. Then \(X=(X_n,d^\varepsilon _i)\) is a precubical set and the associated catoid \((X,\odot ,s,t)\) is the shuffle multimonoid on \(\Sigma \). There is only one unit—the empty word—and the catoid is finitely decomposable. Correspondences for Q-weighted shuffle languages are discussed in [5]. The \({{\,\mathrm{\textit{dom}}\,}}\)/\({{\,\mathrm{\textit{cod}}\,}}\)-structure of the convolution algebra is trivial. \(\square \)

Our final example is a weakly local modal convolution quantale.

Example 9.7

(Weighted assertions in separation logic). Lifting the non-local functional catoid of heaplets along Theorem 7.1 yields a weakly local modal quantale as the convolution algebra, yet with trivial modal structure as the empty heaplet is the only unit [11] and there are no elements between \(\emptyset \) and \(\{\varepsilon \}\). This models weighted assertions of separation logic, including fuzzy or probabilistic ones. \(\square \)

10 Quantitative modal algebras

The domain and codomain operations yield modal diamond and box operators on the convolution algebra, as usual for modal semirings [8]. Many properties of such semirings translate automatically to quantales, and additional ones hold. Forward and backward modal diamond operators can be defined in a modal quantale Q, as on any modal semiring, for \(\alpha ,\beta \in Q\):

$$\begin{aligned} |\alpha \rangle \beta = {{\,\mathrm{\textit{dom}}\,}}(\alpha \beta )\qquad \text { and }\qquad \langle \alpha | \beta = {{\,\mathrm{\textit{cod}}\,}}(\beta \alpha ). \end{aligned}$$

They are related by opposition and the following conjugation [8].

Lemma 10.1

In every modal quantale Q, for all \(\alpha \in Q\) and \(\rho ,\sigma \in Q_{{{\,\mathrm{\textit{dom}}\,}}}\),

$$\begin{aligned} \rho \cdot |\alpha \rangle \sigma = \bot \Leftrightarrow \langle \alpha |\rho \cdot \sigma =\bot . \end{aligned}$$

Proof

\(\rho \cdot |\alpha \rangle \sigma = \bot \Leftrightarrow \rho {{\,\mathrm{\textit{dom}}\,}}(\alpha \sigma ) = \bot \Leftrightarrow \rho \alpha \sigma = \bot \Leftrightarrow {{\,\mathrm{\textit{cod}}\,}}(\rho \alpha )\sigma = \bot \Leftrightarrow \langle \alpha |\rho \cdot \sigma = \bot \). \(\square \)

The laws \({{\,\mathrm{\textit{cod}}\,}}(\alpha )\beta = \bot \Leftrightarrow \alpha \beta = \bot \Leftrightarrow \alpha {{\,\mathrm{\textit{dom}}\,}}(\beta )=\bot \) used in this proof hold in any modal quantale as \({{\,\mathrm{\textit{dom}}\,}}(\alpha )=\bot \Leftrightarrow \alpha =\bot \Leftrightarrow {{\,\mathrm{\textit{cod}}\,}}(\alpha )=\bot \) and by locality [8]. We have seen similar ones in Lemma 3.9, Section 3.

Another consequence of locality is that \(|\alpha \rangle \beta = |\alpha \rangle {{\,\mathrm{\textit{dom}}\,}}(\beta )\), so that \(\beta \) is automatically a domain element. We henceforth indicate this by writing \(|\alpha \rangle \rho \) for \(\rho \in Q_{{{\,\mathrm{\textit{dom}}\,}}}\). Further, locality of \(s\) and \(t\) is equivalent to \(|\alpha \beta \rangle = |\alpha \rangle \circ |\beta \rangle \) and \(\langle \alpha \beta | = \langle \beta |\circ \langle \alpha |\), which are standard properties standard of modal logics. Without locality, only inequalities hold.

Lemma 10.2

In any modal quantale Q, the operators \(|\alpha \rangle \) and \(\langle \alpha |\) preserve arbitrary sups in \(Q_{{{\,\mathrm{\textit{dom}}\,}}}\), for all \(\alpha \in Q\).

Proof

The \({{\,\mathrm{\textit{dom}}\,}}\) and \({{\,\mathrm{\textit{cod}}\,}}\) operations preserve all sups in the complete lattice \(Q_{{{\,\mathrm{\textit{dom}}\,}}}\) ( \(=Q_{{{\,\mathrm{\textit{cod}}\,}}}\)) [15]. Thus diamonds preserve all sups, too: for all \(P\subseteq Q_{{{\,\mathrm{\textit{dom}}\,}}}\),

$$\begin{aligned} |\alpha \rangle \big (\bigvee P\big )&= {{\,\mathrm{\textit{dom}}\,}}\big (\alpha \cdot \big (\bigvee P\big )\big ) = {{\,\mathrm{\textit{dom}}\,}}\big (\bigvee \{\alpha \rho \mid \rho \in P\}\big )\\&= \bigvee \{{{\,\mathrm{\textit{dom}}\,}}(\alpha \rho )\mid \rho \in P\} = \bigvee \{|\alpha \rangle \rho \mid \rho \in P\}. \end{aligned}$$

Sup preservation of \(\langle \alpha |\) follows by duality. \(\square \)

Remark 10.3

In modal semirings, diamonds are strict and preserve finite sups: \(|\alpha \rangle \bot = \bot =\langle \alpha |\bot \), \(|\alpha \rangle (\rho \vee \sigma ) = |\alpha \rangle \rho \vee |\alpha \rangle \sigma \) and \(\langle \alpha |(\rho \vee \sigma ) = \langle \alpha |\rho \vee \langle \alpha |\sigma \) (using quantale notation with \(\vee \) in place of \(+\) and \(\bot \) in place of 0).

Modal quantales admit box operators due to sup-preservation.

Proposition 10.4

In any modal quantale Q, the operators \(|\alpha \rangle \) and \(\langle \alpha |\) have right adjoints in \(Q_{{{\,\mathrm{\textit{dom}}\,}}}\):

$$\begin{aligned}{}[\alpha |\rho = \bigvee \{\sigma \mid |\alpha \rangle \sigma \le \rho \}\qquad \text { and }\qquad |\alpha ]\rho = \bigvee \{\sigma \mid \langle \alpha |\sigma \le \rho \}. \end{aligned}$$

These satisfy \(|\alpha \rangle \rho \le \sigma \Leftrightarrow \rho \le [\alpha |\sigma \) and \( \langle \alpha |\rho \le \sigma \Leftrightarrow \rho \le |\alpha ]\sigma \).

Proof

The diamonds \(|\alpha \rangle \) and \(\langle \alpha |\) preserve all sups by Lemma 10.2 and hence have right adjoints (by the adjoint functor theorem), defined as above. \(\square \)

It follows that \(|\alpha \beta ] = |\alpha ]\circ |\beta ]\), because, for all \(\sigma \in Q_{{{\,\mathrm{\textit{dom}}\,}}}\),

$$\begin{aligned} \sigma \le |\alpha \beta ]\rho \Leftrightarrow \langle \alpha \beta |\sigma \le \rho \Leftrightarrow \langle \beta |\langle \alpha |\sigma \le \rho \Leftrightarrow \langle \alpha |\sigma \le |\beta ]\rho \Leftrightarrow \sigma \le |\alpha ]|\beta ]\rho , \end{aligned}$$

and dually \([\alpha \beta | = [\beta |\circ [\alpha |\).

The following lemma relates boxes and diamonds with laws that do not mention modalities.

Lemma 10.5

In every modal quantale,

$$\begin{aligned} |\alpha \rangle \rho \le \sigma&\Leftrightarrow \alpha \rho \le \sigma \alpha ,&\qquad \langle \alpha |\rho \le \sigma&\Leftrightarrow \rho \alpha \le \alpha \sigma ,\\ \rho \le |\alpha ]\sigma&\Leftrightarrow \rho \alpha \le \alpha \sigma ,&\rho \le [\alpha |\sigma&\Leftrightarrow \alpha \rho \le \sigma \alpha . \end{aligned}$$

Proof

We consider only the first law. The others follow from duality and the adjunctions. First, suppose \(|\alpha \rangle \rho \le \sigma \), that is, \({{\,\mathrm{\textit{dom}}\,}}(\alpha \rho )\le \sigma \). Then \(\alpha \rho ={{\,\mathrm{\textit{dom}}\,}}(\alpha \rho )\alpha \rho \le \sigma \alpha \rho \le \sigma \alpha \). For the converse direction, suppose \(\alpha \rho \le \sigma \alpha \). Then \({{\,\mathrm{\textit{dom}}\,}}(\alpha \rho ) \le {{\,\mathrm{\textit{dom}}\,}}(\sigma \alpha ) = \sigma {{\,\mathrm{\textit{dom}}\,}}(\alpha ) \le \sigma \). \(\square \)

Therefore, \(|\alpha ]\sigma = \bigvee \{\rho \mid \rho \alpha \le \alpha \sigma \}\) and \([\alpha |\sigma =\bigvee \{\rho \mid \alpha \rho \le \sigma \alpha \}\), and the diamond operators, as left adjoints, satisfy \(|\alpha \rangle \rho = \bigwedge \{\sigma \mid \alpha \rho \le \sigma \alpha \}\) and \(\langle \alpha |\rho =\bigwedge \{\sigma \mid \rho \alpha \le \alpha \sigma \}\).

In any boolean modal semiring and therefore any boolean modal quantale, the following De Morgan duality relates boxes and diamonds [8], where \(\rho '\) is the complement of \(\rho \) in \(Q_{{{\,\mathrm{\textit{dom}}\,}}}\) as before.

Lemma 10.6

In any boolean modal quantale, \(|\alpha ]\rho = (|\alpha \rangle \rho ')'\), \([\alpha |\rho =(\langle \alpha |\rho ')'\).

Proof

\(|\alpha \rangle \rho \le \sigma \Leftrightarrow |\alpha \rangle \rho \cdot \sigma ' = \bot \Leftrightarrow \rho \cdot \langle \alpha | \sigma ' = \bot \Leftrightarrow \rho \le (\langle \alpha | \sigma ')'\), hence \((\langle \alpha | \sigma ')'=[\alpha |\rho \). The proof for \(|\alpha ]\) follows by opposition. \(\square \)

In boolean modal semirings and quantales, we therefore obtain conjugation laws for boxes as for diamonds.

Lemma 10.7

In every boolean modal quantale, \(\rho \vee |\alpha ] \sigma = 1 \Leftrightarrow [\alpha |\sigma \vee \rho = 1\).

Proof

Straightforward from De Morgan duality. \(\square \)

While the De Morgan dualities do not depend on locality, the conjugations and adjunctions require these laws.

Remark 10.8

When the catoid X is finitely decomposable, one can use boolean modal semirings, that is, boolean monoids equipped with the usual domain axioms, in the lifting. Boolean monoids are essentially boolean quantales in which only finite sups and infs are assumed and required to be preserved, including empty ones. It follows that, if X is a finitely decomposable local catoid and Q a boolean modal semiring, then \(Q^X\) is a boolean modal semiring.

Next, we consider the modal operators in the convolution quantales \(Q^X\) and relate them with similar properties in X and Q. For diamonds,

$$\begin{aligned} (|f\rangle g)(x) = \bigvee _{x \in s(y\odot z)} |f(y)\rangle g(z)\qquad \text { and }\qquad (\langle f| g)(x) = \bigvee _{x\in t(z\odot y)} \langle f(y)| g(z), \end{aligned}$$

and as upper adjoints are lower adjoints in the dual lattice,

$$\begin{aligned} (|f] g)(x) = \bigwedge _{x \in s(y\odot z)} |f(y)] g(z)\qquad \text { and }\qquad ([f| g)(x) = \bigwedge _{x\in t(z\odot y)} [f(y)| g(z). \end{aligned}$$

Using locality \(s(x\odot y) = s(x\odot s(y))\) and likewise for \(t\) makes these identities slightly longer, but more symmetric. Alternatively, we can write

$$\begin{aligned} |f\rangle g = \bigvee _{x,y,z\in X} |f(y)\rangle g(z) \cdot [x\in s(y\odot z)] \cdot \delta _x. \end{aligned}$$

The shape of the laws for the remaining boxes and diamonds is then obvious.

Example 10.9

(Modal operators in powerset quantales).

(1) In the modal powerset quantale over the path category from Example 9.1, elements are sets of paths. Domain elements are formed by the source elements in the set, codomain elements by its target elements. Both are vertices as paths of length 0. Thus, for any set of paths A and set of vertices \(P\subseteq V\),

$$\begin{aligned} |A\rangle P=\{ (v)\in V\mid \exists \pi \in A.\ (v) = s(\pi ) \wedge t(\pi )\in P\} \end{aligned}$$

is the set of all vertices in V from which one may reach a vertex in P along some path in A. Dually, \(\langle A|P\) models the set of all vertices in V that one may reach from a vertex in P along some path in A. Moreover,

$$\begin{aligned} |A] P=\{ (v)\in V\mid \forall \pi \in A.\ (v) = s(\pi ) \Rightarrow t(\pi ) \in P\} \end{aligned}$$

models the set of all vertices from which one must reach a vertex in P along all paths in A, and [A|P the set of vertices one must reach from a vertex in P along all paths in A. The shape of the modal operators in algebras of continuous paths in Example 9.4 is similar.

(2) The modal operators in the modal powerset quantale on the pair groupoid, the quantale of binary relations, are the standard ones with respect to Kripke semantics. Up to isomorphism between predicates and subidentity relations,

$$\begin{aligned} |R\rangle P =\{a\mid \exists b.\ (a,b)\in R \wedge P(b)\}, \qquad |R]P =\{a\mid \forall b. \ (a,b)\in R \Rightarrow P(b) \}, \end{aligned}$$

for binary relation R and predicate P, and likewise for \(\langle R|P\) and [R|P. \(\square \)

Similar constructions apply to the other powerset algebras over catoids outlined in Section 9. Working out details is routine.

Example 10.10

(Modal operators in convolution quantales).

(1) For weighted relations, the forward diamond is

$$\begin{aligned} \left( |f\rangle \bigvee _c\delta ^{g(c,c)}_{(c,c)}\right) ((a,b)) = \bigvee _c|f(a,c)\rangle g(c,c)\cdot \delta _a(b). \end{aligned}$$

For finite relations we obtain matrices. In the \(2\times 2\) case, for instance,

$$\begin{aligned} \left| \begin{pmatrix} \alpha _{11} &{} \alpha _{12}\\ \alpha _{21} &{} \alpha _{22} \end{pmatrix} \right\rangle \begin{pmatrix} \beta _{11} &{} \bot \\ \bot &{} \beta _{22} \end{pmatrix}&={{\,\mathrm{\textit{Dom}}\,}}\left( \begin{pmatrix} \alpha _{11}\beta _{11} &{} \alpha _{12} \beta _{22}\\ \alpha _{21}\beta _{11} &{} \alpha _{22}\beta _{22} \end{pmatrix} \right) \\&= \begin{pmatrix} |\alpha _{11}\rangle \beta _{11} \vee |\alpha _{12} \rangle \beta _{22} &{}\bot \\ \bot &{} |\alpha _{21}\rangle \beta _{11} \vee |\alpha _{22}\rangle \beta _{22} \end{pmatrix}. \end{aligned}$$

The other modalities satisfy similar laws. The diagonal matrices are isomorphic to vectors and the computation performed corresponds to a linear transformation of a vector, except for the diamonds on the diagonal.

(2) In the modal quantale of weighted paths,

$$\begin{aligned} \left( |f\rangle \bigvee _{v\in V}\delta ^{g(v)}_{v}\right) (x)= \bigvee _v|f(v)\rangle g(t(v))\cdot \delta _{s(v)}(x). \end{aligned}$$

For finite graphs, \(\delta ^{{{\,\mathrm{\textit{dom}}\,}}(g(v))}_v\) can again be seen as a diagonal matrix or vector of weighted vertices, and f(x) as a matrix labelling pairs of vertices with the set of weights of the (hom-set) of paths between them. Multiplications with \(\delta ^{{{\,\mathrm{\textit{dom}}\,}}(g(v))}_v\) then project on the paths with targets in v. Taking the diamond yields the supremum of the weights of all paths that end in a vertex in v. \(\square \)

From a linear algebra point of view, the occurrences of \({{\,\mathrm{\textit{dom}}\,}}\) or \({{\,\mathrm{\textit{cod}}\,}}\) in the computations of weights are irritating. Yet the correspondence results in Sections 7 and 8 show that the condition that Q be a modal quantale cannot be weakened. The approach is thus too restrictive, for instance, for deriving probabilistic predicate transformer semantics where states and relations carry more general weights. In the probabilistic quantale from Example 4.8, in particular, it is easy to check that \(Q_s= \{0,1\}\), which precludes any assignment of non-trivial weights to states of a system.

Predicate transformers, however, are more general than modal Kleene algebras: they are order-, sup- or inf-preserving maps between (complete) lattices. The absorption laws \({{\,\mathrm{\textit{dom}}\,}}(\alpha )\cdot \alpha = \alpha \) and \(\alpha \cdot {{\,\mathrm{\textit{cod}}\,}}(\alpha )=\alpha \) seem irrelevant for them. Only an action on weighted relations is needed beyond properties like sup-preservation. This is given by domain and codomain locality, as discussed at the beginning of this section. Locality lifts from X to \(Q^X\) even if Q is only a quantale. To explain this, we redefine domain on \(Q^X\),

$$\begin{aligned} {{\,\mathrm{\textit{Dom}}\,}}(f)(x) = \bigvee _{y\in X} f(y)\cdot \delta _{s(y)}(x), \end{aligned}$$

using f(y) instead of \({{\,\mathrm{\textit{dom}}\,}}(f(y))\), and likewise for \({{\,\mathrm{\textit{Cod}}\,}}\). Then, for locality in \(Q^X\) and Q merely a quantale,

$$\begin{aligned} ({{\,\mathrm{\textit{Dom}}\,}}(f *g))(v)&= \bigvee _{x,y,z}f(y) g(z) [x\in y\odot z] \delta _{s(x)}(v)\\&= \bigvee _{y,z} f(y)g(z) [v\in s(y\odot z)] \delta _{s(x)}(v)\\&=\bigvee _{y,z}f(y)g(z) [v\in s(y\odot s(z))] \delta _{s(x)}(v)\\&=\bigvee _{x,y,z}f(y) \left( \bigvee _wg(w) \delta _{s(w)}(z)\right) [x\in y\odot z]\delta _{s(x)}(v)\\&= {{\,\mathrm{\textit{Dom}}\,}}(f *{{\,\mathrm{\textit{Dom}}\,}}(g))(v), \end{aligned}$$

replaying part (6) the proof of Theorem 7.1. The first step unfolds the revised definition for \({{\,\mathrm{\textit{Dom}}\,}}\) and convolution. The second uses \(v=s(x)\) and the fact that \(x\in y\odot z\) if and only if \(s(x)=v\in s(y\odot z)\). The third applies locality of \(s\). The fourth, like its counterpart in part (6) of the proof of Theorem 7.1, brings g(z) in shape for the last step of the proof. The proof for \({{\,\mathrm{\textit{Cod}}\,}}\) is dual, as usual. Domain export lifts in the same way:

$$\begin{aligned} ({{\,\mathrm{\textit{Dom}}\,}}({{\,\mathrm{\textit{Dom}}\,}}(f) *g))(v)&= \bigvee _{x,y,z}\left( \bigvee _w f(w) \delta _{s(w)}(y)\right) g(z) [x\in y\odot z]\delta _{s(x)}(v)\\&=\bigvee _{z,w} f(w) g(z) [v\in s(s(w)\odot z)]\\&=\bigvee _{z,w} f(w) g(z) [v\in s(w)\odot s(z)]\\&=({{\,\mathrm{\textit{Dom}}\,}}(f)*{{\,\mathrm{\textit{Dom}}\,}}(g))(v), \end{aligned}$$

and again the proof for codomain export, with Q being merely a quantale, is dual. But it is easy to check that absorption laws can no longer be lifted.

Example 10.11

(Generalised modal operators in convolution quantales). Defining forward and backward diamonds as before in the quantale of weighted relations, but using the revised domain definition, yields

$$\begin{aligned} \left( |f\rangle \bigvee _c\delta ^{g(c,c)}_{(c,c)}\right) ((a,b)) = \bigvee _c f(a,c) \cdot g(c,c)\cdot \delta _a(b). \end{aligned}$$

The shape of the backward diamond is then obvious by duality. In the matrix case, our previous example now reduces to

$$\begin{aligned} \left| \begin{pmatrix} \alpha _{11} &{} \alpha _{12}\\ \alpha _{21} &{} \alpha _{22} \end{pmatrix} \right\rangle \begin{pmatrix} \beta _{11} &{} \bot \\ \bot &{} \beta _{22} \end{pmatrix}&= \begin{pmatrix} \alpha _{11}\beta _{11} \vee \alpha _{12} \beta _{22} &{}\bot \\ \bot &{} \alpha _{21}\beta _{11} \vee \alpha _{22}\beta _{22} \end{pmatrix}. \end{aligned}$$

This has the right form for stochastic matrices and probabilistic predicate transformers, using the probabilistic quantale from Example 4.8. \(\square \)

We have checked with Isabelle that, without absorption laws, domain elements still form a subalgebra and that commutativity lifts whenever Q is abelian. (The proofs are routine. We have not added them to the Isabelle repository, as theories from another repository (Archive of Formal Proofs) need to be downloaded to make them compile.) Idempotency of domain elements does not lift, which is consistent with the fact that multiplication of diagonal matrices is not in general idempotent. This is appropriate for vector spaces and similar structures. Developing the “modal” algebras of such approaches and exploring applications is left for future work.

11 Conclusion

We have introduced catoids and used them to obtain a triangle of equational correspondences between them, modal value quantales and quantale-valued modal convolution quantales, explaining in particular the origin of locality in axiomatisations of domain semirings and quantales in terms of the composition pattern for categories. Our results yield a generic construction recipe for modal quantales: one gets such quantales for free as soon as the much simpler underlying local catoid has been found. The relevance of this approach has been illustrated by a list of examples from mathematics and computing.

We finish with directions for future work: In combination with previous work on concurrent relational monoids and concurrent quantales [5], it seems interesting to build models for non-interleaving concurrent systems based on po(m)sets and graphs with interfaces and lift them to modal concurrent semirings and quantales. Along similar lines it seems possible to define higher-dimensional globular catoids as generalisations of 2-categories and prove correspondence results with respect to the higher globular Kleene algebras introduced for higher rewriting [2]. Ultimately, this should lead to \(\omega \)-catoids as generalisations of \(\omega \)-categories and the corresponding \(\omega \)-quantales, which would share features of modal and concurrent quantales, in combination with axioms for globular structure.

Further, the relevance of the weakened domain and codomain quantales of Section 10 for the verification of quantitative computing systems, in particular stochastic and probabilistic ones, remains to be explored.

We also aim at a categorification of the approach in terms of monoidal categories with Day convolution. While this adds generality, we have chosen a simpler algebraic approach in this work with a view on software verification applications with proof assistants like Isabelle, where reasoning with monoidal categories, coends or coherence conditions seems currently unwieldy. Relational monoids, catoids and the construction of convolution quantales have already been formalised with Isabelle [9]; Isabelle verification components for separation logic use a less general approach with partial abelian monoids and generalised effect algebras instead of catoids [10].

Last, but not least, Jónsson-Tarski duality should be related to the convolution algebra setting and the role of the weight algebras should be explained.