SigmaField
Mathematical Foundations for Quant Finance
0 of 256 lessons
    1. PG6.1 Sets and set operations, provedProof · 30 min
    2. PG6.2 Injective, surjective and bijective mapsProof · 30 min
    3. PG6.3 Countable setsProof · 30 min
    4. PG6.4 Uncountable sets, and infinitely many coin tossesProof · 30 min
    5. PG6.5 Stage review: sets, maps and sizesProof · 30 min
Proof Gym overview →

Proof Gym PG6 Sets and functions Lesson 2 of 5

ProofLesson PG6.2 in the Proof Gym, stage PG6: Sets and functions. About 30 minutes.

Injective, surjective and bijective maps

Simulate

Check the claim with numbers

A map f:X→Yf: X \to Y gives each element of the set XX one element of the set YY. Lesson 1.1.3 asked when a function can be run backwards. That depends on two properties: no two inputs share an output, and every element of YY is an output.

On small sets every map can be listed. A map from {0,1,2}\{0, 1, 2\} to {0,1}\{0, 1\} is a tuple of three outputs, such as (1,0,1)(1, 0, 1). The cell counts the maps between sets of sizes mm and nn, and how many have each property.

⌘/Ctrl + Enter runs the cell

From 2 elements to 3, 6 of the 9 maps keep outputs apart, but none reaches all 3 elements. From 3 to 2, 6 of the 8 maps reach both elements, but none keeps 3 outputs apart. Only between sets of the same size, 3 and 3, do 6 maps have both properties.

Now chain two maps. The cell tries every ff from a 2-element set to a 3-element set, with every gg from there to a 4-element set.

⌘/Ctrl + Enter runs the cell

In all 576 pairs, g∘fg \circ f keeps outputs apart whenever ff and gg both do. The last line shows the reverse fails: in 144 pairs g∘fg \circ f keeps them apart, but gg does not.

Conjecture

If f:X→Yf: X \to Y and g:Y→Zg: Y \to Z are both injective, then so is g∘f:X→Zg \circ f: X \to Z.

Every pair of maps between three small sets. The proof must work for every set, finite or not.

Three properties of a map

The two properties have names. A map with both has an inverse, as lesson 1.1.3 found with the horizontal line test.

Rule: Injective, surjective, bijective

injective:f(a)=f(a′)⇒a=a′surjective:each y∈Y equals some f(x)bijective: both\begin{gathered} \text{injective:} \\ f(a) = f(a') \Rightarrow a = a' \\[4pt] \text{surjective:} \\ \text{each } y \in Y \text{ equals some } f(x) \\[4pt] \text{bijective: both} \end{gathered}

Injective (one-to-one, as in lesson 1.1.3): different inputs give different outputs. Surjective (onto): every element of YY is an output. A bijective map, a bijection, pairs off XX and YY exactly, so it has an inverse f−1:Y→Xf^{-1}: Y \to X.

To prove that a map is injective, take two inputs with the same output and show they are equal. To prove it is surjective, take any y∈Yy \in Y and find an input that gives it. Composition is as in lesson 1.1.3: (g∘f)(x)=g(f(x))(g \circ f)(x) = g\big(f(x)\big).

Format 1

Reorder the steps

Here is the proof of the claim, with its lines shuffled. Put them in order with the arrows, or drag a line by its handle.

  1. So inputs of g∘fg \circ f with the same output are equal: g∘fg \circ f is injective.
  2. By the meaning of composition, that says g(f(a))=g(f(a′))g\big(f(a)\big) = g\big(f(a')\big).
  3. The map ff is injective, so f(a)=f(a′)f(a) = f(a') gives a=a′a = a'.
  4. Suppose ff and gg are injective, and take any a,a′∈Xa, a' \in X with (g∘f)(a)=(g∘f)(a′)(g \circ f)(a) = (g \circ f)(a').
  5. The map gg is injective, and f(a)f(a) and f(a′)f(a') have the same output under gg, so f(a)=f(a′)f(a) = f(a').

Simulate

Is this map injective?

Take f(x)=x2+2xf(x) = x^2 + 2x on all real numbers. The cell evaluates it at every quarter from −5-5 to 5 with exact fractions, and looks for two inputs with the same output.

⌘/Ctrl + Enter runs the cell

Of the 41 inputs, 16 share an output with an earlier one: f(−54)=f(−34)f(-\frac{5}{4}) = f(-\frac{3}{4}), for example, and f(0)=f(−2)=0f(0) = f(-2) = 0. Kept to x≥−1x \ge -1, the 25 inputs give 25 different outputs.

Conjecture

f(x)=x2+2xf(x) = x^2 + 2x is not injective on R\mathbb{R}, but it is injective on [−1,∞)[-1, \infty).

A grid of 41 points. The collisions come in pairs placed evenly about −1-1, which the algebra should explain.

Format 3

Find the error

A proof that f(x)=x2+2xf(x) = x^2 + 2x is injective on all of R\mathbb{R}, which the simulation contradicts. One line loses part of the truth. Select it.

Simulate

Chains of surjective maps

Now the other property. The cell tries every ff from a 4-element set onto a 3-element set, with every gg from there to a 2-element set.

⌘/Ctrl + Enter runs the cell

In all 648 pairs, g∘fg \circ f reaches every element whenever ff and gg both do. Again the reverse fails: in 168 pairs g∘fg \circ f reaches every element, but ff does not.

Conjecture

If f:X→Yf: X \to Y and g:Y→Zg: Y \to Z are both surjective, then so is g∘f:X→Zg \circ f: X \to Z.

Every pair of maps between three small sets, as before. With the first claim, this makes a chain of two bijections a bijection.

Format 4

Write it

Prove that if f:X→Yf: X \to Y and g:Y→Zg: Y \to Z are surjective, then g∘fg \circ f is surjective. Then explain why a chain of two bijections is a bijection.

Saved in this browser as you type.

Write your own first: a proof you have tried to write teaches far more than one you only read.

Lesson PG6.3 uses bijections to compare the sizes of infinite sets.

Summary card

  • f:X→Yf: X \to Y is injective when f(a)=f(a′)f(a) = f(a') forces a=a′a = a', surjective when every y∈Yy \in Y is an output, and bijective when both hold. A bijection has an inverse.
  • Prove injective from two inputs with the same output; prove surjective from an arbitrary yy.
  • If ff and gg are injective, so is g∘fg \circ f; the same holds for surjective, so chains of bijections are bijections.
  • x2+2xx^2 + 2x is not injective on R\mathbb{R}, since f(0)=f(−2)f(0) = f(-2). Taking square roots gives ±\pm; on [−1,∞)[-1, \infty) the minus sign cannot happen.

Free further reading

Optional. This lesson covers what you need; these add more examples and practice. All are free to read.