TITLE: Additivity of projective dimensions, or, help me lower my blood pressure
QUESTION [8 upvotes]: Sorry for the shameless title.  I'm rather stuck on a lemma in commutative algebra - namely, I have both a proof and a counterexample!  I have tried rather strenuously and frustratingly to find the error here, without success; any help from the community in debugging this would be greatly appreciated.
Suppose $R$ is a Noetherian local ring and $M$ is a finite $R$-module of finite projective dimension ($\mathrm{pd}$ for short); write $I=\mathrm{Ann}_R(M)$ in all that follows.
Claim: Under the above hypotheses, we have $\mathrm{pd}_R(R/I)+\mathrm{pd}_{R/I}(M)=\mathrm{pd}_R(M)$.
Proof of claim: Recall the Auslander-Buchsbaum formula, namely $\mathrm{pd}_R(M)+\mathrm{depth}_R(M)=\mathrm{depth}_R(R)$.  Since a sequence $r_1,\dots,r_n \in R$ is $M$-regular if and only if $\overline{r}_1,\dots,\overline{r}_n \in R/I$ is $M$-regular, the $R$-depth and $R/I$-depth of $M$ agree. (This is well-known, see e.g. pp. 130-131 of Matsumura's Commutative Ring Theory).  Hence Auslander-Buchsbaum, applied to $R$ and $R/I$, gives the equality
$\mathrm{pd}_R(M)-\mathrm{pd}_{R/I}(M)=\mathrm{depth}_R(R)-\mathrm{depth}_{R/I}(R/I)$.
By the same reasoning as previously, the $R$-depth and the $R/I$-depth of $R/I$ are equal, so the right-hand side of this formula can be rewritten as $\mathrm{depth}_R(R)-\mathrm{depth}_{R}(R/I)$, which is equal to $\mathrm{pd}_{R}(R/I)$ by another (!) application of Auslander-Buchsbaum. $\square$
Counterexample to claim: Take $R$ local Noetherian, $a\in R$ a nonunit, $M=R/(a) \oplus R/(a^2)$, so $I=(a^2)$.  If I have done this right, each of the projective dimensions in my claim is exactly $1$, and I believe $1+1\neq 1$ was known in antiquity.

REPLY [4 votes]: One problem in the proof is that $\operatorname{pd}_R(R/I)$ might be infinite, so you can't apply Auslander-Buchsbaum the final time.
I can't seem to come up with an example where $M$ has finite projective dimension while $\operatorname{ann} M$ has infinite projective dimension, but they must exist.
Later: The famous Dutta-Hochster-McLaughlin example does the trick.  It is a module $M$ of finite projective dimension over $R = k[x,y,z,w]/(xy-zw)$, with annihilator $(x,y,z,w)^3 + (x,z)$.