Languages of Dot-depth One over Infinite Words
aa r X i v : . [ c s . F L ] A p r Languages of Dot-Depth Oneover Infinite Words ∗ Manfred Kufleitner Alexander LauserUniversity of Stuttgart, FMI
Abstract.
Over finite words, languages of dot-depth one are expressively completefor alternation-free first-order logic. This fragment is also known as the Booleanclosure of existential first-order logic. Here, the atomic formulas comprise order,successor, minimum, and maximum predicates. Knast (1983) has shown that itis decidable whether a language has dot-depth one. We extend Knast’s resultto infinite words. In particular, we describe the class of languages definable inalternation-free first-order logic over infinite words, and we give an effective char-acterization of this fragment. This characterization has two components. The firstcomponent is identical to Knast’s algebraic property for finite words and the sec-ond component is a topological property, namely being a Boolean combination ofCantor sets.As an intermediate step we consider finite and infinite words simultaneously. Wethen obtain the results for infinite words as well as for finite words as special cases.In particular, we give a new proof of Knast’s Theorem on languages of dot-depthone over finite words.
The investigation of logical fragments has a long history. One of the first results in our directionis due to McNaughton and Papert [22]. They showed that a language over finite words isdefinable in first-order logic if and only if it is star-free. A few years earlier, Sch¨utzenbergershowed that a language is star-free if and only if its syntactic monoid is aperiodic [28]. For aregular language given by a (nondeterministic) finite automaton one can effectively computeits syntactic monoid and test for aperiodicity. Combining the result of McNaughton andPapert and the result of Sch¨utzenberger, this gives an algorithm for checking whether a regularlanguage is first-order definable.The very same approach led to similar decision procedures for various other fragments.The motivation for such results is to have some (descriptive) complexity measure for regularlanguages: the simpler a logical formula defining a language, the easier this language is. Inaddition, fragments often admit more efficient algorithms for computational problems such ∗ This work was supported by the German Research Foundation (DFG) under grant DI 435/5-1.
1s the satisfiability problem. For example, the satisfiability for full first-order logic is non-elementary [30], whereas the satisfiability problem for first-order logic with only two variablesis in nexptime [15]. Moreover, one can frequently find temporal logic counterparts for first-order fragments and these temporal logics allow even more efficient algorithms. For example,there are temporal logics for first-order logic with two variables having a satisfiability problemin np [9, 21]. The satisfiability problem for most temporal logics is pspace -complete, seee.g. [13].When considering some particular logical fragment F , then there are several main aspectsof F which are interesting: First, which languages are definable in F , e.g., in first-order logicone can define exactly the class of star-free languages. Second, how can one decide whether agiven regular language is definable in F , e.g., a language is first-order definable if and only if itssyntactic monoid is aperiodic. Third, which closure properties does F have, e.g., the inversehomomorphic image of a first-order definable language is again first-order definable. Otherimportant aspects are given by relations to other fragments and the computational complexityof problems such as the satisfiability problem or the model-checking problem for F . In thispaper, we focus on the first three aspects. Very often, the second aspect is solved by givinga decidable algebraic characterization of the syntactic monoid. Apart from pure decidability,this also has the advantage that several closure properties come for free by Eilenberg’s VarietyTheorem [12].The algebraic approach has been very successful for finite words [8, 33, 35, 41]. It has beengeneralized in different directions. One such direction is to extend the algebraic setting inorder to be able to characterize more fragments. The syntactic monoid of a language and of itscomplement are identical. Hence, if a fragment is not closed under complementation, then onlyconsidering the syntactic monoid is not sufficient. To overcome this obstacle, Pin introducedordered monoids and positive varieties [24]. Other fragments, such as stutter-invariant logics,are not closed under inverse homomorphisms. The solution to this problem was given byStraubing who suggested to use homomorphisms instead of semigroups or monoids. This ledto the notion of C -varieties [34, 5]. More recently Gehrke, Grigorieff, and Pin developed ageneral equational theory for regular languages [16].Another way to generalize the algebraic approach is to consider other models than finitewords such as infinite words [23], finite trees [3, 14], Mazurkiewicz traces [11], or data words [2],just to name a few. In most cases, considering models other than finite words requires a newnotion of recognition or even new algebraic objects. The characterizations we give in this paperrely on an extended notion of recognition based on so-called linked pairs. As it turns out, purelyalgebraic conditions are not sufficient in this setting, but together with a topological propertythey work well.When considering language classes for first-order fragments over finite words, there are twosimilar hierarchies within the class of star-free languages which take center stage. The firstone is the dot-depth hierarchy introduced by Cohen and Brzozowski [6], and the second oneis the Straubing-Th´erien hierarchy [31, 36]. There is a tight connection between the two interms of so-called wreath products [32, 40]. Both hierarchies are strict [4] and each levelforms a variety [6, 26]. Thomas showed that there is a one-to-one correspondence betweenthe quantifier alternation hierarchy of first-order logic and the dot-depth hierarchy [38]. Thiscorrespondence holds if one allows [ <, +1 , min , max] as a signature. The same correspondencebetween the Straubing-Th´erien hierarchy and the quantifier alternation hierarchy holds if werestrict the signature to [ < ], cf. [26]. In particular, all decidability results for the dot-depthhierarchy and the Straubing-Th´erien hierarchy yield decidability of the membership problem2 ragment Algebra + Topology Σ [ < ] x ≤ B Σ [ < ] J -trivial + Boolean combination [23]of Cantor sets B Σ [ <, +1 , min] B + Boolean combination Thm. 17of Cantor setsFO [ < ] DA + closed in strict [10]alphabetic topologyFO [ <, +1] LDA + closed in strict [18]factor topologyΣ [ < ] eM e e ≤ e + open in [10]alphabetic topologyΣ [ <, +1] eP e e ≤ e + open in [18]factor topology Table 1: Fragments of first-order logic over infinite words Γ ω for the respective levels of the quantifier alternation hierarchy and vice versa. Unfortunately,effectively determining the level of a language in the dot-depth hierarchy or the Straubing-Th´erien hierarchy is one of the most challenging open problems in automata theory. Knast hasshown that the first level of the dot-depth hierarchy is decidable [20], and Simon has given adecidable characterization for the first level of the Straubing-Th´erien hierarchy [29]. These twolevels and the first two half levels of each hierarchy are the only decidable cases known so far,see e.g. [25] for an overview and [17] for level 3 / < for order, +1 for successor, min for first position, and max for lastposition. This fragment is denoted by B Σ [ <, +1 , min , max]. In our setting min and max areunary predicates rather than constants because a predicate max also makes sense for infinitewords. Note that this does not change the expressive power of the fragment B Σ and thatover infinite words the fragments B Σ [ <, +1 , min] and B Σ [ <, +1 , min , max] coincide. Froman algebraic and topological point of view it is more natural to work with finite and infinitewords simultaneously. However, over Γ ∞ = Γ ∗ ∪ Γ ω there is one major difference between B Σ [ <, +1 , min] without max and B Σ [ <, +1 , min , max] with max: The latter fragment candistinguish finite from infinite words whereas B Σ [ <, +1 , min] cannot differentiate between Γ ∗ and Γ ω . In particular, every B Σ [ <, +1 , min]-definable language with an infinite word alsocontains finite words, i.e., B Σ [ <, +1 , min] has the finite model property.In all variations (with or without max-predicate; infinite words Γ ω only or finite and infinitewords Γ ∞ ) we obtain the same algebraic characterization B as Knast did for finite words.In addition, we have a topological condition which is being a finite Boolean combination ofopen sets. Here, open means open in the Cantor topology. This topological property is often3enoted by F σ ∩ G δ , see e.g. [39]. As it turns out, there are two slightly different versions of theCantor topology on Γ ∞ . The first one is given by base sets u Γ ∞ for u ∈ Γ ∗ . This correspondsto the fragment B Σ [ <, +1 , min] without max over Γ ∞ . The second version is given by basesets of the form u Γ ω and { u } for u ∈ Γ ∗ , i.e., finite words are isolated points. This secondversion yields a characterization of B Σ [ <, +1 , min , max] with max over Γ ∞ . In our setting,it is more convenient to work with some equivalent linked pair condition instead of using thetopology itself. Related Work
Various fragments over infinite words have been considered. Existential first-order logic isdenoted by Σ and its Boolean closure is B Σ . For two-variable first-order logic we write FO .The second level of the alternation hierarchy is denoted by Σ . It contains all formulas in prenexnormal form with two blocks of quantifiers, starting with a block of existential quantifiers.The prefix of a word can be defined in both FO [ < ] and Σ [ < ]. Hence, FO [ <, +1 , min] =FO [ <, +1] and Σ [ <, +1 , min] = Σ [ <, +1]. In contrast, B Σ [ <, +1] is a strict subclass of B Σ [ <, +1 , min]. The fragment Π consists of negations of formulas in Σ . Since regularlanguages are effectively closed under complementation, decidability for Σ yields decidabilityfor Π .An overview of effective characterizations can be found in Table 1. For the formal definitionsof the algebraic and topological properties we refer to [10, 18, 23]. The first decision proceduresfor FO [ < ] and FO [ <, +1] are due to Wilke [42], and the first effective characterization ofΣ [ < ] was given by Boja´nczyk [1]. Among the topologies in Table 1, the Cantor topology isthe coarsest and the strict factor topology is the finest topology. The relation between theother topologies is depicted in Figure 1. Cantor top. alphabetic top. factor top.strict alphabetic top. strict factor top.
Figure 1: Topologies for infinite words.
Throughout, Γ is a finite nonempty alphabet. The set of finite words over Γ is denoted byΓ ∗ . The empty word is 1, and Γ + = Γ ∗ \ { } is the set of finite, nonempty words. The setof infinite words is Γ ω and Γ ∞ = Γ ∗ ∪ Γ ω is the set of finite and infinite words. A language is a subset of Γ ∞ . Let L ⊆ Γ ∗ and K ⊆ Γ ∞ . We set LK = { u α ∈ Γ ∞ | u ∈ L, α ∈ K } , L ∗ = { u · · · u n | n ∈ N , u i ∈ L } , and L ω = { u u · · · | u i ∈ L } , i.e., L ∗ is the set of finiteproducts of words in L and L ω is the set of infinite products. We have 1 ω = 1. Let α ∈ Γ ∞ and u ∈ Γ ∗ . The word u is a factor of α if α = vu β for some v ∈ Γ ∗ and β ∈ Γ ∞ . It is a prefix if we can choose v = 1 and it is a suffix if we can choose β = 1. We write u ≤ α if u is aprefix of α . The length of α is | α | and we have | α | ∈ N ∪ { ∞ } . For k ∈ N , the k -factor alphabet of α is alph k ( α ) = { u ∈ Γ k | α ∈ Γ ∗ u Γ ∞ } . If X ⊆ N , then α ( X ) is the word comprising all4ositions of α which are contained in X . By extension, α ( x ) is the x -th letter of α . Therefore, α = α (1) · · · α ( n ) if | α | = n ∈ N and α = α (1) α (2) · · · if | α | = ∞ . We say that a position x of α is covered by a factor u of a factorization α = vu β if | v | < x ≤ | vu | . If the position atwhich u occurs in α is clear from the context, then we say that u covers x . Similarly, a setof positions is covered by a set of factors if each position is covered by some factor. Here,factors are understood with implicit positions of occurrence. A monomial is a language ofthe form w Γ ∗ w · · · Γ ∗ w n , of the form w Γ ∗ w · · · Γ ∗ w n Γ ∞ , or of the form w Γ ∗ w · · · Γ ∗ w n Γ ω for n ≥ w i ∈ Γ ∗ . The degree of the monomial is | w · · · w n | . A language L ⊆ Γ ∗ offinite words has dot-depth one if it is a finite Boolean combination of monomials of the form w Γ ∗ w · · · Γ ∗ w n . Similarly, a language L ⊆ Γ ω has dot-depth one if it is a finite Booleancombination of monomials w Γ ∗ w · · · Γ ∗ w n Γ ω . We consider first-order logic FO = FO[ <, +1 , min , max] interpreted over finite and infinitewords. In the context of logic we think of words as labeled linearly ordered positions. Variablesrange over positions of the word. Atomic formulas are ⊤ for true , the unary predicates λ ( x ) = a ,min( x ) and max( x ), and the binary predicates x < y and x = y + 1 for variables x, y and a ∈ Γ.The formula λ ( x ) = a means that x is labeled with a , and the formula min( x ) (resp. max( x ))expresses that x is the first (resp. last) position of the word. The formula x < y is true if x isstrictly smaller than y , and x = y + 1 means that x is the successor position of y . Formulascan be composed by Boolean connectives and by the quantifiers ∃ x : ϕ and ∀ x : ϕ for ϕ ∈ FO.The semantics of the connectives is as usual. A sentence is a formula without free variables.For a sentence ϕ and for α ∈ Γ ∞ we write α | = ϕ if ϕ interpreted over the word α is true. The language defined by ϕ is L ( ϕ ) = { α ∈ Γ ∞ | α | = ϕ } .Let C ⊆ { <, +1 , min , max } . The fragment Σ [ C ] of first-order logic consists of all formulasin FO in prenex normal form with only one block of existential quantifiers which, apart fromlabel-predicates, use only predicates in C . The fragment B Σ [ C ] contains all finite Booleancombinations of formulas in Σ [ C ]. Let L ⊆ Γ ∞ be a language and F be a fragment of first-order logic. Then L is definable in F if there exists some sentence ϕ ∈ F such that L = L ( ϕ ).Sometimes we want to restrict the interpretation of the formula to some subset K ⊆ Γ ∞ . Wesay that L is definable in F over K if there is a sentence ϕ ∈ F with L = { α ∈ K | α | = ϕ } .We frequently use this with K = Γ ∗ or K = Γ ω . Note that max( x ) is false for all positions x ofan infinite word, i.e., a language L is definable in B Σ [ C ] over Γ ω if and only if L is definablein B Σ [ C , max] over Γ ω . Let S be a semigroup. An element x ∈ S is idempotent if x = x . If S is finite, then thereexists a number n ≥ x n is idempotent for all x ∈ S . The monoid S generated by S is defined as follows. If S is a monoid, then we set S = S ; otherwise S = S ∪ { } is the monoid obtained by adding a new neutral element 1. Green’s relations R and L are an important means for structural analysis in the theory of finite semigroups. For x, y ∈ S we set x R y iff xS = yS , x ≤ R y iff xS ⊆ yS ,x L y iff S x = S y, x ≤ L y iff S x ⊆ S y. xS = { xz | z ∈ S } and S x = { zx | z ∈ S } . We often use these relationsin the following way: The relation x ≤ R y holds if and only if there exists z ∈ S such that x = yz . Likewise, x ≤ L y if and only if there exists z ∈ S such that x = zy . As usual, wewrite x < R y if x ≤ R y but not x R y . The relation < L is defined similarly.A finite semigroup S is in B if for all idempotents e, f ∈ S and for all s, t, x, y ∈ S we have( exf y ) n exf ( tesf ) n = ( exf y ) n esf ( tesf ) n for n ≥ n -th powers are idempotent in S . A semigroup S is aperiodic if for every x ∈ S there exists n ≥ x n = x n +1 . In the equation for B we can set e, f, s, t and y to x n which yields x n x = x n . Hence, every semigroup in B is aperiodic. Another importantproperty of B is given in Lemma 3 below.The theory of first-order fragments over finite nonempty words is more concise with semi-groups rather than with monoids. However, we want to treat finite and infinite words simul-taneously, and our approach is heavily based on allowing the empty word 1 (and the fact that1 ω = 1). On the other hand, it is crucial that the idempotents e and f in the above equationfor B correspond to nonempty words. We therefore consider homomorphisms h : Γ ∗ → M tofinite monoids. Membership in B is then formulated as h (Γ + ) ∈ B . A language L ⊆ Γ ∞ is regular if it is recognized by an extended B¨uchi automaton [7], i.e., afinite automaton with two sorts of final states; the first sort is for accepting finite words andthe second is for accepting infinite words by a B¨uchi condition. Alternatively, a language isregular if and only if it is definable in monadic second-order logic [39]. We use a more algebraicframework for recognition based on finite monoids.Let h : Γ ∗ → M be a homomorphism to a finite monoid M . If h is understood and s ∈ M ,then we write [ s ] for the language h − ( s ). A linked pair of M is a pair ( s, e ) ∈ M × M suchthat e is idempotent and s = se . For every word α ∈ Γ ∞ there exists a linked pair ( s, e ) of M such that α ∈ [ s ][ e ] ω by Ramsey’s Theorem [27]. A language L ⊆ Γ ∞ is recognized by h if L = [ { [ s ][ e ] ω | ( s, e ) is a linked pair with [ s ][ e ] ω ∩ L = ∅} . The syntactic congruence of L ⊆ Γ ∞ is defined as follows. For nonempty words p, q ∈ Γ + welet p ≡ L q if for all words u, v, w ∈ Γ ∗ the following equivalences hold: upvw ω ∈ L ⇔ uqvw ω ∈ L and u ( pv ) ω ∈ L ⇔ u ( qv ) ω ∈ L. Remember that 1 ω = 1. This relation indeed is a congruence and the congruence classes[ p ] L = { q ∈ Γ + | p ≡ L q } constitute the syntactic semigroup Synt( L ). The syntactic monoid Synt ( L ) is the monoid generated by Synt( L ), i.e., Synt ( L ) = S for S = Synt( L ). The syntactic homomorphism h L : Γ ∗ → Synt ( L ) is defined by h L ( a ) = [ a ] L for a ∈ Γ. Avariant of the syntactic monoid is the pure syntactic monoid
Synt + ( L ) = Synt( L ) ˙ ∪ { } , i.e.,we add a new neutral element to Synt( L ), even if Synt( L ) is a monoid. The pure syntactichomomorphism h + : Γ ∗ → Synt + ( L ) is defined by h + ( p ) = h L ( p ) for p = 1. The only possibledifference between h + and h L is their behavior on the empty word. Note that h L (Γ + ) = h + (Γ + ) = Synt( L ) ⊆ Synt ( L ) ⊆ Synt + ( L )6nd Synt + ( L ) \ { } = Synt( L ) ( Synt + ( L ). A language L ⊆ Γ ∞ is regular if and only if bothSynt( L ) is finite and h L recognizes L , see e.g. [23, 39]. Moreover, L is recognized by its syntactichomomorphism h L if and only if it is recognized by its pure syntactic homomorphism h + . Incontrast to h L , the pure syntactic homomorphism has the property that h + ( u ) = 1 if and onlyif u = 1. Lemma 1.
Let L ⊆ Γ ∞ be recognized by a homomorphism h : Γ ∗ → M such that h ( u ) = 1 only if u = 1 . Then both L ∩ Γ ∗ and L ∩ Γ ω are also recognized by h .Proof: We have [ s ] = [ s ][1] ω ⊆ Γ ∗ . Moreover, [ s ][ e ] ω ⊆ Γ ω if e = 1. This proves the claim. (cid:3) This section contains simple algebraic and combinatorial properties of the class B . Thefollowing elementary lemma gives a mechanism for obtaining idempotent stabilizers with anonempty preimage: Every sufficiently long word u has a short prefix p admitting a nonemptyidempotent stabilizer e . Lemma 2.
Let h : Γ ∗ → M be a homomorphism to a finite monoid M and let u ∈ Γ ∗ with | u | = | M | − . Then there exists a prefix p of u and an idempotent e ∈ h (Γ + ) with h ( p ) e = h ( p ) .Proof: Let a ∈ Γ and let 1 = p < p < · · · < p | M | = ua be the prefixes of ua . By thepigeonhole principle, there exist 0 ≤ i < j ≤ | M | such that h ( p i ) = h ( p j ). In particular, wehave i ≤ | M | − p i is a prefix of u . Let p i q = p j for q ∈ Γ + . We set e = h ( q ) n to be theidempotent element generated by h ( q ). Now, h ( p ) e = h ( p ) for p = p i . (cid:3) Next we state the key property of B , a substitution rule valid in certain situations. Muchof the work in proving our main theorem is devoted to guarantee its premises. Lemma 3.
Let S ∈ B . If u R uexf and esf v L v for idempotents e, f ∈ S and for u, v, x, s ∈ S , then uexf v = uesf v .Proof: Choose n ≥ n -th powers in S are idempotent. Since u R uexf and v L esf v , there exist y, t ∈ S with u = uexf y and v = tesf v . In particular, u = u ( exf y ) n and v = ( tesf ) n v . We can assume y, t ∈ S because e and f are idempotent. Using the equationfor B we conclude uexf v = u ( exf y ) n exf ( tesf ) n v = u ( exf y ) n esf ( tesf ) n v = uesf v. (cid:3) Proposition 4 below gives an important combinatorial feature of B . It shows that if the R -class changes when reading a word from left to right (resp. the L -class changes when readingthe word from right to left), then this happens with a new factor of bounded length. Proposition 4.
Let h : Γ ∗ → M be a homomorphism with h (Γ + ) ∈ B and let k ≥ | M | . Forall a ∈ Γ and u, x ∈ Γ ∗ with | x | ≥ k we have:1. h ( u ) R h ( ux ) > R h ( uxa ) ⇒ alph k ( x ) = alph k ( xa ) .2. h ( u ) L h ( xu ) > L h ( axu ) ⇒ alph k ( x ) = alph k ( ax ) . roof: By left-right symmetry, it suffices to show “1”. Assume h ( u ) R h ( ux ) > R h ( uxa ) andalph k ( x ) = alph k ( xa ). Let w be the suffix of length k of xa . By Lemma 2, there exist y, z ∈ Γ ∗ with w = yza and h ( y ) e = h ( y ) for some idempotent e ∈ h (Γ + ) because | w | ≥ | M | . Let | y | bemaximal with this property. Since w ∈ alph k ( xa ) = alph k ( x ), we can write x = syzatz for some s, t ∈ Γ ∗ such that y is a suffix of yzat . Note that there is indeed at least one letter betweenthe two occurrences of z . Let u ′ = h ( usy ) and x ′ = h ( zat ). We have u ′ = u ′ e , u ′ x ′ = u ′ x ′ e ,and there exists y ′ ∈ h (Γ + ) with u ′ = u ′ x ′ y ′ . Therefore, we have u ′ x ′ = u ′ ( ex ′ ey ′ ) n ex ′ e ( eeee ) n for all n ∈ N , and by h (Γ + ) ∈ B this equals u ′ ( ex ′ ey ′ ) n eee ( eeee ) n = u ′ for sufficiently large n .Thus u ′ = u ′ x ′ and h ( u ) R u ′ = u ′ x ′ x ′ R h ( uxa ), contradicting the assumption. (cid:3) B Σ [ <, +1 , min] over Γ ∞ This section contains our main result Theorem 5. We give an effective characterization of thefirst-order fragment B Σ [ <, +1 , min] over finite and infinite words.Over Γ ∞ , the fragment B Σ [ <, +1 , min] yields a strict subclass of the B Σ [ <, +1 , min , max]-definable languages. For example, Γ ∗ a is not definable in alternation-free first-order logicwithout max-predicate. On the other hand, the language a Γ ∞ is definable in B Σ [min]. Wepinpoint this asymmetry of B Σ [ <, +1 , min] to some topological condition (expressed in termsof linked pairs). Theorem 5.
Let L ⊆ Γ ∞ be regular. The following assertions are equivalent:1. L is a finite Boolean combination of monomials of the form w Γ ∗ w · · · Γ ∗ w n Γ ∞ .2. L is definable in B Σ [ <, +1 , min] .3. The syntactic homomorphism h L : Γ ∗ → Synt ( L ) satisfiesa) Synt( L ) ∈ B , andb) for all linked pairs ( s, e ) and ( t, f ) of Synt ( L ) with s R t we have [ s ][ e ] ω ⊆ L ⇔ [ t ][ f ] ω ⊆ L .4. L is recognized by a homomorphism h : Γ ∗ → M satisfyinga) h (Γ + ) ∈ B , andb) for all linked pairs ( s, e ) and ( t, f ) of M with s R t we have [ s ][ e ] ω ⊆ L ⇔ [ t ][ f ] ω ⊆ L . Remark 6.
Suppose h : Γ ∗ → M recognizes a regular language L and consider the condition [ s ][ e ] ω ⊆ L ⇔ [ t ][ f ] ω ⊆ L for all linked pairs ( s, e ) and ( t, f ) of M with s R t . This condition isequivalent to L being a finite Boolean combination of open sets, cf. [23, Theorem VI.3.7]. Here, open means open in the Cantor topology defined by the base sets u Γ ∞ for u ∈ Γ ∗ . Therefore,the conditions “3b” and “4b” in Theorem 5 are actually topological properties. Remark 7.
For languages over Γ ∞ there is also the concept of weak recognition. A language L is weakly recognized by a homomorphism h : Γ ∗ → M to a finite monoid if L = [ { [ s ][ e ] ω | ( s, e ) is a linked pair with [ s ][ e ] ω ⊆ L } . If a language L ⊆ Γ ∞ is recognized by a homomorphism h , then it is weakly recognized by h . Ingeneral the converse is not true. However, if in addition [ s ][ e ] ω ⊆ L ⇔ [ t ][ f ] ω ⊆ L for all linkedpairs ( s, e ) and ( t, f ) of M with s R t , then weak recognition implies strong recognition. Suppose [ s ][ e ] ω ∩ L = ∅ . Then there exists a linked pair ( t, f ) with [ t ][ f ] ω ⊆ L and [ s ][ e ] ω ∩ [ t ][ f ] ω = ∅ .The latter condition implies s R t and hence [ s ][ e ] ω ⊆ L .
8n the remainder of this section we prove Theorem 5. The implications “1 ⇒
2” and “2 ⇒ ⇒
1” is shown in the second half of thissection.
Lemma 8.
Let n ≥ and let w , . . . , w n ∈ Γ ∗ .1. The monomial w Γ ∗ w · · · Γ ∗ w n Γ ∞ is defined by a sentence in Σ [ <, +1 , min] with quan-tifier depth | w · · · w n | .2. The monomial w Γ ∗ w · · · Γ ∗ w n is defined by a sentence in Σ [ <, +1 , min , max] with quan-tifier depth | w · · · w n | .Proof: We write ≡ for syntactic equivalence of formulas. For variable vectors x = ( x , . . . , x ℓ )and y = ( y , . . . , y m ) we introduce the shortcuts ∃ x ≡ ∃ x · · · ∃ x ℓ , min( x ) ≡ min( x ),max( x ) ≡ max( x ℓ ), x < y ≡ x ℓ < y , and λ ( x ) = a · · · a ℓ for ^ ≤ j ≤ ℓ λ ( x j ) = a j ∧ ^ ≤ j<ℓ x j +1 = x j + 1 . Let L = w Γ ∗ w · · · Γ ∗ w n Γ ∞ . We introduce variable vectors x i = ( x i, , . . . , x i, | w i | ) for every i ∈ { , . . . , n } . Then L is defined by the following sentence ϕ : ∃ x · · · ∃ x n : min( x ) ∧ ^ ≤ i ≤ n λ ( x i ) = w i ∧ ^ ≤ i Let L ⊆ Γ ∞ be definable in B Σ [ <, +1 , min] and let M be a finite monoid. Forevery surjective homomorphism h : Γ ∗ → M which recognizes L we have [ s ] ⊆ L ⇔ [ s ][ e ] ω ⊆ L for every linked pair ( s, e ) of M . roof: Let ϕ ∈ Σ [ <, +1 , min] be a sentence. If α ∈ Γ ∞ models ϕ , then there is a prefix u of α such that for every β ∈ Γ ∞ we have u β | = ϕ . This is because α | = ϕ yields some satisfyingassignment for the variables, and positions beyond the last position of this assignment have noinfluence. Let L be defined by a sentence in B Σ [ <, +1 , min] with quantifier depth d . Consider α = ˆ s ˆ e ω for ˆ s ∈ [ s ] and ˆ e ∈ [ e ]. By the above consideration there exists a finite prefix u = ˆ s ˆ e n of α such that α and u model the same formulas in Σ [ <, +1 , min] with quantifier depth atmost d . Now, u ∈ L if and only if α ∈ L . Therefore, [ s ] ⊆ L if and only if [ s ][ e ] ω ⊆ L . (cid:3) In the remainder of this section we show that condition “4” in Theorem 5 is sufficient. Tothis end we show that if α and β are contained in the same monomials up to a certain degree,then their images in a semigroup in B are R -related. The main idea is to apply Lemma 3.The first step is to show that under certain conditions we can replace several factors in finitewords (Lemma 11). To formulate these conditions we introduce the R ( k )-factorization and the L ( k )-factorization. Then the substitution principle in Lemma 11 is extended to infinite words(Lemma 12). Finally, in Proposition 13 we show that in B we can guarantee the premises ofLemma 12.We think of a factor u i as being equipped with the position x i of its first letter. Consequently,a factorization F is a tuple ( x , u , . . . , x ℓ , u ℓ ) ∈ ( N × Γ + ) ℓ with ℓ ≥ x i +1 ≥ x i + | u i | forall 1 ≤ i < ℓ , i.e., we assume that the factors u i are in increasing order and nonoverlapping.The type of F is the sequence of words ( u , . . . , u ℓ ). We say that F is a factorization of α if u i = α ( { x i , . . . , x i + | u i | − } ) for all 1 ≤ i ≤ ℓ .We want to merge two factorizations F = ( x , u , . . . , x ℓ , u ℓ ) and G = ( y , v , . . . , y m , v m )of α . In order to define the join F ∨ G of F and G , we combine overlapping factors of F and G into one factor, see Figure 2 for an illustration. More precisely, let X i = { x i , . . . , x i + | u i | − } be the positions of the factor u i and let Y i = { y i , . . . , y i + | v i | − } be the positions of thefactor v i . We say that X = S ℓi =1 X i is the set of positions of F . Analogously, Y = S mi =1 Y i is the set of positions of G . We set Z = X ∪ Y . Let { Z , . . . , Z n } be the finest partitionof Z such that every class Z j is a union of sets X i and sets Y i . Therefore, if x < y < z and x, z ∈ Z j , then y ∈ Z j ; otherwise we could split Z j into two classes Z j ∩ { s ∈ N | s < y } and Z j ∩ { s ∈ N | s > y } , resulting in a finer partition. Therefore, each α ( Z j ) is a factor of α . Let z j be the minimal element in Z j and suppose z < · · · < z n . Now, the join of F and G is F ∨ G = (cid:0) z , α ( Z ) , . . . , z n , α ( Z n ) (cid:1) . It is easy to see that the operation ∨ on factorizations of α is associative and commutative.An important algebraic concept in our proofs is the R ( k )-factorization and its left-rightdual, the L ( k )-factorization. Let h : Γ ∗ → M be a homomorphism to a finite monoid M . The α · · · a a a a a a a a a a a a a a FGF ∨ G Figure 2: The join F ∨ G of the factorizations F and G obtained by merging overlap-ping factors. Here, we have F = (1 , a a a , , a a a , , a a ) and G =(1 , a a , , a , , a a , , a . a ). The join of these two factorizations is F ∨ G =(1 , a a a , , a , , a a a a a , , a a ). Note that nonoverlapping adjacent fac-tors are not merged. 10 -factorization of a word α is given by the positions where the R -class changes when reading α from left to right. More precisely, let α = a w · · · a r − w r − a r β with r ≥ a i ∈ Γ, w i ∈ Γ ∗ and β ∈ Γ ∞ such that h ( a w · · · a i ) R h ( a w · · · a i w i ) > R h ( a w · · · a i +1 )for all 1 ≤ i < r and h ( a w · · · a r ) R h ( a w · · · a r w ) for every finite prefix w of β . Let z i be the position of a i in the above factorization. The R -factorization of α is ( z , a , . . . , z r , a r ).For every word α , the above factorization is unique and its size r is at most | M | . Note that x = 1 for every nonempty word α , even if h ( a ) = 1.We extend this definition by taking the contexts of the R -factorization into account. Let k ∈ N and consider the R -factorization ( z , a , . . . , z r , a r ) of α . Let F i = ( z ′ i , w i ) with z ′ i =max { , z i − k } and w i = α ( { z i − k, . . . , z i + k } ), i.e., w i is the factor of α induced by allpositions z such that | z − z i | ≤ k . The R ( k ) -factorization of α is F ∨ · · · ∨ F r . Let F =( x , u , . . . , x ℓ , u ℓ ) be the R ( k )-factorization of α and let X be the set of its positions. Wehave | X | ≤ | M | (2 k + 1) − k since at most k + 1 positions come from the first position ofthe R -factorization and all other positions of the R -factorization contribute at most 2 k + 1positions to X . In particular, | X | ≤ k if k ≥ | M | . We have α = u w · · · u ℓ − w ℓ − u ℓ β for some w i ∈ Γ ∗ , β ∈ Γ ∞ such that the u i ’s cover the positions of the R -factorization andmoreover, the R -class changes at neither the k first positions of any u i with i > k last positions of any u i with i < ℓ .The L -factorization of a finite word w ∈ Γ ∗ is the left-right dual of the R -factorization: Let w = w a · · · w r a r with r ≥ a i ∈ Γ, and w i ∈ Γ ∗ such that h ( a i − w i a i · · · w r a r ) < L h ( w i a i · · · w r a r ) L h ( a i · · · w r a r )for all 1 ≤ i ≤ r . The L -factorization of w is then given by the factors a i of length one togetherwith their positions in w .As for R -factorizations, we extend this definition by taking contexts into account. Let( z , a , . . . , z r , a r ) be the L -factorization of w . Let k ∈ N and let G i = ( z ′ i , w i ) with z ′ i =max { , z i − k } and let w i = w ( { z i − k, . . . , z i + k } ) be the factor of w induced by all po-sitions z such that | z − z i | ≤ k . Then, the L ( k ) -factorization of w is G ∨ · · · ∨ G r . Let G = ( y , v , . . . , y m , v m ) be the L ( k )-factorization of w and let Y be the set of its positions. Asfor R ( k )-factorizations, we have | Y | ≤ k if k ≥ | M | . Lemma 11. Let h : Γ ∗ → M with h (Γ + ) ∈ B and let k ≥ | M | . If u = w u w · · · u ℓ w ℓ and v = w v w · · · v ℓ w ℓ for words u i , v i , w i ∈ Γ ∗ such that the w i ’s in u cover the positions of the R ( k ) -factorization of u and the w i ’s in v cover the positions of the L ( k ) -factorization of v ,then h ( u ) = h ( v ) .Proof: The proof goes as follows. Since k is large enough, we find a short prefix p i and a shortsuffix q i of each w i admitting idempotent stabilizers f i and e i . Appending these prefixes andsuffixes to the u i ’s and v i ’s then allows us to apply Lemma 3.We can assume that each w i covers the positions of a factor of the R ( k )-factorization of u or ofa factor of the L ( k )-factorization of v . In particular, | w | , | w ℓ | ≥ k and | w i | ≥ k for 0 < i < ℓ .By Lemma 2 and its left-right dual, there exist idempotents f , . . . , f ℓ , e , . . . , e ℓ − ∈ h (Γ + )such that each w i admits a factorization w i = p i r i q i with | p i | ≤ k and | q i | ≤ k satisfying h ( p i ) = h ( p i ) f i for 0 < i ≤ ℓ,h ( q i ) = e i h ( q i ) for 0 ≤ i < ℓ. 11n particular, we can assume p = 1 = q ℓ . Let x i = q i − u i p i and s i = q i − v i p i for 1 ≤ i ≤ ℓ .Then, u = r x r · · · x ℓ r ℓ and s = r s r · · · s ℓ r ℓ , and the r i ’s in u cover the positions of the R -factorization of u , whereas the r i ’s in v cover the positions of the L -factorization of v . Thus h ( r x · · · r i − ) R h ( r x · · · r i − ) · e i − h ( x i ) f i ,e i − h ( s i ) f i · h ( r i · · · s ℓ r ℓ ) L h ( r i · · · s ℓ r ℓ ) . An ℓ -fold application of Lemma 3 yields h ( u ) = h ( r x · · · r ℓ − x ℓ − r ℓ − x ℓ r ℓ )= h ( r x · · · r ℓ − x ℓ − r ℓ − s ℓ r ℓ )= h ( r x · · · r ℓ − s ℓ − r ℓ − s ℓ r ℓ )= · · · = h ( r s · · · r ℓ − s ℓ − r ℓ − s ℓ r ℓ ) = h ( v ) . We can think of the above equations as converting h ( u ) into h ( v ) by using substitution rules x i → s i . Note that the image under h is preserved only when applying these rules from rightto left. (cid:3) Next, we give a version of Lemma 11 for finite and infinite words. The problem is thatthere is no canonical choice for the L ( k )-factorization of an infinite word α . We overcome thisobstacle by fixing a type and considering L ( k )-factorizations of this type for infinitely manyprefixes of α . Lemma 12. Let h : Γ ∗ → M with h (Γ + ) ∈ B , let k ≥ | M | and let α = w u w · · · u ℓ w ℓ γ with u i , w i ∈ Γ ∗ and γ ∈ Γ ∞ such that the w i ’s cover the positions of the R ( k ) -factorization of α .Let τ be a type such that for every finite prefix p of β ∈ Γ ∞ there exists q ∈ Γ ∗ with pq ≤ β and • the L ( k ) -factorization G of pq has type τ , and • pq = w v w · · · v ℓ w ℓ for some v i ∈ Γ ∗ such that the w i ’s cover the positions of G .Then s ≤ R t for all linked pairs ( s, e ) and ( t, f ) of M with α ∈ [ s ][ e ] ω and β ∈ [ t ][ f ] ω .Proof: Suppose α ∈ [ s ][ e ] ω and β ∈ [ t ][ f ] ω . We can write β ∈ p [ f ] ω with h ( p ) = t . Byassumption, there exists q ∈ Γ ∗ such that pq is a prefix of β with L ( k )-factorization G of type τ .Moreover, we have a factorization pq = w v w · · · v ℓ w ℓ such that the positions of G are coveredby the w i ’s. Let r = h ( pq ). We have r ≤ R t because p is a prefix of pq . By Lemma 11 we have h ( w u w · · · u ℓ w ℓ ) = h ( w v w · · · v ℓ w ℓ ). Since we can write α ∈ w [ e ] ω such that h ( w ) = s and w u w · · · u ℓ w ℓ is a prefix of w , we conclude s ≤ R r ≤ R t . (cid:3) Let G = ( y , v , . . . , y m , v m ) be a factorization. A factorization F = ( x , u , . . . , x ℓ , u ℓ ) is a subfactorization of G , denoted by F (cid:22) G , if for every i ∈ { , . . . , ℓ } there exists j ∈ { , . . . , m } such that v j = pu i q and x i = y j + | p | for some p, q ∈ Γ ∗ . Intuitively, this means that every u i is covered by some v j . Let G and G ′ be factorizations of the same type. Then, there is aone-to-one correspondence between the positions of G and the positions of G ′ . Hence, everysubfactorization F (cid:22) G induces a subfactorization F ′ (cid:22) G ′ .For every factorization F = ( x , u , . . . , x ℓ , u ℓ ) with x = 1 we define the monomial P F = u Γ ∗ u · · · Γ ∗ u ℓ Γ ∞ of degree | u · · · u ℓ | . Now, whenever F is a factorization of a word α , then α ∈ P F . The converse does not hold, but if α ∈ P F , then there exists a factorization F ′ of α with type ( u , . . . , u ℓ ). Next, we give a canonical way of turning a membership α ∈ P F intosuch a factorization F ′ . 12et P = u Γ ∗ u · · · Γ ∗ u ℓ Γ ∞ be a monomial and suppose α ∈ P . Write α = u s u · · · s ℓ − u ℓ β such that ( | s | , . . . , | s ℓ − | ) is minimal in the lexicographic order, i.e., we first minimize | s | ,then | s | , and so on. We can think of this as greedily minimizing the lengths of the s i ’sone after another. Now, the greedy factorization for α ∈ P is F ′ = ( x , u , . . . , x ℓ , u ℓ ) with x i = 1 + | u s u · · · s i − | . Proposition 13. Let h : Γ ∗ → M be a homomorphism with h (Γ + ) ∈ B and let α ∈ [ s ][ e ] ω and β ∈ [ t ][ f ] ω for some linked pairs ( s, e ) and ( t, f ) of M . If α and β are contained in thesame monomials w Γ ∗ w · · · Γ ∗ w n Γ ∞ of degree at most | M | , then s R t .Proof: Let k = | M | . We shall first give an intuitive outline of our proof. We consider the R ( k )-factorization F of α . This converts to a factorization F ′ of β . Then we choose a prefix pq of β such that its L ( k )-factorization G ′ is “as far to the right as possible” in a certain sense.Next, the factorization G ′ of β is converted into a factorization G of α . This process makes useof the factorization F ′ to ensure that on α the factorization G is sufficiently far to the rightof F . Using Proposition 4, the crucial step is to show that F ∨ G and F ′ ∨ G ′ have the sametype. This step was inspired by a proof of Kl´ıma [19]. Finally, applying Lemma 12, we obtain s ≤ R t . Since the situation is symmetric in α and β , we conclude s R t .Let F = ( x , u , . . . , x ℓ , u ℓ ) be the R ( k )-factorization of α . Note that α ∈ P F and the degreeof P F is at most 2 k . Therefore, β ∈ P F by assumption. Let F ′ = ( x ′ , u , . . . , x ′ ℓ , u ℓ ) be thegreedy factorization for β ∈ P F .There exists a type τ such that for every prefix p of β there is a prefix pq of β with an L ( k )-factorization of type τ . If β is an infinite word, then this means that there are infinitelymany such prefixes pq of β .Consider some prefix pq of β with an L ( k )-factorization G ′ = ( y ′ , v . . . , y ′ m , v m ) of type τ such that y ′ > x ′ for as many positions y ′ of G ′ and positions x ′ of F ′ as possible. Let H ′ = F ′ ∨ G ′ . We have β ∈ P H ′ and the degree of P H ′ is at most 4 k . Thus α ∈ P H ′ . Let H be the greedy factorization for α ∈ P H ′ . Further, let G (cid:22) H be the subfactorization of H induced by G ′ (cid:22) H ′ . Note that we cannot directly transfer the factorization G ′ of β to theword α because we want that G = ( y , v , . . . , y m , v m ) is “sufficiently far to the right”. Next,we show H = F ∨ G .We claim that for all i ∈ { , . . . , ℓ } , for all 0 ≤ j < | u i | , and for all r ∈ { , . . . , m } we have x i + j < y r iff x ′ i + j < y ′ r and x i + j ≤ y r iff x ′ i + j ≤ y ′ r . Using property “1” of Proposition 4, we see that F is the greedy factorization for α ∈ P F .Therefore, x ′ i + j < y ′ r in β implies x i + j < y r in α . Similarly, x ′ i + j ≤ y ′ r in β implies x i + j ≤ y r in α . Suppose x i + j < y r in α . Let J = ( x , w , . . . , x i , w i ) ∨ ( y r , v r , . . . , y m , v m ) . We have α ∈ P J and the degree of P J is at most 4 k . Hence, β ∈ P J and therefore x ′ i + j < y ′ r by property “2” of Proposition 4 and by choice of pq . Suppose x i + j ≤ y r in α . If x i + j < y r ,then we are done by the previous consideration. So suppose x i + j = y r . We have α ∈ P J with J defined as above. Now, β ∈ P J implies x ′ i + j ≤ y ′ r . Note that we cannot conclude x ′ i + j = y ′ r at this point. This proves the claim.The above claim shows that indeed H = F ∨ G . Let ˜ p ˜ q such that pq ≤ ˜ p ˜ q ≤ β and ˜ p ˜ q hasan L ( k )-factorization of type τ . Then, by property “2” of Proposition 4, the factors of the13 ( k )-factorization of ˜ p ˜ q can only lie further to the right than those of the L ( k )-factorization of pq . Thus considering the L ( k )-factorization of ˜ p ˜ q instead of pq leads to the same factorization H of α . Hence, Lemma 12 shows s ≤ R t . The situation is symmetric in α and β . Therefore, s R t . (cid:3) We are now ready to prove Theorem 5. Proof (Proof of Theorem 5): “1 ⇒ w Γ ∗ w · · · Γ ∗ w n Γ ∞ isdefinable in Σ [ <, +1 , min]. Hence, the Boolean closure of such languages is contained in theBoolean closure of Σ [ <, +1 , min].“2 ⇒ L ) ∈ B is shown in Lemma 9. By Lemma 10, for every linkedpair ( s, e ) of Synt ( L ) we have [ s ] ⊆ L if and only if [ s ][ e ] ω ⊆ L . This is equivalent to thecondition for linked pairs in “3b”, see [10, Proposition 6.4]. The implication “3 ⇒ 4” is trivialsince L is recognized by its syntactic homomorphism.“4 ⇒ α ≡ β if α and β are contained in the same monomials w Γ ∗ w · · · Γ ∗ w n Γ ∞ of degree at most 4 | M | . Every ≡ -class is a finite Boolean combination of such monomials.It therefore suffices to show that β ≡ α ∈ L implies β ∈ L . Suppose α ∈ [ s ][ e ] ω ⊆ L and β ∈ [ t ][ f ] ω for some linked pairs ( s, e ) and ( t, f ). By Proposition 13 we see that α ≡ β implies s R t . Thus [ t ][ f ] ω ⊆ L and in particular β ∈ L . (cid:3) B Σ [ <, +1 , min , max] over Γ ∗ In this section we give a new self-contained proof of Knast’s result for dot-depth one [20].Another proof was given by Th´erien [37]. Both Knast’s and Th´erien’s proof rely on so-calledfinite categories. Our proof uses only elementary algebraic concepts like Green’s relations. Themain part of the proof builds on Proposition 13. Note that a language L ⊆ Γ ∗ is definable in B Σ [ <, +1 , min , max] over Γ ∞ if and only if L is definable in this fragment over Γ ∗ . Theorem 14. Let L ⊆ Γ ∗ . The following are equivalent:1. L has dot-depth one, i.e., L is a finite Boolean combination of monomials w Γ ∗ w · · · Γ ∗ w n .2. L is definable in B Σ [ <, +1 , min , max] .3. Synt( L ) ∈ B .4. L is recognized by some homomorphism h : Γ ∗ → M with h (Γ + ) ∈ B .Proof: “1 ⇒ w Γ ∗ w · · · Γ ∗ w n is definable inΣ [ <, +1 , min , max]. Hence, the Boolean closure of such languages is contained in the Booleanclosure of Σ [ <, +1 , min , max]. “2 ⇒ ⇒ 4” is trivial.“4 ⇒ u ≡ v if u, v ∈ Γ ∗ are contained in the same monomials w Γ ∗ w · · · Γ ∗ w n of degree at most 4 | M | . Every ≡ -class is a Boolean combination of such monomials. Thus itsuffices to show h ( u ) = h ( v ) whenever u ≡ v . Applying Proposition 13 with e = f = 1 shows h ( u ) R h ( v ) if u ≡ v . The reversal of a word w = a · · · a n with a i ∈ Γ is w ′ = a n · · · a . Let u ′ and v ′ be the reversals of u and v , respectively. Now, u ≡ v implies u ′ ≡ v ′ . By Proposition 13we have h ( u ′ ) R h ( v ′ ) in the reversal of M . This in turn is equivalent to h ( u ) L h ( v ) in M .Thus h ( u ) = h ( v ) since M is aperiodic [23, Proposition A.2.9]. Therefore, for every x ∈ M thelanguage h − ( x ) is a Boolean combination of monomials. (cid:3) The Fragment B Σ [ <, +1 , min , max] over Γ ∞ In this section, we incorporate the max-predicate. This leads to an effective characterizationof the first-order fragment B Σ [ <, +1 , min , max] over finite and infinite words. The majordifference between Theorem 15 below and Theorem 5 is that the “topological” linked paircondition is slightly different. To express this new condition, we have to use the pure syntactichomomorphism which can distinguish between finite and infinite words. Theorem 15. Let L ⊆ Γ ∞ be regular. The following assertions are equivalent:1. L is a finite Boolean combination of monomials w Γ ∗ w · · · Γ ∗ w n Γ ∞ and w Γ ∗ w · · · Γ ∗ w n .2. L is definable in B Σ [ <, +1 , min , max] .3. The pure syntactic homomorphism h + : Γ ∗ → Synt + ( L ) satisfiesa) Synt( L ) ∈ B , andb) for all linked pairs ( s, e ) and ( t, f ) of Synt + ( L ) with s R t and e = 1 = f we have [ s ][ e ] ω ⊆ L ⇔ [ t ][ f ] ω ⊆ L .4. L is recognized by a homomorphism h : Γ ∗ → M with h ( u ) = 1 only if u = 1 satisfyinga) h (Γ + ) ∈ B , andb) for all linked pairs ( s, e ) and ( t, f ) of M with s R t and e = 1 = f we have [ s ][ e ] ω ⊆ L ⇔ [ t ][ f ] ω ⊆ L . Before proving Theorem 15 at the end of this section, we give a counterpart of Lemma 10for infinite words. Lemma 16. Let L ⊆ Γ ∞ be definable in B Σ [ <, +1 , min , max] . If h : Γ ∗ → M is a surjectivehomomorphism recognizing L such that h ( u ) = 1 only if u = 1 , then [ s ][ e ] ω ⊆ L ⇔ [ t ][ f ] ω ⊆ L for all linked pairs ( s, e ) and ( t, f ) of M with s R t and e = 1 = f .Proof: Let ϕ ∈ Σ [ <, +1 , min , max] be a sentence. If α ∈ Γ ω models ϕ , then there is a finiteprefix u of α such that for every β ∈ Γ ω we have u β | = ϕ . This is because α | = ϕ yieldssome satisfying assignment for the variables, and positions beyond the last position of thisassignment have no influence.Let L be defined by a formula with quantifier depth d , let t = sx and s = ty for x, y ∈ M .Consider α = ˆ s ˆ e ω for ˆ s ∈ [ s ] and ˆ e ∈ [ e ], and let ˆ x ∈ [ x ], ˆ y ∈ [ y ], and ˆ f ∈ [ f ]. Bythe above consideration, there exists a finite prefix u = ˆ s ˆ e n of α such that β = u ˆ x ˆ f ω models at least the same formulas in Σ [ <, +1 , min , max] with quantifier depth at most d as α does. Similarly, there exists a prefix v = u ˆ x ˆ f m of β such that α = v ˆ y ˆ e ω models atleast the same formulas in Σ [ <, +1 , min , max] with quantifier depth at most d as β does. Wecontinue this process and construct α , β , α , β , . . . such that each word satisfies at leastthe same formulas with quantifier depth d as its predecessor. There are only finitely manynonequivalent Σ [ <, +1 , min , max]-formulas with quantifier depth at most d . Hence, thereexist words α i ∈ [ s ]ˆ e ω and β i ∈ [ t ] ˆ f ω which satisfy the same formulas in Σ [ <, +1 , min , max]with quantifier depth at most d . Now, α i ∈ L if and only if β i ∈ L . This yields [ s ][ e ] ω ⊆ L ifand only if [ t ][ f ] ω ⊆ L . (cid:3) Combining Theorem 5, Theorem 14, and Lemma 16 yields the following proof of Theorem 15. Proof (Proof of Theorem 15): “1 ⇒ w Γ ∗ w · · · Γ ∗ w n Γ ∞ or w Γ ∗ w · · · Γ ∗ w n is definable in Σ [ <, +1 , min , max]. Therefore, the Boolean closure of suchlanguages is contained in B Σ [ <, +1 , min , max].152 ⇒ L be defined by ϕ ∈ B Σ [ <, +1 , min , max]. Lemma 9 shows Synt( L ) ∈ B .The condition “3b” for the linked pairs follows from Lemma 16.“3 ⇒ h + : Γ ∗ → Synt + ( L ) recognizes L and h + maps only theempty word to 1 ∈ Synt + ( L ).“4 ⇒ L ω = L ∩ Γ ω and let L ∞ be the union of the language L ω and the followinglanguage over finite words: [ { [ s ] | L ω ∩ [ s ][ e ] ω = ∅ for some linked pair ( s, e ) of M } . Then L ∞ satisfies condition “4” in Theorem 5 for the homomorphism h and hence L ∞ is afinite Boolean combination of monomials w Γ ∗ w · · · Γ ∗ w n Γ ∞ . Since Γ ω is a finite Booleancombination of languages Γ ∗ a and a Γ ∞ for a ∈ Γ, we see that L ω = L ∞ ∩ Γ ω is a finite Booleancombination of monomials w Γ ∗ w · · · Γ ∗ w n Γ ∞ and w Γ ∗ w · · · Γ ∗ w n . Consider L ∗ = L ∩ Γ ∗ .Lemma 1 shows that L ∗ is recognized by h . Therefore, L is a finite Boolean combination ofmonomials w Γ ∗ w · · · Γ ∗ w n by Theorem 14. Thus L = L ∗ ∪ L ω is of the required form. (cid:3) B Σ [ <, +1 , min] over Γ ω If we consider infinite words only, the predicate max is always false. Hence, the first-order frag-ments B Σ [ <, +1 , min , max] and B Σ [ <, +1 , min] coincide. In this section we give an effectivecharacterization of this fragment for infinite words. It is a rather straightforward consequenceof Theorem 15. Theorem 17. Let L ⊆ Γ ω be regular. The following assertions are equivalent:1. L has dot-depth one, i.e., L is a finite Boolean combination of monomials of the form w Γ ∗ w · · · Γ ∗ w n Γ ω .2. L is definable in B Σ [ <, +1 , min] over Γ ω .3. The pure syntactic homomorphism h + : Γ ∗ → Synt + ( L ) satisfiesa) Synt( L ) ∈ B , andb) for all linked pairs ( s, e ) and ( t, f ) of Synt + ( L ) with s R t and e = 1 = f we have [ s ][ e ] ω ⊆ L ⇔ [ t ][ f ] ω ⊆ L .4. L is recognized by a homomorphism h : Γ ∗ → M with h ( u ) = 1 only if u = 1 satisfyinga) h (Γ + ) ∈ B , andb) for all linked pairs ( s, e ) and ( t, f ) of M with s R t and e = 1 = f we have [ s ][ e ] ω ⊆ L ⇔ [ t ][ f ] ω ⊆ L .Proof: “1 ⇒ L is a Boolean combination of monomials w Γ ∗ w · · · Γ ∗ w n Γ ω , then L canalso be written as a Boolean combination of monomials w Γ ∗ w · · · Γ ∗ w n Γ ∞ and Γ ∗ a for a ∈ Γ.By Theorem 15 the language L is definable in B Σ [ <, +1 , min , max] over Γ ∞ . Since max isfalse for all positions of an infinite word, L is definable in B Σ [ <, +1 , min] over Γ ω .“2 ⇒ L be definable in the fragment B Σ [ <, +1 , min] over Γ ω . Then L is definablein B Σ [ <, +1 , min , max] over Γ ∞ and by Theorem 15 the claim follows. “3 ⇒ ⇒ L ∞ be the union of L and the following language over finite words [ { [ s ] | L ∩ [ s ][ e ] ω = ∅ for some linked pair ( s, e ) of M } . Now, L ∞ satisfies condition “4” in Theorem 5 for the homomorphism h and we obtain that L ∞ is a Boolean combination of monomials w Γ ∗ w · · · Γ ∗ w n Γ ∞ . Moreover, L = L ∞ ∩ Γ ω and L isa Boolean combination of monomials w Γ ∗ w · · · Γ ∗ w n Γ ω . (cid:3) ragment Models Languages Algebra + Linked Pairs B Σ [ <, +1 , min] Γ ∞ B { w Γ ∗ · · · Γ ∗ w n Γ ∞ } B + R -closed Thm. 5 B Σ [ <, +1 , min , max] Γ ∞ B n w Γ ∗ · · · Γ ∗ w n Γ ∞ w Γ ∗ · · · Γ ∗ w n o B + R + -closed Thm. 15 B Σ [ <, +1 , min , max] Γ ∗ B { w Γ ∗ · · · Γ ∗ w n } B [20], Thm. 14 B Σ [ <, +1 , min] Γ ω B { w Γ ∗ · · · w n Γ ω } B + R + -closed Thm. 17 Table 2: Characterizations of the fragment B Σ for various signatures and modelsSince condition “3” in Theorem 17 is decidable, we obtain the following corollary. Corollary 18. It is decidable whether a regular language L ⊆ Γ ω has dot-depth one. (cid:3) Remark 19. Another algebraic framework for infinite words are ω -semigroups [23]. An ω -semigroup ( S + , S ω ) has two components. The first component S + is a semigroup equippedwith an infinite product operation and S ω is the set of results of infinite products. The condi-tions “3” in Theorem 15 and “3” in Theorem 17 are equivalent to saying that the syntactic ω -semigroup ( S + , S ω ) satisfies S + ∈ B and ( x π y π ) π x ω = ( x π y π ) π y ω in S ω for all x, y ∈ S + ,cf. [23, Theorem VI.3.8 (6)]. Here, x π ∈ S + denotes the idempotent generated by x and x ω is an infinite product. The two components of an ω -semigroup inevitably distinguish betweenfinite nonempty and infinite words. Therefore, ω -semigroups are only suitable for fragmentswhich can distinguish finite from infinite words. In particular, B Σ [ <, +1 , min] cannot distin-guish between finite and infinite words and condition “3” in Theorem 5 is not an equational ω -semigroup condition. In Table 2 we summarize our results on alternation-free first-order logic B Σ . We gave classes oflanguages for which B Σ [ <, +1 , min] and B Σ [ <, +1 , min , max] are expressively complete. Ourmain results are characterizations of the syntactic homomorphisms of such languages. Thesecharacterizations are combinations of algebraic and topological properties. The topologicalproperties are stated in terms of linked pairs.An entry “ R -closed” in the column “Linked Pairs” of Table 2 stands for the equivalence[ s ][ e ] ω ⊆ L ⇔ [ t ][ f ] ω ⊆ L for all linked pairs ( s, e ) and ( t, f ) with s R t in the syntacticmonoid. For “ R + -closed” this equivalence has to hold for the pure syntactic homomorphismand e = 1 = f .Over Γ ∞ there are two variants of the Cantor topology. The first one is defined by thebase sets u Γ ∞ for u ∈ Γ ∗ , and base sets for the second one are u Γ ω and { u } . A regularlanguage is a finite Boolean combination of Cantor sets of the first kind if and only if itssyntactic homomorphism is “ R -closed”. Boolean combinations of Cantor sets of the secondkind correspond to “ R + -closed”.In all cases, the combination of the algebraic and the topological properties gives decidabilityof the membership problem for the respective fragment.17 cknowledgments We thank the anonymous referees of the conference version of this paper for their suggestionswhich helped to improve the presentation. References [1] M. Boja´nczyk. The common fragment of ACTL and LTL. In FoSSaCS’08, Proceedings , volume4962 of LNCS , pages 172–185. Springer, 2008.[2] M. Boja´nczyk. Data monoids. In STACS’11, Proceedings , volume 9 of LIPIcs , pages 105–116.Dagstuhl Publishing, 2011.[3] M. Boja´nczyk and I. Walukiewicz. Forest algebras. In Logic and Automata: History and Perspec-tives , Texts in Logic and Games, pages 107–132. Amsterdam University Press, 2008.[4] J. A. Brzozowski and R. Knast. The dot-depth hierarchy of star-free languages is infinite. J.Comput. Syst. Sci. , 16(1):37–55, 1978.[5] L. Chaubard, J.-´E. Pin, and H. Straubing. First order formulas with modular predicates. In LICS’06, Proceedings , pages 211–220. IEEE Computer Society, 2006.[6] R. S. Cohen and J. A. Brzozowski. Dot-depth of star-free events. J. Comput. Syst. Sci. , 5(1):1–16,1971.[7] V. Diekert and P. Gastin. First-order definable languages. In Logic and Automata: History andPerspectives , Texts in Logic and Games, pages 261–306. Amsterdam University Press, 2008.[8] V. Diekert, P. Gastin, and M. Kufleitner. A survey on small fragments of first-order logic overfinite words. Int. J. Found. Comput. Sci. , 19(3):513–548, 2008.[9] V. Diekert, M. Horsch, and M. Kufleitner. On first-order fragments for Mazurkiewicz traces. Fundam. Inform. , 80:1–29, 2007.[10] V. Diekert and M. Kufleitner. Fragments of first-order logic over infinite words. Theory Comput.Syst. , 48:486–516, 2011.[11] V. Diekert and Y. M´etivier. Partial commutation and traces. In Handbook of Formal Languages ,volume 3, pages 457–533. Springer, 1997.[12] S. Eilenberg. Automata, Languages, and Machines , volume B. Academic Press, 1976.[13] E. A. Emerson. Temporal and modal logic. In Handbook of Theoretical Computer Science , vol-ume B, chapter 16, pages 995–1072. Elsevier, 1990.[14] Z. ´Esik and P. Weil. Algebraic characterization of logically defined tree languages. Int. J. AlgebraComput. , 20(2):195–239, 2010.[15] K. Etessami, M. Y. Vardi, and Th. Wilke. First-order logic with two variables and unary temporallogic. Inf. Comput. , 179(2):279–295, 2002.[16] M. Gehrke, S. Grigorieff, and J.-´E. Pin. Duality and equational theory of regular languages. In ICALP’08, Proceedings , volume 5126 of LNCS , pages 246–257. Springer, 2008.[17] Ch. Glaßer and H. Schmitz. Languages of dot-depth 3 / Theory Comput. Syst. , 42(2):256–286,2008.[18] J. Kallas, M. Kufleitner, and A. Lauser. First-order fragments with successor over infinite words.In STACS’11, Proceedings , volume 9 of LIPIcs , pages 356–367. Dagstuhl Publishing, 2011.[19] O. Kl´ıma. Piecewise testable languages via combinatorics on words. Unpublished, 2009.[20] R. Knast. A semigroup characterization of dot-depth one languages. RAIRO, Inf. Th´eor. ,17(4):321–330, 1983.[21] K. Lodaya, P. K. Pandya, and S. S. Shah. Marking the chops: an unambiguous temporal logic. In IFIP TCS’08, Proceedings , volume 273 of IFIP , pages 461–476. Springer, 2008.[22] R. McNaughton and S. Papert. Counter-Free Automata . The MIT Press, 1971. 23] D. Perrin and J.-´E. Pin. Infinite words , volume 141 of Pure and Applied Mathematics . Elsevier,2004.[24] J.-´E. Pin. A variety theorem without complementation. In Russian Mathematics (Iz. VUZ) ,volume 39, pages 80–90, 1995.[25] J.-´E. Pin. Syntactic semigroups. In Handbook of Formal Languages , volume 1, pages 679–746.Springer, 1997.[26] J.-´E. Pin and P. Weil. Polynomial closure and unambiguous product. Theory Comput. Syst. ,30(4):383–422, 1997.[27] F. P. Ramsey. On a problem of formal logic. Proc. London Math. Soc. , 30:264–286, 1930.[28] M. P. Sch¨utzenberger. On finite monoids having only trivial subgroups. Inf. Control , 8:190–194,1965.[29] I. Simon. Piecewise testable events. In Automata Theory and Formal Languages , volume 33 of LNCS , pages 214–222. Springer, 1975.[30] L. Stockmeyer. The complexity of decision problems in automata theory and logic. PhD thesis,TR 133, M.I.T., Cambridge, 1974.[31] H. Straubing. A generalization of the Sch¨utzenberger product of finite monoids. Theor. Comput.Sci. , 13:137–150, 1981.[32] H. Straubing. Finite semigroup varieties of the form V ∗ D . J. Pure Appl. Algebra , 36(1):53–94,1985.[33] H. Straubing. Finite Automata, Formal Logic, and Circuit Complexity . Birkh¨auser, 1994.[34] H. Straubing. On the logical descriptions of regular languages. In LATIN’02, Proceedings , volume2286 of LNCS , pages 528–538. Springer, 2002.[35] P. Tesson and D. Th´erien. Logic meets algebra: The case of regular languages. Log. MethodsComput. Sci. , 3(1):1–37, 2007.[36] D. Th´erien. Classification of finite monoids: The language approach. Theor. Comput. Sci. ,14(2):195–208, 1981.[37] D. Th´erien. Categories et langages de dot-depth un. RAIRO, Inf. Th´eor. , 22(4):437–445, 1988.[38] W. Thomas. Classifying regular events in symbolic logic. J. Comput. Syst. Sci. , 25:360–376, 1982.[39] W. Thomas. Automata on infinite objects. In Handbook of Theoretical Computer Science , chapter 4,pages 133–191. Elsevier, 1990.[40] B. Tilson. Categories as algebras: An essential ingredient in the theory of monoids. J. Pure Appl.Algebra , 48:83–198, 1987.[41] P. Weil. Algebraic recognizability of languages. In MFCS’04, Proceedings , volume 3153 of LNCS ,pages 149–174. Springer, 2004.[42] Th. Wilke. Classifying Discrete Temporal Properties . Habilitationsschrift, Universit¨at Kiel, April1998.. Habilitationsschrift, Universit¨at Kiel, April1998.