TITLE: Equivalence of definitions of Cohen-Macaulay type
QUESTION [9 upvotes]: I know that the Cohen-Macaulay type has these two definitions:

Let $(R,\mathfrak{m},k)$ be a Cohen-Macaulay (noetherian) local ring and $M$ a finite $R$-module of depth $t$. The number $r(M) = \dim_k \mathrm{Ext}_R^t(k,M)$ is called the Cohen-Macaulay type of $M$.
Denote by $\beta_i(M)$ the Betti numbers in a minimal free resolution of $M$ ($M$ is an $R$-module as before). Then the Cohen-Macaulay type of $M$ is the last non zero Betti number, that is, $r(M) = \beta_s(M)$.

So I would ask how to prove the equivalence of these two definitions. There are some books in which I can find this proof?

REPLY [8 votes]: For the equivalence you need two more assumptions: (a) $M$ to have finite projective dimension and (b) $R$ to be Gorenstein. (a) is implicitly required in the second condition, otherwise you don't have the last nonzero Betti number. For necessity of (b), take $M$ to be $R$. Then the last betti is $1$, and the type of $R$ must be $1$ as well. 
Assuming (a) and (b), one can prove the equivalence by induction on the projective dimension of $M$. It must be somewhere in the literature, perhaps Bruns-Herzog, but I do not have access to a precise reference right now.