Concentrated schemes are closed under finite gluings Let $X$ be a scheme. Assume that $X = \cup_i X_i$ is finite open covering, such that the $X_i$ as well as their intersections $X_i \cap X_j$ are concentrated, i.e. quasi-compact and quasi-separated (see Daniel Murfet's notes on concentrated schemes as well as EGA IV.1). Does it follow that $X$ is concentrated? I'm almost embarrassed to ask this question.
Clearly $X$ is quasi-compact, as a finite union of quasi-compact subspaces. In order to show that $X$ is quasi-separated, it suffices to show that for open affines $U \subseteq X_i$ and $V \subseteq X_j$ their intersection $U \cap V$ is quasi-compact. Well this is clear for $i=j$ since $X_i$ is quasi-separated. But what happens for $i \neq j$? Somehow we have to use that $X_i \cap X_j$ is quasi-compact.
Here is a more abstract idea: We have to show that $\Delta : X \to X \times X$ is a quasi-compact morphism. This can be checked locally on the base, hence it suffices to prove that the morphisms $X_i \cap X_j \to X_i \times X_j$ are quasi-compact. Well, $X_i \cap X_j$ is quasi-compact, hence by (EGA IV, 1.1.2 (v)) it would suffice that $X_i \times X_j$ is separated. But we don't assume that the $X_i$ are separated, they are just quasi-separated.
Note that actually EGA IV.1.2.7.c proves the claim, but I don't understand the proof. Here is my translation: "We know that in order to prove that $\Delta : X \to X \times X$ is quasi-compact, it suffices to prove that the inverse images $X_i \cap X_j$ of the $X_i \times X_j$ are quasi-compact (1.1.1)". Here, (1.1.1) is just the definition of a quasi-compact morphisms, after which it is remarked that it suffices to prove this with respect to an affine(!) open covering. But here, we just have an open covering consisting of quasi-compact schemes. This seems to be a gap?
Or does the following statement hold (which we could then apply to $\Delta$)? If $f : X \to Y$ is a morphism and $Y$ is covered by quasi-compact open subsets $Y_i$ such that each $f^{-1}(Y_i)$ is quasi-compact, then $f$ is quasi-compact. I doubt that this is true without any assumption on $Y$.
Edit. Sorry I think now I can answer my question. The treatment of quasi-compact morphisms is better in EGA I (1970), §6. Specifically, in order to show that $X_i \cap X_j \to X_i \times X_j$ is quasi-compact, it suffices that $X_i \cap X_j$ is quasi-compact and $X_i \times X_j$ is quasi-separated by Prop. 6.1.5. (v), and we have both. Note that EGA VI.1.2.7 is reproduced as EGA I.6.1.12, but still the end just refers to the definition of quasi-compact morphisms, which doesn't seem to suffice?
So what about a more direct proof, showing directly that (with the notation above) $U \cap V$ is quasi-compact? One can spell out the proof above as follows (still quite tricky):
$X_i \cap X_j \to (X_i \cap X_j) \times (X_i \times X_j)$ is a base change of the diagonal of $X_i \times X_j$, which is quasi-compact, hence it is also quasi-compact. Since $U \cap V$ is the preimage of the quasi-compact open subscheme $(X_i \cap X_j) \times (U \times V)$, it is quasi-compact.
(Usually I delete a question when I solve it quickly before an answer arrives, but this time I won't because it has already some upvotes and therefore seems to be interesting for others, too. Besides, I would like to know if you also agree that the EGA proof has a gap.)
 A: The problem is roughly the result in the picture below from EGA I.6.1.12 p.296 (Springer 1971).

I claim that the condition d) is not sufficient to imply a) (so EGA I.6.1.12 is not correct as stated). As a counterexample, let take $X$ to be the infinite dimensional affine space over a field with double origin, as Exercise 10.11 in Algebraic geometry I by Görtz-Wedhorn:and we take all $U_{\alpha}$ to be the quasi-compact scheme $X$ itself, then d) holds but a) does not. See also a comment in [Görtz-Wedhorn, Remark 10.2 (4)] for a related issue on quasi-compactness.
A: It was pointed out by Lao-tzu that EGA I.6.1.12 is wrong, but that the answer to my question is "yes" nevertheless, and that the proof appeared at https://mathoverflow.net/questions/157199. Here is the proof in my own words:
It suffices to prove this for the case $X = X_1 \cup X_2$, the general case follows by induction. So let $X = X_1 \cup X_2$ with $X_1,X_2, X_1 \cap X_2$ qcqs. We need to show that $X$ is qcqs. Clearly, $X$ is qc. Now $X_1$ is covered by affine opens $U_i$, and $X_2$ is covered by affine opens $V_j$, and it suffices to prove that their intersections are qc. Each intersection $U_i \cap U_{i'}$ is qc since $X_1$ is qs, similarly $V_j \cap V_{j'}$ is qc since $X_2$ is qs. It remains to show that each $U_i \cap V_j$ is qc. But this is an open subscheme of $X_1 \cap X_2$, and it can be written as the intersection $(U_i \cap X_2) \cap (X_1 \cap V_j)$ of two qc subschemes of $X_1 \cap X_2$, which is therefore also qc since $X_1 \cap X_2$ is assumed to be qs; notice here that $U_i \cap X_2$ (similarly for $X_1 \cap V_j$) is in fact qc because it is the preimage of $U_i$ under the qcqs morphism $X_1 \cap X_2 \to X_1$.
A: So you don't want to choose the $X_i$ to be affine from the beginning? Maybe that's a work around for your last question if you assume $Y$ to be quasi-compact.
Let $f \colon X \to Y$ be a morphism and $Y = \bigcup_{i \in I} Y_i$ with $Y_i$ quasi-compact and $I$ finite. Let $Y_i = \bigcup_{j \in J} Z_j^{(i)}$ where  the $Z_j^{(i)}$ are affine and $J = J(i)$ can be chosen to be finite. Since
$$ f^{-1}(Y_i) = f^{-1} \Bigl( \bigcup_j Z_j^{(i)} \Bigr) = \bigcup_j f^{-1}(Z_j^{(i)}) $$
you get that
$$
X = f^{-1} \Bigl( \bigcup_i Y_i \Bigr) = \bigcup_i f^{-1}(Y_i) = \bigcup_i \bigcup_j f^{-1} (Z_j^{i}) $$
Now stack the project (Tag 01K4) tells us that it is enough to find some cover by open affines to check that $f$ is quasi-compact.
