# Closure of a quasi-affine variety

According to Hartshorne's Algebraic Geometry, an affine variety is an irreducible closed subset $X$ of $\mathbb{A}^n$ (in the Zariski topology) and a quasi-affine variety is an open subset of an affine variety.

Here is my question: let $X$ is an affine variety and $\emptyset\neq Y\subsetneq X$ an open subset of $X$. Is $\overline{Y}=X$ necessarily true?

Using example $1.1.3$ from the book, I've concluded that $Y$ has to be dense in $X$, so I have a strong feeling that the answer is yes. Counter-examples also seem unlikely. But anyway, I'm having trouble formalizing it.

• A topological space is irreducible iff all its non-empty open subsets are dense within it. – Kenny Wong Aug 16 '17 at 21:11
• The definition of quasi-affine says that $Y$ has to be an open subset of some affine variety. But your hypotheses don't guarantee that that affine variety is $X$. Put another way, as you've written things, there's no reason we couldn't have a proper affine subvariety $Z \subset X$ such that $Y$ is an open subset of $Z$. Then the closure of $Y$ will be $Z$, not $X$. – bertram Aug 16 '17 at 21:32

As it was already pointed out in the comments, the answer to your question is no. Here is a specific counterexample: Let's take as irreducible affine variety in $\mathbb{C}^2$, the circle given by equation $x^2+y^2-1=0$ and then take simply the singleton $\{(0,1)\}$. It is a quasi-affine variety, since it is an affine variety. It is closed inside of the circle, therefore its closure is still the singleton.
If on the other hand your quasi-variety $Y$ is open in $X$, then it is true that $\overline Y=X$, since every non-empty open subset of an irreducible set is dense.
• thanks for your answer. I've just edited the question so it demands $Y$ open in $X$. – rmdmc89 Aug 18 '17 at 10:44