We will denote $T \mapsto T_0$ the base change by $\Spec(A/I) \to \Spec(A)$. By Chow's lemma (in the form of Limits, Lemma \ref{limits-lemma-chow-finite-type}) there exists a surjective proper morphism $\varphi : X' \to X$ such that $X'$ admits an immersion into $\mathbf{P}^n_A$. Set $Y' = \varphi^{-1}(Y)$. This is an open and closed subscheme of $X'_0$. Suppose the lemma holds for $(X', Y')$. Let $W' \subset X'$ be the open and closed subscheme proper over $A$ such that $Y' = W'_0$. By Morphisms, Lemma \ref{morphisms-lemma-image-proper-scheme-closed} $W = \varphi(W') \subset X$ and $Q = \varphi(X' \setminus W') \subset X$ are closed subsets and by Morphisms, Lemma \ref{morphisms-lemma-image-proper-is-proper} $W$ is proper over $A$. The image of $W \cap Q$ in $\Spec(A)$ is closed. Since $(A, I)$ is henselian, if $W \cap Q$ is nonempty, then we find that $W \cap Q$ has a point lying over $\Spec(A/I)$. This is impossible as $W'_0 = Y' = \varphi^{-1}(Y)$. We conclude that $W$ is an open and closed subscheme of $X$ proper over $A$ with $W_0 = Y$. Thus we reduce to the case described in the next paragraph. \medskip\noindent Assume there exists an immersion $j : X \to \mathbf{P}^n_A$ over $A$. Let $\overline{X}$ be the scheme theoretic image of $j$. Since $j$ is a quasi-compact morphism (Schemes, Lemma \ref{schemes-lemma-quasi-compact-permanence}) we see that $j : X \to \overline{X}$ is an open immersion (Morphisms, Lemma \ref{morphisms-lemma-quasi-compact-immersion}). Hence the base change $j_0 : X_0 \to \overline{X}_0$ is an open immersion as well. Thus $j_0(Y) \subset \overline{X}_0$ is open. It is also closed by Morphisms, Lemma \ref{morphisms-lemma-image-proper-scheme-closed}. Suppose that the lemma holds for $(\overline{X}, j_0(Y))$. Let $\overline{W} \subset \overline{X}$ be the corresponding open and closed subscheme proper over $A$ such that $j_0(Y) = \overline{W}_0$. Then $T = \overline{W} \setminus j(X)$ is closed in $\overline{W}$, hence has closed image in $\Spec(A)$ by properness of $\overline{W}$ over $A$. Since $(A, I)$ is henselian, we find that if $T$ is nonempty, then there is a point of $T$ mapping into $\Spec(A/I)$. This is impossible because $j_0(Y) = \overline{W}_0$ is contained in $j(X)$. Hence $\overline{W}$ is contained in $j(X)$ and we can set $W \subset X$ equal to the unique open and closed subscheme mapping isomorphically to $\overline{W}$ via $j$. Thus we reduce to the case described in the next paragraph. \medskip\noindent Assume $X \subset \mathbf{P}^n_A$ is a closed subscheme. Then $X \to \Spec(A)$ is a proper morphism. Let $Z = X_0 \setminus Y$. This is an open and closed subscheme of $X_0$ and $X_0 = Y \amalg Z$. Let $X \to X' \to \Spec(A)$ be the Stein factorization as in Theorem \ref{theorem-stein-factorization-general}. Let $Y' \subset X'_0$ and $Z' \subset X'_0$ be the images of $Y$ and $Z$. Since the fibres of $X \to Z$ are geometrically connected, we see that $Y' \cap Z' = \emptyset$. Hence $X'_0 = Y' \amalg Z'$ as $X \to X'$ is surjective. Since $X' \to \Spec(A)$ is integral, we see that $X'$ is the spectrum of an $A$-algebra integral over $A$. Recall that open and closed subsets of spectra correspond $1$-to-$1$ with idempotents in the corresponding ring, see Algebra, Lemma \ref{algebra-lemma-disjoint-decomposition}. Hence by More on Algebra, Lemma \ref{more-algebra-lemma-characterize-henselian-pair} we see that we may write $X' = W' \amalg V'$ with $W'$ and $V'$ open and closed and with $Y' = W'_0$ and $Z' = V'_0$. Let $W$ be the inverse image in $X$ to finish the proof.