beta-reduction (changes) in nLab
Showing changes from revision #7 to #8: Added | Removed | Changed
Context
Type theory
natural deduction metalanguage, practical foundations
type theory (dependent, intensional, observational type theory, homotopy type theory)
computational trinitarianism = \linebreak propositions as types +programs as proofs +relation type theory/category theory
β\beta-reduction
Idea
In type theory, β\beta-reduction is a conversion rule of “computation”, which generally replaces more complicated terms with simpler ones. It was originally identified in the lambda-calculus, where it contrasts with α\alpha-equivalence and η\eta-expansion; this is the version described below for function types. The analogous reduction for inductive types may also be known as ι\iota-reduction.
“Definition”
In its most general form, β\beta-reduction consists of rules which specify, for any given type TT, if we apply an “eliminator” for TT to the result of a “constructor” for TT, how to “evaluate” the result. We write
s→ βts \to_\beta t
if the term ss beta-reduces to the term tt. Sometimes we write s→ β *ts \to_\beta^* t if this reduction takes nn steps (leaving off the ** to denote n=1n=1). The relation “reduces to” generates an equivalence relation on the set of terms called beta equivalence and often denoted s= βts =_\beta t or s≡ βts \equiv_\beta t.
Function types
The most common (and original) example is when TT is a function type A→BA \to B.
In this case, the constructor of A→BA \to B is a λ\lambda-expression: given a term bb of type BB containing a free variable xx of type AA, then λx.b\lambda x.\, b is a term of type A→BA \to B.
The eliminator of A→BA \to B says that given a term ff of type A→BA \to B and a term aa of type AA, we can apply ff to aa to obtain a term f(a)f(a) of type BB.
Now if we first construct a term λx.b:A→B\lambda x.\, b\colon A \to B, and then apply this term to a:Aa\colon A, we obtain a term (λx.b)(a):B(\lambda x.\, b)(a)\colon B. The rule of β\beta-reduction then tells us that this term evaluates or computes or reduces to b[a/x]b[a/x], the result of substituting the term aa for the variable xx in the term bb.
See lambda calculus for more.
Product types
Although function types are the most publicized notion of β\beta-reduction, basically all types in type theory have a form of it. For instance, in the negative presentation of a product type A×BA \times B, the constructor is an ordered pair (a,b):A×B(a,b)\colon A \times B, while the eliminators are projections π 1\pi_1 and π 2\pi_2 which yield elements of AA or BB.
The beta reduction rules then say that if we first apply a constructor (a,b)(a,b), then apply an eliminator to this, the resulting terms π 1(a,b)\pi_1(a,b) and π 2(a,b)\pi_2(a,b) compute to aa and bb respectively.
Informal usage
Informally, one sometimes speaks of a “β\beta-reduction” of a definition or a proof to mean the elimination of levels of abstraction. For instance, if Theorem A is proven by invoking the existence of a green widget, which is proven by Lemma B, then a β\beta-reduced proof of Theorem A would proceed instead by using the specific green widget constructed in the proof of Lemma B.
It makes some sense to call this β\beta-reduction because under propositions as types, the proof of Lemma B would be a term lemmab:B\lemmab:B, whereas the proof of Theorem A would be an application (λx.theorema)(b)(\lambda x.\theorema)(b), where theorema\theorema is the proof of Theorem A using an unspecified green widget xx. This application (λx.theorema)(lemmab)(\lambda x.\theorema)(lemmab) can then be literally β\beta-reduced, in the above sense, to theorem[lemmab/x]\theorem[lemmab/x], in which the specific green widget constructed in the proof of Lemma B is used instead of the unspecified one xx.
Last revised on April 11, 2024 at 02:08:30. See the history of this page for a list of all contributions to it.