4. As shown in the figure, the square $A B C D$ with side length 1 is rotated counterclockwise around point $A$ by $60^{\circ}$ to the position $A B^{\prime} C^{\prime} D^{\prime}$. Then the area of the overlapping part of the two squares is $\qquad$
$4.2-\sqrt{3}$. 
Draw $M N / / A D$ through $B^{\prime}$, intersecting $A B, C D$ at points $M, N$ respectively, and let $B^{\prime} C^{\prime}$ intersect $C D$ at $K$. Then
$$
\begin{aligned}
B^{\prime} M & =A B^{\prime} \cdot \sin 60^{\circ} \\
& =\frac{\sqrt{3}}{2}, \\
\therefore B^{\prime} N & =1-\frac{\sqrt{3}}{2}, A M=\frac{1}{2} .
\end{aligned}
$$
$\bar{D}^{\prime}$
It is easy to prove that Rt $\triangle A K B^{\prime} \cong$ Rt $\triangle A K D$,
$$
\therefore \angle K A B^{\prime}=\angle K A D=15^{\circ}, A D=A B^{\prime} \text {, }
$$

Thus $\angle A D B^{\prime}=75^{\circ}$, so $\angle N D B^{\prime}=15^{\circ}$,
hence Rt $\triangle A D K \sim \mathrm{Rt} \triangle D N B^{\prime}$.
$$
\therefore \frac{D K}{N B^{\prime}}=\frac{A D}{D N} \text {. }
$$

Therefore, $D K=\frac{A D \cdot \tilde{N}}{L} N \frac{A l) \cdot B}{A M}$
$$
=\frac{i \times\left(1-\frac{\sqrt{3}}{2}\right)}{\frac{1}{2}}=2-\sqrt{3} \text {. }
$$
$\therefore$ The area of the overlapping part
$$
S=2 S_{\triangle \triangle D K}=2 \times \frac{1}{2} \times 1 \times(2-\sqrt{3})
$$
$=2-\sqrt{3}$ (square units).