Category Theory: A Primer for Non-Mathematicians

By Josh Fairhead4 minutes read

TL;DR: This article provides an approachable introduction to category theory for those with a tech background but without formal mathematical training. Category theory offers a powerful framework that unifies much of mathematics through the elegant abstractions of objects and morphisms.

Introduction

Coming from a background in tech product development rather than pure mathematics or coding, I’ve recently begun exploring category theory. While I’m familiar with the work of J.G. Bennett and have been exposed to mathematical and programming concepts, I’m essentially starting from the ground up when it comes to formal category theory. This exposition shares what I’ve learned so far, presented in a way that hopefully makes these concepts accessible to others in similar positions.

Foundations: Beyond Set Theory

Traditional mathematics typically builds upon set theory as its foundation. However, category theory offers something different—and arguably more powerful. While sets and categories are fundamentally different constructs, category theory provides greater explanatory power and can integrate vast swaths of the mathematical landscape into a unified framework.

Where set theory focuses on membership and elements, category theory emphasizes relationships and transformations. This shift in perspective proves remarkably fruitful for understanding mathematical structures and their interconnections.

The Basic Building Blocks

Objects and Morphisms

If you’re familiar with graph theory or network diagrams, you already understand the visual metaphor: nodes connected by edges. In category theory, these become:

A category consists of these objects and morphisms, bound together by three fundamental laws that ensure mathematical coherence.

The Three Laws

1. Identity

Every object must have an identity morphism—an arrow that loops back to itself. This self-referential morphism leaves the object unchanged, much like multiplying by 1 or adding 0 in arithmetic. Visually, this appears as a loop starting and ending at the same object.

2. Associativity

When we have multiple morphisms connecting objects, the order in which we group them doesn’t matter. If we have morphisms f, g, and h that can be composed, then (f ∘ g) ∘ h = f ∘ (g ∘ h). This property ensures consistency in how we navigate through our categorical structures.

3. Composition

Perhaps the most powerful law: whenever we have a path from object A to B, and another from B to C, there must exist a direct morphism from A to C that represents their composition. We say this diagram “commutes”—meaning all paths between the same endpoints are equivalent. This creates a rich network of relationships where indirect connections imply direct ones.

Types of Morphisms

Morphisms come in various flavors, each capturing different mathematical relationships:

Higher-Order Structures

Functors: Morphisms Between Categories

Just as morphisms connect objects within a category, functors connect entire categories to each other. A functor maps:

This creates a second-order pattern where categories themselves become objects in a higher-level view, connected by functors as their morphisms.

The Hierarchy Continues

This pattern of abstraction continues indefinitely in higher category theory:

Each level maintains the same fundamental pattern of objects and arrows, creating a fractal-like structure of mathematical relationships.

Further Exploration

This primer barely scratches the surface. Key topics for deeper investigation include: