Category Theory
STEVE AWODEY
Carnegie Mellon University
CLARENDON PRESS • OXFORD
2006
3
Great Clarendon Street, Oxford OX2 6DP
Oxford University Press is a department of the University of Oxford.
It furthers the University’s objective of excellence in research, scholarship,
and education by publishing worldwide in
Oxford New York
Auckland Cape Town Dar es Salaam Hong Kong Karachi
Kuala Lumpur Madrid Melbourne Mexico City Nairobi
New Delhi Shanghai Taipei Toronto
With offices in
Argentina Austria Brazil Chile Czech Republic France Greece
Guatemala Hungary Italy Japan Poland Portugal Singapore
South Korea Switzerland Thailand Turkey Ukraine Vietnam
Oxford is a registered trade mark of Oxford University Press
in the UK and in certain other countries
Published in the United States
by Oxford University Press Inc., New York
c Steve Awodey, 2006
The moral rights of the author have been asserted
Database right Oxford University Press (maker)
First published 2006
All rights reserved. No part of this publication may be reproduced,
stored in a retrieval system, or transmitted, in any form or by any means,
without the prior permission in writing of Oxford University Press,
or as expressly permitted by law, or under terms agreed with the appropriate
reprographics rights organization. Enquiries concerning reproduction
outside the scope of the above should be sent to the Rights Department,
Oxford University Press, at the address above
You must not circulate this book in any other binding or cover
and you must impose the same condition on any acquirer
British Library Cataloguing in Publication Data
Data available
Library of Congress Cataloging in Publication Data
Data available
Typeset by Newgen Imaging Systems (P) Ltd., Chennai, India
Printed in Great Britain
on acid-free paper by
Biddles Ltd., King’s Lynn, Norfolk
ISBN 0–19–856861–4
978–0–19–856861–2
1 3 5 7 9 10 8 6 4 2
in memoriam
Saunders Mac Lane
PREFACE
Why write a new textbook on Category Theory, when we already have Mac
Lane’s Categories for the Working Mathematician? Simply put, because Mac
Lane’s book is for the working (and aspiring) mathematician. What is needed
now, after 30 years of spreading into various other disciplines and places in the
curriculum, is a book for everyone else.
This book has grown from my courses on Category Theory at Carnegie Mellon
University over the last 10 years. In that time, I have given numerous lecture
courses and advanced seminars to undergraduate and graduate students in Com-
puter Science, Mathematics, and Logic. The lecture course based on the material
in this book consists of two, 90-minute lectures a week for 15 weeks. The germ
of these lectures was my own graduate student notes from a course on Category
Theory given by Mac Lane at the University of Chicago. In teaching my own
course, I soon discovered that the mixed group of students at Carnegie Mellon
had very different needs than the Mathematics graduate students at Chicago and
my search for a suitable textbook to meet these needs revealed a serious gap in
the literature. My lecture notes evolved over a time to fill this gap, supplementing
and eventually replacing the various texts I tried using.
The students in my courses often have little background in Mathematics bey-
ond a course in Discrete Math and some Calculus or Linear Algebra or a course
or two in Logic. Nonetheless, eventually, as researchers in Computer Science or
Logic, many will need to be familiar with the basic notions of Category Theory,
without the benefit of much further mathematical training. The Mathematics
undergraduates are in a similar boat: mathematically talented, motivated to
learn the subject by its evident relevance to their further studies, yet unable to
follow Mac Lane because they still lack the mathematical prerequisites. Most
of my students do not know what a free group is (yet), and so they are not
illuminated to learn that it is an example of an adjoint.
This, then, is intended as a text and reference book on Category Theory,
not only for students of Mathematics, but also for researchers and students in
Computer Science, Logic, Linguistics, Cognitive Science, Philosophy, and any of
the other fields that now make use of it. The challenge for me was to make the
basic definitions, theorems, and proof techniques understandable to this reader-
ship, and thus without presuming familiarity with the main (or at least original)
applications in algebra and topology. It will not do, however, to develop the
subject in a vacuum, simply skipping the examples and applications. Material
at this level of abstraction is simply incomprehensible without the applications
and examples that bring it to life.
Faced with this dilemma, I have adopted the strategy of developing a few
basic examples from scratch and in detail—namely posets and monoids—and
PREFACE
vii
then carrying them along and using them throughout the book. This has several
didactic advantages worth mentioning: both posets and monoids are themselves
special kinds of categories, which in a certain sense represent the two “dimen-
sions” (objects and arrows) that a general category has. Many phenomena
occurring in categories can best be understood as generalizations from posets
or monoids. On the other hand, the categories of posets (and monotone maps)
and monoids (and homomorphisms) provide two further, quite different examples
of categories in which to consider various concepts. The notion of a limit,
for instance, can be considered both in a given poset and in the category of
posets.
Of course, many other examples besides posets and monoids are treated as
well. For example, the chapter on groups and categories develops the first steps of
Group Theory up to kernels, quotient groups, and the homomorphism theorem,
as an example of equalizers and coequalizers. Here, and occasionally elsewhere
(e.g. in connection with Stone duality), I have included a bit more Mathematics
than is strictly necessary to illustrate the concepts at hand. My thinking is that
this may be the closest some students will ever get to a higher Mathematics
course, so they should benefit from the labor of learning Category Theory by
reaping some of the nearby fruits.
Although the mathematical prerequisites are substantially lighter than for
Mac Lane, the standard of rigor has (I hope) not been compromised. Full proofs
of all important propositions and theorems are given, and only occasional routine
lemmas are left as exercises (and these are then usually listed as such at the
end of the chapter). The selection of material was easy. There is a standard core
that must be included: categories; functors; natural transformations; equivalence;
limits and colimits; functor categories; representables; Yoneda’s Lemma; adjoints;
and monads. That nearly fills a course. The only “optional” topic included here
is cartesian closed categories and the lambda-calculus, which is a must for com-
puter scientists, logicians, and linguists. Several other obvious further topics were
purposely not included: 2-categories, toposes (in any depth), and monoidal cat-
egories. These topics are treated in Mac Lane, which the student should be able
to read after having completed the course.
Finally, I take this opportunity to thank Wilfried Sieg for his exceptional
support of this project; Peter Johnstone and Dana Scott for helpful suggestions
and support; Andr´e Carus for advice and encouragement; Bill Lawvere for many
very useful comments on the text; and the many students in my courses who
have suggested improvements to the text, clarified the content with their ques-
tions, tested all of the exercises, and caught countless errors and typos. For the
latter, I also thank the many readers who took the trouble to collect and send
helpful corrections, particularly Brighten Godfrey, Peter Gumm, Bob Lubarsky
and Dave Perkinson. Andrej Bauer and Kohei Kishida are to be thanked for
providing Figures 9.1 and 8.1, respectively. Of course, Paul Taylor’s macros for
commutative diagrams must also be acknowledged. And my dear Karin deserves
thanks for too many things to mention. Finally, I wish to record here my debt of
viii
PREFACE
gratitude to my mentor Saunders Mac Lane, not only for teaching me category
theory, and trying to teach me how to write, but also for helping me to find my
place in Mathematics. I dedicate this book to his memory.
Steve Awodey
Pittsburgh
September 2005
CONTENTS
Preface
1 Categories
Introduction
1.1
1.2 Functions of sets
1.3 Definition of a category
1.4 Examples of categories
1.5
1.6 Constructions on categories
1.7 Free categories
1.8 Foundations: large, small, and locally small
1.9 Exercises
Isomorphisms
Initial and terminal objects
2 Abstract structures
2.1 Epis and monos
2.2
2.3 Generalized elements
2.4
2.5 Products
2.6 Examples of products
2.7 Categories with products
2.8 Hom-sets
2.9 Exercises
Sections and retractions
3 Duality
3.1 The duality principle
3.2 Coproducts
3.3 Equalizers
3.4 Coequalizers
3.5 Exercises
4 Groups and categories
4.1 Groups in a category
4.2 The category of groups
4.3 Groups as categories
4.4 Finitely presented categories
4.5 Exercises
5 Limits and colimits
5.1
Subobjects
5.2 Pullbacks
vi
1
1
3
4
5
11
13
16
21
23
25
25
28
29
33
34
36
41
42
45
47
47
49
54
57
63
65
65
68
70
73
74
77
77
80
x
CONTENTS
5.3 Properties of pullbacks
5.4 Limits
5.5 Preservation of limits
5.6 Colimits
5.7 Exercises
6 Exponentials
6.1 Exponential in a category
6.2 Cartesian closed categories
6.3 Heyting algebras
6.4 Equational definition
6.5
λ-calculus
6.6 Exercises
Stone duality
7 Functors and naturality
7.1 Category of categories
7.2 Representable structure
7.3
7.4 Naturality
7.5 Examples of natural transformations
7.6 Exponentials of categories
7.7 Functor categories
7.8 Equivalence of categories
7.9 Examples of equivalence
7.10 Exercises
8 Categories of diagrams
Set-valued functor categories
8.1
8.2 The Yoneda embedding
8.3 The Yoneda Lemma
8.4 Applications of the Yoneda Lemma
8.5 Limits in categories of diagrams
8.6 Colimits in categories of diagrams
8.7 Exponentials in categories of diagrams
8.8 Topoi
8.9 Exercises
9 Adjoints
9.1 Preliminary definition
9.2 Hom-set definition
9.3 Examples of adjoints
9.4 Order adjoints
9.5 Quantifiers as adjoints
9.6 RAPL
9.7 Locally cartesian closed categories
84
89
94
95
102
105
105
108
113
118
119
123
125
125
127
131
133
135
139
142
146
150
155
159
159
160
162
166
167
168
172
174
176
179
179
183
187
191
193
197
202