Definition. Function [009P]

Let A and B be sets. (Note: some books say nonempty sets, but there’s no particular reason to make this restriction!) A function f from A to B, written f : A \to B, is a relation from A to B such that every a \in A is related to exactly one b \in B.

A is called the domain of f and B is the codomain. We write f(a) = b to denote the unique element b \in B that is assigned to a.