Limits and Colimits
Statement
Let be a small category (the shape) and a diagram in . A limit of is an object together with projection morphisms that form a cone, universal among all such cones:
A colimit is the dual: a universal cocone with injection morphisms .
The category has all small limits (instance hasLimitsOfSize in Mathlib).
Visualization
Pullback (limit of a cospan) in Set:
Diagram: A ──f──▶ C ◀──g── B (shape: • → • ← •)
Limit = A ×_C B = { (a, b) ∈ A × B | f(a) = g(b) }
Example: A = {1,2,3}, B = {x,y,z}, C = {red,blue}
f(1)=f(2)=red, f(3)=blue
g(x)=red, g(y)=g(z)=blue
A ×_C B = { (1,x), (2,x), (3,y), (3,z) }
Universal cone:
A ×_C B
↙ ↘
A B
↘ ↙
C
Any cone W ──▶ A, W ──▶ B with f∘π_A = g∘π_B
factors uniquely through A ×_C B.
Equalizer (limit of a parallel pair):
Diagram: A ═══f═══▶ B
═══g═══▶
Equalizer = Eq(f,g) = { a ∈ A | f(a) = g(a) }
f(x) = x², g(x) = 2x on ℤ: Eq(f,g) = {0, 2} (since 0²=0, 2²=4=2·2)
Proof Sketch
-
Existence of limits in Set: Given , form . The projections are natural.
-
Universality: Any cone gives a unique map by ; the compatibility condition ensures the tuple lands in .
-
Colimits via sets and quotients: where for all morphisms in .
-
Adjunction characterization: Limits and colimits are right and left adjoints of the diagonal functor .
Connections
Limits and colimits generalize the Fundamental Theorem of ArithmeticFundamental Theorem of ArithmeticEvery integer greater than 1 has a unique prime factorizationRead more → (GCDs and LCMs are limits/colimits in the divisibility poset). The adjunction is a fundamental instance of Adjoint FunctorsAdjoint FunctorsA pair of functors L ⊣ R with a natural bijection Hom(LX, Y) ≅ Hom(X, RY)Read more →.
Lean4 Proof
import Mathlib.CategoryTheory.Limits.Types.Limits
open CategoryTheory CategoryTheory.Limits
/-- The category Type u has limits of all small diagrams.
Mathlib: `hasLimitsOfSize` instance in CategoryTheory.Limits.Types.Limits. -/
theorem type_has_limits : HasLimitsOfSize.{0, 0} (Type 0) :=
inferInstance
/-- Concretely, a limit in Type is a compatible section of the diagram. -/
example {J : Type} [SmallCategory J] (D : J ⥤ Type 0) :
HasLimit D :=
inferInstanceReferenced by
- Adjoint FunctorsCategory Theory
- Representable FunctorCategory Theory