[!math|{“type”:“definition”,“number”:“auto”,“setAsNoteMathLink”:false,“title”:“Regular Expression”,“label”:“regular-expression”,“_index”:0}] Definition 1 (Regular Expression). is a regex if is
- : empty string
- empty set
- , where and are regex
- where and are regex
- () where is a regex
Connection to Finite Automata
[!math|{“type”:“theorem”,“number”:“auto”,“setAsNoteMathLink”:false,“_index”:1}] Theorem 2. A language is recognized by a FA is described by a ^a8210c.
\begin{proof}
(L is recognized if L is described by regex):
By the rules of what a regex is by definition, we can see that the regex can describe transitions through a NFA.
(L is described by regex if L is recognized): For a FA , we can construct a GNFA:
[!math|{“type”:“definition”,“number”:“auto”,“setAsNoteMathLink”:false,“title”:“Generalized NFA”,“label”:“generalized-nfa”,“_index”:2}] Definition 3 (Generalized NFA). A NFA that has transitions in the form of regex.
Notice that for a 2-state GNFA with just a start and accept state with transition (some regex), we have proven that the recognized language can be expressed by regex.
Now, we prove that -state GNFA can be reduce to 2 states by simply ripping out every intermediate state by replacing regex transitions with a more robust one. Let be 3 states in , with transitions . Then, we can rip by setting the transition with .
\end{proof}
Non Regular Languages
[!math|{“type”:“lemma”,“number”:“auto”,“setAsNoteMathLink”:false,“title”:“Pumping Lemma”,“label”:“pumping-lemma”,“_index”:3}] Lemma 4 (Pumping Lemma). For all regular languages , there is a pumping length s.t. for all words with ,
- for all
We can prove a language is non-regular by
- assume is regular
- must exist pumping length
- select string of length
- no matter how you write satisfying rules 2 and 3, pumping cannot give string in
- profit