# length of modules in arbitrary exact sequences

Let $$R$$ be a commutative, noetherian ring. Given the exact sequence of $$R$$-modules of finite length $$0 \rightarrow M_0 \rightarrow M_1 \rightarrow M_2 \rightarrow M_3 \rightarrow 0$$. Is there an equation, connecting the lengths of the modules like in the case of short exact sequences?

For a short exact sequence of finite length modules $$0\to A\to B\to C\to 0$$, it holds that $$l(B)=l(A)+l(C)$$.
Split your sequence into two short exact ones: $$\begin{gather} 0\to M_0\to M_1\to K\to 0\\ 0\to K\to M_2\to M_3\to 0 \end{gather}$$ Then $$l(K)=l(M_1)-l(M_0)$$ and $$l(K)=l(M_2)-l(M_3)$$, so we get that $$l(M_0)-l(M_1)+l(M_2)-l(M_3)=0$$ which generalizes the relation for short exact sequences.
In these situations, the alternating sum of the lengths is zero. Here, $$l(M_0)-l(M_1)+l(M_2)-l(M_3)=0.$$ One can split this into two exact sequences $$0\to M_0\to M_1\to N\to 0$$ and $$0\to N\to M_2\to M_3\to 0$$ with the same $$N$$, also of finite length, and $$l(N)=l(M_1)-l(M_0)=l(M_2)-l(M_3)$$ etc.