Let $A$ be a regular set. Consider the two sets below.
\begin{align*} L_1 &= \{ x \mid \exists{n}\geq 0 , \exists{y} \in A : y =x^{n} \}, \\ L_2 &= \{ x \mid \exists{n}\geq 0 , \exists{y} \in A : x =y^{n} \}. \end{align*}
Which of the following is true?
- $L_1$ and $L_2$ are regular
- $L_1$ is regular but $L_2$ is not
- $L_2$ is regular but $L_1$ is not
- Both are not regular
What I knew
$Y \in A $ only but now the relation between $y$ and $x$ is: $Y = X^{n}$ and given the clause there exist associated with the value of $n$, so we can assign any value of $n$ which is $\geq 0$. So if $n = 1$, then $Y = X$ and hence $X$ is obviously regular set.
Similarly on setting $n = 2$, we get $Y = X^{2}$ meaning $Y$ can be partitioned on exactly 2 halves and hence we can say $X$ is $\mathrm{half}(Y)$. And we know given a language or a set $L$ is regular, then $\mathrm{half}(L)$ is also regular.
With this understanding I came to a conclusion that $L_1$ is regular.
But, How to check the regularity of $L_2$? I also wanted to confirm my approach to $L_1$ being regular is correct.