Recursive Domains, Indexed Category Theory

and Polymorphism

Paul Taylor

1983–7

A dissertation submitted for the degree of Doctor of Philosophy at the University of Cambridge

also

for the Summer 1986 Prize Fellowship Competition at Trinity College, Cambridge

\begin{matrix}c \\ ◯ \end{matrix} copyright Paul Taylor, August 1986

I hereby declare that my thesis entitled Recursive Domains, Indexed Category Theory and Polymorphism is not substantially the same as any that I have submitted for a degree or diploma or other qualification at any other University. I further state that no part of thesis has already been (or is being) concurrently submitted for any such degree, diploma or other qualification.

Further,

I declare that the results presented herein are the product of my own original research where claimed as such. This qualification will be explained in the Introduction.

During the course of my research I have been supported financially by the Science and Engineering Research Council, Trinity College and the Department of Pure Mathematics and Mathematical Statistics.

This dissertation (in particular Chapter V) has been revised somewhat since submission.

This work is dedicated with love to the guardians of my sanity

James Annett Mark Dawson

Ellie Mayger (née Clarke) Mike Mayger Fiona Miller Shane Voss Ian White

without whose support it would never have happened. iv

Introduction

Let me begin by confessing that this is a very eccentric document. It aims to do two things. First, of course, it sets out some original constructions, primarily of a “type of types” in certain categories whose objects have come to be known (rather unimaginatively) as domains, but also of various other things in such categories. Second, however, which is a departure from custom as far as Ph.D. or fellowship dissertations are concerned, it attempts to give an introduction to a substantial but largely undocumented body of knowledge among (certain) Mathematicians, namely Categorical Logic, which has very recently been found to be of considerable importance in Theoretical Computer Science.

Category Theory, I like to say, is a tourist subject. It started in Group Theory, but was only taken seriously when Frank Adams needed it to discuss constructions in Topology; after that it visited Linear Algebra, Universal Algebra, Automata Theory and Algebraic Geometry. At the last of these it met Logic and turned into Topos Theory. The journey to that stage was undertaken (almost) entirely in the company of mathematicians, who could perhaps be expected to understand the significance of the souvenirs, and in particular the geometrical language. Now that it has arrived in Computer Science, however, I feel that some basic discussion of what it’s all about is called for. This is what I have been trying to do.

I have a strong conviction that when one has begun to understand something which is understood by few other people then it is one’s duty to formulate on paper that understanding (in whatever terms one has found useful) for the benefit of others trying to do likewise. Moreover I have an habitual urge to do so. This is my defence for the length and verbosity of this work.

This policy also requires me to apologise to the originators of the results, and other practitioners of the subject far more expert than myself, for tiring them with the necessity of reading my misrepresentations. This I freely do.

I have also included a lot of standard Domain Theory, starting with the Lambda Calculus. This is not a thesis about the Lambda Calculus! This is because I disagreed with some of the existing terminology and because I wished to push the results as far as I could. Also, in Chapter V I wanted to be able to assume that a category of domains was of the form Retr(Λ); this explains my preference for continuous rather than algebraic domains.

Since much of the bulk of the work is therefore “standard” material, a notation is called for to indicate what is original. This is done by means of a “+” before the number of the section. The other sections I claim for the most part to be an original account of their subject, though occasionally I have marked sections “−” by way of confession of having forgotten the proof of the result in question. In some cases originality means improvement (or in a few cases rediscovery) of an existing result; here credit has been given in apparent contradiction to the mark on the section.

Certain results in this work have been designated as Facts. (Specifically in §§1.1.13, 1.2.11, 2.2.11, 2.5.8.) This indicates an original result which I have not had time to write up.

The most substantial of these is a technique for dealing with large filtered diagrams in a small category (where we just say “cardinality” in a poset), the proof of which would have taken ten pages. [Postscript: This result is a factorisation system which is similar to that of any functor into a final functor followed by a discrete fibration [Street & Walters, 1973?]. The difference is that the first part of my factorisation is also regular epi whilst the second is characterised by a condition I called cosignposted; the latter places a bound on the size of the intermediate category in terms of that of the codomain, whilst the former retains the property of final functors that they yield equivalent filtered colimits. The final-fibration factorisation for functors which preserve connected limits is the same as that giving Diers’ spectrum and Berry’s trace.]

I also have another result whose proof is of a similar length but which is not mentioned in the text. This is that an interpretation by means of partial maps can be given to s simple imperative language (including a while construct) in a category with certain finitary exactness conditions. Specifically, we use equalisers of a form in which one of the maps is a mono to interpret the while; the important stage is the proof (in an elementary topos, though the category itself does not need higher order logic) that a certain graph has the diamond property and hence that the map from the equaliser to the coequaliser of a pair of maps one of which is mono is mono. There is no mention of anything of an infinitary nature in this proof: it uses the adjoint functor theorem in the way in which §4.4 tries to indicate that it can be used to replace infinitary arguments.

The history of Computer Science from Babbage onwards is one of generalisation and abstraction. Foremost among the ideas are those of subroutines and high-level (i.e. machine-independent) languages, enabling the essence (algorithm) of some process to be expressed without reference to either its application or implementation. As programs become ever more complicated, it becomes necessary to provide formal rather than ad hoc techniques for understanding them and proving them correct. This is the rôle of Mathematics, specifically Category Theory, in theoretical Computer Science.

The major languages which were available for programming until the end of the 1960s were imperative, which is to say they set out precisely how — and in particular in what order — the operations were to be performed. The exception to this was LISP. This was nominally based on the λ-calculus, a mathematical tool for the study of recursion with its origins in symbolic logic. LISP and modern theoretical languages are called functional because they express only the behaviour of the program as a function from inputs to outputs, abstracting away details of sequencing just as earlier high level languages had hidden space allocation. This change shifts the emphasis as regards the meaning of the program from the operational to the mathematical viewpoint. It also places functions on the same footing as data items. Also, whereas the imperative style provided recursion (inductive definition) by means of program loops or jumps, the functional style expresses the function as a solution of an equation. This is always of a specific form, a fixed point, so for instance the factorial function is the fixed point of

f ↦ (n ↦ \begin{cases}1 & if n = 0 \\ n × f(n − 1) & otherwise \end{cases} )

which is a function ℕ → ℕ. Since we have placed no restriction on the nature of this function (and cannot, because of the Halting Problem), the domains on which it is defined cannot be ordinary sets.

Another feature of some of the modern languages is polymorphism, which is the abstraction of the function away from the types of its arguments; for instance the same code may be used to calculate determinants of matrices with either real or complex entries. Stronger forms of polymorphism may also be contemplated, as far as asking for a type of all types.

It is clear that concepts such as these cannot be expressed straightforwardly in terms of discrete sets. We can express them in the same way as is customary in existing imperative programming practice, namely operationally. However to do this rigorously we more or less have to invent or describe a particular machine, and this immediately loses the abstraction which we have tried to gain.

In the absence of recursion there are mathematical interpretations of functional languages and even polymorphism naturally provided by category theory. The former is clearly described by a cartesian closed category, which has an exponential or function space operation. The determinant example above, which is uniform over the ring definition, is reminiscent of the naturality of the double dual in Linear Algebra which led Eilenberg and Mac Lane to category theory. In fact this example can be used to motivate the idea of a classifying topos. Once we include recursion this approach breaks down; the λ-calculus, for instance, had no naturally occurring model before Scott replaced function by continuous function and built the so-called D_{∞} and P ω models. This led to the notion of a domain, which is a particular kind of space in which recursion by means of fixed points is possible. P ω, also provides an ad hoc model for recursion. Following this there was considerable work in the theoretical computer science community on extending the Scott-Strachey programme to nondeterministic and parallel languages.

The major aim of the present work is the discussion of polymorphism. This idea arises in a spectrum from the “uniform constructions” such as the determinant which may be expressed in terms of categorical techniques motivated essentially by the category of sets, to the most extreme form in which we admit the type of all types as a first class type itself. Of course this approach has frequently led to contradiction in the past.

We begin by establishing the major standard results in the theory of domains. The first chapter looks at the λ-calculus, the category of retracts, the P ω model and various notions of fixed point.

Chapter II moves to categories of domains and solutions of recursive domain equations. Having provided a definition of a category of domains, it shows that any such arises as a category of retracts.

In chapter III the various forms of polymorphism are discussed. We find that indexed category theory is the appropriate tool for discussing them all. A notion of “quantification” over types (where we consider the identity not to be a function which exists separately once for each type, but has a type “∀X.X → X”) is found to correspond to completeness of the category in the sense of having all “small” products.

Chapter IV reformulates indexed as fibred categories, presenting a body of standard theory not currently well represented in the literature. This was motivated by the category of sets, but the present treatment makes certain generalisations, in particular by removing the requirement for all pullbacks (since categories of domains do not possess them) to give the notion of a relatively cartesian closed category.

In chapter V original material finally forms the major part, where the foregoing theory is applied to categories of domains. Whereas the only model with a type of types currently to be found in the literature is that based on P ω, we find that any category of domains in fact possesses one. Moreover the crudity of the manner of construction shows that models of this nature abound.

Many previous formulations of universal sets and types of types have fallen to contradiction. We present a new paradox along these lines, which essentially shows that the three notions of equality, function spaces and type of types (at least as they are understood in category theory) cannot coexist. The model constructed in chapter V fails to express equality, and indeed most of the traditional notions in logic (comprehension, conjunction, disjunction and negation) are also necessarily absent from it.

As the main conceptual contribution of this work, I offer the notion of a continuous typedependence. Of course we have to pluck something out of the air as a definition for this, but I believe that certain pieces of evidence strongly justify my choice.

First, it is naturally suggested by examination of the obvious idea with the category of retracts (§5.1.13).

Second (§5.2.2), it proves to be the only thing which works (contrary to the claim of my Surrey paper [1986]).

Third, it also works in arbitrary categories of boundedly complete domains (§5.2.9). Though we have a better grasp on these than on arbitrary posets, there is likely to be quite a rich structure in the hierarchy and our ability to deal with fibrations of them seems a remarkable coincidence. Conversely this partly justifies my rather perverse maintainance of such a wide range of categories of domains; on the other hand there is this apparent correspondence with fragments of logic and perhaps there is some “semantic complexity” notion to be found.

I should like to make a few personal comments on the subject.

It will be apparent that I consider myself a Mathematician rather than a Logician (I shall avoid the question as to whether I am a Computer Scientist), in the sense that it is tangible mathematical objects (models) which interest me and not the manipulation of syntax. In fact syntactic discussion of polymorphic languages is decidedly thin in this work. As regards the “denotational semantics” of programming languages, I lost (or rather, suspended) my faith in the applicability of these techniques some two years ago; my interest in the subject is in the remarkable mathematical behaviour of categories of domains.

I have perhaps been less than courteous to some of its other practitioners. I apologise for this. However it would appear that Scott’s original P ω and D_{∞} constructions [1972] and his Data Types as Lattices paper [1976], together with the work of Smyth and Plotkin on recursive domain equations [1978] account for most of what has been done as far as semantics, i.e. the provision of mathematical objects in which to explain things, is concerned. I am of the belief that Chapter V of the present work is the first model of a type-of-types since 1976. Moreover I further claim that it is the first (ever) to attempt to explain its own existence (I cannot help but regard V in P ω as an accident). This in no way detracts from the value of the [1976] paper, indeed it is a veritable goldmine containing many nuggets of which I personally have very little understanding and which are sure to lead to many further major contributions to the subject.

I should also like to offer a piece of friendly advice to anyone who might attempt in the future to study Domain Theory. It is this.

Does your conjecture make any nontrivial statement about finite posets?

If so, then it’s false: look for the counterexample.

On the other hand the remarkable fact about categories of domains is that we seem never to have to worry about questions of size; indeed this (the fact that the function-space of a continuous lattice is essentially no bigger than the given lattice) is what led Scott into the subject in the first place. In other words, the existence of a type-of-types is no particular surprise.

Finally I should like to acknowledge those who have assisted and advised me during the past three years. Foremost among these is Martin Hyland, whose badgering led to my thinking and subsequently writing about Polymorphism in the first place. Many ideas of his have found their way into this text, and though the style of chapter III is not what one usually expects in Mathematics (and in no way is he to be blamed for it), this is where most of them have come to rest. Chapter IV is the result of the influence of my supervisor, Peter Johnstone; indeed it is an account of his Michaelmas 1982 Part III course). Then there are (with a little licence) the members of the joint DPMMS and Computer Laboratory seminar, Mike Abbott, Jon Fairbairn, Thomas Forster, Carl Gunter, Alan Mycroft, Larry Paulson, Edmund Robinson, Giuseppe Rosolini, Glynn Winskel and others. Outside Cambridge, I have had most enlightening discussions with Samson Abramsky, Mike Fourman, Eugenio Moggi, Andrew Pitts, Mike Smyth, Steve Vickers and Gavin Wraith. All these people I should like to thank for their patience with my troublesome manner and eccentric approach. Finally Chris Thompson of the Computing Service has provided more help with “TEX” than I have had time to use.

Postscript, February 1987: The dissertation as presented here has been revised somewhat since its original submission. The main change is that most of the last chapter has been rewritten, and in particular the proofs have been reworked. This is the fruit of my attempting to explain the work to my new colleagues at Imperial College (in particular Samson Abramsky, Yves Lafont, Luke Ong, Axel Poigné, Mike Smyth and Steve Vickers). During this time I have also had the pleasure of meeting Gordon Plotkin for the first time, and there are a few comments in §2.5 resulting from this. This document has behaved rather like a large piece of software, always in need of maintainance and departing rapidly further away from perfection. I should like to apologise to all those to whom I promissed copies six months ago for succumbing to the temptation to keep revising it, and to those who read it now for the many residual errors. Finally I should like to record my appreciation to my examiners, Gavin Wraith and Glynn Winskel for their patience in reading (and approving) my thesis.

March 1991: Despite its many errors and idiosyncracies, there still remains demand for copies of this dissertation. I would like to apologise to those who asked for copies of it as long as three years ago. The reason why it has been “out of print” is that it was originally written using a bug-ridden wysiwyg word processor and translated into “plain TEX”; the latter relied upon a collection of ad hoc additional macros, which after a while ceased to work. It has now been translated into L^{A}TEX, and as a result has got its index back, though the bibliography is rather inaccurate and out of date. All of the diagrams (some of which were literally “scissors and paste” inclusions) have been redrawn. To any reader who is thinking of writing a book using some wysiwyg word-processor and translating it, I have a simple word of advice: don’t.

During this intervening time, of course much has happened in domain theory and polymorphism. A whole new kind of domain theory, characterised by wide pullbacks in addition to the filtered colimits which characterise the kind discussed herein, has seen its rise, fall and renaissance. My own interest now lies in the synthetic kind of which the Effective Topos is the most famous model.

The axiomatisation of categorical models of polymorphism introduced here (relatively cartesian closed categories) has become standard, and has been developed by several authors, notably Thomas Ehrhard and Thomas Streicher. The problem of the largest cartesian closed category of algebraic IPOs has also been solved by Achim Jung, whom I would also like to add to the foregoing list of acknowledgements (both as a colleague and as a friend).

January 1992: It is inappropriate to make alterations to a thesis, or to any document which has been overtaken by history or changes in its author’s style. However before catching up with the requests for copies mentioned above and making the text available by FTP

              theory.doc.ic.ac.uk     /theory/papers/Taylor/thesis

I have decided to remove a number of fallacies. These have been replaced by counterexamples or references where available, and I am particularly grateful to Achim Jung for his assistance with many of these corrections. In the interests of historical accuracy I have left markers admitting to my mistakes and have resisted the temptation to give any generalations or anachronistic references. In several cases sketchy proofs here are filled in in my unpublished 1987 paper, Homomorphisms, bilimits and saturated domains, which is also available by FTP as bilimits. x

Contents

1 Categories with Models of the Lambda Calculus 1 1.1 Lambda Calculus and Combinatory Algebra . . . . . . . . . . . . . . . . . . . . . . 1 1.2 Retracts, Monoids and Cartesian Closed Categories . . . . . . . . . . . . . . . . . . 7 1.3 Typing Lambda Terms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 1.4 The Graph Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 1.5 Fixpoint Properties in Categories . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24

2 Categories of Domains 31 2.1 Inductive Partial Orders . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31 2.2 The Limit Colimit Coincidence . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37 2.3 Continuous Lattices and Posets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45 2.4 Bifinite Posets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50 2.5 The Hierarchy of Categories of Domains . . . . . . . . . . . . . . . . . . . . . . . . 58 2.6 Saturated Domains . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65

3 Type Polymorphism 73 3.1 Types are First-Class Citizens . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73 3.2 Semantics of Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78 3.3 Generic Constructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86 3.4 Polymorphic Lambda Calculus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92 3.5 Strong Polymorphism . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95

4 The Indexed Category Theory of Sets 101 4.1 Indexed Families, Products and Coproducts . . . . . . . . . . . . . . . . . . . . . . 101 4.2 Fibred Categories . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106 4.3 Relatively Cartesian Closed Categories . . . . . . . . . . . . . . . . . . . . . . . . . 114 4.4 The Adjoint Functor Theorem and Toposes . . . . . . . . . . . . . . . . . . . . . . 120

5 Polymorphism in Domains 125 5.1 Indexed Category of Retracts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125 5.2 Indexed Categories of Domains . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 131 5.3 Categories of Fibred Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 138 5.4 Indexed Domain Theory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143 5.5 Equality, Function-Spaces and Type-of-Types . . . . . . . . . . . . . . . . . . . . . 146 5.6 Type of Types in Domains . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 151 5.7 Interpretation of Polymorphism . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 155 5.8 General Theory of Typoses . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 158

Bibliography 161

Chapter 1

Categories with Models of the Lambda Calculus

1.1 Lambda Calculus and Combinatory Algebra

§1.1.1 This chapter is largely concerned with Church’s Lambda Calculus, and how it may be used to obtain a category of domains; the next chapter discusses the latter in the abstract. The λ-calculus is to be regarded in this work as a vehicle for other study rather than the prime object of interest. Though most of the material is standard, we wish to establish notations and conventions and make appropriate remarks concerning its relevance to later parts of the work.

The λ-calculus is concerned with the behaviour of functions under application rather than composition as in category theory. It comes in two forms, typed and untyped. The typed λcalculus is simply a syntax for cartesian closed categories. A model of the untyped λ-calculus would be a set Λ whose function space Λ^{Λ} is a retract of Λ; though this is clearly impossible for discrete sets by cardinality, the purpose of the first three sections is to justify this as a definition. Here every function has a fixed point, which enables us to interpret recursion, indeed there is a uniform way of assigning such fixed points.

We have already stumbled upon the major concepts to be discussed in this chapter (indeed most of those with which the work is concerned), namely retracts, cartesian closed categories, fixed points and typing. We shall also discuss a popular naturally occurring model, known as the P ω model.

For a comprehensive treatment of the λ-calculus see Barendregt [1981], Koymans [1984] and Lambek & Scott [1986]. Basic category theory will be assumed without comment: see Mac Lane [1971] or Arbib and Manes [1975].

§1.1.2 Here is the definition in a “telegraphic” form; for more detail see Barendregt §2.1. P_{f} denotes the finite powerset, i.e. the set of finite subsets of a set.

Suppose we have an arbitrary collection Σ of symbols (variables), along with the ability to generate a (countable) potential infinity of additional ones. We shall often write x⃗ for a set of variables, usually intending it to be the string x_{1}, x_{2}, ..., x_{n}.

By a simultaneous recursion we define the set Λ^{+}[Σ] of raw lambda terms in the variables Σ, the function FV : Λ^{+}[Σ] → P_{f}(Σ) assigning to a term its set of free variables and the function (−)[− := −] : Λ^{+}[Σ] × Σ × Λ^{+}[Σ] → Λ^{+}[Σ] which is the substitution in one term, for all free occurrences of a certain variable, another term.

if...  then... ∈ Λ^{+}[Σ] with FV = ... and − [y := c] = ...
x ∈ Σ, x = y  x  {x}  c
x ∈ Σ, x ≠ y  x  {x}  x
a, b ∈ Λ^{+}[Σ]  (ab)  FV(a) ∪ FV(b) (a[y := c]b[y := c])
a ∈ Λ^{+}[Σ ∪ {x}], x = y  (λx.a)  FV(a) \ {x}  (λx.a)
a ∈ Λ^{+}[Σ ∪ {x}], x ≠ y  (λx.a)  FV(a) \ {x}  (λx.a[y := c])

where, in the last case, x ∉ FV(c).

With the syntax strictly as above, there is a unique way of parsing a term, i.e. proving that a given string is indeed a raw λ-term. The substrings of a term which arise in this parsing are called subterms. We shall adopt the usual abbreviations:

abc  means (ab)c
λx.ab means λx.(ab)
λxy.a means λx.(λy.a)

In fact juxtaposition will be used throughout the work to mean application, composition in a category being denoted by a semicolon (;) and written right-handedly.

A raw λ-term a is closed if FV(a) = ∅. If Σ ⊂ Σ′ then Λ^{+}[Σ] ⊂ Λ^{+}[Σ′] in a natural way, and the subsets of closed terms are identified. Consequently the set of closed lambda terms is independent of Σ, and is written just Λ^{+}. Λ^{+}[Σ] is then seen as the extension of Λ^{+} by Σ.

§1.1.3 The intended meaning of the term λx.a is that function which, to the argument u, assigns the value a[x := u]. The process of replacing a (specified) subterm ((λx.a)u) by the corresponding (a[x := u]) is called a beta conversion, and a string of raw λ-terms in which each is obtained from the previous one by a β-conversion is called a beta transition.

Since we have defined β-conversion with respect to subterms, β-transition and substitution are compatible, and the equivalence relation generated by the existence of β-conversions is a congruence of the application and abstraction operations. We call it beta equivalence.

The quotient sets Λ[Σ] and Λ of Λ^{+}[Σ] and Λ under β-equivalence are called the sets of λ-terms, or sometimes λKβ-terms.

In Λ[Σ] we then have (λx.a)u = a[x := u].

Throughout we shall use Λ (as opposed to Λ) for a model of the λ-calculus (whatever that is). Λ is called the (classical) closed term algebra and Λ[ℕ] the open term model.

A raw term from which there is no nontrivial transition is said to be in normal form. A raw term from which there is a transition to a normal form, or a term with such a raw representative, has a normal form.

§1.1.4 We shall have occasion to define a variety of special λ-terms, of which the first are

K = λxy.x  constant
S = λxyz.xz(yz)
I = λx.x = SKK identity
Y = λf.(λx.f(xx))(λx.f(xx))  fixpoint
⊥ = (λx.xx)(λx.xx)  = (SII)(SII) = YI  bottom
P = λfgx.g(fx)  = S(K(S(S(KS)K)))K  composition
Q = λfgax.ga(fax)  fibred composition
⟨⟩ = λxyz.zxy  pairing
0 = λxy.x  = K  left projection
1 = λxy.y  = KI  right projection

The combinatory expressions for these things get much longer, so we shall desist from quoting them in future. The reason for switching the arguments of P (in other words not using the better known B = λfgx.f(gx)) will become apparent in §5.1.4. We shall adopt the convention of printing special combinators such as these in sans-serif Roman type, and variables in italics.

Warning The letter P (for Paul, Powerset, Pair, Product, Pullback) appears in six different fonts in this work, apart from those which have already appeared in this sentence, namely: P PPpPP. In §5.1.4 we shall see that P = P!

Question Why is the S combinator so-called?

Achim Jung (20 February 1991) says that

“The answer is in Schoenfinkel’s paper from 1924 (Mathematische Annalen 92), where combinators are introduced for the first time. S stands for VerSchmelzungsfunktion (amalgamation function), because it allows to express that two occurrences of a variable are indeed the same variable, i.e. the two occurrences are amalgamated. Schoenfinkel’s paper is fun to read; it has been translated into English.

Why did he not use V? There was another combinator called Vertauschungsfunktion (exchange function).

§1.1.5 The consistency of the above formalism is guaranteed by a major classical result known as the Church-Rosser Theorem. (Barendregt §11.1)

Proposition β-transitions have the diamond property that if a → b and a → c then for some d, b → d and c → d. □

Theorem Λ is not degenerate. Proof K and S are distinct normal forms and so are not identified under β-equivalence. □

In fact β-reductions may be put in a standard form to give the morphisms of a category with pushouts (Barendregt exercise 12.4.4). The “upside-down” diamond property fails.

§1.1.6 There is a remarkable λ-term, sometimes known as the “paradoxical combinator”, which provides a fixed point of (application of) any element.

Lemma For any f ∈ Λ, f(Yf) = Yf. Proof There is a β-transition from Yf to f(Yf). □

There are other such operators for which the transition is in the more natural direction; indeed there is an infinity of fixpoint operators, which are precisely the fixed points of G = λyf.f(yf) = SI.

§1.1.7 The importance of the λ-calculus lies in the fact that it can be used to code recursive (computable) functions. Turing [1936] motivated his own definition of computability and subsequently [1937] showed its equivalence with λ-definability.

Briefly (see Barendregt §6.3), primitive recursive functions are built up from zero (Z), successor (N), if-zero (?) and product projections together with that if f(−), g(−, −, −) are primitive recursive then so is h(−, −) where h(0, n⃗) = f(n⃗) and h(k + 1, n⃗) = g(h(k, n⃗), k, n⃗). Then the recursive functions are those given by adding searching (minimalisation in the literature), so if f(−, −) is recursive then so is the partial function g(−), where g(n⃗) is the least k such that f(i, n⃗) is defined for each 0 ≤ i ≤ k and f(k, n⃗) = 0, if there is one; we write g = μf.

To code all this we of course need some numerals. For instance Church [1941] defined

n = λfx.f^{n}x

so

Z = 0 = KI, N = λxyz.y(xyz) and ? = λnxy.n(Kx)y

Using these it is an easy matter to code primitive recursive functions. For recursive functions we need a searching operator μ with g = μf, such as

μ = λfn⃗.Y[λhk.?(fkn⃗)k(h(Nk))]Z

§1.1.8 We wish to interpret the λ-calculus in a great variety of circumstances, in which we have far less in the way of logic than is available in the category of sets. In order to do this we reformulate it without mentioning variables (or at least without the variable-binding operator λ). [In fact it is possible to do what we intend whilst still carrying variables, by methods suggested in §§3.2.3-5 and 12-13, but this is more complicated. See also [Lambek & Scott, 1986].]

Lemma Λ, the set of closed λ-terms, is generated by K = λxy.x and S = λxyz.xz(yz) under application. Proof We define inductively on the structure of a raw representative the translation

[[λx.x]] = SKK
[[ab]]  = [[a]][[b]]
[[λx.a]] = K[[a]]  if x is not free in a
[[λx.ab]] = S[[λx.a]][[λx.b]]  otherwise
[[λxy.a]] = [[λx.[[λy.a]]]]

in which the left and right sides are β-equivalent. □

Definition A combinatory prealgebra is a set Λ with a binary operation • (“application”) and elements K and S satisfying Kab = a and Sabc = ac(bc) for all a, b, c ∈ Λ, where we adopt the usual convention that abc means (a • b) • c. It it common to add I = SKK.

There are then obvious notions of combinatory transition and of a free combinatory prealgebra on a set of generators (“variables”). This should not, however, be allowed to prejudice our view of what are morphisms of models.

Clarke et al. [1980] have put this to practical use, building a machine whose instruction set is essentially {S, K, I}. Curien [1983] considers combinators more closely related to the presentation in terms of cartesian closed categories (§1.3).

§1.1.9 We shall discuss the assignment of types to λ-terms in section 3. There is an obvious way to type I, K and S, namely P → P, P → (Q → P) and [P → (Q → R)] → [(P → Q) → (P → R)]. In §3.1.6 we shall mention briefly the connection between types and propositions. These types are familiar axioms of propositional calculus. Church’s numerals are typed (P → P) → (P → P).

A set Λ with a binary operation • is said to be combinatory complete if any definable function ϕ : Λ^{n} → Λ (i.e. expression involving •, elements of Λ and n variables) is expressable as fx_{1}x_{2}...x_{n} for some f ∈ Λ, i.e. ∀a⃗ ∈ Λ^{n}.fa⃗ = ϕ(a⃗).

Proposition (Λ, •) is combinatory complete iff there are K, S ∈ Λ such that (Λ, •, K, S) is a combinatory prealgebra. Proof

[⇒] x, y ↦ x and x, y, z ↦ xz(yz) are two such expressions.

[⇐] Use lemma 1.1.8 to express λx⃗.ϕ[x⃗] in terms of K, S. □

§1.1.10 We can speak of a combinatory prealgebra in any category C with finite products. It consists of an object Λ ∈ C and morphisms • : Λ × Λ → Λ and ⌜K⌝, ⌜S⌝ : 1 ⇉ Λ in C such that certain diagrams (expressing the various equations) commute, e.g.

(1 × Λ) × Λ ≅ Λ × Λ \overline{π_{0}} Λ

[figure: (Λ × Λ) × Λ; (⌜K⌝ × 1) × 1; • × 1; Λ × Λ; •]

Moreover if F : C → D is a functor preserving finite products then (F Λ, F •, F ⌜K⌝, F ⌜S⌝) is a combinatory algebra in D because F (simply by virtue of its being a functor) preserves the validity of the equations. Such a functor is the global sections functor F = C(1, −) : C → Set, which we shall sometimes call Γ or | − |. This notation with single vertical lines will be used for the underlying set (or its cardinality) of an object; double verticals will be used for the extension of a type (§1.3.4).

This will enable us to discuss models of the λ-calculus which are not discrete sets.

§1.1.11 The formulation of §§1.1.2-3 may be extended by adding constants and further equations. In particular, suppose we have a “model” A, whose underlying set we write as |A|. Then the term model Λ[|A|], in which we add a constant ⌜a⌝ for each element a ∈ A, has an interpretation in A. This will not however be faithful, i.e. some distinct terms will be set equal by it. We add to the theory these further equations and write Λ[A] for the resulting term model, which should of course be isomorphic to A.

We may now adjoin a new variable to a model, by making the further addition of a new symbol x. The term model Λ[A][x] we call just A[x]. The interpretation of A ≅ Λ[A] in A[x] is faithful. A[x] has the universal property that any interpretation of A in another model B may be extended uniquely to one of A[x] in which x is taken to an arbitrarily chosen b ∈ B.

To do the same for combinatory prealgebras is a standard easy piece of Universal Algebra.

§1.1.12 Unfortunately the translation from λ-terms to a combinatory prealgebra does not respect β-equivalence; for example KI and SK are clearly normal forms qua combinators, but as λ-terms they are equivalent [to λxy.y]. Combinatory prealgebras encapsulate application, but fail to represent abstraction, for which we require a canonical element f whose application to x yields f[x].

By definition in the λ-calculus, a = b implies λx.a = λx.b. A λ-term which “begins with a λ”, i.e. which has a representative of the form λx.a, we call functional.

Lemma

(a) A λ-term is functional iff it has a representative of the form K, S, Ka, Sa or Sab for some a, b.

(b) If f, g are functional terms (with representatives) in which x is not free, and fx = gx then f = g.

(c) A term with a representative beginning with a variable or ⊥ is not functional. Proof

(a) The combinatory translation of λx.a involves either the third, fourth or fifth clause in the proof of lemma 1.1.8, so is of one of these forms. Conversely there is a β-transition from each of these forms to a functional λ-term.

(b) W.l.o.g. f = λx.a, g = λx.b. Then a = fx = gx = b.

(c) The forms λx.a, xa_{1}a_{2}...a_{n} or ⊥a_{1}a_{2}...a_{n} are invariant under transition. Hence by the Church-Rosser theorem (proposition 1.1.5) these three forms are β-inequivalent. □

+§1.1.13 More generally we can say that a term has (at least) n + 1 arguments if whenever it is applied to any (at most) n new variables then the result is functional.

Fact Any λ-term has a representative recursively in the form λx⃗.ya⃗ or λx⃗.(λy.ya⃗)b⃗, and there is an algorithm to find such a representative for any raw term. □

The first form is called head normal, and a term with no such form is unsolvable; a raw term is in normal form iff it is recursively head normal. There is no algorithm to determine whether a term has a head normal form or not. The Böhm tree of a term is given by developing the head normal form of each subterm, putting ⊥ instead if it has none; this may of course be infinite. A combinatory algebra is sensible [Hyland 1976] if all unsolvable terms are identified.

Lemma A λ-term has exactly n arguments iff it has a representative in the form λx⃗.a where a is yb⃗ (possibly y is amongst the x⃗) or unsolvable. Proof By parts (a) and (c) of lemma 1.1.12. □

There are terms with 0, 1, ..., ∞ arguments. Indeed λx_{1}...x_{n}.y has exactly n arguments and YK = (λx.xx)(λxy.xx) has infinitely many.

Corollary The combinators listed in §1.1.4 have exactly as many arguments as λs at the front as they are written there. □

§1.1.14 We can now complete the reformulation of λ-calculus as a purely equational theory.

Lemma Let (Λ, •, K, S) be a combinatory prealgebra. tfae

(α) For any functional f, g ∈ Λ, if fx = gx in Λ[x] then f = g.

(β) β-equivalent terms are equal.

(γ) The following equations are satisfied.

K  = S(S(KS)(S(KK)K))(K(SKK))
S  = S(S(KS)(S(K(S(KS)))(S(K(S(KK)))S)))(K(K(SKK)))
S(KK)  = S(S(KS)(S(KK)(S(KS)K)))(KK)
S(KS)(S(KK))  = S(KK)(S(S(KS)(S(KK)(SKK)))(K(SKK)))
S(K(S(KS)))(S(KS)(S(KS))) = S(S(KS)(S(KK)(S(KS)(S(K(S(KS)))S))))(KS)  □

If Λ satisfies these conditions then we say it is a combinatory algebra. [In fact most authors use this term in the weaker case, and lambda algebra in the stronger.] The importance of part (γ), which is due to Curry, is that we now have a purely equational theory; it now seems unlikely that the form of the equations has any great significance. Part (α) will be used frequently in the constructions of §1.3 and §5.1.

Proposition (Λ[t_{1}, ..., t_{n}], •, K, S) is the free combinatory algebra on n generators. Proof The passage from λ-terms to combinators and back is (β-equivalent to) the identity by lemma 1.1.8. For the converse we use the above lemma. □

§1.1.15 When we introduced the distinction between prealgebras and algebras in §1.1.12 we would have liked to have said that in the λ-calculus “terms beginning with a λ have the same effect as functions”. If, as has been the case so far during this century (though I personally believe this to be a passing heresy), we regard functions as assignments of values to arguments, then this raises questions of extensionality.

Proposition There are distinct functional f, g ∈ Λ with ∀a ∈ Λ.fa = ga. Proof Plotkin [1974]. □

Definition A combinatory algebra is a model if for functional f, g, if ∀a.fa = ga then f = g.

Hence Λ[ℕ] is a model and Λ is only an algebra. We shall see that this distinction corresponds to the notion of a concrete category.

§1.1.16 A “stronger” form of extensionality (although it is in fact an independent condition) is the η-rule that every element is functional, i.e. if x ∉ FV(a) then λx.ax = a. We write Λ^{η}[Σ] for the set of λη-terms in a given set of variables, and Λ^{η} for the closed λη-terms. A combinatory algebra or model with this property is called an η-algebra or η-model respectively. Categorically this corresponds to an isomorphism between Λ and Λ^{Λ} rather than the latter merely being a retract of the former.

We have distinguished between

(i) combinatory prealgebras and algebras by functionality,

(ii) algebras and models by concreteness or weak extensionality, and

(iii) beta and eta by so-called “strong extensionality”;

we will distinguish

(iv) combinatory and lambda by whether we really have function-spaces.

1.2 Retracts, Monoids and Cartesian Closed Categories

§1.2.1 This section is a miscellany of basic category theory.

Definition Let X be a poset and D ⊂ X a subset.

(a) D is said to be directed if (∀d_{1}, d_{2} ∈ D)(∃d ∈ D)(d_{1}, d_{2} ≤ d).

(b) D is down-closed if (∀d ∈ D, x ∈ X : x ≤ d)(x ∈ D)

(c) D is an ideal if it is down-closed and directed.

Lemma A directed union of directed sets or ideals is directed, respectively an ideal. □

§1.2.2 Of considerable importance will be directed unions, or more generally directed joins (also known as directed sups) in a poset.

Definition (a) We say x is the directed join of D ⊂ X, and write x = ⋁ ; D, if

(i) D ≤ x (i.e. ∀d ∈ D.d ≤ x)

(ii) if also D ≤ y then x ≤ y

(iii) D is directed.

Note The use of the arrow implicitly asserts the directedness of the set in question.

Definition (b) We say the function f : X → Y preserves directed joins if f(⋁ ; D) = ⋁ ; {fd : d ∈ D} for all directed D ⊂ X.

Lemma Let f : X → Y preserve directed joins. Then f is monotone (preserves order). Proof Consider the directed set D = {x, y} for any x ≤ y. □

Proposition Let X be a poset with a least element ⊥, and joins for all directed subsets. Let f : X → X preserve directed joins; then f has a least fixed point. Proof Put x_{0} = ⊥ and x_{n+1} = fx_{n}. Then x_{0} = ⊥ ≤ x_{1} so by induction and monotonicity of f, x_{n} = f^{n}⊥ ≤ f^{n}x_{1} = x_{n+1}. Hence D = {x_{n} : n ∈ ℕ} ⊂ X is directed. Let x = ⋁ ; D. Then fx = ⋁ ; {fx_{n} : n ∈ ℕ} by preservation of directed joins, and this is just x. If also fy = y then x_{0} = ⊥ ≤ y, so x_{n} = f^{n}⊥ ≤ f^{n}y = y; hence x ≤ y. □

The result that Tarski [1955] proved was that every monotone endofunction of a complete lattice has a least (and also a greatest) fixed point.

§1.2.3 Let C be a category.

Notation Write the composite of f : X → Y and g : Y → Z in C as (f ; g) : X → Z.

Warning This is right-handed notation (left-handed is slightly more common in Category Theory). The semi-colon is commonly used in programming languages for sequencing. Juxtaposition will always mean application.

An endomorphism e : X → X in C is idempotent if e^{2} (that is, e; e) equals e. If i : U ↪ X and p : X ↠ U in C have i; p = 1_{U} and p; i = e then we say e splits through U. This also arises given just i and p with i; p = 1_{U}, for then e = p; i is automatically idempotent. Some authors introduce several different words for the anatomy of this situation, but we shall indiscriminantly call e or U a retract of X. Write U ◁ X.

We may regard U as a subobject of X by i : U ⊂ X, since this is (regular, indeed split) mono. In this case the restriction of e to U is just i : U ↪ X or 1_{U} : U → U; indeed U is precisely the fixed point set of e. Categorically, U is the equaliser of 1 and e. If we do regard U as a subset we may suppress mention of i and consider p : X ↠ U in place of e; we think of px (for x ∈ X) as x reduced to or reflected in U.

Alternatively, U is a quotient of X by p : X ↠ U, since this is (regular, split) epi. Then U is the image of e, which we may describe as the coequaliser of 1 and e. i is then a section of p.

We shall try to avoid trivial detail when talking about retracts, and the reader will be expected to interpret the context and notation appropriately. Letters such as e (then f), c and r are used for idempotents, p (then q) or π for the surjection and i (then j) or ι for the inclusion.

Notice that when we move to the dual category (in which the arrows are reversed) these concepts either remain the same or are interchanged with one another.

§1.2.4 Very often there will be an order structure on maps in a category. Retracts which are comparable to the identity in this order play a special role. If 1 ≤ c = c^{2} we call it a closure operator; if 1 ≥ c = c^{2} then it is a coclosure operator.

Proposition Let c : X → X be a closure (coclosure) operator on a poset and Y its image. Then the inclusion i : Y ↪ X is right (left) adjoint to the surjection p : X ↠ Y. Conversely if the inclusion of one poset in another has a left (right) adjoint then we have a closure (coclosure). □

Definition Splitting of a coclosure will be of particular importance: we reserve the terms embedding and projection for this case, with notation ↣ and →.

There are analogous concepts for categories rather than posets: a endofunctor tT with natural transformations η : 1 → tT and μ : tT^{2} → tT satisfying certain equations is called a monad. It is idempotent or a reflection if μ is invertible; the image is called a reflective subcategory. Dually ϵ : tT → 1, ν : tT → tT^{2} is a comonad, etc

§1.2.5 In general the composite of two idempotents e, f need not be idempotent.

Lemma

(a) Let e, f be commuting idempotents of X ∈ C. Then e; f is idempotent. If further e, f and e; f split through U, V, W respectively (which we consider as the fixed point sets), then W is the intersection of U and V.

(b) Let e, f be split idempotents of X ∈ C. Then the fixed point set of e is contained in that of f iff e = e; f. □

We write e ⊂ f if e = e; f = f ; e.

What we shall mean by composed retracts is the situation X ◁ Y ◁ Z.

Lemma

(c) If X ◁ Y ◁ Z then X ◁ Z, where the inclusion and surjection are the obvious composites.

(d) In this case write e and f for the idempotents on Z corresponding to X and Y respectively; then e ⊂ f.

(e) Conversely e ⊂ f always arises in this way.

(f) Given e ⊂ f like this, e ≤ f iff X is a coclosure on Y, and e ≥ f iff it is a closure. □

§1.2.6 Preservation by functors is always important.

Proposition Let e : X → X be an idempotent in C and F : C → D a covariant or contravariant functor. Then F e : F X → F X is also idempotent. Suppose e splits, say through i : U ↪ X, p : X ↠ U. Then F e also splits, through F i : F U ↪ F X, F p : F X ↠ F U in the covariant case and F p : F U ↪ F X, F i : F X ↠ F U in the contravariant case. □

Also, if the hom-sets are ordered and F preserves the order then it also preserves closures, coclosures, etc.

§1.2.7 Given any category C we may construct a category K(C), the Karoubian completion of C, in which C is embedded fully and all idempotents split. K(C) has objects the idempotents e : X → X in C and morphisms α : (e : X → X) → (f : Y → Y) those α : X → Y such that α = e; α; f, i.e. the diagram

[figure: X; e; X; Y; α; f; Y; α]

commutes. Composition is as in C and the identity on (e : X → X) is e itself. C is embedded in K(C) by X ↦ (1_{X} : X → X).

Proposition C → K(C) splits idempotents universally in the following sense. K(C) has an explicit choice of splittings, so let D be another category with explicit splittings and F : C → D a functor. Then there is a unique extension to K(C) → D which preserves splittings. If idempotents already split in C then the inclusion is an equivalence. □

Since splitting idempotents is equivalent to adjoining finite filtered colimits (or finite cofiltered limits), K(C) may be found inside the completions of C under arbitrary or filtered colimits. These are respectively [C^{op}, Set] and Ind C (§2.3.6).

+§1.2.8 We shall apply the foregoing construction in the particular case of the monoid derived from a model of the λ-calculus. Any monoid M may be regarded as a category with just one object, the morphisms being the elements of M. The unique object of M is taken to the identity in K(M)

Lemma Let e, f be idempotents in a monoid M. Then e ≅ f as objects of K(M) iff there are u, v ∈ M with u; v = e, v ; u = f, u; v ; u = u and v ; u; v = v in M. □

Proposition Let M and N be monoids. Then there is a natural equivalence

Functors  K (M) \overline{}K(N)
Semigroup homomorphisms M  \overline{}N
□

Note The point of view which has been adopted in this work is the currently orthodox one that functors must preserve identities as well as composition, which leads to the consideration of the category of retracts. Hoofman [1990] has adopted the opposite attitude, namely that as many of the functors considered in this topic are free extensions to the category of retracts of underlying constructions which preserve composition but not identities we should regard such constructions as respectable mathemaical objects (semifunctors). He has shown that much of the development of the well known models of continuous and stable domain theory is simplified by this approach; (essentially) the foregoing result recovers the (identity-preserving) functors.

+§1.2.9 Monoids, like groups, ought always to be considered to act on something. Under what circumstances can a monoid M be represented as the endomorphisms of a set? If we stretch the meaning of “set”, always: M is the endomorphism monoid of 1_{M} ∈ K(M).

We can identify the constants of M as the elements which are insensitive to precomposition, i.e. the c ∈ M with ∀m ∈ M.m; c = c.

Lemma The regular action of M on itself, by m ↦ (x ↦ x;m) restricts to the set C of constants. If the restricted action is faithful, M is a submonoid of the endofunctions of C and we say M has enough constants. □

We shall be interested in the monoid of functional elements of a λ-algebra; this will have enough constants iff it is a λ-model.

(One might ask when monoids in the category of vector spaces, i.e. rings, have enough constants. It is then appropriate to replace equality by proportionality. We are led to submonoids of the projective matrix monoid, the constants being (projections onto) particular rays, cf. PGL, the projective linear group.)

Remark This original form of this result was Cayley’s permutation representation of any (abstract) group; another form of it is the Yoneda lemma in category theory.

§1.2.10 The analogous concept for categories is that there are enough global elements, i.e. maps from the terminal object to each object, i.e. for f, g : X ⇉ Y, if (∀x : 1 → X)(x; f = x; g) then f = g. In this case we say 1 is a generator. (Many authors gratuitously introduce the contrapositive in this definition.) The dual notion will appear in §2.3.2. Then the global section functor C(1, −) : C → Set is faithful.

Warning In naïve category theory, a concrete category is one whose objects are given sets and whose morphisms are some of the functions between them (e.g. groups, fields, topological spaces, but not spaces with homotopies). This may be formalised by saying that there is a faithful functor C → Set. We shall diverge from this usage by requiring this functor to be C(1, −); this makes sense in our context because it is always possible to give morphisms with a “constant” value, but the category of groups, for instance, ceases to be concrete.

Proposition Let M be a monoid and C ≃ K(M) its Karoubi completion. Then M has enough constants iff C is concrete. □

§1.2.11 The analogous concept to directedness in posets is filteredness in categories. By a diagram in a category C we simply mean a functor d : I → C from another category I.

Definition A diagram I is said to be filtered if

(i) I is nonempty (more properly, inhabited)

(ii) for any two objects i, j ∈ I there is an object k ∈ I and morphisms f : i → k and g : j → k in I.

(iii) for any parallel pair of morphisms f, g : i ⇉ j in I there is an object k ∈ I and a morphism h : j → k with f ; h = g ; h.

Examples

(a) Let I = ω, the category with one object for each natural number n and one morphism n → m iff n ≤ m. Then any d : I → C is filtered.

(b) Let D ⊂ X be a directed subset of a poset. Consider X as a category with a unique morphism x → y iff x ≤ y. Then the inclusion D → X is a filtered diagram.

(c) Let e : X → X in C be idempotent. Then the diagram

[figure: X; e; 1_{X}; X; e; X]

is filtered. □

Lemma Let d : I → C be a finite filtered diagram. Then there is a vertex X and an idempotent e : X → X in d forming (in the manner of example (c)) a subdiagram equivalent to d. Thus d has a colimit iff e splits.

Proof Assign to each even number an object of I, and to each odd number a morphism between previously-named objects, so that each occurs infinitely often. We construct a category and functor ω ∪ I → I so that I → ω ∪ I → I is an equivalence and ω ⊂ ω ∪ I full and cofinal; this makes the diagrams I → C and ω ⊂ ω ∪ I → I → C equivalent in the sense of having the same cones and in particular the same colimit. We incorporate the chosen objects and morphisms into ω ∪ I using axiom (ii):

[figure: 0; 1; ⋯; 2n − 2; 2n − 1]

[figure]

2n

[figure]

i_{2n}

and (iii) for i_{2p} ⇉ 2n:

[figure: 0; 1; ⋯; 2p − 1; 2p; ⋯; 2q − 1; 2q; ⋯; 2n − 1; 2n; 2n + 1]
[figure]
i_{2p}  \overline{\begin{matrix}f_{2n+1} \\  \end{matrix}}i_{2q}

Now let X be any vertex which occurs infinitely often in ω → I and f any endomorphism of X which occurs infinitely often as an arrow out of it. f has only finitely many powers; so f^{n} = f^{n+m} for some n ≥ 0, m ≥ 1, and f^{n+r} = f^{n+r+km} for r ≥ 0, k ≥ 1. Put e = f^{n+r} where n + r = km; then e is the required idempotent. □

Facts

(a) In a category with colimits of filtered diagrams of cardinality less than κ (where κ is an infinite regular cardinal considered as an ordinal) any filtered diagram of cardinality κ is equivalent to one of shape κ.

(b) In a finite category in which idempotents are split, every filtered diagram (however large) has a colimit (cf. lemma 2.1.2). □

§1.2.12 The dual concept to filteredness is of course called cofilteredness. The following really amounts to König’s lemma.

Lemma Let X : I → Set be a cofiltered diagram of nonempty sets.

(a) If each map in the diagram is surjective then the limit is nonempty.

(b) If each set in the diagram is finite then the limit is nonempty.

Proof

[a] By induction on the cardinality of the diagram and using Fact 1.2.11a, w.l.o.g. I = κ^{op}. Inductively choose x_{α} ∈ X_{α} such that x_{α+1} maps to x_{α} and x_{λ} = (x_{α} : α < λ) for limit ordinals.

[b] Call x ∈ X_{i} persistent if for any j ∈ I there’s k ∈ I and y ∈ X_{k} with k beyond i, j in I and y mapping to x, and a similar condition on morphisms. Let Y_{i} ⊂ X_{i} consist of the persistent elements; it is nonempty since otherwise we may choose a point in the diagram beyond points at which each of the finitely many elements of X_{i} has been exhausted. Then the diagram reduces to one with surjections. □

1.2. RETRACTS, MONOIDS AND CARTESIAN CLOSED CATEGORIES 13

§1.2.13 From infinite colimits to finite limits. Proposition For a category C tfae (α) C has all finite limits (β) C has a terminal object and all pullbacks (γ) C has finite products and binary intersections of retracts (δ) C has a terminal object, binary products and equalisers. Proof [α ⇒ β] All of these constructions are examples of finite limits. [β ⇒ γ] Binary products are found by pulling back two terminal projections, and products with

more factors by iteration. The image of e : X → X is the pullback of (1, 1) : X → X × X against (1, e) : X → X × X. Intersections are examples of pullbacks.

[γ ⇒ δ] It suffices to construct the equaliser of a pair f, g : A ⇉ B. First observe that A is a retract of A × B by (a, b) ↦ (a, fb). The image of this is usually called the graph of the function f and is written A_{f}; the composite A_{f} → A × B → A with the product projection is an isomorphism. The equaliser of f and g is now A_{f} ∩ A_{g} ⊂ A × B → A.

[δ ⇒ α] The diagram category I is essentially expressed in terms of dom, cod : I_{1} ⇉ I_{0}. The limit

of d : I → C is given by the equaliser of the following pair:

∏_{i∈I_{0}} d(i)  ⇉ ∏_{u∈I_{1}} d(cod u)
⟨x_{i} : i ∈ I_{0}⟩ ↦ \begin{cases}⟨x_{cod u} : u ∈ I_{1}⟩ \\ ⟨u(x_{dom u}) : u ∈ I_{1}⟩ \end{cases}
□

Such a C is called a lex category (left exact).

§1.2.14 Lemma Consider the diagram

[figure: •; •; •; •; •; •]

(a) If the two squares are pullback diagrams then so is the rectangle.

(b) If the rectangle and the right hand square are pullbacks then so is the left hand square. □

§1.2.15 Finite limits and filtered colimits interact nicely. Proposition

(a) Let X : I × J → Set be a diagram with I filtered and J finite. Then the natural comparison map colim_{i} lim_{j} X_{ij} → lim_{j} colim_{i} X_{ij} is an isomorphism.

(b) The same is true of the category of models of any finitary algebraic theory. □

§1.2.16 We shall now turn to cartesian closed categories.

Warning In current Computer Science and older Mathematical usage, a category is cartesian closed if it as finite products and exponentials. In more recent Category Theory, the term has been redefined to require all finite limits. We shall adopt the weaker definition, for reasons which will become apparent in proposition 1.5.11.

Let’s do this explicitly.

A terminal object 1 ∈ C has a unique morphism !_{A} : A → 1 for each A ∈ C. We usually think of this as the one-point set.

The product of X, Y ∈ C is an object X ×Y with morphisms π_{0} : X ×Y → X and π_{1} : X ×Y → Y (projections or components) which are universal in the sense that if f : Z → X and g : Z → Y are any two morphisms of C then there is a unique morphism ⟨f, g⟩ : Z → X × Y making the two triangles commute:

X

[figure: f]

[figure: Z; ⟨f,g⟩; X × Y; π_{0}]

[figure: g]

Y^{π_{0} }

We may of course define products with more factors. The terminal object is the product of zero factors, and any finite product may be obtained by iteration.

The exponential or function space from X to Y is written Y^{X} or X → Y. The functor (−)^{X} is defined to be the right adjoint to the product with X, − × X. This means that there is a natural bijection

[figure: Z; × X; Y; Z; Y^{X}]

The operation from top to bottom is functional abstraction, λx. If we put Z = Y^{X} and consider the identity on the bottom, the corresponding thing on the top is the evaluation map ev : Y^{X} ×X → Y.

§1.2.17 Finally there is a useful presentation of an object as a retract of its function space.

Notation For an object X of a cartesian closed category write

X_{0} = X X_{n+1} = X_{n}^{X_{n}}

Proposition Let X be an object of a cartesian closed category C.

(a) X is inhabited (has a map 1 → X) iff X ◁ X^{X}

(b) If the objects of C carry a partial order, with respect to which X has a least element ⊥, then X ◁ X^{X} by a coclosure.

Proof Habitation is necessary because the image of 1_{X} ∈ X^{X} in X is an element. Let ⊥ ∈ X. Then define X ↪ X^{X} by x ↦ Kx and X^{X} ↠ X by f ↦ f⊥. □

We call this dropping a variable.

1.3 Typing Lambda Terms

§1.3.1 In this section we discuss the typed λ-calculus and its relationship with cartesian closed categories. We also construct the category of retracts, Retr(Λ), of a λ-algebra and show that this enables any term to be typed. Koymans [1984] performs some of these constructions in greater detail. The significance of Retr(Λ) to our work is that any small category of domains is of this form. (We state precisely what can be proved of this assertion in theorem 2.6.12.) Besides the convenience of having a λ-model around, we can also use this formulation to motivate the notion of a continuous type-dependence (definition 5.1.12).

First we construct the monoid of functional elements; throughout Λ is a combinatory algebra.

Definition 1 = λf.PI(PfI) = λfx.fx = S[K(SI)]K This is one of Church’s numerals (§1.1.7).

Lemma

(a) P is associative in the sense that Pα(Pβγ) = P(Pαβ)γ for any α, β, γ ∈ Λ.

(b) The operation f ↦ 1f is idempotent and its image consists precisely of the functional elements.

Proof

[a] I shall do this kind of thing precisely once, so watch carefully! Either (lemma 1.1.14β)

Pα(Pβγ) = [(λxyz.y(xz))α][(λxyz.y(xz))βγ]
= [λyz.y(αz)][λz.γ(βz)]
= λz.[λz.γ(βz)](αz)
= λz.γ(β(αz))
= [λxyz.y(xz)]{λz.β(αz)}γ
= [λxyz.y(xz)]{[λxyz.y(xz)]αβ}γ
= P(Pαβ)γ

or (lemma 1.1.14α), since P has three arguments,

Pα(Pβγ)z = (Pβγ)(αz)
= γ(β(αz))
= γ(Pαβz)
= P(Pαβ)γz

(b) We now know that the operations f ↦ PIf and f ↦ PfI are commuting idempotents, so their composite is idempotent (lemma 1.2.5a). Since P has three arguments, PI(PfI) has at least one, so is functional. Conversely any functional element may be seen to be fixed. □

+§1.3.2 Write M for the set of functional elements of Λ, the image of f ↦ PI(PfI).

Lemma

(a) M is a retract of Λ

(b) Λ is a retract of M

(c) M ⊂ Λ is the union of the images of ⌜K⌝ : 1 → Λ, ⌜S⌝ : 1 → Λ, K− : Λ → Λ, S− : Λ → Λ and S − − : Λ × Λ → Λ.

Proof

[a] by lemma 1.3.1, i.e. PI(PfI)

[b] by dropping a variable (1.2.17), i.e. a ↦ Ka, f ↦ f⊥

[c] by lemma 1.1.12a □

Proposition

(a) M carries the structure of a monoid, where I is the identity and P the composition. Specifically, f ; g = Pfg in right-handed notation.

(b) Λ (as a retract) is the set of constants of M, and the action Λ × M → Λ is (a, m) ↦ ma.

(c) This action is faithful iff Λ is a combinatory model. Proof

[a] by lemma 1.3.1.

[b] by the above lemma

[c] M has enough constants iff (∀a.m_{1}a = m_{2}a) ⇒ m_{1} = m_{2}. □

§1.3.3 In the following paragraphs we combine §1.2.7 and §1.3.2 to construct the category of retracts. It is cartesian closed, idempotents split, it has fixpoints and any λ-term is typable in it.

Definition Let Λ be a combinatory algebra and M its monoid of functional elements. Then Retr(Λ) is the Karoubi completion of M, considered as a category with one object.

Because of the importance of this construction we shall perform it explicitly. An object of Retr(Λ) is an idempotent of M, i.e. an element A ∈ Λ satisfying PAA = A. Unfortunately this operation is not itself idempotent: indeed in general there is no retract of Λ whose image is ob C ⊂ Λ (cf. §1.4.8). The morphisms α : A → B are the elements α ∈ Λ with α = PAα = PαB. The identity on A is A itself, whilst the composite of α : A → B and β : B → C is α;β = Pαβ : A → C.

Notice that we have dropped the category-theoretic convention that the various hom-sets be disjoint, so we do not have functions dom and cod; however it is a straightforward but unenlightening exercise to code these things in if they are required.

For an arbitrary a ∈ Λ, we call Aa a reduced to A; many constructions are of the form of general or untyped constructions reduced to appropriate types, and we shall frequently quote them as such.

Because of the way Retr(Λ) is given, of course idempotents split. So if α : A → A in C satisfies α^{2} = α, i.e. Pαα = α, then there is an object B and a pair of maps B ⇆ A such that B → A → B is the identity and A → B → A is α; in fact of course both B and the two maps are represented by α.

§1.3.4 We now investigate when Retr(Λ) is concrete.

The terminal object is T = K⊥, and this also denotes the terminal projection, the unique map A → T.

Proposition For a combinatory algebra Λ tfae:

(α) Λ is a combinatory model

(β) M has enough constants (γ) Retr(Λ) is concrete Proof By propositions 1.2.10 and 1.3.2c. More explicitly, let α, β : A ⇉ B be two maps whose composites with all maps T → A are equal. Since α and β are functional and Λ is a model, it suffices to show that αw = βw for all w ∈ Λ. Put γ = K(Aw), then γ : T → A so by hypothesis γ ; α = γ ; β. But α(γ⊥) = α(Aw) = αw since A is the domain of α. The same holds for β so we are done. □

The type A can be interpreted as the set ∥A∥ = {a : a = Aa} ⊂ Λ and the map α : A → B as the function a ↦ αa. Note that ∥T∥ = {⊥} and that every type A has a (“least”) element A⊥.

§1.3.5 We shall next show that Retr(Λ) is cartesian closed. For products we have to choose pairing and unpairing combinators ⟨⟩ = λxyz.zxy, 0 = λxy.x = K and 1 = λxy.y = KI.

Lemma ⟨⟩ab0 = a and ⟨⟩ab1 = b for all a, b ∈ Λ. □

Write ⟨a, b⟩, c_{0} and c_{1} for (⟨⟩ab), (c0) and (c1) respectively, noting carefully the positions of the digits. We do not have ⟨c_{0}, c_{1}⟩ = c (but see §1.4.8 and §2.5.11).

Proposition The product A × B of A and B is λc.⟨Ac_{0}, Bc_{1}⟩, which is our abbreviation for λc.⟨⟩(A(c0))(B(c1)), with projections π_{0} = λc.Ac_{0}, π_{1} = λc.Bc_{1}, i.e. 0 and 1 reduced to (domain A × B and) codomain A or B. Given α : D → A and β : D → B, ⟨α, β⟩ = λd.⟨αd, βd⟩ is the unique map (pair) D → A × B making the two triangles commute (1.2.16). □

There is a combinator × = λAB.A×B which, when restricted to ob Retr(Λ)×ob Retr(Λ) → Λ, yields (idempotents representing) products. The forgetful functor | − | : C → Set creates finite products and preserves all limits which exist in C.

Corollary Let X be an inhabited object of a cartesian closed category. Then X × X is a retract of X_{3} (see 1.2.17). Proof We adopt the convention that a, b,... are variables of types involving X once, twice,... in their definition. First X ◁ X_{1} by dropping a variable. Then

X × X  ◁ X^{[(X^{X})^{X}]}
⟨x, y⟩  ↦ λc.cxy
⟨d(λab.a), d(λab.b)⟩ ← d

So

X × X ◁ X^{[(X^{X})^{X}]} ◁ (X^{X})^{[(X^{X})^{(X^{X})}]} ◁ [(X^{X})^{(X^{X})}]^{[(X^{X})^{(X^{X})}]}
□

§1.3.6

Lemma If A = PAA and B = PBB then λf.PAf and λf.PfB are commuting idempotents. □

Proposition Retr(Λ) has function spaces. B^{A} = λf.PA(PfB) = λf.P(PAf)B. Given α : C × A → B we have the exponential transpose α = λca.α⟨c, a⟩ : C → B^{A} and conversely α = λd.αd_{0}d_{1}. The evaluation map ev : B^{A} × A → B is given by λd.C(d_{0}(Bd_{1})). □

This trick is known as Currying, although it was actually discovered by Schönfinkel. Notice that 1 = I^{I}.

Again there are obvious combinators doing these things. B^{A}f is called f reduced to domain A and codomain B, but one should beware that this reduction is not functorial (it does not preserve identity and composition).

Theorem Retr(Λ) is cartesian closed. □

§1.3.7 We would like to think of a “model” of the λ-calculus as an object whose function space is a retract of it in a specified way. Specifically, given a function f : Λ → Λ, λ(f) is its “name” in Λ, and given a name u of a function and an element a, the application ua is in Λ. Hence λ : Λ^{Λ} ↪ Λ and • : Λ × Λ → Λ. The β-rule says precisely that λ is the inclusion and • (the exponential transpose of) the surjection of a retract.

Definition Let E be a cartesian closed category and Λ ∈ E. We say Λ is a lambda β-algebra if Λ^{Λ} ◁ Λ and a lambda η-algebra if Λ^{Λ} ≅ Λ in a specified way. If E is concrete we use the terms lambda β-model and lambda η-model.

This is the last of the distinctions we summed up in §1.1.15.

Proposition Let Λ be a combinatory algebra. Then I is a lambda β-algebra in Retr(Λ). Proof I is the type represented by the identity and M = I^{I} that represented by λf.PI(PfI). M is a retract of I. □

Observe that the endomorphism monoid of I ∈ E is precisely the monoid M of functional elements, and that this is the set of global elements of I^{I}.

§1.3.8 Now we shall discuss what it means for a λ-term to be typable. The basic idea is that for a term fa to (be defined and) have type B, where a has type A, it is necessary that f have type A → B. However besides this function-space construction, there is also a notion of coercion if we are to deal satisfactorily with the untyped λβ-calculus. Thus the functional element f has type Λ^{Λ}, but is also to be considered as an element, and to have type Λ.

Coercion first arose in FORTRAN [ANSI 66], where integer or “real” values could be put in a real or complex context. The purpose is to eliminate vexatious but essentially vacuous explicit reinterpretations of values; the analogue in category theory is the “forgetful functor”. This is the practical value of “strong typing”, used in Mathematics everywhere except in the development of Set Theory, that many things can be understood from context.

The compiler is obliged to supply a conversion function; this is reflected categorically by having a canonical map ℕ → ℝ (or ℝ → ℂ) which enables morphisms X → ℕ and ℝ → Y to be composed. This system of canonical maps must be closed under the appropriate categorical notions (in particular composition and exponential), and there must be at most one such map, usually a mono, between any two objects. We consider the subject of coercion in the context of polymorphism in §3.4.9.

The ⊂ relation in Retr(Λ) (§1.2.5) has appropriate properties.

Lemma A′ ⊃ A, B′ ⊂ B ⇒ B′^{A′} ⊂ B^{A} ⇒ B′ ⊂ B Proof Easy. The second part follows from B = λx.B^{A}(Kx)⊥. □

+§1.3.9

Definition

(a) A Heyting system of types is a set V with a binary operation (→) : V ×V → V and a partial order (⊂) ⊂ V × V such that if A′ ⊃ A and B′ ⊂ B then (A′ → B′) ⊂ (A → B). Note the contravariance in the first argument! A homomorphism F : V → W of Heyting systems is a function satisfying F A → F B = F (A → B) and A ⊂ B ⇒ F A ⊂ F B.

(b) Let C be a cartesian closed category with specified products and exponentials (also projections, evaluation and terminal object). A coercion structure on C is a subcategory D with the same objects as C but at most one (canonical) map between any two objects, such that (i) if A → A′, B → B′ in D then A × B → A′ × B′ in D and (ii) if A′ → A, B → B′ in D then B^{A} → B′^{A′} in D.

Examples

(a) By default the free Heyting system on countably many generators is commonly meant.

(b) Let C be a cartesian closed category with (specified products and exponentials and) a coercion structure D. Then (V, →, ⊂) is the underlying Heyting system on C, where V = ob C, A → B = B^{A} and A ⊂ B iff there is a canonical map A → B.

(c) Let C → C′ be a functor preserving specified products and exponentials and canonical maps. Then there is a homomorphism of their corresponding underlying Heyting systems.

(d) In example (b) suppose D consists only of identities. Then A ⊂ B iff A = B, and (V, →, =) is the underlying discrete Heyting system on C, written ∥C∥.

(e) Let Λ be a combinatory algebra. Then V = ob Retr(Λ), A → B = B^{A}, A ⊂ B ⟺ A = PAB = PBA is the retract coercion structure on Retr(Λ), the canonical map being A : A → B.

+§1.3.10 Given a Heyting system (V, →, ⊂) we may say when a λ-term a ∈ Λ[t_{1}, ..., t_{n}] is typable w.r.t. V when t_{1}, ..., t_{n} are assigned types A_{1}, ..., A_{n} respectively:

(i) t_{i} has type A_{i}

(ii) If f has type A → B, and a has type A, then fa has type B

(iii) If b ∈ Λ[t_{1}, ..., t_{n}, x] has type B when x is assigned type A, then λx.b has type A → B

(iv) If a has type A′ and A′ ⊂ A then a also has type A.

Now we shall define a cartesian closed category Type(V) with a coercion structure.

The objects are finite strings of elements of V, written as formal products (the empty string is written 1); we shall write A⃗ for A_{1} × ... × A_{n}. The morphisms A⃗ → B⃗, where A⃗ and B⃗ have lengths n, m respectively, are the strings of m Λ^{+}[t⃗] terms of types B⃗ where the variables have types A⃗, identified under the rules

[x : A] ; \begin{matrix}· \\ · \\ · \end{matrix} ; b : B a : A ; (β) ; (λx.b)a = b[x := a]f : A → B x ∉ FV(f) ; (η) ; f = λx.fx

The identity on A⃗ is x⃗ and composition is given by substitution. The coercion structure is also given by variables.

The terminal object is the empty string, and the product of two strings their concatenation; the projections are just appropriate substrings of variables.

The exponential is

A_{1} × ... × A_{n} → B_{1} × ... × B_{m} = (A_{1} → (A_{2} → ...(A_{n} → B_{1})...)) × ... × (A_{1} → ...B_{m})

The exponential transpose hom(A⃗ × X, B⃗) → hom(A⃗, B⃗^{X}) is λx. We need the typed η-rule as well as the β-rule to make this a bijection; notice that it applies only to functional types. Evaluation is given by application.

Given a homomorphism F : V → W of Heyting systems, Type(F) on objects applies F to each factor in the string, and on morphisms reinterprets terms.

Proposition Type(V) is a cartesian closed category and Type(F) : Type(V) → Type(W) a functor which preserves products, exponentials and canonical maps. Proof The functor is well-defined on morphisms because any term which is V -typable by A is W -typable by F A, and any equality which holds for V also holds for W. It preserves products, exponentials and canonical maps by construction. □

+§1.3.11 We now compare the cartesian closed categories derived from the naturally occurring Heyting systems on given cartesian closed categories.

Proposition The functor Type gives the free cartesian closed category with coercion on a Heyting system of types, i.e. it is left adjoint to the underlying Heyting system functor, ∥ − ∥. Proof

[η] Let (V, →, ⊂) be a Heyting system. ∥Type(V)∥ has elements strings of V -elements, the unit being the inclusion of singleton strings; → is given in the manner of the exponential in Type(V) and two strings are coercible iff they have the same length and are elementwise coercible.

[ϵ] Let C be a cartesian closed category with coercion. Type(∥C∥) has new products and only the λ-definable morphisms (ϵ being the inclusion of these). □

The adjunction is idempotent in the pseudo sense that the inclusion of Type(V) in Type(∥Type(V)∥) is an equivalence.

+§1.3.12 Now we apply this to a λ-model.

Lemma Let V be a Heyting system with an element Λ such that Λ → Λ ⊂ Λ. Then every raw λ-term has type Λ. Proof In the notation of §1.2.17, Λ_{n} ⊂ Λ_{m} for any n ≥ m. Define the degree of a raw λ-term to be the depth of occurrences of application, so that ∂x = 0, ∂(ab) = max(∂a+1, ∂b), ∂(λx.a) = ∂a. If a raw λ-term has type Λ_{k} when its free variables are assigned types Λ_{m} then it has type Λ_{k+r} when we replace m by n with n ≥ m + r. Claim that any raw term a has type Λ in this case if m ≥ ∂a. This is so for variables. For (ab), a may be retyped as Λ^{Λ} and b as Λ. Finally λx.a has type Λ^{Λ} ⊂ Λ. □

Proposition Let C be a cartesian closed category with an object Λ for which Λ^{Λ} is a retract of Λ in a specified way. Then Λ carries a combinatory algebra structure in C, which is preserved by the global section functor | − | = C(1, −). Proof First replace C by an equivalent category C′ with specified products and exponentials (the objects are terms in ×, → and the objects of C, the hom-sets are those for the isomorphic objects of C). Now let D be the coercion structure on C′ generated by the inclusion Λ^{Λ} ↪ Λ (these are of course unequal objects of C′); since the objects of C′ are uniquely expressable as products and exponentials of C objects, there is indeed at most one (deduction of a) canonical map between any two objects.

Let V be the underlying Heyting system. This satisfies the hypotheses of the lemma, so any λ-term has type Λ. In particular we may interpret •, K and S and verify that these give a combinatory algebra structure on Λ. Such structure is preserved by any functor which preserves products (§1.1.10). □

§1.3.13 Finally we show that the constructions of §1.3.7 and 12 are inverse.

Theorem

(a) Let Λ be a combinatory model. Then Λ is isomorphic to the global sections of the combinatory model structure on the lambda model Λ = I ∈ Retr(Λ).

(b) Let Λ be a lambda model in a cartesian closed category C, such that every object of C is a retract of Λ and idempotents split in C. Then Retr(|Λ|) is equivalent to C.

Proof [a] Following through the constructions, each a ∈ Λ is interpreted by something of the same

name.

[b] Every object of C is represented by a retract of Λ, which is an idempotent global element of Λ^{Λ} and hence a global element of Λ. □

Question What information does Retr(Λ) give about equality of terms in Λ?

We return in §5.6.10 to the question of repeating the Retr construction for the internal combinatory algebra in Retr(Λ).

1.4 The Graph Model

§1.4.1 We have now settled on the definition of a model of the λ-calculus as an object of a cartesian closed category whose function space is a retract of it in a canonical way. Of course there are trivial cardinality reasons why this cannot happen in the category of sets, so this view of the λ-calculus remained dormant for a long time and at one stage it was even doubted whether there was any model of mathematical interest. Then in 1969 Scott showed that the function-spaces of what subsequently became known as continuous lattices were essentially no larger than the original objects, opening the way for a continuous lattice model of the λ-calculus known as D_{∞}. The techniques which were developed from this form the subject of Chapter II.

Then Plotkin (and later independently Scott), circa 1972, showed how to make P ω (the powerset of the natural numbers) into a model of the λ-calculus, though Scott [1979] traces earlier occurrences of the ideas and sketches a hypothetical Master’s thesis which he claims could have been written in 1928. The account given here is a highly potted version of Scott [1976]. The category of retracts of this model is precisely the category of (countably-based) continuous lattices and Scott-continuous maps.

The definition D ≅ D → D of an η-model is an example of a recursive domain equation. D_{∞} was the first (external, categorical) solution of such a problem, and this technique was developed by Smyth and Plotkin [1978]. This is rather peculiar in that the exponential functor is contravariant in the first argument, and so an auxiliary class of morphisms must be introduced to render the function space construction functorial.

P ω also enables domain equations to be solved, but this time by internalising the constructions (again in an apparently non-functorial way); the required solution is then obtained simply by use of the fixpoint combinator. One of our aims is the explanation of why these two techniques work.

In this section we describe the P ω model, which has the property that the Y combinator really does give least fixed points (with respect to its natural order).

§1.4.2 In order to obtain this property for Y, it is necessary to choose particular explicit bijections among ℕ itself, its set ℕ × ℕ of ordered pairs and its set P_{f}ℕ of finite subsets.

These are “cross-diagonal” and “binary” counting:

⟨n, m⟩ = \frac{1}{2}(n + m)(n + m + 1) + m
a  = ∑{2^{n} : n ∈ a}
e_{m}  = {n : the nth binary digit of m is 1}

\begin{aligned}& 20 \\ & 14 & 19 \\ & 9 & 13 & 18 & & ... \\ m & 5 & 8 & 12 & 17 \\ ↑ & 2 & 4 & 7 & 11 & 16 \\ & 0 & 1 & 3 & 6 & 10 & 15 \\ & & → & n \end{aligned}  \begin{aligned}& & & & & ∅ & & = & 0 \\ & & & & \{ & 0 & \} & = & 1 \\ & & \{ & 1 & \} & & & = & 2 \\ & & \{ & 1 & , & 0 & \} & = & 3 \\ \{ & 2 & \} & & & & & = & 4 \\ \{ & 2 & , & & & 0 & \} & = & 5 \\ \{ & 2 & , & 1 & & & \} & = & 6 \\ \{ & 2 & , & 1 & , & 0 & \} & = & 7 \\ & & & & & & & ... \end{aligned}

Lemma

(a) m ≤ ⟨n, m⟩

(b) n ∈ e_{m} implies n < m. □

§1.4.3 P ω carries an order (setwise inclusion), and a topology, the Scott topology, which we shall discuss in detail in §2.1.4. The sets ↑ e_{m} = {a ∈ P ω : e_{m} ⊂ a} ⊂ P ω form a base for this topology, i.e. any open set is a union of sets of this form.

Lemma A function f : P ω → P ω is continuous iff for all a ∈ P ω we have

f(a) = ⋃ ; {f(e_{m}) : e_{m} ⊂ a}

Proof

[⇒] Let n ∈ f(a), so a ∈ f^{−1}(V) where V = e_{2^{n}}. Hence by continuity there is a basic a ∈ ↑ e_{m} ⊂ f^{−1}(V). Then n ∈ f(e_{m}) and e_{m} ⊂ a, n lies in the right-hand side and we have ⊂. ⊃ is trivial.

[⇐] The sets V = e_{2^{n}} are subbasic (generate the topology by finite intersection and arbitrary union), and it suffices to show that f^{−1}(V) is open. Let a ∈ f^{−1}(V), i.e. n ∈ f(a); then n ∈ f(e_{m}) for some e_{m} ⊂ a, i.e. a ∈ ↑ e_{m} ⊂ f^{−1}(V). □

§1.4.4 It suffices to define a continuous function f on these finite sets, and any monotone such definition will do.

Consequently a continuous function is determined by the set

{⟨n, m⟩ : n ∈ f(e_{m})}

which, by the identification of pairing above, is an element of P ω.

Lemma

(a) With this coding, application is given as

fa = {n : (∃m)(e_{m} ⊂ a ∧ ⟨n, m⟩ ∈ f)}

(b) The composite of these two operations,

u ↦ {⟨n, m⟩ : (∃m′)(e_{m′} ⊂ e_{m} ∧ ⟨n, m′⟩ ∈ u)}

is a closure operator whose image consists of the codes of continuous functions. □

Proposition P ω is a β-model in Sp. □

Strictly speaking Sp is not cartesian closed but Retr(P ω) is a full subcategory of Sp known as ContLat_{ω}; in theorem 2.3.8 we shall see that it consists precisely of the countably based injective spaces. The inclusion and surjection maps are called “graph” and “fun”, hence the alternative name graph model for P ω.

§1.4.5 Our interest in the P ω model lies partly in the fact that its retracts are the continuous lattices and that it is a retract of any other continuous β-model but also in that the Y combinator gives exactly least fixed points.

Proposition Let Y = [[λf(λx.f(xx))(λx.f(xx))]]. Then Yf is the least fixpoint of f : P ω → P ω. Proof (Scott) Put w = λx.f(xx) and let fa = a. To show ww ⊂ a it suffices by continuity to show that e_{m} ⊂ w implies e_{m}e_{m} ⊂ a. This we show by induction on m.

Suppose then that the result holds for m′ < m, and that e_{m} ⊂ w with k ∈ e_{m}e_{m}: we want k ∈ a. But by the definition of application, there is some m′ with ⟨k, m′⟩ ∈ e_{m} and e_{m′} ⊂ e_{m}. But m′ ≤ ⟨k, m′⟩ < m by lemma 1.4.2, and e_{m′} ⊂ w, so by hypothesis e_{m′}e_{m′} ⊂ a. Note also that ⟨k, m′⟩ ∈ w and w is defined by λ-abstraction, so k ∈ we_{m′} = f(e_{m′}e_{m′}). By monotonicity f(e_{m′}e_{m′}) ⊂ fa = a so k ∈ a as required. □

The use of the properties of the identifications is essential, as shown by Baeten and Boerboom [1979]. The crucial point, however, was identified much earlier by Park [1969]; it is that the order on ℕ make tuples more complicated than their components.

§1.4.6 On the combinatory algebra structure of P ω we may as before construct the cartesian closed category Retr(P ω) of types. In the previous discussion of this it was remarked that the various constructions (product, exponential, etc.) were performed by means of combinators. For example

× = λABz.⟨Az_{0}, Bz_{1}⟩
→ = λABf.PA(PfB)

when restricted to types (idempotents) yields their product or exponential.

A kind of “sum” may also be constructed using the P ω-combinator

cond = λtxy.\begin{cases}∅ & if t = ∅ \\ x & if t = \{0\} \\ y & if 0 ∉ t ≠ ∅ \\ ω & otherwise \end{cases}

so

A + B = λz.cond z_{0} ⟨{0}, Az_{1}⟩ ⟨{1}, Bz_{1}⟩

The effect of this on lattices is to take their disjoint union and add new top and bottom elements (cf. lemma 2.6.7). It is most certainly not a binary coproduct, but we shall see in §5.7.4 what it really means.

Recall that retracts are ordered by inclusion of their underlying sets: A ⊂ B iff ∥A∥ = {a : a = Aa} ⊂ ∥B∥; equivalently A = PAB = PBA. This is not the same as the order inherited as elements of P ω. We also say a retract is strict if A⊥ = ⊥; of course since Y gives least fixed points this really is the bottom element ∅.

§1.4.7 Using these operators we may write down domain equations, for instance N = 1 + N for the “natural numbers” and D = A + (D → D) for a model of the λ-calculus with atoms.

Proposition Let F ∈ P ω preserve retracts (so PAA = A implies P(F A)(F A) = F A). Then YF is a retract. If also F preserves strictness and ⊂ then ∥YF ∥ is the bilimit of the ∥F^{n}⊥∥. Proof By proposition 1.4.5 YF = ⋁ ; (F^{n}⊥). By preservation of retracts each term is a retract and by continuity of composition so is the limit. This is not a combinatory fact about Y: it depends on proposition 1.4.5. We shall introduce bilimits in proposition 2.2.4 and explain this more fully in §5.7. □

Our two equations may now be “solved” as N = Y(λn.1 + n) and D = Y(λd.A + d → d). This may be used to provide domains for more complicated programming languages than the λ-calculus, in which objects may be numbers, functions, trees, ... whose values may themselves be arbitrary objects. We simply write down (essentially) the Backus-Naur form of the definition of an expression and apply the Y combinator to it; the syntactic operations in the language will also correspond to semantic operations on the recursively defined type.

This is all very well (and it will be clear that this internal Scott method gives the same answers as the external Plotkin method) but we can hardly claim to have explained what it all means, and surely if we are to use the word “semantics” for these techniques it is incumbent upon us to do so.

§1.4.8 What can we say of the collection of retracts? It’s easy to see that it forms a complete lattice, but Ershov has shown that it is not continuous and so is not the image of a retract [Hosono & Sato 1977]. Scott’s answer to this was to restrict attention to the closure operators, i.e. the continuous inflationary idempotents (1 ≤ c = c^{2}).

Proposition The category of closure operators and functions commuting with them is cartesian closed, and there is a type whose elements correspond bijectively to the types. Proof We have to adopt a different pairing combinator, specifically

[x, y] = {2n : n ∈ x} ∪ {2n + 1 : n ∈ y}
u_{0}  = {n : 2n ∈ u}
u_{1}  = {n : 2n + 1 ∈ u}

which satisfies not only [x, y]_{0} = x and [x, y]_{1} = y but also u = [u_{0}, u_{1}], i.e. it is surjective. With this we construct products and exponentials as before.

The type of types is constructed in the obvious way: V = λA. ⋃ A^{n} which is (and has values which are) continuous and idempotent by continuity of composition. it is inflationary because A itself occurs in the union and its values are because the identity (A^{0}) occurs. □

This category actually consists of the countably based algebraic lattices (proposition 2.3.4). This “type of types” combinator V enables us to interpret polymorphism (where the types are

variable), which will be discussed in chapter III. However once again we have begged the question as to what it all means. It is my opinion the use of closure operators here is also a mistake.

§1.4.9 The intuitive reason why Y should give the least fixed point is that Yf = f(Yf) = f^{2}(Yf) = ..., and so is the limit of the sequence ⊥, f⊥, f^{2}⊥, ... More generally, we may approximate terms syntactically by substituting ⊥ for subterms of β-equivalent terms; such approximants are called Böhm trees if they are in normal form (§1.1.13), and a model is continuous if (it is sensible, i.e. identifies unsolvable terms to ⊥, and) the interpretation of a term is the directed sup of those of its Böhm approximants. Thus in particular Y is the least fixed point combinator in a continuous model.

Proposition P ω is a continuous model. □

1.5 Fixpoint Properties in Categories

+§1.5.1 Having now agreed on the definition of a model of the λ-calculus, it is appropriate the discuss the various forms which one might adopt for an axiom demanding fixpoints for all objects in a category, and to investigate the elementary consequences of these. Let E be throughout a cartesian closed category.

Recall that a lambda β- (respectively η-) algebra is an object Λ ∈ E with Λ^{Λ} ◁ Λ (respectively Λ^{Λ} ≅ Λ).

Define the following reflexivity conditions on A ∈ ob E:

[R_{5}] A is η-reflexive if A ◁ Λ for some η-algebra Λ in E.

[R_{4}] A is β-reflexive if A ◁ Λ for some β-algebra Λ in E.

[R_{3}] A is reflexive if A^{U} ◁ U for some object U of E.

[R_{2}] A has internal fixpoints if there’s a map Y_{A} : A^{A} → A such that the two composites below are equal:

[figure: A^{A}; ⟨⌜id⌝, Y_{A}⟩; A^{A} × A; ev_{A}; π_{1}; A]

[R_{1}] A has external fixpoints if for every f : A → A there’s some a : 1 → A such that a; f = a.

[R_{0}] A is inhabited if there’s some map 1 → A from the terminal object of E.

A category in which every object satisfies R_{4} or R_{5} is said to have enough models of the lambda calculus. If one model Λ suffices for the whole category then it is saturated (see §2.6.1) and we have a subcategory of Retr(Λ); clearly this will not be the case for large categories (in the sense of Definition 2.5.2).

+§1.5.2

Proposition Let F : E → F be a functor preserving products and exponentials; then β- and η-algebras and each of R_{0} to R_{5} are preserved. If in addition F is full and faithful then η-, β-algebras, R_{2}, R_{1} and R_{0} are reflected. Proof These follow easily from the form of the definitions. □

+§1.5.3

Lemma Any finite power of an η- or β-algebra or of an η− or β-reflexive object has the same property. Proof Let Λ^{Λ} ◁ Λ. By repeated Currying we have Λ^{Λ^{n}} ◁ Λ; for Λ^{Λ^{n+1}} ≅ (Λ^{Λ})^{Λ^{n}} ◁ Λ^{Λ^{n}}, and so we have this by induction. So (Λ^{n})^{(Λ^{n})} ≅ (Λ^{Λ^{n}})^{n} ◁ Λ^{n}. Similarly with isomorphisms. Also if A ◁ Λ then A^{n} ◁ Λ^{n}. □

+§1.5.4 We now show the implications between these properties.

Lemma Each of R_{5}, R_{4}, R_{2} and R_{1} implies R_{0}, which is equivalent to A ◁ A^{A}. Proof These may be seen by consideration of the identity as an element of Λ^{Λ} or A^{A}; the remaining case (R_{3} ⇒ R_{0}) will follow shortly. If A has an element (which we may call ⊥) then A is a retract of A^{A} by dropping a variable (§1.2.17), i.e. a ↦ λb.a and f ↦ f⊥. □

+§1.5.5

Lemma Each property is stable under retracts. R_{5} and R_{4} are equivalent to reflexivity by an ηor β-algebra respectively. Proof These follow because retracts are preserved by any covariant or contravariant functor, in particular composition and either side of exponentiation. Let B ◁ A.

[R_{5}, R_{4}] B ◁ A ◁ Λ implies B ◁ Λ.

[R_{3}] B^{U} ◁ A^{U} ◁ U.

[R_{2}] This requires some thought, but the composite B^{B} ↪ A^{A} → A ↠ B will be found to work.

[R_{1}] The external version of the same thing. Let f : B → B, and put g : A ↠ B → B ↪ A for the composite with the surjection and inclusion. We recover f as B ↪ A → A ↠ B. Let a ∈ A with ga = a; then the image of a under the surjection is fixed by f.

[R_{0}] by composition with the surjection.

[R_{5} ⇒ R_{3}^{η}, R_{4} ⇒ R_{3}^{β}] A^{Λ} ◁ Λ^{Λ} ◁ Λ

[R_{3}^{β} ⇒ R_{4}, R_{3}^{η} ⇒ R_{5}] A ◁ A^{U} by dropping a variable, i.e. a ↦ Ka and f ↦ f⊥ where ⊥ ∈ U. Then A ◁ U. □

+§1.5.6 The numbers are justified by the

Proposition Each property implies the next. Proof It remains only to show that R_{3} ⇒ R_{2}. Let c : A^{A}×A^{U} → A^{U} be the obvious composition map and Δ : U → U × U the diagonal. Write u : 1 → A^{U} for the exponential transpose of

[figure: U; Δ; U × U; \overline{p}; A]

where \overline{p} is the exponential transpose of the surjection p : U ↠ A^{U}, the inclusion A^{U} ↪ U being called i. We might say that u is λx.[p(x)](x). Then let Y_{A} : A^{A} → A be

[figure: A^{A} × 1; 1 × u; A^{A} × A^{U}; c; A^{U}; ⊂; i; U; Δ; U × U; \overline{p}; A]

This has the required property. □

Of course this is just a specialisation of the Y combinator, and the “bottom” element constructed for Λ by this process is just (λx.xx)(λx.xx). We have in particular shown that Retr(Λ) has internal fixpoints; it will follow shortly that this means that it cannot have binary coproducts, equalisers or intersections of subobjects.

+§1.5.7 We can force these properties by putting strong completeness conditions on E; this is based on an idea of Martin Hyland:

Proposition Suppose E has products over indexing sets of cardinality up to that of the object set of E. Then it has a β-algebra of which any inhabited object is a retract. Proof Let I ⊂ ob E be the set of inhabited objects and Λ = ∏_{A∈I} A their product. Clearly Λ^{Λ} ∈ I because 1_{Λ} ∈ Λ^{Λ}. Choose a point a for each inhabited object A ∈ I. It suffices that any B ∈ I be a retract of Λ, for then Λ^{Λ} ◁ Λ also. The surjection Λ ↠ B is simply the product projection, since B is one of the factors. The image of b ∈ B under the inclusion is (u_{A}(b) : A ∈ I), where

u_{A}(b) = \begin{cases}b & if A = B \\ a & (the chosen point of A) otherwise \end{cases}
□

The peculiar thing about this result is not really its use of the Axiom of Choice: this “axiom” is commonly found to be a theorem when results using it are applied, because there is usually enough structure in the presentation. The difficulty lies in the dichotomy in the definition of the retract, and in the notion of equality of objects.

Example Let Λ be a domain with Λ ≅ Λ × Λ ≅ Λ^{Λ}. We shall construct such a device in §2.5.11. Then E = {1, Λ}, with the obvious morphisms, satisfies the conditions of the Proposition: since there are only two objects we need only binary products.

§1.5.8 We cannot ask for bigger products than this because of the well-known result due to Peter Freyd:

Proposition Let C be a category with at most κ morphisms. If C has κ-indexed products then it is a complete lattice.

Proof Suppose f, g : X ⇉ Y are distinct. Then |C(X, Y^{κ})| = |C(X, Y)|^{κ} ≥ 2^{κ} > κ by Cantor’s theorem (proposition 1.5.13). □

This depends critically on the assumption Ω = 2 in the base topos (Set); if we drop this assumption it is possible to have small complete proper categories.

+§1.5.9 Now we shall refute some of the reverse implications. Clearly R_{0} ⇏ R_{1}; we now show R_{2} ⇏ R_{3}.

Example Consider the cartesian closed category Pos_{f} of finite partially ordered sets and monotone functions. Any nonempty object is inhabited and any finite poset with a least element has internal fixpoints, but the singleton is the only reflexive object.

Proof Cartesian closure is well-known, the exponential B^{A} being just the set of monotone functions from A to B with the pointwise order. Tarski’s theorem for finite posets gives the fixpoints: the sequence ⊥, f(⊥), f^{2}(⊥), f^{3}(⊥),... is monotone and so eventually constant, and the function assigning to f this ultimate value is monotone. Now suppose A^{U} ◁ U.

Suppose that a < b is a nontrivial instance of the order relation on A. For u ∈ U let f_{u} : U → A by f_{u}(ξ) = a if ξ ≤ u and b otherwise; f_{u} and f_{v} agree on {u, v} only if u ≤ v and v ≤ u. This yields a collection of monotone functions {f_{u} : u ∈ U} with as many elements as U, but it does not exhaust A^{U} because the constant function with value b does not occur. Hence we have found more elements of A^{U} than there are in U.

Suppose then that A is discrete, whence so also is A^{U}. Any map U → A or U → A^{U} is constant on the components of U. So the cardinality of A^{U} is n^{m} where n is the cardinality of A and m is the number of components of U. Then the surjection forces n^{m} ≤ m, which is only possible for n = 1. It is, however, possible to have an inclusion A^{U} ↪ U with n > 1. □

+§1.5.10 R_{1} ⇏ R_{2}. For an introduction to K-spaces see Brown [1964].

Example The category of K-spaces and continuous maps is cartesian closed. The unit interval [0, 1] has external but not internal fixpoints.

Proof Let 𝕀 = [0, 1] and ℝ be the reals. 𝕀 has external fixpoints by the Intermediate Value Theorem. Suppose Y : 𝕀^{𝕀} → 𝕀 were a (continuous) fixpoint operator. Let f : ℝ → 𝕀^{𝕀} by

f(t, x) = \begin{cases}e^{t}x & if t ≤ 0 \\ 1 − e^{−t}(1 − x) & if t ≥ 0 \end{cases}

Then Yf : ℝ → 𝕀 must take value 0 for t < 0 and 1 for t > 0 so is not continuous. □

Questions

(a) Does R_{3} ⇒ R_{4} or R_{4} ⇒ R_{5}?

(b) What is the structure of {X ∈ E : X ⊧ R_{i}}?

+§1.5.11 The rest of this section is devoted to showing that certain properties conflict with fixpoints. This is why we have adopted the weaker definition (§1.2.16) for cartesian closure:

Proposition Let E be lex cartesian closed with every object of E inhabited. Then E is degenerate.

Proof Let A → 1 → A be the constant endomorphism of an object whose value is the given element. Consider the pair A ⇉ A consisting of this and the identity, and let U be the equaliser of the corresponding elements 1 ⇉ A^{A}, so U ↪ 1 is regular mono. But U is inhabited so this is epi and hence iso, which means that the two elements of A^{A} and so the two maps A → A are equal, i.e. A → 1 → A is the identity. Trivially 1 → A → 1 is also the identity, so A ≅ 1. □

In order to interpret logic, as usually understood, in sets or categories we need to choose some class of inclusions (monos) as the “subsets of elements satisfying some condition”. This is called the Axiom of Comprehension, and there may be some restrictions on the class of conditions allowed. Since retracts are well behaved, we expect at least these to be admissible as subobjects. However this result together with lemma 1.2.13γ show that we are unable to use intersections to interpret Conjunction.

Another corollary of this is that we cannot solve double fixpoint equations A ≅ fA ≅ gA for general retracts f, g. We can do this if f and g commute, and have done so several times already.

§1.5.12 Negation and Disjunction also fall. For Negation this is of course the famous liar paradox; the complete lattice case is due to Martin Hyland.

Proposition Let A be an object of E with external fixpoints and which carries a Heyting algebra or complete lattice structure. Then it is degenerate (isomorphic to the terminal object).

Proof Let 0 and 1 be the bottom and top elements w.r.t. the order on A and ¬ : A → A be the “negation” operation. In the Heyting algebra case ¬a = (a → 0) and in the complete lattice case ¬a = ⋁{b : a ⋏ b = 0}. In either case ¬0 = 1. Now suppose ∗ is a fixpoint of ¬. Then in the first case ∗ = ∗ ⋏ ∗ = ∗ ⋏ ¬∗ = 0, but then ∗ = ¬∗ = ¬0 = 1, so 0 = 1. In the other case ∗ ⋏ b = 0 implies b ≤ ∗ so ∗ ⋏ b = b = 0; but then ∗ = ⋁{0} = 0 and 0 = ∗ = ¬∗ = ⋁ A = 1. □

Corollary If every object of E has external fixpoints and E has binary coproducts then E is degenerate.

Proof The coproduct of the terminal object with itself has a Boolean algebra structure, and so is degenerate. It follows that any two global elements 1 ⇉ A of an object are equal. So each object has a unique global element, and applying this to the exponentials in E we deduce that between any two objects there is a unique map. □

§1.5.13 Now let E be a topos with subobject classifier (object of truth values) Ω. We shall prove Cantor’s theorem.

Lemma If either A ↠ B or B ↪ A then Ω^{B} ◁ Ω^{A}.

Proof The map Ω^{B} ↪ Ω^{A} (respectively Ω^{A} ↠ Ω^{B}) given by the exponential contravariant functor gives the inverse image of a subset under the original map. As we shall see in §3.2.16, the inverse image maps have adjoints on both sides, which are quantifiers (∃ on the left, ∀ on the right). Either of these provides an inverse, and hence a retract. □

Corollary Suppose E has an object A with either A ↠ Ω^{A} or Ω^{A} ↪ A; then it is degenerate.

Proof With B = Ω^{A} we then have Ω^{B} ◁ B, so Ω is reflexive. But then it has internal fixpoints, and on the other hand a Heyting algebra structure. □

+§1.5.14 Here is an idea (from a note dated 24 April 1986) for [R_{4} ⇏ R_{5}]. Let Λ be the term λβ-model and E = Retr(Λ), so by definition A ⊧ R_{4} for any object A. Suppose A ⊧ R_{5}, so U^{U} ≅ U for some object U, say u : U^{U} → U and v = u^{−1}. Then u = u; v ; u, v = v ; u; v and

u; v = λf.(v ; u; f ; v ; u)

I conjecture(d) that the only solution to these equations is u = K(uu), v = Ku, i.e. A ≅ 1.

30 CHAPTER 1. CATEGORIES WITH MODELS OF THE LAMBDA CALCULUS

Categories of Domains

2.1 Inductive Partial Orders

+§2.1.1 We shall be concerned with models of the λ-calculus which, like P ω, carry an order structure, and in the categories of types arising from them. We begin by repeating the basic ordertheoretic result (proposition 1.2.2), and observing its converse.

Proposition Let (X, ≤) be a poset with least element ⊥ and a least upper bound for any directed set (written ⋁ ; ). Then any monotone function f : X → X has a least fixed point. Proof Put x_{0} = ⊥ and, inductively, x_{α} = ⋁ ; {f(x_{β}) : β ∈ α}. (This is a concise form of a transfinite recursive definition; alternatively we put x_{α+1} = f(x_{α}) for successor ordinals and x_{λ} = ⋁ ; {x_{α} : α < λ} for limit ordinals.) f is monotone so the sequence is increasing and the sup is indeed directed. By cardinality (Hartogs’ Lemma) the sequence must eventually stabilise, say at x, with f(x) = x. If also y = f(y) then x_{α} ≤ y for each α so x ≤ y. □

+§2.1.2 Naturally the converse to this involves Choice.

Lemma Let (X, ≤) be a poset, a ⊂ X a directed subset and κ a cardinal. Suppose X has a least upper bound for any directed set of cardinality less than κ. Then the set of elements lying below the sup of a directed subset of a of cardinality less than κ is an ideal, which we shall call the κ-completion of a. Proof Induction on κ; if κ is a limit cardinal we need only observe that a union of ideals is an ideal, so suppose κ = λ^{+}. Let b be the λ- and c the κ-completion of a, so b is an ideal. Let x = ⋁ ; x_{α}, y = ⋁ ; y_{α} ∈ c, expressed as unions of directed subsets of a of size less than κ, so at most λ. Put z_{0} = ⊥ and for α < λ let z_{α} be a bound in b for ⋁ ; {z_{β} : β < α}, x_{α} and y_{α}. Then {z_{α} : α < λ} is directed of size (at most) λ so has a least upper bound z ∈ c. Also x_{α}, y_{α} ≤ z_{α} ≤ z so x, y ≤ z. Hence c is directed, and trivially down-closed. □

Proposition Let (X, ≤) be a poset. Then every monotone function f : X → X has a least fixed point iff X has a least element (⊥) and every directed set has a least upper bound. Proof The least fixed point of the identity is ⊥. Let a ⊂ X be directed of cardinality κ (say a = {x_{α} : α < κ}) and suppose inductively that X has all directed sups of size < κ.

Let b be the κ-completion of a and (inductively) for α ∈ κ let y_{α} ∈ b be a bound for x_{α} and ⋁ ; {y_{β} : β ∈ α}. Now define f : X → X by

f(x) = \begin{cases}x & if x is a bound for a \\ y_{α} & if α = \{β : y_{β} ≤ x\} < κ \end{cases}

and verify that this is monotone. Observe that f(x) ≤ x holds only in the first case, where x is a bound. The fixed points of f are therefore exactly the upper bounds of a, and by hypothesis there is a least fixed point. □

§2.1.3 In Number Theory the rings in which one can perform Euclid’s algorithm for finding the highest common factor are called Euclidean Domains, so since Tarski’s theorem characterises posets with ⊥ and ⋁ ; perhaps Tarski Domains would be an appropriate name for them. There seems to be a major industry amongst theoretical computer scientists concerning objects with as little structure as this, and they give them the grandiose title of complete partial orders or cpos.

The converse we have proved does not justify the claim that all directed sups are necessary since (i) the proof was nonconstructive (it asked for a fixpoint of a very peculiar function), (ii) we are only interested in continuous functions and (iii) for computer science purposes we only want the effectively given functions anyway. Nor are the conditions sufficient, since the domains for which there is any use are also given in an effective way.

One ought to expect more of something called “complete” than this, and the word is grossly overused anyway. Since Tarski’s theorem applies to the semantics of recursion, I shall compromise and call them inductive partial orders and write (following Plotkin [1976]) IPO for the category having these as objects and as morphisms the functions preserving directed sups.

§2.1.4 We shall always consider ipos to be provided with the Scott topology:

Proposition Let (X, ≤) be a poset with directed sups.

(a) The down-closed subsets of X which are closed under directed sups form the closed sets of a topology.

(b) A function from X to another poset Y with directed sups is continuous w.r.t. this topology iff it preserves directed sups.

Proof Arbitrary unions and intersections of down-closed sets are down-closed. If we also ask for closure under directed sups have only finite unions. If f : X → Y preserves directed sups (whence by considering the sup of any two comparable elements it’s monotone) then its inverse image preserves closure. Conversely if f is continuous and a ⊂ X directed consider the closure of the image of a, which is ↓(⋁ ; (fa)); the inverse image of this is closed and so contains ⋁ ; a. □

However Johnstone [1979] has shown that the Scott topology need not be sober, although as soon as the conditions which we shall regard as minimal (viz. continuity, §2.3.5) are imposed upon the poset then it is always sober.

§2.1.5 The above derives topology from order. Conversely any topological space carries a preorder on its points, the specialisation order. Here x ≤ y if every open set which contains x also contains y.

Lemma The specialisation order ≤ on a space X is

(a) a partial order (antisymmetric) iff X is T_{0},

(b) discrete iff X is T_{1}. □

Topology can say nothing about spaces below T_{0}, so we shall always assume this holds. [However Fred Linton has pointed out to me that in a finite T_{0} space, int ā ⊂ īnt a (the interior of the closure is in the closure of the interior) for any subset a, so that there are fewer than fourteen sets obtainable using closure and complement, whereas there is a nine-point example of a non-T_{0} space with fourteen.] Since Hausdorff = T_{2} ⇒ T_{1}, part (b) explains why this order does not feature in geometric or analytic topology.

Lemma

(c) Let (X, ≤) be a poset with directed sups, and σ its Scott topology. Then the specialisation order on (X, σ) is ≤.

(d) Let (X, τ) be a sober space and ≤ its specialisation order. Then (X, ≤) has directed sups and any τ-open set is Scott-open. □

Of course this order structure applies not only to the points of a space but also to continuous maps between them.

Lemma

(e) Let X, Y be spaces and f, g : X ⇉ Y continuous maps between them. Then ∀x.fx ≤ gx in the specialisation order on the points of Y iff ∀V.f^{−1}V ⊂ g^{−1}V in the inclusion order on open subsets of X. □

§2.1.6 Now we consider products and exponentials in IPO.

Proposition

(a) IPO has arbitrary products, created by the forgetful functor IPO → Set.

(b) A function of several (perhaps infinitely many) arguments is jointly continuous iff it is separately continuous.

(c) the Scott and Tychonov topologies on a (possibly infinite) product agree. □ Proof

[a] We calculate ⋁ ; componentwise.

[b] By proposition 2.1.4b we have to preserve ⋁ ; ; but this is calculated componentwise so we only need preserve it componentwise.

[c] Let X_{i} ∈ IPO for i ∈ I. Write S, T for the product sets with the respective topologies. By definition S → T is continuous; we have to show that if U ⊂ ∏_{i} X_{i} is Scott-open then it is Tychonov-open. Let (x_{i} : i ∈ I) ∈ U; then for a ∈ P_{f}(I) put

x_{i}^{a} = \begin{cases}x_{i} & if i ∈ a \\ ⊥ & otherwise \end{cases}

so ⋁ ; {(x_{i}^{a} : i ∈ I) : a ∈ P_{f}(I)} = (x_{i}). But U is Scott-open so (x_{i}^{a} : i ∈ I) ∈ U for some a = {i_{1}, ..., i_{r}}. Let U_{1}, ..., U_{r} be the projections of U onto the corresponding factors of the product; then the rectangle U_{1} × ... × U_{r} × ∏_{i∉a} X_{i} is a basic Tychonov-open set containing (x_{i} : i ∈ I) and lying within U. □

This good behaviour for products does not apply to all limits. Though IPO does have cofiltered limits, IPO → Sp does not preserve them.

Example Let C_{n} be the “flat domain” with 2^{n} (maximal) points and ⊥. Consider the diagram with vertices the C_{n} and surjections C_{n+1} → C_{n} which identify pairs of maximal points in the obvious way. The limit C_{∞} of this diagram in Sp is obtained from the Cantor set by adding a closed point ⊥ whose only neighbourhood is the whole space. The limit in IPO is the same set, but with the discrete topology on the maximal points (cf. example 5.2.6d). □

§2.1.7

Lemma In the set of Scott-continuous functions between two ipos with the pointwise order, sups and infs (where they exist) are calculated pointwise. In particular this poset is an ipo. □

Proposition IPO is cartesian closed and has internal fixpoints. Proof The ipo constructed in the lemma is the exponential. We found the fixed points in proposition 1.2.1, and this construction is readily seen to be continuous. □

We shall shortly strengthen this reflexivity property (R_{2} from §1.5.1) to R_{5}. If we were to drop the requirement that there be a least element we would get all limits but of course lose fixpoints.

+§2.1.8 When can we take pullbacks in IPO? A map in a category against which we can take the pullback with any map with the same codomain is said to be carrable (French, means squarable).

Proposition

(a) A Scott continuous map p : X → Y between ipos is carrable iff it is a projection (§1.2.4).

(b) The pullback of a carrable map is carrable.

(c) The composite of two carrable maps is carrable.

(d) Any terminal projection is carrable.

Proof

[a,⇒] If p : X → Y is carrable let y ∈ Y and take the pullback against the corresponding ⌜y⌝ : 1 ↪ Y. This is the inverse image of y in X and has to have a least element, which we call iy. We now have to show that iy ≤ x iff y ≤ px; but since y = p(iy), “only if” is trivial. Let y ≤ px; consider the map 2 → Y by 0 ↦ y, 1 ↦ px and let W be the pullback. (0, iy) is the least element of W, and in particular it is less than (1, x), so iy ≤ x. p therefore has a left adjoint monotone function, and this then has to preserve all, not just directed, sups.

\begin{matrix}W & \overline{} & X \\ Z & . . . . . . . . . . . . . . . . . ; ⊣ & \overline{f} & Y & \begin{aligned}i & \\ & ⊣ \begin{matrix}p \\ \end{matrix} \end{aligned} \end{matrix}

[⇐] Let p : X → Y be a projection and f : Z → Y any continuous function. Let W = X ×_{Y} Z be the pullback in Set, which consists of the set of pairs (x, z) with p(x) = f(z). With the componentwise order this is a poset with directed sups. (i(f⊥_{Z}), ⊥_{Z}) is the least element.

(b,c) are standard properties of pullbacks (1.2.14).

(d) Terminal maps are projections because of ⊥; they are carrable because we have products. □

Example The following map shows that the fourth sentence of the proof is not redundant: each point of the codomain has a least preimage but the map is not a projection.

[figure]

This result will become relevant when we discuss fibrations of ipos in chapter V. Parts (b) to (d) are the axioms for a class of display maps (§4.3.2). Adjoint pairs of maps like these will play a major rôle in the rest of the work.

§2.1.9 As already remarked in §2.1.3, IPO is not particularly interesting in itself but serves as a convenient category in which to perform basic constructions. In fact we shall take more interest in certain cartesian closed full subcategories of it.

Lemma Let C be a full subcategory of IPO which is cartesian closed in itself . Then the products and exponentials in C are those from IPO. Proof

[1] Let T be the terminal, and X any other object of C. By definition there is a unique C-map from X to T, and hence by fullness a unique IPO-map. But there is a map Kt for each t ∈ T, so T has just one point.

[×] Let A, B ∈ C; write A × B for their product in IPO and A ⊗ B for that in C. We have to show that the comparison map A⊗B → A×B in IPO is bijective and order-reflecting. Each element of A ⊗ B (map T → A ⊗ B) gives a pair ⟨a, b⟩ (with a ∈ A, b ∈ B) by composition with the C-product projections, and conversely by the universality of ⊗ each such pair arises from a unique [a, b] ∈ A ⊗ B in this way. Hence we have bijectivity. For order-reflection, let ⟨a, b⟩ ≤ ⟨a′, b′⟩ in A × B; by transitivity we need only consider the (similar) cases a ≤ a′, b = b′ and a = a′, b ≤ b′. We have a (unique) map A → A ⊗ B from 1_{A} : A → A and Kb : A → B; by monotonicity, a ≤ a′ implies [a, b] ≤ [a, b′].

[→] Let A, B ∈ C. By the exponential adjunctions and fullness there is an natural bijection among elements of the C-exponential, continuous functions A → B and elements of the IPO-exponential. To show that this is an order isomorphism, let C ∈ C be an arbitrary nontrivial domain and ⊥ ≠ 1 ∈ C (since 2 ◁ C, cf. Lemma 2.3.1b); given f ≤ g, we can extend these to h : C × A → B with h(⊥, a) = f(a) and h(1, a) = g(a). □

§2.1.10 We devote the remainder of this section to a discussion of finite spaces which will be needed in section 6.

Proposition There is an equivalence between

(α) Finite T_{0} spaces and continuous maps

(β) Finite posets and monotone maps

(γ) Finite distributive lattices and opposite homomorphisms. Proof [α ⇒ β] By the specialisation order. [β ⇒ α] There is a unique (T_{0}) topology on a finite poset for which the specialisation order is the given relation. [α ⇒ γ] The topology. [β ⇒ γ] The lattice of upper sets. [γ ⇒ β] The subposet of coprime elements. □

More generally, the prime filters on an (infinite) distributive lattice provide a space called the spectrum, whose compact open sets are the elements of the given lattice. A space which arises in this way is said to be coherent (see §2.4.6).

+§2.1.11 First we characterise finite surjections and their splittings.

Definition

(a) A subset S of a poset X is convex if when s_{1} ≤ x ≤ s_{2} for s_{1}, s_{2} ∈ S and x ∈ X then x ∈ S.

(b) A subset of a space is called locally closed if it is the intersection of an open set with a closed set.

(c) A collection of subsets X_{1}, ..., X_{n} of a poset X is mutually convex if each is convex and if x_{i_{1}} ≤ y_{i_{2}}, x_{i_{2}} ≤ y_{i_{2}}, ... x_{i_{k−1}} ≤ y_{i_{k}}, x_{k} ≤ y_{1}, for some i_{1}, … i_{k}, x_{i_{j}}, y_{i_{j}} ∈ X_{i_{j}}, then i_{1} = i_{2} = ⋯ = i_{k}. [This definition was incorrectly stated (with k = 2) in the original.]

Lemma Let X be any space and S ⊂ X.

(a) S = f^{−1}(y) for some continuous f : X → Y with Y T_{0} finite and y ∈ Y iff S is locally closed in X.

(b) Such a set is convex in the specialisation order. [This is used in §2.6.2.]

(c) Let X be an ipo; then S is locally closed iff it is convex and closed under and inaccessible by directed sup (i.e. if s ≤ ⋁ ; x_{i} then ∃i, s′.s′ ≤ x_{i}.)

(d) Let X be an algebraic poset (2.3.4); then S is locally closed iff S = {⋁ ; D : D ⊂ C} where C = S ∩ X_{fp}.

(e) In (d), any convex C ⊂ X_{fp} arises in this way.

Proof

[a,⇒] Put U = f^{−1}(↑ y) and A = f^{−1}(↓ y).

[⇐] Let u, v : X → 2 be the characteristic functions of the open sets U and X\A, and put f = ⟨u, v⟩ : X → 2^{2} = Y, y = ⟨1, 0⟩.

[b] Suppose s_{1} ≤ x ≤ s_{2} with f(s_{1}) = f(s_{2}) = y. Then y ≤ f(x) ≤ y.

[c,⇒] (a) applied to Scott-continuity.

[⇐] ↑ S is open and ↓ S closed in the Scott topology.

[d,e] follow from (c). □

Proposition Let X = X_{0} ∪ ... ∪ X_{n−1} be a partition of a space.

(a) This arises from a surjection to a finite T_{0} space iff the sets are locally closed and mutually convex.

(b) It arises from a retract with image x_{i} ∈ X_{i} iff each X_{i} is locally closed and whenever u ∈ X_{i}, v ≤ X_{j} with u ≤ v in the specialisation order we have x_{i} ≤ x_{j}.

Proof Necessity in each case is trivial.

[a] By mutual convexity we may suppose (since there are only finitely many of them) that the X_{j} are numbered in such a way that if u ∈ X_{i}, v ∈ X_{j}, u ≤ v then i ≤ j. Let n = {0, 1, ..., n−1} with 0 < 1 < ... < n − 1 and f : X → n by X_{i} → {i}. This is monotone, surjective and gives rise to the partition: it remains to show that it is continuous. Put U_{i} = ⋃{X_{j} : i ≤ j}. Suppose X_{i} = V_{i} ∩ A_{i} and v ∈ V; by the partition v ∈ X_{j}, say, so by the numbering i ≤ j, and v ∈ U_{i}; hence V_{i} ⊂ U_{i}. Conversely let v ∈ U_{i}, so v ∈ X_{j} for some i ≤ j and then v ∈ V_{j} ⊂ U_{j} ⊂ U_{i}. Hence U_{i} = ⋃{V_{j} : i ≤ j} and is open.

[b] Mutual convexity is forced by the additional condition. Let Y be the poset with the same elements 0, 1, ..., n − 1 as before, but only those instances of the order relation which are forced by monotonicity. Then Y ≅ {x_{0}, ..., x_{n−1}} ⊂ X. □

+§2.1.12 The corresponding problem for injections is much harder. The following result simply amplifies the T_{0} separation axiom.

Lemma Let X be a T_{0} space and S ⊂ X nonempty finite. Then there is a finite T_{0} space T and a continuous map X → T such that S ↪ X → T is continuous and bijective (though not necessarily a homeomorphism). Proof Suppose S = {s_{0}, ..., s_{n−1}} is enumerated in such a way that s_{i} ≤ s_{j} implies i ≤ j (sic), using T_{0}. By the definition of the specialisation order, for i < j we have some open V_{ij} with s_{i} ∉ V_{ij} and s_{j} ∈ V_{ij}. Put

U_{i} = ⋃_{k}{⋂_{j}{V_{jk} : j < k} : i ≤ k} and A_{i} = X\U_{i+1}

Then X = U_{0} ⊃ U_{1} ⊃ ... ⊃ U_{n−1}, s_{i} ∈ U_{i} ∩ A_{i} and these sets partition X. Put T = n = {0, 1, ..., n − 1} and define X → T by U_{i} ∩ A_{i} → {i}. This is continuous because the inverse image of ↑ i is U_{i}; S → X → T is clearly bijective. We can cut down the order relation on T in the same way as remarked in the proof of proposition 2.1.11b. There are obvious counterexamples to homeomorphism. □

In order to split an injection we need to choose a partition satisfying the conditions of proposition 2.1.11b. To construct this it would be useful to know, for instance, that ↓ ↑ x is always closed. However this is not true in general (example 2.5.7b). In fact in section 6 we shall retreat to a “lattice-like” case.

The proof of lemma 2.6.3a is a variant of this.

2.2 The Limit Colimit Coincidence

§2.2.1 In this section we begin to see the real power of (suitable subcategories of) IPO. Tarski’s theorem provides a very simple semantics for recursion, but we find that similar results apply to the category as well as its objects. In other words we can solve recursive domain equations such as that Λ ≅ Λ^{Λ} which defines an η-algebra using fixpoint techniques. At the foundation of this is the limit-colimit coincidence first observed by Scott [1972] in the context of complete lattices; the technique was subsequently developed by Smyth and Plotkin [1978]. As we work through this theory the similarities between domains and categories of domains become more and more conspicuous, and in many places we either deliberately confuse, or are in danger of accidentally confusing, object and meta-levels. Eventually (and this is the major aim of this work) we find that we can push this as far as the construction of a “type of types”.

§2.2.2 Perhaps Scott’s “D_{∞}” model of the λ-calculus is the best place to start. We want a “fixed point” of the construction X ↦ X^{X}. There are three rather obvious problems here. First, after Cantor’s theorem (1.5.13) we might think that X^{X} is rather a lot bigger than X. Second, “fixed point” means that f(X) is equal to X, and it is the very first lesson of Category Theory that equality of objects just does not arise naturally in Mathematics. We shall return to this notion in §5.3.6. Finally, this construction is not functorial, because (X, Y) ↦ Y^{X} is contravariant in its first (raised) argument.

The first problem really just shows that our intuition (based on discrete sets) is simply wrong. Of course any nontrivial Λ with Λ ≅ Λ^{Λ} is infinite, but its infinity is of a “fluid” rather than “granular” kind.

There are two different solutions to the second problem. One involves working in a combinatory model such as P ω, where the types have some kind of canonical representation as elements (though there may still be distinct isomorphic types). Whilst this is very pleasant to work with, in the absence of explanation it’s just conjuring.

The other solution, naturally offered by Category Theory, is to replace equality by isomorphism. We also learn from this discipline that isomorphism is not a property of a pair of objects but a structure between them: we have to quote the maps explicitly and carry them around with us in the construction. More generally, the categorical analogue of Tarski’s theorem requires us to name comparison maps between the objects in the diagram, where previously we replied on the mere existence of (an instance of) the partial order relation.

The third problem we also sweep under the carpet (in the first instance) by a trick, namely to move to an auxiliary class of morphisms. In chapter V we attempt to explain what this is all about, although really there the “explanation” amounts only to a comparison with the Retr(P ω) case.

§2.2.3 Scott’s D_{∞} construction of an η-model in IPO takes us from the weakest to the strongest of the reflexivity properties listed in §1.5.1. We start with some “seed” (such as the twoelement lattice 2) and repeatedly apply the function space construction until it stabilises (recall the notation X_{m} from §1.2.17). From lemma 1.5.4 it is necessary that the seed be inhabited, and this turns out to be sufficient because we use the point to give a particular retraction X ◁ X^{X} (by dropping a variable).

In the context of categories rather than posets we need to specify the comparison maps in the diagram. In our case the first of these is the given retraction X ◁ X^{X} = X_{1}, and subsequent ones are obtained by applying the function-space functor to this. This is not the same as dropping a variable between X_{m} and X_{m+1}.

Whereas with Tarski’s theorem the order relation (and ⊥) forced the terms in the sequence to be increasing, in the categorical case we have to supply comparison maps. [No: the same argument still applies; there is a unique map ⊥ → F ⊥ since ⊥ is initial, and applying F provides the other finite terms. The colimiting cocone gives maps to vertices at limit ordinals; then applying F again to the whole diagram we have another cocone, to which there is a unique mediating map from the colimit.]

Thus we need a pointed endofunctor, i.e. a functor F : C → C together with a natural transformation η_{X} : X → F X. This may be iterated in a diagram of the form

[figure: X; η_{X}; F X; F η_{X}; F^{2}X; F^{2}η_{X}; F^{3}X; F^{3}η_{X}; ⋯; F^{m}X; F^{m}η_{X}; F^{m+1}; X; ⋯]

The reason for using F^{m}(η_{X}) rather than η_{(F^{m}X)} is that when we apply F to the whole diagram we then get another copy of it; hence if F preserves the (filtered) colimit then this colimit, F^{∞}X, will be a fixed point of F in the sense that F (F^{∞}X) ≅ F^{∞}X.

But we have already remarked that the function-space construction is not functorial, so what use is this to our case? Well, we change category. In stead of using continuous maps in IPO we use retractions; then in applying the function space construction, which is partly covariant and partly contravariant, we use whichever of the two maps comes to hand. Thus given (i, p) : X ◁ Y we define (i^{p}, p^{i}) : X^{X} ◁ Y^{Y} by i^{p}f = p; f ; i and p^{i}g = i; g ; p.

+§2.2.4 Let us briefly consider the general retract case.

Let C be any category. Write C^{re} for the category whose objects are those of C and whose morphisms X → Y are pairs (i, p) where i : X ↪ Y and p : Y ↠ X satisfy i ; p = 1_{X}. Let X : I → C^{re} be any diagram. Write lim X_{i} for the limit of the diagram in C whose arrows are the epi parts, colim X_{i} for the colimit of the diagram of monos in C and bilim X_{i} for the limit in C^{re}, where these exist.

Lemma

(a) If lim and bilim both exist then they are isomorphic.

(b) Likewise colim and bilim.

(c) If lim and colim both exist and are isomorphic then so does bilim (and is isomorphic to them). Proof

[a] Let π_{i} : lim → X_{i} and (i_{i}, p_{i}) : X_{i} → bilim be the limiting cones. By the universal property of lim there is a comparison map p : bilim → lim in C with p; π_{i} = p_{i}. Put ι_{i} = i_{i} ; p, then ι_{i} ; π_{i} = 1 so we have a cone in C^{re}. But bilim is universal, so we have a comparison map (ι, π) : bilim → lim in C^{re} with ι; π = 1, i_{i}; ι = ι_{i} and π; p_{i} = π_{i}. Now ι; π_{i} = ι; π; p_{i} = p_{i} so ι satisfies the universal property of p, whence ι = p. Also π;ι;π_{i} = π;ι;π;p_{i} = π;p_{i} = π_{i} = 1;π_{i} so again by the definition of lim, π ; ι = 1. Hence lim ≅ bilim. [Why does i_{i} ; p_{i} = id?]

[b] The same argument in C^{op}.

[c] Put bilim = lim = colim with limiting cones i_{i} : X_{i} → colim and p_{i} : lim → X_{i}. Then (i_{i}, p_{i}) : bilim → X_{i} is limiting. □

If lim, colim and bilim all exist for some diagram of retracts we say C has the limit-colimit coincidence for that diagram. As defined the existence of bilim does not imply that of lim or colim (even when the other exists), but by convention we shall only speak of a bilimit when all three exist.

Example ContLat^{em} has coproducts, calculated as products in ContLat, but ContLat does not have coproducts. □

+§2.2.5 What is the effect of this in a cartesian closed category? Let us recall the effect of the × and → functors in C^{re}. Given (i, p) : X′ ◁X and (j, q) : Y′ ◁Y we have (i×j, p×q) : X′ ×Y′ ◁X ×Y and (j^{p}, i^{q}) : Y′^{X′} ◁ Y^{X}, where j^{p}(f) = p; f ; j.

Proposition Let C be a cartesian closed category with the limit colimit coincidence for the four diagrams X : I → C^{re}, Y : J → C^{re}, X × Y : I × J → C^{re} and [X → Y] : I × J → C^{re}. Then bilim(X_{i} × Y_{j}) ≅ (bilim X_{i}) × (bilim Y_{j}) and bilim(X_{i} → Y_{j}) ≅ (bilim X_{i}) → (bilim Y_{j}). Proof × commutes with all limits anyway, so lim(X_{i} × Y_{j}) ≅ (lim X_{i}) × (lim Y_{j}) and by the lemma the result follows. In particular W × − preserves bilimits (of course if it has a right adjoint then it preserves colimits).

For exponentials,

hom_{C}(W × bilim X_{i}, bilim Y_{j})
≅ hom_{C}(bilim(W × X_{i}), bilim Y_{j})  above
≅ hom_{C}(colim(W × X_{i}), lim Y_{j})  hypothesis
≅ lim_{i} lim_{j} hom_{C}(W × X_{i}, Y_{j})  definition of lim and colim
≅ lim_{i} lim_{j} hom_{C}(W, Y_{j}^{X_{i}})  definition of Y_{j}^{X_{i}}
≅ hom_{C}(W, lim_{i,j} Y_{j}^{X_{i}})  definition of lim
≅ hom_{C}(W, bilim_{i,j} Y_{j}^{X_{i}})  hypothesis
□

§2.2.6 The retraction X ◁ X^{X} given by dropping a variable at ⊥ in IPO is a coclosure. We are interested only in this case. Of course this depends on the 2-structure of IPO.

Proposition IPO has the limit-colimit coincidence for filtered diagrams of embeddings. Proof Let X : I → IPO^{em} be filtered. The limit lim X_{i} consists of I-indexed families (x_{i}) with x_{i} ∈ X_{i} which are compatible in the sense that the projection X_{i} → X_{j} takes x_{i} to x_{j}. These families are ordered pointwise. This has directed sups by continuity, and has bottom (⊥) since projections preserve it.

The colimit poset is to be found embedded in lim X_{i} as follows. Given x ∈ X_{i} we define x_{j} ∈ X_{j} for any j ∈ J for which there is an arrow i → j as the image of x under the appropriate embedding (if there are two such then by filteredness they are coequalised by a further embedding, but this is mono so they were equal to start with); for other j we take by filteredness a suitable bound k for i and j and project from k to j (going to a further bound gives the same answer because the composite of an embedding with its projection is the identity).

However (x_{i}) ∈ lim X_{i} lies above, and indeed is the directed sup of, the embeddings of its components {x_{i} : i ∈ I} so lim X_{i} is also the colimit ipo. □

§2.2.7 Write IPO^{em} and IPO^{pr} for the categories of ipos and respectively embeddings and projections, so IPO^{em} ≃ (IPO^{pr})^{op}.

Proposition Any functor F : IPO^{n} × (IPO^{op})^{m} → IPO which preserves the order between continuous functions also preserves coclosures, splittings thereof, embeddings and projections (but interchanges the last two in the contravariant case). It therefore restricts to a functor (IPO^{pr})^{n+m} → IPO^{pr}. □

We use this to get round the contravariance of the exponential functor in its first argument. It will turn out, however, that the significance of embeddings and projections in IPO is far greater than this mere trick.

Since clearly IPO^{em} has an initial object (the singleton) and these filtered colimits, it bears a striking resemblance to its own objects. The difference, of course, is that it is a large category whilst they are small posets. In order, therefore, to take full advantage of the coincidence of structure we would have to move to ICat, the (2-)category of small inductive categories (with initial object and all filtered colimits) and Scott-continuous (i.e. filtered-colimit preserving) functors. Unfortunately, space forbids discussion of this extension of the theory.

There remains, however, an important distinction of size which we cannot abolish and have to circumvent by surgery.

We shall, however, take immediate advantage of the parallel by calling a functor continuous if it preserves bilimits, i.e. filtered colimits in IPO^{em}. From proposition 2.2.5, × and → are continuous.

Warning The term “continuous” in standard category theory means preservation of all limits. Of course “complete” and “continuous” followed “limit” from General Topology.

§2.2.8 We have now collected the machinery to solve domain equations such as D ≅ D^{D} which amount to finding a fixed point of an continuous endofunctor of IPO^{em}.

Proposition

(a) Let F be a continuous endofunctor of IPO^{em}; then F has a fixed point.

(b) Every object of IPO is the image of some coclosure on an η-model. Proof

[a] We construct the diagram as in §2.2.3 with X the singleton (initial object of IPO^{em}) and X → F X the unique map. Then F^{∞}X is a fixed point.

[b] In the case of the function space construction we get nothing interesting from the singleton. However starting from any D ∈ IPO we have D ◁ D_{1} ◁ ... ◁ D_{∞} where D_{∞} is an η-model. □

§2.2.9 Recall the notion of head normal form from §1.1.13; the (infinite) tree of terms we obtain by developing the recursive head normal form so far and substituting ⊥ for subterms (where one term lies above another in the tree if it is obtained by filling in some terms for occurrences of ⊥) we call the Böhm tree. This gives a directed set of finite syntactic approximants to a term, each of which is in normal form in Λ[⊥, x_{1}, ...]. We say that a model Λ in IPO is continuous (§1.4.9) if the interpretation of a term is the directed sup of the interpretation of its Böhm approximants.

In the D_{∞} model we calculate the interpretation of a term as the directed sup of its approximants in D_{n} for n ≥ n_{0}, where n_{0} measures the complexity of its functionality in the obvious way. These approximants give the same values as the Böhm approximants (it is crucial to start by dropping a variable in order to obtain this: Park [1976]), and so D_{∞} is continuous. In particular Y is the least fixpoint combinator because the Böhm approximants of Yf are just f^{n}⊥.

The D_{∞} construction is illustrated by the figure; observe that the embedding of D_{1} in D_{2} is not by dropping a variable.

[figure: ev; K; pre(K) ; post(ev_{⊥}); pre(ev_{⊥}) ; post(K); ⊥⊥; ⊤⊥; ⊤⊤; ⊥; I; ⊤; ⊥⊥⊥; I⊥⊥; II⊥; III; ⊤II; ⊤⊥⊥; ⊤I⊤; ⊤⊤⊥; ⊤⊤I; ⊤⊤⊤; D_{2} = (2^{2})^{(2^{2})}; D_{1} = 2^{2}; D_{0} = 2; ⊤; ⊥]

Figure 2.2.9: Construction of D_{∞} (after Stoy)

§2.2.10 Moving to the auxiliary class of morphisms was only needed in this technique because of our wish to treat the function space construction. We can do the same for any pointed endofunctor on a category.

Definition Let η : 1 → F : C → C be a pointed endofunctor. An algebra for (η, F) is an object X ∈ C together with a structure map ξ : F X → X such that η_{X} ; ξ = 1_{X}. A homomorphism of F -algebras is a C-map f : X → Y making the square commute:

[figure: F X; F f; F Y; X; ξ; f; Y; υ]

We therefore have a category F -Alg and a forgetful functor F -Alg → C.

Lemma If (X, ξ) is initial in F -Alg then ξ is an isomorphism, indeed it is the initial fixed point of F. □

This reduces the problem of finding fixed points of F to that of finding initial F -algebras, or more generally to finding a free algebra functor, i.e. a left adjoint C → F -Alg to the forgetful functor.

Proposition If C has and F preserves countable filtered colimits then there is a free algebra functor; in this case F has fixed points. Proof Same technique as in proposition 2.2.8a. If also Y ≅ F Y then the unique map X → Y extends to a cone over the diagram (using F^{m}X → F^{m}Y ≅ Y). The mediating map F^{∞}X → Y is the unique such map, so that F^{∞}X is the initial algebra. □

In Universal Algebra, preserving (countable) filtered colimits corresponds to finitary algebraic theories. This is a very common and important phenomenon in Computer Science, since we frequently encounter complicated data types such as stacks, trees, etc., which are specified by means of algebraic operations without recursion.

+§2.2.11 Without the hypothesis of continuity we need to construct a transfinite diagram, and the category may not possess large filtered colimits. There is, for instance, no free complete Boolean algebra on countably many generators.

On the other hand it is not impossible for a proper category (i.e. not a poset) to have all (large) filtered colimits. Indeed any finite category in which idempotents split, and more generally any bilimit of such categories (see §2.5.6), has this property. Hence the generalisation from IPO to ICat is not a trivial one.

We cannot afford the space to prove the following generalisation of Tarski’s theorem.

Fact Let C be a small category with all filtered colimits.

(a) Let η : 1 → F : C → C be a pointed endofunctor of C (not necessarily continuous). Then there is a free F -algebra functor.

(b) An arbitrary intersection of (replete) reflective subcategories of C is reflective. □

+§2.2.12 Embeddings and projections of ipos will play a major rôle in the theory. It will, however, be useful (in §5.2) to make a generalisation. Recall that these two maps are adjoint and their composite is the identity. It seems not generally known that the latter condition is not necessary for most occurrences of these maps in the theory, and apart from this ignorance I have seen no argument to motivate it.

Definition Let f : X → Y be continuous, i.e. in IPO. Then f is

(a) a homomorphism if it has a left adjoint (b) a comparison if it has a continuous right adjoint

(c) a projection if it is a surjective homomorphism (Notation →)

(d) an embedding if it is an injective comparison (Notation ↣).

[Postscript: The corresponding notions in stable domain theory have shown a very close connection between (rigid) comparisons and the (Berry) order relation, namely that stable functions have a factorisation system whose intermediate object is the trace, whilst instances of the order relation give rise to rigid comparisons between the traces. The right adjoint (rigid homomorphism) preserves any internal structure of the domains which is preserved by binary meets bounded above (pullbacks) — in particular if the latter distribute over arbitrary joins then the homomorphism itself has a right adjoint. Rigid homomorphisms therefore behave like logical functors between topos,s locally cartesian closed categories, etc. The name, however, was generalised from continuous lattices (Carl Gunter used the word in the same way and, I believe, for similar reasons), but the “algebraic” notions suggested by this are, for general domains, so weak as to be misleading. I now feel that the choice of the word homomorphism for a Scott-continuous functor with a left adjoint between arbitrary ipos was mistaken.]

Write IPO^{hm}, IPO^{cp}, IPO^{pr} and IPO^{em} for the four categories; there is also a duality at the 2-level, so

IPO^{em}(X, Y) ≃ IPO^{pr}(Y, X)^{op} ⊂ IPO^{cp}(X, Y) ≃ IPO^{hm}(Y, X)^{op}

Propositions 2.2.5-8 generalise immediately from projections to homomorphisms (or from embeddings to comparisons), although of course lemma 2.1.8 does not. Any covariant or contravariant functor of however many variables which preserves order restricts to a covariant functor on C^{cp}, and many important functors (notably products and function-spaces) are continuous in the sense of preserving bilimits. In particular we prove

Lemma IPO^{cp} has filtered colimits. Proof Let X : I → IPO^{cp} be filtered. If i → j in I, the composite of the two maps gives rise to a closure operator on X_{i}, and the system of closure operators corresponding to all of the points beyond i ∈ I is directed. Let c_{i} be the sup of these closure operators on X_{i} and Y_{i} its image. If i → i′ in I we have a comparison X_{i} → X_{i′}, and this gives rise to an embedding Y_{i} ↣ Y_{i′}. We therefore have a diagram Y : I → IPO^{em}. This has a colimit by proposition 2.2.5, and this is the colimit of the original diagram. □

A better proof of the general limit colimit coincidence will be found in Homomorphisms, bilimits and saturated domains.

+§2.2.13

Note Some of the results claimed in the original version of the remainder of this section were fallacious and have been removed. A more thorough treatment of limits and colimits in categories of domains was undertaken in my manuscript Homomorphisms, Bilimits and Saturated Domains, to which the reader is referred.

We can take the pullback of two homomorphisms in IPO (cf proposition 2.1.8a), but the result is not a pullback in IPO^{hm} because the mediating maps from other diagrams do not have left adjoints (though they may occasionally have right adjoints). Indeed

Lemma Let X ∈ IPO. Then the diagonal X → X × X has a left adjoint iff X is a complete lattice. Proof It is binary join. □

Example The pullback of a homomorphism against another in IPO need not be a homomorphism.

[figure: •  •; •; = closure; •  •; •]

[figure: •  •; •; ∘; ⊥; not closure; \overline{closure ▷}; •  •; •; ⊥; closure; ∩]

Figure 2.2.13: Pullback of homomorphisms

+§2.2.14 It is a standard result in elementary category theory that pullbacks and a terminal object suffice to construct all finite limits in a category, and that if further we have cofiltered limits then we have all limits. Unfortunately this does not work in the case of projections, because the pullback does not exist as a functor. Even to show that the maps in the limiting cone are homomorphisms, as we have done for pullbacks, we would need the stronger result.

Example Let X be an ipo but not a lattice. The limit of each of the diagrams in the figure is X and the diagonal, Δ : X → X × X, which is not a homomorphism, is a map in the limiting cone. The last diagram is of the form T ^{2} → IPO.

A category I is called a tree it is non-empty and for any two points i, j ∈ I there is a unique sequence of non-identity arrows in alternate directions between them.

Theorem Let d : I → IPO^{hm} be a tree-shaped diagram of projections. Then the maps in the limiting cone are projections. Proof We use pullbacks to construct limits of finite trees; and arbitrary tree is the filtered union of its finite subtrees. The limit is therefore a bilimit of pullbacks. □

This result is proved in greater detail in [Taylor 1987].

+§2.2.15

Lemma

(a)

IPO^{cp}(X, 2)^{op} ≅ IPO^{hm}(2, X) ≅ \begin{cases}X & if X has ⊤ \\ ∅ & otherwise \end{cases}

where the comparison corresponding to x ∈ X, which we write as [x], is the characteristic function of X \ ↓ x, and the homomorphism takes ⊥ and ⊤ to x and ⊤ respectively.

(b)

IPO^{hm}(X, 2)^{op} ≅ IPO^{cp}(2, X) ≅ X_{fp}

where the homomorphism corresponding to x ∈ X_{fp} is the characteristic function of ↑ x and the comparison takes ⊥ and ⊤ to ⊥ and x respectively. □

[figure: X × X; π_{0}; π_{1}; X; X × X  X; X; π_{0}; X; id]

[figure: X  X × X  X; X  X  X; X × X; π_{0}; X; X; X; π_{1}; 1; X; X; X; X]

Figure 2.2.14: Diagrams equivalent to equalisers

2.3 Continuous Lattices and Posets

§2.3.1 As already remarked, we shall be interested in the category IPO itself only as a convenient place in which to do calculations; the categories which are of concern to us will be full subcategories closed under products, exponentials, retracts and countable bilimits. This section is chiefly concerned with the smallest such category, ContLat_{ω}, which is in fact equivalent to Retr(P ω). Wherever possible, however, our arguments will be given in a form applicable to all continuous posets, not just lattices.

What is the smallest nontrivial category of (countably based algebraic) domains? It has a nonsingleton object D, so this has two distinct points ⊥ and u, with ⊥ ≤ u. This is known as the Sierpinski space, written 2, and it has the following property.

Definition An injective space I is one such that given any diagram of spaces and continuous maps

[figure: U; ⊂; X; .......; I]

where U ↪ X is a subspace inclusion (i.e. a subset of U is open iff it is the intersection of U with an open subset of X, which is equivalent to saying that the map is a regular mono in Sp) there is some (not necessarily unique) map X → I making the triangle commute.

Lemma The Sierpinski space 2 is injective and is a retract of any space which is T_{0} but not T_{1}.

Proof

[a] The inverse image of the open point of 2 under the continuous map is an open subset V of U, and there is a largest open set W in X with W ∩ U = V. Let the extension take the larger value on W and the smaller outside it.

[b] Let x < y in the specialisation order on X. Then 2 ≅ {x, y} ⊂ X so by injectivity we have a postinverse. □

§2.3.2 The importance of the Sierpinski space to topology really lies in the fact that it classifies open sets, i.e. for any X ∈ Sp there is a (natural, order-preserving) bijection between open sets of X and continuous functions X → 2. This makes it a cogenerator for T_{0}Sp, i.e. given f, g : X ⇉ Y if whenever we take the composites with maps Y → 2 they are equal then the original maps were already equal. (This is the dual notion to 1.2.10.)

Proposition A T_{0} space is injective iff it is a retract of a Tychonov power of 2. Proof Powers of injectives (specifically 2) are injective by taking the (canonical) extension on each factor; for retracts first make an extension (of the composite with the mono) into the large space then use the epi to bring it back.

Let X be injective with κ open sets. Let X ↪ 2^{κ} by taking each point to the collection of open sets containing it. Verify that this is a subspace inclusion (it is mono by T_{0}). By injectivity the identity on X extends to a retraction. □

Observe that 2^{X} is the Scott topology on an ipo X.

§2.3.3 The next task is to characterise those posets which occur as retracts of full powerset lattices (powers of the Sierpinski space). We shall do this in four stages. First we shall characterise images of closure operators on 2^{κ} (which give algebraic lattices). Next we introduce continuous posets by the “way below” relation and show that they occur as images of coclosures of algebraic posets. Then we show that continuous lattices are the algebras for directed sups and continuous arbitrary infs. Finally we show that retracts of continuous posets are also continuous.

Definition Let X be an ipo and x an element of it. We say x is compact or finite in X if whenever x ≤ ⋁ ; a, then already x ≤ y for some y ∈ a. Write X_{fp} for the set of compact elements of X. (The reason for this notation is that the categorical analogue is called “finitely presentable”.) Notice we always have ⊥ ∈ X_{fp}.

Example x ∈ 2^{κ} is compact iff it is finite quâ subset of κ. □

Proposition Any comparison of ipos (Definition 2.2.12b) preserves compactness. Proof Let f : X → Y have a continuous right adjoint g : Y → X, let x ∈ X be compact and b ⊂ Y directed with fx ≤ ⋁ ; b in Y. Then by the adjunction and continuity of g, x ≤ g(⋁ ; b) = ⋁ ; (gb) in X. Hence by compactness x ≤ gy for some y ∈ b and again by adjointness fx ≤ y. □

§2.3.4

Definition An element x of an ipo X is finitely approximable if it satisfies x = ⋁ ; {k ∈ X_{fp} : k ≤ x}. Note that it is part of the condition that this set be directed. X is algebraic if every element is finitely approximable.

Algebraic lattices occur as the subobject lattices of finitary algebraic theories, e.g. groups, rings, modules, lattices but not fields (not algebraic) or complete lattices (not finitary). Any subgroup of a group, for instance, is the directed union of the finitely generated (not finite) subgroups it contains. Closure operators have also been familiar in mathematics for a long time in similar contexts (group generated by a subset, for instance).

Proposition The images of continuous closure operators on 2^{κ} are precisely the algebraic lattices. Proof Observe first that 2^{κ} is itself algebraic.

[⇒] Let c^{2} = c ≥ 1 be a continuous closure operator on an algebraic poset X with image Y and let y ∈ Y. Then y = ⋁ ; a where a = {k ∈ X_{fp} : k ≤ x}. But for k ∈ a, ck is compact in X by proposition 2.3.3, and k ≤ ck ≤ y. Hence b = {ck : k ∈ a} ⊂ {l ∈ Y_{fp} : l ≤ y} is directed

and x = ⋁ ; b = ⋁ ; {l ∈ Y_{fp} : l ≤ y} as required.

[⇐] Let X be algebraic and κ = |X_{fp}|. Define X ↪ 2^{κ} by x ↦ {k ∈ X_{fp} : k ≤ x}. Then X is the image of the closure operator c(a) = {k ∈ X_{fp} : k ≤ ⋁ a}. □

§2.3.5 We generalise algebraic to continuous posets by making the notion of finiteness or compactness a relative one.

Definition Let X be an ipo. For x, y ∈ X we say x is way below y if whenever y ≤ ⋁ ; a for a ⊂ X directed then already x ≤ z for some z ∈ a. Write x ≪ y for this relation and ↓↓ y = {x ∈ X : x ≪ y}, ↑ ↑ x = {y ∈ X : x ≪ y}. x ∈ X is approximable if x = ⋁ ; ↓↓ x (directedness being again part of the condition), and X is continuous if every element is approximable.

In the case of the lattice of open sets of the reals, ℝ, x ≪ y means that there is a compact set lying between x and y. A space is locally compact iff its lattice of open sets is continuous; ℝ, for instance, has this property. Scott [1972] gave an argument that continuous posets are the appropriate notion of approximate computation, although most of his followers have since retreated to the algebraic condition.

Proposition

(a) If x ≪ y then x ≤ y

(b) If x′ ≤ x ≪ y ≤ y′ then x′ ≪ y′

(c) x ≪ x iff x ∈ X_{fp}

(d) Comparisons preserve ≪. Proof [a-c] Easy. [d] As proposition 2.3.3. □

§2.3.6 There’s a canonical way of embedding a continuous poset in an algebraic one.

Proposition Let X be a continuous ipo and IdlX its poset of ideals. Then IdlX is an algebraic ipo on which there is a continuous coclosure of which X is the image. Specifically the embedding is x ↦ ↓↓ x and the the projection a ↦ ⋁ ; a. Proof The compact elements of IdlX are the principal ideals, {↓ x : x ∈ X}. This is the largest ideal whose sup is x, so ↓ is right adjoint to ⋁ ; (but is not continuous). ↓↓ x, on the other hand, is the smallest ideal with sup x, so ↓↓ is left adjoint. □

For categories there is a construction called Ind which generalises Idl in the sense that it freely adjoins filtered colimits. A category C has filtered colimits iff the inclusion C ↪ Ind C has a left adjoint. A continuous category is then one for which this functor has a further left adjoint. Johnstone and Joyal [1982] have used these to solve the analoguous questions for toposes which are addressed in this section for spaces.

−§2.3.7 We shall now give the algebraic characterisation of continuous lattices, which shows again the importance of adjoint pairs of continuous maps.

Lemma In a continuous lattice inf distributes over ⋁ ; . Proof Let X be continuous and {x_{jk} : j ∈ J, k ∈ K(j)} be a family of elements of X such that {x_{jk} : k ∈ K(j)} is directed for each j ∈ J. Let M be the set of functions f : J → ⋃_{j∈J} K(j) with ∀j.fj ∈ K(j). Then clearly

l = ⋁ ; _{f∈M} inf_{j∈J} x_{j,f(j)} ≤ inf_{j∈J} ⋁ ; _{k∈K(j)} x_{jk} = r

so we have to show the reverse inequality. By continuity it suffices to show that if u ≪ r then u ≤ l. By the definition of (inf and) ≪ this means ∀j.∃k ∈ K(j).u ≤ x_{jk}, so choose f ∈ M with ∀j.u ≤ x_{j,f(j)}; but then u ≤ l. □

Proposition Continuous lattices are exactly the algebras for directed sup and continuous arbitrary inf; the homomorphisms are continuous functions which have left adjoints.

Proof The lemma provides one implication, and since a monotone function between complete lattices has a left adjoint iff it preserves arbitrary infs it is clear what the homomorphisms are. Hence it remains to show that such an algebra is continuous, for which we have only to show that for each element there is a least ideal whose sup is that element. But by the Lemma the family of ideals with this property is closed under intersection. □

Write ContLat^{hm} for the category of continuous lattices (i.e. (inf, ⋁ ; )-algebras) and homomorphisms. Since in general the regular epis in a category of algebras are the surjective homomorphisms, in this case they are the projections.

The free functor Set → ContLat^{hm} was identified by Day [1975]; it yields the lattice of filters on the powerset. Of more interest to us is the free functor from IPO; this gives the lattice of open filters, as it does on Sp. We shall prove the corresponding result for bcCont in proposition 2.5.9.

This result is the reason for the term homomorphism; the term comparison will be explained in §5.1.10.

−§2.3.8 We now complete the characterisation of injectives.

Lemma A retract of a continuous poset is continuous.

Proof Let f = f^{2} : X → X in IPO with image Y. We first show that if x ∈ X, y ∈ Y with x ≪ y in X then fx ≪ y in Y. For if y ≤ ⋁ ; _{Y} b = ⋁ ; _{X} b for directed b ⊂ Y then x ≤ y′ for some y′ ∈ b and so fx ≤ fy′ = y in Y. Hence for y ∈ Y we have

y = fy = f(⋁ ; _{X}{x ∈ X : x ≪_{X} y}) = ⋁ ; _{Y}{fx : x ≪_{X} y} ≤ ⋁ ; _{Y}↓↓ y

as required, checking that the sets are indeed directed. □ We may sum these and some other results up as follows.

Theorem The following are equivalent for an T_{0} space X with its specialisation order (and the Scott topology by default):

(α) X is injective

(β) X is a continuous lattice

(γ) X is a retract of a (Tychonov) power of the Sierpiński space

(δ) X has arbitrary infs which distribute over directed sups

(ϵ) X is an algebra for the filter monad.

For distributive X we may add:

(ζ) X is the open set lattice of an exponentiable space Y, i.e. one such that the functor − × Y : Sp → Sp has a right adjoint. □

§2.3.9 In order to describe precisely the Scott topology on a continuous poset we need the interpolation property of ≪.

Lemma Let X be a continuous poset and x ≪ z in X. Then for some y, x ≪ y ≪ z. Proof Consider the set S = {v ∈ X : (∃y ∈ X)(v ≪ y ≪ z)}. We first show that S is an ideal; it is clearly nonempty and down-closed. If v_{1}, v_{2} ∈ S then v_{i} ≪ y_{i} ≪ z for some y_{1}, y_{2} ∈ X. Then since ↓↓ z is directed we can find y ≪ z with y_{1} ≤ y ≥ y_{2}, and then since ↓↓ y is directed we can find z ≪ y (whence z ∈ S) with z_{1} ≤ z ≥ z_{2}. Also, we clearly have

⋁ ; S = ⋁ ; {⋁ ; ↓↓ y : y ≪ z} = ⋁ ; {y : y ≪ z} = z. But by hypothesis x ≪ z so x ∈ S. □

Proposition Let X be a continuous poset.

(a) the sets ↑ ↑ x for x ∈ X form a base for the Scott topology.

(b) the compact open sets of X are precisely those of the form ↑ ↑{k_{1}, ..., k_{n}} = ↑ ↑ k_{1} ∪ ... ∪ ↑ ↑ k_{n} for k_{1}, ..., k_{n} ∈ X_{fp}.

Proof

[a] If ⋁ ; D ∈ ↑ ↑ x then by the lemma x ≪ d ≪ ⋁ ; D for some d ∈ D, so ↑ ↑ x is open. Conversely let U be open (and hence upper) and u ∈ U; then ↓↓ u ∩ U ≠ ∅, so u ∈ ↑ ↑ x for some x ∈ U, and ↑ ↑ x ⊂ U.

[b] The given sets are compact since they have a finite set of minimal elements. Let x ∈ X with ↑ ↑ x compact. Then there are y_{1}, ..., y_{r} ∈ ↑ ↑ x with ↑ ↑ x = ↑ ↑ y_{1} ∪ ... ∪ ↑ ↑ y_{r}; w.l.o.g. this set is minimal. But by the lemma x ≪ z ≪ y_{1}, so y_{i} ≪ z ≪ y_{1} for some i, and i = 1 by minimality, whence y_{1} ∈ X_{fp}. Likewise for y_{2}, ..., y_{r}, so ↑ ↑ x is of the given form. Since {↑ ↑ x : x ∈ X} is a basis, the result follows. □

We may characterise the Scott topology on continuous and algebraic posets: see Johnstone [1983] VII theorem 2.6(iii) and corollary 2.9.

Proposition

(c) The Scott topology on a continuous poset is a completely distributive lattice, and every such arises in this way.

(d) Further the lattice is algebraic iff the poset is. □

§2.3.10 For the purpose of doing detailed calculations with continuous ipos it is useful to have a small class of easily describable functions of which any other can be expressed as a directed sup. These are called step functions.

Lemma Let X, Y be continuous ipos and x ∈ X, y ∈ Y. Define

[x ⇒ y] : x′ ↦ \begin{cases}y & if x ≪ x′ in X \\ ⊥ & otherwise \end{cases}

Then [x ⇒ y] is continuous, and its dependence on x is contravariant and on y is covariant. It is compact in X → Y iff x and y are compact in X, Y resp. Proof This is really the characteristic function of the open set ↑ ↑ x. □

Proposition ContLat, AlgLat, ContLat_{ω} and AlgLat_{ω} are cartesian closed. Proof We have only to show that the function space X → Y as calculated in IPO inherits the properties of X and Y. Since it has arbitrary infs constructed pointwise, it is clearly a lattice. Let f : X → Y be continuous. Observe that for f : X → Y, if y ≪ fx in y then [x ⇒ y] ≪ f in X → Y; indeed f is the directed sup of all such functions. In the algebraic case we may choose x, y to be compact. If X and Y have countable bases then the step functions provide a countable basis for X → Y. □

ContPos and AlgPos are not, however, closed under exponentiation (2.4.11-13).

+§2.3.11 Finally we turn to the limit-colimit coincidence for ContPos.

Lemma Let X : I → ContPos^{cp} be a filtered diagram of comparisons of continuous posets; then the bilimit is continuous. If the posets in the diagram are lattices or algebraic then so (respectively) is the bilimit; if they are countably based and I is countable then the bilimit is also countably based.

Proof Recall first that ≪ is preserved by comparisons. Let X_{∞} be the bilimit and x ∈ X_{∞} have images x_{i} ∈ X_{i} under the projections. Then x_{i} = ⋁ ; {y_{i} ∈ X_{i} : y_{i} ≪ x_{i}} in each X_{i}. But identifying the x_{i} and y_{i} with their images under embedding, x = ⋁ ; {x_{i} : i ∈ I} = ⋁ ; {⋁ ; {y_{i} ∈ X_{i} : y_{i} ≪ x_{i}} : i ∈ I} = ⋁ ; {y_{i} : y_{i} ≪ x_{i}, i ∈ I}, whence x is approximated. Replacing ≪ by compactness, the same argument applies to the algebraic case. Since projections preserve infs, we may calculate these componentwise and so being a lattice is preserved. In the countable case we take the union of the bases (identified under embedding).

Theorem ContLat, AlgLat, ContLat_{ω} and AlgLat_{ω} are full subcategories of IPO closed under products, exponentials, images of closures and countable bilimits. Moreover they are the smallest nontrivial such categories also closed under respectively retracts and small bimilits, small bilimits, retracts, and nothing else. □

These properties essentially amount to what we shall define as a category of domains. However we want to make a generalisation first, and that will be the subject of the next section.

2.4 Bifinite Posets

+§2.4.1 When Scott first provided mathematical structures for the semantics of programming languages, he believed that the irrelevance of top to computation was outweighed by the mathematical usefulness of lattices. This view quickly lost favour, chiefly because Plotkin’s [1976] powerdomain construction (which is intended as a semantics for nondeterminism, but is outside the scope of this work) does not preserve the property of being a lattice. Indeed the domains in which Scott himself subsequently took an interest (which sometimes have his name attached to them, though we write bcAlg_{ω}) are themselves continuous (or algebraic) lattices minus their top elements.

There is a larger class of algebraic posets which is closed under the powerdomain constructions, whilst still also being closed under exponentiation. Indeed Smyth [1982] showed that it is the largest cartesian closed full subcategory of countably based algebraic posets.

Definition A bifinite poset is one which may be expressed as a bilimit of finite posets. Write BiPos_{f} for the category of bifinite posets and Scott-continuous maps, and Bi_{ω} Pos_{f} for the full subcategory of countably based such.

(Space forbids discussion of the prefix Bi for general 2-categories.)

We may imagine that bifinite posets describe the limit of a sequence of finite computers. Calculations with integers on finite machines may give overflow, but if they dont overflow then they are correct. An arbitrary computation with integers may be performed on a sequence of machines, each twice as big and twice as fast as the one before. Where two machines both succeed they necessarily agree, and there is a two-way comparison between any machine and any bigger one. This comparison, in information terms, must be an embedding-projection pair.

We shall not settle upon this or an other particular class of ipos to call domains. The reason for this is that there is in fact significant interest in the variability, for the following reason. In §3.3 we shall give a brief introduction to classifying toposes; for present purposes one of these is a (generalised) space whose points are the models of a particular theory in a certain fragment of logic (namely geometric logic). From this, spaces correspond to theories and classes of spaces to classes of theories. It turns out, though again discussion of this goes beyond the intentions of this work, that certain well-known categories of domains correspond to certain identifiable fragments of logic.

We shall derive from this a hierarchy of categories of domains, each one in various flavours according whether they are countably based and whether they are closed under retracts. We shall explore this hierarchy a little in the next section, and in the final section show that we may essentially always assume that we are working with a category of the form Retr(Λ). This section is concerned with the top of that hierarchy, the bifinite posets.

+§2.4.2 We begin with a version of Plotkin’s characterisation, of which the essential idea is the

Definition Let X be a poset.

(a) m ∈ X is a minimal upper bound or mub of S ⊂ X if S ≤ m (i.e. ∀s ∈ S.s ≤ m) and if S ≤ m′ ≤ m then m′ = m.

(b) S ⊂ X has a complete set of mubs if for any S ≤ x ∈ X there’s some mub m of S with m ≤ x.

(c) X is mub-complete is any S ⊂ X has a complete set of mubs.

(d) S ⊂ X is mub-closed if any subset of S has a complete set of mubs which lie within S.

Clearly any subset of a mub-complete poset has a mub-closure, obtained by successively adjoining mubs.

Lemma Let X be a poset and S ⊂ X finite. Then S is the image of a (unique) coclosure on X iff it is mub-closed and S ⊂ X_{fp}. Proof

[⇒] Suppose p : X → S is a continuous right adjoint to the inclusion i : S ↣ X. The elements of S are compact in S because the latter is finite, and embeddings preserve compactness (proposition 2.3.3), so S ⊂ X_{fp}. Let m be a mub of A ⊂ S, so A ≤ m; then since p is a projections fixing A, A = pA ≤ pm ≤ m; but m is minimal above A so pm = m, i.e. m ∈ S. Suppose x ≥ A ⊂ S; then A = pA ≤ px ≤ x; choose m ∈ S minimal with A ≤ m ≤ px; repeating the argument shows that m is a mub in X.

[⇐] Suppose S ⊂ X_{fp} is mub closed and let x ∈ X. Consider the set S ∩ ↓ x, which is by hypothesis finite. Let px be a mub for it below x; by mub-closure px ∈ S so is the greatest element of S ∩↓ x. This gives a right adjoint p to i. It is continuous because px is compact. □

Example Let X be a complete lattice (or at least a boundedly complete poset). Then the finite coclosures of X are given by the finite sub-⋎-semilattices of X_{fp}. □

Notation We shall adopt the convention of using “curly” symbols ⋎ and ⋏ for operations within a lattice to avoid confusion with the logical connectives.

+§2.4.3 Plotkin’s characterisation of bifinite posets proceeded by explicitly adjoining mubs. We may simplify this to

Proposition For a poset X tfae:

(α) X is bifinite

(β) id : X → X is the directed sup of the continuous coclosures on X with finite image.

(γ) X is algebraic and every finite set of compact elements is contained in a finite mub closed set of compact elements.

[figure: (a); (b); (c)]

Figure 2.4.4: Three non-bifinite domains

Proof

[α ⇒ β] Let X = bilim X_{i}, so X → X_{i} are coclosures with finite image. Let x ∈ X with projections

x_{i}. Then x = ⋁ ; x_{i}.

[β ⇒ γ] For x ∈ X, x_{i} ∈ X_{fp} ∩ ↓ x and x = ⋁ ; x_{i}, so X is algebraic. Let k ∈ X_{fp}; then k = ⋁ ; k_{i}, so k = k_{i} ∈ X_{i} for some i. For finite S ⊂ X_{fp} choose X_{i} by the directedness of I; this is a finite mub-closed set by lemma 2.4.2.

[γ ⇒ α] Let (X_{i} : i ∈ I) be the diagram of finite mub-closed subsets of X under inclusion. This is directed and the inclusions have continuous right adjoints. The colimit of these posets accounts for all of the compact elements of X, so X = bilim X_{i}. □

Example A complete lattice or boundedly complete poset is bifinite iff it is algebraic. □

Question In (γ) does it suffice for pairs?

Answer No. Figure 1.7 from [Jung 1987] provides a counterexample.

§2.4.4 We record here for future use the three essential examples of algebraic ipos which are not bifinite.

Examples

(a) Some bounded pair of compact elements of X fails to have a mub below a given bound, so X is not mub-complete; also X → X is not continuous.

(b) X is mub-complete but some pair has infinitely many mubs.

(c) Any finite set of compact elements of X has a finite complete set of mubs, but the construction of adjoining mubs continues indefinitely; again X → X is not continuous.

§2.4.5 We have already done the work in constructing products and exponentials of bifinite posets. Pos_{f} has all finite limits, colimits and exponentials (§1.5.9), and the full subcategory of posets with bottom is still cartesian closed.

Proposition BiPos_{f} has the limit-colimit coincidence and is cartesian closed. Also

(bilim X_{i}) × (bilim Y_{j}) ≅ bilim(X_{i} × Y_{j})
(bilim X_{i}) → (bilim Y_{j}) ≅ bilim(X_{i} → Y_{j})

Proof The diagram defining the bilimit is the filtered union of those defining the terms. From §2.2.5, the product and exponential functors are continuous. Alternatively, let S ⊂ X, T ⊂ Y be mub-closed sets in bifinite posets. Then S × T and S → T are mub-closed sets in X × Y and X → Y respectively. In the first case we take the obvious componentwise projections. In the second case the projection of f : X → Y is the composite S ↣ X → Y → T. The compact functions are therefore those which reduce X to a finite set and apply some function into a finite subset of Y. □

+§2.4.6 Recall that the Scott topology on an algebraic poset is based by the sets ↑ k = {x ∈ X : k ≤ x} for compact k. These are of course compact open sets. A general compact open set is of the form ↑ a = {x ∈ X : k ≤ x for some k ∈ a} where a is a finite (possibly empty) set of finite elements.

Definition A space is coherent it it is sober and compact, it has a base of compact open sets, and the intersection of any two compact open sets is again compact.

The specialisation order on a coherent space gives a profinite poset, i.e. one which is the limit of a diagram of finite posets and monotone maps (not necessarily projections). Since I believe full coherent logic will turn out to be needed in Computer Science in due course, we are not at liberty to use the term profinite for bifinite.

Lemma In a coherent space codirected infs exist. Proof We may calculate them in the finite projections. □

[It was claimed that they distribute over directed sup. This is nonsense.]

Example 2.1.6 shows that the coherent topology on a profinite poset need not be the Scott topology.

Proposition A continuous poset is coherent iff it is algebraic and any finite set of compact elements has a complete finite set of minimal upper bounds. Proof We use the characterisation of compact opens in an continuous poset X (proposition 2.3.9b). Let S ⊂ X_{fp} be finite; then U = {x ∈ X : ∀s ∈ S.s ≤ x} is an intersection of compact opens.

[⇒] U is compact open and so of the form ↑ T with T ⊂ X_{fp} finite. Taking a minimal such form we have a complete finite set of mubs for S.

[⇐] U = ↑ T, where T is the (complete finite) set of mubs for S. This is compact open. □

Notice that we haven’t used the full force of the characterisation of bifinite posets, so the “radio mast” (Example 2.4.4c) is coherent algebraic but not bifinite.

§2.4.7 The characterisation of §2.4.3 applies equally well if we drop the requirement that our posets have bottom elements. Unlike ipos we do not gain all finite limits.

Example The diagram on the left is not bifinite, but it is the equaliser in IPO of two endofunctions of the diagram on the right, viz. the two functions which are the identity everywhere apart from the two ponts in the middle, and send both of those points to one of them. (Carl Gunter)

[figure]

Instead of having a unique bottom element we have a smallest (finite) mub-closed set called the root, which contains the minimal elements. An abstract root is a finite poset with no nontrivial coclosure operator. We say that a continuous functor F preserves a root R if R is the root of F (R). This terminology is due to Gunter [1985].

Proposition A continuous functor F has a bifinite fixpoint with root R iff F preserves R. Proof

[⇒] Let D ≅ F (D) be a fixpoint with root R. Then R is the image of a coclosure on D and so since F is continuous F (R) is a coclosure of F (D). But R is the least coclosure on D so factors through this one and so R is the root of F (R).

[⇐] Let i : R ↣ F (R) be an embedding. Form a diagram from F^{n}(i) : F^{n}(R) ↣ F^{n+1}(R) and take take its bilimit D as before. Since F is continuous D ≅ F (D) with root R. □

Example The function space construction preserves only the singleton root. Proof Clearly otherwise we could embed any bifinite poset in an η-model and hence get least fixed points. More explicitly, if m is minimal in D then Km is minimal in D^{D}, but on the other hand so is the least coclosure (onto the root). Hence unless D has a (unique) bottom, D^{D} has more minimal elements and so a bigger root than D. □

From corollary 2.4.12 in fact any β-model in AlgPos has ⊥.

+§2.4.8 With a great deal of grubbing around with orders on subsets and multiple-valued fixpoints, one may find a generalisation of Tarski’s theorem to bifinite posets without ⊥. The true generalisation, however, is as follows; we shall see why in §5.6.

Proposition Let X be a poset with directed sups, r : X → X a continuous coclosure with splitting i : R ↣ X, p : X → R and f : X → X a continuous function with f ; p = p. Then there is a least continuous function g : R → X with g ; p = 1_{R} and g ; f = g. Proof Put g = ⋁ ; (i; f^{n}). This is directed because i; f ≥ i; r ; f = i; r = i so i; f^{n+1} ≥ i; f^{n}. If h is another such function then h ≥ h; r = i so h = h; f^{n} ≥ i; f^{n} and h ≥ g. □

+§2.4.9 We saw that the topology of bifinite posets is almost described by saying that they are coherent.

Proposition A distribitive lattice arises as the lattice of compact open sets of a (coherent) algebraic poset iff every element is expressable as a finite join of coprimes. Proof Coprimes correspond to compact points of the poset and arbitrary elements of the lattice to compact open sets. In a coherent algebraic poset, compact opens are the upper-sets of finite sets of compact elements. □

Unfortunately the characterisation of the open set lattice of a bifinite posets is not so simple.

Theorem There is no first order theory whose models are precisely those distributive lattices whose spectrum is bifinite. Proof Take the language L to be (include) 1, 0, ⋏, ⋎, ≤, < (we can derive the last two as x ≤ y iff x ⋏ y = x and x < y iff x ≤ y ∧ x ≠ y), together with constant symbols a_{0}, a_{1},... and b_{0}, b_{1},... Suppose T were the alleged first order theory. This would in particular include the usual equational presentation for distributive lattices. Recall that p is prime if (∀xy.x ⋏ y ≤ p)(x ≤ p ∨ y ≤ p).

Now let Γ be the theory of distributive lattices together with the assertions that the a_{i} and b_{i} are distinct primes and

a_{i} ⋎ b_{i} = a_{i+1} ⋏ b_{i+1} (for each i)
(∀x)(∃p, q prime)(x = p ⋏ q)

Any model of Γ is the lattice of compact open sets of an algebraic poset in which any two compact elements have at most two mubs. However there is a pair of compact elements whose mub-closure is infinite, because the “radio mast” (example 2.4.4c) is embedded.

Hence Γ ∪ T is inconsistent. So by the Compactness Theorem Γ_{n} ∪ T has no model for some n, where Γ_{n} is the subset of Γ consisting of just those axioms involving suffices at most n.

But Γ_{n} ∪ T has finite models: the corresponding posets are versions of the radio mast with only finitely many rungs.

Hence there is no such T . □

+§2.4.10 Write mubc(X) for the collection of finite mub closed sets of compact elements of a bifinite poset X ordered by inclusion, and Cocl(X) for the poset of all continuous coclosures on X. Clearly we have naturally Idl(mubc(X)) ⊂ Cocl(X). From the characterisation of bifinite posets mubc(X) is a ⋎-semilattice and Idl(mubc(X)) an algebraic lattice whose top element is the identity.

Example Let X be a continuous but not algebraic lattice and Y = IdlX. Then X is the image of a continuous coclosure on Y which is not a directed sup of finite ones. Proof Recall ↓↓ ⊣ ⋁ ; made X a coclosure of Y (proposition 2.3.6). If this were in Idl(mubc(Y)) then X would itself be bifinite, and in particular algebraic. □

Question Is it true that if X is a retract of a bifinite poset that Cocl(X) is a continuous lattice? This was claimed in the original, but the “proof” depended on the assertion that codirected meets in a profinite poset distribute over directed joins.

Answer (Achim Jung, 4 December 1991) Michael Huth has the following result in his PhD thesis:

Theorem 2.31 Let D be a bifinite dcpo. Then the following are equivalent:

1. Cocl(D) is continuous.

2. Cocl(D) is algebraic.

3. Cocl(D) is an algebraic lattice.

4. D is projection stable i.e. every coclosure has an algebraic image.

So every bifinite domain which is not projection stable is a counterexample to your proposition. Our student Magnus Rothe has generalised this to continuous domains:

If D is a continuous domain and the space of all retractions is continuous then D is already algebraic.

I believe this also holds for the space of all coclosures. □ Cocl extends to a functor, indeed a monad, on bcCont, but not for general continuous domains. mubc(X) × mubc(Y) generates mubc(X × Y) or mubc(X → Y) as a semilattice, and we

may describe either of the latter as the “tensor product”. The case for coproducts is simpler: mubc(X + Y) ≅ mubc(X) × mubc(Y). This is somewhat reminiscent of the behaviour of product topologies.

+§2.4.11 The interest in BiPos_{f} lies in the fact that it is about as much of AlgPos as we can have whilst retaining cartesian closure. Plotkin [1976] conjectured that if X and X^{X} are countably based algebraic ipos then they are bifinite; we devote the remainder of this section to a revised version of Smyth’s [1982] proof of this and slightly more. The techniques are extremely brutal, as are those we shall need to construct saturated domains. The original contribution in our presentation is essentially that we have twice as many lemmas as Smyth: we have shown separately that if each of the conditions fails then a generalised version of the corresponding counterexample is a retract, and that the function-space of the counterexample is not countably based algebraic. This result also differs from other “exponentiability” results such as proposition 2.3.8ζ in that it is more common to use 2 as the “test object”; however in this case 2^{X} is always an algebraic lattice whenever X is an algebraic poset.

For an ordinal α, write α^{op} and α^{∇} for the algebraic ipos made of α “upside down” together with, in the second case, three extra elements {⊥, a, b}; cf. Example 2.4.4a.

Lemma

(a) Let X = α^{op} or α^{∇}. Then X → X is algebraic iff α is a successor ordinal.

(b) Let X be a poset with directed sups and some element x below which there is no minimal element. Then α^{op} ◁ X for some limit ordinal α.

(c) Let X be an ipo with a, b ∈ X_{fp}, x ∈ X such that a, b ≤ x and there is no mub of {a, b} below x. Then α^{∇} ◁ X for some limit ordinal α.

Proof

[a,⇒] We show that if α is a limit then any f ∈ [X → X] (fixing a, b in the second case) is a proper directed sup, whence the identity is not approximable. For β ∈ α let f_{β}(γ) = f(γ) if γ ∈ β and f(γ) + 1 otherwise; then f = ⋁ ; {f_{β} : β ∈ α}.

[a,⇐] If α is a successor then X, and hence X^{X}, is bifinite.

[b] Define i : α^{op} ↪ X for ordinals α. For α = 1, let i(0) = x. For α = β + 1, i(β) ≤ x is not minimal, so let i(α) < i(β). For α a limit, carry on if we can, else stop. Now make α^{op} a retract. For y ∈ X we cannot have ∀β.y ≤ i(β) since otherwise the construction could continue, so let β ∈ α be ∈-least (≤-greatest) with y ≰ i(β) and put p(y) = β.

[c] Essentially similar to (b). □

Corollary If X and X^{X} are both algebraic ipos then X is mub-complete. □

+§2.4.12 Next we dispose of Example 2.4.4b; this time we make crucial use of countability.

Lemma

(a) Let X be a mub-complete algebraic poset with κ ≥ 2 minimal elements. Then X^{X} has at least 2^{κ} minimal elements.

(b) Further let Y ◁ X. Then Y has at most κ minimal elements.

(c) Let X be a mub-complete algebraic ipo, and a, b ∈ X_{fp} have κ ≥ 2 mubs. Then there is a pair of compact elements of X^{X} with at least 2^{κ} mubs.

Proof [a] Let M, N be the sets of minimal elements of X and X^{X} respectively, and let 0, 1 ∈ M be

distinct with 0, 1 ≤ ∞ ∈ X if such a triple exists, otherwise any distinct 0, 1. For A ⊂ M define A : X → X by

A(x) = \begin{cases}1 & if ∃a ∈ A.a ≤ x \\ 0 & if ∃b ∈ M\A.b ≤ x \\ ∞ & if both \end{cases}

(we must have at least one by mub-completeness). Now suppose n ≤ A, B for n ∈ N. These are functions, so n(m) ≤ A(m), B(m) for all m ∈ M. But the restrictions of A and B to M are just the characteristic functions, so A = B. Hence 2^{M} is a quotient of a subset of N.

[b] Let y be minimal in Y and x minimal below iy in X. Then px ≤ p(iy) = y so px = y. Then the set of minimal elements of Y is a quotient of a subset of that for X.

[c] Same method as (a): consider the functions [a ⇒ a] and [b ⇒ b].. □

Corollary

(a) Let Λ be an algebraic poset with Λ^{Λ} ◁ Λ. Then Λ is mub-complete and has ⊥.

(b) Further suppose Λ is not coherent. Then |Λ_{fp}| ≥ ℶ_{ω}, the first strong limit cardinal. This is the limit of ℶ_{n} where ℶ_{0} = ω and ℶ_{n+1} = 2^{ℶ_{n}} (ℶ the Hebrew letter beth).

(c) Let X and X^{X} be countably based algebraic ipos. Then X is coherent. □

Question

(a) Construct such an incoherent algebraic β-model.

(b) Is there a non-algebraic one without ⊥?

+§2.4.13 It remains to bar Example 2.4.4c; for the purpose of this section, define a radio mast to be an infinite mub-complete algebraic poset with both ⊥ and ⊤ and finite set S of points (not containing ⊥ or ⊤) of which it is the mub-closure. The crucial property of such posets is that they have a quasifinite point, a non-finite point for which there is a finite set S of finite points such that every coclosure fixing S fixes the point.

Recall that for a ∈ X_{fp}, [a ⇒ a] is the least continuous function fixing a and is compact in X^{X}; also these functions are incomparable for distinct a ≠ ⊥ (lemmas 2.3.3 and 2.6.6).

Lemma

(a) Let X be a coherent algebraic poset which is not bifinite; then X has a quasifinite point.

(b) Let X have a quasifinite point; then Y ◁ X for some radio mast.

(c) Let X be a radio mast; then X^{X} is not algebraic. Proof Let us first adopt some notation and terminology appropriate to all three parts. There is some set S of compact elements whose mub-closure is infinite; this has at least two but finitely many elements. Assign a level h(x) to points in the mub-closure of S as follows:

h(x) = \begin{cases}0 & if x = ⊥ \\ 1 & if x ∈ S \\ ≤ n + 1 & if x is a mub of two points at level ≤ n \\ ∞ & if x ∉ X_{fp} \\ undefined & if x is not in the mub-closure of S \end{cases}

A quasifinite point is then one at infinite level.

[a] By a chain we mean a finite sequence x_{0} ≤ x_{1} ≤ ... ≤ x_{n} with h(x_{i}) = i; chains are partially ordered by amputation as usual and form a tree. There are at least two, but finitely many, chains with any given endpoint x_{n}, so this tree is infinite but finitely branching. Hence by König’s lemma there is an infinite branch, being the initial segments of an infinite chain m_{0} ≤ m_{1} ≤ ... ≤ m = m_{∞} = ⋁ ; m_{i} with h(m_{i}) = i. m is then a quasifinite point.

[b] Let M = ↓ m and Y be the set of points in the mub-closure of S which lie below m. This construction is unaltered if we now replace S by S ∩ Y, so S ⊂ Y ⊂ M. Y is then a radio mast with generating set S. We shall define a retraction f : X ▷ Y. For x ∈ X_{fp} let U(x) = Y ∩ ↓ x, which increases monotonely with x; then put

f(x) = \begin{cases}y & greatest with y ∈ U(x) if x ∈ M \\ m & otherwise \end{cases}

Each case is monotone in x since U(x) is, so we just have to check for x ≤ x′ with x ∈ M and x′ ∉ M since M is down-closed. But then f(x) = y ∈ U(x) ⊂ U(x′) ≤ m = f(x′). f now extends uniquely to a continuous function on X which fixes Y.

[c] We shall show that the identity, 1_{X}, is neither compact nor approximable in X^{X}. By hypothesis X has a top element which not not compact in X. Hence the identity is not compact since 1_{X} ≤ K⊤ = ⋁ ; {Ka : a ∈ X_{fp}} but 1_{X} ≰ Ka for any compact a. On the other hand, [s ⇒ s] is a compact function below 1_{X} for s ∈ S, and there are at least two (but finitely many) such s. If X^{X} were algebraic, X_{fp}^{X} ∩ ↓ 1_{X} would be directed, i.e. there would be a compact function g with ∀s ∈ S.[s ⇒ s] ≤ g ≤ 1_{X}. We show by induction on the level of x that g(x) = x, i.e. g is the identity, which is not compact. This is so for level 0 or 1 by hypothesis on g, so suppose x has level n + 1, being the mub of a and b at level at most n. Then a = g(a) ≤ g(x) ≤ x (and similarly b), but x was a mub of a and b so g(x) = x. □

cf. Lamma 2.4.2.

Corollary If X and X^{X} are both countably based algebraic ipos then they are both bifinite. □

Proposition Let C ⊂ IPO ∩ AlgPos_{ω} be a full subcategory which is cartesian closed. Then C ⊂ BiPos_{f}. Proof Use lemma 2.1.9 to show that the product and exponential must be those from IPO. □

Note The largest cartesian closed category problem for algebraic and continuous domains with and without bottom has now been solved by Achim Jung. He discovered a new cartesian closed category, whose objects (called L-domains) are characterised by the property that ↓ x is a complete lattice for each x ∈ X, so Example 2.4.4b is one of them. Although he characterised two maximal cartesian closed subcategories of continuous ipos (one of them consisting of continuous L-domains), it remains (January 1992) an open question whether the other is strictly larger than the “continuous domains” defined in the next section — almost certainly it is.

2.5 The Hierarchy of Categories of Domains

+§2.5.1 In this section we explore some further important categories of domains and perform constructions in them. We see a few glimpses of a very rich structure which has yet to be uncovered. The methods I have in mind for investigating this hierarchy of categories of domains further again illustrate the deliberate confusion of object and meta-levels which is a necessary feature of any discussion of a “type of types”. For whereas, on the one hand, we shall see the suggestion of a correspondence between categories of domains and fragments of (coherent) logic (via the classifying topos, which we shall discuss in §3.3), on the other hand it seems that coherent logical properties of the domains themselves are the appropriate tool for classifying the categories.

+§2.5.2 My hope in this work was to define a domain to be a certain kind of continuous category (§2.3.6), and consider arbitrary categories of them (and continuous functors) which are closed under products, retracts, exponentials and (countable) bilimits. Unfortunately the additional theory needed for categories rather than posets far exceeds what was feasible, and even the theory for bifinite posets proved more difficult than expected. We have already seen the majority of the Domain Theory to be considered in this work (we shortly turn our attention to Indexed Category Theory), but for the rest of it we concentrate mainly on bcCont_{ω}.

Question Is the class of retracts of bifinite posets closed under bilimits?

Answer Yes. For a proof see Theorem 4.6 of [Jung 1987].

Because of this embarrassing gap, we define ContDom, the category of continuous domains, to be the full subcategory of IPO generated by BiPos_{f} together with retracts and bilimits. ContDom_{ω} consists of the countably based such.

Lemma ContDom and ContDom_{ω} are cartesian closed. Proof Products and exponentials essentially commute with retracts (proposition 1.3.5&6) and bilimits (proposition 2.2.5). □

Definition Let C be a full subcategory of ContDom closed under products, exponentials and countable bilimits. Then C is a

(i) small category of algebraic domains if C ⊂ Bi_{ω} Pos_{f} and is closed under retracts in so far as they exist there,

(ii) small category of continuous domains if C ⊂ ContDom_{ω} and is closed under retracts,

(iii) large category of algebraic domains if C ⊂ BiPos_{f} and is closed under arbitrary small bilimits and retracts there,

(iv) large category of continuous domains if C ⊂ ContDom and is closed under bilimits and retracts.

We shall describe these variant definitions as flavours.

By the weight of a domain we mean the least cardinality of a base, i.e. set which generates the domain by directed sup. For an algebraic domain X this of course means the cardinality of X_{fp}. The weight of a category of domains is meant the supremum of the weights of its objects.

§2.5.3 By far the most widely used category of domains is bcAlg_{ω}, whose objects are countably based algebraic posets in which any bounded subset has a least upper bound. One may feel confident that this is an appropriate tool for the study of the semantics of deterministic recursive programs. Following our preference for closure under retracts, the corresponding bcCont_{ω} is of more interest to us; similarly we have the other flavours bcAlg and bcCont.

From the point of view of geometric logic, spaces in bcAlg classify models of Horn theories. These have as axioms sequents (i.e. statements of the form ϕ ⊢ ψ, where the “implication” is of an external nature and cannot be embedded) whose antecedent and consequent are built up from atomic formulae using only true, false, and and exists. (Full coherent logic allows finite disjunction and geometric logic infinite disjunction: see §3.3.11.)

Since the conjunction of false (⊥) with anything else is still ⊥ and any sequent with ⊥ as antecedent is redundant, we may divide the axiomatisation into two parts, the first being essentially algebraic, i.e. in which the only connective is finite conjunction, and the second consisting of negations of algebraic formulae. Let us call these the positive and negative parts; more specifically we have a pair of sets P and N of the form

P = {(Γ_{i}, ϕ_{i}) : i ∈ I} N = {Δ_{j} : j ∈ J}

where ϕ_{i} are atomic formulae and Γ_{i}, Δ_{j} are finite sets of atomic formulae. The axiomatisation is inconsistent if, for some j ∈ J, we can deduce each δ ∈ Δ_{j} from P. Alternatively, we may deduce the further sequent Γ ⊢ Δ from (P, N) if we reach inconsistency by adding {(∅, γ) : γ ∈ Γ} to P and {Δ} or nothing to N if Δ is respectively algebraic or false.

This fragment of logic has been implemented computationally as the programming language PROLOG [Clocksin & Mellish 1981]. In this case P is usually larger than N and is called the database, whilst N and possible deductions from (P, N) are called queries. The driving force of a PROLOG interpreter is a unification algorithm, which attempts to find simultaneous substitutions into pairs of terms to make them coincide (syntactically); this enables us to search for applications of axioms and hence develop the proof tree. By this means we determine whether or not a given atomic formula is deduceable from the database.

Scott [1982] has also investigated this fragment of logic and shows by means of information systems that it does indeed correspond to the category bcAlg_{ω}.

§2.5.4 The least nontrivial fragment of coherent logic is essentially algebraic logic, in which ⊥ is excluded. Clearly the notion of inconsistency disappears, though of course we may have only the singleton model. The corresponding category of domains is AlgLat (or ContLat or AlgLat_{ω} or ContLat_{ω} according to taste); the categorical analogue of this is described by Gabriel-Ulmer duality [1971].

Next after this is the logic of partial functions. The domains arising as spaces of models here have the property that for any subset, if every pair from that subset is bounded (consistent) then the whole subset has a least upper bound. The word coherent has been used in the computer science literature to describe these, but again we prefer to reserve this for its established use in logic, category theory and topology. Because of the connection with partial functions we shall call them partial lattices and write PAlg, PCont, PAlg_{ω} and PCont_{ω} for the flavours. Write x#y for ¬∃z.x ≤ z ≥ y.

Proposition (Plotkin 1978) T ^{ω} is a saturated object for PCont_{ω}, where T is the three-element poset looking like a V. Proof We have to show that if X ∈ PCont_{ω} then X ◁ T ^{ω}. We represent elements of T ^{ω} by a pair of disjoint subsets of ℕ. Let e_{n} enumerate a basis for X, so that ∀x ∈ X.x = ⋁ ; {e_{n} : e_{n} ≪ x}. Let ϕ : X → T ^{ω} by

x ↦ ⟨{n : e_{n} ≪ x}, {m : e_{m}#x}⟩

and ψ : T ^{ω} → X by

⟨u, v⟩ ↦ ⋁ ; {e_{n} : n ∈ u ∧ ∀m ≤ n.e_{m}#e_{n} ⇒ m ∈ v}

□

Since in particular its own function space is a partial lattice and therefore a retract, this has a β-model structure; in fact this is a corollary of our theorem 2.6.11c. Barendregt and Longo [1980] have shown that the theory of equality in this model is the same as that in the Böhm tree model.

It is a further consequence of Plotkin’s result that the posets of partial maps between objects of suitable categories are exactly partial lattices. From proposition 2.6.4b it will follow that countability is not necessary in the above result, answering the question in Plotkin’s concluding remarks.

+§2.5.5 We shall now give a hint of the application of coherent logic to classifying the hierarchy of domains. Let ϕ be a coherent formula in the language of posets with n free variables x⃗, so it is a finite disjunction of formulae of the form ∃y⃗.α(x⃗, y⃗) where y⃗ has length m and α is a finite conjunction of instances of the order relation between variables. Then we write (A, a⃗) ⊧ ∃y⃗.α(x⃗, y⃗), where A is a poset and a⃗ ∈ A^{n}, if α(a⃗, b⃗) holds for some b⃗ ∈ A^{m}, and likewise for disjunctions.

Lemma Let f : A → B be a monotone map and (A, a⃗) ⊧ ϕ for some coherent formula ϕ with n free variables and some a⃗ ∈ A^{n}. Then (B, f(a⃗)) ⊧ ϕ. □

Proposition Let A ◁ bilim A_{i} with A_{i} finite, p_{i} : A → A_{i} the obvious maps, ϕ a coherent formula with n free variables and a⃗ ∈ A^{n}. Then (A, a⃗) ⊧ ϕ iff for each i, (A_{i}, p_{i}(a⃗)) ⊧ ϕ. Proof Put a⃗_{i} = p_{i}(a⃗). [⇒] follows easily from the lemma, as does [⇐] for retracts; we split [⇐] for bilimits into the cases involving conjunctions of atomics (follows by definition), the existential quantifier and finite disjunction.

[∃] Let ϕ = ∃y⃗.α(x⃗, y⃗) as above, and suppose for each i, (A, a⃗_{i}) ⊧ ϕ. Then W_{i} = {b⃗ ∈ A_{i}^{m} : α(a⃗_{i}, b⃗)} is nonempty and finite. By the lemma, the projection A_{i} → A_{j} restricts to W_{i} → W_{j}. This is a cofiltered diagram of nonempty finite sets, whose limit is nonempty by lemma 1.2.12b; let b⃗ be in it. Since we have projections, b⃗ = ⋁ ; b⃗_{i}; then (A, a⃗, b⃗) ⊧ α, so (A, a⃗) ⊧ ϕ.

[∨] Now let ϕ = ⋁_{j∈J} ϕ_{j} be a finite disjunction, with each ϕ_{j} of the form in (∃), and for each i, (A_{i}, a⃗_{i}) ⊧ ϕ. Let I_{j} = {i : (A, a⃗_{i}) ⊧ ϕ_{j}}; these sets are down-closed in the diagram by the lemma and cover I. But I is filtered and J finite, so I_{j} = I for some j. Hence (A, a⃗_{i}) ⊧ ϕ_{j} by (∃). □

Question Does this result extend to geometric formulae?

+§2.5.6 There are in fact many more categories of domains lying between ContLat_{ω} and bcCont_{ω}. Write H_{n} for the “topless n + 1-diamond”, i.e. the poset of proper subsets of an n + 1set. Also write P_{r}^{s} for the property (of a poset) that for any s-set, if any r-subset of it is bounded then the whole s-set has a least upper bound; observe that this is a coherent sequent.

Lemma

(a) if s′ ≤ s, X ⊧ P_{r}^{s} and r ≤ r′ then X ⊧ P_{r′}^{s′}.

(b) H_{n} satisfies P_{r}^{s} for all n, r, s unless r < n + 1 ≤ s.

(c) if X ⊧ P_{r}^{s} and Y ◁ X^{U} then Y ⊧ P_{r}^{s}. □

Proposition Given Γ ⊂ {P_{r}^{s} : r, s ∈ ℕ}, let C be the full subcategory of IPO whose objects satisfy Γ and are retracts of countably based bifinite posets. Then C is a small category of continuous domains, and there are infinitely many such C. Proof By part (c) of the Lemma, and proposition 2.5.5, C is closed under exponentials, retracts (hence products by corollary 1.3.5) and countable bilimits. □

Gordon Plotkin claims that the H_{n} classify categories of boundedly complete domains. The crucial point is that any finite boundedly complete poset is a retract of a power of H_{n}, where n + 1 is the size of the largest minimally inconsistent subset. The proof of this is presumably a generalisation of that of proposition 2.5.4, but unfortunately I was unable to locate it in his notes.

+§2.5.7 As a further corollary of this application of coherent logic, we have a result about the subspace topology on Max X, the set of maximal elements of a bifinite poset X.

The interest in Max X lies in the idea [which is plausible at the first order but breaks down for higher order functions, where the logical complexity of the totality condition increases] that it represents the “total” or “terminating” elements of the domain, the others being “partial” or “nonterminating”.

[figure: x]

Figure 2.5.7: Max ∩ ↑ x is not closed in Max

Lemma Let X ∈ ContDom and x ∈ X. Then ↓(↑ x) and ↑ x∩Max X are closed in X and Max X respectively. Proof Following §2.5.2, we have to prove this by induction on the construction of X. It is clearly true for finite posets, so let X be a retract of a bilimit of domains X_{i} in which the result holds and p_{i} : X → X_{i} the appropriate maps. Now “y ∈ ↓ ↑ x” is a coherent formula in x, y, so by proposition 2.5.5, ↓(↑ x) = ⋂ p_{i}^{−1}(↓(↑ p_{i}x)), which is an intersection of inverse images of closed sets and hence closed. The result for Max X follows from the definition of the subspace topology.

Proposition Let X be bifinite. Then Max X is zero-dimensional. Proof If x ∈ X_{fp} then ↑ x ∩ Max X is clopen, and these sets form a base for the topology. □

Example

(a) In an infinite flat domain, Max is not compact.

(b) In this algebraic poset there is a point x with ↑ x ∩ Max not closed.

+§2.5.8 Lattices, partial lattices, boundedly complete posets and the other intermediate categories of domains correspond to subfragments of propositional Horn logic. In the other direction we may investigate what happens when we add disjunction to our fragment — necessarily leading to nondeterministic programs — or move to full model theory in stead of just propositions. The former leads to larger categories of posets (a certain fragment of coherent logic gives all bifinite posets, but as we saw in 2.4.9 it is not full coherent logic and the question as to what fragment it is is not an easy one) and the latter to categories or toposes.

We define a bifinite category to be one which is a bilimit of finite categories. Much of the theory of bifinite posets carries over immediately, though there are pitfalls.

Fact The category of algebraic field extensions of ℚ is bifinite (but is not a poset). □

The mind boggles at the thought of Galois models of the λ-calculus! However there is nevertheless a moral to be drawn from this example. The interest of Algebraic Number Theory lies in the objects of the above category, but it is sometimes convenient to work inside the algebraic closure, 𝔸, of ℚ (or even in the complex numbers, ℂ). This serves the same function as a saturated domain in our subject, and indeed the two constructions are much the same. Our interest lies in types, i.e. objects of the category, but we shall find it convenient to work in a saturated domain, Λ (since it is necessarily a β-model). The choice of a particular algebraic closure of ℚ is irrelevant to algebraic number theory, and we likewise shall regard the particular choice of Λ to be unimportant. (There is actually a distinction in that any two algebraic closures of ℚ are isomorphic.)

§2.5.9 For the remainder of this section we concern ourselves only with bcCont.

Proposition The forgetful functor bcCont^{hm} → bcCont has a left adjoint, F. Moreover the unit X → F X is an embedding. Proof For x ∈ X ∈ bcCont, let F X be the poset of proper filters of open subsets of X and η_{X}x the collection of open neighbourhoods of x. [Note: F X is then a set of sets of sets; a filter is proper iff it does not contain the empty set.]

Given f : X → Y in bcCont we have a homomorphism F X → Y by

\begin{matrix}f^{∗} : Y → F X & by & y & ↦ & \{U : (∃V : y ∈ V)(f^{−1}V ⊂ U)\} \\ f_{∗} : F X → Y & by & Φ & ↦ & ⋁ ; \{⋀\{fx : x ∈ U\} : U ∈ Φ\} \end{matrix}

Then f^{∗} ⊣ f_{∗} since f^{∗}y ⊂ Φ and y ≤ f_{∗}Φ are each equivalent to (∀V : y ∈ V)(f^{−1}V ⊂ Φ). Also f_{∗} is continuous, f = η_{X} ; f_{∗} and η_{X} = 1^{∗}. □

Question Does this hold for other categories of (boundedly complete) continuous domains?

§2.5.10 There is a characterisation of boundedly complete continuous posets similar to that for continuous lattices; indeed much of the theory of one category is obtained directly from the other by minor surgery.

Recall from §2.3.1 that a space is injective if any continuous map to it from a subspace of another space can be extended to the whole of that space. More generally a T_{0} space is densely injective if the same holds for dense subspaces.

Proposition The following are equivalent for a T_{0} space X equipped with its specialisation order:

(α) X is a boundedly complete continuous poset with its Scott topology,

(β) X is a closed subspace of a continuous lattice,

(γ) X ∪ {⊤}, where ∀x.x ≤ ⊤, is a continuous lattice

(δ) X is densely injective

(ϵ) X is an “algebra” for arbitrary inhabited inf distributing over directed sup. Proof Only dense injectivity is not completely obvious.

[γ ⇒ δ] Let A ⊂ B be dense. We may extend any A → X to B → X ∪ {⊤}. X is closed in the codomain, so its inverse image, which contains A, is in the domain. But A is dense, so B → X.

[δ ⇒ γ] Let A ⊂ C, with B the closure of A. Extend A → X to B → X by dense injectivity, and to C → X ∪ {⊤} by C\B → {⊤}. □

Considerations from Universal Algebra strongly suggest that we admit the empty poset to bcCont, but we resist them.

Warning bcCont^{hm} is not algebraic over Set; indeed it is not even complete.

+§2.5.11 Here is something we promised in Example 1.5.7 (this I now understand to be Martin Hyland’s original construction from 1973).

Lemma Let X ∈ ContDom. Then the diagonal map X → X × X is an embedding iff X is boundedly complete. Proof The right adjoint to the diagonal is the binary inf operation. Every continuous domain has directed inf, so this exists iff the domain is boundedly complete. Binary inf is continuous since the domain is continuous. □

Proposition In bcCont there are nontrivial objects Λ with Λ ≅ Λ × Λ ≅ Λ^{Λ}; indeed any object is a retract of such. Proof Let X_{0} ∈ bcCont. Put X_{2n+1} = X_{2n} × X_{2n}, embedding X_{2n} by the diagonal map. Put X_{2n+2} = X_{2n+1}^{X_{2n+1}}, embedding X_{2n+1} by dropping a variable. Finally put Λ = bilim X_{i}. Then Λ ≅ bilim X_{2n+1} ≅ bilim[X_{2n} × X_{2n}] ≅ [bilim X_{2n}] × [bilim X_{2n}] ≅ Λ × Λ by continuity of ×. Similarly Λ ≅ Λ^{Λ}. Also X_{0} ◁ Λ. □

The Y combinator gives least fixed points for the same reason as it did in proposition 2.2.8b. We cannot in general expect to be able to solve double fixpoint equations (§1.5.11), but the

relationship between × and → enables us to find X ◁ Λ ≅ Λ × Λ ≅ Λ^{Λ}. For let U = X^{ℕ} and solve Λ ≅ U^{Λ}. Then U ≅ U × U, Λ ≅ U^{Λ} ≅ (U × U)^{Λ} ≅ U^{Λ} × U^{Λ} ≅ Λ × Λ and Λ^{Λ} ≅ (U^{Λ})^{Λ} ≅ U^{(Λ×Λ)} ≅ U^{Λ} ≅ Λ.

+§2.5.12 A large part of the difficulty in extending results about algebraic domains to the continuous case is that no intrinsic characterisation has yet been found of the retracts of bifinite posets. The problem is really that we have far less grasp on a general retract than on closure and coclosure operators; for lattices we overcame this by factoring a retract as a composite of a closure and a coclosure (this is possible because the intermediate retract is the join of the given one with the identity in a certain lattice — perhaps there’s some kind of “zig-zag” lemma in general).

Unfortunately Idl, which we used in lemma 2.3.6, preserves mub-completeness but not bifiniteness.

Example Let X be the countable power of the poset

•  •

[figure] [figure]

[figure: •; ∘]
[figure]

⊥

Then the pair of sequences {a^{∞}, b^{∞}} in IdlX has infinitely (indeed uncountably) many mubs, namely those sequences each of whose terms is either c or d. □

However if X ∈ bcCont then IdlX ∈ bcAlg.

§2.5.13 Somewhat after the submission of this dissertation, Gordon Plotkin told me of his characterisation of continuous domains. We say a domain X is gradable if there is an increasing sequence of endomorphisms δ_{i} : X → X (not necessarily idempotent) with ⋁ ; δ_{i} = 1_{X} and δ_{i}(X) finite.

It is easy to see that retracts, products and exponentials of gradable domains are gradable, and that countably based bifinite posets are gradable.

δ_{i}(x) ≪ x, and x ∈ X_{fp} ⟺ ∃i.δ_{i}(x) = x. It is not, however, necessarily the case that δ_{i} ≪ 1_{X}.

Proposition (a) Any gradable domain is a retract of a countably-based bifinite poset. Proof Let δ_{i} grade X. Put

Y_{i} = {⟨u_{0}, u_{1}, ..., u_{i}⟩ : u_{j} ∈ ⋃_{k≤j} δ_{k}(X), u_{k} ≤ u_{j} : (k ≤ j ≤ i)}

which is finite; also put Y for the similar set of infinite sequences. These form a bilimiting diagram in which the projections curtail the sequences and the embeddings repeat the last term, so Y is bifinite. We make X ◁ Y by x ↦ ⟨δ_{i}(x)⟩ and ⟨u_{i}⟩ ↦ ⋁ ; u_{i}. □

Corollary A domain is gradable iff it is a retract of a countably based bifinite poset. □

By modifying the definition to say that the deflationary endomorphisms with finite image form a directed set with sup the identity, we should be able to extend this beyond the countably-based case.

Proposition (b) A bilimit of gradable domains is gradable. Proof W.l.o.g. the bilimit is of embeddings. I can only see how to prove the result using one of the variant definitions, so that the i + 1st function dominates the preceding ones. □

Theorem The retracts of (countably based) bifinite posets form a category of domains, and in particular have bilimits. □

2.6 Saturated Domains

§2.6.1 We devote the final section of this chapter on domain theory to the construction of saturated domains, i.e. of which any other occurs as a retract (the word universal appears in the literature, but I take the view that this should be reserved for its categorical sense involving uniqueness). This is done for Bi_{ω} Pos_{f}, though the technique is more widely applicable.

Finding saturated domains is really part of the more comprehensive question of showing that small categories of continuous domains and categories of retracts of continuous models of the λcalculus are one and the same thing. The proof of this in the generality I would have liked has several gaps, but it is shown here for subcategories of bcCont_{ω}.

The point of this, as remarked in §2.5.8 by analogy with algebraically closed fields, is that whilst it is the category of domains which is our primary interest it is convenient to assume that it is of the form Retr(Λ). In chapter V we shall make substantial use of this assumption to motivate our definition and subsequent construction of a type of types.

In contradistinction to the case of algebraically closed fields, the technique is a “bootstrapping” one: we make use of any β-model we are given to construct another with slightly better properties. As has been repeatedly emphasised, the primary interest is not in the structure of any particular model. Moreover since each application of this technique suggests a new desirable property of models of the λ-calculus we make no attempt to formulate the optimal definition.

+§2.6.2 The early constructions of models of the λ-calculus overcame the obvious cardinality problem with discrete sets because the step functions of §2.3.10 provide a handle on the size of the function space. The idea of the construction of saturated domains is much the same: we use the finite posets as a (countable) “basis” for the category.

Lemma Let Y be a finite poset and X = bilim X_{i} in IPO. Then Y occurs as a retract of X iff it occurs as a retract of some X_{i}. Proof [⇐] is obvious. [⇒] We use the characterisation of finite retracts from proposition 2.1.11b. For y ∈ Y let U_{y} and A_{y} be the inverse images of ↑ y and ↓ y, so y ∈ U_{y} ∩ A_{y}. For i ∈ I let p_{i} : X → X_{i} ⊂ X be the corresponding projection, so ⋁ ; {p_{i} : i ∈ I} = 1_{X} (cf. proposition 2.4.3β).

Then for y ∈ Y, y = ⋁ ; {p_{i}y : i ∈ I}, so for some i = i_{y}, p_{i}y ∈ U_{y}. There are only finitely many y, so choose i ≥ i_{y}. Then Z = {p_{i}y : y ∈ Y } is the image of Y in X_{i} and is a choice satisfying the conditions of proposition 2.1.11b. Hence it is the image of a retract on X with the same partition (and Y ≅ Z). This retraction restricts to X_{i}, although the composite Y ≅ Z ◁ X_{i} ◁ X need not be the given retraction. □

Proposition Let X, Y be finite posets. Then Y is an object of any category of domains which also contains X iff Y ◁ X_{m} for some m. Proof

[⇐] Any category of domains is by definition closed under retracts and exponentials.

[⇒] Let Σ be the class of (finite) posets which occur as retracts of iterated function spaces of X. By the lemma, if we extend Σ to a category C by alternately adjoining bilimits and retracts we add no new finite domains. Any such extension remains closed under exponentials (lemma 2.5.2). The closure under such operations is a category of domains, indeed the smallest which also contains X, so it contains Y by hypothesis. Hence Y ∈ Σ. □

+§2.6.3 We would like to show that any category of domains is determined by its finite objects. There is no problem with algebraic domains, but we need to show for continuous domains that we can modify any expression of the form X ◁ bilim Y_{i} to replace the Y_{i} by Z_{i} which are necessarily in any category of domains which contains X.

The best I can do here is by restriction to boundedly complete continuous posets. By a subsemilattice is meant a subset closed under such binary joins as exist.

Lemma

(a) Let X ∈ bcCont and S ⊂ X be a finite subsemilattice. Then S ◁ X.

(b) Let X ∈ bcCont_{ω}. Then X ◁ bilim Y_{i} for some countable diagram of finite posets Y_{i} which are retracts of X.

(c) Let X ∈ bcCont and U be any finite poset. Then X^{U} ◁ X^{n} for some n. Proof

[a] For s ∈ S let U_{s} = {x : (∀t ∈ S : x ≤ t)(s ≤ t)}. Then s ∈ U_{s}, U_{⊥} = X, and s ≤ t iff U_{s} ⊃ U_{t}. Also x ∈ U_{s} ∩ U_{t} iff (∀u ∈ S.x ≤ u)(s, t ≤ u); hence U_{s} ∩ U_{t} = U_{s⋎t}. Now let p : X ↠ S by p(x) = ⋂{s : x ∈ U_{s}}.

[b] Let B be a countable base for X, which we may as well assume to be a subsemilattice. Let S be any finite subsemilattice of B; then S is a retract of X by the Lemma. Then Y = IdlB ≅ bilim S so it suffices to show X ◁ Y. But B was a base, so any x ∈ X is a directed sup from B, hence an element of Y, and the inclusion B ⊂ X extends to a continuous map Y → X. Thus X is in fact a coclosure of Y. Of course we have the same result with “countable” deleted.

[c] Given f : |U| → X (where |U| means the underlying discrete set of U), let g(u) = ⋀{f(q) : u ≤ q}. Then X^{U} ◁ X^{|U|} by a coclosure. □

+§2.6.4 We now have two forms of the desired result, a weak one for general algebraic (i.e. bifinite) domains and a strong one for boundedly-complete continuous domains.

Proposition (a) There is a bijective correspondence between (α) large or small categories C of algebraic domains,

(β) classes Σ of finite posets closed under exponentials and retracts.

Proof Put Σ = C ∩ Pos_{f} and C = Bi_{ω} Σ. Then Σ ↦ C ↦ Σ is trivially the identity and C ↦ Σ ↦ C is because any bifinite poset can be expressed as a bilimit of retracts. Σ is of precisely this form by proposition 2.6.2. □

Proposition (b) There is a bijective correspondence between

(α) large or small categories of boundedly-complete continuous domains,

(β) classes of finite boundedly-complete posets closed under products and retracts.

Proof Further use lemma 2.6.3b for equivalence and lemma 2.6.3c for the form of Σ. □

+§2.6.5 Let H be the poset of categories of algebraic domains under inclusion. We call this the hierarchy.

Theorem

(a) H is an infinite countably based algebraic lattice.

(b) The basis (subposet of compact elements) of the hierarchy below bcAlg is recursively decidable.

Proof

[a] This is an immediate corollary of proposition 2.6.4a since exponentiation and retracts are finitary operations; infinity follows from proposition 2.5.6.

[b] We have only to test, for finite boundedly-complete posets X, Y, whether Y ◁ X^{n} for some n. However it is easy to show that w.l.o.g. n = |X^{Y} |. cf. §2.5.6. □

Question Is it distributive, and if so, what does its spectrum mean?

[My reason for suspecting this is the application of coherent logic to the classification (Question 2.5.5): points in the hierarchy appear to correspond to Grothendieck topologies on Pos_{f} and hence to elements of its locale of nuclei.]

It may be useful to apply (abstract) homology theory to the classification of domains, for instance making the simplicial sets at dimension n the bounded n-tuples of the domain (this idea as it stands unfortunately gives a zero result), although as we noted in §2.5.6, Gordon Plotkin claims that boundedly complete domains have essentially one invariant of products, retracts and bilimits, namely “dimension”. A categorical union of homology and coherent logic, incorporating a generalisation of the notion of dimension, would be needed for general bifinite posets.

Remark See (per Archim Jung)

• Baclawski, Bjoerner: Fixed Points in Partially Ordered Sets, Adv. Math.31 (1979) 263–287.

• Walker: Isotone Relations and the Fixed Point Property for Posets. Discrete Math.48 (1984) 275–288.

+§2.6.6 At this point we temporarily shift emphasis from categories of domains back to models of the lambda calculus and their retracts. First we get a grasp of the size of such a model. Recall from §§2.3.1-2 that the Scott topology on a domain X is 2^{X}.

Lemma Let X be an algebraic ipo and a, b ∈ X_{fp}. If [a ⇒ a] ≤ [b ⇒ b] then either a = ⊥ or a = b. Proof First note b ≰ a iff ∃x.a ≤ x ≱ b; under our hypothesis if this holds then a ≤ ⊥, otherwise b ≤ a. In either case a ≤ y ≥ b for some y, whence the hypothesis gives a ≤ b. □

Proposition Let X be an algebraic ipo with weight κ ≥ ω. Then 2^{κ} ◁ X_{2}. Proof The topology of X_{1} is a retract of X_{2}. By the lemma (X_{1})_{fp} has an antichain (discrete subspace) of cardinality κ, so the topology of X_{1} has 2^{κ} (the topology of a discrete space of size κ) as retract. □

Corollary Let Λ be a β-model in AlgPos of weight κ. Then the flat lattice, κ_{⊥}^{⊤}, of size κ (obtained by adding top and bottom to a discrete set) is an object of Retr(Λ). So is the (ordinal) chain of length κ + 1. Proof These are retracts of 2^{κ}. □

+§2.6.7 We can use this lattice to index products if we have ⊤ in the model; otherwise we want the flat domain, κ_{⊥}, obtained by adding just ⊥ to a discrete set. Unfortunately I cannot see how to get beyond ω.

Lemma Let X ∈ ContPos have bottom but not top. Then

(a) T ◁ X, where T = {0, 1, ⊥} is the poset introduced in §2.5.4

(b) If U, V ◁ X then U +_{⊥} V (obtained by adding a new ⊥ to the disjoint union of U and V) is a retract of X × X.

Proof

[a] Let 0, 1 ∈ X be unbounded; choose 0′ ≪ 0, 1′ ≪ 1 with 0′ ≰ 1 and 1′ ≰ 0. Then take ↑ ↑ 0′ to 0, ↑ ↑ 1′ to 1 and the rest to ⊥.

[b] (cf. §1.4.6) Write T, U, V : X → X for the corresponding idempotents and define an endofunction of X × X by

(x_{1}, x_{2}) ↦ \begin{cases}Ux_{2} & if T x_{1} = 0 \\ V x_{2} & if T x_{1} = 1 \\ ⊥ & if T x_{1} = ⊥ \end{cases}

□

Proposition Let Λ be a β-model in ContPos without top. Then the flat domain, ω_{⊥}, of size ω (add bottom to a discrete set) is an object of Retr(Λ). Proof Let F = λX.X +_{⊥} (K⊥). Then F^{n}(K⊥) has the shape indicated by the figure.

ω_{⊥} ◁ ⋁ ; {F^{n}(K⊥)} by sending all non-open points to ⊥. □

+§2.6.8 We can use the previous two results to construct countable products in Retr(Λ).

Proposition Let Λ be a β-model in BiPos_{f}. Then Retr(Λ) has countable products.

[figure: •; •]
[figure]
•  •
[figure: n points]
[figure: •; •]
[figure]
•  •
[figure]
•  •
[figure]
•

Figure 2.6.7: Lazy natural numbers

Proof Let I = ω_{⊥}^{⊤} if Λ has top, ω_{⊥} otherwise, so I ◁ Λ. Let X_{i} ◁ Λ for i ∈ ω, i.e. X_{i} ∈ Λ with PX_{i}X_{i} = X_{i}. I claim ∏_{i∈ω} X_{i} is a retract of Λ^{I}, and hence of Λ, by

(p : I → Λ) ↦ [i ↦ \begin{cases}⊤ & if i = ⊤ \\ X_{i}(pi) & if i ∈ ω \\ ⊥ & if i = ⊥ \end{cases} ]

For any (x_{i} : i ∈ ω) may be extended to a unique p : I → Λ fixed by this, and any fixed point yields such a family. □

We have various kinds of “sums” by a similar trick.

+§2.6.9 It is not necessarily the case that the class of retracts of a domain is closed under bilimits.

Example Let X be the disjoint union of 2^{n} for n ∈ ω, with a ⊥ added. Then every finite lattice occurs as a retract of X, but no infinite one does. □

Here again we retreat to the case of bcCont.

Lemma Let C be a full subcategory of bcCont closed under retracts and (countable) products. Then C is closed under (countable) bilimits. Proof Let X : I → C^{cp} be a filtered diagram of comparisons; since we have retracts, w.l.o.g. the maps are embeddings. The proof really goes via the global (polymorphic) product, which we shall meet in Chapter V; in fact we show bilim_{i∈I} X_{i} ◁ ∏_{i∈I} X_{i} ◁ ∏_{i∈|I|} X_{i}, by which we mean respectively the bilimit, the polymorphic product and the discrete product. Whereas in the last the terms in the family (x_{i}) may be arbitrary, in ∏_{i∈I} X_{i} they must satisfy x_{i} ≤ π_{ji}x_{j}, and in the bilimit we have equality.

Thus we make ∏_{i∈I} X_{i} ◁ ∏_{i∈|I|} X_{i} by

(x_{i}) ↦ (⋀{π_{ji}x_{j} : i ≤ j}; i ∈ I)

Continuity follows from directed distributivity, and the comparison condition holds because π_{ii′} preserves ⋀ and then we are taking the inf of a larger set for i′ than for i (where i′ ≤ i); finally the operation preserves families which already satisfy the condition.

The comparison map bilim_{i∈I} X_{i} → ∏_{i∈|I|} X_{i} which takes an element of the (bi)limit to the compatible family clearly factors through the inclusion of the polymorphic product. This inclusion is a retract simply by taking the directed sup:

(x_{i}) ∈ ∏_{i∈I} X_{i} ↦ ⋁ ; x_{i} ∈ bilim_{i∈I} X_{i}

Hence we have the required retract and bilim_{i∈I} X_{i} ∈ C. cf. Lemma 5.2.5. □

Proposition Let Λ be a β-model in bcCont_{ω}. Then Retr(Λ) is closed under countable bilimits, and is hence a small category of continuous domains. □

+§2.6.10 We now return to categories of domains to find saturated objects. The construction of this section is like P ω and depends on the foregoing results; that of the next section is more like D_{∞} and follows on from proposition 2.6.4.

Proposition Let C be a small category of boundedly-complete continuous domains and Σ its (countable) class of finite objects. Then Λ = ∏_{X∈Σ}(X^{ℕ}) is a β-model and C ≃ Retr(Λ). Proof Since Λ^{ℕ} ≅ Λ, the class of retracts of Λ satisfies the conditions of lemma 2.6.9 and so is closed under countable bilimits; since it contains Σ, it is Bi_{ω} Σ ≃ C. On the other hand Λ^{Λ} is a bilimit of objects of the form X^{Y} with X, Y ∈ Σ, but these are in Σ since it’s closed under exponentials, so Λ^{Λ} ◁ Λ (somehow). □

+§2.6.11 We shall find a saturated domain for Bi_{ω} Pos_{f} by a more general technique which historically derives from the general construction of algebraic closures of fields.

Proposition Bi_{ω} Pos_{f} has a saturated domain. Proof Let Σ be the category of finite posets with ⊥ and embeddings. We seek a “saturated countable filtered colimit” of Σ.

Consider all finite strings of embeddings in Σ starting from the singleton, ordered by “amputation” (i.e. initial segments); these form a tree, T. There is a diagram T → Σ ⊂ Bi_{ω} Pos_{f}^{em} given on points by taking the object at the end of the string and on arrows by the corresponding embedding.

Let Λ be the limit of this diagram (the name is justified since we shall have Λ^{Λ} ◁ Λ). By theorem 2.2.14 we construct it with pullbacks and bilimits and the maps in the limiting cone are projections.

Now let X ∈ Bi_{ω} Pos_{f}. Then X is the bilimit of an ω-diagram of finite posets and embeddings, w.l.o.g. starting at the singleton. We therefore have a diagram ω → Σ, which may be extended to ω → T ⊂ I by considering initial segments. This is a subdiagram of that defining Λ, so there is an embedding X ↣ Λ as required. □

+§2.6.12 We sum up the results of this section for boundedly-complete continuous domains.

Theorem

(a) Let Λ be a β-model in bcCont_{ω}. Then Retr(Λ) is a small category of boundedly complete continuous domains.

(b) Let C be a small category of boundedly complete continuous domains. Then there is some Λ ∈ C with Retr(Λ) ≃ C.

(c) Any such category consists of retracts of countable bilimits of Σ-objects, where Σ is a class of finite boundedly-complete posets closed under retracts and products, and any such Σ will do. □

The corresponding results for BiPos_{f} are weaker:

Theorem (d) Let Λ be a β-model in ContDom. Then Retr(Λ) is closed under retracts, exponentials and

countable products.

(e) Bi_{ω} Pos_{f} has a saturated object.

(f) Any small category of algebraic domains is of the form Bi_{ω} Σ for Σ some class of finite posets closed under retracts and exponentials, and any such Σ will do. □

§2.6.6 suggests that we obtain nothing new by varying the weight of the category. We may improve the properties of Λ (e.g. Y is the least fixpoint combinator and Λ ≅ Λ × Λ ≅ Λ^{Λ}) by using propositions 2.2.8 and 2.5.8.

72 CHAPTER 2. CATEGORIES OF DOMAINS

Type Polymorphism

3.1 Types are First-Class Citizens

§3.1.1 Types first featured in programming languages in an ad hoc fashion as in FORTRAN, where there are “two kinds of numbers”, and in BASIC and countless operating-system and applications command languages, which have numeric and string variables. Already here, however, we encounter coercion (“widening” in ALGOL 68), which is the automatic conversion of a value of one type (e.g. INTEGER) to the type of its context (e.g. REAL), and overloading, which is the use of the same symbol (e.g. +) for different operations depending on the types of its arguments (e.g. addition of numbers and concatenation of strings).

By the end of the 1960s, however, the possibility of extending the type structure was available to the programmer. Three features in particular may be recognised in ALGOL 68 (see [van Wijngaarden et al. 1975] or [McGettrick 1978]) or PASCAL [Jensen and Wirth 1975].

First, enumerated types, such as

week = {Monday, T uesday, W ednesday, T hursday, F riday, Saturday, Sunday}

to replace the choice and passing of arbitrary numeric codes. This enforces a discipline on the programmer, and by explicitly restricting the choice of values of a parameter makes it more likely that its value will be correct, comprehensible to a future maintainer and consistent with subsequent extension. It also enables a clever compiler to optimise, performing say byte rather than word arithmetic on the value. Mathematically these of course correspond to finite coproducts.

Second, records or structures (corresponding mathematically to finite products) enable data to be organised (passed, copied, compared, ...) at a higher level than a number or string at a time. Finally, variant records provide for the type of an item of data to be varied, the type itself being saved in a tag field; mathematically this corresponds to an indexed sum. These features allow the implementation of operations to be hidden from the user, making it possible subsequently to modify it invisibly.

Languages which have such features are called strongly typed. Most of the type checking can be done at compile-time (as opposed to run-time) because it is syntactic and decidable.

§3.1.2 Even with these extensions, we still have to duplicate code if we wish, say, to calculate the determinant of both real and complex matrices. To avoid this we now allow the type to be a variable, which phenomenon we call polymorphism.

It does not require very much of a mathematical background to realise that the determinant depends only on addition and multiplication, so this process may be performed with respect to any ring. Consequently one may define the determinant function parametrically on the base ring; in other words an additional argument is provided (which we shall by convention list first since the interpretation of subsequent arguments is dependent on it) specifying the type corresponding to the ring.

The code of the polymorphic determinant program, then, consists of the pure algorithm (either the defining polynomial with n! terms in the coefficients or — more likely — Gaussian elimination with pivotting), into which are to be substituted the calls to the addition and multiplication subroutines appropriate to the kind of arithmetic in use. The algorithm, however, is given uniformly for all rings.

For the practical implementation of this, we need to pass to the program not just the type of the elements of the ring which will feature as coefficients in the matrix (which the compiler will use only for type-checking) but also the operations on the ring. We can, of course, already do this in FORTRAN: to the arguments we add functions tMULT (X, Y) and tADD(X, Y), calls to which occur instead of × and + in the code. More abstractly, the initial “type” argument to the routine consists of the entire signature, (R, 0, 1, +, −, ×), of the ring.

It is the word “uniformly” which we shall pursue here. In this example it is precisely the same notion as the “natural” isomorphism of a vector space and its double dual which led Eilenberg and Mac Lane to their original formulation of category theory [1942]. We find that it leads naturally to the notion of classifying topos, which we take the opportunity to introduce (unfortunately, within the scope of the present work the hierarchy of categories of domains in §2.5 is the only occasion we find in the present work to make use of it).

In the particular example of the determinant there is in fact another hidden degree of polymorphism because (even fixing the base ring as ℝ) there are matrices of different sizes. Of course this is because we are really dealing with polymorphism over the category of ℝ-modules. When we discuss this example we shall therefore stick to 2 × 2 matrices and consider just the function a × d − b × c since this suffices to make the point. However it may dawn on us that the design of the “conceptually perfect” programming language is inevitably going to involve the whole of modern Algebra.

§3.1.3 Unfortunately not all of the type constructions one might wish to consider in a programming language are functorial in their parameters. The foremost example of this is the exponential or function space which, like the single dual of a vector space, is contravariant in its first argument. In such circumstances it would appear that this interpretation breaks down.

A successful but nevertheless ad hoc attempt to modify the category of types in order to render the function space construction covariant in the first argument has already been discussed in chapter II. We shall return to it in chapter V where we motivate the claim that it is an example of what we mean by a continuous type dependence.

This leads us to consider languages with type-valued expressions. These may have free variables either of some ordinary type(s) — for instance the type of solutions of some parametric equations — or of type type — e.g. the function space.

In such languages it may no longer be possible to perform type checking at compile-time (clearly, for instance, we cannot know whether an expression has type the solution-set of an equation until we know its value). Indeed it may even be the case that type checking is undecidable, as happens with the language we introduce in §3.5.6.

§3.1.4 There is another notion of polymorphism which predates the advent of electronic computers. This is the belief that, say, the identity function is really unique rather than occurring once for each type. We say that the type of λx.x is really “∀X.X → X′′. We shall introduce two languages, the second order polymorphic lambda calculus and PONDER, which explore this idea. PONDER admits of a variety of curious constructions which one might well consider to have no business to exist.

These will, however, be presented late in the chapter, after we have introduced indexed category theory and applied it to natural deduction, since there are important formal parallels between the constructs.

These are second-order, untyped languages in the sense that the types are terms of a certain single higher type which is not itself a type of the language. It is therefore analogous to the large universe of sets. In the determinant example we were interested in types with the signature of rings rather than sets, whereas here we have only one kind of type. Additionally, it is restricted to the second order in that we do not have facility to consider collectively all (say) algebraic theories.

It would be possible to construct a more elaborate category of types in which the ordinary types have mixed in some “higher” types constructed as powers of the external type of types. There is of course a strong tradition in set theory of such stratification but this approach rapidly leads to great complexity when the objects we want to consider consist not simply of types or elements but algebraic structures on a type together with chosen elements.

We shall return to this topic in §3.5.11.

§3.1.5 This kind of approach also necessarily excludes the compiler itself from being well-typed, since it has to comprehend all types whatever.

Consequently we shall follow what has in the past frequently been a dangerous path and seek models in which there is an “ordinary” type of all types. We are saved from contradiction because the logic interpretable in our system is extremely weak (as we showed in chapter I, if we ask for fixpoints we lose most of Comprehension and all Negation). Nevertheless when, in chapter V, we do construct a model, we still find ourselves sailing very close to the wind.

§3.1.6 There is a strong formal connection between (polymorphic) type theory and natural deduction or proof theory, roughly as indicated in the following table:

Proposition Type
Deduction Term or Function
Proof Element
Conjunction and True Products and Singleton
Disjunction and False Coproducts and Empty
Implication Function-space
Substitution Substitution
Existential Quantifier Sum or Coproduct
Universal Quantifier Product

This may be extended to programs, but the novelty of this attitude means that it is difficult to identify the correct words to use in the table.

We shall take advantage of this analogy by exploring the case of natural deduction first. Since it involves lattices rather than categories, its features can be identified with less work. It nevertheless shows the importance of pullback functors and their adjoints.

§3.1.7 The final ingredient of this present chapter is a discussion of the rôle of variables. The need for such an explicit treatment arises from the fact that since we have both type and term variables we shall be making more sophisticated use of them than we have done so far. Such a discussion also throws further light on the use of indexed categories.

The way in which mathematicians in general use variables is mysterious (in both the medieval and modern senses of the word) to the general population, as one quickly discovers if one attempts to teach third-form algebra. Consider for example the following quotations from a typical school textbook:

(a) “Put x = 3, y = 7 in 4x + 2y”

(b) “Simplify −5a + b^{2} − a(b − a) + a − b”

(c) “Factorise x^{2} + 5x + 6”

(d) “Solve x^{2} + x − 2 = 0”

(e) “Solve x^{2} − 41y^{2} = 1”

(f) “Solve \sqrt{x + 4} + \sqrt{x − 1} = 5”

(g) “Sketch x^{3} + 3xy = 2”

(h) “Prove (x^{2} + y^{2})^{2} − (x^{2} − y^{2})^{2} = 4x^{2}y^{2}”

(i) “Integrate ∫ \frac{dx}{\sqrt{a^{2}+x^{2}}} ”

(j) “Find ∫_{0}^{1} \frac{dx}{\sqrt{1−x^{2}}} ”

Can we be surprised that most people throw up their hands in horror at the sight of Algebra, having been brought up on this diet of philosophical confusion?

§3.1.8 In both programming and pedagogy, variables are introduced as having values in an “environment”. This is a reasonable understanding of x and y in example (a), and — at a stretch — of a and b in (b) if the pupil is persuaded to read apples and bananas (what is the square of a banana?). The view is more tenable in programming because a compiler will demand that all variables be declared, which is tantamount to being given (or at least having) a value.

But clearly this breaks down in the remaining examples from §3.1.7, especially those involving calculus. In (d) and (e) the symbols x and y are better described as indeterminates (there is an additional confusion in that (e) is a Diophantine equation: there is a contextual understanding that we seek all integer solutions). The process of dealing with such problems raises another philosophical difficulty which we expect schoolchildren to grasp without explanation. Historically this was described as analysis (in which we treat the indeterminate as if it were known and deduce its value) and synthesis (in which we make use of this knowledge to prove the solution).

Example (f) particularly illustrates analysis and synthesis; we solve it by twice rearranging and squaring to deduce x = 5. However had we put −5 on the right the typical schoolchild would have made the same deduction, though in this case there is no solution since √ by convention takes nonnegative values. The analysis deduced from the assumption that the value exists what it must be, then synthesis determines whether it does exist.

In examples (b), (c) and (h) the variables are intended to stand for generic numbers. We do not mean that these equations hold for each value which one might care to substitute, but that they hold formally and may be manipulated as such. We see this again when school textbooks talk of “the function sin x”, which notation we improve to x ↦ f(x) or λx.a. In the field 𝔽_{5} of order 5 the polynomial x^{5} − x always takes the value 0, but x^{5} − x = 0 is not an identity in this sense.

The relationship between the environmental and generic use of variables is the same as that between models and theories. If there are enough values for the variable to take (as there are not in 𝔽_{5}) then we have a completeness theorem, that a proposition which holds in all environments is provable.

In the case of an algebraic theory (such as rings or combinatory algebra), variables may be treated as generators for a free algebra. For such a theory completeness is trivial, since provability coincides with truth in the free algebra. We shall touch briefly on coherent logic and find a generic model (in the classifying topos) for which the same is true.

§3.1.9 The typical environmental approach to models of the λ-calculus (e.g. [Meyer 1982]) or to model theory presupposes a fixed infinity of variables and all possible assignments of values to them. When we try to treat variable binding we then have essentially to “overwrite” the valueassignments, and we are obliged to imagine some process for picking new variables out of the air (i.e. which do not occur freely in some collection of expressions). Of course this process is not an algorithm because, of its very nature, it cannot be internalised.

Proposition In Λ[x_{0}, ..., x_{k−1}] there is a term # such that #n enumerates the terms as n runs through (say, Church’s) numerals.

Proof (sketch) Let π_{0}, π_{1} be the unpairing functions arising from the cross-diagonal bijection ℕ × ℕ ≅ ℕ (§1.4.2); these are primitive recursive and hence λ-definable (§1.1.7). Now let

#n = \begin{cases}x_{i} & if π_{0}n ≡ i mod k + 1 \\ #(π_{0}(π_{1}n))(#(π_{1}(π_{1}n))) & if π_{0}n ≡ −1 mod k + 1 \end{cases}

which is also primitive recursive. Then by proposition 1.1.14, Λ[x⃗] = {#n : n ∈ ℕ}. Application and abstraction are also recursive, so there exist !, ♣_{i} with #(!mn) = #m(#n) and #(♣m) = λx_{i}.#m for all m, n ∈ ℕ. □

This does not, of course, work for infinitely many variables.

§3.1.10 The λ-calculus and predicate logic are syntactically more complicated than algebra in that they have variable binding. This also features in examples (i) and (j) of §3.1.7, where it is familiar that the variable of integration is “dummy”. Renaming of dummy variables is called the α-rule.

The fact that the same identifier may occur both free and bound, and indeed may occur bound more than once, is another source of confusion, with the effect that one must apply a modicum of thought to the algorithm of substituting an expression for a free variable. There is also a distinction between an identifier and a name, the latter being a particular occurrence.

The range of a name is the subterm delimited by its binding or declaration, or the whole term if it is free. Since subterms are nested (not overlapping), so are ranges. The scope of a name is its range minus any nested range of a name with the same identifier; thus within its scope a name is determined by the identifier.

There are syntactic devices for overcoming this confusion, by eliminating bound variables altogether. The transition from λ-calculus to combinatory algebra which we made in chapter I is the prime example of this. Another technique is to replace each use of a bound variable by a numeral, given by the number of binding operators which separate the use from the binding operator which governs it. Arguably the almost universal practice amongst programming languages of identifying subroutine arguments (bound variables) with their values under application positionally already relegates them to mere names of product projections.

It is usual for a compiler to resolve these things and build its symbol table at a very early stage in its processing. It is well known that a context-free grammar cannot recognise repetitions of a subterm; for this and other reasons the syntactic phase of compilation is devided into tokenisation (in which we strip spaces and comments and recognise identifiers and operators as syntactic atoms using a regular grammar) and parsing (in which the structure of the program is found).

For a practical discussion of compilers see [Aho and Ullman 1977] and its bibliography.

§3.1.11 Yet another confusion which arises with variables is the old and thorny problem of use (value) and mention (name). This is particularly dangerous in the context of assignment: when we write “x := y” we use y and mention x.

The authors of ALGOL 68 put a great deal of effort into assignment, making a novel use of types (or, as they idiosyncratically called them, assignation and modes). The signature of the assignment (say for integers) is (refint, int), and if y happens to have mode refint we have first to coerce (dereference) it to int.

§3.1.12 There is another problem which arises when a named procedure uses a variable which is not defined within the procedure but (possibly) within an enclosing one, and this procedure is called in a different context in which the variable is also defined. This is called the dynamic free variable problem. Which value for this variable should be used?

§3.1.13 The final problem with variables which we consider arises in Natural Deduction from the possibility of an empty domain. From the two rules

\frac{∀x.ϕ(x)}{ϕ(t)} (∀E) (∃I) \frac{ϕ(t)}{∃x.ϕ(x)}

it is an easy matter to deduce a contradiction. There has been much discussion in the Modeltheoretic literature — both classical and categorical — of how this problem is to be resolved, with a suggestion (perhaps applicable to law or politics) even that deduction be not assumed transitive! A more serious proposal, due to Mike Fourman, is the use of partial elements.

§3.1.14 The aim of this chapter, then, is the introduction of indexed category theory as a means of presenting notions of polymorphism and clearing up many of these confusions with variables.

We begin by considering presentations of syntax in terms of indexed “categories” and point out the significance of structure such as products and functors. These ideas are applied to arithmetic, context-free grammars, algebra, λ-calculus and finally natural deduction, with particular reference to the interpretation of the variable binding operators. We also remark that 2-categories and enriched categories can be employed for the same purpose.

In section 3 we consider the determinant as an example of a generic (uniform, natural) construction. It gives rise to a natural transformation between functors Rng → Set. We introduce classifying toposes and sketch their construction for coherent theories. Then we discuss stronger forms of logic which happen “accidentally” in the topos and indicate under what conditions these are preserved. Finally we show how to make an indexed category which codes the language of geometric logic.

In section 4 we look at the second order polymorphic λ-calculus and Fairbairn’s language PONDER, demonstrating that the “type quantifier” ∀ is right adjoint to substitution.

Finally section 5 concerns strong forms of polymorphism including the type of types, showing how recursion and type-of-types fit into the indexed formulation of polymorphism.

In chapter V we shall construct models for these languages.

3.2 Semantics of Variables

§3.2.1 Let us consider what we would like to be able to do with variables anyway, taking the line that they denote “generic” typed values. We expect simple categorical descriptions of substitution and variable binding operators, and the α rule to fall out as a triviality.

The operations on variables are

(i) proliferation: extension of the class of variables in which a given term is to be defined,

(ii) substitution,

(iii) binding by λ, ∀, ∃, etc.,

(iv) α-rule: transparent renaming of dummy (bound) variables,

(v) creation of new variables when required.

§3.2.2 The basic idea is to “stratify” or “index” formulae with respect to the variables which are (potentially) free in them. Each stratum or fibre is named by a string of variables of certain types. Alternatively we may forget (the names of) the variables and list instead the types; it will become apparent that this list is in fact the product of the types in it.

Note This depends on being able to forget and duplicate variables, cf. §3.2.20.

The substance of each stratum is the “free” or “term” model of the language. It is generated by the variables in the list and carries the “algebraic” structure corresponding to the operations in the language. Alternatively we may think of it as the “universe of all definable structure” derived from the variables as “generic” values.

§3.2.3 What about substitution, say a[x := u]? It seems to be appropriate to regard as primitive the operation of simultaneously substituting for all of the free variables of a. If we wish to substitute for only some of them, we make the identity substitution in the remaining places. [There is an argument to suggest that individual substitution is a strictly more powerful operation: §3.2.20.]

Suppose, then, that x is the only free variable of a, whilst u has its free variables amongst y⃗ = y_{1}, y_{2}, ..., y_{m}. The operator [x := u] is then a map from the fibre over x to that over y⃗. Since substitution is meant to respect the operations in the language, this map is a homomorphism of those operations.

§3.2.4 If a has not just one free variable, x, but a string of them, x⃗, we must make a (simultaneous) multiple substitution [x⃗ := u⃗] for them, and all substitutions are of this form.

Moreover if u⃗ have free variables y⃗, the substitutions which may be performed after (composed with) [x⃗ := u⃗] are those of the form [y⃗ := v⃗], and the resultant substitution is

[x⃗ := u⃗][y⃗ := v⃗] = [x⃗ := u⃗[y⃗ := v⃗]]

It is then easy to see that we have a category of substitutions, whose objects are the strings of variables (or their types), whose morphisms are the substitutions, whose composition is that just given and whose identity is [x⃗ := x⃗].

Clearly the substitutions are determined by the strings, u⃗, of terms. These strings have type strings the same as those of the corresponding x⃗.

Proposition The category of terms (§1.3.10) is dual to the category of substitutions. It has finite products, corresponding to listing of types. Each morphism gives rise contravariantly to a homomorphism between the corresponding fibres, and every such homomorphism arises in this way. □

We refer to the category of terms as the base category and denote it by B. The fibres are the “concrete” or regular representation of B, i.e. just the hom sets B(−, −). B(X, Y) is the collection of terms of type Y in the fibre over X.

§3.2.5 Now let’s look at the sense in which x, quâ term, is generic in the fibre over itself, quâ variable. Let a be any term, say with free variables amongst y⃗ = y_{1}, ..., y_{m}. We may form the substitution [x := a], which corresponds to a morphism from y⃗ to x and gives rise to a homomorphism from the fibre over x to that over y⃗. This is the unique homomorphism taking x to a.

Definition A point x in the fibre over X ∈ B is said to be generic of type X if for any a of type X in the fibre over Y there is a unique α : Y → X in B such that the corresponding homomorphism from the fibre over x to that over Y takes x to a. We write ⌜a⌝ for α.

§3.2.6 Most of the rest of this section is concerned with examples of this structure; observe that as yet we have avoided being specific about the nature of the fibres.

The most familiar example is that of polynomials, for which the language is that of commutative rings, consisting of addition, multiplication, etc. The base category simply counts the number of variables. The fibre over x⃗ = x_{1}, ..., x_{n} is the free ring on these generators and the substitution homomorphisms are the obvious evaluation maps; these are indeed precisely all of the homomorphisms between these rings.

There’s something a little peculiar here about restricting attention to free rings. It would seem to be appropriate to extend the base category to the opposite of the category of all commutative rings, or perhaps to the category of algebraic varieties. This of course leads us into algebraic geometry.

§3.2.7 Let’s look at the preceding example from the point of view of universal algebra. An object of the base category is, to all intents and purposes, just a number (of variables), and the product of objects corresponds to addition of numbers. Since every object is a product of copies of a certain single object, we need only consider morphisms into that, and from x⃗ these are all expressions in the free variables x⃗.

The indexed algebra described above is easily seen to be generated by the defining operations of the algebraic theory. However it is sometimes convenient to add to that theory all derived operations obtained by substituting one within another and with them the corresponding equations which say when an operation is obtained in this fashion. For example for groups we specify not only nullary (identity) and binary multiplication but also the product of one, three, four, ... elements. The closure of the signature (system of operations) under substitution in this fashion is called the clone of the theory.

The clone of the theory of rings is just the collection of all polynomials in however many variables. More generally it gives all the morphisms into x of the base category. The entire base category B is called the Lawvere presentation of the theory.

Proposition

(a) The objects of the category B arising from a finitary algebraic theory in this way are in bijection with ℕ, the natural numbers, and the product of two objects is given by the sum of the corresponding numbers. Any category of this form arises uniquely (up to equivalence) from some finitary algebraic theory.

(b) The category of models of an algebraic theory is equivalent to the category of functors B → Set which preserve finite products, and natural transformations between them.

(c) B^{op} is the category of finitely generated free algebras and homomorphisms. □

§3.2.8 The passage from single-sorted to many-sorted algebraic theories in this presentation is easy and natural: it is given simply by dropping the condition that ob B ≅ ℕ. For the extension to essentially algebraic theories, we need to make B a left-exact or lex category, i.e. one with all finite limits (see §1.2.13). The “essentially algebraic” theory of categories yields an example of this. This is usually presented as a two-sorted theory (“objects”, C_{0}, and “morphisms”, C_{1}) with three total operations (“identity”, “domain” and “codomain”) and one partial (“composition”).

The domain of the composition function is not the whole of C_{1} × C_{1} but that subobject carved out as the equaliser of π_{0} ; cod and π_{1} ; dom. It is the set of “composable pairs” and is written C_{2}. It may also be constructed by means of either of the following pullback diagrams. The first is the one more commonly seen, but the second will prove more useful to us in chapter V because ⟨dom, cod⟩ : C_{1} → C_{0} × C_{0} is a display map, which is to say the inverse image of ⟨x, y⟩ ∈ C_{0} × C_{0} is to be a type, C(x, y), viz. the set of maps x → y in C; this will ensure that we can indeed form the pullback.

[figure: C_{2}; π_{0}; C_{1}; dom; C_{0}]

[figure: C_{1}; π_{1}; dom; C_{0}; cod]

C_{0} {cod \atop }

[figure: C_{2}; C_{1} × C_{0}; C_{0} × C_{1}; 1 × ⟨d, c⟩; C_{0} × C_{0} × C_{0}; ⟨d, c⟩ × 1]

Figure 3.2.8: The definition of an internal category

Proposition B^{op} is the category of finitely presented algebras and homomorphisms (cf. proposition 3.2.7c). □

§3.2.9 The presentation of a many-sorted finitary essentially algebraic theory is then just a left-exact category B. Its category of models is LEX(B, Set), the category of finite limit preserving functors from B to Set, and natural transformations between them.

There’s nothing special here about the category Set: we may interpret an essentially algebraic theory in any category E with finite limits, and the category of models is LEX(B, E). For singlesorted algebraic theories this is familiar, writing G for the Lawvere theory of groups, the category of topological groups is LEX(G, Sp). E will commonly be a topos.

However for E we may instead put another algebraic theory; a left-exact functor B → E is then an interpretation of one theory in another, that is, an expression of the operations of (the theory presenting) B in terms of those of E. The following example is an instance of this.

+§3.2.10 Context free grammars may be treated as a special case of a many sorted finitary algebraic theory. Recall that a concrete context-free grammar over an alphabet A consists of a collection of syntactic sorts (we prefer this to the usual syntactic category for the obvious reason) and production rules. For example decimal integer arithmetic expressions may be described by

A = {0, 1, … 9, +, −, ×, ÷, (, )}

together with

D : := 0 | 1 | ... | 9
N : := D | ND
I : := N | + N | − N | (E)
T : := I | T × I | T ÷ I
E : := T | E + T | E − T

It is an easy matter to derive from this a five-sorted algebraic theory with ten constants, seven unary operations, five binary operations and no equations.

It would be more accurate to describe this not as a single theory, but as an interpretation of one abstract theory (of arithmetic) in another (words in A). As lex categories, an interpretation of theories is given by a lex functor.

Proposition Let Γ be a context-free grammar in an alphabet A. Then there are naturally arising categories with products, Γ and A, and a product-preserving functor Γ → A. Moreover this functor is faithful iff Γ is unambiguous.

Proof The objects of Γ are strings of syntactic sorts, X⃗. The morphisms from X⃗ to Y⃗ are strings of productions of sorts Y⃗ with free syntactic variables of sorts X⃗ together with their detailed parsing forests; the terms are at the roots of the trees, the nodes are production rules and the leaves are syntactic variables. The identity is as usual given by variables. Composition is given by substituting trees for leaves in parsing forests. Γ is therefore the free category with products on the production rules (quâ morphisms).

The objects of A are natural numbers n (or finite sets of any syntactic variables irrespective of sort). Morphisms n → m are m-strings of words in A and n syntactic variables (without any kind of parsing information). Identity and composition are by variables and substitution. Notice that we have no reference to “words in A” as the “free monoid on A”; this is because that composition operation is concatenation, which is a red herring as far as parsing is concerned.

The functor Γ → A gives the length of the string on objects and the term being parsed (with its free variables) on morphisms, i.e. it throws away the parsing information. It is faithful iff whenever there are two parsing trees for the same term (in the same variables) then these coincide. □

§3.2.11 Simply by choosing some syntactic representation of an algebraic theory it is easy to give an interpretation of it in terms of an abstract context-free grammar. However it is necessarily abstract, since a concrete interpretation (by words in an alphabet) would implicitly be a solution of the word problem for the theory, i.e. the determination of whether two expressions in given generators and relations are provably equal in the theory, and this is known not to be possible.

Consideration of the analogy between context free grammars and many sorted algebraic theories is enlightenling. As a fairly trivial point, we notice that brackets (such as in the rule for I in §3.2.10) serve as inverses to the inclusion of one sort in another.

The syntactic sorts of course correspond to the algebraic sorts, and when they occur on the right hand side of a production rule they correspond to variables. We might describe them as syntactic metavariables, since in the context of a programming language there will also be semantic (object) variables. Some languages, notably C [Richie et al. 1975], have “macro” facilities, allowing parametrised substitution into the source text before it is processed by the compiler; here the analogy between the two kinds of variables is apparent.

§3.2.12 None of the foregoing examples has involved variable binding operators, so let us now turn our attention to the λ-calculus. Because of the equivalence with combinatory algebra (chapter I) we already know what the structure of the fibres and substitution maps must be: it remains only to investigate the interpretation of λ itself.

We may as well deal with the typed λ-calculus. As in §3.2.2 the objects of the base category are strings of variables of various types, and the morphisms are strings of terms whose free variables are as listed by the domain and whose types are given by the domain; this is precisely the construction of §1.3.10. The fibres are also the sets of all terms in the given variables, identified under βequivalence; they are organised into types within the fibres, and substitution respects type.

Application is definable structure, being defined between terms of types A → B and A with result B; it is preserved by substitution. As with algebraic theories the fibre is an algebra for the operation; it is free if we impose Curry’s equations (§1.1.14). There is a generic instance of application with these types, namely f • a = fa in the fibre over (A → B) × A.

§3.2.13 Let us write [x⃗ ; A] for the type A in the fibre with free variables x⃗. Abstraction is then a function λy : [x⃗, y ; A] → [x⃗; Y → A] where Y is the type of y.

The β-rule is the means by which we relate the internal notion of application to the external notion of substitution. Since we may separately substitute as we please for y, it suffices to consider the case (λy.a)y = a. We have to proliferate [x⃗; Y → A] and [y; y] to the fibre over (x⃗, y); it takes the full force of proliferated substitution to define a map

[x⃗, y ; A] → [x⃗; Y → A] → [x⃗, y ; Y → A] × [x⃗, y ; Y] → [x⃗, y ; A]

which the β-rule requires to be the identity.

Looking at this another way, we have defined a post-inverse to λy. The typed η-rule says that this is also pre-inverse. This is of course what we did in §1.3.10.

Since in this presentation [x⃗;Y] is just the hom-set B(X, Y), these two rules together formulate the fact that B is cartesian closed. Observe, however, that the fact that B is cartesian closed may be formulated equationally, and hence in a world (instead of Set) which merely has finite limits.

The untyped λ-calculus (with self-application and fixpoints) requires further structure in B. The remark about the strength of proliferated substitution will be amplified in §3.2.20 when we mention alternative presentations.

§3.2.14 In all of the foregoing examples the fibres have been discrete sets, and have in fact carried no structure which was not already present in (the hom-sets of) the base category. For the application to polymorphism (and before that to natural deduction and type theory), the fibres acquire the structure of a category and the substitution homomorphisms are functors. The remarkable thing is that quantifiers, sums and products turn out to be their adjoints.

Let us suppose we have a First Order theory T in a language with certain sorts, operations, etc. Consider the language of the first order formulae, possibly including variables of the respective sorts, together with the connectives (⊤, ∧, ⊥, ∨, →, ∀, ∃) and the relation ⊢ of T -provability. We shall make this into an indexed structure (called a hyperdoctrine).

Since we now have a relation as well as operations, we no longer have a discrete set in the fibres. In fact in general we may build a 2-category, whose arrows are the methods (not just the fact) of proof that ϕ ⊢ ψ and whose 2-arrows are the proof transformations. Seely [1977] does this, but the extent of his detail is far beyond what is appropriate to demonstrate the equivalence between categorical and proof-theoretic notions, so we shall restrict attention to the provability preorder.

§3.2.15 The base category, as before, gives the type and term structure of the object language. The fibre over each string of types is the Lindenbaum algebra of propositions possibly containing free variables of the given types. This carries a Heyting algebra structure, with definable operations ⊤, ∧, ⊥, ∨ and ⇒.

We pick just three rules from natural deduction to show that the connectives are interpreted by products, coproducts and exponentials; the last of these is historically known as the modus ponens.

\frac{ϕ ⊢ θ ψ ⊢ θ}{ϕ ∨ ψ ⊢ θ} (∨E)  \frac{χ ⊢ ϕ χ ⊢ ψ}{χ ⊢ ϕ ∧ ψ} (∧I)  \frac{χ ⊢ ϕ χ ⊢ ϕ ⇒ ψ}{χ ⊢ ψ} (⇒ E)

Classically we have the (¬¬E) rule, making this a Boolean algebra, but (to a large extent because there is no analogue of this for categories) it is more appropriate to drop this in favour of intuitionistic logic.

Since the connectives are definable structure, as in the algebraic case they are preserved by the substitution functors. In the proper-category case we have a cartesian closed category with finite limits and colimits, this structure being preserved by substitution maps.

§3.2.16 The crucial observation, due to Lawvere [1969], is that the rules for the quantifiers state that they are adjoints to substitution. This is illustrated by the two rules

\frac{ψ ⊢ ϕ}{∃x.ψ ⊢ ϕ} (∃I) (∀E) \frac{ϕ ⊢ ∀x.ψ}{ϕ ⊢ ψ}

(where x does not occur freely in ϕ). These may be read directly as the adjunction between the functor (written, as usual, in invisible ink) which proliferates the free variable x and respectively ∀x on the right and ∃x on the left. [The Frobenis law, [∃x.(ϕ(x) ∧ ψ)] = [(∃x.ϕ(x)) ∧ ψ], is also needed to characterise the quantifiers.]

These proliferation functors are substitutions over product projections in the base category (the relevant terms being simply variables quâ terms in (more) free variables). What do quantifiers over general morphisms mean? They in fact turn out to be generalised to forms “∃x.ϕ(x) ∧ ψ(x)” and “∀x.ϕ(x) ⇒ ψ(x)”, which are already familiar from mathematical idiom. (In fact the reader may already have spotted the notations “(∀x : ϕ(x))(ψ(x))” or sometimes “∀x : ϕ.ψ” and “(∃x : ϕ(x))(ψ(x))” or “∃x : ϕ.ψ” in this work: these have been used in recognition of this.)

\begin{matrix}X × Y & \{(x, y) : ϕ(x, y)\} \\ Y & \begin{aligned}π_{1} \\ & \end{aligned} & y & \begin{aligned}π_{1} \\ & \end{aligned} \end{matrix}

We shall see more of (adjoints to) substitution over arbitrary base maps when we discuss the indexed presentation of Set in the next chapter.

§3.2.17 There is a technicality in this called the Beck condition. [Indeed there are other important examples of indexed categories with adjoints to substitution, and the Beck condition sems to characterise those we call logical.] We want to be sure that substitution and quantification interact properly, in the sense that it doesn’t matter whether we proliferate variables before or after quantifying. More generally, we want to be able to make substitutions inside quantifiers (though not, of course, for the variable being bound). This is expressed categorically by requiring that if the left-hand figure is a pullback in the base category then the right-hand square must commute (at least up to isomorphism):

[figure: C ×_{A} B; γ; C; B; δ; α; A; β; P(C ×_{A} B); Pγ; PC; PB; ∀δ; Pα; PA; ∀β]

We also need a Beck condition for ∃. However this follows automatically from the fact that a diagram of left adjoints commutes iff the corresponding diagram of right adjoints does (so long as they both exist, of course).

§3.2.18 The structure we have built so far, in which

(i) the base category has finite limits,

(ii) the fibres have finite limits, finite colimits and exponentials,

(iii) the substitution functors preserve the structure of the fibres

and

(iv) have adjoints on both sides satisfying the Beck condition is called a hyperdoctrine. We shall apply this to Set in the next chapter, and (after deleting equalisers and colimits) to categories of domains in chapter V.

The really basic example of a hyperdoctrine is the sub-object structure on a category of sets (topos). In this case substitution over α is just the inverse image α^{−1} and its adjoints are quantification. The Beck condition holds automatically in this case. We may regard an arbitrary hyperdoctrine as a structure which forces the subobject structure on (a category containing) its base category, in the following sense:

Proposition Let P → C be a hyperdoctrine. Then there is a category S whose subobjectstructure yields a hyperdoctrine and in which C is fully embedded such that Sub_{S}(X) ≅ PX for X ∈ C. Proof (sketch) The objects of S are “models of equality”, i.e. objects X ∈ C together with P-equivalence relations, (=_{X}) ∈ PX (satisfying the usual equations). The morphisms are from (X, =_{X}) to (Y, =_{Y}) are P-relations (objects of P(X × Y)) which are functional, total and respect equality. □

In the proof of this result we use the Beck condition in showing that relational (and hence functional) composition is associative (as Gavin Wraith has pointed out to me). This result shows that the Lawvere dictum (that quantification is adjoint to substitution) should be qualified by saying that the Beck condition characterises logical applications. Seely [1983] gives further discussion, claiming that the Beck condition for a particular pullback in the base says that “the category knows that this is a pullback”. When we discuss indexed domain theory in Chapter V we shall encounter indexed categories whose substitution maps have left adjoints which do not satisfy the Beck condition. Other examples arise in Universal Algebra, for instance the indexing of categories of modules over rings, or algebras over theories.

We may take this one stage further and force the higher-order logic. [In other woords, we can build a category in which ∃ and ∀ are the quantifiers arising from subobjects.] this gives the definition of a tripos (see Pitts [1981] and Hyland, Johnstone & Pitts [1980], which perform the above construction in detail). For each object A ∈ B there is a powerobject P A ∈ B and a membership predicate (∈_{A}) ∈ P(A × P A) such that given any ϕ ∈ P(A × B) we have ⌜ϕ⌝ : B → P A in B with P(1_{A} × ⌜ϕ⌝) ∈_{A}≅ ϕ.

A tripos provides all of higher-order logic with the exception of equality. The above result essentially amounts to adding equality to the theory, and in the case of a tripos we thereby obtain a topos. This is not, however, necessarily Grothendieck. This construction was abstracted from that of the Effective topos, which is obtained from a tripos in which the predicates over X are ℕindexed sequences (R_{n}) of subsets of X and (R_{n}) ⊢ (S_{n}) if there is a recursive function ϕ : ℕ → ℕ such that ∀n ∈ ℕ.R_{n} ⊂ S_{ϕ(n)}.

§3.2.19 In this section we have been describing the use of indexed category theory for many purposes in algebra and logic. One should not, however, be fooled by this into believing that it is the only or even necessarily the best tool afforded by (contemporary) category theory. I like to think of category theory as like the children’s building kit “LEGO”: it doesnt come with an instruction book and only lays down very primitive rules as to what you have to do with it.

In many cases we may have a generic object in the fibres, making them look like the “hom-sets” of the base category. When the fibres themselves have additional structure, this is inherited by the base category, and we say that it is enriched over the category describing that structure. See Kelly [1982]. Frequently this will be Cat itself, so that between the morphisms (“functors” or “paths”) in the fibres there are 2-morphisms (“natural transformations” or “homotopies”). In the case of categories of domains we always have enrichment over IPO. Enriched or 2-categories my be quite capable of carrying the structure we have in mind.

§3.2.20 The earliest example of enrichment over anything other than Set is the case of Rng over AbGp. In this case the rôle of the product is played by the tensor product. We may use this example to show that proliferated substitution is strictly more powerful than simultaneous substitution.

In discussing substitution in §§3.2.3-5 and the λ-calculus in §3.2.12, we could have allowed [x⃗; A⃗], the collection of things of type(s) A⃗ in free variables x⃗, to be an object of some category U other than Set. Suppose this carries a tensor product, i.e. a functor ⊗ : U × U → U, which is associative up to coherent natural isomorphism and has a unit object I ∈ U. Then substitution naturally gives rise to a U-enriched category, the product being replaced by tensor product.

[figure: I; ⌜ ; x ; ⌝; [x; X]; [x; Y] ⊗ [y ; Z]; ⌜ ; y :=_{Y;Z} ; ⌝; [x; Z]]

The product corresponding to concatenation of strings of terms, however, appears still to be the ordinary categorical product. We can see this in the category of sets and partial functions, where the tensor product A ⊗ B is the cartesian product of sets and the categorical product is A × B ≅ A ⊗ B ∪ A ∪ B. This requires substitution to be strict whilst allowing pairs to be defined without both components being so.

If we attempt to replace partial functions by abelian groups with the traditional tensor product we find that simultaneous substitution is simply matrix multiplication, but that proliferated substitution is nonlinear.

§3.2.21 Finally we remark that we may have accidental structure. The best known example of this is the centre of a group: all groups have centres, but the centre is not preserved by group homomorphisms. There are many more examples of this in topos theory, and the structure of an (elementary) topos is a prime example: every topos has a subobject classifier Ω (and higher order logic resulting from it) but this is not preserved by geometric morphisms. For this reason there are two sides to the logical interpretation of toposes: we may use their rich structure to prove (higher order) properties inside them, but unless our constructions are geometric they will not be preserved.

3.3 Generic Constructions

§3.3.1 In this section for the first time we discuss type polymorphism, in the weak case of constructions which are uniform in some variable type. We use the determinant example introduced in section 1, but ignore the extra degree of polymorphism over the size of the matrix: the calculation of the formula a × d − b × c suffices to illustrate the point.

A typical polymorphic language might express the 2 × 2 determinant function as follows:

let det2((R, 0, 1, +, −, ×) : ring ; a, b, c, d : R) = a × d − b × c

where the specification of the higher type ring requires the provision of elements 0, 1 : R and functions +, × : R × R → R and − : R → R.

We leave it to the designer of the language and its compiler to decide how to deal with the overloading of the symbols 0, 1, +, − and ×, and concentrate on the natural categorical semantics of such a program. Since our concern is the meaning of the “compound” variable (R, 0, 1, +, −, ×) rather than recursion, we shall here treat all functions as total.

§3.3.2 What is the “type” of the compound variable (R, ...), which is to say, over what does it range? Clearly over all (commutative) rings, and we need to specify explicitly the operations in order that the compiler may arrange for calls to the relevant subroutines may be put in the code.

However although the variable itself can only denote a ring rather than a homomorphism, this higher type really is the category rather than the class of all rings. To see this we need to consider the nature of the uniformity of the definition.

Of course R, as opposed to (R, 0, 1, +, −, ×), denotes the underlying set (or type) of ring elements. Admitting for the moment the claim that the category of rings arises, this is the underlying set functor R : Rng → Set.

What then are 0, 1, +, − and ×? First we have to say what R × R is. Of course it is the functor, again Rng → Set, assigning to a ring the cartesian square of its underlying set. Then + and × are natural transformations R × R → R, whilst − : R → R and ⌜0⌝, ⌜1⌝ : 1 → R where ⌜1⌝ is the functor constantly assigning the singleton set.

These things are natural transformations because if we “replace” R by S “along” the homomorphism θ : R → S then the operations are translated accordingly. Indeed this is precisely the definition of a homomorphism in the first place: we have merely transformed it to make + and × the subject.

[figure: 1 = = = = = = = = = 1; R; ⌜0_{R}⌝; θ; S; ⌜0_{S}⌝; R; θ; S; R; −_{R}; θ; S; −_{S}; R × R; θ × θ; S × S; R; +_{R}; θ; S; +_{S}]

and likewise for 1 and ×.

§3.3.3 We can say a little more about R and R × R than merely that they are functors. They preserve all limits, indeed they have left adjoints: the left adjoint of R is of course the free ring functor. However of more immediate interest to us now is that they preserve filtered colimits; this is precisely because the theory of rings is finitary. Since this is the generalisation of preserving directed sups, we say these functors are continuous as as in §2.2.7. This leads naturally to the category of all Scott continuous functors Rng → Set and natural transformations between them.

There is a simplification to be made here. Rng is an example of a locally finitely presentable category, which is the direct analogue of an algebraic lattice. There is a subcategory Rng_{fp} of finitely presentable objects (which have no proper expression as a filtered colimit) of which any object can be expressed as a filtered colimit. This means that Rng ≃ Ind Rng_{fp}, so there is a natural equivalence between continuous functors Rng → Set and all functors Rng_{fp} → Set, just as any continuous function from an algebraic lattice is determined by its effect on the compact elements, and any monotone function on them will do.

§3.3.4 The functor category [Rng_{fp}, Set] inherits a great deal of structure from Set, and in fact it is a topos. On the other hand, as we shall see, it also encodes the “generic” structure of rings, and for this reason we shall call it more briefly Set[R].

The objects of Set[R] should be thought of as sets dependent upon one variable R of type ring. To start with, Set[R] includes all the “constant” sets (constant functors) independent of the variable R. But also the forgetful functor R : Rng_{fp} → Set is an object of Set[R], and R × R is its product with itself.

We may perform lots of other operations on R as if it were a set. In particular since Set[R] is a topos we may find its powerset, Ω^{R}. However this is an example of the accidental structure we mentioned in §3.2.21, because it turns out not to be preserved. We shall return to the question of preservation in §3.3.16.

In fact only those constructions involving finite limits and arbitrary colimits are preserved by the transformations we have in mind, so only these are of interest in this context. Regarding limits and colimits as “multiplication” and “addition” of sets, Set[R] is the collection of “polynomials” in an indeterminate R.

Examples of such structures include the circle S = {x, y : x^{2} + y^{2} = 1} and the general linear group GL_{2} = {a, b, c, d : ∃u.u(ad − bc) = 1}. The first is carved out as an equaliser (of the interpretations of the sides of the equation as functions R^{2} → R) and the second is the image of a subobject of R^{5} under the product projection R^{5} → R^{4}.

§3.3.5 In fact what we have discovered is the language of geometric logic. In terms of the motivations of section 2, the operations in our language are finite limits and arbitrary colimits, such that finite limits commute with filtered colimits. Lawvere’s presentation of a finitary theory as a lex category in §3.2.8 is the algebra of “polynomials” in the theory together with finite limits, and we found that interpretations and models were given in terms of the relevant homomorphisms, which were lex functors. Set[R] is the algebra whose operations now include colimits, and the relevant homomorphisms preserve these too. Moreover we can present these algebras in terms of generators and relations: this is precisely how a topos is given by a site.

Unfortunately it is not easy to define a topos to be a category with finite limits distributing over arbitrary (small) colimits because of the usual size problems, even though this is the “algebraic” structure which we wish it to have for the purpose of defining homomorphisms (inverse image functors).

This problem is circumvented by clever use of the adjoint functor theorem. We formulate the existence of all colimits in the topos by use of indexed category theory (§4.1.10) and their preservation by inverse image functors by requiring the latter to have right adjoints. However it is the “higher order” part of the definition of an elementary topos (§4.4.6) which ensures that the adjoint functor theorem may be applied. The Giraud theorem (see, e.g., Johnstone [1977], theorems 0.45 and 4.41) shows that this gives what we want.

§3.3.6 The classifying topos is the uppermost stage in the process of “completing” a theory under all kinds of structure. The most basic example of this it the consideration of a group as a totality rather than as a “system of substitutions” generated by some given ones. In §3.2.7 we took an algebraic theory presented as a signature and built from it its clone and then its Lawvere presentation, and in the following paragraph added all finite limits to this. The classifying topos is the result of adding arbitrary colimits to this structure; this admits the facility of prescribing relations for the colimits, which is precisely the function of a Grothendieck topology (see §§3.3.11-13).

For a finitary algebraic theory there is a simple connection between the lex presentation, B, the classifying topos E, the category of models, C. We obtain E by freely adjoining arbitrary (small) colimits to B and C by adjoining filtered colimits to B^{op}. In symbols, E ≃ Set^{B^{op}} and C ≃ Ind B^{op}. Conversely B ≃ C_{fp}^{op}.

§3.3.7 The natural transformations 0, 1, +, − and × provide R with a ring structure in Set[R] and det2 is the 2×2 determinant map on R. We call (Set[R], R) the generic ring for the following reason.

Lemma Let A be any ring. There is a geometric morphism ⌜A⌝ : Set → Set[R] whose inverse image functor ⌜A⌝^{∗} takes R to A, and this is unique up to isomorphism. Indeed this defines an equivalence between the category of rings and the category of geometric morphisms Set → Set[R]. Proof Let X ∈ Set[R], i.e. X : Rng_{fp} → Set; then as remarked in §3.3.3, X extends (uniquely up to isomorphism) to a continuous functor Rng → Set. ⌜A⌝^{∗}(X) is given simply as the value of this functor at A. It is easy to verify that ⌜A⌝^{∗} is a functor, it sends R to A and will be unique. It preserves finite limits because in Set (and in any finitary algebraic category over a topos) these commute with filtered colimits.

For Y ∈ S, ⌜A⌝_{∗}(Y) : Rng_{fp} → Set takes B to Y^{Rng(B,A)}. Again we have to verify that this is right adjoint.

This construction is functorial in A. Conversely the inverse image functor of any geometric morphism f : Set → Set[R] picks out a ring f^{∗}(R) in Set, and we verify that this is an equivalence.

□

Definition Let T be a geometric theory. A topos, denoted by Set[T], is a classifying topos for T if for any topos E over Set, the category of models for T in E is naturally equivalent to the category of geometric morphisms from E to Set[T].

It is a fact that any geometric theory has a classifying topos (unique up to equivalence), and every Grothendieck topos arises in this way. We shall sketch the construction of the classifying topos for a coherent theory.

§3.3.8 Our polymorphic 2 × 2 determinant map, det2, is now the generic one in the sense that the determinant for any ring in any topos is given as the image of the generic one (§3.2.5) under an inverse-image functor of a geometric morphism.

I claim that this is the appropriate understanding of the sense in which det2 is polymorphic.

§3.3.9 Set[R] is the space of all rings in a certain sense. It is a category, as is the category of rings, but they are not equivalent: the sense is a different one from this.

Given any topological space X, we may construct the category Shv(X) of sheaves on it. There are many standard works (e.g. [Tennison 1975]) on this, so I shall not do it here. Shv(X) is a topos. Given a continuous function f : X → Y between spaces, there is a geometric morphism Shv(X) → Shv(Y) between the toposes. Moreover if we restrict to sober spaces (or alternatively move to locales), every geometric morphism arises from a unique continuous function; in order words Shv : Loc → Top is a full embedding.

According to Grothendieck, this means that a topos is a generalised space and a geometric morphism is a continuous function between spaces. The topos Set corresponds to the singleton space and so geometric morphisms Set → E are “points” of E.

The points of the classifying topos Set[R] correspond to rings, and the natural transformations between geometric morphisms give homomorphisms of rings.

§3.3.10 We may consider just the topos Set[R] without mentioning its generic ring R. The geometric morphism ⌜A⌝ : Set → Set[R] now no longer has a particular aspect of structure to pick out, and so we must think of it as yielding the totality of all definable structure arising from the ring A. Thus there is for instance the set of quadruples (a, b, c, d) from A satisfying (∃u)[u(ab − cd) = 1], i.e. the set of invertible 2 × 2 matrices over A.

Of course in practice when we consider a ring we are interested not just in the primitive structure but also in more complex structures defined from it. This also means that we get the same answer if we vary the presentation of the theory.

A famous example of this is the equivalence between Boolean algebras (defined in terms of true, false, and, or and not) and Boolean rings (in which every element is idempotent). In this case the classifying toposes coincide (are equivalent) and the two (generic structures on the) generic objects are mutually definable in the obvious way.

§3.3.11 This kind of construction may be performed for any geometric theory. A geometric language, like a first order language, has type, function and relation symbols of various signatures, and terms are built up from these. Geometric formulae are built up from relations (including equality) between terms together with finite conjunction, arbitrary disjunction and existential quantification. In coherent formulae we allow only finite disjunction.

We have essentially already described the interpretation of a geometric formula. Relations are interpreted as given subobjects, and in particular the solution-set of an equation is the equaliser of the interpretations of the terms; these are called atomic formulae. Conjunction and disjunction are interpreted by intersection and union of subobjects, and existential quantification by image factorisation. All of these constructions are preserved by inverse image functors.

A geometric (coherent) theory in a language is given by a collection of axioms or sequents of the form (ϕ ⊢ ψ), where ϕ and ψ are geometric (coherent) formulae. A structure for the language satisfies the sequent if [[ϕ]] ⊂ [[ψ]] as subobjects of X_{1} × ... × X_{n} where X_{1}, ..., X_{n} are the types of the free variables x_{1}, ..., x_{n} of the formulae. It’s easy to see that any collection of sequents is equivalent (so far as satisfaction is concerned) to one in which the antecedents are (possibly empty) conjunctions of atomic formulae and the consequents are disjunctions of formulae of the form ∃y_{1}...∃y_{m}.ψ_{1}(x⃗, y⃗) ∧ ... ∧ ψ_{r}(x⃗, y⃗).

§3.3.12 A geometric sequent is called essentially algebraic if the consequent involves no disjunction, and only provably unique existential quantification. It is appropriate to separate the essentially algebraic sequents in the axiomatisation of a geometric theory T from the other sequents. This gives a finitary many sorted essentially algebraic theory, T_{0}, which can be described by a lex category B in the manner of Lawvere. The models in E of this subtheory form a category Mod_{E}(T_{0}) ≃ Ind B^{op}, and its classifying topos is Set[T_{0}] ≃ Set^{B^{op}}.

The models of T in E form a full subcategory Mod_{E}(T ) of Mod_{E}(T_{0}), consisting of those structures satisfying the sequents. Regarding these as “points” of classifying toposes, it is natural to think of the classifying topos Set[T] for T as a “subtopos” of Set[T_{0}], and indeed it is. It is constructed by means of a site; the category is B, Set[T_{0}] is the category of presheaves and Set[T] the category of sheaves for a certain Grothendieck topology manufactured out of the axiomatisation.

§3.3.13 An algebraic formula ϕ (finite conjunction of atomic formulae in variables x_{1}, ..., x_{n}) describes a certain particular finitely presented structure A of signature T_{0}, namely the one generated by x_{1}, ..., x_{n} and satisfying the relations and equations making up the formula. The interpretation [[ϕ]] of the formula is the set of images of this structure in the model.

Now consider a sequent (ϕ ⊢ ψ) of the particular form in which ψ already implies ϕ and does not involve disjunction (we replace ψ by ψ ∧ ϕ to achieve the first, and later consider a disjunction of such sequents to accommodate the second). ψ is another algebraic formula (corresponding to a structure B), existentially quantified over the extra variables y_{1}, ..., y_{m}. This sequent may therefore be described by (and henceforward written as) a homomorphism A → B. The model X satisfies this sequent iff any homomorphism A → X can be extended (not uniquely) to one B → X making the triangle commute.

A \overline{ϕ ⊢ ψ} B

..............

X

A model X satisfies a disjunction of sequents, ϕ ⊢ ⋁ ψ_{i} with the same antecedent iff any homomorphism A → X may be extended to one B → X for one of the sequents or homomorphisms A → B. Let R be the set of these for this disjunction. W.l.o.g. we may enlarge R to include any A → B′ where (A → B) ∈ R and B → B′ is arbitrary; for on the one hand we only need have some member of R, so it does no harm to increase the choice, and conversely if we manage to extend A → X to B′ → X then we have B → B′ → X.

A collection of homomorphisms R of this kind is called a sieve or crible on A. When we embed the opposite of the category in the classifying topos by means of the Yoneda embedding, sieves on representable objects correspond to their subobjects. A sieve which arises from the theory as above is said to be covering; it says that this subobject, though not necessarily presented as such, is intended to be the whole of the object.

The axiomatisation of the theory now specifies a collection J(A) of covering sieves for each object A of the original category (we have one R for each time A occurs as an antecedent, so this is the infinite conjunction). J is called a Grothendieck cotopology.

By now the reader will be familiar with the necessity of ensuring that concepts be preserved by substitution. In this case this condition manifests itself as follows. If R ∈ J(A) and θ : A → A′ is any homomorphism, then θ^{∗}R, which consists of those A → B in R which factor through A → A′, is to be in J(A′).

Using the cotopology we may now extract from amongst the presheaves Set[T_{0}], the sheaves which form the subtopos Set[T]. Specifically, a sheaf is a presheaf which, as a functor, takes covers to colimits. Thus the purpose of a topology is to force the colimit structure of a category. This gives the classifying topos for T .

[It’s not clear whether the presentation of this in terms of C or C^{op} is clearer, hence the co’s in the words (some of which have been omitted anyway). This is because of the duality in proposition 3.2.4.]

§3.3.14 The simplest nontrivial geometric theory is that of an “object” (with one type and no functions, relations or axioms). The classifying topos for this is written Set[U]. This performs a similar rôle in Top to that performed by the Sierpiński space 2 in Sp. Recall from §2.3.2 that the latter classifies open sets and is a cogenerator for Sp (or Loc); likewise Set[U] cogenerates Top.

Since Set is really the one point space, it is the terminal object of Top, i.e. there is a unique (up to isomorphism) geometric morphism to it from any given (Grothendieck) topos E. The inverse image functor of this is written Δ, and is the “constant object” functor (cf. the combinator K) if we think of E as a category of functors from a lex category C into Set. The direct image, traditionally called Γ, is the “global section” functor and is given by evaluation at 1 (the terminal object of C).

In the case E = Set[U], Δ also has a left adjoint Σ given by evaluation at 0 (the empty finite set). A geometric morphism f for which f^{∗} has a left adjoint f_{!} as well as a right adjoint f_{∗} is called essential. [In fact the functor Σ : Set[U] → Set in turn has a left adjoint; this is called π_{0} because in topology it is associated with the set of components of a space.]

§3.3.15 This provides us with a simple interpretation for type polymorphism of sets (readily extendable to include models of any geometric theory). Recall the view that toposes are the algebras for the language of geometric logic, and index them over the “free variables”; the substitution homomorphisms are inverse image functors of geometric morphisms.

What are these “free variables”? Of course they are like our (R, 0, 1, +, −, ∗), generic models of geometric theories. The base (syntactic) category is just the category of geometric theories and their interpretations.

Let T_{1}, T_{2},... be geometric theories and Set[T_{1}], Set[T_{2}], ... their classifying toposes. From these it is possible to construct S[T_{1}, T_{2}, ...], the simultaneous classifying topos for models of each of the theories, as a pullback in Top. This contains generic models T_{1}, T_{2}, ... for T_{1}, T_{2}, ... respectively and is the category of all structures definable in terms of them. We may therefore consider it the category of type expressions in the free type variables T_{1}, T_{2}, ... of appropriate kinds.

Now in this case we have more than we did with ordinary algebraic theories, because the fibres are categories rather than discrete sets and the substitution maps are functors. Hence we have an indexed type theory and we can ask about sums, products and exponentials as in §4.1.

§3.3.16 Since the substitution functors are inverse images, they preserve geometric logic. However they do not preserve the other logical structure which we find inside a topos — it is accidental in the sense of §3.2.21. A functor between toposes which preserves finite products, exponentials and the subobject classifier is called a logical functor because it preserves all higher order logic; we shall discuss weaker things than this.

In order to obtain the structure of a hyperdoctrine we need a left as well as a right adjoint to the inverse image functor (giving an essential geometric morphism) and the Beck condition. Such a geometric morphism is said to be locally connected [Johnstone 1980]; the weaker poset form of this condition of being open is equivalent to preserving first order logic.

In fact we do not need the left adjoint to ask about the Beck condition. Suppose we have a pullback of geometric morphisms in Top as follows:

[figure: F ×_{E} G; h; G; F; k; f; E; g]

Then there are two forms of the condition; we say that f satisfies the Beck condition on the left if, for all g with the same codomain, the first diagram of functors below (corresponding to the above pullback) commutes:

[figure: F ×_{E} G; h_{∗}; G; F; k^{∗}; f_{∗}; E; g^{∗}; F ×_{E} G; h^{∗}; G; F; k_{∗}; f^{∗}; E; g_{∗}]

One may show that this is equivalent to local connectedness. Likewise we say that f satisfies the Beck condition on the right if we have this for the second diagram. Lindgren [1984] has shown that this holds iff f_{∗} preserves filtered colimits.

3.4 Polymorphic Lambda Calculus

§3.4.1 So far, all the forms of polymorphism we have discussed have been of a “functorial” form interpretable in Set, or at least in some topos. The ideas which form the subject of the remaining two sections of this chapter are from a different tradition and turn out to be incompatible with the “ordinary” logic of sets; indeed there are several paradoxes to this effect, to which we shall add a new one in theorem 5.5.9.

The underlying idea, which first occurred in Mathematical Logic though the foregoing discussion emphasises its relevance to Computer Science, is that the identity function, λx.x, for instance, does not occur separately as 1_{X} once for each type X, but in a single “Platonic” incarnation of “type” ∀X.X → X, which is instantiated for each type X in a fashion similar to the use of the quantifier in predicate logic. The aim of this section is to provide a formal justification for the use of the quantification symbol in the shape of a demonstration that it is right adjoint to substitution.

There is a remarkable by-product of this approach. Church’s numerals (§1.1.7) are of type ∀X.(X → X) → (X → X), and in certain interpretations it may be shown that these are the only terms of this type. Accordingly we have an object which looks like the natural numbers. Likewise the object ∀U.(X → U) → ((Y → U) → U) is similar to a sum, despite the paradox corollary 1.5.12.

§3.4.2 We look first at a second-order polymorphic lambda calculus studied by Bruce and Meyer [1984]. This admits type variables and expressions with quantification, but allowing only “sets” and not “structures”.

It has

(i) 0-variables x, y, z, ...

(ii) 1-variables X, Y, Z, ...

(iii) (0-)terms formed by the clauses

x  (λx : B.a)  (ab)  (ΛX.a)  a^{A}

(iv) types (1-terms) formed by the clauses

X  (A → B)  (∀X.A)

(v) α_{0}, β_{0} and η_{0} rules

λy : B.a  = λx : B.a[y := x]
(λx : B.a)b = a[x := b]
λx : B.ax = a

(where in the first and third clauses x is not free in a),

(vi) α_{1}, β_{1} and η_{1} rules

∀Y.A  = ∀X.A[Y := X]
ΛY.a  = ΛX.a[Y := X]
(ΛX.a)^{B} = a[X := B]
ΛY.a^{Y}  = a

(where in the first clause X is not free in A, and in the second and fourth it is not free in the type of any free variable of a),

(vii) non-unique typing of terms

x : A
if f : (A → B) and a : A then (fa) : B
if a : A  then (λx : B.a) : (B → A)
if a : A  then (ΛX.a) : (∀X.A)
if a : (∀X.A)  then a^{B} : A[X := B]

(viii) equality rules on 0-terms as appropriate.

By convention ∀ governs as much of the expression as possible to the right, so ∀X.X → X means ∀X.(X → X) and not (∀X.X) → X.

+§3.4.3 Now we shall present this as an indexed category in a manner generalising §1.3.10. The objects of the base category will count the free 1-variables in the terms of the corresponding fibres — we shall set aside the additional complication of counting 0-variables as in §3.2.2.

Let the base category have objects the “products” (i.e. strings) of 1-variables and morphisms from Y⃗ to X⃗ the strings of length |Y⃗ | of types with free variables among X⃗. Variables provide the identity and substitution the composition. Product is given by concatenation. Hence we have a category with products.

The fibre PX⃗ over the string X⃗ has objects the products (strings) of types A⃗ with free 1-variables among X⃗ and the substitution functor over B⃗ : Y⃗ → X⃗ acts on objects as the substitution [X⃗ := B⃗] of free type variables. Accordingly the object parts of the fibres are the regular representation of the base category (§3.2.4).

The morphisms of the fibre PX⃗ from B⃗ to A⃗ are the strings of terms of types A⃗ with free 0-variables of types B⃗. As usual identity and composition arise from variables and substitution. The effect of the substitution functor is again the substitution [X⃗ := C⃗]. The fibres have products by concatenation.

The fibres also have exponentials in the same way as the λ-calculus with fixed types. This arises from the constructor (A → B) with the obvious iteration to provide from strings. We need the η_{0}-rule to ensure that the adjunction is bijective. Again exponentials are preserved by substitution.

+§3.4.4 The type variable X in the fibre over X is a generic type in the sense of §3.2.5. So for any type A in the fibre over Y⃗ there is a unique morphism, called A, from Y⃗ to X the effect of whose substitution at X over X is A over Y⃗.

+§3.4.5 The significant point of this language and indexed presentation is that ∀ and Λ provide quantification over product projections in the base category, i.e. right adjoints to the corresponding substitution functors.

For we have a natural bijection

[figure: B⃗; A⃗; B⃗; ∀X.; A⃗]

where X is not free in B⃗. For above the line we have the terms a⃗ of type A⃗[X] in free variables of types B⃗, and these correspond to terms a′ = ΛX.a⃗ of type ∀X.A⃗ in the same free variables since a⃗ = (ΛX.a⃗)^{X} and a′ = ΛX.(a′)^{X} by the β_{1} and η_{1} rules.

It is an easy matter to verify that the Beck condition holds.

The syntax provides no means to express quantification over other maps in the base category, as we may see from their reading in Natural Deduction as in §3.2.16.

§3.4.6 Seely [1986] discusses a language due to Girard [1972] which is “higher-order” in the sense that it admits variables for type-valued functions of types.

The difference in the interpretation is that now we require the base category to be cartesian closed.

§3.4.7 We are now in a position to propose a provisional definition for a model of a language of this kind. It is an indexed category of a certain form. The base category has at least products and desirably exponentials; it may as well be generated by an object V which is a metatype of types. The fibre over a power of V, which is the term structure with this many free type variables, is to be cartesian closed, and this structure is to be preserved by substitution. The types (objects of the fibre) are not to be functorial in the type variable, but the substitution is to be a functor. Finally we require substitution over at least the product projections to have a right adjoint; in §4.1.7 we shall see why we call this “completeness” for the category.

A presentation of this might be as follows [Moggi 1986]. The types form a small (internal) category (§3.2.8, 4.2.10, 5.5.2) C with object set C_{0}. A type A with free variables X⃗ is interpreted as any function C_{0}^{n} → C_{0}, where n = |X⃗|. This is not to be a functor.

A term a of type A with free variables of types B⃗, where A and B⃗ themselves have free type variables X⃗, is a function C_{0}^{n} → C_{1} (where n = |X⃗|) whose postcomposites with the domain and codomain maps C_{1} ⇉ C_{0} are the interpretations of B⃗ and A respectively. This interpretation is generated in the obvious way from variables as product projections and application and abstraction as the exponential adjunction.

In order to interpret the quantified type ∀X.A we need a right adjoint Π to the substitution (inclusion) C_{0} → C_{0}^{C_{0}}. We then proceed as in §3.4.5.

The problem with this approach is Freyd’s paradox (proposition 1.5.8). This simply means that C cannot be an internal category in Set since that argument depended upon excluded middle. We shall show that it is possible to do this kind of thing with domains instead of sets. It is also possible to do it in the Effective Topos [Hyland 1982].

§3.4.8 From languages of purely theoretical interest we shall now turn to one called PONDER which has been implemented practically by Fairbairn [1984]. His emphasis is upon the use of types as a programming aid (§3.1.1) to ensure that functions are only applied to arguments of appropriate types, and so this work concerns a type-checking algorithm. Instantiation for X in ∀X.A is then a form of coercion (§1.3.8) and so we have to consider the rules for this.

The syntax of PONDER is essentially as in §3.4.2, with the additional features of casts (expressions declared, perhaps erroneously, to be of a certain type), capsules (declared types which must match by name and not structure), overloaded operators (§3.1.1) and generators (recursively defined types). For our purposes the first three are syntactic sugar, and we shall discuss the last in the next section.

As in §1.3.9 we have a relation A ⊂ B between types such that whenever we have a : A then we also have a : B. Fairbairn writes ≥ for this, contrary to the usual convention for the relationship between posets and categories.

§3.4.9 This relation satisfies the following rules.

(i)  A ⊂ A
(ii) if A ⊂ B and B ⊂ C  then  A ⊂ C
(iii) if A ⊂ A′ and B′ ⊂ B  then  (B → A) ⊂ (B′ → A′)
(iv)  (∀X.A) ⊂ A[X := B]
(v) if A ⊂ B and X ∉ FV(A) then  A ⊂ (∀X.B)
(vi) if X ∉ FV(A)  then (∀X.A → B) ⊂ (A → ∀X.B)

We shall consider the rules for recursion in §3.5.4.

Clearly axioms (i) to (iii) are those for an (indexed) Heyting system (§1.3.9). (iv) and (v) say that ∀X is right adjoint to substitution, i.e. a universal quantifier; the monotonicity of ∀X w.r.t. ⊂ follows from these. (vi) is in fact equivalent to preservation of → by substitution; the reverse inequality follows from the other axioms.

The essence of the idea that ∀X.A is “type A, whatever the value of X”, as in our “Platonic” identity of §3.4.1, is in axiom (iv).

We have now justified the claim that ∀X is a right adjoint to substitution.

3.5 Strong Polymorphism

§3.5.1 Finally we consider recursively-defined types and type-of-types, both from the historical negative point of view and in the positive case of highly-typed programming languages. Arguably the notion of a type of types has been present in Computer Science since Babbage’s first stored program. Also, although in practice compilers are essentially syntactic beasts, in order for the compiler for a typed language itself to be well-typed, it is necessary to have a type-of-types in the language.

§3.5.2 First we look at the recursively defined types in PONDER (§3.4.8). The syntax of this language as implemented is declarative, i.e. it allows new names to be introduced. In particular we have, for instance,

type Identity  = ∀X.X → X
type P air[A, B]  = ∀X.(A → (B → X)) → X
rectype Infinite List[A] = P air[A, Infinite List[A]]

Since Fairbairn’s intention was to build a terminating type-checker, there is a restriction in the language in the form of recursive type declarations. This is that all applications of the generator (here Infinite List) within the body of the declaration must be to exactly the parameters as on the left hand side. This restriction ensures that such infinite behaviour as arises in the type-checker is only of a cyclic kind and can therefore be trapped by incorporating memory into the algorithm. Without it, type-checking would have the full power of the λ-calculus and hence be undecidable.

Our intentions, on the other hand, are semantic, and we have not worried about termination elsewhere in this work, so we shall not consider this restriction.

§3.5.3 Here are the coercion rules for recursive types. These are more complicated than those in §3.4.9, so we have to include the assumptions (Γ) explicitly. The typing rules may be deduced from them since the intention of A ⊂ B is that a : A implies a : B for all terms a.

\frac{Γ, A ⊂ B ⊢ G[A] ⊂ B Δ ⊢ A ≅ G[A]}{Γ ∪ Δ ⊢ A ⊂ B}

\frac{Γ ⊢ G[X_{1}, ..., X_{n}] ≅ A}{Γ ⊢ G[X_{1}, ..., X_{n}] ⊂ A}  \frac{Γ ⊢ G[X_{1}, ..., X_{n}] ≅ A}{Γ ⊢ A ⊂ G[X_{1}, ..., X_{n}]}

§3.5.4 Since types form a category rather than a poset, the semantics of recursive types are more complicated than simple fixpoint equations. Of course we have already discussed this in §2.2.2.

§3.5.5 Now let us turn to a “full-blown” form of type polymorphism involving type-of-types. This discussion is based on that of Cardelli [1986], which gives numerous examples of constructs which can be expressed in the language; the semantics given there is based on the P ω model (§1.4.8).

Admitting the type of types is the same as making types values, so we no longer have the stratified variables and terms which we had in the second order polymorphic lambda calculus (§3.4.2), PONDER (§3.4.8) or Martin-Löf [1975]. Types can therefore be the results and parameters of computation, in contrast to their usual passive (and solely compile-time) rôle in type-checking.

Types can also depend on non-type parameters. This is quite familiar in Mathematics, e.g. “the set of points at distance r from the origin”. Notice that y is free in ∀x : a(y).b; again there are familiar mathematical examples.

§3.5.6 The terms of Cardelli’s language are as follows:

1. variables, x,

2. type of types, V,

3. abstraction, (λx : a.b), 3.5. STRONG POLYMORPHISM 97

4. application, (ab),

5. product, (∀x : a.b),

6. pair, ⟨a, b⟩,

7. component, (a ↾ b),

8. sum, (∃x : a.b),

9. recursion, (μx : a.b).

The reduction rules are:

((λx : c.a)b) = a[x := b]  (β)
(λx : c.(ax)) = a  (η)
⟨a_{0}, a_{1}⟩ = a (π)
(⟨a, b⟩ ↾ c) = ((ca)b)  (σ)
(μx : c.a) = a[x := (μx : c.a)] (μ)

where in η, x ∉ FV(a), and in π, 0 = λx : A.λy : B.x, etc.

§3.5.7 Type-checking in this language may involve non-termination computation, and so is undecidable. In what follows, Γ is a type-assignment, i.e. a set of formulae a : A. The empty assignment is valid, and further ones are generated by the rule

\frac{Γ ok Γ ⊢ A : V}{Γ, x : A ok} x ∉ FV(Γ)

Now we have a long sequence of rules defining the type inference relation ⊢. Observe that the last of these involves computation.

\begin{aligned}& A \\ Γ, x : A ⊢ x : A \end{aligned}  \begin{aligned}& VI \\ Γ ⊢ V : V \end{aligned}
Γ, x : A ⊢ B : V ; ∀f ; Γ ⊢ (∀x : A.B) : V  Γ, x : A ⊢ B : V ; ∃f ; Γ ⊢ (∃x : A.B) : V
Γ, x : A ⊢ b : B ; ∀I ; Γ ⊢ (λx : A.b) : (∀x : A.B)  Γ ⊢ a : A Γ ⊢ f : (∀x : A.B) ; ∀E ; Γ ⊢ (fa) : B[x := a]
Γ ⊢ a : A Γ ⊢ b : B[x := a] ; ∃I ; Γ ⊢ ⟨a, b⟩ : (∃x : A.B) Γ ⊢ c : (∃x : A.B) Γ ⊢ d : (∀x : A.∀y : B.C⟨x, y⟩) ; ∃E ; Γ ⊢ (c ↾ d) : Cc
Γ, x : A ⊢ a : A ; μf ; Γ ⊢ (μx : A.a) : A  Γ ⊢ a : A Γ ⊢ B : V A = B ; \overline{Red} ; Γ ⊢ a : B

where in (∃E), x, y ∉ FV(C).

§3.5.8 There are certain constructions which are basic to category theory but derivable from Cardelli’s language (as in PONDER). These are

void (0)  ⊥ = λA : V.μx : A.x  : ∀A : V.A
unit (1)  ∗ = λA : V.λa : A.a  : ∀A : V.∀a : A.A
Boolean (2) 0, 1  : ∀A : V.∀a : A.∀b : A.A
conditional cond = λc : 2.λA : V.λa : A.λb : A.cAab  : 2 → ∀A : V.A × A → A
exponential  → = λA : V.λB : V.∀x : A.B  : V → (V → V)
product  × = λA : V.λB : V.∃x : A.B  : V → (V → V)
sum  + = λA : V.λB : V.∀C : V.(A → (B → C)) → C : V → (V → V)

§3.5.9 How can we present this language as an indexed category? First we have to construct the (ordinary) category C of types and terms as in §1.3.10. Of course this has objects the strings A⃗ of types (A such that A : V) and morphisms from B⃗ to A⃗ the |A⃗|-strings of types A⃗ in free variables of types B⃗. This is cartesian closed because we have an extension of the λ-calculus.

Next we have to deal with the quantifiers. This involves building an indexed category over C. The fibre over A⃗ has objects the strings of type-expressions with free variables of types A⃗ and morphisms the appropriate strings of terms. The substitution functors are, of course, given by substitution.

Now how do we interpret ∀x : B.c, where B has free variables of types A⃗ and c has them of types A⃗, B (the last being of course x)? The expression has free variables of types A⃗, so we have a functor from the fibre over A⃗, B to that over A⃗; over what morphism (A⃗, B) → A⃗ does this lie? This corresponds to a string of terms of types A⃗ in free variables A⃗, B; this must simply be the string of corresponding variables. However this is not a product projection as it was in the second order polymorphic lambda calculus or PONDER, because B itself depends on A; in fact it is the display map corresponding to the sum ∃a⃗ : A⃗.B over A⃗. We shall meet this in the case of Set in §4.1.11 and subsequently in other categories. ∀x : B is then the right adjoint to this substitution map.

The sum ∃x : B.c is similarly interpreted as the corresponding left adjoint. The Beck condition is satisfied in the usual trivial way.

The μ operator gives (or is interpreted as) indexed fixpoints, i.e. Y_{A} = λf : (A → A).μx : A.fx.

−§3.5.10 Finally we have to bring V into the picture. Let X be a variable of type V. This is then an object of the fibre over X, and is such that any other type (in however many free variables of whatever type) is obtained by substitution. X is therefore generic in the sense of §3.2.5.

We are also interested in the (objects of) this fibre over X. We have a type of them, namely G = ∃X : V.X → V. We shall see in §5.4 that this is a generic display and is sufficient to code up the whole of the structure of the model with type-of-types.

−§3.5.11 Finally let us put this in historical perspective by surveying briefly some of the corpses in this philosphical minefield.

The first casualty was of course Frege [1893], who attempted to axiomatise Set theory (and hence Mathematics) using an unrestricted Axiom of Comprehension (cf. §1.5.11). This means that, given any formula ϕ(x) whatever, there is a set “{x : ϕ(x)}” of all things satisfying ϕ. As is well known, Russell pointed out to the unfortunate Frege that ϕ(x) = x ∉ x leads to a contradiction.

The main response to this has been to bind the set-abstraction and quantifiers. Category theorists (at least) would claim that there is no occasion in Mathematics when these operations are not implicitly bound, and in this work the common convention of using lower-case letters for variables of the corresponding upper-case type has usually been adopted.

Russell [1908] was the first to formalise this, as the theory of types. We build an ℕ-indexed hierarchy in which each level consists of all subsets of sets in the level below. This is in fact the simplification due to Ramsey: the original version took account of quantifiers as well. This was a very advanced notion for its time: the systematic classification of sets according to their quantifier complexity (most of the interest being in quantification over subsets of ℕ, which are usually called “real numbers”) began with Kleene.

Russell made an important observation which he called typical ambiguity. This is that whenever we have a proof of ϕ(x) for x of some type n, then we also have it for x of any other type (so long as there are sufficiently many lower types for its hereditary elements). Accordingly his style is such that the variables are implicitly to be understood schematically with quantification over all types. This is of course already a form of polymorphism (we used this kind of type-shifting implicitly in §1.3.12).

Quine [1937] took this a stage further and used this polymorphism to abolish the types. Instead he stratified the formulae (by the ∈-relation). Thus we are allowed to write x ∈ y ∈ z but not x ∈ x or x ∈ y ∈ z...x ∈ z. Formally, there must be an assignment of natural numbers (or integers, to remove the “lower types” complication) to the variables such that ∈ occurs only between variables of successive types. This is called New Foundations or NF . For a general review of this theory and its developments see [Forster 1983].

The remarkable thing about NF is that it allows a universal set, and also complements of arbitrary sets inside it. The Russell paradox of course cannot be stated within it. On the other hand its heavy emphasis on the ∈ relation means that something as basic as the cartesian product construction has a very complicated expression in terms of ⟨x, y⟩ = {{x}, {x, y}}.

There are subsystems of NF depending on the number of types which need to be used. The first two levels (in which a ∈ b and a ∈ b ∈ c are allowed but not a ∈ b ∈ c ∈ d) can be shown to be consistent, as can NFU (NF plus “Ur” elements or atoms). NF_{4} is in fact the full theory, since it allows a kind of duality to be coded, specifically the operation Bx = {y : x ∈ y}.

−§3.5.12 There is another paradox, which was in fact noticed before the better known one due to Russell. This is based on the observation that ordinals (well-founded totally ordered sets) are themselves well-ordered and hence “algebraically” form an ordinal usually called On. Thus in the presence of unrestricted comprehension On ∈ On, and indeed it is the largest ordinal, contrary to the ease with which the successor may be constructed.

This, the Burali-Forte paradox [Rosser 1942], has perhaps been even more of a killer than Russell’s. One might attempt to extend NF by allowing class variables (as in Gödel-Bernays set theory) and admitting as a set the intersection of any abstracted class with a set. However in this theory one may formulate the ordinal-of-ordinals and hence reach contradiction.

The most famous victim of this paradox is probably Martin-Löf’s original attempt at an intuitionistic type theory [1971]. It was discovered both that it was possible to define a type of well-founded partial order types (itself a partial order) and to prove induction over well-founded partial orders. This necessitated some quite far-reaching changes in the type theory, involving the introduction of a nested sequence of universes. Martin-Löf’s executioner was Jean-Yves Girard, who was also interested in this area, largely for proof theoretical reasons. He produced a system of polymorphic λ-calculus known as “Système F” [1972].

This was also a method which was suggested for dismissing typoses with equality (theorem 5.5.9), but other arguments were found instead.

100 CHAPTER 3. TYPE POLYMORPHISM

The Indexed Category Theory of Sets

4.1 Indexed Families, Products and Coproducts

§4.1.1 The previous chapter set out to motivate Indexed Category Theory from a syntactic point of view. We aim, of course, to apply it semantically to categories of domains, and this we do in chapter V. First, however, we must devote the present chapter to the case of discrete sets, which we approach with a view to formulating the fact that Set is “complete”, that it has all “small” (i.e. set- rather than class-indexed) limits (and colimits). The answer to this depends upon first being able to express the notion of a “family” of sets.

This chapter sets out some of the basic ideas of indexed category theory, motivated in the first instance by this problem. In the case of Set we would like to be able to define an indexed family of sets as a function from the indexing set to the “set” of all sets. Of course Russell showed long ago that we cannot have this. However there is a trick with disjoint unions and pullbacks which enables us to perform an equivalent construction called a fibration.

The opening section motivates the notion of an indexed family of sets and the definitions of indexed products and coproducts. In the second section we discuss other categories and constructions indexed over a base category. In section 3 we address the subject of cartesian closure again, this time from an indexed point of view. In the case of Set we require pullback against arbitrary maps (not just product projections) to have a right adjoint, but this is too strong a condition for categories of domains. Instead we define relative cartesian closure, which we find already applies to Cat in another illustration of our confusion of object and metalevels. In the final section we discuss the indexed forms of the general and special adjoint functor theorems and introduce elementary toposes; this illustrates the way in which adjoints can be used to replace infinitary structure such as arbitrary colimits.

§4.1.2 We begin by formalising the notion of an indexed family of objects. This account of indexed categories is very loosely based on [Johnstone et al. 1978] and [Johnstone 1983].

Let S be some category, whose objects we are thinking of as sets — in the first instance S = Set. In order to talk about products, coproducts and so on in S we need some notion of an A-indexed family of objects of S, for each A ∈ ob S. A na¨ ıve notation for such a thing might be (X_{a} : a ∈ A). Between these there are A-indexed functions, (f_{a} : X_{a} → Y_{a} : a ∈ A), so that we have a category S^{A}. In the basic example this category is simply the A-fold power of the category S = Set.

As well as A-indexed families, we have substitution or relabelling functors. If α : B → A is any S-map and (X_{a} : a ∈ A) is an A-indexed family, we have a B-indexed family (X_{αb} : b ∈ B). The same applies to morphisms, so this is in fact a functor S^{α} : S^{A} → S^{B}. The assignment α ↦ S^{α} is itself (pseudo) (contra) functorial, in that S^{id} ≅ id and S^{α;β} ≅ S^{β};S^{α}. These natural isomorphisms will have to satisfy some coherence conditions, but we shall not pay too much attention to them.

§4.1.3 (X_{a} : a ∈ A) appears to be a function from A to the class of all sets, which is a very troublesome notion. As has been remarked, we shall be able to think in this way in Retr(Λ), but not in Set. The trick in Set is to code this up using the disjoint union, making use of our a priori knowledge of the structure of the category but quietly subsuming the Axiom of Replacement. The indexed set (X_{a} : a ∈ A) is represented by its disjoint union together with the display map which identifies the index:

\begin{matrix}X = ∐_{a∈A} X_{a} & x ∈ X_{a} \\ A & & a & \end{matrix}

An object of S^{A} is therefore just a function, or S-morphism; X_{a} is picked out as the inverse image of a, i.e. the pullback of the singleton function ⌜a⌝ : 1 → A against the display map. In the case S = Set any map may occur as a display map.

The substitution functor S^{α} : S^{A} → A^{B} over α : B → A is easily seen to be given by pullback along α and is consequently written Pα or α^{∗}:

[figure: ∐_{b∈B} X_{αb} ≅; X ×_{A} B; X; ≅ ∐_{a∈A} X_{a}; B; α; A]

§4.1.4 There is an alternative description of this set-up in terms of fibrations. The objects over A ∈ S are the S-maps with codomain A, but besides forming categories over each A (called fibres) all the objects together form a category called S^{2} because it is the category of functors from 2 = (• → •) to S; the morphisms are just the commutative squares in S. There is then a functor cod : S^{2} → S with the property that X ∈ S^{A} iff cod(X) = A and the maps X → Y over α : B → A (i.e. the squares whose lower side is α) correspond bijectively to the maps X → PαY in S^{B}. The maps within a single fibre (i.e. the squares with an identity along the bottom) are (for obvious reasons) called vertical whilst those which give pullback squares are called horizontal or cartesian.

The fibred (as opposed to indexed) approach was pioneered by Bénabou [1975] in recognition of the fact that substitution is in practice defined only up to isomorphism.

The fibre over A is in this case may be seen as either the A-fold power of S or as the slice category S/A whose objects are the S-morphisms with codomain A and whose morphisms are the S-morphisms making the triangles commute. In the relative case the objects of the slice will be display maps but the morphisms will still be arbitrary maps.

There is, however, nothing in the definition of a general fibration to require the fibre over an arbitrary A to be the A-fold power of that over the terminal object of S. Indeed the difference is quite crucial to most applications. We shall denote the fibre over A by PA and the substitution functor over α : B → A by Pα.

Lemma Let α : B → A and U, X be over B, A respectively. Then there is a natural bijection

[figure: U; α; X; U; B; Pα; X]

□

§4.1.5 Let us consider the form of (binary) products in the fibre categories. Let X and Y be objects over A, presented either as A-indexed things or as displays (S-morphisms with codomain A), and write X ×_{A} Y for their product according to either interpretation. Naïvely this is (X_{a} × Y_{a} : a ∈ A), but as a display it turns out to be precisely the pullback, hence the alternative name fibre product for the latter. In English we may therefore say “fibre products are pullbacks”, although the (Gaullist) French can’t make the a priori distinction!

[figure: X ×_{A} Y; X  Y; A; PαE; E; PαX; ∩; X; ∩; PαY; Pαf; Pαg; Y; f; g; B; α; A]

The indexed equaliser of f, g : X ⇉ Y in S^{A} is E = (E_{a} : a ∈ A) where E_{a} = {x_{a} ∈ X_{a} : f_{a}x_{a} = g_{a}x_{a}}; this is preserved by substitution (pullback). So in the fibred case, if the column on the right is an equaliser diagram then so is the substituted version on the left. Then E is the equaliser in the whole display category P = S^{2} as well as in the fibre over A.

§4.1.6 Now we shall look at products in Set from the “indexed family” point of view. Like universal and type quantification is corresponds to a right adjoint to substitution. This gives us a notion of “internal product” applicable to categories of retracts and domains.

Given an B-indexed family of sets, (X_{b} : b ∈ B), their product has elements the indexed families (x_{b} : b ∈ B) where ∀b.x_{b} ∈ X_{b}. This is a B-indexed family of choices of elements, which is the same as specifying a B-indexed family of maps from the (constant) singleton to the X_{b}, i.e. a map 1_{B} → X from the terminal object in the fibre over B. Now the display map of the terminal object over B is precisely (as an S-morphism) the identity on B (which to some extent excuses the ambiguous notation 1_{B}) so this is just a section or splitting of the display map.

Write ∏_{B} X for the product set, and think of it as an object of the fibre over the terminal object (i.e. of the category of single sets). It has elements 1_{1} → ∏_{B} X, and these are to correspond to the maps 1_{B} → X over B. Now 1_{B} is the pullback of 1_{1} against the terminal projection α =!_{B} : B → 1, i.e. its image under the substitution functor Pα.

[figure: 1_{B}; ≅; Pα; 1_{1}; B; X; 1_{1}; 1; ∏_{B}; X]

Thus ∏_{B} is the right adjoint of Pα: Pα1_{1} ≅ 1_{B} → X over B.

§4.1.7 Now let us do this indexedly. So given ((X_{b} : b ∈ B_{a}) : a ∈ A), an A-indexed family of B_{a}-indexed families of objects, we need to show how to construct the ath product, (∏_{b∈B_{a}} X_{b} : a ∈ A), and present it as a member of an A-indexed family.

To do this we begin by displaying the B_{a}’s over A, i.e. we construct a morphism α : B → A, where B = ∐ B_{a}; then we present the objects ((X_{b} : b ∈ B_{a}) : a ∈ A) as a B-indexed family (X_{b} : b ∈ B). The elements of the member (ΠαX)_{a} = ∏_{b∈B_{a}} X_{b} of the product are maps to 1 → (ΠαX)_{a} which are to correspond to indexed families (1 → X_{b} : b ∈ B_{a}) and so the maps 1_{B} → ΠαX over A correspond to those 1_{B} → X over B. In other words Πα (or α_{∗}) is the right adjoint to the substitution or pullback Pα (or α^{∗}).

[figure: 1_{B}; ≅; Pα; 1_{A}; B; X; 1_{A}; A; Πα; X; ≅; ∏_{b∈B_{a}} X_{b} : a ∈ A]

Definition An internal product in an indexed category is a right adjoint to substitution over a display map.

§4.1.8 The are no conceptual difficulties in doing this for Set: collections of maps may be understood na¨ ıvely, and any morphism in the base category S occurs as a display map. This is not so in categories of retracts or domains: we have to make our indexing “continuous”, and not every map occurs as a display map.

Likewise the collections of maps (cones) in the definition of product have to be “continuously varying”. Whilst clearly Retr(Λ) and small categories of domains do not have all products externally, they still “think” they have them in this sense. Where the “continuously varying” is taken to mean computable or definable we have the appropriate restriction on the definitions to make them appropriate to programming or intuitionistic type theory.

§4.1.9 The case of a product over a constant family in Set is very familiar: it is simply an exponential. It essentially follows that a category with indexed products over itself is cartesian closed; moreover the exponentials are preserved by substitution (pullback).

The converse is also true for Set. Unfortunately this depends crucially on having all finite limits.

Proposition Let S be left exact. Then the fibration cod : S^{2} → S has indexed products iff each fibre is cartesian closed; moreover in this case the exponentials are preserved by pullbacks. Proof

[⇒] Let α : Y → A and Z be objects over A, and suppose Πα is right adjoint to pullback Pα along α. Then Z_{A}^{Y} = Πα(PαZ) is the exponential, for

Y ×_{A} X  \overline{\overline{_{A}}} Z
Y ×_{A} X ≅ PαX  \overline{\overline{_{Y}}} PαZ ≅ Y ×_{A} Z
X  \overline{\overline{_{A}}} Πα(PαZ)

[⇐] Let α : B → A and suppose that the fibre over A is left exact and cartesian closed. For β : Y → B let ΠαY be the equaliser

[figure: ΠαY; ⊂; Y_{A}^{B}; K1_{B}; post(β); B_{A}^{B}]

Then for U ∈ PA, maps U → ΠαY over A correspond to maps U → Y_{A}^{B} whose composites with the above maps are equal, and hence to maps U ×_{A} B → Y whose composite with β : Y → B is the right projection, i.e. to maps PαU ≅ U ×_{A} B → Y over B.

[pres] By preservation we mean that Pα(Z_{A}^{Y}) ≅ (PαZ)_{B}^{(PαY)}.

U \overline{_{B}} Pα(Z_{A}^{Y}) ≅ Z_{A}^{Y} ×_{A} B
U  \overline{\overline{_{A}}} ZY A
Y ×_{A} U  \overline{\overline{_{A}}} Z
Y ×_{A} U ≅ PαY ×_{B} U \overline{_{B}} Pα Z
U \overline{_{B}} (PαZ)_{B}^{(PαY)}
□

§4.1.10 The case for sums is very similar, although we are not allowed to argue in terms of elements any more. Like existential quantification, it corresponds to a left adjoint to substitution.

Let α : B → A be a display map (with fibres B_{a}) and Y ∈ PB. The indexed sum is

ΣαY = {∑_{b∈B_{a}} Y_{b} : a ∈ A}

Hence a map ΣαY → X over A consists of maps Y_{b} → X_{a} for b ∈ B_{a} (by the definition of a coproduct, for a given a ∈ A we patch these together to make a map (ΣαY)_{a} → X_{a}). The same thing may be presented as a B-indexed family of maps {Y_{b} → X_{αb} : b ∈ B}, i.e. a map Y → PαX over B.

Definition An indexed sum is a left adjoint to substitution over a display map.

For the cod fibration the following easily-overlooked triviality is appropriate:

Lemma For an S-morphism α : B → A, the pullback functor Pα : S/A → S/B along α has a left adjoint Σα (or α_{!}) given by postcomposition with α. □

Proposition The fibration cod : S^{2} → S is cocomplete iff S has all finite (limits and) colimits. □ This is due to Bénabou.

+§4.1.11 Starting from the indexed approach we now have a direct route to the display map: recall that this was originally given as a disjoint union. Let X be an A-indexed family (object of the fibre over A). It has a terminal projection X → 1_{A} in this fibre, and the image of this under the sum functor is of course ∑_{A} X → ∑_{A} 1_{A} over 1; but ∑_{A} 1_{A} is (isomorphic to) A (in the canonical identification of S with the fibre over 1).

Proposition In the fibration cod : S^{2} → S, the fibre over the terminal object is equivalent to S and the display X → A corresponds to the map ∑_{A} X → ∑_{A} 1_{A} in this fibre. □

This is the method by which we shall identify displays of retracts.

§4.1.12 There is another consequence to having a left adjoint to substitution:

Proposition Let p : P → S be a fibration. Then each substitution functor Pα has a left adjoint iff p : P^{op} → S^{op} is also a fibration. Proof [⇒] Let α : B → A in S, Y be over B and Z over C, where γ : A → C. Then

Y  \overline{_{α;γ}} Z
Y \overline{_{B}} Pα(PγZ)
ΣαY  \overline{\overline{_{A}}} PγZ
ΣαY  \overline{\overline{_{γ}}} Z

[⇐] Conversely let Σα be the cosubstitution. □

We shall make use of this in §5.2.

We may form the vertical opposite, P^{vop}, of P, in which we turn round the morphisms in the fibres but not between them. Then P has indexed products iff P^{op} → S^{op} is a fibration. Also write P^{hop} ≃ (P^{vop})^{op}; usage of the terms opfibration and cofibration seems confused.

If both P → S and P^{op} → S^{op} are fibrations then we call them a bifibration.

4.2 Fibred Categories

§4.2.1 The previous section introduced the fibred presentation of Set and its internal completeness and cocompleteness. Though our major concern is with categories of types like Set, Retr(Λ) or BiPos_{f}, we also need to know about how other “large” categories may be presented over the base category of types. This may also be done in terms of fibrations, and the aim of the present section is to relate this to “internal” and “indexed” formulations and to describe common categorical constructions and properties in this new form. In particular in §4.4 we shall prove the various forms of the adjoint functor theorem.

Besides using fibrations to discuss categories of types and algebras, in the next chapter we shall apply them to the types (domains) themselves, since domains are posets and hence categories. Conversely we shall find in the next section that Cat is indexed over itself with fibrations as displays. This confusion of levels is of course important to the construction of a type of types.

§4.2.2 As in §4.1.2, write S for the “base” category, whose objects are the indexing sets and whose morphisms are the relabellings; for the moment this is assumed to be Set. Let C be some (possibly large) category, which we are trying to index over S.

As before, for each set A ∈ S, we have a category of A-indexed families of objects and morphisms of C; of course naïvely this is just C^{A}, the A-fold power of C. If α : B → A is a function we have a functor C^{α} : C^{A} → C^{B} given by composition. Notice that the assignment α ↦ C^{α} is contravariant, so we have a functor C^{(−)} : S → Cat^{op}. More generally this may only preserve identity and composition up to isomorphism, and we have to specify these isomorphisms explicitly (they are called coherences).

If C is a concrete category (so its objects are sets and its morphisms some functions between sets) we can copy the construction of §4.1.3 directly to build a fibration.

Lemma Let C be a concrete category and A a set. Then C^{A} is equivalent to the following (concrete) category. The objects are disjoint unions X = ∐_{a∈A} X_{a} of A-indexed families of objects of C (quâ sets), together with their display maps X → A. The morphisms (X → A) → (Y → A) are the functions X → Y which (i) make the triangle over A commute and (ii), when restricted to the components X_{a} → Y_{a}, yield C-morphisms. □

Since the theory of categories is finitary essentially algebraic (§3.2.8), the data P : S → Cat^{op} yield a (pre)sheaf of categories; this may alternatively be viewed as a category in the topos of presheaves on S.

§4.2.3 For abstract categories we have of course to give an abstract construction. We are aiming for a fibration p : P → S, where P corresponds to S^{2} in the case C = S. For a concrete category, P has objects over A the X → A of lemma 4.2.2 and morphisms over α : B → A the commuting squares which restrict in each component to C-morphisms.

In the abstract case the objects of P over A are the A-indexed families themselves, so ob P = ∐_{A∈S}(ob C)^{A}. The morphisms are generated by the vertical ones, i.e. those in C^{A}, together with the horizontal ones over α : B → A, which are provided by fiat: one of the form (X_{αb} : b ∈ B) → (X_{a} : a ∈ A) for each A-indexed family.

Definition

(a) A morphism f : X → Y in P is cartesian or horizontal (w.r.t. p : P → S) if, given any g : Z → Y in P and a commutative diagram as on the left:

[figure: pZ; pg; pX; α; pf; pY; Z; g; X; h; f; Y]

in S then there is a unique h : Z → X in P with ph = α such that the triangle on the right commutes.

(b) A morphism is vertical if its image under p is an identity.

(c) The functor p : P → S is a fibration if, given any α : B → A in S and X ∈ P with pX = A, there is a cartesian morphism f : Y → X in P with pf = α; we call f a cartesian lifting of α.

In (c) we only ask for the existence of the f, not a choice of it (though any two such will be isomorphic). Even so, we shall write PαX for any such Y.

Proposition Given any category C, the above construction p : P → S is a fibration. If C is concrete (in particular if C = S) this is equivalent to the previous construction, in the sense of an equivalence of categories over S. □

Lemma The following diagram is a pullback in P:

PαX  \overline{}X

[figure: PαY; Pαf; Y; f]

B  \overline{α} A
□

§4.2.4 We have shown how to pass from the indexed to the fibred presentation; the inverse is rather more complicated. However before attempting to perform an inverse construction, we observe that there is nothing in this to require the fibre over A to be the A-fold power of C. In fact the foregoing construction depends only on the (pseudo)functor S → Cat^{op}.

For a general indexing pseudofunctor P : S → Cat^{op}, we construct a fibration p : P → S as follows. The fibre over A is just PA (this accounts for the objects and vertical morphisms), and the horizontal morphisms are of the form PαX → X over α : B → A where X ∈ PA.

There is still something special about the form of the fibration which arises in this way, namely that (contrary to the wording of definition 4.2.3(c)) we have canonical choices of cartesian liftings. A fibration of this form is said to be cloven. Of course any two cartesian liftings are isomorphic, but there is nevertheless a potential problem of Choice. In the case of cod : S^{2} → S this is the distinction between the existence and assignment of pullbacks.

Whether one regards this as a problem or not depends on context. If, as is Bénabou’s view, S-categories and other constructions arise naturally as arbitrary fibrations and not as indexed categories, and we aim to work in an arbitrary topos, then clearly this use of Choice is important. In the contexts in which fibrations arise in the present work, on the other hand, which are essentially syntactic, we find that they are naturally derived from indexations anyway. (On the other hand, in the category theory of Set we may vary the values of functors at individual objects independently, though of course only up to isomorphism, whereas in domain theory we are obliged to make “continuous” choices.)

Proposition There is an equivalence between pseudofunctors S → Cat^{op} and cloven fibrations over S. The indexation is a functor iff the fibration is split, i.e. the coherences (between cartesian liftings over identities and composites) are identities. □

The cod : S^{2} → S fibration is split iff we have not only a canonical choice of pullbacks, but also the composite (cf. §1.2.14) of those for the two squares gives the one for the entire rectangle:

[figure: •; •; •; •; •; •]

The question of splitting has algebraic content (i.e. apart from questions of Choice) where there are objects with proper automorphisms. We shall therefore look at the case for groups in §4.2.16.

§4.2.5 So far the only fibred category we have is cod : S^{2} → S. Let us therefore construct the fibred category of models of a single-sorted finitary algebraic theory, say rings.

An A-indexed family of rings is of course given by (R_{a} : a ∈ A) together with (⌜0_{a}⌝, ⌜1_{a}⌝ : 1 → R_{a} : a ∈ A), (−_{a} : R_{a} → R_{a} : a ∈ A) and (+_{a}, ×_{a} : R_{a} × R_{a} → R_{a} : a ∈ A). These may be coded as before by R → A, ⌜0⌝, ⌜1⌝ : A → R, − : R → R and +, × : R ×_{A} R → R over A, remembering that a fibred terminal object is the identity and a fibred product is constructed by means of a pullback. The equations are satisfied in the components iff they are for the displays: the reader is invited to formulate the latter condition.

A homomorphism of indexed families of rings is given by the corresponding function on sets (which was just a commutative square), so long as it preserves the operations. Again this happens componentwise iff it happens indexedly.

The reason why the componentwise and indexed formulations coincide is essentially that we have evaluation functors ev_{a} : Rng^{A} → Rng for each a ∈ A which (i) preserve (equations and) products and (ii) are jointly faithful. ev_{a} is just the substitution functor over the global element ⌜a⌝ : 1 → A.

§4.2.6 We only so far know about indexed or fibred categories: what about functors?

Consider first the indexed case, given two pseudofunctors P, Q : S → Cat^{op}. Then an indexed functor tT : P → Q is an assignment of a functor tT A : PA → QA to each A ∈ S. This must be consistent with substitution, so to each α : B → A we have coherent natural equivalence:

                                   PB ^{Pα} PA

[figure: QB; tT B; Qα; QA; tT A]

B  \overline{α} A

[cf. the Beck condition. (?)]

Now suppose p : P → S and q : Q → S are the corresponding fibrations. We may collect together the parts {tT A : A ∈ S} into a functor tT : P → Q; this preserves fibres so p = tT ; q exactly (not just up to isomorphism). The cartesian morphisms PαX → X in P over α : B → A are mapped to tT B(PαX) ≅ Qα(tT AX) → tT AX in Q, so tT preserves cartesian morphisms (though not necessarily choices of them). We call a functor with these properties cartesian. Given any cartesian functor between fibrations arising from indexations we may recover the indexed functor.

§4.2.7 And natural transformations?

Given two indexed functors tT , tU : P → Q, an indexed natural transformation θ : tT → tU is an assignment of a natural transformation θA : tT A → tUA to each A ∈ S consistent with substitution in the sense that the following diagram commutes for each α : B → A.

[figure: tT B(PαX); ≅; Qα(tT AX); tT AX]

[figure: tUB(PαX); θBX; ≅; Qα(tUAX); Qα(θAX); tUAX; θAX]

B = = = = = = = = = = = B  \overline{α} A

This gives rise to a natural transformation θ : tT → tU of cartesian functors. The above condition is equivalent to naturality w.r.t. horizontal maps, so any such θ will do.

Proposition Let P, Q be indexations and p, q the corresponding fibrations. Then there is a natural equivalence between indexed and cartesian functors and natural transformations. □

When we speak of functors and natural transformations between fibred categories we shall always mean them to be cartesian.

§4.2.8 Given a fibred category p : P → S, an arbitrary subcategory of P needn’t be fibred over S, and even if it is the inclusion needn’t be cartesian.

Examples Posets are sufficient to show this.

(a) A non-fibred subcategory.

(b) A functor between fibrations which doesnt preserve cartesian maps; this is a non-cartesian inclusion of a fibred subcategory.

[figure: (a); (b)]

Figure 4.2.8: Non-cartesian subcategories

§4.2.9 We can now speak of indexed adjoints.

Proposition Let p : P → S and q : Q → S be fibrations and tT : P → Q, tU : Q → P be cartesian functors.

(a) tT is left adjoint to tU quâ cartesian functors iff they are adjoint quâ ordinary functors.

(b) In this case tT preserves indexed sums and tU preserves indexed products. Proof

[a] From §4.2.7 we impose no additional condition on natural transformations to make them cartesian, and likewise the triangle equations for adjoints coincide.

[b] By taking the diagram of right adjoints to §4.2.6, tU commutes with Π functors, i.e. preserves products; likewise tT preserves sums (Σ). □

§4.2.10 Having considered “large” categories, let us now turn to “small” or internal ones. We showed in §3.2.8 how to interpret the theory of categories in any category with finite limits. Most of the information is contained in ⟨dom, cod⟩ : C_{1} → C_{0} × C_{0}; considered as a display this corresponds to the indexed family (hom_{C}(x, y) : x, y ∈ C_{0}).

The fibred version of this category is given as follows. The objects over A are A-indexed families of “objects” of C (“elements” of C_{0}), i.e. just functions (S-maps) x : A → C_{0}. The morphisms f : (y : B → C_{0}) → (x : A → C_{0}) over α : B → A are functions f : B → C_{1} with f ; dom = y and f ; cod = α; x.

Notice that we have a generic object 1 : C_{0} → C_{0}, of which any other is obtained by substitution (precomposition), and also a generic morphism, (1 : C_{1} → C_{1}) : (dom : C_{1} → C_{0}) → (cod : C_{1} → C_{0}). We shall return to small categories in §4.3.8 and §5.5.2.

§4.2.11 We now turn to manipulation of fibrations, and in particular to change of base. However since we shall be making extensive use of them, we had better first find out what a pullback of categories looks like. The peculiar notation is adapted to our applications.

Since Cat is a 2-category, we have to modify the notion of pullback. For in the following diagram, the images of the functors p and F may “miss” one another up to equality on objects of S, whilst having isomorphic objects in common; in this case the strict pullback falls short of the intention. Replacing equality by isomorphism gives pseudopullback.

Proposition Let F : T → S, p : P → S be functors as in the figure on the left. Then the pseudopullback of F and p in Cat has objects the triples (A, X, u) with A ∈ T , X ∈ P and u : F A ≅ pX in S and morphisms (α, f) : (B, Y, v) → (A, X, u) where α : B → A in T , f : Y → X in P and the right-hand square commutes.

[figure: T ×_{S} P; P; ⇒^{u}; T; F; S; p; F B; v; pY; F A; F α; u; pX; pf]

Specifically the pullback square commutes up to the natural isomorphism u, where u_{(A,X,u)} = u. If we have another pair of functors r : C → T , G : C → P making the square commute up to the natural isomorphism v : (r ; F) → (G ; p) then the mediating functor ⟨r, G⟩ : C → T ×_{S} P takes U to (rU, GU, v_{U}) and θ : V → U to (rθ, Gθ). □

+§4.2.12 There is nothing in this construction which really requires u and v to be isomorphisms. There is a more general notion, called lax pullback, in which they are replaced by arbitrary 2-cells. We write this T ×_{S} P. There are in fact applications of lax constructions to problems in the semantics of programming languages (to powerdomains and to the theory of partial functions) but these topics are not treated in this work.

Note The use of the term lax pullback here is incorrect; the standard name is comma category, although it does seem regrettable that the name of an important concept is derived from a nonintuitive piece of notation.

The three forms of pullback are related in the case of a fibration.

Proposition In the notation of proposition 4.2.11, let p be a fibration.

(a) The forgetful functor T ×_{S} P → T ×_{S} P from the strict to the lax pullback has a coreflection (right adjoint postinverse).

(b) This restricts to an equivalence between the strict and pseudo pullbacks.

(c) If F : T → S is also a fibration q : Q → S and these correspond to indexations P, Q : S → Cat^{op}, the pullback P ×_{S} Q corresponds to the product P × Q.

Proof

[a] Define T ×_{S} P → T ×_{S} P by taking (A, X, u : F A → pX) to (A, PuX), where PuX → X is a cartesian lifting of u at X. The counit is (A → A, PuX → X).

[b] If u is restricted to be an isomorphism, the counit is also an isomorphism.

[c] Same argument as in §4.1.5 □

§4.2.13 In §4.1.3 we saw that substitution of an indexing variable corresponds to precomposition of the indexation and pullback of the display. The same is true at the higher level.

Lemma Let P : S → Cat^{op} be an indexation and p : P → S the corresponding fibration, and let F : T → S be any functor. Put Q = (F ; P) : T → Cat^{op} for the composite indexation and q : Q → T for the corresponding fibration. Then q is the pullback of p along F. Proof We have only to show that Q coincides with T ×_{S} P as constructed in proposition 4.2.11, with the simplification that we may consider strict pullbacks. The fibre QA over A ∈ T is the same as that P(F A) over F A ∈ S and the horizontal maps QαX → X in Q over α : B → A in T correspond to those P(F α)X → X in P over F α : F B → F A. □

This has been phrased in such a way as to show also that the pullback of an arbitrary fibration against a functor is a fibration. We call this change of base.

Proposition Let F : T → S be a functor. Then pullback along F gives rise to a 2-functor from fibrations, cartesian functors and natural transformations over S to those over T . □

We also have a notion of a cartesian functor G : P → Q over a change of base F : T → S. This is either a cartesian functor from P to F^{∗}Q over T , or more simply a functor making the square commute (exactly) and taking horizontal morphisms of P over T to those of Q over S.

§4.2.14 One particularly important example of change of base is where T is a slice category S/A and the functor is just the forgetful functor dom or post(!_{A}). The pullback is the “fibred category of A-indexed families of objects” (cf. §4.1.7).

In this case the pullback (S/A)×_{S} P has another description, being an example of an arrow (or comma) category. For a full treatment of this construction, which also subsumes slice categories, see Mac Lane [1971], §2.6.

Lemma (S/A) ×_{S} P ≃ (p ↓ A) over S/A. Proof (p ↓ A) has objects the pairs (X, α : pX → A) with X ∈ P and morphisms f : (X, α) → (Y, β) the f : X → Y in P with α = pf ; β. This is the same description as the pullback. □

In the case S = Set, (X, α : pX → A) is ((X_{b} : b ∈ B_{a}) : a ∈ A), an A-indexed family of B_{a}-indexed families of P-objects, where B_{a} = α^{−1}(a) ⊂ pX and X_{b} is the fibre of X over b ∈ pX.

More generally, given α : B → A in S, we have a functor S/B → S/A given by postcomposition with α. This gives rise to a comparison map between the pullbacks (p ↓ B) and (p ↓ A) of P over !_{B} = α;!_{A} and !_{A}. The image of this at (X, β : pX → B) is (X, β ; α).

§4.2.15 The previous result verifies one of the axioms for a class of display maps (§4.3.2). We may easily show the other two.

Proposition

(a) A composite of fibrations is a fibration.

(b) Any functor to the degenerate (singleton) category is a fibration. Proof To find cartesian liftings we simply lift half way and then the rest. If the codomain of a functor is degenerate, we make no nontrivial requests for cartesian liftings. □

This is the one case in which the fibred presentation is simpler than the indexed form. Taking the composite of fibrations corresponds to forming indexed sums; indeed if p : C → B and q : B → A are fibrations corresponding to indexations P : B → Cat^{op} and Q : A → Cat^{op} then the fibre over A ∈ A of the composite p; q is the part of the display p : C → B over the fibre QA ⊂ B.

+§4.2.16 An indexation is, roughly speaking, an example of a map P : A → C^{op} in a category C where C^{op} itself has the structure of a C-object. Conversely C-objects have a category structure, so C is a subcategory of Cat. But this makes it a 2-category, so other C-objects also have 2-structure and C is a 3-category, and so on. It seems to me that the reason for this is the confusion of object and meta-levels implicit in the notion of a type-of-types, and (because objects of categories are to be considered isomorphic rather than equal) explains the inconsistency of equality with type-of-types (§5.5.9).

Let’s look at a few familiar cases. First let C = Set ⊂ Cat as the discrete categories. Then P : A → Set^{op} is just an A-indexed family of sets, and the fibration is the display of their disjoint union. Pos hardly differs in principle from the general case, but that of IPO and other categories of domains is of course our main interest: we shall return to it in Chapter V.

Consider, then, the case C = Gp, where we consider a group to be a category with one object (∗) and every morphism invertible. Functors and group homomorphisms coincide.

Lemma Let p : H → G be a group homomorphism.

(a) p is a fibration iff it is surjective.

(b) Then the fibre over the unique object ∗ of G is the kernel K of p.

(c) The substitution functor Pg over the base morphism g ∈ G acts on K by conjugation in H.

(d) A splitting for this fibration is equivalent to an inclusion of G as a subgroup of H disjoint from K. □

Proposition

(a) Fibrations of groups correspond to extensions.

(b) A fibration is split iff the extension splits. □

+§4.2.17 This leads us to a categorical proof of the Jordan-Hölder decomposition theorem for groups. Here is another example of the fact that categories occur in Mathematics not just as collections of familiar objects, but as the objects themselves.

Proposition

(a) Let 1 = U_{0} ◁ U_{1} ◁ U_{2} ◁ ... ◁ U_{n} = G and 1 = V_{0} ◁ V_{1} ◁ V_{2} ◁ ... ◁ V_{m} = G be two subnormal series of subgroups of a group G, i.e. in which each term is normal in the next (but not necessarily in G). Then there are isomorphic refinements, i.e. series U′_{ij} and V′_{ji} (with lexicogrophic order) such that U′_{(i−1)m} = U_{i} = U′_{i0}, V′_{(j−1)n} = V_{j} = V_{j0} and U′_{i(j+1)}/U′_{ij} ≅ V′_{j(i+1)}/V′_{ij}.

(b) The lattice L of normal subgroups of a group is modular, i.e. for a, b ∈ L, the intervals [a ⋏ b, a] = {x : a ⋏ b ≤ x ≤ a} and [b, a ⋎ b] are isomorphic posets.

Proof [a] Each step in the series is a fibration, so the result follows from the fact that a pullback of fibrations is a fibration (lemma 4.2.13). [b] is similar. □

+§4.2.18 Fibrations interact straightforwardly with limits.

Proposition Let P = lim P_{i} and C = lim C_{i} in Cat and p_{i} : P_{i} → C_{i} be a family of fibrations compatible with the diagrams in the sense that

[figure: P_{j}; P_{i}; C_{j}; p_{j}; C_{i}; p_{i}]

is a cartesian functor for each i → j in I. Then the mediating functor p : P → C is a fibration. Proof Let α : B → A in C and X ∈ PA ⊂ P. α arises from a compatible family α_{i} : B_{i} → A_{i} in C_{i}, similarly X from X_{i} ∈ P_{i}A_{i} since p_{i}X_{i} = (pX)_{i} = A_{i}. I claim (P_{i}α_{i}X_{i}) is a compatible family. This is because the functors in the diagram are fibred and hence preserve the horizontal maps P_{i}α_{i}X_{i} → X_{i}. We also have a compatible family of horizontal maps (P_{i}α_{i}X_{i} → X_{i}).

Put PαX = (P_{i}α_{i}X_{i}) → (X_{i}) = X; I claim this is horizontal. For let f : Y → X with pf factoring through α. The we have (pf)_{i} = p_{i}f_{i} : p_{i}Y_{i} → A_{i} and so a mediating map Y_{i} → P_{i}α_{i}X_{i}. By the uniqueness of this map we have a compatible family, and hence a mediating map Y → PαX.

□

We shall make extensive use of this result in the next chapter.

4.3 Relatively Cartesian Closed Categories

§4.3.1 In this section we look at cartesian closed categories from a indexed or fibred point of view. The weakest form is where − × X has a right adjoint for each object X; this corresponds to only allowing “constant families” to be displayed. At the other extreme we have the case of Set, where any map occurs as a display and pullback against it has a right adjoint; we call this local cartesian closure. We shall find that for domains we need an intermediate concept, which is parametric upon the chosen class of display maps so is called relative cartesian closure. We leave the case of domains to the next chapter, but find already here that we can apply this definition to Cat.

§4.3.2 First let us establish the

Definition Let C be a category and D a class of C-morphisms. We say that D is a class of display maps for C if

(i) The pullback of any D-map against any C-map exists and is in D,

(ii) The composite of any two D-maps is in D, and,

(iii) C has a terminal object and any terminal projection is in D.

Examples

(a) Let C be any lex category (with all finite limits), e.g. Set. Then C is a class of display maps for itself.

(b) Let C be any category with finite products and D the class of all (maps isomorphic to) product projections.

(c) Let C = IPO and D the projections. (Proposition 2.1.8)

(d) Let C = Cat and D the fibrations. (Proposition 4.2.13 & 15) □

Examples (a) and (b) are the maximal and minimal cases; we shall be interested in the other two, and the relation between them.

+§4.3.3 Recall that the slice category C/A has objects the C-morphisms with codomain A and morphisms the C-morphisms making the triangle commute. If α : B → A is a C-morphism there is a functor α_{!} : C/B → C/A given by postcomposition with α. The right adjoint to α_{!}, if it exists, is called α^{∗} and is given by pullback along α. (If α^{∗} itself has a right adjoint, written α_{∗}, then α is said to be exponentiable; when we regard α^{∗} as a substitution we write it as Pα and its adjoints as Σα and Πα.)

Warning “Slice over” in a category corresponds to “down-set” in a poset.

More generally let D be a class of C-maps; the relative slice C/_{D}A has objects the D-maps with codomain A but still all C-maps as morphisms (so long as the triangle still commutes in C). Thus C/_{D}A is a full subcategory of C/A.

Warning This seems not to be quite the correct definition, for in the case of categories and fibrations we have the extra condition of preserving cartesian morphisms. I cannot see at the moment what the appropriate morphism-part of this object-definition is, but we do not rely too heavily on the definition in the rest of the work.

[Postscript: it is actually correct.]

From these data we can construct a fibred category p : P → C, which is in some sense “C fibred over itself”.

The objects over A ∈ C are the display maps X → A with codomain A, and the morphisms over α : B → A from Y → B to X → A are the commutative squares of which three sides have already been given. The fibre PA over A is therefore C/_{D}A.

Lemma If (C, D) satisfy axiom (i) above, then this is a fibration; the fibres are relative slices and the horizontal maps are the pullback squares. □

This coincides with the standard construction in the case of Set; for the minimal class of display maps the families are all “constant” ones, so this isn’t very interesting.

+§4.3.4 Axiom (ii) serves a dual rôle: it performs mundane categorical bookkeeping, but also provides indexed sums. The purpose of axiom (iii) is that we should be able to speak of the fibration as actually being the indexed form of the original category.

Proposition Let D be a class of display maps for a category C. Then in the fibration constructed above,

(a) C is canonically identified with the fibre over its terminal object.

(b) C has finite products, and their projections (including all isomorphisms) are in D.

(c) The fibres have finite products and these are preserved (up to isomorphism) by arbitrary pullback functors.

Proof

[a] The fibre over 1 has objects the display maps with codomain 1, which are all maps to 1 by axiom (iii). But by the definition of a terminal object this category is (canonically) equivalent to C.

[b] Finite products are given by pullback over the terminal object, and the projections are in D by axiom (i).

[c] We did this in §4.1.5. Preservation follows from the fact that limits commute with one another. □

+§4.3.5 We also have indexed sums.

Proposition Let C be a category with a class of display maps D. Then in the fibration;

(a) Pullback along display maps has a left adjoint.

(b) The Beck condition for sums is satisfied.

(c) The display map in the sense constructed in §4.1.11 coincides with that defining the indexed type.

Proof (a) and (c) follow immediately from the remarks in §4.1.11 and §4.3.3. We have just to prove for the pullback square on the left (in which α and γ are displays) that the diagram on the right commutes up to isomorphism.

[figure: D; δ; A; B; γ; β; C; α] PD ^{Pδ} PA

[figure: PB; Σγ; Pβ; PC; Σα]

Let ξ : X → A be a display (so X ∈ PA). Then the following squares and rectangle are pullbacks (lemma 1.2.14), so the isomorphism holds.

[figure: Pβ(ΣαX); ≅; Σγ(PδX); D; γ; B; X; ξ; A; δ; α; C; β]

□

+§4.3.6 It therefore remains to discuss indexed products and exponentials.

Definition A category C is cartesian closed relative to a class of display maps D if the substitution functors of the fibration constructed in §4.3.3 have right adjoints.

Note This is rather clumsily stated. The products (right adjoints) only exist over display maps, take displays to displays and must satisfy the Beck condition. The latter is not redundant (despite §3.2.17) because the adjoints do not exist for all base morphisms. However Thomas Streicher observed that with the Beck condition the product over a display α : B → A, applied to a display q : Y → B, enjoys its universal property with respect to maps f not just from displays (objects of the relative slice) but from arbitrary objects p : X → A of the slice:

[figure: X; f; A; Πα; Y; α^{∗}X; B; Y]

and conversely that if the adjoint α^{∗} ⊣ Πα has this property then the Beck condition is satisfied.

Examples

(a) Set, or any locally cartesian closed category, is cartesian closed relative to all maps.

(b) Any cartesian closed category is cartesian closed relative to product projections. □

We shall show that categories of retracts and domains are relatively cartesian closed in §5.1 and 5.4 respectively. Also the projections provide a class of display maps for IPO, they do not do so for other categories of domains, and even IPO is not cartesian closed with respect to them (§5.2.8).

Y′  \overline{}Y

[figure]

[figure: Pα′X′; PαX]

[figure]

X′  \overline{}X

[figure: B′; B]

[figure]

[figure: A′; A]

Figure 4.3.8: Locally small category

§4.3.7 We may sum up our results in the

Theorem A relatively cartesian closed category gives rise to an indexed category whose fibres are cartesian closed and whose substitution functors preserve this structure. It is complete and cocomplete in the sense that substitution along display maps has adjoints on both sides which satisfy the Beck condition. □

§4.3.8 We can use these methods to formulate definitions and constructions internally (say in a locally cartesian closed category). This usually takes the form of finding a generic construction, of which any other is obtained by substitution (pullback), preferably uniquely.

We shall illustrate this by formulating the idea of a category having small hom-sets or being locally small. Since cartesian closure is concerned with exponentials, i.e. sets of functions, it will not come as a surprise that these are equivalent. We can formulate local smallness as having a generic morphism, i.e. one from which any other may be obtained by substitution (pullback).

Thus if Y ∈ PB and X ∈ PA with α : B → A, by a generic morphism from Y to X over α we mean a diagram of the form in the figure, in which the squares (parallelograms) are pullbacks, which is generic in the sense that any other diagram of the same shape (but with′′ for′) is obtained by pulling back this one by a unique A′′ → A′.

Proposition

(a) A small category is locally small.

(b) Given an A-indexed family of objects in a locally small category, there is a small category fully embedded with object-of-objects A.

Proof

[a] Let the small category be (C_{0}, C_{1}). We have a generic object id : C_{0} → C_{0}, i.e. a (C_{0}-indexed) family of which any other is a pullback. There is also a generic morphism C_{1} → C_{0} × C_{0} between any pair of generic objects, and substituting any other families for the generic ones we have generic morphisms between any pair of (families of) objects.

[b] Let X be over A. Put C_{0} = A and C_{1} the hom-set from Pπ_{0}X to Pπ_{1}X over C_{0} × C_{0}. Construct the fibration as in §4.2.10 and the obvious embedding. □

§4.3.9

Proposition S is locally small iff it is locally cartesian closed.

Proof

[⇐] Suppose Y is exponentiable in its fibre. Put B′ = (PαX)_{B}^{Y} and A′ = A ×_{B} B′. Then

Y′′  \overline{_{α′′}} X′′
Y ×_{B} B′′ ≅ Y′′ \overline{_{B′′}} Pα′′X′′ ≅ PαX ×_{B} B′′
B′′ ×_{B} Y \overline{_{B}} Pα X
B′′  \overline{_{B}} (Pα X)_{B}^{Y} = B′

and it’s not difficult to see that the correspondence is obtained by pullback.

[⇒] Conversely if B′ is generic then

B′′ ×_{B} Y  \overline{\overline{_{B}}} X
B′′ ×_{B} Y _{B′′} B′′ ×_{B} X
B′′  \overline{_{B}} B′  = X_{B}^{Y}
□

§4.3.10 We shall now give part of the the proof that Cat is cartesian closed relative to fibrations. [But the morphisms of the relative slices in this case are cartesian not arbitrary functors.]

Specifically we shall construct the fibred category of (cartesian) functors between two fibrations. We do this by first constructing the indexed category and then relying on proposition 4.2.4 to give the fibration.

Given fibrations p : P → S and q : Q → S we need a notion of an A-indexed family of cartesian functors P → Q. Generally an A-indexed family of functions is a fibre-preserving function between displays. Recall from §4.2.14 that (p ↓ A) ≃ (S/A) ×_{S} P is the “fibred category of A-indexed families of P-objects”, and that its objects are (X, α : pX → A). Hence cartesian functors (p ↓ A) → (q ↓ A) over S/A represent A-indexed families of functors P → Q. We take this to be the fibre of Q^{P} over A.

The substitution functor QPα : [p ↓ A, q ↓ A] → [p ↓ B, q ↓ B] over α : B → A is defined as follows. Let tT : p ↓ A → q ↓ A be cartesian over S/A and take (X, pX → A) to (tT_{0}(X, pX → A), pX → A). Then we define QPαtT : p ↓ B → q ↓ B by letting its value at (X, pX → B) be (tT_{0}(X, pX → B → A), pX → B), and likewise by the same postcomposition in the case or morphisms. Replacing tT_{0} by θ gives the prescription for natural transformations.

+§4.3.11 Now we aim to show that this is indeed the exponential. We must show a (natural) equivalence between cartesian functors P ×_{S} R → Q and R → Q^{P} over S. Curiously this seems to have more to do with the lax pullback P ×_{S} R than the strict or pseudo one which is directly given, and the reader is advised to keep the adjunction from proposition 4.2.12a in mind.

The first part of the equivalence takes

[figure: R; tT; Q^{P}; r; q^{p}; S; to; P ×_{S} R; ◁; P ×_{S} R; tT′; Q; p = r; q; S]

Suppose for Z ∈ R over A, tT Z : p ↓ A → q ↓ A takes (X, α : pX → A) to (tT_{0}(X, Z, α), α). Then we define tT′(X, Z, α : pX → rZ) = tT_{0}(X, Z, α). It’s a bit more complicated on morphisms:

[figure: X; f; Y; pX; pf; pY; tT_{0}(X, Z, α); ≅ tT_{0}(X, W, (α; ru))]

such that  goes to

[figure: Z; u; W; rZ; α; ru; rW; β; tT_{0}(Y, W, β); tT_{0}(f, W)]

The effect of the correspondence on the natural transformation θ : tT → tU at (X, Z, α) is just θZ(X, α).

The foregoing construction does not depend on choices of cartesian liftings; naturally its inverse does. We have to take

[figure: P ×_{S} R; \overline{\overline{▷}}; P ×_{S} R; tT′; Q; p = r; q; S; to; R; tT; Q^{P}; r; q^{p}; S]

We must define tT on objects, vertical morphisms and horizontal morphisms. On the object Z of R over A we define tT Z : p ↓ A → p ↓ A by tT Z(X, α) = (tT′(X, RαZ), α) and tT Z(f) = tT (f, h) where f : (X, α) → (Y, β) and

[figure: RαZ; h; RβZ; Z; is the cartesian lifting of; pX; pf; pY; α; β; A]

On the vertical morphism u : Z → W over A = rZ = rW we have to define a natural transformation tT u : tT Z → tT W. The value of this at (X, α) is just tT (X, Rαu). On the horizontal morphism RαZ → Z over α : B → A we have essentially only to observe that the square

[figure: p ↓ B; tT (RαZ); q ↓ B; p ↓ A; tT Z; q ↓ A]

commutes up to isomorphism. On natural transformations θ : tT → tU we have to define the effect at the object Z of R over A; this is a natural transformation θ_{Z} : tT Z → tUZ defined at (X, α) by θ_{(X,RαZ)}.

Proposition Q^{P} as defined above is the exponential in the fibre of Cat/_{fib} over S.

Proof We observe equivalence and naturality by the form of the above construction. □

§4.3.12 As a by-product of this construction we can assign to any fibration p : P → S an associated split fibration p′ : P′ → S, which is the fibred category of (cartesian) functors from 1 : S → S to p : P → S. There is a cartesian functor P′ → P which is full and faithful; with Choice it is essentially surjective on objects. A splitting for p is precisely a choice of preinverse.

4.4 The Adjoint Functor Theorem and Toposes

§4.4.1 This section is a slight diversion from the theme of the use of indexed category theory for the semantics of polymorphism. Its purpose is to illustrate the way in which the formulation of the adjoint functor theorems for indexed categories leads naturally to the notion of an elementary topos. No detailed proofs will be given. This is in turn related via the notion of bounded morphism to Grothendieck toposes, which we introduced in §3.3 to classify geometric theories.

§4.4.2 The adjoint functor theorem for posets (complete lattices) is a triviality which is subsumed in the confusion of terminology between “supremum” and “least upper bound”, for we construct the former precisely as the latter. More generally, a monotone function f : X → Y between complete lattices has a left adjoint iff it preserves infs. The corresponding result for categories, if it is to exist at all, is necessarily more complicated, since we cannot ask for all limits because of Freyd’s paradox (proposition 1.5.8).

Let p : P → S and q : Q → S be fibred categories and tT : P → Q a cartesian functor. Let us assume that P is locally small (§4.3.8) and complete (§4.1.7), and that F preserves limits in the sense of commuting with Π functors (proposition 4.2.9). We aim to formulate and prove the General Adjoint Functor Theorem (see Mac Lane [1971] theorem 5.6.2) for these data.

For each object Y ∈ QA we want to construct an initial object for the arrow category (Y ↓ F). We make this into a fibred category over S/A in the manner of lemma 4.2.14. The fibre over α : B → A has objects the diagrams

QαY  \overline{}Y

F X

B  \overline{α} A

for X ∈ PB.

Lemma (Y ↓ F) is complete. (cf. proposition 4.4.10a) □

An initial object for (Y ↓ F) assigns to each α : B → A an initial object X = G_{α}Y such that G_{α}Y → G_{1}Y is cartesian. G = G_{1} is then the required left adjoint.

[figure: QαY; Y; 1; F X; B; α; A; QβY; Y; 2; F X′; C; β; A; PγX; X; 3; X′; C; γ; B]

[figure: QβY; QαY; Y]

[figure: Qγ(F X); ≅; F (PγX); F X]

4

F X′

[figure: C; γ; B; α; A]

Figure 4.4.4: The solution set condition

§4.4.3 The point of the General Adjoint Functor theorem is to formulate some condition which manufactures this initial object (a colimit) from the available limits, analogously to finding the least upper bound as the intersection of all upper bounds.

Given a fibred category C → S, we say C is initially small if there’s some X ∈ C such that for any Y ∈ C there’s a “family” of maps from X to Y, i.e. a diagram of the form

[figure: •; X; •; Y]

in which the horizontal maps are cartesian.

Lemma If C is complete, locally small and initially small then it has an initial object. □

§4.4.4 This enables us to formulate the General Adjoint Functor Theorem.

Theorem Let F : P → Q be a cartesian functor between locally small fibred categories such that C has and F preserves indexed limits. Then F has a left adjoint G iff for every Y ∈ QA there’s a diagram (1) such that for any similar diagram (2) there’s some diagram (3) such that (4) commutes. □

This is the indexed form of the solution set condition.

§4.4.5 Though the general adjoint functor theorem is “iff”, it is rarely of practical value. A more useful result is obtained by making the category look concrete; though the additional conditions quite commonly hold, they do not always: the category Loc of locales and continuous maps is not, for instance, well-powered (see Johnstone [1983] §2.2.11). The ideas are also, unfortunately, inapplicable to domain theory.

In an ordinary category C, a subobject of an object X is an isomorphism class of monos into X in C/X. We say that C is well-powered if every object has a set of subobjects.

In a fibred category p : P → S we have to test being mono against a family of maps. So i : X → Y in PA is vertically mono if Pαi is mono in the (ordinary) category PB for any α : B → A. Equivalently i is mono in the display P with respect to any pair of maps over the same base map. An arbitrary map i : X → Y over α : B → A in P is vertically mono if its vertical part X → PαY is.

To formulate well-poweredness we need a notation for the set (S-object) of vertical monos into X over A. This is a display map Mono_{A}(X) → A in S. Over this lies the generic mono U → X, which is to be vertically mono and such that any other vertical mono V → X over α : B → A is obtained by substitution over some B → Mono_{A}(X). We say C is weakly or exactly well-powered according as we have saturation (mere existence of such a substitution) or universality (unique existence); in the latter case we write Sub_{A}(X) for Mono_{A}(X).

§4.4.6 When is cod : S^{2} → S (exactly) well-powered? If so, then for every X ∈ S we have an object P X and a subobject (∈_{X}) ⊂ X × P X such that for any subobject U ⊂ X × A there’s a (unique) ⌜U⌝ : A → P X making

[figure: U; (∈_{X}); X × A; 1_{X} × ⌜U⌝; X × P X]

a pullback.

Definition An elementary topos is an exactly well-powered category S with finite limits. □

Proposition Let S be a topos.

(a) If A ∈ S then S/A is also a topos.

(b) S is cartesian closed.

(c) S is locally cartesian closed.

(d) S has finite colimits which are stable under pullback; in particular a strict initial object and disjoint coproducts.

Proof (sketches)

[a] This involves coding the inclusion relation between subobjects.

[b] We code the function f : X → Y by its graph (1_{X}, f) : X ⊂ X × Y and hence the corresponding subobject of X × Y.

[c] follows from (a) and (b)

[d] This was the first result in the huge range of technology for elementary toposes. It can be done within a suitable powerset, since the singleton map may be shown to be mono and the powerset is an internally complete lattice. □

§4.4.7 A more commonly seen definition of an elementary topos involves the subobject classifier, Ω, which is the powerset of 1 in the terminology of the previous section. This has a global element true : 1 → Ω with the property that any mono U ⊂ X is obtained as the pullback along a unique ⌜U⌝ : X → Ω.

Example Set is a topos in which Ω = {true, false}; the function X → Ω is the characteristic function of the subset U, which takes the value true on U and false outside. □

The powerset P X of an arbitrary object X is then Ω^{X}.

Proposition A lex category S is a topos iff it is cartesian closed and has a subobject classifier. □

Warning We need equalisers as well as products!

Corollary If S is a topos, the fibration cod : S^{2} → S is complete, cocomplete, locally small, well-powered and co-well-powered. Proof For the last part, the quotients of an object X correspond to those subobjects of X × X which are equivalence relations (this is another “exactness” property of toposes). □

§4.4.8 Some examples of elementary toposes

Proposition Any Grothendieck topos, and hence any category of sheaves on a space or site, is an elementary topos. Proof See Johnstone [1977], proposition 1.12. □

Example Elementary but not Grothendieck toposes.

(a) The category Set_{f} of finite sets.

(b) The Effective Topos [Hyland 1982]. □

§4.4.9 To return to the adjoint functor theorem, we need the indexed form of a cogenerator (see §1.2.10 and §2.3.2). This is an object G ∈ PA such that given any pair of maps f, g : X ⇉ Y over the same C → B such that for any h : Y → G we have f ; h = g ; h then already f = g.

Lemma Let C → S be a complete, locally small, well-powered category with a cogenerator; then C has an initial object. □

Theorem (Special Adjoint Functor Theorem) Let F : P → Q be a cartesian functor between locally small fibred categories such that P has and F preserves indexed limits. Suppose P is well-powered and has a cogenerator. Then F has a left adjoint. □

§4.4.10 Returning to toposes, suppose we have a functor tT : E → S; what properties on tT do we need in order to get a well-behaved relationship between fibred categories over E and S?

From proposition 4.2.13, we have a 2-functor tT^{∗} taking S-categories to E-categories by pullback.

Proposition Let tT : E → S be a functor between lex categories.

(a) If tT preserves pullbacks and P → S has indexed (co)-products then so does tT^{∗}P.

(b) If tT^{∗}(S^{2}) has indexed coproducts then tT preserves pullbacks.

(c) If tT has a right adjoint then tT^{∗} preserves local smallness.

(d) If S is locally cartesian closed then tT^{∗}(S^{2}) is locally small iff tT has a right adjoint.

(e) If tT has a right adjoint the tT^{∗} preserves exact well-poweredness.

(f) If tT preserves 1 and has a right adjoint R then R extends to a cartesian functor (S ↓ tT) → E^{2} over S^{2}. □

Definition A geometric morphism f : S → E between toposes is a pair of functors f^{∗} : E → S and f_{∗} : S → E such that f_{∗} is right adjoint to f^{∗} and the latter preserves finite limits.

Examples

(a) Let f : X → Y be a continuous map between (sober) spaces. Then f gives rise to a geometric morphism f : Shv(X) → Shv(Y). Moreover there is an equivalence between the poset of lemma 2.1.5e and the category of geometric morphisms.

(b) Let M be a model of a geometric theory T in a topos E. Then there is a geometric morphism ⌜M⌝ : E → Set[T] with ⌜M⌝^{∗}T ≅ M. Indeed there is an equivalence as in §3.3.9.

(c) Let S be a topos and α : B → A in S. Then pullback α^{∗} : S/A → S/B preserves pullbacks but not 1 and has a right adjoint.

In fact any functor which preserves pullbacks and has a right adjoint factors as the inverse image f^{∗} of a geometric morphism and a functor of this form.

§4.4.11 What is the relationship between Grothendieck and elementary toposes? Given any Grothendieck topos E, we have a geometric morphism E → Set, since Set is the (pseudo) terminal object in the category of Grothendieck toposes; for sheaves on a space X this corresponds to the terminal projection X → 1.

A geometric morphism f : E → S is bounded if E has an object of generators over S.

Theorem (Giraud, Mitchell & Diaconescu) An elementary topos E is Grothendieck iff it has a bounded geometric morphism to Set. □

+§4.4.12

Question Is a weakly well-powered, locally cartesian closed category necessarily a topos?

We have an Ω which is a “saturated” but not “universal” mono. There is an S-indexed Heyting prealgebra of monos into (rather than subobjects of) each object, which has S-indexed meets. Moreover pullback preserves this structure. It may be possible to apply the adjoint functor theorem internally to construct joins and show that they are preserved. This would give a tripos, but in fact we only really need stable effective image factorisations to construct the “real” (i.e. universal) Ω.

Answer Martin Hyland has pointed out that the ¬¬-separated objects of the Effective Topos provide a counterexample.

Polymorphism in Domains

5.1 Indexed Category of Retracts

+§5.1.1 In this final chapter we shall bring together our studies of Domain Theory and Polymorphism, making use of the Indexed Category Theory of the previous chapter. The first half of the chapter is devoted to Indexed Domain Theory, which we find to be a very pleasing structure. The second half discusses the notion of a “type-of-types” in the context of indexed category theory and attempts to construct such a device for domains, although we find that what can be achieved is rather disappointing.

We motivate our definitions by recourse to the category of retracts of a combinatory algebra; recall that one of the objectives of Chapter II was to show that we may as well assume any category of domains to be of this form. We begin with a very natural definition of an indexed family of retracts and develop the indexed version of the theory of §1.3.3-6. Then we show that global sums and products may be constructed, and hence follow the “display” idea of §4.1.3 to define display maps; we show that indexed sums and products exist relative to these.

The purpose of studying the retract case is that it very naturally motivates a definition for domains. This definition seems to have rather a lot of clauses, so we spend the second section attempting to drop them. Having thereby shown that the variants yield a much inferior theory, we show in the third section that the correspondence between indexed and fibred holds nicely for various categories of domains and in the fourth that we have indexed products. This completes the indexed version of standard domain theory.

In §5.5 we examine the notion of a type of types in an indexed category, showing in particular that we cannot have this together with both equality and function-spaces. Dropping the requirement for equalisers (which we have needed to do anyway in domain theory) we introduce a provisional definition of a “typos” and show that the familiar closure model (§1.4.8) provides a nontrivial example.

In §5.6 we construct a “type-of-types” according to this definition for some categories of domains (specifically ContLat_{ω} and bcCont_{ω}, but it would probably be possible to do it for others). We can tie this in with §5.1 by showing that we may choose a λ-model in such a way that any fibred type (quâ domain) occurs as a display (quâ retract). This completes the motivation from the retract to the domain case. Pushing this a little further allows us to code up G → V as a single combinator V ∈ Λ.

We are then in a position to interpret polymorphism in domain theory. Unfortunately we find that ∀X.X → X does not have its expected value of 2, and that such failure is inevitable in classical poset domain theory. We conclude with a few speculations as to how some of these problems may be resolved.

+§5.1.2 Since a type is an idempotent element, an indexed or parametric type is a function or program which always returns idempotent values. Thus an A-indexed type is a function X : A → Idem(Λ), where Idem(Λ) is the subset of Λ consisting of the idempotent elements. We force X to have domain A by imposing the equation X = PAX.

Now Ershov showed [Hosono and Sato 1977] that Idem(P ω) is a complete lattice but not continuous, and so it is not a type (object of Retr(P ω) ≃ ContLat_{ω}). But this does not matter, because we do not need a type-of-types to formulate this notion. We only need X : A → Λ to satisfy

∀a ∈ ∥A∥ Xa = P(Xa)(Xa)

The left-hand side of this equation is λu.Xa(Xau). It is convenient to introduce a variant on P to deal with this form (and the corresponding one for indexed functions):

Q = λfgau.ga(fau)

so that our equation becomes X = QXX as functions of a variable a : A. These two equations are formally equivalent if Λ is a model (has enough points), but in any case we really want the latter because we had intentional rather than extensional equality in mind anyway.

Hence an A-indexed type is an element X ∈ Λ satisfying

X = PAX = QXX

By a similar argument, an A-indexed function from Y to X is an f ∈ Λ such that f = PAf = QY f = QfX. We then have a cartesian closed category with fixpoints, which we shall call PA.

+§5.1.3 PA has terminal object U = K(K⊥), and this also represents the terminal projection X → U. As before we may consider (A-indexed) elements: x ∈_{A} X is a function x : A → Λ such that xa ∈ Xa for each a ∈ A; the type of all such indexed elements of X is the (global) product, ∏_{A} X = λua.Xa(u(Aa)) (see below).

The product X ×_{A} Y of X and Y over A is given by λaz.⟨Xaz_{0}, Y az_{1}⟩; the projection maps are π_{0} = λaz.Xaz_{0} and π_{1} = λaz.Y az_{1}, and if f : Z → X, g : Z → Y are two maps in PA then the pair is ⟨f, g⟩ = λaz.⟨faz, gaz⟩ : Z → X ×_{A} Y.

We have fibred exponential types.

Y_{A}^{X} = λaf.P(Xa)(P(fa)(Y a))
= λaf.Q(QY f)Za
= λaf.QY (QfZ)a
= λafx.Y a(fa(Xax))

This is obtained by an interchange of variables from the reduction of f to a solution of f = PAf = QXf = QfY; the latter is a “global section” of the former. The evaluation map ev : Y_{A}^{X} ×_{A}X → Y is given by λau.Y a(u_{0}(Xau_{1})) and the transpose identifies f : W ×_{A} X → Y with g : W → Y_{A}^{X} by g = λawx.fa⟨w, x⟩ and f = λau.gau_{0}u_{1}.

+§5.1.4 Now let α : B → A be any map in the base category Retr(Λ); what is the corresponding substitution functor Pα : PB → PA, and does it have adjoints? The first question has an easy answer, which gives a pleasing consonance of notation: Pα = Pα. In the same way as the naïve indexing of Set over itself performed substitution by composition, so does this.

Thus PαX is simply PαX and Pαf = Pαf; moreover PαU = U, Pα(X ×_{A} Y) = (PαX) ×_{B} (PαY) and Pα(Y_{A}^{X}) = (PαY)_{B}^{(PαX)} exactly. The product projections, pairings, evaluation maps and transposes are also preserved exactly. Because of this notational coincidence (which I hope justifies the switch of variables in the combinator P to the even the most uncompromising users of left-handed notation), PA and Pα will in future be written PA and Pα respectively.

+§5.1.5 We have to show that (some of) the substitution functors have adjoints. In fact those that do are called display maps, and these arise from global sums. Therefore we first construct global sums, then identify the display maps and finally construct the indexed sums and products.

Let Y ∈ PB be a B-indexed family of retracts; write ∏_{B} Y and ∑_{B} Y for their global product and sum (coproduct), which are objects of C, the base category. [Later we shall construct ΠαY and ΣαY, the adjoints to substitution over α : B → A; these give objects of the fibre over A.]

Let B ∈ C and Y ∈ PB. The basic idea of ∏_{B} Y is the set

{u : B → Λ : ∀b.ub ∈ Y b}

As with indexed families of objects we can code this set up using combinators. To say that u is a function from B we just need u = PBu as before. Again as before the condition ub ∈ Y b can be written as ub = Y b(ub). In this we spot a rare natural occurrence of the S combinator, and again replace ∀ by λ. Hence ∏_{B} Y is the set of solutions of

u = PBu = SY u

These are commuting idempotents (given that B = PBB and Y = PBY = QY Y), so their composite gives the required type.

Likewise ∑_{B} Y is based on

{⟨b, y⟩ : b ∈ B ∧ yb ∈ Y b}

which is the set of solutions of

u = ⟨Bu_{0}, Y u_{0}u_{1}⟩

+§5.1.6 We may now define a display map in Retr(Λ) to be (the composite of an invertible followed by) a map of the form π_{0} : ∑_{A} Y → A where Y ∈ PA. π_{0} is in fact λu.Bu_{0}.

We shall take as read a number of trivial properties of pullbacks, including the fact that this definition allows invertibles to be “passed through” display maps.

Lemma (a) The pullback of a display map exists and is a display map. Proof Let α : B → A in C and X ∈ PA. Put Y = PαX; then the following is a pullback square:

[figure: ∑_{B} Y = λv.⟨Bv_{0}, Y v_{0}v_{1}⟩; λv.⟨αv_{0}, Y v_{0}v_{1}⟩; λu.⟨Au_{0}, Xu_{0}u_{1}⟩ = ∑_{A} X; B; π_{0}; α; A; π_{0}]

Given any other β : C → B and γ : C → ∑_{A} X making the square commute, the pair is λc.⟨βc, (γc)_{1}⟩. □

Lemma (b) Any terminal projection is a display map. Proof Given B → T, put X = KB and A = T. Then X ∈ PA and ∑_{A} X = λp.⟨⊥, Bp_{1}⟩ ≅ B. □

+§5.1.7 We have already seen that an indexed category has indexed sums so long as it has a class of display maps, i.e. closed under composition.

Proposition

(a) A composite of display maps is a display map.

(b) Substitution over a display map has a left adjoint. Proof

[a] Given X ∈ PA and Y ∈ PB where B = ∑_{A} X we want to construct Z ∈ PA with ∑_{B} Y ≅ ∑_{A} Z over A. Put Z = λau.⟨Xau_{0}, Y ⟨a, u_{0}⟩u_{1}⟩; then i : ∑_{A} Z → ∑_{B} Y and j : ∑_{B} Y → ∑_{A} Z are mutually inverse where

i = λz.⟨⟨Az_{0}, Xz_{0}z_{10}⟩, Y ⟨z_{0}, z_{10}⟩z_{11}⟩
j = λy.⟨Ay_{00}, ⟨Xy_{00}y_{01}, Y y_{0}y_{1}⟩⟩.

[b] ΣαY = Z. Indeed Σα = λY au.⟨Xau_{0}, Y ⟨Aa, Xau_{0}⟩u_{1}⟩. The adjunctive correspondence between f : ΣαY → V and g : Y → PαV is given by fau = gby where V ∈ PA, αb = a ∈ A, b ∈ Xa ⊂ B, y ∈ Y b and u = ⟨b, y⟩. The unit η : Y → Pα(ΣαY) and counit ϵ : Σα(PαV) → U are given by reducing λby.⟨b, y⟩ and λau.u_{1} to appropriate types. □

We have presented Σα as a combinator. In some sense Σ is also a combinator (as we have pretended by our notation), but its expression involves X, the indexed family corresponding to the display α, rather than α itself. This is because Σα only exists when α is a display map (as is easily deduced from the above proof), and in this highly constructive world we need a concrete proof of every necessary fact, which proof is supplied by the X corresponding to α.

Question Is there a combinatorial (in the sense of the definition of X as an A-indexed type) description of display maps, and hence of Σ?

+§5.1.8

Proposition Pullback against a display map, considered as a functor between relative slices, has a right adjoint. Proof Given X ∈ PA, B = ΣX, α : B → A, Y ∈ PB and a ∈ A we want ΠαY a to be the set of maps from Xa to Y over B. We have Πα = λY av.S(PBY)[P(Xa)v] The adjunctive correspondence between f : PαU → Y and g : U → ΠαY for U ∈ PA is given by fbu = gaub ∈ Y b, where αb = a ∈ A, b ∈ Xa ⊂ B and u ∈ Ua. The unit η : U → Πα(PαU) ≅ U_{A}^{X} and counit ϵ : Pα(ΠαY) → B are given by reducing λaub.u and λbv.vb to appropriate types. □

+§5.1.9 Now we shall look at the effect of the foregoing construction in the case where Λ is an unspecified poset model of the λ-calculus. We deliberately avoid being precise about which model we are using or which maps arise: the purpose of this discussion is to motivate what we may do in the category of domains. We began with the assumption that we represent a type which is the result of a computation by a function into the universe Λ taking type (i.e. idempotent) values. Now we examine the effect of that in the category, i.e. to what the order relation and directed sups correspond.

Lemma Let A, B ∈ Retr(Λ) where Λ is an β-model in IPO. Suppose A ≤ B as elements of Λ. Then

(a) A; B, B ; A, A; B ; A and B ; A; B are also idempotents in Λ, with the order indicated in the figure.

(b) there is an adjunction between A and B whose image in A is the closure A; B ; A and in B the coclosure B ; A; B, these being isomorphic objects of Retr(Λ).

(c) if A and B commute then the diamond collapses.

B  B

B ; A; B
[figure]
A; B  B ; A
[figure]
A; B ; A

A  A \begin{aligned}A; B &  \\ & ⊣ \begin{matrix}B ; A \\  \end{matrix} \end{aligned}
(a)  (b)

Figure 5.1.9: Order on idempotents in a domain λ-model

(d) if they are both coclosures then A = B ; A; B is a coclosure of B

(e) if they are both closures then B = A; B ; A is a closure of A. Proof

[a] A ; B = A ; A ; A ; B ≤ A ; B ; A ; B ≤ A ; B ; B ; B = A ; B, so (A ; B)^{2} = A ; B. Also A = A^{3} ≤ A; B ; A ≤ A; B^{2} = A; B = A^{2} ; B ≤ B ; A; B ≤ B^{3} = B. Similarly with B ; A.

[b] (A; B) ; (B ; A) = A; B ; A ≥ A = 1_{A} and similarly the other way.

[c-e] obvious. □

Question Suppose F : Λ → Λ preserves idempotence. Does it then preserve the above diagram?

+§5.1.10 An A-indexed domain therefore gives rise to a functor X : A → (C^{hm})^{op}, where C^{hm} is the category of domains and continuous functions with left adjoint. We saw from the algebraic and logical examples of indexed categories that the morphisms of the category which arises here are the homomorphisms of the structure. This gives one motivation of the definition of a homomorphism of domains as a continuous function with left adjoint; a surjective homomorphism is known as a projection and its left adjoint an embedding. Since the left adjoint to a homomorphism arises in this way from an instance of the order relation, we call it a comparison and write (C^{hm})^{op} = C^{cp}.

Lemma

(a) Let f : X → Y in IPO^{hm}. Then there is a coclosure u on X and a closure v on Y with isomorphic images, such that f factorises as the projection u : X → I followed by an isomorphism followed by the inclusion (injective homomorphism, not embedding) v : I ↪ Y.

(b) Let c be a coclosure on an object X ∈ C ≃ Retr(Λ). Then there are retracts s ≤ r in Λ such that ∥r∥ ≅ X and s ≤ r gives rise to the coclosure c.

(c) Likewise for a closure, r ≤ s. Proof

[a] Let g ⊣ f and put u = f ; g ≤ 1_{X}, v = g ; f ≥ 1_{Y}. Then f = f ; g ; f = f ; v = u; f.

[b] Choose r arbitrarily with ∥r∥ ≅ X, and put s = r; c; r, i.e. the extension of c from X to Λ. Then s ≤ r and c = s ↾ X as required.

[c] Likewise. □

This lemma shows that we cannot restrict the category C^{cp} (i.e. the codomain of the functor A → C^{cp} which arises from an indexed domain) further, at least so long as we insist that it contain all isomorphisms from C. Of course if we restrict attention in advance to either closures or coclosures of a saturated domain (as is commonly done), we obtain a corresponding restriction on the category of comparisons which arise. However I believe I have seen no argument justifying such a restriction, apart from the observation that many authors seem unaware that the theory about embedding-projection pairs (vis à vis exponentials, recursive domain equations, etc.) generalises to homomorphisms which are not necessarily onto.

It is unlikely that every homomorphism will actually arise from an instance of the order relation in an arbitrary domain model: it may not be possible to choose appropriate representing idempotents for the given domains. However it is in fact possible to build a new model with the same (up to equivalence) category of retracts in which every homomorphism does occur.

+§5.1.11 We have only considered the order relation on Λ and deduced that we have a functor X : A → C^{cp}. However X : A → Idem(Λ) is continuous (preserves directed sup) and so we have to see the effect of that.

Lemma Let Λ be a domain model and {A_{i} ∈ Λ : i ∈ I} a directed set of idempotents. Then A = ⋁ ; A_{i} is idempotent and is the bilimit of the A_{i} with comparisons given in the manner shown before. Proof A is idempotent by continuity of composition. We have coclosures A → A_{i} → A given by A; A_{i} ; A, and the directed sup of these is clearly A^{3} = A = 1_{A}. □

Note This argument only shows A ↪ bilim A_{i}; a full proof will be found in Homomorphisms, Bilimits and Saturated Domains.

+§5.1.12 We have now justified the definition of a continuous type-dependence or indexed domain as a Scott-continuous functor into C^{cp}, the category of domains and comparisons.

Examples

(a) Idem(Λ) → Retr(Λ), where Idem(Λ) ⊂ Λ is the poset (not category) of idempotents (although this is not necessarily a domain).

(b) ↓ : A → bcCont for A ∈ bcCont (the homomorphisms are of the form − ⋏ a).

(c) ↑ : A → ContLat for A ∈ ContLat (the comparisons being − ⋎ a).

(d) Φ : (C^{cp})^{n} → C^{cp} where Φ(X_{1}, ..., X_{n}) is any expression in type variables X_{1}, X_{2}, ..., X_{n} and constructors ×, →, etc. Again (C^{cp})^{n} is not a domain.

+§5.1.13 As a footnote to this motivation, consider an indexed domain as a “domain about which we have partial information”. Thus at a particular value a ∈ A of the parameter we know x_{a} ∈ X_{a} about the data. If we have obtained a by improvement from b with α : b ≤ a, then we take with this at least a certain degree of knowledge, say Σαx_{b} about x. Conversely if we discard information, reducing from a to b, then we can know at most Pαx_{a}. Performing these two processes, which as usual we assume to be continuous, we deduce x_{b} ≤ Pα(Σαx_{b}) and Σα(Pαx_{a}) ≤ x_{a}. Hence Σα ⊣ Pα. Further, if we can approximate a as ⋁ ; a_{i}, then we should be able to recover x_{a} as ⋁ ; Σα_{i}(Pα_{i}x_{a}). Hence P : A → C^{cp}.

Since we have adjoints to substitution in an indexed category, it is natural to ask whether we should require the Beck condition to hold. The answer to the appears to be “no”: we carry through the theory without it, getting arbitrary (i.e. non-Beck) indexations, and it just seems that there are some circumstances (viz. logic) where we need the Beck conditions and others (both here and in examples in Universal Algebra) where we dont.

In what follows we have tended to use P for indexations and Σ for their left adjoints, despite the fact that the use of this letter misleadingly suggests the Beck condition and logic. This is undoubtedly a mistake, and a revision of this notation would be appropriate. Where the indexation has another name, say X or even ΠαY, we still use Σ, but subscripted appropriately, e.g. Σ_{X} and Σ_{ΠαY}.

5.2 Indexed Categories of Domains

+§5.2.1 The previous section culminated in the definition of a continuous type-dependence as a continuous functor from a domain to the category of domains and comparisons. We shall see that for each of the many categories of domains which we introduced in Chapter IV (large or small, continuous or algebraic and — more strikingly — bifinite or any category of boundedly-complete posets) the theory is very rich and beautiful.

Specifically,

(a) there is a direct correspondence between indexations P : A → C^{cp} and fibrations p : X → A, i.e. X ∈ C iff A ∈ C and ∀a ∈ A.Pa ∈ C.

(b) this class of display maps yields a relatively cartesian closed category, i.e. we have domainindexed sums and products of domains (even in the small case).

(c) we have an indexed form of domain theory, i.e. indexed bilimits and fixpoints.

On the face of it, however, the conditions of the definition appear to be very strong, and (in comparison with the theory for categories) it may appear that we have not motivated either of the requirements that the substitution maps have left adjoints or that the functor be continuous (i.e. send directed sups to bilimits). It is therefore appropriate to consider weakened forms of the definition, both from the indexed and the fibred points of view; we find that the theory fails to be at all satisfactory.

+§5.2.2 The most obvious candidate for a class of display maps for IPO is the projections, as strongly hinted by Lemma 2.1.8. However, contrary to the claims of [Taylor 1986], they do not give a class of displays for bcCont.

Examples Pullback may destroy top or bounded completeness, as in the figure.

The fallacy in the alleged proof of the first proposition on page 463 of [Taylor 1986] lies in the last line, where it is claimed that we may pull back an idempotent on W to one on W ×_{A^{⊤}} B^{⊤}.

+§5.2.3 When we spoke of the “fibred” form of a continuous type-dependence in the previous paragraph, we meant the fibration constructed from the indexation in the manner of Chapter IV, where as usual we regard a domain as a poset and hence as a category.

In most cases when studying posets we have no need to give a name to the (unique) instance of the comparison between any two elements, and for this reason lattice theory tends to be substantially simpler than category theory. However in our case we have to regard the base object A as a category and give names to the comparisons in it in order to name the substitution functors which arise. In order to avoid repetitious data, we shall adopt the convention that a, a′, a_{i} and b

[figure: (a); (b)]

Figure 5.2.2: Pullback may destroy top or bounded completeness

[figure: (a); (b)]

Figure 5.2.3: Projections and fibrations

are elements of A, and that α : b ≤ a, α_{ij} : a_{i} ≤ a_{j}, α_{i} : a_{i} ≤ a are instances of the comparison. Because we are forced to use the general notation from the start, much of the theory carries over immediately to categories rather than posets.

Lemma Let p : X → A be a fibration in which each fibre is inhabited. Then

(a) p has a left adjoint iff each fibre has an initial object (least element, ⊥_{a}), and this is a ↦ ⊥_{a}.

(b) (Ignoring questions of choice) the substitution functors have left adjoints iff p : X^{op} → A^{op} is also a fibration.

Proof

[a,⇒] Let i ⊣ p and ⊥_{a} = ia for a ∈ A; since p is surjective, ⊥_{a} ∈ Pa. Then f : ⊥_{a} → X correspond bijectively to pf : a → px and in particular there is a unique f : ⊥_{a} → X over 1_{Pa}.

[a,⇐] Put ia = ⊥_{a}. Then for β : a → b, x ∈ Pb, by definition of ⊥_{a} there’s a unique map ⊥_{a} → Pβx. Hence ia → x correspond bijectively to β : a → b = px.

[b] This is proposition 4.1.12. □

If, however, any fibre is empty or fails to have bottom, a fibration will not be a projection. Conversely the coclosure on the four-point lattice which fixes top and bottom gives a projection which is not a fibration.

[figure: (a); (b)]

Figure 5.2.4: Continuous fibration counterexamples

+§5.2.4 For technical reasons within the constructions, it is worthwhile introducing a weakened form of the definition in which we drop the requirement for adjoints to substitution.

Definition A continuous indexation of domains is a functor P : A → IPO^{op} which takes directed sups to cofiltered limits. Thus for any directed set (a_{i} : i ∈ I) ⊂ A, say with a = ⋁ ; a_{i}, we have a cofiltered diagram Pα_{ij} : Pa_{i} → Pa_{j} and a limiting cone Pα_{i} : Pa → Pa_{j}. Hence elements of Pa are given by compatible families, (x_{i} ∈ Pa_{i} : i ∈ I), where x_{j} = Pα_{ij}x_{i}.

Definition A continuous fibration of domains is a map p : X → A in IPO such that

(i) p is a fibration in the sense of Chapter IV,

(ii) each fibre has a least element (equivalently by lemma 5.2.3a, p is a projection in IPO),

(iii) the substitution maps Pα are continuous,

(iv) given px = a = ⋁ ; a_{i}, then x = ⋁ ; Pα_{i}x, where α_{i} : a_{i} ≤ a,

and

(v) given a compatible family x_{i} ∈ Pa_{i} (for the substitution maps) over a = ⋁ ; a_{i}, then x_{i} =

Pα_{i}(⋁ ; x_{j}).

If also

(vi) p : X^{op} → A^{op} is a fibration

then we say p is a fibred type.

For fibred domain theory the first three conditions are obviously natural. (iv) and (v) express in detail the continuity of the indexation, i.e. that directed sups go to cofiltered limits, and one might question them. However these conditions are used very frequently in the constructions which follow, and occur in much the same rôle as continuity of substitution. Questions of the usefulness of domain theory without continuity I shall leave to the reader’s imagination.

Examples

(a) Given a discontinuous functor A → IPO^{op}, the corresponding fibration X → A need not have X ∈ IPO.

(b) A composite of fibrations between ipos with continuous substitutions need not have continuous substitutions.

+§5.2.5 In the theory which follows, we shall make heavy use of the correspondence between the indexed and fibred presentations, so in particular we have to show that the definitions of the previous paragraph are equivalent. First we construct fibrations from indexations.

Lemma Let A ∈ IPO and P : A → IPO^{op} be a continuous indexation (sending directed sup to cofiltered limit), and p : X → A the corresponding fibration. Then X is an ipo and p a projection. Proof There are no nontrivial parallel pairs of maps in the fibres or horizontally, so X is a poset; p has a left adjoint by lemma 5.2.3a. We have to show that X has and p preserves directed sups.

Let (x_{i} : i ∈ I) ⊂ X be directed with a_{i} = px_{i} and a = ⋁ ; a_{i}. For i ≤ j let α_{ij} : a_{i} ≤ a_{j} and α_{i} : a_{i} ≤ a. By hypothesis the substitution maps over α_{i} form a limiting cone over the cofiltered diagram given by the α_{ij}. For i ≤ j, x_{i} ≤ y_{ij} = Pα_{ij}x_{j} ≤ x_{j}. Hence for each i, {y_{ij} : i ≤ j} is a directed subset of Pa_{i}, so put y_{i} for its sup.

Then

Pα_{ij}y_{j} = Pα_{ij} ⋁ ; (Pα_{jk}x_{k} : j ≤ k)  definition
= ⋁ ; (Pα_{ij}(Pα_{jk}x_{k}) : j ≤ k)  continuity
= ⋁ ; (Pα_{ik}x_{k} : j ≤ k)  functoriality
= ⋁ ; (Pα_{ik}x_{k} : i ≤ k)  cofinality
= y_{i}  definition

so y = (y_{i} : i ∈ I) is a compatible family for the diagram and hence an element of Pa. If ∀i.x_{i} ≤ z ∈ Pb with β_{i} : a_{i} ≤ b and β : a ≤ b then

y_{i} = ⋁ ; {Pα_{ij}x_{j} : i ≤ j} ≤ ⋁ ; {Pα_{ij}(Pβ_{j}z) : i ≤ j} = Pβ_{i}z ≤ z

so y ≤ z. Thus y = ⋁ ; x_{i} ∈ X and py = a. Hence X has an p preserves ⋁ ; . □

Notice that compatible families correspond to directed sups. This result does not require the substitutions to be comparisons, only that directed sups go to cofiltered limits.

Proposition Proposition 4.2.4 specialises to equivalences between

(a) continuous indexations and continuous fibrations of ipos

(b) continuous type-dependences and fibred types. Proof

[a,⇒] By the lemma.

[a,⇐] We have only to check that the fibres are ipos; but these are given by pullback of the fibration (which is a projection) against the corresponding global element (map 1 → A) of the base.

[b] lemma 5.2.3b □

+§5.2.6 We have established the equivalence between the indexed and fibred approaches for continuous indexations and continuous type-dependences of ipos, and as we have already remarked this will be seen to apply to continuous type-dependences of any of the categories of domains which we have studied. However for continuous indexations of categories other than IPO and weaker attempted classes of displays for even IPO, the equivalence breaks down. Curiously, it does so in opposite ways for the cases of bcCont and AlgPos, and in both ways for BiPos_{f}.

Lemma Let P : A → IPO^{op} be a continuous indexation with fibration p : X → A.

[figure: (a); (b)]

(a) If A and each Pa are algebraic then so is X.

(b) If X is boundedly complete then so are A and Pa. Proof

[a] We shall prove essentially this in §5.3.2.

[b] It is easy to show that p preserves mubs. □

Examples

(a) The display of a continuous indexation of boundedly complete posets need not be boundedly complete.

(b) Likewise for bifinite posets (the base is a four-point lattice and only the top fibre is nontrivial).

(c) Conversely a continuous fibration of algebraic posets need not have algebraic fibres. The “odd” point in the infinite fibre is compact neither in the fibre nor in the display, but in the display it is approximated. This of course also shows that AlgPos is not closed under arbitrary cofiltered limits.

(d) Likewise for bifinite posets. In this example the finite points of the display are the points of the finite fibres, and any finite number of fibres yields a mub-closed set; however restricting to the infinite fibre, the two almost-minimal points become finite but have a Cantor set of mubs.

+§5.2.7 Since domain theory, unlike category theory, is infinitary, we still have some groundwork to do before showing that we have classes of display maps even for IPO. First we apply Proposition 4.2.18 about limits of fibrations to the domain case.

Proposition Let p_{i} : X_{i} → A_{i} be a compatible family of (a) projections, (b) fibrations, (c) continuous fibrations or (d) fibred types, for the filtered diagrams X = lim X_{i}, A = lim A_{i}. This means (for b–d) that we ask for the diagram

[figure: X_{j}; f_{ji}; X_{i}; A_{j}; p_{j}; g_{ji}; A_{i}; p_{i}]

[figure: (c)]

Figure 5.2.6: Continuous indexation counterexamples

[figure: Cantor Space]

Figure 5.2.6: (d) to be an indexed functor. Then the mediating map p : X → A is a projection, etc. Proof First, p is continuous.

[a] Let ι_{i} ⊣ p_{i}. For a ∈ A define (ιa)_{i} = ⋁ ; _{i≤j} f_{ji}(ι_{j}a_{j}). We may show that this is a compatible family in the same way as in lemma 5.2.5 and also that ι ⊣ p. However it is crucial to use the fact that (a_{i}) and (x_{i}) are compatible families.

[b] Proposition 4.2.18.

[c] Continuity is preserved because we may interchange limits over P_{i}a_{ij}.

[d] Use lemma 5.2.3b. □

+§5.2.8

Lemma A composite of continuous fibrations is again a continuous fibration. Proof Let P : A → IPO^{op} and Q : B → IPO^{op} be continuous indexations with corresponding fibrations p : B → A and q : C → B respectively, and r = q ; p with corresponding indexation the functor R : A → Cat^{op}; we have to show that each Ra is an ipo that the substitution maps are continuous and that directed sups map to limits.

p, q and r are projections in IPO by proposition 5.2.5a. For a ∈ A, Ra is an ipo because it is r^{−1}(a) ⊂ C; alternatively, as remarked in §4.2.15, it is the fibration of Q ↾ Pa.

Now let α : a′ ≤ a in A; we have to show that Rα : Ra → Ra′ is continuous. This is the cartesian functor (§4.2.6) corresponding to the indexed form Qβ : Qb → Q(Pαb) for b ∈ Pa over a change of base (§4.2.13). To show continuity of Rα, let {c_{i} : i ∈ I} ⊂ Ra be directed, with c_{i} ∈ Qb_{i}. Put c = ⋁ ; c_{i} and b = ⋁ ; b_{i}. Then since Q : B → IPO^{op} is continuous, c ∈ Qb ≅ lim(Qb_{i}). With β_{i} : Pαb_{i} ≤ b_{i}, β : Pαb ≤ b the following diagram commutes:

Q(⋁ ; b_{i}) ≅ lim Qb_{i}  \overline{}Qb_{i}

Q(Pα(⋁ ; b_{i})) ≅ Q(⋁ ; (Pαb_{i})) ≅ lim Q(Pαb_{i}) \begin{aligned}Qβ \\ &  \end{aligned}\overline{}Q(Pαb_{i}) \begin{aligned}Qβ_{i} \\ &  \end{aligned}

(using continuity of Pα). Then Rαc = Qβc = (Qβ_{i}c_{i}) = (Rαc_{i}) so Rα is continuous.

Now we have to show that R : A → IPO^{op} is continuous. Let {a_{i} : i ∈ I} ⊂ A be directed and a = ⋁ ; a_{i}. We have a compatible family of continuous fibrations Ra_{i} → Pa_{i}, so the mediating map lim(Ra_{i}) → lim(Pa_{i}) ≅ Pa is a continuous fibration by proposition 5.2.7c. The fibre of this over b ∈ Pa is lim(Q(Pα_{i}b)) by this construction, and this is isomorphic to Qb since b = ⋁ ; (Pα_{i}b) and Q is continuous; but this is the fibre of Ra over b. □

Proposition The following give classes of display maps for IPO, each class being contained in the previous one:

(a) projections, i.e. continuous surjections with left adjoint,

(b) fibrations (in the categorical sense) which are also projections,

(c) continuous fibrations, and

(d) fibred types. Proof Nesting is obvious. By lemma 4.2.15 a composite of fibrations is a fibration, as is any terminal projection; the latter correspond to type-dependences on 1 and so are fibred types and hence in all four classes.

[figure: (a); (b)]

Figure 5.2.9: Indexed product counterexamples

[a] proposition 2.1.8

[b] the classes of fibrations and of projections are each closed under composition and pullback, and hence so is their intersection.

[c] the lemma gives closure under composition; for pullback we use the equivalence with indexations (proposition 5.2.5a), when pullback becomes precomposition.

[d] the composite of the fibrations p : B^{op} → A^{op} and q : C^{op} → B^{op} is a fibration; for pullback we use proposition 5.2.5b. □

+§5.2.9 There appear still to be three competitors besides the definition given at the end of the previous section for continuous type-dependences (fibred types). However they fail to have indexed products (exponentials);

Examples

(a) Contrary to the claim of [Taylor 1986] and the previous draft of this dissertation, IPO is not cartesian closed relative to projections. In this example, ΠαY does not have ⋁ ; .

(b) A finitary example covers fibrations and continuous fibrations. Writing X over A for the fibration below, X_{A}^{X} is not a fibration. For the unique nontrivial base-morphism has no cartesian lifting at a certain point. This is the point in the upper fibre of X_{A}^{X} which is the identity on the upper fibre of X. The identity on the lower fibre of X and the involution of this fibre interchanging the lower two points provide points of the lower fibre of X_{A}^{X} which are both maximal below the upper identity. □

5.3 Categories of Fibred Types

+§5.3.1 From now on we shall discard all but the chosen definition of fibred types. As remarked, there is a remarkably exact correspondence between the indexed and fibred approaches in this case, and my personal belief is that this is the strongest evidence that we are on the right track. This correspondence has to be proved separately for each of our categories of domains, and we begin with two proofs for BiPos_{f} — I have unfortunately not found the right trick to deal with ContDom. We have to take bilimit expressions for A and Pa and transform them into such expressions for X, and some work is needed to achieve the necessary uniformity in the expressions.

As a notational abbreviation, P : A → C^{cp} is a continuous type-dependence with fibration p : X → A, where C is a category of domains and it is intended that A, X ∈ C (though the object is usually to prove the latter).

+§5.3.2 We shall prove the BiPos_{f} case using finite elements and mub-closed sets. The following lemma classifies finite elements in the fibration.

Lemma x ∈ X is finite iff a = px ∈ A_{fp} and x ∈ (Pa)_{fp}.

Proof

[⇒, A] Suppose a ≤ b = ⋁ ; b_{i} in A, say β_{i} : b_{i} ≤ b, γ : a ≤ b. Put y = Σγx ∈ Pb and y_{i} = Pβ_{i}y ∈ Pb,

so x ≤ y = ⋁ ; y_{i}. But x ∈ X_{fp} so x ≤ y_{i} for some i, so a ≤ b_{i}.

[⇒, Pa] Suppose x ≤ y = ⋁ ; y_{i} with y_{i} ∈ Pa ⊂ X. But x ∈ X_{fp}, so x ≤ y_{i} for some i.

[⇐] Suppose x ≤ y = ⋁ ; y_{i}, y_{i} ∈ Pb_{i}, y ∈ Pb, b = ⋁ ; b_{i}, so a ≤ ⋁ ; b_{i}. But a ∈ A_{fp} so a ≤ b_{i}

for some i. This holds for all later i, so w.l.o.g. ∀i.a ≤ b_{i}. Let γ_{i} : a ≤ b_{i}, γ : a ≤ b. Put

z_{i} = Pγ_{i}y_{i} ∈ Pa, so x ≤ z = ⋁ ; z_{i} = Pγ_{i}y; but x ∈ (Pa)_{fp} so x ≤ z_{i} ≤ y_{i} for some i. □

Proposition X ∈ AlgPos iff A ∈ AlgPos and ∀a ∈ A.Pa ∈ AlgPos.

Proof

[⇒, A] By the lemma, A_{fp} = p(X_{fp}). Let a ∈ A. If x ∈ X_{fp} and x ≤ ⊥_{a} then px ∈ A_{fp} and px ≤ a; moreover a = ⋁ ; (px : x ∈ X_{fp} ∩ ↓ ⊥_{a}) so A is algebraic.

[⇒, Pa] Since AlgPos is closed under bilimits, A is algebraic and P continuous, it suffices to check that Pa ∈ AlgPos for a ∈ A_{fp}. By the lemma, (Pa)_{fp} = Pa ∩ X_{fp}. Let x ∈ Pa. If

y ∈ X_{fp} ∩ ↓ x ∩ Pb with α : b ≤ a then y ≤ Σαy ∈ X_{fp} ∩ ↓ x ∩ Pa, so x = ⋁ ; [(Pa)_{fp} ∩ ↓ x] and

Pa is algebraic.

[⇐] For a ∈ A, a = ⋁ ; A_{fp} ∩ ↓ a, so by continuity Pa ≅ bilim(Pb : b ≤ a ∧ b ∈ A_{fp}). This means that x ∈ Pa ⊂ X is approximated by Pαx ∈ Pb ⊂ X for such α : b ≤ a. These are approximated in turn by the finite elements of Pb (which are also finite in X) below them. □

+§5.3.3

Proposition X ∈ BiPos_{f} iff A ∈ BiPos_{f} and ∀a ∈ A.Pa ∈ BiPos_{f}

Proof We have only to check mub-closed sets.

[⇒, A] Let S ⊂ A_{fp} be finite and M the mub-closure of {⊥_{s} : s ∈ S} ⊂ X_{fp}. Then pM is mubclosed. For let a ∈ A and x be the projection of ⊥_{a} into M, then px ∈ pM ∩ ↓ a; if also b ∈ pM ∩ ↓ a, ⊥_{b} ≤ m ≤ a for some m ∈ M ∩ Pb, so ⊥_{b} ≤ x and b ≤ px.

[⇒, Pa] Let S ⊂ (Pa)_{fp} be a finite set and M be the mub-closure of S ∪ {⊥_{a}} in X. I claim M′ = M ∩ Pa is mub-closed in Pa. For let x ∈ Pa and y be its reduction to M with α : b = py ≤ a. Now ⊥_{a} ∈ S ⊂ M so ⊥_{a} ≤ y and a ≤ b; hence y ∈ Pa ∩ M = M′.

[⇐] Let S ⊂ X_{fp}. Put T = pS ⊂ A_{fp} and N for its mub-closure in A. This is a finite poset, so for a ∈ N we may define M_{a} inductively as the mub-closure of

(S ∩ Pa) ∪ {Σαm : m ∈ M_{b}, α : b < a}

Put M = ⋃_{a∈A} M_{a}; this is a finite set of finite elements, and I claim it is mub-closed. Let x ∈ Pa ⊂ X. Put b for the reduction of a to N with α : b ≤ a. Then M ∩ ↓ x ≤ Pαx. Let y be the reduction of Pαx to M_{b}. Now suppose z ∈ M with z ≤ x, say β : c = pz ≤ b. Then z ≤ Σβz ≤ Pαx ≤ x. But Σβz ∈ M_{b} by construction, so Σβz ≤ y. Thus y is the reduction of x to M. □

The crucial point of this proof is that Σα restrict to M_{b} → M_{a}.

+§5.3.4 Having seen a “concrete” version of this proof in terms of finite elements, we are in a position to give a categorical version. This depends on Cocl(X) being a continuous lattice (proposition 2.4.10), so that we may express X as a bilimit of Y for which the coclosure c : X → Y → X has c ≪ 1_{X} (we shall abuse notation by writing Y ≪ X for this). The delicacy of this construction (or rather the crudeness with which it has been implemented) necessitates restricting in the first instance to finite A. If I had the appropriate trick for retracts, this result would form a case in the proof by induction on the complexity of the domain (§2.5.2) that ContDom is closed under the fibration construction.

Note “Proposition” 2.4.10 is not valid in general.

Lemma Let σ : X → Y and X′ ≪ X in ContDom^{cp}. Then σX′ ≪ Y, i.e. there’s a Y′ ≪ Y through which σ ↾ X′ factorises. Proof “X′ ≪ X” is an instance of ≪ in Cocl(X), which is embedded in ↓ 1_{X} ⊂ [X → X]: recall that comparisons preserve and embeddings also reflect ≪. Write c : X → X for the coclosure corresponding to X′ and σ ⊣ p. Now σ(c) = p;c;σ is a coclosure on Y, and σ(c) ≪ 1_{Y} in Cocl(Y). Put Y′ for its splitting; then σX′ = Y′ i.e. σ ↾ X′ factors through Y′. □

Proposition Let A ∈ Pos_{f} and P : A → ContDom^{cp} be a continuous type-dependence with fibration p : X → A. Then X may be expressed as a bilimit of Y where q : Y → A are fibrations corresponding to continuous type-dependences Q : A → ContDom^{cp} with Qa ≪ Pa. Proof Let U_{a} ≪ Pa be an arbitrary “reference” choice of approximants; it suffices to make U_{a} ≤ Qa ≪ Pa in order to show that X is the bilimit of such Y. Since A is finite and Cocl(Pa) is a continuous lattice, we may define

Qa = ⋁(ΣαU_{b} : α : b ≤ a)

By the lemma, Σα : Pb → Pa restricts to Qb → Qa. Also U_{a} ≤ Qa ≪ Pa.

Put Qα : Qa ↣ Pa → Pb → Qb and verify that Σα ⊣ Qα; moreover Q : A → ContDom^{cp} is a functor, indeed (trivially, since A is finite) a continuous type-dependence. Let q : Y → A be the corresponding fibration; we have to show that Y is a coclosure of X; the projection Y → X turns out to be fibred over A, but the embedding is not. By construction the diagram on the left commutes:

[figure: Pb; Σ_{P} α; Pa; Qb; ι_{b}; Σ_{Q}α; Qa; ι_{a}; Pb; Pα; Pa; Qb; π_{b}; Qα; Qa; π_{a}]

and hence by adjointness so does that on the right. Hence the projection π : P → Q is an A-indexed functor, and we have a fibred functor π : X → Y over A.

Now we have to show that this has a (non-fibred) left adjoint, essentially given by ι. Thus for y ∈ Qa ⊂ Y, ιy = ι_{a}y. To check monotonicity, let y_{1} ≤ y_{2} over α : a_{1} ≤ a_{2}; then ι_{b_{1}}y_{1} ≤ ι_{b_{2}}(Qαy_{2}) ≤ Pα(ι_{b_{2}}y_{2}) ≤ ι_{b_{2}}y_{2}. For adjointness, let x ∈ Pb, β : a ≤ b; then the following are equivalent:

y ≤_{β}  π_{b}x
y ≤_{a} Qβ(π_{b}x)π_{a}(Pβx)
ι_{a}y ≤_{a} Pβx
ι_{a}y ≤_{β}  x

hence Y is a coclosure of X and q : Y → A is a fibration of the required kind. □

+§5.3.5 The restriction to finite base (A) in the previous result is not a serious one; indeed we could (at the expense of increased complexity) have included the approximation of A by A′ ≪ A in the construction, as we did implicitly in proposition 5.3.2. However manipulating the base domain is much simpler than manipulating the fibres.

Proposition

(a) Let A = bilim A_{i}. Then X = bilim X_{i}, where p_{i} : X_{i} → A_{i} are the fibrations corresponding to P_{i} : A_{i} ↣ A → IPO^{cp}.

(b) Let A ◁ B. Then X ◁ Y, where Y → B is the display of B ↠ A → IPO^{cp}. Proof

[a] For i ≤ j, X_{i} ≅ X_{j} ×_{A_{j}} A_{i}; let the coclosure on A_{j} corresponding to A_{i} be r. Then there is a right adjoint X_{j} → X_{i} which takes x_{j} ∈ P_{j}a_{i} ⊂ X_{j} to ⟨P_{j}αx_{j}, ra_{j}⟩, where α : ra_{j} ≤ a_{j}. This is a fibred functor over A_{j} → A_{i}, so p_{i} is a compatible family for bilim X_{i} over A = bilim A_{i}. The mediating map is a fibred type with fibre bilim(P_{i}a_{i}) ≅ Pa over a, so X ≅ bilim X_{i}.

[b] The squares and rectangle below are pullbacks:

[figure: X; ⊂; Y; X; A; p; ⊂; B; A; p]

□

+§5.3.6

Proposition Fibred types form a class of displays for BiPos_{f} and Bi_{ω}Pos_{f}. Proof We have to check closure under pullback and composition; terminal projections are trivially fibred types in the category. By the foregoing results we have a two-way translation between indexations and fibrations. If p : X → A is a fibred type in BiPos_{f} then it corresponds to an indexation P : A → BiPos_{f}^{cp}. The pullback along α : B → A of the fibration is the fibration of the precomposite with this; this composite clearly lies in BiPos_{f} and hence so does the fibration. For composites, the objects are already in the category, and the question for morphisms was disposed of in the discussion of IPO. Lemma 5.3.2 easily ensures that the fibration construction preserves being countably-based. □

+§5.3.7 When working with boundedly complete domains, which is the other case which we treat, we have a convenient way of moving from the fibre over a to that over b, namely via that over a ⋏ b, and hence it is possible to form useful retracts.

Lemma Suppose A ∈ bcCont and let f : Y → A, g : Y → X be arbitrary continuous functions. Then there is a continuous function u : Y → X such that f = u; p and ∀y.fy = p(gy) ⇒ uy = gy.

Proof Let y ∈ Y. Put x = gy, a = px, b = fy and γ : a ⋏ b ≤ a, δ : a ⋏ b ≤ b. Define uy = Σδ(Pγx). We have to show that this is continuous, so let y = ⋁ ; y_{i}, etc., so that the following diagram commutes:

a  b
[figure: γ; δ]
a ⋏ b
[figure: a_{i}; α_{i}; b_{i}; β_{i}]
[figure: γ_{i}; δ_{i}]
a_{i} ⋏ b_{i}^{ϵ_{i} }

By functoriality, the corresponding diagram of fibres and substitutions (Pa and Pγ, etc.) commutes, and indeed the three columns are (bi)limiting cones. By adjointness we also have Σϵ_{i} ; Σδ = Σδ_{i} ; Σβ_{i}. Since A is continuous, a ⋏ b = ⋁ ; (a_{i} ⋏ b_{i}). Finally recall that x = ⋁ ; x_{i} in the display means that x = ⋁ ; Σα_{i}x_{i} in its fibre. So we now have

uy = Σδ(Pγx)  definition
= Σδ(⋁ ; Σϵ_{i}(Pγ_{i}x_{i}))  P(a ⋏ b) = bilim P(a_{i} ⋏ b_{i})
= ⋁ ; Σδ[Σϵ_{i}(Pγ_{i}x_{i})]  continuity
= ⋁ ; Σδ_{i}(Pγ_{i}x_{i})  ϵ_{i} ; δ = δ_{i} ; β
= ⋁ ; Σβ_{i}(uy_{i})  definition
= ⋁ ; uy_{i}  Pb ≅ bilim Pb_{i}

as required. The properties follow easily from the construction. □

+§5.3.8 We can now prove the result for boundedly complete domains.

Lemma X ∈ bcCont iff A ∈ bcCont and ∀a ∈ A.Pa ∈ bcCont.

Proof

[⇒] A ◁ X, so clearly A ∈ bcCont. Let a ∈ A; we use lemma 5.3.7 with Y = X, f = Ka and g = 1_{X}, then the square

[figure: X; u; X; 1; ⌜ ; a ; ⌝; A; p]

commutes, so u factorises u : X → Pa ⊂ X. Moreover the other property of u makes Pa ◁ X.

[⇐] We have only to check binary meets. Let x ∈ Pa, y ∈ Pb. Put c = a ⋏ b ∈ A and α : c ≤ a, β : c ≤ b. Then z = (Pαx) ⋏ (Pαy) ∈ Pc is the meet. Note that it has to be in this fibre since p is a projection. For w ∈ Pd with w ≤ x, y, let α′ : d ≤ a, β′ : d ≤ b, γ : d ≤ c. Then w ≤ (Pα′x) ⋏ (Pβ′y) = (Pγ(Pαx)) ⋏ (Pγ(Pβy)) = Pγ((Pαx) ⋏ (Pβy)) = Pγz ≤ z since Pγ has a left adjoint. □

Proposition Fibred types form a class of display maps for bcCont and its flavours. □

+§5.3.9 Indeed this applies to other categories of (boundedly complete) domains.

Lemma Let C be a category of continuous boundedly complete domains and P : A → IPO^{cp} a continuous type-dependence with fibration p : X → A. Then X ∈ C iff A ∈ C and ∀a.Pa ∈ C. Proof A and Pa are retracts of X by lemma 5.3.8. We shall make X ◁ A × ∏_{a∈A} Pa. Let a ∈ A; we shall make two uses of lemma 5.3.7. Let u_{a} : X → Pa as in the proof of lemma 5.3.8, and

ι : X ↪ U by x ↦ (px, (u_{a}x : a ∈ A))

Put Y = Pa × A, f = π_{1} : Y → A and g = π_{0} : Y → Pa ⊂ X. Then we have v_{a} : Pa × A → X continuous, where v_{a}(x, b) = Σβ(Pαx). Then by directed distributivity,

π : U ↠ X by (a, (y_{b} : b ∈ A)) ↦ ⋀(v_{a}(u_{a}x, px) : px ≤ a)

is continuous. We have to show that ι ; π = 1_{X}. Let x ∈ Pa ⊂ X; then π(ιx) = ⋀(v_{a}(u_{a}, px) : px ≤ a) is the inf of a set with least element x, since for α : px ≤ a, v_{a}(u_{a}x) = Pα(Σαx) ≥ x, and if px = a, v_{a}(u_{a}x) = x. □

Proposition Fibred types form a class of displays for any category of boundedly complete domains. □

+§5.3.10 The notion of a domain-indexed family of domains ought to generalise to spaces and locales, but I have not as yet been able to formulate the definitions in the absence of the specialisation order. I can, however, dispose of the use of Scott-continuity.

Lemma Let A ∈ IPO and P : A → IPO^{cp} be a functor. Then P is continuous iff

(∀a ∈ A, x ∈ U ⊂ Pa : U open) (∃a ∈ V ⊂ A : V open) (∀α : b → a : b ∈ V) (Σα(Pαx) ∈ U) Proof This simply reformulates Pa ≅ bilim(Pa′ : a′ ≪ a) (specifically at the point x). U sets the degree of approximation to x which we require (by definition of Scott-openness, any directed sup which reaches x eventually gets into U, and conversely if this holds for all U then it reaches x). Then V is a sufficient stage in ⋁ ; {Σα(Pαx) : α : b ≤ a, b ∈ V } to get within U. □

5.4 Indexed Domain Theory

+§5.4.1 We have seen that continuous type-dependences, as defined in §5.1.12, behave very nicely vis à vis categories of domains, and that the alternative definitions fail to provide cartesian closure. In this section we demonstrate cartesian closure for continuous type-dependences; we have also to show that the exponentials remain in the given category of domains.

Theorem IPO is cartesian closed relative to fibred types. Proof We have to construct the right adjoint, Πα, to substitution, Pα, over a display map α : B → A. By definition B = ∑_{A} X for some X ∈ PA, i.e. X : A → IPO^{cp} is a continuous type-dependence with fibration α : B → A. Let Y ∈ PB and put β : C = ∑_{B} Y → B for the corresponding display map.

By our intuition from Set,

ΠαY a = {u : Xa → Y : ∀b ∈ Xa.ub ∈ Y b}

with the induced order from [Xa → Y]; the least element is λb.⊥_{Y b} and ⋁ ; is inherited by continuity. We have to show that ΠαY : A → IPO^{cp} is a continuous type-dependence and that Pα ⊣ Πα.

First, for γ : a′ ≤ a, we have to define the substitution ΠαY γ. Let x′ ∈ Xa′ and δ : x′ ≤ Σ_{X}γx′, then

ΠαY γux′ = Y δ[u(Σ_{X}γx′)]

which clearly lies in Y x′ as required. To prove continuity in x′ we have to use the continuity of Y : B → IPO^{cp}: if x′ = ⋁ ; x′_{i} with ξ_{i} : x′_{i} ≤ x′ then the diagram

[figure: Y (Σ_{X}γx′_{i}); Y δ_{i}; Y x′_{i}; u(Σ_{X}γx) ∈; Y (Σ_{X}γx′); Y (Σ_{X}γξ_{i}); Y δ; Y x′; Y ξ]

commutes, the vertical columns being (bi)limiting cones. Continuity in u is trivial. ΠαY γ has a left adjoint given at v ∈ ΠαY a′, x ∈ Xa by

Σ_{ΠαY} γvx = Σ_{Y} δ[v(Xγx)]

Recalling the contravariance of the function-space in its first argument, the following are equivalent:

Σ_{ΠαY} γv  ≤ u
Σ_{Y} δ[v(Xγx)] ≤ ux  ∀x ∈ Xa
v(Xγx)  ≤ Y δ(ux)  ∀x ∈ Xa
vx′  ≤ Y δ[u(Σ_{X}γx′)]  ∀x′ ∈ Xa′
v  ≤ ΠαY γu

We now have a functor ΠαY : A → IPO^{cp}, and we have to show that it is continuous. Let

a = ⋁ ; a_{i}, γ_{i} : a_{i} ≤ a, x ∈ Xa; then

⋁ ; Σ_{ΠαY} γ_{i}(ΠαY γ_{i}ux) = ⋁ ; Σ_{Y} δ_{i}[Y δ_{i}[u[Σ_{X}γ_{i}[Xγ_{i}x]]]] = ux

since X and Y are continuous.

Now we have to show that Πα is right adjoint to Pα. Let Z ∈ PA with fibration γ : D = ∑_{A} Z → A. As in §5.1.8, f : PαZ →_{B} Y correspond to g : Z →_{A} ΠαY by fbu = gaub, where b ∈ Xa ⊂ B and u ∈ PαZb = Za. Bijectiveness and continuity follow immediately as in that section. □

+§5.4.2 Since we have constructed a continuous type-dependence, ΠαY, it is instructive to see the corresponding fibration. This is

{⟨a, u⟩ : a ∈ A, u : Xa → Y, ∀b ∈ Xa.β(ub) = b}

with order relation

⟨a, u⟩ ≤ ⟨a′, u′⟩ ⟺ a ≤ a′ ∧ (∀b ∈ Xa, b′ ∈ Xa′ : b ≤ b′)(ub ≤ u′b′)

It would seem that we may make this construction even for projections, since we need only the display map and its left adjoint (and not the type-dependence) to define it. However this turns out not to work because of examples 5.2.8.

+§5.4.3 Next we show that the indexed product construction is continuous w.r.t. bilimits in its various arguments.

Proposition Let A = bilim A_{i}, B = bilim B_{i}, C = bilim C_{i} and α_{i} : B_{i} → A_{i}, β_{i} : C_{i} → B_{i} be compatible families of fibred types. Let γ_{i} : D_{i} → A_{i} be the indexed product Πα_{i}β_{i}. Let α : B → A, β : C → B and γ : D → A be the mediating maps, where D = bilim D_{i}. Then γ = Παβ, i.e. “ΠαY ” is continuous in A, α and Y. Proof Παβa is the ipo of u making the diagram

[figure: C; u; Xa; 1]

[figure: β]

[figure: B; α; A; ⌜ ; a ; ⌝]

commute, where the square is a pullback. We have to show that such u’s are given precisely by compatible families of similar (but subscripted) diagrams. We may see what the projection maps are by considering the commutative diagram

[figure: ΠαY a; ⊂; [Xa → C]; Πα_{i}Y_{i}a_{i}; ⊂; [X_{i}a_{i} → C_{i}]]

where the right column is (bi)limiting; we have to show that the left is too. We have only to observe that u ∈ [Xa → C] satisfies the condition iff its projects do. □

+§5.4.4 We now restrict these results to the various categories of domains

Theorem BiPos_{f} is cartesian closed relative to fibred types. Proof By the results of §5.3, we have only to show that if A, Xa and Y b are in a given category of domains, C = BiPos_{f}, (for a ∈ A, b ∈ B = ∑_{A} X) then so is ΠαY a. This is trivial for finite domains, and proposition 5.4.3 allows us to introduce bilimits in all three arguments. Functoriality easily allows retracts to be introduced and the result to be extended to ContDom, but we were unable to show the indexed-fibred correspondence for this case. □

+§5.4.5 For the case of bcCont and other categories of boundedly complete domains, we make ΠαY a ◁ [Xa → C].

Theorem Any category of boundedly complete domains is cartesian closed relative to fibred types. Proof Let a ∈ A, B = ∑_{A} X, β : C → B be as before. In lemma 5.3.7, let Y = [Xa → C]×Xa, f = π_{1} : Y → Xa ⊂ B and g = ev : Y → C; then we have a continuous function r : Y → C with p(r(u, b)) = b and if p(u(b)) = b then r(u, b) = u(b), so the exponential transpose of r makes ΠαY a a retract of [Xa → C]. □

+§5.4.6 By “Domain Theory” we mean more than exponentials, so we have to extend these things to the indexed case. However most of these things are very easy.

Proposition Let P : A → C^{cp} be a continuous type dependence with fibration p : X → A.

(a) Let f : X → X be any fibred continuous function over A; then f has a least fibred fixpoint.

(b) There is a fibred embedding X ↣ X_{A}^{X} over A.

(c) Any continuous functor F : C^{cp} → C^{cp} extends to a fibred endofunctor of the fibration of C over itself by means of these displays.

(d) We have fibred bilimits over A.

(e) There is a fibred embedding of X into a fibred η-model. Proof

[a] This even holds for projections; we proved it in proposition 2.4.8.

[b] The proof of proposition 1.2.17b may be read indexedly.

[c] Its value at X is given by P ; F.

[d] Follows from proposition 5.2.6

[e] Apply (c) to (b,c) as in proposition 2.2.8b. □

5.5 Equality, Function-Spaces and Type-of-Types

§5.5.1 In the context of category theory (and we course course take it as axiomatic that this is the appropriate foundational language for mathematics and theoretical computer science) the system of all “sets” is not just a set or type but a category. In the absence of a requirement for strong polymorphism it is generally accepted that this category should be an elementary topos as in §4.4.

Note The account given in this section is rather patchy, but was fully worked out in my joint paper with Andrew Pitts, A Note on Russell’s Paradox in Locally Cartesian Closed Categories.

In our case we want not just a type, V, of types, but an internal category, with an object C_{1} of morphisms as well as an object C_{0} = V of objects. Thus we make the

Definition A typos is a “cartesian closed self-indexed”, i.e. relatively cartesian closed category (S, D), with a “generic family”, i.e. an internal category C in S together with an equivalence S ≃ C of S-indexed categories.

The original definition proposed by Andrew Pitts had “locally” for “relatively”; we devote the last part of this section to showing that such a gadget is necessarily degenerate.

§5.5.2 Before working on this definition let us first unscramble it from the abstract way in which it is presented. We have therefore to recall what is an internal category (especially over a relatively cartesian closed category), how to make the two categories into fibrations and what it means for them to be equivalent.

The morphism-set of a category C is really a polymorphic notion: instead of the scheme C_{1} ⇉ C_{0} we should really think in terms of the hom-set C(X, Y) as an object with two free variables X, Y of type C_{0}. From this we see that ⟨dom, cod⟩ : C_{1} → C_{0} × C_{0} must be a display map. This enables us to construct the pullback

C_{2}  \overline{}C_{1} × C_{0}

[figure: C_{0} × C_{1}; 1 × ⟨dom, cod⟩; C_{0} × C_{0} × C_{0}; ⟨dom, cod⟩ × 1]

(as in §3.2.8) which yields the object of composable pairs, and hence the composition map comp : C_{2} → C_{1}, and similarly formulate the associative law. Of course we also have id : C_{0} → C_{1} as usual.

Given an internal category we construct a fibration as in §4.2.10 whose objects over A ∈ S are S-maps X : A → C_{0}. The equivalence between C and S is to be (at least) a full and faithful assignment of a display X → A to such a map. Taking in particular the identity, C_{0} → C_{0}, we have a display G → C_{0}. The display corresponding to X : A → C_{0} is now given by the pullback X^{∗}G → A of G → C_{0} against this map.

Proposition A typos is determined by a relatively cartesian closed category (S, D) together with a pair of displays G → C_{0} and ⟨dom, cod⟩ : C_{1} → C_{0} × C_{0} and f : dom^{∗} G → cod^{∗} G such that

(i) any display occurs (not uniquely) as a pullback of G → C_{0} and

(ii) for any morphism f : X^{∗}G → Y^{∗}G (where X, Y : A ⇉ C_{0}) there is a unique ⌜f⌝ : A → C_{1} with ⌜f⌝; dom = X, ⌜f⌝; cod = Y and

X^{∗}G  \overline{f} Y^{∗}G

[figure: ⌜f⌝^{∗}(dom^{∗} G); ≅; ⌜f⌝^{∗}f; ⌜f⌝^{∗}(cod^{∗} G); ≅]

commutes. □

+§5.5.3 This definition is highly redundant. Having (quite correctly) made the observation that we should take account of the morphisms into our notion of “type of types”, we may forget it again. For given two “names” (elements of C_{0} = V) for sets, we already know how many morphisms there are to be between them, because we know how many functions there are between the sets they name. Alternatively, we observe that we are using the display G → C_{0} to carve out a small full subcategory of S.

Lemma

(a) ⟨dom, cod⟩ : C_{1} → C_{0} × C_{0} is the fibred exponential of G → C_{0} (or rather G × C_{0} → C_{0} × C_{0}) by itself (i.e. C_{0} × G → C_{0} × C_{0}); more specifically, C_{1} = ∑_{u,v∈V} G[v]^{G[u]}.

(b) dom^{∗} G and cod^{∗} G are objects in the fibre over C_{1}, whose components at f ∈ C_{1} are just dom f and cod f; so f : dom^{∗} G → cod^{∗} G is the morphism in this fibre whose component at f is just f. □

Corollary In proposition 5.5.2 we may delete (ii). □

Since C_{1} will make no further explicit appearance, we shall revert to the name V for the object-of-objects (type-of-types) C_{0}.

V is not really so much a type of types but a type of names of types; then for each name ⌜A⌝ = v ∈ V we have to prescribe the corresponding type A = G[v] = tT^{−1}(⌜A⌝), where tT : G → V. Commonly discussions of type of types omit this second datum; in the models we shall construct in the next section V itself will actually be a lattice and so carry very little information on its own. On the other hand, if we manage to present V as a combinator as in §5.5.5 and §5.6.9, then it does carry sufficient information on its own.

+§5.5.4 We have still further redundancy. Since every display occurs as a pullback of G → V (and every pullback of a display is a display), we need not mention D explicitly. We need only require that all pullbacks of G → V exist and that this class of maps, once constructed, have the required properties. There does not, unfortunately, seem to be any abbreviation of axiom (ii) of §4.3.2 (which formally requires composability of displays but really concerns sums), but we can at least reduce the last two axioms:

Proposition A typos is determined by a category S and a map G → V such that

(i) The pullback of G → V against any map exists in S (write D for the class of such pullbacks)

(ii) D is closed under composition,

(iii) Any terminal projection is in D,

(iv) V has a binary operation →: V × V → V whose pullback against G → V is the fibred exponential of G → V with itself. □

The pullback in the last case is of course just C_{1} again. We shall look again at the definition in section 6, where we shall replace (iii) by the following:

Lemma Let S have a typos structure G → V. Then V has an element ⌜1⌝ and a binary operation × giving rise to the finite products in S. □

§5.5.5 To define a typos we therefore need only give a single morphism in a category. Here is the best known example.

Theorem The closures in P ω provide a typos structure for AlgLat_{ω}. Proof Put Λ = P ω, V = ∥λa. ⋁ ; _{n}(1 ⋎ a)^{n}∥ and G = ∥λu.⟨Vu_{0}, Vu_{0}u_{1}⟩∥; G → V is given by the left component.

The class D of pullbacks of G → V contains the terminal projection A = ∥a∥ → 1 by considering ⌜a⌝ : 1 → V. We construct pullbacks as in §5.1.6, since G = ∑_{V} V. For the exponential we only need G_{V×V}^{G} = ∥λu.⟨⟨Vu_{00}, Vu_{01}⟩, λx.Vu_{01}(u_{1}(Vu_{00}x))⟩∥.

For composites let f : A → V, g : B → V with pullbacks B = ∑_{A} f → G and C = ∑_{B} g → G. Put h = λau.⟨fau_{0}, g(fau_{0})u_{1}⟩. Then the composite C → B → A is the pullback of G → V along h. □

The combinatorial flavour of this suggests that one might try to formulate a new (λ-indefinable but relatively consistent) combinator V. For instance V = VV = QVV says that V is a V-type of V-types; to this we add axioms forcing cartesian closure.

In the next section a new typos will be constructed from fibred types.

+§5.5.6 Both this traditional example and the new ones to be constructed fail to be extensional in the sense that there are continuous functions V → V which do not preserve isomorphisms.

We have already foresaken the traditional belief in Category Theory that all mathematical constructions are functors. However even in the known cases of nonfunctorial constructions we at least have preservation of isomorphisms, so is there some serious problem here?

Perhaps not. Isomorphism, recall, is a structure, not a property, and we have no reason to suppose that even when an isomorphism between to objects exists then it must be recursively realisable (in whatever sense). It is therefore plausible that a function, and even one with type values, may distinguish between accidentally isomorphic objects.

On the other hand, this was the reason for throwing isomorphisms into definition 5.1.12. Any continuous functor C^{cp} → C^{cp} necessarily preserves isomorphisms, and so if we had a model with V = C^{cp} we would have extensionality. This cannot be done classically, but

Question Does the Effective Topos provide an Extensional Typos?

+§5.5.7 The notion of typos clearly allows interpretation of function spaces and type of types. We devote the remainder of this section to the demonstration that if we add equality to these two then we have inconsistency. However it is very interesting to observe that there is apparently no pairwise inconsistency amongst these concepts.

Clearly “classical” categorical model theory (the interpretation of the logic of equality, predicate calculus, quantifiers and so on in categories, in particular toposes) allows nondegenerate interpretations of equality and function spaces.

Our categories of domains allow interpretation of function spaces and type of types.

Joyal’s Arithmetic Universes appear in some sense to allow interpretation of equality and type of types. (Unfortunately no account of this important work has appeared on paper.)

+§5.5.8 A typos with equality would be just too good: it falls over under its own weight. Let S be a locally cartesian closed category which is equivalent as an S-indexed category to an internal category C = (C_{0}, C_{1}). For X over A in S we may construct the object

Mono_{A}(X) = {U ^{i} X : (∀V ⇉_{f}^{g} U : f ; i = g ; i) (f = g)}

as a subobject of C_{0} × C_{1} by means of (pullbacks,) equalisers and a Π functor.

Then i : U ↪ X over Mono_{A}(X) → A is a generic (saturated) mono in S, so that S is (locally cartesian closed and) weakly well powered.

If Question 4.4.12 has a positive answer then S is a topos, and has a subobject classifier Ω. On the other hand, we have a “big” set G. Any object A of course gives rise to a display A → 1

which is a pullback of G → V against some 1 → V; the remaining map in the square is a mono A ↪ G.

But putting A = Ω^{G} we deduce by Cantor’s theorem (corollary 1.5.13) that S is degenerate.

Note This contradiction is examined in detail in A Note on Russell’s Paradox in Locally Cartesian Closed Categories.

§5.5.9 It is possible to dispose of the use of Ω and bring back the diagonal argument underlying Cantor’s theorem directly into the proof itself with V or G playing the rôle previously played by Ω. It would be nice if we could remove equality from this proof and show positively that any object of any typos is inhabited. This would almost certainly show that any typos gives rise to a model of the λ-calculus.

Theorem Let S be a locally cartesian closed category with a generic family. Then S is degenerate. Proof (Pitts) First, there is a pullback square

[figure: V^{G}; i; G; 1; ⌜V^{G}⌝; V]

We perform the rest of the argument in an indexed rather than fibred style, in which G[v], for instance, denotes the inverse image of v in G. For A ∈ S, the equality type indexed by A × A corresponding to the diagonal A → A × A will be written Δ_{A}[a_{1}, a_{2}].

Let X be a fixed object of S and consider

( ∑_{f∈V^{G}} Δ_{G}[g, if] × X^{G[f(if)]} : g ∈ G)

which is a G-indexed family of types, so we write its display as a pullback of G → V along some ξ : G → V. Thus the expression above is isomorphic to G[ξg].

Now ξ gives a global element of V^{G}, to which one may apply i : V^{G} ↪ G to obtain a global element iξ of G. Substituting this for g in the isomorphism yields

G[ξ(iξ)] ≅ ∑_{f} Δ_{G}[iξ, if] × X^{G[f(if)]}
≅ ∑_{f} Δ_{V^{G}}[ξ, f] × X^{G[f(if)]}
≅ X^{G[ξ(iξ)]}

Thus writing Y for the object G[ξ(iξ)] we have Y ≅ X^{Y} so X is reflexive in S and by proposition 1.5.6 is inhabited.

We have shown that every object of a certain cartesian closed category with all finite limits in inhabited. Hence by proposition 1.5.11 S is degenerate. □

§5.5.10 Here for the record are Andrew Pitts’ comments on this proof.

“Although it may not appear so at first, the above argument is (an elementary version of) the one given [in §5.5.8]: the necessity of showing S has a subobject classifier Ω is circumvented by systematically replacing Ω by V in [that] argument, at the same time replacing negation ¬(−) by the exponential X^{(−)}, for X any fixed object. Thus the above proof is really Russell’s Paradox in disguise! To make this clearer, let me remind you of the following argument [corollary 1.5.13]:

If a topos E contains an object T for which there is a monomorphism i : P T = Ω^{T} ↪ T, then E is degenerate. For consider the subobject of T given by

(∃s ∈ P T)(t = is ∧ ¬(is ∈ s))

(cf. the object considered in §5.5.9) and let ξ : 1 → P T be the corresponding global element. Then one has in E:

iξ ∈ ξ ⟺ (∃s ∈ P T : iξ = is)¬(is ∈ s)
⟺ (∃s ∈ P T : ξ = s)¬(is ∈ s)
⟺ ¬(is ∈ s)

which leads to a contradiction.

Note that one could dually start with the subobject of T given by

(∀s ∈ P T)¬(t = is ∧ ¬is ∈ s)

and derive a similar contradiction. Taking the analogue of this in type theory (with X^{(−)} for ¬(−) and V for Ω, etc.) probably gives another proof of the result with the technical advantage that the proof is completely within the (=, Π) fragment of Martin-Löf type theory. G = ∑_{v∈V} G[v] is not in this fragment, but only occurs negatively in the argument: V^{G} ≅ ∏_{v∈V} V^{G[v]}, etc.”

Indeed, writing ∇_{A}^{X}[a, b] = X^{Δ_{A}[a,b]}, we construct the object

∏_{f∈V^{G}} ∇_{G}^{X}[g, if]^{X^{G[f(if)]}}  ≅ X^{G[ξg]} = G[θg]

then with Z = G[θ(iθ)], Z ≅ X^{Y} ≅ X^{Z} as before. Since in some sense

∇_{A}^{X}[a, b] = \begin{cases}X & if a = b \\ 1 & otherwise \end{cases}

it has more chance of existing in a category in which every object is inhabited, so perhaps this leads to the “positive” result suggested at the beginning of §5.5.9.

5.6 Type of Types in Domains

+§5.6.1 Now we are in a position to construct a type of types in any category of domains C, subject to the difficulties we have encountered in the past in manipulating these. Clearly we shall only be able to do this for small categories.

From proposition 5.5.4 we have only to find a fibred type G → V in C of which any other is a pullback. Since pullback of fibration corresponds to precomposition of indexation (lemma 4.2.13) it suffices to find the following:

Definition Let C be a small category of domains and tT : V → C^{cp} a type dependence (§5.1.12). This is saturated if given any other type dependence X : A → C^{cp} there is a continuous map ⌜X⌝ : A → V and a natural isomorphism u : X ≅ ⌜X⌝; tT.

Lemma Let tT : V → C^{cp} be a saturated type dependence and G → V the corresponding fibration. Then G → V is a generic family, making C a typos. Proof Let p : X → A be a display map, i.e. a fibred type corresponding to a continuous typedependence P : A → C^{cp}. Then by hypothesis we have ⌜X⌝ : A → V and u : P≅ ⌜X⌝;tT. The latter is an indexed functor, so corresponds to a fibred equivalence between the corresponding displays, u : X ≅ ⌜X⌝^{∗}G. Hence p : X → A occurs as a pullback of G → V as required. □

+§5.6.2 This brings us directly back to the similarity of C^{cp} with its objects, upon which we first remarked in §2.2.7 (though there we mentioned IPO^{em}). C^{cp} is a category rather than a poset, but it is possible (though beyond what could be done within the scope of this work) to generalise domain theory in this way. Having done this we would like to put V = C^{cp}.

The saturated type-dependence is then of course the identity C^{cp} → C^{cp}. This is clearly the correct approach, and it fails in our case only because of the inadequacy of classical logic. We may seriously expect to be able to proceed in this fashion in the Effective Topos.

A more significant problem than its algebraic structure is that C^{cp} only has countable filtered colimits. Since it comes quite close to having binary coproducts, Freyd’s paradox (proposition 1.5.8) means that we cannot get round this problem, at least in a classical world.

We shall, however, be able to “cover” C^{cp} with a suitable domain V to satisfy the above definition. We do not require the map A → V to be unique; to do so would on the one hand force V ≃ C^{cp} and on the other amount to equality on objects of C. It is this covering operation which loses the extensionality mentioned in §5.5.6.

+§5.6.3 Of course as already remarked we have to have a small category of domains. However we need a better grasp of the object-set than the usual “up to equivalence”, so after, or rather in the spirit of, theorem 2.6.12, we may as well assume C = Retr(Λ) with Λ algebraic. By “concrete domain” we shall here mean the image of a coclosure of Λ, so that there are canonical embeddings and projections between them. We have to do somewhat more work to cut down our indexed domains to a “canonical” form.

In §2.6.11 we approximated domains by means of bilimits of embeddings, and we shall do the same here. However does the fact that we are interested in diagrams of comparisons matter? (In a filtered diagram of monos we have no parallel pairs of maps.) Of course not, because we have just confused the objects (diagrams of comparisons) with their approximating morphisms (“natural embeddings”).

Bilimits raise a particular question of canonicity, since we wish to have directed sups defined up to equality and not isomorphism (and anyway the whole point of the construction on which we are embarking is to discard a lot of isomorphisms). We have to choose a particular construction for (bi)limits, and we shall say that the set-theoretic limit of a diagram (X_{i}) is the set of compatible families (x_{i}). This approach is facilitated where we can express things as bilimits or directed sups of “atomic” (i.e. finite) things, and this is precisely what algebraicity is about.

Definition A canonically indexed domain is a continuous type-dependence P : A → C^{cp} where A is algebraic and

Pa is \begin{cases}a concrete domain & if a ∈ A_{fp} \\ bilim\{Pb : b ∈ A_{fp} ∩ ↓ a\} & otherwise \end{cases}

where the limit is the “set-theoretic” one. This enables us to restrict attention to A_{fp}.

The restriction to algebraic A is a convenience to get round the Axiom of Foundation in set theory and other technical points: we could generalise to arbitrary ipos (at least continuous ones, at any rate) by introducing bases, but this definition serves our present purposes adequately. We shall regard Pa as part of the data for canonical indexed domains only for a ∈ A_{fp}; the non-compact points are redundant and cause unnecessary complications later on.

+§5.6.4 Since continuous type-dependences are functors, of course morphisms between them are natural transformations. The canonicity programme extends equally to these: instead of arbitrary comparisons between domains we are interested in canonical embeddings, and so we define an order relation between canonical indexed domains, P ≤ Q. This holds if Pa ≤ Qa as coclosures on Λ for each a ∈ A_{fp} (the bilimits take care of themselves) and the square of projections and homomorphisms

                                  Qb ^{Qα} Qa

                                  [figure: Pb; Pα; Pa]

b  \overline{α} a

(or alternatively the corresponding square of embeddings and comparisons) commutes.

Lemma L(A), the set of canonical A-indexed domains, is an ipo. Proof First observe that there can indeed be at most one instance of the order relation between any two canonical domains, so we have a poset and not a category. The ipo structure is created by the forgetful functor L(A) → Cocl(Λ)^{|A|}, which means that to calculate it we need only consider the domains and not the comparisons.

Let P_{i} ∈ L(A) be a directed set; recall that the order relation is expressed by a commutative diagram as in the previous paragraph. We take the bilimits of the columns of this diagram; these correspond to directed sups in Cocl(Λ). The mediating maps give the comparisons in the bilimiting indexed domain.

If we had not restricted attention to A_{fp}, this proof would have become more complicated, and if we had not introduced canonicity, the directed sup would not be unique.

The bottom element of L(A) has all its objects ⊥_{Cocl(Λ)} and morphisms the unique comparison 1 → 1. □

For technical reasons (arising from the problem with theorem 2.2.14), we shall find it convenient also to consider continuous indexations; the foregoing discussion applies equally to them (with the exception of the alternative form of the above diagram). Write M(A) for the poset of canonically continuous A-indexations and canonical embeddings; M(A) is also an ipo.

+§5.6.5 The main thing to show is that L(A) ∈ bcCont_{ω}. We have to use M(A) to show that it is countably based.

Lemma Let P ∈ L(A). Then the forgetful functor L(A) → Cocl(Λ)^{|A_{fp}|} (given by the coclosures naming the objects of an indexed domain), restricted to ↓ P ⊂ L(A), has postinverse adjoints on both sides. With the corresponding problem for M(A), there is a postinverse right adjoint.

Proof We have to show that given an arbitrary {W_{a} : a ∈ |A_{fp}|} there is (for the left) a least Q ≤ P in L(A) with W ≤ Q and (for the right) a greatest Q ≥ P in L(A) or M(A) with W ≥ Q.

In the right case, for α; b ≤ a, we want the diagram in §5.6.4 to commute. Hence Qb ⊂ Pα(Qa). But Qb ⊂ W_{b}, so

F W b = inf_{Cocl(Λ)}{Pα(W_{a}) : α : b ≤ a} ⊃ Qb

We may put equality to give the required postinverse right adjoint.

For the left case we consider the adjoint diagram to that in §5.6.4, and get F W a = ⋁_{Cocl(Λ)}{Σα(W_{b}) : α : b ≤ a}. □

Corollary

(a) ↓ P is a countably based continuous lattice.

(b) L(A) and M(A) are in bcCont. Proof

[a] They are retracts of Cocl(Λ)^{|A_{fp}|}.

[b] An ipo is continuous iff every ↓-set is, and is boundedly complete iff every ↓-set is a lattice. Unfortunately we cannot deduce anything about size. □

+§5.6.6 We shall now construct the saturated type-dependence in two particular cases, namely ContLat_{ω} and bcCont_{ω}. The methods can probably be extended to other categories, but these suffice to make the point.

Lemma

(a) There is a continuous indexation Ψ into which any canonically indexed domain may be embedded.

(b) L(A) ∈ bcCont_{ω}. Proof

[a] Consider the functor M(A) → C^{op} as a diagram of projections, and take its limit by theorem 2.2.14. We cannot replace “continuous indexation” by “continuous type-dependence” because as remarked there we do not have limits in C^{cp} as a functor.

[b] L(A) is equivalent to a Scott-closed subset of ↓ Ψ, where Ψ is a canonically continuous indexation isomorphic to the one just constructed. □

Proposition (a) ContLat_{ω} and (b) bcCont_{ω} have saturated type-dependences. Proof

[a] With A = Λ, the limit in the lemma may be constructed in ContLat_{ω}^{hm}, so put L = ↓ Ψ.

[b] We have L = L(Λ) ∈ bcCont_{ω}.

In either case we have a functor L → (C^{cp})^{Λ} and hence tT : V = L × Λ → C^{cp}. Let P : A → C^{cp} be a continuous type-dependence and suppose (i, p) : A ◁ Λ. Let Q ∈ L be isomorphic to p ; P : Λ → A → C^{cp}, say u : F (Λ)(Q) ≅ (p ; P). Then with ⌜P⌝ = ⟨KQ, i⟩ : A → L × Λ = V we have u : ⌜P⌝; tT ≅ P : A → C^{cp} in the manner of definition 5.6.1. □

In this case ⊥ ∈ V is mapped to the trivial indexation, although in general it is consistent with the definition that its image be any domain with ⊤. Nevertheless it is convenient to assume that it does map to 1.

+§5.6.7 It is appropriate to remind ourselves of what we have proved.

Theorem There are nontrivial small categories which are relatively cartesian closed and have an internal category to which they are internally equivalent. In other words, the definition of a typos given in §5.5 is consistent. □

+§5.6.8 Having achieved this, the main aim of the work, we are in a position to pick up certain other questions.

First, we may replace Λ by some other model with the same category of retracts but for which the displays constructed in §5.1.6 are precisely the fibred types of the category. As usual we manufacture the new model from the biggest object in sight, namely the generic type G. It would seem reasonable to assume that this kind of construction ought to be possible in any (abstract) typos, but I have no idea how to find the retractions needed in general.

Secondly, we pick up the internal combinatory algebra structure on a λ-model from theorem 1.3.13 and construct the internal version of the category of retracts on it. Though I = Λ carries this structure and I^{I} an internal monoid structure, it is not possible to perform the Karoubi construction in Retr(Λ) unless we already have a type-of-types. This is because we have no way of constructing the object of idempotent elements of Λ.

It is, of course, possible to perform this construction without the type-of-types in a locally cartesian closed category (or topos) E in which Retr(Λ) is fully embedded preserving products and exponentials (e.g. by the Yoneda embedding). We return to such embeddings in §5.8.

+§5.6.9 This ties §5.1 and §5.2 together.

Theorem Let C be a small category of boundedly complete domains. Then there is a saturated object Λ such that every continuous type-dependence factors up to isomorphism through Idem(Λ) → C^{cp} (cf. 5.1.12) and hence can be represented as an element X ∈ Λ with X = PAX = QXX. Proof Let t : G → V be a generic family for C; as the biggest object in sight, we put Λ = G. We already have V ◁ G, since any fibred type is in particular a retract, but so far V is only defined up to isomorphism (indeed less than that) and it will be convenient to replace it with an isomorphic copy later. Any U ∈ C may be expressed as a retract of G since it occurs as a fibre (namely that over ⌜U⌝) and by lemma 5.3.8 the fibres are retracts of the display in the boundedly complete case. In particular Λ^{Λ} ◁ Λ and so we may put a λ-model structure on Λ.

Now we use lemma 5.3.7 with Y = V × Λ, f = π_{0}, g = π_{1}, so there is a u : V × Λ → Λ such that u ; t = π_{0} and (∀a ∈ V)(∀x ∈ tT a)(u(a, x) = x). Hence we have U : V → Λ^{Λ} ⊂ Λ such that Ua is an idempotent for each a and has underlying set tT a. We also have, for α : b ≤ a, Ub(Uax) = tT α(Uax) and Ua(Ubx) = Σ_{T} α(Ubx) by construction. Hence ∥U − ∥ = tT : V → C^{cp}.

Now U : V ↪ Λ has a postinverse, R = λa.t(a⊥), since R(Ua) = t(Ua⊥) = a. Since, as remarked, we have used V at most up to isomorphism, and now we have an explicit and convenient expression for it as a retract of Λ, we may replace it by its image under this. Hence V = PRU ∈ Idem(Λ) and ∥ − ∥ = R ; tT : ∥V∥ → C^{cp}. Then we have V = PVV = QVV, and also, since V → C^{cp} was a saturated type-dependence, any type-dependence factors through ∥V∥ ⊂ Idem(Λ) as required. □

Unfortunately I cannot see how to make V ∈ ∥V∥, i.e. V = VV.

+§5.6.10 Finally we repeat the Karoubi construction.

Proposition We may express the notions of “category”, “category with products” and “cartesian closed category” in any category with a class of display maps. The base category does not itself need to be cartesian closed.

Proof This is what §3.2 and §4.2 were all about! Being cartesian closed is an equational condition on (the hom-objects of) an internal category; at no point do we consider the collection of all maps between two objects in the base category. □

Theorem Let Λ be a β-model in bcCont_{ω} and C = Retr(Λ). Then there is an internal category C′ in C which is equivalent to C as a C-category and universally splits idempotents in the internal monoid I^{I}. Proof C is a typos by theorem 5.6.7. Let C′ be the internal category of §5.5.2; this is equivalent to C as a C-category by definition of a typos. I^{I} is an internal monoid of C and hence embedded in C′ by the equivalence. We split idempotents internally in C′ or C just as we do externally. Let I^{I} → D be a functor between C-categories in which D splits idempotents, then construct the mediating functor C ≃ K(I^{I}) → D externally and verify that it yields a cartesian functor over C and hence (the unique, up to isomorphism) internal functor C′ → D making the triangle commute. □

5.7 Interpretation of Polymorphism

§5.7.1 We have now completed the major constructions of the work, and we shall finish off with a few observations (rather than serious applications) about polymorphism. We have, in fact, provided two slightly different ways of approaching this, namely direct use of the indexed domain theory introduced in the first half of the present chapter, and via the “type-of-types” co just constructed. We shall find that the latter falls rather short of our expectations, and that whilst we have satisfied the definition posed by Andrew Pitts (§5.5.1), this particular programme for constructing a type of types has failed.

It is, however, worthwhile looking at the way in which the two forms of recursive construction introduced in §2.2, namely for fixed points and recursive domains are unified by the presense of a type of types, and also at certain other at first sight anomalous domain theoretic constructions which are explained in the context of indexed domain theory.

As we have already remarked in §3.5.5, in the presence of a type-of-types we no longer have a distinction between types and values. I would consider the two-sortedness of languages such as those introduced in §3.4.2 to be an aesthetic objection to them. This means that the Tarski fixpoint constructions in domains discussed in §1.4 and §2.1 are unified with the Plotkin-Scott-Smyth techniques for solving recursive domain equations in categories (§2.2). That there should be such a unification can hardly be a surprise, given the similarity of the methods.

+§5.7.2 Let us begin by looking at domain constructions (endofunctors of the “modified” category of domains C^{cp}) as endofunctions of the type of type, V.

Proposition Let C be a small category of domains and F : C^{n} × (C^{op})^{m} → C any continuous functor. Then there is a continuous function ϕ : V^{n+m} → V making the following diagram commute up to isomorphism:

[figure: V^{n+m}; (C^{cp})^{n+m}; C^{n} × (C^{op})^{m}; V; ϕ; C^{cp}; C; F]

Proof The existence of the middle map follows essentially from proposition 2.2.7; that of ϕ is now just the definition of a saturated type-dependence (§5.6.1). □

Question Is there a converse to proposition 2.2.7, i.e. given a continuous functor Φ : C^{cp} → C^{cp} is there a functor F : C × C^{op} → C making the following diagram commute?

[figure: C^{cp}; Δ; C^{cp} × C^{cp}; C × C^{op}; C^{cp}; Φ; C; F]

+§5.7.3 What about recursive domain equations?

Proposition Let F be a continuous co- or contravariant endofunctor of a small category of domains and ϕ : V → V the corresponding endofunction constructed in proposition 5.7.2.

(a) Let ⌜A⌝ be a fixpoint of ϕ with corresponding type A ∈ C. Then F A ≅ A.

(b) Let η : 1 → F : C^{cp} → C^{cp} be a pointed continuous endofunctor of C^{cp}. Then Yϕ ∈ V names the (underlying type of the) initial F -algebra.

Proof

[a] Immediate from the diagram in §5.7.2.

[b] The comparison 1 → F 1 is unique and necessarily the image of ⊥ ≤ ϕ⊥. Repeatedly applying F and ϕ respectively, the Tarski diagram ⊥ ≤ ϕ⊥ ≤ ... ≤ Yϕ is mapped to that in §2.2.3. □

This achieves the unification of §2.1 and §2.2 which we promised.

+§5.7.4 There was an oddity which arose in the P ω model (§1.4.6) and also in §2.6.7, namely the “raised sum”. Can we provide a categorical explanation of this nonassociative operation which seems to be the obvious semantics for tagged records?

Proposition Let C be a small category of domains containing T and X, Y two objects of it. Then X +_{⊥} Y is the indexed sum over T → 1 of the type-dependence which takes the two maximal points of T to X and Y and ⊥ to 1. If f : X → Z and g : Y → Z are any two continuous functions, there is a least continuous function X +_{⊥} Y → Z making the diagram commute. □

+§5.7.5 What do indexed products over T → 1 look like?

If we have ⊥, 0, 1 ∈ T mapped to A, X, Y and the two comparisons are α : A → X and β : A → Y, then the elements of the indexed product are triples ⟨a, x, y⟩ ∈ A × X × Y such that a ≤ Pαx, Pβy. Thus in the case A = 1 we have a binary product; otherwise we have a new construction: it isn’t the product, the pullback or the lax pullback.

+§5.7.6 Now let us look at polymorphism of the “dependent-type” kind, using indexed domain theory. In this case we have variables of “ordinary” (i.e. not type) type and quantification over them.

Constant types are interpreted as appropriate 1-indexed domains, T : 1 → C^{cp}, and constant values as (global) elements of these.

Dependent types with variables of type(s) A are interpreted as A-indexed domains, X(−) : A → C^{cp}. Proliferation of variables is a special case of substitution, which is interpreted by precomposition of indexed domains or pullback of fibred ones.

Iterated dependence, i.e. with a variable whose type is itself dependent, is interpreted by means of composites of fibred types.

Products, function spaces and other categorical constructions are interpreted by means of the appropriate constructions, and lambda abstraction is performed using the indexed adjunctive correspondence for the exponential.

Quantification is always over a variable running over a dependent type, which corresponds to a display map; accordingly it is interpreted by the appropriate adjoint to substitution and satisfies the Beck condition as required.

+§5.7.7 Before looking at the second order polymorphic lambda calculus (which, as we have remarked, we may do in two ways), let us interpret Cardelli’s language with V. The differences lie in the new type V and in the interpretation of constructors like ×.

The type-of-types combinator, V, is interpreted as tT : V → C^{cp} or as the corresponding G → V. For ×, etc., we choose maps V × V → V as in proposition 5.7.2; the interpretation of the

expression A × B quâ element of V now yields the same type as the construction (this was the content of the lemma).

Quantification over type-variables is a special case of quantification over any variable, the type of the variable now being V.

+§5.7.8 Specialising Cardelli’s language to the second order lambda calculus, what values to we get for ∀X.X, etc.? Unfortunately, nothing like what we might expect.

Let ϕ : V → V correspond to Φ : C^{cp} → C^{cp}. Then ∀X.ϕX is consists of the assignments to each (name of a) type ⌜X⌝, a point u⌜X⌝ ∈ ΦX such that whenever we have a comparison f : ⌜X⌝ ≤ ⌜Y⌝, then Φf(u⌜X⌝) ≤ u⌜Y⌝, or equivalently u⌜X⌝ ≤ Φg(u⌜Y⌝) where f ⊣ g.

Unfortunately there are insufficient such comparisons, so that ∀X.X becomes quite a large product. The point is that we have nothing to force u to preserve isomorphisms, because the whole object of the constructions in the previous section was to dispose of them in order to make V a poset. There will always be lots of distinct elements of V corresponding to isomorphic domains, and we can separate them by open sets (or maps to 2 with different values at two such points).

+§5.7.9 This brings us back to the “direct” application of indexed domain theory to the second order polymorphic lambda calculus. We interpret a type which depends on a type-variable as a C^{cp}- indexed domain. Since we do not have an explicit type of types in this language, it does not matter that C^{cp} is not itself an object of C. This change is equivalent to the condition that u ∈ ∀X.Φ(X) preserve isomorphisms, or that we have the compatibility condition for all comparisons between domains rather than names for them in V.

We shall intend quantification over type variables to be over C^{cp} rather than V in future.

Proposition The value of ∀X.X is

(a) the singleton (K⊥) if T ∈ C.

(b) 2 = {K⊥, K⊤} otherwise, i.e. if every domain in C has ⊤.

The value of ∀X.X → X is

(c) the three point lattice if every domain has ⊤. Proof

[a] Suppose uX ≠ ⊥_{X} for some X. We have two embeddings X ↣ X ⊕ X, where X ⊕ X is the disjoint union of two copies of X with their bottoms identified (this is a retract of X +_{⊥} X and hence in C by lemma 2.6.7b). Let the images of uX under these be a, b; then a, b ≤ u(X ⊕ X). However {a, b} is unbounded.

[b] In lemma 2.2.15 we classified the comparisons between X and 2. Suppose uX ≠ ⊥_{X} for some X; let f : X → 2 be the characteristic function of X \ ⊥, which is a comparison. Then f(uX) = ⊤ ≤ u2. Suppose uY ≠ ⊤ for some Y; let y ∈ Y_{fp} \ ↓(uY) and g : 2 → Y by ⊥ ↦ ⊥ and ⊤ ↦ y. Then y = g(⊤) ≤ uY, contrary to the choice of y. Hence u = K⊥ or u = K⊤.

[c] By considering the comparison [⊥] : X → 2 we see that ⊥ ≠ u_{X} ⇒ 1 ≤ u_{2}. By considering the comparison [x ⇒ ⊤] : 2 → X we see that the latter implies 1 ≤ u_{X} and hence (contrapositively) 1 ≰ u_{X} ⇒ 1 ≰ u_{2} ⟺ u_{2} = ⊤. Finally by considering [⊤ ⇒ ⊤] : 2 → X we see that this implies u_{X} = ⊤. Hence uX can only take one of the (uniform) values K⊥, I or K⊤. □

5.8 General Theory of Typoses

+§5.8.1 This final section is unashamèdly speculative: it consists of various ideas which, frankly,

haven’t even really made it to the “top of my head”.

The word “typos” was of course a joke, due to Andrew Pitts, the inventor of the tripos. (This is an acronym for “Topos-Representing Indexed Pre-Ordered Set” and was actually coined by Peter Johnstone; I am pleased to say I have never been offered “tripoi” for its plural: even if it were a Greek word, the plural would be τριπoδϵς.) However it was clearly the kind of joke that would stick.

I would ask, though, that future workers in this area refrain from using this word, especially in any fixed meaning, until it has become clear what the definition should be, i.e. what the strongest possible/reasonable conditions are which can be placed on it. For already in §5.5 above, the term has undergone two changes of meaning (besides the reformulations which were the subject of the first part of that section), namely in dropping the (inconsistent) equality requirement, and in adding the condition of extensionality (§5.5.6). It is likely that when the classical theory developed in this work is extended to domains which are categories rather than posets, and when the ideas are applied to the Effective Topos, and when we begin to see how typoses and toposes can be brought together, then further modification of the definition will be needed, and it would be a pity to lose the use of this word (frivolous though it may have been).

§5.8.2 This brings us to my embarrassing ignorance of the Effective Topos. Rosolini [1986] discussed the category of domains in this, and it seems likely that if we take the category of comparisons in this then we shall obtain a domain and hence an extensional typos.

§5.8.3 In proposition 5.5.4 we observed that we only need the (generic fibred type) G → V to determine the typos structure in a category C. Hence so long as we hang on to this map, we can perform constructions on C. In particular the obvious thing to do is to embed it in a topos.

Definition An internal typos in a relatively cartesian closed category E is a morphism G → V satisfying the results of proposition and lemma 5.5.4, with the exception of axiom (iii). An object A of E is a domain if A → 1 can be expressed as a pullback of G → V.

If, as is intended, E is a topos, then it will have lots of other objects which are not domains.

Example Let C be a category of domains with generic fibred type G → V. Put E = [C^{op}, S] and embed C by the Yoneda embedding. Then we have an internal typos in a topos.

The point of doing this is that whereas we remain within the category of domains when discussing the program-structure and internal logic of denotational semantics, we need the full strength of higher-order logic (in the form of topos theory) to discuss the external logic. This is needed because there are examples of true theorems which are not provable, or valid terminating programs which are not provably so, in the language and fragment of logic in which they are expressed.

We have shown that categories of domains are complete with respect to products and coproducts over domains; the same work immediately generalises to families of domains indexed over sets (objects of the ambient topos) which are not necessarily domains. Indeed we should think of domains as simply a special kind of set over which the results of programs may range; we may need more general sets in the meta-discussion of the program.

+§5.8.4 This may throw some light upon the difference between domains with and without ⊥, and why we do not require it to be preserved (contrary to what usually occurs in Algebra).

We require ⊥ in domains as the “totally undefined” element and as the zeroth approximation to a fixpoint.

On the other hand, for topos-theoretic purposes it may be useful to have A-indexed families of domains for arbitrary A ∈ E, not necessarily a domain. This does not conflict with the constructions of the present chapter.

Viewed in a category of posets, A is an arbitrary object (set, poset or whatever) and an Aindexed family of domains is a fibred type (in particular a projection X → A). We may construct products, exponentials, bilimits and fixpoints indexedly over A. Indeed we found fixpoints in proposition 2.4.8.

The formulation of Smyth’s theorem about cartesian closure in AlgPos, which was the subject of §§2.4.11-13, is now more properly made in this context than simply in terms of products and exponentials in BiPos_{f}. In other words we want some pullbacks against display maps.

+§5.8.5 Having now reached the stage of embedding a typos (and with it the model of the λcalculus and its category of retracts which we used to construct it) in a topos, we are in a position to ask

Question What do we mean by the spectrum of a model of the λ-calculus, and what is a generic model?

The question of meaning is far from clear: we are asking about a concept defined in terms of function-spaces, and Geometric Logic, the strongest form for which we have spectra or generic models, offers nothing on this topic. Moreover the function-space is of course contravariant in its first argument.

As to some sort of construction, perhaps we should use realisability triposes. How or why, I do not know.

+§5.8.6 Further on this matter of the spectrum of a model, the object ∀X.X → X ought to have only two elements.

Question Can ∀X.X → X, or something similar, be given a Heyting algebra structure?

It would appear that the value of ∀X.X → X, as calculated in lemma 5.7.9, depends on the category of domains; it may in fact reflect the hierarchy (§2.6.5) below it.

+§5.8.7 Discussion of the spectrum of a model brings us to a question which has been avoided in this work just as much as it seems to have been in all others.

Question What is a morphism of models of the λ-calculus?

It would seem reasonable to suppose that a morphism of categories of domains is a functor preserving bilimits, products and exponentials; such a functor preserves λ-models, so (since we would want Retr to be functorial) we have to say what is a morphism between models with the same category of retracts.

+§5.8.8 Retr(Λ) is not the whole story as to the world in which a model of the λ-calculus naturally resides: we can still vary the base topos (Set), though we have not done so at all in this work. Question 5.8.5 should be interpreted to be asking for the natural topos in which Λ resides, and I believe it would be missing the point to suggest that this is Set for Λ, P ω or any of the other models discussed in this work.

The classical name for varying the base topos is forcing, and the earliest example of the use of that technique was the independence of the Continuum Hypothesis. It is an easy matter to muck up cardinalities by forcing (consider the classifying topos for the theory of a surjection ℕ ↠ X for any set X). This is the reason why varying the weight of a category of domains (§2.5.2, §2.6.6 and §2.6.12) is unlikely to make much logical difference.

+§5.8.9 The move to internal typoses in §5.8.3, together with this discussion of morphisms of models, leads to the consideration of subtypos structures on the same category.

Question Let C ⊂ D be the categories of domains for two internal typoses in a topos S, so products and exponentials in C are inherited from D and S. Does the inclusion have a left adjoint?

Bibliography

S. Abramsky

[1986] Domain Theory in Logical Form, 1986 P. Aczel

[1980] Frege Structures, in [Barwise et al. 1980] J.F. Adams A.V. Aho and J.D. Ullman

[1977] Principles of Compiler Design, Addison-Wesley, 1977 ANSI

[1966] American National Standard FORTRAN X.3.9 (1966), American National Standards Institute,

New York M.A. Arbib M.A. Arbib and E.G. Manes

[1975] Arrows, Structures and Functors — the Categorical Imperative, Academic Press, 1975, MR

  51/638

M. Artin, A. Grothendieck and J.L. Verdier

[1964] Théorie des Topos et cohomologie etale des schèmas, Séminaire de Géometrie Algebraique

du Bois Marie 1963/4, LNM 269 & 270 (1964) 1-340, Springer, MR 50/7130-1 E. Astesiano and C. Böhm

[1981] Trees in algebra and programming (Genoa 1981), 1981 G. Ausiello and C. Böhm

[1979] Automata, languages and programming (Udine 1978), 1979 C.A. Babbage ? Baclawski [] Homology of Posets, Adv Maths, J. Baeten and B. Boerboom

[1979] Ω can be anything it shouldn’t be, Nederl. Akad. Wetensch. Indag. Math. 41 (1979)

  111-120, MR 80h:03018

B. Banaschewski

[1982] Categorical Aspects of Topology and Analysis (Ottawa 1981), LNM 915 (1982), Springer B. Banaschewski and R.-E. Hoffman 162 BIBLIOGRAPHY

[1981] Continuous Lattices (Bremen 1979), LNM 871 (1981), Springer H.P. Barendregt

[1975] λ-calculus and Computer Science Theory (Rome 1975), LNCS 37 (1975), Springer

[1981] The Lambda Calculus — its Syntax and Semantics, SLFM 103 (1981), North-Holland, MR

      83b:03016

H.P. Barendregt, M. Coppo and M. Dezani-Ciancaglini

[1983] A filter lambda model and the completeness of type assignment, J. Symbolic Logic 48/4

(1983) 931-940 H.P. Barendregt and M. Dezani-Ciancaglini

[1982] International Symposium on Programming (Turin 1982), 1982 H.P. Barendregt and G. Longo

[1980] Equality of Lambda Terms in the Model T , in [Hindley & Seldin 1980] 303-337, MR 82g:03017 M. Barr

[1969] Midwest Category Seminar, LNM 106 (1969), Springer

[1971] Exact Categories, Exact Categories and Categories of Sheaves, LNM 236 (1971) 1-120,

      Springer, Z 223:18010

[1979] *-autonomous categories, 1979 M. Barr and S. Mac Lane

[1970] Reports of the Midwest category seminar 3 , 1970 M. Barr and C. Wells

[1985] Toposes, Triples and Theories, Gr. d. Math. Wis. 278 (1985), Springer J. Barwise

[1975] Admissible sets and structures : an approach to definability theory, 1975

[1977] Handbook of Mathematical Logic, SLFM 90 (1977), North-Holland North-Holland SLFM J. Barwise, A. Baudisch and S. Feferman

[1983] Model-theoretic logics, 1983 J. Barwise, H.J. Keisler and K. Kunen

[1980] The Kleene Symposium (Madison, 1978), SLFM 101 (1980), North Holland A. Baudisch see J. Barwise M.J. Beeson

[1981] Formalising Constructive Mathematics: why and how?, in [Richman 1981] 146-190

[1985] Foundations of Constructive Mathematics, Springer, 1985 J. Bénabou

[1975] Fibrations Pétites et Localement Pétites, Comptes Rendues Acad. Sci. Math. 281 (1975) 831-834 & 897-900, Paris, MR 52/13991 BIBLIOGRAPHY 163

[1985] Fibred Categories and the Foundations of Naïve Category Theory, J. Symb. Logic 50 (1985)

10-37 G. Birkhoff and S. Mac Lane

[1967] Algebra, Macmillan, 1967 B. Boerboom see J. Baeten C. Böhm see also E. Astesiano and G. Ausiello2.5.4

[1975] λ-calculus and Computer Science Theory (Rome 1975), LNCS 37 (1975), Springer A. Boileau and A. Joyal

[1981] La Logique des Topos, JSL 46 (1981) 6-16 F. Borceux and G. Van den Bossche

[1983] Algebra in a localic topos with applications to ring theory, LNM 1038 (1983), Springer L.E.J. Brouwer and D.S. van Dalen [] Brouwer’s Cambridge lectures on intuitionism, R. Brown

[1964] Function Spaces and Product Topologies, Q. J. Math., 1964 K.B. Bruce and A.R. Meyer

[1984] The Semantics of Second Order Polymorphic Lambda Calculus, in [Kahn et al. 1984] 131-144 G. Cantor L. Cardelli [] Two-dimensional syntax for functional languages,

[1986] A Polymorphic Lambda Calculus with Type:Type, Digital Equipment Corporation, 1986 J. Celeyrette

[1975] Fibrations et Extensions de Kan, Thèse, Univ de Paris-Nord, 1975 C.C. Chang and H.J. Keisler

[1973] Model Theory, North-Holland, 1973 J.M. Chapman

[1986] Relative Category Theory as an approach to Geometric Morphisms, Ph.D. dissertation, Bris-

tol, 1986 A. Church

[1941] The Calculi of Lambda Conversion, Princeton University Press, 1941

[1953] Introduction to mathematical logic, 1953

[1976] A System of Set Theory with a Universal Set, Tarski Symposium, American Mathematical

Society, 1976 T.W. Clarke, P.J.S. Gladstone, C.D. Maclean and A.C. Norman

[1980] SKIM - the S, K, I Reduction Machine, LISP-80, 1980 164 BIBLIOGRAPHY

W.F. Clocksin W.F. Clocksin and C.S. Mellish

[1981] Programming in PROLOG, Springer, 1981 P.M. Cohn

[1965] Universal Algebra, Harper and Row, 1965 M. Coppo see H.P. Barendregt Th. Coquand, C.A. Gunter and G. Winskel

[1986] Polymorphism and domain equations, 1986 M. Coste

[1980] Localisation, Spectra and Sheaf Representation, in [Fourman et al. 1980] 212-238 G. Cousineau, P.-L. Curien and B. Robinet

[1986] Categorical combinators, sequential algorithms and functional programming, Combinators

and functional programming languages (Val d’Ajol 1985), 1986 P.-L. Curien see also G. Cousineau

[1983] Combinateurs Catégoriques, algorithmes séquentiels et Programmation Applicative, Ph.D.

dissertatation, Paris VII, 1983 P.-L. Curien and A. Obtułowicz [] Partiality and Cartesian Closedness, H.B. Curry

[1942] The Inconsistency of Certain Formal Logics, J. Symb. Log. 7 (1942) 115-117

[1963] Foundations of mathematical logic, 1963 H.B. Curry and R. Feys

[1958] Combinatory Logic I , North-Holland, 1958 H.B. Curry, J.R. Hindley and J.P. Seldin

[1972] Combinatory Logic II , North-Holland, 1972 A. Day

[1975] Filter Monads, Continuous Lattices and Closure Systems, Canad. J. Math. 27 (1975) 50-59,

  MR 51/3258

M. Dezani-Ciancaglini see H.P. Barendregt S. Eilenberg [] Automata, Languages and Machines, S. Eilenberg and C.C. Elgot [] Recursiveness, S. Eilenberg, A. Heller and M. Tierney

[1975] Algebra, Topology and Catgeory Theory: a collection of papers in honor of Sammy Eilenberg, BIBLIOGRAPHY 165

S. Eilenberg and S. Mac Lane

[1942] Natural Isomorphisms in Group Theory, Proc. Nat. Acad. Sci. USA 28 (1942) 537-543, MR

  4-134

C.C. Elgot see S. Eilenberg Y. Ershov J. Fairbairn

[1984] A New Type-Checker for a Functional Language. 53 (1984), Univ. Camb. Comp. Lab.

techn. report J. Fairbairn and S. Wray

[1987] TIM: A Simple, lazy Abstract Machine to Execute Supercombinators, Dept of Computer

Science Research Report 87/R6 (1987), Univ. Glasgow S. Feferman see J. Barwise R. Feys see H.B. Curry R.G. Fisker, C.H.A. Koster, C.H. Lindsey, B.J. Mailloux, J.G.L.T. Meertens, J.L.

Peck, M. Sintzoff and A. van Wijngaarden

[1975] The Revised Report on the Algorithmic Programming Language ALGOL 68, Acta Informatica

5:1-3 (1975) 1-236 T.E. Forster

[1983] Quine’s New Foundations: an Introduction, Cahiers du Centre de Logique, 1983 M.P. Fourman

[1974] Connections between Category Theory and Logic, D.Phil. dissertation, Oxford, 1974

[1977] The Logic of Topoi, in [Barwise 1977] 1053-1090, MR 56/15351 58/10343 M.P. Fourman, C.J. Mulvey and D.S. Scott

[1979] Applications of Sheaves (Durham, 1977), LNM 753 (1979), Springer

[1980] Applications of Sheaves, 1980 M.P. Fourman and D.S. Scott

[1979] Sheaves and Logic, in [Fourman et al. 1979] 302-401, MR 82d:03061 M.P. Fourman and S.J. Vickers

[1986] Theories as Categories, in [Pitt 1986] 434-448 G. Frege P.J. Freyd [] Numerals and Ordinals, P.J. Freyd and G.M. Kelly

[1972] Categories of Continuous Functors, J Pure Appl Alg 2 (1972) 169-191, MR 48/369 E G. Kahn, D.B. MacQueen and G.D. Plotkin

[1984] Semantics of Data Types, LNCS 173 (1984), Springer B.D. Gabbay 166 BIBLIOGRAPHY

[1984] Elementary Logic — A Procedural Perspective, 1984 P. Gabriel and F. Ulmer

[1971] Lokal Präsentierbare Kategorien, LNM 221 (1971), Springer, MR 48/6205 G. Gierz, K.H. Hofmann, K. Keimel, J.D. Lawson, M. Mislove and D.S. Scott

[1980] A Compendium of Continuous Lattices, Springer, 1980, MR 82h:06005 J.-Y. Girard

[1972] Interprétation functionelle et élimination des coupures de l’arithmétique d’ordre superieur, Ph.D. dissertation, Paris VII, 1972

[1985] The System F of Variable Types, Fifteen Years Later, 1985 J. Giraud

[1972] Classifying Topos, in [Lawvere 1972] 43-56, MR 50/2300 P.J.S. Gladstone see T.W. Clarke R.I. Goldblatt

[1979] Topoi: the Categorical Analysis of Logic, SLFM 98 (1979), North-Holland, MR 81a:03063 A. Grothendieck see M. Artin A.J. Guilfoyle

[1982] Computable Analysis, 1982 C.A. Gunter see also Th. Coquand

[1985] Profinite Solutions of Recursive Domain Equations, Ph.D. dissertation, Wisconsin-Addison, 1985

[1987] Universal Profinite Domains, Information and Computation 72 (1987) 1-30 C.A. Gunter and D.S. Scott

[1987] Semaintic Domains, 1987 A. Heller see also S. Eilenberg

[1970] Applications of Categorical Algebra (New York), American Mathematical Society, 1970 L. Henkin and A. Tarski

[1974] The Tarski Symposium (California, 1971), 1974 J.R. Hindley see also H.B. Curry

[1983] The Completeness Theorem for Typing λ-terms, Theor. Comp. Sci. 22 (1983) 1-17 &

127-133 J.R. Hindley, B. Lercher and J.P. Seldin

[1972] Introduction to Combinatory Logic, LMS Lecture Notes 7 (1972), CUP J.R. Hindley and J.P. Seldin [] Introduction to combinators and the λ-calculus,

[1979] To H.B. Curry: Essays on Combinatory Logic, Lambda Calculus and Formalism, Academic Press, 1979 BIBLIOGRAPHY 167

[1980] To H.B. Curry: Essays on Combinatory Logic, Lambda Calculus and Formalism To H.B. Curry: essays on Combinatory Logic, Lambda Calculus and Formalism, Academic Press, 1980

C.A.R. Hoare and N. Wirth

[1973] An Axiomatic Definition of the Programming Language PASCAL, Acta Informatica 2:4 (1973)

335-356 R.-E. Hoffman see B. Banaschewski K.H. Hofmann see G. Gierz Ch. Hosono and M. Sato

[1977] The Retracts in P ω do not form a Continuous Lattice, Theor. Comp. Sci. 4 (1977) 137-142,

      MR 58/8442

W.A. Howard

[1980] The formulae-as-types notion of construction, in [Hindley & Seldin 1980] 479-490 J.M.E. Hyland

[1975] A Survey of some useful Partial Order Relations on Terms of the Lambda Calculus, in [Barendregt 1975] 83-95, MR 57/9496

[1976] A Syntactic Characterisation of Equality in some Models of the λ-calculus, J. LMS II 12 (1976) 361-370, MR 53/100

[1981] Function Spaces in the Category of Locales, in [Banaschewski & Hoffman 1981] 264-281 [1982] The Effective Topos, in [Troelstra & van Dalen 1982] 165-216, MR 84m:03101

J.M.E. Hyland, P.T. Johnstone and A.M. Pitts

[1980] Tripos Theory, Math. Proc. Camb. Philos. Soc. 88 (1980) 205-232, MR 81i:03102 C.B. Jay

[1987] A Language for Monoidal Categories, 1987 K. Jensen and N. Wirth

[1975] PASCAL User Manual and Report, Springer, 1975 P.T. Johnstone see also J.M.E. Hyland1 4.4.5 5.6.1

[1977] Topos Theory, LMS Monograph 10 (1977), Academic Press, MR 57/9791

[1980] Open Maps of Toposes, Manuscripta Math. 31 (1980) 217-247, MR 81f:18020

[1981] Factorisation Theorems for Geometric Morphisms I , Cah. de Top. et Géom. Diff. 22 (1981) 33-47, MR 82j:18007

[1981] Scott is not always sober, in [Banaschewski & Hoffman 1981] 282-283

[1982] The Vietoris Monad on the Category of Locales, Math. Arb. pap. 27 (1982) 162-179, Univ. Bremen

[1982] Factorisation Theorems for Geometric Morphisms II , in [Banaschewski 1982] 216-233, MR

      83j:18006

[1983] Fibred Categories, St. Adv. Maths. 3 (1983), Part III Lecture Course, Cambridge, MR

      85f:54002

168 BIBLIOGRAPHY

[1983] Open Locales and Exponentiation, Mathematical Applications of Category Theory (Denver

1983), AMS, 1983, MR 85i:18005 P.T. Johnstone and A. Joyal

[1982] Continuous Categories and Exponentiable Toposes, J. Pure Appl. Alg. 25 (1982) 255-296,

  MR 83k:18005

P.T. Johnstone, R. Paré, R.D. Roseburgh, D. Schumacher, R.D. Wood and G.C. Wraith

[1978] Indexed Categories and their Applications, LNM 661 (1978), Springer, MR 58/16816 A. Joyal see A. Boileau and P.T. Johnstone A. Joyal and M. Tierney [] An Extension of the Galois Theory of Grothendieck, G. Kahn, D.B. MacQueen and G.D. Plotkin

[1984] Semantics of Data Types (Sophia-Antipolis, 1984), LNCS 173 (1984), Springer K. Keimel see G. Gierz H.J. Keisler see J. Barwise and C.C. Chang G.M. Kelly see also P.J. Freyd

[1982] Basic Concepts of Enriched Category Theory, LMS lecture notes 64 (1982), CUP B.W. Kernighan, M.E. Lesk and D.M. Richie

[1975] The C Programming Language, CSTR 31 (1975), Bell Labs, N.J.

S.C. Kleene and J.B. Rosser

[1935] The Inconsistency of Certain Formal Logics, Ann. Math. 36 (1935) 630-636 D. Knuth

[1968] The Art of Computer Programming, Addison-Wesley, 1968 A. Kock

[1981] Synthetic differential geometry, LMS lecture notes 51 (1981), CUP A. Kock and G.E. Reyes

[1977] Doctrines in Categorical Logic, in [Barwise 1977] 283-313, MR 58/10395 A. Kock and G.C. Wraith

[1971] Elementary Toposes, Lecture Notes 30 (1971), Aarhus Universitet, MR 49/7324 C.H.A. Koster see R.G. Fisker C.P.J. Koymans

[1984] Models of the Lambda Calculus 9 (1984), Centrum voor Wiskunde en Informatica, Amster-

  dam, ?  MR 85b:03020

K. Kunen see J. Barwise Y.G.A. Lafont

[1987] From Category Theory to Implementation, 1987

[1987] The Linear Abstract Machine, 1987 BIBLIOGRAPHY 169

J. Lambek

[1979] From λ-calculus to Cartesian Closed Categories, in [Hindley & Seldin 1979] 375-402

[1980] From Types to Sets, Advances in Mathematics 35 (1980)

J. Lambek and P.J. Scott

[1986] An Introduction to Higher Order Categorical Logic, St. Adv. Maths. 7 (1986), CUP K.G. Larsen

[1987] Proof Systems for Hennessy-Milner Logic with Recursion, 1987 J.D. Lawson see G. Gierz F.W. Lawvere

[1963] Functorial Semantics of Algebraic Theories, Proc Nat Acad Sci USA 50 (1963) 869-872, MR

      28/2143

[1964] An Elementary Theory of the Category of Sets, Proc. Nat. Acad. Sci. 52 (1964) 1506-1511 [1969] Diagonal Arguments and Cartesian Closed Categories, Category Theory, Homology Theory

and their Applications II, LNM 92 (1969) 134-145, Springer

[1969] Adjointness in Foundations, Dialectica 23 (1969) 281-296

[1970] Quantifiers and Sheaves, Actes du Congrès Intern. des Math., Nice 1 (1970) 329-334

[1972] Toposes, Algebraic Geometry and Logic (Dalhousie, 1971), LNM 274 (1972), Springer

[1973] Metric Spaces, Generalised Logic and Closed Categories, 1973 F.W. Lawvere, C. Maurer and G.C. Wraith

[1975] Model theory and topoi : a collection of lectures by various authors, 1975 B. Lercher see J.R. Hindley M.E. Lesk see B.W. Kernighan L.G. Lewis

[1983] Open maps, colimits and a convenient category of fibre spaces, 1983 T. Lindgren

[1984] Untitled manuscript, Ph.D. dissertation, Rutgers University, 1984 C.H. Lindsey see R.G. Fisker F.J. Linton J.W. Lloyd

[1984] Foundations of Logic Programming, Technical Report 82/7 (1984), Dept of Comp Sci, Univ

Melbourne G. Longo see H.P. Barendregt G. Longo and E. Moggi

[1984] Cartesian closed categories and partial morphisms for effective type structures The Semantics of Second Order Polymorphic Lambda Calculus, in [G. et al. 1984] 131-144

[1984] The hereditary partial functional and recursion theory in higher types, JSL 4/49 (1984) S. Mac Lane see also M. Barr, G. Birkhoff and S. Eilenberg1.1 1.1.1 1.2.13 3.1.2 4.2.14 4.4.2 170 BIBLIOGRAPHY

[1971] Categories for the Working Mathematician, Springer, 1971 C.D. Maclean see T.W. Clarke D.B. MacQueen see E G. Kahn and G. Kahn D.B. MacQueen and D.T. Sanella [] Completeness of proof systems for equational specifications, D.B. MacQueen and R. Sethi

[1982] A Semantic Model of Types for Applicative Languages, Symposium on LISP and Functional Programming, 1982

[1982] A Higher-Order Polymorphic Type System for Applicative Languages, Symposium on LISP and Functional Programming (1982) 242-252

[1984] An Ideal Model for Recursive Polymorphic Types, Eleventh Annual Symposium on Principles

of Programming Languages, 1984 B.J. Mailloux see R.G. Fisker M. Makkai and G.E. Reyes

[1977] First Order Categorical Logic: Model-theoretic methods in the theory of topoi and related

categories, LNM 611 (1977), Springer, MR 58/21600 E.G. Manes see also M.A. Arbib

[1975] Algebraic Theories, GTM 26 (1975), Springer , MR 54/7578 P. Martin-Löf

[1971] A Theory of Types, unpublished, 1971

[1975] An Intuitionistic Theory of Types: Predicative Part, Logic Colloquium, North-Holland, 1975 [1980] Intuitionistic Type Theory, Bibliopolis, 1980

A.R.D. Mathias

[1979] Surrealist landscape with figures (a survey of some recent results in set theory), Per Math Hungarica 10 (1979) 109-175

[1987] The Ignorance of Bourbaki, Eureka 46 (1987)

C. Maurer see F.W. Lawvere A.D. McGettrick

[1978] Algol 68: A First and Second Course, Computer Science Text, CUP, 1978 J.G.L.T. Meertens see R.G. Fisker C.S. Mellish see W.F. Clocksin A.R. Meyer see also K.B. Bruce

[1982] What is a Model of the Lambda Calculus?, Information and Control 52 (1982) 87-122 R. Milner

[1978] A Theory of Type Polymorphism in Programming, J Comp Sys Sci 17 (1978) 348-375

[1982] Calculi for Synchrony and Asynchrony, 1982 M. Mislove see G. Gierz B. Mitchell BIBLIOGRAPHY 171

[1965] Theory of Categories, Academic Press, 1965 J.C. Mitchell and E. Moggi

[1987] Kripke-style models for typed lambda calculus, 1987 E. Moggi see also G. Longo and J.C. Mitchell

[1986] Polymorphism and Internal Categories, Peripatetic Seminar on Sheaves and Logic (Cambridge, March 1986), 1986

[1986] Partial Morphisms in Categories of Effective Objects, 1986

[1987] Empty Types in Polymorphic Lambda Calculus, 1987 G.P. Monro

[1984] A Category-theoretic approach to Boolean-valued models, 1984 C.J. Mulvey see M.P. Fourman R. Nakajima

[1975] Infinite Normal Forms for the λ-calculus, in [Böhm 1975] 62-82 P. Naur

[1963] Revised Report on the Algorithmic Programming Language ALGOL 60 , Comm. ACM. 6:1

(1963) 1-17 S.B. Niefield

[1982] Exactness and Projectivity, 1982 S.B. Niefield and K.I. Rosenthal

[1986] Constructing locales from quantales, 1986 M. Nielsen and E.M. Schmidt

[1982] Automata, Languages and Programming IX Automata, Languages and Programming, Aarhus

1982 (Aarhus, 1982), LNCS 140 (1982), Springer A.C. Norman see T.W. Clarke A. Obtułowicz see also P.-L. Curien

[1986] categorical and algebraic aspects of Martin-Löf type theory, 1986

[1987] Algebra of Constructions I: The Word Problem for Partial Algebras, Information and Com-

putation 73 (1987) 129-173 A. Obtułowicz and A. Wiweger

[1982] Algebraic, Functional and Categorical aspects of the type-free Lambda Calculus, in [Traczyk

1982] 299-324 R. Paré see P.T. Johnstone D. Park

[1976] The Y-combinator in Scott’s Lambda Calculus Models (revised), Dept. Comp. Sci. Theory

of Computation report 13 (1976), Univ. Warwick J.L. Peck see R.G. Fisker J. Penon 172 BIBLIOGRAPHY

[1974] Catégories localement internes, C.R. Acad. Sci. Math. 278 (1974) A1577-1580, Paris, MR

  51/10435

F.C.N. Pereira and D.H.D. Warren

[1980] Definite Clause Grammars: A Survey pf the Formalism and a Comparison with Augmented

TRansition Networks, Artif Intell 13 (1980) 231-278 D. Pitt

[1986] Category Theory and Computer Programming (Guildford, 1985), LNCS 240 (1986), Springer A.M. Pitts see also J.M.E. Hyland0 5.6.1

[1981] The Theory of Triposes, Ph.D. dissertation, Cambridge, 1981

[1987] Completeness of topos models for polymorphic lambda calculus, Categories in computer sci-

ence and logic (Boulder 1987), 1987 G. Plotkin5.4 G.D. Plotkin see also E G. Kahn and G. Kahn

[1974] The λ-calculus is ω-incomplete, J. Symbolic Logic 39 (1974) 313-317, MR 50/6799

[1976] A Powerdomain Construction, SIAM J. Comp. 5 (1976) 452-487, MR 56/4224

[1978] T as a Universal Domain, J. Comp. Sys. Sci. 17 (1978) 209-236, MR 80d:68105

[1984] Types and partial functions, 1984 G.D. Plotkin and M.B. Smyth

[1978] The Category Theoretic Solution of Recursive Domain Equations, Dept. Artif. Intell. re-

search report 60 (1978), Edinburgh Univ. A. Poigné

[1986] Foundations are rich Institutions, but Institutions are poor Foundations, 1986 V.W.V. Quine

[1937] New Foundations for Mathematical Logic, American Mathematical Monthly, 1937 F. Ramsey G.E. Reyes see A. Kock and M. Makkai J.C. Reynolds

[1984] Polymorphism is not Set-Theoretic, LNCS 173 (1984), Springer D.M. Richie see B.W. Kernighan F. Richman

[1981] Constructive Mathematics (New Mexico 1980) 873 (1981), Springer B. Robinet see G. Cousineau E.P. Robinson

[1986] A modal language for powerdomains, 1986 R.D. Roseburgh see P.T. Johnstone K.I. Rosenthal see S.B. Niefield G. Rosolini

[1985] Topoi and p-Categories, Carnegie-Mellon University, 1985 BIBLIOGRAPHY 173

J.B. Rosser see also S.C. Kleene

[1942] The Burali-Forti Paradox, J Symb Logic 7 (1942) 1-17 B.A.W. Russell

[1908] Mathematical Logic based on the Theory of Types, Amer. J. Math. 30 (1908) 222-263

B.A.W. Russell and A.N. Whitehead [1910-13] Principia Mathematica I-III , CUP, 1910-13

D.T. Sanella see D.B. MacQueen D. Sannella and A. Tarlecki

[1985] Specifications in an arbitrary institution, Internal Report 184 (1985), Univ Edinburgh, Dept

of Computer Science M. Sato see Ch. Hosono A. Ščedrov

[1984] Forcing and Classifying Topoi, Mem. Amer. Math. Soc. 48 (1984)

E.M. Schmidt see M. Nielsen

D. Schumacher see P.T. Johnstone

D.S. Scott see also M.P. Fourman, G. Gierz and C.A. Gunter1.1 1.1.1 1.4.1 1.4.7-8 2.2.1 2.3.5 2.4.1 2.5.11 2.5.3 5.5.1

[1970] Outline of a mathematical theory of computation, monograph 2 (1970), Oxford Univ Programming Support Group

[1970] The lattice of flow diagrams, monograph 3 (1970), Oxford Univ Programming Support Group

[1972] Lattice Theory, Data Types and Semantics, Formal Semantics of Programming Languages, 1970 (1972) 65-106, Prentice-Hall, MR 56/7304

[1972] Continuous Lattices, in [Lawvere 1972] 97-136, MR 53/7879

[1975] Combinators and classes, in [Böhm 1975]

[1976] Data Types as Lattices, SIAM J. Comp. 5 (1976) 522-587, MR 55/10262

[1979] Identity and Existence in Intuitionistic Logic, in [Fourman et al. 1979] 660-696, MR 81a:03060 [1980] Lambda Calculus: some Models, some Philosophy, in [Barwise et al. 1980] 223-265

[1981] Lectures on a Mathematical Theory of Computation, PRG Techn. Monogr. 19 (1981), Oxford Univ., MR 85g:68043

[1982] Domains for Denotational Semantics, in [Nielsen & Schmidt 1982] 577-613, MR 83m:68029 D.S. Scott and C. Strachey

[1981] Towards a mathematical semantics for computer languages, monograph 6 (1981), Oxford

Univ Programming Support Group P.J. Scott see J. Lambek J.A. Seebach and L.A. Steen

[1978] Counterexamples in Topology, Hold, Rinehart & Winston, 1978, MR 42/1040 R.A.G. Seely 174 BIBLIOGRAPHY

[1977] Hyperdoctrines and Natural Deduction, Ph.D. dissertation, Cambridge, 1977

[1983] Natural Deduction and the Beck Condition, Zeitschr. Math. Logik und Grundlagen d. Math. 29 (1983) 505-542

[1984] Locally Cartesian Closed Categories and Type Theory, Proc. Camb. Philos. Soc. 95 (1984),

  MR 83m:03076

[1985] Higher Order Polymorphic Lambda Calculus and categories I & II , Math Reports Canad

Acad Sci, 1985 J.P. Seldin see H.B. Curry and J.R. Hindley R. Sethi see D.B. MacQueen H. Simmons

[1978] The lattice-theoretic part of topological separation properties, Proc Edinb Math Soc 21 (1978)

41-48 M. Sintzoff see R.G. Fisker M.B. Smyth see also G.D. Plotkin11 5.6.4

[1982] The Largest Cartesian Closed Category of Domains, Dept. Sci. Sci. internal report 108 (1982), Edinburgh Univ.

[1983] Power domains and predicate transformers: a topological view, Techincal monograph 126 (1983), Univ Edinburgh Dept of Computer Science

[1983] The Largest Cartesian Closed Category of Domains Theor Comp Sci 27 (1983) 109-119,

Edinburgh Univ. I. Sols

[1976] Programming in Topoi, Cahiers top. et Géom. diff. 16 (1976) 312-319 T.P. Speed

[1972] Profinite Posets, Bull Austral Math Soc 6 (1972) 177-183, MR 45/4371 L.A. Steen see J.A. Seebach J.E. Stoy

[1977] Denotational Semantics: the Scott-Strachey approach to Programming Languages, MIT Press,

Cambridge, Mass., USA, 1977, MR 58/8460 C. Strachey see also D.S. Scott

[1973] The varieties of programming language, monograph 10 (1973), Oxford Univ PRG C. Strachey and C.P. Wadsworth

[1974] Continuations: a mathematical semantics for handling full jumps, monograph 11 (1974),

Oxford Univ PRG A. Tarlecki see D. Sannella A. Tarski see also L. Henkin8

[1955] A Lattice-theoretical Fix-point Theorem and its Applications, Pacific J. Math. 5 (1955)

  285-309, MR 17-574

B.R. Tennison M. Tierney see S. Eilenberg and A. Joyal T. Traczyk [1982] Universal Algebra and Applications 9 (1982), Banach Center Publications

A.S. Troelstra

[] Choice sequences : a chapter of intuitionistic mathematics,

A.S. Troelstra and D.S. van Dalen

[1982] L.E.J. Brouwer Centenary Symposium (Noordwijkerhout, 1981) 110 (1982), North-Holland

A.M. Turing J.D. Ullman see A.V. Aho F. Ulmer see P. Gabriel D. van Dalen

[1983] Logic and Structure, Universitext, Springer, 1983

D.S. van Dalen see also L.E.J. Brouwer and A.S. Troelstra

[] Extension problems in intuitionistic plane projective geometry,

G. Van den Bossche see F. Borceux A. van Wijngaarden see R.G. Fisker J.L. Verdier see M. Artin S.J. Vickers see also M.P. Fourman

[1986] PROLOG — a sheaf-theoretic semantics, 1986

[1987] An algorithmic approach to p-adic integers, 1987

C.P. Wadsworth see C. Strachey D.H.D. Warren see F.C.N. Pereira C. Wells see M. Barr A.N. Whitehead see B.A.W. Russell G. Winskel see also Th. Coquand

[1984] Categories of models for concurrency, 1984

[1985] A note on powerdomains and modality, Theor Comp Sci 36 (1985) 127-137

[1985] A complete proof system for SCCS with modal assertions, 1985

N. Wirth see C.A.R. Hoare and K. Jensen A. Wiweger see A. Obtułowicz R.D. Wood see P.T. Johnstone G.C. Wraith see P.T. Johnstone, A. Kock and F.W. Lawvere1 S. Wray see J. Fairbairn

Index

;, right-handed composition in a category, 8 ⟨a, b⟩ = ⟨⟩ab, pair combinator notation, 17 ⟨f, g⟩ : Z → X × Y, pair of functions, 14 A[x], model or algebra extended by x, 5 U ◁ X, X ▷ Y, retract, 8 X^{Y}, space of functions Y → X, 14 X_{n}, iterated function space, 14 Y → X, function space, 14 C(1, −), global sections functor, 5 ∥A∥ = {a : a = Aa}, fixpoint set or underly-

ing type of a retract, 16 ∥X∥, underlying type of a retract, 5 ⊥ = (λx.xx)(λx.xx), bottom combinator, 2 ι : U ↣ X, embedding, 8 ⟨⟩ = λxyz.zxy, pairing combinators, 2 !_{A}, terminal prjection A → 1, 14 x⃗, string of variables, 1 |X|, underlying set, global sections or cardi-

nality, 5 c1 = c_{1}, right projection combinator nota-

tion, 17 c0 = c_{0}, left projection combinator notation,

17 e ⊂ f ⟺ e = e; f = f ; e, sub-retract, 9 i : U ↪ X, inclusion, injection, mono, 8 p : X ↠ Y, surjection, epi, 8 ? = λnxy.n(Kx)y, Church’s test-for-zero com-

binator, 3

0 = λxy.y, Church’s zero numeral, 3 0 = λxy.x, left projection combinator, 2 1 = λf.PI(PfI), 15 1 = λxy.y, right projection combinator, 2

accidental structure, 86 action of a monoid on itself, regular, 10 adjoint

− × X ⊣ (−)^{X}, 14 Type ⊣ ∥ − ∥, 20

↓↓ ⊣ ⋁ ; ⊣ ↓, 47

carrable maps have left adjoints, 34 commuting diagrams, 84 exponentiable space, 48 free alegbra left adjoint to forgetful, 41 functor theorem, 120 for lattices, (⋁ ; , ⋀^{≠∅})-homomorphisms,

47 indexed, 110

quantifiers are adjoint to substitution,

83 definiition of hyperdoctrine, 84

quantifiers to substitution Cantor’s theorem, 28 to diagonal Δ : X → X × X

⋎ ⊣ Δ ⊣ ⋏, 64 to inclusion = (co)reflective, 8 to pullback functors, discussion, 75 ∀∃ theory, finite limits commute with filtered

colimits in, 13 algebra

F -, 41 η-, 7 lambda, 6

algebraic field extensions form a bifinite cat-

egory, 62 algebraic lattice, 24, 47 algebraic poset, 47

chararacterisation of Scott topology on,

49 not bifinite β-model, 56 which are not bifinite, 52

algebraic theory, 41, 80, 108

algebraically closed fields, analogy of saturated domains with, 65

AlgLat is cartesian closed, 49

ALGOL 68, 73 α-rule, 78 alphabet, 81 analysis and synthesis, 76 application, 1 approximable by ≪, 47 approximable element of an algebraic poset,

finitely, 47 approximating type-dependences, 140, 141 Arbib, Michael, 1 arguments of λ-terms, 6 arithmetic universes, 142 arrow category, 112, 120 assignment to variables in programming lan-

guages, 77 associated split fibration, 120 atomic formulae, 89 Axiom of Choice, 26 Axiom of Comprehension, 28, 98 Axiom of Replacement, 102

B = λfgx.f(gx), left-handed composition com-

binator, 2 Babbage, Charles, 95 Backus-Naur form, translation into domain

equations, 23 Baeten and Boerboom, 23 Barendregt, Henk, 1 Barendregt, Henk and Longo, Giuseppe, 60 base category, 79 base of a continuous poset, 59, 61 base, change of, 111 BASIC, 73 bcAlg is cartesian closed relative to fibred

types, 138 Beck condition, 84, 92, 115 Bénabou, Jean, 105, 107 beta rule, 2

algebra or model, 18

for lambda calculus as an indexed cate-

gory, 82 reflexive, 24

beth cardinal (ℶ), 56 bifinite category, 62

X and X^{X} countably based algebraic

implies, 57 algebraic posets which are not, 52 not preserved by pullback against con-

tinuous fibrations, 131 poset, 50

bilimits and directed sups of retracts, 130 in Retr(Λ), 69 of fibrations, 133

binary counting (ℕ = P_{f}ℕ), 21 binding of variables, 78 binding quantifiers and set-abstraction, 98 BiPos_{f} is cartesian closed relative to fibred

types, 138 Bi_{ω} Pos_{f} is a typos, 145 Böhm tree, 6, 24, 41, 60 Boolean algebras and rings, 89 bootstrapping λ-models, 65 bottom, 152

bifinite λβ-model must have, 53 bounded completeness not preserved by pull-

back, 131 bounded geometric morphism, 124 boundedly complete continuous poset, 59, 63

domains and fibrations, 135 domains, hierarchy is recursively decid-

able, 67 Brown, Ronnie, 27 Burali-Forte paradox, 99

C (programming language), 82

Cantor set, 33, 131

Cantor’s theorem, 27, 28, 37, 142, 143

Cardelli, Luca, 96, 97, 148

cardinality of base of category of domains, 65

of exponential, 49 carrable = pullable back, 34 cartesian closed, 14 BiPos_{f} is, 53 IPO is, 33 IPO is relative to projections, 131 Retr(Λ) is relatively, 129 category

lex R_{0} implies degenerate, 28 limit-colimit coincidence in, 39 category with coercion, free, 20 continuous and algebraic lattices are, 49 domains relative to fibred types, 138 equational formulation, 82 full subcategories of AlgPos_{ω}, 57 full subcategories of IPO inherit struc-

ture, 35 locally, 104

iff locally small, 118 relative to, 116 self-indexed category = typos, 138

cartesian functor, 107, 108 adjoints, 110 cartesian lifting, 107 cartesian morphism, 102 categories

exponentials = functor categories

indexed, 118 inductive, 40 theory of as a lex category, 80 various forms of pullbacks of, 111 categories of domains, similarity with domains,

40 category

base, 79 bifinite, 62 concrete, 11 enriched, 85 fibred, 107 slice, 102 category of retracts, 16 Cayley, Arthur, 10 chain, 68 change of base, 111 characterisations of continuous lattices, 48 characteristic function, 123 choice of cartesian liftings, 107 Choice, Axiom of, 26 Church’s numberals, 76, 92 Church, Alonso, 1, 3 Church-Rosser Theorem, 3 Clarke, Thomas, Gladstone, Philip, MacLean,

Duncan and Norman, Arthur, 4 class of display maps, 114 classical term model, 2 classifies open sets, 46 classifying topos, 88 Clocksin, Bill and Mellish, 59 clone of an algebraic theory, 80, 88 closed subset of a space, locally, 35 closed terms, 1

algebra, 2 closure operator, 8, 24 cloven fibration, 107 Cocl, set of coclosure operators, 55, 140, 141 coclosure operator, 8 cocomplete iff has finite colimits, 105 coercion in programming languages, 18, 20,

95 cofibration, 105 cofiltered diagram in a category, 12 cogenerator for the special adjoint functor

theorem, 123 cogenerator in, 46 coherences in a fibred category, 106 coherent logic, application to categories of

domains, 60 coherent space, 35, 53

X and X^{X} countably based algebraic

implies, 56 algebraic but not bifinite poset, 52

colimit, indexed, 105 combinators, 2

generate lambda terms, 4 combinatory algebra, 6

complete, 4 prealgebra, 4

combinatory prealgebra, in category with prod-

ucts, 5 comma or arrow category, 112, 120 comonad, 8 compact element of an algebraic poset, 46 compact open sets in an algebraic poset, 49 compact space, locally, 47 comparison map between domains, 42

explanation of the name, 95, 130

preserves ≪, 47

preserves compactness, 46 compilers, 77

being well-typed requires type-of-types,

95 complete category iff locally cartesian closed,

104 lattice forced by mor C-indexed products,

27 complete lattice with R_{1} is degenerate, 28 complete partial order = ipo, 32 complete set of mubs, 51 complete, combinatory, 4 completely distributive lattices and continu-

ous posets, 49 components = product projections, 14 components of a space (π_{0}), 91 composition in a category (;), 1, 8 of fibrations of domains, 134 of pullbacks, 13 of retracts, 9

Comprehension

Axiom of, 28 Comprehension, Axiom of, 98 computational universe, 125 concrete category, 11

Retr(Λ) is iff Λ is a model, 16 concrete context-free grammar, 81 cond in P ω, 23 confusion of object and meta-level, 37, 40, 58 conjunction fails in categories of retracts, 28 constants in a monoid, 10 context-free grammar, concrete, 81 continuous category, 47 continuous domains, 55, 59, 134 Cocl is continuous, 55 difficulty with, 64, 65 maximal elements are zero-dimensional,

61 continuous families of types, 125, 127 continuous fibrations, 131 continuous function between domains, 40 continuous lattice, 47

and (⋁ ; , ⋀^{≠∅}), 47

equivalent characterisations, 48 continuous model of the λ-calculus, 24 continuous poset, 47

canonically embedded in algebraic poset,

47 chararacterisation of Scott topology on,

49 condition for being coherent, 53 retract of is continuous, 48 continuous type-dependence, 74, 130 ContLat is cartesian closed, 49 contravariance of function-space, 74 conversion, beta, 2 convex subset of a poset, 35 coproduct

absent from categories of retracts, 28 from class of display maps, 115 indexed, 105 of retracts

indexed, 128 cosubstitution, 105, 131 countable products in Retr(Λ), 68 countably based algebraic, X^{X} is implies X

coherent, 56 counterexamples on fibrations of domains, 131 cpo = ipo, 32 crible or sieve in a Grothendieck topology, 90 cross-diagonal counting (ℕ = ℕ × ℕ), 21 Curien, Pierre-Louis, 4 Curry’s equations for a combinatory algebra,

6, 82 Currying, 17

D_{∞}, 37, 40, 41 database in PROLOG, 59 Day, Alan, 47 definable, λ-, 20 degenerate, lex ccc with every object inhab-

ited is, 28 densely injective space, 63 dereferencing in ALGOL 68, 77 determinant example of polymorphism, 73,

86 Diaconescu’s theorem, 124 diagonal counting (ℕ = ℕ × ℕ), 21 diagram in a category, 11 diamond or Church-Rosser property, 3 dichotomous construction of Λ from prod-

ucts, 26 directed subset of a poset, 7

sups of retracts

bilimits and, 130 unions, 7

disjoint union trick for coding indexed fami-

lies, 102 disjunction fails in categories of retracts, 28 display maps

⟨dom, cod⟩ is a, 80 class of, 114 continuous fibrations give for IPO, 134 fibrations form a class of for Cat, 112 from indexed sum, 105 in, 102 in Retr(Λ), 127–129 in a polymorphic language, 98

projections in IPO give a class of, 34 distributes over ⋁ ; in a continuous lattice

inf, 47

in a profinite poset, inf_{↓}, 53 distributive lattices, 35

continuous, 48

continuous posets and completely, 49 is the hierarchy of categories of domains?,

67 no first-order theory for bifinitenes, 54

domain

saturated, 65 domain equations

in P ω, 23

recursive, 21, 37 down-closed subset of a poset, 7 down-set and slice over, 114 dropping a variable

D_{1} ↣ D_{2} is not by, 41

(X ◁ X^{X}), 14, 25

dynamic free variable problem, 78

effective topos, 94, 141, 144, 151 Eilenberg, Sammy, 73 elementary topos, 122 embedding continuous in algebraic posets, 47 embedding map between domains, 8, 42

of type dependences, 145 embeddings, category of ipos and, 39 empty domain problem, 78 enough constants, a monoid has, 10 enough models of the lambda calculus, a cat-

egory has, 24 enriched category, 85 enumerated types in PASCAL, 73 enumeration of λ terms in finitely many free

variables, 76 environmental approach to variables, 76 equalisers, products and, 13 equality on objects in a category, 37

function-space and type-of-types, 142 equational formulation of cartesian closure,

82 equivalence, beta, 2 Ershov, 24 essential geometric morphism, 91 essentially algebraic logic, 59 essentially algebraic sequent, 90 η-algebra or model, 7, 18

reflexive, 24 Euclidean domains (discussion of name for

ipos), 32 ev : Y^{X} × X → Y, evaluation map, 14 evaluation functors in a fibred category, 108 evaluation map in a cartesian closed category,

14 exactly well-powered, 122 exactness properties of toposes, 123 exponential = function-space, 14 exponential or function-space

as product over constant family, 104 in BiPos_{f}, 53 in IPO, 33 inherited by subcategories, 35 morphism, 114 spaces, characterisation of, 48

extensional typos, 141 extensionality of functional λ-terms, 7 extensionality, strong = η-rule, 7 extensions of groups, 112 external fixpoints = R_{1}, 24

F -algebra, 41 Facts, 42, 62 facts

filtered diagrams equivalent to ordinal

ones, 11 finite Karoubi-complete category has all

filtered (co)limits, 11 quasinormal form of lambda terms, 6

Fairbairn, Jon, 95, 96 faithful interpretation of λ-terms, 5 fallacy in [Taylor 1986], 131 fibration

bilimits of, 133 form a class of display maps for Cat, 112 from indexations of domains, 131, 133–

135, 138 of domains, composite of, 134 of groups, 112 pullbacks of, 111 split, 107

fibration of categories, 107 associated split, 120 cloven, 107 from class of display maps, 115

fibration, and projections: counterexamples,

131 fibre in a syntactic indexed category, 79 fibre product = pullback, 103 fibred adjoints, 110

categories, 106, 107 category of models for an algebraic the-

ory, 108 subcategories, 109 type, 131

fibres in, 102 field extensions form a bifinite category, 62 filter monad, characterisation of algebras for,

48 filtered colimits in diagram or category, 11 filtered colimits in preserving, and finitary al-

gebraic theories, 41 filtered colimits in small proper category hav-

ing all, 42 filtered colimits, and finite limits, 13 finitary algebraic theories, 41, 47 finitary algebraic theory, finite limits com-

mute with filtered colimits, 13 finite element of an algebraic poset, 46

objects in a category of domains, 65, 66 powerset, 1 spaces, 35

finite limits and filtered colimits, 13 lex category, 13

finitely approximable element of an algebraic

poset, 47 first order logic

indexed presentation as a hyperdoctrine,

83, 84 there is no theory for bifinite posets, 54

fixed point combinators, 3 fixed point set of an idempotent or retract, 8

in bifinite posets without bottom, 54 of functors, 38

fixed point, least, Tarski’s theorem, 7 flat domain, 68 flat lattice, 68 flavours of categories of domains, 59 font

subtle changes of, 2, 126 force colimit structure using a Grothendieck

topology, 90 subobject structure using a tripos, 84

formulae, atomic, 89 Forster, Thomas, 98 FORTRAN, 17, 73 Fourman, Michael, 78 fourteen subsets using closure and comple-

ment, 32 free algebra functor, 41

cartesian closed category with coercion,

20 combinatory prealgebra, 4 Heyting structure, 18

free boundedly complete continuous poset, 63 free combinatory algebra, 6 free continuous lattice, 47 free ring, 87 free variables in a λ-term, 1 Frege, 98 Freyd

paradox, 27, 94, 120, 144 function space = exponential, 14

contravariance of, 74 equality and type-of-types, 142

function, recursive, 3 functional λ-term, 5 functional abstraction (λ), 14 functor

preservation of retracts by, 9 functor between toposes

cartesian, 107 categories

indexed, 118 indexed or cartesian, 108 logical, 92 preserving models and reflexivity, 25

FV(a), set of free variables of a term a, 1

Γ(−) = C(1, −), global sections functor, 5 G = λyf.f(yf), fixpoint-generating combina-

tor, 3 Gabriel-Ulmer duality, 60 Galois models of the λ-calculus, 62 General Adjoint Functor Theorem, 120 generator in a concrete category, 11 generic, 76

λ-model, 152 determinant function, 89 display = type-of-types, 98 family = typos, 138 mono = subobject classifier, 122 morphism in a locally small category, 110,

117 object, 91 object in a small category, 110 object in an indexed category, 79 ring, 88 type, 94

geometric logic, 88

and polymorphism of sets, 91 geometric morphism, 123

morphism, bounded, 124 morphism, essential, 91 open, 92

geometric theory, 89 Girard, Jean-Yves, 94, 99 Giraud theorem, 88, 124 global elements in a concrete category, 11 global sections functor, 5 Gödel-Bernays set theory, 99 grammar, context-free, 81 graph model = P ω, 22 graph of a function, 13 Grothendieck

(co)topology, 67, 90

Alexander, 89 topos, 124

groups, fibrations of, 112 Guildford paper, fallacy in, 131 Gunter, Carl, 53

Hausdorff implies discrete specialisation or-

der, 32 head normal form for a λ-term, 6 Heyting algebra structure on ∀X.X → X,

153 Heyting algebra with R_{1} is degenerate, 28 Heyting system of types, 18 hierarchy of categories of domains, 67 hom-set is polymorphic not partial, 139 homology theory, application to categories of

domains, 67 homomorphism of domains, 41

explanation of name, 47 of ipos, pullbacks of, 43

homomorphism of groups is a fibration iff it

is surjective, 112 homomorphism of Heyting systems, 18 homomorphism of rings, 86 homomorphism substitution is a, 79 Hoofman, Raymond, 10 horizontal or cartesian map in a fibred cate-

gory, 102, 107 Horn theories, 59 Hosono and Sato, 24 Hyland, Martin, 6, 26, 28, 64, 84 hyperdoctrine, 83, 84

ICat, 40 I = λx.x, identity combinator, 2 ideal in a poset, 7 idempotent = retract, 8 identifier in a programming language, 77 image of an idempotent or retract, 8 implications between, reflexivity conditions,

25, 26 inconsistent database or query in PROLOG,

59 Ind C, 9 A-indexed family of objects, 101 A-indexed family of objects, type, 125 indexed adjoints, 110 indexed family of objects, 101 indexed fixpoints, 152 indexed functor categories, 118 indexed functors, 108 indexed natural transformations, 109 indexed of domains to fibrations, 131 indexed presentation of polymorphic lambda

calculus, 93 indexed product, 103

of retracts, 129 over T → 1, 148

indexed retracts, equivalence, 146 indexed structure preserved on the nose, 126,

127 indexed subcategories, 109 indexed sum, 105 indexed sum and raised sum, 148 indexed sums from class of display maps, 115 indexed sums of retracts, 128 indexed type, A-, 125 inductive categories, 40

partial order = ipo, 32 inflationary idempotent = closure, 24 information systems, 59 inhabited = has a map from 1, 24

every object in lex ccc implies degener-

ate, 28 injective space, 45

characterisation of, 48 densely, 63

internal categories, indexed presentation, 110 internal fixpoints = R_{2}, 24 internal product, 103 interpolation property of ≪ in a continuous

poset, 49 use in approximating type-dependences,

140 interpretation of λ-terms, faithful, 5 intersection of reflective subcategories, 42 intersections of retracts, 13 intervals in a lattice, 113 IPO, 32

continuous fibrations give a class of dis-

play maps for, 134 is cartesian closed relative to fibred types,

138 is cartesian closed relative to projections,

131 limit-colimit coincidence for embeddings,

39 limit-colimit coincidence for homomor-

phisms, 42 pullbacks of homomorphisms in, 43

isomorphic refinements in the Jordan-Hölder

theorem, 113 isomorphism is a structure not a property, 37

Johnstone, Peter, 32, 49, 101, 122, 151 Johnstone, Peter and Joyal, André, 47 Joyal, André, 142 juxtaposition, 1

K(C), Karoubi completion, 9 K = λxy.x, constant combinator, 2 K-spaces is R_{1} but not R_{2}, 27 Karoubi completion

concreteness of, 11

semigroup homomorphism and functors,

10 Karoubian completion, 9

in Retr(λ), 146 Kelly, Max, 85 König’s lemma, 12 Koymans, C.P.J., 1, 15

Λ, model of the untyped lambda calculus, 1 Λ is not degenerate, 3 Λ, set of closed lambda terms, closed term

algebra, 2 Λ^{+}, set of closed raw lambda terms, 1 λx, functional abstraction, 14 λx.a, the function which takes x to a, 1 lambda algebra or model, 18 lambda calculus, 1

as an indexed category, 82 continuous model, 24 definability, 3 terms, raw, 1

lambda terms, generated by S and K, 4 Lambek, Jim, 1 large category of domains, 59 lattices are retracts of all domains, 68 Lawvere

Bill, 83

presentation of an algebraic theory, 80,

88, 90 lax pullback of categories, 111 λη-terms, 7 least fixed point, Tarski’s theorem, 7 least preimage does not imply projection, 34 left Beck condition, 92 left-exact category = lex = has all finite lim-

its, 13, 80 LEGO, 85 lex category, algebraic theory as, 80, 81 lex ccc, every object inhabited implies degen-

erate, 28 liar paradox, 28 lifting, cartesian, 107 limit-colimit coincidence

for BiPos_{f}, 53 for IPO, 39, 42 for retracts in general, 38

has the, 38 limits

finite, lex category, 13 small (set-indexed), indexed formulation

of, 101, 103 limits of ipos do not carry the limit topology,

33 limits, finite, and filtered colimits, 13 Lindenbaum algebra, 83 Lindgren, Terry, 92 Linton, Fred, 32 λKβ-terms, 2 Λ(ℕ), open term model, 2 Loc is not well-powered, 122 locally cartesian closed, 104 locally closed subset of a space, 35 locally compact space, 47 locally connected geometric morphism, 92 locally finitely presentable category, 87 locally small category, 117

iff locally cartesian closed, 118 logical functor between toposes, 92 Λ(Σ), set of lambda terms in variables Σ, 2 Λ^{+}(Σ), set of raw lambda terms in variables

Σ, 1

M, set of functional elements of Λ, 15 μ = λfn⃗.Y[λhk.?(fkn⃗)k(h(Nk))]Z, Church’s

searching combinator, 3 Mac Lane, Saunders, 73, 112, 120 macro facilities in programming languages,

82 Mac Lane, Saunders, 1, 13 Manes, Ernest, 1 Martin-Löf, Per, 96, 99, 143 maximal class of displays for Retr(Λ), 130 maximal elements, zero-dimensional for con-

tinuous domains, 61 membership predicate, 84 mention, use and, 77 metavariables in a context free grammar, syn-

tactic, 82 Meyer, Albert, 76, 93 minimal upper bound = mub, 51 minimalisation = searching in recursive func-

tions, 3 model of the λ-calculus η-, 7 model of the λ-calculus finite powers of, 25 model of the λ-calculus generic and spectrum

of, 152 model of the λ-calculus lambda beta, 18 model of the λ-calculus with surjective pair-

ing, 64 model of the lambda calculus

continuous, 24 model, versus algebra, 7 modes = types in ALGOL 68, 77 modular lattice, 113 modus ponens = (⇒ E), 83 Moggi, Eugenio, 94 monad, 8 Mono_{A}(X) in a typos with equality, 142 monoid, constants in, 10 monotone = preserves order, 7 morphism of type dependences, 145 morphism, cartesian, 102 mub = minimal upper bound, 51 mub-closed subset of a poset, 51 mub-complete poset, 51

X and X^{X} algebraic implies, 56 mubc, set of finite mub-closed sets, 55 mutually convex subsets of a poset, 35

N = λxyz.y(xyz), Church’s successor combi-

nator, 3 name in a programming language, 77 names of types, 140 natural transformations, indexed or cartesian,

109 negative formulae in Horn logic, 59 New Foundations (Quine), 98 nondeterminism, 50 normal form for λ-terms, 2 nose, indexed structure preserved on the, 126,

127 numerals, Church’s, 3, 15, 93

object and meta-levels, confusion of, 37, 58 [C^{op}, Set], 9 open geometric morphism, 92 open sets, classifies, 46 open term model of the λ-calculus, 2 opfibration, 105 order relation between retracts gives compar-

ison, 130 overloading of operators in a programming

language, 73

P, is associative, 15 P = λfgx.g(fx), right-handed composition

combinator, 2 π : X → U, projection, 8 π_{0} : X × Y → X, left product projection, 14 π_{1} : X × Y → Y, right product projection,

14 pairing, model with surjective, 64 paradox

Burali-Forte, 99 Freyd’s, 27 liar, 28

paradoxical combinator (Y), 3 Park, David, 23, 41 parsing of a context-free grammar, 77

of raw λ-terms, 1 partial functions, 60 partial lattices, 60 partial order = ipo, complete, 32 partitions of a space, characterisation of fi-

nite, 35 PASCAL, 73 P_{f}(X), finite powerset, set of finite subsets

of a set X, 1 P GL, projective linear group, 10 Pitts, Andrew, 84, 138, 143, 151 Platonic form of the identity function, 92 Plotkin, Gordon, 7, 21, 32, 50, 51, 56, 60 Plotkin, Gordon and Smyth, Mike, 37 Plotkin, Gordon, and Smyth, Michael, 21 P ω gives a typos, 141 po-hyperdoctrine, 84 pointed endofunctor, 38 polymorphic lambda calculus, indexed pre-

sentation of, 93 polymorphism, 73

interpretation in V, 148

of sets, 91

of the ∈ relation, 98 PONDER, 74, 96 poset

bifinite, 50 profinite, 53

Pos_{f} is R_{2} but not R_{3}, 27 positional matching of subroutine arguments,

77 positive formulae in Horn logic, 59 powerdomain construction, 50 powers of models, 25 preserves directed joins, 7 preserves the root of a bifinite poset, a func-

tor, 53 prime element of a distributive lattice, 54 primitive recursive functions, 3 product, 14

and equalisers in fibres, 103

and exponentials inherited by subcate-

gories, 35 as retract of X_{3}, 17 countable

in Retr(Λ), 68 in IPO, 33 indexed, 103 indexed by mor C give a complete lattice,

27 indexed by ob C give a λβ-model, 26 of retracts, indexed, 129 over constant family = exponential, 104 production rules in a context free grammar,

81 profinite posets, 53 projection map between domains, 8, 42

IPO are carrable, 34

IPO is cartesian closed relative to, 131 category of ipos and, 39 not carrable in categories of domains,

131 not implied by least preimage, 34

projection, product, 14

projective general linear group, 10

proliferated substitution is stronger than si-

multaneous, 85 proliferation of free variables, 78 PROLOG, 59 proof theory and type theory, 75 pseudopullback of categories, 110 pullback against projections fails in categories

of domains, 131 pullback carrable =, 34 pullback in IPO, 34, 43 pullback of categories, 110 pullback of displays of retracts, 128 pullback of homomorphisms in bcCont, 69 pullback of homomorphisms in BiPos_{f}, 70 pullbacks

composition lemmas for, 13 pushout form of the Church-Rosser Theorem,

3

Q, 125

Q = λfgax.ga(fax), fibred composition com-

binator, 2 queries in a PROLOG database, 59 Quine, Victor, 98

radio mast

is not algebraic, 57 radio mast, a coherent algebraic but not bifi-

nite poset, 52 raised sum and indexed sum, 148 raised sum in P ω, 23 raised sum of domains, 68 Ramsey, Frank, 98 range of a variable in a program, 77 raw lambda terms, 1 realisability tripos, 152 record structures in programming languages,

73 recursive domain equation, 21, 37

and V, 147 in P ω, 23

recursive function, 3 recursively decidable, hierarchy of boundedly

complete domains is, 67 a reduced to A, 16 f reduced to domain A and codomain B, 17 reduced to (by a retract), 8, 16, 17 refint in ALGOL 68, 77 refinements in the Jordan-Hölder theorem,

isomorphic, 113 reflected in (by a retract), 8 reflection = left adjoint to inclusion, 8 reflective subcategory, 8

intersection of, 42 reflexivity or fixpoint conditions, 24

implications between, 25, 26 in IPO, 33 reverse implications between, 27 stability under retracts, 25

regular action of a monoid on itself, 10 regular representation of a category, 79 relabelling = substitution functor in an in-

dexed category, 101 relative slice category, 114 relatively cartesian closed, 116

Retr(Λ) is, 129 category with generic family = typos,

139 domains and fibred types, 138

Replacement, Axiom of, 102 representation of a category, regular, 79 Retr(Λ)

category of retracts of λ-algebra Λ, 15 concrete iff Λ is a model, 16 function spaces, 17 objects, morphisms, identity, composi-

tion, idempotents split, 16 products, 17

retracts = idempotents, 8 bilimits of, 69 category of is realtively cartesian closed,

129 composed, 9 countable products of, 68 displays of, 127–129 in P ω, strict, 23 intersection of, 13 limit-colimit coincidence for general, 38 of a model of the λ-calculus, 18 of continuous poset is continuous, 48 order relation between gives comparison,

130 stability of reflexivity conditions under,

25 retracts, splitting equivalent to finite filtered

(co)limits, 11 reverse implications between reflexivity con-

ditions, 27 right Beck condition, 92 right-handed composition in categories, 1, 8 rings (commutative), 80, 86

fibred category of, 108 root of a bifinite poset, 53 Rosolini, Giuseppe, 43, 151 rule, α-, 78 rule, η-, 7 Russell, Bertrand, 98, 99, 120, 143

S = λxyz.xz(yz), 2 Σ, collection of symbols, 1 satisfies a logical sequent, a model, 89 saturated domain, 25, 65

in BiPos_{f}, 70

type-dependence, 143 Schönfinkel, 17 scope of a variable in a program, 77 Scott topology of a continuous poset

characterisation of, 49

continuous function between domains, 40 on P ω, 22 on an ipo, 32

Scott, Dana, 21, 23, 24, 37, 47, 50, 59, 64,

146 Scott, Phil, 1 searching = minimalisation in recursive func-

tions, 3 second order polymorphic lambda calculus,

74 section = pre-inverse, 8, 103 seed of solution of recursive domain equation,

38 Seely, Robert, 83, 84, 94 semantics, use of the word, 23 semigroup homomorphisms and the Karoubi

construction, 10 semilcolon (;) for right-handed composition

in categories, 1, 8 sensible model of the λ-calculus, 6 sequence of finite computers, 50

finite partial orders, 50 sequencing = composition, 1 set-abstraction, 98 set-indexed limits, indexed formulation of, 101 SFP = Bi_{ω} Pos_{f}, 50 sheaves, functor embedding Loc or, 89 Sierpiński space, 45

retracts of powers of, 48 sieve = crible in a Grothendieck topology, 90 similarity of domains and categories of do-

mains, 40 simultaneous substitution, 79 site = Grothendieck topology, 88 size of categories of domains, 40 SKIM, 4 slice category, 102

relative, 114 small category (locally) iff locally cartesian

closed, 118 small category for the general adjoint functor

theorem, initially, 121 small category indexed presentation, 110 small category locally = has small hom-sets,

117 small category of domains, 59 small limits, indexed formulation of, 101 Smyth, Michael, 50, 56, 152 sober, Scott topology need not be, 32 solution set condition, 121 sorts in a context free grammar, syntactic, 81 space of rings, 89 space, Grothendieck topos is a generalised,

89 special adjoint functor theorem, 123 specialisation order on a space, 32 spectrum of a λ-model, 152

of a distributive lattice, 35 split fibration, 107

associated, 120 split retracts, Karoubi construction to, 9 splits through

injections of finite spaces, 37 retract, 8 surjections onto finite spaces, 35

splitting retracts, equivalent to finite filtered

(co)limits, 11 step function ([x ⇒ y]) between continuous

posets, 49 stratification, 74 strict retract in P ω, 23 strong limit cardinal, 56 strongly typed programming language, 17, 73 structure map of an F -algebra, 41 structures in programming languages, 73 subcategories IPO (full ccc) inherit struc-

ture, 35 subcategories indexed, 109 subcategories reflective, 8 subnormal series of subgroups, 113 subobject, 122

classifier (Ω), 123 subroutine arguments, positional matching,

77 subsemilattice of a boundedly complete poset,

66 substitution ([x := y]), 1, 78, 79, 101 subterm, 1 subterms, 1 sum indexed, 105 sum of retracts, indexed, 128 sum raised, in P ω, 23 supremum = least upper bound: adjoint func-

tor theorem, 120 surjections onto finite spaces, 35 surjective pairing (X = X × X), 64 surjective pairing (X = X × X), 23, 26 Surrey paper, fallacy in, 131 symbol table in a compiler, 77 syntactic sorts and metavariables in a context

free grammar, 81 synthesis, analysis and, 76

T = K⊥, terminal object of Retr(Λ), 16 T , 60 T_{0}, 32 T_{0}, but not T_{1}, Sierpiński space is retract, 45 tag field in a progarmming language, 73 Tarski Domain = ipo, 32 Tarski’s theorem, 7, 27, 31, 32, 37, 54 Tennison, Barry, 89 tensor product in an enriched category, 85 (T, ϵ, ν), comonad, 8 term algebra, closed, 2 terminal object, 14 terms, λ-, 2 Teta(T, η, μ), monad, 8 tokenisation as part of compilation, 77 top

ω_{⊥} is a retract of any domain without,

68 its irrelevance to computation, 50

topos, elementary, 122 transfinite construction for Tarski’s theorem

and its converse, 31 transition, beta, 2 tripos, 84 Turing, Alan, 3 Tychonov topology on product of ipos, 33 type assignment, 97 type checking, 73 type constructions as V-valued functions, 146 type dependence, saturated, 143 type of types combinator in P ω, 24 type theory and proof theory, 75 type-of-types, 75, 95

and universal set, 125

equality and function-space, 142

morphisms in, 138–140 typical ambiguity (Russell), 98 typos, 138

Bi_{ω} Pos_{f} is a, 145 P ω gives a, 141 internal, 151 use of the word, 151 with equality, 99, 142

⋃ ; , directed union, 7 underlying Heyting system, 18 underlying set functor for rings, 86 unification algorithm, 59 Universal Algebra, 80 universal set and set-of-sets, 125 unsolvable λ-term, 6 upper bound = mub, minimal, 51 use and mention, 77

V V-valued functions and type constructions,

146 V in P ω, 24 ⋁ ; , directed join or sup, 7 variables

as generators in algebraic theory, 76 binding, 77 discussion of rôle of, 75 enumeration of λ terms in finitely many

free, 76 in a λ-term, free, 1

variant records, 73 vertical morphism in a fibred category, 102,

107 vertical opposite category, 105 vertically mono, 122

warnings cartesian closed, 14 concrete category, 11 font changes, 2 right-handed composition, 8

way below relation in a continuous poset (≪),

47 weakly well-powered category, 122

locally cartesian closed category, 125, 142 weight of a continuous poset, 59 well-powered category, 122 Whitehead, Alfred, 98

X × Y, product, 14 ×, product combinator, 17

Y, 26

Y, least fixed point combinator in continuous

models, 24 Y = λf.(λx.f(xx))(λx.f(xx)), fixpoint com-

binator, 2, 3 Yoneda lemma, 10

Z = λxy.y, Church’s zero numeral, 3

zero-dimensional, maximal elements in con-

tinuous domains, 61 zig-zag lemma, 64