When we prove Nakayama's Lemma, which states that if $M$ is a finitely generated $R$-module, where $R$ is a commutative ring and if $I$ is an ideal of $R$ contained in the Jacobson radical of $R$, if $IM=M$ then $M=0$.
We take the contradiction that $M$ is not equal to zero and the set $\{g_1,\dots,g_n\}$ {$n>1$) is a minimal set of generators of $M$. Since $IM=M$ and we write $g_n=a_1g_1+\dots+a_ng_n$ where $a_1,a_2,\dots,a_n$ are elements of $I$, we rearrange it $(1-a_n)g_n=a_1g_1+\dots+a_{n-1}g_{n-1}$ and since $1-a_n$ is a unit because $a_n$ is in $I\subseteq J(R)$ and, for any element $a$ in $J(R)$, $1-a$ is a unit by the theorem. So how can we say here if $1-a_n$ is unit so $g_n$ belongs to the generating set $\{g_1,\dots,g_{n-1}\}$ which obviously contradicts the minimality of $\{g_1,\dots,g_n\}$.
Can any one assist me to give this concept of $g_n$ belongs to generating set of $\{g_1,\dots,g_{n-1}\}$?