# Prob. 12, Chap. 6, in Baby Rudin: Denseness of $\mathrm{C}[a,b]$ in $L^2[a,b]$

Here is Prob. 12, Chap. 6, in the book Principles of Mathematical Analysis by Walter Rudin, 3rd edition:

With the notations of Exercise 11, suppose $f \in \mathscr{R}(\alpha)$ and $\varepsilon > 0$. Prove that there exists a continuous function $g$ on $[a, b]$ such that $\lVert f-g \rVert_2 < \varepsilon$.

Hint: Let $P = \left\{ \ x_0, \ldots, x_n \ \right\}$ be a suitable partition of $[a, b]$, define $$g(t) = \frac{ x_i - t }{ \Delta x_i } f \left( x_{i-1} \right) + \frac{ t- x_{i-1} }{ \Delta x_i } f \left( x_i \right)$$ if $x_{i-1} \leq t \leq x_i$.

My Attempt:

Here is the link to one of my Math SE posts in which I have included Definitions 6.1 and 6.2 from Rudin, where all the notation to be used below is given:

Theorem 6.15 in Baby Rudin: If $a<s<b$, $f$ is bounded on $[a,b]$, $f$ is continuous at $s$, and $\alpha(x)=I(x-s)$, then . . .

Let us first assume that $f$ is a real function defined on $[a, b]$. As $f$ is Riemann-Stieltjes integrable on $[a, b]$, so it is bounded on $[a, b]$. Let us put $$M \colon= \sup \left\{ \ \lvert f(x) \rvert \ \colon \ a \leq x \leq b \ \right\}. \tag{A}$$

Again as $f$ is Riemann-Stieltjes integrable on $[a, b]$, so by Theorem 6.4 in Rudin we can find a partition $P = \left\{ \ x_0, \ldots, x_n \ \right\}$ of $[a, b]$ for which $$U(P, f, \alpha) - L(P, f, \alpha) < \frac{\varepsilon^2 }{4 M \left[ \alpha(b) - \alpha(a) \right] + 1 }. \tag{B}$$ Then for each $i = 1, \ldots, n$, we have $$\left( M_i - m_i \right) \Delta \alpha_i < \frac{\varepsilon^2 }{4 M \left[ \alpha(b) - \alpha(a) \right] + 1 }. \tag{C}$$

For each $i = 1, \ldots, n$, and for every $t_i$ such that $x_{i-1} \leq t_i \leq x_i$, we see that \begin{align} \left\lvert f\left(t_i \right) - g \left(t_i \right) \right\rvert &= \left\lvert \frac{x_i - t_i + t_i - x_{i-1} }{\Delta x_i } f\left(t_i \right) - \left[ \frac{ x_i - t_i }{ \Delta x_i } f \left( x_{i-1} \right) + \frac{ t_i- x_{i-1} }{ \Delta x_i } f \left( x_i \right) \right] \right\rvert \\ &= \left\lvert \frac{x_i - t_i }{\Delta x_i} \left[ f \left(t_i \right) - f \left( x_{i-1} \right) \right] + \frac{ t_i - x_{i-1} }{\Delta x_i} \left[ f \left(t_i \right) - f \left( x_i \right) \right] \right\rvert \\ &\leq \frac{x_i - t_i }{\Delta x_i} \left\lvert f \left(t_i \right) - f \left( x_{i-1} \right) \right\rvert + \frac{ t_i - x_{i-1} }{\Delta x_i} \left\lvert f \left(t_i \right) - f \left( x_i \right) \right\rvert \\ &\leq \frac{x_i - t_i }{\Delta x_i} \left( M_i - m_i \right) + \frac{t_i - x_{i-1} }{\Delta x_i} \left( M_i - m_i \right) \\ & \mbox{ [ where m_i \colon= \inf \left\{ \ f(t) \ \colon \ x_{i-1} \leq t \leq x_i \ \right\}, and M_i \colon= \sup \left\{ \ f(t) \ \colon \ x_{i-1} \leq t \leq x_i \ \right\} ] } \\ &= M_i - m_i, \end{align} which implies that $$\left\lvert f\left(t_i \right) - g \left(t_i \right) \right\rvert^2 \leq \left( M_i - m_i \right)^2,$$ and so $$\left\lvert f \left(t_i \right) - g \left(t_i \right) \right\rvert^2 \Delta \alpha_i \leq \left( M_i - m_i \right)^2 \Delta \alpha_i.$$ Therefore, for each $t_i \in \left[ x_{i-1}, x_i \right]$ for each $i = 1, \ldots, n$, we have \begin{align} 0 &\leq \sum_{i=1}^n \left\lvert f \left(t_i \right) - g \left(t_i \right) \right\rvert^2 \Delta \alpha_i \\ &\leq \sum_{i=1}^n \left( M_i - m_i \right)^2 \Delta \alpha_i \\ &\leq \sum_{i-1}^n 2M \left( M_i - m_i \right) \Delta \alpha_i \qquad \mbox{ [ using (A) above ] } \\ &= \sum_{i=1}^n 2 M \frac{ \varepsilon^2 }{ 4 M \left[ \alpha(b) - \alpha(a) \right] + 1} \Delta \alpha_i \qquad \mbox{ [ using (C) above ] } \\ &= 2M \frac{ \varepsilon^2 }{ 4M \left[ \alpha(b) - \alpha(a) \right] + 1} \left[ \alpha(b) - \alpha(a) \right]\\ &< \frac{\varepsilon^2 }{2}, \end{align} and so
$$- \frac{\varepsilon^2 }{2} \leq \sum_{i=1}^n \left\lvert f \left(t_i \right) - g \left(t_i \right) \right\rvert^2 \Delta \alpha_i \leq \frac{\varepsilon^2 }{2}. \tag{0}$$

But $$L \left(P, \lvert f-g \rvert^2 , \alpha \right) = \inf \left\{ \ \sum_{i=1}^n \left\lvert f \left(t_i \right) - g \left(t_i \right) \right\rvert^2 \Delta \alpha_i \ \colon \ t_i \in \left[ x_{i-1}, x_i \right] \ i = 1, \ldots, n \ \right\}, \tag{1}$$ and $$U \left( P, \lvert f-g \rvert^2 , \alpha \right) = \sup \left\{ \ \sum_{i=1}^n \left\lvert f \left(t_i \right) - g \left(t_i \right) \right\rvert^2 \Delta \alpha_i \ \colon \ t_i \in \left[ x_{i-1}, x_i \right] \ i = 1, \ldots, n \ \right\}. \tag{2}$$

Here is the link to a relevant post of mine here on Math SE:

Riemann-Stieltjes Upper and Lower Sums as Suprema and Infima

Now from (0), (1), and (2) we can conclude that $$- \frac{\varepsilon^2 }{2} \leq L \left( P, \lvert f-g \rvert^2, \alpha \right) \leq U \left( P , \lvert f-g \rvert^2 , \alpha \right) \leq \frac{\varepsilon^2 }{2}. \tag{3}$$

As $g$ is continuous on $[a, b]$, so $g \in \mathscr{R}(\alpha)$ on $[a, b]$, by Theorem 6.8 in Rudin.

Now as $f, g \in \mathscr{R}(\alpha)$ on $[a, b]$, so $f - g \in \mathscr{R}(\alpha)$, by Theorem 6.12 (a) in Rudin.

Here are the links to my Math SE post on Theorem 6.12 (a) in Rudin:

Theorem 6.12 (a) in Baby Rudin: $\int_a^b \left( f_1 + f_2 \right) d \alpha=\int_a^b f_1 d \alpha + \int_a^b f_2 d \alpha$

Theorem 6.12 (a) in Baby Rudin: If $f\in\mathscr{R}(\alpha)$ on $[a,b]$, then $cf\in\mathscr{R}(\alpha)$ for every constant $c$

Furthermore, as $f-g \in \mathscr{R} (\alpha)$ on $[a, b]$, so $\lvert f-g \rvert \in \mathscr{R} (\alpha)$ on $[a, b]$ as well, by virtue of Theorem 6.13 (b) in Rudin.

Finally, as $\lvert f-g \rvert \in \mathscr{R} (\alpha)$ on $[a, b]$ and as the map $y \mapsto y^2$ is continuous on all of $[0, +\infty)$, so we can conclude that $\lvert f-g \rvert^2 \in \mathscr{R} (\alpha)$ on $[a, b]$ also, by virtue of Theorem 6.11 in Rudin.

Thus $\int_a^b \lvert f-g \rvert^2 \ \mathrm{d} \alpha$ exists. Moreover, for any partition $Q$ of $[a, b]$, we have the inequalities $$L \left( Q, \lvert f-g \rvert^2, \alpha \right) \leq \int_a^b \lvert f-g \rvert^2 \ \mathrm{d} \alpha \leq U \left( Q, \lvert f-g \rvert^2 , \alpha \right). \tag{4}$$

From (3) and (4) we can conclude that $$- \frac{\varepsilon^2}{2} \leq \int_a^b \lvert f-g \rvert^2 \ \mathrm{d} \alpha \leq \frac{\varepsilon^2}{2}. \tag{5}$$

But as $\lvert f - g \rvert^2 \geq 0$ on $[a, b]$, so by Theorem 6.12 (b) in Rudin $$\int_a^b \lvert f - g \rvert^2 \ \mathrm{d} \alpha \geq 0. \tag{6}$$

Here is the link to my Math SE post on Theorem 6.12 (b) in Rudin:

Theorem 6.12 (b) in Baby Rudin: If $f_1 \leq f_2$ on $[a, b]$, then $\int_a^b f_1 d\alpha \leq \int_a^b f_2 d\alpha$

From (5) and (6) we obtain $$0 \leq \int_a^b \lvert f - g \rvert^2 \ \mathrm{d} \alpha \leq \frac{\varepsilon^2}{2} < \varepsilon^2.$$ Therefore, $$\left( \int_a^b \lvert f - g \rvert^2 \ \mathrm{d} \alpha \right)^{1/2} < \varepsilon,$$ which is the same as $$\lVert f-g \rVert_2 < \varepsilon.$$ And the function $g$ is continuous on $[a, b]$.

Is my proof correct? Is it rigorous enough? If not, then where does it lack?

How to rigorously show that this function $g$ is continuous?

Now we assume that $f$ is a complex function defined on $[a, b]$. Then $f = \Re f + \iota \Im f$, where $\Re f$ and $\Im f$ are real functions defined on $[a, b]$.

As $f$ is Riemann-Stieltjes integrable with respect to $\alpha$ on $[a, b]$, so are $\Re f$ and $\Im f$. Then we have $$\int_a^b f \ \mathrm{d} \alpha = \int_a^b \Re f \ \mathrm{d} \alpha + \iota \int_a^b \Im f \ \mathrm{d} \alpha.$$

Applying the result just proved for real functions to $\Re f$ and $\Im f$, we can conclude that there are continuous functions $g_1$ and $g_2$ on $[a, b]$ such that $$\left\lVert \Re f \ - \ g_1 \right\rVert < \frac{ \varepsilon}{4},$$ and $$\left\lVert \Im f \ - \ g_2 \right\rVert < \frac{ \varepsilon}{4};$$ therefore if we put $g \colon= g_1 + \iota g_2$ on $[a, b]$, we have
\begin{align} \lVert f - g \rVert_2 &= \left\lVert \left( \Re f + \iota \Im f \right) \ - \ \left( g_1 + \iota g_2 \right) \right\rVert_2 \\ &= \left\lVert \left( \Re f - g_1 \right) \ + \ \iota \left( \Im f - g_2 \right) \right\rVert_2 \\ &\leq \left\lVert \Re f - g_1 \right\rVert_2 \ + \ \left\lVert \iota \left( \Im f - g_2 \right) \right\rVert_2 \\ &= \left\lVert \Re f - g_1 \right\rVert_2 \ + \ \lvert \iota \rvert \cdot \left\lVert \Im f - g_2 \right\rVert_2 \\ &= \left\lVert \Re f - g_1 \right\rVert_2 \ + \ \left\lVert \Im f - g_2 \right\rVert_2 \\ &< \frac{\varepsilon}{4} + \frac{\varepsilon}{4} \\ &< \varepsilon. \end{align}

Finally, as $g_1 = \Re g$ and $g_2 = \Im g$ are both continuous on $[a, b]$, so is $g$.

Is this proof for complex functions correct too? If so, is it rigorous enough too? If not, then what is it that I am missing out on?

• @Salahamam_Fatima why? Is it because you're being put off by the length of my post? – Saaqib Mahmood Aug 7 '17 at 14:40
• It seems that your proof is right. In (0), lower bound should be 0 if $\alpha$ is increasing. – 04170706 Aug 7 '17 at 14:55