Circuit equivalence in 2-nilpotent algebras
aa r X i v : . [ c s . CC ] S e p CIRCUIT EQUIVALENCE IN 2-NILPOTENT ALGEBRAS
PIOTR KAWA LEK, MICHAEL KOMPATSCHER, JACEK KRZACZKOWSKI
Abstract.
The circuit equivalence problem of a finite algebra A is the com-putational problem of deciding whether two circuits over A define the samefunction or not. This problem not just generalises the equivalence problem forBoolean circuits, but is also of high interest in universal algebra, as it modelsthe problems of checking identities in A . In this paper we discuss the com-plexity for algebras from congruence modular varieties. A partial classificationwas already given in [11], leaving essentially only a gap for nilpotent but notsupernilpotent algebras. We start a systematic study of this open case, provingthat the circuit equivalence problem is in P for 2-nilpotent such algebras. Introduction
To solve equations is one of the oldest and best-known problems in mathematics.For many centuries it inspired research in algebra and lead both to the developmentof new theoretical concepts and new algorithms (let us only mention Galois theory,Diophantine Equations and Gaussian elimination). From a computer science pointof view the main focus lies to the latter and the question: What is the computationalcomplexity of solving equations in a given algebra A ?More formally, by the equation satisfiability problem PolSat ( A ) of a fixed alge-bra A we denote the computational problem of deciding whether a given equationof polynomials over A has a solution or not. A prominent example of such a prob-lem is PolSat ( Z , + , · ), the problem of deciding whether a Diophantine equationhas a solution, which was proven to be undecidable by Matiyasevich [15].The equivalence problem PolEqv ( A ) is the closely related problem, where theinput consists of two polynomials over A , and the task is to decide whether theydefine the same function. In other words the task is to check if an equation holdsfor all possible assignments of values to the variables. For finite algebras PolSat clearly is in NP and PolEqv in co - NP ; in the last twenty years there were numer-ous papers further investigating the complexity and trying to find hardness andtractability criteria for both problems (e.g. [1], [2], [3], [5], [6], [7], [8], [13], [17]).One of the major obstacles in studying PolSat ( A ) and PolEqv ( A ) systemati-cally for all finite algebras is that the complexity strongly depends on the signatureof A . For example, A and some other solvable, non-nilpotent groups are known toinduce problems PolSat and
PolEqv that are in P; however after adding the com-mutator [ x, y ] = x − y − xy as a basic operation we obtain NP -complete PolSat
Key words and phrases. circuit equivalence, identity checking, nilpotent algebra, structuretheory.The first and the third authors are partially supported by Polish NCN Grant problems and co-NP -complete
PolEqv problems [9] [14]. Roughly speaking thisresults from the fact that some operations can be written in a much more conciseways using commutators than just the group operations alone. In fact, the termsused in proving NP-completeness inflate to exponentially longer expressions in thepure group language.To resolve this problem, it was recently proposed to encode an input equationby circuits [11]. This approach prevents an artificial inflation of the input as inthe above example. Consequently the complexity for these ‘circuit problems’ onlydepends on the set of polynomial operations of the algebra, allowing for the useof universal algebra in studying their complexity. We formally define the circuitsatisfiability (
Csat ) and circuit equivalence (
Ceqv ) as follows: • Csat ( A )given a circuit over the algebra A with two output gates g , g is there avaluation of input gates x = ( x , . . . , x n ) that gives the same output onboth g and g , i.e. g ( x ) = g ( x )? • Ceqv ( A )given a circuit over the algebra A is it true that for all inputs x we havethe same values on given two output gates g , g , i.e. g ( x ) = g ( x ) for all x ∈ A n ?Besides [11] these problems were also considered in [10] and [1] (and implicitlyalready earlier, e.g. in [8]). In [11] Idziak and the third author set the goal to classifythe computational complexity of Csat and
Ceqv for algebras from congruencemodular varieties. On one hand these algebras form a quite broad class with manyelements of interest in classical algebra such as groups, quasigroups, rings, modules,fields, lattices, Boolean algebras. On the other hand there is well-developed theoryof commutators in this case, which will be the basis of our proof.There are strong indications that the complexity hierarchy of
Ceqv in the con-gruence modular case corresponds to a structural hierarchy in commutator theory:By [11], for every non-nilpotent algebra A from a congruence modular variety thereexists a quotient algebra A ′ of A such that Ceqv ( A ’) is co-NP -complete. On theother hand it was shown in [2] that Ceqv for so called supernilpotent algebras fromcongruence modular varieties is in P .We remark that in congruence modular varieties supernilpotent algebras arestrictly contained in nilpotent algebras (but it is not true in general, see [16]). Thisleaves a gap for nilpotent, but not supernilpotent algebras. In [10] an example ofa 2-nilpotent, but not supernilpotent algebra A was given for which Ceqv ( A ) canbe solved in polynomial time.This paper is the first step in the systematic study of Ceqv for all nilpotentalgebras. We prove that
Ceqv ( A ) is in P for every 2-nilpotent algebra A from acongruence modular variety. Our algorithm is based on the analysis of a normalform of polynomial operations of such algebras. Thus it comes hand in hand witha deeper understanding of the structure of 2-nilpotent algebras. Our hope is togeneralise these results to k -nilpotent algebras in future research.2. Definitions and notation
We are going to use standard notation from universal algebra, which can befound in [4]. We define a signature F to be a sequence ( f i , k i ) i ∈ I , where each f i is afunction symbol and k i is the arity corresponding to this symbol. An algebra over IRCUIT EQUIVALENCE IN 2-NILPOTENT ALGEBRAS 3 signature F is then a tuple A = ( A, ( f A i ) i ∈ I ) for some set A and f A i being a functionfrom A k i to A . Each f A i will be called a basic operation of A . A finite algebra isan algebra with finite universe A and finite signature, so it has finitely many basicoperations. An algebra B is a subalgebra of A iff B ⊆ A , B is closed under allbasic operations of A , and the basic operations of B are the basic operations of A restricted to the set B . In this case we write B A .For an algebra A , let us denote by the clone of polynomials Pol A the small-est set of operations on A that contains all constant functions, all projections π ni ( x , . . . , x n ) = x i , all basic operations of A and that is closed under composition.Moreover let Pol n A be the set of n -ary functions in Pol A . It is straightforwardto see that for finite algebras Ceqv ( A ) reduces to Ceqv ( B ) if Pol A ⊆ Pol B (see [11]). We will say that B and A are polynomially equivalent iff there exist analgebra B ′ isomorphic to B with Pol A = Pol B ′ .An affine algebra is an algebra that is polynomially equivalent to a module.A Maltsev operation is ternary operation d ( x, y, z ) such that d ( x, x, y ) = y and d ( x, y, y ) = x holds for all x, y . For instance, every affine algebra has x − y + z asa Maltsev operation.We will use lowercase overlined letter x to denote tuples x = ( x , . . . , x n ) ∈ U n .In our paper U will often stand for a direct product Z p k × . . . × Z p kmm . In thiscase, for every i = 1 , . . . , n we further use the notation x i = ( x (1) i , . . . , x ( m ) i ), with x ( j ) i ∈ Z p kjj . In particular, if we just want to study the Z p kjj -component of a tuple x ∈ U n we will use the notion x ( j ) = ( x ( j )1 , . . . , x ( j ) n ).3. The structure of 2-nilpotent algebras
In this section we provide some structural background on 2-nilpotent algebrasand prove that (in some of them) we can represent polynomials in a certain normalform.Nilpotent algebras can be defined using the commutator of congruences, general-ising the notion of nilpotent groups and rings. We are however not going to give theoriginal definition here and refer to the book [4] for background. For our purposesit will be enough to give a characterisation of nilpotent algebras in congruence mod-ular varieties. In this case commutator theory works especially well and allows usto obtain much structural information about algebras. It is for instance well knownthat Abelian (or ’1-nilpotent’) algebras exactly correspond to affine algebras.Now 2-nilpotent algebras from congruence modular varieties can be consideredas the action of one affine algebra on an other one (see Chapter VII of [4]). Moreprecisely, for two algebras U and L of the same signature F such that • U is polynomially equivalent to a module ( U ; +) over a ring R U , and • L is polynomially equivalent to a module ( L ; +) over a ring R L ,and a set b F of functions such that for every f ∈ F , say k -ary, there is b F ∋ b f : U k −→ L we define L ⊗ b F U as an algebra over signature F and universe L × U by(1) f L ⊗ b F U (( l , u ) , . . . , ( l k , u k )) = ( f L ( l , . . . , l k )+ b f ( u , . . . , u k ) , f U ( u , . . . , u k )) . It is shown in [4] that every 2-nilpotent algebra over signature F from a congruence-modular variety is isomorphic to some L ⊗ b F U . Working in such L ⊗ b F U we are PIOTR KAWA LEK, MICHAEL KOMPATSCHER, JACEK KRZACZKOWSKI going to show that every polynomial (or circuit) of it can be expressed in a certainnormal form which will be extensively used by our polynomial time algorithm.First of all observe that not only basic operations of L ⊗ b F U , but all its polynomialoperations, can be expressed in form (1). Moreover, since L and U are affine, for apolynomial operation p over L ⊗ b F U there exist λ i , α i , u such that p L ⊗ b F U (( l , u ) , . . . , ( l k , u k )) = k X i =1 λ i l i + b p ( u , . . . , u k ) , k X i =1 α i u i + u ! . Let ( U, +) ∼ = Z p k × · · · × Z p kmm be the underlying group of U . We will prove thatif U and L are of coprime order then b p ( u , . . . , u k ) can be presented as a sum ofexpressions in the form µ · w a ,..., k X i =1 β (1) i u i + u (1)0 , . . . , k X i =1 β ( s ) i u i + u ( s )0 ! , where w an ,...,n m ( x ) is a function from ( Z p k ) n × . . . × ( Z p kmm ) n m → L , a ∈ L and w an ,...,n m ( x ) = (cid:26) a if x ( i ) j = 0 for all i = 1 , . . . , m and j = 1 , . . . , n i , . For short we will write w a for w a ,..., . Notice that w a is a function from U → L and w an,...,n ( x ) can be interpreted as operation U n → L . For β, ø x ∈ ( Z p k × Z p k × . . . × Z p kmm ) n we will use the following notation: β ⊙ x = ( n X i =1 β (1) i x (1) i , n X i =1 β (2) i x (2) i , . . . , n X i =1 β ( m ) i x ( m ) i ) . If | L | and | U | are co-prime we can express b p in a normal form, just using w a : Lemma 3.1.
Let U , L be modules such that ( U, +) is isomorphic to Z p k × Z p k × . . . × Z p kmm and | U | and | L | are coprime. Then every function f : U n −→ L can beexpressed in the form: (2) f ( x , . . . , x n ) = X l ∈ L,c ∈ Uβ ∈ Un µ lβ,c w l ( β ⊙ ø x + c ) . Proof.
For l ∈ L we set s l ( x , . . . , x n ) = w ln,...,n ( x (1)1 , . . . , x (1) n , . . . , x ( m )1 , . . . , x ( m ) n ).Observe that s l ( x , . . . , x n ) = l if x = . . . = x n = 0 and s l ( x , . . . , x n ) = 0otherwise. Then clearly every function f ( x , . . . , x n ) can be written as the sum ofall expressions s f ( u ,...,u n ) ( x − u , . . . , x n − u n ), for all ( u , . . . , u n ) ∈ U n . Henceto prove the statement of the lemma it suffices to show that for all indices i , . . . , i k and all l ∈ L we are able to express w li ,...,i k in the form (2).First, we will prove this for the case m = 1. For convenience we will write p = p and k = k . If k = 1 then we can obtain w n +1 using w n in the following way: w ln +1 ( x , . . . , x n +1 ) = ν p,l ( p − X i =0 w ln ( x , . . . , x n − , x n + ix n +1 ) − p − X i =1 w ln ( x , . . . , x n − , i + x n +1 )) , (3) IRCUIT EQUIVALENCE IN 2-NILPOTENT ALGEBRAS 5 where ν p,l is a scalar from R L inverse to p (i.e. scalar equivalent to an endomorphism e p of ( L, +) such that e p ( x ) = x + . . . + x | {z } p ). We can assume that such inverse scalarexists since p = | U | is coprime to | L | (in fact, we can assume that R L contains allendomorphisms of L ). A straightforward computation shows that the identity (3)indeed holds (see also Lemma 3.1. in [10]).For arbitrary k we prove the statement by induction. So let us assume it holdsfor all k ′ < k . Again, it is enough to show that we can write w ln +1 in the form(2). As an intermediate step, let us define the polynomial t ln +1 ( x , . . . , x n +1 ) bythe sum(4) p k − X i =0 w ln ( x , . . . , x n − , x n + ix n +1 ) + p k − − X i =0 w ln ( x , . . . , x n − , pix n + x n +1 ) . If there is an index j < n such that x j = 0 then t ln +1 is equal 0. We next give adescription of t ln +1 in the remaining case x = . . . = x n − = 0. Let o ( x n ) be theorder of x n in the group theoretical sense. Notice that the first sum in (4) countsthe number of indices i = 0 , . . . , p k − x n + ix n +1 is 0. This value is 0if o ( x n +1 ) < o ( x n ) and p k /o ( x n +1 ) otherwise. The second sum in (4) counts thenumber of indices i = 0 , . . . , p k − − pix n + x n +1 is 0. It is also easy tosee that this value is 0 if o ( x n ) o ( x n +1 ) = 1 and p k − /o ( x n ) otherwise.The above analysis shows in particular that if x n = 0 or x n +1 = 0 the value of t ln +1 (0 , . . . , , x n , x n +1 ) only depends on the values of x n and x n +1 modulo p k − .Moreover, if p k − divides x n and x n +1 , then t ln +1 (0 , . . . , , x n , x n +1 ) is equal to( p k + p k − ) l if x n = x n +1 = 0 and p k − l else. Hence, p k − w lm +1 ( x , . . . , x n +1 ) = t lm +1 ( x , . . . , x n +1 ) + r ln +1 ( x , . . . , x n +1 )where r ln +1 ( x , . . . , x n +1 ) = 0 if there is a j < n with x j = 0, and r ln +1 (0 , . . . , , x n , x n +1 )is a function that only depends on the value of x n and x n +1 modulo p k − . In otherwords r ln +1 (0 , . . . , , x n , x n +1 ) can be seen as an operation from the submodule pU to L . As the group structure of pU is Z p k − , by induction hypothesis we can express r ln +1 using a normal form as in (4). This and the observation that p k − has aninverse in R L complete the proof for m = 1.For m > k = k = . . . = k m = 1 it is enough toobserve that analogously to (3) we have w ln ,n ,...,n m +1 ( x , . . . , x mn m , x mn m +1 ) = ν p m ,l ( p m − X i =0 w ln ,...,n m ( x , . . . , x mn m − , x mn m + ix mn m +1 ) − p m − X i =1 w ln ,...,n i ,...,n m ( x , . . . , x mn m − , i + x mn m +1 )) . Symmetrically we can obtain w ln ,...,n j +1 ,...,n m for every index j . For an inductionstep on the parameters k j , without loss of generality we also only consider the step k m − → k m . So let us assume the Lemma holds for modules U with groupstructure Z p k × . . . × Z p km − j . Then we claim that it also holds for U over thegroup Z p k × . . . × Z p kmm . To prove this claim we can again use the fact that for the PIOTR KAWA LEK, MICHAEL KOMPATSCHER, JACEK KRZACZKOWSKI term defined by t ln ,...,n m +1 ( x , . . . , x mn m +1 ) = p kmm − X i =0 w ln ,...,n m ( x , . . . , x mn m − , x mn m + ix mn m +1 )+ p km − m − X i =0 w ln ,...,n m ( x , . . . , x jn m − , ip m x mn m + x mn m +1 ) . we have p k m − m w ln ,...,n m +1 = t ln ,...,n m +1 + r ln ,...,n m +1 , for some r ln ,...,n m +1 suchthat r ln ,...,n m +1 (0 , , . . . , x mn m , x mn m +1 ) only depends on the values of x mn m and x mn m +1 modulo p k m − m . The rest of the proof is analogous to the case m = 1 and we leaveit to the reader. (cid:3) A recursive principle
Let A be a finite 2-nilpotent algebra and U , L be the corresponding modules ofcoprime order. By Lemma 3.1 we know that then every polynomial of A can bewritten in the form: p (( l , u ) , . . . , ( l n , u n )) = n X i =1 λ i l i + X l ∈ L,c ∈ Uβ ∈ Un µ lβ,c w l ( β ⊙ ø u + c ) , n X i =1 α i u i + u . Some polynomials p require | U | n many µ lβ,c = 0, which might suggest that wecannot efficiently compute this form. In the next section we will however observethat, depending on the input to Ceqv ( A ), the number of nonzero µ lβ,c is polynomialand that Ceqv ( A ) is essentially equivalent to checking if the expression(5) X l ∈ L,c ∈ Uβ ∈ Un µ lβ,c w l ( β ⊙ ø x + c )is constant. For now we thus concentrate on analysing properties of expressions(5). First of all, we would like to simplify (5) by eliminating constants c and someof β ’s, that are not ’close’ to being invertible according to the following definition: Definition 4.1.
Let β ( i )1 , β ( i )2 , . . . , β ( i ) n ∈ Z p k . We will say that β ( i ) is nondegener-ate if the expression P nj =1 β ( i ) j x j can take all values from Z p k . Moreover β ∈ U n is nondegenerate, if β ( i ) is nondegenerate for all i m . Moreover, let ( U n ) ∗ denote the set of all nondegenerate β ∈ U n . Note that β ( i ) ∈ ( Z p k ) n is nondegenerate iff there is a j such that β ( i ) j has amultiplicative inverse in Z p k . Therefore, if in the expression (5) we have somedegenerate β ∈ U n , we can find a d ∈ U such that β = d · β ′ (where d · β ′ isthe coordinatewise multiplication) and β ′ is nondegenerate. Thus we can eliminatedegenerate expressions and constants by replacing w l ( β ⊙ ø x + c ) by w ( β ′ ⊙ ø x ),where w ( u ) = w l ( d · u + c ). So if m , . . . , m s are all the functions from U → L ,then we can transform (5) to the form(6) X β ∈ ( U n ) ∗ j =1 ...s µ ( j ) β m j ( β ⊙ ø x ) . IRCUIT EQUIVALENCE IN 2-NILPOTENT ALGEBRAS 7
Clearly (6) represents a constant function, if for every fixed ø x ′ ∈ U n it evaluatesto the same value, say c . We can treat all the equations obtained this way as asystem of | U n | many equations over variables µ ( j ) β : c = X β ∈ ( U n ) ∗ j =1 ...s µ ( j ) β m j ( β ⊙ ø x ′ )Solving this system by Gaussian elimination would potentially require exponentialtime and is thus not the way to go. Our technique will be to sum some of thoseequation in an organised manner to derive a nice characterisation of the solution set.To do it properly we have to understand how different β ’s interact with each other.For instance there are β, α such that values of β ⊙ ø x and α ⊙ ø x are independent,i.e. for any choice of c, d ∈ U we can find ø x with β ⊙ ø x = c and α ⊙ ø x = d . On theother hand we can find a pair α, β such that value of β ⊙ ø x implies value of α ⊙ ø x ,which means that for every c there exist d such that β ⊙ ø x = c = ⇒ α ⊙ ø x = d .We are going to measure the degree of dependence of α and β by the concept of M -dependence defined below.Let h a, b i denote the standard inner product (in every module Z p kii ). Notethat β ⊙ x = (cid:16) h β (1) , x (1) i , . . . , h β ( m ) , x ( m ) i (cid:17) . In our definition we will handlethese coordinates separately. Now to describe dependencies between nondegener-ate β ( i ) , α ( i ) ∈ ( Z p kii ) n take some invertible α ( i ) j ∈ Z p kii and put a = ( α ( i ) j ) − · β ( i ) j .Then β ( i ) = aα ( i ) + e m for some e m ∈ ( Z p kii ) n . It is easy to check, that the image of f ( x ( i ) ) = h e m, x ( i ) i does not depend on the choice of α ( i ) j and this image is obviouslysome subgroup of Z p kii . We will call this subgroup M . We can see that e m j = 0 sofor all c ∈ Z p kii , m ∈ M the system of equation ( h α ( i ) , x ( i ) i = c h e m, x ( i ) i = m has a solution (as α ( i ) j is invertible and e m j = 0). We will say that β ( i ) is M -dependent on α ( i ) if M is the image of h e m, x ( i ) i . Notice that, if M = Z p kii thenany assumption on the value of h α ( i ) , x ( i ) i does not imply anything on the value of h β ( i ) , x ( i ) i , so the expressions h β ( i ) , x ( i ) i , h α ( i ) , x ( i ) i are in that sense independent.On the contrary M = { } and h α ( i ) , x ( i ) i = c implies that h β ( i ) , x ( i ) i = a · c for a = ( α ( i ) j ) − · β ( i ) j (for a from the definition of dependence).We give a lemma, summarising some basic properties of M -dependence (proofleft to the reader). In all cases we assume, that β ( i ) , α ( i ) ∈ ( Z p kii ) n are non-degenerate: Lemma 4.2. (1)
The relation of M -dependence is symmetric, so if β ( i ) M -depends on α ( i ) , then α ( i ) M -depends on β ( i ) . (2) Let ( M, β ( i ) ) denote the set of all α ( i ) ∈ Z p kii that are L -dependent on β ( i ) for some L M . Let ( M ) be the set of all pairs ( β ( i ) , β ′ ( i ) ) suchthat β ′ ( i ) ∈ ( M, β ( i ) ) . Then ( M ) is an equivalence relation between β ( i ) ∈ ( Z p kii ) n . (3) The following are equivalent
PIOTR KAWA LEK, MICHAEL KOMPATSCHER, JACEK KRZACZKOWSKI • β ( i ) ∈ ( Z p kii ) n is M -dependent on α ( i ) • for fixed x ( i ) ∈ Z p kii system of equations ( h α ( i ) , x ( i ) i = h α ( i ) , y ( i ) ih β ( i ) , x ( i ) i = h β ( i ) , y ( i ) i + m has a solution iff m ∈ M .Moreover the number of solution to the above system of equations for anygiven m ∈ M is p kn | M | . (4) For β ∈ ( U n ) ∗ let E ( j ) β (ø x, m ) be the set of those evaluations x ′ , whichsatisfy the following conditions: ( β ⊙ ø x ) ( j ) + m = ( β ⊙ x ′ ) ( j ) and x ( i ) = x ′ ( i ) for i = j . Then | E ( j ) β (ø x, m ) | = | E ( j ) β (ø y, m ) | for every ø x, ø y ∈ U n . For N Z p kii let dep ( i ) ( β, N ) denote the set of all α such that α ( i ) is N -dependent on β ( i ) . Let ( i ) ( N, β ) denote the set of all α with ( β ( i ) , α ( i ) ) ∈ ( N ). Moreover let ( i ) ( N ) be equivalence relation containing all pairs ( α, β ) with( α ( i ) , β ( i ) ) ∈ ( N ). Let M ( i ) k = h p ki i be the subgroup of Z p kii generated by p ki .Notice, that a given expression (6) represents a constant function if and only ifit does not depend on x ( i ) for any index i . The following lemma will therefore bekey to construct the recursive algorithm for finite 2-nilpotent algebra with coprime | U | , | L | : Lemma 4.3.
Let m , m , . . . , m s be functions from U = Z p k × Z p k × . . . × Z p kmm to L and let t (ø x ) = X β ∈ ( U n ) ∗ l =1 ...s µ ( l ) β m l ( β ⊙ ø x ) . Then, if t does not depend on the variables x ( i ) , we have that for every β ∈ ( U n ) ∗ : (7) X α ∈ ( i ) ( M ( i )1 ,β ) l =1 ...s µ ( l ) α m l ( α ⊙ ø x ) does not depend on variables x ( i ) for all i .Proof. Without loss of generality we assume that i = 1. Then we put M j = M (1) j for all 1 j k . Moreover let f M j = h ( p j , , . . . , i . So f M j is the subgroup ofthe underlying group of U , whereas M j is the subgroup of Z p k . We will alwayswrite M [0] for M (zero in index) to distinguish it from M o (small letter o in index,which will be used as variable). To prove the theorem we will show by induction,that for 0 j k we have that(8) X α ∈ (1) ( M ,β ) l =1 ...s X m ∈ f M j µ ( l ) α m l ( α ⊙ ø x + m )does not depend on variable x (1) . For j = k , (8) is exactly the statement of thelemma. IRCUIT EQUIVALENCE IN 2-NILPOTENT ALGEBRAS 9
For j = 0 the expression (8) obviously does not depend on x (1) . So assume thatit does not depend on x (1) for j ′ < j and we will show that also for j the expression(8) does not depend on x (1) .Consider Dt (ø x, β, M j ) = X m ∈ M j X ø z ∈ E (1) β (ø x,m ) t (ø z ) . By point 4 of Lemma 4.2 and from the fact that t does not depend on variables x (1) we have Dt (ø x, β, M j ) = Dt (ø y, β, M j )for every ø x, ø y ∈ U n . Pick ø x and ø y such that x ( i ) = y ( i ) for i > β ∈ ( U n ) ∗ .By definitions of t and Dt we have that: Dt (ø x, β, M j ) = X m ∈ M j X ø z ∈ E (1) β (ø x,m ) X α ∈ ( U n ) ∗ l =1 ,...,s µ ( l ) α m l ( α ⊙ ø z )By the fact that every α ∈ ( U n ) ∗ is M o -dependent on the first coordinate on β with exactly one M o (see definition of dependence) we obtain that: Dt (ø x, β, M j ) = X m ∈ M j l =1 ,...,s X ø z ∈ E (1) β (ø x,m ) X α ∈ dep (1) ( β,M o ) o =0 ,...,k µ ( l ) α m l ( α ⊙ ø z ) . We can regroup summands Dt (ø x, β, M j ) = X l =1 ,...,s X α ∈ dep (1) ( β,M o ) o =0 ,...,k X ø z ∈ E (1) β (ø x,m ) m ∈ M j µ ( l ) α m l ( α ⊙ ø z ) . and then by definition of E (1) β (ø x, m ) and by points 3 and 4 of Lemma 4.2 we obtainthat Dt (ø x, β, M j ) = X l =1 ,...,s X α ∈ dep (1) ( β,M o ) o =0 ,...,k X m ′ ∈ g M o m ∈ f M j p kn | M o | µ ( l ) α m l ( α ⊙ ø x + m + m ′ ) . Now, it is easy to see that Dt (ø x, β, M j ) = X l =1 ,...,s X α ∈ dep (1) ( β,M o ) o =0 ,...,k X m ∈ f M min { o,j } | M o || M j || M min { o,j } | p kn | M o | µ ( l ) α m l ( α ⊙ ø x + m ) == X l =1 ,...,s X α ∈ dep (1) ( β,M [ o ] ) o =0 ,...,k X m ∈ f M min { o,j } p kn | M j || M min { o,j } | µ ( l ) α m l ( α ⊙ ø x + m ) . Denote w o,j = p kn | M j || M min { o,j } | . After the substitution above we obtain the following: Dt (ø x, β, M j ) = X l =1 ,...,s X α ∈ dep (1) ( β,M o ) o =0 ,...,k X m ∈ f M min { o,j } w o,j µ ( l ) α m l ( α ⊙ ø x + m ) . Observe that for any α which is M [0] -dependent on the first coordinate on β andevery l ∈ { , . . . , s } we have that X m ∈ g M [0] w ,j µ ( l ) α m l ( α ⊙ ø x + m ) = X m ∈ g M [0] w o,j µ ( l ) α m l ( α ⊙ ø y + m ) . Hence, for Dt ′ (ø x, β, M j ) = X l =1 ,...,s X α ∈ dep (1) ( β,M o ) o =1 ,...,k X m ∈ f M min { o,j } w o,j µ ( l ) α m l ( α ⊙ ø x + m )we have that Dt ′ (ø x, β, M j ) = Dt ′ (ø y, β, M j ) . Note that classes of (1) ( M j ) are contained in classes of (1) ( M ). Let β , β ,. . . , β u be representants of each (1) ( M j ) class contained in ( M ) class of β .As we can substitute β with any β i in the previous equation, we get: X i =1 ,...,u Dt ′ (ø x, β i , M j ) = X i =1 ,...,u Dt ′ (ø y, β i , M j ) , and X i =1 ,...,u Dt ′ (ø x, β i , M j ) = X i =1 ,...,ul =1 ,...,s X α ∈ dep (1) ( β i ,M o ) o =1 ,...,k X m ∈ f M min { o,j } w o,j µ ( l ) α m l ( α ⊙ ø x + m ) . By rewriting of above expression we obtain that P i =1 ,...,u Dt ′ (ø x, β i , M j ) is equal X l =1 ,...,so =1 ,...,k X α ∈ dep (1) ( β,M i ) i =1 ,...,k X m ∈ f M min { o,j } num( α, o ) w o,j µ ( l ) α m l ( α ⊙ ø x + m ) , where num( α, o ) for α ∈ dep (1) ( β, M o ) is the number of β i from which α is M o -dependent on the first coordinate. We have obtained this expression since the (1) ( M j ) classes of β i cover the (1) ( M ) class of β and hence for every 1 o < j and α there is β i such that α is M o dependent form β i . Moreover, for every such α and o the value of num( α, o ) depends only on o . So, in such case we can usenum( β, o ) instead of num( α, o ).Note that by induction hypothesis we know that value of the following sum X α ∈ dep (1) ( β i ,M i ) l =1 ,...,s X m ∈ g M o µ ( l ) α m l ( α ⊙ ø x + m ) , for 1 o < j does not depend on first coordinate. Now, by multiplying by constantsand adding above sum for 1 o < j we obtain that X l =1 ,...,so =1 ,...,j − X α ∈ dep (1) ( β,M i ) i =1 ,...,k X m ∈ g M o num( β, o ) w o,j µ ( l ) α m l ( α ⊙ ø x + m ) . IRCUIT EQUIVALENCE IN 2-NILPOTENT ALGEBRAS 11 does not depend on the first coordinate. Therefore, we know that X l =1 ,...,so = j,...,k X α ∈ dep (1) ( β,M i ) i =1 ,...,k X m ∈ f M j num( α, o ) w o,j µ ( l ) α m l ( α ⊙ ø x + m ) == X l =1 ,...,so = j,...,k X α ∈ dep (1) ( β,M i ) i =1 ,...,k X m ∈ f M j num( α, o ) w o,j µ ( l ) α m l ( α ⊙ ø y + m ) . Notice that for o > j : w o,j = p kn . Hence and by the fact that | U | and | L | arecoprime we obtain that X l =1 ,...,so = j,...,k X α ∈ dep (1) ( β,M i ) i =1 ,...,k X m ∈ f M j num( α, o ) µ ( l ) α m l ( α ⊙ ø x + m ) == X l =1 ,...,so = j,...,k X α ∈ dep (1) ( β,M i ) i =1 ,...,k X m ∈ f M j num( α, o ) µ ( l ) α m l ( α ⊙ ø y + m ) . Observe that num( α, o ) for α ∈ dep (1) ( β, i ), i > o > j and 0 else. Finally, from this facts X l =1 ,...,s X α ∈ dep (1) ( β,M i ) i =1 ,...,k X m ∈ f M j µ ( l ) α m l ( α ⊙ ø x + m ) == X l =1 ,...,s X α ∈ dep (1) ( β,M i ) i =1 ,...,k X m ∈ f M j µ ( l ) α m l ( α ⊙ ø y + m ) . This completes the proof of (8) and hence the proof of the lemma. (cid:3) Circuit equivalence
In two previous sections we have investigated the structure of 2-nilpotent al-gebras. We know that every such algebra A is of the form L ⊗ b F U . We havedevoted special attention to algebras for which | L | and | U | are co-prime and wehave obtained some useful tools for such algebras. In particular, Lemma 4.3 givesus a method how to reduce our problem to some set of simpler questions. On theother hand if L and U are of prime power order for the same prime, then A isa supernilpotent algebra and we can solve Ceqv using the algorithm shown byAichinger and Mudrinski in [2]. Finally, our algorithm, shown in the proof of thenext theorem, solves the problem reducing it to cases mentioned above.
Theorem 5.1.
Let A be finite -nilpotent algebra from a congruence modular va-riety. Then Ceqv ( A ) is in P .Proof. Let us consider an input of
Ceqv ( A ), so two circuits that representingtwo polynomial operations f, g ∈ Pol( A ). Since A is a nilpotent algebra from acongruence modular variety it has a Maltsev term d such that for all a, b ∈ A thefunction h ( x ) = d ( x, a, b ) is a permutation on A (see Lemma 7.3 in [4]). Hence,to check if f and g describe the same function it is enough to check if the identity d ( f ( x ) , g ( x ) ,
0) = 0 holds (for some 0 of A ). Therefore, we can assume that ourproblem is to check if a given circuit with one output gate expresses a functionconstantly equal 0. By [4] we know that there exist modules U and L such that A = L ⊗ F U and as a consequence all operations over A can be expressed in thefollowing form: p L ⊗ b F U (( l , u ) , . . . , ( l k , u k )) = k X i =1 λ i l i + b p ( u , . . . , u k ) , k X i =1 α i u i + u ! , where b p is a sum of elements µ b f ( β ⊙ u )with f being a basic operation of A , β ∈ U n and µ ∈ R L . Note that for algebraswith finite signature we can obtain such a form in polynomial time: It is enough tocompute these forms in preprocessing for the basic operations of the algebra andthen to compute the final form step by step by composing basic operations.If some λ i = 0, α i = 0 or u = 0, then p obviously does not define a functionthat is constantly equal to 0 and so our algorithm will return no. Otherwise it leftto check if b p ( u , . . . , u k ) ≡ . If the evaluation b p (0 , . . . ,
0) gives a non-zero value then clearly this does not hold.Otherwise, all we need to check is if b p ( u , . . . , u k ) is a constant function. Claim . | U | and | L | are co-prime, then there exists a polynomial time algorithmto check whether b p ( u , . . . , u k ) is constant.We will show that Claim 1 holds at the end of the proof. For now assume thatit holds. We will then show that it also holds for arbitrary U and L . Without lossof generality we can assume that L = L × . . . × L b such that for every i the set L i is of prime power order and | L i | and | L j | are co-prime for i = j . For checkingthat b p is a constant function it is enough to check that its projection on each L i is constant. Since L is affine, it is easy to see that also the algebra decomposesas L = L × . . . × L b . Hence, the projection of b p (formally b p L ⊗ b F U ) on the i -thcoordinate is equal to b p L i ⊗ b G U , where b G contains projections of operations from b F on the i -th coordinate. In such a way we can reduce our problem to the case inwhich L is of prime power order. Let | L | be power of some prime q .Now, again, without loss of generality we can assume that U = U × U suchthat | U | is power of q and q ∤ | U | . Using the assumption that U = U × U wecan divide every argument of b p into two independent arguments one from U andone from U . Note that if we fix a constant in the arguments from U we obtainan operation from U to L , stemming from a 2-nilpotent algebra with universe L × U . Symmetrically, if we put constants in place of arguments from U weobtain a polynomial operation over a 2-nilpotent algebra with universe L × U .Note that the second algebra is a nilpotent algebra of prime power order with finitesignature and thus supernilpotent (see [12]). Ceqv for such algebras can be solvedin polynomial time using the algorithm proposed by Aichinger and Mudrinski [2].In this algorithm to check if a given n -ary polynomial operation is constant we needonly to check if is constant on a certain set S of O ( n C ) many tuples, where C is aconstant that depends on the algebra.This enables us to use the following algorithm to solve Ceqv . Let b p be an n -ary function. For every evaluation s from S , put values from s into argumentsfrom U and check if the obtained polynomial over the 2-nilpotent algebra withuniverse L × U is constant using the algorithm given by Claim 1. If for every IRCUIT EQUIVALENCE IN 2-NILPOTENT ALGEBRAS 13 s ∈ S the obtained polynomial is constant and equal the same constant, then b p isconstant. Otherwise, b p is not constant. This algorithm obviously solve our problemin polynomial time. Thus all that is left is to give a proof of Claim 1.If | U | and | L | are co-prime then using the result from the previous two sectionswe can express b p as in (6):(9) b p ( u , . . . , u k ) = X l =1 ,...,sβ ∈ ( Un ) ∗ µ lβ,l m l ( β ⊙ ø u ) . It is not hard to see that we can obtain such a form of b p in polynomial timestep by step composing basic operations occurring in p . Note that b p is a constantfunction if and only if for every i it does not depend on u ( i ) . Hence, from now wewill be looking for an algorithm determining if b p depends on i -th coordinate.By Lemma 4.3 if our function does not depend on variables u ( i ) then also forevery β ∈ ( U n ) ∗ the following subterm does not depend on u ( i ) : t ( u ) = X j =1 ...sα ∈ ( i ) ( M ( i )1 ,β ) µ ( j ) α m j ( α ⊙ u )As ( i ) ( M ( i )1 ) is an equivalence relation, we can partition the set of nondegenerate β ’s into classes of ( i ) ( M ( i )1 ) and check if the corresponding expressions t ( u ) do notdepend on u (1) . So our algorithm checks if a term t for two evaluations u, v ∈ U n that differ only on the i -th coordinate gives the same value. It considers cases,when h β ( i ) , u ( i ) i = c and h β ( i ) , v ( i ) i = d for all c, d ∈ U . The fact that we sum α ’s in one ( i ) ( M ( i )1 ) class will lead us to recursive calls to problems with muchsimpler terms.As β ( i ) is nondegenerate, there exist an index k with invertible β ( i ) k . Thereforethe equation h β ( i ) , u ( i ) i = c is equivalent to u ( i ) k = ( β ( i ) k ) − ( c − P l = k β ( i ) l u ( i ) l ). Henceevaluations with h β ( i ) , u ( i ) i = c are of the form(10) (cid:16) u (1)1 , . . . , u ( i ) k − , ( β ( i ) k ) − ( c − X l = k β ( i ) l u ( i ) l ) , u ( i ) k +1 , . . . , u ( m ) n (cid:17) So we can define t c (ø u ) as function created from t (ø u ) by eliminating variable u ( i ) k according to (10). Now take c, d ∈ U and u, v non-equal only on i -th coordinate with h β ( i ) , u ( i ) i = c and h β ( i ) , v ( i ) i = d . As u, v are equal on all coordinates different than i -th, we identify variables u ( l ) = v ( l ) for l = i in t c (ø u ) − t c (ø v ) and get a function w c,d (ø u, ø v ). Now we recursively check if w c,d (ø u, ø v ) ≡ u, ø v . It’s obviousthat the statement that for all choices of c, d ∈ U equation w c,d (ø u, ø v ) ≡ t ( u ) does not depend on u ( i ) . Now notice, that we canreduce checking w c,d (ø u, ø v ) ≡ w c,d (ø u, ø v ) is constant by checkingif for one evaluation its 0.In such a way we will reduce our question to a constant number of easier ques-tions, as there is only a constant number of pairs c, d . Note that if α ∈ dep ( i ) ( β, M )then there exist ν α,β,i ∈ Z p kii and m α,β,i such that h α ( i ) , u ( i ) i = ν α,β,i h β ( i ) , u ( i ) i + h m α,β,i , u ( i ) i and h m α,β,i , u ( i ) i ∈ M . Hence, we obtain that t ( u ) = X j =1 ...sα ∈ ( i ) ( M ( i )1 ,β ) µ ( j ) α m j ( h α (1) , u (1) i , . . . , ν α,β,i h β ( i ) , u ( i ) i + h m α,β,i , u ( i ) i , . . . , h α ( m ) , u ( m ) i )and if we assume that h β ( i ) , u ( i ) i = c and consequently substitute u ( i ) k according to(10) then(11) t c (ø u ) = X j =1 ...sα ∈ ( i ) ( M ( i )1 ,β ) µ ( j ) α m j ( h α (1) , u (1) i , . . . , ν α,β,i c + h m ′ α,β,i , u ( i ) i , . . . , h α ( m ) , u ( m ) i )where h m ′ α,β,i , u ( i ) i ∈ M ( i )1 . Now observe, that since h m ′ α,β,i , u ( i ) i ∈ M ( i )1 we havethat h m ′ α,β,i , u ( i ) i = p i · ( h m ′′ α,β,i , u ( i ) i ) = h m ′′ α,β,i , ( p i · u ( i ) ) i . Since p i Z p kii is iso-morphic to Z p ki − i , we obtain, in fact, that the expression t c (ø u ) − t d (ø v ) is oversome smaller domain (as we can apply reasoning to both t (ø u ) and t (ø v )). So w c,d (ø u, ø v ) can be regarded as an expression over smaller domain. We then cancontinue recursively and apply Lemma 4.3 to w c,d (ø u, ø v ) ( with the remark that w c,d (ø u, ø v ) might not be in the form required, but can be easily turned into suchan expression, by eliminating all degenerated expressions as discussed in the lastsection).This consideration gives us a recursive algorithm for determining if a given func-tion in form (9) is constant. Observe that if for all i we have k i = 0, then U is oneelement set so we obtain constant expressions and all we need is to compare theirvalues. Note that in every recursive call we reduce the problem to solving linearlymany simpler cases. Simpler means for us that this new functions have descriptionswhich are not longer than twice the original one and are over smaller domain. Sincethe depth of the recursion is bounded by a constant it means that our algorithmworks in polynomial time. This observation completes the proof of the claim andin a consequence the proof of the theorem. (cid:3) References [1] Erhard Aichinger. Solving systems of equations in supernilpotent algebras. In . SchlossDagstuhl-Leibniz-Zentrum fuer Informatik, 2019.[2] Erhard Aichinger and Nebojˇsa Mudrinski. Some applications of higher commutators inMal’cev algebras.
Algebra universalis , 63(4):367–403, 2010.[3] Stanley Burris and John Lawrence. Results on the equivalence problem for finite groups.
Algebra Universalis , 52(4):495–500, 2005.[4] Ralph Freese and Ralph McKenzie.
Commutator theory for congruence modular varieties ,volume 125. CUP Archive, 1987.[5] Mikael Goldmann and Alexander Russell. The complexity of solving equations over finitegroups.
Information and Computation , 178(1):253–262, 2002.[6] G´abor Horv´ath. The complexity of the equivalence and equation solvability problems overnilpotent rings and groups.
Algebra universalis , 66(4):391–403, 2011.[7] G´abor Horv´ath, L´aszl´o M´erai, Csaba Szab´o, and John Lawrence. The complexity of theequivalence problem for nonsolvable groups.
Bulletin of the London Mathematical Society ,39(3):433–438, 2007.[8] G´abor Horv´ath and Csaba Szab´o. The extended equivalence and equation solvability problemsfor groups.
Discrete Mathematics and Theoretical Computer Science , 13(4):23–32, 2011.
IRCUIT EQUIVALENCE IN 2-NILPOTENT ALGEBRAS 15 [9] G´abor Horv´ath and Csaba Szab´o. Equivalence and equation solvability problems for thealternating group a4.
Journal of Pure and Applied Algebra , 216(10):2170–2176, 2012.[10] Pawel M Idziak, Piotr Kawalek, and Jacek Krzaczkowski. Expressive power, satisfiabilityand equivalence of circuits over nilpotent algebras. In . Schloss Dagstuhl-Leibniz-Zentrum fuer Informatik, 2018.[11] Pawe l M Idziak and Jacek Krzaczkowski. Satisfiability in multi-valued circuits. In
Proceedingsof the 33rd Annual ACM/IEEE Symposium on Logic in Computer Science , pages 550–558.ACM, 2018.[12] Keith Kearnes. Congruence modular varieties with small free spectra.
Algebra Universalis ,42(3):165–181, 1999.[13] Ondˇrej Kl´ıma. Complexity issues of checking identities in finite monoids. In
Semigroup Forum ,volume 79, page 435. Springer, 2009.[14] Michael Kompatscher. Notes on extended equation solvability and identity checking forgroups.
Acta Mathematica Hungarica , pages 1–11, 2019.[15] Yu. V. Matijasevic. Enumerable sets are diophantine. In
Soviet Mathematics Doklady , vol-ume 11, pages 354–358, 1970.[16] Matt Moore and Andrew Moorhead. Supernilpotence need not imply nilpotence.
Journal ofAlgebra , volume 535, pages 225-250, 2019.[17] Bernhard Schwarz. The complexity of satisfiability problems over finite lattices. In
AnnualSymposium on Theoretical Aspects of Computer Science , pages 31–43. Springer, 2004.
Piotr Kawa lek, Jagiellonian University, Faculty of Mathematics and Computer Sci-ence, Department of Theoretical Computer Science, ul. Prof. S. Lojasiewicza 6, 30-348,Krak´ow, Poland
E-mail address : [email protected] Michael Kompatscher, Charles University Prague, MFF, Department of Algebra,Sokolovka 83, 186 75 Praha 8, Czech Republic
E-mail address : [email protected] Jacek Krzaczkowski, Maria Curie-Sk lodowska University, Faculty of Mathematics,Physics and Computer Science, Department of Computer Science, ul.Akademicka 9, 20-033, Lublin, PolandJagiellonian University, Faculty of Mathematics and Computer Science, Departmentof Theoretical Computer Science, ul. Prof. S. Lojasiewicza 6, 30-348, Krak´ow, Poland
E-mail address ::