COMPUTATIONAL COMPLEXITY OF CHECKING IDENTITIES IN 0 ...

4 downloads 20458 Views 215KB Size Report
Recently, M. Volkov [20] used the name CHECK-ID (checking iden- tities) for the ..... Let g be the partial map from B(p) to ΓS with domain ΓS which fixes the ...
COMPUTATIONAL COMPLEXITY OF CHECKING IDENTITIES IN 0-SIMPLE SEMIGROUPS AND MATRIX SEMIGROUPS OVER FINITE FIELDS ´ STEVE SEIF AND CSABA SZABO Abstract. In this paper we analyze the so called word-problem for (finite) combinatorial 0-simple semigroups and matrix semigroups from the viewpoint of computational complexity.

1. Introduction The computational complexity of the word problem in algebra is of greater and greater interest. In this paper we present results of the authors from 1997, when they were guests of The Fields Institute of Mathematics in Toronto. Since then the area has developed a lot. In the introduction we try to summarize all those results of this topic that we are aware of. It turns out, for example, that in most cases the multiplicative semigroup of a ring guarantees the hardness of the word problem for the ring itself. It means that to decide whether or not two monomials are equivalent is already coNP-complete for several rings. Hence hardness of the word problem for semigroups implies the hardness of the word problem for rings. We use standard notations in semigroup theory (for a detailed reference see [4]) and computational complexity (see [6]). In 1997 Ross Willard gave a talk at The Fields Institute where he presented several results and problems concerning algebraic complexity questions about rings. He defined two versions of the word problem. There are two kinds of words. A term on an algebra A is an expression that can be obtained using (iterated) compositions of the basic operations and projections. The projections are the trivial operations pni (x1 , . . . , xn ) = xi . A polynomial on an algebra A is an expression that can be obtained using (iterated) compositions of the basic operations, projections and nullary, constant operations. Key words and phrases. 0-simple semigroup, polynomial, term, complexity. The research of the authors was supported by the Hungarian National Foundation for Scientific Research, Grant F32325 and T038059 T043671. 1

2

´ STEVE SEIF AND CSABA SZABO

Example 1.1. Let A = S3 , the symmetric group on 3 letters. Then the expression p(x1 , x2 ) = x21 (12)x2 (123)x1 is a polynomial and t(x1 , x2 ) = x−1 1 x2 x1 x2 x1 is a term (and a polynomial at the same time). The two versions of the word problem are the term equivalence, (TERM-EQ), and the polynomial equivalence (POL-EQ) problems. Recently, M. Volkov [20] used the name CHECK-ID (checking identities) for the TERM-EQ problem. Definition 1.1. Let A be an algebra. Two terms t1 and t2 are called equivalent (t1 (x1 , . . . , xn ) ≡ t2 (x1 , . . . , xn ) or shortly t1 ≡ t2 ) if the values of the two terms are equal at every substitution from A. An instance of the term equivalence problem (TERM-EQ A) is a pair of terms t1 and t2 with the question whether or not the two terms are equivalent. We can define the polynomial equivalence problem in a similar way. Definition 1.2. Let A be an algebra. Two polynomials p1 and p2 are called equivalent (p1 ≡ p2 ) if the values of the two polynomials are equal at every substitution from A. An instance of the polynomial equivalence problem (POL-EQ A) is a pair of polynomials p1 and p2 with the question whether or not the two polynomials are equivalent. For finite structures there is an obvious algorithm to decide these problems. Indeed, one can check every possible substitution, and if the two terms (polynomials) agree at all of them then they are equivalent. On the other hand, if one finds a tuple of elements NOT satisfying the equation, then it can be showed in polynomial time that the two words are not equivalent. Hence for finite algebras both equivalence problems are obviously in coNP. In what follows, all algebras will be finite. Example 1.2. The two terms t1 (x1 , x2 , x3 ) = x2 x63 and t2 (x1 , x2 , x3 ) = −1 3 (x−1 1 x2 x1 x2 ) x2 are equivalent over the symmetric group S3 . The −1 exponent of S3 is 6, hence t1 ≡ x2 ; the values of x−1 1 x2 x1 x2 are in A3 , the commutator subgroup of S3 , and so the third power of them is the identity permutation thus t2 ≡ x2 , as well. The two polynomials p and t in Example 1.1 are not equivalent because p((12), id) = (213) 6= t((12), id) = (12). Willard in his talk discussed these two problems for rings. It was already known ([10]) that for a commutative ring R the TERM-EQ problem is in P if R is nilpotent and coNP-complete otherwise. Burris and Lawrence proved in [3] that the same holds for rings in general. Following their proof it is easy to see that for a nilpotent ring R the

IDENTITIES IN SEMIGROUPS

3

problem POL-EQ R is in P and it is a straightforward consequence of their result that if the ring is not nilpotent, then POL-EQ R is coNPcomplete. They used the fact that a non-solvable group has a type 3 quotient in the sense of tame congruence theory ([9]). An unpublished result of Burris and Lawrence uses the same idea: Theorem 1.3. Let G be a group. If G is nilpotent, then TERM-EQ G is in P. If G is not solvable, then TERM-EQ G is coNP-complete. For example A5 , the alternating group on 5 letters, has a coNPcomplete TERM-EQ problem. They also showed that the problem is in P for the dihedral groups. In a ring there are two basic operations, + and ·. The formal definition of terms and polynomials allows us to use iterated addition and multiplication, for example the expression (x1 +y1 )(x2 +y2 ) · · · (xn +yn ) is a term over a ring. If we expand this term into a sum of monomials, we obtain a sum of 2n many monomials of length n. The length of a term is crucial from the computational point of view. Moreover, when a ring-term or -polynomial is presented, in most cases it is given as a sum of monomials. This is the reason why Lawrence and Willard introduced the Σ version of the identity checking problem for rings. Definition 1.4. Let R be a (finite) ring. An instance of the termsigma equivalence (pol-sigma equivalence) problem (TERMΣ -EQ R, POLΣ -EQ R) is a pair of terms (polynomials) presented as sums of monomials with the question whether or not the two terms (polynomials) are equivalent. Naturally, if the Σ version of a word problem is hard, then the word problem is hard, as well. The complexities of the two problems are not always the same, though. Lawrence and Willard prove the following theorem in [13]. Theorem 1.5. Let R be a ring and J(R) denote its Jacobson radical. If R/J(R) is commutative, then TERMΣ -EQ R is in P. If R is a finite matrix ring whose invertible elements form a non-solvable group then TERMΣ -EQ R is coNP-complete. That is, if n ≥ 3 or K is a field of size at least 4, then for Mn (K), the n by n matrix ring over K, TERMΣ -EQ Mn (K) is coNP-complete. The answer for semigroups is far less complete. In [20] a semigroup of size ≤ 21700 is exhibited with a coNP-complete TERM-EQ problem. Later Kisielewicz ([11]) presented an example of size a few hundred. Recently, Cs. Szab´o and V. V´ertesi ([18]) proved that TERM-EQ M2 (Z2 ) and TERM-EQ M2 (Z3 ) are coNP-complete for the multiplicative semigroups of matrices, hence TERMΣ -EQ M2 (Z2 ) and TERMΣ -EQ M2 (Z3 )

4

´ STEVE SEIF AND CSABA SZABO

are coNP-complete, as well. They also constructed a semigroup of size 13 with coNP-complete term equivalence problem. The smallest example of a semigroup with coNP-complete term equivalence problem is due to O. Kl´ıma [12] and the first author [16], independently. They presented a semigroup of size 6. In [17] we establish a polynomial equivalence between POL-EQ S, where S is an arbitrary combinatorial 0-simple semigroup, and certain problems concerning bipartite graphs. As a corollary, it is shown that POL-EQ M2 (Z2 ) is coNP-complete. In [1] Barrington et al. show for a special class of aperiodic monoids that the POL-EQ problem is tractable. What they really do is that they investigate the EQUATION SATISFIABILITY problem. Let TERM-SAT A and POL-SAT A denote the term- (polynomial)-satisfiability problems. An instance of TERM-SAT (POL-SAT) is a term (polynomial) t and an element a ∈ A and the question is whether there is an evaluation of t such that t = a. Although [1] is about the POL-SAT problem, the results naturally apply to the POL-EQ problem. In this paper we investigate all these and a few other complexity problems for (finite) matrix semigroups and 0-simple semigroups, and the latter will always be considered in their standard Rees matrix representation. 2. Preliminaries 2.1. Graphs. For a graph H we shall denote the vertices and edges of H by V (H) and E(H), respectively. A graph G is irreflexive if it has no loops. By the word graph we shall mean an irreflexive graph without multiple edges. A homomorphism f of a graph G to a graph H is a vertex mapping f : V (G) → V (H) which preserves the edges, that is, uv ∈ E(G) implies f (u)f (v) ∈ E(H). For a fixed graph H, the homomorphism problem HOMH asks whether or not there exists a homomorphism to H from an input graph G. Note that when H is the complete graph with n vertices, a homomorphism of G to H is an n-coloring of G. For a fixed graph H, the input of OAL H (one or all list homomorphism) is a graph G and a partial map g from G to H, where each vertex v in the domain of g is mapped to the vertex g(v). The problem OAL H asks whether or not g can be extended to a homomorphism. The elements of the domain of g are called colored points. A colored point v has color g(v). For a fixed graph H, RETH (retraction to H) asks whether or not the input graph G with a subgraph H 0 , isomorphic to H, admits a

IDENTITIES IN SEMIGROUPS

5

homomorphism to H 0 fixing H 0 vertex-wise (such a map is called a retraction to H 0 ). It is a fairly easy exercise to show that for a graph H the problems RETH and OAL H are polynomially equivalent. We list a few results concerning complexity of various homomorphism problems: Hell and Neˇsetˇril [8] showed that HOMH is in P if H is bipartite, and is NP-complete otherwise, hence OALH is NP-complete if H is not bipartite. The classification of the OAL problem is not complete yet. There are bipartite graphs with tractable and with hard OAL problems as well. Let Jn denote the n by n matrix where every entry is 1 and In the n by n identity matrix. For a 0-1 matrix M let ΓM denote the bipartite graph with adjacency matrix M . The vertices of ΓM are the row and the column indices of M and a column index i is connected with a row index λ if M (λ, i) = 1. Theorem 2.1. ([5], [2]) Let Bn = Jn − In . The retraction problem for the bipartite graph ΓBn is NP-complete. 2.2. Semigroups. We shall consider Rees matrix semigroups and in most cases we shall deal with the case when the underlying group G has one element. This element will be denoted by 1. If there is no confusion, the Rees matrix semigroup M0 ({1}; I, Λ; M ) will be denoted by SM (the semigroup belonging to the matrix M ) and for the triple (1; i, λ) we write [i, λ]. If M is a 0-1 matrix then the multiplication rule in SM is ( [i, γ] if M (λ, j) = 1 [i, λ][j, γ] = 0 if M (λ, j) = 0. Rees matrix semigroups contain 0 as a constant. An instance of POL-NZ S is a polynomial {p} over S. The problem asks if it is true that p is not identically 0, in other words whether it is true that there is a tuple of elements (a1 , . . . , ak ) ∈ Sk such that p(a1 , . . . , ak ) 6= 0. It is easy to see that POL-EQ S is in coNP and POL-NZ S and POL-SAT S are in NP. We continue with an observation: Lemma 2.2. Let M be a 0-1 matrix with at least one 1 in each row and each column, and let S = SM be the combinatorial 0-simple semigroup belonging to M . Then (1) For s, t ∈ S, s 6= 0 and t 6= 0, there exist u, v ∈ S such that usv = t. (2) a1 . . . ak = 0 if and only if there exists j, 1 < j ≤ k, such that aj−1 aj = 0. (3) If [i1 , j1 ] . . . [ik , jk ] 6= 0, then [i1 , j1 ] . . . [ik , jk ] = [i1 , jk ]

6

´ STEVE SEIF AND CSABA SZABO

Proof. For item 1 let s = [i, j] and t = [a, b]. Choose n and m so that Mn,i = Mj,m = 1. By the assumption on M such m, n exist. Now, u = [a, n] and v = [m, b] will do. Items 2 and 3 are clear from the description of the multiplication rule.  A 0-1 matrix M determines the semigroup SM and the bipartite graph ΓM . This gives a natural correspondence between bipartite graphs, 0-1 matrices and combinatorial 0-simple semigroups. The graph corresponding to the semigroup S will be denoted by ΓS and the semigroup belonging to the graph Γ will be denoted by SΓ . Now, let p(x1 , x2 , . . . , xk ) = p be a polynomial over the semigroup SM , where M is an n × m 0-1 matrix. Let B(p) denote the following (bipartite) graph: B(p) has m + k many “top” and n + k many “bottom” vertices. The top vertices are 1, 2, . . . , m and u1 , u2 , . . . uk , the bottom vertices are 1, 2, . . . , n and v1 , v2 , . . . , vk . The top and bottom vertices will represent the first and second coordinates of the semigroup elements and variables, respectively. We imagine the variable xi as a pair [ui , vi ]. Observe that the vertices of ΓS are vertices of B(p), too. There is an edge between vi and uj if xj follows xi somewhere in p, that is, if xi xj is a subword of p. Similarly, let 0 ≤ λ ≤ n; the bottom vertex λ be connected by an edge with uj if [i, λ]xj is a subword of p for some 1 ≤ i ≤ n, and there is an edge from vj to a top vertex i if xj [i, λ] is a subword of p for some 1 ≤ λ ≤ m. A similar construction of directed graphs can be found in [14], paragraph III/A. Properties of the identities are described there with directed graphs, similarly to what follows in the next paragraph. We use the non-directed version of the construction because graph homomorphisms are better understood for the non-directed case. Let g be the partial map from B(p) to ΓS with domain ΓS which fixes the vertices of ΓS . Any evaluation of p induces an extension of g, a map f from V (B(p)) to V (ΓS ). Namely, if we substitute xj = [i, λ] then we put f (vj ) = λ and f (uj ) = i. The following observation and theorem are taken from [17] and will be the key steps to our results. Lemma 2.3. The value of p at an evaluation is not 0 if and only if the corresponding extension map f is a graph homomorphism from B(p) to ΓS . Theorem 2.4. Let M be a 0-1 matrix. For every bipartite graph B and partial map g : B → ΓM there is a polynomial p over SM such that p is not identically 0 if and only if g can be extended to a graph homomorphism from B to ΓM . POL-NZ SM and RET ΓM are polynomially equivalent in the computational sense (see e.g. [6]).

IDENTITIES IN SEMIGROUPS

7

Moreover, in [17] there is a polynomial time algorithm presented that constructs p from B and g. Let Ln (K) denote the multiplicative semigroup of n × n matrices of rank at most 1 over the field K and fix a basis e1 , . . . , en for the vectorspace K n . Every nonzero element of Ln (K) can be uniquely written in the form αu · v T , where α ∈ K ∗ , u, v ∈ K n and the first nonzero coordinate of u and v is equal to 1. Let u1 , u2 , . . . , ut be the set of vecn −1 tors with 1 as their first nonzero coordinate. Here t = |K| . The map |K|−1 T 0 [k; i, λ] → kv i ·uλ and 0 → 0 is an isomorphism from M (G; I, Λ; M ) to n −1 Ln (K) where G = K ∗ , I = Λ = {1, 2, . . . , |K| } and M (i, j) = uTi uj , |K|−1 the scalar product of the vectors ui and uj . We have M (i, j) = 0 if and only if ui is orthogonal to uj . Let us examine the description of L2 (K). The index set of the rows and columns corresponds to the lines of the 2-dimensional vectorspace. In dimension 2 for every line l there is a unique orthogonal line, hence in the matrix M there is a unique 0 in every row and every column. After rearranging the columns and rows we obtain a matrix M such that Mij = 0 if and only if i = j. In Section 3 and Section 4 we discuss complexity problems involving polynomials and terms, respectively. 3. Polynomials In this section we analyze complexity problems involving polynomials for matrix semigroups and Rees matrix semigroups. We prove that if n ≥ 2, then the POL-EQ Mn (K) and POL-SAT Mn (K) problems are all hard (in the semigroup sense). In the rest of the paper we assume that semigroup polynomials do not contain two consecutive constants. Indeed, two consecutive constants can be substituted with their product. For a demonstration of the main idea we start with a special case. Theorem 3.1. POL-NZ L2 (Z2 ) and POL-NZ M2 (Z2 ) are NP-complete. POL-EQ L2 (Z2 ) and POL-EQ M2 (Z2 ) are coNP-complete. Proof. As we have seen above, L2 (Z2 ) ' SB3 . By Theorem 2.1 RET ΓB3 is NP-complete and by Theorem 2.4 POL-NZ L2 (Z2 ) is NP-complete, as well. The co-problem of POL-NZ L2 (Z2 ) is a special case of POL-EQ L2 (Z2 ) hence POL-EQ L2 (Z2 ) is coNP-complete. Now, for every polynomial p over L2 (Z2 ) we exhibit a polynomial q over M2 (Z2 ) such that p ≡ 0 if and only if q ≡ 0, which proves the rest of the statement. Let p(x1 , x2 , . . . , xk ) be a polynomial over

8

´ STEVE SEIF AND CSABA SZABO



 1 0 L2 (Z2 ). Substituting Xi = yi z for xi , the value of Xi takes 0 0 i on all elements of L2 (Z2 ) while yi and zi run through M2 (Z2 ). Hence p(x1 , x2 , . . . , xk ) ≡ 0 in L2 (Z2 ) if and only if p(X1 , X2 , . . . , Xk ) ≡ 0 in M2 (Z2 ). Thus q(y1 , z1 , . . . , yk , zk ) = p(X1 , X2 , . . . , Xk ) will do.  For the two-dimensional case over other fields we start with a general observation: Proposition 3.2. Let M be a matrix over a group G with zero and ¯ be the matrix such that M ¯ (i, j) = 0 if and only if M (i, j) = 0 and let M ¯ (i, j) = 1 otherwise. Then POL-NZ SM¯ and POL-NZ M0 (G; Λ, I; M ) M have the same complexity. Proof. A product is 0 if and only if there is a 0 entry of the sandwich ¯ (i, j) we matrix at the appropriate place and by the definition of M ¯ (i, j) = 0 if and only if M (i, j) = 0. have M  Taking a look at the description of L2 (K) at the end of Subsection ¯ = Bn , where n = |K| + 1, the number of lines 2.2 we can see that M in the two dimensional vectorspace K 2 . Theorem 3.3. POL-NZ L2 (K) is NP-complete and POL-EQ L2 (K) is coNP-complete. Similarly, POL-NZ M2 (K) and POL-EQ M2 (K) are hard. Proof. The first two statements are implied by Theorem 2.1, Proposition 3.2 and the previous paragraph. The hardness of POL-NZ M2 (K) and POL-EQ M2 (K) can be verified identically to the case K = Z2 .  Now, we can state the main result of the section: Theorem 3.4. Let K be an arbitrary finite field. Then POL-NZ Mn (K) is NP-complete and POL-EQ Mn (K) is coNP-complete. Proof. We shall reduce the 2×2 case to this problem. Let p(x1 , x2 , . . . , xk ) be a polynomial over M2 (K) and let A denote the n × n matrix with a11 = a22 = 1 and aij = 0, else. Now, let Xi = Axi A. As xi ranges over Mn (K), the only nonzero entries of Xi are at the places (1, 1), (1, 2), (2, 1), (2, 2), and every 2 × 2 matrix can be obtained in this way as the top left corner of an n × n matrix. Hence p(X1 , . . . , Xk ) ≡ 0 over Mn (K) if and only if p(x1 , . . . , xk ) ≡ 0 over M2 (K). Thus both problems are hard.  Theorem 3.5. Let M be a 0-1 matrix with at least one 1 in each row and column, and let S = SM be the combinatorial 0-simple semigroup belonging to M . Then POL-SAT S and POL-NZ S are polynomially equivalent.

IDENTITIES IN SEMIGROUPS

9

Proof. Let p be a polynomial and x, y be two variables not occurring in p. Then p is not identically 0 if and only if xpy = [1, 1] has a solution. Indeed, let us assume that p is not identically 0. Then there is a pair [i, λ] such that p = [i, λ] has a solution a1 , a2 , . . . , an . There are nonzero entries in both the ith column and λth row of M . Let for example Mµ,i = 1 = Mλ,j . Then x = [1, µ] and y = [j, 1] alongside with a1 , a2 , . . . , an is a solution of xpy = [1, 1]. On the other hand, if xpy = [1, 1] for some evaluation then p is obviously not identically 0. Now, let p(x1 , . . . , xn ) = x1 · · · · · xt = b = [i, λ] be an instance of POL-SAT S. Let q(x1 , x2 , . . . , xt , . . . , xn ) = p([i, 1]x1 , x2 , . . . , xt [1, λ], . . . , xn ) if t 6= 1 and q(x1 , x2 , . . . , xn ) = p([i, λ], x2 , . . . , xn ) if t = 1. Moreover, let Mµ,1 = 1 = M1,j . Let us assume first that t 6= 1. If q(a1 . . . , at , . . . , an ) 6= 0, then p([i, 1]a1 , . . . , at [1, λ], . . . , an ) = [i, λ]. If p(a1 . . . , at , . . . , an ) = [i, λ], where a1 = [i, ν] and at = [k, λ], then q([j, ν], a2 , . . . , [k, µ], . . . , xn ) 6= 0. The case t = 1 can be handled similarly.  Corollary 3.6. Let K be a field and n ≥ 2. Then POL-SAT Ln (K) and POL-SAT Mn (K) are NP-complete. Theorem 3.7. Let T be a semigroup containing a 0-simple semigroup S as an ideal. Then the following hold: (1) If POL-NZ S is NP-complete, then POL-EQ T is coNP-complete. (2) If POL-SAT S is NP-complete then POL-SAT T is NP-complete. Proof. Let s be an arbitrary nonzero element of S. Then TsT = S. Let p(x1 , . . . , xk ) = a be an instance of POL-SAT S and s a nonzero element of S. Putting Xi = yi szi , where yi and zi are new variables, p(x1 , . . . , xk ) = a has a solution over S if and only if p(X1 , . . . , Xk ) = a has a solution over T. Similarly, let p(x1 , . . . , xk ) be an instance of POL-NZ S. Now, p is identically 0 in S if and only if p(X1 , . . . , Xk ) ≡ 0 over T .  4. Terms In this section we investigate complexity problems involving terms. Using the graphs B(t) assigned to the terms t we analyze the identities satisfied by a 0-simple semigroup. Similar descriptions of identities are presented in [7], [14], [19]. Let S be a semigroup with 0. For a term or a polynomial p(x1 , . . . , xk ) over S let Z(p) denote the zero-set of p, Z(p) = {(a1 , . . . , ak ) ∈ Sk | p(a1 , . . . , ak ) = 0}. An instance of the problem TERM-ZSET (POL-ZSET) is a pair

10

´ STEVE SEIF AND CSABA SZABO

of terms (polynomials) with the question whether or not the zero-sets of the two terms (polynomials) are the same. We shall split the possibilities into two cases. Case 1 M is a 1-block matrix, that is, M (λ1 , i1 ) = M (λ1 , i2 ) = M (λ2 , i1 ) = 1 implies M (λ2 , i2 ) = 1. Then by rearranging the rows and columns of M we can obtain a block diagonal matrix, where every block contains only 1-s. Now, ΓM is the discrete union of complete bipartite graphs, and if there are at least two blocks in M , then the Brandt semigroup is the homomorphic image of SM . Case 2 M is not a 1-block matrix, that is, there is a 2 × 2 submatrix containing three 1-s and a 0. After rearranging the rows and columns we can obtain a matrix M such that M (1, 1) = M (1, 2) = M (2, 1) = 1 and M (2, 2) = 0. In this case (1, 1), (1, 2) and (2, 1) are edges of ΓS and (2, 2) is not an edge. The spanned subgraph on the vertices 1, 2 ∈ Λ and 1, 2 ∈ I is a path of length 4. In both cases the following sequel to Theorem 3.7 will be useful. Lemma 4.1. Let S be a 0-simple semigroup. If POL-ZSET S is in P, then POL-NZ S, POL-SAT S and POL-EQ S are in P. Proof. For the first assertion checking POL-NZ for an instance p means whether or not the zero-sets of 0 and p are the same. The second part of the statement is a corollary of Theorem 3.5. Finally, let p = x1 · · · · · xk and q = y1 · · · · · ym . Now, p ≡ q if and only if the following three conditions hold (1) every time when the first component of x1 differs from the first component of y1 both polynomials are identically 0, (2) if the second component of xk differs from the second component of ym , both polynomials are identically 0 (3) the zero-sets of the two polynomials are the same. This can be checked in polynomial time.  4.1. Term problems for Case 2. In this section we assume that we are in Case 2. The polynomial questions for Case 2 are discussed in [17]. Now, we finish the investigation of the problems involving terms. Lemma 4.2. Let t1 and t2 be two terms over S. Then Z(t1 ) = Z(t2 ) if and only if B(t1 ) = B(t2 ). In particular, TERM-ZSET S is in P. Proof. By Lemma 2.3 the zerosets of the two terms are the same if and only if for every evaluation map of all vertices of B(t1 ) and B(t2 ), the map is a graph homomorphism from B(t1 ) exactly if it is a homomorphism from B(t2 ). Now, let us assume that B(t1 ) 6= B(t2 ). Then

IDENTITIES IN SEMIGROUPS

11

without loss of generality we may assume that there is an edge (vk , ul ) of B(t1 ) that is not an edge of B(t2 ). In this case put ( 2 if i = k φ(vi ) = 1 if i 6= k ( 2 if i = l φ(ui ) = 1 if i 6= l. The map φ is a homomorphism of B(t2 ) to ΓS but is not a homomorphism of B(t1 ) to ΓS . To see the converse, let us assume that there is an evaluation such that t1 6= 0 and t2 = 0. This evaluation induces a map φ of the vertices such that φ|B(t1 ) is a homomorphism but φ|B(t2 ) is not. Then there is an edge of B(t2 ) that is not mapped to an edge of ΓS . This edge cannot belong to B(t1 ), hence the two graphs are different.  The following theorem is the algorithmic version of the Proposition in [19]. Theorem 4.3. Let t1 = x1 · · · · · xk and t2 = y1 · · · · · ym be two terms over S. Then t1 ≡ t2 if and only if the following hold: (1) B(t1 ) = B(t2 ); (2) x1 = y1 ; (3) xk = ym . Proof. Lemma 4.2 and item (1) imply that t1 = 0 if and only if t2 = 0. If there is an evaluation such that none of the two terms is equal to 0 then by Lemma 2.2 the value of the two terms are the same. For the forward direction item (1) is guaranteed by Lemma 4.2. Let us assume that x1 6= y1 . Substituting x1 = [2, 1] and xi = [1, 1] for i > 1 and yj = [1, 1] we obtain t1 = [2, 1] 6= [1, 1] = t2 . The case when xk 6= ym can be handled similarly.  Hence we obtain Theorem 3.3 from [7]. Corollary 4.4. Let M and N be two 0-1 matrices each having a submatrix described in Case 2. Then SM and SN generate the same variety. Proof. Indeed, by Theorem 4.3 they satisfy the same identities.



Finally, we take a glance at the term-equivalence problem for S1 . The main difference between S and S1 is that we can substitute 1 for the variables. Let the two terms depend on the variables x1 , . . . , xk . One way to check whether or not the two terms are equivalent is to

12

´ STEVE SEIF AND CSABA SZABO

substitute 1 for every subset of the variables and decide whether or not the two terms obtained are equivalent over S. This may require exponentially many instances of TERM-EQ S. We would like to check conditions (1)-(3) of Theorem 4.3 for every such substitution in polynomial time. Hence we would like to keep track of the first and last variables not equal to 1 and the adjacent vertices of the “new” graphs. Definition 4.5. Let t be a term over S. The right (left) sequencing r(t) (l(t)) of t is the order of variables in which they appear in t from the right (left). Let x and y be two (not necessarily distinct) variables. We say that a set U of variables joins x with y in the term t if the product occurs as a subword in the term obtained by erasing from the term t all occurrences of variables from U . For instance, each of the sets {y} and {y, z} joins x with x in the term t = xyxyzx while the sets ∅, {z} do not. Now, let At,x,y be the collection of all minimal (with respect to inclusion) sets joining x with y in t. For example, for the above term t we have At,x,x = {{y}}, At,x,y = {∅}, At,z,y = ∅. Theorem 4.6. Let t1 = x1 · · · · · xk and t2 = y1 · · · · · yl be two terms over S1 . Then t1 ≡ t2 if and only if the following three conditions hold: (1) At1 ,x,y = At2 ,x,y for every x, y; (2) r(t1 ) = r(t2 ); (3) l(t1 ) = l(t2 ). Proof. Let us assume that t1 ≡ t2 . Then the two terms are equivalent over S, as well, hence by Theorem 4.3 item (2) x1 = y1 holds. Substituting x1 = y1 = 1 and verifying the term-equivalence over S we get that the second variables of the left- and right sequencings are the same in the two terms, etc. Continuing in this fashion we obtain that l(t1 ) = l(t2 ). Similarly, r(t1 ) = r(t2 ). If At1 ,x,y 6= At2 ,x,y for some x 6= y, then without the loss of generality we may assume that there is a subset U of the variables and two variables x and y such that U ∈ At1 ,x,y \ At2 ,x,y . Letting x = [1, 2], y = [2, 1], xi = 1 for xi ∈ U and xj = [1, 1] else, we obtain that t1 = 0. Indeed, xy is a subword of the term obtained from t1 by cancelling all variables of U . At the same time t2 6= 0, because x will not be followed by y in the term similarly obtained from t2 , and so [1, 2] will not be followed by [2, 1] at the evaluation. If At1 ,x,x 6= At2 ,x,x for some variable x, then we obtain a similar inequality letting x = [2, 2], xi = 1 for xi ∈ U and xj = [1, 1] else. Now, let t1 (s1 , s2 , . . . , sk ) = 0 and t2 (s1 , s2 , . . . , sk ) 6= 0. Then, by Lemma 2.2 there are si and sj and a subset U of variables such that si sj = 0 and there is at least one occurrence of the pair xi and xj in t1

IDENTITIES IN SEMIGROUPS

13

such that for any variable between xi and xj we substituted 1, but xi and xj do not follow one another at this evaluation in t2 . A minimal subset of variables with these properties is in At1 ,xi ,xj \ At2 ,xi ,xj . The case when the right or left sequencing is different is handled similarly to Theorem 4.3.  Theorem 4.7. Let S be a combinatorial 0-simple semigroup belonging to Case 2. Then TERM-EQ S1 is in P. Proof. Let the pair t1 , t2 of two terms of length n and k be an instance of TERM-EQ S1 , and let n ≥ k. By Theorem 4.6 we have to compare the left- and right sequencings and the sets of the form At,x,y . There are at most n2 many pairs of variables. For each pair of variables x, y the set At,x,y contains at most n/2 many subsets. Thus we can check the conditions of Theorem 4.6 in polynomial time.  4.2. Case 1. This looks like the least interesting part of the whole discussion from the graph theoretical point of view. In this case ΓS is the disjoint union of complete bipartite graphs, hence the homomorphism problems are basically trivial. Let CompΓ (v) denote the connected component of v in the graph Γ. A special subcase of Case 1 is when the matrix contains a single block. That is, if M = J, the n × m all 1 matrix. In this case the following proposition holds: Proposition 4.8. Let p and q be two polynomials (terms) over SJ . Then p is identically 0 if and only if p contains a constant 0. Z(p) = Z(q) if and only if p and q contain the same variables. In particular POL-ZSET S is in P. Similarly, POL-NZ S, POL-SAT S and POL-EQ S are in P. Proof. The first two statements are obvious, the others follow from Lemma 4.1.  Now, let us assume that the matrix contains at least 2 blocks. Proposition 4.9. Let p be a polynomial (term) over SM , where M is a 1-block matrix with at least two blocks. Then p ≡ 0 if and only if there is a connected component of B(p) containing at least two connected components of ΓS . Hence POL-NZ S is in P. In particular, a term is never identically 0. Proof. By Lemma 2.3 we need to show that there is no graph homomorphism from B(p) to ΓS . Such a homomorphism has to map connected

14

´ STEVE SEIF AND CSABA SZABO

components into connected components fixing ΓS . But now a component of B(p) contains two components of ΓS , hence there is no such homomorphism. On the other hand if each component Comp(B(p)) of B(p) contains at most one component of ΓS , then mapping each point of Comp(B(p)) to an arbitrary element of ΓS ∩ Comp(B(p)) if the intersection is not empty, and mapping the vertices of Comp(B(p)) to an arbitrary component of ΓS , if the intersection is empty, we obtain a homomorphism.  The idea of the proof of Theorem 4.2 gives the analogue statement for Case 1. Proposition 4.10. Let M be a 1-block matrix, p and q be two polynomials (terms) over SM . Then Z(p) = Z(q) if and only if B(p) and B(q) have the same connected components. Thus TERM-ZSET SM and POL-ZSET SM are in P . By Lemma 4.1 we obtain the following statement. Theorem 4.11. Let M be a 1-block matrix. Then POL-EQ SM , POL-SAT SM , TERM-EQ SM and TERM-SAT SM are in P. Now, we summarize the results of this section and present an algorithm for the equivalence problem. Proposition 4.12. Let M be a 1 block matrix and p = x1 · · · · · xk and q = y1 · · · · · ym be two terms over SM = S. Moreover, let y1 = xi and ym = xj . (1) If M = J, the n × l all 1 matrix, then p ≡ q if and only if (a) the variables occurring in p and q are the same; (b) if n ≥ 2, then x1 = y1 ; (c) if l ≥ 2, then xk = ym . (2) If M 6= J is a 1-block matrix, then p ≡ q if and only if (a) the components of B(p) and B(q) are the same; (b) CompB(p) (u1 ) = CompB(q) (ui ); (c) CompB(p) (vk ) = CompB(q) (vj ); (d) if there are two equal rows of M , then x1 = y1 ; (e) if there are two equal columns of M , then xk = ym . Proof. Proposition 4.10 guarantees that the two terms are equal to 0 at the same time and the other conditions describe the equality of their values if they are not equal to 0. The last two items in both cases describe the situation when our 1-block matrix is not the identity matrix.  We conclude the section with the surprising result of Kl´ıma ([12]).

IDENTITIES IN SEMIGROUPS

15

Theorem 4.13. Let I denote the 2 by 2 identity matrix. Then TERM-EQ S1I is coNP-complete. 5. Further remarks There are a few naturally arising questions in this topic. Problem (1). Find the computational complexity of POL-EQ S, TERM-EQ S for a Rees matrix semigroup S = M(G; I, Λ; P ). The following connection can be helpful in the investigation. Proposition 5.1. Let S = M(G; I, Λ; M ) be a Rees matrix semigroup. Then if TERM-EQ G is coNP-complete then TERM-EQ S is coNPcomplete. If TERM-EQ S is in P, then TERM-EQ G is in P. Proof. For every pair of terms t1 , t2 over G we present a pair of terms t01 , t02 over S such that t1 ≡ t2 over G if and only if t01 ≡ t02 over S. Let |G| = n and t1 = x1 x2 . . . xk and t2 = y1 y2 . . . ym . The difference between a term over a semigroup and a group is that the latter one may contain inverses of variables, as well. As G is finite, in a term over G the inverses can be substituted by the (n −1)th powers of the elements. Hence we may assume that t1 and t2 are semigroup terms. Now, introduce a new variable x not occurring in t1 and t2 and let Xi = xn xi xn . Define t0i = t(Xi ). The first observation is that ti ≡ t0i over G, because xn = 1 for every group element x. Let us assume first that t01 ≡ t02 over S. Then, as there is a subgroup of S isomorphic to G, t01 ≡ t02 and so t1 ≡ t2 over G. For the converse, assume that t1 ≡ t2 over G. The two terms t01 and t02 are 0 at the same evaluations. Indeed, both start and end by the same variable x, moreover B(t01 ) = B(t02 ), as in both graphs every vertex is connected exactly to the top and bottom vertices corresponding to the variable x. Hence the conditions of Theorem 4.3 hold. Now, let us assume that at a substitution the values of the two terms are not 0. For x = [g; µ, j] and xi = [gi ; µi , ji ] we get xn xi xn = [g n M (j, µi )gi M (ji , µ)g n ; µ, j] = [M (j, µi )gi M (ji , µ); µ, j]. Letting gi0 = M (j, µi )gi M (ji , µ), we obtain t0i (x1 , . . . , xk ) = [ti (g10 , . . . , gk0 ); µ, j], hence t01 ≡ t02 over S.  A complete characterization does not seem to be easy, though. In [15] the authors give an example of a 19-element 0-simple semigroup over the group Z2 with coNP-hard identity checking problem. To generalize the results about matrix semigroups we pose the following problem:

16

´ STEVE SEIF AND CSABA SZABO

Problem (2). Find the computational complexity of POL-EQ Ω(S), TERM-EQ Ω(S) for the translational hull of a 0-simple semigroup S. Finally, we exhibit an example of an infinite sequence of semigroups A0 ≤ A1 ≤ · · · ≤ Ak ≤ . . . such that POL-EQ Ak is in P for even k-s and POL-EQ Ak is coNP-complete for odd k-s. Example 5.1. Let M2k = Jk − Ik and M2k+1 be the (k + 1) × k matrix obtained from M2k by adding a full 1 row. Let Ak = SMk+5 . As ΓM2k is isomorphic to Bk , POL-EQ Ak is coNP-complete for every odd k. By Theorem 4.1 for even k-s it is enough to check the complexity of POL-NZ Sk . Now as there is a full 1 row in M , a polynomial p is identically 0 if and only if p contains 0 as a constant. Acknowledgements: The authors are grateful to the referee of the paper. He has pointed out several references and with his comments he has helped us write a much clearer and more organized presentation. References [1] D. M. Barrington, P. McKenzie, C. Moore, P. Tesson, D. Th´erien, Equation satisfiability and program satisfiability for finite monoids, in: “Mathematical Foundations of Computer Science 2000 ” (Proc. Conf. Bratislava, 2000), pp. 172-181. Lect. Notes Comput. Sci. no. 1893, Springer, Berlin, 2000. [2] J. B¨ uki, Cs. Szab´ o, Colored homomorphisms for direct products of graphs, Information Processing Letters 81 (2002), 175-178. [3] S. Burris, J. Lawrence, The equivalence problem for finite rings, J. Symbolic Comput. 15 (1993), 67-71. [4] A. Clifford, G. Preston, “The algebraic theory of semigroups”, I, Mathematical Surveys no. 7, Amer. Math. Soc., Providence, 1961. [5] T. Feder, P. Hell, J. Huang, List homomorphisms and circular arc graphs, Combinatorica 19 (1999), 487-505. [6] M. R. Garey, D. S. Johnson, “Computers and intractability”, W.H.Freeman & Co., San Francisco, 1979. [7] T. Hall, Regular semigroups: amalgamation and the lattice of existence varieties, Algebra Universalis 28 (1991), 79-102. [8] P. Hell, J. Neˇsetˇril, On the complexity of H-coloring, J. Combinatorial Theory B 48 (1990), 92 - 110. [9] D. Hobby, R. McKenzie, “The structure of finite algebras”, Contemporary Mathematics no. 76, Amer. Math. Soc., Providence, 1988. [10] H. Hunt, R. Stearns, The complexity for equivalence for commutative rings, J. Symbolic Comput. 10 (1990), 411-436. [11] A. Kisielewicz, Complexity of semigroup identity checking, Int. J. Algerba Comput 14 (2004), 455-464. [12] O. Kl´ıma, Compexity issues of checking identities in finite monoids, manuscript. [13] J. Lawrence, R. Willard, The complexity of solving polynomial equations over finite rings, manuscript, 1997.

IDENTITIES IN SEMIGROUPS

17

[14] G. Mashevitzky, Completely simple and completely 0-simple semigroup identities, Semigroup Forum 37 (1988), 253–264. [15] S. Pleshcheva, V. V´ertesi, The complexity of checking identities for a noncombinatorial 0-simple semigroup, in preparation. [16] S. Seif, The Perkins semigroup has a coNP-complete term-equivalence problem, manuscript. [17] S. Seif, Cs. Szab´ o, Algebra complexity problems involving graph homomorphisms, semigroups and the constraint satisfaction problem, Journal of complexity 19 (2003), 153-160. [18] Cs. Szab´ o, Vera V´ertesi, The complexity of checking identities in M2 (Z2 ), Proc. Amer. Math. Soc. 132 (2004), 3689-3695. [19] A. N. Trahtman, Identities of a five-element 0-simple semigroup, Semigroup Forum 48 (1994), 385–387. [20] M. Volkov, Checking identities in semigroups, Lecture on the Conference on Universal Algebra, Nashville (2002). (1) Department of Mathematics, University of Louisville, Kentucky, 40292, USA E-mail address: [email protected] ¨ tvo ¨ s Lora ´nd University, Department of Algebra and Number (2) Eo ´zma ´ny Pe ´ter se ´ta ´ny 1/c, Hungary Theory, 1117 Budapest, Pa E-mail address: [email protected]