Let $(R,m,k)$ be a local commutative ring and $M$ be a $k$-module. I want to prove that $$\mathrm{length}_R(M)=\dim_k(M)$$
Since it is so obvious, I doubt my own proof.
Let $n=\dim_k(M)$ (could be infinity). Then $M\cong k^n$ as $k$-module (vector space) and hence $M\cong k^n$ as $R$-modules as well (via the natural map $R\to k$), which implies that $\mathrm{length}_R(M)=n$.
Is my proof correct?
The $k$-module $M$ is regarded as an $R$-module by $rx=(r+m)x$. Thus every $R$-submodule of $M$ is also a $k$-submodule (vector subspace) and conversely.
If the dimension of $M$ is finite, then choosing a basis $\{x_1,\dots,x_n\}$ provides a composition series $$ 0\subset \langle x_1\rangle \subset \langle x_1,x_2\rangle \subset\dots \subset \langle x_1,\dots,x_{n-1}\rangle \subset \langle x_1,\dots,x_{n-1},x_n\rangle=M $$ because the factors are isomorphic to $k=R/m$, so they're simple $R$-modules.
If the dimension is infinite, then $M$ is not noetherian, so it has no composition series as vector space and so its $R$-length is infinite.