Suppose $f \colon I \to \mathbb{R}$ is a function in, say, $L^\infty$, and $I \subset \mathbb{R}$ is a bounded interval. We may assume further regularity on $f$, such as Lipschitz continuity or strict positivity, in case it matters.


Consider all polynomials of $f$, such as $3f^4 - f^2 +2$. These are in $L^2(I)$, since $f$ is (essentially) bounded and $I$ is bounded. Let $P\_f$ be the space of all such polynomials.


**What can one say about the closure of $P\_f$ in $L^2(I)$, that is $\overline{P\_f}^{L^2(I)}$?**


### Examples


1. If $f$ is constant (on a given subset of $I$), then so are all of its polynomials.
2. If $f(x) \equiv x$, then $P\_f$ is the set of all polynomials, which is dense in $L^2(I)$.
3. If $f$ has an inverse that is a polynomial, then it can be reduced to the previous case. Maybe this can be done also with functions whose inverse can approximated by polynomials in a suitable strong sense.


Maybe the level sets of $f$ are the only obstruction for the closure to be all of $L^2$? I would be pleasantly surprised if this was the case.



Closure of polynomials of a function in $L^2$
Let $\sigma(f)$ be the smallest $\sigma$-algebra on $[0,1]$ which makes $f$ measurable. I claim that $\overline{P\_f} = L^2(I, \sigma(f), m)$, the space of all square-integrable $\sigma(f)$-measurable functions. In particular, $P\_f$ is dense iff the completion of $\sigma(f)$ under $m$ contains all the Borel sets (equivalently, all the Lebesgue measurable sets).


One direction is easy: it is clear that $L^2(I, \sigma(f), m)$ is a closed subspace of $L^2(I, \mathcal{B}, m)$ (pass to an a.e.-convergent subsequence). And $P\_f$ is clearly contained in the former, since any Borel function of $f$ remains $\sigma(f)$-measurable. 


For the other direction, we use the multiplicative system theorem. This can be seen as a functional version of the monotone class theorem, or a measurable version of the Stone–Weierstrass theorem.



> 
> **Theorem.** Suppose $H$ is a vector space of real-valued bounded measurable functions on some measurable space $X$, which contains the constants and is closed under bounded pointwise convergence of sequences (i.e. if $f\_n \in H$, $f\_n \to f$ pointwise, and $|f\_n| \le C$ for all $n$, then $f \in H$). Suppose $M \subset H$ is closed under pointwise multiplication, and let $\mathcal{G}$ be the $\sigma$-algebra generated by $M$ (i.e. the smallest $\sigma$-algebra on $X$ that makes all functions from $M$ measurable). Then $H$ contains all bounded $\mathcal{G}$-measurable functions.
> 
> 
> 


You can find this (in a slightly stronger form) in Dellacherie, *Probabilities and Potential*, page 14, or in Janson, *Gaussian Hilbert Spaces*, appendix A. The proof is elementary and makes use of the classical Weierstrass approximation theorem. Dellacherie doesn't give any background, but I've heard the result credited to Dynkin.


Let $M = P\_f$, which is obviously closed under multiplication. 


Let $H = \overline{P\_f} \cap L^\infty$ consist of all bounded measurable functions which are in the $L^2$-closure of $P\_f$. Since $P\_f$, its closure, and $L^\infty$ are all vector spaces, $H$ is a vector space. $H$ contains constants because $P\_f$ did. And if $f\_n \in H$ and $f\_n \to f$ boundedly, then we also have $f\_n \to f$ in $L^2$ by the dominated convergence theorem (using $C$ as the dominating function, since we are in a finite measure space). So $H$ satisfies all hypotheses.


Clearly $\mathcal{G} = \sigma(M) \supset \sigma(f)$, so the theorem asserts that $H$ contains all bounded $\sigma(f)$-measurable functions. Now for any $g \in L^2(I, \sigma(f), m)$, let $g\_n = \max(-n, \min(g, n))$ be a truncation of $g$, which is bounded and still $\sigma(f)$-measurable. Then $g\_n \in H \subset \overline{P\_f}$ and $g\_n \to g$ in $L^2$, so $g \in \overline{P\_f}$.


