← back to proofs

Functions

Jim Hefferon · GFDL + CC BY-SA 2.5 · Introduction to Proofs

A function from A to B assigns exactly one element of B to each element of A. Three properties matter: injective (one-to-one), surjective (onto), and bijective (both). A function has an inverse if and only if it is bijective.

injective (no sharing) surjective (everything hit) bijective (perfect pairing)

Injective (one-to-one)

A function f is injective if f(a) = f(b) implies a = b. No two inputs map to the same output. To prove injectivity: assume f(a) = f(b), then show a = b.

Scheme

Surjective (onto)

A function f: A to B is surjective if every element of B is hit. For every b in B, there exists an a in A with f(a) = b. To prove surjectivity: given arbitrary b in B, find an explicit a.

Scheme

Bijective and inverse functions

A function is bijective if it is both injective and surjective. Bijections have inverses: f-inverse(b) is the unique a with f(a) = b. Composition of bijections is a bijection.

Scheme

Composition

If f: A to B and g: B to C, then g composed with f: A to C. Composition preserves injectivity and surjectivity. If g composed with f is injective, then f is injective. If g composed with f is surjective, then g is surjective.

Scheme
Neighbors