The most primitive formulation of the Stone-Weiestrass theorem states that any continuous functions, $f(x)$, defined on $[0, 1]$ can be uniformly approximated by a polynomial, $p(x)$, to an arbitrary precision. Basically, for any given function, we can design a sequence of polynomials, $p_n(x)$, of degree $n \rightarrow \infty$ that converges to $f(x)$ in the supremum norm.

My (potentially naive) confusion is about the definition of *polynomial* in this context. The theorem talks about a sequence of subspaces of polynomials, $\mathcal{P}_n \subset \mathcal{C}[0, 1]$, from which $p_n$'s are selected. Hence, I would like to know:

How is $\mathcal{P}_n$ defined? Is it just a subspace spanned by $1, x, x^2, \dots, x^{n-1}$? How about other types of polynomials in different bases, such as Fourier and Chebyshev polynomials? Do the spans of the first $n$ elements in these bases correspond to the span in the monomial basis?

Can we say something about convergence rates for polynomials in different bases? Is there a general technique to derive the rate of convergence (with respect to supremum norm)? [Probably, this is beyond the Stone-Weierstrass result.]

**EDIT:**

As @NateEldredge points out, the theorem does not require elements of the sequence, $p_n$, to correspond to subspaces $\mathcal{P}_n$. Though, the constructive proof uses a sequence of Bernstein polynomials, $B_n(x)$, that actually correspond to a sequence of subspaces, $\mathcal{P}_n$.

To reformulate my Q1, how can we re-express each element of the Bernstein sequence that approximates $f(x)$ in a different basis (e.g., Fourier or Chebyshev) and how would it look like? Are Bernstein polynomials of finite rank in the Fourier/Chebyshev basis?

The second question is still open. I would appreciate any references to the literature.