I'm reading James Anderson's Automata Theory with Modern Applications. Here:
And I tried to prove the following theorem (for prefix codes).
I tried in the following way: Suppose $C$ is a prefix code which is not uniquely decipherable, that is there is a string $u \in C$ with two different expressions $u=ab=cd$. But $u=vw$ and hence $vw=ab=cd$ where $w= \lambda$ and $\lambda$ is the empty word, therefore $v=a=c$ and $\lambda=b=d$ which contradicts your hypothesis that $u$ is not uniquely decipherable.
Is this correct? I am confused because I paired $v=a=c$ and $\lambda=b=d$ and I'm not sure if that is valid.