 in mathematics, a functor is a type of mapping between categories, which is applied in category theory. functors can be thought of as homomorphisms between categories. in the category of small categories, functors can be thought of more generally as morphisms. functors were first considered in algebraic topology, where algebraic objects (like the fundamental group) are associated to topological spaces, and algebraic homomorphisms are associated to continuous maps. nowadays, functors are used throughout modern mathematics to relate various categories. thus, functors are generally applicable in areas within mathematics that category theory can make an abstraction of. the word functor was borrowed by mathematicians from the philosopher rudolf carnap, who used the term in a linguistic context:carnap, the logical syntax of language, p. 13â14, 1937, routledge & kegan paul see function word. ==definition== let c and d be categories. a functor f from c to d is a mapping thatjacobson (2009), p. 19, def. 1.2. * associates to each object x \in c an object f(x) \in d, * associates to each morphism f:x\rightarrow y \in c a morphism f(f):f(x) \rightarrow f(y) \in d such that the following two conditions hold: ** f(\mathrm{id}_{x}) = \mathrm{id}_{f(x)}\,\! for every object x \in c ** f(g \circ f) = f(g) \circ f(f) for all morphisms f:x \rightarrow y\,\! and g:y\rightarrow z.\,\! 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 to each object x \in c an object f(x) \in d, *associates to each morphism f:x\rightarrow y \in c a morphism f(f):f(y) \rightarrow f(x) \in d such that **f(\mathrm{id}_x) = \mathrm{id}_{f(x)}\,\! for every object x \in c, **f(g \circ f) = f(f) \circ f(g) for all morphisms f:x\rightarrow y\,\! and g:y\rightarrow z.\,\! 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 c^\mathrm{op}.jacobson (2009), p. 19â20. some authors prefer to write all expressions covariantly. that is, instead of saying f: c\rightarrow d is a c
Functors