# Proving that if L is regular. Then L′ = {ww : w ∈ L} is regular

I believe this statement to be true. And here's my reasoning:

Based on regular languages properties, the concatenation of two regular languages is regular. And since L′ = L · L, it follows that L′ must also be regular.

Do you think my reasoning is valid?

• The statement is false, and so your reasoning must be invalid. Consider $L=a^*b$. – Yuval Filmus May 7 '18 at 7:19
• With $L= \Sigma^*$, $L'$ is the most famous example for non-context-free languages. – Raphael May 7 '18 at 10:06
• This question appears to be unsuited for this site because questions of the form: "This is the exercise problem, this is my solution. Please grade!" are not interesting for anyone but you. Please see this related meta discussion, and these hints on asking questions about exercise problems. If you want to ask a specific question about a specific part of your attempt, please edit the question accordingly and it may be reopened. Otherwise, you might want to visit Computer Science Chat and get some feedback there. – Raphael May 7 '18 at 10:06
• @Raphael I think this question is fine. The reasoning here is IMO specific enough to directly address. I don't even see how to ask a more specific question than this. Also, the reasoning is concise enough to be directly answerable, as can be seen in Yuval's answer. – Discrete lizard May 7 '18 at 11:10
• It's a yes/no question. Answering 'yes' or 'no' is not very informative. – reinierpost May 7 '18 at 20:43

The statement is false. Consider the language $L = \{a^n b : n \geq 0\}$. Then $L' = \{ a^n b a^n b : n \geq 0 \}$ is not regular (exercise).
The invalid point in your reasoning is a confusion between the following two languages: $L' = \{ ww : w \in L \}$ and $L'' = \{ w_1w_2 : w_1,w_2 \in L \}$. It is $L''$ which is the concatenation of $L$ with itself. Whereas $L'$ need not be regular, $L''$ is always regular when $L$ is.