No history yet

Introduction to Category Theory

What is a Category?

Category theory is a way of looking at mathematics that focuses on relationships. Instead of zooming in on the details of what things are, it zooms out to see how they connect to each other.

Imagine a map. You have cities, which are like the 'things' in your system. You also have roads connecting these cities. In category theory, the cities are called objects, and the roads are called morphisms (or arrows). The key idea is that you can learn a lot about the system just by studying the roads and how they connect, without needing to know the street layout of every single city.

Category theory is less about the objects themselves and more about the network of relationships between them.

An object can be almost anything: a number, a set of items, a geometric shape, or even another category. A morphism is a structure-preserving map from one object to another. For now, just think of it as a directed connection or a transformation.

The Rules of the Road

For a collection of objects and morphisms to be officially called a category, it must follow two simple rules. These rules ensure the system is consistent and well-behaved.

1. Composition

If there's a road from city A to city B, and another from city B to city C, there must be a direct route from A to C. In category theory, if you have a morphism ff from object AA to object BB (written f:ABf: A \to B) and a morphism gg from BB to CC (g:BCg: B \to C), you must be able to compose them. This creates a new morphism that goes directly from AA to CC.

This composition is written as gfg \circ f (read "g after f"). Notice the order: you apply ff first, then gg.

gf:ACg \circ f: A \to C

Composition must also be associative. If you're composing three morphisms, hgfh \circ g \circ f, it doesn't matter if you combine gg and ff first, or hh and gg first. The final result is the same.

h(gf)=(hg)fh \circ (g \circ f) = (h \circ g) \circ f

2. Identity

Every object must have a special morphism that starts and ends at itself without changing anything. This is the identity morphism. For an object AA, its identity morphism is written as idAid_A. It represents the action of doing nothing.

idA:AAid_A: A \to A

The identity morphism works like the number 1 in multiplication. Composing any morphism ff with an identity morphism doesn't change ff. If ff goes from AA to BB, then composing it with the identity at AA or the identity at BB just gives you ff back.

fidA=fandidBf=ff \circ id_A = f \quad \text{and} \quad id_B \circ f = f

Some Common Categories

This all seems very abstract, but categories are everywhere in mathematics. The framework just gives us a new language to describe familiar structures.

CategoryObjectsMorphisms
SetSetsFunctions between sets
GrpGroupsGroup homomorphisms
TopTopological spacesContinuous functions
VectVector spacesLinear maps

Let's look at Set, the category of sets. The objects are any possible set, like {1, 2}, {a, b, c}, or the set of all integers. The morphisms are functions that map elements from one set to another.

  • Composition: Function composition. If f:ABf: A \to B and g:BCg: B \to C are functions, their composition g(f(x))g(f(x)) is a function from AA to CC.
  • Identity: The identity function. For any set AA, the function idA(x)=xid_A(x) = x maps every element to itself.

Since these properties hold, sets and functions form a valid category.

Quiz Questions 1/5

What are the two fundamental components that define a category?

Quiz Questions 2/5

In a category, if you have a morphism f:XYf: X \to Y and a morphism g:YZg: Y \to Z, which of the following represents their composition?

That's the basic machinery of a category: objects, morphisms, composition, and identity. By focusing on these simple building blocks, category theory provides a powerful, high-level view of how different areas of mathematics are connected.