Parallel algorithms for power circuits and the word problem of the Baumslag group
aa r X i v : . [ c s . CC ] F e b Parallel algorithms for power circuits and theword problem of the Baumslag group
Caroline Mattes ∗ Armin Weiß ∗ February 22, 2021
Power circuits have been introduced in 2012 by Myasnikov, Ushakov and Won asa data structure for non-elementarily compressed integers supporting the arithmeticoperations addition and ( x, y ) x · y . The same authors applied power circuitsto give a polynomial-time solution to the word problem of the Baumslag group,which has a non-elementary Dehn function.In this work, we examine power circuits and the word problem of the Baumslaggroup under parallel complexity aspects. In particular, we establish that the wordproblem of the Baumslag group can be solved in NC – even though one of the essen-tials steps is to compare two integers given by power circuits and this problem, ingeneral, is P -complete. The key observation here is that the depth of the occurringpower circuits is logarithmic and such power circuits, indeed, can be compared in NC . Contents ∗ Universit¨at Stuttgart, Institut f¨ur Formale Methoden der Informatik (FMI), Universit¨atsstraße 38, Stuttgart Introduction
The word problem of a finitely generated group G is as follows: does a given word over thegenerators of G represent the identity of G ? It was first studied by Dehn as one of thebasic algorithmic problems in group theory [8]. Already in the 1950s, Novikov and Boonesucceeded to construct finitely presented groups with an undecidable word problem [5, 32].Nevertheless, many natural classes of groups have an (efficiently) decidable word problem –most prominently the class of linear groups (groups embeddable into a matrix group over somefield): their word problem is in LOGSPACE [22, 36] – hence, in particular, in NC , i.e., decidableby Boolean circuits of polynomial size and polylogarithmic depth (or, equivalently decidablein polylogarithmic time using polynomially many processors).There are various other results on word problems of groups in small parallel complexityclasses defined by circuits. For example the word problems of solvable linear groups are evenin TC (constant depth with threshold gates) [19] and the word problems of Baumslag-Solitargroups and of right-angled Artin groups are AC -Turing-reducible to the word problem of anon-abelian free group [40, 18]. Moreover, Thompson’s groups are co-context-free [21] andhyperbolic groups have word problem in LOGCFL [23]. All these classes are contained within NC . On the other hand, there are also finitely presented groups with a decidable word problembut with arbitrarily high complexity [35].A mysterious class of groups under this point of view are one-relator groups, i.e. groupsthat can be written as a free group modulo a normal subgroup generated by a single element( relator ). Magnus [26] showed that one-relator groups have a decidable word problem; hisalgorithm is called the Magnus breakdown procedure (see also [25, 27]). Nevertheless, thecomplexity remains an open problem – although it is not even clear whether the word problemsof one-relator groups are solvable in elementary time, in [3] the question is raised whether theyare actually decidable in polynomial time.In 1969 Gilbert Baumslag defined the group G , = (cid:10) a, b | bab − a = a bab − (cid:11) as an exampleof a one-relator group which enjoys certain remarkable properties. It is infinite and non-abelian,but all its finite quotients are cyclic and it is not residually finite [4]. Moreover, Gersten showedthat the Dehn function of G , is non-elementary [15] and Platonov [33] made this more preciseby proving that it is (roughly) τ (log n ) where τ (0) = 1 and τ ( i + 1) = 2 τ ( i ) for i ≥ n , one obtains as intermediate results words of the form v x · · · v x m m where v i ∈ { a, b, bab − } , x i ∈ Z , and m ≤ n . The issue is that the x i might growup to τ (log n ); hence, this algorithm has non-elementary running time. However, as foreseenby the above-mentioned conjecture, Myasnikov, Ushakov and Won succeeded to show that theword problem of G , is, indeed, decidable in polynomial time [29]. Their crucial contributionwas to introduce so-called power circuits in [30] for compressing the x i in the description above.Roughly speaking, a power circuit is a directed acyclic graph (a dag) where the edges arelabelled by ±
1. One can define an evaluation of a vertex P as two raised to the power of the(signed) sum of the successors of P . Thus, power circuits can be seen in the broader context ofarithmetic circuits and arithmetic complexity. Note that this way the value τ ( n ) of the towerfunction can be represented by an n -vertex power circuit – thus, power circuits allow for anon-elementary compression. The crucial feature for the application to the Baumslag group isthat power circuits not only efficiently support the operations +, − , and ( x, y ) x · y , but2lso the test whether x = y or x < y for two integers represented by power circuits can bedone in polynomial time. The main technical part of the comparison algorithm is the so-calledreduction process, which computes a certain normal form for power circuits.Based on these striking results, Diekert, Laun and Ushakov [10, 9] improved the algorithm forpower circuit reduction and managed to decrease the running time for the word problem of theBaumslag group from O ( n ) down to O ( n ). They also describe a polynomial-time algorithmfor the word problem of the famous Higman group H [16]. In [31] these algorithms havebeen implemented in C++. Subsequently, more applications of power circuits to these groupsemerged: in [20] a polynomial time solution to the word problem in generalized Baumslag andHigman groups is given, in [12, 11] the conjugacy problem of the Baumslag group is shown to bestrongly generically in P and in [2] the same is done for the conjugacy problem of the Higmangroup. Here “generically” roughly means that the algorithm works for most inputs (for detailson the concept of generic complexity, see [17]). Other examples where compression techniqueslead to efficient algorithms in group theory can be found e.g. in [13, 14] or [24, Theorems 4.6,4.8 and 4.9]. Finally, notice that in [28] the word search problem for the Baumslag group hasbeen examined using parametrized complexity. Contribution.
The aim of this work is analyze power circuits and the word problem of theBaumslag group under the view of parallel (circuit) complexity. For doing so, we first examineso-called compact representations of integers and show that ordinary binary representationscan be converted into compact representations by constant depth circuits (i.e., in AC – seeSection 3). We then apply this in the power circuit reduction process, which is the maintechnical contribution of this paper. While [30, 10] give only polynomial time algorithms, wepresent a more refined method and analyze it in terms of parametrized circuit complexity.The parameter here is the depth D of the power circuit. More precisely, we present thresholdcircuits of depth O ( D ) for power circuit reduction. This leads to the following result: Proposition A.
The problem of comparing two integers given by power circuits of logarithmicdepth is in TC . We then analyze the word problem of the Baumslag group carefully. In particular, we showthat all appearing power circuits have logarithmic depth. Using Proposition A this gives us a TC algorithm for computing the Britton reduction of uv if u and v are already Britton-reduced(Britton reductions are the basic step in the Magnus breakdown procedure – see Section 5 fora definition). Putting things together, we obtain the following result: Theorem B.
The word problem of the Baumslag group G , is in TC . In the final part of the paper we show that our parametrized analysis of power circuitreduction is essentially the best we can hope for as comparing two integers given by a reducedpower circuit is actually in AC . Theorem C.
The problem of comparing two integers given by power circuits is P -complete. TC k is the class of problems decidable by polynomial size threshold circuits of depth O (log k n ). We have TC ⊆ TC ⊆ NC . Notice that Theorem C is already stated in the second author’s dissertation [39], but it never appeared in arefereed journal or conference proceedings. Moreover, the actual result we show in Theorem 49 is an evenstronger (but more technical) statement. Notation and preliminaries
General notions.
We use standard O -notation for functions from N to non-negative reals R ≥ ,see e.g. [7]. Throughout, the logarithm log is with respect to base two. The tower function τ : N → N is defined by τ (0) = 1 and τ ( i + 1) = 2 τ ( i ) for i ≥
0. It is primitive recursive, but τ (6) written in binary cannot be stored in the memory of any conceivable real-world computer.We denote the support of a function f : X → R by σ ( f ) = { x ∈ X | f ( x ) = 0 } . Furthermore,the interval of integers { i, . . . , j } ⊆ Z is denoted by [ i .. j ] and we define [ n ] = [0 .. n − Z [1 /
2] = { p/ q ∈ Q | p, q ∈ Z } for the set of dyadic fractions.Let Σ be a set. The set of all words over Σ is denoted by Σ ∗ = S n ∈ N Σ n . It is the freemonoid over Σ with the empty word 1 as neutral element. The length of a word w ∈ Σ ∗ isdenoted by | w | . We assume the reader to be familiar with the complexity classes
LOGSPACE and P (polynomialtime); see e.g. [1] for details. Most of the time, however, we use circuit complexity within NC .Throughout, we assume that languages L (resp. inputs to functions f ) are encoded over thebinary alphabet { , } . Let k ∈ N . A language L (resp. function f ) is in AC k if there is a familyof polynomial-size Boolean circuits of depth O (log k n ) (where n is the input length) deciding L (resp. computing f ). More precisely, a Boolean circuit is a dag (directed acyclic graph) wherethe vertices are either input gates x , . . . , x n , or Not , And , or Or gates. There are one ormore designated output gates (for computing functions there is more than one output gate –in this case they are numbered from 1 to m ). All gates may have unbounded fan-in (i.e., thereis no bound on the number of incoming wires). A language L ⊆ { , } ∗ belongs to AC k if thereexists a polynomial p and a family ( C n ) n ∈ N of Boolean circuits such that x ∈ L ∩ { , } n if andonly if the output gate of C n evaluates to 1 when assigning x = x · · · x n to the input gates.Moreover, C n may contain at most p ( n ) gates and have depth O (log k n ). Here, the depth ofa circuit is the length of the longest path from an input gate to an output gate. Likewise AC k -computable functions are defined.The class TC k is defined analogously with the difference that also Majority gates areallowed (a
Majority gate outputs 1 if its input contains more 1s than 0s). Moreover, NC = S k ≥ TC k = S k ≥ AC k . For more details on circuits we refer to [38]. Our algorithms (orcircuits) rely on two basic building blocks which can be done in TC (see [38]): Example . Iterated addition is the following problem:
Input: n numbers A , . . . , A n each having n bits Output: P ni =1 A i This is well-known to be in TC . Example . Let ( k , v ) , . . . , ( k n , v n ) be a list of n key-value pairs ( k i , v i ) equipped with atotal order on the keys k i such that it can be decided in TC whether k i < k j . Then theproblem of sorting the list according to the keys is in TC : the desired output is a list( k π (1) , v π (1) ) , . . . , ( k π ( n ) , v π ( n ) ) for some permutation π such that k π ( i ) ≤ k π ( j ) for all i < j .We briefly describe a circuit family to do so: The first layer compares all pairs of keys k i , k j in parallel. For all i and j the next layer computes a predicate P ( i, j ) which is true if and onlyif |{ ℓ | k ℓ < k i }| = j . The latter is computed by iterated addition. As a final step the j -thoutput pair is set to ( k i , v i ) if, and only if, P ( i, j ) is true.4 emark . The class NC is contained in P if we consider uniform circuits. A family of circuitsis called LOGSPACE -uniform (or simply uniform) if the function 1 n C n is computable in LOGSPACE (where 1 n is the string consisting of n ones and C n is given as some reasonableencoding). Be aware that for classes below LOGSPACE usually even stronger uniformity con-ditions are imposed. In order not to overload the presentation, throughout, we state all ourresults in the non-uniform case – all uniformity considerations are left to the reader.
Parametrized circuit complexity.
In our work we also need some parametrized versions of theclasses TC k . Let par : { , } ∗ → N (called the parameter ). Let p be a polynomial and considera family of circuits ( C n,D ) n,D ∈ N such that C n,D contains at most p ( n ) gates (independently of D ) and has depth O ( D · log k n ). A language L is said to be accepted by this circuit family iffor all n and D and all x ∈ { , } n with par( x ) ≤ D we have x ∈ L if and only if C n,D evaluatesto 1 on input of x . Similarly, f : { , } ∗ → { , } ∗ is computed by ( C n,D ) n,D ∈ N if for all n and D and all x ∈ { , } n with par( x ) ≤ D the circuit C n,D evaluates to f ( x ) on input of x .We define LinDepParaTC k to be the class of languages (resp. functions) such that there existssuch a parametrization par : { , } ∗ → N and a family of circuits ( C n,D ) n,D ≥ . Note that thisis not a standard definition – nevertheless, it fits our purposes perfectly. Lemma 4.
Let
C > , k, ℓ ∈ N and par : { , } ∗ → N such that (cid:8) w ∈ { , } ∗ (cid:12)(cid:12) par( w ) ≤ C · ⌊ log | w |⌋ ℓ (cid:9) ∈ TC k + ℓ and L ∈ LinDepParaTC k (parametrized by par ). Then e L = n w ∈ L (cid:12)(cid:12)(cid:12) par( w ) ≤ C · ⌊ log | w |⌋ ℓ o is in TC k + ℓ .Proof. Let w ∈ { , } n be some input. First decide whether par( w ) ≤ log ℓ n (by the hypothesisthis is in TC k + ℓ ). If yes, the circuit C n,C ·⌊ log n ⌋ ℓ can be used to decide whether w ∈ e L . Clearly,the combined circuit has polynomial size. Its depth is O (log k + ℓ n ) plus O ( C · ⌊ log n ⌋ ℓ · log k n ) = O (log k + ℓ n ) for C n,C ·⌊ log n ⌋ ℓ . Hence, we have obtained a TC k + ℓ circuit.We introduce this parametrized TC k classes because later for computing reduced powercircuits we apply a non-constant number of TC computations f one after each other. Thenumber of these computations is the depth of the power circuit. The crucial step is to showthat after any number of applications of f , the output is still polynomially bounded. Puttingthings together, we obtain a LinDepParaTC computation parametrized by the depth of thepower circuit. Let us formalize this idea:Denote the i -fold composition of f by f ( i ) (i.e., f (0) is the identity function and f ( i ) = f ◦ f ( i − for i ≥ Lemma 5.
Let f : { , } ∗ → { , } ∗ be TC k -computable such that for all x ∈ { , } ∗ there issome ω x ≤ | x | with f ( ω x ) ( x ) = f ( ω x +1) ( x ) . Further, assume that there is some polynomial p such that for all x ∈ { , } ∗ and for all i ∈ N we have (cid:12)(cid:12) f ( i ) ( x ) (cid:12)(cid:12) ≤ p ( | x | ) .Then x f ( ω x ) ( x ) is in LinDepParaTC k where the parameter par : { , } ∗ → N is defined by x ω x . roof. Let ( C n ) n ∈ N be the family of TC k circuits computing f . We construct a new family ofcircuits ( C n,ω ) n,ω ∈ N . Let ˜ C m be a circuit consisting of C i for all i ∈ [0 .. m ] in parallel. Wecan compose ˜ C p ( n ) ◦ C n by feeding the outputs of C n into the C i (as part of ˜ C p ( n ) ) with theappropriate number of input bits. By iterating this, we obtain a circuit ˜ C p ( n ) ◦ · · · ◦ ˜ C p ( n ) ◦ C n consisting of C n followed by ω − C p ( n ) . By the hypothesis of the lemma, we canassume ω ≤ n , so this circuit contains at most n · ( p ( n )) gates. Moreover, the depth of ˜ C p ( n ) is O (log k p ( n )) = O (log k n ), so the depth of C n,ω is O ( ω · log k ( n )). Consider a pair (Γ , δ ) where Γ is a set of n vertices and δ is a mapping δ : Γ × Γ → { − , , +1 } .The support of δ is the subset σ ( δ ) ⊆ Γ × Γ consisting of those (
P, Q ) with δ ( P, Q ) = 0.Thus, (Γ , σ ( δ )) is a directed graph without multi-edges. Throughout we require that (Γ , σ ( δ ))is acyclic – i.e., it is a dag. In particular, δ ( P, P ) = 0 for all vertices P . A marking is amapping M : Γ → { − , , +1 } . Each node P ∈ Γ is associated in a natural way with a markingΛ P : Γ → { − , , +1 } , Q δ ( P, Q ) called its successor marking. The support of Λ P consistsof the target nodes of outgoing edges from P . We define the evaluation ε ( P ) of a node ( ε ( M )of a marking resp.) bottom-up in the dag by induction: ε ( P ) = 2 ε (Λ P ) for a node P ,ε ( M ) = X P M ( P ) ε ( P ) for a marking M .
We have ε (Λ P ) = log ( ε ( P )), i.e., the marking Λ P plays the role of a logarithm.Note that leaves (nodes of out-degree 0) evaluate to 1 and every node evaluates to a positivereal number. However, we are only interested in the case that all nodes evaluate to integers: Definition . A power circuit is a pair (Γ , δ ) with δ : Γ × Γ → { − , , +1 } such that (Γ , σ ( δ ))is a dag and all nodes evaluate to some positive natural number in 2 N .The size of a power circuit is the number of nodes | Γ | . By abuse of language, we also simplycall Γ a power circuit and suppress δ whenever it is clear. If S ⊆ Γ, we write M | S for therestriction of M to S . Let (Γ ′ , δ ′ ) be a power circuit, Γ ⊆ Γ ′ , δ = δ ′ | Γ × Γ , and δ ′ | Γ × (Γ ′ \ Γ) = 0.Then (Γ , δ ) itself is a power circuit. We call it a sub-power circuit and denote this by (Γ , δ ) ≤ (Γ ′ , δ ′ ) or, if δ is clear, by Γ ≤ Γ ′ .If M is a marking on S ⊆ Γ, we extend M to Γ by setting M ( P ) = 0 for P ∈ Γ \ S . Withthis convention, every marking on Γ also can be seen as a marking on Γ ′ if Γ ≤ Γ ′ . Example . We can represent every integer in the range [ − n, n ] as the evaluation of somemarking in a power circuit with node set { P , . . . , P ℓ − } such that ε ( P i ) = 2 i for i ∈ [ ℓ ] and ℓ = ⌊ log n ⌋ + 1. Thus, we can convert the binary notation of an integer n into a power circuitwith O (log | n | ) vertices and O ((log | n | ) log log | n | ) edges. Example . A power circuit of size n can realize τ ( n ) since a directed path of n nodes represents τ ( n ) as the evaluation of the last node. Definition . We call a marking M compact if for all P, Q ∈ σ ( M ) with P = Q we have | ε (Λ P ) − ε (Λ Q ) | ≥
2. A reduced power circuit of size n is a power circuit (Γ , δ ) with Γ given asa sorted list Γ = ( P , . . . , P n − ) such that all successor markings are compact and ε ( P i ) < ε ( P j )whenever i < j . In particular, all nodes have pairwise distinct evaluations.6t turns out to be crucial that the nodes in Γ are sorted by their values. Still, sometimesit is convenient to treat Γ as a set and we write P ∈ Γ or S ⊆ Γ with the obvious meaning.Whenever convenient we assume that ε (Λ P i ) = ∞ for i ≥ n .Notice that in [10] the data structure for a reduced power circuit also contains a bit-vectorindicating which nodes have successor markings differing by one – we will compute this infor-mation on-the-fly whenever needed. Remark . If (Γ , δ ) is a reduced power circuit with Γ = ( P , . . . , P n − ), we have δ ( P i , P j ) = 0for j ≥ i . Thus, the order on Γ by evaluations is also a topological order on the dag (Γ , σ ( δ )). In this section we will show that for every binary number we can efficiently calculate a so-calledunique compact representation, which will be crucial for the reduction process.
Definition . (i) A sequence B = ( b , . . . , b m − ) with b i ∈ { − , , +1 } for i ∈ [ m ] is called a signed-digit representation of val( B ) = P m − i =0 b i · i ∈ Z .(ii) The digit-length of B = ( b , . . . , b m − ) is the maximal i with b i − = 0.(iii) The sequence B = ( b , . . . , b m − ) is called compact if b i b i − = 0 for all i ∈ [1 .. m − b i are 0 or 1 (note that, in general, they are not compact).Also negative binary numbers can be seen as special cases of signed-digit representations –though the precise form depends on the representation: A negative number given as two’scomplement is a signed-digit representation where the most-significant digit is a − − k canbe represented as a signed-digit representation. However, in general, a signed-digit represen-tation for an integer k is not unique. Still, we will prove in this section that each integer k ,indeed, has a unique compact signed-digit representation (see also [30]).Note that by setting b i = 0 for i ≥ m , one can extend every signed-digit representation B = ( b , . . . , b m − ) to an arbitrarily long or infinite sequence. Then val( B ) and the digitlength of B do not change by doing so. Computing compact signed-digit representations.
In the following we will, amongst otherthings, show that for every binary number A there exists such a compact signed digit repre-sentation B of A and that B is unique with this property. We start with the existence and thecomplexity of calculating B . While in [30, Section 2.1] a linear-time algorithm for calculating B has been given, we aim for optimizing the parallel complexity. Theorem 12.
The following is in AC : Input:
A binary number A = ( a , . . . , a m − ) . Output:
A compact signed-digit representation of A . Notice that Theorem 12 implies that every integer has a compact signed-digit representation.Moreover, be aware that, clearly, the theorem is only true if we choose suitable encodings – inparticular, we assume that the three values − , , roof. Let A = ( a , . . . , a m − ) be a binary number. For i ≥ m we set a i = 0. We view the a i as Boolean variables and aim for constructing (almost) Boolean formulas for the compactrepresentation. Since the digits of a compact representation are from the set { − , , } , wetreat the Boolean values 0 , ∧ , ∨ , ⊕ ) with arithmetic operations (+, · ). Here ⊕ denotes the exclusive or , which is additionmodulo two.For i ≥ c i = _ ≤ j ≤ i (cid:16) ( a j ∧ a j − ) ∧ ^ j For i = 0, the claim holds because the empty disjunction is equal to 0. Now we assumethat i ≥ i − 1. We set X j = a j ∧ a j − and Y j = a j ∨ a j − .Then we obtain c i = _ ≤ j ≤ i X j ∧ ^ j By Claim 14 we have c k +1 = ( a k +1 ∧ a k ) ∨ ( c k ∧ ( a k +1 ∨ a k )). Thus, we can expressboth b k and c k +1 in terms of a k , a k +1 and c k . This leads us to the following table:8 k a k +1 c k b k c k +1 − − Claim . Let a i , b i and c i be as above. Then for all k ≥ k X i =0 i a i = 2 k +1 c k +1 + k X i =0 i b i . Proof. We use induction on k . Since c = 0 we have a = 2 · c + b by Claim 15. Therefore,the equation holds for k = 0.Now let k ≥ 0. Then we obtain k +1 X i =0 i a i = 2 k +1 a k +1 + k X i =0 i a i = 2 k +1 a k +1 + 2 k +1 c k +1 + k X i =0 i b i (by induction)= 2 k +1 ( a k +1 + c k +1 ) + k X i =0 i b i = 2 k +1 ( b k +1 + 2 c k +2 ) + k X i =0 i b i (by Claim 15)= 2 k +2 c k +2 + k +1 X i =0 i b i This proves the claim. Claim . Let B = ( b , . . . , b m − , b m ) be as defined above. Then B is compact. Proof. We have to make sure that there is no i ∈ [ m ] such that b i = 0 and b i +1 = 0. Inorder to do so, we express b i and b i +1 in terms of a i , a i +1 and c i . Notice that b i +1 is not fullydetermined by a i , a i +1 and c i . Still these three values tell us whether b i +1 is zero or not. Thisleads us to the following table, which shows that B is, indeed, compact:9 i a i +1 c i c i +1 b i b i +1 ± 10 1 1 1 − ± 11 1 0 1 − A = ( a , . . . , a m − ) and B =( b , . . . , b m − , b m ) as above. By Claim 17, B is compact. Moreover, we haveval( B ) = m X i =0 i b i = 2 m c m + m − X i =0 i b i (since c m = b m )= m − X i =0 i a i = val( A ) . (by Claim 16)Therefore, B is a compact signed-digit representation for A as claimed in Theorem 12. ByRemark 13, it can be computed in AC . Uniqueness of compact signed-digit representations. The following lemmas are crucial toolsboth for proving uniqueness of compact representations and for the power circuit reductionprocess, which we describe later. In [30, Section 2.1] similar statements can be found. Lemma 18. Let A be a compact signed-digit representation and let B = ( b , . . . , b n − ) be acompact signed-digit representation of digit-length n such that b i = n − i mod 2 (i.e., b n − = 1 and then B alternates between and ). Then we have(i) val( B ) = j n +1 k ,(ii) val( A ) ≤ val( B ) if and only if the digit-length of A is at most n or val( A ) ≤ .Proof. First, we want to calculate val( B ). If n is even, thenval( B ) = n − X i =0 i +1 = 2 n − X i =0 i = 2 · − n − · (2 n − . If n is odd, then val( B ) = n − X i =0 i = n − X i =0 i = 1 − n − +1 − n +1 − B ) = j n +1 k .In order to see (ii), denote A = ( a , . . . , a n − ). If val( A ) ≤ 0, then clearly val( A ) ≤ val( B ).Hence, assume that the digit-length of A is at most n . Consider the following operations:10. If a i = − 1, then set a i = 0.2. If a n − = 0, then set a n − = 1 and set a n − = 0.3. If a i = a i +1 = 0 with i ∈ [1 .. n − a i = 1 and a i − = 0 (technically, this rulesubsumes the previous rule).4. If a = a = 0, set a = 1.Let A ′ be the number we obtained after applying at least one of the above operations to A (ifthis is possible). Then A ′ is also a compact signed-digit representation, the digit-length of A ′ is at most n , and val( A ) < val( A ′ ). Moreover, if A = B , then we always can apply one of theserules. This shows that val( A ) ≤ val( B ).On the other hand, assume that the digit-length of A is m with m ≥ n + 1. First, assumethat a m − = 1 and set A ′ = ( a m − , . . . , a ). Then, since A is compact, we have a m − = 0and, hence, val( A ) = 2 m − + val( A ′ ). By the previous implication and part (i), we know that | val( A ′ ) | ≤ j m − k . Therefore, val( A ) ≥ m − −| val( A ′ ) | ≥ m − − j m − k > (cid:4) m (cid:5) ≥ j n +1 k =val( B ). If a m − = − 1, we obtain val( A ) < Lemma 19 ([30, Lemma 4]) . Let A = ( a , . . . , a m − ) and B = ( b , . . . , b m − ) be compactsigned-digit representations. Then:(i) val( A ) = val( B ) if and only if a i = b i for all i ∈ [ m ] .(ii) Assume there is some i with a i = b i and let i = max { i ∈ [ m ] | a i = b i } . Then val( A ) < val( B ) if and only if a i < b i .Proof. Notice that (i) is an immediate consequence of (ii). In order to see (ii), observe that itsuffices to show only one implication. Let A ′ = ( a , . . . , a i ) and B ′ = ( b , . . . , b i ) and assumethat 0 = a i < b i = 1 (the cases involving the value − A ′ and B ′ are compact signed-digit representations, so by Lemma 18, val( A ′ ) ≤ j i k andval( B ′ ) > j i k . Hence, val( A ) < val( B ).From this lemma together with Theorem 12 it follows that each k ∈ Z can be uniquelyrepresented by a compact signed digit representation CR( k ). Likewise for a signed digit rep-resentation A , we write CR( A ) for its compact signed digit representation. Corollary 20. The following problems are in AC :(i) Input: A signed-digit representation A . Output: CR( A ) .(ii) Input: Signed-digit representations A and B . Output: The compact signed-digit representation of val( A ) + val( B ) .(iii) Input: Signed-digit representations A and B . Question: Is val( A ) < val( B ) ? roof. Given a signed-digit representation A = ( a , . . . , a m − ), we can split it into two non-negative binary numbers B, C such that val( A ) = val( B ) − val( C ) (i.e., b i = max { , a i } and c i = − min { , a i } ). From these binary numbers we can compute the difference in AC and thenmake the result compact using Theorem 12. To see (ii), we proceed exactly the same way. Forcomparing two signed-digit representations, we compute their compact representations usingpart (i) and then compare them in AC by evaluating the condition in Lemma 19. Before we consider the computation of reduced power circuits, which is our main result in thissection, let us introduce some more notation on power circuits and recall the basic operationsfrom [30, 10] under circuit complexity aspects. Markings and chains. Definition . Let (Γ , δ ) be a reduced power circuit with Γ given as the sorted list Γ =( P , . . . , P n − ).(i) A chain C of length ℓ in Γ starting at P i = start( C ) is a sequence ( P i , . . . , P i + ℓ − ) suchthat ε ( P i + j +1 ) = 2 · ε ( P i + j ) for all j ∈ [ ℓ − ε ( P i + j ) = 2 j · ε ( P i ) for all j ∈ [ ℓ ]. As we do for Γ, we treat a chain both asa sorted list and as a set.(ii) We call a chain C maximal if it cannot be extended in either direction. We denote theset of all maximal chains by C Γ .As a set, a reduced power circuit is the disjoint union of its maximal chains.(iii) Let M be a marking in the reduced power circuit (Γ , δ ) and let C = ( P i , . . . , P i + ℓ − ) ∈ C Γ and define a i = M ( P i ) for i ∈ [ ℓ ]. Then we write digit C ( M ) = ( a , . . . , a ℓ − ).(iv) There is a unique maximal chain C containing the node P of value 1. We call C the initial maximal chain of Γ and denote it by C = C (Γ).We will show how to computationally find the maximal chains in Corollary 27. The followingfacts are clear from the definition of maximal chains: Fact 22. Let (Γ , δ ) be a reduced power circuit and let M be a marking on Γ . Then the followingholds:(i) ε ( M | C ) = ε (start( C )) · val(digit C ( M )) for every chain C in Γ (even if C is not maximal).(ii) ε ( M ) = P C ∈C Γ ε (start( C )) · val(digit C ( M )) .(iii) The marking M is compact if and only if digit C ( M ) is compact for all C ∈ C Γ . Lemma 23. Let (Γ , δ ) be a reduced power circuit. Let L and M be compact markings in Γ such that ε ( L ) > ε ( M ) and let ≤ k ≤ j | C | +1 k . Then ε ( L ) ≤ ε ( M ) + k if and only if thefollowing holds: ε ( M | Γ \ C ) = ε ( L | Γ \ C ) and • ε ( L | C ) ≤ ε ( M | C ) + k .Proof. We first assume that ε ( M | Γ \ C ) = ε ( L | Γ \ C ) and aim for showing that ε ( L ) > ε ( M ) + k :By Lemma 18, we have | ε ( L | C ) | , | ε ( M | C ) | ≤ j | C | +1 k . Hence, (cid:12)(cid:12) ε ( M | C ) + k − ε ( L | C ) (cid:12)(cid:12) ≤ | ε ( M | C ) | + k + | ε ( L | C ) | ≤ $ | C | +1 % ≤ | C | +1 − . Furthermore, ε ( L | Γ \ C ) − ε ( M | Γ \ C ) is a multiple of 2 | C | +1 . Therefore, by the assumption ε ( L ) > ε ( M ) and Lemma 19, we obtain ε ( L | Γ \ C ) − ε ( M | Γ \ C ) ≥ | C | +1 . It follows that ε ( L | Γ \ C ) − ε ( M | Γ \ C ) + ε ( L | C ) − ε ( M | C ) − k ≥ ε ( L ) > ε ( M ) + k .Now assume that ε ( M | Γ \ C ) = ε ( L | Γ \ C ). It remains to show that under this assumption wehave ε ( L ) ≤ ε ( M ) + k if and only if ε ( L | C ) ≤ ε ( M | C ) + k . However, this follows immediatelyfrom the fact that ε ( L ) = ε ( L | Γ \ C ) + ε ( L | C ) and ε ( M ) + k = ε ( M | Γ \ C ) + ε ( M | C ) + k. This finishes the proof of the lemma. Comparison of markings. Lemma 24. Given a reduced power circuit (Γ , δ ) and a node P ∈ Γ one can decide in AC whether P ∈ C .Remark . Since membership in AC often highly depends on the encoding of the input, inthe following we always assume that power circuits are given in a suitable way. In particular,we may assume that an n -node power circuit is given by the n × n matrix representing δ whereeach entry from { , ± } is encoded using two bits. Moreover, in order to represent powercircuits with fewer nodes within the same data structure, we can allow one deleted bit forevery row and column of the matrix. Markings can be encoded the same way by a sequenceof n symbols from { , ± } . Moreover, if the power circuit is reduced, we also assume that thematrix representing δ is already in the sorted order (in particular, the ordering is not given bysome separate data structure).In the following, we do not further consider these encoding issues. Moreover, as soon as weare dealing with TC circuits, there is a lot of freedom how to encode inputs. Proof of Lemma 24. Let Γ = ( P , . . . , P n − ). For each i we define a signed-digit representation A i = ( a i, , . . . , a i,n − ) by a i,j = Λ P i ( P j ). These signed-digit representations might not becompact, but, if P i ∈ C , then A i is compact (this is because, by Remark 10, P i has onlysuccessors in C ). Using Corollary 20, we can compute the maximal i max such that A i max iscompact and for all i < i max also A i is compact and val( A i +1 ) = val( A i ) + 1 = i + 1 (checkingwhether A i is compact, clearly, can be done in AC ). By a straightforward induction, weobtain that for i ≤ i max , we have val( A i ) = ε ( P i ) and P i ∈ C . On the other hand, clearly, P i max +1 C . Hence, we have computed C . 13 roposition 26. Let △ ∈ { = , = , <, ≤ , >, ≥} . The following problems are in AC :(a) Input: A reduced power circuit (Γ , δ ) and compact markings L and M on Γ . Question: Is ε ( L ) △ ε ( M ) ?(b) Input: A reduced power circuit (Γ , δ ) with compact markings L, M and k ∈ [0 .. (cid:4) | C | +1 (cid:5) ] . Question: Is ε ( L ) △ ε ( M ) + k ?Proof. Let us choose ≤ as △ (the other cases follow from this case in a straightforward way).Let Γ = ( P , . . . , P n − ). By Lemma 19 (a) we can check in AC if ε ( L ) = ε ( M ). If this isnot the case, then by Lemma 19 (ii) we have ε ( M ) < ε ( L ) if and only if M ( P i ) < L ( P i ) for i = max { i ∈ [ n ] | M ( P i ) = L ( P i ) } . Now, i can be found in AC and, hence, the whole checkis in AC . This proves part (a).For part (b) we first check whether ε ( L ) ≤ ε ( M ). If yes, then ε ( L ) ≤ ε ( M ) + k . Accordingto part (a), this check is possible in AC . Now assume that ε ( L ) > ε ( M ). By Lemma 24,we can compute C in AC . By Lemma 23 we know that ε ( L ) ≤ ε ( M ) + k if and only if ε ( M | Γ \ C ) = ε ( L | Γ \ C ) and ε ( L | C ) ≤ ε ( M | C ) + k . The markings M | Γ \ C and L | Γ \ C are stillcompact markings in a reduced power circuit, and so we are able to decide in AC if that equalityholds by part (a). So it remains to check if ε ( L | C ) ≤ ε ( M | C )+ k . This amounts to an additionand a comparison of signed-digit representations of digit-length at most | C | + 1 (according toLemma 18), which both can be done in AC (see Corollary 20). Thus, ε ( L ) △ ε ( M ) + k canbe checked in AC . Corollary 27. We can decide in AC , given a reduced power circuit (Γ , δ ) and nodes P, Q ∈ Γ ,whether P and Q belong to the same maximal chain of Γ .Proof. Let P = P i and Q = P j with i < j . Then P and Q belong to the same maximal chainif and only if ε (Λ P ℓ +1 ) = ε (Λ P ℓ ) + 1 for all ℓ ∈ [ i .. j − AC using Proposition 26. Calculations with markings. Lemma 28. The following problems are all in TC :(a) Input: A power circuit (Π , δ Π ) together with markings K and L . Output: A marking M in a power circuit (Π ′ , δ Π ′ ) such that ε ( M ) = ε ( K ) + ε ( L ) and (Π , δ Π ) ≤ (Π ′ , δ Π ′ ) , | Π ′ | ≤ · | Π | and depth(Π ′ ) = depth(Π) .(b) Input: A power circuit (Π , δ Π ) together with a marking L . Output: A marking M in the power circuit (Π , δ Π ) such that ε ( M ) = − ε ( L ) .(c) Input: A power circuit (Π , δ Π ) together with markings K and L such that ε ( L ) ≥ . Output: A marking M in a power circuit (Π ′ , δ Π ′ ) such that ε ( M ) = ε ( K ) · ε ( L ) and (Π , δ Π ) ≤ (Π ′ , δ Π ′ ) , | Π ′ | ≤ · | Π | and depth(Π ′ ) ≤ depth(Π) + 1 . The proof of this lemma uses the following construction (see also [10]):14 efinition . Let (Π , δ ) be a power circuit and let M be a marking on Π.(a) Let P ∈ Π. We define a new power circuit Π ∪ { Clone ( P ) } where Clone ( P ) is a newnode with Λ Clone ( P ) = Λ P .(b) We define a marking Clone ( M ) as follows: First we clone all the nodes in σ ( M ). Thenwe set Clone ( M )( Clone ( P )) = M ( P ) for P ∈ σ ( M ) and Clone ( M )( P ) = 0 otherwise.It is clear that the problem, given a power circuit (Π , δ ) and a marking M , compute a newpower circuit (Π ′ , δ ′ ) containing Clone ( M ) is in TC – and even in AC defining the underlyingdata structure properly. Notice that | Π ′ | ≤ · | Π | and depth(Π ′ ) = depth(Π). Proof. We apply the constructions described in [30, Section 7] and [10, Section 2].Part (a): First, we clone the marking K leading to a power circuit (Π ′ , δ Π ′ ) of size at most2 · | Π | . Now Clone ( K ) and L certainly have disjoint supports. Then we define M ( P ) = Clone ( K )( P ) , P ∈ σ ( Clone ( K )) ,L ( P ) , P ∈ σ ( L ) , , otherwise.Clearly, ε ( M ) = ε ( K ) + ε ( L ), and M can be output in TC . To show (b), we set M ( P ) = ( − L ( P ) , P ∈ σ ( L ) , , otherwise.As for (a), to define M ( P ) we only have to look up L ( P ) and change the sign and we do nothave to create any new nodes or edges – so this can be done even in AC .To (c): To obtain M , we follow a similar approach as described in [10, Section 2]. We firstclone the markings K and L and so obtain markings Clone ( K ) and Clone ( L ). At this point,the size of Π increased by a factor of at most three.Next we create new edges from every node P ∈ σ ( Clone ( K )) to every node Q ∈ σ ( Clone ( L ))such that δ ( P, Q ) = Clone ( L )( Q ). This operation does not change the size of the power cir-cuit, but it increases the depth by at most 1 since there are no incoming edges to nodes in σ ( Clone ( K ). Then the marking Clone ( K ) is the marking we search for.Notice that the construction in (c) also yields ε ( M ) = ε ( K ) · ε ( L ) in the case that ε ( L ) < ε ( K ) · ε ( L ) ∈ Z in order to assure that there are no nodes of non-integralevaluation. While compact markings on a reduced power circuit yield unique representations of integers,in an arbitrary power circuit (Π , δ Π ) we can have two markings L and M such that L = M but ε ( L ) = ε ( M ). Therefore, given an arbitrary power circuit, we wish to produce a reducedpower circuit to be able to compare markings. This is done by the following theorem whoseproof covers the remainder of this section. 15 heorem 30. The following is in LinDepParaTC parametrized by depth(Π) : Input: A power circuit (Π , δ Π ) together with a marking M on Π . Output: A reduced power circuit (Γ , δ ) together with a compact marking e M on Γ suchthat ε ( e M ) = ε ( M ) . For a power circuit (Π , δ Π ) with a marking M we call the power circuit (Γ , δ ) together withthe marking e M obtained by Theorem 30 the reduced form of Π. Insertion of new nodes. The following procedure, called InsertNodes , is a basic tool forthe reduction process. Let (Γ , δ ) be a reduced power circuit and I be a set of nodes withΓ ∩ I = ∅ . Assume that for every P ∈ I there exists a marking Λ P : Γ → { − , , } satisfying: • ε (Λ P ) ≥ P ∈ I , • Λ P is compact for all P ∈ I , and • ε (Λ P ) = ε (Λ Q ) for all P, Q ∈ I ∪ Γ, P = Q .We wish to add I to the reduced power circuit (Γ , δ ). For this, we set Γ ′ = Γ ∪ I and define δ ′ : Γ ′ × Γ ′ → { − , , } in the obvious way: δ ′ | Γ × Γ = δ , δ ′ | Γ ′ × I = 0 and δ ′ ( P, Q ) = Λ P ( Q ) for( P, Q ) ∈ I × Γ. Now, (Γ ′ , δ ′ ) is a power circuit with (Γ , δ ) ≤ (Γ ′ , δ ′ ) and for every P ∈ I the mapΛ P is the successor marking of P . Moreover, each node of Γ ′ has a unique value. In order toobtain a reduced power circuit, we need to sort the nodes in Γ ′ according to their values: Sincefor every node P ∈ Γ ′ the marking Λ P is a compact marking on the reduced power circuit Γ, byProposition 26, for P, Q ∈ Γ ′ we are able to decide in AC whether ε (Λ Q ) ≤ ε (Λ P ). Therefore,by Example 2 we can sort Γ ′ according to the values of the nodes in TC and, hence, assumethat Γ ′ = ( P , . . . , P | Γ ′ |− ) is in increasing order.Observe that | Γ ′ | = | Γ ∪ I | = | Γ | + | I | . In addition, inserting a new node either extends analready existing maximal chain, joins two existing maximal chains, or increases the number ofmaximal chains by one. Therefore, |C Γ ′ | ≤ |C Γ | + | I | . So we have proven the following: Lemma 31 ( InsertNodes ) . The following problem is in TC : Input: A power circuit (Γ , δ ) and a set I with the properties described above. Output: A reduced power circuit (Γ ′ , δ ′ ) such that (Γ , δ ) ≤ (Γ ′ , δ ′ ) and such that forevery P ∈ I there is a node Q in Γ ′ with Λ Q = Λ P . In addition, • | Γ ′ | = | Γ | + | I | , and • |C Γ ′ | ≤ |C Γ | + | I | . The three steps of the reduction process. The reduction process for a power circuit (Π , δ Π )with a marking M consists of several iterations. Each iteration starts with a power circuit(Γ i ∪ Ξ i , δ i ) such that Γ i is a reduced sub-power circuit and a marking M i with ε ( M i ) = ε ( M ).The aim of one iteration is to integrate the vertices Min(Ξ i ) ⊆ Ξ i into Γ i where Min(Ξ i ) isdefined by Min(Ξ i ) = { P ∈ Ξ i | σ (Λ P ) ⊆ Γ i } and to update the marking M i accordingly. Each iteration consists of the three steps UpdateNodes , ExtendChains , and UpdateMarkings , which can be done in TC . We16ave Ξ i +1 = Ξ i \ Min(Ξ i ). Thus, the full reduction process consists of depth(Π) + 1 many TC computations. Let us now describe these three steps in detail and also show that they can bedone in TC . After that we present the full algorithm for power circuit reduction.We write (Γ ∪ Ξ , δ ) = (Γ i ∪ Ξ i , δ i ) for the power circuit at the start of one iteration (forsimplicity we do not write the indices). Let us fix its precise properties: Γ ∩ Ξ = ∅ , (Γ , δ | Γ × Γ ) ≤ (Γ ∪ Ξ , δ ) is a reduced power circuit and Λ P | Γ is a compact marking for every P ∈ Ξ. Lemma 32 ( UpdateNodes ) . The following problem is in TC : Input: A power circuit (Γ ∪ Ξ , δ ) as above. Output: A reduced power circuit (Γ ′ , δ ′ ) such that • (Γ , δ | Γ × Γ ) ≤ (Γ ′ , δ ′ ) , • for every node Q ∈ Min(Ξ) there exists a node P ∈ Γ ′ with ε ( P ) = ε ( Q ) , • | Γ ′ | ≤ | Γ | + | Min(Ξ) | , and • |C Γ ′ | ≤ |C Γ | + | Min(Ξ) | . For the proof, we define the following equivalence relation ∼ ε on Γ ∪ Min(Ξ): P ∼ ε Q if and only if ε ( P ) = ε ( Q ) . For P ∈ Γ ∪ Min(Ξ) we write [ P ] ε for the equivalence class containing P . Proof. Consider the equivalence relation ∼ ε as defined above on Γ ∪ Min(Ξ). Define a set I ⊆ Min(Ξ) by taking one representative of each ∼ ε -class not containing a node of Γ. Such aset I can be computed in TC : Clearly, Min(Ξ) can be computed in TC . The ∼ ε -classes canbe computed in AC by Proposition 26. Finally, for defining I one has to pick representatives.For example, for every ∼ ε -class which does not contain a node of Γ one can pick the first nodein the input which belongs to this class. These representatives also can be found in TC . Now,we can apply Lemma 31 to insert I into Γ in TC . This yields our power circuit (Γ ′ , δ ′ ). Thesize bounds follow now immediately from those in Lemma 31 (notice that | I | ≤ | Min(Ξ) | ). Lemma 33 ( ExtendChains ) . The following problem is in TC : Input: A reduced power circuit (Γ ′ , δ ′ ) and µ ∈ N such that µ ≤ j | C | +1 k (where, asbefore, C = C (Γ ′ ) is the initial maximal chain of Γ ′ ) Output: A reduced power circuit (Γ ′′ , δ ′′ ) such that • (Γ ′ , δ ′ ) ≤ (Γ ′′ , δ ′′ ) , • for each P ∈ Γ ′ and each i ∈ [0 .. µ ] there is a node Q ∈ Γ ′′ with ε (Λ Q ) = ε (Λ P ) + i , • | Γ ′′ | ≤ | Γ ′ | + |C Γ ′ | · µ , and • |C Γ ′′ | ≤ |C Γ ′ | .Proof. First assume that | C | = 1. Then | Γ ′ | = 1 and µ ≤ 1. If µ = 1, then just one nodehas to be created, namely the one of value 2 and we are done. Thus, in the following we can17ssume that | C | ≥ 2. Now, the proof of Lemma 33 consists of two steps: first, we extend onlythe chain C to some longer (and long enough) chain in order to make sure that the values ofthe (compact) successor markings of the nodes we wish to introduce can be represented withinthe power circuit; only afterwards we add the new nodes as described in the lemma. Step 1: We first want to extend the chain C to the chain ˜ C of minimal length such that˜ C is a maximal chain, C ⊆ ˜ C , and the last node of ˜ C is not already present in Γ ′ . Theresulting power circuit will be denoted by ˜Γ. We define i = min (cid:8) i ∈ [ | Γ ′ | ] (cid:12)(cid:12) ε (Λ P i +1 ) − ε (Λ P i ) > (cid:9) . Recall our convention that P | Γ ′ | has value infinity, so i indeed exists. Furthermore, we define I = (cid:8) i ∈ [0 .. i ] (cid:12)(cid:12) ε (Λ P i +1 ) − ε (Λ P i ) ≥ (cid:9) . Thus, in order to obtain ˜Γ, we need to insert a new node between P i and P i +1 into Γ ′ foreach i ∈ I (resp. one node above P i ). Since the successor markings of these new nodes mightpoint to some of the other new nodes, we cannot apply Lemma 31 as a black-box. Instead,we need to take some more care: the rough idea is that, first, we compute all positions I where new nodes need to be introduced ( I is as defined above), then we compute compactsigned-digit representations for the respective successor markings, and, finally, we introducethese new nodes all at once knowing that all nodes where the successor markings point to arealso introduced at the same time. In order to map the positions of nodes in Γ ′ to positions ofnodes in ˜Γ, we introduce a function λ : [ | Γ ′ | ] → N with λ ( i ) = i + | I ∩ [0 .. i − | . Observe that λ ( i ) = i for i ∈ [ | C | ], and λ ( i + 1) = λ ( i ) + 2 for i ∈ I , and λ ( j ) = j + | I | for j ≥ i + 1.For each i ∈ I we introduce a node Q i whose successor marking we will specify later suchthat ε ( Q i ) = 2 ε ( P i ). We define the new power circuit ˜Γ = ( ˜ P , . . . , ˜ P | Γ ′ | + | I |− ) by˜ P j = ( P i if j = λ ( i ) Q i if j = λ ( i ) + 1 and i ∈ I. Notice that, if j = λ ( i ) + 1 for some i ∈ I , then j = λ ( i ) for any i – hence, ˜ P j is well-definedin any case.The nodes ˜ P , . . . , ˜ P λ ( i )+1 will form the chain ˜ C as claimed above. Moreover, we have Γ ′ ⊆ ˜Γand ˜Γ is sorted increasingly. The successor markings of nodes from Γ ′ remain unchanged (i.e.,Λ ˜ P λ ( i ) ( ˜ P λ ( j ) ) = Λ P i ( P j ) for i, j ∈ [ | Γ ′ | ] and Λ ˜ P λ ( i ) ( Q j ) = 0 for j ∈ I ).For every i ∈ I we define the successor marking of the node Q i bydigit ˜ C (Λ Q i ) = CR ( ε (Λ P i ) + 1) and Λ Q i | ˜Γ \ ˜ C = 0 . Be aware that, since Q i ∈ ˜ C , also the successor marking of Q i (of value ε (Λ P i ) + 1) can berepresented using only the nodes from ˜ C (see Remark 10), so this is, indeed, a meaningfuldefinition (be aware that to represent ε (Λ P i ) + 1, we might need some of the additional nodes18 i , but never a node that is not part of the chain ˜ C ). Clearly, this yields ε (Λ Q i ) = ε (Λ P i ) + 1as desired.We obtain a reduced power circuit (˜Γ , ˜ δ ) with (Γ ′ , δ ′ ) ≤ (˜Γ , ˜ δ ) where the map ˜ δ : ˜Γ →{ − , , } is defined by the successor markings. Moreover, ˜ C ⊆ ˜Γ has the required properties.It remains to show that ˜Γ can be computed in TC : As | C | ≥ 2, according to Proposition 26,we are able to decide in AC whether the markings Λ P i and Λ P i +1 differ by 1, 2, or more than2 – for all i ∈ [ | Γ ′ | ] in parallel. Now, i can be determined in TC via its definition as above.Likewise I and the function λ can be computed in TC . By Corollary 20, CR ( ε (Λ P i ) + 1) for i ∈ I can be computed in AC (since | ˜ C | ≤ · | Γ ′ | ) showing that altogether ˜Γ can be computedin TC . Step 2: The second step is to add nodes above each chain of ˜Γ as required in the Lemma.The outcome will be denoted by (Γ ′′ , δ ′′ ). We start by defining d i = min { ε (Λ ˜ P i +1 ) − ε (Λ ˜ P i ) − , µ } for i ∈ [ | ˜Γ | ] \ (cid:8) | ˜ C | − (cid:9) and d i = min { ε (Λ ˜ P i +1 ) − ε (Λ ˜ P i ) − , µ − } for i = | ˜ C | − . In order to obtain (Γ ′′ , δ ′′ ) from (˜Γ , ˜ δ ), for every i ∈ [ | ˜Γ | ] and every h ∈ [1 .. d i ] we have toinsert a node R ( i,h ) such that ε (Λ R ( i,h ) ) = ε (Λ ˜ P i ) + h. Observe that the numbers d i can be computed in TC : since µ + 1 ≤ $ | C | +1 % + 1 ≤ $ | ˜ C | % + 1 ≤ $ | ˜ C | +1 % , by Proposition 26, we can check in AC whether ε (Λ ˜ P i +1 ) ≤ ε (Λ ˜ P i ) + k with k ≤ µ + 1. If i = | ˜ C | − k = µ , otherwise k = µ + 1. If the respective inequality holds, weobtain by Lemma 23 that ε (Λ ˜ P i +1 ) − ε (Λ ˜ P i ) − ε (Λ ˜ P i +1 | ˜ C ) − ε (Λ ˜ P i | ˜ C ) − 1. For the latterwe have signed-digit representations of digit-length at most | ˜ C | . Hence, this difference can becomputed in TC .Since ˜ P | ˜ C |− Γ ′ and in Step 1 we have not introduced any vertex above ˜ P | ˜ C |− , weknow that ˜ P | ˜ C |− is not marked by Λ ˜ P for any ˜ P ∈ ˜Γ. Therefore, for all i ∈ [ | ˜Γ | ] we have ε (Λ ˜ P i | ˜ C ) + µ ≤ j | ˜ C | k + j | C | +1 k ≤ j | ˜ C | k and, hence, by Lemma 18, ε (Λ ˜ P i | ˜ C ) + h can berepresented as a compact marking using only nodes from ˜ C for every h ∈ [1 .. d i ]. Thus, forevery d i = 0 and every h ∈ [1 .. d i ] we define a successor marking of R ( i,h ) bydigit ˜ C (Λ R ( i,h ) ) = CR( ε (Λ ˜ P i | ˜ C ) + h ) and Λ R ( i,h ) | ˜Γ \ ˜ C = Λ ˜ P i | ˜Γ \ ˜ C . Again, we know that | ˜ C | ≤ | Γ ′ | . So according to Corollary 20 we are able to calculateCR( ε (Λ ˜ P i | ˜ C ) + h ) in AC .Now we set I = (cid:8) R ( i,h ) (cid:12)(cid:12) d i = 0 , h ∈ [1 .. d i ] (cid:9) . According to Lemma 31 we are able to con-struct in TC a reduced power circuit (Γ ′′ , δ ′′ ) such that (˜Γ , ˜ δ ) ≤ (Γ ′′ , δ ′′ ) and such that foreach R ∈ I there exists a node Q ∈ Γ ′′ with ε ( Q ) = ε ( R ).Considering the size of Γ ′′ , observe that during the whole construction, for every node P i ∈ Γ ′ we create at most µ new nodes between P i and P i +1 .19oreover, we only create new nodes between P i and P i +1 if P i is the last node of a maximalchain of Γ ′ . Furthermore, notice that the only node of Γ ′ above which we have introduced newnodes in both Step 1 and Step 2 is the second largest node of ˜ C : in Step 1 we have createdone new node and in Step 2 we have created at most µ − ′ we have introduced at most µ new nodes. Thus, | Γ ′′ | ≤ | Γ ′ | + |C Γ ′ | · µ . Finally, thenew nodes we create only prolongate the already existing chains, so we do not create any newchains. This finishes the proof of the lemma.In the following, (Γ ′ , δ ′ ) denotes the power circuit obtained by UpdateNodes when startingwith (Γ ∪ Ξ , δ ), and (Γ ′′ , δ ′′ ) denotes the power circuit obtained by ExtendChains with µ = ⌈ log( | Min(Ξ) | ) ⌉ + 1 on input of the power circuit (Γ ′ , δ ′ ). The value of µ is chosen that way inorder to make sure that in the following lemma one can make the markings compact. Indeed,assume that Min(Ξ) = { P , . . . , P k } all P i with the same evaluation and all marked with 1 by M , then we might need a node of value 2 µ · ε ( P ) in order to make M compact. Lemma 34 ( UpdateMarkings ) . The following problem is in TC : Input: The power circuit (Γ ′′ , δ ′′ ) as a result of ExtendChains with µ = ⌈ log( | Min(Ξ) | ) ⌉ + 1 and a marking M on Γ ∪ Ξ . Output: A marking e M on Γ ′′ ∪ (Ξ \ Min(Ξ)) such that ε ( e M ) = ε ( M ) and e M | Γ ′′ iscompact.Proof. Consider again the equivalence relation ∼ ε as defined above on Γ ′′ ∪ Min(Ξ). For theequivalence class of a node P ∈ Γ ′′ ∪ Min(Ξ) we write [ P ] ε . We will define the marking e M onΓ ′′ by defining it on each maximal chain.Let C = ( P i , . . . , P i + h − ) ∈ C Γ ′′ be a maximal chain of length h and let S = [ P ∈ C [ P ] ε = [ P ∈ C (cid:8) Q ∈ Γ ′′ ∪ Min(Ξ) (cid:12)(cid:12) ε ( Q ) = ε ( P ) (cid:9) ⊆ Γ ′′ ∪ Min(Ξ) . We wish to find a compact marking ˜ M C with support contained in C ⊆ Γ ′′ and evaluation ε ( ˜ M C ) = ε ( M | S ). First define the integer Z M,C = h − X r =0 X Q ∈ [ P i + r ] ε M ( Q ) r . Then we have Z M,C · ε (start( C )) = h − X r =0 X Q ∈ [ P i + r ] ε M ( Q )2 r · ε (start( C ))= X Q ∈ S M ( Q ) ε ( Q )= ε ( M | S ) . Thus, defining ˜ M C by digit C ( ˜ M C ) = CR( Z M,C ) gives our desired marking.However, be aware that, for this, we have to show that the digit-length of CR( Z M,C ) isat most | C | = h . Let k be maximal such that P i + k ∈ Γ ′ . Then, in particular, no node20n S with higher evaluation than P i + k is marked by M . Moreover, by the properties of ExtendChains ( ⌈ log( | Min(Ξ) | ) ⌉ + 1), we have h − − k ≥ ⌈ log( | Min(Ξ) | ) ⌉ + 1. Therefore, Z M,C ≤ val(digit C ( M )) + | Min(Ξ) | · k ≤ · k +2 + 2 k +log( | Min(Ξ) | ) (by Lemma 18) ≤ · (cid:16) k + 2 k +log( | Min(Ξ) | ) (cid:17) ≤ · k + ⌈ log( | Min(Ξ) | ) ⌉ +2 . Thus, by Lemma 18, the digit-length of CR( Z M,C ) is at most k + ⌈ log( | Min(Ξ) | ) ⌉ + 2 ≤ h .By Corollary 27, the maximal chains can be determined in TC . Now, for every maximalchain C the (binary) number Z M,C can be computed in TC using iterated addition and madebe compact in AC using Theorem 12. Thus, the marking ˜ M C can be computed in TC .The marking e M as desired in the lemma is simply defined by e M | Ξ \ Min(Ξ) = M | Ξ \ Min(Ξ) and e M | C = ˜ M C | C for C ∈ C Γ ′′ – all the markings ˜ M C can be computed in parallel. Proof of Theorem 30. Now we are ready to describe the full reduction process based on thethree steps described above. We aim for a LinDepParaTC circuit where the input is parametrizedby the depth of the power circuit. The input is some arbitrary power circuit (Π , δ Π ) togetherwith a marking M on Π. We start with some initial reduced power circuit (Γ , δ ) and somenon-reduced part Ξ = Π and successively apply the three steps to obtain power circuits(Γ i ∪ Ξ i , δ i ) and markings M i for i = 0 , . . . while keeping the following invariants: • (Γ i , δ i | Γ i × Γ i ) ≤ (Γ i ∪ Ξ i , δ i ) (i.e., there are no edges from Γ i to Ξ i ), • Γ i is reduced, • Γ i − ≤ Γ i and Ξ i ⊆ Ξ i − , • ε ( M i ) = ε ( M ).Moreover, as long as Ξ i − = ∅ we assure that depth(Ξ i ) < depth(Ξ i − ).We first construct the initial reduced power circuit (Γ , ˜ δ ) which consists exactly of a chainof length ℓ = ⌈ log( | Min(Π) | ) ⌉ + 1. This can be done as follows: Let Γ = ( P , . . . , P ℓ − ) = C and define successor markings by digit C (Λ P i ) = CR( i ) for i ∈ [ ℓ ]. This defines ˜ δ . Now we setΞ = Π and we define δ : (Γ ∪ Ξ ) × (Γ ∪ Ξ ) → { − , , } by δ | Γ × Γ = ˜ δ , δ | Ξ × Ξ = δ Π and δ = 0 otherwise. We extend the marking M to Γ by setting M ( P ) = 0 for all P ∈ Γ . Sowe obtain a power circuit of the form (Γ ∪ Ξ , δ ) with the properties described above.Now let the power circuit (Γ i ∪ Ξ i , δ i ) together with the marking M i be the input for the i + 1-th iteration meeting the above described invariants. We write ˜ δ i = δ i | Γ i × Γ i . Now weapply the three steps from above:1. Using UpdateNodes (Lemma 32) we compute a reduced power circuit (Γ ′ i , δ ′ i ) with(Γ i , ˜ δ i ) ≤ (Γ ′ i , δ ′ i ) such that for every P ∈ Min(Ξ i ) there is some Q ∈ Γ ′ i with ε ( Q ) = ε ( P ).2. Using ExtendChains (Lemma 33) with µ = ⌈ log( | Min(Ξ i ) | ) ⌉ + 1 we extend each max-imal chain in (Γ ′ i , δ ′ i ) by at most ⌈ log( | Min(Ξ i ) | ) ⌉ + 1 nodes. The result is denoted by(Γ ′′ i , δ ′′ i ). 21. We apply UpdateMarkings (Lemma 34) to obtain markings e M i and ˜Λ P for P ∈ Ξ i \ Min(Ξ i ) on Γ ′′ i ∪ (Ξ i \ Min(Ξ i )) such that ε ( e M i ) = ε ( M i ) and ε ( ˜Λ P ) = ε (Λ P ).Observe that these markings restricted to Γ ′′ i are compact.4. Each iteration ends by setting Γ i +1 = Γ ′′ i and Ξ i +1 = Ξ i \ Min(Ξ i ) and M i +1 = e M i .Finally, δ i +1 is defined as δ ′′ i on Γ i +1 and via the successor markings ˜Λ P for P ∈ Ξ i +1 .After exactly depth(Π)+1 iterations we reach Ξ d +1 = Ξ d \ Min(Ξ d ) = ∅ where d = depth(Π).In this case we do not change the resulting power circuit any further. It is clear from Lemma 32,Lemma 33 and Lemma 34 that throughout the above-mentioned invariants are maintained.Thus, (Γ , δ ) = (Γ d +1 , δ d +1 ) is a reduced power circuit and for every node P ∈ Π there existsa node Q ∈ Γ d +1 such that ε ( Q ) = ε ( P ) and M d +1 is a compact marking on Γ d +1 with ε ( M d +1 ) = ε ( M ). Claim . Let d = depth(Π) and Γ , . . . , Γ d +1 be as constructed above. Then for all i we have • |C Γ i | ≤ | Π | + 1, • | Γ i | ≤ ( | Π | + 1) · (log( | Π | ) + 2). Proof. According to Lemma 32 and Lemma 33 we have (cid:12)(cid:12) C Γ i +1 (cid:12)(cid:12) ≤ |C Γ i | + | Min(Ξ i ) | . Furtherobserve that Γ is the disjoint union of the Min(Ξ j ) for j ∈ [0 .. d ]. Since |C Γ | = 1, we obtainfor all i ∈ [0 .. d ] that (cid:12)(cid:12) C Γ i +1 (cid:12)(cid:12) ≤ |C Γ i | + | Min(Ξ i ) | ≤ X ≤ j ≤ i | Min(Ξ j ) | ≤ | Π | + 1 . (1)Again by Lemma 32 and Lemma 33 we have | Γ i +1 | ≤ (cid:12)(cid:12) Γ ′ i (cid:12)(cid:12) + (cid:12)(cid:12) C Γ ′ i (cid:12)(cid:12) · ( ⌈ log( | Min(Ξ i ) | ) ⌉ + 1) (by Lemma 33) ≤ | Γ i | + | Min(Ξ i ) | + ( |C Γ i | + | Min(Ξ i ) | ) · ( ⌈ log( | Min(Ξ i ) | ) ⌉ + 1) (by Lemma 32) ≤ | Γ i | + | Min(Ξ i ) | + ( | Π | + 1) · ( ⌈ log( | Π | ) ⌉ + 1) . (by (1))Since | Γ | = ⌈ log( | Min(Ξ ) | ) ⌉ + 1, we obtain by induction that | Γ i | ≤ | Γ | + X ≤ j ≤ i − | Min(Ξ j ) | + i · ( | Π | + 1) · (log( | Π | ) + 2) ≤ ( ⌈ log( | Π | ) ⌉ + 1) + | Π | + i · ( | Π | + 1) · (log( | Π | ) + 2) ≤ ( i + 1) · ( | Π | + 1) · (log( | Π | ) + 2)for all i ∈ [1 .. d + 1]. The last inequality is due to the fact that | Π | + 1 ≥ | Π | )+ 2 ≥ d + 1 ≤ | Π | , we obtain | Γ i | ≤ ( | Π | + 1) · (log( | Π | ) + 2).Let D ∈ N and assume that depth(Π) ≤ D . By Lemma 32, Lemma 33 and Lemma 34each iteration of the three steps above can be done in TC . Notice here that the constructionof the markings e M i and ˜Λ P during UpdateMarkings can be done in parallel – so it is in TC , although Lemma 34 is stated only for a single marking. Now, the crucial observationis that, due to Claim 35, the input size for each iteration is polynomial in the original inputsize of (Π , δ Π ). Therefore, we can compose the individual iterations and obtain a circuit ofpolynomial size and depth bounded by O ( D ) as described in Lemma 5. Thus, we have describeda LinDepParaTC circuit (parametrized by depth(Π)) for the problem of computing a reducedform for (Π , δ Π ). This completes the proof of Theorem 30.22 emark . (1) While Theorem 30 is only stated for one input marking, the constructionworks within the same complexity bounds for any number of markings on (Π , δ Π ) sinceduring UpdateMarkings these all can be updated in parallel.(2) Moreover, note that for every maximal chain C ∈ C Γ there exists a node Q ∈ Π (i.e., inthe original power circuit) such that ε ( Q ) = ε (start( C )). This is because new chains areonly created during UpdateNodes , the other steps only extend already existing chains.(3) Further observe that | σ ( e M ) | ≤ | σ ( M ) | . Looking at the construction of e M we see that wefirst make sure that M does not mark two nodes of the same value, then we make themarking compact. Both operations do not increase the number of nodes in the support ofthe marking.For comparing two markings L and M on an arbitrary power circuit, we can proceed asfollows: first compute the difference (Lemma 28), then reduce the power circuit (Theorem 30)and, finally, compare the resulting compact marking with zero (Proposition 26).This shows: Corollary 37. Let △ ∈ { = , = , <, ≤ , >, ≥} . The following is in LinDepParaTC parametrizedby depth(Π) : Input: A power circuit (Π , δ Π ) together with markings L, M on Π . Question: Is ε ( L ) △ ε ( M ) ?Proof of Proposition A. When assuming depth(Π) ≤ C · log | Π | , by Lemma 4, we obtain Propo-sition A as an immediate consequence of Corollary 37. In the following, we want to represent a number r ∈ Z [1 / 2] using markings in a power circuit.For this, we use a floating point representation. Observe that for each such r ∈ Z [1 / \ { } there exist unique u, e ∈ Z with u odd such that r = u · e . Lemma 38. The following problem is in LinDepParaTC parametrized by depth(Π) : Input: A power circuit (Π , δ Π ) with a marking M on Π . Output: A power circuit ( ˜Π , δ ˜Π ) with markings E, U on ˜Π such that ε ( M ) = ε ( U ) · ε ( E ) with ε ( U ) odd.In addition, (Π , δ Π ) ≤ ( ˜Π , δ ˜Π ) , depth( ˜Π) ≤ max(depth(Π) , and | ˜Π | ∈ O ( | Π | ) .Proof. First note that we are searching for a marking representing the maximal e ∈ Z with2 e | ε ( M ). For finding e , we need the compact representation of M . Therefore, we construct thereduced form (Γ , δ ) of Π and a compact marking e M on Γ such that ε ( e M ) = ε ( M ). Accordingto Theorem 30 this is possible in LinDepParaTC . Now we have ε ( M ) = P ki =1 e M ( P i ) · ε (Λ Pi ) for σ ( e M ) = { P , . . . , P k } ⊆ Γ with ε ( P i ) < ε ( P j ) for i < j . Hence, e = ε (Λ P ).Before we can define the markings U and E , we have to introduce some new nodes. Firstwe add ⌊ log( | Γ | ) ⌋ new nodes to Π each of value 1 (i.e., with empty successor marking). Thenfor each j ∈ [0 .. ⌊ log( | Γ | ) ⌋ ] we create a node of value 2 j and depth 1 in the following way: thesuccessor marking of such a node marks exactly j nodes of value 1 with +1 and all the othernodes with 0. 23n order to define U , we aim for adding a node R i to Π with ε (Λ R i ) = ε (Λ P i ) − e for each i ∈ [1 .. k ]. We proceed as follows: For each i ∈ [1 .. k ], let C i ∈ C Γ denote the maximal chainto which P i belongs. Note that for different i these chains could be equal. By Remark 36, weknow that there exist nodes Q , . . . , Q k ∈ Π such that ε ( Q i ) = ε (start( C i )) for i ∈ [1 .. k ]. Tofind the nodes Q i , we can for example remember the equivalence classes we obtain during thereduction process. Now there exist m i ∈ N with m i ∈ [0 .. | Γ | ] such that ε (Λ P i ) = ε (Λ Q i ) + m i .We can find m i as the difference of the indices of P i and start( C i ) in the sorted order of Γ,and so we can find all the m i in AC . Note that the binary representation of m i uses at most ⌊ log( | Γ | ) ⌋ + 1 bits. Now we are ready to define the marking E : we first define a marking M on the newly defined nodes of depth 1 using the binary representation of m such that ε ( M ) = m . Then we obtain E = Λ Q + M .We now want to define a marking U , with ε ( U ) = ε ( M ) · − ε ( E ) . For every i ∈ [1 .. k ] wecreate a node R i with Λ R i = Λ Q i + M i − E , so in particular, ε ( R i ) = ε ( P i ) · − ε ( E ) (notice that ε ( R ) = 1). Because E and M i could have supports with non-trivial intersection (as well as E and Λ Q i ), we have to clone the nodes in σ ( E ) for the addition. Then the marking U with U ( R i ) = e M ( P i ) for i ∈ [1 .. k ] is the marking U we searched for.Regarding the size of ˜Π, observe that to define the markings M i , we insert 2 · ⌊ log( | Γ | ) ⌋ + 1nodes. By cloning the nodes in σ ( E ), we add at most ⌊ log( | Γ | ) ⌋ + 1 + | Π | additional nodes.By Remark 36 (3), we know that | σ ( e M ) | ≤ | σ ( M ) | ≤ | Π | , so we insert at most | Π | nodeswhen inserting the nodes R i . According to Claim 35, we have log( | Γ | ) ∈ O (log( | Π | )). Hence, | ˜Π | ∈ O ( | Π | ).Considering the depth, when inserting the new nodes of depth 1, the depth only increases ifdepth(Π) = 0. When inserting a node R i the depth increases only if depth(Π) ≤ Definition . A power circuit representation of r ∈ Z [1 / 2] consists of a power circuit (Π , δ Π )together with a pair of markings ( U, E ) on Π such that ε ( U ) is either zero or odd and r = ε ( U ) · ε ( E ) . Lemma 40. (a) The following problems are in TC : Input: A power circuit representation for r ∈ Z [1 / over a power circuit (Π , δ Π ) anda marking M on Π . Output: A power circuit representation of r · ε ( M ) over a power circuit ( ˜Π , δ ˜Π ) . Input: A power circuit representation for r ∈ Z [1 / over a power circuit (Π , δ Π ) . Output: A power circuit representation of − r over (Π , δ Π ) . Input: Power circuit representations for r, s ∈ Z [1 / over a power circuit (Π , δ Π ) such that rs is a power of two. Output: A marking L in a power circuit ( ˜Π , δ ˜Π ) such that ε ( L ) = log( rs ) .(b) The following problems are in LinDepParaTC parametrized by depth(Π) : Input: A power circuit (Π , δ Π ) and a marking M on Π . Output: A power circuit representation of ε ( M ) ∈ Z [1 / over a power circuit ( ˜Π , δ ˜Π ) . Input: r, s ∈ Z [1 / given as power circuit representations over a power circuit (Π , δ Π ) . Output: A power circuit representation of r + s over a power circuit ( ˜Π , δ ˜Π ) . nput: A power circuit representation for r ∈ Z [1 / over a power circuit (Π , δ Π ) Question: Is r △ for △ ∈ { = , = , <, ≤ , >, ≥} ? Input: A power circuit representation for r ∈ Z [1 / over a power circuit (Π , δ Π ) . Output: Is r ∈ Z ? If yes, a marking M in a power circuit ( ˜Π , δ ˜Π ) such that ε ( M ) = r .In all cases we have (Π , δ Π ) ≤ ( ˜Π , δ ˜Π ) , | ˜Π | ∈ O ( | Π | ) , and depth( ˜Π) = depth(Π) + O (1) .Proof. During the whole proof, let U, V, E, F be markings in Π such that ε ( U ), ε ( V ) are odd, r = ε ( U ) · ε ( E ) and s = ε ( V ) · ε ( F ) . Part (a): We have r · ε ( M ) = ε ( U ) · ε ( E )+ ε ( M ) . According to Lemma 28 point (a), themarking E + M can be obtained in TC as marking in a power circuit ( ˜Π , δ ˜Π ) that satisfies allthe required properties. The computation of − r is clear by Lemma 28.If rs is a power of two, we know that ε ( U ) = ε ( V ), and so rs = 2 ε ( E ) − ε ( F ) . Now againLemma 28 finishes the proof of part (a). Part (b): The first point is due to Lemma 38. For the addition, first observe that r + s = ε ( U ) · ε ( E ) + ε ( V ) · ε ( F ) = 2 ε ( E ) · ( ε ( U ) + ε ( V ) · ε ( F ) − ε ( E ) )We can decide in LinDepParaTC whether ε ( E ) ≤ ε ( F ) using Corollary 37. W. l. o. g. let ε ( E ) ≤ ε ( F ) (otherwise we switch the roles of r and s ). Next, we construct a marking K in apower circuit (Π ′ , δ Π ′ ) such that ε ( K ) = ε ( U ) + ε ( V ) · ε ( F ) − ε ( E ) . According to Lemma 28 andbecause ε ( F ) − ε ( E ) ≥ 0, this is possible in TC and such that | Π ′ | ∈ O ( | Π | ) and depth(Π ′ ) ≤ depth(Π) + 1. Now, according to Lemma 38 we can construct markings W and G in a powercircuit (Π ′′ , δ Π ′′ ) such that ε ( W ) is odd and ε ( K ) = ε ( W ) · ε ( G ) in LinDepParaTC . In addition, | Π ′′ | ∈ O ( | Π ′ | ) and depth(Π ′′ ) ≤ max(depth(Π ′ ) , E + G can be obtained as marking in a power circuit ( ˜Π , δ ˜Π ) with | ˜Π | ∈ O ( | Π | ) and depth( ˜Π) =depth(Π) + O (1). Then the power circuit ( ˜Π , δ ˜Π ) together with the markings W and E + G isthe power circuit representation for r + s , satisfying the required properties.To decide if r △ 0, we just have to check if ε ( U ) △ 0. According to Corollary 37 this ispossible in LinDepParaTC . To decide if r ∈ Z , since ε ( U ) is odd, we just need to decide if ε ( E ) ≥ 0. Again, this can be done using Corollary 37. In the affirmative case, we just have toapply Lemma 28 point (c) to produce the desired output. Before we start solving the word problem of the Baumslag group, let us fix our notation fromgroup theory. Group presentations. A group G is finitely generated if there is some finite set Σ and asurjective monoid homomorphism η : Σ ∗ → G (called a presentation). Usually, we do notwrite the homomorphism η and treat words over Σ both as words and as their images under η . We write v = G w with the meaning that η ( v ) = η ( w ). If Σ = S ∪ S − where S − is somedisjoint set of formal inverses and R ⊆ Σ ∗ × Σ ∗ is some set of relations, we write h Σ | R i for25he group Σ ∗ /C ( R ) where C ( R ) is the congruence generated by R together with the relations aa − = a − a = 1 for a ∈ Σ. If R is finite, G is called finitely presented .The word problem for a fixed group G with presentation η : Σ ∗ → G is as follows: Input: A word w ∈ Σ ∗ Question: Is w = G The Baumslag-Solitar group. The Baumslag-Solitar group is defined by BS , = (cid:10) a, t | tat − = a (cid:11) . We have BS , ∼ = Z [1 / ⋊ Z via the isomorphism a (1 , 0) and t (0 , Z [1 / 2] = { p/ q ∈ Q | p, q ∈ Z } is the set of dyadic fractions with addition as group operation.The multiplication in Z [1 / ⋊ Z is defined by ( r, m ) · ( s, n ) = ( r + 2 m s, m + n ). Inverses canbe computed by the formula ( r, m ) − = ( − r · − m , − m ). In the following we use BS , and Z [1 / ⋊ Z as synonyms. The Baumslag group. A convenient way to understand the Baumslag group G , is as anHNN extension of the Baumslag-Solitar group: G , = (cid:10) BS , , b | bab − = t (cid:11) = (cid:10) a, t, b | tat − = a , bab − = t (cid:11) . Indeed, due to bab − = t , we can remove t and we obtain exactly the presentation (cid:10) a, b | bab − a = a bab − (cid:11) .Moreover, BS , is a subgroup of G , via the canonical embedding. Henceforth, we will usethe alphabet Σ = { , a, a − , t, t − , b, b − } to represent elements of G , (the letter 1 representsthe group identity; it is there for padding reasons). Britton reductions. Britton reductions are a standard way to solve the word problem in HNNextensions. Here we define them for the special case of G , . Let∆ = BS , ∪ (cid:8) b, b − (cid:9) be an infinite alphabet (note that Σ ⊆ ∆). A word w ∈ ∆ ∗ is called Britton-reduced if it is ofthe form w = ( s , n ) β ( s , n ) · · · β ℓ ( s ℓ , n ℓ )with β i ∈ (cid:8) b, b − (cid:9) and ( s i , n i ) ∈ BS , for all i (i.e., w does not have two successive lettersfrom BS , ) and there is no factor of the form b ( q, b − or b − (0 , k ) b with q, k ∈ Z . If w isnot Britton reduced, one can apply one of the rules( r, m )( s, n ) → ( r + 2 m s, m + n ) b ( q, b − → (0 , q ) b − (0 , k ) b → ( k, Named after Graham Higman, Bernhard H. Neumann and Hanna Neumann. For a precise definition, we referto [25]. This is also the way how the Magnus breakdown procedure works. emma 41 (Britton’s Lemma for G , [6]) . Let w ∈ ∆ ∗ be Britton-reduced. Then w ∈ BS , asa group element if and only if w does not contain any letter b or b − . In particular, w = G , if and only if w = (0 , or w = 1 as a word.Example . Define words w = t and w n +1 = b w n a w − n b − for n ≥ 0. Then we have | w n | = 2 n +2 − w n = G , t τ ( n ) . While the length of the word w n is only exponential in n ,the length of its Britton-reduced form in t ∗ is τ ( n ). The idea to obtain a parallel algorithm for the word problem is to compute a Britton reductionof uv given that both u and v are Britton reduced. For this, we have to find a maximal suffix of u which cancels with a prefix of v . The following lemma is our main tool for finding the longestcanceling suffix. It is important to note that for all suffixes the conditions can be checked inparallel. Lemma 43. Let w = β ( r, m ) β x β − ( s, n ) β − ∈ ∆ ∗ such that β ( r, m ) β and β − ( s, n ) β − both are Britton-reduced and β xβ − = G , ( q, k ) ∈ BS , (in particular, either k = 0 and q ∈ Z or q = 0 ).Then w ∈ BS , if and only if the respective condition in the following table is satisfied.Moreover, if w ∈ BS , , then w = G , ˆ w according to the last column of the table. β β Condition ˆ wb b r + 2 m + k s ∈ Z , m + n + k = 0 (0 , r + 2 − n s ) b b − r + 2 m ( q + s ) ∈ Z , m + n = 0 (0 , r + 2 m ( q + s )) b − b r + 2 m + k s = 0 (cid:0) n + log( − rs ) , (cid:1) b − b − r + 2 m ( q + s ) = 0 ( m + n, Notice that in the case β = b − and β = b , we have r = 0 and s = 0 .Example . Let us illustrate with two examples how to read Lemma 43. For this, let w = β ( r , m ) β x β − ( s , n ) β − ∈ ∆ ∗ with the same properties as in Lemma 43, in particular, β x β − = G , ( q, k ) ∈ BS , .We first consider the case that β = β = b . To check if w ∈ BS , we have to check if m + n + k = 0 and if r + 2 m + k · s ∈ Z according to Lemma 43. In order to obtain a formulafor k , we apply Lemma 43 to β x β − using the rightmost column. We write( q, k ) = G , β x β − = β ( r , m ) β x ′ β − ( s , n ) β − . (2)For our example let us assume that β = b . Then according to Lemma 43, ( q, k ) = (0 , r +2 − n · s ). Hence, w ∈ BS , if and only if m + n +( r +2 − n · s ) = 0 and r +2 m + r +2 − n · s · s ∈ Z .If both conditions are satisfied, we know that w = G , (0 , r + 2 − n s ).Now let us consider a more difficult case. Assume that β = b − and β = b . According toLemma 43, w ∈ BS , if and only if r + 2 m + k s = 0. To obtain a formula for k , we applyagain Lemma 43 using the rightmost column. We again write ( q, k ) = G , β x β − as in (2),but here we assume that β = b − . As we assumed β = b , we have by the last column inLemma 43 that( q, k ) = G , β x β − = β ( r , m ) β x ′ β − ( s , n ) β − = G , (0 , r + 2 m ( q ′ + s ))27f β x ′ β − = G , ( q ′ , k ′ ) ∈ BS , . This means that k = r + 2 m ( q ′ + s ). Now we have to finda formula for q ′ . We write( q ′ , k ′ ) = G , β x ′ β − = β ( r , m ) β x ′′ β − ( s , n ) β − . We assume β = b . Then according to Lemma 43 we obtain that q ′ = n + log (cid:16) − r s (cid:17) . Thisimplies that k = r + 2 m · ( n + log( − r s ) + s ). So, to check whether w ∈ BS , , we have tocheck if r + 2 m + r +2 m · ( n +log( − r s )+ s ) · s = 0 . If this is the case, then w = G , (cid:16) n + log (cid:16) − r s (cid:17) , (cid:17) . Proof of Lemma 43. We distinguish the two cases β = b and β = b − . Each case consists oftwo sub-cases depending on β . Case β = b : Since β xβ − ∈ BS , , we have β xβ − = G , (0 , k ) for some k ∈ Z . Therefore,we obtain ( r, m ) β x β − ( s, n ) = G , ( r, m )(0 , k )( s, n )= G , ( r, m + k )( s, n )= G , ( r + 2 m + k s, m + k + n ) . Thus, if β = b , we have w ∈ BS , if and only if r + 2 m + k s ∈ Z and m + n + k = 0. Moreover, ifthe latter conditions are satisfied, we have w = G , b ( r +2 m + k s, b − = b ( r +2 − n s, b − = G , (0 , r + 2 − n s ).On the other hand, if β = b − , it follows that w ∈ BS , if and only if r + 2 m + k s = 0.Notice that in this case, by assumption, we have r = 0 and s = 0. Therefore, if the condition r + 2 m + k s = 0 is satisfied, we have k = log( − r m s ). Hence, under this condition, we have w = G , b − (0 , m + k + n ) b = b − (0 , m + log( − r m s ) + n ) b = G , ( n + log( − rs ) , 0) (becauselog( − r m s ) = log( − rs ) − m ). Case β = b − : In this case, we do a similar computation:( r, m ) β x β − ( s, n ) = G , ( r, m )( q, s, n )= G , ( r, m )( q + s, n )= G , ( r + 2 m ( q + s ) , m + n )with q ∈ Z . Again, let us consider the case β = b first. In this case we have w ∈ BS , if and only if r + 2 m ( q + s ) ∈ Z and m + n = 0. If these conditions are satisfied, we have w = G , b ( r + 2 m ( q + s ) , b − = G , (0 , r + 2 m ( q + s )).Finally, if β = b − , it follows that w ∈ BS , if and only if r + 2 m ( q + s ) = 0. If this applies,we have w = G , b − ( r + 2 m ( q + s ) , m + n ) b = G , ( m + n, v, w ∈ G , written as words over ∆: u = ( r h , m h ) β h · · · ( r , m ) β ( r , m ) , v = ( s , n ) ˜ β ( s , n ) · · · ˜ β ℓ ( s ℓ , n ℓ ) (3)28ith ( r j , m j ) , ( s j , n j ) ∈ Z [1 / ⋊ Z and β j , ˜ β j ∈ (cid:8) b, b − (cid:9) . We define uv [ i, j ] = β i ( r i − , m i − ) · · · β ( r , m ) ( s , n ) ˜ β · · · ( s j − , n j − ) ˜ β j . Notice that as an immediate consequence of Britton’s Lemma we obtain that, if u and v as in(3) are Britton reduced and uv [ i, i ] ∈ BS , for some i , then also uv [ j, j ] ∈ BS , for all j ≤ i .Moreover, uv is Britton-reduced if and only if β ( r , m )( s , n ) ˜ β BS , .For ℓ ∈ N let X ℓ denote some set of ℓ variables. Denote by PowExp( X ℓ ) the set of expressionswhich can be made up from the variables X ℓ using the operations +, − , ( r, s ) r · s if s ∈ Z (and undefined otherwise), and ( r, s ) log( r/s ) if log( r/s ) ∈ Z (and undefined otherwise). Lemma 45. For every ~β ∈ { b, b − , ⊥} there are expressions θ ~β , ξ ~β , ϕ ~β , ψ ~β ∈ PowExp( X ) such that the following holds: Let u, v ∈ G , as in (3) be Britton reduced and assume that uv [ i − , i − ∈ BS , and β i = ˜ β − i and let V i = { r j , s j , m j , n j | j ∈ { i − , i − , i − }} . If ~β = ( β i , β i − , β i − , β i − ) (where β j = ⊥ for j ≤ ), then1. uv [ i, i ] ∈ BS , if and only if θ ~β ( V i ) ∈ Z and ξ ~β ( V i ) = 0 ,2. if uv [ i, i ] ∈ BS , , then uv [ i, i ] = G , (cid:0) ϕ ~β ( V i ) , ψ ~β ( V i ) (cid:1) . Be aware that here we have to read the set V i of cardinality (at most) 12 as assignment tothe variables X . In particular, given that uv [ i − , i − ∈ BS , , one can decide whether uv [ i, i ] ∈ BS , by looking at only constantly many letters of uv . Proof. W. l. o. g. i ≥ 4. We follow the approach of Example 44. By assumption we knowthat there exist q, k ∈ Z such that uv [ i − , i − 1] = G , ( q, k ) ∈ BS , . According to theconditions in Lemma 43, to show Lemma 45 it suffices to find expressions ϕ ~β ( V i ), ψ ~β ( V i ) for q and k respectively. If ( β i − , β i − ) = ( b, b − ), this follows directly from the rightmost column inLemma 43. Otherwise, we know that ( β i − , β i − ) = ( b, b − ) and so we obtain the expressionsfor q and k by applying Lemma 43 to uv [ i − , i − 2] (note that uv [ i − , i − ∈ BS , because uv [ i − , i − ∈ BS , ). This proves the lemma. A power circuit representation of u ∈ G , written as in (3) consists of the sequence B =( β h , . . . , β ) and a power circuit (Π , δ Π ) with markings U i , E i , M i for i ∈ [0 .. h ] such that( U i , E i ) is a power circuit representation of r i (see Definition 39) and m i = ε ( M i ). Lemma 46. The following problem is in LinDepParaTC parametrized by max i depth(Π i ) : Input: Britton-reduced power circuit representations of u, v ∈ G , over power cir-cuits Π , Π . Output: A Britton-reduced power circuit representation of w ∈ G , over a powercircuit Π ′ such that w = G , uv and depth(Π ′ ) = max i depth(Π i ) + O (1) and | Π ′ | ∈ O ( | Π | + | Π | ) .Proof. Let Π be the disjoint union of Π and Π . We need to find the maximal i such that uv [ i, i ] ∈ BS , . This can be done as follows: By Lemma 40 one can evaluate the expres-sions θ ~β ( V i ) and ξ ~β ( V i ) of Lemma 45 and test the conditions θ ~β ( V i ) ∈ Z and ξ ~β ( V i ) = 0 in29 inDepParaTC . For every i this can be done independently in parallel giving us Boolean valuesindicating whether uv [ i − , i − ∈ BS , implies uv [ i, i ] ∈ BS , . Now, we have to find onlythe maximal i such that for all j ≤ i this implication is true. Since uv [0 , 0] = 1 ∈ BS , ,it follows inductively that uv [ i, i ] ∈ BS , for all i ≤ i . Moreover, as the implication uv [ i , i ] ∈ BS , = ⇒ uv [ i + 1 , i + 1] ∈ BS , fails, we have uv [ j, j ] / ∈ BS , for j ≥ i + 1.Now, using the expressions ϕ ~β , ψ ~β from Lemma 45 one can compute again using Lemma 40( q, k ) = ( ϕ ~β ( V i ) , ψ ~β ( V i )) = G , uv [ i , i ] in LinDepParaTC . Again using Lemma 40, we cancompute in LinDepParaTC ( s, m ) = ( r i , m i )( q, k )( s i , n i ) as a power circuit representationover a power circuit (Π ′ , δ Π ′ ) with (Π , δ Π ) ≤ (Π ′ , δ Π ′ ), | Π ′ | ∈ O (Π) and depth(Π ′ ) ∈ depth(Π)+ O (1). Now, the output is( r h , m h ) β h · · · ( r i +1 , m i +1 ) β i +1 ( s, m ) ˜ β i +1 ( s i +1 , n i +1 ) · · · ˜ β ℓ ( s ℓ , n ℓ ) . Before showing Theorem B, we prove the following slightly more general result. Recall thatΣ = { , a, a − , t, t − , b, b − } . Theorem 47. The following problem is in TC : Input: A word w ∈ Σ ∗ . Output: A power circuit representation for a Britton-reduced word w red ∈ ∆ ∗ such that w = G , w red and the underlying power circuit has depth O (log | w | ) .Proof. Let w = w . . . w n with w j ∈ Σ be some input. Since we can pad with the letter 1,we can assume n = 2 m for m ∈ N . The idea for the proof is simple: First, we transformeach letter w j into a power circuit representation. After that, the first layer computes theBritton reduction of two-letter words using Lemma 46, the next layer takes always two ofthese Britton-reduced words and joins them to a new Britton-reduced word and so on. After m = log n layers we have obtained a single Britton-reduced word. By the bound in Lemma 46,the size of the resulting power circuits stays polynomial in n and their depth in O (log n ). Inparticular, each application of Lemma 46 is in TC and, hence, the whole computation is in TC .Let us detail this high-level description a bit further: For j ∈ [1 .. n ] we set w j = w (1) j . Nowfor each word w (1) j we construct its power circuit representation as follows: Let (Π (1) j , δ (1) j ) bea power circuit such that | Π (1) j | = 1 for j ∈ [1 .. n ]. The we define markings U i , E i and M i asfollows: If w (1) j = a α for α ∈ { − , } then ε ( U i ) = α and ε ( E i ) = ε ( M i ) = 0. If w (1) j = t α , then ε ( U i ) = ε ( E i ) = 0 and ε ( M i ) = α . If w (1) j = β , then all markings evaluate to 0 and we set B (1) j = ( β ) (in all other cases we define B (1) j to be the empty sequence). If w (1) j = 1, then allmarkings evaluate to 0 and B (1) j is the empty sequence.Now let k ∈ [2 .. m + 1] and j ∈ [1 .. n k − ] and assume that the words w ( k − j − and w ( k − j areBritton-reduced with power circuit representations over (Π ( k − j − , δ ( k − j − ) and (Π ( k − j , δ ( k − j ),respectively. By Lemma 46 we can construct a power circuit representation for a Britton-reduced word w ( k ) j over a power circuit (Π ( k ) j , δ ( k ) j ) such that w ( k ) j = G , w ( k − j − w ( k − j and | Π ( k ) j | ≤ c s · (cid:16) | Π ( k − j − | + | Π ( k − j | (cid:17) anddepth(Π ( k ) j ) ≤ c d + max(depth(Π ( k − j − ) , depth(Π ( k − j ))30or constants c s and c d . In order to bound the size and depth of these power circuits inductively,define Π ( k ) to be the disjoint union of the Π ( k ) j for j ∈ [1 .. n k − ]. It follows that | Π ( k ) | ≤ c s · | Π ( k − | and depth(Π ( k ) ) ≤ depth(Π ( k − ) + c d . Let ν ∈ N with c s ≤ ν . With (cid:12)(cid:12) Π (1) (cid:12)(cid:12) = n and depth(Π (1) ) = 1 we obtain thatdepth(Π ( k ) ) ≤ depth(Π (1) ) + ( k − · c d ≤ m · c d = 1 + log( n ) · c d , (4) | Π ( k ) | ≤ c k − s · | Π (1) | ≤ c ms · n ≤ (2 ν ) log( n ) · n = n ν +1 . Therefore, the size of each Π ( k ) is polynomial in the input size n and its depth is logarithmicin n . In particular, the same applies to the power circuits Π ( k ) j . Therefore, by Lemma 4,Lemma 46 yields a TC circuit for computing w ( k ) j from w ( k − j − and w ( k − j . For each k , all thepower circuit representations of the w ( k ) j for j ∈ [1 .. n k − ] can be computed in parallel withthe bound on the depth given by (4). Since we have O (log n ) of these stages, the over allcomplexity is TC . Proof of Theorem B. In order to decide whether w = G , 1, we first compute its Britton re-duction ˆ w using Theorem 47. If ˆ w still contains some b or b − , by Britton’s Lemma, we knowthat w = G , 1. Otherwise, ˆ w = ( r, m ) ∈ Z [1 / ⋊ Z where r, m are given as there power circuitrepresentations over a power circuit Π of depth O (log | w | ). According to Lemma 40, we cancheck in TC whether r = m = 0. Finally, we prove some hardness results on comparison in power circuits. In particular, theyimply that Theorem 30 is optimal in a certain sense. Proposition 48. The following problem is NL -hard: Input: Given a power circuit and Markings M, K . Question: Is ε ( M ) = ε ( K ) ?Proof. Reduce the s - t -connectivity problem for dags to this problem. Given a dag G = ( V, E )and vertices s, t ∈ V make two copies of this graph and add a label +1 to every edge. In onecopy of G add an additional node P and an edge ( t, P ). Let s , s denote the two copies of s .Then ε ( s ) = ε ( s ) if and only if there is no path from s to t in G . Theorem 49. The following problem is P -complete: Input: A power circuit (Π , δ Π ) and nodes R, S ∈ Π such that every marking Λ P iscompact for P ∈ Π and ε ( P ) = ε ( Q ) for all P = Q . Question: Is ε ( R ) ≤ ε ( S ) ? Notice that the only feature the power circuit in Theorem 49 lacks for being reduced is thesorting of the nodes. In particular, under the assumption NC = P , it is not possible to sort thenodes of a given power circuit in NC . 31 emark . (a) It is an immediate consequence of Theorem 49 that the comparison problemof two markings in a power circuit is P -complete. This is because for two nodes R and S in a power circuit (Π , δ Π ) we have ε ( R ) ≤ ε ( S ) if and only if ε (Λ R ) ≤ ε (Λ S ).(b) If the input is given as in Theorem 49, we can check in AC whether ε ( R ) = ε ( S ) becausethis is the case if and only if Λ R ( P ) = Λ S ( P ) for all P ∈ Γ (see Lemma 19). This can beviewed as a hint that also in an arbitrary power circuit testing for equality might be easierthan comparing for less than. Corollary 51. The following problem is P -complete: Input: A dag Γ such that each node has a successor marking. Question: Is Γ already a power circuit?Proof. The comparison problem for power circuits (Theorem 49) can be reduced to this problemin a straightforward way: As input we have a power circuit (Π , δ Π ) with two nodes P, Q ∈ Π.Then we construct a dag as follows: We take (Π , δ Π ) and add a node R with δ ( R, P ) = 1 and δ ( R, Q ) = − 1. Then ε (Λ R ) ≥ ε ( P ) ≥ ε ( Q ), and so the newly defined dag is apower circuit if and only if ε ( P ) ≥ ε ( Q ). Corollary 52. The following problem is P -complete: Input: A power circuit representation of w ∈ G , . Question: Is w ∈ BS , ?Proof. We reduce from the comparison problem for power circuits (Theorem 49). So let(Π , δ Π ) be a power circuit and let M be a marking on Π. Now we consider the word w = b (2 ε ( M ) , b − ∈ ∆ ∗ . Then (Π , δ Π ) together with the marking M is a power circuit representa-tion of w . For w to be in BS , we need the b ’s to cancel. This happens if and only if ε ( M ) ≥ w ∈ BS , if and only if ε ( M ) ≥ Proof of Theorem 49. By [30, Proposition 49], we only need to show the hardness part. Wewant to reduce from the Circuit Value Problem which is well-known to be P -complete,see e.g. [37, Thm. 10.44]. It is defined as follows: We consider a directed acyclic graph thatonly consists of the following types of nodes (now called gates ): input gates (only nodes withno incoming edges) each labelled by 0 or 1, Not gates (only nodes with exactly one incomingedge), Or gates (only nodes with two incoming edges) and exactly one output gate (a nodewith exactly one incoming edge and no outgoing edges). We assume that all circuits are layeredand assign a level to every gate. Input gates have level 0, and gates on level k may only receiveinputs from gates on level k − 1. We can further assume that every gate has a unique numberbetween 1 and L with L being the size of the circuit. Given such a circuit, every gate g evaluates to a truth value in a natural way, which we denote by eval( g ) ∈ { , } ; in particular,the task is to compute eval( output ).W. l. o. g. we assume L ≥ 6, then the following inequalities hold for all k ≥ τ ( L − > L + 2 ,τ ( k + L − / L < τ ( k + L − − ,τ ( k + L − 1) + 2 L < τ ( k + L ) − . (5)32 g i P u P v P g i X i + ++ ++ Figure 1: Power circuit for Or gates. P u P g i R k S k X i ++ − + Figure 2: Power circuit for Not gates. The construction of (Γ , δ ) : Starting with some Boolean circuit, we design a power circuit(Γ , δ ) such that, for every gate g on level k (except the output gate), there is some node P g such that τ ( L − < ε (Λ P g ) ≤ τ (2 k + L + 1) − ,ε (Λ P g ) ≤ τ (2 k + L ) − g ) = 0 ,ε (Λ P g ) ≥ τ (2 k + L ) if eval( g ) = 1 . (6)In addition, for two gates u and v we have that ε (Λ P u ) = ε (Λ P v ) if and only if u = v andeach node in Γ has a compact successor marking. In the power circuit, the edges point to the“opposite direction” as in the Boolean circuit we start with. Let D be the depth of the circuit,i.e., the output gate has level D . We create the following nodes and edges: • We first create nodes X , . . . , X L − such that ε (Λ X i ) = i and Λ X i is a compact marking. • We create nodes T , . . . , T D + L such that T = X and δ ( T i , T i − ) = 1 for i ∈ [1 .. D + L ]and δ ( T i , Q ) = 0 otherwise. Then ε ( T i ) = τ ( i ). If there exists j such that τ ( j ) = 2 i , thenwe set T j = X i . • As an abbreviation, we will denote a node T k + L by R k for k ∈ [1 .. D ]. Note that then ε (Λ R k ) = τ (2 k + L − • For every k ∈ [1 .. D − 1] we create a node S k with δ ( S k , R k − ) = 1 and δ ( S k , X ) = − ε (Λ S k ) = τ (2 k + L − − 1. Note that Λ S k is a compact marking and ε (Λ S k ) > τ ( L − L . • For every input gate g i with eval( g i ) = 0 we create a node P g i with δ ( P g i , T L − ) = δ ( P g i , X i ) = 1, and δ ( P g i , Q ) = 0 otherwise. For every input gate g j with eval( g j ) = 1we create a node P g j with δ ( P g j , T L ) = δ ( P g j , X j ) = 1 and δ ( P g j , Q ) = 0 otherwise. • For every Or gate g i with incoming edges from gates u and v , we create nodes P g i , Q g i ∈ Γand set δ ( P g i , Q g i ) = δ ( Q g i , P u ) = δ ( Q g i , P v ) = 1. In addition, we set δ ( Q g i , X i ) = δ ( P g i , X i ) = 1. • For every Not gate g i on level k with incoming edge from gate u , we create a node P g i ∈ Γ and set δ ( P g i , R k ) = δ ( P g i , S k ) = 1, and δ ( P g , P u ) = − 1. In addition, we set δ ( P g i , X i ) = 1. • For the output gate output on level D with incoming edge from gate u , we create a node P output ∈ Γ and set δ ( P output , P u ) = 1. 33ow, if we believe Eq. (6), we have ε ( P output ) ≥ ε ( R D ) = τ (2 D + L ) if and only if eval( output ) =1. Moreover, all nodes evaluate to numbers in 2 N .It is straightforward to see that this construction can be computed in LOGSPACE : The depthcan be computed by just following an arbitrary path from some input gate to the output gate.The construction of the nodes T k , S k can be done by increasing some counter and in every stepoutputting some new nodes. To define the nodes X i we proceed similarly to the constructionof Γ during the reduction process (see Section 4.2). Observe that if τ ( i ) ≤ L it is clear thatwe can check in LOGSPACE if ε ( T i ) = ε ( X j ) for some j ∈ [ L − P g , Q g corresponding to gates of the circuit is also no problem as simply every gatehas to be “replaced” by a constant number of nodes. Correctness proof: Let us show Eq. (6) by induction starting from the input gates. Let g i be an input gate and first assume that eval( g i ) = 0. Then ε (Λ P gi ) = ε ( T L − ) + ε ( X i ) = τ ( L − 1) + 2 i < τ ( L ) − ε (Λ P gi ) > τ ( L − g i ) = 1. Then ε (Λ P gi ) = ε ( T L ) + ε ( X i ) = τ ( L ) + 2 i > τ ( L ) and ε (Λ P gi ) ≤ τ ( L + 1) − . Now, let g i be some Or gate on level k ≥ u and v . Ifeval( u ) = eval( v ) = 0, then we have by induction ε (Λ P u ) , ε (Λ P v ) ≤ τ (2 k + L − − 2; hence, ε (Λ Q gi ) = ε ( P u ) + ε ( P v ) + ε ( X i ) ≤ · τ (2 k + L − / i = τ (2 k + L − / i < τ (2 k + L − − . So, ε (Λ P gi ) = ε ( Q g i ) < τ (2 k + L ) / < τ (2 k + L ) − u ) = 1. Then by induction, ε (Λ P u ) ≥ τ (2 k + L − ε (Λ Q gi ) = ε ( P u ) + ε ( P v ) + ε ( X i ) ≥ τ (2 k + L − . Thus, ε (Λ P gi ) = ε ( Q g i ) ≥ τ (2 k + L ) . Moreover, observe that by induction, ε (Λ P u ) , ε (Λ P v ) ≤ τ (2 k + L − − ε (Λ P u ) , ε (Λ P v ) > τ ( L − ε (Λ P gi ) < τ (2 k + L + 1) − 2. It is clear that ε (Λ P gi ) > τ ( L − g i be some Not gate on level k ≥ u . Note that byinduction, τ ( L − < ε (Λ P u ) ≤ τ (2 k + L − − 2. If eval( u ) = 0, then we have by induction ε (Λ P u ) ≤ τ (2 k + L − − 2. Hence, ε ( S k ) − ε ( P u ) + ε ( X i ) ≥ τ (2 k + L − / − τ (2 k + L − / i > ε (Λ P gi ) = ε ( S k ) − ε ( P u ) + ε ( X i ) + ε ( R k ) > ε ( R k ) = τ (2 k + L ) and ε (Λ P gi ) ≤ τ (2 k + L − / i + τ (2 k + L ) ≤ · τ (2 k + L ) < τ (2 k + L + 1) − . Now assume that eval( u ) = 1. Then by induction, ε (Λ P u ) ≥ τ (2 k + L − ε ( S k ) − ε ( P u ) + ε ( X i ) ≤ τ (2 k + L − / − τ (2 k + L − 1) + 2 i ≤ − ε (Λ P gi ) = ε ( R k ) + ε ( S k ) − ε ( P u ) + ε ( X i ) ≤ τ (2 k + L ) − ε (Λ P gi ) ≥ τ (2 k + L ) + τ (2 k + L − / − τ (2 k + L ) / i ≥ · τ (2 k + L ) > τ ( L − . Let P, Q ∈ Γ. Now we have to show that ε ( P ) = ε ( Q ) if P = Q . First, we set X = { X i , T j | j ∈ [ L + 1] , i ∈ [ L ] } . By construction, this is clear for P, Q ∈ X . We further knowthat ε ( P ) > τ ( L ) for all nodes P ∈ Γ \X and so in particular ε ( P ) = ε ( Q ) for all nodes P ∈ Γ \X and Q ∈ X . For P ∈ Γ \ X we can also follow that τ ( L ) | ε ( P ) and so ε ( P ) ≡ τ ( L )(note that ε ( P ) is a power of two).Now let u i be an arbitrary gate and v j be an arbitrary Or gate. Considering the successormarkings of the nodes P u i and Q v j we obtain the following: ε (Λ P ui ) ≡ i mod τ ( L ) ,ε (Λ Q vj ) ≡ j mod τ ( L ) ,ε (Λ T ℓ ) ≡ τ ( L ) for ℓ ≥ L,ε (Λ S k ) ≡ − τ ( L ) . (7)By the choice of L we know that 2 i α mod τ ( L ) for α ∈ [ − .. 1] for i ∈ [1 .. L ] and 2 i j mod τ ( L ) for i, j ∈ [1 .. L ] and i = j . This show that | ε (Λ P ) − ε (Λ Q ) | ≥ P, Q ∈ Γ \ X with P = Q . Moreover, | ε (Λ P ) − ε (Λ X i ) | ≥ P ∈ Γ \ X and all i ∈ [1 .. L − ε ( P ) = ε ( Q ) if P = Q , and all successor markings are compact. We have seen that the word problem of the Baumslag group can be solved in TC . This result isbased on the fact that all power circuits used during the algorithm have logarithmic depth andthe comparison problem for such power circuits is in TC . On the other hand, the comparisonproblem for arbitrary power circuits is P -complete. We conclude with some open problems: • Is it possible to reduce the complexity of the word problem of the Baumslag group anyfurther – e.g. to find a LOGSPACE algorithm? • Can we prove some non-trivial lower bounds (the word problem is NC -hard as G , contains a non-abelian free group [34])? • The problem of comparing two markings on a power circuit for equality is NL -hard – isit also P -complete like comparison with less than? • Is the word problem of the Baumslag group with power circuit representations as input P -complete? (By Corollary 52 this holds for the subgroup membership problem for BS , in G , . Moreover, as a consequence of Proposition 48, the word problem is NL -hard.)35 eferences [1] Sanjeev Arora and Boaz Barak. Computational Complexity - A Modern Approach . Cam-bridge University Press, 2009.[2] Owen Baker. The conjugacy problem for Higman’s group. Internat. J. Algebra Comput. ,30(6):1211–1235, 2020. doi:10.1142/S0218196720500393 .[3] G. Baumslag, A. G. Myasnikov, and V. Shpilrain. Open problems in combinatorial grouptheory. Second Edition. In Combinatorial and geometric group theory , volume 296 of Contemporary Mathematics , pages 1–38. American Mathematical Society, 2002.[4] Gilbert Baumslag. A non-cyclic one-relator group all of whose finite quotients are cyclic. Journal of the Australian Mathematical Society , 10(3-4):497–498, 1969.[5] W. W. Boone. The Word Problem. Ann. of Math. , 70(2):207–265, 1959.[6] John L. Britton. The word problem. Ann. of Math. , 77:16–32, 1963.[7] Thomas H. Cormen, Charles E. Leiserson, Ronald L. Rivest, and Clifford Stein. Introduc-tion to Algorithms . The MIT Press, 3 edition, 2009.[8] Max Dehn. Ueber unendliche diskontinuierliche Gruppen. Math. Ann. , 71:116–144, 1911.[9] Volker Diekert, J¨urn Laun, and Alexander Ushakov. Efficient algorithms for highly com-pressed data: The word problem in Higman’s group is in P. In Proc. 29th InternationalSymposium on Theoretical Aspects of Computer Science, STACS 2012, Paris, France ,volume 14 of LIPIcs , pages 218–229. Schloss Dagstuhl - Leibniz-Zentrum f¨ur Informatik,2012. doi:10.4230/LIPIcs.STACS.2012.218 .[10] Volker Diekert, J¨urn Laun, and Alexander Ushakov. Efficient algorithms for highly com-pressed data: The word problem in Higman’s group is in P. International Journal ofAlgebra and Computation , 22(8), 2013. doi:10.1142/S0218196712400085 .[11] Volker Diekert, Alexei G. Myasnikov, and Armin Weiß. Conjugacy in Baumslag’sGroup, Generic Case Complexity, and Division in Power Circuits. In AlbertoPardo and Alfredo Viola, editors, Latin American Theoretical Informatics Sympo-sium , volume 8392 of Lecture Notes in Computer Science , pages 1–12. Springer, 2014. doi:10.1007/978-3-642-54423-1_1 .[12] Volker Diekert, Alexei G. Myasnikov, and Armin Weiß. Conjugacy in Baumslag’s group,generic case complexity, and division in power circuits. Algorithmica , 74:961–988, 2016. doi:10.1007/s00453-016-0117-z .[13] Will Dison, Eduard Einstein, and Timothy R. Riley. Ackermannian integer compressionand the word problem for hydra groups. In ,pages 30:1–30:14, 2016. doi:10.4230/LIPIcs.MFCS.2016.30 .[14] Will Dison, Eduard Einstein, and Timothy R. Riley. Taming the hydra: The word prob-lem and extreme integer compression. Int. J. Algebra Comput. , 28(7):1299–1381, 2018. doi:10.1142/S0218196718500583 . 3615] S. M. Gersten. Isodiametric and isoperimetric inequalities in group extensions. Preprint,1991.[16] Graham Higman. A finitely generated infinite simple group. J. London Math. Soc. , 26:61–64, 1951.[17] I. Kapovich, A. G. Miasnikov, P. Schupp, and V. Shpilrain. Generic-case complexity,decision problems in group theory and random walks. Journal of Algebra , 264:665–694,2003.[18] Jonathan Kausch. The parallel complexity of certain algorithmic problems in group theory .Dissertation, Institut f¨ur Formale Methoden der Informatik, Universit¨at Stuttgart, 2017.[19] Daniel K¨onig and Markus Lohrey. Evaluation of circuits over nilpotent and polycyclicgroups. Algorithmica , 80(5):1459–1492, 2018. doi:10.1007/s00453-017-0343-z .[20] J¨urn Laun. Efficient algorithms for highly compressed data: The word problemin generalized higman groups is in P. Theory Comput. Syst. , 55(4):742–770, 2014. doi:10.1007/s00224-013-9509-5 .[21] J. Lehnert and P. Schweitzer. The co-word problem for the Higman-Thompson group is context-free. Bull. London Math. Soc. , 39:235–241,2007. URL: http://blms.oxfordjournals.org/content/39/2/235.abstract , doi:10.1112/blms/bdl043 .[22] Richard J. Lipton and Yechezkel Zalcstein. Word problems solvable in logspace. J. ACM ,24:522–526, 1977.[23] Markus Lohrey. Decidability and complexity in automatic monoids. International Journalof Foundations of Computer Science , 16(4):707–722, 2005.[24] Markus Lohrey. The Compressed Word Problem for Groups . Springer Briefs in Mathe-matics. Springer, 2014. URL: https://doi.org/10.1007/978-1-4939-0748-9 .[25] Roger Lyndon and Paul Schupp. Combinatorial Group Theory . Classics in Mathematics.Springer, 2001. First edition 1977.[26] Wilhelm Magnus. Das Identit¨atsproblem f¨ur Gruppen mit einer definierenden Relation. Mathematische Annalen , 106:295–307, 1932.[27] Wilhelm Magnus, Abraham Karrass, and Donald Solitar. Combinatorial Group Theory .Dover, 2004.[28] Alexei Miasnikov and Andrey Nikolaev. On parameterized complexity of the word searchproblem in the baumslag-gersten group. In ISSAC ’20: International Symposium onSymbolic and Algebraic Computation, Kalamata, Greece, July 20-23, 2020 , pages 360–363, 2020. doi:10.1145/3373207.3404042 .[29] Alexei G. Myasnikov, Alexander Ushakov, and Won Dong-Wook. The WordProblem in the Baumslag group with a non-elementary Dehn function is poly-nomial time decidable. Journal of Algebra , 345:324–342, 2011. URL: .3730] Alexei G. Myasnikov, Alexander Ushakov, and Won Dong-Wook. Power circuits, expo-nential algebra, and time complexity. International Journal of Algebra and Computation ,22(6):3–53, 2012.[31] Alexei G. Myasnikov and Sasha Ushakov. Cryptography and groups (CRAG). SoftwareLibrary. URL: .[32] P. S. Novikov. On the algorithmic unsolvability of the word problem in group theory. Trudy Mat. Inst. Steklov , pages 1–143, 1955. In Russian.[33] A. N. Platonov. Isoparametric function of the Baumslag-Gersten group. Vestnik Moskov.Univ. Ser. I Mat. Mekh. , 3:12–17, 2004. Russian. Engl. transl. Moscow Univ. Math. Bull.59 (3) (2004), 12–17.[34] David Robinson. Parallel Algorithms for Group Word Problems . PhD thesis, Universityof California, San Diego, 1993.[35] Mark V. Sapir, Jean-Camille Birget, and Eliyahu Rips. Isoperimetric and IsodiametricFunctions of Groups. Ann. Math. , 156(2):345–466, 2002.[36] Hans-Ulrich Simon. Word problems for groups and contextfree recognition. In Proceedingsof Fundamentals of Computation Theory (FCT’79), Berlin/Wendisch-Rietz (GDR) , pages417–422. Akademie-Verlag, 1979.[37] Michael Sipser. Introduction to the Theory of Computation . International Thomson Pub-lishing, 1st edition, 1996.[38] Heribert Vollmer. Introduction to Circuit Complexity . Springer, Berlin, 1999.[39] Armin Weiß. On the Complexity of Conjugacy in Amalgamated Products and HNN Exten-sions . Dissertation, Institut f¨ur Formale Methoden der Informatik, Universit¨at Stuttgart,2015.[40] Armin Weiß. A logspace solution to the word and conjugacy problem of generalizedBaumslag-Solitar groups. In Algebra and Computer Science , volume 677 of