There are many examples in mathematics where from one object
one can construct another kind of object
. For example,
with a Boolean algebra there is associated a topological space
(its prime ideal space), and with a topological space there is associated
its homology group. These constructions extend to maps between the
objects and have reasonable properties for maps. However, upon closer
examination it can be seen that there are really two kinds:
Definition. For categories
and
, a
covariant functor
from
to
consists of
(i) for each object
, an object
, and
(ii) for each
and morphism
Morph
, a
morphism
Morph
,
with the properties
(a)
(whenever
makes sense) and
(b)
1
1
for each
.
An example is the fundamental-group functor
.
Here
is the category of groups; the objects of
are
pairs
consisting of a topological space
and a
designated point in
, and the morphisms of
are
continuous functions that take designated points to designated
points.
is the fundamental group
consisting of equivalence classes of loops at
in
.
A contravariant functor is defined similarly, except that in (ii)
we have
Morph
and in (a)
. An example is the prime-ideal-space functor from
Boolean algebras to topological spaces.
For a functor
from
to
and a functor
from
to
, the result of following
by
is again a functor, which will be covariant if
both
and
are covariant or both
and
are
contravariant.