[Math] Prove that $even(L)$ is regular

automatafinite-automataregular-language

For any string $w$, define $even(w)$ to be the string that results from deleting all the letters that occur in odd positions of $w$.

For example, $even(a)=ε$, $even(ab)=b$, $even(acb) = c$, and $even(acbd) = cd$.

Now extend the definition of even to languages as follows. For any language $L$, define $even(L)$ to be the language $\{ even(w) : w ∈ L \}$. Prove that if $L$ is regular then $even(L)$ is regular.

Note: I want a clean proof! I found this as a proof but it's very complicated. I prefer not to use homomorphism on this question. Maybe you can prove it with constructing a DFA. That would be so much better. Also i know there exists a similar question but in that question, $even(L)$ is defined the words that have even length. So, this question is different. Please don't mark it as duplicate.

Thanks in advance.

Best Answer

Let $M_0$ and $M_1$ be two copies of a DFA for $L$, and let $M$ be their disjoint union. The initial state of $M_0$ will be the initial state of $M$. Replace each transition $p\overset{x}\longrightarrow q$ of $M_0$ by an $\epsilon$-transition $p\overset{\epsilon}\longrightarrow q'$, where $q'$ is the copy of $q$ in $M_1$. Replace each transition $p\overset{x}\longrightarrow q$ of $M_1$ by $p\overset{x}\longrightarrow q'$, where $q'$ is the copy of $q$ in $M_0$. Keep the acceptor states of $M_0$ and $M_1$ unchanged. You now have an NFA that accepts $\operatorname{even}(L)$.

Related Question