Applying universal algebra to lambda calculus

download Applying universal algebra to lambda calculus

of 37

Transcript of Applying universal algebra to lambda calculus

  • 8/7/2019 Applying universal algebra to lambda calculus

    1/37

    Applying Universal Algebra to Lambda Calculus

    Giulio Manzonetto1 and Antonino Salibra1,2

    {gmanzone, salibra}@dsi.unive.it

    1 Laboratoire PPS, CNRS-Universite Paris 7,

    2, place Jussieu (case 7014), 75251 Paris Cedex 05, France2 Universita CaFoscari di Venezia,

    Dipartimento di Informatica Via Torino 155, 30172 Venezia, Italy

    Abstract. The aim of this paper is double. From one side we survey the knowledge we have

    acquired these last ten years about the lattice of all -theories (= equational extensions of

    untyped -calculus) and the models of lambda calculus via universal algebra. This includes

    positive or negative answers to several questions raised in these years as well as several

    independent results, the state of the art about the long-standing open questions concerningthe representability of-theories as theories of models, and 26 open problems. On the otherside, against the common belief, we show that lambda calculus and combinatory logic sat-

    isfy interesting algebraic properties. In fact the Stone representation theorem for Boolean

    algebras can be generalized to combinatory algebras and -abstraction algebras. In every

    combinatory and -abstraction algebra there is a Boolean algebra of central elements (play-

    ing the role of idempotent elements in rings). Central elements are used to represent any

    combinatory and -abstraction algebra as a weak Boolean product of directly indecompos-

    able algebras (i.e., algebras which cannot be decomposed as the Cartesian product of two

    other non-trivial algebras). Central elements are also used to provide applications of the

    representation theorem to lambda calculus. We show that the indecomposable semantics

    (i.e., the semantics of lambda calculus given in terms of models of lambda calculus, which

    are directly indecomposable as combinatory algebras) includes the continuous, stable and

    strongly stable semantics, and the term models of all semisensible -theories. In one of

    the main results of the paper we show that the indecomposable semantics is equationallyincomplete, and this incompleteness is as wide as possible.

    1 Introduction

    Among the computational formalisms which have been introduced, the lambda calculus plays

    an important role as a bridge between logic and computer science. The lambda calculus was

    originally introduced by Church [20, 21] as a foundation for logic, where functions, instead of

    sets, were primitive, and it turned out to be consistent and successful as a tool for formalizing

    all computable functions. The rise of computers and the development of programming languages

    gave a new development to its theoretical studies. The lambda calculus is the kernel of the func-

    tional programming paradigm, because its ordinary parameter-binding mechanism corresponds

    closely to parameter binding in many functional programming languages and to variable binding

    of quantifiers in logic.

    This article is a revised and expanded version of results of the authors presented at the International

    Conference on Order, Algebra and Logics (Nashville, June 12-16, 2007), and at the 19th Annual IEEE

    Symposium on Logic in Computer Science (LICS06) (Seattle, August 12-15, 2006) [52]. Work partially supported by the Equipe PPS of the University Paris 7-Denis Diderot, and by LIX Labo-

    ratoire dInformatique de lEcole Polytechnique (Palaiseau, France).

  • 8/7/2019 Applying universal algebra to lambda calculus

    2/37

    Lambda calculus has been originally investigated by using mainly syntactical methods (see

    Barendregts book [4]). At the beginning researchers have focused their interest on a limited

    number of equational extensions of lambda calculus, called -theories. They arise by syntacticalor semantic considerations. Indeed, a -theory may correspond to a possible operational seman-tics of lambda calculus, as well as it may be induced by a model of lambda calculus through

    the kernel congruence relation of the interpretation function. Syntactical proofs of consistency

    of remarkable -theories (for example, the theory equating all unsolvable -terms) were given inBarendregts 1971 thesis [3], while one of the most significant -theories is connected with thestudy of the infinite normal forms of -terms through Bohm trees [15, 4]. The set of-theoriesis naturally equipped with a structure of complete lattice (see [4, Chapter 4]). The bottom ele-

    ment of this lattice is the least -theory , while the top element is the inconsistent -theory.Although researchers have mainly focused their interest on a limited number of them, the lattice

    of-theories, hereafter denoted by T, has a very rich and complex structure (see e.g. [4, 8, 9]).

    The lambda calculus, although its axioms are all in the form of equations, is not a genuine

    equational theory since the variable-binding properties of lambda abstraction prevent variables

    in lambda calculus from operating as real algebraic variables. Consequently the general methodsthat have been developed in universal algebra, for defining the semantics of an arbitrary algebraic

    theory for instance, are not directly applicable. There have been several attempts to reformulate

    the lambda calculus as a purely algebraic theory. The earliest, and best known, algebraic models

    are the combinatory algebras of Curry and Schonfinkel (see [28, 72]). Although combinatory

    algebras do not keep the lambda notation, they have a simple purely equational characterization

    and were used to provide an intrinsic first-order, but not equational, characterization of the models

    of lambda calculus, as a special class of combinatory algebras called -models [4, Def. 5.2.7].The connection between the syntax and the semantics of lambda calculus is established by the

    completeness theorem of lambda calculus: every -theory is the equational theory of some -model (see [4]).

    Semantical methods have been extensively investigated. Topology is at the center of the

    known approaches to giving models of the untyped lambda calculus. After the first model, found

    by Scott [67] in 1969 in the category of complete lattices and Scott continuous functions, a large

    number of mathematical models for lambda calculus have been introduced in various categories

    of domains and were classified into semantics according to the nature of their representable func-

    tions, see e.g. [4, 8, 61]. Scott continuous semantics [70] is given in the category whose objects

    are complete partial orders and morphisms are Scott continuous functions. Scott continuous se-

    mantics includes the class of graph models, which were isolated in the seventies by Plotkin,

    Scott and Engeler [33, 61, 69], and the class of filter models, which were isolated at the begin-

    ning of eighties by Barendregt, Coppo and Dezani [5] after the introduction of intersection-type

    discipline at the end of seventies by Coppo and Dezani [26]. Filter models were investigated

    by Coppo, Dezani, Barendregt et al. in a series of papers and are perhaps the most established

    and studied semantics of lambda calculus (see e. g. [27, 5, 47]). Other semantics of lambda cal-

    culus were isolated by Berry [12] and Bucciarelli-Ehrhard [16]: Berrys stable semantics and

    Bucciarelli-Ehrhards strongly stable semantics are refinements of the continuous semantics in-troduced to capture the notion of sequential Scott continuous function. All these semantics

    are structurally and equationally rich [10, 44, 46] in the sense that it is possible to build up 20

    -models in each of them inducing, pairwise distinct -theories. Nevertheless, the above deno-tational semantics do not match all possible operational semantics of lambda calculus. We recall

    that a semantics of lambda calculus is equationally incomplete if there exists a -theory which isnot the theory of any model in the semantics. In the nineties the problem of the equational incom-

  • 8/7/2019 Applying universal algebra to lambda calculus

    3/37

    pleteness was positively solved by Honsell and Ronchi della Rocca [39] for Scotts continuous

    semantics, and by Bastonero and Gouy for Berrys stable semantics [6]. The proofs of the above

    results are syntactical and very difficult. In [65, 66] it was shown the equational incompleteness

    of all semantics of lambda calculus that involve monotonicity with respect to some partial order

    and have a bottom element (including the incompleteness of the strongly stable semantics, which

    had been conjectured by Bastonero-Gouy and by Berline [6, 8]). The proof is simple, general and

    abstract. First a theorem relating the properties of a graph to the properties of a suitable binary

    operation on the vertices of the graph is proven. Then the incompleteness is obtained by apply-

    ing this theorem to the graphs, whose vertices are the elements of a partially ordered model of

    lambda calculus, and whose edges correspond to the symmetric and antireflexive relation which

    is the union of the strict order and of the strict dual order of the model. This incompleteness

    removes the belief that partial orderings with a bottom element are intrinsic to models of the

    lambda calculus, and that the incompleteness of a semantics is only due to the richness of the

    structure of representable functions. Instead, the incompleteness is also due to the richness of the

    structure of-theories.

    The need of more abstract and sophisticated mathematical techniques in lambda calculusarises when we recognize the difficulty of the problems we handle, for example in order to

    investigate the structure of the lattice of -theories (see [4, Chapter 4] and [8, 9]) in itself and inconnections with the theory of models. Salibra [51, 66, 63] has launched at the end of the nineties

    a research program for exploring lambda calculus and combinatory logic using techniques of

    universal algebra. The remark that the lattice of-theories is isomorphic to the congruence latticeof the term algebra of the least -theory is the starting point for studying lambda calculus byuniversal algebraic methods, through the variety generated by the term algebra of . In [63]Salibra has shown that the variety generated by the term algebra of is axiomatized by thefinite schema of identities characterizing -abstraction algebras. The equational theory of -abstraction algebras, introduced by Pigozzi and Salibra [59, 60], constitutes a purely algebraic

    theory of the untyped lambda calculus in the same spirit that cylindric and polyadic (Boolean)

    algebras constitute an algebraic theory of the first-order predicate logic. The variety LAA of-

    abstraction algebras is intended as an alternative to the variety CA of combinatory algebras in thisregard since it is a first-order algebraic description of lambda calculus, which keeps the lambda

    notation and hence all the functional intuitions. In [63] Salibra has shown that, for every variety

    of -abstraction algebras, there exists exactly one -theory whose term algebra generates thevariety. Thus, the properties of a -theory can be studied by means of the variety of-abstractionalgebras generated by its term algebra.

    Long-standing open problems of lambda calculus can be restated in terms of algebraic proper-

    ties of varieties of-abstraction algebras. For example, the open problem of the order-incompletenessof lambda calculus, raised by Selinger (see [71]), asks for the existence of a -theory not arisingas the equational theory of a non-trivially partially ordered model of lambda calculus. A partial

    answer to the order-incompleteness problem was obtained by Salibra in [66], where it is shown

    the existence of a -theory not arising as the equational theory of a non-trivially partially orderedmodel with a finite number of connected components. The order-incompleteness of lambda cal-

    culus is equivalent to the existence of an n-permutable variety of-abstraction algebras for somenatural number n 2 (see the remark after Thm. 3.4 in [71]). Plotkin, Selinger and Simpson (see[71]) have shown that 2-permutability and 3-permutability are inconsistent with lambda calculus.The problem ofn-permutability remains open for n 4.

    We wonder if it is possible to apply to the varieties LAA and CA the nice results developed

    in universal algebra in the last thirty years, which essentially connect (a) identities or quasi-

  • 8/7/2019 Applying universal algebra to lambda calculus

    4/37

    identities in the language of lattices satisfied by congruence lattices; (b) properties of the com-

    mutator; and (c) Malcev conditions, that characterize properties in varieties by the existence of

    certain terms involved in certain identities. We recall that the structure of an algebra is affected

    by the shape of its congruence lattice and that the commutator, a binary operation on this lat-

    tice, provides a measure of this shape. The commutator was first introduce in group theory,

    where the concept of Abelian group, and other important concepts, can be defined in terms of

    the commutator operation on normal subgroups. The extension of the commutator to algebras

    other than groups is due to the pioneering papers of Smith [73] and Hagemann-Hermann [37].

    The commutator is very well behaved in congruence modular varieties (see Freese-McKenzie

    [34] and Gumm [35]). However, in [64] it was shown that LAA is not congruence modular. As

    a consequence, it is not possible to apply to LAA the nice theory of commutator developed for

    congruence modular varieties. Lipparini [49, 50] and Kearnes-Szendrei [41] have recently shown

    that under very weak hypotheses the commutator proves also useful in studying algebras without

    congruence modularity. However, in [51] Lusin and Salibra have shown that a lattice identity is

    satisfied by all congruence lattices of-abstraction algebras (combinatory algebras, respectively)

    iff it is true in all lattices. Thus, there is a common belief that lambda calculus and combinatorylogic are algebraically pathological.

    On the contrary, we will show that -calculus and combinatory logic do satisfy interestingalgebraic properties. One of the milestones of modern algebra is the Stone representation theo-

    rem for Boolean algebras. This result was first generalized by Pierce to commutative rings with

    unit and next by Comer to the class of algebras with Boolean factor congruences. By applying

    a theorem by Vaggione [76], we show that Comers generalization of Stone representation theo-

    rem also holds for combinatory and -abstraction algebras: any combinatory (or -abstraction)algebra is isomorphic to a weak Boolean product of directly indecomposable algebras (i.e.,

    algebras which cannot be decomposed as the Cartesian product of two other non-trivial alge-

    bras). The proof of the representation theorem is based on the fact that every combinatory (or

    -abstraction) algebra contains a Boolean algebra of central elements (introduced by Vaggione[75] in universal algebra). These elements define a direct decomposition of the algebra as the

    Cartesian product of two other algebras, just like idempotent elements in rings.

    This result suggests a connection between propositional classic logic and combinatory logic;

    what is the real meaning of this connection remains to be investigated. What we would like to

    emphasize here is that central elements have been shown fundamental in the application of the

    representation theorem to -calculus, as it will be explained in the next paragraph.

    The representation theorem can be roughly summarized as follows: the directly indecompos-

    able combinatory algebras and -abstraction algebras are the building blocks in the respectivevarieties. The notion of directly indecomposable combinatory algebra appears to be so relevant

    that we find it even interesting to speak of the indecomposable semantics to denote the class of

    models of lambda calculus which are directly indecomposable as combinatory algebras. This se-

    mantics is very general since, as we will show, it encompasses the continuous, stable and strongly

    stable semantics, and represents all semisensible -theories (theories which do not equate solv-able and unsolvable terms). In one of the main results of the paper we show that the indecompos-

    able semantics, although so general, is (largely) incomplete. More precisely, we will prove that it

    omits a set of-theories which contains an antichain of cardinality 20 and also countably manyintervals of cardinality 20 .

    In one of the last results of the paper we show that the set of -theories representable in eachof the classic semantics of-calculus is not closed under finite intersection, in particular it is not

  • 8/7/2019 Applying universal algebra to lambda calculus

    5/37

    a sublattice of the lattice of all -theories.

    Outline. This paper is organized as follows: In Section 2 we review the basic definitions ofuniversal algebra which are involved in the rest of the paper. Section 3 is devoted to present the

    -calculus from an algebraic point of view and to recall some results concerning its models. InSection 4 we recall the properties of the lattice of -theories and we provide some new results.The Stone representation theorem for combinatory and -abstraction algebras is presented inSection 5. Section 6 is devoted to the equational incompleteness of the indecomposable seman-

    tics. In Section 7 we present 26 open problems concerning models and theories of -calculus.

    2 Preliminaries

    2.1 Posets

    A poset S is a pair (S, ), where S is a set and is a reflexive, transitive and antisymmetricrelation.

    Two elements s, s of a poset are incomparable if neither s s nor s s.

    Given a poset S and S S we recall that: S is a chain of S if it is totally ordered by ,and S is an antichain in case its elements are pairwise incomparable.

    The interval notation will have the obvious meaning, e.g., I[s, s] = {s S : s s s}and I[s, s[= I[s, s] {s}.

    A subset X of a poset S is directed if, for all s, s X, there exists u X such that s uand s u.

    A poset S is a complete partial order(cpo, for short) if it has a least element , and everydirected set X S admits a least upper bound

    X.

    An element s of a cpo S is compact if, for every directed subset X ofS, s

    X impliess u for some u X.

    2.2 Lattices

    A lattice is a poset S = (S, ) such that any two elements s, s S have a least upper bounds s and a greatest lower bound s s which are respectively called, in this context, join andmeet. Then, is definable from the meet or the join. A lattice is boundedif it has a top and abottom element. A lattice is complete if any A S has a least upper bound (then all As havealso a greatest lower bound); in particular every complete lattice is bounded.

    We say that an element s of a bounded lattice Sis an atom (coatom) if it is a minimal elementdifferent from (maximal element different from ). A lattice S is atomic (resp. coatomic) if,for every element s ofS, there exists an atom a s (resp. a s).

    Two elements s, s of a lattice are incompatible ifs s = ; two intervals I[s, s], I[s, s]are incompatible ifs1, s2 are incompatible, for all s1 I[s, s] and s2 I[s, s].

    A lattice S satisfies the modular law if the following condition holds, for all a,b,c S:

    a (b (a c)) = (a b) (a c).

  • 8/7/2019 Applying universal algebra to lambda calculus

    6/37

    2.3 Algebras

    An algebraic similarity type is constituted by a non-empty set of operator symbols together

    with a function assigning to each operator f a finite arity. Operator symbols of arity 0 arecalled nullary operators or constants.

    Definition 1. A -algebraA is a tuple (A, fA)f , where A is a non-empty set andfA : An

    A is an n-ary function for every f of arity n.

    A is trivial if its underlying set is a singleton.

    Definition 2. Given two -algebras A andB, a homomorphism from A into B is a map g :A B such thatg(fA(a1, . . . , an)) = f

    B(g(a1), . . . , g(an)) for each n-ary operation f and for all ai A.

    Two -algebras A and B are isomorphic, and we write A = B, if there exists a bijectivehomomorphism from A into B.

    We say that an algebra A is a reduct of an algebra B (and that B is an expansion ofA) ifA

    and B have the same underlying set and fA = fB for every operator symbol f in the algebraicsimilarity type ofA. Sometimes we will indicate an expansion ofA as (A, f1, f2, . . .).

    2.4 Congruences

    Given a -algebraA, a binary relation on A is compatible if for all f of arity n, and forall ai, bi A we have

    (a1, b1) , . . . , (an, bn) (fA(a1, . . . , an), f

    A(b1, . . . , bn)) .

    A compatible equivalence relation on a -algebra A is called a congruence. As a matter of

    notation, we will often write ab or a = b for (a, b) .Given two congruences and on an algebra A, we can form their relative product:

    = {(a, c) : (b A) a b c}.

    It is easy to check that is still a compatible relation on A, but not necessarily a congruence.As a matter of notation, we define 1 = and n+1 = ( n ) for n > 0.We denote by Con(A) the complete lattice of the congruences ofA, which is a sublattice of

    the equivalence relations on A. The meet of two congruences and is their intersection,while their join is the least equivalence relation including :

    =n>0

    n .

    The lattice Con(A) contains a top and a bottom element:

    A = A A; A = {(a, a) : a A}.

    When A is clear from the context we will omit the superscript A and write , .

    Lemma 1. LetA be a -algebra.

  • 8/7/2019 Applying universal algebra to lambda calculus

    7/37

    (i) A congruence Con(A) is compact if there exists a finite subsetX of A A such that = (X).

    (ii)If

    A is a compact element, thenCon(

    A

    )is a coatomic lattice.

    A congruence on A is called trivial if it is equal to or .

    Notation 1. IfX A A and is a congruence, then we write (X) for the least congruenceon A including X. If = , then we write (X) for(X). (a, b) denotes the congruence({(a, b)}).

    An algebra A is simple ifCon(A) = {, }.

    2.5 Direct and subdirect products

    Given two algebras A and B, we denote by A B their (direct) product.

    Definition 3. An algebra A is directly decomposable if there exist two non-trivial algebrasB

    andC such thatA = BC; otherwise we say thatA is directly indecomposable.

    Definition 4. An algebraA is a subdirect product of the algebras (Bi)iI, writtenA iIBi,if there exists an embedding f ofA into the direct productiIBi such that the projectioni f : A Bi is onto for every i I.

    2.6 Varieties

    Definition 5. A non-empty classK of algebras of the same similarity type is:

    (i) A variety if it is closed under subalgebras, homomorphic images and direct products;

    (ii) An equational class if it is axiomatizable by a set of equations.

    Birkhoff proved in [14] (see also [54, Thm. 4.131]) that conditions (i) and (ii) are equivalent.

    A variety K of algebras is generated by an algebra A K if every equation satisfied by Ais also satisfied by every algebra in K. We will denote by V(A) the variety generated by A.

    Definition 6. A varietyK is a subvariety of a varietyK ifK K.

    Definition 7. An algebra is

    (i) congruence distributive if its congruence lattice Con(A) is a distributive lattice.

    (ii) congruence n-permutable (n 2) if = n for all congruences , Con(A).

    Definition 8. A variety is

    (i) congruence distributive if every algebra in the variety is congruence distributive.

    (ii) congruence n-permutable (n 2) if every algebra in the variety is congruencen-permutable.

  • 8/7/2019 Applying universal algebra to lambda calculus

    8/37

    2.7 Free algebras

    Let K be a class of-algebras and A be a -algebra.

    Definition 9. IfX is a subset ofA, then we say thatA has the universal mapping property forKover X if, for everyB K and for every mapping g : X B, there is a unique homomorphismf : A B that extends g (i.e., f(x) = g(x) for every x X).

    Definition 10. A is free in K over X ifA K, A is generated by X andA has the universalmapping property forK overX.

    IfA is free inK over X, then X is called a set of generators forA, and A is said to be freelygenerated by X.

    A free algebra in the class of all -algebras is called absolutely free. In the following we givea concrete characterization of the absolutely free algebra.

    Let X be a set. The set T(X) of-terms over X is defined by induction as follows:

    x T(X) for every x X; a T(X) for every nullary operator a ; ift1, . . . , tn T(X) (n > 1) then f(t1, . . . , tn) T(X) for all f of arity n.

    A -term is ground if it does not contain variables. Ift is a -term, we write t t(x1, . . . , xn)if the variables occurring in t are among x1, . . . , xn. IfA is a -algebra then every -termt(x1, . . . , xn) induces a term operation t

    A : An A defined in the obvious way.The absolutely free -algebra overX is the -algebra

    T(X) = (T(X), fT(X))f,

    where

    fT(X)(t1, . . . , tn) = f(t1, . . . , tn), for all f .

    We will write T for the absolutely free algebra T() over an empty set of generators.

    Definition 11. A -identity (or-equation) is a pair(t, u) of-terms, written also t = u. Anidentity t(x1, . . . , xn) = u(x1, . . . , xn) holds in a -algebraA if the n-ary term operations t

    A

    anduA are equal.

    2.8 Factor congruences

    Definition 12. A congruence on an algebra A is a factor congruence if there exists anothercongruence such that = and = . In this case we call (, ) a pair ofcomplementary factor congruences.

    Under the hypotheses of Definition 12 the homomorphism f : A A/ A/ defined byf(x) = (x/, x/) is an isomorphism. Hence, we have:

    Lemma 2. (, ) is a pair of complementary factor congruences ofA if, and only if, A =A/ A/.

    So, the existence of factor congruences is just another way of saying this algebra is a direct

    product of simpler algebras.

    The set of factor congruences ofA is not, in general, a sublattice of Con(A). and arethe trivial factor congruences, corresponding to A = A B, where B is a trivial algebra; ofcourse,B is isomorphic to A/ and A is isomorphic to A/.

  • 8/7/2019 Applying universal algebra to lambda calculus

    9/37

    Lemma 3. An algebra A is directly indecomposable if it admits only the two trivial factor con-

    gruences ( and).

    Clearly, every simple algebra is directly indecomposable, while there are algebras which are

    directly indecomposable but not simple: they have congruences, which however do not split the

    algebra up neatly as a Cartesian product.

    2.9 Decomposition operators

    Factor congruences can be characterized in terms of certain algebra homomorphisms called de-

    composition operators (see [54, Def. 4.32] for more details).

    Definition 13. A decomposition operation for an algebra A is a function f : A A A suchthat

    f(x, x) = x; f(f(x, y), z) = f(x, z) = f(x, f(y, z)); f is an algebra homomorphism from AA into A.

    There exists a bijective correspondence between pairs of complementary factor congruences

    and decomposition operations, and thus, between decomposition operations and factorizations

    like A = B C.

    Proposition 1. [54, Thm. 4.33] Given a decomposition operatorf the binary relations anddefined by:

    x y if, and only if, f(x, y) = y,x y if, and only if, f(x, y) = x,

    form a pair of complementary factor congruences. Conversely, given a pair(, ) of comple-

    mentary factor congruences, the map f defined by:

    f(x, y) = u if, and only if, x u y, (1)

    is a decomposition operation.

    Notice that if(, ) is a pair of complementary factor congruences, then for all x and y thereis just one element u such that x u y.

    2.10 Boolean factor congruences and Boolean products

    The product congruence of 1 Con(A) and 2 Con(B) is the congruence 1 2 onA B defined by: (b, c) 1 2 (b, c) if, and only if, b 1 b and c 2 c. We denote by

    Con(A) Con(B) the sublattice ofCon(A B) constituted by all product congruences.

    Definition 14. A variety C of algebras has factorable congruences if for every A,B C wehave Con(AB) = Con(A) Con(B).

    Definition 15. An algebra has Boolean factor congruences if its factor congruences form a

    Boolean sublattice of the congruence lattice.

  • 8/7/2019 Applying universal algebra to lambda calculus

    10/37

    Most known examples of varieties in which all algebras have Boolean factor congruences are

    those with factorable congruences. This is the case, for example, of the congruence distributive

    varieties, and congruence permutable varieties in which the universal congruences are compact

    (e.g., the variety of rings with unit).

    Lemma 4. (Bigelow-Burris [13, Cor. 1.4]) If a varietyC has factorable congruences, then every

    A C has Boolean factor congruences.

    The Boolean product construction allows us to transfer numerous fascinating properties of

    Boolean algebras into other varieties of algebras (see [22, Ch. IV]). Actually, this construction

    has been presented for several years as the algebra of global sections of sheaves of algebras

    over Boolean spaces (see [25, 40]); however, these notions were unnecessarily complex and we

    prefer to adopt here the following equivalent presentation (see [23]). We recall that a Boolean

    space is a compact, Hausdorff and totally disconnected topological space.

    Definition 16. A weak Boolean product of a family (A)iI of algebras is a subdirect product

    A iIAi, where I can be endowed with a Boolean space topology such that:

    (i) the set{i I : ai = bi} is open for all a, b A, and(ii) ifa, b A andN is a clopen subset ofI, then the elementc, defined by ci = ai for every

    i N andci = bi for every i I N, belongs to A.

    A Boolean product is a weak Boolean product such that the set{i I : ai = bi} is clopen (i.e.,open and closed) for all a, b A.

    3 The -calculus in algebraic setting

    The two primitive notions of the untyped -calculus are application, the operation of applyinga function to an argument, and lambda abstraction, the process of forming a function from the

    expression defining it.From now on we consider two fixed countable non-empty sets; namely, the set Na ofnames,

    and the set Va of algebraic variables. The elements of Na will be denoted by a, b, c, . . . , whilethe elements of Va by x , y , z , . . .

    Definition 17. The algebraic similarity type of lambda calculus is constituted by a binaryoperator symbol ; a nullary operator symbol a and a unary operator symbol a, forevery a Na.

    The binary operator is called application and the unary operator a lambda abstraction.

    Definition 18. A -term is a ground-term.

    We recall that the set of all -terms is denoted by T(Va), while the set of -terms by T.

    -terms will be usually denoted by t , u , v , . . . , while -terms by M , N , P , . . .The following are well known -terms, where the symbol denotes syntactical equality:

    I a(a); 1 a(b(a b)); T a(b(a)); F a(b(b));S a(b(c((a c) (b c)))); a(a a); .

    a(a x) is an example of a -term that is not a -term.

  • 8/7/2019 Applying universal algebra to lambda calculus

    11/37

    Notation 2. From now on, we will write abc.M for a(b(c(M))). The dot of the ap-plication operator is usually omitted and association is made on the left, so that, for example,

    (((a b) c) d) e is written abcde. Then the above -terms can be rewritten as follows:

    I a.a; 1 ab.ab; T ab.a; F ab.b;S abc.ac(bc); a.aa; .

    Remark 1. -terms and algebraic variables are called respectively contexts and holes in Baren-dregts book [4, Def. 14.4.1].

    An occurrence of a name a in a -term is bound if it lies within the scope of a lambdaabstraction a; otherwise it is called free. For example, the occurrence of a in a.ac is bound,whilst the one ofc is free. The set of free names of M is denoted by FN(M). A -term withoutfree names is said to be closed. The set of all closed -terms is denoted by To.

    Two kinds of substitution In the following we analyze the two kinds of substitutions that are

    studied in this paper: the substitution for the free occurrences of a name and the substitution for

    the occurrences of an algebraic variable.

    The essential feature of a -term is that a free name in a -term may become bound whenwe substitute it for a variable within a -term. This kind of substitution is the usual one ofthe equational calculus and it does not matter of free and bound occurrences of names. More

    precisely, given a -term u, t{x := u} is defined by induction over the complexity of the -termt as follows:

    x{x := u} = u (x Va) a{x := u} = a (a Na) (t t){x := u} = (t{x := u}) (t{x := u}) (a.t){x := u} = a.t{x := u}.

    For example,

    (a.xa){x := b.a} = a.(b.a)a.

    The other substitution is proper of -calculus and concerns -terms. Given a -term M, wedenote by M[a := N] the result of substituting the -term N for all free occurrences of a in Msubject to the usual proviso about renaming bound names in M to avoid capture of free names inN. More precisely M[a := N] is defined by induction over the complexity of M as follows:

    a[a := N] = N b[a := N] = b (b = a) (P Q)[a := N] = (P[a := N]) (Q[a := N]) (a.P)[a := N] = a.P b / FN(N) (b.P)[a := N] = b.P[a := N] (a = b) b FN(N) (b.P)[a := N] = c.P[b := c][a := N] (a = b), where c is a new name

    not occurring neither free nor bound in P.

    For example,

    (a.ba)[b := aa] = c.(aa)c,

    where the new name c avoids capture of free names.Note that the equations between -terms, unlike the associative and commutative laws for

    example, are not always preserved when arbitrary -terms are substituted for free names (e.g.,a.ba = c.bc does not imply a.ca = c.cc). On the contrary, the equations between -termsare always preserved when arbitrary -terms are substituted for algebraic variables.

  • 8/7/2019 Applying universal algebra to lambda calculus

    12/37

    3.1 -abstraction algebras

    The -theories are the main object of study of the untyped -calculus, when, roughly speaking,

    we consider conversion more important than reduction.We start by defining the -theories as congruences including ()-conversion (which ex-

    presses the way of calculating a function a.M on an argument N) and ()-conversion (whichavoids capture of free names).

    Let us consider now the absolutely free -algebra T over an empty set of generators (seeSection 2.7).

    Definition 19. A -theory is any congruence on T including ()- and ()-conversion (hereM, N are arbitrary -terms anda, b are names):

    () a.M = b.M[a := b], for any name b that does not occur free in M,() (a.M)N = M[a := N].

    The least-theory is denoted by , while the quotient of the absolutely free algebraT by a-theory is calledthe term algebra of and will be denoted by T/.

    The identities between -terms expressing ()- and ()-conversion do not provide a goodalgebraization of the untyped -calculus, because algebraic variables do not occur in -terms. Inthe remaining part of this section we show how it is possible to algebraize the lambda calculus.

    The variety V(T/) generated by the term algebra of is the starting point for studyingthe lambda calculus by universal algebraic methods.

    We recall that, by definition, V(T/) satisfies an identity between -terms

    t(x1, . . . , xn) = u(x1, . . . , xn)

    if, and only if, the term algebra T/ satisfies it. This means that all instances of the aboveidentity, obtained by substituting (without -conversion) -terms for variables in it, fall within

    :t(M1, . . . , M n) = u(M1, . . . , M n), for all -terms M1, . . . , M n.

    In Theorem 1, which was one of the main results of [63], it is shown that V(T/) is axiomati-zable by suitable equations between -terms characterizing the class oflambda abstraction alge-bras. Among the seven axioms below, the first six constitute a recursive definition of the abstract

    substitution operator; they express precisely the meta-mathematical content of ()-conversion.The last one is an algebraic translation of()-conversion.

    Definition 20. (Pigozzi and Salibra [58]) A -algebra

    A = (A, A, aA, aA)aNa

    is a -abstraction algebra if it satisfies the following identities, where a,b,c (a = b, b = c) are

    names andx, y, z are variables:

    (1) (a.a)x = x;(2) (a.b)x = b;(3) (a.x)a = x;(4) (aa.x)y = a.x;(5) (a.xy)z = (a.x)z((a.y)z);

  • 8/7/2019 Applying universal algebra to lambda calculus

    13/37

    (6) (ab.x)((b.y)c) = b.(a.x)((b.y)c);() (a.(b.x)c) = b.(a.(b.x)c)b.

    The class of -abstraction algebras is a variety, denoted by LAA, and therefore it is closedunder subalgebras, homomorphic images, and Cartesian products.

    In the following theorem it is shown that the term algebras of the -theories are the generatorsof the subvarieties ofLAA.

    Theorem 1. (Salibra [63, Thm. 14, 16]) Every variety of-abstraction algebras is generated bythe term algebra T/ of a suitable -theory . In particular,

    LAA = V(T/).

    Remark 2. The meta-mathematical content of the phrase a name a does not occur free in x, orequivalently x does not depend on the name a, can be expressed by an equation:

    (a.x)b = x (b = a).

    Then, for example, axiom (6) assumes the following natural form for all elements y which donot depend on b:

    (ab.x)y = b.(a.x)y, (a = b).

    Remark 3. Thm. 1 is a consequence of [63, Thm. 13], which is a result relating identities between

    -terms and identities between -terms. Let A be a -abstraction algebra and t(x1, . . . , xn) =u(x1, . . . , xn) be an identity between -terms. Then there exist two -terms Mt and Mu suchthat

    A |= t(x1, . . . , xn) = u(x1, . . . , xn) A |= Mt = Mu. (2)

    We remark that the proof of (2) is not trivial, because -abstraction algebras may admit elementswhich depend on all the names in Na. This is obviously not true for the term algebra of a -theory because every -term is a finite string. As an example of this phenomenon, we consider

    the Cartesian productA

    = (T/)

    Na

    of Na-copies of the term algebra of. Then all namesin Na occur free in aA : a Na A (see Remark 2). Another example concerns the elementswhich are free generators of the free LAA-algebra.

    What kind of variety is LAA? We wonder if it is possible to apply to -abstraction algebrasthe nice results developed in universal algebra in the last thirty years. The following theorem

    seems to show that -calculus is algebraically pathological.A lattice identity is an identity in the similarity type {, , , } of bounded lattices.

    Theorem 2. (Lusin-Salibra [51]) Every lattice identity holding in all congruence lattices of al-

    gebras in LAA is trivial (i.e., true in all lattices).

    Many problems on -calculus may be rephrased as problems of existence of a suitable subva-riety ofLAA (see Section 1). This explains why it is important to study the structure of the lattice

    of the subvarieties ofLAA

    , or dually of the lattice of the equational theories of -abstractionalgebras. The next theorem shows a first positive algebraic result about the subvarieties ofLAA.

    Theorem 3. (Berline-Salibra [10]) There exists a congruence distributive variety of-abstractionalgebras.

    The existence of a variety of -abstraction algebras satisfying strong algebraic properties,such as n-permutability or congruence distributivity was an open problem first raised in [64].

  • 8/7/2019 Applying universal algebra to lambda calculus

    14/37

    3.2 The models of-calculus

    Combinatory logic is a formalism for writing expressions which denote functions. Combinators

    are designed to perform the same tasks as -terms, but without using bound names.

    Combinatory algebras. Schonfinkel and Curry discovered that a formal system of combina-

    tors, having the same expressive power of the -calculus, can be based on only two primitivecombinators.

    Definition 21. An algebra C = (C, C,kC, sC), where C is a binary operation andkC, sC areconstants, is called a combinatory algebra (see [28, 72]) if it satisfies the following identities:

    (k x) y = x; ((s x) y) z = (x z) (y z).

    The superscript C and the symbol are usually omitted. Association is made on the left, sothat, for example, the above axioms can be written as follows:

    kxy = x; sxyz = xz(yz).

    The class CA of all combinatory algebras constitutes a variety of algebras and, therefore, it is

    closed under homomorphic images, subalgebras and direct products.

    In the equational language of combinatory algebras the derived combinators i, and n are

    defined as follows:

    i skk; 1 s(ki); n+1 s(k)(s(kn)).

    Hence, every combinatory algebra satisfies the identities

    ix = x; xy = xy; 2xyz = xyz; 3xyzu = xyzu.

    A function f : C C is representable in a combinatory algebra C if there exists an elementx C such that x z = f(z) for all z C. In this case, we say that c represents f in C.

    Two elements x, y C are called extensionally equal if they represent the same function inC. For example, the elements x and x are extensionally equal for every x C. The combinator will be used in the next subsection to select a canonical representative inside the class of all

    elements y extensionally equal to a given element x C.

    Lambda Models. Although lambda calculus has been object of study since the early thirties, its

    model theory developed only much later, following Scotts pioneering model construction. At the

    end of the seventies, researchers were able to provide a general algebraic characterization of the

    models of lambda calculus as an elementary subclass of combinatory algebras called -models[55, 70].

    Definition 22. An environment with values in C is a total function : Na C, where Na is theset of names of-calculus.

    We denote by EnvC the set of all environments with values in C. For every a Na andx C we denote by [a := x] the environment which coincides with , except on a, where

    takes the value x.

  • 8/7/2019 Applying universal algebra to lambda calculus

    15/37

    Given a combinatory algebra C, the interpretation of a -term M is a function |M| : EnvCC and it is defined by induction as follows, for every environment EnvC:

    |a| = (a); |M N| = |M| |N|; |a.M| = m,

    where m C is any element representing the following function fa : C C:

    fa(x) = |M|[a:=x], for all x C. (3)

    The drawback of the previous definition is that, ifC is an arbitrary combinatory algebra, it may

    happen that the function fa is not representable in C. The axioms characterizing -models wereexpressly chosen to make coherent the previous definition of interpretation.

    Definition 23. A combinatory algebraC is called a -model if it satisfies the identities2k = k,3s = s and the Meyer-Scott axiom:

    xy(z(x z = y z) x = y).

    Here the combinator is used as an inner choice operator. Indeed, given any x, the element x isin the same equivalence class as x w.r.t. extensional equality; and, by Meyer-Scott axiom, x = y for every y extensionally equal to x. Thus, the set Y = {x : x z = fa(z) for all z C}of elements representing the function fa defined in (3) admits m as a canonical representativeand this does not depend on the choice of m Y.

    As a matter of notation, we write C |= M = N if|M| = |N| for all environments . A -model univocally induces a -theory through the kernel congruence relation of the interpretationfunction.

    Definition 24. LetC be a -model. The equational theory ofC is the -theory defined as follows

    T h(C) = {(M, N) : C |= M = N}.

    Definition 25. A -model C represents (orinduces) a -theory if = T h(C).

    Functional -abstraction algebras and -models. The most natural -abstraction algebras arealgebras of functions that are obtained by coordinatizing -models. This situation is analogousto that of algebraic logic: the most natural cylindric (and polyadic) algebras are algebras of

    functions that are obtained by coordinatizing models of first-order logic.

    Definition 26. LetC = (C, C,kC, sC) be a -model. The high-order expansion

    Ch = (Ch, h, ah, ah)aNa

    ofC is an algebra in the similarity type of-abstraction algebras. The underlying setCh is theset of all functions F : EnvC C satisfying the following condition: for every EnvC, for

    every sequence of distinct names a = a1 . . . an, there exists an elementu C (which dependson F, anda) such that, for all x = x1 . . . xn Cn,

    F([a := x]) = ux1 . . . xn1xn.

    The operations of application and lambda abstraction are defined as follows, for all F, G Ch

    and EnvC.

  • 8/7/2019 Applying universal algebra to lambda calculus

    16/37

    (i) ah() = (a);(ii) (F h G)() = F() C G();

    (iii) ah(F)() = C x, where x C is any element satisfying x C y = F([a := y]) for ally C.

    The set Ch contains the interpretations of all -terms and all constant functions.

    Theorem 4. (Pigozzi-Salibra [59]) The algebra Ch is a -abstraction algebra, and it is thelargest algebra of functions F : EnvC C closed under the operations defined in (i)-(iii).

    Definition 27. Any algebra isomorphic to a subalgebra of a high-order expansion of a -modelis called a functional -abstraction algebra.

    The class of all these algebras is denoted by FLA. In [62] it was shown the following repre-

    sentation theorem:

    Theorem 5. (Goldblatt-Salibra [62])LAA = FLA.

    In other words, any -abstraction algebra is isomorphic to a subalgebra of a high-order ex-pansion of a suitable -model. This makes clear the connection existing between lambda calculusand combinatory logic.

    Infinitary lambda calculus. Various infinitary versions of -calculus have been introducedby several authors in [43, 7, 29]. Here, as an application of Thm. 5, we recall from [62] the

    completeness theorem for the infinitary -calculus.Let be the similarity type obtained from the similarity type of lambda calculus by

    adding a new nullary operator symbol .

    Definition 28. An infinitary -term is a finite or infinite rooted tree such that each leaf is eitherlabeled by a name a Na or by the constant, and the inner nodes are either binary appli-cation nodes, or unary abstraction nodes, in which case they have a label of the form a for

    some a Na.The set of infinitary -terms, which contains properly T, is denoted by T and its elements

    by A , B , C , . . .Infinitary -terms arise as limits of infinite sequences of -conversions. For example, let

    3 a.aaa and 3 33. The -term 3 generates an infinite sequence of-conversions

    3 = 33 = (33)3 = = ((((33)3)3)3)3 = .

    Then it is natural to consider the infinitary -term

    3 (((( 3)3)3)3) with infinitely many 3s

    as the limit of the above sequence of-conversions. 3 corresponds to the tree

    zzzz hhh where 3 is equal to a

    www qqq

    3 }}} g

    gg

    }}}

    qqq3

    ee a

    W

    WW3 a a

    ...3

  • 8/7/2019 Applying universal algebra to lambda calculus

    17/37

    The notions of free and bound occurrence of a name are easily extended to infinitary -terms.The extension of the substitution is more subtle, and sometimes has an unexpected behaviour;

    we refer the reader to [63, Sec. 3] for more details. Once defined A[a := B] we can consider theinfinitary versions () and () of the usual () and ()-conversions.

    Definition 29. The algebra of infinitary -terms is

    T = (T, T, Ta , a

    T)aNa,

    where A T B is a tree having an applicative node as root, andA, B as left and right subtreesrespectively; Ta (A) is a tree having an abstraction node as root andA as subtree; a

    T is tree

    constituted by a unique node labeled by a.

    Definition 30. An infinitary -theory is any congruence on T including ()- and ()-

    conversion.

    The quotient algebra ofT by an infinitary -theory , denoted by T/, is called the termalgebra of.

    Proposition 2. T/ is a -abstraction algebra.

    As a consequence of Thm. 5 we have the completeness of the infinitary -calculus.

    Theorem 6. (Goldblatt-Salibra [62], Infinitary Completeness Theorem) Let be an infinitary-theory. Then there exists a -model C such that the term algebraT/ of embeds intoC

    h.

    4 The lattice of-theories

    The interval I[, ] of all -theories is a sublattice of the congruence lattice of the absolutely

    free -algebra T over an empty set of generators, so that it is isomorphic to the congruencelattice of the term algebra T/ of. The lattice of -theories is naturally equipped with astructure of complete lattice, with meet defined as set-theoretical intersection. The join of two

    -theories and is the least equivalence relation including . It is clear that the bottomelement of this lattice is , while the top element is the inconsistent -theory . Althoughresearchers have mainly focused their interest on a limited number of them, the lattice of -theories, hereafter denoted by T, constitutes a very rich and complex structure (see [4, 8, 9]).Lambda theories interesting for computer scientists can be defined by classifying -terms interms of their computational behaviour.

    Definition 31. A closed-term M is solvable if

    M = a1 . . . an.aiM1M2 . . . M k, (n, k 0 and1 i n)

    for some M1, . . . , M k T. M is unsolvable, otherwise.

    Intuitively, solvable -terms are interesting from the computational point of view since theyprovide at least a partial fixed output, namely a1 . . . an.ai1 k, whilst unsolvable -termscorrespond to looping terms.

    Looking at the -theories in terms of solvability/unsolvability, they are classified as:

  • 8/7/2019 Applying universal algebra to lambda calculus

    18/37

    semisensible if they do not equate a solvable and an unsolvable -term; sensible if they equate all unsolvable -terms.

    The following results can be found in [4, Sec. 16, 17]. The -theory H, generated by equatingall unsolvable -terms, is the minimal sensible -theory and it is consistent. H admits a uniquemaximal consistent extension H. H is a coatom (see Section 2.2) in the lattice of -theories.A -theory is semisensible if, and only if, H and it is sensible if, and only if, H .Sensible consistent -theories are semisensible and never recursively enumerable (r.e., for short).

    The semisensible -theory , axiomatized by the axiom of extensionality:

    M a = N a M = N, (a not free in M, N),

    does not distinguish -terms which define the same function.Summarizing, the lattice T of-theories is divided into two parts: one containing all non-

    semisensible -theories and the other one containing all semisensible -theories. The intervalI[H, H], which belongs to the latter part, constitutes the set of all sensible -theories.

    H

    H

    sensible

    -theories

    = least -theory

    = inconsistent -theory

    coatoms

    non-semisensible

    -theories

    semisensible

    -theories

    least extensional

    -theory

    Techniques of universal algebra were applied in [51, 66, 63] to study the structure of the

    lattice T by the variety V(T/) and its subvarieties.

    Theorem 7. (Salibra [63]) The lattice of the equational theories of-abstraction algebras isisomorphic to the lattice of-theories.

    We summarize in the next theorem some results which enlighten the structure of the lattice of-theories. At the end of the nineties, Salibra proposed the conjecture that the lattice T satisfiesno (non-trivial) lattice identity. This conjecture is still open, because Thm. 2 only implies that

    every lattice identity e fails in the congruence lattice of a suitable -abstraction algebra that maybe different from T/. Moreover, there is a good reason to be also interested in large intervalsof the form I[, ], where is a -theory, because this interval is isomorphic to the congruencelattice of the term algebra of, which is a bridge to universal algebra.

  • 8/7/2019 Applying universal algebra to lambda calculus

    19/37

    Definition 32. LetS be a bounded lattice with least element and top element, anda,b,ci(i I) be elements ofS. We say thatS satisfies the Zipper Condition if the following conditionholds:

    IfiI

    ci = , ci a = b (i I) then a = b.

    The following results have been shown by several authors.

    Theorem 8. (i) T has a continuum of coatoms.(ii) [74] The meet of all coatoms ofT is different from . In other words, there are identities

    between non-()-equivalent-terms which are consistent with every -theory.(iii) [77] Every countable partially ordered set embeds into T by an order-preserving map.(iv) [77] Every interval I[, ] where and are r.e. -theories has a continuum of elements.(v) [64] T does not satisfy the modular law .

    (vi) [51] T satisfies the Zipper condition.(vii) [10] There exists a finitely axiomatizable -theory such that the lattice interval I[, ] is

    distributive.

    Proof. (i) There is a continuum of-theories that are pairwise incompatible (see e.g. [10]).(ii)-(iv) are shown by using ingenious non-algebraic techniques.(v) The non-modular pentagon N5 (see [54, Thm. 2.25]) embeds into T.(vi) follows from Thm. 7 and from Lampes results [48] on the lattices of equational theories

    (see Thm. 10 below for another proof).

    (vii) There is a -theory whose term algebra T/ has the lattice operations as termoperations.

    The remaining results of the section are new.

    Let L be a bounded lattice with least element and top element . For any x L we defineLx = {y L {} : x y = }. Every element ofLx is called a lower semicomplementofx. L is said to be lower semicomplementedifLx is non-empty for all x = .

    Proposition 3. The maximal sensible -theory H does not admit a lower semicomplement, so

    that the lattice of-theories is not lower semicomplemented.

    Proof. Let be any non-semisensible -theory. Assume, by the way of contradiction, that H = . It is well known that every equivalence class of a non-semisensible -theory containsan unsolvable -term (see [4]). Then there exists an unsolvable U such that I = U. Since for allunsolvable -terms M we have U M = M (by I = U) and U M =H M (by the sensibilityofH), then U M = M follows from H

    = . In particular, we have U = . By[2, Lemma 1.10] this implies that either U a = a or U a = , for a new name a. In the firstcase, we contradict the semisensibility of . In the second one we derive U M = M = for all unsolvable -terms M. This contradicts the fact that is not sensible.

    Proposition 4. Let be an r.e. -theory. Then the lattice interval I[, ] is not lower semicom-plemented.

    Proof. By [4, Prop. 17.1.9] there exists a

    -termM

    such that(M, N) =

    for all closed

    -terms N. This implies that there exists an infinite number of maximal consistent -theoriesextending . Since the interval I[, ] is a coatomic complete lattice satisfying the Zipper con-dition, and admitting a compact top element (see Theorem 8(vi) and Lemma 1), then the con-clusion of the proposition follows from [32, Prop. 3], where it is shown that, under the above

    hypotheses, a lattice is lower semicomplemented if, and only if, the coatoms form a finite de-

    composition of the least element.

  • 8/7/2019 Applying universal algebra to lambda calculus

    20/37

    4.1 The commutator for -theories

    The structure of an algebra is affected by the shape of its congruence lattice. The commutator, a

    binary operation on this lattice, provides a measure of this shape. In this section we show thatthe binary commutator on the set of -theories has a good behavior if one of its arguments is .As a consequence, we get that the lattice T satisfies a condition (in the form of quasi-identity)that, among other things, implies the ET and Zipper conditions.

    Given two -theories and , we write X(, ) for the set of all 2 2 matrices X = Xi,j(1 i, j 2) of the form:

    X =

    t(M1, N1) t(M1, N2)t(M2, N1) t(M2, N2)

    where M1, M2 (T)n, N1, N2 (T)m, for some n, m 0, t is any m + n-ary -term, andM1M2, N1N2. That is, if in a matrix X we shift along a line then we shift modulus , if weshift along a column we shift modulus .

    If is another -theory, we say that centralizes modulo (see e.g. [34]), in symbolsC(, ; ), if and only if, for every matrix X such that:

    M1 N1M2 N2

    X(, )

    we have:

    M1 N1 M2 N2.

    The set of all -theories such that C(, ; ) is non-empty and closed under arbitrary inter-section (see [34]). The commutator [, ] of and is defined as the least -theory sat-isfying C(, ; ). Notice that always centralizes modulo , so that we have always[, ] .

    In this first result we show that the commutator for -theories has a good behavior when oneof the involved congruences is .

    Theorem 9. Let be a -theory. Then

    [, ] = [, ] = .

    Proof. Let M, N be -terms such that M = N. We define:

    X

    FMF FNFTMF TNF

    =

    F F

    M N

    M(, )

    From (F, F) [, ] it follows that (M, N) [, ]. By the arbitrariness of M and Nsuch that M = N we obtain that [, ]. Since [, ] always holds, we obtain the

    conclusion. Similarly we can show that [, ] = .

    Theorem 10. Let, andi (i I) be -theories. Then we have:

    (i) IfiIi = , (i ( )) (i I) then .

    (ii) If the lattice interval I[, ] is modular andiIi = then =

    iI(i ) for every

    , i .

  • 8/7/2019 Applying universal algebra to lambda calculus

    21/37

    Proof. (i) By [49, Prop. 1.2(6)] and by hypothesis we have C(iIi, ; ). Since

    iIi =

    and [, ] = we get , because the commutator [, ] is the least congruence satisfying C(, ; ).

    (ii) By [49, Cor. 1.3(e)] and the hypothesis of modularity [iIi, ]

    iI[i, ]. Then

    we have: = [, ] = [iIi, ]

    iI[i, ]

    iIi .

    By putting = i in Thm. 10(i) we get another proof of the Zipper condition for T.

    5 The Stone representation theorem for -calculus

    In this section we show that combinatory algebras and -abstraction algebras satisfy a theoremwhich is similar to the Stone representation theorem for Boolean algebras.

    5.1 The classical Stone and Pierce theorem

    The Stone representation theorem for Boolean rings (the observation that Boolean algebras could

    be regarded as rings is due to Stone) admits a generalization, due to Pierce, to commutative rings

    with unit (see [57] and [40, Ch. V]). To help the reader to get familiar with the argument, we now

    outline Pierces construction.

    Let A = (A, +, , 0, 1) be a commutative ring with unit, and let E(A) = {a A : a a = a}be the set of its idempotent elements. One defines a structure of Boolean algebra on E(A) asfollows. For all a, b E(A):

    a b = a b; a b = a + b (a b); a = 1 a.

    Then it is possible to show that for every a E(A), a = 0, 1 induces a pair ((a, 1), (a, 0))of non-trivial complementary factor congruences. In other words, the ring A can be decomposedin a non-trivial way as A = A/(a, 1) A/(a, 0). If E(A) = {0, 1}, then A is directlyindecomposable. Then Pierces theorem for commutative rings with unit can be stated as follows:

    Every commutative ring with unit is isomorphic to a Boolean product of directly

    indecomposable rings.

    IfA is a Boolean ring, we get the Stone representation theorem for Boolean algebras, because

    the ring of truth values is the unique directly indecomposable Boolean ring.

    The remaining part of this section is devoted to provide the statement and the proof of the

    representation theorem for combinatory algebras and -abstraction algebras.

    5.2 The Boolean algebra of central elements

    We start by defining the constants which correspond to the elements 0 and 1 in a commutativering with unit:

    Combinatory algebras: 1 k; 0 sk, -abstraction algebras: 1 ab.a; 0 ab.b.

  • 8/7/2019 Applying universal algebra to lambda calculus

    22/37

    As a matter of notation, we set

    e (1, e); e (e, 0).

    Definition 33. (Vaggione [75, 76]) LetA be an algebra with two constants 0, 1 such that(0, 1) =. We say that an elemente ofA is central, and we write e Ce(A), if(e, e) forms a pair ofcomplementary factor congruences.

    A central element e is trivial if it is equal either to 0 or to 1.

    Lemma 5. LetA CA LAA ande Ce(A). Then we have:

    (i) x e exy e y.(ii) x e y if, and only if, exy = y, andx e y if, and only if, exy = x.

    Proof. (i) Since 1 e e e 0 then x = 1xy e exy e 0xy = y.

    (ii) By (i).

    Lemma 6. LetA CALAA ande A. Then we have: e Ce(A) if, and only if, ee = .

    Proof. () e e = follows from Lemma 5(i).

    We now provide a new characterization of the notion of central element which works for

    combinatory algebras and -abstraction algebras.

    Theorem 11. LetC CA LAA. Then the following conditions are equivalent for all e C:

    (i) e is central;(ii) e satisfies the following identities:

    1. exx = x,

    2. e(exy)z = exz = ex(eyz),3. e(xy)(zt) = exz(eyt),4. e = e10,5. e(a.x)(a.y) = a.exy, (only forLAA).

    (iii) The function fe defined by fe(x, y) = exy is a decomposition operator andfe(1, 0) = e.

    Proof. (ii) (iii) It is a simple exercise to show that e satisfies the identities in (ii) if, and onlyif, fe is a decomposition operator such that fe(0, 1) = e.

    (i) (iii) If e is central, then (e, e) is a pair of complementary factor congruencesand by Lemma 5(i) exy is the unique element such that x e exy e y. It follows that fe is adecomposition operator. Moreover, fe(1, 0) = e10 = e, because e is the unique element suchthat 1 e e e 0.

    (iii) (i) Let (, ) be the pair of complementary factor congruences associated with fe,

    that is, x y iffexy = x, and x y iffexy = y. We recall that exy is the unique element suchthat x exy y. Since fe(1, 0) = e then e is the unique element such that 1 e 0. It followsthat e and e . For the opposite direction, let xy, i.e., exy = x. Then, by 1 e e wehave x = 1xy e exy = y. Similarly, for .

    It follows that an algebra C CALAA is directly indecomposable if, and only if, Ce(C) ={1, 0}.

  • 8/7/2019 Applying universal algebra to lambda calculus

    23/37

    Theorem 12. LetDec(C) be the set of decomposition operators of an algebraC CA LAA.Then the functions, mapping central elements into decomposition operators

    e Ce(C) fe, where fe(x, y) = exy (4)

    and decomposition operators into central elements

    f Dec(C) f(1, 0) Ce(C),

    form the two sides of a bijection.

    Proof. Let f be a decomposition operator and let e = f(1, 0). We now show that e is centraland that f(x, y) = exy. The element e is the unique one satisfying 1 e 0, where (, ) is thepair of complementary factor congruences associated with the decomposition operator f. Since and are compatible equivalence relations, it follows that for all x, y:

    x = 1xy exy 0xy = y.

    Since, by definition, f(x, y) is the unique element satisfying x f(x, y) y , we obtain:

    f(x, y) = exy. (5)

    Finally, the identities defining f as decomposition operator make e a central element by Thm. 11.We now check that these correspondences form the two sides of a bijection. Assume e is

    central, that is (e, e) is a pair of complementary factor congruences. Then f(x, y) = exy is adecomposition operator because x e exy e y. Iff is a decomposition operator, then by (5) wehave that ff(1,0)(x, y) = f(1, 0)xy = f(x, y) for all x, y.

    Corollary 1. The functions, mapping central elements into pairs of complementary factor con-

    gruencese Ce(C) (e, e), (6)

    and pairs of complementary factor congruences into central elements

    (, ) e if1 e 0,

    form the two sides of a bijection.

    Lemma 7. The varieties CA andLAA have factorable congruences. Hence, every algebra C CA LAA has Boolean factor congruences.

    Proof. LetA,B be combinatory algebras or -abstraction algebras; it is clear that, up to isomor-phism, Con(A)Con(B) Con(AB). Conversely, let Con(AB). The projections

    1, 2 of are the binary relations on A and B, respectively, defined as follows:

    x11x2 y1, y2 B such that (x1, y1) (x2, y2),y12y2 x1, x2 A such that (x1, y1) (x2, y2).

    It is obvious that 1 2. We now prove the opposite inclusion. Suppose that (x1, y1) 1 2 (x2, y2) for some x1, x2 A and y1, y2 B. Then, by definition of 1 2, we have that

  • 8/7/2019 Applying universal algebra to lambda calculus

    24/37

    x11x2 and y12y2. Hence, there exist x3, x4 A, y3, y4 B such that (x1, y3) (x2, y4) and(x3, y1) (x4, y2). Since (1, 0) (1, 0) and is a compatible relation, we get:

    (x1, y1) = (1x1x3, 0y3y1) (1x2x4, 0y4y2) = (x2, y2).

    Thus we get = 1 2. It is easy to check that 1, 2 are reflexive, symmetric and com-patible. We now show that 1 is also transitive. Let x11x21x3, then there exist y1, y2, y3, y4such that (x1, y1) (x2, y2) and (x2, y3) (x3, y4); from the symmetry of we have also(x3, y4) (x2, y3). Since (1, 0) (1, 0) and is a compatible relation, we get:

    (x1, y4) = (1x1x3, 0y1y4) (1x2x2, 0y2y3) = (x2, y3).

    Finally, from (x1, y4) (x2, y3) and (x2, y3) (x3, y4) we get (x1, y4) (x3, y4) and, hence,x11x3; thus 1 Con(A). An analogous reasoning gives 2 Con(B). From this it is easyto conclude that Con(A B) = Con(A) Con(B). By Lemma 4, every algebra of a varietywith factorable congruences has Boolean factor congruences.

    We now show that the partial ordering between central elements, defined by:

    x y if, and only if, x y (7)

    is a Boolean ordering and the meet, join and complementation operations are internally repre-

    sentable. 0 and 1 are respectively the bottom element and the top element of this ordering.

    Theorem 13. The algebra (Ce(C), , , , 0, 1) of central elements ofC, defined by

    x y = xy0; x y = x1y; x = x01,

    is a Boolean algebra isomorphic to the Boolean algebra of factor congruences.

    Proof. By Lemma 7 C has Boolean factor congruences. It follows that the partial ordering on

    central elements, defined in (7), is a Boolean ordering. There only remains to show that, for

    all central elements x, y, the elements x, x y and x y are central and are respectivelyassociated with the pairs (x, x), (x y, x x) and (x y, x x) of complementaryfactor congruences.

    We check the details for x. Since x is central then (x, x) is a pair of complementary factorcongruences. The complement is the pair (x, x). We have that x is the unique element suchthat 0 x x x 1. Then 1 x x x 0 for the pair (x, x). This means that x is the centralelement associated with the pair (x, x).

    We now consider x y = x1y. First of all, we show that x1y = y1x. By Lemma 5(i) wehave that 1 x x1y x y, while 1 x y1x x y can be obtained as follows:

    1 = y11 by Thm. 11(ii-1),y11 x y1x by 1 x x,y1x x y10 by x x 0,y10 = y by Thm. 11(ii-4).

    Since there is a unique element c such that 1 x c x y, then we have the conclusion x1y = y1x.We now show that x1y is the central element associated with the factor congruence x y, i.e.,

    1 (e d) x1y (e d) 0.

    From y1x = x1y we easily get that 1 x x1y and 1 d x1y, that is, 1 (e d) x1y. Finally, byLemma 5, we have: x1y e y = y10 d 0, i.e., x1y (e d) 0. The same reasoning works forx y.

  • 8/7/2019 Applying universal algebra to lambda calculus

    25/37

    We now provide the promised representation theorem. If I is a maximal ideal of the Booleanalgebra Ce(A), then I denotes the congruence on A defined by:

    x (I) y if, and only if, x e y for some e I.

    By a Pierce variety (see [76] for the general definition) we mean here a variety of algebras for

    which there are two constants 0, 1 and a term u(x, y, z, v) such that the following identities hold:u(x,y, 0, 1) = x and u(x,y, 1, 0) = y.

    Obviously, the variety of combinatory algebras and that of -abstraction algebras are Piercevarieties: in both cases it is sufficient to take u(x, y, z, v) zyx.

    Theorem 14. (Representation Theorem for CA and LAA) LetC CA LAA and X be theBoolean space of maximal ideals of the Boolean algebra of central elements. Then, for allI Xthe quotient algebraC/I is directly indecomposable and the map

    f : C IX(C/I),

    defined byf(x) = (x/I : I X),

    gives a weak Boolean product representation ofC.

    Proof. By Lemma 7 the factor congruences ofC constitute a Boolean sublattice of Con(C).Then by [25] f gives a weak Boolean product representation ofC. The quotient algebras C/Iare directly indecomposable by [76, Thm. 8], because the varieties CA and LAA are Pierce vari-

    eties.

    Note that, in general, it is not possible to obtain a (non-weak) Boolean product representation

    of an algebra C CA LAA. This follows from Lemma 7 and two results due to Vaggione [75]and Plotkin-Simpson [71]. Vaggione has shown that, if a variety has factorable congruences and

    every member of the variety can be represented as a Boolean product of directly indecomposable

    algebras, then the variety is a discriminator variety (see [22] for the terminology). Discriminatorvarieties satisfy very strong algebraic properties, in particular they are congruence permutable

    (i.e., in each algebra the join of two congruences is just their composition). Plotkin and Simpson

    [71, Thm. 3.7] have shown that this last property is inconsistent with -calculus and combinatorylogic, hence by Lemma 7 and Vaggiones theorem not all combinatory algebras and -abstractionalgebras have a Boolean product representation.

    6 The indecomposable semantics

    The Stone representation theorem for combinatory algebras can be roughly summarized as fol-

    lows: the directly indecomposable combinatory algebras are the building blocks in the variety

    of combinatory algebras. Then it is natural to investigate the class of models of-calculus, which

    are directly indecomposable as combinatory algebras (indecomposable semantics, for short).In this section we show that the indecomposable semantics encompasses the Scott-continuous,

    the stable and the strongly stable semantics, and represents all semisensible -theories. In spiteof this richness, in the last results of this chapter we show that the indecomposable semantics is

    incomplete, and that this incompleteness is as wide as possible. Finally, we will show that the set

    of-theories induced by each of the main semantics is not closed under finite intersection, andhence it does not form a sublattice of T.

  • 8/7/2019 Applying universal algebra to lambda calculus

    26/37

    6.1 The main semantics of-calculus

    After Scott, several models of -calculus have been defined by order theoretic methods and

    classified into semantics according to the nature of their representable functions (see [8], for asurvey on these semantics).

    The Scott-continuous semantics corresponds to the class of-models having cpos (completepartial orders) as underlying sets and representing all Scott continuous functions.

    The stable semantics (Berry [12]) and the strongly stable semantics (Bucciarelli-Ehrhard

    [16]) are refinements of the Scott-continuous semantics which have been introduced to capture

    the notion of sequential continuous function. The underlying sets of the -models living in thestable (strongly stable) semantics are particular algebraic cpos called dI-domains (dI-domains

    with coherences). These models represent all stable (strongly stable) functions between such do-

    mains. A function between dI-domains is stable if it is continuous and, furthermore, commutes

    with infs of compatible elements. A strongly stable function between dI-domains with coher-

    ence, is a stable function preserving coherence. We refer the reader to [8, 9] for a more detailed

    description of these semantics.

    All these semantics are structurally and equationally rich: in particular, in each of them it is

    possible to build up 20 models having pairwise distinct, and even incompatible, -theories.

    6.2 Incompleteness of the indecomposable semantics

    We now define various notions of representability of -theories in classes of models.

    Definition 34. Given a classC of-models and a -theory , we say that:

    1. C represents if there is someC C representing (i.e., T h(C) = ).2. C omits if there is noC C representing (i.e., T h(C) = for all C C).3. C is complete for a setS T of-theories ifC represents all elements ofS (i.e., for every

    S there existsC C such thatT h(C) = ).4. C is incomplete if it omits a consistent-theory (i.e., there exists Ssuch thatT h(C) =

    for allC C).

    We now remark that the class of directly indecomposable combinatory algebras is a universal

    class (i.e., it is an elementary class which can be axiomatized by universal sentences).

    Proposition 5. The class of all directly indecomposable combinatory algebras (-abstractionalgebras, respectively) is a universal class, so that it is closed under subalgebras and ultraprod-

    ucts.

    Proof. By [13, Prop. 1.3].

    The closure of the class of directly indecomposable combinatory algebras under subalgebras

    is the key trick in the proof of the algebraic incompleteness theorem.We have shown that any factor congruence can be represented by a central element, and in

    particular that a combinatory (or -abstraction) algebraC is directly indecomposable if, and onlyif, it only admits the trivial central elements.

    IfA is a -abstraction algebra, the combinatory reductofA is the algebra

    Cr(A) = (A, A, (ab.a)A, (abc.ac(bc))A).

  • 8/7/2019 Applying universal algebra to lambda calculus

    27/37

    By [62, Thm. 29] Cr(A) is always a combinatory algebra. By [4, Cor. 5.2.13(ii)] it is a -modelunder the hypothesis that A is the term algebra of a -theory.

    In every -model the interpretations of the combinators k and sk coincide with those of the-terms ab.a and ab.b. Then the role of the trivial central elements in a -abstraction algebraand in its combinatory reduct is covered by the same elements.

    Lemma 8. Let be a -theory and M be a closed -term. If [M] is a non-trivial centralelement of the term algebra, then every -model representing is directly decomposable. Itfollows that the indecomposable semantics omits .

    Proof. Let C be a -model. Then T h(C) = if, and only if, is isomorphic to a subalgebraof the -abstraction expansion C ofC (see Section 3.2). By Prop. 5 and by the hypothesis weobtain that C is decomposable. Then the combinatory reduct Cr(C) is decomposable. Finally,C is decomposable because it is a subalgebra of Cr(C) that contains the interpretation of allclosed terms.

    We are now able to provide the promised algebraic incompleteness theorem.

    Theorem 15. (Algebraic incompleteness theorem) The indecomposable semantics is incomplete.

    Proof. By Lemma 8 it is sufficient to produce a -theory such that the term algebra of hasa non-trivial central element. By [4, Prop. 15.3.9] the -theories (, ab.a) and (, ab.b) arenon-trivial. Then, we conclude by Lemma 6 that [], where = (,ab.a) (, ab.b), isa non-trivial central element of.

    6.3 Continuous, stable and strongly stable semantics

    In Thm. 16 below we show that, although the indecomposable semantics is incomplete, it is large

    enough to represent all semisensible -theories.

    We need now a technical lemma.

    Lemma 9. Let be a -theory ande be a non-trivial central element of. Then, every -termbelonging to the equivalence class e is unsolvable.

    Proof. Let M e. Since the congruences e and e on are non-trivial, then the -theories1 = (ab.b,M) and 2 = (ab.a,M) are consistent. By [4, Lemma 10.4.1(i)] it is con-sistent to equate two solvable -terms only if they are equivalent according to [4, Def. 10.2.9].IfM were solvable then it should be equivalent both to ab.b and ab.a, so that these last termsshould be equivalent. But this is false. Then M must be unsolvable.

    Theorem 16. The indecomposable semantics represents all semisensible -theories.

    Proof. Let be a semisensible -theory. Assume, by the way of contradiction, that has a

    non-trivial central element e (cf. Lemma 8). Let M e. Then, satisfies the identity exx = xfrom which we derive MP P = P for every solvable P. This contradicts the semisensibility of since M is unsolvable by Lemma 9.

    In the next proposition we show that all -models living in the main semantics are simplealgebras. We recall that an algebra is simple when it has just the two trivial congruences, and is

    hence directly indecomposable.

  • 8/7/2019 Applying universal algebra to lambda calculus

    28/37

    Proposition 6.

    (i) All -models living in the Scott-continuous semantics are simple combinatory algebras.

    (ii) All -models living in the stable or strongly stable semantics are simple combinatory alge-bras.

    Proof. Let us consider a -model C = (D, ,k, s).(i) Suppose that C lives in Scott-continuous semantics, so that D is a cpo and all Scott

    continuous functions are representable in C. It is easy to check that, for all b, c D, the functiongb,c defined by

    gb,c(x) =

    c ifx D b, otherwise,

    is Scott continuous. Let be a congruence on C and suppose that there exist a, d such that a dwith a = d. We have a D d or d D a. Suppose, without loss of generality, that we are in thefirst case. Since the continuous function gd,c is representable in the model (for all c), we have:

    = gd,c(a) gd,c(d) = c, hence c. By the arbitrariness ofc we get that is trivial, so that Cis simple. Note that gd,c is neither stable nor strongly stable hence it cannot be used for provingitem (ii).

    (ii) Suppose that C is a (strongly) stable -model. Consider two elements a, b D such thata = b. We have a D b or b D a. Suppose, without loss of generality, that we are in the firstcase. Then there is a compact element d ofC such that d D a and d D b. The step functionfd,c defined by :

    fd,c(x) =

    c ifd D x, otherwise,

    is stable (strongly stable) for every element c. This function fd,c can be used to show that everycongruence on C is trivial as in the proof of item (i).

    As a consequence of Prop. 6, we get, in a uniform way, the incompleteness of the mainsemantics of-calculus. We will see later on that this incompleteness is very large.

    Corollary 2. The Scott-continuous, the stable and the strongly stable semantics are incomplete.

    Proof. By Prop. 6 and Thm. 15.

    Given a class C of-models, T h(C) denotes the set of -theories which are represented inC. In the remaining part of this subsection we show that, for each of the classic semantics of

    -calculus, the set T h(C) is not closed under finite intersection, so that it is not a sublattice ofthe lattice T of-theories.

    Theorem 17. LetC be a class of directly indecomposable models of-calculus. If there are twoconsistent-theories , T h(C) such that

    = ab.a; = ab.b,

    then T h(C) is not closed under finite intersection, so it is not a sublattice ofT.

    Proof. Let = . By Lemma 6, [] is a non-trivial central element of. It follows that / T h(C).

  • 8/7/2019 Applying universal algebra to lambda calculus

    29/37

    We recall that the graph models (see, e.g., [9, 18]) and the filter models (see, e.g., [5]) are

    classes of-models within the Scott-continuous semantics.

    Corollary 3. LetC be one of the following semantics: graph semantics, filter semantics, Scott-continuous semantics, stable semantics, strongly stable semantics. ThenT h(C) is not a sublatticeofT.

    Proof. In each of these semantics it has been proved that for all M o there exists a modelC such that T h(C) is consistent and =Th(C) M. Then the conclusion follows from Thm. 17and Prop. 6.

    6.4 Concerning the number of decomposable and indecomposable -models

    From the work done in the previous subsection, it is easy to conclude that there is a wealth of

    directly indecomposable -models representing different -theories.

    Theorem 18. LetCIND be the indecomposable semantics. Then T h(CIND) contains an intervalof cardinality 20 and an antichain of cardinality 20 .

    Proof. We know from Thm. 16 that T h(CIND) contains the interval I[, H], which has cardi-nality 20 by [4, Sec. 16.3] (see Section 4 for the definition ofH). Moreover, Cor. 2 implies thatT h(CIND) also contains the set of all -theories represented by the class of graph models, whichhas an antichain of cardinality 20 by [10].

    Now, we show that also the incompleteness of the indecomposable semantics is as wide as

    possible.

    First of all we need some results about -theories. The proof of the following lemma is similarto that of [4, Prop. 17.1.9], where the case k = 1 (due to Visser) is shown, and it is omitted.

    Lemma 10. Suppose that is an r.e. -theory and fix arbitrary pairs of-terms (Mi, Ni) for

    1 i k such thatMi = Ni for all i k. Then there is M o such that, for all P o,the -theory = (M, P) is consistent and

    Mi = Ni, for every i k.

    Then the following theorems are corollaries of the algebraic incompleteness theorem.

    Theorem 19. Let be an r.e. -theory. Then, the intervalI[, [ contains a subinterval I[1, 2]satisfying the following conditions:

    1 and2 are distinct r.e. -theories, every I[1, 2] is omitted by the indecomposable semantics, card(I[1, 2]) = 20 .

    Proof. Since is r.e. we know by [4, Prop. 17.1.9] that there exists a -term Q such that(Q, M) is consistent for all M o. Note that, in particular, this implies Q = ab.a and

    Q = ab.b.Let 1 = (Q, ab.a) (Q, ab.b). Obviously, the -theory 1 is consistent, r.e. and

    contains . By Lemma 6, [Q]1 is a non-trivial central element of1 .We apply Lemma 10 to the r.e. -theory 1 and to the pairs (Q, ab.a) and (Q, ab.b) such

    that Q = ab.a and Q = ab.b. We get a -term R o such that Q =1(R,P) ab.a and

  • 8/7/2019 Applying universal algebra to lambda calculus

    30/37

    Q =1(R,P) ab.b, for all -terms P o. Let 2 = 1(R, a.a). We have that 2 is a proper

    extension of1.The term algebra

    2

    of 2

    is a homomorphic image of the term algebra 1

    of 1

    , then

    every equation satisfied by 1 is also satisfied by 2 . In particular, the equations expressing

    that Q is a central element. Finally, [Q]2 is non-trivial as a central element because Q =2 ab.aand Q =2 ab.b.

    Hence, for every -theory such that 1 2 the equivalence class of Q is a non-trivial central element of the term algebra of .

    We get the conclusion of the theorem because card(I[1, 2]) = 20 by Thm. 8(iv).

    Remark 4. From Lemma 8 it follows that all the -models C such that T h(C) belongs to theinterval I[1, 2] above, are directly decomposable.

    Theorem 20. LetCDEC be the class of all directly decomposable -models. Then we have that

    (i) T h(CDEC) has an antichain of cardinality 20 .

    (ii) T h(CDEC) contains countably many pairwise incompatible intervals of cardinality20 .

    Proof. (i) Let Un (x1 . . . xnx.x) and k be the k-th Churchs numeral. Given a permutation of the set of Churchs numerals, we write , for the -theories respectively generated by:

    E1 = {U0 = ab.a} {Un = (n 1) : n 1},E0 = {U0 = ab.b} {Un = (n 1) : n 1}.

    From [10, Thm. 22] we get that , are consistent and hence we have that the equivalenceclass ofU0 is a non-trivial central element of . Thus, T h(CDEC) by Lemma 8.

    If1, 2 are two distinct permutations of the set of Churchs numerals, then 1 1 and2 2 are incompatible, because it is inconsistent to equate n = m for every n = m.

    Hence, (i) follows since there exist 20 permutations of the set of Churchs numerals which

    give rise to pairwise incompatible -theories T h(CDEC).(ii) Let be a permutation of the Churchs numerals and , be as in the proof of (i).

    Suppose that is computable, then both and are r.e. -theories, hence also T h(CDEC) is r.e. Thus, the interval I[, ] contains an interval of20 -theories belongingto T h(CDEC). The theorem follows since there exist countably many computable permutations.

    Corollary 4. The indecomposable semantics, and hence the Scott-continuous, the stable and the

    strongly stable semantics omit a set of-theories which has an antichain of cardinality 20 , andeven contains countably many pairwise incompatible intervals of cardinality20 .

    7 Open problems

    In this section we collect open problems and conjectures that are related to universal algebra and

    topology. We start with the lattice of-theories.

    7.1 The lattice of-theories

    At the end of the nineties, the second author proposed the following conjecture:

  • 8/7/2019 Applying universal algebra to lambda calculus

    31/37

  • 8/7/2019 Applying universal algebra to lambda calculus

    32/37

    (P8) What varieties of-abstraction algebras have a good commutator?(P9) Is there a property of the commutator which holds for-theories but not for-abstraction

    algebras?

    All the known properties of the commutator for -theories (see Section 4.1 and [51]) are alsotrue for 0, 1-algebras, i.e., algebras having a binary term with a right unit and a right zero. Thenit is natural to rise the following question:

    (P10) Is it possible to find a property of the commutator which distinguish 0, 1-algebras and -abstraction algebras or, more generally, find a new commutator distinguishing 0, 1-algebrasand-abstraction algebras in a natural way?

    7.2 Models of lambda calculus

    Concerning the models of -calculus, the result of incompleteness stating that any semantics

    given in terms of partial orderings with a bottom element is incomplete leads us to the followingproblem.

    (P11) Find a class of models of lambda calculus, where partial orders and Scott topology do not

    play any role.

    As for the lattice of -theories, results on the structure of the set of -theories induced by asemantics are still rare, and there exist several longstanding basic open questions. The following

    natural questions were raised by Berline [8]:

    (P12) Given a class of models of lambda calculus, is there a least-theory represented in theclass?

    (P13) Given a class of models of lambda calculus, is there a least sensible-theory represented inthe class?

    These two problems are related to one of the longstanding open problems of lambda calculus

    raised by Honsell and Ronchi della Rocca [39]:

    (P14) Is there a non-syntactical model of the untyped lambda calculus whose theory is exactly

    the least (extensional) -theory ()?

    Di Gianantonio, Honsell and Plotkin [31] have shown that there exists an extensional -theorywhich is minimal among those represented by Scott continuous semantics.

    Graph models and other classes of models. Graph semantics is the semantics G of lambdacalculus given in terms of graph models. The reasons to concentrate on G are the following. G is,

    by far, the simplest class of models, nevertheless it contains a continuum of models with distincttheories, so it is a rich class. Moreover, the techniques and results for G can often be transferredto other classes of models.

    Bucciarelli and Salibra [1719] have shown that graph semantics admits a least graph theory

    (where graph theory means -theory of a graph model) and a least sensible graph theory.The least graph theory is not equal to and it is trivially different from . The followinginteresting and difficult question is open:

  • 8/7/2