In
mathematics, specifically
category theory, a functor is a
mapping between
categories. Functors were first considered in
algebraic topology
Algebraic topology is a branch of mathematics that uses tools from abstract algebra to study topological spaces. The basic goal is to find algebraic invariants that classify topological spaces up to homeomorphism, though usually most classif ...
, where algebraic objects (such as the
fundamental group
In the mathematical field of algebraic topology, the fundamental group of a topological space is the group of the equivalence classes under homotopy of the loops contained in the space. It records information about the basic shape, or holes, of ...
) are associated to
topological space
In mathematics, a topological space is, roughly speaking, a geometrical space in which closeness is defined but cannot necessarily be measured by a numeric distance. More specifically, a topological space is a set whose elements are called po ...
s, 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
Aristotle (; grc-gre, Ἀριστοτέλης ''Aristotélēs'', ; 384–322 BC) was a Greek philosopher and polymath during the Classical Greece, Classical period in Ancient Greece. Taught by Plato, he was the founder of the Peripatet ...
and
Rudolf Carnap
Rudolf Carnap (; ; 18 May 1891 – 14 September 1970) was a German-language philosopher who was active in Europe before 1935 and in the United States thereafter. He was a major member of the Vienna Circle and an advocate of logical positivism. ...
, respectively. The latter used ''functor'' in a
linguistic
Linguistics is the scientific study of human language. It is called a scientific study because it entails a comprehensive, systematic, objective, and precise analysis of all aspects of language, particularly its nature and structure. Linguis ...
context;
see
function word
In linguistics, function words (also called functors) are words that have little lexical meaning or have ambiguous meaning and express grammatical relationships among other words within a sentence, or specify the attitude or mood of the speaker ...
.
Definition

Let ''C'' and ''D'' be
categories. A functor ''F'' from ''C'' to ''D'' is a mapping that
* associates each object
in ''C'' to an object
in ''D'',
* associates each morphism
in ''C'' to a morphism
in ''D'' such that the following two conditions hold:
**
for every object
in ''C'',
**
for all morphisms
and
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 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
*associates each object
in ''C'' with an object
in ''D'',
*associates each morphism
in ''C'' with a morphism
in ''D'' such that the following two conditions hold:
**
for every object
in ''C'',
**
for all morphisms
and
in ''C''.
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
In category theory, a branch of mathematics, the opposite category or dual category ''C''op of a given category ''C'' is formed by reversing the morphisms, i.e. interchanging the source and target of each morphism. Doing the reversal twice yield ...
. Some authors prefer to write all expressions covariantly. That is, instead of saying
is a contravariant functor, they simply write
(or sometimes
) 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
of a
tangent bundle
In differential geometry, the tangent bundle of a differentiable manifold M is a manifold TM which assembles all the tangent vectors in M . As a set, it is given by the disjoint unionThe disjoint union ensures that for any two points and ...
—as "contravariant" and to "covectors"—i.e.,
1-forms
In differential geometry, a one-form on a differentiable manifold is a smooth section of the cotangent bundle. Equivalently, a one-form on a manifold M is a smooth mapping of the total space of the tangent bundle of M to \R whose restriction to eac ...
, elements of the space of sections
of a
cotangent bundle
In mathematics, especially differential geometry, the cotangent bundle of a smooth manifold is the vector bundle of all the cotangent spaces at every point in the manifold. It may be described also as the dual bundle to the tangent bundle. This ...
—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
for
or
for
In this formalism it is observed that the coordinate transformation symbol
(representing the matrix
) acts on the basis vectors "in the same way" as on the "covector coordinates":
—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''. See also
Covariance and contravariance of vectors
In physics, especially in multilinear algebra and tensor analysis, covariance and contravariance describe how the quantitative description of certain geometric or physical entities changes with a change of basis. In modern mathematical notat ...
.
Opposite functor
Every functor
induces the opposite functor
, where
and
are the
opposite categories to
and
. By definition,
maps objects and morphisms in the identical way as does
. Since
does not coincide with
as a category, and similarly for
,
is distinguished from
. For example, when composing
with
, one should use either
or
. Note that, following the property of
opposite category
In category theory, a branch of mathematics, the opposite category or dual category ''C''op of a given category ''C'' is formed by reversing the morphisms, i.e. interchanging the source and target of each morphism. Doing the reversal twice yield ...
,
.
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
In mathematics, specifically in category theory, hom-sets (i.e. sets of morphisms between objects) give rise to important functors to the category of sets. These functors are called hom-functors and have numerous applications in category theory ...
is of the type . It can be seen as a functor in ''two'' arguments. The
Hom functor
In mathematics, specifically in category theory, hom-sets (i.e. sets of morphisms between objects) give rise to important functors to the category of sets. These functors are called hom-functors and have numerous applications in category theory ...
is a natural example; 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 .
Properties
Two important consequences of the functor
axiom
An axiom, postulate, or assumption is a statement that is taken to be true, to serve as a premise or starting point for further reasoning and arguments. The word comes from the Ancient Greek word (), meaning 'that which is thought worthy o ...
s are:
* ''F'' transforms each
commutative diagram
350px, The commutative diagram used in the proof of the five lemma.
In mathematics, and especially in category theory, a commutative diagram is a diagram such that all directed paths in the diagram with the same start and endpoints lead to the ...
in ''C'' into a commutative diagram in ''D'';
* if ''f'' is an
isomorphism
In mathematics, an isomorphism is a structure-preserving mapping between two structures of the same type that can be reversed by an inverse mapping. Two mathematical structures are isomorphic if an isomorphism exists between them. The word i ...
in ''C'', then ''F''(''f'') is an isomorphism in ''D''.
One can compose functors, i.e. if ''F'' is a functor from ''A'' to ''B'' and ''G'' is a functor from ''B'' to ''C'' then one can form the composite functor from ''A'' to ''C''. Composition of functors is associative where defined. Identity of composition of functors is the identity functor. This shows that functors can be considered as morphisms in categories of categories, for example in the
category of small categories.
A small category with a single object is the same thing as a
monoid
In abstract algebra, a branch of mathematics, a monoid is a set equipped with an associative binary operation and an identity element. For example, the nonnegative integers with addition form a monoid, the identity element being 0.
Monoids ...
: 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
homomorphism
In algebra, a homomorphism is a structure-preserving map between two algebraic structures of the same type (such as two groups, two rings, or two vector spaces). The word ''homomorphism'' comes from the Ancient Greek language: () meaning "sa ...
s. So in a sense, functors between arbitrary categories are a kind of generalization of monoid homomorphisms to categories with more than one object.
Examples
;
Diagram
A diagram is a symbolic representation of information using visualization techniques. Diagrams have been used since prehistoric times on walls of caves, but became more prevalent during the Enlightenment. Sometimes, the technique uses a three ...
: For categories ''C'' and ''J'', a diagram of type ''J'' in ''C'' is a covariant functor
.
;
(Category theoretical) presheaf:For categories ''C'' and ''J'', a ''J''-presheaf on ''C'' is a contravariant functor
.In the special case when J is Set, the category of sets and functions, ''D'' is called a
presheaf on ''C''.
; Presheaves (over a topological space): If ''X'' is a
topological space
In mathematics, a topological space is, roughly speaking, a geometrical space in which closeness is defined but cannot necessarily be measured by a numeric distance. More specifically, a topological space is a set whose elements are called po ...
, then the
open set
In mathematics, open sets are a generalization of open intervals in the real line.
In a metric space (a set along with a distance defined between any two points), open sets are the sets that, with every point , contain all points that a ...
s in ''X'' form a
partially ordered set
In mathematics, especially order theory, a partially ordered set (also poset) formalizes and generalizes the intuitive concept of an ordering, sequencing, or arrangement of the elements of a set. A poset consists of a set together with a binar ...
Open(''X'') under inclusion. Like every partially ordered set, Open(''X'') forms a small category by adding a single arrow if and only if
. Contravariant functors on Open(''X'') are called ''
presheaves
In mathematics, a sheaf is a tool for systematically tracking data (such as sets, abelian groups, rings) attached to the open sets of a topological space and defined locally with regard to them. For example, for each open set, the data could ...
'' on ''X''. For instance, by assigning to every open set ''U'' the