4. In $\triangle A B C$, $B C=a, A C=b, A B=c$. Then $(b+c-a):(a+c-b):(a+b-c)$ equals ( ).
(A) $\sin \frac{A}{2}: \sin \frac{B}{2}: \sin \frac{C}{2}$
(B) $\cos \frac{A}{2}: \cos \frac{B}{2}: \cos \frac{C}{2}$
(C) $\tan \frac{A}{2}: \tan \frac{B}{2}: \tan \frac{C}{2}$
(D) $\cot \frac{A}{2}: \cot \frac{B}{2}: \cot \frac{C}{2}$
4.D.

As shown in Figure 3, it is easy to know
$$
\begin{array}{l}
b+c-a=2 A D \\
=2 r \cot \frac{A}{2}, \\
a+c-b=2 r \cot \frac{B}{2}, \\
a+b-c=2 r \cot \frac{C}{2} .
\end{array}
$$