Understanding proof of a corollary leading up to Nakayama's Lemma I would appreciate help on what should be an easy concept in the proof of a corollary leading up to Nakayama's Lemma.
This link to mathoverflow.com (in the green highlighted section) gives the development as presented in "Atiyah and Macdonald" as well as "Reid."
https://mathoverflow.net/questions/41836/elementary-proof-of-nakayamas-lemma
My question pertains to the second corollary (as in "Reid"):
If $M$ is a finite $A$-module and $M = IM$ then there exists an $x \in A$ such that $x \equiv 1$ mod $I$ and $xM = 0$.
I understand the use of $\phi = id_M$ in the relation of maps to get:
$1 + a_1 + \dots + a_n = 0$ with $a_i \in I$. And $x$ is set equal to this,  giving $xM = 0$.
Also this satisfies $x \equiv 1$ mod ($I$).
Here is my question:
How can $x \in A$ be = $0$ and be $\equiv 1$ (mod $I$)?
Thanks for straightening out what must be an error in my math understanding.
 A: Let us review the previous proposition in Atiyah - Macdonald used in the proof of the Corollary above:


Proposition (Cayley - Hamilton): Let $M$ be a finitely generated $A$ - module, $I$ an ideal of $A$ and $\phi$ an $A$ - module endomorphism of $M$ such that $\phi(M) \subseteq IM$. Then $\phi$ satisfies an equation of the form
    $$\phi^n + a_1 \phi^{n-1} + \ldots + a_n = 0$$
    where $a_i \in I$.


Now we want to apply this to prove your corollary above. What we are doing is this: Choose $x = 1 + a_1 + \ldots + a_n$. It is clear that $x \equiv 1 \mod I$ because $x - 1 = a_1 + \ldots + a_n = $ sum of guys in $I$. Now why is it that $xM= 0$? Well it is not because $x = 0$ but because $x$ is in the annihilator of $M$. This does not mean that $x = 0$. So how do we conclude for this $x$ that $xM = 0$? Well take any element in here, say $xm$ for $m\in M$. Now $\phi$ is the identity map so $\phi(xm) = x\phi(m) = xm$. However on the other hand
$$\begin{eqnarray*} \phi(xm)&=& \phi( (1 + a_1 +\ldots + a_n)m) \\
&=& (1+ a_1+ \ldots + a_n)\phi(m) \\
&=& \phi(m) + a_1\phi(m) + \ldots + a_nm\\
&=& \phi^n (m) + a_1\phi^{n-1}(m) + \ldots + a_n(m) \\
&=& (\phi^n + a_1\phi^{n-1} + \ldots + a_n)(m)\\
&=& 0\cdot m\\
&=& 0 \end{eqnarray*}$$
from which we conclude that $xm = 0$. But this was any element in $xM$ and so $xM= 0$.
A: Ben's answer shows the correct way to conclude the result, but I thought it could help to explain where your reasoning goes astray. 
When you have the equation of the form $\phi^n + a_1 \phi^{n-1} + \cdots + a_n \text{id}_M=0,$ that is an equation in the ring of endomorphisms of $M.$ It says the map $\phi^n + a_1 \phi^{n-1} + \cdots + a_n \text{id}_M : M \to M$ is the same as the map $0 : M \to M.$ 
You tried to plug in $\phi=\text{id}_M$ and also evaluate the map at $1$ to get $1+a_1+\cdots+a_n=0.$ You then set $x=1+a_1+\cdots+a_n$ and wondered how $x=0$ and $x\equiv 1 \pmod I$ at the same time. The mistake was that all these operators are maps from $M$ to $M,$ so actually you can only plug in $1_M$ to get $1_M + a_1 1_M + \cdots + a_n 1_M=0$ as an equality in $M.$ This not actually an element of $A$! So it doesn't fit the conditions of how we need to pick our $x,$ and in fact $xM$ is not even a defined object.
What Reid and Atiyah-Macdonald do is pick $x=1_R + a_1 + \cdots + a_n,$ which is indeed an element of $A,$ and the proof proceeds as in Ben's answer.
