30

I'm reading through Hindley and Seldin's book about the lambda calculus and combinatory logic. In the book, the authors express that, though combinatory logic can be expressed as an equational theory in first order logic, the lambda calculus cannot. I sort of understand why this is true, but I can't seem to figure out the problem with the following method. Aren't the terms of first order logic arbitrary (constructed from constants, functions, and variables, etc.) so why can't we define composition and lambda abstraction as functions on variables, and then consider an equational theory over these terms? Which systems of logic can the lambda calculus be formalized as an equationary theory over?

In particular, we consider a first order language with a single binary predicate, equality. We take a set $V$ of terms over the $\lambda$ calculus, which we will view of as constants in the enveloping first order theory and for each $x \in V$, we will add a function $f_x$, corresponding to $\lambda$ abstraction. We also add a binary function $c$ corresponding to composition. We add in the standard equality axioms, in addition to the $\beta$ and $\alpha$ conversion rules, which are a sequence of infinitely many axioms produced over the terms formed from the $\lambda$ terms from composition and $\lambda$ abstraction. I doubt this is finitely axiomatizable, but it's still a first order theory.

Jacob Denson
  • 2,271
  • 3
    Since lambda calculus and combinatory logic are trivially the same thing written 2 different ways, it is likely that the author is making a statement more about the grammar of the logic moreso than the inherent expressibility of the logic. Without having the book, I'd speculate that they may be pointing out that combinatory logic's grammar is a subgrammar of FOL, and lambda calculus is not because $\lambda x$ is a different kind of quantifier than $\exists x$ or $\forall x$. – DanielV Feb 24 '17 at 17:04
  • the book later discusses models of combinatory logic, and mentions that because combinatory logic can be expressed as a first order theory (a system of first order logic with extra axioms of some form), we essentially already have a definition of models for combinatory logic, whereas for the lambda calculus we don't, because it cannot be formalized as a first order theory. what I'm arguing is why doesn't my method above express the lambda caculus as a first order theory. – Jacob Denson Feb 25 '17 at 10:14
  • How exactly do you intent to convert $\lambda x . yx = y$ into first order logic without first converting it into combinatory logic? – DanielV Feb 25 '17 at 12:59
  • The equality is a predicate of the logic, and the $\lambda x.yx$ and $y$ are terms of the logic. The $\eta$ conversion rule then becomes an axiom of the logic. – Jacob Denson Feb 26 '17 at 00:54
  • I've updated the question to elaborate more on my formalization of the calculus as a first order theory. – Jacob Denson Feb 26 '17 at 01:06
  • You didn't answer my question. What exactly does the expression become in FOL? Keep in mind that $x$ is not a free variable. – DanielV Feb 26 '17 at 04:57
  • The expression becomes $P(f_x(c(y,x)), y)$ in the logic, where $P$ is the equality predicate. The $x$ and $y$ here are not free variables of first order logic, but instead constants which represent variables in the $\lambda$ calculus. – Jacob Denson Feb 26 '17 at 06:48
  • The principle types of lambda calculus and combinators are logic expressions (Hindley, Basic Type Theory).

    But he points out that some combinators have no type. (Such as the Y combinator)

    Possibly, this is the source of the problem.

    – JohnHalleck May 14 '20 at 07:19
  • @JacobDenson One problem with this approach is that in the semantics if two variables are identified, it may not mean that their lambda abstractions are. Which is a weaker notion than semantics defined in their book. One other attempt could be to define predicates to say 'when terms are variables' and 'when lambda abstraction is defined'; then the problem becomes axiomatising which are the non-atomic terms (this is impossible because equality is undecidable). Ultimately I think there isn't a first order theory with the same models as -calculus, but I don't know how to prove that – Oddly Asymmetric Nov 19 '22 at 18:35
  • That was wrong, there is a first order theory that has the same semantics, namely the description of the Scott-Meyer models, where you have (in addition to i,k,s combinators) an e combinator satisfying what e satisfies in Scott-Meyer models. That will be a first order axiomatisation of lambda calculus equality in another language – Oddly Asymmetric Nov 21 '22 at 17:56

2 Answers2

4

Untyped $\lambda$-calculus and untyped combinatory terms both have a form of the $Y$ combinator, so we introduce types to avoid infinite reductions. As (untyped) systems, they are equivalent only as equational theories. To elaborate;

Take $(\Lambda , \rightarrow_{\beta\eta})$ to be the set of $\lambda$-terms equipped with the $\beta\eta$-relation (abstraction and application only, I am considering the simplest case) and $(\mathcal{C}, \rightarrow_R)$ be the set of combinatory terms equipped with reduction. We want a translation $T$, be a bijection between the two sets that respects reduction. The problem is that reduction in combinatory terms happens "too fast" when compared with $\beta\eta$, so such a translation does not exist. When viewed as equational theories, i.e. $(\Lambda , =_{\beta\eta})$ and $(\mathcal{C}, =_R)$, we can find a translation that respects equalities.

An interesting fact is that $=_{\beta\eta} \approx =_{ext}$, where $=_{ext}$ is a form of extensional equality on $\lambda$-terms.

To answer your question, when you view these systems as equational theories, they are both expressible (in FOL) since one of them is and this translation exists. But using just reduction, $\lambda$-calculus has the notion of bound variables, while combinatory logic does not. Bound variables require more expressibility in the system, more than FOL. You need to have access to FOL expressions in order to differentiate them from free variables, which you cannot do from inside the system.

Concepts related to, and explanatory of my abuse of terminology when I say "you need to have access to expressions of FOL" are the $\lambda$-cube and higher-order logics from formal systems, and "linguistic levels" from linguistics. Informally it is the level of precision the system in question has. Take for example the alphabet $\{a,b\}$ and consider all words from this alphabet. This language requires the minimum amount of precision to be expressed, since it is the largest language I can create from this alphabet. Now consider only words of the form $a^nb^n$. This language requires a higher level of precision for a system to be able to express it, because you need to be able to "look inside" a word to tell if belongs to the language or not. You can read more about this topic on https://devopedia.org/chomsky-hierarchy

Jason
  • 662
2

The problem with your approach is that in the semantics of lambda calculus, if you have that the interpretation of two variables is equal in a model, then their lambda abstractions will need to be too. Your situation may have $[[x]]=[[y]]$ but $[[f_x]]$ and $[[f_y]]$ distinct. It therefore doesn't have the same semantics as lambda calculus, so doesn't axiomatise it successfully (you can see this, as your axiomatisation is universal, so will be closed under substructure, whereas the semantics of $\lambda$-calculus is not closed under substructure).

There are two other approaches that work: you could have a predicate $V$ representing 'being a variable' and axioms saying $V(A)$ for each $A$ which $\beta$-reduces to a variable, and axioms saying $\neg V(A)$ for all other $A$.You can then introduce your partial lambda abstraction function as a ternary predicate, i.e. $\lambda (A,B,C)$ represents $\lambda A.B$ is defined and $=C$. You can then axiomatise only being able to abstract over a variable: $\forall A,B (\exists C \lambda (A,B,C))\iff V(A)$ and then proceed to write the rest of the theory using these predicates.

This works, but since whether a term reduces to a variable is undecidable, these axioms are not recursively enumerable, which is a pain for logicians. The final and best approach, is to note that Scott-Meyer models of $\lambda$-calculus are essentially described in a first order way.

So you can have an axiomatisation using 3 constants (s,k,e) and a binary function $\cdot$ with the axioms:
$\forall a,b \, \, \, \, \, \, \, \, k \cdot a \cdot b$ $= a$
$\forall a,b,c \, \, \, \, \, \, s \cdot a \cdot b\cdot c$ $= a\cdot c \cdot (b\cdot c)$
$e \cdot e = e$
$\forall a,b \, \, \, \, \, \, \, \, e \cdot a \cdot b$ $= a\cdot b$
$\forall a,b \, \, \, \, \, \, \, \, \forall c \, \, a \cdot c$ $= b\cdot c \to e \cdot a = e \cdot b$

This is a theory (in a different language) which has the same (Set) models as $\lambda$-calculus. While this is now first order, it is no longer an algebraic axiomatisation.