Functor

Functors were first considered in algebraic topology, where algebraic objects (such as the fundamental group) are associated to topological spaces, and maps between these algebraic objects are associated to continuous maps between spaces.

Nowadays, functors are used throughout modern mathematics to relate various categories.

Thus, functors are important in all areas within mathematics to which category theory is applied.

The words category and functor were borrowed by mathematicians from the philosophers Aristotle and Rudolf Carnap, respectively.

[1] The latter used functor in a linguistic context;[2] see function word.

A functor F from C to D is a mapping that[3] That is, functors must preserve identity morphisms and composition of morphisms.

There are many constructions in mathematics that would be functors but for the fact that they "turn morphisms around" and "reverse composition".

We then define a contravariant functor F from C to D as a mapping that Variance of functor (composite)[4] Note that contravariant functors reverse the direction of composition.

[5] Some authors prefer to write all expressions covariantly.

is a contravariant functor, they simply write

Contravariant functors are also occasionally called cofunctors.

[6] There is a convention which refers to "vectors"—i.e., vector fields, elements of the space of sections

—as "contravariant" and to "covectors"—i.e., 1-forms, elements of the space of sections

This terminology originates in physics, and its rationale has to do with the position of the indices ("upstairs" and "downstairs") in expressions such as

In this formalism it is observed that the coordinate transformation symbol

) acts on the "covector coordinates" "in the same way" as on the basis vectors:

—whereas it acts "in the opposite way" on the "vector coordinates" (but "in the same way" as on the basis covectors:

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.

maps objects and morphisms in the identical way as does

Note that, following the property of opposite category,

For example, the Hom functor is of the type Cop × C → Set.

A multifunctor is a generalization of the functor concept to n variables.

A small category with a single object is the same thing as a monoid: the morphisms of a one-object category can be thought of as elements of the monoid, and composition in the category is thought of as the monoid operation.

Functors between one-object categories correspond to monoid homomorphisms.

So in a sense, functors between arbitrary categories are a kind of generalization of monoid homomorphisms to categories with more than one object.

Morphisms in this category are natural transformations between functors.

Functors are often defined by universal properties; examples are the tensor product, the direct sum and direct product of groups or vector spaces, construction of free groups and modules, direct and inverse limits.

The concepts of limit and colimit generalize several of the above.

Universal constructions often give rise to pairs of adjoint functors.

For instance, the programming language Haskell has a class Functor where fmap is a polytypic function used to map functions (morphisms on Hask, the category of Haskell types)[10] between existing types to functions between some new types.

A category with objects X, Y, Z and morphisms f, g, g ∘ f
Functor must preserve the composition of morphisms and