Cite

This course has no released version yet: the text at this address may change. Cite a released version when one exists.

/courses/models-of-computation/lambda-definability
@misc{models-of-computation-lambda-definability,
  title = {{Computing with λ-terms}},
  howpublished = {Lesson 11 of \emph{Models of computation}, Computability Theory course notes},
  url = {/courses/models-of-computation/lambda-definability},
  note = {Unreleased working version}
}

To cite a single statement, use the # link that appears next to its heading.

Lesson 11 of 13

Computing with λ-terms

Church numerals, arithmetic, booleans and pairs in the pure λ-calculus, Kleene's predecessor, fixed-point combinators, and the λ-definability of the partial recursive functions.

45 min7 questions
Models of computation · lesson 11 of 13
  1. Algorithms and partial functions
  2. Turing machines
  3. Programming Turing machines
  4. Register machines
  5. Primitive recursive functions
  6. Coding finite sequences
  7. The Ackermann function
  8. Minimization and partial recursive functions
  9. LOOP and WHILE programs
  10. The λ-calculus
  11. Computing with λ-terms
  12. Equivalence of the models
  13. The Church–Turing thesis

The pure λ-calculus has no built-in data. To compute functions on integers, we represent integers, booleans and pairs by λ-terms in normal form, and operations on them by terms which reduce correctly when applied to these representations.

11.1 Church numerals and arithmetic

Definition 11.1.#

For n∈Nn \in \nat, the Church numeral n‾\overline{n} is the term

n‾=λfx. fn(x),where f0(x)=x and fn+1(x)=f (fn(x)).\overline{n} = \lambda f x.\, f^n(x), \qquad\text{where } f^0(x) = x \text{ and } f^{n+1}(x) = f\,(f^n(x)).

Thus 0‾=λfx. x\overline{0} = \lambda f x.\, x, 1‾=λfx. f x\overline{1} = \lambda f x.\, f\, x, 2‾=λfx. f (f x)\overline{2} = \lambda f x.\, f\,(f\, x).

The numeral n‾\overline n is the operation “iterate nn times”: n‾ F A↠βFn(A)\overline{n}\, F\, A \twoheadrightarrow_\beta F^n(A) for all terms F,AF, A. Numerals are distinct normal forms, so by Corollary 10.8 they are pairwise not β-convertible.

Definition 11.2.#

A partial function f:Nk⇀Nf : \nat^k \rightharpoonup \nat is λ-definable if there is a term FF such that for all n⃗=(n1,…,nk)\vec n = (n_1, \dots, n_k):

  • if f(n⃗) ⁣ ⁣↓f(\vec n)\converge, then F n1‾⋯nk‾↠βf(n⃗)‾F\, \overline{n_1} \cdots \overline{n_k} \twoheadrightarrow_\beta \overline{f(\vec n)};
  • if f(n⃗) ⁣ ⁣↑f(\vec n)\diverge, then F n1‾⋯nk‾F\, \overline{n_1} \cdots \overline{n_k} has no normal form.

By Church–Rosser, the first condition determines f(n⃗)f(\vec n) uniquely.

Proposition 11.3.#

The following terms λ-define the successor, addition, multiplication and exponentiation:

succ=λnfx. f (n f x),plus=λmnfx. m f (n f x),mult=λmnf. m (n f),exp=λmn. n (mult m) 1‾.\begin{gathered} \mathsf{succ} = \lambda n f x.\, f\,(n\, f\, x), \\ \mathsf{plus} = \lambda m n f x.\, m\, f\,(n\, f\, x), \\ \mathsf{mult} = \lambda m n f.\, m\,(n\, f), \\ \mathsf{exp} = \lambda m n.\, n\,(\mathsf{mult}\, m)\, \overline 1. \end{gathered}

Here exp m‾ n‾↠βmn‾\mathsf{exp}\, \overline m\, \overline n \twoheadrightarrow_\beta \overline{m^n}.

succ n‾→βλfx. f (n‾ f x)↠βλfx. f (fn(x))=n+1‾\mathsf{succ}\, \overline n \to_\beta \lambda f x.\, f\,(\overline n\, f\, x) \twoheadrightarrow_\beta \lambda f x.\, f\,(f^n(x)) = \overline{n+1}.

plus m‾ n‾↠βλfx. m‾ f (n‾ f x)↠βλfx. fm(fn(x))=m+n‾\mathsf{plus}\, \overline m\, \overline n \twoheadrightarrow_\beta \lambda f x.\, \overline m\, f\,(\overline n\, f\, x) \twoheadrightarrow_\beta \lambda f x.\, f^m(f^n(x)) = \overline{m + n}.

mult m‾ n‾↠βλf. m‾ (n‾ f)\mathsf{mult}\, \overline m\, \overline n \twoheadrightarrow_\beta \lambda f.\, \overline m\,(\overline n\, f). Now n‾ f↠βλx. fn(x)\overline n\, f \twoheadrightarrow_\beta \lambda x.\, f^n(x), and iterating this function mm times gives λx. fmn(x)\lambda x.\, f^{mn}(x) after reduction; so the result is λfx. fmn(x)=mn‾\lambda f x.\, f^{mn}(x) = \overline{mn}.

exp m‾ n‾↠βn‾ (mult m‾) 1‾↠β(mult m‾)n(1‾)\mathsf{exp}\, \overline m\, \overline n \twoheadrightarrow_\beta \overline n\,(\mathsf{mult}\, \overline m)\, \overline 1 \twoheadrightarrow_\beta (\mathsf{mult}\, \overline m)^n(\overline 1), which reduces to mn‾\overline{m^n} by induction on nn, using the case of multiplication.

The shorter term λmn. n m\lambda m n.\, n\, m also works for n≥1n \geq 1, but 0‾ m‾↠βλx. x\overline 0\, \overline m \twoheadrightarrow_\beta \lambda x.\, x, which is not 1‾=λfx. f x\overline 1 = \lambda f x.\, f\, x (the two are only η-convertible).

11.2 Booleans, conditionals and pairs

Definition 11.4.#
true=λxy. x,false=λxy. y,iszero=λn. n (λz. false) true,\begin{gathered} \mathsf{true} = \lambda x y.\, x, \\ \mathsf{false} = \lambda x y.\, y, \\ \mathsf{iszero} = \lambda n.\, n\,(\lambda z.\, \mathsf{false})\, \mathsf{true}, \end{gathered}pair=λabf. f a b,fst=λp. p true,snd=λp. p false.\begin{gathered} \mathsf{pair} = \lambda a b f.\, f\, a\, b, \\ \mathsf{fst} = \lambda p.\, p\, \mathsf{true}, \\ \mathsf{snd} = \lambda p.\, p\, \mathsf{false}. \end{gathered}

A boolean selects one of its two arguments: true M N↠βM\mathsf{true}\, M\, N \twoheadrightarrow_\beta M and false M N↠βN\mathsf{false}\, M\, N \twoheadrightarrow_\beta N. Hence “if B then M else N\mathtt{if}\ B\ \mathtt{then}\ M\ \mathtt{else}\ N” is simply B M NB\, M\, N. The term iszero n‾\mathsf{iszero}\, \overline n iterates the constant function λz. false\lambda z.\, \mathsf{false} nn times on true\mathsf{true}: it reduces to true\mathsf{true} if n=0n = 0 and to false\mathsf{false} otherwise. Pairs store two terms: fst (pair M N)↠βM\mathsf{fst}\,(\mathsf{pair}\, M\, N) \twoheadrightarrow_\beta M and snd (pair M N)↠βN\mathsf{snd}\,(\mathsf{pair}\, M\, N) \twoheadrightarrow_\beta N.

11.3 The predecessor

Numerals iterate; they offer no direct way to “undo” an application of ff. Church himself was for a while unsure whether the predecessor was λ-definable. Kleene found a solution in 1932, based on the following idea: iterate on pairs, keeping the previous value.

Proposition 11.5 (Kleene).#

Let Φ=λp. pair (snd p) (succ (snd p))\Phi = \lambda p.\, \mathsf{pair}\,(\mathsf{snd}\, p)\,(\mathsf{succ}\,(\mathsf{snd}\, p)) and

pred=λn. fst (n Φ (pair 0‾ 0‾)).\mathsf{pred} = \lambda n.\, \mathsf{fst}\,\big(n\, \Phi\, (\mathsf{pair}\, \overline 0\, \overline 0)\big).

Then pred 0‾↠β0‾\mathsf{pred}\, \overline 0 \twoheadrightarrow_\beta \overline 0 and pred n+1‾↠βn‾\mathsf{pred}\, \overline{n + 1} \twoheadrightarrow_\beta \overline n.

By induction on nn, Φn(pair 0‾ 0‾)\Phi^n(\mathsf{pair}\, \overline 0\, \overline 0) reduces to pair n−˙1‾ n‾\mathsf{pair}\, \overline{n \dotminus 1}\, \overline{n}: this holds for n=0n = 0, and Φ\Phi applied to pair a‾ n‾\mathsf{pair}\, \overline{a}\, \overline{n} reduces to pair n‾ n+1‾\mathsf{pair}\, \overline{n}\, \overline{n + 1}. Since n‾ Φ A↠βΦn(A)\overline n\, \Phi\, A \twoheadrightarrow_\beta \Phi^n(A), the result follows by taking the first component.

11.4 Fixed-point combinators

The λ-calculus has no names: a term cannot refer to itself. Recursion is nonetheless available, thanks to fixed-point combinators.

Theorem 11.6 (Fixed point theorem for the λ-calculus).#

Let Y=λf. (λx. f (x x)) (λx. f (x x))\mathsf{Y} = \lambda f.\, (\lambda x.\, f\,(x\, x))\,(\lambda x.\, f\,(x\, x)). For every term FF, Y F=βF (Y F)\mathsf{Y}\, F =_\beta F\,(\mathsf{Y}\, F). Moreover, Turing’s combinator Θ=(λxy. y (x x y)) (λxy. y (x x y))\Theta = (\lambda x y.\, y\,(x\, x\, y))\,(\lambda x y.\, y\,(x\, x\, y)) satisfies the stronger property Θ F↠βF (Θ F)\Theta\, F \twoheadrightarrow_\beta F\,(\Theta\, F).

Proof of Theorem 11.6.

Let W=λx. F (x x)W = \lambda x.\, F\,(x\, x). Then Y F→βW W→βF (W W)\mathsf{Y}\, F \to_\beta W\, W \to_\beta F\,(W\, W), and also F (Y F)→βF (W W)F\,(\mathsf{Y}\, F) \to_\beta F\,(W\, W); so both sides reduce to F (W W)F\,(W\, W). For Θ\Theta, let A=λxy. y (x x y)A = \lambda x y.\, y\,(x\, x\, y), so that Θ=A A\Theta = A\, A; then Θ F=A A F→β(λy. y (A A y)) F→βF (A A F)=F (Θ F)\Theta\, F = A\, A\, F \to_\beta (\lambda y.\, y\,(A\, A\, y))\, F \to_\beta F\,(A\, A\, F) = F\,(\Theta\, F).

Fixed points allow recursive definitions. To obtain a term GG with G x=βM[G/g]G\, x =_\beta M[G/g] — a function defined in terms of itself — take G=Y (λgx. M)G = \mathsf{Y}\,(\lambda g x.\, M). For instance, the factorial is

fact=Y (λgn. (iszero n)1‾(mult n (g (pred n)))).\begin{aligned} \mathsf{fact} = \mathsf{Y}\,\big(\lambda g n.\ & (\mathsf{iszero}\, n) \\ & \overline 1 \\ & (\mathsf{mult}\, n\, (g\, (\mathsf{pred}\, n)))\big). \end{aligned}

11.5 λ-definability of the partial recursive functions

Theorem 11.7 (Kleene, 1936).#

Every partial recursive function is λ-definable.

Proof of Theorem 11.7.

We first treat the total recursive functions, which is Kleene’s 1936 theorem, and then reduce the partial case to it with the normal form theorem.

Total functions. By Corollary 8.7, every total recursive function has a derivation from the basic functions by composition, primitive recursion and minimization of regular functions, in which all the functions are total. We show by induction on such a derivation that each of its functions f:Nk→Nf : \nat^k \to \nat is λ-defined by some term FF; since ff is total, this means F n1‾⋯nk‾↠βf(n⃗)‾F\, \overline{n_1} \cdots \overline{n_k} \twoheadrightarrow_\beta \overline{f(\vec n)} for all n⃗\vec n. Below, n‾⃗\vec{\overline n} stands for n1‾⋯nk‾\overline{n_1} \cdots \overline{n_k}.

Basic functions. ZZ is λ-defined by λn. 0‾\lambda n.\, \overline 0, SS by succ\mathsf{succ}, and pikp^k_i by λx1⋯xk. xi\lambda x_1 \cdots x_k.\, x_i.

Composition. If H,G1,…,GmH, G_1, \dots, G_m λ-define h,g1,…,gmh, g_1, \dots, g_m, then F=λx⃗. H (G1 x⃗)⋯(Gm x⃗)F = \lambda \vec x.\, H\,(G_1\, \vec x) \cdots (G_m\, \vec x) satisfies F n‾⃗↠βH g1(n⃗)‾⋯gm(n⃗)‾↠βf(n⃗)‾F\, \vec{\overline n} \twoheadrightarrow_\beta H\, \overline{g_1(\vec n)} \cdots \overline{g_m(\vec n)} \twoheadrightarrow_\beta \overline{f(\vec n)}.

Primitive recursion. If GG and HH λ-define gg and hh, then f(x⃗,y)f(\vec x, y) is λ-defined by iterating on pairs (counter, value), as for the predecessor:

F=λx⃗ y. snd (y (λp. pair (succ (fst p)) (H x⃗ (fst p) (snd p)))(pair 0‾ (G x⃗))).\begin{aligned} F = \lambda \vec x\, y.\, \mathsf{snd}\,\Big(y\ & \big(\lambda p.\, \mathsf{pair}\,(\mathsf{succ}\,(\mathsf{fst}\, p))\,(H\, \vec x\,(\mathsf{fst}\, p)\,(\mathsf{snd}\, p))\big) \\ & (\mathsf{pair}\, \overline 0\,(G\, \vec x))\Big). \end{aligned}

Let Ψ\Psi be the term λp. ⋯\lambda p.\, \cdots above with n‾⃗\vec{\overline n} substituted for x⃗\vec x. By induction on jj, Ψj(pair 0‾ (G n‾⃗))\Psi^j(\mathsf{pair}\, \overline 0\,(G\, \vec{\overline n})) reduces to pair j‾ f(n⃗,j)‾\mathsf{pair}\, \overline j\, \overline{f(\vec n, j)}: for j=0j = 0 because G n‾⃗↠βg(n⃗)‾G\, \vec{\overline n} \twoheadrightarrow_\beta \overline{g(\vec n)}, and for j+1j + 1 because Ψ (pair j‾ v‾)↠βpair j+1‾ h(n⃗,j,v)‾\Psi\,(\mathsf{pair}\, \overline j\, \overline v) \twoheadrightarrow_\beta \mathsf{pair}\, \overline{j + 1}\, \overline{h(\vec n, j, v)}. Since y‾ Ψ A↠βΨy(A)\overline y\, \Psi\, A \twoheadrightarrow_\beta \Psi^y(A), taking the second component gives F n‾⃗ y‾↠βf(n⃗,y)‾F\, \vec{\overline n}\, \overline y \twoheadrightarrow_\beta \overline{f(\vec n, y)}. (For k=0k = 0, G x⃗G\, \vec x is replaced by the numeral of the constant.)

Regular minimization. Let f(x⃗)=μz [g(x⃗,z)=0]f(\vec x) = \mu z\, [g(\vec x, z) = 0] with gg total and regular, λ-defined by GG. With Turing’s combinator, let

search=Θ (λs x⃗ z. (iszero (G x⃗ z))  z  (s x⃗ (succ z))),F=λx⃗. search x⃗ 0‾.\begin{gathered} \mathsf{search} = \Theta\,\big(\lambda s\, \vec x\, z.\, (\mathsf{iszero}\,(G\, \vec x\, z))\; z\; (s\, \vec x\,(\mathsf{succ}\, z))\big), \\ F = \lambda \vec x.\, \mathsf{search}\, \vec x\, \overline 0. \end{gathered}

By Theorem 11.6, search n‾⃗ z‾↠β(iszero (G n‾⃗ z‾))  z‾  (search n‾⃗ (succ z‾))\mathsf{search}\, \vec{\overline n}\, \overline z \twoheadrightarrow_\beta (\mathsf{iszero}\,(G\, \vec{\overline n}\, \overline z))\; \overline z\; (\mathsf{search}\, \vec{\overline n}\,(\mathsf{succ}\, \overline z)). If g(n⃗,z)=0g(\vec n, z) = 0, this reduces to z‾\overline z; otherwise it reduces to search n‾⃗ (succ z‾)\mathsf{search}\, \vec{\overline n}\,(\mathsf{succ}\, \overline z), hence to search n‾⃗ z+1‾\mathsf{search}\, \vec{\overline n}\, \overline{z + 1}. By induction, F n‾⃗↠βsearch n‾⃗ z‾F\, \vec{\overline n} \twoheadrightarrow_\beta \mathsf{search}\, \vec{\overline n}\, \overline z for every z≤z0=f(n⃗)z \leq z_0 = f(\vec n), which exists by regularity, and finally F n‾⃗↠βz0‾F\, \vec{\overline n} \twoheadrightarrow_\beta \overline{z_0}.

Partial functions. For partial functions the constructions above are not adequate as they stand. For instance, the term for composition may have a normal form even if some gi(x⃗)g_i(\vec x) diverges, when HH discards its argument — whereas f(x⃗)f(\vec x) must then be undefined. The normal form theorem avoids this problem: by Theorem 8.6, proved in the lesson Equivalence of the models by arithmetization of Turing machines (without using the λ-calculus), f(x⃗)≃U(μs [g(x⃗,s)=0])f(\vec x) \simeq U(\mu s\, [g(\vec x, s) = 0]) where g(x⃗,s)=sg‾(χTk(e,x⃗,s))g(\vec x, s) = \overline{\mathrm{sg}}(\chi_{T_k}(e, \vec x, s)) and UU are primitive recursive. Let GG and U′U' λ-define gg and UU, let search\mathsf{search} be built from GG as above, and let

F=λx⃗. (search x⃗ 0‾) I I (U′ (search x⃗ 0‾)).F = \lambda \vec x.\, (\mathsf{search}\, \vec x\, \overline 0)\, \mathsf I\, \mathsf I\, \big(U'\,(\mathsf{search}\, \vec x\, \overline 0)\big).

If f(n⃗) ⁣ ⁣↓f(\vec n)\converge, the search succeeds at some s0s_0: then search n‾⃗ 0‾↠βs0‾\mathsf{search}\, \vec{\overline n}\, \overline 0 \twoheadrightarrow_\beta \overline{s_0} as in the total case, s0‾ I I↠βIs0(I)↠βI\overline{s_0}\, \mathsf I\, \mathsf I \twoheadrightarrow_\beta \mathsf I^{s_0}(\mathsf I) \twoheadrightarrow_\beta \mathsf I, and F n‾⃗↠βI (U′ s0‾)↠βU(s0)‾=f(n⃗)‾F\, \vec{\overline n} \twoheadrightarrow_\beta \mathsf I\,\big(U'\, \overline{s_0}\big) \twoheadrightarrow_\beta \overline{U(s_0)} = \overline{f(\vec n)}. If f(n⃗) ⁣ ⁣↑f(\vec n)\diverge, it remains to show that F n‾⃗F\, \vec{\overline n} has no normal form; by confluence, it suffices to show this for its reduct (search n‾⃗ 0‾) I I (U′ (search n‾⃗ 0‾))(\mathsf{search}\, \vec{\overline n}\, \overline 0)\, \mathsf I\, \mathsf I\, (U'\,(\mathsf{search}\, \vec{\overline n}\, \overline 0)). Here search n‾⃗ 0‾\mathsf{search}\, \vec{\overline n}\, \overline 0 reduces to search n‾⃗ z‾\mathsf{search}\, \vec{\overline n}\, \overline z for every zz, and one shows that it has no head normal form: it reduces to no term of the form λy1⋯yj. y M1⋯Mr\lambda y_1 \cdots y_j.\, y\, M_1 \cdots M_r (one says that it is unsolvable). Moreover, if MM has no head normal form, then neither has M P1⋯PrM\, P_1 \cdots P_r, which therefore has no normal form. We admit these two facts about head normal forms; they are proved in Barendregt’s monograph, in the chapters on solvability and on the representation of computable functions, where this construction is carried out in detail.

Theorem 11.8.#

Every λ-definable partial function is partial recursive.

Proof of Theorem 11.8.

Code λ-terms by integers, for instance using de Bruijn indices to avoid α-equivalence issues and the sequence coding of the lesson Coding finite sequences. The following are primitive recursive on codes (we omit the routine verifications): substitution, the predicate ”MM is in normal form”, the function computing the result of one normal order step, its tt-th iterate N(M,t)N(M, t), the code of n‾\overline n as a function of nn, and the predicate ”MM is a numeral” together with the extraction of its value. If FF λ-defines ff, let Mn⃗M_{\vec n} be the code of F n1‾⋯nk‾F\, \overline{n_1} \cdots \overline{n_k}; then

f(n⃗)≃val(N(Mn⃗, μt [N(Mn⃗,t) is in normal form])).f(\vec n) \simeq \mathrm{val}\big(N(M_{\vec n},\ \mu t\, [N(M_{\vec n}, t) \text{ is in normal form}])\big).

By Theorem 10.9, the search terminates exactly when F n1‾⋯nk‾F\, \overline{n_1} \cdots \overline{n_k} has a normal form, which is then f(n⃗)‾\overline{f(\vec n)}.

Thus λ-definability coincides with partial recursiveness, and the next lesson shows that both coincide with Turing computability. These equivalences were established by Kleene (1936) and Turing (1936–1937). Together with Turing’s analysis of mechanical computation, they turned Church’s proposal — identifying effective computability with λ-definability — into a widely accepted thesis (see the lesson The Church–Turing thesis).

11.6 Exercises

Exercise 11.9 ★.

Define λ-terms and\mathsf{and}, or\mathsf{or} and not\mathsf{not} on the booleans true\mathsf{true}, false\mathsf{false}, and check them.

Solution

not=λb. b false true\mathsf{not} = \lambda b.\, b\, \mathsf{false}\, \mathsf{true}, and=λab. a b false\mathsf{and} = \lambda a b.\, a\, b\, \mathsf{false}, or=λab. a true b\mathsf{or} = \lambda a b.\, a\, \mathsf{true}\, b. For instance and true B↠βtrue B false↠βB\mathsf{and}\, \mathsf{true}\, B \twoheadrightarrow_\beta \mathsf{true}\, B\, \mathsf{false} \twoheadrightarrow_\beta B and and false B↠βfalse\mathsf{and}\, \mathsf{false}\, B \twoheadrightarrow_\beta \mathsf{false}.

Exercise 11.10 ★.

Define truncated subtraction minus\mathsf{minus} and the equality test eq\mathsf{eq} on numerals.

Solution

minus=λmn. n pred m\mathsf{minus} = \lambda m n.\, n\, \mathsf{pred}\, m iterates the predecessor nn times on mm. Then leq=λmn. iszero (minus m n)\mathsf{leq} = \lambda m n.\, \mathsf{iszero}\,(\mathsf{minus}\, m\, n) and eq=λmn. and (leq m n) (leq n m)\mathsf{eq} = \lambda m n.\, \mathsf{and}\,(\mathsf{leq}\, m\, n)\,(\mathsf{leq}\, n\, m).

Exercise 11.11 ★★.

Show that fact 3‾↠β6‾\mathsf{fact}\, \overline 3 \twoheadrightarrow_\beta \overline 6 under normal order reduction, and explain what goes wrong with applicative order.

Solution

Write fact=Y F\mathsf{fact} = \mathsf{Y}\, F. By the fixed point property, fact 3‾=βF fact 3‾↠β(iszero 3‾) 1‾ (mult 3‾ (fact (pred 3‾)))\mathsf{fact}\, \overline 3 =_\beta F\, \mathsf{fact}\, \overline 3 \twoheadrightarrow_\beta (\mathsf{iszero}\, \overline 3)\, \overline 1\, (\mathsf{mult}\, \overline 3\, (\mathsf{fact}\,(\mathsf{pred}\, \overline 3))), which reduces to mult 3‾ (fact 2‾)\mathsf{mult}\, \overline 3\, (\mathsf{fact}\, \overline 2); continuing down to fact 0‾=β1‾\mathsf{fact}\, \overline 0 =_\beta \overline 1 gives fact 3‾=β6‾\mathsf{fact}\, \overline 3 =_\beta \overline 6. Since 6‾\overline 6 is a normal form, fact 3‾↠β6‾\mathsf{fact}\, \overline 3 \twoheadrightarrow_\beta \overline 6 by Corollary 10.8, and normal order reaches it by Theorem 10.9. Normal order contracts the conditional before evaluating the recursive call. Applicative order would first try to normalize the subterm Y F\mathsf{Y}\, F, whose reduction Y F→W W→F (W W)→F (F (W W))→⋯\mathsf{Y}\, F \to W\, W \to F\,(W\, W) \to F\,(F\,(W\, W)) \to \cdots never terminates.

11.7 Notes and references

The definability of the predecessor was found by Kleene in 1932, and the equivalence between λ-definability and general recursiveness (for total functions) was proved by Kleene in 1936. The combinator Θ\Theta is due to Turing (1937).

  • S. C. Kleene, λ-definability and recursiveness, Duke Mathematical Journal 2 (1936), 340–353.
  • A. M. Turing, The p-function in λ-K-conversion, Journal of Symbolic Logic 2 (1937), 164.
  • H. P. Barendregt, The Lambda Calculus: Its Syntax and Semantics, North-Holland, 1984.