Let $k$ be an algebraically closed field and let $X$, $Y$ be varieties over $k$. 
Let us denote by $\mathcal{O}(X)$ and $\mathcal{O}(Y)$ the $k$-algebra of regular functions on $X$ and $Y$ respectively. There
exists a natural homomorphism of $k$-algebras:
$$
 \theta \colon \mathcal{O}(X) \otimes\_k \mathcal{O}(Y) \to \mathcal{O}(X \times Y) \, , \quad f \otimes g \mapsto 
\left( (x,y) \mapsto f(x)g(y) \right) \, .
$$
It is well-known, that $\theta$ is an isomorphism in case $X$ and $Y$ are affine. Is it true that $\theta$ is an isomorphism if $X$ and $Y$ are just quasi-affine (i.e. not necessarily affine)?
Is this true for arbitrary varieties $X$ and $Y$? Any proof or counter-example or any reference to a text book would be perfect.



Regular functions on a product of varieties
This is true for $X$ and $Y$ any quasi-compact quasi-separated schemes over any field $k$. Consider a finite open cover $\{Y\_i\}$ of $Y$ with quasi-compact $Y\_i$, so the overlaps $Y\_{ij} = Y\_i \cap Y\_j$ are quasi-compact since $Y$ is quasi-separated. Then we have an evident left-exact sequence of $k$-vector spaces
$$0 \rightarrow O(Y) \rightarrow \prod\_i O(Y\_i) \rightarrow \prod\_{ij} O(Y\_{ij}).$$
Since tensor product passes through *finite* direct products, tensoring by $O(X)$ gives a left-exact sequence
$$0 \rightarrow O(X) \otimes\_k O(Y) \rightarrow \prod\_i (O(X) \otimes\_k O(Y\_i)) \rightarrow \prod\_{ij} (O(X) \otimes\_k O(Y\_{ij}))$$
that is easily seen to be compatible (via the comparison maps of interest) with the left-exact sequence
$$0 \rightarrow O(X \times Y) \rightarrow \prod\_i O(X \times Y\_i) \rightarrow \prod\_{ij} O(X \times Y\_{ij})$$
attached to the quasi-compact open cover $\{X \times Y\_i\}$ of $X \times Y$ (whose overlaps are the $X \times Y\_{ij}$).


In this way, we see that the isomorphism problem for $(X, Y)$ reduces to the cases of each $(X, Y\_i)$ and $(X, Y\_{ij})$. Hence, if $X$ and $Y$ are separated then *without changing $X$* we can reduce to the case of affine $Y$ (all $Y\_{ij}$ are affine when all $Y\_i$ are so, provided $Y$ is separated) and then likewise *without changing $Y$* (that is now affine) we can reduce to $X$ also being affine. But the case of $X$ and $Y$ both affine is clear, so this settles the general case when $X$ and $Y$ are separated (and quasi-compact).


Now for qcqs $X$ and $Y$ we can run through the exact same formal game upon replacing "affine open" with "quasi-compact separated open" everywhere (the latter class of opens is stable under finite intersection inside any qcqs scheme!), so just as we bootstrapped from the affine case to the quasi-compact & separated case we can bootstrap from the settled quasi-compact & separated case to the qcqs case.


The only role of $k$ being a field was to ensure that $O(X)$ is $k$-flat. 


