# Contravariant functors

## Idea

A contravariant functor is like a functor but it reverses the directions of the morphisms. (Between groupoids, contravariant functors are essentially the same as functors.)

## Between categories

A contravariant functor $F$ from a category $C$ to a category $D$ is simply a functor from the opposite category $C^op$ to $D$.

To emphasize that one means a functor $C \to D$ as stated and not as a functor $C^{op} \to D$ one sometimes says covariant functor for non-contravariant, for emphasis.

Equivalently, a contravariant functor from $C$ to $D$ may be thought of as a functor from $C$ to $D^op$, but the version above generalises better to functors of many variables.

Also notice that while the objects of the functor category $[C^{op}, D]$ are in canonical bijection with those in the functor category $[C, D^{op}]$ (both are contravariant functors from $C$ to $D$), the morphisms in the two functor categories are in general different, as

$[C^{op}, D] \simeq [C, D^{op}]^{op} \,.$

This matters when discussing a natural transformation from one contravariant functor to another.

## In a graded $2$-category

The above definition of contravariant functors as covariant functors out of (or into) the opposite category is unsatisfactory if one wishes to consider natural transformations between functors of different variance. In particular, it seems to break the $2$-categorical structure since with the above definition covariant and contravariant functors now live as objects in different categories $[C,D]$ and $[C^{op},D]$ inside the $2$-category Cat of categories and covariant functors, hence whatever natural transformations between functors of different variance are, it is not $2$-morphisms in Cat.

The correct thing to do is to define the $\mathbb{Z}/2$-graded $2$-category? of categories, functors, and natural transformations.

1. The objects of our $2$-category will be categories.

2. The $1$-morphisms of our $2$-category will be all functors, covariant and contravariant alike. The grading (on the $1$-categorical part at least) is then a functor to \mathbb Z/2 considered as one-object category, given by considering contravariant functors to be odd ($\mathbb Z1\bmod 2$) and covariant functors to be even $0\bmod 2$. Composition of functors is then additive on the grading (as it should be).

3. The $2$-morphisms $F\stackrel{\alpha}{\Rightarrow}G\colon C\to D$ will be once again $\ob(C)$-indexed families of morphisms $FX\stackrel{\alpha_X}{\to} GX$, but the commutative diagram they will have to satisfy for each $X\stackrel{f} Y$ in $C$ depends on the combination of variances of $F$ and $G$:

$\array{ FX&\stackrel{Ff}{\rightarrow}&FY&&FX&\stackrel{Ff}{\rightarrow}&FY&&FX&\stackrel{Ff}{\leftarrow}&FY&&FX&\stackrel{Ff}{\leftarrow}&FY \\\alpha_X\downarrow&&\alpha_Y\downarrow&& \alpha_X\downarrow&&\alpha_Y\downarrow&& \alpha_X\downarrow&&\alpha_Y\downarrow&& \alpha_X\downarrow&&\alpha_Y\downarrow \\GX&\stackrel{Gf}{\rightarrow}&GY&&GX&\stackrel{Gf}{\leftarrow}&GY&&GX&\stackrel{Gf}{\rightarrow}&GY&&GX&\stackrel{Gf}{\leftarrow}&GY }$

It is clear that (vertical) composition of $2$-morphisms makes sense, and that furthermore natural transformations between functors of different variance should be graded odd, while natural transformation between functors of the same variance should be graded even.

4. It is less clear that (but true!) that horizontal composition and whiskering also make sense. We thus have almost a (strict) $2$-category, if it were not for the fact that the actions of whiskering by an odd functor act contravariantly on vertical composition (so horizontal composition itself does not behave as usual), so perhaps this is a slightly more general notion of a $2$-category.

What kind of notion of $2$-category is this? I’ve been using the phrase $\mathbb{Z}/2$-graded $2$-category, but this structure is not exactly a $2$-category because of the allowed contravariance in the whiskering/horiztonal composition. –Vladimir_Sotirov

In this context, the structure of the $\cdot^{op}$ operation becomes interesting: it is an involutive $2$-functor that preserves grading, but reverses $2$-morphisms, and furthermore comes equipped with natural isomorphisms $[-^{op},-]\cong[-,-]^{op}\cong[-,-^{op}]$ (this doesn’t make complete sense as we have not discussed yet how our new $2$-category is enriched in itself, so the meaning of $[-,-]^{op}$ is not completely clear…).

## Between $2$-categories

As mentioned in opposite 2-category, a $2$-category can have three different duals, depending on whether we formally flip only the $1$-morphisms, only the $2$-morphisms, or both. From the perspective in this article, however, it is better to say that $2$-functors have three different kinds of contravariance (hence there are four kinds of $2$-functors). Consequently, there should be two $\mathbb{Z}/2\times\mathbb{Z}/2$-graded $2$-categories (or maybe slightly more general structures since again how horizontal composition distributes over vertical composition will depend on the associated variances:

1. A $\mathbb{Z}/2\times\mathbb{Z}/2$-graded $2$-category of $2$-categories, $2$-functors of arbitrary variance, and lax natural transformations. Instead of giving each commutativity condition for the sixteen kinds of lax natural transformations, let us write down the one that a category of V-enriched categories comes equipped with: a lax natural transformation $F\stackrel{\alpha}\Rightarrow G\colon$C$\to$D, where $F$ is a $2$-functor flipping $2$-morphisms, and $G$ is $2$-functor flipping $1$-morphisms, consists of an $\ob(\mathbf{C})$-indexed family of $1$-morphisms $FX\stackrel{\alpha_X}{\to} GX$ in D, and for each two objects $X,Y$ of C, an $\ob[X,Y]$-indexed family of $2$-morphisms $\alpha_f$, so that for every $2$-morphism $f\stackrel{\gamma}{\Rightarrow} g$, we have the commutative diagram of $2$-moprhisms in D:

$\array{ &&FX&\stackrel{Ff}{\rightarrow}&FY\\ &&\alpha_X\downarrow&\stackrel{\alpha_f}{\Rightarrow}&\downarrow\alpha_Y&&FX\\ &&GX&\stackrel{Gf}{\leftarrow}&GY&&\downarrow Ff\\ FX&\stackrel{id}{\neArrow}&&&& \stackrel{G\gamma.(\alpha_Y\circ Ff)}{\seArrow}&FY\\ \alpha_X\downarrow&&&&&&\downarrow\alpha_Y\\ FY&\stackrel{id}{\seArrow}&&&&\stackrel{(Gg\circ\alpha_Y).F\gamma}{\neArrow}&GY\\ &&FX&\stackrel{Fg}{\rightarrow}&FY&&\downarrow Gg\\ &&\alpha_X\downarrow&\stackrel{\alpha_g}{\Rightarrow}&\downarrow\alpha_Y&&GX\\ &&GX&\stackrel{Gg}{\leftarrow}&GY }$

where . is whiskering/horizontal composition. Furthermore, given composable $1$-morphisms $X\stackrel{f}{\rightarrow}Y\stackrel{h}{\rightarrow} Z$, the $2$-moprhisms $\alpha_X\stackrel{\alpha_f}{\Rightarrow}Gf\circ\alpha_Y\circ Ff$ and $\alpha_Y\stackrel{\alpha_h}{\Rightarrow}Gh\circ\alpha_Z\circ Fh$ are related via the formula $\alpha_{h\circ f}=(Gf.\alpha_h.Ff)\circ\alpha_f$, which says that the pasting diagram of $2$-morphisms:

$\array{ FX&\stackrel{Ff}{\rightarrow}&FY&\stackrel{Fh}{\rightarrow}&FZ\\ \alpha_X\downarrow&\stackrel{\alpha_f}{\Rightarrow}&\downarrow\alpha_Y&\stackrel{\alpha_h}{\Rightarrow}&\downarrow\alpha_Z\\ GX&\stackrel{Gf}{\leftarrow}&GY&\stackrel{Gh}{\leftarrow}&GZ }$

reduces to

$\array{ FX&\stackrel{Fh\circ Ff}{\rightarrow}&FZ\\ \alpha_X\downarrow&\stackrel{\alpha_{h\circ f}}{\Rightarrow}&\downarrow\alpha_Z\\ GX&\stackrel{Gh\circ Gf}{\leftarrow}&GZ }$
2. A $\mathbb{Z}/2\times\mathbb{Z}/2$-graded $2$-category of $2$-categories, $2$-functors of arbitrary variance, and oplax natural transformations.

Somewhat mysteriously, the category of V-enriched categories is a $2$-category which comes with a unit enriched category $\mathcal{I}$ and either a lax natural transformation $[\mathcal{I},-]^{op}\Rightarrow[[\mathcal{I},-],V_0]$ (in the case of $\mathcal{V}$ a monoidal structure on $V$), or a lax natural transformation $[\mathcal{I},-]^{op}\Rightarrow[-,V^e]$ (in the case of $\mathcal{V}$ a closed structure on $[\mathcal{I},V^e]\cong V_0$).

Revised on April 28, 2014 09:48:41 by Toby Bartels (64.89.53.201)