This theorem is from the Red Book of Varieties and Schemes, page 147. I'm stuck on a detail in the second paragraph of the proof.
Let $U_i = \operatorname{Spec} S_i$. For $s \in B \subseteq \mathcal O_X(X) = R$, we have the element $f^{\ast}(X)(s) = f^{\ast}(s)$ in $\mathcal O_Y(Y)$, where $f^{\ast}: \mathcal O_X \rightarrow f_{\ast} \mathcal O_Y$ is the surjective morphism of ringed spaces defining the closed immersion.
I believe that the notation $\operatorname{res}_{Y,U_i}(f^\ast s)$ denotes the restriction of $f^\ast s$ to the open set $Y \cap U_i$ of $Y$, that is $f^\ast s|_{Y \cap U_i}$.
But $f^\ast s$ seems like it is the image under some homomorphism of an element $\sigma_i$ of $\mathcal O_{X\mid U}(U) = \mathcal O_X(U)$. The element $\sigma$ should be $s\mid U$, but what is the homomorphism?
I believe it should be possible to define some morphism of schemes $j: Y \cap U_i \rightarrow U_i$, even a closed immersion, such that the diagram
$$\begin{matrix} U_i & \rightarrow & X \\ \uparrow j & & \uparrow f \\ Y \cap U_i & \rightarrow & Y \end{matrix}$$
commutes, which I think would give me the required homomorphism. Is this what is really going on, or am I misunderstanding the argument in the proof? If I am correct, why is this morphism $j$ not mentioned explicitly?
Edit: I think I see it. Perhaps the affine schemes $\operatorname{Spec} S_i$ were not intended to be open subschemes of $X$, but rather open in $Y$. That would make a lot more sense, and the above argument can be avoided.
