Академический Документы
Профессиональный Документы
Культура Документы
Abstract
We study the definability of constraint satisfaction problems (CSP) in various fixed-point and infini-
tary logics. We show that testing the solvability of systems of equations over a finite Abelian group, a
tractable CSP that was previously known not to be definable in Datalog, is not definable in the infinitary
logic with finitely many variables and counting. This implies that it is not definable in least fixed point
logic or its extension with counting. We relate definability of CSPs to their classification obtained from
tame congruence theory of the varieties generated by the algebra of polymorphisms of the template struc-
ture. In particular, we show that if this variety admits either the unary or affine type, the corresponding
CSP is not definable in the infinitary logic with counting.
1 Introduction
The classification of constraint satisfaction problems (CSP) according to their tractability has been a major
research goal since Feder and Vardi first formulated their dichotomy conjecture [14]. This classification
has been closely linked to logic, with definability in Datalog providing one important uniform explanation
for tractability. However, it has long been known that there are tractable CSPs, such as the satisfiability
of systems of linear equations over finite fields, which are not definable in Datalog. Bulatov [5] (see also
[3]) provides a uniform explanation for the tractability of these by showing that any constraint language that
has a Mal’tsev polymorphism is solvable in polynomial time. It has remained an open question, however,
whether there is an explanation for the tractability of these CSPs in terms of a natural logic whose data
complexity is in polynomial time and which can define these problems.
The general form of the constraint satisfaction problem takes as instance two finite relational structures
and and asks if there is a homomorphism from
to . We think of the elements of as the
variables of the problem and the universe of as the domain of values which these variables may take. The
individual tuples in the relations of act as constraints on the values that must be matched to the relations
holding in . The general form of the problem is
-complete [27, 28]. In this paper we are mainly
concerned with the non-uniform version of the problem which gives rise, for each fixed finite structure
to a different decision problem that we denote
, namely the problem of deciding whether a given
maps homomorphically to . For many fixed , this problem is solvable in polynomial time, while for
others it remains -complete. A classification of structures for which the problem is tractable remains a
major goal of research in the area.
In the present paper we classify constraint satisfaction problems according to their definability in a
suitable logic. This is an approach that has proved useful in studying the tractability of constraint satisfaction
problems [14, 9, 24]. In particular, it is known that many natural constraint satisfaction problems that
are tractable are definable (or, to be precise, their complements are definable) in Datalog, the language of
function-free Horn clauses. Any class of structures that is definable in Datalog is necessarily decidable in
polynomial time, but there are known constraint satisfaction problems that are tractable but are not definable
1
in Datalog. A classical example is the solvability of systems of linear equations over the two-element field
[14], which we denote
. Furthermore, there are
-complete constraint satisfaction problems,
such as 3-colourability of graphs, for which it is possible to show that they are not Datalog-definable without
requiring the assumption that is different from
. Indeed, the class of constraint satisfaction problems
whose complements are definable in Datalog appears to be a robust, natural class of problems with many
independent and equivalent characterisations [10, 23].
2
obtain a dichotomy of definability whereby, for every 2 , either 34 562
7 is definable in Datalog or it is not
definable in . 3'89 8
1.3 Organization of the paper
The rest of the paper is structured as follows. In Section 2 we present some background definitions. Section 3
gives a proof that solvability of linear equations is not definable in 3 89 8
. Section 4 considers the definability
of three :";
-complete problems in 3'89 8
. Section 5 establishes that the definability of is determined 34 56207
2
by the variety generated by the algebra of . Section 6 begins by showing that if the variety admits the unary
or affine type, then it contains an algebra with the operations of a module. These results are tied together
in the same section to obtain the main conclusion relating definability in to the omitting of types from 3 89 8
tame congruence theory.
2 Preliminaries
2.1 Notation, relational structures, and homomorphisms
I <
We use the boldface notation for a tuple with components 6=?>A@CBCBCBD@E=GFC7
, and similarly for other letters , H
, etc. and variants with subindices or primes. The arity of the tuple will be clear from context. If is a J
sequence 6LK > @CBCBCBD@MKONP7
of indices in QSR.@CBCBCBD@MTVU
, we write for the tuple <XW . Sometimes we also 6=SYLZC@CBCBCBD@E=GY\[17
write 6= Y^] K`_JV7 a
if the meaning is clear. If is a set of tuples of arity , we write for T . bXc W 6ad7 Qe< WP] <f_fagU
i h h
aPkmlnj F
A vocabulary is a finite collection of relation symbols, each with an associated arity. A -structure
j
consists of a finite set with a relation T
for each -ary relation symbol in . A graph is a a h i
structure with a binary relation that is symmetric and irreflexive. A homomorphism from a -structure to hF
h
a -structure is a map 2 o ] jqpsr
such that for each in and each a h , 6= > @CBCBCBt@E= F 7_fj
if 6=?>A@CBCBCBD@E=GFC7_fa k , then 6uoD6=?>v7w@CBCBCBD@ox6=SF/7M71_yaPz .
i
We write p{2 to denote that there exists a homomorphism from to 2 . A structure is a core if every
i i
i
homomorphism from to itself is an automorphism. We write 34 56207 for the class of finite structures
i
i
such that ps2 and also for the decision problem of determining membership in this class.
2.2 Logic
We assume familiarity with first-order logic. A formula is quantifier-free if it has no quantifiers, and positive
quantifier-free if it is quantifier-free and it has no negations. A formula is positive primitive if it is formed
from the atomic formulas using only conjunctions and existential quantification. A formula is existential
positive if it is formed from the atomic formulas using conjunctions, disjunctions and existential quantifica-
tion. Datalog can be seen as the extension of existential positive formulas with a recursion mechanism for
building least fixed-points. Similarly, LFP is the extension of first-order logic with an operator for forming
|
the least fixed-points of positive formulas. Finally, LFP C is the extension of LFP with a counting mech-
anism. For formal definitions, which we will not need in this paper, we refer the reader to [26]. It is known
|
that every class of structures definable in LFP C is decidable in polynomial time.
39 8
}~ Y)
The formulas of the logic are obtained from the atomic formulas using negation, infinitary con-
junction and disjunction, and counting quantifiers for any integer ). The fragment consists K 39 8
of those formulas of 39 8
in which only distinct variables appear and
3 89 8 3 9 8 B
/ 8
3
The significance of '
is that fixed-point logics can be translated into it. That is, any formula of Datalog
or LFP, and indeed of LFP C is equivalent to one of
. Thus, these logics are fragments of .
Moreover, these translations into infinitary logics have provided some of the most effective tools for proving
inexpressibility results for the fixed-point logics. See [13, 19] for a discussion of this and the role of these
logics in descriptive complexity.
1. ®¿¾¹
2. u®E°G¾yº for every proper ° ,
3. u®E°G¾yº for some proper ° ,
where a proper ° is a tuple À/ACCCDEÀÂÁS of points in ® such that Àv¨Ã ÀMÄ whenever Ŷà .
ÇÆ
We will use for the collections of positive quantifier-free formulas, existential positive formulas, and
Datalog formulas (i.e. Datalog programs) and write , and »ÈeÉEÊ »Ë È »ÌCÍÏÎLÍÂÐÒÑMÓ
, respectively. Note that these
are reducibilities of increasing power, and that definability in
is preserved downwards by all three (the
finitely many exceptions of structures with less than points can be handled individually). Also, all three
reducibilities are transitive.
®
Theorem 2 ([15, 2, 21]). Let be a finite structure, and let åÖn¯ ©
be a non-empty relation that is pre-
®
served by all polymorphisms of . Then is definable in by a pp-formula. ®
4
In [20, 22], Jeavons et al. proved that the set of polymorphisms of is included in the set of poly- æ
morphisms of , then ç èé êëuçyì
is reducible to èé êëæ0ì
by polynomial-time many-one reducicility. Using
the recent logarithmic space algorithm for undirected graph reachability [29], the reduction can be made
logspace.
Theorem 3 ([20, 22]). Let ç and æ be finite structures. If ê¤íîÞëuçyì1ïðê¤íîÞëæ
ì , then èé êëæ0ìñõòÒóMô èé ê¶ëuçäì .
A set with a collection of operations on it is called an algebra. Two algebras are term-equivalent if the
sets of operations obtained by composition from the basic operations of the algebra and all the projections are
the same in both algebras. As is common in universal algebra, we identify algebras up to term-equivalence.
ç
Every structure can be naturally associated with an algebra ö¶î\÷«ëuçyì
, called the algebra of , whose ç
ç
base set is the universe of , and whose operations are the polymorphisms of . Let ç ø{ù{ëú(ûwüdì
and
øgýxùþëúýLûwüPý\ì be algebras. We say that and ø øgý
are similar, or of the same type, if there exists an index
ÿ
set such that ü ù
and ÿ ü"ýù ý
ÿ
, and the operations and are of the same arity, ý
say , for every
and ÿ
û xû
ú, it holds that
'ë ë û Dû ìM`ì ù ý ë ë ìwû Dû ë Mì ì
!
.
We shall use the three standard ways of transforming algebras.
A variety is a class of algebras which, if it contains ø also contains every subalgebra of ø , every
homomorphic image of ø , and every direct power of ø . The smallest variety containing ø is called the
variety generated by ø and denoted by )*+/ëLø
ì . For further background on universal algebra, see [8]. We
shall have occasion to use the following simple observation on pp-definability and reducts.
ç æ
Observation 4. Let and be finite structures with the same universe. The algebra ö¶î\÷«ëuçyì is a reduct
of öî\÷·ëæ
ì
if, and only if, every relation of is pp-definable in . æ ç
The following theorem uses the above mentioned result by Jeavons et al. and the results of [4].
Theorem 5. Let ç and æ be finite structures. If the variety generated by ö¶î\÷«ëuçyì contains a reduct of
ö¶î\÷«ëæ
ì
then èé êëæ
ìñ õòÒóMô è é êëuçyì .
Note that Theorem 3 is a direct consequence of this because ö î\÷·ëuçyì belongs to the variety it generates,
and öî ÷«ëuçyì
is a reduct of ö¶î\÷ëæ
ì
precisely when ê¤íîÞëuçyì1ïðê¤íîÞëæ
ì .
3 Definability and Systems of Equations
In this section we show that the problem of determining the solvability of linear equations over the two-
element field, which we mentioned above as a canonical example of a tractable CSP whose complement is
è
not definable in Datalog, is also not definable in -,. . Indeed, we prove a more general result by showing
,
that the solvability of equations over a finite Abelian group with at least two elements is not definable in
è ,. .
,
5
3.1 Combinatorial games
Our proof of undefinability is based on a game argument. The expressive power of /-01 is characterised by
0
a game known as the bijective game [16]. This is played by two players, Spoiler and Duplicator, on a pair
of structures 2 and 3 , with 4 pairs of pebbles 57698;:=<8?> for @BADCEAF4 . For each move, Spoiler chooses a
pair of pebbles 57698G:=<8 > , Duplicator chooses a bijection HJILKNM O such that HP576RQS>ETU<SQ for CWTY
V X , and
Spoiler chooses Z\[]K and places 68 on Z and <8 on HP5^Z> . If, after some move, the map _a`Mcb is not a
partial isomorphism, Spoiler wins; Duplicator wins infinite plays. By a result of Hella [16], Duplicator has
a winning strategy if, and only if, 2 and 3 cannot be distinguished by any formula of /d1 , a fact denoted
0
by 2fehgij3 .
In constructing the winning strategy in the bijective game we construct, we depend on another game,
the cops and robber game [30], which is known to characterise the treewidth of a graph. For the standard
definition of the treewidth of a graph, we refer the reader to [12]. The cops and robber game is played by
two players, one of whom controls the set of 4 cops attempting to catch a robber controlled by the other
player. The cop player can move any set of cops to any vertices of the graph, while the robber can move
along any path in the graph as long as there is no cop currently on the path. It is known [30] that the cop
player has a winning strategy on a graph using 4lkm@ cops if and only if the graph has treewidth at most 4 .
The treewidth of a graph n is denoted oGpq5 nE> .
Definition 6. Let r be a finite Abelian group over a set n and t be a positive integer. We define the structure
uwvRx y Q}
to have universe n and, for each ZB[zn and @EA\X{A]t , it has a relation | of arity X that consists of
Q
the set of tuples 576~::=6Q>[n that satisfy the equation 6~
kJk\6Q(TZ .
uwvRx y
Thus, any structure 2 in the signature of can be seen as a set of equations in which at most t
variables occur in each equation. The universe of 2 is the set of variables and the occurrence of a tuple
Q}
576~:L:=6QS> in a relation | signifies the equation 6~kk6RQwTZ . This set of equations is solvable if,
u vx y
and only if, 2M . In the sequel we will say “the equation 6~Pkmk]6QTZ occurs in 2 ” to mean
Q}
that the tuple 576~::=6RQ> is in | .
Our aim now is to exhibit, for each non-trivial finite Abelian group r and each positive integer 4 , a pair
u vRx u vRx
of structures 2 and 3 such that 2fe gi 3 and such that 2[\/5 > and 3[\
V /5 > . This will
u vRx u vx y
show that /5 > is not definable in / 01 . This, of course, implies the result for all /Rh5 > with
0
t .
The structures we construct are sets of equations derived from -regular graphs of large treewidth. From
now on, fix a non-trivial finite Abelian group r , a -regular graph , and a distinguished vertex of .
u }
Let SZ
~:L:Z E be the elements of r . We define, for each Z{[SZ~ :L:Z E , a set of equations ¢¡ as
u } u vRx
follows (note that ¡ is a structure over the vocabulary of ): x«
For each vertex £B[¤l¥ and each edge ¦[¨§l¥ that is incident on £ , we have © distinct variables 6ª8
where C ranges over SZ~::Z¬ . Since each vertex has three edges incident on it, there are © variables
associated to each vertex. For every vertex £ other than , let ¦ ~ :¦®:¦ be the three edges incident on £ . We
u }
then include the following equation in ¡ for all C:¯X:4°[SZ~::Z¬ :
x «± x «;² x «´³
6 8ª k\6 Q ª k\6 ª TJCµk¶X(k4µ (1)
d
6
For
½S¾¿
the distinguished
¾Á¬Â
vertex · , instead of the above, we include the following equation, again for all ¸¹¯º¹»¢¼
¹ÀÀÀ¹ :
Ã9ÈÄÅ ÆÇ É Ã9Ë ÄÅ Æ;Ê É Ã9Ä ¾
Í Å ÆGÌ Î ¸ É º É » É À (2)
¿
In addition, for each edge ϼ¢ÐqÑ let Ò ¹=ÒÓ be its endpoints. We include the following equations in ÔwÕÖ Ä
½S¾
¿ ¾ ÁEÂ
for all ¸¹¯º×¼ ¹ÀÀÀL¹ :
ÃÈØ Ç=Å Æ É Ã9Ë Ø Ê!Å Æ Î ¸ É ºÀ (3)
We refer to equations of the form (1) and (2) as vertex equations and equations of the form (3) as edge
equations.
¾
Lemma 7. Ô Õ Ö Ä is satisfiable if, and only if, ÎfÙ
Proof. To see that the system of equations ÔwÚÛÖ Ä is satisfiable, just take the assignment that gives the
variable à ÈØ Å Æ the value ¸ . ¾Ü
To see that ÔwÕSÖ Ä is unsatisfiable when ÎÙ , consider the subsystem ÝÞÚ of equations involving only
the variables à ØÚ Å Æ with subscript Ù . Note that each such variable occurs exactly twice in ÝjÚ , once in a vertex
equation and once in an edge equation. Thus, if we add up the left hand sides of all the equations, we get
ßáà Ã Ø Å Æ Ã Ø ÅÆ Ã Øâ Å Æ where Ò ã is the other endpoint of
Ú . Note also that each variable Ú has a companion variable Ú
the edge Ï and we have the equation Ã9ØÚ Å Æ É ÃØÚ â Å Æ ÎÙ . Thus
ßáä Ã Ø ÅÆ Î ßáä å Ã Ø ÅÆ Ã Ø æâ Å Æ ÎÙ À
Ú Ú É Úç
Ø ÅÆ Æ
To show that í is an isomorphism, we need to argue that it preserves all the equations in Ô(ÕSÖ Ä . Clearly, all
equations corresponding to vertices and edges of Ö that do not appear on the path are preserved as í is the
identity map on the corresponding variables. Consider now the vertex equations corresponding to the vertex
7
ö . Note that the edge ÷ø (the first edge on the chosen path) is incident on ö and let ù and ú be the two other
edges incident on ö . Then, the equation
ûüý þÿ ûüý û9ü ý
ûüý û9ü ý
is mapped by to
ûüý þÿ
Now, consider a vertex equation for an intermediate vertex ( (*) ø along the path. In this case, there
are two edges ÷),+÷) ø of the path incident on ( . Thus, the equation
û- ý þ/. û - ý þ/.10 ÿ û- ý 2 " #
is mapped by to
. û -ý þ/.10 ÿ û3- ý " 67 +
û3-4$ý þ/5
is mapped by to
û-8
.7ý þ!. û3;-:9!$ý þ " <&
We have thus established that maps equations to equations. Since is a bijection, and the number of
equations in ü and in ü is the same, this proves that it is an isomorphism.
Lemma 9. If =?>A@B"C5D and is connected, then #E; üGF6HJI ü for any LKNM .
Proof. Our aim is to exhibit a winning strategy for Duplicator in the -pebble bijective game played on the
two structures O #EP ü and Q ü . Since =?>R@B
C5D , we know that in the cops and robber game
played on , robber has a winning strategy and we show how Duplicator can make use of this strategy.
For each vertex ( K
SUT let V - denote the set of variables û-ý þ for edges ÷ incident on ( . Similarly, for
each ÷ KXWT , let V þ denote the set of variables involving ÷ .
We say that a bijection ùNYZO\[]Q is good for a vertex ( KNS T if the following conditions hold:
h r h hsPu;v;v;vu8h* r
gwsu;v;v;vtu8g3x k h*!u8h*s;
3 '
8 8 i'y
Proof. : Let the path from to avoiding be . For each edge
i'y,%3k
ib%': i'y,%3¡
along this path, write for the variable and
bi %3 i'y
for the variable . We then define
i¥;¥J¤
by
h r
path from to avoids
and
g s u;v;v;vtu8g'x i'y ¢X£
_
¤ ;
¥
i ¢X£
; and agrees with everywhere else. In particular, since the
, agrees with on .
We now describe Duplicator’s winning strategy in the bijective ¦ -pebble game. Duplicator responds to
in the ¦ cops and robber game played on the graph q . At any point in the game, if Spoiler’s pebbles are on
Spoiler’s first move with the identity bijection. She maintains a board on the side which describes a position
the position ws;u;v;v;vtu8'x in l and hsu;v;v;vwu8hx are the vertices of q to which these variables correspond, then
the current position of the cops and robber game has ¦ cops sitting on the vertices hZs;u;v;v;vu8h*x . If the robber’s
position according to its winning strategy is h , then Duplicator will play a bijection that is good for h .
To see that Duplicator can do this forever, suppose Spoiler lifts a pebble from . Duplicator responds
with a current bijection i that is good for h . Since the only equations not preserved by i are those associated
with the vertex h , Spoiler must place at least three pebbles on variables associated with h to win the game.
However, Duplicator responds to Spoiler placing the pebble on a new position y by updating the position
of the cops and robber game. Suppose robber’s winning strategy dictates that the robber move from h to r .
update the bijection i to a new i y that is good for r without changing i on any of the currently pebbled
Since robber’s move must be along a path avoiding the current cop positions, by Claim 10, Duplicator can
Ã#Ä
linear equations over a finite field. Over the 2-element field , this problem is complete for the complexity
¨ ¯° ¯ Å
class , for which we give a definition in Section 4.4 below. As we noted in the introduction, however,
Å
and even its uniform fragment LFP C are powerful enough to express other complete problems for
this class. For example, LFP C can express that a given square matrix has non-zero determinant over any
ÃÆÄ
finite field. This was first noted by Blass, Gurevich and Shelah [1]. In this section, we revisit this result and
discuss the (in)expressibility of these and other problems that are complete for .
9
4.1 Counting quantifiers
ÇGÈÉ È
ÊË3ÌcÍÏÎÑÐ Ò ÊË'ÌcÍÏÎÐPÊÓ½Ê%ÎÑÐ8Ð
Recall that the formulas of are obtained from the atomic formulas by means of negation, infinitary con-
Ò Ó½Ê%ÎÑÐ
junction and disjunction, and counting quantifiers for every integer . The formula
signifies that there exist at least points of the universe that satisfy . In the formulas below we will use
ÊBÔÖÕÐPÊÓGÊBÕÐ8Ð
the notation
Êà2ÕZÐPÊÓ½ÊBÕZÐ8ÐáâÜÂÊBÔÖÕZÐPÊÓ½ÊBÕZÐ8Ð
which says that the number of points that satisfy Ó½ÊBÕZÐ is odd. As a matter of fact, for every set of integers ã
whatsoever, we could write the infinitary formula
× ÊË ÌcÍ ÕZÐPÊÓ½ÊBÕZÐ8ÐÛXÜÂÊË ÌcÍ ÕZÐPÊÓ½ÊBÕZÐ8Ð
ÍZä*å
saying that the number of points that satisfy Ó½ÊBÕZÐ belongs to ã . Let us mention then, as a curiosity, that an
immediate consequence to this is that the infinitary logic Ç ÈÉ
of finite structures. Of course, the uniform fragment LFP æ C of ÇGÈÉ
È is able todoesexpress non-computable properties
ñ ø
and , is represented by the binary relation formed by the pairs such that . In other words,
é úÏñ*õ;û;û;ûüõ8Òþý
the matrix is represented by the set of positions that hold ; the other positions hold . With some abuse of
notation, we will use both for the matrix in the usual meaning and for the binary relation over
that represents it.
ÿ Ø ÊBé#Ð á
ÿ Þß ÊBé#Ð á ÿ ÊBéUõ8ÿJÊBéÆÐ8Ð û
10
By carefully reusing variables, it is possible to write the formula !"#$%&('*)+,)-/. with four variables in
total. For concreteness, we define
Repeated squaring It is also convenient to define the powering of matrices by a more efficient induction
known as repeated squaring. For A>GIH , we use the same base case, and for larger powers we distinguish
the odd and even cases:
!"#$JKL&9-?.M3 N
!"#$ J%1*2&9-?.M3 $!DOP&9-Q)RBSUTV$B#U&(!"#$ J WYX %1*2[Z]\_^` &9-/...@) if A is even
!"#$BJ%1*2 &9-?.M3 $!DOP&9N)RS
TV$#
&(0!"#$BJ WYX %1*2[Za\_^` &9-?...@) if A is odd
Note that, by the same careful reusing of variables as we did for 0!"#$ % , it is possible to write the formula
!"#$ J% with five variables (the additional variable is for the 5 -quantifier in RS
TV$# ).
The good feature of the inductive definition based on repeated squaring is that it takes only bc&9dY!fegAh.
iterations to obtain 0!"#$ J% . In comparison, the inductive definition of !"#$ % requires A iterations. This
difference is important if we need to take powers that are exponential in i , the dimension of the matrix, as
we actually do below.
11
where cBU9? is the sentence saying that is a square ? matrix. In other words, this is the sentence
that says that the structure has exactly elements:
h¢ ¢y£¢ §*¨¢ ¢l£¢
6 ,¡ 8 P¤l¥¦6 ,¡ 8 @©
This shows that the collection of non-singular matrices over the 2-element field is definable in ª«¬ . Let us
«
mention that all definitions are perfectly uniform and can be formalized in the uniform fragment LFP C of
ª «¬ . For this, it is important to use the inductive definition of ®0¯°±B²³ based on repeated squaring because
« f¹º
in the definition of non-singular matrices we are taking a power with exponent ´Q , which is µf¶¸· . Note
that the log of this number is polynomial.
Non-singular matrices over finite fields The discussion up to now can be generalized to arbitrary finite
£
fields. Let » be a finite field with ¼ elements. An ½u matrix 9¾U¿ÁÀtÂÄÃÆÅÈÇÉËÊÌÅÍ* over » is
represented by ¼ÏÎ Ã binary relations ÐÑ , one for each ¾kÒs»ÓνÔÕ
Ö , where Ð?Ñ is the relation containing
£
the pairs (ÇÉËÊ
such that ¾h¿ÁÀ ¾ . In other words, ÐÑ is the set of positions of the matrix that hold ¾ . The
¢
positions that do not belong to any Ð?Ñ hold Õ . It is not too difficult to define ª «¬ formulas ®¯
×P ÉØ,ÉÏÉÙ
¢ «
and ®¯°± ³ ÉØ,É/ defining the product and the power of matrices as we did for the 2-element field in the
previous section. It is important for this that the finite field is fixed.
The set of non-singular matrices over » also forms a group. Its order is
Complete problems The problem GAP , for Graph Accessibility Problem mod 2, is this:
Û
GAP : Given a directed acyclic graph ñ and two vertices ò and ó , decide whether the number
Û
of paths that go from ò to ó in ñ is odd.
It is not hard to see, using the standard reductions from logspace Turing machines to graph reachability
problems, that GAP is complete for é?ê . The trick to make the digraph acyclic consists in adding a counter
Û
of steps in a separate tape of the logspace machine.
We define two more problems:
EõU
N ONSINGULAR : Given a matrix in ô , decide whether is non-singular.
Û Û
Uõ
F EASIBLE : Given a matrix in ô÷ö and a vector ø in ô ö , decide whether the system of
Û ¢y£ ¢ Û Û
equations ø has a solution in ô .
Û
12
It was shown in [7] that the three problems GAP ù , N ONSINGULAR ù and F EASIBLE ù are interreducible by
logspace reductions. It follows that all three are complete for ú?û . Thus, from the computational complexity
perspective, the three problems are equally hard (or easy).
From the descriptive complexity perspective, however, it follows from our results that the situation is
different. We showed in this section that the problem N ONSINGULAR ù is definable in üýþ . Moreover, it is
ý
not hard to see that if ÿ is the adjacency matrix of the digraph , interpreted as a matrix over the 2-element
field, then the -entry of the
-th power ÿ is the parity of the number of walks of length
that go from
to in . In other words, if the number of walks of length
is odd, then the -entry is
, and if it is
even, then it is . It follows that if ÿ is the binary relation representing the adjacency matrix of a directed
acyclic graph , the following formula of üýþ defines GAP ù :
ý
ÿ
#"$%& '(
!
where ) is the set of all finite sets of natural numbers of odd cardinality. Here we use the fact that in a
directed acyclic graph, the only walks are paths.
For the problem F EASIBLE ù the situation is different. We show below how the results in Section 3 imply
that, when appropriately encoded into finite structures, this problem is not definable in üýþ .
ý
Inexpressibility of feasible systems Let ÿ+*,.-0/21435
7698:69;<=
>6@?A6CB be a matrix in DFE' ù GIH and let
J J J
*K / 3L
'6M8:6C;N be a vector in D Eù . The system of equations ÿOP* is represented by a finite structure
as follows. The universe is the disjoint union of two sets QR*TS=
$U=!V!V!VW
and YR*ZS[\U=!V!V!VW][ of sizes
E>X H^X
; and B , respectively, indexing the rows and columns of ÿ , respectively. The matrix itself is represented
J
by the set of pairs
=/_][1` such that -I/a14*b
. Finally, the vector is represented by the set of
/ ’s such that
J
/c*K
.
We show now that the constraint-satisfaction problem üed f.gih j k= , where l is the additive group of
D ù , reduces to F EASIBLE ù by a quantifier-free reduction. Recall that an instance of üed f.g h j k is given
by a finite structure m with its universe representing the set of variables OWU=!V!V!VWO , and with two ternary
H
relations Qin and Q4U representing equations of the form
J
respectively. We build a structure w representing an instance ÿOP* of F EASIBLE ù as follows. First, if Qin
and Q U are not disjoint, w is just a fixed unsatisfiable instance of F EASIBLE ù . Otherwise, the set of columns
Y of the matrix is S=OxU=!V!V!VO , the universe of m itself. The set of rows Q of the matrix is the set of triples
HLX
in Qynz{Q4U . The union QMz|Y is thus the universe of w . The binary relation representing the matrix itself is
the set of pairs
J J
SI.-5 ][=(]}q~QKNYK3$}*-'|}* |}*u[ V
X
Finally, the subset of Q representing the independent vector is precisely Q4U . It is obvious that this is a
quantifier-free reduction from üedf.g h j k to F EASIBLE ù . Thus, F EASIBLE ù is not definable in üýþ .
ý
5 Logical Reductions
The goal of this section is to work out the most useful reductions between CSPs in the framework of logic.
Most constructions are more or less standard, but technical, except the reduction to the idempotent case,
which requires also a non-trivial twist.
13
5.1 Expansions by reduced definable relations
Recall that a structure
is an expansion of another structure if every relation in is also a relation in
.
Let us start with the rather trivial case of reductions to expansions.
Lemma 12. Let be a finite structure, and let be an expansion of . Then, e .=]e . .
Proof. The transformation that expands every instance of e .
by empty relations is a reduction from
e . to e .
. The empty relation is definable by the quantifier-free formula . .
It should be clear that, in Lemma 12, the converse reduction e.
i=e . need not be true.
There is an interesting case, however, where it holds. This is when
is an expansion of by reduced
pp-definable relations. Before we prove this, we need a definition.
Let 9i be a relation on . We define an equivalence relation `¡ on ¢0£¤!¥!¥!¥W¤¦$§ by setting ¨]¤ª©q in
¡ if, and only if, «0¬x«® for every .«L¯!¤!¥!¥!¥W¤]« in . We say that is a reduced relation if ¡ is the trivial
equivalence relation (i.e. equality). Note that the equality relation on is not reduced.
Lemma 13. Let be a finite structure, and let
be an expansion of by reduced relations that are
definable in by a pp-formula. Then, e.
F=°e . .
Proof. Let ± be the vocabulary of . We prove the lemma for the expansion by one reduced relation . The
general case follows by composing. Let ² be the arity of and let ³´µx¯=¤!¥!¥!¥¤µL¶= be the primitive-positive
formula that defines in . The formula has the following form:
¬
where 4¯=¤!¥!¥!¥x¤] are all the relation symbols of ± , each Ç ® is a sequence of indices in ¢0£¤!¥!¥!¥¤È§ whose
length matches the arity ²=¬ of ¬ , and ½ ¾ denotes the projection of the tuple µx¯!¤!¥!¥!¥W¤µ5»i to the indices
indicated by Ç . We may assume that all variables µ ¶]¹¯ ¤!¥!¥!¥x¤µ » are distinct and disjoint from µ ¯ ¤!¥!¥!¥W¤µ ¶ .
Moreover, since is reduced, we may also assume that all variables µW¯=¤!¥!¥!¥x¤µL¶ are distinct. Given an
instance É of e .
, we need to define an instance Ê of . such that ÊÌË if and only if
ÉZËÍ
. First we define Ê abstractly, and then show how to define it in É through a positive quantifier-free
interpretation with parameters.
The universe of Ê is the set ÎCÏ
.7ÐÑ¢=µ5¶]¹¯=¤!¥!¥!¥x¤µL»>§`(¤
Î
where µ5¶]¹¯À¤!¥!¥!¥W¤µL» are the quantified variables in ³ , which we assume not to be members of . Intuitively,
we have a new copy of each quantified variable of ³ for each tuple in Ð . The interpretation of the relation
¬ in Ê consists of ¬Ð , together with a set of tuples defined next. For every ÒPÓ.Ô ¯ ¤!¥!¥!¥¤]Ô ¶ in Ð and
¬
for every Ç ® K¨]¯¤!¥!¥!¥x¤¨¸¶_ÕÖ , add to '¬× the tuple .د=¤!¥!¥!¥¤]Ø=¶ÖÕ_ defined by:
This defines the structure Ê . Let us prove it has the right property:
Claim 14. ÊÞËß if and only if ÉàËá
.
Î
Proof. Let â be a homomorphism from Ê to . We claim that the restriction of â to is a homomorphism
from É to
. For every ¬ we have ¬ Ð Ó ¬× and '¬ã ä'¬å . Moreover, â is a homomorphism, so
âW. ¬× Aæ'¬å . Thus âW. ¬ Ð Aæ'¬ã . Let us now check that âW. Ð |æ'ã . Let then Ò be any tuple in
14
ç7è ç'ô
. Let é+êÓëWì.íIî . We want to show that ïñð êóò´ì.éî , so é belongs to . By the definition of õ , for
ç
ø
every ö0÷ ê,ìù]ú=û!ü!ü!üxûù¸ýÖþÿî , the tuple ìú=û!ü!ü!üû=ý_þÖî defined as before belongs to . Now, if ù is the index of
÷
a bound variable of ò , we view ëWìì.í^û îî as a witness for when evaluating òì.éî in ï . On the other
÷
÷
hand, if ù is the index of a free variable of ò , we view ê ëì
î as the interpretation of . This
ç ô ÷ ÷ ÷
interpretation is well-defined because, critically, is reduced so all variables ú û!ü!ü!üû are distinct.
Under this interpretation for the free and bound variables, we have ïóð ê+ò´ì.é°î as was to be proved.
Suppose now that ë is a homomorphism from to . We need to extend ë to map from to . Fix a
ç7è ç'ô
tuple í in , and let éCêKëì.íIî . Then é belongs to so ï ð ê,òì.éî . Let ýú!û!ü!ü!üWû be witnesses to
the existentially quantified variables in ò . We extend ë by defining ëWìì.í^û îîrê for Mù ! . The
÷ ÷
claim is that ë is a homomorphism from õ to ï and that this follows directly from the definitions.
We need to show now that this reduction is indeed a positive quantifier-free interpretation with parame-
ters. This is more or less routine. Fix a pair of distinct variables "$#`û"xú that will play the role of parameters.
For concreteness, we can think of "$# and "xú as distinct elements of % . Let &7ê')(* and + ê-,/.021435&7689 .
ý;:< 3
We can think of the universe of õ as the subset of % defined by the following formula with =+>@?
free variables A # ûA ú û!ü!ü!üûA ý;: :
ç
ì/AB#êC";#EDFA úrêHGIGIG ê'Aý;:<ú(î5J<ì/AB#êC"xúKD ì/A ú!û!ü!ü!üûAý!î5DMLiì/Aýú=û!ü!ü!üxûAý;:Öîî(û
where Lyì/Aýú!û!ü!ü!üWûAý;:ªî is a formula that is satisfied by the set of numbers NPORQTS û!ü!ü!ü´û&U(P7V when
encoded in binary; the bits are encoded by A ýXW êH"$# or A ýXW êP"xú . In other words, when & is an exact
power of two, which we may as well assume by adding dummy variables, L is the following formula:
:Ycú
Z
ì/A ýú]XW êC"$#8JMA ýú]XW êC"xú(î
W\[X#
ç7èdc
encodes QeLýú!û!ü!ü!üWû V . With the universe defined this way, the rest of the formal definition is easy
to work out.
15
Lemma 15. Let u a finite structure and let v be the reduced version of u . Then wxtyzu|{@}~
wxtyzv{ and wxyzv{}ebwxtyzu{ .
Proof. We start with the reduction wxtyzv{}e8wxtyzu|{ . Let be the vocabulary of u and let X be the
vocabulary of the reduced structure v . Hence, for every symbol in we have a symbol in of the
arity of ez{ . Let be an instance of wxtyzv{ . We define an instance of wxyzu|{ . The universe of
is itself. The interpretation of the -ary symbol in is defined as follows: let 7¡ for P¢
and let £ be a set of representatives of the -classes, ordered in an arbitrary way. Then, ¤ is defined by the
formula ¥
± ´
¡ z/¦§e¨I©I©I©>¨¦ªT{E z/«>¬{5® ¯ ¦ '¦ ©
°²±/³ ´¶µ¸·7¹
It is clear that Hº»v if, and only if, -º»u . Moreover, the reduction is positive quantifier-free.
We proceed now with the reduction wxty¼zu{}~I/
¼wxyzv{ .
Let be an instance of wxtyzu|{ . We define an instance of wxtyzv{ . The universe of is ½ itself.
For the relations, the basic idea is to project every relation ¤ to the coordinates of a set of representatives £
of the -classes, where ¾7¡ . However, before we do that, we need to close each ¤ under all equalities
implied by the equivalences z/¿¨ÀÁ{Âà . We do that using Datalog-definable intermediate relations.
So, let Ä be the binary relation on ½ defined by the following Datalog program:
± ´
ÄÅz/¦ ¨¦ {dÆnÇ@|z/¦>§e¨I©I©I©>¨¦XÈÉ{
ÄÅz/¦K¨Ê{!ÆnÇ@ÄÅz/Ê;¨¦X{
ÄÅz/¦K¨ËÌ{dÆ$Ç@ÄÅz/¦K¨Ê{>®ÍÄÅz/Ê;¨ËÌ{¶¨
where the first rule is introduced for every symbol in and every z/¿¨ÀÌ{Â* ¡Î . It is obvious that Ä is an
equivalence relation on ½ ; reflexivity follows from the fact that z/¿¨ÀÁ{ÏÂC ¡nÎ in the first rule, symmetry is
enforced by the second rule, and transitivity is enforced by the third. Next, for every -ary symbol in ,
let be the relation defined by
z/«>¬{=ÆnÇ9|z/Êt§¨I©I©I©K¨Ê4ȶ{5®FÄMz/¦>§e¨Êt§É{5®ÑÐIÐIÐi®FÄÅz/¦XÈI¨Ê4ȶ{¶¨
where £ is a set of representatives of the -classes ordered in an arbitrary way. This defines , and we
defined it by a Datalog program interpreted on . It remains to argue that this Datalog-interpretation is
indeed a reduction.
Claim 16. If Ò is a homomorphism from to u and zÓ¨ÓÌ<{ÂÃÄ , then ÒzÓ{8ÔÒzÓÌ<{ .
Proof. We proceed by induction on the stage on which zÓ$¨Ó { enters the relation Ä . If it enters in the first
stage, then there exist in , z/¿¨ÀÌ{ÂÕ ¡Î , and ÖÕÂ× ¤ such that Ó ± PÓ and Ó ´ PÓ4 . Since ÒKzÖ${ØÂ× ¤
and z/¿¨ÀÌ{Â_i¡ , it follows that ÒzÓ ± {RÒKzÓ ´ { , so ÒKzÓt{RÒzÓ { . The inductive cases follow trivially from
symmetry and transitivity of equality.
Proof. Suppose that ܺÚu and let Ò be a homomorphism. We claim that Ò itself is also a homomorphism
from to v . Suppose ÝÂCØßÞ . Then there exists Ö and Ö in ¤ such that Ö¬ÏHÝ and zÓ ± ¨Ó̱ {ØÂ_Ä for
every ¿ Âáà4âi¨I©I©I©K¨ã2ä . Now, ÒzÖ {åÂà because Ò is a homomorphism. But also ÒzÖ${æÔÒzÖ { by the claim
above because zÓ ± ¨Ó4± {åÂÃÄ for every ¿ . But then
16
Thus ê is a homomorphism from ë to ì .
Suppose now that ëîíïì and let ê be a homomorphism. For every ðÃñ*ò , let ðÁó be a fixed represen-
tative of the ô -equivalence class of ð . Let õXöðt÷øPêöð ó ÷ for every ð . We
claim that õ is a homomorphism
from ù to ú . Suppose ûÃñüý . Then öûnóæ÷þçñÍüØÿ , so êööûó ÷þT÷ñÃüØÿ . Note that
õ;öû$÷þ¼øêöû ó ÷þøÔêKööû ó ÷þT÷ñÍü ÿ ø öü ÷Eø
þ öü ÷
But then õ;öû$÷ñü by the definition of
and . So õ is a homomorphism.
Proof. Let ú¾ÿ be the reduced version of ú . By Lemma 15, we have öú|÷./!$#0!'&)(+*1öú¾ÿ<÷ . Let úÏÿÿ
be the expansion of ú¾ÿ with the relations of ù . By Lemma 12, we have öú¾ÿ<÷24356-öú¾ÿÿ÷ . Suppose
now that ö¸ùÍ÷78öú|÷ . Note that ú¾ÿÿ is an expansion of ù by reduced relations. Moreover, since the
polymorphisms < of; a relation and its reduced version are the same, it follows from ]ö¸ùF÷9:öú|÷ that
;
every relation ü of ú ÿ is invariant under every polymorphism of ù . Therefore, by Theorem 2 every ü is
pp-definable in ù . By Lemma 13 we have öúÏÿ<÷=2>3?5@-ö¸ùÍ÷ . Composing we get -öú|÷="!$#%!'&)(+*
ö¸ùF÷ .
Lemma 19. Let the algebras A and A ÿ , and the structures ú and ú ÿ ø
BöúEDê$÷ be as above. Then
1. =öú|÷24356-öú¾ÿ
÷ ; and
2. A ÿ is a reduct of J7KXöú ÿ ÷ .
Proof. 1. We argue that =öú|÷øL=öú¾ÿ<÷ by arguing that ú and ú¾ÿ are homomorphically equivalent.
The homomorphism from ú ÿ to ú is just ê , and this is easy to check. As a homomorphism from ú to ú ÿ
we take any inverse of ê ; that is, any function MONPCÚí C¾ÿ such that MEöRQI÷ belongs to êIFIHöRQI÷ for every
QÅñSC . Such a function exists because ê is onto C . It is a homomorphism because if T is a tuple in ü ,
then êöRMEö%TE÷÷æøT , so MEö%Tb÷åñ*êGFIHöü ÷ .
2. It suffices to show that every operation of A ÿ is a polymorphism of ú¾ÿ . Let M;ÿ be an U -ary operation
of A ÿ , and let M be the corresponding operation of B . Suppose that û H D///VDû
W are U tuples that belong to
17
XGYIZ\[%]_^` X<[%aIZb`c/d/d/d<c?X<[%a
e,` ]_^
. Then the tuples all belong to . We apply f component-wise and we obtain
the tuple Z `c/d/d/d<c?X<[%g e Z `c/d/d/dc?X<[%g e
[ [RX<[%g `+`c/d/d/dc [RX[%g `+`+`d
f Z Z f h h
]_^
Since f is an operation of i , and i is a reduct of j , it is a polymorphism of k , so this tuple belongs to .
Now, by the choice of f , this tuple is the same as
[RX<[ [%g Z c/d/d/dcg e `+`c/d/d/dc?X[ [%g Z c/d/d/d<cg e `+`+`d
fml Z Z fml h h
X YIZ [%] ^ `
belongs to . This proves that f l preserves every relation of k l .
Let k be a finite structure and let j be its corresponding algebra. Suppose j l is an algebra that has a
subalgebra ionj l that is a reduct of j . Note that prqsonts l , i.e. the universes of i and j are the same
[ c `
and are a subset of the universe of j l . We define a new structure k l qvu"wx k s l , the extension of k , with
universe s l and the same relations as k .
[ c `
Lemma 20. Let the algebras j and j l , and the structures k and k l qu"wyx k s l be as above. Then
[ `}~4 [ `
1. z={| k z{-| k l ; and
[ `
2. j l is a reduct of 7 k l .
Proof. 1. The structures k and k l are homomorphically equivalent. Indeed the identity mapping on s is a
X
homomorphism of k to k l , and any mapping s l- s that is the identity on sns l and maps elements
from s l s to any element of s is a homomorphism from k l to k .
2. Let f l be an operation of j l and let f be the corresponding operation in i . Then f preserves every
relation of k because i is a reduct of j . But then, trivially, f l also preserves every relation of k l because
the relations in k l and k are the same.
] ] [%]c+`
Let be an -ary relation on the set p . Then the flattening of , denoted , is the -ary
[0 c/d/d/dVc+ ` [+[0 c/d/d/dc+ `c/d/d/d<c4[0V c/d/d/d<c+ `+`,
relation on p that contains all tuples Z h such that Z h YIZ Z h
]
. Let k be a finite structure and let j be its corresponding algebra. Suppose j l is an algebra that has a
direct power iqj l that is a reduct of j . Note that p:qsoqs l , i.e. the universes of i and j are the
[ c+`
same and are the -th power of the universe of j l . We define a new structure k l qv k , the flattening
of k , whose universe is s and whose relations are the flattenings of the relations of k .
[ c+`
Lemma 21. Let the algebras j and j l , and the structures k and k l q k be as above. Then
[ `}~4 [ `
1. z={| k z{-| k l ; and
[ `
2. j l is a reduct of 7 k l .
[ ` [ `
Proof. 1. Given an instance of z={| k , we need to define an instance l of z{| k l such that k
if, and only if, l k l . First we define l abstractly, and then show how to define it on through a
positive quantifier-free interpretation with parameters.
c/d/d/dc+6 ]
The universe of the structure l is p . For every -ary symbol in the vocabulary of
] ]
k , we have a corresponding -ary symbol l in the vocabulary of k l . The interpretation of l in l is
defined as the set of all tuples
[+[0 c `c/d/d/dc4[0 c+`c/d/d/d<c4[0¢¡£c `c/d/d/dc4[0¢¡yc+`+`
Z Z
18
such that ¤0¥V¦>§/¨/¨/¨<§+¥m©«ª belongs to ¬_ .
First we prove that this structure has the right property. If ®°¯²± and ³ is a homomorphism, then clearly
the mapping ³
´Vµ£¶´¢¯¸·9´ defined by the condition ³-´R¤+¤0¥<§+¹$ª+ªº³<¤0¥Iª» , where ³<¤0¥IªPº¼¤R³<¤0¥Gª?¦\§/¨/¨/¨<§?³<¤0¥Iª½-ª ,
is a homomorphism. Conversely, if ³ is a homomorphism from ® ´ to ± ´ , then the mapping ³ ´ ¤0¥Iª¾º
¤R³ ´ ¤+¤0¥§>¿4ª+ª§/¨/¨/¨§?³ ´ ¤+¤0¥<§+Àª+ª+ª is a homomorphism from ® to ± .
Next we show that this reduction is positive quantifier-free. Fix a pair of distinct variables Á¢Â«§%ÁV¦ that
will play the role of parameters. For concreteness, we can think of Á¢Â and Á<¦ as distinct elements of ¶ .
¦
Let Ãĺ Å0ÆÈÇÉÊGÀIËÍÌo¿ . We can think of the universe of ®Î´ as the subset of ¶=ÏÑÐ defined by the for-
mula Ò7¤0Ó«§+Ó¦>§/¨/¨/¨V§+Ó ª with ÃÔ̼¿ free variables that is satisfied by the tuples ¤0Ó«§+Ó¦"§/¨/¨/¨§+Ó ª for which
Ï Ï
¤0Ó ¦ §/¨/¨/¨<§+Ó ª encodes a number from Õ4Ö§/¨/¨/¨§+À
×Ø¿Ù in binary; the bits are encoded by ÓÚÛºÁ  or ÓÚÛºÁ ¦
Ï
for ¿_ÜØÝ,ÜÞÃ . The interpretation of the relational symbol ¬ ´ of arity ßyÀ is given by the formula
½ ©\å ¦
è è é é
¦ © ½ ¦ ½ ¦ ©\å ¦æ½ ¦ »î½ »î½
Ò@à
á'¤0â §/¨/¨/¨<§+⠪㺠¬1¤0Ó Â §+Ó Â Ð §/¨/¨/¨<§+Ӣ ä Ð ªVç ¤0ëìÈíI¤0Ó ¦ Ð §/¨/¨/¨§+Ó Ð ª@ºÞïÍ×Þ¿4ª§
ébê ê Ï
¦ » Â
é é
»î½ »î½
where ëìÈíI¤0Ó ¦ Ð §/¨/¨/¨V§+Ó Ð ªðºÞïÍ׿ abbreviates the expression
Ï
é é
»ñ½ »î½
Ó ¦ Ð º8Ý4¦çóò/ò/ò«çEÓ Ð º8Ý
Ï Ï
Proof. Let õ ºLùÆÉm¤R® ª and örºøù7ÆÉ¢¤%±1ª . Suppose that some algebra õ ´ of
¤0õþª is a reduct of ö . By
the HSP-theorem [8, Theorem 9.5] õ ´ is a homomorphic image of a subalgebra of a direct power of õ . Let
õ , õ , and õ be the direct power, its subalgebra, and the homomorphic image, respectively. We have that
½
õ ´ ºvõ . Let À be such that õ ºvõ , an let ³ be a homomorphism from õ to õ .
We use the three intermediate structures
1.
® Ûº¤R® §?³¢ª ,
2. ®
º \¤R® §¶ ª,
3.
® .º"!#
¤R®$§+Àª .
Using the fact that õ ´ ºõ is a reduct of öºù7ÆÉ¢¤%±1ª , now we apply Lemmas 19, 20, and 21 in sequence
to obtain
1. û=üý=¤%±1ªÜ &%(')6ûü-ý=¤R®ª and
õ is a reduct of ùÆÈÉ¢¤R® ª ,
2. û=üý=¤R® ªÜ *%+')6û=üý=¤R® ª and õ is a reduct of ù7ÆÉm¤R® ª ,
3. û=üý=¤R® $ªÜ&%+',)6ûüý¤R®-£ª , and õ is a reduct of ùÆÉm¤R®-£ª .
The last condition means that ýÇÆ$¤R® ª/.oýÇÆ ¤R®ª . It follows from Theorem 18 that ûü-ý=¤R® ª1Üÿ0
ûüý¤R® ª . Composing, we get ûü-ý=¤%±1ªÜÿ
_ûüý=¤R®úª .
19
5.6 Reduction from the idempotent case
To every finite structure 1 we associate a new structure, the singleton-expansion of 1 , by adding one unary
relation 243+5 for every 37698 . In other words, if 8;:<243(=+>???@>,3BAC5 , then the structure D01->243(=+5E>???F>243BAC5
G is
the singleton-expansion of 1 . Note that the polymorphisms of the singleton-expansion of 1 are exactly the
idempotent polymorphisms of 1 , that is polymorphisms H satisfying the identity HIDJK>???F>
JLGM:"J . Indeed,
every singleton set 243(5 is preserved by any idempotent polymorphism of 1 , and any polymorphism of 1
that preserves every singleton set 243(5 must by idempotent.
Lemma 23. Let 1 be a finite structure, and let N be the singleton-expansion of 1 . Then O*PRQSD01TGU&V+W,X
O*PQYD0NZG and if 1 is a core with at least two points, then OSPQSD0NZG[U&\ V OSPQSD01TG .
Proof. Since N is an expansion of 1 , the reduction O*PQSD01TG[U&V(WX]O*PRQSD0NZG follows from Lemma 12.
Let us now prove that O*PRQSD0NZGU \ V O*PRQSD01TG . Given an instance ^ of O*PQSD0NZG , we need to define an
instance _ of O*PQSD01TG such that _a`b1 if, and only if, ^c`dN . First we define _ abstractly, and then
show how to define it on ^ through an existential-positive interpretation with parameters.
The universe of the structure _ is the disjoint union of e and 8 . For every relation symbol f of arity g
in the vocabulary of 1 , the interpretation of f in _ is defined by cases: if the sets hjk i are pairwise disjoint,
we let fml:"nSo . Otherwise, we let fml be the set
where y is the set of mappings e<`{n such that the following two conditions are satisfied:
xrz
1. D|RG&69h k i qr243(5 for every 36}8 and |69h k i ,
x
2. D|RG~:| for every |-6e k v
h k i .
x
This defines the structure _ . Before we show how to define _ by an existential-positive interpretation, let
us show that it has the property we want:
Claim 24. _`1 if, and only if, ^`{N .
Proof. If the sets hk i are not pairwise disjoint, then clearly ^ ` N . In this case, every relation in _ is the
full relation and in particular it is reflexive. But then _{{ ` 1 since otherwise 1 would also be reflexive and
hence not a core with at least two elements.
Suppose in the following that the sets h k i are pairwise disjoint. Let be a homomorphism from ^ to
N . Note that KD|RG:3 for every |96hk i ; this remark will be of use later. Let be the unique extension of
to n:"8q-e such that D3GM:3 for every 37698 . We prove that is a homomorphism from _ to 1 . Let
6fml for some relation symbol f , and we aim to show that D GY6f p . Since 6rfml , either 6rf p ,
or 6 D0fi[G for some 6Zy . In the first case, D G~:
and hence D G*69f p as required. In the second
case, : x x
D]G for some 6}f i . Let :D|=+>???K>
| G and let us analyze the components |
distinguishing
x o
by cases whether they belong to some hk i or not. Suppose first |
]6}hk i for some 3 . Then KD|
G~:3 by the
remark above. Also D|
G&69h k i q243(5 by the definition of y . Continuing, if D|
G6Zh k i then D D|
G
GM:3
again by the remarkx above, and if D| G:3 then D D| G
G:D3G:3 by x the definition of . x Therefore
D D|
G
GY:;KD|
G . Suppose next that x |
m6
h k i for allx 368 . Then D|
GS:|
by the definition of y , and
D D| G
G:KD| G again. It follows that D D]G
G&:FD]G . Since 6xf i and is a homomorphism from ^
x
to x N , we have FD]G6 fm¡ . It follows that x D Gj6 f p because D G:D D¢G
Gm:tFD]G and fm¡;:;f p .
This proves that is a homomorphism. x
Suppose next that H is a homomorphism from _ to 1 . Note that 1 is an induced substructure of _ ,
so the restriction of H to 8 is a homomorphism from 1 to itself. Since 1 is a core, this restriction must
20
be an automorphism £ of ¤ . We may assume then that ¥ is the identity on ¦ ; otherwise we start with the
homomorphism obtained from ¥ by composing it with £¢§L¨ on ¦ . Now we define the map ©ª«t¬d¦ as
follows: if -®Z¯± ° for some ²7®9¦ , then ©K³R´~µ² ; otherwise, ©K³R´~µ¥I³R´ . Since we are assuming that the
sets ¯ ± ° are pairwise disjoint, the map © is well-defined. We claim that © is a homomorphism from ¶ to · .
First note that if ®}¯ ± ° , then ©F³´[®9¯± ¸ by definition. Now, let ¹®Zº ° for some relation symbol º , and
we prove ©F³¹]´[®9º ¸ . Define »rª¼«<¬{½ by »]³R´~µ² if -®9¯j± ° for some ² , and »¢³´Mµ otherwise. Since
the sets ¯ ± ° are disjoint, this is well-defined. Note that »"®¿¾ . Let ¹µÀ³
Ã+´ and let us analyze
¨+ÁÂÂÂ@Á
the components
Ä distinguishing by cases on whether they belong to some ¯± ° or not. Suppose first that
Ä]®9¯ ± ° for some ² . Then »]³
Ä´Iµ² by the definition of » , and ¥I³»¢³
Ä´
´Mµ² because ¥ is the identity on ¦ .
Also ©K³ Ä ´*µ² by the definition of © . Therefore ©F³ Ä ´*µ¥I³»]³ Ä ´
´ . Suppose next that Äm®Æ Å ¯ ± ° for any ² .
Then »]³
Ä´[µ
Ä by the definition of » , and ©F³
Ä´µÇ¥I³
Ä´ by the definition of © . Again ©F³
Ä´[µ<¥I³»]³
Ä´
´ .
It follows then that ©F³¹¢´Èµ¥I³»¢³¹]´
´ . Now, »¢³¹¢´&®9ºmÉ because »®9¾ and ¹ ®9º ° . Hence ¥I³»¢³¹¢´
´*®}ºmÊ
because ¥ is a homomorphism from Ë to ¤ . Thus ©F³¹¢´Y®º ¸ because º ¸ µº Ê . This proves that © is a
homomorphism.
We need to show that this reduction is indeed existential-positive. Fix a pair of distinct variables ÌCÍ Ì
Á ¨
that will play the role of parameters. For concreteness, we can think of ÌCÍ and Ì as distinct elements of « .
¨
Let ÎµÏ ¦9Ï and Ð[µÒÑÓÕÔ
Ö¼×LÎ4Ø&ÙÚ . We can think of the universe of Ë as the subset of «ÛÝÜK¨ defined by the
following formula with ÐLÙÚ free variables EÍ :
Á ¨ÁÂÂÂKÁ Û
³EÍSµ ÌCÍMÞ- µÇßßßൠL ´ áâ³ µ Ì Þ-ã7³
´ ´
¨ Û ¨ ¨ ¨+ÁÂÂÂ@Á Û Á
where ã³ ´ is a formula that is satisfied by the set of numbers ä®æå(ç ÎMèrÚ
é when encoded in
¨+ÁÂÂÂFÁ Û ± ± Á¢Á
binary; the bits are encoded by µ ÌCÍ or µÌ . This is the same technique as in the proofs of Lemmas 13
¨
and 21. Intuitively, the set of tuples ³EÍ ´ for which EÍ7µêÌCÍ~Þ} µëßßß#µ holds encodes « , and
ÁÂÂÂ@Á Û ¨ Û
the set of tuples for which Í µÇÌ Þrã³ ´ encodes ¦ . Now we define the interpretation of the
¨ ¨ ÁÂÂÂFÁ Û
relation symbol º by the following formula:ì
áZíCîáï ðô î
ðñ
òmó Á ì
where õ is the set of mappings öªå÷Ú é ¬ ¦aù¿å(ç Ú
é , and , íî and ð ô î are formulas to be
ÁÂÂÂFÁ
ø Á
described soon. Note the similarity of this formula with the abstract definition of ºmó É that we gave:
º Êrútû »¢³0º ° ´
üEñ
ý Â
Ã
The formula íî³¹ ¨ ¹ ´ encodes the set º Ê as a finite disjunction of conjunctions of equalities
ÁÂÂÂFÁ Á þ Ã
encoding the tuples of ºmÊ . This is easy to work out. The formula ðô îȳ¹M¨ ¹ ´ encodes the set
ó
Á
Â
 F
 Á Áþ
»¢³0º ° ´ as follows:
³ÿ ´Cßßß4³ÿ(ô³0ºT³ (ô@Þ Þ × ´
¨ ¨(ÁÂÂÂFÁ ¨
where
µ Í µÌCÍMÞ- µ µ Þ¯ ± ³ ´FÞ-¯ ± ³ ´
¨ ñ ¨ ÂÂÂ Û ¨
× µ Í µÌ Þ- µ Ì ± Þ Þ- µÌ ±
ñ
¨ ¨ ÂÂÂ Û
21
where
denote the bits of the binary encoding of
in a fixed numbering of , and where is the
set of such that !#"$
&%' and )( is the set of such that !#"$
* . Finally, the formula + is defined
as ,
456!78 -/. 69;:<8 -43 69=
-/.12 0 -43
where
and
( range over . This completes the definition of >@? . Note that + is used to make >@?A"CBED
whenever the sets 8G- F are not disjoint.
The quotient set endowed with all the operations K)m is called the quotient algebra Hqn of H . It is not hard
m
to see that Hqn is the homomorphic image of H under the homomorphism that takes LrOsH to L m .
m
In the sequel we also refer to type 1 as the unary type and to type 2 as the affine type. We use tame congruence
as a black box extracting properties we need from existing results, and we do not therefore need a precise
definition of the types. The type of a prime quotient ItkA^ is denoted by uv9wIj=^x , while uv9w\H] denotes
the set of types appearing as types of some prime quotient of H . If y is a class of algebras, uv9wz{yT denotes
the set |~}V
@uv!w!\Hq . If O<
b uv!w{yT , we say that y omits type . Otherwise, we say y admits type .
Lemma 25. Let H be a finite idempotent algebra. If
\Hq admits types 1 or 2 then it contains a finite
idempotent reduct of a module.
22
Proof. By a result from [6], if
\q does not omit type 1 then it contains a finite set, that is an algebra all
of whose operations are projections. So, suppose that
\] omits type 1, but does not omit type 2.
Since
\q does not omit type 2, there is a finite algebra
\q and a prime quotient A
7[ such that !!#= ¢¡ . Note first that taking £¤ instead of we may assume that `h¥ , the
equality relation, because it follows from tame congruence theory that !!x£¦M=£¦§e!#= for any
¨t© . Next we note that since is an idempotent algebra, every congruence class of is a subalgebra.
Take a non-trivial -class, and let ª be the corresponding subalgebra. The restriction of to « is the total
congruence ¬ .
A congruence centralizes ® modulo ¯ if for any term operation °V\±;²³³³;=±M´=µ²³³³;=µ´¶&·²³³³;&·
¸
,
² ² ² ² ²
any ¹ ² ³³³;&¹7¸Qlº , and any » ² ³³³;&» ´ , »9¼ ² ³³³;&»!´¼ , ½ ² ³³³W½ ¾ , ½1¼ ² ³³³;½1¾¼ in º such that » ¿ &»9¿¼ GÀ ,
½ ¿ ² ½1¿¼ Ás® , the following implication holds:
² ² ² ² ÃÂ ² ²
°V» ² ³³³W&» ´ ½ ² ³³³½ ¾ & ¹
²³³³;&¹7¸[ °V» ¼ ² ³³³;&» ´¼ ½ ² ³³³;½ ¾ & ¹
²³³³W&¹1¸
Ä
² ² ÃÂ
°V» ² ³³³W&» ´ ½ ¼ ² ³³³½ ¾¼ &¹
²³³³;&¹7¸[ °V» ¼ ² ³³³;&» ´¼ ½ ¼ ² ³³³;½ ¾¼ &¹
²³³³W&¹1¸³
It is known that 9\®¶&9ÆÅ'Çp¡ÉÈ if and only if centralizes itself modulo ® (see [18, Theorem 7.2]).
In our situation we have that centralizes itself modulo ¥ in . Therefore, ¬ centralizes itself modulo
¥ in ª . This implies 9!{ª;ÆÊËÅ'Çp¡ÉÈ , and, since
\] omits type 1, we obtain !!{ª;QÌÅ¡)È . By
Theorem 9.6 of [18] there is a ternary term operation Í that is Mal’tsev on ª , that is Í satisfies the identities
Ͷ\±W=µ¶=µp#fͶ\µ=µ¶=±É#a± . Therefore ª generates a congruence permutable variety, and by a result of [17]
it is an idempotent reduct of a module.
Recall from Section 3 the definition of the structure ÎoÏÐ Ñ for every finite Abelian group Ò and every
integer Ó]Ôf¬ .
Lemma 26. Let Õ be a finite module, let Ò be the Abelian group underlying the ring of Õ , and let be
an idempotent reduct of Õ . Then is a reduct of the algebra of ÎTÏzÐ Ñ for every Ó]Ôf¬ .
Proof. Let ÎfAÎ ÏÐ Ñ . Every Ö -ary term operation of can be represented in the form
°V\±²³³³=± ¾ j`Ó²=±;²×`ØØØ×lÓ ¾ ± ¾
and, as ° is idempotent, Ó²×cØØØz×AÓ ¾ Ù¬ . Take Ö tuples Ú)²³³³;&Ú ¾ in the relation ÛÝÜ Þ in Î , where
Ú ¿ $» ¿ ²³³³W&» ¿ for ß#ÆÅ'¬
³³³=ÖÆÈ . Check that the tuple
Ü
°V» ²=² ³³³W&» ¾ ² ³³³;°V» ² ³³³W&» ¾ =
Ü Ü
also belongs to Û ÜÞ :
Therefore, every relation of Î is invariant under every operation of . That is, is a reduct of the algebra
of Î .
23
6.2 Unary and affine types and definability
We can bring together the results of Section 5 and the previous subsection to establish the following theorem.
Theorem 27. Let á be a finite structure and let â be its algebra. If ãä
åæâç admits types 1 or 2 then there
exists a non-trivial finite Abelian group è such that éÝêëEæìoíî ïçðñò/ó\òSôöõ=÷TéEêëEæáqç for every ø]ùfú .
Proof. Since éÝêë§æá]çsûüéÝêzëEæý7þå&ÿ9æáqç=ç , where ý7þå&ÿ'æáqç is the core of á , we may assume that á is a
core. Let be the singleton-expansion of á and let be its algebra, which is idempotent. By Lemma 23,
we have éÝêzëEæ ç<ðñò/ó\òSôöõ=÷ÆéÝêëEæáqç . Moreover, if ãä
åæâç admits types 1 or 2, so does ãä
åæ]ç because
is a reduct of â (see [18, Chapter 5]). By Lemma 25, the variety ãä
åæ]ç contains a finite idempotent
reduct of a module. Let è be the Abelian group underlying the ring of the module. Then è is non-trivial
and finite. Moreover, is a reduct of the algebra of ì íî ï for every øÆù ú by Lemma 26. It follows that
éÝêë§æìTízî ï7çðñò/óòSôöõ=÷TéÝêëEæ ç . Composing we get the result.
We have seen in Section 3 that éÝêë§æìTízî ç is not definable in é when è is non-trivial. Since defin-
ability in é is preserved downwards by Datalog-reductions, this yields the following corollary:
Corollary 28. Let á be a finite structure and let â be its algebra. If éÝêzëEæáqç is definable in é , then
ã
ä
å
æâç omits types 1 and 2.
Corollary 28 can be seen as a strengthening of the result of Larose and Zadori [25] that if the complement
of éÝêëEæáqç is definable in Datalog then ãä
å
æâç omits types 1 and 2. Larose and Zadori also conjectured
the converse, namely that if ã
ä
å
æâç omits types 1 and 2 then the complement of éÝêëEæáqç is definable in
Datalog. By Corollary 28 this conjecture would imply that every éÝêëEæáqç is either definable in Datalog or
not definable in é , which can be seen as a definability dichotomy.
Another consequence of Corollary 28 is that graph 3-colourability (i.e., éEêëEæ
ç ) is not definable in
é , since its algebra has no operations but the projections and therefore admits type 1.
While this has previously been proved directly [11], our result gives a new proof that gives an algebraic
explanation for why the problem is not definable.
References
[1] A. Blass, Y. Gurevich, and S. Shelah. On polynomial time computation over unordered structures. J.
Symbolic Logic, 67(3):1093–1125, 2002.
[2] V.G. Bodnarchuk, L.A. Kaluzhnin, V.N. Kotov, and B.A. Romov. Galois theory for post algebras. i.
Kibernetika, 3:1–10, 1969. [Russian].
[3] A. A. Bulatov and V. Dalmau. A simple algorithm for mal’tsev constraints. SIAM J. Comput., 36(1):16–
27, 2006.
[4] A. A. Bulatov, P. Jeavons, and A. Krokhin. Classifying the complexity of constraints using finite
algebras. SIAM Journal on Computing, 34:720–742, 2005.
[5] A.A. Bulatov. Mal’tsev constraints are tractable. Technical Report PRG-RR-02-05, Computing Labo-
ratory, University of Oxford, Oxford, UK, 2002.
24
[6] A.A. Bulatov and P.G. Jeavons. Algebraic structures in combinatorial problems. Technical Report
MATH-AL-4-2001, Technische universität Dresden, Dresden, Germany, 2001.
[7] G. Buntrock, C. Damm, U. Hertrampf, and C. Meinel. Structure and importance of logspace-MOD
class. Mathematical Systems Theory, 25:223–237, 1992.
[8] S. Burris and H.P. Sankappanavar. A course in universal algebra, volume 78 of Graduate Texts in
Mathematics. Springer-Verlag, New York-Berlin, 1981.
[9] V. Dalmau. Linear datalog and bounded path duality of relational structures. Logical Methods in
Computer Science, 1(1), 2005.
[10] V. Dalmau, Ph.G. Kolaitis, and M.Y. Vardi. Constraint satisfaction, bounded treewidth, and finite
variable logics. In Proceedings of the 8th International Conference on Principles and Practice of Con-
straint Programming, CP’02, Lecture Notes in Computer Science, pages 311–326. Springer-Verlag,
2002.
[11] A. Dawar. A restricted second order logic for finite structures. Information and Computation, 143:154–
174, 1998.
[13] H-D. Ebbinghaus and J. Flum. Finite Model Theory. Springer, 2 edition, 1999.
[14] T. Feder and M.Y. Vardi. Computational structure of monotone monadic SNP and constraint satisfac-
tion: A study through Datalog and group theory. SIAM Journal of Computing, 28:57–104, 1998.
[15] D. Geiger. Closed systems of function and predicates. Pacific Journal of Mathematics, pages 95–100,
1968.
[16] L. Hella. Logical hierarchies in PTIME. Info. and Comput., 129:1–19, 1996.
[17] C. Herrman. Affine algebras in congruence-modular varieties. Acta Sci. Math. (Szeged), 41:119–125,
1971.
[18] D. Hobby and R.N. McKenzie. The Structure of Finite Algebras, volume 76 of Contemporary Mathe-
matics. American Mathematical Society, Providence, R.I., 1988.
[20] P.G. Jeavons, D.A. Cohen, and M. Gyssens. Closure properties of constraints. Journal of the ACM,
44:527–548, 1997.
[21] P.G. Jeavons, D.A. Cohen, and M. Gyssens. How to determine the expressive power of constraints.
Constraints, 4:113–131, 1999.
[22] P.G. Jeavons, D.A. Cohen, and J.K. Pearson. Constraints and universal algebra. Annals of Mathematics
and Artificial Intelligence, 24:51–67, 1998.
[23] Ph.G. Kolaitis and M.Y Vardi. A game-theoretic approach to constraint satisfaction. In Proc. 17th
National Conference on Artificial Intelligence, AAAI-2000, pages 175–181, 2000.
[24] B. Larose, C. Loten, and C. Tardif. A characterisation of first-order constraint satisfaction problems.
In Proc. 21st IEEE Symp. on Logic in Computer Science, pages 201–210, 2006.
25
[25] B. Larose and L. Zádori. Bounded width problems and algebras. Algebra Universalis, 58:439–466,
2007.
[27] A.K. Mackworth. Consistency in networks of relations. Artificial Intelligence, 8:99–118, 1977.
[28] U. Montanari. Networks of constraints: Fundamental properties and applications to picture processing.
Information Sciences, 7:95–132, 1974.
[29] O. Reingold. Undirected st-connectivity in log-space. In 37th Annual Symposium on Theory of Com-
puting, pages 376–385, 2005.
[30] P. Seymour and R.Thomas. Graph searching and a min-max theorem for treewidth. Journal of Com-
binatorial Theory, Series B, 58:22–33, 1993.
26