The main thing we want sets for is to have something for functions to go between:
For functions from some kind of numbers to some kind of numbers such a rule is often given by an expression telling how to compute the value of the function. Thus we can define a function
using an expression
, for instance. Not all functions (even ones from
to itself) have nice descriptions using expressions. Some will need verbal descriptions or may be defined piecewise. For instance, in integration theory the function
is an important example of a non-continuous function which is integrable.
Rules we would like to define functions from
to
may not actually give answers everywhere, so we may need to specify a smaller set as the domain in order to get a function. Technically these rules give a partial function from
to itself.
Functions from
to S are called sequences in S.
In calculus we often change the domain or codomain of a function so that it will have an inverse. This changes the function. Similarly, two functions which agree everywhere they are both defined need not be equal if one of them is defined at some points where the other is not.
If a function
is one-to-one and onto then it has an inverse under composition
.