MatheramaMatherama
← Relations and Functions
Relations and Functions·Section 4·19 min read

Definition of Functions

Definition§

A function is a special type of relation between two sets AA and BB. A relation RR from AA to BB is called a function if every element of set AA has exactly one image in set BB under RR.

Thus, a relation is a function if it satisfies the following two conditions:

  1. Every element of AA is related to an element in BB:

    This means no element of AA is left without a corresponding element in BB.

  2. Each element of AA is related to exactly one element in BB:

    This ensures that no element in AA has more than one image in BB. The relationship must be unique for every element in AA.

Not a function

Not a function

Function mapping

Functions as Mappings§

A function can be understood as a "rule" or "mapping" that assigns every element in the set AA (the domain) to exactly one element in the set BB (the codomain). This mapping ensures two critical conditions:

  1. Each element in AA must have a corresponding element in BB: No element in AA is left out.
  2. Each element in AA is mapped to exactly one element in BB: No element in AA is assigned multiple outputs in BB.

For example, consider AA as a set of students and BB as a set of grades in a subject. A function f:A→Bf: A \to B 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.

A mapping from students to grades

This way, the function ff clearly and unambiguously maps each student in AA to one and only one grade in BB. 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 RR from set AA to set BB, it is written as R⊆A×BR \subseteq A \times B. However, for a function ff from AA to BB, we use arrow notation, writing f:A→Bf: A \to B. This explicitly shows that ff maps elements of AA (the domain) to elements of BB (the codomain).

How elements of AA and BB are related under ff can be described in many ways. If x∈Ax \in A and y∈By \in B are related by the function ff, we write:

y=f(x).y = f(x).

visualization of y=f(x)

This notation is intuitive—xx is the input we provide to ff, and yy is the output we obtain. The input xx is called the argument or input of ff, and the output yy is called the value or output of ff.

The rule that relates xx and yy in a function is often expressed as a mathematical equation, just like in relations. For example:

  • y=x2y = x^2
  • y=x+1y = x + 1

These equations define how the input xx is transformed into the output yy.

Consider the following example:

Let ff be a function from the set of natural numbers N\mathbb{N} to N\mathbb{N}, written as:

f:N→N.f: \mathbb{N} \to \mathbb{N}.

Suppose the rule for ff is y=f(x)  ⟺  y=x2y = f(x) \iff y = x^2. This means the output yy is the square of the input xx.

We can finally write,

f:N→Nf:\mathbb{N} \to \mathbb{N}, where y=f(x)y=f(x) iff y=x2y=x^2. It can be read as, ff is a function from N\mathbb{N} to N\mathbb{N}, where yy is the output and xx is the input such that y=x2y=x^2.

So,

f(1)=1,f(2)=4,f(3)=9,f(4)=16,…f(1) = 1, \quad f(2) = 4, \quad f(3) = 9, \quad f(4) = 16, \quad \dots

or equivalently:

1=f(1),4=f(2),9=f(3),16=f(4),…1 = f(1), \quad 4 = f(2), \quad 9 = f(3), \quad 16 = f(4), \quad \dots

A function can also be written in these forms as in relations:

  1. Set Builder Form:

    The function ff can be expressed as a set of ordered pairs:

    f={(x,y):x∈N,y∈N,y=x2}.f = \{(x, y) : x \in \mathbb{N}, y \in \mathbb{N}, y = x^2\}.
  2. Roster Form:

    Alternatively, ff can be written as:

    f={(1,1),(2,4),(3,9),(4,16),… }.f = \{(1, 1), (2, 4), (3, 9), (4, 16), \dots\}.

    In this form we expicitly show how inputs and outputs are paired. Here, each ordered pair (x,y)(x, y) specifies the input-output pair for ff. For example, a function gg from the set of students to a grades can be written as, {(john,A),(jessica,B),(tom,A),...}\{(\text{john}, A), (\text{jessica}, B), (\text{tom}, A), ...\}.

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 f:A→Bf: A \to B, the domain is always the entire set AA. This requirement arises from the definition of a function, which states that every element of AA must have exactly one image in BB.

The domain of a function is the set AA from which all inputs are taken. Since each element of AA must have a corresponding output, the domain of a function is always AA itself. For example, consider f:{1,2,3}→{1,2,3,4,5}f: \{1, 2, 3\} \to \{1, 2, 3, 4, 5\}, where f={(1,1),(2,4),(3,1)}f = \{(1, 1), (2, 4), (3, 1)\}. Here, the domain of ff is {1,2,3}\{1, 2, 3\}.

The codomain of a function is the set BB 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 BB that are actually mapped to by some element of AA 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 f:{1,2,3,4}→Zf: \{1, 2, 3, 4\} \to \mathbb{Z}, where f={(1,1),(2,4),(3,9),(4,16)}f = \{(1, 1), (2, 4), (3, 9), (4, 16)\}. Here:

  • The domain is {1,2,3,4}\{1, 2, 3, 4\}.
  • The codomain is Z\mathbb{Z}, the set of integers.
  • The range is {1,4,9,16}\{1, 4, 9, 16\}, which are the actual outputs obtained from the elements in the domain.

The range of a function is always a subset of the codomain:

Range⊆Codomain.\text{Range} \subseteq \text{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 f:{1,2,3,4}→Zf: \{1, 2, 3, 4\} \to \mathbb{Z}, defined above, the range is {1,4,9,16}\{1, 4, 9, 16\}, which is strictly smaller than the codomain Z\mathbb{Z}. This shows that ff 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 xx. 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 ff using some mathematical expression, then we say that the natural domain of ff is the natural domain of the correspoding expression.

For example:

  1. Consider the expression 1x\frac{1}{x}. Division by zero is undefined, so this expression is not valid for x=0x = 0. Hence, its natural domain is R∖{0}\mathbb{R} \setminus \{0\}, meaning all real numbers except 00.
  2. Similarly, for the square root expression x\sqrt{x}, the square root of a negative number is not defined in the set of real numbers. Therefore, the natural domain of x\sqrt{x} is [0,∞)[0, \infty), 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 f(x)=1xf(x) = \frac{1}{x}, the natural domain of ff is R∖{0}\mathbb{R} \setminus \{0\}.
  • If f(x)=xf(x) = \sqrt{x}, the natural domain of ff is [0,∞)[0, \infty).

Example 1

Find the natural domain of f(x)=1xf(x) = \frac{1}{\sqrt{x}}.

Here:

  1. The square root x\sqrt{x} is undefined for x<0x < 0, so x≥0x \geq 0.
  2. Division by zero is also undefined, so x≠0\sqrt{x} \neq 0, which means x>0x > 0.

Hence, the natural domain of f(x)f(x) is (0,∞)(0, \infty), or all positive real numbers.

Example 2

Find the natural domain of f(x)=1−x2f(x) = \sqrt{1 - x^2}.

Here:

  1. The square root 1−x2\sqrt{1 - x^2} is defined only when 1−x2≥01 - x^2 \geq 0, which simplifies to −1≤x≤1-1 \leq x \leq 1.
  2. Therefore, the natural domain of f(x)f(x) is [−1,1][-1, 1], the interval where 1−x21 - x^2 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 f(x)=xf(x) = \sqrt{x}, which has a natural domain of [0,∞)[0, \infty). If we restrict the domain to [0,10][0, 10], the function now operates only on the interval [0,10][0, 10]. Here, [0,10][0, 10] is the restricted domain.
  • Similarly, consider g(x)=sin⁡(x)g(x) = \sin(x), which has a natural domain of all real numbers R\mathbb{R}. If we restrict the domain to [0,π][0, \pi], 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 Z\mathbb{Z} (the set of integers) is a natural and optimal choice for the codomain. Choosing R\mathbb{R} (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 R\mathbb{R} 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 f:R→Rf: \mathbb{R} \to \mathbb{R}, f(x)=x2f(x) = x^2.

  • The codomain is R\mathbb{R} because it is specified during the definition.
  • The range of the function is [0,∞)[0, \infty), which is the set of actual outputs.

Example 2:

Define g:R→R+g: \mathbb{R} \to \mathbb{R}^+, g(x)=x2g(x) = x^2.

  • Here, the codomain is R+\mathbb{R}^+ (non-negative real numbers), which is more aligned with the function's behavior.
  • The range is still [0,∞)[0, \infty), 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 yy) is expressed directly as a formula in terms of the independent variable (typically xx). For example:

y=f(x).y = f(x).

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:

F(x,y)=0.F(x, y) = 0.

Example: f:[−1,1]→[0,∞), x2/3+y2/3=1f: [-1, 1] \to [0, \infty), \, x^{2/3} + y^{2/3} = 1

Consider the equation:

x2/3+y2/3=1,x^{2/3} + y^{2/3} = 1,

where x∈[−1,1]x \in [-1, 1] and y∈[0,∞)y \in [0, \infty).

  1. Implicit Definition:

    The equation above implicitly defines yy as a function of xx. The relationship between xx and yy is given indirectly through the equation, and finding yy for a given xx requires solving the equation:

    y2/3=1−x2/3,x∈[−1,1].y^{2/3} = 1 - x^{2/3}, \quad x \in [-1, 1].
  2. Explicit Definition:

    To define yy explicitly as a function of xx, we solve for yy in terms of xx:

    y=(1−x2/3)3/2,for x∈[−1,1].y = \left( 1 - x^{2/3} \right)^{3/2}, \quad \text{for } x \in [-1, 1].

    Here, yy is explicitly given as a formula in terms of xx, and it can be evaluated directly for any xx in the domain.


Key Differences

  • Implicit: The function is described indirectly by an equation involving both xx and yy. For example, x2/3+y2/3=1x^{2/3} + y^{2/3} = 1 implicitly defines yy as a function of xx.
  • Explicit: The function is expressed directly in terms of xx. For example, y=(1−x2/3)3/2y = \left( 1 - x^{2/3} \right)^{3/2}.

Implicit definitions are often useful for describing complex relationships or curves, while explicit definitions are more practical for computation and analysis.

Section 4 of 18 · Relations and Functions

Mark this section complete when you have worked through its proofs.