4. Given $-\frac{\pi}{2}<\alpha<\frac{\pi}{2}$,
$$
2 \tan \beta=\tan 2 \alpha, \tan (\beta-\alpha)=-2 \sqrt{2} \text {. }
$$

Then $\cos \alpha=(\quad)$.
(A) $\frac{\sqrt{3}}{2}$
(B) $\frac{\sqrt{2}}{2}$
(C) $\frac{\sqrt{3}}{3}$
(D) $\frac{\sqrt{2}}{3}$
4. C.

Let $\tan \alpha=u$.
From $\tan \beta=\frac{1}{2} \tan 2 \alpha=\frac{\tan \alpha}{1-\tan ^{2} \alpha}=\frac{u}{1-u^{2}}$, we get
$$
\begin{array}{l}
\tan (\beta-\alpha)=\frac{\tan \beta-\tan \alpha}{1+\tan \alpha \cdot \tan \beta} \\
=\frac{\frac{u}{1-u^{2}}-u}{1+u \cdot \frac{u}{1-u^{2}}}=u^{3} .
\end{array}
$$

From $u^{3}=-2 \sqrt{2}$, we get $u=\tan \alpha=-\sqrt{2}$.
Since $-\frac{\pi}{2}<\alpha<\frac{\pi}{2}$, therefore,
$$
\cos \alpha=\frac{1}{\sqrt{1+\tan ^{2} \alpha}}=\frac{\sqrt{3}}{3} .
$$