# Is the set of all polynomials dense in the set of all continuous functions that maps from a compact set to reals

Let $C$ be a set of all continuous functions that map from a compact set to the reals. Is the set of all polynomials dense in $C$, with respect to the sup metric?

Can I show that by using the Stone-Weierstrauss Theorem? Since I can find a sequence of polynomials that converge uniformly to any continuous function, if I take the closure of the set of polynomials, do I get the entire set of continuous functions?

• No, because Stone-Weierstrass only applies to compact sets. $e^x$ is not uniformly approximable by polynomials. – user296602 Dec 7 '17 at 17:17
• Dense with respect to which topology? – José Carlos Santos Dec 7 '17 at 17:18
• @user296602 ... which is not a metric on the set of continuous functions, by the way. – user228113 Dec 7 '17 at 17:24
• @G.Sassatelli Is that why I need compactness? – tryingtosolve Dec 7 '17 at 17:26
• Updated the question again. – tryingtosolve Dec 7 '17 at 17:32