Definition of Functions
Definition§
A function is a special type of relation between two sets and . A relation from to is called a function if every element of set has exactly one image in set under .
Thus, a relation is a function if it satisfies the following two conditions:
-
Every element of is related to an element in :
This means no element of is left without a corresponding element in .
-
Each element of is related to exactly one element in :
This ensures that no element in has more than one image in . The relationship must be unique for every element in .



Functions as Mappings§
A function can be understood as a "rule" or "mapping" that assigns every element in the set (the domain) to exactly one element in the set (the codomain). This mapping ensures two critical conditions:
- Each element in must have a corresponding element in : No element in is left out.
- Each element in is mapped to exactly one element in : No element in is assigned multiple outputs in .
For example, consider as a set of students and as a set of grades in a subject. A function could represent the rule "assign the grade of each student in a subject." This ensures two things:
- Every student has a grade: No student is left without a grade, ensuring totality.
- Each student has exactly one grade: A student cannot have more than one grade for the same subject, ensuring uniqueness.

This way, the function clearly and unambiguously maps each student in to one and only one grade in . This structure avoids confusion and guarantees that every input has a well-defined and singular output.
Notation§
The notation of functions is different from that of general relations. If there is a relation from set to set , it is written as . However, for a function from to , we use arrow notation, writing . This explicitly shows that maps elements of (the domain) to elements of (the codomain).
How elements of and are related under can be described in many ways. If and are related by the function , we write:

This notation is intuitive— is the input we provide to , and is the output we obtain. The input is called the argument or input of , and the output is called the value or output of .
The rule that relates and in a function is often expressed as a mathematical equation, just like in relations. For example:
These equations define how the input is transformed into the output .
Consider the following example:
Let be a function from the set of natural numbers to , written as:
Suppose the rule for is . This means the output is the square of the input .
We can finally write,
, where iff . It can be read as, is a function from to , where is the output and is the input such that .
So,
or equivalently:
A function can also be written in these forms as in relations:
-
Set Builder Form:
The function can be expressed as a set of ordered pairs:
-
Roster Form:
Alternatively, can be written as:
In this form we expicitly show how inputs and outputs are paired. Here, each ordered pair specifies the input-output pair for . For example, a function from the set of students to a grades can be written as, .
Domain, Co-Domain and Range§
A function is a specific type of relation. While a general relation allows the domain to be the subset of the first set, consisting of all elements that have atleast one image in the second set, for a function , the domain is always the entire set . This requirement arises from the definition of a function, which states that every element of must have exactly one image in .
The domain of a function is the set from which all inputs are taken. Since each element of must have a corresponding output, the domain of a function is always itself. For example, consider , where . Here, the domain of is .
The codomain of a function is the set that contains all possible outputs. It represents the target set to which the function maps elements of the domain. However, not all elements of the codomain are necessarily outputs of the function. Only those values in that are actually mapped to by some element of form the range of the function.
The range of a function is the set of all actual outputs of the function for inputs in the domain. It is a subset of the codomain. For instance, consider , where . Here:
- The domain is .
- The codomain is , the set of integers.
- The range is , which are the actual outputs obtained from the elements in the domain.
The range of a function is always a subset of the codomain:
If the range equals the codomain, the function is said to be onto or surjective. Otherwise, there exist elements in the codomain that are not mapped to by the function.
For example, in the function , defined above, the range is , which is strictly smaller than the codomain . This shows that is not onto.
The distinction between codomain and range is important. The codomain is part of the function's definition and represents all possible outputs, while the range depends on the actual mappings and consists of the values that are achieved.
Natural Domain or Exhaustive Domain of an Expression and a Function§
Functions are defined using mathematical expressions, but not all such expressions are valid for all real values of . The natural domain or exhaustive domain of an expression refers to the largest subset of real numbers for which the expression remains valid and well-defined. If we define a function using some mathematical expression, then we say that the natural domain of is the natural domain of the correspoding expression.
For example:
- Consider the expression . Division by zero is undefined, so this expression is not valid for . Hence, its natural domain is , meaning all real numbers except .
- Similarly, for the square root expression , the square root of a negative number is not defined in the set of real numbers. Therefore, the natural domain of is , which includes all non-negative real numbers.
When a function is defined using such an expression, the natural domain of the function is limited by the conditions of the expression. For example:
- If , the natural domain of is .
- If , the natural domain of is .
Example 1
Find the natural domain of .
Here:
- The square root is undefined for , so .
- Division by zero is also undefined, so , which means .
Hence, the natural domain of is , or all positive real numbers.
Example 2
Find the natural domain of .
Here:
- The square root is defined only when , which simplifies to .
- Therefore, the natural domain of is , the interval where is non-negative.
Restricted Domain§
The restricted domain of a function is defined when we intentionally limit the domain of the function to a proper subset of its natural domain. This is done to achieve specific properties or focus on a certain range of inputs.
For example:
- Consider , which has a natural domain of . If we restrict the domain to , the function now operates only on the interval . Here, is the restricted domain.
- Similarly, consider , which has a natural domain of all real numbers . If we restrict the domain to , the sine function is now evaluated only on that interval.
How is codomain of a fucntion decided?§
Given the domain of a function, the codomain is chosen so that it is "large enough" to include all possible outputs (the range) of the function. In other words, the range of a function must always be a subset of its codomain. This ensures that every output the function produces is well-defined within the context of the codomain.
For example, if a function produces only integers as outputs, then (the set of integers) is a natural and optimal choice for the codomain. Choosing (the set of real numbers) in this case would be unnecessary and excessive, as it includes many values the function can never produce, such as non-integers. However, if the function can produce any real number, then is the appropriate choice because it accurately reflects the range of possible outputs.
The main idea when deciding the codomain is to balance precision and practicality. The codomain should be broad enough to fully contain the range but not unnecessarily large to include elements that are irrelevant to the function. This consideration is part of the function's definition and helps provide clarity about its behavior and purpose in the given context.
Example 1:
Define , .
- The codomain is because it is specified during the definition.
- The range of the function is , which is the set of actual outputs.
Example 2:
Define , .
- Here, the codomain is (non-negative real numbers), which is more aligned with the function's behavior.
- The range is still , and in this case, it equals the codomain.
Explicit vs Implicit Definition of a Function§
A function can be defined either explicitly or implicitly, depending on how the relationship between the independent and dependent variables is expressed.
Explicit Definition§
A function is said to be explicitly defined when the dependent variable (typically ) is expressed directly as a formula in terms of the independent variable (typically ). For example:
Explicit definitions are straightforward, as the dependent variable is given directly without additional constraints.
Implicit Definition§
A function is said to be implicitly defined when the relationship between the independent and dependent variables is expressed as an equation that they satisfy together. In this case, the function may not be expressed directly in terms of one variable. Instead, it is defined implicitly by an equation involving both variables.
For example:
Example:
Consider the equation:
where and .
-
Implicit Definition:
The equation above implicitly defines as a function of . The relationship between and is given indirectly through the equation, and finding for a given requires solving the equation:
-
Explicit Definition:
To define explicitly as a function of , we solve for in terms of :
Here, is explicitly given as a formula in terms of , and it can be evaluated directly for any in the domain.
Key Differences
- Implicit: The function is described indirectly by an equation involving both and . For example, implicitly defines as a function of .
- Explicit: The function is expressed directly in terms of . For example, .
Implicit definitions are often useful for describing complex relationships or curves, while explicit definitions are more practical for computation and analysis.
Mark this section complete when you have worked through its proofs.