The \v{C}erny Conjecture for aperiodic automata

A word w is called a synchronizing (recurrent, reset) word of a deterministic finite automaton (DFA) if w brings all states of the automaton to some state; a DFA that has a synchronizing word is said to be synchronizing. Cerny conjectured in 1964 that every n-state synchronizing DFA possesses a synchronizing word of length at most (n -1)2. We consider automaton with aperiodic transition monoid (such automaton is called aperiodic). We show that every synchronizing n-state aperiodic automaton has a synchronizing word of length at most n(n-2)+1. Thus, for aperiodic automaton as well as for automatons accepting only star-free languages, the Cerny conjecture holds true.


Introduction
The problem of synchronization of DFA is natural and various aspects of this problem were touched upon the literature.We pay attention to the problem of the existence and of the length of a synchronizing word.
An important problem with a long story is estimating the shortest length of a synchronizing word.Best known as the Černý conjecture, it was proposed independently by several authors.Černý found in 1964 [2] an n-state DFA whose shortest synchronizing word was of length (n − 1) 2 .He conjectured that this is the maximum length of the shortest synchronizing word for any DFA with n states.The conjecture has been verified for several partial cases [1,3,4,6,10,8] but in general the question still remains open.By now, this simply looking conjecture is arguably one of the most longstanding open problems in the theory of finite automata.The best upper bound for the length of the shortest synchronizing word for DFA with n states known so far is equal to (n 3 − n)/6 [5,7,9].For the rich and intriguing story of investigations in this area see [12].
The existence of some non-trivial subgroup in the transition semigroup of the automaton is essential in many investigations of the Černý conjecture, see, e.g., [3,8].We use another approach and consider transition semigroups without non-trivial subgroups.This condition distinguishes a wide class of socalled aperiodic automata that, as shown by Schützenberger [13], accept precisely star-free languages (also known as languages of star height 0).Star-free languages play a significant role in formal language theory.
We prove that every n-state aperiodic DFA with a state that is accessible from every state of the automaton has a synchronizing word of length not greater than n(n − 1)/2, and therefore, for aperiodic automata as well as for automata accepting only star-free languages, the Černý conjecture holds true.
In the case when the underlying graph of the aperiodic DFA is strongly connected, this upper bound has been recently improved by Volkov who has reduced the estimation to n(n + 1)/6.

Preliminaries
We consider a complete DFA A with the input alphabet Σ.The transition graph of A is denoted by Γ and the transition semigroup of A is denoted by S.
Let p and q be two (not necessarily distinct) states of the automaton A. If there exists a path in A from the state p to the state q and the transitions of the path are consecutively labelled by σ 1 , . . ., σ k ∈ Σ then for s = σ 1 . . .σ k we write q = ps.We call a state q a sink if for every state p of A there exists a word s such that ps = q.For a set P of states and s ∈ Σ * , let P s denote the set {ps | p ∈ P }.A word s ∈ Σ + is called a synchronizing word for P if |P s| = 1, that is, ps = qs for all states p, q ∈ P .A word is said to be a synchronizing word of the automaton A (of the graph Γ) if it is synchronizing for the set of all states of A (the set of all vertices of Γ).
A binary relation β on the state set of A is called stable if, for any pair of states q, p and any σ ∈ Σ, from q β p it follows qσ β pσ.Recall that a stable equivalence relation on the state set of A is called a congruence of A. If ρ is a congruence of A, we denote by [q] ρ the ρ-class containing the state q.The quotient A/ρ is the automaton with the states [q] ρ and the transition function defined by the rule [q] ρ σ = [qσ] ρ for any σ ∈ Σ.
For a word s over the alphabet Σ, we denote its length by |s|.
2 The graph Γ 2 The direct square Γ 2 of the transition graph Γ has as vertices all pairs (p, q), where p, q are vertices of Γ.
The edges of the graph Γ 2 have the form (p, q) → (pσ, qσ) where σ ∈ Σ; such an edge is labelled by σ.
For brevity, a strongly connected component of a directed graph is referred to as an SCC.An SCC M of the graph Γ 2 is called almost minimal if, for every pair (p, q) ∈ M , one has p = q and, for every σ ∈ Σ such that pσ = qσ, there exists a word s ∈ Σ * such that (pσ, qσ)s = (p, q).We observe that then (pσ, qσ) ∈ M by the definition of an SCC.By Γ(M ) we denote the set of states that appear as components in the pairs from the almost minimal SCC M .
If M is an almost minimal SCC, we define the relation M as the transitive closure of M (where M is treated as a relation on the state set of our automaton).So r M q if there exists a sequence of states r = p 1 , . . ., p n = q such that n > 1 and (p i , p i+1 ) ∈ M for all i = 1, . . ., n − 1.Let M be the reflexive closure and ρ M the equivalent closure of the relation M .

Lemma 1 For any almost minimal SCC M , the relation M is stable and the relation ρ M is a congruence.
Proof: Suppose u ρ M v. Then there exists a sequence of states such that for every integer i < n at least one of the pairs (p i+1 , p i ), (p i , p i+1 ) belongs to the almost minimal SCC M .Therefore in the sequence of states rs = p 1 s, . . ., p n s = qs, for any two distinct neighbors p i s, p i+1 s, the pair (p i s, p i+1 s) or its dual belongs to M .Hence rs ρ M qs.
If u M v, then there exists a sequence (1) such that for every integer i < n the pair (p i , p i+1 ) belongs to M .Then either (p i s, p i+1 s) ∈ M or p i s = p i+1 s, and therefore, p i s M p i+1 s in any case.Hence us M vs. 2 From the definition of the relation M and Lemma 1, we obtain Corollary 2 If r M q and rs / ∈ Γ(M ) for some word s, then rs = qs.
We also observe the following obvious property: Let us present the following new formulation of a result from [2]: Lemma 4 An automaton A with the transition graph Γ is synchronizing if and only if the graph Γ 2 has a sink.

Proof:
Let s be a synchronizing word of A. Then the unique pair of the set Γ 2 s is a sink of Γ 2 .Conversely, the components of a sink of Γ 2 obviously are equal.Let (t, t) be a sink.For any pair (p, q), there exists a word s such that (p, q)s = (t, t), that is, ps = qs = t.Some product of such words s taken for all pairs of distinct states from Γ is a synchronizing word of the graph Γ. 2

Lemma 5
The sets of synchronizing words of the graphs Γ and Γ 2 coincide.
Proof: Let s be a synchronizing word of the graph Γ.Then there is a state q from Γ such that ps = q for every state p. Therefore for every pair (p, r) one has (p, r)s = (q, q).Thus, s is a synchronizing word of the graph Γ 2 .Now let t be a synchronizing word of the graph Γ 2 .Then there is a pair (q, v) such that (p, r)t = (q, v) for every pair (p, r).Therefore pt = q for an arbitrary state p from Γ and rt = v for an arbitrary state r from Γ. Consequently, v = q and t is a synchronizing word of the graph Γ. 2

Aperiodic automata
A semigroup without non-trivial subgroups is called aperiodic.A DFA with aperiodic transition semigroup is called aperiodic too.Let us recall that the syntactic semigroup of a star-free language is finite and aperiodic [13] and the semigroup satisfies the identity x n = x n+1 for some suitable n.Therefore, for any state p ∈ Γ, any s ∈ S and for some suitable k, one has ps k = ps k+1 .Lemma 6 Let A be an aperiodic DFA.Then the existence of a sink in A is equivalent to the existence of a synchronizing word.
Proof: It is clear that, for any DFA, the existence of a synchronizing word implies the existence of a sink.Now suppose that A has at least one sink.For any state p and any sink p 0 , there exists an element s from the transition semigroup S such that ps = p 0 .The semigroup S is aperiodic, whence for some positive integer m we have s m = s m+1 .Therefore ps m = ps m+1 = p 0 s m , whence the element s m brings both p and p 0 to the same state p 0 s m which is a sink again.We repeat the process reducing the number of states on each step.Then some product of all elements of the form s m arising on each step brings all states of the automaton to some sink.Thus, we obtain in this way a synchronizing word. 2 Let M be an almost minimal SCC.A t-cycle for M is a sequence of states such that n > 1 and (p i , p i+1 ) ∈ M for all i = 1, . . ., m − 1.The next observation is the key ingredient of the proof.

Lemma 7
Let A be an aperiodic DFA and let M be an almost minimal SCC.Then there is no t-cycle for M and the quasi-order M is a partial order.
Proof: Suppose that ( 2) is a t-cycle of minimum size m among all t-cycles for the almost minimal SCC M .Let us first establish that m > 2. Indeed, p 1 = p 2 , whence m > 1.If m = 2 then the two pairs (p 1 , p 2 ) and (p 2 , p 1 ) belong to the SCC M .For some element u from the transition semigroup S, we have (p 1 , p 2 )u = (p 2 , p 1 ).Therefore p 1 u = p 2 , p 2 u = p 1 , whence p 1 u 2 = p 1 = p 1 u.This implies p 1 u 2k = p 1 = p 1 u = p 1 u 2k+1 for any integer k.However, semigroup S is finite and aperiodic, and therefore, for some k we have u 2k = u 2k+1 , whence p 1 u 2k = p 1 u 2k+1 , a contradiction.Thus, we can assume that m > 2 and suppose that the states p 1 , p 2 , p 3 are distinct.For some element s ∈ S, we have (p 1 , p 2 )s = (p 2 , p 3 ).Hence For any element u ∈ S and any pair (p i , p i+1 ) from M , we have either p i u = p i+1 u or (p i u, p i+1 u) ∈ M .Therefore, for any element u ∈ S, the sequence of states p 1 u, . . ., p m u either reduces to just one element repeated m times or forms a t-cycle of size m (because of the minimality of m).
The states p 1 , p 1 s, p 1 s 2 are distinct.Since S is an aperiodic finite semigroup, there exists some integer such that s = s +1 = s +2 .Therefore there exists an k ≤ such that p 1 s k = p 1 s k+1 = p 1 s k+2 the sequence p 1 s k , p 2 s k = p 1 s k+1 , p 3 s k = p 1 s k+2 ,. . ., p m s k has more than 1 but less than m distinct elements.This contradicts the conclusion of the previous paragraph applied to the element u = s k .
It is easy to see that if the quasi-order M is not antisymmetric that there exists a t-cycle for M .Hence M is a partial order.Proof: Suppose |R| > 1.Let M ax be the set of all maximal and M in the set of all minimal states from R with respect to the order M .Observe that there is no ambiguity here: since the order M is contained in the congruence ρ M , maximal (minimal) states of the ordered set (R, M ) are precisely those maximal (minimal) states of the automaton A that belong to R. Further, M ax ∩ M in = ∅ because the congruence ρ M is the equivalent closure of the order M whence for every state q ∈ R there must be a state p ∈ R such that either q M p or p M q.Without loss of generality, we may assume that |M ax| ≥ |M in|.
We need three properties of ordered sets of the form (Rs, M ) where s is a word.Let M ax s (M in s ) stand for the set of all maximal (respectively all minimal) states in (Rs, M ).
Proof: Take an arbitrary state p ∈ M in s and let q be any state in Rs \ {p }.Consider some preimages p, q ∈ R of p and respectively q .Since R is a ρ M -class, there is a sequence of states q 0 , q 1 , . . ., q k ∈ R such that p = q 0 , q k = q, and for each i = 1, . . ., k either q i−1 M q i or q i M q i−1 .Let q i = q i s ∈ Rs, i = 0, . . ., k.Since the order M is stable (Lemma 1), we conclude that there is a sequence of states q 0 , q 1 , . . ., q k ∈ Rs such that p = q 0 , q k = q , and for each i = 1, . . ., k either q i−1 M q i or q i M q i−1 .Since p = q , some of these inequalities must be strict.Let j be the least index such that q j−1 = q j .Then p = q 0 = . . .= q j−1 whence either p M q j or q j M p .As the first inequality would contradict the assumption that p is a minimal element of (Rs, M ), we conclude that the second inequality holds true whence p is not a maximal element of (Rs, M ).Thus, no state in M in s can belong to M ax s . 2 Claim 2. If s, t ∈ Σ * are two arbitrary words, then M in ts ⊆ M in t s.
Proof: Take an arbitrary state p ∈ M in ts and consider its arbitrary preimage p ∈ Rt.There exists a state q ∈ M in t such that p M q.Since the order M is stable (Lemma 1), we then have p = p s M q s = q .The state q belongs to the set Rts, and therefore, q = p because p has been chosen to be a minimal element in this set.Thus, we have found a preimage for p in M in t whence M in ts ⊆ M in t s.Proof: Now take arbitrary state q ∈ M in t .Since the graph Γ is strongly connected, there exists a word that maps q to an element of M ax.If s is a word of minimum length with this property then the path labelled s does not visit any state of A twice whence |s| ≤ n − 1. Observe that since qs ∈ M ax, we also have qs ∈ M ax ts .Therefore either |Rst| = 1 or, by Claim 1 above, qs / ∈ M in ts .Since qs ∈ M in t s, we conclude from Claim 2 that M in ts ⊂ M in t s.Thus, Using Claim 3, we can easily complete the proof of the lemma.Indeed, applying it to the case when t is the empty word, we can find a word s 1 of length at most n − 1 such that either |Rs 1 | = 1 or |M in s1 | < |M in|.In the latter case, applying Claim 3 again, we can find a word s 2 of length at most n − 1 such that either |Rs 1 s 2 | = 1 or |M in s1s2 | < |M in s1 |, and so on.Clearly, the process will stop after at most |M in| steps yielding a word s = s Theorem 9 If the transition graph Γ of an aperiodic DFA A with n states is strongly connected, then A has a synchronizing word of length at most (n − 1)n/2.
Proof: All states of a DFA whose transition graph is strongly connected are sinks.Therefore the automaton is synchronizable (Lemma 6).
There exists at least one almost minimal SCC M in Γ 2 because the number of SCC's is finite and the set of SCC's is partially ordered under the attainability relation.Consider the congruence ρ M (Lemma 1) and the quotient Γ/ρ M .
It is clear that any synchronizing word of Γ synchronizes also Γ/ρ M and that Γ/ρ M is aperiodic and strongly connected.Therefore the graph Γ has a synchronizing word uv where u is a synchronizing word of Γ/ρ M and v is a synchronizing word of the preimage R of the singleton set (Γ/ρ M ) u.By Corollary 3, ρ M is not trivial, therefore r = |Γ/ρ M | < n and we can use induction assuming |u| ≤ (r − 1)r/2.By Lemma 8, a word v of length at most Let us go to the general case.
Theorem 10 Let A be an aperiodic DFA with n states.Then the existence of a sink in A is equivalent to the existence of a synchronizing word of length at most n(n − 1)/2.
Proof: It is clear that the existence of a synchronizing word implies the existence of a sink.For the converse, let us consider a DFA with at least one sink.By Lemma 6, the automaton is synchronizable.We may assume in view of Theorem 9 that the transition graph Γ of A is not strongly connected.
It is clear that the collection C of all sinks of Γ forms a SCC of Γ which is the least SCC with respect to the attainability order.Let r < n stand for the cardinality of C. Let Γ i (i = 1, 2, . . ., k) be all other SCC's of Γ.We may assume that Γ i are numbered so that i ≤ j whenever there is a path in Γ from Γ i to Γ j .Let r i be the cardinality of Γ i .It easily follows from [11,Theorem 6.1] that there exists a word s i of length at most r i (r i + 1)/2 such that Γ i s i ∩ Γ i is empty.Then the product s

2 4 The Černý conjecture Lemma 8
Let A be an aperiodic DFA with n states and strongly connected graph, M an almost minimal SCC.Let r be the number of ρ M -classes and let R be a ρ M -class.Then |Rs| = 1 for some word s ∈ Σ * of length ar most (n − r + 1)(n − 1)/2.

2 Claim 3 .
For any word t ∈ Σ * , there exists a word s ∈ Σ * of length at most n − 1 such that either |Rst| = 1 or |M in ts | < |M in t |.

2 Corollary 11
1 • • • s k of maps Γ into the SCC C. By Theorem 9, C has a synchronizing word s of length at most r(r − 1)/2.Therefore the word s 1 • • • s k s synchronizes Γ and |s 1 . . .s k s| ≤ i + r = n, it is easy to calculate that the right-hand side of the inequality 3 does not exceed (n − 1)n/2.The Černý conjecture holds for aperiodic automata.