范畴论中态射合成逆序定义的底层依据问询
Recently I'm studying category theory in the beginning level. This mathematical concept is really fantastic. However, the definition of morphism composition seems a little confusing:
$$\circ: \mathrm{Hom}_c(B,C) × \mathrm{Hom}_c(A,B) \to \mathrm{Hom}_x(A,B)$$
(注:推测此处$\mathrm{Hom}_x(A,B)$应为$\mathrm{Hom}_c(A,C)$,否则该映射的目标域不符合态射合成的逻辑)
In ordinary function composition, we usually use $f \circ g (x)$ to express $f(g(x))$. Morphism composition, however, seems to be defined in a reverse order. This seems to be contradictory with intuitions and conventions. With this definition, one must use contravariance functor to describe a cast from a space to its dual.
When a definition in mathematics seems to be odd, most of the time there are some underlying structures/rules/properties that explain this oddity. Or at least, it will make solving problems easier in some ways. Can you give me a hint or guess for this oddity?
This is my first question here, thanks for your patience!
Hey there! Awesome first question—category theory's notation choices can definitely feel backwards when you're coming from basic function composition, but there are some really good reasons this convention became standard:
Diagram readability takes priority: When you work with commutative diagrams (which are everywhere in category theory), having morphisms compose left-to-right matches how you trace arrows. If you have $f: A \to B$ and $g: B \to C$, writing $g \circ f$ means you follow the path from $A \to B \to C$ exactly as you read the expression left to right. It's way less confusing when you're parsing a big diagram of objects connected by mappings.
Functor behavior feels consistent: For a functor $F: \mathcal{C} \to \mathcal{D}$, the rule $F(g \circ f) = F(g) \circ F(f)$ is clean and intuitive—it says the functor preserves composition in the "natural" order of the category. If we used the standard function composition order, this would flip to $F(f \circ g) = F(f) \circ F(g)$, which works, but it breaks the nice alignment between the functor's action and the category's structure.
Historical and algebraic alignment: Early category theorists (Eilenberg and Mac Lane, the founders) chose this order because it lined up with how algebraic structures like groups and rings describe mappings. For example, group actions often use left-to-right composition for functions acting on sets, so this notation felt familiar to the algebraic community that adopted category theory first.
Contravariance reveals structure, not just a quirk: While the dual space functor being contravariant feels odd at first, it's actually a meaningful consequence of this composition order. If you have a linear map $f: V \to W$, the dual map $f^: W^ \to V^*$ takes a functional $\phi: W \to \mathbb{F}$ to $\phi \circ f: V \to \mathbb{F}$. Using the category's composition rule, this reversal is a natural reflection of how dual spaces "watch" mappings in reverse, rather than an arbitrary rule.
Don't stress if it takes a bit to get used to! Almost everyone stumbles on this at the beginning, but once you start working with diagrams and functors regularly, the order will feel second nature.
备注:内容来源于stack exchange,提问作者Mooooonk

