$L_1=\{a^n\mid n\ge1\}$ is regular and $L_2=\{a^{n^2}\mid n\ge1\}$ is non-regular. We know that $L_1\cap L_2$ is regular but, here $L_1\cap L_2=L_2$; and $L_2$ is not regular. How is this possible?
-
3$\begingroup$ We don't know that when $L_1$ is regular and $L_2$ isn't, their intersection is always regular. Consider $L_1=\Sigma^*$. $\endgroup$reinierpost– reinierpost2014年12月24日 11:17:26 +00:00Commented Dec 24, 2014 at 11:17
-
$\begingroup$ @reinierpost Actually, the example in the question is $L_1=\Sigma^*$ for $\Sigma=\{a\}$. $\endgroup$David Richerby– David Richerby2014年12月24日 12:04:18 +00:00Commented Dec 24, 2014 at 12:04
-
$\begingroup$ @David Richerby: Yes, my remark is a clumsy way to clarify that the resulting language can always be equal to whatever you pick $L_2$ to be. $\endgroup$reinierpost– reinierpost2014年12月25日 23:01:00 +00:00Commented Dec 25, 2014 at 23:01
-
$\begingroup$ In your specific case, $L_1 \cap L_2 = L_2,ドル non-regular. $\endgroup$vonbrand– vonbrand2020年02月09日 20:39:27 +00:00Commented Feb 9, 2020 at 20:39
2 Answers 2
To expand a bit on David's answer, you are confusing between the next two claims.
Claim 1 if $L_1,L_2$ are regular, then $L_1 \cap L_2$ is also regular.
(proof: construct the product DFA, e.g., here)
Claim 2 if $L_1$ is regular, but $L_2$ is not, then $L_1\cap L_2$ can be either regular or not-regular.
(proof: Let $L_2$ be some non-regular language. If $L_1=\Sigma^*$ then $L_1\cap L_2=L_2$ which is non-regular by its definition. On the other hand, if $L_1=\emptyset$ then $L_1\cap L_2=L_1=\emptyset$ which is regular)
-
$\begingroup$ thanx dear for clearig my point,its cod'n is either or, but not necessary..,thnk u. $\endgroup$yashpal raghuwanshi– yashpal raghuwanshi2014年12月26日 07:39:09 +00:00Commented Dec 26, 2014 at 7:39
If $L$ and $L'$ are both regular then, yes, $L\cap L'$ is regular. But, if $L'$ is not regular, then all the bets are off, as your example shows.