Let $\Sigma_{1}=\{a,b\}$ and $\Sigma_{2}=\{t,f\}$.
Define the function $f_{w}:\Sigma_{1}^{*}\rightarrow\Sigma_{2}^{*}$ for every $w\in\Sigma_{1}^{*}$; $f_{w}(w')\in\Sigma_{2}^{*}$ is the word obtained from $w'\in\Sigma_{1}^{*}$ by replacing the start position of each subword that matches $w$ with $t$ and any other position with $f$.
I meant;
$f_{w}(w')=x_{1}...x_{|w'|}$;
here
$\exists(u,v)\in\Sigma_{1}^{*}\times\Sigma_{1}^{*}[w'=uwv\wedge|u|=i-1]\Rightarrow x_{i}=t$ $\neg\exists (u,v)\in\Sigma_{1}^{*}\times\Sigma_{1}^{*}[w'=uwv\wedge|u|=i-1]\Rightarrow x_{i}=f$
for every $i\in\{1,...,|w|\}$.
Also, define the function $f_{w}^{*}:P(\Sigma_{1}^{*})\rightarrow P(\Sigma_{2}^{*})$ for every $w\in\Sigma_{1}^{*}$; $f_{w}^{*}(L):=\{f_{w}(w')|w'\in L\}$.
I want to know whether each of the assumptions below is true or not;
- For every $w\in\Sigma_{1}^{*}$ satisfying $|w|>0$; $L$ is a regular language $\Rightarrow$ $L'$ is a regular language.
- For every $w\in\Sigma_{1}^{*}$; $L$ is a context-free language $\Rightarrow$ $L'$ is a context-free language.