
> 
> Suppose $f:X\to Y$ is a morphism of *smooth connected* schemes (over some base). Say $Z\subseteq Y$ is a closed subscheme with complement $U$ so that $f$ pulls back (restricts) to isomorphisms on $Z$ and $U$. Does it follow that $f$ is an isomorphism?
> 
> 
> 


If we drop the condition that $X$ and $Y$ have to be smooth, the normalization of a cusp is a counterexample. If we remove the hypothesis that $X$ and $Y$ must be connected, taking $X=U\sqcup Z$ gives a counterexample.



If a map restricts to an isomorphism on a closed subscheme and its open complement, must it be an isomorphism?
This is essentially the argument in [Bhargav](https://mathoverflow.net/users/986/bhargav)'s comment. [Matt Satriano](https://mathoverflow.net/users/28/matt-satriano) showed me the separatedness argument.


We first apply the valuative criterion for separatedness to show that $f:X\to Y$ is separated. In fact, this shows that any morphism which is injective on topological spaces must be separated. Suppose $\Delta$ is the spectrum of a valuation ring with closed point $\ast$. Given any map $\Delta\to Y$, there is a unique set theoretic lift to $X$. Therefore, any failure of the valuative criterion will be witnessed on the induced map from an affine open neighborhood of $\ast$ in $X$ to an affine open neighborhood of $\ast$ in $Y$. Since any morphism of affine schemes is separated, the valuative criterion holds, so $f$ is separated.


Since $f$ induces isomorphisms on geometric points, it is quasi-finite. Supposing $Y$ is normal, integral and locally noetherian and $f$ is finite type, Zariski's Main Theorem† tells us that $f$ is an open immersion. Since $f$ is surjective, it is an isomorphism.


† I'm always surprised at how *everything* seems to be ZMT, so here's a precise reference: EGA III, Corollary 4.4.9. If $Y$ is normal, integral, and locally noetherian, $f:X\to Y$ is separated, birational, finite type, and quasi-finite, then $f$ is an open immersion.


