Primary decomposition theorem for finitely generated modules over a principal ideal domain (source code)

= Primary decomposition theorem for finitely generated modules over a principal ideal domain

A finitely generated module over a principal ideal domain decomposes as
$$
R^r\oplus\bigoplus_p\bigoplus_jR/(p^{e_{p,j}}),
$$
with finitely many irreducibles $p$. The free rank and primary cyclic factors are unique up to associates and ordering.