Skip to content

Injective, surjective and bijective function

Distinguish collisions from missing outputs, classify mappings on stated domains and codomains, and see when a payoff or transformation can be reversed.

An injective function never sends two different inputs to the same output; a surjective function reaches every element of its declared codomain; a bijective function does both. For a quant, these distinctions separate three questions: does a transformation lose information, can it produce every target value, and can its input be recovered uniquely?
Write a function as f:A→Bf:A\to B. Its domain AA contains the allowed inputs. Its codomain BB declares where outputs live. Its range, f(A)f(A), contains only the outputs actually reached.
PropertyExact conditionWhat to look for
Injective, or one-to-onef(x1)=f(x2)⇒x1=x2f(x_1)=f(x_2)\Rightarrow x_1=x_2No collision between distinct inputs
Surjective, or ontoFor every y∈By\in B, some x∈Ax\in A satisfies f(x)=yf(x)=yNo missing element of the codomain
BijectiveFor every y∈By\in B, exactly one x∈Ax\in A satisfies f(x)=yf(x)=yComplete coverage with no collisions
The input variables in the first row range over AA. To disprove injectivity, exhibit one collision; to disprove surjectivity, exhibit one unreachable codomain element. The University of Toronto's bijections guide develops these tests.

A payoff that forgets which state occurred

Consider three fictional terminal model states, A={a,b,c}A=\{a,b,c\}. A contract pays USD 0 in state aa and USD 1 in either bb or cc. Define its numerical USD payoff by

p:A→{0,1},p(a)=0,p(b)=1,p(c)=1.p:A\to\{0,1\},\qquad p(a)=0,\quad p(b)=1,\quad p(c)=1.
This is surjective: both declared payoff values occur. It is not injective: b≠cb\ne c but p(b)=p(c)p(b)=p(c). Observing a USD 1 payoff therefore leaves two possible states. No probabilities are specified, so this observation alone supplies no odds for choosing between them.
Fictional three-state payoff map: a pays USD 0; b and c each pay USD 1. Both declared payoff values are reached, but reversing USD 1 leaves two possible states.
Fictional three-state payoff map: a pays USD 0; b and c each pay USD 1. Both declared payoff values are reached, but reversing USD 1 leaves two possible states.
Original fictional model. The forward map is surjective but not injective; reversing its arrows produces two candidates for payoff 1, rather than a unique-state inverse.

Choosing bb whenever the observed payoff is 1 would reproduce that payoff, but it would fail to recover the original state when cc occurred. A selection rule cannot restore information the payoff discarded.

States with the same payoff form an equivalence relation: the groups here are {a}\{a\} and {b,c}\{b,c\}. Payoff identifies the group uniquely, even though it does not always identify the state. This distinction matters when compressing scenarios: states equivalent for this contract may differ for another position in the portfolio.

Surjectivity changes if the codomain changes. Declaring the same payoff rule as p:A→{0,1,2}p:A\to\{0,1,2\} makes it neither injective nor surjective: USD 2 is now a declared destination that no state reaches.

The formula is only part of the function

For the rule q(x)=x2q(x)=x^2, changing the declared sets changes the answer:

Domain AACodomain BBClassificationReason
R\mathbb RR\mathbb RNeither−2-2 and 22 both give 44; negative outputs are missed
R\mathbb R[0,∞)[0,\infty)Surjective onlyEvery nonnegative value has a square root; the sign collision remains
[0,∞)[0,\infty)R\mathbb RInjective onlyNonnegative inputs have distinct squares; negative outputs are still missed
[0,∞)[0,\infty)[0,∞)[0,\infty)BijectiveEach target y≥0y\ge0 has exactly one allowed input y\sqrt y
Restricting the domain removes collisions here; replacing the codomain with the range removes missing destinations. Neither operation is merely a new label: it changes the declared function. Campesato's MAT246 notes, §5 explicitly include both sets in a function's definition.

To prove injectivity on the nonnegative domain, x12=x22x_1^2=x_2^2 implies (x1−x2)(x1+x2)=0(x_1-x_2)(x_1+x_2)=0. Either x1=x2x_1=x_2, or x1+x2=0x_1+x_2=0; in the second case nonnegativity forces both inputs to be zero. To prove surjectivity onto [0,∞)[0,\infty), take any y≥0y\ge0: the allowed input x=yx=\sqrt y satisfies x2=yx^2=y.

When reversing the map works

A bijection f:A→Bf:A\to B has an inverse function f−1:B→Af^{-1}:B\to A satisfying both round trips:
f−1(f(x))=x(x∈A),f(f−1(y))=y(y∈B).f^{-1}(f(x))=x\quad(x\in A),\qquad f(f^{-1}(y))=y\quad(y\in B).

Injectivity gives uniqueness of a preimage when one exists. Surjectivity supplies existence for every element of BB. Together they justify a two-sided inverse on the whole declared codomain. An injective function alone can instead be inverted on its range.

For a dimensionless affine example,

f:R→R,f(x)=2x+1,f−1(y)=y−12.f:\mathbb R\to\mathbb R,\qquad f(x)=2x+1, \qquad f^{-1}(y)=\frac{y-1}{2}.

If two outputs agree, cancelling 1 and dividing by 2 shows that their inputs agree. For any real target yy, (y−1)/2(y-1)/2 is an allowed real input producing it. Thus the function is bijective: f(3)=7f(3)=7, and f−1(7)=3f^{-1}(7)=3.

Being able to evaluate a pricing formula does not establish that its parameters can be recovered uniquely from one observed price. That requires checking the particular map, its fixed inputs and its domain. The three-state payoff already demonstrates why forward evaluation alone is insufficient.

A counting shortcut has limits. Cardinality counts set size. Between finite sets of equal size, a function is injective if and only if it is surjective: distinct outputs must fill every slot, while covering every slot leaves no room for a collision. Equal sizes alone do not establish either property for a particular function. Nor does the equivalence extend to arbitrary infinite sets: n↦n+1n\mapsto n+1 on the positive integers is injective but misses 1, although its domain and codomain are the same set. Toronto's function definitions connect bijections with one-to-one correspondence and finite set size.
For more practice with evaluation, domains and algebraic rearrangement, see Arithmetic, Algebra, Equations and Functions. The full lesson requires membership.

Sources

Last updated
  • functions
  • injective
  • surjective
  • bijective
  • codomain
  • information loss
← Back to the glossaryBack to top ↑