Mathematics.

foundations of category theory

Categories and Morphisms

Category Theory75 minDifficulty6 out of 10

Overview

A category is a mathematical structure consisting of objects and morphisms (arrows) between them, satisfying identity and associativity laws. Category theory — sometimes called 'abstract nonsense' — provides a universal language that unifies disparate branches of mathematics by focusing on structure-preserving maps rather than the elements of individual structures. Morphisms generalize functions, group homomorphisms, continuous maps, and linear maps under one roof.

Intuition

Think of a category as a directed graph where nodes are 'objects' and edges are 'morphisms', with the extra rule that you can always compose two compatible arrows to get a third, and every node has a special self-loop (the identity). The magic of categories is that you completely ignore what objects are made of — a group, a topological space, and a set are all just 'objects'; what matters is only how they relate to each other via morphisms. This shift from substance to relationship is the deepest philosophical innovation of category theory.

Formal Definition

Definition

A category \(\mathcal{C}\) consists of: (1) a collection of objects \(\text{Ob}(\mathcal{C})\); (2) for each pair of objects \(A, B\), a collection of morphisms \(\text{Hom}(A,B)\) (also written \(\mathcal{C}(A,B)\)); (3) for each triple \(A, B, C\), a composition law \(\circ\); and (4) for each object \(A\), an identity morphism \(\text{id}_A\). These must satisfy two axioms:

Associativity: h(gf)=(hg)f\text{Associativity: } h \circ (g \circ f) = (h \circ g) \circ f

Composition is associative whenever defined

associativity
Identity: idBf=f=fidAfor all f:AB\text{Identity: } \text{id}_B \circ f = f = f \circ \text{id}_A \quad \text{for all } f: A \to B

Identity morphisms act as two-sided units for composition

identity
f:AB,g:BC    gf:ACf: A \to B,\quad g: B \to C \implies g \circ f : A \to C

Composition is defined precisely when the codomain of f equals the domain of g

composition-type

Notation

NotationMeaning
Ob(C)\text{Ob}(\mathcal{C})Collection of objects of category C
Hom(A,B)\text{Hom}(A,B)Set of morphisms from A to B
f:ABf: A \to Bf is a morphism with domain A and codomain B
gfg \circ fComposite of f then g
idA\text{id}_AIdentity morphism on object A
ABA \cong BA and B are isomorphic objects

Properties

Isomorphism

Amorphismf:ABisanisomorphismifthereexistsg:BAwithgf=idAandfg=idB.A morphism f: A \to B is an isomorphism if there exists g: B \to A with g \circ f = \text{id}_A and f \circ g = \text{id}_B.

Example: In \(\text{Set}\), isomorphisms are bijections. In \(\text{Grp}\), they are group isomorphisms.

Monomorphism

f:ABisamonomorphism(monic)iffg=fh    g=hforallg,hwithcodomainA.f: A \to B is a monomorphism (monic) if f \circ g = f \circ h \implies g = h for all g, h with codomain A.

Example: In \(\text{Set}\), monomorphisms are injections.

Epimorphism

f:ABisanepimorphism(epic)ifgf=hf    g=hforallg,hwithdomainB.f: A \to B is an epimorphism (epic) if g \circ f = h \circ f \implies g = h for all g, h with domain B.

Example: In \(\text{Set}\), epimorphisms are surjections. In \(\text{Ring}\), the inclusion \(\mathbb{Z} \hookrightarrow \mathbb{Q}\) is epic but not surjective.

Endomorphism and Automorphism

Anendomorphismisamorphismf:AA.Anautomorphismisanendomorphismthatisalsoanisomorphism.An endomorphism is a morphism f: A \to A. An automorphism is an endomorphism that is also an isomorphism.

Example: In \(\text{Vect}_k\), endomorphisms of \(k^n\) are \(n \times n\) matrices; automorphisms are invertible matrices.

Worked Examples

  1. Objects: all sets. Morphisms: for sets \(A, B\), define \(\text{Hom}(A,B)\) to be all functions \(f: A \to B\).

    Ob(Set)={all sets},Hom(A,B)={f:ABf is a function}\text{Ob}(\text{Set}) = \{\text{all sets}\}, \quad \text{Hom}(A,B) = \{f : A \to B \mid f \text{ is a function}\}
  2. Composition: given \(f: A \to B\) and \(g: B \to C\), define \((g \circ f)(x) = g(f(x))\). Function composition is well-defined and its output is again a function.

    (gf):AC,xg(f(x))(g \circ f): A \to C, \quad x \mapsto g(f(x))
  3. Associativity: for \(f: A \to B\), \(g: B \to C\), \(h: C \to D\) and any \(x \in A\):

    (h(gf))(x)=h(g(f(x)))=((hg)f)(x)(h \circ (g \circ f))(x) = h(g(f(x))) = ((h \circ g) \circ f)(x)
  4. Identity: for each set \(A\), define \(\text{id}_A(x) = x\). Then \(f \circ \text{id}_A = f\) and \(\text{id}_B \circ f = f\) for any \(f: A \to B\).

    idA:AA,xx\text{id}_A: A \to A, \quad x \mapsto x
  5. All axioms are satisfied, so \(\text{Set}\) is a category.

Answer: \(\text{Set}\) satisfies associativity and identity axioms, hence forms a valid category.

Practice Problems

Difficulty 6/10

Let \(\text{Vect}_k\) be the category of vector spaces over a field \(k\) with linear maps as morphisms. Prove that the monomorphisms in \(\text{Vect}_k\) are precisely the injective linear maps.

Difficulty 5/10

Describe the category \(\text{Pos}\) of partially ordered sets with order-preserving maps. What are the isomorphisms?

Difficulty 7/10

Prove that if \(f: A \to B\) is both a monomorphism and an epimorphism in a category \(\mathcal{C}\), it need not be an isomorphism. Give an explicit counterexample.

Common Mistakes

Common Mistake

Objects in a category must be sets with extra structure.

Objects can be anything — sets, spaces, propositions, processes. A category can even have a single object. The definition is purely about morphisms and composition laws.

Common Mistake

A bimorphism (mono + epi) is always an isomorphism.

This holds in balanced categories like Set, but fails in general. In Ring, \(\mathbb{Z} \to \mathbb{Q}\) is bimorphic but not an isomorphism.

Common Mistake

The composite \(g \circ f\) means 'apply g then f'.

The standard convention is \(g \circ f\) means 'apply f first, then g'. So \((g \circ f)(x) = g(f(x))\). Some authors write morphisms on the right and use \(f;g\) for the opposite convention.

Quiz

Which of the following is NOT required by the axioms of a category?
In the category \(\text{Grp}\) of groups, a morphism \(f: G \to H\) that is an epimorphism must be:
A category where every morphism is an isomorphism is called a:
What is \(\text{Hom}(\mathbb{Z}_2, \mathbb{Z}_3)\) in the category \(\text{Grp}\)?

Historical Background

Category theory was invented by Samuel Eilenberg and Saunders Mac Lane in their 1945 paper 'General Theory of Natural Equivalences', motivated by algebraic topology. They needed a rigorous framework to express the idea that two constructions (homology theories) were 'naturally' equivalent — not just isomorphic in an arbitrary way. The theory grew rapidly, with Grothendieck's use in algebraic geometry, Lawvere's categorical foundations of logic, and eventually topos theory. Today it underpins much of modern pure mathematics and theoretical computer science.

  1. 1945

    Eilenberg and Mac Lane introduce categories, functors, and natural transformations

    Samuel Eilenberg, Saunders Mac Lane

  2. 1952

    Mac Lane and others develop homological algebra using categorical language

  3. 1957

    Grothendieck introduces abelian categories and the Tohoku paper revolutionizes algebraic geometry

    Alexander Grothendieck

  4. 1963

    Lawvere's thesis on functorial semantics launches categorical logic

    F. William Lawvere

  5. 1971

    Mac Lane publishes 'Categories for the Working Mathematician', the standard reference

Summary

  • A category consists of objects and morphisms satisfying associativity and identity axioms — no inner structure of objects is assumed.
  • Key examples: Set (sets, functions), Grp (groups, homomorphisms), Top (spaces, continuous maps), Vect_k (vector spaces, linear maps), and one-object categories corresponding to monoids/groups.
  • Isomorphisms, monomorphisms, and epimorphisms are defined purely in terms of the composition law, generalizing bijections, injections, and surjections.
  • In general categories, mono + epi does not imply isomorphism — this only holds in 'balanced' categories.
  • Every group is a one-object groupoid; every preorder is a category with at most one morphism between any two objects.

References

  1. BookMac Lane, S. Categories for the Working Mathematician, 2nd ed. Springer, 1998.
  2. BookAwodey, S. Category Theory, 2nd ed. Oxford University Press, 2010.