I was wondering about infinite closure properties.

Are the Regular languages closed under infinite union? Infinite intersection?

Probably not, by taking $\forall n>0~~L_n=\{a^nb^n\}\in RL$, then $\bigcup_{n=1}^{\infty}L_n=\{a^nb^n|n>0\}\notin RL$

By taking $L_k=\{a^ib^j~|~i\ne k ~~or~~ j\ne k\}\in RL$, then $\bigcap_{k=1}^{\infty}L_k=\{a^ib^j|i \ne j\}\notin RL$

But what about CFL and non-CFL languages? I couldn't find examples for that.


  • $\begingroup$ Please ask only one question per post. I see about 4 questions here, for regular vs CFL and union vs intersection. $\endgroup$
    – D.W.
    Jun 20, 2022 at 17:36
  • $\begingroup$ @D.W. This is one question with related subs... $\endgroup$
    – Math4me
    Jun 20, 2022 at 18:08
  • $\begingroup$ I don't know what "one question with related subs" means, but we don't want one question with related subquestions. Instead, please ask each subquestion separately. The site format doesn't work well when there are multiple questions or subquestions. For instance, if one person answers one of the questions but not the others, the question gets treated as answered. Marking as 'duplicate' doesn't work very well when there are multiple questions or subquestions. $\endgroup$
    – D.W.
    Jun 20, 2022 at 18:24
  • 1
    $\begingroup$ Please spend some time searching this site (and other standard resources) before asking a question. Doing a search on "infinite union" and "infinite intersection" on this site immediately turns up many relevant prior posts that answer many of your questions. $\endgroup$
    – D.W.
    Jun 20, 2022 at 18:30