Give a counterexample to the following claim if A and B are
Solution
A DFA M = (Q, , , s, F) is an NFA N = (Q, Let A and B be regular languages of . Let ¯ be a disjoint copy of and let :(¯¯) be the monoid morphism defined by (x)=(x¯)=xfor all xx. Let B¯ be the copy of B in ¯ and let L be the language of ((¯) defined by
L={ uv¯u,v¯ and |u|=|v| }
Then by construction
AB=(AB¯L)
Let us show that AB is context-free. Since AB¯ is regular, it suffices to prove that LL is context-free (since context-free languages are closed under intersection with regular languages and under morphisms). This can be done directly or by observing that L=(S) where SS is the context-free language {0n1nn0} and is the finite substitution from {0,1} to (¯) defined by (0)= and (1)=¯. Since context-free languages are closed under finite substitutions, L is context-free.
