<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Michi's blog &#187; Category theory</title>
	<atom:link href="http://blog.mikael.johanssons.org/archive/category/mathematics/algebra/category-theory/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.mikael.johanssons.org</link>
	<description>Because my LiveJournal is too silly</description>
	<lastBuildDate>Sat, 12 Nov 2011 15:09:36 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Species, derivatives of types and Gröbner bases for operads</title>
		<link>http://blog.mikael.johanssons.org/archive/2010/12/species-derivatives-of-types-and-grobner-bases-for-operads/</link>
		<comments>http://blog.mikael.johanssons.org/archive/2010/12/species-derivatives-of-types-and-grobner-bases-for-operads/#comments</comments>
		<pubDate>Sat, 18 Dec 2010 01:05:30 +0000</pubDate>
		<dc:creator>Michi</dc:creator>
				<category><![CDATA[Algebra]]></category>
		<category><![CDATA[Category theory]]></category>
		<category><![CDATA[Combinatorics]]></category>
		<category><![CDATA[Haskell]]></category>
		<category><![CDATA[Mathematics]]></category>
		<category><![CDATA[Operads and PROPs]]></category>
		<category><![CDATA[Research]]></category>

		<guid isPermaLink="false">http://blog.mikael.johanssons.org/?p=270</guid>
		<description><![CDATA[This is a typed up copy of my lecture notes from the combinatorics seminar at KTH, 2010-09-01. This is not a perfect copy of what was said at the seminar, rather a starting point from which the talk grew. In some points, I&#8217;ve tried to fill in the most sketchy and un-articulated points with some [...]]]></description>
			<content:encoded><![CDATA[<p><em>This is a typed up copy of my lecture notes from the combinatorics seminar at KTH, 2010-09-01. This is not a perfect copy of what was said at the seminar, rather a starting point from which the talk grew.</p>
<p>In some points, I&#8217;ve tried to fill in the most sketchy and un-articulated points with some simile of what I ended up actually saying.<br />
</em></p>
<p>Combinatorial species started out as a theory to deal with enumerative combinatorics, by providing a toolset &#038; calculus for formal power series. (see Bergeron-Labelle-Leroux and Joyal)</p>
<p>As it turns out, not only is species useful for manipulating generating functions, btu it provides this with a categorical approach that may be transplanted into other areas.</p>
<p>For the benefit of the entire audience, I shall introduce some definitions.</p>
<p><strong>Definition</strong>: A <em>category</em> C is a collection of <em>objects</em> and <em>arrows</em> with each arrow assigned a <em>source</em> and <em>target</em> object, such that </p>
<ol>
<li>Each object has its own <em>identity arrow</em> 1.</li>
<li>Chains of arrows are associatively <em>composable</em>, with 1 the identity of this composition.</li>
</ol>
<p><strong>Examples</strong>: Sets, Finite sets, k-Vector spaces, left and right R-Modules, Graphs, Groups, Abelian groups.</p>
<p><img src='/latexrender/pictures/e19c41413e1b974679b02bd79d5d494c.png' title='\mathbb B' alt='\mathbb B' align='middle' />: finite sets with only bijections as morphisms.</p>
<p><strong>Examples</strong>: </p>
<ul>
<li>Category of a monoid.</li>
<li>Category generated by a graph</li>
<li>Category of a group (groupoid version of the category of a monoid)</li>
<li>Category of a poset</li>
<li>Category of Haskell types and functions.</li>
</ul>
<p><strong>Definition</strong>: A <em>functor</em> F is a map of categories, in other words, a pair of maps Fo on objects and Fa on arrows, such that the identity arrow maps to identity arrows and compositions of maps map to compositions of their images.</p>
<p><strong>Examples</strong>:<br />
Constant functor: sends every object to A, every map to 1.</p>
<p>Identity functor: sends objects and arrows to themselves.</p>
<p>Underlying set functor, free monoid/vector space/module/&#8230; functors.</p>
<p>We are now equipped to define Species:<br />
<strong>Definition</strong>: A <em>species of structures</em> is a functor <img src='/latexrender/pictures/248ed9b3523a819e669addcfca0dd9e1.png' title='\mathbb B\to\mathbb B' alt='\mathbb B\to\mathbb B' align='middle' />.</p>
<p>The idea is a set gets mapped to the set of all structures labelled by the elements in the original set. A bijection on labels maps to the <em>transport of structures</em> along the relabeling. </p>
<p><strong>Examples</strong>:<br />
<img src='/latexrender/pictures/7fc56270e7a70fa81a5935b72eacbe29.png' title='A' alt='A' align='middle' />: rooted trees, labels on vertices<br />
<img src='/latexrender/pictures/dfcf28d0734569a6a693bc8194de62bf.png' title='G' alt='G' align='middle' />: simple graphs, labels on vertices<br />
<img src='/latexrender/pictures/68306c3af365d0638ca6a65e96012770.png' title='Gc' alt='Gc' align='middle' />: connected simple graphs, labels on vertices.<br />
<img src='/latexrender/pictures/0cc175b9c0f1b6a831c399e269772661.png' title='a' alt='a' align='middle' />: trees, labels on vertices.<br />
<img src='/latexrender/pictures/f623e75af30e62bbd73d6df5b50bb7b5.png' title='D' alt='D' align='middle' />: directed graphs, labels on vertices<br />
<img src='/latexrender/pictures/1a13d972a2c8473f075ded6eca465169.png' title='\wp' alt='\wp' align='middle' />: subsets, <img src='/latexrender/pictures/ab03f17fcfe3bf3f9f730c032cf12151.png' title='\wp[U] = \{S: S\subseteq U\}' alt='\wp[U] = \{S: S\subseteq U\}' align='middle' />.<br />
<img src='/latexrender/pictures/87557f11575c0ad78e4e28abedc13b6e.png' title='End' alt='End' align='middle' />: endofunctions<br />
<img src='/latexrender/pictures/a7e871520a392b978d3c9e6344c4407f.png' title='Inv' alt='Inv' align='middle' />: involutions<br />
<img src='/latexrender/pictures/5dbc98dcc983a70728bd082d1a47546e.png' title='S' alt='S' align='middle' />: permutations<br />
<img src='/latexrender/pictures/0d61f8370cad1d412f80b84d143e1257.png' title='C' alt='C' align='middle' />: cycles<br />
<img src='/latexrender/pictures/d20caec3b48a1eef164cb4ca81ba2587.png' title='L' alt='L' align='middle' />: linear orders<br />
<img src='/latexrender/pictures/3a3ea00cfc35332cedf6e5e9a32e94da.png' title='E' alt='E' align='middle' />: sets: <img src='/latexrender/pictures/4784af6daa47ce1b4dc27c7f968b48a3.png' title='E[U] = \{U\}' alt='E[U] = \{U\}' align='middle' /><br />
<img src='/latexrender/pictures/e1671797c52e15f763380b45e841ec32.png' title='e' alt='e' align='middle' />: elements: <img src='/latexrender/pictures/8f19454f9794245cdbaabf2330720444.png' title='e[U] = U' alt='e[U] = U' align='middle' /><br />
<img src='/latexrender/pictures/02129bb861061d1a052c592e2dc6b383.png' title='X' alt='X' align='middle' />: singletons: <img src='/latexrender/pictures/eedeabedbaf43a4ce7a1b347c32faf43.png' title='X[U] = U' alt='X[U] = U' align='middle' /> if <img src='/latexrender/pictures/a03dbebf1f9af1a9557fff5ace5c7534.png' title='|U|=1' alt='|U|=1' align='middle' /> and <img src='/latexrender/pictures/0118beed08546bf49c98e18e68f4e401.png' title='X[U] = \emptyset' alt='X[U] = \emptyset' align='middle' /> otherwise<br />
<img src='/latexrender/pictures/c4ca4238a0b923820dcc509a6f75849b.png' title='1' alt='1' align='middle' />: empty set: <img src='/latexrender/pictures/09f8d10bb99358b7c16cdbe36bea58a0.png' title='1[\emptyset]=\{\emptyset\}' alt='1[\emptyset]=\{\emptyset\}' align='middle' />, <img src='/latexrender/pictures/926ff03720b581dc624f4de2af07bac3.png' title='1[U] = \emptyset' alt='1[U] = \emptyset' align='middle' /> otherwise<br />
<img src='/latexrender/pictures/cfcd208495d565ef66e7dff9f98764da.png' title='0' alt='0' align='middle' />: empty species: <img src='/latexrender/pictures/e864d4557560227f5f4276edab39b730.png' title='0[U] = \emptyset' alt='0[U] = \emptyset' align='middle' />.</p>
<p>In enumerative combinatorics, the power of species resides in the association to each species a number of generating functions:</p>
<p>The generating series of a species F is the exponential formal power series<br />
<img src='/latexrender/pictures/4d16123f57c0b624af2c2edf792d1cd8.png' title='F(x) = \sum_{n=0}^\infty |F[n]|\frac{x^n}{n!}' alt='F(x) = \sum_{n=0}^\infty |F[n]|\frac{x^n}{n!}' align='middle' /><br />
where we use the convention <img src='/latexrender/pictures/aa863c04e18ac592a7560ac3e3a581b1.png' title='[n] = \{1,2,\dots,n\}' alt='[n] = \{1,2,\dots,n\}' align='middle' />, and <img src='/latexrender/pictures/e246dceb6995c5555b1eeb2d505e1708.png' title='F[n] = F[[n]]' alt='F[n] = F[[n]]' align='middle' />.<br />
Thus:<br />
<img src='/latexrender/pictures/3263ff4d9c8a689eae466290bc3052c8.png' title='L(x) = \frac{1}{1-x}' alt='L(x) = \frac{1}{1-x}' align='middle' /><br />
<img src='/latexrender/pictures/3f525bcdaa7612df493b0d76e1364151.png' title='S(x) = \frac{1}{1-x}' alt='S(x) = \frac{1}{1-x}' align='middle' /><br />
<img src='/latexrender/pictures/f77a81e173d3ac51473b37a36e4b323c.png' title='E(x) = e^x' alt='E(x) = e^x' align='middle' /><br />
<img src='/latexrender/pictures/7c5625058ffe6ddb20482fc3079c784a.png' title='e(x) = xe^x' alt='e(x) = xe^x' align='middle' /><br />
<img src='/latexrender/pictures/9063d24c51c77a8c1f84d329a2bed613.png' title='\wp(x) = e^{2x}' alt='\wp(x) = e^{2x}' align='middle' /><br />
<img src='/latexrender/pictures/38d07f869ac97a6ed1deb8574ed0953e.png' title='X(x) = x' alt='X(x) = x' align='middle' /><br />
<img src='/latexrender/pictures/da2ca5efb767fbf1d7d2b4409f3c83f0.png' title='1(x) = 1' alt='1(x) = 1' align='middle' /><br />
<img src='/latexrender/pictures/a78d5784bdd192b7dc4c1b784d719d26.png' title='0(x) = 0' alt='0(x) = 0' align='middle' /></p>
<p>There are a number other in use for combinatorics, but for my purposes, this is the one I&#8217;ll focus on.</p>
<h2>Operations on species</h2>
<p>The real power, though, emerges when we start combining species, and carry over the combinations to actions on the corresponding power series.</p>
<h3>Addition</h3>
<p>The number of ways to form either, say, a graph or a linear order on a set of labels is the sum of the numbers of ways to form either in isolation.</p>
<p>This corresponds cleanly to the coproduct in Set, and we may write F+G for the species<br />
<img src='/latexrender/pictures/d6b9d55d36e1ef2d9b3cce2ce7b09615.png' title='(F+G)[U] = F[U] + G[U]' alt='(F+G)[U] = F[U] + G[U]' align='middle' /><br />
(where the second + is the coproduct — i.e. disjoint union — of sets)</p>
<p>In the power series, we get <img src='/latexrender/pictures/66cb1c86460c5b712cc3ba8b2a0d173b.png' title='(F+G)(x) = F(x) + G(x)' alt='(F+G)(x) = F(x) + G(x)' align='middle' />.</p>
<p>Examples: We may define the species of all non-empty sets <img src='/latexrender/pictures/335d135de25fe2dbf0ccd0f20e0150e1.png' title='E_+' alt='E_+' align='middle' /> by<br />
<img src='/latexrender/pictures/d3315d79ecf2826aaf6b198de80e58d7.png' title='E = 1 + E_+' alt='E = 1 + E_+' align='middle' /><br />
This kind of functional equations is where the theory of species starts to really <em>shine</em>.</p>
<h3>Multiplication</h3>
<p>A tricoloring of a set is a subdivision of the set into three disjoint subsets covering the original set. The number of tricolorings of size n is<br />
<img src='/latexrender/pictures/2cfc95b03d7d4f37d4b7410b9361c214.png' title='\sum_{i+j+k=n} \#\text{sets of size i}\cdot\#\text{sets of size j}\cdot\#\text{sets of size k}' alt='\sum_{i+j+k=n} \#\text{sets of size i}\cdot\#\text{sets of size j}\cdot\#\text{sets of size k}' align='middle' /></p>
<p>A permutation fixes some set of points. The permutation restricted to the non-fixed points is a <em>derangement</em>. Total number of permutations on n elements is<br />
<img src='/latexrender/pictures/475edeb2b536c63ecf62bc9221c06f10.png' title='\sum_{i+j=n}\#\text{sets of size i}\cdot\#\text{derangements of size j}' alt='\sum_{i+j=n}\#\text{sets of size i}\cdot\#\text{derangements of size j}' align='middle' /></p>
<p>In both of these cases, the total generating series is a product of the component series, and we end up defining<br />
<img src='/latexrender/pictures/f05a2036cc62d20e8b6c8a7262f09461.png' title='F\cdot G[U] = \{(f,g): f\in F[U_1], g\in G[U_2], U_1\cap U_2 = \emptyset, U_1\cup U_2 = U\}' alt='F\cdot G[U] = \{(f,g): f\in F[U_1], g\in G[U_2], U_1\cap U_2 = \emptyset, U_1\cup U_2 = U\}' align='middle' /><br />
So <img src='/latexrender/pictures/25b126e16d73bffde96f15011ec62ba6.png' title='F\cdot G[U] = \sum_{U_1,U_2\text{ decompose }U} F[U_1]\times G[U_2]' alt='F\cdot G[U] = \sum_{U_1,U_2\text{ decompose }U} F[U_1]\times G[U_2]' align='middle' />.</p>
<p>Thus, tricolorings are <img src='/latexrender/pictures/77d013a0d46948384f8cd9b41535b43c.png' title='E\cdot E\cdot E' alt='E\cdot E\cdot E' align='middle' /> and permutations are <img src='/latexrender/pictures/65637937dfc1372e746af745b30dabe8.png' title='S = E\cdot Der' alt='S = E\cdot Der' align='middle' />, where the set is that of fixed points, and the derangement captures the actual action of the permutation.</p>
<h3>Composition</h3>
<p>Endofunctions of sets decompose in their actions on the points as cycles or directed trees leading in to these cycles.</p>
<p>Since a collection of disjoint cycles corresponds to a permutation, we can consider such endofunctions to be permutations decorated with rooted trees attached to points of the permutations; or even permutations of rooted trees.</p>
<p>To form such a structure on a set U, we&#8217;d first partition U into subsets, put the structure of a rooted tree on each subset, and then the structure of a permutation on the set of these subsets.</p>
<p>Thus, the number of such structures on n elements is<br />
<img src='/latexrender/pictures/335e2e52de4ab24686357d7fff2b2b15.png' title='\sum_{r\leq n}\sum_{\sum_{k=1}^n i_k = n} \#\tex{permutations on [r]}\cdot\prod_{k=1}^r\#\text{rooted trees on [i_k]}' alt='\sum_{r\leq n}\sum_{\sum_{k=1}^n i_k = n} \#\tex{permutations on [r]}\cdot\prod_{k=1}^r\#\text{rooted trees on [i_k]}' align='middle' /></p>
<p>This corresponds to the power series <img src='/latexrender/pictures/e0411f63150f22a2f99be1510b5910f0.png' title='S(A(x))' alt='S(A(x))' align='middle' />, and we write, in general, <img src='/latexrender/pictures/31029fa092055be1deacf9e244f20333.png' title='F\circ G[U]' alt='F\circ G[U]' align='middle' /> for the species of F-structures of G-structures on subsets.</p>
<p><strong>Examples</strong>:<br />
A = X·E(A)<br />
L = 1 + X·L<br />
B = 1 + X·B·B</p>
<h3>Pointing</h3>
<p>Picking out a single point in a structure on n points can be done in precisely n ways.</p>
<p>Thus the corresponding generating function will be<br />
<img src='/latexrender/pictures/149891bfc400f34cdb0f99d080acc7ef.png' title='\sum n\cdot f_n\cdot\frac{x^n}{n!}' alt='\sum n\cdot f_n\cdot\frac{x^n}{n!}' align='middle' /><br />
for f-structures with a single label distinguished.</p>
<p>Since we&#8217;re working with exponential power series, we may notice that<br />
<img src='/latexrender/pictures/c561d318629404536b769f934f360554.png' title='\frac{\partial}{\partial x} \sum f_n\frac{x^n}{n!} = \sum f_{n+1}\frac{x^n}{n!}' alt='\frac{\partial}{\partial x} \sum f_n\frac{x^n}{n!} = \sum f_{n+1}\frac{x^n}{n!}' align='middle' /><br />
and thus that derivatives are shifts.<br />
Furthermore, <img src='/latexrender/pictures/be3a9d4b57954e8b767df9234c2529b4.png' title='x\cdot\sum f_n\frac{x^n}{n!} = \sum f_n\frac{x^{n+1}}{n!} = \sum f_{n-1}n\cdot{x^n}{n!}' alt='x\cdot\sum f_n\frac{x^n}{n!} = \sum f_n\frac{x^{n+1}}{n!} = \sum f_{n-1}n\cdot{x^n}{n!}' align='middle' /><br />
so that the generating function for F-structures with a single distinguished are<br />
<img src='/latexrender/pictures/594ef9019767eed975d7e51efbddf20a.png' title='F^\bullet(x) = x\cdot\frac{\partial}{\partial x}F(x)' alt='F^\bullet(x) = x\cdot\frac{\partial}{\partial x}F(x)' align='middle' /></p>
<p>In species, this process is called pointing.</p>
<p>In functional programming, Conor McBride related this construction to Huet&#8217;s Zipper datatypes.</p>
<p>As it turns out, many of the constructions for species make eminent sense outside the category <img src='/latexrender/pictures/e19c41413e1b974679b02bd79d5d494c.png' title='\mathbb B' alt='\mathbb B' align='middle' />. In fact, species in Hask are known to programming language researchers as <em>container datatypes</em> and the whole calculus translates relatively cleanly.</p>
<p>Functional equations translate to the standard new data type definitions in Haskell.</p>
<p><strong>Examples</strong>:<br />
L = 1 + X·L<br />
<code><br />
data List a = Nil | Cons a (List a)<br />
</code></p>
<p>B = 1 + X·B·B<br />
<code><br />
data BinaryTree a = Leaf | Node (BinaryTree a) a (BinaryTree a)<br />
</code></p>
<p>A = X·E(A)<br />
<code><br />
data RootedTree a = Node a (Set (RootedTree a))<br />
</code><br />
usually, we simulate the Set here by a List. If we need for our rooted trees to be planar, we can in fact impose a Linear Order structure instead, and get something like<br />
Ap = X·L(Ap)</p>
<p>The species interpretation of <img src='/latexrender/pictures/4d6c379f66675645b3ffe28a15306857.png' title='\frac{\partial}{\partial x}' alt='\frac{\partial}{\partial x}' align='middle' /> corresponding to leaving a hole in the structure carries over cleanly, so that <img src='/latexrender/pictures/27f5948c4a69349055a73e917f5f5b6e.png' title='\frac{\partial}{\partial x}T' alt='\frac{\partial}{\partial x}T' align='middle' /> is the type of T-with-a-hole.</p>
<h2>Two derivatives of lists</h2>
<p>We can deal with  <img src='/latexrender/pictures/12b5d0430c70edf45c18de84a4609c6b.png' title='\frac{\partial}{\partial x}L' alt='\frac{\partial}{\partial x}L' align='middle' /> in two different ways:</p>
<p>1.<br />
DL = D(1+X·L) = D1 + D(X·L) = 0 + DX·L+X·DL<br />
and thus<br />
DL-X·DL = 1·L<br />
so (1-X)·DL = L<br />
and thus<br />
DL = L·1/(1-X)</p>
<p>Now, from L=1+X·L follows by a similar cavalier use of subtraction and division — which, by the way, in species theory is captured by the idea of a <em>virtual species</em>, and dealt with relatively cleanly — that<br />
L = 1+X·L<br />
so<br />
L-X·L = 1<br />
and thus<br />
(1-X)·L = 1<br />
so<br />
L = 1/(1-X)</p>
<p>Thus, we can conclude that<br />
DL = L·1/(1-X) = L·L<br />
and thus, a list with a hole is a pair of lists: the stuff before the hole and the stuff after the hole.</p>
<p>2.<br />
We could, instead of using implicit differentiation, as in 1, attack the derivation we had of<br />
L = 1/(1-X) = 1+X+X·X+X·X·X+…</p>
<p>Indeed,<br />
DL = D(1/(1-X)) = D(1+X+X·X+…) = 0+1+2X+3X·X+…<br />
which we can observe factors as<br />
= (1+X+X·X+X·X·X+…)·(1+X+X·X+X·X·X+…) = L·L</p>
<p>Or we can just use the division rule<br />
DL = D(1/(1-X)) = D(1/u)·D(1-X) = -1/(u·u)·(-1) = 1/[(1-X)·(1-X)] = L·L</p>
<h2>Gröbner bases for operads</h2>
<p>All of this becomes relevant to the implementation of Buchberger&#8217;s algorithm on shuffle operads (see Dotsenko—Khoroshkin and Dotsenko—Vejdemo-Johansson)  in the step where the S-polynomials (and thereby also the reductions) are defined. With a common multiple defined, we need some way to extend the modifications that take the initial term to the common multiple to the rest of that term.</p>
<p>For this, it turns out, that the derivative of the tree datatype used provides theoretical guarantees that only partially filled in trees of the right size, with holes the right size, can be introduced; and also provides an easy and relatively efficient algorithm for contructing the hole-y trees and later filling in the holes.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.mikael.johanssons.org/archive/2010/12/species-derivatives-of-types-and-grobner-bases-for-operads/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>[Stanford] MATH 198: Category Theory and Functional Programming</title>
		<link>http://blog.mikael.johanssons.org/archive/2009/08/stanford-math-198-category-theory-and-functional-programming/</link>
		<comments>http://blog.mikael.johanssons.org/archive/2009/08/stanford-math-198-category-theory-and-functional-programming/#comments</comments>
		<pubDate>Sat, 29 Aug 2009 06:19:27 +0000</pubDate>
		<dc:creator>Michi</dc:creator>
				<category><![CDATA[Category theory]]></category>
		<category><![CDATA[English]]></category>
		<category><![CDATA[Haskell]]></category>
		<category><![CDATA[Teaching]]></category>

		<guid isPermaLink="false">http://blog.mikael.johanssons.org/?p=226</guid>
		<description><![CDATA[Category theory, with an origin in algebra and topology, has found use in recent decades for computer science and logic applications. Possibly most clearly, this is seen in the design of the programming language Haskell &#8211; where the categorical paradigm suffuses the language design, and gives rise to several of the language constructs, most prominently [...]]]></description>
			<content:encoded><![CDATA[<p>Category theory, with an origin in algebra and topology, has found use in recent decades for computer science and logic applications. Possibly most clearly, this is seen in the design of the programming language Haskell &#8211; where the categorical paradigm suffuses the language design, and gives rise to several of the language constructs, most prominently the Monad.</p>
<p>In this course, we will teach category theory from first principles with an eye towards its applications to and correspondences with Haskell and the theory of functional programming. We expect students to previously or currently be taking CS242 and to have some level of mathematical maturity. We also expect students to have had contact with linear algebra and discrete mathematics in order to follow the motivating examples behind the theory expounded.</p>
<p>Wednesdays at 4.15.</p>
<p>Online notes will appear successively on the Haskell wiki on http://haskell.org/haskellwiki/User:Michiexile/MATH198</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.mikael.johanssons.org/archive/2009/08/stanford-math-198-category-theory-and-functional-programming/feed/</wfw:commentRss>
		<slash:comments>14</slash:comments>
		</item>
		<item>
		<title>Soliciting advice</title>
		<link>http://blog.mikael.johanssons.org/archive/2009/07/soliciting-advice/</link>
		<comments>http://blog.mikael.johanssons.org/archive/2009/07/soliciting-advice/#comments</comments>
		<pubDate>Wed, 22 Jul 2009 14:28:55 +0000</pubDate>
		<dc:creator>Michi</dc:creator>
				<category><![CDATA[Category theory]]></category>
		<category><![CDATA[English]]></category>
		<category><![CDATA[Haskell]]></category>
		<category><![CDATA[Teaching]]></category>

		<guid isPermaLink="false">http://blog.mikael.johanssons.org/?p=224</guid>
		<description><![CDATA[Dear blogosphere, come this fall, I shall be teaching. My first lecture course, ever. The subject shall be on introducing Category Theory from the bottom up, in a manner digestible for Computer Science Undergraduates who have seen Haskell and been left wanting more from that contact. And thus comes my question to you all: what [...]]]></description>
			<content:encoded><![CDATA[<p>Dear blogosphere, </p>
<p>come this fall, I shall be teaching. My first lecture course, ever.</p>
<p>The subject shall be on introducing Category Theory from the bottom up, in a manner digestible for Computer Science Undergraduates who have seen Haskell and been left wanting more from that contact.</p>
<p>And thus comes my question to you all: what would you like to see in such a course? Is there any advice you want to give me on how to make the course awesome?</p>
<p>The obvious bits are obvious. I shall have to discuss categories, functors, (co)products, (co)limits, monads, monoids, adjoints, natural transformations, the Curry-Howard isomorphism, the Hom-Tensor adjunction, categorical interpretation of data types. And all of it with explicit reference to how all these things influence Haskell, as well as plenty of mathematical examples.</p>
<p>But what ideas can you give me to make this greater than I&#8217;d make it on my own?</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.mikael.johanssons.org/archive/2009/07/soliciting-advice/feed/</wfw:commentRss>
		<slash:comments>23</slash:comments>
		</item>
		<item>
		<title>PROPs and patches</title>
		<link>http://blog.mikael.johanssons.org/archive/2008/02/props-and-patches/</link>
		<comments>http://blog.mikael.johanssons.org/archive/2008/02/props-and-patches/#comments</comments>
		<pubDate>Fri, 15 Feb 2008 18:59:26 +0000</pubDate>
		<dc:creator>Michi</dc:creator>
				<category><![CDATA[Algebra]]></category>
		<category><![CDATA[Category theory]]></category>
		<category><![CDATA[Operads and PROPs]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://blog.mikael.johanssons.org/archive/2008/02/props-and-patches/</guid>
		<description><![CDATA[Brent Yorgey wrote a post on using category theory to formalize patch theory. In the middle of it, he talks about the need to commute a patch to the end of a patch series, in order to apply a patch undoing it. He suggests a necessary condition to do this is that, given patches P [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://byorgey.wordpress.com">Brent Yorgey</a> wrote a post on <a href="http://byorgey.wordpress.com/2008/02/13/patch-theory-part-ii-some-basics/">using category theory to formalize patch theory</a>. In the middle of it, he talks about the need to commute a patch to the end of a patch series, in order to apply a patch undoing it. He suggests a necessary condition to do this is that, given patches P and Q, we need to be able to find patches Q&#8217; and P&#8217; such that PQ=Q&#8217;P', and preferably such that Q&#8217; and P&#8217; capture some of the info in P and Q.</p>
<p>However, as such, this is not enough to solve the issue. For one thing, we can set Q&#8217;=P and P&#8217;=Q, and things are the way he asks for.</p>
<p>Now, I wonder whether we can solve this by using PROPs (or possibly di-operads or something like that). Let&#8217;s represent a document as a list of some sort of tokens. We&#8217;ll set <img src='/latexrender/pictures/e4f7629b574dd05d19a2107c87806700.png' title='D_n' alt='D_n' align='middle' /> the set of all lists of length <img src='/latexrender/pictures/7b8b965ad4bca0e41ab51de7b31363a1.png' title='n' alt='n' align='middle' />, and we&#8217;ll set <img src='/latexrender/pictures/8f771bc1b32729794ded2f43f30110d3.png' title='P_n^m' alt='P_n^m' align='middle' /> to denote operations that take a list of length n and returns a list of length m.</p>
<p>One operation here is obvious &#8211; the identity operation. So we&#8217;ll take that into the mix. And we&#8217;ll also want to have some manner of composing operations. So, set <img src='/latexrender/pictures/3b72682c4921e5ee163a8aa583f9ba9e.png' title='\circ_i:P_n^m\times P_r^s\to P_n^{m+s-r}' alt='\circ_i:P_n^m\times P_r^s\to P_n^{m+s-r}' align='middle' /> to be the operation that applies the second argument to the elements i,i+1,&#8230;,i+m of the list outputted by the first argument.</p>
<p>This way, we can make patch trees &#8211; using the identities to fill out when a patch doesn&#8217;t influence everything; and have composition of operations represent composition of patches.</p>
<p>Now, the commutativity that Brent asks for would manifest as an additional relation &#8211; on top of those inherent in the definition of a PROP &#8211; to rebuild trees. One obvious one pops out immediately &#8211; as long as the trees don&#8217;t overlap, in other words, as long as the subtree we want to reorganize is contractible (in the topological sense), we can commute patches freely.</p>
<p>When trees -do- overlap, however, the undo operation Brent asks for is much more tricky. Consider the following sequence of edits:</p>
<p>[] -> [a] -> [b] -> [cbd]</p>
<p>Now, undo the insertion of [a].</p>
<p>Sure, taken this way, we cheat a little. Maybe we want to restrict edit descriptions to explicit deletions and additions. So we would have</p>
<p>[] -> [a] -> [] -> [b] -> [cb] -> [cbd]</p>
<p>and here we could probably move things around a bit easier. I don&#8217;t quite see how to do it, right now, though.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.mikael.johanssons.org/archive/2008/02/props-and-patches/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

