<?xml version="1.0" encoding="UTF-8" standalone="yes"?><oembed><version><![CDATA[1.0]]></version><provider_name><![CDATA[Azimuth]]></provider_name><provider_url><![CDATA[https://johncarlosbaez.wordpress.com]]></provider_url><author_name><![CDATA[John Baez]]></author_name><author_url><![CDATA[https://johncarlosbaez.wordpress.com/author/johncarlosbaez/]]></author_url><title><![CDATA[Relative Entropy (Part&nbsp;1)]]></title><type><![CDATA[link]]></type><html><![CDATA[<p>I&#8217;m trying to finish off a paper that Tobias Fritz and I have been working on, which gives a category-theoretic (and Bayesian!) characterization of <a href="http://en.wikipedia.org/wiki/Kullback%E2%80%93Leibler_divergence">relative entropy</a>.  It&#8217;s a kind of sequel to <a href="https://johncarlosbaez.wordpress.com/2011/06/02/a-characterization-of-entropy/">our paper with Tom Leinster</a>, in which we characterized entropy.  </p>
<p>That earlier paper was developed in conversations <a href="http://ncatlab.org/johnbaez/show/A+characterization+of+entropy+in+terms+of+information+loss">on the <i>n</i>-Category Caf&eacute;</a>.  It was a lot of fun; I sort of miss that style of working.    Also, to get warmed up, I need to think through some things I&#8217;ve thought about before.   So, I might as well write them down here.  </p>
<h3> The idea </h3>
<p>There are many categories related to probability theory, and they&#8217;re related in many ways.  Last summer&#8212;on the 24th of August 2012, according to my notes here&#8212;Jamie Vicary, Brendan Fong and I worked through a bunch of these relationships.  I need to write them down now, even if they&#8217;re not all vitally important to my paper with Tobias.  They&#8217;re sort of buzzing around my brain like flies.</p>
<p>(Tobias knows this stuff too, and this is how we think about probability theory, but we weren&#8217;t planning to stick it in our paper.  Maybe we should.)</p>
<p>Let&#8217;s restrict attention to probability measures on <i>finite sets</i>, and related structures.  We could study these questions more generally, and we should, but not today.  What we&#8217;ll do is give a unified purely algebraic description of:</p>
<p>&bull; finite sets</p>
<p>&bull; measures on finite sets</p>
<p>&bull; probability measures on finite sets</p>
<p>and various kinds of maps between these:</p>
<p>&bull; functions</p>
<p>&bull; bijections</p>
<p>&bull; measure-preserving functions</p>
<p>&bull; stochastic maps</p>
<h3>  Finitely generated free [0,&infin;)-modules </h3>
<p>People often do linear algebra over a <a href="http://en.wikipedia.org/wiki/Field_%28mathematics%29">field</a>, which is&#8212;roughly speaking&#8212;a number system where you can add, subtract, multiply and divide.  But algebraists have long realized that a lot of linear algebra still works with a <a href="http://en.wikipedia.org/wiki/Commutative_ring">commutative ring</a>, where you can&#8217;t necessarily divide.  It gets more complicated, but also a lot more interesting.  </p>
<p>But in fact, a lot still works with a commutative <a href="http://ncatlab.org/nlab/show/rig">rig</a>, where we can&#8217;t necessarily subtract either!  Something I keep telling everyone is that linear algebra over rigs is a good idea for studying things like probability theory, thermodynamics, and the principle of least action.</p>
<p>Today we&#8217;ll start with the rig of nonnegative real numbers with their usual addition and multiplication; let&#8217;s call this <img src='https://s0.wp.com/latex.php?latex=%5B0%2C%5Cinfty%29+.&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='[0,&#92;infty) .' title='[0,&#92;infty) .' class='latex' />   The idea is that measure theory, and probability theory, are closely related to linear algebra over this rig. </p>
<p>Let <img src='https://s0.wp.com/latex.php?latex=C&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='C' title='C' class='latex' /> be the category with of <a href="http://en.wikipedia.org/wiki/Finitely-generated_module">finitely generated</a> <a href="http://en.wikipedia.org/wiki/Free_module">free</a> <img src='https://s0.wp.com/latex.php?latex=%5B0%2C%5Cinfty%29+&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='[0,&#92;infty) ' title='[0,&#92;infty) ' class='latex' />-modules as objects, and <a href="http://en.wikipedia.org/wiki/Module_homomorphism#Submodules_and_homomorphisms">module homomorphisms</a> as morphisms.   I&#8217;ll call these morphisms <b>maps</b>.</p>
<p><b>Puzzle.</b> Do we need to say &#8216;free&#8217; here?  Are there finitely generated modules over <img src='https://s0.wp.com/latex.php?latex=%5B0%2C%5Cinfty%29+&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='[0,&#92;infty) ' title='[0,&#92;infty) ' class='latex' /> that aren&#8217;t free?</p>
<p>Every finitely generated free <img src='https://s0.wp.com/latex.php?latex=%5B0%2C%5Cinfty%29&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='[0,&#92;infty)' title='[0,&#92;infty)' class='latex' />-module is isomorphic to <img src='https://s0.wp.com/latex.php?latex=%5B0%2C%5Cinfty%29%5ES+&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='[0,&#92;infty)^S ' title='[0,&#92;infty)^S ' class='latex' /> for some finite set <img src='https://s0.wp.com/latex.php?latex=S+.&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='S .' title='S .' class='latex' /> In other words, it&#8217;s isomorphic to <img src='https://s0.wp.com/latex.php?latex=%5B0%2C%5Cinfty%29%5En+&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='[0,&#92;infty)^n ' title='[0,&#92;infty)^n ' class='latex' /> for some <img src='https://s0.wp.com/latex.php?latex=n+%3D+0%2C+1%2C+2%2C+%5Cdots+.&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='n = 0, 1, 2, &#92;dots .' title='n = 0, 1, 2, &#92;dots .' class='latex' />   So, <img src='https://s0.wp.com/latex.php?latex=C&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='C' title='C' class='latex' /> is equivalent to the category where objects are natural numbers, a morphism from <img src='https://s0.wp.com/latex.php?latex=m+&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='m ' title='m ' class='latex' /> to <img src='https://s0.wp.com/latex.php?latex=n+&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='n ' title='n ' class='latex' /> is an <img src='https://s0.wp.com/latex.php?latex=m+%5Ctimes+n+&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='m &#92;times n ' title='m &#92;times n ' class='latex' /> matrix of numbers in <img src='https://s0.wp.com/latex.php?latex=%5B0%2C%5Cinfty%29+%2C&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='[0,&#92;infty) ,' title='[0,&#92;infty) ,' class='latex' /> and composition is done by matrix multiplication.  I&#8217;ll also call this equivalent category <img src='https://s0.wp.com/latex.php?latex=C.&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='C.' title='C.' class='latex' /> </p>
<p>We can take tensor products of finitely generated free modules, and this makes  <img src='https://s0.wp.com/latex.php?latex=C&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='C' title='C' class='latex' /> into a <a href="http://ncatlab.org/nlab/show/symmetric+monoidal+dagger-category">symmetric monoidal &dagger;-category</a>.  This means we can draw maps using <a href="http://arxiv.org/abs/0903.0340">string diagrams</a> in the usual way.  However, I&#8217;m feeling lazy so I&#8217;ll often write equations when I could be drawing diagrams.  </p>
<p>One of the rules of the game is that all these equations will make sense in <i>any</i> symmetric monoidal &dagger;-category.  So we could, if we wanted, generalize ideas from probability theory this way.  If you want to do this, you&#8217;ll need to know that <img src='https://s0.wp.com/latex.php?latex=%5B0%2C%5Cinfty%29&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='[0,&#92;infty)' title='[0,&#92;infty)' class='latex' /> is the unit for the tensor product in <img src='https://s0.wp.com/latex.php?latex=C.&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='C.' title='C.' class='latex' />   We&#8217;ll be seeing this guy <img src='https://s0.wp.com/latex.php?latex=%5B0%2C%5Cinfty%29&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='[0,&#92;infty)' title='[0,&#92;infty)' class='latex' /> a lot.  So if you want to generalize, replace <img src='https://s0.wp.com/latex.php?latex=C&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='C' title='C' class='latex' /> by any symmetric monoidal &dagger;-category, and replace <img src='https://s0.wp.com/latex.php?latex=%5B0%2C%5Cinfty%29&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='[0,&#92;infty)' title='[0,&#92;infty)' class='latex' /> by the unit for the tensor product.</p>
<h3> Finite sets </h3>
<p>There&#8217;s a way to see the category of finite sets lurking in <img src='https://s0.wp.com/latex.php?latex=C%2C&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='C,' title='C,' class='latex' /> which we can borrow from this paper:</p>
<p>&bull; Bob Coecke, Dusko Pavlovic and Jamie Vicary, <a href="http://arxiv.org/abs/0810.0812">A new description of orthogonal bases</a>.</p>
<p>For any finite set <img src='https://s0.wp.com/latex.php?latex=S+%2C&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='S ,' title='S ,' class='latex' /> we get a free finitely generated <img src='https://s0.wp.com/latex.php?latex=%5B0%2C%5Cinfty%29+&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='[0,&#92;infty) ' title='[0,&#92;infty) ' class='latex' />-module, namely <img src='https://s0.wp.com/latex.php?latex=%5B0%2C%5Cinfty%29%5ES+.&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='[0,&#92;infty)^S .' title='[0,&#92;infty)^S .' class='latex' />  This comes with some structure:</p>
<p>&bull; a multiplication <img src='https://s0.wp.com/latex.php?latex=m%3A+%5B0%2C%5Cinfty%29%5ES+%5Cotimes+%5B0%2C%5Cinfty%29%5ES+%5Cto+%5B0%2C%5Cinfty%29%5ES+%2C&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='m: [0,&#92;infty)^S &#92;otimes [0,&#92;infty)^S &#92;to [0,&#92;infty)^S ,' title='m: [0,&#92;infty)^S &#92;otimes [0,&#92;infty)^S &#92;to [0,&#92;infty)^S ,' class='latex' /> coming from pointwise multiplication of <img src='https://s0.wp.com/latex.php?latex=%5B0%2C%5Cinfty%29+&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='[0,&#92;infty) ' title='[0,&#92;infty) ' class='latex' />-valued functions on <img src='https://s0.wp.com/latex.php?latex=S+&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='S ' title='S ' class='latex' /></p>
<p>&bull; the unit for this multiplication, an element of <img src='https://s0.wp.com/latex.php?latex=%5B0%2C%5Cinfty%29%5ES%2C&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='[0,&#92;infty)^S,' title='[0,&#92;infty)^S,' class='latex' /> which we can write as a morphism <img src='https://s0.wp.com/latex.php?latex=i%3A+%5B0%2C%5Cinfty%29+%5Cto+%5B0%2C%5Cinfty%29%5ES+&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='i: [0,&#92;infty) &#92;to [0,&#92;infty)^S ' title='i: [0,&#92;infty) &#92;to [0,&#92;infty)^S ' class='latex' /></p>
<p>&bull; a comultiplication, obtained by taking the diagonal map <img src='https://s0.wp.com/latex.php?latex=%5CDelta+%3A+S+%5Cto+S+%5Ctimes+S+&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;Delta : S &#92;to S &#92;times S ' title='&#92;Delta : S &#92;to S &#92;times S ' class='latex' /> and promoting it to a linear map <img src='https://s0.wp.com/latex.php?latex=%5CDelta+%3A+%5B0%2C%5Cinfty%29%5ES+%5Cto+%5B0%2C+%5Cinfty%29%5ES+%5Cotimes+%5B0%2C%5Cinfty%29%5ES+&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;Delta : [0,&#92;infty)^S &#92;to [0, &#92;infty)^S &#92;otimes [0,&#92;infty)^S ' title='&#92;Delta : [0,&#92;infty)^S &#92;to [0, &#92;infty)^S &#92;otimes [0,&#92;infty)^S ' class='latex' /></p>
<p>&bull; a counit for this comultiplication, obtained by taking the unique map to the terminal set <img src='https://s0.wp.com/latex.php?latex=%21+%3A+S+%5Cto+1+&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='! : S &#92;to 1 ' title='! : S &#92;to 1 ' class='latex' /> and promoting it to a linear map <img src='https://s0.wp.com/latex.php?latex=e%3A+%5B0%2C%5Cinfty%29%5ES+%5Cto+%5B0%2C%5Cinfty%29&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='e: [0,&#92;infty)^S &#92;to [0,&#92;infty)' title='e: [0,&#92;infty)^S &#92;to [0,&#92;infty)' class='latex' /></p>
<p>These morphisms <img src='https://s0.wp.com/latex.php?latex=m%2C+i%2C+%5CDelta%2C+e+&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='m, i, &#92;Delta, e ' title='m, i, &#92;Delta, e ' class='latex' /> make </p>
<p><img src='https://s0.wp.com/latex.php?latex=x+%3D+%5B0%2C%5Cinfty%29%5ES+&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='x = [0,&#92;infty)^S ' title='x = [0,&#92;infty)^S ' class='latex' /></p>
<p>into a commutative Frobenius algebra in <img src='https://s0.wp.com/latex.php?latex=C+.&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='C .' title='C .' class='latex' />  That&#8217;s a thing where the unit, counit, multiplication and comultiplication obey these laws:</p>
<div align="center">
<img src="https://i0.wp.com/math.ucr.edu/home/baez/commutative_frobenius_algebra.jpg" alt="" />
</div>
<p>(I drew these back when I was feeling less lazy.)   This Frobenius algebra is also &#8216;special&#8217;, meaning it obeys this:</p>
<div align="center">
<img width="300" src="https://i2.wp.com/math.ucr.edu/home/baez/separability.jpg" alt="" />
</div>
<p>And it&#8217;s also a &dagger;-Frobenius algebra, meaning that the counit and comultiplication are obtained from the unit and multiplication by &#8216;flipping&#8217; them using the <a href="http://ncatlab.org/nlab/show/dagger-category">&dagger;category</a> structure.  (If we think of a morphism in <img src='https://s0.wp.com/latex.php?latex=C&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='C' title='C' class='latex' /> as a matrix, its dagger is its transpose.)</p>
<p>Conversely, suppose we have <i>any</i> special commutative &dagger;-Frobenius algebra <img src='https://s0.wp.com/latex.php?latex=x+.&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='x .' title='x .' class='latex' />  Then using the ideas in the paper by Coecke, Pavlovich and Vicary we can recover a basis for <img src='https://s0.wp.com/latex.php?latex=x+%2C&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='x ,' title='x ,' class='latex' /> consisting of the vectors <img src='https://s0.wp.com/latex.php?latex=e_i+%5Cin+x+&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='e_i &#92;in x ' title='e_i &#92;in x ' class='latex' /> with </p>
<p><img src='https://s0.wp.com/latex.php?latex=%5CDelta%28e_i%29+%3D+e_i+%5Cotimes+e_i+&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;Delta(e_i) = e_i &#92;otimes e_i ' title='&#92;Delta(e_i) = e_i &#92;otimes e_i ' class='latex' /></p>
<p>This basis forms a set <img src='https://s0.wp.com/latex.php?latex=S+&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='S ' title='S ' class='latex' /> such that </p>
<p><img src='https://s0.wp.com/latex.php?latex=x+%5Ccong+%5B0%2C%5Cinfty%29%5ES+&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='x &#92;cong [0,&#92;infty)^S ' title='x &#92;cong [0,&#92;infty)^S ' class='latex' /></p>
<p>for some <i>specified</i> isomorphism in <img src='https://s0.wp.com/latex.php?latex=C.&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='C.' title='C.' class='latex' />  Furthermore, this is an isomorphism of special commutative &dagger;-Frobenius algebras!</p>
<p>In case you&#8217;re wondering, these vectors <img src='https://s0.wp.com/latex.php?latex=e_i&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='e_i' title='e_i' class='latex' /> correspond to the functions on <img src='https://s0.wp.com/latex.php?latex=S&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='S' title='S' class='latex' /> that are zero everywhere except at one point <img src='https://s0.wp.com/latex.php?latex=i+%5Cin+S%2C&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='i &#92;in S,' title='i &#92;in S,' class='latex' /> where they equal 1.</p>
<p>In short, a special commutative &dagger;-Frobenius algebra in <img src='https://s0.wp.com/latex.php?latex=C&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='C' title='C' class='latex' /> is just a fancy way of talking about a finite set.  This may seem silly, but it&#8217;s a way to start describing probability theory using linear algebra very much as we do with quantum theory.  This analogy between quantum theory and probability theory is so interesting that it deserves a <a href="http://math.ucr.edu/home/baez/stoch_stable.pdf">book</a>.</p>
<h3> Functions and bijections </h3>
<p>Now suppose we have two special commutative &dagger;-Frobenius algebra in <img src='https://s0.wp.com/latex.php?latex=C&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='C' title='C' class='latex' />, say <img src='https://s0.wp.com/latex.php?latex=x+&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='x ' title='x ' class='latex' /> and <img src='https://s0.wp.com/latex.php?latex=y+.&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='y .' title='y .' class='latex' /></p>
<p>Suppose <img src='https://s0.wp.com/latex.php?latex=f+%3A+x+%5Cto+y+&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='f : x &#92;to y ' title='f : x &#92;to y ' class='latex' /> is a Frobenius algebra homomorphism: that is, a map preserving <i>all</i> the structure&#8212;the unit, counit, multiplication and comultiplication.  Then it comes from an isomorphism of finite sets.   This lets us find <img src='https://s0.wp.com/latex.php?latex=%5Cmathrm%7BFinSet%7D_0+%2C&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;mathrm{FinSet}_0 ,' title='&#92;mathrm{FinSet}_0 ,' class='latex' /> the groupoid of finite sets and bijections, inside <img src='https://s0.wp.com/latex.php?latex=C.&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='C.' title='C.' class='latex' /></p>
<p>Alternatively, suppose <img src='https://s0.wp.com/latex.php?latex=f+%3A+x+%5Cto+y+&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='f : x &#92;to y ' title='f : x &#92;to y ' class='latex' /> is just a coalgebra homomorphism: that is a map preserving just the counit and comultiplication.  Then it comes from an arbitrary function between finite sets.  This lets us find <img src='https://s0.wp.com/latex.php?latex=FinSet+%2C&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='FinSet ,' title='FinSet ,' class='latex' /> the category of finite sets and functions, inside <img src='https://s0.wp.com/latex.php?latex=C+.&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='C .' title='C .' class='latex' /></p>
<p>But what if <img src='https://s0.wp.com/latex.php?latex=f+&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='f ' title='f ' class='latex' /> preserves just the counit?  This sounds like a dry, formal question.  But it&#8217;s not: the answer is something useful, a &#8216;stochastic map&#8217;.</p>
<h3>  Stochastic maps </h3>
<p>A <b>stochastic map</b> from a finite set <img src='https://s0.wp.com/latex.php?latex=S+&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='S ' title='S ' class='latex' /> to a finite set <img src='https://s0.wp.com/latex.php?latex=T+&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='T ' title='T ' class='latex' /> is a map sending each point of <img src='https://s0.wp.com/latex.php?latex=S+&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='S ' title='S ' class='latex' /> to a probability measure on <img src='https://s0.wp.com/latex.php?latex=T+.&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='T .' title='T .' class='latex' />  </p>
<p>We can think of this as a <img src='https://s0.wp.com/latex.php?latex=T+%5Ctimes+S+&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='T &#92;times S ' title='T &#92;times S ' class='latex' />-shaped matrix of numbers in <img src='https://s0.wp.com/latex.php?latex=%5B0%2C%5Cinfty%29+%2C&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='[0,&#92;infty) ,' title='[0,&#92;infty) ,' class='latex' /> where a given column gives the probability that a given point in <img src='https://s0.wp.com/latex.php?latex=S+&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='S ' title='S ' class='latex' /> goes to any point in <img src='https://s0.wp.com/latex.php?latex=T+.&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='T .' title='T .' class='latex' />  The sum of the numbers in each column will be 1.  And conversely, any  <img src='https://s0.wp.com/latex.php?latex=T+%5Ctimes+S+&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='T &#92;times S ' title='T &#92;times S ' class='latex' />-shaped matrix of numbers in <img src='https://s0.wp.com/latex.php?latex=%5B0%2C%5Cinfty%29+%2C&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='[0,&#92;infty) ,' title='[0,&#92;infty) ,' class='latex' /> where each column sums to 1, gives a stochastic map from <img src='https://s0.wp.com/latex.php?latex=S+&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='S ' title='S ' class='latex' /> to <img src='https://s0.wp.com/latex.php?latex=T+.&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='T .' title='T .' class='latex' /></p>
<p>But now let&#8217;s describe this idea using the category <img src='https://s0.wp.com/latex.php?latex=C.&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='C.' title='C.' class='latex' />  We&#8217;ve seen a finite set is the same as a special commutative &dagger;-Frobenius algebra.  So, say we have two of these, <img src='https://s0.wp.com/latex.php?latex=x+&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='x ' title='x ' class='latex' /> and <img src='https://s0.wp.com/latex.php?latex=y+.&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='y .' title='y .' class='latex' />  Our matrix of numbers in <img src='https://s0.wp.com/latex.php?latex=%5B0%2C%5Cinfty%29+&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='[0,&#92;infty) ' title='[0,&#92;infty) ' class='latex' /> is just a map</p>
<p><img src='https://s0.wp.com/latex.php?latex=f%3A+x+%5Cto+y+&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='f: x &#92;to y ' title='f: x &#92;to y ' class='latex' /></p>
<p>So, we just need a way to state the condition that each column in the matrix sums to 1.  And this condition simply says that <img src='https://s0.wp.com/latex.php?latex=f+&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='f ' title='f ' class='latex' /> preserves the counit:</p>
<p><img src='https://s0.wp.com/latex.php?latex=%5Cepsilon_y+%5Ccirc+f+%3D+%5Cepsilon_x+&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;epsilon_y &#92;circ f = &#92;epsilon_x ' title='&#92;epsilon_y &#92;circ f = &#92;epsilon_x ' class='latex' /></p>
<p>where <img src='https://s0.wp.com/latex.php?latex=%5Cepsilon_x+%3A+x+%5Cto+%5B0%2C%5Cinfty%29+&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;epsilon_x : x &#92;to [0,&#92;infty) ' title='&#92;epsilon_x : x &#92;to [0,&#92;infty) ' class='latex' /> is the counit for <img src='https://s0.wp.com/latex.php?latex=x+%2C&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='x ,' title='x ,' class='latex' /> and similarly for <img src='https://s0.wp.com/latex.php?latex=%5Cepsilon_y+.&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;epsilon_y .' title='&#92;epsilon_y .' class='latex' />  </p>
<p>To understand this, note that if we use the canonical isomorphism</p>
<p><img src='https://s0.wp.com/latex.php?latex=x+%5Ccong+%5B0%2C%5Cinfty%29%5ES+&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='x &#92;cong [0,&#92;infty)^S ' title='x &#92;cong [0,&#92;infty)^S ' class='latex' /></p>
<p>the counit <img src='https://s0.wp.com/latex.php?latex=%5Cepsilon_x+&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;epsilon_x ' title='&#92;epsilon_x ' class='latex' /> can be seen as the map</p>
<p><img src='https://s0.wp.com/latex.php?latex=%5B0%2C%5Cinfty%29%5ES+%5Cto+%5B0%2C%5Cinfty%29+&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='[0,&#92;infty)^S &#92;to [0,&#92;infty) ' title='[0,&#92;infty)^S &#92;to [0,&#92;infty) ' class='latex' /></p>
<p>that takes any <img src='https://s0.wp.com/latex.php?latex=S+&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='S ' title='S ' class='latex' />-tuple of numbers and sums them up.   In other words, it&#8217;s integration with respect to counting measure.  So, the equation</p>
<p><img src='https://s0.wp.com/latex.php?latex=%5Cepsilon_y+%5Ccirc+f+%3D+%5Cepsilon_x+&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;epsilon_y &#92;circ f = &#92;epsilon_x ' title='&#92;epsilon_y &#92;circ f = &#92;epsilon_x ' class='latex' /></p>
<p>says that if we take any <img src='https://s0.wp.com/latex.php?latex=S+&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='S ' title='S ' class='latex' />-tuple of numbers, multiply it by the matrix <img src='https://s0.wp.com/latex.php?latex=f+%2C&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='f ,' title='f ,' class='latex' /> and then sum up the entries of the resulting <img src='https://s0.wp.com/latex.php?latex=T+&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='T ' title='T ' class='latex' />-tuple, it&#8217;s the same as if we summed up the original <img src='https://s0.wp.com/latex.php?latex=S+&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='S ' title='S ' class='latex' />-tuple.  But this says precisely that each column of the matrix <img src='https://s0.wp.com/latex.php?latex=f+&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='f ' title='f ' class='latex' /> sums to 1.</p>
<p>So, we can use our formalism to describe <img src='https://s0.wp.com/latex.php?latex=%5Cmathrm%7BFinStoch%7D%2C&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;mathrm{FinStoch},' title='&#92;mathrm{FinStoch},' class='latex' /> the category with finite sets as objects and stochastic maps as morphisms.  We&#8217;ve seen this category is equivalent to the category with special commutative &dagger;-Frobenius algebras in <img src='https://s0.wp.com/latex.php?latex=C&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='C' title='C' class='latex' /> as objects and counit-preserving maps as morphisms.</p>
<h3> Finite measure spaces </h3>
<p>Now let&#8217;s use our formalism to describe finite measure spaces&#8212;by which, beware, I mean a finite sets equipped with measures!  To do this, we&#8217;ll use a special commutative &dagger;-Frobenius algebra <img src='https://s0.wp.com/latex.php?latex=x+&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='x ' title='x ' class='latex' /> in <img src='https://s0.wp.com/latex.php?latex=C&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='C' title='C' class='latex' /> together with any map</p>
<p><img src='https://s0.wp.com/latex.php?latex=%5Cmu%3A+%5B0%2C%5Cinfty%29+%5Cto+x+&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;mu: [0,&#92;infty) &#92;to x ' title='&#92;mu: [0,&#92;infty) &#92;to x ' class='latex' /></p>
<p>Starting from these, we get a specified isomorphism</p>
<p><img src='https://s0.wp.com/latex.php?latex=x+%5Ccong+%5B0%2C%5Cinfty%29%5ES+&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='x &#92;cong [0,&#92;infty)^S ' title='x &#92;cong [0,&#92;infty)^S ' class='latex' /></p>
<p>and <img src='https://s0.wp.com/latex.php?latex=%5Cmu+&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;mu ' title='&#92;mu ' class='latex' /> sends the number 1 to a vector in <img src='https://s0.wp.com/latex.php?latex=%5B0%2C%5Cinfty%29%5ES+&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='[0,&#92;infty)^S ' title='[0,&#92;infty)^S ' class='latex' />: that is, a function on <img src='https://s0.wp.com/latex.php?latex=S+&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='S ' title='S ' class='latex' /> taking values in <img src='https://s0.wp.com/latex.php?latex=%5B0%2C%5Cinfty%29+.&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='[0,&#92;infty) .' title='[0,&#92;infty) .' class='latex' />   Multiplying this function by counting measure, we get a <i>measure</i> on <img src='https://s0.wp.com/latex.php?latex=S+.&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='S .' title='S .' class='latex' />   </p>
<p><b>Puzzle.</b>  How can we describe this measure without the annoying use of counting measure?</p>
<p>Conversely, any measure on a finite set gives a special commutative &dagger;-Frobenius algebra <img src='https://s0.wp.com/latex.php?latex=x+&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='x ' title='x ' class='latex' /> in <img src='https://s0.wp.com/latex.php?latex=C+&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='C ' title='C ' class='latex' /> equipped with a map from <img src='https://s0.wp.com/latex.php?latex=%5B0%2C%5Cinfty%29+.&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='[0,&#92;infty) .' title='[0,&#92;infty) .' class='latex' /></p>
<p>So, we can say a finite measure space is a special commutative &dagger;-Frobenius algebra in <img src='https://s0.wp.com/latex.php?latex=C+&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='C ' title='C ' class='latex' /> equipped with a map</p>
<p><img src='https://s0.wp.com/latex.php?latex=%5Cmu%3A+%5B0%2C%5Cinfty%29+%5Cto+x+&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;mu: [0,&#92;infty) &#92;to x ' title='&#92;mu: [0,&#92;infty) &#92;to x ' class='latex' /></p>
<p>And given two of these,</p>
<p><img src='https://s0.wp.com/latex.php?latex=%5Cmu%3A+%5B0%2C%5Cinfty%29+%5Cto+x+%2C+%5Cqquad++%5Cnu%3A+%5B0%2C%5Cinfty%29+%5Cto+y&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;mu: [0,&#92;infty) &#92;to x , &#92;qquad  &#92;nu: [0,&#92;infty) &#92;to y' title='&#92;mu: [0,&#92;infty) &#92;to x , &#92;qquad  &#92;nu: [0,&#92;infty) &#92;to y' class='latex' /></p>
<p>and a coalgebra morphism</p>
<p><img src='https://s0.wp.com/latex.php?latex=f+%3A+x+%5Cto+y+&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='f : x &#92;to y ' title='f : x &#92;to y ' class='latex' /></p>
<p>obeying this equation</p>
<p><img src='https://s0.wp.com/latex.php?latex=f+%5Ccirc+%5Cmu++%3D+%5Cnu+&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='f &#92;circ &#92;mu  = &#92;nu ' title='f &#92;circ &#92;mu  = &#92;nu ' class='latex' /></p>
<p>then we get a measure-preserving function between finite measure spaces!    If you&#8217;re a category theorist, you&#8217;ll draw this equation as a commutative triangle:</p>
<div align="center">
<img src="https://i2.wp.com/math.ucr.edu/home/baez/mathematical/relative_entropy_commutative_triangle.jpg" />
</div>
<p>Conversely, any measure-preserving function between finite measure spaces obeys this equation.  So, we get an algebraic way of describing the category <img src='https://s0.wp.com/latex.php?latex=%5Cmathrm%7BFinMeas%7D+%2C&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;mathrm{FinMeas} ,' title='&#92;mathrm{FinMeas} ,' class='latex' /> with finite measure spaces as objects and measure-preserving maps as morphisms.</p>
<h3> Finite probability measure spaces </h3>
<p>I&#8217;m mainly interested in probability measures.  So suppose <img src='https://s0.wp.com/latex.php?latex=x+&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='x ' title='x ' class='latex' /> is a special commutative &dagger;-Frobenius algebra in <img src='https://s0.wp.com/latex.php?latex=C&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='C' title='C' class='latex' /> equipped with a map</p>
<p><img src='https://s0.wp.com/latex.php?latex=%5Cmu%3A+%5B0%2C%5Cinfty%29+%5Cto+x+&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;mu: [0,&#92;infty) &#92;to x ' title='&#92;mu: [0,&#92;infty) &#92;to x ' class='latex' /></p>
<p>We&#8217;ve seen this gives a finite measure space.  But this is a probability measure space if and only if </p>
<p><img src='https://s0.wp.com/latex.php?latex=e+%5Ccirc+%5Cmu+%3D+1+&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='e &#92;circ &#92;mu = 1 ' title='e &#92;circ &#92;mu = 1 ' class='latex' /></p>
<p>where </p>
<p><img src='https://s0.wp.com/latex.php?latex=e+%3A+x+%5Cto+%5B0%2C%5Cinfty%29&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='e : x &#92;to [0,&#92;infty)' title='e : x &#92;to [0,&#92;infty)' class='latex' /></p>
<p>is the counit for <img src='https://s0.wp.com/latex.php?latex=x+.&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='x .' title='x .' class='latex' />  The equation simply says the total integral of our measure <img src='https://s0.wp.com/latex.php?latex=%5Cmu+&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;mu ' title='&#92;mu ' class='latex' /> is 1.</p>
<p>So, we get a way of describing the category <img src='https://s0.wp.com/latex.php?latex=%5Cmathrm%7BFinProb%7D+%2C&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;mathrm{FinProb} ,' title='&#92;mathrm{FinProb} ,' class='latex' /> which has finite probability measure spaces as objects and measure-preserving maps as objects.  Given finite probability measure spaces described this way:</p>
<p><img src='https://s0.wp.com/latex.php?latex=%5Cmu%3A+%5B0%2C%5Cinfty%29+%5Cto+x+%2C+%5Cqquad++%5Cnu%3A+%5B0%2C%5Cinfty%29+%5Cto+y&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;mu: [0,&#92;infty) &#92;to x , &#92;qquad  &#92;nu: [0,&#92;infty) &#92;to y' title='&#92;mu: [0,&#92;infty) &#92;to x , &#92;qquad  &#92;nu: [0,&#92;infty) &#92;to y' class='latex' /></p>
<p>a measure-preserving function is a coalgebra morphism</p>
<p><img src='https://s0.wp.com/latex.php?latex=f+%3A+x+%5Cto+y+&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='f : x &#92;to y ' title='f : x &#92;to y ' class='latex' /></p>
<p>such that the obvious triangle commutes:</p>
<p><img src='https://s0.wp.com/latex.php?latex=f+%5Ccirc+%5Cmu++%3D+%5Cnu+&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='f &#92;circ &#92;mu  = &#92;nu ' title='f &#92;circ &#92;mu  = &#92;nu ' class='latex' /></p>
<h3> Measure-preserving stochastic maps </h3>
<p>Say we have two finite measure spaces.  Then we can ask whether a stochastic map from one to the other is measure-preserving.  And we can answer this question in the language of <img src='https://s0.wp.com/latex.php?latex=C+.&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='C .' title='C .' class='latex' />  </p>
<p>Remember, a finite measure space is a special commutative &dagger;-Frobenius algebra <img src='https://s0.wp.com/latex.php?latex=x+&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='x ' title='x ' class='latex' /> in <img src='https://s0.wp.com/latex.php?latex=C+&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='C ' title='C ' class='latex' /> together with a map</p>
<p><img src='https://s0.wp.com/latex.php?latex=%5Cmu%3A+%5B0%2C%5Cinfty%29+%5Cto+x+&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;mu: [0,&#92;infty) &#92;to x ' title='&#92;mu: [0,&#92;infty) &#92;to x ' class='latex' /></p>
<p>Say we have another one:</p>
<p><img src='https://s0.wp.com/latex.php?latex=%5Cnu%3A+%5B0%2C%5Cinfty%29+%5Cto+y+&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;nu: [0,&#92;infty) &#92;to y ' title='&#92;nu: [0,&#92;infty) &#92;to y ' class='latex' /></p>
<p>A stochastic map is just a map</p>
<p><img src='https://s0.wp.com/latex.php?latex=f%3A+x+%5Cto+y+&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='f: x &#92;to y ' title='f: x &#92;to y ' class='latex' /></p>
<p>that preserves the counit:</p>
<p><img src='https://s0.wp.com/latex.php?latex=%5Cepsilon_y+%5Ccirc+f+%3D+%5Cepsilon_x+&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;epsilon_y &#92;circ f = &#92;epsilon_x ' title='&#92;epsilon_y &#92;circ f = &#92;epsilon_x ' class='latex' /></p>
<p>But it&#8217;s a <b>measure-preserving stochastic map</b> if also</p>
<p><img src='https://s0.wp.com/latex.php?latex=f+%5Ccirc+%5Cmu++%3D+%5Cnu+&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='f &#92;circ &#92;mu  = &#92;nu ' title='f &#92;circ &#92;mu  = &#92;nu ' class='latex' /></p>
<h3> Next&#8230; </h3>
<p>There&#8217;s a lot more to say; I haven&#8217;t gotten anywhere near what Tobias and I are doing!  But it&#8217;s pleasant to have this basic stuff written down.</p>
]]></html><thumbnail_url><![CDATA[https://i0.wp.com/math.ucr.edu/home/baez/commutative_frobenius_algebra.jpg?fit=440%2C330]]></thumbnail_url><thumbnail_height><![CDATA[330]]></thumbnail_height><thumbnail_width><![CDATA[303]]></thumbnail_width></oembed>