# The Unapologetic Mathematician

## Composing Real-Valued Measurable Functions II

As promised, today we come up with an example of a measurable function $f:X\to\mathbb{R}$ and a Lebesgue measurable function $\phi:\mathbb{R}\to\mathbb{R}$ so that the composition $(\phi\circ f):X\to\mathbb{R}$ is not measurable. Specifically, $(X,\mathcal{S})$ will be the closed unit interval $\left[0,1\right]$, considered as a measurable subspace of $(\mathbb{R},\mathcal{L})$.

Now, every point $x\in\left[0,1\right]$ can be written out in ternary as

$\displaystyle x=\sum\limits_{i=1}^\infty\frac{\alpha_i}{3^i}=.\alpha_1\alpha_2\alpha_3\dots$

We set $n$ (depending on $x$) to be the first index for which $\alpha_n=1$, and $n=\infty$ if no such index exists. Then we define the function

$\displaystyle\psi(x)\sum\limits_{1\leq i

That is, write out the number in ternary until you hit a $1$, and leave off everything after that. Change all the $2$s to $1$s, and consider the resulting string of $0$s and $1$s as a number written out in binary. The extra fraction added in the formula above comes from that first $\alpha_n=1$. This function is often called the “Cantor function” because of its relationship to the famous Cantor set. In case it’s not apparent, the Cantor set is the collection $C$ of points with no $\alpha_n=1$.

First of all, $\psi$ is increasing from $0$ to $1$. Clearly $0=.000\dots$, so $\psi(0)=0$; and $1=.222\dots$ so $\psi(1)=1$. Given points $x=.\alpha_1\alpha_2\alpha_3\dots$ and $y=.\beta_1\beta_2\beta_3\dots$, if $x then $\alpha_i=\beta_i$ for $1\leq i and $\alpha_j<\beta_j$. If $\alpha_j=0$ and $\beta_j=1$ or $\beta_j=2$, then as we write out $\psi(y)$ in binary the $j$th bit is $1$, while the $j$th bit of $\psi(x)$ is $0$ and so $\psi(x)<\psi(y)$. On the other hand, if $\alpha_j=1$ and $\beta_j=2$, then the $j$th bit of both $\psi(x)$ and $\psi(y)$ is $1$, but $\psi(x)$ stops at that point while $\psi(y)$ has at least one more bit equal to $1$. And so again $\psi(x)<\psi(y)$.

Maybe more surprising is the fact that $\psi$ is actually continuous! If again we have $x=.\alpha_1\alpha_2\alpha_3\dots$ and $y=.\beta_1\beta_2\beta_3\dots$ and $\alpha_i=\beta_i$ for $1\leq i, then we find

$\displaystyle\left\lvert\psi(y)-\psi(x)\right\rvert\leq\frac{1}{2^{j-1}}$

Thus, given an $\epsilon>0$ we can find a large enough $j$ so that $\frac{1}{2^{j-1}}<\epsilon$. Then we can pick a small enough $\delta$ so that two numbers differing by less than $\delta$ will agree to the first $j$ places in their ternary expansions, and so $\psi$ is continuous.

Unfortunately, $\psi$ might not be strictly increasing. Indeed, on any stretch of $x\in X\setminus C$, the function $\psi$ is actually constant! It’s interesting to note that $\psi$ manages to increase continuously from $0$ to $1$ while remaining constant almost everywhere. But still we’re going to need a strictly increasing function for our purposes. We get this by considering $y\mapsto\frac{1}{2}(y+\psi(y))$. This still increases continuously from $0$ to $1$, but now it’s strictly increasing.

But as a strictly increasing continuous function from $[0,1]$ to itself, it has a strictly increasing continuous inverse. That is, there is a strictly increasing continuous function $f$ such that $y=f(x)$ if and only if $x=\frac{1}{2}(y+\psi(y))$. And since it’s continuous, it’s Borel measurable, and any Borel measurable function is Lebesgue measurable.

Now, the set $f^{-1}(C)$ is Lebesgue measurable and has positive measure. This is the collection of points of the form $\frac{1}{2}(y+\psi(y))$ for $y\in C$. To get at this, first we consider the collection $\psi(X-C)$. It’s pretty straightforward to see that this consists of all terminating binary expansions, which are exactly the rational numbers. But this is a countable set, and countable sets have Lebesgue measure zero. Consequently, we find that $\mu(f^{-1}(X-C))=\frac{1}{2}$. Since $\mu(f^{-1}(X))=1$, there must be some positive measure in $f^{-1}(C)$ in order to make up the difference.

But now we can take a thick, non-Lebesgue measurable set whose intersection with $f^{-1}(C)$ is itself a non-Lebesgue measurable set $S$. However, $f(S)=M\subseteq C$, and $C$ has Lebesgue measure zero. Since every subset of a set of Lebesgue measure zero is itself Lebesgue measurable (by completeness), $M$ must be Lebesgue measurable, even though $f^{-1}(M)=S$ is not. This is not a problem because we only ever asked that the preimage under $f$ of any Borel set be Lebesgue measurable.

At last, we set $\phi=\chi_M$ — the characteristic function of this set $M$. This function $\phi$ is Lebesgue measurable, because the preimage of any set is one of $\emptyset$, $M$, $M^c$ or $\mathbb{R}$, all of which are Lebesgue measurable. And we’ve already established that $f$ is measurable. However, the composition $\phi\circ f$ is not measurable, since the preimage of the Borel set $\{1\}$ is

$\displaystyle(\phi\circ f)^{-1}(\{1\})=f^{-1}(\phi^{-1}(\{1\}))=f^{-1}(M)=S$

which is not Lebesgue measurable.