Monads and Quantitative Equational Theories for Nondeterminism and Probability

The monad of convex sets of probability distributions is a well-known tool for modelling the combination of nondeterministic and probabilistic computational effects. In this work we lift this monad from the category of sets to the category of metric spaces, by means of the Hausdorff and Kantorovich metric liftings. Our main result is the presentation of this lifted monad in terms of the quantitative equational theory of convex semilattices, using the framework of quantitative algebras recently introduced by Mardare, Panangaden and Plotkin.


Introduction
In the theory of programming languages the categorical concept of monad is used to handle computational effects [43,44].As main examples, the powerset monad (P) and the probability distribution monad (D) are used to handle nondeterministic and probabilistic behaviours, respectively.It is of course desirable to handle the combination of these two effects to model, for instance, concurrent randomised protocols where nondeterminism arises from the action of an unpredictable scheduler and probability from the use of randomised procedures such as coin tosses.However, the composite functor P • D is not a monad (see, e.g., [52]).
A well-known way to handle this technical issue is to use instead the convex powerset of distributions monad (C) which restricts P•D by only admitting sets of probability distributions that are closed under the formation of convex combinations (see [50,29,28,42,41,33,39] and Section 2).Restricting P • D to C is not only mathematically convenient, because it leads to a monad, but also natural as convexity captures the possibility of a scheduler to make probabilistic choices, as originally observed by Segala [46].Suppose indeed that a scheduler can select between two probabilistic behaviours {d 1 , d 2 } for execution.It is reasonable to assume that said scheduler can also, with the aid of a (biased) coin, choose d 1 with probability p and d 2 with probability 1 − p.Hence, effectively, the scheduler can choose any behaviour in {p In a recent work [13] the authors provide a proof for the following result: the equational theory Th CS of convex semilattices is a presentation of the Set monad C.This means (see Section 2 for details) that the category A(Th CS ) of convex semilattices and their homomorphisms is isomorphic to the category EM(C) of Eilenberg-Moore algebras for C.
Presentation results of this kind have a number of applications in computer science due to the interplay between the structure (syntax) and the dynamics (behaviour) of systems.For example, it follows from the presentation result of [13] that the free convex semilattice with set of generators X is isomorphic to C(X).This allows us to manipulate elements of C(X) as convex semilattice terms modulo the equations of Th CS and, similarly, to perform equational reasoning steps using facts (e.g., from geometry) related to the mathematical structure of C(X).Applications in the field of program semantics and concurrency theory arise by combining coalgebraic reasoning methods, associated with the use of monads as behaviour functors, and algebraic methods, which are made available by presentation theorems.Well known examples include bisimulation up-to techniques (e.g., up-to congruence [11]) and the categorical approach to structural operational semantics, introduced by Turi and Plotkin in [51] (see also [35]) and based on the notion of bialgebras.
The category EMet, having extended metric spaces as objects and non-expansive maps as morphisms, is a natural mathematical setting 1 which can replace the category Set when it is desirable to switch from the concept of program equivalence to that of program distance.This has been a very active topic of research in the last two decades (see, e.g, [45,27,15,23,16]).In this context, it is necessary to deal with monads on EMet.Variants of the Set monads P and D have been proposed on EMet (see, e.g., [15,8] and Section 3), and are technically based on different types of metric liftings, due to Hausdorff and Kantorovich.

Contributions of this work.
In this work we investigate a EMet variant of the Set monad C, which we denote by Ĉ.As a functor, Ĉ : EMet → EMet maps a metric space (X, d) to the metric space (C(X), HK(d)), the collection of non-empty, finitely generated convex sets of finitely supported probability distributions on X endowed with the metric H(K(d)), the Hausdorff lifting of the Kantorovich lifting of the metric d.
As a first contribution, in Section 4 we give a direct proof of the fact that Ĉ is indeed a monad on EMet.This result does not seem straightforward to prove.Most notably, establishing the non-expansiveness of the monad multiplication µ Ĉ requires some detailed calculations.
Our second and main result concerns the presentation of the EMet monad Ĉ. Presentations of monads in Set are given in terms of categories of algebras (in the sense of universal algebra) and their homomorphisms, but these are not adequate in the metric setting.For this reason we use, instead, the recently introduced apparatus of quantitative algebras and quantitative equational theories of [36] (see also [37,7,5,4]).This framework generalises that of universal algebra and equational reasoning by dealing with quantitative algebras, which are metric spaces equipped with non-expansive operations over a signature, and quantitative equations of the form s = t, intuitively expressing that the distance between terms s and t is less than or equal to .In Section 4 we define the quantitative equational theory QTh CS of quantitative convex semilattices, and in Section 5 we prove the presentation result (Theorem 36): the category EM( Ĉ) of Eilenberg-Moore algebras for Ĉ is isomorphic to the category QA(QTh CS ) of quantitative convex semilattices and their non-expansive homomorphims.
Relation with other works.This work continues the research path opened in the seminal [36] (see also subsequent works [37,7,5,4]) where the authors investigated the connection between the quantitative theories of semilattices (QTh SL ) and convex algebras (QTh CA ) and the monads P and D, which are EMet variants of P and D, respectively.Hence, our work constitutes a natural step forward.From a technical standpoint, there is a difference between our main presentation result and those of [36] regarding QTh SL and QTh CA (corollaries 9.4 and 10.6 respectively in [36]).Indeed, in [36] the authors only provide representations of the free objects in the categories QA(QTh SL ) and QA(QTh CA ).While this suffices in many applications, we believe that proving a full presentation, in the sense introduced and investigated in this work, provides a more general and useful result, giving a representation for the whole categorical structure and not just for free objects.This said, the technical machinery developed in [36] suffices, with minor additional work2 , to establish the following presentation results in our sense: QA(QTh SL ) ∼ = EM( P) and QA(QTh CA ) ∼ = EM( D).

Monads on Sets and Equational Theories
In this section we present basic definitions and results regarding monads.We assume the reader is familiar with the basic concepts of category theory (see [3] as a reference).We now introduce three relevant monads on the category Set of sets and functions.Definition 2. The non-empty finite powerset monad (P, η P , µ P ) on Set is defined as follows.Given an object X in Set, P(X) = {X ⊆ X | X = ∅ and X is finite}.Given an arrow f : X → Y , P(f ) : P(X) → P(Y ) is defined as P(f )(X ) = x∈X f (x) for any X ∈ P(X).The unit η P X : X → P(X) is defined as η P X (x) = {x}, and the multiplication µ P X : PP(X) → P(X) is defined as µ A probability distribution on a set X is a function ∆ : X → [0, 1] such that x∈X ∆(x) = 1.The support of ∆ is defined as the set supp(∆) = {x ∈ X | ∆(x) = 0}.In this paper we only consider probability distributions with finite support which we often just refer to as distributions.The Dirac distribution δ(x) is defined as δ(x)(x ) = 1 if x = x and δ(x)(x ) = 0 otherwise.We often denote a distribution having supp(∆) = {x 1 , x 2 } using the expression p 1 x 1 + p 2 x 2 , with p i = ∆(x i ).Analogously, we let n i=1 p i x i denote a distribution ∆ with support {x 1 , . . ., x n } and with p i = ∆(x i ).
Remark 4. Given elements ∆ 1 , . . ., ∆ n ∈ D(X), the expression n i=1 p i ∆ i denotes an element in DD(X).The set D(X) can be seen as a convex subset of the real vector space R X , so in order to avoid confusion with the notation n i=1 p i ∆ i we will use the following dot-notation n i=1 p i • ∆ i to denote convex combinations of distributions: We say that a convex set S ⊆ D(X) is finitely generated if there exists a finite set S ⊆ D(X) (i.e., S ∈ PD(X)) such that S = cc(S ).Given a finitely generated convex set S ⊆ D(X), there exists one minimal (with respect to the inclusion order) finite set UB(S) ∈ PD(X) such that S = cc(UB(S)).The finite set UB(S) is referred to as the unique base of S (see, e.g., [14]).The distributions in UB(S) are convex-linear independent, i.e., if Definition 5.The finitely generated non-empty convex powerset of distributions monad (C, η C , µ C ) on Set is defined as follows.Given an object X in Set, C(X) is the collection of non-empty finitely generated convex sets of finitely supported probability distributions on , where, for any ∆ ∈ DC(X) of the form

Equational Theories and Monad Presentations
An important concept regarding monads is that of algebras for a monad.Definition 6.Let (M : C → C, η, µ) be a monad.An algebra for M is a pair (A, h) where A ∈ C is an object and h : The category of Eilenberg-Moore algebras for M, denoted by EM(M), has M-algebras as objects and M-morphisms as arrows.
The definitions above are purely categorical and, as a consequence, the category EM(M) is sometimes hard to work with as an abstract entity.It is therefore very useful when EM(M) can be proven isomorphic to a category whose objects and morphisms are well-known and understood.This leads to the concept of presentation of a monad.Before introducing it, we recall some basic definitions of universal algebra (see [17] for a standard introduction).

Definition 7.
A signature Σ is a set of function symbols each having its own finite arity.We denote with T (X, Σ) the set of terms built from a set of generators X with the function symbols of Σ.An equational theory Th of type Σ is a set Th ⊆ T (X, Σ) × T (X, Σ) of equations between terms T (X, Σ) closed under deducibility in the logical apparatus of equational logic.Given a set E ⊆ T (X, Σ) × T (X, Σ) of equations, the theory induced by E is the smallest equational theory containing E. The models of a theory Th are Σ-algebras of the theory Th, i.e., structures (A, {f A } f ∈Σ ) consisting of a set A and operations f A : A ar(f ) → A, for each operation symbol f ∈ Σ having arity ar(f ), satisfying all (universally quantified) equations in , for all f ∈ Σ.We denote with A(Th) the category whose objects are models of the theory Th and morphisms are homomorphisms.In what follows we introduce equational theories that are presentations of the three Set monads P, D and C introduced earlier.

One Application: Representation of Term Algebras
Having presentations of Set monads as categories of algebras of equational theories is mathematically convenient for several reasons.One useful application, especially in the field of program semantics, are representation theorems for free algebras, which are, up to isomorphism, term algebras.
In this section we assume the reader to be familiar with the concept of free object in a category (see, e.g., [3, §10.3]).The free object generated by X in the category EM(M) is the M-algebra (M(X), µ M X ).The free object generated by X in the category A(Th) is the term algebra, i.e., the algebra whose carrier is T (X, Σ) /Th , the set of Σ-terms constructed from the set of generators X taken modulo the equations of the theory Th, and with operations defined on equivalences classes, that is, f for each f ∈ Σ.These characterisations, together with the fact that free objects are unique up to isomorphism, can be used to derive the following result.In other words, a presentation theorem for M provides automatically representation results for term algebras via the known semantic behaviour of the multiplication of M.
Example 14.The presentation of the monad C in terms of the theory of convex semilattices implies that the free convex semilattice generated by X is isomorphic with the convex semilattice (CX, ⊕, + p ) where S 1 ⊕S 2 = cc(S 1 ∪S 2 ) (convex union) and S 1 + p S 2 = WMS(pS 1 +(1−p)S 2 ) (weighted Minkowski sum), for all S 1 , S 2 ∈ C(X).In other words, the set T (X, Σ CS ) /Th CS of convex semilattice terms modulo the equational theory of convex semilattices can be identified with the set C(X) of finitely generated convex sets of finitely supported probability distributions on X.The isomorphism is explicitly given in [14] by the function x)] /Th CS , where i∈I x i and + i∈I p i x are respectively notations for the binary operations ⊕ and + p exten- ded to operations of arity I, for I finite (see, e.g., [47,12]).We remark that the equation x ⊕ y = x ⊕ y ⊕ (x + p y), which explicitly expresses closure under taking convex combinations, is derivable from the theory of convex semilattices (see, e.g., [14,Lemma 14]), and that this derivation critically uses the distributivity axiom (D).

Monads on Met and Quantitative Equational Theories
In Section 2 we have considered monads in the category Set.We now shift our focus to monads in the category EMet of extended metric spaces and non-expansive functions.The category EMet provides a natural mathematical setting for developing the semantics of programs exhibiting quantitative behaviour such as, e.g., probabilistic choice.It is indeed appropriate in this setting to replace the usual notion of program equivalence with the more informative notion of program distance (see, e.g., [45,27,15,23,16]).

Definition 15.
An extended metric space is a pair (X, d) such that X is a set and d : X × X → R ≥0 ∪ {∞} is a function, called the metric, satisfying the following properties: d(x, y) = 0 if and only if x = y, d(x, y) = d(y, x), and d(x, y) ≤ d(x, z) + d(z, y), for all x, y, z ∈ X.A function f : X → Y between two extended metric spaces (X, d X ) and (Y, We denote with EMet the category whose objects are extended metric spaces and whose morphisms are non-expansive maps. Since we only work with extended metric spaces, in the rest of this paper we will systematically omit the adjective "extended".Given two metrics d 1 , d 2 on X, we write d 1 d 2 if for all x, x ∈ X, it holds that d 1 (x, x ) ≤ d 2 (x, x ).Let (Y, d) be a metric space, X a set and f : X → Y .We write d f, f for the metric on X defined as its open covers has a finite subcover.Every compact set Y is closed and bounded (i.e., the distance between elements in Y is bounded by some real number).The collection of non-empty compact subsets of a metric space (X, d) is denoted by Comp(X, d).Note that every finite subset of X belongs to Comp(X, d).
The Set monads P and D defined in Section 2 can be extended to monads in EMet.These extensions are well-known and are based on metric liftings constructions due to Hausdorff and Kantorovich (see [34] for a standard reference).
Definition 16 (Hausdorff Lifting).Let (X, d) be a metric space.The Hausdorff lifting of d is a metric H(d) on Comp(X, d), the collection of non-empty compact subsets of X, defined as follows for any pair X 1 , X 2 ∈ Comp(X, d): This leads to the well-known hyperspace monad V on EMet ( [31], see also [34]).3Definition 17.The hyperspace monad (V, η V , µ V ) on EMet is defined as follows.Given an object (X, d) in EMet, V(X, d) = Comp(X, d), H(d) , the metric space of non-empty compact subsets of X equipped with the Hausdorff distance.Given a non-expansive map The restriction of the monad V to finite (hence compact) subsets leads to the non-empty finite powerset monad on EMet, which we denote with P to distinguish it from the Set monad P. Definition 18.The non-empty finite powerset monad ( P, η P , µ P ) on EMet is defined as follows.Given an object (X, d) in EMet, P(X, d) = P(X), H(d) , the collection of finite non-empty subsets of X equipped with the Hausdorff distance.The action of P on morphisms, the unit η P and the multiplication µ P are defined as for the Set monad P (or, equivalently, as for the V monad on EMet restricted to finite sets).
Next, we introduce the Kantorovich lifting on finitely supported distributions [34].
Definition 19 (Kantorovich Lifting).Let (X, d) be a metric space.The Kantorovich lifting of d is a metric K(d) on D(X), the collection of finitely supported probability distributions on X, defined as follows for any pair ∆ 1 , ∆ 2 ∈ D(X): where Coup(∆ 1 , ∆ 2 ) is defined as the collection of couplings of ∆ 1 and ∆ 2 , i.e., the collection of probability distributions on the product space X × X such that the marginals of ω are ∆ 1 and ∆ 2 .Formally, where π 1 : X 1 × X 2 → X 1 and π 2 : X 1 × X 2 → X 2 are the projection functions.
We can now introduce the following version of the finitely supported probability distribution monad on EMet, which we denote with D to distinguish it from the Set monad D. The fact that the above definitions are correct (i.e., that D is a functor and that η D and µ D are non-expansive and satisfy the monad laws) is well-known (see, e.g., [34,15,8]).

Quantitative Equational Theories and Quantitative Algebras
We provide here the essential definitions and results of the framework developed by Mardare, Panangaden, and Plotkin in [36] (see also [7,37,5,38]).In what follows, a signature Σ is fixed.Recall that T (X, Σ) denotes the set of terms constructed from X using the function symbols in Σ.A substitution is a map of type σ : X → T (X, Σ).As usual, to any interpretation ι : X → A of the variables into a set corresponds, by homomorphic extension, a unique map ι : T (X, Σ) → A.
Definition 21 (Quantitative Equational Theory).A quantitative equation is an expression of the form t = s, where t, s ∈ T (X, Σ) and ∈ R ≥0 .We denote with E(Σ) the collection of all quantitative equations.We use the letters Γ, Θ to range over subsets of E(Σ).A quantitative inference is an element of 2 E(Σ) × E(Σ), i.e., a pair (Γ, t = s) where Γ ⊆ E(Σ) and t = s is a quantitative equation.Note that Γ needs not be finite.A deducibility relation is a set of quantitative inferences ⊆ 2 E(Σ) × E(Σ) closed under the following conditions which are stated for arbitrary s, t, u ∈ T (X, Σ), , ∈ R ≥0 , Γ, Θ ⊆ E(Σ), and f ∈ Σ: (Notation: we use the infix notation Γ t = s to mean that (Γ, t = s) ∈ ) where in (Cut) the expression Γ Θ means that for all (t = s) ∈ Θ it holds that Γ t = s.Given a set of quantitative inferences U ⊆ 2 E(Σ) × E(Σ), the quantitative equational theory induced by U is the smallest deducibility relation which includes U.
The models of quantitative theories are quantitative algebras, which we now introduce.d A where (A, d A ) is an extended metric space and, for each f ∈ Σ, the function f A : A ar(f ) → A is a non-expansive map, with A ar(f ) endowed with the sup-metric defined as

homomorphism between quantitative algebras A and B of type Σ is a non-expansive function g
which preserves all operations in Σ, i.e., g(f A (x 1 , . . ., x n )) = f B (g(x 1 ), . . ., g(x n )), for all x i ∈ A. We say that A satisfies a quantitative inference We say that A is a model of a quantitative theory QTh if A satisfies every quantitative inference in QTh.We denote with QA(QTh) the category having as objects the quantitative algebras that are models of QTh, and as arrows the non-expansive homomorphisms between quantitative algebras of type Σ.
Every quantitative algebra of type Σ satisfies the quantitative inferences generating the deducibility relation in Definition 21.We refer to [36] for proofs that all the above definitions are indeed well-defined.Two interesting quantitative theories studied in [36] are the following. 4efinition 23 (Quantitative Semilattices).The quantitative theory of quantitative semilattices, denoted by QTh SL , has type Σ SL (see Definition 9) and is induced by the following quantitative inferences, for all 1 , 2 ∈ R ≥0 : Definition 24 (Quantitative Convex Algebras).The quantitative theory of quantitative convex algebras, denoted by QTh CA , has type Σ CA (see Definition 10) and is induced by the following quantitative inferences, for all p, q ∈ (0, 1) and 1 , 2 ∈ R ≥0 : In other words, the theories QTh SL and QTh CA are obtained by taking the equational axioms of semilattices and convex algebras respectively (Definitions 9 and 10), replacing the equality (=) with (= 0 ), and by introducing the quantitative inferences (H) and (K) respectively.A general result from [36, §5] states that free objects always exist in QA(QTh), for any QTh, and they are isomorphic to term quantitative algebras for QTh.Moreover, such free objects are concretely identified for two relevant theories: Theorem 25 ([36, Cor 9.4 and 10.6]).The following hold: The free quantitative semilattice in QA(QTh SL ) generated by a metric space (X, d) is isomorphic to the metric space P(X, d) = P(X), H(d) .The free quantitative convex algebra in QA(QTh CA ) generated by a metric space (X, d) is isomorphic to the metric space D(X, d) = D(X), K(d) .
We remark that the above theorem from [36] falls short from a full presentation result stating the isomorphisms of categories QA(QTh SL ) ∼ = EM( P) and QA(QTh CA ) ∼ = EM( D).This latter more general statement does indeed hold and can be obtained, with some minor extra work, from the technical machinery developed in [36] (see Footnote 2).

4
The Monad Ĉ on the Category of Metric Spaces In this section we introduce a EMet version of the Set monad C, and we denote it with Ĉ.The monad Ĉ is obtained by composing the Hausdorff lifting H and the Kantorovich lifting K introduced in the previous section.
Corollary 27 implies that, given a metric space (X, d), the collection C(X) of finitely generated non-empty convex sets of distributions on X can be endowed with the subspace metric of V( D(X, d)), and therefore (C(X), HK(d)) is a metric space, with HK(d) = H(K(d)).This observation leads to the following definition.

C O N C U R 2 0 2 0
The rest of this section is devoted to the proof that the above definition is well-specified, i.e., that Ĉ is indeed a monad on EMet.First, one needs to verify that Ĉ is a functor on EMet.This follows immediately from the definition, Corollary 27, and C being a functor on Set.It then remains to verify that the unit η Ĉ and the multiplication µ Ĉ of Ĉ are indeed morphisms in EMet (i.e., they are non-expansive functions) and that they satisfy the monad laws of Definition 1.The fact that the laws are satisfied follows directly from the definitions µ Ĉ = µ C and η Ĉ = η C and the fact that C is a monad on Set (hence µ C and η C satisfy the monad laws).Then it only remains to verify that η Ĉ and µ Ĉ are non-expansive.It is straightforward to verify that η Ĉ is an isometric (hence non-expansive) embedding of (X, d) into C(X), HK(d) .Proving that µ Ĉ is non-expansive, instead, does not seem straightforward and requires some detailed calculations.We state this result as a theorem.

Sketch of the Proof of Theorem 29
The key result to prove is Lemma 32, stating that the weighted Minkowski sum function WMS is non-expansive.This is obtained by exploiting a key property of the HK metric (see Lemma 31) called convexity.It might well be that both these results have already appeared in the literature in some form or another or are known as folklore by specialists.We present here a direct proof.
It is well known that the Kantorovich metric K(d) is convex.The following lemma states that also the Hausdorff-Kantorovich metric HK(d), defined on the collection C(X) of non-empty finitely generated convex sets of distributions, which carries the structure of a convex semilattice (see Example 14) and thus also of a convex algebra, is convex.Lemma 31.Let (X, d) be a metric space.The metric HK(d) on the convex algebra (C(X), {+ p } p∈(0,1) ), with S 1 + p S 2 = WMS(pS 1 + (1 − p)S 2 ), is convex.
Using the convexity of HK it is possible to prove that the WMS function is non-expansive.Lastly, we state the following two useful properties of the Hausdorff lifting.
Proof of Theorem 29.We need to show that HK(d) µ Ĉ , µ Ĉ

HKHK(d).
Since V is a monad on EMet (Definition 17), µ V is non-expansive, i.e., H(d) µ V , µ V HH(d).By applying this to the metric K(d), we derive Proof.For arbitrary x 1 , x 2 , y 1 , y 2 ∈ X, assume d(x 1 , y 1 ) ≤ 1 and d(x 2 , y 2 ) ≤ 2 .Then Hence F is well-defined on objects.It remains to verify that F is well defined on morphisms.Let f : ((X, d), α) → ((Y, d ), β) be a morphism in EM( Ĉ).We need to verify that F(f ) is a morphisms in QA(QTh CS ), i.e., a non-expansive homomorphism of convex semilattices (see Definition 22).Since by definition F(f ) = f , the function F(f ) is nonexpansive.It remains to verify that it is a homomorphism.This proof has no specific metric-theoretic content and we omit it here.

The functor G
).Also, recall from Example 14 that there is an isomorphism κ mapping elements of C(X) to equivalence classes of convex semilattice terms in T (X, Σ CS ) /Th CS .Let us define ν : C(X) → T (X, Σ CS ) as a choice function, mapping each S ∈ C(X) to one representative of the equivalence class κ(S).This allows us to uniquely write down each S ∈ C(X) as a convex semilattice term: With abuse of notation, we have used the letter X to range both over a set of variables and the carrier of A. By interpreting each variable x with the corresponding element x ∈ X of A, and by homomorphic extension, we get that each term t ∈ T (X, Σ CS ) can be interpreted as an element t A of A, and in particular (ν(S)) A denotes an element of A for each S ∈ C(X).
Definition 43 (Functor G).We specify G : QA(QTh CS ) → EM( Ĉ) as follows: on objects A = (X, Σ A CS , d), we define G(A) = ((X, d), α), with α : (C(X), HK(d)) → (X, d) defined as: α(S) = (ν(S)) A , on morphisms (i.e., non-expansive homomorphisms) we define G(f ) = f .In order to prove that G is well-defined on objects, we have to show that indeed ((X, d), α) is an Eilenberg-Moore algebra for Ĉ, which amounts to proving the following lemma.The following technical lemma is critically used in the proof of Lemma 44(2) above.Note that its statement is purely syntactic as it deals with derivability in the deductive apparatus of quantitative equational theories (Definition 21).

Lemma 44. Let
we have G • F(f ) = f = F • G(f ).Hence the identities trivially hold true.The proofs regarding the identities on objects require only routine verifications, unfolding definitions, not involving any specific metric-theoretic content and therefore we omit them here.

Conclusions
We have introduced the EMet monad Ĉ of finitely generated non-empty convex sets of distributions equipped with the Hausdorff-Kantorovich distance, and we have proved that Ĉ is presented by the quantitative equational theory QTh CS of quantitative convex semilattices.This result provides the basis for a foundational understanding of equational reasoning about program distances in processes combining nondeterminism and probabilities, as in bisimulation and trace metrics [22,25,26,49,6,18].This opens several directions for future research.
For instance, one interesting line of research is to examine the axiomatizations of bisimulation equivalences and metrics for nondeterministic and probabilistic programs (or process algebras) that have been proposed in the literature [40,9,21,1,2,20].The quantitative equational framework of quantitative convex semilattices provides a novel tool for comparing and further developing the existing works.
It is also important to explore variants of the EMet monad Ĉ such as, for instance, the one that also includes the empty set.These are needed to model program observations such as termination.Following the ideas presented in [13], these variants can be explored via the lift monad (• + 1) and its quotients described by equational theories over the signature of convex semilattices extended with a new constant symbol.A systematic study of these quotients is a promising direction for future work.Applications to up-to techniques for bisimulation metrics [19,10] could then be pursued as well.
Lastly, it is natural to ask if the monad Ĉ, and its presentation, can be obtained as a general categorical composition of the hyperspace monad V and the distribution monad D. Recently, Goy and Petrisan [30] have used the notion of weak distributive law to provide a positive answer for the corresponding monads in the category Set.Investigating whether this machinery is also applicable to the category EMet is an interesting topic for future work.

Definition 1 .
Given a category C, a monad on C is a triple (M, η, µ) composed of a functor M : C → C together with two natural transformations: a unit η : id ⇒ M, where id is the identity functor on C, and a multiplication µ : M 2 ⇒ M, satisfying the two laws µ • ηM = µ • Mη = id and µ • Mµ = µ • µM.

Definition 3 .
The finitely supported probability distribution monad (D, η D , µ D ) on Set is defined as follows.For objects X in Set, D(X) = {∆ | ∆ is a finitely supported probability distribution on X}.For arrows f : X → Y in Set, D(f ) : D(X) → D(Y ) is defined as

Definition 8 (
Presentation of Set monads).Let M be a monad on Set.A presentation of M is an equational theory Th such that the categories EM(M) and A(Th) are isomorphic.

1 . 2 . 3 .
The theory Th SL of semilattices is a presentation of P, i.e., A(Th SL ) ∼ = EM(P).The theory Th CA of convex algebras is a presentation of D, i.e., A(Th CA ) ∼ = EM(D).The theory Th CS of convex semilattices is a presentation of C, i.e., A(Th CS ) ∼ = EM(C).

Proposition 13 . 6
Let M be a monad on Set and let F : A(Th) ∼ = EM(M) be a presentation of M in terms of the equational theory Th of type Σ.Then the term algebra T (X, Σ) /Th and the free Eilenberg-Moore algebra (M(X), µ M X ) are isomorphic (via F ).C O N C U R 2 0 2 028:Monads and Quantitative Equational Theories for Nondeterminism and Probability The metric d of a metric space (X, d) induces a topology on X whose open sets are generated by the open balls of the form B

Definition 20 .
The finitely supported probability distribution monad ( D, η D , µ D ) on EMet is defined as follows.Given an object (X, d) in EMet, D(X, d) = D(X), K(d) , the collection of finitely supported probability distributions on X equipped with the Kantorovich distance.The action of D on morphisms, the unit η D , and the multiplication µ D are defined as for the Set monad D.