# 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.

## Answers and Replies

mathwonk
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
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
bhobba
Mentor
Ok maybe another hint - the rationals are dense in the reals.

Thanks
Bill

jambaugh
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
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.

mathwonk
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.)

bhobba
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:
bhobba
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:
jambaugh
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?

mathwonk
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
lavinia
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.

lavinia
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
mathwonk
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
Svein
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.

lavinia
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
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:
bhobba
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:
lavinia
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
bhobba
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

Others have wondered about this strange property as well - dense and of measure zero eg:
https://www.quora.com/Why-are-the-rational-numbers-dense-and-of-measure-zero-at-the-same-time

It seems counter intuitive,

Thanks
Bill

bhobba
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.

Others have wondered about this strange property as well - dense and of measure zero eg:
https://www.quora.com/Why-are-the-rational-numbers-dense-and-of-measure-zero-at-the-same-time

It seems counter intuitive.

Thanks
Bill

lavinia
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.

Others have wondered about this strange property as well - dense and of measure zero eg:
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.