# John Baez Convex spaces and an operadic approach to entropy

## Idea

This is a draft of a paper by John Baez, Tobias Fritz and Tom Leinster, based on work that can be found here:

Rényi presents a nice characterization of Shannon entropy due to Fadeev. With only some minor cosmetic changes we can state it as follows.

We may think of a probability measure on a finite set $X$ as a function $p:X\to \left[0,1\right]$ such that ${\sum }_{i\in X}p\left(i\right)=1$. The Shannon entropy of $p$ is

$S\left(p\right)=-\sum _{i\in X}p\left(i\right)\phantom{\rule{thinmathspace}{0ex}}\mathrm{ln}p\left(i\right)$S(p) = -\sum_{i \in X} p(i) \, \ln p(i)

It is convenient to write a probability measure on the set $\left\{1,\dots ,n\right\}$ as an $n$-tuple $p=\left({p}_{1},\dots ,{p}_{n}\right)$.

###### Theorem

(Fadeev) Suppose $F$ is a map sending any probability measure on any finite set to a nonnegative real number. Suppose that:

1. $F$ is invariant under bijections.

2. $F$ is continuous.

3. For any probability measure $p$ on a set of the form $\left\{1,\dots ,n\right\}$, and any number $0\le t\le 1$,

$F\left(t{p}_{1},\left(1-t\right){p}_{1},{p}_{2},\dots ,{p}_{n}\right)={p}_{1}F\left(t,1-t\right)+F\left({p}_{1},\dots ,{p}_{n}\right)$F(t p_1, (1-t)p_1, p_2, \dots, p_n) = p_1 F(t, 1-t) + F(p_1, \dots, p_n)

Then $F$ is a constant nonnegative multiple of Shannon entropy.

In item 1 we’re using the fact that a bijection $f:X\to X\prime$ between finite sets together with a probability distribution on $X$ gives a probability distribution on $X\prime$; we want these to have the same entropy. In item 2 we’re using the standard topology on ${ℝ}^{n}$ to put a topology on the set of probability distributions on any $n$-element set.

The most interesting and mysterious condition in Fadeev’s theorem is item 3. In a sense, this is what our work seeks to explain. The first step is to realize that this condition can be restated in an equivalent but conceptually clearer way. The key idea is that a probability measure on a set $X$ can be used to combine probability measures on an $X$-indexed family of sets into a probability measure on their disjoint union. Item 3 says that Shannon entropy transforms in a simple way under this operation.

Suppose $p$ is a probability measure on the set $\left\{1,\dots ,n\right\}$. Suppose also that for each $1\le i\le n$, ${Y}_{i}$ is a finite set equipped with a probability measure ${q}_{i}$. Then there is a probability measure $p\circ \left({q}_{1},\dots ,{q}_{n}\right)$ on the disjoint union ${⨆}_{i=1}^{n}{Y}_{i}$, defined as follows: if $j\in {Y}_{i}$, then

$p\circ \left({q}_{1},\dots ,{q}_{n}\right)=p\left(i\right){q}_{i}\left(j\right).$p \circ (q_1, \dots, q_n) = p(i) q_i(j).

There is a nice formula for the Shannon entropy of this new probability measure. To express it neatly, the following notation comes in handy. Suppose $p$ is a probability measure on the set $\left\{1,\dots ,n\right\}$ and $\left({a}_{1},\dots ,{a}_{n}\right)$ is an $n$-tuple of real numbers. Then we write $p\left({a}_{1},\dots ,{a}_{n}\right)$ for the weighted arithmetic mean:

$p\left({a}_{1},\dots ,{a}_{n}\right)=\sum _{i=1}^{n}{p}_{i}{a}_{i}$p (a_1, \dots, a_n) = \sum_{i=1}^n p_i a_i

Now, we have:

###### Lemma

Suppose $p$ is a probability measure on the set $\left\{1,\dots ,n\right\}$, and suppose that for each $1\le i\le n$, ${Y}_{i}$ is a finite set equipped with a probability measure ${q}_{i}$. Then Shannon entropy obeys the law:

(1)$S\left(p\circ \left({q}_{1},\dots ,{q}_{n}\right)\right)=S\left(p\right)+p\left(S\left({q}_{1}\right),\dots ,S\left({q}_{n}\right)\right)$S(p\circ(q_1, \ldots, q_n)) = S(p) + p(S(q_1), \ldots, S(q_n))
###### Proof

The proof is a calculation. We write ${q}_{\mathrm{ij}}$ for the value of $q:{Y}_{i}\to \left[0,\infty \right)$ at the point $j\in {Y}_{i}$:

$\begin{array}{rlr}S\left(p\circ \left({q}_{1},\dots ,{q}_{n}\right)\right)& =& \sum _{i=1}^{n}\sum _{j\in {Y}_{i}}{p}_{i}{q}_{\mathrm{ij}}\mathrm{ln}\left({p}_{i}{q}_{\mathrm{ij}}\right)\\ & =& \sum _{i=1}^{n}\sum _{j\in {Y}_{i}}{p}_{i}\left({q}_{\mathrm{ij}}\mathrm{ln}\left(p\left(i\right)+{q}_{\mathrm{ij}}\mathrm{ln}\left({q}_{\mathrm{ij}}\right)\right)\\ & =& \sum _{i=1}^{n}p\left(i\right)\left(\mathrm{ln}\left({p}_{i}\right)+S\left({q}_{i}\right)\right)\\ & =& S\left(p\right)+P\left(S\left({q}_{1}\right),\dots ,S\left({q}_{n}\right)\right)\end{array}$\begin{aligned} S(p\circ(q_1, \ldots, q_n)) &=& \sum_{i=1}^n \sum_{j \in Y_i} p_i q_{ij} \ln(p_i q_{ij}) \\ &=& \sum_{i=1}^n \sum_{j \in Y_i} p_i \left( q_{ij} \ln(p(i) + q_{ij} \ln(q_{ij}) \right) \\ &=& \sum_{i=1}^n p(i) \left( \ln(p_i) + S(q_i) \right) \\ &=& S(p) + P(S(q_1), \dots, S(q_n)) \end{aligned}

Moreover, the above law is almost equivalent to item 3 in Fadeev’s theorem:

###### Lemma

Suppose $F$ is a map sending any probability measure on any finite set to a nonnegative real number. Suppose also that $F$ is invariant under bijections. Then the following are equivalent:

(A) For any probability measure $p$ on any set of the form $\left\{1,\dots ,n\right\}$, and any number $0\le t\le 1$,

$F\left(t{p}_{1},\left(1-t\right){p}_{1},{p}_{2},\dots ,{p}_{n}\right)={p}_{1}F\left(t,1-t\right)+F\left({p}_{1},\dots ,{p}_{n}\right)$F(t p_1, (1-t)p_1, p_2, \dots, p_n) = p_1 F(t, 1-t) + F(p_1, \dots, p_n)

and

(B1) If $\left(1\right)$ denotes the unique probability measure on the set $\left\{1\right\}$, then $F\left(\left(1\right)\right)=0$.

(B2) If $p$ is a probability measure on the set $\left\{1,\dots ,n\right\}$, and for each $1\le i\le n$, ${Y}_{i}$ is a finite set equipped with a probability measure ${q}_{i}$, then

$F\left(p\circ \left({q}_{1},\dots ,{q}_{n}\right)\right)=F\left(p\right)+p\left(F\left({q}_{1}\right),\dots ,F\left({q}_{n}\right)\right)$F(p\circ(q_1, \ldots, q_n)) = F(p) + p(F(q_1), \ldots, F(q_n))
###### Proof

Assume (A). Taking $n=1$, ${p}_{1}=1$ and $t=1$ gives

$S\left(1,0\right)=S\left(\left(1\right)\right)+1S\left(1,0\right)$S(1, 0) = S((1)) + 1S(1, 0)

from which (B1) follows immediately. Then a simple induction gives (B2).

Conversely, assume (B1) and (B2). Take $p=\left({p}_{1},\dots ,{p}_{n}\right)$, ${q}_{1}=\left(t,1-t\right)$ and ${q}_{i}=\left(1\right)$ for $i\ge 2$: then (B1) gives

$S\left(t{p}_{1},\left(1-t\right){p}_{1},{p}_{2},\dots ,{p}_{n}\right)=S\left({p}_{1},\dots ,{p}_{n}\right)+{p}_{1}S\left(t,1-t\right)+\sum _{i=2}^{n}{p}_{i}S\left(\left(1\right)\right)$S(t p_1, (1 - t)p_1, p_2, \ldots, p_n) = S(p_1, \ldots, p_n) + p_1 S(t, 1 - t) + \sum_{i = 2}^n p_i S((1))

which by (B2) gives (A).

We henceforth call (B1,B2) the operadic property of a bijection-invariant function from probability measures on finite sets to nonnegative real numbers.

Summarizing our discussion so far, we have:

###### Corollary

Suppose $F$ is a map sending any probability measure on any finite set to a nonnegative real number. Suppose that:

1. $F$ is invariant under bijections.

2. $F$ is continuous.

3. $F$ has the operadic property.

Then $F$ is a constant nonnegative multiple of Shannon entropy.

## Convex spaces

A convex set is a subset $X\subseteq V$ of a real vector space $V$ that is closed under the operations

${c}_{p}\left(x,y\right)=cx+\left(1-c\right)y$c_p(x,y) = c x + (1-c) y

for all $0\le p\le 1$. We can abstract some properties of convex sets using the concept of a ‘convex space’:

###### Definition

A convex space is a set $X$ equipped with an operation ${c}_{p}:X×X\to X$ for each number $0\le p\le 1$ obeying the following laws:

• ${c}_{1}\left(x,y\right)=x$,
• ${c}_{p}\left(x,x\right)=x$,
• ${c}_{p}\left(x,y\right)={c}_{1-p}\left(y,x\right)$,
• ${c}_{p}\left({c}_{q}\left(x,y\right),z\right)={c}_{pq}\left(x,{c}_{r}\left(y,z\right)\right)$ for $\left(1-pq\right)r=\left(1-q\right)p$.

These operations generate an algebraic theory whose set of $n$-ary operations correspond to probability measures on the set $\left\{1,\dots ,n\right\}$. This set is so important that it needs a name. Of course it is often known as the $\left(n-1\right)$-simplex and denoted ${\Delta }^{n-1}$, but we want a name that involves the number $n$ and makes us think of probability:

###### Definition

Let ${P}_{n}$ be the set of probability distributions on $\left\{1,\dots ,n\right\}$.

We can think of ${P}_{n}$ as the set of $n$-ary operations in an operad. The idea here is that we can compose an operation $p\in {P}_{n}$ with a list of operations ${q}_{i}\in {P}_{{k}_{i}}$ for $1\le i\le n$ to get an operation

$p\circ \left({q}_{1},\dots ,{q}_{n}\right)\in {P}_{{k}_{1}+\cdots +{k}_{n}}$p \circ (q_1, \dots, q_n) \in P_{k_1 + \cdots + k_n}

This is defined as earlier.

OLD STUFF, NOT YET INCORPORATED INTO THE PAPER YET:

###### Definition

The monad for convex sets is a monad on $\mathrm{Set}$ sending any set $X$ to the set of finitely-supported probability distributions on $X$.

For example, this monad sends $\left\{1,\dots ,n\right\}$ to a set ${P}_{n}$, which can be identified with the $\left(n-1\right)$-simplex. This monad is a finitary monad, so can be thought about in a few different ways.

A finitary monad is the same thing as a finitary algebraic theory. This one can be presented by a family $\left({*}_{t}{\right)}_{t\in \left[0,1\right]}$ of binary operations, subject to some equations. They’re probably exactly those equations that hold in a convex subset of ${ℝ}^{n}$ if we put $x{*}_{t}y=\left(1-t\right)x+ty$.

(I suspect there’s a theorem here: that for $n\ge 1$, ${ℝ}^{n}$ “satisfies no laws”. This means there are no equations between the various operations $\left(x,y\right)↦\left(1-t\right)x+ty$ beyond those forced by its being an algebra for this theory.)

A finitary algebraic theory can also be thought of as a kind of souped-up operad. In a symmetric operad $P$, one has for each bijection $\sigma :\left\{1,\dots ,n\right\}\to \left\{1,\dots ,n\right\}$ an induced map ${\sigma }_{*}:{P}_{n}\to {P}_{n}$. In a finitary algebraic theory, one has the same thing for arbitrary functions between finite sets, not just bijections. In other words, a finitary algebraic theory amounts to a non-symmetric operad $P$ together with, for each function $\theta :\left\{1,\dots ,m\right\}\to \left\{1,\dots ,n\right\}$ between finite sets, an induced map ${\theta }_{*}:{P}_{m}\to {P}_{n}$, satisfying suitable axioms.

###### Definition

The underlying symmetric operad for the convex monad is called the operad for convex algebras, and denote $P$. An algebra of $P$ is called a convex algebra.

The space of $n$-ary operations for this operad is ${P}_{n}$, the space of probability distributions on $\left\{1,\dots ,n\right\}$. The composition of operations is supposed to be obvious, but we should probably write down a formula for it. The maps ”${\theta }_{*}:{P}_{n}\to {P}_{m}$” can be defined by pushforward of measures. An algebra for the algebraic theory of convex algebras is an algebra $X$ for the operad with the further property that the square

$\begin{array}{ccc}{P}_{m}×{X}^{n}& \stackrel{1×{\theta }^{*}}{\to }& {P}_{m}×{X}^{m}\\ {\theta }_{*}×1↓& & ↓\\ {P}_{n}×{X}^{n}& \to & X\end{array}$\begin{matrix} \mathbf{P}_m \times X^n &\stackrel{1 \times \theta^*}{\to} &\mathbf{P}_m \times X^m \\ \theta_*\times 1 \downarrow & &\downarrow \\ \mathbf{P}_n \times X^n &\to &X \end{matrix}

commutes for all $\theta :\left\{1,\dots ,m\right\}\to \left\{1,\dots ,n\right\}$.

Note that $P$ is naturally a topological operad, where the topology on ${P}_{n}$ is the usual topology on the $\left(n-1\right)$-simplex. In our applications, we focus on algebras of $P$ in topological categories with finite products. We call these convex algebras in $ℰ$. Here are some examples:

• Any convex subset of ${ℝ}^{n}$ is naturally a convex algebra in $\mathrm{Top}$. In particular, $\left[0,\infty \right)$ is such.

• Moreover, if we regard the topological monoid $\left(\left[0,\infty \right),+,0\right)$ as a one-object topological category, then it is a convex algebra in $\mathrm{Cat}\left(Top\right)$.

• $FinMeas$ is also a convex algebra in $\mathrm{Cat}\left(Top\right)$.

• $FinProb$ is also a convex algebra in $\mathrm{Cat}\left(Top\right)$.

## References

• D. K. Fadeev, Zum Begriff der Entropie einer endlichen Wahrseheinlichkeiitsschemas, Arbeiten zur Informationstheorie I, Berlin, Deutscher Verlag der Wissensehaften, 1957, pp. 85-90.
• Handbook of Analysis and its Foundations, Section 12.7 (short and to the point).

• Romanowska, Smith, Orłowska; Abstract barycentric algebras; pdf. This generalises from $\left[0,1\right]$ to an arbitrary $L\Pi$-algebra ($L$ for ‘Łukasiewicz’, $\Pi$ for ‘product’, so think of $\left[0,1\right]$ as a space of fuzzy truth values).

• Romanowska and Smith, Modal Theory: An Algebraic Approach to Order, Geometry, and Convexity; Res. Exp. Math. 9; Heldermann-Verlag, Berlin, 1985.

• Marshall Harvey Stone, Postulates for the barycentric calculus. Ann. Mat. Pura. Appl. (4), 29:25–30, 1949.

• Tobias Fritz, Convex spaces I: definition and examples. [[arXiv](http://arxiv.org/abs/0903.5522)]

• Bart Jacobs, Duality for convexity. [[arXiv](http://arxiv.org/abs/0911.3834)]

• Joe Flood, Semiconvex geometry, J. Austral. Math. Soc. Ser. A 30 (1980/81), 496-–510.

• T. Swirszcz, Monadic functors and categories of convex sets , Preprint No. 70, Proc. Inst. Math. Pol. Acad. Sci., Warsaw.

• T. Swirszcz, Monadic functors and convexity, Bull. Acad. Polon. Sci. Ser. Sci. Math. Astronom. Phys. 22 (1974), 39–42.

• Stanley P. Gudder, Convexity and mixtures, SIAM Review 19 (1977), 221–240.

• Stanley P. Gudder, A general theory of convexity, Milan Journal of Mathematics, 49 (1979), 89–96.

Many other references, and a discussion of how convex spaces have been repeatedly rediscovered, can be found at the $n$-Category Café post Convex Spaces.

Revised on May 2, 2012 04:23:55 by David Roberts (203.24.207.183)