Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

It is known that the piecewise linear continuous functions form a dense set in the metric space $C[a,b]$ of continuous real valued functions on the compact interval $[a,b]\subset \mathbb{R}$ with "the supremum" metric $d(f,g)=\sup\limits_{t \in [a,b]} |f(t)-g(t)|$ for $f,g \in C[a,b]$.

Consider subspace $X=\{f\in C[a,b]: f(a)=f(b)\}$ of the metric space $(C[a,b],d)$. How do I show that the set of all piecewise linear functions $g$ on $[a,b]$ such that $g(a)=g(b)$ form a dense subset in $X$?

share|cite|improve this question
How do you show that the set of piecewise linear continuous functions is dense in $C[a,b]$? (I ask because your method might be easily modifiable to solve this problem, or it might not be.) I would use uniform continuity. – Jonas Meyer Nov 28 '11 at 9:00
I saw the proof of the classical Weierstrass approximation theorem which based of the density of piecewise linear functions, but I don't remember neither author nor tittle. – Richard Nov 28 '11 at 9:09
Thanks. I was wondering if you had seen a more direct approach. – Jonas Meyer Nov 28 '11 at 9:19
up vote 2 down vote accepted

You can prove it directly by using uniform continuity of $f\in X$, breaking up $[a,b]$ into a bunch of equal size pieces (small intervals), and putting a segment on each piece to match up with $f$ at the endpoints of the piece.

If instead you wanted to use the result stated in the first paragraph, starting with $f\in X$, take a piecewise linear continuous $g$ such that $d(f,g)$ is small. Define $h$ to be linear with $h(a)=f(a)-g(a)$ and $h(b)=f(b)-g(b)$. Then $g+h$ is piecewise linear and matches $f$ at the endpoints, and $d(f,g+h)\leq d(f,g)+d(g,g+h)=d(f,g)+d(0,h)\leq 2d(f,g)$ is small.

share|cite|improve this answer
Very thanks for answer. – Richard Nov 28 '11 at 9:31

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.