Uniform step approximation of a continuous function on a compact interval (source code)

= Uniform step approximation of a continuous function on a compact interval

A <continuous function> on a <compact interval> is <uniformly continuous> by the <Heine-Cantor theorem>. Choose a <partition of an interval> whose widths lie below the input tolerance for a desired output error $\varepsilon$. On each half-open partition subinterval, use the value of the <function> at its left endpoint, and assign the rightmost endpoint its own value. This defines a <step function> whose error is strictly below $\varepsilon$ at every input. Finitely assigned partition-point values are allowed and do not alter the <Riemann integral>.