TITLE: Cardinality of a minimal generating set is the cardinality of a basis
QUESTION [6 upvotes]: Let $R$ be a commutative ring with unity. Let $M$ be a free (unital) $R$-module.
Define a basis of $M$ as a generating, linearly independent set.
Define the rank of $M$ as the cardinality of a basis of $M$ (as we know commutative rings have IBN, so this is well defined).
A minimal generating set is a generating set with cardinality $\inf\{\#S:S\subset M, M=\langle S \rangle\}$.
Must a minimal generating set  have cardinality the rank of $M$?

REPLY [4 votes]: The statement in the Edit of Georges's answer also holds in the non-commutative case:

Let $R$ be an associative ring with $1$. If $M$ is an $R$-module, if $B$ is an infinite basis of $M$, and if $S\subset M$ is a generating subset, then we have $$|S|\ge|B|,$$ where, for any set $X$, the symbol $|X|$ denotes the cardinality of $|X|$. 
In particular, if $C$ is another basis of $M$, then $|C|=|B|$. 

Proof: For any $x\in M$ let $B_x$ be the finite set of those $b$ in $B$ such that the $b$-component of $x$ is nonzero. The fact that $S$ generates $M$ implies 
$$ 
B=\bigcup_{s\in S}\ B_s, 
$$ 
and thus 
$$
|B|=\left|\ \bigcup_{s\in S}\ B_s\ \right|\ \le
\left|\ \coprod_{s\in S}\ B_s\ \right|=
\sum_{s\in S}\ \left|B_s\right|=|S|. 
$$