# Step functions/Integral from above and from below/Section
## Definition

Let $I$ be a real interval with endpoints $a,b\in \mathbb {R}$. Then a function
    $t\colon I\longrightarrow \mathbb {R}$
is called a step function, if there exists a partition
    $a=a_{0}<a_{1}<a_{2}<\cdots <a_{n-1}<a_{n}=b\,$
of $I$ such that $t$ is constant
$]a_{i-1},a_{i}[$
This definition does not require a certain value at the partition points. We call the interval $]a_{i-1},a_{i}[$ the $i$-th interval of the partition, and $a_{i}-a_{i-1}$ is called the length of this interval. If the lengths of all intervals are constant, then the partition is called an equidistant partition.

## Definition

Let $I$ be a real interval with endpoints $a,b\in \mathbb {R}$, and let
    $t\colon I\longrightarrow \mathbb {R}$
denote a step function for the partition $a=a_{0}<a_{1}<a_{2}<\cdots <a_{n-1}<a_{n}=b$, with the values $t_{i}$, $i=1,\ldots ,n$. Then
    $T:=\sum _{i=1}^{n}t_{i}(a_{i}-a_{i-1})\,$
$t$
$I$
We denote the step integral also by $\int _{a}^{b}t(x)\,dx$. If we have an equidistant partition of interval length ${\frac {b-a}{n}}$, then the step integral equals ${\frac {b-a}{n}}{\left(\sum _{i=1}^{n}t_{i}\right)}$. The step integral does not depend on the partition chosen. As long as we have a step function with respect to the partition, one can pass to a refinement of the partition.

## Definition

Let $I$ denote a bounded interval, and let
    $f\colon I\longrightarrow \mathbb {R}$
denote a function. Then a step function
    $t\colon I\longrightarrow \mathbb {R}$
is called a step function from above for $f$, if $t(x)\geq f(x)$ holds for all $x\in I$. A step function
    $s\colon I\longrightarrow \mathbb {R}$
is called a step function from below for $f$, if $s(x)\leq f(x)$ holds for all
$x\in I$
A step function from above (below) for $f$ exists if and only if $f$ is bounded from above (from below).

## Definition

Let $I$ denote a bounded interval, and let
    $f\colon I\longrightarrow \mathbb {R}$
denote a function. For a step function from above
    $t\colon I\longrightarrow \mathbb {R}$
of $f$, with respect to the partition $a_{i}$, $i=0,\ldots ,n$, and values $t_{i}$, $i=1,\ldots ,n$, the step integral
    $T:=\sum _{i=1}^{n}t_{i}{\left(a_{i}-a_{i-1}\right)}\,$
$f$
$I$

## Definition

Let $I$ denote a bounded interval, and let
    $f\colon I\longrightarrow \mathbb {R}$
denote a function. For a step function from below
    $t\colon I\longrightarrow \mathbb {R}$
of $f$, with respect to the partition $a_{i}$, $i=0,\ldots ,n$, and values $s_{i}$, $i=1,\ldots ,n$, the step integral
    $S:=\sum _{i=1}^{n}s_{i}{\left(a_{i}-a_{i-1}\right)}\,$
$f$
$I$
Different step functions from above yield different step integrals from above.

## Definition

Let $I$ denote a bounded interval, and let
    $f\colon I\longrightarrow \mathbb {R}$
denote a function, which is bounded from above. Then the infimum of all step integrals of step functions from above
$f$
$f$

## Definition

Let $I$ denote a bounded interval, and let
    $f\colon I\longrightarrow \mathbb {R}$
denote a function, which is bounded from below. Then the supremum of all step integrals of step functions from below
$f$
$f$
The boundedness from below makes sure that there exists at all a step function from below, so that the set of step integrals from below is not empty. This condition alone does not guarantee that a supremum exists. However, if the function is bounded from both sides, then the upper integral and the lower integral exist. If a partition is given, then there exists a smallest step function from above (a largest from below) which is given by the suprema (infima) of the function on the intervals of the partition. For a continuous function on a closed interval, these are maxima and minima. To compute the integral, we have to look at all step functions for all partitions.