h1

Thoughts on the Goodwillie Calculus

August 2, 2010

So I haven’t gotten to do much blogging in the past few months on account of having to finish up my dissertation and move to Lausanne, Switzerland for my first job here at the EPFL.  Now that I’m settled, I have much more time to devote to writing here and doing mathematics in general, so hopefully posts here will become much more regular.

For my first entry of the post-graduate student era, I figured I’d respond to, or at least share my thoughts about, the discussion about Goodwillie Calculus going on here and here, perhaps expanding a bit on the comments I made in my research statement.

John Baez points out, and I think rightly so, in his comments on n-Forum that the Goodwiliie Calculus is often presented in a way that seems at odds with an interpretation in terms of categorification.  If we are going to categorify linear functions into linear functors, then they should preserve colimits, and certainly the identity functor should be an example.  As it stands, the whole theory of Goodwillie Calculus seems to demand an explanation for why it must make the bizzare modifications to our understanding of ordinary calculus that it does, and I agree with John that there should be a “disentangled” version which serves as a kind of reference point for the idea of “categorified calculus”, and of which the Goodwillie Calculus can be seen as a particular example.

The situation we find ourselves in, though, seems to be that we have a particular example where something like a categorified version of calculus can be set up, but it’s already much more complicated than the situation which we ordinarily take as a starting point for ordinary calculus (namely, functions \mathbb{R} \rightarrow \mathbb{R}).  It’s as if we had discovered Riemann surfaces before we knew anything about the real numbers.  Let me explain.

It has been my conviction for a while now that the Goodwiliie Calculus is a categorification of the following setup:  suppose we have a holomorphic map of Riemann surfaces f : Y \rightarrow X.  Then people often think of a holomorphic map h : Y \rightarrow \mathbb{C} as a “multi-valued” holomorphic function g on X, the multiple values at a point p \in X arising from the various values of h on the elements of f^{-1}(p).  One says that the holomorphic function h “represents” the multi-valued function g.

Let’s take Y = \mathbb{C} and X = \mathbb{C}^*.  Then we have the familiar diagram (which I realize is not a real diagram, since \mathrm{log} is not defined on all of \mathbb{C}^*, but I can’t do dotted arrows, and you get the idea . . .)

\begin{aligned} \mathbb{C} & \overset{\quad \mathrm{id} \quad}{\to} & \mathbb{C} \\ {}^{\mathrm{exp}} \downarrow & \quad \nearrow {}_{\mathrm{log}} & \\ \mathbb{C}^* \end{aligned}

So in this setup, the identity function \mathrm{id} : \mathbb{C} \rightarrow \mathbb{C} represents the logarithm.  My contention is that the Goodwillie Calculus ariese from this situation by replacing \mathbb{C} with the category of spaces, \mathbb{C}^* with the category of infinite loop spaces, \mathrm{exp} with the “free homotopy commutative monoid” and \mathrm{log} with the inclusion, and that this should ultimately be the explanation for claims like

‘The Goodwillie tower of the identity is a logarithm’.

Probably not too many readers of n-Forum will have much trouble believing that the “free homotopy commutative monoid” functor should play the role of the exponential.  A great way to see that this ought to be the case is by looking at Leinster’s work on Euler characteristics of categories.  If we let small categories represent our homotopy types, then each small category \mathcal{C} determines a functor \mathbb{B} \rightarrow \mathcal{C}at by

n \mapsto \mathcal{C}^n

and the Grothendieck construction on this functor (i.e. it’s homotopy colimit), which I will denote P(\mathcal{C}), is a model for the “free homotopy commutative monoid” which in this case is called the “free permutative category on \mathcal{C}.”  Moreover \chi(P(\mathcal{C})) = \mathrm{exp}(\chi(\mathcal{C})) whenever \chi(\mathcal{C}) is defined.  Up to group completion, this is the homotopy theorist’s \Omega^\infty \Sigma^\infty N(\mathcal{C}), which should be the origin of statements like

\Omega^\infty \Sigma^\infty is “like” e^{x-1}

modulo this whole business of understanding the basepoint.

By the statement

…the category of spectra plays the role of the tangent space to the category of spaces at the one-point space

I believe I mean something like the following (though I’m not sure.  It was my research statement, after all.) If we were to temporarily agree that the category of infinite loop spaces was “flat” in some sense, then we might agree that the tangent space at QS^0 = \Omega^\infty \Sigma^\infty S^0 was again just the category of infinite loop spaces.  Somehow I’d like to say that the category of spectra is what we get by “pulling back” this tangent space along “\mathrm{exp}“  In the ordinary, Riemann surface picture, the fiber over a point p \in \mathbb{C}^* is isomorphic to \mathbb{Z}, so pulling back the tangent space at p gives us a “\mathbb{Z}‘s” worth of copies of the same space.  In the homotopy world, all these copies are connected by suspension in the category of spectra, which shifts us up and down the “fiber”.  Well, this one may be a stretch.

Finally, let’s look at the statement

one can interpret this as saying that spaces have some kind of non-trivial curvature

As was already pointed out, curvature may be the wrong word to use here.  When we imagine the exponential map \mathrm{exp} : \mathbb{C} \rightarrow \mathbb{C}^*, most of us think of the standard picture of a giant thickened spiral covering the plane.  Of course, set theoretically, this is just in our imagination: the exponential map simply sends one point in the complex plane to another.  But another way to build the same Riemann surface is to start with the power series for \mathrm{log} and analytically continue it, patching together the various branches, eventually arriving at a space homeomorphic to \mathbb{C}, but which lacks all the niceties, such as a canonical addition and multiplication.  My assertion would be that the category of spaces remembers that it arises in this second way, and this is the source of what we have been calling “curvature.”  (Someone remind me: isn’t it true that the spiral is flat from a geometric point of view? Maybe this could explain Goodwiliie’s remarks . . .)

I better wrap this up here, as this post is getting pretty long here.  I guess I can sumarize what I’m getting at as follows: the Goodwiliie Calculus, as it’s currently described, should be an example of a more general theory of “categorified calculus” which specializes to something like combinatorial species in the discrete case.  In this sense I agree with the thrust of Joyal’s description of the situation.  It seems to me that such a thing must intrinsically involve homotopy theory, and I have wondered for a long time how to create some kind of “toy model” which has many of the features, but not the complexity, of the Goodwiliie Calculus, but I must confess that as of yet, I don’t know what this should look like.

h1

Extending wplatex

January 31, 2010

It’s amazing how good snow is for your productivity. Maybe I should move to Antarctica.

Anyways, I added some rudimentary support for displaying source code using the listings package. Let me show you how this was done as an example of how to add support for whatever packages and macros you would like.

So first of all, plasTeX is pretty smart about understanding the packages that you are using in a Latex document. It will parse your preamble and do the best it can to load and parse the packages you are using as well. This is great if you have, say, some custom macros put aside that you always reference. So if you put a \usepackage{mymacros} in your preamble, plasTeX will find the mymacros.sty file the same way Latex would, parse the file, and then understand how to expand the macros contained therein. This is the default behavior.

For more complicated packages, like listings, for example, there’s a better way. Instead of letting plasTeX load and parse the source, we can choose to tell plasTeX about which commands we care about directly in python. This saves a lot of time and adds a lot of flexibility. (By the way, this has already been done for a bunch of packages that you might want to use, like amsmath, amssymb, graphicx and more.)

Now, when plasTeX finds a \usepackage command in your preamble, before it tries to load the latex source, it will look for a python module on the path which shares the same name as the package specified. This means if I put a file called listings.py somewhere in my python path, when plasTeX sees the \usepackage{listings} at the top of my file, this module will get loaded instead of the Latex source. For convenience, I have the wplpost program add the wplatex package directory to the python path, so you can just add any package code to that directory, reinstall, and everything should work automatically.

Great. So what should go in the python package definition. This is easy: you just define a class for any command that the package let’s you use. In our case, the listings package defines a new environment called lstlisting. When you put source code in this environment, the package will render it in your Latex output. Thus I have the following class definition in the file wplatex/listings.py

  from plasTeX.Base.LaTeX.Verbatim import verbatim

  # This should be a verbatim environment
  class lstlisting(verbatim):
    pass

In most cases, your new class will derive from either the plasTeX.Base.Command or plasTeX.Base.Environment classes, depending on whether you want to tell plasTeX about a new command or a new environment. In the current case, we want to use a special kind of environment, a verbatim environment, since we don’t want to do any rendering or parsing of the code inside. That’s why I’ve derived this class from verbatim.

In the future, this class could override some of its base class’ methods, particularly invoke(), and do some preprocessing like figure out what language to use and add any formatting information. It’s nice to notice, though, that just telling plasTeX about the command by creating a dummy class is enough for it to now recognize it in a Latex source file.

We’re almost done. The only thing left to do is to tell renderer what we want to see when plasTeX encounters one of these environments. The code for the renderer is contained in the file wplate/renderer.py. I added the following method to the WPRenderer class:

    def do_lstlisting(self, node):
        '''Encode Source code blocks
        
        Arguments:
        - `node`:
        '''
        return u'<sourcecode language=Python>%s</sourcecode>' % unicode(node)  

Ridiculously simple, no? All this method does is return a unicode string which we would like to see in the output. The command

  unicode(node)

renders all the children of our lstlisting node in plasTeX’s internal tree representation of our document. Since we’ve already told plasTeX that the lstlisting environment should be verbatim, this will just return all the text found inside. We then plug that in between WordPress’ tag for source code and return the result.

And that’s it! After reinstalling the wplatex package to udpate the code, the wplpost program now understands how to post source code. Not bad for two or three lines of code. In fact, in continuing with the incredibly self-referential tone of the past couple posts, I’ve used this functionality in writing the post you’re reading. Here’s a screenshot.

You can take a look at the source code to see how I’ve implemented other commands and environments. There’s still a lot to do, but I hope this post makes it clear how easy it is to add or customize the output that you send to WordPress. If you do get around to adding support for more things, I hope you’ll drop me an e-mail. And now, I’m making myself some spaghetti.

h1

Overview of wplatex

January 30, 2010

Man, we are getting a lot of snow today. I guess that means I’ll stay inside and describe how to use the wplatex package that I put together.

Okay, so like I said in the last post, you should be able to install the package using the standard way for Python packages. Unzip it into whatever directory you like, then do a

 
    sudo python setup.py install
   

Next, copy the wpblogentry.cls document class definition file into your Latex path. This is usually something like /usr/share/texmf/.... Basically do whatever you have to on your system to make latex find the definition.

At this point, you should be able to make a Latex blog entry by doing something like this:

 
    \documentclass{wpblogentry}

    \title{A Latex Blog Entry}
    \tags{tag1, tag2}
    \category{latex}

    \begin{document}

      Your blog entry

    \end{document}
   

The package will install a script called wplpost on your system, so when you have got your blog entry looking like you want it, you’ll want to run this script to render it and upload it to wordpress. The script will prompt you for a username and password, but you can also specify them on the command line using the -u and -p options respectively. You also need to specify where to upload the post to. You can do this two different ways, using either the -b or -x options. If you do -b blogname, then the script will guess that it can access your blog’s xmlrpc.php file at

 

http://blogname.wordpress.com/xmlrpc.php

   

If this is not the correct location, you can specify the url directly using the -x option. As an example, I would upload this blog entry by doing

 
    wplpost -u ericfinster -b curiousreasoning wplatex.tex
   

Note that this form will automatically publish the post as well. If you would like to upload the post as a draft only, you can specify -d and you should then be able to go in and preview it on WordPress before you actually publish the result.

I think this much should be functional right now. I’m going to try to get the listings package working so that I can write source code in my entries. When I’m done, I’ll write a post about how to extend wplatex’s renderer so that you can add customizations if you like. Cheers everyone.

h1

Update: wplatex

January 29, 2010

Okay, I built a python package, called wplatex, which contains the code for everything I described below. This is still in a very early state, but if anyone wants to play with it, feel free. You can download the package here. Once you’ve unzipped it, install it using the setup.py script as usual. (i.e. (sudo) python setup.py install)

There’s a custom Latex class definition file called wpblogentry.cls which you should put in your Latex path. Then use this for the documentclass in each of your entries. I’ll maybe say more about what else you can do tomorrow, but I think I’ll quit for tonight.

h1

More on Blogging in Latex

January 28, 2010

Okay, so the irony of making a couple of posts about how great my blogging setup was, and then not writing anything else, is not lost on me. Before you completely write me off, I beg you, hear me out.

See, I was thinking about starting a series of posts on just some basic set theory. I figure, if this is going to be a place where I can describe some of my work, I better start at the beginning. Besides, even though set theory is pretty simple and cool and easy to explain, you can get into some interesting and deep ideas pretty quickly. I love the theory of ordinal numbers, for example, so I thought I would write about normal forms and the like

But the problem is, set theory is much easier to explain with pictures, so I needed to be able to draw pictures and post them along with the mathematics. And it occured to me, that in the spirit of automating my Latex posts, I ought to be able to extract any images I include and have them uploaded and linked in automatically. Unfortunately, the script latex2wp.py which I described before doesn’t really do anything like this.

And there were a couple other things I wanted: the script should automatically know the title of my post. (I did hack up a quick kludge to do this, but it wasn’t pretty.) And I should be able to make a new Latex macro to record my tags and categories.

In other words, I am a perfectionist. Even though I had things pretty well automated already, it was driving me crazy that there were a couple of loose ends, and I was compelled by my twisted brain to look into them.

My first conclusion was that the latex2wp.py script was nice, but that it was going to be difficult to make it really do all the things I wanted. The script was clearly meant to be called from the command line, to perform its basic transformations and quit. There was no support for parsing and understanding what your Latex file said, storing the information, and customizing a post based on the content. And when I thought about it, this is what I was really after.

Enter plasTeX. This was what I was really envisioning in my head all along. It parses your Latex document into a something like a custom DOM so that you can perform arbitrary transformations and rendering operations. Moreover, it’s extensible, object-oriented, Unicode aware, and written in Python. Combined with wordpresslib, which I mentioned before, this seemed like the best way of getting real integration between the Latex I was writing on my computer, and the posts that I sent out to the web.

So I’ve been working on this idea for the past couple of days, and finally came up with this. It basically does everything I wanted, and in the future could do even more, since it’s extremely easy to add new features. Automatically making use of WordPress’ source code feature comes to mind, along with more flexible rendering of arrays, aligns, and diagrams. You get the idea.

Unfortunately, there’s a bit more to getting this to work now than just running the script linked to above (you need a couple auxillary files and some paths to be set correctly) but I’ll try to tar up what you need and post some instructions in the next day or so.

I guess that’s all for now. I’m hungry.

h1

Blogging Screenshots

January 22, 2010
h1

LaTeX Blogging with Emacs

January 21, 2010

As a mathematician, I am constantly using Latex to write mathematics. I use it for my own notes and ideas, for writing papers, doing homework, making quizzes and handouts for my class, just about everything. In fact, since I’ve become reasonably profficient, I find little use for any other word processors. The separation that Latex provides between the contents of a document and its format is extremely useful, and now that I’m used to it, I find that most WYSIWYG editors make it more difficult to get a document formatted like you want it, not less. Besides, writing most of my documents in Latex means I get to spend plenty of time with one of my favorite pieces of software, GNU Emacs.

Seriously. It’s the best.

For a long time I’ve had a really comfortable setup in Emacs where I can just open a new document, insert a standard header for notes, and begin writing. There’s essentially no setup time, and I get straight to the point where I can start doing math. I don’t even really need a pen and paper now. I can do most of my thinking at the keyboard, and that way have everything archived and organized. This is much superior the the mountain of notebook paper from years past which threatens to consume my room as we speak.

But it had long been in the back of my mind that really these notes form something like my mathematical diary, and that if I were to spend just a bit more time explaining the things I was doing, they would form the basis for a blog which covers my work. The only thing left was to sort of streamline the process of cleaning things up and posting them online. So let me describe how I can do that now.

There’s a nice little python script called latex2wp.py which you can read about here. It takes your Latex document and outputs html which can be cut and pasted into WordPress. But actually, you can do better if you use this. It’s a little python library for accessing WordPress directly. So I just wrote a little bit of code to connect the two: it first runs latex2wp and the automatically uploads the result. I bound that to one of my Emacs commands, and Voila!.

The upshot is that my blog posts are written in actual Latex on my computer locally, where I can edit, preview, and use all my custom macros. Then when I finish, I just run my script and the result appears on my blog. That’s how this entry was written.

If I get around to it, I might post some screenshots and explain some of the other Emacs customizations which make my life easier.

Follow

Get every new post delivered to your Inbox.