I have the following question: I have seen the statement that for the Shift operation, defined as: Shift($L$) = { $yx$ | $xy \in L$}
Where the following is mentioned: "For any regular language $L$, Shift($L$) is regular as well."
Shift defined as: Shift($L$) = { $yx$ | $xy \in L$}
I tried approaching this by forming a proof from the fact that a Shifted language is pulling from the same set of words / symbols as it's non shifted counterpart, but couldn't reach anything conclusive.
How would one prove that the shift operation preserves regularity?
Here's a sketch proof, using pictures. Let's say we start with some kind of automaton which accepts the language:
I will sketch how to construct a larger non-deterministic finite-state automaton, with $\varepsilon$ transitions (i.e. transitions between states that do not add to the word in progress), that accepts $\operatorname{Shift}(L)$.
Now, create a copy of this FSA for each state, and add a new initial state. Create $\varepsilon$ transitions from this initial state to each copy, each entering at a different state:
Let's focus one such copy, e.g.
We need a little modification here. Create a new copy of this original automaton, and add $\varepsilon$ transitions from the terminal state(s) to the initial state of the new copy. Change the terminal state(s) to not be terminal. Whichever state you arrived in, make it terminal in the copy. So, in this case:
The given non-deterministic FSA should accept $\operatorname{Shift}(L)$.