Show that polynomials $P(x,y)=p(x)q(y)$ are dense in $C([0,1]^2,\mathbb{R})$ (i.e. the set of continous functions in two variables).
My attempt:
Based on inspiration from Multivariate Weierstrass theorem?
$M=[0,1]\times[0,1]$, $A=\{p:[0,1]\times[0,1] \rightarrow \mathbb{R}, \text{p are polynomials}\}$
Since $M$ is a compact metric space and $A\subset C([0,1]^2,\mathbb{R})$ is a function algebra that separates points and that vanishes nowehere, then by Stone-Weirestrass, $A$ is dense in $C([0,1]^2,\mathbb{R})$.
That A is closed under addition, multiplication, and scalar multiplication is clear. To show that it separates points, take $(r_1,r_2),(s_1,s_2) \in M $ not equal. Then $P(x,y)=xy$ separates points. The $P(x,y)=1$ vanishes nowhere.
I think that this is a correct proof of the statement.
However, I also think that there is a way of using only the Weirestrass approximation theorem since the special structure of the polynomials are $P(x,y)=p(x)q(y)$. Following Rudin, how would you in that case choose the polynomials that in one variable looks like $Q_n(x)=c_n(1-x^2)^n$,?