Mathwords logoMathwords

Injective, Surjective, and Bijective Functions — Definition, Formula & Examples

Injective (one-to-one), surjective (onto), and bijective (both) are three ways to classify how a function maps its domain to its codomain. An injective function never maps two different inputs to the same output, a surjective function hits every element of the codomain, and a bijective function does both.

Let f:ABf: A \to B. The function ff is injective if f(a1)=f(a2)    a1=a2f(a_1) = f(a_2) \implies a_1 = a_2 for all a1,a2Aa_1, a_2 \in A. It is surjective if for every bBb \in B, there exists some aAa \in A with f(a)=bf(a) = b. It is bijective if it is both injective and surjective, establishing a one-to-one correspondence between AA and BB.

How It Works

To test injectivity, check whether two distinct inputs can produce the same output; if they cannot, the function is injective. To test surjectivity, check whether every element in the codomain is actually an output of the function. A function that passes both tests is bijective. Bijective functions are the only functions that have a true inverse f1:BAf^{-1}: B \to A. For finite sets of equal size, proving injectivity alone is enough to conclude bijectivity.

Worked Example

Problem: Let f:{1,2,3}{a,b,c}f: \{1,2,3\} \to \{a,b,c\} be defined by f(1)=bf(1)=b, f(2)=cf(2)=c, f(3)=af(3)=a. Determine whether ff is injective, surjective, or bijective.
Check injectivity: No two inputs share an output: f(1)=bf(1)=b, f(2)=cf(2)=c, f(3)=af(3)=a are all distinct.
f(1)f(2)f(3)    f is injectivef(1) \neq f(2) \neq f(3) \implies f \text{ is injective}
Check surjectivity: Every element of the codomain {a,b,c}\{a,b,c\} appears as an output: a=f(3)a=f(3), b=f(1)b=f(1), c=f(2)c=f(2).
{f(1),f(2),f(3)}={a,b,c}    f is surjective\{f(1),f(2),f(3)\} = \{a,b,c\} \implies f \text{ is surjective}
Conclude: Since ff is both injective and surjective, it is bijective.
Answer: ff is bijective.

Why It Matters

These classifications are central to abstract algebra, where bijections define isomorphisms between structures. In cryptography, encryption schemes rely on bijective functions so that every ciphertext can be uniquely decrypted. Understanding injectivity and surjectivity also clarifies when inverse functions exist, a recurring question in linear algebra and analysis.

Common Mistakes

Mistake: Confusing the codomain with the range when testing surjectivity.
Correction: Surjectivity requires that the range equals the entire codomain, not just a subset. If the codomain is R\mathbb{R} but the function only outputs positive reals, it is not surjective onto R\mathbb{R}.