I have checked the list of similar titles, proposed by the site. I hope this is not a repetition.
This question arises from a proof of a proposition in the book Basic Number Theory, as follows.
Proposition
Every finitely generated $R$-module $M$ is the direct sum of finitely many summands, each of which is isomorphic either to R or to a module R/$P^v$, $v$>0.
Proof
Let M be generated by elements $m_1,...,m_n$. Take a vector-space $v$ of dimension n over $K$, with a basis $v_1,...v_n$; put $L$=$\Sigma$ $Rv_i$. Then the formula
$\Sigma$ $x_iv_i$=$\Sigma$ $x_im_i$,
where the $x_i$ are taken in $R$ for i from 1 to n, defines a morphism of $L$ onto $M$; therefore $M$ is isomorphic to L/M', where M' is the kernel of that morphism. Apply now corollary 1 to $L$ and $M$; as $M$ is a subset of $L$, we have $v_j$is positive for j from 1 to r, and r=s.
Question
After that proof, Weil then defines $n_i$ as the dimension of $R_i=M_i/M_{i+1}$, where $M_i$:=$\pi^iM$, over the residual field $k=R/P$; moreover, after the proposition is set up, one can define the number$N_v$ as $N_0$=the number of times R appears in the summands, and $N_v$=the number of times R/$P^v$ appears in the summands. Now, Weil asserts that $n_i$=$N_0$+\Sigma_{v>i}N_v. And my question is why is this true.
Supplement
Here, R is the maximal compact subring of a p-field $k$, in which $P$ is the maximal ideal, where a $p$-field is a non-discrete locally compact field, either of characteristic $p$, or a finite extension of $Q_p$ the completion of $Q$ with respect to the $p$-adic valuation.
I may not exprese my question explicitly enough, so feel free to ask for explanations, and I will do my best to clarify things.
Thanks and regards here.