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

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

  • an assignment on X↦F(X)X\mapsto F(X),
  • for every f:X→Yf: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 X→fY→gZX\xrightarrow{f}Y\xrightarrow{g}Z,
    F(g∘f)=F(f)∘F(g)F(g\circ f)=F(f)\circ F(g)
    (see ).
Equivalent characterizations

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

Cop⟶D,\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:Setop→SetF:\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:X→Yf:X\to Y, F(f)=f−1:P(Y)→P(X)F(f)=f^{-1}:\mathcal P(Y)\to\mathcal P(X), the map. Then (idX)−1=idP(X)(\mathrm{id}_X)^{-1}=\mathrm{id}_{\mathcal P(X)} and (g∘f)−1=f−1∘g−1(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 A∈CA\in\mathcal C. The assignment
    X⟼HomC(X,A)X\longmapsto \mathrm{Hom}_{\mathcal C}(X,A)
    extends to a contravariant functor C→Set\mathcal C\to\mathbf{Set} (equivalently Cop→Set\mathcal C^{\mathrm{op}}\to\mathbf{Set}) by sending f:X→Yf:X\to Y to precomposition:
    HomC(Y,A)→HomC(X,A),(h:Y→A)↦h∘f.\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
    V↦V∗=Homk(V,k).V\mapsto V^\ast=\mathrm{Hom}_k(V,k).
    A linear map f:V→Wf:V\to W induces f∗:W∗→V∗f^\ast:W^\ast\to V^\ast by f∗(φ)=φ∘ff^\ast(\varphi)=\varphi\circ f. The direction reverses, and (g∘f)∗=f∗∘g∗(g\circ f)^\ast=f^\ast\circ g^\ast, so (−)∗(-)^\ast is contravariant.