8
$\begingroup$

Let $A$, $B$ and $C$ be three objects in the category Set. For simplicity, assume that their underlying sets contain a finite number of elements, a, b and c respectively. Using the usual Haskell notation for types, there exists exactly $(c^a)^{c^b×b^a}$ morphisms from the object/type ($b\rightarrow c$, $a\rightarrow b$) to the object/type $a\rightarrow c$. Among this potentially huge set of morphisms, exactly one is the (uncurried) composition function, defined as ${\rm compose}\, (g, f) = g\circ f$.

My question is, does this particular morphism have any universal property that make it possible to identify using only category theory?

This is the computer-scientist-toying-with-categories-version of the question. If you prefer a version written by a proper mathematician, please refer to The universal property of composition of morphisms

$\endgroup$
9
  • 2
    $\begingroup$ I know the Thought Police are going to come along and Close this question. It's very difficult to think of a meaningful positive answer and indeed I've already thought of two situations where there is a choice of ways to compose. However, I believe that the question should stay here as a philosophical challenge to categorists to find positive answers. $\endgroup$ Commented Jun 16, 2021 at 18:05
  • 5
    $\begingroup$ This question is not uninteresting, not off topic, and not too broad; it is in fact a very interesting one, and I asked something similar quite some time ago: mathoverflow.net/questions/315211/… $\endgroup$
    – fosco
    Commented Jun 16, 2021 at 20:35
  • $\begingroup$ (I think my question is $\epsilon$-near to yours; if you have more doubts, feel free to ask) $\endgroup$
    – fosco
    Commented Jun 16, 2021 at 20:56
  • 1
    $\begingroup$ As I'm sure you're aware, the pointwise evaluation map $ev\colon B^A \times A \to B$ has a universal property, but that doesn't quite help here! The trick is to identify what data in the map is variable, and which is fixed. Or, to put it another way, what variable is the map natural in? For $ev$, we fix $A$ and $B$ and let the thing in the $B^A$ slot vary, to consider generic $X\times A\to B$. Then $B^A$ together with $ev$ is the universal thing. What is the analogue for your setup? $\endgroup$
    – David Roberts
    Commented Jun 17, 2021 at 6:17
  • 1
    $\begingroup$ Thanks @Buzz :) $\endgroup$ Commented Jun 18, 2021 at 6:05

1 Answer 1

6
$\begingroup$

First of all, as David Roberts pointed out in a comment above, the composition map

c :: hom a b -> hom b c -> hom a c
c f g = g . f

and the evaluation map

ev :: (a -> b) -> a -> b
ev f x = f x

share a common property, that of forming the components of a cowedge. I will now switch to category-theory notation, I'm confident you'll be able to translate back in pseudo-Haskell-ish/generic FP syntax.

Being a cowedge means that

  1. fixed objects $a,c$ of your category, the correspondence $(b,b')\mapsto \hom_{\cal A}(a,b)\times\hom_{\cal A}(b',c)$ is a functor ${\cal A}^\text{op}\times {\cal A} \to {\sf Set}$; let's call it $T$

  2. the family of maps $c_b : T(b,b)=\hom(a,b)\times\hom(b,c)\to \hom(a,c)$ behaves as follows, once a morphism $f : b\to b'$ is given: the square

    $$\require{AMScd}\begin{CD} T(b',b) @>T(f,b)>> T(b,b) \\ @VT(b',f)VV @VVc_bV \\ T(b',b') @>>c_{b'}> \hom(a,c) \end{CD}$$ is commutative. (I'll leave this verification to you).

Not only this; there is a category of cowedges for $T$, i.e. families $\underline g = \{g_b : T(b,b) \to E\}$ pointing to generic sets $E$ and fitting into the same commutative squares. A morphism between a cowedge $\underline g$ and a cowedge $\underline h$ is a map between their codomains, with the property that the obvious diagram commutes (I'll leave it to you to find what is the obvious diagram). Now,

Claim. $\underline c = \{c_b : T(b,b) \to \hom(a,c)\}$ is the initial object in the category of cowedges for $T$ (a functor that, let me remind you, depends on $a,b$!).

I'll leave to you this verification.

This is the universal property of the composition maps of a category.

PS: what about the evaluation map $\text{ev} : B^A\times A \to B$? Well, in a cartesian closed category its components also form not only a cowedge (this is true in every monoidal closed category, and in fact it is true for every parametric adjunction, but nevermind); they form an initial one! In a sense, feeding a function with an element in its domain is "the simplest operation one can perform", given a function and an element (of course, this intuition deeply relies on the fact we can resort to elements; in category theory, this is often not possible). Similarly, given two arrows in a category that can be composed, composing them is the most natural thing you could do.

$\endgroup$
4
  • $\begingroup$ On a first glance, this looks very much like what I am looking for. I'll look into cowedges. $\endgroup$ Commented Jun 17, 2021 at 20:40
  • $\begingroup$ There's a very long story you can tell about them :D arxiv.org/abs/1501.02503 $\endgroup$
    – fosco
    Commented Jun 17, 2021 at 20:55
  • 4
    $\begingroup$ To sum this up, we have$$\int^{B} \hom(A,B) \times \hom(B,C) = \hom(A,C).$$In fact, for any set-valued functor $F$ we have $$\int^{B} F(B) \times \hom(B,C) = F(C).$$ $\endgroup$ Commented Jun 18, 2021 at 13:27
  • $\begingroup$ Yes, I wanted to add it myself. :) $\endgroup$
    – fosco
    Commented Jun 18, 2021 at 14:56

You must log in to answer this question.

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