Lably
Skip to content

Functor

Mapping between categories

  • 10 min read
  • 5 chapters

Related on Lably

Through Mathematics, Category (mathematics) and Continuous function

The words category and functor were borrowed by mathematicians from the philosophers Aristotle and Rudolf Carnap, respectively. The latter used functor in a linguistic context; see function word.

Definition

Let C and D be categories. A functor F from C to D is a mapping that:

  • associates each object X in C to an object F(X) in D,
  • associates each morphism f:X→Y in C to a morphism F(f):F(X)→F(Y) in D such that the following two conditions hold:
    • F(idX)=idF(X) for every object X in C,
    • F(g∘f)=F(g)∘F(f) for all morphisms f:X→Y and g:Y→Z in C.

That is, functors must preserve identity morphisms and composition of morphisms.

Covariance and contravariance

There are many constructions in mathematics that would be functors, except that they "turn morphisms around" and "reverse composition". We then define a contravariant functor F from C to D as a mapping that

  • associates each object X in C with an object F(X) in D,
  • associates each morphism f:X→Y in C with a morphism F(f):F(Y)→F(X) in D such that the following two conditions hold:
    • F(idX)=idF(X) for every object X in C,
    • F(g∘f)=F(f)∘F(g) for all morphisms f:X→Y and g:Y→Z in C.

Variance of functors (composite):

  • The composite of two functors of the same variance:
    • Covariant∘Covariant→Covariant
    • Contravariant∘Contravariant→Covariant
  • The composite of two functors of opposite variance:
    • Covariant∘Contravariant→Contravariant
    • Contravariant∘Covariant→Contravariant

We see that ({Covariant,Contravariant},∘)≅Z/2Z.

Note that contravariant functors reverse the direction of composition.

Ordinary functors are also called covariant functors in order to distinguish them from contravariant ones. Note that one can also define a contravariant functor as a covariant functor on the opposite category Cop. Some authors prefer to write all expressions covariantly. That is, instead of saying F:C→D is a contravariant functor, they simply write F:Cop→D (or sometimes F:C→Dop) and call it a functor.

Contravariant functors are also occasionally called cofunctors.

There is a convention which refers to "vectors"—i.e., vector fields, elements of the space of sections Γ(TM) of a tangent bundle TM—as "contravariant" and to "covectors"—i.e., 1-forms, elements of the space of sections Γ(T∗M) of a cotangent bundle T∗M—as "covariant". This terminology originates in physics, and its rationale has to do with the position of the indices ("upstairs" and "downstairs") in expressions such as x′i=Λjixj for x′=Λx, or ωi′=Λijωj for ω′=ωΛT. In this formalism it is observed that the coordinate transformation symbol Λij (representing the matrix ΛT) acts on the "covector coordinates" "in the same way" as on the basis vectors: ei=Λijej—whereas it acts "in the opposite way" on the "vector coordinates" (but "in the same way" as on the basis covectors: ei=Λjiej). This terminology is contrary to the one used in category theory because it is the covectors that have pullbacks in general and are thus contravariant, whereas vectors in general are covariant since they can be pushed forward. See also covariance and contravariance of vectors.

Opposite functor

Every functor F:C→D induces the opposite functor Fop:Cop→Dop, where Cop and Dop are the opposite categories to C and D.

By definition, Fop maps objects and morphisms in the identical way as does F. Since Cop does not coincide with C as a category, and similarly for D, Fop is distinguished from F. For example, when composing F:C0→C1 with G:C1op→C2, one should use either G∘Fop or Gop∘F. Note that (Fop)op=F.

Bifunctors and multifunctors

A bifunctor (also known as a binary functor) is a functor whose domain is a product category. For example, the Hom functor is of the type Cop×C→Set. It can be seen as a functor in two arguments; it is contravariant in one argument, covariant in the other.

A multifunctor is a generalization of the functor concept to n variables. So, for example, a bifunctor is a multifunctor with n=2.

Sign in to keep reading

4 more chapters are free with a Lably account.

More in Foundations