girgit.org

Relations and Functions

Both at once: bijective functions, and the finite vs infinite surprise

The big ideaA bijective function is both one-one and onto, a perfect pairing of domain and co-domain; for a finite set mapped to itself, one-one and onto always come together, but for infinite sets like \( \mathbf{N} \) they can come apart.

In simple words

A perfect cinema show: every person has a seat, no two people share a seat, and no seat is empty. People and seats are matched one to one. In a small hall, if nobody shares a seat, the hall must be full. But in a hall with endless seats, strange things happen: you can seat everyone with no sharing and still leave seats empty.

One-one and onto: bijective

A function f : X → Y is bijective (or one-one and onto, or a bijection) if it is both one-one and onto. In an arrow diagram, every point on the right receives exactly one arrow. On a graph of a real function, every horizontal line in the co-domain cuts it exactly once.

FunctionOne-one?Onto?Type
f : \( \mathbf{R} \to \mathbf{R} \), 3x − 5YesYesbijective
f : \( \mathbf{R} \to \mathbf{R} \), x³YesYesbijective
f : [0, ∞) → [0, ∞), x²YesYesbijective
f : \( \mathbf{N} \to \mathbf{N} \), x + 1YesNo (1 missed)one-one, into
f : \( \mathbf{R} \to [0, \infty) \), x²NoYesmany-one, onto
f : \( \mathbf{R} \to \mathbf{R} \), x²NoNoneither
f : \( \mathbf{R} \to \mathbf{R} \), |x|NoNoneither
f : \( \mathbf{R} - \{0\} \to \mathbf{R} - \{0\} \), 1/xYesYesbijective

To prove f is bijective, do both proofs: the "equal outputs give equal inputs" argument for one-one and the "solve for x" argument for onto.

On a finite set, one-one and onto go together

Take f : {1, 2, 3} → {1, 2, 3}.

  • If f is one-one, the three inputs go to three different outputs. But there are only three outputs, so all of them are used: f is onto.
  • If f is onto, the three outputs are all used by just three inputs, so no two inputs can share: f is one-one.

The same holds for any finite set X: a function f : X → X is one-one if and only if it is onto. More generally, if X and Y are finite with the same number of elements, f : X → Y is one-one exactly when it is onto.

Try it: guess first, then try to break the rule by rewiring the arrows.

Guess first: can a function on \( \mathbf{N} \) be one-one but not onto?

You just saw that on {1, 2, 3}, one-one forces onto. Guess: does the same happen on \( \mathbf{N} \) = {1, 2, 3, …}?

See what happens
No. Take f(n) = n + 1. Different inputs give different outputs, so it is one-one. But nothing gives 1, so it is not onto. The finite-set argument breaks because "all the outputs are used up" only works when you can run out. Going the other way, g(n) = ⌈n/2⌉ (n divided by 2, rounded up) sends 1, 2, 3, 4, 5, 6, … to 1, 1, 2, 2, 3, 3, …. Every natural number is reached, so g is onto, but g(1) = g(2), so it is not one-one. Breaking the link between one-one and onto is a defining difference between finite and infinite sets.

Try it: guess first, then run the move in the endless hotel and in one with N rooms.

A bijection that surprises

Here is a bijection that pairs off the natural numbers with all the integers: send 1, 2, 3, 4, 5, 6, 7, … to 0, 1, −1, 2, −2, 3, −3, …. In formula form, f(n) = n/2 when n is even and f(n) = −(n − 1)/2 when n is odd. Every integer is hit exactly once. So in this precise sense \( \mathbf{Z} \), which looks "twice as big", has the same number of elements as \( \mathbf{N} \).

Adding bijections can spoil them

f(x) = x and g(x) = −x are both bijections from \( \mathbf{R} \) to \( \mathbf{R} \). But (f + g)(x) = x + (−x) = 0 for every x, a constant function, which is neither one-one nor onto. So the sum of one-one functions need not be one-one, and the sum of onto functions need not be onto.

Remember

  • Bijective = one-one + onto: every output hit exactly once.
  • For a finite set X, f : X → X is one-one if and only if it is onto.
  • For infinite sets this fails: n + 1 on \( \mathbf{N} \) is one-one but not onto.
  • Sums of one-one (or onto) functions need not be one-one (or onto).

Try it. Decide the type of f : \( \mathbf{R} \to \mathbf{R} \), f(x) = 7 − 2x.

Answer
One-one: \( 7 - 2x_1 = 7 - 2x_2 \) gives \( x_1 = x_2 \). Onto: for any y, \( x = \frac{7 - y}{2} \) is real and gives f(x) = y. So f is bijective.

Words to know

Bijective (bijection)
One-one and onto: a perfect one-to-one pairing.
Finite set
A set you can finish counting.
Infinite set
A set that never runs out, like \( \mathbf{N} \).
\( \lceil x \rceil \)
x rounded up to the nearest integer.

f : {a, b, c, d} → {a, b, c, d} is onto. What else must be true?

  1. f is one-one
  2. f may be many-one
  3. f(x) = x for every x

f : \( \mathbf{N} \to \mathbf{N} \), f(n) = 3n. Which is correct?

  1. f is bijective, because it is one-one
  2. f is one-one but not onto
  3. f is onto but not one-one

Which function from \( \mathbf{R} \) to \( \mathbf{R} \) is bijective?

  1. f(x) = x⁴
  2. f(x) = 5x + 2
  3. f(x) = [x]