approximation theorems for intersection type...

23
Approximation Theorems for Intersection Type Systems MARIANGIOLA DEZANI-CIANCAGLINI, Dipartimento di Informatica, Universit` a di Torino, Corso Svizzera 185, 10149 Torino, Italy. E-Mail: [email protected] FURIO HONSELL, Dipartimento di Matematica ed Informatica, Universit` a di Udine, Via delle Scienze 208, 33100 Udine, Italy. E-Mail: [email protected] YOKO MOTOHAMA, Dipartimento di Informatica, Universit` a di Torino, Corso Svizzera 185, 10149 Torino, Italy. E-Mail: [email protected] Abstract In this paper we prove that many intersection type theories of interest (including those which induce as filter models, Scott’s and Park’s models, the models studied in Barendregt Coppo Dezani, Abramsky Ong, and Honsell Ronchi) satisfy an Approximation Theorem with respect to a suitable notion of approximant. This theorem implies that a -term has a type if and only if there exists an approximant of that term which has that type. We prove this result uniformly for all the intersection type theories under consideration using a Kripke version of stable sets where bases correspond to worlds. Keywords: -calculus, intersection types, approximation theorem, set-theoretical semantics of types. 1 Introduction Intersection types were introduced in the late 1970s by Dezani and Coppo [8, 9, 6], to over- come the limitations of Curry’s type discipline. They are a very expressive type language which allows one to describe and capture various properties of -terms. For instance, they have been used in [27] to give the first type theoretic characterization of strongly normaliz- able terms and in [10] to capture persistently normalizing terms and normalizing terms. See [13] for a more complete account of this line of research concerning intersection types. Intersection types have also a very significant realizability semantics with respect to ap- plicative structures. This is a generalization of Scott’s natural semantics [31] of simple types. According to this interpretation, types denote subsets of the applicative structure, arrow types denoting the sets of terms which map all terms belonging to the interpretation of into terms belonging to the interpretation of , and intersection types denoting the intersections of the interpretation of and the interpretation of . Building on this, intersec- tion types have been used in [6] to give a proof of the completeness of the natural semantics of Curry’s simple type assignment system in applicative structures, introduced in [31]. See [12] for a more complete treatment of the completeness problem of intersection type assignment systems. J. Logic Computat., Vol. 11 No. 3, pp. 395–417 2001 c Oxford University Press

Upload: phungnguyet

Post on 21-Mar-2018

218 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: Approximation Theorems for Intersection Type Systemsuros.m/logcom/hdb/Volume_11/Issue_03/pdf/110395.pdffor a more complete treatment of the ... to Abramsky’s‘domaintheoryin logical

Approximation Theorems forIntersection Type Systems

MARIANGIOLA DEZANI-CIANCAGLINI, Dipartimento di Informatica,Universita di Torino, Corso Svizzera 185, 10149 Torino, Italy.E-Mail: [email protected]

FURIO HONSELL, Dipartimento di Matematica ed Informatica, Universitadi Udine, Via delle Scienze 208, 33100 Udine, Italy.E-Mail: [email protected]

YOKO MOTOHAMA, Dipartimento di Informatica, Universita di Torino,Corso Svizzera 185, 10149 Torino, Italy.E-Mail: [email protected]

AbstractIn this paper we prove that many intersection type theories of interest (including those which induce as filter models,Scott’s and Park’s D1 models, the models studied in Barendregt Coppo Dezani, Abramsky Ong, and HonsellRonchi) satisfy an Approximation Theorem with respect to a suitable notion of approximant. This theorem impliesthat a �-term has a type if and only if there exists an approximant of that term which has that type. We prove thisresult uniformly for all the intersection type theories under consideration using a Kripke version of stable sets wherebases correspond to worlds.

Keywords: �-calculus, intersection types, approximation theorem, set-theoretical semantics of types.

1 Introduction

Intersection types were introduced in the late 1970s by Dezani and Coppo [8, 9, 6], to over-come the limitations of Curry’s type discipline. They are a very expressive type languagewhich allows one to describe and capture various properties of �-terms. For instance, theyhave been used in [27] to give the first type theoretic characterization of strongly normaliz-able terms and in [10] to capture persistently normalizing terms and normalizing terms. See[13] for a more complete account of this line of research concerning intersection types.

Intersection types have also a very significant realizability semantics with respect to ap-plicative structures. This is a generalization of Scott’s natural semantics [31] of simple types.According to this interpretation, types denote subsets of the applicative structure, arrow typesA ! B denoting the sets of terms which map all terms belonging to the interpretation of Ainto terms belonging to the interpretation of B, and intersection types A \ B denoting theintersections of the interpretation of A and the interpretation ofB. Building on this, intersec-tion types have been used in [6] to give a proof of the completeness of the natural semantics ofCurry’s simple type assignment system in applicative structures, introduced in [31]. See [12]for a more complete treatment of the completeness problem of intersection type assignmentsystems.

J. Logic Computat., Vol. 11 No. 3, pp. 395–417 2001 c Oxford University Press

Page 2: Approximation Theorems for Intersection Type Systemsuros.m/logcom/hdb/Volume_11/Issue_03/pdf/110395.pdffor a more complete treatment of the ... to Abramsky’s‘domaintheoryin logical

396 Approximation Theorems for Intersection Type Systems

But intersection types have also an alternative semantics, based on duality, which is relatedto Abramsky’s ‘domain theory in logical form’ [1]. This semantics amounts to the applicationof that paradigm to the special case of !-algebraic complete lattice models of pure lambdacalculus, [11]. Namely, types correspond to compact elements: the type denoting theleast element, intersections denoting joins of compact elements, and arrow types denotingstep functions of compact elements. According to this semantics, a typing judgment canbe interpreted as saying that a given term belongs to a pointed compact open set in a !-algebraic complete lattice model of �-calculus. Hence, by duality, type theories give rise tofilter �-models. Intersection type assignment systems can then be viewed as finitary logicaldefinitions of the interpretation of �-terms in such models, hence the meaning of a �-term isthe set of types which are deducible for it.

This duality lies at the heart of the success of intersection types as a powerful tool both forthe analysis and the synthesis of �-models [2, 6, 11, 10, 3, 15, 19, 14, 26, 18, 28].

As proved in [3, 11, 4] there is a very large class of !-algebraic models which have naturalreadings as filter models. This class includes for example all the D1 inverse limit models,such as Scott’s [31] and Park’s models [23], the model in [2] which has been studied inconnection with the lazy �-calculus, and the model [6] which realizes equality of Bohm trees[29].

It is often the case that the very nature of the syntactical properties of �-terms that one isinterested in might suggest a particular intersection types theory, which induces a filter modelwhich captures semantically such properties. Important examples in this respect are the D1limit models characterizing normalizing terms [10] and terms reducible to �-I-calculus [19],respectively.

A crucial result in the study of the fine structure, and hence the �-theory, of !-algebraic�-models is the, so called, approximation theorem, [33, 21, 7, 30, 19]. An approximationtheorem allows one to express the interpretation of any �-term, even a non terminating one,as the supremum of the interpretations of suitable normal forms, called the approximantsof the term, in an appropriate extended language. Approximation theorems are very usefulin proving, for instance, computational adequacy of models with respect to operational se-mantics [7, 19]. There are other possible methods of showing computational adequacy, bothsemantical and syntactical [2, 33, 19, 24], but the method based on approximation theoremsis usually the most straightforward. However, proving an approximation theorem for a givenmodel theory is usually rather difficult. Most of the proofs in the literature are based on thetechnique of indexed reduction [33, 19].

However, when the model in question is a filter model, by applying duality, the approxi-mation theorem can be rephrased as follows: the types of a given term are all and only thetypes of its approximants. This change in perspective opens the way to proving approxima-tion theorems using the syntactical machinery of proof theory, such as logical predicates andcomputability techniques.

The aim of the present paper is to show in a uniform way that all the type assignmentsystems which induce filter models isomorphic to the models in [2, 6, 30, 19, 10] satisfy theApproximation Theorem. To this end we use a technique which can be construed as a versionof stable sets over a Kripke applicative structure [22].

The present paper is organized as follows. In Section 2 we present type assignment sys-tems for intersection types and we prove some meta-theoretic properties including a genera-tion theorem and subject conversion. In Section 3 we introduce approximants and we provethe approximation theorem using a Kripke interpretation of intersection types in which the

Page 3: Approximation Theorems for Intersection Type Systemsuros.m/logcom/hdb/Volume_11/Issue_03/pdf/110395.pdffor a more complete treatment of the ... to Abramsky’s‘domaintheoryin logical

Approximation Theorems for Intersection Type Systems 397

bases play the role of worlds. In Section 4 we give some applications of the approximationtheorems. Finally we mention directions for future work.

2 Intersection type theories and type assignment systems

Intersection types are syntactical objects built inductively by closing a given set C of typeatoms (constants) under the function type constructor! and the intersection type constructor\. We always assume that the universal type is a member ofC.

DEFINITION 2.1 (Intersection type languages)The intersection type language over C, denoted by T = T(C), is defined by the followingabstract syntax:

T = C j T!T j T \T:

NOTATION 2.2Upper case Roman letters, i.e. A;B; : : :, will denote arbitrary types. In writing intersection-types we shall use the following convention: the constructor \ takes precedence overthe constructor ! and both associate to the right. Moreover An ! B abbreviatesA! � � � ! A| {z }

n

! B.

Much of the expressive power of intersection type disciplines comes from the fact thattypes can be endowed with a preorder relation �, which induces the structure of a meetsemi-lattice with respect to \, the top element being .

DEFINITION 2.3 (Intersection type preorder)Let T = T(C) be an intersection type language. An intersection type preorder over T is abinary relation � on T satisfying the following set 50 (‘nabla-zero’) of axioms and rules:

(refl) A � A (idem) A � A \A

(inclL) A \ B � A (inclR) A \B � B

(mon)A � A0 B � B0

A \B � A0 \ B0(trans)

A � B B � C

A � C

() A � (!-\) (A!B) \ (A!C) � A!B \ C

(�)A0 � A B � B0

A!B � A0!B0

NOTATION 2.4We will write A � B for A � B and B � A.

Notice that associativity and commutativity of \ (modulo�) follow easily from the aboveaxioms and rules.

NOTATION 2.5Being \ commutative and associative, we will write

Ti�nAi for A1 \ : : : \ An. Similarly

we will writeTi2I Ai. We convene that I; J;K etc., when referred to as sets of indexes for

types, always denote finite non-empty sets.

The meaning of the above axioms and rules can be grasped if we take types to denotesubsets of a domain of discourse and we view \ as set-theoretic intersection and ! as the

Page 4: Approximation Theorems for Intersection Type Systemsuros.m/logcom/hdb/Volume_11/Issue_03/pdf/110395.pdffor a more complete treatment of the ... to Abramsky’s‘domaintheoryin logical

398 Approximation Theorems for Intersection Type Systems

(-�) � !

(-lazy) A!B � !

(!-Scott) !! � !

(!-Park) !!! � !

(!') ! � '

('!!) '!! � !

(!!') !!' � '

(I) ('!') \ (!!!) � '

FIGURE 1. Some special purpose axioms concerning�

function space constructor in the light of Curry–Scott semantics [32]. Thus the type A!Bdenotes the set of total functions which map each element of A into an element of B.

The intended interpretation of arrow types motivates axiom (!-\), which implies that if afunction maps A into B, and the same function maps also A into C, then, actually, it mapsthe whole A into the intersection between B and C (i.e. into B \ C), see [6].

Rule (�) is also very natural in view of the set-theoretic interpretation. It implies that thearrow constructor is contravariant in the first argument and covariant in the second one. It isclear that if a function maps A into B, and we take a subset A0 of A and a superset B0 of B,then this function will map also A0 into B0, see [6].

Clearly axiom () implies that is the top element.Possibly effective, syntactical presentations of intersection type preorders can be given

using the notion of intersection type theory. An intersection type theory always includes thebasic set 50 for � and possibly other special purpose axioms and rules.

DEFINITION 2.6 (Intersection type theories)Let T = T(C) be an intersection type language, and let 5 be a set of axioms and rulesfor deriving judgments of the shape A � B, with A;B 2 T. The intersection type theory�(C;5) is the set of all judgmentsA � B derivable from the axioms and rules in 50 [5.

NOTATION 2.7When we consider the intersection type theory �(C;5), we will write:

C5 forC; T5 forT(C); �5 for �(C;5):

Moreover A �5 B will be short for (A � B) 2 �5. Finally we will write A�5B forA �5 B �5 A.

Figure 1 shows a list of special purpose axioms which have been considered in the litera-ture.

Interpreting as the maximal element, i.e. the whole universe, then ! is the set offunctions which applied to an arbitrary element return again an arbitrary element. Thus, ax-iom (-�) expresses the fact that all the objects in our domain of discourse are total functions,i.e. that is equal to ! [6].

Page 5: Approximation Theorems for Intersection Type Systemsuros.m/logcom/hdb/Volume_11/Issue_03/pdf/110395.pdffor a more complete treatment of the ... to Abramsky’s‘domaintheoryin logical

Approximation Theorems for Intersection Type Systems 399

CAO = fg AO = f(-lazy)g

CBCD = fg [C1 BCD = f(-�)g

CSc = f; !g Sc = BCD [ f(!-Scott)g

CPa = f; !g Pa = BCD [ f(!-Park)g

CCDZ = f; '; !g CDZ = BCD [ f(!'); ('!!); (!!')g

CHR = f; '; !g HR = BCD [ f(!'); (I); ('!!)g

FIGURE 2. Type theories: atoms and axioms

If we want to capture only those terms which truly represent functions, as we do for ex-ample in the lazy �-calculus, we cannot assume axiom (-�). One may still postulate theweaker property (-lazy) to make all functions total [2]. This axiom simply says that anelement which is a function, because it maps A into B, maps also the whole universe intoitself.

The remaining axioms express particular properties of D1-like inverse limit models, see[11, 10, 19, 17].

We introduce in Figure 2 a list of intersection type theories which are significant vis a visfor the model theory of untyped �-calculus, because each one induces a filter �-model. Weshall denote such theories as�5, with various different names5 corresponding to the initialsof the authors who have first considered the �-model induced by such a theory [2, 6, 31, 23,10, 19]. For each such 5 we specify in Figure 2 the type theory �5 = �(C;5) by givingthe set of constants C5 and the set 5 of extra axioms taken from Figure 1. Here C1 is aninfinite set of fresh atoms, i.e. different from ; '; !.

Now that we have introduced intersection type theories we have to explain how to capitalizeeffectively on their expressive power. This is achieved via the crucial notion of intersectiontype assignment system. This is a natural extension of Curry’s type assignment system tointersection types. First we need some preliminary definitions and notations.

DEFINITION 2.81. A5-basis is a set of statements of the shape x:B, whereB 2 T5, all of whose variables

are distinct.

2. �; x:A is short for � [ fx:Ag when x =2 �.

3. If �, �0 are 5-bases, we define ��+�0 iff for all x:B 2 � there is x:B0 2 �0 such thatB0 �5 B.

DEFINITION 2.9 (Intersection type assignment system)Let �5 be a type theory. The intersection type assignment system �\5 relative to �5 is aformal system for deriving judgments of the form � `5 M : A, where the subject M is anuntyped �-term, the predicate A is in T5, and � is a 5-basis. Its axioms and rules are thefollowing:

(Ax)x:A 2 �

� `5 x:A(Ax-) � `5 M :

Page 6: Approximation Theorems for Intersection Type Systemsuros.m/logcom/hdb/Volume_11/Issue_03/pdf/110395.pdffor a more complete treatment of the ... to Abramsky’s‘domaintheoryin logical

400 Approximation Theorems for Intersection Type Systems

(!I)�; x:A `5 M : B

� `5 �x:M : A!B(!E)

� `5 M : A! B � `5 N : A

� `5 MN : B

(\I)� `5 M : A � `5 M : B

� `5 M : A \ B(�5)

� `5 M : A A �5 B

� `5 M : B

As usual, �-terms are considered modulo �-congruence.The meaning of the above rules is straightforward given the intended meaning of the inter-

section types language discussed above.

EXAMPLE 2.10Self-application can easily be typed in �\5, as follows.

x:(A!B) \A `5 x:(A!B) \A

x:(A!B) \ A `5 x:A!B(�5)

x:(A!B) \ A `5 x:(A!B) \A

x:(A!B) \ A `5 x:A(�5)

x:(A!B) \ A `5 xx : B(!E)

`5 �x:xx : (A!B) \ A!B(!I)

Also non-strongly normalizing terms can be typed in �\5 even with a type A6�5. Notethe usage of the axiom (Ax-). Let � � �x:xx.

x:A; y: `5 x:A

y: `5 �x:x : A!A(!I)

`5 �yx:x : !A!A(!I)

`5 �� :

`5 (�yx:x)(��) : A!A(!E)

An interesting example is that the Fixedpoint CombinatorY � �f:(�x:f(xx))(�x:f(xx)) can be typed in �\5 (without using intersection!) as follows.

f :! A `5 f :! A f :! A `5 xx :

f :! A `5 f(xx) : A

f :! A `5 �x:f(xx) : ! A f :! A `5 �x:f(xx) :

f :! A `5 (�x:f(xx))(�x:f(xx)) : A

`5 �f:(�x:f(xx))(�x:f(xx)) : (! A)! A

In the rest of this section we give a number of meta-theoretic properties of intersection typesystems, which will be useful in the sequel.

First notice that intersection elimination rules

(\E)� `5 M : A \ B

� `5 M : A

� `5 M : A \B

� `5 M : B

can immediately be shown to be derivable in all �\5 using (�5).A first simple proposition, which can be proved straightforwardly by induction on the

structure of derivations is the following.

Page 7: Approximation Theorems for Intersection Type Systemsuros.m/logcom/hdb/Volume_11/Issue_03/pdf/110395.pdffor a more complete treatment of the ... to Abramsky’s‘domaintheoryin logical

Approximation Theorems for Intersection Type Systems 401

PROPOSITION 2.11For arbitrary intersection type theories �5 the following rules are admissible in the intersec-

tion type assignment system �\5. 1

(weakening)� `5 M : A x =2 �

�; x:B `5 M : A;

(strengthening)�; x:B `5 M : A x =2 FV(M)

� `5 M : A;

(cut)�; x:B `5 M : A � `5 N : B

� `5 M [x := N ] : A;

(�5 L)�; x:B `5 M : A C �5 B

�; x:C `5 M : A;

(!L)�; y:B `5 M : A � `5 N : C x =2 �

�; x:C!B `5 M [y := xN ] : A;

(\L)�; x:A `5 M : B

�; x:A \ C `5 M : B:

As we shall see below the type assignment system �\5 is very well-behaved when thetype theory �5 is beta in the following sense.

DEFINITION 2.12A type theory �5 is beta iff for all I , Ai; Bi; C;D 2 T5:T

i2I (Ai!Bi) �5 C!D &D 6�5)9J � I , C �5

Ti2J Ai &

Ti2J Bi �5 D.

The above property is best understood if we take the view of intersection types as compactelements of !-algebraic CPO models, i.e. the view advocated in [11] and fully expounded in[1]. According to this view, \ represents join and arrow types represent step functions. Thenthe condition for a type theory being beta is exactly the relation which holds between sups ofstep functions [16].

A sufficient condition for a type theory to be beta is given below. We will use this conditionto conclude that all the intersection type theories of Figure 2 are beta (Theorem 2.15).

DEFINITION 2.13A type theory �5 is strong beta iff:

1. each axiom or rule ofr either belongs to BCD or it is of one of the following two shapes:� � 0,� �

Ti2I(

(1)i !

(2)i ),

where ; 0; (1)i ;

(2)i 2 C5, and ; 0; (2)

i 6� (i 2 I);

2. for each 6� 2 C5, there is exactly one axiom in r of the shape �Ti2I(

(1)i !

(2)i );

3. 5 contains � 0 iff:1We recall that a rule �

�is said to be admissible if ` � ) ` � is true.

Page 8: Approximation Theorems for Intersection Type Systemsuros.m/logcom/hdb/Volume_11/Issue_03/pdf/110395.pdffor a more complete treatment of the ... to Abramsky’s‘domaintheoryin logical

402 Approximation Theorems for Intersection Type Systems

(a) �Ti2I(

(1)i !

(2)i ) 2 5;

(b) 0 �Tj2J (

0(1)j !

0(2)j ) 2 5, and

(c) for all j 2 J there exists i 2 I such that 0(1)j � (1)i 2 5 and (2)

i � 0(2)j 2 5.

LEMMA 2.14Each strong beta type theory is beta.

PROOF. We will denote by ; �; �; � (possibly with indices) elements ofC5. By assumptionfor each constant 2 C5 there is exactly one axiom stating that is equivalent to an inter-section of arrow types. We denote by

Tl2L( )(�

( )l !�

( )l ) such an intersection. Moreover

notice that the most general form of an intersection type is a finite intersection of arrow typesand type constants. We can prove by simultaneous induction on the derivation of �5 twostatements, the first of which implies the beta condition:

� if (Ti2I(Ai!Bi)) \ (

Th2H h) �5 (

Tj2J (Cj!Dj)) \ (

Tk2K �k),

and Dj 6�5, then there exist I 0 � I , H 0 � H and, for all h 2 H 0, L( h)0� L( h) such

that Cj �5 (Ti2I0 Ai) \ (

Th2H0(

Tl2L( h)

0 �( h)l )) and

(Ti2I0 Bi) \ (

Th2H0(

Tl2L( h)

0 �( h)l )) �5 Dj ;

� if (Ti2I(Ai!Bi)) \ (

Th2H h) �5 (

Tj2J (Cj!Dj)) \ (

Tk2K �k),

and �k 6�5, then for each m 2 L(�k) there exist I 0 � I , H 0 � H and, for all h 2

H 0, L( h)0� L( h) such that �(�k)m �5 (

Ti2I0 Ai) \ (

Th2H0(

Tl2L( h)

0 �( h)l )) and

(Ti2I0 Bi) \ (

Th2H0(

Tl2L( h)

0 �( h)l )) �5 �

(�k)m .

THEOREM 2.15All the type theories of Figure 2 are beta.

PROOF. For 5 2 fAO; BCDg we can prove by induction on the definition of �5, that if(Ti2I(Ai!Bi))\(

Th2H h) �5 (

Tj2J (Cj!Dj))\(

Tk2K �k) andDj 6�5, then 9I 0 �

I such that Cj �5Ti2I0 Ai, and

Ti2I0 Bi �5 Dj .

The theories �5 for 5 2 fSc;Pa; CDZ;HRg are beta by Lemma 2.14.

We are now ready to give a very important meta-theorem for reasoning on type derivations:the generation or inversion theorem.

Notice the assumption that the theory is beta in clause 4 below.

THEOREM 2.16 (Generation theorem)1. Assume A6�5. Then � `5 x:A iff x:B 2 � and B �5 A for some B 2 T5.

2. Assume A 6�5. Then � `5 MN : A iff � `5 M : B!A, and � `5 N : B for someB 2 T5.

3. � `5 �x:M : A iff �; x:Bi `5 M : Ci andTi2I (Bi!Ci) �5 A, for some I and

Bi; Ci 2 T5.

4. Let �5 be beta. Then � `5 �x:M : B!C iff �; x:B `5 M : C.

PROOF. The proof of each (() is easy. So we only treat ()).(1) Easy by induction on derivations, since only the axioms (Ax), (Ax-), and the rules

(\I), (�5) can be applied. Notice that the conditionA6�5 implies that � `5 x : A cannotbe obtained just using axiom (Ax-).

Page 9: Approximation Theorems for Intersection Type Systemsuros.m/logcom/hdb/Volume_11/Issue_03/pdf/110395.pdffor a more complete treatment of the ... to Abramsky’s‘domaintheoryin logical

Approximation Theorems for Intersection Type Systems 403

(2) By induction on derivations. The only interesting case is when A � A1 \ A2 and thelast applied rule is (\I):

(\I)� `5 MN : A1 � `5 MN : A2

� `5 MN : A1 \ A2:

The condition A6�5 implies that we cannot have A1�5A2�5. We do the proof forA1 6�5 and A2 6�5, the other cases can be treated similarly. By induction there areB;C;D;E such that

� `5 M : B!C; � `5 N : B;� `5 M : D!E; � `5 N : D;

C �5 A1 & E �5 A2:

So we are done being (B!C) \ (D!E) �5 B \ D!C \ E �5 B \ D!A by rules(!-\) and (�) since C \ E �5 A.

(3) The proof is very similar to the proof of (2). It is again by induction on derivations andagain the only interesting case is when the last applied rule is (\I):

(\I)� `5 �x:M : A1 � `5 �x:M : A2

� `5 �x:M : A1 \ A2:

By induction there are I; Bi; Ci; J;Dj ; Ej such that

8i 2 I: �; x:Bi `5 M : Ci; 8j 2 J: �; x:Dj `

5 M : Ej ;Ti2I(Bi!Ci) �5 A1 &

Tj2J (Dj!Ej) �5 A2:

So we are done since (Ti2I(Bi!Ci)) \ (

Tj2J (Dj!Ej)) �5 A.

(4) The case C�5 is trivial. Otherwise let I; Bi; Ci be as in (3), where A � B!C.Then

Ti2I(Bi!Ci) �5 B!C implies that there exists a J � I such that B �5

Ti2J Bi

andTi2J Ci �5 C, since �5 is beta. From �; x:Bi `

5 M : Ci we can derive �; x:B `5

M : Ci using rule (�5 L), so by (\I) we have �; x:B `5 M :Ti2J Ci. Finally applying

rule (�5) we can conclude �; x:B `5 M : C.

We end this section by showing that if a type theory is beta then types are invariant under�-conversion.

THEOREM 2.17 (Subject conversion)Let �5 be a beta type theory and M =� N , then � `5 M : A iff � `5 N : A.

PROOF. It suffices to show that � `5 (�x:M)N : A iff � `5 M [x := N ] : A.()) The case A�5 is trivial. Otherwise by Theorem 2.16(3) � `5 �x:M : Bi!Ci,

� `5 N : Bi andTi2I Ci �5 A, for some I , Bi and Ci. By Theorem 2.16(4) we get

�; x:Bi `5 M : Ci. Then � `5 M [x := N ] : Ci follows by an application of rule (cut),

and so we can conclude � `5 M [x := N ] : A using rules (\I) and (�5).(() Let D be a deduction of � `5 M [x := N ] : A and let �i `5 N : Bi for i 2 I be

all the statements in D whose subject is N . Without loss of generality we can assume that xdoes not occur in �.

If I is non-empty, notice that � � �i but � � FV(N) = �i � FV(N) (recall that (weak-ening) and (strengthening) are not rules of the system, they are admissible rules, so 5-bases

Page 10: Approximation Theorems for Intersection Type Systemsuros.m/logcom/hdb/Volume_11/Issue_03/pdf/110395.pdffor a more complete treatment of the ... to Abramsky’s‘domaintheoryin logical

404 Approximation Theorems for Intersection Type Systems

in a derivation can only be modified by rule (!I)). So using rules (strengthening) and (\I),we have that � `5 N :

Ti2I Bi. Moreover, one can easily see, by induction on M , that

�; x:Ti2I Bi `

5 M : A. Thus, by rule (!I), we have � `5 �x:M :Ti2I Bi!A. Hence,

by (!E) we can conclude � `5 (�x:M)N : A.If I is empty, we get from D a derivation of � `5 M : A by replacing each N by x. By

axiom (Ax-) � `5 N : . By rule (weakening) we get �; x: `5 M : A and we canconclude as in the previous case.

REMARK 2.18There are intersection type theories for which subject reduction fails. As an example take

�50

= �(f; '; !g; BCD [ f(!'!)g) where the axiom (!'!) is !!! � '!!. We canderive x:' `5

0

Ix : ! (where I � �y:y), but we cannot derive x:' `50

x:! since ' 6�50 !.Notably �5

0

is not a beta theory.

From Theorems 2.15 and 2.17 we immediately get:

COROLLARY 2.19In all type assignment systems induced by the type theories of Figure 2 types are invariantunder subject conversion.

3 Approximation theorems

This is the crucial section of the paper. For all the type theories of Figure 2 we introduceappropriate notions of approximants which agree with the �-theories of different models andtherefore also with the type theories describing these models. Then we will prove that alltypes of an approximant of a given term (with respect to the appropriate notion of approxi-mants) are also types of the given term. Finally we show the converse, namely that the typeswhich can be assigned to a term can also be assigned to at least one approximant of that term.Hence a type can be derived for a term if and only if it can be derived for an approximant ofthat term.

3.1 Approximate normal forms

In this paper we consider two extensions of �-calculus both obtained by adding one constant.The first one is the well-known language �? [7]. The other extension is obtained by adding� and is discussed in [19].

DEFINITION 3.11. The set �? of �?-terms is obtained by adding the constant ? to the formation rules of

terms.

2. The set �� of ��-terms is obtained by adding the constant � to the formation rules ofterms.

We consider two mappings (� and �) from �-terms to �?-terms and one mapping ( )from �-terms to ��-terms. These mappings differ in the translation of �-redexes. Clearly thevalues of these mappings are �-irreducible terms, i.e. normal forms for an extended language.As usual we call them approximate normal forms.

DEFINITION 3.2The mappings � : �!�?; � : �!�?; : �!�� are inductively defined by:

Page 11: Approximation Theorems for Intersection Type Systemsuros.m/logcom/hdb/Volume_11/Issue_03/pdf/110395.pdffor a more complete treatment of the ... to Abramsky’s‘domaintheoryin logical

Approximation Theorems for Intersection Type Systems 405

� y(�~x:yM1 : : :Mm) = �~x:y y (M1) : : : y (Mm) for y 2 f�; �; g ;

� �(�~x:(�y:R)NM1 : : :Mm) = ? ;

� �(�~x:(�y:R)NM1 : : :Mm) = �~x:? ;

� (�~x:(�y:R)NM1 : : :Mm) = �~x:� (�y:R) (N) (M1) : : : (Mm)

where m � 0.

In order to give the appropriate approximation theorem we will use the mapping � forthe type assignment systems �\BCD, �\Sc, �\CDZ , the mapping � for the type assignmentsystem �\AO, and the mapping for the type assignment systems �\Pa, �\HR.

Each one of the above mappings associates a set of approximants to each �-term in thestandard way.

DEFINITION 3.3Let 5 2 fBCD; Sc; CDZ;AO;Pa;HRg. The set A5(M) of 5-approximants of M is definedby

A5(M) = fP j 9M 0: M !!� M0 and P � y(M 0)g;

where y = � for 5 2 fBCD; Sc; CDZg, y = � for 5 = AO, and y = for 5 2 fPa;HRg.

We extend the typing to �?-terms and to ��-terms by adding two different axioms for �and nothing for?.

DEFINITION 3.41. We extend the type assignment �\5, where 5 2 fBCD; Sc; CDZ;AOg, to �?-terms.

2. We extend the type assignment �\Pa to ��-terms by adding the axiom

(Ax -�-Pa) � `Pa � : !.

3. We extend the type assignment �\HR to ��-terms by adding the axiom

(Ax -�-HR) � `HR � : '.

It is easy to verify that the appropriate generalization of the generation theorem (Theo-rem 2.16) holds also for these extensions of the type assignment systems. Therefore we donot introduce different notations for these extended type assignment systems and we willfreely refer to the generation theorem 2.16 in discussing derivations in these extended sys-tems.

We immediately get:

PROPOSITION 3.51. Let 5 2 fBCD; Sc; CDZ;AOg. Then � `5 ? : A iff A�5.

2. � `Pa � : A iff ! �Pa A.

3. � `HR � : A iff ' �HR A.

We introduce a partial order on the set of approximate normal forms which reflects the�-reduction on �-terms in the following sense.

DEFINITION 3.6P v5 P 0 iff there are �-terms M;M 0 such that:

�M !!� M0;

Page 12: Approximation Theorems for Intersection Type Systemsuros.m/logcom/hdb/Volume_11/Issue_03/pdf/110395.pdffor a more complete treatment of the ... to Abramsky’s‘domaintheoryin logical

406 Approximation Theorems for Intersection Type Systems

� P � y(M);

� P 0 � y(M 0)

where y is as in Definition 3.3.

As expected, the order on approximate normal forms agrees with typing.

LEMMA 3.71. If � `5 P : A, and P v5 P 0 then � `5 P 0 : A.

2. If P; P 0 2 A5(M), � `5 P : A, and � `5 P 0 : B then there is P 00 2 A5(M) suchthat � `5 P 00 : A \ B.

PROOF. (1) It suffices to consider the case P � y((�x:M)N) and P 0 � y(M [x := N ]).For 5 2 fBCD; Sc; CDZ;AOg the proof is easy using Proposition 3.5(1).For 5 2 fPa;HRg notice that (M [x := N ]) is equal to (M) where the occurrences of xhave been replaced by � (N) if they are functional and N is an abstraction, and by (N)otherwise. More formally if we define the mapping (M) : �! ��:

(M) =

�� (M) if M � �x:M 0

(M) otherwise

and the mapping f gxy : �! �:

fzgxy = z

fMNgxy =

�yfNgxy if M � xfMgxyfNg

xy otherwise

f�z:Mgxy = �z:fMgxy

then it easy to check that (M [x := N ]) � (fMgxy)[x := (N)][y := (N)] (providedthat y 62 FV (M)).

By Theorem 2.16(2) from � `5 P : A we get � `5 � : B ! C ! A, � `5 �x: (M) :B, � `5 (N) : C for some B;C.

For 5 = Pa we get ! �Pa B ! C ! A from � `Pa � : B ! C ! A by Propo-sition 3.5(2). This implies B �Pa !, C �Pa !, and ! �Pa A since ! �Pa ! ! ! and�Pa is a beta theory by Theorem 2.15. We obtain by rule (�Pa) � `Pa �x: (M) : ! and� `Pa (N) : !. We can derive �; x:! `Pa (M) : ! (by Theorem 2.16(4)), which implies�; x:!; y:! `Pa (fMgxy) : !. Moreover from � `Pa (N) : ! we get � `Pa � (N) : !using axiom (Ax -�-Pa) and rules (�Pa), (!E) since ! �Pa ! ! !. So we conclude� `Pa (fMgxy)[x := (N)][y := (N)] : A by rules (cut) and (�Pa).

For 5 = HR we get ' �HR B ! C ! A from � `HR � : B ! C ! A byTheorem 3.5. This implies either (B �HR ' and ' �HR C ! A) or (B �HR ! and! �HR C ! A) since ' �HR (' ! ') \ (! ! !) and �HR is a beta theory byTheorem 2.15 (notice that ' \ ! �HR !). Similarly in the first case from ' �HR C ! Awe get either C �HR ' and ' �HR A or C �HR ! and ! �HR A. In the second casefrom ! �HR C ! A we get C �HR ' and ! �HR A since ! �HR ' ! !. To sum upusing rule (�HR) we have the following alternative cases:

� � `HR �x: (M) : ', � `HR (N) : ', and ' �HR A;

� � `HR �x: (M) : ', � `HR (N) : !, and ! �HR A;

Page 13: Approximation Theorems for Intersection Type Systemsuros.m/logcom/hdb/Volume_11/Issue_03/pdf/110395.pdffor a more complete treatment of the ... to Abramsky’s‘domaintheoryin logical

Approximation Theorems for Intersection Type Systems 407

� � `HR �x: (M) : !, � `HR (N) : ', and ! �HR A.

Therefore we get alternatively:

� �; x:' `HR (M) : ', and � `HR � (N) : ';

� �; x:! `HR (M) : !, and � `HR � (N) : !;

� �; x:' `HR (M) : !, and � `HR � (N) : ',

so we can conclude as in previous case.(2) By hypotheses there are M1, M2 such that M !!� M1, M !!� M2 and P � (M1),

P 0 � (M2). By the Church–Rosser property of!� we can find M3 such that M1 !!� M3

and M2 !!� M3. By (1) we can choose P 00 � (M3).

3.2 Approximation theorem — part 1

In this subsection we prove that if � `5 P : A and P 2 A5(M) then we can build aderivation of � `5 M : A.THEOREM 3.8 (Approximation theorem — part 1)Let 5 2 fBCD; Sc; CDZ;AO;Pa;HRg.

9P 2 A5(M): � `5 P : A) � `5 M : A:

PROOF. IfP 2 A5(M) then by Definition 3.3 there isM 0 such thatM !!� M0, P = y(M 0)

where y is as in Definition 3.3. It suffices to show that � `5 M 0 : A since this implies� `5 M : A by Corollary 2.19.

For 5 2 fBCD; Sc; CDZ;AOg from � `5 P : A we get � `5 M 0 : A by Proposi-tion 3.5(1) and the definition of the mappings � and �.

For 5 2 fPa;HRg we show � `5 M 0 : A by induction on P .The case P � x is trivial.If P � �x:P 0, then M 0 � �x:M 00 where P 0 � (M 00). By Theorem 2.16(3) from

� `5 P : A we get �; x:Bi `5 P 0 : Ci andTi2I(Bi ! Ci) �5 A for some I; Bi; Ci. We

get by induction �; x:Bi `5 M 00 : Ci and so we conclude � `5 M 0 : A using rules (!I),(\I) and (�5).

If P � P1P2, then M 0 � M1M2 where P1 � (M1) and P2 � (M2). By Theo-rem 2.16(2) from � `5 P : A we get � `5 P1 : B ! A, � `5 P2 : B for some B. Byinduction this implies � `5 M1 : B ! A and � `5 M2 : B, so we conclude � `5 M 0 : Ausing rule (!E).

If P � �P1P2, then M 0 � M1M2 where P1 � (M1) and P2 � (M2). By Theo-rem 2.16(2) from � `5 P : A we get � `5 � : B ! C ! A, � `5 P1 : B, � `5 P2 : Cfor some B;C. By induction this implies � `5 M1 : B and � `5 M2 : C.

For 5 = Pa as in the proof of Lemma 3.7(1) we get � `Pa M1 : ! and � `Pa M2 : !.We can conclude � `5 M 0 : A using rules (�Pa) and (!E) since ! �Pa ! ! !.

For 5 = HR as in the proof of Lemma 3.7(1) we have the following alternative cases:

� � `HR M1 : ', � `HR M2 : ', and ' �HR A;

� � `HR M1 : ', � `HR M2 : !, and ! �HR A;

� � `HR M1 : !, � `HR M2 : ', and ! �HR A.

It is easy to verify that in all cases we can derive � `5 M 0 : A using rules (�HR) and(!E).

Page 14: Approximation Theorems for Intersection Type Systemsuros.m/logcom/hdb/Volume_11/Issue_03/pdf/110395.pdffor a more complete treatment of the ... to Abramsky’s‘domaintheoryin logical

408 Approximation Theorems for Intersection Type Systems

3.3 Approximation theorem — part 2

In order to prove the converse of Theorem 3.8 we will use a Kripke-like version of stablesets [22].

It is useful to introduce the following definition.

DEFINITION 3.9Let 5 2 fBCD; Sc; CDZ;AO;Pa;HRg. We write

[A]5� = fM j 9P 2 A5(M): � `5 P : Ag:

By definition we get that M 2 [A]5� and N !!� M imply N 2 [A]5� . Moreover � �+�0

implies [A]5� � [A]5�0 for all types A 2 T5.

The following definition is crucial, albeit a little involved. It amounts essentially to thedefinition of the natural set-theoretic semantics of intersection types over a suitable Kripkeapplicative structure (as defined in [22]), where bases play the role of worlds. In order tokeep the treatment elementary we don’t develop the full theory of the natural semantics ofintersection types in Kripke applicative structures.

The definition below is rather long, since we have different cases for the type ! and forarrow types according to the different type theories under consideration.

DEFINITION 3.10 (Kripke type interpretation)Let 5 2 fBCD; Sc; CDZ;AO;Pa;HRg.

1. [[ ]]5� = [ ]5� for 2 C1 [ f; 'g or = ! and 5 = Pa;

2. [[!]]5� = fM j 8�0�+ �;8 ~N 2 [']5�0 :M ~N 2 [!]5�0g for 5 2 fCDZ;HRg;

3. [[!]]Sc� = fM j 8 ~N:M ~N 2 [!]Sc

� g;

4. [[A!B]]5� = fM j 8�0�+ �;8N 2 [[A]]5�0 :MN 2 [[B]]5�0g, if 5 6= AO or B 6�AO;

5. [[A!B]]AO� = [A!B]AO� if B �AO ;

6. [[A \ B]]5� = [[A]]5� \ [[B]]5� .

Notice that, since M 2 [A]5� and N !!� M imply N 2 [A]5� , the same property holdsfor [[A]]5� . Moreover � �+�0 implies [[A]]5� � [[A]]5�0 for all types A 2 T5.

Lemmas 3.11, 3.13, Definition 3.12 and the final theorem are standard. The proofs of theselemmas are done in the Appendix, since they require some subtle properties of the sets [ ]5�and [[ ]]5� .

LEMMA 3.11Let 5 2 fBCD; Sc; CDZ;AO;Pa;HRg.

1. x ~M 2 [A]5� implies x ~M 2 [[A]]5� ;

2. [[A]]5� � [A]5� .

DEFINITION 3.12 (Semantic satisfiability)Let � be a mapping from term variables to terms and [[M ]]� =M [~x := �(~x)]. Then we write:

1. 5; �;� j=M : A iff [[M ]]� 2 [[A]]5� ;

Page 15: Approximation Theorems for Intersection Type Systemsuros.m/logcom/hdb/Volume_11/Issue_03/pdf/110395.pdffor a more complete treatment of the ... to Abramsky’s‘domaintheoryin logical

Approximation Theorems for Intersection Type Systems 409

2. 5; �;�0 j= � iff 5; �;�0 j= x : B for all x:B 2 �;

3. � j=5 M : A iff 5; �;�0 j= � implies 5; �;�0 j= M : A for all mappings � and all5-basis �0.

In line with the previous remarks, the following result can be construed also as the sound-ness of the natural semantics of intersection types over a particular Kripke applicative struc-ture, where bases play the role of worlds.

LEMMA 3.13 (Soundness)Let 5 2 fBCD; Sc; CDZ;AO;Pa;HRg then � `5 M : A implies � j=5 M : A.

Finally we give the crucial result.

THEOREM 3.14 (Approximation theorem — part 2)Let 5 2 fBCD; Sc; CDZ;AO;Pa;HRg.

� `5 M : A) 9P 2 A5(M): � `5 P : A:

PROOF. Let �0(x) = x. By Lemma 3.11(1) 5; �0;� j= �. Then � `5 M : A impliesM = [[M ]]�0 2 [[A]]5� by Lemma 3.13. So we conclude M 2 [A]5� by Lemma 3.11(2).

Theorems 3.8 and 3.14 were first proved for 5 = BCD in [6], for 5 = Sc in [30], for5 = CDZ in [10], for 5 = AO in [2], for 5 = Pa and 5 = HR in [19].

4 Some applications of the approximation theorems

The approximation theorems, as phased in the present paper, can be fruitfully used to studythe �-theory of a given �-model once we describe such a �-model as a filter �-model. Filtermodels can be introduced concisely by the following definition (see [4] for more details).

DEFINITION 4.11. A 5-filter is a set X � T5 such that:

(a) 2 X ;(b) if A �5 B and A 2 X , then B 2 X ;(c) if A;B 2 X , then A \ B 2 X .

2. F5 denotes the set of 5-filters overT5.

3. Application � : F5 �F5 ! F5 is defined as

X � Y = fB j 9A 2 Y:A! B 2 Xg:

4. Env5 is the set of all mappings from the set of term variables to F5.

5. The interpretation function: [[ ]]5 : �� Env5 ! F5 is defined by

[[M ]]5� = fA 2 T5 j 9� j= �: � `5 M : Ag;

where � ranges over Env5 and � j= � iff (x:B) 2 � implies B 2 �(x).

6. The triple hF5; �; [[ ]]5i is called the (filter) model 5.

Most of the applications of approximation theorems to the study of the fine structure of afilter �-model follow a similar pattern. One usually starts out by focusing on a semidecidable

Page 16: Approximation Theorems for Intersection Type Systemsuros.m/logcom/hdb/Volume_11/Issue_03/pdf/110395.pdffor a more complete treatment of the ... to Abramsky’s‘domaintheoryin logical

410 Approximation Theorems for Intersection Type Systems

property of lambda terms, which is decidable on approximate normal forms, e.g. havinga head normal form, being reducible to an n-fold abstraction, being reducible to a closedterm, : : :. Then, by induction on the structure of approximate normal forms, repeatedly usingthe generation theorem (Theorem 2.16), one proves a completeness result, namely that anapproximate normal form satisfies such a property if and only if it has a type of a givenshape, possibly in a given basis.

Since the model is a filter �-model, this completeness result has a semantical counterpartat the level of compact elements. Finally, being the property under consideration continuous,and so true for an arbitrary lambda term whenever it is true for an approximant of it, by theapproximation theorem, the completeness result can be used to characterize the interpretationof an arbitrary lambda term.

By way of example in the present section we will discuss some interesting properties ofthe models BCD; Sc; CDZ;AO;Pa;HR. More precisely we will show that:

� the models BCD; CDZ; Sc are sensible (according to [7, Definition 4.1.7]);

� the top element in the model AO is the interpretation of the terms of order 1;

� the model Pa characterizes the terms reducible to closed terms;

� the model HR characterizes the terms reducible to �I-terms.

The rest of this section is devoted to the proof of these properties. Other uses of the approxi-mation theorem can be found in the corresponding relevant papers, i.e. [6, 10, 30, 2, 19, 4].

THEOREM 4.2The models BCD; CDZ; Sc are sensible, i.e. they equate all unsolvable terms. Moreover thebottom element of the model is the interpretation of all unsolvable terms.

PROOF. It follows immediately from the approximation theorem and the fact that ? is theonly approximant of an unsolvable term for the mapping �. Notice that by Proposition 3.5(1)the interpretation of unsolvable terms is the set of types equivalent to , i.e. the bottomelement of the model.

Let us recall the definition of term of order 1 [20].

DEFINITION 4.3A term M is of order1 iff for all integers n there is M 0 such that

M !!� �x1 : : : �xn:M0:

THEOREM 4.4A term M is of order1 iff [[M ]]AO� = T

AO for all � 2 EnvAO.

PROOF. It is easy to check by structural induction on types that

for all A 2 TAO there is n such that n ! �AO A.

So by the approximation theorem it suffices to show that if P 2 �? is an approximate normalform:

`AO P : n ! iff P � �x1 : : : �xn:P0 for some P 0.

If P � �x1 : : : �xn:P0 we can derive `AO P : n ! using axiom (Ax-) and rule (!I).

Vice versa if we assume by contradiction that P � �x1 : : : �xm:P0 for m < n and P 0

is either ? or x~P for some x, ~P , then by Theorem 2.16(4) `AO P : n ! impliesfx1:; : : : ; xm:g `

AO P 0 : n�m ! . But this latter judgment cannot be derived byProposition 3.5(1) if P 0 � ? and by Theorem 2.16(2) and (1) if P 0 � x~P .

Page 17: Approximation Theorems for Intersection Type Systemsuros.m/logcom/hdb/Volume_11/Issue_03/pdf/110395.pdffor a more complete treatment of the ... to Abramsky’s‘domaintheoryin logical

Approximation Theorems for Intersection Type Systems 411

THEOREM 4.5A term M reduces to a closed term iff [[M ]]Pa

� �" ! for all � 2 EnvPa.

PROOF. By the approximation theorem it suffices to check that if P 2 �� and V is a set ofterm variables:

fx:! j x 2 Vg `Pa P : ! iff FV (P ) � V :

The proof is by structural induction on P . Let �! = fx:! j x 2 Vg. The key property is that! �Pa ! ! !.

The case P � �y:P 0 follows by Theorem 2.16(4) and using the induction hypothesis.If P � y ~P then by Theorem 2.16(2) and (1) we need y 2 V . Since Pa is a beta theory

we get as the proof of Lemma 3.7(1) �! `Pa ~P : ~!, so we conclude using the inductionhypothesis.

Similarly if P � �P 0 ~P then by Theorem 2.16(2) and Proposition 3.5(2) we have �! `Pa

P 0 : ! and �! `Pa ~P : ~!.

Lastly we work out the characterization of terms reducible to �I-terms.We define the set of terms we want to characterize and the set obtained by adding the

constant � to it.

DEFINITION 4.61. The set �I� of �I�-terms is the subset of � such that M 2 �I� iff M reduces to a term

in which all abstracted variables occur at least once (i.e. M reduces to a �I-term).

2. The set �I�� of �I��-terms is obtained by adding the constant � to the formation rulesof �I�-terms.

In the following key lemma we show that each approximate normal form P 2 �I�� intypable with ' from the HR-basis all whose predicates are '. To deal properly with thestructural induction on approximate normal forms in the case of abstractions we also showthat if x 2 P then P is typable with ! from the HR-basis containing x:! and all whose otherpredicates are '. This is useful since ' �HR ('!') \ (!!!).

LEMMA 4.7Let P 2 �� be an approximate normal form, then:

1. P 2 �I�� iff �' `HR P : ';

2. if P 2 �I�� and x 2 P then �x' `HR P : !;

3. if �x' `HR P : ! then x 2 P ,

where �' = fy:' j 8yg, and �x' = fx:!g [ fy:' j 8y 6= xg.

PROOF. (1), (2) and (3) can be simultaneously proved by induction on P .The case P � y is trivial.Let P � �z:P 0. For (1)()) notice that P 2 �I�� implies P 0 2 �I�� and z 2 P 0. Then

we have by induction �' `HR P 0 : ' and �x' `HR P 0 : !, so by rules (!I), (\I) and(�HR) we get �' `HR P : '. For (1)(() �' `HR P : ' implies �' `HR P 0 : ' and�z' `

HR P 0 : ! by Theorem 2.16(4) since ' �HR ('!') \ (!!!) and �HR is beta. Byinduction P 0 2 �I�� and z 2 P 0 so we get P 2 �I��. For (2) if x 2 P then x 2 P 0, andby induction �x' `

HR P 0 : !, so by rules (!I) and (�HR) we get �x' `HR P : !. For (3)

�x' `HR P : ! implies �x' `

HR P 0 : ! so we get by induction x 2 P 0, i.e. x 2 P .

Page 18: Approximation Theorems for Intersection Type Systemsuros.m/logcom/hdb/Volume_11/Issue_03/pdf/110395.pdffor a more complete treatment of the ... to Abramsky’s‘domaintheoryin logical

412 Approximation Theorems for Intersection Type Systems

Let P � �P 0 ~P where � 2 f�; zg. For (1)()) notice that P 2 �I�� implies P 0 2 �I��

and ~P 2 �I��. Then we have by induction �' `HR P 0 : ' and �' `

HR Pi : ' for alli, so by axiom either (Ax) or (Ax -�-HR) and rules (!E), (�HR) we get �' `HR P : '.For (1)(() notice that �' `HR � : A implies ' �HR A by Theorem 2.16(1) when � � zor by Proposition 3.5(3) when � � �. So �' `HR P : ' implies �' `HR P 0 : 'and �' `HR Pi : ' for all i by Theorem 2.16(2) since ' �HR ('!') \ (!!!). Byinduction P 0 2 �I�� and Pi 2 �I�� for all i, so we get P 2 �I��. For (2) if x 2 P theneither � � x or x 2 P 0 ~P . In the first case x:! `HR x:! so by rules (weakening), (!E),(�HR) we get �x' `HR P : !. In the second case by induction either �x' `HR P 0 : !

or �x' `HR Pi : ! for some i, so by axiom either (Ax) or (Ax -�-HR) and rules (!E),

(�HR) we get �x' `HR P : !. For (3) by an argument similar to that showing (1)(()�x' `

HR P : ! and � 6� x imply either �x' `HR P 0 : ! or �x' `

HR Pi : ! for some i, sowe get by induction either x 2 P 0 or x 2 Pi for some i, i.e. x 2 P .

Now we can prove the final result:

THEOREM 4.8Let �'(x) =" ' for all variables x. A term M 2 �I� iff [[M ]]HR�' �" '.

PROOF. Easy from Theorems 3.8, 3.14 and Lemma 4.7(1) observing that M 2 �I� iffAHR(M) � �I��.

Theorem 4.8 was first proved in [19] by purely semantic means.

Directions for future work

Intersection types theory is necessary for the approximation theorem, because types have tobe invariant under �-conversion. The property of �-invariance holds neither for Simple typesnor for System F. Moreover intersection types don’t preserve �-expansion if we omit theuniversal type [27, 17].

It is interesting to remark that the present proof method does not easily extend to strictintersection types as defined in [5]. Actually for strict intersection types Lemma A.1 (see theAppendix) fails, since for example we can derive x: ! ; z: \ � ` xz: but we cannotderive x:�!� ` x: \ �!�.

It would be interesting to develop in full the natural semantics of intersection types inKripke applicative structures and more generally in pre-sheaf models.

In this paper we have considered only approximation theorems for ordinary �-calculus.It would be worthwhile exploring the techniques developed in this paper for establishingcorresponding approximation theorems for restricted �-calculi, such as Plotkin’s �v-calculus[25].

Acknowledgements

The authors are very grateful to F. Alessi for very stimulating discussion on the subject of thepresent paper, and they thank the referees for their useful suggestions.

This research has been partially supported by MURST Cofin ’99 TOSCA Project, FGV’99 and CNR-GNSAGA.

Page 19: Approximation Theorems for Intersection Type Systemsuros.m/logcom/hdb/Volume_11/Issue_03/pdf/110395.pdffor a more complete treatment of the ... to Abramsky’s‘domaintheoryin logical

Approximation Theorems for Intersection Type Systems 413

References[1] S. Abramsky. Domain theory in logical form. Annals of Pure and Applied Logic, 51, 1–77, 1991.[2] S. Abramsky and C.-H. L. Ong. Full abstraction in the lazy lambda calculus. Information and Computation,

105, 159–267, 1993.[3] F. Alessi. Strutture di tipi, teoria dei domini e modelli del lambda calcolo. PhD thesis, Torino University, 1991.[4] F. Alessi, M. Dezani-Ciancaglini, and F. Honsell. Intersection types. In Typed �-calculus and applications.

H.P. Barendregt, ed. North-Holland, Amsterdam, submitted.[5] S. van Bakel. Complete restrictions of the intersection type discipline. Theoretical Computer Science, 102,

135–163, 1992.[6] H. Barendregt, M. Coppo, and M. Dezani-Ciancaglini. A filter lambda model and the completeness of type

assignment. Journal of Symbolic Logic, 48, 931–940, 1983.[7] H.P. Barendregt. The Lambda Calculus: its Syntax and Semantics. North-Holland, Amsterdam, revised edition,

1984.[8] M. Coppo and M. Dezani-Ciancaglini. An extension of the basic functionality theory for the �-calculus. Notre

Dame Journal of Formal Logic, 21, 685–693, 1980.[9] M. Coppo, M. Dezani-Ciancaglini, and B. Venneri. Principal type schemes and �-calculus semantics. In To

H. B. Curry: Essays on Combinatory Logic, Lambda Calculus and Formalism, pp. 535–560. Academic Press,London, 1980.

[10] M. Coppo, M. Dezani-Ciancaglini, and M. Zacchi. Type theories, normal forms, and D1-lambda-models.Information and Computation, 72, 85–116, 1987.

[11] M. Coppo, F. Honsell, M. Dezani-Ciancaglini, and G. Longo. Extended type structures and filter lambdamodels. In Logic Colloquium ’82, pp. 241–262. North-Holland, Amsterdam, 1984.

[12] M. Dezani-Ciancaglini, F. Honsell, and F. Alessi. A complete characterization of the complete intersection-typetheories. In Proceedings in Informatics, volume 8, J. P. Rolim et al., eds. pp. 287–301. ITRS’00 Workshop,Carleton-Scientific, 2000.

[13] M. Dezani-Ciancaglini, F. Honsell, and Y. Motohama. Compositional characterization of �-terms using inter-section types. In Mathematical Foundations of Computer Science 2000, M. Nielsen and B. Rovan, eds. pp.304–313. Volume 1893 of Lecture Notes in Computer Science, Springer, 2000.

[14] P. Di Gianantonio and F. Honsell. An abstract notion of application. In Typed Lambda Calculi and Applications,M. Bezem and J.F. Groote, eds. pp. 124–138. Volume 664 of Lecture Notes in Computer Science, Springer,Berlin, 1993.

[15] L. Egidi, F. Honsell, and S. Ronchi della Rocca. Operational, denotational and logical descriptions: a casestudy. Fundamenta Informatica, 16, 149–169, 1992.

[16] G.K. Gierz, K.H. Hoffmann, K. Keimel, J.D. Mislove, and D.S. Scott. A Compendium of Continuous Lattices.Springer-Verlag, Berlin, 1980.

[17] F. Honsell and M. Lenisa. Some results on the full abstraction problem for restricted lambda calculi. InMathematical Foundations of Computer Science 1993, Brookes et al., eds. pp. 84–104. Volume 802 of LectureNotes in Computer Science, Springer, Berlin, 1993.

[18] F. Honsell and M. Lenisa. Semantical analysis of perpetual strategies in �-calculus. Theoretical ComputerScience, 212, 183–209, 1999.

[19] F. Honsell and S. Ronchi della Rocca. An approximation theorem for topological lambda models and thetopological incompleteness of lambda calculus. Journal of Computational System Scince, 45, 49–75, 1992.

[20] G. Longo. Set-theoretical models of �-calculus: theories, expansions, isomorphisms. Annals of Pure andApplied Logic, 24, 153–188, 1983.

[21] G. Longo. On Church’s formal theory of functions and functionals. Technical Report 9, Department of Com-puting Science, Pisa University, 1987.

[22] J. Mitchell. Foundation for Programmimg Languages. MIT Press, 1996.[23] D. Park. The Y-combinator in Scott’s �-calculus models (revised version). Theory of Computation Report 13,

Department of Computer Science, University of Warick, 1976.[24] A.M. Pitts. Computational adequacy via ‘mixed’ inductive definitions. In Mathematical foundations of com-

puter science 1993, Brookes et al., eds. pp. 72–82. Volume 802 of Lecture Notes in Computer Science, Springer,Berlin, 1993.

[25] G. D. Plotkin. Call-by-name, call-by-value and the �-calculus. Theoretical Computer Science, 1, 125–159,1975.

Page 20: Approximation Theorems for Intersection Type Systemsuros.m/logcom/hdb/Volume_11/Issue_03/pdf/110395.pdffor a more complete treatment of the ... to Abramsky’s‘domaintheoryin logical

414 Approximation Theorems for Intersection Type Systems

[26] G. D. Plotkin. Set-theoretical and other elementary models of the �-calculus. Theoretical Computer Science,121, 351–409, 1993.

[27] G. Pottinger. A type assignment for the strongly normalizable �-terms. In To H. B. Curry: Essays on Combina-tory Logic, Lambda Calculus and Formalism, J.R. Hindley and J.P. Seldin, eds. pp. 561–577. Academic Press,London, 1980.

[28] A. Pravato, S. Ronchi della Rocca, and L. Roversi. The call-by-value lambda calculus: a semantic investigation.Mathematical Structures in Computer Science, 9, 617–650, 1999.

[29] S. Ronchi della Rocca. Characterization theorems for a filter lambda model. Information and Control, 54,201–216, 1982.

[30] S. Ronchi della Rocca. Lecture notes on semantics and types. Internal Report, Torino University, 1998.

[31] D. Scott. Continuous lattices. In Toposes, Algebraic Geometry and Logic, F.W. Lawvere, ed. pp. 97–136.Volume 274 of Lecture Notes in Mathematics, Springer, Berlin, 1972.

[32] D.S. Scott. Open problem. In Lambda Calculus and Computer Science Theory, C. Bohm, ed. p. 369. Volume 37of Lecture Notes in Computer Science, Springer, Berlin, 1975.

[33] C. P. Wadsworth. The relation between computational and denotational properties for Scott’s D1-models ofthe lambda-calculus. SIAM Journal of Computing, 5, 488–521, 1976.

AppendixFirst we need a technical result.

LEMMA A.1Let 5 2 fBCD;Sc;CDZ;AO;Pa;HRg. If �0 = �; z:B, z =2 FV(M), and A 6�5 for 5 = AO, then

Mz 2 [A]5�0

implies M 2 [B ! A]5� .

PROOF. Let P 2 A5(Mz) and �0 `5 P : A. We show by cases on P and M that there is P 2 A5(M) such

that � `5 P : B ! A. If P 2 A5(Mz) then we are in one of the following cases:� P � ? and 5 2 fBCD;Sc;CDZ;AOg;

� M !!� �x:M0 and P 2 A5(M 0[x := z]);

� P � P 0Q, P 0 2 A5(M) and Q 2 A5(z);

� P � �P 0Q, P 0 2 A5(M), Q 2 A5(z) and 5 2 fPa;HRg.The case P � ? is trivial for 5 2 fBCD;Sc; CDZg and impossible for 5 = AO by Proposition 3.5(1).

If M !!� �x:M0 and P 2 A5(M 0[x := z]) we can choose P � �z:P .

If P � P 0Q where P 0 2 A5(M) and Q 2 A5(z), then we can choose P � P 0. In fact by Theorem 2.16(2)from �0 `5 P : A we get �0 `5 P 0 : C ! A, �0 `5 Q : C for some C . By Theorem 3.8 �0 `5 Q : Cimplies �0 `5 z:C , so we get B �5 C by Theorem 2.16(1) and we conclude using (�5) and (strengthening)� `5 P 0 : B ! A.

If P � �P 0Q where P 0 2 A5(M) and Q 2 A5(z), then 5 2 fPa;HRg, and we can choose P � P 0. Infact by Theorem 2.16(2) from �0 `5 P : A we get �0 `5 � : C ! D ! A, �0 `5 P 0 : C , �0 `5 Q : Dfor some C;D. As in the previous case we get B �5 D. For 5 = Pa using Proposition 3.5(2) as in the proof ofLemma 3.7(1), we get C �Pa !, D �Pa !, and ! �Pa A. Similarly for5 = HR using Proposition 3.5(3), weget either C �HR ', D �HR ', and ' �Pa A, or C �HR ', D �HR !, and ! �HR A, or C �Pa !,D �HR ', and ! �Pa A. In all cases we can conclude C �5 D ! A �5 B ! A and therefore by (�5)and (strengthening) � `5 P 0 : B ! A.

Proof of Lemma 3.11.

PROOF. (1) and (2) can be proved simultaneously by induction on A. We consider only some interesting cases.(1) Case A � ! and 5 = CDZ. Let �0�+ �. [[']]CDZ

�0= [']CDZ

�0(*) by Definition 3.10(1).

x ~M 2 [!]CDZ� and (*) ) x ~MN 2 [!]CDZ�0

by rules (�CDZ ) and (!E)since ! �CDZ '! !

) x ~M 2 [[!]]CDZ� by Definition 3.10(2):

Page 21: Approximation Theorems for Intersection Type Systemsuros.m/logcom/hdb/Volume_11/Issue_03/pdf/110395.pdffor a more complete treatment of the ... to Abramsky’s‘domaintheoryin logical

Approximation Theorems for Intersection Type Systems 415

Case A � B ! C . Let �0�+ � and 5 6= AO or C 6�AO. [[B]]5�0� [B]5

�0(**) by induction on (2).

x ~M 2 [A]5� and (**) ) x ~MN 2 [C]5�0

by rule (!E)

) x ~MN 2 [[C]]5�0

by induction on (1)

) x ~M 2 [[B ! C]]5� by Definition 3.10(4):

(2) Case A � B!C and either 5 6= AO or C 6�AO. Let �0 = �; z:B where z is fresh, and suppose

M 2 [[B ! C]]5� ; then, since z 2 [[B]]5fz:Bg

by induction on (1), we have

M 2 [[B ! C]]5� and z 2 [[B]]5fz:Bg

) Mz 2 [[C]]5�0

by Definition 3.10(4)

) Mz 2 [C]5�0

by induction on (2)

) M 2 [B!C]5�0

by Lemma A.1:

Case A � B \ C . It follows by induction and Lemma 3.7(2).

The following lemma essentially states that Kripke type interpretations agree with the corresponding type theo-ries.

LEMMA A.21. Let M 2 [A]CDZ�;z:! and N 2 [[!]]CDZ� then M [z := N ] 2 [A]CDZ� .

2. Let5 2 fBCD;Sc; CDZ;AO;Pa;HRg. Then A �5 B implies [[A]]5� � [[B]]5� for all A;B 2 T5.

PROOF. (1) If M 2 [A]CDZ�;z:! then there is P 2 ACDZ (M) such that �; z:! `CDZ P : A. The proof is byinduction on P .

The cases P � ? or A �CDZ are trivial. If P � �x:P 0 then M !!� �x:M 0 and P 0 2 ACDZ (M0).

From �; z:! `CDZ P : A we get �; z:!; x:Bi `CDZ P 0 : Ci and

Ti2I(Bi!Ci) �CDZ A for some

I and Bi; Ci 2 TCDZ by Theorem 2.16(3). By induction there are Pi 2 ACDZ (M0[z := N ]) such that

�; x:Bi `CDZ Pi : Ci for all i 2 I . Then by Lemma 3.7(2) there is P 00 2 ACDZ (M

0[z := N ]) such that

�; x:Bi `CDZ P 00 :Ti2I Ci . We can derive � `CDZ �x:P 00 : A using (!I), (\I) and (�CDZ ). Since the

�-abstraction of reduction pairs preserves the reduction relation and the mapping � is closed under the �-abstraction,we get �x:P 00 2 ACDZ(M [z := N ]).

If P � x~P then M !!� x ~M and ~P 2 ACDZ (~M). From �; z:! `CDZ P : A we get �; z:! `CDZ

x : ~B ! A and �; z:! `CDZ ~P : ~B by Theorem 2.16(2). By induction there are ~P 0 2 ACDZ (~M [z := N ])

such that � `CDZ ~P 0 : ~B. If x 6= z we are done since x ~P 0 2 ACDZ (M [z := N ]) and we can derive

� `CDZ x ~P 0 : A using (!E). Otherwise �; z:! `CDZ z: ~B ! A implies ! �CDZ~B ! A by Theo-

rem 2.16(1). Being �CDZ a beta theory by Theorem 2.15 from ! �CDZ ~' ! ! we obtain ~B �CDZ ~' and

! �CDZ A. So we get � `CDZ ~P 0 : ~', i.e. ~M [z := N ] 2 [']CDZ� . By Definition 3.10(2) N 2 [[!]]CDZ�

and ~M [z := N ] 2 [']CDZ� imply M [z := N ] 2 [!]CDZ� . Since ! �CDZ A, by Lemma 3.11(2) we get

M [z := N ] 2 [A]CDZ� .

(2) We consider only the most interesting cases.Proof of [[!!']]CDZ� � [[']]CDZ� . By Lemma 3.11(2) [[!!']]CDZ� � [!!']CDZ� and by Definition 3.9

[!!']CDZ� = [']CDZ� since !!' �CDZ '. Hence we are done since [']CDZ� = [[']]CDZ� by Defini-tion 3.10(1).

Proof of [[']]CDZ� � [[!!']]CDZ� . By Definition 3.10(1) [[']]CDZ� = [']CDZ� . If M 2 [']CDZ� then there

is P 2 ACDZ(M) such that � `CDZ P : '. The proof is by cases on P .The case P � ? is impossible by Proposition 3.5(1).If P � �z:P 0 then M !!� �z:M

0 and P 0 2 ACDZ(M0). From � `CDZ P : ' we get �; z:! `CDZ P 0 :

' by Theorem 2.16(3). This implies M 0 2 [']CDZ�;z:! and also M 0 2 [']CDZ�0;z:!

for an arbitrary �0�+ �, so we get by

(1) M 0[z := N ] 2 [']CDZ�0

for an arbitrary N 2 [[!]]CDZ�0

. We conclude observing that MN !!� M0[z := N ].

If P � x~P notice that � `CDZ P : ' implies � `CDZ P : !!' since ' �CDZ !!'. Take an arbitrary

�0�+ � and an arbitrary N 2 [[!]]CDZ�0

. By Lemma 3.11(2) [[!]]CDZ�0

� [!]CDZ�0

, then there is P 0 2 ACDZ(N)

Page 22: Approximation Theorems for Intersection Type Systemsuros.m/logcom/hdb/Volume_11/Issue_03/pdf/110395.pdffor a more complete treatment of the ... to Abramsky’s‘domaintheoryin logical

416 Approximation Theorems for Intersection Type Systems

such that �0 `CDZ P 0 : !. We can derive �0 `CDZ PP 0 : ' from � `CDZ P : !!' and �0 `CDZ P 0 : !using (!E) and (weakening). We conclude by observing that PP 0 2 ACDZ (MN).

Proof of [['!!]]CDZ� � [[!]]CDZ� . By Lemma 3.11(2) [['!!]]CDZ� � ['!!]CDZ� and by Definition 3.9

['!!]CDZ� = [!]CDZ� since '!! �CDZ !. Moreover

[['!!]]CDZ� = fM j 8�0�+ �;8N 2 [[']]CDZ�0

:MN 2 [[!]]CDZ�0

g by Definition 3.10(4)

= fM j 8�0�+ �;8N 2 [']CDZ�0

:MN 2 [[!]]CDZ�0

g by Definition 3.10(1)

� fM j 8�0�+ �;8N; ~N 2 [']CDZ�0

:MN ~N 2 [!]CDZ�0

g by Definition 3.10(2):

From [['!!]]CDZ� � [!]CDZ� and [['!!]]CDZ� � fM j 8�0�+ �;8N; ~N 2 [']CDZ�0

:MN ~N 2 [!]CDZ�0

g

we can conclude [['!!]]CDZ� � fM j 8�0�+ �; ~N 2 [']CDZ�0

:M ~N 2 [!]CDZ�0

g = [[!]]CDZ� .

Proof of [[!]]CDZ� � [['!!]]CDZ� .

M 2 [[!]]CDZ� ) 8�0�+ �;8N; ~N 2 [']CDZ�0

:MN ~N 2 [!]CDZ�0

by Definition 3.10(2)

) 8�0�+ �;8N 2 [']CDZ�0

:MN 2 [[!]]CDZ�0

by Definition 3.10(1), (2)

) M 2 [['!!]]CDZ� by Definition 3.10(4):

Proof of [[('!') \ (!!!)]]HR� � [[']]HR� . By Lemma 3.11(2) [[('!') \ (!!!)]]HR� � [('!') \

(!!!)]HR� and by Definition 3.9 [('!')\ (!!!)]HR� = [']HR� since ('!')\ (!!!) �HR '. Hence

we are done since [']HR� = [[']]HR� by Definition 3.10(1).

Proof of [[']]HR� � [[('!') \ (!!!)]]HR� . Let �0�+ �.

M 2 [[']]HR� ) M 2 [']HR� by Definition 3.10(1)

) 9P 2 AHR(M) � `HR P : ' (*) by Definition 3.9

N 2 [[']]HR�0

) N 2 [']HR�0

by Definition 3.10(1)

) 9P 0 2 AHR(N) �0 `HR P 0 : ' (**) by Definition 3.9

Let P � �PP 0 if P is a �-abstraction and P � PP 0 otherwise.

(*) and (**) ) �0 `Pa P : ' by (Ax -�-HR), (�HR), (!E)

) MN 2 [']HR�0

since P 2 AHR(MN)

) MN 2 [[']]HR�0

by Definition 3.10(1)

) M 2 [['! ']]HR� by Definition 3.10(4):

N 2 [[!]]HR�0

) N 2 [!]HR�0

by Definition 3.10(2)

) 9P 0 2 AHR(N) �0 `HR P 0 : ! (***) by Definition 3.9

~N 2 [[']]HR�0

) ~N 2 [']HR�0

by Definition 3.10(2)

) 9~P 2 AHR( ~N) �0 `HR ~P 0 : ~' (****) by Definition 3.9

Let P � �PP 0 ~P if P is a �-abstraction and P � PP 0 ~P otherwise.

(*); (***) and (****) ) �0 `Pa P : ! by (Ax -�-HR), (�HR), (!E)

) MN ~N 2 [!]HR�0

since P 2 AHR(MN ~N)

) MN 2 [[!]]HR�0

by Definition 3.10(2)

) M 2 [[!! !]]HR� by Definition 3.10(4):

Proof of [[!!!]]Pa� � [[!]]Pa

� . Let M 2 [[!!!]]Pa� and �0 = �; z : !, where z =2 FV(M).

z 2 [!]Pafz:!g

) z 2 [[!]]Pafz:!g

by Definition 3.10(1)

) Mz 2 [[!]]Pa�0

by Definition 3.10(4)

) Mz 2 [!]Pa�0

by Definition 3.10(1)

) M 2 [!]Pa� by Lemma A.1

and rule (�Pa) being ! �Pa ! ! !

) M 2 [[!]]Pa� by Definition 3.10(1):

Page 23: Approximation Theorems for Intersection Type Systemsuros.m/logcom/hdb/Volume_11/Issue_03/pdf/110395.pdffor a more complete treatment of the ... to Abramsky’s‘domaintheoryin logical

Approximation Theorems for Intersection Type Systems 417

Proof of [[!]]Pa� � [[!!!]]Pa

� . Let �0�+ �.

M 2 [[!]]Pa� ) M 2 [!]Pa

� by Definition 3.10(1)

) 9P 2 APa(M) � `Pa P : ! (*) by Definition 3.9

N 2 [[!]]Pa�0

) N 2 [!]Pa�0

by Definition 3.10(1)

) 9P 0 2 APa(N) �0 `Pa P 0 : ! (**) by Definition 3.9

Let P � �PP 0 if P is a �-abstraction and P � PP 0 otherwise.

(*) and (**) ) �0 `Pa P : ! by (Ax -�-Pa), (�Pa), (!E)

) MN 2 [!]Pa�0

since P 2 APa(MN)

) MN 2 [[!]]Pa�0

by Definition 3.10(1)

) M 2 [[!! !]]Pa� by Definition 3.10(4):

Proof of Lemma 3.13.

PROOF. The proof is by induction on the derivation of � `5 M : A. Cases (Ax), and (Ax-) are immediate.Cases (!E) and (\I) follow by induction. Case (�5) is ok by Lemma A.2(2). In the case (!I), suppose thatM � �y:R, A � B!C and �; y : B `5 R : C has been derived.

Let5 6= AO or C 6�AO. Now, if [[T ]]� 2 [[B]]5�0

where �0�+ �, from the induction hypothesis

[[R]]�[y:=[[T ]]�]2 [[C]]5

�0:

By the invariance of [[ ]]5 under �-expansion we get

[[(�y:R)T ]]� = [[�y:R]]�[[T ]]� 2 [[C]]5�0;

hence by Definition 3.10(4)[[�y:R]]� 2 [[B!C]]5� ;

the term T being arbitrary.The case 5 = AO and C �AO follows easily observing that �y:P 2 AAO([[�y:R]]�) for all P 2

AAO([[R]]�) and all � such that �(y) = y. We can derive `AO �y:P : B!C using (Ax-), (!I) and (�AO).

Hence we conclude [[M ]]� 2 [A]5� which implies [[M ]]� 2 [[A]]5� by Definition 3.10(5).

Received 4 October 2000