Is there a simple method to test a local ring to be Cohen Macaulay?

Some interesting examples of Cohen-Macaulay but not Gorenstein rings:

1) Determinantal rings: Let $m\geq n\geq r>1$ be integers. Take $S=k[x_{ij}]$ with $1\leq i\leq m, 1\leq j\leq n$ and $I$ be the ideal generated by all $r$ by $r$ minors. Then $R=S/I$ is CM, but is Gorenstein if and only if $m=n$. And $R$ has dimension $(m+n-r+1)(r-1)$.

2) Veronese subrings: Let $S=k[x_1,\cdots,x_n]$ and $R=S^{(d)}$ be the $k$-subalgebra of $S$ generated by the monomials of degree $d$. Then $R$ is always CM, but is Gorenstein if only if $d$ divides $n$. And $R$ has dimension $n$.

3) Semigroup rings: Let $R=k[t^{a_1},\cdots, t^{a_n}]$. $R$ is $1$-dimensional domain, so CM. $R$ is Gorenstein if and only if the semigroup generated by $(a_1,\cdots,a_n)$ is symmetric. For higher dimension one can use the trick in BCnrd's comment.


Note that Macaulay2 has some quick ways to check whether a ring is CM and/or Gorenstein. One approach is to write your ring $R$ as a quotient of a regular ring (polynomial ring) $S$, $R = S/I$.

Then one can compute $Ext^i(S^1/I, S^1)$ (in Macaulay2). If these all vanish, except in one spot = $dim S - dim R$ (see Bruns and Herzog chapter 3 -- you don't need to check all $i$), then the ring is CM. That non-vanishing ext group is the canonical module of $R$ (and so one can read off Gorenstein-ness from there also).

There are almost certainly better ways to do this check using Macaulay2 though (does anyone else have suggestions? I guess one can use the command "depth")


For me personally, the whole theory started to take shape (and make sense) once I learned about the graded case and understood connections with combinatorics.

For a graded (sometimes called $*$-local) ring, a basic technique for establishing the Cohen-Macaulay property is "Gröbner degeneration": using a Gröbner basis, deform the ring to a quotient of a polynomial ring by a monomial ideal. Another approach is to deform a ring to a multigraded ring (=an affine semigroup ring) by exhibiting a SAGBI basis. This is known as "toric degeneration". The question then may be decided by combinatorial techniques. The commutative algebra bit is that if $R_t$ is a flat deformation with a CM special fiber $R_0$ and general fiber $R$ then $R$ is also CM.

A quotient $k[x_1,\ldots,x_n]/I$ of a polynomial ring by a square-free monomial ideal is a Stanley-Reisner ring of a simplicial complex $\Delta$ and CM property of the ring can be decided at the level of homology of $\Delta$ by the Reisner criterion. The corresponding simplicial complexes $\Delta$ are also called Cohen-Macaulay and have been much studied by people in algebraic combinatorics.

The Cohen-Macaulayness of determinantal rings mentioned in Hailong's answer can be established using the strategy I outlined (I think that Bruns and Herzog actually do it in a later chapter; I can't verify it since I don't have the book). "Combinatorial commutative algebra" by Miller and Sturmfels is well worth looking at for a more encompassing view. Stanley's "Combinatorics and commutative algebra" is older, but retains much of its appeal: it is very explicit and to the point. You can find many examples there.