# Integral of $1$ minus Dirichlet's function

Suppose $f:[0,1] \to \mathbb R$ is defined as $$f(x) = \begin{cases} 1, &\text{if } x \text{ is irrational; and } \\ 0, &\text{if }x \text{ is rational}. \end{cases}$$

I know from Real Analysis that $\int_0^1 f =1$, but intuitively it seems that the "area under curve" is 0.

Is there some intuitive explanation as to why $\int_0^1 f =1$ (without using measure theory)?

-
Why do you find it intuitive that the area under the curve is 0? The function is 1 for almost all x values... – Jason DeVito Aug 24 '10 at 18:40
It seems that there is no area under the curve because there are no intervals, I, for which f(I) ={1}. – Digital Gal Aug 24 '10 at 18:46
Does your intuition suggest that both ∫fdx and ∫(1−f)dx are 0, but their sum is ∫dx = 1? – Rahul Aug 24 '10 at 18:58
How do you define $\int_0^1 f \, dx$ without Lebesgue measure? f is not Riemann integrable. – kennytm Aug 24 '10 at 19:01
Rahul, Yes intuitivly I would think both integrals would be 0, which contradicts the fact that the integral of sum is 1. – Digital Gal Aug 24 '10 at 19:01

Some of this answer is implicit in many people's comments, but let's make it explicit.

Here's a question. It seems to you that the area under the curve --- of Dirichelt's function --- is zero. But Dirichelt's function is not a "curve", precisely because it is discontinuous. What then do you mean?

Let's consider that idea of "under the curve", for some possible failures of intuition. If you take the phrase "under the curve" very seriously, you'll probably be thinking of something like the lower Darboux sum. This, indeed, is zero for any interval, because there is no space for any rectangles of finite width underneath "the curve". The problem is that the Darboux integral is not well-defined, because the upper Darboux sum for any interval is the length of the interval --- because the shortest rectangles of finite width which envelop the function are the rectangles of height 1.

Thus, Dirichlet's function is not integrable by techniques such as the Darboux integral, because the upper and lower Darboux sums do not coincide. Additional techniques are required --- such as measure theory --- to define the integral at all.

-

The rationals are a set of Lebesgue measure zero, so they don't impact the value of integrals.

Here's how you might see that. Start with an epsilon > 0. You can count the rationals, so put an interval of length epsilon/2 over the first rational. Put an interval of length epsilon/4 over the second rational, etc. You've created a sequence of intervals of total length epsilon that cover the rationals, so they must have measure less than epsilon. But epsilon was arbitrary, so they must have measure zero.

-
Thanks. I was hoping for an explaination that does not require measure theory. – Digital Gal Aug 24 '10 at 18:56
Since the integral is not Riemann integrable, but is Lebesgue integrable, I don't see how one can avoid some measure theory. The Lebesgue integral itself is inherently measure theoretic... – Jason DeVito Aug 24 '10 at 19:20
Thanks that answers my question – Digital Gal Aug 24 '10 at 19:50
You can avoid full-blown measure theory, only defining measure zero without defining measure in general. Spivak does that in his book Calculus on Manifolds. That way you get a theory more general than Riemann but not as general as Lebesgue. – John D. Cook Aug 24 '10 at 22:19