Math 2.0

Computer science Automata and formal languages Theorem

Closure properties of regular languages

Builds on Regular languageKleene starHomomorphismDeterministic finite automaton

Statement

Let Σ\Sigma and Γ\Gamma be alphabets, and let K,L⊆Σ∗K, L \subseteq \Sigma^* be regular languages. Then the following languages are regular:

  1. the union K∪LK \cup L, the intersection K∩LK \cap L, the difference K∖LK \setminus L and the complement Σ∗∖L\Sigma^* \setminus L;
  2. the concatenation KL={uv:u∈K, v∈L}KL = \set{uv : u \in K,\ v \in L};
  3. the Kleene star L∗L^*;
  4. the reversal LR={an⋯a1:a1⋯an∈L}L^R = \set{a_n \cdots a_1 : a_1 \cdots a_n \in L};
  5. the image h(L)h(L) and, for a regular M⊆Γ∗M \subseteq \Gamma^*, the preimage g−1(M)g^{-1}(M), where h ⁣:Σ∗→Γ∗h \colon \Sigma^* \to \Gamma^* and g ⁣:Σ∗→Γ∗g \colon \Sigma^* \to \Gamma^* are monoid homomorphisms.

Remarks

Complement: swap accepting and non-accepting states of a complete DFA for LL. Intersection: run DFAs for KK and LL in parallel on the product of their state sets, accepting when both accept; union and difference work the same way. Concatenation, star and reversal are easiest with nondeterministic automata: glue automata with ε\varepsilon-moves, or reverse all arrows and swap initial and accepting states. For the preimage, a DFA for g−1(M)g^{-1}(M) moves on the letter aa the way a DFA for MM moves on the word g(a)g(a). For example, the words over {a,b}\set{a, b} with an even number of aa's and an odd number of bb's form a regular language, as the intersection of two regular languages. The class is not closed under infinite unions: every language is a union of singletons, and {anbn:n≥0}\set{a^n b^n : n \ge 0} is not regular.

Going deeper

For a student

Closure properties are a main tool for showing that a language is not regular. For instance, if L={w∈{a,b}∗:w has as many a’s as b’s}L = \set{w \in \set{a, b}^* : w \text{ has as many } a\text{'s as } b\text{'s}} were regular, then L∩a∗b∗={anbn}L \cap a^* b^* = \set{a^n b^n} would be regular, which the pumping lemma rules out. Context-free languages, in contrast, are not closed under intersection or complement. The constructions are effective, so they also give algorithms, for example to decide whether two DFAs accept the same language by testing the symmetric difference for emptiness.

Reading path

To understand this page from the ground up, read these 5 pages in order. The foundations come first.

Show the path as a graph
Each page uses the pages above it. The colour of the bar on a box shows how strong the evidence is, and the box also gives it as text. The list has the same pages.
  • no evidence level
  1. Deterministic finite automaton concept
  2. Homomorphism concept
  3. Kleene star concept
  4. Regular language concept
  5. Closure properties of regular languages statement

Further reading

  1. Web https://en.wikipedia.org/wiki/Regular_language
About this page
Tag446KZ8HJ5F
URIm2://446KZ8HJ5F
Kindstatement, theorem
WritingW0 stub
MSC68Q45
StatusThis copy of the site has no build data. Run m2 status 446KZ8HJ5F.
AboutRegular language
UsesRegular language, Kleene star, Homomorphism, Deterministic finite automaton
Changed3 November 2026

Markdown · JSON · Edit on GitHub

What this page needs for W1

  • an inventory row: the row of the inventory that the node accounts for (0 of 1)
  • a source with a locator (0 of 1)

The writing levels say how complete the text of a page is. They do not measure its truth.

What links here

No page links to this page yet.