Skip to content
Skip to page content
soylai.com

Relations and Functions — chapter notes

7 sections 6 min readBeta

1. Relations

A relation RR from AA to BB is a subset of A×BA \times B; a relation on AA is a subset of A×AA \times A. We write a R ba\,R\,b for (a,b)∈R(a, b) \in R.

  • Empty relation: no pairs (R=∅R = \varnothing).
  • Universal relation: every pair (R=A×AR = A \times A).
  • Identity relation: IA={(a,a):a∈A}I_A = \{(a, a) : a \in A\}.

If n(A)=nn(A) = n, then A×AA \times A has n2n^2 pairs and there are 2n22^{n^2} relations on AA.

The two extremes and the identity.
Relation on A={1,2}A = \{1, 2\}PairsNumber of pairs
Empty relation∅\varnothing00
Universal relation A×AA \times A{(1,1),(1,2),(2,1),(2,2)}\{(1, 1), (1, 2), (2, 1), (2, 2)\}44
Identity relation IAI_A{(1,1),(2,2)}\{(1, 1), (2, 2)\}22

Formulas

  • Counting relations
    number of relations on A=2n2\text{number of relations on } A = 2^{n^2}

Key terms

Relation on A

Any subset of A×AA \times A.

Empty relation

The relation with no ordered pairs.

Universal relation

The relation A×AA \times A, containing every pair.

2. Reflexive, symmetric and transitive relations

  • Reflexive: (a,a)∈R(a, a) \in R for every a∈Aa \in A.
  • Symmetric: (a,b)∈R⇒(b,a)∈R(a, b) \in R \Rightarrow (b, a) \in R.
  • Transitive: (a,b)∈R(a, b) \in R and (b,c)∈R⇒(a,c)∈R(b, c) \in R \Rightarrow (a, c) \in R.

The three properties are independent: any combination can occur. The empty relation on a non-empty set is symmetric and transitive (vacuously) but not reflexive. "Is perpendicular to" on lines is symmetric only; "divides" on N\mathbb{N} is reflexive and transitive but not symmetric.

To show a property fails, give one counterexample. To show it holds, argue with general elements.

Each property can hold or fail independently of the others.
Relation on {1,2,3}\{1, 2, 3\}ReflexiveSymmetricTransitive
{(1,1),(2,2),(3,3)}\{(1, 1), (2, 2), (3, 3)\}✓✓✓
{(1,1),(2,2),(3,3),(1,2)}\{(1, 1), (2, 2), (3, 3), (1, 2)\}✓✗✓
{(1,2),(2,1)}\{(1, 2), (2, 1)\}✗✓✗
{(1,2),(2,3),(1,3)}\{(1, 2), (2, 3), (1, 3)\}✗✗✓
{(1,1),(2,2),(3,3),(1,2),(2,1),(2,3),(3,2)}\{(1, 1), (2, 2), (3, 3), (1, 2), (2, 1), (2, 3), (3, 2)\}✓✓✗
∅\varnothing✗✓✓

Formulas

  • Transitive
    (a,b)∈R, (b,c)∈R  ⇒  (a,c)∈R(a, b) \in R,\ (b, c) \in R \;\Rightarrow\; (a, c) \in R

Key terms

Reflexive

Every element is related to itself.

Symmetric

Every pair comes with its reverse.

Transitive

a R ba\,R\,b and b R cb\,R\,c force a R ca\,R\,c.

3. Equivalence relations and classes

A relation that is reflexive, symmetric and transitive is an equivalence relation. The equivalence class of aa is [a]={x∈A:x R a}[a] = \{x \in A : x\,R\,a\}.

Facts: a∈[a]a \in [a]; [a]=[b][a] = [b] if a R ba\,R\,b; otherwise [a]∩[b]=∅[a] \cap [b] = \varnothing. The classes form a partition of AA: disjoint, non-empty, and covering AA.

Shortcut: a relation of the form "xx and yy have the same value of some property" (same remainder, same digit sum, same room, same birth year) is always an equivalence relation, because equality is.

Example: on {1,…,9}\{1, \dots, 9\}, "same remainder on division by 33" has classes {1,4,7}\{1, 4, 7\}, {2,5,8}\{2, 5, 8\}, {3,6,9}\{3, 6, 9\}.

To make a relation an equivalence relation with the fewest additions: add all (a,a)(a, a), the reverses, then whatever transitivity forces.

Classes do not overlap and together cover $A$: a partition.
Remainder on division by 33Equivalence class
11[1]={1,4,7}[1] = \{1, 4, 7\}
22[2]={2,5,8}[2] = \{2, 5, 8\}
00[3]={3,6,9}[3] = \{3, 6, 9\}

Formulas

  • Equivalence class
    [a]={x∈A:x R a}[a] = \{x \in A : x\,R\,a\}

Key terms

Equivalence relation

Reflexive, symmetric and transitive.

Equivalence class

[a][a]: all elements related to aa.

Partition

Splitting a set into non-empty, non-overlapping pieces that cover it.

4. Writing an equivalence proof

Model: on Z\mathbb{Z}, a R b  ⟺  6∣(a+5b)a\,R\,b \iff 6 \mid (a + 5b).

  1. Reflexive: a+5a=6aa + 5a = 6a, divisible by 66.
  2. Symmetric: if a+5b=6ka + 5b = 6k, then b+5a=6(a+b)−(a+5b)=6(a+b−k)b + 5a = 6(a + b) - (a + 5b) = 6(a + b - k).
  3. Transitive: if a+5b=6ka + 5b = 6k and b+5c=6mb + 5c = 6m, then a+5c=6(k+m−b)a + 5c = 6(k + m - b).

Write each condition as "=6×= 6 \times integer", rearrange, and finish each line with the conclusion (a R aa\,R\,a, b R ab\,R\,a, a R ca\,R\,c). Use general letters, never only numbers.

Three properties, each proved for general elements.

Key terms

Counterexample

One specific case showing that a general statement is false.

5. One-one, onto and bijective functions

A function f:A→Bf : A \to B gives each x∈Ax \in A exactly one image f(x)∈Bf(x) \in B. Range ={f(x):x∈A}⊆B= \{f(x) : x \in A\} \subseteq B.

  • One-one (injective): f(x1)=f(x2)⇒x1=x2f(x_1) = f(x_2) \Rightarrow x_1 = x_2 (no element of BB gets two arrows).
  • Onto (surjective): for every y∈By \in B there is x∈Ax \in A with f(x)=yf(x) = y (range =B= B).
  • Bijective: one-one and onto.

Not one-one: give x1≠x2x_1 \ne x_2 with f(x1)=f(x2)f(x_1) = f(x_2). Not onto: give y∈By \in B with no pre-image. For real functions, the horizontal line test is a guide: a line meeting the graph twice means not one-one.

Bijective: every element of $B$ receives exactly one arrow.
One-one: no element of $B$ receives two arrows.
Onto: every element of $B$ receives at least one arrow.

Formulas

  • One-one
    f(x1)=f(x2)  ⇒  x1=x2f(x_1) = f(x_2) \;\Rightarrow\; x_1 = x_2

Key terms

One-one (injective)

Different inputs give different outputs.

Onto (surjective)

Every element of the codomain is an output.

Bijective

Both one-one and onto.

6. Proving properties of real functions

One-one: assume f(x1)=f(x2)f(x_1) = f(x_2) and simplify to x1=x2x_1 = x_2 (for rational functions, cross-multiply).

Onto: take any yy in the codomain, solve f(x)=yf(x) = y, and check that xx is in the domain (real, not an excluded value, a natural number or integer where required).

The domain and codomain matter: x2x^2 is neither one-one nor onto on R→R\mathbb{R} \to \mathbb{R}, onto for R→[0,∞)\mathbb{R} \to [0, \infty), and bijective for [0,∞)→[0,∞)[0, \infty) \to [0, \infty). Linear ax+bax + b (a≠0a \ne 0) and x3x^3 are bijections of R\mathbb{R}. On N\mathbb{N}, n+1n + 1 and 2n2n are one-one but not onto.

Example: f(x)=x+2x−1f(x) = \dfrac{x + 2}{x - 1} on R−{1}→R−{1}\mathbb{R} - \{1\} \to \mathbb{R} - \{1\} has pre-image x=y+2y−1x = \dfrac{y + 2}{y - 1}, so it is a bijection.

  • y=x+2x−1y = \dfrac{x + 2}{x - 1}
  • y=1y = 1 (never reached)
Each value except $1$ is taken exactly once.
Same rule, different domain or codomain, different answers.
FunctionOne-one?Onto?
x2:R→Rx^2 : \mathbb{R} \to \mathbb{R}✗ (f(−2)=f(2)f(-2) = f(2))✗ (−1-1 missed)
x2:R→[0,∞)x^2 : \mathbb{R} \to [0, \infty)✗✓
x2:[0,∞)→[0,∞)x^2 : [0, \infty) \to [0, \infty)✓✓

Formulas

  • Onto proof
    f(x)=y  ⇒  x=⋯∈domainf(x) = y \;\Rightarrow\; x = \dots \in \text{domain}

Key terms

Pre-image

An xx with f(x)=yf(x) = y.

Codomain

The set B in f : A → B; the range may be smaller.

7. Counting functions on finite sets

Let n(A)=mn(A) = m and n(B)=nn(B) = n.

  • All functions A→BA \to B: nmn^m.
  • One-one: n(n−1)(n−2)⋯(n−m+1)n(n - 1)(n - 2) \cdots (n - m + 1) if m≤nm \le n; none if m>nm > n.
  • Onto: none if m<nm < n. To 22 elements: 2m−22^m - 2. To 33 elements: 3m−3⋅2m+33^m - 3 \cdot 2^m + 3.
  • Bijections A→AA \to A with n(A)=nn(A) = n: n!n!. Between finite sets of equal size, one-one   ⟺  \iff onto.

Examples: {1,2,3}→{a,b,c,d}\{1, 2, 3\} \to \{a, b, c, d\}: 6464 functions, 2424 one-one, 00 onto. {1,2,3,4}→{a,b,c}\{1, 2, 3, 4\} \to \{a, b, c\}: 8181 functions, 3636 onto.

One-one needs $m \le n$; onto needs $m \ge n$; both need $m = n$.
∣A∣=m|A| = m, ∣B∣=n|B| = nAll functions nmn^mOne-oneOnto
m=3m = 3, n=4n = 46464242400
m=4m = 4, n=3n = 38181003636
m=3m = 3, n=3n = 327276666
m=5m = 5, n=2n = 23232003030

Formulas

  • All and one-one functions
    nm,n(n−1)⋯(n−m+1)n^m, \qquad n(n-1)\cdots(n-m+1)
  • Onto a 3-element set
    3m−3⋅2m+33^m - 3 \cdot 2^m + 3

Key terms

Bijection on a finite set

An arrangement of its elements; there are n!n!.

Exam tips

How marks are awarded

  • Equivalence relation (3–5 marks): reflexive 1 + symmetric 1 + transitive 1, each with general letters; classes 1–2 if asked.
  • Property fails (1–2 marks): one explicit counterexample, stated as pairs.
  • One-one / onto (2–5 marks): one-one argument 1–2 + onto with pre-image and domain check 1–2 + conclusion.
  • Counting (1 mark): nmn^m, one-one, onto counts, with the reason in written answers.

Common mistakes

  1. Checking reflexivity for some elements only.
  2. Proving symmetry or transitivity with numbers instead of general elements.
  3. Forgetting that the empty relation is symmetric and transitive.
  4. Assuming a symmetric, transitive relation must be reflexive.
  5. Claiming onto after solving f(x)=yf(x) = y without checking xx is in the domain (N\mathbb{N}, Z\mathbb{Z}, excluded values).
  6. Ignoring the codomain: x2x^2 is onto [0,∞)[0, \infty) but not onto R\mathbb{R}.
  7. Writing mnm^n instead of nmn^m for the number of functions from mm to nn elements.
  8. Using composition or inverse functions: not in the 2026–27 syllabus.