I'm reading Matsumura's Commutative Ring Theory Thm7.10, which states
Let $(A,m,k)$ be a local ring, $M$ be a flat module over $A$ and $x_1,\cdots,x_n\in M$. If the images $\overline{x_1},\cdots,\overline{x_n}\in M/mM$ are linear independent over $k$, then $x_1,\cdots,x_n\in M$ are linear independent over $A$.
It also says
If $M$ is finitely generated or $m$ is nilpotent, then all minimal generating set of $M$ is a basis of $M$, and $M$ is free.
I proved the first statement and the image of minimal generating set goes to a basis of $M/mM$ over $k$ (with the hypothesis $A$ is a local ring). So the only thing left to be proved is that $M$ has a minimal generating set when $m$ is nilpotent. I'm stuck with this.
From this answer, it seems to be true. However I can't prove this. Can somebody help me?
I also want to know the example of a module which has no minimal generating set. Sorry for my poor English.