Reason: Initial publication of the proof of the interval integration toolkit lemma.
Proof
Throughout, B, λ, B[a,b], λ[a,b], and zero extensions are as in the statement. We use that the Borel σ-algebra contains every open subset of R and, by closure of a σ-algebra under complements, every closed subset; in particular [a,b]∈B. We also record for repeated use the monotonicity of a measure: if E⊆F are members of a σ-algebra on which μ is a measure, then μ(E)≤μ(F), since μ(F)=μ(E)+μ(F∖E) by additivity, with nonnegative terms.
Claim 1. Every member of B[a,b] has the form S∩[a,b] with S∈B and hence lies in B, being an intersection of two members of B. The collection B[a,b] is a σ-algebra on [a,b]: it contains [a,b]=R∩[a,b]; if E=S∩[a,b] then [a,b]∖E=(R∖S)∩[a,b]∈B[a,b]; and if En=Sn∩[a,b] for n∈N then ⋃nEn=(⋃nSn)∩[a,b]∈B[a,b]. The set function λ[a,b] is a measure: λ[a,b](∅)=λ(∅)=0, and for pairwise disjoint En∈B[a,b]⊆B, countable additivity of λ gives λ[a,b](⋃nEn)=∑nλ[a,b](En). By claim 4 of Existence of Lebesgue Measure on the Real Line, λ([a,b])=b−a. Finally, multiplying a measure by the positive constant (b−a)−1 preserves μ(∅)=0 and countable additivity, and gives total mass (b−a)−1(b−a)=1, so ([a,b],B[a,b],(b−a)−1λ[a,b]) is a probability space.
We record a scaling identity used below: for every constant c>0, every B[a,b]-measurable h:[a,b]→[0,∞] satisfies ∫hd(cλ[a,b])=c∫hdλ[a,b]. Indeed, by Simple Function and Its Integral the integral of a simple functions=∑ici1Ai with respect to cλ[a,b] is ∑icicλ[a,b](Ai), which is c times its integral with respect to λ[a,b]; the class of simple functions below h is the same for both measures, and the supremum defining the integral scales by c.
Claim 2. Let f:[a,b]→[0,∞] and let A be a Borel subset of [0,∞] in the sense of Lebesgue Integral of a Nonnegative Measurable Function. If 0∈/A then f~−1(A)=f−1(A), and if 0∈A then f~−1(A)=f−1(A)∪(R∖[a,b]). If f is B[a,b]-measurable then f−1(A)∈B[a,b]⊆B and R∖[a,b]∈B, so f~ is B-measurable. Conversely, if f~ is B-measurable then f−1(A)=f~−1(A)∩[a,b]∈B[a,b].
For the integrals, we set up a correspondence of simple functions. If s is a simple function on ([a,b],B[a,b]) with s≤f, its zero extension s~ is simple on (R,B) with s~≤f~, and by Simple Function and Its Integral the two integrals agree, the added value 0 on R∖[a,b] contributing 0 by the convention 0⋅∞=0 of Measure, Measure Space, and Probability Measure. Conversely, if s′ is simple on (R,B) with s′≤f~, then s′=0 on R∖[a,b] because f~=0 there and s′≥0; hence s′ is the zero extension of its restriction to [a,b], which is simple with s′↾[a,b]≤f and has the same integral. The two suprema in Lebesgue Integral of a Nonnegative Measurable Function therefore coincide, which is the asserted equality. For real-valued f, apply the above to the positive and negative parts, noting (f+)=(f~)+ and (f−)=(f~)−, and use Integrable Function and the Lebesgue Integral.
Claim 4. Work on the probability space ([a,b],B[a,b],Q) of claim 1, Q:=(b−a)−1λ[a,b], and write EQ for its expectation. By the scaling identity, EQ[f2]=(b−a)−1∫[a,b]f2dλ[a,b]<∞ and likewise for g, so f and g are square-integrable random variables on this space. By Square-Integrable Random Variables and the Mean-Square Inner Product the product fg is Q-integrable, hence λ[a,b]-integrable by the scaling identity applied to (fg)±, and claim 1 of Cauchy-Schwarz and Triangle Inequalities for the Mean-Square Norm gives EQ[fg]2≤EQ[f2]EQ[g2]. Multiplying both sides by (b−a)2 and using the scaling identity again yields the stated inequality. For the final assertion take g=1, which is measurable with ∫[a,b]g2dλ[a,b]=b−a, and replace f by ∣f∣, which satisfies ∣f∣2=f2 and is measurable: for a Borel set A⊆R,
∣f∣−1(A)=f−1((A∩[0,∞))∪(−(A∩(0,∞)))),
and −B:={−x:x∈B} is Borel for every Borel B, because the collection of sets B with −B∈B is a σ-algebra containing all open sets (the reflection of an open set is open).
Claim 5. On the probability space of claim 1, f≥0 is a random variable with EQ[f]=(b−a)−1⋅0=0 by the scaling identity. For every n≥1, Markov's inequality (Markov's and Chebyshev's Inequalities) gives Q(f≥1/n)≤nEQ[f]=0, so λ[a,b]({f≥1/n})=0. Since {f>0}=⋃n≥1{f≥1/n}, countable subadditivity gives λ[a,b]({f>0})=0; subadditivity follows from countable additivity by replacing An:={f≥1/n} with the disjoint sets Bn:=An∖⋃i<nAi and using λ[a,b](Bn)≤λ[a,b](An), which is the monotonicity recorded in the preamble.
Claim 6. Write N:=[a,b]∖D, so λ[a,b](N)=0. For each n the function hn:=fn1D is B[a,b]-measurable: for a Borel set A⊆[0,∞], its preimage is fn−1(A)∩D if 0∈/A and (fn−1(A)∩D)∪N if 0∈A, and both belong to B[a,b]. For every t∈[a,b] we have hn(t)→f(t): on D this is the hypothesis, and on N both sides are 0. Hence f=liminfnhn pointwise (nonnegative real-valued functions are in particular [0,∞]-valued), so f is measurable by Fatou's Lemma.
For the integral identity, let g:[a,b]→[0,∞] be measurable. As in the previous paragraph, g1D and g1N are measurable, and g=g1D+g1N pointwise, so by linearity of the integral of nonnegative measurable functions (Linearity and Monotonicity of the Lebesgue Integral) it suffices to show ∫[a,b]g1Ndλ[a,b]=0. Let s=∑ici1Ai be any simple function with 0≤s≤g1N, written with pairwise disjoint Ai and, discarding zero terms, with every ci>0. For t∈/N we have g1N(t)=0, so s(t)=0 and therefore Ai⊆N for every i; the monotonicity recorded in the preamble gives λ[a,b](Ai)=0, so the integral of s is 0. Taking the supremum over such s in Lebesgue Integral of a Nonnegative Measurable Function yields ∫[a,b]g1Ndλ[a,b]=0, as required.