Uniformly approximating a function and its derivative using polynomials I'm struggling either proving or disproving the following statement:

Let $K\subset \mathbb{R}$ be compact, and $S = \mathrm{span}\{p_k, k = 0, 1, \ldots\}$, where $p_k$'s are polynomials over $K$. If $S$ is dense in $C^1(K)$ with respect to sup-norm, then for any $f\in C^1(K)$, there exists $\{g_n\} \subset S$ such that $g_n$ uniformly approximates $f$ with $f'$ uniformly approximated by $g_n'$.

This statement seems to be true, although $S$ is only a subset of all polynomials over $K$. If the statement appears false, is there any prior assumption that makes it true? Any reference or direct answer would greatly help me.
 A: The span of $\{x^{2k}\colon k=0,1,2,\dots\}$ is dense in $C([0,1])$. But all their derivatives vanish at $0$.
A: [Update: As Pietro Majer pointed out in the comments, the following does not answer the OP's question, but a variant in which $S=\{p_1,p_2,\ldots\}$ instead of $S=\operatorname{span}(\{p_1,p_2,\ldots\})$.]
Not necessarily.
For simplicity, let $K=[0,1]$.
Let $T_0=\{u_1,u_2,\ldots\}$ be a countable dense set in $C(K)$ whose elements are differentiable, say the set of polynomials with rational coefficients.  For each $n$, let
\begin{align*}
   v_n(x) &:= u_n + \frac{1}{n}\sin(\beta(n)x) \;.
\end{align*}
for some function $\beta:\mathbb{N}\to\mathbb{R}$ that grows rapidly to $\infty$.
Note that

*

*$T_1:=\{v_1,v_2,\ldots\}$ is still a countable dense set in $C(K)$;

*Each $v_n$ is differentiable;

*Assuming $\beta$ grows fast enough, $\|v'_n\|\to\infty$ as $n\to\infty$.

Finally, for each $n$, let $p_n$ be a polynomial such that $\|p_n-v_n\|<2^{-n}$ and $\|p'_n-v'_n\|<2^{-n}$.  Let $S:=\{p_1,p_2,\ldots\}$.
Now, clearly $S$ is dense in $C(K)$, but $S':=\{p'_1,p'_2,\ldots\}$ cannot be dense in $C(K)$ because $\|p'_n\|\to\infty$ as $n\to\infty$.
A: Any prior assumption that makes it true. A   simple case where your statement is true is the case of   an interval $K\subset\mathbb{R}_+ $, and $(p_k)_{k\ge0}$ are monomials, $p_k(x)=x^{n_k}$, of degrees $0=n_0<n_1<\dots$. For in this case,   by the Müntz-Szász Theorem,  the  $(p_k)_{k\ge0}$ span a dense subspace in $C^0(I)$, if and only if their derivatives $(p'_k)_{k\ge0}$ do (this of course because $\sum_{k=1}^\infty\frac{1}{n_k}=+\infty$ if and only if $\sum_{k=2}^\infty\frac{1}{n_k-1}=+\infty$).
If by the assumption $S$ is uniformly dense in $C^1(I)$, it is also uniformly dense in $C^0(I)$, therefore the span of the $(p'_k)_{k\ge0}$ is also uniformly dense in $C^0(I)$. Hence, for any $f\in C^1(K)$ there is a sequence $g_n\in S$ such that $g_n'$ converges uniformly to $f'$; since $S$ contains the constants, we can assume $g_n$ converges to $g$ at least on a pont of $K$, but then also $g_n$ converges uniformly to $f $ by the theorem of limit under the sign of derivative.
