# Function in $\mathcal{C}(X\times Y)$ can be “approximated” by sum of finite number of functions of the form $g(x)h(y)$

Let $X,Y$ be compact spaces

if $f \in \mathcal C(X \times Y)$ and $\varepsilon > 0$ then $\exists g_1,\dots , g_n \in \mathcal C(X)$ and $\exists h_1, \dots , h_n \in\mathcal C(Y)$ such that $|f(x,y)- \sum_{k=1}^n g_k(x)h_k(y)| < \varepsilon$ for all $(x,y) \in X \times Y$.

Attempt at the solution:

$X,Y$ are compact which means that for all open covers of $X,Y$, there exists finite subcover.

So, I have been trying to think of a way to pick for all $x_0 \in X$ and $y_0 \in Y$, a function $g_{x_0} \in\mathcal C(X)$ and $h_{y_0} \in\mathcal C(Y)$ such that $f(x_0,y_0) = g_{x_0}(x_0)h_{y_0}(y_0)$ because then there exists an open subset $U_{x_0,y_0}$ of $X \times Y$ such that $|f(x,y) - g_{x_0}(x)h_{y_0}(y)| < \varepsilon$ for all $(x,y) \in U_{x_0,y_0}$. Then by combining all these open subsets, we can form an open cover of $X,Y$ and so there is a finite subcover, $U_1,\dots , U_n$.

But I don't know how I can combine these open sets to get my functions $g_1,\dots ,g_n,h_1, \dots , h_n$ such that $|f(x,y)- \sum _{k=1}^n g_k(x)h_k(y)| < \varepsilon$ for all $(x,y) \in X \times Y$.

I feel like I almost have it :(

-
Are you allowed to invoke Stone-Weierstrass? – Qiaochu Yuan May 21 '12 at 19:23
This question is at the end of the chapter on Stone-Weierstrass theorem, but I don't know how I can use that theorem in this proof. – Euthenia May 21 '12 at 19:30
Well, "use Stone-Weierstrass" is already a pretty big hint, so I think I'll leave it at that. – Qiaochu Yuan May 21 '12 at 19:31
Here is another hint: what if $X, Y = \mathbb{R}$ - can you solve the problem in this case, using the S.-W. theorem? Now think how you can reduce the general problem to this case (hint: for a fixed $y\in Y$, look at the range of $f(x,y)$ in $\mathbb{R}$ as you vary $x$; that is, look at $f(X,y)$. This set is compact. Do the same for fixed $x\in X$ and variable $y$. Don't forget about compactness of $X$ and $Y$ and continuity of $f$--so you'll only need to look at finitely many fixed $y\in Y$ and $x\in X$) – William May 21 '12 at 20:28
By the way, $n$ depends on $\epsilon$ and is related to the degree of a certain approximating polynomial (once you reduce everything to the $\mathbb{R}^2$ case). – William May 21 '12 at 20:35

We apply Stone-Weierstass theorem to the algebra $$\mathcal A:=\{(x,y)\mapsto \sum_{j=1}^nf_j(x)g_j(y), n\in \Bbb N,f_j\in C(X),g_j\in C(Y)\}\subset C(X\times Y).$$ This algebra
• is non-vanishing everywhere: given $(x,y)\in X\times Y$, we can find an element $F$ of $\mathcal A$ such that $F(x,y)\neq 0$, namely $F(x,y)=:1$.
• separates points: take $(x_1,y_1)\neq (x_2,y_2)$. If $x_1\neq x_2$, use the fact that $C(X)$ separates points (take $f(x)=d(x,x_1)$) and use the same idea if $x_1\neq x_2$.