To define relations on sets we must have a concept of an ordered pair, as opposed to the unordered pairs the axiom of pair gives. To have a rigorous definition of ordered pair, we aim to satisfy one important property, namely, for sets a,b,c and d, .
As it stands, there are many ways to define an ordered pair to satisfy this property. A simple definition, then is . (This is true simply by definition. It is a convention that we can usefully build upon, and has no deeper significance.)
If and , then .
Now, if then . Then , so and .
So we have . Thus meaning .
A function may be defined as a particular type of relation. We define a partial function as some mapping from a set to another set that assigns to each no more than one. Alternatively, f is a function if and only if
If for each , assigns exactly one, then is called a function. The following definitions are commonly used when discussing functions.
If and is a function, then we can denote this by writing . The set is known as the domain and the set is known as the codomain.
For a function , the image of an element is such that . Alternatively, we can say that is the value of evaluated at .
For a function , the image of a subset of is the set . This set is denoted by . Be careful not to confuse this with for , which is an element of .
The range of a function is , or all of the values where we can find an such that .
For a function , the preimage of a subset of is the set . This is denoted by .
A function is onto, or surjective, if for each exists such that . It is easy to show that a function is surjective if and only if its codomain is equal to its range. It is one-to-one, or injective, if different elements of are mapped to different elements of , that is . A function that is both injective and surjective is intuitively termed bijective.
If there exists a function such that for , , we call a left inverse of . If a left inverse for exists, we say that is left invertible. Similarly, if there exists a function such that then we call a right inverse of . If such an exists, we say that is right invertible. If there exists an element which is both a left and right inverse of , we say that such an element is the inverse of and denote it by . Be careful not to confuse this with the preimage of f; the preimage of f always exists while the inverse may not. Proof of the following theorems is left as an exercise to the reader.
Theorem: If a function has both a left inverse and a right inverse , then .
Theorem: A function is invertible if and only if it is bijective.