4. Given the vector $\boldsymbol{a}=(1,1)$. Then the vector $\boldsymbol{b}=$ $\left(\frac{1-\sqrt{3}}{2}, \frac{1+\sqrt{3}}{2}\right)$ is obtained by rotating vector $a$ through $(\quad)$.
(A) clockwise rotation by $60^{\circ}$
(B) clockwise rotation by $120^{\circ}$
(C) counterclockwise rotation by $60^{\circ}$
(D) counterclockwise rotation by $120^{\circ}$
4. C.

Let the angle between the two vectors be $\theta$. Then
$$
\cos \theta=\frac{\left(\frac{1-\sqrt{3}}{2}, \frac{1+\sqrt{3}}{2}\right) \cdot(1,1)}{2}=\frac{1}{2} \text {. }
$$

Given $\theta \in\left[0^{\circ}, 180^{\circ}\right]$, thus, $\theta=60^{\circ}$.
Notice that, $\frac{1-\sqrt{3}}{2}<0$.
Therefore, vector $\boldsymbol{b}$ can be obtained by rotating $\boldsymbol{a}$ counterclockwise by $60^{\circ}$.