hcju/stacksqa huggingface dataset:
The question is local on $X$ hence we may assume $X$ is affine, i.e., we have a situation as in Lemma \ref{lemma-inverse-systems-affine}. In this case, if $(\mathcal{F}_n)$ corresponds to the finite $A^\wedge$ module $M$, then $\bigoplus \Ker(\mathcal{F}_{n + 1} \to \mathcal{F}_n)$ corresponds to $\bigoplus I^nM/I^{n + 1}M$ which is clearly a finite module over $\bigoplus I^n/I^{n + 1}$.
Since $f^* : \textit{Coh}(\mathcal{O}_Y) \to \textit{Coh}(\mathcal{O}_X)$ is right exact we have $$ f^*\mathcal{G}_n = f^*(\mathcal{G}_{n + 1}/\mathcal{I}^n\mathcal{G}_{n + 1}) = f^*\mathcal{G}_{n + 1}/f^{-1}\mathcal{I}^nf^*\mathcal{G}_{n + 1} = f^*\mathcal{G}_{n + 1}/\mathcal{J}^nf^*\mathcal{G}_{n + 1} $$ hence the pullback of a system is a system. The construction of cokernels in the proof of Lemma \ref{lemma-inverse-systems-abelian} shows that $f^* : \textit{Coh}(Y, \mathcal{J}) \to \textit{Coh}(X, \mathcal{I})$ is always right exact. If $f$ is flat, then $f^* : \textit{Coh}(\mathcal{O}_Y) \to \textit{Coh}(\mathcal{O}_X)$ is an exact functor. It follows from the construction of kernels in the proof of Lemma \ref{lemma-inverse-systems-abelian} that in this case $f^* : \textit{Coh}(Y, \mathcal{J}) \to \textit{Coh}(X, \mathcal{I})$ also transforms kernels into kernels.
If $X$ and $X'$ are affine, then this follows immediately from More on Algebra, Lemma \ref{more-algebra-lemma-neighbourhood-equivalence}. To prove it in general we let $Z_n \subset X$, $Z'_n \subset X'$ be the $n$th infinitesimal neighbourhoods of $Z$, $Z'$. The induced morphism $Z_n \to Z'_n$ is a homeomorphism on underlying topological spaces. On the other hand, if $z' \in Z'$ maps to $z \in Z$, then the ring map $\mathcal{O}_{X, z} \to \mathcal{O}_{X', z'}$ is flat and induces an isomorphism $\mathcal{O}_{X, z}/\mathcal{I}_z \to \mathcal{O}_{X', z'}/\mathcal{I}'_{z'}$. Hence it induces an isomorphism $\mathcal{O}_{X, z}/\mathcal{I}_z^n \to \mathcal{O}_{X', z'}/(\mathcal{I}'_{z'})^n$ for all $n \geq 1$ for example by More on Algebra, Lemma \ref{more-algebra-lemma-neighbourhood-isomorphism}. Thus $Z'_n \to Z_n$ is an isomorphism of schemes. Thus $f^*$ induces an equivalence between the category of coherent $\mathcal{O}_X$-modules annihilated by $\mathcal{I}^n$ and the category of coherent $\mathcal{O}_{X'}$-modules annihilated by $(\mathcal{I}')^n$, see Lemma \ref{lemma-i-star-equivalence}. This clearly implies the lemma.
First, assume $X = \Spec(A)$ is affine. Let $I, J \subset A$ be the ideals corresponding to $\mathcal{I}, \mathcal{J}$. Then $V(I) = V(J)$ implies we have $I^c \subset J$ and $J^d \subset I$ for some $c, d \geq 1$ by elementary properties of the Zariski topology (see Algebra, Section \ref{algebra-section-spectrum-ring} and Lemma \ref{algebra-lemma-Noetherian-power}). Hence the $I$-adic and $J$-adic completions of $A$ agree, see Algebra, Lemma \ref{algebra-lemma-change-ideal-completion}. Thus the equivalence follows from Lemma \ref{lemma-inverse-systems-affine} in this case. \medskip\noindent In general, using what we said above and the fact that $X$ is quasi-compact, to choose $c, d \geq 1$ such that $\mathcal{I}^c \subset \mathcal{J}$ and $\mathcal{J}^d \subset \mathcal{I}$. Then given an object $(\mathcal{F}_n)$ in $\textit{Coh}(X, \mathcal{I})$ we claim that the inverse system $$ (\mathcal{F}_{cn}/\mathcal{J}^n\mathcal{F}_{cn}) $$ is in $\textit{Coh}(X, \mathcal{J})$. This may be checked on the members of an affine covering; we omit the details. In the same manner we can construct an object of $\textit{Coh}(X, \mathcal{I})$ starting with an object of $\textit{Coh}(X, \mathcal{J})$. We omit the verification that these constructions define mutually quasi-inverse functors.
Let $\mathcal{F}$, $\mathcal{G}$ be coherent $\mathcal{O}_X$-modules. Then $\mathcal{H} = \SheafHom_{\mathcal{O}_X}(\mathcal{G}, \mathcal{F})$ is a coherent $\mathcal{O}_X$-module, see Modules, Lemma \ref{modules-lemma-internal-hom-locally-kernel-direct-sum}. By Lemma \ref{lemma-completion-internal-hom} the map $$ \lim_n H^0(X, \mathcal{H}/\mathcal{I}^n\mathcal{H}) \to \Mor_{\textit{Coh}(X, \mathcal{I})} (\mathcal{G}^\wedge, \mathcal{F}^\wedge) $$ is bijective. Hence fully faithfulness of (\ref{equation-completion-functor}) follows from the theorem on formal functions (Lemma \ref{lemma-spell-out-theorem-formal-functions}) for the coherent sheaf $\mathcal{H}$.
Set $B = \bigoplus I^n/I^{n + 1}$ and $\mathcal{B} = \bigoplus \mathcal{I}^n/\mathcal{I}^{n + 1} = f^*\widetilde{B}$. By Lemma \ref{lemma-finite-over-rees-algebra} the graded quasi-coherent $\mathcal{B}$-module $\mathcal{G} = \bigoplus \Ker(\mathcal{F}_{n + 1} \to \mathcal{F}_n)$ is of finite type. Hence the lemma follows from Lemma \ref{lemma-graded-finiteness} part (2).
We have already seen that (\ref{equation-completion-functor}) is fully faithful in Lemma \ref{lemma-fully-faithful}. Thus it suffices to show that the functor is essentially surjective. \medskip\noindent We first show that every object $(\mathcal{F}_n)$ of $\textit{Coh}(X, \mathcal{I})$ is the quotient of an object in the image of (\ref{equation-completion-functor}).  Let $\mathcal{L}$ be an $f$-ample invertible sheaf on $X$. Choose $d_0$ as in Lemma \ref{lemma-vanishing-projective}. Choose a $d \geq d_0$ such that $\mathcal{F}_1 \otimes \mathcal{L}^{\otimes d}$ is globally generated by some sections $s_{1, 1}, \ldots, s_{t, 1}$. Since the transition maps of the system $$ H^0(X, \mathcal{F}_{n + 1} \otimes \mathcal{L}^{\otimes d}) \longrightarrow H^0(X, \mathcal{F}_n \otimes \mathcal{L}^{\otimes d}) $$ are surjective by the vanishing of $H^1$ we can lift $s_{1, 1}, \ldots, s_{t, 1}$ to a compatible system of global sections $s_{1, n}, \ldots, s_{t, n}$ of $\mathcal{F}_n \otimes \mathcal{L}^{\otimes d}$. These determine a compatible system of maps $$ (s_{1, n}, \ldots, s_{t, n}) : (\mathcal{L}^{\otimes -d})^{\oplus t} \longrightarrow \mathcal{F}_n $$ Using Lemma \ref{lemma-inverse-systems-surjective} we deduce that we have a surjective map $$ \left((\mathcal{L}^{\otimes -d})^{\oplus t}\right)^\wedge \longrightarrow (\mathcal{F}_n) $$ as desired. \medskip\noindent The result of the previous paragraph and the fact that $\textit{Coh}(X, \mathcal{I})$ is abelian (Lemma \ref{lemma-inverse-systems-abelian}) implies that every object of $\textit{Coh}(X, \mathcal{I})$ is a cokernel of a map between objects coming from $\textit{Coh}(\mathcal{O}_X)$. As (\ref{equation-completion-functor}) is fully faithful and exact by Lemmas \ref{lemma-fully-faithful} and \ref{lemma-exact} we conclude.
During this proof we will use without further mention that for a closed immersion $i : Z \to X$ the functor $i_*$ gives an equivalence between the category of coherent modules on $Z$ and coherent modules on $X$ annihilated by the ideal sheaf of $Z$, see Lemma \ref{lemma-i-star-equivalence}. In particular we may identify $\textit{Coh}(\mathcal{O}_{X_e})$ with the category of coherent $\mathcal{O}_X$-modules annihilated by $\mathcal{K}^e$ and $\textit{Coh}(X_e, \mathcal{I}_e)$ as the full subcategory of $\textit{Coh}(X, \mathcal{I})$ of objects annihilated by $\mathcal{K}^e$. Moreover (1) tells us these two categories are equivalent under the completion functor (\ref{equation-completion-functor}). \medskip\noindent Applying this equivalence we get a coherent $\mathcal{O}_X$-module $\mathcal{G}_e$ annihilated by $\mathcal{K}^e$ corresponding to the system $(\mathcal{F}_n/\mathcal{K}^e\mathcal{F}_n)$ of $\textit{Coh}(X, \mathcal{I})$. The maps $\mathcal{F}_n/\mathcal{K}^{e + 1}\mathcal{F}_n \to \mathcal{F}_n/\mathcal{K}^e\mathcal{F}_n$ correspond to canonical maps $\mathcal{G}_{e + 1} \to \mathcal{G}_e$ which induce isomorphisms $\mathcal{G}_{e + 1}/\mathcal{K}^e\mathcal{G}_{e + 1} \to \mathcal{G}_e$. Hence $(\mathcal{G}_e)$ is an object of $\textit{Coh}(X, \mathcal{K})$. The map $\alpha$ induces a system of maps $$ \mathcal{F}_n/\mathcal{K}^e\mathcal{F}_n \longrightarrow \mathcal{H}/(\mathcal{I}^n + \mathcal{K}^e)\mathcal{H} $$ whence maps $\mathcal{G}_e \to \mathcal{H}/\mathcal{K}^e\mathcal{H}$ (by the equivalence of categories again). Let $t \geq 1$ be an integer, which exists by assumption (2), such that $\mathcal{K}^t$ annihilates the kernel and cokernel of all the maps $\mathcal{F}_n \to \mathcal{H}/\mathcal{I}^n\mathcal{H}$. Then $\mathcal{K}^{2t}$ annihilates the kernel and cokernel of the maps $\mathcal{F}_n/\mathcal{K}^e\mathcal{F}_n \to \mathcal{H}/(\mathcal{I}^n + \mathcal{K}^e)\mathcal{H}$, see Remark \ref{remark-inverse-systems-kernel-cokernel-annihilated-by}. Whereupon we conclude that $\mathcal{K}^{4t}$ annihilates the kernel and the cokernel of the maps $$ \mathcal{G}_e \longrightarrow \mathcal{H}/\mathcal{K}^e\mathcal{H}, $$ see Remark \ref{remark-inverse-systems-kernel-cokernel-annihilated-by}. We apply Lemma \ref{lemma-existence-easy} to obtain a coherent $\mathcal{O}_X$-module $\mathcal{F}$, a map $a : \mathcal{F} \to \mathcal{H}$ and an isomorphism $\beta : (\mathcal{G}_e) \to (\mathcal{F}/\mathcal{K}^e\mathcal{F})$ in $\textit{Coh}(X, \mathcal{K})$. Working backwards, for a given $n$ the triple $(\mathcal{F}/\mathcal{I}^n\mathcal{F}, a \bmod \mathcal{I}^n, \beta \bmod \mathcal{I}^n)$ is a triple as in the lemma for the morphism $\alpha_n \bmod \mathcal{K}^e : (\mathcal{F}_n/\mathcal{K}^e\mathcal{F}_n) \to (\mathcal{H}/(\mathcal{I}^n + \mathcal{K}^e)\mathcal{H})$ of $\textit{Coh}(X, \mathcal{K})$. Thus the uniqueness in Lemma \ref{lemma-existence-easy} gives a canonical isomorphism $\mathcal{F}/\mathcal{I}^n\mathcal{F} \to \mathcal{F}_n$ compatible with all the morphisms in sight. This finishes the proof of the lemma.
The implications (3) $\Rightarrow$ (2) and (1) $\Rightarrow$ (2) are immediate. Thus it suffices to prove that (2) implies (3). We urge the reader to find their own proof of this fact. Let $Z'$ and $Z''$ be closed subscheme structures on $Z$ such that $Z' \to S$ is proper. We have to show that $Z'' \to S$ is proper. Let $Z''' = Z' \cup Z''$ be the scheme theoretic union, see Morphisms, Definition \ref{morphisms-definition-scheme-theoretic-intersection-union}. Then $Z'''$ is another closed subscheme structure on $Z$. This follows for example from the description of scheme theoretic unions in Morphisms, Lemma \ref{morphisms-lemma-scheme-theoretic-union}. Since $Z'' \to Z'''$ is a closed immersion it suffices to prove that $Z''' \to S$ is proper (see Morphisms, Lemmas \ref{morphisms-lemma-closed-immersion-proper} and \ref{morphisms-lemma-composition-proper}). The morphism $Z' \to Z'''$ is a bijective closed immersion and in particular surjective and universally closed. Then the fact that $Z' \to S$ is separated implies that $Z''' \to S$ is separated, see Morphisms, Lemma \ref{morphisms-lemma-image-universally-closed-separated}. Moreover $Z''' \to S$ is locally of finite type as $X \to S$ is locally of finite type (Morphisms, Lemmas \ref{morphisms-lemma-immersion-locally-finite-type} and \ref{morphisms-lemma-composition-finite-type}). Since $Z' \to S$ is quasi-compact and $Z' \to Z'''$ is a homeomorphism we see that $Z''' \to S$ is quasi-compact. Finally, since $Z' \to S$ is universally closed, we see that the same thing is true for $Z''' \to S$ by Morphisms, Lemma \ref{morphisms-lemma-image-proper-is-proper}. This finishes the proof.
Observe that the statement makes sense as $f'$ is locally of finite type by Morphisms, Lemma \ref{morphisms-lemma-base-change-finite-type}. Endow $Z$ with the reduced induced closed subscheme structure. Denote $Z' = (g')^{-1}(Z)$ the scheme theoretic inverse image (Schemes, Definition \ref{schemes-definition-inverse-image-closed-subscheme}). Then $Z' = X' \times_X Z = (S' \times_S X) \times_X Z = S' \times_S Z$ is proper over $S'$ as a base change of $Z$ over $S$ (Morphisms, Lemma \ref{morphisms-lemma-base-change-proper}).
Proof of (1). Assume $Y$ is separated over $S$ and $Z \subset X$ is a closed subset proper over $S$. Endow $Z$ with the reduced induced closed subscheme structure and apply Morphisms, Lemma \ref{morphisms-lemma-scheme-theoretic-image-is-proper} to $Z \to Y$ over $S$ to conclude. \medskip\noindent Proof of (2). Assume $f$ is universally closed and $Z \subset X$ is a closed subset proper over $S$. Endow $Z$ and $Z' = f(Z)$ with their reduced induced closed subscheme structures. We obtain an induced morphism $Z \to Z'$. Denote $Z'' = f^{-1}(Z')$ the scheme theoretic inverse image (Schemes, Definition \ref{schemes-definition-inverse-image-closed-subscheme}). Then $Z'' \to Z'$ is universally closed as a base change of $f$ (Morphisms, Lemma \ref{morphisms-lemma-base-change-proper}). Hence $Z \to Z'$ is universally closed as a composition of the closed immersion $Z \to Z''$ and $Z'' \to Z'$ (Morphisms, Lemmas \ref{morphisms-lemma-closed-immersion-proper} and \ref{morphisms-lemma-composition-proper}). We conclude that $Z' \to S$ is separated by Morphisms, Lemma \ref{morphisms-lemma-image-universally-closed-separated}. Since $Z \to S$ is quasi-compact and $Z \to Z'$ is surjective we see that $Z' \to S$ is quasi-compact. Since $Z' \to S$ is the composition of $Z' \to Y$ and $Y \to S$ we see that $Z' \to S$ is locally of finite type (Morphisms, Lemmas \ref{morphisms-lemma-immersion-locally-finite-type} and \ref{morphisms-lemma-composition-finite-type}). Finally, since $Z \to S$ is universally closed, we see that the same thing is true for $Z' \to S$ by Morphisms, Lemma \ref{morphisms-lemma-image-proper-is-proper}. This finishes the proof. \medskip\noindent Proof of (3). Assume $f$ is proper and $Z \subset Y$ is a closed subset proper over $S$. Endow $Z$ with the reduced induced closed subscheme structure. Denote $Z' = f^{-1}(Z)$ the scheme theoretic inverse image (Schemes, Definition \ref{schemes-definition-inverse-image-closed-subscheme}). Then $Z' \to Z$ is proper as a base change of $f$ (Morphisms, Lemma \ref{morphisms-lemma-base-change-proper}). Whence $Z' \to S$ is proper as the composition of $Z' \to Z$ and $Z \to S$ (Morphisms, Lemma \ref{morphisms-lemma-composition-proper}). This finishes the proof.
Endow $Z_i$ with their reduced induced closed subscheme structures. The morphism $$ Z_1 \amalg \ldots \amalg Z_n \longrightarrow X $$ is finite by Morphisms, Lemmas \ref{morphisms-lemma-closed-immersion-finite} and \ref{morphisms-lemma-finite-union-finite}. As finite morphisms are universally closed (Morphisms, Lemma \ref{morphisms-lemma-finite-proper}) and since $Z_1 \amalg \ldots \amalg Z_n$ is proper over $S$ we conclude by Lemma \ref{lemma-functoriality-closed-proper-over-base} part (2) that the image $Z_1 \cup \ldots \cup Z_n$ is proper over $S$.
The support $\text{Supp}(\mathcal{F})$ of $\mathcal{F}$ is a closed subset of $X$, see Morphisms, Lemma \ref{morphisms-lemma-support-finite-type}. Hence we can apply Definition \ref{definition-proper-over-base}. Since the scheme theoretic support of $\mathcal{F}$ is a closed subscheme whose underlying closed subset is $\text{Supp}(\mathcal{F})$ we see that (1) and (2) are equivalent by Definition \ref{definition-proper-over-base}. It is clear that (2) implies (3). Conversely, if (3) is true, then $\text{Supp}(\mathcal{F}) \subset Z$ (an inclusion of closed subsets of $X$) and hence $\text{Supp}(\mathcal{F})$ is proper over $S$ for example by Lemma \ref{lemma-closed-closed-proper-over-base}.
Observe that the statement makes sense because $(g')*\mathcal{F}$ is of finite type by Modules, Lemma \ref{modules-lemma-pullback-finite-type}. We have $\text{Supp}((g')^*\mathcal{F}) = (g')^{-1}(\text{Supp}(\mathcal{F}))$ by Morphisms, Lemma \ref{morphisms-lemma-support-finite-type}. Thus the lemma follows from Lemma \ref{lemma-base-change-closed-proper-over-base}.
Proof of (1). Let $Z$, $Z'$ be the support of $\mathcal{F}$ and $\mathcal{G}$. Then all the sheaves mentioned in (1) have support contained in $Z \cup Z'$. Thus the assertion itself is clear from Lemmas \ref{lemma-closed-closed-proper-over-base} and \ref{lemma-union-closed-proper-over-base} provided we check that these sheaves are finite type and quasi-coherent. For quasi-coherence we refer the reader to Schemes, Section \ref{schemes-section-quasi-coherent}. For ``finite type'' we suggest the reader take a look at Modules, Section \ref{modules-section-finite-type}. \medskip\noindent Proof of (2). The proof is the same as the proof of (1). Note that the assertions make sense as $X$ is locally Noetherian by Morphisms, Lemma \ref{morphisms-lemma-finite-type-noetherian} and by the description of the category of coherent modules in Section \ref{section-coherent-sheaves}.
By Lemma \ref{lemma-module-support-proper-over-base} there exists a closed immersion $i : Z \to X$ and a finite type, quasi-coherent $\mathcal{O}_Z$-module $\mathcal{G}$ such that (a) $g = f \circ i : Z \to S$ is proper, and (b) $i_*\mathcal{G} = \mathcal{F}$. We see that $R^pg_*\mathcal{G}$ is coherent on $S$ by Proposition \ref{proposition-proper-pushforward-coherent}. On the other hand, $R^qi_*\mathcal{G} = 0$ for $q > 0$ (Lemma \ref{lemma-finite-pushforward-coherent}). By Cohomology, Lemma \ref{cohomology-lemma-relative-Leray} we get $R^pf_*\mathcal{F} = R^pg_*\mathcal{G}$ which concludes the proof.
We will use the criterion of Homology, Lemma \ref{homology-lemma-characterize-serre-subcategory}. Moreover, we will use that if $0 \to (\mathcal{G}_n) \to (\mathcal{F}_n) \to (\mathcal{H}_n) \to 0$ is a short exact sequence of $\textit{Coh}(X, \mathcal{I})$, then (a) $\mathcal{G}_n \to \mathcal{F}_n \to \mathcal{H}_n \to 0$ is exact for all $n \geq 1$ and (b) $\mathcal{G}_n$ is a quotient of $\Ker(\mathcal{F}_m \to \mathcal{H}_m)$ for some $m \geq n$. See proof of Lemma \ref{lemma-inverse-systems-abelian}. \medskip\noindent Proof of (1). Let $(\mathcal{F}_n)$ be an object of $\textit{Coh}(X, \mathcal{I})$. Then $\text{Supp}(\mathcal{F}_n) = \text{Supp}(\mathcal{F}_1)$ for all $n \geq 1$. Hence by remarks (a) and (b) above we see that for any short exact sequence $0 \to (\mathcal{G}_n) \to (\mathcal{F}_n) \to (\mathcal{H}_n) \to 0$ of $\textit{Coh}(X, \mathcal{I})$ we have $\text{Supp}(\mathcal{G}_1) \cup \text{Supp}(\mathcal{H}_1) = \text{Supp}(\mathcal{F}_1)$. This proves that the category defined in (1) is a Serre subcategory of $\textit{Coh}(X, \mathcal{I})$. \medskip\noindent Proof of (2). Here we argue the same way. Let $0 \to (\mathcal{G}_n) \to (\mathcal{F}_n) \to (\mathcal{H}_n) \to 0$ be a short exact sequence of $\textit{Coh}(X, \mathcal{I})$. If $Z \subset X$ is a closed subscheme and $\mathcal{I}_Z$ annihilates $\mathcal{F}_n$ for all $n$, then $\mathcal{I}_Z$ annihilates $\mathcal{G}_n$ and $\mathcal{H}_n$ for all $n$ by (a) and (b) above. Hence if $Z \to S$ is proper, then we conclude that the category defined in (2) is closed under taking sub and quotient objects inside of $\textit{Coh}(X, \mathcal{I})$. Finally, suppose that $Z \subset X$ and $Y \subset X$ are closed subschemes proper over $S$ such that $\mathcal{I}_Z \mathcal{G}_n = 0$ and $\mathcal{I}_Y \mathcal{H}_n = 0$ for all $n \geq 1$. Then it follows from (a) above that $\mathcal{I}_{Z \cup Y} = \mathcal{I}_Z \cdot \mathcal{I}_Y$ annihilates $\mathcal{F}_n$ for all $n$. By Lemma \ref{lemma-union-closed-proper-over-base} (and via Definition \ref{definition-proper-over-base} which tells us we may choose an arbitrary scheme structure used on the union) we see that $Z \cup Y \to S$ is proper and the proof is complete.
Let's write $j_n : Z_n \to X_n$ for the vertical morphisms. As the squares in the statement are cartesian we see that the base change of $j_n$ to $X_1$ is $j_1$. Thus Morphisms, Lemma \ref{morphisms-lemma-check-closed-infinitesimally} shows that $j_n$ is a closed immersion. Set $\mathcal{F}_n = j_{n, *}\mathcal{O}_{Z_n}$, so that $j_n^\sharp$ is a surjection $\mathcal{O}_{X_n} \to \mathcal{F}_n$. Again using that the squares are cartesian we see that the pullback of $\mathcal{F}_{n + 1}$ to $X_n$ is $\mathcal{F}_n$. Hence Grothendieck's existence theorem, as reformulated in Remark \ref{remark-reformulate-existence-theorem}, tells us there exists a map $\mathcal{O}_X \to \mathcal{F}$ of coherent $\mathcal{O}_X$-modules whose restriction to $X_n$ recovers $\mathcal{O}_{X_n} \to \mathcal{F}_n$. Moreover, the support of $\mathcal{F}$ is proper over $S$. As the completion functor is exact (Lemma \ref{lemma-exact}) we see that the cokernel $\mathcal{Q}$ of $\mathcal{O}_X \to \mathcal{F}$ has vanishing completion. Since $\mathcal{F}$ has support proper over $S$ and so does $\mathcal{Q}$ this implies that $\mathcal{Q} = 0$ for example because the functor (\ref{equation-completion-functor-proper-over-A}) is an equivalence by Grothendieck's existence theorem. Thus $\mathcal{F} = \mathcal{O}_X/\mathcal{J}$ for some quasi-coherent sheaf of ideals $\mathcal{J}$. Setting $Z = V(\mathcal{J})$ finishes the proof.
Let's write $f_n : Y_n \to X_n$ for the vertical morphisms. Set $\mathcal{F}_n = f_{n, *}\mathcal{O}_{Y_n}$. This is a coherent $\mathcal{O}_{X_n}$-module as $f_n$ is finite (Lemma \ref{lemma-finite-pushforward-coherent}). Using that the squares are cartesian we see that the pullback of $\mathcal{F}_{n + 1}$ to $X_n$ is $\mathcal{F}_n$. Hence Grothendieck's existence theorem, as reformulated in Remark \ref{remark-reformulate-existence-theorem}, tells us there exists a coherent $\mathcal{O}_X$-module $\mathcal{F}$ whose restriction to $X_n$ recovers $\mathcal{F}_n$. Moreover, the support of $\mathcal{F}$ is proper over $S$. As the completion functor is fully faithful (Theorem \ref{theorem-grothendieck-existence}) we see that the multiplication maps $\mathcal{F}_n \otimes_{\mathcal{O}_{X_n}} \mathcal{F}_n \to \mathcal{F}_n$ fit together to give an algebra structure on $\mathcal{F}$. Setting $Y = \underline{\Spec}_X(\mathcal{F})$ finishes the proof.
The morphisms $(1, g_n) : X_n \to X_n \times_S Y_n$ are closed immersions because $Y_n \to S_n$ is separated (Schemes, Lemma \ref{schemes-lemma-section-immersion}). Thus by Lemma \ref{lemma-algebraize-formal-closed-subscheme} there exists a closed subscheme $Z \subset X \times_S Y$ proper over $S$ whose base change to $S_n$ recovers $X_n \subset X_n \times_S Y_n$. The first projection $p : Z \to X$ is a proper morphism (as $Z$ is proper over $S$, see Morphisms, Lemma \ref{morphisms-lemma-image-proper-scheme-closed}) whose base change to $S_n$ is an isomorphism for all $n$. In particular, $p : Z \to X$ is finite over an open neighbourhood of $X_0$ by Lemma \ref{lemma-proper-finite-fibre-finite-in-neighbourhood}. As $X$ is proper over $S$ this open neighbourhood is all of $X$ and we conclude $p : Z \to X$ is finite. Applying the equivalence of Proposition \ref{proposition-existence-proper} we see that $p_*\mathcal{O}_Z = \mathcal{O}_X$ as this is true modulo $I^n$ for all $n$. Hence $p$ is an isomorphism and we obtain the morphism $g$ as the composition $X \cong Z \to Y$. We omit the proof of uniqueness.