Elementary proof of Nakayama's lemma? Nakayama's lemma is as follows:

Let $A$ be a ring, and $\frak{a}$ an ideal such that $\frak{a}$ is contained in every maximal ideal. Let $M$ be a finitely generated $A$-module. Then if $\frak{a}$$M=M$, we have that $M = 0$.

Most proofs of this result that I've seen in books use some non-trivial linear algebra results (like Cramer's rule), and I had come to believe that these were certainly necessary. However, in Lang's Algebraic Number Theory book, I came across a quick proof using only the definitions and induction. I felt initially like something must be wrong--I thought perhaps the proof is simpler because Lang is assuming throughout that all rings are integral domains, but he doesn't use this in the proof he gives, as far as I can see.
Here is the proof, verbatim: We do induction on the number of generators of $M$. Say M is generated by $w_1, \cdots, w_m$. There exists an expression $$w_1 = a_1w_1 + \cdots + a_mw_m$$ with $a_i \in \frak{a}$. Hence $$(1-a_1)w_1 = a_2w_2 + \cdots +a_mw_m$$ If $(1-a_1)$ is not a unit in A, then it is contained in a maximal ideal $\frak{p}$. Since $a_1 \in \frak{p}$ by hypothesis, we have a contradiction. Hence $1-a_1$ is a unit, and dividing by it shows that $M$ can be generated by $m-1$ elements, thereby concluding the proof.
Is the fact that $A$ is assumed to be a domain being smuggled in here in some way that I missed? Or is this really an elementary proof of Nakayama's lemma, in full generality?
 A: I think the following proof is valid and avoids both determinants and maximal ideals. The cost is induction over all $A$-modules generated by $n$ elements.
Nakayama. Let $J$ be the Jacobson radical. Let $M$ be a finitely generated $A$-module satisfying $M=JM$. Then $M=0$.
Proof. Induction on size of generating set. If $M$ is generated by zero elements then it is zero. Assume the assertion holds for modules generated by $n-1$ elements and let $M$ be generated by $n$ elements $m_1,\dots ,m_n$. Then $m_n=\sum _{i=1}^n \varepsilon _im_i$ with $\varepsilon _i\in J$ so $(1-\varepsilon _n)m_n=\sum_{i=1}^{n-1}m_i$. Dividing by the unit $1-\varepsilon _n$ we obtain $m_n$ as a linear combination of $m_1,\dots ,m_{n-1}$. Proceeding in this fashion we find $M=0$.
A: There are various forms of the Nakayama lemma. Here is a rather general one; note that it does not involve maximal ideals and is a constructive theorem (Atiyah-MacDonald, Commutative Algebra, Prop. 2.4 ff).

Let $M$ be a finitely generated $A$-module, $\mathfrak{a} \subseteq A$ be an ideal and $\phi \in End_A(M)$ such that $\phi(M) \subseteq \mathfrak{a} M$. Then there is an equation of the form
  $\phi^n + r_1 \phi^{n-1} + ... + r_n = 0$,
  where the $r_i$ are in $\mathfrak{a}$.

The proof uses the equality $adj(X) \cdot X = \text{det}(X)$ for quadratic matrices over a ring. I call this an elementary linear algebra fact. Of course, there you only prove it for fields but using function fields implies the result for general rings. If we take $\phi=\text{id}_M$, we get the following form:

Let $M$ be a finitely generated $A$-module and let $\mathfrak{a} \subseteq A$ be an ideal such that $\mathfrak{a} M = M$. Then there exists some $r \in A$ such that $rM = 0$ and $r \equiv 1$ mod $\mathfrak{a}$.

In particular, we get:

Let $M$ be a finitely generated $A$-module and let $\mathfrak{a} \subseteq A$ be an ideal such that $\mathfrak{a} M = M$ and $\mathfrak{a}$ lies in every maximal ideal of $A$. Then $M=0$.

Observe that this argument uses Zorn's lemma (namely that every non-unit is contained in a maximal ideal) and is thus nonconstructive. Which is of course not surprising since without Zorn's lemma it is consistent that there are nontrivial rings without any maximal ideals at all. This should convince you that the first form of the Nakayama lemma is the most easy and elementary one. The last form has another short proof, which is standard and given in the question above.
Here is another short well-known proof for the last form, which also works if $A$ is noncommutative (then we have to replace "maximal ideal" by "maximal left ideal"): Assume $M \neq 0$. Since $M$ is finitely generated, an application of Zorn's lemma shows that $M$ has a maximal proper submodule $N$. Then $M/N$ is simple, thus isomorphic to $A/\mathfrak{m}$ for some maximal left ideal $\mathfrak{m}$. Then $N = \mathfrak{m} M = M$, contradiction.
By the way, I don't know if the first form is true if $A$ is noncommutative. The theory of determinants is not really prosperous over noncommutative rings. Hints?
In many texts about algebraic geometry only the last form of the Nakayama lemma is needed. But the first one is stronger and is used in many results in commutative algebra.
