Homomorphisms Given two structures \mathcal A and \mathcal B of the same signature σ, a
(σ-)homomorphism from \mathcal A to \mathcal B is a
map h:|\mathcal A|\rightarrow|\mathcal B| that preserves the functions and relations. More precisely: • For every
n-ary function symbol
f of σ and any elements a_1,a_2,\dots,a_n\in|\mathcal A|, the following equation holds: ::h(f(a_1,a_2,\dots,a_n))=f(h(a_1),h(a_2),\dots,h(a_n)). • For every
n-ary relation symbol
R of σ and any elements a_1,a_2,\dots,a_n\in|\mathcal A|, the following implication holds: ::(a_1,a_2,\dots,a_n)\in R^{\mathcal{A}} \implies (h(a_1),h(a_2),\dots,h(a_n))\in R^{\mathcal{B}} where R^{\mathcal{A}}, R^{\mathcal{B}} is the interpretation of the relation symbol R in the structure \mathcal{A}, \mathcal{B} respectively. A homomorphism
h from \mathcal A to \mathcal B is typically denoted as h: \mathcal A\rightarrow\mathcal B, although technically the function
h is between the domains |\mathcal{A}|, |\mathcal{B}| of the two structures \mathcal{A}, \mathcal{B}. For every signature σ there is a
concrete category σ-
Hom which has σ-structures as objects and σ-homomorphisms as
morphisms. A homomorphism h: \mathcal A\rightarrow\mathcal B is sometimes called a
strong homomorphism if the converse implication from above also holds. More precisely: • For every
n-ary relation symbol
R of σ and any elements a_1,a_2,\dots,a_n\in|\mathcal A| such that (h(a_1), h(a_2), \dots, h(a_n)) \in R^{\mathcal{B}}, then there are a_1',a_2',\dots,a_n'\in|\mathcal A| such that (a_1',a_2',\dots,a_n')\in R^{\mathcal{A}} and h(a_1')=h(a_1),\,h(a_2')=h(a_2),\,\dots,\,h(a_n')=h(a_n). The strong homomorphisms give rise to a subcategory of the category σ-
Hom that was defined above.
Embeddings A (σ-)homomorphism h:\mathcal A\rightarrow\mathcal B is called a (σ-)
embedding if it is
injective and • for every
n-ary relation symbol
R of σ and any elements a_1,a_2,\dots,a_n, the following equivalence holds: ::(a_1,a_2,\dots,a_n)\in R^{\mathcal{A}} \iff(h(a_1),h(a_2),\dots,h(a_n))\in R^{\mathcal{B}} (where R^{\mathcal{A}}, R^{\mathcal{B}} is the interpretation of the relation symbol
R in the structure \mathcal{A}, \mathcal{B} respectively). Thus an embedding is the same thing as a strong homomorphism which is injective. The category σ-
Emb of σ-structures and σ-embeddings is a concrete
subcategory of σ-
Hom. Induced substructures correspond to
subobjects in σ-
Emb. If σ has only function symbols, σ-
Emb is the subcategory of
monomorphisms of σ-
Hom. In this case induced substructures also correspond to subobjects in σ-
Hom.
Example As seen above, in the standard encoding of graphs as structures the induced substructures are precisely the induced subgraphs. However, a
homomorphism between graphs is the same thing as a homomorphism between the two structures coding the graph. In the example of the previous section, even though the subgraph
H of
G is not induced, the identity map id:
H →
G is a homomorphism. This map is in fact a
monomorphism in the category σ-
Hom, and therefore
H is a
subobject of
G which is not an induced substructure.
Homomorphism problem The following problem is known as the
homomorphism problem: :Given two finite structures \mathcal A and \mathcal B of a finite relational signature, find a homomorphism h:\mathcal A\rightarrow\mathcal B or show that no such homomorphism exists. Every
constraint satisfaction problem (CSP) has a translation into the homomorphism problem. Therefore, the
complexity of CSP can be studied using the methods of
finite model theory. Another application is in
database theory, where a
relational model of a
database is essentially the same thing as a relational structure. It turns out that a
conjunctive query on a database can be described by another structure in the same signature as the database model. A homomorphism from the relational model to the structure representing the query is the same thing as a solution to the query. This shows that the conjunctive query problem is also equivalent to the homomorphism problem. ==Structures and first-order logic==