MatheramaMatherama
← Relations and Functions
Relations and Functions·Section 11·21 min read

Types of Functions

We can divide all functions into two categories: injective (one-to-one) and non-injective (many-to-one), based on whether distinct inputs always produce distinct outputs. Injective functions ensure that no two different inputs map to the same output, while non-injective functions allow multiple inputs to share the same output.

one one

Independently, we can also classify functions into two categories: surjective (onto) and non-surjective (into), based on whether every element in the codomain is mapped by at least one element from the domain. Surjective functions cover the entire codomain, while non-surjective functions leave some elements in the codomain unmapped.

onto and into

Combining these two classifications, functions can be categorized into four distinct types:

  1. One-one onto (also called bijective): Functions that are both injective and surjective.
  2. One-one into: Functions that are injective but not surjective.
  3. Many-one onto: Functions that are surjective but not injective.
  4. Many-one into: Functions that are neither injective nor surjective.

alt text

Injective Function (One-to-One Function) vs Non-Injective Function (Many-to-One Function)§

A function f:A→Bf: A \to B is said to be injective (or a one-to-one function) if and only if:

f(x1)=f(x2)  ⟹  x1=x2for all x1,x2∈A.f(x_1) = f(x_2) \implies x_1 = x_2 \quad \text{for all } x_1, x_2 \in A.

This means that no two distinct elements in the domain AA can map to the same element in the codomain BB. The injectivity of a function ensures that the outputs of ff are unique for distinct inputs.

Logical Explanation:

If someone claims that the outputs of ff at x1x_1 and x2x_2 are equal (i.e., f(x1)=f(x2)f(x_1) = f(x_2)), then by the definition of injectivity, it must follow that x1=x2x_1 = x_2. In other words, if the outputs f(x1)f(x_1) and f(x2)f(x_2) are the same, the corresponding inputs x1x_1 and x2x_2 cannot be distinct—they must be equal.

Contrapositive:

An equivalent way of expressing injectivity is:

x1≠x2  ⟹  f(x1)≠f(x2).x_1 \neq x_2 \implies f(x_1) \neq f(x_2).

This means distinct inputs in AA must always map to distinct outputs in BB.

To understand, consider the following contrasting examples:

  1. Injective Function: f(x)=2xf(x) = 2x for x∈Rx \in \mathbb{R}:

    To prove injectivity, assume:

    f(x1)=f(x2).f(x_1) = f(x_2).

    This implies:

    2x1=2x2.2x_1 = 2x_2.

    Dividing through by 2, we get:

    x1=x2.x_1 = x_2.

    Hence, f(x)=2xf(x) = 2x is injective, as no two distinct inputs produce the same output.

  2. Non-Injective Function: f(x)=x2f(x) = x^2 for x∈Rx \in \mathbb{R}:

    To test injectivity, assume:

    f(x1)=f(x2).f(x_1) = f(x_2).

    This implies:

    x12=x22.x_1^2 = x_2^2.

    Taking square roots:

    x1=x2orx1=−x2.x_1 = x_2 \quad \text{or} \quad x_1 = -x_2.

    Since x1x_1 and x2x_2 can be distinct (x1=2x_1 = 2 and x2=−2x_2 = -2) but yield the same output (f(2)=f(−2)=4f(2) = f(-2) = 4), f(x)=x2f(x) = x^2 is not injective.

Horizontal Line Test for Injectivity§

The horizontal line test is a direct way to visually verify if a function f(x)f(x) is injective. It works as follows:

  • If any horizontal line drawn in the graph's range intersects the function's graph at most once, the function is injective.
  • If any horizontal line intersects the graph more than once, the function is not injective.

This test aligns with the formal definition of injectivity: if f(x1)=f(x2)f(x_1) = f(x_2), then x1=x2x_1 = x_2. A horizontal line intersecting the graph more than once indicates that there exist distinct x1x_1 and x2x_2 such that f(x1)=f(x2)f(x_1) = f(x_2), violating injectivity.

Proving injectivity using derivatives§

ignore this section till you complete application of derivatives

Proving injectivity using the definition f(x1)=f(x2)  ⟹  x1=x2f(x_1) = f(x_2) \implies x_1 = x_2 is mathematically rigorous and perfect. However, applying this method can become cumbersome and complex, especially for functions with intricate or non-trivial algebraic forms.

For most functions of our concern, calculus provides a more practical and efficient way to determine injectivity. A differentiable function (even if non-differentiable at some isolated points) is one-to-one if and only if it is strictly increasing or strictly decreasing on its entire domain. This condition eliminates the possibility of two distinct inputs mapping to the same output.

Key Criterion for Injectivity Using Calculus:

  1. A function f(x)f(x) is strictly increasing on an interval if:

    f′(x)≥0for all x in the interval, with equality occurring only at isolated points.f'(x) \geq 0 \quad \text{for all } x \text{ in the interval, with equality occurring only at isolated points.}

    This ensures that f(x)f(x) does not "flatten" over any subinterval (derivative is only zero at isolated points and not intervals) and it does not have any turnings, preventing multiple inputs from producing the same output.

  2. A function f(x)f(x) is strictly decreasing on an interval if:

    f′(x)≤0for all x in the interval, with equality occurring only at isolated points.f'(x) \leq 0 \quad \text{for all } x \text{ in the interval, with equality occurring only at isolated points.}

Many-One Function§

A function f:A→Bf: A \to B is said to be many-one if two or more distinct elements in the domain AA map to the same element in the codomain BB. This means the function violates injectivity.

Formally, ff is many-one if:

∃ x1,x2∈A, x1≠x2 such that f(x1)=f(x2).\exists \, x_1, x_2 \in A, \, x_1 \neq x_2 \text{ such that } f(x_1) = f(x_2).

Graphical Representation of a Many-One Function:

On the graph of a many-one function, some horizontal lines intersect the curve more than once. This visually confirms that multiple inputs in the domain correspond to the same output.

Onto or Surjective Function§

A function ff defined from set AA to set BB is said to be onto or surjective if and only if every element of the codomain BB has at least one preimage in the domain AA. Formally, f:A→Bf : A \to B is surjective if:

∀b∈B, ∃a∈A such that f(a)=b.\forall b \in B, \ \exists a \in A \ \text{such that} \ f(a) = b.

For every element bb in the codomain BB, there exists at least one element aa in the domain AA such that the function ff maps aa to bb. In other words, for a function to be surjective, every element in the codomain must be the output of the function for at least one input from the domain.

This means that no element in the codomain is "unreachable" by the function. If even a single element in the codomain does not correspond to any input from the domain, the function is not surjective.

To understand surjectivity intuitively, imagine a mapping from one set to another. If every element in the codomain BB is hit by at least one arrow from the domain AA, the function is surjective. However, if there exists even a single element in BB that is not reached by any element in AA, the function is not surjective.

Graphically, surjective functions correspond to mappings where the codomain and range coincide. In other words, no part of the codomain is "left out."

Proving a Function is Onto§

Theoretical Approach

The most direct method to prove a function is surjective is to verify that for every b∈Bb \in B, there exists at least one a∈Aa \in A such that f(a)=bf(a) = b. This method involves solving f(a)=bf(a) = b for aa in terms of bb and confirming that aa belongs to the domain.

For example, consider the function f:R→Rf : \mathbb{R} \to \mathbb{R} defined by:

f(x)=3x+4.f(x) = 3x + 4.

To check if f(x)f(x) is surjective, we need to verify whether every b∈Rb \in \mathbb{R} has a corresponding x∈Rx \in \mathbb{R} such that f(x)=bf(x) = b. Assume f(x)=bf(x) = b:

b=3x+4.b = 3x + 4.

Solving for xx, we get:

x=b−43.x = \frac{b - 4}{3}.

Since x∈Rx \in \mathbb{R}, this confirms that for every b∈Rb \in \mathbb{R}, there exists an x∈Rx \in \mathbb{R} such that f(x)=bf(x) = b. Hence, f(x)f(x) is surjective.

In contrast to the above example, consider the following example:

Consider f:Z→Zf : \mathbb{Z} \to \mathbb{Z} such that f(x)=3x+4f(x) = 3x + 4. We will prove that ff is not an onto function.

Let b∈codomain(f)b \in \text{codomain}(f), i.e., b∈Zb \in \mathbb{Z}. Then we solve the equation:

b=3x+4  ⟹  x=b−43.b = 3x + 4 \implies x = \frac{b - 4}{3}.

For f(x)f(x) to be surjective, xx must be an integer (x∈Zx \in \mathbb{Z}) for every b∈Zb \in \mathbb{Z}. However, b−43\frac{b - 4}{3} is not necessarily an integer for all b∈Zb \in \mathbb{Z}.

For example, if b=5b = 5, we have:

x=5−43=13.x = \frac{5 - 4}{3} = \frac{1}{3}.

Here, xx is not an integer (x∉Zx \notin \mathbb{Z}), which means that b=5b = 5 has no preimage in the domain Z\mathbb{Z}. Thus, f(x)f(x) is not surjective.

Similarly, if b=7b = 7, we calculate:

x=7−43=33=1.x = \frac{7 - 4}{3} = \frac{3}{3} = 1.

Here, xx is an integer, so b=7b = 7 has a preimage. However, since not every b∈Zb \in \mathbb{Z} satisfies this condition (as seen with b=5b = 5), the function is not onto.

Range-Based Approach

Another method to determine whether a function is surjective involves calculating its range and comparing it to its codomain. If the range equals the codomain, the function is surjective. If the range is a proper subset of the codomain, the function is not surjective.

For instance, consider the function f:R→Rf : \mathbb{R} \to \mathbb{R} defined by:

f(x)=x2+2x4+x2+1.f(x) = \frac{x^2 + 2}{x^4 + x^2 + 1}.

Here, observe that x2+2>0x^2 + 2 > 0 and x4+x2+1>0x^4 + x^2 + 1 > 0 for all x∈Rx \in \mathbb{R}. Thus, f(x)>0f(x) > 0 for all x∈Rx \in \mathbb{R}. This implies that the range of f(x)f(x) consists only of positive values, which is a proper subset of R\mathbb{R} (the codomain). Therefore, f(x)f(x) is not surjective.

In some cases, we may not need to explicitly calculate the entire range. A qualitative understanding of the function's behavior can often suffice. For example, if the function f(x)f(x) cannot produce certain values in the codomain due to its structure, we can directly conclude that it is not surjective.

Non-Surjective (Into) Function§

A function f:A→Bf : A \to B is said to be non-surjective (or into) if there exists at least one element in the codomain BB that is not the image of any element in the domain AA. In other words, the range of the function is a proper subset of the codomain.

Consider the function f:R→Rf : \mathbb{R} \to \mathbb{R} defined as f(x)=1−x2f(x) = 1 - x^2. The domain is R\mathbb{R}, and the codomain is also R\mathbb{R}. To determine whether f(x)f(x) is surjective, we calculate the range of f(x)f(x).

The function f(x)=1−x2f(x) = 1 - x^2 involves the square of xx, which satisfies x2≥0x^2 \geq 0 for all x∈Rx \in \mathbb{R}. Thus, −x2≤0-x^2 \leq 0, and adding 1 gives f(x)=1−x2≤1f(x) = 1 - x^2 \leq 1. Therefore, the output of f(x)f(x) satisfies:

f(x)∈(−∞,1].f(x) \in (-\infty, 1].

The range of f(x)f(x) is (−∞,1](-\infty, 1], which is the set of all real numbers less than or equal to 1. However, the codomain is R\mathbb{R}, which includes all real numbers. Clearly, there are elements in the codomain, such as 22 or 33, that are not in the range of f(x)f(x). For example, there does not exist any x∈Rx \in \mathbb{R} such that f(x)=2f(x) = 2, because f(x)=1−x2≤1f(x) = 1 - x^2 \leq 1 for all xx.

Since the range (−∞,1](-\infty, 1] is strictly smaller than the codomain R\mathbb{R}, the function f(x)=1−x2f(x) = 1 - x^2 is not surjective. Thus, it is a non-surjective (into) function.

Bijective Function§

A function f:A→Bf : A \to B is said to be bijective if it is both injective (one-to-one) and surjective (onto). In simpler terms, a bijective function establishes a perfect "pairing" between elements of the domain AA and elements of the codomain BB, such that every element in BB is mapped to by exactly one element in AA.

Formally:

  1. Injectivity ensures that no two distinct elements in AA are mapped to the same element in BB.
  2. Surjectivity ensures that every element in BB has at least one preimage in AA.
Section 11 of 18 · Relations and Functions

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