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.

Last updated