# Confusion about proving that closed subprevarieties are actually prevarieties...

$$\newcommand{\O}{\operatorname{\mathcal{O}}}$$ $$\newcommand{\A}{\operatorname{\mathbb{A}}}$$ $$\renewcommand{\subset}{\subseteq}$$

I'm trying to solve Exercise 5.11 from Gathmann's 2019/20 Algebraic Geometry notes...

https://www.mathematik.uni-kl.de/~gathmann/de/alggeom.php

I think I have understood the statement of the exercise - I think it says the following:

Exercise 5.11. Let $$X$$ be a prevariety and let $$U\subset X$$ be an open affine subset.

Let $$\phi:(U,\O_X|_U)\to (Z,\O_Z)$$ be an isomorphism where $$Z\subset \A^n$$ is Zariski-closed.

Let $$Y\subset X$$ be a closed subset.

Then $$W:=\phi(U\cap Y)$$ is a Zariski closed subset of $$\A^n.$$

Show that $$\phi:U\cap Y \to W$$ is an isomorphism of ringed spaces.

So basically we need to show that, for any open $$V\subset W,$$ the pullback map $$\phi_U:\O_W(V)\to \O_Y(\phi^{-1}V)$$ is an isomorphism (right?).

But how can we do this without knowing anything about $$\phi$$?

We do know that $$\phi$$ induces an isomorphism on all stalks $$\mathcal{O}_{X,p}\simeq\mathcal{O}_{Z,\phi(p)}$$ for all $$p\in U$$. By the sheaf properties (and the fact that $$\phi$$ is already a globally defined function), we can "glue" the stalks to see that $$\phi$$ induces an isomorphism on the entirety of $$V\subseteq W$$. This all follows from the important fact that a morphism of sheaves is an isomorphism if and only if it is an isomorphism at all stalks.