# A semi-continuous function with a dense set of points of discontinuity

Let’s come back to Thomae’s function which is defined as:
$f: \left|\begin{array}{lrl} \mathbb{R} & \longrightarrow & \mathbb{R} \\ x & \longmapsto & 0 \text{ if } x \in \mathbb{R} \setminus \mathbb{Q} \\ \frac{p}{q} & \longmapsto & \frac{1}{q} \text{ if } \frac{p}{q} \text{ in lowest terms and } q > 0 \end{array}\right.$

We proved here that $$f$$ right-sided and left-sided limits vanish at all points. Therefore $$\limsup\limits_{x \to a} f(x) \le f(a)$$ at every point $$a$$ which proves that $$f$$ is upper semi-continuous on $$\mathbb R$$. However $$f$$ is continuous at all $$a \in \mathbb R \setminus \mathbb Q$$ and discontinuous at all $$a \in \mathbb Q$$.

# Converse of fundamental theorem of calculus

The fundamental theorem of calculus asserts that for a continuous real-valued function $$f$$ defined on a closed interval $$[a,b]$$, the function $$F$$ defined for all $$x \in [a,b]$$ by
$F(x)=\int _{a}^{x}\!f(t)\,dt$ is uniformly continuous on $$[a,b]$$, differentiable on the open interval $$(a,b)$$ and $F^\prime(x) = f(x)$
for all $$x \in (a,b)$$.

The converse of fundamental theorem of calculus is not true as we see below.

Consider the function defined on the interval $$[0,1]$$ by $f(x)= \begin{cases} 2x\sin(1/x) – \cos(1/x) & \text{ for } x \neq 0 \\ 0 & \text{ for } x = 0 \end{cases}$ $$f$$ is integrable as it is continuous on $$(0,1]$$ and bounded on $$[0,1]$$. Then $F(x)= \begin{cases} x^2 \sin \left( 1/x \right) & \text{ for } x \neq 0 \\ 0 & \text{ for } x = 0 \end{cases}$ $$F$$ is differentiable on $$[0,1]$$. It is clear for $$x \in (0,1]$$. $$F$$ is also differentiable at $$0$$ as for $$x \neq 0$$ we have $\left\vert \frac{F(x) – F(0)}{x-0} \right\vert = \left\vert \frac{F(x)}{x} \right\vert \le \left\vert x \right\vert.$ Consequently $$F^\prime(0) = 0$$.

However $$f$$ is not continuous at $$0$$ as it does not have a right limit at $$0$$.

# A monotonic function whose points of discontinuity form a dense set

Consider a compact interval $$[a,b] \subset \mathbb R$$ with $$a \lt b$$. Let’s build an increasing function $$f : [a,b] \to \mathbb R$$ whose points of discontinuity is an arbitrary dense subset $$D = \{d_n \ ; \ n \in \mathbb N\}$$ of $$[a,b]$$, for example $$D = \mathbb Q \cap [a,b]$$.

Let $$\sum p_n$$ be a convergent series of positive numbers whose sum is equal to $$p$$ and define $$\displaystyle f(x) = \sum_{d_n \le x} p_n$$.

### $$f$$ is strictly increasing

For $$a \le x \lt y \le b$$ we have $f(y) – f(x) = \sum_{x \lt d_n \le y} p_n \gt 0$ as the $$p_n$$ are positive and dense so it exists $$p_m \in (x, y]$$.

### $$f$$ is right-continuous on $$[a,b]$$

We pick-up $$x \in [a,b]$$. For any $$\epsilon \gt 0$$ is exists $$N \in \mathbb N$$ such that $$0 \lt \sum_{n \gt N} p_n \lt \epsilon$$. Let $$\delta > 0$$ be so small that the interval $$(x,x+\delta)$$ doesn’t contain any point in the finite set $$\{p_1, \dots, p_N\}$$. Then $0 \lt f(y) – f(x) \le \sum_{n \gt N} p_n \lt \epsilon,$ for any $$y \in (x,x+\delta)$$ proving the right-continuity of $$f$$ at $$x$$. Continue reading A monotonic function whose points of discontinuity form a dense set

# Uniform continuous function but not Lipschitz continuous

Consider the function $\begin{array}{l|rcl} f : & [0,1] & \longrightarrow & [0,1] \\ & x & \longmapsto & \sqrt{x} \end{array}$

$$f$$ is continuous on the compact interval $$[0,1]$$. Hence $$f$$ is uniform continuous on that interval according to Heine-Cantor theorem. For a direct proof, one can verify that for $$\epsilon > 0$$, one have $$\vert \sqrt{x} – \sqrt{y} \vert \le \epsilon$$ for $$\vert x – y \vert \le \epsilon^2$$.

However $$f$$ is not Lipschitz continuous. If $$f$$ was Lipschitz continuous for a Lipschitz constant $$K > 0$$, we would have $$\vert \sqrt{x} – \sqrt{y} \vert \le K \vert x – y \vert$$ for all $$x,y \in [0,1]$$. But we get a contradiction taking $$x=0$$ and $$y=\frac{1}{4 K^2}$$ as $\vert \sqrt{x} – \sqrt{y} \vert = \frac{1}{2 K} > \frac{1}{4 K} = K \vert x – y \vert$

# Pointwise convergence not uniform on any interval

We provide in this article an example of a pointwise convergent sequence of real functions that doesn’t converge uniformly on any interval.

Let’s consider a sequence $$(a_p)_{p \in \mathbb N}$$ enumerating the set $$\mathbb Q$$ of rational numbers. Such a sequence exists as $$\mathbb Q$$ is countable.

Now let $$(g_n)_{n \in \mathbb N}$$ be the sequence of real functions defined on $$\mathbb R$$ by $g_n(x) = \sum_{p=1}^{\infty} \frac{1}{2^p} f_n(x-a_p)$ where $$f_n : x \mapsto \frac{n^2 x^2}{1+n^4 x^4}$$ for $$n \in \mathbb N$$.

### $$f_n$$ main properties

$$f_n$$ is a rational function whose denominator doesn’t vanish. Hence $$f_n$$ is indefinitely differentiable. As $$f_n$$ is an even function, we can study it only on $$[0,\infty)$$.

We have $f_n^\prime(x)= 2n^2x \frac{1-n^4x^4}{(1+n^4 x^4)^2}.$ $$f_n^\prime$$ vanishes at zero (like $$f_n$$) is positive on $$(0,\frac{1}{n})$$, vanishes at $$\frac{1}{n}$$ and is negative on $$(\frac{1}{n},\infty)$$. Hence $$f_n$$ has a maximum at $$\frac{1}{n}$$ with $$f_n(\frac{1}{n}) = \frac{1}{2}$$ and $$0 \le f_n(x) \le \frac{1}{2}$$ for all $$x \in \mathbb R$$.

Also for $$x \neq 0$$ $0 \le f_n(x) =\frac{n^2 x^2}{1+n^4 x^4} \le \frac{n^2 x^2}{n^4 x^4} = \frac{1}{n^2 x^2}$ consequently $0 \le f_n(x) \le \frac{1}{n} \text{ for } x \ge \frac{1}{\sqrt{n}}.$

### $$(g_n)$$ converges pointwise to zero

First, one can notice that $$g_n$$ is well defined. For $$x \in \mathbb R$$ and $$p \in \mathbb N$$ we have $$0 \le \frac{1}{2^p} f_n(x-a_p) \le \frac{1}{2^p} \cdot\ \frac{1}{2}=\frac{1}{2^{p+1}}$$ according to previous paragraph. Therefore the series of functions $$\sum \frac{1}{2^p} f_n(x-a_p)$$ is normally convergent. $$g_n$$ is also continuous as for all $$p \in \mathbb N$$ $$x \mapsto \frac{1}{2^p} f_n(x-a_p)$$ is continuous. Continue reading Pointwise convergence not uniform on any interval

# A discontinuous midpoint convex function

Let’s recall that a real function $$f: \mathbb R \to \mathbb R$$ is called convex if for all $$x, y \in \mathbb R$$ and $$\lambda \in [0,1]$$ we have $f((1- \lambda) x + \lambda y) \le (1- \lambda) f(x) + \lambda f(y)$ $$f$$ is called midpoint convex if for all $$x, y \in \mathbb R$$ $f \left(\frac{x+y}{2}\right) \le \frac{f(x)+f(y)}{2}$ One can prove that a continuous midpoint convex function is convex. Sierpinski proved the stronger theorem, that a real-valued Lebesgue measurable function that is midpoint convex will be convex.

Can one find a discontinuous midpoint convex function? The answer is positive but requires the Axiom of Choice. Why? Because Robert M. Solovay constructed a model of Zermelo-Fraenkel set theory (ZF), exclusive of the axiom of choice where all functions are Lebesgue measurable. Hence convex according to Sierpinski theorem. And one knows that convex functions defined on $$\mathbb R$$ are continuous.

Referring to my previous article on the existence of discontinuous additive map, let’s use a Hamel basis $$\mathcal B = (b_i)_{i \in I}$$ of $$\mathbb R$$ considered as a vector space on $$\mathbb Q$$. Take $$i_1 \in I$$, define $$f(i_1)=1$$ and $$f(i)=0$$ for $$i \in I\setminus \{i_1\}$$ and extend $$f$$ linearly on $$\mathbb R$$. $$f$$ is midpoint convex as it is linear. As the image of $$\mathbb R$$ under $$f$$ is $$\mathbb Q$$, $$f$$ is discontinuous as explained in the discontinuous additive map counterexample.

Moreover, $$f$$ is unbounded on all open real subsets. By linearity, it is sufficient to prove that $$f$$ is unbounded around $$0$$. Let’s consider $$i_1 \neq i_2 \in I$$. $$G= b_{i_1} \mathbb Z + b_{i_2} \mathbb Z$$ is a proper subgroup of the additive $$\mathbb R$$ group. Hence $$G$$ is either dense of discrete. It cannot be discrete as the set of vectors $$\{b_1,b_2\}$$ is linearly independent. Hence $$G$$ is dense in $$\mathbb R$$. Therefore, one can find a non vanishing sequence $$(x_n)_{n \in \mathbb N}=(q_n^1 b_{i_1} + q_n^2 b_{i_2})_{n \in \mathbb N}$$ (with $$(q_n^1,q_n^2) \in \mathbb Q^2$$ for all $$n \in \mathbb N$$) converging to $$0$$. As $$\{b_1,b_2\}$$ is linearly independent, this implies $$\vert q_n^1 \vert, \vert q_n^2 \vert \underset{n\to+\infty}{\longrightarrow} \infty$$ and therefore $\lim\limits_{n \to \infty} \vert f(x_n) \vert = \lim\limits_{n \to \infty} \vert f(q_n^1 b_{i_1} + q_n^2 b_{i_2}) \vert = \lim\limits_{n \to \infty} \vert q_n^1 \vert = \infty.$

A function $$f$$ defined on $$\mathbb R$$ into $$\mathbb R$$ is said to be additive if and only if for all $$x, y \in \mathbb R$$
$f(x+y) = f(x) + f(y).$ If $$f$$ is supposed to be continuous at zero, $$f$$ must have the form $$f(x)=cx$$ where $$c=f(1)$$. This can be shown using following steps:

• $$f(0) = 0$$ as $$f(0) = f(0+0)= f(0)+f(0)$$.
• For $$q \in \mathbb N$$ $$f(1)=f(q \cdot \frac{1}{q})=q f(\frac{1}{q})$$. Hence $$f(\frac{1}{q}) = \frac{f(1)}{q}$$. Then for $$p,q \in \mathbb N$$, $$f(\frac{p}{q}) = p f(\frac{1}{q})= f(1) \frac{p}{q}$$.
• As $$f(-x) = -f(x)$$ for all $$x \in\mathbb R$$, we get that for all rational number $$\frac{p}{q} \in \mathbb Q$$, $$f(\frac{p}{q})=f(1)\frac{p}{q}$$.
• The equality $$f(x+y) = f(x) + f(y)$$ implies that $$f$$ is continuous on $$\mathbb R$$ if it is continuous at $$0$$.
• We can finally conclude to $$f(x)=cx$$ for all real $$x \in \mathbb R$$ as the rational numbers are dense in $$\mathbb R$$.

We’ll use a Hamel basis to construct a discontinuous linear function. The set $$\mathbb R$$ can be endowed with a vector space structure over $$\mathbb Q$$ using the standard addition and the multiplication by a rational for the scalar multiplication.

Using the axiom of choice, one can find a (Hamel) basis $$\mathcal B = (b_i)_{i \in I}$$ of $$\mathbb R$$ over $$\mathbb Q$$. That means that every real number $$x$$ is a unique linear combination of elements of $$\mathcal B$$: $x= q_1 b_{i_1} + \dots + q_n b_{i_n}$ with rational coefficients $$q_1, \dots, q_n$$. The function $$f$$ is then defined as $f(x) = q_1 + \dots + q_n.$ The linearity of $$f$$ follows from its definition. $$f$$ is not continuous as it only takes rational values which are not all equal. And one knows that the image of $$\mathbb R$$ under a continuous map is an interval.

# Existence of a continuous function with divergent Fourier series

In that article, I provided an example of a continuous function with divergent Fourier series. We prove here the existence of such a function using Banach-Steinhaus theorem, also called uniform boundedness principle.

Theorem (Uniform Boundedness Theorem) Let $$(X, \Vert \cdot \Vert_X)$$ be a Banach space and $$(Y, \Vert \cdot \Vert_Y)$$ be a normed vector space. Suppose that $$F$$ is a set of continuous linear operators from $$X$$ to $$Y$$. If for all $$x \in X$$ one has $\sup\limits_{T \in F} \Vert T(x) \Vert_Y \lt \infty$ then $\sup\limits_{T \in F, \ \Vert x \Vert = 1} \Vert T(x) \Vert_Y \lt \infty$

Let’s take for $$X$$ the vector space $$\mathcal C_{2 \pi}$$ of continuous functions from $$\mathbb R$$ to $$\mathbb C$$ which are periodic with period $$2 \pi$$ endowed with the norm $$\Vert f \Vert_\infty = \sup\limits_{- \pi \le t \le \pi} \vert f(t) \vert$$. $$(\mathcal C_{2 \pi}, \Vert \cdot \Vert_\infty)$$ is a Banach space. For the vector space $$Y$$, we take the complex numbers $$\mathbb C$$ endowed with the modulus.

For $$n \in \mathbb N$$, the map $\begin{array}{l|rcl} \ell_n : & \mathcal C_{2 \pi} & \longrightarrow & \mathbb C \\ & f & \longmapsto & \displaystyle \sum_{p=-n}^n c_p(f) \end{array}$ is a linear operator, where for $$p \in \mathbb Z$$, $$c_p(f)$$ denotes the complex Fourier coefficient $c_p(f) = \frac{1}{2 \pi} \int_{- \pi}^{\pi} f(t) e^{-i p t} \ dt$

We now prove that
\begin{align*}
\Lambda_n &= \sup\limits_{f \in \mathcal C_{2 \pi}, \Vert f \Vert_\infty=1} \vert \ell_n(f) \vert\\
&= \frac{1}{2 \pi} \int_{- \pi}^{\pi} \left\vert \frac{\sin (2n+1)\frac{t}{2}}{\sin \frac{t}{2}} \right\vert \ dt = \frac{1}{2 \pi} \int_{- \pi}^{\pi} \left\vert h_n(t) \right\vert \ dt,
\end{align*} where one can notice that the function $\begin{array}{l|rcll} h_n : & [- \pi, \pi] & \longrightarrow & \mathbb C \\ & t & \longmapsto & \frac{\sin (2n+1)\frac{t}{2}}{\sin \frac{t}{2}} &\text{for } t \neq 0\\ & 0 & \longmapsto & 2n+1 \end{array}$ is continuous.
Continue reading Existence of a continuous function with divergent Fourier series

# Bounded functions and infimum, supremum

According to the extreme value theorem, a continuous real-valued function $$f$$ in the closed and bounded interval $$[a,b]$$ must attain a maximum and a minimum, each at least once.

Let’s see what can happen for non-continuous functions. We consider below maps defined on $$[0,1]$$.

First let’s look at $f(x)=\begin{cases} x &\text{ if } x \in (0,1)\\ 1/2 &\text{otherwise} \end{cases}$ $$f$$ is bounded on $$[0,1]$$, continuous on the interval $$(0,1)$$ but neither at $$0$$ nor at $$1$$. The infimum of $$f$$ is $$0$$, its supremum $$1$$, and $$f$$ doesn’t attain those values. However, for $$0 < a < b < 1$$, $$f$$ attains its supremum and infimum on $$[a,b]$$ as $$f$$ is continuous on this interval.

### Bounded function that doesn’t attain its infimum and supremum on all $$[a,b] \subseteq [0,1]$$

The function $$g$$ defined on $$[0,1]$$ by $g(x)=\begin{cases} 0 & \text{ if } x \notin \mathbb Q \text{ or if } x = 0\\ \frac{(-1)^q (q-1)}{q} & \text{ if } x = \frac{p}{q} \neq 0 \text{, with } p, q \text{ relatively prime} \end{cases}$ is bounded, as for $$x \in \mathbb Q \cap [0,1]$$ we have $\left\vert g(x) \right\vert < 1.$ Hence $$g$$ takes values in the interval $$[-1,1]$$. We prove that the infimum of $$g$$ is $$-1$$ and its supremum $$1$$ on all intervals $$[a,b]$$ with $$0 < a < b <1$$. Consider $$\varepsilon > 0$$ and an odd prime $$q$$ such that $q > \max(\frac{1}{\varepsilon}, \frac{1}{b-a}).$ This is possible as there are infinitely many prime numbers. By the pigeonhole principle and as $$0 < \frac{1}{q} < b-a$$, there exists a natural number $$p$$ such that $$\frac{p}{q} \in (a,b)$$. We have $-1 < g \left(\frac{p}{q} \right) = \frac{(-1)^q (q-1)}{q} = - \frac{q-1}{q} <-1 +\varepsilon$ as $$q$$ is supposed to be an odd prime with $$q > \frac{1}{\varepsilon}$$. This proves that the infimum of $$g$$ is $$-1$$. By similar arguments, one can prove that the supremum of $$g$$ on $$[a,b]$$ is $$1$$.

# A continuous function with divergent Fourier series

It is known that for a piecewise continuously differentiable function $$f$$, the Fourier series of $$f$$ converges at all $$x \in \mathbb R$$ to $$\frac{f(x^-)+f(x^+)}{2}$$.

We describe Fejér example of a continuous function with divergent Fourier series. Fejér example is the even, $$(2 \pi)$$-periodic function $$f$$ defined on $$[0,\pi]$$ by: $f(x) = \sum_{p=1}^\infty \frac{1}{p^2} \sin \left[ (2^{p^3} + 1) \frac{x}{2} \right]$
According to Weierstrass M-test, $$f$$ is continuous. We denote $$f$$ Fourier series by $\frac{1}{2} a_0 + (a_1 \cos x + b_1 \sin x) + \dots + (a_n \cos nx + b_n \sin nx) + \dots.$

As $$f$$ is even, the $$b_n$$ are all vanishing. If we denote for all $$m \in \mathbb N$$:$\lambda_{n,m}=\int_0^{\pi} \sin \left[ (2m + 1) \frac{t}{2} \right] \cos nt \ dt \text{ and } \sigma_{n,m} = \sum_{k=0}^n \lambda_{k,m},$
we have:\begin{aligned} a_n &=\frac{1}{\pi} \int_{-\pi}^{\pi} f(t) \cos nt \ dt= \frac{2}{\pi} \int_0^{\pi} f(t) \cos nt \ dt\\ &= \frac{2}{\pi} \int_0^{\pi} \left(\sum_{p=1}^\infty \frac{1}{p^2} \sin \left[ (2^{p^3} + 1) \frac{x}{2} \right]\right) \cos nt \ dt\\ &=\frac{2}{\pi} \sum_{p=1}^\infty \frac{1}{p^2} \int_0^{\pi} \sin \left[ (2^{p^3} + 1) \frac{x}{2} \right] \cos nt \ dt\\ &=\frac{2}{\pi} \sum_{p=1}^\infty \frac{1}{p^2} \lambda_{n,2^{p^3-1}} \end{aligned} One can switch the $$\int$$ and $$\sum$$ signs as the series is normally convergent.

We now introduce for all $$n \in \mathbb N$$:$S_n = \frac{\pi}{2} \sum_{k=0}^n a_k = \sum_{p=1}^\infty \sum_{k=0}^n \frac{1}{p^2} \lambda_{k,2^{p^3-1}} =\sum_{p=1}^\infty \frac{1}{p^2} \sigma_{n,2^{p^3-1}}$

We will prove below that for all $$n,m \in \mathbb N$$ we have $$\sigma_{m,m} \ge \frac{1}{2} \ln m$$ and $$\sigma_{n,m} \ge 0$$. Assuming those inequalities for now, we get:$S_{2^{p^3-1}} \ge \frac{1}{p^2} \sigma_{2^{p^3-1},2^{p^3-1}} \ge \frac{1}{2p^2} \ln(2^{p^3-1}) = \frac{p^3-1}{2p^2} \ln 2$
As the right hand side diverges to $$\infty$$, we can conclude that $$(S_n)$$ diverges and consequently that the Fourier series of $$f$$ diverges at $$0$$. Continue reading A continuous function with divergent Fourier series