4. Let $A B C D-A^{\prime} B^{\prime} C^{\prime} D^{\prime}$ be a cube with edge length 1. Then the minimum distance $d=$ $\qquad$ between a point $P$ on the incircle of the top face $A B C D$ and a point $Q$ on the circle passing through the vertices $A, B, C^{\prime}, D^{\prime}$.
4. $\frac{\sqrt{3}-\sqrt{2}}{2}$.

As shown in the figure, let $\angle P O Q = 0$, where point $O$ is the center of $A B C^{\prime} D^{\prime}$ (also the center of the cube). Clearly, $O Q = \frac{\sqrt{3}}{2}$, $O P = \frac{\sqrt{2}}{2}$. By the triangle inequality, we get $P Q \geqslant O Q - O P = \frac{\sqrt{3} - \sqrt{2}}{2}$, equality holds if and only if $\theta = 0^{\circ}$. Since the plane $A B C^{\prime} D^{\prime}$ must intersect the inscribed circle $\odot O_{1}$ of the upper base at the midpoint $P_{0}$ of edge $A B$, let the line $O P_{0}$ intersect the inscribed circle $\odot O$ of $A B C^{\prime} D^{\prime}$ at the top point $Q_{0}$, and $P_{0}$ lies inside the segment $O Q_{0}$, at this time $\theta = 0^{\circ}$. Therefore, the minimum distance
$$
d = P_{0} Q_{0} = \frac{\sqrt{3} - \sqrt{2}}{2} .
$$