# Riemann Integral

• I
Let f(x) be a bounded continuous function on [0,1]. Let g(x)=f(x) on all rational points in [0,1]. Let g(x) be Riemann integrable on [0,1]. Does g(x)=f(x) almost everywhere in the interval? If so - proof? If not -counterexample.

Homework Helper
a riemann integrable function is continuous almost everywhere. if g is continuous at c, the value of g at c is determined by its values at all rational points. so....????

• StoneTemplePython and bhobba
Mentor
a riemann integrable function is continuous almost everywhere. if g is continuous at c, the value of g at c is determined by its values at all rational points. so....????

First I do not consider this homework and as a mentor I am discussing it now with the other mentors, but for now it will remain here. As is often the case MIT comes to the rescue:

Now the question is why is the Dirichlet Function not Riemann Integrable - but is Lebesgue Integrable? What condition of the theorem is broken?

Thanks
Bill

• FactChecker
Mentor
Ok maybe another hint - the rationals are dense in the reals.

Thanks
Bill

Gold Member
My apologies, @mathwonk, I just didn't look at the author of the OP.

I believe it's rigorous to recast the question into a comparison of $0 = f(x)-f(x)$ and $h(x) = g(x)-f(x)$, since sums of Riemann integrable(RI) functions are also RI and since continuous function are RI. Then one is basically deconstructing the proof of non-integrability of the Dirichlet function and its modified cousins as an RAA proof of the hypothesis.

...Now the question is why is the Dirichlet Function not Riemann Integrable - but is Lebesgue Integrable? What condition of the theorem is broken?

The problem with Riemann integrability of Dirichlet's function is in the necessary discretion in the evaluation of the function within the subintervals of the Riemann sums. Since both the rationals and irrationals are dense in the interval one can choose to only evaluate $f(x^*_k)$ at rational values or only evaluate at irrational values and you'd get non-convergence of the limits. By making measure the issue instead of density, Lebesgue integration circumvents this problem.

• bhobba
Mentor
Ok you almost got the answer of the original question. Since the rationals are dense in the reals and both functions are continuous let xn be a series of rationals that converge to any x then limit f(xn) = limit g(xn) (as they are the same at the rationals) hence f(x) = g(x) for all reals.and the functions are equal.

The Dirchlet function is the counter example to do you need continuity - its required. The Dirichlet function is continuous nowhere and has no Riemann integral (as you would expect if nowhere continuous) - specifically in every interval the supremum of f is 1 and the infimum is 0 therefore it is not Riemann integrable.

This leads directly to the Lebesgue Integral which can integrate the Dirichlet function, plus has all sorts of other neat features like Fubini and Dominated convergence. I don't know about others but once I learnt Lebesgue integration I forgot Riemann - I think everyone should know it. Its good old MIT to the rescue again:
https://math.mit.edu/~rbm/18-102-S14/Chapter2.pdf

Added later: Just as an overview of the above development of Lebesgue Integration - there are a few (all equivalent of course) - the above is a bit different and more related to distribution theory I am interested in. A function is of compact support if it is zero outside some interval. Consider all such continuous functions. Suppose a sequence of such functions f(n) are absolutely sumable then of course its normal sumable to f. f = ∑f(n) is Lebesgue integrable if ∑ ∫ |f(n)| < ∞. We then use the good old absolute sumable trick to define the Lebesgue integral ∑ ∫ |f(n)| + ∑ ∫ f(n) <= 2*∑ ∫ |f(n)|. That means ∑ ∫ |f(n)| + ∑ ∫ f(n) (sumed to k) is positive and increasing with k, plus is bounded above by 2*∑ ∫ |f(n)| so if k = ∞ ∑ ∫ |f(n)| + ∑ ∫ f(n) exists (least upper bound axiom) then ∑ ∫ f(n) is called the Lebesgue integral. It turns out its well defined, has nice properties including if a function is Riemann integrable it's Lebesgue integrate, dominant convergence applies and Fubini's theorem (look them up if you don't know them).

If you start doing some advanced things in math like Hilbert spaces, divergent series (doing that right now - its stranger than I at first thought - I thought it was just a different definition of convergence - its actually not - but the real answer lies not in Lebesgue integration, but in analytic continuation) and many other cool things you need it - the books all say - when we speak of Integral we mean Lebesgue integration

If you are really keen the best book I have seen on advanced calculus is Hubbard's:
http://matrixeditions.com/5thUnifiedApproach.html

Thanks
Bill

Last edited:
The original problem was not a homework problem! I deliberately made a point that it is Riemann integrable. I am well aware that if it was only Lebesgue integrable, then it would be obviously undecided to say g=f anywhere except at the rationals. My own thought about proving it true is to use the equivalence of Darboux and Riemann integrability and use upper Darboux and lower Darboux sums to squeeze g to the point where it equals f almost everywhere. I just am not sure how to flesh it out.

Homework Helper
can you show g=f wherever g is continuous? (assuming that for every point c of the domain, there is a sequence of rationals converging to c.)

Mentor
The original problem was not a homework problem! I deliberately made a point that it is Riemann integrable. I am well aware that if it was only Lebesgue integrable, then it would be obviously undecided to say g=f anywhere except at the rationals. My own thought about proving it true is to use the equivalence of Darboux and Riemann integrability and use upper Darboux and lower Darboux sums to squeeze g to the point where it equals f almost everywhere. I just am not sure how to flesh it out.

Ah - I see your issue now - you did not actually say g(x) was continuous - I assumed it due to its the usual case in Riemann integration. I will need to think a bit.

Added later: After bit of thought into the deep recesses of my memory I recalled Lebesgue had a theorem about Riemann integration and did a internet search to find it:
http://www.math.ru.nl/~mueger/Lebesgue.pdf

It says:
A function f : [a, b] → R is Riemann integrable iff it is bounded and the set S(f) = {x ∈ [a, b] | f is not continuous at x} has measure zero.

But wait - the Dirichlet function has that property - it is continuous at irrational points but discontinuous at the rationals - it would seem a counter example disproving the theorem. It has defeated me. Someone else with more knowledge needs to look at it I think.

I eagerly await the resolution.

Thanks
Bill

Last edited:
Mentor
can you show g=f wherever g is continuous? (assuming that for every point c of the domain, there is a sequence of rationals converging to c.)

Yes that is what I showed but forgot that the OP did not say g was continuous - just integrable. This one, as the above shows, is proving harder than I thought.

Thanks
Bill

Last edited:
Gold Member
But wait - the Dirichlet function has that property - it is continuous at irrational points but discontinuous at the rationals - it would seem a counter example disproving the theorem. It has defeated me. Someone else with more knowledge needs to look at it I think.

No, the Dirichlet function is discontinuous everywhere, since the rationals are dense.

• bhobba
It appears that the theorem about Lebesgue and Riemann integral should apply here. g is Riemann integrable therefore continuous almost everywhere. Since f=g on a dense set, while f is continuous, this should imply f=g almost everywhere. Is that a complete argument?

Homework Helper
remark: the dirichlet function cited here seems to be the one that equals 1/q at a rational with lowest vterm form p/q and = 0 at every irrational. it is continuous at all irrationals and hence is riemann integrable with integral zero over any finite interval.

the theorem that a bounded function is riemann integrable iff it has a set of discontinuities of measure zero was indeed stated by lebesgue, but the proof already appears in riemann's original paper (on the next page after) where he defined the riemann integral. i know this because it was my job to review the first english translation of riemann's works, so unlike most people i have actually read riemann's paper.

• lurflurf, bhobba and fresh_42
Gold Member
It appears that the theorem about Lebesgue and Riemann integral should apply here. g is Riemann integrable therefore continuous almost everywhere. Since f=g on a dense set, while f is continuous, this should imply f=g almost everywhere. Is that a complete argument?

I think taking @mathwonk's hint would make the argument crystal clear. That is: at points where g is continuous it must equal f.

Gold Member
A cool example: Let f be zero on the unit interval Let g be the function which is one on the Cantor set and zero on the rest of the unit interval. Since the Cantor set has measure zero, g is Riemann integrable and equals f almost everywhere,

Now let g be one on a Cantor set of positive measure - e.g by removing middle 1/4's rather than middle thirds. This is a again a closed set with empty interior but it has positive measure. g does not equal f a.e. and it is not Riemann integrable.

Last edited:
• bhobba
Homework Helper
Very nice!
[notice in lavinia's very nice example, that since the Cantor set is closed, the function that equals zero on its complement is continuous on that open complement. Since even the fat cantor set is nowhere dense, the function that equals 1 on it is discontinuous on it.

Actually, it seems one needs to be a little more careful in describing the fat cantor set example.
https://blogs.scientificamerican.com/roots-of-unity/a-few-of-my-favorite-spaces-fat-cantor-sets/]

Last edited:
• bhobba
A cool example: Let f be zero on the unit interval Let g be the function which is one on the Cantor set and zero on the rest of the unit interval. Since the Cantor set has measure zero, g is Riemann integrable and equals f almost everywhere,

Now let g be one on a Cantor set of positive measure - e.g by removing middle 1/4's the rather than middle thirds. This is a again a closed set with empty interior but it has positive measure. g does not equal f a.e. and it is not Riemann integrable.
I am somewhat lost here. The Riemann integral was defined before measure theory was invented, so talking about "measure zero" and "almost everywhere", while perfectly sensible when talking about Lebesgue integrals, makes no sense when talking about Riemann integrals. Just check out https://en.wikipedia.org/wiki/Riemann_integral.

Gold Member
Theorem. (Lebesgue’s Criterion for integrablility) Let f : [a, b] → R. Then,f is Riemann integrable if and only if f is bounded and the set of discontinuities of f has measure 0.

You can calculate the Riemann integral of the characteritic function of the Cantor set directly.

• bhobba
Mentor
The Riemann integral was defined before measure theory was invented,

Yes but its interpretation using measure theory had to await until it was mathematicaly defined and investigated.

Why I am sitting back and not commenting is I am hoping someone can explain how a function can be continuous at all on dense set of measure zero. There is obviously something in the wording of the theorem I quoted. The following theorem suggests the answer is no to the original question because of it only being defined on a set of measure zero - and the set is dense in the reals - A function f : [a, b] → R is Riemann integrate iff it is bounded and the set S(f) = {x ∈ [a, b] | f is not continuous at x} has measure zero. Yet the Dirichlet function is a counter example to that statement - as it must be if you think about it. Consider any partition - if the set is dense its maximum and minimum can always be different hence can not be Riemann Integrable. There is obviously something I am missing, something in the detail of the theorem. I am waiting for someone to spot it. If you studied the theorems proof and thought hard you could probably figure it out - but I do not feel like spending the time doing that. My feeling for what it is worth is its really saying one can ignore those values and make them anything you like to avoid the partition issue. But I do not know - its just a guess.

Thanks
Bill

Last edited:
Mentor
Think I may have got it - have a look at definition three where the Riemann Integral is defined:
A function f : [a, b] → R is Riemann integrable (on [a, b]) if there exists A ∈ R (easily seen to be unique) such that for every ε > 0 there is λ > 0 such that the Riemann sum σ(f; P, ξ) = Xf(ξi)∆xi satisfies |σ(f; P, ξ) − A| < ε whenever P is a partition with λ(P) < δ and ξi ∈ ∆i for all i = 1, . . . , n. In this case we write R b a f(x)dx = A.

That may not be the same as the usual one where one takes the minimum and maximum of an increasing partition and they converge to the same value:
https://www.math.ucdavis.edu/~hunter/m125b/ch1.pdf

Just a thought.

Thanks
Bill

Last edited:
Gold Member
Yes but its interpretation using measure theory had to await until it was mathematicaly defined and investigated.

Why I am sitting back and not commenting is I am hoping someone can explain how a function can be continuous at all on dense set of measure zero. There is obviously something in the wording of the theorem I quoted. The following theorem suggests the answer is no to the original question because of it only being defined on a set of measure zero - and the set is dense in the reals - A function f : [a, b] → R is Riemann integrate iff it is bounded and the set S(f) = {x ∈ [a, b] | f is not continuous at x} has measure zero. Yet the Dirichlet function is a counter example to that statement - as it must be if you think about it. Consider any partition - if the set is dense its maximum and minimum can always be different hence can not be Riemann Integrable. There is obviously something I am missing, something in the detail of the theorem. I am waiting for someone to spot it. If you studied the theorems proof and thought hard you could probably figure it out - but I do not feel like spending the time doing that. My feeling for what it is worth is its really saying one can ignore those values and make them anything you like to avoid the partition issue. But I do not know - its just a guess.

Thanks
Bill

If by the Dirichlet function you mean the function on the unit interval which is zero on the rationals and 1 on the irrationals then it is discontinuous at every point. So it is discontinuous on a set of measure 1 not zero.

The upper sums will always be 1 and the lower sums will always be 0.

The Lebesque integral of a positive function f is the supremum of the integrals of all "simple" functions that are bounded above by f. The Dirichlet function is the simple function which is zero on the rationals and 1 on the irrationals. Its Lebesque integral by definition is

0⋅measure(rationals) + 1⋅measure(irrationals) = 0⋅0 +1⋅1 = 1

The Riemann integral is defined by dividing the domain into finitely many disjoint intervals. The Lebesque integral is defined by dividing the domain into finitely many disjoint measurable subsets. A lower sum is a function that is bounded above by f and which is constant on each of the disjoint intervals. A simple function is a function that is bounded above by f and which is constant on each of the disjoint measurable subsets.

Every lower sum is also a simple function but not visa versa.

One can think of the Lebesque integral as dividing the y-axis up into disjoint intervals instead of the x-axis as in the Riemann integral.

Last edited:
• Svein
Mentor
So it is discontinuous on a set of measure 1 not zero

Can you expand on this please? I have proven myself in the deep past the rationals have measure 0 - and there are many proofs of that around eg (see example 2.3):
https://www.math.ucdavis.edu/~hunter/measure_theory/measure_notes_ch2.pdf

https://www.quora.com/Why-are-the-rational-numbers-dense-and-of-measure-zero-at-the-same-time

It seems counter intuitive,

Thanks
Bill

Mentor
So it is discontinuous on a set of measure 1 not zero

Can you expand on this please? I have proven myself in the deep past the rationals have measure 0 - and there are many proofs of that around but as mentioned in the link below: The measure of a point is zero and the rational number set is a countable union of point sets of measure zero so the whole thing has measure zero.

https://www.quora.com/Why-are-the-rational-numbers-dense-and-of-measure-zero-at-the-same-time

It seems counter intuitive.

Thanks
Bill

Gold Member
Can you expand on this please? I have proven myself in the deep past the rationals have measure 0 - and there are many proofs of that around but as mentioned in the link below: The measure of a point is zero and the rational number set is a countable union of point sets of measure zero so the whole thing has measure zero.

https://www.quora.com/Why-are-the-rational-numbers-dense-and-of-measure-zero-at-the-same-time

It seems counter intuitive.

Thanks
Bill

It is discontinuous on both the rationals and the irrationals. Every irrational is the limit of a Cauchy sequence of rationals. Every rational is the limit of a Cauchy sequence of irrationals. You do not need to know the measure of the rationals.

Every countable set has measure zero.

Mentor
It is discontinuous on both the rationals and the irrationals. Every irrational is the limit of a Cauchy sequence of rationals. Every rational is the limit of a Cauchy sequence of irrationals. You do not need to know the measure of the rationals.

Are you getting at the measure of the irrationals is 1 over the interval [0,1]. Sure. Are you saying if we do not define, or define it, at the rationals, it doesn't matter which, the measure of the real line between 0 and 1 is the measure of the irrationals ie one. Again sure - just different language to what I said before. But how does that resolve the original query. Under the usual definition of the Riemann Integral it means if it is discontinuous at the rationals it is not Riemann integrable. Thus one could say it cant be discontinuous at the rationals because its Riemann Integrable. - so my argument since the rationals are dense it must be continuous at those points - hence f=g? Have I got your argument correct?

My suspicion, and I have never seen a development along those lines, Riemann Integration can be defined in a more general way as detailed previously.

Thanks
Bill

Gold Member
Are you getting at the measure of the irrationals is 1 over the interval [0,1]. Sure. Are you saying if we do not define, or define it, at the rationals, it doesn't matter which, the measure of the real line between 0 and 1 is the measure of the irrationals ie one. Again sure - just different language to what I said before. But how does that resolve the original query. Under the usual definition of the Riemann Integral it means if it is discontinuous at the rationals it is not Riemann integrable. Thus one could say it cant be discontinuous at the rationals because its Riemann Integrable. - so my argument since the rationals are dense it must be continuous at those points - hence f=g? Have I got your argument correct?

My suspicion, and I have never seen a development along those lines, Riemann Integration can be defined in a more general way as detailed previously.

Thanks
Bill

The Dirichlet function is discontinuous on the entire interval not only the rationals. So it is not Riemann integrable. Every irrational is the limit of a Cauchy sequence of rationals and the limit of the Dirchlet function along this sequence is zero. But its value is 1 on every irrational so it is discontinuous at every irrational. This already means that it is not Riemann integrable. But it is also discontinuous on the rationals. Along any Cauchy sequence of irrationals that converges to a rational, the limit is 1, But the value of the Dirichlet function on each rational is zero. So the measure of the rationals doesn't come into the argument since the Dirichlet function is discontinuous everywhere.

The original post is answered with Mathwonk's hint which is that at points where g is continuous it must equal the function f. If g is Riemann integrable it is continuous except possibly on a set of measure zero. So it equals f almost everywhere. However g does not have to equal f exactly since for instance one can take g to be f everywhere except at a single irrational number.

Not sure if this is what you were asking.

Last edited:
• bhobba
Mentor
So the measure of the rationals doesn't come into the argument since the Dirichlet function is discontinuous everywhere.The original post is answered with Mathwonk's hint which is that at points where g is continuous it must equal the function f. If g is Riemann integrable it is continuous except possibly on a set of measure zero. So it equals f almost everywhere. However g does not have to equal f exactly since for instance one can take g to be f everywhere except at a single irrational number.

Got it.

Not sure if this is what you were asking.

Its cleared up now.

Thanks
Bill

Homework Helper
@Svein: Yes the history of lebesgue versus riemann integration is a little confusing. Let me try to clarify my claim that riemann actually proved "lebesgue's criterion" even before lebesgue stated it. Lebesgue indeed defined the concept of "measure zero" to mean a set that can be covered by a countable sequence of intervals whose total length is as small as desired, i.e. a set has measure zero if: given any epsilon e > 0, there is a countable union of intervals that cover the set, the sum of whose lengths is less than e.

there is however a related concept now called "content zero" which says that for every epsilon, there is a finite sequence of intervals that cover the set, and whose lengths total less than epsilon. Riemann proved that a function f is Riemann integrable if and only if for every epsilon, and every delta, there is a finite sequence of intervals, of total length less than epsilon, that cover the set where f has oscillation greater than delta. I.e. he proved, in modern language, that f is integrable iff for every delta, the set where f has oscillation greater than delta, has content zero. Since it is elementary that the set where f is discontinuous is the union over n of the sets where f has oscillation > 1/n, and since a countable union of sets of content zero trivially has measure zero, Riemann's criterion, although not stated using the word "measure", nonetheless trivially implies Lebesgue's criterion. Thus Lebesgue merely restated Riemann's criterion in a different wording, but offered no new insight whatsoever as to when a function is Riemann integrable.

This is apparently not widely understood, especially in the US, since Riemann's works were only recently translated into English, but I was fortunate enough to be the official reviewer of that translation for Math Reviews, hence was one of the first to read it. I have also seen Riemann's result misstated in some textbooks by apparent "experts". If you have any further interest, I invite you to read the English translation, or the original if you read German, for yourself. It is slow going, but very rewarding reading.

Indeed I have just read the wikipedia article you linked, and while in general wikipedia articles are not always reliable, this one does cite the original article of Riemann as follows:

......(On the concept of a definite integral and the extent of its validity), pages 101–103.

Notice the phrase "and the extent of its validity", (und den Umfang seiner Gultigkeit, for fresh, with apologies). That part is indeed the criterion I have stated as to exactly when the Riemann integral works. I have just now consulted the article itself again and noted for the first time, that Riemann also gives a criterion for an unbounded function to be integrated by taking limits.

Wow! I have very few calculus books left on my shelf but one that I have saved is the excellent one by the magnificent author Joseph Kitchen, Calculus of One Variable. I have consulted it just now on this topic and found for the first time ever, an author who is thoroughly familiar with exactly what I have just explained. On pages 357-362 Kitchen explains in detail Riemann's criterion for integrability, in exactly the language (of content) that I have used, and then proves (in about 8 lines, i.e. trivially) that it is equivalent to Lebesgue's criterion, (by exactly the same argument I myself gave when reading Riemann). Kitchen's book was published over 50 years ago(!), but apparently did not become a standard, as much as the other famous honors books from the 1960's by Spivak and Apostol.

As a personal note, Kitchen was an extremely popular instructor at Harvard when I was a freshman there in 1960-61, and I recall the reviews of his course were summarized roughly as follows: "A large minority of Professor Kitchen's students are convinced that he is God".

Remark: Although his discussion persuades me of his thorough familiarity with the work of Riemann, he gives no specific historical reference to either Riemann's or to Lebesgue's works for this criterion, except for using their names on the concepts.

Last edited:
• bhobba and fresh_42