Understanding the notion of compatible basis. I am a postgraduate student studying final year.We have a course on module theory.Our instructor told us that if $M$ is an  $R$-module with finite basis $\mathcal B=\{x_1,x_2,...,x_k\}$,then we will say that a submodule $N\subset M$ has a basis compatible with $\mathcal B$ if $\exists $ $m\leq k$ and $d_1,d_2,...,d_m\in R$ such that $\mathcal B'=\{d_1x_1,...,d_mx_m\}$ is a basis of $N$.
Then he proved a result:
Theorem:
If $\mathcal B'$ is compatible with $\mathcal B=\{x_1,x_2,...,x_k\}$,then $M/N\simeq R^k/\langle d_1e_1,...,d_me_m\rangle\simeq (R/d_1R)\oplus...\oplus (R/d_m R)\oplus R^{k-m}$.
I want to know the motivation behind a compatible basis.Thinking of this concept seems to be coming out of the blue.It is hard to visualize a compatible basis other than saying that it 'scales' the original basis.But that too is not like vector spaces as scalars are not invertible.
Can someone help me understand the concept of compatible basis in a better way.
 A: I think what you've said is already close to being a good way to understand compatible basis.
Perhaps there is are just a few more observations to be said.
First of all you are right to observe that in the case of a vector space where $R$ is a field, every (nonzero) scalar is invertible. It's worthwhile to carry through the analysis of that case a bit further. As a consequence of your observation, if $d_i \ne 0$ then the direct factor $R / d_i R$ is a $0$-dimensional vector space, whereas if $d_i = 0$ then that direct factor is $1$-dimensional. From this one can compute that the dimension of the vector space $M/N$ is exactly equal to the number of $0$-scalars in the list $d_1,d_2,...,d_m$.
So, now you just have to wrap your mind around what's going on in a general ring where some nonzero scalars are not invertible: for those scalars $d_i$ which are invertible, $R / d_i R$ is (still) the trivial module; and for those scalars $d_i$ which are zero, $R / d_i R$ is (still) isomorphic to $R$ itself. And now there's a new thing: if $d_i$ is nonzero and non-invertible then $R / d_i R$ is a nontrivial cyclic torsion module. So out of this comes the interesting result that $M/N$ is a direct sum of cyclic modules: some of them being "free" cyclic modules (when $d_i=0$), and others being "torsion" cyclic modules (when $d_i \ne 0$ is not invertible).
Let me emphasize two more points.
First, you should work through a few examples where $R=\mathbb Z$ to see what is going on. You'll reach the conclusion that $M/N$ is a direct sum of cyclic groups: some infinite cyclic; some finite cyclic.
Second, if you know some linear algebra then you might see why this notion of compatible basis does not just come out of the blue. It arises quite naturally from the concept of Smith normal form of a matrix over a ring, which is the machinery underlying any actual computation of a quotient module (for sufficiently nice rings).
