Axiomatic Domain Theory

in Categories of Partial Maps

Marcelo P. Fiore

Doctor of Philosophy University of Edinburgh

June 1994

(Graduation date November 1994)

Dedicado a mis padres, Cristina y Luis, y a mis hermanos, Verónica y Alejandro.

\begin{matrix}c \\ ◯ \end{matrix}Marcelo P. Fiore

Synopsis

This thesis is an investigation into axiomatic categorical domain theory as needed for the denotational semantics of deterministic programming languages.

To provide a direct semantic treatment of non-terminating computations, we make partiality the core of our theory. Thus, we focus on categories of partial maps. We study representability of partial maps and show its equivalence with classifiability. We observe that, once partiality is taken as primitive, a notion of approximation may be derived. In fact, two notions of approximation, contextual approximation and specialisation, based on testing and observing partial maps are considered and shown to coincide. Further we characterise when the approximation relation between partial maps is domain-theoretic in the (technical) sense that the category of partial maps Cpo-enriches with respect to it.

Concerning the semantics of type constructors in categories of partial maps, we present a characterisation of colimits of diagrams of total maps; study order-enriched partial cartesian closure; and provide conditions to guarantee the existence of the limits needed to solve recursive type equations. Concerning the semantics of recursive types, we motivate the study of enriched algebraic compactness and make it the central concept when interpreting recursive types. We establish the fundamental property of algebraically compact categories, namely that recursive types on them admit canonical interpretations, and show that in algebraically compact categories recursive types reduce to inductive types. Special attention is paid to Cpo-algebraic compactness, leading to the identification of a 2-category of kinds with very strong closure properties.

As an application of the theory developed, enriched categorical models of the metalanguage FPC (a type theory with sums, products, exponentials and recursive types) are defined and two abstract examples of models, including domain-theoretic models, are axiomatised. Further, FPC is considered as a programming language with a call-by-value operational semantics and a denotational semantics defined on top of a categorical model. Operational and denotational semantics are related via a computational soundness result. The interpretation of FPC expressions in domain-theoretic Poset-models is observed to be representation-independent. And, to culminate, a computational adequacy result for an axiomatisation of absolute non-trivial domain-theoretic models is proved.

Declaration

This thesis was composed by myself. The work reported herein, unless otherwise stated, is my own.

Marcelo P. Fiore

Acknowledgements/Agradecimientos

I will always remain in intellectual debt to my supervisor Gordon Plotkin for having taught me how to do research with his example. Discussing my ideas with him was always —and still is— a pleasure: his suggestions are helpful, and his comments and questions are insightful. This thesis would not have been possible without his stimulating guidance.

I had two second supervisors Barry Jay and John Power from whom I learnt a great deal of category theory and to whom I am grateful for their support and involvement in my work.

In addition, I would like to thank Pietro Cenciarelli, Eugenio Moggi, Wesley Phoa, Andy Pitts, Pino Rosolini and Alex Simpson for conversations on my work.

Also, I am most grateful to Dana Scott and Zhaohui Luo for having examined my thesis.

For friendship I am grateful to Claudia Bolland, Simona Castaldi, Pietro Cenciarelli, Søren Christensen, Jocelyne Giambiaggi, Davide Sangiorgi and David N. Turner.

From October 1992 to October 1993 this work was supported by Fundación Antorchas and The British Council grant ARG 2281/14/6. I am grateful to Monica Paterson for handling the grant with expertise.

A mis padres Cristina y Luis les estoy agradecido porque siempre confiaron en mi, porque siempre me apoyaron en todo y porque les debo todo lo que soy. A mis hermanos Verónica y Alejandro les agradezco su invaluable amistad.

Table of Contents

1. Introduction 1

1.1 Background . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 1.1.1 Undefinedness in Domain Theory . . . . . . . . . . . . . . . . . . 2 1.1.2 Metalanguages for Denotational Semantics . . . . . . . . . . . . . 3 1.1.3 Relating Operational and Denotational Semantics . . . . . . . . . 3 1.1.4 Recursive Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 1.1.5 Abstract Approaches to Domain Theory . . . . . . . . . . . . . . 5

1.2 Our Approach . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 1.2.1 Partiality . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 1.2.2 The Approximation Order . . . . . . . . . . . . . . . . . . . . . . 9 1.2.3 Type Constructors . . . . . . . . . . . . . . . . . . . . . . . . . . 11 1.2.4 Recursive Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 1.2.5 Fixed-point Operators . . . . . . . . . . . . . . . . . . . . . . . . 13 1.2.6 Models of the Metalanguage FPC . . . . . . . . . . . . . . . . . . 14

1.3 Layout of the Thesis and Summary of Results . . . . . . . . . . . . . . . 15

2. Categorical Preliminaries 21 2.1 2-Category Theory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 2.2 Order-enriched Category Theory . . . . . . . . . . . . . . . . . . . . . . . 25 2.3 Basic Concepts of Enriched Category Theory . . . . . . . . . . . . . . . . 27 Table of Contents ii

2.3.1 The Elementary Notions . . . . . . . . . . . . . . . . . . . . . . . 27 2.3.2 Functor Categories . . . . . . . . . . . . . . . . . . . . . . . . . . 35 2.3.3 Limits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39

3. Partiality 41 3.1 Categories of Partial Maps . . . . . . . . . . . . . . . . . . . . . . . . . . 41 3.2 Representing and Classifying Partial Maps . . . . . . . . . . . . . . . . . 47 3.3 Testing and Observing Partial Maps . . . . . . . . . . . . . . . . . . . . 58

4. Order-Enriched Categories of Partial Maps 62 4.1 Ordering Partial Maps . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62 4.2 Poset-Categories of Partial Maps . . . . . . . . . . . . . . . . . . . . . . 66 4.3 Cpo-Categories of Partial Maps . . . . . . . . . . . . . . . . . . . . . . . 69

4.3.1 Properties of Cpo-Categories of Partial Maps . . . . . . . . . . . 70 4.3.2 Uniform Domain Structures . . . . . . . . . . . . . . . . . . . . . 74 4.3.3 Characterisation of Cpo-Categories of Partial Maps induced by

Uniform Domain Structures . . . . . . . . . . . . . . . . . . . . . 77 4.3.4 Computing Lubs of ω-Chains of Partial Maps . . . . . . . . . . . 85

4.4 Enrichment with respect to Specialisation . . . . . . . . . . . . . . . . . 85 4.5 Cpo-Categories of Partial Maps Revisited . . . . . . . . . . . . . . . . . 87

5. Data Types 91 5.1 Partial Binary Products . . . . . . . . . . . . . . . . . . . . . . . . . . . 91 5.2 Partial Exponentials . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101 5.3 Colimits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106 5.4 Colimits of ω-Chains of Embeddings . . . . . . . . . . . . . . . . . . . . 118 Table of Contents iii

6. Recursive Types 125 6.1 Algebraic Completeness . . . . . . . . . . . . . . . . . . . . . . . . . . . 126 6.2 Algebraic Compactness: Motivation . . . . . . . . . . . . . . . . . . . . . 135 6.3 The Doubling Trick . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 138 6.4 Algebraic Compactness: Fundamental Property . . . . . . . . . . . . . . 141 6.5 Recursive Types Reduce to Inductive Types . . . . . . . . . . . . . . . . 148 6.6 Algebraic ω-Completeness and ω-Compactness . . . . . . . . . . . . . . . 153 6.7 Algebraic Supercompleteness and Supercompactness . . . . . . . . . . . . 155

7. Recursive Types in Cpo-Categories 156 7.1 Cpo-Algebraic Completeness . . . . . . . . . . . . . . . . . . . . . . . . 156 7.2 Cpo-Algebraic Compactness . . . . . . . . . . . . . . . . . . . . . . . . . 161 7.3 Categories of Kinds . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 162

7.3.1 PKind . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 163 7.3.2 Kind . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 167

8. FPC 172 8.1 The Language . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 172 8.2 Operational Semantics . . . . . . . . . . . . . . . . . . . . . . . . . . . . 176 8.3 Categorical Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 178 8.4 Denotational Semantics . . . . . . . . . . . . . . . . . . . . . . . . . . . . 179 8.5 Two Axiomatisations of Models . . . . . . . . . . . . . . . . . . . . . . . 186

8.5.1 Domain-Theoretic Models . . . . . . . . . . . . . . . . . . . . . . 187 8.5.2 Axiomatic K_{∗}-Models . . . . . . . . . . . . . . . . . . . . . . . . . 188

8.6 Poset-Models and Parametricity . . . . . . . . . . . . . . . . . . . . . . 196 Table of Contents iv

9. Computational Soundness and Adequacy 200 9.1 Soundness . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 200 9.2 Adequacy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 201

10.Summary and Further Research 223 10.1 Towards Axiomatic Domain Theory . . . . . . . . . . . . . . . . . . . . . 224 10.2 Algebraic Completeness and Compactness . . . . . . . . . . . . . . . . . 225 10.3 Computational Adequacy . . . . . . . . . . . . . . . . . . . . . . . . . . 226 10.4 Towards a Topos for Domain Theory . . . . . . . . . . . . . . . . . . . . 231 10.5 Reasoning about Recursive Types . . . . . . . . . . . . . . . . . . . . . . 233 10.6 Non-determinism . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 234 10.7 Polymorphism . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 235

A. Lemma 8.4.4 236

B. Theorem 8.6.6 240

C. Lemma 9.1.3 248

D. Propositions D.0.1 and D.0.2 260 “Another word about Category Theory: I actually feel that it is particularly significant and important for the theory and for the whole area of semantics. But it must be approached with great caution, for the sheer number of definitions and axioms can try the most patient reader. It seems to me to be especially necessary in discussing applications of abstract mathematical ideas to keep the motivation strongly in mind. This is often hard to do if the categories get too thick, but of course it all depends on the writer. Category Theory is especially useful in stating general properties of structures and in characterizing constructions uniquely; however, there often is a problem actually justifying the existence of certain constructions, and a direct approach can be quicker than quoting lots of theorems. But, man cannot live by construction alone: theorems have to be proved in order to get the proper value out of the work. Domain Theory must also be convenient for demonstrating the soundness of various proof rules for properties of recursively defined objects and recursively defined domains, and I think that Category Theory can be helpful here. A step in the right direction has been made in the LCF system (see [GMW79]), which, however, does not take advantage of general Category Theory; but the whole area needs much more development in my opinion.”

Dana Scott^{1}

1In [Sco82].

1 Introduction

The denotational semantics approach to the semantics of programming languages understands the language constructions by assigning elements of mathematical structures to them. The structures form so-called categories of domains and the study of their closure properties is the subject of domain theory [Sco70,Sco82,Plo83a,GS90,AJ94].

Typically, categories of domains consist of suitably complete partially ordered sets together with continuous maps. But, what is a category of domains? Our aim in this thesis is to answer this question by axiomatising the categorical structure needed on a category so that it can be considered a category of domains. Criteria required from categories of domains can be of the most varied sort. For example, we could ask them to

• have fixed-point operators for endomorphisms and endofunctors;

• have a rich collection of type constructors: coproducts, products, exponentials, powerdomains, dependent types, polymorphic types, etc;

• have a Stone dual providing a logic of observable properties [Abr87,Vic89,Zha91];

• have only computable maps [Sco76,Smy77,McC84,Ros86,Pho90a].

The criteria adopted here will be quite modest but rich enough for the denotational semantics of deterministic programming languages. For us a category of domains will be a category with the structure necessary to support the interpretation of the metalanguage FPC (a type theory with sums, products, exponentials and recursive types). And our axiomatic approach will aim not only at clarifying the categorical structure needed on a category for doing domain theory but also at relating such mathematical criteria with computational criteria.

1.1 Background

This section discusses the topics in domain theory that serve as a basis for our work. The aim is to present the line of research which we explore in this thesis and to outline our approach (a more detailed account is deferred to Sections 1.2 and 1.3). Other abstract approaches to domain theory are also mentioned briefly.

1.1.1 Undefinedness in Domain Theory

In domain theory, the traditional treatment of undefinedness (arising from the possibility of non-termination in computation) is to postulate a fictitious element, undefined, and code partial functions as total ones. This has been the approach right from the beginning; we quote from [Sco69]:

“We do not wish to reject a program if the function defined is partial — because as everyone knows it is not possible to predict which programs will ‘loop’ and which will define total functions.

The solution to this problem of total vs. partial functions is to make a ‘mathematical model’ for the theory of partial functions using ordinary total functions.”

This approach has been extremely successful but it is not entirely satisfactory. For example, the description of types by universal properties is not always possible (e.g., cartesian closure and fixed-point operators are inconsistent with coproducts —see [HP90]); also, the way of expressing termination of a program p is indirect, ¬(p = ⊥), and intuitionistically incorrect (see [Sco79,CS93]).

These considerations lead Gordon Plotkin to reformulate domain theory in terms of partial functions [Plo85]. Technically, this was achieved by eliminating the least element from the domains. Conceptually, the result was the incorporation of partiality, to the notion of approximation, in the foundations of domain theory. As a by-product, the direct treatment of non-termination provided a setting which is computationally more natural; fitting in better with standard formulations of recursion theory. Also, types could be described categorically (via partial cartesian closure [LM84] with coproducts).

1.1.2 Metalanguages for Denotational Semantics

Denotational semantics is always based, generally implicitly, but sometimes explicitly (as in [Sto77] and [Plo85]), on a typed functional metalanguage. Examples of metalanguages can be found in [Sto77,Plo83b,Plo85,Abr87,Zha91,CM93]; they typically contain a rich type theory consisting of basic type constructors together with an operator for defining types by recursion.

Metalanguages may themselves be considered as programming languages with an operational and a denotational (or mathematical) semantics. The denotational approach to the semantics of programming languages is then to translate the programming language in consideration into the metalanguage; thus, deriving operational and denotational semantics for the programming language in consideration.

Another aspect of metalanguages is to provide the term language of a logic (precursors of such logics are LCF [Sco69] and PPλ [GMW79]). Then, from the translation of a programming language into the metalanguage, a logic for reasoning about the programming language is derived. In this activity it is important that the operational and denotational semantics of the metalanguage be in harmony (see Subsection 1.1.3) since this will guarantee the harmony between provability (in the logic) and validity (in the model) of operational properties of the programming language.

The metalanguage that will concern us in this thesis is called FPC [Plo85,Gun92] (see Section 8.1). FPC is a typed functional language with sums, products, exponentials and recursive types.

1.1.3 Relating Operational and Denotational Semantics

The investigation of the relation between operational and denotational semantics started with a question of Dana Scott. In [Sco69], he introduced LCF together with its standard semantics and suggested investigating the relation between the model and syntactic reduction. Gordon Plotkin took up Scott’s suggestion. In [Plo77], he introduced PCF and proved the soundness and adequacy of the standard semantics for a call-by-name evaluator. He further showed that due to the presence of parallel functions the standard semantics fails to be fully abstract. In [Mil77], Milner constructed a syntactic fully abstract model for PCF and left open the problem of its semantical characterisation.

Recently, in [AMR94] and [HO94], intensionally fully abstract semantic models (yielding fully abstract models by extensional collapse) have been constructed.

A computational soundness and adequacy result is a correspondence theorem between operational termination and denotational existence; it generally states that a program terminates according to the operational semantics if and only if its denotational semantics denotes a value.

In [Plo85], the metalanguage FPC was considered as a programming language, with a call-by-value operational semantics and a denotational semantics in pCpo (the category of cpos and partial continuous functions —see page 7). Moreover, the two semantics were related by a computational soundness and adequacy result (inspired by the work of [ML83] —see also [Abr87,Abr90]).

Related results can be found in [MC88]. There, FPC is interpreted in Cppo, the category of cppos —small complete pointed partial orders (posets with least element closed under lubs of ω-chains)— and continuous functions. The existence of sound and adequate evaluators for this interpretation is investigated. Two evaluators are proposed: one which is adequate with respect to observed types (these are the types with no exponentials); and another one which is adequate for the language without sums. No adequate evaluator for the full language is given.

1.1.4 Recursive Types

The solution of recursive type equations in categories of domains was first treated abstractly, in the sense that no commitment to a particular category of domains was required, in [Wan79]. Subsequently this approach was developed in [SP82] and then, further, in [Fre90,Fre92]. The idea is to work with various kinds of order-enriched categories (these are categories equipped with an order structure on each hom and such that composition interacts well with it).

The approach was very much appreciated as a unification of the techniques for solving recursive type equations in categories of domains, but its axiomatic character remained overlooked. For instance, it lead Lehmann and Smyth [LS81] to outline the first abstract setting for specifying both algebraic (in the ADJ jargon) and recursive types, but these ideas were not pursued further.

Recently, a more abstract approach for solving recursive type equations which does not only apply to order-enriched categories was proposed by [Fre91] (see Subsection 1.2.4). This has been a first important step towards an axiomatic theory of recursive types.

1.1.5 Abstract Approaches to Domain Theory

Synthetic Domain Theory

Synthetic domain theory [Ros86,Pho90b,Hyl91,Tay91] was proposed by Dana Scott in 1980, with the motivating slogan: domains are sets (more exactly, “domains are certain kinds of constructive sets”). The aim is to axiomatise effectivity in a categorical framework suitable for domain theory. The idea of the approach is to assume a category of sets (generally a topos; the effective topos being the leading example) and identify the domains within this category by means of properties of a classifier of semidecidable properties.

The application of synthetic domain theory to denotational semantics is the subject of current research (see [Pho93]).

Type Theory and Recursion

In the approach of Plotkin [Plo93a,Plo93b], rather than considering directly possible categorical structure, the idea is to work in a second-order intuitionistic linear type theory whose primitive type constructors are linear and intuitionistic exponentials, and second order quantification. Then, in the presence of a modified form of Reynold’s parametricity the operators of linear logic are derived. Further, initial algebras and final coalgebras for definable endofunctors over the category of linear maps are obtained. One can then consistently add a fixed-point operator for endomorphisms which guarantees algebraic compactness (see Subsection 8.5.2).

In this setting, the connection with operational notions is still unclear.

This Thesis

This thesis is an investigation into axiomatic categorical domain theory as needed for the denotational semantics of deterministic programming languages. Our first motivation for this development is to understand the general principles underlying categories of domains. Of course, as a by-product, theorems will be established for wide classes of categories of domains yielding a second reason for developing the theory. On more speculative grounds (see Chapter 10), it is also hoped that axiomatisations of categories of domains will suggest new (hopefully non-order-theoretic) models or will provide the basis for setting up a representation theory.

Our approach is:

1. axiomatic, because we axiomatise certain categories of domains;

2. categorical, because our concern is the categorical structure needed on a category to be considered a category of domains; and,

3. for denotational semantics, because we particularly consider models of the metalanguage FPC.

The approach is obtained by merging two independent developments (see the chapter dependency on page 20). One of these, the first one in the exposition, deals with categories of partial maps, their order-enrichment, and the categorical description of data types in them. The other one is that of an axiomatic theory of recursive types with emphasis in the solution of recursive type equations in order-enriched categories. The result of their combination provides the mathematical concepts for defining categorical models of FPC in which the notion of undefinedness is treated directly.

Consequently, FPC can be considered as a programming language with a call-by-value operational semantics and a denotational semantics defined on top of a categorical model. It happens that the denotational semantics of FPC in any model is computationally sound for the operational semantics. It is even possible to give an axiomatisation of domain-theoretic models for which it is also computationally adequate; this constitutes the culmination of this thesis.

Our axiomatic approach and the synthetic approach are different but certainly not incompatible (e.g., as we argue in Section 10.4, from our axiomatic viewpoint we might recover the view of domains as sets advocated by synthetic domain theory). Interaction between the two subjects is bound to be fruitful. For example, the axiomatic approach can influence the synthetic approach by requiring that models of synthetic domain theory comply with axiomatic domain theory. From another perspective, it is conceivable that effectiveness could be incorporated in our framework by doing axiomatic domain theory within synthetic domain theory.

1.2 Our Approach

We discuss our approach to categorical axiomatic domain theory in the light of the paradigmatical example which we will axiomatise, pCpo, the category of cpos —small complete partial orders (posets, possibly without least element, closed under lubs of ω-chains)— and partial continuous functions. These are partial functions u : P ⇀ Q such that

1. Monotonicity: For every x, x′ ∈ P,

if x ⊑_{P} x′ then u(x) ⊏ ∼_{Q} u(x′)

where, for two mathematical expressions e and e′, we write e ⊏ ∼_{Q} e′ to mean that if e denotes some y in Q then e′ denotes some y′ in Q and y ⊑_{Q} y′; and

2. Continuity: For every ω-chain x in P,

⨆_{k} u(x_{k}) ≃ u(⨆_{k} x_{k})

where the expression on the left is intended to be undefined if every u(x_{k}) is; or, otherwise, denote ⨆_{k≥k_{0}} u(x_{k}) where k_{0} is any index for which u(x_{k_{0}}) is defined, and for two mathematical expressions e and e′, e ≃ e′ stands for e ⊏ ∼ e′ and e′ ⊏ ∼ e.

1.2.1 Partiality

In [Plo85] a revitalised approach to domain theory was initiated by replacing Cppo with pCpo. Following the main motivation of the reformulation, i.e. to provide a direct treatment of non-termination in the semantics of computation, we postulate categories of partial maps as the primitive universes in which to interpret possibly non-terminating programs.

Our standpoint is to assume a category of values (in our case total maps) and consider the notion of computation we wish to model (in our case non-termination) as extra structure on the category of values. The paradigmatical example, pCpo, is obtained by taking the category of total maps to be Cpo the category of cpos and (total) continuous functions. Partiality (the semantical counterpart of non-termination) arises simply by specifying potential domains of definitions for partial functions which will be continuous where defined. Technically, we introduce the subcategory of admissible monos Σ consisting of all those full monos in Cpo whose induced subobject is Scott-open, and define p(Cpo, Σ) to be the category of cpos and partial functions described by spans consisting of an admissible mono and a total map. It follows that p(Cpo, Σ) ≅ pCpo.

More generally, we have a category K of total maps (values) together with a subcategory D of admissible monos (possible domains of definition for partial maps) which induce the category of partial maps (computations) p(K, D) —see Chapter 3. The basic computational scenario is then given by the faithful inclusion functor J : K → p(K, D) which allows us to regard total maps as partial maps.

Partial continuous functions are representable by total continuous ones, in that for every P ∈ | Cpo | and Q ∈ | pCpo |,

pCpo(P, Q) ≅ Cpo(P, Q_{⊥})  (1.1)

where Q_{⊥} is the cppo obtained from Q by adding a least element. The above bijection is natural in P and Q, and thus establishes that J : Cpo → pCpo has a right adjoint: the lifting functor. Requiring this adjunction in the abstract setting, our computational scenario expands to the following

≅ L J K_{𝕃}  p(K, D)  p(K, D)_{𝕃} K K^{𝕃}

where K_{𝕃}, K^{𝕃} and p(K, D)_{𝕃} are respectively the Kleisli category, the category of Eilenberg-Moore algebras and the (co)Kleisli category of the (co)monad induced by J ⊣ L. When (K, D) = (Cpo, Σ) we have Cpo_{𝕃} ≅ p(Cpo, Σ) ≅ pCpo, Cpo^{𝕃} ≅ Cppo_{⊥} (the category of cppos and strict continuous functions), and p(Cpo, Σ)_{𝕃} ≅ Cppo.

In this thesis we will mainly focus on the adjunction J ⊣ L : p(K, D) → K, though we also exploit the isomorphism p(K, D) ≅ K_{𝕃}. The import of the adjunction is that allows the transfer of properties, constructions, etc. between the category of total maps and the category of partial maps —e.g., it follows that coproducts in K become coproducts in p(K, D).

Remark. Axiomatising p(K, D)_{𝕃} and K^{𝕃} is the spirit of [Plo93a,Plo93b].

1.2.2 The Approximation Order

Once partiality is treated directly, the notion of approximation may be derived. For v, v′ : Q ⇀ P in pCpo we may state that v approximates v′ and write v ⊏ ∼_{Q,P} v′ (usually omitting the subscripts) if every computable test that the execution of v with some input passes is also passed by the execution of v′ with the same input. Formally, we consider partial maps P ⇀ 1 in pCpo as computable tests on P and define v ⊏ ∼ v′ : Q ⇀ P if and only if for every input x ∈ Q and computable test u : P ⇀ 1,

u(vx) ↓ ⇒ u(v′x) ↓ .  (1.2)

Note that it would have been equivalent to quantify over more general inputs Q′ ⇀ Q and computable tests P ⇀ P′. In fact, this will be the approach taken in the abstract setting when defining contextual approximation.

An alternative description of approximation is possible. Observe that when Q = 1 in (1.1) we have

pCpo(P, 1) ≅ Cpo(P, Σ) ≅ Σ(P)

where Σ = 1_{⊥} and Σ(P) is the set of Scott-open subsets of P; and hence, Σ(P) corresponds to the semidecidable properties on P. (In the abstract setting this correspondence will suggest the consideration of subobjects of admissible monos as semidecidable properties). Then, (1.2) can be re-stated as v ⊏ ∼ v′ : Q ⇀ P if and only if for every input x ∈ Q and every semidecidable property U ∈ Σ(P),

v(x) ∈ U ⇒ v′(x) ∈ U.

The restriction of ⊏ ∼ to total maps is denoted by ⊑. When Q = 1, ⊑ is the specialisation order on the T_{0}-space (| P |, Σ(P)), given on a cpo by the Scott topology. Hence, identifying elements with total maps out of the singleton, we have that

x ⊑_{1,P} x′ : 1 → P if and only if x ⊑_{P} x′;

and it also follows that

f ⊑_{Q,P} f′ : Q → P if and only if for every x ∈ Q, f(x) ⊑_{P} f′(x).

The technical appropriateness of the above notions of approximation is that they are domain-theoretic in the sense that (Cpo(P, Q), ⊑_{P,Q}) and (pCpo(P, Q), ⊏ ∼_{P,Q} ) are cpos, and the composition of maps is a continuous operation (i.e., ⊑ and ⊏ ∼ provide Cpo-enrichments for Cpo and pCpo respectively).

We stress that ⊏ ∼ is not primitive but derived, as

v ⊏ ∼ v′ : P ⇀ Q ⟺ dom(v) ⊆ dom(v′) ∧ v ↾ dom(v) ⊑ v′ ↾ dom(v)
⟺ ∀ x ∈ P. v(x) ↓ ⇒ (v′(x) ↓ ∧ v(x) ⊑ v′(x)).  (1.3)

Remark. Note that the equivalence (1.3) renders the notation of this discussion in harmony with that of page 7.

The above observations support the view that partiality is a primitive notion from which the notion of approximation is derived; and that, moreover, the notion of approximation for total maps is more primitive than the notion of approximation for partial maps.

Thus we will study when the notions of approximation for total and partial maps as derived from partiality are domain-theoretic (see Section 4.4). But, for the sake of generality, in our axiomatisation of domain-theoretic models of FPC we will take both partiality and ⊑ as primitive, and ⊏ ∼ as derived. Then the main question, addressed in Chapter 4, is when ⊏ ∼ is domain-theoretic (as happens in pCpo) provided that so is ⊑ (as happens in Cpo).

1.2.3 Type Constructors

The type constructors we will be concerned with are sums, products and exponentials (see Chapter 5).

As it is well known, in categories of partial maps cartesian closure does not provide adequate notions of products and exponentials (e.g., consider Pfn, the category of small sets and partial functions). Moreover, in general, categories of partial maps are not cartesian closed. This is due to the inconsistency of cartesian closure with zero objects (objects which are both initial and terminal): in a cartesian closed category C with zero object 0, for every A ∈ | C |, 0 ≅ 0 × A (as 0 is initial) and 0 × A ≅ A (as 0 is terminal), thus C is equivalent to the terminal category 1. (For more on inconsistencies consult [HP90]). The appropriate categorical structure for interpreting products and exponentials in categories of partial maps is partial cartesian closure [LM84].

A category of partial maps is partial cartesian if its category of total maps is cartesian. In this case the product functor on total maps extends to a partial-product functor on partial maps. We consider the example of pCpo, whose category of total maps, Cpo, is cartesian (in fact, cartesian closed but never mind). The product functor

× : Cpo × Cpo → Cpo, associating a pair of cpos with the cpo whose underlying set is their cartesian product with the pointwise order, extends to a functor ⊗ : pCpo × pCpo → pCpo sending a pair of partial maps (u, u′) : (P, P′) ⇀ (Q, Q′) to the partial map

u ⊗ u′ : P × P′ ⇀ Q × Q′ : (x, x′) ↦ \{ \begin{matrix}(u(x), u′(x′)) & , if u(x) ↓ and u′(x′) ↓. \\ undefined & , otherwise. \end{matrix}

This construction carries over to the abstract setting.

As usual for higher types, exponentiation arises as right adjoint to multiplication. A partial cartesian category of partial maps p(K, D) is partial cartesian closed if, for every A ∈ | K |, ⊗ A : K → p(K, D) has right adjoint A⇀ ⇀ : p(K, D) → K. The category pCpo is partial cartesian closed and P ⇀ ⇀Q is the cppo of partial continuous functions from P to Q with the approximation order ⊏ ∼ .

Observe that when the category of total maps has terminal object 1, the lifting functor arises from partial cartesian closure because ⊗ 1 ≅ J : K → p(K, D) and hence 1⇀ ⇀ ≅ L : p(K, D) → K.

Sums will be interpreted as coproducts in p(K, D), which in the presence of partial cartesian closure will be given as in K. In pCpo coproducts are given by disjoint unions and coproduct injections are admissible monos. These properties will be shown to hold in the abstract setting as well.

1.2.4 Recursive Types

The traditional way to solve recursive type equations was first established by Scott [Sco72]. It was subsequently developed in the context of Cpo-categories by Wand [Wan79], and then by Smyth and Plotkin [SP82]. The method is based on Lambek’s Lemma [Lam68] (Lemma 6.1.2), the Basic Lemma [SP82] (Lemma 6.6.4) and the Limit/Colimit Coincidence Theorem [SP82] (Theorem 5.4.5). The idea is to transform Cpo-bifunctors F : C^{op} × C → C into Cpo-endofunctors F_{E} : C_{E} → C_{E} (where C_{E} is the category of embeddings in C) such that a fixed-point of F_{E} is a fixed-point of F. To find a fixedpoint for F_{E}, C_{E} is required to have initial object, 0, and colimits of ω-chains so that by the Limit/Colimit Coincidence Theorem the colimit of the ω-chain ⟨F_{E}^{n}(0), F_{E}^{n}(0 → F_{E}0)⟩ is preserved by F_{E} and, by the Basic Lemma, is an initial algebra which, by Lambek’s Lemma, is an isomorphism.

The ideas behind this method are still the standard way to find fixed-points for bifunctors in categories of domains. However, the approach has some deficiencies: it only applies to Cpo-categories and the fixed-points are only canonical in a subcategory of the category of interest.

Recently, Freyd [Fre90,Fre91] has proposed another approach for solving recursive type equations which we develop further (in Chapter 6). He introduced categories appropriate for interpreting inductive types. These he called algebraically complete [Fre91]; they are those categories such that every endofunctor on them has an initial algebra. The real novelty was his refinement of this notion to algebraic compactness [Fre91] by further imposing the axiom that initial algebras are free in the sense that their inverses are final coalgebras. In these categories, not only inductive types but also recursive types have canonical and minimal interpretations.

The category pCpo is Cpo-algebraically compact in that every Cpo-endofunctor on it has a free algebra. This follows because pCpo has the following structure:

1. ep-zero (a zero object such that every morphism with it as source is an embedding and hence every morphism with it as target is a projection); and

2. colimits of ω-chains of embeddings.

Thus, for every Cpo-endofunctor F on pCpo, by the Basic Lemma, the Limit/Colimit Coincidence Theorem and their dual statements, it follows that the colimit of the ω-chain of embeddings ⟨F^{n}0, F^{n}(0 ⇀ F 0)⟩ is both an initial algebra and a final coalgebra.

As the above argument applies to any Cpo-category with the properties (1) and (2), it is natural to consider the (2-)category of all such small categories. This (2-)category, called Kind, besides consisting of Cpo-algebraically compact categories will be shown to have very strong closure properties (see Chapter 7).

Finally observe that to solve recursive type equations with this technique in domaintheoretic categories of partial maps, type constructors are required to be Cpo-functors. Such considerations are addressed in Chapter 5.

1.2.5 Fixed-point Operators

It is frequently claimed that categories of domains should have fixed-point operators for endomorphisms. But this assertion is just a myth and such an extreme position is not necessary for interpreting recursive programs. To illustrate this point we discuss the interpretation of recursive programs in pCpo.

Consider a (call-by-value) language where recursive programs are restricted to higher types with the following syntax:

\frac{Γ, f : τ_{1}⇀ ⇀τ_{2}, x : τ_{1} ⊢ e : τ_{2}}{Γ ⊢ rec f in λx. e : τ_{1}⇀ ⇀τ_{2}} ,

and operational rule:

                  rec f in λx. e ⇝ λx. e[f ↦ rec f in λx. e].

Then, an adequate interpretation of a recursive program is the total map

[[ ⊢ rec f in λx. e : τ_{1}⇀ ⇀τ_{2}]] : 1 → [[τ_{1}]]⇀ ⇀[[τ_{2}]]

defined as

pfix ∘ pλ(pλ([[f : τ_{1}⇀ ⇀τ_{2}, x : τ_{1} ⊢ e : τ_{2}]]))

where, pλ : pCpo(Q ⊗ P_{1}, P_{2}) ≅ Cpo(Q, P_{1}⇀ ⇀P_{2}) is the natural isomorphism given by the adjunction ⊗ P_{1} ⊣ P_{1}⇀ ⇀ ; and

pfix : ((P_{1}⇀ ⇀P_{2})⇀ ⇀(P_{1}⇀ ⇀P_{2})) → (P_{1}⇀ ⇀P_{2}) : u ↦ \{ \begin{matrix}⨆_{n ∈ |ω|} u^{n}(∅) & , if u is total. \\ ∅ & , otherwise. \end{matrix}

is the least total extension of

fix : ((P_{1}⇀ ⇀P_{2}) ⇒ (P_{1}⇀ ⇀P_{2})) → (P_{1}⇀ ⇀P_{2}) : f ↦ ⨆_{n ∈ |ω|} f^{n}(∅),

the least fixed-point operator in Cppo.

However, pfix is not a fixed-point operator as, in general, u(pfix u) ≄ pfix u. It only happens that

u(pfix u) ↓ ⇒ u(pfix u) = pfix u,

but pfix is still appropriate for our purposes because u (pfix u) x ≃ (pfix u) x for every x.

In the sequel recursion at the level of programs is not considered primitive, instead our viewpoint is that it arises from recursion at the level of types. In fact, the version of FPC adopted in this thesis is not equipped with a fixed-point operator for programs because in the presence of exponentials and recursive types the paradoxical combinators are definable. In particular the call-by-value fixed-point operator (see page 175) corresponds to pfix.

1.2.6 Models of the Metalanguage FPC

We have exhibited pCpo as a

(parameterised) Cpo-algebraically compact partial cartesian closed category with binary coproducts

and, from this perspective, pCpo is the prototypical model of type theories with sums, products, exponentials and recursive types (as the metalanguage FPC).

In the abstract setting, models such as pCpo will be axiomatised, a denotational semantics defined on top of a categorical model will be given, and soundness and adequacy results will be shown to follow from the categorical structure provided by the models (see Chapters 8 and 9).

1.3 Layout of the Thesis and Summary of Results

Chapter 2 contains the categorical notions outside the scope of [Mac71] used throughout the thesis. The emphasis is on 2-categories (Section 2.1) and order-enriched categories (Section 2.2), though a basic introduction to the general theory of enriched categories [Kel82] (Section 2.3) is also included.

Order-enriched categories play a central role in our approach. Informally an orderenriched category is a category whose homs come equipped with an order (partial order in the case of Poset-enrichment, cpo in the case of Cpo-enrichment) and such that composition is a morphism of ordered sets (monotone in the case of Poset-enrichment, continuous in the case of Cpo-enrichment). Order-enriched functors between order-enriched categories are functors which are locally morphisms of ordered sets (locally monotone in the case of Poset-enrichment, locally continuous in the case of Cpo-enrichment). These mathematical structures and their theory are fundamental for abstractly discussing the notion of approximation, permitting a study of domain theory without committing to particular categories of domains.

2-categories [KS74] are superficially used when discussing categories of kinds (Section 7.3).

Chapter 3 introduces categories of partial maps [RR88] (Definition 3.1.2). These are categorical structures in which maps have explicit domains of definition so that it is possible to account for partiality. Total maps are then partial maps whose domain of definition coincides with its source. Rather than considering an abstract notion of category of partial maps, for us categories of partial maps will arise from domain structures [Ros86, Mog86] (Definition 3.1.1); these consist of a category, the total maps, together with a suitably closed subcategory of admissible monos, the possible domains of definition.

The representability of partial maps as total maps, which amounts to asking for a right adjoint (the lifting functor) to the inclusion functor from the category of total maps to the category of partial maps, is studied. It is shown that partial maps can be represented as total ones if and only if they are classifiable, in the sense that every partial map determines a unique characteristic total map from which the partial map can be recovered by pulling back the classifier (see Definition 3.2.1). This characterisation (Theorem 3.2.6) will be used later, in Sections 4.5 and 5.3, to transfer both order-enrichment and certain colimits from the category of total maps to the category of partial maps.

The direct treatment of non-termination induces notions of approximation between partial maps (Section 3.3). Two such notions are introduced, contextual approximation (Definition 3.3.1) and specialisation (Definition 3.3.3), and shown to coincide (Proposition 3.3.5). The contextual approach is based on testing for the totality of partial maps in different contexts; more precisely, a partial map is said to contextually approximate another one if the latter passes the test for all contexts in which the former does. Specialisation is based on observing partial maps. Intuitively, a partial map is said to specialise another one if for every observable property on the outputs, whenever the execution of the former with some input satisfies the property then so does the execution of the latter with the same input.

Since the approximation between partial maps can be characterised in terms of the approximation of total maps and test for totality (Proposition 3.3.2), in Chapter 4 we consider the approximation of total maps as the primitive notion and treat the approximation of partial maps as derived (see Definition 4.1.1). Thus, we address the question of when the approximation of partial maps is domain-theoretic (in the technical sense that the category of partial maps Cpo-enriches with respect to it) provided that so is the approximation of total maps. This study is undertaken in two steps. First, we provide a characterisation of Poset-categories of partial maps induced by domain structures with a Poset-category of total maps (Theorem 4.2.4). Second, to deal with Cpo-enrichment, we introduce uniform domain structures (Definition 4.3.5) and characterise those Cpo-categories of partial maps induced by uniform domain structures with a Cpo-category of total maps (Theorem 4.3.9). Intuitively, a domain structure is uniform if lubs of ω-chains of admissible subobjects behave like unions. (The import of this characterisation is discussed in Section 10.4).

In most examples, the categories of total and partial maps are Poset-enriched, the inclusion functor from the category of total maps to the category of partial maps is Poset-enriched and it has a Poset-enriched right adjoint (i.e., the bijective correspondence determined by the adjunction is an isomorphism of posets). This situation is studied in the abstract setting where it is observed that if in addition the category of total maps is Cpo-enriched then the category of partial maps Cpo-enriches (Corollary 4.5.3).

The above results for transferring order-enrichment from total to partial maps are applied yielding conditions under which the category of partial maps Cpo-enriches with respect to specialisation (Proposition 4.4.2 and Theorem 4.5.8).

Chapter 5 is devoted to the study of the categorical structure allowing the interpretation of types in categories of partial maps.

First, partial cartesian closure [LM84] (Definition 5.2.3) in the order-enriched setting is discussed. It is shown that the product Poset-functor on total maps extends to a partial-product Poset-functor on partial maps (Proposition 5.1.2) and conditions under which this extension holds for Cpo-enrichment are provided (Proposition 5.1.3). It is also shown that, when the partial-product functor is Cpo-enriched, the Poset-partial-exponential functor Cpo-enriches (Proposition 5.2.1).

Second, we focus on colimits in categories of partial maps. We present a characterisation of colimits of diagrams of total maps due to Gordon Plotkin (Theorem 5.3.9) from which it follows that, under mild assumptions, coproducts in categories of partial maps are disjoint and coproduct injections are admissible monos. (This result is relevant to provide a logical notion of representation (Definition 8.6.1), a formalisation of the notion of implementation, for sum types —see Lemma 8.6.3 (3)). Moreover, assuming the category of total maps has a terminal object and the existence of the lifting functor we provide a method for computing colimits of diagrams of total maps in categories of partial maps provided that the lifted diagram has a colimit in the category of total maps (Theorem 5.3.14).

Finally, we present conditions under which the existence of the colimits needed to solve recursive type equations in Cpo-categories of total maps guarantees the existence of such colimits in Cpo-categories of partial maps (Theorem 5.4.11).

In Chapter 6 we develop an axiomatic theory of recursive types. Following Peter Freyd, we start by introducing categories which are appropriate for interpreting inductive types. These he called algebraically complete [Fre91] and are those categories such that every endofunctor on them has an initial algebra. Algebraic completeness (Definition 6.1.4) and a parameterised version of the concept (Definition 6.1.7) are considered in the enriched setting. (Parameterisation is needed for interpreting types defined by mutual recursion). The basic properties of (parameterised) algebraically complete categories are established: in particular, from the observation that Bekic̆’s Lemma (Lemma 6.1.13) holds for them we conclude the Product Theorem for Parameterised Algebraically Complete Categories (viz., that parameterised algebraically complete categories are closed under finite products —Theorem 6.1.14) and the dinaturality of the functor delivering initial algebras (Proposition 6.1.15). Again following Peter Freyd, with the intention of interpreting general recursive types, algebraically complete categories are refined to algebraically compact categories [Fre91] by further imposing the axiom that initial algebras are free in the sense that their inverses are final coalgebras. After motivating the compactness axiom, we introduce the concept together with its parameterised version in the enriched setting (Definition 6.2.2). Bekic̆’s Lemma together with its corollaries are observed to hold. More importantly, the Fundamental Property of Algebraically Compact Categories (viz., that every endofunctor on an algebraically compact category has a canonical and minimal fixed-point —Theorem 6.4.1) is established and extended to parameterised algebraic compactness (Theorem 6.4.4). Further evidence for the suitability of the compactness axiom is provided by showing that in algebraically compact categories recursive types reduce to inductive types (Corollary 6.5.2 and Proposition 6.5.3). Finally, supercompleteness and supercompactness axioms, guaranteeing closure under exponentiation are discussed briefly (Section 6.6).

Cpo-algebraic completeness and compactness is the topic of Chapter 7. The Cpo-enriched setting is particularly well behaved as Cpo-algebraic completeness and compactness coincide with their parameterised versions (Theorem 7.1.12). Exploiting the Limit/Colimit Coincidence in Cpo-categories [SP82] (Theorem 5.4.5), we identify a 2-category, Kind (Definition 7.3.11), of parameterised Cpo-algebraically compact categories with very strong closure properties: we show that it is 2-cartesian-closed, closed under taking opposite categories, closed under the formation of categories of algebras and coalgebras with lax-homomorphisms (Definition 7.1.8), and has a unique uniform (up to isomorphism) fixed-point operator —viz., the functor delivering free algebras (Theorem 7.3.12). Thus, Kind is appropriate for interpreting type systems with kinds built by recursion from products, exponentials, algebras and coalgebras; but neither such a system nor its interpretation is discussed here.

The theory is applied in Chapters 8 and 9. The metalanguage FPC is considered as a programming language with a call-by-value operational semantics (Section 8.2). Categorical models of FPC are defined to be parameterised enriched algebraically compact partial cartesian closed categories with binary coproducts (Definition 8.3.1) and a denotational semantics defined on top of a categorical model is given (Section 8.4). Two axiomatic classes of models, for which pCpo is the paradigmatical example, are presented: domain-theoretic models (Subsection 8.5.1) and K_{∗}-models (Subsection 8.5.2).

Domain-theoretic models are Cpo-models arising from domain structures with a Cpo-category of partial maps in which Cpo-algebraic compactness is obtained from the Limit/Colimit Coincidence (see Corollary 7.2.4). K_{∗}-models are enriched over K_{∗} (intuitively, the full subcategory of the category of total maps consisting of all those objects with a least element (see Definitions 8.5.4 and 8.5.6)), and algebraic compactness is obtained by postulating special fixed-points for endofunctors on the category of partial maps together with a parameterised uniform fixed-point operator in K_{∗}.

A first study of the denotational semantics of FPC is carried out in Section 8.6 where it is shown that Poset-models arising from domain structures with a Poset-category of total maps are parametric with respect to representations [Rey74] (see Definition 8.6.1 and Theorem 8.6.6). Secondly, operational and denotational semantics are related. It is shown that the interpretation of FPC expressions is computationally sound (Theorem 9.1.4). We culminate by proving that non-trivial domain-theoretic models satisfying an absoluteness axiom (which holds in pCpo) are computationally adequate (Theorem 9.2.19). It follows that the domain-theoretic model specified by (Cpo, Σ) —as well as many similar classical models specified by a category of predomains and the Scott-open subsets— is computationally adequate. Other examples are functor categories over Cpo (see Corollary 9.2.20).

In Chapter 10 we discuss further directions of research.

The chapter dependency is as follows:

4–5  2.3 6–7 3  2.1–2.2 8–10 3. Partiality  8. FPC 10. Summary and Further Research 2.1. 2-Category Theory 2.2. Order-enriched Category Theory 7. 4. Order-Enriched Categories  Enriched Category Theory Basic Concepts of 2.3. of Partial Maps  9. Computational Soundness and Adequacy 6. Recursive Types Cpo-Categories Recursive Types in 5. Data Types

2 Categorical Preliminaries

The category-theoretic notions outside the scope of [Mac71] but used throughout the thesis are reviewed. Section 2.1 is a summary of [KS74] and introduces 2-categories and cartesian closure for them. Section 2.2 introduces order-enriched categories and the elementary notions needed to define order-enriched adjunctions and order-enriched colimits. Both Sections 2.1 and 2.2 are examples of the theory of enriched categories (introduced in Section 2.3 which condenses the first three chapters of [Kel82]).

Familiarity with Sections 2.1 and 2.2 is essential for reading Chapters 4 and 5 whilst familiarity with Section 2.3 is required in Chapters 6–9.

2.1 2-Category Theory

A 2-category C has objects or 0-cells A, B, …; arrows or morphisms or 1-cells f : A → B, …; and 2-cells

A  B ff′ α  .

The objects and the arrows form a category C_{0}, called the underlying category of C, with identities Id_{A} : A → A. When unambiguous, we sometimes write C for C_{0}.

For fixed A and B, the arrows A → B and the 2-cells between them form a category C(A, B) under the operation known as vertical composition

B f f′ f′′ α α′ A  .

The vertical composite f ⇒ f′′ above is denoted by α′ ∘ α; its identities are denoted by

A  B ff^{id_{f}}  .

There is also a horizontal composition of 2-cells, whereby from 2-cells

A  B ff′  gg′ B  C α  β

we get a 2-cell

gg′  C = A  ff′  B  A  C g′ ∘ f′ g ∘ f α  β  β ⋆ α  .

Under this operation 2-cells form a category, with identities

A  A^{Id_{A}} Id_{A}^{id_{Id_{A}}}  .

We require finally that, in the situation

A  g g′ g′′ β′ β C B f f′ f′′ α α′

the composites (β′ ⋆ α′) ∘ (β ⋆ α) and (β′ ∘ β) ⋆ (α′ ∘ α) coincide; and that in the situation

g  C A  f  B f  g^{id_{f}}  ^{id_{g}}

we have id_{g} ⋆ id_{f} = id_{g∘f}.

As a convention, in the situation

A  B h h′ A′  B′ f  g α

we write g ∘ α ∘ f or simply gαf for id_{g} ⋆ α ⋆ id_{f} : g ∘ h ∘ f ⇒ g ∘ h′ ∘ f : A′ → B′.

For examples of 2-categories, the paradigmatic ones are Cat and CAT. The objects are small categories and locally small categories respectively, the arrows are functors, and the 2-cells are natural transformations. Cat is locally small (has small hom-categories) whilst CAT is not.

A 2-functor F : A → B sends objects of A to objects of B, arrows of A to arrows of B, and 2-cells of A to 2-cells of B, preserving domains and codomains and all types of identity and composition.

A trivial example is the “constantly 1” 2-functor K1 from any 2-category to CAT.

A 2-natural transformation η : F \underrightarrow{.} G : A → B assigns to each object A of A an arrow η_{A} : F A → GA in B, which is not only natural in the ordinary sense that, for f : A → B, we have η_{B} ∘ F f = Gf ∘ η_{A}, but also 2-natural in the sense that, for each 2-cell α : f ⇒ f′ : A → B in A, we have

F B F f′ F f F A  η_{B}  GB = F A η_{A}  GA F α  Gf Gf′ GB Gα  .

The dual, C^{op}, of a 2-category C has C^{op}(A, B) = C(B, A), so that 1-cells are reversed but not 2-cells.

For 2-categories A and B we have a product 2-category A × B, with set of objects | A × B | = | A | × | B |, and with (A × B)((A, B), (A′, B′)) = A(A, A′) × B(B, B′). Identities and composition are given pointwise.

Every 2-category C induces a hom 2-functor C( , ) : C^{op} × C → CAT, sending an object (A, B) to the category C(A, B), an arrow (f, g) : (A, B) → (A′, B′) to the functor g ∘ ∘ f : C(A, B) → C(A′, B′), and a 2-cell (α, β) : (f, g) ⇒ (f′, g′) : (A, B) → (A′, B′) to the natural transformation α ⋆ id ⋆ β : g ∘ ∘ f ⇒ g′ ∘ ∘ f′ : C(A, B) → C(A′, B′).

A 2-category C, is 2-cartesian-closed if it has terminal object, binary 2-products and 2-exponentials in the following sense:

• An object 1 of C is terminal if there is a 2-natural isomorphism C( , 1) ≅ K1.

• The 2-product of two objects A and B of C is specified by an object A × B of C together with a 2-natural isomorphism C( , A × B) ≅ C( , A) × C( , B).

• The 2-exponential [A, B] of two objects A and B of C is specified by an object of C together with a 2-natural isomorphism C( × A, B) ≅ C( , [A, B]) which is also natural in B.

2.2 Order-enriched Category Theory

Throughout this section let V denote either Poset (the category of small partially ordered sets and monotone functions) or Cpo.

A Poset-category (Cpo-category) is a locally small category whose hom-sets come equipped with a partial order (complete partial order) respect to which composition of morphisms is a monotone (continuous) operation.

The immediate examples of Poset-categories are Poset and Cpo where each hom-set is ordered pointwise; even more, Cpo is a Cpo-category. More examples are obtained from the observation that every category K freely induces a V-category K_{V} by discretely ordering each hom-set.

For V-categories K and L, a V-functor F : K → L is a functorial mapping such that for every A, B ∈ | K | the assignment F_{A,B} : K(A, B) → L(F A, F B) is a morphism in V.

Convention. To ease the notation we generally contravene some conventions of the enriched-category theorist. Particularly, we write X both for a V-category as well as for its underlying category X_{0} where the order structure has been forgotten. This is in the vein of the usual convention of using the same notation for a poset or cpo as well as for its underlying set. A similar convention is adopted for V-functors.

V-Cat is the 2-category of small V-categories, V-functors, and natural transformations. It is 2-cartesian-closed, and the structure can be described as follows:

• The terminal V-category 1 has a singleton set of objects while the only hom is the terminal object in V.

• The product, K × L, of the V-categories K and L, is the V-category with set of objects | K × L | = | K | × | L |, and homs defined as

(K × L)((A, X), (B, Y)) = K(A, B) × L(X, Y)

where the operation on the right hand side is the product in V.

• For V-categories K and L the functor category [K, L] is the V-category with the V-functors K → L as the set of objects, and where the hom [K, L](F, G) is the poset with underlying set Nat(F, G) of natural transformations F \underrightarrow{.} G ordered pointwise.

For a V-category K its dual, K^{op}, is the V-category with the same objects as K, but with K^{op}(A, B) = K(B, A). (Notice that the order in each hom remains unchanged.)

A V-adjunction χ : F ⊣ U : K → L is given by V-categories K and L, V-functors F : L → K and U : K → L, and a natural isomorphism

χ : K(F , ) ≅ L( , U ) : L^{op} × K → V.

For a category G and a V-category K, a diagram Γ in K of type G is a V-functor G_{V} → K. We have a “constant diagram” V-functor K : K → [G_{V}, K] defined as the composite

K ≅ [1, K] ⟶^{[U,Id]} [G_{V}, K]

where U is the unique V-functor G_{V} → 1.

A V-colimit of a diagram Γ is given by an object C of K and a natural transformation γ : Γ \underrightarrow{.} KC : G_{V} → K such that for every A ∈ | K |,

[G_{V}, K](γ, id) ∘ K_{C,A} : K(C, A) → [G_{V}, K](Γ, KA)

is an isomorphism in V.

Remark. The treatment of V-colimits offered above is far from been complete and just concerns a restricted class of conical colimits [Kel82].

Proposition 2.2.1 Let G be a category, K be a Cpo-category, and Γ be a diagram in K of type G. Then, the following are equivalent:

1. (C, γ) is a Cpo-colimit of Γ.

2. (C, γ) is a Poset-colimit of Γ.

3. (C, γ) is a colimit of Γ and for every f, g : C → A, if f ∘ γ ≤ g ∘ γ then f ≤ g. □

For V-functors F, G : K → L, a lax natural transformation η : F \underrightarrow{.}_{≤}G : K → L is an | K |-indexed family of components η_{A} : F A → GA in L such that for every f : A → B in K,

F B F A F f  GA GBGf ≤ η_{A} η_{B}  .

2.3 Basic Concepts of Enriched Category Theory

Subsection 2.3.1 begins by introducing symmetric monoidal closed categories V, examining their elementary properties, and defining the 2-category V-CAT of V-categories, V-functors, and V-natural transformations, together with the forgetful 2-functor ( )_{0} : V-CAT → CAT. Next the basic structure of V-CAT —the dual of a V-category, V itself as a V-category, representable V-functors, and the Yoneda lemma— is developed. With this done, adjunctions in V-CAT are discussed.

Subsection 2.3.2 develops more of the basic structure of V-CAT —tensor products of V-categories and extraordinary V-natural transformations— in order to present the closed structure of V-CAT, given by V-functor categories.

Subsection 2.3.3 considers limits for V-categories in the case of cartesian closed V. (The treatment offered here is far from been complete.)

2.3.1 The Elementary Notions

A monoidal category V = (V_{0}, ⊗, I, l, r, a) consists of a category V_{0}, a functor ⊗ : V_{0} × V_{0} → V_{0}, an object I ∈ | V_{0} |, and natural isomorphisms l_{X} : I ⊗ X → X, r_{X} : X ⊗ I → X, a_{X,Y,Z} : (X ⊗ Y) ⊗ Z → X ⊗ (Y ⊗ Z) subject to two coherence axioms:

((W ⊗ X) ⊗ Y) ⊗ Z  (W ⊗ X) ⊗ (Y ⊗ Z) (W ⊗ (X ⊗ Y)) ⊗ Z  W ⊗ (X ⊗ (Y ⊗ Z)) W ⊗ ((X ⊗ Y) ⊗ Z) a a ⊗ id  a  id ⊗ a a

and

(X ⊗ I) ⊗ Y  X ⊗ (I ⊗ Y) X ⊗ Y r ⊗ id  a  id ⊗ l  .

A special kind of example is given by taking for V_{0} any cartesian category (i.e., a category with finite products), for ⊗ and I the product × and the terminal object 1, and for a, l, r the canonical isomorphisms. Important cases of this are the categories Set, Cat, Gpd, Poset, Cpo, Top of small sets, categories, groupoids, posets, cpos and topological spaces; here “small” refers to a chosen universe, which we suppose given once for all. Other cartesian examples are obtained by taking for V_{0} a poset with finite meets, such as the ordinal 2 = (0 → 1). All these examples are symmetric in the sense of page 32, and all the named ones except Top are closed in the sense of page 33.

A collection of non-cartesian (symmetric, closed) examples is given by the categories Ab, R-Mod, of small abelian groups, R-modules for a commutative ring R, each with its usual tensor product as ⊗; the ordered set \overline{ℝ}_{+} of non-negative reals with +∞, with the reverse of the usual order, and with + as ⊗; and the category Cppo_{⊥} with the smash product for ⊗.

A non-symmetric example is the category of endofunctors of a small category, with composition as ⊗; here a, l, r are identities, so the monoidal category is called strict.

In general we call ⊗ the tensor product and I the unit object.

We suppose henceforth given a monoidal V such that V_{0} is locally small (has small hom-sets). We then have the representable functor V_{0}(I, ) : V_{0} → Set, denoted by V. In such cases as Set, Poset, Cpo, Top, it is the ordinary “underlying-set” functor; in these cases V is faithful, while in Set it is even conservative (i.e., isomorphism-reflecting). Yet V is not faithful in general; in the cases Cat and Gpd, V X is the set of objects of X.

In spite of the failure of V to be faithful in general, it is convenient to call an element f of V X, i.e., a map f : I → X in V_{0}, an element f of X.

A V-category A consists of a set | A | of objects, a hom-object A(A, B) ∈ | V_{0} | for each pair of objects of A, a composition M_{A,B,C} : A(B, C)⊗A(A, B) → A(A, C) for each triple of objects, and an identity element j_{A} : I → A(A, A) for each object; subject to the associativity and unit axioms expressed by

(A(C, D) ⊗ A(B, C)) ⊗ A(A, B)  A(C, D) ⊗ (A(B, C) ⊗ A(A, B)) A(C, D) ⊗ A(A, C) A(B, D) ⊗ A(A, B)  id ⊗ M M  M a M ⊗ id  A(A, D)

and

A(A, B) A(B, B) ⊗ A(A, B)  A(A, B) ⊗ A(A, A) I ⊗ A(A, B)  A(A, B) ⊗ I id ⊗ j l  r M j ⊗ id  M  .

Taking V = Set, Cat, 2, \overline{ℝ}_{+} we re-find the classical notions of locally small ordinary category, 2-category, preorder and generalised metric spaces. For a general reference on 2-categories, see [KS74]; and for the generalised metric spaces, see [Law73]. We call the V-category A small if | A | is small.

For V-categories A and B, a V-functor F : A → B consists of a function F : | A | → | B | together with, for each pair A, B ∈ | A | a map F_{A,B} : A(A, B) → B(F A, F B), subject to the preservation of composition and identities:

A(B, C) ⊗ A(A, B) B(F B, F C) ⊗ B(F A, F B)  B(F A, F C) A(A, C) M  F F ⊗ F  M

and

A(A, A) B(F A, F A) I jj  F  .

In the four examples above we re-find the classical notions of functor, 2-functor, increasing function, and contracting map.

For V-functors F, G : A → B, a V-natural transformation α : F \underrightarrow{.} G : A → B is an | A |-indexed family of components α_{A} : I → B(F A, GA) satisfying the V-naturality condition expressed by

A(A, B)  B(GA, GB) ⊗ B(F A, GA) B(F B, GB) ⊗ B(F A, F B) I ⊗ A(A, B) A(A, B) ⊗ I  B(F A, GB) M M r^{−1} l^{−1}  α_{B} ⊗ F G ⊗ α_{A}  .

The “vertical composite” β ∘ α of α : F \underrightarrow{.} G : A → B and β : G \underrightarrow{.} H : A → B has the component (β ∘ α)_{A} given by

I ≅ I ⊗ I ⟶^{β_{A}⊗α_{A}} B(GA, HA) ⊗ B(F A, GA) ⟶^{M} B(F A, HA).

The composite of α above with U : B → C has for its component (Uα)_{A} the composite

I ⟶^{α_{A}} B(F A, GA) ⟶^{U} C(UF A, UGA)

while the composite of α with T : C → A has for its component (αT)_{C} simply α_{T C}.

It is easy to verify that V-categories, V-functors, and V-natural transformations constitute a 2-category V-CAT; which may not be locally small unless some restriction is placed on the size, as in the 2-category V-Cat of small V-categories. When V = Set, V-CAT reduces to the 2-category CAT of locally small ordinary categories.

Convention. Since a V-category A has no “morphisms”, we harmlessly call a map A → B in A_{0}, which is an element of A(A, B), “a map A → B in A”.

To speak of a V-functor F : A → B carries the implication that A and B are V-categories. Similarly, to speak of a V-natural transformation α : F \underrightarrow{.} G presupposes that F and G are V-functors.

Denoting by I the unit V-category with one object 0 and with I(0, 0) = I, we write ( )_{0} : V-CAT → CAT for the representable 2-functor V-CAT(I, ); which we now describe in more elementary terms.

A V-functor A : I → A may be identified with an object A of the V-category A; and a V-natural f : A \underrightarrow{.} B : I → A consists of a single component f : I → A(A, B). Thus the ordinary category A_{0}, which is called the underlying category of A, has the same objects as A, while a map f : A → B in A_{0} is just an element f : I → A(A, B) of A(A, B). Otherwise put, A_{0}(A, B) = V A(A, B). The composite g ∘ f in A_{0} is given by the composite

I ≅ I ⊗ I ⟶^{g⊗f} A(B, C) ⊗ A(A, B) ⟶^{M} A(A, C)

in V_{0}, whilst the identity in A_{0}(A, A) is j_{A}.

How much information about A is retained by A_{0} depends upon how faithful V is. When V = Cat, V is not faithful; A is a 2-category, and A_{0} is the category obtained by discarding the 2-cells. When V = Cpo, V is faithful, and A_{0} has lost only the order on the hom-objects of A.

The ordinary functor F_{0} : A_{0} → B_{0} induced by (or underlying) the V-functor F : A → B sends A : I → A to F A and sends f : A \underrightarrow{.} B : I → A to F f.

The ordinary natural transformation α_{0} : F_{0} \underrightarrow{.} G_{0} : A_{0} → B_{0} induced by the V-natural α : F \underrightarrow{.} G : A → B has for its A-component α_{0}_{A} ∈ B_{0}(F A, GA) the A-component α_{A} : I → B(F A, GA) of α; so that it is not necessary to distinguish α from α_{0}. The V-naturality condition for α : F \underrightarrow{.} G becomes the usual naturality condition for α : F \underrightarrow{.} G when V is applied to it. Hence the naturality of α : F_{0} \underrightarrow{.} G_{0}, while weaker in general than the V-naturality of α : F \underrightarrow{.} G, is equivalent to it when V is faithful.

A symmetry for a monoidal category V is a natural isomorphism c_{X,Y} : X⊗Y → Y ⊗X satisfying the coherence axioms

Y ⊗ X X ⊗ Y X ⊗ Y  c  c id

and

(X ⊗ Y) ⊗ Z  X ⊗ (Y ⊗ Z)  (Y ⊗ Z) ⊗ X (Y ⊗ X) ⊗ Z  Y ⊗ (X ⊗ Z)  Y ⊗ (Z ⊗ X) a  a c c ⊗ id  a  id ⊗ c  .

A monoidal category V together with a symmetry is called a symmetric monoidal category. We now suppose V to be such.

To each V-category A we can associate a dual, or opposite, V-category A^{op}, with the same objects as A, but with A^{op}(A, B) = A(B, A). The composition

M : A^{op}(B, C) ⊗ A^{op}(A, B) → A^{op}(A, C)

is just the composite

A(C, B) ⊗ A(B, A) ⟶^{c} A(B, A) ⊗ A(C, B) ⟶^{M} A(C, A)

whilst the unit element I → A^{op}(A, A) is that of A. A functor A^{op} → B may be called a contravariant functor from A to B. From α : F \underrightarrow{.} G : A → B we get, with evident definitions, α^{op} : F^{op} \underrightarrow{.} G^{op} : A^{op} → B^{op}; note that ( )^{op} reverses 2-cells but not 1-cells. Of course ( )^{op} is an involution: ( ^{op})^{op} = Id.

The monoidal category V (symmetric or not) is closed (cartesian closed, when V is cartesian) if each functor ⊗ Y : V_{0} → V_{0} has a right adjoint [Y, ]; so that we have an adjunction

λ : V_{0}(X ⊗ Y, Z) ≅ V_{0}(X, [Y, Z])  (2.1)

with counit (called evaluation)

ε : [Y, Z] ⊗ Y → Z.

Putting X = I in (2.1), using the isomorphism l : I ⊗ Y ≅ Y, and recalling that V = V_{0}(I, ) : V_{0} → Set, we get a natural isomorphism

V_{0}(Y, Z) ≅ V [Y, Z].  (2.2)

Since [Y, Z] is thus exhibited as a lifting through V of the hom-set V_{0}(Y, Z), it is called the internal hom of Y and Z.

From now on we suppose that our given V is symmetric monoidal closed, with V_{0} locally small.

The internal-hom of V “makes V itself into a V-category”. There is a V-category, which we call V, whose objects are those of V_{0}, and whose hom-object V(X, Y) is [X, Y]. Its composition M : [Y, Z] ⊗ [X, Y] → [X, Z] corresponds under the adjunction (2.1) to the composite

([Y, Z] ⊗ [X, Y]) ⊗ X ⟶^{a} [Y, Z] ⊗ ([X, Y] ⊗ X) ⟶^{id⊗ε} [Y, Z] ⊗ Y ⟶^{ε} Z

and its identity element j_{X} : I → [X, X] corresponds under (2.1) to l : I ⊗ X → X. It is easily verified that (2.2) gives an isomorphism between V_{0} and the underlying ordinary category of the V-category V; we henceforth identify these two ordinary categories by this isomorphism thus rendering the notation V_{0} consistent with the notation A_{0}.

Next we observe that, for each V-category A and each object A ∈ | A |, we have the representable V-functor A(A, ) : A → V, sending B ∈ | A | to A(A, B) ∈ | V |, and with

A(A, )_{B,C} : A(B, C) → [A(A, B), A(A, C)]

corresponding under the adjunction (2.1) to M : A(B, C) ⊗ A(A, C) → A(A, C). Replacing A by A^{op} gives the contravariant representable V-functor A( , B) : A^{op} → V.

The form of the Yoneda Lemma we give here is a weak one, in that it asserts a bijection of sets rather than an isomorphism of objects of V.

Consider a V-functor F : A → V and an object A of A. To each V-natural transformation α : A(A, ) \underrightarrow{.} F we can assign the element a : I → F A of F A given by the composite

I ⟶^{j_{A}} A(A, A) ⟶^{α_{A}} F A.

The Yoneda Lemma asserts that this gives a bijection between the set V-Nat(A(A, ), F) of V-natural transformations and the set V_{0}(I, F A) (= V F A) of elements of F A; the component α_{X} being given in terms of a as the composite

A(A, X) ⟶^{F_{A,X}} [F A, F X] ⟶^{[a,id]} [I, F X] ⟶^{λ(r)^{−1}} F X.  (2.3)

It is worth noting an alternative way of writing (2.3) when F has the form B(B, U ) for a V-functor U : A → B, so that a : I → B(B, UA) is then a map a : B → UA in B_{0} (in fact, the image of id_{A} under V α_{A} : A_{0}(A, A) → B_{0}(B, UA)). Then α_{X} is the composite

A(A, X) ⟶^{U_{A,X}} B(UA, UX) ⟶^{B(a,id)} B(B, UX).  (2.4)

In particular, every V-natural α : A(A, ) → A(X, ) is A(f, ) for a unique f : X → A; and clearly f is an isomorphism if and only if α is.

As in any 2-category (see [KS74]) an adjunction η, ε : F ⊣ U : A → B in V-CAT between U : A → B (the right adjoint) and F : B → A (the left adjoint) consists of η : Id \underrightarrow{.} UF (the unit) and ε : F U \underrightarrow{.} Id (the counit) satisfying the triangular equations Uε ∘ ηU = id and εF ∘ F η = id. By the Yoneda Lemma, such adjunctions in V-CAT are in bijection with V-natural isomorphisms

χ : A(F B, A) ≅ B(B, UA)

for by (2.4) a V-natural map χ : A(F B, A) → B(B, UA) has the form χ = B(η, id)U for a unique η, while a V-natural map χ′ : B(B, UA) → A(F B, A) has the form χ′ = A(id, ε)F for a unique ε, and the equations χ′ ∘ χ = id and χ ∘ χ′ = id reduce by Yoneda to the triangular equations. The 2-functor ( )_{0} : V-CAT → CAT carries such an adjunction into an ordinary adjunction η, ε : F_{0} ⊣ U_{0} : A_{0} → B_{0} in CAT. The corresponding isomorphism of hom-sets is

V χ : A_{0}(F B, A) ≅ B_{0}(B, UA).

The unit and counit of this ordinary adjunction are the same η and ε, now seen as natural rather than V-natural.

2.3.2 Functor Categories

Suppose that V is symmetric monoidal closed and that the underlying ordinary category V_{0} is locally small. Then to each pair A, B of V-categories we can associate a tensor product A ⊗ B, with object-set | A | × | B |, and with

(A ⊗ B)((A, B), (A′, B′)) = A(A, A′) ⊗ B(B, B′).

The composition is given by

A(A, A′′) ⊗ B(B, B′′) M (A(A′, A′′) ⊗ B(B′, B′′)) ⊗ (A(A, A′) ⊗ B(B, B′)) m  M ⊗ M (A(A′, A′′) ⊗ A(A, A′)) ⊗ (B(B′, B′′) ⊗ B(B, B′))

where m : (W ⊗ X) ⊗ (Y ⊗ Z) ≅ (W ⊗ Y) ⊗ (X ⊗ Z) is the middle-four interchange defined by any suitable composite of instances of a and c. The identity element is the composite

I ≅ I ⊗ I ⟶^{j_{A}⊗j_{B}} A(A, A) ⊗ B(B, B).

With the obvious definitions of F ⊗ G : A ⊗ B → A′ ⊗ B′ and of α ⊗ β : F ⊗ G → F′ ⊗ G′, we have a 2-functor ⊗ : V-CAT × V-CAT → V-CAT; and we have coherent 2-natural isomorphisms (A ⊗ B) ⊗ C ≅ A ⊗ (B ⊗ C), I ⊗ A ≅ A ≅ A ⊗ I, and A ⊗ B ≅ B ⊗ A (where I is the unit V-category). Thus V-CAT is a symmetric monoidal 2-category.

A functor T : A ⊗ B → C may be thought of as a functor of two variables. Such a T gives rise to functors T (A, ) : B → C for each A ∈ | A | and T ( , B) : A → C for each B ∈ | B |. Here T (A, ) is the composite

B ≅ I ⊗ B ⟶^{A⊗Id} A ⊗ B ⟶^{T} C

from which can be read off the value T (A, )_{B,B′}.

By (extraordinary) V-naturality for an | A |-indexed family of maps ε_{A} : Z → T (A, A) in B_{0}, where Z ∈ | B | and T : A^{op} ⊗A → B, we mean the commutativity of each diagram

A(A, B) T ( , B)  B(T (A, A), T (A, B)) B(T (B, B), T (A, B)) T (A, ) B(ε_{B}, id)  B(ε_{A}, id) B(Z, T (A, B)) .  (2.5)

Henceforth we add the further assumption that V_{0} is complete, in the sense that it admits all small limits.

Consider a V-functor T : A^{op} ⊗ A → V. If there exists a universal V-natural family ε_{A} : Z → T (A, A), in the sense that every V-natural γ_{A} : C → T (A, A) is given by γ_{A} = ε_{A} ∘ h for a unique h : C → Z, we call (Z, ε) the end of T; clearly, when it exists, it is unique up to isomorphism. We write ∫_{X∈ | A |} T (X, X) for the object Z, and by the usual abuse of language also call this object the end of T: then the universal V-natural ε_{A} : ∫_{X} T (X, X) → T (A, A) may be called the counit of this end.

The V-naturality condition (2.5), in the case B = V, transforms under the adjunction V_{0}(W, [X, Y]) ≅ V_{0}(W ⊗ X, Y) ≅ V_{0}(X, [W, Y]) into

T (B, B)  T (A, A) [A(A, B), T (A, B)] ε_{A} β_{A,B}  α_{A,B} ε_{B} Z

where α_{A,B} and β_{A,B} are the transforms of T (A, )_{A,B} and T ( , B)_{B,A}. When A is small, the end ∫_{A∈ | A |} T (A, A) exists, and is given as the equaliser

∏_{A,B∈ | A |} [A(A, B), T (A, B)]. α β ∏_{A∈ | A |} T (A, A) ∫_{A∈ | A |} T (A, A) λ

For V-functors F, G : A → B we introduce the notation

[A, B](F, G) = ∫_{A} B(F A, GA)

for the end on the right, whenever it exists; and we write the counit as

ε_{A} = ε_{A}^{F,G} : [A, B](F, G) → B(F A, GA).

We write [A, B]_{0}(F, G) for the set V [A, B](F, G) of elements α : I → [A, B](F, G) of this end. These correspond to V-natural families

α_{A} = ε_{A} ∘ α : I → B(F A, GA)

which are precisely the V-natural transformations α : F \underrightarrow{.} G : A → B.

When [A, B](F, G) exists for all F, G : A → B, as it does if A is small, it is the hom-object of a V-category [A, B] with all the F : A → B as objects. The composition of [A, B] is uniquely determined by the commutativity of

[A, B](G, H) ⊗ [A, B](F, G)  [A, B](F, H) B(F A, HA) B(GA, HA) ⊗ B(F A, GA)  M M  ε_{A} ε_{A} ⊗ ε_{A}

and its identity elements are similarly determined by ε_{A} ∘ j_{F} = j_{F A}.

We call [A, B], when it exists, the functor category; its underlying category [A, B]_{0} is the ordinary category of all V-functors A → B and all V-natural transformations between them —that is,

[A, B]_{0} = V-CAT(A, B).

There is a V-functor E : [A, B] ⊗ A → B, called evaluation, sending (F, A) to F A and with E_{(F,A),(G,B)} as the composite

[A, B](F, G) ⊗ A(A, B) ⟶^{ε_{B}⊗F} B(F B, GB) ⊗ B(F A, F B) ⟶^{M} B(F A, GA);

which induces, for each V-category C, an ordinary functor

V-CAT(C, [A, B]) ⟶ V-CAT(C ⊗ A, B)  (2.6)

sending F : C → [A, B] to the composite

C ⊗ A ⟶^{F ⊗Id} [A, B] ⊗ A ⟶^{E} B

and sending α : F \underrightarrow{.} G : C → [A, B] to the composite E(α ⊗ id). The map (2.6) is 2-natural in C; and in fact is an isomorphism of categories.

We have called the V-functors A(A, ) : A → V representable. More generally, a V-functor F : A → V is called representable if there is some A ∈ | A | and an isomorphism α : A(A, ) \underrightarrow{.} F. Then the pair (A, α) is a representation of F; it is essentially unique if it exists, in the sense that any other representation β : A(B, ) \underrightarrow{.} F has the form β = α ∘ A(f, ) for a unique isomorphism f : A → B. The corresponding a : I → F A is called the unit of the representation. (We call a the counit when we are representing a contravariant F : A^{op} → V in the form A( , A)).

Now let F : B^{op} ⊗ A → V be such that each F (B, ) : A → V admits a representation α_{B} : A(RB, ) \underrightarrow{.} F (B, ). Then there is exactly one way of defining a map R_{B,C} : B(B, C) → A(RB, RC) that makes R a V-functor for which the isomorphism α_{B}_{A} : A(RB, A) → F (B, A) is V-natural in B as well as A.

It follows that, if it exists, [A, B] is uniquely 2-functorial in A and B in such a way that (2.6) is 2-natural in every variable. For F : A′ → A and G : B → B′, the V-functor [F, G] : [A, B] → [A′, B′] sends T to GT F and is determined on hom-objects by

[A, B](T, U)  [F, G]_{T,U}  [A′, B′](GT F, GUF) B′(GT F A, GUF A) G_{T F A,UF A} B(T F A, UF A)  ε′_{A} ε_{F A}

while the V-natural transformation [α, β] : [F, G] \underrightarrow{.} [F′, G′] is given by

[α, β]_{T} = βT α : GT F → G′T F′.

The 2-natural isomorphism (2.6) exhibits [A, B], when it exists, as a representing object for the 2-functor V-CAT( ⊗ A, B). It is conversely true that, if this 2-functor is representable by some D, then [A, B] exists and is isomorphic to D —at least if V_{0} has an initial object 0. For taking C to be I in (2.6), with [A, B] replaced by D, we identify the objects of D with the V-functors A → B; while taking C to be the V-category with two objects 0 and 1, with C(0, 0) = C(1, 1) = I, with C(1, 0) = 0, and with C(0, 1) an arbitrary object X of V, we easily see that D(F, G) = ∫_{A} B(F A, GA).

The 2-functor ⊗ A : V-CAT → V-CAT has a right adjoint [A, ] when [A, B] exists for all B; and by the above, only then, if V_{0} has an initial object. This right adjoint exists when A is small. In this sense the symmetric monoidal 2-category V-Cat of small V-categories is closed.

2.3.3 Limits

Suppose that V is cartesian closed and that V_{0} is locally small, complete and cocomplete.

Then, the ordinary functor V = V_{0}(I, ) : V_{0} → Set has a left adjoint ( ) · I, sending the set A to the coproduct A · I of A copies of I in V_{0}. This functor sends the cartesian product in Set to the tensor product in V_{0}, in that we have

(A × B) · I ≅ (A · I) ⊗ (B · I), 1 · I ≅ I.  (2.7)

The 2-functor ( )_{0} : V-CAT → CAT now has a left adjoint ( )_{V}. The free V-category G_{V} on the ordinary locally-small category G has the same objects as G, and has hom-objects G_{V}(X, Y) = G(X, Y) · I; its composition and its identities are induced from those of G using the isomorphisms (2.7).

It also happens that I = 1 in V_{0}, so that the V-categories I and 1 coincide; then, for every pair of V-categories A and B, there is, for any A ∈ | A |, a “constant V-functor” KA : B → 1 → A with this value.

For any ordinary category G, we may think of a V-functor Γ : G_{V} → A as a diagram in A of type G. For each A ∈ | A |, we can consider the existence in V of the object [G_{V}, A](KA, Γ). If this exists for all A —as it does when G is small— it is the value of a V-functor A^{op} → V. If this V-functor not only exists but admits a representation

A(A, lim Γ) ≅ [G_{V}, A](KA, Γ)

with counit

π_{A} : 1 → A(lim Γ, ΓA)

we call the representation (lim Γ, π) the limit of Γ.

3 Partiality

Categorical structures suitable for describing partial maps, viz. domain structures, are introduced and their induced categories of partial maps are defined.

The representation of partial maps as total ones is addressed. In particular, the representability (in the categorical sense) and the classifiability (in the sense of topos theory) of partial maps are shown to be equivalent (Theorem 3.2.6).

Finally, two notions of approximation, contextual approximation and specialisation, based on testing and observing partial maps are considered and shown to coincide. It is observed that the approximation of partial maps is definable from testing for totality and the approximation of total maps; providing evidence for taking the approximation of total maps as primitive.

3.1 Categories of Partial Maps

To motivate the definition of a partial map, observe that a partial function u : A ⇀ B is determined by its domain of definition dom(u) ⊆ A and the total function dom(u) → B induced by the mapping a ↦ u(a). Thus, every partial function A ⇀ B can be described by a pair consisting of an injection D ↣ A and a total function D → B with the same source. These descriptions are not unique, for (m, f) and (n, g) describe the same partial function if and only if

m = n ∘ i and f = g ∘ i, for some isomorphism i.  (3.1)

Following the above reformulation, given a category whose morphisms are to be thought of as total maps, a pair (m : D ↣ A, f : D → B) will be a description of a partial map [m, f] : A ⇀ B; and conversely, every partial map A ⇀ B will be described by some pair (D ↣ A, D → B). Formally, the descriptions (m, f) and (n, g) are regarded as equivalent whenever (3.1) holds; and a partial map is defined to be an equivalence class of descriptions.

When working with partial maps it is usual just to deal with their descriptions and observe that the arguments or constructions involved are independent of the chosen descriptions. For example, in a category with enough pullbacks, the composition of the partial map v = [n, g] : B ⇀ C with the partial map u = [m, f] : A ⇀ B is defined to be the partial map v ∘ u = [m ∘ f^{−1}(n), g ∘ (n^{∗}f)] : A ⇀ C where

n f n^{∗}f f^{−1}(n)  (3.2)

is a pullback.

The suspicious reader should check that the above definition is independent of any choice of descriptions for the partial maps, as well as for the required pullback. It is also easy to see that composition is associative, and that the partial map [id, id] is a unit for it. Before defining categories of partial maps it will be necessary to refine the notion of partial map as the following examples show.

Let pPoset be the category whose objects are small posets and whose morphisms u : P ⇀ Q are partial monotone functions, in the sense that, for every x, x′ ∈ P,

if x ⊑ x′ then u(x) ⊏ ∼ u(x′)  (3.3)

where, for two mathematical expressions e and e′, we write e ⊏ ∼ e′ to mean that if e denotes some y in Q then e′ denotes some y′ in Q and y ⊑ y′. We further write e ≃ e′ whenever both e ⊏ ∼ e′ and e′ ⊏ ∼ e. Further let pCpo be the subcategory of pPoset whose objects are cpos and whose morphisms u : P ⇀ Q are partial continuous functions, in the sense that, for every ω-chain x in P,

⨆_{k ∈ |ω|} u(x_{k}) ≃ u( ⨆_{k ∈ |ω|} x_{k})  (3.4)

where the expression on the left is intended to be undefined if every u(x_{k}) is; or, otherwise, denote ⨆_{k ≥ k_{0}} u(x_{k}) where k_{0} is any index for which u(x_{k_{0}}) is defined. In these two categories, the domain of definition of a morphism P ⇀ Q cannot be any subobject of P: in pPoset, by (3.3), the only possible domains of definitions are the upper-closed subsets of P, whilst in pCpo, by (3.4), they are the Scott-open subsets of P.

To include such a possibility, descriptions of partial maps are to be pairs (m, f) where m is confined to a class of admissible monos. The category of total maps together with such a class constitute a domain structure.

Definition 3.1.1 ([Ros86,Mog86]) A domain structure is a pair (K, D) consisting of a well-powered category D and a category K, such that D is a full-on-objects subcategory of K all of whose morphisms are monos in K, with the following closure property: every diagram ⟶^{f}⟵^{n} with f ∈ K and n ∈ D has a pullback in K and whenever

f^{−1}(n)  f  n

is a pullback then f^{−1}(n) ∈ D. □

Convention. K is called the category of total maps and D is called the category of admissible monos. For every A ∈ | D |, we write D(A) for the representative small set of subobjects of A in D guaranteed by well-powerness.

Categories of admissible monos are closed under isomorphisms, for every isomorphism i appears in the pullback

id idi i  .

For monos m and n, we write [m] ⊆_{i} [n] (m ⊆_{i} n) and say that i realises the inequality [m] ⊆ [n] (m ⊆ n) whenever m = n ∘ i. Realisers of inequalities between admissible subobjects are admissible, for consider the equivalence:

n i id  m ⟺ [m] ⊆_{i} [n]  .

Convention. For a category X and a set O ⊆ | X |, the full subcategory of X with set of objects O is denoted as X ↾ O.

It is time for some examples. Every well-powered category K appears in two domain structures: a minimal one, (K, Isos_{K}) where Isos_{K} is the category of all isomorphisms in K; and a maximal one, (K, Monos_{K}) where Monos_{K} is the category of all monomorphisms in K.

To obtain further examples, we show how to construct new domain structures from old ones. Let (K, D) be a domain structure and let L be a full subcategory of K whose objects are closed under taking the source of admissible monos (i.e., for every X ∈ | L | and D ∈ | D |, if D ↣ X in D then D ∈ | L |). Then (L, D ↾ | L |) is a domain structure. In particular, every domain structure (K, D) and set O ⊆ | K | induce the domain structure (K ↾ O′, D ↾ O′) where O′ = ⋃_{A∈O}{D | D ↣ A in D}.

A more tangible example of domain structure is (Top, Open) where Open consists of all those monos m : (X, OX) ↣ (Y, OY) in Top such that (m(X), P(mX) ∩ OY) is a topological space isomorphic to (X, OX). The above construction applied to K = Top, D = Open, and L = Poset (resp. Cpo), viewed as the full subcategory of Top whose objects are posets (resp. cpos) with the Alexandrov (resp. Scott) topology, yields the domain structure (Poset,Open) (resp. (Cpo,Open) = (Cpo,Σ)).

Definition 3.1.2 The category of partial maps p(K, D) induced by a domain structure (K, D) has the same objects as K, a morphism is an equivalence class of descriptions in D × K, and composition and identities are given as detailed above. □

Convention. Whenever we write p(K, D) it is assumed that (K, D) is a domain structure; when D is clear from the context we simply write pK.

To distinguish total maps (i.e., morphisms in K) from partial maps (i.e., morphisms in pK) we denote the former with → and the latter with ⇀.

The categories of partial maps induced by some of our examples of domain structures are: p(K, Isos_{K}) ≅ K, p(Set, Monos) ≅ Pfn, p(Poset, Open) ≅ pPoset, and p(Cpo, Σ) ≅ pCpo. A non-standard example is ω+1 = p(ω + 1, Monos), which is isomorphic to the category with object-set ω + 1, hom-sets Hom(k, l) = min(k, l) + 1, identities id_{k} = k, and composition (j ⟶^{m} k ⟶^{n} l) = (j ⟶^{min(m,n)} l).

The category of total maps can be viewed as a full-on-objects subcategory of the category of partial maps by identifying K with its image under the faithful inclusion functor J : K → pK which acts as the identity on objects and sends a total map f to the partial map [id, f]. It should then be clear what is meant by a total partial map and by the composition of a total map with a partial map. To indicate that a partial map u is total we write u ↓. Totality and composition interact in the desirable way: e.g., for partial maps u and v,

(v ∘ u) ↓ ⇒ u ↓ .

When the category of total maps has a terminal object, we say that totality is extensional if for all u : A ⇀ B,

u ↓ ⟺ (u ∘ x) ↓ for every x : 1 → A.

There is a partial-inclusion functor ( )^{R} : D^{op} → pK which acts as the identity on objects and sends m : D ↣ A in D to m^{R} = [m, id] : A ⇀ D. Partial inclusions have nice equational properties, in particular

m^{R} = n^{R} ⟺ [m] = [n],
m^{R} ∘ m = id,  (3.5)
[m, f] = f ∘ m^{R}.  (3.6)

While (3.5) justifies the terminology, (3.6) shows that every partial map can be factored as a partial inclusion followed by a total map. In fact, as observed by John Power, this determines a factorisation system [FK72]. Partial inclusions also provide a simple equational characterisation for the pullbacks we are interested in, as

⟺ n m  g  n^{R} ∘ f = g ∘ m^{R}. f

The adopted description of partial maps allows the definition of the inverse image, u^{−1}[n], of an admissible subobject [n] ∈ D(B) along a partial map u = [m, f] : A ⇀ B, simply as the admissible subobject [m ∘ f^{−1}(n)] ∈ D(A). In fact, we have an inverseimage functor D : pK^{op} → Poset sending A ∈ | pK | to D(A) and u : A ⇀ B to u^{−1}( ) : D(B) → D(A). Its restriction to total maps is D ∘ J^{op} : K^{op} → Poset. As a convention, for u : A ⇀ B and [m : D ↣ B] ∈ D we write u^{−1}(m) : u^{−1}(D) ↣ A for a representative of u^{−1}[m] ∈ D(A). Notice that, for f : A → B, the convention agrees with the already adopted notation, f^{−1}(m), for any mono obtained by pulling back m along f. Also, extending the n^{∗}f notation of diagram (3.2) to partial maps, so that n^{∗}[m, f] = n^{∗}f, we have:

Proposition 3.1.3 The commuting square

D Bm u A u^{−1}(m) u^{−1}(D) m^{∗}u

is a pullback for total maps. That is, for every A ⟵^{f} C ⟶^{g} D satisfying u ∘ f = m ∘ g there exists a unique h : C → u^{−1}(D) such that f = u^{−1}(m) ∘ h and g = (m^{∗}u) ∘ h. □

From the inverse image of a partial map we can obtain its domain of definition by setting

dom_{A,B}( ) = ( )^{−1}[id_{A}] : pK(A, B) → D(A)

for every A, B ∈ | pK |. It follows then that a partial map is total if and only if its domain of definition is the maximal subobject.

3.2 Representing and Classifying Partial Maps

Partial maps are frequently represented as total maps. This section studies this kind of representability. The purpose is not to reduce partial maps to total ones, but to deepen the understanding of their relationship; we aim at establishing a connection which will allow the transfer of properties, constructions, etc. between total and partial maps.

The intuition of the representation is simple: a partial map A ⇀ B is represented by a total map A → LB where LB (read as “B lifted”) arises from B by adjoining undefinedness to it. For sets and partial functions, LB is B with a new element, usually written ⊥, symbolising undefinedness. Here, a partial function u : A ⇀ B is represented by the total function

χ(u) : A ⟶ LB
a ⟼ \{ \begin{matrix}u(a) & , if a ∈ dom(u) \\ ⊥ & , otherwise \end{matrix}

In this way, χ determines a bijection, natural in A, between Pfn(A, B) and Set(A, LB).

This kind of representability is categorical. Recall that a representation of a functor F : K^{op} → Set is a pair (R, ρ) consisting of a representing object R ∈ | K | and a natural isomorphism ρ : K( , R) \underrightarrow{.} F : K^{op} → Set. The counit of the representation is determined by the Yoneda bijection Υ : Nat(K( , R), F) → F R as Υ(ρ) = ρ(id_{R}) ∈ F R. In the above example LB is a representing object of Pfn( , B) : Set^{op} → Set, with counit the partial inclusion (B ↣ LB)^{R} : LB ⇀ B only undefined for ⊥.

Representations of partial functions can be characterised equationally. As the reader should check, for a partial function u : A ⇀ B, its representation χ(u) : A → LB is the unique total function satisfying

χ(u)^{−1}(B) = dom(u), and ∀ x ∈ dom(u). χ(u)(x) = u(x).  (3.7)

In topos theoretic terms (3.7) says that u is classified by B ↣ LB:

Definition 3.2.1 (c.f. [Joh77]) Let (K, D) be a domain structure. A classifier of partial maps with target B is a mono n : B ↣ LB in D such that for every partial map [m, f] : A ⇀ B, there exists a unique total map χ_{[m,f]} : A → LB, called the characteristic map of [m, f], making

D A  LB B m  f  n χ_{[m,f]}

a pullback. □

Convention. An | pK |-indexed collection η is called a partial map classifier if for every B ∈ | pK | the component η_{B} is a classifier of partial maps with target B.

When K has a terminal object, the classifier of partial maps with target 1 classifies admissible monos and so is called a D-classifier.

The representing object of pPoset( , Q) : Poset^{op} → Set, usually denoted Q_{⊥}, is the poset Q with a new least element. Not surprisingly, the representations are as defined for sets and partial functions. And thus (3.7) also characterises representations of partial monotone functions. Similarly this characterisation extends to partial continuous functions; and in fact, it holds for any category of partial maps:

Theorem 3.2.2 For B ∈ | pK |, the functor pK( , B) : K^{op} → Set is representable if and only if there is a classifier of partial maps with target B. □

If K has a terminal object we have that D( ) ≅ pK( , 1) : K^{op} → Set, hence:

Corollary 3.2.3 When K has a terminal object, the functor D( ) : K^{op} → Set is representable if and only if there is a D-classifier. □

Theorem 3.2.2 is a consequence of the following two propositions which correspond to each direction of the theorem.

Proposition 3.2.4 If ρ : K( , LB) ≅ pK( , B) : χ then

1. χ(id_{B}) : B → LB is admissible,

2. the counit ρ(id_{LB}) : LB ⇀ B is χ(id_{B})^{R},

3. χ(id_{B}) classifies partial maps with target B, and

4. χ[m, f] is the characteristic map of [m, f].

Proof: To prove that the counit of the representation ρ is a partial inclusion we show that if ρ(id_{LB}) = [n, g] then g is an isomorphism; so that ρ(id_{LB}) = (n ∘ g^{−1})^{R}.

As ρ and χ are inverses to each other,

for every object A ∈ | K | and every partial map [m, f] ∈ pK(A, B), the total map χ[m, f] ∈ K(A, LB) is the unique such that

[m, f] = ρ(χ[m, f]) = ρ(id_{LB}) ∘ χ[m, f].

(3.8)

Recalling that ρ(id_{LB}) = [n, g], the above equation states that

D mA  LB  B h_{[m,f]}  g n Ef χ[m, f]

for some h_{[m,f]}.

In particular, for every A ∈ | K | and f ∈ K(A, B) there exists h_{f} ∈ K(A, E) such that f = g ∘ h_{f}. Moreover, it is unique because as for every h : A → E, [n, g] ∘ n ∘ h = g ∘ h then, if g ∘ h = f it follows that n ∘ h_{f} = χ_{f} = n ∘ h and hence h_{f} = h. Therefore, g ∘ : K( , E) \underrightarrow{.} K( , B) : K^{op} → Set is a natural isomorphism and, by the Yoneda Lemma, g is an isomorphism.

The equality

(n ∘ g^{−1})^{R} ∘ χ(id_{B}) = ρ(id_{LB}) ∘ χ(id_{B}) = ρ(χ(id_{B})) = id_{B}

stands for

LB idB B  n ∘ g^{−1} B id χ(id_{B})

and implies both that χ(id_{B}) is admissible and

ρ(id_{LB}) = χ(id_{B})^{R}.  (3.9)

Finally, (3.8) and (3.9) establish that χ(id_{B}) classifies partial maps with target B, and that χ[m, f] is the characteristic map of [m, f]. □

Proposition 3.2.5 If n : B ↣ LB classifies partial maps with target B, then Υ^{−1}(n^{R}) = n^{R} ∘ : K( , LB) \underrightarrow{.} pK( , B) represents pK( , B) : K^{op} → Set.

Proof: Since n classifies partial maps with target B, it follows that for every A ∈ | K | and every [m, f] ∈ pK(A, B) there exists a unique χ_{[m,f]} ∈ K(A, LB) such that

[m, f] = n^{R} ∘ χ_{[m,f]}
= Υ^{−1}(n^{R})(χ_{[m,f]}).

Hence Υ^{−1}(n^{R}) is an isomorphism. □

As is well-known, if for every B ∈ | K | there is a representing object LB ∈ | pK | of pK( , B) : K^{op} → Set then L can be extended to a functor L : pK → K, called the lifting functor, which is right adjoint to the inclusion functor J : K → pK. This adjunction can be characterised from the previous analysis.

Theorem 3.2.6 η, ε : J ⊣ L : pK → K if and only if η is a partial map classifier, ε = η^{R} and, for every [m, f] : A ⇀ B, L[m, f] is the characteristic map of [η_{A} ∘ m, f]. □

Remark. The action of the lifting functor on partial maps can be described as a characteristic map because, as follows from Proposition 3.2.4 (4), the natural isomorphism χ : pK( , ) \underrightarrow{.} K( , L ) : K^{op} × pK → Set induced by the adjunction provides the characteristic map of a partial map; and for every [m, f] : A ⇀ B,

L[m, f] = χ([m, f] ∘ ε_{A}) , by a well-known formula
= χ[η_{A} ∘ m, f] , using ε_{A} = η_{A}^{R}.

(Another possible explanation is by naturality of ε : JL . ⇀ Id : pK → pK).

Succinctly, to have a lifting functor is equivalent to have a partial map classifier. It should be stressed that this alternative viewpoint is essential when transferring structure like enrichment and colimits from total to partial maps (see Section 4.5 and Theorem 5.3.14).

Among all classifiers, when K has a terminal object, the D-classifier plays a central role as it can encode all the others. This allows an axiomatisation of the lifting in terms of the classification of admissible monos; which is the approach taken in synthetic domain theory [Ros86,Pho90b,Hyl91,Tay91].

Proposition 3.2.7 Assume K has terminal object and let t : 1 ↣ Σ be admissible. If the right adjoint Π_{t} of t^{∗} : K/Σ → K exists then it is full and faithful.

Proof: We show that the counit ϵ of the adjunction t^{∗} ⊣ Π_{t} is an isomorphism.

By the universal property of ϵ we have that for every a : A → Σ in | K/Σ | and every f : t^{∗}a → B in K there exists a unique \overline{f} : a → Π_{t}B in K/Σ such that

t^{∗}a A  t^{∗}(Π_{t}B) LB \overline{f}  B f  Π_{t}B  Σ 1 ϵ_{B} t^{∗}\overline{f} a  t .

In particular, taking a to be B → 1 ↣^{t} Σ and f to be the canonical isomorphism in

Σ 1 1 B B id  t t a ≅ f t^{∗}a

we have that ϵ_{B} ∘ (t^{∗}\overline{f}) is an isomorphism; and hence ϵ_{B} is split epi.

Finally, we show that ϵ_{B} is mono. For every x : A → t^{∗}(Π_{t}B), writing f for the canonical isomorphism t^{∗}(A → 1 ↣^{t} Σ) ≅ A and n_{B} for t^{∗}(Π_{t}B) ↣ LB we have that

\overline{ϵ_{B} ∘ x ∘ f} = n_{B} ∘ x

because

x A  t^{∗}(Π_{t}B)  LB n_{B} 1  Σ  Π_{t}B t

and

t^{∗}(A → 1 ↣^{t} Σ) ≅ f A  A t^{∗}(Π_{t}B) x  n_{B}  LB t^{∗}(Π_{t}B) n_{B} x

so that ϵ_{B} ∘ t^{∗}(n_{B} ∘ x) = ϵ_{B} ∘ x ∘ f.

Hence, for x, y : A → t^{∗}(Π_{t}B), if ϵ_{B} ∘ x = ϵ_{B} ∘ y then

n_{B} ∘ x = \overline{ϵ_{B} ∘ x ∘ f} = \overline{ϵ_{B} ∘ y ∘ f} = n_{B} ∘ y

and, as n_{B} is mono, x = y. □

Theorem 3.2.8 Assume K has terminal object. Then t : 1 ↣ Σ is a D-classifier and t^{∗} : K/Σ → K has a right adjoint if and only if J : K → pK has a right adjoint and, writing η for the unit of the adjunction, η_{1} ≅ t in K^{·→·}.

Proof:

(⇒) Let Π_{t} : K → K/Σ be right adjoint to t^{∗}. For every B ∈ | K | define η_{B} to be the composite B ≅ t^{∗}(Π_{t}B) ↣ LB where ϵ_{B} : t^{∗}(Π_{t}B) ≅ B is the counit of the adjunction t^{∗} ⊣ Π_{t} (see Proposition 3.2.7) and where

Σt 1 LB Π^{t}B t^{∗}(Π_{t}B)  .

Then we have that

Σt 1 LB Π_{t}B B η_{B}

and that η_{B} classifies partial maps with target B as we now show.

For [m, f] : A ⇀ B we have

t 1 Σ D mA χ_{[m,D→1]}  .

Then, D ≅ t^{∗}χ_{[m,D→1]}, and the transpose of the map t^{∗}χ_{[m,D→1]} ≅ D ⟶^{f} B gives a

unique φ : χ_{[m,D→1]} → Π_{t}B such that ϵ_{B} ∘ (t^{∗}φ) = (t^{∗}χ_{[m,D→1]} ≅ D ⟶^{f} B) and

A D ≅ t^{∗}χ_{[m,D→1]} A  LB φ t^{∗}φ m  t^{∗}(Π_{t}B) ≅ B LB f  η_{B} .

Thus φ is the characteristic map of [m, f].

(⇐) As t ≅ η_{1} in K^{·→·} we have both that t is a D-classifier and that t^{∗} ≅ η_{1}^{∗}. Therefore we only need show that η_{1}^{∗} has right adjoint.

Let L be the lifting functor. For B ∈ | K |, L(B → 1) ∈ | K/L1 | is the cofree object on B with counit ϵ_{B} : η_{1}^{∗}(L(B → 1)) ≅ B defined as the mediating morphism between the following two pullbacks

1 L1η_{1} η_{1}^{∗}(L(B → 1)) ϵ_{B} ≅ L(B → 1)^{−1}(η_{1})  B η_{B} LB L(B → 1)  .

Recall that the square is a pullback because L(B → 1) is the characteristic map of [η_{B}, B → 1] (see Theorem 3.2.6 and the remark after it).

We now check the universal property of the counit. Let B ∈ | K |, g ∈ | K/L1 | and h : g ⟶ L(B → 1) in K/L1. We have,

L(B → 1)^{−1}(η_{1}) LB A  η_{1}^{∗}(h) h g^{−1}(η_{1}) η_{1}^{∗}(g)  η_{1}^{∗}(L(B → 1))  LBη_{B} B ϵ_{B} ≅ id

and therefore, for every f : η_{1}^{∗}(g) → B in K,

h = χ[g^{−1}(η_{1}), f] ⟺ f = ϵ_{B} ∘ η_{1}^{∗}(h).  (3.10)

Finally, observe that (3.10 (⇒)) establishes the existence condition of the universal property of the counit, whilst (3.10 (⇐)) establishes uniqueness. □

The rest of the section is devoted to discussing the consequences of having the lifting functor. We first observe that the category of partial maps is the Kleisli category of the monad induced by the adjunction. This simply happens because the inclusion functor is bijective on objects.

Proposition 3.2.9 (Kleisli) If η, ε : F ⊣ U : L → K and F is bijective (essentially surjective) on objects then L is isomorphic (equivalent) to K_{𝕋}, the Kleisli category of the monad 𝕋 = (UF, UεF, η) : K → K.

Proof: Recall that there is an adjunction F_{𝕋} ⊣ U_{𝕋} : K_{𝕋} → K such that there exists a unique comparison functor K_{𝕋} → L acting as F on objects and sending f ∈ K_{𝕋}(A, B) to ρ(f) ∈ L(F A, F B), where ρ : K( , U ) \underrightarrow{.} L(F , ) : K^{op} × L → Set is the natural isomorphism induced by the adjunction F ⊣ U. The comparison functor is full and faithful, and when F is bijective (essentially surjective) on objects, it is an isomorphism (equivalence) of categories. □

Corollary 3.2.10 If η, ε : J ⊣ L : pK → K then pK is (isomorphic to) the Kleisli category of 𝕃 = (LJ, LεJ, η) : K → K. □

Further miscellaneous consequences are:

Proposition 3.2.11 If η, ε : J ⊣ L : pK → K then

1. η is a cartesian natural transformation (i.e., the commuting square defining naturality is a pullback).

2. Every admissible mono is regular. In particular, η_{A} is the equaliser of the pair Lη_{A}, η_{LA} : LA → L^{2}A.

3. L is faithful.

4. L reflects isomorphisms.

Proof:

(1) By naturality of εJ : JLJ \underrightarrow{.} J : K → pK.

(2) Every admissible mono m : D ↣ B is the equaliser of χ[m, m], η_{B} : B → LB. In particular, χ[η_{A}, η_{A}] = Lη_{A}.

(3) Because ε is epi, as ε_{A} ∘ η_{A} = id for every A ∈ | pK |.

(4) Assume L[m, f] is an isomorphism.

First we show that f is an isomorphism: if L[m, f] has inverse h, then defining g as the mediating morphism in the diagram

LB  LB LA  η_{B} D gη_{A} ∘ m  B B η_{B}  f id h  L[m, f] id

it follows that f ∘ g = id. Moreover, g ∘ f = id, because the following rectangle is a pullback,

D η_{A} ∘ m  id LB LA  B f L[m, f]  LA D η_{B}  η_{A} ∘ m gh  .

Second we show that m is an isomorphism (for which we need only check that m ∘ m^{R} = id): L[m, f] = L(f) ∘ L(m^{R}) and since L[m, f] and Lf are both isomorphisms it follows that so is L(m^{R}). Moreover, L(m^{R}) ∘ L(m) = L(m^{R} ∘ m) = id and hence (Lm)^{−1} = L(m^{R}). Thus, L(m ∘ m^{R}) = id and, as L is faithful, m ∘ m^{R} = id. □

3.3 Testing and Observing Partial Maps

The capability of observing that an input/output program terminates serves as the basis for discriminating between programs. For example, in the contextual approach, a program e is said to approximate a program e′ (written e ⊏ ∼^{c} e′) if, in every program in which e occurs, e can be safely replaced by e′ in the sense that new non-terminating behaviour will not happen.

The explicit distinction between partial and total maps induces an approximation relation in which contexts are used to discriminate between maps based on their terminating behaviour. Following the informal description of a context as a “program with a hole”; in a category of partial maps, a context is described as a “partial map with a hole”. Formally, contexts are incomplete composites u ∘ ∘ v where u and v are partial maps. The contextual approximation relation for partial maps is defined as follows,

Definition 3.3.1 (Plotkin) For every u, v : A ⇀ B,

u ⊏ ∼^{c} v if and only if C[u] ↓ ⇒ C[v] ↓ for every context C[ ]. □

Remark. Observe that because of the adopted description of partial maps it is enough to consider contexts of the form m^{R} ∘ ∘ f for m an admissible mono and f a total map. But the definition is independent of the description of the category of partial maps, and thus, makes sense in any axiomatisation of such categories.

The restriction of ⊏ ∼^{c} to total maps gives a contextual approximation relation on total maps which we denote ⊑^{c}. Both ⊑^{c} and ⊏ ∼^{c} are preorders and, in general, they are not partial orders.

Justifying our computational intuition, in the examples of interest the contextual approximation relation turns out to be a partial order which, further, coincides with the usual notion of approximation. In Poset and Cpo, ⊑^{c} is the pointwise order ⊑; whilst in pPoset and pCpo, ⊏ ∼^{c} is the appropriate generalisation of the pointwise order, namely for u, v : P ⇀ Q,

u ⊏ ∼ v if and only if u(x) ↓ ⇒ (v(x) ↓ ∧ u(x) ⊑ v(x)) for every x ∈ P.  (3.11)

Instead of checking these facts, which follow from general considerations (see the remark after Proposition 3.3.5), we exemplify the use of contexts to discriminate maps. Let f, g : P → Q in Poset be such that there exists v ∈ P for which fv ⊏ gv, and let C[ ] be the context in pPoset, U^{R} ∘ ∘v, where v : 1 → P : ∗ ↦ v and U = Q\{y ∈ Q | y ⊑ fv}. Then, with respect to termination, C[ ] distinguishes f and g, as C[f] ↑ and C[g] ↓.

In pPoset (pCpo), (3.11) reduces the order on partial monotone (continuous) functions to the test for definedness and the order on elements. As the next proposition shows this is a general phenomenon and sustains a claim that testing for totality and the approximation of total maps are primitive concepts, whilst the approximation of partial maps is a derived one.

Proposition 3.3.2 For every u, v : A ⇀ B,

u ⊏ ∼^{c} v if and only if u ∘ x ↓ ⇒ (v ∘ x ↓ ∧ u ∘ x ⊑^{c} v ∘ x) for every x : X → A.

Moreover, when the category of total maps has terminal object and totality is extensional (in the sense of page 45) the above can be strengthened to

u ⊏ ∼^{c} v if and only if u ∘ x ↓ ⇒ (v ∘ x ↓ ∧ u ∘ x ⊑^{c} v ∘ x) for every x : 1 → A. □

Remark. In the proposition, it would make no difference to allow x to range over partial maps, as u ∘ x ↓ ⇒ x ↓. Moreover, this property is central to the (omitted) proof.

Further evidence for the suitability of contextual approximation is that it interacts well with composition: the contextual approximation relation is a preorder with respect to which composition is a monotone operation.

The description of partial maps based on domain structures provides another computationally natural notion of approximation. For this purpose, admissible monos are regarded as predicates describing observable properties.

A program e is said to specialise a program e′ (written e ⊏ ∼^{s} e′) if the observable properties of the outputs of e are also satisfied by the outputs of e′. Put it in another way, for any observable property U, the weakest precondition ensuring that every execution of e satisfies U is a precondition ensuring that every execution of e′ satisfies U. Thus, an observer content with the input/output behaviour of e should also be content with the input/output behaviour of e′. The specialisation relation for partial maps is defined as follows,

Definition 3.3.3 u ⊏ ∼^{s} v : A ⇀ B in pK if and only if u^{−1}( ) ⊆ v^{−1}( ) : D(B) → D(A) in Poset. □

The specialisation relation generalises the one from topology. Recall that for a T_{0}-space (X, O(X)), its specialisation order ≤ ⊆ X × X is defined as

x ≤ y if and only if x ∈ U ⇒ y ∈ U for every U ∈ O(X).

Then, by identifying elements with functions out of the singleton, the above definition can be put in a form resembling Definition 3.3.3:

x ≤ y if and only if x^{−1}(U) ⊆ y^{−1}(U) for every U ∈ O(X).

Pleasantly enough, the notions of approximation obtained by testing and by observing partial maps coincide.

Lemma 3.3.4 For f ∈ K(X, A), u ∈ pK(A, B) and m ∈ D(D, B),

m^{R} ∘ u ∘ f ↓ ⟺ f factors through u^{−1}(m).

Proof:

(⇒) For every n ∈ D(E, Y) and g ∈ K(X, Y), n^{R} ∘ g ↓ ⇒ g = n ∘ n^{R} ∘ g.

Thus, assuming m^{R} ∘ u ∘ f ↓ we have that u ∘ f = m ∘ (m^{R} ∘ u ∘ f), and since A ↢^{u^{−1}(m)} u^{−1}(D) ⟶^{m^{∗}u} D is a pullback of A ⇀^{u} B ↢^{m} D for total maps (see Proposition 3.1.3) we are done.

(⇐) Assume f = u^{−1}(m) ∘ g. Then, g is total and

m^{R} ∘ u ∘ f = m^{R} ∘ u ∘ u^{−1}(m) ∘ g
= m^{R} ∘ m ∘ (m^{∗}u) ∘ g
= (m^{∗}u) ∘ g.  □

Proposition 3.3.5 Contextual approximation and specialisation coincide.

Proof:

( ⊏ ∼^{c} ⊆ ⊏ ∼^{s} ) Let u ⊏ ∼^{c} v : A ⇀ B. Then,

u ⊏ ∼^{c} v ⟹ ∀ [m] ∈ D(B).
(m^{R} ∘ u ∘ u^{−1}(m) ↓ ⇒ m^{R} ∘ v ∘ u^{−1}(m) ↓)
⟺ ∀ [m] ∈ D(B). m^{R} ∘ v ∘ u^{−1}(m) ↓

, as m^{R} ∘ u ∘ u^{−1}(m) = m^{∗}u ↓

⟺ ∀ [m] ∈ D(B). u^{−1}(m) factors through v^{−1}(m)

, by Lemma 3.3.4

⟺ u ⊏ ∼^{s} v.

( ⊏ ∼^{s} ⊆ ⊏ ∼^{c} ) Let u ⊏ ∼^{s} v : A ⇀ B. Then,

u ⊏ ∼^{s} v ⟺ ∀ [m] ∈ D(B). u^{−1}(m) ⊆ v^{−1}(m)
⟺ ∀ [m] ∈ D(B). u^{−1}(m) factors through v^{−1}(m)
⟹ ∀ f ∈ K(X, A). ∀ [m] ∈ D(B).
(f factors through u^{−1}(m) ⇒ f factors through v^{−1}(m))
⟹ ∀ f ∈ K(X, A). ∀ [m] ∈ D(B).
(m^{R} ∘ u ∘ f ↓ ⇒ m^{R} ∘ v ∘ f ↓)  , by Lemma 3.3.4
⟺ u ⊏ ∼^{c} v.  □

Remark. In Poset (resp. Cpo), the contextual approximation relation, the specialisation relation, and the pointwise order are equal, by Proposition 3.3.5 and the well-known fact that, for f, g : P → Q,

f ⊑ g if and only if f^{−1}(U) ⊆ g^{−1}(U) for every upper-closed (resp. Scott-open) U ⊆ Q.

Moreover, the equality extends to pPoset and pCpo, by Propositions 3.3.2 and 3.3.5.

4 Order-Enriched Categories of Partial Maps

Motivated by the discussion in Section 3.3, the approximation order between total maps (⊑) is adopted as primitive and is used to derive the notion of approximation between partial maps ( ⊏ ∼ ). Afterwards, the main goal is to understand when ⊏ ∼ is domain theoretic, in the technical sense that the category of partial maps Cpo-enriches with respect to it. For simplicity we undertake this study in two steps: first, we characterise Poset-categories of partial maps induced by domain structures with a Poset-category of total maps; second, we restrict our attention to uniform domain structures (Definition 4.3.5) with a Cpo-category of total maps, and provide necessary and sufficient conditions so that the induced category of partial maps Cpo-enriches. As an example, these characterisations are used when the approximation order is specialisation.

Finally, the transference of Cpo-enrichment from the category of total maps to the category of partial maps is revisited in the light of representability and, again, the example when the approximation order is specialisation is discussed.

Convention. For V = Poset or Cpo, a domain structure with a V-category of total maps is called a V-domain-structure and the order on total maps is denoted ⊑.

4.1 Ordering Partial Maps

A Poset-domain-structure induces an order on partial maps (denoted ⊏ ∼ ) whose definition is motivated by Proposition 3.3.2.

Definition 4.1.1 Given a Poset-domain-structure, for every u, v : A ⇀ B,

u ⊏ ∼ v if and only if for every x : X → A, u ∘ x ↓ ⇒ (v ∘ x ↓ ∧ u ∘ x ⊑ v ∘ x). □

Remark. The relation ⊏ ∼ is clearly reflexive and transitive. That it is antisymmetric follows from Proposition 4.1.2 below.

The intuition behind the definition is that a possibly non-terminating input/output program e approximates another one e′ provided that under all possible inputs, the outputs of e approximate the outputs of e′. Thus, in particular, whenever e outputs, so does e′. In symbols,

dom(e) ⊆ dom(e′) ∧ e ↾ dom(e) ⊑ e′ ↾ dom(e).

This intuition is technically correct:

Proposition 4.1.2 Given a Poset-domain-structure, for every [m, f], [n, g] : A ⇀ B,

[m, f] ⊏ ∼ [n, g] ⟺ m ⊆_{i} n ∧ f ⊑ g ∘ i for a unique i.

(In diagram form:

A  B n  g D E f m  ⊒ i  .)

Proof:

(⇒) Assume [m, f] ⊏ ∼ [n, g]. Since [m, f] ∘ m = f is total then so is [n, g] ∘ m and therefore there exists a unique i for which

i id  n m  and f = [m, f] ∘ m ⊑ [n, g] ∘ m = g ∘ i.

(⇐) Let m ⊆_{i} n and f ⊑ g ∘ i for some i. For x : X → A, if [m, f] ∘ x ↓ then

[id] = dom([m, f] ∘ x)
= x^{−1}[m]
⊆ x^{−1}[n]
= dom([n, g] ∘ x)

and therefore [n, g] ∘ x ↓.

Moreover, we have

m^{∗}x id  n n^{∗}x  ⊒ f id  i g x

and hence, [m, f] ∘ x = f ∘ (m^{∗}x) ⊑ g ∘ i ∘ (m^{∗}x) = [n, g] ∘ x. □

Convention. We introduce the notation [m, f] ⊏ ∼_{i} [n, g] to indicate that i realises the inequality between the representatives (i.e., m ⊆_{i} n and f ⊑ g ∘i). Clearly, if [m, f] ⊏ ∼ [n, g] and m ⊆_{i} n then [m, f] ⊏ ∼_{i} [n, g].

An example of the order induced by a Poset-domain-structure is a generalisation of the graph inclusion order; denoted ⊆, and defined to be the order induced by (K_{Poset}, D) where (K, D) is a domain structure. Explicitly,

[m, f] ⊆_{i} [n, g] if and only if m ⊆_{i} n and f = g ∘ i.

Justifying the terminology, when (K, D) = (Set, Monos),

u ⊆ v if and only if graph(u) ⊆ graph(v), and when (K, D) = (ω + 1, Monos),

[m ↣ k, m → l] ⊆ [n ↣ k, n → l] if and only if m ⊆ n.

The characterisation of ⊏ ∼ , provided by Proposition 4.1.2, is more convenient to work with than its definition and thus, from now on, the definition will be forgotten. For example, using this characterisation the following is straightforward:

Proposition 4.1.3 Let (K, D) be a Poset-domain-structure. Then, for A, B ∈ | K |,

1. (pK(A, B), ⊏ ∼ ) is a poset.

2. J_{A,B} : (K(A, B), ⊑) ↪ (pK(A, B), ⊏ ∼ ) is a full functor. Therefore, f ⊑ g : A → B if and only if Jf ⊏ ∼ Jg : A ⇀ B.

3. K(A, B) is upper-closed in (pK(A, B), ⊏ ∼ ); i.e., for every f : A → B and u : A ⇀ B, if f ⊏ ∼ u then u ↓.

4. J_{A,B} preserves lubs.

5. dom_{A,B} : (pK(A, B), ⊏ ∼ ) → (D(A), ⊆) is monotone. □

Remark. From (2) and (3) above, it follows that J_{A,B} is a full and upper-closed morphism in Poset, in the sense that, for every f : A → B and u : A ⇀ B, if Jf ⊏ ∼ u then there exists a unique g : A → B such that f ⊑ g and Jg = u. And this property together with monotonicity imply (4).

Full and upper-closed morphisms play a central role in the next section.

4.2 Poset-Categories of Partial Maps

We have seen that the category of partial maps induced by a Poset-domain-structure has hom-posets with respect to the induced order. Thus, it would be Poset-enriched if composition (or equivalently, composition on the right and composition on the left) was monotone.

Checking for monotonicity, and also continuity (as will be seen in the next section), of composition on the right is easier than for composition on the left due to the asymmetry in the diagram

⊒  (4.1)

expressing the inequality between two partial maps. When the order on partial maps is the graph inclusion order, the situation in (4.1) is symmetric (as both triangles commute) and potentially more manageable.

Monotonicity of composition on the right is immediate:

Lemma 4.2.1 For a Poset-domain-structure, pK( , A) is a functor pK^{op} → Poset for every A ∈ | pK |.

Proof: Let [m, f] : X ⇀ Y. Assume [n′, g′] ⊏ ∼_{i} [n, g] : Y ⇀ A, then the diagram

g i f m  n n′  g′ ⊒ j

states that j realises the inequality [n′, g′] ∘ [m, f] ⊏ ∼ [n, g] ∘ [m, f]. □

Aiming at characterising monotonicity of composition on the left, some domaintheoretic concepts in the context of Poset-categories, due to Barry Jay, are introduced.

Definition 4.2.2 (Jay) In a Poset-category C, a morphism m : A → B is said to be

1. full if for every C ∈ | C |, the monotone map m ∘ : C(C, A) → C(C, B) is full as a functor (i.e., for every x, y : C → A, m ∘ x ≤ m ∘ y ⇒ x ≤ y).

2. upper-closed if for every x : C → A and y : C → B, whenever m ∘ x ≤ y there exists a z : C → A such that m ∘ z = y. □

In Poset, a morphism m : P → Q is full if and only if establishes an isomorphism between P and m(P) ordered as in Q. Further, if f : P → Q is upper-closed then f(P) is an upper-closed subset of Q. The converse need not hold, but whenever m : P → Q is full and such that m(P) is an upper-closed subset of Q then m is an upper-closed morphism. Therefore, the full and upper-closed subobjects of a poset are exactly its upper-closed subsets with the induced order.

Full and upper-closed morphisms can be characterised along the lines of the remark after Proposition 4.1.3.

Proposition 4.2.3 In a Poset-category, a morphism m : A → B is full and upper-closed if and only if it is a mono and for every x : C → A and y : C → B, if m ∘ x ≤ y then there exists a (necessarily unique) z : C → A such that x ≤ z and m ∘ z = y. □

In pPoset every admissible mono is full and upper-closed. This is not accidental:

Theorem 4.2.4 Given a Poset-domain-structure (K, D), the following are equivalent:

1. p(K, D) Poset-enriches with respect to ⊏ ∼ .

2. pK(A, ) is a functor pK → Poset for every A ∈ | pK |.

4. Order-Enriched Categories of Partial Maps 68

3. For every A ∈ | K | and m : D ↣ B in D, the map

m^{R} ∘ : K(A, B) ⟶ pK(A, D)

is monotone.

4. Every admissible mono is full and upper-closed.

Proof:

(1) ⇒ (2) Vacuously.

(2) ⇒ (1) By Lemma 4.2.1. (2)⇒(3) Obvious. (3)⇒(4) Let m ∈ D, and assume that m ∘ x ⊑ y. Then,

x = m^{R} ∘ m ∘ x ⊏ ∼ m^{R} ∘ y.

In diagram form,

y  m i m^{∗}y x id  ⊒ y^{−1}(m)

for some i.

Therefore, x ⊑ (m^{∗}y) ∘ i and m ∘ (m^{∗}y) ∘ i = y.

(4) ⇒ (2) Let [n, g] : X ⇀ Y. Assume [m′, f′] ⊏ ∼_{i} [m, f] : A ⇀ X, then

n ∘ (n^{∗}f′) = f′ ∘ f^{′−1}(n) ⊑ f ∘ i ∘ f^{′−1}(n).

Since n is full and upper-closed, it follows that there exists a unique z such that

z  n^{∗}f′ n f if^{′−1}(n)  ⊒  .

Then, by the universal property of pullbacks, there exists a unique j such that

n f if^{′−1}(n)  z j n^{∗}f f^{−1}(n)  .

And finally, it follows that j realises the inequality [n, g] ∘ [m′, f′] ⊏ ∼ [n, g] ∘ [m, f]. □

Corollary 4.2.5 p(K, D) Poset-enriches with respect to ⊆. □

4.3 Cpo-Categories of Partial Maps

We start the investigation on Cpo-categories of partial maps focusing on the properties enforced by the enrichment. In this respect, two important points are: the fact that the class of admissible subobjects of a Cpo-domain-structure inducing a Cpo-category of partial maps ought to be locally a cpo, and a trick which reduces lubs of arbitrary partial maps to lubs of graph included partial maps (Subsection 4.3.1). Afterwards, with the purpose of obtaining lubs of admissible subobjects and lubs of partial maps in a canonical way, uniform domain structures are introduced and their properties studied (Subsection 4.3.2). This, together with the given characterisation of Poset-categories of partial maps, will provide a characterisation of Cpo-categories of partial maps induced by uniform Cpo-domain-structures (Subsection 4.3.3). Finally, as an application, a recipe for computing lubs of ω-chains of partial maps in these categories is given (Subsection 4.3.4).

Convention. Whenever we say that a category of partial maps is Cpo-enriched we assume that so is the domain structure that induces it and that the order is ⊏ ∼ .

4.3.1 Properties of Cpo-Categories of Partial Maps

Convention. We regard lubs (of subobjects and partial maps) as colimits. Thus we sometimes write ⨆ ⟨[m_{k}] ⊆ [m_{k+1}]⟩ = ⟨[m_{k}] ⊆ [m]⟩ to mean that ⟨[m_{k}] ⊆ [m_{k+1}]⟩ is an ω-chain with lub [m]. (An analogous notation is used for partial maps.)

Proposition 4.3.1 Let (K, D) be a Cpo-domain-structure. If p(K, D) has hom-cpos then D is locally a cpo (i.e., for every A ∈ | D |, (D(A), ⊆) is a cpo).

Proof: If ⟨[m_{k}] ⊆ [m_{k+1}]⟩ is an ω-chain in D(A) then ⟨[m_{k}, m_{k}] ⊆ [m_{k+1}, m_{k+1}]⟩ is an ω-chain in pK(A, A). And, if ⨆ [m_{k}, m_{k}] = [m, f], it follows that ⨆ [m_{k}] = [m]. □

The local completeness of the class of admissible subobjects has interesting consequences:

Proposition 4.3.2 Given a domain structure, if D is locally a cpo then

1. If ⟨[m_{k}] ⊆_{i_{k}} [m_{k+1}]⟩ is an ω-chain in D(A) with lub ⟨[m_{k}] ⊆_{μ_{k}} [m : D ↣ A]⟩ then ⟨[μ_{k}] ⊆_{i_{k}} [μ_{k+1}]⟩ is an ω-chain in D(D) with lub [id_{D}].

2. For every n : D ↣ A in D, the mapping [n ∘ ] : D(D) → D(A) is continuous.

3. dom preserves lubs of ω-chains.

Proof:

(1) Clearly ⟨[μ_{k}] ⊆_{i_{k}} [μ_{k+1}]⟩ is an ω-chain in D(D), and ⨆ [μ_{k}] = [id_{D}] because for every [n] ∈ D(D),

∀ k ∈ | ω |. μ_{k} ⊆ n ⟺ ∀ k ∈ | ω |. m_{k} = m ∘ μ_{k} ⊆ m ∘ n
⟺ m ⊆ m ∘ n
⟺ [n] = [id_{D}].

(2) First, observe that for every [m] ∈ D(D) and [n′] ∈ D(A),

n ∘ m ⊆ n′ ⟺ m ⊆ n^{−1}(n′).  (4.2)

Now, let ⟨[m_{k}] ⊆ [m_{k+1}]⟩ be an ω-chain in D(D) with lub [m]. Then, for every [n′] ∈ D(A),

∀ k ∈ | ω |. n ∘ m_{k} ⊆ n′ ⟺ ∀ k ∈ | ω |. m_{k} ⊆ n^{−1}(n′) , by (4.2)
⟺ m ⊆ n^{−1}(n′)
⟺ n ∘ m ⊆ n′  , by (4.2).

(3) Let ⟨[m_{k}, f_{k}] ⊏ ∼ [m_{k+1}, f_{k+1}]⟩ be an ω-chain. If ⨆ [m_{k}, f_{k}] = ⟨[m_{k}, f_{k}] ⊏ ∼ _{μ′_{k}}[m′, f]⟩ and ⨆ [m_{k}] = ⟨[m_{k}] ⊆_{μ_{k}} [m]⟩ then we are required to prove that [m] = [m′].

The admissible subobject [m′] is an upper bound of the ω-chain ⟨[m_{k}] ⊆ [m_{k+1}]⟩ and then [m] ⊆_{i} [m′]. For every k ∈ | ω |, since [m_{k}] ⊆_{μ_{k}} [m] ⊆_{i} [m′] and [m_{k}] ⊆_{μ′_{k}} [m′], it follows that μ′_{k} = i ∘ μ_{k}. Therefore, [m, f ∘ i] is an upper bound of the ω-chain ⟨[m_{k}, f_{k}] ⊏ ∼ [m_{k+1}, f_{k+1}]⟩, and then, [m′] ⊆ [m]. □

Convention. Let ⟨i_{k} : D_{k} → D_{k+1}⟩ be an ω-chain, then

1. we write ⟨m_{k}⟩ : ⟨i_{k}⟩ \underrightarrow{.} A to indicate that ⟨m_{k} : D_{k} → A⟩ is a cone for ⟨i_{k}⟩ (that is, m_{k} = m_{k+1} ∘ i_{k} for all k ∈ | ω |);

2. we write ⟨f_{k}⟩ : ⟨i_{k}⟩ \underrightarrow{.}_{≤}B to indicate that ⟨f_{k} : D_{k} → B⟩ is a lax cone for ⟨i_{k}⟩ (that is, f_{k} ⊑ f_{k+1} ∘ i_{k} for all k ∈ | ω |); and,

3. for cones ⟨μ_{k}⟩ : ⟨i_{k}⟩ \underrightarrow{.} D and ⟨m_{k}⟩ : ⟨i_{k}⟩ \underrightarrow{.} A, we write m : ⟨μ_{k}⟩ → ⟨m_{k}⟩ to indicate that m : D → A is a morphism of cones (that is, m ∘ μ_{k} = m_{k} for all k ∈ | ω |).

We now analyse ω-chains of partial maps and their lubs. Let ⟨[m_{k}, f_{k}] ⊏ ∼_{i_{k}} [m_{k+1}, f_{k+1}]⟩ be an ω-chain in pK(A, B). Then we have that ⟨i_{k}⟩ is an ω-chain in D, ⟨m_{k}⟩ : ⟨i_{k}⟩ \underrightarrow{.} A, and ⟨f_{k}⟩ : ⟨i_{k}⟩ \underrightarrow{.}_{≤}B. In diagram form,

D_{k} D_{k+1} i_{k}  f_{k+1} B ⊑  (k ∈ | ω |) f_{k} A  D_{k} D_{k+1} m_{k} m_{k+1}  i_{k}  (k ∈ | ω |) .

The Cpo-enrichment of K allows us to replace lax cones by cones. In fact, the lax cone ⟨f_{k}⟩ : ⟨i_{k}⟩ \underrightarrow{.}_{≤}B induces a cone ⟨F_{k}⟩ : ⟨i_{k}⟩ \underrightarrow{.} B such that —as we see below— the lub of the ω-chain of graph inclusions ⟨[m_{k}, F_{k}] ⊆_{i_{k}} [m_{k+1}, F_{k+1}]⟩ equals the lub of the original ω-chain ⟨[m_{k}, f_{k}] ⊏ ∼_{i_{k}} [m_{k+1}, f_{k+1}]⟩.

Intuitively, F_{k} improves f_{k} by taking into account the information of the f_{l}’s, for l ≥ k, restricted to D_{k}. Formally, define F_{k} = ⨆_{l≥k} f_{l} ∘ i_{k,l} where we write i_{k,l} for the composite i_{l−1} ∘ … ∘ i_{k}. Then, ⟨F_{k}⟩ : ⟨i_{k}⟩ \underrightarrow{.} B because, for every k ∈ | ω |,

F_{k} = ⨆_{l≥k+1} f_{l} ∘ i_{k,l}
= ⨆_{l≥k+1}(f_{l} ∘ i_{k+1,l} ∘ i_{k})
= ( ⨆_{l≥k+1} f_{l} ∘ i_{k+1,l}) ∘ i_{k}
= F_{k+1} ∘ i_{k}

Technically, F_{k} may not be f restricted to D_{k}, as F_{k} ⊑ f ∘ μ_{k} (see Proposition 4.3.3 (1)) but the equality need not hold (in Subsection 4.3.2 this oddity is removed by imposing a uniformity condition on the domain structure).

With the above notation we have:

Proposition 4.3.3 1. ⨆ [m_{k}, f_{k}] exists if and only if so does ⨆ [m_{k}, F_{k}] and they are equal.

2. For [n, g] : X ⇀ A, ⨆ ([m_{k}, f_{k}]∘[n, g]) exists if and only if so does ⨆ ([m_{k}, F_{k}]∘[n, g]) and they are equal.

Proof:

(1) Observe that for every k ∈ | ω |,

[m_{l}, f_{l}] ⊏ ∼_{μ_{l}} [m, f] for every l ≥ k ⇒ [m_{k}, F_{k}] ⊏ ∼_{μ_{k}} [m, f]  (4.3)

because assuming the antecedent, f_{l} ⊑ f ∘ μ_{l} and then, f_{l} ∘ i_{k,l} ⊑ f ∘ μ_{l} ∘ i_{k,l} = f ∘ μ_{k} for l ≥ k, yielding F_{k} ⊑ f ∘ μ_{k}.

Moreover, since for every k ∈ | ω |, [m_{k}, f_{k}] ⊏ ∼_{id} [m_{k}, F_{k}] it follows that

[m_{k}, f_{k}] ⊏ ∼_{μ_{k}} [m, f] for all k ∈ | ω | ⟺ [m_{k}, F_{k}] ⊏ ∼_{μ_{k}} [m, f] for all k ∈ | ω |

and we are done.

(2) By Proposition 4.3.3 (1), ⨆ ([m_{k}, f_{k}] ∘ [n, g]) = ⨆ [n ∘ g^{−1}(m_{k}), f_{k} ∘ (m_{k}^{∗}g)] exists if and only if so does ⨆ [n∘g^{−1}(m_{k}), H_{k}] and they are equal, where H_{k} = ⨆_{l≥k} f_{l}∘(m_{l}^{∗}g)∘j_{k,l} and [n ∘ g^{−1}(m_{k}), f_{k} ∘ (m_{k}^{∗}g)] ⊏ ∼_{j_{k}} [n ∘ g^{−1}(m_{k+1}), f_{k+1} ∘ (m_{k+1}^{∗}g)] as indicated in the following diagram

n  j_{k} g  f_{k+1} m_{k+1} m_{k+1}^{∗}g  f_{k} m_{k}^{∗}g ⊒ i_{k} m_{k}  .  (4.4)

To conclude the proof it is enough to show that H_{k} = F_{k} ∘ (m_{k}^{∗}g) because then [n ∘ g^{−1}(m_{k}), H_{k}] = [n ∘ g^{−1}(m_{k}), F_{k} ∘ (m_{k}^{∗}g)] = [n, g] ∘ [m_{k}, F_{k}].

But from (4.4), by induction, it follows that (m_{l}^{∗}g) ∘ j_{k,l} = i_{k,l} ∘ (m_{k}^{∗}g) for every l ≥ k and hence H_{k} = ⨆_{l≥k} f_{l} ∘ (m_{l}^{∗}g) ∘ j_{k,l} = ⨆_{l≥k} f_{l} ∘ i_{k,l} ∘ (m_{k}^{∗}g) = F_{k} ∘ (m_{k}^{∗}g). □

As mentioned at the beginning of Section 4.2, checking for continuity of composition on the left is more difficult than checking for continuity of composition on the right. This is reflected in the fact that the technique used to prove Proposition 4.3.3 does not extend to prove that ⨆ ([n, g] ∘ [m_{k}, f_{k}]) = ⨆ ([n, g] ∘ [m_{k}, F_{k}]) for every [n, g] : B ⇀ Y. For instance, a straight reduction of this equality to Proposition 4.3.3 (1) —as done for proving Proposition 4.3.3 (2)— is not possible because, for a start, there is no reason for which dom([n, g]∘[m_{k}, f_{k}]) = [m_{k} ∘f_{k}^{−1}(n)] equals dom([n, g]∘[m_{k}, F_{k}]) = [m_{k} ∘F_{k}^{−1}(n)].

4.3.2 Uniform Domain Structures

There are Cpo-categories of partial maps in which lubs do not behave as expected, the worst case being that the lub of an ω-chain of partial identities need not be a partial identity (i.e., for every A ∈ | K |, the partial-identity mapping [ , ] : D(A) → pK(A, A) need not be continuous). For an example, consider the Cpo-category K pictured as

0  ⋯ k 1  1 0  ⋯  k ω⊥ ⋯  ⋯  (k ∈ | ω |)

where ⊥ ⊏ ω, and hence forced to be idempotent. Then Monos_{K} = K \ {⊥} and p(K, Monos) Cpo-enriches. The only infinite chain is ⟨[k, k] ⊆ [k + 1, k + 1]⟩ in pK(ω, ω) and, contradicting all expectations, ⨆ [k, k] = [ω, ⊥] ⊏ [ω, ω].

The problem is that for an ω-chain ⟨[m_{k}] ⊆_{i_{k}:D_{k}↣D_{k+1}} [m_{k+1}]⟩ in D(A) with lub ⟨[m_{k}] ⊆_{μ_{k}:D_{k}↣D} [m]⟩ the universal property of lubs is not enough to capture the intuition that D = ⋃ D_{k}. Pursuing this intuition, given an | ω |-indexed family ⟨f_{k} : D_{k} → B⟩ such that f_{k+1} extends f_{k} (i.e., f_{k} = f_{k+1} ↾ D_{k}) there ought to be a unique uniform extension f : D → B of the f_{k}’s (i.e., f_{k} = f ↾ D_{k}).

In categorical terms, we are asking for the following property to hold:

If ⨆ ⟨[m_{k}] ⊆_{i_{k}} [m_{k+1}]⟩ = ⟨[m_{k}] ⊆_{μ_{k}:D_{k}↣D} [m]⟩ then

⟨μ_{k}⟩ : ⟨i_{k}⟩ \underrightarrow{.} D is colimiting in K.

(4.5)

A colimit as in (4.5) can be used to obtain lubs of ω-chains of admissible subobjects:

Lemma 4.3.4 Let ⟨[m_{k}] ⊆_{i_{k}} [m_{k+1}]⟩ be an ω-chain in D(A), and let ⟨μ_{k}⟩ be a colimit in K for ⟨i_{k}⟩. If the unique mediating morphism m : ⟨μ_{k}⟩ → ⟨m_{k}⟩ is admissible, then ⨆ [m_{k}] = [m].

Proof: The cone ⟨μ_{k}⟩ : ⟨i_{k} : m_{k} → m_{k+1}⟩ \underrightarrow{.} m is colimiting in D/A because the forgetful functor U_{A} : D/A → K reflects colimits. □

When (4.5) holds for all ω-chains of admissible subobjects, the domain structure is said to be uniform.

Definition 4.3.5 A domain structure (K, D) is said to be uniform if the forgetful functor U : Σ_{A ∈ |D|}D/A → K preserves colimits of ω-chains. □

The following should help in understanding uniformity:

Lemma 4.3.6 The domain structure (K, D) is uniform and D is locally a cpo if and only if p(K_{Poset}, D) has hom-cpos.

Proof:

(⇒) ⨆ ⟨[m_{k}, f_{k}] ⊆ [m_{k+1}, f_{k+1}]⟩ = [m, f] where ⨆ [m_{k}] = ⟨[m_{k}] ⊆_{μ_{k}} [m]⟩ and f : ⟨μ_{k}⟩ → ⟨f_{k}⟩.

(⇐) By Proposition 4.3.1, D is locally a cpo. Let ⟨[m_{k}] ⊆ [m_{k+1}]⟩ be an ω-chain in D(A) with lub ⟨[m_{k}] ⊆_{μ_{k}} [m]⟩, and let ⟨f_{k}⟩ : ⟨μ_{k}⟩ \underrightarrow{.} B in K. Then the ω-chain ⟨[m_{k}, f_{k}] ⊆ [m_{k+1}, f_{k+1}]⟩ in pK(A, B) has lub ⟨[m_{k}, f_{k}] ⊆_{μ_{k}} [m, f]⟩ for some f (because if ⨆ [m_{k}, f_{k}] = [n, g] then [m] = ⨆ [m_{k}] = [n]). Clearly f : ⟨μ_{k}⟩ → ⟨f_{k}⟩. To see that it is the unique such, let g : ⟨μ_{k}⟩ → ⟨f_{k}⟩ then [m_{k}, f_{k}] ⊆ [m, g] for every k ∈ | ω | and therefore [m, f] ⊆ [m, g]. Thus, f = g. □

It follows from the lemma that (Set, Monos), (Poset, Open), and (Cpo, Σ) are uniform. A non-example was given at the beginning of the subsection.

The next proposition exhibits the appropriateness of uniformity by showing that, for uniform domain structures, the partial-identity mapping is continuous. Various other consequences are also presented.

Proposition 4.3.7 Let (K, D) be a uniform Poset-domain-structure. If pK has homcpos, then for every A ∈ | K |, the partial-identity mapping [ , ] : D(A) → pK(A, A) is continuous.

Proof: Monotonicity is clear. For preservation of lubs, let ⟨[m_{k}] ⊆ [m_{k+1}]⟩ be an ω-chain in D(A).

Assume that ⨆ [m_{k}, m_{k}] = ⟨[m_{k}, m_{k}] ⊏ ∼ _{μ_{k}}[m, f]⟩. Then, by Proposition 4.3.1, ⨆ [m_{k}] = [m] and therefore we just need to check that f = m.

Since, [m, m] is an upper bound of the ω-chain ⟨[m_{k}, m_{k}] ⊆ [m_{k+1}, m_{k+1}]⟩ it follows that [m, f] ⊏ ∼ [m, m] and therefore f ⊑ m. Thus, f ∘ μ_{k} ⊑ m ∘ μ_{k} and since m ∘ μ_{k} = m_{k} ⊑ f ∘ μ_{k}, we get m ∘ μ_{k} = f ∘ μ_{k}; invoking uniformity the proof is finished. □

Proposition 4.3.8 Let (K, D) be a uniform Cpo-domain-structure. If pK Cpo-enriches, then

1. D( ) is a Cpo-functor K^{op} → Cpo.

2. If ⟨[m_{k}] ⊆ [m_{k+1}]⟩ is an ω-chain in D(A) with lub [m], then for every f, g : A → B,

f ∘ m_{k} ⊑ g ∘ m_{k} for every k ∈ | ω | if and only if f ∘ m ⊑ g ∘ m.

3. ⊆ is a subcpo of ⊏ ∼ .

Proof:

(1) By Proposition 4.3.1, D is locally a cpo. And D( )( ) is a composition of continuous maps, namely, dom([ , ] ∘ ) —by Propositions 4.3.2 (3) and 4.3.7.

(2) (⇒) For every k ∈ | ω |, f ∘ m_{k} ⊑ g ∘ m_{k} implies f ∘ [m_{k}, m_{k}] ⊏ ∼ g ∘ [m_{k}, m_{k}]. Then, f ∘ [m, m] = ⨆ f ∘ [m_{k}, m_{k}] ⊏ ∼ ⨆ g ∘ [m_{k}, m_{k}] = g ∘ [m, m] and therefore f ∘ m ⊑ g ∘ m.

(⇐) For every k ∈ | ω |, let [m_{k}] ⊆_{μ_{k}} [m]. Then,
f ∘ m_{k} = f ∘ m ∘ μ_{k} ⊑ g ∘ m ∘ μ_{k} = g ∘ m_{k}.

(3) For every A, B ∈ | pK |, by Propositions 4.3.1 and 4.3.6, (pK(A, B), ⊆) is a cpo. As ⊆ is a subposet of ⊏ ∼ , we only need to show that for every ω-chain ⟨[m_{k}, f_{k}] ⊆ [m_{k+1}, f_{k+1}]⟩ with lub ⟨[m_{k}, f_{k}] ⊆_{μ_{k}} [m, f]⟩ in (pK(A, B), ⊆)

[m_{k}, f_{k}] ⊏ ∼ _{ν_{k}}[n, g] for every k ∈ | ω | ⇒ [m, f] ⊏ ∼ [n, g].

Assuming the antecedent, [m_{k}] ⊆_{ν_{k}} [n] for every k ∈ | ω | and, because ⨆ [m_{k}] = [m], we have that [m] ⊆_{i} [n]. Finally, to show that f ⊑ g ∘ i observe that [m_{k}] ⊆_{ν_{k}} [n] and [m_{k}] ⊆_{μ_{k}} [m] ⊆_{i} [n] imply ν_{k} = i ∘ μ_{k}. Then, f ∘ μ_{k} = f_{k} ⊑ g ∘ ν_{k} = g ∘ i ∘ μ_{k} and since, by Proposition 4.3.2 (1), ⨆ [μ_{k}] = [id], using Proposition 4.3.8 (2) we are done. □

4.3.3 Characterisation of Cpo-Categories of Partial Maps induced by Uniform Domain Structures

Theorem 4.3.9 Let (K, D) be a uniform Cpo-domain-structure. Then,

p(K, D) Cpo-enriches with respect to ⊏ ∼

if and only if

1. p(K, D) Poset-enriches with respect to ⊏ ∼ ,

2. D( ) is a Cpo-functor K^{op} → Cpo, and

3. the colimits of ω-chains preserved by the forgetful functor U : Σ_{A∈| D |}D/A → K are Poset-colimits. □

That the three conditions above are necessary follows from Propositions 4.3.8 (1), 4.3.8 (2), 4.3.2 (1) and 2.2.1. We show that they are sufficient in a series of steps.

Remark. The idea behind the proof is simple though one has to go through a series of long calculations.

• For showing that every hom-poset is a cpo, by Proposition 4.3.3 (1), we reduce the general case to finding lubs of chains of graph inclusions. Intuitively, the lub of a chain of graph inclusions is the partial map with domain of definition the union of the domains of definition of the partial maps in the chain, and with total component the unique uniform extension of the total components of the partial maps in the chain. (Recall that such extensions exist by the uniformity of the domain structure.)

• For showing that composition on the right is continuous, by Proposition 4.3.3 (2), the general case is reduced to the graph inclusion case which, in turn, is proved by calculating the relevant lub with the above recipe.

• For showing that composition on the left is continuous the problem is broken down in more subcases. We show that composition on the left with total maps is continuous, and that composition on the left with partial inclusions is continuous for total maps. This allows us to reduce the general case to the graph inclusion case. Then, after proving that composition on the left is continuos for chains of graph inclusions the general case is established.

Until the end of this subsection, let (K, D) be a uniform Cpo-domain-structure.

Hom-posets are cpos

Lemma 4.3.10 (The graph inclusion case) Let D be locally a cpo, and let K be Poset-enriched. Assume that U maps colimits of ω-chains to Poset-colimits. For an ω-chain ⟨[m_{k}, f_{k}] ⊆ [m_{k+1}, f_{k+1}]⟩,

⨆ [m_{k}, f_{k}] = ⟨[m_{k}, f_{k}] ⊏ ∼_{μ_{k}} [m, f]⟩ ⟺ ⨆ [m_{k}] = ⟨[m_{k}] ⊆_{μ_{k}} [m]⟩ and f : ⟨μ_{k}⟩ → ⟨f_{k}⟩.

Proof:

(⇒) ⨆ [m_{k}] = ⟨[m_{k}] ⊆_{μ_{k}} [m]⟩ because dom preserves lubs of ω-chains —see Proposition 4.3.2 (3). Since U preserves colimits of ω-chains, it follows that ⟨μ_{k}⟩ is a colimiting cone. Let g : ⟨μ_{k}⟩ → ⟨f_{k}⟩, then [m, g] is an upper bound of the ω-chain ⟨[m_{k}, f_{k}] ⊆ [m_{k+1}, f_{k+1}]⟩ and therefore f ⊑ g. Thus, f ∘ μ_{k} ⊑ g ∘ μ_{k} = f_{k}, and since f_{k} ⊑ f ∘ μ_{k}, it follows that f : ⟨μ_{k}⟩ → ⟨f_{k}⟩.

(⇐) By construction, [m, f] is an upper-bound of ⟨[m_{k}, f_{k}] ⊆ [m_{k+1}, f_{k+1}]⟩. It is also the least, for assuming that [m_{k}, f_{k}] ⊏ ∼_{ν_{k}} [n, g], it follows that [m_{k}] ⊆_{ν_{k}} [n], and therefore [m] ⊆_{i} [n]. Thus, ν_{k} = i ∘ μ_{k} and then f ∘ μ_{k} ⊑ g ∘ i ∘ μ_{k} for every k ∈ | ω |. Finally, since ⟨μ_{k}⟩ is a Poset-colimit, we conclude that f ⊑ g ∘ i. □

Proposition 4.3.11 (Hom-posets are cpos) Let D be locally a cpo, and let K be Cpo-enriched. If U maps colimits of ω-chains to Poset-colimits, then every hom-poset in pK is a cpo.

Proof: Follows from Lemma 4.3.10 and Proposition 4.3.3 (1). □

Composition on the right is continuous

Proposition 4.3.12 Let K be Cpo-enriched. Assume that U maps colimits of ω-chains to Poset-colimits, and that D( ) is a functor K^{op} → Cpo. Then,

1. (Composition on the right is continuous for ω-chains of graph inclusions) for every ω-chain ⟨[m_{k}, f_{k}] ⊆ [m_{k+1}, f_{k+1}]⟩ in pK(B, C), and every [n, g] : A ⇀ B,

(⨆ [m_{k}, f_{k}]) ∘ [n, g] = ⨆ ([m_{k}, f_{k}] ∘ [n, g]).

2. (Composition on the right is continuous) pK( , A) is a functor pK^{op} → Cpo for every A ∈ | pK |.

Proof:

(1) Let ⨆ [m_{k}, f_{k}] = ⟨[m_{k}, f_{k}] ⊏ ∼_{μ_{k}} [m, f]⟩. By Lemma 4.3.10, ⨆ [m_{k}] = ⟨[m_{k}] ⊆_{μ_{k}} [m]⟩ and f : ⟨μ_{k}⟩ → ⟨f_{k}⟩.

By Corollary 4.2.5, ⟨[m_{k}, f_{k}] ∘ [n, g] ⊆ [m_{k+1}, f_{k+1}] ∘ [n, g]⟩ is an ω-chain. To prove

⨆ [n ∘ g^{−1}(m_{k}), f_{k} ∘ (m_{k}^{∗}g)] = [n ∘ g^{−1}(m), f ∘ (m^{∗}g)]

we will, again, use Lemma 4.3.10.

First,

⨆ [n ∘ g^{−1}(m_{k})] = [n ∘ g^{−1}(m)]

by Proposition 4.3.2 (2) and the continuity of D(g).

Second, assume that n ∘ g^{−1}(m_{k}) ⊆_{ν_{k}} n ∘ g^{−1}(m). Since f : ⟨μ_{k}⟩ → ⟨f_{k}⟩, it follows that

f_{k} m_{k}^{∗}g ν_{k}  μ_{k} f m^{∗}g

and therefore f ∘ (m^{∗}g) : ⟨ν_{k}⟩ → ⟨f_{k} ∘ (m_{k}^{∗}g)⟩.

(2) For every ω-chain ⟨[m_{k}, f_{k}] ⊏ ∼ [m_{k+1}, f_{k+1}]⟩ in pK(C, A) and [n, g] : B ⇀ C, by Lemma 4.2.1, ⟨[m_{k}, f_{k}] ∘ [n, g] ⊏ ∼ [m_{k+1}, f_{k+1}] ∘ [n, g]⟩ is an ω-chain in pK(B, A). And, we have

(⨆ [m_{k}, f_{k}]) ∘ [n, g] = (⨆ [m_{k}, F_{k}]) ∘ [n, g] , by Proposition 4.3.3 (1)
= ⨆ ([m_{k}, F_{k}] ∘ [n, g]) , by Proposition 4.3.12 (1)
= ⨆ ([m_{k}, f_{k}] ∘ [n, g]) , by Proposition 4.3.3 (2).  □

Composition on the left is continuous

Proposition 4.3.13 Let D be locally a cpo, let K be Cpo-enriched, and let pK be Poset-enriched. Assume that U maps colimits of ω-chains to Poset-colimits. Then,

1. (Composition on the left with total maps is continuous) pK(A, ) is a functor K → Cpo for every A ∈ | pK |.

2. (Composition on the left with partial inclusions is continuous for total maps) For A ∈ | K | and m ∈ D(D, B), if the mapping D( )[m] : K(A, B) → D(A) is continuous, then so is the mapping m^{R} ∘ : K(A, B) → pK(A, D).

3. (Reduction to the graph inclusion case) If D( ) is a Cpo-functor K^{op} → Cpo, then for every ω-chain ⟨[m_{k}, f_{k}] ⊏ ∼_{i_{k}} [m_{k+1}, f_{k+1}]⟩ in pK(A, B) and [n, g] : B ⇀ C,

⨆ ([n, g] ∘ [m_{k}, f_{k}]) = ⨆ ([n, g] ∘ [m_{k}, F_{k}])

where F_{k} = ⨆_{l≥k} f_{l} ∘ i_{k,l}.

4. Order-Enriched Categories of Partial Maps 81

Proof:

(1) Let ⟨[m_{k}, f_{k}] ⊏ ∼_{i_{k}} [m_{k+1}, f_{k+1}]⟩ be an ω-chain in pK(A, B).

By Proposition 4.3.3 (1) and Lemma 4.3.10, we have that ⨆ [m_{k}, f_{k}] = [m, f] where ⨆ [m_{k}] = ⟨[m_{k}] ⊆_{μ_{k}} [m]⟩ and f : ⟨μ_{k}⟩ → ⟨⨆_{l≥k} f_{l} ∘ i_{k,l}⟩.

Then, g ∘ f : ⟨μ_{k}⟩ → ⟨⨆_{l≥k}(g ∘ f_{l}) ∘ i_{k,l}⟩ and, again by Proposition 4.3.3 (1) and Lemma 4.3.10, ⨆ [m_{k}, g ∘ f_{k}] = [m, g ∘ f].

(2) m^{R} ∘ is monotone because pK is Poset-enriched.

For the preservation of lubs, if ⟨f_{k}⟩ is an ω-chain in K(A, B), writing f for ⨆ f_{k}, we must prove

⨆ [f_{k}^{−1}(m), m^{∗}f_{k}] = [f^{−1}(m), m^{∗}f].

The ω-chain ⟨[f_{k}^{−1}(m), m^{∗}f_{k}] ⊏ ∼ [f_{k+1}^{−1}(m), m^{∗}f_{k+1}]⟩ in pK(A, D) has [f^{−1}(m), m^{∗}f] as an upper bound because the composition of partial maps is monotone. To see that it is the least, assume [f_{k}^{−1}(m), m^{∗}f_{k}] ⊏ ∼_{μ_{k}} [f^{−1}(m), m^{∗}f] and [f_{k}^{−1}(m), m^{∗}f_{k}] ⊏ ∼_{ν_{k}} [n, g].

First, [f_{k}^{−1}(m)] ⊆_{ν_{k}} [n] and therefore, [f^{−1}(m)] ⊆_{i} [n], by the continuity of D( )[m]. Second, we will show that m^{∗}f ⊑ g ∘ i. The inequalities [f_{k}^{−1}(m)] ⊆_{μ_{k}} [f^{−1}(m)] ⊆_{i} [n] and [f_{k}^{−1}(m)] ⊆_{ν_{k}} [n], imply ν_{k} = i ∘ μ_{k}.

So we have

f_{k}  m μ_{k}  g n  i ⊑  .

Thus, f_{k} ∘ n ∘ i ∘ μ_{k} ⊑ m ∘ g ∘ i ∘ μ_{k} for every k ∈ | ω |, and since ⟨μ_{k}⟩ is a Poset-colimit, we conclude that m ∘ g ∘ i is an upper bound of the ω-chain ⟨f_{k} ∘ n ∘ i⟩. On the other hand, ⨆ (f_{k} ∘ n ∘ i) = f ∘ n ∘ i = f ∘ f^{−1}(m) = m ∘ (m^{∗}f).

Then, m ∘ (m^{∗}f) ⊑ m ∘ g ∘ i, and since m is full we are done.

(3) We proceed via two calculations:

First,

⨆_{k≥0}(n^{R} ∘ [m_{k}, F_{k}]) = ⨆_{k≥0}(n^{R} ∘ (⨆_{l≥k} f_{l} ∘ i_{k,l}) ∘ m_{k}^{R})
= ⨆_{k≥0} ((⨆_{l≥k} n^{R} ∘ f_{l} ∘ i_{k,l}) ∘ m_{k}^{R}) , by Proposition 4.3.13 (2)
= ⨆_{k≥0} ⨆_{l≥k}(n^{R} ∘ f_{l} ∘ i_{k,l} ∘ m_{k}^{R}) , by Proposition 4.3.12 (2)
= ⨆_{k≥0}(n^{R} ∘ f_{k} ∘ m_{k}^{R})
= ⨆_{k≥0}(n^{R} ∘ [m_{k}, f_{k}]).

Second,

⨆ ([n, g] ∘ [m_{k}, f_{k}]) = ⨆ (g ∘ n^{R} ∘ [m_{k}, f_{k}])
= g ∘ ⨆ (n^{R} ∘ [m_{k}, f_{k}]) , by Proposition 4.3.13 (1)
= g ∘ ⨆ (n^{R} ∘ [m_{k}, F_{k}]) , by the previous calculation
= ⨆ (g ∘ n^{R} ∘ [m_{k}, F_{k}]) , by Proposition 4.3.13 (1)
= ⨆ ([n, g] ∘ [m_{k}, F_{k}]).  □

Proposition 4.3.14 (Composition on the left is continuous for ω-chains of graph inclusions) Let K be Cpo-enriched. Assume that U maps colimits of ω-chains to Poset-colimits, and that D( ) is a functor K^{op} → Cpo. Then, for every ω-chain ⟨[m_{k}, f_{k}] ⊆_{i_{k}} [m_{k+1}, f_{k+1}]⟩ in pK(A, B) and [n, g] : B ⇀ C,

⨆ ([n, g] ∘ [m_{k}, f_{k}]) = [n, g] ∘ ⨆ [m_{k}, f_{k}].

Proof: Let ⨆ [m_{k}, f_{k}] = ⟨[m_{k}, f_{k}] ⊏ ∼_{μ_{k}} [m, f]⟩.

By Corollary 4.2.5, ⟨[n, g] ∘ [m_{k}, f_{k}] ⊆ [n, g] ∘ [m_{k+1}, f_{k+1}]⟩ is an ω-chain. To prove

⨆ [m_{k} ∘ f_{k}^{−1}(n), g ∘ (n^{∗}f_{k})] = [m ∘ f^{−1}(n), g ∘ (n^{∗}f)]

we will use Lemma 4.3.10.

If [m_{k} ∘ f_{k}^{−1}(n)] ⊆_{j_{k}} [m_{k+1} ∘ f_{k+1}^{−1}(n)] then to show ⨆ [m_{k} ∘ f_{k}^{−1}(n)] = [m ∘ f^{−1}(n)], by Lemma 4.3.4, it is enough to find a colimiting cone for ⟨j_{k}⟩, say ⟨ν_{k}⟩, such that m ∘ f^{−1}(n) : ⟨ν_{k}⟩ → ⟨m_{k} ∘ f_{k}^{−1}(n)⟩.

We have

f_{k}^{−1}(n)  j_{k}i_{k} f_{k+1}^{−1}(n)  n^{∗}f_{k} n^{∗}f_{k+1} f_{k} m_{k+1} m_{k}  f_{k+1} n

and so

f_{k}^{−1}(n)  f_{k+1}^{−1}(n) i_{k} j_{k}  .

Moreover, by Lemma 4.3.10, f : ⟨μ_{k}⟩ → ⟨f_{k}⟩, and therefore for every k ∈ | ω | we have

f^{−1}(n) μ_{k} ν_{k} f_{k}^{−1}(n)  f  n n^{∗}f n^{∗}f_{k} f_{k}  (4.6)

for some unique ν_{k}.

The complete picture is as follows

j_{k}i_{k} m_{k+1} f_{k+1}^{−1}(n) f_{k}^{−1}(n) m f^{−1}(n) μ_{k} ν_{k}  μ_{k+1} ν_{k+1}  m_{k}  .

Thus, ⟨ν_{k}⟩ is a cone for ⟨j_{k}⟩ and m ∘ f^{−1}(n) : ⟨ν_{k}⟩ → ⟨m_{k} ∘ f_{k}^{−1}(n)⟩.

Finally, recall that by Lemma 4.3.10, ⨆ [m_{k}] = ⟨[m_{k}] ⊆_{μ_{k}} [m]⟩ and so, by Proposition 4.3.2 (1), ⨆ [μ_{k}] = [id]. Since, by construction, ν_{k} is obtained by pulling back μ_{k} along f^{−1}(n), and D(f^{−1}(n)) is continuous, it follows that ⨆ [ν_{k}] = [id]. Hence, since U preserves colimits of ω-chains, ⟨ν_{k}⟩ is a colimit for ⟨j_{k}⟩.

To complete the proof, by Lemma 4.3.10, we need only check whether g ∘(n^{∗}f) : ⟨ν_{k}⟩ → ⟨g ∘(n^{∗}f_{k})⟩. This follows because (n^{∗}f)∘ν_{k} = n^{∗}f_{k} —see diagram (4.6).

□

Proposition 4.3.15 (Composition on the left is continuous) Let K be Cpo-enriched and let pK be Poset-enriched. Assume that U maps colimits of ω-chains to Poset-colimits and that D( ) is a Cpo-functor K^{op} → Cpo. Then, pK(A, ) is a functor pK → Cpo for every A ∈ | pK |.

Proof: Because for every ω-chain ⟨[m_{k}, f_{k}] ⊏ ∼ [m_{k+1}, f_{k+1}]⟩ in pK(A, B), and every [n, g] : B ⇀ C, we have

[n, g] ∘ ⨆ [m_{k}, f_{k}] = [n, g] ∘ ⨆ [m_{k}, F_{k}] , by Proposition 4.3.3 (1)
= ⨆ ([n, g] ∘ [m_{k}, F_{k}]) , by Proposition 4.3.14
= ⨆ ([n, g] ∘ [m_{k}, f_{k}]) , by Proposition 4.3.13 (3).  □

4.3.4 Computing Lubs of ω-Chains of Partial Maps

A by-product of the above characterisation is a recipe for computing lubs of ω-chains of partial maps in Cpo-categories of partial maps induced by uniform Cpo-domain-structures:

Proposition 4.3.16 Let (K, D) be a uniform Cpo-domain-structure such that pK Cpo-enriches. For every ω-chain ⟨[m_{k}, f_{k}] ⊏ ∼_{i_{k}} [m_{k+1}, f_{k+1}]⟩,

⨆ [m_{k}, f_{k}] = ⟨[m_{k}, f_{k}] ⊏ ∼_{μ_{k}:D_{k}↣D} [m, f]⟩

if and only if

⟨μ_{k}⟩ : ⟨i_{k}⟩ \underrightarrow{.} D is colimiting in K, m : ⟨μ_{k}⟩ → ⟨m_{k}⟩ and f : ⟨μ_{k}⟩ → ⟨F_{k}⟩
where F_{k} = ⨆_{l≥k} f_{l} ∘ i_{k,l}.

Proof: Follows from Proposition 4.3.3 (1) and Lemma 4.3.10. □

4.4 Enrichment with respect to Specialisation

In this section the characterisation theorem of Cpo-categories of partial maps (Theorem 4.3.9) is applied when the order is specialisation. As will be shown, Posetenrichment is immediate, whilst Cpo-enrichment requires that the operation of pulling back admissible monos along arbitrary maps be continuous.

Proposition 4.4.1 Let (K, D) be a domain structure. Then, K and pK Preorder-enrich with respect ⊑^{s} and ⊏ ∼^{s} respectively.

Thus, if ⊑^{s} is antisymmetric, K and pK Poset-enrich with respect ⊑^{s} and ⊏ ∼^{s} respectively.

Proof: It is enough to see that pK Preorder-enriches with respect to ⊏ ∼^{s} .

This follows because ⊏ ∼^{s} is a preorder and, for u : X ⇀ A, v ⊏ ∼^{s} v′ : A ⇀ B and w : B ⇀ Y, we have that

v ⊏ ∼^{s} v′ ⟺ D(v) ⊆ D(v′)
⟹ D(w ∘ v ∘ u) = D(u) ∘ D(v) ∘ D(w) ⊆ D(u) ∘ D(v′) ∘ D(w)
⟺ w ∘ v ∘ u ⊏ ∼^{s} w ∘ v′ ∘ u.  □

Proposition 4.4.2 Let (K, D) be a uniform domain structure. If D is locally a cpo, K has hom-cpos with respect to ⊑^{s}, and for every A, B ∈ | K |, the mapping D( )( ) : K(A, B) × D(B) → D(A) is continuous, then K and pK Cpo-enrich with respect to ⊑^{s} and ⊏ ∼^{s} respectively.

Proof: By Proposition 4.4.1, K Poset-enriches. By hypothesis every hom in K is a cpo. Moreover, using the fact that D( ) : K(A, B) → Cpo(D(B), D(A)) is injective, we have that

• since for every m : D ↣ B in D, the mapping D( )[m] : K(A, B) → D(A) is continuous, then so is composition on the left in K; and,

• since, in addition, for every f : A → B, the mapping D(f) : D(B) → D(A) is continuous, it follows that so is composition on the right in K.

Therefore, K Cpo-enriches.

By Proposition 4.4.1, pK Poset-enriches.

Finally, for every ω-chain ⟨[m_{k}] ⊆ [m_{k+1}]⟩ for which [m_{k}] ⊆_{μ_{k}:D_{k}→D} ⨆ [m_{k}] we show that for f, f′ : D → B,

f ∘ μ_{k} ⊑^{s} f′ ∘ μ_{k} for every k ∈ | ω | ⇒ f ⊑^{s} f′.  (4.7)

This will establish item (3) of Theorem 4.3.9 and, by invoking this theorem, conclude the proof of the proposition.

For [m] ∈ D(B), let D(f)[m] = [n] and let D(f′)[m] = [n′]. Assuming the antecedent of (4.7), it follows that D(μ_{k})[n] = D(f ∘ μ_{k})[m] ⊆ D(f′ ∘ μ_{k})[m] = D(μ_{k})[n′] and therefore [n ∘ n^{−1}(μ_{k})] = [μ_{k} ∘ μ_{k}^{−1}(n)] ⊆ [μ_{k} ∘ μ_{k}^{−1}(n′)] = [n′ ∘ n^{′−1}(μ_{k})]. Then,

D(f)[m] = ⨆ [n ∘ n^{−1}(μ_{k})] , because [n ∘ ] and D(n) are continuous,
⨆ [μ_{k}] = [id] and n^{−1}[id] = [id].
⊆ ⨆ [n′ ∘ n^{′−1}(μ_{k})]
= D(f′)[m].  □

4.5 Cpo-Categories of Partial Maps Revisited

Cpo-categories of partial maps are revisited in the light of representability. The idea is to regard pK as a subcategory of K via the lifting functor and see whether the Cpo-enrichment of K restricts to this subcategory.

We know, by Proposition 4.1.3 (4), that J : K → pK locally preserves lubs of ω-chains but, what about its right adjoint?

Proposition 4.5.1 If χ : J ⊣ L : pK → K is a Poset-adjunction, then L locally preserves lubs.

Proof: By Theorem 3.2.6, ε_{A} = η_{A}^{R}. So for every A, B ∈ | pK |,

∘ ε_{A} ⊣ ∘ η_{A} : pK(LA, B) → pK(A, B)

and thus ∘ ε_{A} preserves lubs. Since also χ_{A,B} preserves lubs (as it is an isomorphism in Poset), and L_{A,B}( ) = χ_{A,B}( ∘ ε_{A}) we are done. □

Now let χ : J ⊣ L : pK → K be a Poset-adjunction. Then,

• hom-posets are cpos, as: for every ω-chain ⟨u_{k}⟩ in pK(A, B),

⨆_{pK} u_{k} = ε_{B} ∘ ( ⨆_{K} χ(u_{k}));

• composition on the left is continuous, as: for every ω-chain ⟨u_{k}⟩ in pK(A, B) and v : B ⇀ Y,

⨆_{pK}(v ∘ u_{k}) = ε_{Y} ∘ ( ⨆_{K} χ(v ∘ u_{k})) = ε_{Y} ∘ ( ⨆_{K}(Lv) ∘ χ(u_{k}))
= ε_{Y} ∘ (Lv) ∘ (⨆_{K} χu_{k}) = v ∘ ε_{B} ∘ (⨆_{K} χu_{k})
= v ∘ (⨆_{pK} u_{k}).

• composition on the right is continuous, as: for every ω-chain ⟨u_{k}⟩ in pK(A, B) and v : X ⇀ A,

⨆_{pK}(u_{k} ∘ v) = ε_{B} ∘ ( ⨆_{K} χ(u_{k} ∘ v))
= ε_{B} ∘ (⨆_{K} L(u_{k}) ∘ χv)
= ε_{B} ∘ ( ⨆_{K} L(u_{k})) ∘ χv
= ε_{B} ∘ L(⨆_{pK} u_{k}) ∘ χv , because L locally preserves lubs
= (⨆_{pK} u_{k}) ∘ ε_{A} ∘ χv
= (⨆_{pK} u_{k}) ∘ v.

As the next proposition shows, all these calculations can be avoided.

Proposition 4.5.2 Let F ⊣ U : L → K be a Poset-adjunction with F bijective on objects. If K is Cpo-enriched and UF is a Cpo-functor, then L Cpo-enriches.

Proof: Let 𝕋 be the monad induced by F ⊣ U. By a Poset-enriched version of Proposition 3.2.9, we have that L ≅ K_{𝕋} in Poset-CAT. Since UF is a Cpo-functor, it follows that K_{𝕋} is Cpo-enriched and therefore so is L. □

Corollary 4.5.3 If J ⊣ L : pK → K is a Poset-adjunction and K is Cpo-enriched then pK Cpo-enriches. □

Unfortunately, not every adjunction J ⊣ L : pK → K in CAT enriches to one in Poset-CAT. For example, χ : J ⊣ L : Pfn → Set is not a Poset-adjunction because χ_{A,B} is not a monotone function (Pfn(A, B), ⊆) → (Set(A, LB), =). In fact, this is all that can fail:

Proposition 4.5.4 Let K and pK be Poset-enriched and let χ : J ⊣ L : pK → K, then J ⊣ L is a Poset-adjunction if and only if for every A, B ∈ | K |, the bijection χ_{A,B} is monotone.

Proof:

(⇒) Obvious.

(⇐) Because for every A, B ∈ | K |, χ_{A,B}^{−1} = ε_{B} ∘ : K(A, LB) → pK(A, B) is monotone. □

Again we pay particular attention to enrichment with respect to specialisation. For this purpose we consider maximal partial map classifiers.

Definition 4.5.5 Let η, ε : J ⊣ L : pK → K. Then, η is said to be maximal if for every A ∈ | K |, η_{A} is maximal among all proper (i.e., non-maximal) admissible monos of LA.

□

With the purpose of characterising maximal units we introduce some notation: for a poset P, let P^{⊤} denote the poset resulting from adjoining a new top element to P; and, for every poset with top element Q and every monotone f : P → Q, let f^{#} : P^{⊤} → Q denote the unique top-preserving monotone extension of f.

Proposition 4.5.6 Let η, ε : J ⊣ L : p(K, D) → K. Then, η is maximal if and only if for every A ∈ | K |, either [η_{A}] = [id_{LA}] or [η_{A} ∘ ]^{#} : D(A)^{⊤} → D(LA) is an isomorphism in Poset.

Proof:

(⇒) Let A ∈ | K |.

If [η_{A}] = [id_{LA}] we are done.

Assume η_{A} ⊂ id_{LA}. By maximality, for all proper m ∈ D/LA there exists a unique i ∈ D/A such that η_{A} ∘ i = m and therefore [η_{A} ∘ ] : D(A) → D(LA) \ { [id_{LA}] } is a bijection. It is monotone and so is its inverse because, for every i, j ∈ D/A,

i ⊆ j ⟺ η_{A} ∘ i ⊆ η_{A} ∘ j.

Hence, [η_{A} ∘ ]^{#} : D(A)^{⊤} → D(LA) is an isomorphism in Poset.

(⇐) For every A ∈ | K |, either [η_{A}] = [id_{LA}] and therefore η_{A} is maximal, or the isomorphism [η_{A} ∘ ]^{#} restricts to a bijection from D(A) to D(LA)\{[id_{LA}]}, establishing the maximality of η_{A}. □

It follows then, that the unit of J ⊣ L : Pfn → Set is not maximal, and that the units of J ⊣ L : pPoset → Poset and J ⊣ L : pCpo → Cpo are.

Observe that the condition [η_{A}] = [id_{LA}] in the characterisation is not vacuous since, for example, J ⊣ L : p(K, Isos_{K}) ≅ K has a maximal unit η ≅ id. The other condition, [η_{A} ∘ ]^{#} : D(A)^{⊤} ≅ D(LA), is appealing as it states that the observable properties of LA are the observable properties of A together with a new observable property, [id_{LA}], providing no information. This yields an appropriate computational interpretation of lifting; internalising the operation on locales corresponding to lifting of cpos (viz., to add a new top element —see [Rob87]). (For a discussion on how this approach might extend to powerdomains see Section 10.6.)

The main property of maximal units follows:

Proposition 4.5.7 Let χ : J ⊣ L : pK → K. If the unit of this adjunction is maximal, then for every A, B ∈ | K |, the bijection χ_{A,B} preserves the specialisation preorder.

Proof: Let u ⊏ ∼^{s} v : A ⇀ B. We need show that D(χu)[m] ⊆ D(χv)[m] for every [m] ∈ D(LB).

The case [m] = [id] is vacuously satisfied. Assume m is a proper mono and let m ⊆_{i} η_{B}. Then, as pK is Preorder-enriched with respect to ⊏ ∼^{s} (see Proposition 4.4.1) we have that

m^{R} ∘ χu = i^{R} ∘ η_{B}^{R} ∘ χu = i^{R} ∘ u ⊏ ∼^{s} i^{R} ∘ v = m^{R} ∘ χv

and the result follows. □

Finally, we have:

Theorem 4.5.8 Let K be Cpo-enriched with respect to ⊑^{s}. If η, ε : J ⊣ L : pK → K and η is maximal, then pK Cpo-enriches with respect to ⊏ ∼^{s} .

Proof: Follows from Proposition 4.5.7, Proposition 4.5.4, and Corollary 4.5.3. □

5 Data Types

In this chapter we study the categorical constructions for interpreting data types. We start by observing that the notion of pairing in a category of partial maps (with a minimum of structure) cannot be the categorical product. The appropriate interpretation for product types (partial products) is the categorical product in the category of total maps endowed with a pairing operation on partial maps extending the pairing of total maps. Once the notion of product is established, partial exponentials are defined as usual, and some properties of Poset-partial-exponentials are presented. Next colimits are studied. The situation is completely different from that of limits. For example, an object is initial in the category of total maps if and only if it is so in the category of partial maps. A characterisation of certain colimits (including coproducts) in a category of partial maps, due to Gordon Plotkin, is given. We further relate colimits in the category of total maps and colimits in the category of partial maps by means of the lifting functor. Finally, we provide conditions on a Cpo-category of partial maps under which ω-chains of embeddings have colimits. This is done in the presence of the lifting functor, and for arbitrary categories of partial maps.

5.1 Partial Binary Products

The data type for pairing in pK cannot be the categorical product because, under reasonable assumptions, this would lead to inconsistency. For example, if pK has a zero object (which we think of modelling the recursive data type μT.T) and is cartesian closed, then for every A ∈ | pK |,

A ≅ 0 × A , because 0 is terminal and × is the categorical product
≅ 0  , because 0 is initial and × A preserves colimits.

Then, pK ≃ 1. (In particular, as every algebraically compact category has a zero object (see Definition 6.2.2 (1) and Proposition 6.2.4), it follows that cartesian closure is inconsistent with algebraic compactness.)

Writing A_{1} ⊗ A_{2} for the data type representing pairs of elements of A_{1} and A_{2}, we expect that to give a pair of generalised elements, (X → A_{1}, X → A_{2}), of A_{1} and A_{2} corresponds precisely to give a generalised element, X → A_{1} ⊗ A_{2}, of A_{1} ⊗ A_{2}. That is, A_{1} ⊗ A_{2} is the categorical product in the category of total maps. But, this is meaningful because there is a pairing operation for partial maps: in the situation

A_{1} ⊗ A_{2}  A^{2} A^{1}π_{1}  B u  v π_{2}  ,  (5.1)

the partial pairing of u = [m, f] and v = [n, g] is the partial map

⟨⟨u, v⟩⟩ = [m ∩ n, ⟨f ∘ m^{−1}(n), g ∘ n^{−1}(m)⟩] : B ⇀ A_{1} ⊗ A_{2}  (5.2)

where ⟨ , ⟩ is the pairing of total maps and π_{i} (i = 1, 2) are the corresponding projections. Intuitively,

⟨⟨u, v⟩⟩(x) = \{ \begin{matrix}(u(x), v(x)) & , if x ∈ dom(u) ∩ dom(v). \\ undefined & , otherwise. \end{matrix}

so that the pairing is strict.

By definition, the partial pairing extends the pairing of total maps as, for f : B → A_{1} and g : B → A_{2}, it follows that ⟨f, g⟩ = ⟨⟨f, g⟩⟩.

Combining (5.1) and (5.2) into one diagram we obtain

D_{1} ∩ D_{2} D_{1}  n m^{−1}(n)  n^{−1}(m) D_{2} m  m ∩ n A^{1} f  g B u  v A_{1} ⊗ A_{2}  A^{2} π_{2} π_{1}  ^{⟨f ∘ m^{−1}(n), g ∘ n^{−1}(m)⟩}

showing that

π_{1} ∘ ⟨⟨[m, f], [n, g]⟩⟩ = [m ∩ n, f ∘ m^{−1}(n)],  (5.3)
π_{2} ∘ ⟨⟨[m, f], [n, g]⟩⟩ = [m ∩ n, g ∘ n^{−1}(m)].  (5.4)

Convention. For the sake of readability we will write [D ↣ B, D → A] for a partial map B ⇀ A whenever the maps D ↣ B and D → A are clear from the context. Thus, for example, with this notation the above two equations become π_{1} ∘ ⟨⟨[D_{1} ↣ B, D_{1} → A_{1}], [D_{2} ↣ B, D_{2} → A_{2}]⟩⟩ = [D_{1} ∩ D_{2} ↣ B, D_{1} ∩ D_{2} ↣ D_{1} → A_{1}], π_{2} ∘ ⟨⟨[D_{1} ↣ B, D_{1} → A_{1}], [D_{2} ↣ B, D_{2} → A_{2}]⟩⟩ = [D_{1} ∩ D_{2} ↣ B, D_{1} ∩ D_{2} ↣ D_{2} → A_{2}].

The following properties of the partial pairing are folklore: Proposition 5.1.1 Let u_{i} : B ⇀ A_{i}, v_{i} : A_{i} ⇀ A′_{i} (i = 1, 2), and v : B′ ⇀ B. Then,

1. π_{1} ∘ ⟨⟨u_{1}, u_{2}⟩⟩ = π_{2} ∘ ⟨⟨u_{2}, u_{1}⟩⟩.

2. π_{i} ∘ ⟨⟨u_{1}, u_{2}⟩⟩ ⊆ u_{i} (i = 1, 2).

3. dom(u_{1}) ⊆ dom(u_{2}) ⟺ π_{1} ∘ ⟨⟨u_{1}, u_{2}⟩⟩ = u_{1}.

4. u_{i} : B → A_{i} (i = 1, 2) ⟺ ⟨⟨u_{1}, u_{2}⟩⟩ : B → A_{1} ⊗ A_{2}.

5. Data Types 94 5. ⟨⟨u_{1}, u_{2}⟩⟩ ∘ v = ⟨⟨u_{1} ∘ v, u_{2} ∘ v⟩⟩.

6. ⟨⟨v_{1} ∘ π_{1} ∘ ⟨⟨u_{1}, u_{2}⟩⟩, v_{2} ∘ π_{2} ∘ ⟨⟨u_{1}, u_{2}⟩⟩⟩⟩ = ⟨⟨v_{1} ∘ u_{1}, v_{2} ∘ u_{2}⟩⟩.

7. The product functor × : K ×K → K extends to a functor ⊗ : pK ×pK → pK sending a pair of objects (A, B) to A × B and a pair of partial maps (u, v) to ⟨⟨u ∘ π_{1}, v ∘ π_{2}⟩⟩. Moreover, [m, f] ⊗ [n, g] = [m × n, f × g].

Proof:

(1)–(3) Follow from (5.3) and (5.4).

(4) (⇒) Clear as the partial pairing extends the pairing of total maps.

(⇐) By Proposition 5.1.1 (2), π_{i} ∘ ⟨⟨u_{1}, u_{2}⟩⟩ ⊆ u_{i}, and since π_{i} ∘ ⟨⟨u_{1}, u_{2}⟩⟩ is total, then so is u_{i}.

(5) Let u_{i} = [D_{i} ↣ B, D_{i} → A_{i}] (i = 1, 2) and v = [E ↣ B′, E → B].

From the diagram

A_{2} D_{2} E_{2} E_{1} A_{1} D_{1}  E′ D_{1} ∩ D_{2} A_{1} ⊗ A_{2} E B B′

it follows that ⟨⟨u_{1}, u_{2}⟩⟩ ∘ v = [E′ ↣ E ↣ B′, E′ → D_{1} ∩ D_{2} → A_{1} ⊗ A_{2}] and that, for i = 1, 2, there exists a unique E′ ↣ E_{i} for which

D_{i} E_{i} D_{1} ∩ D_{2} E′

is a pullback.

Thus, in the following cube

E_{1} D^{1}  D^{1} ∩ D^{2}  D_{2} E_{2} E B  E′

every face, except for the top one, is known to be a pullback. But then the top face is a pullback as well, and therefore so is

E E_{2} E E_{1} E′  B′

Moreover, as

E_{1} D_{1} A_{1}  E′ D_{1} ∩ D_{2}  E_{2} D_{2} A_{2} A_{1} ⊗ A_{2}

we conclude that ⟨⟨u_{1} ∘ v, u_{2} ∘ v⟩⟩ = [E′ ↣ B′, E′ → D_{1} ∩ D_{2} → A_{1} ⊗ A_{2}]. (6) The proof is essentially given by the following diagram

f_{1}^{−1}(E_{1}) ∩ f_{2}^{−1}(E_{2}) f_{1}^{−1}(E_{1}) ∩ D_{2}  D_{1} ∩ f_{2}^{−1}(E_{2}) f_{1}^{−1}(E_{1})  f_{2}^{−1}(E_{2}) D_{1} ∩ D_{2} E_{1}  D_{1}  D_{2}  E_{2} A_{1}  A_{2} u_{1}  u_{2} v_{1}  v_{2} f_{1}  f_{2} A′_{1} ⊗ A′_{2} B  A′_{2} A′_{1}  .

As it implies that • π_{i} ∘ ⟨⟨u_{1}, u_{2}⟩⟩ = [D_{1} ∩ D_{2} ↣ B, D_{1} ∩ D_{2} ↣ D_{i} → A_{i}] (i = 1, 2).

• v_{1} ∘ π_{1} ∘ ⟨⟨u_{1}, u_{2}⟩⟩ = [f_{1}^{−1}(E_{1}) ∩ D_{2} ↣ B, f_{1}^{−1}(E_{1}) ∩ D_{2} ↣ f_{1}^{−1}(E_{1}) → E_{1} → A′_{1}].

• v_{2} ∘ π_{2} ∘ ⟨⟨u_{1}, u_{2}⟩⟩ = [D_{1} ∩ f_{2}^{−1}(E_{2}) ↣ B, D_{1} ∩ f_{2}^{−1}(E_{2}) ↣ f_{2}^{−1}(E_{2}) → E_{2} → A′_{2}]. And therefore,

⟨⟨v_{1} ∘ π_{1} ∘ ⟨⟨u_{1}, u_{2}⟩⟩, v_{2} ∘ π_{1} ∘ ⟨⟨u_{1}, u_{2}⟩⟩⟩⟩

= [f_{1}^{−1}(E_{1}) ∩ f_{2}^{−1}(E_{2}) ↣ B, f_{1}^{−1}(E_{1}) ∩ f_{2}^{−1}(E_{2}) → A′_{1} ⊗ A′_{2}]
= ⟨⟨v_{1} ∘ u_{1}, v_{2} ∘ u_{2}⟩⟩.

(7) The operation ⊗ extends ×, because ⟨⟨ , ⟩⟩ extends ⟨ , ⟩, and therefore preserves identities. It preserves composition by Proposition 5.1.1 (5) and (6).

Finally, let [m, f] : A ⇀ X and [n, g] : B ⇀ Y. From the following diagram,

π_{1}  π_{2} f  f × g π_{1}  π_{2} π^{2}  n m  g id × n  m × id π_{1}  π_{2} A × E B D × B A D  A × B D × E X × Y  E Y X  π^{1} m × id  id × n

it follows that

[m, f] ∘ π_{1} = π_{1} ∘ [m × n, f × g], and [n, g] ∘ π_{2} = π_{2} ∘ [m × n, f × g].

Thus,

[m, f] ⊗ [n, g] = ⟨⟨[m, f] ∘ π_{1}, [n, g] ∘ π_{2}⟩⟩
= ⟨⟨π_{1} ∘ [m × n, f × g], π_{2} ∘ [m × n, f × g]⟩⟩
= ⟨⟨π_{1}, π_{2}⟩⟩ ∘ [m × n, f × g]  , by Proposition 5.1.1 (5)
= [m × n, f × g]  □

As the order-enriched case is the one that concern us, from now on we consider K and pK to be Poset-enriched w.r.t. ⊑ and ⊏ ∼ respectively, and assume that K has binary Poset-products.

Proposition 5.1.2 Let A_{i} (i = 1, 2), B ∈ | pK |. Then, the partial pairing operation ⟨⟨ , ⟩⟩ : pK(B, A_{1}) × pK(B, A_{2}) → pK(B, A_{1} ⊗ A_{2}) is monotone.

And hence, ⊗ : pK × pK → pK is a Poset-functor.

Proof: Let u = [m, f] ⊏ ∼ [m′, f′] = u′ : B ⇀ A_{1} and v = [n, g] : B ⇀ A_{2}.

Then we have the following situation,

D′_{1}  B  n ⊑  D_{2} A_{1}  A_{1} ⊗ A_{2} f′ m′ f  m  A_{2} D′_{1} ∩ D_{2}  g D_{1}  . D_{1} ∩ D_{2}  (5.5)

So that

⟨⟨u, v⟩⟩ = [D_{1} ∩ D_{2} ↣ B, D_{1} ∩ D_{2} → A_{1} ⊗ A_{2}]

and

⟨⟨u′, v⟩⟩ = [D′_{1} ∩ D_{2} ↣ B, D′_{1} ∩ D_{2} → A_{1} ⊗ A_{2}].

Since (D_{1} ∩ D_{2} ↣ B) = (D_{1} ∩ D_{2} ↣ D′_{1} ∩ D_{2} ↣ B), to show that ⟨⟨u, v⟩⟩ ⊏ ∼ ⟨⟨u′, v⟩⟩ we just need to establish that

(D_{1} ∩ D_{2} → A_{1} ⊗ A_{2}) ⊑ (D_{1} ∩ D_{2} ↣ D′_{1} ∩ D_{2} → A_{1} ⊗ A_{2}).  (5.6)

Chasing the diagram (5.5), it follows that

(D_{1} ∩ D_{2} → A_{1} ⊗ A_{2} → A_{1}) ⊑ (D_{1} ∩ D_{2} ↣ D′_{1} ∩ D_{2} → A_{1} ⊗ A_{2} → A_{1}) and

(D_{1} ∩ D_{2} → A_{1} ⊗ A_{2} → A_{2}) = (D_{1} ∩ D_{2} ↣ D′_{1} ∩ D_{2} → A_{1} ⊗ A_{2} → A_{2}).

Thus, since products in K are Poset-enriched, (5.6) holds.

The monotonicity of the partial pairing in the second argument follows, because ⟨⟨v, u⟩⟩ = ⟨⟨π_{2}, π_{1}⟩⟩ ∘ ⟨⟨u, v⟩⟩ ⊏ ∼ ⟨⟨π_{2}, π_{1}⟩⟩ ∘ ⟨⟨u′, v⟩⟩ = ⟨⟨v, u′⟩⟩. □

Proposition 5.1.3 Let (K, D) be a uniform Cpo-domain-structure such that pK Cpo-enriches. If × : K × K → K is a Cpo-product functor such that, for every A ∈ | K |, the functor × A : K → K preserves colimits of ω-chains in D then the partial-product functor ⊗ : pK × pK → pK Cpo-enriches.

Proof: By Proposition 5.1.2 we need only show that

⊗ : pK(B_{1}, A_{1}) × pK(B_{2}, A_{2}) → pK(B_{1} ⊗ B_{2}, A_{1} ⊗ A_{2})

is continuous.

First we show that ⊗ preserves lubs of ω-chains of graph included partial maps. Consider ω-chains ⟨[m_{k}, f_{k}] ⊆_{i_{k}} [m_{k+1}, f_{k+1}]⟩ and ⟨[n_{k}, g_{k}] ⊆_{j_{k}} [n_{k+1}, g_{k+1}]⟩ such that ⨆ [m_{k}, f_{k}] = ⟨[m_{k}, f_{k}] ⊏ ∼_{μ_{k}} [m, f]⟩ and ⨆ [n_{k}, g_{k}] = ⟨[n_{k}, g_{k}] ⊏ ∼_{η_{k}} [n, g]⟩.

By Proposition 4.3.16,

⨆ [m_{k} × n_{k}, f_{k} × g_{k}] = [m × n, f × g] = [m, f] ⊗ [n, g]

because

colim_{k} ⟨i_{k} × j_{k}⟩ ≅ colim_{l} colim_{k} ⟨i_{k} × j_{l}⟩ ≅ colim_{l} ⟨(colim_{k} i_{k}) × j_{l}⟩
≅ colim_{k} ⟨i_{k}⟩ × colim_{l} ⟨j_{l}⟩ ≅ ⟨μ_{k}⟩ × ⟨η_{l}⟩
≅ ⟨μ_{k} × η_{k}⟩,

m × n : ⟨μ_{k} × η_{k}⟩ → ⟨m_{k} × n_{k}⟩ and f × g : ⟨μ_{k} × η_{k}⟩ → ⟨f_{k} × g_{k}⟩.

Second, for arbitrary ω-chains ⟨[m_{k}, f_{k}] ⊏ ∼_{i_{k}} [m_{k+1}, f_{k+1}]⟩ and ⟨[n_{k}, g_{k}] ⊏ ∼_{j_{k}} [n_{k+1}, g_{k+1}]⟩, by Proposition 4.3.3 (1), we have that

⨆ [m_{k}, f_{k}] ⊗ ⨆ [n_{k}, g_{k}] = ⨆ [m_{k}, F_{k}] ⊗ ⨆ [n_{k}, G_{k}] = ⨆ [m_{k} × n_{k}, F_{k} × G_{k}]

where F_{k} = ⨆_{l≥k} f_{l} ∘ i_{k,l} and G_{k} = ⨆_{l≥k} g_{l} ∘ j_{k,l}. Also, by Proposition 4.3.3 (1),

⨆ [m_{k}, f_{k}] ⊗ [n_{k}, g_{k}] = ⨆ [m_{k} × n_{k}, f_{k} × g_{k}] = ⨆ [m_{k} × n_{k}, H_{k}]

where

\begin{aligned}H_{k} & = & ⨆_{l≥k}(f_{l} × g_{l}) ∘ (i_{k,l} × j_{k,l}) & = & ⨆_{l≥k}(f_{l} ∘ i_{k,l}) × (g_{l} ∘ j_{k,l}) \\ & = & ⨆_{l≥k}(f_{l} ∘ i_{k,l}) × ⨆_{l≥k}(g_{l} ∘ j_{k,l}) & = & F_{k} × G_{k}. \end{aligned}

And the result follows. □

The terminal object in K (when it exists) becomes a partial terminal object in pK, in the sense that, for every A ∈ | pK | there exists a unique A → 1 which is maximal among all A ⇀ 1. Notice that this maximality condition can be imposed by requiring (A ⇀ B → 1) ⊆ (A → 1) for every A ⇀ B, since then (A ⇀ 1) = (A ⇀ 1 → 1) ⊆ (A → 1).

Definition 5.1.4 A category of partial maps is partial cartesian if its subcategory of total maps is cartesian. □

Remark. A definition based on partial maps would ask for the category of partial maps to have finite partial products. What this may mean is under investigation (see [Jay91]).

A miscellaneous result concerning partial cartesian structure and lifting:

Proposition 5.1.5 Let pK be partial cartesian. If χ : J ⊣ L : pK → K, then the monad 𝕃 = (LJ, η, LεJ) : K → K has a tensorial strength [Koc70]

t_{A,B} = χ(id_{A} ⊗ ε_{B}) : A × LB → L(A × B). □

We close the section indicating the kind of algebraic structure induced by a partial cartesian structure on a category of partial maps.

Definition 5.1.6 ([Car86]) A bicategory of partial maps is a symmetric monoidal structure on a Poset-category B such that

1. the tensor product is a Poset-functor,

2. there is a unique cocommutative comonoid structure t_{B} : B → I, Δ_{B} : B → B ⊗ B on each B ∈ | B |, and

3. t : Id \underrightarrow{.}_{≤}I : B → B and Δ : Id \underrightarrow{.} ⊗ : B → B. □

Proposition 5.1.7 If K is Poset-cartesian and pK is Poset-enriched then the canonical symmetric monoidal structure on K extends to a symmetric monoidal structure on pK, with the partial product as the tensor product, making it a bicategory of partial maps.□

5.2 Partial Exponentials

Throughout this section let K and pK be Poset-enriched w.r.t. ⊑ and ⊏ ∼ respectively, and let K have binary Poset-products.

As usual for higher types, exponentiation arises as a right adjoint to multiplication. In our case, for every A ∈ | K |, we set

⊗ A ⊣ A⇀ ⇀ : pK → K in Poset-CAT.  (5.7)

This corresponds to our intuitions, for if K is cartesian then the global elements of A⇀ ⇀B are the partial maps A ⇀ B (because pK(A, B) ≅ pK(1 ⊗ A, B) ≅ K(1, A⇀ ⇀B)). Thus, A⇀ ⇀B internalises the partial maps A ⇀ B.

Convention. We write ε and pλ respectively for the counit (A⇀ ⇀ ) ⊗ A . ⇀ Id and the natural isomorphism pK( ⊗ A, ) ≅ K( , A⇀ ⇀ ) determined by the adjunction (5.7).

Proposition 5.2.1 Poset-partial-exponentials extend to a Poset-functor ⇀ ⇀ : pK^{op} × pK → pK sending pairs of objects (A, B) to A⇀ ⇀B and pairs of partial maps (u, v) to pλ(v ∘ ε ∘ (id ⊗ u)).

Moreover, if K and pK are Cpo-enriched and ⊗ : pK ×pK → pK is a Cpo-functor then ⇀ ⇀ is a Cpo-functor.

Proof: That ⇀ ⇀ preserves identities is clear; that preserves composition is proved as usual, namely by the diagram

v v′ ε id ⊗ (u ∘ u′) id ⊗ u′  id ⊗ u (u⇀ ⇀v) ⊗ id ε ε (u′⇀ ⇀v′) ⊗ id (u⇀ ⇀v) ⊗ id id ⊗ u′  .

The functor ⇀ ⇀ is Poset-enriched because it is locally defined as a composition of monotone operations.

Moreover, if K and pK are Cpo-enriched then pλ is continuous (as it is an isomorphism in Poset between cpos); so, if in addition ⊗ is a Cpo-functor, it follows that ⇀ ⇀ is Cpo-enriched because it is locally defined as a composition of continuous operations. □

Some properties of Poset-partial-exponentials that will be used later (especially Proposition 5.2.2 (3)) are:

Proposition 5.2.2 In a category of partial maps with partial exponentials the following hold:

1. For u = [m, f] : C ⇀ A⇀ ⇀B, we have that f = pλ(ε ∘ (u ⊗ id)) ∘ m, and therefore u ⊆ pλ(ε ∘ (u ⊗ id)).

2. Whenever v^{L} ⊣ v (i.e., id ⊏ ∼ v ∘ v^{L} and v^{L} ∘ v ⊏ ∼ id),

(A⇀ ⇀B) ⊗ A  u B εε  B′ (A′⇀ ⇀B′) ⊗ A′  ⊏ ∼ (v^{L}⇀ ⇀u) ⊗ v  .

3. Whenever v^{L} ⊣ v,

⟺ A′_{1} ⊗ A′  A_{2} A′_{2} ⊏ ∼u u′  v_{2} A_{1} ⊗ A  v_{1}  pλ(u) pλ(u′)  v^{L}⇀ ⇀v_{2} A_{1} A′_{1}  ⊏ ∼ A′⇀ ⇀A′_{2} A⇀ ⇀A_{2} v_{1} ⊗ v  .

5. Data Types 103

Proof:

(1) Since f = u ∘ m is total, it follows that f = pλ(ε ∘ (u ⊗ id) ∘ (m ⊗ id)), and using the naturality of pλ, we conclude that f = pλ(ε ∘ (u ⊗ id)) ∘ m.

(2) Because

(id⇀ ⇀u) ⊗ id  id ⊗ v^{L} εε ⊏ ∼  ε (v^{L}⇀ ⇀id) ⊗ id  u id id ⊗ v  .

(3)(⇒) As the following diagram shows, ε∘(((v⇀ ⇀id)∘pλ(u′)∘v_{1})⊗id) = u′ ∘(v_{1} ⊗v)

id ⊗ v v_{1} ⊗ v pλ(u′) ⊗ id ε ε  u′ pλ(u′) ⊗ id v_{1} ⊗ id (v⇀ ⇀id) ⊗ id

and therefore

(v⇀ ⇀id) ∘ pλ(u′) ∘ v_{1} ⊆ pλ(u′ ∘ (v_{1} ⊗ v)) , by Proposition 5.2.2 (1)
⊏ ∼ pλ(v_{2} ∘ u)  , by hypothesis since pλ is monotone
= (id⇀ ⇀v_{2}) ∘ pλ(u).

Now, post-composing both sides of the inequality with v^{L}⇀ ⇀id, we are done:

pλ(u′) ∘ v_{1} ⊏ ∼ (v^{L}⇀ ⇀id) ∘ (v⇀ ⇀id) ∘ pλ(u′) ∘ v_{1}
⊏ ∼ (v^{L}⇀ ⇀id) ∘ (id⇀ ⇀v_{2}) ∘ pλ(u)
= (v^{L}⇀ ⇀v_{2}) ∘ pλ(u).
(⇐) Because

pλ(u) ⊗ id  (id⇀ ⇀v_{2}) ⊗ id id ⊗ v  pλ(u) ⊗ id  (v^{L}⇀ ⇀v_{2}) ⊗ id v_{1} ⊗ id  ⊏ ∼  pλ(u′) ⊗ id (v^{L}⇀ ⇀id) ⊗ v v_{2} ∘ u  ε ⊏ ∼u′ε  □ .

Definition 5.2.3 ([LM84]) A partial cartesian category of partial maps is partial cartesian closed if it has all partial exponentials. □

We close the section with some comments on the relations between lifting, partial exponentials and exponentials.

1. Lifting is a partial exponential: if K is cartesian then ⊗ 1 ≅ J : K → pK and therefore 1⇀ ⇀ : pK → K is the lifting functor.

2. If K is cartesian closed and J ⊣ L : pK → K then pK is partial cartesian closed, because

K  K  pK × A ⊗ A J A ⇒  L  .

3. The existence of lifting and partial exponentials does not imply the existence of exponentials.

Let ωAlgCpo and pωAlgCpo denote, respectively, the full subcategories of Cpo and pCpo of ω-algebraic cpos. Then, J ⊣ L : pωAlgCpo → ωAlgCpo and ⊗ ℕ ⊣ ℕ⇀ ⇀ : pωAlgCpo → ωAlgCpo but × ℕ : ωAlgCpo → ωAlgCpo does not have a right adjoint.

4. Despite pK being partial cartesian closed, K need not be cartesian closed.

Let Dom and pDom denote, respectively, the full subcategories of Cpo and pCpo of consistently complete ω-algebraic cpos. Then, Dom is not cartesian closed whilst pDom is partial cartesian closed.

5. If K has equalisers and pK is partial cartesian closed then K is cartesian closed (see [Rom89]).

6. Proposition 5.2.4 If K has a terminal object then the inclusion functor J : K → pK: (a) reflects, and (b) creates colimits.

Proof: Let Δ be a diagram in K.

(a) We need show that if γ : Δ \underrightarrow{.} C is colimiting in pK then it is also colimiting in K. Equivalently, assuming γ is colimiting in pK we show that for every cone χ : Δ \underrightarrow{.} X the unique mediating partial map γ ⇀ χ is total.

Note that (X → 1) ∘ (γ ⇀ χ) = C → 1 because both maps mediate between γ and Δ \underrightarrow{.} 1. Thus, (X → 1) ∘ (γ ⇀ χ) is total and therefore so is γ ⇀ χ.

(b) We need show that if γ : Δ . ⇀ C is colimiting in pK then γ is both pointwisetotal and colimiting in K.

By Proposition 5.2.4 (a) it is enough to show that γ is pointwise-total. This follows because there exists a unique C ⇀ 1 such that Δ . ⇀ C ⇀ 1 equals the unique pointwise-total cone Δ \underrightarrow{.} 1 so that Δ . ⇀ C ⇀ 1 is pointwise-total and therefore so is Δ . ⇀ C. □

Corollary 5.2.5 If pK is partial cartesian closed then, for every A ∈ | K |, the functor × A : K → K preserves colimits.

Proof: Follows form Proposition 5.2.4 (a) because for every A ∈ | K | the functor ⊗ A : K → pK preserves colimits as it has right adjoint. □

Hence, by The Freyd Adjoint Functor Theorem, if K is cocomplete and pK is partial cartesian closed then K is cartesian closed if and only if every × A satisfies the solution set condition.

5.3 Colimits

We begin by showing some properties of an initial object in a category of partial maps. The aim is to illustrate the difference from limits and to analyse the interaction with partial cartesian closure.

Proposition 5.3.1 An object is initial in K if and only if it is so in pK.

Proof:

(⇒) Every D ↣ 0 in D is an isomorphism because it is split epi as (0 → D ↣ 0) = id.

(⇐) Let u = [m, f] : 0 ⇀ A. Then, m is an isomorphism with inverse m^{R} and therefore u is total. □

Partial cartesian closure constrains initial objects:

Proposition 5.3.2 Let K have binary products and pK have partial exponentials. If 0 is initial in pK then

1. 0 is strict in K (i.e., for every A ∈ | K |, K(A, 0) ≠ ∅ ⇒ A ≅ 0), and

2. for every A ∈ | K |, 0⇀ ⇀A is terminal in K.

Proof:

(1) Since initial objects in K and pK coincide and, for every A ∈ | K |, the functor ⊗ A preserves colimits it follows that 0 and 0 ⊗ A are initial in K.

Then every f : A → 0 is split mono because

0 ⊗ A 0  A id ⟨⟨f, id⟩⟩ π_{2} A  π_{1} f  .

(2) K(X, 0⇀ ⇀A) ≅ pK(X ⊗ 0, A) ≅ pK(0, A) ≅ 1. □

Proposition 5.3.3 If 0 is strict initial in K then 0 is a zero object in pK if and only if 0 → A is admissible.

Proof: For every [m, f] : A ⇀ 0, by strictness, f is an isomorphism. Therefore,

(⇒) (A → 0) = m ∘ f^{−1} ∈ D.

(⇐) [m, f] = (0 ↣ A)^{R}. □

Corollary 5.3.4 Let K have binary products and pK have partial exponentials. Then, 0 is a zero object in pK if and only if 0 is initial in K and 0 → A is admissible. □

From now on we will be concern with colimits of diagrams of total maps in categories of partial maps. The restriction to this kind of diagram is not severe as we include the one we need to consider, viz. coproducts and ω-chains of embeddings. The first thing to ask is whether colimiting cones for this kind of diagram ought to be pointwise-total. In general, this will not be the case. Consider the following simple but artificial counterexample: let K be

B D A  C  E

and let D consist of the specified monos. Then, pK is

B D A  C  E

and, A ⇀ C ↼ B is a coproduct in pK. Notice that K has no terminal object (C is terminal in pK but not in K). In fact, for the property to fail it cannot have one because if K has terminal object then the inclusion functor J : K → pK creates colimits —see Proposition 5.2.4 (b).

In functor categories pullbacks can be computed pointwise and therefore the category of diagrams in K of type G comes equipped with a plenitude of pullbacks:

Proposition 5.3.5 Let (K, D) be a domain structure. Let C be the full-on-objects subcategory of K^{G} of all cartesian and pointwise-admissible natural transformations. Then, (K^{G}, C) is a domain structure and p(K^{G}, C) ≅ p(K, D)^{G} ↾ | K^{G} |.

Proof: Clearly, every morphism in C is a mono in K^{G}. Moreover, K^{G} has pullbacks of morphisms in C along arbitrary maps because pullbacks of admissible monos along arbitrary maps exist; and thus, for every φ : Ξ \underrightarrow{.} Γ in K^{G} and μ : Δ . ↣ Γ in C, the diagram

φ^{−1}(Δ) Ξ φ^{−1}(μ)  Γ Δμ φ μ^{∗}φ

is a pullback in K^{G} if and only if , for every A ∈ | G |, the diagram

μ_{A} ΓA ΔA φ^{−1}(μ)_{A}ΞA φ^{−1}(Δ)A (μ^{∗}φ)_{A} φ_{A}

is a pullback in K and, for every f : A → B in G, the map φ^{−1}(Δ)f is the unique mediating morphism (given by the universal property of pullbacks) making the diagram

μ_{A} ΓA ΔA φ^{−1}(Δ)B  ΔB (μ^{∗}φ)_{B} μ_{B} ΞB  ΓB φ_{B} φ^{−1}(μ)_{B} φ^{−1}(μ)_{A}ΞA φ^{−1}(Δ)A (μ^{∗}φ)_{A} Ξf  Γf Δf φ^{−1}(Δ)f φ_{A}

commute. Thus, φ^{−1}(μ) is pointwise-admissible; it is also cartesian because the righthand face of the above diagram is a pullback and therefore so is the left-hand face. Hence, φ^{−1}(μ) ∈ C.

One half of the isomorphism p(K^{G}, C) ≅ p(K, D)^{G} ↾ | K^{G} | is given by the mapping

[μ, φ] : Ξ ⇀ Γ ↦ {[μ_{A}, φ_{A}] : ΞA ⇀ ΓA}_{A ∈ |G|} : Ξ . ⇀ Γ

which is shown to be well defined using that μ is cartesian and that φ is natural. The other half, assigns to a natural transformation {[ΔA ↣^{μ_{A}} ΞA, ΔA →^{φ_{A}} ΓA]}_{A ∈ |G|} : Ξ . ⇀ Γ the partial map [μ : Δ . ↣ Ξ, φ : Δ \underrightarrow{.} Γ] where Δ : G → K is the functor mapping an object A to ΔA and a morphism f : A → B to the unique Δf —guaranteed to exist by the naturality of {[μ_{A}, φ_{A}]}— making the diagram

ΞB  ΔB Δf ΔA ΞA  ΓA  ΓB Γf μ_{A}  φ_{A}  φ_{B} μ_{B} Ξf

commute. Observe that, by construction, μ and φ are natural transformations, and that μ is cartesian and pointwise-admissible. □

Justified by the above proposition, cartesian and pointwise-admissible natural transformations will be called admissible. Note that, via the isomorphism of the above proposition, every admissible μ : Δ . ↣ Γ : G → K induces a partial inclusion natural transformation μ^{R} : Γ . ⇀ Δ : G → pK given by μ^{R}_{N} = μ_{N}^{R} for every N ∈ | G |.

The next two lemmas provide the basis for characterising colimits of diagrams of total maps in categories of partial maps. The first one states that colimits are stable under pullbacks along admissible monos. The second one states that admissibility is preserved under colimits.

Lemma 5.3.6 Let γ : Γ \underrightarrow{.} C : G → K be colimiting in pK. Then, for every admissible m : D ↣ C, the cone m^{∗}γ : γ^{−1}(D) \underrightarrow{.} D : G → K is colimiting in pK and in K.

Proof: For every β : γ^{−1}(D) . ⇀ B : G → pK we have that u : m^{∗}γ ⇀ β if and only if u = v ∘ m where v is the unique mediating morphism γ ⇀ β ∘ γ^{−1}(m)^{R} because

(⇒) u ∘ m^{R} : γ ⇀ β ∘ γ^{−1}(m)^{R} and therefore u = u ∘ m^{R} ∘ m = v ∘ m.

(⇐)

v ∘ m ∘ (m^{∗}γ) = v ∘ γ ∘ γ^{−1}(m)
= β ∘ γ^{−1}(m)^{R} ∘ γ^{−1}(m)
= β.

Therefore, m^{∗}γ : γ^{−1}(D) \underrightarrow{.} D is colimiting in pK.

We now show that whenever β is pointwise-total, u is total. Let v = [n, g], then v : γ ⇀ β ∘ γ^{−1}(m)^{R} implies the existence of a unique n^{∗}γ such that

B γ  D C γ^{−1}(m)Γ γ^{−1}(D)  E β m^{∗}γ  g n u v m n^{∗}γ

commutes. But then, n^{∗}γ : γ^{−1}(D) \underrightarrow{.} E is colimiting in pK and therefore there is an isomorphism i : m^{∗}γ ≅ n^{∗}γ. Moreover, since n ∘ i : m^{∗}γ ↣ m ∘ (m^{∗}γ) it follows that m = n ∘ i and therefore u = v ∘ m = g ∘ n^{R} ∘ m = g ∘ i. □

As a corollary we improve Proposition 5.2.4 (a):

Corollary 5.3.7 The inclusion functor J : K → pK reflects colimits. □

Lemma 5.3.8 Let

Γ  D C γδ μ  v Δ  (5.8)

commute, where δ : Δ \underrightarrow{.} D : G → K and γ : Γ \underrightarrow{.} C : G → K are colimiting in pK, μ : Δ . ↣ Γ : G → K is admissible, and v is the unique mediating morphism δ ⇀ γ ∘ μ.

Then, v is admissible and (5.8) is a pullback.

Proof: Let u = [m, f] : γ ⇀ δ ∘ μ^{R}. Then, we have the situation

μ μ^{R}  γ  D C Γ  E m u Δ  δ  f m^{∗}γ  (5.9)

for a unique m^{∗}γ : Δ \underrightarrow{.} E which, by Lemma 5.3.6, is colimiting in pK. Since δ : Δ \underrightarrow{.} D is also colimiting in pK and f : m^{∗}γ → δ it follows that f is an isomorphism and we are done, because v = m ∘ f^{−1} : δ ↣ γ ∘ μ is admissible and the diagram (5.9) gives the required pullback. □

Theorem 5.3.9 (Plotkin) pK has colimits of diagrams in K of type G with pointwisetotal colimiting cones if and only if

1. K has colimits of diagrams in K of type G.

2. Whenever γ : Γ \underrightarrow{.} C : G → K is colimiting in K and m : D ↣ C is admissible then m^{∗}γ : γ^{−1}(D) \underrightarrow{.} D : G → K is colimiting in K.

3. Whenever δ : Δ \underrightarrow{.} D : G → K and γ : Γ \underrightarrow{.} C : G → K are colimiting in K, μ : Δ . ↣ Γ : G → K is admissible, and m : δ → γ ∘ μ then m is admissible and

Γ  D C γδ μ  m Δ  .

Proof:

(⇒) (1) Follows from Corollary 5.3.7.

(2)–(3) Follow from Lemmas 5.3.6 and 5.3.8 observing that if Γ : G → K has colimit in pK and Γ \underrightarrow{.} C is colimiting in K, then it is also colimiting in pK.

(⇐) We show that if γ : Γ \underrightarrow{.} C : G → K is colimiting in K then it is also colimiting in pK.

Given [μ, φ] : Γ . ⇀ A, consider the diagram

γ  D C Γ Δ  δ μ φ  m f A

where δ : Δ \underrightarrow{.} D is colimiting in K, and f : δ → φ and m : δ → γ ∘ μ are mediating morphisms. (By (3), m is admissible and makes the square a pullback). Then, we have that [m, f] : γ ⇀ [μ, φ]. To see that it is the unique such, suppose [n, g] : γ ⇀ [μ, φ]. Then there exists a unique n^{∗}γ such that

γ  D C Γ Δ  δ μ  A φ  m f  E ng n^{∗}γ

commutes. But, by (2), n^{∗}γ is colimiting in K and therefore there is an isomorphism i : δ → n^{∗}γ. Moreover, since n ∘ i : δ → m ∘ δ and g ∘ i : δ → f ∘ δ we conclude that [n, g] = [m, f]. □

Corollary 5.3.10 If K has colimits of type G then J : K → pK preserves them if and only if (2) and (3) of Theorem 5.3.9 hold. □

It is time for applications. Assume that pK has binary coproducts and that K has terminal object (so that the coproduct injections are total).

Then, for [m, f] : A ⇀ C and [n, g] : B ⇀ C, by Theorem 5.3.9, the unique mediating morphism [[m, f], [n, g]] equals [m + n, [f, g]] : A + B ⇀ C. And it follows that, for [m, f] : A ⇀ X and [n, g] : B ⇀ Y,

[m, f] + [n, g] = [m + n, f + g] : A + B ⇀ X + Y.

Moreover, putting statements (2) and (3) in Theorem 5.3.9 together, we have that to give an admissible subobject [C ↣ A + B] corresponds to give a pair of admissible subobjects ([D ↣ A], [E ↣ B]) for which D + E ≅ C. Thus, the notion of admissibility of A + B is determined disjointly by the notion of admissibility for A and for B.

Proposition 5.3.11 If K has terminal object and pK has finite coproducts then D is extensive (following [Law90]) in the sense that

\begin{aligned}D/0 & ≃ & 1, \\ D/A + B & ≃ & D/A × D/B. & □ \end{aligned}

It came as a nice surprise that under the mild assumption that maps 0 → A are admissible, coproduct injections are to be admissible and coproducts are to be disjoint:

Proposition 5.3.12 If K has terminal object, pK has finite coproducts, and for every A ∈ | pK | the map 0 → A is admissible then for every A_{i} (i = 1, 2) ∈ | pK |, the coproduct injections ⨿_{i} : A_{i} → A_{1} + A_{2} (i = 1, 2) are admissible and ⨿_{1} ∩ ⨿_{2} = 0.

Proof: A_{1} ⟶^{id} A_{1} ⟵ 0 and 0 ⟶ A_{2} ⟵^{id} A_{2} are coproducts and since

A_{1} + A_{2} 0  A_{2}  A_{2} A_{1}  A_{2} ⨿_{2}  id ⨿_{1}  ⨿_{2} A_{1} A_{1}  A_{1} + A_{2} A_{1}  A_{2} 0 id  ⨿_{1}  ⨿_{1} ⨿_{2}  , id id

by Lemma 5.3.8, we conclude that ⨿_{i} : A_{i} → A_{1} + A_{2} (i = 1, 2) are admissible and that the above squares are pullbacks. In particular,

A_{1}  A_{2} A^{1} + A^{2} 0  □ ⨿_{2} ⨿_{1}  .

As a final application we show that, for order-enriched categories, the coproduct functor automatically enriches.

Proposition 5.3.13 Assume K has terminal object. Let pK be Poset-enriched (Cpo-enriched). If K has binary Poset-coproducts then binary coproducts in pK are Poset-coproducts (Cpo-coproducts).

Proof: Consider the case when pK is Poset-enriched.

Let [m, f] ⊏ ∼_{i} [m′, f′] : A ⇀ C and [n, g] : B ⇀ C. Then, since

m + n = (m′ ∘ i) + n = (m′ + n) ∘ (i + id)

and

[f, g] ⊑ [f′ ∘ i, g] = [f′, g] ∘ (i + id)

we conclude the monotonicity of [ , ] in the first argument:

[[m, f], [n, g]] = [m + n, [f, g]] ⊏ ∼_{i+id} [m′ + n, [f′, g]] = [[m′, f′], [n, g]].

The monotonicity of [ , ] in the second argument follows, because

[[n, g], [m, f]] = [[m, f], [n, g]] ∘ [⨿_{2}, ⨿_{1}]
⊏ ∼ [[m′, f′], [n, g]] ∘ [⨿_{2}, ⨿_{1}]
= [[n, g], [m′, f′]].

Moreover, by Proposition 2.2.1, when pK is Cpo-enriched then so are the coproducts. □

When pK is partial cartesian closed all diagrams having colimit in K have colimit in pK simply because J : K → pK has right adjoint and therefore preserves colimits. Thus, for example, if K has binary coproducts then so does pK. Further, by arguments analogous to those in cartesian closed categories, they interact with partial cartesian closure as expected; there are canonical natural isomorphisms,

(A + B) ⊗ C ≅ (A ⊗ C) + (B ⊗ C),
(A + B)⇀ ⇀C ≅ (A⇀ ⇀C) ⊗ (B⇀ ⇀C).

We present another approach for calculating colimits that will allow us to infer the existence of the colimits needed for solving recursive type equations in pK from the existence of such colimits in K (see Proposition 5.4.4). The idea is to formalise the following argument: given a diagram, make it into a diagram in K by adjoining undefinedness, calculate its colimit in K, and finally, remove undefinedness to obtain a colimit in pK. Curiously, the last step cannot be formalised as it is and has to be reformulated as ‘extract the defined part’. Constructively, the process of removing undefinedness and the process of extracting definedness seem not to be the same, and proceeding in the second way forces us to restrict the analysis to diagrams in K.

Theorem 5.3.14 Let K have terminal object and let J ⊣ L : pK → K. For every Γ : G → K, if LΓ has colimit in K then Γ has colimit in pK.

Proof: As Γ is a diagram in K, we have a unique pointwise-total cone Γ \underrightarrow{.} 1 which lifts to a cone L(Γ \underrightarrow{.} 1) : LΓ \underrightarrow{.} L1.

Now let γ′ : LΓ \underrightarrow{.} C′ be colimiting in K, and let (C′ → L1) : γ′ ⟶ L(Γ \underrightarrow{.} 1). Pulling back η_{1} along C′ → L1, we end up in the situation

Γ C  1  η_{1} LΓ C′  L1 γ′ η_{Γ}  L(Γ \underrightarrow{.} 1) γ  (5.10)

where γ : Γ \underrightarrow{.} C is the unique cone given by the universal property of pullbacks. (By the way, observe that (C ↣ C′)^{R} ∘ γ′ = γ ∘ η_{Γ}^{R}).

As J : K → pK preserves colimits, to show that γ is colimiting in pK it is enough to show that it is so in K.

For a cone α : Γ \underrightarrow{.} A, the diagram (5.10) expands to

LΓ C′  L1 Γ  Lα γ′ γ  α η_{Γ}  LA A  1 C  η_{A}  (5.11)

where (C′ → LA) : γ′ → Lα and where C → A is the unique mediating morphism between the two specified pullbacks. Chasing diagram (5.11), we see that η_{A} ∘ (C → A) ∘ γ = η_{A} ∘ α and therefore (C → A) : γ → α. It is the unique such, because for any C → A : γ → α, chasing diagram (5.11) while keeping in mind that (C ↣ C′)^{R} ∘γ′ = γ ∘η_{Γ}^{R} and that α∘η_{Γ}^{R} = η_{A}^{R} ∘Lα, the partial maps [C ↣ C′, C → A] and η_{A}^{R} ∘ (C′ → LA) are seen to mediate between γ′ and η_{A}^{R} ∘ Lα and, since γ′ is colimiting in pK, they are equal; making C → A be the unique map that appears in the pullback

A LA C′ C  η_{A}  □ .

Remark. A couple of comments on the proof:

1. The proof technique does not extend to diagrams Γ in pK, as in general we only have a lax cone Γ \underrightarrow{.}_{≤}1.

2. The proof does not show that L creates colimits, as we do not know whether the cones γ′ and Lγ are isomorphic. In the next section, when considering ω-chains of embeddings in a Cpo-enriched setting this will turn out to be the case (see Theorem 5.4.7).

5.4 Colimits of ω-Chains of Embeddings

In this section we study the colimits needed to solve recursive type equations. In particular, we establish conditions under which the category of partial maps has colimits of ω-chains of embeddings provided that so does the category of total maps. First, we do it in the presence of the lifting functor as an application of Theorem 5.3.14; afterwards we do it for arbitrary categories of partial maps.

We recall the basic definitions:

Definition 5.4.1 In a Poset-category, f ⊣ g is an adjoint pair if id ≤ g∘f and f ∘g ≤ id. Further, whenever g ∘ f = id the pair is called an embedding-projection pair (or simply, ep-pair). □

Following tradition, in an adjoint pair the first component is called the left adjoint whilst the second component is called the right adjoint. Since each of the adjoints uniquely determines the other one, the notations f^{R}, for the right adjoint of a left adjoint f, and g^{L}, for the left adjoint of a right adjoint g, are justified. In fact, for a Poset-category C, defining C_{L} (C_{R}) to be the subcategory of C of all left (right) adjoints, we have a duality of categories ( )^{R} : C_{L}^{op} ≅ C_{R} : ( )^{L}. Further useful definitions are: C_{A} for the subcategory of C^{op} × C of all adjoint pairs, and C_{E} (C_{P}) for the subcategory of C_{L} (C_{R}) of all embeddings (projections). Clearly, the previous duality cuts down to a duality C_{E}^{op} ≅ C_{P}.

Ep-pairs in a Poset-category of partial maps are such that an object A partially embeds into another one B if and only if A totally embeds into an admissible subobject of B.

5. Data Types 119 Proposition 5.4.2 Let pK be Poset-enriched. For every A, B ∈ | pK |,

• pK_{E}(A, B) = {n ∘ f | f ∈ K_{E}(A, D) ∧ n ∈ D(D, B) for some D ∈ | K |},

• pK_{P} (B, A) = {[n, g] | n ∈ D(D, B) ∧ g ∈ K_{P} (D, A) for some D ∈ | K |}. Proof: We show that [m, f] ⊣ [n, g] is an ep-pair if and only if g ∈ K_{P} and [m, f] = n ∘ g^{L}.

(⇒) The equality [n, g] ∘ [m, f] = id implies that m is an isomorphism and that there is a unique f′ such that

f f′  g idn m id  m^{−1}  .

Then, g ∘ f′ = id and [m, f] = n ∘ f′. Moreover, pre-composing with n at both sides of the inequality (n ∘ f′) ∘ (g ∘ n^{R}) ⊏ ∼ id it follows that n ∘ f′ ∘ g ⊑ n, and since n is full we have that f′ ∘ g ⊑ id

(⇐) Check the definition of ep-pair. □ Similarly we can prove:

Proposition 5.4.3 Let pK be Poset-enriched. For every A, B ∈ | pK |, • pK_{L}(A, B) = {n ∘ f | f ∈ K_{L}(A, D) ∧ n ∈ D(D, B) for some D ∈ | K |},

• pK_{R}(B, A) = {[n, g] | n ∈ D(D, B) ∧ g ∈ K_{R}(D, A) for some D ∈ | K |}. □ As a corollary to Theorem 5.3.14 we obtain:

Proposition 5.4.4 Let K have terminal object and let J ⊣ L : pK → K in Poset-CAT. If K has colimits of ω-chains of embeddings then so does pK. □

Remark. The lifting functor is required to be Poset-enriched so that ep-pairs are preserved (as they are adjoint pairs).

In the Cpo-enriched case, exploiting the limit/colimit coincidence, we strengthen the result by showing that the lifting functor creates colimits of ω-chains of embeddings.

We recall the order-theoretic characterisation of colimits of ω-chains of embeddings in Cpo-categories from which the limit/colimit coincidence follows:

Theorem 5.4.5 (Limit/Colimit Coincidence Theorem [SP82]) In a Cpo-category C, for Γ : ω → C_{E} the following are equivalent:

1. γ : Γ \underrightarrow{.} C : ω → C is colimiting in C.

2. γ : Γ \underrightarrow{.} C : ω → C_{E} and ⋁ γ_{n} ∘ (γ_{n})^{R} = id_{C}.

3. γ : Γ \underrightarrow{.} C : ω → C is Cpo-colimiting in C.

4. γ : Γ \underrightarrow{.} C : ω → C_{E} and γ^{R} : C \underrightarrow{.} Γ^{R} : ω → C_{P} is limiting in C.

5. γ : Γ \underrightarrow{.} C : ω → C_{E} and γ^{R} : C \underrightarrow{.} Γ^{R} : ω → C_{P} is Cpo-limiting in C. □

The theorem below is essentially proved using Theorem 5.3.14, and the facts that colimits happen to be limits and that these are preserved by the lifting functor.

Definition 5.4.6 A functor F : A → B pseudo-creates colimits for a diagram Δ in A if whenever F Δ has colimit in B then Δ has colimit in A and F preserves it. □

Theorem 5.4.7 Let K have terminal object. If J ⊣ L : pK → K in Cpo-CAT then L pseudo-creates colimits of ω-chains of embeddings.

Proof: Given Γ : ω → pK_{E}, if γ′ : LΓ \underrightarrow{.} C′ is colimiting in K then, by Theorem 5.3.14, we can construct γ : Γ \underrightarrow{.} C colimiting in pK. Now, by the Limit/Colimit Coincidence Theorem, we have that γ : Γ \underrightarrow{.} C : ω → pK_{E} and that γ^{R} : C . ⇀ Γ^{R} is limiting in pK.

Then, since L is a right adjoint, it preserves limits and therefore L(γ^{R}) : LC \underrightarrow{.} L(Γ^{R}) is limiting in K. Moreover, as L is a Poset-functor, it preserves ep-pairs and hence L(γ^{R}) = (Lγ)^{R} and L(Γ^{R}) = (LΓ)^{R}. Thus, by the Limit/Colimit Coincidence Theorem, Lγ : LΓ \underrightarrow{.} LC is colimiting in K. □

In the general case (i.e., when the lifting functor is not assumed to exist), it is more convenient to work with limits of ω^{op}-chains of projections. The following two propositions will be essential when considering such limits.

Proposition 5.4.8 Let pK be Poset-enriched.

1. Projections in K are preserved by pulling-back along admissible monos.

2. For g ∈ K_{P} (B, A) and n ∈ D(D, A),

g^{−1}(n) ∘ (n^{∗}g)^{L} ∘ (n^{∗}g) = g^{L} ∘ g ∘ g^{−1}(n).

Proof:

(1) Let g ∈ K_{P}. Then [g^{−1}(n), n^{∗}g] = n^{R} ∘ g is a projection in pK (with embedding g^{L} ∘ n) and, by Proposition 5.4.2, n^{∗}g is an projection in K.

(2) We calculate:

g^{−1}(n) ∘ (n^{∗}g)^{L} ∘ (n^{∗}g) = ((n^{∗}g) ∘ g^{−1}(n)^{R})^{L} ∘ (n^{∗}g)
= (n^{R} ∘ g)^{L} ∘ (n^{∗}g)
= g^{L} ∘ n ∘ (n^{∗}g)
= g^{L} ∘ g ∘ g^{−1}(n).  □

Proposition 5.4.9 Let (K, D) be a domain structure. Let π : P \underrightarrow{.} Γ : ω^{op} → K be a cone and let μ : Γ′ . ↣ Γ : ω^{op} → K be admissible. Then, there exists a cone π′ : P′ \underrightarrow{.} Γ′ : ω^{op} → K and an admissible m : P′ ↣ P such that

P′ Γ  P Γ′  π m π′ μ

is a pullback in K^{ω^{op}}. And thus, π′ is limiting whenever π is.

Proof: Let

P′  P π_{0} Γ′_{0}  Γ_{0} m π′_{0}μ_{0}

and for k ∈ | ω | define inductively π′_{k+1} to be the unique morphism for which

P′  P m Γ′_{k+1}  Γ_{k+1} Γ′_{k}  π′_{k+1} μ_{k+1} μ_{k}  Γ_{k} Γ′_{k+1,k}Γ_{k+1,k}  π_{k+1}π_{k} π′_{k}  .  □

Corollary 5.4.10 Let (K, D) be a domain structure. For an admissible natural transformation μ : Γ′ . ↣ Γ : ω^{op} → K, if π : P → Γ and π′ : P′ → Γ′ are limiting then the unique m : μ ∘ π′ → π is admissible and for every k ∈ | ω |,

m π_{k} μ_{k}  □^{π′_{k}}  .

Theorem 5.4.11 Let pK be Cpo-enriched, and assume that K has limits of ω^{op}-chains of projections. If D has colimits of ω-chains and the inclusion functor D → K preserves them, then pK has limits of ω^{op}-chains of projections.

Proof: Let ⟨[n_{k}, g_{k}]⟩ be an ω^{op}-chain of projections in pK. For j ∈ | ω |, define

g_{k}^{(j)} = \{ \begin{matrix}g_{j} & if k = 0 \\ n_{k−1}^{(j)}^{∗}g_{k−1}^{(j+1)} & if k ≥ 1 \end{matrix} n_{k}^{(j)} =^{def} \{ \begin{matrix}n_{j} & if k = 0 \\ (g_{k−1}^{(j+1)})^{−1}(n_{k−1}^{(j)}) & if k ≥ 1 \end{matrix}

so that we are in the following situation

... ... ... ... g_{0} g_{1}^{(0)} g_{2}^{(0)}  g_{1}^{(1)} n_{1}^{(0)} n_{0}  n_{1}^{(1)} n_{2} n_{1} g_{1}  g_{2} n_{2}^{(0)}  .

Let succ : ω → ω : k ↦ k + 1. Then, by construction, n^{(j)} : (g^{(j)} succ) . ↣ g^{(j+1)} is admissible. And, since every g_{k} is a projection, by Proposition 5.4.8 (1), for every j ∈ | ω | the ω^{op}-chain g^{(j)} consists of projections.

For every j ∈ | ω |, let π^{(j)} be a limit in K for g^{(j)} and let m_{j} be the unique mediating morphism n^{(j)} ∘ (π^{(j)} succ) → π^{(j+1)}. Then, by Corollary 5.4.10, ⟨m_{j}⟩ is an ω-chain in D and

m_{j} n_{k}^{(j)}  π_{k}^{(j+1)} π_{k+1}^{(j)}  .  (5.12)

Letting μ be a colimit of ⟨m_{j}⟩ in D we will show that ⟨[μ_{k}, π_{0}^{(k)}]⟩ is a limit of ⟨[n_{k}, g_{k}]⟩ in pK.

Since π_{0}^{(k)} ∈ K_{P} and μ_{k} ∈ D it follows that [μ_{k}, π_{0}^{(k)}] ∈ pK_{P}. Moreover, it is a cone because

π_{1}^{(k)}  m_{k} π_{0}^{(k+1)} μ_{k+1} g_{k} π_{0}^{(k)}  n_{k}  μ_{k} .

Finally, by the Limit/Colimit Coincidence Theorem, we need only check that ⨆ [μ_{k}, π_{0}^{(k)}]^{L} ∘ [μ_{k}, π_{0}^{(k)}] = id.

For ϕ_{k} = μ_{k} ∘ (π_{0}^{(k)})^{L} ∘ π_{0}^{(k)} we have that [μ_{k}, π_{0}^{(k)}]^{L} ∘ [μ_{k}, π_{0}^{(k)}] = [μ_{k}, ϕ_{k}] and since μ_{k} ⊆_{m_{k}} μ_{k+1}, the inequality [μ_{k}, ϕ_{k}] ⊏ ∼ [μ_{k+1}, ϕ_{k+1}] is realised by m_{k}. Then, by Proposition 4.3.3 (1), ⨆ [μ_{k}, π_{0}^{(k)}]^{L} ∘ [μ_{k}, π_{0}^{(k)}] = ⨆ [μ_{k}, Φ_{k}] where Φ_{k} = ⨆_{j≥k} ϕ_{j} ∘ m_{k,j}. But,

Φ_{k} = ⨆_{j≥k} μ_{j} ∘ (π_{0}^{(j)})^{L} ∘ π_{0}^{(j)} ∘ m_{k,j}
= ⨆_{j≥k} μ_{j} ∘ m_{k,j} ∘ (π_{j−k}^{(j)})^{L} ∘ π_{j−k}^{(j)} , using Proposition 5.4.8 (2) for diagram (5.12)
= μ_{k} ∘ ⨆_{j≥0}(π_{j}^{(k)})^{L} ∘ π_{j}^{(k)}
= μ_{k}

and therefore, ⨆ [μ_{k}, π_{0}^{(k)}]^{L} ∘ [μ_{k}, π_{0}^{(k)}] = ⨆ [μ_{k}, μ_{k}]. Now, using Lemma 4.3.4 and the argument in the proof of Proposition 4.3.7, we are done. □

Corollary 5.4.12 Let (K, D) be a uniform Cpo-domain-structure such that pK Cpo-enriches. If K has limits of ω^{op}-chains of projections and D has colimits of ω-chains then pK has limits of ω^{op}-chains of projections. □

6 Recursive Types

We thoroughly study the semantics of inductive and recursive types. Our point of view is that types constitute the objects of a category and that type constructors are bifunctors on the category of types. By a bifunctor on a category we mean a functor on two variables from the category to itself, contravariant in the first, covariant in the second.

First, following Peter Freyd, the stress is on the study of algebraically complete categories, i.e. those categories admitting all inductive types (in the sense that every endofunctor on them has an initial algebra —this is understood in a setting in which the phrase “every endofunctor” refers to a class of enriched endofunctors— see Definition 6.1.4). After observing that algebraic completeness guarantees the existence of parameterised initial algebras, we identify, under the name of parameterised algebraically complete categories, all those categories which are algebraically complete and such that every parameterised inductive type constructor gives rise to a parameterised inductive type (see Definition 6.1.7). Type constructors on several variables are dealt with by Bekic̆’s Lemma, from which follow both the Product Theorem for Parameterised Algebraically Complete Categories (Theorem 6.1.14) and also the dinaturality of Fix (the functor delivering initial algebras).

Second, again following Peter Freyd, algebraic completeness is refined to algebraic compactness by imposing the axiom that, for every endofunctor, the inverse of an initial algebra is a final coalgebra. The compactness axiom is motivated with a simple argument showing that every bifunctor on an algebraically compact category admits a fixed-point. Further preliminary evidence for the suitability of algebraic compactness is that Bekic̆’s Lemma (together with its corollaries) hold. More definite evidence is provided by the fundamental property of algebraically compact categories, viz. that every bifunctor on an algebraically compact category has a canonical and minimal fixed-point (Theorem 6.4.1), and by the fact that recursive types reduce to inductive types (see Section 6.5).

6.1 Algebraic Completeness

The category-theoretic solution of recursive type equations is based on the following, by now standard, assumptions:

1. Types constitute the objects of a category.

2. Type constructors are bifunctors on the category of types.

With this viewpoint, given a bifunctor, F, on a category, the recursive type Fix (F) is a canonical type which is a fixed-point of F; that is,

F(Fix F, Fix F) ≅ Fix F.

Intuitively, the isomorphism allows the folding and unfolding of the recursive type.

The concern of this section is the particular case in which the bifunctor reduces to an endofunctor yielding inductive types, Fix (F) = μX.F X, satisfying

F (μX.F X) ≅ μX.F X

and whose canonicity is due to a clear notion of least fixed-point, viz., an initial algebra. This is justified by the next lemma.

Definition 6.1.1 For a functor F : A → A, the category of F -algebras, F -Alg, has objects (A, α) where A ∈ | A | and α : F A → A in A, and morphisms h : (A, α) → (B, β) where h : A → B in A is such that

F A A  B F B F h h α  β .

Composition and identities are as in A. □

Lemma 6.1.2 (Lambek’s Lemma [Lam68]) Initial algebras are fixed-points. □

Implicit in the proof of Lambek’s Lemma there is:

Lemma 6.1.3 ([Fre91]) Endofunctors preserve their initial algebras. □

Categories admitting all inductive types are important and thus we proceed to study them. In [Fre91], Peter Freyd defined an algebraically complete category as one for which every endofunctor on it has an initial algebra. As he emphasised [Fre92], this should be understood in a 2-categorical setting, that is, a setting in which the phrase “every endofunctor” refers to an understood class of endofunctors. For us, such a 2-categorical setting will be determined by enrichment. Hence the following:

Definition 6.1.4 (c.f. [Fre91]) A V-category A is V-algebraically complete if for every V-endofunctor F on A, the underlying endofunctor F_{0} on A_{0} has an initial algebra. □

Remark. Another possible definition (more in the spirit of enriched category theory) would assume that V has equalisers and terminal object so that for every V-functor F : A → A one can construct the V-category F -Alg and require that this has a V-initial object. We have not proceeded this way because the above definition suits our purposes without imposing any conditions on V and, further, because under some mild conditions (e.g., that A has cotensors with a strong generator in V_{0}) both approaches are equivalent.

A non-trivial example of algebraic completeness is Set_{ω}, the category of countable sets and functions (see [AT90,Fre92]). Other examples are given in Section 6.6, whilst more familiar examples can be found among posets:

Proposition 6.1.5 ([Mar76]) A poset is algebraically complete if and only if it is chaincomplete. □

A first basic property of algebraic completeness:

Proposition 6.1.6 ([Fre91]) If A is V-algebraically complete then A_{0} has an initial object. □

An important consequence of algebraic completeness is that it guarantees the existence of parameterised initial algebras. Since, for a type constructor on B parameterised on A, i.e. a functor F : A × B → B, if B is algebraically complete then, for every A ∈ | A |, there is an inductive type μX.F (A, X) satisfying

F(A, μX.F (A, X)) ≅ μX.F (A, X).

Moreover, parameterised inductive types can be extended to a type on B parameterised on A (i.e., a functor A → B), mapping A to μX.F (A, X) and denoted F^{†}, which we now describe formally.

Let V be cartesian, and let A and B be V-categories. Assume that B is V-algebraically complete and let F : A × B → B be a V-functor. As for every A ∈ | A | we have that F (A, ) : B → B is a V-functor, we can set (F_{0}^{†}A, ι_{A}^{F_{0}}) to be an initial algebra for the endofunctor F (A, )_{0} = F_{0}(A, ). To extend the action of F_{0}^{†} to morphisms, for every f : X → Y in A_{0}, let F_{0}^{†}f : F_{0}^{†}X → F_{0}^{†}Y be the unique morphism for which

F (X, F_{0}^{†}f) F (X, F_{0}^{†}X) F (X, F_{0}^{†}Y)F (f, F_{0}^{†}Y) F (Y, F_{0}^{†}Y) ι_{X}^{F_{0}}  ι_{Y}^{F_{0}} F_{0}^{†}YF_{0}^{†}f F_{0}^{†}X

or, equivalently,

F (X, F_{0}^{†}X) ι_{X}^{F_{0}} F_{0}^{†}X F (f, F_{0}^{†}f) F (Y, F_{0}^{†}Y) ι{F_{0} \atop Y} F_{0}^{†}YF_{0}^{†}f .  (6.1)

By the universal property of initial algebras, F_{0}^{†} is a functor A_{0} → B_{0}. Unfortunately it need not V-enrich. To see this let Z be the Poset-category induced by the ordered monoid Z = (ℤ, ≤, 0, +) and consider the Poset-functor F : Z × Z → Z : (m, n) ↦ m + 2n. Every i ∈ ℤ is an initial algebra for the functor F_{0}(Z, ) : Z_{0} → Z_{0} : n ↦ 2n and since, for every m ∈ ℤ,

i i  ⟺ F (Z, F_{0}^{†}Z) 2(F_{0}^{†}m) = F (0, F_{0}^{†}m) F (Z, F_{0}^{†}Z) F (m, 0) = m F (Z, F_{0}^{†}Z)  F_{0}^{†}Z F_{0}^{†}Z F_{0}^{†}m  F_{0}^{†}m = −m

it follows that F_{0}^{†} : Z → Z does not Poset-enrich.

Thus the following definition is natural.

Definition 6.1.7 Let V be cartesian. A V-category B is parameterised V-algebraically complete if it is V-algebraically complete and for every V-functor F : A × B → B and every indexed family {ι_{A}^{F_{0}} : F (A, F_{0}^{†}A) → F_{0}^{†}A}_{A ∈ | A |} of initial F_{0}(A, )-algebras, the induced functor F_{0}^{†} : A_{0} → B_{0} V-enriches.

A parameterisation on a parameterised V-algebraically complete category B is a mapping associating every V-functor F : A × B → B with a pair consisting of a V-functor F^{†} : A → B and an indexed family ι^{F_{0}} = {ι_{A}^{F_{0}} : F (A, F^{†}A) → F^{†}A}_{A ∈ | A |} of initial F_{0}(A, )-algebras such that F^{†}_{0} = F_{0}^{†}. □

Convention. From now on, in the situation of the above definition, the indexed family of initial algebras determining F_{0}^{†} will be left implicit. To avoid the axiom of choice we will assume that either our V has enough points (so that there is a unique V-enrichment of F_{0}^{†}) or that our parameterised V-algebraically complete category comes equipped with a parameterisation. Moreover, when constructing new parameterised V-algebraically complete categories from old ones we will be careful so that our constructions also apply to parameterisations.

Remark. It is possible to give a stronger definition of V-algebraic completeness that implies the parameterised version; such a possibility will not be discussed here.

The fact that ι^{F_{0}} is a natural transformation F_{0} ∘ ⟨Id_{A_{0}}, F_{0}^{†}⟩ \underrightarrow{.} F_{0}^{†}, as (6.1) shows, motivates the following definition:

Definition 6.1.8 For a functor F : A×B → B, the category of parameterised F -algebras is F ∘ ⟨Id_{A}, ⟩-Alg where F ∘ ⟨Id_{A}, ⟩ : CAT(A, B) → CAT(A, B). □

Remark. As expected, when A = 1 in the above definition, algebras and parameterised algebras coincide.

Proposition 6.1.9 Let V be cartesian and let F : A × B → B be a V-functor. If B is V-algebraically complete then (F_{0}^{†}, ι^{F_{0}}) is an initial parameterised F_{0}-algebra. □

As an application of this characterisation we have:

Proposition 6.1.10 Let V be cartesian, and let A, B and C be V-categories. Assume that C is V-algebraically complete. Then, for V-functors F : B × C → C and G : A → B, there is a canonical natural isomorphism (F ∘ (G × Id))_{0}^{†} ≅ F_{0}^{†} ∘ G_{0}.

Proof: Because (F_{0}^{†}G_{0}, ι^{F_{0}}G_{0}) is an initial parameterised F_{0} ∘ (G_{0} × Id)-algebra. □

The operation ( _{0})^{†} can be extended to act on natural transformations:

For cartesian V, let F, G : A×B → B be V-functors. Assume that B is V-algebraically complete. For every η : F \underrightarrow{.} G : A × B → B, the components of the natural transformation η^{†} : F_{0}^{†} \underrightarrow{.} G_{0}^{†} : A_{0} → B_{0} are defined as the unique morphisms such that

η_{A}^{†} F (A, F_{0}^{†}A) F (A, η_{A}^{†}) F (A, G_{0}^{†}A)  ι_{A}^{F_{0}} η^{(A,G_{0}^{†}A)} G(A, G_{0}^{†}A) ι_{A}^{G_{0}} G_{0}^{†}A F_{0}^{†}A .

Then, by construction, we have the following useful property:

Proposition 6.1.11 The operation ( )^{†} preserves natural isomorphisms. In fact, if η is a natural isomorphism then (η^{†})^{−1} = (η^{−1})^{†}. □

Proposition 6.1.12 Let V be a cartesian category with enough points. If B is parameterised V-algebraically complete then, for every V-category A, the operation ( )_{0}^{†} : η ↦ η^{†} is a functor V-CAT(A × B, B) → V-CAT(A, B).

Moreover, whenever V-Cat is 2-cartesian-closed, for a small V-category B, if the functor Fix ( _{0}) : [B, B]_{0} → B_{0} V-enriches then, for every small V-category A, so does the functor ( )_{0}^{†} : [A × B, B]_{0} → [A, B]_{0} (since it is the underlying functor of the unique V-functor ( )^{†} satisfying

E Λ × Id  B [B, B] Fix [A, [B, B]] × A E [A × B, B] × A [A, B] × A ( )^{†} × Id  (6.2)

where Fix_{0} = Fix ( _{0}).) □

Defining ( )^{†} as in (6.2) we have that H_{0}^{†} = Fix ( _{0})∘Λ(H)_{0} and that the homogeneity of the definition makes possible to strengthen Proposition 6.1.10 to an equality, since

(F ∘ (G × Id))_{0}^{†} = Fix ( _{0}) ∘ Λ(F ∘ (G × Id))_{0} = Fix ( _{0}) ∘ Λ(F)_{0} ∘ G_{0} = F_{0}^{†} ∘ G_{0}. (6.3)

Inductive types on several variables can be computed by a two step process as follows:

μ(X, Y).(F (X, Y), G(X, Y))

≅ (A, G^{†}A) where A = μX.F (X, G^{†}X) and G^{†}X = μY.G(X, Y).

The idea is that the system of equations

\{ \begin{matrix}X = F (X, Y)  (1) \\ Y = G(X, Y)  (2) \end{matrix}

can be reduced to the system

\{ \begin{matrix}X = F (X, G^{†}X) \\ Y = G^{†}X \end{matrix}

and thus it can be solved by solving equation (1) with Y replaced by the parameterised solution of equation (2), and then calculating the solution of equation (2) with X replaced by the previously obtained inductive type.

The following can be found in [LS81] and [Fre92]:

Lemma 6.1.13 (Bekic̆’s Lemma for Algebraically Complete Categories) Let V be cartesian, and let A and B be V-categories. Assume that B is V-algebraically complete. For a functor F_{0} : A_{0} × B_{0} → A_{0} and a V-functor G : A × B → B, if (A, α) is an initial F_{0}( , G_{0}^{†} )-algebra then ((A, G_{0}^{†}A), (α, ι_{A}^{G_{0}})) is an initial ⟨F_{0}, G_{0}⟩-algebra. □

As a corollary we obtain the Product Theorem for Parameterised Algebraically Complete Categories:

Theorem 6.1.14 Let V be cartesian, and let A and B be V-categories. If A and B are parameterised V-algebraically complete then so is A × B.

Proof: Let C be a V-category and let F : C × A × B → A and G : C × A × B → B be V-functors.

For C ∈ | C_{0} |, since G_{0}^{†}(C, ) is a parameterised initial G_{0}(C, , )-algebra (as for every A ∈ | A |, G_{0}(C, A, G_{0}^{†}(C, A)) ≅ G_{0}^{†}(C, A) is an initial G_{0}(C, A, )-algebra) we have that

G_{0}(C, , )^{†} ≅ G_{0}^{†}(C, );

moreover ⟨F_{0}(C, , ), G_{0}(C, , )⟩ = ⟨F, G⟩_{0}(C, , ) and, by Bekic̆’s Lemma, it follows that if (A, α) is an initial F_{0}(C, , G_{0}^{†}(C, ))-algebra then ((A, G_{0}^{†}(C, A)), (α, ι_{(C,A)}^{G_{0}})) is an initial ⟨F, G⟩_{0}(C, , )-algebra. Thus, ⟨F, G⟩^{†} is the V-functor

⟨H^{†}, G^{†} ∘ ⟨Id, H^{†}⟩⟩ : C → A × B

where H = F ∘ ⟨Id, G^{†}⟩ : C × A → A. □

A surprising consequence of Bekic̆’s Lemma is dinaturality (cf. [Fre91]):

Proposition 6.1.15 Let V be cartesian and such that V-Cat is 2-cartesian-closed. If A and B are V-algebraically complete then, for every V-functor F : A → B,

≅  F_{0} A_{0} B_{0} [A, A]_{0} [B, B]_{0} Fix ( ^{0}) [B, A]_{0} ∘ F F ∘  Fix ( _{0})  .

6. Recursive Types 133 Proof: Define F′ = F ∘ Π_{1} : A × B → B.

For a V-functor G : B → A, let G′ = G ∘ Π_{2} : A × B → A. By Bekic̆’s Lemma, we have the canonical isomorphisms:

μ(X, Y).(G_{0}Y, F_{0}X)

≅ (A, F′_{0}^{†}A) where A = μX.G′_{0}(X, F′_{0}^{†}X) = Fix (G_{0} ∘ F′_{0}^{†}),
≅ (G′_{0}^{†}B, B) where B = μY.F′_{0}(G′_{0}^{†}Y, Y) = Fix (F_{0} ∘ G′_{0}^{†}).

which induce the canonical isomorphisms:

F (Fix G_{0}F_{0}) ≅ F′_{0}^{†}A  , because F′_{0}^{†} ≅ F_{0}
≅ B
≅ Fix (F_{0}G_{0}) , because G′_{0}^{†} ≅ G_{0}.

For η : G \underrightarrow{.} H : B → A we have to show that

Fix (F_{0}G_{0}) Fix (F_{0}H_{0}) Fix (F_{0}η) ≅ ≅ F (Fix (ηF_{0})) F (Fix H_{0}F_{0}) F (Fix G_{0}F_{0})  .  (6.4)

Recall that Fix (F_{0}η) is the unique such that

F G(Fix F_{0}G_{0}) F G(Fix (F_{0}η)) F G(Fix F_{0}H_{0})  ι^{F_{0}G_{0}} F H(Fix F_{0}H_{0})  Fix (F_{0}G_{0}) Fix (F_{0}η) Fix (F_{0}H_{0}) ι^{F_{0}H_{0}} F η_{Fix (F_{0}H_{0})}  (6.5)

and that Fix (ηF_{0}) is the unique such that

GF (Fix G_{0}F_{0}) GF (Fix (ηF_{0}))  η_{F (Fix H_{0}F_{0})} GF (Fix H_{0}F_{0})  ι^{G_{0}F_{0}} HF (Fix H_{0}F_{0}) ι^{H_{0}F_{0}} Fix (G_{0}F_{0}) Fix (ηF_{0}) Fix (H_{0}F_{0})  . (6.6)

Applying F_{0} to (6.6) and using the naturality of η we have

≅ ≅  ≅ ≅  h g ≅ F G(Fix F_{0}G_{0}) F G(g) F GF (Fix G_{0}F_{0}) F GF(Fix (ηF_{0})) F GF (Fix H_{0}F_{0}) F G(h) F G(Fix F_{0}H_{0}) F η_{Fix (F_{0}H_{0})} F η_{F (Fix H_{0}F_{0})} F ι^{G_{0}F_{0}} ι^{F_{0}G_{0}} F HF (Fix H_{0}F_{0}) F H(h) F H(Fix F_{0}H_{0}) ι^{F_{0}H_{0}} Fix (H_{0}F_{0}) F (Fix H_{0}F_{0}) F(Fix (ηF_{0})) Fix (F_{0}G_{0}) F (Fix G_{0}F_{0}) F ι^{H_{0}F_{0}}

and, by the universal property of ι^{F_{0}G_{0}} and (6.5), it follows that (6.4) is satisfied. □

Yet another corollary of Bekic̆’s Lemma:

Corollary 6.1.16 Let V be cartesian. For parameterised V-algebraically complete categories A and B, and V-functors F : A×B → A and G : A×B → B, if ((A, B), (α, β)) is an initial ⟨F, G⟩_{0}-algebra then (A, α) is an initial F_{0}( , B)-algebra and (B, β) is an initial G_{0}(A, )-algebra.

Proof: Let (X, χ) be an initial F_{0}( , G_{0}^{†} )-algebra.

By Bekic̆’s Lemma, there exists an isomorphism (u, v) such that

X Au α χ  β F (X, G^{†}X) F (u, v) F (A, B)  ι_{X}^{G_{0}} G(X, G^{†}X) G(u, v) G(A, B)  Bv G^{†}X .

Then, v ∘ G^{†}(u^{−1}) is a G_{0}(A, )-algebra isomorphism (G^{†}A, ι_{A}^{G_{0}}) → (B, β). □

6.2 Algebraic Compactness: Motivation

Given a bifunctor, F, on a category, A, we seek a canonical type Fix (F) satisfying F(Fix F, Fix F) ≅ Fix (F). We have already seen how to interpret such a recursive type when the bifunctor reduces to an endofunctor. Now, for a moment, suppose that it is known how to interpret recursive types when the bifunctor reduces to a contravariant endofunctor. That is, assume that for every contravariant endofunctor, G, on A there is a canonical Fix (G) satisfying

G(Fix G) ≅ Fix (G).  (6.7)

Then, there is a candidate for Fix (F), viz., Fix (F^{†}) because

F (Fix F^{†} , Fix F^{†}) ≅ F(Fix F^{†} , F^{†}(Fix F^{†}))
≅ F^{†}(Fix F^{†})
≅ Fix (F^{†}).

Motivated by the above discussion we start the study of fixed-points for contravariant endofunctors. Observe that (6.7) implies G^{2}(Fix G) ≅ G(Fix G) ≅ Fix (G). Then, a natural choice for Fix (G) is Fix (G^{2}) and, in fact, this interpretation will turn out to be possible provided that A is sufficiently rich. To see this we first provide the analogue of Lemma 6.1.3 for contravariant endofunctors.

Lemma 6.2.1 Let G be a contravariant endofunctor. If G^{2} has an initial algebra and a final coalgebra then G transforms initial G^{2}-algebras to final G^{2}-coalgebras and vice versa.

Proof: Let (A, α) be an initial G^{2}-algebra and (Z, ζ) be a final G^{2}-coalgebra. By their universal properties the following two diagrams commute for unique f and g:

G^{2}(GZ) G^{2}A  α G^{2}f  Gζ  GA Z g  Gα ζ A GZf  G^{2}Z G^{2}(GA) G^{2}g .

Applying G to the diagram on the right and gluing the resulting diagram with the one on the left, and proceeding dually, we get the following commuting diagrams:

G^{2}(GZ) G^{2}A  α G^{2}f  Gζ  A GZf G^{2}(G^{2}A)  G^{2}A G^{2}α  Gg G^{2}(Gg)  GA Z  G^{2}Z G^{2}(GA) G^{2}g Gα ζ g G^{2}Z  G^{2}(G^{2}Z) Gf  G^{2}(Gf) G^{2}ζ  .

Then, by Lemma 6.1.3, Gg ∘ f and g ∘ Gf are both isomorphisms, and therefore so are Gf ∘ G^{2}g and G^{2}f ∘ Gg. Thus, Gf and Gg have both right and left inverses and then so do f and g (as Gg ∘ f and g ∘ Gf are isomorphisms).

Notice, in passing, that since α is a G^{2}-algebra morphism (G^{2}A, G^{2}α) → (A, α) it follows that α^{−1} = Gg ∘ f. Similarly, ζ^{−1} = g ∘ Gf. □

By Lemma 6.2.1, for every contravariant endofunctor, G, on an algebraically bicomplete category it follows that

G(μX.G^{2}X) ≅ νX.G^{2}X and G(νX.G^{2}X) ≅ μX.G^{2}X.

So, if in addition, we have that

μX.G^{2}X ≅ νX.G^{2}X  (6.8)

then G has a fixed-point as required.

The need for (6.8) motivates the following:

Definition 6.2.2 1. (c.f. [Fre91]) A V-category is said to be V-algebraically compact if it is V-algebraically complete and the initial algebra of the underlying endofunctor of every V-endofunctor on it is free, in the sense that its inverse is a final coalgebra.

2. For cartesian V, a V-category is parameterised V-algebraically compact if it is V-algebraically compact and parameterised V-algebraically complete. □

Remark. In algebraically compact categories, initial algebras and final coalgebras are canonically isomorphic, in the sense that the unique algebra morphism from an initial algebra to the inverse of a final coalgebra is an isomorphism.

So far we have seen:

Proposition 6.2.3 Let V be cartesian. For every V-bifunctor F on a parameterised V-algebraically compact category, the bifunctor F_{0} has a fixed-point, viz., Fix (F^{†}_{0}^{2}). □

The basic properties of algebraic completeness extend to compactness:

Proposition 6.2.4 ([Fre91]) If A is V-algebraically compact then A_{0} has zero object. □

Hence there are no non-trivial examples of algebraically compact posets.

Lemma 6.2.5 (Bekic̆’s Lemma for Alg. Compact Categories [Fre92]) Let V be cartesian, and let A and B be V-categories. Assume that B is V-algebraically compact. For a functor F_{0} : A_{0} × B_{0} → A_{0} and a V-functor G : A × B → B, if (A, α) is a free F_{0}( , G_{0}^{†} )-algebra then ((A, G_{0}^{†}A), (α, ι_{A}^{G_{0}})) is a free ⟨F_{0}, G_{0}⟩-algebra. □

Again, as a corollary, we obtain the Product Theorem for Parameterised Algebraically Compact Categories:

Theorem 6.2.6 Let V be cartesian, and let A and B be V-categories. If A and B are parameterised V-algebraically compact then so is A × B. □

Algebraic compactness is a self-dual property. Hence:

Corollary 6.2.7 Let V be cartesian.

1. If A is (parameterised) V-algebraically compact then so is A^{op}.

2. If A is parameterised V-algebraically compact then so is A^{op} × A. □

Although the above analysis motivates the introduction of algebraically compact categories by showing that they admit recursive types it neglects the issue of their canonicity. This is addressed below.

6.3 The Doubling Trick

The universal property of recursive types is better understood in the light of another approach to their interpretation. The idea is to universally reduce recursive types to inductive types. For this purpose, following a suggestion of John Power, we work with involutory categories (viz., those categories which are self-dual via an involution), and use the duality to transform bifunctors into endofunctors in a universal way. Then, the inductive type determined by the endofunctor should provide the required recursive type (see Section 6.4).

An abstraction of the category of involutory categories is given in the definition below. (For intuition think of C as being CAT and ( )^{∘} as ( )^{op}.)

Definition 6.3.1 Let C be a category and let ( )^{∘} : C → C be an involution (that is, ( )^{∘} ∘ ( )^{∘} = Id_{C}). The category Inv(C, ( )^{∘}) of involutory objects of C is defined to be the full subcategory of ( )^{∘}-Alg with ( )^{∘}-algebras (A, a) for which a ∘ a^{∘} = id_{A}. □

Convention. In a category with binary products, if f is a morphism X → A_{1} × A_{2} then, for i = 1, 2, we write f_{i} for the composite π_{i} ∘ f : X → A_{i}.

Examples of involutory categories abound as for every locally small category A, we have that (A^{op} × A, ⟨Π_{2}, Π_{1}⟩) is an object of Inv(CAT, ( )^{op}). In this case, morphisms F : (A^{op} × A, ⟨Π_{2}, Π_{1}⟩) → (B^{op} × B, ⟨Π_{2}, Π_{1}⟩) are functors F : A^{op} × A → B^{op} × B such that for every f′ ∈ A^{op} and f ∈ A, the equality F_{1}(f′, f) = F_{2}(f, f′) holds. Motivated by this property, morphisms in Inv(C, ( )^{∘}) are called symmetric.

Are there cofree involutory categories? Yes, as implied by

Proposition 6.3.2 If C has binary products then the forgetful functor U : Inv(C, ( )^{∘}) → C is comonadic.

Proof: We have that U ⊣ H : C → Inv(C, ( )^{∘}) : A ↦ (A^{∘} × A, ⟨π_{2}^{∘}, π_{1}^{∘}⟩) with counit ε_{A} = π_{2} : A^{∘} × A → A, because for every (B, b) ∈ | Inv(C, ( )^{∘}) | and f : B → A in C,

(B, b) (A^{∘} × A, ⟨π_{2}^{∘}, π_{1}^{∘}⟩) ∃! f̆ = ⟨f^{∘} ∘ b^{∘}, f⟩  such that  f̆ A^{∘} × A  A B  f π_{2}  .

Let ℍ : C → C be the comonad determined by U ⊣ H. The comparison functor from Inv(C, ( )^{∘}) to the category of Eilenberg-Moore coalgebras C^{ℍ} sends (A, a) to (A, ⟨a^{∘}, id⟩); its inverse maps (A, α) to (A, α_{1}^{∘}). □

With the notation of the above proposition we have:

Proposition 6.3.3 If C is cartesian closed then so are the coKleisli category C_{ℍ} and Inv(C, ( )^{∘}). Moreover, the comparison functor C_{ℍ} → Inv(C, ( )^{∘}) preserves the cartesian closed structure.

Proof: C_{ℍ} is cartesian closed because the coKleisli category of a cartesian closed category is cartesian closed.

The cartesian closed structure of Inv(C, ( )^{∘}) is as follows:

• Terminal object: (1, 1^{∘} → 1).

• Binary products: (A, a) × (B, b) = (A × B, (A × B)^{∘} ≅ A^{∘} × B^{∘} ⟶^{a×b} A × B).

• Exponentials: (A, a)^{(B,b)} = (A^{B}, (A^{B})^{∘} ≅ (A^{∘})^{B^{∘}} ⟶^{a^{b^{∘}}} A^{B}). □

Convention. We will write Ă and ( )^{§} for A^{∘} × A and ⟨π_{2}^{∘}, π_{1}^{∘}⟩ respectively. In addition, for every involutory object (B, b) and every f : B → A, we will write f̆ for ⟨f^{∘} ∘ b^{∘}, f⟩ : (B, b) → (Ă, ( )^{§}).

The adjunction U ⊣ H of Proposition 6.3.2 provides a universal way to transform bifunctors into covariant endofunctors via the bijective correspondence:

Ă  A F Ă  F̆ symmetric Ă

The operation ( )^{}˘ can be extended to contravariant endofunctors: for G : A^{op} → A, we define Ğ to be (G ∘ Π_{1})^{}˘ : Ă → Ă.

For simplicity, and because it suits our purposes, when defining Inv(CAT, ( )^{op}) the 2-categorical structure of CAT was ignored. Nevertheless, pseudo-symmetric functors (i.e., symmetric up to isomorphism) will appear naturally (see Lemma 6.4.3) and hence it is necessary to relate them with symmetric functors. In particular, it happens that every pseudo-symmetric morphism into a cofree involutory object is isomorphic to a symmetric morphism.

Proposition 6.3.4 Let C be a 2-category with binary 2-products and let ( )^{∘} be an involution on C_{0}. For every (B, b) ∈ | Inv(C_{0}, ( )^{∘}) | and A ∈ | C_{0} |, if

B^{∘} B  Ă Ă^{∘} ≅  ( )^{§} b  f f^{∘}

then f ≅ f̆_{2} : (B, b) → (Ă, ( )^{§}).

Proof: Since

⟨π_{2}^{∘}, π_{1}^{∘}⟩ B^{∘} B b  f f^{∘}  A^{∘} × A (A^{∘} × A)^{∘}  A^{π_{1}^{∘}} f_{2}  π_{2} ≅

it follows that f_{2} ∘ b ≅ f_{1}^{∘} and so f = ⟨f_{1}, f_{2}⟩ ≅ ⟨(f_{2} ∘ b)^{∘}, f_{2}⟩ = f̆_{2}. □

6.4 Algebraic Compactness: Fundamental Property

As bifunctors F : B̆ → B correspond to symmetric endofunctors F̆ : B̆ → B̆, it is reasonable to expect to find Fix (F) from Fix (F̆). In this section we show that, provided that B is algebraically compact, this is possible. First, we outline why:

By Corollary 6.2.7 (2), B̆ is algebraically compact and therefore F̆ has a free algebra (Fix F̆, ιF̆). The coalgebra ((Fix F̆)^{§}, (ιF̆)^{§}) is also free and the canonical isomorphism ρ : ((Fix F̆)^{§}, (ιF̆)^{§}) ≅ (Fix F̆, (ιF̆)^{−1}) induces a free F̆-algebra

\{ \begin{matrix}F (Fix F, Fix F) & ⟵^{f^{−1}} & Fix (F) \\ F (Fix F, Fix F) & ⟶^{f} & Fix (F) \end{matrix}  (6.9)

where

Fix (F) = (Fix F̆)_{2}

and

F̆(Fix F, Fix F) F̆(Fix F̆) F̆(ρ_{2}, id)  (f^{−1}, f) ιF̆  (Fix F, Fix F) (ρ_{2}^{−1}, id) Fix (F̆)  .

The freeness of (6.9) implies that it is canonical in that for every

(β′ : B′ → F (B, B′), β : F (B′, B) → B)

there exists a unique (u′ : B′ → Fix (F), u : Fix (F) → B) such that

f^{−1}  f β′  β F (Fix F, Fix F) F (B′, B) F (u′, u)  u B Fix (F) F (Fix F, Fix F) F (B, B′) F (u, u′)  B′u′ Fix (F)  .

Moreover, Fix (F) is minimal in the sense that it is a retract of every fixed-point: for every β : F (B, B) ≅ B there exists a unique F̆-algebra morphism (u′, u) : (f^{−1}, f) → (β^{−1}, β) and, since

(u′ ∘ u, u′ ∘ u) = (f^{−1}, f) (u, u′) (β^{−1}, β) (u′, u) (f^{−1}, f)

it follows that u′ ∘ u = id. That is, Fix (F) is a retract of B (with section u and retraction u′). Thus we conclude the Fundamental Property of Algebraically Compact Categories (slightly extending a previous result of Peter Freyd):

Theorem 6.4.1 Let V be cartesian. For every V-bifunctor F on a parameterised V-algebraically compact category, the bifunctor F_{0} has a canonical and minimal fixedpoint, viz., (Fix F̆_{0})_{2}. □

The rest of the section justifies and generalises the above outline.

Convention. The duality associated to a involutory category X will be denoted ( )^{x}, except when X is of the form Ă where, following a previous convention, we use ( )^{§}. In addition, for cartesian V, whenever a V-functor F : A → B is said to be symmetric it is assumed that the V-categories A and B are V-involutory (i.e., self-dual via a V-involution).

Moreover, a morphism f in X such that f = f^{x} is called symmetric. We also call an object X ∈ | X | symmetric if id_{X} is too. For example, in Ă the symmetric morphisms have the form (f, f) for some endomorphism f in A whilst the symmetric objects are those (A, A) for A in A.

For symmetric endofunctors on an involutory category, the duality transforms initial algebras to final coalgebras. More generally,

Lemma 6.4.2 For a symmetric functor F : A × B → B, if β : F (A, B) → B is an initial F (A, )-algebra then β^{b} : B^{b} → F (A^{a}, B^{b}) is a final F (A^{a}, )-coalgebra.

Proof: Because x is an F (A^{a}, )-coalgebra morphism (X, χ) → (B^{b}, β^{b}) if and only if x = u^{b} where u is the unique F (A, )-algebra morphism (B, β) → (X^{b}, χ^{b}). □

Lemma 6.4.3 Let V be cartesian, and let A and B be V-categories. Assume that B is V-algebraically compact. For a symmetric V-functor F : A × B → B, if (F_{0}^{†}, ι^{F_{0}}) is an initial parameterised F_{0}-algebra then there exists a canonical natural isomorphism

( )^{a}  ( )^{b} (F_{0}^{†})^{op} ρ^{≅} A_{0}^{op} F_{0}^{†} A_{0}  B_{0} B_{0}^{op}

such that ρ_{A} is symmetric whenever A is.

Proof: By Lemma 6.4.2, (ι_{A}^{F_{0}})^{b} is a final F_{0}(A^{a}, )-coalgebra and therefore the unique ρ_{A} in

(F_{0}^{†}A)^{b} F_{0}^{†}(A^{a})  (F (A, F_{0}^{†}A))^{b} = F (A^{a}, (F_{0}^{†}A)^{b}) F (A^{a}, F_{0}^{†}(A^{a})) ρ_{A}  F (A^{a}, ρ_{A}) (ι_{A}^{F_{0}})^{b} (ι_{A^{a}}^{F_{0}})^{−1}  (6.10)

is an isomorphism.

To see that ρ is natural, let f : X → A in A_{0}. Then, using the definitions we have that

ρ_{A}^{−1} (F_{0}^{†}f)^{b} ρ_{X} F (id, ρ_{A})  ι_{X^{a}}^{F_{0}} ((ι_{X}^{F_{0}})^{b})^{−1} F (id, ρ_{A}^{−1}) = (F (id, ρ_{A}))^{−1} F (f^{a}, (F_{0}^{†}f)^{b}) = (F (f, F_{0}^{†}f))^{b}  ι_{A^{a}}^{F_{0}} ((ι_{A}^{F_{0}})^{b})^{−1}

and hence F_{0}^{†}(f^{a}) = ρ_{X} ∘ (F_{0}^{†}f)^{b} ∘ ρ_{A}^{−1}.

Now assume A is symmetric, then applying ( )^{b} to (6.10) it follows that

F (A, ρ_{A}^{b}) = F (A^{a}, ρ_{A}^{b})^{ρ_{A}^{b}} ((ι_{A^{a}}^{F_{0}})^{−1})^{b} = ((ι_{A}^{F_{0}})^{b})^{−1} ι_{A}^{F_{0}} = ι_{A^{a}}^{F_{0}}

and therefore ρ_{A}^{b} satisfies the same universal property as ρ_{A}. □

The Fundamental Property of Parameterised Algebraically Compact Categories:

Theorem 6.4.4 Let V be cartesian, and let A and B be V-categories. Assume that B is parameterised V-algebraically compact. For a symmetric V-functor F : A×B̆ → B̆, every initial parameterised F_{0}-algebra (F_{0}^{†}, ι^{F_{0}}) canonically induces an initial parameterised F_{0}-algebra (F_{0}^{‡}, φ^{F_{0}}) such that F^{‡} is a symmetric V-functor and φ_{A}^{§} = φ_{A}^{−1} for every symmetric A.

Proof: Following Proposition 6.3.4, define F^{‡} = (Π_{2} ∘ F^{†})^{}˘ . And let φ_{A}^{F_{0}} be defined by

F^{†}A F^{‡}A F(A, ((ρ_{A})_{2}, id)) F (A, F^{†}A) F (A, F^{‡}A)  ((ρ_{A})_{2}^{−1}, id) ι_{A}^{F_{0}} φ_{A}^{F_{0}}  .

By construction, F^{‡} is a symmetric V-functor. The parameterised F_{0}-algebra (F_{0}^{‡}, φ^{F_{0}}) is initial because ((ρ_{A})_{2}, id) : φ_{A}^{F_{0}} ≅ ι_{A}^{F_{0}}.

Now assume A symmetric. Then, by Lemma 6.4.3, ρ_{A} is symmetric. Say ρ_{A} = (r_{A}, r_{A}). By (6.10) we have that F(A, (r_{A}, r_{A})) ∘ (ι_{A}^{F_{0}})^{§} = (ι_{A}^{F_{0}})^{−1} ∘ (r_{A}, r_{A}), and therefore

φ_{A}^{§} = F(A, (id, r_{A})) ∘ (ι_{A}^{F_{0}})^{§} ∘ (id, r_{A}^{−1})
= F(A, (r_{A}^{−1}, id)) ∘ (ι_{A}^{F_{0}})^{−1} ∘ (r_{A}, id)
= φ_{A}^{−1}.  □

The ( _{0})^{‡} operation allow us to refine Proposition 6.1.10:

Proposition 6.4.5 Let V be cartesian, and let A, B and C be V-categories. Assume that C is parameterised V-algebraically compact. For symmetric V-functors F : B × C̆ → C̆ and G : A → B, the canonical natural isomorphism ψ : (F ∘(G×Id))_{0}^{‡} ≅ F_{0}^{‡} ∘G_{0} satisfies ψ_{A}^{§} = ψ_{A}^{−1} for every symmetric A.

Proof: Let A be symmetric and write H for F ∘ (G × Id). By definition, ψ_{A} is the unique in

φ_{A}^{H_{0}} F (GA, H^{‡}A) F (GA, F^{‡}GA) F (GA, ψ_{A})  H^{‡}A F^{‡}GA ψ_{A} φ_{GA}^{F_{0}}  .  (6.11)

Applying ( )^{§} and ( )^{−1} to (6.11) we obtain

F (GA, ψ_{A}^{§})  ψ_{A}^{§} (φ_{A}^{H_{0}})^{§} = (φ_{A}^{H_{0}})^{−1} (φ_{GA}^{F_{0}})^{§} = (φ_{GA}^{F_{0}})^{−1}  ψ_{A}^{−1} F (GA, ψ_{A}^{−1}) (φ_{A}^{H_{0}})^{−1} (φ_{GA}^{F_{0}})^{−1} and

and therefore ψ_{A}^{§} = ψ_{A}^{−1}. □

Proposition 6.4.6 Let V be cartesian, and let A and B be V-categories. Assume that B is parameterised V-algebraically compact. Let F, G : A×B̆ → B̆ be symmetric V-functors and let η : F \underrightarrow{.} G. Then,

1. (η_{A}^{‡})^{§} = (η^{§})_{A}^{‡} for every symmetric A.

2. If η is an isomorphism such that η_{(A,B)}^{§} = η_{(A,B)}^{−1} for every symmetric (A, B) then (η_{A}^{‡})^{§} = (η_{A}^{‡})^{−1} for every symmetric A.

Proof: Let A ∈ | A_{0} | be symmetric. Recall that by definition,

F (A, η_{A}^{‡}) η_{(A,G^{‡}A)} φ_{A}^{F_{0}} φ_{A}^{G_{0}}  η_{A}^{‡} .  (6.12)

(1) Applying ( )^{§} to (6.12) and using the naturality of η^{§} we have

η_{(A,F^{‡}A)}^{§} η_{(A,G^{‡}A)}^{§} F (A, (η_{A}^{‡})^{§})  (η_{A}^{‡})^{§} G(A, (η_{A}^{‡})^{§})  (φ_{A}^{G_{0}})^{§} = (φ_{A}^{G_{0}})^{−1} (φ_{A}^{F_{0}})^{§} = (φ_{A}^{F_{0}})^{−1}

and thus (η_{A}^{‡})^{§} = (η^{§})_{A}^{‡}.

(2) Applying ( )^{−1} to (6.12) and using the naturality of η^{−1} we have

(η_{A}^{‡})^{−1} G(A, (η_{A}^{‡})^{−1})  F (A, (η_{A}^{‡})^{−1}) (φ_{A}^{G_{0}})^{−1}  (φ_{A}^{F_{0}})^{−1} η_{(A,F^{‡}A)}^{−1} = η_{(A,F^{‡}A)}^{§} η_{(A,G^{‡}A)}^{−1}

and thus (η_{A}^{‡})^{−1} = (η^{§})_{A}^{‡} = (η_{A}^{‡})^{§}. □

6.5 Recursive Types Reduce to Inductive Types

When V is cartesian, Propositions 6.2.3 and 6.4.1 provide two fixed-points for the underlying bifunctor of a V-bifunctor F on a parameterised V-algebraically compact category, viz., Fix (F^{†}_{0}^{2}) and (Fix F̆_{0})_{2}. The former was introduced for being a simple inductive type, the later for being canonical and minimal. In this section we show that one can be obtained from the other and vice versa. Thus reducing the recursive type Fix (F_{0}) = (Fix F̆_{0})_{2} to the inductive type Fix (F^{†}_{0}^{2}). We regard this result as a confirmation of the appropriateness of algebraically compact categories as a universe for interpreting recursive types. Moreover, because the reduction of recursive types to inductive types makes different approaches for finding fixed-points of bifunctors fit together and guarantees recursive types in the presence of inductive types, we henceforth propose that this be an indispensable requirement of a universe for interpreting recursive types.

To see that recursive types reduce to inductive types we proceed in two steps.

1. The case in which the bifunctor reduces to a contravariant endofunctor: we show that, for every contravariant endofunctor G,

Fix (G) = (Fix Ğ)_{2} ≅ Fix (G^{2}).

That is, endofunctors suffice.

2. The general case: we show that, for every bifunctor F,

Fix (F) = (Fix F̆)_{2} ≅ Fix (F^{†}).

That is, one variable suffices.

Proposition 6.5.1 For G : A^{op} → A, the symmetric Ğ : Ă → Ă has an initial algebra if and only if G^{2} : A → A has an initial algebra and a final coalgebra.

Proof:

(⇒) We show that

if ((Z, A), (z, a)) is an initial Ğ-algebra then (A, a ∘ Gz) is an initial G^{2}-algebra.

(6.13)

That G^{2} has a final coalgebra follows by dualising (6.13) and by Lemma 6.4.2.

Let (X, x) be a G^{2}-algebra. Then ((GX, X), (id_{GX}, x)) is a Ğ-algebra and, by initiality, the following diagrams commute

g  f GX z  A X GZ Gg  a x G^{2}X Z GA Gf

for unique g and f.

Applying G to the triangle and pasting we get

f A X Gg Gz G^{2}A G^{2}X G^{2}f  GZ x  a  .

That is, f is a G^{2}-algebra morphism (A, a ∘ Gz) → (X, x).

It is unique because for any other such, say u, we have that (z^{−1}∘Gu, u) is a Ğ-algebra morphism ((Z, A), (z, a)) → ((GX, X), (id_{GX}, x)).

(⇐) Let (A, α) be an initial G^{2}-algebra and let (Z, ζ) be a final G^{2}-coalgebra.

By Lemma 6.2.1, (GZ, Gζ) is an initial G^{2}-algebra, (GA, Gα) is a final G^{2}-coalgebra and for a : (GZ, Gζ) ≅ (A, α) and z : (Z, ζ) ≅ (GA, Gα) the equalities α = a ∘ Gz and ζ = (Ga) ∘ z hold.

We show that ((Z, A), (z, a)) is an initial Ğ-algebra.

Let (g, f) be a Ğ-algebra morphism ((Z, A), (z, a)) → ((Y, X), (y, x)). Then, f is a G^{2}-algebra morphism (A, α) → (X, x ∘ Gy) and g is a G^{2}-coalgebra morphism (Y, (Gx) ∘ y) → (Z, ζ). Thus uniqueness follows.

For existence note that by the universal properties of (A, α) and (Z, ζ) the following diagrams commute for unique f and g

G^{2}f  G^{2}Y G^{2}g G^{2}Z GZ GY G^{2}X G^{2}A Gz  a Gy  x p α  A  GXq GA Y Z  Gx yz g  ζ Ga f X

where p = Gy ∘ (G^{2}f) ∘ Gz^{−1} and q = Ga^{−1} ∘ (G^{2}g) ∘ Gx.

On one hand, applying G to each of the above diagrams we get that Gg is the unique G^{2}-algebra morphism (GZ, Gζ) → (GY, Gy∘G^{2}x) and that Gf is the unique G^{2}-coalgebra morphism (GX, G^{2}y ∘ Gx) → (GA, Gα).

On the other hand, applying G^{2} to the right square in the left diagram and appending the left square, and proceeding dually we have,

G^{2}Y G^{2}Z GX GA q  Gx  G^{2}g Ga  G^{2}(GA) G^{2}(GX) G^{2}q G^{2}y G^{2}z Gα Gζ G^{2}A G^{2}X G^{2}(GZ) G^{2}(GY)  G^{2}f G^{2}x G^{2}a G^{2}p  Gz Gy  p GY GZ  .

Therefore, p = Gg and q = Gf. Thus implying that (g, f) is a Ğ-algebra morphism ((Z, A), (z, a)) → ((Y, X), (y, x)). □

Corollary 6.5.2 (Endofunctors Suffice) Let V be cartesian and let A be parameterised V-algebraically compact. For every contravariant V-endofunctor G on A, G_{0}^{2} has free algebra and if (A, φ) is a free G_{0}^{2}-algebra then, writing a for the unique G_{0}^{2}-coalgebra morphism (GA, Gφ) ≅ (A, φ^{−1}), the Ğ_{0}-algebra ((A, A), (a^{−1}, a)) is free. □

Proposition 6.5.3 (One Variable Suffices) Let V be cartesian and let A be parameterised V-algebraically compact. For every V-bifunctor F on A, F^{†}_{0}^{2} has free algebra and if (A, φ) is a free F^{†}_{0}^{2}-algebra then, writing a for the unique F^{†}_{0}^{2}-coalgebra morphism (F^{†}A, F^{†}φ) ≅ (A, φ^{−1}) and α for a ∘ ι_{A}^{F_{0}} ∘ F (A, a^{−1}), the F̆_{0}-algebra ((A, A), (α^{−1}, α)) is free.

Proof: Let ((Z, Z), (ζ^{−1}, ζ)) be a free F̆_{0}-algebra.

If (u, v) is the unique F̆_{0}-algebra morphism ((Z, Z), (ζ^{−1}, ζ)) → ((A, A), (α^{−1}, α)) then (u ∘ v, u ∘ v) is an F̆_{0}-algebra endomorphism on ((Z, Z), (ζ^{−1}, ζ)) and thus u ∘ v = id_{Z}.

If z is the unique F_{0}(Z, )-algebra morphism (Z, ζ) → (F^{†}Z, ι_{Z}^{F_{0}}) which, by Corollary 6.1.16, is an isomorphism then the following diagrams commute

F (Z, Z) ζ Z  ι_{Z}^{F_{0}} F (Z, F^{†}Z) F^{†}Z F (A, F^{†}A) F^{†}A ι_{A}^{F_{0}}  Aα a  F (A, A)  u F (v, u) F (v, z^{−1} ∘ u ∘ a)  z^{−1} F (Z, z^{−1}) F (A, a)

F (A, A) Aα F^{†}Z ι_{Z}^{F_{0}} F (Z, F^{†}Z) F (Z, z)  Zζ F (Z, Z) F (u, v) v F (u, a^{−1} ∘ v ∘ z)  F (A, a^{−1})  ι_{A}^{F_{0}} F (A, F^{†}A) F^{†}A a^{−1} z

and it follows that F^{†}v = z^{−1} ∘ u ∘ a and F^{†}u = a^{−1} ∘ v ∘ z. Then, (v ∘ u, v ∘ u) is an F̆^{†}_{0}-algebra endomorphism on ((A, A), (α^{−1}, α)) which, by Corollary 6.5.2, is free and thus v ∘ u = id_{A}. □

Conversely:

Proposition 6.5.4 Let V be cartesian and let A be parameterised V-algebraically compact. For every V-bifunctor F on A, F̆_{0} has free algebra and if ((A, A), (α^{−1}, α)) is a free F̆_{0}-algebra then, writing a for the unique F_{0}(A, )-algebra morphism (F^{†}A, ι_{A}^{F_{0}}) ≅ (A, α), the F^{†}_{0}^{2}-algebra (A, (F^{†}a) ∘ a^{−1}) is free.

Proof: Recall that a is an isomorphism because, by Corollary 6.1.16, (A, α) is a free F_{0}(A, )-algebra.

By Proposition 6.5.1 (⇒) —see (6.13)— it is enough to show that ((A, A), (a^{−1}, a)) is a free F̆^{†}_{0}-algebra.

Let ((Z, Z), (z^{−1}, z)) be a free F̆^{†}_{0}-algebra.

If (u, v) is the unique F̆^{†}_{0}-algebra morphism ((Z, Z), (z^{−1}, z)) → ((A, A), (a^{−1}, a)) then u∘v = id_{Z} because (u∘v, u∘v) is an F̆^{†}_{0}-algebra endomorphism on ((Z, Z), (z^{−1}, z)).

For ζ = z ∘ ι_{Z}^{F_{0}} ∘ F (Z, z^{−1}), the following two cubes commute

a F (u, v)  z^{−1} v A F^{†}u Z F (Z, F^{†}Z)F (A, F^{†}A) ζ F (A, A) F (A, a)  F^{†}A F (Z, z^{−1})  F^{†}Z F (Z, Z)  α F (u, F^{†}u)  ι_{A} ι_{Z} z u F (v, u)  a^{−1} F (Z, F^{†}Z) F (A, A)  A ζ Z F^{†}Z F (Z, z) F (Z, Z) F (A, a^{−1})  α F (A, F^{†}A)  F^{†}v ι_{A} ι_{Z} F (v, F^{†}v)  F^{†}A

and therefore (v ∘ u, v ∘ u) is an F̆_{0}-algebra endomorphism on ((A, A), (α^{−1}, α)). Thus, v ∘ u = id_{A}. □

6.6 Algebraic ω-Completeness and ω-Compactness

Various examples of algebraically complete categories satisfy the stronger property that the initial algebra of an endofunctor can be computed by a limit process from iterations of the endofunctor over the initial object. Hence the following definitions:

Definition 6.6.1 For an endofunctor F on a category with an initial object 0 we define its standard ω-chain Δ_{F} to be ⟨F^{k}(0), F^{k}(0 → F 0)⟩_{k∈ | ω |} and say that F is initially ω-convergent if Δ_{F} has colimit and F preserves it. □

Definition 6.6.2 (c.f. [Adá93]) A V-category A is said to be V-algebraically ω-complete if A_{0} has initial object and the underlying endofunctor of every V-endofunctor on A is initially ω-convergent. □

A general result from [Adá93] yields that the following are algebraically ω-complete: Pfn_{ω} (the category of countable sets and partial functions), Rel_{ω} (the category of countable sets and relations), F -Vec_{ω} (the category of countably dimensional vector spaces, for a countable field F, and linear functions) and Well_{ω} (the category of countable wellordered sets and join-preserving functions). Examples among posets are characterised by:

Proposition 6.6.3 ([Adá93]) A poset is algebraically ω-complete if and only if it has least element and every infinite chain has a unique upper bound. □

That V-algebraic ω-completeness entails V-algebraic completeness follows from the Basic Lemma.

Lemma 6.6.4 (Basic Lemma [SP82]) For an initially ω-convergent endofunctor F, if δ : Δ_{F} \underrightarrow{.} A is colimiting then, writing α for the unique F δ ≅ (δ succ) : Δ_{F} succ \underrightarrow{.} F A (where succ : ω → ω : k ↦ k + 1), the F -algebra (A, α) is initial. □

Corollary 6.6.5 V-algebraic ω-completeness implies V-algebraic completeness. □

The import of ω-completeness is that it provides most of the examples of algebraically complete categories. Unfortunately the concept is not useful for classifying categories for interpreting inductive types. For example, algebraically ω-complete posets are not even closed under binary products as ω + 1 and 2 are algebraically ω-complete but (ω + 1) × 2 is not, since the chain ⟨(k, 0)⟩_{k∈ | ω |} has two upper bounds, viz., (ω, 0) and (ω, 1).

Definition 6.6.6 (c.f. [Adá93]) A V-category A is said to be V-algebraically ω-compact if A_{0} has a zero object and the underlying endofunctor of every V-endofunctor on A is ω-convergent, in the sense that it is initially and finally ω-convergent and the initial algebra induced by the colimit of its standard ω-chain is canonically isomorphic to the final coalgebra induced by the limit of its standard ω^{op}-chain. □

The paradigmatic example of ω-compactness is pCpo which, as will be shown, is Cpo-algebraically ω-compact (see Section 7.2). Two other examples are Pin_{ω} (the category of countable sets and partial injections) and Hil_{ω} (the category of countably dimensional Hilbert spaces and linear maps of norm at most 1) which, as shown in [Bar92], are algebraically ω-compact.

6.7 Algebraic Supercompleteness and Supercompact-

ness

We conjecture that algebraic completeness and compactness are not closed under exponentiation and thus proceed to impose a super closure property on top of them which will guarantee closure under exponentiation while maintaining closure under finite products. In the compact case we further maintain closure under taking opposite categories.

Definition 6.7.1 Let V be cartesian and such that V-Cat is 2-cartesian-closed. A V-category A is said to be (parameterised) V-algebraically (ω-)supercomplete (resp. (ω-)supercompact) if for every V-category B, the functor category [B, A] is (parameterised) V-algebraically (ω-)complete (resp. (ω-)compact). □

Examples do exist: pCpo is parameterised Cpo-algebraically ω-supercompact. The reasons being quite general and studied in Section 7.2 —see Theorem 7.3.12 (1).

The closure under binary products, exponentials and opposites is essentially due to the isomorphisms

[C, A × B] ≅ [C, A] × [C, B],
[C, [B, A]] ≅ [B × C, A], and
[C, A^{op}] ≅ [C^{op}, A]^{op}.

Proposition 6.7.2 Let V be cartesian and such that V-Cat is 2-cartesian-closed.

1. 1 is parameterised V-algebraically supercompact.

2. If A and B are parameterised V-algebraically supercomplete (resp. supercompact) then so is A × B.

3. If A is (parameterised) V-algebraically supercomplete (resp. supercompact) and B is V-algebraically supercomplete (resp. supercompact) then [B, A] is (parameterised) V-algebraically supercomplete (resp. supercompact).

4. If A is (parameterised) V-algebraically supercompact then so is A^{op}. □

7 Recursive Types in Cpo-Categories

We investigate Cpo-algebraic completeness and compactness. This is a particularly well behaved setting. For example, we show that Cpo-algebraic completeness and parameterised Cpo-algebraic completeness coincide; whilst, for Cppo_{⊥}-categories, we further show the coincidence of Cpo-algebraic completeness and parameterised Cpo-algebraic compactness. As a by-product, we identify a 2-category of kinds, called Kind, all of whose objects are parameterised Cpo-algebraically ω-compact categories. Kind is 2-cartesian-closed, op-closed, closed under the formation of categories of algebras and coalgebras with lax homomorphisms, and has a unique (up to isomorphism) uniform fixed-point operator. Thus, Kind is appropriate for interpreting type systems with kinds built by recursion from products, exponentials, algebras and coalgebras; but neither such a system nor its interpretation will be discussed here.

7.1 Cpo-Algebraic Completeness

Cpo-algebraic completeness is studied. First, we focus on those Cpo-categories for which the initial object embeds in every object of the category. The reason being that in this case the presence of colimits of ω-chains of embeddings guarantees algebraic ω-completeness which turns out to coincide with algebraic completeness. Further, an equational characterisation of initial algebras becomes available. Second, we explore categories of algebras and lax homomorphisms to finally show that algebraic completeness and parameterised algebraic completeness coincide.

Definition 7.1.1 In a Poset-category, an e-initial object is an initial object such that every morphism with it as source is an embedding. The dual notion is called a p-terminal object. An object which is both e-initial and p-terminal is called an ep-zero. □

In Pposet (the full subcategory of Poset of all pointed posets) the terminal object is p-terminal whilst in Pposet_{⊥} (the subcategory of Pposet of strict monotone functions) it is an ep-zero.

Lemma 7.1.2 In a Poset-category with initial object the following are equivalent:

1. The initial object is e-initial.

2. Every hom-poset has a least element and composition is right strict.

3. For every object X there exists X → 0 such that for every object Y, the composite X → 0 → Y is the least among all X → Y.

4. For every object X there exists X → 0 such that (X → 0 → X) ≤ id_{X}. □

Theorem 7.1.3 A Cpo-category with e-initial object and colimits of ω-chains of embeddings is Cpo-algebraically ω-complete.

Proof: Let F be a Cpo-endofunctor on a Cpo-category with e-initial object and colimits of ω-chains of embeddings.

Since the initial object is e-initial and F preserves ep-pairs, the standard ω-chain Δ_{F} consists of embeddings and hence it has a colimit, say γ : Δ_{F} \underrightarrow{.} C. By the Limit/Colimit Coincidence Theorem, γ is a cone of embeddings and ⋁ γ_{n} ∘ (γ_{n})^{R} = id_{C}. Thus, F γ : F Δ_{F} \underrightarrow{.} F C is a cone of embeddings and since

⋁(F γ_{n}) ∘ (F γ_{n})^{R} = ⋁ F (γ_{n} ∘ (γ_{n})^{R}) = F (⋁ γ_{n} ∘ (γ_{n})^{R}) = id_{F C}

it follows, by the Limit/Colimit Coincidence Theorem, that F γ is colimiting. Hence, F is initially ω-convergent. □

Example 7.1.4 Cppo has p-terminal object and limits of ω^{op}-chains of projections. Hence, it is Cpo-algebraically ω-cocomplete but it is not Cpo-algebraically compact (as it has no initial object). □

In the presence of an e-initial object, Cpo-algebraic completeness and Cpo-algebraic ω-completeness coincide:

Theorem 7.1.5 A Cpo-algebraically complete category with an e-initial object is Cpo-algebraically ω-complete.

Proof: It is enough to show that the standard ω-chain of every Cpo-endofunctor has a colimit. This will be preserved, using the Limit/Colimit Coincidence Theorem, because Cpo-functors preserve embeddings and lubs of ω-chains.

Let F be a Cpo-endofunctor and let (A, α) be an initial F -algebra. The commuting diagram

F^{2}(0 → A) F^{2}0 F^{2}A  · · · · · · 0 A  α F A F 0F (0 → A) F α F (0 → F 0)

induces a cone of embeddings δ : Δ_{F} \underrightarrow{.} A defined by δ_{0} = (0 → A) and, for k ∈ | ω |, by δ_{k+1} = α ∘ F δ_{k}. To see that it is colimiting we invoke the Limit/Colimit Coincidence Theorem and show that ⋁ δ_{k} ∘ (δ_{k})^{R} is an F -algebra endomorphism on (A, α):

(⋁ δ_{k} ∘ (δ_{k})^{R}) ∘ α = ⋁ δ_{k+1} ∘ (δ_{k+1})^{R} ∘ α
= ⋁ α ∘ F (δ_{k}) ∘ F (δ_{k})^{R}
= α ∘ F (⋁ δ_{k} ∘ (δ_{k})^{R}).

In passing notice that α : F δ ≅ (δ succ) where succ : ω → ω : k ↦ k + 1. □

In the presence of an e-initial object, initial algebras of Cpo-endofunctors are characterised as those fixed-points whose least endomorphism is the identity.

Definition 7.1.6 ([Fre90]) Let F : A → A be a Cpo-functor. An special F -invariant object is a fixed-point α : F A ≅ A such that id_{A} is the least F -algebra endomorphism on (A, α). □

Theorem 7.1.7 ([Fre90]) In a Cppo-category with right-strict composition, special invariant objects of Cpo-endofunctors are initial algebras.

Proof: Let F be a Cpo-endofunctor on a Cpo-category A with e-initial object.

If (A, α) is an special F -invariant object then, writing fix for the least fixed-point operator in Cppo, we have that fix (λx. α ∘ (F x) ∘ α^{−1}) = id_{A}. Moreover, for every F -algebra (B, β), by the fixed-point property, fix (λx. β ∘ (F x) ∘ α^{−1}) : (A, α) → (B, β). Finally, if h : (A, α) → (B, β) then

A(A, A) A(A, B) h ∘ λx. β ∘ (F x) ∘ α^{−1} λx. α ∘ (F x) ∘ α^{−1} A(A, A) A(A, B) h ∘

and, by the uniformity of fix ,

fix (λx. β ∘ (F x) ∘ α^{−1}) = h ∘ fix (λx. α ∘ (F x) ∘ α^{−1}) = h. □

Aiming at establishing the equivalence between Cpo-algebraic completeness and parameterised Cpo-algebraic completeness we now start an excursion into categories of algebras and lax homomorphisms.

Definition 7.1.8 For a Poset-functor (Cpo-functor) F : A → A, the Poset-category (Cpo-category) of F-algebras and lax algebra morphisms, F -Alg_{≤}, has objects (A, α) where A ∈ | A | and α : F A → A in A, and morphisms h : (A, α) ⟶_{≤} (B, β) where h : A → B in A is such that

F A A  B F B F h h α  β ≤  .

The hom-order, composition and identities are as in A.

For a monad 𝕋 : A → A in Poset-CAT (Cpo-CAT), the Poset-category (Cpo-category) A_{≤}^{𝕋} is the full subcategory of 𝕋-Alg_{≤} of Eilenberg-Moore algebras. □

Remark. In the Cpo-enriched case F -Alg_{≤} and A_{≤}^{𝕋} have hom-cpos because for every

ω-chain ⟨f_{k} : (A, α) ⟶_{≤}(B, β)⟩,

(∀ k ∈ | ω |. f_{k} ∘ α ≤ β ∘ F f_{k}) ⇒ (⋁ f_{k}) ∘ α ≤ β ∘ ⋁ F (f_{k}) = β ∘ F (⋁ f_{k}).

Definition 7.1.9 An algebra of a Poset-endofunctor is maximally initial if it is initial and the unique algebra morphism to any other algebra is maximal among all lax algebra morphisms. □

Maximal initiality is relevant for it guarantees the monotonicity of the mapping which to an algebra associates the unique algebra morphism from the maximally-initial algebra into it.

Proposition 7.1.10 Initial algebras of Cpo-endofunctors are maximally initial.

Proof: Let F : A → A be a Cpo-endofunctor. For an initial F -algebra (A, α) and a lax F -algebra morphism h : (A, α) ⟶_{≤} (B, β) define Φ : A(A, B) → A(A, B) as the continuous mapping x ↦ β ∘ (F x) ∘ α^{−1}. Then, ⟨Φ^{k}(h)⟩ is an ω-chain and

⋁ Φ^{k+1}(h) = ⋁ β ∘ F (Φ^{k}h) ∘ α^{−1}
= β ∘ F( ⋁ Φ^{k}(h)) ∘ α^{−1}.

So ⋁ Φ^{k}(h) is an F -algebra morphism (A, α) → (B, β) and also h ≤ ⋁ Φ^{k}(h). □

Corollary 7.1.11 Let F : A → A be a Cpo-functor. If (A, α) is an initial F -algebra then, for every B ∈ | A |, the mapping A(F B, B) → A(A, B) sending β to the unique (A, α) → (B, β) is continuous.

Proof: Let u : A(F B, B) → A(A, B) be the described mapping. If β ≤ β′ then u(β) : (A, α) ⟶_{≤} (B, β′) and since, by Proposition 7.1.10, (A, α) is maximally initial it follows that u(β) ≤ u(β′).

For an ω-chain ⟨β_{k}⟩ in A(F B, B), it follows that ⋁ u(β_{k}) : (A, α) → (B, ⋁ β_{k}) and we are done. □

Theorem 7.1.12 Cpo-algebraic completeness (resp. compactness) implies parameterised Cpo-algebraic completeness (resp. compactness).

Proof: Let F : A × B → B be a Cpo-functor. Assuming that B is Cpo-algebraically complete (compact) we show that F^{†} : A → B is a Cpo-functor.

F^{†} is a Cpo-functor because F_{X,Y}^{†} : A(X, Y) → B(F^{†}X, F^{†}Y) is the composition of the continuous mappings A(X, Y) → B(F (X, F^{†}Y), F^{†}Y) sending f to ι_{Y}^{F} ∘F (f, F^{†}Y) and B(F (X, F^{†}Y), F^{†}Y) → B(F^{†}X, F^{†}Y) sending h to the unique F (X, )-algebra morphism (F^{†}X, ι_{X}^{F}) → (F^{†}Y, h) —see Corollary 7.1.11. □

7.2 Cpo-Algebraic Compactness

In the vein of the previous section we study Cpo-algebraically compact categories with ep-zero. The result is that for Cppo_{⊥}-categories, completeness and compactness in their parameterised and ω forms all coincide (see Corollary 7.2.5).

Remark. When considering Cppo_{⊥}-enrichment (Pposet_{⊥}-enrichment), we take the monoidal structure on Cppo_{⊥} (Pposet_{⊥}) to be the smash product for the tensor and the Sierpińsky space for the unit. Hence, to give a Cppo_{⊥}-enrichment (Pposet_{⊥}-enrichment) on a category is to give a Cppo-enrichment (Pposet-enrichment) in which composition is strict.

Frequently, explicit mention of ep-zeros is avoided because,

Proposition 7.2.1 A Poset-category has ep-zero if and only if it is Pposet_{⊥}-enriched and has an initial object. □

By Theorem 7.1.7 and its dual:

Theorem 7.2.2 ([Fre90]) In a Cppo_{⊥}-category, special invariant objects are free algebras. □

Moreover, because of the Limit/Colimit Coincidence Theorem, the above can be strengthened to:

Theorem 7.2.3 For a Cppo_{⊥}-category, Cpo-algebraic completeness implies Cpo-algebraic ω-compactness.

Proof: Let A be a Cppo_{⊥}-category and let F be a Cpo-endofunctor on it.

By Theorem 7.1.5, if (A, α) is an initial F -algebra then the standard ω-chain has a colimiting cone of embeddings δ : Δ_{F} \underrightarrow{.} A for which α : F δ ≅ (δ succ) where succ : ω → ω : k ↦ k + 1. Thus, α^{−1} : (δ succ)^{R} ≅ F (δ^{R}) and since Δ_{F}^{R} is the standard ω^{op}-chain and, by the Limit/Colimit Coincidence Theorem, the cone δ^{R} : A \underrightarrow{.} Δ_{F}^{R} is limiting it follows, by the (dual of the) Basic Lemma, that (A, α^{−1}) is a final F -coalgebra.

□

Corollary 7.2.4 A Cpo-category with ep-zero and colimits of ω-chains of embeddings is parameterised Cpo-algebraically ω-compact.

Proof: By Theorems 7.1.3, 7.1.12 and 7.2.3. □

Corollary 7.2.5 For a Cppo_{⊥}-category,

Cpo-alg. ω-compactness parameterised Cpo-alg. compactness parameterised Cpo-alg. completeness ω-completeness Cpo-alg. Cpo-alg. completeness ≡ Cpo-alg. compactness  □

7.3 Categories of Kinds

We introduce a 2-category of Cpo-algebraically compact categories, Kind, defined to contain categories in which the existence, preservation and coincidence of all colimits of standard ω-chains and limits of standard ω^{op}-chains is guaranteed.

Afterwards the closure properties of Kind are studied. In particular we show that it is 2-cartesian-closed and has a fixed-point operator characterised by a uniformity property, but much more holds (see Theorem 7.3.12).

7.3.1 PKind

For the sake of simplicity and generality we first concentrate on Cpo-algebraic cocompleteness. To guarantee the existence and preservation of limits of all standard ω^{op}-chains, we wish to group all those small Cpo-categories with p-terminal object and limits of ω^{op}-chains of projections in a 2-category (see Theorem 7.1.3).

Definition 7.3.1 PKind is the 2-category of small Cpo-categories with p-terminal object and limits of ω^{op}-chains of projections, Cpo-functors and natural transformations.

□

Corollary 7.3.2 1. Every category in PKind is parameterised Cpo-algebraically ω-cocomplete.

2. PKind is 2-cartesian.

Proof:

(1) By Theorems 7.1.3 and 7.1.12.

(2) Because 1 is in PKind and, for A, B in PKind, A × B has a p-terminal object and limits of ω^{op}-chains of projections given pointwise. □

PKind does not have exponentials, the reason being exclusively that the property of having a p-terminal object is not closed under exponentiation. For example, Cppo has a p-terminal object but Cppo^{→} does not. For, if the terminal object 1 → 1 were to be p-terminal then, for every A_{0} → A_{1} ∈ | Cppo^{→} | it should happen that

1 ⊥ ⊥ A_{0} A_{1}

which is not always the case. Instead we have the weaker property

1 ⊥ ⊥ ≤  , A_{0} A_{1}

which we interpret as lax naturality (see page 27). Thus the following:

Definition 7.3.3 For small Cpo-categories A and B, [A, B]_{≤} is the Cpo-category with the Cpo-functors A → B as the set of objects, and where the hom [A, B]_{≤}(F, G) is the cpo with underlying set Nat_{≤}(F, G) of lax natural transformations F \underrightarrow{.}_{≤} G ordered pointwise. □

For A in Cpo-Cat and B in PKind, it is easily verified that [A, B]_{≤} has p-terminal object, whilst —as we will see— the basic reason for which it has limits of ω^{op}-chains of projections is that projections are natural and that limits can be computed pointwise.

Lemma 7.3.4 Let A and B be Cpo-categories. Then, η ∈ [A, B]_{≤}(F, G) is a projection if and only if η : F \underrightarrow{.} G and for every A ∈ | A |, the component η_{A} : F A → GA is a projection in B. □

Lemma 7.3.5 Let A and B be Cpo-categories and let Γ : G → [A, B]. If for every X ∈ | A | the diagram Γ_{X} : G → B : e ↦ (Γe)_{X} has a Cpo-limit then so does the diagram Γ : G → [A, B] → [A, B]_{≤}

Proof: Briefly, Γ : G → [A, B] has a Cpo-limit as it does pointwise, and the claim follows because they are preserved by [A, B] → [A, B]_{≤}.

In detail, for X ∈ | A | let π^{(X)} : P X \underrightarrow{.} Γ_{X} be Cpo-limiting. For every f : X → Y in A define Γ_{f} : Γ_{X} \underrightarrow{.} Γ_{Y} by (Γ_{f})_{N} = (ΓN)f for N ∈ | G | and let P f be the unique mediating morphism (Γ_{f} ∘ π^{(X)}) → π^{(Y)}. This process defines a Cpo-functor P : A → B, as each π^{(X)} is Cpo-limiting, and a cone π : P \underrightarrow{.} Γ : G → [A, B] where (π_{N})_{X} = π_{N}^{(X)} for N ∈ | G |. We show that π is limiting in [A, B]_{≤}. Let γ : Q \underrightarrow{.} Γ : G → [A, B]_{≤} and for

X ∈ | A | define γ^{(X)} : QX \underrightarrow{.} Γ_{X} by γ_{N}^{(X)} = (γ_{N})_{X} for N ∈ | G |. If μ : γ \underrightarrow{.}_{≤}π then for

every X ∈ | A | it follows that μ_{X} : γ^{(X)} → π^{(X)}, showing uniqueness. For existence, we need only verify that \{μ_{X} : γ^{(X)} → π^{(X)}\} : Q \underrightarrow{.}_{≤}P. For every f : X → Y in A since

QX QY  ΓY ΓX P Y P X π^{(Y)} Qf  π^{(X)} γ^{(X)} γ^{(Y)}  Γ_{f} ≤  P f

it follows that π^{(Y)} ∘ (γ^{(Y)} → π^{(Y)}) ∘ Qf ≤ π^{(Y)} ∘ (P f) ∘ (γ^{(X)} → π^{(X)}) and, as π^{(Y)} is Cpo-limiting, we have (γ^{(Y)} → π^{(Y)}) ∘ Qf ≤ (P f) ∘ (γ^{(X)} → π^{(X)}) as desired. Finally, to conclude that π is Cpo-limiting, by Proposition 2.2.1, we need show that for every

α, β : Q \underrightarrow{.}_{≤}P in [A, B]_{≤},

π ∘ α ≤ π ∘ β ⇒ α ≤ β.  (7.1)

Assuming the antecedent of (7.1) we have that for every N ∈ | G | and every X ∈ | A |,

π_{N}^{(X)} ∘ α_{X} = (π_{N})_{X} ∘ α_{X} ≤ (π_{N})_{X} ∘ β_{X} = π_{N}^{(X)} ∘ β_{X};

and hence, that for every X ∈ | A |, π^{(X)} ∘α_{X} ≤ π^{(X)} ∘β_{X}. Thus, as π^{(X)} is Cpo-limiting, it follows that α_{X} ≤ β_{X} for every X ∈ | A | and so α ≤ β. □

Proposition 7.3.6 If A is in Cpo-Cat and B is in PKind then [A, B]_{≤} is in PKind.

Proof: The p-terminal object in [A, B]_{≤} is the constantly 1 Cpo-functor and [A, B]_{≤} has limits of ω^{op}-chains of projections by Lemma 7.3.5 using Lemma 7.3.4 and the Limit/Colimit Coincidence Theorem. □

Perhaps surprisingly, PKind is closed under the formation of categories of algebras and lax homomorphisms. Once again, for an endofunctor in PKind, it is easily verified that the category of algebras and lax homomorphisms has a p-terminal object; that it has limits of ω^{op}-chains of projections basically follows because projections are homomorphisms and the functor forgetting the algebra structure creates limits.

Lemma 7.3.7 Let F be a Poset-endofunctor on A. Then h : (A, α) ⟶_{≤} (B, β) is a projection in F -Alg_{≤} if and only if h : (A, α) → (B, β) and h : A → B is a projection in A. □

Lemma 7.3.8 For a Poset-functor F : A → A, the forgetful functor U : F -Alg_{≤} → A creates Poset-limits of diagrams in F -Alg.

Proof: Briefly because the forgetful functor F -Alg → A creates Poset-limits and these are preserved by the inclusion functor F -Alg → F -Alg_{≤}.

In detail, let Γ : G → F -Alg and let π : A \underrightarrow{.} UΓ : G → A be a Poset-limit. The object mapping of Γ gives rise to a natural transformation | Γ | : F UΓ \underrightarrow{.} UΓ and thus there exists a unique α : | Γ | ∘ F π → π. The cone π : (A, α) \underrightarrow{.} Γ is Poset-limiting in F -Alg_{≤} as should be clear after verifying that for ρ : (B, β) \underrightarrow{.}_{≤}Γ the unique h : ρ → π is a lax F -algebra morphism (B, β) ⟶_{≤}(A, α). This holds because chasing the diagram

UΓ F UΓ F B B β  A F A  | Γ | ≤  α  π ρ  F π F ρ h F h

we have that π ∘ h ∘ β ≤ π ∘ α ∘ F h from which we conclude that h ∘ β ≤ α ∘ F h. □

Corollary 7.3.9 For a monad 𝕋 : A → A in Poset-CAT, the forgetful functor A_{≤}^{𝕋} → A creates Poset-limits of diagrams in A^{𝕋}.

Proof: Because the forgetful functors A^{𝕋} → A and 𝕋-Alg_{≤} → A create limits of diagrams in A^{𝕋}, and A_{≤}^{𝕋} is a full subcategory of 𝕋-Alg_{≤}. □

Proposition 7.3.10 1. If F : A → A is in PKind then so is F -Alg_{≤}.

2. If 𝕋 : A → A is a monad in PKind then A_{≤}^{𝕋} is in PKind.

Proof:

(1) The p-terminal object is F 1 → 1 and F -Alg_{≤} has limits of ω^{op}-chains of projections by Lemma 7.3.8 using Lemma 7.3.7 and the Limit/Colimit Coincidence Theorem.

(2) The p-terminal object, T 1 → 1, is an Eilenberg-Moore algebra and A_{≤}^{𝕋} has limits of ω^{op}-chains of projections by Corollary 7.3.9 using Lemma 7.3.7 and the Limit/Colimit Coincidence Theorem. □

7.3.2 Kind

Kind is obtained by simply self dualising the property defining categories in PKind.

Definition 7.3.11 Kind is the 2-category of small Cpo-categories with ep-zero and colimits of ω-chains of embeddings, Cpo-functors and natural transformations. □

Remark. In [Bar92] it is observed that a non-empty Pposet_{⊥}-category with colimits of ω-chains has ep-zero, viz., the colimit of X ⟶^{⊥} X ⟶^{⊥} X → … for any object X. Unfortunately when restricting the ω-chains to embeddings, this does not hold. For example, the Pposet_{⊥}-category induced by the ordered monoid ({⊥, ⊤}, ⊢, ⊤, ∧) has colimits of ω-chains of embeddings but does not have ep-zero.

Examples of categories in Kind are: ω+1 (see page 45), Pfn, Rel (the category of sets and relations) and pCpo.

In virtue of the results of the previous subsection we conclude (1)–(5) below:

Theorem 7.3.12 1. Every category in Kind is parameterised Cpo-algebraically ω-supercompact.

2. Kind is 2-cartesian-closed.

3. If A is in Kind then so is A^{op}.

4. If F : A → A is in Kind then so are F -Alg_{≤} and F -CoAlg_{≥} (= (F^{op}-Alg_{≤})^{op}).

5. If 𝕋 : A → A is a (co)monad in Kind then A_{≤}^{𝕋} (A_{≥}^{𝕋}) is in Kind.

6. Fix is the unique (up to isomorphism) uniform fixed-point operator in Kind. That is, it is characterised by the uniformity property that for every zero-preserving functor V : B ∘→ Y in Kind,

F G B Y  B Y V  V  Fix G Fix F ⟹  1  B YV ≅  ≅ α  β

where β : ι^{G} → (V ι^{F}) ∘ α_{Fix F}.

Proof: (6) Fix is uniform because

V (ι^{F} : F (Fix F) → Fix F)

≅ V (F (colim Δ_{F}) → colim Δ_{F}) , Fix F ≅ colim Δ_{F}
= V F (colim Δ_{F}) → V (colim Δ_{F})
≅ GV (colim Δ_{F}) → V (colim Δ_{F}) , V F ≅ GV
≅ G(colim V Δ_{F}) → colim (V Δ_{F}) , V preserves colimits of ω-chains of embeddings
≅ G(colim Δ_{G}) → colim Δ_{G}  , V Δ_{F} ≅ Δ_{G}
≅ ι^{G} : G(Fix G) → Fix G.

To see that it is the unique such we start with the universal property which gives ω+1 its name:

Let J : ω + 1 → ω+1 be the Cpo-functor sending k → l to k : k → l. Then, every Cpo-functor Δ : ω + 1 → C for which Δ ↾ ω = (ω ↪ ω + 1 ⟶^{Δ} C) is an ω-chain of embeddings and ⟨Δ(n → ω)⟩_{n∈ | ω |} : Δ ↾ ω \underrightarrow{.} Δ(ω) is colimiting has strict Kan extension along J in Cpo-Gpd. That is, there exists a Cpo-functor Kan Δ : ω+1 → C such that Δ = (Kan Δ) ∘ J and

ω+1 ω + 1 J  C D  ⟹ D ≅ Kan Δ. Δ ≅

The crucial fact making the property hold is that ω+1 is obtained from ω + 1 by freely turning all its morphisms into embeddings.

Now, for F : A → A in Kind let Δ_{F}^{#} : ω + 1 → A be the diagram

⋯ 0  ⋯ F 0 Fix F ι^{F} F (Fix F)

constructed in the proof of Theorem 7.1.5. Then we have that

ω+1 J ω + 1  ω+1 J ω + 1 succ  SUCC = Kan (J succ) Kan Δ_{F}^{#} A Δ_{F}^{#} ω+1 J ω + 1  Kan Δ_{F}^{#} A succ ω + 1  A Δ_{F}^{#}≅  F Δ_{F}^{#}

where succ : ω + 1 → ω + 1 sends k ∈ | ω | to k + 1 and ω to itself. Therefore

SUCC F ω+1 Kan Δ_{F}^{#} A ≅ ω+1 Kan Δ_{F}^{#}A  .  (7.2)

And finally, if Y is a uniform fixed-point operator:

Y F ≅ (Kan Δ_{F}^{#})(Y SUCC) , applying the uniformity property to (7.2)
= (Kan Δ_{F}^{#})(ω)  , Y SUCC = ω
= Δ_{F}^{#}(ω)
= Fix F.  □

Remark. For A in Kind, the extension of Fix to [A, A]_{≤} → A is a locally continuous mapping, but in general it is not a functor as it only satisfies Fix (η∘μ) ≤ (Fix η)∘(Fix μ).

Recalling that ( )^{†} = Fix ∘ Λ( ) we have:

Corollary 7.3.13 If A and B are in Kind then so is ( )^{†} : [A × B, B] → [A, B].

Moreover, it is uniform in the sense that

B YV  ⟹ F  F^{†} G^{†} G  A X U U × V X × Y A × B  B YV ≅  ≅ α  β

where β_{A} : ι_{UA}^{G} → (V ι_{A}^{F}) ∘ α_{(A,F^{†}A)}. □

As the following proposition shows, sometimes the parameterised fixed-point operator can be constructed so as to satisfy a stronger strict uniformity property. (This will be needed in Section 9.2.)

Proposition 7.3.14 Let

B YV F G U × V X × Y A × B

in Kind.

If V creates colimits of ω-chains of embeddings then for every initial parameterised G-algebra (G^{†}, ι^{G}) there exists a unique initial parameterised F -algebra (F^{†}, ι^{F}) such that

A X G⟨Id, G^{†}⟩ F^{†} F ⟨Id, F^{†}⟩ G^{†} ≅^{ι^{F}} ≅^{ι^{G}} U  B YV  .

Proof: For A ∈ | A |, by Theorem 7.1.5, G^{†}UA = colim Δ_{G(UA, )} and since V Δ_{F (A, )} = Δ_{G(UA, )} it follows that there exists a unique F^{†}A = colim Δ_{F (A, )} such that V F^{†}A = G^{†}UA. Also, for f : A → A′ in A, F^{†}f mediates between F^{†}A and F^{†}A′ so that V F^{†}f mediates between G^{†}UA and G^{†}UA′ and thus equals G^{†}Uf.

Moreover, ι_{A}^{F} mediates between F (A, F^{†}A) and F^{†}A so that V ι_{A}^{F} mediates between G(UA, G^{†}UA) and G^{†}UA and thus equals ι_{UA}^{G}. That is, V ι^{F} = ι^{G}U. □

8 FPC

We present the metalanguage FPC [Plo85,Gun92] and study it as a programming language. First, a call-by-value operational semantics is provided. Second, enriched categorical models of FPC are defined and, on top of them, a denotational semantics is given. Finally, it is shown that Poset-models of FPC arising from Poset-domain-structures are parametric with respect to representations [Rey74,Rey83] and that, categorically, this corresponds to the lax naturality of the interpretation.

8.1 The Language

The metalanguage FPC is a type theory with sums, products, exponentials and recursive types based on the propositions-as-types paradigm [CF58,How80]. The grammar of FPC requires two syntax classes of variables: one called TypeVars for type variables and another called Vars for expression variables. The syntax of the language is given as follows:

T ∈ TypeVars
τ ∈ Types ::= T | τ_{1} + τ_{2} | τ_{1} × τ_{2} | τ_{1}⇀ ⇀τ_{2} | μT.τ
x ∈ Vars
e ∈ Expressions ::= x | inl_{τ_{1},τ_{2}}(e) | inr_{τ_{1},τ_{2}}(e) | case e of inl(x_{1}).e_{1} or inr(x_{2}).e_{2} |
⟨e_{1}, e_{2}⟩ | fst(e) | snd(e) | λx : τ.e | e_{1}(e_{2}) | intro_{μT.τ}(e) | elim(e).

As usual expressions are identified up to α-equivalence; μT.τ binds T in τ, λx : τ.e binds x in e, and case e of inl(x_{1}).e_{1} or inr(x_{2}).e_{2} binds x_{1} in e_{1} and x_{2} in e_{2}. The ordinary definitions of free variables, bound variables and substitution apply.

Remark. Despite that the tags on the expressions are essential for proving a unique type lemma (Lemma 8.1.1) we will usually drop them when they are clear from the context or unimportant.

The definition of the expressions is such that every type comes equipped with operators for constructing and for destroying expressions; these are, respectively,

inl( )/inr( ) , ⟨ , ⟩ , λx. , intro( ) , and

      case  ofinl(x_{1}). orinr(x_{2}). , fst( )/snd( ) , ( ) , elim( ) .

This dichotomy corresponds, under the propositions-as-types paradigm, to the logical introduction and elimination rules (see the rules defining well-formed expressions on page 174).

The ability to define types recursively is a powerful tool. For example, it automatically provides a large supply of basic types. These are closed types (i.e., those with no free variables) specified by the grammar:

σ ::= T | σ_{1} + σ_{2} | σ_{1} × σ_{2} | σ_{1}⇀ ⇀σ_{2}
β ∈ BasicTypes ::= σ | μT.β.

The simplest basic type is 0 = μT.T. From 0 we can construct 1 = 0⇀ ⇀0 and even more exciting types: Nat = μT.1 + T, NatList = μT.1 + (Nat × T), Lambda = μT.Nat + (T⇀ ⇀T), etc. (see [Plo85,Gun92]).

A well-formed type consists of a list of distinct type variables and a type whose free type variables appear in the given list. Formally, we introduce type contexts and wellformed type contexts by the following grammar and rules:

Θ ∈ Type Contexts ::= ⟨⟩ | ⟨Θ, T⟩
\overline{⊢ ⟨⟩}  \frac{⊢ Θ}{⊢ Θ, T}   T∉ Θ

and define well-formed types to be those judgements Θ ⊢ τ derivable by the rules:

var  \frac{⊢ Θ}{Θ ⊢ Θ_{i}} 1 ≤ i ≤ | Θ |

⋆  \frac{Θ ⊢ τ_{1} Θ ⊢ τ_{2}}{Θ ⊢ τ_{1} ⋆ τ_{2}} where ⋆ ∈ \{+, ×, ⇀ ⇀\}

μ  \frac{Θ, T ⊢ τ}{Θ ⊢ μT.τ}

Remark. If Θ ⊢ τ is derivable then so is ⊢ Θ.

Although the type system of FPC does not have polymorphic types, the judgements Θ ⊢ τ allow parameterisation. For instance, one may think of A ⊢ μT.1 + (A × T) as the type of lists on A.

Well-formed expression contexts are finite mappings assigning well-formed types to expression variables; they are defined by the following grammar and rules:

Γ ∈ Expression Contexts ::= ⟨⟩ | ⟨Γ, x : τ⟩
\frac{⊢ Θ}{Θ ⊢ ⟨⟩}  \frac{Θ ⊢ τ}{Θ ⊢ Γ, x : τ} x∉ Γ

Remark. If Θ ⊢ Γ is derivable then, for every τ in Γ, so is Θ ⊢ τ.

Well-formed expressions are defined to be those judgements Θ, Γ ⊢ e : τ derivable by the following rules

var  \frac{Θ ⊢ Γ}{Θ, Γ ⊢ Γ_{i}} 1 ≤ i ≤ | Γ |

+Il  \frac{Θ, Γ ⊢ e : τ_{1} Θ ⊢ τ_{2}}{Θ, Γ ⊢ inl_{τ_{1},τ_{2}}(e) : τ_{1} + τ_{2}}  +Ir  \frac{Θ, Γ ⊢ e : τ_{2} Θ ⊢ τ_{1}}{Θ, Γ ⊢ inr_{τ_{1},τ_{2}}(e) : τ_{1} + τ_{2}}

+E  \frac{Θ, Γ ⊢ e : τ_{1} + τ_{2} Θ, ⟨Γ, x_{1} : τ_{1}⟩ ⊢ e_{1} : τ  Θ, ⟨Γ, x_{2} : τ_{2}⟩ ⊢ e_{2} : τ}{Θ, Γ ⊢ case e of inl(x_{1}).e_{1} or inr(x_{2}).e_{2} : τ}

×I  \frac{Θ, Γ ⊢ e_{1} : τ_{1} Θ, Γ ⊢ e_{2} : τ_{2}}{Θ, Γ ⊢ ⟨e_{1}, e_{2}⟩ : τ_{1} × τ_{2}}

×E_{1}  \frac{Θ, Γ ⊢ e : τ_{1} × τ_{2}}{Θ, Γ ⊢ fst(e) : τ_{1}}  ×E_{2}  \frac{Θ, Γ ⊢ e : τ_{1} × τ_{2}}{Θ, Γ ⊢ snd(e) : τ_{2}}

⇀ ⇀I  \frac{Θ, ⟨Γ, x : τ_{1}⟩ ⊢ e : τ_{2}}{Θ, Γ ⊢ λx : τ_{1}.e : τ_{1}⇀ ⇀τ_{2}}

⇀ ⇀E  \frac{Θ, Γ ⊢ e : τ_{1}⇀ ⇀τ_{2} Θ, Γ ⊢ e_{1} : τ_{1}}{Θ, Γ ⊢ e(e_{1}) : τ_{2}}

μI  \frac{Θ, Γ ⊢ e : τ[T ↦ μT.τ]}{Θ, Γ ⊢ intro_{μT.τ}(e) : μT.τ} T∉ Θ

μE  \frac{Θ, Γ ⊢ e : μT.τ}{Θ, Γ ⊢ elim(e) : τ[T ↦ μT.τ]}

Remark. If Θ, Γ ⊢ e : τ is derivable then so are Θ ⊢ Γ and Θ ⊢ τ.

The operators intro( ) and elim( ) can be used to implement self application, and thus allow the coding of the paradoxical combinators. For example, the call-by-value fixed-point operator corresponds to the expression

Z_{σ,τ} ≡ λf : (σ⇀ ⇀τ)⇀ ⇀σ⇀ ⇀τ. V_{σ,τ}(intro V_{σ,τ}) : ((σ⇀ ⇀τ)⇀ ⇀σ⇀ ⇀τ)⇀ ⇀σ⇀ ⇀τ
V_{σ,τ} ≡ λx : μT.T⇀ ⇀σ⇀ ⇀τ. λy : σ. f (elimxx) y : (μT.T⇀ ⇀σ⇀ ⇀τ)⇀ ⇀σ⇀ ⇀τ.

(For the operational behaviour of Z see page 177.)

The typing discipline guarantees the following properties:

Lemma 8.1.1 (Unique Type) If Θ, Γ ⊢ e : τ and Θ, Γ ⊢ e : τ′ are derivable then τ ≡ τ′. □

Lemma 8.1.2 (Substitution) If the judgements Θ, ⟨Γ, x : τ′⟩ ⊢ e : τ and Θ, Γ ⊢ e′ : τ′ are derivable then so is Θ, Γ ⊢ e[x ↦ e′] : τ. □

8.2 Operational Semantics

As it is now common practice after [Plo81], the operational semantics of expressions is given by a binary evaluation relation on expressions (⇝) defined by induction on the structure of expressions. The rules for call-by-value evaluation are:

var  \overline{x ⇝ x}
+Il \frac{e ⇝ v}{inl(e) ⇝ inl(v)}  +Ir \frac{e ⇝ v}{inr(e) ⇝ inr(v)}

+El  \frac{e ⇝ inl(v) e_{1}[x_{1} ↦ v] ⇝ v′}{case e of inl(x_{1}).e_{1} or inr(x_{2}).e_{2} ⇝ v′}

+Er  \frac{e ⇝ inr(v) e_{2}[x_{2} ↦ v] ⇝ v′}{case e of inl(x_{1}).e_{1} or inr(x_{2}).e_{2} ⇝ v′}

×I  \frac{e_{1} ⇝ v_{1} e_{2} ⇝ v_{2}}{⟨e_{1}, e_{2}⟩ ⇝ ⟨v_{1}, v_{2}⟩}
×E_{1}  \frac{e ⇝ ⟨v_{1}, v_{2}⟩}{fst(e) ⇝ v_{1}}  ×E_{2}  \frac{e ⇝ ⟨v_{1}, v_{2}⟩}{snd(e) ⇝ v_{2}}

⇀ ⇀I  \overline{λx.e ⇝ λx.e}

⇀ ⇀E  \frac{e_{1} ⇝ λx.e e_{2} ⇝ v e[x ↦ v] ⇝ v′}{e_{1}(e_{2}) ⇝ v′}

μI  \frac{e ⇝ v}{intro(e) ⇝ intro(v)}

μE  \frac{e ⇝ intro(v)}{elim(e) ⇝ v}

8. FPC 177 The expressions v such that v ⇝ v, called values, are characterised by the grammar,

v ∈ Values ::= x | inl_{τ_{1},τ_{2}}(v) | inr_{τ_{1},τ_{2}}(v) | ⟨v_{1}, v_{2}⟩ | λx : τ. e | intro_{μT.τ}(v).

The notion of program: Definition 8.2.1 A program p is an expression such that ⊢ p : τ for some type τ. □

Program values are important for understanding the nature of types. For example, 0 and 1 are not exciting types but for different reasons: 0 has no program values, whilst 1 has, for example, the program value λx.x.

An interesting program is the call-by-value fixed-point operator Z (see page 175); it evaluates as follows:

1. Z ⇝ Z.

2. For every value v,

Zv ⇝ λy. v (elim (introV [f ↦ v]) (introV [f ↦ v])) y.

3. For every value v, the following rule is derivable:

\frac{Z(λx. e) ⇝ X e[x ↦ X] v ⇝ v′}{Z (λx. e) v ⇝ v′} .

Some properties of the evaluation relation are: Proposition 8.2.2 ⇝ is a partial computable function from Expressions to Values. □ Convention. We write Θ, Γ ⊢ e ⇝ v : τ to indicate that Θ, Γ ⊢ e : τ and that e ⇝ v.

We also write Θ, Γ ⊢ e ✓ : τ when Θ, Γ ⊢ e ⇝ v : τ for some value v. Proposition 8.2.3 (Subject Reduction) If Θ, Γ ⊢ e ⇝ v : τ then Θ, Γ ⊢ v : τ. □

8.3 Categorical Models

Essentially, the categorical structure needed to interpret FPC is a parameterised algebraically compact partial cartesian closed category with coproducts. Definition 8.3.1 For cartesian V, a V-model of FPC is specified by

• a domain structure (K, D),

• a V-category L,

• V-functors \underline{+}, \underline{⊗} : L × L → L and \underline{⇀ ⇀} : L^{op} × L → L, and

• mappings ( )^{†} and ι^{( )_{0}} associating every V-functor F : A×L → L with a V-functor

F^{†} : A → L and a natural transformation ι^{F_{0}} : F_{0} ⟨Id, F_{0}^{†}⟩ \underrightarrow{.} F_{0}^{†} such that

• p(K, D) ≅ L_{0},

• the underlying functors +, ⊗ : pK×pK → pK and ⇀ ⇀ : pK^{op}×pK → pK of \underline{+}, \underline{⊗} and \underline{⇀ ⇀} are, respectively, coproduct, partial product and partial exponential functors, and

• L is parameterised V-algebraically compact with parameterisation (( )^{†}, ι^{( )_{0}}). □ Remark. pK has zero object 0 (viz., a free Id_{pK}-algebra), K has terminal object 1 = 0⇀ ⇀0 (see Proposition 5.3.2 (2)) and J ≅ ⊗ 1 : K → pK has right adjoint.

8.4 Denotational Semantics

The interpretation of FPC in a categorical model is provided. Roughly speaking, wellformed types, Θ ⊢ τ, are interpreted as symmetric functors [[Θ ⊢ τ]] : p̆K^{| Θ |} → p̆K whilst well-formed expressions, Θ, Γ ⊢ e : τ, are interpreted as indexed families of partial maps

{[[Θ, Γ ⊢ e : τ]]_{A} : [[Θ ⊢ Γ]]_{2}(A) ⇀ [[Θ ⊢ τ]]_{2}(A)}

where A ∈ | p̆K |^{| Θ |} is symmetric (that is, A = ((X_{1}, X_{1}), …, (X_{|Θ|}, X_{|Θ|})) for some X ∈ | pK |^{| Θ |}).

Throughout this section, we let V be cartesian and work with a fixed V-model of FPC.

Interpretation of Types

Let us recall some notation and introduce more. We write L̆ for L^{op} × L and for a V-functor F : L̆ × L̆ → L we write F̆ for the symmetric V-functor

⟨F ∘ ( )^{§}, F ⟩ : L̆ × L̆ → L̆

where ( )^{§} is the V-functor ⟨Π_{2}, Π_{1}⟩ × ⟨Π_{2}, Π_{1}⟩ : L̆ × L̆ → (L̆ × L̆)^{op} (for details see Section 6.3).

Further, for a V-functor F : L × L → L (resp. F : L^{op} × L → L), the symmetric V-functor (F ∘ (Π_{2} × Π_{2}))^{}˘ : L̆ × L̆ → L̆ (resp. (F ∘ (Π_{1} × Π_{2}))^{}˘ : L̆ × L̆ → L̆) is denoted F˘˘ .

Definition 8.4.1 (Interpretation of Well-Formed Types) \underline{[[Θ ⊢ τ]]} : L̆^{| Θ |} → L̆.

• \underline{[[Θ ⊢ Θ_{i}]]} = Π_{i} (1 ≤ i ≤ | Θ |).

• \underline{[[Θ ⊢ τ_{1} ⋆ τ_{2}]]} = [[⋆]]˘˘ ∘ ⟨\underline{[[Θ ⊢ τ_{1}]]}, \underline{[[Θ ⊢ τ_{2}]]}⟩ where [[⋆]] = \{ \begin{matrix}\underline{+} & , if ⋆ = + \\ \underline{⊗} & , if ⋆ = × \\ \underline{⇀ ⇀} & , if ⋆ = ⇀ ⇀ \end{matrix} .

• \underline{[[Θ ⊢ μT.τ]]} = \underline{[[Θ, T ⊢ τ]]}^{‡}. □

Remark. The parameterisation ( )^{‡} on L̆ is the one induced, by Corollary 6.2.7 (2) and Theorem 6.4.4, from the given parameterisation on L.

By construction and because of Theorem 6.4.4:

Proposition 8.4.2 \underline{[[Θ ⊢ τ]]} is a symmetric V-functor. □

Convention. Given a V-functor F : X → A_{1} × A_{2}, for i = 1, 2, we write F_{i} for the composite Π_{i} ∘ F : X → A_{i}. And given η : F \underrightarrow{.} G : X → A_{1} × A_{2}, for i = 1, 2, we write η_{i} for Π_{i} η : F_{i} \underrightarrow{.} G_{i} : X → A_{i}.

For F : L × L → L, the equality Π_{i} ∘ F˘˘ = F ∘ (Π_{i} × Π_{i}) holds for i = 1, 2 and for F : L^{op}×L → L, so do the equalities Π_{1}∘F˘˘ = F ∘(Π_{2}×Π_{1}) and Π_{2}∘F˘˘ = F ∘(Π_{1}×Π_{2}). Hence:

Proposition 8.4.3 For i = 1, 2,

\underline{[[Θ, Γ ⊢ τ_{1} ⋆ τ_{2}]]}_{i} = [[⋆]] ∘ ⟨\underline{[[Θ, Γ ⊢ τ_{1}]]}_{i}, \underline{[[Θ, Γ ⊢ τ_{2}]]}_{i}⟩ where ⋆ ∈ \{+, ×\}.

Also,

\underline{[[Θ, Γ ⊢ τ_{1}⇀ ⇀τ_{2}]]}_{1} = \underline{⇀ ⇀} ∘ ⟨\underline{[[Θ, Γ ⊢ τ_{1}]]}_{2}, \underline{[[Θ, Γ ⊢ τ_{2}]]}_{1}⟩
\underline{[[Θ, Γ ⊢ τ_{1}⇀ ⇀τ_{2}]]}_{2} = \underline{⇀ ⇀} ∘ ⟨\underline{[[Θ, Γ ⊢ τ_{1}]]}_{1}, \underline{[[Θ, Γ ⊢ τ_{2}]]}_{2}⟩.  □

Convention. To ease the notation, we will write [[Θ ⊢ τ]] for the composite

p̆K^{| Θ |} ≅ L̆_{0}^{| Θ |}  ^{\underline{[[Θ ⊢ τ]]}_{0}}  L̆_{0} ≅ p̆K_{0}.

The interpretation of types respects a substitution lemma (Lemma 8.4.4) establishing that the interpretation of the substitution of a type τ_{2} for a variable T in a type τ_{1} is coherent with the evaluation of the interpretation of the type τ_{1} parameterised in T at the interpretation of the type τ_{2}. That is, evaluation is the semantic counterpart of syntactic substitution.

The substitution lemma is needed to interpret expressions. For example, we want

[[⊢ elim(e) : τ[T ↦ μT.τ]]] : 1 ⇀ [[⊢ τ[T ↦ μT.τ]]]_{2}  (8.1)

to be obtained from [[⊢ e : μT.τ]] : 1 ⇀ [[⊢ μT.τ]]_{2} by unfolding the recursive type μT.τ; that is, by composing with the isomorphism [[⊢ μT.τ]]_{2} ≅ [[T ⊢ τ]]_{2}([[⊢ μT.τ]]). But then, to satisfy (8.1) we further need

[[⊢ τ[T ↦ μT.τ]]]_{2} ≅ [[T ⊢ τ]]_{2}([[⊢ μT.τ]]).

Lemma 8.4.4 (Substitution Lemma) There exists a canonical natural isomorphism

β : [[Θ ⊢ τ_{1}[T ↦ τ_{2}]]] ≅ [[Θ, T ⊢ τ_{1}]] ∘ ⟨Id, [[Θ ⊢ τ_{2}]]⟩

such that β_{A}^{§} = β_{A}^{−1} for every symmetric A.

Proof: By induction on the derivation of τ_{1} (see Appendix A). □

Remark. If ( )_{0}^{†} is homogeneous (in the sense that for every symmetric V-functors F : L̆^{m+1} → L̆ and G : L̆^{n} → L̆^{m}, (F ∘ (G × Id))_{0}^{†} = F_{0}^{†} ∘ G_{0} —c.f. (6.3) on page 131— then so is ( )_{0}^{‡}; moreover, in this case, β = id.

Interpretation of Expression Contexts

The interpretation of types is extended to expression contexts by taking the partial product of the interpretation of the types constituting the context. In particular, the empty context is interpreted as the terminal object in the category of total maps.

Definition 8.4.5 (Interpretation of Well-Formed Expression Contexts) \underline{[[Θ ⊢ Γ]]} : L̆^{| Θ |} → L̆.

• \underline{[[Θ ⊢ ⟨⟩]]} = K(1, 1).

• \underline{[[Θ ⊢ Γ, x : τ]]} = \underline{⊗}˘˘ ∘ ⟨\underline{[[Θ ⊢ Γ]]}, \underline{[[Θ ⊢ τ]]}⟩. □

The basic properties of the interpretation of types extend to the interpretation of expression contexts:

8. FPC 182 Proposition 8.4.6 1. \underline{[[Θ ⊢ Γ]]} is a symmetric V-functor.

2. Let Γ ≡ x_{1} : τ_{1}, …, x_{n} : τ_{n}. Then, for i = 1, 2,

\begin{aligned}\underline{[[Θ ⊢ ⟨⟩]]}_{i} & = & K1, \\ \underline{[[Θ ⊢ Γ, x : τ]]}_{i} & = & \underline{⊗} ∘ ⟨\underline{[[Θ ⊢ Γ]]}_{i}, \underline{[[Θ ⊢ τ]]}_{i}⟩. & □ \end{aligned}

Interpretation of Expressions The interpretation of expressions is defined in the standard way. Roughly speaking, variables correspond to projections, inl/inr to coproducts injections, case to coproduct selection, ⟨ , ⟩ to partial pairing, fst/snd to projections, λx. to currying, ( ) to evaluation and intro/elim to folding/unfolding a recursive type. This is formalised in the definition below which should be understood in conjunction with Proposition 8.4.8. Definition 8.4.7 (Interpretation of Well-Formed Expressions)

[[Θ, Γ ⊢ e : τ]] = {[[Θ, Γ ⊢ e : τ]]_{A} | A ∈ | p̆K |^{| Θ |} is symmetric}

is defined as follows:

• [[Θ, Γ ⊢ Γ_{i}]] = π_{i} (1 ≤ i ≤ | Γ |).

• [[Θ, Γ ⊢ inl(e) : τ_{1} + τ_{2}]] = ⨿_{1} ∘ [[Θ, Γ ⊢ e : τ_{1}]].

• [[Θ, Γ ⊢ inr(e) : τ_{1} + τ_{2}]] = ⨿_{2} ∘ [[Θ, Γ ⊢ e : τ_{2}]].

• [[Θ, Γ ⊢ case e of inl(x_{1}).e_{1} or inr(x_{2}).e_{2} : τ]] = [[[Θ, ⟨Γ, x_{1} : τ_{1}⟩ ⊢ e_{1} : τ]], [[Θ, ⟨Γ, x_{2} : τ_{2}⟩ ⊢ e_{2} : τ]]] ∘ δ ∘ ⟨⟨id, [[Θ, Γ ⊢ e : τ_{1} + τ_{2}]]⟩⟩ where δ is the canonical natural isomorphism [[Θ ⊢ Γ]]_{2}⊗([[Θ ⊢ τ_{1}]]_{2}+[[Θ ⊢ τ_{2}]]_{2}) ≅ ([[Θ ⊢ Γ]]_{2}⊗[[Θ ⊢ τ_{1}]]_{2})+([[Θ ⊢ Γ]]_{2}⊗[[Θ ⊢ τ_{1}]]_{2}).

• [[Θ, Γ ⊢ ⟨e_{1}, e_{2}⟩ : τ_{1} × τ_{2}]] = ⟨⟨[[Θ, Γ ⊢ e_{1} : τ_{1}]], [[Θ, Γ ⊢ e_{2} : τ_{2}]]⟩⟩.

• [[Θ, Γ ⊢ fst(e) : τ_{1}]] = π_{1} ∘ [[Θ, Γ ⊢ e : τ_{1} × τ_{2}]].

• [[Θ, Γ ⊢ snd(e) : τ_{2}]] = π_{2} ∘ [[Θ, Γ ⊢ e : τ_{1} × τ_{2}]].

8. FPC 183 • [[Θ, Γ ⊢ λx.e : τ_{1}⇀ ⇀τ_{2}]] = pλ([[Θ, ⟨Γ, x : τ_{1}⟩ ⊢ e : τ_{2}]]).

• [[Θ, Γ ⊢ e(e_{1}) : τ_{2}]] = ε ∘ ⟨⟨[[Θ, Γ ⊢ e : τ_{1}⇀ ⇀τ_{2}]], [[Θ, Γ ⊢ e_{1} : τ_{1}]]⟩⟩.

• [[Θ, Γ ⊢ intro(e) : μT.τ]] = I ∘ [[Θ, Γ ⊢ e : τ[T ↦ μT.τ]]] where I = (φ^{[[Θ, T ⊢τ]]} ∘ β)_{2}.

• [[Θ, Γ ⊢ elim(e) : τ[T ↦ μT.τ]]] = E ∘[[Θ, Γ ⊢ e : μT.τ]] where E = (φ^{[[Θ, T ⊢τ]]}∘β)_{1}.

□

Remark. By Theorem 6.4.4 and Lemma 8.4.4, I and E above are mutual inverses.

The interpretation of expressions is well-defined: Proposition 8.4.8 For every symmetric A ∈ | p̆K |^{| Θ |} ,

[[Θ, Γ ⊢ e : τ]]_{A} : [[Θ ⊢ Γ]]_{2}(A) ⇀ [[Θ ⊢ τ]]_{2}(A).

Proof: By induction on the derivation of Θ, Γ ⊢ e : τ.

• Θ, Γ ⊢ Γ_{i} where Γ ≡ x_{1} : τ_{1}, …, x_{n} : τ_{n} and 1 ≤ i ≤ n.

[[Θ, Γ ⊢ Γ_{i}]]_{A} = π_{i} : [[Θ ⊢ τ_{1}]]_{2}(A) ⊗ … ⊗ [[Θ ⊢ τ_{n}]]_{2}(A) → [[Θ ⊢ τ_{i}]]_{2}(A) Since

[[Θ ⊢ Γ]]_{2} = [[Θ ⊢ τ_{1}]]_{2} ⊗ … ⊗ [[Θ ⊢ τ_{n}]]_{2}

we are done.

• Θ, Γ ⊢ inl(e) : τ_{1} + τ_{2}.

By induction,

[[Θ, Γ ⊢ e : τ_{1}]]_{A} : [[Θ ⊢ Γ]]_{2}(A) ⇀ [[Θ ⊢ τ_{1}]]_{2}(A).

Since

⨿_{1} : [[Θ ⊢ τ_{1}]]_{2}(A) → [[Θ ⊢ τ_{1}]]_{2}(A) + [[Θ ⊢ τ_{2}]]_{2}(A)

and

[[Θ ⊢ τ_{1} + τ_{2}]]_{2} = [[Θ ⊢ τ_{1}]]_{2} + [[Θ ⊢ τ_{2}]]_{2}

we are done.

8. FPC 184 • Θ, Γ ⊢ inr(e) : τ_{1} + τ_{2}. Analogous to the previous case.

• Θ, Γ ⊢ case e of inl(x_{1}).e_{1} or inr(x_{2}).e_{2} : τ.

By induction,

[[Θ, Γ ⊢ e : τ_{1} + τ_{2}]]_{A} : [[Θ ⊢ Γ]]_{2}(A) ⇀ [[Θ ⊢ τ_{1} + τ_{2}]]_{2}(A)

and, for i = 1, 2,

[[Θ, ⟨Γ, x_{i} : τ_{i}⟩ ⊢ e_{i} : τ_{i}]]_{A} : [[Θ ⊢ Γ, x_{i} : τ_{i}]]_{2}(A) ⇀ [[Θ ⊢ τ]]_{2}(A).

Since

[[Θ ⊢ τ_{1} + τ_{2}]]_{2} = [[Θ ⊢ Γ]]_{2} + [[Θ ⊢ Γ]]_{2}

and

[[Θ ⊢ Γ]]_{2} ⊗ [[Θ ⊢ τ_{i}]]_{2} = [[Θ ⊢ Γ, x_{i} : τ_{i}]]_{2}

we are done.

• Θ, Γ ⊢ fst(e) : τ_{1}.

By induction,

[[Θ, Γ ⊢ e : τ_{1} × τ_{2}]]_{A} : [[Θ ⊢ Γ]]_{2}(A) ⇀ [[Θ ⊢ τ_{1} × τ_{2}]]_{2}(A).

Since

[[Θ ⊢ τ_{1} × τ_{2}]]_{2} = [[Θ ⊢ τ_{1}]]_{2} ⊗ [[Θ ⊢ τ_{2}]]_{2}

and

π_{1} : [[Θ ⊢ τ_{1}]]_{2}(A) ⊗ [[Θ ⊢ τ_{2}]]_{2}(A) → [[Θ ⊢ τ_{1}]]_{2}(A)

we are done.

• Θ, Γ ⊢ snd(e) : τ_{2}. Analogous to the previous case.

• Θ, Γ ⊢ ⟨e_{1}, e_{2}⟩ : τ_{1} × τ_{2}.

By induction, for i = 1, 2,

[[Θ, Γ ⊢ e_{i} : τ_{i}]]_{A} : [[Θ ⊢ Γ]]_{2}(A) ⇀ [[Θ ⊢ τ_{i}]]_{2}(A).

Since

[[Θ ⊢ τ_{1}]]_{2} ⊗ [[Θ ⊢ τ_{2}]]_{2} = [[Θ ⊢ τ_{1} × τ_{2}]]_{2}

we are done.

8. FPC 185

• Θ, Γ ⊢ λx.e : τ_{1}⇀ ⇀τ_{2}.

By induction,

[[Θ, ⟨Γ, x; τ_{1}⟩ ⊢ e : τ_{2}]]_{A} : [[Θ ⊢ Γ, x : τ_{1}]]_{2}(A) ⇀ [[Θ ⊢ τ_{2}]]_{2}(A).

Since

[[Θ ⊢ Γ]]_{2} ⊗ [[Θ ⊢ τ_{1}]]_{2} = [[Θ ⊢ Γ, x : τ_{1}]]_{2}

it follows that

pλ([[Θ, ⟨Γ, x; τ_{1}⟩ ⊢ e : τ_{2}]]_{A}) : [[Θ ⊢ Γ]]_{2}(A) → [[Θ ⊢ τ_{1}]]_{2}(A)⇀ ⇀[[Θ ⊢ τ_{2}]]_{2}(A). Finally [[Θ ⊢ τ_{1}]]_{2}(A)⇀ ⇀[[Θ ⊢ τ_{2}]]_{2}(A) = [[Θ ⊢ τ_{1}]]_{1}(A)⇀ ⇀[[Θ ⊢ τ_{2}]]_{2}(A) = [[Θ ⊢ τ_{1}⇀ ⇀τ_{2}]]_{2}(A) and we are done.

• Θ, Γ ⊢ e(e_{1}) : τ_{2}.

By induction,

[[Θ, Γ ⊢ e : τ_{1}⇀ ⇀τ_{2}]]_{A} : [[Θ ⊢ Γ]]_{2}(A) ⇀ [[Θ ⊢ τ_{1}⇀ ⇀τ_{2}]]_{2}(A)

and

[[Θ, Γ ⊢ e_{1} : τ_{1}]]_{A} : [[Θ ⊢ Γ]]_{2}(A) ⇀ [[Θ ⊢ τ_{1}]]_{2}(A).

Since

[[Θ ⊢ τ_{1}⇀ ⇀τ_{2}]]_{2} = [[Θ ⊢ τ_{1}]]_{1}⇀ ⇀[[Θ ⊢ τ_{2}]]_{2}

and

[[Θ ⊢ τ_{1}]]_{2}(A) = [[Θ ⊢ τ_{1}]]_{1}(A)

we are done.

• Θ, Γ ⊢ intro(e) : μT.τ.

By induction, [[Θ, Γ ⊢ e : τ[T ↦ μT.τ]]]_{A} : [[Θ ⊢ Γ]]_{2}(A) ⇀ [[Θ ⊢ τ[T ↦ μT.τ]]]_{2}(A).

Since

(β_{A})_{2} : [[Θ ⊢ τ[T ↦ μT.τ]]]_{2}(A) ≅ [[Θ, T ⊢ τ]]_{2}(A, [[Θ ⊢ μT.τ]]A)

and

(φ_{A}^{[[Θ, T ⊢τ]]})_{2} : [[Θ, T ⊢ τ]]_{2}(A, [[Θ, T ⊢ τ]]^{‡}A) ≅ [[Θ, T ⊢ τ]]_{2}^{‡}(A)

we are done.

• Θ, Γ ⊢ elim(e) : τ[T ↦ μT.τ].

By induction,

[[Θ, Γ ⊢ e : μT.τ]]_{A} : [[Θ ⊢ Γ]]_{2}(A) ⇀ [[Θ ⊢ μT.τ]]_{2}(A).

Since

[[Θ ⊢ μT.τ]]_{2}(A) = [[Θ, T ⊢ τ]]_{1}^{‡}(A),
(φ_{A}^{[[Θ, T ⊢τ]]})_{1} : [[Θ, T ⊢ τ]]_{1}^{‡}(A) ≅ [[Θ, T ⊢ τ]]_{1}(A, [[Θ, T ⊢ τ]]^{‡}A),
(β_{A})_{1} : [[Θ, T ⊢ τ]]_{1}(A, [[Θ ⊢ μT.τ]]A) ≅ [[Θ ⊢ τ[T ↦ μT.τ]]]_{1}(A)

and

[[Θ ⊢ τ[T ↦ μT.τ]]]_{1}(A) = [[Θ ⊢ τ[T ↦ μT.τ]]]_{2}(A)

we are done. □

8.5 Two Axiomatisations of Models

We impose axioms on domain structures so that their induced categories of partial maps are models of FPC. We will be concerned with two classes of models:

1. Domain-theoretic models (Subsection 8.5.1), corresponding to Cpo-domain-structures whose induced category of partial maps is a Cpo-model with respect to the approximation order and where algebraic compactness arises from the limit/colimit coincidence.

2. Axiomatic K_{∗}-models (Subsection 8.5.2), meaning models enriched over the full subcategory of the category of total maps of all those objects embodying undefinedness. (The approach taken here has been guided by the (more abstract) approach of [Sim92]).

8.5.1 Domain-Theoretic Models

Definition 8.5.1 A domain-theoretic model of FPC is specified by a uniform domain structure (K, D) and a Cpo-enrichment ⊑ for K satisfying:

Axiom 1. (K, ⊑) has chosen binary Poset-coproducts.

Axiom 2. (K, ⊑) has chosen binary Poset-products.

Axiom 3. (pK, ⊏ ∼ ) is a Poset-category with chosen Poset-partial-exponentials.

Axiom 4. pK has a chosen zero object.

Axiom 5. K has chosen colimits of ω-chains of embeddings. □

Theorem 8.5.2 If (K, D, ⊑) is a domain-theoretic model of FPC then (p(K, D), ⊏ ∼ ) is a Cpo-model of FPC.

Proof: Since, by Proposition 5.3.1 and Proposition 5.3.2 (2), K has terminal object it follows, by Axiom 3, that J ⊣ L : pK → K is a Poset-adjunction.

Then, as K is Cpo-enriched, by Corollary 4.5.3, so is pK.

Moreover, by Propositions 5.3.2 (1) and 5.3.3 the zero is an ep-zero and by Proposition 5.4.4 and Axiom 5, pK has colimits of ω-chains of embeddings. Hence, by Axiom 4 and Corollary 7.2.4, pK is parameterised Cpo-algebraically compact.

Finally, by Proposition 5.3.13, the binary coproduct functor is Cpo-enriched. By Proposition 5.1.3, using Corollary 5.2.5, the partial-product functor Cpo-enriches. And, since Poset-adjunctions between Cpo-categories are Cpo-adjunctions, it follows that the partial-exponential functor is Cpo-enriched. □

Example 8.5.3 For W a small Cpo-category, let ([W, Cpo], ⊑) be the Cpo-functor-category of Cpo-functors W → Cpo and natural transformations ordered pointwise, and let ΣC_{[W,Cpo]} be the subcategory of [W, Cpo] of all pointwise-admissible and cartesian natural transformations. Then, ([W, Cpo], ΣC_{[W,Cpo]}, ⊑) specifies a domain-theoretic model. □

8.5.2 Axiomatic K_{∗}-Models

Let (K, D) be a domain structure.

The first two axioms equip pK with the type constructors. In particular, we postulate the existence of a zero object which explicitly introduces undefinedness.

Axiom 1. K has chosen binary coproducts (+) and chosen binary products (×).

Axiom 2. pK has a chosen zero object (0) and chosen partial exponentials (⇀ ⇀).

Consequently, K has initial object (viz., 0), terminal object (viz., 1 = 0⇀ ⇀0) and representation of partial maps (via η, ε : J ⊣ L : pK → K).

To state the rest of the axioms, those objects embodying undefinedness need to be identified. These have the characteristic feature that every partial map into them can be completed to a total map.

Definition 8.5.4 ([Ers73]) An object A ∈ | K | is said to be complete if for every u : X ⇀ A there exists f : X → A such that u ⊆ f. □

In the presence of lifting, complete objects are exactly those objects that are retracts of their lifting; the retraction being the way in which undefinedness is built-in the complete object.

Proposition 8.5.5 (c.f. [Mog88]) For A, B ∈ | K |,

1. The following are equivalent:

(a) A is complete.

(b) A is a retract of LA in K.

(c) η_{A} : A ↣ LA is a section in K.

(d) ε_{A} ⊆ a for some total map a : LA → A.

2. 1, LA and A⇀ ⇀B are complete.

3. If A and B are complete then so is A × B. □

8. FPC 189 Definition 8.5.6 Let K_{∗} be the full subcategory of K of all complete objects. □ Remark. The above notation is adopted because complete objects have a point that internalises undefinedness (see Definition 8.5.9).

The previous proposition implies: Corollary 8.5.7 K_{∗} is cartesian. □

The third axiom states that, in a complete object, undefinedness is built-in in a unique way: Axiom 3. If A is a retract of LA in K via (η_{A}, f) and (η_{A}, g) then f = g. Remark. Axiom 3 has been postulated on intuitive grounds and not for technical reasons. In fact, we could dispose of it provided that we endow complete objects with additional structure indicating the way in which undefinedness arises (i.e., considering Eilenberg-Moore algebras for the lifting monad). Convention. For a complete object A, we will write ρ_{A} for the unique total map making A a retract of LA with section η_{A}. Proposition 8.5.8 1. For A ∈ | K |, ρ_{LA} = Lε_{A}.

2. For A, B ∈ | K |, ρ_{A ⇀ ⇀ B} is the transpose of

L(A⇀ ⇀B) × A ⇀^{ε⊗id} (A⇀ ⇀B) × A ⇀^{ε} B.

3. For complete objects A and B,

ρ_{A×B} = (L(A × B) ⟶^{⟨Lπ_{1},Lπ_{2}⟩} LA × LB ⟶^{ρ_{A}×ρ_{B}} A × B). □

Definition 8.5.9 The least element of a complete object A, is defined to be the total map (1 ⟶^{⊥_{A}} A) = (1 → LA ⟶^{ρ_{A}} A) where 1 → LA represents the zero map 1 ⇀ 0 ↣ A.

□ Definition 8.5.10 A map between complete objects is strict if it preserves the least element. That is, A ∘→ B if (1 ⟶^{⊥} A → B) = (1 ⟶^{⊥} B). □

Examples of strict maps are: id_{A}, A → 1 and ρ_{A} for every complete object A, Lu for every partial map u and the projections π_{i} : A_{1} × A_{2} → A_{i} for i = 1, 2. Moreover, strict maps are closed under composition and pairing.

We write K_{∗,⊥} for the subcategory of K_{∗} of all complete objects and strict maps. From the above remarks, K_{∗,⊥} is cartesian.

Let L be the K_{∗}-category with object-set | K |, hom-objects L(A, B) = A⇀ ⇀B, identities j_{A} : 1 → A⇀ ⇀A obtained as the transpose of

1 × A ≅ A ⟶^{id} A

and composition M_{A,B,C} : (B⇀ ⇀C) × (A⇀ ⇀B) → A⇀ ⇀C obtained as the transpose of

((B⇀ ⇀C) × (A⇀ ⇀B)) × A ≅ (B⇀ ⇀C) × ((A⇀ ⇀B) × A) ⇀^{id⊗ε} (B⇀ ⇀C) × B ⇀^{ε} C.

Then, L_{0} ≅ pK.

Remark. Despite M being strict, L is not a K_{∗,⊥}-category because j_{A} fails to be strict.

The type constructors are K_{∗}-functors:

1. Let \underline{+} : L × L → L be the K_{∗}-functor sending (A, B) to A + B and where \underline{+}_{(A,B),(X,Y)} : (A⇀ ⇀X) × (B⇀ ⇀Y) → (A + B)⇀ ⇀(X + Y) is the transpose of

X + Y ((A⇀ ⇀X) × A) + ((B⇀ ⇀Y) × B) ε + ε π_{1} + π_{2} ≅ ((A⇀ ⇀X) × (B⇀ ⇀Y)) × (A + B) (((A⇀ ⇀X) × A) × (B⇀ ⇀Y)) + ((A⇀ ⇀X) × ((B⇀ ⇀Y) × B))  .

Then, \underline{+}_{0} ≅ + : pK × pK → pK.

2. Let \underline{⊗} : L × L → L be the K_{∗}-functor sending (A, B) to A × B and where \underline{⊗}_{(A,B),(X,Y)} : (A⇀ ⇀X) × (B⇀ ⇀Y) → (A × B)⇀ ⇀(X × Y) is the transpose of

((A⇀ ⇀X) × (B⇀ ⇀Y)) × (A × B) ≅ ((A⇀ ⇀X) × A) × ((B⇀ ⇀Y) × B) ⇀^{ε⊗ε} X × Y.

Then, \underline{⊗}_{0} ≅ ⊗ : pK × pK → pK.

3. Let \underline{⇀ ⇀} : L^{op} × L → L be the K_{∗}-functor sending (A, B) to A⇀ ⇀B and where \underline{⇀ ⇀}_{(A,B),(X,Y)} : (X⇀ ⇀A) × (B⇀ ⇀Y) → (A⇀ ⇀B)⇀ ⇀(X⇀ ⇀Y) is the transpose of

≅ (B⇀ ⇀Y) × ((A⇀ ⇀B) × (X⇀ ⇀A)) id × M ((X⇀ ⇀A) × (B⇀ ⇀Y)) × (A⇀ ⇀B)  (B⇀ ⇀Y) × (X⇀ ⇀B) M X⇀ ⇀Y  .

Then, \underline{⇀ ⇀}_{0} ≅ ⇀ ⇀ : pK^{op} × pK → pK.

Finally, Axiom 4 postulates the existence of a suitable fixed-point operator in K_{∗} which together with Axiom 5 will guarantee the existence of all recursive types.

Axiom 4. K_{∗} has a uniform parameterised fixed-point operator.

That is, for every f : A × B → B in K_{∗} there exists f^{†} : A → B such that

f ∘ ⟨id, f^{†}⟩ = f^{†}

and,

A × B u × v X × Y  ⟹ f  B Y v  A  f^{†}  Bv uX  Y g^{†} g  .

Let us pause to show an application of uniformity which will be needed later: for f_{i} : A_{i} × B_{i} → B_{i} (i = 1, 2) in K_{∗}, the commutativity of

≅ (A_{1} × A_{2}) × (B_{1} × B_{2}) (A_{1} × B_{1}) × (A_{2} × B_{2}) A_{i} × B_{i} π_{i} × π_{i}  f_{i}  B_{1} × B_{2} B_{i}π_{i} f_{1} × f_{2}

yields, by uniformity, π_{i} ∘ ((f_{1} × f_{2})∘ ≅)^{†} = f_{i}^{†} ∘ π_{i}. Thus,

((f_{1} × f_{2})∘ ≅)^{†} = f_{1}^{†} × f_{2}^{†}.  (8.2)

Convention.

1. We set \underline{( )} : pK ≅ L_{0} : \overline{( )}.

2. Given a K_{∗}-functor \underline{F} : A × L → L we write F for the composite

A_{0} × pK ≅ A_{0} × L_{0} ⟶^{\underline{F}_{0}} L_{0} ≅ pK.

Moreover, given an F (A, )-algebra (B, β) and an F (A′, )-coalgebra (C, γ), we write \underline{β ∘ F ( , ) ∘ γ} : A(A′, A) × (C⇀ ⇀B) → C⇀ ⇀B for the composite

\underline{β} × (\underline{F} × \underline{γ}) A(A′, A) × (C⇀ ⇀B) 1 × ((A(A′, A) × C⇀ ⇀B) × 1) ≅ (F (A, B)⇀ ⇀B) × (F (A′, C)⇀ ⇀F (A, B) × C⇀ ⇀F (A′, C)) (F (A, B)⇀ ⇀B) × (C⇀ ⇀F (A, B)) C⇀ ⇀B M id × M  .

Axiom 5. Every K_{∗}-endofunctor on L has a chosen special invariant object.

That is, every K_{∗}-functor \underline{F} : L → L comes equipped with an F -invariant object α : F A ≅ A such that (\underline{α ∘ F ( ) ∘ α^{−1}})^{†} = j_{A} : 1 → A⇀ ⇀A.

8. FPC 193

L admits recursive types:

1. L is K_{∗}-algebraically complete: Let \underline{F} : L → L be a K_{∗}-functor and let (A, α) be an special F -invariant object. For an F -algebra (B, β), if \underline{u} = (\underline{β ∘ F ( ) ∘ α^{−1}})^{†} it follows that u : (A, α) ⇀ (B, β) is an F -algebra morphism because

\underline{β ∘ F (u) ∘ α^{−1}} = \underline{β ∘ F ( ) ∘ α^{−1}} ∘ \underline{u}
= \underline{u}  , by the fixed-point property.

Moreover, if v : (A, α) ⇀ (B, β) is an F -algebra morphism then, writing \underline{v ∘} for

the composite A⇀ ⇀A ≅ 1 × (A⇀ ⇀A) ⟶^{\underline{v} × id} (A⇀ ⇀B) × (A⇀ ⇀A) ⟶^{M} A⇀ ⇀B, we have

that

\underline{α ∘ F ( ) ∘ α^{−1}} A⇀ ⇀A C⇀ ⇀A  A⇀ ⇀A C⇀ ⇀A \underline{v ∘} \underline{v ∘}  \underline{β ∘ F ( ) ∘ α^{−1}}

and therefore

\underline{v} = \underline{v ∘} ∘ j_{A}
= \underline{v ∘} ∘ (\underline{α ∘ F ( ) ∘ α^{−1}})^{†}
= (\underline{β ∘ F ( ) ∘ α^{−1}})^{†}  , by uniformity.

2. L is K_{∗}-algebraically compact: Let \underline{F} : L → L be a K_{∗}-functor and let (A, α) be an initial F -algebra. For an F -coalgebra (C, γ), if \underline{u} = (\underline{α ∘ F ( ) ∘ γ})^{†} it follows that u : (C, γ) ⇀ (A, α^{−1}) is an F -coalgebra morphism because

\underline{α ∘ F (u) ∘ γ} = \underline{α ∘ F ( ) ∘ γ} ∘ \underline{u}
= \underline{u}  , by the fixed-point property.

8. FPC 194 Moreover, if v : (C, γ) ⇀ (A, α^{−1}) is an F -coalgebra morphism then, writing \underline{∘ v} for the composite A⇀ ⇀A ≅ (A⇀ ⇀A) × 1 ⟶^{id×\underline{v}} (A⇀ ⇀A) × (C⇀ ⇀A) ⟶^{M} (C⇀ ⇀A), we have that

\underline{α ∘ F ( ) ∘ α^{−1}} A⇀ ⇀A \underline{∘ v} C⇀ ⇀A  \underline{α ∘ F ( ) ∘ γ}  A⇀ ⇀A C⇀ ⇀A\underline{∘ v}

and therefore

\underline{v} = \underline{∘ v} ∘ j_{A}
= \underline{∘ v} ∘ (\underline{α ∘ F ( ) ∘ α^{−1}})^{†}
= (\underline{α ∘ F ( ) ∘ γ})^{†}  , by uniformity.

3. L is parameterised K_{∗}-algebraically compact: Let \underline{F} : A × L → L be a K_{∗}-functor. For A, B ∈ | A |, define

Φ_{A,B} = \underline{ι_{B}^{F} ∘ F ( , ) ∘ (ι_{A}^{F})^{−1}} : A(A, B) × (F^{†}A⇀ ⇀F^{†}B) → F^{†}A⇀ ⇀F^{†}B. Then, for every f : 1 → A(A, B),

\underline{ι_{B}^{F} ∘ F (f, \overline{Φ^{†} ∘ f}) ∘ (ι_{A}^{F})^{−1}} = Φ ∘ ⟨f, Φ^{†} ∘ f⟩ = Φ^{†} ∘ f : 1 → F^{†}A⇀ ⇀F^{†}B and therefore

ι_{B}^{F} ∘ F (f, \overline{Φ^{†} ∘ f}) ∘ (ι_{A}^{F})^{−1} = \overline{Φ^{†} ∘ f} : F^{†}A ⇀ F^{†}B.

Thus, \overline{Φ^{†} ∘ f} = F^{†}f. In particular, \overline{Φ^{†} ∘ j_{A}} = F^{†}(j_{A}) = id_{F^{†}A} and therefore Φ^{†} ∘ j_{A} = \underline{id_{F^{†}A}} = j_{F^{†}A}.

Moreover,

(A(B, C) × A(A, B)) × ((F^{†}B⇀ ⇀F^{†}C) × (F^{†}A⇀ ⇀F^{†}B)) (F^{†}B⇀ ⇀F^{†}C) × (F^{†}A⇀ ⇀F^{†}B) ≅ A(A, C) × (F^{†}A⇀ ⇀F^{†}C) M × M  Φ  Φ × Φ F^{†}A⇀ ⇀F^{†}C (A(B, C) × (F^{†}B⇀ ⇀F^{†}C)) × (A(A, B) × (F^{†}A⇀ ⇀F^{†}B))  M

and, using (8.2), we have

F^{†}A⇀ ⇀F^{†}C M (F^{†}B⇀ ⇀F^{†}C) × (F^{†}A⇀ ⇀F^{†}B) M  Φ^{†} Φ^{†} × Φ^{†} A(A, C) A(B, C) × A(A, B)  .

Hence, \underline{F^{†}} : A → L defined as Φ^{†} on hom-objects is a K_{∗}-functor such that \underline{F^{†}}_{0} ≅ F^{†} : A_{0} → pK.

Thus, we have proved:

Theorem 8.5.11 Let (K, D) be a domain structure satisfying Axioms 1–5. Then, (K, D), L, \underline{+}, \underline{⊗}, \underline{⇀ ⇀} and \underline{( )^{†}} specify a K_{∗}-model of FPC. □

Example 8.5.12 (Cpo, Σ) satisfies Axioms 1–5. □

8.6 Poset-Models and Parametricity

Throughout this section, we consider a domain structure (K, D) together with a Poset-enrichment ⊑ for K such that (pK, ⊏ ∼ ) is a Poset-model of FPC and investigate the behaviour of expressions in it. We show that expressions are parametric with respect to representations (Definition 8.6.1) and that, categorically, this corresponds to the lax naturality of the interpretation.

Representations were introduced in [Rey74] as an initial formalisation of the notion of implementation. Here we generalise Reynolds’ definition in two obvious ways: we state it in an arbitrary Poset-category (rather than in a category of domains) and we consider representations between morphisms (rather than between elements).

Definition 8.6.1 A representation between A and B is an indexed family of relations

{([v])_{Z} ⊆ pK(Z, A) × pK(Z, B)}_{Z ∈ | pK |}

where v ∈ pK_{R}(A, B) and for every a : Z ⇀ A and b : Z ⇀ B, a ([v])_{Z} b ⟺ b ⊏ ∼ v ∘ a. □

The motivation for parametricity (i.e., the property that the interpretation of an expression maps related environments to related values) is to guarantee representation independence. In our setting, this abstraction property is captured by lax naturality (Proposition 8.6.5). The following lemma suggests why.

Lemma 8.6.2 For v_{i} ∈ pK_{R}(A_{i}, B_{i}) (i = 1, 2), a : A_{1} ⇀ A_{2} and b : B_{1} ⇀ B_{2}, the following statements are equivalent:

1. For every Z ∈ | pK |, x : Z ⇀ A_{1}, y : Z ⇀ A_{2},

x ([v_{1}])_{Z} y ⇒ a ∘ x ([v_{2}])_{Z} b ∘ y.

2. For every x : A_{1} ⇀ A_{1}, y : A_{1} ⇀ A_{2},

x ([v_{1}])_{A_{1}} y ⇒ a ∘ x ([v_{2}])_{A_{1}} b ∘ y.

3.  A_{2} B_{2} B_{1} A_{1}  ⊏ ∼ ab v_{1}  v_{2}  □

A neat aspect of our treatment is that the notion of representation on compound types is not imposed by definition but derived. This is done by characterising the representations of a compound type in terms of the representations of its constituent types. Pleasantly enough, representations of compound types turn out to be logical [Mit90].

Proposition 8.6.3 For i = 1, 2, let v_{i} ∈ pK_{R}(A_{i}, B_{i}).

1. Let a : A_{1} ⇀ A_{2} and b : B_{1} ⇀ B_{2}. Then,

pλ(a) ([v_{1}^{L}⇀ ⇀v_{2}]) pλ(b)
⟺
∀ Z ∈ | pK |, x : Z ⇀ A_{1}, y : Z ⇀ A_{2}. x ([v_{1}]) y ⇒ a ∘ x ([v_{2}]) b ∘ y.

2. Let a : Z ⇀ A_{1} ⊗ A_{2} and b : Z ⇀ B_{1} ⊗ B_{2}. Then,

a ([v_{1} ⊗ v_{2}]) b ⟺ (π_{1} ∘ a ([v_{1}]) π_{1} ∘ b) ∧ (π_{2} ∘ a ([v_{2}]) π_{2} ∘ b).

3. For i = 1, 2, if a : Z ⇀ A_{i} and b : Z ⇀ B_{i} then

⨿_{i} ∘ a ([v_{1} + v_{2}]) ⨿_{i} ∘ b ⟺ a ([v_{i}]) b.

Proof:

(1) By Proposition 5.2.2 (3) and Lemma 8.6.2.

(2) (⇒) By Proposition 5.1.1 (2).

(⇐) By monotonicity of ⟨⟨ , ⟩⟩ and Proposition 5.1.1 (5).

(3) (⇒) Because ⨿_{i} is full (see Definition 4.2.2 (1)) as follows from the fact that ⨿_{i} is an admissible mono (see Proposition 5.3.12) and that admissible monos are full (see Theorem 4.2.4).

(⇐) By monotonicity of ⨿_{i} ∘ . □

8. FPC 198 Before stating the correspondence between parametricity and lax naturality some

definitions restricting the interpretation of types to representations are needed. Definition 8.6.4 1. [[Θ ⊢ τ]]_{R} : pK_{R}^{| Θ |} → pK is defined by

[[Θ ⊢ τ]]_{R}(v) = [[Θ ⊢ τ]]_{2}((v_{1}^{L}, v_{1}), …, (v_{|Θ|}^{L}, v_{|Θ|})).

2. [[Θ ⊢ τ]]_{D} : (pK_{R}^{| Θ |} )^{}˘ → pK is defined by

[[Θ ⊢ τ]]_{D}(v′, v) = [[Θ ⊢ τ]]_{2}((v′_{1}, v_{1}), …, (v′_{|Θ|}, v_{|Θ|})). □

Convention. For A ∈ pK^{| Θ |} , [[Θ, Γ ⊢ e : τ]]_{A} stands for [[Θ, Γ ⊢ e : τ]]_{((A_{1},A_{1}),...,(A_{|Θ|},A_{|Θ|}))}. Proposition 8.6.5 The following statements are equivalent:

1. For every v ∈ pK_{R}^{| Θ |} (A, B),

∀ a ∈ pK^{|Θ|}(Z, A), b ∈ pK^{|Θ|}(Z, B).

a ([[[Θ ⊢ Γ]]_{R}(v)]) b ⟹ [[Θ, Γ ⊢ e : τ]]_{A} ∘ a ([[[Θ ⊢ τ]]_{R}(v)]) [[Θ, Γ ⊢ e : τ]]_{B} ∘ b.

2. [[Θ, Γ ⊢ e : τ]] : [[Θ ⊢ Γ]]_{R} \underrightarrow{.}_{≤}[[Θ ⊢ τ]]_{R} : pK_{R}^{| Θ |} → pK.

3. [[Θ, Γ ⊢ e : τ]] : [[Θ ⊢ Γ]]_{D} \underrightarrow{..}_{≤} [[Θ ⊢ τ]]_{D} : (pK_{R}^{| Θ |} )^{}˘ → pK. That is, for every v ∈ pK_{R}^{| Θ |} (A, B),

[[Θ ⊢ Γ]]_{D}(A, A)  [[Θ ⊢ τ]]_{D}(A, A) [[Θ, Γ ⊢ e : τ]]_{A} [[Θ ⊢ Γ]]_{D}(B, B) [[Θ ⊢ Γ]]_{D}(v, id) [[Θ ⊢ Γ]]_{D}(id, v)  [[Θ ⊢ τ]]_{D}(B, B) ⊏ ∼  [[Θ ⊢ τ]]_{D}(A, B) [[Θ ⊢ τ]]_{D}(id, v) [[Θ ⊢ τ]]_{D}(v, id) [[Θ, Γ ⊢ e : τ]]_{B} [[Θ ⊢ Γ]]_{D}(B, A)  □

8. FPC 199 Finally,

Theorem 8.6.6 (Poset-Models are Parametric w.r.t. Representations)

[[Θ, Γ ⊢ e : τ]] : [[Θ ⊢ Γ]]_{R} \underrightarrow{.}_{≤}[[Θ ⊢ τ]]_{R} : pK_{R}^{| Θ |} → pK.

Proof: By induction on the derivation of Θ, Γ ⊢ e : τ (see Appendix B). □

9 Computational Soundness and Adequacy

The relationship between the operational notion of termination and the denotational notion of totality is examined. It is shown that in any model of FPC the interpretation of expressions is computationally sound (meaning that expressions whose evaluation terminates have total interpretations). Furthermore, for a wide class of domain-theoretic models this is strengthened by showing that they are also computationally adequate (in the sense that, the evaluation of a program terminates whenever its interpretation is total).

9.1 Soundness

The strategy for proving soundness is as usual: observe that values have total interpretations (Lemma 9.1.2) and that the interpretation of expressions is preserved under evaluation (Lemma 9.1.3). Both lemmas are proved by induction. The first one follows straightforwardly; the second one requires a substitution lemma for expressions (which is particularly interesting as it only holds when substituting expressions with total interpretation) and its proof is deferred to Appendix C.

Definition 9.1.1 A model of FPC is computationally sound if, for every ⊢ p : τ,

⊢ p ✓ : τ implies [[⊢ p : τ]] ↓. □

Lemma 9.1.2 In any model of FPC, [[Θ, Γ ⊢ v : τ]] ↓ for every value v.

Proof: By induction on the structure of v. □

Lemma 9.1.3 In any model of FPC,

if Θ, Γ ⊢ e ⇝ v : τ then [[Θ, Γ ⊢ e : τ]] = [[Θ, Γ ⊢ v : τ]].

Proof: By induction on the derivation of e ⇝ v (see Appendix C). □

From the two previous lemmas:

Theorem 9.1.4 (Computational Soundness) In any model of FPC,

if Θ, Γ ⊢ e ✓ : τ then [[Θ, Γ ⊢ e : τ]] ↓. □

9.2 Adequacy

A model of FPC is computationally adequate when the operational notion of termination and the denotational notion of totality coincide. Formally,

Definition 9.2.1 A model of FPC is computationally adequate if, for every ⊢ p : τ,

[[⊢ p : τ]] ↓ implies ⊢ p ✓ : τ. □

The main mathematical effort of this section is to establish the computational adequacy of a wide class of domain-theoretic models (see Subsection 8.5.1).

Fix a V-model of FPC. The first impulse to try to prove [[⊢ p : τ]] ↓ ⇒ ⊢ p ✓ : τ is to proceed by induction on the structure of p. But this does not work. To see what goes wrong consider the case p ≡ p_{1}(p_{2}). If ε ∘ ⟨⟨[[⊢ p_{1} : σ⇀ ⇀τ]], [[⊢ p_{2} : σ]]⟩⟩ = [[⊢ p_{1}(p_{2}) : τ]] is total then so are [[⊢ p_{1} : σ⇀ ⇀τ]] and [[⊢ p_{2} : σ]] and , by induction, there exist λx. e and v such that p_{1} ⇝ λx. e and p_{2} ⇝ v. But, there is no reason for which we can conclude that e[x ↦ v] ✓. The solution is to strengthen the induction hypothesis, roughly, to something like

[[⊢ p : τ]] ↓ ⇒ ∃ v. p ⇝ v ∧ [[⊢ p : τ]] ⪯_{τ} v  (9.1)

where { ⪯_{τ} ⊆ K(1, [[⊢ τ]]_{2})×{v ∈ Values | ⊢ v : τ}} is a family of formal-approximation relations with enough closure properties to overcome the above and similar problems. The nature of the closure properties alluded is best illustrated with a couple of examples.

1. Consider the case p ≡ p_{1}(p_{2}). If [[⊢ p_{1} : σ⇀ ⇀τ]] and [[⊢ p_{2} : σ]] are total, by induction, there exist λx. e and v such that p_{1} ⇝ λx. e ∧ [[⊢ p_{1} : σ⇀ ⇀τ]] ⪯_{σ⇀ ⇀τ} λx. e and p_{2} ⇝ v ∧ [[⊢ p_{2} : σ]] ⪯_{σ} v. Thus, if we could built ⪯_{σ⇀ ⇀τ} and ⪯_{σ} with the property that whenever f ⪯_{σ⇀ ⇀τ} λx. e and x ⪯_{σ} v we have that

ε ∘ ⟨⟨f, x⟩⟩ ↓ ⇒ ∃ v′. e[x ↦ v] ⇝ v′ ∧ ε ∘ ⟨⟨f, x⟩⟩ ⪯_{τ} v′  (9.2)

then, using that

\frac{e[x ↦ v] ⇝ v′}{p_{1}(p_{2}) ⇝ v′}

and putting f = [[⊢ p_{1} : σ⇀ ⇀τ]] and x = [[⊢ p_{2} : σ]] in (9.2), we could conclude that

[[⊢ p_{1}(p_{2}) : τ]] ↓ ⇒ ∃ v′. p_{1}(p_{2}) ⇝ v′ ∧ [[⊢ p_{1}(p_{2}) : τ]] ⪯_{τ} v′.

2. Consider the case p ≡ elim(p′). If E ∘ [[⊢ p′ : μT. τ′]] = [[⊢ elim(p′) : τ′[T ↦ μT.τ′]]] is total then so is [[⊢ p′ : μT. τ′]] and, by induction, there exists intro(v) such that p′ ⇝ intro(v) ∧ [[⊢ p′ : μT. τ′]] ⪯_{μT. τ′} intro(v). Thus, if we could built ⪯_{μT. τ′} and ⪯_{τ′[T ↦ μT. τ′]} with the property that

x ⪯_{μT. τ′} intro(v) ⇒ E ∘ x ⪯_{τ′[T ↦ μT. τ′]} v  (9.3)

then, using that

\frac{p′ ⇝ intro(v)}{elim(p′) ⇝ v}

and putting x = [[⊢ p′ : μT. τ′]] in (9.3), we could conclude that

[[⊢ elim(p′) : τ′[T ↦ μT.τ′]]] ↓ ⇒ ∃ v. elim(p′) ⇝ v ∧ [[⊢ elim(p′) : τ′[T ↦ μT.τ′]]] ⪯_{τ′[T ↦ μT. τ′]} v.

The reader is advised to consider the remaining cases and find out the other closure properties or to look at them in Corollary 9.2.17.

Remark. The actual induction hypothesis needed to carry out the proof is a suitable generalisation of (9.1) —see Lemma 9.2.18— to include expression contexts and expressions (as required, for example, to treat the case p ≡ λx. e).

Establishing the existence of the formal-approximation relations is a major task on which we now embark. Essentially the difficulty arises because they are defined recursively and one should guarantee that such a definition makes sense. But this is better discussed in the light of the following definitions:

For ⊢ τ, we define

Values(τ) = {v ∈ Values | ⊢ v : τ},
Programs(τ) = {p ∈ Expressions | ⊢ p : τ}

and, generalising from the formal-approximation relations, we set

| R(τ) | = {(A, ⪯) | A ∈ | K | ∧ ⪯ ⊆ K(1, A) × Values(τ)}.

Given ⪯ ⊆ K(1, A) × Values(τ), we define its extension to partial maps and programs, ≾ ⊆ pK(1, A) × Programs(τ), by u ≾ p ⟺ (u ↓ ⇒ ∃ v. p ⇝ v ∧ u ⪯ v) —c.f. (9.1).

Now, in order to provide an equational description of the closure properties of ⪯_{σ⋆τ} (for ⋆ ∈ {+, ×, ⇀ ⇀}) and to clarify the closure property of ⪯_{μT.τ}, the type constructors are logically extended to relations following Corollary 9.2.17.

Definition 9.2.2 For ⊢ σ and ⊢ τ,

1. Define +_{σ,τ} : | R(σ) | × | R(τ) | → | R(σ + τ) | to be the function mapping ((A, ⪯_{A}), (B, ⪯_{B})) to (A + B, ⪯_{A} + ⪯_{B}) where

x (⪯_{A} + ⪯_{B}) inl(v) ⟺ (∃ x′. x = ⨿_{1} ∘ x′ ∧ x′ ⪯_{A} v)

and

x (⪯_{A} + ⪯_{B}) inr(v) ⟺ (∃ x′. x = ⨿_{2} ∘ x′ ∧ x′ ⪯_{B} v).

2. Define ⊗_{σ,τ} : | R(σ) | × | R(τ) | → | R(σ × τ) | to be the function mapping ((A, ⪯_{A}), (B, ⪯_{B})) to (A ⊗ B, ⪯_{A} ⊗ ⪯_{B}) where

x (⪯_{A} ⊗ ⪯_{B}) ⟨v_{1}, v_{2}⟩ ⟺ (π_{1} ∘ x ⪯_{A} v_{1}) ∧ (π_{2} ∘ x ⪯_{B} v_{2}).

3. Define ⇀ ⇀_{σ,τ} : | R(σ) | × | R(τ) | → | R(σ⇀ ⇀τ) | to be the function mapping ((A, ⪯_{A}), (B, ⪯_{B})) to (A⇀ ⇀B, ⪯_{A} ⇀ ⇀ ⪯_{B}) where

f (⪯_{A} ⇀ ⇀ ⪯_{B}) λx. e ⟺ (x ⪯_{A} v ⇒ ε ∘ ⟨⟨f, x⟩⟩ ≾_{B} e[x ↦ v]). □

Then, (1)–(3) in Corollary 9.2.17 below can be expressed as

⪯_{σ⋆τ} = ⪯_{σ} [[⋆]] ⪯_{τ}  where [[⋆]] = \{ \begin{matrix}+ & , if ⋆ = + \\ ⊗ & , if ⋆ = × \\ ⇀ ⇀ & , if ⋆ = ⇀ ⇀ \end{matrix} .

To see what happens with recursive types we look at an example. Recall that Nat ≡ μT.1 + T where 1 ≡ 0⇀ ⇀0 and 0 ≡ μT.T. Then, for x ∈ K(1, [[Nat]]) and v ∈ Values(1 + Nat),

                 x ⪯_{Nat} intro(v) ⟺ E ∘ x ⪯_{1+Nat} v

⟺ E ∘ x (⪯_{1} + ⪯_{Nat}) v

where E : [[Nat]] ≅ [[1+Nat]]. Now, if for ⪯ ⊆ K(1, [[τ[T ↦ μT. τ]]])×Values(τ[T ↦ μT. τ]), we define 𝕀 ⪯ ⊆ K(1, [[τ[T ↦ μT. τ]]]) × Values(μT. τ) by

x′ (𝕀 ⪯) intro(v′) ⟺ x′ ⪯ v′;

we have that

x ⪯_{Nat} intro(v) ⟺ E ∘ x 𝕀(⪯_{1} + ⪯_{Nat}) intro(v).  (9.4)

That is, intuitively,

E : ⪯_{Nat}  ≅ 𝕀(⪯_{1} + ⪯_{Nat}).  (9.5)

And this is exactly where the difficulty in constructing ⪯_{μT. τ} resides as we have to solve a recursive equation for relations! In the sequel, this will be done using the techniques of Section 7.3.

First we need to make | R(τ) | into a category. But, what should a morphism (A, ⪯_{A}) ⇀ (B, ⪯_{B}) be? The answer is suggested by (9.4) and (9.5):

Definition 9.2.3 Given ⊢ τ, the category R(τ) has objects | R(τ) | and morphisms u : (A, ⪯_{A}) ⇀ (B, ⪯_{B}) where u : A ⇀ B is such that x ⪯_{A} v ⇒ u ∘ x ≾_{B} v. Composition and identities are as in pK. □

We list some basic properties of the R(τ)’s:

1. For u : (A, ⪯_{A}) ⇀ (B, ⪯_{B}), u′ ≾_{A} p ⇒ u ∘ u′ ≾_{B} p.

2. R(0) ≅ pK.

3. R(τ) has an initial object, viz. (0, ∅), and the forgetful functor U_{τ} : R(τ) → pK preserves it.

4. 𝕀_{μT. τ} : R(τ[T ↦ μT. τ]) ≅ R(μT. τ) : 𝔼_{μT. τ} where

𝕀_{μT. τ} : (A, ⪯) ↦ (A, 𝕀 ⪯) with x (𝕀 ⪯) intro(v) ⟺ x ⪯ v

and

𝔼_{μT. τ} : (A, ⪯) ↦ (A, 𝔼 ⪯) with x (𝔼 ⪯) v ⟺ x ⪯ intro(v).

Proposition 9.2.4 For every ⊢ τ, (0, ∅) is a zero object in R(τ) if and only if pK is non-trivial.

Proof:

(⇒) If (0, ∅) is a zero object in R(1) then the unique 1 ⇀ 0 is a morphism (1, {(id_{1}, λx : 0. x)}) ⇀ (0, ∅) in R(1). Therefore we have that

(1 ⇀ 0) ↓ ⇒ ((1 ⇀ 0), λx : 0. x) ∈ ∅

or equivalently, that

¬ (1 ⇀ 0) ↓ .

Hence, 1 ≅ 0̸.

(⇐) For ⊢ τ, let (A, ⪯) ∈ | R(τ) |. The unique 0 → A in pK is a morphism (0, ∅) → (A, ⪯) and thus (0, ∅) is initial in R(τ). Moreover, if pK is non-trivial then the unique 1 ⇀ 0 in pK in not total and so the unique A ⇀ 0 in pK is a morphism (A, ⪯) ⇀ (0, ∅); thus (0, ∅) is terminal in R(τ). □

Proposition 9.2.5 The functions +_{σ,τ}, ⊗_{σ,τ} and ⇀ ⇀_{σ,τ} extend to functors satisfying

R(σ) × R(τ) pK × pK  pK ⇀ ⇀ R(σ⇀ ⇀τ)^{⇀ ⇀_{σ,τ}} pK^{op} × pK R(σ)^{op} × R(τ) pK R(σ ⋆ τ) (⋆ ∈ {+, ⊗}) ⋆_{σ,τ} ⋆  .

Proof: We need to show that, for u : (A, ⪯_{A}) ⇀ (B, ⪯_{B}) and u′ : (A′, ⪯_{A′}) ⇀ (B′, ⪯_{B′}),

u ⋆ u′ : (A ⋆ A′, ⪯_{A} ⋆ ⪯_{A′}) ⇀ (B ⋆ B′, ⪯_{B} ⋆ ⪯_{B′})  (⋆ ∈ {+, ⊗})

and u⇀ ⇀u′ : (B⇀ ⇀A′, ⪯_{B} ⇀ ⇀ ⪯_{A′}) ⇀ (A⇀ ⇀B′, ⪯_{A} ⇀ ⇀ ⪯_{B′}).

We consider each case:

+: Assume that x (⪯_{A} + ⪯_{A′}) v and that (u + u′) ∘ x ↓. We have to show that (u + u′) ∘ x (⪯_{B} + ⪯_{B′}) v. There are two cases:

– v ≡ inl(v_{1}): We need to find y such that (u + u′) ∘ x = ⨿_{1} ∘ y and y ⪯_{B} v_{1}. By the first assumption, there exists x′ such that x = ⨿_{1} ∘ x′ and x′ ⪯_{A} v_{1}. Then, u ∘ x′ ≾_{B} v_{1}, but since ⨿_{1} ∘ u ∘ x′ = (u + u′) ∘ ⨿_{1} ∘ x′ = (u + u′) ∘ x is total then so is u ∘ x′ and hence u ∘ x′ ⪯_{B} v_{1}. Finally, take y = u ∘ x′.

– v ≡ inr(v_{2}): analogous to the previous case.

⊗: Assume that x (⪯_{A} ⊗ ⪯_{A′}) ⟨v_{1}, v_{2}⟩. Writing ⪯ for ⪯_{B} ⊗ ⪯_{B′} we have to show that (u ⊗ u′) ∘ x ≾ ⟨v_{1}, v_{2}⟩.

By assumption, π_{1} ∘ x ⪯_{A} v_{1} and π_{2} ∘ x ⪯_{A′} v_{2}. Then, u ∘ π_{1} ∘ x ≾_{B} v_{1} and u′ ∘ π_{2} ∘ x ≾_{B′} v_{2} and hence (u ⊗ u′) ∘ x = ⟨⟨u ∘ π_{1} ∘ x, u ∘ π_{2} ∘ x⟩⟩ ≾ ⟨v_{1}, v_{2}⟩.

⇀ ⇀: Assume that f (⪯_{B} ⇀ ⇀ ⪯_{A′}) λx.e. We have to show that (u⇀ ⇀u′) ∘ f ↓ and x ⪯_{A} v imply ε ∘ ⟨⟨(u⇀ ⇀u′) ∘ f, x⟩⟩ ≾_{B} e[x ↦ v].

Assume that (u⇀ ⇀u′) ∘ f ↓ and that x ⪯_{A} v. Then, u ∘ x ≾_{B} v and, using the first assumption, it follows that ε ∘ ⟨⟨f, u ∘ x⟩⟩ ≾_{A′} e[x ↦ v]. Hence,

ε ∘ ⟨⟨(u⇀ ⇀u′) ∘ f, x⟩⟩ = u′ ∘ ε ∘ ⟨⟨f, u ∘ x⟩⟩ ≾_{B′} e[x ↦ v]. □

The type constructors on pK have been extended to the R(τ)’s but there are far too many relations in the R(τ)’s to be able to find recursive types for them. The way out is to find subcategories pK(τ) of R(τ) in which this is possible.

Precisely, we now assume that our fixed model of FPC is a Cpo-model and intend to construct the pK(τ) with the following properties:

A1. U_{τ} : pK(τ) → pK is a Cpo-functor.

A2. pK(τ) is parameterised Cpo-algebraically compact.

A3. For ⋆ = +, ⊗ (resp. ⇀ ⇀), the functor ⋆_{σ,τ} cuts down to a Cpo-functor pK(σ) × pK(τ) → pK(σ ⋆ τ) (resp. pK(σ)^{op} × pK(τ) → pK(σ⇀ ⇀τ)).

A4. 𝕀_{μT. τ} cuts down to pK(τ[T ↦ μT. τ]) ≅ pK(μT. τ).

A5. [Strict Uniformity] For every pair of symmetric Cpo-functors F and G, if

pK(σ)^{}˘p̆K pK(σ_{1})^{}˘ × … × pK(σ_{m})^{}˘ × pK(σ)^{}˘  F p̆K × … × p̆K × p̆K  G  (9.6)

then for every initial parameterised G-algebra (G^{†}, ι^{G}) there exists an initial parameterised F -algebra (F^{†}, ι^{F}) such that

pK(σ_{1})^{}˘ × … × pK(σ_{m})^{}˘  pK(σ)^{}˘≅^{ι^{F}} F ⟨Id, F^{†}⟩ F^{†} p̆K × … × p̆K  p̆K ≅^{ι^{G}} G⟨Id, G^{†}⟩ G^{†}  .

Before going into the construction of the pK(τ)’s we remark that the Strict Uniformity Property is stronger than it seems:

Proposition 9.2.6 Assume the Strict Uniformity Property. In the situation (9.6), for every initial parameterised G-algebra (G^{†}, ι^{G}) there exists an initial parameterised F -algebra (F^{†}, ι^{F}) such that

pK(σ_{1})^{}˘ × … × pK(σ_{m})^{}˘  pK(σ)^{}˘≅^{φ^{F}} F ⟨Id, F^{‡}⟩ F^{‡} p̆K × … × p̆K  p̆K ≅^{φ^{G}} G⟨Id, G^{‡}⟩ G^{‡}  .

Proof: Write W for (U_{σ_{1}}^{op} × U_{σ_{1}}) × … × (U_{σ_{m}}^{op} × U_{σ_{m}}) and V for U_{σ}^{op} × U_{σ}.

On the one hand,

Π_{2}V F^{‡} = UΠ_{2}F^{‡} = UΠ_{2}F^{†} = Π_{2}G^{†}W = Π_{2}G^{‡}W

and therefore V F^{‡} = G^{‡}W.

On the other hand, recall from pages 145 and 144 that

φ_{X}^{F} = ((ρ_{X}^{F})_{2}^{−1}, id) ∘ ι_{X}^{F} ∘ F(X, ((ρ_{X}^{F})_{2}, id))  (9.7)

where

F^{†}(X^{§}) (F^{†}X)^{§}  F (X^{§}, (F^{†}X)^{§}) (ι_{X}^{F})^{§} (ι{F \atop X§})^{−1} ρ_{X}^{F}  F (X^{§}, ρ_{X}^{F}) F(X^{§}, F^{†}(X^{§}))  .

Then, applying V to the above diagram it follows that

(ι_{W X}^{G})^{§}  G((W X)^{§}, V ρ_{X}^{F}) (G^{†}W X)^{§} V ρ_{X}^{F} G^{†}(W X)^{§}  G((W X)^{§}, G^{†}(W X)^{§}) G((W X)^{§}, (G^{†}W X)^{§}) (ι_{(W X)§}^{G})^{−1}

and therefore ρ^{G}W = V ρ^{F}. In particular,

Π_{2}ρ^{G}W = Π_{2}V ρ^{F} = UΠ_{2}ρ^{F} .  (9.8)

And, applying V to (9.7) and using (9.8), the equality V φ^{F} = φ^{G}W is easily verified. □

Further consequences of the Strict Uniformity Property, which will be used later, are given in Appendix D.

Returning to the definition of the pK(τ)’s we now show how it is shaped by Property (A1): if U_{τ} is a Cpo-functor then, for every ω-chain ⟨u_{k} : (A, ⪯_{A}) ⇀ (B, ⪯_{B})⟩ in pK(τ), it should happen that ⨆_{pK} u_{k} = ⨆_{pK(τ)} u_{k} : (A, ⪯_{A}) ⇀ (B, ⪯_{B}). How this could be guaranteed is shown by the following chain of implications: if x ⪯_{A} v then

⨆ u_{k} ∘ x ↓

⇒ ∃ l. ∀k ≥ l. u_{k} ∘ x ↓ , assuming that
K(1, A) is inaccessible by lubs of ω-chains in pK(1, A) (9.9)
⇒ ∃ l. ∀k ≥ l. u_{k} ∘ x ⪯_{B} v , because u_{k} : (A, ⪯_{A}) ⇀ (B, ⪯_{B})
⇒ ⨆ u_{k} ∘ x ⪯_{B} v , assuming that
⪯_{B}^{−1}(v) is closed under lubs of ω-chains in pK(1, B).  (9.10)

How to cut down the relations in the R(τ)’s is then dictated by (9.10):

Definition 9.2.7 Let pK(τ) be the full subcategory of R(τ) consisting of all those objects (A, ⪯) such that for every v ∈ Values(τ), ⪯^{−1} (v) is closed under lubs of ω-chains in pK(1, A). □

Proposition 9.2.8 For every ⊢ τ, (0, ∅) is a zero object in pK(τ) if and only if pK is non-trivial.

Proof: As in Proposition 9.2.4. □

We identify those Cpo-models satisfying (9.9):

Definition 9.2.9 A Cpo-model of FPC is absolute if for every A ∈ | K |, K(1, A) is inaccessible by lubs of ω-chains in pK(1, A). □

Proposition 9.2.10 In an absolute Cpo-model of FPC, for every (A, ⪯) ∈ | pK(τ) | and p ∈ Programs(τ), ≾^{−1} (p) is closed under lubs of ω-chains in pK(1, A).

Proof: Let ⟨u_{k}⟩ be an ω-chain in pK(1, A) such that u_{k} ≾ p. If ⨆ u_{k} ↓ there exists l such that u_{l} ↓. Then, for every k ≥ l, u_{k} ↓ and thus there exists v_{k} such that p ⇝ v_{k} and u_{k} ⪯ v_{k}. Since ⇝ is functional, there exists v such that p ⇝ v and u_{k} ⪯ v. But then ⨆ u_{k} ⪯ v and thus ⨆ u_{k} ≾ p. □

In domain-theoretic models of FPC (see Definition 8.5.1) absoluteness has a simple characterisation:

Proposition 9.2.11 A domain-theoretic model of FPC is absolute if and only if [id_{1}] is inaccessible by lubs of ω-chains in D(1). □

Remark. Equivalently, the above could have been stated as: the D-classifier t : 1 ↣ Σ is inaccessible by lubs of ω-chains in K(1, Σ). (This motivates the terminology as, in absolute domain-theoretic models of FPC, computable truth is absolute in that the only way to approximate it is to have it.)

Example 9.2.12 For a small Cpo-category W, the domain-theoretic model ([W, Cpo], ΣC_{[W,Cpo]}) is absolute if and only if W has a finite number of connected components. □

From now on, and till the end of the section, let our fixed Cpo-model of FPC be an absolute non-trivial domain-theoretic one. Then, as follows from the previous analysis, pK(τ) with the order inherited from pK is Cpo-enriched and U_{τ} is a Cpo-functor, but even better:

Proposition 9.2.13 Properties (A1)–(A5) hold.

Proof: Property (A1) holds by construction of pK(τ).

Property (A2) holds, as follows from Corollary 7.2.4, because pK(τ) has ep-zero, (viz. (0, ∅)); pK has colimits of ω-chains of embeddings; and

U_{τ} : pK(τ) → pK creates colimits of ω-chains of embeddings  (9.11)

as we now show. Given an ω-chain of embeddings ⟨(A_{k}, ⪯_{k}), f_{k}⟩ in pK(τ) and a colimit ϕ : ⟨A_{k}, f_{k}⟩ \underrightarrow{.} A in pK, by the Limit/Colimit Coincidence Theorem, it is enough to endow A with a relation ⪯ ⊆ K(1, A) × Values(τ) such that

(A, ⪯) ∈ | pK(τ) |,  (9.12)
ϕ_{k} : (A_{k}, ⪯_{k}) → (A, ⪯), and  (9.13)
ϕ_{k}^{R} : (A, ⪯) ⇀ (A_{k}, ⪯_{k}).  (9.14)

In fact (9.12)–(9.14) determine ⪯ as, by (9.14), we should have that x ⪯ v ⇒ ϕ_{k}^{R} ∘ x ≾_{k} v; whilst

ϕ_{k}^{R} ∘ x ≾_{k} v

⇒ ϕ_{k} ∘ ϕ_{k}^{R} ∘ x ≾ v  , by (9.13)
⇒ x = ⨆ ϕ_{k} ∘ ϕ_{k}^{R} ∘ x ≾ v , by (9.12) using Proposition 9.2.10

and the Limit/Colimit Coincidence Theorem

⇒ x ⪯ v.

Thus, we define

x ⪯ v ⟺ ∀ k ∈ | ω |. ϕ_{k}^{R} ∘ x ≾_{k} v

and check that (9.12)–(9.14) are satisfied. First, for every ω-chain ⟨x_{l}⟩ in K(1, A) such that x_{l} ⪯ v we have that ϕ_{k}^{R} ∘ x_{l} ≾_{k} v and therefore ϕ_{k}^{R} ∘ ⨆ x_{l} = ⨆_{l} ϕ_{k}^{R} ∘ x_{l} ≾_{k} v. That is, ⨆ x_{l} ⪯ v and thus (A, ⪯) ∈ | pK(τ) |. Second, ϕ_{k} : (A_{k}, ⪯_{k}) → (A, ⪯) if and only if x ⪯_{k} v ⇒ ∀ l ∈ | ω |. ϕ_{l}^{R} ∘ ϕ_{k} ∘ x ≾_{l} v. And assuming that x ⪯_{k} v, for l ≤ k we have that ϕ_{l}^{R} ∘ ϕ_{k} ∘ x = f_{l,k}^{R} ∘ x (using ϕ_{l}^{R} = f_{l,k}^{R} ∘ ϕ_{k}^{R}) and since f_{l,k}^{R} : (A_{k}, ⪯_{k}) ⇀ (A_{l}, ⪯_{l}) it follows that f_{l,k}^{R} ∘ x ≾_{l} v; whilst, for l ≥ k we have that ϕ_{l}^{R} ∘ ϕ_{k} ∘ x = f_{k,l} ∘ x (using ϕ_{k} = ϕ_{l} ∘ f_{k,l}) and since f_{k,l} : (A_{k}, ⪯_{k}) → (A_{l}, ⪯_{l}) it follows that f_{k,l} ∘ x ≾_{l} v. Third, ϕ_{k}^{R} : (A, ⪯) ⇀ (A_{k}, ⪯_{k}) by definition.

Property (A3) holds because for every (A, ⪯_{A}) ∈ | pK(σ) | and (B, ⪯_{B}) ∈ | pK(τ) |,

(A ⋆ B, ⪯_{A} ⋆ ⪯_{B}) ∈ | pK(σ ⋆ τ) | (⋆ ∈ {+, ⊗, ⇀ ⇀}).

We consider each case:

+: Let ⟨x_{k}⟩ be an ω-chain in K(1, A + B) such that x_{k} (⪯_{A} + ⪯_{B}) v. There are two cases:

– v ≡ inl(v_{1}): Then, for k ∈ | ω |, there exists x′_{k} such that x_{k} = ⨿_{1} ∘ x′_{k} and x′_{k} ⪯_{A} v_{1}. As ⨿_{1} is full (by Proposition 5.3.12 and Theorem 4.2.4), ⟨x′_{k}⟩ is an ω-chain in K(1, A). Moreover, ⨆ x_{k} = ⨿_{1} ∘ ⨆ x′_{k} and ⨆ x′_{k} ⪯_{A} v_{1}. That is, ⨆ x_{k} (⪯_{A} + ⪯_{B}) inl(v_{1}).

– v ≡ inr(v_{2}): analogous to the previous case.

⊗: Let ⟨x_{k}⟩ be an ω-chain in K(1, A ⊗ B) such that x_{k} (⪯_{A} ⊗ ⪯_{B}) ⟨v_{1}, v_{2}⟩. Then, for k ∈ | ω |, π_{1} ∘ x_{k} ⪯_{A} v_{1} and π_{2} ∘ x_{k} ⪯_{B} v_{2}. Thus π_{1} ∘ ⨆ x_{k} = ⨆ π_{1} ∘ x_{k} ⪯_{A} v_{1} and π_{2} ∘ ⨆ x_{k} = ⨆ π_{2} ∘ x_{k} ⪯_{B} v_{2}. That is, ⨆ x_{k} (⪯_{A} ⊗ ⪯_{B}) ⟨v_{1}, v_{2}⟩.

⇀ ⇀: Let ⟨f_{k}⟩ be an ω-chain in K(1, A⇀ ⇀B) such that f_{k} (⪯_{A} ⇀ ⇀ ⪯_{B}) λx.e. Assuming that x ⪯_{A} v, for k ∈ | ω |, ε ∘ ⟨⟨f_{k}, x⟩⟩ ≾_{B} e[x ↦ v] and therefore, by Proposition 9.2.10, ε ∘ ⟨⟨⨆ f_{k}, x⟩⟩ = ⨆ ε ∘ ⟨⟨f_{k}, v⟩⟩ ≾_{B} e[x ↦ v]. That is, ⨆ f_{k} (⪯_{A} ⇀ ⇀ ⪯_{B}) λx.e.

Property (A4) holds because

(𝕀 ⪯)^{−1}(intro(v)) = ⪯^{−1} (v) and (𝔼 ⪯)^{−1}(v) = ⪯^{−1} (intro(v)).

Finally, the Strict Uniformity Property holds by Proposition 7.3.14 (which is applicable because U_{τ}^{op} × U_{τ} preserves the zero object and creates colimits of ω-chains of embeddings as so does U_{τ} —see (9.11)). □

Now that Properties (A1)–(A5) are known to hold, the formal-approximation relations are constructed by providing a non-standard interpretation of types in the pK(τ)’s (Proposition 9.2.14) which extends the interpretation of types (Definition 8.4.1) respecting the folding/unfolding of recursive types (Corollary 9.2.15) and the substitution of types (Lemma 9.2.16).

Convention. Given Θ ≡ T_{1}, …, T_{m} and ⊢ σ_{i} (1 ≤ i ≤ m) we write σ⃗ for σ_{1}, …, σ_{m} and [Θ ↦ σ⃗] for [T_{1} ↦ σ_{1}, …, T_{m} ↦ σ_{m}].

Proposition 9.2.14 There exists an interpretation

⟨[Θ ⊢ τ]⟩(σ⃗) : pK(σ_{1})^{}˘ × … × pK(σ_{|Θ|})^{}˘ → pK(τ[Θ ↦ σ⃗])^{}˘ .

such that ⟨[Θ ⊢ τ]⟩(σ⃗) is a symmetric Cpo-functor and

pK(τ[Θ ↦ σ⃗])^{}˘p̆K p̆K × … × p̆K  ⟨[Θ ⊢ τ]⟩(σ⃗) [[Θ ⊢ τ]] pK(σ_{1})^{}˘ × … × pK(σ_{|Θ|})^{}˘  .

Proof: By induction on the derivation of τ.

Write m for | Θ |.

• τ ≡ Θ_{i} (1 ≤ i ≤ m): Define ⟨[Θ ⊢ Θ_{i}]⟩(σ⃗) = Π_{i}.

• τ ≡ τ_{1} ⋆ τ_{2} where ⋆ ∈ {+, ×, ⇀ ⇀}:

Define ⟨[Θ ⊢ τ_{1} ⋆ τ_{2}]⟩(σ⃗) = ⟨[⋆_{τ_{1}[Θ↦σ⃗],τ_{2}[Θ↦σ⃗]}]⟩˘˘ ∘ ⟨⟨[Θ ⊢ τ_{1}]⟩(σ⃗), ⟨[Θ ⊢ τ_{2}]⟩(σ⃗)⟩

where ⟨[⋆_{σ,τ}]⟩ = \{ \begin{matrix}+_{σ,τ} & , if ⋆ = + \\ ⊗_{σ,τ} & , if ⋆ = × \\ ⇀ ⇀_{σ,τ} & , if ⋆ = ⇀ ⇀ \end{matrix} .

By induction, ⟨[Θ ⊢ τ_{i}]⟩(σ⃗) (i = 1, 2) are symmetric Cpo-functors and therefore so is ⟨[Θ ⊢ τ_{1} ⋆ τ_{2}]⟩(σ⃗).

Moreover,

p̆K × … × p̆K  ⟨[[Θ ⊢ τ_{1}]], [[Θ ⊢ τ_{2}]]⟩  p̆K × p̆K pK(σ_{1})^{}˘ × … × pK(σ_{m})^{}˘ ⟨⟨[Θ ⊢ τ_{1}]⟩(σ⃗), ⟨[Θ ⊢ τ_{2}]⟩(σ⃗)⟩ pK(τ_{1}[Θ ↦ σ⃗])^{}˘ × pK(τ_{2}[Θ ↦ σ⃗])^{}˘

and since it follows from Proposition 9.2.5 and Property (A3) that

p̆K × p̆K  p̆K [[⋆]]˘˘ pK(τ_{1}[Θ ↦ σ⃗])^{}˘ × pK(τ_{2}[Θ ↦ σ⃗])^{}˘ ⟨[⋆_{τ_{1}[Θ↦σ⃗],τ_{2}[Θ↦σ⃗]}]⟩˘˘ pK(τ_{1}[Θ ↦ σ⃗] ⋆ τ_{2}[Θ ↦ σ⃗])^{}˘ (9.15)

we are done.

• τ ≡ μT. τ′: By induction, ⟨[Θ, T ⊢ τ′]⟩(σ⃗, μT. τ′[Θ ↦ σ⃗]) is a symmetric Cpo-functor and, writing τ′′ for τ′[Θ ↦ σ⃗, T ↦ μT.τ′[Θ ↦ σ⃗]] ≡ τ′[T ↦ μT. τ′][Θ ↦ σ⃗], we have that

pK(σ_{1})^{}˘ × … × pK(σ_{m})^{}˘ × pK(μT. τ′[Θ ↦ σ⃗])^{}˘ ⟨[Θ, T ⊢ τ′]⟩(σ⃗, μT. τ′[Θ ↦ σ⃗]) pK(τ′′)^{}˘p̆K × … × p̆K × p̆K  [[Θ, T ⊢ τ′]]  p̆K

commutes.

Therefore, also

p̆K × … × p̆K × p̆K  pK(τ′′)^{}˘  pK(μT. τ′[Θ ↦ σ⃗])^{}˘p̆K pK(σ_{1})^{}˘ × … × pK(σ_{m})^{}˘ × pK(μT. τ′[Θ ↦ σ⃗])^{}˘ ⟨[Θ, T ⊢ τ′]⟩(σ⃗, μT. τ′[Θ ↦ σ⃗])  𝕀^{op} × 𝕀 F [[Θ, T ⊢ τ′]]

commutes (where F is a symmetric Cpo-functor) and, by the Strict Uniformity Property and Proposition 9.2.6, there exists F^{†} such that

p̆K pK(μT. τ′[Θ ↦ σ⃗])^{}˘p̆K × … × p̆K pK(σ_{1})^{}˘ × … × pK(σ_{m})^{}˘[[Θ, T ⊢ τ′]]^{‡} = [[Θ ⊢ μT. τ′]] F^{‡}  .

Defining [[Θ ⊢ μT.τ′]](σ⃗) = F^{‡} we are done. □ Inspecting the last case in the above proof and using Proposition 9.2.6 we have:

Corollary 9.2.15 For F = (𝕀^{op} × 𝕀) ∘ ⟨[Θ, T ⊢ τ]⟩(σ⃗, μT. τ[Θ ↦ σ⃗]),

p̆K pK(μT. τ[Θ ↦ σ⃗])^{}˘p̆K × … × p̆K  ⟨[Θ ⊢ μT. τ]⟩(σ⃗) F ⟨Id, ⟨[Θ ⊢ μT. τ]⟩(σ⃗)⟩ ≅ [[Θ ⊢ μT. τ]] [[Θ, T ⊢ τ]]⟨Id, [[Θ ⊢ μT. τ]]⟩ ≅^{φ} pK(σ_{1})^{}˘ × … × pK(σ_{|Θ|})^{}˘  □ .

Lemma 9.2.16 (Substitution Lemma) There exists a canonical natural isomorphism

⟨[Θ ⊢ τ_{1}[T ↦ τ_{2}]]⟩(σ⃗) ≅ ⟨[Θ, T ⊢ τ_{1}]⟩(σ⃗, τ_{2}[Θ ↦ σ⃗]) ∘ ⟨Id, ⟨[Θ ⊢ τ_{2}]⟩(σ⃗)⟩

satisfying

p̆K × … × p̆K  [[Θ, T ⊢ τ_{1}]] ∘ ⟨Id, [[Θ ⊢ τ_{2}]]⟩  p̆K ≅ ⟨[Θ, T ⊢ τ_{1}]⟩(σ⃗, τ_{2}[Θ ↦ σ⃗]) ∘ ⟨Id, ⟨[Θ ⊢ τ_{2}]⟩(σ⃗)⟩ β ≅ ⟨[Θ ⊢ τ_{1}[T ↦ τ_{2}]]⟩(σ⃗) [[Θ ⊢ τ_{1}[T ↦ τ_{2}]]]  pK(τ)^{}˘ pK(σ_{1})^{}˘ × … × pK(σ_{|Θ|})^{}˘

where τ ≡ τ_{1}[Θ ↦ σ⃗, T ↦ τ_{2}[Θ ↦ σ⃗]] ≡ τ_{1}[T ↦ τ_{2}][Θ ↦ σ⃗] and β is given by Lemma 8.4.4.

Proof: By induction on the derivation of τ_{1} (along the lines of the proof of Lemma 8.4.4 —see Appendix A— suitably generalising the permutation and contraction lemmas) using (9.15), and Propositions 9.2.6, D.0.1 and D.0.2.

The details are left to the reader. □

9. Computational Soundness and Adequacy 217 From the non-standard interpretation of types, the formal-approximation relations

are easily extracted: Corollary 9.2.17 There exists a family of relations {⪯_{τ} ⊆ K(1, [[⊢ τ]]_{2}) × Values(τ)} such that

1. • x ⪯_{σ+τ} inl(v) ⟺ ∃ x′. x = ⨿_{1} ∘ x′ ∧ x′ ⪯_{σ} v.

• x ⪯_{σ+τ} inr(v) ⟺ ∃ x′. x = ⨿_{2} ∘ x′ ∧ x′ ⪯_{τ} v.

2. x ⪯_{σ×τ} ⟨v_{1}, v_{2}⟩ ⟺ (π_{1} ∘ x ⪯_{σ} v_{1}) ∧ (π_{2} ∘ x ⪯_{τ} v_{2}).

3. f ⪯_{σ⇀ ⇀τ} λx. e ⟺ (x ⪯_{σ} v ⇒ ε ∘ ⟨⟨f, x⟩⟩ ≾_{τ} e[x ↦ v]).

4. x ⪯_{μT. τ} intro(v) ⟺ E ∘ x ⪯_{τ[T ↦ μT. τ]} v. Proof: By Proposition 9.2.14, ⟨[⊢ τ]⟩_{2} is of the form ([[⊢ τ]]_{2}, ⪯_{τ}).

The family {⪯_{τ}} has the above properties because

1. ⟨[⊢ σ + τ]⟩_{2} = ⟨[⊢ σ]⟩_{2} + ⟨[⊢ τ]⟩_{2}.

2. ⟨[⊢ σ × τ]⟩_{2} = ⟨[⊢ σ]⟩_{2} ⊗ ⟨[⊢ τ]⟩_{2}.

3. ⟨[⊢ σ⇀ ⇀τ]⟩_{2} = ⟨[⊢ σ]⟩_{1}⇀ ⇀⟨[⊢ τ]⟩_{2} and ⟨[⊢ σ]⟩_{1} = ⟨[⊢ σ]⟩_{2}.

4. ⟨[⊢ μT. τ]⟩ ≅ (𝕀^{op} × 𝕀)(⟨[T ⊢ τ]⟩⟨[⊢ μT. τ]⟩) ≅ (𝕀^{op} × 𝕀)⟨[⊢ τ[T ↦ μT. τ]]⟩ so that, by

Corollary 9.2.15 and Lemma 9.2.16,

E : ([[⊢ μT. τ]]_{2}, ⪯_{μT. τ}) = ⟨[⊢ μT. τ]⟩_{2}
≅ 𝕀 ⟨[⊢ τ[T ↦ μT. τ]]⟩_{2}
= ([[⊢ τ[T ↦ μT.τ]]]_{2}, 𝕀 ⪯_{τ[T ↦ μT. τ]}) : I

and hence

x ⪯_{μT.τ} intro(v)
⇒ E ∘ x (𝕀 ⪯_{τ[T ↦ μT.τ]}) intro(v)
⇒ E ∘ x ⪯_{τ[T ↦ μT.τ]} v
⇒ E ∘ x (𝕀 ⪯_{τ[T ↦ μT.τ]}) intro(v)
⇒ x = I ∘ E ∘ x ⪯_{μT.τ} intro(v).  □

9. Computational Soundness and Adequacy 218

The main lemma, where the induction hinted at the beginning of the subsection takes place, follows:

Lemma 9.2.18 For Γ ≡ x_{1} : τ_{1}, …, x_{n} : τ_{n}, if x_{i} ⪯_{τ_{i}} v_{i} (1 ≤ i ≤ n) then [[Γ ⊢ e : τ]] ∘ ⟨⟨x_{1}, …, x_{n}⟩⟩ ≾_{τ} e[x_{1} ↦ v_{1}, …, x_{n} ↦ v_{n}].

Proof: By induction on the structure of e. Write x for ⟨⟨x_{1}, …, x_{n}⟩⟩ and [x⃗ ↦ v⃗] for [x_{1} ↦ v_{1}, …, x_{n} ↦ v_{n}].

• e ≡ x_{i} (1 ≤ i ≤ n):

[[Γ ⊢ x_{i} : τ_{i}]] ∘ x = π_{i} ∘ x = x_{i} ⪯_{τ_{i}} v_{i} and x_{i}[x⃗ ↦ v⃗] ≡ v_{i} ⇝ v_{i}.

• e ≡ inl(e′):

Assume that [[Γ ⊢ inl(e′) : τ′ + τ′′]] ∘ x ↓. Then, since [[Γ ⊢ inl(e′) : τ′ + τ′′]] ∘ x = ⨿_{1} ∘ [[Γ ⊢ e′ : τ′]] ∘ x it follows that [[Γ ⊢ e′ : τ′]] ∘ x ↓ and, by induction, there exists v′ such that e′[x⃗ ↦ v⃗] ⇝ v′ and [[Γ ⊢ e′ : τ′]] ∘ x ⪯_{τ′} v′. Therefore,

inl(e′)[x⃗ ↦ v⃗] ≡ inl(e′[x⃗ ↦ v⃗]) ⇝ inl(v′)

and

⨿_{1} ∘ [[Γ ⊢ e′ : τ′]] ∘ x ⪯_{τ′+τ′′} inl(v′).

• e ≡ inr(e′′): analogous to the previous case.

• e ≡ case e_{0} of inl(y_{1}).e_{1} or inr(y_{2}).e_{2}:

Assume that [[Γ ⊢ case e_{0} of inl(y_{1}).e_{1} or inr(y_{2}).e_{2} : τ]] ∘ x ↓. Then, since [[Γ ⊢ case e_{0} of inl(y_{1}).e_{1} or inr(y_{2}).e_{2} : τ]] ∘ x

= [[[Γ, y_{1} : τ′ ⊢ e_{1} : τ]], [[Γ, y_{2} : τ′′ ⊢ e_{2} : τ]]] ∘ δ ∘ ⟨⟨x, [[Γ ⊢ e_{0} : τ′ + τ′′]] ∘ x⟩⟩

it follows that [[Γ ⊢ e_{0} : τ′ + τ′′]] ∘ x ↓ and, by induction, there exists v′ such that e_{0}[x⃗ ↦ v⃗] ⇝ v′ and [[Γ ⊢ e_{0} : τ′ + τ′′]] ∘ x ⪯_{τ′+τ′′} v′.

There are two subcases:

– v′ ≡ inl(v′_{1}):

Then, e_{0}[x⃗ ↦ v⃗] ⇝ inl(v′_{1}) and [[Γ ⊢ e_{0} : τ′ + τ′′]] ∘ x ⪯_{τ′+τ′′} inl(v′_{1}). Thus there exists y such that [[Γ ⊢ e_{0} : τ′ + τ′′]] ∘ x = ⨿_{1} ∘ y and y ⪯_{τ′} v′_{1}. Then, since

[[Γ ⊢ case e_{0} of inl(y_{1}).e_{1} or inr(y_{2}).e_{2} : τ]] ∘ x
= [[[Γ, y_{1} : τ′ ⊢ e_{1} : τ]], [[Γ, y_{2} : τ′′ ⊢ e_{2} : τ]]] ∘ δ ∘ ⟨⟨x, ⨿_{1} ∘ y⟩⟩
= [[Γ, y_{1} : τ′ ⊢ e_{1} : τ]] ∘ ⟨⟨x, y⟩⟩

it follows that [[Γ, y_{1} : τ′ ⊢ e_{1} : τ]] ∘ ⟨⟨x, y⟩⟩ ↓ and, by induction, there exists v′′ such that e_{1}[x⃗ ↦ v⃗, y_{1} ↦ v′_{1}] ⇝ v′′ and [[Γ, y_{1} : τ′ ⊢ e_{1} : τ]] ∘ ⟨⟨x, y⟩⟩ ⪯_{τ} v′′. Therefore,

e[x⃗ ↦ v⃗] ⇝ v′′

and

[[Γ ⊢ e : τ]] ∘ x ⪯_{τ} v′′.

– v′ ≡ inr(v′_{2}): analogous to the previous subcase.

• e ≡ fst(e′):

Assume that [[Γ ⊢ fst(e′) : τ]] ∘ x ↓.

Then, since [[Γ ⊢ fst(e′) : τ]] ∘ x = π_{1} ∘ [[Γ ⊢ e′ : τ × σ]] ∘ x it follows that [[Γ ⊢ e′ : τ × σ]] ∘ x ↓ and, by induction, there exists ⟨v′_{1}, v′_{2}⟩ such that e′[x⃗ ↦ v⃗] ⇝ ⟨v′_{1}, v′_{2}⟩ and [[Γ ⊢ e′ : τ × σ]] ∘ x ⪯_{τ×σ} ⟨v′_{1}, v′_{2}⟩.

Therefore,

fst(e′)[x⃗ ↦ v⃗] ≡ fst(e′[x⃗ ↦ v⃗]) ⇝ v′_{1}

and

π_{1} ∘ [[Γ ⊢ e′ : τ × σ]] ∘ x ⪯_{τ} v′_{1}.

• e ≡ snd(e′): analogous to the previous case.

9. Computational Soundness and Adequacy 220

• e ≡ ⟨e_{1}, e_{2}⟩: Assume that [[Γ ⊢ ⟨e_{1}, e_{2}⟩ : σ_{1} × σ_{2}]] ∘ x ↓. Then, since [[Γ ⊢ ⟨e_{1}, e_{2}⟩ : σ_{1} × σ_{2}]] ∘ x = ⟨⟨[[Γ ⊢ e_{1} : σ_{1}]] ∘ x, [[Γ ⊢ e_{2} : σ_{2}]] ∘ x⟩⟩, for i = 1, 2, it follows that [[Γ ⊢ e_{i} : σ_{i}]] ∘ x ↓ and, by induction, there exists v′_{i} such that e_{i}[x⃗ ↦ v⃗] ⇝ v′_{i} and π_{i} ∘ [[Γ ⊢ ⟨e_{1}, e_{2}⟩ : σ_{1} × σ_{2}]] ∘ x = [[Γ ⊢ e_{i} : σ_{i}]] ∘ x ⪯_{σ_{i}} v′_{i}. Therefore

⟨e_{1}, e_{2}⟩[x⃗ ↦ v⃗] ≡ ⟨e_{1}[x⃗ ↦ v⃗], e_{2}[x⃗ ↦ v⃗]⟩ ⇝ ⟨v′_{1}, v′_{2}⟩

and

[[Γ ⊢ ⟨e_{1}, e_{2}⟩ : σ_{1} × σ_{2}]] ∘ x ⪯_{σ_{1}×σ_{2}} ⟨v′_{1}, v′_{2}⟩.

• e ≡ λy. e′:

Then,

(λy. e′)[x⃗ ↦ v⃗] ≡ λy. e′[x⃗ ↦ v⃗] ⇝ λy. e′[x⃗ ↦ v⃗]

and

[[Γ ⊢ λy. e′ : σ_{1}⇀ ⇀σ_{2}]] ∘ x ⪯_{σ_{1}⇀ ⇀σ_{2}} λy. e′[x⃗ ↦ v⃗]

because if y ⪯_{σ_{1}} v′ then

ε ∘ ⟨⟨[[Γ ⊢ λy. e′ : σ_{1}⇀ ⇀σ_{2}]] ∘ x, y⟩⟩

= ε ∘ (pλ([[Γ, y : σ_{1} ⊢ e′ : σ_{2}]]) ⊗ id) ∘ ⟨⟨x, y⟩⟩
= [[Γ, y : σ_{1} ⊢ e′ : σ_{2}]] ∘ ⟨⟨x, y⟩⟩
≾_{σ_{2}} e′[x⃗ ↦ v⃗, y ↦ v′]  by induction.

• e ≡ e_{1}(e_{2}): Assume that [[Γ ⊢ e_{1}(e_{2}) : τ]] ∘ x ↓. Since [[Γ ⊢ e_{1}(e_{2}) : τ]] ∘ x = ε ∘ ⟨⟨[[Γ ⊢ e_{1} : σ⇀ ⇀τ]] ∘ x, [[Γ ⊢ e_{2} : σ]] ∘ x⟩⟩ it follows that [[Γ ⊢ e_{1} : σ⇀ ⇀τ]] ∘ x ↓ and [[Γ ⊢ e_{2} : σ]] ∘ x ↓. Thus, by induction, there exist λy. e′ and v′ such that e_{1}[x⃗ ↦ v⃗] ⇝ λy. e′ ∧ [[Γ ⊢ e_{1} : σ⇀ ⇀τ]] ∘ x ⪯_{σ⇀ ⇀τ} λy. e′ and e_{2}[x⃗ ↦ v⃗] ⇝ v′ ∧ [[Γ ⊢ e_{2} : σ]] ∘ x ⪯_{σ} v′.

9. Computational Soundness and Adequacy 221

Then,

[[Γ ⊢ e_{1}(e_{2}) : τ]] ∘ x
= ε ∘ ⟨⟨[[Γ ⊢ e_{1} : σ⇀ ⇀τ]] ∘ x, [[Γ ⊢ e_{2} : σ]] ∘ x⟩⟩
≾_{τ} e′[y ↦ v′]

Therefore, as [[Γ ⊢ e_{1}(e_{2}) : τ]] ∘ x ↓, there exists v′′ such that e′[y ↦ v′] ⇝ v′′ and

[[Γ ⊢ e_{1}(e_{2}) : τ]] ∘ x ⪯_{τ} v′′.

Also,

e_{1}(e_{2})[x⃗ ↦ v⃗] ≡ e_{1}[x⃗ ↦ v⃗](e_{2}[x⃗ ↦ v⃗]) ⇝ v′′.

• e ≡ intro(e′): Assume that [[Γ ⊢ intro(e′) : μT. τ′]] ∘ x ↓. Then, since [[Γ ⊢ intro(e′) : μT. τ′]] ∘ x = I ∘ [[Γ ⊢ e′ : τ′[T ↦ μT. τ′]]] ∘ x it follows that [[Γ ⊢ e′ : τ′[T ↦ μT. τ′]]] ∘ x ↓ and, by induction, there exists v′ such that e′[x⃗ ↦ v⃗] ⇝ v′ and [[Γ ⊢ e′ : τ′[T ↦ μT. τ′]]] ∘ x ⪯_{τ′[T ↦ μT. τ′]} v′. Therefore,

intro(e′)[x⃗ ↦ v⃗] ≡ intro(e′[x⃗ ↦ v⃗]) ⇝ intro(v′)

and

I ∘ [[Γ ⊢ e′ : τ′[T ↦ μT. τ′]]] ∘ x ⪯_{μT. τ′} intro(v′).

• e ≡ elim(e′): Assume that [[Γ ⊢ elim(e′) : τ′[T ↦ μT. τ′]]] ∘ x ↓. Then, since [[Γ ⊢ elim(e′) : τ′[T ↦ μT. τ′]]] ∘ x = E ∘ [[Γ ⊢ e′ : μT. τ′]] ∘ x it follows that [[Γ ⊢ e′ : μT. τ′]] ∘ x ↓ and, by induction, there exists intro(v′) such that e′[x⃗ ↦ v⃗] ⇝ intro(v′) and [[Γ ⊢ e′ : μT. τ′]] ∘ x ⪯_{μT. τ′} intro(v′). Therefore,

elim(e′)[x⃗ ↦ v⃗] ≡ elim(e′[x⃗ ↦ v⃗]) ⇝ v′

and

E ∘ [[Γ ⊢ e′ : μT. τ′]] ∘ x ⪯_{τ′[T ↦ μT. τ′]} v′. □

Finally:

Theorem 9.2.19 (Computational Adequacy) Every absolute non-trivial domaintheoretic model of FPC is computationally adequate.

Proof: Because, by Lemma 9.2.18, [[⊢ p : τ]] ≾_{τ} p. □

Remark. Properties (A1)–(A5), which play a fundamental organisational role in our proof of computational adequacy, provide sufficient conditions for establishing such a result for arbitrary V-models. In fact, it is implicit in our analysis that:

A V-model of FPC for which there are V-categories L(τ), such that L(τ)_{0} ≅ pK(τ), satisfying Properties (A1)–(A5) where ‘Cpo’ is replaced by ‘V’ and ‘Cpo-functor’ by ‘functor that V-enriches’, is computationally adequate.

Remark. Using (A3), domain structures with a Cpo-category of total maps satisfying the axioms (DTM1)–(DTM4) and absoluteness, and equipped with structure for interpreting natural numbers and booleans can be shown to be computationally adequate for call-by-value PCF with sums and products (c.f. [BCL85]).

Corollary 9.2.20 For every non-empty small Cpo-category W, the domain-theoretic model specified by ([W, Cpo], ΣC_{[W,Cpo]}) is computationally adequate. □

Remark. Thus there are computationally-adequate non-absolute domain-theoretic models.

10 Summary and Further Research

We have initiated an abstract approach to domain theory as needed for the denotational semantics of deterministic programming languages. To provide an explicit semantic treatment of non-termination, we decided to make partiality the core of our theory. Thus, we focussed on categories of partial maps. We have studied the representability of partial maps and shown its equivalence with classifiability. We have observed that, once partiality is taken as primitive, a notion of approximation may be derived. In fact, two notions of approximations based on testing and observing partial maps have been considered and shown to coincide. Further we have characterised when the approximation relation between partial maps is domain-theoretic in the (technical) sense that the category of partial maps Cpo-enriches with respect to it.

Concerning the semantics of type constructors in categories of partial maps we have: presented a characterisation of colimits of diagrams of total maps due to Gordon Plotkin; studied order-enriched partial cartesian closure; and provided conditions to guarantee the existence of the limits needed to solve recursive type equations. Concerning the semantics of recursive types we have: made Peter Freyd’s notion of algebraic compactness the central concept; motivated the compactness axiom; established the fundamental property of parameterised algebraically compact categories (slightly extending a previous result of Peter Freyd); and shown that in algebraically compact categories recursive types reduce to inductive types. Special attention has been paid to Cpo-algebraic compactness, leading to the identification of a 2-category of kinds with very strong closure properties.

As an application of the theory developed, enriched categorical models of the metalanguage FPC have been defined and two abstract classes of models, including domaintheoretic models, have been axiomatised. Further, the metalanguage FPC was considered as a programming language with a call-by-value operational semantics and a denotational semantics (defined on top of a categorical model). It was observed that the interpretation of FPC expressions in Poset-models arising from Poset-domain-structures is representation-independent. The denotational semantics was shown to be computationally sound for the operational semantics and, more strikingly, a computational adequacy result for an axiomatisation of absolute non-trivial domain-theoretic models was proved.

The main conclusion drawn from our investigation is, thus, that axiomatic domain theory is not a dream but a possibility. But much work remains to be done as we now indicate.

10.1 Towards Axiomatic Domain Theory

We have not tried to axiomatise categories of partial maps and partial products. We plan to do it in a way for which there is a representation theorem along the following lines:

Every axiomatised Cpo-category of partial maps C is equivalent to one of the form (p(C_{t}, D), ⊏ ∼ ) where C_{t} is the subcategory of total maps in C.

so that our current approach will transfer to the new one. We wonder whether such a representation theorem is available for bicategories of partial maps (see Definition 5.1.6 and Proposition 5.1.7) but, if not, we hope that the thorough study of categories of partial maps done will lead us to a natural axiomatisation.

Concerning recursive types we have obtained algebraic compactness (from the Limit/Colimit Coincidence Theorem) by stating closure under ep-zero objects and colimits of ω-chains of embeddings as axioms. Recently, in [Wag94], the category of complete internal preorders (cipos) in a sheaf topos over a suitable Heyting algebra has been shown to be closed under colimits of ω-chains of retractions. This result unifies previously known ones as, depending on the choice of the complete Heyting algebra, the cipos externally appear as cpos or generalised metric spaces. We would like to see whether our approach based on Cpo-enrichment generalises to cipo-enrichment. If so, this might suggest new (hopefully non-order-theoretic) examples. But even if not, we might hope to approach the old question of representability of categories of domains from this viewpoint. It might well happen that the structure required of cipo-models of FPC (or some appealing notion of cipo-categories of domains) forces the complete Heyting algebra over which the cipos are taken to be such that, externally, the cipos are some kind of complete partial order; thus making order-enrichment the only alternative.

10.2 Algebraic Completeness and Compactness

There are some (we believe, interesting and hard) questions which remain open:

1. We have exhibited a Poset-functor with a parameterised initial algebra which does not enrich. However a counterexample for

V-algebraic completeness implies parameterised V-algebraic completeness (10.1)

is still missing. In fact, we conjecture that (10.1) does not hold in general and plan to investigate conditions under which it does.

2. We conjecture that algebraically complete categories are not closed under exponentiation.

3. We wonder which closure properties (apart from closure under initial object) are forced on a category by algebraic completeness. In particular, are Cpo-algebraically complete categories with e-initial object closed under colimits of ω-chains of embeddings?

For the sake of generality and to encompass more applications (e.g., the extensional pers of [FMRS92] where algebraic compactness holds for all realisable functors) we would like to investigate completeness and compactness in a 2-categorical setting. As it turns out the basic definitions can be easily stated. First, in a 2-cartesian-category C, the category of algebras for an arrow F : A → A is defined as the inserter [Kel89] of the pair (F, Id_{A}). That is, a datum

A A^{Id_{A}} p A p F -Alg F σ

with the universal property that for every other datum

A A^{Id_{A}} A  F X q  q τ

there exists a unique u : X → F -Alg such that

u ∘ p = q : X → A and uσ = τ : F ∘ q ⇒ q : X → A.

Then, initial F -algebras are defined as initial objects in C(1, F -Alg). And thus, the notions of algebraic completeness and compactness can be introduced.

10.3 Computational Adequacy

We conjecture that the computational adequacy result of Chapter 9 could also be proved assuming Properties (A1)–(A4) on page 207 and replacing the Strict Uniformity Property by the following (categorically more appealing) Uniformity Property:

A5′. [Uniformity] For every pair of symmetric Cpo-functors F and G, if

pK(σ)^{}˘p̆K pK(σ_{1})^{}˘ × … × pK(σ_{m})^{}˘ × pK(σ)^{}˘  F p̆K × … × p̆K × p̆K  G W × V  V ≅ α

then

pK(σ)^{}˘p̆K pK(σ_{1})^{}˘ × … × pK(σ_{m})^{}˘p̆K × … × p̆K W  ≅ α′  V F^{†} G^{†}

where α′_{X} : ι_{W X}^{G} → (V ι_{X}^{F}) ∘ α_{(X,F^{†}X)}. In fact, as we now show, we can go a long way towards a proof. First, we define the

non-standard interpretation of types: Definition 10.3.1 For ⊢ σ_{i} (1 ≤ i ≤ | Θ |),

⟨[Θ ⊢ τ]⟩(σ⃗) : pK(σ_{1})^{}˘ × … × pK(σ_{|Θ|})^{}˘ → pK(τ[Θ ↦ σ⃗])^{}˘ .

• ⟨[Θ ⊢ Θ_{i}]⟩(σ⃗) = Π_{i} (1 ≤ i ≤ | Θ |).

• For ⋆ ∈ {+, ×, ⇀ ⇀}, ⟨[Θ ⊢ τ_{1} ⋆ τ_{2}]⟩(σ⃗) = ⟨[⋆_{τ_{1}[Θ↦σ⃗],τ_{2}[Θ↦σ⃗]}]⟩˘˘ ∘ ⟨⟨[Θ ⊢ τ_{1}]⟩(σ⃗), ⟨[Θ ⊢ τ_{2}]⟩(σ⃗)⟩.

• ⟨[Θ ⊢ μT. τ]⟩(σ⃗) = ((𝕀_{μT. τ[Θ ↦ σ⃗]}^{op} × 𝕀_{μT. τ[Θ ↦ σ⃗]}) ∘ ⟨[Θ, T ⊢ τ]⟩(σ⃗, μT. τ[Θ ↦ σ⃗]))^{‡}. □ Second, we observe that, by construction, the non-standard interpretation of types

has the following properties: Proposition 10.3.2 ⟨[Θ ⊢ τ]⟩(σ⃗) is a symmetric Cpo-functor. □ Lemma 10.3.3 (Substitution Lemma) There exists a canonical natural isomorphism

β : ⟨[Θ ⊢ τ_{1}[T ↦ τ_{2}]]⟩(σ⃗) ≅ ⟨[Θ, T ⊢ τ_{1}]⟩(σ⃗, τ_{2}[Θ ↦ σ⃗]) ∘ ⟨Id, ⟨[Θ ⊢ τ_{2}]⟩(σ⃗)⟩

such that β_{X}^{§} = β_{X}^{−1} for every symmetric X. □

Then, writing ⟨[⊢ τ]⟩_{2} = (⟨⟨[τ]⟩⟩, ≪_{τ}), it follows that the family of relations {≪_{τ} ⊆ K(1, ⟨⟨[τ]⟩⟩) × Values(τ)} satisfies:

10. Summary and Further Research 228

≪_{σ⋆τ} = ≪_{σ} ⟨[⋆_{σ,τ}]⟩ ≪_{τ} (⋆ ∈ {+, ×, ⇀ ⇀})

and

E : ≪_{μT.τ} ≅ 𝕀 ≪_{τ[T ↦ μT.τ]}

where E is the unfolding induced by the non-standard interpretation.

Third, we relate the non-standard and standard interpretations of types and try to define the formal-approximation relations by transferring the above properties. Proposition 10.3.4 There exists a canonical natural isomorphism

pK(τ[Θ ↦ σ⃗])^{}˘p̆K pK(σ_{1})^{}˘ × … × pK(σ_{m})^{}˘p̆K × … × p̆K  ⟨[Θ ⊢ τ]⟩(σ⃗) [[Θ ⊢ τ]] ≅ κσ⃗ ; Θ⊢τ

such that κ_{X}^{§} = κ_{X}^{−1} for every symmetric X. □ Definition 10.3.5 For ⊢ τ, define ⪯_{τ} ⊆ K(1, [[⊢ τ]]_{2}) × Values(τ) by

x ⪯_{τ} v ⟺ κ_{2} ∘ x ≪_{τ} v. □

It follows that ⪯_{σ⋆τ} = ⪯_{σ} ⟨[⋆_{σ,τ}]⟩ ⪯_{τ} (⋆ ∈ {+, ×, ⇀ ⇀}) but, unfortunately,

E : ⪯_{μT.τ} ≅ 𝕀 ⪯_{τ[T ↦ μT.τ]}  (10.2)

is not easy to establish. To appreciate the problem observe that

x ⪯_{μT. τ} intro(v) ⟺ κ_{2} ∘ x ≪_{μT. τ} intro(v) ⟺ E ∘ κ_{2} ∘ x ≪_{τ[T ↦ μT. τ]} v and

E ∘ x ⪯_{τ[T ↦ μT. τ]} v ⟺ κ_{2} ∘ E ∘ x ≪_{τ[T ↦ μT. τ]} v.

Thus, to satisfy (10.2) we need

p̆K pK(μT. τ)^{}˘≅ E≅ κ 11  [[⊢ μT. τ]] ≅ E  p̆K [[⊢ τ[T ↦ μT. τ]]] pK(μT. τ)^{}˘≅ κ ⟨[⊢ μT. τ]⟩  =  11  ⟨[⊢ μT. τ]⟩ [[⊢ τ[T ↦ μT. τ]]] (𝕀^{op} × 𝕀)⟨[⊢ τ[T ↦ μT. τ]]⟩  .

We can even go further and note that, by the construction of κ, the above equality is implied by the following

≅ β

≅ β

1 1 1 1

⟨[⊢ τ[T ↦ μT. τ]]⟩ (⟨[T ⊢ τ]⟩(μT. τ))⟨[⊢ μT. τ]⟩

≅

κ_{⊢ τ[T ↦ μT. τ]} =

[[T ⊢ τ]][[⊢ μT.τ]] [[⊢ τ[T ↦ μT. τ]]]

(⟨[T ⊢ τ]⟩(μT. τ))⟨[⊢ μT. τ]⟩

κ_{⊢ μT.τ} • κ_{T ⊢ τ} ≅

[[⊢ τ[T ↦ μT. τ]]]

(10.3)

where κ_{⊢ μT. τ} • κ_{T ⊢ τ} is the composite

≅ κ_{⊢ μT. τ}  κ_{T ⊢ τ} ≅ pK(μT. τ)^{}˘p̆K [[⊢ μT.τ]] 11  pK(τ[T ↦ μT. τ])^{}˘p̆K [[T ⊢ τ]] ⟨[T ⊢ τ]⟩(μT. τ) ⟨[⊢ μT.τ]⟩  .

At this point, we generalise (10.3) obtaining:

Conjecture 10.3.6

≅ β

≅ β

≅

⟨[Θ ⊢ τ_{1}[T ↦ τ_{2}]]⟩(σ⃗)

κ_{Θ ⊢ τ_{1}[T ↦ τ_{2}]}
[[Θ ⊢ τ_{1}[T ↦ τ_{2}]]]

=

[[Θ, T ⊢ τ_{1}]] ∘ ⟨Id, [[Θ ⊢ τ_{2}]]⟩

≅
[[Θ ⊢ τ_{1}[T ↦ τ_{2}]]]

⟨[Θ, T ⊢ τ_{1}]⟩(σ⃗, τ_{2}[Θ ↦ σ⃗]) ∘ ⟨Id, ⟨[Θ ⊢ τ_{2}]⟩(σ⃗)⟩ ⟨[Θ, T ⊢ τ_{1}]⟩(σ⃗, τ_{2}[Θ ↦ σ⃗]) ∘ ⟨Id, ⟨[Θ ⊢ τ_{2}]⟩(σ⃗)⟩

(id_{W} , κ_{Θ⊢τ_{2}}) • κ_{Θ, T ⊢ τ_{1}}

where (id_{W} , κ_{Θ⊢τ_{2}}) • κ_{Θ, T ⊢ τ_{1}} is the composite

(id_{W} , κ_{Θ⊢τ_{2}}) ≅  κ_{Θ, T ⊢ τ_{1}} ≅  □ .

Attempting to prove the conjecture by induction on the derivation of τ_{1} is the natural step. It is possible to re-establish the induction hypothesis in the cases τ_{1} ≡ Θ_{i} and τ_{1} ≡ τ′ ⋆ τ′′ (⋆ ∈ {+, ×, ⇀ ⇀}). The last case, τ_{1} ≡ μT′. τ, involves such an unbearable number of canonical isomorphisms that we feel that a new technique is necessary.

The above problem is more general than it seems and concerns the relation between interpretations of FPC . A slightly simplified version of the general question behind it is:

Given a model of FPC and two interpretations I[[ ]] and J [[ ]] on it, there exists a canonical natural isomorphism i : I[[Θ ⊢ τ]] ≅ J [[Θ ⊢ τ]] : j, but are the interpretations of expressions essentially the same, in the sense that the equality

i_{2} ∘ I[[Θ, Γ ⊢ e : τ]] = J [[Θ, Γ ⊢ e : τ]] ∘ j_{2}  (10.4)

holds?

In the absence of recursive types (10.4) can be established with no difficulty, but the general case seems a delicate coherence problem.

Of course, another question that we expect to consider is the adequacy of K_{∗}-models of FPC (see Subsection 8.5.2). To this end, we plan to extend the relational properties of domains of [Pit93a] to K_{∗}-models and prove the existence of the formal approximation relations using the technique proposed therein.

10.4 Towards a Topos for Domain Theory

Our investigation has been mainly concerned with the identification of the categorical structure present in categories of domains. Of course, as we were aiming at axiomatic domain theory, we have favoured abstraction over concreteness. And, having done so, we have (perhaps surprisingly) gained insight into how to recover the naive view of domains as sets as intended in synthetic domain theory. Our main motivation for such a development is to find a systematic way tailored to the domains under consideration to obtain constructive set theories in which we can reason about types (domains) and programs (partial maps between domains). As a by-product, we expect that this model-theoretic approach will help in formalising program logics (e.g., in the spirit of LCF [Sco69] with partial elements [Sco79] and reasoning principles for recursive types [Pit93a]) that account for the computational phenomenon being modelled by the domains under consideration.

An investigation of the kind proposed here was advocated by Dana Scott in [Sco80]:

“The functor category is just a very first stage of the investigation: in topos theory the categories of sheaves result from putting a kind of modal operator into the logic, and making a reinterpretation of the logical connectives and quantifiers. The passage from S^{C^{op}} is one of finding c.c.c. as cartesian closed subcategories of the functor category. There are many of them and many still contain C as a cartesian closed subcategory. So, there is much to look for, and — I am sure — much left to be discovered of definite logical interest.”

After we proved Theorem 4.3.9, Gordon Plotkin envisaged the possibility of embedding a small category K (of a given Cpo-domain-structure (K, D) for which pK Cpo-enriches with respect to ⊏ ∼ ) in a sheaf topos. The idea is to exploit the fact that D is locally a cpo to specify chain-open covers:

Definition 10.4.1 (Plotkin) Let (K, D) be a domain structure. For every D ∈ | K |, let K_{chain-open}(D) be the set of all those countable chains {m_{k} : D_{k} ↣ D in D} such that ⨆ [m_{k}] in D(D) exists and equals [id_{D}]. □

Our terminology on sheaves is as in Sections III.2 and III.4 of [LM92] except for the following:

Definition 10.4.2 A basis for a (Grothendieck) topology on a category C is a function K which assigns to each object C a collection K(C) consisting of families of morphisms with codomain C such that

1. if f : C′ → C is an isomorphism then {f : C′ → C} ∈ K(C);

2. if {f_{i} : C_{i} → C | i ∈ I} ∈ K(C) then, for every g : Z → C in C and i ∈ I, the

diagram Z ⟶^{g} C ⟵^{f_{i}} C_{i} has pullback and {g^{∗}f_{i} → Z | i ∈ I} ∈ K(Z);

3. if {f_{i} : C_{i} → C | i ∈ I} ∈ K(C) and, for every i ∈ I, {g_{ij} : Z_{ij} → C_{i} | j ∈ I_{i}} ∈ K(C_{i}) then {f_{i} ∘ g_{ij} : Z_{ij} → C | i ∈ I, j ∈ I_{i}} ∈ K(C). □

We would like K_{chain-open} to be a basis for a subcanonical topology on K. The next two propositions determine when this is possible. In particular, Proposition 10.4.4 exhibits the essence of uniform domain structures.

Proposition 10.4.3 K_{chain-open} is a basis for a topology on K if and only if pulling-back admissible monos along total maps is a continuous operation. □

Proposition 10.4.4 Assume that K_{chain-open} is a basis for a topology on K, and let J_{chain-open} be the topology generated by K_{chain-open}. Then, the following statements are equivalent

1. J_{chain-open} is subcanonical.

2. (K, D) is uniform (Definition 4.3.5).

3. The representable presheaves pK^{op} → Set satisfy the sheaf condition with respect to every cover in K_{chain-open}. □

Then, when (K, D) is a uniform Cpo-domain-structure such that pK Cpo-enriches with respect to ⊏ ∼ we have that K_{chain-open} is a basis for a subcanonical topology. Thus, every small K embeds, by Yoneda, into the (Grothendieck) topos Sh(K, J_{chain-open}). For one example, take K to be SFP (the category of bifinite domains and continuous functions) and D(D) to be the collection of Scott-open subsets of D.

One can even imagine to tighten the above toposes so that the structure of domaintheoretic models of FPC is preserved by the Yoneda embedding. The preservation of partial cartesian closure is immediate whilst to preserve binary coproducts we plan to consider the sheaf topos whose topology is determined by both chain-open and binarycoproduct covers (Definition 10.4.5).

Definition 10.4.5 Let (K, D) be a domain structure. For every object D ∈ | K |, let

K_{+}(D) = {f, g ∈ K | A ⟶^{f} D ⟵^{g} B is a coproduct in pK}. □

The appropriateness of these toposes as a constructive set theory for domain theory is under investigation; results in this direction will be reported elsewhere.

10.5 Reasoning about Recursive Types

In a series of papers, Pitts [Pit92,Pit93b,Pit93a] has studied proof principles for reasoning about recursively defined domains derived from the initiality/finality property given by the compactness axiom. In particular, [Pit93a] establishes a mixed induction/coinduction property of abstract relations on recursive domains in Cppo_{⊥}, shows how it specialises to well-known principles, and presents various applications. This work is carried over in Cppo_{⊥} (≅ pCpo) but we believe it generalises to the axiomatic K_{∗}-models of Section 8.5. Such an investigation is left as future work.

A coinduction principle available for our domain-theoretic models can be found in [Fio93a] (see also [RT93,Rut93]). There, ordered categorical bisimulations are defined, and from a strong-extensionality theorem stating that the inequality relation on the final coalgebra of a Cpo-endofunctor is maximal among all bisimulations, the following proof principle is derived:

For a Cpo-endofunctor, if R is an ordered categorical bisimulation on the final coalgebra U, and u and u′ are elements of U for which u R u′, then u ≤ u′.

The relation between the above two approaches is still unclear.

10.6 Non-determinism

In our study of partiality, the lifting monad arose when discussing the representability of partial maps. Non-determinism seems to arise in the same way (intuitively because partiality is a restricted form of non-determinism —viz., when at most one output is possible). We plan to study whether this can be stated precisely and, if so, we will try to transfer our approach to that setting. We expect that there will be things to adjust but hope that our abstract categorical setting is modular enough to allow the reusability of part of the theory developed.

Another possible way to incorporate non-determinism in our abstract setting is by emphasising the view of admissible monos as observable properties (in the vein of [Abr87] and [Rob87]). For example, consider domain structures (K, D) for which

1. K has binary products, and

2. the mapping D determines a binary-product preserving functor K → Loc where Loc is the category of locales.

Generalising from the characterisation of maximal units for the lifting monad (see Definition 4.5.5, Proposition 4.5.6 and the discussion after it), we could describe the powerdomain of an object by modal operators (see [Rob87]) on its locale of admissible monos. Then, an abstract powerdomain construction, internalising the powerdomain construction on locales, might be given by the data:

PD 1. a monad (P, η, μ) : K → K,

PD 2. a natural transformation ⊔ : × ∘ ⟨P, P ⟩ \underrightarrow{.} P making P a semilattice, and

PD 3. natural transformations □^{P} , ♢^{P} : DP \underrightarrow{.} DP subject to the conditions:

PC 1. that, for every A ∈ | K |, (D(P A), □_{A}^{P}, ♢_{A}^{P}) is a powerlocale,

PC 2. that, writing (V L, □_{L}^{V}, ♢_{L}^{V}) for the free powerlocale on a locale L, the unique natural transformation ι : (V D(A), □_{DA}^{V}, ♢_{DA}^{V}) \underrightarrow{.} (D(P A), □_{A}^{P}, ♢_{A}^{P}) making the following diagram commute

V D { } D  ι Dη  DP

is an isomorphism,

PC 3. that Dμ = (DP P ≅ V V D \underrightarrow{⋃} V D ≅ DP), and

PC 4. that D⊔ = (D(P × P) ≅ DP × DP ≅ V D × V D ⟶^{∪} V D ≅ DP).

Remark. Note that, by (PD 3) and (PC 1), the mapping A ↦ (D(P A), □_{A}^{P}, ♢_{A}^{P}) determines a functor K → PowerLoc where PowerLoc denotes the category of powerlocales.

This approach might provide connections with axiomatic semantics and program logics [Abr87,Rob87,Zha91] and open the possibility of establishing adequacy results by means of methods based on formal neighbourhoods [ML83,Abr90].

10.7 Polymorphism

We have not treated polymorphic languages. It would be interesting to axiomatise domain-theoretic models of polymorphism [CGW89] and see whether the representationindependence and adequacy results (Theorems 8.6.6 and 9.2.19) can be extended to that setting.

A Lemma 8.4.4

A substitution lemma for types in FPC is proved. As usual, permutation and contraction lemmas are needed and thus these are also proved.

Remark. The proofs do intensive and implicit use of Theorem 6.4.4 and Propositions 6.4.5 and 6.4.6.

Lemma A.0.1 (Permutation Lemma) Let | Θ | = m and | Θ′ | = m′. There exists a canonical natural isomorphism

σ : [[Θ, T, T′, Θ′ ⊢ τ]] ≅ [[Θ, T′, T, Θ′ ⊢ τ]] ∘ ⟨Π_{1}, …, Π_{m}, Π_{m+2}, Π_{m+1}, Π_{m+3}, …, Π_{m+m′+2}⟩

such that σ_{A}^{§} = σ_{A}^{−1} for every A = A^{§}.

Proof: By induction on the derivation of τ.

Write Π for ⟨Π_{1}, …, Π_{m}, Π_{m+2}, Π_{m+1}, Π_{m+3}, …, Π_{m+m′+2}⟩.

• τ ≡ Θ_{i} (1 ≤ i ≤ m):

[[Θ, T, T′, Θ′ ⊢ Θ_{i}]] = Π_{i} = Π_{i} ∘ Π = [[Θ, T′, T, Θ′ ⊢ Θ_{i}]] ∘ Π.

• τ ≡ T:

[[Θ, T, T′, Θ′ ⊢ Θ_{i}]] = Π_{m+1} = Π_{m+2} ∘ Π = [[Θ, T′, T, Θ′ ⊢ Θ_{i}]] ∘ Π.

• τ ≡ T′:

[[Θ, T, T′, Θ′ ⊢ Θ_{i}]] = Π_{m+2} = Π_{m+1} ∘ Π = [[Θ, T′, T, Θ′ ⊢ Θ_{i}]] ∘ Π.

• τ ≡ Θ′_{i} (1 ≤ i ≤ m′):

[[Θ, T, T′, Θ′ ⊢ Θ_{i}]] = Π_{i+m+2} = Π_{i+m+2} ∘ Π = [[Θ, T′, T, Θ′ ⊢ Θ_{i}]] ∘ Π.

A. Lemma 8.4.4 237

• τ ≡ τ_{1} ⋆ τ_{2} where ⋆ ∈ {+, ×, ⇀ ⇀}:

[[Θ, T, T′, Θ′ ⊢ τ_{1} ⋆ τ_{2}]] = [[⋆]]˘˘ ∘ ⟨[[Θ, T, T′, Θ′ ⊢ τ_{1}]], [[Θ, T, T′, Θ′ ⊢ τ_{2}]]⟩
≅ [[⋆]]˘˘ ∘ ⟨[[Θ, T′, T, Θ′ ⊢ τ_{1}]] ∘ Π, [[Θ, T′, T, Θ′ ⊢ τ_{2}]] ∘ Π⟩
= [[⋆]]˘˘ ∘ ⟨[[Θ, T′, T, Θ′ ⊢ τ_{1}]], [[Θ, T′, T, Θ′ ⊢ τ_{2}]]⟩ ∘ Π
= [[Θ, T′, T, Θ′ ⊢ τ_{1} ⋆ τ_{2}]] ∘ Π.

• τ ≡ μT′′.τ′:

[[Θ, T, T′, Θ′ ⊢ μT′′.τ′]] = [[Θ, T, T′, Θ′, T′′ ⊢ τ′]]^{‡}
≅ ([[Θ, T′, T, Θ′, T′′ ⊢ τ′]] ∘ (Π × Id))^{‡}
≅ [[Θ, T′, T, Θ′, T′′ ⊢ τ′]]^{‡} ∘ Π
= [[Θ, T′, T, Θ′ ⊢ μT′′.τ′]] ∘ Π.  □

Lemma A.0.2 (Contraction Lemma) Let | Θ | = m and | Θ′ | = m′. There exists a canonical natural isomorphism

γ : [[Θ, T, Θ′ ⊢ τ]] ≅ [[Θ, Θ′ ⊢ τ]] ∘ ⟨Π_{1}, …, Π_{m}, Π_{m+2}, …, Π_{m+m′+1}⟩

such that γ_{A}^{§} = γ_{A}^{−1} for every A = A^{§}. Proof: By induction on the derivation of τ.

Write Π for ⟨Π_{1}, …, Π_{m}, Π_{m+2}, …, Π_{m+m′+1}⟩

• τ ≡ Θ_{i} (1 ≤ i ≤ m):

[[Θ, T, Θ′ ⊢ Θ_{i}]] = Π_{i} = Π_{i} ∘ Π = [[Θ, Θ′ ⊢ Θ_{i}]] ∘ Π.

• τ ≡ Θ′_{i} (1 ≤ i ≤ m′):

[[Θ, T, Θ′ ⊢ Θ′_{i}]] = Π_{i+m+1} = Π_{i+m} ∘ Π = [[Θ, Θ′ ⊢ Θ′_{i}]] ∘ Π.

• τ ≡ τ_{1} ⋆ τ_{2} where ⋆ ∈ {+, ×, ⇀ ⇀}:

[[Θ, T, Θ′ ⊢ τ_{1} ⋆ τ_{2}]] = [[⋆]]˘˘ ∘ ⟨[[Θ, T, Θ′ ⊢ τ_{1}]], [[Θ, T, Θ′ ⊢ τ_{2}]]⟩
≅ [[⋆]]˘˘ ∘ ⟨[[Θ, Θ′ ⊢ τ_{1}]] ∘ Π, [[Θ, Θ′ ⊢ τ_{2}]] ∘ Π⟩
= [[⋆]]˘˘ ∘ ⟨[[Θ, Θ′ ⊢ τ_{1}]], [[Θ, Θ′ ⊢ τ_{2}]]⟩ ∘ Π
= [[Θ, Θ′ ⊢ τ_{1} ⋆ τ_{2}]] ∘ Π.

A. Lemma 8.4.4 238

• τ ≡ μT′.τ′:

[[Θ, T, Θ′ ⊢ μT′.τ′]] = [[Θ, T, Θ′, T′ ⊢ τ′]]^{‡}
≅ ([[Θ, Θ′, T′ ⊢ τ′]] ∘ (Π × Id))^{‡}
≅ [[Θ, Θ′, T′ ⊢ τ′]]^{‡} ∘ Π
= [[Θ, Θ′ ⊢ μT′.τ′]] ∘ Π.  □

Lemma 8.4.4 (Substitution Lemma) There exists a canonical natural isomorphism

β : [[Θ ⊢ τ_{1}[T ↦ τ_{2}]]] ≅ [[Θ, T ⊢ τ_{1}]] ∘ ⟨Id, [[Θ ⊢ τ_{2}]]⟩

such that β_{A}^{§} = β_{A}^{−1} for every A = A^{§}. Proof: By induction on the derivation of τ_{1}.

Write m for | Θ |.

• τ_{1} ≡ Θ_{i} (1 ≤ i ≤ m):

[[Θ ⊢ Θ_{i}[T ↦ τ_{2}]]] = [[Θ ⊢ Θ_{i}]] = Π_{i} = Π_{i} ∘ ⟨Π_{1}, …, Π_{m}, [[Θ ⊢ τ_{2}]]⟩
= [[Θ, T ⊢ Θ_{i}]] ∘ ⟨Id, [[Θ ⊢ τ_{2}]]⟩.

• τ ≡ T:

[[Θ ⊢ T[T ↦ τ_{2}]]] = [[Θ ⊢ τ_{2}]] = Π_{m+1} ∘ ⟨Id, [[Θ ⊢ τ_{2}]]⟩ = [[Θ, T ⊢ T]] ∘ ⟨Id, [[Θ ⊢ τ_{2}]]⟩.

• τ_{1} ≡ τ ⋆ τ′ where ⋆ ∈ {+, ×, ⇀ ⇀}:

[[Θ ⊢ (τ ⋆ τ′)[T ↦ τ_{2}]]]

= [[Θ ⊢ τ[T ↦ τ_{2}] ⋆ τ′[T ↦ τ_{2}]]]
= [[⋆]]˘˘ ∘ ⟨[[Θ ⊢ τ[T ↦ τ_{2}]]], [[Θ ⊢ τ′[T ↦ τ_{2}]]]⟩
≅ [[⋆]]˘˘ ∘ ⟨[[Θ, T ⊢ τ]] ∘ ⟨Id, [[Θ, ⊢ τ_{2}]]⟩, [[Θ, T ⊢ τ′]] ∘ ⟨Id, [[Θ, ⊢ τ_{2}]]⟩⟩
= [[⋆]]˘˘ ∘ ⟨[[Θ, T ⊢ τ]], [[Θ, T ⊢ τ′]]⟩ ∘ ⟨Id, [[Θ, ⊢ τ_{2}]]⟩
= [[Θ, T ⊢ τ ⋆ τ′]] ∘ ⟨Id, [[Θ, ⊢ τ_{2}]]⟩.

A. Lemma 8.4.4 239

• τ_{1} ≡ μT′.τ:

[[Θ ⊢ (μT′.τ)[T ↦ τ_{2}]]] = [[Θ ⊢ μT′.τ[T ↦ τ_{2}]]]
= [[Θ, T′ ⊢ τ[T ↦ τ_{2}]]]^{‡}
≅ ([[Θ, T′, T ⊢ τ]] ∘ ⟨Id, [[Θ, T′ ⊢ τ_{2}]]⟩)^{‡}

[[Θ, T′, T ⊢ τ]] ∘ ⟨Id, [[Θ, T′ ⊢ τ_{2}]]⟩

≅ [[Θ, T, T′ ⊢ τ]] ∘ ⟨Π_{1}, …, Π_{m}, Π_{m+2}, Π_{m+1}⟩ ∘ ⟨Id, [[Θ, T′ ⊢ τ_{2}]]⟩
= [[Θ, T, T′ ⊢ τ]] ∘ ⟨Id, [[Θ, T′ ⊢ τ_{2}]], Π_{m+1}⟩
≅ [[Θ, T, T′ ⊢ τ]] ∘ ⟨Id, [[Θ ⊢ τ_{2}]] ∘ ⟨Π_{1}, …, Π_{m}⟩, Π_{m+1}⟩
= [[Θ, T, T′ ⊢ τ]] ∘ (⟨Id, [[Θ ⊢ τ_{2}]]⟩ × Id)
[[Θ ⊢ (μT′.τ)[T ↦ τ_{2}]]] ≅ [[Θ, T, T′ ⊢ τ]]^{‡} ∘ ⟨Id, [[Θ ⊢ τ_{2}]]⟩
= [[Θ, T ⊢ μT′.τ]] ∘ ⟨Id, [[Θ ⊢ τ_{2}]]⟩.  □

B Theorem 8.6.6

Theorem 8.6.6 (Poset-Models are Parametric w.r.t. Representations)

[[Θ, Γ ⊢ e : τ]] : [[Θ ⊢ Γ]]_{R} \underrightarrow{.}_{≤}[[Θ ⊢ τ]]_{R} : pK_{R}^{| Θ |} → pK.

Proof: By induction on the derivation of Θ, Γ ⊢ e : τ.

• Θ, Γ ⊢ Γ_{i} where Γ ≡ x_{1} : τ_{1}, …, x_{n} : τ_{n}:

Π_{i} ∘ [[Θ ⊢ Γ]]_{R}(v)

= Π_{i} ∘ ([[Θ ⊢ τ_{1}]]_{R}(v) ⊗ … ⊗ [[Θ ⊢ τ_{n}]]_{R}(v))
⊏ ∼ [[Θ ⊢ τ_{i}]]_{R}(v) ∘ Π_{i}  , by Proposition 5.1.1 (2).

• Θ, Γ ⊢ inl(e) : τ_{1} + τ_{2}:

By induction,

[[Θ ⊢ Γ]]_{R}(v) [[Θ ⊢ Γ]]_{R}(B) [[Θ ⊢ Γ]]_{R}(A) [[Θ, Γ ⊢ e : τ_{1}]]_{A} [[Θ ⊢ τ_{1}]]_{R}(A) [[Θ ⊢ τ_{1}]]_{R}(B) [[Θ ⊢ τ_{1}]]_{R}(v) [[Θ, Γ ⊢ e : τ^{1}]]^{B} ⊏ ∼  .

Also,

⨿_{1}  [[Θ ⊢ τ_{1}]]_{R}(A) + [[Θ ⊢ τ_{2}]]_{R}(A) = [[Θ ⊢ τ_{1} + τ_{2}]]_{R}(A) ⨿_{1} [[Θ ⊢ τ_{1}]]_{R}(A) [[Θ ⊢ τ_{1}]]_{R}(v)  [[Θ ⊢ τ_{1}]]_{R}(v) + [[Θ ⊢ τ_{2}]]_{R}(v) = [[Θ ⊢ τ_{1} + τ_{2}]]_{R}(v) [[Θ ⊢ τ_{1}]]_{R}(B)  = [[Θ ⊢ τ_{1} + τ_{2}]]_{R}(B) [[Θ ⊢ τ_{1}]]_{R}(B) + [[Θ ⊢ τ_{2}]]_{R}(B)  .

Then, gluing the above two diagrams it follows that [[Θ, Γ ⊢ inl(e) : τ_{1}+τ_{2}]] satisfies the corresponding diagram.

• Θ, Γ ⊢ inr(e) : τ_{1} + τ_{2}: analogous to the previous case.

• Θ, Γ ⊢ case e of inl(x_{1}).e_{1} or inr(x_{2}).e_{2} : τ: Let G = [[Θ ⊢ Γ]]_{R}, T = [[Θ ⊢ τ]]_{R}, and T^{(i)} = [[Θ ⊢ τ_{i}]]_{R} (i = 1, 2). By induction,

G(A) G(B) G(v)  T^{(1)}(A) + T^{(2)}(A) T^{(1)}(B) + T^{(2)}(B) T^{(1)}(v) + T^{(2)}(v) ⊏ ∼ a = [[Θ, Γ ⊢ e : τ_{1} + τ_{2}]]_{A} b = [[Θ, Γ ⊢ e : τ_{1} + τ_{2}]]_{B}

and, for i = 1, 2,

T (A) T (B) T (v) G(B) + T^{(i)}(B) G(v) + T^{(i)}(v) G(A) + T^{(i)}(A) b_{i} = [[Θ, Γ ⊢ e_{i} : τ_{i}]]_{B} a_{i} = [[Θ, Γ ⊢ e_{i} : τ_{i}]]_{A} ⊏ ∼  .

Then,

(G(v) ⊗ T^{(1)}(v)) + (G(v) ⊗ T^{(2)}(v)) δ_{A} ≅  δ_{B} ≅ ⟨⟨id, a⟩⟩  ⟨⟨id, b⟩⟩ G(v) G(v) ⊗ (T^{(1)}(v) + T^{(2)}(v)) ⊐ ∼ T (v) ⊐ ∼ [a_{1}, a_{2}]                                       [b_{1}, b_{2}]

because

⟨⟨id, b⟩⟩ ∘ G(v)

= ⟨⟨G(v), b ∘ G(v)⟩⟩  , by Proposition 5.1.1 (5)
⊏ ∼ ⟨⟨G(v), (T^{(1)}(v) + T^{(2)}(v)) ∘ a⟩⟩  , as ⟨⟨ , ⟩⟩ is monotone
= (G(v) ⊗ (T^{(1)}(v) + T^{(2)}(v))) ∘ ⟨⟨id, a⟩⟩

and [b_{1}, b_{2}] ∘ ((G(v) ⊗ T^{(1)}(v)) + (G(v) ⊗ T^{(2)}(v)))

= [b_{1} ∘ (G(v) + T^{(1)}(v)), b_{2} ∘ (G(v) + T^{(2)}(v))]

⊏ ∼ [T (v) ∘ a_{1}, T (v) ∘ a_{2}]  , as [ , ] is monotone

= T (v) ∘ [a_{1}, a_{2}].

• Θ, Γ ⊢ fst(e) : τ_{1}:

By induction,

[[Θ ⊢ Γ]]_{R}(v) [[Θ ⊢ Γ]]_{R}(A) [[Θ ⊢ Γ]]_{R}(B) [[Θ, Γ ⊢ e : τ_{1} × τ_{2}]]_{A} ⊏ ∼ [[Θ, Γ ⊢ e : τ_{1} × τ_{2}]]_{B} [[Θ ⊢ τ_{1} × τ_{2}]]_{R}(A) [[Θ ⊢ τ_{1} × τ_{2}]]_{R}(v) [[Θ ⊢ τ_{1} × τ_{2}]]_{R}(B)  .

Also,

[[Θ ⊢ τ_{1} × τ_{2}]]_{R}(A)  π_{1}  [[Θ ⊢ τ_{1}]]_{R}(A) [[Θ ⊢ τ_{1} × τ_{2}]]_{R}(B) [[Θ ⊢ τ_{1} × τ_{2}]]_{R}(v)  ⊏ ∼ π_{1}  [[Θ ⊢ τ_{1}]]_{R}(B) [[Θ ⊢ τ_{1}]]_{R}(v)

because

π_{1} ∘ [[Θ ⊢ τ_{1} × τ_{2}]]_{R}(v)

= π_{1} ∘ ([[Θ ⊢ τ_{1}]]_{R}(v) ⊗ [[Θ ⊢ τ_{2}]]_{R}(v))

⊏ ∼ [[Θ ⊢ τ_{1}]]_{R}(v) ∘ π_{1}  , by Proposition 5.1.1 (2).

Gluing the above two diagrams it follows that [[Θ, Γ ⊢ fst(e) : τ_{1}]] satisfies the corresponding diagram.

• Θ, Γ ⊢ snd(e) : τ_{2}: analogous to the previous case.

• Θ, Γ ⊢ ⟨e_{1}, e_{2}⟩ : τ_{1} × τ_{2}: By induction, for i = 1, 2,

[[Θ ⊢ Γ]]_{R}(A) [[Θ ⊢ Γ]]_{R}(v) [[Θ ⊢ Γ]]_{R}(B) a_{i} = [[Θ, Γ ⊢ e_{i} : τ_{i}]]_{A} [[Θ ⊢ τ_{i}]]_{R}(A) [[Θ ⊢ τ_{i}]]_{R}(v) ⊏ ∼  [[Θ ⊢ τ_{i}]]_{R}(B) b^{i} = [[Θ, Γ ⊢ e^{i} : τ^{i}]]^{B}  .

Then, [[Θ, Γ ⊢ ⟨e_{1}, e_{2}⟩ : τ_{1} × τ_{2}]]_{B} ∘ [[Θ ⊢ Γ]]_{R}(v)

= ⟨⟨b_{1}, b_{2}⟩⟩ ∘ [[Θ ⊢ Γ]]_{R}(v) = ⟨⟨b_{1} ∘ [[Θ ⊢ Γ]]_{R}(v), b_{2} ∘ [[Θ ⊢ Γ]]_{R}(v)⟩⟩

⊏ ∼ ⟨⟨[[Θ ⊢ τ_{1}]]_{R}(v) ∘ a_{1}, [[Θ ⊢ τ_{2}]]_{R}(v) ∘ a_{2}⟩⟩  , as ⟨⟨ , ⟩⟩ is monotone

= ([[Θ ⊢ τ_{1}]]_{R}(v) ⊗ [[Θ ⊢ τ_{2}]]_{R}(v)) ∘ ⟨⟨a_{1}, a_{2}⟩⟩ = [[Θ ⊢ τ_{1} × τ_{2}]]_{R}(v) ∘ [[Θ, Γ ⊢ ⟨e_{1}, e_{2}⟩ : τ_{1} × τ_{2}]]_{A}.

• Θ, Γ ⊢ λx.e : τ_{1} ⇀ τ_{2}: Let G = [[Θ ⊢ Γ]]_{R}, T = [[Θ ⊢ τ_{1}⇀ ⇀τ_{2}]], and T^{(i)} = [[Θ ⊢ τ_{i}]] (i = 1, 2). By induction,

a = [[Θ, ⟨Γ, x : τ_{1}⟩ ⊢ e : τ_{2}]]_{A} G(A) ⊗ T_{R}^{(1)}(A)  T_{R}^{(2)}(A) G(v) ⊗ T_{R}^{(1)}(v) G(B) ⊗ T_{R}^{(1)}(B)  T_{R}^{(2)}(v) ⊏ ∼  T_{R}^{(2)}(B) b = [[Θ, ⟨Γ, x : τ_{1}⟩ ⊢ e : τ_{2}]]_{B}  .

Then, by Proposition 5.2.2 (3), and the calculation

(T_{R}^{(1)}(v))^{L} = T_{2}^{(1)}(((v_{1}^{L}, v_{1}), …, (v_{m}^{L}, v_{m}))^{L}) , because T_{2}^{(1)} is a Poset-functor
= T_{2}^{(1)}((v_{1}, v_{1}^{L}), …, (v_{m}, v_{m}^{L}))
= T_{1}^{(1)}((v_{1}^{L}, v_{1}), …, (v_{m}^{L}, v_{m}))  , because T^{(1)} is symmetric
= T_{1}^{(1)}(v)

it follows that

G(A) G(v) G(B)  ⊏ ∼  T_{R}^{(1)}(B)⇀ ⇀T_{R}^{(2)}(B) T_{R}^{(1)}(A)⇀ ⇀T_{R}^{(2)}(A) (T_{R}^{(1)}(v))^{L}⇀ ⇀T_{R}^{(2)}(v) = T_{1}^{(1)}(v)⇀ ⇀T_{2}^{(2)}(v) = T_{R}(v) pλ(a) pλ(b)  .

• Θ, Γ ⊢ e(e_{1}) : τ_{2}: Let G = [[Θ ⊢ Γ]]_{R}, T = [[Θ ⊢ τ_{1}⇀ ⇀τ_{2}]]_{R}, and T^{(i)} = [[Θ ⊢ τ_{i}]]_{R} (i = 1, 2). By induction,

G(A)  T (A) a = [[Θ, Γ ⊢ e : τ_{1}⇀ ⇀τ_{2}]]_{A} ⊏ ∼ G(B)  T (B) G(v)  T (v) = (T^{(1)}(v))^{L}⇀ ⇀T^{(2)}(v) b = [[Θ, Γ ⊢ e : τ_{1}⇀ ⇀τ_{2}]]_{B}

and

T^{(1)}(A) T^{(1)}(B) T^{(1)}(v) G(A) a_{1} = [[Θ, Γ ⊢ e_{1}]]_{A} G(B) b_{1} = [[Θ, Γ ⊢ e_{1}]]_{B} G(v)  ⊏ ∼  .

Then, by Proposition 5.1.1 (5) and the monotonicity of ⟨⟨ , ⟩⟩,

G(A) ⟨⟨a, a_{1}⟩⟩ (T^{(1)}(A)⇀ ⇀T^{(2)}(A)) ⊗ T^{(1)}(A) G(v) G(B)  ((T^{(1)}(v))^{L}⇀ ⇀T^{(2)}(v)) ⊗ T^{(1)}(v) (T^{(1)}(B)⇀ ⇀T^{(2)}(B)) ⊗ T^{(1)}(B) ⟨⟨b, b^{1}⟩⟩ ⊏ ∼  .

Finally, by Proposition 5.2.2 (2), [[Θ, Γ ⊢ e(e_{1}) : τ_{2}]] satisfies the corresponding diagram.

• Θ, Γ ⊢ intro(e) : μT.τ:

By induction,

[[Θ, Γ ⊢ e : τ[T ↦ μT.τ]]]_{A} [[Θ ⊢ Γ]]_{R}(A)  ⊏ ∼ [[Θ, Γ ⊢ e : τ[T ↦ μT.τ]]]_{B} [[Θ ⊢ Γ]]_{R}(v) [[Θ ⊢ Γ]]_{R}(B)  [[Θ ⊢ τ[T ↦ μT.τ]]]_{R}(A) [[Θ ⊢ τ[T ↦ μT.τ]]]_{R}(B) [[Θ ⊢ τ[T ↦ μT.τ]]]_{R}(v) .

And since, by naturality,

[[Θ ⊢ τ[T ↦ μT.τ]]]_{R}(A)  [[Θ ⊢ μT.τ]]_{R}(A) I_{A} [[Θ ⊢ τ[T ↦ μT.τ]]]_{R}(v)  [[Θ ⊢ μT.τ]]_{R}(v) [[Θ ⊢ τ[T ↦ μT.τ]]]_{R}(B)  [[Θ ⊢ μT.τ]]_{R}(B) I_{B} ≅ ≅

it follows that [[Θ, Γ ⊢ intro(e) : μT.τ]] satisfies the corresponding diagram.

• Θ, Γ ⊢ elim(e) : τ[T ↦ μT.τ]: analogous to the previous case. □

C Lemma 9.1.3

We prove that the interpretation of expressions is preserved under evaluation. To do this, a substitution lemma (together with permutation and contraction lemmas) for expressions is needed and thus these are also proved.

Lemma C.0.1 (Permutation Lemma) In any model of FPC,

[[Θ, ⟨Γ, x : τ, x′ : τ′, Γ′⟩ ⊢ e : τ′′]]

= [[Θ, ⟨Γ, x′ : τ′, x : τ, Γ′⟩ ⊢ e : τ′′]] ∘ ⟨⟨π_{1}, …, π_{n}, π_{n+2}, π_{n+1}, π_{n+3}, …, π_{n+n′+2}⟩⟩

where | Γ | = n and | Γ′ | = n′.

Proof: By induction on the structure of e.

Write π for ⟨⟨π_{1}, …, π_{n}, π_{n+2}, π_{n+1}, π_{n+3}, …, π_{n+n′+2}⟩⟩.

• e ≡ x_{i} (1 ≤ i ≤ n):

[[Θ, ⟨Γ, x : τ, x′ : τ′, Γ′⟩ ⊢ x_{i} : τ_{i}]] = π_{i} = π_{i} ∘ π
= [[Θ, ⟨Γ, x′ : τ′, x : τ, Γ′⟩ ⊢ x_{i} : τ_{i}]] ∘ π.

• e ≡ x:

[[Θ, ⟨Γ, x : τ, x′ : τ′, Γ′⟩ ⊢ x : τ]] = π_{n+1} = π_{n+2} ∘ π
= [[Θ, ⟨Γ, x′ : τ′, x : τ, Γ′⟩ ⊢ x : τ]] ∘ π.

• e ≡ x′:

[[Θ, ⟨Γ, x : τ, x′ : τ′, Γ′⟩ ⊢ x′ : τ′]] = π_{n+2} = π_{n+1} ∘ π
= [[Θ, ⟨Γ, x′ : τ′, x : τ, Γ′⟩ ⊢ x′ : τ′]] ∘ π.

C. Lemma 9.1.3 249

• e ≡ x′_{i} (1 ≤ i ≤ n′):

[[Θ, ⟨Γ, x : τ, x′ : τ′, Γ′⟩ ⊢ x′_{i} : τ′_{i}]] = π_{n+i+2} = π_{n+i+2} ∘ π
= [[Θ, ⟨Γ, x′ : τ′, x : τ, Γ′⟩ ⊢ x′_{i} : τ′_{i}]] ∘ π.

• e ≡ inl(e_{1}):

[[Θ, ⟨Γ, x : τ, x′ : τ′, Γ′⟩ ⊢ inl(e_{1}) : τ_{1} + τ_{2}]]

= ⨿_{1} ∘ [[Θ, ⟨Γ, x : τ, x′ : τ′, Γ′⟩ ⊢ e_{1} : τ_{1}]]
= ⨿_{1} ∘ [[Θ, ⟨Γ, x′ : τ′, x : τ, Γ′⟩ ⊢ e_{1} : τ_{1}]] ∘ π
= [[Θ, ⟨Γ, x′ : τ′, x : τ, Γ′⟩ ⊢ inl(e_{1}) : τ_{1} + τ_{2}]] ∘ π.

• e ≡ inr(e_{2}): analogous to the previous case.

• e ≡ case e_{0} of inl(x_{1}).e_{1} or inr(x_{2}).e_{2}: [[Θ, ⟨Γ, x : τ, x′ : τ′, Γ′⟩ ⊢ case e_{0} of inl(x_{1}).e_{1} or inr(x_{2}).e_{2} : τ′′]]

= [[[Θ, ⟨Γ, x : τ, x′ : τ′, Γ′, x_{1} : τ_{1}⟩ ⊢ e_{1} : τ′′]], [[Θ, ⟨Γ, x : τ, x′ : τ′, Γ′, x_{2} : τ_{2}⟩ ⊢ e_{2} : τ′′]]]
∘ δ ∘ ⟨⟨id, [[Θ, ⟨Γ, x : τ, x′ : τ′, Γ′⟩ ⊢ e_{0} : τ_{1} + τ_{2}]]⟩⟩
= [u_{1} ∘ (π ⊗ id_{[[τ_{1}]]}), u_{2} ∘ (π ⊗ id_{[[τ_{2}]]})] ∘ δ ∘ ⟨⟨id, u_{0} ∘ π⟩⟩
, writing u_{0} for [[Θ, ⟨Γ, x′ : τ′, x : τ, Γ′⟩ ⊢ e_{0} : τ_{1} + τ_{2}]] and

u_{i} (i = 1, 2) for [[Θ, ⟨Γ, x′ : τ′, x : τ, Γ′, x_{i} : τ_{i}⟩ ⊢ e_{i} : τ′′]]

= [u_{1}, u_{2}] ∘ ((π ⊗ id_{[[τ_{1}]]}) + (π ⊗ id_{[[τ_{2}]]})) ∘ δ ∘ ⟨⟨id, u_{0} ∘ π⟩⟩
= [u_{1}, u_{2}] ∘ δ ∘ (π ⊗ id_{[[τ_{1}]]+[[τ_{2}]]}) ∘ ⟨⟨id, u_{0} ∘ π⟩⟩

, by naturality of δ

= [u_{1}, u_{2}] ∘ δ ∘ ⟨⟨π, u_{0} ∘ π⟩⟩
= [u_{1}, u_{2}] ∘ δ ∘ ⟨⟨id, u_{0}⟩⟩ ∘ π
= [[Θ, ⟨Γ, x′ : τ′, x : τ, Γ′⟩ ⊢ case e_{0} of inl(x_{1}).e_{1} or inr(x_{2}).e_{2} : τ′′]] ∘ π.

C. Lemma 9.1.3 250 • e ≡ ⟨e_{1}, e_{2}⟩: [[Θ, ⟨Γ, x : τ, x′ : τ′, Γ′⟩ ⊢ ⟨e_{1}, e_{2}⟩ : τ_{1} × τ_{2}]]

= ⟨⟨[[Θ, ⟨Γ, x : τ, x′ : τ′, Γ′⟩ ⊢ e_{1} : τ_{1}]], [[Θ, ⟨Γ, x : τ, x′ : τ′, Γ′⟩ ⊢ e_{2} : τ_{2}]]⟩⟩
= ⟨⟨[[Θ, ⟨Γ, x′ : τ′, x : τ, Γ′⟩ ⊢ e_{1} : τ_{1}]] ∘ π, [[Θ, ⟨Γ, x′ : τ′, x : τ, Γ′⟩ ⊢ e_{2} : τ_{2}]] ∘ π⟩⟩
= ⟨⟨[[Θ, ⟨Γ, x′ : τ′, x : τ, Γ′⟩ ⊢ e_{1} : τ_{1}]], [[Θ, ⟨Γ, x′ : τ′, x : τ, Γ′⟩ ⊢ e_{2} : τ_{2}]]⟩⟩ ∘ π
= [[Θ, ⟨Γ, x′ : τ′, x : τ, Γ′⟩ ⊢ ⟨e_{1}, e_{2}⟩ : τ_{1} × τ_{2}]] ∘ π.

• e ≡ fst(e′):

[[Θ, ⟨Γ, x : τ, x′ : τ′, Γ′⟩ ⊢ fst(e′) : τ_{1}]]
= π_{1} ∘ [[Θ, ⟨Γ, x : τ, x′ : τ′, Γ′⟩ ⊢ e′ : τ_{1} × τ_{2}]]
= π_{1} ∘ [[Θ, ⟨Γ, x′ : τ′, x : τ, Γ′⟩ ⊢ e′ : τ_{1} × τ_{2}]] ∘ π
= [[Θ, ⟨Γ, x′ : τ′, x : τ, Γ′⟩ ⊢ fst(e′) : τ_{1}]] ∘ π.

• e ≡ snd(e′): analogous to the previous case.

• e ≡ λx′′. e′:

[[Θ, ⟨Γ, x : τ, x′ : τ′, Γ′⟩ ⊢ λx′′. e′ : τ_{1}⇀ ⇀τ_{2}]]

= pλ([[Θ, ⟨Γ, x : τ, x′ : τ′, Γ′, x′′ : τ_{1}⟩ ⊢ e′ : τ_{2}]])
= pλ([[Θ, ⟨Γ, x′ : τ′, x : τ, Γ′, x′′ : τ_{1}⟩ ⊢ e′ : τ_{2}]] ∘ (π ⊗ id))
= pλ([[Θ, ⟨Γ, x′ : τ′, x : τ, Γ′, x′′ : τ_{1}⟩ ⊢ e′ : τ_{2}]]) ∘ π  , because π ↓
= [[Θ, ⟨Γ, x′ : τ′, x : τ, Γ′⟩ ⊢ λx′′. e′ : τ_{1}⇀ ⇀τ_{2}]] ∘ π.

• e ≡ e_{1}(e_{2}): [[Θ, ⟨Γ, x : τ, x′ : τ′, Γ′⟩ ⊢ e_{1}(e_{2}) : τ′′]]

= ε ∘ ⟨⟨[[Θ, ⟨Γ, x : τ, x′ : τ′, Γ′⟩ ⊢ e_{1} : τ_{2}⇀ ⇀τ′′]], [[Θ, ⟨Γ, x : τ, x′ : τ′, Γ′⟩ ⊢ e_{2} : τ_{2}]]⟩⟩
= ε ∘

⟨⟨[[Θ, ⟨Γ, x′ : τ′, x : τ, Γ′⟩ ⊢ e_{1} : τ_{2}⇀ ⇀τ′′]] ∘ π, [[Θ, ⟨Γ, x′ : τ′, x : τ, Γ′⟩ ⊢ e_{2} : τ_{2}]] ∘ π⟩⟩

= ε ∘ ⟨⟨[[Θ, ⟨Γ, x′ : τ′, x : τ, Γ′⟩ ⊢ e_{1} : τ_{2}⇀ ⇀τ′′]], [[Θ, ⟨Γ, x′ : τ′, x : τ, Γ′⟩ ⊢ e_{2} : τ_{2}]]⟩⟩ ∘ π
= [[Θ, ⟨Γ, x′ : τ′, x : τ, Γ′⟩ ⊢ e_{1}(e_{2}) : τ′′]] ∘ π.

C. Lemma 9.1.3 251

• e ≡ intro(e′):

[[Θ, ⟨Γ, x : τ, x′ : τ′, Γ′⟩ ⊢ intro(e′) : μT. τ_{1}]]

= I ∘ [[Θ, ⟨Γ, x : τ, x′ : τ′, Γ′⟩ ⊢ e′ : τ_{1}[T ↦ μT. τ_{1}]]]
= I ∘ [[Θ, ⟨Γ, x′ : τ′, x : τ, Γ′⟩ ⊢ e′ : τ_{1}[T ↦ μT. τ_{1}]]] ∘ π
= [[Θ, ⟨Γ, x′ : τ′, x : τ, Γ′⟩ ⊢ intro(e′) : μT. τ_{1}]] ∘ π.

• e ≡ elim(e′):

[[Θ, ⟨Γ, x : τ, x′ : τ′, Γ′⟩ ⊢ elim(e′) : τ_{1}[T ↦ μT. τ_{1}]]]

= E ∘ [[Θ, ⟨Γ, x : τ, x′ : τ′, Γ′⟩ ⊢ e′ : μT. τ_{1}]]
= E ∘ [[Θ, ⟨Γ, x′ : τ′, x : τ, Γ′⟩ ⊢ e′ : μT. τ_{1}]] ∘ π
= [[Θ, ⟨Γ, x′ : τ′, x : τ, Γ′⟩ ⊢ elim(e′) : τ_{1}[T ↦ μT. τ_{1}]]] ∘ π.  □

Lemma C.0.2 (Contraction Lemma) In any model of FPC,

[[Θ, ⟨Γ, x : τ′, Γ′⟩ ⊢ e : τ]] = [[Θ, ⟨Γ, Γ′⟩ ⊢ e : τ]] ∘ ⟨⟨π_{1}, …, π_{n}, π_{n+2}, …, π_{n+n′+1}⟩⟩

where | Γ | = n and | Γ′ | = n′. Proof: By induction on the structure of e.

Write π for ⟨⟨π_{1}, …, π_{n}, π_{n+2}, …, π_{n+n′+1}⟩⟩.

• e ≡ x_{i} (1 ≤ i ≤ n):

[[Θ, ⟨Γ, x : τ′, Γ′⟩ ⊢ x_{i} : τ_{i}]] = π_{i} = π_{i} ∘ π = [[Θ, ⟨Γ, Γ′⟩ ⊢ x_{i} : τ_{i}]] ∘ π.

• e ≡ x′_{i} (1 ≤ i ≤ n′):

[[Θ, ⟨Γ, x : τ, Γ′⟩ ⊢ x′_{i} : τ′_{i}]] = π_{n+i+1} = π_{n+i} ∘ π = [[Θ, ⟨Γ, Γ′⟩ ⊢ x′_{i} : τ′_{i}]] ∘ π.

• e ≡ inl(e_{1}):

[[Θ, ⟨Γ, x : τ′, Γ′⟩ ⊢ inl(e_{1}) : τ_{1} + τ_{2}]] = ⨿_{1} ∘ [[Θ, ⟨Γ, x : τ′, Γ′⟩ ⊢ e_{1} : τ_{1}]]
= ⨿_{1} ∘ [[Θ, ⟨Γ, Γ′⟩ ⊢ e_{1} : τ_{1}]] ∘ π
= [[Θ, ⟨Γ, Γ′⟩ ⊢ inl(e_{1}) : τ_{1} + τ_{2}]] ∘ π.

C. Lemma 9.1.3 252 • e ≡ inr(e_{2}): analogous to the previous case.

• e ≡ case e_{0} of inl(x_{1}).e_{1} or inr(x_{2}).e_{2}: [[Θ, ⟨Γ, x : τ′, Γ′⟩ ⊢ case e_{0} of inl(x_{1}).e_{1} or inr(x_{2}).e_{2} : τ]]

= [[[Θ, ⟨Γ, x : τ′, Γ′, x_{1} : τ_{1}⟩ ⊢ e_{1} : τ]], [[Θ, ⟨Γ, x : τ′, Γ′, x_{2} : τ_{2}⟩ ⊢ e_{2} : τ]]]
∘ δ ∘ ⟨⟨id, [[Θ, ⟨Γ, x : τ′, Γ′⟩ ⊢ e_{0} : τ_{1} + τ_{2}]]⟩⟩
= [u_{1} ∘ (π ⊗ id_{[[τ_{1}]]}), u_{2} ∘ (π ⊗ id_{[[τ_{2}]]})] ∘ δ ∘ ⟨⟨id, u_{0} ∘ π⟩⟩
, writing u_{0} for [[Θ, ⟨Γ, Γ′⟩ ⊢ e_{0} : τ_{1} + τ_{2}]] and
u_{i} (i = 1, 2) for [[Θ, ⟨Γ, Γ′, x_{i} : τ_{i}⟩ ⊢ e_{i} : τ]]
= [u_{1}, u_{2}] ∘ δ ∘ ⟨⟨id, u_{0}⟩⟩ ∘ π
= [[Θ, ⟨Γ, Γ′⟩ ⊢ case e_{0} of inl(x_{1}).e_{1} or inr(x_{2}).e_{2} : τ]] ∘ π.

• e ≡ ⟨e_{1}, e_{2}⟩:

[[Θ, ⟨Γ, x : τ′, Γ′⟩ ⊢ ⟨e_{1}, e_{2}⟩ : τ_{1} × τ_{2}]]

= ⟨⟨[[Θ, ⟨Γ, x : τ′, Γ′⟩ ⊢ e_{1} : τ_{1}]], [[Θ, ⟨Γ, x : τ′, Γ′⟩ ⊢ e_{2} : τ_{2}]]⟩⟩
= ⟨⟨[[Θ, ⟨Γ, Γ′⟩ ⊢ e_{1} : τ_{1}]] ∘ π, [[Θ, ⟨Γ, Γ′⟩ ⊢ e_{2} : τ_{2}]] ∘ π⟩⟩
= [[Θ, ⟨Γ, Γ′⟩ ⊢ ⟨e_{1}, e_{2}⟩ : τ_{1} × τ_{2}]] ∘ π.

• e ≡ fst(e′):

[[Θ, ⟨Γ, x : τ′, Γ′⟩ ⊢ fst(e′) : τ]] = π_{1} ∘ [[Θ, ⟨Γ, x : τ′, Γ′⟩ ⊢ e′ : τ × τ_{2}]]
= π_{1} ∘ [[Θ, ⟨Γ, Γ′⟩ ⊢ e′ : τ × τ_{2}]] ∘ π
= [[Θ, ⟨Γ, Γ′⟩ ⊢ fst(e′) : τ]] ∘ π.

• e ≡ snd(e′): analogous to the previous case.

• e ≡ λx′. e′:

[[Θ, ⟨Γ, x : τ′, Γ′⟩ ⊢ λx′. e′ : τ_{1}⇀ ⇀τ_{2}]] = pλ([[Θ, ⟨Γ, x : τ′, Γ′, x′ : τ_{1}⟩ ⊢ e′ : τ_{2}]])
= pλ([[Θ, ⟨Γ, Γ′, x′ : τ_{1}⟩ ⊢ e′ : τ_{2}]] ∘ (π ⊗ id))
= [[Θ, ⟨Γ, Γ′⟩ ⊢ λx′. e′ : τ_{1}⇀ ⇀τ_{2}]] ∘ π.

C. Lemma 9.1.3 253

• e ≡ e_{1}(e_{2}):

[[Θ, ⟨Γ, x : τ′, Γ′⟩ ⊢ e_{1}(e_{2}) : τ]]

= ε ∘ ⟨⟨[[Θ, ⟨Γ, x : τ′, Γ′⟩ ⊢ e_{1} : τ′′⇀ ⇀τ]], [[Θ, ⟨Γ, x : τ′, Γ′⟩ ⊢ e_{2} : τ′′]]⟩⟩
= ε ∘ ⟨⟨[[Θ, ⟨Γ, Γ′⟩ ⊢ e_{1} : τ′′⇀ ⇀τ]] ∘ π, [[Θ, ⟨Γ, Γ′⟩ ⊢ e_{2} : τ′′]] ∘ π⟩⟩
= [[Θ, ⟨Γ, Γ′⟩ ⊢ e_{1}(e_{2}) : τ]] ∘ π.

• e ≡ intro(e′):

[[Θ, ⟨Γ, x : τ′, Γ′⟩ ⊢ intro(e′) : μT. τ′′]]
= I ∘ [[Θ, ⟨Γ, x : τ′, Γ′⟩ ⊢ e′ : τ′′[T ↦ μT. τ′′]]]
= I ∘ [[Θ, ⟨Γ, Γ′⟩ ⊢ e′ : τ′′[T ↦ μT. τ′′]]] ∘ π
= [[Θ, ⟨Γ, Γ′⟩ ⊢ intro(e′) : μT. τ′′]] ∘ π.

• e ≡ elim(e′):

[[Θ, ⟨Γ, x : τ′, Γ′⟩ ⊢ elim(e′) : τ′′[T ↦ μT. τ′′]]]

= E ∘ [[Θ, ⟨Γ, x : τ′, Γ′⟩ ⊢ e′ : μT. τ′′]]
= E ∘ [[Θ, ⟨Γ, Γ′⟩ ⊢ e′ : μT. τ′′]] ∘ π
= [[Θ, ⟨Γ, Γ′⟩ ⊢ elim(e′) : τ′′[T ↦ μT. τ′′]]] ∘ π.  □

Lemma C.0.3 (Substitution Lemma) In any model of FPC, if [[Θ, Γ ⊢ e′ : τ′]] ↓ then [[Θ, Γ ⊢ e[x ↦ e′] : τ]] = [[Θ, ⟨Γ, x : τ′⟩ ⊢ e : τ]] ∘ ⟨⟨id, [[Θ, Γ ⊢ e′ : τ′]]⟩⟩. Proof: By induction on the structure of e.

• e ≡ x_{i} (1 ≤ i ≤ | Γ |):

[[Θ, Γ ⊢ x_{i}[x ↦ e′] : τ_{i}]] = π_{i} = π_{i} ∘ ⟨⟨id, [[Θ, Γ ⊢ e′ : τ′]]⟩⟩
= [[Θ, ⟨Γ, x : τ′⟩ ⊢ x_{i} : τ_{i}]] ∘ ⟨⟨id, [[Θ, Γ ⊢ e′ : τ′]]⟩⟩.

• e ≡ x:

[[Θ, Γ ⊢ x[x ↦ e′] : τ′]] = [[Θ, Γ ⊢ e′ : τ′]]
= [[Θ, ⟨Γ, x : τ′⟩ ⊢ x : τ′]] ∘ ⟨⟨id, [[Θ, Γ ⊢ e′ : τ′]]⟩⟩.

C. Lemma 9.1.3 254

• e ≡ inl(e_{1}):

[[Θ, Γ ⊢ inl(e_{1})[x ↦ e′] : τ_{1} + τ_{2}]]

= [[Θ, Γ ⊢ inl(e_{1}[x ↦ e′]) : τ_{1} + τ_{2}]]
= ⨿_{1} ∘ [[Θ, Γ ⊢ e_{1}[x ↦ e′] : τ_{1}]]
= ⨿_{1} ∘ [[Θ, ⟨Γ, x : τ′⟩ ⊢ e_{1} : τ_{1}]] ∘ ⟨⟨id, [[Θ, Γ ⊢ e′ : τ′]]⟩⟩
= [[Θ, ⟨Γ, x : τ′⟩ ⊢ inl(e_{1}) : τ_{1} + τ_{2}]] ∘ ⟨⟨id, [[Θ, Γ ⊢ e′ : τ′]]⟩⟩.

• e ≡ inr(e_{2}): analogous to the previous case.

• case e_{0} of inl(x_{1}).e_{1} or inr(x_{2}).e_{2}:

[[Θ, Γ ⊢ (case e_{0} of inl(x_{1}).e_{1} or inr(x_{2}).e_{2})[x ↦ e′] : τ]]

= [[Θ, Γ ⊢ case e_{0}[x ↦ e′] of inl(x_{1}).e_{1}[x ↦ e′] or inr(x_{2}).e_{2}[x ↦ e′] : τ]]
= [[[Θ, ⟨Γ, x_{1} : τ_{1}⟩ ⊢ e_{1}[x ↦ e′] : τ]], [[Θ, ⟨Γ, x_{2} : τ_{2}⟩ ⊢ e_{2}[x ↦ e′] : τ]]]

∘ δ ∘ ⟨⟨id, [[Θ, Γ ⊢ e_{0}[x ↦ e′] : τ_{1} + τ_{2}]]⟩⟩

= [v_{1} ∘ ⟨⟨id, [[Θ, ⟨Γ, x_{1} : τ_{1}⟩ ⊢ e′ : τ′]]⟩⟩, v_{2} ∘ ⟨⟨id, [[Θ, ⟨Γ, x_{2} : τ_{2}⟩ ⊢ e′ : τ′]]⟩⟩]
∘ δ ∘ ⟨⟨id, u_{0} ∘ ⟨⟨id, [[Θ, Γ ⊢ e′ : τ′]]⟩⟩⟩⟩  (C.1)

, writing u_{0} for [[Θ, ⟨Γ, x : τ′⟩ ⊢ e_{0} : τ_{1} + τ_{2}]] and v_{i} (i = 1, 2) for [[Θ, ⟨Γ, x_{i} : τ_{i}, x : τ′⟩ ⊢ e_{i} : τ]].

By the permutation lemma, for u_{i} = [[Θ, ⟨Γ, x : τ′, x_{i} : τ_{i}⟩ ⊢ e_{i} : τ]] (i = 1, 2),

v_{i} = u_{i} ∘ ⟨⟨π_{1}, …, π_{n}, π_{n+2}, π_{n+1}⟩⟩

and, by the contraction lemma,

[[Θ, ⟨Γ, x_{i} : τ_{i}⟩ ⊢ e′ : τ′]] = [[Θ, Γ ⊢ e′ : τ′]] ∘ ⟨⟨π_{1}, …, π_{n}⟩⟩.

Hence, for i = 1, 2,

v_{i} ∘ ⟨⟨id, [[Θ, ⟨Γ, x_{i} : τ_{i}⟩ ⊢ e′ : τ′]]⟩⟩

= u_{i} ∘ ⟨⟨π_{1}, …, π_{n}, π_{n+2}, π_{n+1}⟩⟩ ∘ ⟨⟨id, [[Θ, Γ ⊢ e′ : τ′]] ∘ ⟨⟨π_{1}, …, π_{n}⟩⟩⟩⟩
= u_{i} ∘ ⟨⟨π_{1}, …, π_{n}, [[Θ, Γ ⊢ e′ : τ′]] ∘ ⟨⟨π_{1}, …, π_{n}⟩⟩, π_{n+1}⟩⟩
= u_{i} ∘ (⟨⟨id, [[Θ, Γ ⊢ e′ : τ′]]⟩⟩ ⊗ id_{[[τ_{i}]]}).  (C.2)

C. Lemma 9.1.3 255

Finally, from (C.1) and (C.2), [[Θ, Γ ⊢ (case e_{0} of inl(x_{1}).e_{1} or inr(x_{2}).e_{2})[x ↦ e′] : τ]]

= [u_{1} ∘ (⟨⟨id, [[Θ, Γ ⊢ e′ : τ′]]⟩⟩ ⊗ id_{[[τ_{1}]]}), u_{2} ∘ (⟨⟨id, [[Θ, Γ ⊢ e′ : τ′]]⟩⟩ ⊗ id_{[[τ_{2}]]})]

∘ δ ∘ ⟨⟨id, u_{0} ∘ ⟨⟨id, [[Θ, Γ ⊢ e′ : τ′]]⟩⟩⟩⟩

= [u_{1}, u_{2}] ∘ δ ∘ ⟨⟨id, u_{0}⟩⟩ ∘ ⟨⟨id, [[Θ, Γ ⊢ e′ : τ′]]⟩⟩
= [[Θ, ⟨Γ, x : τ′⟩ ⊢ case e_{0} of inl(x_{1}).e_{1} or inr(x_{2}).e_{2} : τ]]

∘ ⟨⟨id, [[Θ, Γ ⊢ e′ : τ′]]⟩⟩.

• e ≡ ⟨e_{1}, e_{2}⟩:

[[Θ, Γ ⊢ ⟨e_{1}, e_{2}⟩[x ↦ e′] : τ_{1} × τ_{2}]]

= [[Θ, Γ ⊢ ⟨e_{1}[x ↦ e′], e_{2}[x ↦ e′]⟩ : τ_{1} × τ_{2}]]
= ⟨⟨[[Θ, Γ ⊢ e_{1}[x ↦ e′] : τ_{1}]], [[Θ, Γ ⊢ e_{2}[x ↦ e′] : τ_{2}]]⟩⟩
= ⟨⟨[[Θ, ⟨Γ, x : τ′⟩ ⊢ e_{1} : τ_{1}]] ∘ ⟨⟨id, [[Θ, Γ ⊢ e′ : τ′]]⟩⟩,
[[Θ, ⟨Γ, x : τ′⟩ ⊢ e_{2} : τ_{2}]] ∘ ⟨⟨id, [[Θ, Γ ⊢ e′ : τ′]]⟩⟩⟩⟩
= ⟨⟨[[Θ, ⟨Γ, x : τ′⟩ ⊢ e_{1} : τ_{1}]], [[Θ, ⟨Γ, x : τ′⟩ ⊢ e_{2} : τ_{2}]]⟩⟩ ∘ ⟨⟨id, [[Θ, Γ ⊢ e′ : τ′]]⟩⟩
= [[Θ, ⟨Γ, x : τ′⟩ ⊢ ⟨e_{1}, e_{2}⟩ : τ_{1} × τ_{2}]] ∘ ⟨⟨id, [[Θ, Γ ⊢ e′ : τ′]]⟩⟩.

• e ≡ fst(e_{1}):

[[Θ, Γ ⊢ fst(e_{1})[x ↦ e′] : τ]]

= [[Θ, Γ ⊢ fst(e_{1}[x ↦ e′]) : τ]]
= π_{1} ∘ [[Θ, Γ ⊢ e_{1}[x ↦ e′] : τ × τ_{2}]]
= π_{1} ∘ [[Θ, ⟨Γ, x : τ′⟩ ⊢ e_{1} : τ × τ_{2}]] ∘ ⟨⟨id, [[Θ, Γ ⊢ e′ : τ′]]⟩⟩
= [[Θ, ⟨Γ, x : τ′⟩ ⊢ fst(e_{1}) : τ]] ∘ ⟨⟨id, [[Θ, Γ ⊢ e′ : τ′]]⟩⟩.

• e ≡ snd(e_{2}): analogous to the previous case.

• e ≡ λx′. e_{1}:

[[Θ, Γ ⊢ (λx′. e_{1})[x ↦ e′] : τ_{1}⇀ ⇀τ_{2}]]

= [[Θ, Γ ⊢ λx′. e_{1}[x ↦ e′] : τ_{1}⇀ ⇀τ_{2}]]
= pλ([[Θ, ⟨Γ, x′ : τ_{1}⟩ ⊢ e_{1}[x ↦ e′] : τ_{2}]])
= pλ([[Θ, ⟨Γ, x′ : τ_{1}, x : τ′⟩ ⊢ e_{1} : τ_{2}]] ∘ ⟨⟨id, [[Θ, ⟨Γ, x′ : τ_{1}⟩ ⊢ e′ : τ′]]⟩⟩). (C.3)

C. Lemma 9.1.3 256

Since, by the permutation lemma,

[[Θ, ⟨Γ, x′ : τ_{1}, x : τ′⟩ ⊢ e_{1} : τ_{2}]]

= [[Θ, ⟨Γ, x : τ′, x′ : τ_{1}⟩ ⊢ e_{1} : τ_{2}]] ∘ ⟨⟨π_{1}, …, π_{n}, π_{n+2}, π_{n+1}⟩⟩

and, by the contraction lemma,

[[Θ, ⟨Γ, x′ : τ_{1}⟩ ⊢ e′ : τ′]] = [[Θ, Γ ⊢ e′ : τ′]] ∘ ⟨⟨π_{1}, …, π_{n}⟩⟩

it follows that

[[Θ, ⟨Γ, x′ : τ_{1}, x : τ′⟩ ⊢ e_{1} : τ_{2}]] ∘ ⟨⟨id, [[Θ, ⟨Γ, x′ : τ_{1}⟩ ⊢ e′ : τ′]]⟩⟩

= [[Θ, ⟨Γ, x : τ′, x′ : τ_{1}⟩ ⊢ e_{1} : τ_{2}]]

∘ ⟨⟨π_{1}, …, π_{n}, π_{n+2}, π_{n+1}⟩⟩ ∘ ⟨⟨id, [[Θ, Γ ⊢ e′ : τ′]] ∘ ⟨⟨π_{1}, …, π_{n}⟩⟩⟩⟩

= [[Θ, ⟨Γ, x : τ′, x′ : τ_{1}⟩ ⊢ e_{1} : τ_{2}]] ∘ (⟨⟨id, [[Θ, Γ ⊢ e′ : τ′]]⟩⟩ ⊗ id_{[[τ_{1}]]}). (C.4)

Finally, from (C.3) and (C.4),

[[Θ, Γ ⊢ (λx′. e_{1})[x ↦ e′] : τ_{1}⇀ ⇀τ_{2}]]

= pλ([[Θ, ⟨Γ, x : τ′, x′ : τ_{1}⟩ ⊢ e_{1} : τ_{2}]] ∘ (⟨⟨id, [[Θ, Γ ⊢ e′ : τ′]]⟩⟩ ⊗ id_{[[τ_{1}]]}))
= pλ([[Θ, ⟨Γ, x : τ′, x′ : τ_{1}⟩ ⊢ e_{1} : τ_{2}]]) ∘ ⟨⟨id, [[Θ, Γ ⊢ e′ : τ′]]⟩⟩
= [[Θ, ⟨Γ, x : τ′⟩ ⊢ λx′. e_{1} : τ_{1}⇀ ⇀τ_{2}]] ∘ ⟨⟨id, [[Θ, Γ ⊢ e′ : τ′]]⟩⟩.

• e ≡ e_{1}(e_{2}): [[Θ, Γ ⊢ e_{1}(e_{2})[x ↦ e′] : τ]]

= [[Θ, Γ ⊢ e_{1}[x ↦ e′](e_{2}[x ↦ e′]) : τ]]
= ε ∘ ⟨⟨[[Θ, Γ ⊢ e_{1}[x ↦ e′] : τ′′⇀ ⇀τ]], [[Θ, Γ ⊢ e_{2}[x ↦ e′] : τ′′]]⟩⟩
= ε ∘
⟨⟨[[Θ, ⟨Γ, x : τ′⟩ ⊢ e_{1} : τ′′⇀ ⇀τ]] ∘ ⟨⟨id, [[Θ, Γ ⊢ e′ : τ′]]⟩⟩,
[[Θ, ⟨Γ, x : τ′⟩ ⊢ e_{2} : τ′′]] ∘ ⟨⟨id, [[Θ, Γ ⊢ e′ : τ′]]⟩⟩⟩⟩
= [[Θ, ⟨Γ, x : τ′⟩ ⊢ e_{1}(e_{2}) : τ]] ∘ ⟨⟨id, [[Θ, Γ ⊢ e′ : τ′]]⟩⟩.

C. Lemma 9.1.3 257

• e ≡ intro(e_{1}):

[[Θ, Γ ⊢ intro(e_{1})[x ↦ e′] : μT. τ_{1}]]

= [[Θ, Γ ⊢ intro(e_{1}[x ↦ e′]) : μT. τ_{1}]]
= I ∘ [[Θ, Γ ⊢ e_{1}[x ↦ e′] : τ_{1}[T ↦ μT. τ_{1}]]]
= I ∘ [[Θ, ⟨Γ, x : τ′⟩ ⊢ e_{1} : τ_{1}[T ↦ μT. τ_{1}]]] ∘ ⟨⟨id, [[Θ, Γ ⊢ e′ : τ′]]⟩⟩
= [[Θ, ⟨Γ, x : τ′⟩ ⊢ intro(e_{1}) : μT. τ_{1}]] ∘ ⟨⟨id, [[Θ, Γ ⊢ e′ : τ′]]⟩⟩.

• e ≡ elim(e_{1}):

[[Θ, Γ ⊢ elim(e_{1})[x ↦ e′] : τ_{1}[T ↦ μT. τ_{1}]]]

= [[Θ, Γ ⊢ elim(e_{1}[x ↦ e′]) : τ_{1}[T ↦ μT. τ_{1}]]]
= E ∘ [[Θ, Γ ⊢ e_{1}[x ↦ e′] : μT.τ_{1}]]
= E ∘ [[Θ, ⟨Γ, x : τ′⟩ ⊢ e_{1} : μT. τ_{1}]] ∘ ⟨⟨id, [[Θ, Γ ⊢ e′ : τ′]]⟩⟩
= [[Θ, ⟨Γ, x : τ′⟩ ⊢ elim(e_{1}) : τ_{1}[T ↦ μT. τ_{1}]]] ∘ ⟨⟨id, [[Θ, Γ ⊢ e′ : τ′]]⟩⟩.  □

Lemma 9.1.3 In any model of FPC,

if Θ, Γ ⊢ e ⇝ v : τ then [[Θ, Γ ⊢ e : τ]] = [[Θ, Γ ⊢ v : τ]].

Proof: By induction on the derivation of e ⇝ v. Assume that Θ, Γ ⊢ e ⇝ v : τ.

• e ≡ x_{i} (1 ≤ i ≤ | Γ |): vacuous.

• e ≡ inl(e_{1}):

Then, v ≡ inl(v_{1}) where Θ, Γ ⊢ e_{1} ⇝ v_{1} : τ_{1} and

[[Θ, Γ ⊢ e : τ_{1} + τ_{2}]] = ⨿_{1} ∘ [[Θ, Γ ⊢ e_{1} : τ_{1}]] = ⨿_{1} ∘ [[Θ, Γ ⊢ v_{1} : τ_{1}]]
= [[Θ, Γ ⊢ v : τ_{1} + τ_{2}]].

• e ≡ inr(e_{2}): analogous to the previous case.

C. Lemma 9.1.3 258

• e ≡ case e_{0} of inl(x_{1}).e_{1} or inr(x_{2}).e_{2}:

– Θ, Γ ⊢ e_{0} ⇝ inl(v_{1}) : τ_{1} + τ_{2}:

Then, Θ, Γ ⊢ e_{1}[x_{1} ↦ v_{1}] ⇝ v : τ and

[[Θ, Γ ⊢ e : τ]] = [[[Θ, ⟨Γ, x_{1} : τ_{1}⟩ ⊢ e_{1} : τ]], [[Θ, ⟨Γ, x_{2} : τ_{2}⟩ ⊢ e_{2} : τ]]]

∘ δ ∘ ⟨⟨id, [[Θ, Γ ⊢ e_{0} : τ_{1} + τ_{2}]]⟩⟩

= [[[Θ, ⟨Γ, x_{1} : τ_{1}⟩ ⊢ e_{1} : τ]], [[Θ, ⟨Γ, x_{2} : τ_{2}⟩ ⊢ e_{2} : τ]]]

∘ δ ∘ ⟨⟨id, ⨿_{1} ∘ [[Θ, Γ ⊢ v_{1} : τ_{1}]]⟩⟩

= [[[Θ, ⟨Γ, x_{1} : τ_{1}⟩ ⊢ e_{1} : τ]], [[Θ, ⟨Γ, x_{2} : τ_{2}⟩ ⊢ e_{2} : τ]]]

∘ ⨿_{1} ∘⟨⟨id, [[Θ, Γ ⊢ v_{1} : τ_{1}]]⟩⟩

= [[Θ, ⟨Γ, x_{1} : τ_{1}⟩ ⊢ e_{1} : τ]] ∘ ⟨⟨id, [[Θ, Γ ⊢ v_{1} : τ_{1}]]⟩⟩
= [[Θ, Γ ⊢ e_{1}[x_{1} ↦ v_{1}] : τ]]  , by the substitution lemma
= [[Θ, Γ ⊢ v : τ]].

– Θ, Γ ⊢ e_{0} ⇝ inr(v_{2}) : τ_{1} + τ_{2}: analogous to the previous case.

• e ≡ ⟨e_{1}, e_{2}⟩:

Then, v ≡ ⟨v_{1}, v_{2}⟩ where Θ, Γ ⊢ e_{i} ⇝ v_{i} : τ_{i} (i = 1, 2) and

[[Θ, Γ ⊢ e : τ_{1} × τ_{2}]] = ⟨⟨[[Θ, Γ ⊢ e_{1} : τ_{1}]], [[Θ, Γ ⊢ e_{2} : τ_{2}]]⟩⟩
= ⟨⟨[[Θ, Γ ⊢ v_{1} : τ_{1}]], [[Θ, Γ ⊢ v_{2} : τ_{2}]]⟩⟩
= [[Θ, Γ ⊢ v : τ_{1} × τ_{2}]].

• e ≡ fst(e′):

Then, Θ, Γ ⊢ e′ ⇝ ⟨v, v′⟩ : τ × τ′ and

[[Θ, Γ ⊢ e : τ]] = π_{1} ∘ [[Θ, Γ ⊢ e′ : τ × τ′]]
= π_{1} ∘ ⟨⟨[[Θ, Γ ⊢ v : τ]], [[Θ, Γ ⊢ v′ : τ′]]⟩⟩
= [[Θ, Γ ⊢ v : τ]]  , because [[Θ, Γ ⊢ v′ : τ′]] ↓.

• e ≡ snd(e′): analogous to the previous case.

C. Lemma 9.1.3 259

• e ≡ λx. e′: vacuous.

• e ≡ e_{1}(e_{2}):

Then, – Θ, Γ ⊢ e_{1} ⇝ λx.e′ : τ′⇀ ⇀τ,

– Θ, Γ ⊢ e_{2} ⇝ v′ : τ′,

– Θ, Γ ⊢ e′[x ↦ v′] ⇝ v : τ and

[[Θ, Γ ⊢ e : τ]] = ε ∘ ⟨⟨[[Θ, Γ ⊢ e_{1} : τ′⇀ ⇀τ]], [[Θ, Γ ⊢ e_{2} : τ′]]⟩⟩
= ε ∘ ⟨⟨[[Θ, Γ ⊢ λx. e′ : τ′⇀ ⇀τ]], [[Θ, Γ ⊢ v′ : τ′]]⟩⟩
= ε ∘ ⟨⟨pλ([[Θ, ⟨Γ, x : τ′⟩ ⊢ e′ : τ]]), [[Θ, Γ ⊢ v′ : τ′]]⟩⟩
= [[Θ, ⟨Γ, x : τ′⟩ ⊢ e′ : τ]] ∘ ⟨⟨id, [[Θ, Γ ⊢ v′ : τ′]]⟩⟩
, because [[Θ, Γ ⊢ v′ : τ′]] ↓
= [[Θ, Γ ⊢ e′[x ↦ v′] : τ]]  , by the substitution lemma
= [[Θ, Γ ⊢ v : τ]].

• e ≡ intro(e′):

Then, v ≡ intro(v′) where Θ, Γ ⊢ e′ ⇝ v′ : τ′[T ↦ μT. τ′] and

[[Θ, Γ ⊢ e : μT. τ′]] = I ∘ [[Θ, Γ ⊢ e′ : τ′[T ↦ μT. τ′]]]
= I ∘ [[Θ, Γ ⊢ v′ : τ′[T ↦ μT. τ′]]]
= [[Θ, Γ ⊢ v : μT. τ′]].

• e ≡ elim(e′):

Then, e′ ⇝ intro(v) and

[[Θ, Γ ⊢ e : τ′[T ↦ μT. τ′]]]

= E ∘ [[Θ, Γ ⊢ e′ : μT. τ′]]
= E ∘ [[Θ, Γ ⊢ intro(v) : μT. τ′]]
= E ∘ I ∘ [[Θ, Γ ⊢ v : τ′[T ↦ μT. τ′]]]
= [[Θ, Γ ⊢ v : τ′[T ↦ μT. τ′]]]  , because E ∘ I = id.  □

D Propositions D.0.1 and D.0.2

Proposition D.0.1 In the situation (9.6) of page 207, for symmetric Cpo-functors F′ and G′ such that

p̆K × … × p̆K pK(σ′_{1})^{}˘ × … × pK(σ′_{m′})^{}˘ F′  pK(σ_{1})^{}˘ × … × pK(σ_{m})^{}˘p̆K × … × p̆K G′  ,

if

pK(σ_{1})^{}˘ × … × pK(σ_{m})^{}˘  pK(σ)^{}˘≅^{φ^{F}} F ⟨Id, F^{‡}⟩ F^{‡} p̆K × … × p̆K  p̆K ≅^{φ^{G}} G⟨Id, G^{‡}⟩ G^{‡}

and, for S = F (F′ × Id) and T = G(G′ × Id),

pK(σ)^{}˘p̆K × … × p̆K  p̆K pK(σ′_{1})^{}˘ × … × pK(σ′_{m′})^{}˘ F ⟨F′, S^{‡}⟩ S^{‡} G⟨G′, T^{‡}⟩ T^{‡} ≅^{φ^{T}}≅^{φ^{S}}

then

p̆K (F (F′ × Id))^{‡} F^{‡}F′  pK(σ)^{}˘ (G(G′ × Id))^{‡} G^{‡}G′ ≅^{ψ^{F,F′}} ≅^{ψ^{G,G′}} p̆K × … × p̆K pK(σ′_{1})^{}˘ × … × pK(σ′_{m′})^{}˘  .

Proof: Recall from page 146 that

F (F′X, S^{‡}X) F (F′X, F^{‡}F′X)  ψ_{X}^{F,F′} F (F′X, ψ_{X}^{F,F′})  F^{‡}F′X φ_{F′X}^{F} φ_{X}^{S}  S^{‡}X  .

Then, writing W for (U_{σ_{1}}^{op} × U_{σ_{1}}) × … × (U_{σ_{m}}^{op} × U_{σ_{m}}), V for U_{σ}^{op} × U_{σ} and W′ for (U_{σ′_{1}}^{op} × U_{σ′_{1}}) × … × (U_{σ′_{m′}}^{op} × U_{σ′_{m′}}), and applying V to the above diagram it follows that

T^{‡}W′X V ψ_{X}^{F,F′} G^{‡}G′W′X G(G′W′X, T^{‡}W′X) G(G′W′X, V ψ_{X}^{F,F′}) G(G′W′X, G^{‡}G′W′X)  V φ_{X}^{S} = φ_{W′X}^{T} V φ_{F′X}^{F} = φ_{W F′X}^{G} = φ_{G′W′X}^{G}

and therefore V ψ^{F,F′} = ψ^{G,G′}W′. □ Proposition D.0.2 For symmetric Cpo-functors F_{i}, G_{i} (i = 1, 2) such that

F_{1}  pK(σ)^{}˘ G_{1} F_{2}  p̆K G_{2} η_{1} η_{2} pK(σ_{1})^{}˘ × … × pK(σ_{m})^{}˘ × pK(σ)^{}˘p̆K × … × p̆K × p̆K  ,

if, for H = F, G,

pK(σ_{1})^{}˘ × … × pK(σ_{m})^{}˘  pK(σ)^{}˘p̆K × … × p̆K  p̆K^{H_{1}^{‡}} H_{2}⟨Id, H_{2}^{‡}⟩ H_{2}^{‡} H_{1}⟨Id, H_{1}^{‡}⟩ ≅^{φ^{H_{2}}} ≅^{φ^{H_{1}}}

then

pK(σ)^{}˘p̆K^{F_{2}^{‡}}^{η_{2}^{‡}} G_{2}^{‡}^{G_{1}^{‡}}^{F_{1}^{‡}}^{η_{1}^{‡}} pK(σ_{1})^{}˘ × … × pK(σ_{m})^{}˘p̆K × … × p̆K  .

Proof: Recall from page 130 that

F_{1}(X, G_{1}^{‡}X)  G_{1}(X, G_{1}^{‡}X)  G_{1}^{‡}X F_{1}(X, F_{1}^{‡}X)  ^{η_{1}_{X}^{‡}} φ_{X}^{G_{1}} φ_{X}^{F_{1}} η_{(X,G_{1}^{‡}X)}  F_{1}^{‡}X F_{1}(X, η_{1}_{X}^{‡})  .

Then, writing W for (U_{σ_{1}}^{op} ×U_{σ_{1}})×…×(U_{σ_{m}}^{op} ×U_{σ_{m}}) and V for U_{σ}^{op} ×U_{σ}, and applying V to the above diagram it follows that

V η_{1}_{X}^{‡} G_{2}^{‡}W X F_{2}^{‡}W X F_{2}(W X, F_{1}^{‡}W X) F_{2}(W X, G_{2}^{‡}W X)  G_{2}(W X, G_{2}^{‡}W X) V η_{(X,G_{1}^{‡}X)}  V φ_{X}^{G_{1}} = φ_{W X}^{G_{2}} F_{2}(W X, V η_{1}_{X}^{‡})  V φ_{X}^{F_{1}} = φ_{W X}^{F_{2}} η_{2}_{(W X,G_{2}^{‡}W X)}

and therefore V η_{1}^{‡} = η_{2}^{‡}W. □

Bibliography

[Abr87] S. Abramsky. Domain Theory and the Logic of Observable Properties. PhD thesis, University of London, 1987.

[Abr90] S. Abramsky. The lazy λ-calculus. In D.A. Turner, editor, Logical Foundations of Functional Programming, pages 65–116. Addison-Wesley, 1990.

[Adá93] J. Adámek. Data types in algebraically ω-complete categories. To appear in Information and Computation, 1993.

[AJ94] S. Abramsky and A. Jung. Domain theory. To appear in the Handbook of Logic in Computer Science, 1994.

[AMR94] S. Abramsky, P. Malacaria, and Jagadeesan R. Full abstraction for PCF (extended abstract). In M. Hagiya and J.C. Mitchell, editors, Theoretical Aspects of Computer Software, pages 1–15. Springer-Verlag, 1994.

[AT90] J. Adámek and V. Trnková. Automata and Algebras in Categories. Klumer Publ., 1990.

[Bar92] M. Barr. Algebraically compact functors. Journal of Pure and Applied Algebra, 82:211–231, 1992.

[BCL85] G. Berry, P.-L. Curien, and J.-J. Lévy. Full abstraction for sequential languages: the state of the art. In M. Nivat and J.C. Reynolds, editors, Algebraic methods in semantics, pages 89–132. Cambridge University Press, 1985.

[Car86] A. Carboni. Bicategories of partial maps. Cahiers Topologie Géom. Différentielle, 1986.

[CF58] H.B. Curry and R. Feys. Combinatory Logic, volume 1 of Studies in Logic and the Foundations of Mathematics. North-Holland, 1958.

[CGW89] T. Coquand, C.A. Gunter, and G. Winskel. Domain theoretic models of polymorphism. Information and Computation, 81:123–167, 1989.

[CM93] P. Cenciarelli and E. Moggi. A syntactic approach to modularity in denotational semantics. In CTCS-5 (Category Theory and Computer Science Fifth Biennial Meeting), pages 9–12. CWI, September 1993.

[CS93] R. L. Constable and S.F. Smith. Computational foundations of basic recursive function theory. Theoretical Computer Science, 121:89–112, 1993.

[Ers73] Y. Ershov. Theorie der numerierungen I. Z. Math. Logik, 19, 1973.

[Fio93a] M.P. Fiore. A coinduction principle for recursive data types based on bisimulation. In 8^{th} LICS Conf., pages 110–119. IEEE, Computer Society Press, 1993.

[Fio93b] M.P. Fiore. Cpo-categories of partial maps. In CTCS-5 (Category Theory and Computer Science Fifth Biennial Meeting), pages 45–49. CWI, September 1993.

[FK72] P.J. Freyd and G.M. Kelly. Categories of continuous functors, I. Journal of Pure and Applied Algebra, 2:169–191, 1972.

[FMRS92] P.J. Freyd, P. Mulry, G. Rosolini, and D.S. Scott. Extensional PERs. Information and Computation, 98:211–227, 1992.

[FP92] M.P. Fiore and G.D. Plotkin. On compactness and Cpo-enriched categories. In G. Winskel, editor, Proceedings of the CLICS Workshop (23-27 March 1992), volume 397-II of DAIMI PB, pages 571–584. Computer Science Department, Aarhus University, May 1992.

[FP94] M.P. Fiore and G.D. Plotkin. An axiomatisation of computationally adequate domain theoretic models of FPC. In 9^{th} LICS Conf. IEEE, Computer Society Press, 1994.

[Fre90] P.J. Freyd. Recursive types reduced to inductive types. In 5^{th} LICS Conf., pages 498–507. IEEE, Computer Society Press, 1990.

[Fre91] P.J. Freyd. Algebraically complete categories. In A. Carboni, M.C. Pedicchio, and G. Rosolini, editors, Category Theory, volume 1488 of Lecture Notes in Mathematics, pages 131–156. Springer-Verlag, 1991.

[Fre92] P.J. Freyd. Remarks on algebraically compact categories. In M.P. Fourman, P.T. Johnstone, and A.M. Pitts, editors, Applications of Categories in Computer Science, volume 177 of London Mathematical Society Lecture Note Series, pages 95–106. Cambridge University Press, 1992.

[GMW79] M.J.C. Gordon, A.J.R. Milner, and C.P. Wadsworth. Edinburgh LCF, volume 78 of Lecture Notes in Computer Science. Springer-Verlag, 1979.

[GS90] C.A. Gunter and D.S. Scott. Semantic domains. Handbook of Theoretical Computer Science, pages 633–674, 1990.

[Gun92] C.A. Gunter. Semantics of Programming Languages: Structures and Techniques. The MIT Press, 1992.

[HO94] J.M.E Hyland and C.-H.L. Ong. Full abstraction for PCF: dialogue games and innocent strategies. Preprint, 1994.

[How80] W.A. Howard. The formulae-as-types notion of construction. In [HS80], pages 479–490. Academic Press, 1980.

[HP90] H. Huwig and A. Poigné. A note on inconsistencies caused by fixpoints in a cartesian closed category. Theoretical Computer Science, 73:101–112, 1990.

[HS80] J.R. Hindley and J.P. Seldin, editors. To H.B. Curry: essays in Combinatory Logic, lambda calculus and Formalisms. Academic Press, 1980.

[Hyl91] J.M.E. Hyland. First steps in synthetic domain theory. In A. Carboni, M.C. Pedicchio, and G. Rosolini, editors, Category Theory, volume 1488 of Lecture Notes in Mathematics, pages 95–104. Springer-Verlag, 1991.

[Jay91] C.B. Jay. Partial functions, ordered categories, limits and cartesian closure. In Workshops in Computing, IV Higher Order Workshop, Banff, pages 151–161. Springer-Verlag, 1991.

[Joh77] P.T. Johnstone. Topos Theory. Academic Press, 1977.

[Kel82] G.M. Kelly. Basic Concepts of Enriched Category Theory. Cambridge University Press, 1982.

[Kel89] G.M. Kelly. Elementary observations on 2-categorical limits. Bull. Austral. Math. Soc., 39(2):301–317, 1989.

[Koc70] A. Kock. Strong functors and monoidal monads. Various Publications Series 11, Aarhus Universitet, August 1970.

[KS74] G.M. Kelly and R. Street. Review of the elements of 2-categories. In G.M. Kelly, editor, Proceedings Sydney Category Theory Seminar 1972/1973, pages 75–103. Springer-Verlag, 1974.

[Lam68] J. Lambek. A fixpoint theorem for complete categories. Math. Zeitschr., 103:151–161, 1968.

[Law73] F.W. Lawvere. Metric spaces, generalized logic, and closed categories. Rend. del Sem. Mat. e Fis. di Milano, 43:135–166, 1973.

[Law90] F.W. Lawvere. Some thoughts on the future of category theory. In A. Carboni, M.C. Pedicchio, and G. Rosolini, editors, Category Theory, volume 1488 of Lecture Notes in Mathematics, pages 1–13. Springer-Verlag, 1990.

[LM84] G. Longo and E. Moggi. Cartesian closed categories of enumerations for effective type-structures. In G. Kahn, D. MacQueen, and G. Plotkin, editors, Symposium on Semantics of Data Types, volume 173 of Lecture Notes in Computer Science. Springer-Verlag, 1984.

[LM92] S. Mac Lane and I. Moerdijk. Sheaves in Geometry and Logic: A First Introduction to Topos Theory. Springer-Verlag, 1992.

[LS81] D.J. Lehmann and M.B. Smyth. Algebraic specification of data types: A synthetic approach. Math. Systems Theory, 14:97–139, 1981.

[Mac71] S. MacLane. Categories for the Working Mathematician. Springer-Verlag, 1971.

[Mar76] G. Markowsky. Chain-complete posets and directed sets with applications. Algebra Univ., 6:53–68, 1976.

[MC88] A.R. Meyer and S.S. Cosmadakis. Semantical paradigms: Notes for an invited lecture. In 3^{rd} LICS Conf., pages 236–253. IEEE, Computer Society Press, 1988.

[McC84] D.C. McCarty. Realizability and Recursive Mathematics. PhD thesis, University of Oxford, 1984. Also CMU-CS-84-131, Carnegie-Mellon University.

[Mil77] R. Milner. Fully abstract models of typed lambda calculus. Theoretical Computer Science, 4:1–22, 1977.

[Mit90] J.C. Mitchell. Types systems for programming languages. Handbook of Theoretical Computer Science, pages 366–457, 1990.

[ML83] P. Martin-Löf. The domain interpretation of type theory. In Programming Methodology Group, editor, Workshop on the Semantics of Programming Languages, pages 21–48, 1983. University of Göteborg and Chalmers University of Technology.

[Mog86] E. Moggi. Categories of partial morphisms and the partial lambda-calculus. In Proceedings Workshop on Category Theory and Computer Programming, Guildford 1985, volume 240 of Lecture Notes in Computer Science, pages 242– 251. Springer-Verlag, 1986.

[Mog88] E. Moggi. Partial morphisms in categories of effective objects. Information and Computation, 76:250–277, 1988.

[Pho90a] W. Phoa. Domain Theory in Realizability Toposes. PhD thesis, Trinity College, Cambridge, 1990. Also CST-82-91, University of Edinburgh.

[Pho90b] W. Phoa. Effective domains and intrinsic structure. In 5^{th} LICS Conf., pages 366–377. IEEE, Computer Society Press, 1990.

[Pho93] W. Phoa. Adequacy for untyped translations of typed λ-calculi. In 8^{th} LICS Conf., pages 287–295. IEEE, Computer Society Press, 1993.

[Pit92] A.M. Pitts. A co-induction principle for recursively defined domains. Technical Report 252, Cambridge Univ. Computer Laboratory, September 1992. To appear in Theoretical Computer Science.

[Pit93a] A.M. Pitts. Relational properties of domains. Technical Report 321, Cambridge Univ. Computer Laboratory, December 1993.

[Pit93b] A.M. Pitts. Relational properties of recursively defined domains. In 8^{th} LICS Conf., pages 86–97. IEEE, Computer Society Press, 1993.

[Plo77] G.D. Plotkin. LCF considered as a programming language. Theoretical Computer Science, 5:223–256, 1977.

[Plo81] G.D. Plotkin. A structural approach to operational semantics. Technical Report DAIMI FN-19, Computer Science Department, Aarhus University, September 1981.

[Plo83a] G.D. Plotkin. Domains. Department of Computer Science, University of Edinburgh, 1983.

[Plo83b] G.D. Plotkin. A metalanguage for predomains. In Programming Methodology Group, editor, Workshop on the Semantics of Programming Languages, pages 93–118, 1983. University of Göteborg and Chalmers University of Technology.

[Plo85] G.D. Plotkin. Denotational semantics with partial functions. Lecture at C.S.L.I. Summer School, 1985.

[Plo93a] G.D. Plotkin. Second order type theory and recursion. Slides of a talk given at the Scott Fest, February 1993.

[Plo93b] G.D. Plotkin. Type theory and recursion (extended abstract). In 8^{th} LICS Conf., page 374. IEEE, Computer Society Press, 1993.

[Rey74] J. Reynolds. Towards a theory of type structure. In B. Robinet, editor, Programming Symposium ’74, volume 19 of Lecture Notes in Computer Science. Springer-Verlag, 1974.

[Rey83] J. Reynolds. Types, abstraction, and parametric polymorphism. IFIP Congress, 1983.

[Rob87] E. Robinson. Logical aspects of denotational semantics. In Category Theory and Computer Science, number 283 in Lecture Notes in Computer Science, pages 238–253. Springer-Verlag, September 1987.

[Rom89] L. Román. On partial cartesian closed categories. In Proc. AMS Conf. on Categories in Comp. Sci. and Logic (Boulder 1987), volume 92, 1989.

[Ros86] G. Rosolini. Continuity and Effectiveness in Topoi. PhD thesis, University of Oxford, 1986.

[RR88] E. Robinson and G. Rosolini. Categories of partial maps. Information and Computation, 79:95–130, 1988.

[RT93] J. Rutten and D. Turi. On the foundations of final semantics: Non-standard sets, metric spaces, partial orders. In J.W. de Bakker, W.P. de Roever, and Rozenberg, editors, Proc. of the REX workshop, Semantics: Foundations and Applications, volume 666 of Lecture Notes in Computer Science. Springer-Verlag, 1993.

[Rut93] J. Rutten. A structural co-induction theorem. In Proc. of the 9^{th} Conference on the Mathematical Foundations of Programming Semantics, Lecture Notes in Computer Science. Springer-Verlag, 1993. To appear.

[Sco69] D.S. Scott. A type-theoretical alternative to CUCH, ISWIM, OWHY. Also [Sco93], 1969.

[Sco70] D.S. Scott. Outline of a mathematical theory of computation. Technical Report PRG-2, Oxford Univ. Computing Lab., 1970.

[Sco72] D.S. Scott. Continuous lattices. In F.W. Lawvere, editor, Toposes, Algebraic Geometry and Logic, volume 274 of Lecture Notes in Mathematics, pages 97– 136. Springer-Verlag, 1972.

[Sco76] D.S. Scott. Data types as lattices. SIAM Journal of Computing, 5:522–587, 1976.

[Sco79] D.S. Scott. Identity and existence in intuitionistic logic. In M.P. Fourman, C.J. Mulvey, and D.S. Scott, editors, Applications of Sheaves, volume 753 of Lecture Notes in Mathematics. Springer-Verlag, 1979.

[Sco80] D.S. Scott. Relating theories of the λ-calculus. In R. Hindley and J. Seldin, editors, [HS80]. Academic Press, 1980.

[Sco82] D.S. Scott. Domains for denotational semantics. In M. Nielsen and E.M. Schimdt, editors, 9^{th} Colloquium on Automata, Languages and Programming, volume 140 of Lecture Notes in Computer Science, pages 577–613. Springer-Verlag, 1982.

[Sco93] D.S. Scott. A type-theoretical alternative to CUCH, ISWIM, OWHY. Theoretical Computer Science, 121:411–440, 1993. Reprint of a manuscript.

[Sim92] A.K. Simpson. Recursive types in Kleisli categories. Department of Computer Science, University of Edinburgh. Draft, 1992.

[Smy77] M.B. Smyth. Effectively given domains. Theoretical Computer Science, 5:257– 274, 1977.

[SP82] M.B. Smyth and G.D. Plotkin. The category-theoretic solution of recursive domain equations. SIAM Journal of Computing, 11(4):761–783, November 1982.

[Sto77] J.E. Stoy. Denotational Semantics: The Scott-Strachey Approach to Programming Language Theory. The MIT Press, 1977.

[Tay91] P. Taylor. The fixed point property in synthetic domain theory. In 6^{th} LICS Conf., pages 152–160. IEEE, Computer Society Press, 1991.

[Vic89] S. Vickers. Topology via Logic. Cambridge University Press, 1989. Volume 5 of Tracts in Theoretical Computer Science.

[Wag94] K.R. Wagner. Abstract pre-orders. In M. Hagiya and J.C. Mitchell, editors, Theoretical Aspects of Computer Software, pages 598–617. Springer-Verlag, 1994.

[Wan79] M. Wand. Fixed point constructions in order-enriched categories. Theoretical Computer Science, 8:13–30, 1979.

[Zha91] G.-Q. Zhang. Logic of Domains. Birkhäuser, 1991.

Index

1, 11 2, 28

Ab, 28 adequacy

computational —, 201 computational — Theorem, 222

adjoint pair, 118 adjunction

V- —, 34 Cpo- —, 26 Poset- —, 26

admissible — mono, 43

— natural transformation, 110 category of — monos, 43

ωAlgCpo, 105 algebra

free —, 137 initial —

parameterised —, 128 lax — morphism, 159 maximally initial —, 160 parameterised —, 130

algebraic — ω-compactness, 154

— ω-completeness, 153

— compactness, 137 Fundamental Property of —, 142

— completeness, 127 — supercompactness, 155

— supercompleteness, 155 parameterised — compactness, 137

Fundamental Property of —, 145 parameterised — completeness, 129

algebras

category of —, 126 approximation

— order, 58, 59 contextual —, 58 formal —, 201

Basic Lemma, 154 Bekic’s Lemma, 132, 138 bicategory of partial maps, 100 bifunctor, 125

cartesian — category, 28

— closed 2-category, 24

— closed category, 33

— natural transformation, 56 partial — category, 100 partial — closed category, 104

CAT, 23

V- —, 31 Cat, 23

V- —, 31 Cpo- —, 25 Poset- —, 25 category

— of admissible monos, 43

— of algebras, 126

— of partial maps, 44

— of total maps, 43 V- —, 29 Cpo- —, 25 Poset- —, 25 2- —, 21 algebraically ω-compact —, 154 algebraically ω-complete —, 153 algebraically compact —, 137 algebraically complete —, 127 algebraically supercompact —, 155 algebraically supercomplete —, 155 cartesian —, 28 cartesian closed —, 33 cartesian closed 2- —, 24 dual —, 33 extensive —, 114 free V- —, 40 free Cpo- —, 25 free Poset- —, 25 functor —, 38 involutory —, 138 monoidal —, 27 monoidal closed —, 33 parameterised algebraically compact

—, 137 parameterised algebraically complete

—, 129 partial cartesian —, 100 partial cartesian closed —, 104 symmetric monoidal —, 32 underlying —, 31 unit V- —, 31 well-powered —, 43 characteristic map, 48 classifier

D- —, 48

— of partial maps, 48 closed

cartesian — 2-category, 24 cartesian — category, 33 monoidal — category, 33 partial cartesian — category, 104

colimit Cpo- —, 26 Poset- —, 26

colimits

pseudo-creation of —, 120 compact

algebraically — category, 137 parameterised —, 137

complete

algebraically — category, 127 parameterised —, 129

complete object, 188

composition horizontal —, 22 vertical —, 21

computational

— adequacy, 201 — Theorem, 222

— soundness, 200 — Theorem, 201 contextual approximation, 58 Contraction Lemma, 237, 251 contravariant functor, 33 ω-convergent, 154

initially —, 153 Cpo, 8 Cppo, 4 Cppo_{⊥}, 9

dinaturality, 132 Dom, 105 domain

— of definition, 46

— structure, 43 Cpo- —, 62 Poset- —, 62 uniform —, 75

domain theory axiomatic categorical —, 5 synthetic —, 51, 231

doubling trick, 138 dual category, 33

e-initial object, 156 embedding, 118 end, 36

counit of an —, 36 endofunctors suffice, 148 ep-pair, 118 ep-zero object, 156 exponential

partial —, 101 extensive category, 114 extraordinary natural transformation, 36

fixed-point operator uniformity, 168, 226 parameterised —, 191 strict —, 170, 207 formal approximation, 201 FPC

— expression contexts, 174 — expressions, 174

— type contexts, 173

— types, 173 free

V-category, 40 Cpo-category, 25 Poset-category, 25 full morphism, 65, 67 functor

— category, 38

V- —, 30 2- —, 23 Cpo- —, 25 Poset- —, 25 contravariant —, 33 inclusion —, 45 inverse image —, 46 lifting —, 50 partial-inclusion —, 45 pseudo-symmetric —, 140 representable —, 34, 38 representation of a —, 47

Gpd, 28

graph inclusion order, 64

Hil_{ω}, 154 hom

internal —, 33 horizontal composition, 22 identity

partial —, 74 inclusion functor, 45 initial

maximally — algebra, 160 internal hom, 33 interpretation of FPC

— expression contexts, 181

— expressions, 182

— types, 179 non-standard — types, 212

inverse image functor, 46 involutory category, 138 Isos_{K}, 44

Kind, 167

Lambek’s Lemma, 127 lax

— algebra morphism, 159

— natural transformation, 27 LCF, 3 least element, 189 lifting functor, 50 limit

V- —, 40 Limit/Colimit Coincidence, 120 Loc, 234

models of FPC, 186 K_{∗}- —, 186 V- —, 178 absolute Cpo- —, 210 domain-theoretic —, 186

monoidal — category, 27

— closed category, 33 symmetric — category, 32

Monos_{K}, 44 morphism

full —, 65 lax algebra —, 159 symmetric —, 139, 143 upper-closed —, 65

natural transformation V- —, 30 2- —, 24 admissible —, 110 cartesian —, 56 extraordinary —, 36 lax —, 27 partial inclusion —, 110

object complete —, 188 e-initial —, 156 ep-zero —, 156 p-terminal —, 156 special invariant —, 158 symmetric —, 143 unit —, 28 zero —, 11, 91

ω+1, 45 one variable suffices, 149 Open, 44 order

approximation —, 58, 59 graph inclusion —, 64 specialisation —, 60 p-terminal object, 156 pairing

partial —, 92 pωAlgCpo, 105 parameterisation, 129 parametricity, 196 partial

— cartesian category, 100

— cartesian closed category, 104

— exponential, 101

— identity, 74

— inclusion, 45

— inclusion natural transformation, 110

— map classifier, 48

— pairing, 92 bicategory of — maps, 100 category of — maps, 44

PCF, 3 pCpo, 7, 42 pDom, 105 Permutation Lemma, 236, 248 Pfn, 11 Pin_{ω}, 154 PKind, 163 Poset, 25 PowerLoc, 235 PPλ, 3 Pposet, 157 pPoset, 42 Pposet_{⊥}, 157 product

tensor —, 28 Product Theorem, 132, 138 program, 177 projection, 118 pseudo-creation of colimits, 120 pseudo-symmetric functor, 140

R-Mod, 28 \overline{ℝ}_{+}, 28 Rel, 167 representable functor, 34, 38 representation, 196

— of a functor, 47

semantics of FPC denotational —, 179 operational —, 176

Set, 28 Set_{ω}, 127 SFP, 233 Σ, 8 soundness

computational —, 200

computational — Theorem, 201 special invariant object, 158 specialisation, 60 standard ω-chain, 153 strict map, 190 Subject Reduction, 177 Substitution Lemma, 181, 216, 238, 253 supercompact

algebraically — category, 155 supercomplete

algebraically — category, 155 symmetric

— morphism, 139, 143

— object, 143

— monoidal category, 32 symmetry, 32

tensor product, 28 Top, 28 total maps

category of —, 43 type

inductive —, 126 recursive —, 135

underlying category, 31 Unique Type Lemma, 175 unit

— V-category, 31

— object, 28 upper-closed morphism, 65, 67

values, 177 vertical composition, 21

well-powered category, 43

Yoneda Lemma, 34

zero object, 11, 91 Index 279

Symbol Index

Chapter 1

⊏ ∼ , 7 ; ≃, 7 ; ⊏ ∼ , 9 ; Σ(P), 9 ; ⊑, 10 ; ×, 11 ; ⊗, 11  ⇀ ⇀, 11 ; F_{E}, 12 ; C_{E}, 12 ; pλ, 14 ; pfix , 14 ; fix , 14

Chapter 2

C_{0}, 21 ; η : F \underrightarrow{.} G : A → B, 24 ; 1, 24 ; A × B, 24 ; [A, B], 24 ; K_{V}, 25 ; 1, 25 ; K × L, 25 ; [K, L], 26 ; χ : F ⊣ U : K → L, 26 ; η : F \underrightarrow{.}_{≤}G : K → L, 27 ; (V_{0}, ⊗, I, l, r, a), 27 ; V, 29 ; M_{A,B,C}, 29 ; j_{A}, 29 ; Uα, 31 ; αT, 31 ; I, 31 ; ( )_{0} : V-CAT → CAT, 31  F_{0} : A_{0} → B_{0}, 32 ; α_{0}, 32 ; c_{X,Y}, 32 ; A^{op}, 33 ; ⊗ Y, 33 ; [Y, ], 33 ; A(A, ), 34 ; A( , B), 34 ; η, ε : F ⊣ U : A → B, 34 ; A ⊗ B, 35 ; T (A, ), 36 ; T ( , B), 36 ; ∫_{X∈ | A |} T (X, X), 36 ; [A, B], 37 ; E : [A, B] ⊗ A → B, 38 ; ( ) · I, 40 ; ( )_{V}, 40 ; KA, 40 ; (lim Γ, π), 40

Index 280

Chapter 3

n^{∗}f, 42 f^{−1}(n), 42 ⊏ ∼ , 42 ≃, 42 (K, D), 43 D(A), 43 [m] ⊆_{i} [n], 44 m ⊆_{i} n, 44 X ↾ O, 44 p(K, D), 44 pK, 45 →, 45 ⇀, 45 J : K → pK, 45 u ↓, 45

( )^{R} : D^{op} → pK, 45
u^{−1}[n], 46
D : pK^{op} → Poset, 46
u^{−1}(m), 46
n^{∗}u, 46
dom_{A,B}, 46
Q_{⊥}, 48
L : pK → K, 50
η, ε : J ⊣ L : pK → K, 51
⊏ ∼^{c} , 58
⊑^{c}, 58
⊏ ∼^{s} , 60

Chapter 4

⊑, 62 ; ⊏ ∼ , 62 ; [m, f] ⊏ ∼_{i} [n, g], 64 ; ⊆, 64 ; ⨆ ⟨[m_{k}] ⊆ [m_{k+1}]⟩ = ⟨[m_{k}] ⊆ [m]⟩, 70 ; ⟨m_{k}⟩ : ⟨i_{k}⟩ \underrightarrow{.} A, 71  ⟨f_{k}⟩ : ⟨i_{k}⟩ \underrightarrow{.}_{≤}B, 71 ; m : ⟨μ_{k}⟩ → ⟨m_{k}⟩, 71 ; F_{k}, 72 ; i_{k,l}, 72 ; [ , ] : D(A) → pK(A, A), 74 ; U : Σ_{A ∈ |D|}D/A → K , 75

Chapter 5

⟨⟨ , ⟩⟩, 92 ; ⟨ , ⟩, 92 ; [D ↣ B, D → A], 93 ; ×, 94 ; ⊗, 94 ; 𝕃, 100 ; ⇀ ⇀, 101 ; ε, 101 ; pλ, 101  [ , ], 114 ; f ⊣ g, 118 ; f^{R}, 118 ; g^{L}, 118 ; C_{L}, 118 ; C_{R}, 118 ; C_{A}, 118 ; C_{E}, 118 ; C_{P}, 118

Chapter 6

Fix (F), 126 F -Alg, 126

h : (A, α) → (B, β), 126

(F_{0}^{†}A, ι_{A}^{F_{0}}), 128 η^{†}, 130 ( )^{†}, 131 Fix , 131

Inv(C, ( )^{∘}), 139 f_{i}, 139

Ă, 140 ( )^{§}, 140 f̆, 140 ( )^{x}, 143 ρ, 143 (F_{0}^{‡}, φ^{F_{0}}), 145 ψ, 146 Δ_{F}, 153

Chapter 7

fix , 159 ; F -Alg_{≤}, 159 ; h : (A, α) ⟶_{≤}(B, β), 159  A_{≤}^{𝕋}, 160 ; [A, B]_{≤}, 164 ; B ∘→ Y, 168

Chapter 8

T, 172 τ_{1} + τ_{2}, 172 τ_{1} × τ_{2}, 172 τ_{1}⇀ ⇀τ_{2}, 172 μT.τ, 172 x, 172

inl_{τ_{1},τ_{2}}(e), 172 inr_{τ_{1},τ_{2}}(e), 172 ⟨e_{1}, e_{2}⟩, 172 fst(e), 172 snd(e), 172 λx : τ.e, 172 e_{1}(e_{2}), 172

intro_{μT.τ}(e), 172

elim(e), 172

Nat, 173

NatList, 173

Lambda, 173

Θ ⊢ τ, 173 Θ ⊢ Γ, 174

Θ, Γ ⊢ e : τ, 174

Z_{σ,τ}, 175 Θ, Γ ⊢ e ⇝ v : τ, 177 Θ, Γ ⊢ e ✓ : τ, 177

\underline{+}, 178 \underline{⊗}, 178 \underline{⇀ ⇀}, 178 L̆, 179 F̆, 179 ( )^{§}, 179 F˘˘ , 179

\underline{[[Θ ⊢ τ]]}, 179 F_{i}, 180 η_{i}, 180

[[Θ ⊢ τ]], 180

β, 181 ; \underline{[[Θ ⊢ Γ]]}, 181 ; [[Θ, Γ ⊢ e : τ]], 182 ; K_{∗}, 189 ; ρ_{A}, 189 ; ⊥_{A}, 189  A ∘→ B, 190 ; K_{∗,⊥}, 190 ; f^{†}, 191 ; ([v]), 196 ; [[Θ ⊢ τ]]_{R}, 198 ; [[Θ ⊢ τ]]_{D}, 198

Chapter 9

Values(τ), 203 Programs(τ), 203

| R(τ) |, 203 ⪯, 203 ≾, 203 +_{σ,τ}, 203 ⊗_{σ,τ}, 203 ⇀ ⇀_{σ,τ}, 203

R(τ), 204
𝕀_{μT. τ}, 205
𝔼_{μT. τ}, 205
pK(τ), 209
σ⃗, 213
[Θ ↦ σ⃗], 213
⟨[Θ ⊢ τ]⟩(σ⃗), 213
⪯_{τ} ⊆ K(1, [[⊢ τ]]_{2}) × Values(τ), 217

Chapter 10

(⟨⟨[τ]⟩⟩, ≪_{τ}), 227 κσ⃗ ; Θ⊢τ, 228

K_{chain-open}(D), 232
K_{+}(D), 233