Let $k$ be an algebraically closed field. Let $P\subset \mathbb{P}^n(k)$ be a projective variety, and $X\subset P$ be a subset.
Suppose that $X_i = X\cap U_i$ is an affine closed subset for every affine open $U_i$ of $\mathbb{P}^n$, i.e. that for every $i$ we have a polynomial $\;f_i \in A(U_i \cap P)$ such that $X_i = \mathcal{Z}(f_i)$.
Is it always true that, then, $X$ is a closed subspace of $P$ ? Or do we need some extra conditions?
Thanks to Jared for his suggestion! Below there's a possible easy proof of the following fact (notice there's a slight difference: in my claim $U_i\cap X$ is closed in $U_i$, not in $X$. This is what I need to answer the above question) :
Proof:
Since $X_i = U_i\cap X$ is closed in $U_i$, we have that $U_i \setminus X_i$ is open for every $i$. Then we find that $$ P\setminus X = \bigcup_i \left( U_i \setminus (\cup_j X_j)\right) = \bigcup_i U_i \setminus X_i $$ is open being a union of the open sets $U_i \setminus X_i$. Therefore $X$ is closed in $P$.
Hence the answer to the above question is: yes, under those assumptions $X\subset P$ is a closed set.