Subject Reduction vs Intersection / Union Types in λµ ˜ µ

This paper studies intersection and union type assignment for the calculus λµ ˜ µ [9], a proof-term syntax for Gentzen’s classical sequent calculus. We show that this notion is closed for subject-expansion, and show that it needs to be restricted to satisfy subject-reduction as well, even when limiting reduction to (conﬂuent) call-by-name or call-by-value reduction, making it unsuitable to deﬁne a semantics.


Introduction
One of the main contributions of intersection types [8] for the λ-calculus [7] is the characterisation of strong normalisation, which states that, in a system without the type constant ⊤1 the typeable terms are exactly the strongly normalisable ones [1].This result has since then been achieved in many ways for different calculi, and in order to come to a similar characterisation for the (untyped) sequent calculus λµ μ [9], [11] presented a notion of intersection and union type assignment for that calculus.
Another main contribution of intersection types is that of the construction of filter semantics [8], i.e. to build a λ-model using assignable types.With this goal in mind, in this paper we revisit the system of [11], adding ⊤ as the maximal and ⊥ as the minimal type, and the derivation rules (⊤), (⊥), that are added for the purpose of subject expansion (the property that types are preserved also going backwards with respect to reduction, sometimes also called completeness); we also add the rules (≤L) and (≤R) as a correction of the system of [11], in that they are needed for the proof of subject reduction (the converse of completeness, also called soundness).
The notion of type (or better, context) assignment we present here will be shown to be the natural system, in that intersection, ⊤, union, and ⊥ play their expected roles for subject expansion, our first step towards the construction of a filter model.However, we show that subject reduction no longer holds, and will argue that this is caused by the non-logical foundation (i.e.typeable terms no longer correspond to proofs [18]) of both intersection and union.In this regard, [11] contained some flaws, and a later attempt by the same authors [13] to achieve the strong normalisation results had those flaws as well; this paper will address and partially correct these.We should point out that also a previous attempt to tackle the same kind of problem (but in the context of X , a different sequent calculus) by the author of this paper [3] was flawed in the same way.We will show that we can partially recover from these failures by restricting to either call-by-name or call-by-value reduction, but that we also need to restrict the applicability of either union or intersection.This then, unfortunately, demolishes the subject-expansion result, making the system not suitable to define semantics.
Another approach, in spirit close to ours, is that mentioned in [17]; as we will see, the differences between that approach and the one chosen here are subtle, but important.In particular, in [17], intersection and union types do not bring the expected properties: not all normal forms can be typed in that system and it is not closed for subject-expansion, so it does certainly not type exactly the strongly normalisable terms.
In this paper we will show that the -at the time-surprising loss of soundness for the system with intersection and union types in [6] is, in fact, natural and inevitable.Also, working with intersection and union in the context of these highly symmetric sequent calculi makes clear that these are truly dual; we will show that it is not union alone that causes problems, but that the problem is much more profound, and also arises when dealing with intersection.Although the idea behind both intersection and union might be (the logical) and and or, the fact that they are both not logical destroys the soundness, both for a system based on intersection, as for a system based on union.This also explains why, for ML with side-effects [16,23,21], quantification is no longer sound: also the (∀I) and (∀E) rules of ML are not logical.This problem also appears when using intersection and union types in an operational setting [10,14].The sequent calculus, introduced by Gentzen in [15], is a logical system in which the rules only introduce connectives (but on both sides of a sequent), in contrast to natural deduction which uses introduction and elimination rules.The only way to eliminate a connective is to eliminate the whole formula in which it appears, via an application of the (cut)-rule.A number of variants exist for Gentzen's calculus for classical logic LK; the variant of LK one we will consider in this paper, and that lies at the basis of the calculus λµ μ is the calculus known as G 3 [19], which is defined by: It allows sequents of the form A 1 , . . ., A n ⊢ B 1 , . . ., B m , where A 1 , . . ., A n is to be understood as A 1 ∧ . . .∧A n and B 1 , . . . ,B m is to be understood as B 1 ∨ . . .∨B m , and has implicit weakening and contraction.
In this paper we will treat λµ μ as a pure, untyped calculus, and ignore its origin in that we define a notion of sequent-style intersection-union type assignment for λµ μ; as mentioned above, intersection types are notorious for lacking a solid background in logic [18].In order to achieve a natural notion of type assignment that is closed for expansion, we will also need to add union types.
The system we define in this paper is set up to be a conservative extension of the BCD intersection type assignment system for the λ-calculus [8], in that lambda terms typeable in that system translate to λµ μ-terms, while preserving the type.There are many different notions of intersection type assignment in existence (see also [20,1,2]), that, in the context of the λ-calculus more or less coincide; the most important difference is normally the language of types (full BCD [8,20], or strict types [1,2]), and the availability of a contra-variant ≤-relation [8,2] or not [20,1].Surprisingly, this is no longer true when bringing intersection types (and union) to the context of sequent calculi; both BCD-types and a contra variant relation are needed, as will be shown in this paper.
The system presented here is also a natural extension of the system considered in [9], i.e. the basic implicative system for Classical Logic, but extended with intersection and union types and the type constants ⊤ and ⊥.The main results of this paper are that this notion is closed for expansion and that it needs to be restricted to become closed for reduction; characterisation of strong normalisation is still an open issue.
We will show in this paper that there are two causes for the loss of subject reduction: a) Performing a µ-reduction towards an introduced intersection (i.e. via rule (∩R)), and b) Performing a μ-reduction towards an introduced union (via rule (∪L)).
Any solution for subject reduction for a system with intersection and union types for λµ μ will need to solve both problems.
In [17], the subject reduction problem is recognised, and two systems are proposed that solve the problem, one for CBV, and one for CBN reduction, as we will do in Section 4.There the CBV restriction is defined by limiting rule (∪R) to values, and the CBN restriction by limiting rule (∩L) to slots.How this will achieve subject-reduction is not made clear; it is remarkable that the suggested solution is almost orthogonal to what we define below in Section 4.However, this does not seem to affect the validity of the subject reduction claim in [17]; in fact, we conjecture that, given the applicability of rule (∩L) only to contexts and rule (∪R) only to terms, subject reduction even holds for the unrestricted system of that paper.
In this paper we will revisit the systems of [11] and [13], and discuss the problem of subject reduction and expansion in the context of those systems in detail.We will then define a notion of type assignment that is an extension of [11] by adding a contra-variant ≤-relation on types, and show that subject reduction is still problematic.After that we will focus on two sub-sytems, ⊢ V and ⊢ N , that will successfully tackle that problem; for CBV we limit (∩R) to values, and for CBN limit (∪L) to slots.These solutions are crucially different from any other published in the past, in that we do not limit the syntax of types at all (as in [12,13]), and pose completely different side-conditions on rules (wrt [17]), in fact generalising the there claimed result.As far as we know, these are the first correct presentations of sound restrictions of a fully expressive system with intersection and union types or λµ μ.
It might seem that the restriction flattens the system too much; however, as intersection is not problematic for CBN-reduction, we can still embed the ⊢ ∩ -system for the λ-calculus whilst preserving the types, so our system ⊢ N is as least as expressive; also, union types are still useful for µ-reductions.On the other hand, union types are not problematic for CBV-reduction, and intersection can then be used for μ-reductions.However, limiting the applicability of either rule (∩R) or (∪L) disrupts the proof of subject-expansion: this implies that it is impossible to define a notion of type assignment that is closed for conversion, even when restricting to CBV of CBN.So we cannot construct a filter model using types for λµ μ using this system.This paper is constructed as follows: in Section 1 we define the λµ μ-calculus, and encode the λ-calculus into it.In Section ?? we will present the intersection-union type assignment system M ∩∪ of [11] and show, via detailed examples, that subject reduction does not hold.This will be followed in Section ?? by the system M ∩ of [13]; we will show that apart from subject-reduction, also subject expansion fails there.In Section 2 we will revisit the BCD system of [8], from which in Section 3 we will construct our notion of type assignment, and prove some standard properties, as well as that the encoding of the λ-calculus preserves BCD-types.We will also show subject expansion, and soundness for rule (→); we will show that contraction via rules (µ) and ( μ) is not sound.In Section 4 we will define two restrictions of our system, ⊢ N and ⊢ V , and will show that call-by-name and call-by-value, respectively, are sound for these notions; completeness will fail.

The calculus λµ μ
In its typed version, λµ μ [9] is a proof-term syntax for a classical sequent calculus.For the λµ μcalculus there are two sets of variables: x, y, z, etc., label the types of the hypotheses and α, β, γ, etc., label the types of the conclusions.Moreover, the syntax of λµ μ has three different categories: commands, terms, and contexts (or co-terms).Correspondingly, they are typed by three kinds of sequents: the usual sequents Γ ⊢ ∆ type commands, while the sequents typing terms (resp.contexts) are of the form Γ ⊢ A | ∆ (resp.Γ | A ⊢ ∆), marking the conclusion (resp.hypothesis) A as active.Definition 1.1 (COMMANDS, TERMS, AND CONTEXTS [9]) With conventional notations about contexts, v • e is to be thought of as e Here µα.c, μx.c ′ and λy.v respectively bind α in c, x in c ′ and y in v; as usual, we will consider terms, contexts and commands up to α-conversion, writing them in a way satisfying Barendregt's convention, and consider substitution to be capture avoiding.
Note that the type of a context is the type that a term is expected to have in order to fit in the hole '•'.We see here how a term (context) is built either by introducing '→' on the right-hand side (left-hand side) of a sequent, or just by activating one conclusion (hypothesis) from a sequent typing a command: µα.c is inherited from λµ, as is v | α which corresponds to [α]v, and μx.c is to be thought of as Commands can be computed (thus eliminating the cut in the corresponding proof): 9, 17]) The reduction rules are defined by: We have a critical pair in the command µα.c 1 | μx.c 2 ; since cut-elimination of the classical sequent calculus is not confluent, neither is reduction in λµ μ.Notice also that the rules (→), (µ), and ( μ) reduce commands to commands, that rules (η) and (ηµ) reduce a term to a term, and that rule (η μ) reduces a context to a context.If not mentioned explicitly, we will assume that reduction is done only via the logical rules.Herbelin's λµ μ-calculus expresses the duality of LK's left and right introduction in a very symmetrical syntax.But the duality goes beyond that: for instance, the symmetry of the reduction rules display syntactically the duality between the call-by-value (CBV) and call-by-name (CBN) evaluations (see also [22]).Indeed, the CBV reduction → V is obtained by forbidding a μ-reduction when the redex is also a µ-redex, whereas the CBN reduction → N forbids a µ-reduction when the redex is also a μ-redex.Definition 1.4 (CBV AND CBN [9,17]) i) Values V are defined by V ::= x | λx.v, and slots2 E are defined by E ::= α | v • e. ii) CBV-reduction is defined by replacing rule ( μ) by: ( μV The remainder of this paper will be dedicated to the definition of a notion of intersection type assignment on λµ μ.This will be defined as a natural extension of a system with intersection types for the λ-calculus; we will start by briefly summarising the latter.ii) The reduction relation → β is defined as the contextual (i.e.compatible [7]) closure of the rule: The relation → → β is the reflexive and transitive closure of → β , and the = β is the equivalence relation generated by → → β .iii) Call-by-value reduction is defined by limiting the reduction rule → β to contract only if the right-hand term is a value, i.e. if V is either a variable or an abstraction.
Essentially following [9], we define an encoding of the λ-calculus into λµ μ: Definition 1.6 An interpretation • of the λ-calculus into λµ μ can be defined as follows: We can even represent substitution explicitly (so interpret λx [?]), by adding Correctness of this encoding is easy to prove: Notice that we need ηµ-reduction to achieve this.
Using this lemma, we can prove the following relation between the λ-calculus and λµ μ: Proof: Both parts follow by induction on the definition of → β , using Lemma 3.7.For part 2, we also need to check that (λx.M)N → V M [ N /x] only if N is a value.Well, then either N ≡ x or N ≡ λy.N ′ , and for both cases N is a value.Then the μ-reduction in the proof of Lemma 3.7 is permitted, making the reduction CBV. 2 The system M ∩∪ of intersection and union type assignment for λµ μ

[11]
A first notion of intersection and union type assignment for λµ μ was presented in [11]; this was followed by [13], which presented improvements/variants of the original system.In this paper, we will revisit these systems, in order, albeit in a presentation that is adapted to our approach, and discuss their shortcomings.
We start with the definition of intersection/union types.

Definition 2.1 (INTERSECTION AND UNION TYPES, CONTEXTS) i)
The set T ∩∪ of intersection-union types (we will write T for short), ranged over by A, B, . . . is inductively defined by: ii) A context Γ of term-variables (∆ of context-variables) is a partial mapping from term-variables (context-variables) to types, represented as a set of statements with only distinct variables as subjects.
We will omit unnecessary brackets in types; the type constructors '∩' and '∪' will bind more strongly than '→', so A∩B→C∩D is used for ((A∩B)→(C∩D)), A→B∩C→D for (A→((B∩C)→D)), and (A→B)∩C→D for (((A→B)∩C)→D).We will sometimes write the omitable brackets to enhance readability.
We will consider a pre-order on types which takes into account the idem-potence, commutativity and associativity of the intersection and union type constructors.

Definition 2.2 (RELATIONS ON TYPES) i)
The relation ≤ is defined as the least pre-order on T such that: We will write A ≤ ∩ B for the relation on types defined by the first line, and A ≤ ∪ B for the one defined by the second.ii) The equivalence relation ∼ on types is defined by: The set T will be considered modulo ∼; then ≤ becomes a partial order.Since intersection and union are associative and commutative, we will write The following is easy to show: , and for every B j there exists an A i j such that

and for every A i there exists a B j i such that
We will now define a notion of intersection-union type assignment for λµ μ, which corresponds to system M ∩∪ as defined in [11].
Notice that instead of the rules (Ax-t) and (Ax-c), the system of [11] contains the rules (e-ax) and (r-ax) that only allow of selection of a type out of a context, instead of an selection out of an intersection or union type as well; to be able to select such a subtype, it also had rules (∩L−var) and (∪R−var); our rules combine these, with the same functionality.
Also, their notion of type assignment is defined without any relation on types, it is just stated that types are considered to be defined modulo commutativity and associativity for ∩ and ∪; this corresponds to the type inclusion relation we use here.Notice we do not have a contra-variant type inclusion relation (which would state that C ≤ A & B ≤ D ⇒ A→B ≤ C→D); this combined with the full BCD-intersection types [8] gives a notion of type assignment that is closet to Krivine's system D [20].
Notice that type assignment is not preserved for rule (η): for example, we can derive but cannot show y:A→B ⊢ M y : (A∩C)→B | ; we would need a ≤-relation on types that is contravariant over arrow types.Similar to the results we will show below (Theorem 3.12), it is straightforward to show that this system is closed for expansion.
However, it is not closed for reduction, so we can't show that, if c 1 → c 2 and c 1 : Γ ⊢ M ∆ then also c 2 : Γ ⊢ M ∆.To illustrate this, we will show two counterexamples in detail.
Then it is straightforward to verify that c 1 → V c 2 , and c 1 → N c 3 .Let the derivation D 1 be constructed as follows: (notice that we have made D 3 explicit).We then contract the µα redex to obtain When contracting the µα redex on the other hand, the context μy.y | y•β will be inserted for the context variable α.But we cannot derive: We would expect the derivation D 1 to be inserted for α (in one way or another; since intersection and union are involved in this system, it might be that a derivation gets divided into pieces before being inserted, as we have seen above) in the derivation for x | x•α .However, notice that we do not have a sub-derivation for | α : (C→D)∩C ⊢ M α:(C→D)∩C, but only two for both | α : C ⊢ M α:C and | α : C→D ⊢ M α:C→D.This means that a derivation for the contractum cannot be simply constructed from the one above by 'cut and paste': we need to build a new derivation.Now we cannot split the intersection needed to derive D 1 : both types C and C→D are needed to type μy.y | y•β , so we cannot derive either | μy.
Given the structure of the rules in system ⊢, for x | x • μy.y | y•β this implies that for c 2 we can at most derive: Notice that this is incomparable to the desired result: there is no way we can transform A, A→C and A→C→D (i.e.A∩(A→C)∩(A→C→D)) into A∩(A→(C→D)∩C).We would need the contravariant relation ≤ on types as defined below (in Definition 3.2) to achieve this; since that relation is not considered in [11], this is not possible.So we have a type assignment for c 1 that is a valid type assignment also for c 3 , but not for c 2 .
By the subject expansion result, the above type assignment for c 2 is also a type assignment for c 1 , so, in the opposite direction, no problem exists; we can derive c 1 : x:A∩(A→((C→D)∩C)) ⊢ M β:D: A particular problem with this last type assignment is that we (have shown that we) can derive it for both c 1 and c 2 , but cannot derive it for c 3 ; a derivation for c 3 necessarily should have the shape as shown above.There is no way we can derive c 3 : x:A∩(A→(C→D)∩C) ⊢ M β:D; again, we could solve this by ≤, but this forms no part of the system.
Notice that the typing for c 2 shows the usefulness of allowing intersection types on the right of an arrow.Summarising, this counterexample shows the following things: i) there exist terms c 1 , c 2 , and c 3 such that c 1 → V c 2 and c 1 → N c 3 , and ii) there are contexts Γ 1 and ∆ 1 such that c 1 : iii) there are contexts Γ 2 and ∆ 2 such that c 1 : Γ 2 ⊢ M ∆ 2 and c 3 : iv) for all contexts Γ, ∆ such that either c 2 : Γ ⊢ M ∆ or c 3 : Γ ⊢ M ∆, we have c 1 : Γ ⊢ M ∆.
We have seen that part of the encountered problems can be overcome by using a contra-variant ≤ relation, as we will do in Section 3.
The problem of loss of soundness exists also for μ-reduction: Example 2.7 Take the μ-reduction Notice that this derivation shows that both types A and A→B are needed here; we cannot derive either We can type the left-hand side as follows: When building a derivation for we would expect the derivation D to be inserted for z in the derivation for λv.z | γ .But, because of the inseparability of A and A→B for µδ.λxµβ.x | δ | δ , this is impossible; we can at most derive (notice that we have weakened the left context in D with v:C): Again, by the subject-expansion result, we can also derive: Notice that now we cannot achieve the desired result through ≤; it is easy to verify that (C→A)∪(C→A→B) ≤ C→A∪(A→B) but not vice-versa, as is needed here.
The conclusion of these two counterexamples has to be that it is profoundly impossible to achieve soundness (or subject reduction) in the system M ∩∪ .
As we have seen, adding contra-variant ≤ to our system would fix part of the here noted problems, and that is exactly what we will do in Section 3.

The system M ∩ of [13]
A normal reason to set up a notion of type assignment with intersection types is to prove a characterisation result for strong normalisation, and that was one of the motivations for [11].In order to achieve this result, the authors of that paper decided to modify the system they defined in [11] quite drastically, adding negation, and expressing union types via an intersection and negation.This is accompanied by transforming derivable statements from sequent style to natural deduction style, writing only a context to the left and to have a single result (conclusion).
We will briefly revisit that system here (adapting notation and syntax), and show that the above counter examples are valid in that modified system as well.
It is important to point out that [13] presents a slightly different version of λµ μ's reduction relation (Definition For example, for the full reduction as we consider here, we can reduce as follows: Now this latter term can be reduced in two ways: the first is: The other contraction gives: which corresponds to a CBN reduction.Using the reduction rule (→ ′ ), we can only reduce: So [13] partially (i.e.essentially) restricts reduction to CBN.Definition 3.1 (SYSTEM M ∩ [13]) i) Types are defined by Intersection is associative and commutative, and ii) The type assignment rules are defined by: Notice that union types are omitted, but that they are 'silently' present as negated intersection types; it is the view of the authors of [13] that union is not the dual of intersection, a view we don't share here.Moreover, notice that rule (∩R) is missing altogether: this in particular creates a problem with the subject expansion result that is claimed in [13], but collapses.There is only an implicit (∩R) in rule (→e), much as there was one in rule (→E) in the first presentation of the strict type assignment system in [1]; that system, however, also had an implicit general (∩I) rule that is missing here.
As for the subject reduction and expansion (soundness and completeness) results stated in [13], Example ?? essentially provides also a counter example against both.We will construct those, translating the derivations of that example to fit the new system.Example 3.2 Notice that, since the first derivation in Example ?? for c 1 uses rule (∩R), we cannot simulate that derivation in M ∩ , so cannot derive This now gives an immediate counter example against the subject expansion result of [13]: c 1 reduces to c 3 , but not every type assignment for c 3 is valid for c 1 .
We can assigning c 2 's type to c 1 .First we construct D: So the only statement derivable in the system of [13] for c 1 is c 2 's, which cannot be derived for c 3 , for reasons similar to those discussed in Example ??; this gives a counter example against subject reduction.
So both subject reduction and expansion of [13] collapse.
As already noted in [17], the problem lies in the fact that, although both intersection and union might be similar to the (logical) and and or, they are both not logical [18].In fact, when deriving in the derivation for c 2 : Γ, x:A∩B ⊢ M ′ ∆, there will be two 'leaves' for x, one deriving x:A∩B ⊢ M ′ x : A | , and the other deriving x:A∩B ⊢ M ′ x : B | .Then, as shown in Lemma 4.3, performing the μ reduction poses no problems, since the two derivations for Γ ⊢ M ′ µα.c 1 : A | ∆ and Γ ⊢ M ′ µα.c 1 : B | ∆ will be safely 'inserted' yielding a derivation for c 2 [µα.c 1 /x] : Γ ⊢ M ′ ∆.Contracting the µ redex, on the other hand, poses a problem.Since there is no 'leaf' for α that derives | α : A∩B ⊢ M ′ α:A∩B, we cannot 'in- sert' the derivation for Γ | μx.c 2 : A∩B ⊢ M ′ ∆ for the 'leaves' for α: this derivation does not 'distribute'.
A similar argument holds regarding union types and μ reduction.

The BCD Intersection Type Assignment for the λ-calculus [8]
The notion of intersection type assignment for λµ μ as defined in the next section is a conservative extension of the BCD-system presented in [8], in that we can translate lambda terms typeable in that system to λµ μ terms whilst preserving types.The BCD-system treats the two type constructors '→' and '∩' the same, allowing, in particular, intersection to occur at the right of arrow types; this general treatment is not necessary within the context of the λ-calculus (see [2]), but for λµ μ, as we saw in Example ??, to type all normal forms it is natural to have an intersection type occur on the right-hand side of an arrow type.

Definition 4.1 (INTERSECTION TYPES, STATEMENTS, AND CONTEXTS) i)
Let V be a countable (infinite) set of type-variables, ranged over by ϕ.The set T of intersection types, ranged over by A, B . .., is defined through the grammar: ii) A statement is an expression of the form M : A, with M ∈ Λ, and A ∈ T .M is the subject and A the predicate of M : A. iii) A context Γ is a partial mapping from term variables to intersection types, and we write x:A ∈ Γ if Γ x = A. We will write x ∈ Γ if Γ is not defined on x, and Γ\x when we remove x from the domain of Γ.
In the notation of types, as usual, right-most outer-most brackets will be omitted.
We will consider a pre-order on types which takes into account the idem-potence, commutativity and associativity of the intersection type constructor, and defines ⊤ to be the maximal element.

Definition 4.2
The relation ≤ is defined as the least pre-order (i.e.reflexive and transitive relation) on T such that: and the relation ∼ is defined by: T will be considered modulo ∼ ; then ≤ becomes a partial order.We will write n for the set {1, . . ., n}.It is easy to show that both (A∩B)∩C ∼ B∩(A∩C) and A∩B ∼ B∩ A, so the type constructor ∩ is associative and commutative, and we will write

and consider
⊤ to be the empty intersection: ⊤ = ∩ m A j .Moreover, we will assume, unless stated explicitly otherwise, that in ∩ n A i each A i is not an intersection type.(Ax We will write Γ ⊢ ∩ M : A for statements that are derived using these rules.

Extentional Intersection and union type assignment for λµ μ
In the sections above, we have seen that subject reduction is lost for the systems presented in [11] and [13].It might be clear that the approach of [13] did not improve the situation in that there also subject expansion was lost, and we will therefore not consider the union-through-negation approach; this brings us back to the approach of [11].
We have seen, in Example ??, three terms c 1 , c 2 and c 3 , such that This implies that, even when restricting to either CBN or CBV, subject reduction will collapse.We have also seen that, when adding a full contra-variant ≤ relation on types, with corresponding (≤) type assignment rules, this problem disappears.This is the direction we will explore in this section, and will show that also this system is closed for expansion; however, we will see, by giving counterexamples in the next section, that it is also not closed for reduction.

Definition 5.1 (INTERSECTION AND UNION TYPES, CONTEXTS) i)
The set T ∩∪ of intersection-union types (we will write T for short), ranged over by A, B, . . . is inductively defined by: ii) A context Γ of term-variables (∆ of context-variables) is a partial mapping from term-variables (context-variables) to types, represented as a set of statements with only distinct variables as subjects.
We will consider a pre-order on types which takes into account the idem-potence, commutativity and associativity of the intersection and union type constructors, and defines ⊤ to be the maximal element, and ⊥ to be the minimal.

Definition 5.2 (RELATIONS ON TYPES) i)
The relation ≤ is defined as the least pre-order on T such that: The equivalence relation ∼ on types is defined by: Notice that, since the relation defined here is a natural extension of that in Definition 2.2, we are free to use the same symbol.
ii) The equivalence relation ∼ on types is defined The set T can be considered modulo ∼; then ≤ becomes a partial order.Since intersection and union are associative and commutative (easy to verify), we will write ∩ n A i for A 1 ∩• • •∩ A n , and ⊤ (top) for the empty intersection type, as well as ∪ n A i for A 1 ∪• • •∪ A n , and ⊥ (bottom) for the empty union type.The following is easy to show: then, for every B j , there exists an A i j such that A i j ≤ B j .
ii) If ∪ n A i ≤ ∪ m B j then, for every A i , there exists a B j i such that Notice that the rules (⊤) and (⊥) are special cases of (∩R) and (∪L) by taking n = 0 as well and ignoring the fact that an intersection (or union) of an empty collection of sets is the empty set.
This system does not have choice: Example 5.7 Take the term µδ.λxµβ.x | δ | δ ; we can type this term as follows: As with the necessity of intersection to type x | x•α , we need both types for δ to type the whole term.It is therefore impossible to derive either ⊢ µδ.λxµβ.
The following properties hold: Proof: Easy.
Proof: Without loss of generality, we assume that this the derivation is proper.
then this is derived as follows: Then, by Lemma 3.5, B ≤ A, and by rule (≤R), also Γ ⊢ x | e : A ⊢ ∆, then this is derived as follows: Then, by Lemma 3.5, A ≤ B, and by rule (≤L), Γ | e : A ⊢ ∆.
The following expansion properties are easy to show: Then, by induction 2 there exists Then, by rules ( μ), (∪L) and (≤L), Γ | μx.c : A ⊢ α:∪ n B i , ∆, and by thinning and rule (∪L), some j ∈ n, and we can construct : By Lemma 3.10, there exists a B ∈ T such that c : Γ, x:B ⊢ ∆, and Γ ⊢ v : B | ∆.
Then we can derive: Then we can derive: 16 Suppose a union type has been used to type the command µα.c 1 | μz.c 2 , as follows: we want to derive the same result for µδ.c 1 | μx.x | μz.c 2 (notice that this term μ-reduces to the term above): As we will show in the next section, we cannot prove a general subject reduction result.However, we can show that the rule (→), μ-reduction towards an intersection, and µ-reduction towards a union are safe.First we deal with rule (→): then by Lemma 3.5, this derivation is constructed as follows: , so, in particular, for every i ∈ n there exists a j ∈ m such that C i →D i ≤ E j →F j , so such that E j ≤ C i and D i ≤ F j .But then we can derive: Now we expect the derivation for c 2 : Γ ⊢ δ:B, ∆ to be composed out of D 1 to D 5 ; however, since the intersection type in derivation D 5 cannot be split, we can at most derive: We could only solve this problem via (≤) if C∩D→E∪F is smaller than (C→E)∪(D→F); this is not the case.We can show (C→E)∪(D→F) ≤ C∩D→E∪F, but that is of no use here.
Looking at the essence of the examples, it seems that performing a µ-reduction towards an intersection type, or performing a μ-reduction towards a union type, is problematic.Let's first of all analyse the situation.If an intersection has been used to type a command, we find ourselves in either one of the following two situations: Only the first case is problematic, since from the second we get c[e/α] : ∩ n Γ i ∩Γ ⊢ ∪ n ∆ i ∪∆ by Lemma 4.4.For the first case, we normally cannot remove any of the types in ∩ n A i in the derivation D, so we cannot safely propagate D into the various D i .So this is the problem case that should be caught.
Similarly, for union, we have the situations: As above, only the second situation is possibly problematic, and propagating D into the D i should be avoided.
Summarising, it is problematic to: 1) perform a µ-reduction towards an intersection type, introduced via (∩R), or 2) perform a μ-reduction towards a union type, introduced via (∪L).Below, we will define a restriction of the notion of type assignment that will avoid these reductions.

Sound restrictions
In this section we will investigate if we can at least partially recover the soundness property by limiting reduction; we will look at both CBV and CBN.We will recover from the subject reduction only partially, in that we will obtain a soundness result for both notions of reduction, but at the price of sacrificing completeness.
The general idea will be to make sure that a reduction towards an introduced intersection will be blocked by allowing rule (∩R) only for values; that way, if v | e is typeable, and (∩R) is used to type v, then v is not a µ-abstraction, so a reduction towards v is excluded.Likewise, a reduction towards an introduced union will be blocked by allowing rule (∪L) only for slots.In fact, we will enforce witness reduction by modifying the system in such a way that It might seem tempting to define the system immediately with both these restrictions in place.However, it would be too restrictive: for example, we could not encode the lambda calculus whilst preserving assignable intersection types, whatever system used there: to type (λx.xx)(yy), for example, we must derive  From this example, it seems reasonable to allow full (∩R) for CBN; assuming we use the restriction on (∪L), how do we stop reducing into an intersection?Remember that this only happens in case µα.c | e , with e a slot; in that case, the intersection type on the right is superfluous, and only one proper type inside it is needed.
For CBV, we take the dual approach, and restrict the use of (∩R).To avoid a µ-reduction into an intersection, we either do not allow intersections for cuts at all (which, by the example above, is clearly to restrictive), or make sure that no intersection is introduced for µα.c via the restriction on (∩R).The only thing to solve is then to avoid the contraction of v | μx.c into a union, which is solved by the fact that then v is a value.Definition 6.1 (CBN INTERSECTION AND UNION TYPING FOR λµ μ) The notion of type assignment ⊢ N is defined as ⊢, by changing rule (∪L) into: For CBV, we define: Definition 6.2 (CBV INTERSECTION AND UNION TYPE ASSIGNMENT FOR λµ μ) The notion of type assignment ⊢ V is defined as ⊢, by changing rule (∩R) into: That subject-expansion now fails is immediate, since the condition on these rules (either the term is a value or the context is a slot) are not preserved by expansion.
To show that these solution indeed yield sound solutions, we first need to check the following properties:  As for the system suggested in [17] (there only the intersection and union rules for a CBN and CBV restriction are given), the added rules are: With these rules, none of the above result can be achieved; for example, there we cannot derive ⊢ λx.xx : ((A→B)∩ A)→B | , so cannot type all normal forms.Notice the role of intersection on term variables and union on context variables in Theorem 3.12; we cannot prove such a property for the system of [17].

Concluding remarks
It is worthwhile to observe that the system presented above is just one of the possible ways of dealing with intersection and union in the context of λµ μ.In fact, allowing intersection and union for activated formulae only, actually leans strongly on the similarity between those type constructs and the logical & and ∨.
An alternative would be to allow union and intersection to be assigned also to inactive statements, by adding a variant of (∪L) for c : Γ ⊢ ∆ and Γ ⊢ v : A | ∆, and of (∩R) for c : Γ ⊢ ∆ and Γ | e : A ⊢ ∆.However, this would not solve the subject reduction problem at all (and very likely make it worse).The approach followed (essentially, since it deals with a different calculus) in [4], is to not depend on the logical foundation at all any more, and to allow (∪L) and (∩R) only for commands: It is still possible then to preserve the types assignable in the ⊢ ∩ -system, but we would need a different interpretation function.
We have seen that it is straightforward to define a natural notion of type assignment to the sequent calculus λµ μ that uses intersection and union types.This system was shown natural in that we were able to show that subject expansion -the main reason to use either intersection or union -follows easily, and that both intersection and union play their natural and crucial role in that proof.
However, this ease is not paired with soundness with respect to subject reduction.As in similar notions for the λ-calculus, combining union and intersection types breaks the soundness of the system; unlike the λ-calculus, however, also intersection is problematic.We have isolated the problem cases, and seen that it is exactly the non-logical behaviour of both type constructors that causes the problem.We have looked at restrictions for either CBN or CBV reduction that overcome this defect, but all with the loss of the subject expansion result.
Although this does not affect the characterisation of strong normalisation, it does have negative implications with the respect to the obtainable results.For example, it is now impossible to define a filter-style semantics [8] using intersection and union types for λµ μ, even for the two confluent subreduction systems CBV and CBN.We will investigate the other standard properties, like characterisation of strong normalisation, approximation and head-normalisation in future work.

Definition 4 . 3
Intersection type assignment and derivations are defined by the following (sequent style) natural deduction system.