text stringlengths 128 2.05k |
|---|
[MATH] is then the set of [MATH] for which the upper endpoint of [MATH] equals the lower endpoint of [MATH] . By Lemma 6.4 [MATH] contains one of [MATH] [MATH] . Without loss of generality assume [MATH] . Let |
[MATH] and observe that for each [MATH] there is an [MATH] such that [MATH] and [MATH] , and thus [EQUATION] If [MATH] is an irreducible representation with [MATH] then |
[MATH] and so the range of [MATH] is an invariant subspace of [MATH] , whence, one of [MATH] . If [MATH] then [EQUATION] while if [MATH] then |
[EQUATION] Theorem 6.6 Let [MATH] in [MATH] . Then there is a free ultrafilter [MATH] and a sequence of pairwise orthogonal finite-rank intervals [MATH] such that |
[MATH] and [MATH] contains [EQUATION] Moreover, given any decomposition of the [MATH] as the sums of intervals [MATH] we can replace [MATH] with one of [MATH] or [MATH] |
Proof. The existence of the intervals follows from Proposition 6.3 Let [MATH] be the ultrafilter obtained in Lemma 6.4 If [MATH] then, given [MATH] , there is a [MATH] |
such that [MATH] for all [MATH] . Thus taking [MATH] , we see that [MATH] and that [MATH] , whence [MATH] . Thus [MATH] is a limit point of [MATH] |
and since [MATH] is norm closed, [MATH] Given a decomposition [MATH] , we know from Proposition 6.5 that one of [MATH] [MATH] is in [MATH] . Without loss suppose [MATH] . Again by Lemma 6.4 |
[MATH] is an ultrafilter. Now let [MATH] . Since [MATH] is an ultrafilter, one of [MATH] But if [MATH] then [EQUATION] which is impossible. Thus [MATH] and so, since [MATH] was arbitrary, |
[MATH] . But [MATH] is also an ultrafilter, so in fact [MATH] . Thus we may replace [MATH] with [MATH] Now it follows that the limit of the ranks of the intervals must be [MATH] , for otherwise after finitely many decompositions we could conclude that [MATH] and so |
[MATH] . Similarly if [MATH] were not free then [MATH] would contain [MATH] for some [MATH] and, after finitely many decompositions if necessary, we would see that [MATH] for some [MATH] again contrary to hypothesis. |
Acknowledgements The author gratefully acknowledges the hospitality of Professor Tony Carbery and the University of Edinburgh Mathematics Department. |
# Source: arxiv 1806.04645 # Title: State Complexity of Pattern Matching in Regular Languages # Sections: all # Downloaded: 2026-03-03T02:40:44.409496+00:00 |
State Complexity of Pattern Matching in Regular Languages Abstract In a simple pattern matching problem one has a pattern [MATH] and a text [MATH] , which are words over a finite alphabet [MATH] One may ask whether [MATH] occurs in [MATH] , and if so, where? More generally, we may have a set [MATH] of patterns and a se... |
[MATH] [MATH] , and [MATH] , where [MATH] is the shuffle operation. The state complexity [MATH] of a regular language [MATH] is the number of states in the minimal deterministic finite automaton recognizing [MATH] We derive the following upper bounds on the state complexities of our pattern-matching languages, where |
[MATH] , and [MATH] [MATH] [MATH] [MATH] and [MATH] We prove that these bounds are tight, and that to meet them, the alphabet must have at least two letters in the first three cases, and at least [MATH] letters in the last case. We also consider the special case where [MATH] is a single word [MATH] , and obtain the fol... |
[MATH] [MATH] [MATH] and [MATH] For unary languages, we have a tight upper bound of [MATH] in all eight of the aforementioned cases. |
keywords: all-sided ideal, combined operation, factor, finite automaton, left ideal, pattern matching, prefix, regular language, right ideal, state complexity, subsequence, suffix, two-sided ideal |
Introduction Given a regularity-preserving operation on regular languages, we may ask the following natural question: in the worst case, how many states are necessary and sufficient for a deterministic finite automaton (DFA) to accept the language resulting from the operation, in terms of the number of states of the in... |
that an [MATH] -state DFA is also necessary in the worst case; for all [MATH] , there exist a language accepted by an [MATH] -state DFA and a language accepted by an [MATH] -state DFA whose intersection is accepted by a minimal DFA with [MATH] states. |
This worst-case value is called the state complexity of the operation. The state complexity of a regular language [MATH] , denoted by [MATH] , is the number of states in the minimal DFA accepting [MATH] . Thus [MATH] means the minimal DFA for [MATH] has exactly [MATH] states, and [MATH] means [MATH] can be recognized b... |
[MATH] and [MATH] , then [MATH] and this bound is tight for all [MATH] Aside from “basic” operations like union, intersection, concatenation and star, the state complexity of combined operations |
such as “star of intersection” and “star of union” has also been studied. We investigate the state complexity of new combined operations inspired by pattern matching problems. |
For a comprehensive treatment of pattern matching, see In a pattern matching problem we have a text and a pattern In its simplest form, the pattern [MATH] and the text [MATH] are both words over an alphabet [MATH] Some natural questions about patterns in texts include the following: Does [MATH] |
occur in [MATH] and if so, where? Pattern matching has many applications. Aho and Corasick developed an algorithm to determine all occurrences of words from a finite pattern in a given text; this algorithm leads to significant improvements in the speed of bibliographic searches. Pattern matching is used in bioinformati... |
in this context the text [MATH] is often a DNA sequence, and the pattern [MATH] is a sequence of nucleotides searched for in the text. |
More generally, we can have a set [MATH] of patterns and a set [MATH] of texts. These could be finite sets, or they could be arbitrary regular languages, specified by a finite automaton or a regular expression. For example, many text editors and text processing utilities have a regular expression search feature, which ... |
In this paper, we ask whether a pattern from the set [MATH] occurs as a prefix suffix factor or subsequence of a text from the set [MATH] If [MATH] and [MATH] , then [MATH] is a prefix of [MATH] and [MATH] is a suffix of [MATH] If [MATH] for some [MATH] , then [MATH] is a factor of [MATH] If [MATH] , where [MATH] , and... |
of [MATH] If [MATH] is any language, then [MATH] is the right ideal [MATH] [MATH] is the left ideal [MATH] , and [MATH] is the two-sided ideal |
[MATH] The shuffle [MATH] of words [MATH] is defined as follows: [EQUATION] The shuffle of two languages [MATH] and [MATH] over [MATH] is defined by |
[EQUATION] The language [MATH] is an all-sided ideal The language [MATH] consists of all words that contain [MATH] as a subsequence. Such a language could be used, for example, to determine whether a report has all the required sections and that they are in the correct order. |
The combined operations we consider are of the form “the intersection of [MATH] with the right (left, two-sided, all-sided) ideal [MATH] ”. We study four problems with pattern sets [MATH] and text sets [MATH] |
1. Find [MATH] , the set of all the words in [MATH] each of which begins with a word in [MATH] 2. Find [MATH] , the set of all the words in [MATH] each of which ends with a word in [MATH] |
3. Find [MATH] the set of all the words in [MATH] each of which has a word in [MATH] as a factor. 4. Find [MATH] , the set of all the words in [MATH] each of which has a word of [MATH] as a subsequence. |
We then repeat these four problems for the case where the pattern is a single word [MATH] In all eight cases we find the state complexity of these operations. We show that for languages [MATH] [MATH] and [MATH] such that [MATH] [MATH] [MATH] the following upper bounds hold: |
1. General case: (a) Prefix: [MATH] (b) Suffix: [MATH] (c) Factor: [MATH] (d) Subsequence: [MATH] 2. Single-word case: (a) Prefix: |
[MATH] (b) Suffix: [MATH] (c) Factor: [MATH] (d) Subsequence: [MATH] Moreover, in each case there exist languages [MATH] [MATH] [MATH] that meet the upper bounds. |
In the general prefix, suffix and factor cases, there exist binary witnesses meeting the bounds. For the general subsequence case, an alphabet of at least [MATH] letters is needed to reach this bound. For the single-word cases we use binary witnesses to reach each of the bounds. |
In Section 7.1 , we consider prefix matching in the case where [MATH] is a single word. In addition to considering arbitrary alphabets, in that section we also look at the case where [MATH] and [MATH] are languages over a unary alphabet We prove a tight upper bound of [MATH] on the state complexity of [MATH] in the una... |
Terminology and Notation deterministic finite automaton (DFA) is a 5-tuple [MATH] , where [MATH] is a finite non-empty set of states |
[MATH] is a finite non-empty alphabet [MATH] is the transition function [MATH] is the initial state, and [MATH] is the set of final states. We extend [MATH] to a function [MATH] inductively as follows: for [MATH] , define [MATH] , and for [MATH] and [MATH] , define [MATH] We extend it further to [MATH] by setting [MATH... |
accepts a word [MATH] if [MATH] . The language accepted by [MATH] is the set of all words that [MATH] accepts, and is denoted by [MATH] . If [MATH] is a state of [MATH] , then the language [MATH] of [MATH] is the language accepted by the DFA [MATH] A state is empty (or dead or a sink state ) if its language is empty. T... |
indistinguishable if [MATH] A state [MATH] is reachable if there exists [MATH] such that [MATH] A DFA [MATH] is minimal if it has the smallest number of states and the smallest alphabet among all DFAs accepting [MATH] It is well known that a DFA is minimal if it uses the smallest alphabet, all of its states are reachab... |
nondeterministic finite automaton (NFA) is a 5-tuple [MATH] , where [MATH] is now a function [MATH] , and all other components are as in a DFA. Extending [MATH] to a function [MATH] , the NFA [MATH] accepts a word [MATH] if [MATH] . As with DFAs, the language accepted by the NFA [MATH] is the set of all accepted words. |
Let [MATH] be a language over [MATH] . The quotient of [MATH] by a word [MATH] is the set [MATH] . In a DFA [MATH] , if [MATH] , then [MATH] |
transformation of a set [MATH] is a function [MATH] The image of [MATH] under the transformation [MATH] is denoted by [MATH] If [MATH] are transformations of [MATH] , their composition is denoted by [MATH] and defined by |
[MATH] ; that is, composition is performed from left to right The preimage of [MATH] under the transformation [MATH] is denoted by [MATH] , and is defined to be the set [MATH] This notation extends to sets: for [MATH] , we have [MATH] and [MATH] |
For [MATH] , a transformation [MATH] of a set [MATH] is a [MATH] -cycle if [MATH] [MATH] , …, [MATH] [MATH] and [MATH] for all [MATH] This [MATH] -cycle is denoted by [MATH] A 2-cycle [MATH] is a transposition The identity transformation of [MATH] is denoted by [MATH] ; while this notation omits the set [MATH] , it can... |
In a DFA [MATH] , each letter [MATH] induces a transformation of the set of states [MATH] , defined by [MATH] for [MATH] We denote this transformation by [MATH] Specifying the transformation [MATH] induced by each letter [MATH] completely specifies the transition function [MATH] , so we often define [MATH] in this way.... |
[MATH] means the transformation induced by [MATH] in the DFA [MATH] is the cycle [MATH] We extend the [MATH] notation from letters to words: if [MATH] for [MATH] , then [MATH] |
dialect of a regular language [MATH] is a language obtained from [MATH] by replacing or deleting letters of [MATH] in the words of [MATH] In this paper we use only dialects obtained by permuting the letters of [MATH] Thus, for example, if [MATH] , then [MATH] The notion of a dialect is also extended to DFAs. |
Henceforth we sometimes refer to state complexity as simply complexity , since we do not discuss other measures of complexity in this paper. |
Prefix Matching Let [MATH] and [MATH] be regular languages over an alphabet [MATH] We compute the set [MATH] of all the words of [MATH] that are prefixed by words in [MATH] ; that is, the language [MATH] We want to find the worst-case state complexity of [MATH] |
Theorem 1 For [MATH] if [MATH] and [MATH] then [MATH] , and this bound is tight if the cardinality of [MATH] is at least 2. Proof 1 |
The language [MATH] is the right ideal [MATH] . It is known that the state complexity of [MATH] is at most [MATH] Furthermore, it was shown in |
that the complexity of intersection is at most [MATH] if the first input has complexity at most [MATH] and the second has complexity at most [MATH] Hence [MATH] is an upper bound on the complexity of [MATH] |
Next we find witnesses that meet this bound. Let [MATH] be accepted by the DFA [MATH] , where [MATH] [MATH] and [MATH] is defined by the transformations [MATH] , and |
[MATH] see Figure This DFA is minimal because the shortest word in [MATH] accepted by state [MATH] is [MATH] ; this shortest word distinguishes [MATH] from any other state. |
Now let [MATH] be the dialect of [MATH] with the roles of [MATH] and [MATH] interchanged. Thus the DFA [MATH] , where [MATH] and [MATH] is defined by |
[MATH] [MATH] , is the minimal DFA of [MATH] This DFA is minimal because any state is distinguished from any other state by the shortest word in |
[MATH] that it accepts. To find [MATH] , we concatenate the language [MATH] with the language [MATH] Note that once state [MATH] is reached in the DFA [MATH] recognizing [MATH] , every word is accepted. Thus the transition from [MATH] to 0 is not needed, because it is replaced by a self-loop on state [MATH] under [MATH... |
[MATH] of Figure , where [MATH] is defined by [MATH] [MATH] Our last task is to find a DFA accepting [MATH] and prove that it is minimal and has [MATH] states. To achieve this we find the direct product [MATH] of [MATH] and [MATH] ; an example of this product for |
[MATH] is given in Figure Let [MATH] , where [MATH] Since DFA [MATH] has [MATH] states, it remains to prove that every state if [MATH] is reachable and every two states are distinguishable. |
We observe that [MATH] , for all [MATH] and [MATH] . Therefore, every state is reachable. We also observe that the minimal word in [MATH] |
accepted by a state [MATH] is [MATH] , where [MATH] and [MATH] . Therefore, each state in [MATH] has a unique minimal word in [MATH] this makes all states pairwise distinguishable. Hence, [MATH] is minimal, and has state complexity [MATH] |
\qed Suffix Matching Let [MATH] and [MATH] be regular languages over an alphabet [MATH] We are now interested in the worst-case state complexity of the set [MATH] of all the words of [MATH] that end with words in [MATH] . More formally, [MATH] |
Proposition 2 For [MATH] if [MATH] and [MATH] then [MATH] Proof 2 The language [MATH] is the left ideal [MATH] . It is known that the state complexity of this ideal is at most [MATH] |
Furthermore, the complexity of intersection is at most the product of the state complexities of the two operands. Hence [MATH] is an upper bound on the complexity of [MATH] |
\qed Our next goal is to prove that this upper bound is tight. We describe witnesses [MATH] and [MATH] that meet the upper bound. Let [MATH] be accepted by the DFA [MATH] , where [MATH] [MATH] and [MATH] is defined by the transformations [MATH] [MATH] See Figure This DFA is minimal because the shortest word in [MATH] a... |
It turns out that [MATH] , and its dialect [MATH] shown in Figure , act as witnesses in the case of suffix matching. We denote the language of the DFA [MATH] |
by [MATH] Let [MATH] Then [MATH] can be described by the regular expression [MATH] Now we have [EQUATION] The new generator of the left ideal [MATH] is |
[MATH] It consists of any word of length [MATH] beginning with [MATH] , possibly followed by any number of words of length [MATH] beginning with [MATH] An NFA accepting the left ideal is shown in Figure |
Before we prove that the bound of Proposition is tight, we need a different characterization of the language [MATH] To describe a DFA for this language, we will use binary [MATH] -tuples which we denote by [MATH] |
Definition 3 Define the following DFA: [EQUATION] where [EQUATION] In other words, the input [MATH] shifts the tuple [MATH] one position to the left cyclically, while [MATH] shifts the tuple to the left, losing the first component and replacing [MATH] by 1. DFA [MATH] is shown in Figure |
Proposition 4 All the states of [MATH] are reachable and pairwise distinguishable. Proof 3 Consider a state [MATH] , and view it as the binary representation of a number [MATH] State [MATH] is reachable by [MATH] and [MATH] by [MATH] If [MATH] is even, it is reachable from [MATH] by [MATH] , and [MATH] is reachable fro... |
We note that if a state [MATH] has [MATH] , then [MATH] accepts the word [MATH] For each state [MATH] , define [MATH] Since each state has a unique binary representation, each state has a unique [MATH] , which is a subset of all words accepted by [MATH] Therefore, if [MATH] and [MATH] are distinct states, they are pair... |
\qed In the example of Figure , we have [MATH] [MATH] [MATH] [MATH] [MATH] [MATH] [MATH] Recall that the left ideal [MATH] is [MATH] , that is, [MATH] |
Lemma 5 DFA [MATH] is isomorphic to the minimal DFA of [MATH] Proof 4 First we prove that each state [MATH] of [MATH] accepts [MATH] , and thus [MATH] accepts a superset of |
[MATH] Let [MATH] be an arbitary word from [MATH] Since [MATH] begins with [MATH] , this letter “loads” a 1 into position [MATH] Then this [MATH] is followed by [MATH] arbitrary letters, which shift the 1 into position [MATH] If there is no more input, the word [MATH] is accepted. Otherwise, the next letter is an [MATH... |
Next we prove that [MATH] If [MATH] , then [MATH] has length at least [MATH] Let [MATH] , where [MATH] Consider the prefix [MATH] of [MATH] If [MATH] , then [MATH] |
is in [MATH] and we are done. If [MATH] , then [MATH] is in [MATH] Now our proof strategy is as follows: jump back [MATH] letters and look at [MATH] If this letter is a [MATH] , then [MATH] |
is in [MATH] and we are done. If it’s an [MATH] , then [MATH] is in [MATH] , and we can keep jumping back [MATH] letters at a time until we find a [MATH] |
More formally, we claim there exists [MATH] such that [MATH] , and for [MATH] we have [MATH] ; thus [MATH] is in [MATH] , and we are done. |
To see this, suppose the above claim is false. We can write [MATH] , where [MATH] is the quotient upon dividing [MATH] by [MATH] , and [MATH] is the remainder with [MATH] Since the claim is false, we have [MATH] In fact, we have [MATH] for [MATH] It follows that [MATH] |
is in [MATH] Since [MATH] , the prefix [MATH] cannot lead to an accepting state. Now, if we are in a non-accepting state, and we apply a word from the language [MATH] , we will remain in a non-accepting state. Thus [MATH] is not accepted, which is a contradiction. So the claim must be true, and this completes the proof... |
\qed To finally prove that [MATH] meets the bound [MATH] , we construct the direct product of the DFAs [MATH] and [MATH] We show that all [MATH] states in the direct product are reachable and pairwise distinguishable. |
We will use the following lemma in the proof of reachability: Lemma 6 If (a) DFAs [MATH] and [MATH] are minimal DFAs, (b) [MATH] |
is bijective on [MATH] for all [MATH] , and (c) every state in [MATH] is reachable in the direct product of the DFAs [MATH] , then every state in [MATH] is reachable in [MATH] |
Proof 5 Suppose every state in [MATH] is reachable. We will show that [MATH] is reachable for all [MATH] and [MATH] Let [MATH] be a word over [MATH] that such that |
[MATH] such a word exists since [MATH] is minimal. Since [MATH] is bijective for all [MATH] the transformation [MATH] is bijective and hence has an inverse. So we may reach [MATH] by first reaching |
[MATH] and then applying [MATH] \qed We can now prove the following theorem: Theorem 7 For [MATH] if [MATH] and [MATH] then [MATH] , and this bound is tight if the cardinality of [MATH] is at least 2. |
Proof 6 The upper bound follows from Proposition To prove that the upper bound is tight, we show that all states in the direct product [MATH] are reachable and pairwise distinguishable. |
Reachability. Let [MATH] denote the state set of [MATH] and let [MATH] denote the initial state of [MATH] The initial state of the direct product is [MATH] Every state of the form [MATH] , where [MATH] , is reachable by [MATH] We observe that [MATH] and [MATH] (where [MATH] is the transition function of [MATH] ) are bo... |
Distinguishability. In this part of the proof, to simplify the notation, we simply write [MATH] for the transformation induced by [MATH] in the appropriate DFA. For example, if [MATH] , then [MATH] is equivalent to [MATH] or [MATH] |
First note the following facts about [MATH] 1. The word [MATH] sends all states to the final state [MATH] 2. The final state [MATH] is fixed by all words in [MATH] |
3. The letter [MATH] permutes the states. Thus if [MATH] and [MATH] are distinct, then [MATH] and [MATH] are distinct. 4. Suppose [MATH] and [MATH] are states, and define [MATH] to be the largest integer [MATH] such that [MATH] , or [MATH] if the states are equal. If [MATH] , then [MATH] and [MATH] are distinguishable ... |
5. If [MATH] , then [MATH] sends [MATH] to a state [MATH] and [MATH] to a state [MATH] such that [MATH] Now, let [MATH] and [MATH] be distinct states, where [MATH] |
Case 1. [MATH] Without loss of generality, we can assume [MATH] ; otherwise apply [MATH] . Choose a word [MATH] that distinguishes [MATH] and [MATH] in [MATH] ; then [MATH] distinguishes [MATH] and [MATH] |
Case 2. [MATH] (and thus [MATH] ). We may assume without loss of generality that [MATH] and [MATH] differ in exactly one component, and that [MATH] Otherwise, first apply [MATH] to reach [MATH] and [MATH] such that [MATH] , and note that this implies [MATH] and [MATH] differ in exactly one component. Then apply [MATH] ... |
Suppose now that [MATH] and [MATH] differ in exactly one component and [MATH] Then [MATH] is the index of the component where [MATH] and [MATH] differ. Furthermore, if we apply a word [MATH] , then either [MATH] , or [MATH] and [MATH] differ in exactly one component and [MATH] is the index of this component. So as long... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.