Course pages 2020–21 (these pages are still being updated)

# Category Theory

**Principal lecturer:** Prof Andrew Pitts**Taken by:** Part II CST 75%

No. of lectures: 16

Prerequisite courses: Discrete Mathematics, Foundations of Computer Science, Semantics of Programming Languages.

Capacity: 16

## Aims

Category theory provides a unified treatment of mathematical properties and constructions that can be expressed in terms of “morphisms” between structures. It gives a precise framework for comparing one branch of mathematics (organized as a category) with another and for the transfer of problems in one area to another. Since its origins in the 1940s motivated by connections between algebra and geometry, category theory has been applied to diverse fields, including computer science, logic and linguistics. This course introduces the basic notions of category theory: adjunction, natural transformation, functor and category. We will use category theory to organize and develop the kinds of structure that arise in models and semantics for logics and programming languages.

## Lectures

**Introduction:**some history. Definition of category. The category of sets and functions.**Commutative diagrams.**Examples of categories: preorders and monotone functions; monoids and monoid homomorphisms; a preorder as a category; a monoid as a category. Definition of isomorphism. Informal notion of a "category-theoretic" property.**Terminal objects.**The opposite of a category and the duality principle. Initial objects. Free monoids as initial objects.**Binary products and coproducts.**Cartesian categories.**Exponential objects:**in the category of sets and in general. Cartesian closed categories: definition and examples.**Intuitionistic Propositional Logic (IPL)**in Natural Deduction style. Semantics of IPL in a cartesian closed preorder.**Simply Typed Lambda Calculus (STLC).**The typing relation. Semantics of STLC types and terms in a cartesian closed category (ccc). The internal language of a ccc. The Curry-Howard-Lawvere correspondence.**Functors.**Contravariance. Identity and composition for functors.**Size:**small categories and locally small categories. The category of small categories. Finite products of categories.**Natural transformations.**Functor categories. The category of small categories is cartesian closed.**Hom functors.**Natural isomorphisms. Adjunctions. Examples of adjoint functors. Theorem characterising the existence of right (respectively left) adjoints in terms of a universal property.**Dependent types.**Dependent product sets and dependent function sets as adjoint functors. Equivalence of categories. Example: the category of I-indexed sets and functions is equivalent to the slice category Set/I.**Presheaves.**The Yoneda Lemma. Categories of presheaves are cartesian closed.**Monads.**Modelling notions of computation as monads. Moggi’s computational lambda calculus.

## Objectives

At the end of the course students should:

- be familiar with some of the basic notions of category theory and its connections with logic and programming language semantics.

## Recommended reading

* Awodey, S. (2010). *Category theory*. Oxford University Press (2nd ed.).

Crole, R.L. (1994). *Categories for types*. Cambridge University Press.

Lambek, J. & Scott, P.J. (1986). *Introduction to higher order categorical logic*. Cambridge University Press.

Pitts, A.M. (2000). “Categorical Logic”. In Abramsky, S., Gabbay, D.M. & Maibaum, T.S.E. (eds.) *Handbook of Logic in Computer Science*, Volume 5. Oxford University Press. (Draft copy available at: `http://www.cl.cam.ac.uk/ amp12/papers/catl/catl.pdf`)