For the other function sometimes incorrectly called the Dirichlet function, see
Dirichlet kernel.
In mathematics, the Dirichlet function is the indicator function
of the set of rational numbers
over the set of real numbers
, i.e.
for a real number x if x is a rational number and
if x is not a rational number (i.e. is an irrational number).
It is named after the mathematician Peter Gustav Lejeune Dirichlet. It is an example of a pathological function which provides counterexamples to many situations.