Let $R$ be a commutative ring and $M$ a finitely generated $R$-module. Let $s$ be the maximum number of linearly independent elements of $M$, while $t$ is the minimum number of a system of generators of $M$. Show that $s\leq t$.
It is immediate in the case of vector spaces, but my first attempt (explicit computation) didn't work here due to the fact that there are coefficients (elements of $R$) without an inverse. I tried in so much other ways spending a lot of time, and I should be very glad if you cold give me a precise, complete and rigorous proof.
Thank you in advance.