Simple Function

In mathematics, a simple function is a real- or complex-valued function over a subset of the real line.
They look similar to step functions, in that they have are defined everywhere on the domain subset (really???) and consist of flat lines with jumps.
They attain only a finite number of values (note this does not mean there are a finite number of subsets of the domain).
Note: important for the definition of the Lebesgue integral, since the simple function is a function, each point in the domain only maps to one point in the image, so that when defining the 'bars to add up' in the definition, there is no overlap.
== Definition ==
Let (S,\Sigma) be a measurable space, (A_i)_{i=1}^n \subset \Sigma be a sequence of disjoint measurable set, and (a_i)_{i=1}^na sequence of real or complex numbers. Then the function f:S \to \mathbb{C} is a simple function if it is of the form:
f(x) = \sum_{i=1}^n a_i \mathbf{1}_{A_i}(x)
where \mathbf{1}_{A_i}(x) is the indicator function of the set A_i.
== Integral of simple functions ==
If a measure \mu is defined on the measurable space (S,\Sigma), then the integral of f with respect to this measure is
\sum_{i=1}^n a_i \mu(A_i)
if all terms in the sum are finite.