Continuous functions that are nowhere
differentiable
S. Kesavan
The Institute of Mathematical Sciences,
CIT Campus, Taramani,
Chennai - 600113.
e-mail: kesh @imsc.res.in
Abstract
It is shown that the existence of continuous functions on the interval [0, 1] that
are nowhere differentiable can be deduced from the Baire category theorem.
This approach also shows that there is a preponderance of such functions.
1
1 Introduction
The French mathematician Hermite, in a letter written to Stieltjes, dated
May 20, 1893, wrote ‘I turn away with fear and horror from the lamentable
plague of continuous functions which do not have derivatives ...’(cf. Pinkus [6]).
The earliest universally acknowledged explicit example of a continuous func-
tion which is nowhere differentiable is due to Weierstrass (1872) given by
∞
X
an cos(bn πx)
n=0
where ab > 1 + 32 π. It is also said that Bolzano constructed such an example
(in the 1830s), which was not published. Since then a number of variants
of Weierstrass’ example have appeared in the literature. Here are some of
them.
• ∞
X 1
n
sin(3n x).
n=0
2
• (cf. Hardy [3])
∞
X 1
2
sin(n2 πx).
n=1
n
• (cf. Rudin [7]) Define
x, 0 ≤ x ≤ 1,
ϕ(x) =
2 − x, 1 ≤ x ≤ 2
and extend it to all of R by setting ϕ(x + 2) = ϕ(x). Then the function
defined by the series
∞ n
X 3
ϕ(4n x)
n=0
4
is again continuous and nowhere differentiable.
In the above three examples, the series are clearly uniformly convergent by
the Weierstrass M-test and so the sum defines a continuous function. One
has to show that it is nowhere differentiable.
2
Another type of example is constructed as follows. Consider the space
C[0, 1] (the space of continuous functions on [0, 1]) with the usual norm topol-
ogy generated by the norm
kf k∞ = max |f (x)|.
x∈[0,1]
Let
X = {f ∈ C[0, 1] | f (0) = 0, f (1) = 1}.
Then it is a closed subset of C[0, 1] and is hence a complete metric space in
its own right. For f ∈ X, define
3
4
f (3x), 0 ≤ x ≤ 31 ,
1
T (f )(x) = 4
+ 12 f (2 − 3x), 31 ≤ x ≤ 32 ,
1 3
4
+ 4 f (3x − 2), 32 ≤ x ≤ 1.
Then it can be shown that T maps X into itself and that
3
kT (f ) − T (g)k∞ ≤ kf − gk∞ .
4
Hence, by the contraction mapping theorem, there exists h ∈ X such that
T (h) = h. It can be shown then that h is nowhere differentiable.
The aim of the present article is to show the existence of continuous but
nowhere differentiable functions, without exhibiting one. The proof, follow-
ing the ideas of Banach [1] and Mazurkiewicz [5], uses the Baire category
theorem which can be stated as follows.
Theorem 1.1 (Baire)Let X be a complete metric space. If {Un }∞
n=1 is a
sequence of open and dense sets in X, then
∩∞
n=1 Un
is also dense in X.
Equivalently, a complete metric space cannot be the countable union of a
family of closed and nowhere dense sets. In technical parlance, a complete
metric space is said to be of the ‘second category’ (the first category being
topological spaces which are countable unions of closed and nowhere dense
3
sets), and hence the word ‘category’ in the name of the theorem. For a
proof, see any text on functional analysis (for instance, see Ciarlet [2] or
Kesavan [4]).
Baire’s theorem is the corner stone of the famous trinity of theorems in
functional analysis, viz. the uniform boundedness principle, the open map-
ping theorem and the closed graph theorem. As a consequence of the uniform
boundedness principle, we can show that for a large class of continuous func-
tions, the Fourier series diverges on a large set of points (see, for instance,
Kesavan [4]).
We will use Baire’s theorem to prove the existence of nowhere differen-
tiable functions in C[0, 1]. This approach also shows that the class of such
functions is quite large. Our presentation is an adaptation of that found in
Ciarlet [2].
2 Approximation by smooth functions
A celebrated theorem of Weierstrass states that any continuous function on
[0, 1] can be uniformly approximated by polynomials. To make this presenta-
tion as self-contained as possible, we will prove a slightly weaker result which
is enough for our purposes, viz. that any continuous function on [0, 1] can be
uniformly approximated by smooth functions.
Consider the function
(
− 1
ρ(x) = e 1−|x|2 , if |x| < 1,
0, if |x| ≥ 1.
It is not difficult to see that this defines a C ∞ function on R whose support is
the closed ball centered at the origin and with unit radius. For ε > 0, define
x
−1
ρε (x) = (kε) ρ
ε
where
∞
Z 1Z
k = ρ(x) dx = ρ(x) dx.
−∞ −1
Then, it is easy to see that ρε is also C ∞ and its support is the closed ball
centered at the origin with radius ε. Further
Z ∞ Z ε
ρε (x) dx = ρε (x) dx = 1.
−∞ −ε
4
Recall that if f and g are continuous real-valued functions defined on R,
with one of them having compact support, the convolution product f ∗ g
defined by
Z ∞ Z ∞
(f ∗ g)(x) = f (x − y)g(y) dy = g(x − y)f (y) dy
−∞ −∞
is well defined and is a continuous function. Further, if one of them is in
C k (R), then f ∗ g ∈ C k (R) for any 1 ≤ k ≤ ∞. If supp(F ) denotes the
support of a function F , then
supp(f ∗ g) ⊂ supp(f ) + supp(g)
where, for subsets A and B of R, we define
A + B = {x + y | x ∈ A, y ∈ B}.
Proposition 2.1 Let f : R → R be a continuous function with compact
support. Then ρε ∗ f converges uniformly to f as ε → 0.
Proof: Let K be the support of f . Then K is a compact subset of R.
Without loss of generality, we can assume 0 < ε < 1 so that ρε ∗ f is a C ∞
function with support contained in the fixed compact set
{x ∈ R | |x| ≤ 1} + K.
Clearly f is uniformly continuous and so, given η > 0, there exists δ > 0
such that |f (x) − f (y)| < η whenever |x − y| < δ. Now, since the integral of
ρε is unity, we can write
Z ε
(ρε ∗ f )(x) − f (x) = (f (x − y) − f (x))ρε (y) dy.
−ε
Thus, if ε < δ then
Z ε
|(ρε ∗ f )(x) − f (x)| ≤ |f (x − y) − f (x)|ρε (y) dy ≤ η
−ε
for all x and this completes the proof.
Corollary 2.1 Let f ∈ C[0, 1]. Then f can be uniformly approximated by
smooth functions.
5
Proof: Given f ∈ C[0, 1], we can extend it to a continuous function with
compact support in R. For example, define
0, if x < −1 or if x > 2,
(x + 1)f (0), if x ∈ [−1, 0],
fe(x) =
f (x), if x ∈ [0, 1],
(2 − x)f (1), if x ∈ [1, 2].
−1 0 1 2
Now fe can be uniformly approximated by smooth functions in R and so their
restrictions to [0, 1] will approximate f uniformly on [0, 1].
Proposition 2.2 Let f ∈ C[0, 1]. Let ε > 0 and n, a positive integer, be
given. Then there exists a piecewise linear continuous function g, defined on
[0, 1] such that kf − gk∞ < ε and such that |g 0 (t)| > n at all points where the
derivative exists.
Proof: In view of the corollary above, we can assume that f is a smooth
function defined on [0, 1].
Step 1. Since f is smooth, f 0 is bounded in [0, 1]. Let |f 0 (x)| ≤ M for all
x ∈ [0, 1]. Since f is continuous on [0, 1], it is uniformly continuous and so
there exists δ > 0 such that, whenever |x − y| < δ, we have |f (x) − f (y)| < 4ε .
Now, choose h > 0 such that
ε
h < min δ, .
2(M + n)
Step 2. Now choose a partition
P : 0 = t0 < t1 < · · · < tk = 1
such that
max (ti+1 − ti ) ≤ h.
0≤i≤k−1
6
Let g : [0, 1] → R be a piecewise linear and continuous function, defined on
each sub-interval [ti , ti+1 ], 0 ≤ i ≤ k − 1, as follows:
g(ti ) = f (ti ) + (−1)i 4ε ,
g(ti+1 ) = f (ti+1 ) + (−1)i+1 4ε ,
ti+1 −t t−ti
g(t) = ti+1 −ti
g(ti ) + ti+1 −ti
g(ti+1 ), ti < t < ti+1 .
The function g is differentiable except at the points {t1 , · · · , tk−1 }.
Step 3. For t ∈ [ti , ti+1 ], 0 ≤ i ≤ k − 1, we have
ti+1 − t t − ti
g(t) − f (t) = (g(ti ) − f (t)) + (g(ti+1 ) − f (t))
ti+1 − ti ti+1 − ti
so that
ε
|g(t) − f (t)| ≤ |f (ti ) − f (t)| + |f (ti+1 ) − f (t)| + < ε
2
since |t − ti | and |t − ti+1 | are both less than, or equal to h < δ. Thus, it
follows that kf − gk∞ < ε.
Step 4. For any t ∈ (ti , ti+1 ), 0 ≤ i ≤ k − 1, we have
f (ti+1 ) − f (ti ) + (−1)i+1 2ε (−1)i+1 2ε
g 0 (t) = = f 0 (ξi ) +
ti+1 − ti ti+1 − ti
where ξi ∈ (ti , ti+1 ). Thus, by our choice of h, we have
(−1)i+1 ε
|g 0 (t)| = ti+1 −ti
2
+ f 0 (ξi )
≥ 2(ti+1ε −ti ) − |f 0 (ξi )|
ε
≥ 2h −M
> n
which completes the proof.
7
3 The main result
Proposition 3.1 Let f ∈ C[0, 1] be differentiable at some point a ∈ [0, 1].
Then, there exists a positive integer N such that
f (a + h) − f (a)
sup ≤ N.
h6=0 h
Proof: Since f is differentiable at a ∈ [0, 1], there exists h0 > 0 such that
for all 0 < |h| ≤ h0 , we have
f (a + h) − f (a)
− f 0 (a) ≤ 1.
h
Thus, for all 0 < |h| ≤ h0 , we have
f (a + h) − f (a)
≤ 1 + |f 0 (a)|.
h
If |h| ≥ h0 , then trivially
f (a + h) − f (a) 2kf k∞
≤ .
h h0
Thus we only need to take
2kf k∞
0
N ≥ max 1 + |f (a)|, .
h0
Let us now define, for each positive integer n,
f (a + h) − f (a)
An = f ∈ C[0, 1] | sup ≤ n for some a ∈ [0, 1] .
h6=0 h
Proposition 3.2 For each positive integer n, the set An is closed in C[0, 1].
Proof: Let {fk } be a sequence in An such that fk → f in C[0, 1]. Then,
there exists a sequence {ak } in [0, 1] such that, for each k,
fk (ak + h) − fk (ak )
sup ≤ n.
h6=0 h
8
Let {akl } be a convergent subsequence, converging to a ∈ [0, 1].
Let h 6= 0 be given. Choose hkl such that akl + hkl = a + h.Thus the
sequence {hkl } converges to h 6= 0 and so we may assume, without loss of
generality, that it is a sequence of non-zero real numbers. Now
|f (a + h) − fkl (akl + hkl )| = |(f − fkl )(a + h)| ≤ kf − fkl k∞ .
Also
|f (a)−fkl (akl )| ≤ |f (a)−f (akl )|+|f (akl )−fkl (akl )| ≤ |f (a)−f (akl )|+kf −fkl k∞ .
By the continuity of f and the convergence of {fkl } to f , we then deduce
that
f (a + h) − f (a) fkl (akl + hkl ) − fkl (akl )
= lim ≤n
h l→∞ hkl
which shows that f ∈ An as well, which completes the proof.
Proposition 3.3 For each positive integer n, the set An has empty interior.
Proof: Given ε > 0, a positive integer n and a function f ∈ An , let g be
constructed as in the proof of Proposition 2.2. Then it is clear that the ball
centered at f and of radius ε in C[0, 1] contains g and that g 6∈ An . This
completes the proof.
We can now prove the main theorem.
Theorem 3.1 There exist continuous functions on the interval [0, 1] which
are nowhere differentiable. In fact the collection of all such functions forms
a dense subset of C[0, 1].
Proof: By Baire’s theorem and the two preceding propositions, it follows
that
C[0, 1] 6= ∪∞
n=1 An .
From the definition of the sets An and from Proposition 3.1, it follows that
every function in
C[0, 1]\ ∪∞ ∞
n=1 An = ∩n=1 (C[0, 1]\An )
is nowhere differentiable and also that this set is dense, since it is the count-
able intersection of open dense sets.
In particular, it follows that every continuous function on [0, 1], irrespec-
tive of its smoothness, is the uniform limit of functions that are nowhere
differentiable!
9
References
[1] Banach, S. Über die baire’sche Kategorie gewisser Funktionen mengen,
Studia Math., 3, pp. 174-179, 1931.
[2] Ciarlet, P. G. Linear and Nonlinear Functional Analysis with Applica-
tions, SIAM, 2013.
[3] Hardy, G. H. Weierstrass’ non-differentiable function, Trans. Amer.
Math. Soc., 17, 1916, pp.301-325.
[4] Kesavan, S. Functional Analysis, TRIM Series No. 52, Hindustan Book
Agency, 2009.
[5] Mazurkiewicz, S. Sur les fonctions non dérivables, Studia Math., 3, pp.
92-94, 1931.
[6] Pinkus, A. Weierstrass and approximation theory, J. Approx. Th., 107,
2000, pp.1 - 66.
[7] Rudin, W. Principles of Mathematical Analysis, McGraw-Hill, Second
Edition, International Student Edition, 1964.
10