I had this theorem in my course, which states
Suppose $R$ is a commutative ring with identity, $M$ is a finitely generated $R$- module, and if $I_1\subset I_2\subset\dots\subset I_n$ and $J_1\subset J_2\subset\dots\subset J_m$, which are all proper ideals such that $M\cong (R/I_1)\bigoplus\dots\bigoplus(R/I_n)$ and $M\cong(R/J_1)\bigoplus\dots\bigoplus(R/J_m)$. Then $n=m$ and $I_k=J_k$.
Now the proof started with
Fix $x\in R$, and consider the map $M\to M; z\mapsto xz$. This makes $xM$ an $R$-module. We shall show that $$I_k=\{x\in R\mid xM \text{ is generated by fewer than $k$ elements} \}.$$
Now I understood the rest of the proof where we went on and prove $I_k$ is indeed the set on the right, for $k=1,...,n$. However though, I do not understand why the set above is actually an ideal?
Or is it not necessary to check if the set on the right is an ideal, since if it equals to $I_k$, and $I_k$ is an ideal by assumption, then checking becomes redundant?
Being an ideal is a property of a subset. If you show that two subsets, one of which is an ideal, are equal, the other is an ideal too.