TITLE: Dimension of the irreducible components of an affine open in $\mathbb{P}^n_k$.
QUESTION [5 upvotes]: I was doing some exercises in Liu's book on Algebraic Geometry. I am currently trying to solve a problem by showing the following:
Let $U \subset \mathbb{P}^n_k$, k  a field, be an affine open subset.
Show that the irreducible components of $\mathbb{P}^n_k-U$ all have dimension n-1. 
I would appreciate any help / hint here. I have some problems understanding $\mathbb{P }^n_k$ at a deep (even semi-deep) level. I suspect that one could maybe show that the dimension of such an affine open should be of dimension n (or am I wrong here?), since we can compute the dimension of X on any open set. We should be able to write the complement as $V_+(I)$ for some homogenous ideal . However, I don't see how to get from this to that the irreducible components of the component has dimension n-1. 
Thank you for looking at my question and please forgive me if it's a naive one.

REPLY [3 votes]: For the sake of an answer. Cover $\mathbb P^n_k$ (with coordinates $x_0, \dots, x_n$) by affines spaces $U_0, \dots, U_n$ with $U_i=D_+(x_i)$. Then 
$$ \mathbb P^n_k\setminus U=\cup_i (U_i\setminus (U\cap U_i))$$ 
and it is enough to show $U_i\setminus (U\cap U_i)$ is empty or pure of dimension $n-1$ for all $i\le n$. By a previous part of the exercice, we know that $U_i\setminus (U\cap U_i)$ is a principal closed subset of $U_i$, hence it is empty or pure of dimension $n-1$.