Lecture 1: Categories





Write-up of the Lecture (notes for reflection - feel free to interact via comments):

1.1. Directed Graphs

The goal of this lecture is to define what a category is and to give examples of categories. To explain what a category is, first let us revisit the notion of a directed graph. The latter is a collection of objects, called vertices of the directed graph, and directed edges (represented as arrows) connecting them. Here is an example:
This directed graph has four vertices and various arrows between them. Note that in our notion of a directed graph we allow there to be multiple arrows/edges connecting the same pair of vertices, and even arrows that loop in the same vertex. The contour around the diagram of points and arrows signifies that we want to think of the multitude of constituents of a directed graph (the vertices, the arrows, and the data of which arrow start and ends with which vertex) as a single entity. There can thus be many different directed graphs. Here is another one:
Both of these directed graphs are randomly generated, and do not necessarily encode any useful information about any subject matter. Well, maybe they do, but at least, we do not know whether this is the case or not. Let us then give a more meaningful example of a directed graph. In the following directed graph
the vertices are numbers one to six, and an edge represents the relation of divisibility: a number is connected with another number if, and only if, the second number is divisible by the first number. Notice a curious phenomenon: number one has an arrow going to every other vertex!

1.2. Composition of Functions

Comparing the three directed graphs considered above, we may notice two properties of the third graph that are not shared by the first two graphs. The first property is that between any two vertices there is at most one edge. This is true for the third directed graph, but not for the first two. The second is that in the third graph, whenever we have two arrows that sort-of "chain up", there is always a third arrow that connects the start of the chain with the end:
This is of course because if one number ("c") is divisible by another number ("b"), and that other number ("b") is divisible by yet another number ("a"), then the first number ("c") will be divisible by the third number ("a") -- a fact we know already from school. When we will define a category, we will see how the first of these two properties will be abandoned (we will allow possibly multiple morphisms between two given vertices) and how the second property will be turned into additional information that the directed graph needs to come with: the information of selecting, out of several possible arrows from "a" to "c", one that is linked with a given chain of arrows starting with "a", ending with "c", and passing through "b". To give an illustration for the need of such selection, we will now consider yet another directed graph.

In the directed graph we are about to consider (for which we will no longer give a complete drawing), there will be only one vertex given by the set of real numbers (the entire set is seen as a single object here). The edges or the arrows will be real-valued functions with the domain being the set of all real numbers. We could have actually considered not just the set of real numbers, but arbitrary sets as well, along with the set of real numbers, and then arrows being arbitrary functions between these sets. For now, however, we will just stick with one vertex -- the set of real numbers. Consider two specific arrows in this directed graph, labeled by "f" and "g":
Suppose they are the functions defined as follows:

Of course, many more functions exist than just these two -- our directed graph will in fact have infinitely many arrows (which is the reason why chose not to give a complete drawing of it). It is just that, at this moment, we are only talking about two of them -- the functions "f" and "g" defined above. As a third arrow that "connects" the chain,
we will choose, out of infinitely many arrows to choose from, the function "h" which is given by composing the functions "f" and "g":
This process of choosing a third arrow for given two arrows, which in this particular case is given by the familiar idea of composition of functions, is an additional data that we want to append to the structure of a directed graph: a category will be defined as a directed graph that comes together with such additional data. Note that a directed graph alone does not "know" how the composites are to be defined. We need to specify this as an additional piece of information. To illustrate this idea more vividly, let us consider again some meaningless directed graph, in the next example.

1.3. Abstract Composition

Consider the following directed graph:
In this directed graph we have two objects (aka vertices), "U" and "V". There are four arrows, represented by the numbers from three to six. What we will now do is to draw up some random way of composing the arrows. Note however that an arrow is only allowed to be composed with another when the target of the first arrow matches with the source of the second. Let us specify some random rule of composition using the following table, which resembles a "multiplication table" from school:
According to this table, the composite of the arrow "3" with the arrow "4" (these arrows are indeed composable since the target of "3" matches with the source of "4"), is equal to the arrow "6". In general, the rule for the arrangement of the composite relative to the arrangement of the arrows used to create the composite, is as shown on the following picture
which is similar to the picture we had previously, with "g" and "f" being functions. The composite of the two arrows, "f" and "g", is written with a little circle between them and note also that the order in which "g" and "f" appear in the composite is opposite to the order in which the arrows appear on the diagram (reading from left to right). The picture above shows that the source of the composite must match with the source of the first arrow (when read from left to right in the diagram), which in this case is the arrow "f", while the target of the composite must match with the target of the second arrow "g". This rule is satisfied throughout all composites defined by the table above. 

By the way, we read out composites from the table above as follows: for a row with label "f" and a column with label "g", the cell where this row and column meet has in it the composite of "f" and "g". Some of the cells are crossed out because not every two arrows can be composed. Only those can be composed where the target of "f" matched with the source of "g". Remember that we are working still with the directed graph displayed just before the table. This table represents a sample data of composites in a directed graph. Apart from the restrictions on sources and targets discussed above, we have full freedom to decide how to complete such table. Thus, for instance, currently the composite of "3" and "4" is defined to be "6", but we could have instead defined it to be "4", since it would not violate the restrictions on sources and targets of composed arrows just described.  

1.4. The Definition of a Category

We should now be ready to define what a category is. A category is a directed graph that comes together with a table such as the one shown above, which gives values for all allowed composites (i.e., composites of pairs of arrows where the target of the first arrow matches with the source of the other). We say in this case that the directed graph is equipped with a rule of composition. Note that there could be multiple rules of composition for the same directed graph: in other words, the directed graph, in general, does not determine composition. Composition of arrows needs to be specified separately to specifying the directed graph. Moreover, composition needs to be fully described: we cannot have an uncertainty as to whether a composite of two arrows is or is not a given arrow. Just like in a directed graph it must be given exactly what the vertices and the arrows of the graph are (achieved by e.g., drawing the directed graph), so it must be given in a directed graph equipped with composition what are the composites of all composable pairs of arrows (achieved by e.g., a composition table). In the example considered above, this was indeed so, since we did not leave any cell in the table blank (except those where formation of a composite was illegal due to source-target mismatch of the arrows). Now, a category is not just any directed graph equipped with composition. Composition needs to satisfy two properties (axioms) in order for a directed graph with composition to be a category. We will discuss these two properties below.

The first axiom of a category says that composition must be associative, meaning that the following equality must always hold:  
We must be a bit careful here. Recall that composites are only defined when arrows being composed match in a chain: the first arrow has target matching with the second arrow. Examining the following picture we can get convinced that if the composites of the left side of the equality are defined, so will be composites of the right side of the equality:
The same picture shows that the two sides of the equality will be defined precisely when "f", "g" and "h" are arranged as shows on the picture: the target of "f" is the source of "g" and the target of "g" is the source of "h". The first axiom of a category requires that in every such case, the two arrows arising by compositions shown by the two sides of the equality above must be the same arrow (hence the equality). So the top-most arrow in every instance of the diagram above must equal to the bottom-most arrow.

The second axiom of a category requires there to be, for every object, a special arrow that loops in that object (i.e., its source and target both match with the object), which is written by writing number one "1" and the name of the object as its subscript:
This special arrow, which must exist individually for every object "X", must in addition have the following property. For every arrow "e" with "X" as the target and for every arrow "f" with "X" as the source, as shown on the diagram
we must have that composing "e" with the special arrow gives us back "e" and composing the special arrow with "f" gives us back "f". In other words, we must have the following equalities:
A category is a directed graph equipped with composition which satisfied the two axioms stated above.

1.5. An Example of a Category

An obvious example of a category is given by a directed graph with only one vertex, whose arrows (which are forced to be looping arrows) are the positive natural numbers. But recall that it is not enough to know what the objects and the arrows are, we also need to know how composition is defined. In the example we have in mind, composition is the usual multiplication of numbers. Thus,
Then the first axiom, associativity of composition, becomes the law of associativity of multiplication, which we know to hold already from school. As for the second axiom, since there is only one object, call it, say "X", we need to specify exactly one special arrow. This arrow needs to be a number such that any other number times that number gives back that other number. We know from school, once again, that the number one is indeed such number. So, since such special arrow exists for the unique object in the given directed graph with composition, we get that the second axiom holds for it as well. Therefore, this directed graph with composition is a category. What happens if instead of multiplication we use addition? We leave this for some other time.

1.6. Breaking the Axioms of a Category

Let us check whether the two axioms of a category hold or not for the example we gave above, where composition was described by a table. In that example, our directed graph was the following:
Composition was given by the following table:
The first axiom breaks, as the following calculation shows:
If we look at the middle part of this series of equalities, we need to have the left hand side triple composite to equal to the right hand side triple composite by the first axiom. But they are not equal since the left hand side works out to equal the arrow "4", while the right hand side works out to equal "6" (we can use the table to carry our the calculations shows). The second axiom breaks as well. Indeed, the only looping arrow that the object "U" has is the arrow "3", so if there is a special looping arrow (and there must be by the second axiom), then it must be "3". But if "3" was special, its composite with "4" must equal "4" -- according to the table, however, it is equal to "6". 

1.7. Conclusion

In this lecture we gave the definition of a category as a collection of three items: a directed graph, composition, and two axioms. Each of these three pieces of information are independent of each other: we may have a directed graph without any specified composition, or there could be several ways of specifying composition on the same directed graph (which would then result in different categories, even though those categories will share the same directed graph). Also, we saw that we can have composition that satisfies axioms, and we can also have a composition that does not satisfy the axioms. When a directed graph is given, and composition is specified in such a way that the two axioms hold, then we have a category. When one of these items is missing, we do not have a category. Note also that if we change either the directed graph or the composition, even if the change is minor, we get a different category -- in other words, an individual category is determined by the pairing of the data of a directed graph and composition (satisfying the axioms). We saw one example of a directed graph equipped with composition that was not a category and one example that was. Some of the earlier directed graphs we considered, namely the one given by the divisibility relation and the one given by functions, can actually be turned into categories by equipping them with composition that was hinted on during the discussion of these examples -- we shall come back to these examples at the next lecture.

Comments

  1. What is wrong with 3 == 1u; 6 = 4 ° 3 = 4 ° 1u = 4 ? Josef

    ReplyDelete
    Replies
    1. Nothing is wrong with that. This argument shows that if we assume 3=1u then it follows that 6=4. Since 6=4 is false, this means that our initial assumption 3=1u is false. In other words, the argument you give is a proof (by contradiction) that 3=1u is false.

      Delete
    2. What I said above is of course under the base assumption that 6 and 4 do represent different arrows in the directed graph and that composition is defined as specified by the table. If we change the first part of this base assumption to 3=1u, then the argument that you give shows us that 6 and 4 must be the same arrow in the directed graph. As with all other situations in mathematics, the meaning of calculations depends very much on the base (hidden) assumptions. A lot of obstacles and confusion in mathematics arises from not having clarified what the base assumptions are. The notion of "base assumption(s)" in mathematics/logic is similar to the notion of "frame of reference" in physics.

      Delete

Post a Comment

Popular posts from this blog

Lecture 4: Natural Transformations

Lecture 2: Products