Closure Properties of Regular Languages
Overview
Regular languages are closed under many operations, meaning: applying the operation to regular languages yields another regular language.
This is proved using automata or regular expressions.
Union
Theorem: If and are regular, then is regular.
Proof (NFA)
Given DFAs and :
- Create new start state
- Add -transitions to and
- Accepting states:
Proof (Regex)
If , then .
Concatenation
Theorem: If and are regular, then is regular.
Proof (NFA)
Given NFAs :
- Add -transitions from to
- Start:
- Accepting:
Proof (Regex)
If , then .
Kleene Star
Theorem: If is regular, then is regular.
Proof (NFA)
- Create new start/accept state
- Add -transition
- Add -transitions from each to
- Add -transition from each to
- Accepting:
Proof (Regex)
If , then .
Complement
Theorem: If is regular, then is regular.
Proof (DFA)
Given DFA :
Define .
Swap accepting and non-accepting states.
Note: Requires complete DFA (all transitions defined).
Intersection
Theorem: If and are regular, then is regular.
Proof (DFA Product Construction)
Given DFAs and :
Define product DFA :
Product accepts iff both components are accepting.
Proof (De Morgan)
Use closure under complement and union.
Difference
Theorem: If and are regular, then is regular.
Proof
Use intersection and complement.
Homomorphism
Theorem: If is regular and is a homomorphism, then is regular.
Proof (Regex)
Apply to each symbol in the regex.
Inverse Homomorphism
Theorem: If is regular and is a homomorphism, then is regular.
Proof (DFA)
Given DFA for , construct where:
Run on the image of each input symbol.
Reversal
Theorem: If is regular, then is regular.
Proof
Reverse all transitions in an NFA, swap start and accept, convert to DFA.
Properties Summary
| Operation | Construction | Notes |
|---|---|---|
| Union | NFA with -edges | Easy |
| Concatenation | NFA with -edges | Easy |
| Star | NFA with loop back | Easy |
| Complement | Swap accept/non-accept in DFA | Needs complete DFA |
| Intersection | Product DFA | Quadratic states |
| Difference | Via intersection and complement | |
| Reversal | Reverse NFA | Swap start/accept |
| Homomorphism | Apply to regex | Symbol-wise |
| Inverse homomorphism | DFA transformation | Efficient |
Summary
- Regular languages are closed under: , , , , , , reversal
- Union/concat/star: easy with NFAs
- Complement: easy with DFAs, hard with NFAs
- Intersection: product construction or complement + union