Let $R=F[x]$ where $F$ is a field, the $n\times n$ matrix $A=[v_1,\ldots,v_n]\in \operatorname{Mat}_n(R)$. Let $M=R^n/(Rv_1+\cdots+Rv_n)$ be the $R$-module. Show that $M$ is finite dimensional over $F$ iff $f=\det(A)\ne 0$, and in this case, $\dim_FM=\deg f$.
Since $N:=Rv_1+\cdots+Rv_n$ is a submodule of $R^n$, there exists a basis $\{x_1,\ldots,x_n\}$ s.t. $\{a_1x_1,\ldots,a_mx_m\}$ is a basis of $N$ where $m\leq n$ and $a_1\mid a_2\mid\cdots\mid a_n$ and $a_i\in R$. Then $M\cong Rx_1/(a_1x_1)\oplus \cdots \oplus Rx_m/(a_mx_m)\oplus R^{n-m}$. Since $R$ is infinite dimensional over $F$, $M$ is finite dimensional over $F$ if and only if $m=n$. On the other hand, $m=n \Leftrightarrow \{v_1,\ldots, v_n\} $ is a basis of $N$ $\Leftrightarrow v_1,\ldots, v_n$ are linearly independent over $F \Leftrightarrow f\ne0$.
Is this proof right and how to prove $\dim_FM=\deg f$?