Nonmodularity results for lambda calculus Antonino Salibra Universita Ca'Foscari di Venezia, Dipartimento di Informatica, Via Torino 155, 30172 Venezia, Italy,
[email protected]
Abstract
The variety (equational class) of lambda abstraction algebras was introduced to algebraize the untyped lambda calculus in the same way cylindric and polyadic algebras algebraize the rst-order predicate logic. In this paper we prove that the lattice of lambda theories is not modular and that the variety generated by the term algebra of a semi-sensible lambda theory is not congruence modular. Another result of the paper is that the Mal'cev condition for congruence modularity is inconsistent with the lambda theory generated by equating all the unsolvable -terms.
Key words and phrases. Lambda calculus, lambda abstraction algebras, combi-
natory algebras, lattice of lambda theories, modularity, commutator.
1 Introduction The untyped lambda calculus was introduced by Church [3, 4] as a foundation for logic. Although the appearance of paradoxes caused the program to fail, a consistent part of the theory turned out to be successful as a theory of \functions as rules" (formalized as terms of the lambda calculus) that stresses the computational process of going from the argument to value. Every object is at the same time a function and an argument; in particular a function can be applied to itself. There have been several attempts to reformulate the lambda calculus as a purely algebraic theory. However the general methods that have been developed in universal algebra and category theory, for de ning the semantics of an arbitrary algebraic theory, are not directly applicable, since the untyped lambda calculus is not an equational theory in the normal sense. In fact, the equations, unlike the associative and commutative laws for example, are not always preserved when arbitrary terms are substituted for variables (e.g., x:yx = z:yz does not imply x:xx = z:xz). In [21, 25] Pigozzi and Salibra have introduced lambda abstraction algebras (LAA's) which constitute a purely algebraic theory of the untyped lambda calculus. The equational theory of lambda abstraction algebras is intended as an alternative to combinatory logic (see Curry-Feys [5]) since it is a rst-order algebraic description of lambda calculus, which allows to keep the lambda notation and hence all the functional intuitions. Combinatory algebras (CA's) and lambda abstraction algebras are both de ned by
2
universally quanti ed equations and thus form varieties in the universal algebraic sense. There are important dierences however that result in theories of very dierent character. Functional application is taken as a fundamental operation in both CA's and LAA's. Lambda (i.e., functional) abstraction is also fundamental in LAA's but in CA's is de ned in terms of the combinators k and s. A more important dierence is connected with the role variables play in the lambda calculus as place holders. In a LAA this is also abstracted. It takes the form of a system of basic elements (nullary operations) of the algebra. This is a crucial feature of LAA's that is borrowed from cylindric and polyadic algebras (see Henkin-Monk-Tarski [13] and Halmos [12]) and has no direct analogue in CA's. The most natural LAA's are algebras of functions, called functional LAA's, which arise as \expansions" of suitable combinatory algebras by the variables of lambda calculus in a natural way. The situation in algebraic logic is analogous, and it is the algebraic-logic model that mainly motivated our study. In analogy to the case for LAA's, the most natural cylindric (and polyadic) algebras are algebras of functions that are obtained by coordinatizing models of classical rst-order logic. The smallest variety that includes all the functional algebras that are most closely connected with models of rst-order logic constitutes the class of representable cylindric algebras. It is a proper subvariety of the class of all cylindric algebras, hence non-representable cylindric algebras exist. Questions related to the functional representation of various subclasses of lambda abstraction algebras were investigated by Pigozzi and Salibra in a series of papers [21, 23, 24, 25, 27]. In a recent paper Salibra and Goldblatt [31] have solved the problem of representability for LAA's, by showing that every LAA is isomorphic to a functional LAA and that the class of isomorphic images of functional lambda abstraction algebras constitutes a variety of algebras axiomatized by the nite schema of identities characterizing LAA's. The theory of lambda abstraction algebras can be regarded as axiomatizing the equations that hold between contexts of the lambda calculus, as opposed to lambda terms with free variables. We recall from Barendregt [1, Def. 14.4.1] that a context is a -term with some `holes' in it. The essential feature of a context is that a free variable in a -term may become bound when we substitute it for a `hole' within the context. Barendregt's `holes' play the role of algebraic variables, and the contexts are the algebraic terms in the similarity type of lambda abstraction algebras. In [30] Salibra has shown that, for every variety of LAA's, there exists exactly one lambda theory whose term algebra generates the variety. For example, the variety generated by the term algebra of the least lambda theory is the variety LAA of all lambda abstraction algebras. Hence the explicit nite equational axiomatization for the variety of lambda abstraction algebras provides also an explicit axiomatization of the identities between contexts satis ed by the term algebra of the least lambda theory . These results prove useful in the lambda calculus as a way for applying the methods of universal algebra: we can study the properties of a lambda theory by means of the variety of LAA's generated by its term algebra. It is well known that the structure of an algebra is aected by the shape of its congruence lattice. For example, it is easy to show that if a group G has three normal subgroups (recall that normal subgroups of a group correspond to congruences), any two of which intersect in the trivial subgroup and generate the whole G, then
Nonmodularity results for lambda calculus
3
G must be Abelian. Put in another way, if the nite lattice M3 is a 0-1-sublattice of the lattice of congruences of G, then G is Abelian. Alternatively, the concept of Abelian group (and other important concepts such as the center of a group, the centralizer of a normal subgroup, solvable group, and nilpotent group) can be de ned in terms of the commutator operation [M; N ] = Sg(fa?1b?1ab : a 2 M; b 2 N g) on normal subgroups: G is Abelian if, and only if, [G; G] is the trivial subgroup. The extension of the commutator to algebras other than groups is due to the pioneering papers of Smith [33] and Hagemann-Hermann [11]. General commutator theory has to do with a binary operation, the commutator, that can be de ned on the set of congruences of any algebra. The operation is very well-behaved in congruence modular varieties (see Freese-McKenzie [6] and Gumm [10]). Lipparini [17, 18] and Kearnes-Szendrei [15] have recently shown that under very weak hypotheses the commutator proves also useful in studying algebras without congruence modularity. Their deep results essentially connect: (a) identities or quasi-identities in the language of lattices satis ed by congruence lattices; (b) properties of the commutator; and (c) Mal'cev conditions, that characterize properties in varieties by the existence of certain terms involved in certain identities. The lattice of lambda theories of lambda calculus (see [1, Chapter 4]) is the congruence lattice of the term algebra of the least lambda theory , and this term algebra generates the variety LAA of all lambda abstraction algebras (see Salibra [30]). We propose to study the properties of the lattice of lambda theories by the corresponding properties of the commutator in the variety LAA. In the present paper, we show that every variety of LAA's generated by the term algebra of a semi-sensible lambda theory is not congruence modular, as a consequence it is not possible to apply to it the theory of commutator developed for congruence modular varieties. We also prove that two interesting lattices are not modular: the lattice of the lambda theories of lambda calculus and the lattice of the subvarieties of LAA. In spite of these negative results, we believe that the recent theory of the commutator for algebras without congruence modularity [17, 18, 15] can be fruitfully applied to the lambda calculus and we intend to investigate it in a future paper. Unless otherwise stated we shall use the terminology of Barendregt [1] for lambda calculus and that of Salibra and Goldblatt [31] for lambda abstraction algebras. For the general theory of lambda calculus the reader may consult Barendregt [1] and Krivine [16]. For lambda abstraction algebras and variable-binding calculi the reader may consult Goldblatt [7, 8], Pigozzi and Salibra [22, 27, 25, 26], Salibra and Goldblatt [31], and Salibra [29, 30]. For the general theory of universal algebras the reader may consult Burris and Sankappanavar [2], Gratzer [9], and McKenzie, McNulty and Taylor [19]. For commutator theory the reader may consult Freese and McKenzie [6], and Gumm [10]. The main references for cylindric algebras are [13] and [14]; for polyadic algebras it is [12]. We also mention here Nemeti [20]. It contains an extensive survey of the various algebraic versions of quanti er logics.
4
2 Basic De nitions A lattice order is a partial order on a nonempty set L with respect to which every subset of L with exactly two elements has both a least upper bound (join) and a greatest lower bound (meet). The join and meet of a and b are denoted respectively by a + b and ab. A lattice L is modular if it satis es the modular law: a(b + c) = ab + c for all a; b; c 2 L such that c a. A congruence on an algebra is just a compatible equivalence relation, that is, the kernel of some homomorphism. ConA, the set of all congruences of the algebra A, is naturally equipped with a lattice structure, with meet de ned as set theoretical intersection. As a matter of notation, the least and largest congruences of an algebra are denoted by 0 and 1. A variety V of algebras is congruence modular if for all A 2 V , the lattice ConA is modular.
2.1 The lambda calculus
The two primitive notions of the lambda calculus are application, the operation of applying a function to an argument (expressed as juxtaposition of terms), and lambda (functional) abstraction, the process of forming a function from the \rule" that de nes it. The set FI of -terms of lambda calculus over an in nite set I of variables is constructed as usual: every variable x 2 I is a -term; if t and s are -terms, then so are (st) and x:t for each variable x 2 I . An occurrence of a variable x in a -term is bound if it lies within the scope of a lambda abstraction x; otherwise it is free. A -term without free variables is said to be closed. t[x := s] is the result of substituting s for all free occurrences of x in t subject to the usual provisos about renaming bound variables in t to avoid capture of free variables in s. The axioms of the -calculus are as follows: t and s are arbitrary -terms and x; y variables. () x:t = y:t[x := y], for any variable y that does not occur free in t; ( ) (x:t)s = t[x := s]; t = t; t = s implies s = t; t = s, s = r imply t = r; t = s, u = r imply tu = sr; t = s implies x:t = x:s. ( )-conversion expresses the way of calculating a function (x:t) on an argument s, while ()-conversion says that bound variables can be replaced in a term under the obvious condition. A lambda theory T is any set of equations between -terms that is closed under () and ( ) conversion and the ve equality rules. We will write either T ` t = s or t =T s for t = s 2 T . denotes the least lambda theory. The
Nonmodularity results for lambda calculus
5
set of all lambda theories is naturally equipped with a lattice structure, with meet de ned as set theoretical intersection. The symbol denotes syntactic equality. A closure of a -term t is x1 : : : xn:t, where x1; : : :; xn is any sequence of variables including the free variables of t. Recall from Def. 8.3.1 in [1] that a closed -term t is solvable if there exist a natural number n and -terms u1; : : :; un such that ` tu1 : : :un = x:x. An arbitrary -term t is solvable if a closure x1 : : :xn:t of t is solvable (this is independent of the choice of x1; : : :; xn). A -term t is unsolvable if t is not solvable. By [1, Thm. 8.3.14] a -term t is solvable i ` t = u and u is a head normal form, where u is a head normal form if there exist natural numbers n and m, variables x1; : : : ; xn and terms u1; : : :; um such that u x1 : : : xn:xu1 : : :um . Variable x is the head variable of u. If a -term t is unsolvable, then by [1, Cor. 8.3.4] so is x1 : : :xn :tu1 : : : um for all variables x1; : : : ; xn and all -terms u1; : : :; um. The lambda theory H, generated by equating all the unsolvable -terms, is consistent by [1, Thm. 16.1.3] and admits a unique maximal consistent extension H [1, Thm. 16.2.6]. A lambda theory T is called sensible [1, Def. 4.1.7(ii)] if H T , while it is semi-sensible [1, Def. 4.1.7(iii)] if T 6` t = u whenever t is solvable and u is unsolvable. By [1, Lemma 17.1.1] T is semi-sensible i T H. A lambda theory T is extensional if T ` x:tx = t provided that x is not free in t. T is extensional i T ` i = 1, where i = x:x and 1 = xy:xy (see [1, Lemma 4.1.5]). H is an extensional lambda theory. H denotes the least extensional lambda theory including H.
2.2 Lambda abstraction algebras
Let I be an in nite set. The similarity type of lambda abstraction algebras of dimension I is constituted by a binary operation symbol \" formalizing application, a unary operation symbol \x" for every x 2 I formalizing functional abstraction, and a constant symbol (i.e., nullary operation symbol) \x" for every x 2 I . The elements of I are the variables of lambda calculus although in their algebraic transformation they no longer play the role of variables in the usual sense. In the remaining part of the paper we will refer to them as -variables. The actual variables of the lambda abstraction theory will be referred to as context variables and denoted by the Greek letters , , and , possibly with subscripts. The terms of the language of lambda abstraction theory are called -contexts. They are constructed in the usual way: every -variable x 2 I and context variable is a -context; if t and s are -contexts, then so are t s and x(t). Because of their similarity to the terms of the lambda calculus we use the standard notational conventions of the latter. The application operation symbol \" is normally omitted, and the application of t and s is written as juxtaposition ts. When parentheses are omitted, association to the left is assumed. The left parenthesis delimiting the scope of a lambda abstraction is replaced with a period and the right parenthesis is omitted. For example, x(ts) is written x:ts. Successive -abstractions xyz are written xyz . A word of caution for those readers familiar with the lambda calculus. When dealing with models of the lambda calculus one often allows terms that contain con-
6
stant symbols representing the elements of the models. These constants should not be confused with context variables; they play a much dierent role. Our notion of a -context coincides with the notion of context de ned in Barendregt [1, Def. 14.4.1]; our context variables correspond to Barendregt's notion of a `hole'. The main difference between Barendregt's notation and our's is that `holes' are denoted here by Greek letters ; ; : : :, while in Barendregt's book by [ ]; [ ]1; : : :. The essential feature of a -context is that a free -variable in a -term may become bound when we substitute it for a `hole' within the context. For example, if C () x:x(y:) is a -context, in Barendregt's notation: C ([ ]) x:x(y:[ ]), and t xy is a -term, then C (t) x:x(y:xy). Lambda abstraction algebras are meant to axiomatize those identities between -contexts that are valid for the lambda calculus. We now give the formal de nition of a lambda abstraction algebra.
De nition 1 By a lambda abstraction algebra of dimension I we mean an algebraic structure of the form
A := (A; A; xA; xA)x2I satisfying the following identities for all x; y; z 2 I and all ; ; 2 A (we simplify the notation by suppressing the A-superscript): ( 1 ) (x:x) = ; ( 2 ) (x:y) = y; x 6= y; ( 3 ) (x:)x = ; ( 4) (xx:) = x:; ( 5) (x:) = (x:) ((x:) ); ( 6 ) (xy:)((y:)z) = y:(x:)((y:)z ); x 6= y; z 6= y; () x:(y:)z = y:(x:(y:)z)y; z 6= y.
The class of lambda abstraction algebras of dimension I is denoted by LAAI and the class of all lambda abstraction algebras of any dimension by LAA. We also use LAAI as shorthand for the phrase \lambda abstraction algebra of dimension I ", and similar for LAA. LAAI is a variety (equational class) for every dimension set I , and therefore is closed under the formation of subalgebras, homomorphic (in particular isomorphic) images, and Cartesian products. A lambda theory T has a natural algebraic interpretation: it is a congruence on the absolutely free algebra FI in the similarity type of lambda abstraction algebras over the empty set of generators (we recall that FI := (FI ; F ; xF ; xF )x2I , where, for all -terms s; t 2 FI , s F t = (st); xF (t) = x:t and xF = x). We denote by FTI the quotient of FI by T and call it the term algebra of the lambda theory T . In [27, 30, 31] it is shown that every term algebra is a lambda abstraction algebra and that every variety of lambda abstraction algebras is generated by I
I
I
I
I
I
Nonmodularity results for lambda calculus
7
the term algebra of a suitable lambda theory. In particular, the term algebra of the least lambda theory generates the variety LAAI . Hence the explicit nite equational axiomatization for the variety of lambda abstraction algebras provides also an explicit axiomatization of the identities satis ed by the term algebra of the least lambda theory . The variety of LAAI 's generated by the term algebra FTI will be denoted by LAATI . Note that the lattice of all lambda theories is naturally isomorphic to the lattice of all congruences of the term algebra F I .
3 Results and Proofs
Theorem 1 The lattice of the lambda theories is not modular.
Proof: We consider the following three lambda theories: (i) The unique maximal consistent extension H of H. (ii) The lambda theory T generated by the identity = i, where (x:xx)(x:xx) is unsolvable and i x:x. (iii) The join H + Ts of the lambda theories H and Ts, where H is the lambda theory generated by equating all the unsolvable -terms and Ts = H \ T is the unique maximal semi-sensible lambda theory within T . We will show that the modular law is not satis ed by the lattice of the lambda theories since H \ (T + (H + Ts)) 6= (H \ T ) + (H + Ts): (Note that H + Ts H because H H by de nition and Ts = H \ T ). The proof is divided in Claims. Claim 1 If a lambda theory S is not semi-sensible then S + H is inconsistent (i.e., S + H = 1). By hypothesis there exist a solvable t and an unsolvable u such that S ` t = u. By [1, Cor. 8.3.4] a closure of an unsolvable -term is always unsolvable. Moreover, by de nition a -term is solvable if its closure is solvable. Then, without loss of generality, we may assume t and u closed. Since t is solvable, we have that ` ts1 : : :sk = x:x for some -terms s1; : : : ; sk . Choose arbitrary -terms q and r. By [1, Cor. 8.3.4] and by the hypothesis on u we have that us1 : : : sk q and us1 : : : sk r are both unsolvable. Then we obtain the inconsistency of S + H as follows.
q = = =S =H =S = =
(x:x)q ts1 : : :sk q us1 : : :sk q us1 : : :sk r ts1 : : :sk r (x:x)r r:
8
Claim 2 H \ (T + (H + Ts)) = H. The lambda theory T is not semi-sensible since it equates an unsolvable to a solvable i. Then T + H is inconsistent by Claim 1. Then the conclusion can be obtained as follows:
H \ (T + (H + Ts)) = H \ (T + H + Ts) = H \ (1 + Ts) = H \ 1 = H: Claim 3 (H \ T ) + (H + Ts) = H + Ts. We have H \ T = Ts by de nition. Then the conclusion is trivial. By Claim 2 and Claim 3 it remains to prove that H + Ts is strictly contained within H. Let x; z 2 I be distinct -variables of the lambda calculus. Claim 4 Ts 6` x = z:xz. By contraposition assume Ts ` x = z:xz. Since Ts T we also have T ` x = z:xz.
De ne the notion of reduction by extending the -reduction rule [1, Def. 3.1.3] by the further rule ! i. Then from [1, Thm. 15.3.5] it follows that the re exive transitive and compatible closure of satis es the Church-Rosser property. This implies that T ` t = u i t and u have a common reduct with respect to the reduction rule . Then the condition T ` x = z:xz implies that x and z:xz have a common -reduct. This is not possible because x and z:xz are distinct -normal forms. Contradiction. i
i
i
i
i
Claim 5 H 6` x = z:xz. It follows from [1, Thm. 16.1.9(ii)]: if H ` x = z:xz then ` x = z:xz. This is not possible because x and z:xz are distinct -normal forms.
Claim 6 H ` x = z:xz. By [1, Lem. 16.2.2] H is an extensional lambda theory. This means that H ` t = z:tz (for every -variable z 2 I not free in t). In particular, we have the conclusion. Claim 7 Ts + H 6` x = z:xz. Since Ts + H ` x = z:xz implies Ts + H ` x:x = xz:xz, it is sucient to prove Ts + H 6` x:x = xz:xz. We will write t u either for Ts ` t = u or for H ` t = u. Ts + H is a congruence on the absolutely free algebra FI . Then x:x and xz:xz are (Ts + H)-equivalent i there exists a sequence t1; : : : ; tk of -terms such that xz:xz t1 t2 : : : tk x:x: Since x:x and xz:xz are solvable and the lambda theories H and Ts are semisensible, then all the -terms t1; : : : ; tk are solvable. Without loss of generality, we may assume that t1; : : : ; tk are head normal forms.
Nonmodularity results for lambda calculus
9
We will prove by induction over k that there exists no sequence satisfying the above condition. For k = 0 the conclusion follows from Claim 4 and Claim 5. Now assume k > 0 and assume by induction hypothesis that there exists no proof of x:x = xz:xz into k ? 1 steps. We analyse two possibilities. (1) tk x:x is H ` tk = x:x. By [1, Thm. 16.1.9] we obtain that ` tk = x:x. Then we have
xz:xz t1 t2 : : : tk?1 tk = x:x so that
xz:xz t1 t2 : : : tk?1 x:x because all the lambda theories contain . We have obtained a shorter proof of x:x = xz:xz and this contradicts the induction hypothesis. (2) tk x:x is Ts ` tk = x:x. Since Ts T we have that T ` tk = x:x. It follows that tk and x:x have a common reduct with respect to the -reduction rules de ned above. However, x:x is a -normal form; then there exists a reduction from tk to x:x. Because -reductions do not change the structure of the head normal form and tk is a head normal form then we must have tk x:x. Then we have xz:xz t1 t2 : : : tk?1 x:x so that we have got a shorter proof of x:x = xz:xz and this contradicts the induction hypothesis. 2 In every lattice L the modularity law is equivalent to the requirement that L has no sublattice isomorphic to \pentagon" N5 (see [19, Thm. 2.25]). We have proven in the above theorem that the ve lambda theories Ts, T , H + Ts, H and 1 constitute a pentagon. The bottom and the top of the pentagon are respectively Ts and 1. Remark: The lattice of the extensional lambda theories is also not modular. The proof of this result is similar to that of Thm. 1. It is sucient to consider the following three extensional lambda theories: (i) H ; (ii) The extensional lambda theory U generated by the identities = i = 1, where 1 xy:xy; (ii) The join H + Us, where H is the least extensional lambda theory including H, and Us = H \ U is the unique maximal semi-sensible extensional lambda theory within U . Finally, the identity i = J , where J (zxy:x(zy)) is an in nite -expansion of i (see [1, Example 10.2.9]) and (xy:y(xxy))(xy:y(xxy)) is a xed point combinator (see [1, Def. 6.1.4]), substitutes the identity x = z:xz in Claims 4-7. We now analyse some consequences of Thm. 1. i
i
i
i
Corollary 1 The lattice of the subvarieties of LAAI is not modular. Proof: It is a consequence of Thm. 1 in this paper and of Thm. 17 in [30], where it is shown that the lattice of the subvarieties of LAAI is isomorphic to the lattice of the lambda theories. 2
Corollary 2 The variety LAAI is not congruence modular.
10
Proof: The term algebra F I of the least lambda theory is an LAAI (see [25]) and its lattice of congruences is isomorphic to the (non-modular) lattice of the lambda theories. 2 One of the most fruitful directions of research in universal algebra was initiated by Mal'cev in fties when he showed the connection between permutability of congruences for all algebras in a variety and the existence of a ternary term satisfying certain conditions. Conditions of this form are referred to as \Mal'cev conditions" (see [19, Section 4.12]). Roughly speaking, Mal'cev conditions \measure" the degree of non-sequentiality of the algebras in a variety. Since the lambda calculus is sequential (see [1, Section 14.4]), we conjecture that the variety LAAI does not satisfy any Mal'cev condition. Some results in this direction were obtained by Plotkin-Simpson (see [32, Lemma 3.14]) and Plotkin-Selinger (see [32, Lemma 3.15]). They have shown that the Mal'cev conditions for the permutability and 3-permutability of congruences are inconsistent with lambda calculus. These results are connected with the problem, stated by Plotkin [28], of nding an absolutely unorderable combinatory algebra. Congruence modularity for all algebras in a variety is equivalent to a Mal'cev condition (see [6, Thm. 6.4]). We conclude the paper by generalizing the result of Corollary 2 to a wide class of varieties. We recall that a variety of LAA's is always generated by the term algebra of a suitable lambda theory [30], and that the set of semi-sensible lambda theories constitutes a complete sublattice of the lattice of lambda theories [1]. The least semi-sensible lambda theory is , while the largest one is H.
Theorem 2 Let T be a semi-sensible lambda theory. Then the variety of LAA's generated by the term algebra of T is not congruence modular.
Proof: Assume, by the way of contradiction, that LAATI is congruence modular. Then by [6, Thm. 6.4] LAATI satis es the Mal'cev condition for congruence modularity, i.e., there exist ternary -contexts
Q0(1; 2; 3); : : :; Qn+1(1; 2; 3) for some n 0 such that the following are identities (between -contexts) of LAATI . (i) Q0(1; 2; 3) = 1; (ii) Qi(1; 2; 1) = 1 for i n; (iii) Qi(1; 2; 2) = Qi+1(1; 2; 2) for i < n even; (iv) Qi(1; 1; 2) = Qi+1(1; 1; 2) for i < n odd; (v) Qn(1; 2; 2) = Qn+1 (1; 2; 2); (vi) Qn+1(1; 1; 2) = 2.
Nonmodularity results for lambda calculus
11
Recall that, because of the lack of context variables in a -term, the interpretation of a -term u in an LAAI A is an element uA of A, while the interpretation of a -context t(1; 2; 3) in A is a map tA : A A A ! A. Then an identity A u1 = u2 between -terms holds in A if uA 1 and u2 denote the same element of A, while, for example, the identity Qn(1; 2; 2) = Qn+1 (1; 2; 2) holds in A if A QA n (a1; a2; a2) = Qn (a1; a2; a2) for all a1; a2 2 A. Let y1; y2; y3 2 I be three fresh -variables, i.e., they do not occur in Q0; : : : ; Qn+1 either as constants xi or as -abstractions xi. Every algebra A in LAATI satis es (i)-(vi) however we interpret the context variables 1; 2; 3 with elements of the algebra. In particular, we can interpret i as yiA for i = 1; 2; 3. It follows that variety LAATI satis es the following identities between -terms: (a) (b) (c) (d) (e) (f)
Q0(y1; y2; y3) = y1; Qi(y1; y2; y1) = y1 for i n; Qi(y1; y2; y2) = Qi+1(y1; y2; y2) for i < n even; Qi(y1; y1; y2) = Qi+1(y1; y1; y2) for i < n odd; Qn(y1; y2; y2) = Qn+1(y1; y2; y2); Qn+1(y1; y1; y2) = y2.
Note that variety LAATI is generated by the term algebra FTI of T , so that LAATI satis es identities (a)-(f) if, and only if, FTI does. This is equivalent to the requirement that T ` Q0(y1; y2; y3) = y1, : : :, T ` Qn+1(y1; y1; y2) = y2. Let Q0i (y1y2y3:Qi(y1; y2; y3)) for every 0 i n + 1. Since Q0iy1y2y3 = Qi(y1; y2; y3) for all i, then we have: (1) Q00y1y2y3 =T y1; (2) Q0iy1y2y1 =T y1 for i n; (3) Q0iy1y2y2 =T Q0i+1y1y2y2 for i < n even; (4) Q0iy1y1y2 =T Q0i+1y1y1y2 for i < n odd; (5) Q0ny1y2y2 =T Q0n+1y1y2y2; (6) Q0n+1y1y1y2 =T y2. Since T is semi-sensible by hypothesis, it does not equate a solvable and an unsolvable lambda term. The -terms y1; y2; y3 are solvable. Then from identities (2) and (6) it follows that the -terms Q0iy1y2y1 (i n) and Q0n+1y1y1y2 are solvable. By applying Thm. 8.3.14 and Prop. 8.3.13(iii) in [1], we get that Q0i is also solvable for every i n + 1. Without loss of generality, we may assume that Q00; : : :; Q0n+1 are in head normal form. For every -term t in head normal form, there exists a sequence z z1 : : : zk of -variables such that tz = xt1 : : : tr for a suitable -variable x and suitable
12
-terms t1; : : :; tr (note that tz means tz1 : : : zk , i.e., (: : : ((tz1)z2) : : : zk?1)zk ) ). Let t and u be head normal forms. Let z be a string of distinct -variables such that tz = xt1 : : : tr and uz = yu1 : : : us. We say that t and u are equivalent (see Def. 10.2.19 and Remark 10.2.20(ii) in [1]) if x and y are the same -variable and r = s. From [1, Lemma 10.4.1(i)] it follows that every lambda theory equating two non-equivalent head normal forms is inconsistent. Recall that the -term Q0i (y1y2y3:Qi(y1; y2; y3)) (i n + 1) is in head normal form. Let z z1 : : : zk 2 I n fy1; y2; y3g be a sequence of distinct -variables such that Q0iy1y2y3z = vit1 : : :tr (i n + 1) for a suitable -variable vi 2 I and suitable -terms t1; : : : ; tr . The remaining part of the proof is divided in Claims. i
i
Claim 8 The head variable v0 of Q00 is equal to y1. From identity (1) we get that
v0t1 : : :tr0 =T y1z: Since T is consistent, the head normal forms v0t1 : : :tr0 and y1z are equivalent, so that v0 y1.
Claim 9 For all 1 i n, the head variable vi of Q0i is equal either to y1 or to y3. Q0i does not admit free occurrences of the -variables y1; y2 and y3, so that Q0i[y3 := y1] Q0i. Moreover, recall that every -variable in the sequence z belongs to I n fy1; y2; y3g. Then we have by de nition of -conversion (y3:Q0iy1y2y3z)y1 = (Q0iy1y2y3z)[y3 := y1] Q0iy1y2y1z: By identity (2) we get y1z =T Q0iy1y2y1z (Q0iy1y2y3z)[y3 := y1] = (y3:Q0iy1y2y3z)y1 = (y3:vit1 : : : tr )y1 = ((y3:vi)y1)((y3:t1)y1) : : : ((y3:tr )y1) = x((y3:t1)y1) : : : ((y3:tr )y1) i
i
i
where the -variable x, obtained by reducing the -redex (y3:vi)y1, is de ned as follows if vi y1 or vi y3 x vy1 otherwise i
Since T does not equate two non-equivalent head normal forms, then the head variable x of x((y3:t1)y1) : : : ((y3:tr )y1) must be equal to the head variable y1 of y1z. This is possible only if either vi y1 or vi y3. i
Nonmodularity results for lambda calculus
13
Claim 10 For all 0 i n, the head variable vi of Q0i is equal to y1. By Claim 8 y1 is the head variable of Q00. Assume now by induction hypothesis that the head variable vi of Q0i is y1 (i < n). If i is even, by identity (3) and by the induction hypothesis we get
y1((y3:t1)y2) : : : ((y3:tr )y2) = = = =T = = = = i
(y3:y1t1 : : :tr )y2 (y3:Q0iy1y2y3z)y2 Q0iy1y2y2z Q0i+1y1y2y2z (y3:Q0i+1y1y2y3z)y2 (y3:vi+1t1 : : :tr +1 )y2 ((y3:vi+1)y2)((y3:t1)y2) : : : ((y3:tr +1 )y2) x((y3:t1)y2) : : : ((y3:tr +1 )y2) i
i
i
i
where the -variable x, obtained by reducing the -redex (y3:vi+1)y2, is de ned as follows y3 x yy2 ifif vvi+1 y 1
i+1
1
because by Claim 9 vi+1 is equal either to y1 or to y3. Since T does not equate two non-equivalent head normal forms, we obtain that x y1, that implies vi+1 y1. If i is odd, with a similar reasoning applied to identity (4) we also get that the head variable vi+1 of Q0i+1 is y1. This concludes the proof of Claim 10. The conclusion of the theorem can be obtained as follows. By identity (5) and by Claim 10 for i = n we get that the head variable of Q0n+1 is y1 that contradicts identity (6). It follows that identities (1)-(6) cannot be T -identities and then LAATI is not congruence modular. 2
Corollary 3 The Mal'cev condition for congruence modularity is inconsistent with the lambda theory H equating all the unsolvable -terms. Proof: Every sensible lambda theory is also semi-sensible. Since H is sensible, H
then from the above theorem it follows that LAAI is not congruence modular. We recall from [30] that every variety of LAA's is generated by the term algebra of a suitable lambda theory. So, a subvariety V of LAAHI is generated by the term algebra of a lambda theory T such that H T . Then T is sensible and then semi-sensible. So, V is not congruence modular. In conclusion, the identities of H and the Mal'cev condition for congruence modularity de ne the trivial variety. 2
Acknowledgements: The author is grateful to Chantal Berline for helpful sug-
gestions.
14
References [1] H.P. Barendregt, The lambda calculus: Its syntax and semantics. Studies in Logic and the Foundations of Mathematics vol. 103, North-Holland Publishing Co., Amsterdam (1984) [2] S. Burris and H.P. Sankappanavar, A course in universal algebra. SpringerVerlag, Berlin (1981) [3] A. Church, A set of postulates for the foundation of logic. Annals of Math. 2 (1933) 346{366 [4] A. Church, The calculi of lambda conversion. Princeton University Press, Princeton (1941) [5] H.B. Curry and R. Feys, Combinatory Logic, Vol. I. North-Holland Publishing Co., Amsterdam (1958) [6] R. Freese and R. McKenzie, Commutator theory for congruence modular varieties. Cambridge University Press, Cambridge (1987) [7] R. Goldblatt, The functional lambda abstraction algebras form a variety. In: D.S. Bridges, C.S. Calude, J. Gibbons, S. Reeves and I.H. Witten (Eds.), Proceedings of DMTCS'96, Springer Series in Discrete Mathematics and Theoretical Computer Science, Springer-Verlag, Singapore (1997) 226{243 [8] R. Goldblatt, Enlargements of functional algebras for the lambda calculus. Theoretical Computer Science 198 (1998) 177{200 [9] G. Gratzer, Universal Algebra. Springer-Verlag, New York (1979) [10] H.P. Gumm, Geometrical methods in congruence modular algebras. Memoirs of the American Mathematical Society, vol. 45, No. 286 (1983) [11] J. Hagemann and C. Herrmann, A concrete ideal multiplication for algebraic systems and its relation to congruence distributivity. Arch. Math. 32 (1979) 234{ 245 [12] P. Halmos, Algebraic Logic. Chelsea Publishing Co., New York (1962) [13] L. Henkin, J.D. Monk and A. Tarski, Cylindric algebras, Parts I and II. NorthHolland Publishing Co, Amsterdam (1971, 1985) [14] L. Henkin, J.D. Monk, A. Tarski, H. Andreka and I. Nemeti, Cylindric set algebras. Lecture Notes in Mathematics, No. 883, Springer-Verlag, Berlin (1981) [15] K. Kearnes and A. Szendrei, The relationship between two commutators. International Journal of Algebra and Computation 8 (1998) 497{531 [16] J.L. Krivine, Lambda-Calcul, types et modeles. Masson, Paris (1990)
Nonmodularity results for lambda calculus
15
[17] P. Lipparini, Commutator theory without join-distributivity, Transactions of the American Mathematical Society 346 (1994) 177{202 [18] P. Lipparini, A characterization of varieties with a dierence term, II: neutral = meet semidistributivity. Canad. Math. Bull. 41 (1998) 318{327 [19] R.N. McKenzie, G.F. McNulty and W.F. Taylor, Algebras, Lattices, Varieties, Volume I. Wadsworth Brooks, Monterey, California (1987) [20] I. Nemeti, Algebraizations of quanti er logics. An introductory overview. Studia Logica 50 (1991) 485{569 [21] D. Pigozzi and A. Salibra, An introduction to lambda abstraction algebras. IX Simposio Latinoamericano de Logica Matematica, Notas de Logica Matematica 38 (1993) 93{112 [22] D. Pigozzi and A. Salibra, Polyadic algebras over nonclassical logics. Algebraic Methods in Logic and Computer Science, Institute of Mathematics, Polish Academy of Sciences, Warszawa, Banach Center Publications 28 (1993) 51{66 [23] D. Pigozzi and A. Salibra, Dimension-complemented lambda abstraction algebras. In: M. Nivat, C. Rattray, T. Rus and G. Scollo (Eds.), Algebraic Methodology and Software Technology (AMAST'93) Workshops in Computing, SpringerVerlag, London (1994) 131{138 [24] D. Pigozzi and A. Salibra, A representation theorem for lambda abstraction algebras. In: A.M. Borzyszkowski and S. Sokolowski (Eds.), Proc. 18th International Symposium on Mathematical Foundations of Computer Science, Lecture Notes in Computer Science 711, Springer-Verlag, Berlin (1993) 629{639 [25] D. Pigozzi and A. Salibra, Lambda abstraction algebras: representation theorems. Theoretical Computer Science 140 (1995) 5{52 [26] D. Pigozzi and A. Salibra, The abstract variable-binding calculus. Studia Logica 55 (1995) 129{179 [27] D. Pigozzi and A. Salibra, Lambda abstraction algebras: coordinatizing models of lambda calculus. Fundamenta Informaticae 33 (1998) 149{200 [28] G. Plotkin, On a question of H. Friedman. Information and Computation 126 (1996) 74{77 [29] A. Salibra, A general theory of algebras with quanti ers. In: H.Andreka, J.D. Monk, I. Nemeti (Eds.), Algebraic Logic (Proc. Conf. Budapest 1988), NorthHolland Publishing Co., Amsterdam, Colloq. Math. Soc. J. Bolyai 54 (1991) 573{620 [30] A. Salibra, On the algebraic models of lambda calculus. Theoretical Computer Science 249 (2000) 197{240
16
[31] A. Salibra and R. Goldblatt, A nite equational axiomatization of the functional algebras for the lambda calculus. Information and Computation 148 (1999) 71{ 130 [32] P. Selinger, Functionality, polymorphism, and concurrency: a mathematical investigation of programming paradigms. PhD thesis, University of Pennsylvania (1997) [33] J. D. H. Smith, Mal'cev varieties. Lecture Notes in Mathematics 554, SpringerVerlag, Berlin (1976)