Types of Functions
A function is a special type of relation that assigns to every element in its domain exactly one element in its codomain. Once we accept this definition, a natural next question arises: are all functions 'the same shape'? The answer is no — functions can behave very differently depending on how their inputs and outputs relate to each other. Classifying functions into types gives us a precise language to describe these behaviours and is essential for topics ranging from inverse functions to calculus. The main classifications you will encounter are: one-one (injective) functions, onto (surjective) functions, many-one functions, and bijective functions (which are both one-one and onto). Each classification focuses on a specific question: do two different inputs ever produce the same output? Does every possible output actually get 'hit' by some input? Answering these questions tells us a great deal about the structure of the function. Understanding these types is not merely an academic exercise. In cryptography, bijective functions are used to encode and decode messages reliably. In counting and combinatorics, injections and surjections count the ways objects can be assigned to boxes. In analysis, only bijective functions have true inverses. By the end of this article you will be able to identify, prove, and apply each type confidently.
- One-One (Injective) Functions
- Many-One Functions
- Onto (Surjective) Functions
- Into Functions
- Bijective Functions (One-One and Onto)
- Constant Functions
One-One (Injective) Functions
A function f : A → B is called one-one (or injective) if distinct elements of A always map to distinct elements of B. Formally: if f(x₁) = f(x₂) then x₁ = x₂, equivalently if x₁ ≠ x₂ then f(x₁) ≠ f(x₂). Example: f(x) = 3x + 1 on ℝ is one-one because if 3x₁ + 1 = 3x₂ + 1 then x₁ = x₂. On a graph, a function is one-one if and only if every horizontal line crosses the graph at most once (Horizontal Line Test).
Many-One Functions
A function f : A → B is many-one if at least two distinct elements of A share the same image in B. That is, there exist x₁ ≠ x₂ in A with f(x₁) = f(x₂). Example: f(x) = x² on ℝ is many-one because f(2) = f(−2) = 4. Trigonometric functions like sin x and cos x are also many-one over ℝ. A many-one function fails the Horizontal Line Test — some horizontal line cuts the graph more than once. Many-one functions do NOT have inverses unless their domain is restricted.
Onto (Surjective) Functions
A function f : A → B is onto (or surjective) if every element b ∈ B is the image of at least one element a ∈ A. Formally: for every b ∈ B there exists a ∈ A such that f(a) = b. The range of f equals its entire codomain B. Example: f(x) = 2x − 1 from ℝ to ℝ is onto because for any y ∈ ℝ we can solve: a = (y + 1)/2 ∈ ℝ, and f(a) = y. However, f(x) = x² from ℝ to ℝ is NOT onto because negative numbers are never outputs.
Into Functions
A function f : A → B is called into if it is NOT onto, meaning its range is a proper subset of B. At least one element of B is never mapped to by any element of A. Example: f(x) = x² from ℝ to ℝ is into because the range is [0, ∞) ⊊ ℝ. Note that every function is either onto or into — these are complementary categories. The distinction matters when asking whether an equation f(x) = c always has a solution.
Bijective Functions (One-One and Onto)
A function f : A → B is bijective if it is both injective and surjective simultaneously. Every element of B is the image of exactly one element of A — perfect pairing with no element left out and no element matched twice. Example: f(x) = 5x − 3 from ℝ to ℝ is bijective. Bijective functions always have a well-defined inverse function f⁻¹ : B → A. If A and B are finite sets, bijectivity implies |A| = |B|. The identity function f(x) = x is always bijective on any set.
Constant Functions
A constant function maps every element of A to the same single element c ∈ B: f(x) = c for all x ∈ A. If |A| > 1, a constant function is always many-one (all inputs share one output). It is onto only when |B| = 1. Its graph is a horizontal line. Although simple, constant functions appear naturally as limiting cases and in piecewise definitions.
The Key Equation
- f — Function (none): The rule assigning each element of A to an element of B
- A — Domain (none): The set of all valid inputs for the function
- B — Codomain (none): The set containing all possible outputs (the target set)
- x_1, x_2 — Input elements (none): Arbitrary elements chosen from the domain A
- \implies — Implies (none): Logical implication — if the left side is true, so is the right side
Worked Example
Problem. Let f : ℝ → ℝ be defined by f(x) = 2x² − 3. Determine whether f is (a) one-one, (b) onto.
Answer. f is many-one and into (neither injective nor surjective over ℝ).
Origins · 1 minPeter Gustav Lejeune Dirichlet and how this was discovered
Dirichlet gave the modern rigorous definition of a function in 1837, replacing the vague notion of a 'formula' with the precise idea of a correspondence between two sets of numbers. His definition — that y is a function of x if to every value of x in an interval there corresponds a definite value of y — is essentially the definition we still use today. This laid the groundwork for classifying functions by their input-output behaviour, making the study of function types possible. Dirichlet was so quiet and modest that his colleagues joked he could not even say 'yes' or 'no' without writing it down first, yet he was one of the most influential mathematicians of the 19th century.
Related Concepts
- Inverse Functions — Only bijective functions (one-one and onto) have a well-defined inverse function. Understanding function types is a prerequisite for studying inverses.
- Domain and Range — Onto functions are defined by the range equalling the entire codomain, making domain and range concepts directly tied to classifying surjectivity.
- Definition of a Function — Understanding what makes a relation a function is the logical first step before classifying functions into types such as injective or surjective.
- Composition of Functions — Injectivity and surjectivity behave predictably under composition — e.g. the composition of two injective functions is injective — linking these types to composite functions.
- Pigeonhole Principle — The pigeonhole principle is deeply connected to injections: if |A| > |B|, no injective function from A to B can exist, making function types central to combinatorial arguments.