Try   HackMD

Universal Algebra 4: Equations, Congruences, Completeness

It may be a good idea to skip this lecture first and to go directly to the chapter on term rewriting systems and to come back here for definitions as needed.

For this course, the current chapter is more background and only essential for those who want to go deeper into universal algebra or term rewriting. Having said this, it leaves a gap when ignored.

Introduction

As we have seen, both solving equations in algebra and program execution in an ARS are special cases of equational reasoning. This leads to the following

Question: What precisely do we mean when we say that an equation

tt follows from a set of equations
E
?

We have also seen that equations can or cannot hold in an algebra. For example, in the term-algebra

L for the signature
{1,+,}
, the equation
111
is false, but in the natural numbers the equation
111
is true.

Question: What precisely do we mean when we say that an equation

tt holds in an algebra
A
?

Can we always derive all equations that are true in all algebras (possibly satisfying some axioms)? In other words:

Question: Are the rules of equational logic complete?

In this lecture we will answer some of these questions and more.

What are equations?

We can profit from our understanding of free algebras/term algebras in order to understand equations precisely.

Definition: Let

Σ be a signature and
X
a set of variables. An equation is a pair
(t,t)TermΣ(X)×TermΣ(X)

Instead of

(t,t) we usually write
tt
.

Reminder: When we write

t=t we mean equality in an algebra, when we write
tt
we mean the pair
(t,t)
in
TermΣ(X)
.

Remark: Let

E be a set of equations
TermΣ(X)
. We will see below how to use the notion of congruence relation in order to construct an algebra
TermΣ(X)/E
in which each equation
tt
is turned into an equality.

Congruence relations

Introduction

Conceptually, we have already seen the importance of equivalence relations in many examples. We have also seen the importance of structure preserving maps. In this section we study congruence relations, which are structure preserving equivalence relations.

What is the idea of a structure preserving equivalence relation?

The reason why equivalence relations are so important is that they allow us to take quotients of sets. More precisely, whenever we have an equivalence relation

on a set
A
, then we can from the quotient (=set of equivalence classes)
A/
. Moreover, we get a function, sometimes also called the quotient,
AA/

mapping an element of

A to its equivalence class.

But what if

A is not a mere set, but carries some structure?

What to we need to add to the notion of equivalence relation in order to make sure that

AA/ is a structure preserving map?

If the structure in question is algebraic, as given by a signature, then the answer is that we need the equivalence relation to be a congruence relation.

Example

The clock is a homomorphism

h:ZClock

As every function,

h gives rise to an equivalence relation
nm defh(n)=h(m)

The same equivalence relation can defined purely in terms of

Z by
nm defkZ.nm=12k.

Moreover, the second definition allows us to get back

h as
ZZ/nn mod 12

since
Clock
is ismorphic to
Z/
.

One question remains. We know that

h is not only a function but a homomorphism. Accordingly,
is not only an equivalence relation.

Which property of

guarantees that
ZZ/
is not only a function but also a homomorphism?

The property that

h is structure preserving can be phrased intuitively as:

​​​​The Clock is neither fast nor slow but measures time the same everyday. 

More precisely, if on two different days the clock shows the same time, and on both days I wait

n hours, then the clock also shows the same time on both days after my wait.

Even more precisely, in symbolic notation:

ttt+nt+n

We arrived at the definition of a congruence relation in case we have one unary operation "

+n".

Congruence relation, defined

More technically, the most important insight about equational logic is that the rules of equational logic capture what it means to be a surjective homomorphism (=structure preserving map).

Definition: A congruence relation on an algebra

A is an equivalence relation
closed under congruence, that is, if
f
is an operation of arity
n
and
tisi

for

1in then also
f(t1,tn)f(s1,sn).

Proposition on congruence relations:

  • Let

    h:AB be a homomorphism. Then the so-called kernel
    ker(h)={(t,s)h(t)=h(s)}
    is a congruence relation.

  • Let

    be a congruence relation on
    A
    . Then
    A/
    is an algebra and the function
    []:AA/
    mapping
    t[t]
    is a homomorphism.

Moreover, homomorphism and congruences determine each other in the following sense. If

h:AB is surjective, then
A/ker(h)
is isomorphic to
B
. And if
is a congruence relation then
is the kernel of
[]
.

Remark: Notice that this is universal algebra terminology for what we discussed in the lecture on meaning in syntax. If

h:TermΣ(X)A is a homomorphism, we can think of it as a meaning function from syntax to semantics. Then the relation
tt defh(t)=h(t)
is a congruence relation and, moreover contains enough information to recover
A
and
h
up to isomorphism.

Remark on completeness

The proposition on congruence relations is essentially a completeness theorem for equational reasoning without variables. For a full explanation of this, we need more mathematical machinery to be developed below. But the basic idea can be exlained now:

Let

E be a set of equations without variables and
TermΣ
the corresponding term algebra. Let
tt
be an equation that is true in all algebras
A
in which the equations
E
are true. We will show that
tt
can be derived from
E
using the rules of equational logic:

Let

be the smallest congruence relation containing
E
. Using the proposition on congruence relations, we know that
TermΣ/E
, which we define to be
TermΣ/
, is an algebra. Moreover,
TermΣ/E
is an algebra that satisfies, by its definition, all equations in
E
. So we know that
TermΣ/E
also satisfies
tt
. But this means that
tt
is in the congruence
generated by
E
, which in turn means that there is a proof in equational logic deriving
tt
from axioms in
E
.

Syntactical consequence

In the lecture on induction, we have seen that, given a set of equations

E the rules of equational reasoning amount to an inductive definition of the smallest set
E
of equations closed under the rules of equational logic and containing
E
(the set of "axioms").

So to say that the equation

tt can be derived from a set of equations
E
is equivalent to say that
tt
is an element of
E
. In logic this is usually written as
Ett

Semantical consequence

There is another take on consequence. We write

Ett

to mean that whenever an algebra

A satsifies "the axioms"
E
, it also satisfies
tt
. In symbols,
Ett
if and only if for all algebras
A

AE  Att

This leaves us with the task to explain what it means for an equation to hold for an algebra

A. Intuitively an equation
tt
should hold in
A
if both sides are equal in
A
for all substitutions of variables. This means (recall ) that all homomorphisms
h:TermΣ(X)A
we have
h(t)=h(t)
.

Definition: Let

Σ be a signature and
X
a set of variables. Let
tt
be an equation and
A
and algebra.
We say that
tt
holds in
A
, and write
Att

if for all homomorphisms

h:TermΣ(X)A

we have

h(t)=h(t). We write
AE

to say

Att for all
tt
in
E
.

Soundness and Completeness of Equational Logic

An important theorem, called the soundness and completeness theorem of equational logic states that these two notions of consequence are equivalent.

Theorem:

Ett if and only if
Ett
.

Proof: (Sketch) Soundness is the direction from left to right. By induction on the definition of

E, we have to show for each rule of equational logic that if the assumptions of the rule hold in
A
, then so does the conclusion. By definition,
Att
means that
h(t)=h(t)
. Since equality is reflexive, transitive and symmetric, the corresponding rules of equational logic are sound. The soundness of substitution comes from the definition of
Att
quantifying over all homomorphisms
h:TermΣ(X)A
. The soundness of the congruence rule stems from homomorphisms preserving the operations.
Completeness is the converse. Among all the algebras in which
E
holds is the termalgebra quotiented by the smallest congruence relation generated by
E
, which we denote by
TermΣ(X)/E
. Let
h:TermΣ(X)TermΣ(X)/E
be the homomorphism mapping each term to its equivalence class modulo
E
. Now assume
Ett
. It follows
h(t)=h(t)
. And by definition of
TermΣ(X)/E
this means that the equation
tt
is in
E
.

Remark: This sketch does has some gaps. Most importantly, that the term algebra quotiented by

E is an algebra in which the equations
E
hold. We have seen the importance of this in the variable free situation in the Remark on completeness. We fill this gap in the next section on fully invariant congruence relations, which extends the variable-free congruence relations to the situation of equations with variables.

Fully invariant congruence relations

In the section on congruence relations, and in the remark on completeness in particular, we argued that the proposition on congruence relations is a completeness theorem of equational logic without variables.

More precisely, a completeness theorem of equational logic in which variables are treated like constants in the sense that the rule of substitution is not admitted. For example, it would not be possible to deduce from

x+y=y+x that
2+3=3+2
because this requires a substitution
[x2,y3]
.

It is our aim to extend congruence relations to the case with variables. For this we need to consider special congruences. The basic idea is clear, once we remember the rules of equational logic:

Equivalence relations are reflexive, transitive and symmetric.

Congruence relations add the congruence rule.

Fully invariant congruence relations add the substitution rule.

This is done in the following way. Recall that substitutions on the term algebra are exactly the homomorphisms. The next definition is based on this idea and just that it replaces the term algebra by an arbitrary algebra

A.

Definition: A fully invariant congruence relation on an algebra

A is a congruence relation
closed under substitution, that is, if
h:AA
is a homomorphism and
(t,t)
in
, then
(h(t),h(t))
is also in
.

Proposition on fully invariant congruence relations: