measure propertieszero integralfunction comparisonthomae functionlebesgue measuredarboux sumsriemann integrabilitypointwise analysisoscillating behaviorlimit nonexistencesequence oscillationdensity argumenteverywhere discontinuousfunction valuespiecewise definitionreal domainindicator ruleirrational valuesrational valuesanalysisbehaviordefinition
Definition
The Dirichlet function is defined on $\mathbb{R}$ by the following rule:
\[D ( x ) = \{ 1 & \text{if} x \in \mathbb{Q} \\ 0 & \text{if} x \in \mathbb{R} \backslash \mathbb{Q}\]At first glance this appears to be an almost trivial definition, a simple distinction between rationals and irrationals. Yet precisely this simplicity conceals an extremely irregular analytic behaviour, which has made this function a key reference object in integration theory and real analysis.
A notable property of $D$ is its discontinuity at every point of $\mathbb{R}$. This result follows from the mutual density of $\mathbb{Q}$ and $\mathbb{R} \backslash \mathbb{Q}$ in the real line.
For any fixed point $x_{0} \in \mathbb{R}$ and any $\epsilon > 0$, the interval $( x_{0} - \epsilon , x_{0} + \epsilon )$ contains both rational and irrational numbers. Therefore, there is no neighborhood of $x_{0}$ on which $D$ is constant, and any sequence converging to $x_{0}$ can be constructed so that the values of $D$ alternate indefinitely between $0$ and $1$. As a result, the following limit:
\[\underset{x \rightarrow x_{0}}{lim} D ( x )\]does not exist for any $x_{0}$, establishing discontinuity at every point. Since a function that is discontinuous everywhere cannot be Riemann integrable on any non-degenerate interval, this can be confirmed by noting that the upper and lower Darboux sums remain fixed at $1$ and $0$, respectively, for every partition of the interval.
Darboux sums are sums obtained by multiplying the maximum or minimum value of a function on each subinterval of a partition by the width of that subinterval. These sums are used to approximate the integral from above and below.
Non-integrability in the Riemann sense
Consider an interval $[ a , b ]$ with $a < b$ and any partition $\mathcal{P}$ such that:
\[\mathcal{P} = a = x_{0} < x_{1} < \hdots < x_{n} = b\]On each subinterval $[ x_{i - 1} , x_{i} ]$, the supremum of $D$ is $1$ due to the density of the rationals, while the infimum is $0$ due to the density of the irrationals. Therefore:
\(U ( D , \mathcal{P} ) = \sum_{i = 1}^{n} 1 \cdot ( x_{i} - x_{i - 1} ) = b - a\) \(L ( D , \mathcal{P} ) = \sum_{i = 1}^{n} 0 \cdot ( x_{i} - x_{i - 1} ) = 0\)
Because $U ( D , \mathcal{P} ) - L ( D , \mathcal{P} ) = b - a > 0$ for every partition $\mathcal{P}$, the Riemann criterion is not satisfied. Consequently, the function is not integrable in the classical sense on any non-trivial interval.
Lebesgue’s integration theory introduces a significant shift in perspective. The set $\mathbb{Q}$ is countable and therefore has Lebesgue measure zero: $\lambda ( \mathbb{Q} ) = 0$. It follows that $D ( x ) = 0$ almost everywhere with respect to the Lebesgue measure, and since a function that equals zero almost everywhere has integral zero, one obtains
\[\int_{a}^{b} D ( x ) d \lambda = 0\]for every interval $[ a , b ]$. This is one of the more immediate illustrations of the greater reach of Lebesgue’s theory relative to Riemann’s: by construction, it assigns no weight to sets of measure zero, even when those sets are dense in the real line.
Differentiability
The question of whether $D$ possesses a derivative at any point has a definitive answer: $D$ is nowhere differentiable. The derivative of $D$ at a point $x_{0}$ is defined as the limit:
\[D^{'} ( x_{0} ) = \underset{h \rightarrow 0}{lim} \frac{D ( x_{0} + h ) - D ( x_{0} )}{h}\]provided this limit exists. Since differentiability implies continuity and $D$ is discontinuous at every point of $\mathbb{R}$, it follows immediately that $D$ cannot be differentiable anywhere.
This conclusion can also be seen directly through difference quotients. Fix any $x_{0}$ and consider two sequences $( r_{n} )$ and $( s_{n} )$ converging to $x_{0}$, with $r_{n} \in \mathbb{Q}$ and $s_{n} \in \mathbb{R} \backslash \mathbb{Q}$ for all $n$. If $x_{0} \in \mathbb{Q}$, then:
\(\frac{D ( r_{n} ) - D ( x_{0} )}{r_{n} - x_{0}} = \frac{1 - 1}{r_{n} - x_{0}} = 0\) \(\frac{D ( s_{n} ) - D ( x_{0} )}{s_{n} - x_{0}} = \frac{0 - 1}{s_{n} - x_{0}} = \frac{- 1}{s_{n} - x_{0}}\)
The second expression is unbounded as $s_{n} \rightarrow x_{0}$. If instead $x_{0} \in \mathbb{R} \backslash \mathbb{Q}$, then:
\(\frac{D ( r_{n} ) - D ( x_{0} )}{r_{n} - x_{0}} = \frac{1 - 0}{r_{n} - x_{0}} = \frac{1}{r_{n} - x_{0}}\) \(\frac{D ( s_{n} ) - D ( x_{0} )}{s_{n} - x_{0}} = \frac{0 - 0}{s_{n} - x_{0}} = 0\)
It is now the first expression that grows without bound as $r_{n} \rightarrow x_{0}$. In either case, the difference quotient admits no finite limit, confirming that $D^{‘} ( x_{0} )$ does not exist.
The Thomae function
A function closely related to the Dirichlet function, known as the Thomae function or the popcorn function, is defined as follows:
\[T ( x ) = \{ \frac{1}{q} & \text{if} x = \frac{p}{q} \\ 0 & \text{if} x \in \mathbb{R} \backslash \mathbb{Q}\]| We have $p \in \mathbb{Z}$, $q \in \mathbb{N}_{> 0}$, and $gcd ( | p | , q ) = 1$, that is, the fraction $p / q$ is in lowest terms. |
In contrast to the Dirichlet function, the Thomae function is continuous at every irrational point and discontinuous at every rational point. This behaviour exemplifies the boundary case allowed by the Lebesgue criterion for Riemann integrability: a Riemann-integrable function may be discontinuous on a set of measure zero, and the rationals, though dense, constitute precisely such a set.
Consequently, the Thomae function is Riemann integrable, with integral equal to zero on every interval, and serves as a well-behaved counterpart to the Dirichlet function.
Selected resources
- Harvard University, C. T. McMullen. Math 55b Course Notes
- Harvard University, A. Varilly. Thomae Function and Riemann Integrability
- MIT, R. B. Melrose. Dirichlet Function and Darboux Sums
- Princeton University, J. Shapiro. Lebesgue’s Theorem and the Dirichlet Function
- UC Davis J. K. Hunter. The Riemann Integral