An estimation for the lengths of reduction sequences of the λμρθ -calculus
LLogical Methods in Computer ScienceVol. 14(2:17)2018, pp. 1–35https://lmcs.episciences.org/ Submitted Mar. 20, 2017Published Jun. 22, 2018
AN ESTIMATION FOR THE LENGTHS OF REDUCTION SEQUENCESOF THE λµρθ -CALCULUS
P´ETER BATTY ´ANYI AND KARIM NOURDepartment of Computer Science, Faculty of Informatics, University of Debrecen, Kassai ´ut 26,4028 Debrecen, Hungary e-mail address : [email protected]. Grenoble Alpes, Univ. Savoie Mont Blanc, CNRS, LAMA, 73000 Chamb´ery, France e-mail address : [email protected]
Abstract.
Since it was realized that the Curry-Howard isomorphism can be extendedto the case of classical logic as well, several calculi have appeared as candidates for theencodings of proofs in classical logic. One of the most extensively studied among them isthe λµ -calculus of Parigot [Par.92]. In this paper, based on the result of Xi presented forthe λ -calculus [Xi.99], we give an upper bound for the lengths of the reduction sequencesin the λµ -calculus extended with the ρ - and θ -rules. Surprisingly, our results show that thenew terms and the new rules do not add to the computational complexity of the calculusdespite the fact that µ -abstraction is able to consume an unbounded number of argumentsby virtue of the µ -rule. Introduction
The Curry-Howard isomorphism for classical logic.
In the early nineties it wasrealized that the Curry-Howard isomorphism can be extended to the case of classical logic[Gri.90, Mur.91]. Since then several calculi have appeared aiming to give an encodingof proofs formulated either in classical natural deduction or in classical sequent calculus[BaBe.96, CuHe.00, Par.92, ReSo.94].A noteworthy example of a calculus establishing a correspondence between terms andnatural deduction proofs is the λµ -calculus presented by Parigot [Par.90], which standsvery close in nature to the λ -calculus itself. Besides the usual variables a new type ofvariables is introduced, the so-called classical- or µ -variables. The calculus enriched withthe µ -variables is capable of representing proofs in classical natural deduction by terms viathe Curry-Howard isomorphism. The reduction rules corresponding to the new λµ -termsare defined in [Par.92]. In addition, further simplification rules, for example the ρ - and θ -rules, and the symmetric counterpart of the µ -rule, which is the µ (cid:48) -rule, were definedfor the λµ -calculus [Par.92, Par.93]. The motivation for introducing the µ (cid:48) -rule, and thesimplification rules ρ and θ , was the following. In the typed λ -calculus we are able to defineintegers by Church’s numerals and other data types in the usual manner [Kri.91]. For the Key words and phrases: classical logic ; λµ -calculus ; standardization ; length of reduction sequence. LOGICAL METHODS l IN COMPUTER SCIENCE DOI:10.23638/LMCS-14(2:17)2018 c (cid:13)
P. Battyányi and K. Nour CC (cid:13) Creative Commons
P. BATTY ´ANYI AND K. NOUR
Church numerals and the data types the unicity of representation of data holds. This meansthat, if we talk about the Church numerals only, every term of type N , where N is a type ofa Church numeral, is β -equal to a Church numeral. This is no more true for the λµ -calculus:we can find normal terms of type N that are not Church numerals. The problem is resolvedby introducing a symmetric equivalent of the µ -rule and some more reduction rules, namelythe ρ - and the θ -rules [Par.93]. We should remark that the price for adding more rules to thecalculus other than the β - and µ -rules was the disappearance of the usual proof theoreticalproperties, like confluence, in case of the λµµ (cid:48) -calculus. Even strong normalization is lost,when we consider the symmetric λµ -calculus together with the ρ -rule [Bat.07]. Parigothas already showed in [Par.97] that the λµ -calculus, i.e. when we consider the β - and the µ -rules only, is strongly normalizing: his proof was based on the Tait-Girard reducibilitymethod [Tai.67]. An arithmetical proof of the same result was presented by David and Nour[DaNo.03].1.2. The work of Xi.
Prior to presenting the work of Xi, we give an example which showsthat the length of a reduction sequence can be exponential in terms of the complexity of aterm even in the case of the simply typed λ -calculus. We define a sequence of simple typeswith recursion. Let N = ( X → X ) → ( X → X ), where X is a type variable and, for every i ∈ N , N i +1 = ( N i → N i ) → ( N i → N i ). For every n ∈ N we denote by n the n -th Churchnumeral. Let n , ..., n m ∈ N and P = ( n m ( ... ( n ( n n )) ... )). It is easy to check that P is of type N m − → N m − and reduces to the Church numeral n m. .. n n in n m. .. n n steps of β -reductions.In his paper [Xi.99], Xi obtains an upper bound for the lengths of reduction sequencesof the simply typed λ -calculus. First of all, he finds a bound for the leftmost reductionsequences of the λ I-calculus. Since any reduction sequence of a λ I-term is at most as long asthe leftmost one, he has immediately found a bound for the λ I-calculus. Next, he maps theset of λ -terms into the set of λ I-terms such that, for any reduction sequence of a λ -term, hecan find a reduction sequence of the corresponding λ I-term which is at least as long. As ourstarting example shows, it is inevitable that this bound will be exponential in relation tothe complexity (the number of symbols) of the term and/or the rank (the number of arrows)of the type of the term. In our treatment we chose to develop Xi’s method further, since,when aiming to find the terms with longest reduction sequences, λµ I-terms appeared to bepromising candidates and, among their reduction sequences, the standard ones turned outto be the ones with longest reduction paths.An improvement of Xi’s method appeared in the work of Asperti and L´evy [AsLe.13].They gave a refinement of Xi’s result which proved to be a considerable strengthening of thebound especially in the cases when the computation leads to normal forms of a sufficientlysimple structure (e.g. a variable or booleans). They showed that in these cases the length ofthe longest reduction sequence is at most a factorial of that of the shortest one.1.3.
The motivations of our work.
First of all, we note that the motivation for theintroduction of the λµ -calculus was not the enhancement of the expressive power of the λ -calculus but rather the need for representing program constructs, like exit , call/CC , whichwere missing from the simply typed λ -calculus. The power of the new calculus stems fromthe fact that a µ -abstraction can consume any number of arguments through subsequentreductions. N ESTIMATION FOR THE LENGTHS OF REDUCTION SEQUENCES OF THE λµρθ -CALCULUS 3
Interestingly, our results show that the upper bound for the number of reduction stepsof a term in the λµ -calculus stays close to the expression giving an upper bound for the λ -calculus. One expects that this bound should increase in comparison with the λ -calculus,since the λµ -calculus properly contains the λ -calculus.Intuitively, one should try to simulate the λµ -calculus with the help of the λ -calculusand hence obtain a bound for the lengths of the reduction sequences. This type of simulationhas two defects: first of all, the upper bound for the lengths would grow considerably and,secondly, additional difficulties would come up when we want to simulate the simplificationrules (for a detailed explanation see Section 5). Hence, in spite of the expected difficultieswith respect to the handling of critical pairs and, consequently, with relation to the choiceof the definition of standard reduction sequences, we have voted for the adaptation of Xi’smethod.There are several works concerning the standardization of the λµ -calculus [Bat.07,DaNo1.05, Py.98, Sau.10]. David and Nour [DaNo1.05] consider standardization of the λµ -calculus without simplification rules, while Py [Py.98] chooses simplification rules bywhich the confluence is retained in the extended calculi. This eliminates the difficultiesimposed on the treatment of the critical pairs. A different aspect is that of Saurin [Sau.10].He works with essentially the same calculus: basically, he considers the rules β , µ , ρ and θ , which are sufficient to obtain confluency in the calculus. In his calculus, he also appliessome other- local and global- simplification rules besides the already mentioned ones. Inspite of the complexity of this calculus, Saurin succeeds in defining the notion of a standardreduction sequence and he also obtains a standardization theorem. His definition follows thetraditional way: he uses the notion of residuals (one cannot reduce the residual of a redexlying to the left of a redex reduced). This results in a rather technical proof. However, noneof the works mentioned contain estimations for the lengths of standard reduction sequences.Instead of the traditional way, we chose to define the notion of a standard reduction sequencefollowing the style of David [DaNo1.05] so that the proofs can be carried out by recursionon the lengths of the reduction sequences.1.4. Outline of the present work.
In this paper, following the reasoning of Xi [Xi.99] forthe simply typed λ -calculus, we present an upper bound for the lengths of the reductionsequences in the λµρθ -calculus in terms of the complexity and the rank of the term M , wherethe rank of M is the maximum of its redex ranks and the complexity of a term is the numberof symbols in M . We base our treatment on [Bat.07]. First we prove a standardizationtheorem for the λµ -calculus with the additional assertion that, in the case of the λµ I-calculusthe length of a reduction sequence is majorized by that of its standardization, which is,in turn, bounded from above by a certain measure defined in the paper. In addition, weshow that, if M is a λµ I-term, then a standard reduction sequence leading to the normalform of M is the leftmost reduction sequence, which is necessarily unique. This fits ourintuition, as a matter of fact. Thus it makes no difference in which way we are able to findthe standard reduction sequence leading to the normal form of M : it is by all means thelongest reduction sequence normalizing M . Thus, as our first task, we find an appropriate,normalizing reduction sequence for λµ I-terms such that its standardization provides us witha measure which is a super-exponential number theoretic function and an upper bound forthe length of the standard reduction sequence. This is accomplished in Section 4. Hence,our strategy for a general term M is to define a translation [[ M ]] k of M into the λµ I-calculussuch that the longest reduction sequence of M is not longer than the longest reduction P. BATTY ´ANYI AND K. NOUR sequence of [[ M ]] k . Since we have already obtained a bound for the reduction sequences of[[ M ]] k , we also have one for those of M .1.5. Some difficulties and our proposed solutions.
The new redexes, and especiallythe critical pairs, impose additional difficulties: we reformulated the notion of a standardreduction sequence in the λµρθ -calculus in line with the definition of standard β -reductionsequences according to David [Dav.01]. The resulting notion proved to be vastly different inappearance from that for the λ -calculus. With the presence of the new rules overlappingredexes can occur: performing a θ -redex can make a µ -redex to vanish and executing a θ -redex can make a ρ -redex to disappear and vice versa. Our definition of a standard reductionsequence excludes these situations: overlapping θ - and µ -redexes are always considered µ -redexes. Likewise, in the case overlapping θ - and ρ -redexes, a θ -redex in not allowed todestroy the containing ρ -redex and vice versa. We show that our choice is appropriate:we can always find standard reduction sequences respecting these constraints. Due to thepresence of other reduction rules, finding the bound and proving that the lengths of thereduction sequences obey that bound is more difficult even in the case of λµ I-terms. Insteadof treating as candidates every possible λµ I-sequences of reductions for the estimation likeXi does for the λ I-calculus, we compute the bound only by starting from a special kindof λµ I-reduction sequence which we call good k -normalization sequence. We evaluate thebound for the general case by assigning a λµ I-term [[ M ]] k with a certain k to the λµ -term M such that the length of the longest reduction paths of [[ M ]] k is greater than or equal tothat of M . Concerning the general case, our transformation of M into [[ M ]] k is in fact acorrection of Xi’s argument [Xi.99], the original idea of Xi contained a slight impreciseness.Namely, when M is a λ -abstraction, we have to apply case distinction deciding whether M is the left hand side of a β -redex or not. Otherwise the size of the corresponding λµ I-term,[[ M ]] k , could not be estimated correctly.As a general remark, we can observe that the bound obtained for the λµ -calculusis exactly the same as the one obtained by Xi [Xi.99] for the λ -calculus, except for thefact that the ranks of the redexes and hence the measures of the reduction sequences aregeneralizations of the corresponding notions for the λ -calculus. Perhaps, this surprising resultcould be interpreted as an informal statement saying that the computational complexity ofthe λµ -calculus has not been increased by introducing the classical variables in the λ -calculus.2. The λµρθ -calculus
The syntax of calculus.
The λµρθ -calculus was introduced by Parigot [Par.92].Instead of his original calculus, we use a modified version owing to de Groote [deG.98]: weapply the term formation rules in a more flexible way, that is, we do not assume that a µ -abstraction ( µα.M ) must be of the form ( µα. ([ β ] M )) for some β and M . In what follows,we give the appropriate definitions. Definition 2.1 (Terms) . (1) There are two kinds of variables : the set of λ -variables V = { x, y, z, . . . } and the set of µ -variables W = { α, β, γ, . . . } . The set of terms is denoted by T and the term formationrules are: T := V | ( λ V . T ) | ( µ W . T ) | ([ W ] T ) | ( T T ) . N ESTIMATION FOR THE LENGTHS OF REDUCTION SEQUENCES OF THE λµρθ -CALCULUS 5 (2) The complexity of a term is defined as follows: • comp ( x ) = 1, • comp ([ α ] M ) = comp ( λx.M ) = comp ( µα.M ) = comp ( M ) + 1, • comp ( M N ) = comp ( M ) + comp ( N ).(3) As usual we denote by F v ( M ) the set of variables ooccuring free in the term M .(4) Let M and N be terms. We write N ≤ M if N is a subterm of M and N < M , if N ≤ M and N (cid:54) = M .In brief, the complexity of a term is the number of symbols in the term. By the formationof terms we apply the usual stipulations: the scope of the λ - and µ -abstractions extend tothe right as far as possible, moreover, the abstractions are right associative, whereas theterm application is left associative. The calculus examined by us is the simply typed one,the typing relation is presented in the next definition. Definition 2.2 (Type system) . (1) The types are built from atomic formulas (or, in other words, atomic types) andthe constant symbol ⊥ with the connector → . As usual for every type A , ¬ A is anabbreviation for A → ⊥ .(2) The length of a type A (denoted by lh ( A )) is defined as the number of arrows of A .(3) In the definition below, Γ denotes a (possibly empty) context, that is, a finite set ofdeclarations of the form x : A (resp. α : ¬ A ) for a λ -variable x (resp. a µ -variable α )and type A such that a λ -variable x (resp. a µ -variable α ) occurs at most once in anexpression x : A (resp. α : ¬ A ) of Γ. The typing rules are:Γ , x : A (cid:96) x : A ax Γ , x : A (cid:96) M : B Γ (cid:96) λx.M : A → B → i Γ (cid:96) M : A → B Γ (cid:96) N : A Γ (cid:96) M N : B → e Γ , α : ¬ A (cid:96) M : A Γ , α : ¬ A (cid:96) [ α ] M : ⊥ ⊥ Γ , α : ¬ A (cid:96) M : ⊥ Γ (cid:96) µα.M : A µ (4) We will say that a term M is typable with A , if there is a set of declarations Γ suchthat Γ (cid:96) M : A holds. Definition 2.3 (Reduction rules) . (1) We have four kinds of redexes • a β -redex : term of the form ( λx.M ) N , • a µ -redex : term of the form ( µα.M ) N , • a ρ -redex : term of the form [ α ] µβ.M , • a θ -redex : term of the form µα. [ α ] M and α (cid:54)∈ F v ( M ).We denote by N F the set of normal forms i.e. terms without redex.(2) The reduction rules are as follows: • The β -reduction rule is ( λx.M ) N → β M [ x := N ]where M [ x := N ] is obtained from M by replacing every x in M by N . • The µ -reduction rule is ( µα.M ) N → µ µα.M [ α : = r N ]where M [ α : = r N ] is obtained from M by replacing every subterm in M of the form[ α ] U by [ α ]( U N ). P. BATTY ´ANYI AND K. NOUR • The ρ -reduction is [ α ] µβ.M → ρ M [ β := α ]where M [ β := α ] is obtained by exchanging in M every free occurrence of β for α . • The θ -reduction is µα. [ α ] M → θ M provided α (cid:54)∈ F v ( M ).(3) Let R be a redex of M . We write M → R N if N is the term M after the reduction of R . If M = M → R M → R . . . → R n M n +1 = N , then σ = [ R , . . . , R n ] denotes thisreduction sequence, n = | σ | and we write M (cid:55)→ σ N .(4) Let σ , ν be (possibly empty) sequences of reductions. Then σ ν denotes their concate-nation. Let σ = [ R , . . . , R n ]. We denote by σ [ x := M ] (resp. σ [ α := r M ]) the reductionsequence [ R [ x := M ] , . . . , R n [ x := M ]] (resp. [ R [ α := r M ] , . . . , R n [ α := r M ]]). More-over, let σ [ α := β ] denote the reduction sequence [ R [ α := β ] , . . . , R n [ α := β ]].(5) As it is customary, by a reduction step we mean the closure of the reduction relationcompatible with respect to the term formation rules. In general → denotes the compatibleclosure of a reduction relation, or that of the union of some set of relations, while by (cid:55)→ we mean the reflexive, transitive closure of → . Sometimes we write M (cid:55)→ n N if M isreduced with n steps of reductions to N .(6) If M is strongly normalizing i.e. M has no infinite reduction sequences, then, by K¨onig’sinfinity lemma, η ( M ) will denote the length of the longest reduction sequence startingfrom M .We present below some theoretical properties of the λµρθ -calculus. Theorem 2.4 (Church-Rosser property) . Let M , M and M be terms such that M (cid:55)→ M and M (cid:55)→ M . Then there exists an term M for which M (cid:55)→ M and M (cid:55)→ M . A proof of the above assertion can be found in the papers of Parigot [Par.92], Py [Py.98]or Rozi`ere [Roz.03]. Py [Py.98] expounded the question to a greater extent together withthe results belonging to the topic.
Proposition 2.5 (Type preservation property) . Let M , N and A , Γ be such that Γ (cid:96) M : A and M (cid:55)→ N . Then Γ (cid:96) N : A . The property can be verified by double induction on the length of the reduction sequence M (cid:55)→ N and the complexity of M . Theorem 2.6 (Strong normalization) . If M is a typable term, then M is strongly normalizingi.e. every reduction sequence starting from M is finite. There are several proofs of this result in the literature. Consider, for example, Parigot[Par.97], David and Nour [DaNo.03]. In [deG.01], de Groote proves the strong normalizationof the simply typed λµ -calculus extended with terms of conjunctive and disjunctive types,respectively. He does not consider the ρ - and θ -reduction rules in his calculus.Albeit, we aim to find an upper bound for the reduction sequences of the λµ -calculus enrichedwith the ρ - and θ -rules, as a by-product we also obtain a proof for the strong normalization ofthe λµρθ -calculus. We consider fewer simplification rules than Saurin [Sau.10], however, ournotion of standardness is formulated in a different form which enables us to prove statementsconcerning standard reduction sequences by induction on the complexity of terms.In this paper we consider only simply typed λµ -terms. The typing relations involve thata µ -variable cannot have but one argument, that is, we are not allowed to formulate termsof the form (([ α ] M ) N ), where α is a µ -variable and M , N are arbitrary terms. N ESTIMATION FOR THE LENGTHS OF REDUCTION SEQUENCES OF THE λµρθ -CALCULUS 7
Head and leftmost reductions.
In order to proceed to the standardization theorem,we define the notions of head- and leftmost reduction sequences. Both are special cases ofthe standard reduction sequences discussed in the next section.
Definition 2.7. (1) Let M be a term and −→ P a possibly empty sequence of terms P , . . . , P n . We write( M −→ P ) for the term ( . . . (( M P ) P ) . . . P n ), which also is denoted by ( M P . . . P n ).(2) Let M = ( P . . . P n ) = ( P −→ P ), with a possibly empty sequence of terms −→ P . Then, for2 ≤ i ≤ n , we write P i ∈ −→ P and we call P i (2 ≤ i ≤ n ) the components of −→ P or thearguments of P .(3) Let −→ P = P . . . P n . We write −→ P (cid:55)→ σ −→ P (cid:48) , where σ = σ . . . σ n is such that P i (cid:55)→ σ i P (cid:48) i (1 ≤ i ≤ n ). Lemma 2.8.
Every term M of the simply typed λµρθ -calculus can be written uniquely inone of the following forms. (1) M is a variable, (2) M = λx.M , or M = µα.M and M is not a θ -redex, or M = [ α ] M and M is not a ρ -redex, (3) M = ( x M −→ P ) , (4) M = ( λx.M ) M −→ P , or M = ( µα.M ) M −→ P , (5) M = [ α ] µβ.M , or M = µα. [ α ] M and α / ∈ F v ( M ) .Proof. By induction on comp ( M ).In the following definitions the functions hr and lr are undefined in the cases notmentioned explicitly. Definition 2.9. (1) The head-redex of a term M , in notation hr ( M ), is defined as follows. • hr ( λx.M ) = hr ( M ), • hr ( µα.M ) = µα.M if µαM is a θ -redex, and hr ( µα.M ) = hr ( M ) otherwise, • hr ([ α ] M ) = [ α ] M if [ α ] M is a ρ -redex, and hr ([ α ] M ) = hr ( M ) otherwise, • hr (( µα.M ) M −→ P ) = ( µα.M ) M , • hr (( λx.M ) M −→ P ) = ( λx.M ) M .If M = ( µα.M ) M −→ P , then a critical pair of redexes can emerge provided ( µα.M )is a θ -redex as well. In this situation we always choose the µ -redex ( µα.M ) M as thehead-redex of M .(2) Let M → R M → R . . . → R n M n +1 . Then σ = [ R , . . . , R n ] is a head-reductionsequence, if, for each 1 ≤ i ≤ n , R i is the head-redex of M i . We denote by M (cid:55)→ hd N the fact that M reduces to N via a head-reduction sequence. Definition 2.10. (1) The leftmost-redex of a term M , in notation lr ( M ), is defined as follows. • lr ( λx.M ) = lr ( M ), • lr ( µα.M ) = µα.M if µαM is a θ -redex, and lr ( µα.M ) = lr ( M ) otherwise, • lr ([ α ] M ) = [ α ] M if [ α ] M is a ρ -redex, and lr ([ α ] M ) = lr ( M ) otherwise, • lr (( µα.M ) M −→ P ) = ( µα.M ) M , • lr (( λx.M ) M −→ P )) = ( λx.M ) M , P. BATTY ´ANYI AND K. NOUR • lr ( x M M . . . M n ) = lr ( M i ) provided M i / ∈ N F and M j ∈ N F (1 ≤ j ≤ i − M → R M → R . . . → R n M n +1 is the leftmost-reductionsequence from M to M n +1 if R i is the leftmost-redex of M i (1 ≤ i ≤ n ). We denote by M (cid:55)→ lrs N the fact that M reduces to N via a leftmost-reduction sequence. Then thereduction sequence itself is denoted by lrs ( M (cid:55)→ N ). If M (cid:55)→ σ N and σ is a leftmostreduction sequence, then σ is unique.Following the tradition of relating head reduction sequences to leftmost reductionsequences in the case of the λ -calculus [Bar.85], we compare briefly the two notions ofreductions. Lemma 2.11.
Every head-reduction sequence is a leftmost-reduction sequence.Proof.
A straightforward induction on the complexity of the term, comparing the varioussubcases of Definitions 2.9 and 2.10.We give a sketch of the proof that every leftmost-reduction sequence is the concatenationof head-reduction sequences, however. To this end, we first settle what we mean by a termbeing in head-normal form.
Definition 2.12.
A term M is in head-normal form (in notation M ∈ HN F ), if one of thefollowing cases is valid.(1) M = λx.M and M ∈ HN F ,(2) M = ( x M . . . M k ),(3) M = µα.M , M is not a θ -redex and M ∈ HN F ,(4) M = [ α ] M , M is not a ρ -redex and M ∈ HN F .We say that M (cid:48) ∈ HN F is a head-normal form of M , if M (cid:55)→ hd M (cid:48) . Observe that, sincethe typed λµρθ -calculus is strongly normalizing, every term has a unique head-normal form.Prior to detailing the connection between leftmost reduction and head reduction, weintroduce a new notion. Definition 2.13.
Let M ∈ HN F .(1) The core of M , in notation core ( M ), is defined as follows. • If M = λx.M , or M = µα.M , or M = [ α ] M , then core ( M ) = core ( M ). • If M = x , or M = ( M M ), then core ( M ) = M .Observe that, if M ∈ HN F , core ( M ) can be obtained from M if we omit the initial λ -, µ -prefixes or µ -variables standing in front of M .(2) Assume core ( M ) = ( x −→ P ) with a possibly empty −→ P . Then we call the components of −→ P the components of M , as well.Intuitively, a leftmost reduction sequence is a head reduction sequence until the termreaches a head normal form. At this point, the leftmost reduction sequence is the concatena-tion of leftmost reduction sequences of the components. This is the content of the lemmabelow. Lemma 2.14.
Let M (cid:55)→ σ M (cid:48)(cid:48) be a leftmost reduction sequence and assume M (cid:48)(cid:48) ∈ N F .Then there exists M (cid:48) ∈ HN F and σ (cid:48) , σ (cid:48)(cid:48) such that M (cid:55)→ σ (cid:48) M (cid:48) (cid:55)→ σ (cid:48)(cid:48) M (cid:48)(cid:48) , where σ (cid:48) is ahead reduction sequence and, if core ( M (cid:48) ) = ( x M (cid:48) . . . M (cid:48) k ) , then σ (cid:48)(cid:48) = ν . . . ν k such that core ( M (cid:48)(cid:48) ) = ( x M (cid:48)(cid:48) . . . M (cid:48)(cid:48) k ) , M (cid:48) i (cid:55)→ ν i M (cid:48)(cid:48) i and ν i are leftmost reduction sequences (1 ≤ i ≤ k ) . N ESTIMATION FOR THE LENGTHS OF REDUCTION SEQUENCES OF THE λµρθ -CALCULUS 9
Proof.
By induction on comp ( M ) taking into account the subcases of Definition 2.10. Let M (cid:55)→ σlrs M (cid:48)(cid:48) and assume σ = [ R ] (cid:98) σ . A straightforward observation of the points ofDefinitions 2.9 and 2.10 gives that, if M (cid:48)(cid:48) / ∈ HN F , then R is the head redex of M . Hencewe may assume M (cid:55)→ σ (cid:48)(cid:48) M (cid:48)(cid:48) , where M ∈ HN F . Then, by induction on comp ( M ), weobtain that we may suppose that M = x or M = ( x M . . . M n ). By Definition 2.10, bothassumptions immediately yield the result.2.3. Other definitions.
We define in this subsection the notion of a λµ I-term and a λµ I-redex, together with some main properties of the λµ I-calculus.
Definition 2.15. (1) The set of λµI -terms is defined inductively as follows: • x is a λµI -term, • λx.M is a λµI -term provided M is a λµI -term and x ∈ F v ( M ), • ( M N ) is a λµI -term if M and N are λµI -terms, • µα.M is a λµI -term provided M is a λµI -term and α ∈ F v ( M ), • [ α ] M is a λµI -term provided M is a λµI -term.(2) If M = ( λx.M ) M (resp. M = ( µα.M ) M , where λx.M (resp. µα.M ) and M are λµ I-terms, then M is called a λµ I-redex.It is easy to see that, if M is a λµ I-term and M (cid:55)→ M (cid:48) , then M (cid:48) is a λµ I-term. Thus, itis clear that this calculus also has the following three properties: Church-Rosser-property,type preservation and strong normalization.The next section is concerned with a standardization result in the λµρθ -calculus. In thesequel, we are going to use the notions of subterms, redexes, reduction sequences, residualsetc. in an intuitive manner.A reduction sequence M → R M → R . . . → R n M n +1 is a sequence of terms and redexoccurrences, where M i +1 is obtained by reducing with R i in M i (1 ≤ i ≤ n ). In what follows,by an abuse of notation, a reduction sequence will be referred to without noting explicitlythe exact occurrences of the redexes in the terms, if they are clear from the context. Wegive a short account of the intuitive notions for residuals and involvement of redexes. Definition 2.16. (1) Let M → R M (cid:48) be a reduction step.(a) If R = ( λx.R ) R < M , then R and λx.R have no residuals, otherwise, if( λx.R ) R < U ≤ M , we obtain the residual of U by exchanging ( λx.R ) R for R [ x := R ] in U . When U ≤ R , then we obtain the residual by substitutingeach occurrence of x by R in U . In the case of U ≤ R , the residual of U is thesame, only its position changes in M (cid:48) : its index will be one of the indices of aformer occurrence of x in R . If R and U are disjoint, then the residual of U is U itself.(b) The situations are analogous in the cases of the other redexes: if R = ( µα.R ) R ,then R has no residual, if R = [ α ] µβ.R , then R and µβ.R have no residuals,and, finally, if R = µα. [ α ] R , then R and [ α ] R have no residuals. Besides theseafore-said cases, if R < U ≤ M , then we obtain the residual of U , if we executethe redex R in U . When U < R and U has a residual: if R = ( µα.R ) R and U ≤ R , we obtain the residual by recursively exchanging every subterm [ α ] P of U by [ α ]( P R ). If U ≤ R , then the residual is U only its index changes in M (cid:48) .Otherwise, for U ≤ R and R = [ α ] µβ.R , the residual is U [ β := α ]. If U ≤ R and R = µα. [ α ] R , then the residual is U just the index is modified in M (cid:48) .(2) Residuals of terms with respect to reduction sequences are defined in a recursive way:we obtain the residuals with respect to a reduction sequence if we compute the residualsof the residuals with respect to subsequences of the reduction sequence.(3) Let σ be the reduction sequence M → R M → R . . . → R n M n +1 , assume R ≤ M is aredex. Then we say that R is involved in σ , if there is an 1 ≤ i ≤ n such that R = R i and R i is a residual of R with respect to M → R . . . → R i − M i .In what follows, most of the proofs will follow an induction on lexicographically orderedtuples of integers. Ordering of tuples is understood in the usual lexicographic manner:( n, m ) ≤ ( n (cid:48) , m (cid:48) ) iff either n < n (cid:48) or n = n (cid:48) and m ≤ m (cid:48) .3. Standardization for the λµρθ -calculus
Our results concerning the standardization of the λµ -calculus are not the strongest ones. Infact, some of our statements are valid for the λµ I-calculus only. A standardization result canbe found in the paper of Saurin [Sau.10], where, besides the rules mentioned in our article,some other rules are taken into account. Our only concern with the standardization is ouraim to find an upper bound for the reduction sequences of the λµ -calculus. In the presentsubsection we define a notion of a standard reduction sequence for the λµρθ -calculus andfind some assertions concerning their lengths. Many of the proofs are adaptations of theones related to the simply typed λ -calculus in [Xi.99]. The result itself, however, is not asimple generalization of Xi’s method. In the presence of µ -, ρ - and θ -reductions overlappingredexes mean the greatest obstacle to a straightforward formulation of standardness. Wesuggest the following solution to this problem. We define the notion of a standard reductionsequence such that every standard reduction sequence should obey the following properties:when a redex, which is simultaneously a µ - and a θ -redex, is involved in a standard reductionsequence, we stipulate that the redex should be understood only as a µ -redex. Likewise,when a θ -redex would destroy a containing ρ -redex we prohibit reducing the θ -redex, andwhen a ρ -redex would make a containing θ -redex disappear, we forbid the ρ -redex until the θ -redex exists. These raise additional issues in the estimation of the lengths of standardreduction sequences: we must take into account the numbers of arguments of such θ -redexesthat are simultaneously µ -redexes and we must exclude some reduction sequences from theset of standard reduction sequences in order to deal with the overlapping ρ - and θ -redexes.These considerations are reflected in the definition of a standard reduction sequence andin the measure for a term presented in Definition 3.18. We show that our suggestion for asolution is appropriate: we can majorize every reduction sequence by a standard reductionsequence of Definition 3.1.We should remark that the widely known and intuitive definition requires of a standardreduction sequence that no redex is a residual of a redex which lies to the left of someother redex in the sequence [Bar.85]. Instead of this, we use a definition of a standardreduction sequence similar to the one applied in [Dav.01], which enables us to prove propertiesconcerning standard reduction sequences by induction on the complexity of terms. N ESTIMATION FOR THE LENGTHS OF REDUCTION SEQUENCES OF THE λµρθ -CALCULUS 11
Standard reduction sequences in the λµρθ -calculus.
In this subsection we definethe notion of a standard βµρθ -reduction sequence and present some elementary lemmasconcerning properties of standard reduction sequences. In the definition below, we clarifywhat we mean by a standard βµρθ -reduction sequence. The definition is structured byinduction on the lexicographically ordered pair ( | σ | , comp ( M )). Definition 3.1.
A reduction sequence M (cid:55)→ σ N is standard if, either it is empty, or one ofthe following cases holds.(1) M = λx.M , N = λx.N , M (cid:55)→ σ N and σ is standard.(2) If M = µα.M , let M (cid:55)→ σ N be M = P → P → . . . → P k +1 = N .(a) Either N = µα.N , M (cid:55)→ σ N and σ is standard and none of P j is a θ -redex(1 ≤ j ≤ k + 1),(b) or let M (cid:55)→ σ (cid:48) µα. [ α ] M (cid:48) = P j such that P j is the first term in the sequence which isa θ -redex and σ (cid:48) is standard and(i) either µα. [ α ] M (cid:48) = P j → θ M (cid:48) (cid:55)→ σ (cid:48)(cid:48) N ,(ii) or µα. [ α ] M (cid:48) = P j (cid:55)→ σ (cid:48)(cid:48)(cid:48) µα. [ α ] N (cid:48) such that M (cid:48) (cid:55)→ σ (cid:48)(cid:48)(cid:48) N (cid:48) ,where σ (cid:48)(cid:48) and σ (cid:48)(cid:48)(cid:48) are standard.(3) If M = [ α ] M , let M (cid:55)→ σ N be M = P → P → . . . → P k +1 = N .(a) Either N = [ α ] N , M (cid:55)→ σ N and σ is standard and none of P j is a ρ -redex(1 ≤ j ≤ k + 1),(b) or let M (cid:55)→ σ (cid:48) [ α ] µβ.M (cid:48) = P j such that P j is the first term in the sequence which isa ρ -redex and σ (cid:48) is standard and(i) either [ α ] µβ.M (cid:48) = P j → ρ M (cid:48) [ β := α ] (cid:55)→ σ (cid:48)(cid:48) N ,(ii) or [ α ] µβ.M (cid:48) = P j (cid:55)→ σ (cid:48)(cid:48)(cid:48) [ α ] µβ.N (cid:48) such that M (cid:48) (cid:55)→ σ (cid:48)(cid:48)(cid:48) N (cid:48) ,where σ (cid:48)(cid:48) and σ (cid:48)(cid:48)(cid:48) are standard.(4) M = ( λx.M ) M . . . M n and(a) either M → β ( M [ x := M ] . . . M n ) (cid:55)→ σ N and σ is standard,(b) or M (cid:55)→ σ ( λx.N ) M . . . M n (cid:55)→ σ ( λx.N ) N . . . M n (cid:55)→ σ . . . (cid:55)→ σ n ( λx.N ) N . . . N n = N and σ i (1 ≤ i ≤ n ) are standard.(5) M = ( µα.M ) M . . . M n and(a) either M → µ ( µα.M [ α := r M ] . . . M n ) (cid:55)→ σ N and σ is standard,(b) or M (cid:55)→ σ ( µα.N ) M . . . M n (cid:55)→ σ ( µα.N ) N . . . M n (cid:55)→ σ . . . (cid:55)→ σ n ( µα.N ) N . . . N n = N and σ i (1 ≤ i ≤ n ) are standard.(6) M = ( x M . . . M n ), M = ( x M . . . M n ) (cid:55)→ σ ( x N . . . M n ) (cid:55)→ σ . . . (cid:55)→ σ n ( x N N . . . N n ) = N and σ i (1 ≤ i ≤ n ) are standard.In the rest of this paper, we may treat a reduction sequence σ as a list of the terms in σ orsometimes as the list of the redex occurrences of the reduction sequence. In accordance withthis, given a standard reduction sequence M → R M → R . . . → R n M n +1 , we may say thatthe sequence M , . . . , M n +1 is standard (the redex occurrences are implicitly understood in M i ), or we may talk about the same thing by just saying that the sequence σ = [ R , . . . , R n ]is standard. In notation: σ ∈ St .We illustrate some of the difficulties in the example below, when we want to assertstatements about standard reduction sequences. Example 3.2.
Let M = ( µα. [ α ] λu. ( µβ. [ β ] λy.x )[ α ] x ) x . Then, if we choose the θ -redex µβ. [ β ] λy.x , we obtain M → θ ( µα. [ α ] λu. ( λy.x )[ α ] x ) x , and, since we are not allowed toreduce the redex ( λy.x )[ α ] x , there are no more reductions provided we restrict ourselves to standard ones. On the other hand, if we choose the µ -redex ( µβ. [ β ] λy.x )[ α ] x , then M → µ ( µα. [ α ] λu.µβ. [ β ]( λy.x )[ α ] x ) x → β ( µα. [ α ] λu.µβ. [ β ] x ) x → µ µα. [ α ]( λu.µβ. [ β ] x ) x → θ ( λu.µβ. [ β ] x ) x → β µβ [ β ] x → θ x is standard.The above definition prevents standard reduction sequences from having overlapping θ -and ρ -redexes that could eliminate each other. Moreover, our definition of standardness issuch that it gives rise to the following distinction between standard reduction sequences,at least in the case of the λµ I-calculus: given a λµ I-term, if the head redex exists, thena standard reduction sequence either begins with the head redex or the head redex hasa unique residual in the resulting term, which is the head redex of the result itself. Thiswill be demonstrated in Lemmas 3.8 and 3.10. On the other hand, in the general case, thesituation is a little more complicated as Examples 3.9 and 3.11 show. Example 3.9 evendemonstrates that, in the general case, in the presence of the θ -rule, a standard reductionsequence is not necessarily left to right, in contrast with the case of the λ -calculus.Our aim in this section is to obtain a standardization theorem for the λµρθ -calculus,together with an upper bound on the lengths of the standard reduction sequences. Tothis end, we state and prove some auxiliary propositions first concerning the behaviour ofstandard reduction sequences and then we present some lemmas providing upper bounds forthe lengths of reduction sequences starting from terms obtained as the results of substitutions.We state our first theorem saying that left-most reduction sequences are special cases ofstandard reduction sequences. Theorem 3.3.
Every leftmost reduction sequence is standard.Proof.
Immediate from Definitions 2.10 and 3.1.The following lemma states that a reduction sequence, which consists of a head reductionsequence followed by a standard reduction sequence is itself standard.
Lemma 3.4.
Let M (cid:55)→ σ (cid:48) M (cid:48) (cid:55)→ σ (cid:48)(cid:48) M (cid:48)(cid:48) such that σ (cid:48) is a head-reduction sequence and σ (cid:48)(cid:48) isstandard. Then σ = σ (cid:48) σ (cid:48)(cid:48) is standard.Proof. Let σ (cid:48) = [ R ] ν . We prove the result by induction on ( | σ (cid:48) | , comp ( M )), taking intoaccount the various points of Definition 2.9. Assume | ν | = 0. We deal with two of the casesonly.(1) M = [ α ] M .(a) Assume M is a ρ -redex, then M = µβ.M and M → ρ M [ β := α ] (cid:55)→ σ (cid:48)(cid:48) M (cid:48)(cid:48) isstandard by point 3 of Definition 3.1.(b) If R ≤ M , then the induction hypothesis applies.(2) M = ( µα.M ) M . . . M n . In this case the head redex of M is ( µα.M ) M . Thus M → µ ( µα.M [ α := r M ] . . . M n ) (cid:55)→ σ (cid:48)(cid:48) M (cid:48)(cid:48) and σ is standard by point 5 of Definition3.1.The cases when | ν | > M , M (cid:48) and N , N (cid:48) such that M (cid:55)→ st M (cid:48) and N (cid:55)→ st N (cid:48) , then it is also true that M [ x := N ] (cid:55)→ st M (cid:48) [ x := N (cid:48) ] and M [ α := r N ] (cid:55)→ st M (cid:48) [ α := r N (cid:48) ], respectively. N ESTIMATION FOR THE LENGTHS OF REDUCTION SEQUENCES OF THE λµρθ -CALCULUS 13
Lemma 3.5. (1)
Let M = ( M M ) (cid:55)→ σ ( µα.M ) M → µ ( µα.M [ α := M ]) (cid:55)→ ν N such that σ , ν ∈ St and suppose µα.M is the first term of the reduction sequence M (cid:55)→ σ µα.M of theform µβ.P . Then ξ = σ µα.M ) M ] ν is standard. (2) Let M = ( M M ) (cid:55)→ σ ( λx.M ) M → µ M [ x := M ] (cid:55)→ ν N such that σ , ν ∈ St andsuppose λx.M is the first term of the reduction sequence M (cid:55)→ σ λx.M of the form λy.P . Then ξ = σ λx.M ) M ] ν is standard.Proof. We deal only with case 1. We examine some of the interesting cases. The proof goesby induction on ( | σ | , comp ( M )) taking into account the various points of Definition 3.1.(1) If σ is standard by virtue of point 2 of Definition 3.1, that is, M = µα.M , the onlypossibility is when R = µα. [ α ] R is the first θ -redex in the sequence. But then R is infact M , and [ R ] ν is standard by definition.(2) Let σ be standard by reason of point 5 of Definition 3.1. By assumption, the onlypossibility is M = ( µα.P ) P . . . P n and σ = [( µα.P ) P ] σ (cid:48) . The induction hypothesiscan be applied to σ (cid:48) and M (cid:48) = ( µα.P [ α := r P ] . . . P n ).The following lemma gives us some information on the form of a term which is a reductobtained by a standard reduction sequence. Lemma 3.6.
Let M (cid:55)→ σ M (cid:48) such that σ is standard. Assume the head-redex hd ( M ) of M ,if it exists, is not involved in σ . Then the following statements are true. (1) If M = λx.M , then M (cid:48) = λx.M (cid:48) , where M (cid:55)→ σ M (cid:48) . (2) If M = [ α ] M , then M (cid:48) = [ α ] M (cid:48) , where M (cid:55)→ σ M (cid:48) . (3) If M = ( M . . . M n ) , then there are standard σ , . . . , σ n and terms M (cid:48) , . . . , M (cid:48) n such that M i (cid:55)→ σ i M (cid:48) i (1 ≤ i ≤ n ) , M (cid:48) = ( M (cid:48) . . . M (cid:48) n ) and σ = σ . . . σ n . (4) If M = µα.M is a λµ I-term, then M (cid:48) = µα.M (cid:48) , where M (cid:55)→ σ M (cid:48) .Proof. By induction on ( | σ | , comp ( M )). We consider some of the typical cases.(1) M = ( µα.M ) M . . . M n . Since the head redex ( µα.M ) M is not involved in σ , point 5of Definition 3.1 yields the result.(2) M = µα.M . If M = µα [ α ] M is a θ -redex, then, since M is not involved in σ , point2 of Definition 3.1 yields that M (cid:55)→ σ N such that N = µα. [ α ] N . Assume now M isnot a θ -redex. Thus M is either not of the form µα. [ α ] M such that α / ∈ F v ( M ) or M = µα. [ α ] M and α ∈ F v ( M ). Then hd ( M ) = hd ( M ) and, applying the inductionhypothesis to M , it is straightforward to check that either M cannot reduce to a termof the form µα. [ α ] M (cid:48)(cid:48) , or M (cid:55)→ µα. [ α ] M (cid:48)(cid:48) and α ∈ F v ( M (cid:48)(cid:48) ). Again, by point 2 ofDefinition 3.1 we obtain the result.We remark that the assumption of M being a λµ I-term is crucial in Case 4 of Lemma3.6 as the following example shows.
Example 3.7. If M = µα. [ α ]( λx.x )(( λy.x )[ α ] x ), then hd ( M ) = ( λx.x )(( λy.x ) [ α ] x ). Con-sider the standard reduction sequence σ : M → β µα. [ α ]( λx.x ) x → θ ( λx.x ) x = M (cid:48) . Then hd ( M ) is not involved in σ , on the other hand, M (cid:48) is not of the form µα.M (cid:48) .In the next two lemmas our common assumption is that M is a λµ I-term. The lemmaswill serve as auxiliary statements when we prove that a standard normalizing reductionsequence is unique in the case of λµ I-terms.
Lemma 3.8.
Let M be a λµ I-term. If M (cid:55)→ σ M (cid:48) is standard such that the head-redex hd ( M ) of M exists and is not involved in σ , then the head-redex hd ( M (cid:48) ) of M (cid:48) exists and itis the unique residual of hd ( M ) with respect to σ .Proof. By induction on ( | σ | , comp ( M )), taking into account the various cases of Definition2.9. Let σ = [ R ] σ (cid:48) . We assume | σ (cid:48) | = 0. We examine some of the cases.(1) M = µα.M .(a) M = µα. [ α ] M .Assume M is a θ -redex. By assumption, M (cid:55)→ R M (cid:48) such that M (cid:48) = µα. [ α ] M (cid:48) .Then our assertion follows. We have also made use of point 2 (b) of Definition 3.1.Assume now M is not a θ -redex, which implies α ∈ F v ( M ). Then hd ( M ) = hd ( M )is not R , we have M (cid:55)→ R M (cid:48) . Since M is a λµ I-term, α ∈ F v ( M (cid:48) ) holds. Thus, if M (cid:48) = [ α ] M (cid:48) , hd ( M (cid:48) ) = hd ( M (cid:48) ), by which, and the induction hypothesis, we havethe result.(b) M (cid:54) = µα. [ α ] M . Let M → R M (cid:48) , where M (cid:48) = µα.M (cid:48) . By the induction hypothesis, hd ( M (cid:48) ) exists and it is the unique residual of hd ( M ), which is hd ( M ). We provethat hd ( M (cid:48) ) = hd ( M (cid:48) ), by which our assertion follows. By Definition 2.9, it isenough to verify that M (cid:48) is not a θ -redex. Lemma 3.6 shows that the only possibilityis M = µα. [ α ] M for some M provided M (cid:48) is a θ -redex, but this was excluded bythe assumption.(2) M = [ α ] M .(a) M = [ α ] µβ.M . Then our assumption and point 3 of Definition 3.1 yields thestatement.(b) M is not a ρ -redex. Then Lemma 3.6 ensures that M (cid:48) is not a ρ -redex either. If M (cid:55)→ R M (cid:48) , where M (cid:48) = [ α ] M (cid:48) , then hd ( M ) = hd ( M ) and hd ( M (cid:48) ) = hd ( M (cid:48) ), bywhich, together with the induction hypothesis, our claim follows.(3) M = ( µα.M ) M . . . M n . Since hd ( M ) is not R , the only possibility is M i → R M (cid:48) i forsome 1 ≤ i ≤ n . Hence our assertion follows.The case | σ (cid:48) | > M is a λµ I-term is necessary in the above lemma, too.
Example 3.9.
Let M = µα. [ α ]( λx.x )(( λy.x )[ α ] x ), as in Example 3.7, then hd ( M ) =( λx.x )(( λy.x )[ α ] x ). Consider the reduction sequence M → β µα. [ α ]( λx.x ) x = M (cid:48) . In thiscase hd ( M (cid:48) ) = M (cid:48) and it is not a residual of hd ( M ). Lemma 3.10.
Let M be a λµ I-term. If M (cid:55)→ σ M (cid:48) is standard and the head-redex hd ( M ) of M is involved in σ , then σ = [ hd ( M )] σ (cid:48) for some σ (cid:48) .Proof. The proof goes by induction on | σ | , considering the cases of Definition 3.1. If | σ | = 1,then the statement is trivial. Assume σ = [ R ] σ (cid:48) , where | σ (cid:48) | >
0, and let hd ( M ), the headredex of M , be different from R . Let M → R M (cid:48)(cid:48) (cid:55)→ σ (cid:48) M (cid:48) . By Lemma 3.8, the head redex hd ( M (cid:48)(cid:48) ) of M (cid:48)(cid:48) exists and it is the unique residual of hd ( M ) with respect to R . Then hd ( M (cid:48)(cid:48) )is involved in σ (cid:48) , thus, by the induction hypothesis, we have σ (cid:48) = [ hd ( M (cid:48)(cid:48) )] σ (cid:48)(cid:48) . Now, byexamining the various forms of M according to Definition 2.9, we can easily check that theabove situation is impossible.Again, M ∈ λµ I is necessary for the statement of the previous lemma.
Example 3.11.
Let M = µα. [ α ]( λx.x )(( λy.x )[ α ] x ), as in Example 3.7, then hd ( M ) =( λx.x )(( λy.x )[ α ] x ). Consider the standard reduction sequence σ , N ESTIMATION FOR THE LENGTHS OF REDUCTION SEQUENCES OF THE λµρθ -CALCULUS 15 M → β µα. [ α ]( λx.x ) x → θ ( λx.x ) x → β x = M (cid:48) . Then hd ( M ) is involved in σ and, on theother hand, σ is not of the form [ hd ( M )] σ (cid:48) for some σ (cid:48) .3.2. Calculating the bounds for substitutions.
In the following lemmas we examinehow standardization is related to substitutions in relation to λ - and µ -variables. In addition,we give estimations for the lengths of standard reduction sequences starting from termsgiven in the form of substitutions. The lemmas in this subsection are indispensable forproving Lemma 3.20, which is the standardization lemma.The next lemma shows that the length of a standard reduction sequence is not modifiedby a λ -substitution, i.e. we can find a standard reduction sequence of the same length forthe substitutions. Lemma 3.12.
Let M (cid:55)→ σ M (cid:48) be standard, then there exists a ν ∈ St such that M [ x := N ] (cid:55)→ ν M (cid:48) [ x := N ] and | ν | = | σ | .Proof. The proof goes by a straightforward induction on ( | σ | , comp ( M )) distinguishing thecases of Definition 3.1. We deal only with the case M = [ α ] M . We prove that the choice ν = σ [ x := N ] is appropriate.(1) If M (cid:55)→ σ M (cid:48) with M (cid:48) = [ α ] M (cid:48) and M (cid:55)→ σ M (cid:48) , then the induction hypothesis applies.(2) (a) If M (cid:55)→ σ [ α ] µβ.P → ρ P [ β := α ] (cid:55)→ σ M (cid:48) such that [ α ] µβ.P is the first ρ -redexin the sequence, then the induction hypothesis implies that M [ x := N ] (cid:55)→ σ [ x := N ] [ α ] µβ.P [ x := N ] and P [ β := α ][ x := N ] (cid:55)→ σ [ x := N ] M (cid:48) [ x := N ] are standard,moreover, [ α ] µβ.P [ x := N ] is the first ρ -redex in the sequence. We obtain the resultimmediately from Definition 3.1.(b) If M (cid:55)→ σ [ α ] µβ.P (cid:55)→ σ [ α ] µβ.Q = M (cid:48) , where [ α ] µβ.P is the first ρ -redex in thesequence then, by the induction hypothesis, M [ x := N ] (cid:55)→ σ [ x := N ] [ α ] µβ.P [ x := N ]and [ α ] µβ.P [ x := N ] (cid:55)→ σ [ α ] µβ.Q [ x := N ] = M (cid:48) [ x := N ] are standard, which,considering Definition 3.1, yields the result.In the sequel, we make preparations for the estimation of the upper bound of the lengthof a standard reduction sequence. To this aim, we introduce quantitative notions in relationto reduction sequences. Definition 3.13. (1) Let M be a term and x (resp. α ) be a λ -variable (resp. µ -variable). Denote by | M | x (resp. | M | α ) the number of occurrences of x (resp. α ) in M .(2) Let σ be the reduction sequence M → R M → R . . . → R n M n and α ∈ F v ( M ). Let (cid:104) σ (cid:105) ( ρ,α ) denote the number of ρ -reductions of the form ( α µβ.P ) in σ . Furthermore, let (cid:104) σ (cid:105) ρ be the number of ρ -redexes in σ .(3) If M (cid:55)→ σ M (cid:48) , let us denote by (cid:104) σ (cid:105) θ the number of θ -redexes in σ .(4) If x ∈ F v ( M ), let us denote by sumarg ( M, x ) the sum of the number of arguments ofeach occurrence of x in M . It is easy to see that sumarg ( M, x ) ≤ comp ( M ) − µ -substitutions, the length of a standard reduction sequence can increase.This is in connection with the standardization of reduction sequences initially containing ρ -redexes. Lemma 3.14. If M (cid:55)→ σ M (cid:48) is standard and N , . . . , N k are terms for which α / ∈ F v ( N i )(1 ≤ i ≤ k ) , then there exists a standard reduction sequence ν such that M [ α := r N ] . . . [ α := r N k ] (cid:55)→ ν M (cid:48) [ α := r N ] . . . [ α := r N k ] and | ν | = | σ | + k · (cid:104) σ (cid:105) ( ρ,α ) . Proof.
By induction on ( | σ | , comp ( M )). The case | σ | = 0 is trivial. If σ = [ R ] σ (cid:48) , where M → R M (cid:48)(cid:48) (cid:55)→ σ (cid:48) M (cid:48) , the only interesting case is M = [ γ ] µβ.M → ρ M [ β := γ ] = M (cid:48)(cid:48) (cid:55)→ σ (cid:48) M (cid:48) . If α (cid:54) = γ , then the result follows from the induction hypothesis. Otherwise, we have thefollowing reduction sequence denoted by (1) : M [ α := r N ] . . . [ α := r N k ] = [ α ]( µβ.M [ α := r N ] . . . [ α := r N k ]) N . . . N k (cid:55)→ kµ [ α ] µβ.M [ α := r N ] . . . [ α := r N k ][ β := r N ] . . . [ β := r N k ] → ρ M [ β := α ][ α := r N ] . . . [ α := r N k ], from which the estimation for the length of ν follows. Assume σ is standard, we prove by induction on ( | σ | , comp ( M )) that ν is standard.We examine the cases of Definition 3.1. We consider only the case when σ is standard byreason of point 3 of Definition 3.1. Let M = [ γ ] M . If M (cid:55)→ σ M (cid:48) , the induction hypothesisapplies. Otherwise, there are standard σ (cid:48) , σ (cid:48)(cid:48) such that M (cid:55)→ σ (cid:48) [ γ ] µβ.M (cid:48)(cid:48) (cid:55)→ σ (cid:48)(cid:48) M (cid:48) and[ γ ] µβ.M (cid:48)(cid:48) is the first term in the sequence which is a ρ -redex and either σ (cid:48)(cid:48) = [[ γ ] µβ.M (cid:48)(cid:48) ] σ (cid:48)(cid:48)(cid:48) for some σ (cid:48)(cid:48)(cid:48) ∈ St or M (cid:48) = [ γ ] µβ.M (cid:48)(cid:48)(cid:48) and M (cid:48)(cid:48) (cid:55)→ σ (cid:48)(cid:48) M (cid:48)(cid:48)(cid:48) . Assume γ = α . Then, by theinduction hypothesis, M [ α := r N ] . . . [ α := r N k ] (cid:55)→ ν (cid:48) [ α ]( µβ.M (cid:48)(cid:48) [ α := r N ] . . . [ α := r N k ]) N . . . N k is standard and ( µβ.M (cid:48)(cid:48) [ α := r N ] . . . [ α := r N k ]) N . . . N k is the first µ -redexin the sequence. Then we apply the head reduction sequence of (1), hence Lemma 3.4 involvesthat ν is standard. If γ (cid:54) = α , then M [ α := r N ] . . . [ α := r N k ] = [ γ ] M [ α := r N ] . . . [ α := r N k ] (cid:55)→ [ γ ] µβ.M (cid:48)(cid:48) [ α := r N ] . . . [ α := r N k ]. If σ (cid:48)(cid:48) = [[ γ ] µβ.M (cid:48)(cid:48) ] σ (cid:48)(cid:48)(cid:48) , then Lemma 3.5 applies.Otherwise we obtain the result by the induction hypothesis.The situation in the lemma below is more complicated when we assume that we areprovided a term together with a standard reduction sequence emanating from that andwe substitute the term in place of a variable of another term. This is in relation with thepossibility of creating new redexes. As we have seen earlier, sometimes we only obtain anestimation for the lengths of the new standard reduction sequences. Lemma 3.15. (1) If N (cid:55)→ σ N (cid:48) is standard, then there exists a standard reduction ν such that M [ x := N ] (cid:55)→ ν M [ x := N (cid:48) ] and | ν | ≤ | σ | · | M | x + sumarg ( M, x ) · ( (cid:104) σ (cid:105) θ + (cid:104) σ (cid:105) ρ ) . (2) If N (cid:55)→ σ N (cid:48) is standard, then there exists a standard reduction ν such that M [ α := r N ] (cid:55)→ ν M [ α := r N (cid:48) ] and | ν | = | σ | · | M | α .Proof. Let us only deal with case 1. The proof goes by a straightforward induction on comp ( M ). We lean on the points of Definition 2.9. For example, let us consider two of thecases.(1) M = ( x M . . . M n ). Let τ i be the reduction sequences obtained for M i [ x := N ] bythe induction hypothesis. Let τ = τ . . . τ n . By induction on | σ | , we define thefollowing transformation σ ◦ . We eliminate the outermost θ -redexes from σ , that is,redexes R , where N (cid:55)→ σ (cid:48) R → θ R (cid:48) (cid:55)→ σ (cid:48)(cid:48) N (cid:48) . Observe that an outermost θ -redex appearsin σ iff σ is standard by reason of point 2. (a) of Definition 3.1. Let σ be such that N = µα.P (cid:55)→ σ µα. [ α ] R → θ R (cid:55)→ σ N (cid:48) , where σ = σ σ and R is the first θ -redex in σ . Let ξ be ( µα.P ) M [ x := N ] . . . M n [ x := N ] → nµ µα.P [ α := r M [ x := N ]] . . . [ α := r M n [ x := N ]] (cid:55)→ σ (cid:48) µα. [ α ]( R M [ x := N ] . . . M n [ x := N ]) → θ ( R M [ x := N ] . . . M n [ x := N ]), where σ (cid:48) is obtained from σ by Lemma 3.14. Then let σ ◦ = ξ σ ) ◦ where σ = [ R ] σ (cid:48) . The reduction sequence M [ x := N ] (cid:55)→ σ ◦ ( N (cid:48) M [ x := N ] . . . M n [ x := N ]) (cid:55)→ τ ( N (cid:48) M [ x := N (cid:48) ] . . . M n [ x := N (cid:48) ]) is appropriate. We prove by induction on | σ | that | σ ◦ | ≤ n + n · ( (cid:104) σ (cid:105) ρ + (cid:104) σ (cid:105) θ ): | σ ◦ | = | ξ | + | σ ◦ | = 1 + n + | σ | + n · (cid:104) σ (cid:105) ( ρ,α ) + | σ ◦ | ≤ n + | σ | + n · (cid:104) σ (cid:105) ρ + | σ ◦ | ≤ n + | σ | + n · (cid:104) σ (cid:105) ρ + | σ | + n · ( (cid:104) σ (cid:105) θ + (cid:104) σ (cid:105) ρ ) = N ESTIMATION FOR THE LENGTHS OF REDUCTION SEQUENCES OF THE λµρθ -CALCULUS 17 | σ | + n · ( (cid:104) σ (cid:105) θ + (cid:104) σ (cid:105) ρ ). Then | σ ◦ + τ | = | σ ◦ | + (cid:80) i = ni =1 | τ i | ≤ | σ | + n · ( (cid:104) σ (cid:105) θ + (cid:104) σ (cid:105) ρ ) + | τ i | · (cid:80) i = ni =1 | M i | x + (cid:80) i = ni =1 sumarg ( M i , x ) · ( (cid:104) σ (cid:105) θ + (cid:104) σ (cid:105) ρ ) = | σ |·| M | x + sumarg ( M, x ) · ( (cid:104) σ (cid:105) θ + (cid:104) σ (cid:105) ρ ).(2) M = ( λy.M ) M −→ P . The induction hypothesis gives τ i such that M i [ x := N ] (cid:55)→ τ i M i [ x := N (cid:48) ] (1 ≤ i ≤ , k ). Then we can choose τ = τ . . . τ k .Lemmas 3.16 and 3.17 combine the results of the preceding lemmas: we substitute inplace of a variable common in the members of a standard reduction sequence a new termsuch that we are also equipped with a standard reduction sequence starting from it. Inthe case of the λ -substitution we obtain an inequality for the length of the new standardreduction sequence, whereas in the case of the µ -substitution we have an exact estimation. Lemma 3.16.
Let M (cid:55)→ σ M (cid:48) and N (cid:55)→ ν N (cid:48) be standard. Then there is a standard reduction τ such that M [ x := N ] (cid:55)→ τ M (cid:48) [ x := N (cid:48) ] and | τ | ≤ | σ | + | M (cid:48) | x · | ν | + sumarg ( M (cid:48) , x ) · ( (cid:104) ν (cid:105) θ + (cid:104) ν (cid:105) ρ ) .Proof. The proof goes by induction on ( | σ | , comp ( M )), taking into account the various pointsof Definition 3.1. The case | σ | = 0 is treated by Lemma 3.15. Let σ = [ R ] σ (cid:48) . We treatsome of the typical cases.(1) M = µα.M . If M (cid:55)→ σ M (cid:48) , then the induction hypothesis applies. Let σ be standardby reason of point 2 (a) of Definition 3.1. Let M (cid:55)→ σ µα. [ α ] M → θ M (cid:55)→ σ M (cid:48) .Lemma 3.12 and the induction hypothesis give standard ν and ν such that M [ x := N ] (cid:55)→ ν µα. [ α ] M [ x := N ]) → θ M [ x := N ] (cid:55)→ ν M (cid:48) [ x := N (cid:48) ]. Moreover, since µα. [ α ] M [ x := N ] is the first θ -redex in the sequence, ν = ν µα. [ α ] M [ x := N ]] ν is standard by virtue of Definition 3.1. The case of point 2. (b) of Definition 3.1 followsfrom the induction hypothesis.(2) M = ( µα.M ) M . . . M n . Assume M → µ ( µα.M [ α := r M ] . . . M n ) (cid:55)→ σ (cid:48) M (cid:48) . Then(( µα.M ) M )[ x := N ] is the head redex of M [ x := N ] and Lemma 3.4 together withthe induction hypothesis yield the result. If ( µα.M ) M is not involved in σ , then theinduction hypothesis applies.(3) M = ( x M . . . M n ). The proof is analogous to that of Lemma 3.15. We define, byinduction on ν , a standard reduction sequence ν ◦ in the same way as in Lemma 3.15.We let τ = ν ◦ τ . . . τ n , where τ i is obtained from M i [ x := N ] (2 ≤ i ≤ n ) by theinduction hypothesis. By examining the various cases of Definition 3.1, we prove byinduction on | ν | that τ ∈ St . As to the length of τ , we have | τ | = | ν ◦ | + | τ | + . . . + | τ n | ≤| ν | + ( n − · ( (cid:104) ν (cid:105) θ + (cid:104) ν (cid:105) ρ ) + (cid:80) ni =2 ( | σ i | + | M (cid:48) i | x · | ν | + sumarg ( M (cid:48) i , x ) · ( (cid:104) ν (cid:105) θ + (cid:104) ν (cid:105) ρ )) = | σ | + | M (cid:48) | x · | ν | + sumarg ( M (cid:48) , x ) · ( (cid:104) ν (cid:105) θ + (cid:104) ν (cid:105) ρ ).The remaining cases are proved analogously. Lemma 3.17.
Let M (cid:55)→ σ M (cid:48) and N (cid:55)→ ν N (cid:48) be standard. Then there is standard sequence τ such that M [ α := r N ] (cid:55)→ τ M (cid:48) [ α := r N (cid:48) ] and | τ | = | σ | + (cid:104) σ (cid:105) ( ρ,α ) + | M (cid:48) | α · | ν | .Proof. The proof goes by induction on ( | σ | , comp ( M )), similarly to that of the previouslemma. We consider some of the cases according to Definition 3.1. The case σ =0 is treatedin Lemma 3.15. Let σ = [ R ] σ (cid:48) for some σ (cid:48) .(1) M = [ β ] M . Assume β = α . If M (cid:55)→ σ M (cid:48) with M (cid:48) = [ α ] M (cid:48) , then the inductionhypothesis applies. Otherwise, let M (cid:55)→ σ [ α ] µγ.M → ρ M [ γ := α ] (cid:55)→ σ M (cid:48) . Similarlyto the proof of Lemma 3.14, we have the standard reduction sequence τ : M [ α := r N ] (cid:55)→ σ [ α := r N ] [ α ]( µγ.M [ α := r N ]) N → µ [ α ] µγ.M [ α := r N ][ γ := r N ]) → ρ M [ γ := α ][ α := r N ] (cid:55)→ τ M (cid:48) [ α := r N (cid:48) ], where τ is obtained from σ by the induction hypothesis and the standardness follows from Lemma 3.5 and the induction hypothesis, where wehave made use of the fact that [ α ] µγ.M is the first ρ -redex in σ . For the length of τ wehave | τ | = 2 + | σ | + | τ | = 2 + | σ | + | σ | + (cid:104) σ (cid:105) ( ρ,α ) + | M (cid:48) | α · | ν | = | σ | + (cid:104) σ (cid:105) ( ρ,α ) + | M (cid:48) | α · | ν | .Assume now β (cid:54) = α . The case when M does not reduce to a ρ -redex or it reduces toa ρ -redex but this is not involved in σ is again obvious. Let M (cid:55)→ σ [ β ] µγ.M . Then M [ α := r N ] (cid:55)→ σ [ α := r N ] [ β ] µγ.M [ α := r N ] → ρ M [ γ := β ][ α := r N ] (cid:55)→ τ (cid:48) M (cid:48) [ α := r N (cid:48) ]is standard, and τ (cid:48) is obtained by the induction hypothesis. The equation for the lengthof τ is obviously valid in this case, too.(2) M = ( µβ.M ) M . . . M n . If ( µβ.M ) M is not involved in σ , then the induction hypoth-esis applies. Otherwise, since hd ( M ) = hd ( M [ α := r N ]), we have the result by Lemma3.4, and again by the induction hypothesis.All the remaining cases are proved in a similar way.3.3. The standardization theorem for the λµρθ -calculus.
We are in a position nowto state and prove the standardization theorem for the λµρθ -calculus. As an additionalresult, we obtain an upper bound for the lengths of the standard λµ I-reduction sequences.First of all, we harvest the results of the previous subsection in a definition: the definitionbelow assigns values to pairs formed by redexes and their containing terms. The definitionis of technical interest: it makes us possible to find an upper bound for the standardizationof a reduction sequence.
Definition 3.18.
Let R be a redex in a term M , the number m ( R, M ) is defined as follows.(1) If R = ( µα.P ) Q , then m ( R, M ) = | P | α .(2) If R = ( λx.P ) Q , then m ( R, M ) = 2 · comp ( M ) − R = [ α ] µβ.P , then m ( R, M ) = 1.(4) If R = µα. [ α ] P and R has n arguments in M , then m ( R, M ) = 2 n − m ( R, M ) resembles the corresponding definition applied by Xi [Xi.99],where m ( R ) is the number of the occurrences of x in P provided R = ( λx.P ) Q . Theadditional redexes, however, compel us to change the value of m ( R, M ) even for the case ofthe β -redex. The lemma below will be used in the next subsection. Lemma 3.19. If R is a redex in M , then m ( R, M ) ≤ · ( comp ( M ) − .Proof. Immediate by Definition 3.18.The following lemma is the main lemma for obtaining the standardization result andthe bound for the standard reduction sequences in Theorem 3.22. In what follows, let | σ | ∗ = max ( | σ | , σ is a reduction sequence. Lemma 3.20.
Let M (cid:55)→ σ M (cid:48) → R M (cid:48)(cid:48) such that σ is a standard reduction sequence. Thenthere exists a standard reduction sequence M (cid:55)→ τ M (cid:48)(cid:48) such that | τ | ≤ max ( m ( R, M (cid:48) ) , ·| σ | ∗ . Furthermore, if M is a λµ I-term, then | σ | ≤ | τ | .Proof. The proof goes by induction ( | σ | , comp ( M )). The case of | σ | = 0 is obvious, thus wemay assume | σ | >
0. We examine the points of Definition 3.1. We treat some of the moreinteresting cases.
N ESTIMATION FOR THE LENGTHS OF REDUCTION SEQUENCES OF THE λµρθ -CALCULUS 19 (1) M = [ α ] M . If M (cid:55)→ σ M (cid:48) such that M (cid:48) = [ α ] M (cid:48) and there are no ρ -redexes as headredexes in σ including M (cid:48)(cid:48) , then the induction hypothesis applies. Assume M (cid:55)→ σ [ α ] µβ.M such that σ ∈ St and [ α ] µβ.M is the first ρ -redex in the sequence. Let ussuppose, according to point 3 (a) of Definition 3.1, [ α ] µβ.M → ρ M [ β := α ] (cid:55)→ σ M (cid:48) ,where σ = σ α ] µβ.M ] σ and σ i ∈ St ( i ∈ { , } ). By the induction hypothesisapplied to σ , we obtain a τ (cid:48) ∈ St such that | τ (cid:48) | ≤ max ( m ( R, M (cid:48) ) , · | σ | ∗ . Then let τ = σ α ] µβ.M ] τ (cid:48) . Hence | τ | = 1 + | σ | + | τ (cid:48) | ≤ | σ | + 1 + max ( m ( R, M (cid:48) ) , ·| σ | ∗ ≤ max ( m ( R, M (cid:48) ) , · | σ | ∗ . Assume we have [ α ] µβ.M (cid:55)→ σ [ α ] µβ.M (cid:48) with M (cid:48) = [ α ] µβ.M (cid:48) and M (cid:55)→ σ M (cid:48) , by reason of point 3 (b) of Definition 3.1. If R ≤ M (cid:48) ,then we obtain the result by the induction hypothesis. Assume R = M (cid:48) . Then τ = σ α ] µβ.M ] σ (cid:48) is appropriate, where σ (cid:48) is M [ β := α ] (cid:55)→ σ [ β := α ] M (cid:48) [ β := α ].The estimation for | τ | follows easily, since | σ (cid:48) | = | σ | . Finally, if M is a λµ I-term,the result follows from the induction hypothesis by inspection of the various subcases.For example, consider the case when [ α ] µβ.M → ρ M [ β := α ] (cid:55)→ σ M (cid:48) , where σ = σ α ] µβ.M ] σ , that is, the case described by point 3 (a) of Definition 3.1. If τ (cid:48) isthe standard reduction sequence corresponding to σ by the induction hypothesis and τ = σ α ] µβ.M ] τ (cid:48) , then 1 + | σ | ≤ | τ (cid:48) | and we obtain the result.(2) M = ( µα.M ) M . . . M n . Let σ be standard by virtue of point 5.(a) of Definition 3.1.Then ( µα.M ) M . . . M n → µ ( µα.M [ α := r M ] . . . M n ) (cid:55)→ σ (cid:48) M (cid:48) with σ (cid:48) ∈ St . Theinduction hypothesis applied to σ (cid:48) provides us with a standard τ (cid:48) with appropriatelength such that ( µα.M [ α := r M ] . . . M n ) (cid:55)→ τ (cid:48) M (cid:48)(cid:48) . By this the result follows. Assume σ is standard by reason of point 5.(b) of Definition 3.1. Then ( µα.M ) M . . . M n → σ ( µα.M (cid:48) ) M . . . M n (cid:55)→ σ . . . (cid:55)→ σ n ( µα.M (cid:48) ) M (cid:48) . . . M (cid:48) n = M (cid:48) , where σ = σ . . . σ n . If R ≤ M (cid:48) i , then the induction hypothesis gives the result. Let R = ( µα.M (cid:48) ) M (cid:48) . Then τ can be chosen as ( µα.M ) M . . . M n → µ ( µα.M [ α := r M ] . . . M n ) (cid:55)→ τ ( µα.M (cid:48) [ α := r M (cid:48) ] . . . M n ) (cid:55)→ σ . . . (cid:55)→ σ n ( µα.M (cid:48) [ α := r M (cid:48) ] . . . M (cid:48) n ), where τ is obtained from Lemma3.17. Moreover, | τ | = 1 + | τ | + (cid:80) ni =3 | σ i | = 1 + | σ | + (cid:104) σ (cid:105) ( ρ,α ) + | M (cid:48) | α · | σ | + (cid:80) ni =3 | σ i | ≤ | σ | + | M (cid:48) | α · | σ | + (cid:80) ni =3 | σ i | ≤ max ( m ( R, M (cid:48) ) , · | σ | ∗ . Assume R = µα. [ α ] M (cid:48)(cid:48) is a θ -redex. In this case σ is standard by virtue of point 2 (b) (ii) of Definition3.1. Let µα. [ α ] M ∗ be the first θ -redex such that an initial segment σ (cid:48) of σ produces µα. [ α ] M ∗ starting from µα.M . Let σ = σ (cid:48) σ (cid:48)(cid:48) . Then ( µα.M ) M . . . M n → n − µ µα.M [ α := r M ] . . . [ α := r M n ] (cid:55)→ τ µα. [ α ]( M ∗ M . . . M n ) → θ ( M ∗ M . . . M n ) (cid:55)→ σ (cid:48)(cid:48) ( M (cid:48) M . . . M n ) (cid:55)→ σ . . . (cid:55)→ σ n ( M (cid:48) M (cid:48) . . . M (cid:48) n ) = M (cid:48) is standard, where τ is obtainedfrom σ (cid:48) by Lemma 3.14. As to the length of τ , we have | τ | = 1 + ( n −
1) + | τ | + | σ (cid:48)(cid:48) | + (cid:80) ni =2 | σ i | = 1+( n − | σ (cid:48) | +( n − ·(cid:104) σ (cid:48) (cid:105) ( ρ,α ) + | σ (cid:48)(cid:48) | + (cid:80) ni =2 | σ i | ≤ | σ | +( n − · (1+ | σ | ) =1 + n · | σ | + ( n − ≤ max ( m ( R, M (cid:48) ) , · | σ | ∗ . When M is a λµ I-term, weobtain the result by the induction hypothesis. Let us only treat the last case, where( µα.M ) M . . . M n → σ ( µα.M (cid:48) ) M . . . M n (cid:55)→ σ . . . (cid:55)→ σ n ( µα.M (cid:48) ) M (cid:48) . . . M (cid:48) n = M (cid:48) and R = µα.M (cid:48) = µα. [ α ] M (cid:48)(cid:48) . If µα. [ α ] M ∗ is the first θ -redex in σ such that σ = σ (cid:48) σ (cid:48)(cid:48) and τ is obtained from σ (cid:48) by Lemma 3.14 and τ is defined as above, then 1 + | σ | =1 + | σ (cid:48) | + | σ (cid:48)(cid:48) | + (cid:80) ni =2 | σ i | ≤ | τ | = ( n −
1) + | τ | + 1 + | σ (cid:48)(cid:48) | + (cid:80) ni =2 | σ i | , where | σ (cid:48) | ≤ | τ | by Lemma 3.14. Definition 3.21.
Let σ be the reduction sequence M → R M → R . . . → R n M n +1 . Denoteby M ( σ ) (the measure of σ ) the number (cid:81) ni =1 (1 + max ( m ( R i , M i ) , Theorem 3.22.
Let σ be the reduction sequence M = M → R M → R . . . → R n M n +1 .Then there is a standard reduction sequence st ( σ ) such that M (cid:55)→ st ( σ ) M n +1 and | st ( σ ) | ≤M ( σ ) . Moreover, if M is a λµ I-term, then | σ | ≤ | st ( σ ) | also holds.Proof. The statement of the theorem is proved by induction on | σ | .(1) If | σ | = 1, then our claim follows directly from Lemma 3.20.(2) Let σ = σ (cid:48) R n ], where | σ (cid:48) | ≥
1. By the induction hypothesis, we can find a stan-dard st ( σ (cid:48) ) with appropriate length such that M (cid:55)→ st ( σ (cid:48) ) M n . Moreover, | st ( σ (cid:48) ) | ∗ = | st ( σ (cid:48) ) | . Then, by Lemma 3.20, there is a standard M (cid:55)→ τ M n +1 such that | τ | ≤ max ( m ( R n , M n ) , · | st ( σ (cid:48) ) | ∗ ≤ (1 + max ( m ( R n , M n ) , · | st ( σ (cid:48) ) | ∗ , which yields theresult. Theorem 3.23. If M is a λµ I-term, then a standard reduction sequence starting from M and leading to the normal form of M is the leftmost reduction sequence and it is a reductionsequence of maximal length.Proof. Let M be a λµ I-term. Assume M (cid:55)→ σ M (cid:48) where M (cid:48) is the normal form of M .The proof goes by induction on ( | σ | , comp ( M )). We may assume M ∈ HN F . Otherwise,by Lemma 3.8, the head redex of M is involved in σ , then Lemma 3.10 yields that σ =[ hd ( M )] σ (cid:48) . That is, if M / ∈ HN F , then the induction hypothesis applies. Let M =( x M . . . M n ). By Definition 3.1 there exist σ i ∈ St (2 ≤ i ≤ n ) such that σ = σ . . . σ n and ( x M . . . M n ) (cid:55)→ σ ( x M (cid:48) . . . M n ) (cid:55)→ σ . . . (cid:55)→ σ n ( x M (cid:48) . . . M (cid:48) n ). Then the inductionhypothesis applied to σ i (2 ≤ i ≤ n ) gives the result. The leftmost reduction has a maximallength by Theorem 3.22.4. The estimation for the lengths of the reduction sequences of the λµρθ -calculus
In this section we present an application of Theorem 3.22 which, through the standardization,provides us with a bound for the length of the standard reduction sequence. Making use ofthe fact that, by Theorem 3.23, the standard reduction sequence for a λµ I-term is uniqueand the Church-Rosser property is valid for the λµ I-calculus, it does not make a differencewhich normalizing reduction sequence we start from and obtain its standardization. Hence,we choose a normalization sequence σ the measure of which, M ( σ ), can easily be estimated,which is, at the same time, an upper bound for the standardization of σ . By Theorem 3.22,we have thus obtained an upper bound for | σ | . We extend this result to the general case byfinding a translation [[ M ]] k of M with an appropriate k , where [[ M ]] k is a λµ I-term such thatlengths of the types of the redexes in M is the same as those of [[ M ]] k and η ( M ) ≤ η ([[ M ]] k )and the complexity of [[ M ]] k is bounded by a linear function of the complexity of M .4.1. The estimation the lengths of the reduction sequences of the λµρθI -calculus.
In this subsection we give an estimation for the lengths of the reduction sequences in the λµρθ
I-calculus. To this end we define a normalization strategy such that the lengths ofreduction sequences obeying that strategy can be assessed easily and we can even establishbounds for the sizes of the developments. Prior to this, we need the rank of a redex.Intuitively, the rank of a redex is the length of type of the λ - or µ -abstraction of the redex.This is exactly the quantity that can decrease by a reduction. N ESTIMATION FOR THE LENGTHS OF REDUCTION SEQUENCES OF THE λµρθ -CALCULUS 21
Definition 4.1. (1) The rank of a redex R in a term M is defined as follows. • If R = ( λx.M ) M , then rank ( R, M ) = lh ( type ( λx.M )). • If R = ( µα.M ) M , then rank ( R, M ) = lh ( type ( µα.M )). • If R = [ α ] µβ.M , then rank ( R, M ) = lh ( type ( µβ.M )). • If R = µα. [ α ] M , then rank ( R, M ) = lh ( type ( µα. ( α M ))).(2) The rank of a term M is rank ( M ) = max { rank ( R, M ) | R is a redex in M } .(3) Define N F k = { M | rank ( M ) < k } .The following lemma states that reductions do not increase the rank. Lemma 4.2.
Let M , N be terms. (1) We have rank ( M [ x := N ]) ≤ max { rank ( M ) , rank ( N ) , lh ( type ( x )) } and rank ( M [ α := r N ]) ≤ max { rank ( M ) , rank ( N ) , lh ( type ∗ ( α )) } ,where type ∗ ( α ) = A if type ( α ) = ¬ A . (2) If M (cid:55)→ M (cid:48) , then rank ( M ) ≥ rank ( M (cid:48) ) .Proof. (1) By induction on comp ( M ).(2) It is enough to prove if M → R M (cid:48) , then rank ( M ) ≥ rank ( M (cid:48) ). The proof goes byinduction on comp ( M ) and we use the first item.We are now in a position to define the notion of a k -reduction sequence, which willdenote a specific normalization strategy in what follows. Definition 4.3. (1) We say that a reduction sequence ν is a k -reduction sequence, if every redex in ν is ofrank k .(2) A reduction sequence M (cid:55)→ ν M (cid:48) is a k -normalization for a given term M , if it is a k -reduction sequence and M (cid:48) ∈ N F k .(3) A reduction sequence ξ starting from a term is good, if, at each reduction step, it choosesthe leftmost, innermost redex of maximal rank, that is, the redex containing no otherredexes of maximal rank and stands in the leftmost position among these redexes.Let σ be a good reduction sequence starting from M , assume rank ( M ) = k . Then σ starts with the leftmost, innermost redex of rank k and chooses the leftmost, innermostredex of maximal rank every time. Since M is strongly normalizable, σ is necessarily finite.By Lemma 4.2, the ranks of the redexes involved in σ form a monotone decreasing sequence.Thus, if σ is a good normalizing sequence, then the sequence of redexes of rank k in σ comes to an end and σ continues with a leftmost, innermost redex of maximal rank, whichis less than k . Hence, σ is the concatenation of l i -normalization sequences (1 ≤ i ≤ s ) with l = k > l > ... > l s ≥ Lemma 4.4. (1)
Let rank (( µα.P ) Q ) = k and x / ∈ F v ( P ) . If ( µα.P ) Q (cid:55)→ ν U and ν is a good k -normalizationsequence, there are terms P (cid:48) , Q (cid:48) , U (cid:48) and good k -normalization sequences ν , ν , ν suchthat P (cid:55)→ ν P (cid:48) , Q (cid:55)→ ν Q (cid:48) , ( µα.P (cid:48) ) x (cid:55)→ ν U (cid:48) , U = U (cid:48) [ x = Q (cid:48) ] and ν = ν ν ν [ x := Q (cid:48) ] . (2) Let rank (( λy.P ) Q ) = k and x / ∈ F v ( P ) . If ( λy.P ) Q (cid:55)→ ν U and ν is a good k -normalizationsequence, there are terms P (cid:48) , Q (cid:48) , U (cid:48) and good k -normalization sequences ν , ν such that P (cid:55)→ ν P (cid:48) , Q (cid:55)→ ν Q (cid:48) , ( λy.P (cid:48) ) x → ν P (cid:48) [ y := x ] = P (cid:48)(cid:48) , U = P (cid:48)(cid:48) [ x := Q (cid:48) ] and ν = ν ν ν [ x := Q (cid:48) ] .Proof. (1) The algorithm proceeds by eliminating the innermost k -redexes from left to right,that is we have (possibly empty) ν and ν - both being k -normalization sequences suchthat ν ν is an initial subsequent of ν and P (cid:55)→ ν P (cid:48) ∈ N F k , Q (cid:55)→ ν Q (cid:48) ∈ N F k . Then ν continues with reducing ( µα.P (cid:48) ) Q (cid:48) and the redexes created by this reduction. It isimmediate to check that when reducing ( µα.P (cid:48) ) Q (cid:48) , the created k -redexes can only beredexes of the form ( λy.V [ α := r Q (cid:48) ]) Q (cid:48) for some λy.V of rank k such that [ α ] λy.V ≤ P (cid:48) ,so for every k -redex R in µα.P (cid:48) [ α := r Q (cid:48) ] there is an R (cid:48) in µα.P (cid:48) [ α := r x ] such that R = R (cid:48) [ x := Q (cid:48) ]. Reducing with these β -redexes in µα.P (cid:48) [ α := r Q (cid:48) ], no more k -redexesare created. This proves our assertion.(2) Analogous to the first point. Lemma 4.5.
Let rank (( µα.P ) x ) = k , µα.P ∈ N F k and x / ∈ F v ( P ) . If ( µα.P ) x (cid:55)→ ν U , ν is a good k -normalization sequence, and U ∈ N F k , then | ν | ≤ comp ( P ) and comp ( U ) ≤ · comp ( P ) .Proof. Since µα.P ∈ N F k , in µα.P [ α := r x ] k -redexes of the form ( λy.Q [ α := r x ]) x can onlyoccur, where [ α ] λy.Q ≤ P and rank ( λy.Q ) = k . Subsequently reducing these redexes gives U , which means that U can be obtained in at most | P | α + 1 ≤ comp ( P ) steps. Consideringthe above argument, since x is a variable, the β -reduction steps in ν does not increase thesize of the term, so comp ( U ) ≤ comp ( µα.P [ α := r x ]) = 1 + comp ( P ) + | P | α ≤ · comp ( P ).The lemma below gives estimations for good k -normalization sequences. We may observethat the obtained bounds does not depend on k . Lemma 4.6.
Let M be a term such that rank ( M ) = k . If M (cid:55)→ ν M (cid:48) and ν is a good k -normalization sequence, then comp ( M (cid:48) ) ≤ comp ( M ) − and | ν | ≤ comp ( M ) − .Proof. The proof of comp ( M (cid:48) ) ≤ comp ( M ) − goes by induction on comp ( M ).(1) The case M = x or M = λx.M is obvious.(2) Let M = µα.M .(a) If M = µα. [ α ] M is a θ -redex of rank k , then, since the algorithm eliminates k -redexes from bottom to up and from left to right, we have a ν (cid:48) ≤ ν such that µα. [ α ] M (cid:55)→ ν (cid:48) µα. [ α ] M (cid:48) → R M (cid:48) = M (cid:48) . But in this case M → θ M (cid:55)→ ν (cid:48) M (cid:48) is validas well, thus by the induction hypothesis comp ( M (cid:48) ) ≤ comp (( M ) − < comp ( M ) − .(b) If µα.M is not a θ -redex, but reduces to a θ -redex of rank k in the course of theprocess, then a reasoning analogous to the above one works.(c) If µα.M is not a θ -redex and it neither reduces to a θ -redex, then the inductionhypothesis applies.(3) Let M = ( M M ).(a) If M is not a k -redex, then we prove that M cannot reduce to a k -redex.Suppose on the contrary that there is some initial subsequent of ν such that itreduces M to a k -redex, take ν (cid:48) as the shortest such reduction sequence. Suppose M reduces to a µ -redex (the case of a β -redex is similar). In this case we have M (cid:55)→ ν (cid:48) ( µβ.N ) N , where M (cid:55)→ µβ.N and M (cid:55)→ N . Then M (cid:55)→ ν (cid:48)(cid:48) ( N N ) → R (cid:48) ( µβ.N ) N must hold for some R (cid:48) , ν (cid:48)(cid:48) such that ν (cid:48) = ν (cid:48)(cid:48) R (cid:48) ] and for some N , N not beginning with a µ . This means N = R (cid:48) would be again a k -redex, but astraightforward examination of the possible cases shows it is impossible. N ESTIMATION FOR THE LENGTHS OF REDUCTION SEQUENCES OF THE λµρθ -CALCULUS 23
Hence we have M (cid:48) = ( M (cid:48) M (cid:48) ), ν = ν ν for some k -reduction sequences sequences ν , ν and M i (cid:55)→ ν i M (cid:48) i ( i ∈ { , } ). Thus by the induction hypothesis comp ( M (cid:48) ) = comp ( M (cid:48) ) + comp ( M (cid:48) ) ≤ comp ( M ) − + 2 comp ( M ) − ≤ comp ( M ) − .(b) If M is a k -redex and M = ( µα.M ) M , then M is involved in ν as a µ -redex. ByLemma 4.4, we have M (cid:48) , M (cid:48) , M (cid:48)(cid:48) and ν , ν , ν such that M (cid:55)→ ν M (cid:48) , M (cid:55)→ ν M (cid:48) ,( µα.M (cid:48) ) x (cid:55)→ ν M (cid:48)(cid:48) , M (cid:48) = M (cid:48)(cid:48) [ x := M (cid:48) ] and ν = ν ν ν [ x := M (cid:48) ], provided x / ∈ F v ( M ). From this, by Lemma 4.5 and by the induction hypothesis, comp ( M (cid:48) ) = comp ( M (cid:48)(cid:48) [ x := M (cid:48) ]) = comp ( M (cid:48)(cid:48) ) + | M (cid:48)(cid:48) | x · ( comp ( M (cid:48) ) − < comp ( M (cid:48)(cid:48) ) · comp ( M (cid:48) ) ≤ · comp ( M (cid:48) ) · comp ( M (cid:48) ) ≤ · comp ( M ) − · comp ( M ) − < comp ( M ) − .The case M = ( λx.M ) M is similar.(4) Let M = [ α ] M .(a) If M does not reduce to a k -redex, then the result is obvious.(b) If M is either a k -redex, or reduces to a k -redex, then there is a ν (cid:48) and a µβ.M ∈ N F k such that [ α ] M (cid:55)→ ν (cid:48) [ α ] µβ.M → R M [ β := α ] and ν (cid:48) R ] = ν . Theinduction hypothesis for M gives the result.We prove | ν | ≤ comp ( M ) − by induction on comp ( M ). The only interesting case is when M is a redex of rank k . Let, for example, M = ( µα.M ) M . Since ν is a k -normalizationsequence we can assume again that M is involved in ν . By Lemma 4.4, we have M (cid:48) , M (cid:48) and k -normalization sequences ν , ν , ν such that M (cid:55)→ ν M (cid:48) , M (cid:55)→ ν M (cid:48) , ( µα.M ) (cid:48) x (cid:55)→ ν M (cid:48)(cid:48) , M (cid:48) = M (cid:48)(cid:48) [ x = M (cid:48) ] and ν = ν ν ν [ x := M (cid:48) ], provided x / ∈ F v ( M ). Then, using Lemma4.5 and the induction hypothesis, we obtain | ν | = | ν | + | ν | + | ν [ x := M (cid:48) ] | = | ν | + | ν | + | ν | ≤ comp ( M ) − + 2 comp ( M ) − + 2 comp ( M ) − = 2 comp ( M ) + 2 comp ( M ) − ≤ comp ( M ) − . Definition 4.7.
Let tower defined by tower ( n, m ) = (cid:26) m if n = 0 , tower ( n − ,m ) if n > . In other words, the integer tower ( n, m ) is 2 · ·· m , where 2 is repeated n times. Theorem 4.8.
Let M be a term such that rank ( M ) = k . If M (cid:55)→ σ N , σ is a good reductionsequence and N ∈ N F , then M ( σ ) < tower( k + 1 , comp ( M )) .Proof. We first prove by induction on k that M ( σ ) < tower(1 , tower(1 , comp ( M )) + (cid:80) ki =2 tower( i, comp ( M ) − k = 1, then σ is a 1-normalization sequence. Suppose σ is M = M → R M → R . . . → R n − M n → R n M n +1 for some n ≥
1. We have, by Lemmas 3.19 and 4.6,1 + max ( m ( R i , M i ) , ≤ · comp ( M i ) − ≤ · comp ( M ) − − < comp ( M ) , then M ( σ ) = (cid:81) ni =1 (1 + max ( m ( R i , M i ) , < (cid:81) ni =1 comp ( M ) = 2 n · comp ( M ) . Again, by Lemma 4.6, we obtain n = | σ | ≤ comp ( M ) − , so M ( σ ) < comp ( M ) · comp ( M ) − ≤ comp ( M ) =tower(1 , tower(1 , comp ( M ))).(2) Let rank ( M ) = k + 1 and k ≥
1. Assume M (cid:55)→ σ (cid:48) M (cid:48) (cid:55)→ σ (cid:48)(cid:48) N ∈ N F , where σ (cid:48) is a k + 1-normalization sequence starting from M . By the induction hypothesis, we have M ( σ (cid:48)(cid:48) ) < tower(1 , tower(1 , comp ( M (cid:48) )) + (cid:80) ki =2 tower( i, comp ( M (cid:48) ) − M ( σ (cid:48) ) < comp ( M ) . Then, using the multiplicity of M and Lemma 4.6,we can assert M ( σ ) = M ( σ (cid:48) ) · M ( σ (cid:48)(cid:48) ) < comp ( M ) · tower (cid:16) , tower(1 , comp ( M (cid:48) )) + (cid:80) ki =2 tower( i, comp ( M (cid:48) ) − (cid:17) < comp ( M ) · tower (cid:16) , tower(1 , tower(1 , comp ( M ) − (cid:80) ki =2 tower( i, tower(1 , comp ( M ) − (cid:17) =2 comp ( M ) · comp ( M ) − + · · · + 2 · ·· comp ( M ) − (cid:124) (cid:123)(cid:122) (cid:125) k =tower(1 , tower(1 , comp ( M )) + (cid:80) k +1 i =2 tower( i, comp ( M ) − k , thattower(1 , comp ( M )) + (cid:80) ki =2 tower( i, comp ( M ) − ≤ tower( k, comp ( M )).The case k = 1 is obvious. Let k = n + 1 and n ≥
1. Applying the induction hypothesis, weobtain tower(1 , comp ( M )) + (cid:80) n +1 i =2 tower( i, comp ( M ) −
1) =2 comp ( M ) + 2 comp ( M ) − + · · · + 2 · ·· comp ( M ) − (cid:124) (cid:123)(cid:122) (cid:125) n +1 ≤ tower( n, comp ( M )) + tower( n + 1 , comp ( M ) − < tower( n + 1 , comp ( M )). Corollary 4.9.
Let M be a λµI -term of rank k . Every reduction sequence starting from M has length less than tower( k + 1 , comp ( M )) .Proof. Let N be the normal-form of M . By Definition 4.3 and Theorem 4.8, there exists a σ such that M (cid:55)→ σ N and M ( σ ) < tower( k + 1 , comp ( M )). By Theorem 3.22, there is astandard σ (cid:48) such that M (cid:55)→ σ (cid:48) N and | σ (cid:48) | < M ( σ ). The result follows now from Theorem3.23.4.2. Some properties of the function η . In the next subsection we undertake the task ofestimating the lengths of reduction sequences starting from an arbitrary term by transformingthe starting term into a λµ I-term and estimating an upper bound for the reduction sequencesof the λµ I-term. In order to make the estimation work, we have to prove that the longestreduction sequences of the transformed terms are at least as long as those of the originalterms. To this end, we perform some calculations concerning longest reduction sequences ofterms and their reducts. This subsection prepares the treatment of the general case. Thelemmas of the subsection compare the lengths of the longest reduction sequences startingfrom a redex and from one of its reducts.
Lemma 4.10.
Let
M, N and −→ P be λµI -terms. If α / ∈ F v ( N ) , then η (( µα. (cid:104) M, [ α ] z (cid:105) ) −→ P ) + η ( N ) ≤ η (( µα. (cid:104) M, [ α ]( z N ) (cid:105) ) −→ P ) .Proof. Let U = ( µα. (cid:104) M, [ α ] z (cid:105) ) −→ P , V = ( µα. (cid:104) M, [ α ]( z N ) (cid:105) ) −→ P . If −→ P is empty, the result istrivial, so may assume −→ P is not empty and its components are M , . . . , M n . We are going toprove if U (cid:55)→ σ U (cid:48) , N (cid:55)→ σ N (cid:48) for some σ , σ , U (cid:48) , N (cid:48) , then we have a reduction sequence ν of V such that | σ | + | σ | ≤ | ν | . By the second part of Theorem 3.22, it is enough to restrictour attention to the case when σ and σ are standard. We may assume that the head-redexof U is involved in σ , otherwise the result is trivial. Furthermore, we may suppose that µα. (cid:104) M, [ α ] z (cid:105) is reduced in | σ | with all of its arguments M , . . . , M n . Then σ is of the form U (cid:55)→ ξ µα. (cid:104) M [ α := r M ] . . . [ α := r M n ] , [ α ]( z M . . . M n ) (cid:105)(cid:55)→ ζ µα. (cid:104) M (cid:48) , [ α ]( z M . . . M n ) (cid:105) (cid:55)→ ζ ∗ µα. (cid:104) M (cid:48) , [ α ]( z M (cid:48) . . . M (cid:48) n ) (cid:105) ,where M [ α := r M ] . . . [ α := r M n ] (cid:55)→ ζ M (cid:48) and ζ ∗ = ζ . . . ζ n with M i (cid:55)→ ζ i M (cid:48) i for1 ≤ i ≤ n . Let ξ (cid:48) be V (cid:55)→ ξ (cid:48) µα. (cid:104) M [ α := r M ] . . . [ α := r M n ] , [ α ]( z N M . . . M n ) (cid:105) , thenchoosing ν as ν = ξ (cid:48) ζ σ ζ ∗ is appropriate. N ESTIMATION FOR THE LENGTHS OF REDUCTION SEQUENCES OF THE λµρθ -CALCULUS 25
Lemma 4.11.
Let M = ( λx.M ) M −→ P and N = ( M [ x := M ] −→ P (cid:48) ) . (1) If x ∈ F v ( M ) and N is strongly normalizable, then M is also strongly normalizableand η ( M ) = η ( N ) + 1 . (2) If x / ∈ F v ( M ) and N, M are strongly normalizable, then M is also strongly normalizableand η ( M ) = η ( N ) + η ( M ) + 1 .Proof. (1) Let M (cid:55)→ σ U be an arbitrary reduction sequence, we are going to show that | σ | ≤ η ( N ) + 1, from which the result follows. We may suppose that ( λx.M ) M is involved in σ . Then σ is of the following form for some σ and σ , M = ( λx.M ) M −→ P (cid:55)→ σ M (cid:48) =( λx.M (cid:48) ) M (cid:48) −→ P (cid:48) → ( M (cid:48) [ x := M (cid:48) ] −→ P (cid:48) ) (cid:55)→ σ U where M i (cid:55)→ ν i M (cid:48) i ( i ∈ { , } ), −→ P (cid:55)→ ν −→ P (cid:48) and σ = ν ν ν . Let σ (cid:48) denote the reduction sequence M = ( λx.M ) M −→ P → N =( M [ x := M ] −→ P ) (cid:55)→ σ ∗ U , where σ ∗ = ν (cid:48) ν (cid:48) ν σ and ν (cid:48) is constructed from ν byLemma 3.12 with M (cid:55)→ ν M (cid:48) and M and ν (cid:48) is obtained by applying Lemma 3.15 to M and M (cid:55)→ ν M (cid:48) . Then | σ | ≤ η ( N ) + 1, which is the desired result.(2) Let M (cid:55)→ σ U be an arbitrary reduction sequence, it is enough to show that | σ | ≤ η ( N ) + η ( M ) + 1. We may suppose that ( λx.M ) M is involved in σ . Then σ is ofthe form M = ( λx.M ) M −→ P (cid:55)→ σ M (cid:48) = ( λx.M (cid:48) ) M (cid:48) −→ P (cid:48) → β ( M (cid:48) −→ P (cid:48) ) (cid:55)→ σ U where M i (cid:55)→ ν i M (cid:48) i ( i ∈ { , } ), −→ P (cid:55)→ ν −→ P (cid:48) and σ = ν ν ν . σ can obviously be rearrangedas M (cid:55)→ ν ( λx.M ) M (cid:48) −→ P → β N = ( M −→ P ) (cid:55)→ ν ν ( M (cid:48) −→ P (cid:48) ), which yields the result. Lemma 4.12. (1)
Let M = [ α ] µβ.M and N = M [ β := α ] . If N is strongly normalizable, then M is alsostrongly normalizable and η ( M ) = η ( N ) + 1 . (2) Let M = µα. [ α ] M be a θ -redex. If M is strongly normalizable, then M is also stronglynormalizable and η ( M ) = η ( M ) + 1 .Proof. (1) Assume σ is a reduction sequence starting from [ α ] µβ.M . We prove | σ | ≤ η ( N ) + 1, from which the result follows. Let σ = [ R ] σ (cid:48) for some σ (cid:48) . We distinguishthe various cases according to the form of σ .(a) If [ α ] µβ.M → Rρ M [ β := α ] (cid:55)→ σ (cid:48) M , where σ = [ R ] σ (cid:48) , then the result obviouslyfollows.(b) If [ α ] µβ.M ) → R M (cid:55)→ σ (cid:48) M , where M (cid:54) = N and µβ.M does not disappear in σ ,then M = [ α ] µβ.M (cid:48) and M (cid:55)→ σ M (cid:48) , which yields the result.(c) If [ α ] µβ.M → R M (cid:55)→ σ (cid:48) M , where M (cid:54) = N and µβ.M disappears in σ . Then[ α ] µβ.M (cid:55)→ σ (cid:48)(cid:48) [ α ] µβ. [ β ] M k → θ [ α ] M k (cid:55)→ σ (cid:48)(cid:48)(cid:48) M , where µβ.M does not disappearin σ (cid:48)(cid:48) . We have [ α ] µβ.M → ρ M [ β := α ] (cid:55)→ σ (cid:48)(cid:48) [ β := α ] ([ β ] M k )[ β := α ] = [ α ] M k (cid:55)→ σ (cid:48)(cid:48)(cid:48) M , and the latter reduction sequence is equal in length to σ . By this the resultfollows.The reverse direction is obvious.(2) Similar to the above one. Lemma 4.13.
Let M = ( µα.M ) M −→ P and N = ( µα.M [ α := r M ]) −→ P (cid:48) . (1) If α ∈ F v ( M ) and N is strongly normalizable, then M is also strongly normalizable η ( M ) = η ( N ) + 1 . (2) If α / ∈ F v ( M ) and N, M are strongly normalizable, then M is also strongly normalizableand η ( M ) = η ( N ) + η ( M ) + 1 . Proof. (1) Let M → σ M ∗ . We prove | σ | ≤ η ( N ) + 1, from this η ( M ) ≤ η ( N ) + 1 follows.(a) The redex R = ( µα.M ) M is involved in σ .(i) If µα.M does not disappear in σ , ( µα.M ) M −→ P → σ (cid:48) ( µα.M (cid:48) ) M (cid:48) −→ P (cid:48) → µ ( µα.M (cid:48) [ α := r M (cid:48) ]) −→ P (cid:48) (cid:55)→ σ (cid:48)(cid:48) M ∗ . Then, since α ∈ F v ( M ), by Lemmas 3.15and 3.14, the reduction sequence ( µα.M ) M −→ P → r ( µα.M [ α := r M ]) −→ P (cid:55)→ ( µα.M [ α := r M (cid:48) ]) −→ P (cid:55)→ ( µα.M (cid:48) [ α := r M (cid:48) ]) −→ P (cid:48) (cid:55)→ σ (cid:48)(cid:48) M ∗ has length at least | σ | , by which the assertion follows.(ii) If µα.M disappears in σ , ( µα.M ) M −→ P → σ (cid:48) ( µα. [ α ] M (cid:48) ) M (cid:48) −→ P (cid:48) → θ ( M (cid:48) M (cid:48) −→ P (cid:48) ) (cid:55)→ σ (cid:48)(cid:48) M ∗ . Then, since α ∈ F v ( M ), by Lemmas 3.15 and 3.14,the sequence ( µα.M ) M −→ P → µ ( µα.M [ α := r M ]) −→ P (cid:55)→ ( µα. ([ α ] M (cid:48) )[ α := r M (cid:48) ]) −→ P (cid:48) = ( µα. [ α ]( M (cid:48) M (cid:48) )) −→ P (cid:48) ) → θ ( M (cid:48) M (cid:48) −→ P (cid:48) ) (cid:55)→ σ (cid:48)(cid:48) M ∗ has length at least | σ | , which yields the result.(b) The redex R = ( µα.M ) M is not involved in σ .(i) If µα.M does not disappear in σ , that is, ( µα.M ) M −→ P (cid:55)→ M ∗ =( µα.M (cid:48) ) M (cid:48) −→ P (cid:48) . Then, since α ∈ F v ( M ), we can apply Lemmas 3.15 and3.14 to assert that ( µα.M ) M −→ P → R ( µα.M [ α := r M ]) −→ P (cid:55)→ ( µα.M (cid:48) [ α := r M (cid:48) ]) −→ P (cid:48) has length at least | σ | + 1.(ii) If µα.M disappears in σ , ( µα.M ) M −→ P (cid:55)→ ( µα. [ α ] M (cid:48) ) M (cid:48) −→ P (cid:48) → θ ( M (cid:48) M (cid:48) −→ P (cid:48) ) (cid:55)→ M ∗ . By Lemmas 3.14 and 3.15, the sequence( µα.M ) M −→ P → R ( µα.M [ α := r M ]) −→ P (cid:55)→ ( µα. ([ α ] M (cid:48) )[ α := r M (cid:48) ]) −→ P (cid:48) =( µα. [ α ]( M (cid:48) M (cid:48) )) −→ P (cid:48) → θ ( M (cid:48) M (cid:48) −→ P (cid:48) ) (cid:55)→ M ∗ has length at least | σ | + 1, whichproves the assertion.The reverse direction is obvious.(2) The proof of η ( M ) ≤ η ( N ) + η ( M ) + 1 is similar to the first part of the proof of Lemma4.13. In this case the verification is made easier by the fact that, since α / ∈ F v ( M ), µα.M does not disappear in a reduction sequence starting from M . For the converse, let N (cid:55)→ σ N (cid:48) and M (cid:55)→ ν M (cid:48) . Then ( µα.M ) M −→ P → ν ( µα.M ) M (cid:48) −→ P → µ ( µα.M ) −→ P → σ N (cid:48) is a reduction sequence starting from M , which means that η ( N )+ η ( M )+1 ≤ η ( M ).4.3. The general case.
In what follows we transform every λµ -term M into a λµI -term[[ M ]] k with some k ≥ η ( M ) ≤ η ([[ M ]] k ), by which, using Corollary 4.9, we canobtain a bound for η ( M ).At this point our presentation slightly differs from that of Xi [Xi.99]. We have refor-mulated the translation in [Xi.99], hence we were able to avoid the minor mistake of Xiwhen computing the complexity of the obtained λµ I-terms. For a detailed explanation see[Bat.07]. The interesting fact for Theorem 4.22, which is the main result of the paper, is,however, that we get the same bound for the simply typed λµ -calculus as Xi obtained forthe λ -calculus, mutatis mutandis. Namely, if we restrict the notion of the rank of a term inDefinition 4.1 by taking into consideration the β -redex only, we get the result of Xi for the λ -calculus as a special case of Theorem 4.22. This suggests that the addition of the classicalvariables, together with the new rules, does not increase the computational complexity of N ESTIMATION FOR THE LENGTHS OF REDUCTION SEQUENCES OF THE λµρθ -CALCULUS 27 the calculus. The idea of the translation is to introduce new variables of appropriate typesin order to ensure that each bounded variable appears in the terms. The only difficult caseis that of the λ -abstraction. We explain below the difficulties lying behind the definition forthe case of the abstraction. Definition 4.14. (1) Let V = { v ( A,B ) | A, B are types } be a set of distinguished variables such that for all A , B we have v ( A,B ) : A → ( B → A ), where v ( A,B ) are either constants or new variables.Let M : A and N : B be typed λµ -terms. We denote the term (( v ( A,B ) M ) N ) by (cid:104) M, N (cid:105) .(2) Let M be a term and k ≥
0. The λµ -term [[ M ]] k assigned to M is defined as follows. • [[ M ]] k = M , if M is a variable, • [[ M ]] k = λx.λy . . . . λy m . (cid:104) ([[ M ]] k y . . . y m ) , x (cid:105) , if M = λx.M such that lh ( type ( M )) ≤ k and type ( M ) = A → . . . → A m → B , type ( y i ) = A i (1 ≤ i ≤ m ) and B is atomic, • [[ M ]] k = λx. (cid:104) [[ M ]] k , x (cid:105) , if M = λx.M and lh ( type ( M )) > k , • [[ M ]] k = µα. (cid:104) [[ M ]] k , [ α ] z (cid:105) , if M = µα.M , where α / ∈ F v ( M ) and z is a new variablesuch that type ( M ) = type ( z ), • [[ M ]] k = µα. [[ M ]] k , if M = µα.M and α ∈ F v ( M ), • [[ M ]] k = [ α ][[ M ]] k , if M = [ α ] M , • [[ M ]] k = ([[ M ]] k [[ M ]] k ), if M = ( M M ).(3) For each term M and each k ≥
0, we define the contexte Γ
M,k wich containes theconstants v ( A,B ) of [[ M ]] k with their type A → ( B → A ).Observe that in the definition above the translations for λ - and µ -abstractions differ.The underlying reason is the fact that in a β -reduction the λ -abstraction disappears whilethis is not the case concerning a µ -reduction. Hence, in order to ensure the validity ofLemma 4.21, we must make sure that the translation of a term with β -redex as head redexcan be continued even after the reduction with the head redex. The main aim with thetranslation is to produce a λµ I-term [[ M ]] k from M such that the relation η ( M ) ≤ η ([[ M ]] k )should be valid, which is the statement of Lemma 4.21. To achieve this, we reproduce theoriginal M inside its translation [[ M ]] k in a sense, since, in general, the translation does notrespect reduction, that is, if M → N , then it is not necessarily the case that [[ M ]] k → [[ N ]] k .The next four lemmas describe some intuitively clear properties of the translation. Lemma 4.15.
Let M be a term and k ≥ . (1) [[ M ]] k is a λµI -term. (2) α ∈ F v ( M ) iff α ∈ F v ([[ M ]] k ) and if x ∈ F v ( M ) , then x ∈ F v ([[ M ]] k ) .Proof. By induction on comp ( M ).Observe that, in the case of λ -variables, F v ( M ) ⊆ F v ([[ M ]] k ), since M can contain freevariables of the form v ( A,B ) besides its original parameters. Lemma 4.16. If M is a term and k ≥ , then rank ([[ M ]] k ) = rank ( M ) .Proof. By induction on comp ( M ). Lemma 4.17. If M be a term and k ≥ , then comp ([[ M ]] k ) ≤ (2 k + 3) · comp ( M ) .Proof. The only nontrivial case is M = λx.M . Let lh ( type ( λxM )) = l . If k < l ,then comp ([[ M ]] k ) = comp ( λx. (cid:104) [[ M ]] k , x (cid:105) ) = comp ([[ M ]] k ) + 3 ≤ (2 k + 3) · comp ( M ). If k ≥ l , then, for some m ≤ l , we obtain by the induction hypothesis comp ([[ M ]] k ) = comp ( λx.λy . . . . λy m . (cid:104) ([[ M ]] k y . . . y m ) , x (cid:105) ) = comp ([[ M ]] k ) + 2 m + 3 ≤ (2 k + 3) · comp ( M ). Lemma 4.18.
Let
M, N be terms and k ≥ . (1) If Γ (cid:96) M : A , then Γ , Γ M,k (cid:96) [[ M ]] k : A . (2) [[ M ]] k [ x := [[ N ]] k ] = [[ M [ x := N ]]] k , (3) [[ M ]] k [ α := r [[ N ]] k ] = [[ M [ α := r N ]]] k , (4) [[ M ]] k [ β := α ] = [[ M [ β := α ]]] k .Proof. By induction on comp ( M ).Our aim is to prove η ( M ) ≤ η ([[ M ]] k ). The assertions of Subsection 4.2 and Lemma 4.19prepare the proof of that statement, which is the claim of Lemma 4.21. Lemma 4.19. If M → M (cid:48) and rank ( M ) ≤ k , then η ([[ M (cid:48) ]] k ) + 1 ≤ η ([[ M ]] k ) .Proof. By induction on comp ( M ).(1) If M = λx.M , the induction hypothesis applies.(2) If M = ( λx.M ) M . . . M n . We have lh ( type ( λx.M )) ≤ k by virtue of the assumption rank ( M ) ≤ k . Let type ( M ) = A → . . . A m → B , where B is atomic. Let M (cid:48) =( M [ x := M ] . . . M n ), otherwise the induction hypothesis applies. Since B is atomic, m ≥ n − M ]] k → λy . . . . λy m . (cid:104) ([[ M ]] k [ x := [[ M ]] k ] y . . . y m ) , [[ M ]] k (cid:105) . . . [[ M n ]] k (cid:55)→ λy n − . . . . λy m . (cid:104) ([[ M ]] k [ x := [[ M ]] k ] . . . [[ M n ]] k y n − . . . y m ) , [[ M ]] k (cid:105) . Lemma 4.18 gives([[ M ]] k [ x := [[ M ]] k ] [[ M ]] k . . . [[ M n ]] k ) = ([[ M [ x := M ]]] k [[ M ]] k . . . [[ M n ]] k ) =([[ M [ x := M ] M . . . M n ]] k ) = [[ M (cid:48) ]] k , by which the result follows.(3) If M = ( µα.M ) M . . . M n , we may assume again that M → R M (cid:48) , where R =( µα.M ) M .(a) If α ∈ F v ( M ), let M (cid:48) = ( µα.M [ α := r M ] . . . M n ). We have, by Lemma 4.18,[[ M ]] k = ( µα. [[ M ]] k )[[ M ]] k . . . [[ M n ]] k → ( µα. [[ M ]] k [ α := r [[ M ]] k ] . . . [[ M n ]] k ) =( µα. [[ M [ α := r M ]]] k . . . [[ M n ]] k ) = [[ M (cid:48) ]] k .(b) If α / ∈ F v ( M ), then M (cid:48) = ( µα.M ) M . . . M n and [[ M ]] k → ( µα. (cid:104) [[ M ]] k , [ α ]( z [[ M ]] k ) (cid:105) )[[ M ]] k . . . [[ M n ]] k . We may assume α / ∈ F v ( M i ) (1 ≤ i ≤ k ). Then Lemma 4.10 gives η (( µα. (cid:104) [[ M ]] k , [ α ]( z [[ M ]] k ) (cid:105) )[[ M ]] k . . . [[ M n ]] k ) ≥ η (( µα. (cid:104) [[ M ]] k , [ α ] z (cid:105) )[[ M ]] k . . . [[ M n ]] k ) + η ([[ M ]] k ) + 1. Moreover, by induction on n , we obtain that η ([[ M (cid:48) ]] k ) ≤ η (( µα. (cid:104) [[ M ]] k , [ α ] z (cid:105) )[[ M ]] k . . . [[ M n ]] k ), by which theresult follows.(4) If M = [ α ] M , the only interesting case is M = [ α ] µβ.M (cid:48) → M (cid:48) [ β := α ]. If β ∈ F v ( M (cid:48) ),then [[ M ]] k = ( α µβ. [[ M (cid:48) ]] k ). Otherwise, [[ M ]] k = [ α ] µβ. (cid:104) [[ M (cid:48) ]] k , [ β ] z (cid:105) . Applying Lemma4.18, in both cases we obtain the result.(5) The case M = µα.M is analogous to the previous one.(6) If M = ( x M −→ P ), the induction hypothesis applies. N ESTIMATION FOR THE LENGTHS OF REDUCTION SEQUENCES OF THE λµρθ -CALCULUS 29
Prior to proving the next lemma, we demonstrate with an example that the hypothesis rank ( M ) ≤ k was indeed necessary for the validity of Lemma 4.19. Example 4.20.
Let M = ( λx.λy.y x ) y . Then M (cid:48) = ( λy.y ) y . Assume x, y : A . Then rank ( λx.λy.y ) = 2, which means rank ( M ) = 2. Let k = 1. Then[[ M ]] = (( λx. (cid:104) [[ λy.y ]] , x (cid:105) ) x ) y , and [[ M (cid:48) ]] = ( λy. (cid:104) y, y (cid:105) ) y .Since [[ λy.y ]] = λy. (cid:104) y, y (cid:105) is not a redex, we have η ([[ M ]] ) = η ([[ M (cid:48) ]] ) = 1, thus thestatement of Lemma 4.19 is not valid for M . Lemma 4.21. If M is a λµ -term such that rank ( M ) ≤ k , then η ( M ) ≤ η ([[ M ]] k ) .Proof. By induction on ( η ([[ M ]] k ) , comp ( M )).(1) If M = λx.M , then, by the induction hypothesis we have the result.(2) If M = ( x M . . . M n ), then, by the induction hypothesis, η ( M ) = η ( M )+ · · · + η ( M n ) ≤ η ([[ M ]] k ) + · · · + η ([[ M n ]] k ) = η ([[ M ]] k ).(3) If M = ( λx.M ) M . . . M n , let M (cid:48) = ( M [ x := M ] . . . M n ). If follows from Lemma 4.2that rank ( M (cid:48) ) ≤ k .- x ∈ F v ( M ): By Lemmas 4.19 and 4.11 and the induction hypothesis, η ( M ) = η ( M (cid:48) ) + 1 ≤ η ([[ M (cid:48) ]] k ) + 1 ≤ η ([[ M ]] k ).- x / ∈ F v ( M ): [[ M ]] k → β λy . . . . λy m . (cid:104) ([[ M ]] k y . . . y m ) , [[ M ]] k (cid:105) . . . [[ M n ]] k = U . ByLemma 4.11, we are ready, if we prove η ([[( M M . . . M n )]] k ≤ η ( U ). By the choice of m , we have m ≥ n −
2, hence U (cid:55)→ (cid:104) ([[ M ]] k [[ M ]] k . . . [[ M m ]] k ) , [[ M ]] k (cid:105) . . . [[ M n ]] k , from which the conclusion follows.(4) Let M = ( µα.M ) M . . . M n .- If α ∈ F v ( M ), let M (cid:48) = ( µα.M [ α := r M ] . . . M n ). Then rank ( M (cid:48) ) ≤ k byLemma 4.2 again. We have, by Lemmas 4.19, 4.13 and the induction hypothesis, η ( M ) = η ( M (cid:48) ) + 1 ≤ η ([[ M (cid:48) ]] k ) + 1 = η ([[ M ]] k ).- If α / ∈ F v ( M ), let M (cid:48) = ( µα.M ) M . . . M n . We have[[ M ]] k → ( µα. (cid:104) [[ M ]] k , [ α ]( z [[ M ]] k ) (cid:105) )[[ M ]] k . . . [[ M n ]] k , which, together with Lemmas4.13, 4.10, 4.2 and the induction hypothesis, yields that η ( M ) ≤ η ( M (cid:48) ) + η ( M ) + 1 ≤ η ([[ M (cid:48) ]] k ) + η ([[ M ]] k ) + 1 ≤ η ([[ M ]] k ).(5) Let M = µα.M .- Assume α ∈ F v ( M ). If µα.M = µα. [ α ] M is a θ -redex, then, by Lemmas 4.12,4.2 and the induction hypothesis, η ( M ) = η ( M ) + 1 ≤ η ([[ M ]] k ) + 1 = η ([[ M ]] k ).Otherwise, let µα.M → M (cid:48) . Since µα.M is not a θ -redex, we have M (cid:48) = µα.M (cid:48) together with rank ( M (cid:48) ) ≤ k . By Lemma 4.19, we can apply the induction hypothesisto M (cid:48) , that is, η ( µα.M (cid:48) ) + 1 ≤ η ([[ µα.M (cid:48) ]] k ) + 1 ≤ η ([[ µα.M ]] k ). But M (cid:48) was arbitraryand η ( M ) = max { η ( M (cid:48) ) + 1 | M → M (cid:48) } , which proves our assertion.- If α / ∈ F v ( M ), then we can apply the induction hypothesis to M .(6) Let M = [ α ] µβ.M (cid:48) . Similar to the previous case by using Lemma 4.12.The following theorem is the main result of our paper. Interestingly, as mentionedbefore, we obtain the same bound for the λµρθ -calculus as that for the λ -calculus [Xi.99]. Theorem 4.22. If M is a λµ -term such that rank ( M ) = k , then every βµρθ -reductionsequence starting from M is of length less than tower ( k + 1 , (2 k + 3) · comp ( M )) .Proof. We obtain, by Lemma 4.17, comp ([[ M ]] k ) ≤ (2 k + 3) · comp ( M ) and, by Lemma4.16, rank ([[ M ]] k ) = rank ( M ). These, together with Corollary 4.9 and Lemma 4.21, imply η ( M ) ≤ η ([[ M ]] k ) < tower ( k + 1 , comp ([[ M ]] k )) ≤ tower ( k + 1 , (2 k + 3) · comp ( M )). Concluding remarks
In what follows, we give a short account of the other possibilities for obtaining bounds forthe reduction sequences in the λµ -calculus. We could have also begun our paper with theseconsiderations, however the methods below do not give such full-fledged results as the onediscussed above (the bounds are higher and, more importantly, we were unable to treat theadditional rules by the arguments presented below). By this reason, we decided to deal withthese discussions only after the main argument of the paper. We could resort to the ideaof translating the λµ -calculus into the λ -calculus by a CPS-translation such that the sizesof the translated terms and the lengths of their reduction sequences would depend on thesizes and lengths of the original terms. Then the bound for the λ -calculus would provideus with a bound for the λµ -calculus, too. By examining this idea, we have come to theconclusion that we were not able to simulate every reduction rule, if we apply the alreadyexisting translations, and even the bound would be much worse than the one appearing inour result. We investigate these questions in detail below.5.1. A possible attempt to compute an upper bound for the λµρ -calculus.
In thefollowing observations we confine our attention to the case of the λµρ -calculus. In orderto establish a bound for the lengths of reduction sequences of the λµρ -calculus it seemsto be a natural idea to try to transform a reduction sequence of the λµρ -calculus into areduction sequence of the λ -calculus. We go round this approach a little bit more detailed:we present the CPS-translation from the simply-typed λµρ -calculus to the simply-typed λ -calculus introduced by de Groote [deG.01], and then we give an account of the possibilitiesof finding an appropriate bound with this method. The notation for the CPS-translation istaken from de Groote [deG.01]. As to a bound for the simply-typed λ -calculus we regardthe one presented in Xi [Xi.99]. Definition 5.1.
Let o be some distinguished atomic type.(1) For every type A , we define the three types A o , ∼ A and A by : ∼ A = A → o , A = ∼∼ A o , ⊥ o = o , X o = X , if X is atomic, and ( B → C ) o = B → C .(2) Let Γ λ (resp. Γ µ ) denote a λ -context (resp. µ -context), that is, a finite (possibly empty)set of declarations x : A , . . . , x n : A n (resp. α : ¬ B , . . . , α m : ¬ B m ). We define Γ λ (resp. ∼ Γ oµ ) by x : A , . . . , x n : A n (resp. α : ∼ B o , . . . , α m : ∼ B om ).We suppose that the µ -variables of the λµρ -calculus are also λ -variables of the λ -calculus. Definition 5.2.
The CPS-translation M of a λµρ -term M is defined as follows. • x = λk. ( x k ), • λx.M = λk. ( k λx.M ), • ( M N ) = λk. ( M λm. ( m N k )), • µα.M = λα. ( M λk.k ), • [ α ] M = λk. ( M α ). Lemma 5.3.
Let M : A be a typable term with λ -context Γ λ and µ -context Γ µ . Then itsCPS-translation, M , is typable with contexts Γ λ and ∼ Γ oµ . Definition 5.4.
Let = λ (resp. = µ ) denote the relation defined as the reflexive, symmetric,transitive closure of the β -reduction (resp. that of the union of the β -, µ - and ρ -reductions).As usual, we consider terms differing in renaming of bound variables as equals. N ESTIMATION FOR THE LENGTHS OF REDUCTION SEQUENCES OF THE λµρθ -CALCULUS 31
Then, in [deG.94], de Groote proves the following result.
Lemma 5.5.
Let
M, N be λµρ -terms. Then M = µ N iff M = λ N . Unfortunately, in Lemma 5.5, M (cid:55)→ λ N does not hold in general, even if M (cid:55)→ µ N . Soon one hand we cannot use the CPS-translation to imitate the reduction sequences in the λµρ -calculus by reduction sequences in the λ -calculus. On the other hand there can beanother drawback of this approach.In general, we could make use of the CPS-translation for estimating bounds of reductionsequences if, for any M (cid:55)→ σµ N F ( M ), we could find a ν with M (cid:55)→ νλ N F ( M ) such that | σ | ≤ c. | ν | with some constant c , where N F ( M ) and N F ( M ) denote the (unique) normalform of M in the λµρ -calculus and of M in the λ -calculus, respectively. In fact, we evenknow that N F ( M ) = N F ( M ), where M stands for the so called modified CPS-translationof the term M ( de Groote [deG.94]).For the moment suppose for every reduction sequence M (cid:55)→ σ N F ( M ) we can find areduction sequence ν such that M (cid:55)→ νλ N F ( M ) with | σ | ≤ c · | ν | . By the result for the β -normalization in Xi [Xi.99], we would have for any ν as above | ν | < c · tower( rank ( M ) + 1 , (2 · rank ( M ) + 3) · comp ( M )).On the other hand we have the following estimations. Lemma 5.6.
Let M be a λµ -term. Then rank ( M ) = 3 · rank ( M ) and · comp ( M ) < comp ( M ) . This means that the best estimation for the lengths of the reductions with this methodwould be greater than c · tower(3 · rank ( M ) + 1 , (12 · rank ( M ) + 6) · comp ( M )), and by thedirect method this upper bound is tower( rank ( M ) + 1 , (2 · rank ( M ) + 3) · comp ( M )). Atpresent, no CPS-translation which could yield a significantly better estimation is known tothe authors.5.2. A translation of the λµ -calculus into the λ ∗ c -calculus. Some years ago Davidand Nour [DaNo2.07] discovered a translation of the λµ -calculus into the λ -calculus withrecursive equations for types. This is somewhat simpler than the CPS-translation andprovides an easy method for finding an estimation for the lengths of the reduction sequencesin the λµ -calculus. We present a version of their translation establishing a connectionbetween the λµ -calculus and a variant of the λ -calculus enlarged with some constants. Themethod traces back to Krivine [Kri.91, Kri.94], where he supplemented the typed calculuswith a constant of type ∀ X ( ¬¬ X → X ). Definition 5.7.
Enhance the set of types of the simply typed λ -calculus with an element ⊥ and define ¬ A as A → ⊥ . Let X be an atomic type, add for each X a new constant c X of type ¬¬ X → X . Let us call the new calculus as λ ∗ c . We define for each type A a closed λ ∗ c -term T A such that T A has the type ¬¬ A → A . • T ⊥ = λy. ( y I ), where I = λx.x , • T X = c X , where X is atomic, • T A → B = λx.λy. ( T B λz. ( x λt. ( z ( t y )))).We suppose that the µ -variables of the λµ -calculus are also λ -variables of the λ -calculus. Definition 5.8.
Let k ≥
0. We define a k -translation (cid:107) . (cid:107) k of the set of λµ -terms into theset of terms of the λ ∗ c -calculus as follows. • (cid:107) x (cid:107) k = x , • (cid:107) λx.M (cid:107) k = λx. (cid:107) M (cid:107) k , • (cid:107) ( M N ) (cid:107) k = ( (cid:107) M (cid:107) k (cid:107) N (cid:107) k ), • (cid:107) µα.M (cid:107) k = ( T A λα. (cid:107) M (cid:107) k ), if α has type ¬ A and lh ( A ) ≤ k , • (cid:107) µα.M (cid:107) k = ( z (cid:107) M (cid:107) k ), if α has type ¬ A and lh ( A ) > k and where z : ⊥ → A is a newvariable, • (cid:107) [ α ] M (cid:107) k = ( α (cid:107) M (cid:107) k ).In the above definition the µ -variables and its translated counterparts were denotedwith the same letters. Let (cid:96) λµ and (cid:96) λ ∗ c denote the typing relations in the λµ - and in the λ ∗ -calculus, respectively. We have the following assertions. Lemma 5.9.
Let k ≥ and M a λµ -term. If Γ (cid:96) λµ M : A , then Γ (cid:96) λ ∗ c (cid:107) M (cid:107) k : A .Proof. Straightforward.
Lemma 5.10.
Let k ≥ , M , N be λµ -terms such that rank ( M ) ≤ k .If M → λµ N , then (cid:107) M (cid:107) k (cid:55)→ + λ (cid:107) N (cid:107) k .Proof. Obviously, it is enough to check the relation (cid:107) ( µα.M ) M (cid:107) k (cid:55)→ + λ (cid:107) µα.M [ α := r M ] (cid:107) k , where, necessarily, k ≥ lh ( A ) provided type ( α ) = ¬ A . Lemma 5.11.
Let k ≥ , M , N be λµ -terms such that rank ( M ) ≤ k .If M (cid:55)→ n N , then (cid:107) M (cid:107) k (cid:55)→ m (cid:107) N (cid:107) k for some m ≥ n .Proof. Follows from Lemmas 4.2 and 5.10.Since no reduction rules are added to λ when defining λ ∗ c , the method of Xi [Xi.99] forestimating the lengths of reduction sequences is also applicable to λ ∗ c without any changes.We state without proof the following theorem. Theorem 5.12.
Let M be a λ ∗ c -term such that rank ( M ) = k . Then every reduction sequencestarting from M has length less than tower ( k + 1 , (2 k + 3) · comp ( M )) . In order to establish a bound for the lengths of λµ -reduction sequences we have toestimate the size of the translated terms as well. Lemma 5.13. If A is a type, then comp ( T A ) ≥ · lh ( A ) + 3 .Proof. Obvious.
Lemma 5.14. If M is a λµ -term such that rank ( M ) = k , then comp ( (cid:107) M (cid:107) k ) ≤ (8 k + 4) · comp ( M ) .Proof. By induction on comp ( M ). We only check one of the cases. Let M = ( µα.M ) M .Assume type ( α ) = ¬ A . Then, since k ≥ lh ( A ), we have, by Lemma 5.13 and the inductionhypothesis, comp ( (cid:107) M (cid:107) k ) = comp ( (cid:107) µα.M (cid:107) k ) (cid:107) M (cid:107) k = comp (( T A λα. (cid:107) M (cid:107) k )) + comp ( (cid:107) M (cid:107) k ) ≤ (8 k + 4) + comp ( (cid:107) M (cid:107) k ) + comp ( (cid:107) M (cid:107) k ) ≤ (8 k + 4) · comp ( M ). Theorem 5.15.
Let M be a λµ -term such that rank ( M ) = k . Then every reductionsequence starting from M has length less thantower ( k + 1 , (2 k + 3) · (8 k + 4) · comp ( M )) .Proof. Follows from Theorem 5.12 and Lemma 5.14.
N ESTIMATION FOR THE LENGTHS OF REDUCTION SEQUENCES OF THE λµρθ -CALCULUS 33
This method, however, is not applicable to the λµρθ -calculus, since, in the cases of the ρ - and θ -reductions, Lemma 5.10 is not valid.6. Future work
In this paper, we have shown how to find a bound for the lengths of the reduction sequencesin the simply typed λµ -calculus extended with the rules ρ and θ . The bound depends onlyon the size of the term and on the maximum of the ranks of its redexes. We first gave abound concerning λµ I-terms, then we established a correspondence between λµ -terms and λµ I-terms such that the lengths of the longest reduction sequences do not decrease. Toobtain a bound for the λµ I-calculus we defined the notion of a standard βµρθ -reductionsequence, the formulation of which was not entirely straightforward because of the presenceof overlapping redexes. Surprisingly, we have obtained that, with the necessary changes,the same bound is appropriate for the λµ -calculus as the one found by Xi [Xi.99] for the λ -calculus [Xi.99]. This leads us to the conjecture that the computational complexity of the λ -calculus is not enhanced by the introduction of the classical variables and the new rules.Our future work can be the following.(1) Finding a term realizing the bound.
In the literature usually different upper boundscan be found for the lengths of the reduction sequences in the λ -calculus. A questionnaturally arises, which bounds could be the most precise ones? Could we amend thepresent bounds considerably?(2) Commutation lemmas for the ρ - and θ -rules. If we considered only the β - and µ -rules, our proof would simplify considerably, especially the arguments concerningstandardization. However, the question arises whether, in the cases of the ρ - and the θ -rules, we are able to prove commutation lemmas together with maintaining an upperbound for the lengths of the reductions. It would be good to see whether this approachsimplifies the presentation of our results or not.(3) Other rules for the λµ -calculus. The λµ -calculus can be considered with other kindsof reductions. For example, one can prohibit two consecutive µ -abstractions ( µα.µβ.M )or µ -variable applications ([ α ][ β ] M ) (see Nour [Nou.97]). Parigot has also proposed arule which prohibits that a λ -abstraction should immediately follow a µ -variable (Py[Py.98]). Moreover, in Saurin’s paper [Sau.10], there are some additional rules: Saurinproves a standardization theorem with respect to his calculus. Another rule is also worthconsidering: ( N µα.M ) → µ (cid:48) µα.M [ α : = l N ], where M [ α : = l N ] is obtained from M byreplacing every subterm in M of the form [ α ] U by [ α ]( N U ). This rule is the symmetriccounterpart of the µ -rule, the addition of which makes the λµ -calculus non-confluent, butthe strong normalization still holds [DaNo2.05, DaNo1.07]. A standardization result inrelation to the λµµ (cid:48) -calculus is obtained by David and Nour in [DaNo1.05]. Concerningour results, we think that the same bound could also be obtained for the λµµ (cid:48) -calculus.Presumably, the proof would be a little more involved than the one presented in thisarticle, however, we do not intend to elaborate it.(4) Other classical calculi.
It would be interesting to find an upper bound for the lengthsof the reduction sequences in other classical calculi [BaBe.96, CuHe.00]. The questionnaturally arises whether the methods presented in this paper are applicable to them.
Acknowledgment
We wish to thank Ren´e David for helpful discussions.
References [AsLe.13] A. Asperti and J.-J. L´evy.
The Cost of Usage in the Lambda-Calculus , LICS 2013: pp. 293-300,2013.[Bar.85] H. P. Barendregt.
The Lambda Calculus: Its Syntax and Semantics , Studies in Logic and theFoundations of Mathematics, Volume 103, North Holland, 1985.[BaBe.96] F. Barbanera and S. Berardi.
A symmetric lambda calculus for classical program extraction ,Information and computation (125), pp. 103-117, 1996.[Bat.07] P. Batty´anyi.
Normalization properties of symmetric logical calculi , PhD thesis, University ofChamb´ery, 2007.[CuHe.00] P.-L. Curien and H. Herbelin.
The duality of computation , ACM SIGPLAN Notices, 2000.[Dav.01] R. David.
Normalization without reducibility , Annals of Pure and Applied Logic (107), pp. 121-130,2001.[DaNo.03] R. David and K. Nour.
A short proof of the strong normalization of the simply typed λµ -calculus ,Schedae Informaticae (12), 2003.[DaNo1.05] R. David and K. Nour. Why the usual candidates of reducibility do not work for the symmetric λµ -calculus , Electronic Notes in Theoretical Computer Science (140), 2005.[DaNo2.05] R. David and K. Nour. Arithmetical proofs of strong normalization results for the symmetric λµµ (cid:48) -calculus , TLCA 2005, Lecture Notes in Computer Science (3461), pp. 162-178, Springer Verlag,Berlin, 2005.[DaNo1.07] R. David and K. Nour.
Arithmetical proofs of strong normalization results for symmetric lambdacalculi , Fundamenta Informaticae (77), pp. 1001-1022, 2007.[DaNo2.07] R. David and K. Nour.
An arithmetical proof of the strong normalization for the λ -calculus withrecursive types , TLCA 2007, Lecture Notes in Computer Science (4583), Springer Verlag, Berlin, 2007.[Gri.90] T. Griffin. A formulae-as-type notion of control , POPL 1990, pp. 47-58, ACM Press, New York,1990.[deG.94] P. de Groote.
A CPS-translation of the λµ -calculus , Lecture Notes in Computer Science (787),Springer Verlag, Berlin, 1994.[deG.98] P. de Groote. An environment machine for the λµ -calculus , Mathematical Structure in ComputerScience (8), 1998.[deG.01] P. de Groote. Strong normalization of classical natural deduction with disjunction , TLCA 2001,Lecture Notes in Computer Science (2044), Springer Verlag, Berlin, 2001.[Kri.91] J.-L. Krivine.
Lambda-calcul, ´evaluation paresseuse et mise en m´emoire , Thearetical Informaticsand Applications. Vol. 25,1 pp. 67-84, 1991.[Kri.94] J.-L. Krivine.
Classical logic, storage operators and 2nd order lambda-calculus , Annals of Pure andApplied Logic (68), pp. 53-78, 1994.[Mur.91] C. R. Murthy.
An evaluation semantics for classical proofs , Proceedings of the sixth annual IEEEsymposium, pp. 96-107, 1991.[Nou.97] K. Nour.
La valeur d’un entier classique en λµ -calcul , Archive for Mathematical Logic (36), pp.461-471, 1997.[Par.90] M. Parigot. Free Deduction: An Analysis of “Computations” in Classical Logic , Lecture Notes inComputer Science (592), pp. 361-380, Springer-Verlag, Berlin, 1990.[Par.92] M. Parigot. λµ -calculus: an algorithmic interpretation of classical natural deduction , Lecture Notesin Computer Science (624), pp. 190-201, Springer Verlag, Berlin, 1992.[Par.93] M. Parigot. Classical proofs as programs , Lecture Notes in Computer Science (713), pp. 263-276,Springer Verlag, Berlin, 1993.[Par.97] M. Parigot.
Proofs of strong normalization for second order classical natural deduction , Journal ofSymbolic Logic (62), pp. 1461-1479, 1997.[Py.98] W. Py.
Confluence en λµ -calcul , PhD thesis, University of Chamb´ery, 1998.[ReSo.94] N. J. Rehof and M. H. Sørensen. The λ (cid:52) -calculus , Lecture Notes in Computer Science (789), pp.516-542, 1994. N ESTIMATION FOR THE LENGTHS OF REDUCTION SEQUENCES OF THE λµρθ -CALCULUS 35 [Roz.03] P. Rozi`ere.
D´eduction naturelle classique et λµ -calcul , Course notes, 2003.[Sau.10] A. Saurin. Standardization and B¨ohm trees for λµ -calculus , in: FLOPS 2010, in: Lecture Notes inComputer Science, 2010.[Tai.67] W. W. Tait. Intensional Interpretations of Functionals of Finite Type I , Journal of Symbolic Logic(32), pp. 198-212, 1967.[Xi.99] H. Xi.
Upper bounds for standardisation and an application , Journal of Symbolic Logic (64), pp.291-303, 1999.[Xi.05] H. Xi.
Development separation in lambda-calculus , WOLLIC 2005, Electronic Notes in TheoreticalComputer Science (143), pp. 207-221, 2005.
This work is licensed under the Creative Commons Attribution License. To view a copy of thislicense, visit https://creativecommons.org/licenses/by/4.0/https://creativecommons.org/licenses/by/4.0/