
In mathematics, specifically category theory, a functor is a mapping between categories. 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. 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
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.
Variance of functor (composite)
- The composite of two functors of the same variance:
- The composite of two functors of opposite variance:
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 . 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
—as "contravariant" and to "covectors"—i.e., 1-forms, elements of the space of sections
of a cotangent bundle
—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 "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. See also Covariance and contravariance of vectors.
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,
.
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.
Properties
Two important consequences of the functor axioms are:
- F transforms each commutative diagram in C into a commutative diagram in D;
- if f is an isomorphism 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 G ∘ F 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: 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.
Examples
- Diagram
- 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, then the open sets in X form a partially ordered set Open(X) under inclusion. Like every partially ordered set, Open(X) forms a small category by adding a single arrow U → V if and only if
. Contravariant functors on Open(X) are called presheaves on X. For instance, by assigning to every open set U the associative algebra of real-valued continuous functions on U, one obtains a presheaf of algebras on X.
- Constant functor
- The functor C → D which maps every object of C to a fixed object X in D and every morphism in C to the identity morphism on X. Such a functor is called a constant or selection functor.
- Endofunctor
- A functor that maps a category to that same category; e.g., polynomial functor.
- Identity functor
- In category C, written 1C or idC, maps an object to itself and a morphism to itself. The identity functor is an endofunctor.
- Diagonal functor
- The diagonal functor is defined as the functor from D to the functor category DC which sends each object in D to the constant functor at that object.
- Limit functor
- For a fixed index category J, if every functor J → C has a limit (for instance if C is complete), then the limit functor CJ → C assigns to each functor its limit. The existence of this functor can be proved by realizing that it is the right-adjoint to the diagonal functor and invoking the Freyd adjoint functor theorem. This requires a suitable version of the axiom of choice. Similar remarks apply to the colimit functor (which assigns to every functor its colimit, and is covariant).
- Power sets functor
- The power set functor P : Set → Set maps each set to its power set and each function
to the map which sends
to its image
. One can also consider the contravariant power set functor which sends
to the map which sends
to its inverse image
For example, if
then
. Suppose
and
. Then
is the function which sends any subset
of
to its image
, which in this case means
, where
denotes the mapping under
, so this could also be written as
. For the other values,
Note that
consequently generates the trivial topology on
. Also note that although the function
in this example mapped to the power set of
, that need not be the case in general.
- Dual vector space
- The map which assigns to every vector space its dual space and to every linear map its dual or transpose is a contravariant functor from the category of all vector spaces over a fixed field to itself.
- Fundamental group
- Consider the category of pointed topological spaces, i.e. topological spaces with distinguished points. The objects are pairs (X, x0), where X is a topological space and x0 is a point in X. A morphism from (X, x0) to (Y, y0) is given by a continuous map f : X → Y with f(x0) = y0. To every topological space X with distinguished point x0, one can define the fundamental group based at x0, denoted π1(X, x0). This is the group of homotopy classes of loops based at x0, with the group operation of concatenation. If f : X → Y is a morphism of pointed spaces, then every loop in X with base point x0 can be composed with f to yield a loop in Y with base point y0. This operation is compatible with the homotopy equivalence relation and the composition of loops, and we get a group homomorphism from π(X, x0) to π(Y, y0). We thus obtain a functor from the category of pointed topological spaces to the category of groups. In the category of topological spaces (without distinguished point), one considers homotopy classes of generic curves, but they cannot be composed unless they share an endpoint. Thus one has the fundamental groupoid instead of the fundamental group, and this construction is functorial.
- Algebra of continuous functions
- A contravariant functor from the category of topological spaces (with continuous maps as morphisms) to the category of real associative algebras is given by assigning to every topological space X the algebra C(X) of all real-valued continuous functions on that space. Every continuous map f : X → Y induces an algebra homomorphism C(f) : C(Y) → C(X) by the rule C(f)(φ) = φ ∘ f for every φ in C(Y).
- Tangent and cotangent bundles
- The map which sends every differentiable manifold to its tangent bundle and every smooth map to its derivative is a covariant functor from the category of differentiable manifolds to the category of vector bundles. Doing this constructions pointwise gives the tangent space, a covariant functor from the category of pointed differentiable manifolds to the category of real vector spaces. Likewise, cotangent space is a contravariant functor, essentially the composition of the tangent space with the dual space above.
- Group actions/representations
- Every group G can be considered as a category with a single object whose morphisms are the elements of G. A functor from G to Set is then nothing but a group action of G on a particular set, i.e. a G-set. Likewise, a functor from G to the category of vector spaces, VectK, is a linear representation of G. In general, a functor G → C can be considered as an "action" of G on an object in the category C. If C is a group, then this action is a group homomorphism.
- Lie algebras
- Assigning to every real (complex) Lie group its real (complex) Lie algebra defines a functor.
- Tensor products
- If C denotes the category of vector spaces over a fixed field, with linear maps as morphisms, then the tensor product
defines a functor C × C → C which is covariant in both arguments.
- Forgetful functors
- The functor U : Grp → Set which maps a group to its underlying set and a group homomorphism to its underlying function of sets is a functor. Functors like these, which "forget" some structure, are termed forgetful functors. Another example is the functor Rng → Ab which maps a ring to its underlying additive abelian group. Morphisms in Rng (ring homomorphisms) become morphisms in Ab (abelian group homomorphisms).
- Free functors
- Going in the opposite direction of forgetful functors are free functors. The free functor F : Set → Grp sends every set X to the free group generated by X. Functions get mapped to group homomorphisms between free groups. Free constructions exist for many categories based on structured sets. See free object.
- Homomorphism groups
- To every pair A, B of abelian groups one can assign the abelian group Hom(A, B) consisting of all group homomorphisms from A to B. This is a functor which is contravariant in the first and covariant in the second argument, i.e. it is a functor Abop × Ab → Ab (where Ab denotes the category of abelian groups with group homomorphisms). If f : A1 → A2 and g : B1 → B2 are morphisms in Ab, then the group homomorphism Hom(f, g): Hom(A2, B1) → Hom(A1, B2) is given by φ ↦ g ∘ φ ∘ f. See Hom functor.
- Representable functors
- We can generalize the previous example to any category C. To every pair X, Y of objects in C one can assign the set Hom(X, Y) of morphisms from X to Y. This defines a functor to Set which is contravariant in the first argument and covariant in the second, i.e. it is a functor Cop × C → Set. If f : X1 → X2 and g : Y1 → Y2 are morphisms in C, then the map Hom(f, g) : Hom(X2, Y1) → Hom(X1, Y2) is given by φ ↦ g ∘ φ ∘ f. Functors like these are called representable functors. An important goal in many settings is to determine whether a given functor is representable.
Relation to other categorical concepts
Let C and D be categories. The collection of all functors from C to D forms the objects of a category: the functor category. 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.
Computer implementations
Functors sometimes appear in functional programming. 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) between existing types to functions between some new types.
See also
- Anafunctor
- Profunctor
- Functor category
- Kan extension
- Pseudofunctor
Notes
- Mac Lane, Saunders (1971), Categories for the Working Mathematician, New York: Springer-Verlag, p. 30, ISBN 978-3-540-90035-1
- Carnap, Rudolf (1937). The Logical Syntax of Language, Routledge & Kegan, pp. 13–14.
- Jacobson (2009), p. 19, def. 1.2.
- Simmons (2011), Exercise 3.1.4.
- Jacobson (2009), pp. 19–20.
- Popescu, Nicolae; Popescu, Liliana (1979). Theory of categories. Dordrecht: Springer. p. 12. ISBN 9789400995505. Retrieved 23 April 2016.
- Mac Lane, Saunders; Moerdijk, Ieke (1992), Sheaves in geometry and logic: a first introduction to topos theory, Springer, ISBN 978-0-387-97710-2
- Hazewinkel, Michiel; ; ; (2004), Algebras, rings and modules, Springer, ISBN 978-1-4020-2690-4
- Jacobson (2009), p. 20, ex. 2.
- It's not entirely clear that Haskell datatypes truly form a category. See https://wiki.haskell.org/Hask for more details.
- See https://wiki.haskell.org/Category_theory/Functor#Functors_in_Haskell for more information.
References
External links
- "Functor", Encyclopedia of Mathematics, EMS Press, 2001 [1994]
- see functor at the nLab and the variations discussed and linked to there.
- André Joyal, CatLab, a wiki project dedicated to the exposition of categorical mathematics
- Hillman, Chris (2001). "A Categorical Primer". CiteSeerX 10.1.1.24.3264. Archived from the original on 1997-05-03.
- J. Adamek, H. Herrlich, G. Stecker, Abstract and Concrete Categories-The Joy of Cats Archived 2015-04-21 at the Wayback Machine
- Stanford Encyclopedia of Philosophy: "Category Theory" — by Jean-Pierre Marquis. Extensive bibliography.
- List of academic conferences on category theory
- Baez, John, 1996,"The Tale of n-categories." An informal introduction to higher order categories.
- WildCats is a category theory package for Mathematica. Manipulation and visualization of objects, morphisms, categories, functors, natural transformations, universal properties.
- The catsters, a YouTube channel about category theory.
- Video archive of recorded talks relevant to categories, logic and the foundations of physics.
- Interactive Web page which generates examples of categorical constructions in the category of finite sets.
In mathematics specifically category theory a functor is a mapping between categories 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 The latter used functor in a linguistic context see function word DefinitionA category with objects X Y Z and morphisms f g g fFunctor F displaystyle F must preserve the composition of morphisms g displaystyle g and f displaystyle f Let C and D be categories A functor F from C to D is a mapping that associates each object X displaystyle X in C to an object F X displaystyle F X in D associates each morphism f X Y displaystyle f colon X to Y in C to a morphism F f F X F Y displaystyle F f colon F X to F Y in D such that the following two conditions hold F idX idF X displaystyle F mathrm id X mathrm id F X for every object X displaystyle X in C F g f F g F f displaystyle F g circ f F g circ F f for all morphisms f X Y displaystyle f colon X to Y and g Y Z displaystyle g colon Y to 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 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 X displaystyle X in C with an object F X displaystyle F X in D associates each morphism f X Y displaystyle f colon X to Y in C with a morphism F f F Y F X displaystyle F f colon F Y to F X in D such that the following two conditions hold F idX idF X displaystyle F mathrm id X mathrm id F X for every object X displaystyle X in C F g f F f F g displaystyle F g circ f F f circ F g for all morphisms f X Y displaystyle f colon X to Y and g Y Z displaystyle g colon Y to Z in C Variance of functor composite The composite of two functors of the same variance Covariant Covariant Covariant displaystyle mathrm Covariant circ mathrm Covariant to mathrm Covariant Contravariant Contravariant Covariant displaystyle mathrm Contravariant circ mathrm Contravariant to mathrm Covariant The composite of two functors of opposite variance Covariant Contravariant Contravariant displaystyle mathrm Covariant circ mathrm Contravariant to mathrm Contravariant Contravariant Covariant Contravariant displaystyle mathrm Contravariant circ mathrm Covariant to mathrm Contravariant 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 displaystyle C mathrm op Some authors prefer to write all expressions covariantly That is instead of saying F C D displaystyle F colon C to D is a contravariant functor they simply write F Cop D displaystyle F colon C mathrm op to D or sometimes F C Dop displaystyle F colon C to D mathrm op 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 G TM displaystyle Gamma TM of a tangent bundle TM displaystyle TM as contravariant and to covectors i e 1 forms elements of the space of sections G T M displaystyle Gamma mathord left T M right of a cotangent bundle T M displaystyle 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 Ljixj displaystyle x i Lambda j i x j for x Lx displaystyle mathbf x boldsymbol Lambda mathbf x or wi Lijwj displaystyle omega i Lambda i j omega j for w wLT displaystyle boldsymbol omega boldsymbol omega boldsymbol Lambda textsf T In this formalism it is observed that the coordinate transformation symbol Lij displaystyle Lambda i j representing the matrix LT displaystyle boldsymbol Lambda textsf T acts on the covector coordinates in the same way as on the basis vectors ei Lijej displaystyle mathbf e i Lambda i j mathbf e j whereas it acts in the opposite way on the vector coordinates but in the same way as on the basis covectors ei Ljiej displaystyle mathbf e i Lambda j i mathbf e j 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 displaystyle F colon C to D induces the opposite functor Fop Cop Dop displaystyle F mathrm op colon C mathrm op to D mathrm op where Cop displaystyle C mathrm op and Dop displaystyle D mathrm op are the opposite categories to C displaystyle C and D displaystyle D By definition Fop displaystyle F mathrm op maps objects and morphisms in the identical way as does F displaystyle F Since Cop displaystyle C mathrm op does not coincide with C displaystyle C as a category and similarly for D displaystyle D Fop displaystyle F mathrm op is distinguished from F displaystyle F For example when composing F C0 C1 displaystyle F colon C 0 to C 1 with G C1op C2 displaystyle G colon C 1 mathrm op to C 2 one should use either G Fop displaystyle G circ F mathrm op or Gop F displaystyle G mathrm op circ F Note that following the property of opposite category Fop op F displaystyle left F mathrm op right mathrm 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 PropertiesTwo important consequences of the functor axioms are F transforms each commutative diagram in C into a commutative diagram in D if f is an isomorphism 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 G F 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 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 ExamplesDiagram For categories C and J a diagram of type J in C is a covariant functor D J C displaystyle D colon J to C Category theoretical presheaf For categories C and J a J presheaf on C is a contravariant functor D C J displaystyle D colon C to J 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 then the open sets in X form a partially ordered set Open X under inclusion Like every partially ordered set Open X forms a small category by adding a single arrow U V if and only if U V displaystyle U subseteq V Contravariant functors on Open X are called presheaves on X For instance by assigning to every open set U the associative algebra of real valued continuous functions on U one obtains a presheaf of algebras on X Constant functor The functor C D which maps every object of C to a fixed object X in D and every morphism in C to the identity morphism on X Such a functor is called a constant or selection functor Endofunctor A functor that maps a category to that same category e g polynomial functor Identity functor In category C written 1C or idC maps an object to itself and a morphism to itself The identity functor is an endofunctor Diagonal functor The diagonal functor is defined as the functor from D to the functor category DC which sends each object in D to the constant functor at that object Limit functor For a fixed index category J if every functor J C has a limit for instance if C is complete then the limit functor CJ C assigns to each functor its limit The existence of this functor can be proved by realizing that it is the right adjoint to the diagonal functor and invoking the Freyd adjoint functor theorem This requires a suitable version of the axiom of choice Similar remarks apply to the colimit functor which assigns to every functor its colimit and is covariant Power sets functor The power set functor P Set Set maps each set to its power set and each function f X Y displaystyle f colon X to Y to the map which sends U P X displaystyle U in mathcal P X to its image f U P Y displaystyle f U in mathcal P Y One can also consider the contravariant power set functor which sends f X Y displaystyle f colon X to Y to the map which sends V Y displaystyle V subseteq Y to its inverse image f 1 V X displaystyle f 1 V subseteq X For example if X 0 1 displaystyle X 0 1 then F X P X 0 1 X displaystyle F X mathcal P X 0 1 X Suppose f 0 displaystyle f 0 and f 1 X displaystyle f 1 X Then F f displaystyle F f is the function which sends any subset U displaystyle U of X displaystyle X to its image f U displaystyle f U which in this case means f displaystyle mapsto f where displaystyle mapsto denotes the mapping under F f displaystyle F f so this could also be written as F f displaystyle F f For the other values 0 f 0 f 0 displaystyle 0 mapsto f 0 f 0 1 f 1 f 1 X displaystyle 1 mapsto f 1 f 1 X 0 1 f 0 1 f 0 f 1 X displaystyle 0 1 mapsto f 0 1 f 0 f 1 X Note that f 0 1 displaystyle f 0 1 consequently generates the trivial topology on X displaystyle X Also note that although the function f displaystyle f in this example mapped to the power set of X displaystyle X that need not be the case in general Dual vector space The map which assigns to every vector space its dual space and to every linear map its dual or transpose is a contravariant functor from the category of all vector spaces over a fixed field to itself Fundamental group Consider the category of pointed topological spaces i e topological spaces with distinguished points The objects are pairs X x0 where X is a topological space and x0 is a point in X A morphism from X x0 to Y y0 is given by a continuous map f X Y with f x0 y0 To every topological space X with distinguished point x0 one can define the fundamental group based at x0 denoted p1 X x0 This is the group of homotopy classes of loops based at x0 with the group operation of concatenation If f X Y is a morphism of pointed spaces then every loop in X with base point x0 can be composed with f to yield a loop in Y with base point y0 This operation is compatible with the homotopy equivalence relation and the composition of loops and we get a group homomorphism from p X x0 to p Y y0 We thus obtain a functor from the category of pointed topological spaces to the category of groups In the category of topological spaces without distinguished point one considers homotopy classes of generic curves but they cannot be composed unless they share an endpoint Thus one has the fundamental groupoid instead of the fundamental group and this construction is functorial Algebra of continuous functions A contravariant functor from the category of topological spaces with continuous maps as morphisms to the category of real associative algebras is given by assigning to every topological space X the algebra C X of all real valued continuous functions on that space Every continuous map f X Y induces an algebra homomorphism C f C Y C X by the rule C f f f f for every f in C Y Tangent and cotangent bundles The map which sends every differentiable manifold to its tangent bundle and every smooth map to its derivative is a covariant functor from the category of differentiable manifolds to the category of vector bundles Doing this constructions pointwise gives the tangent space a covariant functor from the category of pointed differentiable manifolds to the category of real vector spaces Likewise cotangent space is a contravariant functor essentially the composition of the tangent space with the dual space above Group actions representations Every group G can be considered as a category with a single object whose morphisms are the elements of G A functor from G to Set is then nothing but a group action of G on a particular set i e a G set Likewise a functor from G to the category of vector spaces VectK is a linear representation of G In general a functor G C can be considered as an action of G on an object in the category C If C is a group then this action is a group homomorphism Lie algebras Assigning to every real complex Lie group its real complex Lie algebra defines a functor Tensor products If C denotes the category of vector spaces over a fixed field with linear maps as morphisms then the tensor product V W displaystyle V otimes W defines a functor C C C which is covariant in both arguments Forgetful functors The functor U Grp Set which maps a group to its underlying set and a group homomorphism to its underlying function of sets is a functor Functors like these which forget some structure are termed forgetful functors Another example is the functor Rng Ab which maps a ring to its underlying additive abelian group Morphisms in Rng ring homomorphisms become morphisms in Ab abelian group homomorphisms Free functors Going in the opposite direction of forgetful functors are free functors The free functor F Set Grp sends every set X to the free group generated by X Functions get mapped to group homomorphisms between free groups Free constructions exist for many categories based on structured sets See free object Homomorphism groups To every pair A B of abelian groups one can assign the abelian group Hom A B consisting of all group homomorphisms from A to B This is a functor which is contravariant in the first and covariant in the second argument i e it is a functor Abop Ab Ab where Ab denotes the category of abelian groups with group homomorphisms If f A1 A2 and g B1 B2 are morphisms in Ab then the group homomorphism Hom f g Hom A2 B1 Hom A1 B2 is given by f g f f See Hom functor Representable functors We can generalize the previous example to any category C To every pair X Y of objects in C one can assign the set Hom X Y of morphisms from X to Y This defines a functor to Set which is contravariant in the first argument and covariant in the second i e it is a functor Cop C Set If f X1 X2 and g Y1 Y2 are morphisms in C then the map Hom f g Hom X2 Y1 Hom X1 Y2 is given by f g f f Functors like these are called representable functors An important goal in many settings is to determine whether a given functor is representable Relation to other categorical conceptsLet C and D be categories The collection of all functors from C to D forms the objects of a category the functor category 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 Computer implementationsFunctors sometimes appear in functional programming 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 between existing types to functions between some new types See alsoMathematics portalAnafunctor Profunctor Functor category Kan extension PseudofunctorNotesMac Lane Saunders 1971 Categories for the Working Mathematician New York Springer Verlag p 30 ISBN 978 3 540 90035 1 Carnap Rudolf 1937 The Logical Syntax of Language Routledge amp Kegan pp 13 14 Jacobson 2009 p 19 def 1 2 Simmons 2011 Exercise 3 1 4 Jacobson 2009 pp 19 20 Popescu Nicolae Popescu Liliana 1979 Theory of categories Dordrecht Springer p 12 ISBN 9789400995505 Retrieved 23 April 2016 Mac Lane Saunders Moerdijk Ieke 1992 Sheaves in geometry and logic a first introduction to topos theory Springer ISBN 978 0 387 97710 2 Hazewinkel Michiel 2004 Algebras rings and modules Springer ISBN 978 1 4020 2690 4 Jacobson 2009 p 20 ex 2 It s not entirely clear that Haskell datatypes truly form a category See https wiki haskell org Hask for more details See https wiki haskell org Category theory Functor Functors in Haskell for more information ReferencesJacobson Nathan 2009 Basic algebra vol 2 2nd ed Dover ISBN 978 0 486 47187 7 Simmons Harold 2011 Functors and natural transformations An Introduction to Category Theory pp 72 107 doi 10 1017 CBO9780511863226 004 ISBN 978 1 107 01087 1External linksLook up functor in Wiktionary the free dictionary Functor Encyclopedia of Mathematics EMS Press 2001 1994 see functor at the nLab and the variations discussed and linked to there Andre Joyal CatLab a wiki project dedicated to the exposition of categorical mathematics Hillman Chris 2001 A Categorical Primer CiteSeerX 10 1 1 24 3264 Archived from the original on 1997 05 03 J Adamek H Herrlich G Stecker Abstract and Concrete Categories The Joy of Cats Archived 2015 04 21 at the Wayback Machine Stanford Encyclopedia of Philosophy Category Theory by Jean Pierre Marquis Extensive bibliography List of academic conferences on category theory Baez John 1996 The Tale of n categories An informal introduction to higher order categories WildCats is a category theory package for Mathematica Manipulation and visualization of objects morphisms categories functors natural transformations universal properties The catsters a YouTube channel about category theory Video archive of recorded talks relevant to categories logic and the foundations of physics Interactive Web page which generates examples of categorical constructions in the category of finite sets