# Categories, categories of linear maps and homomorphisms

The concept of categories and morphisms were introduced to us today in our Linear Algebra course. I haven't taken abstract algebra yet so this lecture confused me quite a bit. As far as my understanding goes, a category consists of the following:

1. A class of objects
2. A class of morphisms given any 2 objects from the category
3. An identity morphism given an object
4. A way to compose 2 morphisms

A few examples that were given by our professor that he claimed would be relevant in the class were the category of vector spaces with linear maps as morphisms and the category of linear maps. But he never explored these concepts in detail and just skimmed over them.

Why must the morphisms of the category of vector spaces have to be linear maps? Why not functions that are non-linear? I have eventually, after trying to prove that they must be linear, think that it is only for the sake of convenience. Is this correct?

And I am quite confused about morphisms of the category of Linear maps (between vector spaces). Does it mean that the morphism takes linear maps as input and outputs an other map in the category?

And in general, do morphisms need only be associative or are there other resitrictions?

I have no prior experience in abstract algebra so please consider me a layman. A few might examples might help.

Thank you

• Consider $\mathbb{R}$ as a vector space. Consider the map $x\mapsto e^x$. The image of $\mathbb{R}$ is under this map is $(0,\infty)$. Is $(0,\infty)$ a vector space?
– user443408
Feb 21, 2020 at 4:27
• @Darel Perhaps I misunderstand your point, but $(0, \infty)$ is a vector space with the operators conjugated to the usual vector space operations $+, \cdot$ on $\Bbb R$ by the exponential map you wrote down, namely, $v \oplus w := v \cdot w$ and $\alpha \odot v := v^{\alpha}$. Feb 21, 2020 at 6:51
• @Chandrahas We could certainly form a new category whose objects are vector spaces and whose morphisms are maps between vector spaces (without any restrictions like linearity). But that category wouldn't make much use of the fact that our underlying spaces are vector spaces in the first place, and in particular of the operations $+, \cdot$, and therefore we shouldn't expect that category to tell us much about linear algebra. Feb 21, 2020 at 6:56
• Put another way, for most purposes the underlying sets might as well be any sets, not ones that happen to have a vector space structure that our morphisms don't care much about, so probably we'd be just as well off working in the category $\textsf{Set}$. Feb 21, 2020 at 6:57
• @TravisWillse I think your second comment gets to the gist of what I was trying to get at much better.
– user443408
Feb 21, 2020 at 7:37

It is by definition that the maps in the category of vector spaces are linear maps. The full description of the data defining the category of vector spaces and linear maps is, after fixing a base field (such as the real numbers $$\mathbb{R}$$):

1. Objects: vector spaces over $$\mathbb{R}$$.
2. Morphisms: Set $$\operatorname{Hom}(V, W) = \{f : V \to W \mid f \text{ is } \mathbb{R}\text{-linear}\}$$.
3. Composition: For $$f \in \operatorname{Hom}(U, V)$$ and $$g \in \operatorname{Hom}(V, W)$$, the composition $$fg$$ in the category is defined to be the composition of functions $$f \circ g$$.

Now you need to check that this data is indeed a category: that composition is associative, that composition lands in the correct set (for the above example, we need $$f \circ g$$ to be a linear map $$V \to W$$), and that an identity morphism $$\operatorname{id}_V \in \operatorname{Hom}(V, V)$$ exists for each object $$V$$.

Here are some other examples of random categories we could define:

1. The category of vector spaces and linear isomorphisms. (Same objects as above, but fewer morphisms).
2. The category of vector spaces, where the only morphisms are the identity morphisms from an object to itself. (Same objects as above, but a pretty useless category).
3. The category of sets and functions.
4. The category where the objects are the natural numbers $$\mathbb{N} = \{0, 1, 2, \ldots\}$$, the morphisms $$\operatorname{Hom}(n, m)$$ are the set of $$m \times n$$ matrices, and composition is matrix multiplication.
5. The category with a single object $$x$$ and a single morphism in $$\operatorname{Hom}(x, x)$$.

There are many things that are categories, some useful, and some not. But the defining data are objects, morphisms, and composition. Then you need to check that the conditions hold. Here are some non-examples of categories:

1. The category with a single object $$\mathbb{R}$$, where morphisms $$\operatorname{Hom}(\mathbb{R}, \mathbb{R})$$ are polynomials of degree at most 2, and composition in the category is composition of functions. (The composition of two quadratics can be a degree-4 polynomial, so this is not a category).
2. Suppose we have three objects $$A, B, C$$, identity morphisms $$\operatorname{id}_A, \operatorname{id}_B, \operatorname{id}_C$$, and the only other two morphisms in the "category" are $$A \to B$$ and $$B \to C$$. Then no matter how composition is defined, this can never be a category, since composing those two morphisms should have given us a morphism $$A \to C$$.
• That clears a lot up! So from the answer I gather that morphisms aren't exactly like maps and don't "morph" one object into an other (as evidenced by the category of natural numbers)? Feb 21, 2020 at 20:42
• @Chandrahas That's right, a category can be whatever you want, as long as it obeys the axioms. It is true that many categories we commonly work in are so-called "concrete categories", meaning the objects are based on sets and the maps are based on functions. Feb 21, 2020 at 22:55

Your set of morphisms between two vector spaces $$V$$ and $$W$$ could be the set $$\{x: x \text{ is a red fruit that grows in spain}\}$$ and you would still get a category if you manage to define composition. It can literally be any set you want as long as you define what it means to compose two morphisms. You can't prove that any category with objects given by vector spaces has linear maps as morphisms. Your set of morphisms between two objects has no relation to functions in general. That's the power of category theory. And yes your definitions get the gist of it right, the composition has to be associative aswell though, i.e $$(f \circ g) \circ h = f \circ (g \circ h)$$ but those are the only requirements.

Most oftenly we require that $$\text{Hom}(x,y)$$ (the class of morphisms between two objects $$x$$ and $$y$$) is a set but category theorists usually don't really give a crap about size restrictions in my experience. If you want to explicitly say that $$\text{Hom}(x,y)$$ has to be a set for all $$x,y$$ then you say that your category is locally small.

A category $$\mathcal C$$ has objects and morphisms. Nothing is said a priori about the nature of the objects. Given a pair $$(A, B)$$ of objects of $$\mathcal C$$, there exists a set $$\mathrm{Hom}(A, B)$$ of morphisms from $$A$$ to $$B$$. Note that $$f$$ is a morphism of $$A$$ in $$B$$ by using the diagram $$f: A \longrightarrow B$$ or by writing $$f\in \mathrm{Hom}(A, B)$$. The following conditions are required for the morphisms of a category.

1. If $$f$$ is a morphism of $$A_1$$ to $$A_2$$ and $$g$$ is a morphism of $$A_2$$ to $$A_3$$, there is a composition morphism, denoted $$gf$$, of $$A_1$$ to $$A_3$$.

2. If $$f$$ is a morphism from $$A_1$$ to $$A_2$$, $$g$$ is a morphism from $$A_2$$ to $$A_3$$ and h is a morphism from $$A_3$$ to $$A_4$$, then we have $$(hg)f = h(gf)$$.

3. For every object $$A$$ there exists a morphism $$e: A \rightarrow A$$, called the identity of $$A$$, such that for any morphism $$f: B \rightarrow A$$ we have $$ef = f$$ and for any morphism $$g: \rightarrow B$$ we have $$ge = g$$.

• Category $$\mathrm{Ens}$$ of sets. The objects are the sets and the morphisms of $$A$$ in $$B$$ are the applications of $$A$$ in $$B$$. The identity of $$A$$ is the identity application defined by $$e(x) = x$$ for any element x of $$A$$.

• Category whose objects are the numbers $$1, 2, 3.$$ Morphisms other than identities are $$u: 1 \rightarrow 2, v: 2 \rightarrow3$$ and $$w: 1 \rightarrow3.$$ The morphisms $$u$$ and $$v$$ are composable and we necessarily $$vu = w$$ because $$w$$ is the only morphism going from $$1$$ to $$3.$$

• We can think of it as a transformation. For example, the "mincer" morphism that transforms cow into a minced steak, which can be represented as follows:

$$\mathrm{Cow} \longrightarrow \mathrm{Steak}.$$