# What is a module?

The most familiar example of a module is probably a vector space like $\mathbb{R}^n$, in which you can add and subtract vectors, or multiply a vector by a real number (a scalar). More generally, the abstract axioms for a vector space $V$ over a field $K$ look like this:

• The data: $V$ is an abelian group (so it comes with a notion of $+, -$ and $0$), and we have a “multiplication” $K\times V\to V$ (so you can multiply vectors by scalars).
• The properties: $K\times V\to V$ is bilinear and an action, in the sense that for all $a,b\in K$ and $v,w\in V$,
• $(a+b)\cdot v = a\cdot v + b\cdot v$,
• $a\cdot(v+w) = a\cdot v + a\cdot w$, and
• $a\cdot(b\cdot v) = (ab)\cdot v$ and $1\cdot v = v$.

It’s straightforward to check that $K^n$, with the product abelian group structure under addition, and componentwise multiplication by $K$, is always a vector space over $K$. In fact, these and their infinite-dimensional variants are the only examples of vector spaces, up to isomorphism.

One key feature of the vector space axioms is that nowhere do they use division. The only properties of $K$ that we use explicitly are its addition, multiplication, and unit element; if we also want $K$ to be a vector space over itself, we also implicitly use that addition makes $K$ an abelian group, and that multiplication makes $K$ a monoid and distributes over addition.

A set equipped with both an abelian group structure $+$ and a monoid structure $\cdot$ distributing over it is called a ring. (Any field, like $\mathbb{R}$ or $\mathbb{Q}$, is a ring, but there are also rings like $\mathbb{Z}$ which are not fields because their nonzero elements don’t all have multiplicative inverses.) If $R$ is a ring, then an $R$-module $M$ is, again, just an abelian group with a multiplication $R\times M\to M$ that is both bilinear and an action in the exact same sense as for vector spaces over fields. We automatically get an $R$-module structure on each power $R^n$, just as with vector spaces over fields.

(Note: I’m most comfortable working with commutative rings, in which the multiplication operation commutes. In the following, every ring is assumed to be commutative.)

Question: Every vector space over a field $K$ is isomorphic to one of the form $K^n$ or its infinite-dimensional analogues. Is the same true for modules over a ring $R$?

Answer: No! The technical result for vector spaces is that every vector space has a basis: if $V$ is a vector space over $K$, then a basis for $V$ is a collection of vectors $B\subseteq V$ for which every vector in $V$ can be uniquely written as a $K$-linear combination $a_1\cdot v_1 + \dots + a_n v_n$ with all the $a_i\in K$ and the $v_i\in B$. If you’ve got a basis of size $n$, say $\{b_1,\dots,b_n\}$, then you get an isomorphism $K^n\to V$ sending $(1,0,\dots,0)$ to $b_1$, $(0,1,0,\dots,0)$ to $b_2$, and so on up to $(0,\dots,0,1)\mapsto b_n$.

The notion of basis makes sense in the module context—a collection of elements of $M$ such that every element can be written uniquely as an $R$-linear combination of them—it’s just that modules don’t in general have them. Here are two examples of modules without a basis:

Example 1. The abelian group $\mathbb{Z}/3\mathbb{Z}$ is a $\mathbb{Z}$-module under the multiplication $n\cdot[m] = [nm]$. (In fact, every abelian group is a $\mathbb{Z}$-module in a unique way.) But while $[1]\in\mathbb{Z}/3\mathbb{Z}$ has the property that every other element can be written as a multiple of it (e.g. $[0] = 0\cdot [1]$ and $[2] = 2\cdot [1]$), there’s more than one way to do so: we also have $[0] = 3\cdot [1]$ and $[2] = 5\cdot[1]$. It’s not hard to see that no other collection of elements of $\mathbb{Z}/3\mathbb{Z}$ forms a basis either.

Example 2. The abelian group $\mathbb{Q}$ is also a $\mathbb{Z}$-module with the ordinary multiplication $n\cdot a/b = (na)/b$, but it doesn’t have a basis of any size. Suppose I had such a basis $\{r_1,r_2,\dots\}$, and write $r_1/2$ as a $\mathbb{Z}$-linear combination $n_1 r_1 + n_2 r_2 + \dots$. Double this equation: We now have $r_1 = 2n_1 r_1 + 2n_2 r_2 + \dots$ but also $r_1= 1r_1 + 0r_2 + 0r_3 + \dots$. These are two different linear expressions for the same element of $\mathbb{Q}$—the coefficient of $r_1$ is even in one and odd in the other—which contradicts our assumption that $\{r_1,r_2,\dots\}$ was a basis.

Having a basis is actually pretty unusual for a module, and modules that do have them are called free. It’s much more common to drop uniqueness and ask merely for a collection of elements such that every other element can be written in at least one way as a linear combination of them, like $\{[1]\}$ did for $\mathbb{Z}/3\mathbb{Z}$. That’s called a generating set, and if you’ve got one, its elements are called generators. In the case of a singleton generating set like $\{[1]\}$, that says the map $\mathbb{Z} \to \mathbb{Z}/3\mathbb{Z}$ sending $n$ to $n\cdot [1]$ is surjective, and in general, a size-$n$ generating set $m_1,\dots,m_n$ for $M$ gives you a surjection $R^n\to M$ sending $(1,0,\dots,0)\mapsto m_1$ up to $(0,\dots,0,1)\mapsto m_n$.

Question: Even though not every module has a basis, does every module at least have a generating set?

Answer: Yes—just take the whole module as its generating subset! This is usually overkill: $\mathbb{Z}^2$, for example, can be generated as a $\mathbb{Z}$-module by just the two elements $(1,0)$ and $(0,1)$. In general, we say that if a module has a finite generating set then it is finitely generated. For vector spaces, that reduces to the ordinary notion of a finite-dimensional vector space. Taking any infinite-dimensional vector space, then—say, the $\mathbb{R}$-vector space of all polynomials with real coefficients, or the $\mathbb{Q}$-vector space of all real numbers—we get an example of a module that is not finitely generated.