I am confused about a step in Hartshorne's proof (final part of Corollary 1.4) that an algebraic set Y$Y$ in affine n-space A^n,$\mathbb{A}^n$ having a prime ideal I(Y)$I(Y)$ in the polynomial ring over n$n$ variables A$A$. The proof goes as follows:
Let p be a prime ideal, and suppose Z(p) = Y1 union Y2. Then p = I(Y1) intersection I(Y2). Then (here is where I am confused!) p equals I(Y1) or I(Y2). Then of course Y equals Y1 or Y2, thus Y is irreducible.
Let $\mathfrak{p}$ be a prime ideal, and suppose $Z(p) = Y_1 \cup Y_2$. Then $p = I(Y_1)$ intersection $I(Y_2)$. Then (here is where I am confused!) $\mathfrak{p}$ equals $I(Y_1)$ or $I(Y_2)$. Then of course $Y$ equals $Y_1$ or $Y_2$, thus $Y$ is irreducible.