Thesis. The \(\lambda \)-calculus is the internal language of currying, the adjunction
Terms and reduction.
abstraction \(\lambda x.M\) is the transpose and application is evaluation;
\(\beta \)-reduction is the triangle identity of the adjunction and \(\eta \) is uniqueness of the transpose;
the identity function \(\lambda x.x\) is the transpose of the projection, the identity arrow \(A\to A\).
Data. Numbers are iterations (Church numerals, the free monoid \(\{1\}^{*}\)). Booleans are the two projections, and branching is elimination on \(\mathbf 2\).
Fixed points. Self-application \(xx\) is the diagonal. In the untyped calculus every term has a fixed point, by the \(Y\) combinator, which is Lawvere’s fixed-point theorem applied in the positive direction. The same theorem in the negative direction gives Russell, Cantor and Gödel. So the untyped calculus has no consistent reading as logic, while typing forbids \(xx\) and makes every term terminate.
Curry–Howard. Typed terms are proofs: \(\rightarrow \), \(\times \), \(+\), \(0\) are \(\Rightarrow \), \(\wedge \), \(\vee \), \(\bot \). \(\beta \)-reduction is cut elimination (Section 364); dependent types add \(\forall \), \(\exists \) and the identity type with \(\mathsf {refl}\).
Computability. \(\lambda \)-definable, Turing-computable and general recursive functions coincide; this is a theorem. That they capture all effective computation is the Church–Turing thesis.
Syntax.
\(\alpha \)-equivalence. Terms differing only in the names of bound variables are identified, \(\lambda x.M=\lambda y.M[x:=y]\) for fresh \(y\). A bound variable is a position, not a name.
Substitution. \(M[x:=N]\) replaces the free occurrences of \(x\) in \(M\) by \(N\), renaming bound variables of \(M\) to avoid capturing the free variables of \(N\):
Reductions.
Categorical reading. In a cartesian closed category, a term \(M\) with free variable \(x:A\) in context \(\Gamma \) is an arrow \(m:\Gamma \times A\to B\). Then:
\(\lambda x.M\) is its transpose \(\Lambda m:\Gamma \to B^A\);
application is composition with evaluation \(\mathrm {ev}:B^A\times A\to B\), the counit;
\(\beta \) is the triangle identity \(\mathrm {ev}\circ (\Lambda m\times \mathrm {id})=m\): transposing and then evaluating returns the original arrow;
\(\eta \) is uniqueness of the transpose, \(\Lambda (\mathrm {ev}\circ (f\times \mathrm {id}))=f\).
Identity. The projection \(\pi _2:\Gamma \times A\to A\) transposes to \(\lambda x.x:\Gamma \to A^A\), which names \(\mathrm {id}_A\):
Examples.
Church–Rosser theorem. If \(M\twoheadrightarrow N_1\) and \(M\twoheadrightarrow N_2\), there is \(P\) with \(N_1\twoheadrightarrow P\) and \(N_2\twoheadrightarrow P\).
Proof sketch (Tait–Martin-Löf). Define parallel reduction \(\Rightarrow \), which contracts any set of redexes at once. It satisfies the diamond property, which follows from the substitution lemma
Consequence. A term has at most one normal form. Evaluation order (eager as in Python, lazy as in Haskell) can change whether a normal form is reached, but not which one.
Church numerals.
Arithmetic.
Addition concatenates iterations, multiplication composes them, and exponentiation iterates iteration. Predecessor is definable by iterating on pairs, \((k,k+1)\mapsto (k+1,k+2)\), and reading off the first component.
Booleans.
Pairs.
Self-application. \(xx\) applies a term to itself: the diagonal, \(x\mapsto (x,x)\) followed by evaluation. The term
The \(Y\) combinator.
Lawvere. Let \(D\) be a model of the untyped calculus, an object with \(D\cong D^D\), as in Scott’s domains. Then \(D\to D^D\) is surjective, and Lawvere’s theorem (Section 350) gives every \(f:D\to D\) a fixed point. \(Y\) is that fixed point: \(\lambda x.f(xx)\) is the map \(x\mapsto g(e(x)(x))\) of the proof.
Two directions of one theorem.
| Setting | Surjection \(X\to Y^X\)? | Conclusion |
| untyped \(\lambda \), \(D\cong D^D\) | yes | every \(f\) has a fixed point (\(Y\)) |
| sets, \(\{0,1\}^X\) | no, \(\neg \) has no fixed point | Russell, Cantor |
| arithmetic, provability | diagonal lemma | Gödel, Tarski |
Least fixed points. In a Scott domain, \(Y\,f\) is the least fixed point \(\bigsqcup _nf^n(\bot )\) (Kleene). The supremum over all \(n\) is a limit of an \(\omega \)-chain, so this form is conditional on the declaration of Section 458; the equation \(Y\,F=_\beta F(Y\,F)\) itself is finite.
No consistent logic. Reading untyped terms as propositions is inconsistent. With implication \(\supset \), set \(C=Y(\lambda x.\,x\supset P)\), so \(C=C\supset P\). Then \(C\supset C\) gives \(C\supset (C\supset P)\), hence \(C\supset P\), hence \(C\), hence \(P\), for arbitrary \(P\) (Curry’s paradox). The fixed point that makes the calculus universal is the one that defeats it as logic.
Simple types.
No self-application. \(xx\) has no type: if \(x:A\) and \(x:A\to B\), then \(A=A\to B\), which no finite type satisfies. \(\Omega \) and \(Y\) are untypable.
Strong normalisation (Tait). Every typed term reaches a normal form by every reduction sequence. Define, by induction on types, the reducible terms: at a base type, the strongly normalising terms; at \(A\to B\), terms sending reducible arguments to reducible results. Then every reducible term is strongly normalising, and every typed term is reducible.
Consistency. There is no closed normal term of the empty type, so the corresponding logic is consistent. Typing removes the surjection \(D\to D^D\), and with it the general fixed point.
| Logic | Type theory | Category |
| proposition \(A\) | type \(A\) | object |
| proof of \(A\Rightarrow B\) | term \(\lambda x.M:A\to B\) | arrow, exponential |
| \(A\wedge B\) | product \(A\times B\) | right adjoint of \(\Delta \) |
| \(A\vee B\) | sum \(A+B\) | left adjoint of \(\Delta \) |
| \(\bot \) | empty type \(0\) | initial object |
| \(A\Rightarrow A\) | \(\lambda x.x:A\to A\) | \(\mathrm {id}_A\) |
| detour elimination, cut | \(\beta \)-reduction | triangle identity |
| uniqueness of proofs | \(\eta \) | uniqueness of transpose |
| normal proof | normal form | — |
Simply typed \(\lambda \)-calculus with products and sums, intuitionistic propositional natural deduction, and bicartesian closed categories are three presentations of one structure.
Extensions.
Polymorphism. System F, with types \(\forall X.A\), corresponds to second-order intuitionistic logic and is strongly normalising (Girard); its representable functions are those provably total in second-order arithmetic.
Dependent types. \(\Pi _{x:A}B(x)\) and \(\Sigma _{x:A}B(x)\) correspond to \(\forall \) and \(\exists \), the adjoints of substitution. The identity type \(a=_Aa'\), with \(\mathsf {refl}_a:a=a\), is equality as a type (Section 343).
Classical logic. Control operators such as \(\mathsf {call/cc}\) have the type of Peirce’s law \(((A\to B)\to A)\to A\) (Griffin). Excluded middle corresponds to capturing and re-entering continuations, the involution of LK restored as a control effect.
Two identities. In proof assistants, \(\mathtt {id}:A\to A\) (the function \(\lambda x.x\)) and \(\mathtt {rfl}:a=a\) (Lean), or \(\mathtt {eq\_refl}\) (Coq), are different terms of different types: the first proves the implication \(A\Rightarrow A\); the second inhabits the identity type. Both are forms of the identity: one as an arrow, one as an identification.
Theorem (Kleene, Church, Turing). For functions \(\mathbb N\to \mathbb N\), the following coincide:
\(\lambda \)-definable on Church numerals;
computable by a Turing machine;
general recursive.
Each formalism simulates the others: a Turing machine configuration is encoded as a \(\lambda \)-term, and \(\beta \)-reduction steps are simulated by a machine.
Church–Turing thesis. These functions are exactly the effectively computable ones. This is a thesis about an informal notion; the agreement of the three formal definitions is its evidence.
Undecidability. No \(\lambda \)-term decides whether two terms have the same normal form. By the Scott–Curry theorem, any nontrivial set of terms closed under \(\beta \)-equality is undecidable, the analogue of the halting problem. The proof is again a diagonal: a decider \(d\) would yield a term that does the opposite of what \(d\) predicts about it.
| Language | Function | Evaluation |
| Haskell | \x -> x + 1 | lazy, typed |
| OCaml | fun x -> x + 1 | eager, typed |
| Python | lambda x: x + 1 | eager, dynamically typed |
| JavaScript | (x) => x + 1 | eager, dynamically typed |
| Lean, Coq | fun x => x + 1 | dependent types, normalising core |
A closure is a term \(\lambda x.M\) together with values for the free variables of \(M\), an element of \(B^A\) paired with its context. Recursion in general-purpose languages is the fixed point that typed cores exclude or restrict.
| Item | Form | From |
| abstraction | \(\lambda x.M\) | transpose (currying) |
| application | \(M\,N\) | evaluation, counit |
| \(\beta \) | \((\lambda x.M)N\to M[x:=N]\) | triangle identity |
| \(\eta \) | \(\lambda x.Mx\to M\) | uniqueness of transpose |
| identity function | \(\lambda x.x:A\to A\) | \(\mathrm {id}_A\) |
| substitution | capture-avoiding | transport |
| confluence | unique normal forms | parallel reduction |
| numerals | \(\lambda f.\lambda x.f^nx\) | free monoid |
| Booleans | projections, \(b\,M\,N\) | elimination on \(\mathbf 2\) |
| self-application | \(xx\), \(\Omega \to \Omega \) | diagonal |
| \(Y\) | \(YF=F(YF)\) | Lawvere, positive direction |
| Curry’s paradox | untyped logic inconsistent | same fixed point |
| typing | \(xx\) untypable | no \(D\cong D^D\) |
| normalisation | Tait | reducibility |
| Curry–Howard | proofs \(=\) terms | bicartesian closed |
| dependent types | \(\Pi ,\Sigma \), \(\mathsf {refl}\) | adjoints, identity type |
| classical | \(\mathsf {call/cc}\) : Peirce | continuations |
| computability | \(\lambda =\) Turing \(=\) recursive | theorem |
| Church–Turing | all effective computation | thesis |
| undecidability | Scott–Curry | diagonal |
The twentieth-century dispute between Hilbert’s formalism and Brouwer’s intuitionism reduces to a single partition:
1. The dispute.
| Hilbert | Brouwer | |
| Law of Excluded Middle | \(A \vee \neg A = 1\) | \(A \vee \neg A \neq 1\) |
| Double negation | \(\neg \neg A = A\) | \(\neg \neg A \neq A\) |
| Foundation | Formal axioms | Mental construction |
2. Resolution: both are correct.
The apparent contradiction dissolves under the observer partition:
Hilbert describes \(T = 1\) from the outside. Brouwer describes \(O < T\) from the inside. Both are correct — they are two finitions of the same structure:
3. Double negation as \(O < T\).
In intuitionistic logic:
4. The dispute itself is \(A + \neg A = 1\).
Neither position is wrong. Each is the correct description of one side of the partition. The dispute could not be resolved within either framework because each framework was describing a different finition of the same \(T = 1\).
5. Topos theory connection.
In a Topos \(\mathcal {E}\), the subobject classifier \(\Omega \) instantiates \(A + \neg A = 1\):
One-line summary.
Remark 367.1 (The Declaration of \(A\) Generates \(\neg A\)).
Every declaration of \(A\) automatically generates \(\neg A\). The act of drawing a boundary simultaneously creates an inside and an outside:
Every dichotomy is one structure.
Again, Genesis 1 as partition declaration.
Remark 367.2. Every formal system, every physical theory, every philosophical dispute, and every act of perception begins with a single declaration: \(A\). That declaration generates \(\neg A\). Their sum is \(T = 1\). \(T = 1\) was never divided. The declaration only revealed the partition already present in \(A = A\).