Let $X$ be a scheme. Does there exist an open immersion $X\rightarrow Y$ with $Y$ quasi-compact?



Quasi-compactifying schemes
Here are two types of counterexamples. They are all locally of finite type over a fixed field $k$. They rely on the following trivial fact: If $X$ is a subscheme of $Y$ and $Y$ is covered by $n$ open affines, then $X$ (and of course every subscheme of $X$) is covered by $n$ open subschemes which are embeddable in affine schemes, in particular separated. 


1. **Nonseparated examples:**  

For each set I, let $(L\_i)\_{i\in I}$ be a family of copies of (say) the affine $k$-line, with $l\_i$:= the origin of $L\_i$ and $U\_i:=L\_i\smallsetminus\{l\_i\}$. Let $X\_I$ be obtained by gluing all the $L\_i$'s along the $U\_i$'s. A separated open subscheme of $X\_I$ cannot contain more than one of the $l\_i$'s. So if $I$ is infinite, $X\_I$ has no finite cover by separated opens.  

The above example is not quasiseparated, but a quasiseparated variant is $X=\coprod\_{n≥1}X\_{\{1,...,n\}}$.
2. **A separated example:** just take $X=\coprod\_{n≥0}\mathbb{P}^n\_k$.  

Indeed, if $U\subset\mathbb{P}^n\_k$ is embeddable in an affine scheme (i.e. $U$ is quasiaffine, since it is quasicompact) then its complement in $\mathbb{P}^n\_k$ contains a hypersurface: otherwise we would have $H^0(U,\mathscr{O}\_U)=k$ or $0$. Thus, if $\mathbb{P}^n\_k$ is covered by $N$ quasiaffine opens we must have $N≥n+1$ since the intersection of $≤N$ hypersurfaces is nonempty.


**EDIT** prompted by @schematic\_boi's comment: 


3. **An irreducible and separated example:** This comes from Qing Liu's answer to [this question](https://mathoverflow.net/q/34620). Start with the affine line $L=\mathrm{Spec}(k[t])$ over $k$. For each closed point $x\in L$, put $L\_x:=\mathrm{Spec}(\mathscr{O}\_{L,x})$. For each set $S$ of closed points, let $X\_S$ be the scheme obtained by gluing all schemes $L\_x$ ($x\in S$) at their common generic point $\eta$ (this is a scheme because $\{\eta\}$ is open in each $L\_x$). As Liu observes, this is an irreducible separated scheme. Let us also observe that $\Gamma(X\_S,\mathscr{O}\_{X\_S})=:R\_S\subset k(t)$ is the ring of rational functions defined at each $x\in S$. Also, if $T\subset S$ there is a natural open immersion $X\_T\hookrightarrow X\_S$; in particular (for $T=\emptyset$) $\{\eta\}$ is open in $X\_S$.  

Now assume $S$ infinite (e.g. all closed points, for infinite $k$). Assume there is an open immersion $j:X\_S\to Y$ where $Y$ is quasicompact. Taking a finite affine covering of $Y$, we see that for some infinite subset $T$ of $S$, $j(X\_T)$ is contained in an affine open subset. Replacing $S$ with $T$, we may assume $Y=\mathrm{Spec}(A)$ affine. Since $\{j(\eta)\}$ is open in $Y$, there is $f\in A$ such that $j(\eta)\in D(f)\subset\{j(\eta)\}$ and therefore $f$ vanishes at each closed point of $X\_S$. In other words, the image of $f$ in $R\_S\subset k(t)$ vanishes at infinitely many closed points but not at $\eta$, which is absurd.


