2

Afternoon All,

Perhaps an easy one for many, but am new to Lambda calculus:

Is the below list, Ni, a representation of the Church numerals? I think it is but how do I prove it...if not, what is it...?

The terms Ni and N'i for each natural number i are defined as follows. (n and c are variables while i stands for a number.)

          N'0 = n
          N'i = c i N'i−1 for i > 0
          Ni = λc.λn.N'i for any i

any help much appreciated... Kind Regards

1 Answers1

0

Is the below list, Ni, a representation of the Church numerals?

No. This implementation contains $i$ as a natural number, but how do you represent that in Lambda Calculus?

$\qquad\begin{align}N'_0 &:= n\\N'_i&:=c\,\underline i\,N'_{i-1}&&\forall~i>0\\[2ex]N_0&:=\lambda c.\lambda n.n\\N_i&:=\lambda c.\lambda n.N'_i&&\forall ~i>0\\&=\lambda c.\lambda n.c\,\underline 1\,N'_{i-1}\\&=\lambda c.\lambda n.c\,\underline i(c\,\underline{i-1}(\ldots(c\,\underline 1\,n)\ldots)) \end{align}$

However you represent the natural numbers, this $N_i$ is a sequence of the first $i$ representations, where $c$ is a consecutively applied function, and $n$ the end-list-handler.

A classic example is if you pass $\operatorname{\sf times}$ as $c$ and $\underline 1$ as $n$, where $\operatorname{\sf times}\underline a\,\underline b=_{\!\beta}\underline{a\times b}$, then the result is the factorial of $i$, in whatever representation of the numbers you are using.

$$\begin{align}N_i \operatorname{times}\underline 1 &= \operatorname{times} \underline i(\operatorname{times}\underline{i-1}(\ldots(\operatorname{times} \underline 1\,\underline 1)\ldots))\\&=\underline {i\times((i-1)\times(\ldots(1\times 1)\ldots))}\\&=\underline {i!}\end{align}$$

Graham Kemp
  • 101
  • 1