Theorem. (Elementary Divisors). Let $R$ be a $PID$, $M$ a free module, $N$ a submodule. Assume $N$ is free of rank $n<\infty$. Then there exists a decomposition $M=M'\bigoplus M''$ and elements $x_1,...,x_n\in M'$ and $a_1,...,a_n\in R$ such that $M'=Rx_1\bigoplus\cdots\bigoplus Rx_n, N=Ra_1x_1\bigoplus\cdots\bigoplus Ra_nx_n, \left<a_1\right>\supset\cdots\supset\left<a_n\right>\neq0$. Moreover, $M$ and $N$ determine $M'$ and each $a_i$ up to unit multiple.
Question for the case $n=0$) In the proof that I am reading , for $n=0$, we take $M'=0$ and it says that as no $a_i$ or $x_i$ are needed, $M''=M$ and the case is trivial. But I am not sure why. When $n=0$, $N$ is free of rank $0$. So $N=0$. And I cannot go further. Also, since $n=0$, does that mean we take $0$ elements from $M'$ and $R$, meaning no elements?
The theorem is Theorem 5.38 in the following link, https://web.mit.edu/18.705/www/13Ed.pdf
Yes, there are no $x_i$ and no $a_i$ in this case, and the decomposition is given by $M' = 0$ and $M'' = R$.