# What are morphisms in the category of sets $\mathbf{Set}$?

Do i understand correctly that morphisms in the category of sets $\mathbf{Set}$ are ordered triples $(f, A, B)$ where $f$ is a function $A\to B$?

It seems that it is often claimed, even in the Categories for the working mathematician by Mac Lane, that morphisms are functions, while this is obviously wrong, as the codomain operation on morphisms would not be possible to define (corectly) in this case.

(Incidentally, a similar error reappears in the definition of the category of functors: natural transformations are taken to be morphisms, but probably the correct definition of morphisms would be all triples $(\tau, S, T)$, where $\tau$ is a natural transformation from the functor $S$ to the functor $T$.)

-
The definition of a function includes the domain and codomain as part of it. For instance, the function $f: \mathbb R \to \mathbb R$ defined by $f(x)=x^2$ is different than the function $g: \mathbb Q \to \mathbb Q$ defined by $g(x)=x^2$ – Santiago Canez Feb 15 '14 at 14:14
@SantiagoCanez the function $f\colon\mathbb{R}\to\mathbb{R}, x\mapsto x^2$ is the same as the function $f\colon\mathbb{R}\to[0, +\infty), x\mapsto x^2$. – Alexey Feb 15 '14 at 14:16
Alexey, from a set theoretical point, yes. But from a category theoretical point, no. The functions $(x\mapsto x^2,\Bbb R,\Bbb R)$ and $(x\mapsto x^2,\Bbb R,[0,\infty))$ are different. – Asaf Karagila Feb 15 '14 at 14:18
Even if i alter the standard definition of a function to include the codomain, it would not help to explain the similar problem with the category of functors, as the natural transformation is defined in the same book as a family of morphisms, and carries not information about the functors. – Alexey Feb 15 '14 at 14:18
@AsafKaragila, is your category-theoretic definition of a function "an ordered triple $(f, A, B)$ with $f\colon A\to B$ a set-theoretic function"? Does this mean that the answer to my question is basically "yes"? ;) – Alexey Feb 15 '14 at 14:22

Alexey you're observation is correct. To or to be exact in MacLane's book a function $f \colon X \to Y$ is thought as an ordered triple of the form $f=\langle X,Y,\bar f\rangle$ where $X$ and $Y$ are sets and $\bar f \subset X \times Y$ is a functional relation (i.e. a relation such that for every $x \in X$ there's a unique $y \in Y$ with the property $(x,y) \in \bar f$) [as written in the introduction of the book].
@Alexey I do: "Category theory starts... ... Each arrow $f \colon X \to Y$ represent a function; that is, a set $X$, a set $Y$, and a rule $x \mapsto fx$ which ..." at page 1. – Giorgio Mossa Feb 15 '14 at 14:41