Showing $L=\{uw \mid \exists v:uv\in L_{1},vw\in L_{2}\}$ is regular

498 Views Asked by At

Let $L_{1,}L_{2}$ be regular languages and define $L:=\{uw \mid \exists v\in\Sigma^{*}:uv\in L_{1},vw\in L_{2}\}$.

I wish to prove that $L$ is regular using only closure properties (such as $L_{1},L_{2}$ is regular then so is $L_{1}\cap L_{2},L1\cup L_{2},L_{1}^{*}$ etc.).

My thoughts: I tried to define a homomorphism $h:\Sigma\cup\Sigma'\to\Sigma^{*}$

$$\forall\sigma\in\Sigma:h(\sigma)=\sigma$$ $$\forall\sigma'\in\Sigma':h(\sigma')=\epsilon$$

Then I tried to look at $h^{-1}(L_{1}),h^{-1}(L_{2})$, I thought about looking at their intersection with the languages $\Sigma^{*}(\Sigma')^{*},(\Sigma')^{*}\Sigma^{*}$ etc to give the words in $h^{-1}(L_{1}),h^{-1}(L_{2})$ the form of $ww'$s.t $w\in L_{1}$ or $w'w$ s.t $w\in L_{2}$.

I am having difficulty to continue, I thought about trying to get to something like $L_{3}(\Sigma')^{*}L_{4}$ where $L_{3}$ is all the prefix of words in $L_{1}$ and $L_{4}$ is all the endings of words in $L_{2}$ and then intersect this with $\Sigma^{*}L_{5}'\Sigma^{*}$ where $L_{5}$ is some language to enforce that the words in $(\Sigma')^{*}$in the expression$L_{3}(\Sigma')^{*}L_{4}$ will be such that if I remove all the tags (using a homomorphism) I would get $L$.

How can I show $L$ is regular using only closure properties ?

2

There are 2 best solutions below

4
On BEST ANSWER

Let $\underline \Sigma := \{ \underline a : a \in \Sigma \}$ be a disjoint copy of $\Sigma$, assume $<$ and $>$ are symbols not already present in $\Sigma$ and define a homomorphism $h: \Sigma \cup \underline \Sigma \cup \{<,>\} \to \Sigma$ by \begin{align*} a &\mapsto a,\\ \underline a &\mapsto a,\\ < &\mapsto \varepsilon,\\ > &\mapsto \varepsilon.\\ \end{align*} Then \begin{align*} K &:= \{ u \text{<}\underline v \text{>} w : uv \in L_1, vw \in L_2 \}\\ &= \Sigma^* \text{<}\underline{\Sigma}^*\text{>} \Sigma^* \cap h^{-1}(L_1)\text{>}\Sigma^* \cap \Sigma^* \text{<}h^{-1}(L_2) \end{align*} is regular by the closure properties of regular languages, and so is $L$ since it is the homomorphic image of $K$ by deleting the symbols from $\underline \Sigma$ and $\{<,>\}$.

0
On

Another way is to make 3 distinct copies $\Sigma_i$ of $\Sigma$, and define the morphisms $h_i : \Sigma_1 \cup \Sigma_2 \cup \Sigma_3 \to \Sigma^*$, by $a_i \mapsto \varepsilon ; a_j \mapsto a$ for $j \neq i$ ($h_i$ simply erases the letters from $\Sigma_i$)

Then $L = h_2(\Sigma_1^* \Sigma_2^* \Sigma_3^* \cap h_3^{-1}(L_1) \cap h_1^{-1}(L_2))$