Define, by structural induction, a function $f : A^* \to A^*$ that removes all occurrences of the letter $a$. For instance, we should have $f(abcbab) = bcbb$ and $f(bc) = bc$.
I came up with this:
$f(\lambda) = \lambda$ (empty word)
$f(xw) = xf(w)$ if $x$ is not $a$
$f(w)$, otherwise.
But I have no idea if this is sufficient and if its a structural induction.
Thanks in advance
You have the right idea but I would make the removal of $a$ the explicit case:
$f(\lambda) = \lambda$
$f(aw) = f(w)$
$f(xw) = xf(w) \ otherwise$