Adjoint Functors

lean4-proofcategory-theoryvisualization
Hom(LX,Y)Hom(X,RY)\mathrm{Hom}(LX, Y) \cong \mathrm{Hom}(X, RY)

Statement

Functors L:CDL : \mathcal{C} \to \mathcal{D} and R:DCR : \mathcal{D} \to \mathcal{C} are adjoint (LRL \dashv R) if there is a natural bijection:

HomD(LX,Y)    HomC(X,RY)\mathrm{Hom}_{\mathcal{D}}(LX, Y) \;\cong\; \mathrm{Hom}_{\mathcal{C}}(X, RY)

natural in both XCX \in \mathcal{C} and YDY \in \mathcal{D}. Equivalently, there exist natural transformations η:IdCRL\eta : \mathrm{Id}_{\mathcal{C}} \Rightarrow R \circ L (unit) and ε:LRIdD\varepsilon : L \circ R \Rightarrow \mathrm{Id}_{\mathcal{D}} (counit) satisfying the triangle identities:

(εL)(Lη)=idL(Rε)(ηR)=idR(\varepsilon L) \circ (L \eta) = \mathrm{id}_L \qquad (R \varepsilon) \circ (\eta R) = \mathrm{id}_R

Visualization

Free monoid \dashv underlying set in Mon\mathbf{Mon} vs Set\mathbf{Set}:

  L = FreeMonoid : Set ─────▶ Mon     (L(S) = S* = finite words over S)
  R = forget     : Mon ─────▶ Set     (R(M) = underlying set of M)

  Natural bijection for S = {a,b}, M = (ℤ, +):
  ┌─────────────────────────────────────────────────────────┐
  │ MonHom(FreeMonoid{a,b},  (ℤ,+)) ≅ SetMap({a,b}, ℤ)   │
  │                                                         │
  │  f ↦ (a↦3, b↦-1)  ←→  a↦3, b↦-1                      │
  │  f(ab) = 3 + (-1) = 2                                   │
  │  f(aab) = 3+3+(-1) = 5                                  │
  │                                                         │
  │  Unit η_S : S ──▶ R(L(S)) = S*:   s ↦ [s]  (singleton) │
  │  Counit ε_M : L(R(M)) = M* ──▶ M:  [m1,m2] ↦ m1·m2   │
  └─────────────────────────────────────────────────────────┘

  Triangle identity check:
    ε_{LS} ∘ L(η_S) : LS ─▶ L(R(L(S))) ─▶ LS
    [w] ──▶ <a class="concept-link" data-concept="w">w</a> ──▶ [w]   ✓  (flatten-of-singleton = identity)

Proof Sketch

  1. From hom-set bijection to unit/counit: The unit ηX\eta_X is the image of idLX\mathrm{id}_{LX} under the bijection Hom(LX,LX)Hom(X,RLX)\mathrm{Hom}(LX, LX) \cong \mathrm{Hom}(X, RLX). The counit εY\varepsilon_Y is the preimage of idRY\mathrm{id}_{RY} under Hom(LRY,Y)Hom(RY,RY)\mathrm{Hom}(LRY, Y) \cong \mathrm{Hom}(RY, RY).

  2. Triangle identities: The first triangle (εL)(Lη)=idL(\varepsilon L)(L\eta) = \mathrm{id}_L follows because both sides correspond to idLX\mathrm{id}_{LX} under the bijection (by naturality in YY). The second is symmetric.

  3. From unit/counit to bijection: Given f:LXYf : LX \to Y, map to RfηX:XRYRf \circ \eta_X : X \to RY. Given g:XRYg : X \to RY, map to εYLg:LXY\varepsilon_Y \circ Lg : LX \to Y. The triangle identities ensure these are inverse.

  4. Uniqueness: An adjoint functor RR is unique up to natural isomorphism once LL is fixed (and vice versa), by the Yoneda lemma.

Connections

Adjoint functors generalize Galois connections and appear in every corner of mathematics. The hom-set bijection is a manifestation of the Yoneda LemmaYoneda LemmaNat(Hom(X,),F)F(X)\mathrm{Nat}(\mathrm{Hom}(X,-),\, F) \cong F(X)Natural transformations from a representable functor y_X to F biject with elements of F(X)Read more →. Limits and colimits are characterized by adjunctions — see Limits and ColimitsLimits and ColimitslimDΔlimD\varprojlim D \dashv \Delta \dashv \varinjlim DUniversal cones over diagrams: limits generalize products and equalizers; colimits generalize coproducts and coequalizersRead more →.

Lean4 Proof

import Mathlib.CategoryTheory.Adjunction.Basic

open CategoryTheory

/-- The hom-set bijection for an adjunction L ⊣ R.
    Mathlib provides this as `Adjunction.homEquiv`.
    Note: `(L.obj X ⟶ Y) ≃ (X ⟶ R.obj Y)` is a Type (Equiv), not a Prop,
    so we use `def` instead of `theorem`. -/
def adjunction_hom_equiv {C D : Type*} [Category C] [Category D]
    {L : CD} {R : DC} (adj : LR) (X : C) (Y : D) :
    (L.obj XY) ≃ (XR.obj Y) :=
  adj.homEquiv X Y

/-- Unit of the adjunction: id_C ⟹ R ∘ L. -/
theorem adjunction_unit_naturality {C D : Type*} [Category C] [Category D]
    {L : CD} {R : DC} (adj : LR) (X : C) :
    adj.homEquiv X (L.obj X) (𝟙 (L.obj X)) = adj.unit.app X :=
  adj.homEquiv_id X