Mathematics Course 111: Algebra I Part I: Algebraic Structures, Sets and Permutations

D. R. Wilkins

Academic Year 1996-7

1 Number Systems and Matrix Algebra

Integers

The ‘whole numbers’ 0, ±1, ±2, ±3, ±4, … are referred to as integers. The set of all integers is denoted by ℤ. The set {1, 2, 3, 4, …} of all positive integers is denoted by ℕ. Positive integers are often referred to as natural numbers. (Some authors include zero in the set of natural numbers).

Here are some basic properties of the integers under addition:—

• the sum x + y of two integers x and y is itself an integer;

• x + y = y + x for all integers x and y (the Commutative Law for addition);

• x + (y + z) = (x + y) + z for all integers x, y and z (the Associative Law for addition);

• there is an integer 0 with the property that x + 0 = x for all integers x;

• given any integer x, there exists an integer u satisfying x + u = 0.

Many other basic properties of integers under addition can be derived formally from those listed above.

The first four of the basic properties of integers under addition listed above have analogues for multiplication:—

• the product x × y of two integers x and y is itself an integer;

• x × y = y × x for all integers x and y (the Commutative Law for multiplication);

• x × (y × z) = (x × y) × z for all integers x, y and z (the Associative Law for multiplication);

• there is an integer 1 with the property that x × 1 = x for all integers x;

Another basic property of the integers is the Distributive Law relating multiplication and addition. This states that (x + y) × z = (x × z) + (y × z) for all integers x, y and z.

The Principle of Mathematical Induction

In order to prove that certain properties hold for all positive integers, the Principle of Mathematical Induction is often employed. This principle is a consequence of the following important property of subsets of the set ℕ of positive integers:

The Principle of Mathematical Induction (for subsets of ℕ). Let T be a set of positive integers which satisfies the following conditions:

• 1 ∈ T;

• if k ∈ T for any positive integer k then k + 1 ∈ T.

Then T = ℕ.

Indeed, repeated use of these conditions ensures that 1 ∈ T, hence 2 ∈ T, hence 3 ∈ T, hence 4 ∈ T, and so on.

Suppose that one wishes to prove that a certain property holds for all positive integers. Then the set T can be taken as the set of all positive integers with the specified property, and the above induction principle can be applied. This leads to the following formulation of the Principle of Mathematical Induction.

The Principle of Mathematical Induction. Suppose that some property of positive integers is specified and that the following conditions are satisfied:

• 1 has the specified property;

• if a positive integer k has the specified property, then so does k + 1.

Then all positive integers have the specified property.

Example. The Principle of Mathematical Induction can be used to show that ∑_{i=1}^{n} i = \frac{1}{2}n(n + 1) for

all positive integers n. Clearly this equality holds when n = 1. We must show that if equality holds

when n = k, then equality holds when n = k + 1. Suppose then that ∑_{i=1}^{k} i = \frac{1}{2}k(k + 1). Then

∑_{i=1}^{k+1} i = \frac{1}{2}k(k + 1) + (k + 1) = \frac{1}{2}k^{2} + \frac{3}{2}k + 1 = \frac{1}{2}(k + 1)(k + 2).

Thus if equality holds when n = k then equality holds when n = k + 1. It now follows from the

Principle of Mathematical Induction that ∑_{i=1}^{n} i = \frac{1}{2}n(n + 1) for all positive integers n.

The following principle is a useful variant of the Principle of Mathematical Induction.

The Principle of Complete Induction. Suppose that some property of positive integers is specified and that the following conditions are satisfied:

• 1 has the specified property;

• if k is an integer greater than one, and if all positive integers j satisfying j < k have the specified property, then so does k.

Then all positive integers have the specified property.

Thus suppose that some property of positive integers satisfies these conditions. Then 1 has the property. Hence 2 has the property. Then 1 and 2 have the property, hence 3 has the property. Then 1, 2 and 3 have the property, hence 4 has the property, and so on.

The Principle of Complete Induction can be justified more formally as follows. Let T be the subset of the set ℕ of positive integers which consists of 1 together with those positive integers k greater than one for which 1, 2, …, k − 1 have the specified property. If the hypotheses of the Principle of Complete Induction are satisfied and if k ∈ T for some positive integer k then k has the specified property, and hence k + 1 ∈ T. It now follows from the Principle of Mathematical Induction that T ∈ ℕ, and thus all positive integers have the specified property.

Rational, Real and Complex Numbers

A rational number is a number of the form m/n, where m and n are both integers (‘whole numbers’). The notation ℚ is used to denote the set of all rational numbers.

The system of real numbers includes not only rational numbers but irrational numbers such as \sqrt{2} and π. (The ancient Greeks proved that there do not exist non-zero integers p and q satisfying p^{2} = 2q^{2}: this demonstrates that \sqrt{2} is not a rational number. One can think of the real numbers as comprising all numbers representing displacements along a straight line from some given point. Formal definitions of the real number system were given by Dedekind and Cantor in 1872. The notation ℝ is used to denote the set of all real numbers.

A complex number is a number representable in the form x + iy, where x and y are real numbers and i satisfies i^{2} = −1. The notation ℂ is used to denote the set of all complex numbers.

The system of rational numbers, the system of real numbers and the system of complex numbers are examples of fields. A field is a set on which are defined operations of addition and multiplication with properties corresponding to those of addition and multiplication on the rational, real and complex numbers.

Matrix algebra

Let us now consider algebraic operations on the set of all 2 × 2 matrices with real coefficients. Matrix addition is defined for 2 × 2 matrices as follows:—

( \begin{matrix}a & b \\ c & d \end{matrix} ) + ( \begin{matrix}e & f \\ g & h \end{matrix} ) = ( \begin{matrix}a + e & b + f \\ c + g & d + h \end{matrix} ) .

Matrix addition is commutative (i.e., A + B = B + A for all 2 × 2 matrices A and B) and associative (i.e., A + (B + C) = (A + B) + C for all 2 × 2 matrices A, B and C). There is a zero matrix Z with the property that A + Z = A (and Z + A = A) for all 2 × 2 matrices A. This matrix is given by

Z = ( \begin{matrix}0 & 0 \\ 0 & 0 \end{matrix} ). Moreover, given any 2 × 2 matrix A, there is a 2 × 2 matrix B satisfying A + B = Z

(and B + A = Z). If A = ( \begin{matrix}a & b \\ c & d \end{matrix} ) then B = ( \begin{matrix}−a & −b \\ −c & −d \end{matrix} ).

Matrix multiplication is defined for 2 × 2 matrices as follows:—

( \begin{matrix}a & b \\ c & d \end{matrix} ) ( \begin{matrix}e & f \\ g & h \end{matrix} ) = ( \begin{matrix}ae + bg & af + bh \\ ce + dg & cf + dh \end{matrix} ) .

The rule for matrix multiplication can be described as follows: the element in the ith row and jth column of the product is obtained by multiplying each element of the ith row of the first matrix with the corresponding element of the jth column of the second matrix, and then adding up all these products. Thus if A_{ij}, B_{ij} and M_{ij} denote the element in the ith row and jth column of matrices A, B and M respectively, where M = AB, then M_{ij} = A_{i1}B_{1j} + A_{i2}B_{2j}.

A straightforward calculation shows that multiplication of 2 × 2 matrices is associative (i.e., (AB)C = A(BC) for all 2 × 2 matrices A, B and C. However multiplication of 2 × 2 matrices is not commutative. For example,

( \begin{matrix}1 & 0 \\ 0 & 0 \end{matrix} ) ( \begin{matrix}0 & 1 \\ 0 & 0 \end{matrix} ) = ( \begin{matrix}0 & 1 \\ 0 & 0 \end{matrix} ) whereas ( \begin{matrix}0 & 1 \\ 0 & 0 \end{matrix} ) ( \begin{matrix}1 & 0 \\ 0 & 0 \end{matrix} ) = ( \begin{matrix}0 & 0 \\ 0 & 0 \end{matrix} ) .

Let I be the identity matrix ( \begin{matrix}1 & 0 \\ 0 & 1 \end{matrix} ). Then AI = A = IA for all 2 × 2 matrices A.

If A = ( \begin{matrix}a & b \\ c & d \end{matrix} ), and if ad − bc ≠ 0, then the matrix A has a well-defined inverse A^{−1} with the

property that AA^{−1} = I = A^{−1}A. The inverse matrix A^{−1} is given by the formula

A^{−1} = ( \begin{matrix}d/(ad − bc) & −b/(ad − bc) \\ −c/(ad − bc) & a/(ad − bc) \end{matrix} ) .

The quantity ad − bc is known as the determinant of a 2 × 2 matrix ( \begin{matrix}a & b \\ c & d \end{matrix} ), and is denoted by

| \begin{matrix}a & b \\ c & d \end{matrix} |. We also denote the determinant of a matrix A by det A. A straightforward calculation shows

that det A det B = det(AB) for all 2 × 2 matrices A and B. Note that if A and B are 2 × 2 matrices, and if det A ≠ 0, then there always exist a 2 × 2 matrices X and Y satisfying AX = B and Y A = B. These matrices are given by X = A^{−1}B and Y = BA^{−1}, where A^{−1} is the inverse of the matrix A.

The operations of matrix addition and matrix multiplication satisfy the distributive law: C(A + B) = CA + CB and (A + B)C = AC + BC for all 2 × 2 matrices A, B and C.

Matrices and Transformations

Matrices can be used to represent an important class of transformations of the plane known as linear transformations. These transformations include rotations about the origin (0, 0) of Cartesian coordinates, and reflections in lines passing through the origin.

A transformation sending points (x, y) of the plane to points (x′, y′) is said to be linear if there exist coefficients a, b, c and d such that x′ = ax + by and y′ = cx + dy. Note that these equations defining the transformation can be written in the form

( \begin{matrix}x′ \\ y′ \end{matrix} ) = ( \begin{matrix}a & b \\ c & d \end{matrix} ) ( \begin{matrix}x \\ y \end{matrix} ) .

We can therefore represent linear transformations of the plane that fix the origin by corresponding 2 × 2 matrices. For example an anticlockwise rotation about the origin through an angle θ sends a point (x, y) to the point

(x cos θ − y sin θ, x sin θ + y cos θ).

This rotation is therefore represented by the matrix ( \begin{matrix}cos θ & − sin θ \\ sin θ & cos θ \end{matrix} ). A straightforward calculation

shows that if linear transformations S and T are represented by matrices A and B in this way, then the composition S ∘ T of the two transformations is represented by the product AB of the matrices. (Recall that S ∘ T is the transformation obtained by first applying T and then applying S.)

2 Sets

Sets

A set is a collection of objects; these objects are known as elements of the set. If an element x belongs to a set X then we denote this fact by writing x ∈ X. Sets with small numbers of elements can be specified by listing the elements of the set enclosed within ‘curly brackets’. For example {a, b, c, d} is the set consisting of the elements a, b, c and d. Two sets are equal if and only if they have the same elements.

The empty set ∅ is the set with no elements. Standard notations ℕ, ℤ, ℚ, ℝ and ℂ are adopted for the following sets:

• the set ℕ of positive integers;

• the set ℤ of integers;

• the set ℚ of rational numbers;

• the set ℝ of real numbers;

• the set ℂ of complex numbers. A set A is said to be a subset of a set B if every element of A is also an element of B. If A is a

subset of B but is not equal to B, then we say that A is a proper subset of B. If A is a subset of a set B then we denote this fact by writing A ⊂ B. Note that A = B if and only if A ⊂ B and B ⊂ A.

Given a set X and a condition that may or may not be satisfied by elements of X, the subset of X consisting of all elements of X that satisfy the stated condition is represented using the notation

{x ∈ X : condition}.

Thus for example {n ∈ ℤ : n > 0} is the subset of the set ℤ of integers which consists of all strictly positive integers. (In certain contexts it is possible to simplify the above notation to {x : condition} if it is clear from the context what the set is to which the elements x in question belong.)

Let a and b be real numbers satisfying a ≤ b. Then intervals in the set of real numbers are denoted using the following standard notation:

• [a, b] denotes the set {x ∈ ℝ : a ≤ x ≤ b};

• (a, b) denotes the set {x ∈ ℝ : a < x < b};

• [a, b) denotes the set {x ∈ ℝ : a ≤ x < b};

• (a, b] denotes the set {x ∈ ℝ : a < x ≤ b};

• [a, +∞) denotes the set {x ∈ ℝ : x ≥ a};

• (a, +∞) denotes the set {x ∈ ℝ : x > a};

• (−∞, a] denotes the set {x ∈ ℝ : x ≤ a};

• (−∞, a) denotes the set {x ∈ ℝ : x < a}. The union, intersection and difference of two sets are defined as follows:— • the union X ∪ Y of two sets X and Y is the set consisting of all elements that belong to X or

to Y (or to both);

• the intersection X ∩ Y of two sets X and Y is the set consisting of all elements that belong to both X and Y;

• the difference X \ Y of two sets X and Y is the set consisting of all elements that belong to X but not to Y.

The sets X and Y are said to be disjoint if no element belongs to both X and Y (i.e., X ∩ Y = ∅.)

Note that X ∪ Y is the union of the three sets X ∩ Y, X \ Y and Y \ X. Moreover these three sets are pairwise disjoint (i.e., each pair is disjoint).

We can also consider unions and intersections of more than two sets. The union of a given collection of sets is the set consisting of all elements that belong to at least one of the given sets. The intersection of a given collection of sets is the set consisting of all elements that belong to every one of the given sets.

Let X_{1}, X_{2}, X_{3}, …, X_{n} be sets. We denote the union and intersection of these sets by X_{1} ∪ X_{2} ∪ X_{3} ∪ ⋯ ∪ X_{n} and X_{1} ∩ X_{2} ∩ X_{3} ∩ ⋯ ∩ X_{n} respectively.

The union and intersection of an infinite sequence X_{1}, X_{2}, X_{3}, … of sets are denoted by ⋃_{i=1}^{∞} X_{i}

and by ⋂_{i=1}^{∞} X_{i} respectively. More generally, given any collection C of sets, the union and intersection

of the sets in the collection are denoted by ⋃_{X∈C} X and ⋂_{X∈C} X respectively.

Let X be a set, and let A be a subset of X. The complement of A (in X) is the set X \ A of all elements of X that do not belong to A.

For each subset A of a given set X, let A^{c} denote the complement of A in X. Then (A ∪ B)^{c} = A^{c} ∩B^{c} and (A∩B)^{c} = A^{c} ∪B^{c} for all subsets A and B of X. These identities generalize to situations where the number of subsets of X involved is greater than two: the complement of the intersection of any collection of subsets of X is the union of the complements of those subsets; the complement of the union of any collection of subsets of X is the intersection of the complements of those subsets.

Cartesian Products of Sets

Let X and Y be sets. An element x of X and an element y of Y together specify an ordered pair (x, y). Ordered pairs (x, y) are characterized by the following property:

(x, y) = (u, v) if and only if x = u and y = v.

The set of all ordered pairs (x, y) with x ∈ X and y ∈ Y is referred to as the Cartesian product of the sets X and Y, and is denoted by X × Y.

Example. The Cartesian product ℝ × ℝ consists of all ordered pairs (x, y) where x and y are real numbers. This set is denoted by ℝ^{2}.

Example. Let X = {1, 2, 3} and Y = {2, 4}. Then

X × Y = {(1, 2), (1, 4), (2, 2), (2, 4), (3, 2), (3, 4)}.

The Cartesian product X_{1} ×X_{2} ×X_{3} ×⋯×X_{n} of n sets X_{1}, X_{2}, X_{3}, …, X_{n} consists of all ordered n-tuples (x_{1}, x_{2}, …, x_{n}) with x_{i} ∈ X_{i} for i = 1, 2, 3, …, n.

Example. Points of 3-dimensional space are represented with respect to a Cartesian co-ordinate system as ordered triples (x, y, z), where x, y and z are real numbers. The set of all such ordered triples is the Cartesian product ℝ × ℝ × ℝ (denoted by ℝ^{3}).

Note that if X_{i} is a finite set with m_{i} elements for i = 1, 2, …, n, then the Cartesian product X_{1} × X_{2} × X_{3} × ⋯ × X_{n} has m_{1}m_{2}m_{3} ⋯ m_{n} elements.

Relations

Let X be a set. A binary relation on X determines, for elements u and v of X, whether or not u is related to v. For example, there is a binary relation on the set of real numbers, where two real numbers x and y are related if and only if x is less than y.

It is traditional to denote binary relations by inserting the symbol for the relation between any two elements that are related. Thus if ∼ is a relation on a set X then u ∼ v is true for elements u and v of X if and only if u and v are related. Familiar examples of this notation are provided by the relations = (‘equals’), < (‘less than’) and ≤ (‘less than or equal to’) on sets of numbers.

Any binary relation ∼ on a set X determines a corresponding subset {(u, v) ∈ X × X : u ∼ v} of the Cartesian product X × X. Conversely any subset R of X × X determines a corresponding relation ∼ on X, where elements u and v of X satisfy u ∼ v if and only if (u, v) ∈ R. There is thus a one-to-one correspondence between binary relations on a set X and subsets of X × X.

Equivalence Relations

Let ∼ be a binary relation on a set S.

• The relation ∼ is reflexive on S if the following is true: x ∼ x for all elements x of S.

• The relation ∼ is symmetric on S if the following is true: if x and y are elements of S and if x ∼ y then y ∼ x.

• The relation ∼ is transitive on S if the following is true: if x, y and z are elements of S and if if x ∼ y and y ∼ z then x ∼ z.

Example. The relation = (i.e., ‘is equal to’) is reflexive, symmetric and transitive on any set.

Example. The relation < (i.e., ‘is less than’) is transitive on the set of real numbers but is neither reflexive nor symmetric.

Example. The relation ≤ (i.e., ‘is less than of equal to’) is reflexive and transitive on the set of real numbers but is not symmetric.

Example. The relation ≠ (i.e., ‘is not equal to’) is symmetric on the set of real numbers but is neither reflexive nor transitive.

Example. The relation ‘has the same number of elements as’ is reflexive, symmetric and transitive on any collection of finite sets.

Definition. An equivalence relation on a given set is a binary relation on that set which is reflexive, symmetric and transitive.

The relation of equality is an equivalence relation on any set.

The relation < (i.e., ‘is less than’) is not an equivalence relation on the set of real numbers because it is neither reflexive nor symmetric.

Definition. Let ∼ be an equivalence relation on a set X. The equivalence class of x in X (with respect to the equivalence relation ∼) is the set C_{x} consisting of all elements of X that are related to x. Thus

C_{x} = {y ∈ X : x ∼ y}.

Lemma 2.1. Let ∼ be an equivalence relation on a set X, and, for each x ∈ X, let C_{x} denote equivalence class of x, defined by

C_{x} = {y ∈ X : x ∼ y}.

Then the following are true:

(i) x ∈ C_{x} for all x ∈ X;

(ii) y ∈ C_{x} if and only if C_{x} = C_{y};

(iii) if x and y are elements of X and if C_{x} ∩ C_{y} is non-empty, then C_{x} = C_{y};

(iv) an element x of X belongs to exactly one equivalence class.

Proof. The fact that x ∈ C_{x} for all x ∈ X follows immediately from the fact that any equivalence relation is required to be reflexive. This proves (i).

Suppose that y ∈ C_{x}. Then x ∼ y. Also y ∼ x, since any equivalence relation is transitive. If z ∈ C_{y} then x ∼ y and y ∼ z, and hence x ∼ z, since any equivalence relation is transitive. It follows that if z ∈ C_{y} then z ∈ C_{x}, and thus C_{y} ⊂ C_{x}. Similarly C_{x} ⊂ C_{y}. Thus if y ∈ C_{x} then C_{x} = C_{y}. Conversely if C_{x} = C_{y} then y ∈ C_{x}, since y ∈ C_{y}. This proves (ii).

Next note that if x and y are elements of X and if C_{x} ∩ C_{y} is non-empty, then there exists some element z of X such that z ∈ C_{x} and z ∈ C_{y}. It follows from (ii) that C_{x} = C_{z} and C_{y} = C_{z}, and therefore C_{x} = C_{y}. This proves (iii).

Finally (iv) is a consequence of (i) and (iii).

Definition. Let X be a set. A partition of X is a collection of subsets of X with the property that every element of X belongs to exactly one of these subsets.

Let an equivalence relation be given on a set X. Then the collection of equivalence classes constitutes a partition of X. Conversely any partition of a set X determines an equivalence relation, where two elements of X are related if and only if they belong to the same subset in the partition.

Congruence

Let n be a positive integer. Two integers x and y are said to be congruent modulo n if x − y is divisible by n. If x and y are congruent modulo n then we write x ≡ y mod n to denote this fact; if x and y are not congruent modulo n then we write x ≢ y mod n.

Lemma 2.2. Let n be a positive integer. Then the relation of congruence modulo n is an equivalence relation on the set ℤ of integers.

Proof. Let x be an integer. Then x ≡ x mod n. Thus the relation of congruence modulo n is reflexive.

If x and y are integers, and if x ≡ y mod n then y ≡ x mod n, for if x − y is divisible by n then so is y − x. Thus the relation of congruence modulo n is symmetric.

Suppose that x, y and z are integers and that x ≡ y mod n and y ≡ z mod n. Then x − y and y − z are divisible by n. But then x − z is divisible by n, since x − z = (x − y) + (y − z). It follows that x ≡ z mod n. Thus the relation of congruence modulo n is transitive.

The relation of congruence modulo n is reflexive, symmetric and transitive, and is thus an equivalence relation on the set of integers.

Let n be a positive integer. The equivalence class of an integer x under the relation of congruence modulo n is referred to as the congruence class of x modulo n; this congruence class consists of all integers y for which x − y is divisible by n. Every integer belongs to exactly one congruence class modulo n. The set of congruence classes of integers modulo n is denoted by ℤ_{n}. It is easy to see that any integer is congruent to exactly one of the integers 0, 1, 2, …, n − 1 modulo n. It follows that ℤ_{n} has n elements.

Let us denote by [x]_{n} the congruence class of an integer x modulo a positive integer n. Then [x]_{n} = [y]_{n} if and only if x ≡ y mod n.

Lemma 2.3. Let n be a positive integer, and let x, y, u and v be integers. Suppose that x ≡ u mod n and y ≡ v mod n. Then x + y ≡ u + v mod n and xy ≡ uv mod n.

Proof. The numbers x − u and y − v are divisible by n, since x ≡ u mod n and y ≡ v mod n. It follows that (x + y) − (u + v) is divisible by n, since

(x + y) − (u + v) = (x − u) + (y − v).

Also xy − uv is divisible by n, since

xy − uv = (x − u)y + u(y − v).

Thus x + y ≡ u + v mod n and xy ≡ uv mod n.

Let n be a positive integer. Lemma 2.3 ensures that there are well-defined operations of addition and multiplication on the set ℤ_{n} of equivalence classes of integers modulo n. These operations are defined so that [x]_{n} + [y]_{n} = [x + y]_{n} and [x]_{n}[y]_{n} = [xy]_{n} for all integers x and y. Clearly these operations are commutative and associative, and multiplication on ℤ_{n} is distributive over addition.

When n is small the algebraic operations on ℤ_{n} can be tabulated. Here is the multiplation table for ℤ_{6}:

\begin{matrix}× & [0]_{6} & [1]_{6} & [2]_{6} & [3]_{6} & [4]_{6} & [5]_{6} \\ [0]_{6} & [0]_{6} & [0]_{6} & [0]_{6} & [0]_{6} & [0]_{6} & [0]_{6} \\ [1]_{6} & [0]_{6} & [1]_{6} & [2]_{6} & [3]_{6} & [4]_{6} & [5]_{6} \\ [2]_{6} & [0]_{6} & [2]_{6} & [4]_{6} & [0]_{6} & [2]_{6} & [4]_{6} \\ [3]_{6} & [0]_{6} & [3]_{6} & [0]_{6} & [3]_{6} & [0]_{6} & [3]_{6} \\ [4]_{6} & [0]_{6} & [4]_{6} & [2]_{6} & [0]_{6} & [4]_{6} & [2]_{6} \\ [5]_{6} & [0]_{6} & [5]_{6} & [4]_{6} & [3]_{6} & [2]_{6} & [1]_{6} \end{matrix} .

A congruence class in the body of such a table represents the sum or product of the congruence classes labelling the row and the column in which it occurs. For example, we can read off from the above table that [2]_{6} × [5]_{6} = [4]_{6}.

3 Functions

Let X and Y be sets. A function f: X → Y from X to Y assigns to each element x of the set X exactly one element f(x) of the set Y. The set X is the domain of the function, and the set Y is the co-domain of the function.

The notation f: X → Y is used to specify a function f whose domain is the set X and whose co-domain is the set Y.

A function is not fully specified unless its domain and co-domain are specified.

Example. Let us consider ‘the function that sends x to 1/x^{2}’. Note that 1/x^{2} is is not defined when x = 0. Therefore we cannot view this ‘function’ as a function on the set of real numbers. We can however take as the domain of the function the set ℝ \ {0} of all non-zero real numbers. We thus obtain a function f: ℝ \ {0} → ℝ from the set ℝ \ {0} of non-zero real numbers to the set ℝ of real numbers, where f(x) = 1/x^{2} for all non-zero real numbers x.

There is also a function g: ℂ \ {0} → ℂ from the set ℂ \ {0} of non-zero complex numbers to the set ℂ of complex numbers, where g(z) = 1/z^{2} for all non-zero complex numbers z. The functions f and g have different domains, and are therefore considered to be different functions.

Note that there is no element x of the domain ℝ \ {0} of f: ℝ \ {0} → ℝ for which f(x) = 0. Also f(x) = f(−x) for all non-zero real numbers x. Thus, given an element y of the co-domain ℝ of the function f, there need not be exactly one element x of the domain satisfying f(x) = y. There may not be any such elements x, as is the case when y < 0, or there may be more than one such element x, as is the case when y > 0.

Let X be a set. There is a function i: X → X from X to itself, where i(x) = x for all x ∈ X. This function is referred to as the identity map of X.

Let f: X → Y be a function from a set X to a set Y. The range f(X) of the function is defined to be the set {f(x) : x ∈ X} of all elements of the co-domain Y that are of the form f(x) for some element x of the domain. The image f(A) of a subset A of X is defined to be the set {f(x) : x ∈ A} of all elements of the co-domain Y that are of the form f(x) for some element x of A. Also the preimage f^{−1}(B) of a subset B of Y is defined to be the set {x ∈ X : f(x) ∈ B} of all elements of x for which f(x) is an element of B.

Note that the range of a function f: X → Y is the image f(X) of the domain X of the function. Also f^{−1}(Y) = X.

Example. Let f: ℝ → ℝ be the function defined by f(x) = x^{2} for all x ∈ ℝ. The range of f is the set [0, +∞) of non-negative real numbers. The image f([1, 2]) of the interval [1, 2] is the interval [1, 4]. The preimage f^{−1}([1, 4]) of the interval [1, 4] is the union [−2, −1] ∪ [1, 2] of the intervals [1, 2] and [−2, −1].

Let X, Y and Z be sets, and let f: X → Y and g: Y → Z be functions, where the domain Y of g: Y → Z is the co-domain of f: X → Y. The composition function g ∘ f: X → Z is defined by (g ∘ f)(x) = g(f(x)) for all x ∈ X. Note that g ∘ f denotes the function ‘f followed by g’.

Injective, Surjective and Bijective Functions

We now define injective, surjective and bijective functions:—

• a function f: X → Y is said to be injective (or one-to-one) if f(u) ≠ f(v) whenever u and v are elements of the domain X with u ≠ v; • a function f: X → Y is said to be surjective (or onto) if each element of the codomain of the

function is the image f(x) of at least one element x of the domain X;

• a function f: X → Y is said to be bijective (or is said to be a one-to-one correspondence) if it is both injective and surjective.

Injective, surjective and bijective functions are also referred to as injections, surjections and bijections respectively.

Note that a function f: X → Y is bijective if and only if, given any element y of the co-domain Y of the function, there exists exactly one element x of the domain X satisfying f(x) = y.

Example. Let ℕ denote the set {1, 2, 3, 4, …} of positive integers. Let f: ℕ → ℕ be the function defined by f(n) = n^{2} for all positive integers n. This function is injective, for if m and n are positive integers and if m ≠ n then m^{2} ≠ n^{2}. The function is not surjective, since there is no positive integer n satisfying f(n) = 3.

Example. Let g: ℝ → [0, +∞) be the function from the set ℝ of real numbers to the set [0, +∞) of non-negative real numbers that sends each real number x to x^{2}. This function is not injective, since g(2) = g(−2) = 4. It is surjective: for any non-negative real number y, there is a real number \sqrt{y} satisfying g(\sqrt{y}) = y.

Example. Let h: ℕ → ℕ be the function from the set ℕ of positive integers to itself defined by

h(n) = \{ \begin{matrix}n + 1 & if n is odd; \\ n − 1 & if n is even. \end{matrix}

Thus h(1) = 2, h(2) = 1, h(3) = 4, h(4) = 3, etc. The function is injective. Indeed let m and n be positive integers with m ≠ n. If m is odd and n is even then h(m) ≠ h(n), since h(m) is even and h(n) is odd. If m is even and n is odd then h(m) ≠ h(n), since h(m) is odd and h(n) is even. If m and n are both odd then h(m) ≠ h(n) since h(m) = m + 1, h(n) = n + 1 and m + 1 ≠ n + 1. If m and n are both even then h(m) ≠ h(n) since h(m) = m − 1, h(n) = n − 1 and m − 1 ≠ n − 1. We have thus verified that h(m) ≠ h(n) for all positive integers m and n satisfying m ≠ n. Thus the function is injective.

Let n be a positive integer. If n is odd then n = h(n + 1). If n is even then n = h(n − 1). Thus the function is surjective.

The function h: ℕ → ℕ is therefore bijective.

Lemma 3.1. Let X, Y and Z be sets, and let f: X → Y and g: Y → Z be functions.

(i) If f: X → Y and g: Y → Z are injective, then so is g ∘ f: X → Z.

(ii) If f: X → Y and g: Y → Z are surjective, then so is g ∘ f: X → Z.

(iii) If f: X → Y and g: Y → Z are bijective, then so is g ∘ f: X → Z.

Proof. First suppose that f: X → Y and g: Y → Z are injective. We must prove that g ∘ f: X → Z is injective. Let u and v be elements of X with u ≠ v. Then f(u) ≠ f(v), since f: X → Y is injective. But then g(f(u)) ≠ g(f(v)), since g: Y → Z is injective. It follows that g ∘ f: X → Z is injective. This proves (i).

Next suppose that f: X → Y and g: Y → Z are surjective. We must prove that g ∘ f: X → Z is surjective. Let z be an element of Z. Then there exists y ∈ Y satisfying g(y) = z, since g: Y → Z is surjective. Then there exists x ∈ X satisfying f(x) = y, since f: X → Y is surjective. But then g(f(x) = z. It follows that g ∘ f: X → Z is surjective. This proves (ii).

Clearly (iii) follows from (i) and (ii).

Inverse Functions

Definition. Let X and Y be sets, and let f: X → Y be a function from X to Y. A function g: Y → X from Y to X is said to be the inverse of f: X → Y if g(f(x)) = x for all x ∈ X and f(g(y)) = y for all y ∈ Y.

We denote by f^{−1}: Y → X the inverse of a function f: X → Y, provided that such an inverse exists.

Example. Consider the function f: [1, 2] → [1, 4], where f(x) = x^{2} for all x ∈ [1, 2]. The inverse of this function is the function g: [1, 4] → [1, 2], where g(y) = \sqrt{y} for all y ∈ [1, 4].

Example. Consider the function h: ℝ → ℝ, where h(x) = x^{2} for all real numbers x. This function does not have an well-defined inverse. Indeed no function k: ℝ → ℝ has the property that y = h(k(y)) for all real numbers y, since this identity clearly cannot be satisfied when y < 0.

Lemma 3.2. Let X and Y be sets. A function f: X → Y has a well-defined inverse if and only if it is a bijection. Moreover the inverse of a bijection is itself a bijection.

Proof. Let f: X → Y be a function which has a well-defined inverse f^{−1}: Y → X. Let u and v be elements of X. Then u = f^{−1}(f(u)) and v = f^{−1}(f(v)). Thus if u ≠ v then f(u) ≠ f(v). The function f: X → Y is therefore injective. The function f: X → Y is also surjective, since y = f(f^{−1}(y)) for all y ∈ Y. We have thus shown that if a function f: X → Y has a well defined inverse then it is both injective and surjective, and is thus a bijection.

Conversely suppose that f: X → Y is a bijection. Then, given any element y of Y, there exists exactly one element x of X satisfying f(x) = y. We therefore define f^{−1}(y) to be the unique element x of X satisfying f(x) = y. Clearly f(f^{−1}(y)) = y for all y ∈ Y. Thus f ∘ f^{−1} is the identity map of Y. We must also show that f^{−1} ∘ f is the identity map of X. Let x be an element of X. Then f(f^{−1}(f(x))) = f(x), since f ∘ f^{−1} is the identity map of Y. But f: X → Y is injective. It follows that f^{−1}(f(x)) = x, since the elements x and f^{−1}(f(x)) are mapped by f to the same element of the set Y. We have thus shown that if the function f: X → Y is a bijection then it has a well-inverse.

If g: Y → X is the inverse of a bijection f: X → Y then f is the inverse of g, and therefore g: Y → X must be a bijection.

4 Permutations

A permutation of a set S is a bijective function p: S → S from S to itself.

The identity permutation of a set S is the permutation that fixes every element of S.

Permutations of a finite set S are conveniently represented in a two row form

( \begin{matrix}x_{1} & x_{2} & … & x_{n} \\ p(x_{1}) & p(x_{2}) & … & p(x_{n}) \end{matrix} ) ,

where x_{1}, x_{2}, …, x_{n} are the elements of the set S and p(x_{1}), p(x_{2}), …, p(x_{n}) are the images of these elements under the permutation p being represented. Thus for example

( \begin{matrix}1 & 2 & 3 \\ 2 & 3 & 1 \end{matrix} )

represents the permutation of the set {1, 2, 3} that sends 1 to 2, sends 2 to 3, and sends 3 to 1.

Example. There are two permutations of a set {a, b} with two elements. These are the identity

permutation ( \begin{matrix}a & b \\ a & b \end{matrix} ) and the transposition ( \begin{matrix}a & b \\ b & a \end{matrix} ) that interchanges the elements a and b. Indeed

if p is a permutation of {a, b} and if p(a) = a, then p(b) ≠ a (since a must be the image of exactly one element of the set), hence p(b) = b and thus p is the identity permutation. Similarly if p(a) = b then p(b) ≠ b and therefore p(b) = a, and thus p is the transposition that interchanges the elements a and b.

Example. There are six permutations of a set {a, b, c} with three elements. These are

( \begin{matrix}a & b & c \\ a & b & c \end{matrix} ) , ( \begin{matrix}a & b & c \\ a & c & b \end{matrix} ) ,

( \begin{matrix}a & b & c \\ b & a & c \end{matrix} ) , ( \begin{matrix}a & b & c \\ b & c & a \end{matrix} ) ,

( \begin{matrix}a & b & c \\ c & a & b \end{matrix} ) , ( \begin{matrix}a & b & c \\ c & b & a \end{matrix} ) .

Indeed it is easy to see that the first two include all permutations that send a to itself, the next two include all permutations that send a to b, and the remaining two include all permutations that send a to c.

Lemma 4.1. Let S be a set. Then the composition q ∘ p of any two permutations of S is itself a permutation of S. Also any permutation p of S has a well-defined inverse p^{−1}.

Proof. The composition of two bijections is a bijection (Lemma 3.1). Therefore the composition of two permutations is a permutation.

A function is a bijection if and only if it has a well-defined inverse (Lemma 3.2). It follows that any permutation has a well-defined inverse.

Let p, q and r be permutations of a set S. Then (r ∘ q) ∘ p = r ∘ (q ∘ p), since

(p ∘ (q ∘ r))(x) = (p(q ∘ r)(x)) = p(q(r(x)) = (p ∘ q)(r(x)) = ((p ∘ q) ∘ r)(x)

for any element x of S. Thus composition of permutations is associative.

Let S be a set, and let a_{1}, a_{2}, …, a_{n} be distinct elements of S. We denote by (a_{1} a_{2} ⋯ a_{n}) the permutation of S that sends a_{i} to a_{i+1} for i = 1, 2, …, n − 1, sends a_{n} to a_{1}, and fixes all other elements of S. Such a permutation is called a cycle of order n, or n-cycle. A cycle of length 2 is also called a transposition.

(Note that evaluating a composition of cycles, we shall compose them from right to left, in accordance with standard practice when composing functions.)

Example. We list all permutations of a set {a, b, c, d} with exactly four elements. There is the identity permutation that fixes every element of the set. There are six transpositions. These are (a b), (a c), (a d), (b c), (b d) and (c d), where

(a b) = ( \begin{matrix}a & b & c & d \\ b & a & c & d \end{matrix} ) , (a c) = ( \begin{matrix}a & b & c & d \\ c & b & a & d \end{matrix} ) , etc.

There are eight 3-cycles. These are

(b c d), (b d c), (a c d), (a d c),

(a b d), (a d b), (a b c), (a c b),

where

(b c d) = ( \begin{matrix}a & b & c & d \\ a & c & d & b \end{matrix} ) , (b d c) = ( \begin{matrix}a & b & c & d \\ a & d & b & c \end{matrix} ) , etc.

There are six 4-cycles. These are

(a b c d), (a b d c), (a c b d),
(a c d b), (a d b c), (a d c b).

We now show that there are three more permutations of the set. Let p be a permutation of {a, b, c, d}. Now if p fixes any element of the set then it must permute the remaining three elements amongst themselves and must therefore be the identity permutation, a transposition or a 3-cycle. (All six permutations of a set with three elements are of this type.) Also if p(a) = u and p(u) = v, where a, u and v are all distinct, then it is not difficult to verify that p must be either a 3-cycle or a 4-cycle. Thus if p is a permutation of the set which is not the identity permutation and is not a cycle, and if p(a) = u, then p(u) = a, and p must also transpose the other two elements of the set. It follows that there are three permutations of the set {a, b, c, d} that are not the identity permutation and are not cycles. These are

( \begin{matrix}a & b & c & d \\ b & a & d & c \end{matrix} ) , ( \begin{matrix}a & b & c & d \\ c & d & a & b \end{matrix} ) , ( \begin{matrix}a & b & c & d \\ d & c & b & a \end{matrix} ) .

Note that

( \begin{matrix}a & b & c & d \\ b & a & d & c \end{matrix} ) = (a b) ∘ (c d);
( \begin{matrix}a & b & c & d \\ c & d & a & b \end{matrix} ) = (a c) ∘ (b d);
( \begin{matrix}a & b & c & d \\ d & c & b & a \end{matrix} ) = (a d) ∘ (b c).

We have now found all 24 permutations of a set with four elements: the identity permutation, six transpositions, eight 3-cycles, six 4-cycles, and three further permutations.

Two cycles (a_{1} a_{2} ⋯ a_{m}) and (b_{1} b_{2} ⋯ b_{n}) are said to be disjoint when the elements a_{1}, a_{2}, …, a_{m} and b_{1}, b_{2}, …, b_{n} are distinct (i.e., no pair of these elements coincide).

It is easy to see that if (a_{1} a_{2} ⋯ a_{m}) and (b_{1} b_{2} ⋯ b_{n}) are disjoint cycles then

(a_{1} a_{2} ⋯ a_{m}) ∘ (b_{1} b_{2} ⋯ b_{n}) = (b_{1} b_{2} ⋯ b_{n}) ∘ (a_{1} a_{2} ⋯ a_{m}).

Proposition 4.2. Any permutation of a finite set S is the identity permutation, a cycle, or a composition of two or more disjoint cycles.

Proof. We prove the result by induction on the number of elements in the set S (using the Principle of Complete Induction). The result is trivially true if S has only one element, since in this case the only permutation of S is the identity permutation. Suppose that the result is known to be true for all permutations of sets with fewer than k elements. We show that the result then holds for all permutations of sets with k elements.

Let S be a set with k elements and let p be a permutation of S. Choose an element a_{1} of S, and let elements a_{2}, a_{3}, a_{4}, … of S be defined by the requirement that p(a_{i}) = a_{i+1} for all positive integers i.

Let n be the largest positive integer for which the elements a_{1}, a_{2}, …, a_{n} of S are distinct. We claim that p(a_{n}) = a_{1}.

Now the choice of n ensures that the elements a_{1}, a_{2}, …, a_{n}, a_{n+1} are not distinct. Therefore a_{n+1} = a_{j} for some positive integer j between 1 and n. If j were greater than one then we would have a_{j} = p(a_{j−1}) and a_{j} = p(a_{n}), which is impossible since if p is a permutation of S then exactly one element of S must be sent to a_{j} by p. Therefore j = 1, and thus p(a_{n}) = a_{1}. Let σ_{1} = (a_{1} a_{2} ⋯ a_{n}).

Let T be the set S \ {a_{1}, a_{2}, …, a_{n}} consisting of all elements of S other than a_{1}, a_{2}, …, a_{n}. Now a_{1} = p(a_{n}), and a_{i} = p(a_{i−1}) for i = 2, 3, …, n. Thus if x ∈ T then p(x) ≠ a_{i} for i = 1, 2, …, n (since the function p: S → S is injective), and therefore p(x) ∈ T. We can therefore define a function q: T → T, where q(x) = p(x) for all x ∈ T. This function has a well-defined inverse q^{−1}: T → T where q^{−1}(x) = p^{−1}(x) for all x ∈ T. It follows that q: T → T is a permutation of T. The induction hypothesis ensures that this permutation is the identity permutation of T, or is a cycle, or can be expressed as a composition of two or more disjoint cyles. These cycles extend to permutations of S that fix the elements a_{1}, a_{2}, …, a_{n}, and these permutations of S are also cycles. It follows that either p = σ_{1} (and q is the identity permutation of T), or else p = σ_{1} ∘ σ_{2} … ∘ σ_{m}, where σ_{2}, σ_{3}, …, σ_{m} are disjoint cycles of S that fix a_{1}, a_{2}, …, a_{n} and correspond to cycles of T. Thus if the result holds for permutations of sets with fewer than k elements, then it holds for permutations of sets with k elements. It follows by induction on k that the result holds for permutations of finite sets.

Recall that a transposition is a permutation (a b) of a set S that interchanges two elements a and b of S and fixes the remaining elements.

Lemma 4.3. Every permutation of a finite set with more than one element can be expressed as a finite composition of transpositions.

Proof. Each cycle can be expressed as a composition of transpositions. Indeed if a_{1}, a_{2}, …, a_{n} are distinct elements of a finite set S then

(a_{1} a_{2} ⋯ a_{n}) = (a_{1} a_{2}) ∘ (a_{2} a_{3}) ∘ ⋯ ∘ (a_{n−1} a_{n}).

It follows from Proposition 4.2 that a permutation of S that is not the identity permutation can be expressed as a finite composition of transpositions. Moreover the identity permutation of S can be expressed as the composition of any transposition with itself, provided that S has more than one element. The result follows.

Theorem 4.4. A permutation of a finite set cannot be expressed in one way as a composition of an odd number of transpositions and in another way as a composition of an even number of transpositions.

Proof. Let n be an integer greater than one. Given any permutation p of the set {1, 2, …, n} we define ϵ(p) = (−1)^{m(p)}, where m(p) is the number of ordered pairs (i, j) of integers between 1 and n satisfying i < j and p(i) > p(j).

Let p and q be permutations of the set {1, 2, …, n}. We claim that ϵ(p ∘ q) = ϵ(p)ϵ(q). Define numbers a, b, c and d as follows:—

• let a be the number of ordered pairs (i, j) of integers between 1 and n satisfying i < j, q(i) < q(j) and p(q(i)) < p(q(j));

• let b be the number of ordered pairs (i, j) of integers between 1 and n satisfying i < j, q(i) < q(j) and p(q(i)) > p(q(j)); • let c be the number of ordered pairs (i, j) of integers between 1 and n satisfying i < j, q(i) > q(j)

and p(q(i)) < p(q(j));

• let d be the number of pairs (i, j) of integers between 1 and n satisfying i < j, q(i) > q(j) and p(q(i)) > p(q(j)).

Clearly m(q) = c + d and m(p ∘ q) = b + d. Now m(p) can be described as the number of subsets of {1, 2, …, n} with exactly two elements where the order of these elements is reversed under the permutation p. Moreover each such subset is of the form {q(i), q(j)} where i and j are uniquely determined integers between 1 and n satisfying i < j. It follows that m(p) is equal to the number of ordered pairs (i, j) of integers between 1 and n satisfying i < j for which either q(i) < q(j) and p(q(i)) > p(q(j)) or else q(i) > q(j) and p(q(i)) < p(q(j)). Thus m(p) = b + c. It follows that

ϵ(p)ϵ(q) = (−1)^{b+2c+d} = (−1)^{b+d} = ϵ(p ∘ q).

Now let t be a transposition (k l), where k < l. Then the set of all ordered pairs (i, j) satisfying i < j and t(i) > t(j) consists of the pair (k, l) together with all pairs (k, j) and (j, l) with k < j < l. It follows that m(t) = 1 + 2(l − k − 1), and thus ϵ(t) = −1. It follows that if a permutation p of {1, 2, …, n} can be expressed a composition of g transpositions then (−1)^{g} = ϵ(p). Therefore p cannot be expressed in one way as a composition of an odd number of transpositions and in another way as a composition of an even number of transpositions. This result holds also for permutations of any set with n elements, for if these elements are labelled as x_{1}, x_{2}, …, x_{n} then a permutation of the set sends each element x_{i} to x_{p(i)}, where p is a corresponding permutation of the set {1, 2, …, n}.

A permutation of a finite set is said to be even if it is expressible as the composition of an even number of transpositions. A permutation of a finite set is said to be odd if it is expressible as the composition of an odd number of transpositions.

Any permutation of a finite set is expressible as a composition of transpositions (Lemma 4.3) and must therefore be either even or odd. However Theorem 4.4 ensures that a permutation of a finite set cannot be both even and odd.

Lemma 4.5. An n-cycle is even if n is odd, and is odd if n is even.

Proof. An n-cycle (a_{1}, a_{2}, …, a_{n}) is expressible as a composition of n − 1 transpositions, since

(a_{1} a_{2} ⋯ a_{n}) = (a_{1} a_{2}) ∘ (a_{2} a_{3}) ∘ ⋯ ∘ (a_{n−1} a_{n}).

Thus an n-cycle is even if n − 1 is even, and is odd if n − 1 is odd.

Example. Let us classify the permutations of a set {a, b, c, d} of 4 elements into even and odd permutations. The identity permutation is even. The six transpositions are all odd. The eight 3cycles are all even. The six 4-cycles are all odd. The three remaining permutations (a b) ∘ (c d), (a c) ∘ (b d) and (a d) ∘ (b c) are all even. Note that there are 12 even permutations and 12 odd permutations of a set with 4 elements.

5 Countable and Uncountable Sets

Definition. A set A is said to be countable if there exists an injection from the set A to the set ℕ of positive integers. A set which is not countable is said to be uncountable.

(A countable set is thus one which may be put in one-to-one correspondence with some subset of the set ℕ of positive integers.)

Example. Any subset A of the set ℕ of positive integers is countable: the required injection is the ‘inclusion map’ i: A → ℕ defined by i(x) = x for all x ∈ A.

Example. The set ℤ of integers is countable: an injection f: ℤ → ℕ from ℤ to ℕ is given by the formula

f(n) = \{ \begin{matrix}2n & if n > 0; \\ 1 − 2n & if n ≤ 0. \end{matrix}

Example. Any subset of a countable set is countable. Indeed if A is a subset of a countable set B, and if f: B → ℕ is an injection mapping B into the set ℕ of positive integers then the restriction f|A: A → ℕ is also an injection, where (f|A)(x) = f(x) for all x ∈ A. In particular, any subset of the set ℤ of integers is countable.

Example. The union of two countable sets is countable. Indeed let A and B be countable sets, and let f: A → ℕ and g: B → ℕ be injections. We can obtain an injection h: A ∪ B → ℕ by defining

h(x) = \{ \begin{matrix}2f(x) & if x ∈ A; \\ 2g(x) − 1 & if x ∈ B \ A. \end{matrix}

Note that the function h maps all elements of A to even numbers, and maps all elements of B \ A to odd numbers. Thus if x and y are elements of A ∪ B and if h(x) = h(y) then either h(x) is even, in which case x and y are both elements of A, or else h(x) is odd, in which case x and y are both elements of B \ A. In either case it follows that x = y, since the functions f: A → ℕ and g: B → ℕ are injective. Therefore the function h: A ∪ B → ℕ is indeed injective, and hence the union A ∪ B of the countable sets A and B is itself countable.

Example. Any finite union of countable sets is countable. Indeed suppose that A = A_{1} ∪ A_{2} ∪ A_{3} ∪ ⋯ ∪ A_{n}, where A_{1}, A_{2}, A_{3}, …, A_{n} are countable sets. Then there exist injections f_{j}: A_{j} → ℕ for j = 1, 2, 3, …, n. Let f: A → ℕ be defined by f(x) = k(x) + nf_{k(x)}(x), where k(x) is the smallest value of j for which x ∈ A_{j}. It is easy to verify that f: A → ℕ is injective. Thus A is countable.

Example. The Cartesian product ℕ × ℕ is countable. An injection f: ℕ × ℕ → ℕ is given by

f(m, n) = \frac{1}{2}(m + n − 2)(m + n − 1) + m

for each ordered pair (m, n) of positive integers m and n. The values of f(m, n) are given for small values of m and n in the following table, in which rows are labelled by m and columns by n:

1 2 3 4 5 6 …
1 1 2 4 7 11 16 …
2 3 5 8 12 17
3 6 9 13 18
4 10 14 19
5 15 20
6 21
⋮ ⋮

Lemma 5.1. Let A_{1}, A_{2}, A_{3}, … be an infinite sequence of countable sets. Then the union ⋃_{n=1}^{∞} A_{n} of

the sets in the sequence is a countable set.

Proof. For each positive integer n there exists an injection g_{n}: A_{n} → ℕ, since A_{n} is countable. Let

A = ⋃_{n=1}^{∞} A_{n} be the union of the sets A_{1}, A_{2}, A_{3}, . . .. We obtain a function h: A → ℕ × ℕ by defining

h(x) = (k(x), g_{k(x)}(x)), where k(x) is defined to be the smallest positive integer n for which x ∈ A_{n}.

We now show that h: A → ℕ × ℕ is injective. Let x and y be elements of A for which h(x) = h(y), and let n = k(x). Then the elements x and y both belong to A_{n}, since n = k(x) = k(y). Moreover g_{n}(x) = g_{n}(y). But g_{n}: A → ℕ is injective. Therefore x = y. We conclude that h: A → ℕ×ℕ is indeed injective.

Now ℕ × ℕ is countable. Indeed the function f: ℕ × ℕ → ℕ defined by

f(m, n) = \frac{1}{2}(m + n − 2)(m + n − 1) + m

is injective (see the example above). The function f ∘h: A → ℕ is then an injection from A to ℕ, since it is the composition of two injections. Thus the union A of the sets A_{1}, A_{2}, …, A_{n} is countable, as required.

Lemma 5.2. A finite Cartesian product of countable sets is countable.

Proof. First we show that the Cartesian product A × B of two countable sets A and B is countable. Now there exist injections g: A → ℕ and h: B → ℕ mapping the sets A and B into the set ℕ of positive integers, since A and B are countable. Moreover the Cartesian product ℕ × ℕ is countable, and thus there exists an injection f: ℕ × ℕ → ℕ from ℕ × ℕ to ℕ. Let k: A × B → ℕ be the function defined by k(x, y) = f(g(x), h(y)) for all x ∈ A and y ∈ B. Suppose that k(x, y) = k(u, v) where x, u ∈ A and y, v ∈ B. Then (g(x), h(y)) = (g(u), h(v)), since the function f: ℕ × ℕ → ℕ is injective, and therefore g(x) = g(u) and h(y) = h(v). But then x = u and y = v, since the functions f: A → ℕ and g: B → ℕ are injective, and thus (x, y) = (u, v). Thus the function k: A × B → ℕ is indeed injective. This shows that the Cartesian product A × B of two countable sets is countable.

Suppose that n > 2. Then a Cartesian product A_{1} ×A_{2} ×⋯×A_{n−1} ×A_{n} of n sets can be regarded as the Cartesian product of the sets A_{1} × A_{2} × ⋯ × A_{n−1} and A_{n}; this follows on representing an n-tuple (x_{1}, x_{2}, …, x_{n}) in the n-fold Cartesian product as the ordered pair ((x_{1}, x_{2}, …, x_{n−1}), x_{n}), where the first component of the ordered pair belongs to the Cartesian product of the first n − 1 sets. A straightforward induction on n now shows that a Cartesian product of a finite number of countable sets is countable, as required.

Lemma 5.3. A non-empty set A is countable if and only if there exists a surjection from the set ℕ of positive integers to A.

Proof. Suppose that there exists a surjection g: ℕ → A. Then, for each element x of A there exists at least one positive integer n satisfying g(n) = x. We can therefore define a function f: A → ℕ which sends each element x of A to the smallest positive integer n for which g(n) = x. Clearly g(f(x)) = x for all x ∈ A. Thus if x and y are elements of A and if f(x) = f(y) then x = g(f(x)) = g(f(y)) = y. It follows that the function f: A → ℕ is injective, and thus the set A is countable.

Conversely suppose that the non-empty set A is countable. Then there exists an injection f: A → ℕ from A to the set ℕ of positive integers. Choose an element w of A. Now, for each element n of f(A) there exists a unique element x of A for which f(x) = n, since f: A → ℕ is an injection. It follows that there is a function g: ℕ → A defined such that g(n) is the unique element of A satisfying f(g(n)) = n for each positive integer n that belongs to to f(A), and g(n) = w for each positive integer n that does not belong to f(A). Moreover g(f(x)) = x for all elements x of A, and therefore g: ℕ → A is surjective, as required.

The Set of Real Numbers is Uncountable

Any non-negative real number less than one can be represented by means of a decimal expansion

0.d_{1} d_{2} d_{3} d_{4} d_{5} d_{6} d_{7} ⋯

where the digits d_{1}, d_{2}, d_{3}, … are integers between zero and nine. We say that this decimal expansion has recurring nines if there is some positive integer m such that d_{i} = 9 for all i ≥ 9. If a number can be represented by a terminating decimal expansion (in which all but finitely many of the digits are zero), then it can also be represented as a non-terminating decimal expansion with recurring nines. However every non-negative real number less than one has a unique decimal expansion without recurring nines.

Theorem 5.4. The set of non-negative real numbers less than one is uncountable.

Proof. Let A be the set of all non-negative real number less than 1. We prove that that A is uncountable, using the method of reductio ad absurdum (also known as proof by contradiction). We show that if the hypothesis that A is countable were adopted then this would lead to a contradiction.

Thus suppose that the set A were countable. Then there would exist a surjection f: ℕ → A (Lemma 5.3. We shall show that this would emply the existence of an element y of A that was not in the image f(A) of this surjection. But the existence of such an element y is clearly impossible. Thus the hypothesis that A is countable leads to the required contradiction.

Supposing that a surjection f: ℕ → A were to exist. For each positive integer i let

f(i) = 0.d_{i1} d_{i2} d_{i3} d_{i4} d_{i5} d_{i6} d_{i7} ⋯

be the decimal expansion of f(i) without recurring nines. This decimal expansion is uniquely determined. Let

e_{j} = \{ \begin{matrix}d_{jj} + 1 & if 0 ≤ d_{jj} ≤ 7, \\ 0 & if d_{jj} = 8 or 9, \end{matrix}

and let y be the element of A with decimal expansion

y = 0.e_{1} e_{2} e_{3} e_{4} e_{5} e_{6} e_{7} · · · .

Note that this decimal expansion does not involve the digit nine. Now e_{i} ≠ d_{ii} for each positive integer i. The uniqueness of decimal expansions without recurring nines would then ensure that y ≠ f(i) for each positive integer i, since the decimal expansions of these numbers would differ in the ith digit. Thus y would be an element of A that was not in the image of the surjection f: ℕ → A. But f(ℕ) = A, so that we have arrived at the required contradiction. Since the hypothesis that the set A is countable leads to a contradiction, it must be the case that the set A is uncountable.

Corollary 5.5. The set of all real numbers is uncountable.

Proof. Any subset of a countable set is countable. Therefore any set with an uncountable subset must itself be uncountable. In particular the set of real numbers must be uncountable.

Problems

1. Use the Principle of Mathematical Induction to show that ∑_{i=1}^{n} i^{2} = \frac{1}{6}n(n + 1)(2n + 1) for all

positive integers n.

2. Let X = {2, 4, 6, 8, 10} and Y = {4, 5, 6, 7}. What are X ∪ Y, X ∩ Y, X \ Y and Y \ X?

3. Let ℕ denote the set {1, 2, 3, …} of positive integers, and let ℤ denote the set of all (positive and negative) integers. Determine which of the following functions are injective and which are surjective:

(a) the function f: ℕ → ℕ defined by f(n) = n + 1 for all positive integers n;

(b) the function g: ℤ → ℤ defined by g(n) = n + 1 for all integers n;

(c) the function h: {1, 2, 3} → {1, 2, 3} defined by h(1) = 2, h(2) = 3 and h(3) = 3;

(d) the function k: {1, 2, 3} → {1, 2, 3} defined by k(1) = 2, k(2) = 3 and k(3) = 1;

(e) the function l: ℤ → ℤ defined by l(n) = n^{3} for all integers n.

4. Give an example consisting of sets X, Y and Z and functions f: X → Y and g: Y → Z such that g ∘ f: X → Z is bijective though neither f: X → Y nor g: Y → Z is bijective.

5. Let X and Y be non-empty sets. Prove that a function f: X → Y is surjective if and only if there exists a function g: Y → X such that f ∘ g is the identity map of Y.

6. Let X and Y be non-empty sets. Prove that a function f: X → Y is injective if and only if there exists a function h: Y → X such that h ∘ f is the identity map of X.

7. Calculate the following composition of permutations of the set {a, b, c, d, e}:

( \begin{matrix}a & b & c & d & e \\ b & e & c & a & d \end{matrix} ) ∘ ( \begin{matrix}a & b & c & d & e \\ a & c & e & b & d \end{matrix} )

8. Calculate the permutation of {a, b, c, d, e} resulting from the following composition of cycles:

(a b c) ∘ (a d e) ∘ (b e) ∘ (a d e).

[Remember that permutations (including cycles) are composed from right to left.]

9. Determine by inspection whether the following composition of cycles is an even or odd permutation of the set {a, b, c, d, e, f}:

(a b) ∘ (d f a c) ∘ (e b d) ∘ (a e f d)

10. Let A and B be non-empty sets, and let f: A → B be a surjection. Suppose that A is countable. Explain why B is countable.

11. Let A be a countable set with infinitely many elements, and let i: A → ℕ be an injection. For each positive integer n, let f(n) be the unique element a of A with the property that i(a) is the nth smallest element of i(A). Verify that f: ℕ → A is a bijection from ℕ to A.