4. Given real numbers $a, b$ satisfy $\arcsin \left(1+a^{2}\right)-\arcsin (b-1)^{2} \geqslant \frac{\pi}{2}$. Then $\arccos \left(a^{2}-b^{2}\right)=$ $\qquad$ .
4. $\pi$.

From the problem, we have
$$
\begin{array}{l}
1+a^{2} \leqslant 1 \Rightarrow a=0 \\
\Rightarrow \arcsin \left(1+a^{2}\right)=\frac{\pi}{2} .
\end{array}
$$

From the given inequality, we get
$$
\arcsin (b-1)^{2} \leqslant 0 \text {. }
$$

Then $(b-1)^{2}=0 \Rightarrow b=1$.
Thus, $\arccos \left(a^{2}-b^{2}\right)=\arccos (-1)=\pi$.