# What is the difference between a function and a morphism? [closed]

Say I have a function $f$. Then, if I understand correctly, $f$ can be regarded as a morphism in a suitably chosen category which has the domain of $f$ and the range of $f$ as objects.

So, the other direction. Say I have a morphism $f$ in some category from one object $A$ to another object $B$. Can I not regard $f$ as a function whose domain is $\{A\}$ and range $\{B\}$?

I'm interested in looking for contexts in which the latter move is not appropriate for some reason.

-
Think of a one object category which had more than one morphism... –  Yemon Choi Jan 26 '13 at 4:49
Don't you really mean "whose domain is $A$ and range $B$" ? (then, of course, you have to think of the objects of your category as sets). But of course, the answer is negative, as different morphisms can correspond to the same function. –  Feldmann Denis Jan 26 '13 at 5:59
@Feldmann - No, I wanted the domain of $f$ to be the set containing $A$, simply because $A$ may not be a set, and the domain of a function is a set by definition. –  Benjamin Braun Jan 26 '13 at 7:36

## closed as off topic by Eric Wofsey, Yemon Choi, Dan Petersen, Will Sawin, Martin BrandenburgJan 26 '13 at 10:23

Questions on MathOverflow are expected to relate to research level mathematics within the scope defined by the community. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about reopening questions here.If this question can be reworded to fit the rules in the help center, please edit the question.

You're losing a lot of information. Let's say we have two morphisms $f,g\in \mathrm{Hom}(A,B)$. Using your perspective, we see that both $f$ and $g$ agree at all points (as the only point is $B$). Thus by eta-reduction we should have $f=g$, but this is not necessarily the case. So thinking of morphisms as functions from $\{A\}$ to $\{B\}$ is the wrong perspective.

-
Got it. I've resolved my issue by thinking of morphisms as just triples of the form $(x,y,z)$ where $x$ and $z$ are objects of the category and $y$ is some mathematical object. So in your example, $f$ would be $(A,u,B)$ where $g$ would be $(A,v,B)$ where $u$ and $v$ are what is making $f$ different from $g$. –  Benjamin Braun Jan 26 '13 at 5:08
@Benjamin I'm not really sure how that differs from saying $f,g\in \mathrm{Hom}(A,B)$. You're just using slightly different notation with $u$ instead of $f$ and $v$ instead of $g$. –  Alex Becker Jan 26 '13 at 5:18

There are various natural categories in topology where morphisms are not functions. For instance, you may define for every $n$ the category whose objects are all compact closed $n$-manifolds and whose morphisms are the $(n+1)$-dimensional cobordisms, i.e. compact $(n+1)$-manifolds $W$ with boundary, where each boundary component of $W$ is coloured with a "+" or "-" sign. Of course you cannot interprete a cobordism $W$ from two $n$-manifolds $M$ and $N$ as a function $M\to N$. However, you can naturally define a "composition" of morphisms by gluing the manifolds. The "identity" is just the product manifold $W = M \times [0,1]$.

You can also construct embedded versions of that. For instance: objects are compact 1-submanifolds of $\mathbb R^2$ (i.e. finitely many disjoint circles) and morphisms are proper subsurfaces of $\mathbb R^2 \times [0,1]$. You might decide to see morphisms only up to isotopy fixing their boundary.

-
There is also the category whose objects are all topological spaces and whose morphisms are homotopy classes of functions. Maybe this is even the first "non set theory" functor students will encounter, at least in topology. –  Lee Mosher Jan 26 '13 at 15:39
or also, the obvious construction of "opposite category". –  Pietro Majer Jan 26 '13 at 17:12
Another interesting reason why categories cannot be identified always with categories having functions for morphisms is given in this paper, by Peter Freyd in which is proven that there are some categories which aren't concrete: i.e. which don't have any faithful functor from the category in $\mathbf{Set}$ (the category of sets and functions). Having a such functor is necessary condition to have functions as morphisms.