How to memorise (understand) Nakayama's lemma and its corollaries? Nakayama's lemma is mentioned in the majority of books on algebraic geometry that treat varieties. So I think Ihave read the formulation of this lemma at least 20 times (and read the proof maybe around 10 times) in my life. 
But for some reason I just cannot get this lemma, i.e. I have tendency to forget it. Last time this happened just a couple of days ago, in the book of Shafarevich (Basic Algebraic geometry in 1.5.3.) This lemma is used to prove that for finite maps between quasiprojective varieties the image of a closed set is closed, and again this lemma sounded as something foreign to me (so again I went through the proof of the lemma)... 
Question. Is there a path to get some stable understanding of Nakayama's lemma and its corollaries? I would be especially happy if there were some geometric intuition underlying this lemma. Or some geometric example. Or maybe there is a nice article of this topic? Some mnemonic rule? (or one just needs to get used to the lemma?)
 A: It's easiest to understand for local rings, so let $R$ be one with residue field $k$.  Nakayama's lemma just says that a finitely generated $R$-module is zero if and only if the induced $k$-vector space is.  Through the magic of abelian categories, this implies that a map of $R$-modules is surjective if and only if the induced $k$-linear map of $k$-vector spaces is (apply the lemma to its cokernel).  This says that I can find generators for an $R$-module by lifting a basis of its associated $k$-vector space (that is, I can test whether a map $R^n \to M$ is surjective by testing it after reducing by $k$).
There are two ways to look at this: one (algebraically), it allows you to consider a lot of $R$-module statements as actually being $k$-linear algebra statements; and two (geometrically), it allows you to transfer information from the fiber of a sheaf at a point to the stalk at that point, and from there, to an open neighborhood.
An example of the first property: suppose you want to prove the Cayley-Hamilton theorem for a linear endomorphism $A$ of some finitely-generated $R$-module: that $A$ satisfies its own characteristic polynomial $p_A$.  Note that $p_A$, as an element of $R[t]$, reduces correctly when we pass to $k$, so that $p_A(A)$ vanishes after reducing to $k$ by the Cayley-Hamilton theorem for vector spaces.  Therefore, by Nakayama's lemma applied to the image of $p_A(A)$, it vanishes over $R$ as well.
An example of the second property: suppose $R$ is noetherian and I have a flat $R$-module $M$, and I choose a basis for its reduction to $k$, giving a presentation $R^n \to M \to 0$ (it is surjective by the lemma applied to the cokernel, as explained before).  This turns into a short exact sequence $0 \to K \to R^n \to M \to 0$ in which $K$ is finitely generated (since $R$ is noetherian) and since $M$ is flat, it remains exact after reducing to $k$, where the kernel $K$ vanishes.  Conclusion: $M$ is free over $R$.  The geometric interpretation of this is that flat, coherent sheaves over a noetherian scheme (if you're reading Shafarevich, your schemes are varieties and are always noetherian) are vector bundles.
A: The Graded Nakayama's Lemma
My intuition for Nakayama's lemma is rooted in the graded version.
 (Graded Nakayama's Lemma)
Let $R$ be a $\mathbb{N}$-graded algebra, and let $R_+$ be the 'irrelevant' ideal of positive degree elements.  Let $M$ be a finitely-generated $\mathbb{Z}$-graded $R$-module.

If $I\subseteq R_+$, and $IM=M$ then $M=0$.

I find this version of the lemma very clear and intuitive.  A finitely generated $R$-module will be zero in sufficiently low degree.  If $M$ is non-zero, then there will be some minimal degree $d$ where $M_d\neq0$.  But $R_+$ strictly increases degrees, and so $(R_+ M)_d=0$, and so $IM\neq M$.
In the study of connected graded algebras, the vector space $M/R_+M$ is an extremely useful gadget, which in a natural way parametrizes the generators of $M$.  The graded Nakayama's lemma is just the first step along this correspondence.
Other Nakayama's Lemmas
If you understand the graded Nakayama's lemma, the other version follow rather directly.  The filtered version follows from the graded version by passing to the associated graded algebra.
 (Filtered Nakayama's Lemma)
Let $R$ be a descending filtered algebra, and let $R_1$ be the ideal of positively filtered elements.  Let $M$ be a finitely-generated good-filtered $R$-module so that $\cap M_i=0$.

If $I\subseteq R_1$, and $IM=M$ then $M=0$.

Proof: To see this, let $\overline{R}:=\oplus R_i/R_{i+1}$ be the associated graded algebra, and let $\overline{M}:=\oplus M_i/M_{i+1}$ be the associated graded module (the good-filtered condition on $M$ is exactly that $\overline{M}$ is f.g.).  Then $I\subset R_1$ means $\overline{I}\subset \overline{R}_+$, and $\overline{I}\overline{M}=\overline{M}$, and so $\overline{M}=0$.  Since $\cap M_i=0$, it follows that $M=0$.

The local Nakayama's Lemma is just a special case of the filtered version, with the $m$-adic filtration.
 (Local Nakayama's Lemma)
Let $R$ be a local algebra, and let $m$ be the maximal ideal.  Let $M$ be a finitely-generated $R$-module.

If $I\subseteq m$, and $IM=M$ then $M=0$.

Finally, the global Nakayama's lemma follows from the local one.  This is because the Jacobson radical is contained in the maximal ideal in every localization, and if every localization of $M$ is zero, then $M$ is zero (uh, does this second fact use Nakayama's Lemma?).
 (Global Nakayama's Lemma)
Let $R$ be an algebra, and let $J$ be the Jacobson radical.  Let $M$ be a finitely-generated $R$-module.

If $I\subseteq J$, and $IM=M$ then $M=0$.

A: For me the Nakayama lemma (even though maybe not in its strongest form) simply says that:

If $\mathcal{F}$ is a coherent sheaf over the (locally noetherian) scheme $X$, then the dimension of the fiber of $\mathcal{F}$ at a closed point $x\in X$ is equal to the rank of the stalk, and a basis of the fiber lifts to a system of generators of the stalk.

A: I usually find the statement of Nakayama's Lemma easy to remember because of its proof, which is really nothing more than the definition of the Jacobson radical plus the existence of maximal left ideals in a ring.
Every non-zero finitely generated module $M$ admits a non-zero cyclic quotient module, which in turn (by a Zornication) admits a non-zero simple quotient module. So we can find a submodule $N$ of $M$ with $M/N$ simple. But now $J . (M/N) = 0$ since the Jacobson radical $J$ of the ring kills every simple module, so $JM \leq N < M$ which says that $JM$ is a proper submodule of $M$.
Note that this general form of the Lemma doesn't need any complicated determinant-type arguments. In the commutative case, other forms of the Lemma can easily be obtained from this general form "$JM < M$" by considering localisation.
A: As one says, proofs are useful not only to certify the truth of a statement, but also
to remember and understand the statement better. But in this second function, proofs
should not be understood only as "proof of the statement". Proofs that use the statement, instead, are also a very useful way to remember it.
There was a time where I had difficulty to remember Nakayama. This time ended when I
learnt the following basic result: Let $M$ be a finitely generated module over a local domain $A$ of maximal ideal $m$, residue field $A/m=k$, fraction field $K$. To such an $M$ one can attach two finite-dimensional vector spaces, one, $M \otimes_A K$ over $K$, the other, $M \otimes_A k = M/mM$ over $k$. Then one always $\dim_K M \otimes_A K \leq \dim_k M \otimes_A k$
with equality if and only if $M$ is free. 
I find this result much more striking and easy to remember than Nakayama itself. Yet it is
essentially equivalent to it. Here is the proof: Take $e_1, \dots, e_n$ be a basis of
$M \otimes_A k$. Lift this in a family $f_1,\dots,f_n$ of $A$. By Nakayama, $f_1, \dots, f_n$ generates $M$ as an $A$-module, hence $M \otimes_A K$ as a $K$-vector space, hence the stated inequality. If furthermore is is an equality, then $f_1,\dots,f_n$ is a basis of $M \otimes_A K$, hence $K$-free, hence $A$-free, hence an $A$-basis of $M$.  
A: It's sort of like the inverse function theorem, and that is why it is so strong.  If you have $n$ functions vanishing at the origin of $k^n$ and want to know if they give a local coordinate system, you ask if their differentials are independent at the origin.  Or equivalently if their differentials generate the cotangent space at the origin.  So in a [not necessarily noetherian, thanks Georges!] local ring $(\mathcal{O},\mathfrak{m})$, Nakayama's lemma says you can detect that elements of the maximal ideal generate that ideal, hence act sort of like coordinate functions, just by knowing their differentials, i.e. their residues in the Zariski cotangent space $\mathfrak{m}/\mathfrak{m}^2$, generate that linear space.
Those versions of the lemma you linked to are almost unrecognizable forms of this simple statement, but that's the way abstract math goes as we know. But the idea is the same, you have a hypotheses about a truncated version of your statement, and you get out the fuller version.  The Jacobson radical stuff is there to disguise the fact that it doesn't say much unless you are in a local setting.  I.e. in a local ring the Jacobson radical is pretty big and you get a better result.  In a polynomial ring with tiny Jacobson radical you get nothing.
A: I just came up with a geometric interpretation for Nakayama's lemma, and I'm surprised that no one here has already mentioned it!
The statement is the following: given a ring $A$, an ideal $I$, and a finitely generated $A$-module $M$, if $IM=M$ then we can find an element $a\in I$ such that $(a-1)M=0$.
In the geometric picture, we see $A$ as functions on a space $X$ (the spectrum $\mathrm{Spec}(A)$), with $I$ corresponding to functions that vanish on a closed subset $Z$ (the subset $V(I)$); $M$ is the module of global sections for a "vector bundle" $\mathcal F$ (the sheaf of modules $\widetilde M$). The elements of $IM$ represent those global sections vanishing along $Z$, so the condition $IM=M$ says that these are all the sections possible. In other words, $\mathcal F$ is identically zero along $Z$, and so its support $\mathrm{Supp}(\mathcal F)$ must be disjoint from $Z$. Now the conclusion of Nakayama's lemma simply affirms the existence of a "bump function" $a$, that is, a function being $0$ along $Z$, and $1$ along the support of $\mathcal F$: i.e. it lies in $I$ and it acts on $M$ like $1$!
If one works out the details of commutative algebra,


*

*the condition "$\exists\ a\in I$ s.t. $(a-1)M=0$" is equivalent to $V(I)\cap V(\mathrm{Ann}(M))=\emptyset$ (the "partition of unity");

*the support $\mathrm{Supp}(M)$ is contained in $V(\mathrm{Ann}(M))$;

*for finitely generated module $M$, the condition $IM=M$ implies $V(I)\cap\mathrm{Supp}(M)=\emptyset$, moreover $\mathrm{Supp}(M)$ can be shown to coincide with the closed subset $V(\mathrm{Ann}(M))$.



When $M$ is not finitely generated, $\mathrm{Supp}(M)$ does not behave well, so we have courterexamples
  
  
*
  
*$IM=M$ does not imply $V(I)\cap\mathrm{Supp}(M)=\emptyset$: the classical counterexample $A=\mathbf Z_{(p)}$ with its maximal ideal, and $M=\mathbf Q$;
  
*$\mathrm{Supp}(M)$ can be non-closed: $A=\mathbf Z$, $I=2\mathbf Z$, and $M=\bigoplus_{p\ge3}\mathbf F_p$;
  
*$\mathrm{Supp}(M)$ can be closed yet different from $V(\mathrm{Ann}(M))$: $A=\mathbf Z$, $I=2\mathbf Z$, and $M=\bigoplus_{n\ge1}\mathbf Z/3^n\mathbf Z$.
  

So, to conclude, Nakayama's lemma (in the above form) says that the support of a finitely generated $A$-module $M$ can be identified with the closed subset $V(\mathrm{Ann}(M))$, and given any closed subset $Z=V(I)$ disjoint from it, we can find a "bump function" separating the two.
In real life, however, we are usually just using another (weaker) property of the closedness: the support is closed under specialization. Since for an $A$-module $M$ to be non-zero, it must at least have some support, and by specialization, it must be supported at least at one closed point (corresponding to a maximal ideal). Therefore, if we can verify that $M$ is not supported at any of the closed points, (which is provided, say, by the condition $IM=M$ for $I$ contained in the Jacobson radical $J(A)$), then $M$ must be zero.
A: Mnemonic:  $\quad M=IM \Rightarrow m=im$
The version of Nakayama described: If $I$ is an arbitrary ideal of an arbitrary commutative ring $A$ and if a finitely generated module $M$ satisfies $M=IM$, then there exists $i\in I$ such that for all $m\in M$ we have $m=im$.
Please notice: no noetherian nor local assumption on $A$, no assumption at all on $I$.
