4. If real numbers $x, y$ satisfy $x^{3}+y^{3}+3 x y=1$, then the minimum value of $x^{2}+y^{2}$ is $\qquad$ .
4. $\frac{1}{2}$.

Notice that,
$$
\begin{aligned}
0= & x^{3}+y^{3}+3 x y-1 \\
= & (x+y)^{3}+(-1)^{3}-3 x^{2} y-3 x y^{2}+3 x y \\
= & (x+y-1)\left((x+y)^{2}-\right. \\
& \left.(x+y)(-1)+(-1)^{2}\right)-3 x y(x+y-1) \\
= & (x+y-1)\left(x^{2}+y^{2}-x y+x+y+1\right) \\
= & \frac{1}{2}(x+y-1)\left((x-y)^{2}+(x+1)^{2}+(y+1)^{2}\right) .
\end{aligned}
$$

Thus, $x=y=-1$ or $x+y=1$.
If $x=y=-1$, then $x^{2}+y^{2}=2$.
If $x+y=1$, then
$$
\begin{array}{l}
x^{2}+y^{2}=\frac{1}{2}\left((x+y)^{2}+(x-y)^{2}\right) \\
=\frac{1}{2}\left(1+(x-y)^{2}\right) \geqslant \frac{1}{2},
\end{array}
$$

with equality holding if and only if $x=y=\frac{1}{2}$.
Therefore, the minimum value of $x^{2}+y^{2}$ is $\frac{1}{2}$.