The of Categories is Cartesian Closed

Maarten M Fokkinga CWI, Amsterdam, and University of Twente, Enschede

Version of Feb 5, 1991

The category of categories is cartesian closed. This means amongst others that curry(†) is well defined for any bi- † , having the properties that we expect it to have. The sectioning notation x† may be used to denote “ x subject to curry(†)” (for object or x ); it follows that f† is a from A† to B† , whenever f : A → B .

Introduction The category of categories, C , has all (small?) categories as objects and all as . Cartesian closedness of C means

• there exists a category 1 that is final in C ,

• for any two categories A and B there exists a category A × B and suitable pro- jection functors that together constitute a in C , and

→ • for any two categories A and B there exists a category A B and functor @A,B : A × (A→B) → B and, for any functor † : A × B → C , a functor †ˆ: A → (B→C) that together constitute an exponent in C .

Once the formal requirements are laid down, most of the definitions are straightforward and present no surprises if the point-wise construction of the final object, the products, and the exponents within are known. Also, the verification that the required typing and equations are fullfilled is a matter of routine. The “only” difference with Set is this: in Set a morphism is just a single , whereas in C a morphism is a functor and therefore both a function from objects to objects and a function from morphisms to morphisms. Let us consider the construction for exponents in some more detail. We shall use the following notation and naming convention, unless stated explicitly otherwise. A, B,... vary over categories (i.e. A ∈ Obj(C)); F, G,... vary over functors, typically F : A → B (i.e., F ∈ HomC(A, B)); x.F denotes “ x subject to F ”, and x.(F; G)=(x.F).G ;

1 † : A × B → C in C and x † y =(x,y).† ; A, A′,... vary over objects of A (i.e., A ∈ Obj(A)) and so on; ′ ′ f,g,... vary over morphisms, typically f : A → A in A (i.e., f ∈ HomA(A, A )) and g : B → B′ in B ; composition of morphisms in A and so on is denoted f; f ′ .

Exponents Exponent, Given categories A and B we define the category A→B to be the well-known category of functors from A to B whose morphisms are natural transforma- tions. Given a (bi-) functor † : A×B → C we define the (mono-)functor †ˆ: A → (B→C) as follows. A.†ˆ = the functor from B to C given by B.(A.†ˆ) = A † B ′ (1) g.(A.†ˆ) = id A † g : B.(A.†ˆ) → B .(A.†ˆ) f.†ˆ = the natural transformation from A.†ˆto A′.†ˆgiven by ′ B.(f.†ˆ) = f † id B : A † B → A † B in C ; The requirements for A.†ˆ to be a functor, and for f.†ˆ to be a natural transformation, are easily verified. We can extend the above definition of f.†ˆ (as a mapping from objects to morphisms) with a mapping from morphisms to morphisms as follows. (Here g • ϕ denotes “ g subject to ϕ ”.) g • (f.†ˆ) = f † g = (id A † g);(f † id B′ ) (2) ′ = g.(A†ˆ); B .(f†ˆ) = B.(f†ˆ); g.(A′†ˆ) ; This is no surprise since we can do so in general for any natural transformation ϕ : F → G in B→C (with F, G : B → C in C ): • (3) g.F; ϕB′ = ϕB; g.G =: g ϕ for any g : B → B′ in B .

Sectioning We may use the notation x† for x.†ˆ. It has been defined above for both objects x and morphisms x , and we have seen that A† is a functor and f† is a natural transformation. When object A in A is also used to denote the morphism id A : A → A and • the constant functor A : X → A (mapping an object to A and a morphism to id A ), then we can summarize all four definitions of †ˆ by (4) y. (x†) = x † y in C for any object and morphism x in A and any object and morphism y in B . (Notice that there is a syntactic ambiguity in f; A.F and (A.F); F′ but no semantic ambiguity, since F id A. = id A.F .)

2 Evaluation We also need to define for any two objects A and B in C an evaluation → functor @A,B : A × (A B) → B . As a mapping on objects its definition suggests itself; as a mapping on morphisms it might be a very little bit surprising. (A, F).@ = A.F in B (5) ′ (f,ϕ).@ = f • ϕ : A.F → A .F (= f.F; ϕ = ϕ; f.G) ; for f : A → A′ in A and ϕ : F → G in A→B . In order to fully complete the proof that these constructions do constitute an exponent, the following equivalence has to be satisfied:

(6) F = †ˆ ≡ F × IB→C; @B,C = † for all F : A → B in C . Since @ is defined pointwise one can easily check the equivalence by extensionality.

Acknowledgement I have had an instructive discussion with Lambert Meertens and Jaap van der Woude on this topic.

3