# Limits in the category of graphs

This is a first post about some categorical properties of graphs (there might be a few more).

Definition. For us, a graph is a pair where is a set and is a collection of subsets of of size or . An element with is called an edge from to , and a singleton is a loop at (or sometimes an edge from to itself). If , it is customary to write and .

A morphism of graphs is a map such that for all . The category of graphs will be denoted , and will be called the forgetful functor.

Example. The complete graph on vertices is the graph where and is the set of -element subsets of . In other words, there is an edge from to if and only if .

Then a morphism is exactly an -colouring of : the condition for forces whenever and are adjacent. Conversely, a morphism to a graph without loops is exactly an -clique in : the condition that has no loops forces for .

Lemma. The category has and the forgetful functor preserves all small limits.

Proof. Let be a functor from a small category , and let be the limit of the underlying sets, with cone maps . We will equip with a graph structure such that the maps for are morphisms and then show that the constructed is a limit of in .

To equip with an edge set , simply let be the set of of size or such that for all . Then this clearly makes into a graph such that the are graph morphisms for all . Moreover, these maps make into the limit cone over : for any other cone , the underlying maps factor uniquely through by the definition of , and the construction of shows that is actually a morphism of graphs .

Remark. Note however that does not create limits. On top of the construction above, this would mean that there is a unique graph structure on such that is a cone over . However, there are many such structures on , because we can remove edges all we want (on the same vertex set ).

Example. As an example, we explicitly describe the product of two graphs and : by the lemma its vertex set is . The ‘largest graph structure’ such that both projections and are graph morphisms is given by if and only if and and . This corresponds to the structure found in the proof of the lemma.

For a very concrete example, note that the product of two intervals/edges is a disjoint union of two intervals, corresponding to the diagonals in . This is the local model to keep in mind.

The literature also contains other types of product graphs, which all have the underlying set . Some authors use the notation for the categorical product or tensor product we described. The Cartesian product is defined by , so that the product of two intervals is a box. The strong product is the union of the two, so that the product of two intervals is a box with diagonals. There are numerous other notions of products of graphs.

Remark. Analogously, we can also show that has and preserves all small colimits: just equip the set-theoretic colimit with the edges coming from one of the graphs in the diagram.

Example. For a concrete example of a colimit, let’s carry out an edge contraction. Let be a graph, and let be an edge. The only way to contract in our category is to create a loop: let be the one-point graph without edges, and let be the maps sending to and respectively. Then the coequaliser of the parallel pair is the graph whose vertices are , where is the equivalence relation if and only if or , and whose edges are exactly the images of edges in . In particular, the edge gives a loop at the image .

Remark. Note that the preservation of limits also follows since has a left adjoint: to a set we can associate the discrete graph with vertex set and no edges. Then a morphism to any graph is just a set map .

Similarly, the complete graph with loops gives a right adjoint to , showing that all colimits that exist in must be preserved by . However, these considerations do not actually tell us which limits or colimits exist.

# Scales containing every interval

This is a maths/music crossover post, inspired by fidgeting around with diatonic chords containing no thirds. The general lemma is the following (see also the examples below):

Lemma. Let be a positive integer, and a subset containing elements. Then every occurs as a difference between two elements .

Proof. Consider the translate . Since both and have size , they have an element in common. If , then for some , so .

Here are some applications to music theory:

Example 1 (scales containing every chromatic interval). Any scale consisting of at least out of the available chromatic notes contains every interval. Indeed, , so the lemma shows that every difference between two elements of the scale occurs.

The above proof in this case can be rephrased as follows: if we want to construct a minor third (which is semitones) in our scale , we consider the scale and its transpose by a minor third. Because , there must be an overlap somewhere, corresponding to an interval of a minor third in our scale.

In fact, this shows that our scale must contain two minor thirds, since you need at least overlaps to get from down to . For example, the C major scale contains two minor seconds (B to C and E to F), at least two major thirds (C to E and G to B), and two tritones (B to F and F to B).

The closer the original key is to its transpose, the more overlaps there are between them. For example, there are major fifths in C major, since C major and G major overlap at 6 notes. Conversely, if an interval occurs many times in a key , that means that the transposition of by the interval has many notes in common with the old key . (Exercise: make precise the relationship between intervals occurring ‘many times’ and transpositions having ‘many notes in common’.)

We see that this argument is insensitive to enharmonic equivalence: it does not distinguish between a diminished fifth and an augmented fourth. Similarly, a harmonic minor scale contains both a minor third and an augmented second, which this argument does not distinguish.

Remark. We note that the result is sharp: the whole-tone scales and have size , but only contain the even intervals (major second, major third, tritone, minor sixth, and minor seventh).

Example 2 (harmonies containing every diatonic interval). Any cluster of notes in a major or minor scale contains every diatonic interval. Indeed, modelling the scale as integers modulo , we observe that , so the lemma above shows that every diatonic interval occurs at least once.

For example, a seventh chord contains the notes¹ of the key. It contains a second between and , a third between and , a fourth between and , etcetera.

Thus, the largest harmony avoiding all (major or minor) thirds is a triad. In fact, it’s pretty easy to see that such a harmony must be a diatonic transposition of the sus4 (or sus2, which is an inversion) harmony. But these chords may contain a tritone, like the chord B-F-G in C major.

Example 3. If you work with your favourite -tone tuning system, then any scale consisting of at least of those notes contains every chromatic interval available in this tuning.

# Epimorphisms of groups

In my previous post, we saw that injections (surjections) in concrete categories are always monomorphisms (epimorphisms), and in some cases the converse holds.

We now wish to classify all epimorphisms of groups. To show that all epimorphisms are surjective, for any strict subgroup we want to construct maps to some group that differ on but agree on . In the case of abelian groups this is relatively easy, because we can take to be the cokernel, the quotient map, and the zero map. But in general the cokernel only exists if the image is normal, so a different argument is needed.

Lemma. Let be a group homomorphism. Then is an epimorphism if and only if is surjective.

Proof. We already saw that surjections are epimorphisms. Conversely, let be an epimorphism of groups. We may replace by its image in , since the map is still an epimorphism. Let be the coset space, viewed as a pointed set with distinguished element . Let be the set “ with the distinguished point doubled”, and write and for these distinguished points.

Let be the symmetric group on , and define homomorphisms by letting act naturally on the copy of in (for ). Since the action of on fixes the trivial coset , we see that the maps agree. Since is an epimorphism, this forces . But then

showing that is surjective (and a fortiori ).

Note however that the result is not true in every algebraic category. For example, the map is an epimorphism of (commutative) rings that is not surjective. More generally, every localisation is an epimorphism, by the universal property of localisation; these maps are rarely surjective.

# Concrete categories and monomorphisms

This post serves to collect some background on concrete categories for my next post.

Concrete categories are categories in which objects have an underlying set:

Definition. A concrete category is a pair of a category with a faithful functor . In cases where is understood, we will simply say is a concrete category.

Example. The categories of groups, of topological spaces, of rings, and of -modules are concrete in an obvious way. The category of sheaves on a site with enough points is concrete by mapping a sheaf to the disjoint union of its stalks (the same holds for any Grothendieck topos, but a different argument is needed). Similarly, the category of schemes can be concretised by sending to , where is the contravariant power set functor.

Today we will study the relationship between monomorphisms and injections in :

Lemma. Let be a concrete category, and let be a morphism in . If is a monomorphism (resp. epimorphism), then so is .

Proof. A morphism in is a monomorphism if and only if the induced map is injective. Faithfulness implies that the vertical maps in the commutative diagram

are injective, hence if the bottom map is injective so is the top. The statement about epimorphisms follows dually.

For example, this says that any injection of groups is a monomorphism, and any surjection of rings is an epimorphism, since the monomorphisms (epimorphisms) in are exactly the injections (surjections).

In some concrete categories, these are the only monomorphisms and epimorphisms. For example:

Lemma. Let be a concrete category such that the forgetful functor admits a left (right) adjoint. Then every monomorphism (epimorphism) in is injective (surjective).

Proof. If is a right adjoint, it preserves limits. But is a monomorphism if and only if the square

is a pullback. Thus, preserves monomorphisms if it preserves limits. The statement about epimorphisms is dual.

For example, the forgetful functors on algebraic categories like , , and have left adjoints (a free functor), so all monomorphisms are injective.

The forgetful functor has adjoints on both sides: the left adjoint is given by the discrete topology, and the right adjoint by the indiscrete topology. Thus, monomorphisms and epimorphisms in are exactly injections and surjections, respectively.

On the other hand, in the category of Hausdorff topological spaces, the inclusion is an epimorphism that is not surjective. Indeed, a map to a Hausdorff space is determined by its values on .

# Classification of compact objects in Top

In my previous post, I showed that compact objects in the category of topological spaces have to be finite. Today we improve this to a full characterisation.

Lemma. Let be a topological space. Then is a compact object in if and only if is finite discrete.

This result dates back to Gabriel and Ulmer [GU71, 6.4], as was pointed out to me by Jiří Rosický in reply to my MO question and answer of this account (of which this post is essentially a retelling). Our proof is different from the one given in [GU71], instead using a variant of an argument given in the n-Lab.

Before giving the proof, we construct an auxiliary space against which we will be testing compactness. It is essentially the colimit constructed in the n-Lab, except that we swapped the roles of and (the reason for this will become clear in the proof).

Definition. For all , let be the topological space , where the nonempty open sets are given by for . They form a topology since

Define the map by

This is continuous since equals if and if . Let be the colimit of this diagram.

Since the elements map to the same element in , we conclude that is the two-point space , where the map is the second coordinate projection. Moreover, the colimit topology on is the indiscrete topology. Indeed, neither nor are open.

Proof of Lemma. If is compact, then my previous post shows that is finite. Let be any subset, and let be the indicator function . It is continuous because has the indiscrete topology. Since is a compact object, has to factor through some . Let be the first coordinate projection, i.e.

Let be a number such that for all ; this exists because is finite. Then , which shows that is open. Since was arbitrary, we conclude that is discrete.

Conversely, every finite discrete space is a compact object. Indeed, any map out of is continuous, and finite sets are compact in .

[GU71] Gabriel, Peter and Ulmer, Friedrich, Lokal präsentierbare Kategorien. Lecture Notes in Mathematics 221. Springer-Verlag, Berlin-New York, 1971. DOI: 10.1007/BFb0059396.

# A fun example of a representable functor

This post is about representable functors:

Definition. Let be a functor. Then is representable if it is isomorphic to for some . In this case, we say that represents .

Exercise. If such exists, then it is unique up to unique isomorphism.

Really one should encode the isomorphism as well, but this is often dropped from the notation. By the Yoneda lemma, every natural transformation is uniquely determined by the element of corresponding to the identity of .

When is a natural isomorphism, the corresponding element is called the universal object of . It has the property that for every and any , there exists a unique morphism such that .

Example. The forgetful functor is represented by . Indeed, the natural map

is an isomorphism. The universal element is .

Example. Similarly, the forgetful functor is represented by . The universal element is .

A fun exercise (for the rest of your life!) is to see whether functors you encounter in your work are representable. See for example this post about some more geometric examples.

The main example for today is the following:

Lemma. The functor that associates to a topological space its topology is representable.

Proof. Consider the topological space with topology . Then there is a natural map

Conversely, given an open set , we can associate the characteristic function . This gives an inverse of the map above.

The space we constructed is called the Sierpiński space. The universal open set is .

Remark. The space represents the data of open sets for : for any continuous map , we have , where . If denotes the complementary open, then the form a cover of if and only if . This corresponds to the statement that lands in .

Thus, the open cover is the universal open cover, i.e. for every open covering there exists a unique continuous map such that .

# Cardinality of fraction field

This is a ridiculous lemma that I came up with.

Lemma. Let be a (commutative) ring, and let be its total ring of fractions. Then and have the same cardinality.

Proof. If is finite, my previous post shows that . If is infinite, then is a subquotient of , hence . But injects into , so .

Corollary. If is a domain, then .

Proof. This is a special case of the lemma.