In logic, the term "homomorphism" is used in a manner similar to but a bit different from its usage in abstract algebra. The usage in logic is a special case of a "morphism" from category theory.
Let ,
and
be structures for a common language
, and let
. Then
is a homomorphism from
to
provided that it satisfies the following:
1. For each constant ,
.
2. For each predicate symbol , if the arity of
is
, then
3. For each function symbol (or operation) , if the arity of
is
, then for any
,
For example, let and
be (directed) graphs (the set
is the set of vertices of
, and
is the set of vertices of
, while
is the relational representation of the edges of the graph
,
etc.). A homomorphism from
to
is a function
such that for any vertices
and
of
,
and
are connected by a directed edge (from
to
if and only if the vertices
and
are connected by a directed edge from
to
.
Another example is available in the theory of ordered groups. Let and
be ordered groups. (We are using
the symbol
to denote the multiplicative inversion operation. We will drop the superscripts
and
,
and for any
(or
),
we denote
by
.)
Formal application of our definition of a homomorphism in this setting indicates
that
is a homomorphism if and only if it satisfies the following:
1. .
2. For ,
.
3. For any ,
.
4. For any ,
if and only if
.
(Of course, these conditions can be shown to be redundant. Hence many texts define homomorphisms with requiring the preservation of the group identity (), and with postulating the preservation of multiplicative
inversion.)
The homomorphisms of universal algebra are special cases of structure homomorphisms, and the notion of a structure homomorphism also extends the corresponding morphism notions in categories of ordered sets and various relational/algebraic structures.