Church–Rosser theorem

From HandWiki
Confluence.svg

In lambda calculus, the Church–Rosser theorem states that, when applying reduction rules to terms, the ordering in which the reductions are chosen does not make a difference to the eventual result.

More precisely, if there are two distinct reductions or sequences of reductions that can be applied to the same term, then there exists a term that is reachable from both results, by applying (possibly empty) sequences of additional reductions.[1] The theorem was proved in 1936 by Alonzo Church and J. Barkley Rosser, after whom it is named.

The theorem is symbolized by the adjacent diagram: If term a can be reduced to both b and c, then there must be a further term d (possibly equal to either b or c) to which both b and c can be reduced. Viewing the lambda calculus as an abstract rewriting system, the Church–Rosser theorem states that the reduction rules of the lambda calculus are confluent. As a consequence of the theorem, a term in the lambda calculus has at most one normal form, justifying reference to "the normal form" of a given normalizable term.

History

In 1936, Alonzo Church and J. Barkley Rosser proved that the theorem holds for β-reduction in the λI-calculus (in which every abstracted variable must appear in the term's body). The proof method is known as "finiteness of developments", and it has additional consequences such as the Standardization Theorem, which relates to a method in which reductions can be performed from left to right to reach a normal form (if one exists). The result for the pure untyped lambda calculus was proved by D. E. Schroer in 1965.[2]

Pure untyped lambda calculus

One type of reduction in the pure untyped lambda calculus for which the Church–Rosser theorem applies is β-reduction, in which a subterm of the form [math]\displaystyle{ ( \lambda x . t) s }[/math] is contracted by the substitution [math]\displaystyle{ t [ x := s] }[/math]. If β-reduction is denoted by [math]\displaystyle{ \rightarrow_\beta }[/math] and its reflexive, transitive closure by [math]\displaystyle{ \twoheadrightarrow_\beta }[/math] then the Church–Rosser theorem is that:[3]

[math]\displaystyle{ \forall M, N_1, N_2 \in \Lambda: \text{if}\ M\twoheadrightarrow_\beta N_1 \ \text{and}\ M\twoheadrightarrow_\beta N_2 \ \text{then}\ \exists X\in \Lambda: N_1\twoheadrightarrow_\beta X \ \text{and}\ N_2\twoheadrightarrow_\beta X }[/math]

A consequence of this property is that two terms equal in [math]\displaystyle{ \lambda\beta }[/math] must reduce to a common term:[4]

[math]\displaystyle{ \forall M, N\in \Lambda: \text{if}\ \lambda\beta \vdash M=N \ \text{then}\ \exists X: M \twoheadrightarrow_\beta X \ \text{and}\ N\twoheadrightarrow_\beta X }[/math]

The theorem also applies to η-reduction, in which a subterm [math]\displaystyle{ \lambda x.Sx }[/math] is replaced by [math]\displaystyle{ S }[/math]. It also applies to βη-reduction, the union of the two reduction rules.

Proof

For β-reduction, one proof method originates from William W. Tait and Per Martin-Löf.[5] Say that a binary relation [math]\displaystyle{ \rightarrow }[/math] satisfies the diamond property if:

[math]\displaystyle{ \forall M, N_1, N_2 \in \Lambda: \text{if}\ M\rightarrow N_1 \ \text{and}\ M\rightarrow N_2 \ \text{then}\ \exists X\in \Lambda: N_1\rightarrow X \ \text{and}\ N_2\rightarrow X }[/math]

Then the Church–Rosser property is the statement that [math]\displaystyle{ \twoheadrightarrow_\beta }[/math] satisfies the diamond property. We introduce a new reduction [math]\displaystyle{ \rightarrow_{\|} }[/math] whose reflexive transitive closure is [math]\displaystyle{ \twoheadrightarrow_\beta }[/math] and which satisfies the diamond property. By induction on the number of steps in the reduction, it thus follows that [math]\displaystyle{ \twoheadrightarrow_\beta }[/math] satisfies the diamond property.

The relation [math]\displaystyle{ \rightarrow_{\|} }[/math] has the formation rules:

  • [math]\displaystyle{ M \rightarrow_{\|} M }[/math]
  • If [math]\displaystyle{ M \rightarrow_{\|} M' }[/math] and [math]\displaystyle{ N \rightarrow_{\|} N' }[/math] then [math]\displaystyle{ \lambda x.M \rightarrow_{\|} \lambda x.M' }[/math] and [math]\displaystyle{ MN \rightarrow_{\|} M'N' }[/math] and [math]\displaystyle{ (\lambda x. M)N \rightarrow_{\|} M'[x:=N'] }[/math]

The η-reduction rule can be proved to be Church–Rosser directly. Then, it can be proved that β-reduction and η-reduction commute in the sense that:[6]

If [math]\displaystyle{ M \rightarrow_\beta N_1 }[/math] and [math]\displaystyle{ M \rightarrow_\eta N_2 }[/math] then there exists a term [math]\displaystyle{ X }[/math] such that [math]\displaystyle{ N_1 \rightarrow_\eta X }[/math] and [math]\displaystyle{ N_2\rightarrow_\beta X }[/math].

Hence we can conclude that βη-reduction is Church–Rosser.[7]

Normalisation

A reduction rule that satisfies the Church–Rosser property has the property that every term M can have at most one distinct normal form, as follows: if X and Y are normal forms of M then by the Church–Rosser property, they both reduce to an equal term Z. Both terms are already normal forms so [math]\displaystyle{ X=Z=Y }[/math].[4]

If a reduction is strongly normalising (there are no infinite reduction paths) then a weak form of the Church–Rosser property implies the full property (see Newman's lemma). The weak property, for a relation [math]\displaystyle{ \rightarrow }[/math], is:[8]

[math]\displaystyle{ \forall M, N_1, N_2\in \Lambda: }[/math] if [math]\displaystyle{ M\rightarrow N_1 }[/math] and [math]\displaystyle{ M\rightarrow N_2 }[/math] then there exists a term [math]\displaystyle{ X }[/math] such that [math]\displaystyle{ N_1\twoheadrightarrow X }[/math] and [math]\displaystyle{ N_2 \twoheadrightarrow X }[/math].

Variants

The Church–Rosser theorem also holds for many variants of the lambda calculus, such as the simply-typed lambda calculus, many calculi with advanced type systems, and Gordon Plotkin's beta-value calculus. Plotkin also used a Church–Rosser theorem to prove that the evaluation of functional programs (for both lazy evaluation and eager evaluation) is a function from programs to values (a subset of the lambda terms).

In older research papers, a rewriting system is said to be Church–Rosser, or to have the Church–Rosser property, when it is confluent.

Notes

References