Introduction to Category Theory
Total Page:16
File Type:pdf, Size:1020Kb
Introduction to Category Theory David Holgate & Ando Razafindrakoto University of Stellenbosch June 2011 Contents Chapter 1. Categories 1 1. Introduction 1 2. Categories 1 3. Isomorphisms 4 4. Universal Properties 5 5. Duality 6 Chapter 2. Functors and Natural Transformations 8 1. Functors 8 2. Natural Transformations 12 3. Functor Categories and the Yoneda embedding 13 4. Representable Functors 14 Chapter 3. Special Morphisms 16 1. Monomorphisms and Epimorphisms 16 2. Split and extremal monomorphisms and epimorphisms 17 Chapter 4. Adjunctions 19 1. Galois connections 19 2. Adjoint Functors 20 Chapter 5. Limits and Colimits 23 1. Products 23 2. Pullbacks 24 3. Equalizers 26 4. Limits and Colimits 27 5. Functors and Limits 28 Chapter 6. Subcategories 30 1. Subcategories 30 2. Reflective Subcategories 31 3 1. Categories 1. Introduction Sets and their notation are widely regarded as providing the “language” we use to express our mathematics. Naively, the fundamental notion in set theory is that of membership or being an element. We write a ∈ X if a is an element of the set X and a set is understood by knowing what its elements are. Category theory takes another perspective. The category theorist says that we understand what mathematical objects are by knowing how they interact with other objects. For example a group G is understood not so much by knowing what its elements are but by knowing about the homomorphisms from G to other groups. Even a set X is more completely understood by knowing about the functions from X to other sets, f : X → Y . For example consider the single element set A = {?}. If we understand A by considering elements, we could say that A has an element (∃ a ∈ A) and this element is unique (a, b ∈ A ⇒ a = b). On the other hand, using functions we could say that for all sets X there exists a unique X → A. When understanding groups or sets, for example, category theorists looks at the homomorphisms f G →h H (not the groups) or the functions X → Y (not the sets) as fundamental. We study the “arrows” and the question we ask is, “How much of our mathematics can we formulate and understand using only arrows?” The answer to this question is both elegantly simple and remarkably deep. It is given by Category Theory – “the algebra of arrows”. 2. Categories One of the simplest algebraic structures is a monoid (M, ◦, e), a set M with an associative binary multiplication and two-sided identity. (A monoid can be thought of as a “group without inverses”. For a, b ∈ M the product a ◦ b ∈ M and for any a ∈ M, a ◦ e = a = e ◦ a.) It is this algebraic structure that we adopt for our algebra of arrows. The principal difference between a monoid and a category is that multiplication of arrows, which is modeled on the composition of functions, is only possible if one arrow follows another. Thus 1 Section 2. Categories Page 2 for the arrows below f ) # h A B c g we can multiply f ◦ g, g ◦ f, h ◦ g and f ◦ h. But g ◦ h and h ◦ f, for example, are not defined. A category is like a monoid, but with a number of “nodes”. Definition 2.1. A category C (with components (Ob, hom, ◦, 1)) consists of: (1) A collection Ob C of C-objects. (2) For each pair A, B ∈ Ob C a set homC(A, B) of C-arrows or C-morphisms from A to f B. A morphism f ∈ homC(A, B) is usually denoted f : A → B or A → B. (3) For any A, B, C ∈ Ob C and pair of arrows f ∈ homC(A, B) and g ∈ homC(B, C), the composition g ◦ f ∈ homC(A, C) f g A / B / C : g◦f (4) For each A ∈ Ob C an identity arrow 1A ∈ homC(A, A) Subject to the following conditions: • Composition ◦ is associative. • For any arrow f ∈ homC(A, B), f ◦ 1A = f = 1B ◦ f. • If the pairs of objects (A, B) 6= (C, D) then homC(A, B) ∩ homC(C, D) = ∅. f Implicit in the definition of hom-sets is the fact that any arrow A → B in C begins at an object, the domain of f (dom(f) = A) and ends at another object, the codomain of f (cod(f) = B). The composition g ◦ f is well-defined only if dom(g) = cod(f). Examples 2.2. (1) Any monoid (M, ◦, e) is a category C – an algebra of arrows. Thus the elements of M are the arrows and the category has only one object, which we call ?. Then homC(?, ?) = M and 1? = e. ? a∈M g (2) A pre-ordered set (X, ≤) is a set equipped with a reflexive and transitive binary relation ≤. Such a (X, ≤) is a category C. In this case Ob C = X and for a, b ∈ X, homC(a, b) has exactly one element iff a ≤ b. Section 2. Categories Page 3 These two examples demonstrate two aspects of a category. On the one hand a category can be viewed as a generalised monoid with composition of arrows the algebraic operation. On the other hand a category is a generalised pre-ordered set with the arrows showing how the objects of the category relate to each other. (3) There are a number of categories which group together particular mathematical struc- tures. Can you name the obvious arrows or morphisms of the categories with the fol- lowing objects? What are the identities and what is composition? • Set – objects sets. • Grp – objects groups. • Top – objects topological spaces. • Met – objects metric spaces. • VecK – objects finite dimensional vector spaces over a field K. • Mon – objects monoids. • Pre – objects pre-ordered sets. (4) Let K be a field. We define a category Mat(K) with objects the natural numbers N and arrows A : n → m, n × m matrices with coefficients in K. Composition is matrix multiplication and for each n ∈ N, 1n is the n ×n identity matrix. (How is this category related to the category VecK above?) 2.1. Some remarks on notation. One of the most useful and pleasant aspects of category theory is the notation. Arrow diagrams provide pictures which explain definitions and proofs. This provides a concise and clear overview of categorical reasoning and a well drawn arrow diagram can make a proof or definition very easy to follow. (As they say, “A picture is worth a thousand words.”) A diagram such as the one below commutes if all the possible arrow compositions with the same domain and codomain are equal. f A / B ~ ~ ~ d ~ g ~ k ~ ~ ~ ~ h C / D That is if k ◦ f = h ◦ g, d ◦ f = g and h ◦ d = k. In other words a commutative diagram is a collection of equations. Section 3. Isomorphisms Page 4 Often we are lazy and omit the ◦ when writing composition, unless the context requires some clarity. So the above equations could be written as kf = hg, df = g and hd = k. The broken line for the arrow d is a notation used to indicate the mathematical sentence “there exists an arrow d”. Thus the above commutative diagram would be understood to say, “If kf = hg then there exists an arrow d such that df = g and hd = k.” Exercises 2.3. (1) Show that there are two possible categories with one object and two morphisms. Can you represent these categories using a set and functions on the set? (2) Show that there are exactly 11 different categories with three morphisms. (3) Consider the category generated by the two arrows f : X → Y and g : Y → X satisfying the relations fgfg = fg gfgf = idX . Show that the category has at most 5 arrows. (4) Express the associativity of the composition and the property of identity arrows in the definition of a category in terms of commuting diagrams. (5) For a set X, show that the power set P(X) can be viewed as a category where a morphism A → B means A ⊆ B. (6) Given a category C and a fixed object A ∈ Ob C, the category of objects over A, written (C ↓ A), is defined as follows: (a) Objects are pairs (X, f) where f : X → A is a morphism in C. (b) Morphisms h :(X, f) → (Y, g) are C-morphisms h : X → Y such that gh = f. Verify that (C ↓ A) is a category. (It will help to draw diagrams.) 3. Isomorphisms Two mathematical objects are considered to be isomorphic if they are indistinguishable in some sense. For instance the sets {a, b} and {x, y} are isomorphic because they are both two-element sets. Similarly the real intervals (0, 1) and (0, 2) are topologically isomorphic, the one is a continuous scaling of the other. From the point of view of category theory such isomorphic objects cannot be distinguished by using morphisms or arrows. Definition 3.1. The morphism f : A → B is an isomorphism if there exists a g : B → A such that gf = 1A and fg = 1B. The morphism g is an inverse of f. Two objects A and B are isomorphic if there is an isomorphism f : A → B. In this case we write A ∼= B. Section 4. Universal Properties Page 5 Proposition 3.2. (1) Inverses are unique, i.e. if both g and h are inverses of f, then g = h. For this reason if f has an inverse we write it as f −1. (2) Inverses are isomorphisms, i.e. if f has an inverse f −1 then f −1 is an isomorphism.