Theory of Computation · Properties of Regular Languages
Closure of Regular Languages under Union
Overview
A class of languages is closed under an operation when applying that operation to languages in the class always yields a language still in the class.
Regular languages are closed under union, concatenation and Kleene star, and each fact is proved with the regular expression argument.
Key concepts
- Closed under an operation: a class of languages is closed under an operation if applying that operation to languages in the class always produces a language that is again in the class.
- Regular expression argument: every regular language has a regular expression, and the regular-expression definition of regular languages is itself closed under union (plus), concatenation and star.
This single technique proves all three closure properties. - Closure under union: if is regular and is regular, then is regular.
- Closure under concatenation: if is regular and is regular, then is regular.
- Closure under Kleene star: if is regular, then (Kleene star / Kleene closure) is regular.
- For closure properties of the other language classes (context-free, recursive, recursively enumerable, context-sensitive), a summary table is sufficient for reference.
How it works
Union ()
- regular implies there exists a regular expression with .
- regular implies there exists a regular expression with .
- The union of the two languages is obtained by putting a plus in the middle: .
- is again a regular expression, since union (plus) is one of the three regular-expression operations.
- Therefore is regular.
Concatenation ()
- regular implies a regular expression for .
- regular implies a regular expression for .
- Apply concatenation to the expressions: .
- is again a regular expression, since concatenation is a regular-expression operation.
- Since the resulting expression is a regular expression, the language it denotes, , must be regular.
Kleene star ()
- regular implies there exists a regular expression for .
- The Kleene closure of the language is the Kleene closure of the regular expression: .
- is again a regular expression, since star is a regular-expression operation.
- Therefore the resulting language is regular.
Formulas
- — is a regular expression for , is a regular expression for , and denotes union of regular expressions.
- — juxtaposition denotes concatenation of regular expressions.
- — denotes Kleene star of a regular expression.
Worked examples
The method, applied to each operation:
- Union: given regular with expression and regular with expression , form ; it is a regular expression, so is regular.
- Concatenation: given regular with expression and regular with expression , form ; it is a regular expression, so is regular.
- Kleene star: given regular with expression , form ; it is a regular expression, so is regular.
Comparison
| Operation | Statement | Proof idea |
|---|---|---|
| Union | regular and regular regular | Take regular expressions , ; is a regular expression |
| Concatenation | regular and regular regular | Take regular expressions , ; is a regular expression |
| Kleene star | regular regular | Take regular expression ; is a regular expression |
Revision summary
- Closure means the result of the operation stays inside the class: regular in, regular out.
- The proof pattern is always: convert the language(s) to regular expression(s), apply the corresponding regular-expression operation (plus, concatenation, star), and note the result is still a regular expression, hence the language is regular.
- Union of regular expressions is written with , not with .
- Concatenation of regular expressions is written by juxtaposition: .
- Kleene star of a language corresponds to Kleene star of its regular expression: .
- For context-free, recursive, recursively enumerable and context-sensitive languages, a summary table of closure properties is sufficient for reference.
Previous-year exam insights
- Regular languages are closed under all the standard operations: union, intersection, complement, difference, concatenation, Kleene star, reversal, homomorphism and inverse homomorphism.
In particular, if L1 and L2 are regular then L1 ∩ L2 and Σ* − L1 are regular.
Asked inGATE 1990GATE 1989 - Closure under union (or any binary operation) is a finite, binary property: it says nothing about infinite unions.
The class of regular languages is NOT closed under infinite union, and a union of two languages can be regular even when one or both of them are not regular (e.g. a non-regular language united with its complement gives Σ*).
Asked inGATE 2020 - If L is regular then its reversal is regular (reverse the regular expression, or reverse all transitions of the NFA and swap initial and final states), and the concatenation of two regular languages is regular; hence languages built from regular pieces by union, concatenation, star, reversal and complement stay regular.
Asked inUGC NET 2013 - A language of the form { | w ∈ Σ*} is not regular (pump it, or note it needs unbounded memory), whereas {} over a one-letter alphabet or with w of bounded length can be regular; do not assume reversal-based patterns are regular.
Asked inUGC NET 2013 - Closure facts for other classes: context-free languages are closed under union, concatenation, Kleene star and homomorphism but NOT under intersection or complement; recursive languages are closed under all boolean operations; recursively enumerable languages are closed under union and intersection but not complement; context-sensitive languages are closed under union, intersection and complement.
Asked inGATE 1989 - To prove a class is NOT closed under an operation, give a counterexample: e.g. for intersection of two CFLs, take { } ∩ { } = { };
for complement of CFLs, use that closure under complement plus union would give closure under intersection by De Morgan, which fails.
Asked inGATE 1989