Is there a simple method to test a local ring to be Cohen Macaulay? Hi, everybody. I'm recently reading W.Bruns and J.Herzog's famous book-Cohen-Macaulay Rings. I personally believe that it would be perfect if the authors provide for readers more concrete examples. After reading the first two sections of this book, I have two questions.


*

*Given a non-negative integer n, how can we construct a non-Gorenstein Cohen-Macaulay ring with dimension n?

*Except by the definitions of Cohen-Macaulay rings, is there a more efficient way to check the Cohen-Macaulayness of local rings?
 A: 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")
A: 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.
A: (1) A commutative Noetherian ring is reduced if and only if it is generically reduced
(i.e. $R_0$, i.e. regular after localization at all height zero primes) and $S_1$ 
(i.e. every prime of height at least one has depth at least one).
Since a ring is Cohen--Macaulay iff it is $S_i$ for all $i$, to construct a non-CM ring,
it suffices to construct a non-$S_1$-ring, and by the above, for this it suffices to
construct a ring which is generically reduced but not reduced (or more geometrically speaking,
has embedded components).
E.g. $k[x_1,\ldots,x_n,y]/(x_1 y, \ldots , x_n y, y^2)$ is such a ring, and has dimension $n$.
(To get a local example, localize at $(x_1,\ldots,x_n,y).$)
[Added: misread question; these are non-CM rings.  For CM, but non-Gorenstein rings,
see Hailong Dao's answer.]
(2) Typically the easiest way to recognize that a ring is Cohen--Macaulay is to use the following facts: any regular local ring is CM; if $A$ is CM and $f$ is a regular element
of $A$ (i.e. a non-unit and non-zero divisor) then $A/fA$ is CM.
Arguing inductively, we find that if $f_1,\ldots,f_n$ is a regular sequence in a regular
local ring $A,$ then $A/(f_1,\ldots,f_n)$ is CM.  In particular, complete intersections
in an affine space are CM (and thus so are any of their localizations).
(In fact, these rings will be Gorenstein, not just CM.)
In small dimensions, one can also use the fact stated in part (1) to conclude that a one-dimensional reduced Noetherian ring is CM, and one also has Serre's criterion $R_1 + S_2$
for normality, which shows that a normal ring of dimension two is CM.
A: 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.  
