2

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?

Ali Caglayan
  • 5,726
Rohit
  • 21

1 Answers1

1

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).

J.-E. Pin
  • 40,163
  • but the use of a non recursively enumerable subset of $\mathbb{N}$ is tedious. is there an example of a context-sensitive (but recursively enumerable) $L$ for which $L^2$ is context-free ? under the Goldbach conjecture ${a^p, p \ \ \text{is prime}}$ would work – reuns Feb 01 '16 at 17:45
  • @user1952009 It suffices to modify my example as follows: $L = 1 \cup (aa)^a \cup {a^{2p} \mid p \text{ is prime} }$. Again $L^2 = a^$, but $L$ is context-sensitive, and not context-free. – J.-E. Pin Feb 01 '16 at 17:49