I'm looking for clarification as to whether or not the following proof is valid. I am unsure in justifying the last paragraph.
Thank in advance as always,
M
Claim: Let $R$ be a ring and $(M_{k} , q_{k,j})_{k \in \mathbb{N}}$ be a directed inverse system of finitely-generated $R$-modules with surjective transition maps $q_{k,j} : M_j \rightarrow M_k$ for $k \leq j$. Suppose $M := \varprojlim_{k\in \mathbb{N}} M_k$. Then $\mathrm{rank}_R M = \sup (\mathrm{rank}_R M_k)$.
Attempted proof: Firstly, since we have a natural projection $q_k : M \rightarrow M_k$ we deduce that $\mathrm{rank}_R M \geq \mathrm{rank}_R M_{k}$ for all $k \in \mathbb{N}$.
Conversely, let $N \subseteq M$ be a finitely-generated $R$-submodule generated by a basis $(e_i )_{i=1}^n$. Then there exists some $k \in \mathbb{N}$ so that $e_i \in M_k$ for $i =1,2,\dots,n$. Let $j \geq k$. Since $M_j \rightarrow M_k$ surjects for all $j \geq k$, we also have that $e_i \in M_j$ for $i =1,2,\dots,n$, allowing us to conclude that $\mathrm{rank}_R M_{j} \geq \mathrm{rank}_R N$.
(Unsure from here) Since this holds for any finite-rank submodule of $M$, we have $\sup_{j \in \mathbb{N}} \mathrm{rank}_R M_j = \mathrm{length}_R M \geq \mathrm{rank}_R M$.
Essentially, I think my unease comes from that I've implicitly used that the length of $M$ may be taken as the supremum of the length chains of finitely-generated submodules. Is this allowed?
Would this hold if we additionally assumed that $M$ be free?