TITLE: If a chain of distinct irreducible closed subsets of a quasi-affine variety $Y$ is maximal, a chain of their closures is maximal in $\overline{Y}$?
QUESTION [5 upvotes]: The following is the Proposition 1.10 of Hartshorne's Algebraic Geometry:

If $Y$ is a quasi-affine variety, then $\dim Y =\dim \overline{Y}$.

In the proof, there is a statement saying that if 
$$
Z_0 \subset \cdots \subset Z_n \;\;\; (1)
$$
is a maximal chain of distinct irreducible closed subsets of $Y$, then
$$
\overline{Z}_0 \subset \cdots \subset \overline{Z}_n   \;\;\; (2)
$$
is also a maximal chain of distinct irreducible closed subsets of $\overline{Y}$
refering to the example (1.1.3) which is

Any nonempty open subset of an irreducible space is irreducible and dense. 

I can't understand this. Yes, Y is an open subset of an affine variety. Then, what ?
Help me!

REPLY [2 votes]: We are given a maximal chain in $Y$ given by $(1)$. Each $Z_i$ is irreducible in $Y$ and hence is irreducible in $X=\bar{Y}$. We know that if $Z_i$ is irreducible in $X$ then it's closure is also irreducible (and of course $\bar{Z_i}$ is closed in $X$). What remains to show is that your chain in $(2)$ is maximal. Suppose we could extend it to $\bar{Z_n}\subset W$ with proper containment and $W$ is closed and irreducible. 
Let $W' = Y\cap W$. Since $W$ is closed, $W'$ is closed in $Y$. Now we use your quoted theorem. $W'$ is irreducible since it is a non-empty open subset of an irreducible set.
Finally, $Z_n\subset W'$ since intersection respects containment, and is strict since their closures are distinct (We are using the fact that $W'$ is dense in $W$ so that $\bar{W'}=W$, which again makes use of your quoted theorem). Thus we have extended the maximal chain $(1)$ which is a contradiction.