### Partition Function as Cardinality

#### Posted by John Baez

In classical statistical mechanics we often think about sets where each point has a number called its ‘energy’. Then the ‘partition function’ counts the set’s points — but points with large energy count for less! And the amount each point gets counted depends on the temperature.

So, the partition function is a generalization of the cardinality $|X|$ that works for sets $X$ equipped with a function $E\colon X \to \mathbb{R}$. I’ve been talking with Tom Leinster about this lately, so let me say a bit more about how it works.

Say $X$ is a set where each point $i$ has a number $E_i \in \R$. Following the physicists, I’ll call this number the point’s **energy**.

The **partition function** is

$Z = \sum_{i \in X} e^{- E_i/kT}$

where $T \in \mathbb{R}$ is called **temperature** and $k$ is a number called Boltzmann’s constant. If you are a mathematician, feel free to set this constant equal to $1$.

So, the partition function counts the points of $X$ — but the idea is that it counts points with large energy for less. Points with energy $E_i \gg k T$ count for very little. But as $T \to \infty$, all points get fully counted and

$Z \to |X|$

So, the partition function is a generalization of the cardinality $|X|$ that works for sets $X$ equipped with a function $E\colon X \to \mathbb{R}$. And it reduces to the cardinality in the high-temperature limit.

Just like the cardinality, the partition function adds when you take disjoint unions, and multiplies when you take products! Let me explain this.

Let’s call a set $X$ with a function $E \colon X \to \mathbb{R}$ an **energetic set**. I may just call it $X$, and you need to remember it has this function. I’ll call its partition function $Z(X)$.

How does the partition function work for the disjoint union or product of energetic sets?

The disjoint union $X+X'$ of energetic sets $E\colon X \to \mathbb{R}$ and $E' \colon X' \to \mathbb{R}$ is again an energetic set: for points in $X$ we use the energy function $E$, while for points in $X'$ we use the function $E'$. And we can show that

$Z(X+X') = Z(X) + Z(X')$

Just like cardinality!

The cartesian product $X\ \times X'$ of energetic sets $E\colon X \to \mathbb{R}$ and $E' \colon X' \to \mathbb{R}$ is again an energetic set: define the energy of a point $(x,x') \in X \times X'$ to be $E(x) + E(x')$. This is how it really works in physics. And we can show that

$Z(X \times X') = Z(X)\, Z(X')$

Just like cardinality!

If you like category theory, here are some fun things to do:

1) Make up a category of energetic sets.

(Hint: I’m thinking about a slice category.)

2) Show the disjoint union of energetic sets, defined as above, is the coproduct in this category.

3) Show the ‘cartesian product’ of energetic sets, defined as above, is *not* the
product in this category.

4) Show that the ‘cartesian product’ of energetic sets, defined as above, gives a symmetric monoidal structure on the category of energetic sets. So we should really write it as a tensor product $X \otimes X'$, not $X\times X'$.

5) Show the category of energetic sets has colimits and the tensor product distributes over them.

6) Show that the category $\mathbf{FinEn}$ of finite energetic sets has finite colimits and the tensor product distributes over them. So, it is a nice kind of symmetric rig category.

7) Show the partition function defines a map of symmetric rig categories

$Z \colon \mathbf{FinEn} \to C^\infty(\mathbb{R})$

where $C^\infty(\mathbb{R})$ is the usual ring of smooth real functions on the real line, thought of as a symmetric rig category with only identity morphisms.

Finally, a really nice fact:

8) Show that for finite energetic sets $X$ and $X'$, $X \cong X'$ if and only if $Z(X) = Z(X')$.

(Hint: use the Laplace transform.)

So, the partition function for finite energetic sets acts a lot like the cardinality of finite sets. Like the cardinality of finite sets, it’s a map of symmetric rig categories and a complete invariant. And it reduces to counting as $T \to +\infty$.

We can generalize 6) to certain infinite energetic sets, but then we have to worry about whether this sum converges:

$Z = \sum_{i \in X} e^{- E_i/k T}$

We can also go ahead and consider measure spaces, replacing this sum by an integral. This is very common in physics. But again, we need some conditions if we want these integrals to converge.

## Convergence

Is there a p-adic version where the sum automatically converges? Also, I feel like one should be able to tie this up with L-functions, but I don’t remember enough about those to really know what I mean.