Closure Properties of Regular Sets



Throughout the articles we have seen the finite state machines and regular languages and the regular sets. In this chapter, we will cover the basics of closure properties in regular sets which is the fundamental concept in finite automata and the study of formal languages.

Closure properties describe the behaviour of regular sets under various operations, ensuring that the application of these operations on regular sets results in another regular set.

Theorem on Closure Sets

Let us see the theorem for different closure properties on regular sets one by one.

Union Operation

Regular sets are closed under the union operation. This means if we have two regular sets L1 and L2, their union L1 ∪ L2 is also a regular set.

Proof − Let L1 and L2 be regular languages over an alphabet Σ. There exist two finite automata M1 and M2 such that

$$\mathrm{L_{1} \:=\: L(M_{1}) \:\:and \:\:L_{2} \: =\: L(M_{2})}$$

Define a new finite automaton M as follows −

  • States of M are Q = Q1 ∪ Q2 ∪ {q0}, where q0 is a new start state not in Q1 or Q2.
  • The start state is q0.
  • The final states are F = F1 ∪ F2
  • The transition function δ includes −
    • δ(q0, ) = {q01, q02}
    • Transitions of M1 for states in Q1
    • Transitions of M2 for states in Q2

Thus, any string accepted by M1 or M2 is accepted by M, proving that L1 ∪ L2 is regular.

Example

Consider we have two machines M1 and M2 accepting languages L1 and L2 respectively.

$$\mathrm{L_{1} \:=\: a_{*}\: (a\: +\: b)\: b^{*}}$$

$$\mathrm{L_{2} \:=\: ab(a \:+\: b)^{*}}$$

The machines will be like −

Theorem on Closure Sets

And,

Theorem on Closure Sets 1

After applying union, the machine will be like −

After applying union, the machine

Complement Operation

The complement of a regular set is also a regular set. This property indicates that if L is a regular set, then its complement LC is also regular.

Proof − If L is a regular set, there exists a finite automaton M that accepts L. Construct a new finite automaton M' with the same states and transitions as M, but with the final and non-final states swapped. The new automaton M' accepts the complement of L.

Let us see an example for language, L = ab(a + b)*

Complement Operation

Its complement will be the same machine but non-final will be final and final will be non-final.

Complement Operation 1

Intersection Operation

Regular sets are closed under the intersection operation. This means if we have two regular sets L1 and L2, their intersection L1 ∩ L2 is also a regular set.

Proof − From De Morgans laws, we know that L1 ∩ L2 = $\mathrm{(L_1^C \cup L_2^C)}$. If L1 and L2 are regular, their complements L1C and L2C are also regular. The union of regular sets is regular, and the complement of a regular set is regular. Therefore, L1 ∩ L2 is regular.

Cross Product of a Regular Set

The cross product of a regular set is also a regular set. This property indicates that combination of two regular sets will fall under regular.

Proof − Let D1 = {Q1, Σ, δ1, q01, F1} and D2 = {Q2, Σ, δ2, q02, F2} be two DFA accepting two RE L1 and L2 respectively. Let us construct a new FA, D as follows.

$$\mathrm{D \:=\: \{Q,\: \Sigma,\: \delta,\: q_{0},\: F\}}$$

Where,

$$\mathrm{Q \:=\: Q_{1}\: \times\: Q_{2}}$$

$$\mathrm{\delta((S_{1},\: S_{2}),\: i/p) \:=\: (\delta_{1}(S_{1}, \:i/p),\: \delta_{2}(S_{2},\: i/p))\: \text{ for all }\: S_{1}\: \in \:Q_{1},\: S_{2}\: \in \:Q_{2}\: \text{ and } \:i/p \:\in \: \Sigma}$$

$$\mathrm{q_{0} \:=\: (q_{01},\: q_{02})}$$

$$\mathrm{F \:=\: F_{1}\: \times \: F_{2}}$$

So, D is a DFA. Thus, DFA are closed under cross product.

Conclusion

The closure properties of regular sets ensure that regular languages are closed under various operations such as union, intersection, complement, etc. These properties are foundational in automata theory in the context of regular languages.

Advertisements