# Regular functions on a product of varieties

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.

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.