Let
be a DFA that accepts L1 and
be a DFA that accepts L2. Construct the
automata
as follows:
s3 = (s1,s2,1)
and for all
and for all
,
Then one can easily show that
.
Hence,
is regular.
Note: It would be nice if the answer includes a proof of
but the construction would be enough.
Clearly, for all
,
as
and
and
.
Hence,
We now show that
is not a CFL. Assume, to the
contrary, that L is a CFL. Then the pumping lemma for CFL's holds
for L. Let l be the pumping constant. Now consider the string
Clearly,
and
.
Then by the pumping lemma there
exists a split of s = uvwxy satisfying
We show that this is not the case by considering all possible splits of s. This will yield a contradiction hence showing that the pumping lemma for CFL's does not hold for L and hence L is not CFL.
We claim that for all possible splits uvwxy of s satisfying
conditions 1 and 2 above,
.
Recalling that
we have the folllowing cases:
Case 1: vwx lies completely within a4l. In this case,
as
.
Case 2: vwx lies completely within (ab)l. Similar to case 1.
Case 3: vwx lies completely within b6l. Similar to case 1.
Case 4: vwx lies in the part
a4l(ab)l but not within
a4l or (ab)l individually. Since
either
or
.
If
then certainly a non-empty part of
v lies within a4l (else vwx lies totally in (ab)l). Then
uv0wx0y = a4l-tzb6l where
and
z = (ab)j or
z=b(ab)j for some
.
In either case,
.
The case where
is similar.
Case 5: vwx lies in the part
(ab)lb6l but not within
b6l or (ab)l individually. An argument similar to case 4 shows
that
.