<<

Internal Enriched Categories

Enrico Ghiorzi King’s College, University of Cambridge Supervisor: Prof. J. Martin E. Hyland

August 2019

This dissertation is submitted for the degree of Doctor of Philosophy This dissertation is the result of my own work and includes nothing which is the outcome of work done in collaboration except as declared in the Preface and specified in the text. It is not substantially the same as any that I have submitted, or, is being concurrently submitted for a degree or diploma or other qualification at the University of Cambridge or any other University or similar institution except as declared in the Preface and specified in the text. I further state that no substantial part of my dissertation has already been submitted, or, is being concurrently submitted for any such degree, diploma or other qualification at the University of Cambridge or any other University or similar institution except as declared in the Preface and specified in the text. It does not exceed the prescribed word for the relevant Degree Committee. Internal Enriched Categories Dissertation Summary

Enrico Ghiorzi

This dissertation introduces and develops the theory of internal enriched categories, arising from the internalization of the theory of enriched categories. Given an internal monoidal V in an ambient category ℰ, we define the notions of V-, and . We then develop such theory, which presents many of the good properties of standard enriched . Notably, under suitable conditions, the category of internal V-enriched categories and their is monoidal closed. Internal enriched categories admit a notion of internal weighted limit, anal- ogously to how internal categories admit internal limits. Such theory of limits constitutes a major focus point in the dissertation and yields fundamental results such as the adjoint functor theorem. It is observed that internal catego- ries are intrinsically small and some of them are non-trivial examples of small complete categories, whereas the only standard small complete categories are complete lattices. As a consequence, the internal theory is better behaved than that of standard categories, particularly in relation with size issues, while still featuring interesting examples. Moreover, to frame it into a wider context, the notion of internal enriched category is compared with related notions from the literature, such as those of indexed enriched category and enriched generalized multicategory. It turns out that internal enriched categories are indeed strongly connected with such other notions, thus providing a novel approach to–and, possibly, insight into– other topics in category theory.

Acknowledgments

For even the very wise cannot see all ends.

(J.R.R. Tolkien, The Fellowship of the ) I wish to thank the Cambridge Trust and the Engineering and Physical Sci- ences Research Council for generously funding my PhD studies. I am deeply grateful to my supervisor, Prof. Martin Hyland, for helping and supporting me along the course of my PhD. Particularly, I wish to thank him for the infinite patience and kindness he showed me during our many long meetings, and for imparting to me his immense mathematical knowledge, profound insights, and intuition. I also wish to thank Prof. Giuseppe Rosolini, my undergraduate and master’s degree supervisor at the Università degli Studi di Genova, for the many helpful conversations which we had when I was visiting, and in particular for providing the original suggestion of enriching over the category of Modest Sets, which became a central topic in this dissertation. I could not have undertaken such great endeavor without an equally great amount of personal support from those whom I hold dear. In this regard,I wish to thank my family for supporting me both morally and concretely during my studies and my whole life; my girlfriend Lydia, for always believing in me even when I was despairing and losing faith in myself, giving me the strength to keep going; and my many friends in Genova, Cambridge and wherever they may now be, which are too many to name and to whom I am too indebted to properly express, for making even the hardest of times bearable. Finally, I wish to thank the one person whom, despite all of his many short- comings, made this work possible by not giving up: myself.

v

Contents

Introduction 1

1. Background 5 1.1. Internal Categories ...... 5 1.2. Exponentials of Internal Categories ...... 9 1.3. Internal Monoidal Categories ...... 12 1.4. Indexed Categories ...... 16 1.5. Externalization of Internal Categories ...... 18 1.6. Indexed Enriched Categories ...... 22

2. Completeness of Internal Categories 27 2.1. Diagrams and Cones ...... 28 2.2. Limits ...... 30 2.3. Completeness ...... 32

3. Internal Enriched Categories 41 3.1. Internal Enriched Categories ...... 41 3.2. Comparison with Indexed Enriched Categories ...... 48 3.3. Categories of Functors ...... 54 3.4. and Extranatural Transformations ...... 57 3.5. Ends ...... 60 3.6. Monoidal Product of Enriched Categories ...... 63 3.7. Exponentials of Internal Enriched Categories ...... 65 3.8. for Internal Enriched Categories ...... 76

4. Limits and Completeness 83 4.1. Complete Categories ...... 84 4.2. Limit-Preserving Functors ...... 91 4.3. Adjoint Functor Theorem ...... 93

5. Future Work 99 5.1. Sets ...... 99 5.2. Modest Sets ...... 99 5.3. Groupoids ...... 101 5.4. Monads ...... 101 5.5. Cubical Sets ...... 103

vii Contents

Concluding Remarks 105

A. Enriched Generalized Multicategories 107 A.1. Generalized Multicategories ...... 107 A.2. The ℱ-multicategory 풱 ...... 109 A.3. Internal Enrichment to Enriched Generalized Multicategories . 111 A.4. Enriched Generalized Multicategories to Internal Enrichment . 117 A.5. Equivalence ...... 118

Bibliography 121

viii Introduction

It is a remarkable feature of the Effective (Hyland 1982) that it contains a small which is in some sense complete. That something of this kind should be true was originally suggested by Eugenio Moggi as a way to understand how realizability give rise to models for impredicative polymorphism. Concrete versions of such models already appeared in Girard 1972.The relevant subcategory identified within the Effective Topos has been called the category of Modest Sets.The sense in which it is complete is a delicate matter. That and other aspects of the situation are considered in detail in Hyland, Robinson, and Rosolini 1990. For the purposes of this dissertation however it will be enough to know that the Modest Sets form a small complete subcategory of the Category of Assemblies (equivalently, the ¬¬-separated objects in the Effective Topos, identified in Hyland 1982) in a sense which we shall make precise in chapter 2.This notion of (strong) completeness is related in a reasonably straightforward way—using the externalization of an —to the established notion for indexed categories (Paré and Schumacher 1978). However we do not exploit this explicitly and keep the exposition as internal as possible.There is a rough sketch of the indexed point of view in Hyland 1982. Aside from the applications to polymorphism, the existence of a small com- plete category remains underexploited. Section 3.1 of Hyland 1988 contains a little small complete category theory, inspired by the understanding of indexed categories (Paré and Schumacher 1978), but even that has never been worked through in any detail. We are not going to address that lack in this dissertation: rather, we want to propose a different perspective, that of enriched category theory. This dissertation introduces the notion of internal enriched category theory, that is, enriched category theory internal to a suitable ambient category ℰ. Given a complete (and so co-complete) symmetric 풱 within ℰ, we consider categories enriched in 풱 and internal to ℰ. (These themselves form a category indexed over ℰ.) Our aim is to develop an attractive theory of such internal enriched categories. Our leading example of such a situation is provided by taking 풱 to be the internal category of modest sets within ℰ the Category of Assemblies.In that case 풱 is an internal subcategory of ℰ and enriched categories are essentially special categories internal to ℰ. Even within the Category of Assemblies, there should be many other examples of our general situation where the enriched

1 Introduction categories are not simply special categories.In particular, if 푇 is a commutative monad acting on 풱, then the category of 푇-algebras should give an internal symmetric monoidal category in which one can enrich. We briefly address this at the of the dissertation. The dissertation is organized as follows. Some categorical background to the dissertation is presented in chapter 1. The focus of the dissertation is on enriched category theory internal to a suitable ambient category, so we discuss internal categories and internal monoidal categories. However, when handling internal category theory, one needs to consider from time to time e.g. all such categories and give definitions which are not strictly within the internal logic. It is helpful to see such material from the perspective of indexed category theory, as that gives a way to talk about large categories over a base. While we shall not need to make this perspective explicit throughout the dissertation, we include here a treatment of indexed categories as motivating background for the main material of the dissertation. The usual setting for enriched category theory involves a symmetric monod- ical which is complete and cocomplete (Kelly 1982). We try to follow essentially the same approach in our internal theory, so we have to consider, in particular, the completeness of our enriching symmetric monoidal categories.There is relatively little on this topic in the existing literature and the fullest treatment (Hyland, Robinson, and Rosolini 1990) is concerned with issues irrelevant to the context in which we develop our theory. Hence, in chap- ter 2 we give a treatment of limits and completeness for internal categories. In chapter 3 we introduce the main objects of study in the dissertation, that is, internal categories enriched in an internal complete symmetric monoidal closed category. We make the comparison with the indexed setting and then introduce the basic machinery of the theory of enrichment, including a crucial calculus of ends. A major topic is the construction and properties of the exponential (or enriched category of functors) between enriched categories. After we address that in some detail, we are then able to present a form of the Yoneda lemma and Yoneda embedding. We finally come to the focal point of the dissertation in chapter 4, inwhich we discuss completeness and cocompleteness for internal enriched categories. Here, we find a pleasing contrast with Kelly’s classical theory: there is no need to consider matters of size, as all objects under consideration are internal and can thus be thought of as small. So our results—for example the adjoint functor theorem—appear clean and uncluttered by the usual delicate -theoretic considerations. We have not developed the theory of internal enriched categories simply for its own sake and in our concluding chapter 5, we suggest directions for future work. Finally, in appendix A we conduct a kind of sanity check on the notion of

2 internal enriched category, by showing that it can be presented as an example of Leinster’s notion of enriched generalised multicategory (Leinster 2002, 2004).

3

1. Background

In this chapter we quickly recall, without any claim of completeness, some topics in Category Theory which will be needed as background. Although these topics are standard and well-known, it is useful to spell them out anyway to set the notation. Aside from that, we assume the reader to be familiar with the basic notions of Category Theory. In this respect, we shall regard Borceux (1994) and Mac Lane (1989) as our main references. In the context of this dissertation, let ℰ be a category with finite limits, which we will regard as our ambient category. We also require ℰ to have a cartesian monoidal structure, that is, a monoidal structure given by a functorial choice ℰ of binary products × ∶ ℰ × ℰ → ℰ and a chosen terminal object ퟙℰ. Notice that, as a category with finite limits, ℰ is a model for cartesian logic, or finite limit logic. So, we will frequently use its internal language to ease the notation.The internal language will be extended to typed lambda- calculus when we will further assume ℰ to be locally cartesian closed. There are multiple accounts of the internal language of categories in the literature. In particular, we shall follow Crole (1993) and Johnstone (2002), but, since we only make a basic use of the internal language, other references would be equally adequate.

1.1. Internal Categories

We start by giving the definitions of internal category, functor and natural transformation using the internal language of ℰ as described before.

Definition 1.1.1 (internal category). An internal category (or category object) 푨 in ℰ is a diagram

s푨 ∘푨 퐴0 id푨 퐴1 퐴1 s×t 퐴1 t푨 in ℰ (where 퐴1 s×t 퐴1 is the pullback of s푨 and t푨) satisfying the usual axioms for categories, which can be expressed in the internal language of ℰ as follows.

푎∶ 퐴0 ⊢ s푨(id푨(푎)) = 푎∶ 퐴0 푎∶ 퐴0 ⊢ t푨(id푨(푎)) = 푎∶ 퐴0

5 1. Background

(푔, 푓 )∶ 퐴1 s×t 퐴1 ⊢ s푨(푔 ∘푨 푓 ) = s푨(푓 )∶ 퐴0

(푔, 푓 )∶ 퐴1 s×t 퐴1 ⊢ t푨(푔 ∘푨 푓 ) = t푨(푔)∶ 퐴0

(ℎ, 푔, 푓 )∶ 퐴1 s×t 퐴1 s×t 퐴1 ⊢ ℎ ∘푨 (푔 ∘푨 푓 ) = (ℎ ∘푨 푔) ∘푨 푓∶ 퐴1

푓∶ 퐴1 ⊢ 푓 ∘푨 id푨(s푨(푓 )) = 푓∶ 퐴1 푓∶ 퐴1 ⊢ id푨(t푨(푓 )) ∘푨 푓 = 푓∶ 퐴1

We now define a notion of functor of internal categories with relative compo- sition and identity, so that internal categories and their functors shall form a category.

Definition 1.1.2 (internal functor). Let 푨 and 푩 be internal categories in ℰ. A functor of internal categories 퐹∶ 푨 → 푩 is given by a pair of arrows 퐹0 ∶ 퐴0 → 퐵0 and 퐹1 ∶ 퐴1 → 퐵1 such that

푓∶ 퐴1 ⊢ s푩(퐹1(푓 )) = 퐹0(s푨(푓 ))∶ 퐵0 푓∶ 퐴1 ⊢ t푩(퐹1(푓 )) = 퐹0(t푨(푓 ))∶ 퐵0 (푔, 푓 )∶ 퐴1 s×t 퐴1 ⊢ 퐹1(푔 ∘푨 푓 ) = 퐹1(푔) ∘푩 퐹1(푓 )∶ 퐵1.

퐹 퐺 The composition 퐺 ∘ 퐹 of two consecutive functors 푨 −→ 푩 −→ 푪 is defined by

푎∶ 퐴0 ⊢ (퐺 ∘ 퐹)0(푎) ≔ 퐺0(퐹0(푎))∶ 퐶0

푓∶ 퐴1 ⊢ (퐺 ∘ 퐹)1(푓 ) ≔ 퐺1(퐹1(푓 ))∶ 퐶1.

The identity functor id푨 ∶ 푨 → 푨 is defined by

푎∶ 퐴0 ⊢ (id푨)0(푎) ≔ 푎∶ 퐴0

푓∶ 퐴1 ⊢ (id푨)1(푓 ) ≔ 푓∶ 퐴1.

With the composition so defined, internal categories in ℰ and their func- tors form a category Catℰ.In the following remark, we notice some useful properties of Catℰ in relation to slicing and change of base. Remark 1.1.3. Let ℰ′ be another category with finite limits, and 퐹∶ ℰ → ℰ′ a functor preserving finite limits.Then, there is a functor 퐹∶ Catℰ → Catℰ′ (with notation overload) applying 퐹 to the underlying graph of internal categories. Remark 1.1.4. Let 푖∶ 퐽 → 퐼 be an arrow in ℰ.Then, there is an adjunction ∗ 푖! ⊣ 푖 ∶ ℰ/퐼 → ℰ/퐽 where the functor 푖! ∶ ℰ/퐽 → ℰ/퐼 is given by post-composition with 푖, and the functor 푖∗ ∶ ℰ/퐼 → ℰ/퐽 is given by pullback along 푖.This ∗ adjunction extends to internal categories, yielding 푖! ⊣ 푖 ∶ Catℰ/퐼 → Catℰ/퐽. ∗ In particular, the unique arrow !퐼 ∶ 퐼 → ퟙℰ yields an adjunction 퐼! ⊣ 퐼 ∶ Catℰ → Catℰ/퐼.

6 1.1. Internal Categories

While correct, the use we made of the internal language is quite unwieldy, especially when dealing with terms whose type is the object of arrows of an internal category. We then introduce conventions to ease the use of the internal language, by bringing it closer to the standard notation of category theory.

Notation 1.1.5. Given arrows 퐹∶ 푋 → 퐴1 and 푆, 푇∶ 푋 → 퐴0, we shall write 퐹(푥) 푥∶ 푋 ⊢ 퐹(푥)∶ 푆(푥) → 푇(푥)∶ 퐴1 or 푥∶ 푋 ⊢ 푆(푥) −−−→푇(푥)∶ 퐴1 instead of 푥∶ 푋 ⊢ s푨퐹(푥) = 푆(푥)∶ 퐴0 and 푥∶ 푋 ⊢ t푨퐹(푥) = 푇(푥)∶ 퐴0. More- over, given 퐺∶ 푋 → 퐴1 and 푈∶ 푋 → 퐴0 such that 푥∶ 푋 ⊢ 퐺(푥)∶ 푇(푥) → 푈(푥)∶ 퐴1, we shall write 퐹(푥) 퐺(푥) 푥∶ 푋 ⊢ 푆(푥) −−−→푇(푥) −−−→푈(푥)∶ 퐴1 instead of 푥∶ 푋 ⊢ 퐺(푥)∘푨퐹(푥)∶ 퐴1. Finally, when we have a term 푎0, 푎1 ∶ 퐴0, 푓∶ 퐴1 ⊢ 푡(푎0, 푎1, 푓 )∶ 퐵 we shall write

(푓∶ 푎0 → 푎1)∶ 퐴1 ⊢ 푡(푓 , 푎0, 푎1)∶ 퐵 in place of 푓∶ 퐴1 ⊢ 푡(s푨(푓 ), t푨(푓 ), 푓 )∶ 퐵. Then, we can use the familiar notation for commuting diagrams even in the internal language. With the previous notation, it is easy to define natural transformations between functors of internal categories, with relative horizontal and vertical compositions and identity, so that internal categories with their functors and the natural transformations between them shall form a 2-category. Definition 1.1.6 (natural transformations). Let 퐹, 퐺∶ 푨 → 푩 be functors of internal categories in ℰ. A natural transformation 훼∶ 퐹 → 퐺∶ 푨 → 푩 is given by an arrow 훼∶ 퐴0 → 퐵1 such that 훼(푎) 푎∶ 퐴0 ⊢ 퐹0(푎) −−−→퐺0(푎)∶ 퐵1, 훼(푎) 퐹0(푎) 퐺0(푎) ′ (푓∶ 푎 → 푎 )∶ 퐴1 ⊢ 퐹1(푓 ) 퐺1(푓 ) ∶ 퐵1. ′ ′ 퐹0(푎 ) 퐺0(푎 ) 훼(푎′)

The vertical and horizontal compositions of natural transformations in

훼 퐿 푅 푪 푨 퐺 푩 푫 훽

7 1. Background are given by

훼(푎) 훽(푎) 푎∶ 퐴0 ⊢ (훼훽)(푎) ≔ 퐹0(푎) −−−→퐺0(푎) −−−→퐻0(푎)∶ 퐵1 훼(퐿(푐)) 푐∶ 퐶0 ⊢ (훼퐿)(푎) ≔ 퐹0(퐿0(푐)) −−−−−→퐺0(퐿0(푐))∶ 퐵1 푅1(훼(푎)) 푎∶ 퐴0 ⊢ (푅훼)(푎) ≔ 푅0(퐹0(푎)) −−−−−−→푅0(퐺0(푎))∶ 퐷1.

The identity natural transformation id퐹 ∶ 퐹 → 퐹∶ 푨 → 푩 is defined by

id푨(퐹0(푎)) 푎∶ 퐴0 ⊢ id퐹(푎) ≔ 퐹0(푎) −−−−−−−→퐹0(푎)∶ 퐵1.

With the compositions so defined, internal categories in ℰ with their functors and the natural transformations between them form a 2-category Catℰ. Notice that there is a notation overload, but context is usually sufficient to distinguish between occurrences of Catℰ as a category or as a 2-category. The category of internal categories is well-behaved with respect to slicing, as the following remark makes clear. The following proposition can be proved by a completely routine application of the internal language of ℰ.

Proposition 1.1.7. The category Catℰ has finite limits induced point-wise by the corresponding limits in ℰ.In particular, there is a terminal internal ퟙ ×Catℰ category Catℰ and a binary product of internal categories making Catℰ a cartesian monoidal category.

There is also an obvious functor Catℰ → ℰ, given in the next definition.

Definition 1.1.8. The objects functor is the 푈∶ Catℰ → ℰ sending an internal category 푨 into its object of objects 퐴, and an internal functor 퐹∶ 푨 → 푩 into its object component 퐹0 ∶ 퐴 → 퐵.

We now present a few remarkable examples of internal categories. Example 1.1.9. Let 퐴 be an object of ℰ.The discrete category 퐝퐢퐬(퐴) over 퐴 is given by

s =id 퐝퐢퐬(퐴)1 퐴

id퐝퐢퐬(퐴) ∘퐝퐢퐬(퐴) =id퐴 = 1 1 퐝퐢퐬(퐴)0 = 퐴 퐝퐢퐬(퐴)1 = 퐴 퐝퐢퐬(퐴)1 s×t 퐝퐢퐬(퐴)1 ≅ 퐴 id퐴

t =id 퐝퐢퐬(퐴)1 퐴

This extends to a monoidal functor 퐝퐢퐬∶ ℰ → Catℰ.

8 1.2. Exponentials of Internal Categories

Example 1.1.10. Let 퐴 be an object of ℰ. The indiscrete category 퐢퐧퐝(퐴) over 퐴 is given by

s =휋 퐢퐧퐝(퐴)1 1

id ∘ 퐢퐧퐝(퐴)1 퐢퐧퐝(퐴)1 퐢퐧퐝(퐴)1 s×t 퐢퐧퐝(퐴)1 = = 퐢퐧퐝(퐴)0 = 퐴 퐢퐧퐝(퐴)1 = 퐴 × 퐴 훥퐴 (휋1,휋3) ≅ 퐴 × 퐴 × 퐴

t =휋 퐢퐧퐝(퐴)1 2

This extends to a monoidal functor 퐢퐧퐝∶ ℰ → Catℰ. The above constructions yield the free and co-free internal categories over an object of ℰ, as formally stated by the following proposition, whose proof is, again, routine.

Proposition 1.1.11. There are monoidal adjunctions 퐝퐢퐬 ⊣ 푈 ⊣ 퐢퐧퐝.

As a further example, consider opposite categories. Example 1.1.12. Let 푨 be an internal category in ℰ.The 푨퐨퐩 is obtained by switching the source and target arrows of 푨, so that s푨퐨퐩 = t푨 퐨퐩 and t푨퐨퐩 = s푨. This extends to a monoidal functor (‐) ∶ Catℰ → Catℰ. Then, it is not difficult to prove the following result. 퐨퐩 Proposition 1.1.13. The monoidal functor (‐) is a self-adjoint automor- phism.

1.2. Exponentials of Internal Categories

The functors between two categories form a set, meaning that Cat is enriched over Set. Analogously, we would expect Catℰ to be enriched over ℰ. For that, we need to assume that ℰ is cartesian closed. Then, the theory of categories internal to ℰ becomes clearer from the perspective of enriched category theory. In this section, let’s assume that ℰ is cartesian closed, meaning that its internal language will be the simply typed lambda calculus extension of finite limit logic.

퐴 Notation 1.2.1. If 퐴 and 퐵 are objects of ℰ, let eℰ ∶ 퐵 × 퐴 → 퐵 be the evaluation .The notation for the evaluation arrow should also be decorated with 퐴 and 퐵, but it is unnecessary as those are usually clear from the context.

It is also useful to introduce a convention to denote subobjects yielded by an equalizer.

9 1. Background

Notation 1.2.2. Given two terms 푎∶ 퐴 ⊢ 푡(푎), 푡′(푎)∶ 퐵 we can form the equal- izer of the two parallel arrows 퐴 → 퐵 yielded by 푡 and 푡′.That is the subobject of 퐴 of those 푎∶ 퐴 such that 푡(푎) = 푡′(푎).

We are now ready to prove that the intuition about Catℰ being enriched in ℰ was correct, in the sense made precise by the statement of the following proposition.

Proposition 1.2.3. There is a category enriched in ℰ (which shall be called Catℰ with abuse of notation) whose underlying category is isomorphic to Catℰ itself. (푨, 푩) 푨 푩 Proof. The hom-object HomCatℰ of internal categories and repre- 퐴0 퐴1 sents the functors 푨 → 푩, and is defined as the subobject of 퐵0 × 퐵1 of those 퐹 = (퐹0, 퐹1) satisfying the functoriality axioms, i.e. such that

eℰ(퐹1,푓 ) 휆(푓∶ 푎0 → 푎1)∶ 퐴1. eℰ(퐹0, 푎0) −−−−−−→ eℰ(퐹0, 푎1) 휆(푔, 푓 )∶ 퐴1 s×t 퐴1. eℰ(퐹1, 푔 ∘푨 푓 ) = 휆(푔, 푓 )∶ 퐴1 s×t 퐴1. eℰ(퐹1, 푔) ∘푩 eℰ(퐹1, 푓 ).

The composition of internal categories 푨, 푩 and 푪 is the arrow

∘ (푨, 푩, 푪)∶ (푩, 푪) × (푨, 푩) → (푨, 푪) Catℰ HomCatℰ HomCatℰ HomCatℰ 퐹∶ (푨, 푩) 퐺∶ (푩, 푪) defined in context HomCatℰ , HomCatℰ as

퐴 ∘ (푨, 푩, 푪)(퐹, 퐺) ≔ 휆푎∶ 퐴 . e (퐺 , e (퐹 , 푎))∶ 퐶 0 Catℰ 0 0 ℰ 0 ℰ 0 0 퐴 ∘ (푨, 푩, 푪)(퐹, 퐺) ≔ 휆푓∶ 퐴 . e (퐺 , e (퐹 , 푓 ))∶ 퐶 1. Catℰ 1 1 ℰ 1 ℰ 1 1 The identity of the internal category 푨 is the arrow

(푨)∶ ퟙ → (푨, 푨) idCatℰ ℰ HomCatℰ defined as

(푨) ≔ (휆푎∶ 퐴 . 푎, 휆푓∶ 퐴 . 푓 )∶ (푨, 푨). idCatℰ 0 1 HomCatℰ The verification that these data give an enrichment is a simple exercise in the internal language. (푨, 푩) The points of the hom-object HomCatℰ are evidently in bijective corre- spondence with functors 푨 → 푩. The theory developed in section 1.1 extends to the context of enriched cate- gory theory. For example, consider the following proposition.

Proposition 1.2.4. The adjunctions from proposition 1.1.11 are ℰ-enriched.

10 1.2. Exponentials of Internal Categories

Remark 1.2.5. For any object 퐼 in ℰ we have that Catℰ/퐼 is enriched over ℰ/퐼. Moreover, if 푢∶ 퐼 → 퐽 is an arrow in ℰ, then Catℰ/퐽 has an enrichment on ℰ/퐼 ∗ ∗ through 푢 ∶ ℰ/퐽 → ℰ/퐼, and (푢 )∗ ∶ Catℰ/퐽 → Catℰ/퐼 is a ℰ/퐼-enriched functor.

We can finally prove that Catℰ is cartesian closed. Moreover, as it is clear from the following proof, if 푨 and 푩 are categories in ℰ, then the points of 푩푨 are in bijective correspondence with the functors 푨 → 푩.

Proposition 1.2.6. The category Catℰ is cartesian closed. Proof. Let 푨 and 푩 be internal categories of ℰ.Let’s define the 푩푨, representing the internal category of functors 푨 → 푩 and natural transformations between them: (푩푨) (푨, 푩) Object of objects 0 is HomCatℰ , as defined in proposition 1.2.3.

푨 푨 푨 퐴0 Object of arrows (푩 )1 is the subobject of (푩 )0 × (푩 )0 × 퐵1 given, in 푨 푨 퐴0 context (퐹∶ (푩 )0, 퐺∶ (푩 )0, 훼∶ 퐵1 ), by the axiom

eℰ(훼,푎) eℰ(퐹0, 푎) eℰ(퐺0, 푎)

휆(푓∶ 푎 → 푏)∶ 퐴1. eℰ(퐹0,푓 ) eℰ(퐺0,푓 ) ∶ 퐵1.

eℰ(퐹0, 푏) eℰ(퐺0, 푏) eℰ(훼,푏)

푨 푨 푨 Composition is the arrow ∘푩푨 ∶ (푩 )1 s×t (푩 )1 → (푩 )1 defined, in context 푨 푨 ((퐺, 퐻, 훽), (퐹, 퐺, 훼))∶ (푩 )1 s×t (푩 )1, as

(퐺, 퐻, 훽) ∘푩푨 (퐹, 퐺, 훼) ≔ (퐹, 퐻, 휆푎∶ 퐴0. eℰ(훽, 푎) ∘푩 eℰ(훼, 푎))

푨 푨 푨 Identity is the arrow id푩푨 ∶ (푩 )0 → (푩 )1 defined, in context 퐹∶ (푩 )0, as

id푩푨(퐹) ≔ (퐹, 퐹, 휆푎∶ 퐴0. id푩(퐹0(푎))).

Then, a standard argument shows that there is an isomorphism

(푨′ ×Catℰ 푨, 푩) ≅ (푨′, 푩푨) HomCatℰ HomCatℰ natural in 푨′.

Of course the fact that Catℰ is cartesian closed tells us that it is enriched in itself. That extends the fact that it is enriched in ℰ.In fact the enrichment in ℰ is essentially obtained from that in Catℰ by change of base along the objects functor 푈∶ Catℰ → ℰ.

11 1. Background

1.3. Internal Monoidal Categories

We could not conceivably present a notion of enrichment without introducing a suitable notion of monoidal category to serve as enriching category. We introduce here the definitions, in the internal language of ℰ, of the notions of monoidal category, functor and natural transformation. We also give the definitions pertaining to the symmetric case, which is of most interest forthe sequel.

Definition 1.3.1 (internal monoidal category). An internal monoidal category is an internal category 푽 in ℰ equipped with functors Monoidal product ⊗푽 ∶ 푽 ×Catℰ 푽 → 푽, and 핀 ∶ ퟙ → 푽 Monoidal unit 푽 Catℰ , and natural isomorphisms 푽 푽 푽 푽 Associator 훼푽 ∶ (휋1 ⊗ 휋2) ⊗ 휋3 → 휋1 ⊗ (휋2 ⊗ 휋3)∶ 푽 × 푽 × 푽 → 푽, 푽 Left unitor 휆푽 ∶ 핀푽 ⊗ id푽 → id푽 ∶ 푽 → 푽, and 푽 Right unitor 휌푽 ∶ id푽 ⊗ 핀푽 → id푽 ∶ 푽 → 푽, such that, in context 푎, 푏, 푐, 푑∶ 푉0, the axioms

푽 푽 훼푽(푎,핀푽,푏) 푽 푽 (푎 ⊗0 핀푽) ⊗0 푏 푎 ⊗0 (핀푽 ⊗0 푏) (Triangle) 푽 푽 휌푽(푎)⊗1id푽(푏) id푽(푎)⊗1휆푽(푏) 푽 푎 ⊗0 푏

푽 푽 푽 ((푎 ⊗0 푏) ⊗0 푐) ⊗0 푑 푽 푽 훼푽(푎,푏,푐)⊗0푑 훼푽(푎⊗0푏,푐,푑)

푽 푽 푽 푽 푽 푽 (푎 ⊗0 (푏 ⊗0 푐)) ⊗0 푑 (푎 ⊗0 푏) ⊗0 (푐 ⊗0 푑)

푽 푽 훼푽(푎,푏⊗0푐,푑) 훼푽(푎,푏,푐⊗0푑) 푎 ⊗푽 ((푏 ⊗푽 푐) ⊗푽 푑) 푎 ⊗푽 (푏 ⊗푽 (푐 ⊗푽 푑)) 0 0 0 푽 0 0 0 푎⊗0훼푽(푏,푐,푑) (Pentagon) hold. The previous definition is a direct internalization of the standard definition of monoidal category, and that alone should suffice to persuade us of its correct- ness. If we were still skeptical, though, it could also be argued that, since small

12 1.3. Internal Monoidal Categories monoidal categories are pseudomonoids in the 2-category of categories, then internal monoidal categories in ℰ must be pseudomonoids in the 2-category Catℰ, which is what our definition amounts to. We then proceed with the definition of monoidal functor.

Definition 1.3.2 (internal monoidal functor). An internal monoidal functor (퐹, 휖, 휇)∶ 푽 → 푾 is given by an internal functor 퐹∶ 푽 → 푾 and coherence natural isomorphisms

휖∶ 핀 → 퐹핀 ∶ 핀 → 푾 푾 푽 Catℰ and 휇∶ 퐹 ⊗푾 퐹 → 퐹(‐ ⊗푽 ‐)∶ 푽 × 푽 → 푾 such that, in context 푎, 푏, 푐∶ 푉0, the axioms

훼푾(퐹0(푎),퐹0(푏),퐹0(푐))

푾 푾 푾 푾 (퐹0(푎) ⊗ 퐹0(푏)) ⊗ 퐹0(푐) 퐹0(푎) ⊗ (퐹0(푏) ⊗ 퐹0(푐))

푾 푽 휇(푎,푏)⊗1 id푾(퐹0(푐)) id푾(퐹0(푎))⊗1휇(푏,푐) 푽 푾 푾 푽 퐹0(푎 ⊗ 푏) ⊗ 퐹0(푐) 퐹0(푎) ⊗ 퐹0(푏 ⊗ 푐)

푽 푽 휇(푎⊗0푏,푐) 휇(푎,푏⊗0푐) 푽 푽 푽 푽 퐹0((푎 ⊗ 푏) ⊗ 푐) 퐹0(푎 ⊗ (푏 ⊗ 푐)) 퐹1(훼푽(푎,푏,푐))

휆 (퐹 (푎)) 푾 푾 0 핀푾 ⊗ 퐹0(푎) 퐹0(푎)

푾 휖⊗ 퐹0(푎) 퐹1(휆푽(푎)) 푾 푽 퐹0(핀푽) ⊗ 퐹0(푎) 퐹0(핀푽 ⊗ 푎) 휇(핀푽,푎)

휌 (퐹 (푎)) 푾 푾 0 퐹0(푎) ⊗ 핀푾 퐹0(푎)

푾 퐹0(푎)⊗ 휖 퐹1(휌푽(푎)) 푾 푽 퐹0(푎) ⊗ 퐹0(핀푽) 퐹0(푎 ⊗ 핀푽) 휇(푎,핀푽) hold.

Then, we define natural trasformations of monoidal functors.

Definition 1.3.3 (internal monoidal natural transformation). An internal monoidal natural transformation 훼∶ (퐹, 휖퐹, 휇퐹) → (퐺, 휖퐺, 휇퐺)∶ 푽 → 푾 is a

13 1. Background

natural transformation 훼∶ 퐹 → 퐺∶ 푽 → 푾 such that, in context 푎, 푏, ∶ 푉0, the axioms

푾 푾 훼(푎)⊗ 훼(푏) 푾 퐹0(푎) ⊗ 퐹0(푏) 퐺0(푎) ⊗ 퐺0(푏)

휇퐹(푎,푏) 휇퐺(푎,푏) 푽 푽 퐹0(푎 ⊗ 푏) 퐺0(푎 ⊗ 푏) 훼(푎⊗푽푏)

훼(핀푽) 퐹0(핀푽) 퐺0(핀푽)

휖퐹 휖퐺 핀푾 hold.

While it is not necessary for the definition of the notion of enrichment, in many situations it is required for the monoidal product of the enriching category to be symmetric. We now define the notion of internal symmetric monoidal category and functor. Notice that there is no need for a definition of symmetric monoidal natural transformation, as the usual definition is already adequate.

Definition 1.3.4 (internal symmetric monoidal category). An internal monoidal category 푽 is a internal symmetric monoidal category if it comes equipped 푽 푽 with a symmetry, that is, a natural isomorphism 휎푽 ∶ 휋1 ⊗ 휋2 → 휋2 ⊗ Catℰ 휋1 ∶ 푽 × 푽 → 푽 such that, in context 푎, 푏∶ 푉0, the following axioms

훼 (푎,푏,푐) (푎 ⊗푽 푏) ⊗푽 푐 푽 푎 ⊗푽 (푏 ⊗푽 푐)

푽 푽 휎푽(푎,푏)⊗ 푐 휎푽(푎,푏⊗ 푐) (푏 ⊗푽 푎) ⊗푽 푐 (푏 ⊗푽 푐) ⊗푽 푎 (Hexagon)

훼푽(푏,푎,푐) 훼푽(푏,푐,푎) 푏 ⊗푽 (푎 ⊗푽 푐) 푏 ⊗푽 (푐 ⊗푽 푎) 푽 푏⊗ 휎푽(푎,푐) 푎 ⊗푽 푏 푎 ⊗푽 푏 (Involution) 휎푽(푎,푏) 휎푽(푏,푎) 푏 ⊗푽 푎 hold.

14 1.3. Internal Monoidal Categories

Definition 1.3.5 (internal symmetric monoidal functor). An internal monoidal functor (퐹, 휖, 휇)∶ 푽 → 푾 between internal symmetric monoidal categories 푽 and 푾 is a internal symmetric monoidal functor if the axiom

휇(푎,푏) 푽 푾 퐹0(푎 ⊗ 푏) 퐹0(푎) ⊗ 퐹0(푏)

퐹1(휎푽(푎,푏)) 휎푾(퐹0(푎),퐹0(푏)) 퐹 (푏 ⊗푽 푎) 퐹 (푏) ⊗푾 퐹 (푎) 0 휇(푏,푎) 0 0 holds.

It is routine to check in the internal language that the data above gives 2-categories, so we can give the following definitions.

Definition 1.3.6 (category of internal monoidal categories). Internal monoidal categories and monoidal functors (and monoidal transformations) in ℰ form a (2-)category MonCatℰ.Internal symmetric monoidal categories and symmetric monoidal functors (and monoidal transformations) in ℰ form a (2-)category SymMonCatℰ.

Remark 1.3.7. There is an underlying-monoidal-category (2-)functor

푈 ∶ → MonCatℰ SymMonCatℰ MonCatℰ sending symmetric monoidal categories and functors (and natural transfor- mations) to, respectively, their underlying monoidal categories and functors (and natural transformations). There is an underlying-internal-category (2-)functor

푈 ∶ → Catℰ MonCatℰ Catℰ sending monoidal categories and functors (and natural transformations) to, respectively, their underlying internal categories and functors (and natural transformations). The analogous result to proposition 1.2.6 does not hold for monoidal cate- gories, as MonCatℰ is not generally cartesian closed even when ℰ is. However, we can still extend the ideas about enrichment to the case of monoidal cate- gories, and we have the following proposition, analogous to proposition 1.2.3 and proved in the same way.

Proposition 1.3.8. If ℰ is cartesian closed, then MonCatℰ (SymMonCatℰ) has an enrichment on Catℰ (as a cartesian monoidal category) whose underlying category is MonCatℰ (SymMonCatℰ) itself.

15 1. Background

Finally, in this dissertation we will also need a notion of monoidal closedness for internal symmetric monoidal categories.

Definition 1.3.9 (monoidal closed internal category). An internal symmetric monoidal categoy 푽 is monoidal closed if the functor in ℰ/푉0

푽 (휋2,⊗ ) ∗ 푽 × 푉0 (푉0) 푽

휋2 휋1 푉0

∗ has a right adjoint [−, −]∶ (푉0) 푽 → 푽.In this case, the unit and counit will be internal natural transformations

푽 휂∶ 휋1 → [휋2, 휋1 ⊗ 휋2]∶ 푽 × 푉0 → 푽 × 푉0 and 푽 ∗ ∗ 휖∶ [휋1, 휋2] ⊗ 휋1 → 휋2 ∶ (푉0) 푽 → (푉0) 푽, the latter providing the evaluation e푽.

1.4. Indexed Categories

Indexed categories have been treated extensively in the literature, and the main ideas are long established. However, we shall refer to the recent expo- sition given in Shulman (2008, 2013), since these sources are also needed in regard to the notion of enriched indexed category. To begin with, we shall state the definition of indexed category.

Definition 1.4.1 (indexed category). An ℰ-indexed category is a pseudofunctor 풞∶ ℰ퐨퐩 → Cat, where Cat is the 2-category of categories, functors, and natural transformations.

Consider the following, notable example, which will turn out to be useful later on. Example 1.4.2. The self-indexing of ℰ is the ℰ-indexed category whose fiber over an object 푋 is the slice category ℰ/푋 and where the reindexing along 푓∶ 푋 → 푌 is given by pullback along 푓. There is a strict relation between the theory of indexed categories and that of fibration, as established by the following, classic result.

Theorem 1.4.3. An ℰ-indexed category 풞 is, via the Grothendieck construc- tion, equivalent to a cloven fibration ∫ 풞 → ℰ.

16 1.4. Indexed Categories

Now we want to extend the previous ideas to the context of monoidal cate- gories. We begin by giving the notion of indexed monoidal categories.

Definition 1.4.4 (indexed monoidal category). An ℰ-indexed monoidal cate- gory is a pseudofunctor 풲∶ ℰ퐨퐩 → MonCat, where MonCat is the 2-category of monoidal categories, strong monoidal functors, and monoidal transforma- tions.

A suitable notion of monoidal fibration is required to establish a relation with indexed monoidal categories, so we recall that in the following definition.

Definition 1.4.5 (monoidal fibration). Let 풱 be a monoidal category. A monoidal fibration is a cloven fibration 풱 → ℰ such that the underlying functor is strict monoidal (with ℰ cartesian monoidal) and the in 풱 preserves the choice of cartesian arrows.

For a general monoidal base category ℰ′ the notions of ℰ′-indexed monoidal category and of monoidal fibration do not correspond under the Grothendieck construction. Indeed, if 풲∶ ℰ′퐨퐩 → MonCat is an ℰ′-indexed monoidal cate- gory, then, in the cloven fibration ∫ 풲 → ℰ′, it is evident that ∫ 풲 has tensor products only for objects in the same fiber, and the result is still an object in that fiber. On the other hand, if 풱 → ℰ′ is a monoidal fibration, and 퐴 and 퐵 are objects of 풱 lying over the objects 푋 and 푌 of ℰ′ respectively, then ′ the tensor product 퐴 ⊗풱 퐵 lies over 푋 ⊗ℰ 푌. However, it is folklore that, in case the monodial structure on ℰ′ is given by the product, i.e. ℰ′ is cartesian monoidal, such as our ambient category ℰ is, then there is a correspondence. We now introduce some convenient notation for use in the next result.

Notation 1.4.6. Let 퐹∶ 풞 → ℰ be a cloven fibration, and 푓∶ 푋 → 푌 an arrow in ℰ.Then, call 푓 ∗ ∶ 퐹−1(푌) → 퐹−1(푋) the lifting functor from the fiber along 퐹 over 푌 to the fiber over 푋.

We then state and give a sketch proof of the theorem analogous to theo- rem 1.4.3, in the context of monoidal categories.

Theorem 1.4.7. An ℰ-indexed monoidal category 풲 is, via the Grothendieck construction, equivalent to a monoidal fibration ∫ 풲 → ℰ.

Proof (sketch). Let the pseudo-functor 풲∶ ℰ → MonCat be an index monoidal category and ∫ 풲 → ℰ the fibration yielded by the Grothendieck construc- ∫ 풲 핀 = 핀 푋 tion.Then, has a monoidal structure.Indeed, ∫ 풲 풲(ퟙℰ).Let and 푌 be objects of ℰ. Let 퐴 be an object of 풲(푋) and 퐵 one of 풲(푌). Then,

∫ 풲 ∗ 풲(푋×푌) ∗ 퐴 ⊗ 퐵 = (휋푌) 퐴 ⊗ (휋푋) 퐵

17 1. Background

where 휋푌 ∶ 푋 × 푌 → 푋 and 휋푋 ∶ 푋 × 푌 → 푌. With this monoidal structure on ∫ 풲, the fibration ∫ 풲 → ℰ is strict monoidal. Let 푉∶ 풱 → ℰ be a strict monoidal fibration and 풲∶ ℰ → Cat the pseud- ofunctor defined by the fibers of 푉.Then, 풲 is an ℰ-indexed monoidal cat- egory, that is, it restricts to 풲∶ ℰ → MonCat.Let 푋 be an object of ℰ, and ∗ !푋 ∶ 푋 → ퟙℰ the unique such arrow. Then, 핀풲(푋) = (!푋) 핀풱. Let 퐴 and 퐵 be a objects of 풲(푋). Then, 퐴 ⊗풲(푋) 퐵 = 훥∗(퐴 ⊗풱 퐵) where 훥∶ 푋 → 푋 × 푋. Notice that the proof makes essential use of the assumption that ℰ has (at least) finite products.

1.5. Externalization of Internal Categories

The next piece of background material that we present concerns the relation- ship between internal and indexed categories, and makes an essential use of the theory of indexed categories from section 1.4. Let 푨 be a category in ℰ and 푋 an object of ℰ. We regard an arrow 푋 → 퐴0 as representing an indexed family of objects of 푨 over the indexing object 푋. Given two such indexed families 푥0, 푥1 ∶ 푋 → 퐴0, consider the pullback

∗ (푥0, 푥1) 퐴1 퐴1 ⌟ 푝 (s푨,t푨)

푋 퐴0 × 퐴0. (푥0,푥1)

Then, the sections of 푝 represent indexed families of arrows of 푨 with domain 푥0 and codomain 푥1. Given another family 푥2 ∶ 푋 → 퐴0, the composition in 푨 restricts to an indexed composition ∘ ∶ (푥 , 푥 )∗퐴 × (푥 , 푥 )∗퐴 → (푥 , 푥 )∗퐴 푨|푥0,푥1,푥2 1 2 1 0 1 1 0 2 1 inducing a composition of indexed families of arrows: given two families of ∗ ∗ arrows 푠0 ∶ 푋 → (푥0, 푥1) 퐴1 and 푠1 ∶ 푋 → (푥1, 푥2) 퐴1, their composition is defined as

∘푨 (푠1,푠0) ∗ ∗ |푥0,푥1,푥2 ∗ 푠1 ∘[푨]푋 푠0 ≔ 푋 −−−−−→(푥1, 푥2) 퐴1 × (푥0, 푥1) 퐴1 −−−−−−−→(푥0, 푥2) 퐴1.

Moreover, a family of objects 푥∶ 푋 → 퐴0 induces a family of identity arrows ∗ 푋 id[푨]푋(푥)∶ 푋 → (푥, 푥) 퐴1.These data form the category [푨] of indexed families of objects and of 푨 over 푋.

18 1.5. Externalization of Internal Categories

Given a reindexing 푢∶ 푋′ → 푋, precomposition reindexes a family of objects ′ ∗ 푥∶ 푋 → 퐴0 over 푋 the family 푥푢 over 푋 ; a family of arrows 푠∶ 푋 → (푥0, 푥1) 퐴1 ∗ ′ ∗ is reindexed to 푢 푠∶ 푋 → (푢푥0, 푢푥1) 퐴1 by pulling back the section 푠 along ∗ 푋 푋′ (푥0, 푥1). That gives a functor 푢 ∶ [푨] → [푨] . The above discussion leads to the following result. Proposition 1.5.1. For 푨 an internal category in ℰ, there is an indexed category [푨] given by [푨](푋) ≔ [푨]푋 and [푨](푢) ≔ 푢∗. Remark 1.5.2. Notice that the indexed category arising from an internal one is given by a strict (rather than merely a pseudo) functor ℰ퐨퐩 → Cat.Then, evidently, internal categories yield rather special indexed categories, and not all indexed categories can be obtained from an internal one. Moreover, the construction extends to the monoidal context, as shown in the following proposition. Proposition 1.5.3. Let 푽 be an internal (symmetric) monoidal category in ℰ. Then, [푽] is an indexed (symmetric) monoidal category on ℰ. Proof. Let 푋 be an object in ℰ.Then, [푽]푋 has a monoidal structure induced by that of 푽. The monoidal product on objects is defined as

′ ′ ⊗푽 푥 [푽]푋 푥 (푥,푥 ) (푋 −→푉0) ⊗ (푋 −→푉0) ≔ 푋 −−−−→푉0 × 푉0 −−→푉0.

Let ∗ 푥0 푓∶ 푋→(푥0,푥1) 푉1 푥1 (푋 −→푉0) −−−−−−−−−−−−→(푋 −→푉0) and ′ ′ ′ ′ ∗ ′ 푥0 푓 ∶ 푋→(푥0,푥1) 푉1 푥1 (푋 −→푉0) −−−−−−−−−−−−→(푋 −→푉0) be arrows of [푽]푋, and notice that ⊗푽 restricts to

∗ ′ ′ ∗ [푽]푋 ′ [푽]푋 ′ ∗ (푥0, 푥1) 푉1 × (푥0, 푥1) 푉1 → (푥0 ⊗ 푥0, 푥1 ⊗ 푥1) 푉1.

푋 Then, the monoidal product of arrows 푓 ⊗[푽] 푓 ′ is given by the arrow

′ ⊗푽 (푓 ,푓 ) ∗ ′ ′ ∗ 푽 ′ 푽 ′ ∗ 푋 −−−−→(푥0, 푥1) 푉1 × (푥0, 푥1) 푉1 −−→(푥0 ⊗ 푥0, 푥1 ⊗ 푥1) 푉1.

The monoidal unit 핀[푽]푋 is defined by the constant family indexed by 푋 on the monoidal unit of 푽. The structural isomorphisms, associator and unitors (and, in case 푽 is symmetric, the symmetry), are defined point-wise. Moreover, reindexing preserves the monoidal product.

19 1. Background

Remark 1.5.4. The strictness of the monoidal products of the fibers of the indexed monoidal category [푽] obtained from an internal monoidal category 푽 is the same as that of the original monoidal product of 푽, so it will generally not be strict monoidal. Still, the reindexing functors for [푽] strictly preserve the monoidal structure, regardless of how strict the monoidal product of 푽 is.That means that the (actually strict) functor [푽] ∶ ℰ → MonCat factorizes through the 2-category of (non-necessarily-strict) monoidal categories, strict monoidal functors and monoidal natural transformations. Such a category is quite uncommon, since normally there is little use for strict monoidal functors, especially between non-strict monoidal categories. Nonetheless, this shows that the indexed monoidal categories arising from internal monoidal categories are rather special ones. Remark 1.5.5. The fiber [푨]푋 over an object 푋 is enriched over ℰ/푋: ∗ 푝 Homset: Hom[푨]푋(푥0, 푥1) ≔ (푥0, 푥1) 퐴1 −→푋.

Composition: ∘ 푋(푥 , 푥 , 푥 ) ≔ ∘ . [푨] 0 1 2 푨|푥0,푥1,푥2

Identity: id[푨]푋(푥). Reindexing is compatible with this structure, in that the reindexing of the homset is the same as the homset of the reindexing. More explicitly, given a reindexing 푢∶ 푋′ → 푋, by pullback-pasting we have that

∗ ∗ ∗ 푢 (푥0, 푥1) 퐴1 ≅ (푥0푢, 푥1푢) 퐴1.

′ In fact, the reindexing functor 푢∗ ∶ [푨]푋 → [푨]푋 is a fully-faithful functor of enriched categories. Then, [푨] is an indexed enriched category over the self-indexing of ℰ (see example 1.4.2). Equivalently, it is the locally internal category over ℰ whose underlying indexed category is (up to natural isomorphism) [푨] as an indexed category (Johnstone 2002; Shulman 2013). As shown in section 1.4, indexed (monoidal) categories are equivalent to cloven (monoidal) fibration. Definition 1.5.6 (externalization). The externalization of an internal category 푨 is the total category for the fibration associated to the indexed category [푨]. With abuse of notation, we denote the externalization of 푨 with [푨], and context will usually suffice to distinguish between the use of the notation as a fibration or as an indexed category. Explicitly, the externalization of 푨 is the category given by the data Objects: families of objects of 푨 indexed over objects of ℰ, that is, arrows 푋 → 퐴0 with 푋 in ℰ.

20 1.5. Externalization of Internal Categories

Morphisms: an arrow (푥∶ 푋 → 퐴0) → (푦∶ 푌 → 퐴0) is given by a reindexing 푢∶ 푋 → 푌 and a family of arrows 푥 → 푦푢, that is, a section of the projection ∗ 푝∶ (푥, 푦푢) 퐴1 → 푋.

Composition: the composition is given by

푓 푔 푢 ∗ 푣 ∗ 푥 (푋−→푌,푋−→(푥,푦푢) 퐴1) 푦 (푌−→푍,푌−→(푦,푧푣) 퐴1) 푧 (푋 −→퐴0) −−−−−−−−−−−−−−−−→(푌 −→퐴0) −−−−−−−−−−−−−−−−→(푍 −→퐴0) 푢 푣 (푋−→푌−→푍,푢∗푔∘ 푓∶ 푋→(푥,푧푣푢)∗퐴 ) 푥 [푨]푋 1 푧 ≔ (푋 −→퐴0) −−−−−−−−−−−−−−−−−−−−−−−−−−−→(푍 −→퐴0).

Identity: the family of identity arrows.

Let 퐹∶ 푨 → 푩 be a functor of internal categories.Then, there is a functor of fibered categories [퐹] ∶ [푨] → [푩] defined on objects as

푥 푥 퐹0 [퐹](푋 −→퐴0) ≔ 푋 −→퐴0 −−→퐵0 and on morphisms as

푓 푢 ∗ 푥 (푋−→푌,푋−→(푥,푦푢) 퐴1) 푦 [퐹]((푋 −→퐴0) −−−−−−−−−−−−−−−−→(푌 −→퐴0)) 푓 퐹 푢 ∗ 1 ∗ (푋−→푌,푋−→(푥,푦푢) 퐴1−−→(퐹0푥,퐹0푦푢) 퐵1) 푥 퐹0 푦 퐹0 ≔ (푋 −→퐴0 −−→퐵0) −−−−−−−−−−−−−−−−−−−−−−−−−−−−−−→(푌 −→퐴0 −−→퐵0) which restricts to a functor on the fibers [퐹]푋 ∶ [푨]푋 → [푩]푋. Let 훼∶ 퐹 → 퐺∶ 푨 → 푩 be a natural transformation.Then, there is a natural transformation of fibered categories [훼] ∶ [퐹] → [퐺] ∶ [푨] → [푩], defined as

푥 훼 ∗ 푥 푥 퐹0 (id푋,푋−→퐴0−→(퐹0푥,퐺0푥) 퐵1) 푥 퐺0 [훼](푋 −→퐴0) ≔ (푋 −→퐴0 −−→퐵0) −−−−−−−−−−−−−−−−−−−−−→(푋 −→퐴0 −−→퐵0) which restricts to a natural transformation on the fibers [훼]푋 ∶ [퐹]푋 → [퐺]푋. Remark 1.5.7. If 푽 is a (symmetric) monoidal category, then its externalization [푽] has a (symmetric) monoidal structure induced by that of the indexed (symmetric) monoidal category [푽].The monoidal product on objects is given by ⊗푽 푥 [푽] 푦 푥×푦 (푋 −→푉0) ⊗ (푌 −→푉0) ≔ 푋 × 푌 −−→푉0 × 푉0 −−→푉0. The monoidal product on arrows

푓 푢 ∗ 푥 (푋−→푌,푋−→(푥,푦푢) 푉1) 푦 (푋 −→푉0) −−−−−−−−−−−−−−−−→(푌 −→푉0)

21 1. Background and 푔 푣 ∗ 푧 (푍−→푊,푍−→(푧,푤푣) 푉1) 푤 (푍 −→푉0) −−−−−−−−−−−−−−−−−→(푊 −→푉0)

푢×푣 is indexed by 푋 × 푍 −−−→푌 × 푊 and given by

푓⊗푽푔 푽 푽 ∗ 푋 × 푍 −−−→(푥 ⊗ 푧, 푦푢 ⊗ 푤푣) 푉1.

The monoidal unit is 핀푽 ∶ ퟙℰ → 푉0. Finally, the structural isomorphisms are induced by those of 푽.

1.6. Indexed Enriched Categories

Now that we have—at least for ℰ with products—a notion of indexed monoidal category, we give, as the last piece of background material, the notion of enrichment in such a category. This comes in two versions: a general indexed version and a version which we call “small” (Shulman 2013). The latter is in a sense a hybrid notion, having an internal as well as an indexed aspect. The force of the definition will be clear in chapter 3, after we have (in the next section) treated the relationship between internal and indexed categories. In this section, let 풲 be an ℰ-indexed monoidal category. Let’s introduce a convenient notation for use in the next definition.

Notation 1.6.1. If 푓∶ 퐵 → 퐴 is a morphism in ℰ and 퐻 is an object in 풲(퐴), let’s write 퐻(푓 ) for the object 풲(푓 )(퐻) of 풲(퐵).

First we give an outline of the definitions of the notions of small 풲-category, of functors between such categories, and of natural transformations between such functors. For brevity we will omit some diagrammatic axioms. We refer to Shulman (ibid.) for those.

Definition 1.6.2 (small 풲-category). A small 풲-category 풜 consists of • an object 퐴 of ℰ;

• an object Hom풜 of 풲(퐴 × 퐴);

• a morphism id풜 ∶ 핀풲(퐴) → Hom풜(훥) where 훥∶ 퐴 → 퐴 × 퐴 is the diagonal;

• A morphism of 풲(퐴 × 퐴 × 퐴)

풲(퐴×퐴×퐴) ∘풜 ∶ Hom풜(휋2, 휋3) ⊗ Hom풜(휋1, 휋2) → Hom풜(휋1, 휋2)

where 휋1, 휋2, 휋3 ∶ 퐴 × 퐴 × 퐴 → 퐴 are projections.

22 1.6. Indexed Enriched Categories satisfying the associativity and unitarity axioms (ibid.). Definition 1.6.3 (functor of small 풲-categories). A functor of small 풲- categories 퐹∶ 풜 → ℬ consists of

• a morphism 퐹0 ∶ 퐴 → 퐵 of ℰ;

• a morphism 퐹1 ∶ Hom풜 → Homℬ(퐹0, 퐹0) of 풲(퐴 × 퐴); satisfying the functoriality axioms (ibid.). Definition 1.6.4 (natural transformation of small 풲-categories). A natu- ral transformation of small 풲-categories 훼∶ 퐹 → 퐺∶ 풜 → ℬ consists of a morphism 훼∶ 핀풲(퐴) → Homℬ((퐹0, 퐺0)훥) satisfying a naturality axiom. Let’s introduce some convenient notations for use in the next definition. Notation 1.6.5. Let 풱 and 풱′ be monoidal categories. If 퐹∶ 풱 → 풱′ is a lax monoidal functor and 풜 is a 풱-enriched category, then there is an induced ′ 풱 -enriched category 퐹•(풜). Moreover, if 퐹 is a closed monoidal functor (with 풱 and 풱′ closed monoidal), then in particular there is a fully faithful ′ ′ 풱 -functor 퐹• ∶ 퐹•(풱) → 풱 . Now we present the hopefully more familiar definition of a general indexed category enriched in an indexed monoidal category (ibid.). Definition 1.6.6 (indexed 풲-category). An indexed 풲-category ℬ consists of • for each 푋 object of ℰ, a 풲(푋)-category ℬ푋; ∗ ∗ 푌 푋 • for each 푓∶ 푋 → 푌 in ℰ, a fully faithful 풲(푋)-functor 푓 ∶ (푓 )•(ℬ ) → ℬ ; • for each 푓∶ 푋 → 푌 and 푔∶ 푌 → 푍 in ℰ, a 풲(푋)-natural isomorphism ∗ ∗ ∗ ∗ 푍 (푔푓 ) ≅ 푓 ∘ (푓 )•(푔) (where we implicitly identify (푓 )•(푔 )•ℬ with ∗ 푍 (푔푓 )•ℬ in the domains of these functors); ∗ • for each 푋 object of ℰ, a 풲(푋)-natural isomorphism (id푋) ≅ idℬ푋; satisfying, for every 푓∶ 푋 → 푌, 푔∶ 푌 → 푍 and ℎ∶ 푍 → 퐾 in ℰ, the axioms for associativity and unitarity, analogous to those for ordinary indexed categories, by making the following diagrams of isomorphisms commute. ∗ ∗ ∗ ∗ (ℎ푔푓 ) 푓 ∘ (푓 )•((ℎ푔) )

∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ (푔푓 ) ∘ ((푔푓 ) )•(ℎ ) 푓 ∘ (푓 )•(푔 ∘ (푔 )•(ℎ ))

∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ 푓 ∘ (푓 )•(푔 ) ∘ ((푔푓 ) )•(ℎ ) 푓 ∘ (푓 )•(푔 ) ∘ (푓 )•(푔 )•(ℎ )

23 1. Background

∗ ∗ ∗ 푓 ∗ ∘ (푓 ∗) (( )∗) (id풳) ∘ ((id풳) )•(푓 ) • id풴

∗ ∗ ∗ ∗ (푓id풳) 푓 (id풴푓 ) 푓

Definition 1.6.7 (functor of indexed 풲-categories). An indexed 풲-functor ℱ∶ ℬ → ℬ′ consists, for every object 푋 of ℰ, of a 풲(푋)-enriched functor 푋 ℱ푋 ∶ ℬ푋 → ℬ′ together with, for every 푓∶ 푋 → 푌, an isomorphism ℱ푋 ∘ 푓 ∗ ≅ ∗ ∗ 푌 푓 ∘ (푓 )•(ℱ ). Such data have to satisfy the functoriality axioms by making the following diagrams of isomorphisms commute, for every 푓∶ 푋 → 푌 and 푔∶ 푌 → 푍 in ℰ.

퐼 ∗ 푋 ∗ ∗ ∗ ℱ ∘ (푔푓 ) ℱ ∘ 푓 ∘ (푓 )•(푔 )

∗ ∗ 푍 ∗ ∗ 푌 ∗ ∗ (푔푓 ) ∘ ((푔푓 ) )•(ℱ ) 푓 ∘ (푓 )•(ℱ ) ∘ (푓 )•(푔 )

∗ ∗ ∗ ∗ ∗ 푍 ∗ ∗ 푌 ∗ 푓 ∘ (푓 )•(푔 ) ∘ (푓 )•((푔 )•(ℱ )) 푓 ∘ (푓 )•(ℱ ∘ 푔 )

∗ ∗ ∗ ∗ 푍 푓 ∘ (푓 )•(푔 ∘ (푔 )•(ℱ ))

푋 ∗ ∗ ∗ 푋 ℱ ∘ (id풳) (id풳) ∘ ((id풳) )•(ℱ )

ℱ푋

Definition 1.6.8 (natural transformation of indexed 풲-categories). An in- dexed 풲-natural transformation 훼∶ ℱ → 풢∶ ℬ → ℬ′ consists, for every 푋 object 푋 of ℰ, of a 풲(푋)-natural transformation 훼푋 ∶ ℱ푋 → 풢푋 ∶ ℬ푋 → ℬ′ , satisfying naturality axioms by making the following diagram commute, for every 푓∶ 푋 → 푌. 푋 ∗ ∗ ∗ 푌 ℱ ∘ 푓 푓 ∘ (푓 )•(ℱ )

푋 ∗ ∗ ∗ 푌 ℱ ∘ 푓 푓 ∘ (푓 )•(ℱ )

With the data thus defined (plus the obvious notions of compositions and identities) we can define a 2-category of indexed enriched categories.

24 1.6. Indexed Enriched Categories

Definition 1.6.9 (category of indexed 풲-categories). We denote with 풲ICatℰ the 2-category of indexed 풲-categories, their functors and the natural trans- formations between them.

By abuse of notation, we shall denote with 풲ICatℰ also the mere 1-category of indexed 풲-categories and their functors. Usually, the context is sufficient to distinguish when the notation is being used referring to the 1-category or the 2-category. Finally, we briefly mention how to change the indexed monoidal category in which we are enriching. Such operation, fundamental for every flavor of enriched category theory, is called change of cosmos. For more details, we refer to Shulman 2013. First, we define the transformation between indexed monoidal categories.

Definition 1.6.10 (lax monoidal morphism). If 풲 is an ℰ-indexed monoidal category, and 풲′ is an ℰ′-indexed monoidal category, then a lax monoidal morphism 휙∶ 풲 → 풲′ is a commutative square

휙 ∫ 풲 ∫ 풲′

ℰ ℰ′ 휙 such that 휙∶ ℰ → ℰ′ preserves finite products and 휙∶ ∫ 풲 → ∫ 풲′ is lax monoidal and preserves cartesian arrows.

If 휙∶ 풲 → 풲′ is a lax monoidal morphism, there are induced operations ′ 휙• from small and indexed 풲-categories to the corresponding sort of 풲 - categories, and similarly for functors, and natural transformations.

25

2. Completeness of Internal Categories

The aim of this dissertation is to develop a form of enriched category theory internal to a suitable ambient category ℰ. What is perhaps unexpected in our theory is that we seek enriching categories within ℰ that are complete. Of course, when ℰ is the , there are relatively few small complete categories in which we can usefully enrich: essentially, they are all quantales. However, there are small complete internal categories within categories pro- vided by realizability, such as the category of modest sets within the category of assemblies (Hyland 1988). As in the usual theory of enriched categories (Kelly 1982), two kinds of completeness play a role in the theory: first, there is the completeness of the enriching category; secondly, the completeness of the enriched categories.The main focus of the dissertation is on the second notion, which is part of the theory of internal enriched categories. However, to set the stage for that, we have to consider the first notion. So, we need some preliminaries on complete internal categories. Sadly, the existing literature on internal complete categories is sparse.The paper Hyland 1988, which presents a leading example, gives a sketch of how the theory might develop.The more or less contemporaneous paper Hyland, Robinson, and Rosolini 1990 discusses the definitions in light of a perspective suggested by Freyd, but its main focus is on weak notions of completeness which play no role in this dissertation. The basic idea is that one has a weak limit when it is internally true that there exists a limit cone for the given diagram, while the limit is strong when the choice of limit cone is given as part of the structure. In this dissertation, though, we are not assuming that the internal logic of our ambient category features existential quantification, so the notion of weak limit is not even applicable. As completeness of the enriching category is fundamental to the theory we develop, we have decided to adopt and clarify the definition of strong complete- ness given in ibid. Evidently, the use of the internal logic in ibid. is intended to ensure that the property of being a limit cone is stable under pullback. Although that makes the definition of completeness very concise, it also obfus- cates its content. Instead, we will present the notion in a more explicit way, by avoiding the use of the internal language. In this chapter ℰ shall be a finitely complete, locally cartesian closed category.

27 2. Completeness of Internal Categories

As a consequence, the internal language is now a dependent type theory (Seely 1984). In particular, these assumptions are necessary to ensure that the notions we are going to define will be stable under pullback, which in turn is necessary if we want them to be meaningful in the internal language.

2.1. Diagrams and Cones

As obvious as they might seem, we shall spell out the definitions of diagrams and cones over diagrams in the internal context.

Definition 2.1.1 (diagram). Let 푨 and 푫 be internal categories in ℰ. A diagram of shape 푫 in 푨 is an internal functor 퐷∶ 푫 → 푨. 퐷∶ 푫 → 푨 푇∶ ퟙ → Definition 2.1.2 (cone). A cone over a diagram with vertex Catℰ 푨 훾∶ 훥푇 → ⌜퐷⌝∶ ퟙ → [푫, 푨] 훥∶ 푨 → is a natural transformation Catℰ , where [푫, 푨] is the . The situation is shown in the following diagram.

ퟙ ퟙ Catℰ Catℰ 훾 푇 ⌜퐷⌝ 푨 [푫, 푨] 훥

훾 ∶ 푇 훥 → ⌜퐷⌝∶ ퟙ → [푫, 푨] 푖 = 0, 1 Let 푖 푖 Catℰ for be two cones over the 퐷∶ 푫 → 푨 푇 ∶ ퟙ → 푨 diagram with tips 푖 Catℰ respectively. A morphism of cones ℎ∶ 훾0 → 훾1 is given by a natural transformation ℎ∶ 푇0 → 푇1 such that 훾1 ∘ (훥 ∗ ℎ) = 훾0, as represented in the following diagram.

ퟙ ퟙ ퟙ ퟙ Catℰ Catℰ Catℰ Catℰ 푇0 푇1 ℎ = 훾0 ⌜퐷⌝ 푇0 ⌜퐷⌝ 훾1 푨 [푫, 푨] 푨 [푫, 푨] 훥 훥

Dually, we can give the definition of cocone (which we sum up, but all the considerations from the definition of cones apply).

Definition 2.1.3 (cocone). A cocone over a diagram 퐷∶ 푫 → 푨 with vertex 푇∶ ퟙ → 푨 훾∶ ⌜퐷⌝ → 훥푇∶ ퟙ → [푫, 푨] Catℰ is a natural transformation Catℰ . Let 퐼 be an object of ℰ, to be intended as an indexing object. We know ∗ from remark 1.1.4 that there are two adjunctions, 퐼! ⊣ 퐼 ∶ ℰ → ℰ/퐼 and ∗ ∗ 퐼! ⊣ 퐼 ∶ Catℰ → Catℰ/퐼. Moreover, the canonical morphism 푖∶ 퐼 [푫, 푨] → [퐼∗푫, 퐼∗푨] is an isomorphism because ℰ is locally cartesian closed.Then,

28 2.1. Diagrams and Cones given a diagram 퐷∶ 푫 → 푨, we get a diagram 퐼∗퐷∶ 퐼∗푫 → 퐼∗푨, and, given a cone ퟙ ퟙ Catℰ Catℰ 훾 푇 ⌜퐷⌝ 푨 [푫, 푨] 훥 over 퐷, we get a cone

ퟙ ퟙ ∗ Catℰ/퐼 Catℰ/퐼 ⌜퐼 퐷⌝ 푖∗퐼∗훾 퐼∗푇 퐼∗⌜퐷⌝ 퐼∗푨 퐼∗[푫, 푨] [퐼∗푫, 퐼∗푨] 퐼∗훥 푖 훥 over 퐼∗퐷. Notice that 퐼∗ preserves the terminal object, 푖 ∘ 퐼∗⌜퐷⌝ = ⌜퐼∗퐷⌝ and ∗ ∗ 푖 ∘ 퐼 훥 = 훥. Then, we have a functor 퐼 ∶ Cone퐷 → Cone퐼∗퐷. It is worth noting that the previous notions are all internal, in the sense that they can be expressed by the internal language of ℰ.The internal category of cones over a diagram 퐷∶ 푫 → 푨 is given by the lax pullback

Cone퐷 ퟙ ⌟ Catℰ ⌜퐷⌝ . 푨 [푫, 푨] 훥

Then, the category of points of Cone퐷 is the external category of cones over 퐷 and their transformtions; in particular, any cone (푇, 훾) over 퐷 corresponds (푇, 훾)∶ ퟙ → 퐼 uniquely to a global sections Catℰ Cone퐷. Moreover, if is an object of ℰ, an 퐼-indexed family of cones over 퐷 is given by a 2-cell 푰 ퟙ Catℰ 훾 푇 ⌜퐷⌝ (2.1) 푨 [푫, 푨] 훥 푰 퐼 퐼∗ퟙ 퐼 where is ! Catℰ (intuitively, the discrete category over the object ). Analo- gously, the category of all cones of shape 푫 over 푨 is given by the lax pullback

Cone푫 [푫, 푨] ⌟ .

푨 [푫, 푨] 훥

29 2. Completeness of Internal Categories

Dually, the internal category of cocones over a diagram 퐷∶ 푫 → 푨 is given by the lax pullback

CoCone퐷 ퟙ ⌟ Catℰ ⌜퐷⌝ . 푨 [푫, 푨] 훥

2.2. Limits

As usual, we call universal a cone that is a terminal object in the category of cones over the given diagrams.Though, we have to be careful about which category of cones we are talking about, and what it means to be terminal in it. Since our definition aims to be internal in essence, what we want is a terminal object, as defined by the internal language, in the internal category of cones. That is more than a terminal object in the external category of cones: there, stability under pullback has to be enforced, thus realizing the intuition that, ∗ if lim퐷 is a limit for a diagram 퐷∶ 푫 → 푨 and 퐼 is an object of ℰ, then 퐼 lim퐷 should be a limit for 퐼∗퐷.

Definition 2.2.1 (universal cone/limit). A cone (푇, 훾) over a diagram 퐷∶ 푫 → 푨 is universal if it is internally a terminal object for Cone퐷; that means that, for every object 퐼 of ℰ, the cone 퐼∗(푇, 훾) over 퐼∗퐷 is a terminal object in the external category of cones over 퐼∗퐷.The vertex of a universal cone over 퐷 is also called the limit of 퐷.

Dually, we give the definitions of universal cocone and colimit.

Definition 2.2.2 (universal cocone/colimit). A cocone (푇, 훾) over a diagram 퐷∶ 푫 → 푨 is universal if it is internally an initial object for CoCone퐷; that means that, for every object 퐼 of ℰ, the cocone 퐼∗(푇, 훾) over 퐼∗퐷 is an initial object in the external category of cocones over 퐼∗퐷.The vertex of a universal cocone over 퐷 is also called the colimit of 퐷.

It is inconvenient that stability needs to be imposed, but such is the price of doing everything concretely, without relying on the internal logic. However, once the definition has been stabilized, we get all the desired consequences of an internal definition. For example, the does not merely hold for cones, but for indexed families of cones as well: that is to say the universal quantifier for all cones has the expected property. Indeed, let 퐷∶ 푫 → 푨 be a diagram admitting a limit (lim퐷, 휋).Then, if 퐼 is

30 2.2. Limits an object of ℰ, consider an 퐼-indexed family of cones

푰 ퟙ Catℰ 훾 푇 ⌜퐷⌝ . (2.2) 푨 [푫, 푨] 훥

By applying 퐼∗ and the properties of the adjunction, we get

ퟙ ퟙ Catℰ/퐼 Catℰ/퐼 휂(ퟙ ) Catℰ/퐼

퐼∗푰 ퟙ ∗ Catℰ/퐼 ⌜퐼 퐷⌝ ∗ ∗ 퐼 훾 퐼 푇 퐼∗⌜퐷⌝ 퐼∗푨 퐼∗[푫, 푨] [퐼∗푫, 퐼∗푨] 퐼∗훥 푖 훥 which is a cone over 퐼∗퐷.Let’s call 푇̄ = 퐼∗푇 ∘ 휂(ퟙ) and ̄훾 = 푖 ∗ 훾 ∗ 휂(ퟙ).Then, ̄ ∗ by the universal property, there exists a unique ℎ∶ 푇 → 퐼 lim퐷 such that the above diagram is equal to

ퟙ ퟙ ∗ Catℰ/퐼 Catℰ/퐼 ⌜퐼 퐷⌝ ∗ 푇̄ 퐼 lim퐷 ℎ . 퐼∗⌜퐷⌝ 퐼∗휋 퐼∗푨 퐼∗[푫, 푨] [퐼∗푫, 퐼∗푨] 퐼∗훥 푖

On both squares, cancel the whiskering with 푖, which is possible because 푖 is an isomorphism as ℰ is locally cartesian closed. Apply 퐼! to the two squares ̄ and then compose with the counit 휖; let ℎ be 휖(푨) ∗ 퐼!ℎ. Then, we get that the square (2.2) is equal to

푰 ! ퟙ ퟙ Catℰ Catℰ

ℎ̄ 휋 푇 lim퐷 ⌜퐷⌝ 푨 [푫, 푨] 훥 thus showing that even families of cones factorize through the limit.

31 2. Completeness of Internal Categories

Moreover, any cone (푇, 훾) over 퐷 corresponds uniquely to a global sections (푇, 훾)∶ ퟙ → Catℰ Cone퐷, and a cone is a limit if it is understood in the internal logic as a terminal object for Cone퐷. Again, it is essential that the notion is stable under pullback, or it could not be expressed in the internal language. Then, that of limit is a notion in the internal logic, and that allows us to use the internal logic to argue about it.

2.3. Completeness

While completeness generally means to “just” have limits for all diagrams, in the internal setting the treatment of the notion requires special care.The category of diagrams of shape 푫 over 푨 is evidently the [푫, 푨], and the notion of functor category is stable under pullback.Then, we may wish to say, in the internal language, that every such diagram has a limit cone. However, limits are determined only up to (unique) isomorphism, and we have no non-unique existential quantifier in the logic of a cartesian closed category (this issue could be partially circumvented by treating completeness as a structure rather than a property, and requiring a functorial choice of limits on the internal category of diagrams). Even more limiting, while we have a category of diagrams of a certain shape, there is no category of diagrams of any shape. Thus, completeness cannot be a purely internal notion. From an external perspective, it would look natural to call an (internal) category complete if every diagram over it admits a limit. Again, it is necessary to reconsider this intuition as the resulting notion would not be stable under pullback.Indeed, even if every diagram over a category 푨 admits a limit, it is still possible that not every diagram over 퐼∗푨 does, for some indexing object 퐼.

Definition 2.3.1 (completeness). An internal category 푨 in ℰ is (strongly) complete if, for every object 퐼 of ℰ, every diagram over 퐼∗푨 admits a limit.

At this point, it is necessary to find out whether such definition of complete- ness admits non-trivial examples.The first place to look into is the category of sets. Example 2.3.2. The internal complete categories in Set coincide with (the categories associate to) complete lattices. Thus, the internal complete categories in Set are precisely the small complete categories.That means that the notion of internal completeness is compatible with the standard one, as it should be. While the examples in the category of sets are legitimate, they are a bit disappointing: there are no small complete categories other than lattices. Fortunately, and somewhat surprisingly, there are remarkable examples in

32 2.3. Completeness other ambient categories. Maybe the most famous of these is the internal cat- egory of the Modest Sets in the Category of Assemblies (Hyland 1988; Hyland, Robinson, and Rosolini 1990). Such example is presented in section 5.2. The dual notion of cocompleteness is as one would expect. Definition 2.3.3 (cocompleteness). An internal category 푨 in ℰ is (strongly) cocomplete if, for every object 퐼 of ℰ, every diagram over 퐼∗푨 admits a colimit. A complete category has all indexed limits, and the object of diagrams of a certain shape over it is a suitable indexing object. Following this intuition, we can produce a functorial choice of limits in the form of a right adjoint to the di- agonal functor. This shows some interesting facts. Firstly, that there exists an internal, uniform (as in functorial) choice of limits, as opposed to the external choice required by the definition of internal completeness. Secondly, that our definition of completeness is consistent with the well-known characterization of completeness via adjunctions. Finally, that the limit-choice functor comes for free from the definition of completeness, whereas, for standard categories, that would generally require the use of the axiom of choice. It is worth remark- ing that the choice functor can only be defined over the object of diagrams of a given shape, as there is no internal object of all diagrams of any shape. Proposition 2.3.4. If 푨 is a complete internal category in ℰ, then for any internal category 푫 in ℰ there is an internal functor lim푫 ∶ [푫, 푨] → 푨 which is right adjoint to the diagonal functor 훥∶ 푨 → [푫, 푨].

Proof. The first step is to define the functor lim푫. We shall define the object and arrow components separately, each by using the definition of limit for a suitable diagram, in a suitable slice of 퐸. To define the object component of lim푫, consider Fun(푫, 푨) as the indexing object. There is a diagram 휖∶ Fun(푫, 푨)∗푫 → Fun(푫, 푨)∗푨 in Catℰ/Fun(푫, 푨), defined as

퐹∶ Fun(푫, 푨), 푑∶ 퐷0 ⊢ 휖0(퐹, 푑) ≔ (퐹, eℰ(퐹0, 푑)) 퐹∶ Fun(푫, 푨), 푓∶ 퐷1 ⊢ 휖1(퐹, 푓 ) ≔ (퐹, eℰ(퐹1, 푓 )). Then, the diagram has a limit given by (lim ) ∶ ퟙ → Fun(푫, 푨)∗푨, 푫 0 Catℰ/Fun(푫, 푨) corresponding to an arrow (lim푫)0 ∶ Fun(푫, 푨) → 퐴0 yielding the object component of lim푫. We also get the universal cone, let it be the natural transformation ∗ ∗ 휋∶ (lim푫)0! → 휖∶ Fun(푫, 푨) 푫 → Fun(푫, 푨) 푨.

33 2. Completeness of Internal Categories

To define the arrow component of lim푫, consider Nat(푫, 푨) as the indexing ∗ ∗ object. There are diagrams 휖s, 휖t ∶ Nat(푫, 푨) 푫 → Nat(푫, 푨) 푨 in Catℰ/Nat(푫, 푨), defined as (훼∶ 퐹 → 퐺)∶ (푫, 푨), 푑∶ 퐷 ⊢ (휖 ) (훼, 푑) ≔ (훼, (퐹 , 푑)) Nat 0 s 0 eℰ 0 (훼∶ 퐹 → 퐺)∶ (푫, 푨), 푓∶ 퐷 ⊢ (휖 ) (훼, 푓 ) ≔ (훼, (퐹 , 푓 )) Nat 1 s 1 eℰ 1 and (훼∶ 퐹 → 퐺)∶ (푫, 푨), 푑∶ 퐷 ⊢ (휖 ) (훼, 푑) ≔ (훼, (퐺 , 푑)) Nat 0 t 0 eℰ 0 (훼∶ 퐹 → 퐺)∶ (푫, 푨), 푓∶ 퐷 ⊢ (휖 ) (훼, 푓 ) ≔ (훼, (퐺 , 푓 )), Nat 1 t 1 eℰ 1 and there is also a natural transformation ̄휖∶ 휖s → 휖t defined as

(훼∶ 퐹 → 퐺)∶ Nat(푫, 푨), 푑∶ 퐷0 ⊢ ̄휖(훼, 푑) ≔ (훼, eℰ(훼, 푑)).

Then, the diagram 휖t has a limit given by 퐿∶ ퟙ → Nat(푫, 푨)∗푨, Catℰ/Nat(푫, 푨) corresponding to an arrow 퐿∶ Nat(푫, 푨) → 퐴0, and a universal cone ∗ ∗ 푝∶ 퐿! → 휖t ∶ Nat(푫, 푨) 푫 → Nat(푫, 푨) 푨.

Observe that, in context 푑∶ 퐷0, (훼∶ 퐹 → 퐺)∶ Nat(푫, 푨), we have 퐿(훼) = (lim ) (퐺) and 푝(훼, 푑) = 휋(퐺, 푑). Consider 퐿′ ∶ ퟙ → Nat(푫, 푨)∗푨 푫 0 Catℰ/Nat(푫, 푨) ′ ′ ′ given by 퐿 (훼) ≔ (lim푫)0(퐹), and the natural transformations 푝 ∶ 퐿 ! → 휖s defined as ′ 휋(퐹,푑) 푝 (훼, 푑) ≔ (훼, (lim푫)0(퐹) −−−−−→휖(퐹, 푑)). ″ ′ Let 푝 ≔ 푝̄휖 ∶ 퐿! → 휖t. Then, by the universal property of the limit, there is a unique natural transformation (lim ) ∶ 퐿′ → 퐿∶ ퟙ → Nat(푫, 푨)∗푨 푫 1 Catℰ/Nat(푫, 푨) ″ such that 푝 = 푝(lim푫)1 and whose underlying arrow in ℰ is a morphism (lim푫)1 ∶ Nat(푫, 푨) → 퐴1. That yields the arrow component of lim푫. We shall now give the unit and counit for the adjunction 훥 ⊣ lim푫. Define the unit 휂∶ id(푨) → lim푫 훥∶ 푨 → 푨 as the unique natural isomorphism yielded by the universal property of the limit. Define the counit 휇∶ 훥 lim푫 → id([푫, 푨]) as the natural transformation induced by the universal cone 휋, which can be regarded as an arrow Fun(푫, 푨) → Nat(푫, 푨).That is natural because, ″ in context (훼∶ 퐹 → 퐺)∶ Nat(푫, 푨) and 푑∶ 퐷0, the equation 푝 = 푝(lim푫)1 implies that the square 휋(퐹,푑) (lim푫)0(퐹) 휖(퐹, 푑) = eℰ(퐹0, 푑)

(lim푫)1(훼) eℰ(훼,푑) 휋(퐺,푑) (lim푫)0(퐺) 휖(퐺, 푑) = eℰ(퐺0, 푑)

34 2.3. Completeness commutes. These data yield the required adjunction.

Together, the functor lim푫 and the counit of the adjunction 훥 lim푫 → id[푫,푨] induce an internal functor [푫, 푨] → Cone푫 which is a right adjoint of the projection 푝∶ Cone푫 → [푫, 푨]. Likewise, we could produce the functor lim푫 from the right adjoint of 푝.In other words, the two formulations of a limit functor in terms of a right adjoint to 푝∶ Cone푫 → [푫, 푨] and in terms of a right adjoint to 훥∶ 푨 → [푫, 푨] are equivalent. Such equivalence is just a matter of routine 2-category-theory calculations. Notice that the limit functor is stable under pullback, as it is the right adjoint of the diagonal functor, which is a stable notion in a locally cartesian closed ∗ category. More precisely, 퐼 lim푫 ≅ lim퐼∗푫 ∶ 푨 → [푫, 푨] for every indexing object 퐼 of ℰ. The strength of the notion of internal completeness is constrained by the shapes of the diagrams we can build in ℰ. For example, if ℰ doesn’t have a ퟙ + ퟙ, we are unable to build a diagram with a pair of objects.That means that an internal category may in principle be complete, but not have binary products. Even more strikingly, if ℰ does not have an initial object, we are unable to build the degenerate diagram having the terminal object as its limit. Fortunately, it is possible to express the concepts of terminal object, internal binary product and equalizer independently of the notion of internal limits. Firstly, we treat the terminal object.

Definition 2.3.5 (internal terminal object). An internal category 푨 in ℰ has !∶ 푨 → ퟙ terminal object if the functor Catℰ has a right adjoint.

Proposition 2.3.6. If ℰ has initial object and 푨 is a complete internal category in ℰ, then 푨 has terminal object.

ퟘ ퟘ Proof. Let Catℰ be the initial object in Catℰ, built from the initial object ℰ ℰ 훥∶ 푨 → [ퟘ , 푨] !∶ 푨 → ퟙ 푨 of .Then, Catℰ is Catℰ, and the limit functor of from proposition 2.3.4 yields the right adjoint.

Secondly, we turn our attention to binary products.

Definition 2.3.7 (internal binary product). An internal category 푨 in ℰ has binary products if the functor 훥∶ 푨 → 푨 ×Catℰ 푨 has a right adjoint.

It turns out that when one can give a natural definition in terms of diagrams, then it coincides with the general definition.

Proposition 2.3.8. If ℰ has binary and 푨 is a complete internal category in ℰ, then 푨 has binary products.

35 2. Completeness of Internal Categories

픻 = ퟙ +Catℰ ퟙ Proof. Let Catℰ Catℰ be the internal category with just two objects (let them be called 0 and 1) and their identity arrows. Consider the diagram in the slice ℰ/퐴0 × 퐴0

∗ ∗ 퐷∶ (퐴0 × 퐴0) 픻 → (퐴0 × 퐴0) 푨 defined, in context 푎0, 푎1 ∶ 퐴0, as 퐷0(푎0, 푎1, 푖) ≔ (푎0, 푎1, 푎푖) for 푖 = 0, 1.Then, the limit of 퐷 yields the right adjoint to 훥. (푨 ) Finally, we treat the case of equalizers. Consider the object p 0 of pairs of parallel arrows in 푨, defined by means of the internal language as the subobject of 퐴1 × 퐴1 given, in context (푓 , 푔)∶ 퐴1 × 퐴1, by s푨(푓 ) = s푨(푔) and t푨(푓 ) = t푨(푔). Analogously, there is an object of commutative squares between 푨 (푨 ) × (푨 ) × 퐴 × 퐴 pairs of parallel arrows in , which is the subobject of p 0 p 0 1 1 ′ ′ given, in context ((푓 , 푔), (푓 , 푔 ), ℎ0, ℎ1), by

푓 푋0 푋1 푔

ℎ0 ℎ1 푓 ′ 푌0 푌1 푔′

′ ′ where ℎ1 ∘푨 푓 = 푓 ∘푨 ℎ0 and ℎ1 ∘푨 푔 = 푔 ∘푨 ℎ0. Thus we get the category 푨p of parallel arrows of 푨.There is also a delta functor 훥∶ 푨 → 푨p sending an object of 푨 into the pair given by its identity arrow (twice).

Definition 2.3.9 (internal equalizer). An internal category 푨 in ℰ has equal- izers if the functor 훥∶ 푨 → 푨p has a right adjoint. Again, when we can give a definition in terms of diagrams it coincides with the general definition.

Proposition 2.3.10. If ℰ has binary coproducts and 푨 is a complete internal category in ℰ, then 푨 has equalizers.

Proof. Let ℙ be the internal category in ℰ with two objects (let them be called 0 and 1) and two parallel arrows between them (let them be called 0⃗ and 1).⃗ ℰ/(푨 ) Consider the diagram in the slice p 0

퐷∶ (푨 )∗ℙ → (푨 )∗푨 p 0 p 0 푃 = (푓 , 푓 ∶ 푎 → 푎 )∶ (푨 ) 퐷 (푃, 푖) ≔ 푎 푖 = 0, 1 defined, in context 0 1 0 1 p 0 as 0 푖 for , and 퐷1(푃, )⃗횤 ≔ 푓푖 for 푖 = 0, 1. sending pairs of parallel arrows of 푨 into the corresponding diagram, yields the right adjoint to 훥.

36 2.3. Completeness

Notice that the previous notions are all stable under pullback, as they are defined as the right adjoint of the diagonal functor, which is a stable notion in a locally cartesian closed category. Moreover, we could similarly define the dual special colimits: initial object, binary sum and . It is part of the folklore of category theory that, were it not for issues of size, completeness and cocompleteness would be equivalent notions. For example, the thought plays a manifest role in the proof of the General Adjoint Functor Theorem.In the context of internal categories the size issues disappear and there is an equivalence.This important fact is alluded to in Hyland (1988), but there is no written account of which we are aware, so we think it useful to indicate full details of a proof in a modern categorical style.The proof of the equivalence is a consequence of the following remarkable propositions.

푨 ℰ (푨)∶ 푨 → 푨 Proposition 2.3.11. Let be a category in . If the identity idCatℰ has a limit, then that limit is an initial object in 푨.

퐼∶ ퟙ → 푨 (푨) Proof. Let the functor Catℰ be the limit of idCatℰ , and the natural 휋∶ 퐼! → (푨)∶ 푨 → 푨 transformation 푨 idCatℰ be its universal cone. We want to prove that 퐼 is the left adjoint of !푨, with 휋 as the counit of the adjunction (the unit being the obvious degenerate natural transformation). Then, the only non-trivial triangular equation (after canceling the identity terms) requires us to prove that 휋 ∗ 퐼 = id(퐼). Observe that the interchange law of composition applied to the natural transformations

ퟙ Catℰ 퐼 휋 푨 푨 푨 휋 퐼 ퟙ Catℰ says that 휋 = 휋(휋 ∗ 퐼!) (given that 퐼! ∗ 휋 is an identity as it factors through ퟙ ℎ∶ 퐼 → 퐼 Catℰ). Then, by the universal property of the limit, there is a unique such that 휋(ℎ∗!) = 휋, which is obviously id(퐼). But, by the previous observa- tion, also 휋 ∗ 퐼 features such property, and then it must be that 휋 ∗ 퐼 = id(퐼), which is the required triangular equation.

Proposition 2.3.12. Let 푨 be a complete category in ℰ and 퐷∶ 푫 → 푨 a diagram over it. Then, CoCone퐷 is complete too.

′ ′ Proof. Let 퐷 ∶ 푫 → CoCone퐷 be a diagram over CoCone퐷. Observe that, by ′ composition with the projection 푇∶ CoCone퐷 → 푨, we have a diagram 푇퐷

37 2. Completeness of Internal Categories

′ 푨 푇퐷 ′ ∶ ퟙ → 푨 over . By hypothesis, has a limit lim푇퐷 Catℰ with universal cone ′ 휋∶ 훥 lim푇퐷′ → ⌜푇퐷 ⌝. The situation is as follows.

′ ′ 퐷 푫 CoCone퐷 ퟙ ⌟ Catℰ 휋 푇 훾 ⌜퐷⌝ ퟙ 푨 [푫, 푨] Catℰ lim푇퐷′ 훥

Because 훥 preserves limits, lim훥푇퐷′ is (isomorphic to) 훥 lim푇퐷′ and its uni- versal cone is (isomorphic to) 훥 ∗ 휋. But 훾 ∗ 퐷′ ∶ ⌜퐷⌝! → 훥푇퐷′ is a cone over 훥푇퐷′ with vertex ⌜퐷⌝, so, by the universal property of the limit, there is a unique natural transformation ℎ∶ ⌜퐷⌝ → 훥 lim푇퐷′ such that (훥 ∗ 휋)(ℎ∗!) = 훾 ∗ 퐷′.Then, by the universal property of the lax pullback, there is a unique 퐿∶ ퟙ → 푇퐿 ≅ ′ Catℰ CoCone퐷 such that lim푇퐷 and (up to this isomorphism) 훾 ∗ 퐿 = ℎ. Moreover, observe that by the defining properties of ℎ and 퐿 it holds 훾 ∗ 퐷′ = (훥 ∗ 휋)(훾 ∗ 퐿!).Then, by the 2-dimensional universal property of the lax pullback, there is a unique 푝∶ 퐿! → 퐷′ such that 푇 ∗ 푝 = 휋. We claim (퐿, 푝) is a limit for 퐷′. We need to show that, for any other cone (퐿′, 푝′) on 퐷′, there is a unique 훽∶ 퐿′ → 퐿 such that 푝(훽∗!) = 푝′. Let’s produce 훽.To begin with, notice that 푇 ∗ 푝′ ∶ 푇퐿′! → 푇퐷′ is a cone on 푇퐷′ and thus, by the universal property of the limit, there exists a unique ′ ′ ′ 푘∶ 푇퐿 → lim푇퐷′ such that 휋(푘∗!) = 푇 ∗ 푝 .Then, observe that (훥 ∗ 푘)(훾 ∗ 퐿 ) is ℎ, as it has the same unique property: (훥 ∗ 휋)((훥 ∗ 푘)(훾 ∗ 퐿′)∗!) = (훥 ∗ 휋)(훥 ∗ 푘∗!)(훾 ∗ 퐿′!) = (훥 ∗ (휋(푘∗!)))(훾 ∗ 퐿′!) (by the unique property of 푘) = (훥푇 ∗ 푝′)(훾 ∗ 퐿′!) (by the interchange law of composition) = (훾 ∗ 퐷′)(⌜퐷⌝! ∗ 푝′) ⌜퐷⌝! ∗ 푝′ ퟙ = 훾 ∗ 퐷′. (because factors through Catℰ)

Finally, by the 2-dimensional universal property of the lax pullback, there is a unique 훽∶ 퐿′ → 퐿 such that 푇 ∗ 훽 = 푘. Now we need to show that 푝′ factorizes through 푝, i.e. that 푝(훽∗!) = 푝′. Notice that 훾∗퐷′ = (훥∗(휋(푘∗!)))(훾∗퐿′!) (it is the same calculation as before). Then, there is a unique 푞∶ 퐿′! → 퐷′ such that 푇 ∗ 푞 = 휋(푘∗!). But both 푝(훽∗!) and 푝′ have this unique property. Indeed, 푇 ∗ (푝(훽∗!)) = (푇 ∗ 푝)(푇 ∗ 훽∗!) and that, because of the unique properties of 푝 and 훽, is 휋(푘∗!); and for 푝′ it holds because the unique property of 푘. But then, 푝(훽∗!) = 푝′. To conclude, let’s prove that 훽 is unique with its property. Let 훽′ ∶ 퐿′ → 퐿 be such that 푝(훽′∗!) = 푝′.To prove that 훽′ is 훽, we need to show that it has the

38 2.3. Completeness same unique property, i.e. that 푇∗훽′ = 푘. Likewise, to prove that 푇∗훽′ is 푘, we need show that it has the same unique property, i.e. that 휋(푇 ∗ 훽′∗!) = 푇 ∗ 푝′. But that follows from (푇 ∗ 푝)(푇 ∗ 훽′∗!) = 푇 ∗ 푝′, by applying the unique property of 푝. We can now finally prove the result.

Theorem 2.3.13. Let 푨 be a category in ℰ.Then, 푨 is complete if and only if it is cocomplete.

Proof. By , it is enough to show only one direction of the equivalence. Assume 푨 is complete, and let’s prove that it is also cocomplete. Consider the diagram 퐷∶ 푫 → 푨. A colimit of 퐷 is by definition an initial object in CoCone퐷, which is, by proposition 2.3.11, the identity on CoCone퐷. Such limit exists because, by proposition 2.3.12, CoCone퐷 is complete. The equivalence of completeness and cocompleteness is, essentially, a gen- eralization of the well-known fact that complete lattices are also cocomplete. We can now retrieve such fact by recalling that complete lattices are complete internal categories in Set (example 2.3.2) and applying theorem 2.3.13. Another immediate consequence is that the category of Modest Sets in the Category of Assemblies is cocomplete.

39

3. Internal Enriched Categories

In this chapter we introduce the notion of internal enriched category, abstract- ing both the notions of internal and enriched category. After giving the main definitions, we develop the foundations of such theory by presenting a selection of standard categorical topics in the new setting. That shows that our theory parallels standard (enriched) category theory and it has many of its features. Moreover, we compare the new notion to that of enriched indexed category, showing that the two are closely related. It is worth remarking that standard category theory has an intrinsic bias towards sets, in that (small) categories are implicitly enriched over the (large) category of sets.In the internal context, there is no immediate notion of large category: the usual substitute is via a theory of indexed categories, but that has the disadvantage that the notion of large is not intrinsic to the situation. As a result, a considerable portion of standard category theory is problematic from the internal point of view. After all one cannot even state the Yoneda Lemma internally. However having an internal enriching category obviates these difficulties.Thus, the theory of internal enriched categories has many of the features of the standard theory of categories, while retaining the generality of the theory of internal categories. In this chapter, let ℰ be a category with finite limits, and 푽 be an internal monoidal category in ℰ.

3.1. Internal Enriched Categories

Let’s define a notion of internal enrichment in 푽, substantially by translating the standard notion of enriched category in the internal language of ℰ.

Definition 3.1.1 (internal enriched category). An internal 푽-enriched category 푿 in ℰ, or 푽-category, is given by

Underlying object: an object 푋 of ℰ;

Internal hom: a morphism Hom푿 ∶ 푋 × 푋 → 푉0;

Composition: a morphism ∘푿 ∶ 푋×푋 ×푋 → 푉1 such that, in context 푥0, 푥1, 푥2 ∶ 푋,

푽 ∘푿(푥0, 푥1, 푥2)∶ Hom푿(푥1, 푥2) ⊗ Hom푿(푥0, 푥1) → Hom푿(푥0, 푥2);

41 3. Internal Enriched Categories

Identity: a morphism id푿 ∶ 푋 → 푉1 such that, in context 푥∶ 푋,

id푿 ∶ 핀푽 → Hom푿(푥, 푥);

satisfying, in context 푥0, 푥1, 푥2, 푥3 ∶ 푋, the axioms of 3.1, 3.2, and 3.3.

푽 ∘푿(푥1,푥2,푥3)⊗ Hom푿(푥0,푥1)

푽 푽 푽 (Hom푿(푥2, 푥3) ⊗ Hom푿(푥1, 푥2)) ⊗ Hom푿(푥0, 푥1) Hom푿(푥1, 푥3) ⊗ Hom푿(푥0, 푥1)

훼푽(Hom푿(푥2,푥3),Hom푿(푥1,푥2),Hom푿(푥0,푥1))

푽 푽 Hom푿(푥2, 푥3) ⊗ (Hom푿(푥1, 푥2) ⊗ Hom푿(푥0, 푥1)) ∘푿(푥0,푥1,푥3)

푽 Hom푿(푥2,푥3)⊗ ∘푿(푥0,푥1,푥2)

푽 Hom푿(푥2, 푥3) ⊗ Hom푿(푥0, 푥2) Hom푿(푥0, 푥3) ∘푿(푥0,푥2,푥3) (3.1)

휆 (Hom (푥 ,푥 )) 푽 푽 푿 0 1 핀푽 ⊗ Hom푿(푥0, 푥1) Hom푿(푥0, 푥1)

푽 ∘ (푥 ,푥 ,푥 ) id푿(푥1)⊗ Hom푿(푥0,푥1) 푿 0 1 1 푽 Hom푿(푥1, 푥1) ⊗ Hom푿(푥0, 푥1) (3.2)

휌 (Hom (푥 ,푥 )) 푽 푽 푿 0 1 Hom푿(푥0, 푥1) ⊗ 핀푽 Hom푿(푥0, 푥1)

푽 ∘ (푥 ,푥 ,푥 ) Hom푿(푥0,푥1)⊗ id푿(푥0) 푿 0 0 1 푽 Hom푿(푥0, 푥0) ⊗ Hom푿(푥0, 푥1) (3.3)

Notice how the conventions on the internal language of ℰ allow one to express those axioms in a form very close to that used to define standard enriched categories. Example 3.1.2. Let 풱 be a small monoidal category. Then, 풱 is an internal category in Set, and internal 풱-enriched categories in Set are standard (small) 풱-enriched categories. Continuing in the style of the previous definition, we give a notion of inter- nal enriched functor, by translating the standard definition into the internal language.

42 3.1. Internal Enriched Categories

Definition 3.1.3 (internal enriched functor). Let 푿 and 풀 be 푽-enriched cate- gories. A 푽-enriched functor, or 푽-functor, 퐹∶ 푿 → 풀 is given by

Objects component: an arrow 퐹0 ∶ 푋 → 푌;

Morphisms component: an arrow 퐹1 ∶ 푋 × 푋 → 푉1 of shape

푥0, 푥1 ∶ 푋 ⊢ 퐹1(푥0, 푥1)∶ Hom푿(푥0, 푥1) → Hom풀(퐹0(푥0), 퐹0(푥1))∶ 푉1; satisfying, in context 푥0, 푥1, 푥2 ∶ 푋, the axiom 3.4.

푽 ∘푿(푥0,푥1,푥2) Hom푿(푥1, 푥2) ⊗ Hom푿(푥0, 푥1) Hom푿(푥0, 푥2)

푽 퐹1(푥1,푥2)⊗1퐹1(푥0,푥1) 퐹1(푥0,푥2)

푽 Hom풀(퐹0(푥1), 퐹0(푥2)) ⊗ Hom풀(퐹0(푥0), 퐹0(푥1)) Hom풀(퐹0(푥0), 퐹0(푥2))

∘풀(퐹0(푥0),퐹0(푥1),퐹0(푥2)) (3.4)

We would expect the definition above to provide a category of internal 푽- enriched categories and functors. We present the relevant data for that. 퐹 퐺 The composition of 푽-functors 퐺 ∘ 퐹∶ 푿 −→풀 −→풁 is defined by

(퐺 ∘ 퐹)0 ≔ 퐺0퐹0 ∶ 푋 → 푍 and

Hom푿(푥0, 푥1)

퐹1(푥0,푥1) 푥 , 푥 ∶ 푋 ⊢ (퐺 ∘ 퐹) (푥 , 푥 ) ≔ ∶ 푉 . 0 1 1 0 1 Hom풀(퐹0(푥0), 퐹0(푥1)) 1

퐺1(퐹0(푥0),퐹0(푥1))

Hom풁(퐺0퐹0(푥0), 퐺0퐹0(푥1))

The identity 푽-functor id푿 ∶ 푿 → 푿 on 푿 is defined by

(id푿)0 ≔ idℰ(푋)∶ 푋 → 푋 and Hom푿 id푽 (id푿)1 ≔ 푋 −−−−→푉0 −−→푉1.

It is just an exercise in the internal language to prove that the data so defined yield a category, as stated in the following proposition.

43 3. Internal Enriched Categories

Proposition 3.1.4. Composition and identity of internal enriched functors strictly satisfy associativity and unitarity. Then, 푽-enriched categories and functors form a category 푽Catℰ.

Example 3.1.5. There is an underlying-object functor 푈∶ 푽Catℰ → ℰ sending 푽-enriched categories to their underlying object, and 푽-enriched functors to their object-component. Example 3.1.6. Let 푋 be an object of ℰ.The indiscrete 푽-enriched category 퐢퐧퐝(푋) on 푋 is given by

! 핀푽 Hom퐢퐧퐝(푋) ≔ 푋 × 푋 −→ퟙℰ −→푉0. The rest of the structure follows from that. Analogously, a morphism 푓∶ 푋 → 푌 induces an indiscrete 푽-enriched functor 퐢퐧퐝(푓 )∶ 퐢퐧퐝(푋) → 퐢퐧퐝(푌).Then, there is a functor 퐢퐧퐝∶ ℰ → 푽Catℰ. Remark 3.1.7. To define the discrete 푽-enriched category over an object of ℰ, we would need to assume some extra hypothesis. Firstly, we would need to be able to tell whether two elements of the underlying object of the 푽-enriched category are equal. Secondly, we would need an initial object in 푽 to be the homset of non-equal elements of the underlying object. Both hypothesis do not hold in general. For example, the first one does not hold in the Effective Topos. Finally, again by translating the standard definition into the internal lan- guage, we give the definition of internal enriched natural transformation. Definition 3.1.8 (internal enriched natural transformation). Let 푿 and 풀 be 푽- enriched categories, and 퐹 and 퐺 be 푽-enriched functors 푿 → 풀. A 푽-enriched natural transformation, or 푽-natural transformation, 훼∶ 퐹 → 퐺∶ 푿 → 풀 is given by an arrow 훼∶ 푋 → 푉1 of shape

푥∶ 푋 ⊢ 훼(푥)∶ 핀푽 → Hom풀(퐹0(푥), 퐺0(푥))∶ 푉1 satisfying, in context 푥0, 푥1 ∶ 푋, the axiom 3.5. 푽 훼(푥1)⊗ 퐹1(푥0,푥1)

푽 푽 핀푽 ⊗ Hom푿(푥0, 푥1) Hom풀(퐹0(푥1), 퐺0(푥1)) ⊗ Hom풀(퐹0(푥0), 퐹0(푥1))

−1 휆푽 (Hom푿(푥0,푥1)) ∘풀(퐹0(푥0),퐹0(푥1),퐺0(푥1))

Hom푿(푥0, 푥1) Hom풀(퐹0(푥0), 퐺0(푥1))

−1 휌푽 (Hom푿(푥0,푥1)) ∘풀(퐹0(푥0),퐺0(푥0),퐺0(푥1))

푽 푽 Hom푿(푥0, 푥1) ⊗ 핀푽 Hom풀(퐺0(푥0), 퐺0(푥1)) ⊗ Hom풀(퐹0(푥0), 퐺0(푥0))

푽 퐺1(푥0,푥1)⊗ 훼(푥0) (3.5)

44 3.1. Internal Enriched Categories

We would expect the definition above to provide a 2-category of internal 푽-enriched categories, functors and natural transformations. We present the relevant data for that. Consider 푽-categories, 푽-functors and 푽-natural transformations as shown in the diagram:

훼 퐿 푅 푾 푿 퐺 풀 풁 훽

Vertical composition of 푽-natural transformations 훽 ∘ 훼∶ 퐹 → 퐻∶ 푋 → 푌 is defined by

푽 핀푽 ≅ 핀푽 ⊗ 핀푽

훽(푥)⊗푽훼(푥)

푥∶ 푋 ⊢ (훽 ∘ 훼)(푥) ≔ 푽 ∶ 푉1. Hom푿(퐺0(푥), 퐻0(푥)) ⊗ Hom푿(퐹0(푥), 퐺0(푥))

∘풀(퐹0(푥),퐺0(푥),퐻0(푥))

Hom푿(퐹0(푥), 퐻0(푥))

The left whiskering 훼∗퐿∶퐹∘퐿→퐺∘퐿∶푾→풀 is defined by

푤∶ 푊 ⊢ (훼 ∗ 퐿)(푤) ≔ 훼(퐿0(푤))∶ 푉1. The right whiskering 푅∗훽∶푅∘퐺→푅∘퐻∶푿→풁 is defined by

핀푽

훽(푥) 푥∶ 푋 ⊢ (푅 ∗ 훽)(푥) ≔ ∶ 푉 . Hom풀(퐺0(푥), 퐻0(푥)) 1

푅1(퐺0(푥),퐻0(푥))

Hom풁(푅0퐺0(푥), 푅0퐻0(푥))

The identity 푽-natural transformation id퐹 ∶ 퐹 → 퐹∶ 푿 → 풀 is defined as

퐹0 id풀 id퐹 ≔ 푋 −−→푌 −−→푉1. It is just an exercise in the internal language to prove that a pair of 푽- enriched categories yield a category of functors and natural transformations, as stated in the following proposition.

45 3. Internal Enriched Categories

Proposition 3.1.9. Vertical composition and identity of internal enriched natural transformation strictly satisfy associativity and unitarity. Then, given 푽-enriched categories 푿 and 풀, the 푽-enriched functors 푿 → 풀 and natural transformations between them form a category 푽Catℰ(푿, 풀). Moreover, with the horizontal composition defined before, the above assign- ment turns out to yield an enrichment in Cat. Equivalently, internal enriched categories, functors and natural transformations form a 2-category, as stated in the following result, whose proof is again an exercise in the internal lan- guage. Proposition 3.1.10. Horizontal and vertical composition of 푽-enriched nat- ural transformations satisfy the interchange laws. So, 푽-enriched categories, functors, and natural transformations form a strict 2-category 푽Catℰ.

By abuse of notation, we called by 푽Catℰ both the category of 푽-enriched categories and their functors, and the 2-category of 푽-enriched categories, their functors and their natural transformations. As a consequence, given two 푽-enriched categories 푿 and 풀, we will denote by 푽Catℰ(푿, 풀) both the hom-set of 푽-enriched functors 푿 → 풀 and the hom-category of 푽-enriched functors 푿 → 풀 and their natural transformations. Context will usually suffice to determine in which sense the notation is being used. Remark 3.1.11. Let 푿 be a 푽-enriched category. There is an underlying ℰ- category 푈(푿), such that 푈(푿)0 ≔ 푋 and 푈(푿)1 is the subobject of 푋× 푋× 푉1 given by (푥0, 푥1, 푓 )∶ 푈(푿)1 ⊢ 푓∶ 핀푽 → Hom푿(푥0, 푥1)∶ 푉1 with the first and second projections as source and target. The composition is defined, in context (푥1, 푥2, 푔), (푥0, 푥1, 푓 )∶ 푈(푿)1 s×t 푈(푿)1, as

푽 (푥1, 푥2, 푔) ∘푈(푿) (푥0, 푥1, 푓 ) ≔ (푥0, 푥2, ∘푿(푥0, 푥1, 푥2) ∘푽 (푔 ⊗ 푓 ))∶ 푈(푿)1. Let 퐹∶ 푿 → 풀 be a 푽-enriched functor. There is an underlying functor 푈(퐹)∶ 푈(푿) → 푈(풀) in ℰ, with 푈(퐹)0 defined as 퐹0 and 푈(퐹)1(푥0, 푥1, 푓 ), in context (푥0, 푥1, 푓 )∶ 푈(푿)1, as the tuple

푓 퐹1(푥0,푥1) (퐹0(푥0), 퐹0(푥1), 핀푽 −→ Hom푿(푥0, 푥1) −−−−−−−→ Hom푿(퐹0(푥0), 퐹0(푥1))) in 푈(풀)1. Let 훼∶ 퐹 → 퐺∶ 푿 → 풀 be a 푽-enriched natural transformation. There is an underlying natural transformation 푈(훼)∶ 푈(퐹) → 푈(퐺)∶ 푈(푿) → 푈(풀) in ℰ, defined as

푥∶ 푈(푿)0 ⊢ 푈(훼)(푥) ≔ (퐹0(푥), 퐺0(푥), 훼(푥))∶ 푈(풀)1.

Those data yield the underlying-category-in-ℰ 2-functor 푈∶ 푽Catℰ → Catℰ.

46 3.1. Internal Enriched Categories

It is an established practice in enriched category theory to focus on en- richment in symmetric monoidal closed category. Inter alia this provides a self-enrichment. We check that this happens in our internal setting.

Proposition 3.1.12. If 푽 is symmetric and monoidal closed, then it has an internal 푽-category structure such that (with abuse of notation) 푈(푽) = 푽.

Proof. Let 푉0 be the underlying object. Define

푎, 푏∶ 푉0 ⊢ Hom푽(푎, 푏) ≔ [푎, 푏]∶ 푉0.

Let the composition

푎, 푏, 푐∶ 푉0 ⊢ ∘푽(푎, 푏, 푐)∶ Hom푽(푏, 푐) ⊗ Hom푽(푎, 푏) → Hom푽(푎, 푐)∶ 푉1 be the exponential transpose of

Hom푽(푏,푐)⊗e(푎,푏) e(푏,푐) Hom푽(푏, 푐) ⊗ Hom푽(푎, 푏) ⊗ 푎 −−−−−−−−−−−−−→ Hom푽(푏, 푐) ⊗ 푏 −−−−→푐 and the identity

푎∶ 푉0 ⊢ id푽(푎)∶ 핀 → Hom푽(푎, 푎)∶ 푉1 be the exponential transpose of the identity id푽(푎)∶ 푎 → 푎.(Notice again that there is some notation overload.) The 푽-category axioms hold because of the defining property of monoidal closure. We now consider the issue of the change of base.In this context, though, there are two sensible such notions, one coming from internal category the- ory and one from enriched category theory. Indeed, we can change both the ambient category and the enriching category. To begin with, let’s state the internal version of the standard result changing the enriching category.

Proposition 3.1.13. Let 푽′ be another monoidal category in ℰ, and 퐹∶ 푽 → 푽′ ′ a monoidal functor. Then there is an induced 2-functor 퐹∗ ∶ 푽Catℰ → 푽 Catℰ. ′ Proof. Let 푿 be a 푽-category. Define a 푽 -category 퐹∗(푿) on 푋 given by

Hom 퐹 ≔ 푋 × 푋 −−−−→푉푿 −−→푉0 ′ Internal hom: Hom퐹∗(푿) 0 0; ∘ 퐹 ∘ ≔ 푋 × 푋 × 푋 −→푉푿 −−→푉1 ′ Composition: 퐹∗(푿) 1 1;

Hom 퐹 ≔ 푋 −−−−→푉푿 −−→푉1 ′ Identity: id퐹∗(푿) 1 1.

47 3. Internal Enriched Categories

′ Let 퐺∶ 푿 → 풀 be a 푽-functor. Define a 푽 -functor 퐹∗(퐺)∶ 퐹∗(푿) → 퐹∗(풀), with the same object component as 퐺 and arrow component given by

퐺 퐹 1 1 ′ (퐹∗(퐺))1 ≔ 푋 × 푋 −−→푉1 −−→푉1.

Let 훼∶ 퐺 → 퐺′ ∶ 푿 → 풀 be a 푽-natural transformation. Define a 푽′-natural ′ transformation 퐹∗(훼)∶ 퐹∗(퐺) → 퐹∗(퐺 )∶ 퐹∗(푿) → 퐹∗(풀) as

퐹 훼 1 ′ 퐹∗(훼) ≔ 푋 −→푉1 −−→푉1.

The axioms for the above definitions hold because of the functoriality of 퐹.

Then, let’s check that changing the ambient category induces a 2-functorial operation on internal enriched categories, just as it does on internal categories.

Proposition 3.1.14. Let ℰ′ be another finitely complete category and 퐹∶ ℰ → ℰ′ a functor preserving finite limits. Then there is an induced monoidal category ′ 퐹(푽) in ℰ and a 2-functor 퐹∗ ∶ 푽Catℰ → 퐹(푽)Catℰ′.

Proof. Let 푿 be a 푽-category. Define a 퐹(푽)-category 퐹∗(푿) on 퐹(푋) by applying the functor 퐹 to the structural arrows Hom푿, ∘푿 and id푿 of 푿. That gives a 퐹(푽)-enriched category because 퐹 preserves finite-limit logic, in terms of which internal enriched categories are defined. Analogously, define 퐹∗ on 푽-enriched functors and natural transformations.

3.2. Comparison with Indexed Enriched Categories

We now establish the connection between internal enriched categories and the notions from section 1.4. Recall that the externalization of 푽 is a monoidal indexed category [푽] over ℰ.Thus, we will investigate which relationship subsists between 푽-enriched categories, small [푽]-categories and indexed [푽]-categories. The most immediate fact is that 푽-enriched categories and small [푽]- categories are the same thing, in a very strict sense: their definitions coincide!

Proposition 3.2.1. To give a 푽-enriched category (functor, natural transfor- mation) is to give a small [푽]-category (functor, natural transformation).

Proof. A small [푽]-category 푿 is yielded by

• an object 푋 of ℰ;

푋×푋 • an object Hom푿 ∶ 푋 × 푋 → 푉0 of [푽] ;

48 3.2. Comparison with Indexed Enriched Categories

• a morphism of [푽]

훥 id 푋 푿 ∗ !푋 핀푽 (푋−−→푋×푋,푋−−→(핀푽!푋,Hom푿훥푋) 푉1) Hom푿 (푋 −→ퟙℰ −→푉0) −−−−−−−−−−−−−−−−−−−−−−−−−−−−→(푋×푋 −−−−→푉0);

• a morphism of [푽]

푽 Hom푿(휋2,휋3)⊗ Hom푿(휋1,휋2) Hom푿 (푋 × 푋 × 푋 −−−−−−−−−−−−−−−−−−−−−→푉0) → (푋 × 푋 −−−−→푉0)

(휋1,휋3) over 푋 × 푋 × 푋 −−−−−−→푋 × 푋, given by ∘ 푿 푽 ∗ 푋 × 푋 × 푋 −→ (Hom푿(휋2, 휋3) ⊗ Hom푿(휋1, 휋2), Hom푿(휋1, 휋3)) 푉1 satisfying associativity and unitarity axioms. But these are precisely the same data that yield an internal 푽-enriched category. Analogously, to give a functor or a natural transformation of small [푽]- categories is to give a functor or a natural transformation of internal 푽- enriched categories.

The relationship between 푽-enriched categories and indexed [푽]-categories is more complicated. We will prove that 푽-enriched categories are a sub-case of indexed [푽]-categories, in the sense precisely stated in propositions 3.2.2 and 3.2.3. First, we give the construction yielding an indexed [푽]-category from a 푽- enriched category. Let 푿 be a 푽-enriched category and let’s define an indexed [푽]-category [푿]. Given an indexing object 퐼 of ℰ, define the [푽]퐼-enriched category [푿]퐼 as

Objects: 퐼-indexed families 푥∶ 퐼 → 푋 of elements of 푋;

(푥0,푥1) Hom푿 Internal hom: Hom[푿]퐼(푥0 ∶ 퐼 → 푋, 푥1 ∶ 퐼 → 푋) ≔ 퐼 −−−−−→푋 × 푋 −−−−→푉0;

(푥0,푥1,푥1) ∘푿 Composition: ∘[푿]퐼(푥0, 푥1, 푥2) ≔ 퐼 −−−−−−−→푋 × 푋 × 푋 −→푉1;

푥 id푿 Identity: id[푿]퐼(푥) ≔ 퐼 −→푋 −−→푉1.

퐼 ∗ ∗ 퐽 퐼 Let 푓∶ 퐼 → 퐽 be a re-indexing. Define the [푽] -functor 푓 ∶ (푓 )•([푿] ) → [푿] as

∗ 푥 푓 푥 푓0 (퐽 −→푋) ≔ 퐼 −→퐽 −→푋 푥 푥 ∗ 0 1 id 푓 (퐽 −→푋, 퐽 −→푋) ≔ Hom ∗ 퐽 (푥0, 푥1) −→ Hom 퐼(푥0푓 , 푥1푓 ). 1 (푓 )•([푿] ) [푿]

49 3. Internal Enriched Categories

∗ 퐼 ∗ Since 푓1 (푥0, 푥1) is the identity of Hom푿(푥0푓 , 푥1푓 ) as an object of [푽] , then 푓 is full and faithful, as required by the definition.The rest of the structure is given by canonical isomorphisms verifying the axioms. Secondly, let 퐹∶ 푿 → 풀 be a 푽-enriched functor and let’s define an indexed [푽]-enriched functor [퐹] ∶ [푿] → [풀] induced by 퐹. For an indexing object 퐼, define the [푽]퐼-enriched functor [퐹]퐼 ∶ [푿]퐼 → [풀]퐼 as

푥 푥 퐹0 Objects component: [퐹]퐼(퐼 −→푋) ≔ 퐼 −→푋 −−→푌; 푥 푥 (푥 ,푥 ) 퐹 퐼 0 1 0 1 1 Morphisms component: [퐹] (퐼 −→푋, 퐼 −→푋) ≔ 퐼 −−−−−→푋 × 푋 −−→푉1 Notice that, for any reindexing 푓∶ 퐼 → 퐽, we have an equality [퐹]퐼 ∘ 푓 ∗ = ∗ ∗ 퐽 푓 ∘ (푓 )•([퐹] ), meaning that the axioms for indexed [푽]-enriched functors are automatically satisfied. Finally, let 훼∶ 퐹 → 퐺∶ 푿 → 풀 be a 푽-enriched natural transformation and let’s define an indexed [푽]-natural transformation [훼] ∶ [퐹] → [퐺] ∶ [푿] → [풀] induced by 훼.Let 퐼 be an indexing object. Then, define the [푽]퐼-enriched natural transformation [훼]퐼 ∶ [퐹]퐼 → [퐺]퐼 ∶ [푿]퐼 → [풀]퐼 as 퐼 푥 푥 훼 [훼] (퐼 −→푋) ≔ 퐼 −→푋 −→푉1. The naturality condition for indexed [푽]-natural transformations is trivially satisfied because the defining isomorphisms of indexed [푽]-functors [퐹] and [퐺] are identities. With the data previously defined, we have the following proposition.

Proposition 3.2.2. There is a 2-functor [‐] from 푽Catℰ to the 2-category of indexed [푽]-categories [푽]ICatℰ. The previous result is extremely weak.Indeed, we would like to better understand the 2-functor [‐]. Observe that there is a construction inducing 푽-enriched functors from indexed [푽]-functors.Let ℱ∶ [푿] → [풀] be a [푽]-functor. Define the 푽- functor ℱ∶̄ 푿 → 풀 as ̄ 푋 ℱ0 ≔ (ℱ )0(id(푋))∶ 푋 → 푌 ̄ 푋×푋 ℱ1 ≔ 휙 ∘풀 (ℱ )1(휋1, 휋2)∶ 푋 × 푋 → 푉1. The isomorphism appearing in the definition of the morphism component 푋×푋 requires some explanation.The source and target of (ℱ )1(휋1, 휋2) are, 푋×푋 푋×푋 respectively, (ℱ )0(휋1) and (ℱ )0(휋2), while we need an arrow from 푋 푋 ̄ (ℱ )0(id(푋))휋1 to (ℱ )0(id(푋))휋2 to match the definition of ℱ on objects. We fix this issue by introducing a suitable isomorphism. By the definition of [푽]-functor, we have an isomorphism 푋×푋 ∗ ∗ ∗ 푋 ∗ 푋 푋×푋 ℱ ∘ 휋푖 ≅ 휋푖 ∘ (휋푖 )•(ℱ )∶ (휋푖 )•([푿] ) → [푿]

50 3.2. Comparison with Indexed Enriched Categories

∗ 푋 which we apply to the object id(푋) of (휋푖 )•([푿] ) to get an isomorphism

푋×푋 푋 휙푖 ∶ (ℱ )0(휋푖) ≅ (ℱ )0(id(푋))휋푖

푋×푋 in [푿] . From 휙1 and 휙2 we get the isomorphism 휙 that we need. Moreover, there is also a construction inducing 푽-enriched natural transfor- mations from indexed [푽]-natural transformations.Let 훼∶ ℱ → 풢∶ [푿] → [풀] be an indexed [푽]-natural transformation. Define the 푽-enriched natural transformation ̄훼∶ ℱ̄ → 풢∶̄ 푿 → 풀 as

푋 ̄훼≔ 훼 (id(푋))∶ 푋 → 푉1.

It is clear that, for a 푽-enriched functor 퐹∶ 푿 → 풀, we have 퐹 = [퐹], and for a 푽-enriched natural transformation 훼∶ 퐹 → 퐺∶ 푿 → 풀, we have 훼 = [훼].This provides a strengthening of proposition 3.2.2, in that it shows that 푽Catℰ is a sub-2-category of [푽]ICatℰ. Moreover, as proved in the following proposition, 푽Catℰ is a full sub-2-category, meaning that there is an equivalence of hom- categories.

Proposition 3.2.3. The 2-category 푽Catℰ is a full sub-2-category of [푽]ICatℰ, and [‐] is the relative inclusion. Proof. Consider indexed [푽]-categories [푿] and [풀]. We need to show that there is an equivalence of categories

Cat푽(푿, 풀) ≣ Cat[푽]([푿], [풀]).

Let ℱ∶ [푿] → [풀] be a [푽]-functor, and consider the indexed [푽]-functor [ℱ̄] ∶ [푿] → [풀]. We need to prove that there is a [푽]-natural isomorphism ℱ ≅ [ℱ̄].Let 퐼 be an indexing object in ℰ.Then we need a natural isomor- phism ℱ퐼 ≅ [ℱ̄]퐼.Let 푥∶ 퐼 → 푋 be an object of [푿]퐼. By the definition of [푽]-functor, we have an isomorphism

퐼 ∗ ∗ ∗ 푋 ∗ 푋 퐼 ℱ ∘ 푥 ≅ 푥 ∘ (푥 )•(ℱ )∶ (푥 )•([푿] ) → [푿] ∗ 푋 which we apply to the object id(푋) of (푥 )•([푿] ) to get an isomorphism 퐼 푋 ℱ0(푥) ≅푥 ℱ0 (id(푋)) ∘ 푥 in [푿]퐼.Then, we take that as the definition of the isomorphism ℱ퐼 ≅ [ℱ̄]퐼 on 푥∶ 퐼 → 푋. We need to prove that the isomorphism just defined is natural. Let 퐼 be an 퐼 indexing object in ℰ and 푥1, 푥2 ∶ 퐼 → 푋 objects of [푿] . By the definition of [푽]-functor, we have an isomorphism

퐼 ∗ ∗ ∗ 푋×푋 ∗ 푋×푋 퐼 ℱ ∘(푥1, 푥2) ≅ (푥1, 푥2) ∘((푥1, 푥2) )•(ℱ )∶ ((푥1, 푥2) )•([푿] ) → [푿]

51 3. Internal Enriched Categories

∗ 푋×푋 which we apply to the objects 휋푖 of ((푥1, 푥2) )•([푿] ) to get an isomorphism

퐼 푋×푋 ℱ0(푥푖) ≅ ℱ0 (휋푖) ∘ (푥1, 푥2) in [푿]퐼. Then, consider the following diagram.

퐼 ≅ 푋×푋 ≅ 푋 ℱ0(푥1) ℱ0 (휋1) ∘ (푥1, 푥2) ℱ0 (id(푋)) ∘ 푥1 퐼 푋×푋 ̄ 퐼 ℱ1(푥1,푥2) ℱ1 (휋1,휋2)∘(푥1,푥2) [ℱ]1(푥1,푥2) 퐼 ≅ 푋×푋 ≅ 푋 ℱ0(푥2) ℱ0 (휋2) ∘ (푥1, 푥2) ℱ0 (id(푋)) ∘ 푥1

Firstly, the left-hand-side square commutes because of the naturality of the isomorphism. Secondly, the right-hand-side square commutes because such is the definition of [ℱ̄]. Finally, the composition of the consecutive isomorphisms 퐼 푋 퐼 ̄ 퐼 ℱ0(푥푖) → ℱ0 (id(푋)) ∘ 푥푖 is the isomorphism ℱ ≅ [ℱ] computed on 푥푖, because of the functoriality axiom for [푽]-functors applied to the functor ℱ and the composition 휋푖 ∘ (푥1, 푥2) = 푥푖. But then the outer square is the naturality diagram, and we have shown that it commutes. Then, we need to prove that the isomorphism ℱ ≅ [ℱ̄] satisfies the natu- rality condition for [푽]-natural transformations.Let 푓∶ 퐼 → 퐽 be a reindexing and 푥∶ 퐽 → 푋 an object of [푿].Then the naturality diagram for the reindexing 푓 and computed on 푥 is

≅ 퐼 푓 퐼 ℱ0(푗 ∘ 푓 ) ℱ0(푥) ∘ 푓

≅ 푥∘푓 ≅푥∘푓 ̄ 퐼 푋 [ℱ]0(푥 ∘ 푓 ) = ℱ0 (id(푋)) ∘ 푥 ∘ 푓 which commutes thanks to the functoriality axiom for [푽]-functors applied to the functor ℱ and the composition of 푓 and 푥. Finally, we need to prove that, for any indexed [푽]-natural transformation 훼∶ ℱ → 풢∶ [푿] → [풀], the following square commute.

ℱ 훼 풢 ≅ ≅ [ ̄훼] [ℱ]̄ [풢]̄

Let 퐼 be an indexing object in ℰ and 푥∶ 퐼 → 푋 an object of [푿]퐼, and compute the 퐼-th component of the above diagram on 푥. We get a commutative square, as it is an instance of the naturality axiom for the indexed [푽]-natural transformation 훼, relative to the reindexing 푥 and computed on id(푋).

52 3.2. Comparison with Indexed Enriched Categories

Remark 3.2.4. The converse of proposition 3.2.3 does not seem to hold, that is, indexed [푽]-categories don’t canonically induce internal 푽-enriched categories. In particular, the categories [푿]퐼 are small, as their object of objects is the homset ℰ(퐼, 푋), but that is not generally the case for indexed [푽]-categories. We then straightforwardly get the following corollary.

Corollary 3.2.5. The 2-category of small [푽]-categories, functors and natu- ral transformations is a full sub-2-category of the 2-category of indexed [푽]- categories, functors and natural transformations. To conclude, we look at the interplay between externalization and the un- derlying category of points.

Proposition 3.2.6. Let 푿 be a 푽-enriched category. Then, there is a natural isomorphism of indexed categories 푈([푿]) ≅ [푈(푿)] between the underlying indexed category of the indexed [푽]-enriched category [푿] and the externaliza- tion of the underlying ℰ-category 푈(푿). Proof. Let 퐼 be an indexing object. We need to prove that there is an isomor- phism 푈([푿]퐼) ≅ [푈(푿)]퐼 between the underlying standard category of the [푽]퐼-enriched category [푿]퐼 and the fiber over 퐼 of the externalization of the underlying ℰ-category 푈(푿). Moreover, for any reindexing 푓∶ 퐽 → 퐼 in ℰ, the square 푈([푿]퐼) ≅ [푈(푿)]퐼

푈(푓 ∗([푿])) 푓 ∗([푈(푿)])

푈([푿]퐽) ≅ [푈(푿)]퐽 has to commute. For both categories, the objects are 퐼-indexed families of objects of 푿, and 푥0 푥1 the arrows (퐼 −→푋) → (퐼 −→푋) are the sections of the projection ∗ (핀푽!푋, Hom푿(푥0, 푥1)) 푉1 → 퐼, so that the categories are clearly isomorphic to each other, and the square commutes trivially. The previous result can be extended to the following proposition.

Proposition 3.2.7. The following diagram of 2-functors commutes.

푈 푽Catℰ Catℰ [‐] [‐] 푈 [푽]ICatℰ ICatℰ

53 3. Internal Enriched Categories

3.3. Categories of Functors

Analogously to the treatment of internal categories, we now look at the enrich- ment of 푽Catℰ over Catℰ.That is, we show how two 푽-enriched categories give rise to a category in ℰ of the functors between them and their natural transformations.That will be propaedeutic to the investigation regarding the monoidal closure of 푽Catℰ, whereas, instead of an internal category of functors and natural transformations, we will need an internally enriched one. In this section, we shall assume that ℰ is cartesian closed. Let 푿 and 풀 be 푽-categories. Define Fun(푿, 풀) as the object representing 푋 푋×푋 the 푽-enriched functors 푿 → 풀; that is, the subobject of 푌 × 푉1 of those 푋 푋×푋 퐹 = (퐹0 ∶ 푌 , 퐹1 ∶ 푉1 ) such that, in the context 푥0, 푥1, 푥2 ∶ 푋, the axioms

e(퐹1, (푥0, 푥1))∶ Hom푿(푥0, 푥1) → Hom풀(e(퐹0, 푥0), e(퐹0, 푥1))∶ 푉1 and 푽 ∘푿(푥0,푥1,푥2) Hom푿(푥1, 푥2) ⊗ Hom푿(푥0, 푥1) Hom푿(푥0, 푥2)

푽 e(퐹1,(푥1,푥2))⊗ e(퐹1,(푥0,푥1)) 1 e(퐹1,(푥0,푥2))

Hom풀(e(퐹0, 푥1), e(퐹0, 푥2)) 푽 Hom풀(e(퐹0, 푥0), e(퐹0, 푥2)) ⊗ Hom풀(e(퐹0, 푥0), e(퐹0, 푥1))

∘풀(e(퐹0,푥0),e(퐹0,푥1),e(퐹0,푥2)) hold. We shall now validate the intuition that Fun(푿, 풀) is indeed an internal representation of 푽-enriched functors 푿 → 풀, or, in other words, that 푽- enriched functors 푿 → 풀 correspond to the global sections of Fun(푿, 풀).That suggests that Fun(‐, ‐) may actually yield the hom-objects for an enriched category extending 푽Catℰ. Proposition 3.3.1. There is an ℰ-enriched category whose underlying category is isomorphic to 푽Catℰ (and, with abuse of notation, it shall be called in the same way). That is, for all 푽-enriched categories 푿 and 풀, there is a natural bijection between the hom-sets ℰ(ퟙ , (푿, 풀)) ≅ 푽 (푿, 풀). ℰ Hom푽Catℰ Catℰ (3.6)

Proof. Let 푿, 풀 and 풁 be 푽-categories. Define the enrichment of 푽Catℰ in ℰ: (푿, 풀) 푿 풀 (푿, 풀) Hom-object: Hom푽Catℰ , the hom-object of and , is Fun . Composition: The composition of 푿, 풀 and 풁 is given by the arrow ∘ (푿, 풀, 풁)∶ (푿, 풀)× (푿, 풀) → (푿, 풁) 푽Catℰ Hom푽Catℰ Hom푽Catℰ Hom푽Catℰ

54 3.3. Categories of Functors

퐹∶ (푿, 풀), 퐺∶ (풀, 풁) where, in context Hom푽Catℰ Hom푽Catℰ , the compo- nent ∘ (푿, 풀, 풁)(퐹, 퐺) ∶ 푍푋 is defined as 휆푥∶ 푋. e (퐺 , e (퐹 , 푥)) 푽Catℰ 0 ℰ 0 ℰ 0 푋×푋 and the component ∘ (푿, 풀, 풁)(퐹, 퐺) ∶ 푉 as 푽Catℰ 1 1

Hom푿(푥0, 푥1)

eℰ(퐹1,(푥0,푥1))

휆푥0, 푥1 ∶ 푋. Hom풀(e(퐹0, 푥0), e(퐹0, 푥1)) .

eℰ(퐺1,(eℰ(퐹0,푥0),(eℰ(퐹0,푥1))))

Hom풁(e(퐺0, e(퐹0, 푥0)), e(퐺0, e(퐹0, 푥1)))

Identity: The identity of 푿 is the arrow

(푿)∶ ퟙ → (푿, 푿) id푽Catℰ ℰ Hom푽Catℰ

where the component id (푿) ∶ 푋푋 is defined as 휆푥∶ 푋. 푥 and the 푽Catℰ 0 푋×푋 component id (푿) ∶ 푉 as 휆푥 , 푥 ∶ 푋. id (Hom (푥 , 푥 )). 푽Catℰ 1 1 0 1 푽 푿 0 1 Finally, the bijection (3.6) is obtained straightforwardly by applying the exponential transpose. Let 푿 and 풀 be 푽-categories.Let’s define Nat(푿, 풀) as the object represent- ing the 푽-enriched natural transformations 푿 → 풀; that is, the subobject of 푋 Fun(푿, 풀) × Fun(푿, 풀) × 푉1 of those

푋 (퐹∶ Fun(푿, 풀), 퐺∶ Fun(푿, 풀), 훼∶ 푉1 ) such that, in context 푥, 푥0, 푥1 ∶ 푋, the axioms

e(훼, 푥)∶ 핀푽 → Hom풀(e(퐹0, 푥), e(퐹0, 푥))∶ 푉1 and 푽 e(훼,푥1)⊗ e(퐹1,(푥0,푥1))

Hom풀(e(퐹0, 푥1), e(퐺0, 푥1)) Hom푿(푥0, 푥1) 푽 ⊗ Hom풀(e(퐹0, 푥0), e(퐹0, 푥1))

푽 e(퐺1,(푥0,푥1))⊗ e(훼,푥0) ∘풀(e(퐹0,푥0),e(퐹0,푥1),e(퐺0,푥1))

Hom풀(e(퐺0, 푥0), e(퐺0, 푥1)) 푽 Hom풀(e(퐹0, 푥0), e(퐺0, 푥1)) ⊗ Hom풀(e(퐹0, 푥0), e(퐺0, 푥0))

∘풀(e(퐹0,푥0),e(퐺0,푥0),e(퐺0,푥1))

55 3. Internal Enriched Categories hold. As before, we now validate the intuition that Nat(푿, 풀) represents the object of 푽-natural transformations 푿 → 풀. By doing that, we prove that the enrichment of 푽Catℰ over ℰ extends to an enrichment over Catℰ; in other words, that two 푽-enriched categories yield an internal category in ℰ whose underlying standard category is that of 푽-functors between them and their natural transformations.

Proposition 3.3.2. There is a Catℰ-enriched category whose underlying cat- egory is isomorphic to 푽Catℰ (and, with abuse of notation, it shall be called in the same way). Such enrichment extends that of proposition 3.3.1. That is, for all 푽-enriched categories 푿 and 풀, the natural bijection (3.6) extends to an isomorphism of categories

(ퟙ , (푿, 풀)) ≅ 푽 (푿, 풀). Catℰ Catℰ Hom푽Catℰ Catℰ (3.7) 푿 풀 풁 푽 (푿, 풀) Proof. Let , and be -categories.Let’s define the category Hom푽Catℰ in ℰ as:

Object of objects: let Hom (푿, 풀) be Fun(푿, 풀). 푽Catℰ 0 Object of arrows: let Hom (푿, 풀) be Nat(푿, 풀) with the first and second 푽Catℰ 1 projections as source and target, respectively.

Composition: In context (퐹, 퐺, 훼), (퐺, 퐻, 훽)∶ Nat(푿, 풀), composition is de- fined as

훽 ∘Hom (푿,풀) 훼 ≔ (퐹, 퐻, 휆푥∶ 푋. e(훽, 푥) ∘푽 e(훼, 푥)∶ 푉1)∶ Nat(푿, 풀). 푽Catℰ

Identity: in context 퐹∶ Fun(푿, 풀), identity is defined as

idHom (푿,풀)(퐹) ≔ (퐹, 퐹, 휆푥∶ 푋. id풀(e(퐹0, 푥))∶ 푉1)∶ Nat(푿, 풀). 푽Catℰ

The composition

∘ (푿, 풀, 풁)∶ (풀, 풁) ×Catℰ (푿, 풀) → (푿, 풁) 푽Catℰ Hom푽Catℰ Hom푽Catℰ Hom푽Catℰ is the functor which, on the object component, acts as the composition of functors in proposition 3.3.1. On the morphism component,

퐹′(∘ ) 퐹, ⎛ 푽Catℰ 0 ⎞ ⎜ ⎟ (퐹′, 퐺′, 훽)(∘ ) (퐹, 퐺, 훼) ≔ ⎜ 퐺′(∘ ) 퐺, ⎟ 푽Catℰ 1 ⎜ 푽Catℰ 0 ⎟ ⎝휆푥∶ 푋. e(훽, e(퐺0, 푥)) ∘풁 e(퐹0, e(훼, 푥))⎠

56 3.4. Profunctors and Extranatural Transformations

(which is one out of two equivalent ways to define composition of natural transformations). The identity

(푿)∶ 핀 → (푿, 푿) id푽Catℰ 푽Catℰ Hom푽Catℰ targets the identity functor in Fun(푿, 푿) and the identity natural transfor- mation on it in Nat(푿, 푿). Finally, the object and morphism components of the isomorphism (3.7) are obtained by applications of the exponential transpose.

There is abuse of notation in that 푽Catℰ is enriched both in ℰ and in (푿, 풀) Catℰ, and thus Hom푽Catℰ can either be an object or an internal cate- ℰ (푿, 풀) gory in . Moreover, Hom푽Catℰ as an object is the object of objects of (푿, 풀) ℰ Hom푽Catℰ as an internal category in .

3.4. Profunctors and Extranatural Transformations

In the following, we will need the notion of end.In order to properly define ends, though, it is useful to dedicate some time to the treatment of profunctors and extranatural transformations, which will be the main topic of the present section.This will allow for a very general and elegant theory of ends, requiring no unnecessary assumptions. In standard enriched category theory, are normally defined as certain functors into the enriching category. Such a notion, though, is well- defined only if the enriching category is monoidal closed and thus enriched over itself. The same situation presents itself in the internal context. Luckily, by stating the definitions carefully, it is possible to introduce profunctors, extranatural transformations and ends without requiring extra assumptions on the enriching category.

Definition 3.4.1 (profunctor). Let 푿 and 풀 be 푽-enriched categories. A 푽- enriched profunctor 푃∶ 푿 ↛ 풀 is given by

Object component: an arrow 푃0 ∶ 푌 × 푋 → 푉0;

Morphism component: an arrow 푃1 ∶ (푌 × 푋) × (푌 × 푋) → 푉1 of shape

푥0, 푥1 ∶ 푋, 푦0, 푦1 ∶ 푌 ⊢ 푃1((푦0, 푥0), (푦1, 푥1))∶ Hom풀(푦1, 푦0) ⊗ 푃0(푦0, 푥0) ⊗ Hom푿(푥0, 푥1) → 푃0(푦1, 푥1)∶ 푉1;

57 3. Internal Enriched Categories

satisfying, in context 푥, 푥0, 푥1, 푥2 ∶ 푋, 푦, 푦0, 푦1, 푦2 ∶ 푌, the axioms

Hom풀(푦2,푦1)⊗푃1((푦0,푥0),(푦1,푥1))⊗Hom푿(푥1,푥2)

Hom풀(푦2, 푦1) ⊗ Hom풀(푦1, 푦0) Hom풀(푦2, 푦1) ⊗ 푃0(푦0, 푥0)⊗ ⊗ 푃0(푦1, 푥1)⊗ Hom푿(푥0, 푥1) ⊗ Hom푿(푥1, 푥2) Hom푿(푥1, 푥2)

∘풀(푦0,푦1,푦2)⊗푃0(푦0,푥0)⊗∘푿(푥0,푥1,푥2) 푃1((푦1,푥1),(푦1,푥1))

Hom풀(푦2, 푦0) ⊗ 푃0(푦0, 푥0)⊗ 푃0(푦2, 푥2) Hom푿(푥0, 푥2) 푃1((푦0,푥0),(푦2,푥2)) and id 푃0(푦, 푥) 푃0(푦, 푥)

. id풀(푦)⊗푃0(푦,푥)⊗id푿(푥) 푃1((푦,푥),(푦,푥))

Hom풀(푦, 푦) ⊗ 푃0(푦, 푥) ⊗ Hom푿(푥, 푥)

Remark 3.4.2. Given a profunctor 푃∶ 푿′ ↛ 풀 ′ and functors 퐹∶ 푿 → 푿′ and 퐺∶ 풀 → 풀 ′, there is a composite profunctor 푃(퐺, 퐹)∶ 푿 ↛ 풀 defined, in context 푥0, 푥1 ∶ 푋, 푦0, 푦1 ∶ 푌, as

퐹×퐺 ′ ′ 푃 (푃(퐺, 퐹))0 ≔ 푌 × 푋 −−−→푌 × 푋 −→푉0

(푃(퐺, 퐹))1((푦0, 푥0), (푦1, 푥1)) ≔

Hom풀(푦1, 푦0) ⊗ (푃(퐺, 퐹))0(푦0, 푥0) ⊗ Hom푿(푥0, 푥1) 퐺 (푦 ,푦 )⊗(푃(퐺,퐹)) (푦 ,푥 )⊗퐹 (푥 ,푥 ) 1 1 0 0 0 0 1 0 1

Hom풀′(퐺0(푦1), 퐺0(푦0)) ⊗ 푃0(퐺0(푦0), 퐹0(푥0)) ⊗ Hom푿′(퐹0(푥0), 퐹0(푥1))

푃1((퐺0(푦0),퐹0(푥0)),(퐺0(푦1),퐹0(푥1)))

푃0(퐺0(푦1), 퐹0(푥1)) = (푃(퐺, 퐹))0(푦1, 푥1).

Example 3.4.3. Any 푽-enriched category 푿 has an associated profunctor in- duced by the internal hom, Hom푿 ∶ 푿 ↛ 푿, where (Hom푿)0 is the internal hom of 푿 and (Hom푿)1 is given by the composition in 푿. Example 3.4.4. Let 퐹∶ 푿 → 풀 be a 푽-enriched functor. Then, there is a 푽- enriched profunctor Hom풀(‐, 퐹)∶ 푿 ↛ 풀 given by the composition of Hom풀 and 퐹. Analogously, there is a 푽-enriched profunctor Hom풀(퐹, ‐)∶ 풀 ↛ 푿.

58 3.4. Profunctors and Extranatural Transformations

푽 핀 ↛ 핀 Example 3.4.5. The -enriched profunctors 푽Catℰ 푽Catℰ are the same 핀 → 푽 thing as the internal functors Catℰ . We shall now give a definition of extranatural transformation in the context of internal enriched categories.That is, a transformation between profunctors that is (ordinary-)natural in some variables and extranatural in others (the meaning of which is clarified in the definition). Notice that some occurrences of identity arrows of enriched categories (such as id푿(푥, 푥)) have been omitted in the definition’s axioms to improve clarity. Definition 3.4.6 (extranatural transformation). Let 푃∶ 푿⊗ 풀 ↛ 풀 and 푄∶ 푿⊗ 풁 ↛ 풁 be 푽-enriched profunctors. A 푽-enriched extranatural transformation 휖∶ 푃 → 푄 is given by a morphism 휖∶ 푋 × 푌 × 푍 → 푉1 of shape

푥∶ 푋, 푦∶ 푌, 푧∶ 푍 ⊢ 휖(푥, 푦, 푧)∶ 푃0(푥, 푦, 푦) → 푄0(푥, 푧, 푧)∶ 푉1 satisfying, in context 푥0, 푥1 ∶ 푋, 푦∶ 푌, 푧∶ 푍, the axiom

휖(푥0,푦,푧)⊗Hom푿(푥0,푥1)

푃0(푥0, 푦, 푦) ⊗ Hom푿(푥0, 푥1) 푄0(푥0, 푧, 푧) ⊗ Hom푿(푥0, 푥1)

푃1((푥0,푦,푦),(푥1,푦,푦)) 푄1((푥0,푧,푧),(푥1,푧,푧))

휖(푥1,푦,푧) 푃0(푥1, 푦, 푦) 푄0(푥1, 푧, 푧)

(naturality in 푿); in context 푥∶ 푋, 푦0, 푦1 ∶ 푌, 푧∶ 푍, the axiom

푃1((푥,푦0,푦1),(푥,푦1,푦1))

푃0(푥, 푦0, 푦1) ⊗ Hom풀(푦0, 푦1) 푃0(푥, 푦1, 푦1)

푃1((푥,푦0,푦1),(푥,푦0,푦0)) 휖(푥,푦1,푧)

휖(푥,푦0,푧) 푃0(푥, 푦0, 푦0) 푄0(푥, 푧, 푧)

(extranaturality in 풀); and, in context 푥∶ 푋, 푦∶ 푌, 푧0, 푧1 ∶ 푍, the axiom

휖(푥,푦,푧1)⊗Hom풁(푧0,푧1)

푃0(푥, 푦, 푦) ⊗ Hom풁(푧0, 푧1) 푄0(푥, 푧1, 푦1) ⊗ Hom풁(푧0, 푧1)

휖(푥,푦,푧0)⊗Hom풁(푧0,푧1) 푄1((푥,푧1,푧1),(푥,푧0,푧1))

푄1((푥,푧0,푧0),(푥,푧0,푧1)) 푄0(푥, 푧0, 푧0) ⊗ Hom풁(푧0, 푧1) 푄0(푥, 푧0, 푧1)

(extranaturality in 풁).

59 3. Internal Enriched Categories

The definition of extranatural transformation supports the calculus of ends and coends (as defined in the next section). For applications, it is impor- tant to have definitions parametrized by an additional category representing “ordinary-natural” variables (that is 푿 in our definition). However, we shall not draw further attention to this parametrization in our use of ends and coends, as those are defined relatively to profunctors having “extra-natural” variables only (that are 풀 and 풁 in our definition). Notice that there are many special cases of this definition. Example 3.4.7. An extranatural transformation 휖∶ 퐴 → 푃 between the pro- 퐴∶ 핀 ↛ 핀 퐴∶ ퟙ → 푽 functors 푽Catℰ 푽Catℰ (or, equivalently, a functor Catℰ ) and 푃∶ 푿 ↛ 푿 only needs to satisfy the extranaturality axiom on 푿. Example 3.4.8. An extranatural transformation 휖∶ 푃 → 푄 between the pro- 푃, 푄∶ 푿 ↛ 핀 푿 functors 푽Catℰ only needs to satisfy the naturality axiom on . In standard category theory, profunctors and extranatural transformations form a . Defining the composition of profunctors requires the use of coends, which have not yet been introduced. Anyway, we are not going to need such general composition, but it will be useful to define just a few special cases, for use in the following sections. 푽 푃∶ 푿 ↛ 푿 퐴∶ ퟙ → 푽 푽 Given a -enriched profunctor , a functor Catℰ , a - enriched functor 퐹∶ 풀 → 푿, and a 푽-enriched extranatural transformation 휖∶ 퐴 → 푃, there is an horizontal composition 휖 ∗ 퐹∶ 퐴 → 푃(퐹, 퐹) given by

휖(퐹0(푦)) 푦∶ 푌 ⊢ (휖퐹)(푦) ≔ 퐴 −−−−−−→푃0(퐹0(푦), 퐹0(푦))∶ 푉1. 푽 푃∶ 푿 ↛ 푿 퐴∶ ퟙ → 푽 Moreover, given a -enriched profunctor , a functor Catℰ , a 푽-enriched extranatural transformation 휖∶ 퐴 → 푃, and a natural transfor- ℎ∶ 퐴′ → 퐴∶ ퟙ → 푽 휖 ∘ ℎ∶ 퐴′ → 푃 mation Catℰ , there is an horizontal composition given by ′ ℎ 휖(푦) 푦∶ 푌 ⊢ (휖 ∘푽 ℎ)(푦) ≔ 퐴 −→퐴 −−−→푃0(푦, 푦)∶ 푉1. 푽 푃, 푄∶ 푿 ↛ 핀 푽 Finally, given -enriched profunctors 푽Catℰ, a -enriched ex- tranatural transformation 휖∶ 푃 → 푄 and a 푽-enriched functor 퐹∶ 풀 → 푿, there is an horizontal composition 휖 ∗ 퐹∶ 푃퐹 → 푄퐹 given by

휖(퐹0(푥)) 푦∶ 푌 ⊢ (휖퐹)(푦) ≔ 푃0(퐹0(푥)) −−−−−−→푄0(퐹0(푥))∶ 푉1.

3.5. Ends

Equipped with the tools defined in the previous section, and informed bythe discussion from chapter 2, we are now ready to introduce the notion of end,

60 3.5. Ends which will turn out to be essential to the treatment of exponentials of internal enriched categories and their weighted limits.

Definition 3.5.1 (universal extranatural transformation). Let 푃∶ 푿 ↛ 푿 a 푽 퐸∶ ퟙ → 푽 -enriched profunctor and Catℰ an internal functor. An extranatural 휖∶ 퐸 → 푃 퐸′ ∶ 핀 → 푽 transformation is universal if, given another functor 푽Catℰ and another extranatural transformation 휖′ ∶ 퐸′ → 푃, there exists a unique natural transformation ℎ∶ 퐸′ → 퐸 such that 휖′ = 휖 ∘ ℎ.

By duality, we also have the definition of couniversal natural transformation (so called for lack of better terminology in the literature).

Definition 3.5.2 (couniversal extranatural transformation). Let 푃∶ 푿 ↛ 푿 a 푽 퐸∶ ퟙ → 푽 -enriched profunctor and Catℰ an internal functor. An extranatural 휖∶ 푃 → 퐸 퐸′ ∶ 핀 → transformation is couniversal if, given another functor 푽Catℰ 푽 and another extranatural transformation 휖′ ∶ 푃 → 퐸′, there exists a unique natural transformation ℎ∶ 퐸 → 퐸′ such that 휖′ = ℎ ∘ 휖.

Analogously to what happens in chapter 2, the definition of universal ex- tranatural transformation is not stable under pullback. So, we shall enforce stability explicitly in the definition of end.

Definition 3.5.3 (end). Let 푃∶ 푿 ↛ 푿 a 푽-enriched profunctor. An end for 푃 ∫ 푃∶ ퟙ → 푽 is given by an internal functor 푿 Catℰ and an extranatural trans- formation 휋∶ ∫푿 푃 → 푃 such that, for any object 퐼 of ℰ, the extranatural ∗ ∗ ∗ transformation 퐼 휋∶ 퐼 ∫푿 푃 → 퐼 푃 is universal.

Definition 3.5.4 (coend). Let 푃∶ 푿 ↛ 푿 a 푽-enriched profunctor. A coend 푿 푃 ∫ 푃∶ ퟙ → 푽 for is given by an internal functor Catℰ and an extranatural 푿 transformation 휋∶ 푃 → ∫ 푃 such that, for any object 퐼 of ℰ, the extranatural 푿 transformation 퐼∗휋∶ 퐼∗푃 → 퐼∗ ∫ 푃 is universal.

Analogously to the definition of complete internal category, we say a category has all ends (for lack of better terminology from the literature) if, in every slice, every profunctor has an end, so that the notion is forcefully made stable under pullback.

Definition 3.5.5 (category with all (co)ends). We say that 푽 has all (co)ends if, for every object 퐼 in ℰ and every 퐼∗푽-enriched category 푿, every 퐼∗푽-enriched profunctor 푃∶ 푿 ↛ 푿 has a (co)end.

Let’s note down (without proof) a few properties of ends and coends.

61 3. Internal Enriched Categories

Proposition 3.5.6. It is possible to swap ends (and coends) with each other (that is the so-called Fubini theorem):

∫ ∫ 푃 ((푥, 푦), (푥, 푦)) ≅ ∫ ∫ 푃 ((푥, 푦), (푥, 푦)) ≅ ∫ 푃 (푝, 푝) 푦∶ 푌 푥∶ 푋 0 푥∶ 푋 푦∶ 푌 0 푝∶ 푋×푌 0 푦∶ 푌 푥∶ 푋 푥∶ 푋 푦∶ 푌 푝∶ 푋×푌 ∫ ∫ 푃0((푥, 푦), (푥, 푦)) ≅ ∫ ∫ 푃0((푥, 푦), (푥, 푦)) ≅ ∫ 푃0(푝, 푝).

Moreover, if 푽 is monoidal closed, there is an interchange between the exponen- tial objects and (co)ends:

Hom (푣, ∫ 푃 (푥, 푥)) ≅ ∫ Hom (푣, 푃 (푥, 푥)) 푽 푥∶ 푋 0 푥∶ 푋 푽 0 푥∶ 푋 Hom ( ∫ 푃 (푥, 푥), 푣) ≅ ∫ Hom (푃 (푥, 푥), 푣). 푽 푥∶ 푋 0 푽 0

Let’s introduce a notation for products in 푽 indexed over some object of ℰ which will be helpful in the future.

Notation 3.5.7 (product). Let 푓∶ 푋 → 푉0 be a morphism. Consider the discrete category 퐝퐢퐬(푋) (see example 1.1.9) and the diagram 퐝퐢퐬(퐹)∶ 퐝퐢퐬(푋) → 푽. The limit of that diagram, if it exists, is the product of 푓, and we write it as ∏푥∶ 푋 푓 (푥)∶ 푉0.

Proposition 3.5.8. Assume 푽 is symmetric, complete (in the internal sense) and monoidal closed, and it has equalizers. Then, 푽 has all ends.

Proof. Notice that all the hypothesis are stable under slicing.Then, the proof reduces to show that, given the above assumptions, any 푽-enriched profunctor 푃∶ 푿 ↛ 푿 has an end. There are two morphisms

휙, 휓∶ ∏ 푃0(푥, 푥) → ∏ Hom푽(Hom푿(푥0, 푥1), 푃0(푥0, 푥1)) 푥∶ 푋 푥0,푥1 ∶ 푋 which we define component-wise as

∏푥∶ 푋 푃0(푥, 푥)

푽 id푿(푥0)⊗ 휋(푥0)

휙(푥0, 푥1)∶ 푽 Hom푿(푥0, 푥0) ⊗ 푃0(푥0, 푥0)

푃1((푥0,푥0),(푥0,푥1))

Hom푽(Hom푿(푥0, 푥1), 푃0(푥0, 푥1))

62 3.6. Monoidal Product of Enriched Categories

where 푃1((푥0, 푥0), (푥0, 푥1)) is the exponential transpose of 푃1((푥0, 푥0), (푥0, 푥1)), and ∏푥∶ 푋 푃0(푥, 푥)

푽 id푿(푥1)⊗ 휋(푥1)

휓(푥0, 푥1)∶ 푽 Hom푿(푥1, 푥1) ⊗ 푃0(푥1, 푥1)

푃1((푥1,푥1),(푥0,푥1))

Hom푽(Hom푿(푥0, 푥1), 푃0(푥0, 푥1)) where 푃1((푥1, 푥1), (푥0, 푥1)) is the exponential transpose of 푃1((푥1, 푥1), (푥0, 푥1)). Notice that an extra-natural transformation 휖∶ 퐸 → 푃 induces a morphism 푒∶ 퐸 → ∏푥∶ 푋 푃0(푥, 푥).Then, 휖 being extranatural is equivalent to 푒 equalizing 휙 and 휓. We claim that the equalizer 퐸 of 휙 and 휓 is the end of 푃, and the projection is given by the extranatural transformation

푒 휋(푥) 푥∶ 푋 ⊢ 휖(푥) ≔ 퐸 −→ ∏ 푃0(푥, 푥) −−−→푃0(푥, 푥). 푥∶ 푋 Indeed, notice that the product and equalizer used to construct the above extranatural transformation are stable under pullback, so stability will not be ′ ′ ′ a concern.Then, let 퐸 ∶ 푉0 and 휖 ∶ 퐸 → 푃 be another extranatural transfor- ′ mation.There is an induced equalizing arrow 푒 ∶ 퐸 → ∏푥∶ 푋 푃0(푥, 푥).Then, define ℎ∶ 퐸′ → 퐸 as the unique arrow making the equalizer 푒 commute with 푒′. But, by construction, ℎ is also the unique arrow making 휖 and 휖′ commute. We could also derive the dual result.

Proposition 3.5.9. Assume 푽 is symmetric, cocomplete (which it is, by the- orem 2.3.13, if and only if it is complete) and monoidal closed, and it has . Then, 푽 has all coends.

3.6. Monoidal Product of Enriched Categories

Standard enriched categories have a monoidal product induced by that of their enriching category, if that is symmetric monoidal. Indeed, symmetry is necessary to define the composition of the . The situation is analogous in the setting of internal enriched categories.

Proposition 3.6.1. If 푽 is a symmetric monoidal category, then so is 푽Catℰ.

푽Catℰ Proof. Let 푿 and 풀 be 푽-categories. The monoidal product 푿 ⊗0 풀 is the 푽-category given by the data:

63 3. Internal Enriched Categories

Underlying object: 푋 × 푌;

Internal hom: in context (푥0, 푦0), (푥1, 푦1)∶ 푋 × 푌, define ((푥 , 푦 ), (푥 , 푦 )) ≔ (푥 , 푥 ) ⊗푽 (푦 , 푦 ); Hom푿⊗푽Catℰ풀 0 0 1 1 Hom푿 0 1 Hom풀 0 1

Composition: in context (푥0, 푦0), (푥1, 푦1), (푥2, 푦2)∶ 푋 × 푌, define

∘ ((푥 , 푦 ), (푥 , 푦 ), (푥 , 푦 )) ≔ 푿⊗푽Catℰ풀 0 0 1 1 2 2 푽 푽 푽 Hom푿(푥1, 푥2) ⊗ Hom풀(푦1, 푦2) ⊗ Hom푿(푥0, 푥1) ⊗ Hom풀(푦0, 푦1)

푽 푽 Hom푿(푥1,푥2)⊗ 휎푽(Hom풀(푦1,푦2),Hom푿(푥0,푥1))⊗ Hom풀(푦0,푦1)

푽 푽 푽 ; Hom푿(푥1, 푥2) ⊗ Hom푿(푥0, 푥1) ⊗ Hom풀(푦1, 푦2) ⊗ Hom풀(푦0, 푦1)

푽 ∘푿(푥0,푥1,푥2)⊗ ∘풀(푦0,푦1,푦2)

푽 Hom푿(푥0, 푥2) ⊗ Hom풀(푦0, 푦2)

푽 Identity: (푥, 푦)∶ 푋 × 푌 푽 (푥, 푦) ≔ (푥) ⊗ (푦) in context , define id푿⊗ Catℰ풀 id푿 id풀 . As it can be straightforwardly checked by using the internal logic, these data satisfy the axioms 3.1 to 3.3. Let 퐹∶ 푿 → 풀 and 퐺∶ 푾 → 풁 be 푽-enriched functors. Define the monoidal 푽Catℰ product 퐹 ⊗1 퐺 as: (퐹 ⊗푽Catℰ 퐺) ≔ 퐹 × 퐺 ∶ 푋 × 푊 → 푌 × 푍 Object component: 1 0 0 0 ;

Morphism component: in context (푥0, 푤0), (푥1, 푤1)∶ 푋 × 푊, define

(퐹 ⊗푽Catℰ 퐺) ((푥 , 푤 ), (푥 , 푤 )) ≔ 퐹 (푥 , 푥 ) ⊗푽 퐺 (푤 , 푤 ). 1 1 0 0 1 1 1 0 1 1 0 1 which satisfy the axiom 3.4. 푽Catℰ That gives a functor ⊗ ∶ 푽Catℰ × 푽Catℰ → 푽Catℰ satisfying the asso- ciativity axiom up to a suitable associator isomorphism. 핀 푽 The monoidal unit 푽Catℰ is the -category given by the data:

Underlying object: ퟙ풞;

Internal hom: 핀ℳ ∶ ퟙ풞 × ퟙ풞 ≅ ퟙ풞 → 푉0; 푽 풞 풞 Composition: 휌푽(핀푽) ∘푽 (휌푽(핀푽) ⊗1 id푽(핀푽))∶ ퟙ풞 × ퟙ풞 × ퟙ풞 → 푉1;

Identity: id푽(핀푽)∶ ퟙ풞 → 푉1.

64 3.7. Exponentials of Internal Enriched Categories

The unit satisfies the unitarity axioms up to left/right unitor isomorphisms. Given 푽-categories 푿 and 풀, their symmetry

휎 (푿, 풀)∶ 푿 ⊗푽Catℰ 풀 → 풀 ⊗푽Catℰ 푿 푽Catℰ is defined as (푥, 푦)∶ 푋 × 푌 ⊢ 휎 (푿, 풀) (푥, 푦) ≔ (푦, 푥)∶ 푌 × 푋 푽Catℰ 0 (푥 , 푦 ), (푥 , 푦 )∶ 푋 × 푌 ⊢ 휎 (푿, 풀) ((푥 , 푦 ), (푥 , 푦 )) 0 0 1 1 푽Catℰ 1 0 0 1 1 푽 Hom푿(푥0, 푥1) ⊗ Hom풀(푦0, 푦1) ≔ ∶ 푉 . 휎푽(Hom푿(푥0,푥1),Hom풀(푦0,푦1)) 1

푽 Hom풀(푦0, 푦1) ⊗ Hom푿(푥0, 푥1).

That satisfies the monoidal symmetry axioms.

3.7. Exponentials of Internal Enriched Categories

Remember that in section 3.3 we showed how, given two 푽-enriched categories 푿 and 풀, there is an object Fun(푿, 풀) in ℰ representing 푽-enriched functors 푿 → 풀, yielding an enrichment of 푽Catℰ in ℰ.Then, we extended the previ- ous argument assigning to 푿 and 풀 an object Nat(푿, 풀) in ℰ of 푽-enriched natural transformations between 푽-enriched functors 푿 → 풀. We thus have an internal category in ℰ of 푽-enriched functors and their 푽-enriched natural transformations, yielding an enrichment of 푽Catℰ in Catℰ. We now prove that the category of internal 푽-enriched categories is monoidal closed with respect to the monoidal product defined in section 3.6.That re- quires associating to 푿 and 풀 an internal 푽-enriched category whose under- lying object is Fun(푿, 풀), and whose hom-morphism represents 푽-enriched natural transformations as an object of 푽. As in standard enriched Category Theory, that is provided by an end. In this section, assume ℰ is locally cartesian closed and 푽 is symmetric monoidal (so that 푽Catℰ is too, by proposition 3.6.1) and it has all ends. Let’s begin by defining a suitable candidate to be the exponential of two internal enriched categories.

Definition 3.7.1 (exponential 푽-category). Let 푿 and 풀 be 푽-categories. The exponential of 푿 and 풀 is the 푽-enriched category [푿, 풀] defined as follows.

Underlying object: is given by Fun(푿, 풀), the object of 푽-enriched functors between 푿 and 풀.

65 3. Internal Enriched Categories

Hom: is given by

퐹, 퐺∶ Fun(푿, 풀) ⊢ Hom (퐹, 퐺) ≔ ∫ Hom (e(퐹 , 푥), e(퐺 , 푥))∶ 푉 [푿,풀] 푥∶ 푋 풀 0 0 0 and it comes with an extranatural transformation

푥∶ 푋, 퐹, 퐺∶ Fun(푿, 풀) ⊢ 휋(퐹, 퐺, 푥) ≔ Hom[푿,풀](퐹, 퐺) → Hom풀(e(퐹0, 푥), e(퐺0, 푥))∶ 푉1.

Composition: is given by an arrow

퐹, 퐺, 퐻∶ Fun(푿, 풀) ⊢ 푽 ∘[푿,풀](퐹, 퐺, 퐻)∶ Hom[푿,풀](퐺, 퐻)⊗ Hom[푿,풀](퐹, 퐺) → Hom[푿,풀](퐹, 퐻)

defined as the unique arrow induced by the end on the extranatural transformation

퐹, 퐺, 퐻∶ Fun(푿, 풀), 푥∶ 푿 ⊢ 푽 Hom[푿,풀](퐺, 퐻) ⊗ Hom[푿,풀](퐹, 퐺)

푽 휋푥⊗ 휋푥

푽 ∶ 푉1. Hom풀(e(퐺0, 푥), e(퐻0, 푥)) ⊗ Hom풀(e(퐹0, 푥), e(퐺0, 푥))

∘풀(e(퐹0,푥),e(퐺0,푥),e(퐻0,푥))

Hom풀(e(퐹0, 푥), e(퐻0, 푥))

Identity: is given by an arrow

퐹∶ Fun(푿, 풀) ⊢ id[푿,풀](퐹)∶ 핀푽 → Hom[푿,풀](퐹, 퐹)

defined as the unique arrow induced by the end on the extranatural transformation

id풀(e(퐹0,푥)) 퐹∶ Fun(푿, 풀), 푥∶ 푋 ⊢ 핀푽 −−−−−−−−−→ Hom풀(e(퐹0, 푥), e(퐹0, 푥))∶ 푉1.

Often in this dissertation we have omitted routine calculations, but in this case it seems instructional to spell out the calculations in detail. Let 푿, 풀 and 풁 be 푽-categories.To prove that [풀, 풁] is indeed the exponential object of 풀 and 풁, we need to show that 푽-enriched functors 푿 ⊗푽Catℰ 풀 → 풁 correspond to 푽-enriched functors 푿 → [풀, 풁].That is, that there is a natural bijection 푽Catℰ 푽Catℰ(푿 ⊗ 풀, 풁) ≅ 푽Catℰ(푿, [풀, 풁]).

66 3.7. Exponentials of Internal Enriched Categories

We shall first give the two constructions yielding the correspondence, and then show that these are mutually inverse. Let’s first give the construction of

̄ 푽Catℰ (‐)∶ 푽Catℰ(푿 ⊗ 풀, 풁) → 푽Catℰ(푿, [풀, 풁]).

Let 퐹∶ 푿 ⊗푽Catℰ 풀 → 풁 be a 푽-enriched functor. Define the transposed 푽- enriched functor 퐹̄ ∶ 푿 → [풀, 풁] as follows.

Object component: is given by

̄ 푥∶ 푋 ⊢ 퐹0(푥)0 ≔ 휆푦∶ 푌. 퐹0(푥, 푦)∶ 푍 and

Hom풀(푦0, 푦1)

푽 id푿(푥)⊗ id 푥∶ 푋 ⊢ 퐹̄ (푥) ≔ 휆푦 , 푦 ∶ 푌. 푽 ∶ 푉 . 0 1 0 1 Hom푿(푥, 푥) ⊗ Hom풀(푦0, 푦1) 1

퐹1((푥,푦0),(푥,푦1))

Hom풁(퐹0(푥, 푦0), 퐹0(푥, 푦1))

Morphism component: is an arrow of shape

̄ ̄ ̄ 푥0, 푥1 ∶ 푋 ⊢ 퐹1(푥0, 푥1)∶ Hom푿(푥0, 푥1) → Hom[풀,풁](퐹0(푥0), 퐹0(푥1))∶ 푉1

defined, in context 푥0, 푥1 ∶ 푋, 푦∶ 푌, as the arrow yielded by the end over the extranatural transformation

Hom푿(푥0, 푥1)

푽 id⊗ id풀(푦) (푥 , 푥 ) ⊗푽 (푦, 푦) = ((푥 , 푦), (푥 , 푦)) Hom푿 0 1 Hom풀 Hom푿⊗푽Catℰ풀 0 1

퐹1((푥0,푦),(푥1,푦)) ̄ ̄ Hom풁(퐹0(푥0, 푦), 퐹0(푥1, 푦)) = Hom풁(e(퐹0(푥0), 푦), e(퐹0(푥1), 푦))

̄ ̄ ̄ so that the above arrow is the composition 휋(퐹0(푥0), 퐹0(푥1), 푦)퐹1(푥0, 푥1). Note that here, by the definitions, we have genuine equality of objects, not mere isomorphisms.

67 3. Internal Enriched Categories

̄ Let’s prove that 퐹 is functorial. In context 푥0, 푥1, 푥2 ∶ 푋, 푦∶ 푌, consider the following composite.

푽 Hom푿(푥1, 푥2) ⊗ Hom푿(푥0, 푥1) ̄ 푽 ̄ 퐹1(푥1,푥2)⊗ 퐹1(푥1,푥2) ̄ ̄ 푽 ̄ ̄ Hom[풀,풁](퐹0(푥1), 퐹0(푥2)) ⊗ Hom[풀,풁](퐹0(푥1), 퐹0(푥2)) ̄ ̄ ̄ ∘[풀,풁](퐹0(푥0),퐹0(푥1),퐹0(푥2)) ̄ ̄ Hom[풀,풁](퐹0(푥0), 퐹0(푥2)) ̄ ̄ 휋(퐹0(푥0),퐹0(푥2),푦) ̄ ̄ Hom풁(e(퐹0(푥0), 푦), e(퐹0(푥2), 푦))

̄ By definition of ∘[풀,풁] and 퐹0, the previous is equal to the composite

푽 Hom푿(푥1, 푥2) ⊗ Hom푿(푥0, 푥1) ̄ 푽 ̄ 퐹1(푥1,푥2)⊗ 퐹1(푥0,푥1) ̄ ̄ 푽 ̄ ̄ Hom[풀,풁](퐹0(푥1), 퐹0(푥2)) ⊗ Hom[풀,풁](퐹0(푥0), 퐹0(푥1))

̄ ̄ 푽 ̄ ̄ 휋(퐹0(푥1),퐹0(푥2),푦)⊗ 휋(퐹0(푥0),퐹0(푥1),푦) 푽 Hom풁(퐹0(푥1, 푦), 퐹0(푥2, 푦)) ⊗ Hom풁(퐹0(푥0, 푦), 퐹0(푥1, 푦))

∘풁(퐹0(푥0,푦),퐹0(푥1,푦),퐹0(푥2,푦))

Hom풁(퐹0(푥0, 푦), 퐹0(푥2, 푦))

̄ which, by definition of 퐹1, is equal to the composite

푽 Hom푿(푥1, 푥2) ⊗ Hom푿(푥0, 푥1)

푽 푽 푽 id⊗ id풀(푦)⊗ id⊗ id풀(푦) 푽 푽 푽 Hom푿(푥1, 푥2) ⊗ Hom풀(푦, 푦) ⊗ Hom푿(푥0, 푥1) ⊗ Hom풀(푦, 푦)

푽 퐹1((푥1,푦),(푥2,푦))⊗ 퐹1((푥0,푦),(푥1,푦)) 푽 Hom풁(퐹0(푥1, 푦), 퐹0(푥2, 푦)) ⊗ Hom풁(퐹0(푥0, 푦), 퐹0(푥1, 푦))

∘[풀,풁](퐹0(푥0,푦),퐹0(푥1,푦),퐹0(푥2,푦))

Hom풁(퐹0(푥0, 푦), 퐹0(푥2, 푦))

68 3.7. Exponentials of Internal Enriched Categories which, by functoriality of 퐹, is equal to the composite

푽 Hom푿(푥1, 푥2) ⊗ Hom푿(푥0, 푥1)

∘푿(푥0,푥1,푥2)

Hom푿(푥0, 푥2) 푽 . id⊗ id풀(푦) 푽 Hom푿(푥0, 푥2) ⊗ Hom풀(푦, 푦)

퐹1((푥0,푦),(푥2,푦))

Hom풁(퐹0(푥0, 푦), 퐹0(푥2, 푦))

By applying the argument backwards, we get that the map we started from is equal to 푽 Hom푿(푥1, 푥2) ⊗ Hom푿(푥0, 푥1)

∘푿(푥0,푥1,푥2)

Hom푿(푥0, 푥2) ̄ 퐹1(푥0,푥2) ̄ ̄ Hom[풀,풁](퐹0(푥0), 퐹0(푥2)) ̄ ̄ 휋(퐹0(푥0),퐹0(푥2),푦) ̄ ̄ Hom풁(e(퐹0(푥0), 푦), e(퐹0(푥2), 푦)) and with this we have proved functoriality. Let’s now give the construction of

̂ 푽Catℰ (‐)∶ 푽Catℰ(푿, [풀, 풁]) → 푽Catℰ(푿 ⊗ 풀, 풁).

Let 퐺∶ 푿 → [풀, 풁] be a 푽-enriched functor. Define the transposed functor 퐺∶̂ 푿 ⊗푽Catℰ 풀 → 풁 as follows.

̂ Object component: is the arrow 퐺0 ∶ 푋 × 푌 → 푍 defined as

̂ 푥∶ 푋, 푦∶ 푌 ⊢ 퐺0(푥, 푦) ≔ e(퐺0(푥)0, 푦)∶ 푍.

̂ Morphism component: is the arrow 퐺1 ∶ 푋 × 푌 × 푋 × 푌 → 푉1 defined as

̂ 푥0, 푥1 ∶ 푋, 푦0, 푦1 ∶ 푌 ⊢ 퐺1((푥0, 푦0), (푥1, 푦1)) ≔

69 3. Internal Enriched Categories

((푥 , 푦 ), (푥 , 푦 )) = (푥 , 푥 ) ⊗푽 (푦 , 푦 ) Hom푿⊗푽Catℰ풀 0 0 1 1 Hom푿 0 1 Hom풀 0 1

푽 퐺1(푥0,푥1)⊗ e(퐺0(푥0)1,(푦0,푦1))

푽 Hom[풀,풁](퐺0(푥0), 퐺0(푥1)) ⊗ Hom풁(e(퐺0(푥0)0, 푦0), e(퐺0(푥0)0, 푦1))

푽 휋(퐺0(푥0),퐺0(푥1),푦1)⊗ id

푽 Hom풁(e(퐺0(푥0)0, 푦1), e(퐺0(푥1)0, 푦1)) ⊗ Hom풁(e(퐺0(푥0)0, 푦0), e(퐺0(푥0)0, 푦1))

∘풁(e(퐺0(푥0)0,푦0),e(퐺0(푥0)0,푦1),e(퐺0(푥1)0,푦1))

̂ ̂ Hom풁(e(퐺0(푥0)0, 푦0), e(퐺0(푥1)0, 푦1)) = Hom풁(퐺0(푥0, 푦0), 퐺0(푥1, 푦1)).

̂ Let’s prove that 퐺 is functorial. In context 푥0, 푥1, 푥2 ∶ 푋, 푦0, 푦1, 푦2 ∶ 푌, consider the composite

((푥 , 푦 ), (푥 , 푦 )) ⊗푽 ((푥 , 푦 ), (푥 , 푦 )) Hom푿⊗푽Catℰ풀 1 1 2 2 Hom푿⊗푽Catℰ풀 0 0 1 1

̂ 푽 ̂ 퐺1((푥1,푦1),(푥2,푦2))⊗ 퐺1((푥0,푦0),(푥1,푦1))

̂ ̂ 푽 ̂ ̂ Hom풁(퐺0(푥1, 푦1), 퐺0(푥2, 푦2)) ⊗ Hom풁(퐺0(푥0, 푦0), 퐺0(푥1, 푦1))

̂ ̂ ̂ ∘풁(퐺0(푥0,푦0),퐺0(푥1,푦1),퐺0(푥2,푦2))

̂ ̂ Hom풁(퐺0(푥0, 푦0), 퐺0(푥2, 푦2)).

70 3.7. Exponentials of Internal Enriched Categories

By definition of 퐺̂, that is equal to the composite arrow

푽 Hom푿(푥1, 푥2) ⊗ Hom풀(푦1, 푦2) 푽 푽 ⊗ Hom푿(푥0, 푥1) ⊗ Hom풀(푦0, 푦1)

푽 퐺1(푥1,푥2)⊗ e(퐺0(푥1)1,(푦1,푦2))

푽 푽 ⊗ 퐺1(푥0,푥1)⊗ e(퐺0(푥1)1,(푦0,푦1))

Hom[풀,풁](퐺0(푥1), 퐺0(푥2)) 푽 ⊗ Hom풁(e(퐺0(푥1)0, 푦1), e(퐺0(푥1)0, 푦2)) 푽 ⊗ Hom[풀,풁](퐺0(푥0), 퐺0(푥1)) 푽 ⊗ Hom풁(e(퐺0(푥1)0, 푦0), e(퐺0(푥1)0, 푦1))

푽 푽 푽 휋(퐺0(푥1),퐺0(푥2),푦2)⊗ id⊗ 휋(퐺0(푥0),퐺0(푥1),푦0)⊗ id

Hom풁(e(퐺0(푥1)0, 푦2), e(퐺0(푥2)0, 푦2)) 푽 ⊗ Hom풁(e(퐺0(푥1)0, 푦1), e(퐺0(푥1)0, 푦2)) 푽 ⊗ Hom풁(e(퐺0(푥0)0, 푦0), e(퐺0(푥1)0, 푦0)) 푽 ⊗ Hom풁(e(퐺0(푥1)0, 푦0), e(퐺0(푥1)0, 푦1))

∘풁(e(퐺0(푥1)0,푦1),e(퐺0(푥1)0,푦2),e(퐺0(푥2)0,푦2))

푽 ⊗ ∘풁(e(퐺0(푥0)0,푦0),e(퐺0(푥1)0,푦0),e(퐺0(푥1)0,푦1))

Hom풁(e(퐺0(푥1)0, 푦1), e(퐺0(푥2)0, 푦2)) 푽 ⊗ Hom풁(e(퐺0(푥0)0, 푦0), e(퐺0(푥1)0, 푦1))

∘풁(e(퐺0(푥0)0,푦0),e(퐺0(푥1)0,푦1),e(퐺0(푥2)0,푦2))

Hom풁(e(퐺0(푥0)0, 푦0), e(퐺0(푥2)0, 푦2)).

By shuffling the compositions, we get another composite equal to the previous

71 3. Internal Enriched Categories one,

푽 Hom푿(푥1, 푥2) ⊗ Hom풀(푦1, 푦2) 푽 푽 ⊗ Hom푿(푥0, 푥1) ⊗ Hom풀(푦0, 푦1) 푽 퐺1(푥1,푥2)⊗ e(퐺0(푥1)1,(푦1,푦2)) 푽 푽 ⊗ 퐺1(푥0,푥1)⊗ e(퐺0(푥1)1,(푦0,푦1)) 푽 Hom[풀,풁](퐺0(푥1), 퐺0(푥2)) ⊗ Hom풁(e(퐺0(푥1)0, 푦1), e(퐺0(푥1)0, 푦2)) 푽 푽 ⊗ Hom[풀,풁](퐺0(푥0), 퐺0(푥1)) ⊗ Hom풁(e(퐺0(푥1)0, 푦0), e(퐺0(푥1)0, 푦1)) 푽 휋(퐺0(푥1),퐺0(푥2),푦2)⊗ 휋(퐺0(푥0),퐺0(푥1),푦0) 푽 ⊗ ∘풁(e(퐺0(푥1)0,푦0),e(퐺0(푥1)0,푦1),e(퐺0(푥1)0,푦2))

Hom풁(e(퐺0(푥1)0, 푦2), e(퐺0(푥2)0, 푦2)) 푽 ⊗ Hom풁(e(퐺0(푥1)0, 푦0), e(퐺0(푥1)0, 푦2)) 푽 ⊗ Hom풁(e(퐺0(푥0)0, 푦0), e(퐺0(푥1)0, 푦0))

∘풁(e(퐺0(푥0)0,푦0),e(퐺0(푥1)0,푦0),e(퐺0(푥1)0,푦2),e(퐺0(푥2)0,푦2))

Hom풁(e(퐺0(푥0)0, 푦0), e(퐺0(푥2)0, 푦2)) which, by functoriality of 퐺, is equal to

푽 Hom푿(푥1, 푥2) ⊗ Hom풀(푦1, 푦2) 푽 푽 ⊗ Hom푿(푥0, 푥1) ⊗ Hom풀(푦0, 푦1)

푽 푽 퐺1(푥1,푥2)⊗ ∘풀(푦0,푦1,푦2)⊗ 퐺1(푥0,푥1)

푽 Hom[풀,풁](퐺0(푥1), 퐺0(푥2)) ⊗ Hom풀(푦0, 푦2) 푽 ⊗ Hom[풀,풁](퐺0(푥0), 퐺0(푥1)) 푽 휋(퐺0(푥1),퐺0(푥2),푦2)⊗ e(퐺0(푥1)1,(푦0,푦2)) 푽 ⊗ 휋(퐺0(푥0),퐺0(푥1),푦0)

Hom풁(e(퐺0(푥1)0, 푦2), e(퐺0(푥2)0, 푦2)) 푽 ⊗ Hom풁(e(퐺0(푥1)0, 푦0), e(퐺0(푥1)0, 푦2)) 푽 ⊗ Hom풁(e(퐺0(푥0)0, 푦0), e(퐺0(푥1)0, 푦0))

∘풁(e(퐺0(푥0)0,푦0),e(퐺0(푥1)0,푦0),e(퐺0(푥1)0,푦2),e(퐺0(푥2)0,푦2))

Hom풁(e(퐺0(푥0)0, 푦0), e(퐺0(푥2)0, 푦2))

72 3.7. Exponentials of Internal Enriched Categories which, by extranaturality of 휋, is equal to

푽 Hom푿(푥1, 푥2) ⊗ Hom풀(푦1, 푦2) 푽 푽 ⊗ Hom푿(푥0, 푥1) ⊗ Hom풀(푦0, 푦1)

푽 푽 퐺1(푥1,푥2)⊗ 퐺1(푥0,푥1)⊗ ∘풀(푦0,푦1,푦2)

Hom[풀,풁](퐺0(푥1), 퐺0(푥2)) 푽 ⊗ Hom[풀,풁](퐺0(푥0), 퐺0(푥1)) 푽 ⊗ Hom풀(푦0, 푦2) 푽 휋(퐺0(푥1),퐺0(푥2),푦2)⊗ 휋(퐺0(푥0),퐺0(푥1),푦2) 푽 ⊗ e(퐺0(푥0)1,(푦0,푦2))

Hom풁(e(퐺0(푥1)0, 푦2), e(퐺0(푥2)0, 푦2)) 푽 ⊗ Hom풁(e(퐺0(푥0)0, 푦2), e(퐺0(푥1)0, 푦2)) 푽 ⊗ Hom풁(e(퐺0(푥0)0, 푦0), e(퐺0(푥0)0, 푦2))

∘풁(e(퐺0(푥0)0,푦0),e(퐺0(푥0)0,푦2),e(퐺0(푥1)0,푦2),e(퐺0(푥2)0,푦2))

Hom풁(e(퐺0(푥0)0, 푦0), e(퐺0(푥2)0, 푦2)).

By definition of composition in [풀, 풁], and again by functoriality of 퐺, the previous composite is equal to

푽 Hom푿(푥1, 푥2) ⊗ Hom풀(푦1, 푦2) 푽 푽 ⊗ Hom푿(푥0, 푥1) ⊗ Hom풀(푦0, 푦1)

푽 ∘푿(푥0,푥1,푥2)⊗ ∘풀(푦0,푦1,푦2) 푽 Hom푿(푥0, 푥2) ⊗ Hom풀(푦0, 푦2)

푽 퐺1(푥0,푥2)⊗ Hom풀(푦0,푦2) 푽 Hom[풀,풁](퐺0(푥0), 퐺0(푥2)) ⊗ Hom풀(푦0, 푦2)

푽 휋(퐺0(푥0),퐺0(푥2),푦2)⊗ e(퐺0(푥0)1,(푦0,푦2))

Hom풁(e(퐺0(푥0)0, 푦2), e(퐺0(푥2)0, 푦2)) 푽 ⊗ Hom풁(e(퐺0(푥0)0, 푦0), e(퐺0(푥0)0, 푦2))

∘풁(e(퐺0(푥0)0,푦0),e(퐺0(푥0)0,푦2),e(퐺0(푥2)0,푦2))

Hom풁(e(퐺0(푥0)0, 푦0), e(퐺0(푥2)0, 푦2))

73 3. Internal Enriched Categories which is equal to

((푥 , 푦 ), (푥 , 푦 )) ⊗푽 ((푥 , 푦 ), (푥 , 푦 )) Hom푿⊗푽Catℰ풀 1 1 2 2 Hom푿⊗푽Catℰ풀 0 0 1 1

∘ 푽Cat ((푥0,푦0),(푥1,푦1),(푥2,푦2)) 푿⊗ ℰ풀 ((푥 , 푦 ), (푥 , 푦 )) Hom푿⊗푽Catℰ풀 0 0 2 2 ̂ 퐺1((푥0,푦0),(푥2,푦2)) ̂ ̂ Hom풁(퐺0(푥0, 푦0), 퐺0(푥2, 푦2)) thus showing that 퐺̂ is functorial. The final and most fundamental part of the argument is showing that the two constructions yield a bijection.That is the content of the next proposition.

Proposition 3.7.2. The constructions (‐)̂ and (‐)̄ are mutually inverse.

̂ Proof. Let’s prove that 퐹̄ = 퐹. On the object component, we simply have the following chain of equalities,

̄̂ ̄ 푥∶ 푋, 푦∶ 푌 ⊢ 퐹0(푥, 푦) = e(퐹0(푥)0, 푦) = 퐹0(푥, 푦)∶ 푍.

On the morphism component, in context 푥0, 푥1 ∶ 푋, 푦0, 푦1 ∶ 푌, we have by defini- ̄̂ ̄̂ tion of 퐹 that 퐹1((푥0, 푦0), (푥1, 푦1)) is

((푥 , 푦 ), (푥 , 푦 )) = (푥 , 푥 ) ⊗푽 (푦 , 푦 ) Hom푿⊗푽Catℰ풀 0 0 1 1 Hom푿 0 1 Hom풀 0 1

̄ 푽 ̄ 퐹1(푥0,푥1)⊗ e(퐹0(푥0)1,(푦0,푦1)) ̄ ̄ 푽 ̄ ̄ Hom[풀,풁](퐹0(푥0), 퐹0(푥1)) ⊗ Hom풁(e(퐹0(푥0)0, 푦0), e(퐹0(푥0)0, 푦1)) ̄ ̄ 푽 휋(퐹0(푥0),퐹0(푥1),푦1)⊗ id ̄ ̄ 푽 ̄ ̄ Hom풁(e(퐹0(푥0)0, 푦1), e(퐹0(푥1)0, 푦1)) ⊗ Hom풁(e(퐹0(푥0)0, 푦0), e(퐹0(푥0)0, 푦1)) ̄ ̄ ̄ ∘풁(e(퐹0(푥0)0,푦0),e(퐹0(푥0)0,푦1),e(퐹0(푥1)0,푦1)) ̄ ̄ ̄̂ ̄̂ Hom풁(e(퐹0(푥0)0, 푦0), e(퐹0(푥1)0, 푦1)) = Hom풁(퐹0(푥0, 푦0), 퐹0(푥1, 푦1))

74 3.7. Exponentials of Internal Enriched Categories

̄ ̄ which, by definition of 퐹1, and by definition of 퐹0(푥0)1, is equal to

푽 Hom푿(푥0, 푥1) ⊗ Hom풀(푦0, 푦1)

푽 푽 푽 id⊗ id풀(푦1)⊗ id푿(푥0)⊗ id 푽 푽 푽 Hom푿(푥0, 푥1) ⊗ Hom풀(푦1, 푦1) ⊗ Hom푿(푥0, 푥0) ⊗ Hom풀(푦0, 푦1)

푽 퐹1((푥0,푦1),(푥1,푦1))⊗ 퐹1((푥0,푦0),(푥0,푦1)) 푽 Hom풁(퐹0(푥0, 푦1), 퐹0(푥1, 푦1)) ⊗ Hom풁(퐹0(푥0, 푦0), 퐹0(푥0, 푦1))

∘풁(퐹0(푥0,푦0),퐹0(푥0,푦1),퐹0(푥1,푦1))

Hom풁(퐹0(푥0, 푦0), 퐹0(푥1푦1)).

By functoriality, swap the application of the functor 퐹 and the composition; then, apply the unit law. This way, it remains only the application of 퐹1. ̄ Let’s prove that 퐺̂ = 퐺. On the object component we have, in context 푥∶ 푋, the chain of equalities

̄̂ ̂ 퐺0(푥)0 = 휆푦∶ 푌. 퐺0(푥, 푦) = 휆푦∶ 푌. e(퐺0(푥), 푦) = 퐺0(푥)∶ 푍

̄̂ whereas, in context 푥∶ 푋, 푦0, 푦1 ∶ 푌, we have that eℰ(퐺0(푥)1, (푦0, 푦1)) is the composite arrow

Hom풀(푦0, 푦1)

푽 id푿(푥)⊗ id 푽 Hom푿(푥, 푥) ⊗ Hom풀(푦0, 푦1)

푽 퐺1⊗ e(퐺0(푥)1,(푦0,푦1)) 푽 Hom[풀,풁](퐺0(푥), 퐺0(푥)) ⊗ Hom풁(e(퐺0(푥)0, 푦0), e(퐺0(푥)0, 푦1))

푽 휋(퐺0(푥),퐺0(푥),푦1)⊗ id 푽 Hom풁(e(퐺0(푥)0, 푦1), e(퐺0(푥)0, 푦1)) ⊗ Hom풁(e(퐺0(푥)0, 푦0), e(퐺0(푥)0, 푦1))

∘풁(e(퐺0(푥)0,푦0),e(퐺0(푥)0,푦1),e(퐺0(푥)0,푦1))

Hom풁(e(퐺0(푥)0, 푦0), e(퐺0(푥)0, 푦1)).

But 휋(푦1) ∘푽 퐺1 ∘푽 id푿(푥) is equal to id풁(e(퐺0(푥)0, 푦0)), thus the above composite arrow is equal to 퐺0(푥)1 applied to (푦0, 푦1). On the morphism ̄̂ component, in context 푥0, 푥1 ∶ 푋, 푦∶ 푌, the 푦-component of 퐺1(푥0, 푥1), that is,

75 3. Internal Enriched Categories

̄̂ ̄̂ ̄̂ the composition 휋(퐺0(푥0), 퐺0(푥1), 푦)퐺1(푥0, 푥1), is:

Hom푿(푥0, 푥1)

푽 Hom푿(푥0,푥1)⊗ id풀(푦) 푽 Hom푿(푥0, 푥1) ⊗ Hom풀(푦, 푦)

푽 퐺1(푥0,푥1)⊗ 퐺0(푥0)1(푦,푦) 푽 Hom[풀,풁](퐺0(푥0), 퐺0(푥1)) ⊗ Hom풁(e(퐺0(푥0)0, 푦), e(퐺0(푥0)0, 푦))

푽 휋(퐺0(푥0),퐺0(푥1),푦)⊗ Hom풁(… ) 푽 Hom풁(e(퐺0(푥0)0, 푦), e(퐺0(푥1)0, 푦)) ⊗ Hom풁(e(퐺0(푥0)0, 푦), e(퐺0(푥0)0, 푦))

∘풁(e(퐺0(푥0)0,푦),e(퐺0(푥0)0,푦),e(퐺0(푥1)0,푦))

Hom풁(e(퐺0(푥0)0, 푦), e(퐺0(푥1)0, 푦)) which, by the extranaturality of 휋, is

Hom푿(푥0, 푥1)

퐺1(푥0,푥1)

Hom[풀,풁](퐺0(푥0), 퐺0(푥1))

휋(퐺0(푥0),퐺0(푥1),푦)

Hom풁(e(퐺0(푥0)0, 푦), e(퐺0(푥1)0, 푦)) that is, the 푦-component of 퐺1(푥0, 푥1).

Now at last we have proved the following.

Theorem 3.7.3. The category 푽Catℰ is monoidal closed.

3.8. Yoneda Lemma for Internal Enriched Categories

No theory of enriched categories can do without a suitable form of the Yoneda lemma.The major concern in our context is not to prove the result, as the proof just works out by means of the usual arguments, but rather to correctly express the statement in an internal way. Indeed, while there is a tradition to view the Yoneda lemma for internal categories in terms of indexed categories, the point of the dissertation is that internal enrichment avoids all that.

76 3.8. Yoneda Lemma for Internal Enriched Categories

In this section, let’s work under the hypothesis that ℰ is locally cartesian closed, 푽 is symmetric, monoidal closed (and thus 푽-enriched itself) and it has all ends (so that 푽Catℰ is monoidal closed, by theorem 3.7.3). We begin by defining the Yoneda embedding.

Definition 3.8.1 (Yoneda embedding). Let 푿 be a 푽-category. The Yoneda embedding for 푿 is the 푽-enriched functor Y∶ 푿 → [푿퐨퐩, 푽] which is the 퐨퐩 exponential transpose in 푽Catℰ of the hom-functor Hom푿 ∶ 푿 ⊗ 푿 → 푽.

We now give a version of the Yoneda Lemma for 푽-enriched categories. Notice how the statement is different from its usual form, as it has to capture the fundamentally internal nature of the result.

Theorem 3.8.2 (Yoneda Lemma). The functor

퐨퐩 퐨퐩 Y ⊗[푿 ,푽] Hom[푿퐨퐩,푽] 푿퐨퐩 ⊗ [푿퐨퐩, 푽] −−−−−−−−−→[푿퐨퐩, 푽]퐨퐩 ⊗ [푿퐨퐩, 푽] −−−−−−−−→푽 is naturally isomorphic to the evaluation functor.

Proof. Define the natural transformation

퐨퐩 푥∶ 푋, 퐹∶ [푿 , 푽] ⊢ y푥,퐹 ∶ e(퐹0, 푥) → Hom[푿퐨퐩,푽](Y0(푥), 퐹)∶ 푉1 on the projections

′ 퐨퐩 ′ ′ 푥, 푥 ∶ 푋, 퐹∶ [푿 , 푽] ⊢ 휋푥′y푥,퐹 ∶ e(퐹0, 푥) → Hom푽(Hom푿(푥 , 푥), e(퐹0, 푥 ))∶ 푉1

′ as the exponential transpose of e(퐹1, (푥, 푥 )), meaning that

′ ′ e푽 ∘푽 (휋푥′y푥,퐹 ⊗ id푽(Hom푿(푥 , 푥))) = e푽 ∘푽 (e(퐹1, (푥, 푥 )) ⊗ id푽(e(퐹0, 푥))).

Define the natural transformation y−1 as

퐨퐩 −1 푥∶ 푋, 퐹∶ [푿 , 푽] ⊢ y푥,퐹 ∶ Hom[푿퐨퐩,푽](Y0(푥), 퐹) → e(퐹0, 푥)

Hom[푿퐨퐩,푽](Y0(푥), 퐹)

휋푥⊗id푿(푥) ≔ ∶ 푉 (3.8) Hom푽(Hom푿(푥, 푥), e(퐹0, 푥)) ⊗ Hom푿(푥, 푥) 1

e푽

e(퐹0, 푥)

77 3. Internal Enriched Categories

Let’s prove that y−1y = id.In context 푥∶ 푋, 퐹∶ [푿퐨퐩, 푽], we have by defini- −1 tion that y푥,퐹y푥,퐹 is

e(퐹0, 푥)

휋푥′y푥,퐹⊗id푿(푥)

Hom푽(Hom푿(푥, 푥), e(퐹0, 푥)) ⊗ Hom푿(푥, 푥)

e푽

e(퐹0, 푥) which, again expanding the definition, is

e(퐹0, 푥)

e(퐹0,푥)⊗id푿(푥)

e(퐹0, 푥) ⊗ Hom푿(푥, 푥)

e(퐹0,푥)⊗e(퐹1,(푥,푥))

e(퐹0, 푥) ⊗ Hom푽(e(퐹0, 푥), e(퐹0, 푥))

e푽

e(퐹0, 푥)

which, by functoriality of 퐹1, is

e(퐹0, 푥)

e(퐹0,푥)⊗id푽(e(퐹0,푥))

e(퐹0, 푥) ⊗ Hom푽(e(퐹0, 푥), e(퐹0, 푥))

e푽

e(퐹0, 푥)

and that amounts to id푽(e(퐹0, 푥)). Let’s prove that yy−1 = id. In context 푥, 푥′ ∶ 푋, 퐹∶ [푿퐨퐩, 푽], the exponential

78 3.8. Yoneda Lemma for Internal Enriched Categories

−1 transpose of 휋푥′y푥,퐹y푥,퐹 is

′ Hom푿(푥 , 푥) ⊗ Hom[푿퐨퐩,푽](Y0(푥), 퐹)

′ Hom푿(푥 ,푥)⊗휋푥⊗id푿(푥) ′ Hom푿(푥 , 푥) ⊗ Hom푽(Hom푿(푥, 푥), e(퐹0, 푥)) ⊗ Hom푿(푥, 푥)

′ Hom푿(푥 ,푥)⊗e푽 ′ . Hom푿(푥 , 푥) ⊗ e(퐹0, 푥) ′ Hom푿(푥 ,푥)⊗휋푥′y푥,퐹 ′ ′ ′ Hom푿(푥 , 푥) ⊗ Hom푽(Hom푿(푥 , 푥), e(퐹0, 푥 ))

e푽 ′ e(퐹0, 푥 )

By definition of y, the above morphism is equal to

′ Hom푿(푥 , 푥) ⊗ Hom[푿퐨퐩,푽](Y0(푥), 퐹)

′ Hom푿(푥 ,푥)⊗휋푥⊗id푿(푥) ′ Hom푿(푥 , 푥) ⊗ Hom푽(Hom푿(푥, 푥), e(퐹0, 푥)) ⊗ Hom푿(푥, 푥)

′ e(퐹1,(푥,푥 ))⊗e푽 ′ Hom푽(e(퐹0, 푥), e(퐹0, 푥 )) ⊗ e(퐹0, 푥)

e푽 ′ e(퐹0, 푥 ) which, by naturality, is

′ Hom푿(푥 , 푥) ⊗ Hom[푿퐨퐩,푽](Y0(푥), 퐹)

′ id푿(푥)⊗e(e(Y0,푥)1,(푥,푥 ))⊗Hom[푿퐨퐩,푽](Y0(푥),퐹) ′ Hom푿(푥, 푥) ⊗ Hom푽(Hom푿(푥, 푥), Hom푿(푥 , 푥)) ⊗ Hom[푿퐨퐩,푽](Y0(푥), 퐹) . e푽⊗휋푥′ ′ ′ ′ Hom푿(푥 , 푥) ⊗ Hom푽(Hom푿(푥 , 푥), e(퐹0, 푥 ))

e푽 ′ e(퐹0, 푥 )

79 3. Internal Enriched Categories

Then, the above composite arrow computes to

′ Hom푿(푥 , 푥) ⊗ Hom[푿퐨퐩,푽](Y0(푥), 퐹)

′ Hom푿(푥 ,푥)⊗휋푥′ ′ ′ ′ Hom푿(푥 , 푥) ⊗ Hom푽(Hom푿(푥 , 푥), e(퐹0, 푥 ))

e푽 ′ e(퐹0, 푥 ) which is the exponential transpose of 휋푥′. There are some immediate consequences of the Yoneda Lemma. For a start, that the Yoneda embedding is a full and faithful functor.

Corollary 3.8.3. Let 푿 be a 푽-enriched category. Then, in context 푥0, 푥1 ∶ 푋,

Y1(푥0, 푥1)∶ Hom푿(푥0, 푥1) → Hom[푿퐨퐩,푽](Y0(푥0), Y0(푥1)) is an isomorphism. Proof. By Yoneda lemma (theorem 3.8.2)

Hom[푿퐨퐩,푽](Y0(푥0), Y0(푥1)) ≅ Y0(푥1)(푥0) = Hom푿(푥0, 푥1). It follows that also post-composition by the Yoneda embedding is a full and faithful functor. Corollary 3.8.4. Let 푿 be a 푽-enriched category and 퐹, 퐺∶ 풀 → 푿 be 푽- enriched functors.There is a natural bijection between natural transformations Y퐹 → Y퐺 and natural transformations 퐹 → 퐺, which internalizes to an isomorphism

Hom[풀,푿](퐹, 퐺) ≅ Hom[풀,[푿퐨퐩,푽]](Y퐹, Y퐺). Proof. Any natural transformation Y퐹 → Y퐺 yields one 퐹 → 퐺 by composing each component with the isomorphism of corollary 3.8.3,

푦∶ 푌 ⊢ Hom[푿퐨퐩,푽](Y0(퐹0(푦)), Y0(퐺0(푦))) ≅ Hom푿(퐹0(푦), 퐺0(푦)), and vice-versa. In particular, that applies to natural isomorphisms, which is a fact we will need later on. Corollary 3.8.5. Let 퐹, 퐺∶ 풀 → 푿 be 푽-enriched functors. If there is a natural isomorphism 휙∶ Y퐹 ≅ Y퐺, then there is a natural isomorphism 휓∶ 퐹 ≅ 퐺 such that Y휓 = 휙.

80 3.8. Yoneda Lemma for Internal Enriched Categories

Finally, we get the classic density result characterizing presheaves as colim- its of representable presheaves. Proposition 3.5.9 reminds us that, for coends to exist, in addition to the hypothesis already made at the beginning of the section the enriching category also has to have coequalizers.

Corollary 3.8.6 (density of presheaves). Assume 푽 has coequalizers and let 푿 be a 푽-category. Then, in context 퐹∶ [푿퐨퐩, 푽], 푥∶ 푋, there is a natural isomor- phism 푥′ ∶ 푋 ′ 푽 ′ e(퐹0, 푥) ≅ ∫ Hom푿(푥, 푥 ) ⊗ e(퐹0, 푥 ). (3.9)

Proof. Adding 푣∶ 푉0 to the context, we have

푥′ ∶ 푋 ′ 푽 ′ Hom푽( ∫ Hom푿(푥, 푥 ) ⊗ e(퐹0, 푥 ), 푣) ≅ ∫ Hom (Hom (푥, 푥′) ⊗푽 e(퐹 , 푥′), 푣) 푥′ ∶ 푋 푽 푿 0 ≅ ∫ Hom (Hom (푥, 푥′), Hom (e(퐹 , 푥′), 푣)) 푥′ ∶ 푋 푽 푿 푽 0 = Hom[푿퐨퐩,푽](Hom푿(푥, ‐), Hom푽(e(퐹0, ‐), 푣))

≅ Hom푽(e(퐹0, 푥), 푣) where the last step is an application of theorem 3.8.2. But then, by corol- lary 3.8.5, we obtain the isomorphism (3.9).

81

4. Limits and Completeness

In this chapter, we develop the theory of weighted (co)limits and (co)complete- ness for internal enriched categories. With regards to limits and completeness, the notion of size plays an im- portant role. Particularly, one should be clear about what is the size of the diagrams in respect to which a category is said to be complete.In standard category theory, we generally mean that a category is complete with respect to small diagrams, even when such a category is large. One needs to look no further then to the category of sets to find an instance of this phenomenon. That, indeed, is a large category which we say complete, meaning with respect to small diagrams, while it is certainly not so with respect to large diagrams. For example, the product of all non-empty sets is not a set, but a proper . It is also worth noting that all small complete categories are, essentially, complete lattices.These feature a most remarkable behavior. For example, for lattices, completeness and cocompleteness are equivalent. That is just another way to look at the classic result for which a lattice has all meets if and only if it has all joins. Moreover, the adjoint functor theorem for complete lattices does away with size conditions, as those are trivially satisfied. It is essential to note that the notion of internal enriched category is fun- damentally “small” with respect to the given environment, in that underlying objects are objects of the ambient category. That is in sharp contrast with the standard theory of enriched categories, which are allowed to be “large” (as in having a proper class of objects). This consideration suggests that in- ternal enriched categories should be treated as analogous to small enriched categories over a small monoidal enriching category. Moreover, for those that are complete, we should also expect to get the same kind of results holding for small complete categories. In the internal setting there are non-trivial (as in other than lattices) ex- amples of complete small categories. A most notable example is the internal category of modest sets in the category of assemblies (Hyland 1988). Such category is not only complete, but it also has a symmetric monoidal product (the categorical product) with respect to which it is closed (that is to say, it is a cartesian closed category). This provides a setting featuring all the good properties we need, thus guaranteeing that our theory of internal enriched categories is well-founded. For the extent of this chapter, we shall assume that ℰ is locally cartesian closed, and 푽 is a symmetric monoidal closed category in ℰ with all ends.

83 4. Limits and Completeness

4.1. Complete Categories

In this section we define the notion of internal weighted limits, following that for internal limits (see definition 2.2.1). Then, we derive a few standard results which will be instrumental in the following sections. We begin by defining internal weighted limits. Definition 4.1.1 (weighted limits for 푽-categories). Let 푿 and 푲 be 푽-enriched categories and 퐹∶ 푲 → 푿 and 푊∶ 푲 → 푽 be 푽-enriched functors. A weighted limit over 퐹 with respect to the weight 푊 is given by a 푽-enriched functor {푊; 퐹}∶ 핀 → 푿 푽 푽Catℰ and a -enriched natural isomorphism

≅ 퐨퐩 휙∶ Hom푿(‐, {푊; 퐹}) −→ Hom[푲,푽](푊, Hom푿(‐, 퐹))∶ 푿 → 푽. Notice that, unlike the notions of internal limit and end, that of internal weighted limit is automatically stable under pullback, being defined through a natural isomorphism between homsets. For completeness, though, we have to enforce stability again. Definition 4.1.2 (completeness for 푽-categories). We say 푿 is complete if, for every 퐼 object of ℰ, 퐼∗푽-enriched category 푲, 퐼∗푽-enriched functors 퐹∶ 푲 → 퐼∗푿 and 푊∶ 푲 → 퐼∗푽, the limit of 퐹 with respect to the weight 푊 exists. By duality, we have the notions of colimits and cocompleteness as well. Definition 4.1.3 (weighted colimits for 푽-categories). Let 푿 and 푲 be 푽- enriched categories and 퐺∶ 푲 → 푿 and 푊∶ 푲퐨퐩 → 푽 be 푽-enriched functors. A weighted colimit over 퐺 with respect to the weight 푊 is given by a 푽-enriched 퐹 ⋅ 푊∶ 핀 → 푿 푽 functor 푽Catℰ and a -enriched natural isomorphism ≅ 휙∶ Hom푿(퐺 ⋅ 푊, ‐) −→ Hom[푲퐨퐩,푽](푊, Hom푿(퐺, ‐))∶ 푿 → 푽. Definition 4.1.4 (cocompleteness for 푽-categories). We say 푿 is cocomplete if, for every 퐼 object of ℰ, 퐼∗푽-enriched category 푲, 퐼∗푽-enriched functors 퐺∶ 푲 → 퐼∗푿 and 푊∶ 푲퐨퐩 → 퐼∗푽, the colimit of 퐺 with respect to the weight 푊 exists. As a sanity check, we make sure that the previous definitions of limit and colimit yield a pair of dual notions. Remark 4.1.5. Colimits in a 푽-enriched category 푿 are, equivalently, limits in 푿퐨퐩 퐹 ⋅ 푊∶ 핀 → 푿 퐺∶ 푲 → 푿 .Indeed, let 푽Catℰ be the colimit of with respect to 퐨퐩 the weight 푊∶ 푲 → 푽, and Hom푿(퐺 ⋅ 푊, ‐) ≅ Hom[푲퐨퐩,푽](푊, Hom푿(퐺, ‐)) the associated isomorphism.That can, equivalently, be regarded as an isomor- phism 퐨퐩 퐨퐩 Hom푿퐨퐩(‐, (퐺 ⋅ 푊) ) ≅ Hom[푲퐨퐩,푽](푊, Hom푿퐨퐩(‐, 퐺 )),

84 4.1. Complete Categories

(퐺 ⋅ 푊)퐨퐩 ∶ 핀 → 푿퐨퐩 showing that 푽Catℰ (which corresponds to the same point of 푋 as 퐺 ⋅ 푊 does) is the limit of 퐺퐨퐩 ∶ 푲퐨퐩 → 푿퐨퐩 with respect to the weight 푊. Limits are often thought of in terms of their universal property, which we can indeed derive from the definition. Remark 4.1.6. Let 퐹∶ 푲 → 푿 and 푊∶ 푲 → 푽 be 푽-enriched functors. Then, in context 푥∶ 푋, by the Yoneda Lemma (theorem 3.8.2), we have an isomorphism

Hom[푿퐨퐩,푽](Y(푥), Hom[푲,푽](푊, Hom푿(‐, 퐹))) ≅ Hom[푲,푽](푊, Hom푿(푥, 퐹)).

The previous remark, applied to the definition of weighted limit, suggests the following proposition.

Proposition 4.1.7. Let 퐹∶ 푲 → 푿 and 푊∶ 푲 → 푽 be 푽-enriched functors. If the weighted limit {푊; 퐹} exists, then by remark 4.1.6 there is an associated 푽- enriched natural transformation

휋∶ 푊 → Hom푿({푊; 퐹}, 퐹)∶ 푲 → 푽 which is called the universal cone for the limit {푊; 퐹}.Then, given another 푽 퐿∶ 핀 → 푿 푽 -enriched functor 푽Catℰ and another -enriched natural transfor- mation 푝∶ 푊 → Hom푿(퐿, 퐹), there is a unique ℎ∶ 퐿 → {푊; 퐹} such that Hom푿(ℎ, 퐹)휋 = 푝.

Proof. The natural transformation 푝 has an associated 푽-enriched natural transformation

퐨퐩 훼∶ Hom푿(‐, 퐿) → Hom[푲,푽](푊, Hom푿(‐, 퐹))∶ 푿 → 푽.

Then, ℎ is given by 핀

id푿(퐿)

Hom푿(퐿, 퐿) 훼(퐿)

Hom[푲,푽](푊, Hom푿(퐿, 퐹))

휙−1(퐿)

Hom푿(퐿, {푊; 퐹}).

85 4. Limits and Completeness

Notice that 훼(퐿)id푿(퐿) is the exponential transpose of 푝, and that

푊 ⊗ Hom[푲,푽](푊, Hom푿(퐿, 퐹))

휋⊗휙−1(퐿)

Hom푿({푊; 퐹}, 퐹) ⊗ Hom푿(퐿, {푊; 퐹}) ∘

Hom푿(퐿, 퐹) is the evaluation on 푊. Then, Hom푿(ℎ, 퐹)휋 = 푝.

Remark 4.1.8. It is not generally true that the converse of proposition 4.1.7 holds, that is, that the 푽-enriched natural transformation associated to a universal cone is necessarily an isomorphism, and it thus yields a weighted limit. The same issue arises in standard enriched category theory and, in that context, the classic approach involves the notion of conservative category (Kelly 1982). It is likely that the same could be done in our context, but in this dissertation we shall not pursue this topic any further. As an immediate consequence of the limit’s universal property, we have their uniqueness property.

Proposition 4.1.9 (uniqueness of weighted limits). A weighted limit, if it exists, is unique up to isomorphism.

Using proposition 2.3.4 as an analogy, we would like to have a choice-of- limits functor which, in a suitable sense, yields limits for internal functors relative to internal weights.

Notation 4.1.10. We shall now define a functor {‐; ‐}∶ [푲, 푽]퐨퐩 ⊗ [푲, 푿] → 푿 for which it will be convenient to use an infix notation. We shall thus write {푊; 퐹} for ({‐; ‐})0(푊, 퐹) and {푊0, 푊1; 퐹0, 퐹1} for ({‐; ‐})1((푊0, 퐹0), (푊1, 퐹1)).

Proposition 4.1.11 (weighted limits functor). If 푿 is a complete 푽-enriched category, then there is a 푽-enriched functor

{‐; ‐}∶ [푲, 푽]퐨퐩 ⊗ [푲, 푿] → 푿 inducing a 푽-enriched isomorphism

Hom푿(푥, {푊; 퐹}) ≅ Hom[푲,푽](푊, Hom푿(푥, 퐹)) (4.1) natural in 푥∶ 푋, 푊∶ [푲, 푽] and 퐹∶ [푲, 푿].

86 4.1. Complete Categories

Proof. Consider an indexing object 퐼 = Fun(푲, 푽) × Fun(푲, 푿).In context ̄ ∗ ∗ ∗ 푊∶ [푲, 푽], 퐹∶ [푲, 푿], 푘, 푘0, 푘1 ∶ 퐾, let 푊 ∶ 퐼 푲 → 퐼 푽 be the 퐼 푽-enriched func- ̄ ̄ tor defined by 푊0(푊, 퐹, 푘) ≔ e(푊0, 푘) and 푊1(푊, 퐹, 푘0, 푘1) ≔ e(푊1, (푘0, 푘1)). Let 퐹̄ ∶ 퐼∗푲 → 퐼∗푿 be the 퐼∗푽-enriched functor defined by 퐹̄(푊, 퐹, 푘) ≔ ̄ e(퐹0, 푘) and 퐹1(푊, 퐹, 푘0, 푘1) ≔ e(퐹1, (푘0, 푘1)). Then, the limit of 퐹̄ with respect to the weight 푊̄ yields an arrow {‐; ‐}∶ 퐼 → 푋 and a family of 푽-enriched natural isomorphisms

퐨퐩 휙푊,퐹 ∶ Hom푿(‐, {푊; 퐹}) → Hom[푲,푽](푊, Hom푿(‐, 퐹))∶ 푿 → 푽 inducing universal cones 휋푊,퐹 ∶ 푊 → Hom푿({푊; 퐹}, 퐹). Let {푊0, 푊1; 퐹0, 퐹1} be the arrow

Hom[푲,푽](푊1, 푊0) ⊗ Hom[푲,푿](퐹0, 퐹1) (푊 ,휋 )⊗ (퐹 ,퐹 ) Hom[푲,푽] 1 푊0,퐹0 Hom[푲,푿] 0 1

Hom[푲,푽](푊1, Hom푿({푊0; 퐹0}, 퐹0)) ⊗ Hom[푲,푿](퐹0, 퐹1)

∘[푲,푿]

Hom[푲,푽](푊1, Hom푿({푊0; 퐹0}, 퐹1))

−1 휙 ({푊0;퐹0}) 푊1,퐹1

Hom푿({푊0; 퐹0}0, {푊1; 퐹1}0).

Then, the isomorphism 4.1 holds point-wise and is natual in 푥∶ 푋. We have to show that it is natural in 푊∶ [푲, 푽] and 퐹∶ [푲, 푿].That is, that the diagram

(푥, {푊 ; 퐹 }) Hom (푊 , Hom (푥, 퐹 )) Hom푿 0 0 휙 (푥)⊗… [푲,푽] 0 푿 0 푊0,퐹0 ⊗ Hom[푲,푿](퐹0, 퐹1) ⊗ Hom[푲,푿](퐹0, 퐹1)

⊗ Hom[푲,푽](푊1, 푊0) ⊗ Hom[푲,푽](푊1, 푊0)

Hom푿(푥,{푊0;퐹0})⊗{푊0,푊1;퐹0,퐹1}

(푥, {푊 ; 퐹 }) Hom푿 0 0 ∘ ⊗ Hom푿({푊0; 퐹0}, {푊1; 퐹1})

∘푿(푥,{푊0;퐹0},{푊1;퐹1}) 휙 (푥) 푊1,퐹1 Hom푿(푥, {푊1; 퐹1}) Hom[푲,푽](푊1, Hom푿(푥, 퐹1))

87 4. Limits and Completeness commutes. But that follows from the fact that

Hom푿(푥, {푊0; 퐹0}) ⊗ Hom[푲,푽](푊1, Hom푿({푊0; 퐹0}, 퐹1))

−1 Hom푿(푥,{푊0;퐹0})⊗휙 ({푊0;퐹0}) 푊1,퐹1

Hom푿(푥, {푊0; 퐹0}) ⊗ Hom푿({푊0; 퐹0}, {푊1; 퐹1})

∘푿(푥,{푊0;퐹0},{푊1;퐹1})

Hom푿(푥, {푊1; 퐹1}) 휙 (푥) 푊1,퐹1

Hom[푲,푽](푊1, Hom푿(푥, 퐹1)) is the composition replacing {푊0; 퐹0} with 푥, by the naturality of 휙. Observe that limits and the limit-functor behave consistently with respect to parameters, in the sense made precise by the following remark. Remark 4.1.12. Let 푿 be a complete category, and 퐹∶ 푲 × 푳 → 푿 and 푊∶ 푲 → 푽 be 푽-enriched functors. Consider the exponential transposes 퐹̂ ∶ 푲 → [푳, 푿] 퐹̄ ∶ 푳 → [푲, 푿] {푊; 퐹̂} 푽 핀 → and . Then, the limit is a -enriched functor 푽Catℰ [푳, 푿] or, equivalently, a 푽-enriched functor 푳 → 푿. Moreover, we can consider the composition of 퐹̄ and the identity of 푊 with the limit-functor for 푿, and get a functor {푊; 퐹̄}∶ 푳 → 푿.Then, {푊; 퐹̂} ≅ {푊; 퐹̄}, indeed, in context 퐺∶ [푳, 푿] ̂ Hom[푳,푿](퐺, {푊; 퐹}) ̂ ≅ Hom[푲,푽](푊, Hom[푳,푿](퐺, 퐹)) = ∫ ∫ Hom (푊 (푘), Hom (e(퐺 , 푙), e(퐹̂ (푘), 푙))) 푘∶ 퐾 푙∶ 퐿 푽 0 푿 0 0 = ∫ ∫ Hom (푊 (푘), Hom (e(퐺 , 푙), e(퐹̄ (푙), 푘))) 푘∶ 퐾 푙∶ 퐿 푽 0 푿 0 0 ̄ ≅ Hom[푲,푽](푊, Hom[푳,푿](퐺, 퐹)) ̄ ≅ Hom[푳,푿](퐺, {푊; 퐹}). ̂ ̄ In particular, in context 푙∶ 퐿, we have that {푊; 퐹}0(푙) ≅ {푊; 퐹0(푙)}. The enriching internal category 푽 itself has a 푽-enrichment when it is monoidal closed (see proposition 3.1.12). In that case, it is legitimate to ask whether it is complete as a 푽-enriched category. Unintuitively, that does not (directly) depend on 푽 being complete as an internal category, but on its having all ends (even though that is connected to completeness, see proposition 3.5.8).

Proposition 4.1.13. The category 푽 is complete as a 푽-enriched category, and its limits for diagrams of shape 푲 are given by the hom of the functor category [푲, 푽].

88 4.1. Complete Categories

Proof. All hypothesis are stable under slicing, so we can assume 퐼 = ퟙℰ. Let 푲 be a 푽-category, and 퐹, 푊∶ 푲 → 푽 be 푽-enriched functors.Then, the limit is Hom[푲,푽](푊, 퐹). Indeed, in context 푣∶ 푉0,

Hom푽(푣, Hom[푲,푽](푊, 퐹)) = Hom (푣, ∫ Hom (푊 (푘), 퐹 (푘))) 푽 푘∶ 퐾 푽 0 0 ≅ ∫ Hom (푣, Hom (푊 (푘), 퐹 (푘))) 푘∶ 퐾 푽 푽 0 0 ≅ ∫ Hom (푊 (푘), Hom (푣, 퐹 (푘))) 푘∶ 퐾 푽 0 푽 0 = Hom[푲,푽](푊, Hom푽(푣, 퐹)).

The previous result produces a first example of complete 푽-enriched category. We can produce further examples by means of the following proposition.

Proposition 4.1.14. Let 푿 and 풀 be 푽-enriched categories. If 풀 is complete, then [푿, 풀] is complete and its weighted limits are computed point-wise.

Proof. All hypothesis are stable under slicing, so we can assume we are slicing over the terminal object. Moreover, by proposition 4.1.11, there is a 푽-enriched functor {‐; ‐}∶ [푲, 푽]퐨퐩 ⊗ [푲, 풀] → 풀 yielding weighted limits in 풀. Let 푲 be a 푽-category, and 퐹∶ 푲 → [푿, 풀] and 푊∶ 푲 → 푽 be 푽-enriched functors.The limit of 퐹 with respect to the weight 푊 has to be a point of Fun(푿, 풀), which is equivalent to a 푽-enriched functor 푿 → 풀. Moreover, consider the exponential transpose 퐹̄ ∶ 푿 → [푲, 풀] of 퐹.Then, let’s define such a functor {푊; 퐹} as

̄ 푥∶ 푋 ⊢ {푊; 퐹}0(푥) ≔ {푊; 퐹0(푥)} ̄ ̄ 푥0, 푥1 ∶ 푋 ⊢ {푊; 퐹}1(푥0, 푥1) ≔ {푊; 퐹0(푥0), 퐹0(푥1)}.

Let’s prove that, in context 퐻∶ [푿, 풀], there is a natural isomorphism

Hom[푿,풀](퐻, {푊; 퐹})) ≅ Hom[푲,푽](푊, Hom[푿,풀](퐻, 퐹)).

89 4. Limits and Completeness

That is yielded by the following chain of equalities and natural isomorphims,

Hom[푿,풀](퐻, {푊; 퐹})) = ∫ Hom (e(퐻 , 푥), {푊; 퐹} (푥)) 푥∶ 푋 풀 0 0 = ∫ Hom (e(퐻 , 푥), {푊; 퐹̄ (푥)}) 푥∶ 푋 풀 0 0 ≅ ∫ Hom (푊, Hom (e(퐻 , 푥), 퐹̄ (푥))) 푥∶ 푋 [푲,푽] 풀 0 0 ≅ ∫ ∫ Hom (푊 (푘), Hom (e(퐻 , 푥), e(퐹̄ (푥) , 푘))) 푥∶ 푋 푘∶ 퐾 푽 0 풀 0 0 0 = ∫ ∫ Hom (푊 (푘), Hom (e(퐻 , 푥), e(퐹 (푘) , 푥))) 푥∶ 푋 푘∶ 퐾 푽 0 풀 0 0 0 ≅ ∫ Hom (푊 (푘), ∫ Hom (e(퐻 , 푥), e(퐹 (푘) , 푥))) 푘∶ 퐾 푽 0 푥∶ 푋 풀 0 0 0 = ∫ Hom (푊 (푘), Hom (퐻, 퐹 (푘))) 푘∶ 퐾 푽 0 [푿,풀] 0 = Hom[푲,푽](푊, Hom[푿,풀](퐻, 퐹)).

As an immediate consequence of the previous results, we have that categories of presheaves are complete. That is a fundamental fact of standard category theory, and it was legitimate to expect it would hold in our context as well.

Corollary 4.1.15. Let 푿 be a 푽-enriched category. Then, the category [푿퐨퐩, 푽] of presheaves over 푿 is complete.

Proof. It follows from propositions 4.1.13 and 4.1.14.

Finally, we mention that weighted limits endow complete 푽-enriched cate- gories with a cotensor on 푽. Remark 4.1.16. If 푿 is a complete 푽-enriched category, there is a cotensor 퐨퐩 ′ {‐; ‐}∶ 푽 ⊗ 푿 → 푿 yielding, in context 푣∶ 푉0, 푥, 푥 ∶ 푋, a natural isomorphism

′ ′ Hom푿(푥, {푣; 푥 }) ≅ Hom푽(푣, Hom푿(푥, 푥 )).

Such a cotensor and its associate isomorphism are obtained by composing the {‐; ‐}∶ [핀 , 푽]퐨퐩 ⊗ [핀 , 푿] → 푿 limit-yielding functor 푽Catℰ 푽Catℰ with the obvious 푿 → [핀 , 푿] 푽 → [핀 , 푽] equivalences 푽Catℰ and 푽Catℰ . In the special case of a presheaf category [푿퐨퐩, 푽], which is complete because of corollary 4.1.15, we have a very concrete representation of the cotensor. 퐨퐩 Indeed, in context 푣∶ 푉0, 퐹∶ [푿 , 푽], we have

{푣; 퐹} ≅ Hom푽(푣, ‐) ∘ 퐹.

Essentially, this is a special case of proposition 4.1.14, but explicitely we see

90 4.2. Limit-Preserving Functors that, in context 퐻∶ [푿퐨퐩, 푽],

Hom[푿퐨퐩,푽](퐻, Hom푽(푣, ‐) ∘ 퐹) = ∫ Hom (e(퐻 , 푥), Hom (푣, e (퐹 , 푥))) 푥∶ 푋 푽 0 푽 ℰ 0 ≅ ∫ Hom (푣, Hom (e(퐻 , 푥), e (퐹 , 푥))) 푥∶ 푋 푽 푽 0 ℰ 0 ≅ Hom (푣, ∫ Hom (e(퐻 , 푥), e (퐹 , 푥))) 푽 푥∶ 푋 푽 0 ℰ 0 = Hom푽(푣, Hom[푿퐨퐩,푽](퐻, 퐹)).

4.2. Limit-Preserving Functors

The concept of a limit-preserving functor will be particularly helpful in the next section, so we shall dedicate some space to the definition and study of such a notion. As a terminology remark, notice that, since internal categories are intrinsi- cally small, to preserve limits is the same as to preserve small limits.Then, it would also be appropriate to call limit-preserving functors as continuous functors (which, in the standard terminology, denotes functors preserving small limits).

Definition 4.2.1 (limit-preserving functor). Let 퐻∶ 푿 → 풀 be a 푽-enriched functor. We say 퐻 preserves weighted limits if, for every indexing object 퐼 in ℰ, 퐼∗푽-enriched category 푲 and 퐼∗푽-enriched functors 퐹∶ 푲 → 퐼∗푿 and 푊∶ 푲 → 퐼∗푽, the evident 푽-enriched natural transformation determined by universality (퐼∗퐻){푊; 퐹} → {푊; (퐼∗퐻)퐹} is an isomorphism.

In the rest of the chapter we sometimes have to prove that a functor is limit- preserving. In such situation, we will show the existence of an isomorphism, but omit the routine and tedious check that such isomorphism is indeed the correct one, i.e. the one determined by universality. A first example of weighted limits-preserving 푽-enriched functor is given by covariant and controvariant representable presheaves.

Proposition 4.2.2. Representable 푽-enriched covariant presheaves preserve weighed limits.

푿 푲 푽 푥∶ 핀 → 푿 Proof. Let and be -enriched categories, and 푽Catℰ an object of 푿.Let’s show that Hom푿(푥, ‐)∶ 푿 → 푽 preserves limits.Let 퐹∶ 푲 → 푿 and 푊∶ 푲 → 푽 푽 {푊; 퐹}∶ 핀 → 푿 퐹 be -functors, and 푽Catℰ the weighted limit of with respect to the weight 푊. Then, by proposition 4.1.13, we have that

{푊; Hom푿(푥, ‐) ∘ 퐹} ≅ Hom[푲,푽](푊, Hom푿(푥, ‐) ∘ 퐹) ≅ Hom푿(푥, {푊; 퐹}).

91 4. Limits and Completeness

Proposition 4.2.3. Representable controvariant 푽-enriched presheaves pre- serve weighed limits. 푿 푲 푽 푥∶ 핀 → 푿 Proof. Let and be -enriched categories, and 푽Catℰ an object of 퐨퐩 퐨퐩 푿.Let’s show that Hom푿(‐, 푥)∶ 푿 → 푽 preserves limits.Let 퐹∶ 푲 → 푿 푊∶ 푲 → 푽 푽 {푊; 퐹}∶ 핀 → 푿퐨퐩 and be -functors, and 푽Catℰ the weighted limit of 퐹 with respect to the weight 푊. Then, by proposition 4.1.13, we have that

{푊; Hom푿(‐, 푥) ∘ 퐹} ≅ Hom[푲,푽](푊, Hom푿퐨퐩(푥, ‐) ∘ 퐹)

≅ Hom푿퐨퐩(푥, {푊; 퐹}) = Hom푿({푊; 퐹}, 푥).

Then, by duality, we get that representable presheaves also preserve colimits. The following corollary sums up the situation.

Corollary 4.2.4. Covariant and controvariant representable presheaves pre- serve both limits and colimits.

The Yoneda embedding is another notable example of limit-preserving func- tor.

Proposition 4.2.5. Let 푿 be a 푽-enriched category. Then, the Yoneda embed- ding Y∶ 푿 → [푿퐨퐩, 푽] preserves weighted limits. Proof. All hypothesis are stable under slicing and, for an indexing object 퐼, we ∗ ∗ have that 퐼 Y is the Yoneda embedding of 퐼 푿. So, we can assume 퐼 = ퟙℰ. Let 퐹∶ 푲 → 푿 and 푊∶ 푲 → 푽 be 푽-enriched functors, such that it exists the limit of 퐹 with respect to the weight 푊. Then,

Hom[푿퐨퐩,푽](퐻, Y{푊; 퐹}) = ∫ Hom (퐻 (푥), Hom (푥, {푊; 퐹})) 푥∶ 푋 푽 0 푿 ≅ ∫ Hom (퐻 (푥), Hom (푊, Hom (푥, 퐹))) 푥∶ 푋 푽 0 [푲,푽] 푿 = ∫ Hom (퐻 (푥), ∫ Hom (푊 (푘), Hom (푥, 퐹 (푘)))) 푥∶ 푋 푽 0 푘∶ 퐾 푽 0 푿 0 ≅ ∫ Hom (푊 (푘), ∫ Hom (퐻 (푥), Hom (푥, 퐹 (푘)))) 푘∶ 퐾 푽 0 푥∶ 푋 푽 0 푿 0 = ∫ Hom (푊 (푘), Hom 퐨퐩 (퐻, Y (퐹 (푘)))) 푘∶ 퐾 푽 0 [푿 ,푽] 0 0 = Hom[푲,푽](푊, Hom[푿퐨퐩,푽](퐻, Y퐹)) meaning that {푊; Y퐹} exists and it is Y{푊; 퐹}. It is worth noticing that we cannot internalize the notion of limit-preserving functor (meaning that we have no object of all limit-preserving functors), as

92 4.3. Adjoint Functor Theorem the relative defining condition spans over all possible diagrams, and there is no internal representation of the object of all diagrams (just as there is no set of all sets). Still, fixed a diagram shape (other than a domain and a codomain 푽-categories), it is possible to consider an internal representation of all functors (with the given domain and codomain) preserving limits of diagrams of the given shape. Remark 4.2.6. Let 푲 be a 푽-enriched category. Then, there is in ℰ an object of 푲-limit-preserving functors 푿 → 풀, denoted by LPFun푲(푿, 풀), which also tracks the required isomorphisms.This induces a 푽-enriched category [푿, 풀]LP(푲). Analogously to the case of completeness for 푽-enriched categories, a limit- preserving functor 퐻∶ 푿 → 풀 induces, for each 푽-enriched category 푲, an internal choice of isomorphisms witnessing its property of preserving the limits of 푽-enriched functors 푲 → 푿 with respect to weights 푲 → 푽.

4.3. Adjoint Functor Theorem

In this section, we prove some further results about internal weighted limits and completeness, notably the adjoint functor theorem, by taking advantage of the intrinsic smallness of internal enriched categories.The results in this section will then be analogous to those that can be obtained for lattices, regarded as small categories. The next, fundamental proposition establishes a link between limits and representability of functors, and it will be the base upon which we will build all of the following results.

Proposition 4.3.1. Let 푿 be a 푽-enriched category and 퐹∶ 푿 → 푽 a limit- 푽 (푿) 퐹 preserving -functor. If the limit of id푽Catℰ relative to the weight , denoted by {퐹; 푿}, exists, then Hom푿({퐹; 푿}, ‐) ≅ 퐹 (that is, 퐹 is representable).

Proof. Let ̄푝∶ 퐹 → Hom푿({퐹; 푿}, ‐) be the universal cone for the limit {퐹; 푿}, which we shall take as one side of the isomorphism. Since 퐹 preserves limits, 퐹0({퐹; 푿}) is (isomorphic to) the limit {퐹; 퐹}. Because of that, the natural transformation

퐹1({퐹; 푿}, ‐)∶ Hom푿({퐹; 푿}, ‐) → Hom푽({퐹; 퐹}, 퐹(‐))∶ 푿 → 푽 yields the universal cone of {퐹; 퐹},

̄푝 퐹1({퐹;푿},‐) ̄푞= 퐹 −→ Hom푿({퐹; 푿}, ‐) −−−−−−−−→ Hom푽({퐹; 퐹}, 퐹(‐)).

93 4. Limits and Completeness

Consider the identical natural transformation id(퐹)∶ 퐹 → 퐹 ≅ Hom푽(핀푽, 퐹). By the universality of the cone ̄푞, there is a (unique) 휇∶ 핀푽 → {퐹; 퐹} such that

̄푞 Hom푽(휇,퐹) 퐹 −→ Hom푽({퐹; 퐹}, 퐹) −−−−−−−−→ Hom푽(핀푽, 퐹) ≅ 퐹 (4.2) is the identity on 퐹.That suggests that the natural transformation ̄푝−1 that we need is

퐹1({퐹;푿},‐) Hom푽(휇,퐹) Hom푿({퐹; 푿}, ‐) −−−−−−−−→ Hom푽({퐹; 퐹}, 퐹(‐)) −−−−−−−−→퐹. Let’s prove that

̄푝−1 ̄푝 Hom푿({퐹; 푿}, ‐) −−→퐹 −→ Hom푿({푿; 퐹}, ‐) = id. (4.3) The diagram

푽 ∘푿 Hom푿({퐹; 푿}, {퐹; 푿}) ⊗ Hom푿({퐹; 푿}, ‐) Hom푿({퐹; 푿}, ‐)

퐹 ({퐹;푿},{퐹;푿})⊗푽 푽 퐹 ({퐹;푿},‐) 1 id ∘푿(id⊗ 퐹1({퐹;푿},‐)) 1

푽 Hom푽({퐹; 퐹}, {퐹; 퐹}) ⊗ Hom푿({퐹; 푿}, ‐) Hom푽({퐹; 퐹}, ‐)퐹

푽 Hom푽(휇,{퐹;퐹})⊗ id Hom푽(휇,‐)

푽 푽 ∘푿(id⊗ 퐹1) 퐹0({퐹; 푿}) ⊗ Hom푿({퐹; 푿}, ‐) 퐹

푽 ̄푝{퐹;푿}⊗ id ̄푝

푽 ∘푿 Hom푿({퐹; 푿}, {퐹; 푿}) ⊗ Hom푿({퐹; 푿}, ‐) Hom푿({퐹; 푿}, ‐) commutes because of functoriality of 퐹, associativity of composition and natu- rality of ̄푝. Notice that ̄푝{퐹;푿}휇∶ 핀푽 → Hom푽({퐹; 푿}, {퐹; 푿}) yields a natural transformation

Hom푿( ̄푝{퐹;푿}휇, ‐)∶ Hom푿({퐹; 푿}, ‐) → Hom푿({퐹; 푿}, ‐).

By diagram-chasing id푿({퐹; 푿}), we get that

̄푝Hom푽(휇, {퐹; 퐹})퐹1({퐹; 푿}, ‐) = Hom푿( ̄푝{퐹;푿}휇, ‐). (4.4) By pre-composing with ̄푝 and using eq. (4.2), it follows that

Hom푿( ̄푝{퐹;푿}휇, ‐) ̄푝= ̄푝Hom푽(휇, {퐹; 퐹})퐹1({퐹; 푿}, ‐) ̄푝= ̄푝. But, by the universal property of the limit, the only such arrow {퐹; 푿} → {퐹; 푿} is the identity, which means that eq. (4.4) yields eq. (4.3).

94 4.3. Adjoint Functor Theorem

We would like to internalize proposition 4.3.1 to get an isomorphism that is natural over the object of limit-preserving functors.That could be achieved by internalizing the whole proof by using, in particular, the internal limit- functor for a complete category from proposition 4.1.11 and the internal choice of isomorphisms from remark 4.2.6. Still, the result would be hard to read and provide little insight. Instead, we provide a proof via indexing over the object of limit-preserving functors, and then applying the external version of the result. Notice how, in the proof of proposition 4.3.1, the only limits the functor needs to truly preserve are those of diagrams with shape 푿. Of course, since the functor turns out to be (isomorphic to) a presheaf, it indeed preserves all limits. This observation, though, is useful for internalizing the result, since internally we can represent the object of functors preserving limits of diagrams with shape 푿, but not general limit-preserving functors.

Corollary 4.3.2. Let 푿 be a complete 푽-enriched category. Then there is a 푽- enriched isomorphism Hom푿({퐹; 푿}, ‐) ≅ 퐹 natural in 퐹∶ LPFun푿(푿, 푽) (see remark 4.2.6).

Proof. In the slice category of ℰ over LPFun푿(푿, 푽), consider the diagram

∗ ∗ e ∶ LPFun푿(푿, 푽) 푿 → LPFun푿(푿, 푽) 푽 defined, in context 퐹∶ LPFun푿(푿, 푽), 푥∶ 푋, as e(퐹, 푥) = (퐹, eℰ(퐹0, 푥)). Such functor preserves limits because it is indexed over the object of limit-preserving functors, so we can apply proposition 4.3.1 to get an isomorphism

∗ ∗ ({ (푿, 푽) 푿; }(퐹), (퐹, 푥)) ≅ (퐹, (퐹 , 푥)). HomLPFun푿(푿,푽) 푿 LPFun푿 e eℰ 0 ∗ Notice that the weighted limit {LPFun푿(푿, 푽) 푿; e} with parameter 퐹 will be a pair (퐹, 푙) where 푙∶ 푋. Then, the chain of isomorphisms

′ (퐹, Hom푿(푥 , 푙)) ′ = ∗ ((퐹, 푥 ), (퐹, 푙)) HomLPFun푿(푿,푽) 푿 ′ ∗ = ∗ ((퐹, 푥 ), { (푿, 푽) 푿; }(퐹)) HomLPFun푿(푿,푽) 푿 LPFun푿 e ∗ ′ ≅ ∗ ( (푿, 푽) 푿, ∗ ((퐹, 푥 ), (퐹))) HomLPFun푿(푿,푽) [푿,푿] LPFun푿 HomLPFun푿(푿,푽) 푿 e ′ = (퐹, (푿, ∗ (푥 , 퐹))) Hom[푿,푿] HomLPFun푿(푿,푽) 푿 shows that 푙 is {푿; 퐹}. But then, eℰ(퐹0, 푥) ≅ Hom푿(‐, {푿; 퐹}). By corollary 4.3.2, a presheaf on a 푽-enriched category 푿 that preserves limits of shape 푿 is representable. We know that representable presheaves preserves all limits, so it may be tempting to say that LPFun푿(푿, 푽) is the object of limit-preserving presheaves over 푿.There is, though, a philosophical

95 4. Limits and Completeness

issue: LPFun푿(푿, 푽) tracks, for each presheaf it contains and each diagram of shape 푿, the isomorphism witnessing that the limit of such diagram is preserved by such presheaf, but it does not do the same for diagrams of other shapes, as an object representing limit-preserving functors should. Remarkably, corollary 4.3.2 provides a pseudo-inverse of the Yoneda em- bedding. Unexpectedly, it is then possible to establish an equivalence be- tween a 푽-enriched category 푿 and the 푽-enriched category of limit-preserving presheaves over it.

Corollary 4.3.3. Let 푿 be a complete 푽-enriched category. Then there is an equivalence of 푽-enriched categories

푿 ≣ [푿, 풀]LP(푲).

Proof. It follows from corollaries 3.8.5 and 4.3.2 and proposition 4.2.3.

From the previous results, it follows that, in the context of internal enriched categories, completeness implies cocompleteness.

Corollary 4.3.4. Complete 푽-enriched categories are cocomplete.

Proof. Let 푿 be a complete 푽-enriched category, and 푊∶ 푲퐨퐩 → 푽 and 퐺∶ 푲 → 푿 be 푽-enriched functors. Define

퐹 ≔ Hom[푲퐨퐩,푽](푊, Hom푿(퐺, ‐))∶ 푿 → 푽.

By propositions 4.1.14 and 4.2.5, 퐹 preserves limits.Then, the weighted colimit 푊 ⋅ 퐺 is given by the weighted limit {퐹; 푿}.Indeed, from proposition 4.3.1, we get Hom푿({퐹; 푿}, ‐) ≅ 퐹 = Hom[푲퐨퐩,푽](푊, Hom푿(퐺, ‐)).

By duality we also get the converse, so that completeness and cocompleteness are equivalent in the context of 푽-enriched categories.

Corollary 4.3.5. Cocomplete 푽-enriched categories are complete.

We have an immediate consequence by applying the previous result to cate- gories of presheaves.

Corollary 4.3.6. All 푽-enriched categories of presheaves are co-complete.

Proof. It follows from corollaries 4.1.15 and 4.3.4.

We also have a version of the adjoint functor theorem. What is remarkable about it is that it doesn’t require any size-related hypothesis, such as the solution set condition.

96 4.3. Adjoint Functor Theorem

Corollary 4.3.7 (adjoint functor theorem). Let 푿 and 풀 be 푽-enriched cate- gories, of which 푿 is complete, and 퐹∶ 푿 → 풀 a limit-preserving 푽-enriched functor. Then, 퐹 has a left adjoint. ̃ 퐨퐩 Proof. Consider the functor 퐹 ≔ Hom풀(‐, 퐹)∶ 풀 → [푿, 푽]. Notice that, in ̃ context 푦∶ 푌, the functor 퐹0(푦)∶ LPFun푿(푿, 푽) preserves limits.Then, the functor ̃퐨퐩 퐹 ⊗id푽Cat (푿) {‐;‐} 퐺 ≔ 풀 −−−−−−−−−−−→[푿,ℰ 푽]퐨퐩 ⊗푽 [푿, 푿] −−−→푿 is left adjoint to 퐹. Indeed, in context 푥∶ 푋 and 푦∶ 푌, ̃ ̃ Hom푿(퐺0(푦), 푥) = Hom푿({퐹0(푦); 푿}, 푥) ≅ e(퐹0(푦), 푥) = Hom풀(푦, 퐹0(푥)) by corollary 4.3.2. By duality, we also get a version of the adjoint functor theorem for colimits.

Corollary 4.3.8. Let 푿 and 풀 be 푽-enriched categories, of which 푿 is cocomplete, and 퐹∶ 푿 → 풀 a colimit-preserving 푽-enriched functor. Then, 퐹 has a right adjoint.

Finally, the previous results can be applied to categories of presheaves.

Corollary 4.3.9. The Yoneda embedding for a complete 푽-enriched category has a left adjoint.

Proof. It follows from proposition 4.2.5 and corollary 4.3.7. Remark 4.3.10. It would be way too good if, analogously to corollary 4.3.5, a 푽-enriched functor preserved limits if and only if it preserved colimits. Sadly, counter-examples are easy to find: frames are complete lattices (and thus they are complete Set-enriched categories) satisfying an infinite distributive law, whose homomorphisms preserve arbitrary joins (so preserve limits) and finite meets, but do not necessarily preserve arbitrary meets (and so do not necessarily preserve colimits). The lattice of open sets of topologies provides examples of such frames, and the inverse-image of continuous functions yields frame homomorphisms, which notoriously preserve arbitrary joins (unions of opens sets) and finite meets (intersections of open sets), but not arbitrary meets (interiors of intersections of open sets).

97

5. Future Work

In this dissertation, we developed the foundations of the theory of internal enriched categories.This merging of the separate subjects of internal and enriched category theory raises many issues. In particular one would like to investigate how the theory plays out in examples and exploit the theory in application areas.In this chapter we suggest what seem to be promising areas for future research.

5.1. Sets

Within the category of sets, our theory corresponds to the standard theory of enriched categories (with the restriction that both the enriched categories and the enriching monoidal categories are small). With regards to completeness of the enriching category, the small com- plete symmetric monoidal closed categories are—up to equivalence—what are known as commutative unital quantales.There is some existing theory of quantale enriched categories which has been studied in particular by Dirk Hofmann, and it would be of interest to consider this subject from the point of view of this dissertation. On the one hand, the theorems which we give can be read as the elementary results of that theory. On the other hand, one might try to generalize developments of that theory to our context, such as the duality theory given in Hofmann and Waszkiewicz (2012).

5.2. Modest Sets

The internal category of modest sets in the effective topos (or better, its subcat- egory of assemblies) represents the leading example for the theory of internal enriched categories, as it fits all the requirements we need to develop the theory presented in this dissertation. Let’s recall the definition of the effective topos, Eff (Hyland 1982).

Definition 5.2.1 (effective topos). An object (푋, [‐ =푋 ‐]) of the effective topos is a set 푋 with a non-standard equality predicate [‐ =푋 ‐] on 푋 × 푋, that is, a 푋 × 푋 → 풫(ℕ), such that the axioms ′ ′ Symmetry: [푥 =푋 푥 ] ⟹ [푥 =푋 푥], and

99 5. Future Work

′ ′ ″ ″ Transitivity: [푥 =푋 푥 ] ∧ [푥 =푋 푥 ] ⟹ [푥 =푋 푥 ] are valid. Let’s denote the term [푥 =푋 푥] with [푥 ∈ 푋], since, in a way, it represents the set of witnesses to the belonging of 푥 to 푋. An arrow (푋, [‐ =푋 ‐]) → (푌, [‐ =푌 ‐]) of the effective topos is a class of equivalence of functional relations 푋 → 푌, that is, functions 푓∶ 푋 × 푌 → 풫(ℕ) such that the axioms

′ ′ ′ ′ Relational: 푓 (푥, 푦) ∧ [푥 =푋 푥 ] ∧ [푦 =푌 푦 ] ⟹ 푓 (푥 , 푦 ),

Strict: 푓 (푥, 푦) ⟹ [푥 ∈ 푋] ∧ [푦 ∈ 푌],

′ ′ Single-valued: 푓 (푥, 푦) ∧ 푓 (푥, 푦 ) ⟹ [푦 =푌 푦 ], and

Total: [푥 ∈ 푋] ⟹ ∃푦∶ 푌. 푓 (푥, 푦) are valid, and where who such functional relations 푓 and 푔 are equivalent if 푓 (푥, 푦) ⟺ 푔(푥, 푦) is valid. Given two morphisms

[푓 ] [푔] (푋, [‐ =푋 ‐]) −−→(푌, [‐ =푌 ‐]) −−→(푍, [‐ =푍 ‐]), the composition is given by the class of equivalence of the predicate

(푔 ∘ 푓 )(푥, 푧) ≔ ∃푦∶ 푌. 푓 (푥, 푦) ∧ 푔(푦, 푧).

The identity for an object is given by the non-standard equality predicate of the object.

There is a functor 훥∶ Set → Eff sending a set 푋 to the object (푋, 훿푋), where ′ ′ 훿푋(푥, 푥 ) = ℕ if 푥 = 푥 and ∅ otherwise. Let’s now define the internal category of modest sets Mod in the effective topos (Hyland 1988).

Definition 5.2.2 (modest sets). A modest set is an object (푋, [‐ =푋 ‐]) in Eff ′ ′ ′ ′ such that [푥 =푋 푥 ] = [푥 ∈ 푋] ∩ [푥 ∈ 푋] and [푥 =푋 푥 ] ≠ ∅ implies 푥 = 푥 for all 푥, 푥′ ∈ 푋.

Modest sets are, equivalently, partial equivalence relations on ℕ. Let PER be the category of partial equivalence relations on ℕ.

Definition 5.2.3 (category of modest sets). The object of objects of the internal category Mod in Eff is Mod0 = 훥(PER0).The object of arrows of Mod is the subobject of 훥(PER1) with existence predicate given by [푓 ∈ Mod1] = { 푛 ∣ 푛 is an index for 푓 }.

100 5.3. Groupoids

In the effective topos, Mod is weakly complete, in the sense of Hyland, Robin- son, and Rosolini 1990. Sadly that is not much use for the purposes of this dissertation. However we can restrict attention to the quasi-topos of separated objects for the double-negation topology, which is, equivalently, the category of assemblies.

Definition 5.2.4 (assemblies). An assembly is an object (푋, [‐ =푋 ‐]) of Eff ′ ′ ′ such that [푥 =푋 푥 ] ≠ ∅ implies 푥 = 푥 for all 푥, 푥 ∈ 푋. Let’s call Asm the full subcategory of assemblies in the effective topos.

Then, Mod is an internal strongly complete category in Asm (ibid.). Moreover, the in Mod makes it a symmetric monoidal closed category. Then, we can then consider Mod-enriched categories in Asm, and the theory developed in this dissertation will hold in that context.

5.3. Groupoids

The original suggestion that there should be an internal enrichment over the category of Modest Sets came from a discussion with Rosolini on the topic of categorical models of type theory, in an attempt to formalize the intuition of a groupoid-like object whose hom-sets look like modest sets. In the early stages of the research,I abandoned the attempt to develop a theory for groupoids, focusing instead on the mere enrichment over an internal monoidal category. The reason is that, to define an enriched groupoid, the enriching category has to be cartesian monoidal, an that would have much reduced the generality of the argument. Indeed, the internal logic of a monoidal category does not even allow to express a formula of the kind 푓 ∘ 푓 −1 = id! Still, the leading example of the category of Modest Sets is cartesian monoidal (other then cartesian closed and complete), so it would support a notion of groupoid enriched over it. It would then be interesting to specialize the present theory to groupoids enriched over a cartesian monoidal category, and then apply that theory to the category of Modest Sets.

5.4. Monads

Monads are an essential tool in category theory, and have found wide appli- cation in the area of theoretical computer science (Moggi 1991). It is then opportune to develop a theory of monads in the context of internal enriched categories.There two aspects of monads which seem worth following up from the point of view of this dissertation. First note that the category of modest sets just discussed is cartesian closed and we might wish to have examples of more general complete symmetric

101 5. Future Work monoidal closed internal categories. One way to do that is by using the theory of commutative monads as developed by Anders Kock (Kock 1970, 1971a,b, 1972a,b). Suppose we have an internal complete cartesian closed or even symmetric monoidal closed category and an internal commutative monad T on it. Then we would expect the category of T-algebras to be complete symmetric monoidal closed. Typically algebraic theories where there is a natural tensor product on algebras are commutative.There are many mathematical examples and if anything more examples have been studied in connection with Moggi’s approach to computational effects.There will surely be versions of such monads acting on modest sets and that will give a large collection of examples of the theory presented in this dissertation. Secondly we might develop a theory of internal enriched monads. We sketch the basic framework. Assume 푽 is an internal symmetric monoidal category in ℰ with equalizer.

Definition 5.4.1 (internal enriched monad). Let 푿 be a 푽-enriched category. A monad 푇 on 푿 is a triple

(푇∶ 푿 → 푿, 휂∶ id(푿) → 푇, 휇∶ 푇2 → 푇) such that 휇(휂푇) = id(푇)∶ 푇 → 푇 and 휇(휇푇) = 휇(푇휇)∶ 푇3 → 푇. The object of algebras on 푇 is the subobject of 푋 × 푉1 of those (푥∶ 푋, ℎ∶ 푉1) such that

ℎ∶ 핀푽 → Hom푿(푇0(푥), 푥),

Hom푿(푇0(푥), 푥) ⊗ Hom푿(푥, 푇0(푥)) ℎ⊗휂(푥) ∘푿(푥,푇0(푥),푥)

id푿(푥) 핀푽 Hom푿(푥, 푥) and

ℎ⊗ℎ Hom푿(푇0(푥), 푥) 핀푽 ⊗ Hom푿(푇0(푥), 푥)

푇1(푇0(푥),푥)⊗id

휇(푥)⊗ℎ Hom푿(푇0(푇0(푥)), 푇0(푥)) ⊗ Hom푿(푇0(푥), 푥)

∘푿(푇0(푇0(푥)),푇0(푥),푥)

Hom푿(푇0(푇0(푥)), 푇0(푥)) Hom푿(푇0(푇0(푥)), 푥). ⊗ Hom푿(푇0(푥), 푥)

∘푿(푇0(푇0(푥)),푇0(푥),푥)

102 5.5. Cubical Sets

The homset in the context of algebras (푥0, ℎ0) and (푥1, ℎ1) is the equalizer of

Hom푿(푥0, 푥1) Hom푿(푥0, 푥1)

id⊗ℎ0 ℎ0⊗푇1(푥0,푥1)

Hom푿(푥0, 푥1) ⊗ Hom푿(푇0(푥0), 푥0) and Hom푿(푇0(푥1), 푥1) ⊗ Hom푿(푇0(푥0), 푇0(푥1))

∘푿(푇0(푥0),푥0,푥1) ∘푿(푇0(푥0),푇0(푥1),푥1)

Hom푿(푇0(푥0), 푥1) Hom푿(푇0(푥0), 푥1)

and the identity in the context of algebra (푥, ℎ) is id푿(푥). With this data, we have an internal 푽-enriched category of algebras Alg푇. There are some standard definitions and results which would now have to be proved, such as the characterization of monadic functors. Of particular interest would be to prove that categories of algebras Alg푇 are complete.This would imply that categories of algebras are cocomplete too.In standard category theory, it is not generally true that if a category is cocomplete then so is a category of algebras over it. Although there are various circumstances in which such categories are cocomplete, these require individual attention. Even the case of algebras over sets is non-trivial. A theory of monads in the enriched setting is one notable omission in Kelly’s treaties on enriched categories and rather little seems to be have appeared in the classical literature.There may be good reason for this. For example, in his consideration of the related topics of adjoint lifting in the enriched setting, John Power explicitly remarks (Power 1988) that he conducts his arguments essentially in the context of Street’s Formal Theory of Monads (Street 1972). Perhaps because of this intellectual history it would be instructive to develop the theory of enriched monads on an internal enriched category. One would expect initial problems e.g. as to whether the category of algebras is cocomplete to evaporate. But would one now be able to refer to Street’s theory as a suitable background?

5.5. Cubical Sets

There is currently much interest in models for Type Theory (especially for Homotopy Type Theory) in categories of presheaves. Because of its seeming simplicity, internal enriched category theory should provide an ideal setting for this kind of investigations. We shall comment on the possibility of developing a theory of cubical sets (M. Grandis and Mauri 2003) in the context of modest sets.Indeed, cubical sets have been successfully used to yield univalent models for homotopy type theory (Bezem, Coquand, and Huber 2014), and a theory of “modest” cubical

103 5. Future Work sets would provide a potentially interesting variation of those models.In particular, it would be interesting to investigate how the properties of the effective topos, especially those regarding representability, affect such models. To begin with, it would be necessary to define a suitable cube category  in Asm. It could seem tempting to just use the set-theoretic definition, via the embedding 훥, but likely that would not be the best choice: the set of object of the cube category is ℕ, but 훥(ℕ) is not the natural number object of Eff. A better idea would probably be to consider the natural number object of Eff as the object of objects, and a suitable subobject of ℕℕ (whose underlying set is, notably, the set of recursive functions ℕ → ℕ, see Hyland 1982,Lemma 10.1) as the object of arrows.Then, the internal category of “modest” cubical sets, 퐨퐩 [ , Mod], would be a complete symmetric monoidal closed category. 퐨퐩 Moreover, we can consider [ , Mod]-enriched categories, which provide an interesting take on and have potential applications as models for type theory. It is an under-developed idea that categories enriched over cubical sets may be, essentially, types. It is also worth noticing that there is a category of cubical categories (Marco Grandis 2009) which is (according to preliminary investigations) monadic on the category of cubical sets.This again should translate to the language of internal categories, so that we may get an internal category of “modest” cubical categories which is still complete and cartesian closed.

104 Concluding Remarks

This dissertation introduces the notion of internal enriched category, whose definition is a straightforward internalization of that of standard enriched category. This turns out to be a special case of other well-known notions, notably those of indexed enriched category (Shulman 2013) and enriched generalized multicategory (Leinster 2004). The methodical study of internal enriched categories in the spirit of Kelly (1982) shows that they feature many of the good properties of standard enriched categories.In particular, under suitable conditions, the category of internal enriched categories and their functors is monoidal closed, in close analogy to what happens in the external setting.That makes it possible to derive an internalized version of the Yoneda lemma. Moreover, a notion of completeness, compatible with that of strong internal completeness as given in Hyland, Robinson, and Rosolini (1990), applies to internal enriched categories.This is remarkable because there are interest- ing examples of internal complete categories, such as, notably, the internal category of Modest Sets inside the category of Assemblies (a subcategory of the Effective Topos, see Hyland (1982)). We argue that the the theory of internal enriched categories is particularly nice to work with and suitable for applications in areas where the use of standard category theory turns out to be problematic, thanks to its remarkable combination of features.Indeed, as shown in the course of this dissertation, the theory follows the familiar patterns from standard enriched category theory, while offering the generality and wide array of examples of internal category theory. Moreover, internal enriched categories are especially well- behaved in regard to size issues, as they are always small with respect to the ambient category; as a result, many size-related issues and inconveniences that traditionally plague the treatment of completeness, especially in relation to presheaves categories, disappear. In particular, the theory developed herein is meant to find application in the setting of categorical models of type theory. For example, internal enrichment over the category of Modest Sets in the category of Assemblies could provide a natural environment for the development of models with attractive computa- tional features. This is a broad area of research well outside the scope of this dissertation, though nevertheless a worthy investigation for future work. More generally, the approach taken in this thesis is designed to facilitate applications.In particular, note that many type theorists start with the idea of

105 Concluding Remarks models in locally cartesian closed categories, as in Seely (1984). Even though in our leading example of the Modest Sets in the category of Assemblies we do in fact have some existential quantification (after all, as they are a category of separated objects, Assemblies form a quasitopos—see for example Johnstone (2002)), we have been careful to present the whole theory without reference to that. Hence traditional type theorists can exploit the theory here just as it stands.

106 A. Enriched Generalized Multicategories

The notion of internally enriched category is an occurrence of Leinster’s more general notion of enriched generalized multicategory (Leinster 2002, 2004). This section will follow Leinster 2004’s notation.

A.1. Generalized Multicategories

Let ℰ be a finitely complete category. In addition to the usual assumption, we shall need to also assume that the 푈∶ Catℰ → Graphℰ has a left adjoint, the free-category-on-a-graph functor ℱ∶ Graphℰ → Catℰ.In particular, that is true if ℰ has countable products and finite coproducts. Definition A.1.1 (cartesian monad, ibid., definition 4.1.1). Call cartesian • a category, if it has pullbacks; • a functor, if it preserves pullbacks; • a natural transformation, if all of its naturality squares are pullbacks; • a monad (푇, 휂, 휇) on ℰ, if the category ℰ, the functor 푇, and the natural transformations 휇 and 휂 are all cartesian.

Let idℰ be the identity monad on ℰ.This is a cartesian monad, since ℰ is finitely complete (and thus, in particular, cartesian). Definition A.1.2 (generalized multicategory, ibid., definition 4.2.2). Let 푇 be a cartesian monad on ℰ.A 푇-graph is a diagram

퐶1 휎풞 휏풞

푇(퐶0) 퐶0 in ℰ. A (generalized) 푇-multicategory is a monad in the category of 푇-algebras ℰ(푇). Explicitely, a 푇-multicategory 풞 consists of a 푇-graph (as above) together with arrows ⋅ ∶ 퐶 × 푇(퐶 ) → 퐶 풞 1 푇(퐶0) 1 1 (A.1)

107 A. Enriched Generalized Multicategories and i풞 ∶ 퐶0 → 퐶1 (A.2) satisfying associativity and unitarity axioms. Remark A.1.3. Observe that Multicat = Cat and Graph = Graph . idℰ ℰ idℰ ℰ Consider the forgetful functor 푈∶ Multicat → Graph , that is, 푈∶ Cat → idℰ idℰ ℰ Graphℰ, and its left adjoint ℱ.The adjunction (ℱ, 푈, 휂, 휖) is monadic, and it induces the monad (ℱ = 푈ℱ, 휂, • = 푈휖ℱ) over Graphℰ (Leinster 2004, theorem 6.5.2). Given an object 푋 of ℰ, there exists a unique ℰ-category structure on the ℰ-graph 푋 × 푋 휋1 휋2

푋 푋 which is called 퐢퐧퐝(푋), the indiscrete category over 푋. Composition is given by (휋 푝 ,휋 푝 ) (푋 × 푋) × (푋 × 푋) −−−−−−−−−→(푋1 2 2 1 × 푋) 휋1 휋2 (where 푝1 and 푝2 are the pullback’s projections), and identity is given by the diagonal 훥∶ 푋 → 푋 × 푋. The (underlying ℰ-graph of the) indiscrete ℰ-category 퐢퐧퐝(푋) has an ℱ- algebra structure

∘퐢퐧퐝(푋) = 푈휖퐢퐧퐝(푋) ∶ ℱ퐢퐧퐝(푋) → 퐢퐧퐝(푋) given by the counit of the adjunction.Then, there is a (unique) ℱ-multicategory + structure 퐢퐧퐝(푋) (ibid., example 4.2.22) given by a ℱ-graph ℱ퐢퐧퐝(푋) s=id t=∘퐢퐧퐝(푋)

ℱ퐢퐧퐝(푋) 퐢퐧퐝(푋) and operations

휋2 •퐢퐧퐝(푋) ⋅퐢퐧퐝(푋)+ = ℱ퐢퐧퐝(푋) ×ℱ퐢퐧퐝(푋) ℱℱ퐢퐧퐝(푋) −−→ℱℱ퐢퐧퐝(푋) −−−−−→ℱ퐢퐧퐝(푋) and 휂퐢퐧퐝(푋) i퐢퐧퐝(푋)+ = 퐢퐧퐝(푋) −−−−−→ℱ퐢퐧퐝(푋) satisfying associativity and unitarity. + Intuitively, the composition of 퐢퐧퐝(푋) collapses a list of lists of elements of 푋 into a single list:

(푥0, … , 푥푛)⋅퐢퐧퐝(푋)+((푥0, … , 푥1), … , (푥푛−1, … , 푥푛)) = (푥0, … , 푥1, … , 푥푛−1, … , 푥푛).

108 A.2. The ℱ-multicategory 풱

Definition A.1.4 (enriched generalized multicategory, ibid., definition 6.8.1). Let 풱 be an ℱ-multicategory. A 풱-enriched idℰ-multicategory is an object 푋 + of ℰ together with a map 퐢퐧퐝(푋) → 풱 of ℱ-multicategories.

A.2. The ℱ-multicategory 풱

Given the monoidal ℰ-category 푽, there is a ℱ-multicategory (a ℱ-operad, to be more specific) 풱, constructed as follows. 푽 Let 푽0 be the ℰ-graph ퟙℰ ⇇ 푉0. Consider the ℰ-category (푽0, ⊗ , 핀푽) given by the monoidal structure on 푽. Then, by adjunction, there is a morphism of ℰ-categories 0 푽 ⊗ ∶ ℱ(푽0) → (푽0, ⊗ , 핀푽),

ℰ induced by the morphism of -graphs id푽0. On the underlying graph, that 0 is a morphism ⊗ ∶ ℱ(푽0) → 푽0, which is non-trivial only on the arrow’s component. + + Let 푽1 = 푉0 ⇇ 푉1 be the pullback of ℰ-graphs

휋 휋2 ⎜⎛ + 휋2 + 2 ⎟⎞ 푽1 ퟙℰ ⇇ 푉1 ⎜ 푉 ퟙℰ 푉1 푉1 ⎟ ⌟ ⎜ 0 ⌟ ⌟ ⎟ = ⎜ ⇇ ⎟. 휋1 (!,s푽) ⎜ 휋1 휋1 sℳ ⎟ ⎜ ⎟ ⎜ ⎟ ℱ(푽0) 푽0 ퟙℰ ퟙℰ ℱ(푽0) 푉0 ⊗0 ⎝ 1 ⊗0 ⎠

+ + Notice that 푉0 = ퟙℰ.In the internal language of ℰ, the pullback 푉1 has 0 elements those pairs ((퐴푖)∶ ℱ(푽0)1, 푓∶ 푉1) such that s푽(푓 ) = ⊗ (퐴푖). Thus, 푽 informally speaking, 푽1 is the graph with one vertex and arrows 푓∶ 퐴0 ⊗ 푽 … ⊗ 퐴푛 → 퐴 of 푽 as edges, remembering the sequence 퐴0 … 퐴푛 yielding the domain of 푓. ℰ (푽 , ∘ , ) There is an -category structure 1 푽1 id푽1 where composition is defined as + + 휋2×휋2 푉1 × 푉1 푉1 × 푉1

∘ ⊗푽 푽1 + 휋2 휋1×휋1 푉 푉 1 ⌟ 1 휋1 sℳ ℱ(푽 ) × ℱ(푽 ) ℱ(푽 ) 푉 0 1 0 1 ∘ 0 1 0 0 ℱ(푽0) ⊗

109 A. Enriched Generalized Multicategories and identity as

id푽핀푽 ퟙℰ

id푽1 휋2 핀 푉+ 푉 . 푽 1 ⌟ 1 휋1 s푽

푉0 ℱ(푽0)1 푉0 (휂푽 ) ⊗0 0 1

In the internal language,

(퐴 , 푓 ), (퐵 , 푔)∶ 푉+ ⊢ (퐵 , 푔) ∘ (퐴 , 푓 ) = (퐴 ∘ 퐵 , 푓 ⊗푽 푔). 푖 푗 1 푗 푽1 푖 푖 ℱ(푽0) 푗

Informally speaking,

푓 푔 푓⊗푔 (퐴 ⊗…⊗퐴 −→퐴)∘ (퐵 ⊗…⊗퐵 −→퐵) = (퐴 ⊗…⊗퐴 ⊗퐵 ⊗…⊗퐵 −−→퐴⊗퐵). 0 푛 푽1 0 푚 0 푛 0 푚

By adjunction, there is a morphism of 푽-categories

⊗1 ∶ ℱ(푽 ) → (푽 , ∘ , ) 1 1 푽1 id푽1

ℰ induced by the morphism of -graphs id푽1. There is a ℱ-multicategory 풱 with structure given by

푽1 휋1 (!,t푽휋2) .

ℱ(푽0) 푽0

⋅ ∶ 푽 × ℱ(푽 ) → 푽 The composition 풱 1 ℱ(푽0) 1 1 is given by

1 푽1×푽 ⊗ 휋 ×휋 푽 × ℱ(푽 ) 0 푽 × 푽 2 2 ퟙ ⇇ 푉 × 푉 1 ℱ(푽0) 1 1 푽0 1 ℰ 1 푉0 1 휋 2 ⋅풱 (!,∘ℳ) 휋2 , ℱ(푽1) 푽1 ⌟ ퟙℰ ⇇ 푉1

ℱ(휋1) 휋1 (!,s푽) ℱℱ(푽 ) ℱ(푽 ) 푽 0 • 0 0 0 푽0 ⊗

110 A.3. Internal Enrichment to Enriched Generalized Multicategories

and the identity i풱 ∶ 푽0 → 푽1 given by

(!,id푽) 푽0

i풱 휋2 . 푽1 ퟙℰ ⇇ 푉1 휂 ⌟ 푽0 휋1 (!,s푽)

ℱ(푽0) 푽0 ⊗0 Observe that only the edges’ part is non-trivial. In the internal language, + given (퐴푖, 푓 )∶ 푉1 and ((퐴푗)푖, 푓푖)∶ ℱ(푽1)1 such that 퐴푖 = t푽(푓푖)∶ ℱ(푽0)1, multi-category composition on the arrows’ component is defined as 1 + (퐴푖, 푓 )(⋅풱)1((퐴푗)푖, 푓푖) ≔ (퐴(푖,푗), 푓 ∘푽 ⊗ (푓푖))∶ 푉1 퐴 = (• ) ((퐴 ) )∶ ℱ(푽 ) where (푖,푗) 푽0 1 푗 푖 0 1 (and it is trivial on the object compo- nent). Informally, 푓 ⋅풱 (푓0, … , 푓푛) is 퐴0 ⊗ … ⊗ 퐴0 … 퐴푛 ⊗ … ⊗ 퐴푛 0 푚0 0 푚푛

푓0 ⊗ … ⊗ 푓푛

퐴0 ⊗ … ⊗ 퐴푛 푓 퐴.

A.3. Internal Enrichment to Enriched Generalized Multicategories

Let 푿 be a 푽-enriched category. We shall build a 풱-enriched id-multicategory 풳 out of it. That is given by an object of ℰ, let’s choose 푋, and a morphism + 퐢퐧퐝(푋) → 풱 of ℱ-categories; that means a in Graphℰ ℱ퐢퐧퐝(푋) ∘퐢퐧퐝(푋)

ℱ퐢퐧퐝(푋) 풳1 퐢퐧퐝(푋) (A.3)

ℱ풳0 푽1 풳0 s 풱 t풱

ℱ(푽0) 푽0

111 A. Enriched Generalized Multicategories such that the diagrams

i 퐢퐧퐝(푋)+ 퐢퐧퐝(푋) ℱ퐢퐧퐝(푋)

풳0 풳1 (A.4)

푽0 푽1 i풱

and

⋅ 퐢퐧퐝(푋)+ ℱ퐢퐧퐝(푋) ×ℱ퐢퐧퐝(푋) ℱℱ퐢퐧퐝(푋) ℱ퐢퐧퐝(푋)

풳1×ℱ풳1 풳1 (A.5) 푽 × ℱ(푽 ) 푽 1 ℱ(푽0) 1 ⋅풱 1

commute.

(!,Hom푿) Let 풳0 be 퐢퐧퐝(푋) −−−−−−→푽0.

The arrow 풳1 ∶ ℱ퐢퐧퐝(푋) → 푽1 requires a two-step construction. Consider the ℰ-graph 푽푿 ∶ (푽푿)0 ⇇ (푽푿)1, given by

휋 ⎛ 휋2 휋 ⎞ 2 ⎜ (푽 ) ퟙ 2 + ⎟ 푽푿 푽1 ⎜ 푿 0 풞 (푽푿)1 푉1 ⎟ ⌟ ⎜ ⌟ ⌟ ⎟ ⎜ ⎟ 휋1 (!,t푽휋2) = ⎜ 휋1 ⇇ 휋1 t 휋 ⎟ ⎜ 푽 2 ⎟ ⎜ ⎟ 퐢퐧퐝(푋) 푽0 푋 ퟙ풞 푋 × 푋 푉0 풳0 ⎝ Hom푿 ⎠

and notice that (푽푿)0 = 푋, while, in the internal language, (푽푿)1 has el- ements those tuples (푥0 ∶ 푋, 푥1 ∶ 푋, (퐴푖)∶ ℱ(푽0)1, 푓∶ 푉1) such that s푽(푓 ) = 0 ⊗ (퐴푖) and t푽(푓 ) = Hom푿(푥0, 푥1).Informally, 푽푿 is the graph with elements of 푋 as vertices, and arrows 푓∶ 퐴0 ⊗ … ⊗ 퐴푛 → Hom푿(푥0, 푥1) as edges from the vertex 푥0 to the vertex 푥1. ℰ (푽 , ∘ , ) ∘ ∶ (푽 ) × There is a -category structure 푿 푽푿 id푽푿 . Composition 푽푿 푿 1 푋

112 A.3. Internal Enrichment to Enriched Generalized Multicategories

(푽푿)1 → (푽푿)1 is given by

휋 ∘ 푉 2 푉 × 푉 푽 푉 1 1 푉0 1 1

휋1 ⊗푽 푉1 × 푉1 푉1

휋2×휋2 휋2

휋 ×휋 ∘ℱ(푽 ) ∘ + + 1 1 0 . 푿 푉1 × 푉1 ℱ(푽0)1 × ℱ(푽0)1 ℱ(푽0)1

휋 (휋2)1×(휋2)1 1

(휋2)1 ∘푽 + (푽푿)1 ×푋 (푽푿)1 푿 (푽푿)1 푉1 ⌟

(휋1)1×푋(휋1)1 (휋1)1 t푽휋2

푋 × 푋 × 푋 푋 × 푋 푉0 (휋1,휋3) Hom푿

∶ 푋 → (푽 ) Identity id푽푿 푿 1 is given by

(휂(푉0)핀푽!,id푿) 푋 id 푽푿 (휋 ) 2 1 + . (푽푿)1 푉1 훥푋 ⌟ (휋1)1 t푽휋2

푋 × 푋 푉0 Hom푿

In the internal language, the composition is given by

(푥 , 푥 , 퐵 , 푔) ∘ (푥 , 푥 , 퐴 , 푓 ) ≔ (푥 , 푥 , 퐴 ∘ 퐵 , ∘ (푥 , 푥 , 푥 )(푓 ⊗푽 푔). 1 2 푗 푽푿 0 1 푖 0 2 푖 ℱ(푽0) 푗 푿 0 1 2 Informally, the composition is given by

퐵0 ⊗ … ⊗ 퐵푚 퐴0 ⊗ … ⊗ 퐴푛 푔 푓

Hom푿(푥1, 푥2) ⊗ Hom푿(푥0, 푥1)

∘푿(푥0,푥1,푥2)

Hom푿(푥0, 푥2).

113 A. Enriched Generalized Multicategories

푽-functors ℱ퐢퐧퐝(푋) → 푽푿 correspond bijectively, by adjointness, to mor- phisms 퐢퐧퐝(푋) → 푽푿 of ℰ-graphs (by abuse of notation, the same sym- bol is being used for both a ℰ-category and its underlying ℰ-graph). Let ∘푿 ∶ ℱ퐢퐧퐝(푋) → 푽푿 extend the morphism of ℰ-categories

×(휂 , ) (id퐢퐧퐝(푋),Hom푽) id퐢퐧퐝(푋) 푽 id푽 퐢퐧퐝(푋) −−−−−−−−−−−→퐢퐧퐝(푋) × 푽 −−−−−−−−−−−−−→퐢퐧퐝(푋)0 × 푽 ≅ 푽 푽0 0 푽0 1 푿 that is, intuitively, the functor sending 푥 to id푿(푥) and (푥0, 푥1) to id푽(Hom푿(푥0, 푥1)). Then,

∘푿 ∘푿(푥0, … , 푥푛) = Hom푿(푥푛−1, 푥푛) ⊗ … ⊗ Hom푿(푥0, 푥1) −→ Hom푿(푥0, 푥푛).

By applying the forgetful functor, let’s consider ∘푿 as a mere morphism of ℰ-graphs.Let then 풳1 ∶ ℱ퐢퐧퐝(푋) → 푽1 be the composition of ∘푿 with the morphism of ℰ-graphs 휋2 ∶ 푽푿 → 푽1. Diagram (A.3) commutes. To prove this, consider the diagram

퐢퐧퐝(푋)

휂퐢퐧퐝(푋) ℱ퐢퐧퐝(푋) ∘퐢퐧퐝(푋) ∘푿

휋 ℱ퐢퐧퐝(푋) 푽푿 1 퐢퐧퐝(푋) .

휋2

ℱ(풳0) 푽1 풳0 s 풱 t풱

ℱ(푽0) 푽0

Consider the two morphisms ℱ퐢퐧퐝(푋) → 푽0 of ℰ-graphs forming the right square. Direct calculation shows that the square at the bottom commutes. The triangle on top is the underlying diagram of ℰ-graphs of a diagram of ℰ-categories. Restricted by precomposition on 퐢퐧퐝(푋), the two ℰ-graph paths commute. Both the paths ℱ퐢퐧퐝(푋) → 퐢퐧퐝(푋) extend those to ℰ-functors, and as such they must coincide by adjunction. Consider the two morphisms ℱ퐢퐧퐝(푋) → ℱ(푽0) of ℰ-graphs forming the right square. Direct calculation shows that the two paths, restricted on 퐢퐧퐝(푋), commute. Moreover, they are functors of ℰ-categories. Both morphisms of ℰ- graphs extend that to ℰ-functors on ℱ퐢퐧퐝(푋), and as such they must coincide by adjunction.

114 A.3. Internal Enrichment to Enriched Generalized Multicategories

Diagram (A.4) commutes, because

id퐢퐧퐝(푋)×i풱 퐢퐧퐝(푋) × 푽 푽 푽0 0 푿 휋 (id퐢퐧퐝(푋),풳0) 2 i + 퐢퐧퐝(푋) 풳1 . 퐢퐧퐝(푋) = ℱ퐢퐧퐝(푋) 푽1 휂퐢퐧퐝(푋)

푽 i풱 풳0 0

⋅ ∶ 푽 × ℱ(푽 ) → 푽 Diagram (A.5) commutes.To begin with, define 푽푿 푿 ℱ(푽0) 푿 푿 as 휋 ×ℱ(휋 ) 푽 × ℱ(푽 ) 2 2 푽 × ℱ(푽 ) 푿 ℱ(푽0) 푿 1 ℱ(푽0) 1

⋅ ⋅풱 푽푿 휋2 . 휋1 푽 푽 푿 ⌟ 1

휋1 (!,t푽휋2)

푽푿 휋 퐢퐧퐝(푋) 푽0 1 풳0

푖 푖 In the internal language, given (푥0, 푥1, 퐴푖, 푓 )∶ (푽푿)1 and (푥0, 푥1, (퐴푗)푖, 푓푖)∶ ℱ(푽푿)1 푖 푖 such that 퐴푖 = Hom푿(푥0, 푥1)∶ ℱ(푽0)1, multi-category composition on the ar- rows’ component is defined as

(푥 , 푥 , 퐴 , 푓 )(⋅ ) (푥푖 , 푥푖 , (퐴 ) , 푓 ) ≔ (푥 , 푥 , 퐴 , 푓 ∘ ⊗1(푓 ))∶ (푽 ) . 0 1 푖 푽푿 1 0 1 푗 푖 푖 0 1 (푖,푗) 푽 푖 푿 1

푓 ⋅ (푓 , … , 푓 ) Intuitively, the composition 푽푿 0 푛 is given by

퐴0 ⊗ … ⊗ 퐴0 … 퐴푛 ⊗ … ⊗ 퐴푛 0 푚0 0 푚푛

푓0 ⊗ … ⊗ 푓푛 0 0 푛 푛 Hom푿(푥0, 푥1) ⊗ … ⊗ Hom푿(푥0, 푥1) 푓

Hom푿(푥0, 푥1)

⋅ ⋅ so that 푽푿 is an extension of 풱. ℰ ⋅ ℰ 푽 The morphism of -graphs 푽푿 is a functor of -categories, where 푿 is

115 A. Enriched Generalized Multicategories

ℰ (푽 , ∘ , ) given the -category structure 푿 푽푿 id푽푿 .This means that the diagrams

id 푽푿×ℱ(푽푿) (푽 × ℱ(푽 )) (푽 × ℱ(푽 )) 푿 ℱ(푽0) 푿 0 푿 ℱ(푽0) 푿 1

(⋅푽 ) (⋅푽 ) (A.6) 푿 0 푿 1

(푽푿) (푽푿) 0 id 1 푽푿 and

∘ (푽푿×ℱ(푽푿))

(푽 × ℱ(푽 )) × (푽 × ℱ(푽 )) (푽 × ℱ(푽 )) 푿 ℱ(푽0) 푿 1 푋 푿 ℱ(푽0) 푿 1 푿 ℱ(푽0) 푿 1

(⋅푽 ) ×(⋅푽 ) (⋅푽 ) 푿 1 푿 1 푿 1

(푽푿)1 ×푋 (푽푿)1 ∘ (푽푿)1 푽푿 (A.7) commute. Then, to prove that (A.5) commutes is to prove that

⋅ 퐢퐧퐝(푋)+ ℱ퐢퐧퐝(푋) ×ℱ퐢퐧퐝(푋) ℱℱ퐢퐧퐝(푋) ℱ퐢퐧퐝(푋) ∘ ∘푿×ℱ∘푿 푿 (A.8)

푽푿 ×ℱ(푽 ) ℱ(푽푿) ⋅ 푽푿 0 푽푿 commutes. All morphisms in (A.8) are functors of ℰ-categories.Thus, it suffices to show that the paths commute on the generators of

ℱ퐢퐧퐝(푋) ×ℱ퐢퐧퐝(푋) ℱℱ퐢퐧퐝(푋) ≅ ℱ(퐢퐧퐝(푋) ×퐢퐧퐝(푋) ℱ퐢퐧퐝(푋)).

Also, notice that 퐢퐧퐝(푋) ×퐢퐧퐝(푋) ℱ퐢퐧퐝(푋) ≅ ℱ퐢퐧퐝(푋). With this in mind,

116 A.4. Enriched Generalized Multicategories to Internal Enrichment

the diagram

푽푿

휋2 ∘푿 ℱ퐢퐧퐝(푋)

휂퐢퐧퐝(푋)×휂ℱ퐢퐧퐝(푋) ⋅ + (∘퐢퐧퐝(푋),idℱ퐢퐧퐝(푋)) 퐢퐧퐝(푋)

ℱ퐢퐧퐝(푋) 퐢퐧퐝(푋) ×퐢퐧퐝(푋) ℱ퐢퐧퐝(푋) ℱ퐢퐧퐝(푋) ×ℱ퐢퐧퐝(푋) ℱℱ퐢퐧퐝(푋)

(id퐢퐧퐝(푋)×Hom푿)×∘푿 ∘푿×ℱ∘푿 (퐢퐧퐝(푋) × 푽 ) × 푽 푽 × ℱ(푽 ) 0 푽0 푿 푿 ℱ(푽0) 푿

(id ×i )×휂 ⋅푽 퐢퐧퐝(푋) 풱 푽푿 푿

푽푿 휋2 ∘푿

proves that (A.8) commutes.

Remark A.3.1. For the notion of natural transformation of functors of 푇- multicategory, and of 풱-enriched functor, see Leinster 2002.

Given a functor 퐹∶ 푿 → 풀 of 푽-enriched categories, there is a 풱-enriched ℱ-functor 풳 → 풴 given by 퐹0 ∶ 푋0 → 푌0, and 퐹1 ∶ 퐢퐧퐝(푋) → 푽1 induced by 퐹1 ∶ 푋 × 푋 → 푉1.

A.4. Enriched Generalized Multicategories to Internal Enrichment

+ Let 풳∶ 퐢퐧퐝(푋) → 풱 be a 풱-enriched ℱ-multicategory as in eq.(A.3). Then there is a 푽-category 푿 on 푋 whose hom is Hom푿 = (풳0)1 ∶ 푋 × 푋 =

117 A. Enriched Generalized Multicategories

퐢퐧퐝(푋)1 → 푉0, whose composition is

푋 × 푋 × 푋 ≅ 퐢퐧퐝(푋) × 퐢퐧퐝(푋) 1 s퐢퐧퐝(푋) t퐢퐧퐝(푋) 1 (휂 ) ×(휂 ) 퐢퐧퐝(푋) 1 퐢퐧퐝(푋) 1 (ℱ퐢퐧퐝(푋)) × (ℱ퐢퐧퐝(푋)) 1 sℱ퐢퐧퐝(푋) tℱ퐢퐧퐝(푋) 1

∘ℱ퐢퐧퐝(푋) , (ℱ퐢퐧퐝(푋))1

(풳1)1

(푽1)1

(휋2)1

푉1 and whose identity id푿 is

(휂)0 iℱ퐢퐧퐝(푋) (풳1)1 (휋2)1 푋 = 퐢퐧퐝(푋)0 −−−→(ℱ퐢퐧퐝(푋))0 −−−−−−→(ℱ퐢퐧퐝(푋))1 −−−−→(푽1)1 −−−−→푉1.

Given a ℱ-enriched functor 퐹∶ 푿 → 풀 of ℱ-enriched categories, there is a functor of 푽-categories given by 퐹0 ∶ 푋0 → 푌0, and 퐹1 ∶ 푋 × 푋 → 푉1 induced by 퐹1 ∶ 퐢퐧퐝(푋) → 푽1.

A.5. Equivalence

Finally, let’s show that the constructions defined in the previous sections are mutually inverse (up to isomorphism), meaning that 풱-enriched id-multicategories and 푽-enriched categories are equivalent notions.

Proposition A.5.1. Let 푿 be a 푽-enriched category, 풳 the 풱-enriched id- multicategory associated to 푿, and 푿̄ the 푽-enriched category associated to 풳. Then, 푿 ≅ 푿̄.

Proof. Observe that Hom푿 = Hom푿̄. The composition

∘ℱ퐢퐧퐝(푋) (풳1)1 (ℱ퐢퐧퐝(푋))1 s×t (ℱ퐢퐧퐝(푋))1 −−−−−−→(ℱ퐢퐧퐝(푋))1 −−−−→(푽1)1 is equal to

∘ (풳1)1×(풳1)1 푽1 (ℱ퐢퐧퐝(푋))1 s×t (ℱ퐢퐧퐝(푋))1 −−−−−−−−−−→(푽1)1 × (푽1)1 −−→(푽1)1.

118 A.5. Equivalence

̄ Then, the composition ∘푿̄ of 푿 is

퐢퐧퐝(푋)1 s×t 퐢퐧퐝(푋)1 퐢퐧퐝(푋)1 s×t 퐢퐧퐝(푋)1 (휂 ) ×(휂 ) (휂 ) ×(휂 ) 퐢퐧퐝(푋) 1 퐢퐧퐝(푋) 1 퐢퐧퐝(푋) 1 퐢퐧퐝(푋) 1

(ℱ퐢퐧퐝(푋))1 s×t (ℱ퐢퐧퐝(푋))1 (ℱ퐢퐧퐝(푋))1 s×t (ℱ퐢퐧퐝(푋))1

(풳1)1×(풳1)1 (풳1)1×(풳1)1 = (푽1)1 × (푽1)1 (푽1)1 × (푽1)1

∘푽 1 (휋2)1×(휋2)1

(푽1)1 푉1 ×푋 푉1

(휋2)1 ∘푿(휋1⊗휋2)

푉1 푉1 which is ∘푿.

Proposition A.5.2. Let 풳 be a 풱-enriched id-multicategory, 푿 the 푽-enriched category associated to 풳, and 풳̄ the 풱-enriched id-multicategory associated to 푿. Then, 풳 ≅ 풳̄ . ̄ ̄ Proof. Observe that 풳0 = 풳0.Then, it’s enough to check (풳1)1 = (풳1)1 (up to canonical isomorphism) on the generators of the ℱ퐢퐧퐝(푋), that is, on 퐢퐧퐝(푋) × 퐢퐧퐝(푋) 1 s퐢퐧퐝(푋) t퐢퐧퐝(푋) 1 (휂 ) ×(휂 ) 퐢퐧퐝(푋) 1 퐢퐧퐝(푋) 1 (ℱ퐢퐧퐝(푋)) × (ℱ퐢퐧퐝(푋)) 1 sℱ퐢퐧퐝(푋) tℱ퐢퐧퐝(푋) 1

∘ℱ퐢퐧퐝(푋)

(ℱ퐢퐧퐝(푋))1 but that means to check that ∘푿 is equal to the composition of the 푽-enriched category associated to 풳̄ , which has already been proven in the previous proposition.

119

Bibliography

Bezem, Marc,Thierry Coquand, and Simon Huber (2014). “A model of type theory in cubical sets”. In: 19th International Conference on Types for Proofs and Programs (TYPES 2013). Vol. 26, pp. 107–128 (cit. on p. 103). Borceux, F. (1994). Handbook of Categorical Algebra. Categories and Struc- tures. Vol. 2. Cambridge University Press (cit. on p. 5). Crole, Roy L (1993). Categories for types. Cambridge University Press (cit. on p. 5). Girard,Jean-Yves (1972). “Interprétation fonctionelle et élimination des coupures de l’arithmétique d’ordre supérieur”. PhD thesis. PhD thesis, Université Paris VII (cit. on p. 1). Grandis, M. and L. Mauri (2003). “Cubical sets and their site”. In: Theory and Applications of Categories 11.8, pp. 185–211 (cit. on p. 103). Grandis, Marco (2009). “The role of symmetries in cubical sets and cubical categories”. In: Cahiers de topologie et géométrie différentielle catégoriques 50.2, pp. 102–143 (cit. on p. 104). Hofmann, Dirk and Paweł Waszkiewicz (2012). “A duality of quantale-enriched categories”. In: Journal of Pure and Applied Algebra 216.8-9, pp. 1866–1878 (cit. on p. 99). Hyland, J. Martin E. (1982). “The effective topos”. In: The L. E. J. Brouwer centenary symposium. Ed. by A. S.Toelstra and D. van Dalen.Vol. 110. Amsterdam: North-Holland, pp. 165–216 (cit. on pp. 1, 99, 104, 105). – (1988). “A small complete category”. In: Annals of pure and applied logic 40.2, pp. 135–165 (cit. on pp. 1, 27, 33, 37, 83, 100). Hyland, J. Martin E., Edmund P. Robinson, and Giuseppe Rosolini (1990). “The discrete objects in the effective topos”. In: Proc.London Math. Soc. 3(60), pp. 1–36 (cit. on pp. 1, 2, 27, 33, 101, 105). Johnstone, Peter T. (2002). Sketches of an elephant: A topos theory compendium: Volumes 1 and 2. Oxford Logic Guides 43. Oxford Science Publications (cit. on pp. 5, 20, 106). Kelly, Max (1982). Basic concepts of enriched category theory.Vol. 64. CUP Archive (cit. on pp. 2, 27, 86, 105). Kock, Anders (1970). “Monads on symmetric monoidal closed categories”. In: Archiv der Mathematik 21.1, pp. 1–10 (cit. on p. 102). – (1971a). “Closed categories generated by commutative monads”. In: Journal of the Australian Mathematical Society 12.4, pp. 405–424 (cit. on p. 102).

121 Bibliography

Kock, Anders (1971b). “On double dualization monads”. In: Mathematica Scan- dinavica 27.2, pp. 151–165 (cit. on p. 102). – (1972a). “Bilinearity and cartesian closed monads”. In: Mathematica Scan- dinavica 29.2, pp. 161–174 (cit. on p. 102). – (1972b). “Strong functors and monoidal monads”. In: Archiv der Mathematik 23.1, pp. 113–120 (cit. on p. 102). Leinster, Tom (2002). “Generalized enrichment of categories”. In: J. Pure Appl. Algebra 168.2-3. Category theory 1999 (Coimbra), pp. 391–406. issn: 0022- 4049 (cit. on pp. 3, 107, 117). – (2004). Higher operads, higher categories.Vol. 298.London Mathemati- cal Society Lecture Note Series. Cambridge University Press, Cambridge, pp. xiv+433. isbn: 0-521-53215-9 (cit. on pp. 3, 105, 107–109). Mac Lane, S. (1989). Categories for the Working Mathematician. 2nd ed. Grad- uate Texts in Mathematics 7. Springer-Verlag (cit. on p. 5). Moggi, E. (1991). “Notions of computation and monads”. In: Information And Computation 93(1) (cit. on p. 101). Paré, Robert and Dietmar Schumacher (1978). “Abstract families and the adjoint functor theorems”. In: Indexed categories and their applications. Springer, pp. 1–125 (cit. on p. 1). Power, AJ (1988). “A unified approach to the lifting of adjoints”. In: Cahiers de topologie et géométrie différentielle catégoriques 29.1, pp. 67–77 (cit. on p. 103). Seely, R. A. G. (1984). “Locally cartesian closed categories and type theory”. In: Mathematical Proceedings of the Cambridge Philosophical Society 95.1, pp. 33–48. doi: 10.1017/S0305004100061284 (cit. on pp. 28, 106). Shulman, Michael (2008). “Framed and monoidal fibrations”. In: Theory and Applications of Categories 20.18, pp. 650–738 (cit. on p. 16). – (2013). “Enriched indexed categories”. In: Theory and Applications of Cate- gories 28.21, pp. 616–695 (cit. on pp. 16, 20, 22, 23, 25, 105). Street, Ross (1972). “The formal theory of monads”. In: Journal of Pure and Applied Algebra 2.2, pp. 149–168 (cit. on p. 103).

122