Space of Piecewise Linear Functions on Closed Interval is Dense in Space of Continuous Functions on Closed Interval

Theorem
Let $I = \closedint a b$.

Let $\map \CC I$ be the set of continuous functions on $I$.

Let $\map {\mathrm {PL} } I$ be the set of piecewise linear functions on $I$.

Let $d$ be the metric induced by the supremum norm.

Then $\map {\mathrm {PL} } I$ is dense in $\struct {\map \CC I, d}$.

Proof
Let $f \in \map \CC I$.

Let $\epsilon \in \R_{>0}$ be a real number.

From Open Ball Characterization of Denseness:


 * it suffices to find a $p \in \map {\mathrm {PL} } I$ such that $p$ is contained in the open ball $\map {B_\epsilon} f$.

From Continuous Function on Closed Real Interval is Uniformly Continuous:


 * $f$ is uniformly continuous on $I$.

That is:


 * there exists a $\delta > 0$ such that for all $x, y \in I$ with $\size {x - y} < \delta$ we have $\size {\map f x - \map f y} < \epsilon/3$.

Let:


 * $P = \{a_0 = a, a_1, a_2, \ldots, a_n = b\}$

be a finite subdivision of $I$, with:


 * $\size {a_{i + 1} - a_i} < \delta$

for each $i$.

Let $p \in \map {\mathrm {PL} } I$ be such that:


 * $\map p {a_i} = \map f {a_i}$

for each $i$, with $p$ continuous.

We can explicitly construct such a $p$ by connecting $\tuple {a_i, \map f {a_i} }$ to $\tuple {a_{i + 1}, \map f {a_{i + 1} } }$ with a straight line segment for each $i$.

Fix $x \in I$.

Note that there exists precisely one $i$ such that $a_i \le x \le a_{i + 1}$, fix this $i$.

We then have:

since $\size {a_{i + 1} - a_i} < \delta$.

Since $\size {x - a_i} < \size {a_{i + 1} - a_i} < \delta$, we also have:


 * $\size {\map f x - \map f {a_i} } < \epsilon/3$

So:

Note that $x \in I$ was arbitrary, so:

so $p \in \map {B_\epsilon} f$.