 I'm Valeria New-Delhi and I'm going to talk about monads and quantitative equation theories for non-determinism and probabilities. The results I'm going to present are based on collaborations with Matteo Mille, Moitfilippo Bonchi and Anna Skolva. We are interested in programs that combine together non-determinism and probabilities. And you can see here an example of such a program using a transition system semantics. And as you can see here we have a state x that can non-deterministically choose between two different transitions. And these transitions actually reach probability distributions over states. If we take the left hand transition we have a probability distribution assigning probability one-half to x1 and probability one-half to x2 and with the right hand transition we reach x3 with probability one-third and x4 with probability two-thirds. So we represent the combination of non-determinism and probabilities via transitions that reach sets of probability distributions. And the fundamental problem in program semantics is verifying whether two programs are equivalent. And when we have two programs that have probabilistic information we can actually have a final look at program equivalence and talk about program distances. As you can see here we'll have two programs and the second one has a possibly small variation given by epsilon in the probabilities. And in this case we would like to say that the two programs are not just not equivalent but they are at the given distance possibly bounded by epsilon. And so this means that we want to talk about matrix or distances on sets of probability distributions. Moreover since we're talking about computational effects such as non-determinism, probabilities and their combination we want to model these computational effects using monads and also exploit the correspondence between monads and equation on theories. And when we study program distances this means talking about monads on metric spaces and quantitative equation on theories. So in this talk I will try to tell you about all this by focusing in particular on the case when we have programs combining on determinism and probabilities. So let me start by recalling monads and their correspondence with equation on theories. When we have a monad in the category of sets so given by a fun to reunite and multiplication we sometimes can find a corresponding equation on theory defined in the usual sense of universal algebra so given by a signature and a set of axioms. And formally this means that the equation on theory gives a presentation of the monad that is to say that we have an isomorphism of categories between on one side the category of i-lember more algebras for the monad which is a category of algebras defined in categorical terms and on the other side the category of algebras or models in the usual sense of universal algebra of the equation on theory. And when we have such a presentation and so such an isomorphism we can derive interesting results such as fact for instance that given a generating set x the set of elements given by the monad over x is actually isomorphic to the set of terms induced by x and the signature of the equation of theory modulo the axioms of the equation of theory. But let me give you some example and let's start from the case when the computational effect we are considering is non determinism. And as you can see here when we have an deterministic program we have transitions that reach sets of states for instance here x reaches the set of states given by x1 and x2. And indeed we can model this computational effect using the power set monad which assigns to a set x the set of non-empty finite subsets of x. And we have an equation of theory which is a presentation of the power set monad and it is the equation of theory of similarities. This theory has one binary operation this non deterministic plus representing union of sets and as axioms associativity commutativity and idempotency for this operation. Another example is given by probabilities so when we have a probabilistic system we have transition reaches probability distributions over states and indeed we can model this computational effect using the distribution monad which assigns to a set x the set of probability distributions on x which are finitely supported so that assign a non-zero probability only to a finite number of elements of x. And again we have a corresponding equation of theory so an equation of theory representing this monad which is the equation of theory of convex algebras. This theory has infinitely many binary operations as signature this plus p for any p strictly in zero one which denote distribution assigning p to the left hand side and y minus p to the right hand side. And as axiom we have the probabilistic versions of associativity commutativity and idempotencies for for these binary operations. And now the question is what happens when we want to combine together non determinism and probabilities so what is the monad that we have and what is an equation of theory for reasoning about non determinism and probability? Well to answer this let's go back to our example so as we said when we have programs combining non determinism and probabilities we have transitions which is sets of probability distributions but we have a weather problem here because the combination of powerset monad and the distribution monad which would indeed give us sets of probability distribution is not itself a monad. This is a well known result from Baraka's PhD thesis and we have a weather solution which is to use convex sets of probability distributions. Indeed as we'll see this gives us a monad. A set of probability distributions is convex if whenever we have two probability distributions in the set then the set also contains the convex combination of such distributions meaning that it contains also all distribution assigning probability p to the first one and probability y minus p to the second one. And considering convex sets it's not just interesting from a theoretical point of view because it gives us a monad but it's also interesting from a concrete point of view since it accounts for probabilistic schedulers. So the idea that a scheduler that chooses between different non deterministic transitions can also choose to probabilistically combine such transitions. So as we said when we take convex sets of probability distributions we have a monad. The monad of convex sets of probability distributions has a functor associating to a set x the set containing all the sets of finitely support probability distribution over x that are non-empty, convex closed so that closed under convex combinations of such probability distributions and finitely generated meaning that such convex sets can always be obtained as convex combinations of only a finite number of probability distributions. As a unit of this monad we have function assigned x the singleton containing the probability distribution assigning 1 to x and as a multiplication we have a function that takes a set delta 1 delta n of probability distributions over convex sets and returns the union of the weighted Minkowski sum of such probability distributions. And the weighted Minkowski sum is a well known operation which given a distribution over convex sets returns the set of distributions that are given by choosing an arbitrary element for each of these convex sets and then weighting it with a weight given by distribution in the set. And now that we have a monad combining the determinism and probabilities we can wonder what is the equation of theory corresponding to this monad and for the monad of convex sets of distributions we indeed have an equation of theory representing the monad which is the theory of convex similarities. This theory has a signature the signature of similarities so then on the deterministic plus and the signature of convex algorithms so all these probabilistic pluses and as axioms as the axiom of similarities the axioms of convex algebras and the distributivity axiom which basically tells us how the probabilistic plus distributes over the deterministic plus and which allows us indeed to derive convexity and the presentation of this monad using convex similarities was proven in recent work with Filippo Bonke and Anna Sokolova and we have applied it to verifying trace equivalents of label transition systems combining non-determinism and probabilities. But now we want to move as we said from program equivalences to program distances and for doing so we needed to move from monads on sets to monads on metric spaces. So first we are moving from the category of sets to the category map of metric spaces which is the category having as objects metric spaces so pairs given by a set and a distance on pairs of elements of a set and having as morphisms functions between such metric spaces that are non-expansive that is to say functions on the sets which do not increase the distances and now when we have a monad in the category of sets we can try to lift it to a monad in the category of metric spaces and when we do so we will have a functor that associates a metric space xd here to the metric space having a set the set of elements given by the monad over x and then as a distance the distance obtained by lifting in some way the original distance d to the set of elements of the monad over x and then as a unit and multiplication we can use the same unit and multiplication of the monad in sets but we have to prove that they are non-expansive and if we can do so we have lifted the monad from sets to map and indeed this is something that we can do for the monad of convex sets of distribution if we take the monad of convex sets of distributions in set we can lift it to a monad on metric spaces by defining a functor associating to a metric space xd the metric space having a set the set of convex sets of distributions over x and as a distance between such convex sets of distributions the house of lifting of the contour of each lifting of the original distance d what does this mean well we start from some distance d between the elements of x and then when we have probability distributions over such elements we can lift the distance d to a distance between probability distribution using the Cantorovich lifting so the Cantorovich lifting of the distance gives us a distance between probability distributions and then when we have a set of such probability distribution we can use the house of lifting to compare such sets and so the house of lifting of the Cantorovich lifting of the distance gives us a distance between sets of probability distribution and here it's actually important that such sets of probability distributions are convex and finitely generated as this gives us compact max which is needed in order to apply the house of lifting and so this is the way we define the functor of our monad in met and then we have the unit and the multiplication which are defined as for the monad of convex sets of distribution in set but that we have to prove to be non-expansive and indeed that this is what we have explored in recent work together with Matteo. And now that we have a monad on metric spaces we can try to reason equationally about this monad and to do so we can use quantitative equation of theories. The framework of quantitative equation of theories is a framework recently introduced by Mardare, Palangadan and Plotkin which allows us to move from equation to quantitative equations so equations between terms that now are endowed with some quantity epsilon that denotes that the two terms are a distance at most epsilon. Then we have quantitative inferences which tell us how given some distances between variables we can derive distances in terms possibly containing such variables and so given a signature and a set of quantitative inferences we have a quantitative equation of theory and from a semantic point of view the models of this quantitative equation of theories are quantitative algebras that is algebras endowed the metric and satisfying the quantitative inferences in the theory. And formally we have that quantitative equation of theory is a presentation of a monad on metric spaces if we have an isomorphism again between the category of Eilembermuir algebra for the monad and the category of quantitative algebras or models for the quantitative equation of theory. And now we can study specific quantitative equation of theories that present monad on metric spaces we are interested in and indeed if we take the monad of convex sets of probability distributions on metric spaces we have a presentation given by a quantitative equation of theory of convex similarities which is the theory that has the signature of convex similarities so then on the terministic plus and the probabilistic plus and as quantitative inferences we have first of all the axioms of convex similarities where an axiom is now embedded in the quantitative equation of theory by transforming it into the quantitative axiom assigning distance zero to the terms. And then we have two inference rules the first inference rule is a quantitative inference that was already known from the word Mardare, Panangad and Plotkin to correspond to the house of lifting somehow and this rule tells us that whenever we have some distances between terms and we compose the terms using the non-deterministic plus then the distance of the composed terms is at most the maximal distance between the variables and the second rule is again a rule that was already known to correspond to the counter-ovic lifting and that tells us that whenever we have some distances between variables and we compose the probability distributions over such variables then the distances between such probability distributions is bounded by the convex combinations of the distances of the variables with using the same weights. So we have proved that the quantitative equation of theory of convex similarities is a presentation of the monotone convex sets of distributions on metric spaces. As a corollary of this presentation by looking at three algebras we obtain a representation result which tells us that if we take the metric space having a set the set of convex sets of distributions over x and as a distance the house of lifting of the counter-ovic lifting of the distance well this is actually isomorphic to taking the set of terms of the signature of convex similarities modulating the axioms of convex similarities and as a distance the distance given by the quantitative equation theory that is to say the distance assigned to any pair of terms or to any pair of representatives of the equivalence classes the minimal distance that we can derive in the theory between such terms and so this gives us a way to reason equationally about programs combining on determinism and probabilities and about metrics on such programs. Well I hope you enjoyed this talk and thank you very much for listening.