# "Good" notation for $\hom$-functors

In a follow-on comment, the answerer of this question opines that the standard notation used to represent $\hom$-functors is "bad". That's somewhat comforting, as it tells me my own confusion is caused by muddled notation, not lack of the necessary neurons on my part.

If you agree with this assessment, can you offer, simply for pedagogical purposes, an alternate notation that would be more consistent and descriptive that might trigger an a-ha moment for me?

UPDATE: stared at the above-linked SO question for a while, and back at the text I'm studying from (Abstract and Concrete Categories: the Joy of Cats, by Adamek, Herrlich & Strecker, p. 30). Here's the relevant section of the text:

For any category $\mathbf{A}$ and any $\mathbf{A}$-object $\mathbf{A}$, there is the covariant hom-functor $\hom(A, −) : \mathbf{A → Set}$, defined by $$\hom(A, −)(B \xrightarrow f C) = \hom(A, B) \xrightarrow {\hom(A,f)} \hom(A, C)$$ where $\hom(A, f)(g) = f \circ g.$

It looks to me like $$\hom(A,f)(g)$$ is intended as a rewrite of the left side of the equation above it $$\hom(A,-)(B \xrightarrow f C)$$ with $f$ substituted for the "-" and $g$ substituted for the $f$. But that's obviously wrong. To get the right sequence ($A, B, C$) of domains and codomains, $f$ in the final equation has to be the same as the $B \xrightarrow f C$ in the previous one, and $g$ has to be $A \xrightarrow g B$. But if that's so, why are the positions switched? (As I write this, the light is dawning about the meaning of the right side of the main equation, in which $g=\hom(A,B)$ is the argument passed to $\hom(A,f)$ and the result is the converted morphism $A \xrightarrow h C = \hom(A,C)$. But it still seems like the left side doesn't match the left side of the "where" clause equation.)

UPDATE 2: Thanks to the erudite responses below, my understanding is getting better. Here's my attempt to document the blanks I've filled in. It starts with a pretty picture: 1. The objects in Set are in this case sets of A-morphisms originating at object $A$. So... the objects are sets of morphisms – a slightly disorienting fact initially to me and probably other Cat-Theory neophytes. I understood it from the beginning but I think it contributed to some head scratching.
2. A co-variant hom-functor $\hom(A,-)$ can be thought of as generating new morphisms from $A$ to $C$, using existing $A \rightarrow B$ morphisms with a $B \rightarrow C$ “helper function” to complete the path. This is just good old composition, no more and no less, only viewed in a slightly weird way that brings the Set category into the mix.
3. To transform any given morphism or object, we fill in the "–" in $\hom(A,–)$ with a specific object or morphism from A. That is, if we fill in with an object $B$, then $\hom(A,B)$ yields (in fact, is) the set of -- well, $\hom(A,B)$. If we fill in with A-morphism $f: A \rightarrow B$, then $\hom(A,-)$ converts A-morphism $f$ to a Set-morphism $\hom(A,f)$. Since the objects we're concerned with in Set are A-morphisms, the morphisms we care about in Set take us from one A-morphism to another A-morphism. This is accomplished via regular old composition: $\hom(A,f)$ gives us a Set-morphism that takes us from an A-morphism $g$ to $f \circ g$, which is of course another A-morphism.
4. All that said, we haven't written down explicitly any function $F_o:$ Ob(A) $\rightarrow$ Ob(Set) to transform objects, or any $F_m:$ Mor(A) $\rightarrow$ Mor(Set) to transform morphisms. Since we're looking at functors, not functions, maybe this is what I should expect.
• Is it just for morphisms or objects too? Oct 1, 2016 at 1:23
• Both would be great, just to show consistency of types, but of course morphisms is where things get kinda hairy. Oct 1, 2016 at 3:02
• Can someone please explain the downvote? I have no idea why my question should be considered a bad one, so I'm quite likely to do it again :(. Oct 1, 2016 at 3:12
• @nclark: the notation comes from thinking of $\text{Hom}(S, -)$ as a functor. Functors act on both objects and morphisms, so sometimes you might want to plug in an object and sometimes you might want to plug in a morphism. Oct 1, 2016 at 3:16
• I would disagree that comment that the notation is bad -- IMO there is real value in having notation where elements of any shape of a category can be treated uniformly. If $F$ is a functor, then I should be able to write $F(x)$ whether $x$ is an object, an arrow, or even more exotic things (e.g. any sort of diagram). Treating objects and arrows as separate types of thing is something to be avoided when unneeded, rather than a habit to be emphasized.
– user14972
Oct 3, 2016 at 2:26

Write it as $\text{Hom} \left( S, T \xrightarrow{f} V \right)$. The output of this operation is a function which you can write

$$\text{Hom}(S, T) \xrightarrow{g \mapsto fg} \text{Hom}(S, V).$$

• That is not better at all, it is just more cumbersome Oct 1, 2016 at 1:28
• Thanks for the effort, @Qiaochu. I do have trouble seeing how this make things clearer, though. Oct 1, 2016 at 3:06
• @nclark: one reason you might have trouble parsing the notation $\text{Hom}(S, f)$ is because it might be difficult to keep in working memory that $f$ is a morphism and not another object. This notation makes it very clear that $f$ is a morphism by making explicit its source and target. It also suggests that whatever the notation means it has something to do with $\text{Hom}(S, T)$ and $\text{Hom}(S, V)$. In any case, I think you are not asking the question you want to ask here. Ask for a better explanation of Hom functors, and try to understand and describe your confusion in more detail. Oct 1, 2016 at 3:16

$\hom(A,-)$ is a functor from $\mathbf{A}$ to Sets. You can thus plug any object or morphism of $\mathbf{A}$ into it. When you plug in an object, such as $B$, you should get an object of Sets, namely the set of morphisms $\hom(A,B)$. When you plug in a morphism, such as $f:B\to C$, you should get a morphism of Sets, namely, the function $\hom(A,f):\hom(A,B)\to\hom(A,C)$ which sends a morphism $g:A\to B$ to the composition $f\circ g$. So, and this may be the point of confusion, $f$ and $g$ play two very different roles here: respectively, as the argument of the functor and as an element of the domain of the image of $f$ under $\hom$. I don't see a likely way to improve the notation; note the use of "arguably" in the post you reference.

The notation quoted in the original post is flat out wrong.

The presence of the "$-$" in the notation $\hom(A,-)$ is meant to indicate where the argument to the functor is to be placed: when evaluated at some variable $X$ of type $\mathbf{A}$ (e.g. $X$ could be an object or an arrow of $\mathbf{A}$), one is supposed to write $\hom(A,X)$.

The notation $\hom(A,-)(X)$, however, indicates a function that, when evaluated at $Y$, produces the value $\hom(A,Y)(X)$, and that is definitely not what is intended (and is usually nonsensical!).

The notation $\hom(A,-)$ is itself notation for partially evaluating the functor $$\hom(-,-) : \mathbf{A}^\circ \times \mathbf{A} \to \mathbf{Set}$$ at $A$ in its first argument.

Alternative notations do exist, though. For example, the two notations

$$h_Y(X) = h^X(Y) = \hom(X, Y)$$

get used. I have also seen $\mathbf{y}$ used for the Yoneda embedding $\mathbf{A} \to \mathbf{Set}^{\mathbf{A}^{\circ}}$; that is, $\mathbf{y}A = \hom(-,A)$, although this has the wrong variance for the specific example under discussion. I don't think I've seen the other embedding notated by the letter 'y' before.

• I guess this is a flaw in the $-$ notation, which is that it doesn't tell us what the $\lambda$ encompasses. For example $f(-)(x)$ could mean $(\lambda a.f(a))(x)$, or it could mean $\lambda a.f(a)(x)$. Sep 10, 2017 at 14:55
• In fact, even $g = f(-)$ is ambiguous. Are we saying that $g$ equals the function $f(-)$, or are we denoting something that turns an $x$ into the truthvalue $g=f(x)$? Sep 10, 2017 at 14:56

Let us write ; for the “forwards/diagrammatic composition” in our category 𝒞. That is, g ∘ f = f ; g. Let a and b be objects and f and g be morphisms in our category.

Define the Hom-(bi)functor

_⟶_ : 𝒞ᵒᵖ × 𝒞 → 𝒮e𝓉
(a ⟶ b) = {x ∣ x is a 𝒞-morphism with source a and target b}
(f ⟶ g) = (λ i • f ; i ; g)


We use diagrammatic composition to make the second clause easier to remember; also the bullet “•” syntax simply serves to separate the arguments from the body in the lambda.

This notation, afaik, is due to Maarten M. Fokkinga ─a pleasent fellow :-)

Benefits of using this notation include

• The operation on objects is exactly what we expect in the familiar setting of sets and functions. Thus a generlisation of that notion.

• It is common to use an underscore _ to denote the position of a “missing argument” and the arrow ⟶ looks like an underscore and thus makes it easy to rewrite (f ⟶ g)(i) as f ; i ; g.

• Functors are usually denoted by the same symbol for both the object and morphism operations and this is easily achieved by extending the exiting arrow notation to morphisms.

• Identifying an object with the identity morphism, gives us the usual covaraint and contravariant hom-functors; e.g., (a ⟶ g)(i) = idₐ ; i ; g = i ; g.

The intended usage is clear from the typing of the variables involved; which is the ubiquitous usage of all functors.

• Some statements look easier or more familiar with this notation ─depending on context of course. For example, that X × Y is a product object means we have a natural distributive rule (Z ⟶ X × Y) ≅ (Z ⟶ X) × (Z ⟶ Y); which is generalizes the logical rule of “obtaining multiple results is tantamount to obtaining each simultaneously”: (p ⇒ q ∧ r) ≡ (p ⇒ q) ∧ (p ⇒ r)

If one knows some lattice theory, they may realise ⟶ as sharing many properties of an order relation. Roland Backhouse and friends take this approach and make the motto: “categories are coherently constructive lattices”!

• Wikipedia mentions that “internal hom” operations are sometimes denoted with the double arrow ⇒, which is similar to the external hom ⟶.

In particular, in a closed monoidal category, we obtain a lovely “relisation of internal as external”: I ⟶ (Y ⇒ Z) ≅ Y ⟶ Z, where I is the unit object. We may read this as: the "points" of the internal hom correspond precisely to morphisms.

Hope this helps :-)