---
title: The Structure Theorem for Modules over a PID
module: Modules over PIDs and Canonical Forms
moduleNumber: 9
lessonNumber: 1
order: 901
summary: >
  Every finitely generated module over a principal ideal domain splits as a free
  part plus a direct sum of cyclic torsion pieces, in two canonical ways: invariant
  factors, tied together by a divisibility chain, and elementary divisors, one prime
  power at a time. Existence follows from the stacked-basis theorem, both lists are
  unique, and the case $R = \mathbb{Z}$ is the classification of finitely generated
  abelian groups.
topics: [Modules over PIDs and Canonical Forms]
draft: false
sources:
  - book: Dummit & Foote
    ref: "Ch. 12 — Modules over Principal Ideal Domains; §12.1 The Basic Theory"
---

A [module](/abstract-algebra/module-theory/introduction-to-modules) over a general
ring can be arbitrarily complicated: it need not have a basis, a submodule of a
free module need not be free, and there is no classification. Restrict the ring to
a [principal ideal domain](/abstract-algebra/factorization-and-polynomials/euclidean-domains-pids-ufds)
and restrict the module to finitely generated, and the picture collapses to a
single statement. The module is a free part $R^r$ plus a finite direct sum
of cyclic pieces $R/(a)$, and the ideals $(a)$ that appear are determined by the
module up to reordering.

This is the **structure theorem for finitely generated modules over a PID**. It is
the source of two things at once: the classification of
[finite abelian groups](/abstract-algebra/products-and-group-structure/direct-products-and-finite-abelian-groups)
(take $R = \mathbb{Z}$) and the canonical forms of a linear operator (take
$R = F[x]$).

## Rank, torsion, and the annihilator

Throughout, $R$ is a PID and $M$ is an $R$-module. Three invariants organize the
whole theory.

> **Definition (Rank).** The **rank** of an $R$-module $M$ is the maximum number
> of $R$-linearly independent elements of $M$: the largest $n$ for which there
> exist $x_1, \dots, x_n \in M$ with $r_1 x_1 + \cdots + r_n x_n = 0$ forcing
> every $r_i = 0$.

Over a field this recovers the dimension of a vector space, and a maximal
independent set is a basis. Over a general PID the rank still counts independence,
but a rank-$n$ module need not have a basis of $n$ elements: an element killed by
a nonzero ring element can never sit in an independent set, so
$\mathbb{Z} \oplus \mathbb{Z}/2\mathbb{Z}$ has rank $1$ yet is not free.

> **Definition (Torsion submodule).** For an integral domain $R$ and an
> $R$-module $M$, the **torsion submodule** is
> $$
> \operatorname{Tor}(M) = \{\, x \in M \mid rx = 0 \text{ for some nonzero } r \in R \,\}.
> $$
> $M$ is **torsion free** if $\operatorname{Tor}(M) = 0$ and a **torsion module**
> if $\operatorname{Tor}(M) = M$.

> **Definition (Annihilator).** The **annihilator** of a submodule $N \subseteq M$
> is the ideal $\operatorname{Ann}(N) = \{\, r \in R \mid rn = 0 \text{ for all }
> n \in N \,\}$. If $N \subseteq L$ then $\operatorname{Ann}(L) \subseteq
> \operatorname{Ann}(N)$, and over a PID, writing $\operatorname{Ann}(N) = (a)$
> and $\operatorname{Ann}(L) = (b)$ gives $a \mid b$.

The last containment is the module version of a divisibility statement that will
reappear as the invariant-factor chain. When $R = \mathbb{Z}$ it is Lagrange's
theorem: the order of an element divides the order of the group.

A PID is **Noetherian** — every
ascending chain of ideals stabilizes — because any union of a chain of ideals is
again a principal ideal, generated by an element that already lives in one link of
the chain. Consequently every submodule of a finitely generated module over a PID
is again finitely generated.[^df-basic]

## The stacked-basis theorem

The whole chapter rests on how a submodule sits inside a
[free module](/abstract-algebra/module-theory/free-modules-and-direct-sums).
Over a field, a subspace of $F^n$ is again $F^m$ and any basis extends; over a
PID the analogue holds, but the two bases are linked by scalars.

> **Theorem (Stacked basis).** Let $R$ be a PID, let $M$ be a free $R$-module of
> finite rank $n$, and let $N \subseteq M$ be a submodule. Then:
> - $N$ is free of some rank $m \le n$;
> - there is a basis $y_1, \dots, y_n$ of $M$ and nonzero scalars
>   $a_1, \dots, a_m \in R$ with $a_1 \mid a_2 \mid \cdots \mid a_m$ such that
>   $a_1 y_1, \dots, a_m y_m$ is a basis of $N$.

A single basis of $M$ serves for both modules: multiply its first $m$ vectors by
the scalars $a_i$ to obtain a basis of $N$.

> **Proof sketch.** Take $a_1$ to be a generator of an ideal $\varphi(N)$ that is
> maximal among the ideals $\{\psi(N) : \psi \in \operatorname{Hom}_R(M, R)\}$;
> such a maximal element exists because $R$ is Noetherian. Maximality forces $a_1$
> to divide every coordinate of a preimage $y \in N$ with $\varphi(y) = a_1$,
> which splits off one summand $M = Ry_1 \oplus \ker \varphi$ with $a_1 y_1 \in N$.
> Induction on the rank handles the rest and produces the divisibility
> $a_1 \mid a_2 \mid \cdots \mid a_m$.[^df-stacked] $\square$
$$
% caption: The stacked-basis theorem: one basis of $M$ works for both modules, its first $m$ vectors scaled by $a_1 \mid a_2 \mid \cdots \mid a_m$ to give a basis of the submodule $N$.
\begin{tikzpicture}[font=\small, >=stealth]
\definecolor{acc}{HTML}{4A6FA5}
\foreach \i/\lab in {1/{y_1},2/{y_2},3/{y_3}} {
  \node[draw, minimum size=9mm] (m\i) at ({(\i-1)*1.8},1.6) {$\lab$};
}
\node at (4.9,1.6) {...};
\node[draw, minimum size=9mm] (mn) at (6.4,1.6) {$y_n$};
\node[black, anchor=west] at (7.3,1.6) {basis of $M$};
\foreach \i/\lab in {1/{a_1 y_1},2/{a_2 y_2},3/{a_3 y_3}} {
  \node[draw, fill=acc!10, minimum size=9mm] (n\i) at ({(\i-1)*1.8},0) {$\lab$};
}
\node at (4.9,0) {...};
\node[draw, fill=acc!10, minimum size=9mm] (nm) at (6.4,0) {$a_m y_m$};
\node[acc, anchor=west] at (7.3,0) {basis of $N$};
\foreach \i in {1,2,3} \draw[->, acc] (m\i) -- (n\i) node[midway, right, font=\footnotesize] {$a_{\i}$};
\end{tikzpicture}
$$

## Existence: invariant factors

Present $M$ by generators and relations. If $M$ is generated by $n$ elements,
there is a surjection $\pi : R^n \to M$, and by the first isomorphism theorem
$M \cong R^n / \ker\pi$. The kernel is a submodule of the free module $R^n$, so
the stacked-basis theorem applies to it. Quotienting the free module by its scaled
sub-basis leaves exactly a direct sum of cyclic modules.

> **Theorem (Invariant factor form).** Let $R$ be a PID and $M$ a finitely
> generated $R$-module. Then
> $$
> M \;\cong\; R^r \oplus R/(a_1) \oplus R/(a_2) \oplus \cdots \oplus R/(a_m)
> $$
> for some integer $r \ge 0$ and nonzero non-units $a_1, \dots, a_m \in R$
> satisfying
> $$
> a_1 \mid a_2 \mid \cdots \mid a_m.
> $$
> Moreover $M$ is torsion free if and only if it is free, and $M$ is a torsion
> module if and only if $r = 0$, in which case $\operatorname{Ann}(M) = (a_m)$.

> **Definition (Free rank and invariant factors).** The integer $r$ is the **free
> rank** (or **Betti number**) of $M$. The elements $a_1, \dots, a_m$, defined up
> to multiplication by units, are the **invariant factors** of $M$.

$$
% caption: The invariant-factor decomposition: a free part of rank $r$ and torsion cyclic summands whose annihilators form the divisibility chain.
\begin{tikzpicture}[font=\small]
\definecolor{acc}{HTML}{4A6FA5}
\node[draw, minimum height=11mm, minimum width=15mm] (free) at (0,0) {$R^{r}$};
\node at (1.5,0) {$+$};
\node[draw, minimum height=11mm, minimum width=15mm, fill=acc!10] (t1) at (3,0) {$\dfrac{R}{(a_1)}$};
\node at (4.5,0) {$+$};
\node[draw, minimum height=11mm, minimum width=15mm, fill=acc!10] (t2) at (6,0) {$\dfrac{R}{(a_2)}$};
\node at (7.35,0) {...};
\node[draw, minimum height=11mm, minimum width=15mm, fill=acc!10] (tm) at (8.7,0) {$\dfrac{R}{(a_m)}$};
\node[anchor=north, font=\footnotesize] at (0,-0.9) {free part};
\draw[black] (2.2,-0.85) -- (9.5,-0.85);
\node[black, anchor=north, font=\footnotesize] at (5.85,-0.9) {torsion submodule};
\end{tikzpicture}
$$

The divisibility chain is what pins the decomposition down. Without it the ideals
$(a_i)$ are not unique: $\mathbb{Z}/6 \cong \mathbb{Z}/2 \oplus \mathbb{Z}/3$, so
the "same" module can be written with different lists of cyclic factors. The
condition $a_1 \mid a_2 \mid \cdots \mid a_m$ singles out one list.

### Computing the decomposition from a relations matrix

The decomposition is computable. When $R$ is a Euclidean domain (so $R = \mathbb{Z}$
or $R = F[x]$ in the applications), write the generators $y_1, \dots, y_m$ of
$\ker\pi$ in the basis $x_1, \dots, x_n$ of $R^n$; the coefficients form the
$m \times n$ **relations matrix** $A = (a_{ij})$. Elementary row operations change
the choice of generators for $\ker\pi$, elementary column operations change the
basis of $R^n$, and neither touches the module $M$. Diagonalizing $A$ by these
operations therefore reads off the invariant factors.[^df-relmat]

> **Worked example.** Let $M = \mathbb{Z}^3 / K$, where $K$ is generated by the
> three relations
>
> $$
> \begin{aligned}
> 2x_1 + 4x_2 + 6x_3 &= 0, \\
> 4x_1 + 7x_2 + 8x_3 &= 0, \\
> 6x_1 + 8x_2 + 14x_3 &= 0,
> \end{aligned}
> \qquad
> A = \begin{pmatrix} 2 & 4 & 6 \\ 4 & 7 & 8 \\ 6 & 8 & 14 \end{pmatrix}.
> $$
>
> No entry is a unit, so take the smallest entry $2$ as pivot and clear its column
> and row:
>
> $$
> A
> \xrightarrow{\;R_2 \to R_2 - 2R_1\;}
> \begin{pmatrix} 2 & 4 & 6 \\ 0 & -1 & -4 \\ 6 & 8 & 14 \end{pmatrix}
> \xrightarrow{\;R_3 \to R_3 - 3R_1\;}
> \begin{pmatrix} 2 & 4 & 6 \\ 0 & -1 & -4 \\ 0 & -4 & -4 \end{pmatrix}
> $$
>
> $$
> \xrightarrow{\;C_2 \to C_2 - 2C_1\;}
> \begin{pmatrix} 2 & 0 & 6 \\ 0 & -1 & -4 \\ 0 & -4 & -4 \end{pmatrix}
> \xrightarrow{\;C_3 \to C_3 - 3C_1\;}
> \begin{pmatrix} 2 & 0 & 0 \\ 0 & -1 & -4 \\ 0 & -4 & -4 \end{pmatrix}.
> $$
>
> The pivot $2$ does not divide the interior entry $-1$, so the divisibility chain
> would fail; repair it by moving $-1$ into the pivot position. Add row $2$ to row
> $1$, swap columns $1$ and $2$, and normalize the sign:
>
> $$
> \xrightarrow{\;R_1 \to R_1 + R_2\;}
> \begin{pmatrix} 2 & -1 & -4 \\ 0 & -1 & -4 \\ 0 & -4 & -4 \end{pmatrix}
> \xrightarrow{\;C_1 \leftrightarrow C_2\;}
> \begin{pmatrix} -1 & 2 & -4 \\ -1 & 0 & -4 \\ -4 & 0 & -4 \end{pmatrix}
> \xrightarrow{\;R_1 \to -R_1\;}
> \begin{pmatrix} 1 & -2 & 4 \\ -1 & 0 & -4 \\ -4 & 0 & -4 \end{pmatrix}
> $$
>
> and clear again with the new pivot $1$:
>
> $$
> \xrightarrow{\substack{R_2 \to R_2 + R_1 \\ R_3 \to R_3 + 4R_1}}
> \begin{pmatrix} 1 & -2 & 4 \\ 0 & -2 & 0 \\ 0 & -8 & 12 \end{pmatrix}
> \xrightarrow{\substack{C_2 \to C_2 + 2C_1 \\ C_3 \to C_3 - 4C_1}}
> \begin{pmatrix} 1 & 0 & 0 \\ 0 & -2 & 0 \\ 0 & -8 & 12 \end{pmatrix}.
> $$
>
> The remaining $2 \times 2$ block has smallest entry $-2$, which divides both
> other entries:
>
> $$
> \xrightarrow{\;R_2 \to -R_2\;}
> \begin{pmatrix} 1 & 0 & 0 \\ 0 & 2 & 0 \\ 0 & -8 & 12 \end{pmatrix}
> \xrightarrow{\;R_3 \to R_3 + 4R_2\;}
> \begin{pmatrix} 1 & 0 & 0 \\ 0 & 2 & 0 \\ 0 & 0 & 12 \end{pmatrix}.
> $$
>
> The diagonal is $1, 2, 12$ with $1 \mid 2 \mid 12$. The unit entry $1$
> contributes the zero summand $\mathbb{Z}/(1) = 0$, so
>
> $$
> M \;\cong\; \mathbb{Z}/2\mathbb{Z} \oplus \mathbb{Z}/12\mathbb{Z},
> $$
>
> an abelian group of order $24$ with invariant factors $2 \mid 12$. Its
> elementary divisors follow by factoring: $2$ and $12 = 4 \cdot 3$ give
> $2, 4, 3$, so also $M \cong \mathbb{Z}/2 \oplus \mathbb{Z}/4 \oplus \mathbb{Z}/3$.
> As a check, the product of the invariant factors is $\det A$ up to sign:
> $\det A = -24$ and $1 \cdot 2 \cdot 12 = 24$.

## Existence: elementary divisors

The invariant factors can be broken further. In a PID every nonzero non-unit
factors into prime powers, and the
[Chinese Remainder Theorem](/abstract-algebra/ring-theory/fractions-and-the-chinese-remainder-theorem)
splits a cyclic module along coprime factors: if $a = u\, p_1^{\alpha_1} \cdots
p_s^{\alpha_s}$ with distinct primes $p_i$, then the ideals $(p_i^{\alpha_i})$ are
pairwise comaximal and
$$
R/(a) \;\cong\; R/(p_1^{\alpha_1}) \oplus \cdots \oplus R/(p_s^{\alpha_s}).
$$

Applying this to each cyclic factor in the invariant-factor form gives the second
decomposition.

> **Theorem (Elementary divisor form).** Let $R$ be a PID and $M$ a finitely
> generated $R$-module. Then
> $$
> M \;\cong\; R^r \oplus R/(p_1^{\alpha_1}) \oplus R/(p_2^{\alpha_2}) \oplus \cdots
> \oplus R/(p_t^{\alpha_t}),
> $$
> where $r \ge 0$ and the $p_i^{\alpha_i}$ are positive powers of (not necessarily
> distinct) primes. The prime powers $p_i^{\alpha_i}$, defined up to units, are the
> **elementary divisors** of $M$.

Grouping the summands by prime gives the **primary decomposition**: the torsion
part is $N_1 \oplus \cdots \oplus N_k$ where $N_i$, the $p_i$-**primary
component**, collects every element annihilated by some power of $p_i$. Each
$N_i$ is itself a direct sum of cyclic modules with annihilators powers of the
single prime $p_i$.[^df-elem]

The two decompositions are two readings of one grid. Lay the elementary divisors
out with one row per prime and one column per invariant factor: the entry in row
$p$, column $a_j$ is the $p$-power dividing $a_j$. Reading **down a column**
multiplies the prime powers into an invariant factor; reading **across a row**
lists the elementary divisors for that prime.

$$
% caption: The conversion grid. Each column multiplies to an invariant factor; each row lists the elementary divisors for one prime. Columns are padded with $1$ so all rows have equal length.
\begin{tikzpicture}[font=\small, >=stealth]
\definecolor{acc}{HTML}{4A6FA5}
\node[font=\footnotesize, black] at (2,2.1) {$a_1$};
\node[font=\footnotesize, black] at (4,2.1) {$a_2$};
\node[font=\footnotesize, black, anchor=east] at (0.4,1) {prime $p$};
\node[font=\footnotesize, black, anchor=east] at (0.4,0) {prime $q$};
\node[draw, fill=acc!10, minimum size=9mm] at (2,1) {$p$};
\node[draw, fill=acc!10, minimum size=9mm] at (4,1) {$p^2$};
\node[draw, fill=acc!10, minimum size=9mm] at (2,0) {$1$};
\node[draw, fill=acc!10, minimum size=9mm] at (4,0) {$q^2$};
\draw[->, acc] (2,-0.6) -- (2,-1.15);
\draw[->, acc] (4,-0.6) -- (4,-1.15);
\node[acc] at (2,-1.5) {$p$};
\node[acc] at (4,-1.5) {$p^2 q^2$};
\node[acc, anchor=north, font=\footnotesize] at (3,-1.9) {invariant factors (column products)};
\end{tikzpicture}
$$

To go from elementary divisors to invariant factors: sort the powers of each prime
into nondecreasing order, pad the shorter lists with $1$'s so every prime has the
same count, and multiply the largest power of each prime for the largest invariant
factor, the next largest for the next, and so on.

```algorithm
caption: $\textsc{ToInvariantFactors}$ — assemble invariant factors from elementary divisors
input: multiset $E$ of prime powers $p^\alpha$
for each distinct prime $p$ occurring in $E$ do
  collect its powers into a list, sorted in nondecreasing exponent
let $w \gets$ the maximum list length over all primes
pad every prime's list on the left with copies of $1$ up to length $w$
for $j \gets w$ down to $1$ do
  $a_j \gets$ product over all primes of the $j$-th entry of that prime's list
return $a_1 \mid a_2 \mid \cdots \mid a_w$
```

> **Worked example.** Find the invariant factors of
> $M = \mathbb{Z}/2 \oplus \mathbb{Z}/4 \oplus \mathbb{Z}/3 \oplus \mathbb{Z}/9 \oplus \mathbb{Z}/5$.
> The elementary divisors are $2, 4, 3, 9, 5$. Sort by prime and pad to the
> longest list (length $2$):
>
> | prime | smaller | larger |
> | --- | --- | --- |
> | $2$ | $2$ | $4$ |
> | $3$ | $3$ | $9$ |
> | $5$ | $1$ | $5$ |
>
> Column products give the invariant factors:
>
> $$
> a_2 = 4 \cdot 9 \cdot 5 = 180, \qquad a_1 = 2 \cdot 3 \cdot 1 = 6,
> $$
>
> so $M \cong \mathbb{Z}/6 \oplus \mathbb{Z}/180$ with $6 \mid 180$. As a check,
> $6 \cdot 180 = 1080 = 2 \cdot 4 \cdot 3 \cdot 9 \cdot 5 = |M|$.

## Uniqueness

Existence gives a decomposition; the theorem also asserts that it is essentially
unique. The proof reduces to counting dimensions of vector spaces over the residue
field $F = R/(p)$.

> **Theorem (Uniqueness).** Let $R$ be a PID. Two finitely generated $R$-modules
> are isomorphic if and only if they have the same free rank and the same list of
> invariant factors — equivalently, the same free rank and the same list of
> elementary divisors.

> **Proof sketch.** Three moves. An isomorphism carries torsion to torsion, so
> $\operatorname{Tor}(M_1) \cong \operatorname{Tor}(M_2)$ and the free quotients
> match. For the free rank, reduce mod a prime $p$: $R^r/pR^r \cong F^r$, so
> $M_i / \operatorname{Tor}(M_i)$ reduced mod $p$ has dimension $r_i$ over $F$,
> forcing $r_1 = r_2$. For the torsion part, fix a prime $p$ and examine the
> $p$-primary component; the map $x \mapsto px$ peels one power off every
> elementary divisor of $p$, and induction on the largest power together with the
> dimension count of $M/pM$ shows the two modules have the same multiset of
> $p$-power elementary divisors. Since invariant factors are recovered from
> elementary divisors by a deterministic procedure, matching one list matches the
> other.[^df-uniq] $\square$
The theorem yields a decision procedure for isomorphism: put both modules in
invariant factor (or elementary divisor) form and compare the lists.

| | Invariant factor form | Elementary divisor form |
| --- | --- | --- |
| Summands | $R/(a_1), \dots, R/(a_m)$ | $R/(p_i^{\alpha_i})$, prime powers |
| Constraint | $a_1 \mid a_2 \mid \cdots \mid a_m$ | each annihilator a prime power |
| Count | as few cyclic factors as possible | as many, as simple as possible |
| Reads off | minimal generators; $\operatorname{Ann} = (a_m)$ | primary components |
| Uniqueness | the list $(a_1, \dots, a_m)$ | the multiset $\{p_i^{\alpha_i}\}$ |
| Bridge | CRT splits each $R/(a_i)$ | pack prime powers back into a chain |

## The case $R = \mathbb{Z}$

Take $R = \mathbb{Z}$. A finitely generated $\mathbb{Z}$-module is exactly a
finitely generated abelian group, cyclic modules $\mathbb{Z}/(a)$ are cyclic
groups, and the two forms of the theorem are the two forms of the classification
of finite abelian groups. The free rank $r$ counts the copies of $\mathbb{Z}$; the
torsion part is the finite subgroup.

> **Corollary (Fundamental theorem of finitely generated abelian groups).** Every
> finitely generated abelian group is
> $$
> \mathbb{Z}^r \oplus \mathbb{Z}/(a_1) \oplus \cdots \oplus \mathbb{Z}/(a_m),
> \qquad a_1 \mid a_2 \mid \cdots \mid a_m,
> $$
> and the free rank $r$ together with the list of invariant factors determines the
> group up to isomorphism.

For example, take the abelian group of order $24$ with invariant factors $2$ and
$12$. The chain $2 \mid 12$ holds, so this is the invariant-factor form
$\mathbb{Z}_2 \oplus \mathbb{Z}_{12}$. Splitting $12 = 4 \cdot 3$ by CRT gives the
elementary-divisor form $\mathbb{Z}_2 \oplus \mathbb{Z}_4 \oplus \mathbb{Z}_3$,
with elementary divisors $2, 4, 3$ — one prime power at a time.

$$
% caption: One abelian group of order $24$ in both forms: two invariant factors $2 \mid 12$, or three prime-power elementary divisors, bridged by splitting $\mathbb{Z}_{12}$ along coprime factors.
\begin{tikzpicture}[font=\small, >=stealth]
\definecolor{acc}{HTML}{4A6FA5}
\node[draw, minimum size=10mm] (i1) at (0,1.6) {$\mathbb{Z}_{2}$};
\node at (1.2,1.6) {$+$};
\node[draw, minimum size=10mm] (i2) at (2.4,1.6) {$\mathbb{Z}_{12}$};
\node[black, anchor=west, font=\footnotesize] at (3.4,1.6) {invariant factors $2$, $12$};
\node[draw, fill=acc!10, minimum size=10mm] (e1) at (0,0) {$\mathbb{Z}_{2}$};
\node at (1.2,0) {$+$};
\node[draw, fill=acc!10, minimum size=10mm] (e2) at (2.4,0) {$\mathbb{Z}_{4}$};
\node at (3.6,0) {$+$};
\node[draw, fill=acc!10, minimum size=10mm] (e3) at (4.8,0) {$\mathbb{Z}_{3}$};
\node[acc, anchor=west, font=\footnotesize] at (5.8,0) {elementary divisors $2$, $4$, $3$};
\draw[->, black] (i2.south) .. controls (2.4,0.9) and (3.4,0.9) .. (e2.north) node[midway, right, font=\scriptsize] {CRT};
\draw[->, black] (i2.south) .. controls (3.2,0.9) and (5.4,0.9) .. (e3.north);
\draw[->, black] (i1.south) -- (e1.north);
\end{tikzpicture}
$$

Enumerating abelian groups of a given order is now bookkeeping on prime powers. For
order $p^3$, the elementary divisors for the single prime $p$ are the partitions of
$3$: $\{p^3\}$, $\{p^2, p\}$, $\{p, p, p\}$, giving $\mathbb{Z}_{p^3}$,
$\mathbb{Z}_{p^2} \oplus \mathbb{Z}_p$, and $\mathbb{Z}_p^3$ — three groups, one per
partition of the exponent.

> **Worked example.** List all abelian groups of order $72 = 2^3 \cdot 3^2$.
> Elementary divisors for $2$ are partitions of $3$ ($\{8\}$, $\{4,2\}$,
> $\{2,2,2\}$); for $3$, partitions of $2$ ($\{9\}$, $\{3,3\}$). Every pairing
> gives one group: $3 \times 2 = 6$ groups. Converting each pairing to invariant
> factors (pad, take column products):
>
> | elementary divisors | invariant factors | group |
> | --- | --- | --- |
> | $8;\ 9$ | $72$ | $\mathbb{Z}_{72}$ |
> | $8;\ 3,3$ | $3 \mid 24$ | $\mathbb{Z}_3 \oplus \mathbb{Z}_{24}$ |
> | $4,2;\ 9$ | $2 \mid 36$ | $\mathbb{Z}_2 \oplus \mathbb{Z}_{36}$ |
> | $4,2;\ 3,3$ | $6 \mid 12$ | $\mathbb{Z}_6 \oplus \mathbb{Z}_{12}$ |
> | $2,2,2;\ 9$ | $2 \mid 2 \mid 18$ | $\mathbb{Z}_2 \oplus \mathbb{Z}_2 \oplus \mathbb{Z}_{18}$ |
> | $2,2,2;\ 3,3$ | $2 \mid 6 \mid 6$ | $\mathbb{Z}_2 \oplus \mathbb{Z}_6 \oplus \mathbb{Z}_6$ |
>
> Each invariant-factor list multiplies to $72$ and satisfies the divisibility
> chain, and no two lists agree, so these six groups are pairwise nonisomorphic.

## Two specializations

The statement is neutral about which PID $R$ is, and two choices carry it into
linear algebra:

- **$R = \mathbb{Z}$** classifies finite abelian groups, as above.
- **$R = F[x]$** classifies linear operators. A finite-dimensional
  [vector space](/abstract-algebra/module-theory/vector-spaces-and-linear-maps)
  $V$ with a chosen operator $T$ becomes an $F[x]$-module by letting $x$ act as
  $T$. Because $\dim V < \infty$, this module is finitely generated and torsion.
  Its invariant factors are polynomials, and the two canonical decompositions
  become the [rational canonical form](/abstract-algebra/modules-over-pids/rational-canonical-form)
  and the [Jordan canonical form](/abstract-algebra/modules-over-pids/jordan-canonical-form).

The dictionary is exact: the largest invariant factor becomes the minimal
polynomial, and the product of all invariant factors becomes the characteristic
polynomial.

[^df-basic]: Dummit & Foote, §12.1 — Theorem 1 and Corollary 2: a PID is Noetherian, and every submodule of a finitely generated module over a Noetherian ring is finitely generated; Proposition 3 bounds the rank of a submodule of a free module.
[^df-stacked]: Dummit & Foote, §12.1 — Theorem 4: the stacked (or "aligned") basis theorem for a submodule of a finite-rank free module over a PID, with the divisibility chain $a_1 \mid a_2 \mid \cdots \mid a_m$.
[^df-elem]: Dummit & Foote, §12.1 — Theorems 5, 6, and 7: invariant-factor and elementary-divisor existence, and the primary decomposition of a torsion module into $p$-primary components.
[^df-uniq]: Dummit & Foote, §12.1 — Theorem 9 and Corollary 10: uniqueness of both decompositions via reduction modulo a prime, and the deterministic conversion between invariant factors and elementary divisors; Corollary 11 specializes to $R = \mathbb{Z}$.
[^df-relmat]: Dummit & Foote, §12.1, Exercises 16–19 — the relations-matrix computation of the invariant factor decomposition over a Euclidean domain: row operations change the generators of $\ker\pi$, column operations change the basis of $R^n$, and the reduction terminates in a diagonal matrix whose entries satisfy the divisibility chain. The diagonalization itself is the Smith normal form of §12.2, Theorem 21.
