1

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$.)

Alexey
  • 2,124
  • 2
    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
  • 2
    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
  • Also, note some definitions of category do not require $\hom(A,B) \cap \hom(C,D) = \varnothing$ when $(A,B) \neq (C,D)$. In such a situation, "domain" and "codomain" would not be operations on the class of all morphisms of a category. –  Feb 15 '14 at 14:29
  • @Hurkyl, i can imagine that it may be enough to define what $\operatorname{hom}(A,B)$ is. However, the existence of domain and codomain seems to be usually required in the same texts that define morphisms in $\mathbf{Set}$ as functions. Also, not having homsets disjoint seems to make it impossible to talk about categories in an object-less manner (replacing objects by their identity morphisms). – Alexey Feb 15 '14 at 14:35
  • This question is a duplicate. – Martin Brandenburg Feb 15 '14 at 14:37
  • @MartinBrandenburg, sorry i didn't notice. Is it this one? If so, it seems to be a very verbose variant of my simple question. – Alexey Feb 15 '14 at 14:43

2 Answers2

3

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].

In such case the operation of codomain is defined, being just the operation giving the second element of the ordered triple.

Clearly the same objection applies to the case of natural transformations and functors, but that's just to avoid to be too pedantic.

Giorgio Mossa
  • 18,150
0

To be precise, an ordinary function itself is always a triple. The domain and the codomain of a function is always part of its definition.

Two functions with the same expression, and isomorphic domain or codomain, can only be "completed" to a similar function in 2 different ways. In general, all the "static parts" of X are always part of the definition of X.

It's not a trivial idea, I think this completion appears in non trivial context.

nicolas
  • 697
  • Not according to the set-theoretic definition that i am using. I do not distinguish the $\sin$ function with codomain $\mathbf{R}$ from the $\sin$ function with codomain $[-1,1]$. I also have only one empty function. – Alexey Nov 01 '21 at 09:50
  • I find that definition (which I have never seen) very much not desirable then. That means that it is not well-defined that a function is surjective. Which seems to be a fairly bad behaviour. – Captain Lama Nov 01 '21 at 10:14
  • @CaptainLama, I don't understand what you mean. Being surjective is perfectly well-defined, because in the literature people almost always use phrases like "the function f is surjective on some set X" which is well-defined. If you don't specify a target set, then the notion of surjectiveness becomes trivial, as every function is surjective on it's range and so it is still well-defined. – Shervin Sorouri Nov 01 '21 at 11:48
  • @ShervinSorouri The two approaches specify a target. the literature saying "f is surjective on some set X" is a way to say one can restrict it to another function with target that set (not "a set") while being surjective. It's another function because the set of function you can compose it with is different from the set of function you can compose the original with : to compose function they have to agree on some domain. – nicolas Nov 01 '21 at 12:05
  • @Alexey maybe what you want is polymorphic functions. a function like "the identity" exist in different flavor : one for each, say, set $1_A : A \to A $. or one polymorphic function $id : \forall X. X -> X$ those are more like natural transformations. – nicolas Nov 01 '21 at 12:09
  • @nicolas, no actually. One can compose functions with disagreements both in their domains and ranges and so they are the same. Maybe your foundational viewpoint is different though. – Shervin Sorouri Nov 01 '21 at 13:11
  • @ShervinSorouri if you accept that you can compose functions disagreeing on codomain and domain, you have no hope to write a generic function "compose" which accepts two functions as its input and return its composite for its result. – nicolas Nov 01 '21 at 13:20