Difference of regular languages
Let L1, L2 be two regular languages. We will prove that their difference L = L1 ∖ L2 is also a regular language.
Idea
There is really not much to prove. For the difference of two sets, the following relation holds:
where
Example
Let A1 be this automaton, which accepts all strings that contain an even number of 1s:
and let A2 be an automaton that accepts strings containing an odd number of 0s:
We will construct an automaton that accepts the difference of these languages. We need an automaton
Now we only need to construct the automaton A, which will accept the intersection of the languages L(A1) and
Sources
Chapters: Closure of regular languages, Union of regular languages, Intersection of regular languages, Difference of regular languages, Complement of a regular language, Concatenation of regular languages, Kleene closure of a regular language