Weierstrass function: a function that is continuous everywhere but differentiable nowhere #
This file defines the real-valued Weierstrass function as
$$f(x) = \sum_{n=0}^\infty a^n \cos (b^n\pi x)$$
and prove that it is continuous everywhere but differentiable nowhere for $a \in (0, 1)$, and a positive odd integer $b$ such that
$$ab > 1 + \frac{3}{2}\pi$$
which is the original bound given by Karl Weierstrass. There is a better bound $ab \ge 1$ given by G. H. Hardy with a less elementary proof, which is not implemented here.
References #
Definition #
For real parameter $a$ and $b$, define the Weierstrass function as $$f(x) = \sum_{n=0}^\infty a^n \cos (b^n\pi x)$$
Continuity #
We show that for $a \in (0, 1)$, the summation in the definition is uniformly convergent, each term is uniformly continuous, and therefore Weierstrass function is uniformly continuous.
Non-differentiability #
To show that Weierstrass function $f(x)$ is not differentiable at any $x$, we choose a sequence $\{x_m\}$ such that, as $m\to\infty$
- $\{x_m\}$ converges to $x$
- The slope $(f(x_m) - f(x)) / (x_m - x)$ grows unbounded which means the derivative $f'(x)$ cannot exist.
Show that $x_m \in (x, x + 3 / (2b^m)]$, and it tends to $x$ by squeeze theorem.
To estimate the slope $(f(x_m) - f(x)) / (x_m - x)$, we break the infinite sum in $f(x_m) - f(x)$ into two parts $f(x_m) - f(x) = A + B$, where
$$ A = ∑_{n=0}^{m-1} a^n (\cos(b^n\pi x_m) - \cos(b^n\pi x)) $$ $$ B = ∑_{n=m}^{\infty} a^n (\cos(b^n\pi x_m) - \cos(b^n\pi x)) $$
The remainder has lower bound in absolute value $|B| \ge |x_m - x| 2 (ab)^m / 3$
With bounds for $|A|$ and $|B|$ found, we have
$$ |f(x_m) - f(x)| = |A + B| \ge |B| - |A| \ge |x_m - x| (ab)^m \left(\frac{2}{3} - \frac{\pi}{ab - 1}\right) $$
It is obvious that $|f(x_m) - f(x)| / |x_m - x|$ grows exponentially and gives no limit for the derivative.
A concrete example of $a$ and $b$ to show that the condition is not vacuous.