Category Theory as Coherently Constructive Lattice Theory Working Document
Roland Backhouse, Marcel Bijsterveld, Rik van Geldrop and Jaap van der Woude
June 12, 1998
Contents
1 Introduction 2 Basic De nitions 2.1 Categories : : : : : : : : : 2.2 Initial Objects : : : : : : : 2.3 Functors : : : : : : : : : : 2.4 Natural Transformations : 2.5 Examples of Categories : : 2.5.1 Discrete Category :
: : : : : : : 2.5.3 Category of Categories : 2.5.4 Functor Category : : : : 2.5.5 Sum Category : : : : : : 3 Elementary Illustrations 3.1 The Initial Functor : : : : : : : 3.2 Yoneda's Lemma : : : : : : : : 3.2.1 In Lattice Theory : : : : : : : : : : 2.5.2 Opposite Category : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : :
5 7 8 10 10 10 11 11 11 13
1 5
: : : : 3.2.3 Hom Functors (Generalised) : 3.2.4 The Lemma : : : : : : : : : : 3.2.5 Corollaries : : : : : : : : : : : 4 Adjunctions 4.1 Galois Connections : : : : : : : : : : 4.1.1 Examples : : : : : : : : : : :
: : : 3.2.2 The Evaluation Functor :
17
17 19 19 21 22 23 26 29 30 32 33 34 36 38 40 47
::::: ::::: 4.1.2 Introduction and Elimination Rules : : 4.1.3 Pointwise Ordering of Functions : : : : 4.1.4 Properties : : : : : : : : : : : : : : : : 4.1.5 Suprema : : : : : : : : : : : : : : : : : 4.1.6 Parameterised Suprema : : : : : : : : : 4.2 De nition : : : : : : : : : : : : : : : : : : : : 4.3 Properties : : : : : : : : : : : : : : : : : : : :
i
29
Category Theory
June 12, 1998
ii 4.4 Sharp and Flat : : : : : : : : 4.5 Limits and Colimits : : : : : : 4.5.1 Parameterised Colimits 4.5.2 Colimit Preservation : 4.6 Existence of adjoints : : : : :
: : : : : : : : : : : : : : : : : : : : : : : :
: : : : : : : : : : : : : : : : : : : : : : : :
: : : : : : : : : : : : : : : : : : : : : : : :
: : : : : : : : : : : : : : : : : : : : : : : :
: : : : : : : : : : : : : : : : : : : : : : : :
: : : : : : : : : : : : : : : : : : : : : : : :
: : : : : : : : : : : : : : : : : : : : : : : :
: : : : : : : : : : : : : : : : : : : : : : : :
: : : : : : : : : : : : : : : : : : : : : : : :
: : : : : : : : : : : : : : : : : : : : : : : :
: : : : : : : : : : : : : : : : : : : : : : : :
: : : : : : : : : : : : : : : : : : : : : : : :
: : : : : : : : : : : : : : : : : : : : : : : :
: : : : : : : : : : : : : : : : : : : : : : : :
: : : : : : : : : : : : : : : : : : : : : : : :
: : : : : : : : : : : : : : : : : : : : : : : :
: : : : : : : : : : : : : : : : : : : : : : : :
: : : : : : : : : : : : : : : : : : : : : : : :
: : : : : : : : : : : : : : : : : : : : : : : :
: : : : : : : : : : : : : : : : : : : : : : : :
: : : : : : : : : : : : : : : : : : : : : : : :
: : : : : : : : : : : : : : : : : : : : : : : :
: : : : : : : : : : : : : : : : : : : : : : : :
: : : : : : : : : : : : : : : : : : : : : : : :
: : : : : : : : : : : : : : : : : : : : : : : :
50 53 55 57 58
5 Algebras
5.1 5.2 5.3 5.4
De nition and Properties : : Initial Algebras : : : : : : : The Initial Algebra Functor Map Operator : : : : : : : :
: : : : : : : : : : : : : : : : : : :
63
63 68 71 73
6 Fixed Point Calculus 6.1 The Fusion Rule : : : : : : : 6.2 The Abstraction Theorem : 6.3 The Beautiful Theorem : : : 6.4 The Rolling Rule : : : : : : 6.5 The Square Theorem : : : : 6.6 The Exchange Rule : : : : : 6.7 The Diagonal Rule : : : : : 6.7.1 One Half : : : : : : : 6.7.2 The Other Half : : : 6.8 Mutual Recursion : : : : : : 7 Monads 7.1 Introduction : : : : : : : : : 7.2 Monads and Adjunctions : : 7.3 Basic Adjunction : : : : : : 7.4 Lifted Adjunction : : : : : : 7.5 Decomposition Theorem : : 8 Applications to Lists 8.1 Preliminaries : : : : : : : : 8.2 Theorems : : : : : : : : : :
78 82 86 89 91 94 100 100 103 106
77
111
111 112 113 116 118
: : : : : : : : : : : : : : : : : : : : : : : : : : 121 : : : : : : : : : : : : : : : : : : : : : : : : : : 126
121
Category Theory
June 12, 1998
1998
. Ultimately the intention is to write a document that does emphasise the relevance to programming and is accessible to the uninitiated.Chapter 1 Introduction
This document is about programming. The document contains lots of programs all to do with transforming one datatype to another. It is also about type theory. it may seem that the document contains no programs and has nothing to do with programming. According to this view. The current document does give particular attention to a categorical formulation of type structure and its relationship to constructive type theory. Category Theory 1 June 12. the relationship between the work reported here and categorical accounts of type structures is one that we have only just hinted at. It is not a document for the fainthearted since one of its main purposes is as a repository for the complete proofs of properties included in articles submitted to conferences where space constraints force us to omit the proofs. The work reported here has its origins in the rstnamed author's interest in constructive type theory.1. The programs are not written in a conventional programming language but in the language of mathematics. We have not discussed it in depth because we ourselves are not capable of doing so at this point in time. To the uninitiated. but these are only the means and programming is the end. We cannot o er any solace to the uninitiated. As a working document. it contains unrefereed material and is subject to ongoing revision. therefore. several concepts of lattice theory are instances of concepts of category theory as shown in table 1. lattice theory and category theory. In 2] the importance and relevance of constructive type theory to program design was argued we shall not reiterate the arguments here . The paper concluded as follows: Finally. Nevertheless it is a topic that we believe will receive particular attention in the future. Category theoreticians view a preordered set as a particular sort of category in which there is at most one arrow between any pair of objects. This is a working document used by the authors to collate their ongoing research and make it available to anyone who might be interested in reading it.
This idea is not new. Indeed. Pratt 22] has observed the relationship between the CurryHoward isomorphism between propositions and types. In the textbook by Rydeheard and Burstall 23]. on the other hand. and Smyth and Plotkin 26] acknowledge \the wellknown analogy between partial orders and categories" as the basis of their generalisation of the solution of xed point equations to the construction of initial xed points. the wellknown focal point of constructive type theory. is that lattice theory is a valuable source of inspiration for novel results in category theory. a category without sums and products has little relevance. with as basic di erence
It has been remarked that we should say \preorder" theory rather than \lattice" theory. however. Apart from Lambek cited earlier. it is the thesis of this document that for the purposes of advancing programming methodology category theory may pro tably be regarded as \coherently constructive lattice theory1 ". the emphasis on program construction as a byproduct of the manipulation of types. and residuated lattices. arrows between objects of a category may be seen as \witnesses" to a preordering between the objects. There is something more to be gained from looking at category theory in this way. in Scott's work 25] there is a clear progression from lattice theory to category theory. Thus. If we are able to explain category theory as an extension of lattice theory.2 Lattice theory is an instance of concept the category theory concept preorder category monotonic function functor (pointwise) ordering natural transformation between functions between functors supremum colimit least initial Galois connection adjunction pre x point algebra closure operator monad Table 1.e. From the point of view of computing science. it is indeed lattice theory that is our source of inspiration. The latticetheoretic properties we are studying and the organisation of those properties are documented in 1]. Adopting this view of category theory. advocated by Lambek 13]. Introduction
An alternative viewpoint. 1998
.1: Lattice theory versus category theory
1. Most recently. Category theory is \coherently constructive" because it is also a theory about the relations between such witnesses (i. the existence of commuting diagrams and naturality properties). viz. That is to say. Category theory is thus \constructive" because it is a theory about how to construct such witnesses rather than a theory solely about their existence.
1
Category Theory
June 12. the theory's contribution to programming methodology can be likened to the contribution of constructive type theory. the idea that category theory is constructive is the explicit theme although they do not make the link with lattice theory. It turns out to be very bene cial in improving our own understanding of category theory.
their existence being all that's needed. then the witnesses are relevant. Second. Chapter 4 is about one of the most important concepts in category theory viz.
Category Theory
June 12. all explained from the point of view that important categorical concepts correspond to latticetheoretical concepts. the nodes in a diagram are only written down once. However. Unavoidable preliminaries are rst an introduction to the basic de nitions of category theory and some elementary properties. if your interest is in the construction of programs. as ours is. For small problems it can be illuminating and save some writing. which corresponds in lattice theory to the notion of a pre x point. 1998
. This is done for two reasons. we want to avoid the use of diagrams. We don't reject the use of diagrams. First. that turns out to be useful later.3 the introduction of witnesses. So. which in a publication are normally omitted. which corresponds in lattice theory to a Galois connection. the rolling rule and the diagonal rule. because a diagram doesn't make clear in which order the arrows are drawn and why the construction is indeed correct. an adjunction. However. Furthermore. Those familiar with publications on category theory will be surprised that this paper contains very few diagrams. We have no idea how in such situations we can e ectively use diagrams. for category theoreticians the construction of witnesses to a proof is a byproduct not relevant for further calculations. the authors have limited experience with category theory. This is the content of chapter 2 which is immediately followed in chapter 3 by two substantial examples of the methodology of deriving category theoretic results by generalising from lattice theory. We frequently deal with more than one category at once. while in normal calculations they are repeated several times. In that same chapter we'll also immediately use two of them to derive yet another categorical xed point rule. Finally in chapter 8 the categorical xed point rules are used to establish isomorphisms between certain list structures and at the same time construct the corresponding witnesses. In chapter 6 we derive the four basic categorical xed point rules. This paper contains a large number of detailed proofs. This paper is oriented to the derivation of categorical xed point rules corresponding to four basic xed point rules in lattice theory  the abstraction theorem. When stating the theorem. we wanted to verify all the minute details. we have tried to separate these speci c details from the theorem itself by putting them under the name \Speci cs". the fusion rule. then category theory could become more understandable for a wider audience. In particular. a diagram is drawn within one particular category. For them the knowledge that two elements are isomorphic is enough and what the witnesses are is not considered to be relevant. In chapter 5 the notion of an algebra is introduced.
4
1. Introduction
Category Theory
June 12. 1998
.
g 2 x y and h 2 y z :
id
w
) f g2x
z :
f = f = f id ^ (f g) h = f (g h) :
x
Category Theory
5
June 12. We denote the collection of all arrows to x from y by x y . Thus. 1998
.Chapter 2 Basic De nitions
In this chapter we summarise the most elementary notions of category theory  category. A deductive system is a graph in which to each object x there is associated an arrow id with codomain and domain both equal to x .1) id 2 x x
x
and to each pair of arrows f 2 x y and g 2 y z there is associated an arrow f g with codomain x and domain z . Chapter 3 presents two substantial illustrations of this viewpoint. and two mappings from the class of arrows to the class of objects. De nitions are taken from 14] with some notational adaptations. The codomain and domain mappings are denoted by cod and dom .
x
(2. We also often say that f is to x and from y . functor and natural transformation. respectively. the class of arrows and the class of objects . called the codomain and domain mappings. i. That is. A graph consists of two classes. A category is a deductive system in which the following equations hold for all arrows f 2 w x . f 2 x y is synonymous with cod:f=x^ dom:f=y . and f g is called the composition of f with g .1 Categories
We begin with the de nition of a category via the notions of a graph and a deductive system. We emphasise the viewpoint that a category is a \constructive" preorder such that the \witnesses" to orderings are \coherent".
2.2) f 2 x y ^ g 2 y z
x
The arrow id is called the identity arrow on x .e. (2.
they are each other's inverses. Specifically. Rule (2. f 2 x y and there exists an arrow f 2 y x that is its inverse. So. 1998
.6
2. and locally small if for each pair of objects x and y the class of arrows to x from y is a set. if we have an expression and it may not be clear in which category we are working then we'll tag that expression in some way with the intended category.
x y
Suppose we de ne the relation w on objects in a deductive system by x w y 9(f f 2 x y) : Then w is re exive (by (2. This means that x and y are isomorphic. Thus the objects of a (small) deductive system form a preordered set under this relation. To prevent confusion. we sometimes mention explicitly to which category an arrow belongs. we can de ne objects of a category D to be some subclass of the arrows of C . i. In this sense. The axioms of a category say that witnesses must be coherent. category theory is constructive: it is a theory about how to construct such witnesses rather than a theory about the existence of the witnesses.e. Assuming w w x
::
w x
Category Theory
June 12. For example. in category D we might have arrows to arrows of C from arrows of C . we often write f 2 x = y . Consider the identity axiom: the requirement that id f = f = f id whenever f 2 w x . then we denote the arrow ' in D to f from g by
'2f
D
g :
In general. Borrowing jargon from constructive type theory we can read \ f 2 x y " as \ f witnesses the ordering x w y ". we write f 2 x = y 3 g . dom:f = cod:g ) cod:(f g) = cod:f^ dom:(f g) = dom:g : We sometimes refer to this (and other elementary rules about the domain and codomain mappings) as (co)domain calculus . A graph is said to be small if the classes of objects and arrows are sets. = is transitive: if f 2 x = y and g 2 y = z then f g 2 x = z . For example.2)). Finally. If this is the case we write x = y or. given a category C . Similarly. We also say that x and y are equal up to isomorphism.1)) and transitive (by (2. It is often the case that one category is de ned in terms of another. Basic De nitions
We use the notation x2C to denote that x is an object of the category C . if we want to be explicit about the arrows.2) can be stated solely in terms of the domain and codomain mappings. We sometimes use the notion f to denote the inverse of an arrow f: As a result. in each case. if f and g are arrows in C . the underlying graph is small. Objects x and y in the same category are said to be isomorphic if there are two arrows f 2 x y and g 2 y x such that f g = id and g f = id . we talk of a small deductive system and a small category if. Note that the use of the membership symbol in the above de nitions should not be taken to imply that we only consider small categories.
In the remainder of this section we present some elementary properties and theorems concerning initial objects.4) id = ( a = a]) : Second: We have the following fusion theorem. g 2 x y and h 2 y z . id f and f id . By instantiating f x = id a in (2. there is a unique arrow to x from a: The corresponding concept in lattice theory is least element. If we augment these arguments with the construction of witnesses to the ordering we obtain (f g) h and f (g h) . Our own understanding of category theory is that all concepts in the theory admit the same decomposition: Underlying the categorytheory concept is a concept in lattice theory to this is added a constructive element. a category. The de nition of a category is decomposed into three parts: a graph. a is initial in C if and only if. The identity axiom says that these must be the same.
:
(2. The coherence requirement is the uniqueness of such arrows. Speci cally. 1998
. If we augment these arguments with the construction of witnesses to the ordering we obtain f . That is.
: :
a a
:
Category Theory
June 12. x w y and y w z there are two di erent ways we can combine the orderings into the ordering w w z : we may rst combine w w x and x w y by transitivity to obtain w w y and then combine the latter with y w z .3) we obtain: (2. or we may begin by combining x w y and y w z to obtain x w z and then combine this with w w x .1 presents a more substantial example.2. respectively. Section 3. In general. the construction of witnesses is required to be \coherent". An initial object in a category is an object a such that. A similar argument applies to the associativity axiom: the requirement that (f g) h = f (g h) whenever f 2 w x . for all arrows f and all objects x in C . by arguing that w w w (by re exivity) and w w x (by assumption) and hence by transitivity w w x . 18] and Fokkinga 8]. nally. or by arguing that w w x (by assumption) and x w x (by re exivity) and hence by transitivity w w x .3) f 2 x C a f = (C x = a]) : Most often we will drop the parameter C . we denote the unique arrow in a category C to an object x from an initial object a by ( C x = a]) .
w x
2. Following Malcolm 17. for each object x in the category. the coherence requirements state that the order in which the basic rules of category theory are applied has no e ect on the obtained witnesses. First: Let a be an initial object.2 Initial Objects
The simplest illustration of the coherently constructive nature of category theory is the notion of an initial object in a category. The constructive element in the de nition of initial object is that there exists an arrow from the object to each object in the category. a deductive system and. Initial Objects
7
there are (at least) three ways of concluding that w w x : immediately. We give the theorem this name because it gives conditions under which an arrow can be \fused with" an arrow from an initial object. a mechanism for building \witnesses" to orderings nally. given that w w x .2. There are three elementary consequences of the de nition of an initial object.
F is called a (covariant) functor to C from D if F maps objects of D to objects of C and arrows of D to arrows of C in such a way that: for all objects x and y in D
F:f 2 F:x
Category Theory
C
F:y ( f 2 x
D
y :
June 12. 1998
. suppose f 2 x y . So our use of the word \fusion" is not without precedent. Theorem 2. the hard work of applying them still has to be done. read as a righttoleft transformation.6 \theorems" because of their relative importance. the theorem can be seen as a rule for \defusing" an arrow from an initial object into two arrows.6 are so trivial. The proof is left as an (easy) exercise for the reader. Their importance is conceptual. least elements are unique.e. We have taken the liberty of calling 2.5 Let a be an initial object and let x and y be arbitrary objects in a category. De nition 2.5 forms the basis of a number of program transformation rules enabling programs to be made more e cient 9.
2
2. then f ( y = a]) = ( x = a]) :
: :
Proof
(
2
f (y = f f (y = f f2x y
:
:
a]) = ( x = a]) (2. Furthermore.5 and 2.7 (Functor) Given are two categories C and D . Among these rules are ones for \loop fusion" which state when two repetitions (\loops") can be combined (\fused") into one. Basic De nitions
(Alternatively.) Theorem 2.8
2. 8]. They emphasise the importance of identifying mathematical notions as initial objects in suitable categories. In a category initial objects are unique up to isomorphism. Because the proofs of theorems 2.5 and 2. composition g :
: :
Third: In a partially ordered set. i.3 Functors
The concept of a monotonic function in lattice theory is captured in category theory by the concept of a functor.3) g a]) 2 x a ( y = a]) 2 y a . Theorem 2.6 Initial objects in the same category are isomorphic. a preordered set where the ordering is also antisymmetric.
then IdC denotes the identity functor on C .2. F is called a contravariant functor to C from D if F maps objects of D to objects of C and arrows of D to arrows of C such that: for all objects x and y in D
F:f 2 F:y
C
F:x ( f 2 x
D
y :
(Note the reversal of x and y .) Furthermore. Functors
9
Furthermore. F must also satisfy the following two coherence requirements. The subscript C is often omitted. Category Theory June 12. 1998
2
. It maps objects and arrows of C to themselves.3.
De nition 2. F must also satisfy the following two coherence requirements. Let f and g be two arrows with dom:f = cod:g then
F:(f g) = F:f F:g
and for each object x in D
F:id = id
x
F:x
:
The two coherence requirements on functors re ect the fact that there are two proofs of each of the properties:
2
F:x w F:z ( x w y^y w z
and
F:x w F:x
given that F is a monotonic function.8 (Contravariant Functor) Given are two categories C and D . An antimonotonic function in lattice theory corresponds to a contravariant functor. Let f and g be two arrows with dom:f = cod:g then
F:(f g) = F:g F:f
and for each object x in D
F:id = id
x
F:x
:
(Note the reversal of f and g: ) If C is a category.
A discrete category is a category in which the only arrows are the identity arrows.4 Natural Transformations
A natural transformation between functors in category theory corresponds to the pointwise ordering of monotonic functions. C is a discrete category whenever.10
2. and all arrows f . De nition 2.5.1 Discrete Category
Trivial examples of categories are the discrete categories.
2
F:x F:f
"
x
G:x
"
G:f
Note that arrows in the diagram point from right to left or from bottom to top.5 Examples of Categories
2. Basic De nitions
2. A natural transformation to F from G is a family of arrows. f 2 x C y x = y^f = id :
x
Category Theory
June 12. This is shown in the following diagram which provides a useful way of remembering the requirement. such that 8(x x2D 2 F:x C G:x)
:: : :
x y x
and.
F:y
y
G:y
2. This facilitates reading o the coherence requirement: just remember to always read from left to right and from top to bottom in the normal way. for all objects x and y . 1998
. More speci cally. in lattice theory we have the pointwise _ ordering w on monotonic functions de ned by: let f and g be monotonic functions _ f w g 8(x f:x w g:x) : In category theory we have a similar de nition. Formally. but  as usual in category theory  with an extra coherence requirement. for each arrow f 2 x D y . one for each object x2D . F:f = G:f :
The coherence requirement arises from the fact that an arrow to F:x from G:y can be constructed in two di erent ways.9 (Natural Transformation) Given are two categories C and D and two functors F and G to C from D .
This category has the same class of objects and the same class of arrows but with the codomain and domain turned around. is a category. What does it mean for to be a natural transformation between F and G ?
2
Given a category C we also have a socalled opposite category C op .5.5.
2. So. and 2 the discrete category with exactly two objects. Using the notation Category Theory June 12. In the category C op such an object a is called a terminal object. there is a unique arrow from a to every other object in the category C . i. 1998
. f 2 x y is an arrow in C op if and only if f 2 y x is an arrow in C . Using the notation previously introduced for arrows. That is.3 Category of Categories
2. Suppose F and G are both functors of type C 2 . we let F 2C D denote the functor to the category C from the category D . Having introduced the concept of a small category. the set of monotonic functions to C from D forms a preordered set under the pointwise ordering of functions.5. The objects of Cat are small categories and the arrows of Cat are functors. we don't have to give special treatment to contravariant functors separately from (covariant) functors.5. Correspondingly. 0 denotes the (discrete) category with no objects.4 Functor Category
Given the preordered sets C and D . More speci cally. Let a be an initial object in the category C . Then Fun(C D) .10 Simplify the de nition of a functor in the case that the domain category is 0 . Because of the existence of an opposite category.) Composition of two functors F 2C D and G 2D E is denoted by F G 2C E . For example. constructed as follows. (We use this notation also for nonsmall categories. we can talk about a category of small categories denoted by Cat .e. in the opposite category C op there is unique arrow from every other object to a . Note that Cat itself is not a small category in just the same way as there is no set containing all sets. we often make use of discrete categories.2. Examples of Categories
11
The discrete categories with a nite number of objects will be denoted by their number of objects in a bold font. in particular as socalled \shape categories". 1 or 2 .2 Opposite Category
2.
Exercise 2. let C and D be categories. a contravariant functor F to C from D can be viewed as a (covariant) functor by replacing its codomain by C op or its domain by Dop . The objects are the functors to C from D and the arrows are natural transformations. Trivial though they may be.
1998
. Sometimes we write F 2C D . Without proof we state them here. Then (2. is denoted by F and de ned pointwise by ( F) = for each object x in D. and sometimes we write F2Fun(C D) . we can construct F 2 Fun(C E ) Fun(D E ) and F 2 Fun(E D) Fun(E C ) . given a functor F 2C D and a category E . I. Similarly. We leave the veri cation of the coherence requirements needed to prove that we have indeed de ned two functors as an exercise. where x2D. where G H 2 Fun(E C ) . It may be confusing at rst but after a while one gets used to the idea! Given a monotonic function f 2C D and a preordered set E we can construct two monotonic functions f 2 (C E ) (D E ) and f 2 (E D) (E C ) from monotonic functions to monotonic functions. The de nition of F is as follows.11) ( ) = . Finally. For every functor G2Fun(D E ) we have: (F ):G = F G : Application of F to the natural transformation 2 G H .e. is denoted by F and de ned pointwise by (F ) = F: for each object x in E .12) (id F) = id . Basic De nitions
previously introduced for arrows.12
2. will be denoted by End:C .13) F id = id F
x x x x F:x x x x F:x
Category Theory
June 12. having introduced the functors F and F there are all kinds of coherence properties relating natural transformations F and F . These are functors from a functor category to a functor category. we let 2 F G denote the natural transformation to F from G: Composition of arrows 2 F G and 2 G H is de ned by (2. but in the rst case the emphasis is on the fact that a functor is an arrow. for every functor G2Fun(E C ) we have: ( F):G = G F : Application of F to the natural transformation 2 G H . Both meanings boil down to the same thing. meaning that F is an object in the functor category. i.e. Similarly. meaning that F is an arrow in the category Cat with codomain C and domain D . id F 2 F F is de ned by (2. commonly referred to as Godement's rules. where x2D. The category of endofunctors on C . Note that functors are arrows in the category Cat and objects in the category Fun(C D) . where G H 2 Fun(D E ) . Suppose F and G are functors and and are natural transformations all of appropiate type. The identity arrows are the identity transformations. They are de ned by (f ):g = f g and ( f):g = g f where denotes function composition. and in the second case that it is an object. Fun(C C ) .
2.5. Examples of Categories (2.14) (F G) = F (G ) (2.15) (F G) = ( F) G ) = (F ) (F ) ) F = ( F) ( F) : (2.16) (G ) F = G ( F) (2.17) F ( (2.18) (
13
Finally, suppose 2 F G and 2 H K . Then and can be composed to form a natural transformation, denoted , of type F H G K called their vertical composition. Speci cally, (2.19) = ( H) (G ) = (F ) ( K) : The two di erent but equal ways of de ning vertical composition (expressed by the equality between the last two terms) is commonly known as the interchange law for functors and natural transformations. Let 2 F G . De ne by ( ) = H for all functors H . Then we have for all functors H ( ) 2FH GH and by (2.19) for all 2 H K (F ): ( ) = ( ) (G ): : Thus, is a natural transformation. More speci cally,
H
:
H
K
H
Furthermore, by (2.18), ( ) = and, by (2.16), (id F) = id (F ) . In other words, postcomposition  the function mapping F to F and to  is a functor to the category Fun(Fun(C E ) Fun(D E )) from the category Fun(C D) . Similarly, let 2 H K . De ne by ( ) = F for all functors F . Then, precomposition  the function mapping F to F and to  is a functor to the category Fun(Fun(E D) Fun(E C )) from the category Fun(C D) .
F
2F
G :
2.5.5 Sum Category
Suppose C is a category and J 2 Cat C . That is, J:x is a category for each object x in C and J:f is a functor for each arrow f in C . Then we de ne the sum category C J of J in the following way. The objects are pairs (x y) where x 2C and y 2 J:x . (Thus the objects are elements, y , of the collections of objects J:x accompanied by a \tag", x , indicating from which collection they are drawn.) The arrows are pairs (f g) satisfying (2.20) (f g) 2 (u v) Category Theory
CJ
(x y)
f2u
C
x ^ g2v
J:u
(J:f):y : June 12, 1998
14
J:x y x
2. Basic De nitions
The identity arrow on object (x y) is (idC id ) . Composition of arrows is de ned by (2.21) (f g) (h k) = (f h g (J:f):k) : In the case that J is a contravariant functor, i.e. a functor of type Cat C op we de ne C J by: the objects are pairs (x y) where x 2C and y 2 J:x , and the arrows are pairs (f g) satisfying (2.22) (f g) 2 (u v) C (x y) f 2 u C x ^ g 2 (J:f):v y : The identity arrow on object (x y) is (idC id ) and composition of arrows is de ned by (2.23) (f g) (h k) = (f h (J:h):g k) :
J J:x J:x y x
For a contravariant functor, J , the above construction is called the Grothendieck conR struction. Such a functor is called an indexed category . Instead of C J the notation J R (or C J if it is desired to make the category C explicit) is also used. Exercise 2.24 The de nition of the composition of arrows in C J simpli es considerably when the category C is a discrete category. What is this simpli cation? Suppose C is the discrete category with two objects 0 and 1. Suppose J 2 Cat C is such that J:0 = A and J:1 = B . It is usual to write A B instead of C J . Apply the de nition of C J in this case to determine what the objects and arrows of A B are.
+ +
maps functors to categories. The question that immediately arises is whether the de nition of can be extended to map natural transformations (arrows in the functor category Cat C ) to functors (arrows in the category Cat ) in such a way that it is a functor. This can indeed be done. The exercise is a tedious one since it involves careful unfolding of several de nitions. Nevertheless, it is worthwhile working through some of the details in order to gain familiarity with the various de nitions. In order to derive the educational bene t without too much of the tedium we present some of the details for you. We have to de ne for each natural transformation . Suppose 2 J K . Then should be a functor (an arrow in Cat ) of type C J C K . Thus, the rst task is to de ne the application of to objects and to arrows in the category C K . Guided by the type requirements, we de ne on objects by :(u v) = (u :v) for each u2C and v 2 K:u . Verify that this meets the requirement that :(u v) 2 C J . (You will need to use the fact that is a functor. How much of the de nition of a functor do you actually use?) Also guided by the type requirements, we de ne on arrows by :(f g) = (f :g) C whenever f 2 u x and g 2 v (K:f):y . Verify that this meets the requirement that C :(f g) 2 :(u v) :(x y) . (Here you will need to use the fact that is a natural transformation.) Verify in addition that preserves identities and distributes through composition.
u u u K:u J
Exercise 2.25 In the construction of the sum category,
2
Category Theory
June 12, 1998
2.5. Examples of Categories
15
2
Another important category, the category of algebras, is treated in chapter 5.
Category Theory
June 12, 1998
Basic De nitions
Category Theory
June 12.16
2. 1998
.
To obtain the categorical version of this fact we replace \poset" by \category". The second of the two \Yoneda's lemma" is (in our view) transformed in this way from a relatively di cult proposition to a straightforward. the function least is monotonic. 1998
. but tedious. the category S:x has an initial object given by InitObj:x . The proof is elementary. Suppose further that. if S is an antimonotonic function (i. Suppose (D ) is a poset and fx x2D S:xg is a set of sets and suppose that each set S:x has a least element least:x . for each x in D . We begin with the statement of the lemma in lattice theory. In this case. Were we to provide the details immediately it would suggest that we always somehow guess what the de nition is and then verify that our guess is correct.Chapter 3 Elementary Illustrations
In this chapter we present two elementary illustrations of the methodology of deriving categorical results by generalising from lattice theoretic results. We get:
: : : :
Lemma 3. \least" by \initial" and \monotonic function" by \(covariant) functor". and S 2 Cat D is a contravariant functor.1 The Initial Functor
In this section we present a relatively straightforward but nevertheless substantial illustration of the constructive nature of category theory.e. Then there is a functor Init 2 S D . one. we postpone giving the details of the functor Init because we want to illustrate how its de nition is constructed . It will also be useful to us later on.
In the future. S:x S:y ( x y ). whenever we state a lemma such as this one we will simultaneously provide all details. Then. \antimonotonic function S " by \contravariant functor S ".
3. The lemma we prove combines the notion of a sum category with the notion of an initial object and is thus a good illustration of categorical concepts per se .1
2
Suppose D is a category. but that is not the case! Category Theory 17 June 12. however. the indexed set of sets \ fx x2D S:xg " by S .
On arrows f 2 x D y the requirement for Init to be a functor is: Since arrows in S are. Elementary Illustrations
Referring to the de nition of a functor (de nition 2.2). 1998
. de nition of identity arrows in S g (id InitArr:id ) = (id idInitObj ) f pair forming g InitArr:id = idInitObj f initiality of InitObj:x g
S S:y S:y
Init:f 2 Init:x
S
Init:y :
:
:
x
:x
x
x
x
:x
x
:x
(
InitArr:id
f
x
2 InitObj:x S:id = id
x
S:x
S:x
g
InitObj:x
Category Theory
June 12. In the case of object x we de ne Init:x = (x InitObj:x) this being the obvious way to satisfy the requirement that Init:x 2 S . de nition of Init:x and Init:y g D 2 x y ^ 2 (S: ):(InitObj:x) InitObj:y f =f g 2 (S:f):(InitObj:x) InitObj:y f InitObj:y is initial in S:y g = ( S:y (S:f):(InitObj:x) = InitObj:y]) The unique way of satisfying the type requirement on Init:f is thus by letting: (3.7). Init:id = idInit f de nition of Init : (3. pairs we postulate that Init:f = ( ) and we calculate suitable de nitions of and as follows: ( ) 2 Init:x Init:y f de nition of an arrow in S : (2. For brevity we use InitArr:f to denote the second component of Init:f . First the veri cation that identity arrows are mapped to identity arrows.22). by de nition.2) Init:f = (f ( S:y (S:f):(InitObj:x) = InitObj:y])) : We now have to verify that Init maps identity arrows to identity arrows as well as distributing through the composition of two arrows.18
3. we have to de ne Init on objects and arrows of D .
1998
3.3.2 Yoneda's Lemma
In this section we illustrate the idea of category theory as coherently constructive lattice theory by showing how to formulate and prove Yoneda's lemma. Yoneda's Lemma
InitArr:id
19
S:x x
true : Now we prove that Init distributes through composition.
f
x
2 (S:id ):(InitObj:x) by construction g
InitObj:x
3.23) g (f g InitArr:(f g)) = (f g (S:g):(InitArr:f) InitArr:g) ( f pair forming g InitArr:(f g) = (S:g):(InitArr:f) InitArr:g f initiality: both terms have domain InitObj:z g cod:(InitArr:(f g)) = cod:((S:g):(InitArr:f) InitArr:g) ( f construction of InitArr . By `a monotonic predicate' we mean a predicate p such that: (p:x ( p:y) ( x w y : In lattice theory we have the following lemma. Category Theory June 12. Then.1 In Lattice Theory
. cod:(f g) = cod:f g (S:(f g)):(InitObj:x) = cod:((S:g):(InitArr:f)) f S is a contravariant functor.2. Init:(f g) = Init:f Init:g f de nition g (f g InitArr:(f g)) = (f InitArr:f) (g InitArr:g) f de nition of composition in S : (2.2. Suppose f 2 x y and g 2 y z . S:g is a (covariant) functor g (S:g S:f):(InitObj:x) = (S:g):(cod:(InitArr:f)) f cod:(InitArr:f) =(S:f):(InitObj:x) g true : This completes the proof.
4) as the equality: (3. Among its corollaries is the rule we call indirect equality  a rule that is equally simple but which deserves a name because of its ubiquity. Then.3 Suppose p is a monotonic predicate and x is an arbitrary element of the domain of p: Then.7) p x monotonic:p p:x] = p x monotonic :p p ( y y w x]] : Now note that the three predicates in this equality are all monotonic functions. particularly for restricting the domain of a function. The freedom to include domain information is a useful device.3 (noting that p is indeed monotonic). The predicate p x p:x] is the evaluation function (restricted to monotonic predicates). or by x f:x] 1 if the domain is clear from the context.6) x w z 8(y y w z ( y w x) : The result follows from (3.
:: : ::
2
2
We now formulate and prove a lemma similar to (3. (3. x = z 8(y y w z y w x) : Proof Instantiate p:x = (x w z) in lemma 3. using extensionality three times.6) with x and z interchanged. and antisymmetry.3) but within a categorical framework. Then we have (3.5 (indirect equality) For arbitrary elements x and z . Elementary Illustrations
Lemma 3. (We have refrained from writing just a dot on the lefthand side of the equation because it would most probably confuse a great many readers!) It is monotonic in the argument p by de nition  with respect to the pointwise ordering on predicates: p(q 8(x p:x ( q:x) : It is also monotonic in the argument x by virtue of the following simple calculation: p monotonic:p p:x] ( p monotonic :p p:y] f de nition of pointwise ordering g 8(p monotonic :p p:x ( p:y) ( f de nition of monotonic predicate g
: : :: : : : : :: :: :: : : : : : :
xwy :
In the more familiar lambda notation this would be written x:fx . We rst make the following observation. we can rewrite (3.6). Suppose we denote function f with domain A by x x2A f:x] . (3. 1998
.4) p:x 8(y p:y ( y w x) :
::
The lemma is so simple that it doesn't have a name. It is the function denoted by the in x dot.20
3. Corollary 3.
1
Category Theory
June 12.
Let us begin with the evaluation function. This leads to de ning :f as F:f . and predicate p by a functor F 2 Set C for a locally small category C .9) (assuming that F and G are monotonic.2 The Evaluation Functor
There is an alternative to the rst step in the above calculation. In other words :f must satisfy (3. We urge you to write down the (rather trivial) veri cations.9) F:x w G:y ( F w G^x w y :
3. We still have to verify the coherence requirement on the evaluation functor. functors F G 2 Set C and natural transformation 2 F Fun(Set C) G we have to construct an arrow :f 2 F:x Set G:y . That is.8) :f 2 F:x G:y ( 2 F G ^ f 2 x y : Compare this requirement with the monotonicity of the evaluation function: _ (3.2.
x x
Compare also the proof of (3. It will help you shortly to understand the categorical equivalents. Thus. monotonic function by functor. 1998
. In order to \lift" (3. arrow f 2 x C y . for given objects x y 2C . Moreover. :f = G:f satis es the requirement (3. G:f 2 G:x G:y :f = G:f g 2 F:x G:x ( f de nition of natural transformation g = : In conclusion. We have to de ne an evaluation functor for a given locally small category C .3. proof left to the reader) with the following construction of :f :
Category Theory
June 12. In addition.2. we have to de ne functorial counterparts to the three monotonic functions just discussed. It must map F 2 Set C and x2C to an object in Set : the object F:x is the obvious candidate. the other two functions are also monotonic. it must map an arrow f 2 x C y and a natural transformation 2 F Fun(Set C) G to an arrow :f in Set . Being a binary functor means that it has to be constructively monotonic in both its arguments. Since it is a binary functor we have to check that ( ):(f g) = :f :g
y
:f 2 F:x G:y ( f G is a functor. Yoneda's Lemma
21
Similarly. namely. The coherence property of natural transformations guarantees that the choice is irrelevant.8). we could have used the fact that F rather than G is a functor.7) to category theory we replace equality by isomorphism.
22
3. Elementary Illustrations
for all natural transformations and , and all arrows f and g . (Note that all three compositions are in di erent categories.) We also have to check that (id F):idC = idSet for all functors F and objects x . We leave these (simple) checks to the reader. This completes the construction of the evaluation functor and the veri cation that it is indeed a functor. In order to maintain the suggestive link with lattice theory we shall denote it by F x F2Fun(Set C ) ^x2C F:x] or, more commonly, F x F:x] . In general, when we introduce quanti ed expressions (as indicated by square brackets) the dummies range over both objects and arrows of the relevant categories. Thus, in this case, F ranges over objects and arrows of the functor category Fun(Set C ) and x ranges over objects and arrows of the category C . One nal thing to note about the evaluation functor is that the structure of the category Set has never been used  it might just as well have been some arbitrary category.
x F:x
:
:
::
for all h 2 F:u C G:y . Straightforwardly,
We still have to de ne the functors corresponding to the functions y y w x] and p x p ( y y w x]] . It pays to rst de ne a more general functor of which both are instances. Suppose p and q are arbitrary monotonic predicates (not necessarily with the same domain). Then the predicate p:x ( q:y is monotonic in x and antimonotonic in y . Let us \lift" this observation to a statement in category theory. Suppose F 2C D and G 2C E are arbitrary functors. Consider the function mapping x2D and y2E to the set2 F:x C G:y (the arrows in the category C to F:x from G:y ). This function can be extended to a binary functor that is covariant in the argument x and contravariant in the argument y: The codomain of the functor is the category Set. Its domain is the cartesian product of the category D and (the opposite of) category E . On arrows f 2 x D u and g 2 y E v we de ne F:f G:g by (F:f G:g):h = F:f h G:g
:: :: ::
3.2.3 Hom Functors (Generalised)
G:v) (F:u C G:y) : (Note the switch in the order of y and v . The unlabelled arrow on the right denotes a class of arrows in the category Set. So, F:f G:g is a function.) Moreover, (F:id G:id ):h = h F:f G:g 2 (F:x
x v
C
and
2
(F:f G:g) (F:h G:k) = F:(f h) G:(k g)
For convenience we assume that the category is locally small. That is, the arrows between a pair of objects form a set. We shall see later that this can be avoided.
Category Theory
June 12, 1998
3.2. Yoneda's Lemma
::
23
for all f , g , h and k of suitable type. (Note the switch in the order of g and k .) Thus we have indeed de ned a functor. Let us denote this functor by x y F:x G:y] , the square brackets indicating abstraction from the dummies x and y: If F and G are both instantiated to the identity functor on some category C then the functor we obtain, x y x y] , maps a pair of objects x and y onto the set of arrows to x from y . This set is called a hom set (\hom" being short for \homomorphism") and the functor is called the hom functor. Category theoreticians will recognize the functor x y F:x G:y] as the composition of the hom functor on the (common) codomains of F and G and the product of the functors F and the opposite of G .
:: ::
Given a binary functor we can always construct a unary functor by xing one of its arguments. The binary functor x y F:x G:y] thus has instances the covariant functor x F:x y] de ned on arrow f by (F:f id ):h = F:f h and the contravariant functor y x G:y] de ned on arrow g by (id G:g):h = h G:g : So we now have all the bits and pieces needed to formulate the categorical counterpart of lemma (3.3), a lemma commonly referred to as Yoneda's lemma.
:: ::
y
3.2.4 The Lemma
::
x
Lemma 3.10 (Yoneda's lemma) Suppose C is locally small. Then, F x F2Fun(Set C ) ^x2C F:x] = F x F2Fun(Set C ) ^x2C F y y x]] :
: : : : ::
2
For the proof of Yoneda's lemma we are required to construct two witnesses ' and such that ' 2 F x F:x] = F x F y y x]] 3 : We begin by constructing candidates for the natural transformations ' and . Candidate ' : Suppose x is an arbitrary object of C . For ' we observe that
:: :: ::
(F y y x]) : So, ' is a function and on 2 F y y x] we de ne it by: (3.11) ' : = :id : Candidate : For we observe that
F x
' 2 F:x
F x
Set
::
F x
::
x
x
F x
2 (F y y x])
::
Set
F:x :
June 12, 1998
Category Theory
24 Take an object a 2 F:x then
F x F x
3. Elementary Illustrations
So, :a is a natural transformation. Thus for all objects y and arrows f 2 u v we must have ( :a) 2 F:y Set (y x) ^ F:f ( :a) = ( :a) (f ) : So, ( :a) is a function and on g 2 y x we de ne it by: (3.12) ( :a) :g =(F:g):a : It remains to verify the naturality property of :a . Take g 2 v x . Then, (F:f ( :a) ):g = f de nition :a g (F:f):((F:g):a) = f composition, F functor g (F:(f g)):a = f de nition :a g ( :a) :(f g) : Thus we have derived candidates for both ' and : Inverses: We now prove that they are others' inverses. First, ' :( :a) = f de nition ' g ( :a) :id = f de nition g (F:id ):a = f F functor g
F x y F x v F x u F x y F x y F x F x v F x F x F x u F x F x F x x x x
:a 2 F Fun(Set C) y y x] :
::
id :a :
F:x
Second,
:(' : )) :g = f de nition ' and g (F:g):( :id ) = f 2 F y y x] , so F:g :g :
(
F x F x y x x
::
x
=
y
(g ) g June 12, 1998
y
Category Theory
this is unnecessary. :f ' = ' ( y y f]) :
G v F u
::
Note. ' 2 F=G 3 8(x ' 2 F:x = G:x 3 ) ^ 8(f f 2 x y F:f ' = ' G:f) :
::
x x
:
:
y
x
Category Theory
June 12. so G:f = (f ) In particular. because of the following lemma. for all f 2 u v . However.
y y f] 2 (F y y v]) Set (G y y u]) i. 1998
.2. and all 2 F G . Yoneda's Lemma
25
Naturality ' : Finally we prove the naturality property for ' .13) g ( ):f = f 2 G y y x] . it is a function and for 2 G y y u] it is de ned by (3.3.
=
F u
('
F u
(
y y f])):
:: ::
::
u
u
u
u
::
v
u
v
v
u
u
v
v
G v
G v
We now have to verify the naturality property of .e.
f application g ' :(( y y f]): ) = f de nition ' g (( y y f]): ) :id = f (3. i. (G:f):( :id ) = :f g ( G:f):( :id ) = f de nition of :f and of ' g ( :f):(' : ) composition g = f ( :f ' ): : The naturality of ' follows by extensionality.13) (( y y f]): ) = ( f) :
:: :: :: :: ::
z z z
Thus.14 (natural isomorphism) For all functors F and G .e. and our proof of Yoneda's lemma is complete.
Lemma 3.
we can derive the isomorphism.17) the witnesses are de ned as in the proof of lemma 3.16) and (3.4. (3. for an arbitrary object z .15 (indirect isomorphism) small category C . (3. 1998
. For all f 2 x y we have = id and ' = id .2. Leibniz in both directions g ' (G:f ) ' = ' ( F:f) ' f ' = id and ' = id g ' G:f = F:f ' :
x x F:x x x G:x x y y x x y x x F:x x x G:x x y
f
y
'
x
F:f
2
3. for the ( part.5 Corollaries
Just as indirect equality is a direct consequence of lemma 3. Then x = z y y x] = y y z]
:: :: : :: :: :: :: ::
Suppose x and y are objects of a locally
Proof By taking F = y y z] in lemma 3. assume
in reverse order is completely symmetric: Category Theory
2 y y z] = y y x] 3 : Then. We only prove ' :
:: ::
x z x
z
: = id . That it holds follows by the following calculation.10. Elementary Illustrations
Proof Lemma 3.26
3.17) 2 z x = y y x] y y z] 3 :
x
::
::
x
z
::
::
z
In both (3.16) ' 2 x z = y y z] y y x] 3 : Similarly. for an arbitrary object x . Now. ' : 2 x z and : 2 z x . The composition
x
June 12.14 follows almost immediately from the de nition of isomorphism and
G:f
=
natural transformation.10 we have (after some dummy renaming) ' 2 x x z] = x y y z] y y x]] 3 : Since this is a natural isomorphism we also have. The only remarkable thing is that in the ( part nothing is assumed about the naturality of . the rule of indirect isomorphism is a direct consequence of Yoneda's lemma:
Lemma 3.
3.2. Yoneda's Lemma = =
x
27
':
x x
:id
f
x
z
:
z
f
:id
de nition: ' : = :id
x x z
x
g
v u
:( :id ) = f id :
x x x
let f 2 u v then (f ) = (f ) , i.e. let g 2 v z then f :g = :(f g) g
v u
= id
y:: y
z
]
g
For the
f 2 x=z 3 g : Then, :f 2 y y z] y y x] and :g 2 y y x] y y z] Again, for reasons of symmetry, we only prove that :f :g = id ] . Suppose h 2 y z ( :f :g) :h = f de nition: ( :g) :h = ( y y x]:h):g = h g g ( :f) :(h g) = f de nition g h g f = f g f = id g h :
x
) part, assume
::
::
z
::
::
x
z
y:: y
z
x
z
y
z
y
::
x
y
x
This concludes our proof.
2
It is abundantly clear from this one example that the progression from lattice theory to category theory causes an explosion in the lengths of one's calculations. We hope to have demonstrated, nonetheless, that the process is systematic. The construction of witnesses does not add to the lengths of the proofs, although it does add extra detail. It is the veri cation of the coherence properties that is the additional burden, together with the fact that whenever a functor is introduced one must de ne it for both objects and arrows. (At the same time, however, it is the coherence properties that give the theorem in category theory its added value.) Given the tremendous amount of detail that needs to be borne in mind, it is our view that much e ort in organising and streamlining proofs in lattice theory is an essential prerequisite to tackling nontrivial problems in category theory. In subsequent chapters we present novel theorems that were discovered in this way but which we probably would never have been able to discover otherwise. Category Theory June 12, 1998
28
3. Elementary Illustrations
Category Theory
June 12, 1998
Chapter 4 Adjunctions
The concept of a Galois connection in lattice theory is captured in category theory by the concept of an adjunction. Before giving the de nition of an adjunction, we rst give the de nition of a Galois connection and show some elementary examples and properties. In lattice theory there are several alternative, but equivalent, de nitions of a Galois connection. We will show that we can also give several alternative, but equivalent, de nitions of an adjunction. In sections 4.3 and 4.4 we will prove several properties concerning adjunctions.
The combination of two partially ordered sets (C w) and (D ) , and two functions, F 2 C D and G 2 D C forms a Galois connection if the following formula holds for all x2C and y2D . (4.1) x w F:y G:x y : The function F is called the lower adjoint and the function G is called the upper adjoint. The concept of a Galois connection is supposedly \well known", see e.g. 4, 5], but even if it is not well known to the reader it is such a simple and elegant concept that no di culty should be experienced in verifying any properties that we state without proof. The concept was rst introduced by Ore in 1944 21] 1 the de nition given above is due to Schmidt 24]. The importance of Galois connections lies in their ubiquity and their simplicity. Mathematics and, in particular, computing science abounds with instances of Galois connections, although until very recently they have rarely been recognised as such. We present several elementary examples in this section. Those to whom the concept is indeed well known may skip the section.
In spite of the name, \Galois" connections were not invented by the famous mathematician Evariste Galois, but an instance of a \Galois connection" is the \Galois correspondence" between groups and extension elds to which Galois owes his fame. We shall have nothing further to say about the Galois correspondence, our attention being devoted to connections between functions in a much broader setting. Those wishing to know more about the Galois correspondence are referred to 7].
1
4.1 Galois Connections
Category Theory
29
June 12, 1998
One that is is the connection between conjunction and implication in the predicate calculus: p^q ) r q)(p)r) : Here p .30
4. q and r denote predicates and the connection is between the functions ( p^ ) and ( p) ).1 Examples


+

+

:p ) q p ( :q :
Category Theory
June 12. Adjunctions
Lots of examples of Galois connections can be given. (Two elements are ordered if and only if they are equal. by observing that two inverse functions are Galois connected. the function ( y ) (add y ) is inverse to the function ( y ) (subtract y ). We have:
x
4. It thus describes a family of Galoisconnected functions. The \golden rule" of Galois connections discussed later was discovered in precisely this way. F:x = y x = G:y : This is a Galois connection in which we view A and B as ordered sets where the ordering relation is identical to the equality relation. To be more precise. Just slightly more complex is the connection between addition and subtraction: x y=z x=z y : This formula states that. both sets A and B in the de nition of a Galois connection are taken to be the set of predicates. That inverse functions are Galois connected is a useful observation  not because a study of Galois connections will tell us something we didn't already know about inverse functions.) An example that will no doubt be very familiar is the connection between the exponential and logarithmic functions: e = y x = ln y : A yet simpler example is negation (in arithmetic): x=y x= y : Negation is selfinverse and thus Galois connected to itself. elements of the family being indexed by y . for all x2B and y2A . in the rst instance. Further examples of Galois connections are not hard to nd although sometimes they are not immediately evident. 1998
. An interesting example is provided by negation (not) in the predicate calculus. but because we can draw inspiration from our existing knowledge of properties of inverse functions to guide us in the study of Galoisconnected functions. and the ordering relation is implication ( ) ). for all y .1. Then their being inverse can be expressed by the equivalence. Suppose A and B are two sets and F 2A B and g 2B A are inverse functions. The above formula also describes a family of Galois connections. one for each instance of the variable p .
we can order predicates by implication ( ) ) or by the converse ordering followsfrom ( ( ). ordered by the atmost relation ( ).
Most texts de ne maximum via a case analysis and the above. by 4z = (z z) : Having done so we can rewrite the de nition of max as follows: max:(x y) z (x y) 4z : Thus max is a function mapping IR IR . Galois Connections
31
The example is interesting because it involves two di erent orderings on the same set. to IR . denoted by 4 . and is de ned by a Galoisconnection connecting it to the doubling function. and this relation can be extended pointwise to an ordering relation on IR IR . In the rst of the two the functions are endofunctions on the real numbers ordered by equality in the second the ordering is the usual at most relation. Now IR is ordered by the atmost relation ( ). we de ne ( u v) (x y) u x^v y : Finally. One elementary example of a Galois connection that is not immediately evident is a orded by the binary maximum operator on real numbers. Speci cally. What a shame!
2
Category Theory
June 12. To reinforce the point let us return to addition and subtraction in real arithmetic. i. First note that max is a binary function. We can however identify it as such as follows. Speci cally. 1998
. de nition is little known. All four elements form an integral part of the de nition and mistakes in the exploitation of the properties of Galois connections may occur if one is not clear about all four.1.4. a function from the cartesian product IR IR (the set of pairs of real numbers) to the set IR . Denoting it by the in x operator max . denoting the relation by . ordered pointwise by the relation . we have2 :
+ 
x max y z
x z^y z :
At rst sight this doesn't look like a Galois connection principally on account of the conjunction on the righthand side of the equation. Not only do we have the identity: x y=z x=z y we also have:
+ 
x y z x z y :
+ 
These identities express two di erent (families of) Galois connections. beautifully compact. The point is that there are four elements to the de nition of a Galois connection: two ordered sets and two functions between the ordered sets.e. Predicates ordered by implication and predicates ordered by followsfrom are quite di erent partially ordered sets. Both involve the functions ( y ) and ( y ) . we de ne the doubling function .
Adjunctions
4. Gentzen's sequent calculus 12] de nes the logic operators using socalled introduction and elimination rules. In this section we show. by example. and two functions.) There is one elimination rule for disjunction: (p)r) ^ (q)r)
) (p_q ) r)
:
It is not di cult to see that these three rules are equivalent to the one rule In general. Let us use disjunction as our rst example. it is: which is indeed the same as the conjunction of p ) p_q and q ) p_q . that such rules de ne a Galois connection. Doing so. (p)r) ^ (q)r)
p_q ) r :
To see that this is the form taken by Gentzen's rules we rst rewrite the elimination rule in the same way as we did for maximum above.32
4. Category Theory June 12. So far we have presented all examples according to Schmidt's de nition 24].2 Introduction and Elimination Rules
There are several equivalent de nitions of the notion of a Galois connection. the combination of two partially ordered sets (C v) and (D ) . we identify F as the doubling function and G as disjunction: (p q) )
x w F:y ) G:x y if also. Such subtleties will be ignored in this discussion. for all x2C . albeit not in the form proposed by Schmidt. it is obvious that the doubling function is monotonic. F 2 C D and G 2 D C forms a Galois connection if for all x2C and y2D . There are two introduction rules. Finally. nally.1.
) (r r) ) ) (p_q
(_:(p q) ) r)
We now check that the required cancellation law corresponds to the introduction rules. F is monotonic. namely:
p ) p_q
and
q ) p_q :
(Gentzen would have used a turnstile rather than an implication operator. we have the cancellation law x w F:(G:x) and. Formally. 1998 (p q) )
p_q)
.
Indeed. A very useful strategy borrowed from category theory in the study of posets is to \lift" statements about orderings between elements to statements about orderings between functions. p)q whenever _ _ 8(x x2S p:x ) q:x) . Let p be a predicate de ned on some state space S . both of type A B . Then. we de ne the relation wA B on the carrier set A B by f wA B g 8(x f:x w g:x) : As is easily veri ed. We shall adopt this strategy frequently in the sequel. Speci cally. the predicate K:r is such that. With the aid of these de nitions. However. we shall restrict our attention throughout to monotonic functions even though in speci c cases this is unnecessary. 1998
. observations are that the identity function on a set is monotonic. Speci cally.4. is de ned by the elimination rule 8(x p:x ) r) ) (9:p ) r) combined with the introduction rule
::
Let us introduce the lifted ordering ) on predicates on S .1. this would introduce additional complications that we prefer to postpone.3 Pointwise Ordering of Functions
Category Theory
June 12. we recognise yet another Galois connection. but vital. the elimination rule for existential quanti cation is then (p ) K:r) ) (9:p ) r) _ and the introduction rule is p ) K:(9:p) : _ Noting that K is a monotonic function. An example is the formulation of monotonicity of a function in terms purely of functions and function composition
: : ::
4. can be ordered pointwise. Speci cally. Galois Connections
: :
33
Gentzen's laws for existential quanti cation generalise the laws for (binary) disjunction. The set A is the carrier and w is the re exive. Two trivial.e. transitive and antisymmetric ordering relation on elements of the carrier. Then. \Partially ordered set" will be abbreviated from now on to \poset". (A B wA B ) is also a partially ordered set. 9:p (i. 9(x x2S p:x) ). a function f 2 A B is monotonic if 8(x y x y f:x w f:y) . for all x2S .
: :
p:a ) 9:p :
Suppose A = (A w) is a partially ordered set. We write f 2A B whenever this is the case.1.) Suppose B = (B ) is also a poset. (K:r):x = r . Functions f and g . Let us also introduce K to denote the constant function mapping proposition r to predicates on S . and the composition of two monotonic functions is also monotonic. (In fact the assumption that A is a preorder su ces and ts in better with the discussion of the generalisation to category theory.
we obtain two cancellation properties.
Instead of stating the de nition of a Galois connection in terms of points it is useful to restate it in terms of functions. and two functions.1. with these cancellation properties it is straightforward to prove that both F and G are monotonic. the combination of two posets (A w) and (B ) . forms a Galois connection if and only if for all functions h and k of appropriate type.34
4. Pointfree these properties are expressed as follows (4.3) Id w F G where Id denotes the identity function.4) h w F k G h _ k : Category Theory June 12.
rather than function application. but which ordering is intended will never be ambiguous. First of all. _ (4.1) in such a way that one side becomes true. (F G) is a Galois connection i the following two clauses hold: _ G F _ I and I w F G
F and G are monotonic. These properties of a Galois connection give rise to an alternative de nition of a Galois connection that is equivalent to our previous formulation. Furthermore. F 2 A B and G 2 B A . 1998
. we have (for all C ): f is monotonic 8(g h g wB C h f g wA C f h) : Letting f denote the function g 7! f g we can express the above yet more strikingly:
: :
4. Speci cally. Speci cally. sometimes in one rule. Adjunctions
f is monotonic f is monotonic : Letting f denote the function g 7! g f we also have: f is monotonic : Rather than subscripting the symbol w with the type of the functions involved to indicate _ a pointwise ordering of functions we will sometimes use the symbol w instead (the point
serving to remind the reader that the ordering is pointwise). if we instantiate (4.2) G F _ Id _ (4. This has the disadvantage that the same symbol is used for di erent ordering relations. denoting composition of functions by the in x operator .4 Properties
Galois connections are interesting because as soon as we recognise one we can immediately deduce a number of useful properties of the adjoints.
Suppose. for any functions h and k of appropriate type. The main bene t that is gained from the observation is that it can suggest properties that one might investigate of Galoisconnected functions.4. direct calculations using the fact that a composition of the one function followed by the other is an identity function. for all x in the domain of F . for instance. then for all functions h and k of appropriate type. Galois Connections Another way of expressing the equivalence of (4. subscripts have been omitted from the ordering relations since they can be inferred from the given type information.6) h F w F k G h _ k G :
0 1 1 0
i
i
i
i
i
i
0
1
1
0
(As forewarned. This observation has no signi cance whatsoever for a study of inverse functions: nothing can be gained in such a study by instantiating general theorems about Galois connections that is not predicted by much simpler. and expressed at function level.
8(y G:(h:y) = k:(G:y)) : More generally.) Category Theory June 12. Then we have. Suppose the inverse functions are F and G .
x=F:y
G:x=y :
The two poset orderings needed to establish the connection are the trivial orderings whereby the only ordered elements are equal elements. and y in the domain of G . has as its inverse the logarithmic function. An important example is that inverse functions have \inverse" algebraic properties. Let h 2A A and k 2B B
:: ::
0 0 1 1 0 1 1 0 i i i i i i
8(x h:(F:x) = F:(k:x))
be arbitrary monotonic functions.4) is (4. h F =F k G h=k G : The generalisation to Galois connections takes the following form. and
1 exp ( x) = exp x
+
whereas

1 ln x = ln ( x )
and exp (x y) = exp x exp y whereas ln x ln y = ln (x y) :
+
In general.1) and (4. The exponential function. 1998
. if F and G are inverse functions then.5) (F G) forms a Galois connection (F G ) forms a Galois connection :
35
If two functions are inverses of each other then they are Galois connected. for i = 0 1 . if (F G ) and (F G ) are pairs of inverse functions.1. the combination of two posets A = (A w ) and B = (B ) and two functions F 2A B and G 2B A forms a Galois connection. Then _ (4.
7) x 8(a a w x 8(b a w f:b)) : (Some readers may be more familiar with the de nition of a supremum as a least upper bound.4) it includes the following as special cases: First. As well as subsuming (4.7). Speci cally. and F and G to F and G .) Take care to note the switch in the order of F and G . Property (4.6) does not seem to be widely known but it is soon learnt and it is particularly useful since it captures in one rule several calculational properties of Galoisconnected functions. That is.
1 1 0 0 0 1 1 0 0 1 1 0
Suppose A = (A w) and B = (B ) are posets.7) g awx :
0 0
::
1
1
Category Theory
June 12.7) g 8(b a w f:b) f x solves (4. respectively.) It is easily seen that all solutions of (4. The rule states that if F has upper adjoint G then F has lower adjoint G . we obtain: (F G) forms a Galois connection ) ( G F) forms a Galois connection : (In fact an equivalence can be proved. Second. by instantiating F and G to the identity function.5 Suprema De ning Galois Connection
awx f x solves (4. x is a supremum of f if it is an upper bound: 8(b x w f:b) and it is least among such upper bounds 8(a a w x ( 8(b a w f:b)) : This is entirely equivalent to (4. 1998
.36
4. Adjunctions
As a useful aide memoire to property (4. by instantiating h and k to the identity function.6) we suggest the slogan \Galoisconnected functions have pseudoinverse algebraic properties". and f 2A B is a monotonic function. Then a supremum of f is a solution of the equation (4.7) are equal. Hence. _ F wF G _ G : Note this time the switch in the order of subscripts. as is easily veri ed.1. F =F G =G : Thus adjoints are uniquely de ned.
:: :: :: :: :: ::
4. for all a2A .
x and x both solve (4.9) _ (between the posets A and ( A B w ) ) is put into words by saying that A is B cocomplete. Galois Connections
37
Hence. If it does. Then we recognise (4. Suppose that there is a function Sup mapping all such functions to a supremum. however. for all a2A and f 2A B . Writing f:0 t f:1 instead of Sup:f . (Dual to suprema. however. and the existence of the Galois connection (4. and the ordering relation on two functions both to A from B corresponds to the elementwise ordering on the pairs to which the functions correspond. (4.7) need not. then. we denote its solution by Sup:f . leading to the dual notion of completeness of A . By de nition.1.) If B is the twopoint set f0 1g ordered by equality then the set of functions to A from B is in (1{1) correspondence with pairs of elements (a a ) (to be precise: f7!(f:0 f:1) and (a a )7!f where f:0 = a and f:1 = a ). _ (4. We retain it.9) a w Sup:f K:a w f : The poset B is called the shape poset. we may also de ne in ma. by indirect equality. have a solution.8) as a Galois connection. equivalent and for this reason the \co" is redundant. The function K:a corresponds to the pair (a a) . That is.4. Speci cally. If A is B cocomplete for all posets B then we say that A is cocomplete. 1998
. Completeness and cocompleteness of posets are.7) ) x = x : Equation (4. of course. for a given f . 8(b a w f:b) f de ne the function K 2 (A B) A by (K:a):b = a g 8(b (K:a):b w f:b) _ f de nition of w (pointwise ordering on functions) g _ K:a w f :
0 1 0 1
::
::
::
::
Thus.9) thus corresponds to _ a w xty (a a) w (x y) :
0 1 0 1 0 1
Examples
Category Theory
June 12. our supposition becomes that there is a function Sup that is the lower adjoint of the socalled \constant combinator" K of type (A B) A . in order to emphasise the link with category theory .8) 8(a a w Sup:f 8(b a w f:b)) : Suppose we x the posets A and B and consider all functions of type A B . the Galois connection (4.
6 Parameterised Suprema
Category Theory
June 12.38 That is.10) 8(a a wA Sup:( c) KA B :a wA B c) : The goal is to solve the equation (4. thus. there is an element Sup:( c) in A satisfying (4. This function is monotonic (and thus in A C ) since it is the composition of two monotonic functions.
:: :: :: ^ ^
4. Assume that. Thus KA B is the function of type (A B) A de ned by (KA B :a):b = a : The assumption is thus that. which is the same thing). B = (B wB ) and C = (C wC ) are posets.1. and suppose A is B cocomplete. for all a2A and f 2A . We present it nonetheless in order to show the bene t of exploiting (4. A third example is the case that B is (IN ) (the natural numbers ordered in the usual way). namely the identity function (or the empty function. for all c2C . Consider function 2 (A C ) B .
0 1 2
a w xt y
a w x^a w y :
a w Sup:f :
Suppose A =(A wA ) . For brevity we denote application of to arguments b in B and c in C by b c . 1998
. That it also satis es (4.5). In words. To express the question formally we need to re ne our notation in order to avoid ambiguity. The right side of (4. If B is the empty poset then there is exactly one function of type A B .
4. for all c2C . We can answer this question by answering the following question.11) is a straightforward calculation.9) is vacuously true and. the function Sup (which is monotonic because the adjoints in a Galois connection are inevitably monotonic) and the function 2 (A B) C de ned by ( :c):b = b c . Functions in A B are then in (1{1) correspondence with chains a a a ::: . To say that A is (IN ) cocomplete is equivalent to all such chains having a supremum in A . The question is whether this information is su cient to guarantee that has a supremum. since c is a function of type A B . Where before we wrote K let us now write KA B . the function c 2A B de ned by ( c):b = b c has a supremum denoted by Sup:( c) .11) x x 2A C ^ 8(f f wA C x KA C B :f w(A C) B ) : The obvious candidate for x is the function c7!Sup:( c) . Motivated by the strategy of lifting statements about points to statements about functions we are naturally led to the question whether the poset A C is B cocomplete. the existence of Sup:( c) is implied by B cocompleteness of A . the poset A is cocomplete equivales A has a least element. Adjunctions
This is the wellknown Galois connection de ning the supremum of a bag of two elements. Note that.
4. by de nition. we have KA B f = Flip:(KA C B :f) g Flip:(KA C B :f) w(A C ) B f Flip is clearly an order isomorphism. a direct corollary is that if A is B cocomplete then A C is also B cocomplete (independently of C ). (t) = Sup: Category Theory
:
June 12. Since the existence of a supremum of ( c ) for each c is implied by B cocompleteness of A . so. ( Sup ) has upper adjoint (KA B ) g KA B f w(A C ) B f We now try to express KA B f in terms of KA C B :f : ((KA B f):c):b = f de nition g f:c = f de nition g ((KA C B :f):b):c
^ ^
Thus. In words it says that the result of abstracting from the parameter in a parameterised supremum is itself a supremum. De ne 2 (A C ) B by 0 (a a ) = a and 1 (a a ) = a . 1998
. by (4. Galois Connections
39
^
f wA C c7!Sup:( c) f see above for the de nition of extensionality g f wA C Sup f Sup has upper adjoint KA B . The element Sup:( c) is called a parameterised supremum and the theorem just proved we call the abstraction theorem for suprema. = Flip: g
^ ^
Thus. Then.
0 1 0 0 1 1
KA C B :f w(A C ) B
:
a ta = (c7!Sup:( c)):(a a ) :
0 1 0 1
Applying the abstraction theorem. de ning the function Flip by ((Flip:g):c):b =(g:b):c .5). we have indeed veri ed that c7!Sup:( c) = Sup: . In particular if A is (co)complete then A C is (co)complete. An example of a parameterised supremum is the binary supremum operator: let B be (f0 1g =) as in the de nition of t and let C be (A A w w) .1. by assumption.
as we shall demonstrate in section 4.12 (Adjunction) Suppose F 2C D and G 2D C are two functors then (F G) is an adjunction x y x F:y] = x y G:x y] : Here. De nition 4.
4. The one we give here is particularly wellsuited to our goal. F and G form a Galois connection if the function mapping the pair x y to x w F:y is equal to the function mapping the pair x y to G:x y .40
4.13) d e2 x y x F:y] x y G:x y]
:: ::
2
Category Theory
June 12. 1998
.1. Speci cally. Adjunctions
Category theoreticians will recognise in the above a special case of theorem 1 on page 111 of Mac Lane's classic text 15] concerning parameterised (co)limits. in particular its use of (4. The corresponding limit theorem in category theory is. Using extensionality.
:: :: :: :: :: :: :: :: :: :: :: ::
x w F:y G:x
y :
Let us spell out some of the details of de nition 4. Suppose that F and G are functors of type C D and D C . (Recall the de nition of these functors given in section 3. can be easily adapted to an attractive alternative to Mac Lane's proof.2.2 De nition
The categorytheoretic concept corresponding to the notion of a Galois connection is that of an adjunction. Then x y idC :x F:y] and x y G:x idD :y] are functors of the same type. functor F is called the lower adjoint and functor G is called the upper adjoint.12. Expanding the de nition of a natural isomorphism we get that there are two natural transformations d e and b c such that (4. Writing x y x F:y] and x y G:x y] instead of x y idC :x F:y] and x y G:x idD :y] we therefore have the following de nition. 8(x y x w F:y G:x y) f extensionality: F = G 8(x F:x = G:x) g x y x w F:y] = x y G:x y] : I.5).e. Neither the fact that (t) = Sup: nor the general abstraction theorem for suprema seem to be signi cant. Recall the de ning equation for a Galois connection between functions F and G : for all x and y of the appropriate types.5. The proof we have just given. respectively. however.) If they are isomorphic then F and G are said to be adjoint functors. There is a large number of equivalent de nitions of an adjunction. we can rewrite this universally quanti ed proposition as an equation between functions. By replacing \function" by \functor" we generalise this form of the de nition to category theory.
1998
Category Theory
.15) db ce = id ^ bd ec = id : The natural transformations d e and b c are called the upper adjungate and the lower adjungate respectively. i.14) b c2 x y G:x y] x y x F:y]
:: ::
41
which are each others' inverses. then d e and b c would have been functors. we can use extensionality and the de nition of the functor x y F:x G:y] to give an alternative de nition of an adjunction. then the following equalities must hold.e.2. If h 2 G:u D v then (c) f dhe F:g = dG:f h ge and dually if h 2 u D F:v then (d) G:f bhc g = bf h F:gc : Finally. both d e and b c are functions for every pair (x y) . So.) Now.
2
We will usually omit the subscripts of the lower and upper adjungate. De nition (4.
x y x y x y x y
::
Theorem 4. (Remark: had we de ned x F:y as a discrete category. (4. Expanding the de nition of a natural transformation we get from (4.13): for each x2C and y2D
d e 2 (x F:y) (G:x y) and for each (f g) 2 (x v) (u y) (f F:g) d e = d e (G:f g) :
x y u v x y
A similar result can be derived for the natural transformation (4. for f 2 x C F:y and g 2 G:x D y the equivalence (e) dge = f g = bfc
x y x y u v x y u v x y x y x y
must hold. June 12.14). suppose f 2 x C u and g 2 v D y .16 F and G form an adjunction if we have two natural transformations d e and b c satisfying for all x2C and y2D (a) dge 2 x C F:y ( g 2 G:x D y (b) bfc 2 G:x D y ( f 2 x C F:y : Furthermore.4.
17 In section 4.21) bFc :f 2 bFc :x B bFc :y
c c c
(4. 1998
Category Theory
.18) expands to.23) bFc :(f g) = bFc :f bFc :g
c
y ^ g2y
J:c
z :
To satisfy (4. Note that. we argued that the introduction and elimination rules
f 2 c C d c = d^f = id : Suppose J 2 Cat C and F 2B Cat C J . A categorical generalisation of that Galois connection is an adjunction between the sum functor C (discussed in section 2.20) bFc :x 2B ( c2C ^ x 2 J:c
c
( c2C ^ d2C ^ f 2 c
C
d :
(4. Thus we require that (4.19) is trivially satis ed since C is.1.22) bFc :id = idb cc
c x F c
:x
( x 2 J:c
c
( x 2 J:c ^ y 2 J:c ^ f 2 x ( f2x
J:c
J:c
y
(4.20) we de ne bFc :x = F:(c x) : To satisfy (4.18) bFc 2 B Cat J:c ( c2C
c c
(4. (4. Suppose C is a discrete category. for a discrete category C .22) is then
c c c c x
bFc :id = f de nition g F:(id id ) = f (id id ) = id(
c x c x
c x
)
=
id
g
F: c x
(
idb cc
F
f
)
:x
:
de nition g June 12. for all c2C . We have to de ne bFc 2 K:B Fun(Cat C) J .42
4.2. That is. by assumption.21) we de ne bFc :f = F:(id f) : Property (4.5.5) and the constant functor K for a discrete category C . Property (4. (4. the composition of arrows in C J is componentwise. Adjunctions
for existential quanti cation amounted to a Galois connection.19) bFc J:f = bFc
c
d
However.
Example 4. a discrete category.
17 in these two cases. give an interpretation to the lower and upper adjungates. the discrete categories containing exactly 1 and 2 elements. For an adjunction a similar result can be derived. That is.24
2
The two simplest examples of discrete categories are 1 and 2. 1998
. d e:(c x) 2B ( c2C ^ x 2 J:c
It remains to verify properties (c) through (e) of theorem 4. Work out the details of example 4.4.2.16. respectively. In particular.23) is also easily veri ed: bFc :(f g) = f de nition g F:(id f g) = f composition in C J is componentwise when C is a discrete category g F:((id f) (id g)) = f F is a functor g F:(id f) F:(id g) = f de nition g
c c c c c c c c
43
d e:(f g) 2 d e:(u x) B d e:(v y) ( f 2 u C v ^ g 2 x (J:f):y d e:((f g) (h k)) = d e:(f g) d e:(h k) : Recalling that C is a discrete category. these requirements are satis ed by de ning d e:(c x) = :x d e:(id g) = :g :
J:u c c c
bFc :f bFc :g : Now suppose 2 K:B Fun(Cat C) J . Refer to exercise 2. De nition Property (4.
2
Exercise 4. We leave the veri cation to the reader. Elementary consequences of a Galois connection are the cancellation properties. By construction of we calculate as follows: Category Theory June 12. We have to construct d e2B Cat C J .25 for the complete de nition of the functor C .
known as the counit of the adjunction. where counit = did e for all x. Dually.44
4. Corresponding to lattice theory. = bid c g 8(f f 2 x y G:F:f bid c = bid c f) f (4. Adjunctions
(
2 G F IdD f de nition natural transformation g 8(x 2 G:F:x x) ^ 8(f f 2 x y G:F:f = f) f (4.16b). Under the assumption that f 2 x F:y we construct the lower adjungate as follows: 2 G:x y ( f = unit g 2 G:x G:F:y ( f G is a functor g = G:f :
y
Category Theory
June 12. such that unit 2 G F IdD . So. we also have a natural transformation counit .25 F and G form an adjunction if we have two natural transformations unit and counit such that
x F:x x G:x
unit 2 G F
counit 2 IdC
IdD
FG
and the following two coherence requirements are satis ed counit F F unit = id F
G counit unit G = id G :
Proof We have to construct a lower and upper adjungate. Theorem 4.16d) g true :
::
x
:
:
y
x
x
F:x
:
:
F:y
F:x
In category theory this natural transformation is commonly known as the unit of the adjunction. such that counit 2 IdC F G . we can give an alternative de nition of an adjunction using the unit and counit. 1998
. where unit = bid c for all x. an immediate consequence of an adjunction is that we have a natural transformation unit .
De nition Thus. Category Theory June 12. where f 2 x F:y
y
2
(4. An adjunction does not determine the lower and upper adjungate uniquely.
)
G:f unit = g f Leibniz g counit F:(G:f unit ) = counit F:g f F is a functor g counit F:G:f F:unit = counit F:g f counit 2 Id F G g f counit F:unit = counit F:g f counit F F unit = id F g f = counit F:g :
y x y x x y x F:y y x x
We have shown that.2.
G:f unit 2 G:x y ( f 2 x F:y
y
counit F:g 2 x
x
This gives the candidates for (the pointwise de nition of) the lower and upper adjungate respectively. the above constructions show that we can always take the lower and upper adjungate and the unit and counit in such a way that the following properties hold (4. But. We only give two veri cations the others' being similar. and vice versa. G:g (G:f unit ) h = f unit 2 G F Id g
y
F:y ( g 2 G:x y :
G:g G:f G:F:h unitdom = f G is a functor g G:(g f F:h) unitdom
:h :h
And nally. nor the unit and counit. The veri cation of the coherence requirements goes as follows. where g 2 G:x y :
x
We'll do this in the rest of this chapter so that we can always use this property.26) bfc = G:f unit .
45
and dually.4.27) dge = counit F:g . given the lower and upper adjungate we can construct a unit and counit. 1998
.
25.28) G:f unit = g
y
f = counit F:g :
x
This property is equivalent to the two coherence requirements stipulated in theorem 4. More speci cally. by instantiating f y g = counit G:x id in (4. An antimonotonic function corresponds to a contravariant functor. for all f 2 x F:y and g 2 G:x y .
De nition 4. two contravariant functors can give rise to a contravariant adjunction.29
unit and counit such that unit 2 G F counit 2 IdC IdD
F and G form an adjunction if we have two natural transformations
FG
g 2 G:x y G:f unit = g 2
y
and the following coherence requirement is satis ed: for two arrows f 2 x F:y and
f = counit F:g :
x
A monotonic function corresponds to a (covariant) functor.30 (Contravariant adjunction) Two contravariant functors F and G form a contravariant adjunction if we have two mappings d e and b c such that (a) dge 2 F:y x ( g 2 G:x y (b) bfc 2 G:x y ( f 2 F:y x : (c) F:g dhe f = dG:f h ge (d) G:f bhc g = bF:g h fc (e) dge=f g=bfc :
Category Theory June 12. Two (covariant) functors can give rise to a (covariant) adjunction. So. The other one can be derived in a similar way. Speci cally.46
4. 1998
. (4. Adjunctions
In the above proof a valuable property is proven. we obtain
:
x G:x
G:counit unit = id
x G:x
G:x
:
By using extensionality we thus obtain one of the two coherence requirements. we have as a third alternative de nition of an adjunction
Theorem 4. For the other way around.28). the two coherence requirements give rise to this property as shown in the last proof. So.
(4.3 Properties
Theorem 4. we assume the adjunction (F G) with unit and counit as unit and counit respectively and construct a unit and counit for the adjunction (F G ) .26). we have proven F:? = ? .28). More speci cally. Show that F maps an initial object of D to an initial object of C . Using this notation we have the following computation rules:
F G
2
(4. For the other inclusion we argue as follows ? ?
C D D C
? w F:? ? ? f Galois connection g G:? ? ? ?
C D C D
and this last line also holds by de nition of a least element. this does not mean that the other adjoint is unimportant for the de nition of units and adjungates. 1998
. So. i. Properties
47
For the remainder of this chapter we will use the following notation.e.
4. using mutual inclusion. If (F 2 C D G 2 D C) is a Galois connection. then F maps the least element of D to the least element of C .33 (F G) forms an adjunction i (F G ) forms an adjunction. F preserves least elements. Given a functor F 2C D we can construct a functor F 2 Fun(C E ) Fun(D E ) . These parameters are only introduced to remind the reader to which adjunction they belong. we propose the following exercise. If no confusion is possible the parameters F and G will be omitted. For the unit
this construction goes as follows: Category Theory June 12. (Later we provide the proof of a more general theorem.)
D C
2
Let C D and E be categories. If (F G) is an adjunction then we denote its unit and counit by unit and counit and upper and lower adjungate by dF e and bG c respectively. Suppose the functor F 2C D is the lower adjoint in an adjunction. Proof First. The lifting of functors from object to functor level gives rise to the following theorem.3. ? ? Generalising to category theory.
Exercise 4.32 Let (C w) and (D ) be partially ordered sets. let ? and ? be the least elements in C and D respectively.4. Then.27) and (4. ? ? F:? w? by de nition of a least element. Although we have introduced this notation.31) G:dF ge (unit ) = g and (counit ) F:bG fc = f
F x G y
which follow immediately from (4.
we de ne unit .35) (counit ) = counit H :
H
What remains are the two coherence requirements (as stated in theorem 4. unit and counit g (counit F H) (F unit H) = f Godement's rules g (counit F F unit) H = f coherence property of the adjunction (F G) g (id F) H = f Godement's rules g (id (F )) : The veri cation of the second coherence requirement is similar.
H F :H H H x
2
y
The adjungates b G c and d F e of the adjunction (F G ) are of the following type:
bG c 2 G K H ( 2 K F H
K H
Category Theory
June 12.25).48
4.34) (unit ) = unit H
H
(4.11) g (counit )( ) (F ):((unit ) ) = f de nition F .19): 2 H K and unit 2 G F Id g true :
::
H
:
:
K
H
H
:
:
So. and dually counit . and maps an arrow f to the natural transformation K:f on objects y de ned by: (K:f) = f . Adjunctions
(
2 (G ) (F ) IdFun(D E ) f de nition natural transformation g 8(H 2 G F H H) ^ 8( 2 H K G F = ) f = unit H g 8( 2 H K G F unit K = unit H ) f vertical composition (2. which are proven using extensionality. For the proof in the other direction use the constant functor K which maps an object x to the constant functor K:x on x . ((counit ) (F ) (F ) (unit )) = f (2. by (4. de ned by: (K:x):y = x for all objects y and (K:x):f = id for all arrows f . 1998
. This is left as an exercise for the reader.
for i = 0 1 .4. Note. Then for all monotonic functions H 2 D D and K 2 C C . then (4. of the adjunction (F G ) . =bG c g
0 1 0 0 0
Category Theory
June 12.39 Suppose.37) b G c L = b G Lc and d F e L = d F Le
K H x x K:x H:x K H y y K:y H:y
Inverse functions have inverse algebraic properties.3. The latter is expressed by the following theorem.40) b G K counit 1 G c 2 G K H G 2KF F H
i i i i i i i i 0 1 0 1 0 G 1 0 1 1 0
(4. By construction of we calculate as follows:
(
2G K HG f (F G ) is an adjunction. for every functor L : (4. we assume
the righthand side and construct the witness on the lefthand side. _ _ (4. for i = 0 1 .36) (b G c ) = bG c and (d F e ) = dF e . respectively. Let and be natural transformations as de ned above. Then for all functors H 2D D and K 2C C . The implications are then proven by showing that the constructed witnesses are inverses of each other. That is.41) d F )
G
F H unit 1 e 2 K F F H 2 G K H G : (Note that b G c and d F e denote the adjungates of the adjunction (F G ) whilst counit 1 and unit 1 denote the counit and unit. 1998
.
0 1 F 1 0 0 1 0 0 0 0 F 1 1
Proof We rst prove the followsfrom in each of the equivalences. The corresponding theorem in category theory is that adjoint functors have constructively pseudoinverse algebraic properties.38) K F w F H G K w H G :
i C i D i i i i i i 0 1 0 1 1 0 0 1
This one rule captures in a nutshell all calculation properties of Galois connections. b G c = G unit H and d F e = counit K F so using the Godement's rules we can derive. (4. Theorem 4. Suppose. C and D are categories and the pairs of functors (F 2C D G 2D C ) form an adjunction. (C w i ) and (D w i ) are partially ordered sets and the pairs of functions (F 2 C D G 2 D C ) form a Galois connection. Functions that form a Galois connection have pseudoinverse algebraic properties. Properties
49
dF e 2 K F H ( 2 G K H :
K H
The relationship between the adjungates of the adjunction (F G) and the adjungates of the adjunction (F G ) can easily be constructed.
are given. Finally.
] ] ] ]
Category Theory
June 12. The former maps a functor F 2C D that is known to have an upper adjoint to a canonical upper adjoint F 2D C . We assume.37).
G c F e F (H unit 1 ) = c and d F e are each others' inverses g (H unit 1 ) = Godement's rules g (G F ) (F H) unit 1 1) F = vertical composition (2. that the relevant counits and units of the adjunctions are known. A nal assumption is that and are inverse functions (so that F = F and G = G ).16c) g K counit 1 (4. Adjunctions
( (
2K F HG f = g 2K KF G ^ 2KF G f Godement's rules g = K counit 1 ^ = G :
0 1 1 1 1 G 1
1
F HG
0
1
The construction of the witness in the lefthand side of equivalence (4. It maps a functor G 2D C that is known to have a lower adjoint to a canonical lower adjoint G 2C D .19): 2 K F F H and unit 1 2 G F Id g (K counit 1 ) F (K F ) unit 1 = f Godement's rules g K (counit 1 F F unit 1 ) = f coherence property of the adjunction (F G ) g K (id F ) = f identity g :
0 0 G 1 1 0 F 0 0 G 1 1 0 F G 1 1 1 0 F 1 0 F 1 1 G 1 1 F G 1 1 F 1 1 1
=
dF bG f dF bG f (K counit f (K counit f
0
0
K counit 1 (4. and . The latter does the opposite. 1998
.4 Sharp and Flat
]
Suppose C and D are two categories. we prove that the constructed witnesses are each others' inverses. In this section we suppose that two mappings. b G G)F F 1
G
G c F H unit 1 e
1 1 F
2
4. furthermore.50
4.41) is similar.
19): 2 G F and b G counit H c 2G H g b F counit G b G counit H c ( H )c f (4. G and H be functors that have an upper adjoint and let 2 G F and 2 H G be two natural transformations.31) g b F counit H Hc f factorise. then the arrow part of is de ned by (4.43) g ( ) :
]
G]
f
de nition of : (4. Then by theorem (4.43) = b F counit Gc : It remains to verify the coherence properties.43) g
] ] ]
H]
]
]
G]
]
]
H]
]
]
H]
]
]
]
]
G]
]
H]
]
]
]
H]
]
]
]
]
(id F)
]
bF
f
]
Symmetrically. 1998
. de nition of : (4. the functors are inverses
]
Theorem 4. b F counit G c 2 F G . where 2 G F :
]
G]
]
]
]
Note the reversal in the typing of the arrows. Moreover. For arrows we have the following. So.44) = d G F unit e (2 F G ) . to a given xed upper adjoint.42
of each other.
]
Proof On objects maps a functor. Sharp and Flat
51 and are contravariant functors. Then. = =
b F counit G c b G counit Hc f (4. Suppose F and G have upper adjoints. Let F .
] ] ]
G]
]
]
]
= = = = = Also. where we take for both H and K the identity functor.4. that has an upper adjoint.39). for arrows we de ne by (4. counit = d F id F] e
F] F]
de nition of : (4.4. let F and G be functors that have a lower adjoint.16d) g b F counit G F b G counit H cc f vertical composition (2.43) g
]
g
Category Theory
June 12. where 2 G F :
F
id F :
]
f
counit
id F F] c identity.
in the jargon of category theory. is \unique up to isomorphism". so we can apply to F: Furthermore.45 and form a contravariant adjunction. 1998
.39) we have F =F G =G :
0 1 0 1
In words. so we can apply to G: Then we have 2F G ( 2G F 2G F ( 2F G :
] ] ] ] ]
Thus the lower and upper adjungates of the adjunction we want to construct are the functors and . The property (4. Adjunctions
The nal part of the theorem that and are inverses of each other comprises two statements.30e) has already been veri ed. Furthermore suppose 2 F H .
2
Theorem 4.40) and (4. namely that they are inverses of each other as mappings on functors.30c) is
] ] ] ]
=(
]
) :
]
The veri cation is elementary:
]
=
]
f
] ]
]
and are inverses g is a contravariant functor g
=
(
f
]
) :
]
An upper adjoint of a functor may not be unique but. adjoint functors are unique up to isomorphism. The rst statement is true by assumption.) To verify (4.30.52
]
4. 2 G F and 2 G K are natural transformations.
2
Theorem 4. the second statement is immediate from the (more general) fact that the constructions given by (4. Proof Let F be functor that has an upper adjoint.41) are inverses of each other. Then the appropriate instantiation of (4. Category Theory June 12. let H be a functor that has an upper adjoint and let K be a functor that has a lower adjoint. It remains to verify the coherence requirements speci ed in de nition 4. let G be a functor that has a lower adjoint. and they are inverses of each other as mappings on natural transformations.46 With the same assumptions as in theorem (4. (It is the statement that the functors and are inverses of each other.30c).
2. we have 2 G G and 2 G G . 1998
. for all a2A . however. for all f 2 u A v . The functor K de ned here is the more general of the two the \doubling" functor 4 is introduced later. for each x in A . (G ) = F and (G ) = F .
2
is also an identity transformation. In order to de ne colimits we need to rst de ne the diagonal3 functor K in place of the diagonal function K . Suppose F 2A B .5 Limits and Colimits
The categorytheoretic notion corresponding to the notion of supremum is colimit . p67].
4.
Hence. Now we extend the de nition of K to arrows in the category A : if f 2 w A x we de ne K:f to be a natural transformation to the functor K:w from the functor K:x by letting (K:f) equal f for all objects y in the category B . 62 Mac Lane also uses the name \diagonal functor" and the symbol 4 for the functor that doubles its argument (the justi cation presumably being that the former generalises the latter). K is a functor to the functor category Fun(A B) from the category A . The conclusion is that K 2 Fun(A B) A . on p. Limits and Colimits
0 1 0 1 1 0
53
Proof Suppose 2 F = F .4. A colimit of F is a solution of the equation: (4. It is left to the reader to check that this does indeed de ne a natural transformation. De ning (F ) = G . Speci cally.47) x a a x] = a K:a F] : Here both dummies a range over objects and arrrows of A .5. This is straightforward enough. It is left to the reader to check that this does indeed de ne K:x to be a functor of type A B (in particular that the coherence properties are satis ed). Mac Lane uses the symbol 4 . (F ) = G . and a K:a F]:a is the set of all arrows to K:a from F in the category Fun(A B) also. Confusingly.
0
]
0
1
]
1
0
0
1
1
]
1
0
]
0
1
]
]
= =
(
]
)
f
]
]
is a contravariant functor g is the inverse of
id :
f
] ]
g
In the same way.e. i. instead of K . a a x]:f is the
x y
::
::
::
::
::
::
::
::
::
The name \diagonal functor" is that used by Mac Lane 15. Given categories A and B we de ne K:x . Then we have two natural transformations 2 F F and 2 F F . and arrows g 2 y B z to the arrow id 2 (K:x):y A (K:x):z . to be the functor that maps objects y in B to x . whose composition in either order gives an identity transformation.
3
Category Theory
June 12. The functors a a x] and a K:a F] are de ned according to a minor variation on the de nition of the functor x y F:x G:y] introduced in section 4. a a x]:a is the set of arrows to a from x in the category A .
id11 . Adjunctions
::
function f (mapping arrows to v from x into arrows to u from x ) and a K:a F]:f is the function (K:f) . 1998
.e. so KA :a A 1 consists of precisely one 1 arrow. Dually. a limit of F is a solution of the equation: (4. the diagonal 1 1 functor KA 2 (A ) A is the functor which maps an object of A to 1 . x is an initial object in A . (K:f ) = f .e.50) a a A x] = a KA :a A
:: ::
Example I
1] : 1
1 But. Then the functor category A is the category consisting of only one object. that x = y . Suppose x and y are both colimits of functor F .) It is easy to see that all colimits of a functor are isomorphic. 1 Suppose x is a colimit of the functor 1 . The category A is B cocomplete i the diagonal functor K 2 Fun(A B) A has a lower adjoint.48) range over objects of the category A and objects of the category Fun(A B) (i. say 1 .15.54
4.
y y
a a x] f = a K:a f = a a y]
:: :: ::
x is a colimit of F g F] y is a colimit of F g :
It follows by the law of indirect isomorphism. functors to A from B ). for every object a in A . i. viz.e.50). Thus. Therefore. Moreover. Thus. respectively. for each object y .
End of Example
Category Theory
June 12. KA :a = 1 .49) x
::
a x a] = a F K:a] :
:: ::
Let denote the empty category. lemma 3. by 1 the arguments given here it's obvious that the converse is also true. x satis es 1 (4. and one arrow (the identity arrow on 1 ). i. So. by (4.48) a F a Col:F] = a F K:a F] :
:: ::
The dummies a and F in (4. the function (K:f) maps natural transformation 2 K:v F to the natural transformation K:f 2 K:u F where. there is also precisely one arrow in A to a from x . (Unfolding the de nition of K:f . a colimit of 1 is an initial object. Then. A is B cocomplete if there is a functor Col 2A Fun(A B) such that (4.
52). We need to di erentiate between diagonal functors: where above we wrote K let us now write KA B . for all c2C . since c is a functor of type A B . the functor c 2A B de ned by ( c):b = b c has a colimit denoted by Col:( c) .52) x x 2A C ^ f f x] = f KA C B :f ] : A candidate for x is obtained by extending the mapping c7!Col:( c) on objects of the category C to a functor.111 of 15].4. 1998
. Limits and Colimits
55
Just as in lattice theory if (poset) A is B cocomplete then A C is B cocomplete for all (posets) C it is the case that if category A is B cocomplete then the functor category Fun(A C ) is B cocomplete for all categories C . B and C are categories.5.33). Note that. (That is. the existence of Col:( c) is implied by B cocompleteness of A . The question is whether this information is su cient to guarantee that has a colimit. For brevity we denote application of to arguments b in B and c in C by b c . The assumption is thus that. This is easily done if we observe that c7!Col:( c) coincides with the object part of the functor Col Flip: where Flip is the functor that \ ips" the order of the arguments of a functor of type (A C ) B to form a functor of type (A B) C .51) a a Col:( c)] = a KA B :a c] The goal is to solve the equation: (4. encouraged to whilst reading Suppose A . by assumption. Flip: is the functor of type (A B) C such that b c = c b .
:: :: :: :: :: ^ ^ :: :: :: ::
4. by (4. For the second conjunct we have: f f Col Flip: ] f Col has upper adjoint KA B .) Accordingly we verify that Col Flip: satis es (4. there is an object Col:( c) in A satisfying (4.1 Parameterised Colimits
Category Theory
June 12. Suppose 2 (A C ) B . As mentioned earlier. for all c2C . Assume that. It clearly satis es the rst conjunct (since it is a composition of two functors of types A (A B) and (A B) C ). this is theorem 1 on p. ( Col ) has upper adjoint KA B g f KA B f Flip: ] = f KA B f = Flip:(KA C B :f) (just as in lattice theory) g f Flip:(KA C B :f) Flip: ] f Flip is clearly an isomorphism of categories g = f KA C B :f ] : What emerges very clearly from this proof is that the parameterised colimit theorem is an instance of (4. = So.33). Let us present an alternative proof to illustrate the process of transforming proofs in lattice theory into proofs in category theory.5.
this de nes the coproduct functor to be the functor Col Flip: . Speci cally.16d) yields the conjunction of (h k) inl = inl h and (h k) inr = inr k : (Several simpli cations are needed to reduce what is obtained from (4. and the four subterms are the witnesses to the two isomorphism steps in the above proof.16e) yields f inl = g ^ f inr = h f = g 5 h the property (4. De ne 2 (A C ) B by: on objects 0 (a a ) = a and 1 (a a ) = a on arrows id (f f ) = f and id (f f ) = f . Assuming that A is B cocomplete. Brie y.16d) to this compact form. Expanding the de nitions of colimit. Let C be (A A w w) . the lower adjungate in the adjunction de ning Col boils down to a mapping from arrows f 2 a b c to the pair f inl f inr where inl and inr are both natural transformations the upper adjungate boils down to a mapping from pairs of arrows f and g with the same codomain to an arrow f 5 g with codomain the common codomain of f and g and domain the coproduct of the domains of f and g . letting b c and d e denote the lower and upper adjungate of the adjunction (ColA KA C ) they are: d e Flip K:Flip 2 f f Col Flip: ] = f (KA C B :f) ] and K:Flip b c Flip 2 f (KA C B :f) ] = f f Col Flip: ] : (The compositions arise from the transitivity of isomorphism.56
4.. adjunction. namely the identity arrows on 0 and 1. The conjunctions arise from equalities between pairs. etc.111] proof of this theorem involves the explicit construction of the witnesses to the isomorphism followed by a veri cation of their naturality properties. by de nition.) The standard example of a parameterised colimit is the coproduct functor. 1998
. coproduct is the colimit of the functor we have just de ned. the property (4.16c) boils down to (f g k) 5 (f h l) = f (g 5 h) (k l) :
:
::
::
:
::
::
0
1
0
0
1
1
0
0
1
0
1
0
1
1
+
0+
1
0
1
+
b c
b c
+
+
+
Category Theory
June 12. equational. 0 and 1. p. Let B be the category consisting of exactly two objects. and two arrows. as they have been called by Wadler 27]. That is.) Finally. proof includes a construction of the witnesses as a (mechanical) byproduct. The above. we nd that this gives several \theorems for free". a a = Col:( (a a )) : Applying the abstraction theorem. (4. Adjunctions
Mac Lane's 15. Moreover.
by extensionality. Limits and Colimits
57
4.54). In category theory we have a theorem which has some resemblance to this property. Category Theory June 12. i. We are particularly proud of the above calculational proof of the theorem. 1998
2
F:x] = a KA C :a Fun(A C) F G] is a colimit of F G . Suppose x is a colimit of the functor G 2B C .54) b b B x] = b KB C :b Fun(B C) G] :
]
:: ::
We prove that i. 114]. F:x = = =
=
Theorem 4. In lattice theory.5. KB C :(F :a) = F (KA C :a) g a F (KA C :a) Fun(B C) G] f F has F as lower adjoint. Correspondingly:
Theorem 4.e. g a KA C :a Fun(A C) F G] : a a
:: :: ::
A
]
::
]
]
]
::
]
] ]
]
]
F] :a
]
a
]
]
]
::
]
]
::
2
. g B a F :a x] f (4. note H = K ) H F = K F . i. a a A F:x] f F has F as upper adjoint.53 is a beautiful theorem with many applications. if a set has a minimal element then that minimal element is also the in mum of the set.55 Lower adjoints preserve initial objects. (KB C :(F :a)):f = id = F :id = F :((KA C :a):f) .e. So the above theorem immediately gives as a corollary: Corollary 4. g a KB C :(F :a) Fun(B C) G] f (KB C :(F :a)):c = F :a = F :((KA C :a):c) .2 Colimit Preservation
The lower adjoint in a Galois connection distributes universally over all suprema. (4.5.e. For a traditionalstyle proof see 15. p. Proof Let (F 2A B F 2 B A b c d e) be an adjunction.53 Lower adjoints preserve colimits. We showed that an initial object is a special instance of a colimit.4.
1998
.
2
4. Its objects are pairs (f x) such that f 2 G:x z .58
4.
z G
Lemma 4. An arrow in z#G between two objects (f x) and (g y) is de ned
' 2 (f x) # (g y) ' 2 x C y ^ f = G:' g : We will refer to the x component of the pair (f x) as the carrier of (f x) . a a x] = a G:a z] : Proof We rst prove the ( part.57 (undercone category) Let G 2D C be a functor and z2D . We construct a unique arrow in z#G to an object (g y) from (bid c x) as
:: :: :: ::
x x x x x x
Note: in lattice theory this category corresponds to the set fx G:x w z xg . i. Suppose d e2 a a x] = a G:a z] 3b c : Then. Adjunctions
Theorem 4.56 If x is an initial object in the category B then the functor F 2A B has a limit viz. (bid c x) 2 z#G . bid c 2 G:x z .6 Existence of adjoints
as follows:
De nition 4. Its objects are pairs (f x) such that f 2 z G:x . We will denote the undercone category of z under G by z#G . Dually we can de ne the overcone category G#z .e.58 x is the carrier of an initial object in z#G i . Proof See Mac Lane. F:x . We conjecture that (bid c x) is initial in z#G .
: :
2
follows:
x
x
2 (g y) # (bid c x) f de nition arrow in z#G g 2 y x ^ g = G: bid c f computation rule: (G:h ) b c = b c (h ) g 2y x ^ g=b c f b c and d e inverses g = dge :
z G x x x x y y
Category Theory
June 12.
Existence of adjoints
59
For the ) part assume (f x) to be initial in z#G . we de ne dge = ((g a) = (f x)]) and by de nition g = G:dge f . '2a x ) f G functor. we de ne b'c = G:' f .4. (f x) initial in z#G g ((g a) = (f x)]) 2 (g a) # (f x) f de nition arrow in z#G g ((g a) = (f x)]) 2 a x ^ g = G:((g a) = (f x)]) f : Thus. 1998
. unique arrow g ' 2 ( g a) ( # ) ( f x) f '2a x g g = G:' f f de ntion b c g g = b'c :
z G
:
:
:
a
:
a
a
a
a
b
a
b
a
a
a
a
a
a
z G
a
a
Category Theory
June 12. ((G:h ) b c ):' = (b c (h )):' f application g G:h b'c = bh 'c f b'c = G:' f g G:h G:' f = G:(h ') f f G is a functor g true : Finally the proof that d e and b c are inverse functions.6. f 2 G:x z g G:' f 2 G:a z : Thus. Suppose h 2 a b and ' 2 b x . We have to de ne two mappings d e and b c such that d e2 a a x] = a G:a z] 3b c : We do this pointwise and then prove that they are natural in a and each others' inverses. Suppose g 2 G:a z and '2a x dge = ' f de nition dge .
:: ::
g 2 G:a z ) f (g a)2(z#G) . Now we prove that b c is natural in a: The naturality of d e in a then follows automatically.
Moreover. Thus.60) 8(z d e 2 a a ] = a G:a z] 3b c ) We now construct a lower adjoint G for G . To see that this indeed de nes a lower adjoint for G we need to verify that the natural transformation d e (or b c ) in (4.
4.
2
Example II (yellowbook 5.60 This completes our proof.60) is also natural in z: We rst de ne a a ] for f 2 u v : a a ]2 a a ] a a ] ( f take: a a ] = d e b c g 2 a G:a v] a G:a u]
:: :: :: :: :: ::
z
::
z
::
z
z
z
z
::
f
::
f
::
v
::
u
::
f
v
u
(
::
::
f2u v g = K:( f) : f
Category Theory
June 12. For the ( part suppose (4. G :z is the carrier of an initial object in z#G . if (F G) forms an adjunction. 1998
. Adjunctions As an immediate consequence of this lemma we have the following examples. Thus by the above lemma F:z is the carrier of an initial object in z#G .
:: ::
2
z
Theorem 4. then (unit F:z) is initial in z#G . if we take a look at the above proof we see that in the case that (F G) forms an adjunction that bid c corresponds to the unit of the adjunction applied to x . then we have a b a G :b] = a b G:a b] ) f x second argument g 8(z a a G :z] = a G:a z]) : So. Proof Using the above lemma.59 The functor G 2D C has a lower adjoint i for each object z of D the category z#G has an initial object. An obvious candidate is the functor which maps an object z to .32 (implication)) Suppose that (F G) forms an adjunction.
x x
Example III A colimit x2C of the functor F 2C D satis es a a x] = a K:a F] : Thus by the above lemma a colimit of F is the carrier of an initial object in the category F#K where K 2 (C D) C . that \for each object z of D the category z#G has an
:: :: ::
2
initial object" equivales: 8(z a a x] = a G:a z] has a solution in x) : We rst prove the ) part suppose G is a lower adjoint of G .
from example II we know that if G is the upper adjoint of an adjunction then for every object z the category z#G has an initial object. so by theorem 4. De ne the forgetful functor U 2C (z#G) by: let (g x) 2 (z#G) . 2
::
f v u u u u v
::
z
z
z
:
:
z
z
Category Theory
June 12.61 If the functor G 2D C has a lower adjoint then G preserves all limits and U 2C (z#G) has a limit for all z2C . (Hint: G is contravariant). a a follows:
:: ::
f v u z
61
] = d e K:( f) b c .e. Furthermore. To verify the naturality of d e in z we calculate as
f u
a a ] de = f de nition a a ] g d e K:( f) b c d e = f b c and d e are each others' inverses g d e a G:a f] : We leave it to the reader to de ne G on arrows. 1998
.53 gives us that upper adjoints preserves limits. then U :(g x) = x . 2 Suppose G 2D C is a functor. g 2 G:x z .6.e. Existence of adjoints I.4. Theorem 4. Proof The dual of theorem 4. Note: a limit of U corresponds in lattice theory to u(x G:x w z x) .56 the functor U 2C (z#G) has a limit. i.
62
4. Adjunctions
Category Theory
June 12. 1998
.
However. Second. If in lattice theory a pre x point x of F contains a pre x point y of F .e. This leads to the following de nition. x and y are pre x points of F . we can construct a category of Falgebras. In category theory this corresponds to an object x and a (not necessarily unique) arrow f such that f 2 x F:x . In category theory containment of pre x points is captured by the construction of arrows between algebras.
2
De nition 5. 1998
. then we have the following four containments.2 (Category AlgC :F ) Let C be a category and let F be an endofunctor on C .
5. First.Chapter 5 Algebras
The notion in category theory that corresponds to the notion of a pre x point in lattice theory is known as an algebra.1 (Algebra) Let C be a category and let F be an endofunctor on C . where F is a functor. Finally.
De nition 5. the containment x w F:y can be constructed in two di erent ways. Thus we have x w F:x and y w F:y . x contains y . where x = cod:f . Falgebras are arrows between certain objects in the underlying category. In other words. I. we can also view Falgebras as objects and construct arrows between Falgebras. Thus. The category AlgC :F is de ned as follows.
Category Theory 63 June 12. given the arrow f we can always deduce its corresponding object. from the monotonicity of F it follows that we also have the containment F:x w F:y: As a result.
If f is an Falgebra it is often the case that its codomain is referred to as the carrier. Thus we have x w y . But.1 De nition and Properties
For a monotonic endofunction F an element x such that x w F:x is called a pre x point of F . the socalled base category. namely cod:f . f 2 x F:x . The objects of AlgC :F are the Falgebras. An F algebra is an arrow f of C such that dom:f = F:(cod:f) .
Speci cally. 1998
. The decoration ` C ' in AlgC :F is omitted when it can be deduced from the context. however.e. we conclude that cod cod ' and witness the isomorphism between cod:f and cod:g in the category C .4
Category Theory June 12. so we also have ' = idC and ' = idC . the witnesses to the isomorphisms are the same. and the fact is wellknown. That is. Suppose f and g are two isomorphic Falgebras. idC 2 f Alg f: The superscripts ` Alg:F ' and ` C ' are usually omitted. As a result we cod have Lemma 5. More precisely. The claim that Alg:F is a category should be proven. then their carriers are isomorphic in the underlying base category.e. '
:F :F
= idAlg and ' = idAlg . To this end.
F F
Lemma 5.64
5. Arrows in an algebra category are also arrows in the base category. we introduce the in x operator = to denote isomorphism in the category Alg:F . Then the arrows ' to f from g are characterised by the equation:
' 2 f AlgC g
:F
' 2 cod:f
C
cod:g ^ f F:' = ' g :
Note. Moreover. We leave the proof of the following lemma as a (simple) exercise in the use of the notation. we have two arrows
:F :f
2 g Alg f which are each others' inverses. More speci cally. and what the relevant functor is. if f is an Falgebra then idAlg = idC cod
:F f :f
2
i. Algebras
Its arrows are constructed from the arrows of the base category C . Proof Let C be category and let F be an endofunctor on C .
:F :F f g
' 2 f Alg g and
C
' 2 cod:f
2
cod:g and
2 cod:g
:f
C
cod:f :
:g
Furthermore. It is a straightforward exercise. So. One \trivial" element of the proof that we make abundant use of is the fact that the identity arrows in Alg:F are the identity arrows in the base category. Thus. the identity arrows in the algebra category are the identity arrows in the base category. which corresponds in lattice theory to two di erent proofs of x w F:y given that x w y as discussed above. that the coherence condition f F:' = ' g follows from the fact that the arrow to cod:f from F:(cod:g) can be constructed in two di erent ways. of course. we write f = g if f and g are isomorphic Falgebras. suppose f and g are Falgebras. i.3 If two algebras are isomorphic in the algebra category. We sometimes wish to emphasise that we have an isomorphism between two algebras.
Proof The rst step is to prove that K maps Galgebras to Halgebras. G 2D D and H 2C C . 1998
. given two Galgebras f and g and an arrow ' 2 f Alg g .7) K:g = F:g
cod:g
. it is easily shown that F _ maps pre x points of G to pre x points of H provided that F G w H F . Suppose that there is a natural transformation 2 F G H F . for every object g2Alg:G. Then formally.6 Given are three functors F 2C D .8) K:' = F:' . transitivity g F:x w H:(F:x) : Denote the set of pre x points of G by Pre:G . G 2D D and H 2C C in the lattice theory.
(5.
Lemma 5. From the de nition of K on objects and the fact
x :G :H
that arrows in an algebra category are also arrows in the base category. Let cod:f = x and cod:g = y: Then we verify this conjecture as follows:
Category Theory
June 12. we have: _ (5. Then we can de ne a functor K to Alg:H from Alg:G in the following way:
(5. g 2 x G:x ) f F is a functor g F:g 2 F:x F:(G:x) ) f 2FG HF g F:g 2 F:x H:(F:x) : The next step is to prove that K maps arrows of Alg:G to arrows of Alg:H: More precisely. for every arrow ' in Alg:G. we have to construct a de nition of K:' such that K:' 2 K:f Alg K:g . we conjecture that K:' = F:' . De nition and Properties
65
2 =
2
F
^ 2F=G
)
2
cod:
=
G
cod:
:
Given the partially ordered sets C = (C w) and D = (D ) and the monotonic functions F 2C D .5) 8(x x2Pre:G F:x 2 Pre:H) ( F G w H F :
: :
x
In category theory this corresponds to the existence of a functor to Alg:H from Alg:G under similar conditions.1.
G:x ) f F monotonic g F:x w F:(G:x) _ ) f F G w H F .5.
Then F is a functor to Alg:(F G) from Alg:(G F) .9) using the fact that the identity arrows in Alg:G are the identity arrows in the base category. For K these are (5.6 we have: F:' cod 2 F:f = F:g ( ' 2 f = g :
2
Corollary 5. 1998
Specialising to isomorphisms.11 With the same assumptions as in lemma 5.2) g F:' 2 cod:(F:f ) C cod:(F:g ) ^ F:f H:F:' = F:' F:g f domains 2 F G H F .
:f H G
( ' 2 f Alg
:G
g :
2
Corollary 5.e.12 Let F 2C D and G 2D C be functors. (5. Their proofs are easily supplied.66
Alg F:g F:' 2 F:f f de nition of an arrow in Alg:H : (5. for every arrow ' and in Alg:G. F is a functor g F:' 2 F:x C F:y ^ F:(f G:') = F:(' g) f F is a functor Leibniz g ' 2 x D y ^ f G:' = ' g f de nition of an arrow in Alg:G : (5. for every object g2Alg:G and (5.10) K:(' ) = K:' K: . It is easy to verify (5. i. Lemma 5.2) g Alg '2f g :
:H x y: x y: x y: y y: :G
5. F:f 2 Alg:(F G) ( f2Alg:(G F)
and
F:' 2 F:f
Category Theory
Alg:(F
G
)
F:g
(
' 2 f Alg (
: G F
)
g :
June 12.8) and the assumption that F is a functor.10) follows immediately from the de nition of K on arrows (5.6 has two corollaries that prove useful later. we have:
.9) K:id = id . Algebras
(
So.
F:' 2 F:f
g K:g
Alg:H
x
F:g
y:
We still have to verify the two coherence requirements on functors.
17 If f is an Falgebra then f 2 f Alg F:f . AlgC 2 CatC End:C . a functor.5. i.
:g
A particular instance of corollary 5. Theorem 5. We deduce that.
:F :F
Category Theory
June 12.13) Pre:G Pre:H ( G w H :
A trivial lemma that nevertheless proves its worth is the following:
2
Lemma 5.16) (Alg: ):' = ' for each arrow ' in Alg:G .14 (Functor Alg ) For each category C there is a contravariant functor AlgC from the category of endofunctors on C to the category of categories based on C .12 is obtained by taking F to be an endofunctor and G to be the identity functor. 1998
. i. the function that maps a function G to the set of pre x points of G is antimonotonic.13) gives rise to the theorem that Alg is a contravariant functor. and (5. Alg has to satisfy Alg: 2 Alg:H Alg:G . De nition and Properties
67
F:' 2 F:f =
2
F G
F:g
(
'2f =
G F
g :
In words. (5. whenever 2 G H.2) g C f 2 cod:f F:(cod:f) ^ f F:f = f F:f f de nition 5.e. Pre:G . The set of pre x points of G . Proof f 2 f Alg F:f f de nition arrow in Alg:F : (5. Note the reversal of the orderings. if f is an Falgebra. The de nition of the functor Alg: follows from lemma 5. But this is trivial.1. then F:f is also an Falgebra. Note the reversal in the typing of the arrows and that Alg: has to be an arrow in CatC .2) de nes Alg (omitting the subscript) for each object F 2 End:C .e.6. If we instantiate the function F in (5. Proof The de nition of Alg:F (5. It remains to check the coherence requirements to prove that Alg is indeed functorial. corresponds to the category Alg:G . in category theory (5.5) to the identity function we get _ (5.1 g f is an Falgebra. natural transformations.e. On arrows of End:C .15) (Alg: ):g = g cod for each object g2Alg:G . Speci cally. i. So.
i.) Where it is necessary to avoid confusion we will write ( F f = muF]) . Speci cally.19 Let F be an endofunctor on C .19e then the righthand side of the `followsfrom' can be replaced by f g = h F:f . We state some of the consequences of this equivalence in the following lemma. lemma 5. It says that every object of Alg:F is an arrow of Alg:F .17 can be confusing. Suppose f is an Falgebra and muF is an initial Falgebra.
:
Lemma 5. \computation rule". will be denoted by F . In lattice theory we denote the least pre x point of a function f by f: In category theory we will usually denote an initial algebra of an endofunctor F by muF . Here. we end up with the notion of an initial algebra of an endofunctor F . \uep" is short for \unique extension property". \identity" and \(catamorphism) fusion" respectively. The confusion may occur when we consider a functor on Alg:F when applying such a functor one must always be very clear about whether it is being applied to an object or an arrow. `Translating' all the concepts to the corresponding concepts in category theory. its carrier. 1998
Category Theory
. June 12. Algebras
(Although trivial. \uep". So.e. let F be an endofunctor on C .2 Initial Algebras
In lattice theory we have the notion of a least pre x point of a monotonic endofunction f .68
5. Its codomain. muF 2 F F: F . (Very often g is muF and so it is easy to see that Alg:F is the intended category. Suppose f is an Falgebra and muF is an initial Falgebra.)
2
5.
:F
:
:
:
:
F
F
:
:F
:
:
We will refer to these properties by using the terms \typing". Then (5.18) ' 2 f
Alg:F
muF
' = ( Alg:F f = muF]) :
: :
As announced at the time the notation was introduced.3) appropriately. For initial algebras we have an equivalence obtained by instantiating (2. we will most often omit the parameter Alg:F in expressions of the form ( Alg:F f = g]) . Then: (a) ( f = muF]) 2 f Alg muF : (b) ' 2 cod:f C F ^ f F:' = ' muF ' = ( f = muF]) : (c) f F:(f = muF]) = ( f = muF]) muF : (d) idmu = id = ( muF = muF]) : (e) f ( g = muF]) = ( h = muF]) ( f 2 h Alg g : If the typing of f in the base category is already known when using property 5.
Property 5. f is an arbitrary Falgebra and muG is an initial Galgebra. in the following sense: Category Theory June 12.19e is proven as follows
:
F F
Proof By instantiating ' = ( f = muF]) in (5.19b by instantiating ' such that the righthand side becomes true. For property 5. then: ( F f = muF]) ( G muF = muG]) = ( G f cod = muG]) : Proof ( f = muF]) ( muF = muG]) = ( f cod = muG]) f (5. a least pre x point is a xed point.19e) g ( f = muF]) 2 f cod Alg muF f 2 F G .18) we obtain property 5. In category theory. Finally. 1998
2
.
:
F
F
(
2
f (g = f f (g = f f 2 h Alg
:
muF]) = ( h = muF])
:
:
(5.19b follows from 5.5 is about initial objects in general.
Lemma 5.18) we obtain idmu = ( muF = muF]) .20 Let F and G be endofunctors on C .19a.6) g ( f = muF]) 2 f Alg muF f (5. suppose we have a natural transformation 2 F G .19a) g true :
:
F
:
:f
:
:
F
:
:f
:
:G
:
:f
F
:F
:
In lattice theory. By instantiating ' f = idmu muF in (5.2. an initial Falgebra is also a xed point. The equality idmu = id follows from the remark made earlier that the identity arrows in an algebra category are the identity arrows in the base category. For initial algebras we can derive the following. Initial Algebras
69
: :
Property 5.19d we argue as follows.5.18) g muF]) 2 h Alg muF (5. Suppose muF is an initial Falgebra. Property 5.18 and writing out the de nition of an arrow in an algebra category.19c follows immediately from 5.19a) g
:F
:F
g :
Theorem 2. (5.
By lemma 5.21
and
If muF is an initial Falgebra then F:muF is also an Falgebra and isomorphic to muF . muF ( F:muF = muF]) = idmu f identity: (5.70
5.19d) g muF ( F:muF = muF]) = ( muF = muF]) ( f fusion: (5. Algebras
Theorem 5.
:F
muF 2 muF
:
Alg:F
It thus su ces to prove that (5.22) muF ( F:muF = muF]) = idmu and (5. ( F:muF = muF]) 2 F:muF Alg muF :
:F
( F:muF = muF]) 2 F:muF Alg muF : Proof Assume that muF is an initial Falgebra.23) ( F:muF = muF]) muF = id mu : We have.17) g true :
muF
:F
( F:muF = muF]) muF = f computation rule: (5. 1998
Category Theory
. By corollary 5.19c) g F:muF F:(F:muF = muF]) = f F is a functor g F:(muF ( F:muF = muF])) = f (5.12. The witnesses are
muF 2 muF
:
Alg:F
F:muF
F:muF : Moreover.
2 muF Alg F:muF f (5.17.19e) g
:
F
:
F:
F
:
F
:
:
Also.22) g
: : :
F:idmu = f
id
F:
F
muF
:
F is a functor g
June 12. by the initiality of muF . F:muF is an Falgebra.
_ In lattice theory the function is monotonic in the sense that f w g ( f w g . In category theory is constructively monotonic.
71
2
This theorem is due to Lambek 13] and is often referred to as Lambek's lemma . The Initial Algebra Functor This completes the proof.3. the functor S:x has a canonical initial algebra mu(S:x) with carrier (S:x) . for each x2D .1. Following the standard technique in category theory. and
Mu:f = (f ( Alg:(S:y) (Alg:(S:f)):mu(S:x) = mu(S:y)]))
:
for all f 2 x y . functorial. for each x2D . Noting that mu(S:x) is an initial object in the category Alg:(S:x) . the assumption we make is that all endofunctors of a certain \shape" have initial algebras. The assumed \shape" will be speci ed in more detail later for the moment it has no relevance to our discussion. In this section we formulate and prove this theorem.3 The Initial Algebra Functor
for all x2D . Category Theory June 12.e. We further postulate that. that the power set functor cannot have an initial algebra. we postulate a shape category. A complication in our formulation is that we do not wish to assume that all endofunctors have initial algebras. D say. (It is very wellknown. which equals (Alg S):x . Then there is a functor Mu 2 (Alg S) D de ned by
Mu:x = (x mu(S:x))
for all x2D . Expanding the de nition of the functor Alg on arrows (see theorem 5. and a (covariant) functor S to the category End:C from D . for example.14).24 Suppose S 2 End:C D is a (covariant) functor such that. i. and
Mu:f = (f ( Alg:(S:y) mu(S:x) (S:f)
(S:x)
= mu(S:y)]))
:
for all f 2 x D y . 1998
.5. the functor S:x has a canonical initial algebra mu(S:x) with carrier (S:x) . We obtain: there is a functor Mu 2 (Alg S) D de ned by
Mu:x = (x mu(S:x))
5. and the functor Alg S is contravariant we see that we can immediately apply lemma 3.) Instead. we obtain:
Lemma 5.
the functor S:x has a canonical initial algebra mu(S:x) with carrier (S:x) .26) car:(x f) = cod:f and on arrows car is de ned by: (5. and :f = ( Alg:(S:y) mu(S:x) (S:f) ( ) = mu(S:y)]) for all f 2 x D y . Now what we need is some sort of carrier functor that maps the pair (F muF) to F(= cod:muF) .72
5. codomain calculus g
S S :y S :y :f
:
Theorem 5.
S S S S:x
:
2
Category Theory June 12. 1998
.28 (The Functor ) Suppose S 2 End:C D is a (covariant) functor such that. Then there is a functor 2C D de ned by :x = (S:x) for all x2D .25 car 2C (Alg S) is the functor de ned in the following way. This explains why we do not make explicit the fact that it is parameterised by S .27) car:(h ') = ' :
2
Proof
) )
' 2 cod:f C cod:g f de nition car on objects g ' 2 car:(x f) C car:(y g) : So. 2
Combining the two functors car and Mu we have a functor
S S
(h ') 2 (x f) (Alg ) (y g) f (2.15) g ' 2 f (S:h)cod (Alg ) g f de nition arrow in Alg:G . Algebras
Remark: The name Mu is purely local to the current construction and will only once be used outside this section. On objects car is de ned by: (5.22) g ' 2 ((Alg S):h):f (Alg ) g f de nition Alg : (5. Lemma 5. for arrows we de ne car:(h ') = ' . The coherence properties are straightforward. for each x2D .
mu(x ) .30
(5. List:x is de ned by considering the binary functor where x y = 1 (x y) . then by construction of :
Category Theory June 12.
2
Lemma 5. and then abstracting from x: In this section 1 we make this process precise. namely the construction of inductive types. We are going to prove that the socalled map operator $ . on objects x2C . 1998
. Assume that 2 D C D is a binary functor. on arrows f in C . where. In other words. Map Operator
73
5. Let f 2 x y be an arrow in C .4. Suppose that for all objects x the endofunctor x has a canonical initial algebra.5. for all y2D:
y y
Proof In lemma 5. by de nition. Informally.29
is functorial in both arguments. The theorem is clearly an instance of theorem 5. The functor List is an example of an inductive type. con1 structing an initial (y 7! 1 (x y))algebra. If x is an object of C then x is the endofunctor on D obtained by xing the rst argument of to x: Suppose y is an object of D .29 we stated that x is an endofunctor on D . which maps objects x to the object (x ) is a functor.28 but in order to instantiate the latter formally we need two elementary lemmas.
+ +
Lemma 5. y 2D C is the unary functor obtained by xing the second argument of to y .31) app:x = x
app 2 End:D
C is a functor. xing the argument x .
and. The proof of the rst is left to the reader.32) app:f = f where f is the natural transformation in End:D de ned by (f ) = f id . (5. with carrier (x ) . by xing one of the arguments of a binary functor we obtain a unary functor. then x is de ned by: (x ):y = x y and on arrows f it is de ned by: (x ):f = id f :
x
Symmetrically.4 Map Operator
We now come to one of the most important constructions in computing science.
:
:
v
u
z
z
:
:
x
v
u
y
From (5. Then. we can give the main result Theorem 5. where (5. Algebras
de nition of a natural transformation g 8(z z2D 2 x z y z) ^ 8(g g 2 u v (x ):g = (y ):g) ( f = f id lemma 5. Category Theory June 12. Let us now introduce the following functor. Then F _ G 2 C D is a functor.35) we can immediately derive the following computation rule: (5.
: :
z
2 app:x app:y f (5.
x
2
:
.34) $ :x = (x ) and (5. 1998
2
Finally.37 Let F G 2C D be functors.39) (F _ G):f = F:f G:f: for arrows f in D .28 with the functor app .29 g 8(g g 2 u v id g f id = f id id g) f is a binary functor: coherence requirement g true : The coherence properties are straightforward.38) (F _ G):x = F:x G:x for objects x in D and (5.35) $ :f = ( y mu(x ) f id ( ) = mu(y )]) where f 2 x y .31) g 2x y f x and y are functors. Lemma 5. Proof Instantiate S in theorem 5. the map operator $ 2D C is a functor de ned in the following way: (5.36) $ :f mu(y ) = mu(x ) f $ :f for all f 2 x y .33 Suppose 2 D C D is a binary functor and for each object x in C the functor x has an initial algebra denoted by mu(x ) .74
5.
Map Operator
75
Then we can rewrite (5. using (5.5. we can give the typing of mu(x ) in the base category: mu(x ) 2 $ :x (Id _ $ ):x : In other words.36) as $ :f mu(y ) = mu(x ) (Id _ $ ):f : Similarly.20) we can derive a `mapfusion rule': let g 2 x y then (5. Finally. 1998
. using also that $ :x = (x ) .40) ' 2 $ Id _ $ de ned on objects x by ' = mu(x ) . we have a natural transformation (5.4.41) ( f = mu(x )]) $ :g = ( f g idcod = mu(y )]) :
x
2
:
:f
:
Category Theory
June 12.
Algebras
Category Theory
June 12. 1998
.76
5.
. The fusion rule combines the concept of an initial algebra with the concept of an adjunction.) The rolling rule is too elementary to be called \important" in its own right but it is extremely useful in combination with the other rules. the form: \if functors F . i. . As an illustration. and two theorems that are each the result of combining two of the basic theorems. have initial algebras . Often. the abstraction theorem. . we combine the rolling rule with the fusion rule in section 6. The rolling rule generalises the property (commonly known to category theoreticians as \Lambek's lemma" 13]) that initial Falgebras are xed points of F . . . the diagonal rule. a set with a re exive. in lattice theory. In this chapter a similar assumption about the categories we are working in will not be made. transitive and antisymmetric ordering. . The last basic xed point rule. Each of the theorems has. G . Combining the fusion rule and the abstraction theorem enables us to prove in section 6. captures the basic principle of decomposing the construction of an initial algebra into the construction of a succession of such algebras. (Its namesake in lattice theory generalises the property that a least pre x point of monotonic function f is a xed point of f . then functor H has initial algebra de ned as follows:". 1998
. instead. The exchange rule is so called because it states when two lower adjoints may be exchanged in the construction of initial algebras. . Although a category corresponds to a preordered set we state the latticetheoretic theorem within a complete partially ordered set. Presenting the theorem in a preordered set introduces additional complications Category Theory 77 June 12. In every section we rst state the corresponding theorem in lattice theory. and the abstraction theorem combines the concept of an initial algebra with the concept of parameterisation. the rolling rule and the diagonal rule. the calculations concerning xed points are performed within a complete lattice. the exchange rule.3 a \beautiful theorem" concerning the limit properties of xed point constructions.6 to prove another theorem.e.Chapter 6 Fixed Point Calculus
In this chapter we present four basic xed point theorems. The KnasterTarski theorem can then be used which states that for every monotonic function there is a least pre x point which coincides with its least xed point. The basic xed point theorems that we present are respectively: the fusion rule.
Furthermore.78 that we prefer to avoid.e.36). 1998
. it is assumed that there is an isomorphism swap 2 F G = H F 3 swap .
]
:
:
]
]
]
Hence.1 The Fusion Rule
: :
Given are two complete partially ordered sets C = (C w) and D = (D ) . Fixed Point Calculus
6.5): _ (6. By theorem (4. Assume that f is a lower adjoint. We make the following assumptions: Given are two categories.38): _ _ h fwf g f hwg f :
] ]
Our goal is to derive a similar result in category theory.1) we get _ 8(x x2Pre:h f :x 2 Pre:g) ( f h w g f :
]
:
In particular. we have f: g = h .3) adjswap 2 F H G F :
] ] ] ] ]
Category Theory
June 12. if f g = h f then f and f form a Galois connection between Pre:h and Pre:g . and two functors G 2D D and H 2C C . we have to construct an adjunction between the categories Alg:H and Alg:G . since Pre:h2C and Pre:g2D .1) 8(x x2Pre:g f:x 2 Pre:h) ( f g w h f : _ f: g 2 Pre:h ( f g w h f : Furthermore. Given also is an adjoint pair of functors (F 2C D F 2D C ) with unit and counit as unit and counit and b c and d e as left and right adjungate respectively. We have now proven the theorem we call the fusion rule: if f is a lower adjoint then f: g = h ( f g = h f :
]
But by the pseudoinversality property (4.e. Recall from theorem 4.
6. i. f has an upper adjoint f 2D C . First. an adjoint pair of functors (K 2 Alg:H Alg:G K 2 Alg:G Alg:H) . since h is the least pre x point of h . Suppose that f 2C D . g 2D D and h 2C C are monotonic functions.2) f: g w h ( f g w h f : This gives us the inspiration to look for a similar result but with as ordering equality. Finally.33 that the pair of functors (F (F ) ) forms an adjunction with adjungates b c and d e de ned by equation (4. _ (6. there is a natural transformation adjswap such that: (6. We recall (5. i. since lower adjoints preserve least elements. C and D . By instantiating f g h = f h g in (6.39).
where
]
is an arrow in Alg:H.
]
]
x
]
]
x
F] :x
]
Category Theory
June 12. By lemma 5. (6.7) K :h = F :h adjswapcod .6.2.7) g b c 2 F :h adjswap Alg g f de nition 5.5) K:g = F:g swapcod . The result of that construction is that K de ned in the following way is a functor to Alg:G from Alg:H . (6.6) K:' = F:' . where h 2 Alg:H
] ] ] ]
:h
(6. with K and K de ned in the previous way.
H G :g
(6. where ' is an arrow in Alg:G.6 can also be applied to construct a de nition for K . (6. cod:h = x and cod:g = y then b c 2 K :h Alg g f (6.6. Similarity of K and K with F and F suggests that the adjunction (K K ) has left and right adjungates equal to b c and d e (with the domains limited to arrows of Alg:H and Alg:G respectively).9) b c 2 K :h
]
Alg:G
(6. i.9) and (6.1. Suppose h is an Halgebra.
] ] ] ]
Finally.8) K : = F :
] ]
. Lemma 5.4) g b c 2 F :x y ^ F :h bH:counit swap c G:b c = b c g f (4.10) are symmetric. (6. . 1998
. K de ned in the following way is a functor to Alg:H from Alg:G . domains g b c 2 F :x y ^ F :h adjswap G:b c = b c g f (6.4) adjswap = b F H counit swap F c : We're now going to use the given information to relate objects in the two categories Alg:G and Alg:H to each other. The Fusion Rule
] ]
79
More precisely. we have to verify that (K K ) . so we only verify the rst one.10) d'e 2 h
Alg:H
K:g ( ' 2 K :h
]
:G
g ( 2h
Alg:H
K:g g :
Alg:G
g is a Galgebra. where g 2 Alg:G.16d) g b c 2 F :x y
] ]
:G x
(6.e. First we verify that the types of b c and d e are correct. is indeed an adjunction.
Then the functor K 2 Alg:H Alg:G de ned by K:g = F:g swapcod .80
6.
] ]
Speci cs If we let unit and counit denote the unit and counit and b c and d e denote the left and right adjungate of the adjunction (F 2C D F 2D C ) .2 g Alg F:g swap 2h f (6. H is a functor g b c 2 F :x y ^ h H:(counit F:b c) swap = F:g f counit = did e . Finally assume that there is an isomorphism swap 2 F G = H F . so counit F:b c = g b c 2 F :x y ^ h H: swap = F:g f swap is an isomorphism. Fixed Point Calculus
(
(
^ bh H:counit swap F:G:b cc = b F:gc f Leibniz g b c 2 F :x y ^ h H:counit swap F:G:b c = F:g f swap 2 H F F G .36). where ' is an arrow in Alg:G
Category Theory June 12.5) g Alg 2h K:g :
x F] :x
]
x
F] :x
]
x
y
x
F] :x
x
]
y
y
:H
y
:H
The remaining coherence properties are
K : b'c
]
=b
]
' K: c
d'e K: = dK : ' e b c='
= d'e :
]
All three follow immediately from (6.4) and the adjungates b c and d e by equation (4.16b) g 2 x F:y ^ h H: = F:g swap f de nition 5. In summary we have proven the following:
Theorem 6.
:g
K:' = F:' . (4. Let G 2D D and H 2C C be two functors and let (F 2C D F 2D C ) be an adjunction. where g 2 Alg:G. Then.6) and (6.11
Suppose C and D are categories. 1998
. respectively.8) and the assumption that (F F ) is an adjoint pair of functors with b c and d e as left and right adjungate respectively. there is an adjunction between the categories Alg:H and Alg:G . De ne adjswap by equation (6.
(Although. where h 2 Alg:H K : = F : .
F:muG swap
Alg:G
G
=d e
h
muG . it is assumed that Alg:G has an initial object muG . the functor F has an upper adjoint F .
]
Then
is an initial object in the category Alg:H . Furthermore.6. this de nition is correct because the arrow is also an arrow in the base category C . For the unique arrow to h from F:muG swap we have
G
( (
2h f 2 F :h f = ( F :h
] ]
Alg:H
G
muG initiality of muG in Alg:G adjswap = muG]) : adjswap
H H
theorem 6.
de nition of K
]
g
g
June 12. follows immediately from our previous theorem and the fact that lower adjoints map initial objects to initial objects.1. for every initial Halgebra muH F:muG swap = muH : As a consequence we also have an isomorphism in the base category. where is an arrow in Alg:H is the upper adjoint. 1998
:
Category Theory
. Given also is an isomorphism swap 2 F G = H F . b c is de ned on arrows of C .11. The Fusion Rule
] ] ]
81
is the lower adjoint and the functor K 2 Alg:G Alg:H de ned by K :h = F :h adjswapcod . F: G = H : Speci cs In both isomorphisms ( Alg:H F:muG swap = muH]) is the arrow to F: G from H and d( Alg:G F :muH adjswap = muG])emu mu is its inverse. Finally. i.12 (Fusion Rule) Given are three functors F 2C D .
G G
F:muG swap
G
:
]
H
:
H
G
Proof That F:muG swap is an initial object in the category Alg:H .
:h
]
]
2
Corollary 6. So. The left adjungate of this adjunction is de ned on arrows in Alg:H by b c .e.) The right adjungate is de ned similarly. G 2D D and H 2C C .
On objects F _ maps a functor G to the functor F _ G de ned in lemma 5. Guided by the above discussion. Given the expression f:x g:x we can either: rst abstract from g then abstract from x and then take the least pre x point (which leads to (f _ ) ) or we can rst abstract from g:x then take the least pre x point and then abstract from x (which leads to x 7! ((f:x) ) ). Let f 2C E be a monotonic function and let 2 D C D be a monotonic binary function written as in x operator. Then the monotonic function f _ 2 (D E ) (D E ) de ned by ((f _ ):g):x = (f _ g):x = f:x g:x has a least pre x point. The equality says that in both cases we end up with the same expression.
Lemma 6. D and E . For every natural transformation in the functor category Fun(D E ) .82
6. 1998
Category Theory
. if we allow extensionality then the equality says that we can de ne the least pre x point of (f _ ) pointwise. (f _ ) = x 7! ((f:x) ) : The justi cation for the name \abstraction theorem" comes from the following observation.
6. Finally. Fixed Point Calculus
2
The two arrows witnessing the isomorphism follow from the initiality of muH in Alg:H and instantiating muH for h in the above respectively.14) (F _ ):G = F _ G for every functor G 2D E . the natural transformation (F _ ): in Fun(D E ) is de ned by: (6. For each element x2E we denote the least pre x point of the function (f:x) by ((f:x) ) . our rst task is to de ne F _ 2 Fun(D E ) Fun(D E ) as a functor.37. speci cally.15) ((F _ ): ) = id
z F:z z
for all z2E . D and E . June 12.2 The Abstraction Theorem
In lattice theory the abstraction theorem for least pre x points is the following. So. we make the following assumptions. Let F 2C E be a functor and let 2 D C D be a binary functor written as in x operator. Given are three complete preordered sets C . Given are three categories C . it is assumed that for every object x in C an initial object mu((F:x) ) exists in Alg:((F:x) ) . Moreover. In this section we translate the above theorem to category theory.13
F _ 2 Fun(D E ) Fun(D E ) is a functor. where
(6.
Let mu(F _ ) denote a particular initial (F _ )algebra then we can conclude (F _ ) = $ F : The construction of an initial (F _ )algebra on the carrier $ F goes as follows.16) x 7! ((F:x) ) = (x 7! (x )) F = $ F where $ is the map operator of section 5.e. It remains to prove that is initial. an immediate consequence is that the carrier of . by construction of :
::
x x
2
f arrow in Alg:(F _ ) g (F _ ): = ^ 2 G Fun(D E ) $ F f extensionality.4.6. Suppose 2 G F _ G is an (F _ )algebra. We do this by constructing an initial object in Alg:(F _ ) in such a way that has $ F as its carrier. is isomorphic (in the functor category) to the carriers of all initial (F _ )algebras. We will show that if Alg:((F:x) ) has an initial object for all x (as our assumption states) then so does Alg:(F _ ) . so is isomorphic to all initial (F _ )algebras.3. The Abstraction Theorem
83
That x 7! ((F:x) ) is a functor follows immediately from the following observation (6. We have to construct a unique arrow to from . i. In theorem 2.40) g 8(x ' = mu(x )) : So. =' F g ' 2 $ Id _ $ ( f (5. First we construct a candidate: 2 $ F F _ ($ F) f composition g 2 $ F (Id _ $ ) F ( f Godement's rules.6 we showed that all initial objects in a category are isomorphic. has a unique arrow to any other (F _ )algebra. Thus. as a candidate we have the natural transformation de ned by = mu((F:x) ) for each object x .e. i. $ F . by lemma 5. So.2. 1998
. de nition natural transformation g 8(x id = ^ 2 G:x $ :(F:x)) ^ 8(f f 2 x y G:f = $ :(F:f))
::
x F:x x x x x
2
Alg:F _
:
:
y
x
Category Theory
June 12.
29): id = ((F:x) ): . Let f 2 x y . (being an arrow in base category is trivial) g F:f id ((F:y) ):G:f = G:f f ((F:y) ):(G:f) = id G:f . Fixed Point Calculus
(6. (5.19e) g G:f 2 F:f id Alg (( ) ) f de nition arrow in Alg:((F:y) ) . and objects in Alg:((F:x) ) g Alg (( ) ) 8(x 2 ) ^ 8(f f 2 x y G:f = $ :(F:f)) f = mu((F:x) ) .18) g 8(x = ( = mu((F:x) )])) ^ 8(f f 2 x y G:f = $ :(F:f)) f see veri cation below g 8(x = ( = mu((F:x) )])) :
::
x x x x x x x
x
g
:
:
y
x
x
x
:
F:x
::
x
x
x
:
:
y
x
x
::
x
x
:
:
:
y
x
::
x
x
:
If we are now able to prove that the rst conjunct in (6.41) g G:f ( = mu((F:y) )]) = ( F:f id = mu((F:y) )]) f fusion: (5.17) implies the second conjunct then we have proven that the natural transformation de ned on objects x by = ( = mu((F:x) )]) is an arrow to from . 1998
. June 12. Then this veri cation goes as follows:
x x
:
(
G:f ( = mu((F:y) )]) = ( = mu((F:x) )]) $ :(F:f) f mapfusion: (5.84
F:x x x
6.17)
f (5. de nition of 8(x ((F:x) ): = ^ 2 cod: cod: ) ^ 8(f f 2 x y G:f = $ :(F:f)) f de nition natural transformation. we have also veri ed the uniqueness of . since in the above construction all the steps are equivalences. coherence property binary functor g F:f G:f = G:f f 2G F_G g true :
y
:
x
:
y
:
x
G:x
:
:
F:y
x
G:x
y
x
G:x
y
F:y
x
y
We conclude that Category Theory
is indeed an initial (F _ )algebra. Moreover.
which follows from the above proof. 1998
.2.3 also the carriers of and mu(F _ ) are isomorphic so x 7! ((F:x) ) = (F _ )
:
and the witnesses are the same. Assume also that for every object x in C an initial object mu((F:x) ) exists in Alg:((F:x) ) .
2
Category Theory
June 12. By lemma 5. the uniqueness of the arrow to and from mu(F _ ) and to and from . the proven initiality of and. and
2 mu(F _ )
x
Alg:F _
x
de ned by = ((mu(F _ )) = mu((F:x) )]) for each object x in E . Then the natural transformation . Finally we state the theorem in full. ( = mu(F _ )]) is the arrow to x ! ((F:x) ) from (F _ ) and the natural transformation de ned by 7 = ((mu(F _ )) = mu((F:z) )]) for each object z in E
x
:
z
z
:
is its inverse.6.18 (Abstraction Theorem) Given are three categories C .6 = mu(F _ ) : The witnesses to this isomorphism are ( = mu(F _ )]) 2
:
Alg:F _
mu(F _ )
which follows from the assumed initiality of mu(F _ ) . de ned pointwise by = mu((F:x) ) is an initial (F _ )algebra. if mu(F _ ) denotes a particular initial (F _ )algebra having codomain (F _ ) . D and E . then x ! ((F:x) ) = (F _ ) : 7 Speci cs In both isomorphisms. The Abstraction Theorem
85
We have now reached the nal part of the proof. let F _ denote the functor G!(x ! F:x G:x) of type 7 7 Fun(D E ) Fun(D E ) . Moreover. That the composition of these arrows in both order gives the identity arrow follows from the assumed initiality of mu(F _ ) . as a result. Then by theorem 2.
Theorem 6. between and mu(F _ ) and their carriers. and let 2 D C D be a binary functor written as inx operator. Finally. Suppose mu(F _ ) denotes a particular initial (F _ )algebra. Let F 2C E be a functor.
86
6. then (6. which we denote by $ . For all f 2B C . 159]. We begin our proof with a use of the abstraction theorem designed to get us into a position in which fusion is applicable. More precisely. Denote the least pre x point of x by (x ) and consider the function x 7! (x ) . A proof of this theorem (in lattice theory) is a straightforward combination of the abstraction and fusion theorems (in lattice theory). f _ g is the function mapping x to f:x g:x and denotes function composition.19) 8(f $ :(Sup:f) = Sup:($ f)) ( 8(f g (Sup:f) (Sup:g) = Sup:(f _ g)) where. letting Sup:f denote the supremum of f .
above calculation applied to the rhs g ((SupB :f) ) = SupA : (f _ ) ( f fusion (which is applicable since SupA is a lower adjoint) and extensionality g 8(g (SupB :f) (SupA:g) = SupA :(f _ g)) : We have thus proved that 8(f $ :(SupB :f) = SupA:($ f) ( 8(g (SupB :f) (SupA :g)=SupA :(f _ g))) :
:: :: ::
Category Theory
June 12. de nition of composition g c ! $ :(f:c) 7 = f de nition of $ g c ! ((f:c) ) 7 = f abstraction theorem g (f _ ) : $ :(SupB :f) = SupA :($ f) f de nition of $ applied to the lhs. Dijkstra and Scholten formulate the \beautiful theorem" in the context of the predicate calculus. 1998
. by de nition. The \beautiful theorem" is that $ enjoys any type of supremumpreserving property that is enjoyed by the (uncurried binary) function . Let us show how this is done.
$ f = f extensionality.
:: ::
Thus. p. Fixed Point Calculus
6. In terms of lattice theory the theorem is stated as follows. Suppose that A = (A w) and B = (B ) are complete lattices and suppose 2 (A A) B is a monotonic function.3 The Beautiful Theorem
This section combines the abstraction theorem and fusion theorem to prove in category theory a theorem dubbed \beautiful" by Dijkstra and Scholten 6.
) Our goal is to prove that $ \commutes" with Col if \commutes" with Col . by the fusion theorem (and the fact that ColA is a lower adjoint). Then.6. for all b2B . $ F = cod: g cod:(ColA : ( _ ) ) = ColA :(cod: ) f codomain calculus g true :
:: ::
F x F
Category Theory
June 12. . is an initial (F _ )algebra. The Beautiful Theorem
87
The \beautiful theorem" follows by elementary calculus.4 for the de nitions of the three functors on the right side of this equation.3. Suppose A . the functor b has an initial object denoted by mu(b ) . we are given that. But. Let ColA and ColB denote colimit operators of type A Fun(A C ) and B Fun(B C ) . The only fact that we will use about these two operators is that ColA is a lower adjoint in an adjunction between the categories A and Fun(A C ) . Thus we assume that. Let $ denote the functor whose action on objects is to map b to (b ) . In this section we formulate and prove the categorical version of the theorem. Eliminating the quanti cation over G . B and C are categories and suppose that A and B are both C cocomplete. 1998
. ColA (F _ ) = (ColB :F) ColA : Suppose the witnessing isomorphism is . Only the fact that the supremum operator is the lower adjoint in a Galois connection is needed. To be precise. de ned by = mu((F:x) ) . for all F . A remarkable aspect of that proof is that no use is made whatsoever of the details of the Galois connection de ning suprema. More precisely. de ne $ = car Mu app : (See section 5.2. We adopt the same notational conventions and assumptions as in section 6. Thus. by the abstraction theorem. Suppose 2 (A A) B . Let us consider the premise. ColA :mu(F _ ) ( _ ) is an initial ((ColB :F) )algebra whenever mu(F _ ) is an initial (F _ )algebra. we prove that 8(F $ :(ColB :F) = ColA :($ F)) ( 8(F G ColA:(F _ G) = (ColB :F) (ColA:G)) : Here and elsewhere the dummy F ranges over functors of type B C and the dummy G over functors of type A C . The codomain of mu(b ) is again denoted by (b ) . $ :(ColB :F) = ColA :($ F) f $ :(ColB :F) is by de nition the codomain of an initial ((ColB :F) )algebra by de nition. respectively.
(Recall that an arrow between two algebras in an algebra category is also an arrow between their carriers in the base category. Then d( KA C :f = ])e is the unique arrow from ColA : ( _ ) to f . for all F . The details are complicated but entirely mechanical. Let b c and d e denote the lower and upper adjungate and counit the counit of the adjunction (ColA KA C ) .
6.289]. A striking feature of our proof is that no use is made whatsoever of the structure of the adjunction de ning colimits we have used the fact that B cocompleteness of a category is equivalent to the existence of an adjunction but the structure of the colimit functor or its upper adjoint has not entered the picture. Let f be a ((ColB :F) )algebra and let = b(ColB :F) counitcod KA C (cod ) c . 17] where details of the construction of a category of cocones plays a prominent r^le.88 We have thus proved that. 1998
. For completeness we should of course provide details of the witnesses to the constructed isomorphism. de ning = d( KA C :mu((ColB :F) ) we have:
mu((ColB :F)
)
2 $ :(ColB :F) = ColA:($ F)
(
2 ColA (F _ ) = (ColB :F) ColA :
An important special instance of the \beautiful theorem" is that ! cocontinuity is preserved by the process of constructing initial algebras 19. This emphasises the more fundamental nature of the o abstraction and fusion theorems. p. Furthermore.
d( KA C :mu((ColB :F) )
mu((ColB :F)
)
= ])e
:
F
is the unique arrow to $ :(ColB :F) from cod:(ColA : ( _ ) ) .
cod:(ColA :
(F _ )
) = ColA:(cod: ) = ColA :($ F) : = ])e
:
So.
f :f : :f f
:
F
$ :(ColB :F) =(car Mu app):(ColB :F) = cod:(mu((ColB :F) )) :
Thus. This is in marked contrast to proofs given by others of the preservation of ! cocontinuity 16. Let denote the inverse of . Fixed Point Calculus
$ :(ColB :F) = ColA:($ F) ( 8(G ColA:(F _ G) = (ColB :F) (ColA :G)) :
::
The categorical \beautiful theorem" follows by elementary calculus.) Finally. Category Theory June 12.
We will show how to construct an initial (F G)algebra. This is our candidate initial (F G)algebra. 1998
.4 The Rolling Rule
Given two complete partially ordered sets C and D and two monotonic functions f 2C D and g 2D C .23) f F:G:' = ' F:mu(G F) : We have to verify that = ' (where is constructed as above). Let C and D be categories.12 to conclude that F:mu(G F) is an (F G)algebra.21) ' 2 f Alg ( ) F:mu(G F) : That is. (6. We construct an arrow in the category Alg:(F G) to f from F:mu(G F) as follows. and F 2C D and G 2D C be functors. f 2 f Alg ( ) F:G:f .6. 2 f Alg ( ) F:mu(G F) ( f by lemma 5. Although we know speci cally how to construct (mu(G F)) it will not be necessary to exploit the details of that construction.21). constructive transitivity. First we prove the existence of such an arrow. = F: g 2 G:f Alg ( ) mu(G F) ( f mu(G F) is an initial (G F)algebra g = ( G:f = mu(G F)]) : We have thus constructed the arrow (6. =f g 2 F:G:f Alg ( ) F:mu(G F) ( f corollary 5. we can use corollary 5. by de nition 5. Category Theory June 12.4. Suppose that
: F G : F G : F G : G F
:
: F G
:
(6.20) f F:(G:f = mu(G F)]) 2 f Alg ( ) F:mu(G F) : We now have to show that the above constructed arrow is unique. Suppose f is an (F G)algebra. Since mu(G F) is a (G F)algebra by assumption. So.2. The Rolling Rule
89
6.22) ' 2 cod:f F: (G F) and
: F G
(6. we have to show that there is a unique arrow from F:mu(G F) to any other (F G)algebra.12.17 . Suppose that mu(G F) is an initial (G F)algebra. the socalled rolling rule in lattice theory states that f: (g f) = (f g) : In this section we give a corresponding theorem in category theory. The key insight in the proof is that there is an arrow (mu(G F)) such that mu(G F) and (mu(G F)) are witnesses to the fact that mu(G F) and G:F:mu(G F) are isomorphic G Falgebras (see theorem 5.
Then by theorem 2. i. By lemma 5.90 ='
6.3. Leibnitz g ( G:f = mu(G F)]) = G:' (mu(G F)) f (5. Fixed Point Calculus
f F:mu(G F) F:(mu(G F)) = F:idmu( ) = F:id ( ) g = ' F:mu(G F) F:(mu(G F)) f = f F:(G:f = mu(G F)]) (see above) . (6.18) g G:' (mu(G F)) 2 G:f Alg ( ) mu(G F) ( f (mu(G F)) 2 G:F:mu(G F) Alg ( ) mu(G F) g G:' 2 G:f Alg ( ) G:F:mu(G F) ( f (5. Then F:mu(G F) Category Theory June 12. We nally state the theorem in full. F: (G F) = (F G) and the witnesses to this isomorphism are the same.21) g true : This concludes our proof that F:mu(G F) is an initial (F G)algebra.23) g f F:(G:f = mu(G F)]) = f F:G:' F:(mu(G F)) ( f F is a functor. Theorem 6. Suppose that mu(G F) is an initial G Falgebra.e. 1998
.12) g Alg ( ) '2f F:mu(G F) f (6. Now suppose that mu(F G) is an initial (F G)algebra.6 F:mu(G F) = mu(F G) :
G F G F
:
:
:
: G F
: G F
: G F
: F G
The witnesses to the isomorphism are ( F:mu(G F) = mu(F G)]) 2 F:mu(G F) Alg ( ) mu(F G) which follows from the assumed initiality of mu(F G) and
: F G
:
mu(F G) F:( G:mu(F G) = mu(G F)])
:
2 mu(F G)
Alg:(F
G
)
F:mu(G F)
which follows from the above proof.24 (Rolling Rule) Let C and D be categories. and F 2C D and G 2D C be functors. we also have an isomorphism between the carriers.
It follows that it is a least pre x point of f if it is a pre x point of f .5 The Square Theorem
Suppose f is a monotonic endofunction on a partially ordered set C = (C v) . for every initial (F G)algebra mu(F G) F:mu(G F) = mu(F G) : As a consequence we also have an isomorphism in the base category.5. in particular exploiting the rolling rule. Then f also has a least pre x point (indeed (f f) is itself the least pre x point of f ). (We assume nothing else about C .)
Category Theory
June 12. The theorem is due to Freyd 10] who called it the iterated square theorem. (Freyd does not use the rolling rule instead he uses the square theorem to prove the mutual recursion theorem from which he derives the rolling rule. Speci cally. So. Then x is a pre x point of f f as shown by the following elementary calculation:
x w f:f:x ( f transitivity g x w f:x ^ f:x w f:f:x ( f f is monotonic g x w f:x : The pre x points of f thus form a subset of the pre x points of f f and (f f) . See the discussion of the mutual recursion theorem. But. i. by the rolling rule (f f) = f: (f f) and so this is indeed the case.
In this section we prove the categorical version of this theorem. being a lower bound on all pre x points of f f . is a lower bound on all pre x points of f .) Suppose that f f has a least pre x point (f f) . The proof is straightforward. The Square Theorem is an initial (F G)algebra. suppose x is a pre x point of f . 1998
.6.
: :
91
2
This theorem is stated and proved in 10].
6. F: (G F) = (F G) : Speci cs In both isomorphisms ( F:mu(G F) = mu(F G)]) is the arrow to F: (G F) from (F G) and mu(F G) F:( G:mu(F G) = mu(G F)]) is its inverse.e. Our proof follows the lines of the above latticetheoretic argument.
Let us denote the functor we have constructed by Sq . (I. Fixed Point Calculus
Suppose F is an endofunctor and suppose F F has an initial algebra mu(F F) . Speci cally. One might suppose from the latticetheoretic proof that the rst step is to establish that any Falgebra is an (F F)algebra. For the arrow part of the functor we are trying to construct it is a simple
matter to derive that
2 f F:f
Alg:(F
F
)
g F:g
(
2 f Alg g :
:F
(We leave this calculation to the reader. by construction of .
:F
mu(F F) = Sq:
(
Lambek's lemma (5.21) and lemma (5. f 2 x F:x . The goal is to prove that F has an initial algebra.) Thus the identity function is what we are looking for (and because it is the identity function we know immediately that we have constructed a functor). We next remark that mu(F F) is in the range of the (object part of the) functor Sq . Suppose f is an Falgebra with carrier x . Sq:f = f F:f for all Falgebras f .92
6.17) mu(F F) is the unique arrow in Alg:(F F) to mu(F F) from (F F):mu(F F) g Sq: 2 mu(F F) Alg ( ) (F F) : mu(F F) f Sq: = F: by de nition straightforward calculation using the de nition of arrows in Alg:(F F) g
: F F
f
Category Theory
June 12. This however is not the case.e. (It is the case that any carrier of an Falgebra is a carrier of an (F F)algebra. By de nition.) What is the case is that there is a functor mapping Falgebras to (F F)algebras. 1998
. Proving this property is our rst task. and Sq: = for all arrows 2 f Alg g .) We construct an (F F)algebra with carrier x as follows:
2 x F:F:x ( f = g 2 x F:x ^ 2 F:x F:F:x ( f F is a functor = F: g 2 x F:x ( f assumption g =f : We conclude that f ! f F:f is a mapping from the objects of Alg:F to the objects of 7 Alg:(F F) .
)
2 f Alg f de nition of Sq g Alg ( ) Sq: 2 Sq:f f Sq: = mu(F F) g = ( Alg:(F F) Sq:f = mu(F F)]) :
:F : F F
:
Initiality of demands that we establish an equivalence rather than an implication. supposing f is an Falgebra. we shall have no need of those details.6. The Square Theorem
93
: F F
(
2 mu(F F) Alg ( ) F:mu(F F) f rolling rule g = mu(F F) F:(F:mu(F F) = mu(F F)]) :
:
Note that. 1998
. Thus the proof is completed by showing that ( Alg:(F F) Sq:f = mu(F F)]) 2 f Alg : Let us introduce the abbreviation for ( Alg:(F F) Sq:f = mu(F F)]) . although we have given the details of the construction of . The property we will use of is that it is an isomorphism between mu(F F) and F:mu(F F) . we must show that there is a unique arrow in Alg:F to each Falgebra from .
:F
:
:
(
2f f de nition of Alg:F g 2 cod:f cod: ^ f F: = f 2 Sq:f Alg ( ) Sq: .5. Now.12 g f 2 Sq:f Alg ( ) F:(Sq:f) f F:(Sq:f) = F:(f F:f) = F:f F:(F:f) = Sq:(F:f) g
: F F : F F : F F : F F : F F : F F
Alg:F
Category Theory
June 12. Then. We now want to verify that is an initial Falgebra. corollary 5. That is. codomain calculus g f F: = f is an isomorphism g f F: = f unicity of g f F: 2 Sq:f Alg ( ) mu(F F) f 2 F:mu(F F) Alg ( ) mu(F F) g f F: 2 Sq:f Alg ( ) F:mu(F F) f 2 Sq:f Alg ( ) mu(F F) .
we have: Theorem 6.25 (Square Theorem) If F is an endofunctor and mu(F F) is an initial (F F)algebra then = mu(F F) F:(F:mu(F F) = mu(F F)]) is an initial Falgebra.26) (f g) = (f h) ( h f g = g f h : A possible proof of this theorem is the following. 1998
. We rst calculate as follows: (for this calculation suppose f and g are monotonic endofunctions) f= g f w is antisymmetric g
( (
fw g ^ gw f f least pre x point f and g g f w g: f ^ g w f: g f w is re exive g f = g: f ^ g = f: g :
Summarising. Moreover. Sq is a functor g f 2 f Alg F:f f lemma 5.27) f = g ( f = g: f ^ g = f: g : Using this calculation we prove (6.26): Category Theory June 12. Fixed Point Calculus
(
f 2 Sq:f Alg ( ) Sq:(F:f) f f = Sq:f (for arrow f ).94
6. More speci cally: Given are two complete partially ordered sets C and D and three monotonic functions f 2C D . Then the theorem we call the exchange rule states (6. (6. ( Alg:(F F) f F:f = mu(F F)]) = ( Alg:F f = ]) :
: : :
2
6. we can combine the rolling and fusion rule to establish yet another useful equality between least pre x points. Summarising what we have shown. g 2D C and h 2D C such that both g and h have an upper adjoint. for all Falgebras f .17 g true :
: F F :F
This completes the proof.6 The Exchange Rule
In lattice theory.
Then.6.27). Given is the category C and two endofunctors F and G on C which both have initial algebras denoted by muF and muG respectively. (6.31) muG G: = F:muG :
:G G G
To see that is an Falgebra we observe that it is also an arrow in the base category C . we now have (6. We introduce the following assumption: there is an isomorphism 2 F G = G F .6. F:muG has a unique arrow to any other Galgebra. g and h have an upper adjoint.27) corresponds to the assumption that F:muG is an initial Galgebra and G:muF is an initial Falgebra. in particular to muG .6. F:muG is a Galgebra and G:muF is an Falgebra. More speci cally: (6. We begin by constructing a similar result to (6. by lemma 5. We want to show that we can construct an initial Galgebra on the carrier F and conversely construct an initial Falgebra on the carrier G . As a consequence we then have F = G .27) g (f g) = f:h: (f g) ^ (f h) = f:g: (f h) f fusion rule (twice).29) = ( muG = F:muG ]) :
:
G
:G
F:muG
G
G
:
]) . So. The Exchange Rule
95
(
(f g) = (f h) f (6. This abbreviation is used throughout
:
G
Furthermore.e. I. (6.28) ( muG = F:muG ]) 2 muG Alg Let us use to denote (muG = F:muG the rest of this section.30) : 2 muG Alg F:muG Finally. h f g=g f h g (f g) = f: (g f) ^ (f h) = f: (h f) f rolling rule (twice) g true :
In this section we are going to prove a similar result in category theory. from (6.30) and the de nition of an arrow in Alg:G the following computation rule follows immediately: (6.
G F G F G
(6.32)
2 G
C
F: G :
June 12. Thus. We calculate as follows.28) can now be restated as: (6. 1998
Category Theory
.
28) we also have an arrow with the following properties: (6.33) ( = muF]) 2 Alg muF : This gives us half of the required isomorphism. Using theorem 5.19 it su ces to show that muF F:( = muG]) = ( = muG]) : The veri cation goes as follows: muF F:( = muG]) = ( = muG]) f lemma 5. By de nition we have (6.6): Alg F:muG g F:( = muG]) 2 F:
: : : : : : : : :
G G :G
:
G
:G
:
muF
2 F: f de nition arrow in Alg:G . symmetrically. to F from cod: .35)
:F
F
F
and nally:
2 F
:
C
G: F :
:G
So by de nition we also have: (6. 1998
.36) muF F: = G:muF
(6.20. typing base category trivial g G:muF = muF F: f (6. We conjecture that ( = muG]) is the inverse to ( = muF]) .18) g Alg muF F:( = muG]) 2 F:muG f 2 F G = G F .37) ( = muG]) 2 Alg muG : Thus.29) g muF F:( = muG]) = ( = F:muG ]) f F:muG is an initial Galgebra: (5.36) g true :
F F
Alg:G
F
G
Category Theory
June 12. (5.e. in the base category ( = muG]) is an arrow to cod: from G .96
6. by showing that it is isomorphic to muF . de nition of : (6. i. by interchanging F and G and and in (6. Fixed Point Calculus
We now show that is an initial Falgebra. For the arrow in the other direction observe that.34) = ( muF = G:muF ])
:F
:
:
F
2 muF Alg G:muF (6.
But the composition of ( = muG]) and ( = muF]) is also an arrow in Alg:F to muF from muF . The Exchange Rule In summary we have proven the following: ( = muF]) 2
:
97
Alg:F
muF
:F
and ( = muG]) 2 muF Alg : From the assumed initiality of muF we know that all the arrows in Alg:F from muF to another Falgebra are unique. Symmetrically. the identity arrows in an algebra are the identity arrows in the base category. so we have:
:
F
:
:
:
:
:F
F
:
:
:G
G
idAlg mu = idC = idC cod = idAlg :
:G G G : :F
I. we have proven: Lemma 6. Then: ^ 2 muF = G:muF 2 muG = F:muG ) ( = muF]) 2 = muF ^ ( = muG]) 2 = muG ^ ( = muF]) = ( = muG]) : Moreover. is an Falgebra with G as carrier.38 Given is the category C and two endofunctors F and G on C which both have an initial algebra denoted by muF and muG respectively. in particular the identity arrow idmu is the unique arrow to muF from muF . 1998
. so for the base category we have:
G G F F
:
F
:
G
:
:
)
^ 2 muF = G:muF 2 muG = F:muG ( = muF]) 2 G =C F ^ ( = muF]) = ( = muG]) :
G G F F
:
:
:
Category Theory
June 12. Finally we have that F and G(=cod: ) are isomorphic in the base category C . muF and are isomorphic in Alg:F . so we immediately have: ( = muG]) ( = muF]) = idAlg : mu Symmetrically we also have: ( = muF]) ( = muG]) = idAlg : mu But. muG and are isomorphic in Alg:G . In summary.e.6.6. Given also is an isomorphism 2 F G = G F .
an initial (F G)algebra and an initial (F H)algebra exist denoted by mu(F G) and mu(F H) respectively. for F a lower adjoint.98
6. 2 (F G) =C (F H) ^ = ( f lemma 6. Fixed Point Calculus
2
We can now continue with the proof of the exchange rule. G . Given are two categories. (F H):mu(F G) (F mirror) ( ) = f Godement's rules. =( = mu(F H)]) ^ = ( = mu(F G)]) g 2 mu(F G) = (F H):mu(F G) ( ) ^ 2 mu(F H) = (F G):mu(F H) ( ) ^ 2 F H F G=F G F H : ( f = F mirror g 2 mu(F G) = (F H):mu(F G) (F mirror) ( ) ^ 2 mu(F H) = (F G):mu(F H) (F mirror) ( ) : Further. (Details of the two adjunctions will not be needed in this section. G 2D C and H 2D C such that G is the lower adjoint in an adjunction and H is also the lower adjoint in an adjunction.38: F G = (F H) (F G) above. F:(fuse ( ) ( ):mirror) = and lemma 5. C and D . fuse :swap 2 muH = F:muG swap : We prove the isomorphism of (F G) and (F H) and simultaneously construct the witnesses and . We will simply make use of the results of the fusion rule. 1998
. and three functors F 2C D .) Futhermore. F is a functor g F:(H:mu(F G) mirror ( )) f fusion rule. H and swap ) roll 2 mu(F G) = F:mu(G F) and.12 g F:mu(G F)
F G F G F G H H G
:
:
:
F G
F G
F H
F H
F G
F G
F H
F H
F G
F G
F G
H
F G
G F
Category Theory
June 12. We will show that (F G) = (F H) ( mirror 2 H F G = G F H : We recall that the rolling rule and fusion rule give the existence of two isomorphisms of the following type: (for appropriate F .
mu(F G) . Furthermore. we have the natural isomorphism mirror 2 H F G = G F H . Finally. and four functors F 2C D . G 2D E . and three functors F 2C D . Finally. and an initial (F H)algebra. suppose given are three categories. we assume that an initial (F G K)algebra. we assume that an initial (F G)algebra. Then (F G) = (F H) : Speci cs In this isomorphism ( roll F:(fuse ( ) ( ) :mirror) = mu(F H)]) is the witness to (F G) from (F H) and ( roll F:(fuse ( ) ( ):(mirror )) = mu(F G)]) is its inverse.40 The two exchange rules can be combined into one. C . so (G F) and (H F) are isomorphic. ( fuse ( ) ( ):mirror H:roll = mu(H F)]) 2 (G F) C (H F) and ( fuse ( ) ( ) :(mirror ) G:roll = mu(G F)]) 2 (H F) C (G F) : Moreover these arrows are each others' inverses. and an initial (F H K)algebra.
F G
99
roll
F G
f rolling rule.6. Theorem 6. G 2D C and H 2D C such that G is the lower adjoint in an adjunction and H is also the lower adjoint in an adjunction. Speci cally.39 (Exchange Rule) Given are two categories.
H F G G F F G
:
G
F H
H F
F H
:
2
Category Theory
June 12. so (F G) and (F H) are isomorphic. Exercise 6.
:
F H G F H H F
:
F G
H
F G
G F
:
F H
G
F H
H F
:
2
In the same way we can construct a similar result for (G F) and (H F) . mu(F H K) . exist. exist. H 2D E and K 2E C such that G is the lower adjoint in an adjunction and H is also the lower adjoint in an adjunction. mu(F G)
F G H F G G F
g
( roll F:(fuse ( ) ( ) :mirror) = mu(F H)]) 2 (F G) C (F H) Symmetrically. Then (F G K) = (F H K) : Establish this theorem.6. suppose we have the natural isomorphism mirror 2 H K F G = G K F H . D and E . Finally. mu(F H) . 1998
. The Exchange Rule = I. we can state the theorem in full. Furthermore. mu(F G K) . Speci cally.e. C and D . ( roll F:(fuse ( ) ( ):(mirror )) = mu(F G)]) 2 (F H) C (F G) : Moreover these arrows are each others' inverses.
given an initial (x 7! x x)algebra we construct an initial (x 7! (y 7! x y))algebra and. We begin with introducing the following notation. Then the lattice theoretic diagonal rule states: (x 7! x x) = (x 7! (y 7! x y)) : In this section we derive the corresponding theorem in category theory.
^ ^
More speci cally.100
6. With these assumptions. The unusual length of the section is due to the fact that we prove the existence of an initial algebra in two directions.7 The Diagonal Rule
(6. Fixed Point Calculus
Let C be a complete partially ordered set and 2 C C C a monotonic binary function.41) (6. More speci cally. 1998
. we will construct an initial algebra in the other category on the same carrier. With the unary functor we denote the functor de ned on objects x and arrows f by respectively
^
6. given an initial algebra in one category. Given are a category C and a binary functor 2 C C C .7. We make the assumption that mu exists in Alg: and we have to show that an initial object exists in Alg:$ on the carrier . The rst step is to construct such that it is an object of Alg:$ . an arrow in the base category C to from $: .
^
$:
^
Category Theory
June 12.
^
6.vice versa. i. given an initial (x 7! (y 7! x y))algebra we construct an initial (x 7! x x)algebra.1 One Half
^
We begin with the proof that (a) implies (b).
^ ^ ^ ^
2 2
^
f
^
(
f
de nition of $ g (( ) ) mu(x ) is initial in Alg:(x ) .e.4.42)
^
x=x x f=f f :
^
Note that the functor x 7! (y 7! x y) corresponds to the map operator $ of section 5. we prove that the following two statements are equivalent: (a) (b) an initial object mu exists in Alg: . We may then derive an isomorphism between the carriers of initial algebras and initial $algebras. we assume that for each element x in C an initial object mu(x ) exists in Alg:(x ) . an initial object mu$ exists in Alg:$ . Furthermore.
(6. As computation rule we then immediately have (6.17): f 2 f Alg $:f . =f g Alg 2 $:f f de nition arrow in Alg:$ g $:(f ) = ^ 2 $:x f f 2x : de nition $ (5. The Diagonal Rule
101 = ( = mu((
: ^
2 f Alg ( f (5.19e) g mu(x ) (f ) id id = mu ^ 2 $:x f coherence requirement binary functor g mu(x ) f id = mu ^ 2 $:x f uep: (5. We now have to construct a unique arrow (in Alg:$ ) to f from . For brevity let denote ( mu = mu(( ) )]) . assume (6. for all f 2 Alg:$ (where cod:f = x ).44) f ( mu(x ) f id = mu ]) 2 f Alg : We now have to show that f ( mu(x ) f id = mu ]) is the unique arrow in Alg:$ to f from . 1998
. Assume that ' 2 f Alg .35). By construction of :
^ ^ : ^ ^ ^ ^ : ^ ^ ^
^
(
2 f
) )]) : g
^
^
^
initial algebra g
^
^
^
$:x
:
^
^
:
^
^
$:x
^
^
^
$:x
^
^
$:x
:
^
$:x
:
^
:$
$:x
:
^
:$
^
Category Theory
June 12. That is.19b) g = ( mu(x ) f id = mu ]) Thus.7.45) ' 2 x and (6.46) f $:' = ' :
:$ :$ :$
= mu : We conclude from this calculation that ( mu = mu(( ) )]) 2 $: is an object of Alg:$ . de nition g ( mu(x ) (f ) id = mu(( ) )]) = ( mu = mu(( ) )]) ^ 2 $:x ( f fusion: (5.43) mu(( ) ) = mu id : Now suppose that f 2 x $:x .6.
1998
.36) g mu(x ) f id $:' $:' = mu(x ) ' $:' id ( f coherence requirement for binary functors.43).46) we need rst to nd some arrow = id : The calculation of is carried out as follows:
$:x
6. Leibniz g = id f is a binary functor g = id :
^ ^
= id
f
^
^
:
^
:
^
:
^
^
:
^
^
^
^
^
^
^
$:
^
To summarise the latter calculation: ( mu(( ) ) id = mu ]) = id : Now we go back to our main calculation. In order to exploit (6. $:' 2 (x ) (( ) ) g mu(x ) f id $:' $:' = $:' mu(( ) ) id f '2x : computation rule map (5. Leibnitz to remove \ f " g $:' ( mu(( ) ) id = mu ]) = ( mu(x ) f id = mu ]) ( f fusion. = ( = mu ]) aiming for fusion g ( = mu ]) = ( mu = mu ]) f fusion. above g = mu ]) ' ( mu(( ) ) id = f ( mu(x ) f id = mu ]) ( f assumption (6. 2 $: g mu = ^ cod: = $: f = mu(( ) ) (6.46).19d): id = idmu = ( mu = mu ]) .102 We want to show that ' = f ( mu(x ) f id = mu ]) . Leibniz g f $:' = '
^
$:
^
:
^
^
$:x
:
^
^
^
$:
^
:
^
$:x
:
^
^
$:
^
:
^
$:x
:
^
^
$:x
^
$:
^
^
$:x
$:
^
Category Theory
June 12. Fixed Point Calculus
: ^
such that
^
( ( ( (
by (5. ' = f ( mu(x ) f id = mu ]) f ' = ' id .
7. coherence property binary functor g
$
$
Category Theory
June 12. We have to show that there is an initial object in Alg: on the carrier $ . The Diagonal Rule
true :
103
f
assumption: (6.46) g
This concludes the proof of (a) implies (b).2 The Other Half
We now begin the proof that (b) implies (a). 2 f Alg mu$ mu(( $) ) id (mu$) f de nition of an arrow in Alg: g
mu$ mu(( $) ) id
$ $
^
:
^
$
^
^f
2x
f
= mu$ mu(( $) ) id (mu$) inverses.21: mu$ has an inverse denoted by (mu$) 2 $: $ $ g = id (mu$) :
$
(mu$) 2 $ $ $ : Now suppose f 2 x x x . The assumption this time is that the category Alg:$ has initial object mu$ . theorem 5. = mu(( $) ) : g 2 $ (( $) ) $ $ f de nition of $ .7. Then we assume that f is an object of Alg: and construct a unique arrow to f from in the category Alg: . For the rst step we have the following calculation:
^ ^ ^
( ( (
Thus. We rst construct a candidate arrow to $ from $ $ in the base category. 1998
.
2 $ $ $ f mu$ 2 $ $: $ = mu$ g 2 $: $ $ $ f de nition of $ g 2 (( $) ) $ $ f mu(x ) 2 (x ) x (x ) for all x .6. The steps in the proof are the same as in the rst part. We construct an arrow in Alg: to f from mu$ mu(( $) ) id (mu$) as follows.
6.
19b) g 2 x $ ^ mu$ = ( f id = mu(( $) )]) f de nition $ and theorem 5. ( mu = mu(( ) )]) has as carrier. that this also follows from the fact that mu$ mu(( $) ) id (mu$) has $ as carrier) We will now show the construction of the witnesses. This completes the proof that (b) implies (a). So. We assume that mu is an initial object in Alg: . Fixed Point Calculus
2 x $ ^ f ( mu$) = mu$ mu(( $) ) f coherence requirement binary functor g 2x $ ^ f id id ( mu$) = ( mu$) mu(( $) ) f uep: (5. so at the same time we also have proven the uniqueness of this arrow. we have the following two isomorphisms ( mu = mu(( ) )]) = mu$
^ ^ ^ : ^
$
^
^
:
^
mu$ mu(( $) ) id
^ :
$
(mu$) = mu
^
^
:
Furthermore. so we also have an isomorphism in the base category = $ : (Note. by theorem 2.
: :
:^ $
Thus.41 g 2 x $ ^ mu$ = ( f = mu(x )]) $: f uep: (5. 1998
.44) we obtain:
^ ^
$
Category Theory
June 12.47)
We have now reached the last part of the proof. In the previous part we have proven that under these assumptions ( mu = mu(( ) )]) is an initial $algebra and mu$ mu(( $) ) id (mu$) is an initial algebra. (6.19b) g = (( f = mu(x )]) = mu$])
x $ x
:
:
:
:
(( f = mu(x )]) = mu$]) 2 f Alg mu$ mu(( $) ) id (mu$) In the above construction all the steps are equivalences. Substituting mu$ for f in (6.104
6. and that mu$ is an initial object in Alg:$ .6.
we assume that for each element x in C an initial object.6.47) we obtain: (( mu = mu(( ) )]) = mu$]) 2 mu Alg mu$ mu(( $) ) id (mu$) : From the assumed initiality of mu$ in Alg:$ we can conclude that (( mu = mu(( ) )]) = mu$]) 2 ( mu = mu(( ) )]) Alg mu$ : Symmetry suggests that also mu$ ( mu(( $) ) mu$ id = mu ]) 2 mu$ mu(( $) ) id (mu$) Alg mu : Because of the initiality of mu in Alg: and (5. we state the theorem in full. Finally. typing base category trivial g mu$ mu(( $) ) mu$ id = mu$ mu(( $) ) id (mu$) mu$ mu$ f coherence requirements g true : Arrows in an algebra category are also arrows in the base category. exists in Alg:(x ) . substituting mu for f in (6.18) we can verify this as follows: mu$ ( mu(( $) ) mu$ id = mu ]) = ( mu$ mu(( $) ) id (mu$) = mu ]) f fusion. 1998
. then ( mu = mu(( ) )])
^ ^ : ^ : ^
:^ $
2
mu$ ( mu(( $) ) mu$ id = mu ]) Alg mu$ ( mu = mu(( ) )]) :
: ^
:$
^
:
^
^
:
^
:
^
:
^
:$
$:
$
:
^
:^
$
^
^
^
$:
$
:
^
$
:
^
$:
$
$
^
:
^
:
$:
$
:
^
^
^
^
:
^
Category Theory
June 12. The Diagonal Rule
105
$: $
Similarly. mu(x ) . If mu is an initial object in Alg: . Theorem 6. so we can conclude that the arrows ((mu = mu(( ) )]) = mu$]) and mu$ ( mu(( $) ) mu$ id = mu ]) are the witnesses to all three isomorphisms.7.48 (Diagonal Rule) Let C be a category and 2 C C C be a binary functor. Furthermore.
That is. mu$ mu(( $) ) id (mu$) = mu : As a consequence we also have an isomorphism in the base category: = $ .106
^ : ^
6. (x 7! x x) = (x 7! (y 7! x y)) : Speci cs In all three isomorphisms ((mu = mu(( ) )]) = mu$]) is the arrow to from $ and mu$ ( mu(( $) ) mu$ id = mu ]) is its inverse. As we shall see the main tool in this analysis is the diagonal rule. So. Category Theory June 12. be broken down into two functions.e. supposing C and D are categories and F is an endofunctor on the product category C D . What conditions on the existence of least pre x points of endofunctors on C and on D are su cient to guarantee the existence of a least pre x point of the (monotonic endofunction) (x y) 7! (y x x y) ? The answer is given in lemma 6. if mu$ is an initial object in Alg:$ then mu$ mu(( $) ) id (mu$) is an initial object in the category Alg: .) So let us discuss that solution rst. Any endofunction on C D can thus be broken down into two binary functions of types C D C and D C D . For this particular problem being able to determine a solution in lattice theory really pays o . So. Suppose 2 C D C and 2 D C D are monotonic.8 Mutual Recursion
For our last xed point rule we consider the problem of computing initial algebras in a product category. for every initial $algebra mu$ ( mu = mu(( ) )]) = mu$ : Conversely. Then C D is partially ordered by the relation w . Fixed Point Calculus
is an initial object in the category Alg:$ . we determine what information is needed about initial algebras of endofunctors on C and on D in order to be able to compute an initial Falgebra. state our problem in the following way. First two simple lemmas dealing with two special cases of the general problem.). therefore. for every initial algebra mu . 1998
. i. one to C and one to D . We may. of course. lemma 14]. (The proof we give using the diagonal rule appears to be original to the authors and their colleagues in the Eindhoven University Mathematics of Program Construction Group 20. (We will discuss why at the end of the section.50 below. Any function to C D can. The lemma is often attributed to Bekic 3]. Suppose C = (C w) and D = (D ) are partially ordered sets.
$
^
^
^
$
^
^
^
:
^
:
^
$:
$
:
^
2
6.
49 is straightforward: use fusion for the rst (noting that the two projection functions are lower adjoints).
2
The proof of lemma 6.
Proof
= = = = =
((x y) 7! (y x x y)) f diagonal rule. $ g ( (x 7! (u 7! $ :x u)) (y 7! (v 7! $ :y v))) f diagonal rule twice: u = x .25) for the second. i. v = y g ( (x 7! $ :x x) (y 7! $ :y y)) :
: : :
2
With this proof as guide we shall now show how to formulate and prove the theorem in category theory.49(b)) g ( (x 7! $ :($ :x)) (y 7! $ :($ :y))) f de nition $ .50 ((x y) 7! (y x x y)) = ( (x 7! $ :x x) (y 7! $ :y y)) where $ :x = (v ! x v) and $ :y = (u 7! y u) .49(a) and de nition of $ and $ g ((x y) 7! ($ :y $ :x)) f square theorem (speci cally lemma 6. and use the square theorem (theorem 6.6. with x = (x y) and de ned by (u v) (x y) = (y u x v) g ((x y) 7! ((u v) 7! (y u x v))) f lemma 6.
Lemma 6.e. $ :x and $ :y are the least 7
xed points of the individual equations.49
(a) (b)
((x y) 7! (f:x g:y)) = ( f g)
((x y) 7! (f:y g:x)) = ( (f g) (g f)) . 1998
. Category Theory June 12. Mutual Recursion
107
Lemma 6.8.
for all x2C and y2D . with x = (x y) and de ned by (u v) (x y) = (y u x v) = mu((cod: ) ) idcod g is an initial Falgebra ^ F:(x y) is an initial (u v) 7! (y u x v) algebra f lemma 6.25 = $ :( $ $ : = ]) g is an initial $ algebra f $ = (x 7! $ :($ :x) y 7! $ :($ :y)) = ( ") g is an initial x 7! $ :($ :x) algebra ^ " is an initial y 7! $ :($ :y) algebra f de nition $ . $ g is an initial x 7! (u 7! $ :x u) algebra ^ " is an initial y 7! (v 7! $ :y v) algebra f diagonal rule (theorem 6.48. y .49(a) and de nitions of $ and $ g is an initial (x y) 7! ($ :y $ :x) algebra f square theorem: theorem 6.
2
Freyd 10] de nes a category to be algebraically complete if all its endofunctors have initial algebras. v = y = ( u 7! $ :(cod: ) u = mu(u 7! $ :(cod: ) u)]) " = ( v 7! $ :(cod: ) v = mu(v 7! $ :(cod: ) v)])
:
: 2
:
2
2
:
:
:
:
^
is an initial x 7! $ :x x algebra is an initial y ! $ :y y algebra : 7
g
Theorem 6. Then the functor F de ned by F:(x y) = (y x x y) has an initial algebra.48) twice: u = x .108
6.51 (Mutual recursion) Let 2 C D C and 2 D C D be binary functors such that. x . 1998
. $ _ IdC and $ _ IdD have initial algebras. Fixed Point Calculus
(
( (
(
is an initial ((x y) 7! (y x x y)) algebra f diagonal rule: theorem 6. Relaxing the conditions on existence of initial algebras in theorem 6. Category Theory June 12.51 we obtain the following corollary due to Freyd.
Mutual Recursion
109 The product of two algebraically com
Corollary 6.8. 1998
.6.52 (Algebraic Completeness)
plete categories is algebraically complete.
2
Category Theory
June 12.
1998
. Fixed Point Calculus
Category Theory
June 12.110
6.
The closest to the usual de nition of a monad is a re exive. f :? is the least pre x point of f: The ? proof is a good example of the use of Galois connections. There are several equivalent de nitions of a closure operator. Remark It is a short step from the above argument to the wellknown KnasterTarski theorem that every monotonic function on a complete lattice has a least xed point: it su ces to note that a least pre x point of a monotonic function is a xed point of the function. monotonic endofunction on a partially ordered set. Consider Pre:f . So it su ces to observe that a xed point is a point that is simultaneously a pre x point and a post x point and a monotonic function maps its pre x points to pre x points (i.e. the function embedding Pre:f in the base lattice distributes universally over in ma. i. Moreover. Finally.1 Introduction
In this chapter we generalise the basic theory of closure operators in lattice theory to monads in category theory. 1998
. Given a monotonic endofunction f on a complete lattice there is a unique minimal closure operator f that is at least f . It is also a short step to Tarski's theorem that the xed points of a monotonic function on a complete lattice form a complete lattice: We have shown that the pre x points form a complete lattice. End of Remark We use the notation f for the least closure operator above f because the operation of mapping f to f has several properties in common with the Kleene star in the theory of regular languages.e. the set of pre x points of f . since adjoint functions preserve limits the lower adjoint applied to the least element of the base set is the least pre x point of f .Chapter 7 Monads
7. Dually the post x points also form a complete lattice. idempotent. Observe that the in mum in the base set of a subset of Pre:f is a pre x point of f: Thus Pre:f is a complete lattice and. and the composition of the embedding function after the lower adjoint is a closure operator. (It is just the identity function!) It thus has a lower adjoint. monotonic function f is an endofunction on Pre:f ). More substantial examples are that f is
? ? ? ? ? ?
Category Theory
111
June 12. the identity function). An elementary example is that f is above all powers of f (including the zeroth power. in particular.
2) mul F mul = mul mul F and (7.3) guarantee the \coherence" of all such constructions in the sense that any two ways of constructing one such transformation give rise to equal transformations.112
7. Starting from the natural transformations unit 2 F id and mul 2 F F F together with the identity transformations F id 2 F F and id F 2 F F it is straightforward to construct natural transformations 2 F F for all i 0 (where F denotes the i fold composition of F with itself). Indeed.5.1 A monad in a category C consists of an endofunctor F on C and two natural transformations unit 2 F id and mul 2 F F F such that (7. Theorem 7.2 Monads and Adjunctions
A closure operator is a function from a preorder to a preorder that is monotonic. A monad is a \coherently constructive" closure operator. The two terms of (7. Monads
the least pre x point of the function F mapping function g to Id t f g (where Id is the identity function) and the star decomposition rule (ftg) = g (f g ) : In this chapter we begin from the (generalisation of the) premise that the function embedding Pre:f in the base set has a lower adjoint. 1998
. each can be constructed in an unbounded number of ways.2) correspond to the most elementary constructions of natural transformations to F from F as shown in the following diagram.15 generalises the construction of a least pre x point. The monad decomposition rule generalising the star decomposition rule is proved in section 7.2) and (7.
i i i 0 3
2
F
mul
"
mul
FF
"
F mul
F F mul F F F F
Category Theory June 12. unit is called the unit of the monad mul is called the multiplication of the monad. De nition 7.
? ? ? ? ?
7. The two requirements (7. It is also common to refer to the functor F as \a monad" although strictly it is but one component of a monad. and theorem 7.19 the fact that f is itself a least pre x point.3) mul F unit = F id = mul unit F = id F : As suggested by the notation. re exive and idempotent. with the exception of .
3) is obtained by applying theorem 4.3. (The second and fourth terms are of course always equal. For the moment that is unnecessary we will make the dependency explicit when it does become so. The lower and upper adjungates of this adjunction will be denoted by b c and d e respectively. Let U denote the functor in C Alg:F de ned by U: = cod: and U:' = ' . : : : to denote arrows of C that are not necessarily arrows of Alg:F . Suppose U has a lower adjoint denoted by U . The lower and upper adjungates of the assumed adjunction must.)
2
7. Note that U is dependent on F although the notation does not make the dependency explicit. with the assumption that an adjunction exists between a category of algebras and a base category. for all i . Assuming a complete lattice.25 in combination with Godement's laws. therefore.4 Suppose (F 2C D G 2D C ) is an adjunction. A standard theorem in lattice theory is that the composition of the lower adjoint of a Galois connection after the upper adjoint is a closure operator. The key theorem in this argument states that a function with domain a complete lattice that distributes universally over all in ma in the lattice has a lower adjoint. known as Freyd's adjoint functor theorem 15. is left to the reader. and f applied to the bottom element of the lattice is the least pre x point (and thus least xed point) of f . Theorem 7. : : : to denote objects of C and f .2) is a straightforward application of Godement's interchange law (2. Let unit 2 G F id be its unit and counit 2 id F G its counit. (Veri cation of the coherence property (7. The corresponding theorem in category theory is also standard 15].19). involves conditions that we do not want go into. Basic Adjunction
1
113
The four terms in (7. the embedding of the pre x points of monotonic endofunction f in the lattice has as lower adjoint f . g . (Note that both objects and arrows of Alg:F are also arrows of the category C . and (7. This functor is called a forgetful functor: it forgets about the structure of an algebra by mapping it to its carrier.4 are left to the reader. The corresponding theorem in category theory. (7. 11]. y . We introduce a special notation for the composition of U and U : let F denote U U .) The inductive proof that these two properties are su cient to guarantee uniqueness of . .3 Basic Adjunction
Recall our (sketched) proof of the KnasterTarski theorem. : : : to denote objects of Alg:F and ' . 1998
.5) b'c 2 cod: C x ' 2 Alg U :x
? ? ?
:F x
Category Theory
June 12. We begin this section. Let F denote an endofunctor on the category C . : : : to denote arrows of Alg:F . We use .
i
The details of the proof of theorem 7. satisfy the following 6 rules. Then the triple consisting of G F . by de nition. . the least closure operator above f .7. unit and G counit F is a monad on C .) We use x .3) correspond to the most elementary constructions of natural transformations to F from F ( = F ).
F is (the functorpart of)
a monad with as its unit.7) db'c e (7. (7.13) d eU = idU
:x
:
Lemma 7. With the above we can easily derive the following computation rules. Monads
2
x x
Alg:F
U :x
f 2 cod:
Alg:F
C
x
(7. June 12.114 (7.10) Let
C
y :
denote bidU cU
?
. From (7. from (7.12)
x x
Also. by theorem 7.8).
( f 2 cod:
x
C
x : f 2 cod:
C
F:dfe = dfe
x x :x x
U :x
(
x :
From (7. from (7. cod:(U :x) = U:(U :x) = F :x .) Note.
? ?
2 F :x C x : (Recall. 1998
Proof
Category Theory
. Then.9)
( (
x x
b'c g = b ' U :gc 2 Alg ^ ' 2 Alg U :x ^ g 2 x dfe U :g = d f ge 2 Alg ^ f 2 cod: C x ^ g 2 x
x y :F :x :x x
C
y
(7.9).6) and the de nition of an arrow in Alg:F . (7.8) bdfe c
x
x
( '2 = f ( f 2 cod:
='
x :F
U :x
C
x
y :F
(7.14 U 2F FF where 2 U F U is de ned by
? ?
= .5).7).4. from (7.
x
=b c =f
x
(
2
Alg:F
U :x :
In particular.11) dfe (7.6) dfe
x
7.6) and (7.
given ? ? ? catamorphisms for the base category C .16) ( Alg:F ( Alg:F
? ? = muF]) = d( C cod: = ? ])e ? : b
: :
Note that the initiality of U :? in Alg:F immediately gives the catamorphism fusion rule: ? = muF]) = ( Alg:F
: : :
= muF])
:
(
2
Alg:F
:
Also.12) gives the computation rule: ? ?
F:(Alg:F
Category Theory
= muF]) = ( Alg:F
:
= muF]) muF :
:
June 12. Basic Adjunction
115
? ?
(
2F FF f F =UU g U 2UU FUU f U is a functor g 2U FU f natural transformation g 8( 2Alg:F 2 U: F:(U: )) ^ 8(' ' 2 Alg U:' = F:(U:')) f de nition U g 8( 2Alg:F 2 cod: F:(cod: )) ^ 8(' ' 2 Alg ' = F:') f = .15
2
U :? is an initial F algebra with F? :? as its carrier. this de nes catamorphisms for the category Alg:F : letting muF denote U :? we de ne ?
:
(7. 1998
. I. de nition of an arrow in Alg:F g true :
U
?
: :
:F
:
:
:
:
:F
:
:
2
Let ? denote an initial object in category C .7. ?
U :? ?
2 F :? F:(F :? ) : ? ?
? ?
Moreover. since lower adjoints map an initial object to an initial object we immediately have the following theorem. ? ?
From the proof that lower adjoints preserve initial objects we see that the unique arrow in Alg:F to an object from U :? is given by d( C cod: = ? ])e ? .3. instantiating f x = ( C cod: = ? ]) ? in (7.
Theorem 7.e. Then.
116
7. Suppose 2 cod: End C G . ' 2 Alg ( ) f de nition g End C ' 2 cod: cod: ^ F ' = ' f de nition nat. 1998
.17 The adjunction (U U) between C and Alg:F induces an adjunction between End:C and Alg:(F ) .. de nition F algebra g 8(x ' 2 Alg ) ^ 8(f f 2 x C y (cod: ):f ' = ' (cod: ):f) :
: F :
::
::
: F
:
::
x
x
x
x
x
:
:
y
x
x
:F
::
x
x
x
:
:
y
x
Our proof obligations are: construct lower and upper adjungates and prove that they satisfy certain coherence requirements. Let 2Alg:(F ) and G2End:C . with dummy ranging over Alg:(F ) and dummy G ranging over End:C . pointwise and some rearrangement g 8(x ' 2 (cod: ):x C (cod: ):x ^ F:' = ' ) ^ 8(f f 2 x C y (cod: ):f ' = ' (cod: ):f) f (cod: ):x = cod: . we have: Alg ( ) G U G] = G cod: End C G] : Proof First. Adopting this strategy we are lead to the following lemma:
?
Lemma 7. F :G:f = U:U :G:f = U :G:f .
:
(
U G f above. fusion rules g 8(x 2 cod: C G:x) ^ 8(f f 2 x C y (cod: ):f = G:f)
:
:
f
y
x
x
x
G:x
?
::
x
x
:
:
y
x
Category Theory
June 12. Monads
7. Let 2 Alg:(F ) then. Speci cally. trans.4 Lifted Adjunction
In lattice theory a useful technique in the study of F is to \lift" the Galois connection between the base set and Pre:F to a Galois connection between the monotonic endofunctions on the base set and Pre:(F ) . By construction of ' we derive a candidate for the upper adjungate. U G 2 F? G F F? G g 8(x ' 2 Alg U :G:x) ^ 8(f f 2 x C y (cod: ):f ' = ' F?:G:f)
)
:F
'2
Alg:(F
::
x
x
assumption: ' = d e x . note the following calculation.
We have to construct a unique arrow in Alg:F to from 5( U ) G .
?
:
+
?
Proof First. Furthermore. 1998
. 5( U ) G is an F algebra with F G as carrier.4. Then. Suppose 2Alg:F . 5( U ) G is initial in Alg:F with F G as carrier. In terms of this newly established adjunction we can reexpress as:
x :x :x x
U = cod:
End:C
Id
(7.
Alg:(F
)
with d e Id as witness from right to left and b c Id as its inverse.19 De ne the functor F 2 End:C End:C by F :H = G (F H) . 5( U ) G 2 F G End C Id (F F ) G : Since Id (F F ) G = G (F F G) . we had previously de ned by bidU cU .
G
x
x
G:x
2
Thus as a result we have the following family of isomorphisms: for each 2Alg:(F ) . Lifted Adjunction
117
= : So the upper adjungate d e is de ned by (d e ) = d e x . Theorem 7. Suppose ' 2 Alg ( ) U G . U G 2 F G F F G g =' : So the lower adjungate b c is de ned by (b 'c ) = b' c x . fusion rules. U :G:f = U:U :G:f = F :G:f g 8(x 2 Alg U :G:x) ^ 8(f f 2 x C y (cod: ):f = F :G:f) ( f above.
x x G x x G:x : F
(
f
2 cod:
End:C
G g
2 cod: End C G f natural transformation g 8(x 2 cod: C G:x) ^ 8(f f 2 x C y (cod: ):f = G:f) ( f assumption: = b c x . The coherence require:
::
x
x
:
:
y
x
x
x
G:x
?
:F
::
x
x
:
:
y
x
?
?
?
x
x
ments follow immediately by the pointwise de nition of the adjungates. 2 F End C Id and U 2 F End C F F : Thus.18) = b id U c U Id (2 F End C Id) : We are now ready for the theorem that justi es our \Kleene star" notation. by de nition of addition.7.
?
:
?
:
?
?
:
+
?
+
?
+
?
?
Category Theory
June 12. By construction of we derive a candidate for the lower adjungate.
20) (f g) = g (f g ) where f denotes the least closure operator above f and denotes the binary supremum operator lifted pointwise to functions. fusion g Alg ( ) U G ^ (inl G) = b 'c inr ' 2 inr f lemma 7.5 Decomposition Theorem
In this section we prove the categorical generalisation of the theorem that (7. A proof in lattice theory is a straightforward calculation:
+
?
?
? ?
?
+
(f g) = g (f g ) f de nition of g (h 7! id (f g h)) = g (h 7! id (f g h)) f diagonal rule: id (f g h) = (id (f h)) (g h) rolling rule g (h 7! (j 7! (id (f h)) (g j))) = (h 7! g id (f h)) f de nition of g (h 7! g id (f h)) = (h 7! g id (f h))
+
?
?
? ?
?
+
+
?
+
?
+
+
+
+
+
+
?
+
?
?
+
?
+
Category Theory
June 12.
'2
Alg:F
f
5(
U) G
?
:
+
+
:
?
+
:
?
?
: F
: F
G
G
2
7.computation rules g f ' 2 cod: End C F G ^ (inl G) = ' ^ inr (F ') = ' ( U G) f de nition arrow in Alg:(F ) .118
7. inverse g ' = d (inl G)e inr : In the above proof all the steps are equivalences so we have at the same time also proven uniqueness. Monads
de nition arrow in Alg:F g ' 2 cod: End C F G ^ (Id G) (F ') = ' ( 5( U ) G) f = (inl )5(inr ) g ' 2 cod: End C F G ^ (inl G)5(inr F ') = ' ( 5( U ) G) 5 / .17. F = U U = cod:( U ) g ' 2 inr Alg ( ) U G ^ (inl G) = ' f = b id U c U Id . 1998
.
we shall use U to denote the forgetful functor from Alg:F into the base category C . Decomposition Theorem
119
true : The categorical theorem we want to prove is that. the functor H 7! G? Id (F H) has ini5( tial algebra (U ) ) with carrier (F G)? . Similarly. once in a \wordy" style and once in a calculational style.19. There is thus an initial object in Alg:$ with carrier (F G)? . G? Id (F H) is the carrier of the initial algebra 5( (U ) ) Id (F H) and thus. we use and for the unit of the monad F? and the natural transformation to U from F U . (A detail in the application of the diagonal rule is that H is isomorphic to Id (F G H) . respectively. by theorem 7.5. Thus.7. Combining this with the rst ob5( 5( (U ) ) and (U ) ) are isomorphic. that (U ) ) is an initial object of Alg:$ . for functors F and G . First.) Fourth. we note that. Third.48). G? Second.19 we need to di erentiate between forgetful functors: in general. We present the proof twice. de ning the binary functor by H J = (Id (F H)) (G J) and the map functor $ as in theorem 5.19. the functor (G?) maps an initial object of Alg:(H 7! Id (F G? H)) to an initial object of Alg:(H 7! G? Id (F H)) . 5( (U ) ) is an initial H 7! G? Id (F H)algebra. an initial H 7! G? Id (F H)
+
F F F F F
f
re exivity
g
+
+
F
G?
F
G?
F
G?
+
G
G
G
+
+
+
+
+
+
F+G
F+G
F+ G
+
^
+
+
+
+
+
+
G
G
G
+
+
+
F+G
F+ G
F+G
+
F
G?
F
G?
F
G?
F+G
F+G
F+G
+
+
F G?
F G?
F G?
F+G
F+G
F+G
F+G
F+G
F+G
+
+
F G?
F G?
F G?
+
+
+
Category Theory
June 12.33. G? ? ? ? rst has carrier G (F G ) and the second (F G)? these two functors are also isomorphic. This follows from the associativity of and the de nition of (the lifting of de nition of to) F G . by theorem 7. The reader may choose which is most appealing. by the rolling rule. $ :H equals G? Id (F H) (for all functors H ). The \wordy" proof has ve steps. Since the servation.19 that 5( (U ) ) Id (F H) is an initial object of the functor mapping J to (Id (F H)) (G J) with the functor G? Id (F H) as carrier. observe by theorem 7. we note. The proof has the same ingredients as the lattice theoretic proof. 1998
. by applying the diagonal rule 5( (theorem 6. Combining the third and fourth observations. The calculational proof also has ve steps: G? (F G? )? = (F G)? ( f taking carriers preserves isomorphism g 5( 5( (U ) ) G? (U ) ) = 5( ( f (U ) ) is an initial H 7! Id (F G H) algebra g 5( G? (U ) ) is an initial H 7! Id (F G H) algebra ( f by the diagonal rule. the monad (F G)? is isomorphic to the monad G? (F G? )? . by de nition of the map functor $ on objects. In order to apply theorem 7.
1998
.19 g true :
+ +
7. Monads
?
F G? F G? F G?
(
?
+
F G?
F G?
F G?
+
?
Category Theory
June 12.120 algebra is an initial H 7! Id (F G H) algebra g 5( G (U ) ) is an initial H 7! G Id (F H) algebra f rolling rule g 5( (U ) ) is an initial H 7! Id (F G H) algebra f theorem 7.
the de nition of a product can be given as an instance of a limit. Sum is frequently introduced as an instance of a socalled colimit. this would involve giving full explanation of what a colimit is { a colimit corresponds in lattice theory to a supremum { and this is something we wish to avoid here.
8. However. De nition 8. Before we can start with these proofs we rst have to give categorical de nitions corresponding to the basic elements of regular algebra and give some elementary properties.Chapter 8 Applications to Lists
In this chapter we use the categorical xed point theorems of the previous chapter to prove isomorphisms between certain list structures and simultaneously construct its witnesses.1 (Sum) A sum (or coproduct) of two objects x and y is an object x y .1 Preliminaries
**** Needs to be revised to exploit previous material on limits and in particular parameterised limit theorem. together with two projections exl 2 x x y and exr 2 y x y such that for any object z and pair of arrows f 2 x z and g 2 y z there is a unique arrow h 2 x y z such that (omitting the subscripts) exl h = f ^ exr h = g :
x y x y
Category Theory
121
June 12. The isomorphisms we are going to prove correspond to wellknown properties of the regular algebra.2 (Product)
A product of two objects x and y is an object x y . Similarly. together with two injections inl 2 x y x and inr 2 x y y such that for any object z and pair of arrows f 2 z x and g 2 z y there is a unique arrow h 2 z x y such that (omitting the subscripts) h inl = f ^ h inr = g :
+
x y
+
x y
+
+
2
De nition 8. 1998
. ***** We begin by giving the de nition of a sum and a product of two objects.
Note. Let a . an expression
De nition 8.e. i. A product of two objects in a category is a sum of the two objects in the opposite category. b and c a (b c) = (a b) (a c) (a b) c = (a c) (b c) a =
+ + + +
and
a=
is called a distributive category.
+ + +
. Applications to Lists
Sums and products are unique up to isomorphism.122
8. 1998
. b and c be objects.3 (Distributive Category ) A category which has an initial object and a terminal object 1 . that these isomorphisms hold for all categories in this chapter. As a result product and sum have similar properties. We assume all categories in this chapter to be distributive categories. in which product and sums of pairs of objects exist. and which 1 satis es the following isomorphisms: for all objects a . then:
lunit
a
21 a=a 1 2a 1 =a 1
a b c
runit
a
sumass
2 (a b) c = a (b c)
+ + + +
Category Theory
June 12. Without proof we state the following isomorphisms: (a b) c = a (b c)
+ + + +
2
and (a b) c = a (b c) : In expressions we will assume that has a lower precedence than like a b c must be parsed as (a b) c . Having the terminal object 1 we can derive the following isomorphisms 1
2
1 a = a and a 1 = a : 1 1
We repeat the isomorphisms we have so far introduced and furthermore give speci c names for the corresponding witnesses.
Taking inl 2 F _ G F to be (inl ) = inl and inr similarly. so we can extend the de nition of sum to a binary functor +. that maps two objects x and y to the object x y . Fun is also a distributive category where for instance sumass 2 (F _ G) _ H = F _ (G _ H) is given by (sumass ) = sumass :
+ + + + +
F G
+
F G
x
F:x G:x
F G
+
F G
F G
+
+
x
x+
x
F G H
+
+
+
+
F G H
x
F:x G:x H:x
What we frequently need in the forthcoming proofs are isomorphisms like: b 7! (a b) c = b 7! a (b c) : Thus. The constructor _ can be turned into a binary functor on Fun by de ning ( _ ) = : Similarly _ can be de ned such that it is a binary product functor on Fun . The sum in the category Fun is related to the sum in the base categories as follows.
x y
+
x y
+
+
+
+
With Fun we will denote the category of all functors between the distributive categories under consideration. Let F and G be two functors with the same domain and codomain.
In a distributive category sums of all objects exist.1. we want to be able to abstract from one of the arguments in the isomorphisms for sum and product as listed before.8. then we de ne F _ G by (F _ G):x = F:x G:x for x an object or an arrow. Then F _ G is a functor. Finally. For arrows we argue as follows. the triple ( F _ G inl inr ) is a sum of F and G in the category Fun . Suppose a is an object we let K:a denote
+ + + +
Category Theory
June 12. Similarly. we can de ne the binary functor . suppose f 2 x u and g 2 y v then we have two arrows inl f 2 x y u and inr g 2 x y v so there is a unique arrow to x y from u v: We will denote this arrow by f g . Assume is a xed sum functor on the base categories. With the remarks made above about isomorphisms in the functor category we can argue as follows. 1998
. These distributive categories will be referred to as the base categories. Preliminaries
proass rdist ldist
a b c
123
2 (a b) c = a (b c)
+ +
a b c
2 (a b) c = (a c) (b c) 2 a (b c) = (a b) (a c) :
+ +
a b c
In all cases if
is a witness to an isomorphism then we will denote its inverse by
+
.
We leave it to the reader to verify that also K is a functor. we assume the functor is de ned by: let a be an object
a = (y 7! 1 (a y)) : 1
+
In contrast to normal functor applications we will skip the dot when the functor is applied to an object.
+
2
Lists can be de ned in various (isomorphic) ways. Note. G and H be functors and let a . Thus. The result is a functor x for some binary functor . we denote the isomorphism b 7! (a b) b = b 7! a (b b) . i. G and H
a c
+
+
+
+
a
+
+
+
+
:
F sumass
a
(G H) 2 b 7! F:((a G:b) H:b) = b 7! F:(a (G:b H:b)) :
+ + + +
De nition 8.
We assume all categories in this section to be cartesian closed. both have an upper adjoints.4 (Cartesian Closed Category ) A category is cartesian closed if for all objects y the functors y and y . Category Theory June 12. With these de nitions we can make calculations similar to the one below: let F . In this chapter we will frequently construct binary functors using the functors and and then x one of the arguments.e. b and c denote objects: (F _ G) _ H = F _ (G _ H) ) f instantiate F G H = K:a Id K:c g (K:a _ Id) _ K:c = K:a _ (Id _ K:c) f de nition _ g b 7! ((K:a):b Id:b) (K:c):b = b 7! (K:a):b (Id:b (K:c):b) f de nition K:a and Id g b 7! (a b) c = b 7! a (b c) :
x
+
+
+
+
:
+
+
+
+
+
+
+
+
+
+
+
+
+
We let sumass denote the isomorphism b 7! (a b) c = b 7! a (b c) . In the examples that follow we use \cons" lists. the functors obtained by xing in turn the arguments of the binary functor to y . let x be an object then (K:a):x = a and let f be an arrow then (K:a):f = id . i.4. that is a functor follows immediately from the fact that is a map operator as de ned in section 5. Applications to Lists
the constant functor on a . 1998
.e. Recalling the let sumass Godement notation: for three functors F . we can talk about the codomain of an initial x algebra denoted by (x ) . We assume that all these functors have an initial algebra.124
a
8. Now we can extend the de nition of K to arrows: on arrows f we de ne K:f to be a natural transformation by letting K:f equal f for all objects x in the category. That is. Similarly.
5) F = _F : =
+ + + + + + +
F
f
We recall from the previous chapter that for the functors F . we now de ne the functor _ on objects F by (G 7! K:1 _ F _ G) then we can write 1 (8.9) exch
F G H
:mirror 2 (F G) = (F H)
June 12. With the abstraction theorem for algebras we have proven that $ F is the carrier of a particular initial F _ algebra. We want to have a similar result for . G and H all of appropriate type we have the following isomorphisms (8.8) diag 2 (x ! (y ! x y)) = (x 7! x x) 7 7
(8. Preliminaries
+ +
125
We have seen that we could `lift' the binary sum and product functor and de ned on base categories to a binary sum and product functor _ and _ de ned on a functor category.6) roll 2 F: (G F) = (F G)
F G
:swap 2 F: G = H where swap 2 F G = H F and F has an upper adjoint. extensionality g 1 (G 7! K:1 _ F _ G) : 1 If.8.e.1. (8. (a 7! (F:a ) =)$ F = (F _ ) : With the de nition of and the remarks made about abstraction we can make the following calculation: de nition g (a 7! (y 7! 1 (a y))) F 1 = f composition g a 7! (y 7! 1 F:a y) 1 = f heading for abstraction de ne a y = 1 F:a y g 1 a 7! (a ) = f abstraction theorem g (G 7! Id _ G) = f (Id _ G):x = x G:x = 1 (F:x G:x) 1 = (K:1 _ F _ G):x . 1998
Category Theory
.7) fuse
F G H
(8. Thus we may choose mu(F _ ) to have $ F as carrier i.
fuse:swap 2 G = H :
In this chapter we employ a notation whereby the witnesses to isomorphisms are included in the hints marked by a bullet (\ "). The rst example is chosen for its simplicity. where F G H = b (y ! 1 a y) (y ! b a y) g 7 1 7 2 y ! (1 a y) b = y ! b a (y b) 7 1 7 g ( f above isomorphisms.
8. Applications to Lists
where both G and H have an upper adjoint and mirror 2 H F G = G F H . fusion (8. 1998
. The functors G and H can be inferred from the typing of the natural isomorphism swap .10 (List Fusion) a b = (y 7! b a y) : Proof We construct a witness as follows 2 a b = (y ! b a y) 7 f de nition of g 2 (y ! 1 a y) b = (y 7! b a y) 7 1 ( f b is a lower adjoint for all b .126
8. i. = rdist (a )
+ + + +
F G H
:
+
+
+
+
1 1
b
Category Theory
June 12. we prove isomorphisms between certain list structures and simultaneously construct its witnesses.7) we get ( Id has an upper adjoint):
:
:swap 2 G = H where swap 2 G = H . Speci cally a proof step of the form =
F G
f
hint.e. Again the inverse of a witness will be denoted by .
Theorem 8.
g
is short for
2 F = G ( hint . so in the case that F equals the identity functor we will not
fuseId
G H
explicitly mention the functors anymore.2 Theorems
In this section. If we instantiate F = Id in (8.7) = fuse : .
Construct in addition the inverse of the program. An instance is the socalled \linesunlines" problem: given a sequence of two types of characters. delimiters and nondelimiters. theorem 7. and its practical relevance.
a b
listfuse
a b
2 a b = (y 7! b a y) :
+
The next example has been chosen for its relative di culty. 1
fuse
F G H 1 1 b b
+
a
b
+
:
+
+
Corollary 8. 1998
.12 (List Decomposition) a (b a) = (b a) : Proof a (b a) = f de nition of g a (y ! 1 (b a) y) 7 1
+ +
Category Theory
June 12.
Theorem 8. Theorems
127
+ +
(
2 y 7! (1 b) (a y) b = y 7! b a (y b) 1 f de nition _ g 2 (y ! 1 b) _ (y 7! (a y) b) = (y7!b) _ (y 7! a (y b)) 7 1 f de nition _ g = K:(lunit ) _ proass :
+ + + +
b
+
a
b
We have thus constructed
2
:(rdist (a ) (K:(lunit ) _ proass )) 2 a b = (y 7! b a y) where F G H = b (y 7! 1 a y) (y 7! b a y) .11 (a ) = ( a) Proof Straightforward combination of the abstraction theorem.10.
2
so
In the remainder of this section we will denote the witness to list fusion by listfuse . the problem boils down to showing that the star decomposition theorem of regular languages is constructively valid. write a program to divide the sequence into (possibly empty) \lines" of nondelimiters separated by single delimiters. Expressed as an isomorphism between datatypes.8.19 and theo?
rem 8.2.
id fuse:((1 ) (proass 1 a (y 7! 1 b ( a y)) 1 f rolling rule. We can use abstraction to lift the above isomorphism to the level of functors. Exl :(a b) = a and Exr :(a b) = b g a b 7! (Exl :(a b)) (Exr :(a b) (Exl :(a b))) = f abstraction g ( Exl ) _ ( (Exr _ ( Exl )))
a b
Category Theory
June 12.11. fuse:((listfuse ) F) g = (y 7! (z 7! (1 b y) a z)) 1 f diagonal rule. roll = we let F denote y 7! 1 b y g 1 (y 7! a (1 b y)) 1 f fusion rule. This instructive exercise is left to the reader. diag where y z = (1 b y) a z g 1 = (y 7! (1 b y) a y) 1 f fusion rule. a b 7! a (b a) = f Introducing the functors Exl and Exr . fuse:((sumass ) (b a ) (1 ) (rdist )) g 1 = (y 7! 1 (b a) y) 1 = f de nition of g (b a) : We conclude that.128 =
8. id fuse:((1 ) (proass 1 ))
f
a
+
b
a
+
a
F
+
+
a
+
+
+
+
+
+
1 1
+
b a
+
+
+
a
+
b
a
a ) ((1 ) (rdist ))) 1 2 a (b a) = (b a) : where F = y 7! 1 b y and y z = (1 b y) a z : 1 1 2
1 1
roll fuse:((listfuse ) F) diag fuse:((sumass ) (b
a F a
+
b a
+
+
+
+
(An alternative \higher level" proof is to use the monad decomposition theorem together with corollary 8. Applications to Lists
)) g Godement's rules.) Suppose we denote the above witness by decomp . 1998
.
1998
. De ne the object part of the functor F by F = a 7! (F a ) : Suppose we have two natural isomorphisms ass 2 (a b) c = a (b c) and leapF 2 F:(a b) a = a F:(b a) : Then a F:(b a) = F:(a b) a Proof We start with the left hand side: a F:(b a) = f de nition of F g a (y 7! F:((b a) y)) f id fuse:(F ass ) g = a (y 7! F:(b (a y))) f roll g = (y 7! a F:(b y)) :
+ : + : + : ^ ^
a b c a b
g
^
^
^
^
a
b a
a
F b
Category Theory
June 12.8.12 =
decompExl Exr
+
129
f
_ (Exr _ Exl ) = f abstraction g a b 7! (b a) : If full details of the de nition of decompExl Exr are required then we would have to instantiate the above witness in the following way: a b = Exl Exr = _ _ _ and 1 = K:1 : 1 1 Theorem 8.5) g _ Exl _ _ (Exr _ _ Exl ) f theorem 8. Theorems = abstraction: (8.13 (Leapfrog Preservation) Suppose F is a functor and is a binary functor such that a is a lower adjoint for every object a .2.
Applications to Lists
(
=
( ( (
2 a F:(b a) = F:(a b) a f above calculation = id fuse:(F ass ) roll g 2 (y ! a F:(b y)) = F:(a b) a 7 f de nition of F g 2 (y ! a F:(b y)) = (y ! F:((a b) y)) a 7 7 f a is a lower adjoint. assumption g = (leapF ) (b ) :
^ ^
a b a a F b
^
^
a G H
:
a b
b
a
a
We conclude that
2 a F:(b a) = F:(a b) a : where G H = (y 7! F:((a b) y)) (y ! a F:(b y)) : 7
^ ^
id fuse:(F ass ) roll (fuse :((( a) F ass ) (leapF ) (b ) ((a ) F ass
a b a a F b a G H a b a
b
a
)))
2
:
Corollary 8. 1998
Category Theory
.14 (List Leapfrog) a (b a) = (a b) a : Proof Instantiate in theorem 8.130 Thus. = (fuse :) 7 where G H = y ! F:((a b) y) y ! a F:(b y) g 7 2 y ! F:((a b) y) a = y ! a F:(b (y a)) 7 7 f = (( a) F ass ) ((a ) F ass ) g 2 y ! F:(a (b y)) a = y ! a F:((b y) a) 7 7 f Godement's rules.
8.13: F =1 1
: + :
=
:
and
leapF
a b
= rdist
1 a 1
b a
(lunit runit ) proass
a a
+
a b a
ldist
a 1 b 1
a
:
June 12.
2.
(
2F = F f above g 2 ((F ) (Id _ )) = ((F ) ( _ Id)) f exchange rule.15
isomorphism
leapF
^
a b
Suppose Id _ and _ Id are lower adjoints and we have the following
2 F:(a b) a = a F:(b a) : De ne the map functors F and F by F = a 7! (F a )
^
and
Then
F = a 7! (F a) : F=F :
^
Proof We rst use the abstraction theorem: F = f de nition g a ! (F a ) 7 = f de ne a y = F:(a y) g a ! (a ) 7 = f abstraction g
^
=
((Id _ ):G):x = x G:x = F:(x G:x) = (((F ) (Id _ )):G):x g ((F ) (Id _ )) :
(Id _ )
f
Thus. 1998
. Id _ and _ Id are lower adjoints
^
Category Theory
June 12.8. Theorems To these must be added the substitution ass = proass :
:
131
2
Theorem 8.
1998
.15: F =1 1
: + :
= = rdist (lunit runit ) proass
a a
and
leapF
a b
:
1 a 1
b a
+
a b a
ldist
a 1 b 1
a
:
2
Category Theory
June 12.16 (Cons.
exch
F
Id _ _ Id
:(leapFId ) 2 F = F :
^
2
Corollary 8.132 = exch Id _ _ Id : g 2 ( _ Id) (F ) (Id _ ) = (Id _ ) (F ) ( _ Id) f assumption g = leapFId :
F
8. Applications to Lists
Thus. Snoc List Isomorphism) De ning \cons" lists by the equation
Clist = a 7! (y 7! 1 a y) 1
+ +
and \snoc" lists by the equation Slist = a 7! (y 7! 1 y a) 1 we have
Clist = Slist :
Proof Instantiate in theorem 8.
1990. Law and Order in Algorithmics. Formal Aspects of Computing. Investigations into logical deduction. Providence. 1967. September 1992. The Collected Papers of Gerhard Gentzen. Category Theory 133 June 12.tue.C. Category Theory. Calculate categorically! Formal Aspects of Computing. A. Introduction to Lattices and Order. 3rd edition. Introduction to the Galois Correspondence. 7] Maureen H. Dijkstra and C. Doityourself type theory. Lattice Theory. 12] G.Bibliography
1] C. Backhouse.E. Rosolini A. Programming Languages and Their De nition. 1984. pages 95{104. Birkhauser Boston. NorthHolland. NorthHolland. Backhouse. Universiteit Twente. In G. Voermans. Cambridge University Press.W. Gentzen. 1992. M. A. 8] Maarten M.win. volume 25 of American Mathematical Society Colloquium Publications. Carboni. Malcolm. editor.S. Proceedings. Saaman. Algebraically complete categories. R. 6] E.C. editor. Available via WorldWide Web at http://www. 9] Maarten M. T. pages 68{213. Hoogendijk. 1989. SpringerVerlag. G. 1990. 5] B. Szabo. Priestley.J. Fenrick. 11] P. 2] R. Selected papers edited by C. 4] Garrett Birkho . Davey and H. volume 1488 of Lecture Notes in Mathematics. Categories.S. Fokkinga. Aarts. Jones. and J. P. The Netherlands. Bekic. 1998
.nl/cs/wp/papers. 1:19{84. volume 177 of LNCS. 1969. Fokkinga. PhD thesis. Como 1990. Freyd and A. Berlin. 1992.C. Cambridge Mathematical Textbooks.J. SpringerVerlag. van der Woude. 10] Peter Freyd. 1990. 1991. Pedicchio. SpringerVerlag. Rhode Island. 3] H. In M.B. rst edition. A relational theory of datatypes. Amsterdam. Scholten. and E. American Mathematical Society. P. Chisholm. Predicate Calculus and Program Semantics. 1990. Allegories. Scedrov. 4:673{ 692.
B. II. Lambek. 23] D. 19] E.B. Theorems for free! In 4'th Symposium on Functional Programming Languages and Computer Architecture. Data structures and program transformation. 24] J.
Category Theory
June 12.M. Computational Category Theory. Manes and M.G. Fixed point calculus. 11(4):761{83. 1986. 14(2{3):255{280.D. Smyth and G. Plotkin. 22] Vaughan Pratt. 25] Dana Scott. 1944. Nachr. Algebraic speci cation of data types: A synthetic approach. Logics in AI: European Workshop JELIA '90. Wadler.J. 18] G. volume 7 of Studies in Advanced Mathematics. A xpoint theorem for complete categories. Information Processing Letters. 103:151{161. Science of Computer Programming. 16] D. 5(3):522{587.A. Lambek and P. 1968. Theory.J. Applications to Lists
13] J. London. volume 5 of Graduate Texts in Mathematics. of Computing. Lehman and M. Algebraic Approaches to Program Semantics. 53(3):131{136. Malcolm.134
8. 14(2):97{140. volume 478. 10:197{232. 1981. Rydeheard and R. 1990. 1971. Math. ACM. Introduction to Higher Order Categorical Logic. 1990. Schmidt. The categorytheoretic solution of recursive domain equations. SpringerVerlag Lecture Notes in Computer Science.. Syst. 55:493{513. 17] G. In J. 1988. editor. September 1989. van Eijck.E. Berlin. February 1995. Texts and Monographs in Computer Science. PhD thesis. Algebraic data types and program transformation. 1982. Proc. Scott. 20] Eindhoven University of Technology Mathematics of Program Construction Group. SpringerVerlag. Action logic and pure induction. Mac Lane. PrenticeHall International. October 1990. SIAM J. Cambridge University Press. Burstall. 1953. Malcolm. 27] P. 1998
. Galois connexions. 1986. 14] J. pages 97{120. SpringerVerlag. Mathematische Zeitschrift. Smyth. Groningen University. Arbib. Math. Data types as lattices. September 1976. 21] Oystein Ore. Beitrage fur ltertheorie. 15] S. Categories for the Working Mathematician. SIAM Journal of Computing. 26] M. Transactions of the American Mathematical Society.
Theorems
135
Category Theory
June 12.2.8. 1998
.
124 category. 63 136 June 12. 125 _ . 78 = . 121 ldist . 11 algebra  ( Alg ). 37. 40 adjunction. 123 beautiful theorem. 121 exr . 123 _ . 5 base category. 63 Cat . 121 inr . 41 algebra. 5 exch . 46 adjungate lower . 122 proass .Index
_ . 11 Col . 11. 34 carrier  of an algebra. 63 initial . 85 adjoint lower . 5  algebraically complete. 123 K . 108 arrow identity.. 123
abstraction theorem. 123 roll . 63 carrier of an . 125
+
F
F . 82. 40 upper . 122 fusion. 72 cod . 126 exl . 5 decomp . 41 upper . 125 inl . 29. 29. 67 U . 122 sumass . 5 arrows of a graph. 106 Burstall. 29. 122 1
?
. 64 Alg . 53 Pre . Rod. 68 algebraically complete. 86 Bekic. 63 isomorphic . 124
runit . 123 listfuse . 2 cancellation properties. 108  of small categories ( Cat ). 61 car . 40 contravariant . 121 fuse . 127 lunit . 3. 1998
Category Theory
. 123 . 128 diag . 12 Fun . 77. 67 Alg . 54 End . H. 123 rdist . 125 dom . 72 cartesian closed. 113 1 . 64 carrier functor (car).
32 Godement's rules. 11 covariant . 53  preservation. 11 overcone . 13 constant combinator.. 61. 100 Dijkstra. 7 forgetful functor. 126 Galois connection. 5 functor . 54 evaluation  function. Theorems base.2. 99 xed point. 21 forgetful . 53 diagonal rule. 91. 12 associativity axiom. 12 evaluation . 10 distributive. 113 identity . 6 coherence requirement  initial object. 53 endo category ( End ). 10 s contravariant functor. 72  category ( Fun ). 105 in lattice theory. 13 pre. 11 indexed . 81 catamorphism . 11 post. 3. 123 base . 11 diagonal  ( K ). 9 fusion.. 63 cartesian closed . 53 empty category. 108  adjoint functor theorem. 2 Category Theory deductive system.. 124 cocomplete . 9 s covariant functor. 9. 5  calculus. 78  rule. Edsger W. 58 small . 20 evaluation functor. 6 doubling functor ( 4 ). 111 counit  of the adjunction. Peter. 9 s functor category. 57 composition. 122 empty . 11 Alg . 8. 88 codomain. 3. 54 cocontinuity ! . 8  carrier. 77. 7 . 115 list . 6 diagonal functor ( K ). 44 cocomplete  category. 121 CurryHoward isomorphism. 11  composition. 13 undercone .. 1998
. 12 functor  ( Fun ). 77. 5 small . G. 14 opposite . 21 exchange rule. 37 coproduct. 5  calculus. M. 6 colimit. 7  natural transformation. 13 vertical. 58 closure operator. 113 Freyd. 86 distributive category. 54 endofunctor  ( End ). 29{40 Gentzen. 122 domain. 54 discrete . 7 identity axiom. 12
137
June 12. 113 functor. 6 sum .. 77. 69 Fokkinga. 53 doubling  ( 4 ).8. 61. 67 contravariant .
2 precomposition. 7. 13 Pratt. 61 linesunlines problem. 5  functor. 6 isomorphism cons. 112 de nition. 121 interchange law. 75 map operator. G. David. 91 natural isomorphism  lemma. 5 overcone  category. 71 leapfrog list . 112 mutual recursion. 129 limit. Carel S. 6 Mac Lane. 2 Scholten. 2 postcomposition. 113  decomposition. 53 Malcolm. 63 set of s ( Pre ). 60 algebra.R. 132 iterated square theorem. 127 list  decomposition. 58. 127  fusion. Vaughan. snoc list . 7. J. 111 Lambek. G. 73 monad F . 106{109 mutual recursion theorem. 86 Scott. 77. 14 indirect  equality. 1998
. 6
?
June 12. 124. 54 injection. 2. 130 preservation. 32 small  graph... 25 natural transformation. 121 projection. 121 rolling rule. 13 pre x point. 5 Grothendieck construction. 115 initial object. 9 indexed category. 14 hom  functor. Applications to Lists locally small. 130 cons . 57 terminal . 132 Category Theory
8. 64  objects.D. 26 initial  algebra. 54  preservation. 3. 7 map fusion. see square theorem KnasterTarski theorem. 132 snoc .138 graph. 60 isomorphic s.. 2 sequent calculus. 126  leapfrog. 10 object initial . 20  isomorphism. 23 identity  arrow. 67 product. Dana.. 90 Rydeheard.. 6 preservation of initial s. 11 objects of a graph. S. 13 isomorphic  carriers. 58. 54. 23  set. 58 Plotkin. 77. 68  object. 121 regular algebra.
111 terminal  object.8. Theorems category of  categories ( Cat ). 91{94 star decomposition. Alfred. 112 sum. 111 Tarski. 13 Yoneda's lemma. 23
?
139
Category Theory
June 12. 121 sum category. 114 vertical composition.. 1998
.2. 11 undercone  category. 58 unit  of the adjunction. 13 Tarski's theorem. M. 44 of monad F .B. 11 Smyth. 2 square theorem.