Casey Chu
- The Dirichlet function in closed form
- My calculus teacher gave an example of a function that was discontinuous everywhere, the Dirichlet function. It indicates whether a number is rational or irrational:
- That’s cool, but what’s even cooler is that there exists this expression for the Dirichlet function:
- Unfortunately, neither Wikipedia nor Wolfram’s web site explains why this is equivalent to the Dirichlet function, so I spent a long time thinking about it. Here’s what I’ve come up with.
- Let’s consider a simplified version first. Consider the function . It equals so long as is an integer, and a positive decimal less than otherwise. This is simple to see by graphing the function.
- Now, if you exponentiate the result an infinite number of times — i.e., — you end up with two outcomes. If is an integer, then , and exponentiated infinitely will still equal . If is not an integer, then and will therefore get smaller after every exponentiation, eventually hitting . That is to say, the limit will equal for non-integers.
- We’ve basically created an indicator function for integers:
- Now we can rewrite the Dirichlet function in terms of this function:
- This is the especially cool part: we can show that if is rational, then is an integer. If we let approach , then we have a product of all positive integers multiplied by the input . If is rational, then can be written as a fraction of integers where and are integers. The will then cancel with one of the integers in the factorial, thus making the whole product an integer. In the other case — where is irrational — this won’t happen, and will not be an integer.
- Visually, for big enough, we have that
- Now if we plug the either-integer-or-non-integer result into our function, what results is an indicator function for rationality — the Dirichlet function.