Category Theory - Functors

Functors

Functors are structure-preserving maps between categories. They can be thought of as morphisms in the category of all (small) categories.

A (covariant) functor F from a category C to a category D, written F : CD, consists of:

  • for each object x in C, an object F(x) in D; and
  • for each morphism f : xy in C, a morphism F(f) : F(x) → F(y),

such that the following two properties hold:

  • For every object x in C, F(1x) = 1F(x);
  • For all morphisms f : xy and g : yz, F(gf) = F(g) ∘ F(f).

A contravariant functor F: CD, is like a covariant functor, except that it "turns morphisms around" ("reverses all the arrows"). More specifically, every morphism f : xy in C must be assigned to a morphism F(f) : F(y) → F(x) in D. In other words, a contravariant functor acts as a covariant functor from the opposite category Cop to D.

Read more about this topic:  Category Theory