Finitely generated idempotent ideals are principal: proof without using Nakayama's lemma
The following proof uses the "Cayley-Hamilton trick":
Let $x_1,\cdots,x_n$ generate $I$ as an $A$-module. Since $I=I^2$, we can write: $x_i=\sum\limits_{i=1}^{n} a_{ij}x_j$ for $1\leq i\leq n$ and $a_{ij}\in I$ for all $1\leq i\leq n$, $1\leq j\leq n$. In particular, the matrix $M=[\delta_{ij}-a_{ij}]_{1\leq i\leq n,1\leq j\leq n}$ ($\delta_{ij}$ denotes the Kronecker delta) annihilates the column vector $x=[x_j]_{1\leq j\leq n}$. If we multiply both sides of the matrix equation $Mx=0$ by the classical adjoint of $M$, we obtain an element of the form $1-e$ for $e\in I$ (the determinant of $M$) that annihilates every $x_i$. Hence $(1-e)I=0$. Clearly, this implies that $I=eA$ and $e^2=e$.
What follows is partially excerpted from my Historia Matematica post of 2005.01.04 on this topic, in reply to questions by Colin McLarty and Martin Davis.
The Lemma below is from Gilmer's 1970 Monthly Classroom Note[1]. Gilmer mentions that it is also presented on p. 58 of his textbook[2].$\:$
LEMMA $\ $ If $\rm\:B\:$ is a finitely generated idempotent ideal of a commutative ring $\rm\:T\:$ then $\rm\:B\:$ is principal and is generated by an idempotent element.
Proof $\ $ First assume that $\rm\:T\:$ has an identity and let $\rm\:\{b_{\:i}\:\}\:$ be a finite set of generators for $\rm\:B\:.\:$ Then $\rm\:B = B^2 = \sum\: B\ b_{\:i}\:$ so that we obtain a system of equations $\rm\ b_k = \sum s_{\:k\:i}\ b_{\:i}\:,\ $ where $\rm\:s_{\:k\:i} \in B\:.\ $ This yields a system of equations $\rm\ \sum\ (\delta_{\:k\:i}-s_{\:k\:i})\ b_{\:i} = 0\:,\:$ where $\delta =$ Kronecker delta.
By Cramer's rule $\rm\:d\ b_i = 0\:$ for all $\rm\:i\:,\:$ where $\rm\ d = \det [\delta_{ki}-s_{ki}]\:.\ $ It is easy to see that $\rm\:d\:$ has the form $\rm\: 1-b\: $ for some $\rm\:b \in B\:.\ $ Now $\rm\ 0 = d\ b_i = b_i - b\ b_i\ $ for all $\rm\:i\:,\:$ implies $\rm\: B\: $ is the principal ideal generated by $\rm\:b\:.\ $ And since $\rm\ 1-b\ $ kills $\rm\:B\:,\:$ we conclude $\rm\ (1-b)\ b = 0\:,\ $ or $\rm\ b = b^2\:.$
If $\rm\:T\:$ contains no identity element, we consider a commutative ring $\rm\:T'\:$ obtained by adjoining an identity element to $\rm\:T\:.\ $ Then $\rm\:B\:$ is a finitely generated idempotent ideal of $\rm\:T',\:$ and hence is principal as an ideal of $\rm\:T',\:$ generated by an idempotent element $\rm\:v\:.\ $ Since $\rm\:T'$ is obtained by adjoining an identity element to $\rm\:T\:,\:$ it follows $\rm\:v\:$ also generates $\rm\:B\:$ as an ideal of $\rm\:T\:.\quad$ QED
REMARK $\ $ The use of Cramer's rule in Gilmer's proof is simply a special case of the deduction of an equation of integral dependence over an ideal (vs. ring), e.g. see Kaplansky, Commutative Rings, p.11 Exer.1. or see his later Theorem 75, viz.
THEOREM $\rm\ 75.\ \ $ Let $\rm\:R\:$ be a ring, $\rm\:J\:$ an ideal in $\rm\:R,\ B\:$ an $\rm\:R$-module generated by $\rm\:n\:$ elements,$\ \ $ and $\rm\:r\:$ an element of $\rm\:R\:$ satisfying $\rm\ r\:B \subset JB\:.\ $ Then $\rm\ (r^n - j)\ B = 0\ $ for some $\rm\ j \in J\:.$
The desired proof now follows immediately, namely:
Specializing $\rm\ r=1,\ B=J\ $ yields $\rm\ (1-j)\ J = 0\ \Rightarrow\ J = (j),\ \ j^2 = j\:.\quad$ QED
Note that this may be viewed as a generalization of the simpler Dedekind domain case.
The above proof doesn't work in the noncommutative case because the determinant trick no longer applies. However one can prove Theorem 75 without using determinants by instead appealing to Nakayama's Lemma. Namely, see Exercises 3.1, 3.2, p.43 in Atiyah and Macdonald, Introduction to Commutative Algebra.
[1] Robert Gilmer, An Existence Theorem for Non-Noetherian Rings
(in Classroom Notes),
The American Mathematical Monthly, Vol. 77, No. 6, 1970, pp. 621-623.
[2] Robert Gilmer, Multiplicative Ideal Theory,
Queens University, Kingston, Ontario, 1968. See p.58