I am self-studying Shafarevich's "Basic Algebraic Geometry" and I am having some trouble understanding the decomposition of quasi-projective varieties into irreducible components. I work over an algebraically closed field.
Shafarevich claims that "The notion of irreducible variety and the theorem on decomposing a variety as a union of irreducible components carries over word-for-word from the case of affine sets." I am having difficulties understanding this (Shafarevich dedicates only half a page to the concept of quasi-projective variety, leaving a lot for the student to figure out by himself).
Let $X \subseteq \Bbb P ^n$ be an irreducible projective variety. Let $U = \{[x_0 : \dots : x_n] \in \Bbb P ^n \mid x_0 \ne 0\}$ be our usual affine chart. Let $X_0 = U \cap X$ be the affine part and $X_\infty = X \setminus X_0$ be the part at infinity. $X_0$ is the intersection of a Zariski closed subset of $\Bbb P^n$ and the open subset $U$, therefore a quasi-projective variety. $X_\infty$ is a closed subset of $X$, therefore closed in $\Bbb P^n$, therefore projective, therefore quasi-projective. Since $X = X_0 \cup X_\infty$, it follows that $X$ is reducible! Where am I wrong?
A concrete example: consider the affine line $L: x=0$ in $\Bbb A^2$ and let $\overline L$ be its projective closure. Then $\overline L$ will be the union of $L$ (the affine part) and $[0:1:0]$ (the point at infinity). How does this fit with the intuition that $\overline L$ should be irreducible?
Let $X,Y,Z$ be projective varieties such that $X = Y \cup Z$ with $Y \cap Z \ne \emptyset$. Let $W = Z \setminus Y$ - a quasi-projective variety. Since $X = Y \cup W$, how does this fit with the expected uniqueness of the decomposition in irreducible components?
If $X = Y \cup Z$ is reducible with $X,Y$ projective, does it follow that $Z$ must be projective too, or can it also be quasi-projective non-projective?
If $X$ is projective, it is irreducible if it cannot be written as a union of two closed subset. Here, all your decompositions are on the form $X = X \backslash Z \sqcup Z$ where $Z \subset X$ is closed. $X \backslash Z$ is not closed so there is no contradiction. For example, $[0,1] = \{0\} \cup (0,1]$ but it is connected because $\{0\}$ is not open.
The uniqueness of decomposition into irreducible component is only true if you take closed component. Else, you can again take $\mathbb A^1 = \mathbb A^1 \backslash \{pt\} \sqcup \{pt\}$ which would contradict the irreducibility of $\mathbb A^1$.
Here is some example of reducible variety : the variety $xy = 0$ in $\mathbb P^2$ (a union of two lines), the variety defined by $x(y^2 - xz)$ (a union of a line and a parabola), and any polynomial $f = gh$ is the union of the variety $g = 0$ and $h=0$. If $g,h$ are non-units and different polynomial you will get a reducible variety. Hope it helps a bit.
Finally, your answer to 3) is yes. If $X$ is projective it is given by equation $f = 0$. Assume for simplicity $Y,Z$ are irreducible : then $f = gh$ with $g = 0$ correspond to $Y$ and $h=0$ corresponds to $Y$. So just $X$ projective and $Y,Z$ closed implies that $Y,Z$ are projective.