Quasi-separatedness is affine-local? [Vakil defines a scheme $X$ to be quasiseparated if the intersection of any two quasicompact opens is quasicompact]
This is part (b) of 7.3.C in Vakil's FOAG: Show that a morphism $\pi$ from a scheme $X$ into a scheme $Y$ is quasiseparated [ For any open affine $Spec(U)\subset Y$, $\pi^{-1}(Spec(U))$ is quasiseparated] if there is a cover of $Y$ by open affine subsets $U_i$ such that $\pi^{-1}(U_i)$ is quasiseparated.
Part (a) is to prove the same thing for quasicompactness and is straightforward. The hint suggests using the affine communication lemma and I can use that to show that for an arbitrary open subset $Spec(A)$ of $Y$, $\pi^{-1}(Spec(A))$ is finite union of quasiseparated open subsets, but that is clearly not sufficient.
Another approach seems to be to reduce the problem to showing that if $Spec(W)$ is an open subset of $\pi^{-1}(U_i)$ and $Spec(V)$ is an open subset of $\pi^{-1}(U_j)$, then $Spec(W)\cap Spec(V)$ is quasicompact. But i'm not even convinced that this is true in general.
Any hints or solutions would be greatly appreciated.
 A: Here is an argument using the ``Affine communication lemma,'' perhaps more along the lines of what Vakil intended. 
We want to show two steps:


*

*If $\pi^{-1}(\text{Spec}(A))$ is quasi-separated and $f \in A$, then $\pi^{-1}(\text{Spec}(A_f))$ is quasi-separated. 

*If $(f_1, \ldots, f_n) = A$ and each $\pi^{-1}(\text{Spec}(A_{f_i}))$ is quasi-separated, then $\pi^{-1}(\text{Spec}(A))$ is quasi-separated. 
Claim 1 is the easier one: an open subset of a quasi-separated scheme is quasi-separated. (Take two quasi-compacts in the open subset and regard them as quasicompacts in the whole space.) 
For 2, suppose $U$ and $V$ are two quasi-compact open subsets of $\pi^{-1}(\text{Spec}(A))$. We can reduce to the case where $U$ and $V$ lie entirely in $\pi^{-1}(\text{Spec}(A_{f_i}))$ and  $\pi^{-1}(\text{Spec}(A_{f_j}))$, since each is covered by finitely many open subsets lying entirely in one of the pre-images. Then 
$$U \cap V = U \cap \pi^{-1}(\text{Spec}(A_{f_i})) \cap V = U \cap V_{\pi^{\#}}(f_i)$$
and $V_{\pi^{\#}}(f_i)$ is affine, so this is quasicompact because $\pi^{-1}(\text{Spec}(A_{f_i}))$ is quasiseparated. 
A: The key to doing all these problems on quasi-separatedness is to use the magic square (defined in the beginning of Ravi's notes). As an example of its power we prove:


Exercise 1: Let $f : X \to Y$ be a quasi-separated morphism of schemes. Then for every open affine $W \subseteq Y$ and open affines $U,V \subseteq X$ that map to $W$, we have that $U \cap V$ can be covered by finitely many affines. 


We have an open immersion $W \hookrightarrow Y$ which means that $U \times_Y V \cong U \times_W V$; essentially this comes because an open immersion in the category of schemes is a monomorphism. The magic square then says that we have a fiber diagram

Then because $\Delta$ is quasi-compact, its pullback $\Delta'$ is quasi compact by stability under base change. Thus $U \times_X V$  is the inverse image  under $\Delta'$ of the affine scheme $U \times_W V$ and thus is quasi-compact. But now $U \times_X V \cong U \cap V$ which completes the exercise. 
Having completed this we can now prove the result you want:


Exercise 2: A morphism of schemes $f : X \to Y$ is quasi-separated iff for any affine open cover $\{U_i\}$ of $Y$, we have that $f|_{f^{-1}(U_i)} : f^{-1}(U_i) \to U_i$ is quasi-separated.


One direction will follow immediately from the fact that quasi-separatedness is stable under base change. For the other direction suppose we have an affine open cover $\{U_i\}$ of $Y$ such that $f|_{f^{-1}(U_i)} : f^{-1}(U_i) \to U_i$ is quasi-compact. We want to show the diagonal $\Delta: X \to X \times_Y X $ is quasi-compact.
Now recall the construction of the fiber product $X \times_Y X$: Since the $U_i$'s cover $Y$, we have that the $f^{-1}(U_i) \times_{U_i} f^{-1}(U_i)$'s cover $X \times_Y X$. Since quasi-compactness is local on the target we are reduced to showing the map$$ \Delta : \Delta^{-1}( f^{-1}(U_i) \times_{U_i} f^{-1}(U_i)) \longrightarrow f^{-1}(U_i) \times_{U_i} f^{-1}(U_i)$$
 is quasi-compact.  By similar reasoning as in Exercise 1, $\Delta^{-1}( f^{-1}(U_i) \times_{U_i} f^{-1}(U_i)) = f^{-1}(U_i)$ and by assumption the diagonal  $f^{-1}(U_i) \to f^{-1}(U_i) \times_{U_i} f^{-1}(U_i)$ is quasi-compact. Thus $\Delta : X \to X \times_Y X$ is quasi-compact as claimed so that $f : X \to Y$ is quasi-separated. 
A: Okay, figured it out using some of the ideas in Matt E's post:
Suppose we have a cover of $Y$ by affine open subsets $Spec(U_{i})$ such that $\pi^{-1}(Spec(U_{i}))$ is quasiseparated. Given an arbitrary open subset $Spec(A)$ of $Y$, we wish to show that $\pi^{-1}(Spec(A))$ is quasiseparated. Using the affine communication lemma (See FOAG), we can find a cover of $Spec(A)$ by distinguished open subsets $D(f_{1}),\ldots,D(f_{n})$ such that $\pi^{-1}(D(f_{i}))$ is quasiseparated. Recall that an equivalent condition for a scheme $W$ to be quasiseparated is that it must be possible to cover the intersection of any two open affine subschemes with finitely many open affine subschemes. So let $Spec(B)$
  and $Spec(C)$
  be two such open subschemes of $\pi^{-1}(Spec(A))$
  and note that the problem is reduced to the following special case: 
$X$
  is the union of two open affine subschemes $Spec(B)$
  and $Spec(C)$
  and $Y=Spec(A)$
 . Let $D(f_{1}),\ldots,D(f_{n})$
  be a finite cover of $Y$
  such that $\pi^{-1}(D(f_{i}))$
  is quasiseparated. We want to show that $X$
  is quasiseperated.
Let $d_{C,i}$
  denote the preimage of $D(f_{i})$
  in $Spec(C)$
  and $d_{B,i}$
  denote the preimage in $Spec(B)$
 . Then the $d_{B,i}$
  and the $d_{C,i}$
  form an affine cover of X
 . Note that $d_{B,i}\cap d_{B,j}$
  is the preimage of $D(f_{i})\cap D(f_{j})=D(f_{i}f_{j})$
  in $Spec(B)$
 , so it is affine. The analogous remark also applies to $d_{C,i}\cap d_{C,j}$
 . Thus it remains to show that $d_{C,i}\cap d_{B,j}$
  can be covered by finitely many affine open subsets: Note that $p\in d_{C,i}\cap d_{B,j}$
  implies $p\in d_{B,i}$
  since we must have $p\in Spec(B)$
  and $\pi(p)\in D(f_{i}),D(f_{j})$
 . Thus $d_{C,i}\cap d_{B,j}=d_{C,i}\cap(d_{B,j}\cap d_{B,i})$
 We know that $d_{B,j}\cap d_{B,i}$
  is a quasicompact (affine, in fact) open subset of $d_{B,i}\cup d_{C,i}$
 , as is $d_{C,i}$
 . Our original assumption tells us that $d_{B,i}\cup d_{C,i}$
  is quasiseperated and it now follows that $d_{C,i}\cap d_{B,j}$
  is quasicompact and can be covered by finitely many affine open sets. Thus, the space X
  is quasiseparated.
