# Appendix H. Category Theory Basics

## H.1 Motivation

Category theory studies mathematical structures through objects and maps between them. Instead of looking only at what objects are made of, it studies how they relate to other objects.

This viewpoint appears naturally in modern number theory. Groups, rings, fields, modules, schemes, varieties, sheaves, and representations all form categories. Many deep constructions are best understood as maps preserving structure.

Category theory provides a common language for algebra, topology, geometry, and arithmetic.

## H.2 Categories

A category $\mathcal{C}$ consists of:

1. objects,
2. morphisms between objects,
3. composition of morphisms,
4. identity morphisms.

If $A$ and $B$ are objects, a morphism from $A$ to $B$ is written

$$
f:A\to B.
$$

If

$$
f:A\to B
$$

and

$$
g:B\to C,
$$

then their composition is

$$
g\circ f:A\to C.
$$

Composition must be associative:

$$
h\circ(g\circ f)=(h\circ g)\circ f.
$$

Each object $A$ has an identity morphism

$$
\operatorname{id}_A:A\to A
$$

satisfying

$$
f\circ \operatorname{id}_A=f,
$$

$$
\operatorname{id}_B\circ f=f.
$$

## H.3 Examples of Categories

The category of sets has sets as objects and functions as morphisms.

The category of groups has groups as objects and group homomorphisms as morphisms.

The category of rings has rings as objects and ring homomorphisms as morphisms.

The category of fields has fields as objects and field homomorphisms as morphisms.

The category of topological spaces has spaces as objects and continuous maps as morphisms.

The category of schemes has schemes as objects and morphisms of schemes as morphisms.

In each case, the morphisms are the structure-preserving maps.

## H.4 Isomorphisms

A morphism

$$
f:A\to B
$$

is an isomorphism if there exists a morphism

$$
g:B\to A
$$

such that

$$
g\circ f=\operatorname{id}_A
$$

and

$$
f\circ g=\operatorname{id}_B.
$$

If such a morphism exists, $A$ and $B$ are isomorphic.

Isomorphic objects are structurally the same from the viewpoint of the category.

For example,

$$
\mathbb{Z}/6\mathbb{Z}
$$

and

$$
\mathbb{Z}/2\mathbb{Z}\times \mathbb{Z}/3\mathbb{Z}
$$

are isomorphic as rings, by the Chinese remainder theorem.

## H.5 Functors

A functor is a map between categories that sends objects to objects and morphisms to morphisms while preserving identity morphisms and composition.

If

$$
F:\mathcal{C}\to\mathcal{D}
$$

is a functor, then each object $A\in\mathcal{C}$ is assigned an object

$$
F(A)\in\mathcal{D}.
$$

Each morphism

$$
f:A\to B
$$

is assigned a morphism

$$
F(f):F(A)\to F(B).
$$

The functor must satisfy

$$
F(\operatorname{id}_A)=\operatorname{id}_{F(A)}
$$

and

$$
F(g\circ f)=F(g)\circ F(f).
$$

Functors make precise the idea of transporting structure.

## H.6 Forgetful Functors

A forgetful functor discards part of the structure.

For example, every group has an underlying set. This gives a functor from groups to sets:

$$
\mathbf{Grp}\to\mathbf{Set}.
$$

It sends a group to its underlying set and a group homomorphism to its underlying function.

Similarly, a ring can be viewed as an abelian group under addition. This gives a forgetful functor:

$$
\mathbf{Ring}\to\mathbf{Ab}.
$$

Forgetful functors are useful because they show how one structure refines another.

## H.7 Free Objects

A free object is an object generated by a set with no relations except those forced by the structure.

The free group on a set $S$ is the group whose elements are formal words in symbols from $S$ and their inverses.

The free module over a ring $R$ with basis $S$ consists of finite $R$-linear combinations of elements of $S$.

Free objects are important because maps out of them are easy to define. To define a homomorphism from a free object, it is enough to specify where the generators go.

This principle appears throughout algebra and arithmetic.

## H.8 Natural Transformations

Functors themselves can be compared. A natural transformation is a systematic way to map one functor to another.

Suppose

$$
F,G:\mathcal{C}\to\mathcal{D}
$$

are functors. A natural transformation

$$
\eta:F\Rightarrow G
$$

assigns to each object $A\in\mathcal{C}$ a morphism

$$
\eta_A:F(A)\to G(A)
$$

such that for every morphism

$$
f:A\to B,
$$

the diagram commutes:

$$
G(f)\circ \eta_A=\eta_B\circ F(f).
$$

Naturality means the construction does not depend on arbitrary choices. It behaves consistently with all morphisms in the category.

## H.9 Universal Properties

A universal property characterizes an object by how maps to or from it behave.

This is one of the central ideas of category theory.

For example, the product of two objects $A$ and $B$ is an object $A\times B$ equipped with projection maps

$$
\pi_A:A\times B\to A,
$$

$$
\pi_B:A\times B\to B,
$$

such that for every object $X$ with maps

$$
f:X\to A,
$$

$$
g:X\to B,
$$

there exists a unique map

$$
h:X\to A\times B
$$

with

$$
\pi_A\circ h=f,
$$

$$
\pi_B\circ h=g.
$$

The product is defined not by its internal construction, but by its mapping behavior.

## H.10 Products and Coproducts

A product combines objects using maps into the factors.

In sets, the product is the Cartesian product:

$$
A\times B.
$$

In groups, the product is the direct product:

$$
G\times H.
$$

A coproduct is the dual notion. It combines objects using maps out of the factors.

In sets, the coproduct is disjoint union.

In abelian groups, the coproduct is direct sum.

In rings, products and coproducts behave differently from naive expectations. This is one reason universal properties are preferred over elementwise descriptions.

## H.11 Initial and Terminal Objects

An initial object $I$ in a category is an object such that for every object $A$, there is a unique morphism

$$
I\to A.
$$

A terminal object $T$ is an object such that for every object $A$, there is a unique morphism

$$
A\to T.
$$

In the category of sets, the empty set is initial, and any one-element set is terminal.

In the category of groups, the trivial group is both initial and terminal.

Initial and terminal objects are simple examples of universal properties.

## H.12 Opposite Categories

Every category $\mathcal{C}$ has an opposite category

$$
\mathcal{C}^{op}.
$$

It has the same objects as $\mathcal{C}$, but all morphisms are reversed.

Thus a morphism

$$
f:A\to B
$$

in $\mathcal{C}$ becomes a morphism

$$
f:B\to A
$$

in $\mathcal{C}^{op}$.

Opposite categories formalize duality. Many constructions come in pairs: product and coproduct, injective and projective, limits and colimits.

## H.13 Limits and Colimits

Limits generalize products, pullbacks, inverse limits, and equalizers.

Colimits generalize coproducts, pushouts, direct limits, and coequalizers.

The point is that many constructions share the same abstract form: they solve a universal mapping problem.

In number theory, limits and colimits appear in:

- profinite groups,
- $p$-adic completions,
- Galois groups,
- sheaf cohomology,
- étale fundamental groups.

For example, the $p$-adic integers may be viewed as an inverse limit:

$$
\mathbb{Z}_p =
\varprojlim_n \mathbb{Z}/p^n\mathbb{Z}.
$$

This formula says that a $p$-adic integer is compatible data modulo $p$, modulo $p^2$, modulo $p^3$, and so on.

## H.14 Representable Functors

A functor is representable if it is naturally isomorphic to a Hom functor.

For an object $A$, the functor

$$
\operatorname{Hom}(A,-)
$$

sends an object $X$ to the set of morphisms

$$
\operatorname{Hom}(A,X).
$$

The functor

$$
\operatorname{Hom}(-,A)
$$

is contravariant and sends $X$ to

$$
\operatorname{Hom}(X,A).
$$

Representability means that an abstract rule is actually encoded by a concrete object.

This idea is essential in algebraic geometry, especially in the study of moduli spaces.

## H.15 Adjunctions

An adjunction is a pair of functors

$$
F:\mathcal{C}\to\mathcal{D},
$$

$$
G:\mathcal{D}\to\mathcal{C}
$$

related by natural bijections

$$
\operatorname{Hom}_{\mathcal{D}}(F(A),B)
\cong
\operatorname{Hom}_{\mathcal{C}}(A,G(B)).
$$

The functor $F$ is called left adjoint to $G$, and $G$ is called right adjoint to $F$.

Adjunctions capture the idea that one construction is the most efficient way to produce another kind of object.

Examples include:

- free group and forgetful functor,
- tensor product and Hom,
- localization and restriction,
- extension and restriction of scalars.

Adjunctions are one of the main organizing principles in modern mathematics.

## H.16 Categories in Algebraic Geometry

Algebraic geometry is deeply categorical.

Affine schemes reverse the direction of commutative rings:

$$
R \mapsto \operatorname{Spec}(R).
$$

A ring homomorphism

$$
R\to S
$$

induces a morphism of schemes

$$
\operatorname{Spec}(S)\to \operatorname{Spec}(R).
$$

This reversal explains why opposite categories are unavoidable in modern arithmetic geometry.

Many geometric constructions become clearer when expressed functorially.

## H.17 Categories in Number Theory

Category theory appears in number theory through many structures.

| Category | Objects | Morphisms |
|---|---|---|
| $\mathbf{Ab}$ | abelian groups | group homomorphisms |
| $\mathbf{Ring}$ | rings | ring homomorphisms |
| $\mathbf{Field}$ | fields | field homomorphisms |
| $\mathbf{Mod}_R$ | $R$-modules | $R$-linear maps |
| $\mathbf{Sch}$ | schemes | scheme morphisms |
| $\mathbf{Rep}(G)$ | representations of $G$ | intertwining maps |

The categorical view helps separate construction from presentation. A ring may be presented by generators and relations, but its true role is expressed through maps into and out of it.

## H.18 Why Category Theory Matters

Category theory gives modern number theory a precise language for structure-preserving construction.

It clarifies when two constructions are the same in a natural way. It explains why similar patterns appear in algebra, topology, analysis, and geometry. It allows arithmetic objects to be studied not just as sets with elements, but as parts of larger systems of maps.

This viewpoint is essential for schemes, sheaves, cohomology, Galois representations, moduli problems, and the Langlands program.

