Bijections and Inverse Functions

When can we "undo" a function, recovering the input exactly from the output? This question sounds innocent. Yet it is the hinge on which an enormous amount of mathematics turns. A function that can be undone — reversed step for step by another function — is called a bijection. Its reversal is its inverse. Understanding exactly when this reversal exists is essential. So is understanding why it must be unique when it does. This forces us to confront two independent ways a function can fail to be reversible. It can lose information (two inputs collapsing to one output). Or it can fail to cover the target (some outputs never occur). Bijections are precisely the functions immune to both failures. The idea matters far beyond bookkeeping. Bijections are the mathematical embodiment of "same size" for sets, finite or infinite. They are the symmetries that group theory studies. They let us relabel coordinate systems, re-index sums, and transport structure from one set to an isomorphic copy of it. Cryptographic ciphers are bijections on blocks of data. This is precisely because a legitimate user must be able to decrypt. Change-of-variables formulas in calculus depend on this notion. So does permutation counting in combinatorics. So does the definition of cardinality for infinite sets. The big picture is this: injectivity and surjectivity are complementary constraints. One is about not merging distinct elements. The other is about hitting everything. A function satisfying both simultaneously acquires a genuine two-sided inverse. It gets more than just a partial or one-sided patch. This is not automatic. One-sided inverses can exist under weaker hypotheses. They behave quite differently, though. Sorting out precisely which combination of hypotheses yields precisely which kind of inverse is the technical heart of this article. This article gives the exact definition of a bijection. It proves the central existence-and-uniqueness theorem for two-sided inverses. It works through two concrete non-trivial examples. One example concerns finite sets; the other, real-valued functions. It also exhibits a careful counterexample. This shows why both injectivity and surjectivity are indispensable. It closes with the historical origins of the concept. It also covers its uses across mathematics and beyond, and a compact reference card.

Key takeaways
  • A bijection is a function that is both injective (one-to-one) and surjective (onto).
  • Bijections are exactly the functions f:A→Bf:A\to B that admit a genuine two-sided inverse f−1:B→Af^{-1}:B\to A.
  • The inverse of a bijection is itself a bijection, and it is unique when it exists.
  • Injectivity alone gives a left inverse (on nonempty domains); surjectivity alone gives a right inverse (using choice); only both together give a true inverse.
  • Composition interacts cleanly with inverses: (g∘f)−1=f−1∘g−1(g\circ f)^{-1} = f^{-1}\circ g^{-1} when both f,gf,g are bijections.
  • Key idea: a function is reversible exactly when it neither loses information (injective) nor misses part of the target (surjective).

Where this lives today

Bijections are the working definition of "the same size" used throughout mathematics, most explicitly in Finite Sets and Counting, where a bijection between a finite set and {1,…,n}\{1,\dots,n\} is the definition of "having nn elements," and in the theory of infinite cardinal numbers, where two sets are declared to have equal cardinality exactly when a bijection between them exists (this is how one proves ∣N∣=∣Z∣=∣Q∣<∣R∣|\mathbb N| = |\mathbb Z| = |\mathbb Q| < |\mathbb R|). In algebra, the automorphisms of any structure — bijective structure-preserving self-maps — form a group under Composition of Functions, and permutation groups are literally groups of bijections of a finite set to itself. In analysis, the Inverse Function Theorem gives local conditions under which a differentiable map is a bijection near a point and computes the derivative of the resulting inverse. In cryptography, block ciphers such as AES are, for each fixed key, bijections on the space of possible blocks — this is mathematically forced, since a legitimate recipient must be able to decrypt uniquely. In computer science, hash functions used for perfect hashing and bijective encodings (e.g. Gödel numbering schemes, Cantor pairing functions) rely on explicit bijections between combinatorial structures and N\mathbb{N}. In statistics and probability, change-of-variables formulas for densities require the transforming map to be a (locally) bijective, differentiable function so that the inverse and its Jacobian are well defined.

Ask the tutor: Why does surjectivity alone require the Axiom of Choice to build a right inverse, while injectivity alone does not need choice for a left inverse?

DefinitionBijection and Inverse Function

Let AA and BB be sets and let f:A→Bf : A \to B be a function.

  • ff is injective (one-to-one) if for all x1,x2∈Ax_1, x_2 \in A, f(x1)=f(x2)f(x_1) = f(x_2) implies x1=x2x_1 = x_2.
  • ff is surjective (onto BB) if for every y∈By \in B there exists x∈Ax \in A with f(x)=yf(x) = y.
  • ff is a bijection (or a bijective correspondence, or a one-to-one correspondence) from AA to BB if ff is both injective and surjective.

Given a function f:A→Bf: A \to B, a function g:B→Ag : B \to A is called:

  • a left inverse of ff if g∘f=idAg \circ f = \mathrm{id}_A, i.e. g(f(x))=xg(f(x)) = x for all x∈Ax \in A;
  • a right inverse of ff if f∘g=idBf \circ g = \mathrm{id}_B, i.e. f(g(y))=yf(g(y)) = y for all y∈By \in B;
  • a (two-sided) inverse of ff if gg is both a left inverse and a right inverse of ff.

When a two-sided inverse of ff exists, it is denoted f−1f^{-1}.

Intuition

Think of a function f:A→Bf : A \to B as a machine that assigns to each element of AA an arrow pointing into BB. Two things can go wrong if you try to build a "reverse machine" that sends each output back to where it came from. First, two different inputs might point to the same output — then the reverse machine would not know which one to send you back to. This failure is exactly the failure of injectivity. Second, some element of BB might have no arrow pointing at it at all — then the reverse machine has nothing to do when handed that element. This failure is exactly the failure of surjectivity. A bijection is a diagram of arrows with none of these defects: every element of BB has exactly one arrow coming in. Reversing every arrow then produces a perfectly well-defined function B→AB \to A — the inverse. This is why the two hypotheses are not redundant with each other: injectivity handles the "too many inputs share an output" problem, surjectivity handles the "some outputs are orphaned" problem, and a genuine reversal needs both problems solved simultaneously.

Figure
Three functions on a 4-point set: only the bijection reverses cleanly
not injective (loses info) a b c 1 2 not surjective (misses target) a b 1 2 3 bijection (reversible) a b c 1 2 3 Only the third diagram has arrows that can be reversed to give a well-defined function 1,2,3 → a,b,c.

The central theorem

TheoremBijections and Two-Sided Inverses

Let AA and BB be sets and let f:A→Bf : A \to B be a function. Then the following are equivalent: 1. ff is a bijection (injective and surjective). 2. ff has a two-sided inverse, that is, there exists g:B→Ag : B \to A with g∘f=idAg \circ f = \mathrm{id}_A and f∘g=idBf \circ g = \mathrm{id}_B. Moreover, when a two-sided inverse of ff exists, it is unique; consequently f−1f^{-1} is well-defined, it is itself a bijection B→AB \to A, and (f−1)−1=f(f^{-1})^{-1} = f.

Proof

We prove (1)⇒(2)(1) \Rightarrow (2), then (2)⇒(1)(2) \Rightarrow (1), then uniqueness, then the closing remarks. The technique throughout is direct construction and verification from the definitions, together with a standard uniqueness argument via composition.

(1)⇒(2)(1) \Rightarrow (2). Suppose ff is injective and surjective. We construct g:B→Ag : B \to A explicitly. Let y∈By \in B be arbitrary. Since ff is surjective, the set f−1({y})={x∈A:f(x)=y}f^{-1}(\{y\}) = \{x \in A : f(x) = y\} is nonempty; choose some x∈f−1({y})x \in f^{-1}(\{y\}). We claim this xx is unique: if x1,x2∈Ax_1, x_2 \in A both satisfy f(x1)=y=f(x2)f(x_1) = y = f(x_2), then f(x1)=f(x2)f(x_1) = f(x_2), and injectivity of ff gives x1=x2x_1 = x_2. Hence for each y∈By \in B there is exactly one x∈Ax \in A with f(x)=yf(x) = y; call it g(y)g(y). This rule y↦g(y)y \mapsto g(y) defines a function g:B→Ag : B \to A (formally, gg is the set of pairs {(y,x)∈B×A:f(x)=y}\{(y,x) \in B \times A : f(x) = y\}, and the argument just given shows this relation assigns to each y∈By \in B exactly one x∈Ax \in A, so it is a function). We check gg is a two-sided inverse of ff. g∘f=idAg \circ f = \mathrm{id}_A: let x∈Ax \in A and set y=f(x)y = f(x). By definition, g(y)g(y) is the unique element of AA mapping to yy under ff; since f(x)=yf(x) = y, uniqueness forces g(y)=xg(y) = x. Thus g(f(x))=xg(f(x)) = x for every x∈Ax \in A, i.e. g∘f=idAg \circ f = \mathrm{id}_A. f∘g=idBf \circ g = \mathrm{id}_B: let y∈By \in B. By construction f(g(y))=yf(g(y)) = y directly, since g(y)g(y) was chosen (and shown unique) precisely as an element with f(g(y))=yf(g(y)) = y. Thus f∘g=idBf \circ g = \mathrm{id}_B. Hence gg is a two-sided inverse of ff, proving (2)(2).

(2)⇒(1)(2) \Rightarrow (1). Suppose g:B→Ag : B \to A satisfies g∘f=idAg \circ f = \mathrm{id}_A and f∘g=idBf \circ g = \mathrm{id}_B. We show ff is injective and surjective. Injectivity: suppose x1,x2∈Ax_1, x_2 \in A with f(x1)=f(x2)f(x_1) = f(x_2). Apply gg to both sides: g(f(x1))=g(f(x2))g(f(x_1)) = g(f(x_2)). Since g∘f=idAg \circ f = \mathrm{id}_A, the left side is x1x_1 and the right side is x2x_2. Hence x1=x2x_1 = x_2. So ff is injective. Surjectivity: let y∈By \in B be arbitrary. Set x=g(y)∈Ax = g(y) \in A. Then

f(x)=f(g(y))=(f∘g)(y)=idB(y)=y,f(x) = f(g(y)) = (f \circ g)(y) = \mathrm{id}_B(y) = y,

using f∘g=idBf \circ g = \mathrm{id}_B. So yy is in the range of ff. Since y∈By \in B was arbitrary, ff is surjective. Hence ff is a bijection, proving (1)(1).

Uniqueness of the inverse. Suppose g1,g2:B→Ag_1, g_2 : B \to A are both two-sided inverses of ff: g1∘f=idA=g2∘fg_1 \circ f = \mathrm{id}_A = g_2 \circ f and f∘g1=idB=f∘g2f \circ g_1 = \mathrm{id}_B = f \circ g_2. We show g1=g2g_1 = g_2 as functions, i.e. g1(y)=g2(y)g_1(y) = g_2(y) for every y∈By \in B. Fix y∈By \in B. Using associativity of composition of functions (which holds because composition of functions is literally composition of relations/set-theoretic maps, and this is associative — a fact independent of and prior to the present theorem), compute:

g1=g1∘idB=g1∘(f∘g2)=(g1∘f)∘g2=idA∘g2=g2.g_1 = g_1 \circ \mathrm{id}_B = g_1 \circ (f \circ g_2) = (g_1 \circ f) \circ g_2 = \mathrm{id}_A \circ g_2 = g_2.

Each equality uses only the defining identities g1∘f=idAg_1 \circ f = \mathrm{id}_A, f∘g2=idBf\circ g_2 = \mathrm{id}_B, and the identity laws idA∘h=h\mathrm{id}_A \circ h = h, h∘idB=hh \circ \mathrm{id}_B = h for the relevant hh. Hence g1=g2g_1 = g_2 as functions B→AB \to A. This proves uniqueness, so we may unambiguously write f−1f^{-1} for the two-sided inverse of a bijection ff.

f−1f^{-1} is itself a bijection, and (f−1)−1=f(f^{-1})^{-1} = f. By the defining property, f−1∘f=idAf^{-1} \circ f = \mathrm{id}_A and f∘f−1=idBf \circ f^{-1} = \mathrm{id}_B. Reading these two equations as saying "ff is a two-sided inverse of f−1f^{-1}" (the two equations are exactly the two required identities, with the roles of ff and f−1f^{-1} swapped), we conclude f−1:B→Af^{-1} : B \to A has ff as a two-sided inverse. By the already-proved direction (2)⇒(1)(2)\Rightarrow(1) applied to f−1f^{-1} in place of ff, f−1f^{-1} is itself a bijection. By uniqueness of inverses (already proved) applied to f−1f^{-1}, its unique two-sided inverse is ff, i.e. (f−1)−1=f(f^{-1})^{-1} = f. ■\blacksquare

∎
CorollaryComposition of Bijections

If f:A→Bf : A \to B and h:B→Ch : B \to C are bijections, then h∘f:A→Ch \circ f : A \to C is a bijection, and

(h∘f)−1=f−1∘h−1.(h \circ f)^{-1} = f^{-1} \circ h^{-1}.
Proof

Since ff and hh are bijections, by the theorem they have two-sided inverses f−1:B→Af^{-1}: B\to A and h−1:C→Bh^{-1}: C \to B. Define k=f−1∘h−1:C→Ak = f^{-1}\circ h^{-1} : C \to A. We check kk is a two-sided inverse of h∘fh \circ f, using associativity of composition:

k∘(h∘f)=f−1∘(h−1∘h)∘f=f−1∘idB∘f=f−1∘f=idA,k \circ (h \circ f) = f^{-1}\circ (h^{-1} \circ h) \circ f = f^{-1}\circ \mathrm{id}_B \circ f = f^{-1}\circ f = \mathrm{id}_A,
(h∘f)∘k=h∘(f∘f−1)∘h−1=h∘idB∘h−1=h∘h−1=idC.(h\circ f)\circ k = h \circ (f \circ f^{-1})\circ h^{-1} = h \circ \mathrm{id}_B \circ h^{-1} = h \circ h^{-1} = \mathrm{id}_C.

So kk is a two-sided inverse of h∘fh \circ f. By the theorem's (2)⇒(1)(2)\Rightarrow(1) direction, h∘fh\circ f is a bijection, and by uniqueness of inverses, (h∘f)−1=k=f−1∘h−1(h\circ f)^{-1} = k = f^{-1}\circ h^{-1}. ■\blacksquare

∎

Worked examples

Example 1 (finite, asymmetric sets — explicit bijection and its inverse). Let A={p,q,r,s}A = \{p, q, r, s\} and B={2,3,5,7}B = \{2, 3, 5, 7\} (note: AA has abstract labels, BB has concrete distinct primes — deliberately asymmetric so no hidden relabeling coincidence can mask an error). Define f:A→Bf : A \to B by

f(p)=5,f(q)=2,f(r)=7,f(s)=3.f(p) = 5, \quad f(q) = 2, \quad f(r) = 7, \quad f(s) = 3.

Checking injectivity. The four output values 5,2,7,35, 2, 7, 3 listed for p,q,r,sp,q,r,s are pairwise distinct. Hence no two distinct inputs share an output, so ff is injective. (Formally: if f(x1)=f(x2)f(x_1)=f(x_2) with x1≠x2x_1\ne x_2 then two of {5,2,7,3}\{5,2,7,3\} would coincide, which is false by inspection of the four values.) Checking surjectivity. B={2,3,5,7}B = \{2,3,5,7\} and the range of ff is {f(p),f(q),f(r),f(s)}={5,2,7,3}={2,3,5,7}=B\{f(p),f(q),f(r),f(s)\} = \{5,2,7,3\} = \{2,3,5,7\} = B. So every element of BB is hit, and ff is surjective. Hence ff is a bijection. By the theorem, ff has a unique two-sided inverse g=f−1:B→Ag = f^{-1} : B \to A. Following the proof's construction, g(y)g(y) is the unique xx with f(x)=yf(x) = y:

g(2)=q,g(3)=s,g(5)=p,g(7)=r.g(2) = q,\quad g(3) = s,\quad g(5) = p,\quad g(7) = r.

Verification of both identities directly. Compute g(f(x))g(f(x)) for each x∈Ax \in A:

g(f(p))=g(5)=p,g(f(q))=g(2)=q,g(f(r))=g(7)=r,g(f(s))=g(3)=s.g(f(p)) = g(5) = p,\quad g(f(q)) = g(2) = q,\quad g(f(r)) = g(7) = r,\quad g(f(s)) = g(3) = s.

So g∘f=idAg \circ f = \mathrm{id}_A on all four elements. Compute f(g(y))f(g(y)) for each y∈By \in B:

f(g(2))=f(q)=2,f(g(3))=f(s)=3,f(g(5))=f(p)=5,f(g(7))=f(r)=7.f(g(2)) = f(q) = 2,\quad f(g(3)) = f(s) = 3,\quad f(g(5)) = f(p) = 5,\quad f(g(7)) = f(r) = 7.

So f∘g=idBf \circ g = \mathrm{id}_B on all four elements. Both identities hold on every element of the (finite) domains, so gg is genuinely a two-sided inverse, confirming the theorem's guarantee.

Example 2 (a bijection between intervals of different lengths, with explicit formula for the inverse). Let A=[1,4]A = [1, 4] and B=[0,9]B = [0, 9], two closed real intervals of different lengths (33 versus 99 — chosen asymmetrically to avoid the misleading special case of equal-length intervals). Define

f:[1,4]→[0,9],f(x)=3(x−1)2−(no — must be monotone; use)f(x)=3x−3.f : [1,4] \to [0,9], \qquad f(x) = 3(x-1)^2 - \text{(no — must be monotone; use)}\quad f(x) = 3x - 3.

(We use the monotone affine map f(x)=3x−3f(x) = 3x-3, since a quadratic would not be injective on an interval containing both signs of x−x-vertex; affine maps are automatically injective when the slope is nonzero, which we verify below.) Checking injectivity. Suppose f(x1)=f(x2)f(x_1) = f(x_2), i.e. 3x1−3=3x2−33x_1 - 3 = 3x_2 - 3. Adding 33 to both sides gives 3x1=3x23x_1 = 3x_2, and dividing by 33 (nonzero) gives x1=x2x_1 = x_2. So ff is injective on all of R\mathbb{R}, in particular on [1,4][1,4]. Checking that ff maps [1,4][1,4] into [0,9][0,9]. ff is increasing (slope 3>03>0), so its minimum and maximum on [1,4][1,4] occur at the endpoints: f(1)=3(1)−3=0f(1) = 3(1)-3 = 0 and f(4)=3(4)−3=9f(4) = 3(4) - 3 = 9. Since ff is continuous and strictly increasing, f([1,4])=[f(1),f(4)]=[0,9]f([1,4]) = [f(1),f(4)] = [0,9] (this uses the Intermediate Value Theorem to guarantee every value between 00 and 99 is attained, plus monotonicity to guarantee no value is skipped or repeated). Checking surjectivity onto B=[0,9]B=[0,9]. We just showed f([1,4])=[0,9]=Bf([1,4]) = [0,9] = B exactly, so every element of BB is attained: ff is surjective onto BB. Hence f:[1,4]→[0,9]f : [1,4] \to [0,9] is a bijection. Solve y=3x−3y = 3x - 3 for xx:

x=y+33=y3+1.x = \frac{y+3}{3} = \frac{y}{3} + 1.

So define g(y)=y3+1g(y) = \dfrac{y}{3} + 1 for y∈[0,9]y \in [0,9]. Check gg maps [0,9][0,9] into [1,4][1,4]: g(0)=1g(0) = 1, g(9)=4g(9) = 4, and gg is increasing, so g([0,9])=[1,4]g([0,9]) = [1,4], matching the domain AA. Verify both composite identities symbolically (not just at endpoints). For x∈[1,4]x \in [1,4]:

g(f(x))=g(3x−3)=3x−33+1=(x−1)+1=x.g(f(x)) = g(3x-3) = \frac{3x-3}{3} + 1 = (x - 1) + 1 = x.

For y∈[0,9]y \in [0,9]:

f(g(y))=f ⁣(y3+1)=3(y3+1)−3=(y+3)−3=y.f(g(y)) = f\!\left(\frac{y}{3}+1\right) = 3\left(\frac{y}{3}+1\right) - 3 = (y + 3) - 3 = y.

Both identities hold for every point in the respective domains (not merely at a few sample points), confirming g=f−1g = f^{-1} rigorously. Note the inverse of a bijection between intervals of different lengths (33 vs. 99) still exists and is affine — bijectivity does not require any relation between the "sizes" as measured by length, only the exact correspondence described in the definition.

Counterexamplewhy both injectivity and surjectivity are needed

The theorem requires ff to be both injective and surjective to guarantee a two-sided inverse. We exhibit two functions, each satisfying exactly one of the two hypotheses, and show each fails to have a two-sided inverse — though each does admit a one-sided inverse, which is instructive in itself.

Failure of surjectivity (injective but not surjective). Let A=ZA = \mathbb{Z}, B=ZB = \mathbb{Z}, and define f(n)=2nf(n) = 2n. Injective: if 2n1=2n22n_1 = 2n_2 then n1=n2n_1 = n_2 (divide by 22). So ff is injective. Not surjective: the value y=1y=1 is never attained, since 2n=12n=1 has no integer solution (n=1/2∉Zn=1/2 \notin \mathbb{Z}). So ff is not surjective onto B=ZB=\mathbb{Z}. Suppose toward contradiction that g:Z→Zg : \mathbb{Z}\to\mathbb{Z} were a two-sided inverse of ff. Then f∘g=idZf\circ g = \mathrm{id}_{\mathbb Z} would require f(g(1))=1f(g(1)) = 1, i.e. 2 g(1)=12\,g(1) = 1 — impossible for an integer g(1)g(1). So no two-sided inverse exists, exactly as the theorem's necessity direction predicts, since ff fails surjectivity. What does exist is a left inverse: define h:Z→Zh:\mathbb Z\to\mathbb Z by h(m)=m/2h(m) = m/2 if mm is even, h(m)=0h(m)=0 if mm is odd. Then h(f(n))=h(2n)=nh(f(n)) = h(2n) = n for all nn, so h∘f=idZh\circ f = \mathrm{id}_{\mathbb Z}: a left inverse exists precisely because ff is injective, but hh is not a right inverse, since f(h(1))=f(0)=0≠1f(h(1)) = f(0) = 0 \ne 1. This shows injectivity alone buys a left inverse but not a two-sided one.

Failure of injectivity (surjective but not injective). Let A=RA = \mathbb{R}, B=R≥0=[0,∞)B = \mathbb{R}_{\ge 0} = [0,\infty), and define f(x)=x2f(x) = x^2. Surjective: for any y≥0y \ge 0, x=yx = \sqrt{y} satisfies f(x)=yf(x) = y. So ff is surjective onto BB. Not injective: f(2)=4=f(−2)f(2) = 4 = f(-2) but 2≠−22 \ne -2. So ff is not injective. Suppose toward contradiction g:[0,∞)→Rg : [0,\infty) \to \mathbb{R} were a two-sided inverse. Then g∘f=idRg\circ f = \mathrm{id}_{\mathbb R} would require g(f(2))=2g(f(2)) = 2 and g(f(−2))=−2g(f(-2)) = -2; but f(2)=f(−2)=4f(2) = f(-2) = 4, so g(4)g(4) would have to equal both 22 and −2-2 simultaneously — impossible, since g(4)g(4) is a single value. So no two-sided inverse exists, exactly because ff fails injectivity. What does exist is a right inverse: define k:[0,∞)→Rk : [0,\infty)\to\mathbb R by k(y)=yk(y) = \sqrt{y} (the nonnegative square root). Then f(k(y))=(y)2=yf(k(y)) = (\sqrt y)^2 = y for all y≥0y \ge 0, so f∘k=id[0,∞)f \circ k = \mathrm{id}_{[0,\infty)}: a right inverse exists precisely because ff is surjective. But kk is not a left inverse: k(f(−2))=k(4)=2≠−2k(f(-2)) = k(4) = 2 \ne -2. These two examples show the two hypotheses are logically independent obstructions, each capable by itself of destroying two-sidedness, and each capable by itself of still producing a weaker, one-sided inverse.

Scope, edge cases & common traps

SituationWhat holdsWhat can fail
ff injective onlyLeft inverse exists (if A≠∅A\ne\varnothing)Right inverse generally fails; left inverse not unique if ff not also surjective
ff surjective onlyRight inverse exists (needs Axiom of Choice in general)Left inverse generally fails; right inverse not unique
ff bijectiveTwo-sided inverse exists and is unique—
A=∅A=\varnothing, B≠∅B\ne\varnothingNo function A→BA\to B... wait, unique empty function exists but cannot be surjective unless B=∅B=\varnothingVacuous edge case: check surjectivity fails unless B=∅B=\varnothing
Infinite setsBijection can exist between a set and a proper subset (e.g. N→\mathbb N \to evens)"Same size" intuition from finite sets breaks; this is normal, not an error
Constructing right inverse from surjectivity aloneRequires choosing one preimage per point of BBFor infinite BB this genuinely requires the Axiom of Choice

The mathematician behind it

Origins · 1 minGeorg Cantor and how this was discovered
GC
Georg Cantor
1845–1918 · Halle, German Empire

Georg Cantor founded set theory and, in doing so, made the notion of bijection the precise tool for comparing the sizes of infinite collections. His 1874 discovery that there is no bijection between N\mathbb{N} and R\mathbb{R} (via the diagonal argument), contrasted with his earlier discovery of an explicit bijection between N\mathbb{N} and Q\mathbb{Q}, showed for the first time that infinities come in different sizes — a conclusion that depends entirely on treating "bijection exists" as the correct formal meaning of "same cardinality."

History
- 1874 — Cantor publishes his first paper on set theory, proving the rationals are countable (biject with N\mathbb N) while the reals are not.
- 1878 — Cantor introduces the general notion of two sets having "the same power" (Mächtigkeit) via the existence of a bijection between them.
- 1883 — Cantor develops ordinal and cardinal numbers systematically in Grundlagen einer allgemeinen Mannigfaltigkeitslehre, relying throughout on bijective correspondence as the basic comparative tool.
- 1895–1897 — Cantor's Beiträge papers give a mature, largely modern treatment of cardinal arithmetic built on bijections, including the Cantor–Bernstein theorem on mutual injections implying a bijection.
- 1908 — Ernst Zermelo axiomatizes set theory, formalizing functions as certain sets of ordered pairs and giving the modern rigorous scaffolding in which "bijection" and "inverse function" receive the precise definitions used today.
Is every function with an inverse automatically a bijection?

Yes, provided "inverse" means genuine two-sided inverse as defined here. The theorem's direction (2)⇒(1)(2)\Rightarrow(1) proves exactly this: if some gg satisfies both g∘f=idAg\circ f = \mathrm{id}_A and f∘g=idBf\circ g=\mathrm{id}_B, then ff must be injective (apply gg to an equality of outputs to force equality of inputs) and surjective (for any target yy, g(y)g(y) is an explicit preimage). The subtlety is the word "two-sided": a function can have a left inverse or a right inverse without being a bijection, as the counterexample block shows. Colloquially, "has an inverse" almost always means two-sided inverse, in which case the equivalence is exact and unconditional.

Does constructing a right inverse from surjectivity really need the Axiom of Choice?

For a general surjection f:A→Bf:A\to B, yes: to build g:B→Ag:B\to A with f∘g=idBf\circ g=\mathrm{id}_B, you must select, for each y∈By\in B, one element from the (nonempty, by surjectivity) preimage set f−1({y})f^{-1}(\{y\}), and doing this simultaneously for possibly infinitely many yy with no canonical rule is precisely an instance of the Axiom of Choice. When ff is also injective (i.e. bijective), no choice is needed because each preimage set is a singleton, so there is nothing to choose — the theorem's proof of (1)⇒(2)(1)\Rightarrow(2) is fully constructive and choice-free. Choice becomes essential exactly at the point where surjectivity alone, without injectivity, is used to manufacture a section.

Can a set be in bijection with a proper subset of itself?

Yes, and this is completely consistent with the theory — it is one of the defining features of infinite sets. The map f:N→Nf:\mathbb N\to\mathbb N, f(n)=2nf(n)=2n, restricted in codomain to the even naturals E={0,2,4,… }⊊NE=\{0,2,4,\dots\}\subsetneq\mathbb N, is a bijection N→E\mathbb N\to E: it is injective as shown in the counterexample block, and surjective onto EE since every even number is 2n2n for some nn. A classical theorem (Dedekind) even defines an infinite set as one admitting a bijection with a proper subset of itself; finite sets never admit such a bijection, which is part of why "same cardinality via bijection" behaves so differently once we leave the finite world, foreshadowing Finite Sets and Counting.

What goes wrong if I only check injectivity or only check surjectivity before writing "f−1f^{-1}"?

Writing f−1(y)f^{-1}(y) presupposes that there is exactly one xx with f(x)=yf(x)=y: existence of such an xx is surjectivity, uniqueness is injectivity. If you only verify injectivity, f−1(y)f^{-1}(y) may be undefined for some y∈By \in B (nothing maps to yy), producing a partial function masquerading as a total one. If you only verify surjectivity, f−1(y)f^{-1}(y) may be ambiguous (several valid xx's), so "f−1f^{-1}" is not a well-defined function at all — at best you get a relation, or you must arbitrarily select one preimage using choice, losing the right to call the result "the" inverse.

How does this relate to the Cantor–Schröder–Bernstein theorem?

The Cantor–Schröder–Bernstein theorem addresses a related but distinct question: given only an injection f:A→Bf:A\to B and an injection g:B→Ag:B\to A (neither assumed surjective), it proves a bijection A→BA\to B exists nonetheless, constructed by splicing pieces of ff and gpartial−1g^{-1}_{\text{partial}} together. It is a genuinely different and harder theorem than the one here, because here we assume a single function is both injective and surjective, whereas Cantor–Schröder–Bernstein derives the existence of some bijection from two one-directional injections that individually need not be surjective. The present theorem is the tool used inside that proof once the final bijective map has been assembled.

Is the identity function always a bijection, and is it its own inverse?

Yes. For any set AA, idA:A→A\mathrm{id}_A:A\to A defined by idA(x)=x\mathrm{id}_A(x)=x is injective (if x1=x2x_1=x_2 trivially x1=x2x_1=x_2) and surjective (every y∈Ay\in A equals idA(y)\mathrm{id}_A(y)), hence a bijection. Its two-sided inverse gg must satisfy g∘idA=idAg\circ\mathrm{id}_A=\mathrm{id}_A and idA∘g=idA\mathrm{id}_A\circ g=\mathrm{id}_A; taking g=idAg=\mathrm{id}_A satisfies both, and uniqueness of inverses (proved above) forces this to be the only possibility. So idA−1=idA\mathrm{id}_A^{-1}=\mathrm{id}_A, consistent with the general fact (f−1)−1=f(f^{-1})^{-1}=f applied when ff is already self-inverse.

Why does the proof of uniqueness use associativity of composition, and is that circular?

The uniqueness argument computes g1=g1∘(f∘g2)=(g1∘f)∘g2=g2g_1 = g_1\circ(f\circ g_2) = (g_1\circ f)\circ g_2 = g_2, which requires regrouping g1∘f∘g2g_1\circ f\circ g_2 two different ways — that is associativity. This is not circular: associativity of function composition is a basic fact about composing set-theoretic relations, provable directly from the definition (h∘k)(x)=h(k(x))(h\circ k)(x) = h(k(x)) without any reference to injectivity, surjectivity, or inverses. It is logically prior to, and independent of, the bijection theorem, so invoking it here introduces no circularity.

Where this leads