Tutorials › Real Analysis › Bijective Functions

Sets and Functions · Tutorial 65 of 1000

Bijective Functions

A bijection pairs every element of its codomain with exactly one input, joining the ideas of injectivity and surjectivity.

Beginner 12 min read

What You'll Learn

  • How bijectivity combines injectivity and surjectivity
  • How to prove that each codomain element has exactly one preimage
  • Why a bijection has an inverse function
  • How the domain and codomain affect whether a function is bijective
  • How to use the inverse identities to check a proposed inverse

One-to-One and Onto at the Same Time

The previous tutorials treated two distinct questions about a function. Injectivity asks whether different inputs can have the same output. Surjectivity asks whether every element of the codomain is attained. A bijective function satisfies both conditions: it misses no codomain element, and it assigns no codomain element to more than one input.

Let \(f:A\to B\). Recall that \(f\) is injective if \(f(x)=f(y)\) for \(x,y\in A\) implies \(x=y\), and it is surjective if for every \(b\in B\) there exists \(a\in A\) with \(f(a)=b\). These are the definitions established in Injective Functions and Surjective Functions. The new term combines them.

Definition (Bijective Function). A function \(f:A\to B\) is bijective if it is both injective and surjective. A bijective function is also called a bijection or a one-to-one correspondence between \(A\) and \(B\).

The two parts of the definition answer complementary questions about a chosen \(b\in B\). Surjectivity guarantees at least one \(a\in A\) with \(f(a)=b\). Injectivity guarantees that there cannot be two distinct such inputs. Together, they say there is exactly one input associated with each codomain element.

Exactly one has two parts. “Every \(b\in B\) has a preimage” is the onto condition. “No \(b\in B\) has two different preimages” follows from injectivity. A proof of bijectivity must establish both facts; proving only one is not enough.

The Unique-Preimage Criterion

It is often useful to combine the two defining conditions into one statement. In the theorem below, “exactly one” means that there exists an input giving the target, and any input giving that target must equal the one already found.

Theorem (Unique-Preimage Criterion for a Bijection). Let \(f:A\to B\). Then \(f\) is bijective if and only if for every \(b\in B\), there exists exactly one \(a\in A\) such that \(f(a)=b\).

Proof. Suppose first that \(f\) is bijective, so it is surjective and injective. Let \(b\in B\) be arbitrary. Since \(f\) is surjective, there exists \(a\in A\) such that \(f(a)=b\). Now suppose \(a'\in A\) also satisfies \(f(a')=b\). Then \(f(a')=f(a)\), so injectivity gives \(a'=a\). Thus \(a\) is the unique input that maps to \(b\). Since \(b\) was arbitrary, every element of \(B\) has exactly one preimage.

Conversely, suppose every \(b\in B\) has exactly one preimage in \(A\). In particular, every \(b\in B\) has at least one preimage, so \(f\) is surjective. To prove injectivity, let \(x,y\in A\) and suppose \(f(x)=f(y)\). Set \(b=f(x)\), which belongs to \(B\) because \(f:A\to B\). Both \(x\) and \(y\) are preimages of \(b\). Since \(b\) has exactly one preimage, \(x=y\). Therefore \(f\) is injective as well as surjective, and hence is bijective. \(\square\)

The criterion offers a direct proof strategy: choose an arbitrary codomain element, find a preimage, and then prove that any other preimage must coincide with it. This can be more convenient than presenting separate arguments labelled “injective” and “surjective,” though the underlying requirements remain the same.

1
Start with an arbitrary target: let \(b\in B\). This is the target whose preimage must be accounted for.
2
Establish existence: construct an \(a\in A\) satisfying \(f(a)=b\). This proves the onto part.
3
Establish uniqueness: suppose \(a'\in A\) also satisfies \(f(a')=b\), and use injectivity to show \(a'=a\).
4
Conclude for every target: because \(b\) was arbitrary, every codomain element has exactly one preimage.

Worked Examples

Worked Example: A Bijection Between Finite Sets

Let \(A=\{p,q,r\}\) and \(B=\{2,4,6\}\), and define \(f:A\to B\) by $$ f(p)=4,\qquad f(q)=6,\qquad f(r)=2. $$ To show surjectivity, note that each element of \(B\) occurs: \(2=f(r)\), \(4=f(p)\), and \(6=f(q)\). To show injectivity, the three distinct inputs have the three distinct outputs \(4,6,2\). More explicitly, no two different members of \(A\) have the same assigned value. Thus \(f\) is both surjective and injective, so it is bijective.

The unique-preimage description is visible target by target: \(2\) has preimage \(r\), \(4\) has preimage \(p\), and \(6\) has preimage \(q\). For finite sets, a table can make these checks especially clear, provided every domain element and every codomain element is accounted for.

Worked Example: An Affine Bijection on the Reals

Define \(f:\mathbb R\to\mathbb R\) by \(f(x)=3x-5\). Let \(y\in\mathbb R\) be arbitrary. Solving \(3x-5=y\) gives the candidate \(x=(y+5)/3\), which is real and therefore belongs to the domain. Substitution gives $$ f\left(\frac{y+5}{3}\right) =3\left(\frac{y+5}{3}\right)-5 =y+5-5 =y. $$ Thus every real target is attained, and \(f\) is surjective.

To check injectivity, suppose \(f(x_1)=f(x_2)\) for \(x_1,x_2\in\mathbb R\). Then $$ 3x_1-5=3x_2-5. $$ Adding \(5\) to both sides and dividing by the nonzero number \(3\) gives \(x_1=x_2\). Hence \(f\) is injective and therefore bijective. The construction also shows that the unique input mapping to \(y\) is \((y+5)/3\).

Worked Example: Restricting the Domain of Squaring

Define \(s:[0,\infty)\to[0,\infty)\) by \(s(x)=x^2\). For surjectivity, take any \(y\in[0,\infty)\). The nonnegative square root \(\sqrt y\) belongs to the domain, and $$ s(\sqrt y)=(\sqrt y)^2=y. $$ Therefore \(s\) is surjective.

For injectivity, let \(x_1,x_2\in[0,\infty)\) and suppose \(x_1^2=x_2^2\). The equality of squares criterion established earlier in this course gives \(x_1=x_2\) or \(x_1=-x_2\). In the second case, both numbers are nonnegative, so \(x_1=-x_2\geq0\) and \(x_2\geq0\); these inequalities force \(x_1=x_2=0\), and thus \(x_1=x_2\) in this case too. Hence \(s\) is injective. It is both injective and surjective, so it is bijective.

The domain restriction matters. If the domain were all of \(\mathbb R\), then \(1\) and \(-1\) would be distinct inputs with the same square, so the function would not be injective. If the codomain were all of \(\mathbb R\), negative targets would not be attained, so it would not be surjective. A formula alone does not determine bijectivity; the domain and codomain are part of the function.

Bijections and Inverse Functions

A bijection allows us to reverse the direction of the mapping: each \(b\in B\) determines exactly one \(a\in A\) for which \(f(a)=b\). This makes it possible to define a function from \(B\) back to \(A\). The unique-preimage criterion supplies both the existence and the uniqueness needed for that definition.

Theorem (A Function Has an Inverse Exactly When It Is Bijective). Let \(f:A\to B\). The function \(f\) is bijective if and only if there exists a function \(g:B\to A\) such that $$ g(f(a))=a\quad\text{for every }a\in A, \qquad f(g(b))=b\quad\text{for every }b\in B. $$ When such a function exists, it is unique and is denoted by \(f^{-1}:B\to A\).

Proof. First suppose that \(f\) is bijective. By the Unique-Preimage Criterion, for each \(b\in B\) there is exactly one \(a\in A\) with \(f(a)=b\). Define \(g(b)\) to be that unique \(a\). This defines a function \(g:B\to A\), since each \(b\) is assigned one and only one value in \(A\). By its definition, \(f(g(b))=b\) for every \(b\in B\).

Now take \(a\in A\). The element \(f(a)\) belongs to \(B\), and \(a\) is a preimage of \(f(a)\). Since that preimage is unique, the definition of \(g\) gives \(g(f(a))=a\). Thus both required identities hold.

For uniqueness, suppose \(h:B\to A\) also satisfies \(f(h(b))=b\) for every \(b\in B\). Fix \(b\in B\). Both \(h(b)\) and \(g(b)\) are preimages of \(b\), because \(f(h(b))=b\) and \(f(g(b))=b\). Injectivity of \(f\) implies \(h(b)=g(b)\). This holds for every \(b\in B\), so the pointwise equality criterion for functions gives \(h=g\).

Conversely, suppose there is a function \(g:B\to A\) satisfying the two displayed identities. To prove that \(f\) is surjective, let \(b\in B\). The element \(g(b)\) belongs to \(A\), and \(f(g(b))=b\). Thus every \(b\) has a preimage. To prove injectivity, suppose \(f(a_1)=f(a_2)\) for \(a_1,a_2\in A\). Applying \(g\) to the equal outputs gives $$ g(f(a_1))=g(f(a_2)). $$ Using the identity \(g(f(a))=a\), this becomes \(a_1=a_2\). Therefore \(f\) is injective as well as surjective, so it is bijective. \(\square\)

The function \(f^{-1}\) reverses inputs and outputs, but it is not obtained by simply placing a minus sign on \(f\). In the affine example, the unique input associated with \(y\) was \((y+5)/3\), so $$ f^{-1}(y)=\frac{y+5}{3}. $$ The two identities in the theorem are the reliable check: applying \(f^{-1}\) after \(f\) returns the original input, while applying \(f\) after \(f^{-1}\) returns the original target.

Do not confuse an inverse function with a reciprocal. The notation \(f^{-1}\) denotes the function that reverses the mapping when \(f\) is bijective. It does not mean \(1/f\). The inverse has domain \(B\) and codomain \(A\), in the reverse order from \(f:A\to B\).

What Fails When a Function Is Not Bijective?

Failure of either defining condition prevents a function from being a bijection. If \(f\) is not surjective, some \(b\in B\) has no preimage, so there is no value in \(A\) that an inverse function could assign to that \(b\) while satisfying \(f(f^{-1}(b))=b\). If \(f\) is not injective, distinct inputs share an output. Reversing that output would then require the inverse to return two different values, which a function cannot do.

Property of \(f:A\to B\) Preimages of a codomain element Consequence
Surjective but not injective At least one for each target, sometimes more than one No inverse function can return a unique input for every target
Injective but not surjective At most one for each target, with some targets having none An inverse cannot be defined on all of \(B\)
Bijective Exactly one for each target A unique inverse function \(f^{-1}:B\to A\) exists

The table describes why both conditions are necessary, not just why they are useful. Injectivity controls the number of possible preimages from above; surjectivity ensures there is at least one. Only together do they give exactly one for every target. This is also why changing a codomain can change whether a function is bijective even if its domain and rule stay fixed.

Empty sets fit the same definitions. The function from \(\varnothing\) to \(\varnothing\) is bijective: injectivity has no pair of domain elements that could violate it, and surjectivity has no codomain elements that could lack preimages. A function from \(\varnothing\) to a nonempty set is not surjective, since its targets have no preimages. A function from a nonempty set to \(\varnothing\) cannot exist, because each domain element would need an output in the empty codomain. Thus no other empty-set case gives a bijection.

1
Fix the mapping: write down its domain, codomain, and rule or assignments.
2
Check onto: for an arbitrary codomain element, find an input that maps to it.
3
Check one-to-one: assume two inputs have equal outputs and prove that the inputs are equal.
4
Connect the conditions: conclude bijectivity, or identify a target with no preimage or multiple preimages.

Check Your Understanding

  1. State the definition of a bijective function \(f:A\to B\) in terms of injectivity and surjectivity.
  2. For the map \(f:\mathbb R\to\mathbb R\) given by \(f(x)=3x-5\), what input maps to an arbitrary target \(y\)? Why does that help establish surjectivity?
  3. For \(s:[0,\infty)\to[0,\infty)\) given by \(s(x)=x^2\), identify a preimage of an arbitrary \(y\) and explain why it belongs to the domain.
  4. Explain why \(x\mapsto x^2\), with domain \(\mathbb R\), is not injective.
  5. What two identities must an inverse function \(f^{-1}:B\to A\) satisfy for a bijection \(f:A\to B\)?
  6. If a function is surjective but not injective, what prevents it from having an inverse function on its entire codomain?