# Regular languages and sets proof

I just have general questions about sets and determining if they are regular languages.

i) If A is regular, and A is a subset of B, then B must be regular.

ii) If B is regular, and A is a subset of B, then A must be regular.

iii) If A and AB are regular, than B must be regular

iv) If Ai is an infinite family of regular sets, than the union of all those sets is regular.

For the third one, I know that AB can only be regular if B is regular, because a regular set * a irregular one is not regular.

Lost for the other ones.

• You are wrong about iii: consider for example $A = \emptyset$ or $A = \Sigma^*$. Oct 15 '15 at 15:44
• Welcome to CS.SE! 1. Please ask only one question per question. The site format does not work well with multiple questions. You can ask separate questions. 2. We discourage posts that simply state a problem out of context, and expect the community to solve it. Assuming you tried to solve it yourself and got stuck, it may be helpful if you wrote your thoughts and what you could not figure out. You may also want to check out our reference questions, or use the search engine of this site to find similar questions that were already answered.
– D.W.
Oct 15 '15 at 17:11
• We probably have a duplicate for every one of the four questions, too.
– Raphael
Oct 15 '15 at 17:37
• For iii, consider $A = a^*$, and $B = \{a^{n^2} \colon n \ge 0\}$, so $A = A B$ is regular, $B$ isn't. Oct 15 '15 at 18:57
• For iv, consider the infinite family of finite (regular) sets $A_i = \{a^{i^2}\}$, the infinite union is $\{a^{n^2} \colon n \ge 0\}$ Oct 15 '15 at 18:59

Also, let $N$ be some arbitrary non-regular language.
i) The language that contains no strings, which is regular, is a subset of $N$.
ii) $N$ is a subset of the language that contains all strings, which is regular.
iv) For every string $S_i$ in $N$, construct a set $L_i$ that contains only $S_i$. Note that all of these constructed sets are trivially regular. But the union of all of these (infinite number of) constructed sets is $N$, which is not regular.