Why this mat­ters

Think about how "equals" behaves. Every­thing equals itself, it works in both direc­tions, and you can chain it along. Some rela­tions behave in exactly the same way, and when they do, they sort a set neatly into groups that never over­lap. In this chap­ter we name these prop­er­ties (reflex­ive, sym­met­ric, tran­si­tive), meet equiv­a­lence rela­tions and their classes, and then sort func­tions into one-one, onto, or both.

Types of rela­tions

A rela­tion RR on a set AA is sim­ply a sub­set of A×AA \times A. We call it

  • empty if R=∅R = \varnothing, uni­ver­sal if R=A×AR = A \times A;
  • reflex­ive if (a,a)∈R(a, a) \in R for every a∈Aa \in A;
  • sym­met­ric if (a,b)∈R⇒(b,a)∈R(a, b) \in R \Rightarrow (b, a) \in R;
  • tran­si­tive if (a,b),(b,c)∈R⇒(a,c)∈R(a, b), (b, c) \in R \Rightarrow (a, c) \in R.

When a rela­tion has all three of the last prop­er­ties, we call it an equiv­a­lence rela­tion.

Exam­ple 1. On Z\mathbf{Z}, R={(a,b):a−b is divisible by 4}R = \{(a, b) : a - b \text{ is divisible by } 4\}. Check each prop­erty in turn. It is reflex­ive, because a−a=0a - a = 0. It is sym­met­ric, because if 4∣a−b4 \mid a - b then 4∣b−a4 \mid b - a. It is tran­si­tive, because a−c=(a−b)+(b−c)a - c = (a - b) + (b - c). So RR is an equiv­a­lence rela­tion.

Exam­ple 2. On {1,2,3}\{1, 2, 3\}, R={(1,1),(2,2),(3,3),(1,2)}R = \{(1, 1), (2, 2), (3, 3), (1, 2)\} is reflex­ive and tran­si­tive, but it is not sym­met­ric, since (2,1)∉R(2, 1) \notin R.

Exam­ple 3. Take all the lines in a plane. "Is per­pen­dic­u­lar to" is sym­met­ric, but it is nei­ther reflex­ive nor tran­si­tive. "Is par­al­lel to", if we agree that a line is par­al­lel to itself, turns out to be an equiv­a­lence rela­tion.

Exam­ple 4. On R\mathbf{R}, a R b  ⟺  a≤b2a \, R \, b \iff a \le b^2. This one fails all three tests: it is not reflex­ive (12>14\displaystyle \tfrac{1}{2} > \tfrac{1}{4}), not sym­met­ric ((1,3)∈R(1, 3) \in R, (3,1)∉R(3, 1) \notin R), not tran­si­tive (3≤(−2)23 \le (-2)^2, −2≤12-2 \le 1^2, but 3>123 > 1^2).

Equiv­a­lence classes

Given an equiv­a­lence rela­tion, the class of aa is [a]={x:(x,a)∈R}[a] = \{x : (x, a) \in R\}, the set of every­thing related to it. Here is the lovely part: any two classes are either exactly the same or com­pletely sep­a­rate, and together they fill the whole set. Exam­ple 1 has four classes: [0][0] (mul­ti­ples of 44), [1][1], [2][2], [3][3].

Exam­ple 5. On A={1,2,…,10}A = \{1, 2, \ldots, 10\}, R={(a,b):∣a−b∣ is even}R = \{(a, b) : \lvert a - b \rvert \text{ is even}\}. The classes are {1,3,5,7,9}\{1, 3, 5, 7, 9\} and {2,4,6,8,10}\{2, 4, 6, 8, 10\}, and noth­ing in one is related to any­thing in the other.

The set {1, 2, ..., 10} split by a dashed line into two classes under |a - b| even: the odd numbers 1, 3, 5, 7, 9 and the even numbers 2, 4, 6, 8, 10.
The rela­tion sorts the set into two dis­joint classes that together cover it.

Types of func­tions

Now to func­tions. We say f:A→Bf : A \to B is

  • one-one (injec­tive) if f(x1)=f(x2)⇒x1=x2f(x_1) = f(x_2) \Rightarrow x_1 = x_2, so dif­fer­ent inputs always give dif­fer­ent out­puts;
  • onto (sur­jec­tive) if every b∈Bb \in B is f(a)f(a) for some aa, so the range is the whole of BB;
  • bijec­tive if it is both.

A handy short­cut: for finite sets with n(A)=n(B)n(A) = n(B), one-one and onto mean the same thing, so check­ing one is enough.

Exam­ple 6. f:R→Rf : \mathbf{R} \to \mathbf{R}, f(x)=3x−5f(x) = 3x - 5. It is one-one (3x1−5=3x2−5⇒x1=x23x_1 - 5 = 3x_2 - 5 \Rightarrow x_1 = x_2) and onto (y=f(y+53)\displaystyle y = f\left(\tfrac{y + 5}{3}\right)), so it is bijec­tive.

Exam­ple 7. f:R→Rf : \mathbf{R} \to \mathbf{R}, f(x)=x2+1f(x) = x^2 + 1. It is not one-one, since f(2)=f(−2)f(2) = f(-2), and it is not onto, since 00 has no preim­age.

Graph of y = x squared + 1: the horizontal line y = 5 meets it twice, at x = -2 and x = 2, so f is not one-one; the value 0 is never reached, so f is not onto.
A hor­i­zon­tal line meets the graph twice, and val­ues below 1 are never reached.

Exam­ple 8. f:N→Nf : \mathbf{N} \to \mathbf{N}, f(n)=2nf(n) = 2n is one-one but not onto, because it misses every odd num­ber. g:N→Ng : \mathbf{N} \to \mathbf{N}, g(n)=⌈n2⌉\displaystyle g(n) = \left\lceil \tfrac{n}{2} \right\rceil is the other way round: onto, but not one-one.

Prac­tice

  1. On {1,2,3,4}\{1, 2, 3, 4\}, work out which prop­er­ties each rela­tion has: R1={(1,1),(2,2),(3,3),(4,4),(1,3),(3,1)}R_1 = \{(1, 1), (2, 2), (3, 3), (4, 4), (1, 3), (3, 1)\}; R2={(1,2),(2,1)}R_2 = \{(1, 2), (2, 1)\}; R3={(1,2),(2,3),(1,3)}R_3 = \{(1, 2), (2, 3), (1, 3)\}.
  2. Show that R={(a,b):a−b is a multiple of 5}R = \{(a, b) : a - b \text{ is a multiple of } 5\} on Z\mathbf{Z} is an equiv­a­lence rela­tion. Describe [2][2].
  3. On the set of all tri­an­gles, show that "is sim­i­lar to" is an equiv­a­lence rela­tion.
  4. On N\mathbf{N}, is R={(a,b):a divides b}R = \{(a, b) : a \text{ divides } b\} reflex­ive? Sym­met­ric? Tran­si­tive?
  5. Give an exam­ple of a rela­tion on {1,2,3}\{1, 2, 3\} that is sym­met­ric and tran­si­tive but not reflex­ive.
  6. On A={1,2,…,12}A = \{1, 2, \ldots, 12\}, R={(a,b):3∣a−b}R = \{(a, b) : 3 \mid a - b\}. List the equiv­a­lence classes.
  7. Decide one-one / onto: f:R→Rf : \mathbf{R} \to \mathbf{R}, f(x)=5−2xf(x) = 5 - 2x; f:R→Rf : \mathbf{R} \to \mathbf{R}, f(x)=∣x∣f(x) = \lvert x \rvert; f:N→Nf : \mathbf{N} \to \mathbf{N}, f(n)=n+3f(n) = n + 3; f:R→Rf : \mathbf{R} \to \mathbf{R}, f(x)=x3f(x) = x^3.
  8. Show that f:R−{2}→R−{1}f : \mathbf{R} - \{2\} \to \mathbf{R} - \{1\}, f(x)=x−1x−2\displaystyle f(x) = \tfrac{x - 1}{x - 2} is a bijec­tion.
  9. How many one-one func­tions are there from {a,b}\{a, b\} to {1,2,3}\{1, 2, 3\}? Onto func­tions from {1,2,3}\{1, 2, 3\} to {a,b}\{a, b\}?
  10. Is the signum func­tion one-one? Onto R\mathbf{R}?

Answers

Show answers
  1. R1R_1: equiv­a­lence. R2R_2: sym­met­ric only (not reflex­ive; not tran­si­tive since (1,1)∉R2(1, 1) \notin R_2). R3R_3: tran­si­tive only.
  2. 5∣05 \mid 0; 5∣a−b⇒5∣b−a5 \mid a - b \Rightarrow 5 \mid b - a; sum of mul­ti­ples of 55. [2]={…,−8,−3,2,7,12,…}[2] = \{\ldots, -8, -3, 2, 7, 12, \ldots\}.
  3. Every tri­an­gle is sim­i­lar to itself, sim­i­lar­ity works both ways, and it chains along.
  4. Reflex­ive and tran­si­tive, but not sym­met­ric.
  5. {(1,1),(2,2)}\{(1, 1), (2, 2)\} (33 is not related to itself).
  6. {1,4,7,10}\{1, 4, 7, 10\}, {2,5,8,11}\{2, 5, 8, 11\}, {3,6,9,12}\{3, 6, 9, 12\}.
  7. Bijec­tive; nei­ther; one-one not onto (1,2,31, 2, 3 missed); bijec­tive.
  8. f(x1)=f(x2)f(x_1) = f(x_2) gives x1=x2x_1 = x_2 after cross-mul­ti­ply­ing; for y≠1y \ne 1, x=2y−1y−1\displaystyle x = \tfrac{2y - 1}{y - 1} gives f(x)=yf(x) = y.
  9. 3×2=63 \times 2 = 6; 23−2=62^3 - 2 = 6.
  10. No; no (range {−1,0,1}\{-1, 0, 1\}).