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?