<?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[Decorated Cospans]]></title><type><![CDATA[link]]></type><html><![CDATA[<p><a href="https://johncarlosbaez.wordpress.com/2015/04/28/a-compositional-framework-for-passive-linear-networks/">Last time</a> I talked about a new paper I wrote with <a href="https://www.cs.ox.ac.uk/people/brendan.fong/">Brendan Fong</a>.  It&#8217;s about electrical circuits made of &#8216;passive&#8217; components, like resistors, inductors and capacitors.  We showed these circuits are morphisms in a category.  Moreover, there&#8217;s a functor sending each circuit to its &#8216;external behavior&#8217;: what it <em>does</em>, as seen by someone who can only measure voltages and currents at the terminals.</p>
<p>Our paper uses a formalism that Brendan developed here:</p>
<p>&bull; Brendan Fong, <a href="http://arxiv.org/abs/1502.00872">Decorated cospans</a>.</p>
<p>The idea here is we may want to take something like a graph with edges labelled by positive numbers:</p>
<div align="center">
<img src="https://i0.wp.com/math.ucr.edu/home/baez/networks/decorated_cospans/labelled_graph.jpg" />
</div>
<p>and say that some of its nodes are &#8216;inputs&#8217;, while others are &#8216;outputs&#8217;:</p>
<div align="center">
<img width="90%" height="90%" src="https://i2.wp.com/math.ucr.edu/home/baez/networks/decorated_cospans/labelled_graph_as_cospan_1.jpg" />
</div>
<p>This lets us treat our labelled graph as a &#8216;morphism&#8217; from the set <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' /> to the set <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>The point is that we can <i>compose</i> such morphisms.  For example, suppose we have another one of these things, going from <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' /> to <img src='https://s0.wp.com/latex.php?latex=Z&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='Z' title='Z' class='latex' />:</p>
<div align="center">
<img width="90%" height="90%" src="https://i0.wp.com/math.ucr.edu/home/baez/networks/decorated_cospans/labelled_graph_as_cospan_2.jpg" />
</div>
<p>Since the points of <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' /> are sitting in both things:</p>
<div align="center">
<img width="90%" height="90%" src="https://i2.wp.com/math.ucr.edu/home/baez/networks/decorated_cospans/labelled_graphs_as_composable_cospans.jpg" />
</div>
<p>we can glue them together and get a thing going from <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' /> to <img src='https://s0.wp.com/latex.php?latex=Z&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='Z' title='Z' class='latex' />:</p>
<div align="center">
<img width="90%" height="90%" src="https://i2.wp.com/math.ucr.edu/home/baez/networks/decorated_cospans/labelled_graph_as_composite_cospan.jpg" />
</div>
<p>That&#8217;s how we compose these morphisms.</p>
<p>Note how we&#8217;re specifying some nodes of our original thing as inputs and outputs:</p>
<div align="center">
<img width="90%" height="90%" src="https://i2.wp.com/math.ucr.edu/home/baez/networks/decorated_cospans/labelled_graph_as_cospan_1.jpg" />
</div>
<p>We&#8217;re using maps from two sets <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' /> to the set <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' /> of nodes of our graph.  And a bit surprisingly, we&#8217;re not demanding that these maps be one-to-one.  That turns out to be useful&#8212;and in general, when doing math, it&#8217;s dumb to make your definitions forbid certain possibilities unless you really need to.</p>
<p>So, our thing is really a <b>cospan</b> of finite sets&#8212;that is, a diagram of finite sets and functions like this:</p>
<div align="center">
<img src="https://i2.wp.com/math.ucr.edu/home/baez/networks/decorated_cospans/cospan.jpg" />
</div>
<p>together some extra structure on the set <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' />.  This extra structure is what Brendan calls a <b>decoration</b>, and it makes the cospan into a &#8216;decorated cospan&#8217;.  In this particular example, a decoration on <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 a way of making it into the nodes of a graph with edges labelled by positive numbers.  But one could consider many other kinds of decorations: this idea is very general.</p>
<p>To formalize the idea of &#8216;a kind of decoration&#8217;, Brendan uses a functor</p>
<p><img src='https://s0.wp.com/latex.php?latex=F%3A+%5Cmathrm%7BFinSet%7D+%5Cto+%5Cmathrm%7BSet%7D+&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='F: &#92;mathrm{FinSet} &#92;to &#92;mathrm{Set} ' title='F: &#92;mathrm{FinSet} &#92;to &#92;mathrm{Set} ' class='latex' /></p>
<p>sending each finite set <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' /> to a set of <img src='https://s0.wp.com/latex.php?latex=F%28N%29.&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='F(N).' title='F(N).' class='latex' />  This set <img src='https://s0.wp.com/latex.php?latex=F%28N%29&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='F(N)' title='F(N)' class='latex' /> is the set of decorations of the given kind that we can put on <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' /></p>
<p>So, for any such functor <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' /> a <b>decorated cospan of finite sets</b> is a cospan of finite sets:</p>
<div align="center">
<img src="https://i2.wp.com/math.ucr.edu/home/baez/networks/decorated_cospans/cospan.jpg" />
</div>
<p>together with an element of <img src='https://s0.wp.com/latex.php?latex=F%28N%29.&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='F(N).' title='F(N).' class='latex' /></p>
<p>But in fact, Brendan goes further.  He&#8217;s not content to use a functor</p>
<p><img src='https://s0.wp.com/latex.php?latex=F%3A+%5Cmathrm%7BFinSet%7D+%5Cto+%5Cmathrm%7BSet%7D+&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='F: &#92;mathrm{FinSet} &#92;to &#92;mathrm{Set} ' title='F: &#92;mathrm{FinSet} &#92;to &#92;mathrm{Set} ' class='latex' /></p>
<p>to decorate his cospans.</p>
<p>First, there&#8217;s no need to limit ourselves to cospans of <i>finite sets</i>: we can replace <img src='https://s0.wp.com/latex.php?latex=%5Cmathrm%7BFinSet%7D&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;mathrm{FinSet}' title='&#92;mathrm{FinSet}' class='latex' /> with some other category!  If <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 any category with <a href="https://en.wikipedia.org/w/index.php?title=Limit_%28category_theory%29&amp;redirect=no#Colimits">finite colimits</a>, there&#8217;s a category <img src='https://s0.wp.com/latex.php?latex=%5Cmathrm%7BCospan%7D%28C%29&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;mathrm{Cospan}(C)' title='&#92;mathrm{Cospan}(C)' class='latex' /> with:</p>
<p>&bull; objects 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' /> as its objects,<br />
&bull; isomorphism classes of cospans between these as morphisms.</p>
<p>Second, there&#8217;s no need to limit ourselves to decorations that are elements of a <i>set</i>: we can replace <img src='https://s0.wp.com/latex.php?latex=%5Cmathrm%7BSet%7D&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;mathrm{Set}' title='&#92;mathrm{Set}' class='latex' /> with some other category!  If <img src='https://s0.wp.com/latex.php?latex=D&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='D' title='D' class='latex' /> is any <a href="https://en.wikipedia.org/wiki/Symmetric_monoidal_category">symmetric monoidal category</a>, we can define an <b>element</b> of an object <img src='https://s0.wp.com/latex.php?latex=d+%5Cin+D&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='d &#92;in D' title='d &#92;in D' class='latex' /> to be a morphism</p>
<p><img src='https://s0.wp.com/latex.php?latex=f%3A+I+%5Cto+d&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='f: I &#92;to d' title='f: I &#92;to d' class='latex' /></p>
<p>where <img src='https://s0.wp.com/latex.php?latex=I&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='I' title='I' class='latex' /> is the unit for the tensor product in <img src='https://s0.wp.com/latex.php?latex=D.&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='D.' title='D.' class='latex' /></p>
<p>So, Brendan defines decorated cospans at this high level of generality, and shows that under some mild conditions we can compose them, just as in the pictures we saw earlier.</p>
<p>Here&#8217;s one of the theorems Brendan proves:</p>
<p><b>Theorem.</b>  Suppose <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 a category with finite colimits, and make <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 symmetric monoidal category with its <a href="https://en.wikipedia.org/wiki/Coproduct">coproduct</a> as the tensor product.  Suppose <img src='https://s0.wp.com/latex.php?latex=D&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='D' title='D' class='latex' /> is a symmetric monoidal category, and suppose <img src='https://s0.wp.com/latex.php?latex=F%3A+C+%5Cto+D&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='F: C &#92;to D' title='F: C &#92;to D' class='latex' /> is a <a href="http://ncatlab.org/nlab/show/symmetric+monoidal+functor">lax symmetric monoidal functor</a>. Define an <b><i>F</i>-decorated cospan</b> to be a cospan</p>
<div align="center">
<img src="https://i2.wp.com/math.ucr.edu/home/baez/networks/decorated_cospans/cospan.jpg" />
</div>
<p>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 an element of <img src='https://s0.wp.com/latex.php?latex=F%28N%29.&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='F(N).' title='F(N).' class='latex' />   Then there is a category with</p>
<p>&bull; objects 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' /> as its objects,<br />
&bull; isomorphism classes of <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' />-decorated cospans as its morphisms.</p>
<p>This is called the <b><i>F</i>-decorated cospan category</b>, <img src='https://s0.wp.com/latex.php?latex=FCospan.&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='FCospan.' title='FCospan.' class='latex' />  This category becomes symmetric monoidal in a natural way.  It is then a <a href="https://en.wikipedia.org/wiki/Dagger_compact_category">dagger compact category</a>.</p>
<p>(You may not know all this jargon, but &#8216;lax symmetric monoidal&#8217;, for example, talks about how we can take decorations on two things and get a decoration on their disjoint union, or &#8216;coproduct&#8217;.  We need to be able to do this&#8212;as should be obvious from the pictures I drew.  Also, a &#8216;dagger compact category&#8217; is the kind of category whose morphisms can be drawn as networks.)</p>
<p>Brendan also explains how to get functors between decorated cospan categories.  We need this in our paper on electrical circuits, because we consider several categories where morphisms is a circuit, or something that captures some aspect of a circuit.  Most of these categories are decorated cospan categories.  We want to get functors between them.  And often we can just use Brendan&#8217;s general results to get the job done!  No fuss, no muss: all the hard work has been done ahead of time.</p>
<p>I expect to use this technology a lot in my work on network theory.</p>
]]></html><thumbnail_url><![CDATA[https://i0.wp.com/math.ucr.edu/home/baez/networks/decorated_cospans/labelled_graph.jpg?fit=440%2C330]]></thumbnail_url><thumbnail_height><![CDATA[203]]></thumbnail_height><thumbnail_width><![CDATA[222]]></thumbnail_width></oembed>