I'm trying to prove the extension of Stone–Weierstrass for trigonometric polynomials to more than 1 dimension, but I'm unable to complete it. Here's the exact statement I am trying to prove:
Let $f:\mathbb{R^k} \to \mathbb{R}$ continuous and $n \in \mathbb{Z}^k$ periodic (i.e. $f(x)=f(x+n) $ for all $ x\in \mathbb{R^k}$ and $n \in \mathbb{Z^k}$. Prove that the set $B:= \bigg\{\sum_{n \in I \subseteq \mathbb{Z^k}} a_n \cos(2 \pi \langle x, n \rangle)+b_n \sin(2 \pi \langle x, n \rangle) \mid a_n, b_n \in \mathbb{R}, I \text{ finite}\bigg\}$ is dense in $C_\mathbb{R}^{per}(\mathbb{R^k})$ (continuous periodic functions from $\mathbb{R^k}$ to $\mathbb{R}$).
So the idea I went for is to use the following tools:
We have previously proven that the algebra $A:=\bigg\{\sum_{n=0}^N a_n \cos(2 \pi xn)+b_n \sin(2 \pi xn) \mid a_n, b_n \in \mathbb{R}, N \in \mathbb{N} \bigg\}$ is dense in $C_\mathbb{R}^{per}(\mathbb{R})$ (continuous periodic functions from $\mathbb{R}$ to $\mathbb{R}$) using a bijection, which is also an isometry, from the unit circle (to which we can apply Stone–Weierstrass, see here) to $\mathbb{R}$.
I have proven that, given two Hausorff and compact topological spaces, $X$ and $Y$, if we define $A_{X \times Y}:=\text{span}_{\mathbb{R}}\{f(x)g(y) \mid f\in A_X, g\in A_Y\}$, where $X\times Y$ is the product topology, then $A_{X\times Y}$ is also an algebra and it is dense in $C_{\mathbb{R}}(X\times Y)$.
For $k=2$ (for simplicity), I took $A_{X\times Y}$ with $A_X$ and $A_Y$ to be precisely like $A$, and the bijection from the unit circle is now defined as $\Phi:= C_{\mathbb{R}}(S^1\times S^1)\to C_{\mathbb{R}}^{per}(\mathbb{R}^2)$. I am able to prove that $\Phi$ is also a bijection, an isometry, separates points etc. From here it's identical to the $\mathbb{R}$ case (1-dimension), except that I still need to show that $A_{X\times Y} = B$. This is the part I cannot seem to accomplish.
Assuming my method is correct, how can I prove that $A_{X\times Y} = B$?