# Free Resolutions and Hilbert Polynomials

This post is about Hilbert Polynomials and how they can be computed using free resolutions, and is based on a talk I gave on 7/4. There is a pdf version: Free Resolutions and Hilbert Polynomials. For more detail and historical background, see [Eis05, Ch. 1] (this was also used as the basis for this talk); for general facts about commutative algebra that are used, see [AM69, Eis95].

Let $k$ be a field and $S = k[x_0,\ldots,x_r]$ be a standard graded polynomial ring, i.e., $S = k \oplus \langle\deg 1~\text{monomials}\rangle \oplus \langle\deg 2~\text{monomials}\rangle \oplus \cdots$
We will be working with homogeneous ideals and graded modules and rings. Geometrically, we are working with projective varieties in projective space $\mathbb{P}^r$.

Let $M$ be a finitely generated graded $S$-module. Graded means the module can be decomposed as follows: $M = \cdots \oplus M_{-1} \oplus M_0 \oplus M_1 \oplus \cdots$
Since we haven’t really discussed this yet, just think of $M$ as a quotient ring by a homogeneous ideal, or the homogeneous ideal itself.

Recall the following definition:

Definition. The (projective) Hilbert function of $M$ is $H_M(d) = \dim_k M_d$.

This is non-trivial to compute, and so we’d like a better way to compute this. The motivation to do so stems from the fact that the Hilbert function is an invariant on modules, and also because it (asymptotically) contains other geometric invariants like dimension, degree, and genus.

Example (Free modules). Recall that a module is free if it is the direct sum of copies of $S$. Thus, its Hilbert function is just its rank times the Hilbert function of $S$.
Consider when the rank is one. Then, we claim that $H_S(d) = \dim_k S_d = \binom{r+d}{r}$. We just have to count the ways to get degree $d$ monomials from $r+1$ variables by using the “stars and bars” argument. We have $d$ “stars” that we want to separate into $r+1$ “bins” which we separate by “bars.” To count how many ways to do this, we count the number of ways we can put $r+d+1$ stars into $r+1$ bins that are non-empty, and then subtract one star from each bin to allow for empty ones. But this is the same as considering the way you can put $r$ bars in $r+d$ gaps to make the $r+1$ bins. Thus, we have $\binom{r+d}{r}$ as desired.

Hilbert’s idea was to compute $H_M(d)$ by comparing $M$ with free modules, using a free resolution, since as we have seen the free case is very easy to understand. To adapt the corresponding notion for affine/ungraded objects to graded modules in graded polynomial rings, we need some new terminology.

For any graded module $M$, denote $M(a)$ the module $M$ shifted by $a$: $M(a)_d = M_{a+d}$, i.e., the degree $e$ elements in $M$ become degree $e-a$ ($\deg 0 \mapsto \deg -a$); think of this as shifting every summand in the decomposition into graded parts to the left $a$ spots.

Example (a principal ideal). The free $S$-module of rank $1$ generated by an element of degree $a$ is $S(-a)$. The easy example is that the ideal $\langle x \rangle \subset S$ is isomorphic as a graded $S$-module to $S(-1)$.

Definition. A graded free resolution of $M$ is an exact sequence of degree-0 maps between graded free modules such that $\mathrm{coker}\:\varphi_1 = M$: $\cdots \to F_i \xrightarrow{\varphi_i} F_{i-1} \to \cdots \to F_1 \xrightarrow{\varphi_1} F_0$.

How to compute the (graded) free resolution:

1. Given homogeneous elements $m_i \in M$ of degree $a_i$ that generate $M$ as an $S$-module, we can define a map from the graded free module $F_0 = \bigoplus_i S(-a_i)$ onto $M$ by sending the $i$th generator to $m_i$. Note we need the grade shifts to make sure our maps are degree-preserving.
2. Let $M_1 \subset F_0$ be defined as $M_1 := \ker(F_0 \to M)$; this is also finitely generated by the Hilbert basis theorem. The elements of $M_1$ are called the syzygies of $M$. This can be done with Buchberger’s algorithm.
3. Choosing finitely many homogeneous syzygies that generate $M_1$, we can define map of graded $S$-modules $F_1 \to F_0$ with image $M_1$. Continuing in this way we construct a graded free resolution of $M$. Programs like Macaulay2 use an improvement of Buchberger’s algorithm for free resolutions due to Schreyer [Sch91, App.].
4. Note that this process stops because of the Hilbert syzygy theorem [Eis05, Thm. 1.1].

A free resolution is an example of a complex of graded modules, i.e., a chain of graded modules with (grade-preserving) maps between them such that the composition of two adjacent maps is always zero.

Example (twisted cubic, [Eis05, Exc. 2.8]). Recall that the (projective) twisted cubic $k[s^3,s^2t,st^2,t^3]$ is defined by the ideal $I = (x_1x_3-x_2^2,-x_0x_3+x_1x_2,x_0x_2-x_1^2)$ [Har95, Ex. 1.10]. You can also see this by taking the projective closure of the affine twisted cubic. This is a Gröbner basis (check e.g. with Macaulay2) with the GrRevLex order in the usual ordering $x_0 > \cdots > x_3$.
This gives our first map in the free resolution:
$S^3(-2) \xrightarrow{\begin{pmatrix}\displaystyle x_1x_3-x_2^2 & \displaystyle -x_0x_3+x_1x_2 & \displaystyle x_0x_2-x_1^2\end{pmatrix}} S$
This completes to a free resolution as follows:
$0 \to S^2(-3) \xrightarrow{\begin{pmatrix} \displaystyle x_0 & \displaystyle x_1\\ \displaystyle x_1 & \displaystyle x_2\\ \displaystyle x_2 & \displaystyle x_3\end{pmatrix}} S^3(-2) \xrightarrow{\begin{pmatrix}\displaystyle x_1x_3-x_2^2 & \displaystyle -x_0x_3+x_1x_2 & \displaystyle x_0x_2-x_1^2\end{pmatrix}} S$
To show this is exact, since our maps are grade-preserving, it suffices to show that the maps between the degree $d$ pieces of each free module are exact as $k$-linear maps. Exactness at $S^2(-3)$ since the matrix
$\begin{pmatrix} x_0 & x_1\\ x_1 & x_2\\ x_2 & x_3 \end{pmatrix}$
is of full rank. Exactness at $S^3(-2)$ follows since the matrix
$\begin{pmatrix} x_1x_3-x_2^2 & -x_0x_3+x_1x_2 & x_0x_2-x_1^2 \end{pmatrix}$
has rank $1$, and by the rank-nullity theorem.
We can check this with Macaulay2 (modulo change of bases):

i1 : R = QQ[x_0..x_3,MonomialOrder=>GLex]

o1 = R

o1 : PolynomialRing

i2 : M = coker matrix{{x_1*x_3-x_2^2,-x_0*x_3+x_1*x_2,x_0*x_2-x_1^2}}

o2 = cokernel | x_1x_3-x_2^2 -x_0x_3+x_1x_2 x_0x_2-x_1^2 |

1
o2 : R-module, quotient of R

i3 : d = res M

1      3      2
o3 = R  <-- R  <-- R  <-- 0

0      1      2      3

o3 : ChainComplex

i4 : d.dd

1                                                   3
o4 = 0 : R  <----------------------------------------------- R  : 1
| x_0x_2-x_1^2 x_0x_3-x_1x_2 x_1x_3-x_2^2 |

3                         2
1 : R  <--------------------- R  : 2
{2} | x_2  -x_3 |
{2} | -x_1 x_2  |
{2} | x_0  -x_1 |

2
2 : R  <----- 0 : 3
0

o4 : ChainComplexMap


Note that in general, a graded complex of graded modules (e.g. a free resolution) is exact if and only if the maps restricted to each degree $d$ piece of the modules is exact. We used above the fact that a short exact sequence of vector spaces $0 \to V_1 \to V_2 \to V_3 \to 0$ is exact if and only if $\dim V_1 + \dim V_3 = \dim V_2$ (the rank-nullity theorem). By splitting up a complex into short exact sequences like the one above, we have that a complex of vector spaces is exact if and only if $\sum (-1)^i \dim V_i = 0$, nothing that we require that our complex is finite.

This suggests that we can write the Hilbert function as $H_M(d) = \sum_i (-1)^i H_{F_i}(d)$, and this sum makes sense since our resolution is finite by the Hilbert syzygy theorem.

Theorem.If the graded $S$-module has finite free resolution $0 \to F_m \xrightarrow{\varphi_m} F_{m-1} \to \cdots \to F_1 \xrightarrow{\varphi_1} F_0$, with each $F_i$ a finitely generated free module $F_i = \bigoplus_j S(-a_{ij})$, then $H_M(d) = \sum_{i=0}^m (-1)^i \sum_j \binom{r+d-a_{ij}}{r}$.

Proof.$H_M(d) = \sum_{i=0}^m (-1)^i H_{F_i}(d)$, so it suffices to show $H_{F_i}(d) = \sum_j \binom{r+d-a_{ij}}{r}$, but decomposing $F_i$ as a direct sum and shifting back $H_{S(-a)}(d) = \binom{r+d-a}{r}$ gives us exactly the calculation we did as before.

Corollary. There is a polynomial $P_M(d)$ (called the Hilbert polynomial of $M$) such that, if $M$ has free resolution as above, then $P_M(d) = H_M(d)$ for $d \ge \max_{i,j}\{a_{ij}-r\}$.

Proof. The binomial coefficient is a polynomial when $r+d-a \ge 0$.

Example (the twisted cubic, continued). The Hilbert function for the twisted cubic is given by $H_{S/I}(d) = \binom{d+3}{3} - 3 \cdot \binom{d+1}{3} + 2 \cdot \binom{d}{3}$, which for $d \ge 0$ is the polynomial $P_{S/I}(d) = 3d+1$. The $3$ in the first term corresponds to the degree, the largest exponent $r=1$ corresponds to the dimension, and the genus is $(-1)^r(\text{constant term} - 1) = 0$.
We can check this with Macaulay2:

i5 : hilbertPolynomial(M)

o5 = - 2*P  + 3*P
0      1

o5 : ProjectiveHilbertPolynomial

i6 : hilbertPolynomial(M, Projective => false)

o6 = 3i + 1

o6 : QQ[i]


Example (Koszul complexes, [Eis05, p. 4]). When our polynomials are sufficiently different (precisely, if they form a regular sequence), then computing the free resolution becomes much easier, by using something called Koszul complexes. For example, let $I = \langle x^a,y^b,z^c \rangle$, and consider the quotient ring $k[x,y,z]/I$. We then have the resolution
$0 \to S(-a-b-c) \xrightarrow{\begin{pmatrix} \displaystyle x^a\\ \displaystyle y^b\\ \displaystyle z^c \end{pmatrix}} S(-b-c) \oplus S(-a-c) \oplus S(-a-b) \xrightarrow{\begin{pmatrix} \displaystyle 0 & \displaystyle z^c & \displaystyle -y^b\\ \displaystyle -z^c & \displaystyle 0 & \displaystyle x^a\\ \displaystyle y^b & \displaystyle -x^a & \displaystyle 0 \end{pmatrix}} S(-a) \oplus S(-b) \oplus S(-c) \xrightarrow{\begin{pmatrix} \displaystyle x^a & \displaystyle y^b & \displaystyle z^c \end{pmatrix}} S$

Example (Monomial ideals, [BPS98, Ex. 3.4]).For a sufficiently general monomial ideals, we can can calculate the free resolution using simplicial methods. Let $I = \langle x^2z^3,x^3z^2,xyz,y^2 \rangle$. Then, we can construct what is called the Scarf complex:

The basic idea is to connect vertexes that represent generators when they share variables. The triangle is labeled by $x^3yz^3$, the edges of the triangle by $x^3z^3,x^2yz^3,x^3yz^2$, and the other edge by $xy^2z$. Then the free resolution becomes
$0 \to S \xrightarrow{\begin{pmatrix} \displaystyle y\\ \displaystyle -x\\ \displaystyle z\\ \displaystyle 0 \end{pmatrix}} S^4 \xrightarrow{\begin{pmatrix} \displaystyle -x & \displaystyle -y & \displaystyle 0 & \displaystyle 0\\ \displaystyle z & \displaystyle 0 & \displaystyle -y & \displaystyle 0\\ \displaystyle 0 & \displaystyle xz^2 & \displaystyle x^2z & \displaystyle -y\\ \displaystyle 0 & \displaystyle 0 & \displaystyle 0 & \displaystyle xz \end{pmatrix}} S^4 \xrightarrow{\begin{pmatrix} \displaystyle x^2z^3 & \displaystyle x^3z^2 & \displaystyle xyz & \displaystyle y^2 \end{pmatrix}} S$
Note that this is the simplicial homology complex. This ends up having a Hilbert polynomial of $6$.

### References

 [AM69] M. F. Atiyah and I. G. Macdonald. Introduction to commutative algebra. Reading, Mass.: Addison-Wesley Publishing Co., 1969. [BPS98] D. Bayer, I. Peeva, and B. Sturmfels. “Monomial resolutions.” Math. Res. Lett. 5.1-2 (1998), pp. 31–46. [Eis05] D. Eisenbud. The geometry of syzygies: A second course in commutative algebra and algebraic geometry. Graduate Texts in Mathematics 229. New York: Springer-Verlag, 2005. [Eis95] D. Eisenbud. Commutative algebra: With a view toward algebraic geometry. Graduate Texts in Mathematics 150. New York: Springer-Verlag, 1995. [Har95] J. Harris. Algebraic geometry: A first course. Graduate Texts in Mathematics 133. Corrected reprint of the 1992 original. New York: Springer-Verlag, 1995. [Sch91] F.-O. Schreyer. “A standard basis approach to syzygies of canonical curves.” J. Reine Angew. Math. 421 (1991), pp. 83–123.