Functions
In this article, we will go over what is a function and the different types of functions.
1 Terminologies
- A function from to , denoted as , is a relation from to that assigns each element of to exactly one element of .
- is called the domain of . The domain is the set of all inputs.
- is called the codomain of . The codomain is the set of all allowable outputs.
- If maps element to element , we write .
- If , is an image of and is a preimage of .
- The range of is the set of all images of elements in .
1. Identifying a function
2. Difference between codomain and range
2 One-to-one functions
A function is called one-to-one or injective if and only if implies for every , in the domain of . In other words, one-to-one functions never assign different elements in the domain to the same element in the codomain.
2.1 Proving injectivity
There are a few methods to check if a function is injective:
1. Arrow diagram
We can draw arrow diagrams that represents the mapping of the relations from the domain to codomain in order to determine if the function is injective or not. However, this method is very difficult to use when the domain and codomain is large.
2. Horizontal line test
This method is easy and convenient. All we have to do is draw a horizontal line through the graph of a function and if it intersects the graph only once, then the function is one-to-one as shown in the example below:
However, this method only works for graphs over real numbers.
3. Mathematical proof
This is the most commonly used method for proving injectivity as it is more general and straightforward.
Steps:
- Assume for all , in the domain.
- Some workings to show that
- Conclude that if , then is injective
Example:
3 Onto functions
A function is called onto or surjective if and only if for every element in the codomain, there is an element in the domain such that . In this case, the range of is equal to the codomain.
3.1 Proving surjectivity
There are also multiple ways to see if a function is surjective:
1. Arrow diagram
We can also use the arrow diagram method to prove surjectivity but same limitations apply.
2. Comparing range and codomain
If we are given a graph, the easiest way to determine surjectivity is to compare the range with the codomain. If they are the same, then the function is surjective.
3. Mathematical proof
The key to proving a surjection using the proof method is to figure out what we’re after then work backwards from there.
Example: Prove that f(x) = x - 8 is a surjective function for any integer x.
Assume for any , there exists an such that .
Then by definition of .
Hence for all , and is onto.
4 Bijective functions
A function is bijective if it is both injective and surjective. To prove the bijectivity of a function, we have to prove both injectivity and surjectivity. Here’s a diagram to summarise what we have learnt so far:
4.1 Functions and cardinality
Given that and are finite sets, the function is:
- injective if ,
- surjective if ,
- bijective if .
5 Inverse functions
Every bijection from set to set also has an inverse function.
- The inverse of the bijection is denoted as -1.
- The inverse function assigns an element to an element such that .
- A function that has an inverse is called an invertible function.
- A function is invertible if and only if it is bijective. This is because the inverse will not fulfil the criterias of a function if it is not both injective and surjective.
6 Function composition
Let be a function from to , and from to . The composition of and , denoted as , is defined by:
Example 1:
Let and be functions from to such that and .
Example 2:
Prove −1 , where is the identity function. The identify function for A, written as A: , is defined by A for all .
Note that A = .
−1 = −1
Let be .
Then, −1 = −1 .
By definition of inverse, −1 if and only if .
Thus, −1 = −1 = = A.