How can I show regular language is closed under square root?

46 Views Asked by At

I came across this question when reading a textbook of automata and languages:

For $L\subseteq\Sigma^*$, define $\sqrt{L}=\{x\ |\ \text{there exists $y \in \Sigma^*$ such that $|y|=|x|^2$ and $xy\in L$} \}$. Show that if $L$ is regular, then $\sqrt{L}$ is regular.

When proving a language is regular, I would usually design a DFA/NFA that accepts the language. But I have no idea how to tackle this one. Any help is appreciated, thanks in advance!