Basic Category Theory

Similar documents
Category Theory. Course by Dr. Arthur Hughes, Typset by Cathal Ormond

1 Categories, Functors, and Natural Transformations. Discrete categories. A category is discrete when every arrow is an identity.

LIMITS AND COLIMITS. m : M X. in a category G of structured sets of some sort call them gadgets the image subset

GENERAL ABSTRACT NONSENSE

Category Theory. Travis Dirle. December 12, 2017

Boolean Algebra and Propositional Logic

CATEGORIES. 1.1 Introduction

CATEGORY THEORY. Cats have been around for 70 years. Eilenberg + Mac Lane =. Cats are about building bridges between different parts of maths.

Joseph Muscat Categories. 1 December 2012

Boolean Algebra and Propositional Logic

HSP SUBCATEGORIES OF EILENBERG-MOORE ALGEBRAS

Category Theory (UMV/TK/07)

GENERALIZED ABSTRACT NONSENSE: CATEGORY THEORY AND ADJUNCTIONS

University of Oxford, Michaelis November 16, Categorical Semantics and Topos Theory Homotopy type theor

PART I. Abstract algebraic categories

An Introduction to Topos Theory

1. Introduction and preliminaries

Category Theory. Categories. Definition.

Review of category theory

From Wikipedia, the free encyclopedia

UMS 7/2/14. Nawaz John Sultani. July 12, Abstract

CONTINUITY. 1. Continuity 1.1. Preserving limits and colimits. Suppose that F : J C and R: C D are functors. Consider the limit diagrams.

Categories and Natural Transformations

Topos Theory. Lectures 21 and 22: Classifying toposes. Olivia Caramello. Topos Theory. Olivia Caramello. The notion of classifying topos

Topos Theory. Lectures 17-20: The interpretation of logic in categories. Olivia Caramello. Topos Theory. Olivia Caramello.

Algebraic Geometry

MATH 101B: ALGEBRA II PART A: HOMOLOGICAL ALGEBRA

Adjunctions! Everywhere!

University of Cape Town

FOUNDATIONS OF ALGEBRAIC GEOMETRY CLASS 2

Span, Cospan, and Other Double Categories

Categories and functors

An introduction to toposes. Richard Pettigrew Department of Philosophy University of Bristol

Some glances at topos theory. Francis Borceux

Representable presheaves

arxiv: v1 [math.ct] 28 Oct 2017

Elementary (ha-ha) Aspects of Topos Theory

A Grothendieck site is a small category C equipped with a Grothendieck topology T. A Grothendieck topology T consists of a collection of subfunctors

The denormalized 3 3 lemma

sset(x, Y ) n = sset(x [n], Y ).

C2.7: CATEGORY THEORY

THE HOMOTOPY THEORY OF EQUIVALENCE RELATIONS

(C) The rationals and the reals as linearly ordered sets. Contents. 1 The characterizing results

A brief Introduction to Category Theory

THE SNAIL LEMMA ENRICO M. VITALE

SEPARATED AND PROPER MORPHISMS

Universal Properties

Category Theory. Steve Awodey. Carnegie Mellon University

A Peter May Picture Book, Part 1

Universal Algebra for Logics

LIST OF CORRECTIONS LOCALLY PRESENTABLE AND ACCESSIBLE CATEGORIES

Lectures - XXIII and XXIV Coproducts and Pushouts

Exercises on chapter 0

LOCALIZATIONS, COLOCALIZATIONS AND NON ADDITIVE -OBJECTS

SEPARATED AND PROPER MORPHISMS

Categories and Modules

The basics of frame theory

CATEGORICAL GROTHENDIECK RINGS AND PICARD GROUPS. Contents. 1. The ring K(R) and the group Pic(R)

Elements of Category Theory

Category theory for computer science. Overall idea

An introduction to locally finitely presentable categories

GALOIS CATEGORIES MELISSA LYNN

Representation Theory of Hopf Algebroids. Atsushi Yamaguchi

Theory of Categories 1. Notes M. Grandis Laurea e Laurea Magistrale in Matematica, Genova.

FUNCTORS AND ADJUNCTIONS. 1. Functors

MISHA GAVRILOVICH, ALEXANDER LUZGAREV, AND VLADIMIR SOSNILO PRELIMINARY DRAFT

A New Category for Semantics

MADE-TO-ORDER WEAK FACTORIZATION SYSTEMS

Algebras of Deductions in Category Theory. 1 Logical models from universal algebra

Topological algebra based on sorts and properties as free and cofree universes

Lecture 9: Sheaves. February 11, 2018

What s category theory, anyway? Dedicated to the memory of Dietmar Schumacher ( )

Lectures on Homological Algebra. Weizhe Zheng

On the normal completion of a Boolean algebra

Equational Logic. Chapter Syntax Terms and Term Algebras

Category Theory for Linear Logicians

arxiv: v2 [math.ct] 27 Dec 2014

A Fibrational View of Geometric Morphisms

SJÄLVSTÄNDIGA ARBETEN I MATEMATIK

Math 248B. Base change morphisms

ALGEBRAIC GEOMETRY COURSE NOTES, LECTURE 9: SCHEMES AND THEIR MODULES.

MATH 101B: ALGEBRA II PART A: HOMOLOGICAL ALGEBRA 23

Assume the left square is a pushout. Then the right square is a pushout if and only if the big rectangle is.

Algebraic Geometry Spring 2009

Limit Preservation from Naturality

The equivalence axiom and univalent models of type theory.

Symbol Index Group GermAnal Ring AbMonoid

A GLIMPSE OF ALGEBRAIC K-THEORY: Eric M. Friedlander

Algebraic Theories of Quasivarieties

ON THE CONSTRUCTION OF LIMITS AND COLIMITS IN -CATEGORIES

Real-cohesion: from connectedness to continuity

ESSENTIALLY ALGEBRAIC THEORIES AND LOCALIZATIONS IN TOPOSES AND ABELIAN CATEGORIES

Boolean Algebras, Boolean Rings and Stone s Representation Theorem

VALUATIVE CRITERIA FOR SEPARATED AND PROPER MORPHISMS

Math 216A. A gluing construction of Proj(S)

III A Functional Approach to General Topology

Dual Adjunctions Between Algebras and Coalgebras

Barr s Embedding Theorem for Enriched Categories

Algebraic Geometry Spring 2009

Descent on the étale site Wouter Zomervrucht, October 14, 2014

Transcription:

BRICS LS-95-1 J. van Oosten: Basic Category Theory BRICS Basic Research in Computer Science Basic Category Theory Jaap van Oosten BRICS Lecture Series LS-95-1 ISSN 1395-2048 January 1995

Copyright c 1995, BRICS, Department o Computer Science University o Aarhus. All rights reserved. Reproduction o all or part o this work is permitted or educational or research use on condition that this copyright notice is included in any copy. See back inner page or a list o recent publications in the BRICS Lecture Series. Copies may be obtained by contacting: BRICS Department o Computer Science University o Aarhus Ny Munkegade, building 540 DK - 8000 Aarhus C Denmark Telephone: +45 8942 3360 Teleax: +45 8942 3255 Internet: BRICS@daimi.aau.dk BRICS publications are in general accessible through WWW and anonymous TP: http:www.brics.aau.dkbrics tp tp.brics.aau.dk (cd pubbrics)

Basic Category Theory Jaap van Oosten

Jaap van Oosten BRICS 1 Department o Computer Science University o Aarhus Ny Munkegade DK-8000 Aarhus C, Denmark 1 Basic Research In Computer Science, Centre o the Danish National Research oundation.

o Preace These notes contain the material o a short course on categories I gave in Arhus in the autumn o 1994, as part o Glynn Winskel's semantics course. Later on, while writing, I added some material, but not much. The style in which they are written reects my view on category theory: it is, especially at this low level, practice rather than theory which counts. I have thereore given many proos as exercises. I you really want to get a grip on the subject, I strongly suggest you do as many o them as you can. The same goes or the examples. They are the esh and bones o the theory, and many o them have been chosen so they are a recurring theme; unctors C D may be given as examples in chapter 1, be shown to constitute an adjunction in chapter 5, while this may turn out to be a monadic situation in chapter 6. or the same reason, reerences are omitted. Even a sketchy proo, or a hint o the crucial argument, is better than an intimidating reerence to [R]. O course, the examples will be best understood by students who are amiliar with the mathematical notions involved, but in general these notes do not require a lot o mathematical background, except or some basic knowledge o groups, rings and topological spaces (although examples on the latter may be skipped, since I have not pursued them through the whole text). What I did presuppose is some amiliarity with logic and the -calculus. Although denitions are given, standard acts about substitution and the like are suppressed (a teacher can easily supply them when he gives the course). This amiliarity does not include a good understanding o set theory or even an inkling o the size problems one can run into. I've used the terms \set" and \small" wherever necessary, although I don't suppose they mean much to many students. or that reason I've also omitted a proo o reyd's Adjoint unctor Theorem and an explanation o the role o the solution set condition. Apart rom chapters 4 and 7, where in spite o the act that the results are well-known I haven't been able to nd reerences where they are treated in a concise enough orm, and so had to develop the material mysel, everything is pretty standard. I have consulted the ollowing sources: S. MacLane, Categories or the Working Mathematician, Springer (Berlin) 1971. Still the best text. or non-mathematicians it may be a little tough going, but it is worth the trouble.. Borceux, Handbook o Categorical Algebra, (Encyclopaedia o Mathematics and its Applications) Cambridge University Press (Cambridge) 1994. Next best. Gives a lot o material in a very readable style; also on specialized topics. Three volumes. i

A strange error in the denition o Grothendieck universes in the rst chapter, making the denition inconsistent, supports the point about set theory, I made beore. Many concrete examples. The reader will nd many answers to my exercises in this book. M. Barr & C. Wells, Category Theory or Computing Science, Prentice Hall (New York) 1990. At this moment out o print. The emphasis on sketches is debatable, or a rst course in the theory. Otherwise a very valuable source. P.T. Johnstone, Stone Spaces, Cambridge University Press (Cambridge) 1982. Not a book on category theory proper, but a systematic study on various dualities o the Stone type. A lot o material on posetal structures like rames, Boolean algebras etc. A. Asperti, Categorical Topics in Computer Science, Ph.D. Thesis, Pisa 1990. Later reworked into: A. Asperti & G. Longo, Categories, Types, and Structures: An Introduction to Category Theory or the Working Computer Scientist (oundations o Computing), MIT Press (Cambridge Massachusetts) 1991. M. Makkai & G. Reyes, irst Order Categorical Logic (Lecture Notes in Mathematics 611), Springer (Berlin) 1977. \The" book on categorical logic. It is my eeling that a sequel is badly needed. The main ideas are developed here. S. MacLane & I. Moerdijk, Sheaves in Geometry and Logic (Universitext), Springer 1992. Treats topos theory, with important applications to logic. Can almost be read rom scratch. J. Lambek & P. Scott, Introduction to higher order categorical logic, Cambridge University Press (Cambridge) 1986. This may very well be a book o the uture, but or a rst acquaintance with category theory the approach is too ormal or my taste. Gives a very elaborate account o the correspondences between type theories and certain types o categories. O course this list doesn't make any pretense whatsoever at being complete or even a guide into the literature. It mainly reects my personal attitude. Acknowledgements. I am grateul to the group o students who patiently and critically sat through my lectures, and in particular to Thomas Hildebrandt ii

and Sren Bgh Lassen who pointed out mistakes in my original hand-written notes. The help o my oce mate Vladi Sassone, has been invaluable. A critical reading by him o the whole rst version revealed a couple o embarassing mistakes (\the unctor (?) X also has a let adjoint", ha ha there is no limit to what a conused brain can come up with); then he put a lot o eort in the visual layout o the text, teaching me emacs and LaT E X in the process, and designed the rococo painting which is the title page. It goes without saying that the remaining errors are mine, and that the poor visual quality o the text is a testimony o my ignorance o LaT E X, which I am not proud o. Reerences [R] J. Razdajev, Some acts about unctors, Novosibirsk Journal o Diving Research XLVII (1947), pp. 634-98 (Russian) iii

iv

Contents 1 Categories and unctors 1 1.1 Denitions and examples : : : : : : : : : : : : : : : : : : : : : : : 1 1.2 Some special objects and arrows : : : : : : : : : : : : : : : : : : 6 2 Natural transormations 9 2.1 The Yoneda lemma : : : : : : : : : : : : : : : : : : : : : : : : : : 9 2.2 Examples o natural transormations : : : : : : : : : : : : : : : : 12 2.3 Equivalence o categories; an example : : : : : : : : : : : : : : : 14 3 (Co)cones and (co)limits 17 3.1 Limits : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 17 3.2 Limits by products and equalizers : : : : : : : : : : : : : : : : : 24 3.3 Colimits : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 25 4 A little piece o categorical logic 29 4.1 Regular categories and subobjects : : : : : : : : : : : : : : : : : 29 4.2 Coherent logic in regular categories : : : : : : : : : : : : : : : : : 33 4.3 The language L(C) and theory T (C) associated to a regular category C : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 38 4.4 Example o a regular category : : : : : : : : : : : : : : : : : : : : 39 5 Adjunctions 43 5.1 Adjoint unctors : : : : : : : : : : : : : : : : : : : : : : : : : : : 43 5.2 Expressing (co)completeness by existence o adjoints; preservation o (co)limits by adjoint unctors : : : : : : : : : : : : : : : : 48 6 Monads and Algebras 53 6.1 Algebras or a monad : : : : : : : : : : : : : : : : : : : : : : : : 54 6.2 T -Algebras at least as complete as D : : : : : : : : : : : : : : : : 59 6.3 The Kleisli category o a monad : : : : : : : : : : : : : : : : : : : 59 7 Cartesian closed categories and the -calculus 63 7.1 Cartesian closed categories (ccc's); examples and basic acts : : : 63 7.2 Typed -calculus and cartesian closed categories : : : : : : : : : 67 7.3 Representation o primitive recursive unctions in ccc's with natural numbers object : : : : : : : : : : : : : : : : : : : : : : : : : 70 Index 73 v

vi

Categories 1 Categories and unctors 1.1 Denitions and examples A category C is given by a class C 0 o objects and a class C 1 o arrows which have the ollowing structure. Each arrow has a domain and a codomain which are objects; one writes : X! Y or X! Y i X is the domain o the arrow, and Y its codomain. One also writes X = dom() and Y = cod(); Given two arrows and g such that cod() = dom(g), the composition o and g, written g, is dened and has domain dom() and codomain cod(g): X! Y! g Z Composition is associative, that is: given : X! Y, g : Y! Z and h : Z! W, h(g) = (hg); or every object X there is an identity arrow id X, satisying id X g = g or every g : Y! X and id X = or every : X! Y. Exercise 1. Show that id X is the unique arrow with domain X and codomain X with this property. Instead o \arrow" we also use the terms \morphism" or \map". Examples a) 1 is the category with one object and one arrow, id ; b) 0 is the empty category; c) A preorder is a set X together with a binary relation which is reexive (i.e. x x or all x 2 X) and transitive (i.e. x y and y z imply x z or all x; y; z 2 X). This can be viewed as a category, with set o objects X and exactly one arrow: x! y i x y. Exercise 2. Prove this. Prove also the converse: i C is a category such that C 0 is a set, and such that or any two objects X; Y o C there is at most one arrow: X! Y, then C 0 is a preordered set. d) A monoid is a set X together with a binary operation, written like multiplication: xy or x; y 2 X, which is associative and has a unit element e 2 X, satisying ex = xe = x or all x 2 X. Such a monoid is a category with one object, and an arrow x or every x 2 X. 1

Categories e) Set is the category which has the class o all sets as objects, and unctions between sets as arrows. Most basic categories have as objects certain mathematical structures, and the structure-preserving unctions as morphisms. Examples: ) Top is the category o topological spaces and continuous unctions. g) Grp is the category o groups and group homomorphisms. h) Rng is the category o rings and ring homomorphisms. i) Grph is the category o graphs and graph homomorphisms. j) Pos is the category o partially ordered sets and monotone unctions. Given two categories C and D, a unctor : C! D consists o operations 0 : C 0! D 0 and 1 : C 1! D 1, such that or each : X! Y, 1 () : 0 (X)! 0 (Y ) and: or X! Y g! Z, 1 (g) = 1 (g) 1 (); 1 (id X ) = id 0(X) or each X 2 C 0. But usually we write just instead o 0 ; 1. Examples. a) There is a unctor U : Top! Set which assigns to any topological space X its underlying set. We call this unctor \orgetul": it \orgets" the mathematical structure. Similarly, there are orgetul unctors Grp! Set, Grph! Set, Rng! Set, Pos! Set etcetera; b) or every category C there is a unique unctor C! 1 and a unique one 0! C; c) Given two categories C and D we can dene the product category C D which has as objects pairs (C; D) 2 C 0 D 0, and as arrows:(c; D)! (C 0 ; D 0 ) pairs (; g) with : C! C 0 in C, and g : D! D 0 in D. There are unctors 0 : C D! C and 1 : C D! D; d) Given two unctors : C! D and G : D! E one can dene the composition G : C! E. This composition is o course associative and since we have, or any category C, the identity unctor C! C, we have a category Cat which has categories as objects and unctors as morphisms. 2

1. Categories and unctors e) Given a set A, consider the set ~ A o strings a1 : : : a n on the alphabet A [ A?1 (A?1 consists o elements a?1 or each element a o A; the sets A and A?1 are disjoint and in 1-1 correspondence with each other), such that or no x 2 A, xx?1 or x?1 x is a substring o a 1 : : :a n. Given two such strings ~a = a 1 : : : a n ; ~ b = b 1 : : : b m, let ~a? ~ b the string ormed by rst taking a 1 : : :a n b 1 : : : b m and then removing rom this string, successively, substrings o orm xx?1 or x?1 x, until one has an element o ~ A. This denes a group structure on ~ A. ~ A is called the ree group on the set A. Exercise 3. Prove this, and prove that the assignment A 7! ~ A is part o a unctor: Set! Grp. This unctor is called the ree unctor. ) Every directed graph can be made into a category as ollows: the objects are the vertices o the graph and the arrows are paths in the graph. This denes a unctor rom the category Dgrph o directed graphs to Cat. The image o a directed graph D under this unctor is called the category generated by the graph D. g) Quotient categories. Given a category C, a congruence relation on C species, or each pair o objects X; Y, an equivalence relation X;Y on the class o arrows C(X; Y ) which have domain X and codomain Y, such that or ; g : X! Y and h : Y! Z, i X;Y g then h X;Z hg; or : X! Y and g; h : Y! Z, i g Y;Z h then g X;Z h. Given such a congruence relation on C, one can orm the quotient category C= which has the same objects as C, and arrows X! Y are X;Y -equivalence classes o arrows X! Y in C. Exercise 4. Show this and show that there is a unctor C! C=, which takes each arrow o C to its equivalence class. h) An example o this is the ollowing (\homotopy"). Given a topological space X and points x; y 2 X, a path rom x to y is a continuous mapping rom some closed interval [0; a] to X with (0) = x and (a) = y. I : [0; a]! X is a path rom x to y and g : [0; b]! X is a path rom y to z (t) t a there is a path g : [0; a+b]! X (dened by g(t) = ) g(t? a) else rom x to z. This makes X into a category, the path category o X, and o course this also denes a unctor Top! Cat. Now given paths : [0; a]! X, g : [0; b]! X, both rom x to y, one can dene x;y g i 3

Categories there is a continuous map : A! X where A is the area: in IR 2, such that (0; 1) (b; 1) (0; 0) (a; 0) (t; 0) = (t) (t; 1) = g(t) (0; s) = x s 2 [0; 1] (s; t) = y (s; t) on the segment (b; 1)? (a; 0) One can easily show that this is a congruence relation. The quotient o the path category by this congruence relation is a category called the category o homotopy classes o paths in X. i) let C be a category such that or every pair (X; Y ) o objects the class C(X; Y ) o arrows rom X to Y is a set (such C is called locally small). or any object C o C then, there is a unctor h C : C! Set which assigns to any object C 0 the set C(C; C 0 ). Any arrow : C 0! C 00 gives by composition a unction C(C; C 0 )! C(C; C 00 ), so we have a unctor. A unctor o this orm is called a representable unctor. j) Let C be a category and C an object o C. The slice category C=C has as objects all arrows g which have codomain C. An arrow rom g : D! C to h : E! C in C=C is an arrow k : D! E in C such that hk = g. Draw like: k D @ @ ~ @ @ @ g @ ~ ~~ @ h ~ ~~ We say that this diagram commutes i we mean that hk = g. Exercise 5. Convince yoursel that the assignment C 7! C=C gives rise to a unctor C! Cat. k) Remember that or every group (G; ) we can orm a group (G;?) by putting? g = g. C or categories the same construction is available: given C we can orm a category C op which has the same objects and arrows as C, but with reversed direction; so i : X! Y in C then : Y! X in C op. To 4 E

{ 1. Categories and unctors make it notationally clear, write or the arrow Y! X corresponding to : X! Y in C. Composition in C op is dened by: g = g Oten one reads the term \contravariant unctor" in the literature. What I call unctor, is then called \covariant unctor". A contravariant unctor rom C to D inverts the direction o the arrows, so 1 () : 0 (cod())! 0 (dom()) or arrows in C. In other words, a contravariant unctor rom C to D is a unctor rom C op! D (equivalently, rom C to D op ). Exercise 6. Let C be locally small. Show that there is a unctor (the \Hom unctor") C(?;?) : C op C! Set, assigning to the pair (A; B) o objects o C, the set C(A; B). l) Given a partially ordered set (X; ) we make a topological space by dening U X to be open i or all x; y 2 X, x y and x 2 U imply y 2 U (U is \upwards closed", or an \upper set"). This is a topology, called the Alexandro topology w.r.t. the order. I (X; ) and (Y; ) are two partially ordered sets, a unction : X! Y is monotone or the orderings i and only i is continuous or the Alexandro topologies. This gives an important unctor: Pos! Top. Exercise 7. Show that the construction o the quotient category in example g) generalizes that o a quotient group by a normal subgroup. That is, regard a group G as a category with one object; show that there is a bijection between congruence relations on G and normal subgroups o G, and that or a normal subgroup N o G, the quotient category by the congruence relation corresponding to N, is to the quotient group G=N. m) \Abelianization". Let Abgp be the category o abelian groups and homomorphisms. or every group G the subgroup [G; G] generated by all elements o orm aba?1 b?1 is a normal subgroup. G=[G; G] is abelian, and or every group homomorphism : G! H with H abelian, there is a unique homomorphism : G=[G; G]! H such that the diagram p v vvv v vvv v G???????? G=[G; G] commutes. Show that this gives a unctor: Grp! Abgp. 5 H

Categories n) \Specialization ordering". Given a topological space X, you can dene an ordering s on X as ollows: say x s y i or all open sets U, i x 2 U then y 2 U. or many spaces, s is trivial (in particular when X is T 1 ) but in case X is or example the Alexandro topology on a poset (X; ) as in l), then x s y i x y. Exercise 8. I : X! Y is a continuous map o topological spaces then is monotone w.r.t. the specialization orderings s. This denes a unctor Top! Pos. 1.2 Some special objects and arrows We call an arrow : A! B mono (or a monomorphism, or monomorphic) in a category C, i or any other object C and or any pair o arrows g; h : C! A, g = h implies g = h. In Set, is mono i is an injective unction. The same is true or Grp, Grph, Rng, Preord, Pos,: : : We call an arrow : A! B epi (epimorphism, epimorphic) i or any pair g; h : B! C, g = h implies g = h. The denition o epi is \dual" to the denition o mono. That is, is epi in the category C i and only i is mono in C op, and vice versa. In general, given a property P o an object, arrow, diagram,: : :we can associate with P the dual property P op : the object or arrow has property P op in C i it has P in C op. The duality principle, a very important, albeit trivial, principle in category theory, says that any valid statement about categories, involving the properties P 1 ; : : :; P n implies the \dualized" statement (where direction o arrows is reversed) with the P i replaced by Pi op. Example. I g is mono, then is mono. rom this, \by duality", i g is epi, then is epi. Exercise 9. Prove these statements. In Set, is epi i is a surjective unction. This holds (less trivially!) also or Grp, but not or Mon, the category o monoids and monoid homomorphisms: In Mon, the embedding N! Zis an epimorphism. or suppose Z (M; e;?) two monoid homomorphisms which agree on the nonnegative integers. Then g (?1) = (?1)? g(1)? g(?1) = (?1)? (1)? g(?1) = g(?1) 6

1. Categories and unctors so and g agree on the whole o Z. We say a unctor preserves a property P i whenever an object or arrow (or: : :) has P, its -image does so. Now a unctor does not in general preserve monos or epis: the example o Mon shows that the orgetul unctor Mon! Set does not preserve epis. An epi : A! B is called split i there is g : B! A such that g = id B (other names: in this case g is called a section o, and a retraction o g). Exercise 10. By duality, dene what a split mono is. Prove that every unctor preserves split epis and monos. : A! B is an isomorphism i there is g : B! A such that g = id B and g = id A We call g the inverse o (and vice versa, o course); it is unique i it exists. We also write g =?1. Every unctor preserves isomorphisms. Exercise 11. In Set, every arrow which is both epi and mono is an isomorphism. Not so in Mon, as we have seen. Here's another one: let CRng1 be the category o commutative rings with 1, and ring homomorphisms (preserving 1) as arrows. Show that the embedding Z! Q is epi in CRng1. Exercise 12. i) I two o, g and g are iso, then so is the third; ii) iii) i is epi and split mono, it is iso; i is split epi and mono, is iso. A unctor reects a property P i whenever the -image o something (object, arrow,: : :) has P, then that something has. A unctor : C! D is called ull i or every two objects A; B o C, : C(A; B)! D( A; B) is a surjection. is aithul i this map is always injective. Exercise 13. A aithul unctor reects epis and monos. An object X is called terminal i or any other object Y there is exactly one morphism Y! X in the category. Dually, X is initial i or all Y there is exactly one X! Y. Exercise 14. A ull and aithul unctor reects the property o being a terminal (or initial) object. 7

Categories Exercise 15. I X and X 0 are two terminal objects, they are isomorphic, that is there exists an isomorphism between them. Same or initial objects. 8

2. Natural transormations 2 Natural transormations 2.1 The Yoneda lemma A natural transormation between two unctors ; G : C! D consists o a amily o morphisms ( C : C! GC) C2C 0 indexed by the collection o objects o C, satisying the ollowing requirement: or every morphism : C! C 0 in C, the diagram C C GC G C 0 C 0 GC 0 commutes in D (the diagram above is called the naturality square). We say = ( C ) C2C 0 : ) G and we call C the component at C o the natural transormation. Given natural transormations : ) G and : G ) H we have a natural transormation = ( C C ) C : ) H, and with this composition there is a category D C with unctors : C! D as objects, and natural transormations as arrows. One o the points o the naturality square condition in the denition o a natural transormation is given by the ollowing proposition. Compare with the situation in Set: denoting the set o all unctions rom X to Y by Y X, or any set Z there is a bijection between unctions Z! Y X and unctions Z X! Y (Set is cartesian closed: see chapter 7). Proposition 2.1 or categories C, D and E there is a bijection: Cat(E C; D)! Cat(E; D C ) Proo. Given : E C! D dene or every object E o E the unctor E : C! D by E (C) = (E; C); or : C! C 0 let E () = (id E ; ) : E (C) = (E; C)! (E; C 0 ) = E (C 0 ) Given g : E! E 0 in E, the amily ( (g; id C ) : E (C)! E 0(C)) C2C 0 is a natural transormation: E ) E 0. So we have a unctor 7! (?) : E! D C. Conversely, given a unctor G : E! D C we dene a unctor ~ G : E C! D on objects by ~ G(E; C) = G(E)(C), and on arrows by ~ G(g; ) = G(g) C 0G(E)() = 9

Categories G(E 0 )()G(g) C : G(E)(C) = ~ G(E; C) G(g) C ~ G(E 0 ; C) = G(E 0 )(C) G(E)() ~G(E; C 0 ) G(g) C 0 G(E 0 )() ~G(E 0 ; C 0 ) = G(E 0 )(C 0 ) Exercise 16. Write out the details. Check that ~ G as just dened, is a unctor, and that the two operations o Cat(E C; D) Cat(E; D C ) are inverse to each other. An important example o natural transormations arises rom the unctors h C : C op! Set (see example i) in the preceding chapter); dened on objects by h C (C 0 ) = C(C 0 ; C) and on arrows : C 00! C 0 so that h C () is composition with : C(C 0 ; C)! C(C 00 ; C). Given g : C 1! C 2 there is a natural transormation h g : h C1 ) h C2 whose components are composition with g. Exercise 17. Spell this out. We have, in other words, a unctor h (?) : C! Set Cop This unctor is also oten denoted by Y and listens to the name Yoneda embedding. An embedding is a unctor which is ull and aithul and injective on objects. That Y is injective on objects is easy to see, because id C 2 h C (C) or each object C, and id C is in no other set h D (E); that Y is ull and aithul ollows rom the amous Proposition 2.2 (Yoneda lemma) or every object o Set Cop and every object C o C, there is a bijection C; : Set Cop (h C ; )! (C). Moreover, this bijection is natural in C and in the ollowing sense: given g : C 0! C in C 10

2. Natural transormations and : ) 0 in Set Cop, the diagram Set Cop (h C ; ) C; (C) Set Cop (g;) Set Cop (h C 0; 0 ) 0 (C 0 ) C 0 ; 0 C 0(g)= 0 (g) C commutes in Set. Proo. or every object C 0 o C, every element o h C (C 0 ) = C(C 0 ; C) is equal to id C which is h C ()(id C ). I = ( C 0jC 0 2 C 0 ) is a natural transormation: h C ) then, C 0() must be equal to ()( C (id C )). So is completely determined by C (id C ) 2 (C) and conversely, any element o (C) determines a natural transormation h C ). Given g : C 0! C in C and : ) 0 in Set Cop, the map Set Cop (g; ) sends the natural transormation = ( C 00jC 00 2 C 0 ) : h C ) to = ( C 00jC 00 2 C 0 ) where C 00 : h C 0(C 00 )! 0 (C 00 ) is dened by C 00(h : C 00! C 0 ) = C 00( C 00(gh)) Now C0 ; 0() = C 0(id C 0) = C 0( C 0(g)) = C 0( (g)( C (id C ))) = ( C 0 (g))( C; ()) which proves the naturality statement. Corollary 2.3 The unctor Y : C! Set Cop is ull and aithul. Proo. Immediate by the Yoneda lemma, since and this bijection is induced by Y. C(C; C 0 ) = h C 0(C) = Set Cop (h C ; h C 0) The use o the Yoneda lemma is oten the ollowing. One wants to prove that objects A and B o C are isomorphic. Suppose one can show that or every object X o C there is a bijection X : C(X; A)! C(X; B) which is natural in 11

Categories X; i.e. given g : X 0! X in C one has that C(X; A) X C(X; B) C(g;id A) C(X 0 ; A) X 0 C(g;id B) C(X 0 ; B) commutes. Then one can conclude that A and B are isomorphic in C; or, rom what one has just shown it ollows that h A and h B are isomorphic objects in Set Cop ; that is, Y (A) and Y (B) are isomorphic. Since Y is ull and aithul, A and B are isomorphic by the ollowing exercise: Exercise 18. Check: i : C! D is ull and aithul, and (A) is isomorphic to (B) in D, then A is isomorphic to B in C. Exercise 19. Suppose objects A and B are such that or every object X in C there is a bijection X : C(A; X)! C(B; X), naturally in a sense you dene yoursel. Conclude that A and B are isomorphic (hint: duality + the previous). This argument can be carried urther. Suppose one wants to show that two unctors ; G : C! D are isomorphic as objects o D C. Let's rst spell out what this means: Exercise 20. Show that and G are isomorphic in D C i and only i there is a natural transormation : ) G such that all components C are isomorphisms (in particular, i is such, the amily (( C )?1 jc 2 C 0 ) is also a natural transormation G ) ). Now suppose one has or each C 2 C 0 and D 2 D 0 a bijection D(D; C) = D(D; GC) natural in D and C. This means that the objects h C and h GC o Set Dop are isomorphic, by isomorphisms which are natural in C. By ull and aithulness o Y, C and GC are isomorphic in D by isomorphisms natural in C; which says exactly that and G are isomorphic as objects o D C. 2.2 Examples o natural transormations a) Let M and N be two monoids, regarded as categories with one object as in chapter 1. A unctor : M! N is then just the same as a homomorphism 12

2. Natural transormations o monoids. Given two such, say ; G : M! N, a natural transormation ) G is (given by) an element n o N such that n (x) = G(x)n or all x 2 M; b) Let P and Q two preorders, regarded as categories. A unctor P! Q is a monotone unction, and there exists a unique natural transormation between two such, ) G, exactly i (x) G(x) or all x 2 P. Exercise 21. In act, show that i D is a preorder and the category C is small, i.e. the classes C 0 and C 1 are sets, then the unctor category D C is a preorder. c) Let U : Grp! Set denote the orgetul unctor, and : Set! Grp the ree unctor (see chapter 1). There are natural transormations " : U ) id Grp and : id Set ) U. Given a group G, " G takes the string = g 1 : : : g n to the product g 1 g n (here, the \ormal inverses" g i?1 are interpreted as the real inverses in G!). Given a set A, A (a) is the singleton string a. d) Let i : Abgp! Grp be the inclusion unctor and r : Grp! Abgp the abelianization unctor dened in example m) in chapter 1. There is " : ri ) id Abgp and : id Grp ) ir. The components G o are the quotient maps G! G=[G; G]; the components o " are isomorphisms. e) There are at least two ways to associate a category to a set X: let (X) be the category with as objects the elements o X, and as only arrows identities (a category o the orm (X) is called discrete; and G(X) the category with the same objects but with exactly one arrow x;y : x! y or each pair (x; y) o elements o X (We might call G(X) an indiscrete category). Exercise 22. Check that and G can be extended to unctors: Set! Cat and describe the natural transormation : ) G which has, at each component, the identity unction on objects. ) Every class o arrows o a category C can be viewed as a natural transormation. Suppose S C 1. Let (S) be the discrete category on S as in the preceding example. There are the two unctors dom; cod : (S)! C, giving the domain and the codomain, respectively. or every 2 S we have : dom()! cod(), and the amily (j 2 S) denes a natural transormation: dom ) cod. g) Let A and B be sets. There are unctors (?)A : Set! Set and (?)B : Set! Set. Any unction : A! B gives a natural transormation (?) A ) (?) B. 13

Categories h) A category C is called a groupoid i every arrow o C is an isomorphism. Let C be a groupoid, and suppose we are given, or each object X o C, an arrow X in C with domain X. Exercise 23. Show that there is a unctor : C! C in this case, which acts on objects by (X) = cod( X ), and that = ( X jx 2 C 0 ) is a natural transormation: id C ). i) Given categories C, D and an object D o D, there is the constant unctor D : C! D which assigns D to every object o C and id D to every arrow o C. Every arrow : D! D 0 gives a natural transormation : D ) D 0 dened by ( ) C = or each C 2 C 0. j) Let P(X) denote the power set o a set X: the set o subsets o X. The powerset operation can be extended to a unctor P : Set! Set. Given a unction : X! Y dene P() by P()(A) = [A], the image o A X under. There is a natural transormation : id Set ) P such that X (x) = xg 2 P(X) or each set X. There is also a natural transormation : PP ) P. Given A 2 PP(X), so A is a set o subsets o X, we take its union S (A) which is a subset o X. Put X (A) = S (A). 2.3 Equivalence o categories; an example As will become clear in the ollowing chapters, equality between objects plays only a minor role in category theory. The most important categorical notions are only dened \up to isomorphism". This is in accordance with mathematical practice and with common sense: just renaming all elements o a group does not give you really another group. We have already seen one example o this: the property o being a terminal object denes an object up to isomorphism. That is, any two terminal objects are isomorphic. There is, in the language o categories, no way o distinguishing between two isomorphic objects, so this is as ar as we can get. However, once we also consider unctor categories, it turns out that there is another relation o \sameness" between categories, weaker than isomorphism o categories, and yet preserving all \good" categorical properties. Isomorphism o categories C and D requires the existence o unctors : C! D and G : D! C such that G = id D and G = id C ; but bearing in mind that we can't really say meaningul things about equality between objects, we may relax the requirement by just asking that G is isomorphic to id D in the unctor category D D (and 14

2. Natural transormations the same or G ); doing this we arrive at the notion o equivalence o categories, which is generally regarded as the proper notion o sameness. So two categories C and D are equivalent i there are unctors : C! D, G : D! C and natural transormations : id C ) G and : id D ) G whose components are all isomorphisms. and G are called pseudo inverses o each other. A unctor which has a pseudo inverse is also called an equivalence o categories. Exercise 24. Show that a category is equivalent to a discrete category i and only i it is a groupoid and a preorder. In this section I want to give an important example o an equivalence o categories: the so-called \Lindenbaum-Tarski duality between Set and Complete Atomic Boolean Algebras". A duality between categories C and D is an equivalence between C op and D (equivalently, between C and D op ). We need some denitions. A lattice is a partially ordered set in which every two elements x; y have a least upper bound (or join) x _ y and a greatest lower bound (or meet) x ^ y; moreover, there exist a least element 0 and a greatest element 1. Such a lattice is called a Boolean algebra i every element x has a complement :x, that is, satisying x _ :x = 1 and x ^ :x = 0; and the lattice is distributive, which means that x ^ (y _ z) = (x ^ y) _ (x ^ z) or all x; y; z. In a Boolean algebra, complements are unique, or i both y and z are complements o x, then y = y ^ 1 = y ^ (x _ z) = (y ^ x) _ (y ^ z) = 0 _ (y ^ z) = y ^ z so y z; similarly, z y so y = z. This is a non-example: x 1??????? z 0 It is a lattice, and every element has a complement, but it is not distributive (check!). A Boolean algebra B is complete i every subset A o B has a least upper bound W A and a greatest lower bound V A. 15??????? y

Categories An atom in a Boolean algebra is an element x such that 0 < x but or no y we have 0 < y < x. A Boolean algebra is atomic i every x is the join o the atoms below it: x = _ aja x and a is an atomg The category CABool is dened as ollows: the objects are complete atomic Boolean algebras, and the arrows are complete homomorphisms, that is: : B! C is a complete homomorphism i or every A B, ( _ A) = _ (a)ja 2 Ag and (^ A) = ^(a)ja 2 Ag Exercise 25. Show that 1 = V ; and 0 = W ;. Conclude that a complete homomorphism preserves 1, 0 and complements. Exercise 26. Show that V A = : W :aja 2 Ag and conclude that i a unction preserves all W 's, 1 and complements, it is a complete homomorphism. Theorem 2.4 The category CABool is equivalent to Set op. Proo. or every set X, P(X) is a complete atomic Boolean algebra and i : Y! X is a unction, then?1 : P(X)! P(Y ) which takes, or each subset o X, its inverse image under, is a complete homomorphism. So this denes a unctor : Set op! CABool. Conversely, given a complete atomic Boolean algebra B, let G(B) be the set o atoms o B. Given a complete homomorphism g : B! C we have a unction G(g) : G(C)! G(B) dened by: G(g)(c) is the unique b 2 G(B) such that c g(b). This is well-dened: rst, there is an atom b with c g(b) because 1 B = W G(B) (B is atomic), so 1 C = g(1 B ) = W g(b)jb is an atomg and: Exercise 27. Prove: i c is an atom and c W A, then there is a 2 A with c a (hint: prove or all a; b that a ^ b = 0, a :b, and prove or a; c with c atom: c 6 a, a :c). Secondly, the atom b is unique since c g(b) and c g(b 0 ) means c g(b) ^ g(b 0 ) = g(b ^ b 0 ) = g(0) = 0. So we have a unctor G : CABool! Set op. Now the atoms o the Boolean algebra P(X) are exactly the singleton subsets o X, so G (X) = xgjx 2 Xg which is clearly isomorphic to X. On the other hand, G(B) = P(b 2 Bjb is an atomg). There is a map rom G(B) to B which sends each set o atoms to its least upper bound in B, and this map is an isomorphism in CABool. Exercise 28. Prove the last statement: that the map rom G(B) to B, dened in the last paragraph o the proo, is an isomorphism. 16

" 3. (Co)cones and (co)limits 3 (Co)cones and (co)limits 3.1 Limits Given a unctor : C! D, a cone or consists o an object D o D together with a natural transormation : D ) ( D is the constant unctor with value D). In other words, we have a amily ( C : D! (C)jC 2 C 0 ), and the naturality requirement in this case means that or every arrow : C! C 0 in C, C z zzz z zzz D E E E E C 0 E E E E (C) () (C 0 ) commutes in D (this diagram explains, I hope, the name \cone"). Let us denote the cone by (D; ). D is called the vertex o the cone. A map o cones (D; )! (D 0 ; 0 ) is a map g : D! D 0 such that 0 C g = C or all C 2 C 0. Clearly, there is a category Cone( ) which has as objects the cones or and as morphisms maps o cones. A limiting cone or is a terminal object in Cone( ). Since terminal objects are unique up to isomorphism, as we have seen, any two limiting cones are isomorphic in Cone( ) and in particular, their vertices are isomorphic in D. A unctor : C! D is also called a diagram in D o type C, and C is the index category o the diagram. Let us see what it means to be a limiting cone, in some simple, important cases. i) A limiting cone or the unique unctor! : 0! D (0 is the empty category) \is" a terminal object in D. or every object D o D determines, together with the empty amily, a cone or!, and a map o cones is just an arrow in D. So Cone(!) is isomorphic to D. ii) Let 2 be the discrete category with two objects x; y. A unctor 2! D is just a pair ha; Bi o objects o D, and a cone or this unctor consists o an object C o D and two maps arrows in 2. A C @ @ @ @ @ B @ @ A B since there are no nontrivial (C; ( A ; B )) is a limiting cone or ha; Bi i the ollowing holds: or any object D and arrows : D! A, g : D! B, there is a unique arrow 17

> ' # Categories h : D! C such that commutes. D h ~ ~ ~ ~ A C 0 0 0 0 0 0 0 0 B P P A 0 P P 0 P P 0 P P 0 P 0 g P P P 0 P P In other words, there is, or any D, a 1-1 correspondence D between maps D! C and pairs o maps B ~ ~~ ~ ~ ~~ @ @ @ @ @ @ @ This is A B the property o a product; a limiting cone or ha; Bi is thereore called a product cone, and usually denoted: iii) A x A x xxx x xxx A B B The arrows A and B are called projections. Let ^2 denote the category x as a parallel pair o arrows A A cone or h; gi is: A a b g ~ A ~ ~~ ~ ~~ B y. A unctor ^2! D is the same thing B in D; I write h; gi or this unctor. D g @ @ @ @ B @ @ @ But B = A = g A is already dened rom A, so giving a cone is the same as giving a map A : D! A such that A = g A. Such a cone is limiting i or any other map h : C! A with h = gh, there is a unique k : C! D such that h = A k. We call A, i it is limiting, an equalizer o the pair ; g, and the diagram A A g D B an equalizer diagram. In Sets, an equalizer o ; g is isomorphic (as a cone) to the inclusion o a 2 Aj(a) = g(a)g into A. In categorical interpretations o logical 18 B

( 3. (Co)cones and (co)limits systems (see chapters 4 and 7), equalizers are used to interpret equality between terms. Exercise 29. Show that every equalizer is a monomorphism. e Exercise 30. I E is an isomorphism i and only i = g. X g Y is an equalizer diagram, show that e Exercise 31. Show that in Set, every monomorphism ts into an equalizer diagram. y iv) Let J denote the category x a z by giving two arrows in D with the same codomain, say : X! Z, g : Y! Z. A limit or such a unctor is given by an object W together with projections p X p Y W X given any other pair o arrows: unique arrow V! W such that Y b A unctor : J! D is specied satisying p X s r V X Y = gp Y, and such that, with gr = s, there is a commutes. The diagram V 0 A P P 0 A PP A P 0 A PP r 0 A P A PP 0 A 0 A s 0 0 0 0 p X W 0 0 0 0 W p X P PP P P p Y X p Y X Y Z g Y Z g 19

Categories is called a pullback diagram. In Set, the pullback cone or ; g is isomorphic to (x; y) 2 X Y j(x) = g(y)g with the obvious projections. We say that a category D has binary products (equalizers, pullbacks) i every unctor 2! D (^2! D, J! D, respectively) has a limiting cone. Some dependencies hold in this context: Proposition 3.1 I a category D has a terminal object and pullbacks, it has binary products and equalizers. I D has binary products and equalizers, it has pullbacks. Proo. Let 1 be the terminal object in D; given objects X and Y, i is a pullback diagram, then Given a product cone p Y p X C Y X A A B B B A is a product cone. and maps g X B p Y A C p X X Y 1 we write X h;gi! A B or the unique actorization through the product. Write also : Y! Y Y or hid Y ; id Y i. Now given ; g : X! Y, i E e X Y e is a pullback diagram, then E proves the rst statement. As or the second: given X Y g h;gi Y Y X Z 20 g Y e let E is an equalizer diagram. This X Y X Z be an g Y

3. (Co)cones and (co)limits equalizer; then Y e E X e Y g X Z is a pullback diagram. Exercise 32. Let A b B a X g a pullback diagram with mono. Show that a is also mono. Also, i is iso (an isomorphism), so is a. Y Exercise 33. Given: A b B c C a X g Y h a) i both squares are pullback squares, then so is the composite square a A cb X hg C Z d b) I the right hand square and the composite square are pullbacks, then so is the let hand square. Exercise 34. : A! B is a monomorphism i and only i d Z A id A A id A A B is a pullback diagram. 21

Categories A monomorphism : A! B which ts into an equalizer diagram A B g h C is called a regular mono. Exercise 35. I b A a B X Y g is a pullback and g is regular mono, so is b. Exercise 36. I is regular mono and epi, is iso. Every split mono is regular. Exercise 37. Give an example o a category in which not every mono is regular. Exercise 38. In Grp, every mono is regular [This is not so easy]. Exercise 39. In Pos, every mono is regular. Exercise 40. I a category D has binary products and a terminal object, it has all nite products, i.e. limiting cones or every unctor into D rom a nite discrete category. Exercise 41. Suppose C has binary products and suppose or every ordered pair (A; B) o objects o C a product cone A B B B A A has been chosen. a) Show that there is a unctor: C C??! C (the product unctor) which sends each pair (A; B) o objects to A B and each pair o arrows ( : A! A 0 ; g : B! B 0 ) to g = h A ; g B i. b) rom a), there are unctors: C C C 22 (??)??(??) C

5 3. (Co)cones and (co)limits (A B) C sending (A; B; C) to Show that there is a natural transormation a = (a A;B;C ja; B; C 2 C 0 ) rom (??)? to? (??) A (B C) such that or any our objects A; B; C; D o C: ((A B) C) D a AB;C;D (A B) (C D) a A;B;Cid D (A (B C)) D T TTTTTTTTTTTTT a A;BC;D T ) A ((B C) D) jjjjjjjjjjjjjj id A a B;C;D j commutes (This diagram is called \MacLane's pentagon"). a A;B;CD A (B (C D)) A unctor : C! D is said to preserve limits o type E i or all unctors M : E! C, i (D; ) is a limiting cone or M in C, then ( D; = ( ( E )je 2 E 0 )) is a limiting cone or M in D. So, a unctor : C! D preserves binary products i or every product dia- B ( B) A B B (A B) (B) gram A its -image ( A) is again a product A (A) diagram. Similarly or equalizers and pullbacks. Some more terminology: is said to preserve all nite limits i it preserves limits o type E or every nite E. A category which has all nite limits is called lex (let exact), cartesian or nitely complete. A category is called complete i it has limits o type E or all small E. In general, limits over large (i.e. not small) diagrams do not exist. or example in Set, there is a limiting cone or the identity unctor Set! Set (its vertex is the empty set), but not or the inclusion unctor o the subcategory o all nonempty sets into Set. Exercise 42. I a category C has equalizers, it has all nite equalizers: or every category E o the orm X 1 ṅ. Y every unctor E! C has a limiting cone. 23

}! Categories Exercise 43. Suppose : C! D preserves equalizers (and C has equalizers) and reects isomorphisms. Then is aithul. Exercise 44. Let C be a category with nite limits. Show that or every object C o C, the slice category C=C (example j) o 1.1) has binary products: the vertex o a product diagram or two objects D! C, D 0! C is D 00! C where D 00 D is a pullback square in C. D 0 C 3.2 Limits by products and equalizers In Set, every small diagram has a limit; given a unctor : E! Set with E small, there is a limiting cone or in Set with vertex Y (x E ) E2E0 2 E2E 0 (E)j8E! E 0 2 E 1 ( ()(x E ) = x E 0)g So in Set, limits are equationally dened subsets o suitable products. holds in any category: This Proposition 3.2 Suppose C has all small products (including the empty product, i.e. a terminal object 1) and equalizers; then C has all small limits. Proo. Given a set I and an I-indexed amily o objects (A i ji 2 I) o C, we denote the product by Q i2i A i and projections by i : Q i2i A i! A i ; an arrow : X! Q i2i A i which is determined by the compositions i = i : X! A i, is also denoted ( i ji 2 I). Now given E! C with E 0 and E 1 sets, we construct E ( e cod(u) ju2e 1) Qi2E 0 (i) ( (u) dom(u) ju2e 1) Q u2e 1 (cod(u)) in C as an equalizer diagram. The amily ( i = i e : E! (i)ji 2 E 0 ) is a natural transormation E ) because, given an arrow u 2 E 1, say u : i! j, we have that E ie { {{{ { {{{ C C C C j e C C C C (i) (u) 24 (j)

# 3. (Co)cones and (co)limits commutes since (u) i e = (u) dom(u) e = cod(u) e = j e. So (E; ) is a cone or, but every other cone (D; ) or gives a map d : D! Q i2e 0 (i) equalizing the two horizontal arrows; so actors uniquely through E. Exercise 45. Check that \small" in the statement o the proposition, can be replaced by \nite": i C has all nite products and equalizers, C is nitely complete. 3.3 Colimits The dual notion o limit is colimit. Given a unctor : E! C there is clearly a unctor op : E op! C op which does \the same" as. We say that a colimiting cocone or is a limiting cone or op. So: a cocone or : E! C is a pair (; D) where : ) D and a colimiting cocone is an initial object in the category Cocone( ). Examples i) a colimiting cocone or! : 0! C \is" an initial object o C ii) a colimiting cocone or ha; Bi : 2! C is a coproduct o A and B in C: usually denoted A + B or A t B; there are coprojections or coproduct inclusions A A B B A t B with the property that, given any pair o arrows A! C, B! g C thereis a unique map : AtB! C such that = g A and g = B g g iii) a colimiting cocone or A g B (as unctor ^2! C) is given by a map B c! C satisying c = cg, and such that or any B h! D with h = hg there is a unique C! h0 D with h = h 0 c. c is called a coequalizer or and g; the diagram A B C a coequalizer diagram. Exercise 46. Is the terminology \coproduct inclusions" correct? That is, it suggests they are monos. Is this always the case? In Set, the coproduct o X and Y is the disjoint union (0g X) [ (1g Y ) 25

Categories o X and Y. The coequalizer o X where is the equivalence relation generated by g Y is the quotient map Y! Y= y y 0 i there is x 2 X with (x) = y and g(x) = y 0 The dual notion o pullback is pushout. cocone or a unctor?! C where? is the category is a square g X Z b which commutes and such that, given Y A pushout diagram is a colimiting x y Y P a??????? Z Q z. Such a diagram with = g, there is a unique P! p Q with = pa and = pb. In Set, the pushout o X! Y and X! g Z is the coproduct Y t Z where the two images o X are identied: Y X * X H HHj X H HHj X * Z Exercise 47. Give yoursel, in terms o X! Y and X g! Z, a ormal denition o a relation R on Y t Z such that the pushout o and g is Y t Z=, being the equivalence relation generated by R. One can now dualize every result and exercise rom the section on limits: 26

3. (Co)cones and (co)limits Exercise 48. is epi i and only i id id is a pushout diagram. Exercise 49. Every coequalizer is an epimorphism; i e is a coequalizer o and g, then e is iso i = g Exercise 50. I C has an initial object and pushouts, C has binary coproducts and coequalizers; i C has binary coproducts and coequalizers, C has pushouts. Exercise 51. I a is a pushout diagram, then a epi implies epi, and a regular epi (i.e. a coequalizer) implies regular epi. Exercise 52. The composition o two puhout squares is a pushout; i both the rst square and the composition are pushouts, the second square is. Exercise 53. I C has all small (nite) coproducts and coequalizers, C has all small (nite) colimits. Exercise 54. In Pos, X! Y is a regular epi i and only i or all y; y 0 in Y : y y 0, 9x 2?1 (y)9x 0 2?1 (y 0 ):x x 0 Show by an example that not every epi is regular in Pos. Exercise 55. In Grp, every epi is regular. 27

Categories 28

4. A little piece o categorical logic 4 A little piece o categorical logic One o the major achievements o category theory in mathematical logic and in computer science, has been a unied treatment o semantics or all kinds o logical systems and term calculi which are the basis or programming languages. One can say that mathematical logic, seen as the study o classical rst order logic, rst started to be a real subject with the discovery, by Godel, o the completeness theorem or set-theoretic interpretations: a sentence ' is provable i and only i ' is true in all possible interpretations. This unites the two approaches to logic: proo theory and model theory, makes logic accessible or mathematical methods and enables one to give nice and elegant proos o proo theoretical properties by model theory (or example, the Beth and Craig denability and interpolation theorems). However the completeness theorem needs generalization once one considers logics, such as intuitionistic logic (which does not admit the principle o excluded middle), minimal logic (which has no negation) or modal logic (where the logic has an extra operator, expressing \necessarily true"), or which the set-theoretic interpretation is not complete. One thereore comes with a general denition o \interpretation" in a category C o a logical system, which generalizes Tarski's truth denition: this will then be the special case o classical logic and the category Set. In this chapter I treat, or reasons o space, only a ragment o rst order logic: coherent logic. On this ragment the valid statements o classical and intuitionistic logic coincide. or an interpretation o a term calculus like the -calculus, which is o paramount importance in theoretical computer science, the reader is reerred to chapter 7. 4.1 Regular categories and subobjects Denition 4.1 A category C is called regular i the ollowing conditions hold: a) C has all nite limits; b) or every arrow, i Z p 0 X p 1 X Y is a pullback (then Z p 0 X is called the kernel pair o ), the coequal- p 1 izer o p 0 ; p 1 exists; 29