# Structure theorem for finitely generated modules over a principal ideal domain

In mathematics, in the field of abstract algebra, the structure theorem for finitely generated modules over a principal ideal domain is a generalization of the fundamental theorem of finitely generated abelian groups and roughly states that finitely generated modules over a principal ideal domain (PID) can be uniquely decomposed in much the same way that integers have a prime factorization. The result provides a simple framework to understand various canonical form results for square matrices over fields.

## Statement

When a vector space over a field F has a finite generating set, then one may extract from it a basis consisting of a finite number n of vectors, and the space is therefore isomorphic to F$^n$. The corresponding statement with F generalized to a principal ideal domain R is no longer true, since a basis for a finitely generated module over R might not exist. However such a module is still isomorphic to a quotient of some module R$^n$ with n finite (to see this it suffices to construct the morphism that sends the elements of the canonical basis of R$^n$ to the generators of the module, and take the quotient by its kernel.) By changing the choice of generating set, one can in fact describe the module as the quotient of some R$^n$ by a particularly simple submodule, and this is the structure theorem.
The structure theorem for finitely generated modules over a principal ideal domain usually appears in the following two forms.

### Invariant factor decomposition

For every finitely generated module M over a principal ideal domain R, there is a unique decreasing sequence of proper ideals $(d_{1})\supseteq (d_{2})\supseteq \cdots \supseteq (d_{n})$ such that M is isomorphic to the sum of cyclic modules:
    $M\cong \bigoplus _{i}R/(d_{i})=R/(d_{1})\oplus R/(d_{2})\oplus \cdots \oplus R/(d_{n}).$
The generators $d_{i}$ of the ideals are unique up to multiplication by a unit, and are called invariant factors of M. Since the ideals should be proper, these factors must not themselves be invertible (this avoids trivial factors in the sum), and the inclusion of the ideals means one has divisibility $d_{1}\,|\,d_{2}\,|\,\cdots \,|\,d_{n}$. The free part is visible in the part of the decomposition corresponding to factors $d_{i}=0$. Such factors, if any, occur at the end of the sequence.
While the direct sum is uniquely determined by M, the isomorphism giving the decomposition itself is not unique in general. For instance if R is actually a field, then all occurring ideals must be zero, and one obtains the decomposition of a finite dimensional vector space into a direct sum of one-dimensional subspaces; the number of such factors is fixed, namely the dimension of the space, but there is a lot of freedom for choosing the subspaces themselves (if dim M > 1).
The nonzero $d_{i}$ elements, together with the number of $d_{i}$ which are zero, form a complete set of invariants for the module. Explicitly, this means that any two modules sharing the same set of invariants are necessarily isomorphic.
Some prefer to write the free part of M separately:
    $R^{f}\oplus \bigoplus _{i}R/(d_{i})=R^{f}\oplus R/(d_{1})\oplus R/(d_{2})\oplus \cdots \oplus R/(d_{n-f})\;,$
where the visible $d_{i}$ are nonzero, and f is the number of $d_{i}$'s in the original sequence which are 0.

### Primary decomposition

Every finitely generated module M over a principal ideal domain R is isomorphic to one of the form
    $\bigoplus _{i}R/(q_{i})\;,$
where $(q_{i})\neq R$ and the $(q_{i})$ are primary ideals. The $q_{i}$ are unique (up to multiplication by units).
The elements $q_{i}$ are called the elementary divisors of M. In a PID, nonzero primary ideals are powers of primes, and so $(q_{i})=(p_{i}^{r_{i}})=(p_{i})^{r_{i}}$. When $q_{i}=0$, the resulting indecomposable module is $R$ itself, and this is inside the part of M that is a free module.
The summands $R/(q_{i})$ are indecomposable, so the primary decomposition is a decomposition into indecomposable modules, and thus every finitely generated module over a PID is a completely decomposable module. Since PID's are Noetherian rings, this can be seen as a manifestation of the Lasker-Noether theorem.
As before, it is possible to write the free part (where $q_{i}=0$) separately and express M as
    $R^{f}\oplus (\bigoplus _{i}R/(q_{i}))\;,$
where the visible $q_{i}$ are nonzero.

## Proofs

One proof proceeds as follows:
* Every finitely generated module over a PID is also finitely presented because a PID is Noetherian, an even stronger condition than coherence.
* Take a presentation, which is a map $R^{r}\to R^{g}$ (relations to generators), and put it in Smith normal form.
This yields the invariant factor decomposition, and the diagonal entries of Smith normal form are the invariant factors.
Another outline of a proof:
* Denote by tM the torsion submodule of M. Torsion module can be embedded as a submodule of M and this gives short exact sequence:
    $0\rightarrow tM\rightarrow M\rightarrow M/tM\rightarrow 0$
Where the map is a projection. M/tM is a finitely generated torsion free module, and such a module over a commutative PID is a free module of finite rank, so it is isomorphic to: $R^{n}$ for a positive integer n. Since every free module is projective module, then exists right inverse of the projection map (it suffices to lift each of the generators of M/tM into M). By splitting lemma (left split) M splits into: $M=tM\oplus F$.
* For a prime element p in R we can then speak of $N_{p}=\{m\in tM\mid \exists i,mp^{i}=0\}$. This is a submodule of tM, and it turns out that each N$_p$ is a direct sum of cyclic modules, and that tM is a direct sum of N$_p$ for a finite number of distinct primes p.
* Putting the previous two steps together, M is decomposed into cyclic modules of the indicated types.

## Corollaries

This includes the classification of finite-dimensional vector spaces as a special case, where $R=K$. Since fields have no non-trivial ideals, every finitely generated vector space is free.
Taking $R=\mathbb {Z}$ yields the fundamental theorem of finitely generated abelian groups.
Let T be a linear operator on a finite-dimensional vector space V over K. Taking $R=K[T]$, the algebra of polynomials with coefficients in K evaluated at T, yields structure information about T. V can be viewed as a finitely generated module over $K[T]$. The last invariant factor is the minimal polynomial, and the product of invariant factors is the characteristic polynomial. Combined with a standard matrix form for $K[T]/p(T)$, this yields various canonical forms:
* invariant factors + companion matrix yields Frobenius normal form (aka, rational canonical form)
* primary decomposition + companion matrix yields primary rational canonical form
* primary decomposition + Jordan blocks yields Jordan canonical form (this latter only holds over an algebraically closed field)

## Uniqueness

While the invariants (rank, invariant factors, and elementary divisors) are unique, the isomorphism between M and its canonical form is not unique, and does not even preserve the direct sum decomposition. This follows because there are non-trivial automorphisms of these modules which do not preserve the summands.
However, one has a canonical torsion submodule T, and similar canonical submodules corresponding to each (distinct) invariant factor, which yield a canonical sequence:
    $0<\cdots <T<M.$
Compare composition series in Jordan–Hölder theorem.
For instance, if $M\approx \mathbf {Z} \oplus \mathbf {Z} /2$, and $(1,{\bar {0}}),(0,{\bar {1}})$ is one basis, then $(1,{\bar {1}}),(0,{\bar {1}})$ is another basis, and the change of basis matrix ${\begin{bmatrix}1&0\\1&1\end{bmatrix}}$ does not preserve the summand $\mathbf {Z}$. However, it does preserve the $\mathbf {Z} /2$ summand, as this is the torsion submodule (equivalently here, the 2-torsion elements).

## Generalizations
### Groups

The Jordan–Hölder theorem is a more general result for finite groups (or modules over an arbitrary ring). In this generality, one obtains a composition series, rather than a direct sum.
The Krull–Schmidt theorem and related results give conditions under which a module has something like a primary decomposition, a decomposition as a direct sum of indecomposable modules in which the summands are unique up to order.

### Primary decomposition

The primary decomposition generalizes to finitely generated modules over commutative Noetherian rings, and this result is called the Lasker–Noether theorem.

### Indecomposable modules

By contrast, unique decomposition into indecomposable submodules does not generalize as far, and the failure is measured by the ideal class group, which vanishes for PIDs.
For rings that are not principal ideal domains, unique decomposition need not even hold for modules over a ring generated by two elements. For the ring R = Z[√−5], both the module R and its submodule M generated by 2 and 1 + √−5 are indecomposable. While R is not isomorphic to M, R ⊕ R is isomorphic to M ⊕ M; thus the images of the M summands give indecomposable submodules L$_1$, L$_2$ < R ⊕ R which give a different decomposition of R ⊕ R. The failure of uniquely factorizing R ⊕ R into a direct sum of indecomposable modules is directly related (via the ideal class group) to the failure of the unique factorization of elements of R into irreducible elements of R.
However, over a Dedekind domain the ideal class group is the only obstruction, and the structure theorem generalizes to finitely generated modules over a Dedekind domain with minor modifications. There is still a unique torsion part, with a torsionfree complement (unique up to isomorphism), but a torsionfree module over a Dedekind domain is no longer necessarily free. Torsionfree modules over a Dedekind domain are determined (up to isomorphism) by rank and Steinitz class (which takes value in the ideal class group), and the decomposition into a direct sum of copies of R (rank one free modules) is replaced by a direct sum into rank one projective modules: the individual summands are not uniquely determined, but the Steinitz class (of the sum) is.

### Non-finitely generated modules

Similarly for modules that are not finitely generated, one cannot expect such a nice decomposition: even the number of factors may vary. There are Z-submodules of Q$^4$ which are simultaneously direct sums of two indecomposable modules and direct sums of three indecomposable modules, showing the analogue of the primary decomposition cannot hold for infinitely generated modules, even over the integers, Z.
Another issue that arises with non-finitely generated modules is that there are torsion-free modules which are not free. For instance, consider the ring Z of integers. Then Q is a torsion-free Z-module which is not free. Another classical example of such a module is the Baer–Specker group, the group of all sequences of integers under termwise addition. In general, the question of which infinitely generated torsion-free abelian groups are free depends on which large cardinals exist. A consequence is that any structure theorem for infinitely generated modules depends on a choice of set theory axioms and may be invalid under a different choice.