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

A contravariant functor F:CDF:\mathcal C\to\mathcal D consists of:

  • an assignment on XF(X)X\mapsto F(X),
  • for every f:XYf:X\to Y in C\mathcal C, a morphism
    F(f):F(Y)F(X)F(f):F(Y)\to F(X)
    in D\mathcal D,

such that:

  1. (Identities) F(idX)=idF(X)F(\mathrm{id}_X)=\mathrm{id}_{F(X)} for every XX (see ),
  2. (Reversed composition) for composable XfYgZX\xrightarrow{f}Y\xrightarrow{g}Z,
    F(gf)=F(f)F(g)F(g\circ f)=F(f)\circ F(g)
    (see ).
Equivalent characterizations

Equivalently, a contravariant functor F:CDF:\mathcal C\to\mathcal D is the same thing as an ordinary (covariant)

CopD,\mathcal C^{\mathrm{op}}\longrightarrow \mathcal D,

where Cop\mathcal C^{\mathrm{op}} is the of C\mathcal C.

Examples
  1. Inverse-image on power sets (Set). Let Set\mathbf{Set} be the category of and . Define F:SetopSetF:\mathbf{Set}^{\mathrm{op}}\to \mathbf{Set} by
  • F(X)=P(X)F(X)=\mathcal P(X) (the set of subsets of XX),
  • for f:XYf:X\to Y, F(f)=f1:P(Y)P(X)F(f)=f^{-1}:\mathcal P(Y)\to\mathcal P(X), the map. Then f1(id)=idf^{-1}(\mathrm{id})=\mathrm{id} and (gf)1=f1g1(g\circ f)^{-1}=f^{-1}\circ g^{-1}, so this is contravariant.
  1. Representable hom-functor HomC(,A)\mathrm{Hom}_{\mathcal C}(-,A). Fix an object ACA\in\mathcal C. The assignment
    XHomC(X,A)X\longmapsto \mathrm{Hom}_{\mathcal C}(X,A)
    extends to a contravariant functor CSet\mathcal C\to\mathbf{Set} (equivalently CopSet\mathcal C^{\mathrm{op}}\to\mathbf{Set}) by sending f:XYf:X\to Y to precomposition:
    HomC(Y,A)HomC(X,A),(h:YA)hf.\mathrm{Hom}_{\mathcal C}(Y,A)\to \mathrm{Hom}_{\mathcal C}(X,A),\quad (h:Y\to A)\mapsto h\circ f.
    This is a basic instance of a .
  1. Linear dual (Vectk_k or RR-Mod). In the category of vector spaces over a field kk (or modules over a ring), define
    VV=Homk(V,k).V\mapsto V^\ast=\mathrm{Hom}_k(V,k).
    A linear map f:VWf:V\to W induces f:WVf^\ast:W^\ast\to V^\ast by f(φ)=φff^\ast(\varphi)=\varphi\circ f. The direction reverses, and (gf)=fg(g\circ f)^\ast=f^\ast\circ g^\ast, so ()(-)^\ast is contravariant.