Math 2.0

Mathematical logic and foundations Definition

Church encoding

Builds on Lambda calculusBeta reduction

Definition

Work in the untyped lambda calculus with beta conversion =β=_\beta. For terms F,XF, X define F0 X=XF^0\, X = X and Fn+1 X=F (Fn X)F^{n+1}\, X = F\, (F^n\, X). The Church numeral of n∈ℕn \in \N is the term n‾=λf. λx. fn x.\overline{n} = \lambda f.\, \lambda x.\, f^n\, x. The Church booleans are 𝖳=λx. λy. x\mathsf{T} = \lambda x.\, \lambda y.\, x and 𝖥=λx. λy. y\mathsf{F} = \lambda x.\, \lambda y.\, y.

A function φ ⁣:ℕk→ℕ\varphi \colon \N^k \to \N is λ\lambda-definable if some term FF satisfies the following. For all n1,…,nk∈ℕn_1, \ldots, n_k \in \N, F n1‾⋯nk‾=βφ(n1,…,nk)‾.F\, \overline{n_1} \cdots \overline{n_k} =_\beta \overline{\varphi(n_1, \ldots, n_k)}.

Remarks

Example: the successor function is λ\lambda-definable by 𝖲=λn. λf. λx. f (n f x)\mathsf{S} = \lambda n.\, \lambda f.\, \lambda x.\, f\, (n\, f\, x). Indeed, 𝖲 n‾→βλf. λx. f (n‾ f x)\mathsf{S}\, \overline{n} \to_\beta \lambda f.\, \lambda x.\, f\, (\overline{n}\, f\, x), and n‾ f x↠βfn x\overline{n}\, f\, x \twoheadrightarrow_\beta f^n\, x, so the result is λf. λx. fn+1 x=n+1‾\lambda f.\, \lambda x.\, f^{n+1}\, x = \overline{n+1}. Addition is defined by λm. λn. λf. λx. m f (n f x)\lambda m.\, \lambda n.\, \lambda f.\, \lambda x.\, m\, f\, (n\, f\, x) and multiplication by λm. λn. λf. m (n f)\lambda m.\, \lambda n.\, \lambda f.\, m\, (n\, f).

Non-example: λf. λx. x f\lambda f.\, \lambda x.\, x\, f is not a Church numeral. Its body applies xx to ff, not ff some number of times to xx.

The conditional "if bb then PP else QQ" is just b P Qb\, P\, Q, since 𝖳 P Q↠βP\mathsf{T}\, P\, Q \twoheadrightarrow_\beta P and 𝖥 P Q↠βQ\mathsf{F}\, P\, Q \twoheadrightarrow_\beta Q. By results of Church and Kleene, the λ\lambda-definable functions are exactly the total computable functions.

Reading path

To understand this page from the ground up, read these 3 pages in order. The foundations come first.

Show the path as a graph
Each page uses the pages above it. The colour of the bar on a box shows how strong the evidence is, and the box also gives it as text. The list has the same pages.
  • no evidence level
  1. Beta reduction concept
  2. Lambda calculus concept
  3. Church encoding definition

Further reading

  1. Web https://en.wikipedia.org/wiki/Church_encoding
About this page
Tag956GV08TFE
URIm2://956GV08TFE
Kinddefinition
WritingW0 stub
MSC03B40, 68N18
DefinesChurch encoding
UsesLambda calculus, Beta reduction
Changed3 November 2026

Markdown · JSON · Edit on GitHub

What this page needs for W1

  • an inventory row: the row of the inventory that the node accounts for (0 of 1)
  • a source with a locator (0 of 1)

The writing levels say how complete the text of a page is. They do not measure its truth.

What links here

No page links to this page yet.