TITLE: Product of two algebraic varieties is affine... are the two varieties affine?
QUESTION [11 upvotes]: Let $X_1$ and $X_2$ two algebraic varieties such that their product $X_1\times X_2$ is affine. Are $X_1$ and $X_2$ affine then?
If this is not true, could you give a counterexample?

REPLY [9 votes]: I'll assume you are in the classical context of varieties over an algebraically closed field.
If $a_2\in X_2$  is an arbitrary point, the subvariety $X_1\times \{a_2\}\subset X_1\times X_2$ is closed in the affine variety $X_1\times X_2$ and is thus  affine.
Since $X_1$ is isomorphic to $X_1\times \{a_2\}$, $X_1$ is affine too.