# Quasicompactness in terms of morphisms and $\operatorname{Spec} \mathbb{Z}$

In The Rising Sea, Vakil states the following right before exercise 8.3.B (p. 231):

Following Grothendieck’s philosophy of thinking that the important notions are properties of morphisms, not of objects, we can restate the definition of quasicompact (resp. quasiseparated) scheme as a scheme that is quasicompact (resp. quasiseparated) over the final object $$\operatorname{Spec}\mathbb{Z}$$ in the category of schemes.

It is clear to me that if $$X\to \operatorname{Spec}\mathbb{Z}$$ is quasicompact (resp. quasiseparated), then X is quasicompact (resp. quasiseparated), since $$\operatorname{Spec}\mathbb{Z}$$ is affine. It is also clear that if $$X$$ is quasiseparated, then the morphism is quasiseparated, since every open subscheme of a quasiseparated scheme is also quasiseparated.

The problem is that I am not sure how to verify that if $$X$$ is quasicompact, then the morphism $$X\to \operatorname{Spec}\mathbb{Z}$$ is quasicompact. This is clear if $$X$$ is noetherian, but I can't see why it holds in general.

Related question that may be useful to solve my problem: how does $$\operatorname{Spec}\mathbb{Z}$$ behave? Is it true that every open subscheme of this scheme is affine? Is every affine open subscheme of the form $$\operatorname{Spec}\mathbb{Z}_f$$?

Lemma (Stacks 01K4). Let $$f:X\to S$$ be a morphism of schemes. The following are equivalent:
1. $$f$$ is quasi-compact,
3. there exists some affine open covering $$S=\bigcup_{i\in I} U_i$$ such that $$f^{-1}(U_i)$$ is quasi-compact for all $$i$$.
Proof. It's the standard strategy for this type of claim ("you can find one cover verifying the property" is equivalent to "all covers must verify the property"), see link for full details. $$\blacksquare$$
What this means is that if $$f:X\to S$$ is a morphism of schemes with affine target, $$X$$ is quasi-compact iff $$f$$ is.
As for your related question about $$\operatorname{Spec} \Bbb Z$$, everything you ask for is true, and this is because $$\Bbb Z$$ is a PID.