2
$\begingroup$

I know that there are many languages that are context free but not regular like $\{a^n b^n :n>0\}.$ But I want to know if every context free but non-regular language has infinitely many non-regular subsets?

Thank you.

$\endgroup$
1
  • $\begingroup$ Next time please read the tag descriptions, and don't randomly pick. $\endgroup$
    – user21820
    Apr 14, 2016 at 11:28

2 Answers 2

1
$\begingroup$

Yes.

If $L$ is context free but non-regular, then for every positive integer n, let $L_n\subseteq L$ be a language such that $|L-L_n|=n$. If $L_n$ were regular, then $L$ would be regular, since an automaton which decides $L_n$ could be (non-deterministically for simplicity) expanded to decide $L_n$ and exactly all the finite strings removed from $L$, and thus the automaton also decides $L$. Thus we conclude that none of $L_n$ may be regular.

$\endgroup$
1
$\begingroup$

If $L$ is context-free but not regular, $L$ must be infinite. For each $w\in L$ let $L_w=L\setminus\{w\}$. The finite language $\{w\}$ is certainly regular, and the union of two regular languages is regular, so if $L_w$ were regular, $L=L_w\cup\{w\}$ would also be regular. Thus, $L_w$ cannot be regular, and each of the infinitely many languages $L_w$ is a distinct non-regular subset of $L$.

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .