Tutorials › Measure Theory › Lebesgue Integrals of Step Functions

Comparing Riemann and Lebesgue Integrals · Tutorial 316 of 798

Lebesgue Integrals of Step Functions

Learn to express a finite step function using interval and singleton indicators, and calculate its Lebesgue integral without letting endpoint conventions affect the answer.

Advanced 9 min read

What You'll Learn

  • Define a finite step function on a compact interval using a finite partition.
  • Represent its values on open subintervals and at partition points with indicator functions.
  • Compute its Lebesgue integral as a finite sum of values times interval lengths.
  • Verify why singleton endpoint contributions have measure zero.
  • Check that different endpoint conventions or endpoint values give the same integral.

Step Functions on a Finite Interval

A finite step function is constant between finitely many partition points. Its integral is therefore computed from finitely many interval lengths and constant values. The endpoint values require care: they are part of the function's pointwise definition, but each affects the function only on a singleton, whose Lebesgue measure is zero.

Fix real numbers \(a<b\). Throughout, the measure space is \(([a,b],\mathcal L|_{[a,b]},m)\), where \(\mathcal L|_{[a,b]}\) is the Lebesgue sigma-algebra restricted to \([a,b]\), and \(m\) is Lebesgue measure. The functions in this tutorial are real-valued. A finite step function is measurable, bounded, and Lebesgue integrable on this finite-measure space.

Definition: Choose a finite partition \(a=x_0<x_1<\cdots<x_n=b\). A function \(f:[a,b]\to\mathbb R\) is a finite step function for this partition if it is constant on each open interval \((x_{i-1},x_i)\), for \(1\le i\le n\). Its values at \(x_0,\ldots,x_n\) may be any real numbers, independently of the values on the open intervals.

Write \(c_i\) for the constant value on \((x_{i-1},x_i)\), and \(d_j=f(x_j)\) for the value at the partition point \(x_j\). With \(\chi_E\) denoting the indicator of a set \(E\), the function has the exact pointwise representation

$$ f=\sum_{i=1}^{n}c_i\chi_{(x_{i-1},x_i)} +\sum_{j=0}^{n}d_j\chi_{\{x_j\}}. $$

The open intervals and the singletons in this expression are disjoint and cover \([a,b]\). Thus the expression records every value of \(f\), including the partition-point values. It is a finite linear combination of interval indicators together with singleton indicators.

Why Endpoint Values Do Not Contribute

For every \(x\in[a,b]\), the singleton \(\{x\}\) has measure zero. Indeed, for every \(\varepsilon>0\), it is contained in an interval of length \(2\varepsilon\), so its Lebesgue outer measure is at most \(2\varepsilon\). Since this holds for every positive \(\varepsilon\), \(m(\{x\})=0\). Also, for \(u<v\), any choice of including or excluding the endpoints of an interval with endpoints \(u,v\) has no effect on its measure: the difference between such choices is contained in \(\{u,v\}\), a null set. Each such interval has measure \(v-u\).

Theorem: For a finite step function \(f\) on \([a,b]\) with partition \(a=x_0<\cdots<x_n=b\) and interval values \(c_i\), its Lebesgue integral is $$ \int_{[a,b]} f\,dm=\sum_{i=1}^{n}c_i(x_i-x_{i-1}). $$ The values of \(f\) at the finitely many partition points do not affect this integral.

Proof. The pointwise representation above expresses \(f\) as a finite sum of constant multiples of indicators of measurable sets. The integral of a constant multiple \(r\chi_E\), for \(r\in\mathbb R\) and measurable \(E\subseteq[a,b]\), is \(r\,m(E)\); finite additivity of the integral for integrable real-valued functions therefore gives $$ \int_{[a,b]}f\,dm =\sum_{i=1}^{n}c_i\,m((x_{i-1},x_i)) +\sum_{j=0}^{n}d_j\,m(\{x_j\}). $$ The interval measures are \(x_i-x_{i-1}\), and each singleton measure is zero. Substituting these values yields the formula. Since the terms involving the endpoint values \(d_j\) are all zero, changing those values leaves the integral unchanged. \(\square\)

The same conclusion can be stated for any two finite step functions on \([a,b]\) that agree except at finitely many points: their difference is supported on a finite union of singletons, and its integral is zero. Here “supported” means that the difference vanishes outside that union; it does not mean that the difference must vanish at the points in the union.

Worked Example: Different Values at Partition Points

On \([-1,2]\), let \(f\) have value \(2\) on \((-1,0)\), value \(-1\) on \((0,1)\), and value \(3\) on \((1,2)\). Set \(f(-1)=7\), \(f(0)=5\), \(f(1)=-4\), and \(f(2)=6\). Compute its Lebesgue integral.

The three open intervals each have length \(1\): \(0-(-1)=1\), \(1-0=1\), and \(2-1=1\). The theorem gives $$ \int_{[-1,2]} f\,dm =2\cdot1+(-1)\cdot1+3\cdot1 =2-1+3 =4. $$ The values \(7,5,-4,6\) occur only at the four partition points and contribute \(7\cdot0+5\cdot0+(-4)\cdot0+6\cdot0=0\).

Check: The positive interval contributions are \(2\cdot1=2\) and \(3\cdot1=3\), totaling \(5\); the negative contribution is \((-1)\cdot1=-1\). Thus \(5-1=4\), the same value as the formula. In particular, replacing all four partition-point values by \(0\) leaves the integral equal to \(4\).

Interval Indicators and Linear Combinations

Often a step function is presented directly as a finite linear combination of interval indicators, possibly with overlapping intervals or different endpoint conventions. The indicator of a set \(E\) is \(1\) on \(E\) and \(0\) outside \(E\). Since the integral is linear for finite sums of integrable real-valued functions, and an interval in \([a,b]\) has measure equal to its length regardless of whether its endpoints are included, we have the following formula.

Takeaway: If \(I_1,\ldots,I_k\) are intervals in \([a,b]\) and \(\alpha_1,\ldots,\alpha_k\in\mathbb R\), then $$ \int_{[a,b]}\left(\sum_{r=1}^{k}\alpha_r\chi_{I_r}\right)\,dm =\sum_{r=1}^{k}\alpha_r\,m(I_r). $$ Overlaps do not invalidate the formula: at an overlap, the function value is the sum of the coefficients of the intervals containing that point, and linearity accounts for those contributions.

Worked Example: Overlapping Interval Indicators

On \([0,3]\), define \(g=3\chi_{[0,2)}-2\chi_{[1,3]}\). Compute its integral first using linearity and then by dividing the domain into constant-value pieces.

The first interval has length \(2-0=2\), and the second has length \(3-1=2\). Therefore, $$ \int_{[0,3]}g\,dm =3\cdot2-2\cdot2 =6-4 =2. $$ For an independent calculation, on \((0,1)\) only the first indicator is \(1\), so \(g=3\). On \((1,2)\) both indicators are \(1\), so \(g=3-2=1\). On \((2,3)\) only the second indicator is \(1\), so \(g=-2\). Each of these intervals has length \(1\), and the values at \(0,1,2,3\) do not affect the integral. Hence the piecewise calculation is $$ 3\cdot1+1\cdot1+(-2)\cdot1=3+1-2=2. $$

Check: The direct interval calculation gives \(6-4=2\), while the disjoint-piece calculation gives \(3+1-2=2\). The agreement verifies the result even though the original intervals overlap.

Worked Example: Changing Endpoint Values

On \([0,4]\), let \(f\) equal \(1,0,-2,3\), respectively, on the open intervals \((0,1),(1,2),(2,3),(3,4)\). Let \(g\) have the same values on those open intervals but different arbitrary real values at \(0,1,2,3,4\). Find both integrals and compare them.

Each open interval has length \(1\), so $$ \int_{[0,4]}f\,dm =1\cdot1+0\cdot1+(-2)\cdot1+3\cdot1 =1+0-2+3 =2. $$ The function \(g\) has exactly the same four interval values, so applying the same formula gives $$ \int_{[0,4]}g\,dm =1\cdot1+0\cdot1+(-2)\cdot1+3\cdot1 =2. $$ The difference \(f-g\) is zero outside \(\{0,1,2,3,4\}\). That finite set has measure \(0+0+0+0+0=0\), so the integral of the difference is zero.

Check: The positive contributions total \(1\cdot1+3\cdot1=4\), and the negative contribution is \((-2)\cdot1=-2\); the zero-valued interval contributes \(0\cdot1=0\). Thus both integrals are \(4-2+0=2\), irrespective of the endpoint values.

A Common Endpoint Mistake

A frequent error is to treat an endpoint value as though it held on a whole interval. For example, suppose \(h:[0,1]\to\mathbb R\) is defined by \(h(0)=100\) and \(h(x)=0\) for every \(x\in(0,1]\). The incorrect calculation \(100\cdot1=100\) treats the value at \(0\) as if it were the constant value throughout \([0,1]\). But \(h=100\chi_{\{0\}}\), and \(m(\{0\})=0\), so $$ \int_{[0,1]}h\,dm=100\cdot m(\{0\})=100\cdot0=0. $$ The correction is to multiply each constant value by the measure of the set where that value actually occurs—not by the length of an interval that contains the point.

This calculation explains why open, closed, and half-open interval conventions give the same Lebesgue integral for a finite step function when they differ only at partition points. It does not say that the functions are pointwise equal: their endpoint values can differ. It says that they agree outside a finite null set, and their Lebesgue integrals are consequently equal. The finite formula is useful both for computing these integrals and for distinguishing the contribution of intervals from the irrelevant choices made at their endpoints.

Check Your Understanding

Use interval lengths and singleton measures to justify each answer.

  1. On \([0,3]\), a step function has values \(2,-1,4\) on \((0,1),(1,2),(2,3)\). What is its Lebesgue integral if its values at \(0,1,2,3\) are arbitrary?
  2. Write a pointwise indicator representation of a step function with value \(c_1\) on \((x_0,x_1)\), value \(c_2\) on \((x_1,x_2)\), and endpoint values \(d_0,d_1,d_2\).
  3. Compute the integral on \([0,4]\) of \(2\chi_{[0,3)}-\chi_{(1,4]}\), first by linearity and then by subdividing into constant-value pieces.
  4. Explain why changing a step function at finitely many partition points does not change its Lebesgue integral, even though the resulting functions need not be equal everywhere.
  5. Identify the error in claiming that a function equal to \(7\) at \(0\) and \(0\) elsewhere on \([0,1]\) has integral \(7\).