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.



Additivity of projective dimensions, or, help me lower my blood pressure
Your proof only works if the projective dimensions of $M$ as an $R$-module *and* as an $R/I$-module are finite. Indeed, finite projective dimension is a hypothesis for the Auslander-Buchsbaum formula, and you used the AB-formula for $M$ as an $R/I$-module in your argument.


In the case of your counter-example, the projective dimension of $M$ is $\infty$. E.g., if $R=\mathbb{C}[x]$ (or its localization at $0$ if you like), $a=x$, then you have the resolution: $$\ldots\to\mathbb{C}[x]/x^2\overset{\cdot x}\to\mathbb{C}[x]/x^2\overset{\cdot x}{\to}\mathbb{C}[x]/x^2\to 0\to \ldots$$
of the module $\mathbb{C}$. Using this to compute 
$\operatorname{Ext}^{\cdot}\_{\mathbb{C}[x]/x^2}(\mathbb{C},\mathbb{C})$, one sees that 


$$\operatorname{Ext}^{i}\_{\mathbb{C}[x]/x^2}(\mathbb{C},\mathbb{C})=\mathbb{C}$$ for all $i\geq{0}$. In particular, the projective dimension is infinite.


In this case, your module is $\mathbb{C}\oplus\mathbb{C}[x]/x^2$, which by the above has infinite projective dimension.


