Functor

A map between categories that preserves identities and composition.
Functor

Let C,D\mathcal C,\mathcal D be .

Definition

A (covariant) functor F:CDF:\mathcal C\to\mathcal D consists of:

  1. an assignment on : for each ACA\in\mathcal C, an object F(A)DF(A)\in\mathcal D;
  2. an assignment on : for each morphism f:ABf:A\to B in C\mathcal C, a morphism F(f):F(A)F(B) F(f):F(A)\to F(B) in D\mathcal D;

such that the following axioms hold:

  • (identity preservation) for every object AA, F(idA)=idF(A), F(\mathrm{id}_A)=\mathrm{id}_{F(A)}, where idA\mathrm{id}_A is the ;
  • (composition preservation) for every composable pair AfBgCA\xrightarrow{f}B\xrightarrow{g}C in C\mathcal C, F(gf)=F(g)F(f), F(g\circ f)=F(g)\circ F(f), where \circ denotes in the relevant category.

Examples

  1. Forgetful functor GrpSet\mathbf{Grp}\to\mathbf{Set}:
    Send a group GG to its underlying set U(G)U(G), and a group homomorphism φ:GH\varphi:G\to H to the underlying U(φ):U(G)U(H)U(\varphi):U(G)\to U(H).
    This preserves identity maps and composition, hence is a functor.

  2. Free abelian group functor SetAb\mathbf{Set}\to\mathbf{Ab}:
    Send a set XX to the free abelian group Z[X]\mathbb Z[X] generated by XX, and a function f:XYf:X\to Y to the induced homomorphism Z[X]Z[Y]\mathbb Z[X]\to \mathbb Z[Y].
    This is a functor (and is left adjoint to the forgetful functor AbSet\mathbf{Ab}\to\mathbf{Set}; see ).

  3. Representable hom-functor: Fix an object ACA\in\mathcal C.
    The assignment XHomC(A,X)X\mapsto \mathrm{Hom}_{\mathcal C}(A,X) defines a functor CSet\mathcal C\to\mathbf{Set}, called a (covariant in XX).
    Dually, XHomC(X,A)X\mapsto \mathrm{Hom}_{\mathcal C}(X,A) is a functor CopSet\mathcal C^{\mathrm{op}}\to\mathbf{Set}.