# Varieties cannot be isomorphic to proper open subsets

Let $X$ be an irreducible variety and let $U \subset X$ be a proper open set. Question : can there be a morphism $f : X \rightarrow U$ such that the composition $U \hookrightarrow X \stackrel{f}{\rightarrow} U$ is the identity?

My guess is that the answer is "no", but I can't seem to prove it.

One observation is that if $f$ exists, then it would give a procedure for taking a regular function $\phi : U \rightarrow k$ and extending it to all of $X$. But this can definitely be done in some cases; for instance, if $X = \mathbb{A}^2$ and $U = \mathbb{A}^2 \setminus \{(0,0)\}$.

-
The title seems to ask a different question than the body. The question in the body asks whether a proper open subset can be a retract. – Benjamin Steinberg Feb 10 '12 at 23:00
The question in the title is much more interesting than the question in the question. For the question in the question, regard $f$ as a function from $X$ to $X$, and observe that $f$ restricts to the identity on $U$. Thus $f$ must be the identity on the closure of $U$, which is all of $X$ since $X$ is irreducible. – Andy Putman Feb 11 '12 at 4:35
The retraction question is slightly more subtle than it appears since the Zariski topology is not Hausdorff. One needs to use that varieties are separated. – Benjamin Steinberg Feb 11 '12 at 13:11