4. As shown in Figure 4, in $\triangle A B C$, $A B=A C$, $\angle B=40^{\circ}$, $B D$ is the angle bisector of $\angle B$, and $B D$ is extended to $E$ such that $D E=A D$. Then the degree measure of $\angle E C A$ is
4. $40^{\circ}$.

As shown in Figure 7, on $BC$, take $BF=AB$, connect $DF$, then $\triangle ABD \cong \triangle FBD$.
$$
\therefore DF=DA=DE.
$$

From $AC=AB$, we know $\angle ACB=40^{\circ}$.
$$
\begin{aligned}
\angle DFC & =180^{\circ}-\angle DFB \\
& =180^{\circ}-80^{\circ}=100^{\circ},
\end{aligned}
$$
$$
\therefore \angle FDC=60^{\circ}.
$$

Also, $\angle BDF=180^{\circ}-20^{\circ}-100^{\circ}=60^{\circ}$, so $\angle CDE=60^{\circ}$,
$\therefore \triangle DCF \cong \triangle DCE$.
Thus, $\angle DCE=\angle DCF=40^{\circ}$.