The Commutative Closure of Shuffle Expressions over Group Languages is Regular
aa r X i v : . [ c s . F L ] A ug State Complexity Bounds for Shuffle andIterated Shuffle Combined with theCommutative Closure on Group Languages
Stefan Hoffmann r ´ ´ ´ X s Informatikwissenschaften, FB IV, Universit¨at Trier, Universit¨atsring 15, 54296 Trier,Germany, [email protected]
Abstract.
We show that the shuffle and iterated shuffle of the commu-tative closure of a group language is regular, and derive state boundsfor resulting automata. In particular, for commutative group languagesthe iterated shuffle is a regularity preserving operation. For the shuffle oftwo commutative group languages, we give a sharp bound. For applyingthe shuffle operation to the commutative closure of multiple group lan-guages we give a state bound that is better than applying general boundson individual operations. To derive our results, we introduce the statelabel method as a unifying framework, which is based on a generalizedcommutative image and a decomposition thereof into unary automata.
Keywords: state complexity · commutative closure · group language · permutation automaton · state label method · shuffle · iterated shuffle The state complexity of a regular language L is the minimal number of statesneeded in a complete deterministic automaton accepting L . Investigating thestate complexity of the result of a regularity-preserving operation on regularlanguages was first initiated in [16] and systematically started in [22], for a sur-vey see [9]. If we combine the bounds for different operations, we get bounds forthe combined operations. But it was noted that often these bounds are not op-timal. The first study [1], which looked at the state complexity of the combinedoperation Σ ˚ ¨ L , was motivated by applications from temporal logic. Severalstudies followed that looked at combined operations, also on subclasses of theregular languages, we refer again to the survey [9]. Here, we study the state com-plexity of the shuffle and iterated shuffle combined with the commutative closureon the class of group languages. This class is special, as for it the commutativeclosure is regularity-preserving [11, 14]. We will also show that the combinedoperation of commutative closure and iterated shuffle is regularity preserving onit, a result not true in general. The shuffle and iterated shuffle have been intro-duced and studied to understand the semantics of parallel programs. This wasundertaken, as it appears to be, independently by Campbell and Habermann [4],by Mazurkiewicz [17] and by Shaw [21]. They introduced flow expressions , whichallow for sequential operators (catenation and iterated catenation) as well as forparallel operators (shuffle and iterated shuffle). The shuffle operation as a binary S. Hoffmann operation, but not the iterated shuffle, is regularity preserving on all regular lan-guages. The state complexity of this operation was studied in [2, 5, 6, 12, 13]. Thestate complexity of the commutative closure on finite languages was investigatedin [7, 15, 19].
Let Σ “ t a , . . . , a k u be a finite set of symbols , called an alphabet. The set Σ ˚ denotes the set of all finite sequences, i.e., of all words with the concatenationoperation. The finite sequence of length zero, or the empty word , is denoted by ε .For a given word, we denote by | w | its length, and for a P Σ by | w | a the numberof occurrences of the symbol a in w . Subsets of Σ ˚ are called languages . For L Ď Σ ˚ we set L ` “ Ť i “ L i and L ˚ “ L ` Y t ε u . With N “ t , , , . . . u wedenote the set of natural numbers, including zero. We consider the usual order ă on N . On the cartesian product N m ( m ą
0) by ă we denote the product (orcomponentwise) order . For a set X by P p X q we denote the power set of X , i.e, theset of all subsets of X . Every function f : X Ñ Y induces a function f : P p X q Ñ P p Y q by setting f p Z q : “ t f p z q | z P Z u . Here, we will denote this extension alsoby f . A bijective function f : X Ñ X is called a permutation (of X ) . If X isfinite, the smallest number n ě f n p x q “ x for each x P X is called the order of the permutation . Every permutation could be written as a compositionof disjoint cycles, which is unique up to the order of the cycles [3]. Then theorder equals the least common multiple of all the resulting cycle lengths. By π : X ˆ Y Ñ X and π : X ˆ Y Ñ Y we denote the projection maps ontothe first and second component, π p x, y q “ x and π p x, y q “ y . If a, b P N with b ą
0, we denote by a mod b the unique number 0 ď r ă b such that a “ bn ` r for some n ě
0. For n P N we set r n s : “ t k P N : 0 ď k ă n u . Let M Ď N be a finite set. By max M we denote the maximal element in M with respect to theusual order, and we set max H “
0. Also for finite M Ď N zt u , i.e., M is finitewithout zero in it, by lcm M we denote the least common multiple of the numbersin M , where lcm H “
0. A finite deterministic and complete automaton will bedenoted by A “ p Σ, S, δ, s , F q with δ : S ˆ Σ Ñ S the state transition function, S a finite set of states, s P S the start state and F Ď S the set of final states.The properties of being deterministic and complete are implied by the definitionof δ as a total function. The transition function δ : S ˆ Σ Ñ S could be extendedto a transition function on words δ ˚ : S ˆ Σ ˚ Ñ S by setting δ ˚ p s, ε q : “ s and δ ˚ p s, wa q : “ δ p δ ˚ p s, w q , a q for s P S , a P Σ and w P Σ ˚ . In the remainder we dropthe distinction between both functions and will also denote this extension by δ .A semi-automaton A “ p Σ, Q, δ q is like an automaton, but without a designatedstart state and without a set of final states. All (semi-)automata considered inthis paper will be finite, complete and deterministic. The language acceptedby an automaton A “ p Σ, S, δ, s , F q is L p A q “ t w P Σ ˚ | δ p s , w q P F u . Alanguage L Ď Σ ˚ is called regular if L “ L p A q for some finite automaton. Fora language L Ď Σ ˚ and u, v P Σ ˚ we define the Nerode right-congruence withrespect to L by u ” L v if and only if @ x P Σ : ux P L Ø vx P L. The equivalenceclass for some w P Σ ˚ is denoted by r w s ” L : “ t x P Σ ˚ | x ” L w u . A language isregular if and only if the above right-congruence has finite index, and it could If not otherwise stated we assume that our alphabet has the form Σ “ t a , . . . , a k u and k ě be used to define the minimal deterministic automaton A L “ p Σ, Q, δ, r ε s ” L , F q with Q : “ tr w s ” L | w P Σ ˚ u , δ pr w s ” L , a q : “ r wa s ” L for a P Σ , w P Σ ˚ and F : “ tr w s ” L | w P L u . It is indeed the smallest automaton accepting L in termsof states, and we will refer to this construction as the minimal automaton of L .The state complexity of a regular language is defined as the number of Neroderight-congruence classes. We will denote this number by sc p L q . We will also talkabout the state complexity of a (combined) regularity-preserving operation. If f : P p Σ ˚ q n Ñ P p Σ ˚ q is a regularity-preserving operation, its state complexity is thefunction sc p f q : N n Ñ N given by sc p f qp m , . . . , m n q “ max t sc p f p L , . . . , L n qq | L i regular with sc p L i q ď m i for i P t , . . . , n uu . The same definition holds foroperations that are only regularity-preserving on subclasses, or if we are onlyinterested in certain subclasses. Then the domain is restricted to this subclass.The map ψ : Σ ˚ Ñ N k given by ψ p w q “ p| w | a , . . . , | w | a k q is called the Parikh-morphism . For a given word w P Σ ˚ we define perm p w q : “ t u P Σ ˚ : ψ p u q “ ψ p w qu and for languages L Ď Σ ˚ we set perm p L q : “ Ť w P L perm p w q . A languageis called commutative if perm p L q “ L . Definition 1.
The shuffle operation , denoted by (cid:1) , is defined by u (cid:1) v : “ " x y x y ¨ ¨ ¨ x n y n | u “ x x ¨ ¨ ¨ x n , v “ y y ¨ ¨ ¨ y n ,x i , y i P Σ ˚ , ď i ď n, n ě * , for u, v P Σ ˚ and L (cid:1) L : “ Ť x P L ,y P L p x (cid:1) y q for L , L Ď Σ ˚ . The shuffle operation is commutative, associative and distributive over union.We will use these properties without further mention. In writing formulas with-out brackets we suppose that the shuffle operation binds stronger than the set op-erations, and the concatenation operator has the strongest binding. For L Ď Σ ˚ the iterated shuffle is L (cid:1) , ˚ “ Ť i “ L (cid:1) ,i with L (cid:1) , “ t ε u and L (cid:1) ,i ` “ L (cid:1) L (cid:1) ,i .The positive iterated shuffle is L (cid:1) , ` “ Ť i “ L (cid:1) ,i . We call a language a (pure-)group language if it is accepted by a complete automaton where every let-ter acts as a permutation on the state set. Such automata are also called per-mutation automata . The next result is taken from [8] and gives equations likeperm p U V q “ perm p U q (cid:1) perm p V q or perm p U ˚ q “ perm p U q (cid:1) , ˚ for U, V Ď Σ ˚ We will use such equations frequently without special mentioning.
Theorem 1. [8] perm : P p Σ ˚ q Ñ P p Σ ˚ q is a semiring morphism from thesemiring p P p Σ ˚ q , Y , ¨ , H , t ε uq to the semiring p P p Σ ˚ q , Y , (cid:1) , H , t ε uq that alsorespects the iterated catenation resp. iterated shuffle operation. Let L Ď Σ ˚ be a commutative regular language. For each j P t , . . . , k u let i j ě p j ě r a i j j s ” L “ r a i j ` p j j s ” L . Thevectors p i , . . . , i k q and p p , . . . , p k q are then called the index and period vectorsof L . These notions where introduced in [10, 12, 13] and it was shown that theycould be used to bound the state complexity of L . Theorem 2. [10, 12, 13] Let L be a commutative regular language with indexvector p i , . . . , i k q and period vector p p , . . . , p k q . Then sc p L q ď ś kj “ p i j ` p j q . These were introduced in [18] under the name of pure-group events. S. Hoffmann
A commutative regular language is a group languages if and only if its indexvector is the zero vector. This follows by constructions from [12, 13] and as theminimal automaton of a group language is a permutation automaton. Note thatfor commutative group languages, the periods equal the order of the correspond-ing letter viewed as a permutation on the states of the minimal automaton.
Let Σ “ t a u be a unary alphabet. In this section we collect some results aboutunary languages. Suppose L Ď Σ ˚ is regular with an accepting complete deter-ministic automaton A “ p Σ, S, δ, s , F q . Then by considering the sequence ofstates δ p s , a q , δ p s , a q , δ p s , a q , . . . we find numbers i ě , p ą i and p minimal such that δ p s , a i q “ δ p s , a i ` p q . We call these numbers the index i and the period p of the automaton A . Suppose A is initially connected, i.e., δ p s , Σ ˚ q “ Q . Then i ` p “ | S | and the states t s , δ p s , a q , . . . , δ p s , a i ´ qu con-stitute the tail and the states t δ p s , a i q , δ p s , a i ` q , . . . , δ p s , a i ` p ´ u constitutethe unique cycle of the automaton. When we speak of the cycle, tail, index orperiod of an arbitrary unary automaton we nevertheless mean the above sets,even if the automaton is not initially connected and the automaton graph mighthave more than one cycle or more than one straight path. We assume Σ “ t a , . . . , a k u . First, in Section 3.1 we introduce the state labelmethod and use it to derive Theorem 3. This theorem is a general regularitycondition that also gives bounds for the size of resulting automata. The statelabel method and Theorem 3 are the backbone of the results from Section 3.3,Section 3.4 and Section 3.5. The method, as applied here, is related to automata.The definitions and results for these so called automata induced state label maps are collected in Section 3.2. In Section 3.3, as a first application, we derivestate complexity bounds for the combined operation of the commutative closureand the binary shuffle operation on group languages. We relate these bounds toprevious results, but also state a sharp bound for the special case of commutativegroup languages, for which this combined operation reduces to the ordinaryshuffle operation. But the state label method as presented in this section is morea preparation and example application for the following sections. In particular,in the follow-up Section 3.4 the same method with minor modifications couldbe applied to derive state bounds for the combined operation of applying theshuffle n times to the commutative closure of n group languages. Lastly, inSection 3.5, we derive that the combined operation of the commutative closureand the iterated shuffle on group languages gives a regular language, and we givestate complexity bounds for this operation. This implies that the iterated shuffleon commutative group languages is regularity preserving. The state label method was implicitly used in [14] to give a state complexitybound for the commutative closure of a group language, see [14] for an intuitiveexplanation and examples in this special case. That the commutative closure isregularity preserving for group languages was discovered in [11]. Here, we ex-tract the method of proof from [14] in a more abstract setting and formulate itindependently of any automata. Intuitively, we want to describe a commutative tate Bounds for (Iterated) Shuffle and Comm. Closure on Group Languages 5 language by labelling points from N k with subsets. We call these subsets statelabels, as in our applications they arise from the states of given automata. In-tuitively and very roughly, the method could be thought of as both a refinedParikh map for regular languages and a power set construction for automatathat incorporates the commutativity condition. The connection to languages isstated in Theorem 3. In the framework of the state label method we introducea special class of unary automata in Definition 4. These are used to decomposethe state labelling map, which is made more precise in Proposition 1. This takesthe theme of viewing commutative languages as strongly tied to unary languagesfurther, a guiding theme already used in previous work [12, 13, 14]. In our ap-plications in Section 3.3, Section 3.4 and Section 3.5 we will first define a statelabelling from one or many automata that is related to our operations at hand.Then, we will show that this state labelling could be linked with the Parikhimage of the language operation in question. This last step then yields that thestate label map could be used to decribe the commutative closure. Finally, byProposition 2, for permutation automata we can apply Theorem 3 in our sit-uations to conclude that the resulting languages are regular and derive statecomplexity bounds. Our first definition in this section will be the notion of astate label map. Definition 2.
Let Σ “ t a , . . . , a k u and Q be a finite set. A state label function is a function σ : N k Ñ P p Q q given by another function f : P p Q q ˆ Σ Ñ P p Q q so that σ p p q “ ď p q,b q p “ q ` ψ p b q f p σ p q q , b q (1) for p ‰ p , . . . , q and σ p , . . . , q P P p Q q is arbitrary. In this context, we call the elements from Q states, even if they do notcorrespond to an automaton. The function f : P p Q q ˆ Σ Ñ P p Q q could beextended to words by setting f p S, ε q “ S and f p S, ux q “ f p f p S, u q , x q . Withthis extension the next equation could be derived. Lemma 1.
Let σ : N k Ñ P p Q q be a state label function given by f : P p Q qˆ Σ Ñ P p Q q and p “ p p , . . . , p k q P N k . If ď n ď p ` . . . ` p k , then σ p p q “ ď p q,w qP N k ˆ Σ n p “ q ` ψ p w q f p σ p q q , w q . Next, we introduce the hyperplanes that will be used in Definition 4.
Definition 3. (hyperplane aligned with letter) Let Σ “ t a , . . . , a k u and j Pt , . . . , k u . We set H j “ tp p , . . . , p k q P N k | p j “ u . Suppose Σ “ t a , . . . , a k u and j P t , . . . , k u . We will decompose the statelabel map into unary automata. For each letter a j and point p P H j , we constructunary automata A p j q p . They are meant to read inputs in the direction ψ p a j q ,which is orthogonal to H j . This will be stated more precisely in Proposition 1. S. Hoffmann
Definition 4. (unary automata along letter a j P Σ ) Let Σ “ t a , . . . , a k u and σ : N k Ñ P p Q q be a state label function, with defining function f : P p Q q ˆ Σ Ñ P p Q q and finite set Q . Fix j P t , . . . , k u and p P H j . We define a unary automa-ton A p j q p “ pt a j u , Q p j q p , δ p j q p , s p ,j q p , F p j q p q . But suppose for points q P N k with p “ q ` ψ p b q for some b P Σ the unary automata A p j q q “ pt a j u , Q p j q q , δ p j q q , s p ,j q q , F p j q q q are already defined. Set P “ t A p j q q | p “ q ` ψ p b q for some b P Σ u . Let I be the maximal index and P the least common multiple of the periods ofthe unary automata in P . Then set Q p j q p “ P p Q q ˆ r I ` P s ,s p ,j q p “ p σ p p q , q , (2) δ p j q p pp S, i q , a j q “ " p T, i ` q if i ` ă I ` P ; p T, I q if i ` “ I ` P ; (3) where T “ f p S, a j q Y ď p q,b qP N k ˆ Σp “ q ` ψ p b q f p π p δ p j q q p s p ,j q q , a i ` j qq , b q (4) and F p j q p “ tp S, i q | S X F ‰ Hu . For a state p S, i q P Q p j q p the set S will be calledthe state (set) label , or the state set associated with it . The reader might consult [14] for examples. The next statement makes precisewhat we mean by decomposing the state label map along the hyperplanes intothe automata A p j q p “ pt a j u , Q p j q p , δ p j q p , s p ,j q p , F p j q p q . Moreover, it justifies callingthe first component of any state p S, i q P Q p j q p also the state set label. Proposition 1. (state label map decomposition) Suppose Σ “ t a , . . . , a k u and Q is a finite set. Let σ : N k Ñ P p Q q be a state label map, ď j ď k and p “ p p , . . . , p k q P N k . Assume p P H j is the projection of p onto H j , i.e., p “ p p , . . . , p j ´ , , p j ` , . . . , p k q . Then σ p p q “ π p δ p j q p p s p ,j q p , a p j j qq for the automata A p j q p “ pt a j u , Q p j q p , δ p j q p , s p ,j q p , F p j q p q from Definition 4. By Propositon 1, the state label sets of the axis-parallel rays in N k correspondto the state set labels of unary automata. Hence, the next is implied. Corollary 1.
A state label map is ultimately periodic along each ray. More for-mally, if σ : N k Ñ P p Q q is a state label function, p P N k and j P t , . . . , k u , thenthe sequence of state sets σ p p ` i ¨ ψ p a j qq for i “ , , , . . . is ultimately periodic. Note that in the definition of P , as p P H j , we have b ‰ a j and q P H j . In general,points q P N k with p “ q ` ψ p b q for some b P Σ are predecessor points in the grid N k . Note max
H “
H “
Our final result in this section is the mentioned regularity condition. It saysthat if the automata from Definition 4 underlying the state set labels, as statedin Proposition 1, do not grow, i.e., have a bounded number of states, then wecan deduce that the languages we get if we look at the inverse images of the statelabel map and the Parikh map are regular. This is equivalent with the conditionthat the state set labels all get periodic behind specific points, i.e., outside ofsome bounded rectangle in N k . Theorem 3.
Let σ : N Ñ P p Q q be a state label map and ψ : Σ ˚ Ñ N k bethe Parikh map. Suppose for every j P t , . . . , k u and p P H j the automata A p j q p “ pt a j u , Q p j q p , δ p j q p , s p ,j q p , F p j q p q from Definition 4 have a bounded number ofstates , i.e., | Q p j q p | ď N for some N ě independent of p and j . Then for F Ď P p Q q the commutative language ψ ´ p σ ´ p F qq is regular and could be accepted by an automaton of size ś kj “ p I j ` P j q , where I j denotes the largest index among the unary automata t A p j q p | p P H j u and P j the least common multiple of all the periods of these automata. In particular,by the relations of the index and period to the states from Section 2.1, the statecomplexity of ψ ´ p σ ´ p F qq is bounded by N k . I refer to [14] for examples and more explanation.
We call a state label map σ : N k Ñ P p Q q given by a function f : P p Q q ˆ Σ Ñ P p Q q an automaton induced state label map , if there exists some semi-automaton A “ p Σ, Q, δ q such that δ p S, a q Ď f p S, a q for each a P Σ . We also say that suchan (semi-)automaton is compatible with the state map. This gives inductivelythat δ p S, w q Ď f p S, w q for each word w P Σ ˚ and set S Ď Q . Lemma 2.
Let A “ p Σ, Q, δ q be a semi-automaton and suppose the state labelmap σ : N k Ñ P p Q q is compatible with A . Let p, q P N k with q ă p , then δ p σ p q q , w q Ď σ p p q for each w P Σ ˚ with p “ ψ p w q ` q . Our most important result, which generalizes a corresponding result from [14]to automata induced state label maps, is stated next.
Proposition 2.
Let A “ p Σ, Q, δ, s , F q be a permutation automaton and σ : N k Ñ P p Q q a state map compatible with A . Then for every automaton A p j q p fromDefinition 4 its index equals at most p| Q | ´ q L j and its period is divided by L j ,where L j denotes the order of the letter a j viewed as a permutation of Q , i.e., δ p q, a L j j q “ q for any q P Q and L j is minimal with this property. Equivalently, the index and period is bounded, which is equivalent with just a finitenumber of distinct automata, up to semi-automaton isomorphism. We call two semi-automata isomorphic if one semi-automaton can be obtained from the other one byrenaming states and alphabet symbols. For every automaton A “ p Σ, Q, δ, s , F q we can consider the corresponding semi-automaton A “ p Σ, Q, δ q and we will do so without special mentioning. S. Hoffmann Let Σ “ t a , . . . , a k u and L Ď Σ ˚ be a commutative regular language withindex vector p i , . . . , i k q and period vector p p , . . . , p k q . In [11] it was shown thatthe commutative closure of a group language is regular and in [12] the followingbound for the state complexity of the commutative closure on group languageswas derived. Theorem 4. [14] Let A “ p Σ, Q, δ, s , F q be a permutation automaton. Then perm p L p A qq is regular and for its index vector p i , . . . , i k q and period vector p p , . . . , p k q we have i j ď p| Q | ´ q L j and p j divides L j for j P t , . . . , k u , where L j denotes the order of the letter a j , viewed as a permutation of the state set.Hence, by Theorem 2, sc p perm p L p A qqq ď | Q | k ś kj “ L j . In [12, 13], the shuffle operation on commutative languages was investigatedand the following result stated.
Theorem 5. [12, 13] Let U and V be commutative regular languages with indexand period vectors p i , . . . , i k q , p j , . . . , j k q and p p , . . . , p k q , p q , . . . , q k q respec-tively. Then sc p U (cid:1) V q ď ś kl “ p i l ` j l ` ¨ lcm p p l , q l q ´ q . Combining Theorem 4 and Theorem 5, we get the following bound on thestate complexity of the combined operation perm p L p A q L p B qq “ perm p L p A qq (cid:1) perm p L p B qq . Corollary 2.
Let A “ p Σ, Q A , δ A , s A , F A q and B “ p Σ, Q B , δ B , s B , F B q be fi-nite permutation automata. Suppose L j and K j denote the order of the letter a j viewed as a permutation on Q A and Q B respectively. Then sc p perm p L p A qq (cid:1) perm p L p B qqq is bounded by k ź j “ pp| Q A | ´ q L j ` p| Q A | ´ q K j ` ¨ lcm p L j , K j q ´ q . Next, we will use the state label method to derive another bound. For theshuffle of two languages, the bound given in Corollary 2 is better. So, the presen-tation that follows is an example of how to employ the state label method anda preparation for Section 3.4. The technique carries over without much modifi-cation to the n -times shuffle of n given group languages. We will give this resultin Section 3.4, and only refer to case of two languages. I feel the presentationfor two languages is much more transparent and once the scheme is understood,I guess the reader sees how to apply it to the case of n group languages. As weuse the state label method, let us define our state label map. Definition 5.
Let A “ p Σ, Q A , δ A , s A , F A q and B “ p Σ, Q B , δ B , s B , F B q befinite automata with disjoint state sets, i.e., Q A X Q B “ H . Denote by σ A , B : N k Ñ P p Q A Y Q B q the state label function given by f : P p Q A Y Q B q ˆ Σ Ñ P p Q A Y Q B q , where f p S, a q “ " δ A p S X Q A , a q Y δ B p S X Q B , a q Y t s B u if δ A p S X Q A , a q X F A ‰ H ; δ A p S X Q A , a q Y δ B p S X Q B , a q otherwise; (5) tate Bounds for (Iterated) Shuffle and Comm. Closure on Group Languages 9 for S Ď Q A Y Q B , a P Σ , and σ A , B p p q “ " t s A , s B u if s A P F A ; t s A u otherwise. The requirement Q A X Q B “ H in most statements of this section is not alimitation, as we could always construct an isomorphic copy of any one of theinvolved automata if this is not fullfilled. It is more a technical requirement ofthe constructions, to not mix up what is read up to some point. Lemma 3.
Let p P N k and A “ p Σ, Q A , δ A , s A , F A q , B “ p Σ, Q B , δ B , s B , F B q be finite automata with disjoint state sets. Denote by σ A , B : N k Ñ P p Q A Y Q B q the state label map from Definition 5. If for all q P N k with q ď p we have σ A , B p q q X F A “ H , then σ A , B p p q X Q B “ H . With Lemma 3, we can derive a connection between the Parikh image of L p A q L p B q and the state label map. Proposition 3.
Suppose we have finite automata A “ p Σ, Q A , δ A , s A , F A q and B “ p Σ, Q B , δ B , s B , F B q with Q A X Q B “ H . Then ψ p L p A q L p B qq “ σ ´ A , B pt S Ď Q A Y Q B | S X F B ‰ Huq . Hence, as perm p L q “ ψ ´ p ψ p L qq for any L Ď Σ ˚ , we can conclude thatthis state labeling could be used to describe the commutative closure of theconcatenation, which, by Theorem 1, equals perm p L p A qq (cid:1) perm p L p B q . Corollary 3.
Suppose we have finite automata A “ p Σ, Q A , δ A , s A , F A q and B “ p Σ, Q B , δ B , s B , F B q with Q A X Q B “ H . Then perm p L p A q L p B qq “ ψ ´ p σ ´ A , B pt S Ď Q A Y Q B | S X F B ‰ Huqq . Constructing an appropriate automaton over Q A Y Q B and applying Theo-rem 3 then gives the next result. Theorem 6.
Let A “ p Σ, Q A , δ A , s A , F A q and B “ p Σ, Q B , δ B , s B , F B q be finitepermutation automata. Suppose L j and K j denote the order of the letter a j viewed as a permutation on Q A and Q B respectively, then sc p perm p L p A qq (cid:1) perm p L p B qqq ď p Q A ` Q B q k k ź j “ lcm p L j , K j q . For commutative group languages U and V with period vectors p p , . . . , p k q and p q , . . . , q k q the best bound up to now is given by Corollary 2,sc p U (cid:1) V q ď k ź j “ pp sc p U q ´ q p j ` p sc p V q ´ q q j ` p p j , q j q ´ q with sc p U q ď ś kj “ p j and sc p V q ď ś kj “ q j . But, in this special case, we can dobetter. We will derive a sharp bound. We do not use the state label method forthis result, the method of proof is more similar as in [12, 13]. Theorem 7.
Let Σ “ t a , . . . , a k u . For commutative group languages U, V Ď Σ ˚ with period vectors p p , . . . , p k q and p q , . . . , q k q their shuffle U (cid:1) V has indexvector p i , . . . , i k q with i j “ lcm p p j , q j q ´ for j P t , . . . , k u and period vector p gcd p p , q q , . . . , gcd p p k , q k qq . Hence sc p U (cid:1) V q ď k ź j “ p gcd p p j , q j q ` lcm p p j , q j q ´ q . And this bound is sharp, i.e., there exist commutative group languages such thata minimal automaton accepting their shuffle reaches the bound. n -times Shuffle Let A i “ p Σ, Q, δ i , s i , F i q for i P t , . . . , n u be n permutation automata. For thecombined operation perm p L p A qq (cid:1) . . . (cid:1) perm p L p A n qq we can derive a statecomplexity bound analogous as in Section 3.3. We do not detail the steps, asessentially they consist in first generalizing Definition 5, then deriving a resultsimilar to Proposition 3, using this to conclude that the commutative closure ofthe concatenation operation could be described by the state label function as inCorollary 3, and finally applying Theorem 3. We then get Theorem 8. Theorem 8.
Let A i “ p Σ, Q, δ i , s i , F i q for i P t , . . . , n u be n permutation au-tomata. Then sc p perm p L p A qq (cid:1) . . . (cid:1) perm p L p A n qqq ď ˜ n ÿ i “ Q i ¸ k k ź j “ lcm p L p q j , . . . , L p n q j q where L p i q j for i P t , . . . , n u and j P t , . . . , k u denotes the order of the letter a j as a permutation on Q i . We use the state label method. First, we need to define our state label map.
Definition 6.
Let A “ p Σ, Q, δ, s , F q be a finite automaton. Denote by σ A , ` : N k Ñ P p Q q the state label function given by f : P p Q q ˆ Σ Ñ P p Q q , where f p Q, a q “ " δ p Q, a q Y t s u if δ p Q, a q X F ‰ H ; δ p Q, a q otherwise; (6) and σ A , ` p , . . . , q “ t s u . To derive our results, we need the following formula for the image of the statelabel map at a given point.
Proposition 4.
Let Σ “ t a , . . . , a k u and A “ p Σ, Q, δ, s , F q be a finite au-tomaton. For the state-label function from Definition 6 we have σ A , ` p p q “ " A p Y B p if p A p Y B p q X F “ H ; A p Y B p Y t s u otherwise;where A p “ t δ p s , w q | ψ p w q “ p u and B p “ t δ p s , w q | D q P N k : q ă p and q ` ψ p w q “ p and σ A , ` p q q X F ‰ Hu . IBLIOGRAPHY 11
The next statement, in analogy to Propostion 3 from Section 3.3, gives aconnection between the Parikh image of L p A q ˚ and σ A , ` : N k Ñ P p Q q . Proposition 5.
Let A “ p Σ, Q, δ, s , F q be a finite automaton. Then ψ p L p A q ˚ q “ σ ´ A , ` pt S Ď Q | S X F ‰ Huq Y tp , . . . , qu . With this, we can derive our state complexity bound for the combined oper-ation of the commutative closure and of the shuffle closure on group languages.Note that in general this combined operation does not preserves regularity, asshown by perm pt ab uq (cid:1) , ˚ “ t w P t a, b u ˚ | | w | a “ | w | b u . Theorem 9.
Let A “ p Σ, Q, δ, s , F q be a permutation automaton. Then perm p L p A q ˚ q “ perm p L p A qq (cid:1) , ˚ is regular and sc p perm p L p A qq (cid:1) , ˚ q ď ´ | Q | k ś kj “ L j ¯ ` , where L j for j Pt , . . . , k u denotes the order of a j viewed as a permutation of the state set Q . Now we can derive that for commutative group languages the shuffle closureis regular, and we can bound the size of a resulting automaton.
Corollary 4.
Let Σ “ t a , . . . , a k u and L Ď Σ ˚ be a commutative group lan-guage with period vector p p , . . . , p k q . Then sc p L (cid:1) , ˚ q ď p sc p L q k ś kj “ p j q ` . We have introduced the state label method, which yields a general regularitycriterion for the commutative closure of languages related to regular languages.The method was applied to derive state complexity bounds for the combinedoperation of the commutative closure with the shuffle and iterated shuffle forthe class of group languages. We do not know if these bounds are sharp, but wesuspect that they leave room for improvement, see the corresponding discussionat the end of [14]. Hence, on group languages, commutative closure with iteratedshuffle is regularity-preserving. In particular the iterated shuffle of commutativegroup languages is regular. In case of the shuffle of two commutative grouplanguages, we also gave sharp bounds for the state complexity. All our boundsincorporate | Σ | , a phenomenon already encountered in previous work by theauthor [12, 13, 14, 15]. Bibliography [1] Birget, J.: The state complexity of \ sigma * L and its connection with temporallogic. Inf. Process. Lett. (4), 185–188 (1996)[2] Brzozowski, J.A., Jir´askov´a, G., Liu, B., Rajasekaran, A., Szyku la, M.: On thestate complexity of the shuffle of regular languages. In: Cˆampeanu, C., Manea, F.,Shallit, J.O. (eds.) Descriptional Complexity of Formal Systems - 18th IFIP WG1.2 International Conference, DCFS 2016, Bucharest, Romania, July 5-8, 2016.Proceedings. Lecture Notes in Computer Science, vol. 9777, pp. 73–86. Springer(2016), https://doi.org/10.1007/978-3-319-41114-9 [3] Cameron, P.J.: Permutation Groups. London Mathematical Society Student Texts,Cambridge University Press (1999)2 S. Hoffmann[4] Campbell, R.H., Habermann, A.N.: The specification of process synchronizationby path expressions. In: Gelenbe, E., Kaiser, C. (eds.) Operating Systems OS.LNCS, vol. 16, pp. 89–102. Springer (1974)[5] Cˆampeanu, C., Salomaa, K., Yu, S.: Tight lower bound for the state complexityof shuffle of regular languages. J. Autom. Lang. Comb. (3), 303–310 (2002)[6] Caron, P., Luque, J., Patrou, B.: A combinatorial approach for the state complex-ity of the shuffle product. CoRR abs/1905.08120 (2019)[7] Cho, D., Goc, D., Han, Y., Ko, S., Palioudakis, A., Salomaa, K.: State complexityof permutation on finite languages over a binary alphabet. Theor. Comput. Sci. , 67–78 (2017)[8] Fernau, H., Paramasivan, M., Schmid, M.L., Vorel, V.: Characterization and com-plexity results on jumping finite automata. Theoretical Computer Science ,31–52 (2017)[9] Gao, Y., Moreira, N., Reis, R., Yu, S.: A survey on operational state complexity.Journal of Automata, Languages and Combinatorics (4), 251–310 (2017)[10] G´omez, A.C., Alvarez, G.I.: Learning commutative regular languages. In: Clark,A., Coste, F., Miclet, L. (eds.) Grammatical Inference: Algorithms and Applica-tions, 9th International Colloquium, ICGI 2008, Saint-Malo, France, September22-24, 2008, Proceedings. Lecture Notes in Computer Science, vol. 5278, pp. 71–83.Springer (2008)[11] G´omez, A.C., Guaiana, G., Pin, J.: Regular languages and partial commutations.Inf. Comput. , 76–96 (2013)[12] Hoffmann, S.: State complexity, properties and generalizations of commutativeregular languages. Information and Computation (to appear) [13] Hoffmann, S.: Commutative regular languages - properties and state complexity.In: Ciric, M., Droste, M., Pin, J. (eds.) Algebraic Informatics - 8th InternationalConference, CAI 2019, Niˇs, Serbia, June 30 - July 4, 2019, Proceedings. LectureNotes in Computer Science, vol. 11545, pp. 151–163. Springer (2019)[14] Hoffmann, S.: State complexity bounds for the commutative closure of group lan-guages. CoRR abs/2004.11772 (2020), https://arxiv.org/abs/2004.11772 [15] Hoffmann, S.: State complexity of permutation on finite languages. CoRR abs/2006.15178 (2020), https://arxiv.org/abs/2006.15178 [16] Maslov, A.N.: Estimates of the number of states of finite automata. Dokl. Akad.Nauk SSSR (6), 1266–1268 (1970)[17] Mazurkiewicz, A.W.: Parallel recursive program schemes. In: Becv´ar, J. (ed.)Mathematical Foundations of Computer Science 1975, 4th Symposium, Mari´ansk´eL´azne, Czechoslovakia, September 1-5, 1975, Proceedings. Lecture Notes in Com-puter Science, vol. 32, pp. 75–87. Springer (1975)[18] McNaughton, R.: The loop complexity of pure-group events. Information and Con-trol (1/2), 167–176 (1967)[19] Palioudakis, A., Cho, D., Goc, D., Han, Y., Ko, S., Salomaa, K.: The state com-plexity of permutations on finite languages over binary alphabets. In: Shallit,J.O., Okhotin, A. (eds.) Descriptional Complexity of Formal Systems - 17th In-ternational Workshop, DCFS 2015, Waterloo, ON, Canada, June 25-27, 2015.Proceedings. Lecture Notes in Computer Science, vol. 9118, pp. 220–230. Springer(2015)[20] Pighizzini, G., Shallit, J.: Unary language operations, state complexity and jacob-sthal’s function. International Journal of Foundations of Computer Science (1),145–159 (2002)[21] Shaw, A.C.: Software descriptions with flow expressions. IEEE Trans. Softw. Eng. , 242–254 (1978)[22] Yu, S., Zhuang, Q., Salomaa, K.: The state complexities of some basic operationson regular languages. Theor. Comput. Sci. (2), 315–328 (1994)IBLIOGRAPHY 13 Here we collect some proofs not given in the main text.
In this section we collect results that are only needed in the proofs stated in theappendix. See Section 5.2 for proofs of the results from the main text.
Lemma 4.
Let A “ p Σ, Q, δ, s , F q be some unary automaton. If δ p s, a k q “ s for some state s P Q and number k ą , then k is divided by the period of A .Proof. Let i be the index, and p the period of A . We write k “ np ` r with0 ď r ă p . First note that s is on the cycle of A , i.e., s P t δ p s , a i q , δ p s , a i ` q , . . . , δ p s , a i ` p ´ qu as otherwise i would not be minimal. Then if s “ δ p s , a i ` j q for some 0 ď j ă p we have δ p s , a i ` k q “ δ p s , a i ` p ` k q “ δ p s , a i ` j ` k `p p ´ j q q “ δ p s , a i ` j `p p ´ j q q “ δ p s , a i q . So δ p s , a i q “ δ p s , a i ` k q “ δ p s , a i ` np ` r q “ δ p s , a i ` r q which gives r “ p . [\ Also, we will need Lemma 5 and Lemma 6 in the proof of Theorem 7.
Lemma 5. (Combining results from [12, 13]) Let Σ “ t a , . . . , a k u and L Ď Σ ˚ be a commutative regular language with index vector p i , . . . , i k q and period vector p p , . . . , p k q . Then we can write L “ n ď l “ U p l q (cid:1) . . . (cid:1) U p l q k with unary languages U p l q j Ď t a j u ˚ for j P t , . . . , k u . Furthermore, we can findunary automata A j “ pt a j u , Q j , δ j , s j , F j q with indices i j and periods p j andwith F j “ t f p q j , . . . , f p n q j u such that for l P t , . . . , n u U p l q j “ t u P t a j u ˚ : δ j p u q “ f p l q j u and | Q j | “ i j ` p j . Hence L p A j q “ t a | u | aj j | u P L u “ Ť nl “ U lj .Proof. We refer to [10, 12, 13] for the definition of the minimal commutativeautomaton. We also use the same notation for the languages U p l q j as used in [12,13]. The first claim is stated as Corollary 2 in [12, 13]. Lemma 5 of [12, 13]states that we can derive from the minimal commutative automaton a unaryautomaton with i j ` p j states such that U p l q j for l P t , . . . , n u is precisely theset of words that lead this automaton into a single final state. For each U p l q j theautomaton with i j ` p j states is the same automaton. Hence, collecting in F allthe final states corresponding to the U p l q j gives the claim. Note that we couldhave U p l q j “ U p l q j for distinct l, l P t , . . . , n u . Also note that by definition, andas the minimal commutative automaton is deterministic, if U p l q j ‰ U p l q j , then U p l q j X U p l q j “ H . [\ Remark 1.
In general, for commutative group languages, the minimal commu-tative automaton from [10, 12, 13] is not minimal, even if it has a single finalstate . For example, consider L “ a p aa q ˚ (cid:1) b p bb q ˚ Yp aa q ˚ (cid:1) p bb q ˚ “ t u P t a, b u ˚ || u | is even u . This language is accepted by the two-state permutation automaton A “ pt a, b u , t q , q u , δ, q , t q uq where δ : Q ˆ t a, b u Ñ Q is given by δ p q , x q “ q and δ p q , x q “ q for x P t a, b u . Lemma 6. (Refining a result from [20]) Let A “ pt a u , Q, δ, s , F q and B “pt a u , P, µ, t , E q be two unary automata with index zero and periods p and q respectively. Write F “ t f , . . . , f n u , E “ t e , . . . , e m u . Then L p A q L p B q couldbe accepted by an automaton C “ pt a u , R, η, r , T q with index lcm p p, q q´ , period gcd p p, q q and T “ Ť nl “ Ť mh “ T l,h such that t w | η p r , w q P T l,h u “ t u | δ p s , u q “ f l u ¨ t v | µ p t , v q “ e h u for l P t , . . . , n u and h P t , . . . , m u . This result is optimal in the sense thatthere exists automata A and B as above such that C is isomorphic to the minimalautomaton of L p A q L p B q .Proof. The existence and optimality was stated in [20] as Theorem 8, we onlyshow the additional part about the final states. With the notation from thestatement, set A l “ pt a u , Q, δ, s , t f l uq and B h “ pt a u , Q, µ, t , t e h uq for l Pt , . . . , n u and h P t , . . . , m u . Then by [20] we have an automaton with indexlcm p p, q q ´ p p, q q accepting L p A l q ¨ L p B h q for l P t , . . . , n u and h P t , . . . , m u . As the index and period determines the form of the automatonuniquely, we can suppose the only differing parts of those automata for each l P t , . . . , n u and h P t , . . . , m u are the final states. Hence, we can write C l,h “pt a u , R, η, r , T l,h q where R , η and the start state r are independent of l and h ,and L ppt a u , R, η, r , T l,h qq “ L p A l q L p B h q . Set T “ Ť nl “ Ť mh “ T l,h , then L ppt a u , R, η, r , T qq “ n ď l “ m ď h “ L p A l q L p B h q“ ˜ n ď l “ L p A l q ¸ ¨ ˜ m ď h “ L p B h q ¸ “ L p A q L p B q . This shows our claim. [\ For lower bound results, we also need the next results.
Lemma 7.
Let Σ “ t a , . . . , a k u and p n , . . . , n k q P N k . Suppose for a commu-tative language L Ď Σ ˚ we have1. t w P Σ ˚ | @ j P t , . . . , k u : | w | a j ě n j u Ď L , Note that for group languages, if an accepting permutation automaton has a singlefinal state, then it is minimal.IBLIOGRAPHY 15 t w P Σ ˚ | D j P t , . . . , k u : | w | a j “ min t n j ´ , uu X L “ H .then sc p L q “ ś kj “ p n j ` q with index vector p n , . . . , n k q and period vector p , . . . , q .Proof. Set C “ p Σ, r n ` s ˆ . . . ˆ r n k ` s , δ, p , . . . , q , F q with δ pp i , . . . , i j ´ , i j , i j ` , . . . , i k q , a j q“ p i , . . . , i j ´ , p i j ` q mod p n j ` q , i j ` , . . . , i k q . and F “ tp min t| w | a , n u , . . . , min t| w | a k , n k uq | w P L u . Then L p C q “ L . Let p i , . . . , i k q , p l , . . . , l k q P r n ` s ˆ . . . ˆ r n k ` s be distinct. Suppose, withoutloss of generality, i j ą l j for some j P t , . . . , k u . This implies 0 ď l j ă n j . Then δ pp l , . . . , l k q , a n ¨ ¨ ¨ a n j ´ j ´ a n j ´ ´ l j j a n j ` j ` ¨ ¨ ¨ a n k k q R F but δ pp i , . . . , i k q , a n ¨ ¨ ¨ a n j ´ j ´ a n j ´ ´ l j j a n j ` j ` ¨ ¨ ¨ a n k k q P F Hence, all states are distinguishable and C is isomorphic to the minimal automa-ton of L , which proves the claim. [\ Lemma 8.
Let Σ “ t a , . . . , a k u and L Ď Σ ˚ be a regular language with sc p L q “ n . Then sc p L Y t ε uq ď n ` and this bound is sharp. If L is commutative withindex vector p i , . . . , i k q , then the index vector of L Yt ε u is at most p i ` , . . . , i k ` q and both languages have the same period.Proof. Let A “ p Σ, Q, δ, s , F q be an automaton for L . Choose s R Q andconstruct A “ p Σ, Q
Y t s u , δ , s , F Y t s uq with δ p s , x q “ δ p s , x q for x P Σ , and δ p q, x q “ δ p q, x q for q P Q , x P Σ .1. L p A q Ď L Y t ε u .Let w P Σ ˚ be a word with δ p s , w q P F Y t s u . By construction, if δ p s , w q “ s , then w “ ε . Otherwise, if δ p s , w q ‰ s , then | w | ą δ p s , w q “ δ p s , w q . So w P L .2. L Y t ε u Ď L p A q .As s is a final state, the empty word is accepted. Now suppose that w P L zt ε u . Hence δ p s , w q P F . Then, as δ p s , w q “ δ p s , w q , we have w P L p A q .Let m ą
0. That the bound is sharp is demonstrated by the (unary group)language L “ a m ´ p a m q ˚ . We have sc p L q “ m and sc p L Y t ε uq “ m ` L Y t ε u is in general not a group language anymore. If A is theminimal commutative automaton from [10, 12, 13] it is easy to see that theabove construction increases the index for each letter by one, but leaves theperiod untouched. [\ We will also need the following stronger version of Lemma 3.
Lemma 9.
Let p P N k and A “ p Σ, Q A , δ A , s A , F A q , B “ p Σ, Q B , δ B , s B , F B q be finite automata with disjoint state sets. Denote by σ A , B : N k Ñ P p Q A Y Q B q the state label map from Definition 5. Then σ A , B p p q X Q B “ ď σ A , B p q qX F A ‰H p “ q ` ψ p u q δ B pt s B u , u q . Proof. If p “ p , . . . , q , then σ A , B p p q “ " t s A , s B u if s A P F A ; t s A u otherwise.Hence, as then p “ q ` ψ p u q implies q “ p “ p , . . . , q and u “ ε , so that δ pt s B u , u q “ t s B u , we have σ A , B p p q X Q B “ " δ pt s B u , u q if σ A , B p p q X F A ‰ H ; H otherwise.So, the equation holds. If p ‰ p , . . . , q , then we can reason inductively, σ A , B p p q X Q B “ ¨˚˚˝ ď p q,b q p “ q ` ψ p b q f p σ A , B p q q , b q ˛‹‹‚ X Q B “ ď p q,b q p “ q ` ψ p b q p f p σ A , B p q q , b q X Q B q By Equation (5), the set f p σ A , B p q q , b q X Q B equals " δ B p σ A , B p q q X Q B , b q Y t s B u if δ A p σ A , B p q q X Q A , b q X F A ‰ H ; δ B p σ A , B p q q X Q B , b q otherwise.By induction hypothesis, we can assume σ A , B p q q X Q B “ ď σ A , B p r qX F A ‰H q “ r ` ψ p u q δ pt s B u , u q . Hence δ B p σ A , B p q q X Q B , b q “ ď σ A , B p r qX F A ‰H q “ r ` ψ p u q δ B p δ B pt s B u , u q , b q IBLIOGRAPHY 17
If for all b P Σ and q P N k with p “ q ` ψ p b q we have δ A p σ A , B p q q X Q A , b q X F A “H , then by combining the above equations σ A , B p p q “ ď p q,b q p “ q ` ψ p b q ď σ A , B p r qX F A ‰H q “ r ` ψ p u q δ B p δ B pt s B u , u q , b q“ ď p q,b q p “ r ` ψ p u q` ψ p b q σ A , B p r qX F A ‰H δ B pt s B u , ub q“ ď p r,w q p “ r ` ψ p w q σ A , B p r qX F A ‰H δ B pt s B u , w q . Otherwise σ A , B p p q “ ď p q,b q p “ q ` ψ p b q ¨˚˚˝ ď σ A , B p r qX F A ‰H q “ r ` ψ p u q δ B p δ B pt s B u , u q , b q ˛‹‹‚ Y t s B u“ ď p q,b q p “ r ` ψ p u q` ψ p b q σ A , B p r qX F A ‰H δ B pt s B u , ub q Y t s B u“ ď p r,w q p “ r ` ψ p w q σ A , B p r qX F A ‰H δ B pt s B u , w q where the last equation holds, as t s B u “ δ pt s B u , ε q and σ A , B p p q X F A ‰ H , sothat p p, ε q is part of the union. So, by induction, the equation from the lemmaholds true. [\ Here, we give the proofs for all non-trivial results from the main text.
Let σ : N k Ñ P p Q q be a state label function given by f : P p Q qˆ Σ Ñ P p Q q and p “ p p , . . . , p k q P N k . If ď n ď p ` . . . ` p k , then σ p p q “ ď p q,w qP N k ˆ Σ n p “ q ` ψ p w q f p σ p q q , w q . Proof.
For n “ p ‰ p , . . . , q by the assump-tions. For n ą
1, by Definition 2, σ p p q “ ď p q,b qP N k ˆ Σp “ q ` ψ p b q f p σ p q q , b q . If b P Σ , then p “ q ` ψ p b q implies q ` . . . ` q k “ p ` . . . ` p k ´
1. Hence1 ď n ´ ď q ` . . . ` q k and, as inductively σ p q q “ ď p q ,u qP N k ˆ Σ n ´ q “ q ` ψ p u q f p σ p q q , u q , we get σ p p q “ ď p q,b qP N k ˆ Σp “ q ` ψ p b q f ¨˚˚˚˝ ď p q ,u qP N k ˆ Σ n ´ q “ q ` ψ p u q f p σ p q q , u q , b ˛‹‹‹‚ “ ď p q,b qP N k ˆ Σp “ q ` ψ p b q ď p q ,u qP N k ˆ Σ n ´ q “ q ` ψ p u q f p f p σ p q q , u q , b q“ ď p q,u qP N k ˆ Σ n ´ ,b P Σp “ q ` ψ p u q` ψ p b q f p f p σ p q q , u q , b q“ ď p q,u qP N k ˆ Σ n ´ ,b P Σp “ q ` ψ p u q` ψ p b q f p σ p q q , ub q“ ď p q,w qP N k ˆ Σ n p “ q ` ψ p w q f p σ p q q , w q . So, the formula holds true. [\ (state label map decomposition) Suppose Σ “ t a , . . . , a k u and Q is a finite set. Let σ : N k Ñ P p Q q be a state label map, ď j ď k and p “ p p , . . . , p k q P N k . Assume p P H j is the projection of p onto H j , i.e., p “ p p , . . . , p j ´ , , p j ` , . . . , p k q . Then σ p p q “ π p δ p j q p p s p ,j q p , a p j j qq for the automata A p j q p “ pt a j u , Q p j q p , δ p j q p , s p ,j q p , F p j q p q from Definition 4.Proof. Notation as in the statement. Also, let f : P p Q q ˆ Σ Ñ P p Q q be thedefining function for the state label map. For p “ p , . . . , q this is clear. If p j “
0, then p “ p , and, by Equation (2), π p δ p j q p p s p ,j q p , ε qq “ π p s p ,j q p q “ σ p p q . Suppose p j ą tp q, b q P N k ˆ Σ | p “ q ` ψ p b qu is non-empty and we can use Equation (1) and, inductively, that σ p q q “ IBLIOGRAPHY 19 π p δ p j q q p s p ,j q q , a q j j qq , which gives σ p p q “ ď p q,b q p “ q ` ψ p b q f p σ p q q , b q“ ď p q,b q p “ q ` ψ p b q f p π p δ p j q q p s p ,j q q , a q j j qq , b q (7)where q “ p q , . . . , q k q and q “ p q , . . . , q j ´ , , q j ` , . . . , q k q P H j . As p j ą p “ q ` ψ p a j q for some unique point q “ p p , . . . , p j ´ , p j ´ , p j ` . . . , p k q .For all other points r “ p r , . . . , r k q with p “ r ` ψ p b q for some b P Σ , thecondition r ‰ q implies b ‰ a j and r j “ p j for r “ p r , . . . , r k q . Also, if q P H j denotes the projection to H j , we have q “ p for our chosen q with p “ q ` ψ p a j q .Hence, taken all this together, we can write Equation (7) in the form σ A p p q “ ¨˚˚˝ ď p r,b q ,b ‰ a j p “ r ` ψ p b q f p π p δ p j q r p s p ,j q r , a p j j qq , b q ˛‹‹‚ Y f p π p δ p j q p p s p ,j q p , a p j ´ j qq , a j q . Let b P Σ . As for a j ‰ b , we have that p “ r ` ψ p b q if and only if p “ r ` ψ p b q ,with the notation as above for p, r, p and r “ p r , . . . , r j ´ , , r j ` , . . . , r k q , wecan simplify further and write σ A p p q “ ¨˚˚˝ ď p r,b q ,r P H j p “ r ` ψ p b q f p π p δ p j q r p s p ,j q r , a p j j qq , b q ˛‹‹‚ Y f p π p δ p j q p p s p ,j q p , a p j ´ j qq , a j q . (8)Set S “ π p δ p j q p p s p ,j q p , a p j ´ j qq , T “ σ p p q and P “ t A p j q r | p “ r ` ψ p b q for some b P Σ u . Let I be the maximal index, and P the least common multiple of all the periods,of the unary automata in P . We distinguish two cases for the value of p j ą ă p j ď I .By Equation (3), δ p p s p ,j q p , a p j ´ j q “ p S, p j ´ q . In this case Equation (8)equals Equation (4), if the state p S, p j ´ q is used in Equation (3), i.e., T “ f p S, a j q Y ¨˚˚˝ ď p r,b q ,r P H j p “ r ` ψ p b q f p π p δ p j q r p s p ,j q r , a p j j qq , b q ˛‹‹‚ . Note that for p P H j , the condition p “ q ` ψ p b q , for some b P Σ , implies q P H j and b ‰ a j .0 S. Hoffmann This gives δ p j q p pp S, p j ´ q , a j q “ p T, p j q . Hence π p δ p j q p pp S, p j ´ q , a j qq “ T “ σ p p q .(ii) I ă p j .Set y “ I ` pp p j ´ ´ I q mod P q . Then I ď y ă I ` P . By Equation (3), δ p j q p p s p ,j q p , a p j ´ j q “ p S, y q . So, also by Equation (3), δ p j q p p s p ,j q p , a p j j q “ δ p j q p pp S, y q , a j q “ " p R, y ` q if I ď y ă I ` P ´ p R, I q if y “ I ` P ´ , where, by Equation (4), R “ f p S, a j q Y ď p r,b q p “ r ` ψ p b q f p π p δ p j q r p s p ,j q r , a y ` j qq , b q . (9)Let r P H j with p “ r ` ψ p b q for some b P Σ , and p P H j the point from thestatement of this Proposition. Then, as the period of A p j q r divides P , and y is greater than or equal to the index of A p j q r , we have δ p j q r p s p ,j q r , a p j ´ j q “ δ p j q r p s p ,j q r , a yj q . So δ p j q r p s p ,j q r , a p j j q “ δ p j q r p s p ,j q r , a y ` j q . Hence, comparing Equation (9) withEquation (8), we find that they are equal, and so R “ T . [\ Let σ : N Ñ P p Q q be a state label map and ψ : Σ ˚ Ñ N k bethe Parikh map. Suppose for every j P t , . . . , k u and p P H j the automata A p j q p “ pt a j u , Q p j q p , δ p j q p , s p ,j q p , F p j q p q from Definition 4 have a bounded number ofstates , i.e., | Q p j q p | ď N for some N ě independent of p and j . Then for F Ď P p Q q the commutative language ψ ´ p σ ´ p F qq is regular and could be accepted by an automaton of size ś kj “ p I j ` P j q , where I j denotes the largest index among the unary automata t A p j q p | p P H j u and P j the least common multiple of all the periods of these automata. In particular,by the relations of the index and period to the states from Section 2.1, the statecomplexity of ψ ´ p σ ´ p F qq is bounded by N k . Equivalently, the index and period is bounded, which is equivalent with just a finitenumber of distinct automata, up to semi-automaton isomorphism. We call two semi-automata isomorphic if one semi-automaton can be obtained from the other one byrenaming states and alphabet symbols.IBLIOGRAPHY 21
Proof.
We use the same notation as introduced in the statement of the theorem.Let p “ p p , . . . , p k q P N k and j P t , . . . k u . Denote by σ : N k Ñ P p Q q the statelabel function from Definition 2. By Proposition 1, if p j ě I j , we have σ p p , . . . , p j ´ , p j ` P j , p j ` , . . . , p k q “ σ p p , . . . , p k q . (10)Construct the unary semi-automaton A j “ pt a j u , Q j , δ j q with Q j “ t s p j q , s p j q , . . . , s p j q I j ` P j ´ u ,δ j p s p j q i , a j q “ s p j q i ` if i ă I j s p j q I j `p i ´ I j ` q mod P j if i ě I j . Then build C “ p Σ, Q ˆ . . . ˆ Q k , µ, s , E q with s “ p s p q , . . . , s p k q q ,µ pp t , . . . , t k q , a j q “ p t , . . . , t j ´ , δ j p t j , a j q , t j ` , . . . , t k q for all 1 ď j ď k,E “ t µ p s , u q : σ p ψ p u qq P F u . By construction, for words u, v P Σ with u P perm p v q we have µ pp t , . . . , t k q , u q “ µ pp t , . . . , t k q , v q for any state p t , . . . , t k q P Q ˆ . . . Q k . Hence, the languageaccepted by C is commutative. We will show that L p C q “ t u P Σ ˚ | σ p ψ p u qq P F u .By choice of E we have t u P Σ ˚ | σ p ψ p u qq P F u Ď L p C q . Conversely, suppose w P L p C q . Then µ p s , w q “ µ p s , u q for some u P Σ ˚ with σ p ψ p u qq P F . Next,we will argue that we can find w P L p C q and u P Σ ˚ with σ p ψ p u qq P F , µ p s , w q “ µ p s , w q “ µ p s , u q “ µ p s , u q and max t| w | a j , | u | a j u ă I j ` P j forall j P t , . . . , k u .(i) By construction of C , if | w | a j ě I j ` P j , we can find w with | w | a j “ | w | a j ´ P j such that µ p s , w q “ µ p s , w q . So, applying this procedure repeatedly, wecan find w P Σ ˚ with | w | a j ă I j ` P j for all j P t , . . . , k u and µ p s , w q “ µ p s , w q .(ii) If | u | a j ě I j ` P j , by Equation (10), we can find u with | u | a j “ | u | a j ´ P j and σ p ψ p u qq P F . By construction of C , we have µ p s , u q “ µ p s , u q . So, afterrepeatedly applying the above steps, we find u P Σ ˚ with σ p ψ p u qq P F , µ p s , u q “ µ p s , u q and | u | a j ă I j ` P j for all j P t , . . . , k u .By construction of C , for words u, v P Σ ˚ with max t| u | a j , | v | a j u ă I j ` P j for all j P t , . . . , k u , we have µ p s , u q “ µ p s , v q ô u P perm p v q ô ψ p u q “ ψ p v q . (11)Hence, using Equation (11) for the words w and u from (i) and (ii) above, as µ p s , u q “ µ p s , w q , we find ψ p u q “ ψ p w q . So σ p ψ p w qq “ σ p ψ p u qq P F . Now,again using Equation (10), this gives σ p ψ p w qq P F . [\ The term semi-automaton is used for automata without a designated initial state,nor a set of final states.2 S. Hoffmann
Let A “ p Σ, Q, δ q be a semi-automaton and suppose the state labelmap σ : N k Ñ P p Q q is compatible with A . Let p, q P N k with q ă p , then δ p σ p q q , w q Ď σ p p q for each w P Σ ˚ with p “ ψ p w q ` q .Proof. Let w P Σ ˚ with p “ ψ p w q ` q . Set n “ | w | . As q ă p we have 1 ď n ď p ` . . . ` p k . Hence, by Lemma 1, f p σ p q q , w q Ď σ p p q . As the state label map iscompatible with A , we have δ p σ p q q , w q Ď f p σ p q q , w q . [\ Let A “ p Σ, Q, δ, s , F q be a permutation automaton and σ : N k Ñ P p Q q a state map compatible with A . Then for every automaton A p j q p fromDefinition 4 its index equals at most p| Q | ´ q L j and its period is divided by L j ,where L j denotes the order of the letter a j viewed as a permutation of Q , i.e., δ p q, a L j j q “ q for any q P Q and L j is minimal with this property.Proof. It might be helpful for the reader to have some idea of how the symmetricgroup (or any permutation group) acts on subsets of its permutation domain,see for example [3] for further information. We also say that the letter a j acts (oroperates) on a subset S Ď Q , the action being given by the transition function δ : Q ˆ Σ Ñ Q , where δ p S, a j q is the result of the action of a j on S . Set P “ t A p j q q | p “ q ` ψ p b q for some b P Σ u . Denote by I the maximal index and by P the least common multiple of theperiods of the unary automata in P .First the case P “ H , which is equivalent with p “ p , . . . , q . In this case, I “ , P “ Q p j q p “ P p Q q ˆ t u and Equation (3) reduces to δ p j q p pp S, q , a j q “ p f p S, a j q , q for S Ď Q . As the state label map is compatible with A , we have δ p S, a j q Ď f p S, a j q . So, as a j permutes the states Q , if | S | “ | f p S, a nj q| for n ě
0, then f p S, a nj q “ δ p S, a nj q . As for each S Ď Q we have δ p S, a L j j q “ S , if | f p S, a nj q| “ | S | ,which gives f p S, a nj q “ δ p S, a nj q , we find 0 ď m ă L j with f p S, a mj q “ f p S, a nj q .Let R “ t n ą | f p σ p p q , a n ´ j q| ă | f p σ p p q , a nj q|u . If R “ H , then f does not add any states as symbols are read, and the automa-ton A p j q p is essentially the action of a j starting on the set σ p p q , i.e., the orbit t σ p p q , δ p σ p p q , a j q , δ p σ p p q , a j q , . . . u . Hence we have index zero and some perioddividing L j , as the letter a j is a permutations of order L j on Q . If R ‰ H ,then R is finite, as the sets could not grow indefinitely. Let m “ | R | and write R “ t n i | i P t , . . . , m uu with n i ă n i ` for i P t , . . . , m ´ u , i.e., the se-quence orders the elements from R . We have n i ` ´ n i ď L j and n ď L j , forif n i ď k ă n i ` (or k ă n ), then with S “ f p σ p p q , a n i j q (or S “ σ p p qq ), asargued previously, we find f p S, a kj q “ δ p S, a kj q . Assuming n i ` ´ n i ą L j (orsimilarly n ą L j ) would then yield f p S, a L j j q “ S , and so for every k ě n i , IBLIOGRAPHY 23 writing k “ qL j ` r , we have f p S, a kj q “ f p S, a rj q and the cardinalities couldnot grow anymore, i.e., we would be stuck in a cycle. So by definition of R , | σ p p q| ă | f p σ p p q , a n j | ă . . . ă | f p σ p p q , a n m j | ď | Q | . This gives m ď | Q | ´ | σ p p q| .By choice, for n ě n m we have | f p σ p p q , a n m j q| “ | f p σ p p q , a nj q| . Hence it is againjust the action of a j starting on the subset f p σ p p q , a n m j q . So we are in the cycle,and the period of A p j q p divides L j , as the operation of A p j q p could be identified withthe function f : P p Q q ˆ Σ Ñ P p Q q for p “ p , . . . , q . Note that n m is preciselythe index of A p j q p , and by the previous considerations n m ď p| Q | ´ | σ p p q|q L j .So, now suppose P ‰ H . We split the proof into several steps. Note thatthe statements (ii), (iii), (iv), (v) written below are also proven by the aboveconsiderations for the case P “ H . Hence, we can argue inductively in theirproofs. Let S, T Ď Q .(i) Claim: If p T, y q “ δ p j q p pp S, x q , a rj q for some r ě
0, then | T | ě | S | . In particular,the state labels of cycle states all have the same cardinality.Proof of Claim (i): By Equation (4), f p S, a j q Ď π p δ p j q p pp S, x q , a j qq . As thestate label map is compatible with A , we have δ p S, a j q Ď f p S, a j q , andas a j is a permutation on the states, we have | S | “ | δ p S, a j q| . Hence | S | ď| π p δ p j q p pp S, x q , a j qq| , which gives the claim inductively. As states on the cyclecould be mapped to each other, the state labels from cycle states all havethe same cardinality.(ii) Claim: Let L S “ lcm t|t δ p s, a ij q : i ě u| : s P S u , i.e. the least commonmultiple of the orbit lengths of all elements in S . For x ě I and p T, y q “ δ p j q p pp S, x q , a lcm p P,L S q j q , if | T | “ | S | , then p T, y q “ p
S, x q . So, by Lemma 4,the period of A p j q p divides lcm p P, L S q .Proof of Claim (ii): From Equation (4) of Definition 4 and the fact that thestate map is compatible with A , we get inductively δ p S, a ij q Ď f p S, a ij q Ď π p δ p j q p pp S, x q , a ij qq for all i ě
0. So, as δ p s, a L S j q “ s for all s P S , this gives S Ď T . Hence, as | S | “ | T | , we get S “ T . Furthermore, as x ě I i , byEquation (3) of Definition 4, as P divides lcm p P, L S q , we have x “ y . ByLemma 4, this implies that the period of A p j q p divides lcm p P, L S q . [\ (iii) Claim: With the notation from (ii), the number lcm p P, L S q divides L j andthe period of A p j q p divides L j .Proof of Claim (iii): With the notation from (ii), as L j “ lcm t| δ p q, a ij q : i ě u| : q P Q u , L S divides L j . Inductively, the periods of all unary automatain P divide L j . So, as P is the least common multiple of these periods, also P divides L j . Hence lcm p P, L S q divides L j . So, with Claim (ii), the periodof A p j q p divides L j . For a permutation π : r n s Ñ r n s on a finite set r n s and m P r n s , the orbit lengthof m under the permutation π is |t π i p m q : i ě u| . In [14], the orbit length of anelement is also called the cycle length of that element, as it is precisely the size ofthe unique cycle in which the element m appears with respect to the permutation.4 S. Hoffmann (iv) Claim: For x ě I and p T, y q “ δ p j q p pp S, x q , a L j j q , if | T | “ | S | , then p T, y q “p
S, x q .Proof of Claim (iv): With the notation from (ii) and Claim (iii), we canwrite L j “ m ¨ lcm p P, L j q for some natural number m ě
1. Set p R, z q “ δ p j q p pp S, x q , a lcm p P,L S q j q . By (i), we have | S | ď | R | ď | T | . By assumption | S | “| T | , hence | S | “ | R | . So, we can apply (ii), which yields p R, z q “ p
S, x q .Applying this repeatedly m times gives p T, y q “ p
S, x q .(v) Claim: If T is the state label of any cycle state of A p j q p , then the index of A p j q p is bounded by p| T | ´ q L j .Proof of Claim (v): We define a sequence p T n , y n q P Q p j q p of states for n P N .Set p T , y q “ δ p j q p p s p ,j q p , a Ij q , which implies y “ I by Equation (3), and p T n , y n q “ δ p j q p pp T n ´ , y n ´ q , a L j j q for n ą
0. Note that, as P divides L j , by Equation (3), we have y n “ I forall n ě p T, x q P Q p j q p be some state from the cycle of A p j q p . Then thestate p T | T |´| T | , y | T |´| T | q “ δ p j q p p s p ,j q p , a I `p| T |´| T |q L j j q is also from the cycleof A p j q p .By construction, and Equation (3) from Definition 4, we have y n ě I forall n . If T n ` ‰ T n , then, by (iv) and (i), we have | T n ` | ą | T n | (remember y n “ y n ` “ I ). Hence , by finiteness, we must have a smallest m such that T m ` “ T m . As also y m ` “ y m , we are on the cycle of A p j q p , and the periodof this automaton divides L j by (iv). This yields p T n , y n q “ p T m , y m q for all n ě m . By (i), the size of the state label sets on the cycle stays constant,and just grows before we enter the cycle. As we could add at most | T m |´ | T | elements, and for T , T , . . . , T m each time at least one element is added, wehave, as m was chosen minimal, that m ď | T | ´ | T | , where T is any statelabel on the cycle, which all have the same cardinality | T | “ | T m | by (i).This means we could read at most | T | ´ | T | times the sequence a L j j , startingfrom p T , I q , before we enter the cycle of A p i q p .Claim 2: We have I ď p| T | ´ q L j .Remember, the case P “ H was already handled, for then p “ p , . . . , q and I “
0. Otherwise, let A p j q q P P with p “ q ` ψ p b q for b P Σ . Let p S, x q “ δ p j q q p s p ,j q q , a nj q with n ě
0. If n ą
0, by Equation (4) from Definition4, we have, with p R, z q “ δ p j q p p s p ,j q p , a n ´ j q , π p δ p j q p p s p ,j q p , a nj qq “ π p δ p j q p pp R, z q , a j qq“ f p R, a j q Y ď p r,a qP N k ˆ Σp “ r ` ψ p a q f p π p δ p j q r p s p ,j q r , a nj qq , a q . Also, as T n “ δ p T n , a L j J q Ď f p T n , a L j j q Ď π p δ p j q p pp T n , I q , a L j j qq , we find T n Ď T n ` .IBLIOGRAPHY 25 If n “
0, we have π p δ p j q p p s p ,j q p , a nj qq “ π pp σ p p q , qq “ σ p p q . In the latter case, also S “ π p δ p j q q p s p ,j q q , a j qq “ σ p q q and, as p ‰ p , . . . q (which is equivalent to P ‰ H ), by Equation (1) and as the state label mapis compatible with A , we have δ p S, b q Ď f p S, b q Ď σ p p q . In the former case n ą δ p S, b q Ď f p S, b q Ď ď p r,a qP N k ˆ Σp “ r ` ψ p a q f p π p δ p j q r p s p ,j q r , a nj qq , a q So, in any case, δ p S, b q Ď π p δ p j q p p s p ,j q p , a nj qq . In particular for n “ I weget δ p S, b q Ď T , and as b induces a permutation on the states, this gives | S | ď | T | . Also for n ě I , we are on the cycle of A p j q q . Hence, inductively,the index of A p j q q is at most p| S | ´ q L j ď p| T | ´ q L j . As A p j q q P P waschosen arbitrary, we get I ď p| T | ´ q L j .With Claim (2) above, we can derive the upper bound p| T | ´ q L j for thelength of the word a I `p| T |´| T |q j from Claim (1), as I ` p| T | ´ | T |q L j ď p| T | ´ q L j ` p| T | ´ | T |q L j “ p| T | ´ q L j . And as Claim (1) essentially says that the index of A p j q p is smaller than I ` p| T | ` | T |q L j , this gives Claim (v). Also, as | T | ď | Q | , the claim aboutthe index of the statement in Proposition 2 is proven. So, in total, (iii) and(v) give Proposition 2. [\ Let p P N k and A “ p Σ, Q A , δ A , s A , F A q , B “ p Σ, Q B , δ B , s B , F B q be finite automata with disjoint state sets. Denote by σ A , B : N k Ñ P p Q A Y Q B q the state label map from Definition 5. If for all q P N k with q ď p we have σ A , B p q q X F A “ H , then σ A , B p p q X Q B “ H .Proof. For p “ p , . . . , q the claim follows by Definition 5. Suppose p ‰ p , . . . , q .Then σ A , B p p q “ ď p “ q ` ψ p b q f p σ A , B p q q , b q . By assumption σ A , B p p q X F A “ H . Hence, for q P N k and b P Σ with p “ q ` ψ p b q , we have f p σ A , B p q q , b qX F A “ H . By Definition 5, δ A p σ A , B p q qX Q A , b q Ď f p σ A , B p q q , b q , so that δ A p σ A , B p q q X Q A , b q X F A “ H . Again, by Definition 5,then f p σ A , B p q q , b q “ δ A p σ A , B p q q X Q A , b q Y δ B p σ A , B p q q X Q B , b q Inductively, we can assume σ A , B p q q X Q B “ H . So the above set equals δ A p σ A , B p q q X Q A , b q , which is contained in Q A . Hence, as this holds for any q P N k and b P Σ with p “ q ` ψ p b q , we have σ A , B p p q “ ď p “ q ` ψ p b q f p σ A , B p q q , b q Ď Q A which is equivalent with σ A , B p p q X Q B “ H . [\ Suppose we have finite automata A “ p Σ, Q A , δ A , s A , F A q and B “ p Σ, Q B , δ B , s B , F B q with Q A X Q B “ H . Then ψ p L p A q L p B qq “ σ ´ A , B pt S Ď Q A Y Q B | S X F B ‰ Huq . Proof.
By assumption Q A X Q B “ H . Set Q “ Q A Y Q B . Construct the semi-automaton C “ p Σ, Q, δ q with δ p q, x q “ " δ A p q, x q if q P Q A ; δ B p q, x q if q P Q B . Then δ p S, a q “ δ A p S X Q A , a q Y δ B p S X Q B , a q for each S Ď Q . Let f : P p Q q ˆ Σ Ñ P p Q q be the function from Definition 5 and σ A , B : N k Ñ P p Q q thecorresponding state label map. Then, for each S Ď Q A Y Q B and a P Σ , we have δ p S, a q Ď f p S, a q by Equation (5), i.e., the semi-automaton C is compatible withthe state label map.(i) First, let p P ψ p L p A q L p B qq . Then p “ ψ p u q ` ψ p v q with u P L p A q and v P L p B q . By Lemma 2, δ p σ A , B p , . . . , q , u q Ď σ A , B p ψ p u qq . By Definition 5, t s A u Ď σ A , B p , . . . , q . As u P L p A q , we have δ A p s A , u q P F A . We will show thatthis implies t s B u Ď σ A , B p ψ p u qq .Claim: t s B u Ď σ A , B p ψ p u qq for u P L p A q . Proof of the claim. If | u | “
0, then s A P F A . Hence, by Definition 5, t s A , s B u “ σ A , B p , . . . , q “ σ A , B p ψ p u qq . Otherwise, write u “ wa forsome a P Σ , w P Σ ˚ and set S “ f p σ A , B p , . . . , q , w q . So, f p σ A , B p , . . . , q , u q “ f p S, a q by the extension of f : P p Q q ˆ Σ Ñ P p Q q to words. As C is compatiblewith σ A , B , we find δ p σ A , B p , . . . , q , w q Ď S. As t s A u Ď σ A , B p , . . . , q , this gives, by construction of C , then δ A pt s A u , w q Ď S . Hence, δ A p S X Q A , a q X F A ‰ H . But then, by Equation (5), f p S, a q “ δ p S, a q Y t s B u . By Lemma 1, and as ψ p u q “ q ` ψ p w q for | u | “ | w | implies q “ p , . . . , q , σ A , B p ψ p u qq “ ď p q,w qP N k ˆ Σ | u | ψ p u q“ q ` ψ p w q f p σ A , B p , . . . , q , w q . Hence f p S, a q “ f p σ A , B p , . . . , q , u q Ď σ A , B p ψ p u qq and we can deduce t s B u Ď σ A , B p ψ p u qq . [\ IBLIOGRAPHY 27
Using Lemma 1, we find f p σ A , B p ψ p u qq , v q Ď σ A , B p ψ p u q ` ψ p v qq . As δ B pt s B u , v q Ď δ B p σ A , B p ψ p u qq X Q B , v q Ď δ p σ A , B p ψ p u qq , v q Ď f p σ A , B p ψ p u qq , v q and δ B p s B , v q P F B , we find σ A , B p p q X F B ‰ H . This shows ψ p L p A q L p B qq Ď σ ´ A , B pt S Ď Q A Y Q B | S X F B ‰ Huq .(ii) Conversely, assume F B X σ A , B p p q ‰ H .Claim: For each S Ď Q and w P Σ ˚ f p S, w q X Q A “ δ A p S X Q A , w q . (12) Proof of the claim. If | w | “
0, then f p S, w qX Q A “ S X Q A “ δ p S X Q A , w q by definition of the extension of f and the transition function to words.Otherwise, write w “ w a with w P Σ ˚ and a P Σ . Then f p S, w a q “ f p f p S, w q , a q . By Equation (5), in either case δ A p f p S, w qX Q A , a qX F A ‰H or δ A p f p S, w q X Q A , a q X F A “ H , we have f p f p S, w q , a q X Q A “ δ A p f p S, w q X Q A , a q . Inductively, f p S, w qX Q A “ δ A p S X Q A , w q , so that f p S, w q “ δ A p f p S, w qX Q A , a q “ δ A p δ A p S X Q a , w q , a q “ δ A p S X Q A , w q . [\ Then Lemma 1 and Equation (12) give, for any q P N k , σ A , B p q q X Q A “ ¨˝ ď ψ p w q“ q f p σ A , B p , . . . , q , w q ˛‚ X Q A “ ď ψ p w q“ q p f p σ A , B p , . . . , q , w q X Q A q“ ď ψ p w q“ q δ A p σ A , B p , . . . , q X Q A , w q . By Lemma 9, as σ A , B p p q X F B ‰ H , we have some v P L p B q and q P N k with p “ q ` ψ p v q and σ A , B p q q X F A ‰ H . By the above equations, we find w P Σ ˚ with ψ p w q “ q and δ A p σ A , B p , . . . , q X Q A , w q X F A ‰ H . As, by Equation (5), σ A , B p , . . . , q X Q A “ t s A u , this gives w P L p A q . So, we have p “ ψ p w q ` ψ p v q with w P L p A q and v P L p B q . This yields p P ψ p L p A q L p B qq . [\ Let A “ p Σ, Q A , δ A , s A , F A q and B “ p Σ, Q B , δ B , s B , F B q be finitepermutation automata. Suppose L j and K j denote the order of the letter a j viewed as a permutation on Q A and Q B respectively, then sc p perm p L p A qq (cid:1) perm p L p B qqq ď p Q A ` Q B q k k ź j “ lcm p L j , K j q . Proof.
We can assume Q A X Q B “ H . Set Q “ Q A Y Q B . Construct the semi-automaton C “ p Σ, Q, δ q with δ p q, x q “ " δ A p q, x q if q P Q A ; δ B p q, x q if q P Q B . Let f : P p Q q ˆ Σ Ñ P p Q q be the function from Definition 5 and σ A , B : N k Ñ P p Q q the corresponding state label map. Then, for each S Ď Q A Y Q B and a P Σ , we have δ p S, a q Ď f p S, a q by Equation (5), i.e., the semi-automaton C is compatible with the state label map. The automaton C is a permutationsemi-automaton, and each letter a j P Σ has order lcm p L j , K j q , viewed as apermutation on Q A Y Q B . By Proposition 2, the automata A p j q p from Definition 4have index at most p| Q A Y Q B | ´ q lcm p L j , K j q and period at most lcm p L j , K j q .Hence, using Theorem 3, the language ψ ´ p σ A , B p F qq with F “ t S Ď Q A Y Q B | S X F B ‰ Hu is accepted by an automaton of size at most k ź j “ ˆ p| Q A Y Q B | ´ q lcm p L j , K j q ` lcm p L j , K j q ˙ . By Corollary 3, the result follows. [\ Let Σ “ t a , . . . , a k u . For commutative group languages U, V Ď Σ ˚ with period vectors p p , . . . , p k q and p q , . . . , q k q their shuffle U (cid:1) V has indexvector p i , . . . , i k q with i j “ lcm p p j , q j q ´ for j P t , . . . , k u and period vector p gcd p p , q q , . . . , gcd p p k , q k qq . Hence sc p U (cid:1) V q ď k ź j “ p gcd p p j , q j q ` lcm p p j , q j q ´ q . And this bound is sharp, i.e., there exist commutative group languages such thata minimal automaton accepting their shuffle reaches the bound.Proof.
Write U “ n ď l “ U p l q (cid:1) . . . (cid:1) U p l q k V “ m ď h “ V p h q (cid:1) . . . (cid:1) V p h q k with, for j P t , . . . , k u , unary automata A j “ pt a j u , Q j , δ j , s j , F j q and B j “pt a j u , P j , µ j , t j , E j q , F j “ t f p l q j | l P t , . . . , n uu and E j “ t e p h q j | h P t , . . . , m uu ,with indices zero and periods p j and q j respectively, according to Lemma 5. Let C j “ pt a j u , R j , η j , r j , T j q with T j “ Ť nl “ Ť mh “ T p l,h q j be automata according toLemma 6 such that t u | η j p r j , u q P T p l,h q j u “ U p l q j ¨ V p h q j (13) IBLIOGRAPHY 29 for l P t , . . . , n u and h P t , . . . , m u . Hence, the indices and periods of theseautomata, as stated in Lemma 6, are precisely lcm p p j , q j q ´ p p j , q j q .Define C “ p Σ, R ˆ . . . ˆ R k , η, p r , . . . , r k q , T q with T “ n ď l “ m ď h “ T p l,h q ˆ . . . ˆ T p l,h q k and transition function δ pp r , . . . , r j , . . . , r k q , a j q “ p r , . . . , δ j p r j , a j q , . . . , r k q for p r , . . . , r j , . . . , r k q P R ˆ . . . ˆ R k . By construction of C and Equation (13), wehave δ p u, p r , . . . , r k qq P T p l,h q ˆ . . . ˆ T p l,h q k ô u P p U p l q V p h q q (cid:1) . . . (cid:1) p U p l q k V p h q k q for l P t , . . . , n u and h P t , . . . , m u . Hence L p C q “ n ď l “ m ď h “ p U p l q V p h q q (cid:1) . . . (cid:1) p U p l q k V p h q k q“ n ď l “ m ď h “ U p l q (cid:1) . . . (cid:1) U p l q k (cid:1) V p l q (cid:1) . . . (cid:1) V p l q k “ ˜ n ď l “ U p l q (cid:1) . . . (cid:1) U p l q k ¸ (cid:1) ˜ m ď h “ V p l q (cid:1) . . . (cid:1) V p l q k ¸ “ U (cid:1) V as the shuffle operation is commutative and distributive over union and for unarylanguages shuffle and concatenation are the same operations. Now, we show thatthe bound is sharp. Let p, q be two distinct prime numbers. Then, every numbergreater than p ¨ q ´ p p ` q q ` ap ` bq with a, b ě pq ´ p p ` q q could notbe written in that way; see [20]. Set V j “ a p ´ j p a pj q ˚ , W j “ a q ´ j p a qj q ˚ and U j “ t a p ` q ´ ` ap ` bqj | a, b ě u “ V j W j . Thensc p V (cid:1) . . . (cid:1) V k q “ p k . For, the permutation automaton C “ p Σ, r p s k , δ, p , . . . , q , tp p ´ , . . . , p ´ quq with δ pp i , . . . , i j ´ , i j , i j ` , . . . , i k q , a j q “ p i , . . . , i j ´ , p i j ` q mod p, i j ` , . . . , i k q accepts V (cid:1) . . . (cid:1) V k , and it is easy to see that if a language is accepted by apermutation automaton with a single final state, then this automaton is minimal.Similarly, sc p W (cid:1) . . . (cid:1) W k q “ q k .Set n j “ pq ´ j P t , . . . , k u . Then the language L “ U (cid:1) . . . (cid:1) U k “ p V W q (cid:1) . . . (cid:1) p W W k q“ p V (cid:1) . . . (cid:1) V k q (cid:1) p W (cid:1) . . . (cid:1) W K q . fulfills the prerequisites of Lemma 7 with p n , . . . , n k q , as for each j P t , . . . k u we have a pq ´ j R U j and a pq ´ j a ˚ j Ď U j . Hence,sc p L q “ p pq q | Σ | “ p gcd p p, q q ` lcm p p, q q ´ q | Σ | and the bound given by the statement is attained. [\ Let Σ “ t a , . . . , a k u and A “ p Σ, Q, δ, s , F q be a finite au-tomaton. For the state-label function from Definition 6 we have σ A , ` p p q “ " A p Y B p if p A p Y B p q X F “ H ; A p Y B p Y t s u otherwise;where A p “ t δ p s , w q | ψ p w q “ p u and B p “ t δ p s , w q | D q P N k : q ă p and q ` ψ p w q “ p and σ A , ` p q q X F ‰ Hu .Proof. For p “ p , . . . , q the statement is clear. If p ‰ p , . . . , q , then by defini-tion σ A , ` p p q “ ď p q,b q p “ q ` ψ p b q f p σ A , ` p q q , b q . (14)For q with p “ q ` ψ p b q for some b P Σ set A q “t δ p s , w q | ψ p w q “ q u B q “t δ p s , w q | D r P N k : r ă q and r ` ψ p w q “ q and σ A , ` p r q X F ‰ Hu . Inductively, σ A , ` p q q “ " A q Y B q if p A q X B q q X F “ H ,A q Y B q Y t s u otherwise.Hence, using Definition 6, f p σ A , ` p q q , b q equals $’&’% δ p A q Y B q , b q if p A q Y B q q X F “ H , δ p A q Y B q , b q X F “ H ,δ p A q Y B q , b q Y t s u if p A q Y B q q X F “ H , δ p A q Y B q , b q X F ‰ H δ p A q Y B q Y t s u , b q if p A q Y B q q X F ‰ H , δ p A q Y B q Y t s u , b q X F “ H ,δ p A q Y B q Y t s u , b q Y t s u if p A q Y B q q X F ‰ H , δ p A q Y B q Y t s u , b q X F ‰ H . (15)Under the induction hypothesis, i.e., that the formula holds true for q ă p ,in particular if p “ q ` ψ p b q for some b P Σ , we prove various claims that we useto derive our final formula.Claim 1: For q P N k with p “ q ` ψ p b q for some b P Σ we have p A q Y B q q X F ‰ H ô σ A , ` p q q X F ‰ H . Proof of the claim. If p A q Y B q q X F ‰ H , then σ A , ˚ p q q X F ‰ H byinduction hypothesis. If σ A , ˚ p q q X F ‰ H , assume p A q Y B q q X F “ H .Then, using inductively that the formula holds true for q , this gives σ A , ` p q q “ A q Y B q , which implies p A q Y B q q X F ‰ H . Hence, this isnot possible and we must have p A q Y B q q X F ‰ H . [\ IBLIOGRAPHY 31
Claim 2: We have A p “ ď p q,b q p “ q ` ψ p b q δ p A q , b q ,B p “ ď p q,b q p “ q ` ψ p b q δ p B q , b q Y ď p q,b q p “ q ` ψ p b q σ A , ` p q qX F ‰H δ pt s u , b q . Proof of the claim.
The first equation is obvious. For the other, first let δ p s , w q P B p for some w P Σ ˚ . Then, we have r P N k such that r ă p, r ` ψ p w q “ p, and σ A , ` p r q X F ‰ H . Write w “ ub with b P Σ (note that by definition of the sets B p wehave | w | ą r ă p ´ ψ p b q , then δ p s , u q P B p ´ ψ p b q and so δ p s , w q P δ p B p ´ ψ p b q , b q . Otherwise r “ p ´ ψ p b q , which implies u “ ε and w “ b . In this case, δ p s , b q P ď p q,b q p “ q ` ψ p b q σ A , ` p q qX F ‰H δ pt s u , b q . Hence, B p is included in the set on the right hand side. The inclusion ofthe other two sets in B p is obvious. [\ Claim 3: We have p A p Y B p q X F ‰ H if and only if there exists q P N k and b P Σ ˚ with p “ q ` ψ p b q such that at least one of the conditions is fulfilled:(1) p A q Y B q q X F “ H and δ p A q Y B q , b q X F ‰ H ,(2) p A q Y B q q X F ‰ H and δ p A q Y B q Y t s u , b q X F ‰ H . Proof of the claim.
Assume p A p Y B p q X F ‰ H . We distinguish the twocases A p X F ‰ H or B p X F ‰ H . First, suppose A p X F ‰ H . By Claim(2) then δ p A q , b q X F ‰ H for some q P N k and b P Σ with p “ q ` ψ p b q .As δ p A q , b q Ď δ p A q Y B q , b q Ď δ p A q Y B q Y t s u , b q , both conditions (1)and (2) are fulfilled. Now, suppose B p X F ‰ H . Using Claim (2), wehave two cases.1. It is δ p B q , b q X F ‰ H for some q P N and b P Σ with p “ q ` ψ p b q .As δ p B q , b q Ď δ p A q Y B q , b q Ď δ p A q Y B q Y t s u , b q , both conditions(1) and (2) are fulfilled.2. We find, also using Claim (1), some q P N k and b P Σ with p “ q ` ψ p b q and p A q Y B q q X F ‰ H such that δ p s , b q P F .Then condition (2) is fulfilled.Conversely, assume condition (1) is fulfilled. Then, by Claim (2), we have A p X F ‰ H or B p X F ‰ H . Otherwise, assume condition (2) is fulfilled.If δ p A q Y B q , b q X F ‰ H , we have p A p Y B p q X F ‰ H as before. So,assume δ p A q Y B q , b q X F “ H . But then, we must have δ p s , b q P F ,using Claim (2), which gives, as p A q Y B q q X F ‰ H and using Claim(1) and Claim (2), that δ p s , b q P B p , hence B p X F ‰ H . [\ First, assume p A p Y B p q X F “ H . Then, by Equation (15) together with Claim(3) and Equation (14), σ A , ` p p q “ ď p q,b q p “ q ` ψ p b q f p σ A , ` p q q , b q“ ď p q,b q p “ q ` ψ p b q δ p A q Y B q , b q Y ď p q,b q p “ q ` ψ p b qp A q X B q qX F ‰H δ pt s u , b q . By Claim (1) and Claim (2), we get σ A , ` p p q “ A p Y B q . Otherwise, if p A p Y B p q X F ‰ H , by Equation (15) together with Claim (3) and Equation (14), σ A , ` p p q “ ď p q,b q p “ q ` ψ p b q f p σ A , ` p q q , b q“ t s u Y ď p q,b q p “ q ` ψ p b q δ p A q Y B q , b q Y ď p q,b q p “ q ` ψ p b qp A q X B q qX F ‰H δ pt s u , b q . As above, this equals t s u Y A p Y B p . [\ Let A “ p Σ, Q, δ, s , F q be a finite automaton. Then ψ p L p A q ˚ q “ σ ´ A , ` pt S Ď Q | S X F ‰ Huq Y tp , . . . , qu . Proof.
First suppose p P ψ p L p A q ˚ q . Then either p “ p , . . . , q or we find p , . . . , p n with n ą p “ p ` . . . ` p n and words w , . . . , w n with p i “ ψ p w i q and w i P L p A q for i P t , . . . , n u . If p ‰ p , . . . , q , then we can assume w i ‰ ε for i P t , . . . , n u , which is equivalent with p i ‰ p , . . . , q . Note that, with thenotation from Proposition 4, for any p P N k σ A , ` p p q X F ‰ H ô p A p Y B p q X F ‰ H . (16)For if σ A , ` p p qX F “ H then obviously p A p Y B p qX F “ H . And if p A p Y B p qX F “H holds true, then σ A , ` p p q “ A p Y B p . So, σ A , ` p p qX F ‰ H implies s P σ A , ` p p q .Claim: For i P t , . . . , n u we have σ A , ` p p ` . . . ` p i q X F ‰ H . Proof of the claim. As w P L p A q and for every w P Σ ˚ by Defini-tion 6 and Lemma 1 we have δ p s , w q P f pt s u , w q Ď σ A , ` p ψ p w qq , we get δ p s , w q P σ A , ` p p q . Hence σ A , ` p p q X F ‰ H as δ p s , w q P F . Now,suppose inductively that for i P t , . . . , n ´ u we have σ A , ` p p ` . . . ` p i q X F ‰ H . By Equation (16) and the remarks thereafter, s P σ A , ` p p ` . . . ` p i q . ByDefinition 6 and Lemma 1 then, as p ` . . . p i ` “ p ` . . . p i ` ψ p w i ` q , δ p s , w i ` q P δ p σ A , ` p p ` . . . ` p i q , w i ` qĎ f p σ A , ` p p ` . . . ` p i q , w i ` q [Definition 6] Ď σ A , ` p p ` . . . ` p i ` p i ` q . [Lemma 1] IBLIOGRAPHY 33 As δ p s , w i ` q P F we find σ A , ` p p ` . . . ` p i ` p i ` q X F ‰ H . [\ With the above claim, for i “ n , we find σ A , ` p p q X F ‰ H .Conversely, assume σ A , ` p p q X F ‰ H or p “ p , . . . , q . In the latter case wehave p P ψ p L p A q ˚ q by definition of the star operation. Hence, assume the formerholds true. If p P ψ p L p A qq Ď ψ p L p A q ˚ q we have nothing to prove. So, assume p R ψ p L p A qq . Then, we claim the next.Claim: There exists q P N k with q ă p such that p “ q ` ψ p w q for some w P L p A q and σ A , ` p q q X F ‰ H . Proof of the claim. As p R ψ p L p A qq , we have t δ p s , w q | ψ p w q “ p u X F “ H . Set B q “ t δ p s , w q | D q P N k : q ă p, ψ p w q ` q “ p, σ A , ` p q q X F ‰ Hu . Assume B p X F “ H , then by Proposition 4 this implies σ A , ` p p q “t δ p s , w q | ψ p w q “ p u Y B p . But then, as σ A , ` p p q X F ‰ H , this is notpossible and we must have B p X F ‰ H , which gives the claim. [\ By the above claim, choose q P N k with q ă p and p “ q ` ψ p w q for some w P L p A q and σ A , ` p q q X F ‰ H . By induction hypothesis, we find u P L p A q ˚ with ψ p u q “ q . Then p “ ψ p u q ` ψ p w q “ ψ p uw q and we have uw P L p A q ˚ , i.e. p P ψ p L p A q ˚ q . [\ Let A “ p Σ, Q, δ, s , F q be a permutation automaton. Then perm p L p A q ˚ q “ perm p L p A qq (cid:1) , ˚ is regular and sc p perm p L p A qq (cid:1) , ˚ q ď ´ | Q | k ś kj “ L j ¯ ` , where L j for j Pt , . . . , k u denotes the order of a j viewed as a permutation of the state set Q .Proof. Let Σ “ t a , . . . , a k u and A “ p Σ, Q, δ, s , F q be a permutation automa-ton. Denote by σ A , ` : N k Ñ P p Q q the state label map from Definition 6 and by ψ : Σ ˚ Ñ N k the Parikh map. By Proposition 4 we haveperm p L p A qq (cid:1) , ˚ “ ψ ´ p σ ´ A , ` p F qq Y t ε u with F “ t S Ď Q | S X F ‰ Hu Ď P p Q q . Inspecting Definition 6, we see thatthe state label map is compatible with A . So, by Proposition 2, the indices ofthe automata A p j q p from Definition 4 are universally bounded by p| Q | ´ q L j andthe periods divide L j . Hence, applying Theorem 3 gives sc p ψ ´ p σ ´ A , ` p F qqq ď | Q | k k ź j “ L j . Finally, using Lemma 8 gives the result for the iterative shuffle. [\ The set ψ ´ p σ ´ A , ` p F qq equals perm p L p A qq (cid:1) , ` . This is not explicitly stated but couldbe extracted from the proof of Proposition 4.4 S. Hoffmann Let Σ “ t a , . . . , a k u and L Ď Σ ˚ be a commutative group lan-guage with period vector p p , . . . , p k q . Then sc p L (cid:1) , ˚ q ď p sc p L q k ś kj “ p j q ` . Proof.