{'fraction_non_alphanumeric': 0.06495688483680478, 'fraction_numerical': 0.008450077829664221, 'mean_word_length': 3.213408286487612, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 24, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
A New Technique for Reachability of States in Concatenation Automata

We present a new technique for demonstrating the reachability of states in deterministic finite automata representing the concatenation of two languages. Such demonstrations are a necessary step in establishing the state complexity of the concatenation of two languages, and thus in establishing the state complexity of concatenation as an operation. Typically, ad-hoc induction arguments are used to show particular states are reachable in concatenation automata. We prove some results that seem to capture the essence of many of these induction arguments. Using these results, reachability proofs in concatenation automata can often be done more simply and without using induction directly.


Introduction
Formal definitions are postponed until Section 2.
The state complexity of a regular language L, denoted sc(L), is the least number of states needed to recognize the language with a deterministic finite automaton. The state complexity of an operation on regular languages is the worst-case state complexity of the result of the operation, expressed as a function of the maximal allowed state complexity of the input languages. For example, suppose L is a language of state complexity at most m, and K is a language of state complexity at most n. It is known that the intersection L ∩ K has state complexity at most mn, and that this upper bound can be attained. Thus, we say that the state complexity of intersection is the function (m, n) → mn.
To establish the state complexity of an operation, there are two steps. First, one derives an upper bound. For example, in the case of intersection, if the input languages L and K have state complexity at most m and at most n respectively, then the standard direct product construction gives an automaton for L ∩ K with mn states, leading to the aforementioned upper bound of mn. Next, one searches for witnesses to the upper bound, that is, languages which attain the upper bound for each value of m and n. In the case of intersection, this means for each pair (m, n), one must find a pair of languages (L m , K n ) with sc(L m ) ≤ m and sc(K n ) ≤ n such that sc(L m ∩ K n ) = mn.
One must not only find these witnesses but also prove that the desired state complexity bound is reached. Such proofs are the subject of this paper. We are interested in the case where the operation is concatenation of languages. We assume that one is working within some subclass of the regular languages, and has derived an upper bound f (m, n) for the worst-case state complexity of concatenation within this subclasses. We also assume one has found (by computer search or some other means) candidate witnesses for this upper bound, in the form of two sequences of languages (L m : m ≥ 1) and (K n : n ≥ 1) such that sc(L m ) ≤ m and sc(K n ) ≤ n. The goal is to prove that for each pair (m, n), the concatenation L m K n has state complexity f (m, n). We may divide such a proof into three steps: 1. Construct an automaton A for L m K n in the standard way.
2. Show that A contains at least f (m, n) reachable states. 3. Show exactly f (m, n) reachable states in A are pairwise distinguishable.
We present a new technique for dealing with step (2) of this process. The standard way to construct a deterministic finite automaton A for the concatenation of two languages yields an automaton in which the states are sets; to show a particular set is reachable, one typically proceeds by induction on the size of the set. We prove a result that seems to generalize many of these ad-hoc induction arguments, and can be used to establish reachability of sets without directly using induction. Additionally, we prove some helpful lemmas that make our main result easier to apply.
We demonstrate our technique by applying it to a variety of concatenation witnesses taken from the literature. The state complexity of concatenation has been studied in the class of all regular languages, as well as many subclasses. Table 1 lists some examples of subclasses that have been studied, and the state complexity of concatenation in each subclass. See the cited papers for definitions of each subclass and derivations/proofs of each complexity. The complexities listed are "restricted" complexities, that is, they are computed under the assumption that both inputs to the concatenation operation share the same alphabet. "Unrestricted" state complexity of concatenation (where the inputs may be languages over different alphabets) has also been studied, and will be discussed later, but is not included in the table.
If the state complexity of concatenation grows exponentially with n (indicated in Table 1 by bold type), it is typical to use an induction argument to prove the desired number of states is reachable. It is cases like this in which our technique is most likely to be useful. We selected 16 concatenation witnesses, all from subclasses in which the state complexity of concatenation is exponential in n, and tried to apply our technique to these witnesses. In many cases we were able to produce shorter and simpler proofs than the original authors, and we only found two cases in which our technique did not work or was not useful.
This suggests that our technique is widely applicable and should be considered as an viable alternative to the traditional induction argument when attempting reachability proofs in concatenation automata. The rest of the paper is structured as follows. Section 2 contains background material and definitions needed to understand the paper. Section 3 describes our new technique and proves the relevant results. Section 4 contains examples of our technique applied to numerous concatenation witnesses from the literature. Section 5 concludes the paper.

Relations and Functions
A binary relation ρ between X and Y is a subset of X × Y . If ρ ⊆ X × Y and τ ⊆ Y × Z, the composition of ρ and τ is the relation ρτ = {(x, z) ∈ X × Z : there exists y ∈ Y such that (x, y) ∈ ρ and (y, z) ∈ τ }. For x ∈ X and ρ ⊆ X × Y , the image of x under ρ is the set xρ = {y ∈ Y : (x, y) ∈ ρ}. For x ∈ X we define xρ = ∅. The converse of a binary relation ρ ⊆ X × Y is the relation ρ −1 = {(y, x) : (x, y) ∈ ρ} ⊆ Y × X. The set yρ −1 = {x ∈ X : (x, y) ∈ ρ} is called the preimage of y under ρ. Elements of this set are callled preimages of y; for example, if x ∈ yρ −1 we say that x is a preimage of y.
If we write P(S) for the power set of a set S (that is, the set of all subsets of S), then we can view ρ as a map ρ : X → P(Y ). We may also extend ρ by union to a map ρ : P(X) → P(Y ) as follows: for S ⊆ X, we define We thus have two ways to make sense of an expression like xρτ : it is the image of x under the composite relation ρτ ⊆ X × Z, and it is also the image of the set xρ ⊆ Y under the map τ : P(Y ) → P(Z). Additionally, we have a way to make sense of a composition ρτ : X → P(Z) of maps ρ : X → P(Y ) and τ : Y → P(Z): take the composition of the corresponding relations.
A function f : X → Y is a binary relation f ⊆ X × Y such that |xf | = 1 for all x ∈ X. Following our notation for binary relations, we write functions to the right of their arguments. Composition of functions is defined by composing the corresponding relations. Thus the order of composition is left-to-right ; in a composition f g, first f is applied and then g.
A transformation of a set X is a function t : X → X, that is, a function from X into itself. We say t is a permutation of X if Xt = X. We say t acts as a permutation on S ⊆ X if St = S. If t acts as a permutation on S, then every element of S has at least one preimage under t, that is, for all s ∈ S, the set st −1 = {x ∈ X : xt = s} is non-empty.
A cyclic permutation of a set {x 1 , . . . , x k } ⊆ X is a permutation p such that We denote such a permutation as (x 1 , . . . , x k ). A cyclic permutation of a twoelement set is called a transposition. The identity transformation is denoted id.
The notation (S → x) for S ⊆ X and x ∈ X denotes a transformation that sends every element of S to x and fixes every element of S \ X. For example, ({i} → j) denotes a transformation that maps i to j and fixes everything else. The transformation (X → x) is a constant transformation that maps every element of X to x.
In the case where X = {1, 2, . . . , n}, the notation ( j i x → x + 1) denotes a transformation such that for each x with i ≤ x ≤ j, the transformation sends x to x + 1, and every other x is fixed. For example, the transformation ( n−1 2 x → x + 1) fixes 1, sends x to x + 1 for 2 ≤ x ≤ n − 1, and fixes n. The notation ( j i x → x − 1) is defined similarly.

Automata
A finite automaton (FA) is a tuple A = (Q, Σ, T, I, F ) where Q is a finite set of states, Σ is a finite set of letters called an alphabet, T ⊆ Q × Σ × Q is a set of transitions, I ⊆ Q is a set of initial states, and F ⊆ Q is a set of final states. We now define a binary relation T w ⊆ Q × Q for each w ∈ Σ * . Define T ε = {(q, q) : q ∈ Q}; in terms of maps, this is the identity map on Q. For a ∈ Σ, define T a = {(p, q) ∈ Q × Q : (p, a, q) ∈ T }. For w = a 1 · · · a k with a 1 , . . . , a k ∈ Σ, define T w = T a1 · · · T a k . The relation T w is called the relation induced by w. The set {T w : w ∈ Σ * } is a monoid under composition, called the transition monoid of A. For technical reasons, if w is a word but is not a word over Σ, we define T w to be the empty relation: qT w = ∅ for all q ∈ Q.
Observe that the set of transitions of an FA is determined by the relations T a . Furthermore, each relation T a is determined by the set of images qT a , where q ∈ Q. Hence we often define the transitions of an FA by specifying the images qT a for each q ∈ Q and a ∈ Σ.
If A = (Q, Σ, T, I, F ) is a finite automaton such that |I| = 1 and T a is a function for each a ∈ Σ, we say A is deterministic. We abbreviate "deterministic finite automaton" to DFA.
Let A = (Q, Σ, T, I, F ) be an FA. A word w ∈ Σ * is accepted by A if we have IT w ∩ F = ∅. If A is a DFA with I = {i}, this condition becomes iT w ∈ F . The language of A, denoted L(A), is the set of all words it accepts. Languages of FAs are called regular languages. A sequence of transitions (q 0 , a 1 , q 1 ), (q 1 , a 2 , q 2 ) . . . , (q k−1 , a k , q k ) with w = a 1 · · · a k is called a path from q 0 to q k with label w, and the path is accepting if q 0 ∈ I and q k ∈ F . The FA A accepts a word w if and only if there is an accepting path with label w. We write p w −→ q to mean that there is a path from p to q with label w. Given two regular languages L and K with DFAs , we may construct an FA AB = (Q, Σ, T, I, F ) that accepts the concatenation LK as follows: We assume without loss of generality that Q A ∩ Q B = ∅. Proof. Suppose w ∈ LK; we want to show that w is accepted by AB. We can write w = uv with u ∈ L and v ∈ K. There are two cases: u can be empty or non-empty. If u = ε then ε ∈ L, so i A ∈ F A . Thus If u = ε we can write u = xa for some word x and letter a. Then IT xa ⊇ i A T A xa , which contains an element of F A since xa ∈ L. It follows that IT x ⊇ i A T A x contains some state q such that qT A a ∈ F A . Thus IT xa ⊇ qT a ∋ i B , and so Conversely, let w be accepted by AB. Choose an accepting path for w. There are two cases: either this accepting path starts from i B , or it contains exactly one transition leading from a state of Q A to i B . In the first case we must have I = {i A , i B }, and so i A ∈ F A . This means ε ∈ L. If an accepting path starts from i B , all transitions on the path must belong to T B . Thus we have i B T B w ∈ F B . It follows that w ∈ K, and so w ∈ LK. In the second case, where the path contains exactly one transition from Q A to i B , note that this transition must be of the form (q, a, i B ) where qT A a ∈ F A . Note also that every transition before this one lies in T A , and every transition after lies in T B . Write w = uav; then i A T A ua = qT A a ∈ F A , so ua ∈ L. Also, i B T B v must be final, or our path would not be accepting. Thus v ∈ K, and uav = w ∈ LK.
We are interested in the deterministic state complexity of concatenation, so we convert the FA AB = (Q, Σ, T, I, F ) to a DFA recognizing the same language. The DFA we use is C = (P(Q), Σ, T, Since each relation T a can be viewed as a function from P(Q) to itself, and there is a unique initial state I ∈ P(Q), this automaton is indeed deterministic.
Since IT w ∈ F 0 if and only if IT w ∩ F = ∅, we see that C recognizes the same language as AB. We call C the concatenation DFA for A and B.
We make some observations and introduce some conventions to make it easier to work with the concatenation DFA.
• Since we are assuming A and B are DFAs, the only reachable states in Without loss of generality, we can assume the state set of C consists of states of this form, rather than all of P(Q).
• We mark the states of A with primes so they can be distinguished from the states of B. So a variable named p or q generally means a element of Q B , while p ′ or q ′ means an element of Q A .
• We identify the set S A ∪ S B with the ordered pair (S A , S B ). Hence we can view the states of C as these ordered pairs. Reachable states are either of • For convenience, we frequently make no distinction between singleton sets and the elements they contain, and so write (q ′ , S) rather than ({q ′ }, S).
• Rather than T w , T A w and T B w , we simply write w when it is clear from context which relation is meant. For example, (q ′ , S)w means (q ′ , S)T w since (q ′ , S) is a state of C, and thus T w is the natural relation to apply. From our convention for marking the states of A and B with primes, one can infer that q ′ w means q ′ T A w and qw means qT B w . • Rather than i A and i B , let 1 ′ denote the initial state of A and let 1 denote the initial state of B. We also assume without loss of generality that Under these conventions, the transitions of C can be described as follows: Recall that T A w is the empty relation if w is not a word over Σ A , and similarly for B. Thus the transitions admit a simpler description:

State Complexity
We say a DFA A is minimal if it has the least number of states among all DFAs that recognize L(A). It is well known that each regular language has a unique minimal DFA (up to renamings of the states). The state complexity of a regular language L, denoted sc(L), is the number of states in its minimal DFA.
There is a subtlety in this definition, arising from the fact that there are two common ways to define equality of functions. One way is to say that functions are simply certain sets of ordered pairs, and are equal if they are equal as sets. The other way is to say that functions are triples (f, D, C), where D is the domain of the function and C is the codomain, and thus two functions are equal if they are equal as sets and have the same domain and codomain. Since words over alphabets are formally defined as functions, the first viewpoint implies that two words over distinct alphabets can be equal, while the second viewpoint implies two words over distinct alphabets are always distinct. We call the first viewpoint the unrestricted viewpoint, and the second the restricted viewpoint, since the second viewpoint has more restrictive conditions for function equality. Now, consider how this affects the state complexity of the language L = {a} * over alphabet {a, b}. The smallest DFA with alphabet {a, b} that recognizes L has two states; a second state is necessary to exclude the words that contain b. Thus in the restricted viewpoint, the state complexity of L is two. But in the unrestricted viewpoint, L is equal to the language {a} * over alphabet {a}, which is recognized by a one-state DFA; thus the state complexity of L is one.
The following characterization of minimality is useful. Let D = (Q, Σ, T, i, F ) be a DFA. A state q ∈ Q is reachable if iw = q. For p, q ∈ Q, we say q is reachable from p if pw = q. Two states p, q ∈ Q are indistinguishable if they are equivalent under the following equivalence relation: p ∼ q if for all w ∈ Σ * , we have pw ∈ F ⇐⇒ qw ∈ F . Otherwise they are distinguishable by some word w such that pw ∈ F ⇐⇒ qw ∈ F . In the restricted viewpoint, a DFA is minimal if and only if all of its states are reachable and pairwise distinguishable. In the unrestricted viewpoint, we also require that the DFA has an alphabet of minimal size.
Let • be a binary operation on regular languages. The state complexity of the operation • is the following function, where m and n are positive integers: This is the worst-case state complexity of the result of the operation, expressed as a function of the maximal allowed state complexities of the input languages. As with state complexity of languages, this definition differs depending on whether we adopt the restricted or unrestricted viewpoint, but the consequences are farther-reaching.
In the restricted viewpoint, we must assume that the inputs to the binary operation are languages over a common alphabet. The restricted viewpoint considers words over different alphabets to be always distinct, so it generally does not make sense to perform binary operations on languages over different alphabets. For example, if we take the language L = {ab} over alphabet {a, b}, and the language K = {ab} over alphabet {a, b, c}, the union L ∪ K contains two distinct elements both representing the word ab. This set L ∪ K is arguably not a language at all, since it cannot be written as a set of words over a single alphabet. Thus when computing the restricted state complexity of binary operations, we only consider inputs with the same alphabet.
In the unrestricted viewpoint, there is no issue in allowing the input languages to have different alphabets. Thus when computing the unrestricted state complexity of binary operations, we consider all possible inputs to the operation, including pairs of languages with different alphabets. Allowing for different alphabets makes unrestricted state complexity slightly more complicated to compute. In fact, for many years, papers on operational state complexity only considered restricted state complexity. Unrestricted state complexity was first studied by Brzozowski [2] in 2016, who pointed out that the restriction to common alphabets is artificial and can be removed.
Let us derive an upper bound for the restricted and unrestricted state complexities of the concatenation operation. We begin with two DFAs A and B that have m and n states respectively. The number of reachable states in the concatenation DFA C for A and B gives an upper bound for the state complex- then there are at most (m + 1 − k)2 n states with a non-final state or the empty set in the first component, and k2 n−1 states with a final state in the first component. It follows there are at most (m + 1 − k)2 n + k2 n−1 reachable states in C. This is maximized by taking k = 1, giving an upper bound of m2 n + 2 n−1 in the unrestricted case. For the restricted case, note that we cannot get the empty set in the first component, since this requires using a letter in Σ B \ Σ A . Thus we get an upper bound of (m − 1)2 n + 2 n−1 in the restricted case. We will see later that both of these bounds are tight. Remark. Let p ′ , q ′ ∈ Q A , let X, Y, Z ⊆ Q B , and let w ∈ Σ * . Then:

Results
Indeed, recall that the pair (p ′ , X) stands for the set which in our pair notation is (q ′ , Y ∪ Zw). We will readily use this basic fact in proofs.
Before stating our main result formally, we give some motivating exposition. Fix a state s ′ ∈ Q A and a subset B of Q B . The state s ′ is called the focus state or simply focus; it is often taken to be the initial state 1 ′ but in general can be any state. The subset B is called the base. Fix a set T with B ⊆ T ⊆ Q B , called the target. Our goal is to give sufficient conditions under which starting from (s ′ , B), we can reach (s ′ , S) for all sets S with B ⊆ S ⊆ T . That is, we can reach any state of the concatenation DFA C in which the first component is the focus and the second component lies between the base and the target.
The idea is to first assume we can reach (s ′ , B), the state consisting of the focus and the base. Now, for q ∈ Q, define a q-word to be a word w such that (s ′ , B)w = (s ′ , B ∪ q). We can think of this as a word that "adds" the state q to the base B. Our next assumption is that we have a q-word for each state q in the target T . To reach a set S with B ⊆ S ⊆ T , we will repeatedly use q-words to add each missing element of S to the base B.
There is a problem with this idea, which we illustrate with an example. Suppose w p is a p-word and w q is a q-word, and we want to reach (s ′ , B ∪{p, q}). Starting from (s ′ , B) we may apply w p to reach (s ′ , B ∪ p). But now if we apply w q , we reach (s ′ , B ∪ {pw q , q}). There is no guarantee that we have pw q = p, and in many cases we will not. What we should really do is find a state r such that rw q = p, use an r-word to reach (s ′ , B ∪ r), and then apply w q to reach (s ′ , B ∪ {p, q}). But this idea only works if p has a preimage under w q , which may not be the case.
We resolve this by making a technical assumption, which ensures that preimages will always exist when we attempt constructions like the above. First, define a construction set for the target T to be a set of words consisting of exactly one q-word for each q ∈ T . If W is a construction set for T , we write W [q] for the unique q-word in W .
We say a construction set is complete if there is a total order ≺ on the target T such that for all p, q ∈ T with p ≺ q, the state q has at least one preimage under the unique p-word W [p], and at least one of these preimages lies in T . More formally, whenever p ≺ q, the set qW [p] −1 = {s ∈ Q B : sW [p] = q} intersects T non-trivially. Our final assumption is that we have a complete construction set for T .
Note that the definition of a q-word depends not only on q, but also on s ′ and B. Since a construction set for T is a set of q-words, the definition of construction set also depends on s ′ and B. For simplicity, we omit this dependence on s ′ and B from the notation for q-words and construction sets.
We summarize the definitions that have just been introduced: • Fix a state s ′ ∈ Q A , called the focus, and a set B ⊆ Q B called the base.
• For q ∈ Q B , a q-word is a word w such that (s ′ , B)w = (s ′ , B ∪ q).
• Given a target set T with B ⊆ T ⊆ Q B , a construction set for T is a set of words that contains exactly one q-word for each q ∈ T .
• The unique q-word in a construction set W is denoted by W [q].
• A construction set for T is complete if there exists a total order ≺ on T such that for all p, q ∈ T with p ≺ q, we have Now, we state our main theorem, which gives the formal version of the construction described above.  (s ′ , B). We want to show this also holds for |R| = k. Let W be a complete construction set for T and let ≺ be the corresponding total order on T . Let p be the minimal element of R under ≺. Let w be W [p], the unique p-word in W . For all q ∈ R \ p, we have p ≺ q and thus qw −1 contains an element of T (since W is complete).
Construct sets X and Y as follows: starting with X = ∅, for each q ∈ R \ p, choose an element of qw −1 ∩ T and add it to X. Then set Y = X \ B. Observe that X is a subset of T of size |R \ p| = k − 1. Hence Y is a subset of T of size at most k − 1 such that Y ∩ B = ∅. It follows by the induction hypothesis that (s ′ , Y ∪ B) is reachable from (s ′ , B). But Y ∪ B = X ∪ B, so (s ′ , X ∪ B) is reachable from (s ′ , B). By the definition of X, we have Xw = R \ p. Since w is a p-word, we have (s ′ , B)w = (s ′ , B ∪ p), and thus Hence (s ′ , R ∪ B) is reachable from (s ′ , B), as required.
The definition of completeness is somewhat complicated, which makes it difficult to use Theorem 1. Thus, we next prove some results giving useful sufficient conditions for a construction set to be complete. Before stating our first such result, we introduce some notation.
Define Σ 0 = Σ A ∩ Σ B . We call Σ 0 the shared alphabet of A and B. The following remark shows that when Σ A = Σ B , it is important to work exclusively with the shared alphabet when looking for complete construction sets. Of course, if Σ A = Σ B then the shared alphabet is just the common alphabet of both automata, and there is nothing to worry about.

Remark.
A construction set for a non-empty target cannot be complete unless it is a subset of Σ * 0 . To see this, suppose W is a construction set and let w ∈ W . If w contains a letter from Σ A \ Σ B , then w is not a word over Σ B . Recall that if w is not a word over Σ B , then T B w is defined to be the empty relation. Thus the converse relation (T B w ) −1 is also empty, which means qw −1 is empty for all q. It follows W cannot be complete. On the other hand, suppose w contains a letter from Σ B \ Σ A . Then (s ′ , B)w = (∅, Bw). Hence w is not a q-word for any q, and so w cannot be an element of a construction set, which is a contradiction. It follows that all words in a complete construction set are words over the shared alphabet Σ 0 . Lemma 1. Fix s ′ ∈ Q A and sets B ⊆ T ⊆ Q B . Let x 1 , . . . , x j be words over Σ 0 that act as permutations on T , and let y be an arbitrary word over Σ 0 . Choose If W is a construction set for T , then it is complete.
Define an order ≺ on T so that q 1 ≺ q 2 ≺ · · · ≺ q ℓ . We claim this order makes W complete. Notice that w r = W [q r ], the unique q r -word in W . Thus we must show that whenever q r ≺ q s , we have q s w −1 r ∩ T = ∅. Suppose r < s and r ≤ j. Then w r = x r acts as a permutation on T . Thus q s w −1 r ∩ T is non-empty, since q s ∈ T . Suppose r < s and r > j. Since s − r > 0, we can write w s = x 0 y s−j = x 0 y s−r y r−j = w j+s−r y r−j . Thus (s ′ , B)w s = (s ′ , B ∪ q j+s−r )y r−j = (s ′ , B ∪ q s ). There are two possibilities: q j+s−r y r−j = q s , or qy r−j = q s for some q ∈ B.
In either case, q s (y r−j ) −1 ∩ T is non-empty. That is, there exists q ∈ T such that qy r−j = q s . Since x 0 acts as a permutation on T , there exists p ∈ T such that px 0 = q. Thus px 0 y r−j = pw r = q s . It follows that q s w −1 r ∩ T is non-empty, as required.
Usually, we will use one of the following corollaries instead of Lemma 1 itself. Corollary 1. Fix s ′ ∈ Q A and sets B ⊆ T ⊆ Q B . Let x and y be words over Σ 0 such that x acts as a permutation on T . Suppose W is one of the following sets: 1. {y, y 2 , . . . , y k }.   If W is a construction set for T , then it is complete.
Proof. All statements follow easily from Lemma 1: 1. Set j = 0. 1. If every word in W acts as a permutation on T , then W is complete.
2. If there is a word w ∈ W such that every word in W \ w acts as a permutation on T , then W is complete.
In the special case where W contains ε, Corollary 2 admits the following generalization, which we found occasionally useful.
Lemma 2. Fix s ′ ∈ Q A and sets B ⊆ T ⊆ Q B . Let W = {ε, w 1 , . . . , w k } be a construction set for T , where w 1 , . . . , w k are non-empty words over Σ 0 . Suppose that for every word w ∈ W , there exists a set S with T \ B ⊆ S ⊆ T such that w acts as a permutation on S. Then W is complete.
Proof. Write B = {q 1 , . . . , q j }. Note that ε is a q i -word for 1 ≤ i ≤ j. Thus by the definition of a construction set, ε is the unique q i -word in W for each q i ∈ B, that is, W [q i ] = ε for 1 ≤ i ≤ j. In particular, each non-empty word in W is a q-word for some q ∈ T \ B. For 1 ≤ i ≤ k, let q j+i be the state such that (s ′ , B)w i = (s ′ , B ∪ q j+i ). Then T = {q 1 , . . . , q j+k }. Note that W Define an order ≺ on T by q 1 ≺ q 2 ≺ · · · ≺ q j+k . We claim this order makes W complete. Choose q r , q s ∈ T with q r ≺ q s ; we want to show that q s W [q r ] −1 ∩ T = ∅. Suppose q r ∈ B. Then W [q r ] = ε, and we have q s ε −1 ∩ T non-empty as required. Now if q r ∈ B, then since q r ≺ q s we also have q s ∈ B. In this case, W [q r ] = w r−j , which acts as a permutation on some superset S of T \ B. Since q s ∈ T \ B, it follows that q s has a preimage under w r−j , and furthermore this preimage lies in T , since S is a subset of T . Thus q s w −1 r−j ∩T = ∅ as required. This proves that W is complete.
Note that all words referred to in the above lemmas and corollaries are words over Σ 0 , the shared alphabet of A and B. When working with automata that have different alphabets, it is important to only use words over the shared alphabet when trying to find a complete construction set.
The following "master theorem" summarizes all the results of this section. We have attempted to state this theorem in a form such that it can be cited without having to first define all the notions introduced in this section, such as q-words and construction sets and completeness.
Fix a state s ′ ∈ Q A and sets B ⊆ T ⊆ Q B . Suppose that for each q ∈ T , there exists a word w q ∈ Σ * 0 such that (s ′ , B) Suppose that one of the following conditions holds: 1. There exist words x, y ∈ Σ * 0 , where x acts as a permutation on T , such that W can be written in one of the following forms: • W = {y, y 2 , . . . , y k }.

Every word in W acts as a permutation on T .
3. There exists w ∈ W such that every word in W \ w acts as a permutation on T .
4. W contains ε, and for every non-empty word w ∈ W , there exists a set S such that T \ B ⊆ S ⊆ T and w acts as a permutation on S.

5.
There exists a total order ≺ on T such that for all p, q ∈ T with p ≺ q, the set qw

Examples
We now demonstrate our technique by applying it to various concatenation witnesses from the literature.
Theorem 3 (Regular Language Witness. Brzozowski and Sinnamon, 2017 [9]). Let t : Q A → Q A be a transformation such that j ′ t = 1 ′ . Define A and B as follows: If gcd(j − 1, n) = 1, then C has (m − 1)2 n + 2 n−1 reachable states. In particular, transformations t with 2 ′ t = 1 ′ work for all m and n.
The authors of [9] proved this result with t = (1 ′ , 2 ′ ), but we prove a slightly more general statement.
Proof. The initial state of C is (1 ′ , ∅). Set x = a m and y = a j−1 b. We have (Addition in the second component is performed modulo n.) Since j−1 and n are coprime, it follows from elementary number theory that W = {x, xy, . . . , xy n−1 } is a construction set for Q B (with s ′ = 1 ′ and B = ∅). By Corollary 1, it is complete. Hence (1 ′ , S) is reachable for all S ⊆ Q B . To reach (q ′ , S) for q ′ non-final, first reach (1 ′ , Sa −(q−1) ) and then apply a q−1 . To reach (m ′ , S ∪ 1) for S ⊆ Q B \ 1, first reach ((m − 1) ′ , Sa −1 ) and then apply a.
Note that the above theorem only gives conditions for (m − 1)2 n + 2 n−1 states to be reachable; it is not necessarily true that all the reachable states are pairwise distinguishable. For example, if t is the constant transformation (Q A → 1 ′ ) then (p ′ , Q B ) and (q ′ , Q B ) are indistinguishable. However, in [9] the authors take t to be the transposition (1 ′ , 2 ′ ) and find that all reachable states are pairwise distinguishable.
In the remainder of our examples, all of the states we show are reachable will also be pairwise distinguishable. Since the focus of this paper is reachability, we refer to the original authors for distinguishability proofs in most cases. In cases where the original authors did not provide a distinguishability proof, we give a brief argument for completeness.
The next example involves two DFAs with different alphabets: we have Σ A = {a, b, c} and Σ B = {a, b, d}. Our construction set will consist of words over the shared alphabet Σ 0 = Σ A ∩ Σ B = {a, b}.
Proof. The initial state is (1 ′ , ∅). If n is odd, we have Thus {a m , a m bb, a m (bb) 2 , . . . , a m (bb) n−1 } is a construction set for Q B (with s ′ = 1 ′ and B = ∅). By Corollary 1, it is complete (taking x = a m and y = bb).
If n is even, we have The words used to reach each state (1 ′ , q) form a construction set for Q B (with s ′ = 1 and B = ∅). We cannot use Corollary 1 to show it is complete (since the appearance of ab breaks the pattern), but notice that all the words in the construction set are words over {a, b}, and a and b both act as permutations on Q B . Thus all words in the construction set are permutations of Q B , and so by Corollary 2 it is complete.
In either case, we have a complete construction set for Q B and so (1 ′ , S) is reachable for all S ⊆ Q B . We can reach (q ′ , S) for q ′ = m ′ and (m ′ , S ∪ 1) by words in a * , as in Theorem 3. This gives (m − 1)2 n + 2 n−1 reachable states. Additionally, from (q ′ , S) we can reach (∅, S) by d, for an extra 2 n states.
For distinguishability of the reached states, see [2].
The main differences in reachability proofs between the different-alphabet case (unrestricted state complexity) and the same-alphabet case (restricted state complexity) are as follows: • When looking for a complete construction set, we are restricted to using words over the shared alphabet Σ 0 = Σ A ∩ Σ B .
• Usually some additional states can be reached using letters in Σ A \ Σ B or Σ B \ Σ A , e.g., the states of the form (∅, S) in the previous example.
As these differences are not too significant, we will stick to the same-alphabet case for the remainder of our examples.
This construction set does not quite have the right form to apply Corollary 1, due to the last word a m (ab) n−2 c. However, notice that all words in W except for a m (ab) n−2 c are in fact permutations of Q B , so Corollary 2 shows that W is complete. Hence all states (1 ′ , S) with S ⊆ Q B are reachable. We can reach (q ′ , S) for q ′ = m ′ and (m ′ , S ∪ 1) by words in a * , as in Theorem 3.
For distinguishability of the reached states, see [1].
Theorem 6 (Regular Language Witness. Yu, Zhuang and Salomaa, 1994 [19]). Define A and B as follows: Then C has (m − 1)2 n + 2 n−1 reachable and pairwise distinguishable states. 1). It follows that {a m , a m b, . . . , ab n−1 } is a construction set for Q B (with s ′ = 1 ′ and B = ∅). By Corollary 1, it is complete (taking x = a m and y = b). Hence all states (1 ′ , S) with S ⊆ Q B are reachable. We can reach (q ′ , S) for q ′ = m ′ and (m ′ , S ∪ 1) by words in a * .
Let (p ′ , S) and (q ′ , T ) be distinct states of C. If S = T , let r be a state in the symmetric difference of S and T . Then b n−r distinguishes the states. If S = T and p ′ < q ′ , then ca m−q b n−2 distinguishes the states.
Proof. The initial state is (1 ′ , ∅). We have Thus {a m , a m b, a m b 2 , . . . , a m b n−1 } is a construction set for Q B (with s ′ = 1 ′ and B = ∅). By Corollary 1, it is complete. Hence (1 ′ , S) is reachable for all S ⊆ Q B . We can reach (q ′ , S) for q ′ = m ′ and (m ′ , S ∪ 1) by words in a * , as in Theorem 3. Let (p ′ , S) and (q ′ , T ) be distinct states of C. If S = T , let r be a state in the symmetric difference of S and T . Then b n−r distinguishes the states. If S = T and p ′ < q ′ , by b n we reach (p ′ , n) and (q ′ , n). Then by a m−q we reach ((p + m − q) ′ , na m−q ) and (m ′ , na m−q ∪ 1). These states differ in their second component, so they are distinguishable.
To reach (q ′ , S) for non-final q ′ ∈ Q A and S ⊆ Q B , proceed as follows. If 1 ∈ S, first reach (m ′ , S ∪ 1) then apply b m−q . If 1 ∈ S, let i be the smallest element of S. Set T = {q − (i − 1) : q ∈ S \ i} and reach (m ′ , T ∪ 1). Then For distinguishability of the reached states, see [7].
Proof. The initial state is (1 ′ , ∅). Let x = a m−1 and y = ab. If n is even, If n is odd, In both cases, Corollary 1 implies that {x, xy, . . . , xy n−2 } is a complete construction set for Q B \ 1 (with s ′ = 2 ′ and B = ∅). It follows that (2 ′ , S) is reachable for all S ⊆ Q B \ 1. This gives 2 n−1 reachable states.
To reach (q ′ , S) for non-final q ′ ∈ Q A \ 1 and S ⊆ Q B \ 1, note that a acts as a permutation on Q B \ 1, and so there exists T ⊆ Q B \ 1 such that T a q−2 = S. Thus we can first reach (2 ′ , T ) and then apply a q−2 . To reach (m ′ , S ∪ 1) for S ⊆ Q B \ 1, reach ((m − 1) ′ , T ) where T a = S and apply a. Counting the initial state (1, ∅), we get (m − 1)2 n−1 + 1 reachable states.
For distinguishability of the reached states, see [3].
For distinguishability of the reached states, see [11].
To reach (m ′ , S) with S ⊆ Q B \ n, set S non-empty, and 1 ∈ S, let p be the smallest element of S. Let T = Sa −(p−1) ; then 1 ∈ T since 1a p−1 = p. Reach (m ′ , T ) and apply a p−1 to reach (m ′ , S). There are 2 n−2 −1 non-empty sets that exclude 1 and n, and we can reach an additional state (m ′ , n) from (m ′ , n − 1) by b. This gives another 2 n−2 reachable states, for a total of (m + 1)2 n−2 states.
For distinguishability of the reached states, see [6].
For distinguishability of the reached states, see [8]. Note that the authors of [8] use a different concatenation DFA from our C: they first delete the sink states m ′ from A and n from B, and then form the concatenation of these modified DFAs. However, the same words used for distinguishing states in [8] can be used to distinguish states of C.
For distinguishability of the reached states, see [12]. Note that the authors of [12] work with a reduced concatenation DFA obtained by identifying, for each q ′ and S, the indistiguishable states (q ′ , S) and (q ′ , S ∪ n). Thus, for example, they write that (q ′ , ∅) is reachable for 3 ≤ q ≤ m − 1; these states are not reachable in our DFA C, but states (q ′ , n) for 3 ≤ q ≤ m − 1 are reachable.
We have reached (m − 1) + 2 n−2 states so far. Additionally, we have For distinguishability of the reached states, see [9].
Then C has m + 2 n−2 reachable and pairwise distinguishable states.
We have reached (m − 1) + 2 n−2 states so far. Additionally, we have {1, n}), giving m + 2 n−2 . For distinguishability of the reached states, see [5]. Note that the authors of [5] use a different concatenation DFA, constructed by removing state m ′ from A and then forming the concatenation in the usual way. However, the same words used in [5] can be used to distinguish states in C.
We now give two examples where our method of proof does not seem applicable or helpful. When attempting concatenation state complexity proofs, it seems best to consider both traditional techniques and the technique we present in this paper, switching between the two options if one does not yield an easy argument.
Example 1 (Prefix-Closed Witness. Brzozowski and Sinnamon, 2017 [9]). Our technique does not seem to work well with the following witness languages. Define A and B as follows: (1,2) and let F A = {1 ′ , . . . , (m − 1) ′ } and F B = {1, . . . , n − 1}. The inductive proof given by the authors of [9] has a different structure from the type of argument captured by Theorem 1. To reach a state (q ′ , S), in Theorem 1 we start from some state (q ′ , B) and apply a word that fixes the first component q ′ . In [9] the authors instead start from a state (p ′ , B) and apply a word w such that p ′ w = q ′ . The proof in [9] is short and clean, whereas a proof in the style of Theorem 1 seems to require complicated arguments. It is possible that Theorem 1 could be generalized to cover arguments of the form used in [9], but we have not found such a generalization. Additionally, assume that m + 1 ≥ n > 2. Then C has (m − n + 3)2 n−2 − 1 reachable and pairwise distinguishable states. This is the maximum for finite languages over a binary alphabet when m + 1 ≥ n > 2.
Let us consider why Theorem 1 cannot be used here. The point of Theorem 1 is to build up states (s ′ , S) by starting from (s ′ , B) and using words that fix the focus state s ′ . But in this witness, no state of A is fixed by any word except for the non-final sink state m ′ . So to use Theorem 1, the focus state must be m ′ . But from a state of the form (m ′ , S), we can only reach sets (m ′ , T ) with |T | ≤ |S|, since m ′ is a non-final sink state. So there is no way to start from some base state (m ′ , B) and build up larger sets, which is the strategy of Theorem 1.

Conclusions
We have introduced a new technique for demonstrating the reachability of states in DFAs for the concatenation of two regular languages, and provided evidence that this technique is useful in a wide variety of cases. However, we found two cases (Examples 1 and 2) where our technique does not seem applicable. Example 1 in particular suggests that Theorem 1 may admit a generalization that covers more types of inductive proofs. We leave this as an open problem.