To save content items to your account,
please confirm that you agree to abide by our usage policies.
If this is the first time you use this feature, you will be asked to authorise Cambridge Core to connect with your account.
Find out more about saving content to .
To save content items to your Kindle, first ensure no-reply@cambridge.org
is added to your Approved Personal Document E-mail List under your Personal Document Settings
on the Manage Your Content and Devices page of your Amazon account. Then enter the ‘name’ part
of your Kindle email address below.
Find out more about saving to your Kindle.
Note you can select to save to either the @free.kindle.com or @kindle.com variations.
‘@free.kindle.com’ emails are free but can only be saved to your device when it is connected to wi-fi.
‘@kindle.com’ emails can be delivered even when you are not connected to wi-fi, but note that service fees apply.
This book is not about type theories in general but about one very neat and special system called “TA” for “type-assignment”. Its types contain type-variables and arrows but nothing else, and its terms are built by λ-abstraction and application from term-variables and nothing else. Its expressive power is close to that of the system called simple type theory that originated with Alonzo Church.
TA is polymorphic in the sense that a term can have more than one type, indeed an infinite number of types. On the other hand the system has no ∀-types and hence it is weaker than the strong polymorphic theories in current use in logic and programming. However, it lies at the core of nearly every one of them and its properties are so distinctive and even enjoyable that I believe the system is worth isolating and studying on its own. That is the aim of this book. In it I hope to try to pass on to the reader the pleasure the system's properties have given me.
TA is also an excellent training ground for learning the techniques of type-theory as a whole. Its methods and algorithms are not trivial but the main lines of most of them become clear once the basic concepts have been understood. Many ideas that are complicated and tedious to formulate for stronger type-theories, and many complex techniques for analysing structures in these theories, appear in TA in a very clean and neat stripped-down form.
One of the most interesting facts about TAλ is that there is a very close correspondence between this system and propositional logic, in which the types assignable to closed terms in TAλ turn out to be exactly the formulae provable in a certain formal logic of implication. This correspondence is often called the Curry-Howard isomorphism or the formulae-as-types isomorphism, and will be studied in this chapter.
The logic involved in this correspondence is not the classical logic of truth-tables however, but that of the intuitionist philosophers; it will be defined in the first section below.
The Curry-Howard isomorphism was first hinted at in print in Curry 1934 p.588, and was made explicit in Curry 1942 p.60 footnote 28 and Curry and Feys 1958 §9E. But it was viewed there as no more than a curiosity. The first people to see that it could be extended to other connectives and quantifiers and used as a technical tool to derive results were N. G. de Bruijn, William Howard and H. Läuchli in the 1960's. See Howard 1969, de Bruijn 1980 (an introduction to de Bruijn's AUTOMATH project which began in the 1960's), and Läuchli 1965.
This chapter will also define three rather interesting subsystems of intuitionist logic and show that they correspond to the three restricted classes of λ-terms defined in Section ID. This correspondence was first noted by Carew Meredith in unpublished work around 1951 and was explored in detail in the thesis Rezus 1981.
The λ-calculus is a family of prototype programming languages invented by a logician, Alonzo Church, in the 1930's. Their main feature is that they are higherorder; that is, they give a systematic notation for operators whose input and output values may be other operators. Also they are functional, that is they are based on the notion of function or operator and include notation for function-application and abstraction.
This book will be about the simplest of these languages, the pure λ-calculus, in which λ-terms are formed by application and abstraction from variables only. No atomic constants will be allowed.
λ-terms and their structure
Definition (λ-terms) An infinite sequence of term-variables is assumed to be given. Then linguistic expressions called λ--terms are defined thus:
each term-variable is a λ-term, called an atom or atomic term;
if M and N are λ-terms then (MN) is a λ-term called an application;
if x is a term-variable and M is a λ-term then (λx. M) is a λ-term called an abstract or a λ-abstract.
A composite λ-term is a λ-term that is not an atom.
Notation Term-variables are denoted by “u”, “v”, “w”, “x”, “y”, “z”, with or without number-subscripts. Distinct letters denote distinct variables unless otherwise stated.
Arbitrary λ-terms are denoted by “L”, “M”, “N”, “P”, “Q”, “R”, “S”, “T”, with or without number-subscripts. For “λ-term” we shall usually say just “term”.
The topic of this book is one of the simplest current type-theories. It was called TA in the Introduction but in fact it comes in two forms, TAc for combinatory logic and TAλ for λ-calculus. Since most readers probably know λ-calculus better than combinatory logic, only TAλ will be described here. (The reader who wishes to see an outline of TAC can find one in HS 86 Ch.14; most of its properties are parallel to those of TAλ.)
The present chapter consists of a definition and description of TAλ. It is close to the treatment in HS 86 Ch. 15 but differs in some technical details.
The system TAλ
Definition (Types) An infinite sequence of type-variables is assumed to be given, distinct from the term-variables. Types are linguistic expressions defined thus:
each type-variable is a type (called an atom);
if σ and τ are types then (σ→τ) is a type (called a composite type).
NotationType-variables are denoted by “a”, “b”, “c”, “d”, “e”, “f”, “g”, with or without number-subscripts, and distinct letters denote distinct variables unless otherwise stated.
Arbitrary types are denoted by lower-case Greek letters except “λ”.
Parentheses will often (but not always) be omitted from types, and the reader should restore omitted ones in such a way that, for example,
ρ→σ→τ ≡ (ρ→(σ→τ)).
This restoration rule is called association to the right.
Informal interpretation To interpret types we think of each type-variable as a set and σ→τ as a set of functions from σ into τ.
In Chapter 2 some care was taken to distinguish the Curry and Church approaches to type-theory from each other. Curry's approach involved assigning types to preexisting untyped terms with each term receiving either an infinite set of types or none at all, whereas in Church's the terms were defined with built-in types with each term having a single type (see 2A3). In Curry's approach the types contained variables, in Church's they contained only constants.
This book focuses on the Curry approach. However, even in this approach it turns out to be very useful to introduce a typed-term language as an alternative notation for TAλ-deductions. Although the tree-notation introduced in Chapter 2 shows very clearly what assumptions are needed in deducing what conclusions, it takes up a lot of space and is hard to visualise when the deduction is in any way complicated. And when manipulations and reductions of deductions are under discussion it is almost unmanageable. A much more compact alternative notation is needed, and this is what the typed terms in the present chapter will give.
We shall also define reduction of typed terms; typed terms will be shown in the next chapter to encode deductions in propositional logic as well as in TAλ, and their reduction will be essentially the same as the reduction of deductions that is a standard tool in proof theory.
This chapter combines the theme of propositional logic from Chapter 6 with that of principal types from Chapter 3. We saw in the Curry-Howard theorem (6B7) that the types of the closed terms are exactly the theorems of the intuitionist logic of implication: hence the principal types of these terms must form a subset of these theorems, and the very natural question arises of just how large this subset is. Do its members form an aristocracy distinguished in some structural way from the general rabble of theorems, or can every theorem be a principal type?
The main result of the chapter will show that there is in fact no aristocracy: if a type τ is assignable to a closed term M but is not the principal type of M, then it is the principal type of another closed term M*.
The proof will include an algorithm to construct M* when τ and M are given. To build M* an occurrence of M will be combined with some extra terms chosen from a certain carefully defined stock of “building blocks”, closed terms with known principal types; and the main aim of this chapter will be to build M* from as restricted a set of building blocks as possible.
The algorithm in the earliest known proof needed full λ-calculus (Hindley 1969), but two later ones used only λI-terms as building blocks (Mints and Tammet 1991, Hirokawa 1992a §3) and another used an even more restricted class (Meyer and Bunder 1988 §9). The algorithm below will be based on the latter very economical one.
To avoid interrupting the main lines of thought in the earlier chapters some concepts were defined there only in outline and their main properties were stated without proof. This chapter gives the full definitions and proofs. It should be read only as required to follow the arguments in the other chapters. Its sections are largely independent of each other.
The structure of a term
From the viewpoint of logical order this section is best read between 1A3 and 1A4.
As remarked in 1A4, a subterm of a term may have more than one occurrence. The present section introduces a precise notation to distinguish such different occurrences; it is rather clumsy and the reader should avoid using it whenever possible, but in some proofs its precision will be vital. The first step is to define a set of expressions called positions that can be assigned to different occurrences of a subterm to show where they occur.
Definition (Positions) A positionp = i1 … im is any finite (perhaps empty) string of symbols such that i1, …, im are integers and im is either an integer or an asterisk, *. Its length is m, and if m = 0 we say p = Ø.
If m ≥ 1 and im = 1 we call p a function position;
If m ≥ 1 and im = 2 we call p an argument position;
if m ≥ 1 and im = 0 we call p a body position; and
if m ≥ 1 and im = * we call p an abstractor position.
Given a type τ, how many closed terms can receive type τ in TAλ? As stated this question is trivial, since if the answer is not zero it is always infinite; for example the type a→a can be assigned to all members of the sequence I, II, III, etc. But if we change the question to ask only for terms in normal form, the answer is often finite and interesting patterns show up which are still not completely understood.
The aim of this chapter is to describe an algorithm from Ben-Yelles 1979 that answers the “how many” question for normal forms. For each τ it will decide in a finite number of steps whether the number of closed β-normal forms that receive type τ is finite or infinite, will compute this number in the finite case, and will list all the relevant terms in both cases.
Ben-Yelles' algorithm can be used in particular to test whether the number of terms with type τ is zero or not, and as mentioned in 6B7.3 this gives a test for provability in Intuitionist implicational logic.
The first section below will describe the sets to be counted. The next will show some examples of the algorithm's strategy in action. Then in 8C–D the algorithm will be stated formally, and the rest of the chapter will be occupied by a proof that the algorithm does what it claims to do.
Inhabitants
This section gives precise definitions and notations for the sets to be counted.
Quantum theory is well known for having a nonclassical and somewhat peculiar logic. One approach to trying to make this logic comprehensible is by means of what is called a “manual of experiments.” This is the approach taken, for example, in the book An Introduction to Hilbert Space and Quantum Logic (Cohen, 1989), which we use as our main reference. A manual is thought of as describing a variety of different tests of a system, but where the making of one test may, for some reason, preclude the making of some other test of the same system at the same time. Still, it can happen that from performing one kind of experiment we may get information about what the outcome would have been had we performed another kind of experiment.
Example 21.1. Here is an example taken from 17). Imagine a firefly trapped inside a box, and two kinds of experiments, front and side, one can perform when observing this box at a given instant. In a front experiment one looks in the box from the front, whereas in side one looks from the right-hand side. In front there are three possible outcomes: one may see the firefly light lit up on the right (r), lit up on the left (l), or not lit up at all (n). Similarly, in side there are three possible outcomes: one may see the firefly light at the front (f), at the back (b), or not at all (n).