---
title: Generation, Direct Sums, and Free Modules
module: Module Theory
moduleNumber: 8
lessonNumber: 2
order: 802
summary: >
  A generating set spans a module by R-linear combinations; a direct sum
  decomposes it into independent pieces; a free module has a basis and the
  universal property that a homomorphism is determined by arbitrary values on that
  basis. Rank is well defined over a commutative ring, torsion blocks a basis, and
  every module is a quotient of a free one — a presentation by generators and
  relations.
topics: [Module Theory]
draft: false
sources:
  - book: Dummit & Foote
    ref: "Ch. 10 — Introduction to Module Theory; §10.3 Generation of Modules, Direct Sums, and Free Modules"
---

Three notions describe how a
[module](/abstract-algebra/module-theory/introduction-to-modules) is built from a
handful of elements: **generation** (spanning by $R$-linear combinations),
**direct sums** (assembling a module from independent pieces), and **free
modules** (those with a basis). The last separates module theory from linear
algebra: over a general ring a module need not have a basis, and the modules that
do — the free ones — are the only ones where the familiar coordinate
arguments still run.[^df-gen]

## Generation

> **Definition (Submodule generated by a set).** Let $M$ be an $R$-module and
> $A \subseteq M$. The **submodule generated by $A$** is
> $$
> RA = \{ r_1 a_1 + \cdots + r_m a_m : r_i \in R,\ a_i \in A,\ m \in \mathbb{Z}^{+} \},
> $$
> the set of all finite $R$-linear combinations of elements of $A$ (with
> $RA = 0$ when $A = \varnothing$). If $N = RA$ we call $A$ a **generating set** for
> $N$. The module $N$ is **finitely generated** if $A$ can be taken finite, and
> **cyclic** if $A$ can be taken to be a single element: $N = Ra$.

$RA$ is the smallest submodule containing $A$: it is a submodule by the submodule
criterion, and any submodule containing $A$ is closed under linear combinations, so
contains $RA$. For a family of submodules $N_1, \dots, N_k$, the submodule they
generate is their **sum** $N_1 + \cdots + N_k = \{a_1 + \cdots + a_k : a_i \in N_i\}$,
the smallest submodule containing every $N_i$. Generation for modules is tamer than
for groups: because $M$ is abelian, like terms in a combination always collect,
$r_1 a_1 + r_2 a_2 + s_1 a_1 = (r_1 + s_1)a_1 + r_2 a_2$, and no word problem arises.

- **Over $\mathbb{Z}$,** $\mathbb{Z}a = \langle a \rangle$ is the cyclic subgroup
  generated by $a$; "finitely generated $\mathbb{Z}$-module" means "finitely
  generated abelian group."
- **$R$ over itself** is cyclic, generated by $1$, since $R = R \cdot 1$. Its cyclic
  submodules are the principal ideals; its finitely generated submodules are the
  finitely generated ideals.
- **Generation is not inherited by submodules.** Let $R = F[x_1, x_2, \dots]$ be the
  polynomial ring in infinitely many variables. Then $R$ is cyclic over itself, yet
  its submodule (ideal) generated by all the $x_i$ is not finitely generated. A
  finitely generated module can have a submodule that is not.

A finitely generated module has a smallest generating size $d$; any generating set
of size $d$ is a **minimal generating set**. Unlike in a vector space, minimal
generating sets can have different relations among them, and $d$ is not a complete
invariant: the relations matter, and the free-module theory below tracks them.

## Direct sums

> **Definition (External direct sum).** For $R$-modules $M_1, \dots, M_k$, the set of
> tuples $(m_1, \dots, m_k)$ with componentwise addition and action is the **direct
> sum** $M_1 \oplus \cdots \oplus M_k$ (equal to the direct product for finitely many
> factors).

The external direct sum combines separate modules. The more useful question is when
a module already _is_ a direct sum of submodules it contains, an **internal** direct
sum. The following three conditions, each equivalent, pin this down.[^df-ds]

> **Proposition (Internal direct sum).** Let $N_1, \dots, N_k \le M$ be submodules.
> The following are equivalent.
>
> - The addition map $N_1 \times \cdots \times N_k \to N_1 + \cdots + N_k$,
>   $(a_1, \dots, a_k) \mapsto a_1 + \cdots + a_k$, is an isomorphism.
> - $N_j \cap (N_1 + \cdots + N_{j-1} + N_{j+1} + \cdots + N_k) = 0$ for every $j$.
> - Every element of $N_1 + \cdots + N_k$ is _uniquely_ a sum
>   $a_1 + \cdots + a_k$ with $a_i \in N_i$.

When these hold, $M = N_1 \oplus \cdots \oplus N_k$ (internally): the external direct
sum of the $N_i$ is isomorphic to the submodule they span, and each element has one
representation. The uniqueness is of the module elements $a_i$, not of any scalars.

> **Worked example.** Show $\mathbb{Z}/6 = N_1 \oplus N_2$ for the submodules
> $N_1 = \langle 3 \rangle = \{0, 3\}$ and $N_2 = \langle 2 \rangle = \{0, 2, 4\}$.
>
> - **Trivial intersection**: $N_1 \cap N_2 = \{0\}$, since $3 \notin \{0, 2, 4\}$.
> - **Sum is everything**: $3 + 4 = 1$, so $1 \in N_1 + N_2$ and the sum, being a
>   submodule containing a generator, is all of $\mathbb{Z}/6$.
> - **Unique decomposition**: the six sums $a + b$ with $a \in N_1$, $b \in N_2$
>   are $0, 2, 4, 3, 5, 1$ — all distinct, so each element has exactly one
>   representation.
>
> Hence $\mathbb{Z}/6 \cong \mathbb{Z}/2 \oplus \mathbb{Z}/3$ as
> $\mathbb{Z}$-modules, the module form of the Chinese remainder theorem for
> $6 = 2 \cdot 3$.

$$
% caption: An internal direct sum $M = N_1 \oplus N_2$ resolves every element into a
% unique pair of components, one from each summand, exactly as coordinates resolve a
% point of the plane along two independent axes.
\begin{tikzpicture}[>=stealth, font=\footnotesize]
  \definecolor{acc}{HTML}{4A6FA5}
  \draw[->, black] (-0.3,0) -- (5,0) node[right, font=\scriptsize, text=black] {$N_1$};
  \draw[->, black] (0,-0.3) -- (0,3.4) node[above, font=\scriptsize, text=black] {$N_2$};
  \coordinate (p) at (3.4,2.5);
  \fill[acc] (p) circle (2.4pt);
  \node[anchor=south west, font=\scriptsize, text=acc] at (p) {$m = a_1 + a_2$};
  \draw[acc, dashed] (p) -- (3.4,0) node[below, font=\scriptsize, text=black] {$a_1$};
  \draw[acc, dashed] (p) -- (0,2.5) node[left, font=\scriptsize, text=black] {$a_2$};
\end{tikzpicture}
$$

## Free modules

The standard basis $e_i = (0, \dots, 0, 1, 0, \dots, 0)$ generates $R^n$, and every
tuple $(s_1, \dots, s_n) = \sum s_i e_i$ has a unique such expression — unique in the
_ring_ coefficients, not merely in the module components. That extra uniqueness is
the definition of a basis.

> **Definition (Free module, basis, rank).** An $R$-module $F$ is **free on a subset
> $A \subseteq F$** if every nonzero $x \in F$ is uniquely
> $x = r_1 a_1 + \cdots + r_n a_n$ with distinct $a_i \in A$ and nonzero $r_i \in R$.
> Then $A$ is a **basis** of $F$. When $R$ is commutative, the cardinality of $A$ is
> the **rank** of $F$.

The uniqueness here is stronger than in a direct sum. In $\mathbb{Z}/2\mathbb{Z}
\oplus \mathbb{Z}/2\mathbb{Z}$ each element is a unique sum $n_1 + n_2$ of components,
but the component $n_1 = (1,0)$ equals $1 \cdot (1,0) = 3 \cdot (1,0) = \cdots$, so
the _scalar_ is not determined. That module is not free on $\{(1,0), (0,1)\}$, nor on
any set. Freeness requires the scalars to be determined too.

$$
% caption: A free module of rank $n$ is a direct sum of $n$ copies of the ring; a
% basis assigns to each element a unique coordinate tuple of ring scalars, one per
% copy.
\begin{tikzpicture}[>=stealth, font=\footnotesize,
  cp/.style={draw, minimum width=13mm, minimum height=10mm, font=\footnotesize}]
  \definecolor{acc}{HTML}{4A6FA5}
  \node[cp] (a) at (0,0) {$R$};
  \node[font=\large] at (1.3,0) {$+$};
  \node[cp] (b) at (2.6,0) {$R$};
  \node[font=\large] at (3.9,0) {$+$};
  \node[cp] (c) at (5.2,0) {$R$};
  \node[font=\large] at (6.4,0) {$+$ ... $+$};
  \node[cp] (d) at (7.8,0) {$R$};
  \node[font=\scriptsize, text=acc] at (0,-0.95) {$r_1 e_1$};
  \node[font=\scriptsize, text=acc] at (2.6,-0.95) {$r_2 e_2$};
  \node[font=\scriptsize, text=acc] at (5.2,-0.95) {$r_3 e_3$};
  \node[font=\scriptsize, text=acc] at (7.8,-0.95) {$r_n e_n$};
  \node[anchor=north, font=\scriptsize] at (3.9,-1.6) {one scalar coordinate per copy of the ring};
\end{tikzpicture}
$$

### The universal property

Free modules are characterized by how maps out of
them behave: a homomorphism from a free module is determined by _arbitrary_ values on
a basis, with no relations to respect.

> **Theorem (Universal property of free modules).** For any set $A$ there is a free
> $R$-module $F(A)$ with basis $A$, unique up to isomorphism, with this property: for
> every $R$-module $M$ and every set map $\varphi : A \to M$, there is a **unique**
> $R$-module homomorphism $\Phi : F(A) \to M$ extending $\varphi$. When
> $A = \{a_1, \dots, a_n\}$ is finite, $F(A) = Ra_1 \oplus \cdots \oplus Ra_n \cong R^n$.

Concretely $F(A)$ is the set of functions $A \to R$ vanishing at all but finitely
many points, identified with formal finite sums $\sum r_i a_i$. The extension is
forced: $\Phi(\sum r_i a_i) = \sum r_i \varphi(a_i)$, well defined precisely because
the expression $\sum r_i a_i$ is unique. This is the same universal property free
groups have, and it is why one may "define a homomorphism on a basis and extend by
linearity": the extension exists and is unique.[^df-univ]

> **Worked example.** Define a homomorphism $\varphi : \mathbb{Z}^2 \to \mathbb{Z}/6$
> on the standard basis by $\varphi(e_1) = 2$, $\varphi(e_2) = 3$; the universal
> property extends it to $\varphi(a, b) = 2a + 3b \bmod 6$ with no conditions to
> check. It is surjective, since $\varphi(-1, 1) = 1$. The kernel is
>
> $$
> \ker\varphi = \{(a, b) : 2a + 3b \equiv 0 \pmod 6\}
> = \{(a, b) : 3 \mid a \text{ and } 2 \mid b\},
> $$
>
> because $2a \equiv -3b \pmod 6$ forces $2a \equiv 0 \pmod 3$ (so $3 \mid a$) and
> $3b \equiv 0 \pmod 2$ (so $2 \mid b$); conversely $a = 3s$, $b = 2t$ gives
> $2a + 3b = 6s + 6t \equiv 0$. So $\ker\varphi$ is generated by $(3, 0)$ and
> $(0, 2)$, and the first isomorphism theorem exhibits
> $\mathbb{Z}^2 / \langle (3,0), (0,2) \rangle \cong \mathbb{Z}/6$.

$$
% caption: The universal property: any set map from a basis $A$ into a module $M$
% extends along the inclusion to one and only one homomorphism out of the free
% module $F(A)$.
\begin{tikzpicture}[>=stealth, font=\footnotesize,
  box/.style={draw, minimum width=15mm, minimum height=10mm, font=\footnotesize}]
  \definecolor{acc}{HTML}{4A6FA5}
  \node[box] (A) at (0,2.2) {$A$};
  \node[box, draw=acc, text=acc, thick] (F) at (0,0) {$F(A)$};
  \node[box] (M) at (4.6,2.2) {$M$};
  \draw[->, black] (A) -- (F) node[midway, left, font=\scriptsize] {inclusion};
  \draw[->, black] (A) -- (M) node[midway, above, font=\scriptsize] {any map};
  \draw[->, acc, thick, dashed] (F) -- (M) node[midway, below, sloped, font=\scriptsize, text=black] {unique};
\end{tikzpicture}
$$

### Invariance of rank

For finite-dimensional vector spaces, any two bases have the same size. The same
holds for free modules over a commutative ring, so rank is an invariant.

> **Proposition (Invariance of rank).** If $R$ is commutative, then $R^n \cong R^m$
> as $R$-modules if and only if $n = m$.

> **Proof.** Reduce to the field case: pick a maximal ideal $\mathfrak{m}$, and
> note $R^n / \mathfrak{m} R^n \cong (R/\mathfrak{m})^n$ is a vector space of
> dimension $n$ over the field $R/\mathfrak{m}$. An isomorphism $R^n \cong R^m$
> descends to an isomorphism of these vector spaces, forcing $n = m$. $\square$

Commutativity is a real hypothesis: over suitable noncommutative rings one can
have $R \cong R^2 \cong R^n$ for all $n$, so "rank" is meaningless there, and the
invariant-basis-number property is a genuine restriction.

## Not every module is free

A module can have no basis at all.

> **Example (A non-free module).** As a $\mathbb{Z}$-module, $\mathbb{Z}/n\mathbb{Z}$
> ($n > 1$) has no basis. Any nonzero element $a$ satisfies $n \cdot a = 0$ with
> $n \ne 0$, so $\{a\}$ is not linearly independent — no single element, hence no
> subset, is a basis.

Torsion is the obstruction. A basis element must be free of relations, but every
element of a nontrivial finite abelian group is annihilated by its order. More
generally, any module with a nonzero torsion element is not free. Over a field there
is no torsion, which is why
[every vector space is free](/abstract-algebra/module-theory/vector-spaces-and-linear-maps);
over $\mathbb{Z}$ or $F[x]$ torsion is generic, and measuring it is the content of the
[structure theorem for modules over a PID](/abstract-algebra/modules-over-pids/structure-theorem-over-pids).

Torsion is not the only obstruction: a torsion-free module can still fail to be
free.

> **Worked example.** The $\mathbb{Z}$-module $\mathbb{Q}$ is torsion free but not
> free.
>
> - **Any two elements are dependent.** For nonzero $\tfrac{a}{b}, \tfrac{c}{d}
>   \in \mathbb{Q}$ (integer numerators and denominators),
>
> $$
> (bc) \cdot \frac{a}{b} - (ad) \cdot \frac{c}{d} = ac - ac = 0
> $$
>
>   is a nontrivial dependence with integer coefficients. So a basis has at most
>   one element.
> - **No single element generates.** $\mathbb{Z} \cdot \tfrac{a}{b} =
>   \{ \tfrac{na}{b} : n \in \mathbb{Z} \}$ misses $\tfrac{a}{2b}$, so
>   $\mathbb{Q}$ is not cyclic — indeed not finitely generated, since finitely
>   many fractions share a common denominator $D$ and generate only a submodule
>   of $\tfrac{1}{D}\mathbb{Z}$.
>
> A basis of $\mathbb{Q}$ would have to be a single element by the first point and
> cannot exist by the second. Freeness fails without any torsion.

$$
% caption: In $\mathbf{Z}/n\mathbf{Z}$ the multiples of any element $a$ close up
% after $n$ steps, so the relation $n\,a = 0$ holds and $\{a\}$ can never be a
% linearly independent set: torsion blocks a basis.
\begin{tikzpicture}[>=stealth, font=\footnotesize]
  \definecolor{acc}{HTML}{4A6FA5}
  \foreach \k/\lab/\ang in {0/{a}/60, 1/{2a}/0, 2/{3a}/-60, 3/{4a}/-120, 4/{5a}/180, 5/{0}/120}{
    \node[draw, circle, minimum size=8mm, inner sep=0pt, font=\scriptsize] (n\k) at (\ang:1.9) {$\lab$};
  }
  \draw[->, acc, thick] (n0) to[bend left=16] (n1);
  \draw[->, acc, thick] (n1) to[bend left=16] (n2);
  \draw[->, acc, thick] (n2) to[bend left=16] (n3);
  \draw[->, acc, thick] (n3) to[bend left=16] (n4);
  \draw[->, acc, thick] (n4) to[bend left=16] (n5);
  \draw[->, acc, thick] (n5) to[bend left=16] (n0);
  \node[font=\scriptsize, text=acc, align=center] at (0,0) {$6a = 0$};
\end{tikzpicture}
$$

## Constructing modules by generators and relations

Every module is a quotient of a free one. Given a generating set $S$ for $M$, the
universal property produces a surjection $F(S) \twoheadrightarrow M$ (the map that is
the identity on $S$), and its kernel $K$ records the relations among the generators,
giving a [short exact sequence](/abstract-algebra/module-theory/tensor-products-and-exact-sequences):

$$
0 \;\longrightarrow\; K \;\longrightarrow\; F(S) \;\longrightarrow\; M \;\longrightarrow\; 0.
$$

This exhibits $M \cong F(S)/K$ — a **presentation** of $M$ by generators (a basis of
$F(S)$) and relations (generators of $K$). The worked example above is exactly such
a presentation: $\mathbb{Z}/6$ presented by two generators mapping to $2$ and $3$
and the relations $(3, 0)$ and $(0, 2)$.

| Notion | Uniqueness enforced on | Field analogue | Present over $\mathbb{Z}$? |
| --- | --- | --- | --- |
| Generating set | none | spanning set | always |
| Direct sum $\bigoplus N_i$ | components $a_i$ | complementary subspaces | always |
| Free / basis | components _and_ scalars | basis | only for torsion-free special cases |

[^df-gen]: **Dummit & Foote**, _Abstract Algebra_, 3rd ed., §10.3 — generation of modules, finitely generated and cyclic modules, and the submodule generated by a subset as the set of finite $R$-linear combinations.
[^df-ds]: **Dummit & Foote**, §10.3, Proposition 5 — the equivalence of the three characterizations of an internal direct sum of submodules.
[^df-univ]: **Dummit & Foote**, §10.3, Theorem 6 and Corollary 7 — existence of the free module $F(A)$, its universal property with respect to set maps out of $A$, and the resulting "define on a basis, extend by linearity" principle; the invariance-of-rank statement is Exercise 2 of the same section.
