4. All real pairs $(x, y)=$ $\qquad$  that satisfy the equation,
$$
\log _{2}\left[2 \cos ^{2}(x y)+\frac{1}{2 \cos ^{2}(x y)}\right]=-y^{2}+y+\frac{3}{4}
$$
4. $\left(k \pi+\frac{\pi}{2}, \frac{1}{2}\right)(k \in \mathbf{Z})$.

From $2 \cos ^{2}(x y)>0$, we get
the left side $\geqslant \log _{2} 2=1$.
And the right side $=-\left(y-\frac{1}{2}\right)^{2}+1 \leqslant 1$.
Therefore, the left side must equal the right side, both equal to 1.
$$
\begin{array}{l}
\text { Hence } y=\frac{1}{2}, 2 \cos ^{2}(x y)=\frac{1}{2 \cos ^{2}(x y)}=1 \\
\Rightarrow \cos ^{2} \frac{x}{2}=\frac{1+\cos x}{2}=\frac{1}{2} \\
\Rightarrow \cos x=0 \Rightarrow x=k \pi+\frac{\pi}{2}(k \in \mathbf{Z}) .
\end{array}
$$