Let $R$ be a Noetherian local ring, and $M$ a finitely generated $R$-module.
I am trying to show the following:
$\dim_R(M)=\dim_{\widehat{R}}(\widehat{M})$
I have found a reference from this question that the result holds for $M=R$.
Then my proof would be complete if I could show that $\text{Ann}_{\widehat{R}}(\widehat{M})=\widehat{\text{Ann}_R(M)}$, since localisation is exact and so the completion of $R/\text{Ann}_R(M)$ is isomorphic to the quotient of the completions.
It is clear that $\widehat{\text{Ann}_R(M)}\subseteq\text{Ann}_{\widehat{R}}(\widehat{M})$, but I have been unable to show the converse.
Is my claim true, or is there a different way to prove this result?
Any help would be much appreciated.
Update:
I have found a reference, Corollary 2.1.8(a) of Cohen-Macaulay rings by Bruns and Herzog, for the original result I am trying to prove (though not my statement about annihilators).
Their proof is that the extension $R\to\widehat{R}$ is flat and local, and $\widehat{M}=M\otimes\widehat{R}$ since $M$ is finitely generated.
However I'm unsure how this proves the claim, and would appreciate any clarification.
Here's a useful lemma.
Let $R$ be a commutative ring and $M$ is a $R$-module. Assume $R\rightarrow S$ is flat. Consider $m\otimes 1\in M\otimes S$. Then $\operatorname{Ann}_{S}(m\otimes 1)=\operatorname{Ann}_R(m)S$.
Proof: One considers the exact sequence $$0\rightarrow \operatorname{Ann}_R(m)\rightarrow R\xrightarrow{1\mapsto m} M$$ Using the fact thatt $-\otimes_R S$ is an exact functor, we get the exact sequence $$0\rightarrow \operatorname{Ann}_R(m)\otimes_R S\rightarrow R\otimes_R S\rightarrow M\otimes_R S$$ This gives the exact sequence $$0\rightarrow \operatorname{Ann}_R(m) S\rightarrow S\xrightarrow{1\mapsto m\otimes 1} M\otimes_R S$$ after identifying $R\otimes_R S\cong S$ and the ideal $\operatorname {Ann}_R(m)\otimes_R S$ with $\operatorname{Ann}_R(m) S$ under this isomorphism.
If $M$ is a finite $R$ module with generators say $m_1,m_2,\dots, m_k$, then $Ann_R(M)=\bigcap_{i=1}^k\operatorname{Ann}_R(m_i)$ and $Ann_S(M\otimes_R S)=\bigcap_{i=1}^k\operatorname{Ann}_S(m_i\otimes 1)=\bigcap_{i=1}^k\operatorname{Ann}_R(m_i) S = \left (\bigcap_{i=1}^k\operatorname{Ann}_R(m_i) \right )S=\operatorname{Ann}_R(M)S$ Note that the last equality follows again from flatness since for 2 ideals $I,J$ of $R$, we have the exact sequence $$0\rightarrow I\cap J \rightarrow R \rightarrow R/I \oplus R/J$$ Tensoring by $S$ we get the exact sequence $$0\rightarrow (I\cap J)\otimes_R S \rightarrow R\otimes_R S\rightarrow \left ( R/I \oplus R/J \right )\otimes_R S $$ which is the exact sequence $0\rightarrow (I\cap J)S\rightarrow S\rightarrow S/IS \oplus S/JS$ forcing $(I\cap J)S=IS\cap JS$.