  Using the Fredholm theory of the linear time-dependent Schr\"odinger equation
set up in our previous article arXiv:2201.03140, we solve the final-state
problem for the nonlinear Schr\"odinger problem $$ (D_t + \Delta + V) u = N[u],
\quad u(z,t) \sim (4\pi it)^{-n/2} e^{i|z|^2/4t} f\big( \frac{z}{2t} \big),
\quad t \to -\infty, $$ where $u : \mathbb{R}^{n+1} \to \mathbb{C}$ is the
unknown and $f : \mathbb{R}^n \to \mathbb{C}$ is the asymptotic data. Here $D_t
= -i \frac{\partial}{\partial t}$ and $\Delta = \sum_{j=1}^n D_{z_j} D_{z_j}$
is the positive Laplacian, or more generally a compactly supported, nontrapping
perturbation of this, $V$ is a smooth compactly supported potential function,
and the nonlinear term $N$ is a (suitable) polynomial in $u$, $\partial_{z_j}u$
and their complex conjugates satisfying phase invariance. Our assumption on the
asymptotic data $f$ is that it is small in a certain function space
$\mathcal{W}^k$ constructed in arXiv:2201.03140, for sufficiently large $k \in
\mathbb{N}$, where the index $k$ measures both regularity and decay at infinity
(it is similar to, but not quite a standard weighted Sobolev space $H^{k,
k}(\mathbb{R}^n)$). We find that for $N[u] = \pm |u|^{p-1} u$, $p$ odd, and
$(n,p) \neq (1, 3)$ then if the asymptotic data as $t \to -\infty$ is small in
$\mathcal{W}^k$, then the asymptotic data as $t \to +\infty$ is also in
$\mathcal{W}^k$; that is, the nonlinear scattering map preserves these spaces
of asymptotic data. For a more general nonlinearity involving derivatives of
$u$, we show that if the asymptotic data as $t \to -\infty$ is small in
$\langle \zeta \rangle^{-1} \mathcal{W}^k_\zeta$, then the asymptotic data as
$t \to +\infty$ is also in this space (where $\zeta$ is the argument of $f$).
