Dirichlet function
Indicator function of rational numbers
title: "Dirichlet function" type: doc version: 1 created: 2026-02-28 author: "Wikipedia contributors" status: active scope: public tags: ["elementary-special-functions", "real-analysis"] description: "Indicator function of rational numbers" topic_path: "general/elementary-special-functions" source: "https://en.wikipedia.org/wiki/Dirichlet_function" license: "CC BY-SA 4.0" wikipedia_page_id: 0 wikipedia_revision_id: 0
::summary Indicator function of rational numbers ::
In mathematics, the Dirichlet function is the indicator function \mathbf{1}\Q of the set of rational numbers \Q over the set of real numbers \R, i.e. \mathbf{1}\Q(x) = 1 for a real number x if x is a rational number and \mathbf{1}\Q(x) = 0 if x is not a rational number (i.e. is an irrational number). \mathbf 1\Q(x) = \begin{cases} 1 & x \in \Q \ 0 & x \notin \Q \end{cases}
It is named after the mathematician Peter Gustav Lejeune Dirichlet. It is an example of a pathological function which provides counterexamples to many situations.
Topological properties
| The Dirichlet function is nowhere continuous. We can prove this by reference to the definition of a continuous function to show that it violates the continuity properties at both rational and irrational arguments:
- If y is irrational, then . Again, we can take , and this time, because the rational numbers are dense in the reals, we can pick z to be a rational number as close to y as is required. Again, is more than away from .}} Its restrictions to the set of rational numbers and to the set of irrational numbers are constants and therefore continuous. The Dirichlet function is an archetypal example of the Blumberg theorem.
| The Dirichlet function can be constructed as the double pointwise limit of a sequence of continuous functions, as follows: \forall x \in \R, \quad \mathbf{1}{\Q}(x) = \lim{k \to \infty} \left(\lim_{j\to\infty}\left(\cos(k!\pi x)\right)^{2j}\right) for integer j and k. This shows that the Dirichlet function is a Baire class 2 function. It cannot be a Baire class 1 function because a Baire class 1 function can only be discontinuous on a meagre set.{{cite book | last = Dunham | first = William | title = The Calculus Gallery | publisher = Princeton University Press | date = 2005 | pages = 197 | isbn = 0-691-09565-5 }}
Periodicity
For any real number x and any positive rational number T, \mathbf{1}\Q(x + T) = \mathbf{1}\Q(x). The Dirichlet function is therefore an example of a real periodic function which is not constant but whose set of periods, the set of rational numbers, is a dense subset of \R.
Integration properties
| The Dirichlet function is not Riemann-integrable on any segment of \R despite being bounded because the set of its discontinuity points is not negligible (for the Lebesgue measure). | The Dirichlet function has both an upper Darboux integral (namely, b-a) and a lower Darboux integral (0) over any bounded interval [a,b] — but they are not equal if a , so the Dirichlet function is not Darboux-integrable (and therefore not Riemann-integrable) over any nondegenerate interval. | The Dirichlet function provides a counterexample showing that the monotone convergence theorem is not true in the context of the Riemann integral. | The Dirichlet function is Lebesgue-integrable on \R and its integral over \R is zero because it is zero except on the set of rational numbers which is negligible (for the Lebesgue measure).
References
References
- "Dirichlet-function".
- [http://mathworld.wolfram.com/DirichletFunction.html Dirichlet Function — from MathWorld]
- Lejeune Dirichlet, Peter Gustav. (1829). "Sur la convergence des séries trigonométriques qui servent à représenter une fonction arbitraire entre des limites données". Journal für die reine und angewandte Mathematik.
::callout[type=info title="Wikipedia Source"] This article was imported from Wikipedia and is available under the Creative Commons Attribution-ShareAlike 4.0 License. Content has been adapted to SurfDoc format. Original contributors can be found on the article history page. ::