12
$\begingroup$

According to Wikipedia:

Let C and D be categories. A functor F from C to D is 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(X) \rightarrow F(Y)$ in D such that the following two conditions hold:
    • $F(id_X) = 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$ in C.

That is, functors must preserve identity morphisms and composition of morphisms.

Maybe this is because of my programming background, but it's not clear what is $F$ in this definition. It looks like a function, but it always takes different arguments: $F(X)$ – object, $F(f)$ – morphism.

It looks like a very smart function that accepts all kinds of arguments and knows what to return in each case.

Moreover, in this book there is one more equation that makes thing even more complicated:

$$F(f : X \rightarrow Y) = F(f) : F(X) \rightarrow F(Y)$$

Does it mean that if we pass a function $f : X \rightarrow Y$ to $F$, we will get a function $F(f) : F(X) \rightarrow F(Y)$?

Also, shall $F$ mentioned here: $F(f : X \rightarrow Y)$ and here: $F(X)$ to be two different functions with different signatures and behavior?

$\endgroup$
2
  • 2
    $\begingroup$ If you are familiar with Haskell, you might recognize the two components of a functor as a type constructor (the object mapping, like [] or Maybe) and the fmap function (the morphism mapping). The well-known map function in many languages is a combination of the mapping of a function to another function on lists, along with the application of that function on a list. $\endgroup$
    – chepner
    Commented Aug 14, 2016 at 19:54
  • 2
    $\begingroup$ Category theory overloads 'operator()' a lot more than set theory does. $\endgroup$
    – user14972
    Commented Aug 15, 2016 at 7:11

4 Answers 4

23
$\begingroup$

You're right, $F$ really is two functions. If you were being very formal, you might say a functor $F : \mathcal{C} \to \mathcal{D}$ is a pair $F=(F_0, F_1)$, where $F_0 : \mathrm{ob}(\mathcal{C}) \to \mathrm{ob}(\mathcal{D})$ and $F_1 : \mathrm{mor}(\mathcal{C}) \to \mathrm{mor}(\mathcal{D})$ are functions satsifying

  • If $f : X \to Y$ in $\mathcal{C}$, then $F_1(f) : F_0(X) \to F_0(Y)$ in $\mathcal{D}$;
  • $F_1(\mathrm{id}_X) = \mathrm{id}_{F_0(X)}$ for all $X \in \mathrm{ob}(\mathcal{C})$; and
  • $F_1(g \circ f) = F_1(g) \circ F_1(f)$ for all $X \xrightarrow{f} Y \xrightarrow{g} Z$ in $\mathcal{C}$.

There are various encoding tricks you could use to completely remove ambiguity, but in day-to-day life there is no problem with just writing $F$ to denote both $F_0$ and $F_1$. But when using a proof assistant, say, the distinction has to be made.

$\endgroup$
8
  • 6
    $\begingroup$ +1. Note that an alternative to this is to dispense with objects entirely, and work with an "arrows-only" formalization; see my answer to this question. $\endgroup$ Commented Aug 14, 2016 at 18:19
  • $\begingroup$ Err... no, functors are not functions, because categories are not sets. $\endgroup$
    – user325968
    Commented Aug 14, 2016 at 18:21
  • 7
    $\begingroup$ @mathguy: That depends on whether you're using, say, NBG set theory (in which a category is class and a small category is a set), or a Grothendieck universe (in which case a category is a set, and a small category is a small set), or whatever else. Regardless of the underlying theory, you could replace 'function' by 'class-function' and my answer goes through. $\endgroup$ Commented Aug 14, 2016 at 18:23
  • 6
    $\begingroup$ @mathguy: That's also just not true. A functor is a pair of (possibly class-)functions satisfying certain conditions. You can (and people do) talk about a functor being, say, injective on objects (i.e. $F_0$ is an injective (class-)function), or a corresponding notion for morphisms (say faithfulness). $\endgroup$ Commented Aug 14, 2016 at 18:30
  • 6
    $\begingroup$ @mathguy: I'm not sure what point you're trying to make here, your objections keep changing (or you're just not reading my comments). No-one (except you) said anything about 'injective functors'. I'm very well-versed in the distinction between a functor being injective on objects and being faithful. $\endgroup$ Commented Aug 14, 2016 at 18:38
7
$\begingroup$

Don't forget a category $\mathcal C$ is made up of two sorts of data: a class of objects, and for each pair of objects, a set of arrows. Therefore, it is natural that a functor from the category $\mathcal C$ to another category has, so to say, two components: a function on the class of objects, and functions on each set of arrows.

$\endgroup$
8
  • $\begingroup$ Not a "function" on the class of objects - it is call a "class" of objects and not a "set" of objects precisely because in most cases it is not a set (so you can't define a "function" on it.) $\endgroup$
    – user325968
    Commented Aug 14, 2016 at 18:22
  • 4
    $\begingroup$ @mathguy: I never wrote a set of objects. Reread my answer. And the term function is valid for classes, as far as I know. $\endgroup$
    – Bernard
    Commented Aug 14, 2016 at 18:25
  • 5
    $\begingroup$ @mathguy: That just isn't true, 'function' is very commonly used for class functions. $\endgroup$ Commented Aug 14, 2016 at 18:28
  • 1
    $\begingroup$ @mathguy: See NBG Set theory. $\endgroup$
    – Bernard
    Commented Aug 14, 2016 at 18:38
  • 1
    $\begingroup$ @mathguy While the term "class function" is more precise, I've definitely heard the distinction between (set) functions and class functions get elided in contexts where the set- or class-theoretic foundations are not actively relevant. And I think this is one of those times. $\endgroup$ Commented Aug 14, 2016 at 18:43
4
$\begingroup$

If you extract the set1 $Ob(C)$ of objects from the category $C$ and the set $Ar(C)$ of arrows, then given any functor $F : C \to D$, you can indeed construct two functions $$ Ob(C) \to Ob(D) : X \mapsto F(X) $$ $$ Ar(C) \to Ar(D) : f \mapsto F(f) $$ satisfying the stated properties. And conversely, given any two functions satisfying the properties, there exists a corresponding functor.

You can think of the functor as being a pair of functions, but it is probably better to instead think of that as a way to represent functors. You want to think of a functor as being a thing in its own right, rather than being shackled to that particular representation.

For example, you can do the usual thing of promoting evaluation to a binary operator. In set theory, there is a set $Y^X$ of all functions from $X$ to $Y$, and you can consider evaluation a function $Y^X \times X \to Y$.

You can do the same thing with functors; there is a category $D^C$ whose objects are functors from $C$ to $D$ (and whose arrows are natural transformations), and evaluation is itself a functor $D^C \times C \to D$.

Another potentially interesting point is that categories don't just have point-shaped and arrow-shaped elements. They have elements in the shape of any diagram: for example, they have commutative-square-shaped elements, and the functor $F$ also maps commutative-square-shaped elements of $C$ to commutative-square-shaped elements of $D$.

That a functor preserves composition of morphisms can actually be phrased in terms of the functor acting on the commutative-triangle-shaped elements.

(all of the information of a category is in its arrows so we can reduce all various-shaped elements to arrows and equations between them, but we don't have to)

1: Replace "set" with other notions as needed or to taste

$\endgroup$
0
0
$\begingroup$

Functors are not "functions" because categories themselves are not "sets" to begin witthh. (The contradictions of the concept of "set" of all sets, with which you may be familiar, is what leads to the need for the different concept of "category" in the first place.)

Using the same letter $F$ for mappings from one category's objects to the other's and for the mapping from the first category's morphisms to the other's is an "abuse of notation" (overloading is indeed the correct analogy); it is not required for the definition. You might as well say a functor is a mapping $F$ from the objects of $C$ to the objects of $D$, together with, for EACH pair of objects $(X,Y)$ of $C$, a function $\varphi_{X,Y}$ (indeed, because morphisms between two objects must always be sets) from [ the morphisms from $X$ to $Y$ in the category $C$ ] to [the morphisms from $F(X)$ to $F(Y)$ in the category $D$ ]. Writing it this way, without using the same notation $F$ for everything, does not change the definition.

$\endgroup$
14
  • 1
    $\begingroup$ I see a few down votes... It may help me and others if you would explain what is wrong with the answer. Thanks! $\endgroup$
    – user325968
    Commented Aug 15, 2016 at 2:12
  • 6
    $\begingroup$ Though I did not dos vote this, if I did downvote it, it would because careful distinctions between sets and classes are not germane to the level of question of the OP. More sophisticatedly, as has already been pointed out to you on this page twice, in at least one very widely used foundation, every category is a set, and even when this is not the case it's far from universally accepted that any serious purpose is served by dogmatically restricting the word "function" to a mapping defined between sets. $\endgroup$ Commented Aug 15, 2016 at 5:26
  • 3
    $\begingroup$ Nor did I downvote it, but if I did it would be at least in part for the extreme unhelpfulness of "go back a few chapters in your imaginary book." That's much more snarky than it is actually informative. $\endgroup$
    – Wildcard
    Commented Aug 15, 2016 at 6:27
  • 1
    $\begingroup$ @Wildcard - Fair enough. I will edit to remove that remark. Thank you! $\endgroup$
    – user325968
    Commented Aug 15, 2016 at 12:19
  • 2
    $\begingroup$ You just haven't given any clear explanation of the reasons for this vehemence. You claim it's the essence of a category not to be necessarily a set, we all point out that's far from clear, and you haven't done anything to defend your point. My point is that the study of categories via universes is category theory, which you apparently dispute, and I still don't know why. It might help to point out that no successful foundation of category theory without reference to sets has yet been given. $\endgroup$ Commented Aug 15, 2016 at 23:18

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .