# Elements of a function

A function, `f`, is a _functional_ and _serial_ **relation** that relates two sets A and B (which may be the same set).

The _source set_, `A`, is called the **domain** and the _target set_, `B`, is called the **codomain**.

A function `f` that associates _each element_ of the domain `A` to a _unique element_ of the codomain B may be specified by a **type signature**: `f : A -> B` which may be read "function f (goes) from A to B".

A function's _signature_ unambiguously specifies its domain and codomain, clearly indicating the domain over which the input variable ranges, as well as the codomain over which the output variable ranges (both indicate the domain of discurse).

In fact, the domain of a function may be derived from the set of a function by extracting the first components from all the ordered pairs, collecting them in a set (must be equal to the domain). The set that is obtain by gathering together all the second components of the ord pairs is called **range**.

Functions are usually modelled as unary taking and returning only one value.
