User menu

User login

You are here

Primary tabs

diamond lemma

The diamond lemmas constitute a class of results about the existence
of a unique normal form. Diamond lemmas exist in many diverse areas of
mathematics, and as a result their technical contents can be quite
different, but they are easily recognisable from their overall
structure and basic idea — the “diamond” condition
from which they inherit their name.

where →*superscriptnormal-→\stackrel{*}{\rightarrow} denotes the reflexive transitive closure of →normal-→\rightarrow. This is the “diamond” from which the result derives its
name — not crystallised carbon, but merely a square standing on one
corner. In relation to this picture, what the condition says is that
whenever one has a,b,c∈XabcXa,b,c\in X forming the top two sides of such a
diagram, there is a fourth corner d∈XdXd\in X which completes the
diamond.

The typical case to which one applies this theorem is that XXX is a
set of formal terms on which one wishes to define an equivalence
relation∼similar-to\sim. The →normal-→\rightarrow relation encodes a set of
“elementary” equivalences — an example in standard algebra of
such an elementary equivalence might be the instancea⁢(b+c)→a⁢b+a⁢cnormal-→abcabaca(b+\nobreak c)\rightarrow ab+ac of the distributivityaxiom — that generate the wanted ∼similar-to\sim. It is
techincally possible to define the equivalence ∼similar-to\sim as the
reflexive–transitive–symmetric closure of →normal-→\rightarrow, but
since XXX is typically infinite that definition does not lead to
an effective method for determining whether x∼ysimilar-toxyx\sim y. However
when the relation →normal-→\rightarrowsatisfies the conditions in
Theorem 1, there does exist an algorithm which given
→normal-→\rightarrow determines whether two arbitrary elements are related
by ∼similar-to\sim.

In a computational setting, the interpretation of x→ynormal-→xyx\rightarrow y
is usually that there exists a “one-step simplification” that
converts the expressionxxx to the expression yyy. The corresponding
interpretation of x→*ysuperscriptnormal-→xyx\stackrel{*}{\rightarrow}y is thus that
there exists a finite sequence of “simplifications” that converts
xxx to yyy. The formal term used for “simplifications” in this
sense is reductions, so x→*ysuperscriptnormal-→xyx\stackrel{*}{\rightarrow}y is
read as “xxx reduces to yyy” or “xxx can be reduced to yyy”.

The theorem has several immediate
applications — first of all that there is a unique functionN:X⟶Xnormal-:Nnormal-⟶XXN\colon X\longrightarrow X which sends arbitrary elements of
XXX to their normal forms — and this leads to a test for whether
arbitrary elements are equivalent.

Lemma 1.

Let XXX be a set and →normal-→\rightarrow a binary relation on XXX such
that all elements of XXX has a unique normal form with respect to
→normal-→\rightarrow. Denote by ∼similar-to\sim the reflexive transitive symmetric
closure of →normal-→\rightarrow and denote by NNN the function
X⟶Xnormal-⟶XXX\longrightarrow X which sends every element to its normal
form with respect to →normal-→\rightarrow. Then for all x,y∈XxyXx,y\in X,

x∼yif and only ifN⁢(x)=N⁢(y)⁢.formulae-sequencesimilar-toxyif and only ifNxNy.x\sim y\quad\text{if and only if}\quad N(x)=N(y)\text{.}

(1)

Proof.

Denote by →*superscriptnormal-→\stackrel{*}{\rightarrow} the reflexive–transitive
closure of →normal-→\rightarrow and denote by ↔normal-↔\leftrightarrow the
symmetrisation of →normal-→\rightarrow. If N⁢(x)=N⁢(y)NxNyN(x)=N(y) then obviously
x→*N⁢(x)=N⁢(y)←*ysuperscriptnormal-→xNxNysuperscriptnormal-←yx\stackrel{*}{\rightarrow}N(x)=N(y)\stackrel{*}{\leftarrow}y and thus x∼N⁢(x)∼ysimilar-toxNxsimilar-toyx\sim N(x)\sim y as claimed. If converselyx∼ysimilar-toxyx\sim y then there must exist some sequence

where z0,…,zn∈Xsubscriptz0normal-…subscriptznXz_{0},\ldots,z_{n}\in X, z0=xsubscriptz0xz_{0}=x, and zn=ysubscriptznyz_{n}=y. For every
zksubscriptzkz_{k} one of zk→zk+1normal-→subscriptzksubscriptzk1z_{k}\rightarrow z_{{k+1}} and zk←zk+1normal-←subscriptzksubscriptzk1z_{k}\leftarrow z_{{k+1}} must hold. In the former case zk→*zk+1→*N⁢(zk+1)superscriptnormal-→subscriptzksubscriptzk1superscriptnormal-→Nsubscriptzk1z_{k}\stackrel{*}{\rightarrow}z_{{k+1}}\stackrel{*}{\rightarrow}N(z_{{k+1}}) and thus by transitivityzk→*N⁢(zk+1)superscriptnormal-→subscriptzkNsubscriptzk1z_{k}\stackrel{*}{\rightarrow}N(z_{{k+1}}), but this meansN⁢(zk+1)Nsubscriptzk1N(z_{{k+1}}) is a normal form also
of zksubscriptzkz_{k}. In the latter case one similarly shows that N⁢(zk)NsubscriptzkN(z_{k}) is a
normal form of zk+1subscriptzk1z_{{k+1}}. Either way it follows from the uniqueness
of the normal form that N⁢(zk)=N⁢(zk+1)NsubscriptzkNsubscriptzk1N(z_{k})=N(z_{{k+1}}). Thus N⁢(z0)=N⁢(z1)=⋯=N⁢(zn-1)=N⁢(zn)Nsubscriptz0Nsubscriptz1normal-⋯Nsubscriptzn1NsubscriptznN(z_{0})=N(z_{1})=\cdots=N(z_{{n-1}})=N(z_{n}) and hence N⁢(x)=N⁢(y)NxNyN(x)=N(y) as
claimed.
∎

Another application of normal forms is to serve as representatives of
the equivalence classes of XXX. Many mathematical constructions of
algebraic structures (e.g. that of a quotient of a group) end up
producing a set X/∼fragmentsXsimilar-toX/{\sim} of equivalence classes of some given set
XXX, but these are as a rule unfeasible for computational purposes.
What one can do instead is to choose an element from each equivalence
class and use these as representatives of their equivalence classes.
When normal forms are known to be unique, there trivially exists a
bijection from

Xnf={x∈X is on normal form}fragmentssubscriptXnffragmentsnormal-{xXxxx is on normal formnormal-}X_{{\mathrm{nf}}}=\left\{\,x\in X\,\,\vrule\,\,\text{$x$ is on normal form}\,\right\}

to X/∼fragmentsXsimilar-toX/{\sim} given by x↦[x]∼maps-toxsubscriptxsimilar-tox\mapsto[x]_{\sim}, and its inverse can
thanks to Lemma1 be defined in terms of the normal
form mapNNN as [x]∼↦N⁢(x)maps-tosubscriptxsimilar-toNx[x]_{\sim}\mapsto N(x).

How does one know that the normal form map NNN is effective, though?
This is because of the terminatingproperty on the binary relation
in Theorem 1.

The primaryconsequence of being terminating is that
→*superscriptnormal-→\stackrel{*}{\rightarrow} is well-founded, and it is no surprise that Theorem 1 is proved using well-founded induction. Being terminating is also what guarantees that the following algorithm “terminates”.

Algorithm 1 (Normal form).

Let XXX be a set and →normal-→\rightarrow a strict binary relation on XXX
which satisfies the descending chain condition.

Input

An element x∈XxXx\in X.

Output

A normal form of xxx.

Procedure

If xxx is on normal form with respect to →normal-→\rightarrow then
return xxx. Otherwise there is some y∈XyXy\in X such that x→ynormal-→xyx\rightarrow y; pick one such yyy. Set x:=yassignxyx:=y and repeat
the procedure from start.

For relations →normal-→\rightarrow which
satisfy the descending chain
condition and have unique normal forms, Algorithm 1
and Lemma 1
combine to an algorithm for deciding the
relation ∼similar-to\sim. A typical problem is however that uniqueness of the
normal form is a global condition that is very hard to establish
using elementary methods.
Theorem 1 offers an
equivalent local condition that often is straightforward to verify in
each particular case by explicit calculations.

2 Diamond lemmas for algebraic structures

One disadvantage of the basic diamond lemma (Theorem 1) is
that it requires all reductions to be explicit, whereas the
average mathematician probably expects it
to handle reduction schemas transparently. To illustate the
difference, consider again the
reduction a⁢(b+c)→a⁢b+a⁢cnormal-→abcabaca(b+\nobreak c)\rightarrow ab+ac. This does
notimply(d+e)⁢(b+c)→(d+e)⁢b+(d+e)⁢cnormal-→debcdebdec(d+\nobreak e)(b+\nobreak c)\rightarrow(d+\nobreak e)b+(d+\nobreak e)c, or even2⁢(b+c)→2⁢b+2⁢cnormal-→2bc2b2c2(b+\nobreak c)\rightarrow 2b+2c, because all three left hand
sides are distinct as formulae
(i.e., as elements of XXX). In order to let aaa, bbb, and
ccc be arbitrary, one need to explicitly state that e.g.
“a⁢(b+c)→a⁢b+a⁢cnormal-→abcabaca(b+\nobreak c)\rightarrow ab+ac for all well-formed formulae
aaa, bbb, and ccc”. Even this may be less than what was intended,
since it is often the case that one wants it to follow from
a⁢(b+c)→a⁢b+a⁢cnormal-→abcabaca(b+\nobreak c)\rightarrow ab+ac also that
f⁢(a⁢(b+c))→f⁢(a⁢b+a⁢c)normal-→fabcfabacf\bigl(a(b+\nobreak c)\bigr)\rightarrow f(ab+\nobreak ac)
for arbitrary functionalised expressions fff. Theorem 1
requires its user to take care of such details explicitly.

Moreover, the conditions in Theorem 1 are stated about
arbitrary elements of XXX, so even if one employs schemas in the
definition of →normal-→\rightarrow, it is necessary to verify that
condition 1 holds for every concrete triple (a,b,c)abc(a,b,c)
of elements of XXX such that b←a→cnormal-←banormal-→cb\leftarrow a\rightarrow c. This too
can be done collectively using proof schemas, but the situation is
complicated enough that it is often far from clear whether all cases
have been checked. It is furthermore common that trivial
verifications of a syntactic origin outnumber the verifications that
have interesting mathematical content. This makes it less likely that
mathematicians will actually bother to produce a
complete proof, and
more likely that they will skip it altogether by resorting to the
notorious “It is easy to see that …”

Finally, it is not always the case than one just wants an equivalence
relation. When the base set XXX has an
established algebraic structure one typically
rather wants ∼similar-to\sim to be a congruence
relation, but the basic diamond lemma can of course not take such
sophistications into account. Therefore there exist also a number
of specialised diamond lemmas which are tailored to particular
algebraic structures
and can make do with verifications of significantly fewer
cases than the basic diamond lemma.