Prove or disprove: $L^2$ context free implies $L$ is context free.

253 Views Asked by At

Clearly we have to disprove this. But I am finding it hard to prove it. I was trying in following way:
Considering any non context free language $L$. I was trying to prove that $L^2$ is context free which will contradict given statement. But I don't know to how to prove it. Because by pumping lemma we can show only that language is not CFL but converse is not true.

Can you please help me? Or is there any other way to prove it?

1

There are 1 best solutions below

2
On

The answer is negative, even on a single letter alphabet $\{a\}$. Let $S$ be a non recursively enumerable subset of $\mathbb{N}$ and let $$ L = 1 \cup (aa)^*a \cup \{a^{2n} \mid n \in S \} $$ Then $L^2 = a^*$ and thus $L$ is regular, but $L$ is not recursively enumerable (an in particular not context free).