In the comments and answer to another recent [question](https://mathoverflow.net/q/422023/92164), it became apparent that category theorists who work with the ‘many hom-class’ definition of a category implicitly view composition as a function of five variables, three of them the objects that define the hom-classes the composable arrows live in.


This is, to put it mildly, very counterintuitive to me. I can’t think of a single time in my years working with (fibered) categories where composition depended on the objects involved, but maybe I just didn’t notice due to not looking for it. To this end,



> 
> What are some examples of ‘naturally occurring’ categories $\mathcal{C}$ where we have objects $X,Y,Z,X’,Y’,Z’$ and arrows $$f\in{\bf Hom}\_\mathcal{C}(Y,Z)\cap {\bf Hom}\_\mathcal{C}(Y’,Z’),$$ $$g\in{\bf Hom}\_\mathcal{C}(X,Y)\cap{\bf Hom}\_\mathcal{C}(X’,Y’)$$ such that $$f\circ\_{\_{XYZ}}g\neq f\circ\_{\_{X’Y’Z’}}g?$$
> 
> 
> 


Any relevant input is appreciated.



Naturally occurring examples of categories where composition depends on objects
Here is a way to see that [Brian Shin’s example](https://mathoverflow.net/a/422314/2273) can be obtained from (standard many-hom-sets presentations of) more general constructions — so this shows clearly that constructions from the standard literature can lead to cases where composition genuinely depends on the objects.


$\newcommand{\C}{\mathcal{C}}\newcommand{\op}{\mathrm{op}}\newcommand{\id}{\mathrm{id}}$First, take the [**category of elements**](https://en.wikipedia.org/wiki/Category_of_elements) $\int\_{\C^\op} F$ of a presheaf $F : \C^\op \to \mathrm{Set}$ to have:


* objects are pairs $(c,x)$, where $c \in \C$, $x \in F(c)$;
* maps $(c',x') \to (c,x)$ are maps $f : c' \to c$ such that $x|\_f = x'$.


In particular, applying this over the terminal category $\C = \{\*\}$ yields a construction of *discrete* categories $DX = \int\_1 X$ in which all identities are equal: $DX((\*,x),(\*,x)) = \{ \id\_\*\}$.


Now, take the [**Grothenedieck construction**](https://en.wikipedia.org/wiki/Grothendieck_construction) of a functor $\newcommand{\D}{\mathcal{D}}\D : \C \to \mathrm{Cat}$ to have:


* objects are pairs $(c,d)$, where $c \in \C$, $d \in \D(c)$;
* maps $(c,d) \to (c',d')$ are pairs $(f,g)$, where $f : c' \to c$, and $g : \D(f)(d) \to d'$.


Now take $G$ and $G'$ to be two different groups on the same underlying set, viewed as one-object categories; and consider the functor $\mathcal{G} : D2 \to \mathrm{Cat}$ picking out $G$ and $G'$. Then the Grothendieck construction of $\mathcal{G}$ recovers Brian Shin’s example: its hom-sets are $\{\id\_\*\} \times G$ and $\{\id\_\*\} \times G'$, i.e. the same set with different composition operations.




---


That said, let me address where you write:



> 
> it became apparent that category theorists who work with the ‘many hom-class’ definition of a category implicitly view composition as a function of five variables […] This is, to put it mildly, very counterintuitive to me.
> 
> 
> 


I really want to convince you it *shouldn’t* be counterintuitive: it’s just being slightly more explicit about something you’re doing all the time anyway, in many situations.


As in my [previous answer](https://mathoverflow.net/a/422068/2273), think about group operations (I’ll write multiplicatively). We think of multiplication as a function of two variables — and for a fixed group, of course, it is. But with varying groups, it also depends on the group. And this really matters — for instance, when we take the product of a family of groups $\prod\_i G\_i$, we define its pointwise multiplication as $(x \cdot y)\_i = x\_i \cdot y\_i$. Formally of course this must mean $x\_i \cdot\_i y\_i$ — the multiplication used depends on $i$. But this doesn’t disrupt our intuition of it as a binary operation; it just *also* depends on another parameter *i*.


Of course, you could avoid that dependence by assuming that the groups in the family must be disjoint, or compatible where they intersect, in order to form the product. But I think most modern algebraists would find such a restriction highly artificial, and unnecessary anyway — the dependence is nothing to be worried by. Indeed, once you look for it, this sort of thing is *everywhere* in mathematical practice. A large part of Martin-Löf’s original motivation for dependent type theory was analysing how mathematicians use this sort of dependency in practice. For me, meeting dependent type theory was like [Molière’s character](https://en.wikipedia.org/wiki/Le_Bourgeois_gentilhomme) learning he’d been speaking prose all his life.


Coming back to the typed-hom-sets definition of category: The point isn’t to *focus* on the extra dependence on objects. The point is to let us *ignore* the question intersection/disjointness of objects, and view it as just as irrelevant as the question of whether different abstract groups are disjoint; and we achieve it by exactly the same mechanism.


