If $X$ and $Y$ are two compact spaces and view $X\times Y$ as a metric space with metric $d((x,y),(x',y'))=\sqrt{dx(x,x')^2+dy(y,y')^2}$, $f \colon X \times Y \to \Bbb R$ is a continuous function, then for every $\epsilon > 0$ there exist $n > 0$ and continuous functions $f_1,\dots, f_n$ on $X$ and continuous functions $g_1, \dots, g_n$ on $Y$ such that $\|f − ∑ f_i g_i\| < \epsilon$.
Do I first need to prove that $X\times Y$ is also a compact metric space? how can I do this from the given metric?
And is stone-weierstrass only suitable for one variable, how can I apply it for two variables $x$ and $y$?
Show that $A$ satisfies the conditions of the Stone-Weirstrass theorem:
$A$ contains the constants.
$A$ separates points.