# Polynomial approximation of continuous function with constraints

Consider the closed convex subset $$\mathcal{F} = \{f \in C[0,1] : 0 \leq f \leq 1, f(0)=0, f(1)=1\}$$. Consider the polynomial class $$\mathcal{P} = \{p \text{ is a polynomial} : p(0)=0, p(1)=1, 0 \leq p \leq 1\}$$. Is $$\mathcal{P}$$ dense in $$\mathcal{F}$$ in the sup norm?

Is anything known about Weierstrass theorem generalized as above to handle constraints? Or is there a counterexample?

Indeed, $$\mathcal{P}$$ is dense in $$\mathcal{F}$$. The Bernstein polynomials approximating $$f\in\mathcal{F}$$ belong to $$\mathcal{P}$$, see Theorem 11.68 in:
• The answer is fitting, but perhaps does not fully address the $0\leq p\leq1$ constraint. So I would add that the reason that $p$ lies within the same bounds as $f$ can be most clearly seen via De Casteljau's construction of the corresponding polynomial approximation (convex hull property of Bezier curves). – Iiro Ullin May 18 at 23:50
• @IiroUllin It does. If $0\leq f\leq 1$, then the Bernstein polynomials satisfy the same estimate. $p\geq 0$ is obvious, because all terms in the definition of $p$ are nonnegative and then replacing $f(k/n)$ by the upper bound of $1$ you get the binomial formula for $((1-x)+x)^n$ which equals $1$ which is the upper bound for $p$. If I find time, I will add details. – Piotr Hajlasz May 19 at 0:25