Let $\Sigma_1 , \Sigma_2$ be alphabets. Let $L\subseteq \Sigma_1^*$ be a regular language, and let $ h:\Sigma_1^* \rightarrow \Sigma_2^* $ be a homomorphism.
Proof $h(L)$ is regular.
I have written a proof using induction over the number of operands in the regular expression $r$ such that $L = L(r)$, that there exists a regular expression $r'$ such that $L(r') = h(L)$.
I divided it to three cases:
$r=r_1 \cup r_2$
$ r= r_1r_2$
$ r =r_1^*$
Since functions union might not always be a function (i.e $f(1)=1$, $g(1) =2$ $\rightarrow f\cup g$ not a function) I would like to get your opinion for the union case, to verify I didn't do anything wrong there - especially in lines $5,6,7$:
- $w\in h(L) \Leftrightarrow w = h(\sigma_1 \dots \sigma_n)\in h(L) \wedge \sigma_1 \dots \sigma_n \in L \Leftrightarrow $
- $\sigma_1 \dots \sigma_n \in L(r_1 \cup r_2) \Leftrightarrow $
- $\sigma_1 \dots \sigma_n \in L(r_1) \cup L(r_2) \Leftrightarrow $
- $\sigma_1 \dots \sigma_n \in L(r_1) \vee \sigma_1 \dots \sigma_n\in L(r_2) \Leftrightarrow $
- $h(\sigma_1 \dots \sigma_n) \in h(L(r_1)) \vee h(\sigma_1 \dots \sigma_n) \in h(L(r_2)) \Leftrightarrow $
- $h(\sigma_1 \dots \sigma_n) \in h(L(r_1)) \cup h(L(r_2)) \Leftrightarrow $
Now, using the induction hypothesis, since $r_1$ and $r_2$ has less operands,
- $h(\sigma_1 \dots \sigma_n) \in L(r_1') \cup L(r_2') \Leftrightarrow $
- $w \in L(r_1' \cup r_2') $
Is this a valid proof for this case?