Let $t_1 < t_2 < \cdots <t_m$ be real, and $X = \cup_{i=1}^{m-1} (t_i, t_{i+1})$ be a union of real open intervals. Let $f:X \rightarrow \{-1, 1\}$ be any piecewise constant function of form $$ f(x) = \begin{cases} a_1 & \text{ if } t_1 < x < t_2 \\ a_2 & \text{ if }t_2 < x < t_3 \\ \vdots \\ a_{m-2} & \text{ if } t_{m-2} < x < t_{m-1} \\ a_{m-1} & \text{ if } t_{m-1} < x < t_m \end{cases} $$ Where $a_i \in \{-1, 1\}$, and $a_{i} = -a_{i+1}$ for $i = 1, ..., m-1$.
I have a number of questions regarding polynomial approximations of such a function $f$:
- Can we always find a sequence of polynomials $(p_n)_{n=1}^\infty$ so that $(p_n)_{n=1}^\infty$ converge pointwise to $f$, and $|p_n(x) - f(x)| \leq 1$ for all $x \in X$ and $n \in \mathbb{N}$?
- If so, are such polynomials easy to find and construct (i.e. do we have closed form solutions)?
- How quickly do we get convergence?
I am aware that, upon picking a suitable inner product, we can use any collection of orthonormal polynomials to make approximations of functions. For example I know the Chebyshev, Bernstein, Jacobi etc. polynomials can be used to approximate continuous functions on bounded intervals, but I have found no theorem that says we can use these to construct approximations for arbitrary piecewise constant functions like the one given above.
Indeed, it is easy to find a polynomial approximation for the Heaviside Step function for example, however it is unclear how, or if this an be done for more complicated step functions.