Jump to content

Mathematical Proof/Print version

From Wikibooks, open books for an open world


Mathematical Proof

The current, editable version of this book is available in Wikibooks, the open-content textbooks collection, at
https://en.wikibooks.org/wiki/Mathematical_Proof

Permission is granted to copy, distribute, and/or modify this document under the terms of the Creative Commons Attribution-ShareAlike 3.0 License.

Cover

Venn diagram with three sets


Introduction to Set Theory

Objects known as sets are often used in mathematics, and there exists set theory which studies them. Although set theory can be discussed formally [1], it is not necessary for us to have such a formal discussion in this book, and we may not be interested in and understand the formal discussion in this stage.

Even if we do not discuss set theory formally, it is important for us to understand some basic concepts about sets, which will be covered in this chapter.

What is a set means

[edit | edit source]

A set may be viewed as a collection of well-defined, distinct objects (the objects can also be sets). Because of the vagueness of the term "well-defined", we do not regard this as the definition of set. Instead, we regard set as a primitive notion (i.e., concepts not defined in terms of previously-defined concepts). Other examples of primitive notions in mathematics include point and line.

We have mentioned that a set is a collection of well-defined, distinct objects. Objects in a set are called elements of the set. We write a∈A to mean that the element a belongs to the set A. If a does not belong to A, we write a∉A.

Example.

  • Consider the set of all even numbers E. Elements of E include (but are not limited to) -2, 0, and 4, i.e., −2,0,4∈E.
  • The elements of the English alphabet (a set) are English letters.


Ways of describing a set

[edit | edit source]

There are multiple ways to describe a set precisely (in the sense that element(s) belonging to the set is (are) known precisely).

If a set consists of a small number of elements, then the listing method may be quite efficient. In the listing method, elements of a set are listed within a pair of braces ({}). In particular, just changing the listing order of elements does not change the set represented. For example, {1,2} and {2,1} are both representing the same set whose elements are 1 and 2. If the elements listed in the pair of braces are the same, the notations created by the listing method with different listing orders refer to the same set. Also, repeatedly listing a specific element in a set does not change the set represented. For example, {1,1,2,2,2} and {1,2} are both representing the same set whose elements are 1 and 2. In particular, if a set contains no elements, it can be denoted by {} based on the listing method or ∅. This kind of set is called an empty set.

Another way to describe a set is using words. For example, consider the set S of prime numbers less than 10. If we use the listing method instead, the set S is represented by {2,3,5,7}.

The third way to describe a set is advantageous when a set contains many elements. This method is called set-builder notation. There are three parts within a pair of braces in this notation. They are illustrated below with descriptions: {⏟The set ofx⏟all elements x:⏟such thatP(x)⏟the property P(x) is satisfied}

As one may expect, two sets are equal if and only if they contain the same elements. Equivalently, two sets A and B are equal if and only if each element of A is also an element of B and each element of B is also an element of A. This can be regarded as an axiom [2] or a definition. If two sets A and B are equal, we write A=B. If not, we write A≠B.

In this book, when we are solving an equation, we are only considering its real solution(s) unless stated otherwise.

Example.

  • {x:3x+2=0}={−2/3}.
  • {y:y is a positive odd number}={1,3,5,…}.
  • {z:z is an English letter}={a,b,c,…,z,A,B,…,Z}.
Clipboard

Exercise. Assume a and b are different elements. Is each of the following statements true or false?

1

The set {{}} contains no elements.

True.
False.

2

{}=∅.

True.
False.

3

{1,1,2,3} is a set.

True.
False.

4

{x:0<x<2 and x2=4}={2}.

True.
False.

5

{a,b,b}∈{{a,b},a,b,b}.

True.
False.

6

{{a},{a}}∈{∅,{a},{b},{a,b}}.

True.
False.



Set cardinality

[edit | edit source]

If a set contains finite number of elements, it is called a finite set, and it is called an infinite set otherwise. If a set is finite, then its cardinality is its number of elements. For infinite sets, it is harder and more complicated to define their cardinalities, and so we will do this in the later chapter about set cardinalities. For each set S, its cardinality is denoted by |S|.

Example.

  • Let A={red,yellow,blue}. Then, |A|=3.
  • Let B={∅,{∅},∅}. Then, |B|=2 (not 3 since the element ∅ is listed repeatedly).
  • Let C={x:x2<0}. Then, |C|=0 since there is no solution for x2<0 (for real number x), and thus C is an empty set.
  • Let D={y:y2−4y+4=0}. Solving y2−4y+4=0⇔(y−2)2=0, we have y=2. Hence, D={2} and thus |D|=1 [3].

There are some special infinite sets for which notations are given, as follows:

  • ℕ is the set of all natural numbers (0 is not regarded as a natural number in this book).
  • ℤ is the set of all integers.
  • ℚ is the set of all rational numbers.
  • (nonstandard notation) 𝕀 is the set of all irrational numbers.
  • ℝ is the set of all real numbers.
  • ℂ is the set of all complex numbers.

In particular, we can use set-builder notation to express ℚ, as follows: ℚ={p/q:p,q∈ℤ and q≠0}.

Example.

  • 2,3∉ℚ
  • 5,π,e∈𝕀
Clipboard

Exercise. Use set-builder notation to express ℂ without using "ℂ" in the expression.

Solution

We can express like this: ℂ={x:x=a+bi and a,b∈ℝ} (i=−1).


Subsets

[edit | edit source]

Definition. (Subset) A set A is a subset of a set B (denoted by A⊆B) if each element of A is also an element of B.

Remark.

  • If A is not a subset of B, we denote it as A⊈B.
  • Recall that two sets A and B are equal if and only if each element of A belongs to B and each element of B belongs to A. Using the notion of subsets, we can write A=B if and only if A⊆B and B⊆A.

Example.

  • ℕ⊆ℤ⊆ℚ⊆ℝ⊆ℂ.
  • ℤ⊈𝕀 (e.g. 1∈ℤ but 1∉𝕀)
  • ℂ⊈ℝ (e.g. i∈ℂ but i∉ℝ)
  • For each set S, S⊆S, i.e. each set is a subset of itself.
  • This is because each element of set S is an element of S.
  • For each set S, ∅⊆S.
  • If we want to prove this directly, there are some difficulties since ∅ does not contain any element. So, what is meant by "each element of ∅"?
  • Under this situation, it may be better to prove by contradiction (a proof technique covered in the later chapter about methods of proof). First, we suppose on the contrary that ∅⊈S. By the negation of the definition, there is at least one element of ∅ that is not an element of S, which is false. This yields a contradiction, and thus the hypothesis is false (explanation will be provided later), i.e. ∅⊈S is false.

Definition. (Proper subset) A set A is a proper subset of a set B (denoted by A⊊B) if A is a subset of B and A≠B.

Remark.

  • Similarly, if A is not a proper subset of B, we write A⊊̸B.

Example.

  • For each nonempty set S, ∅⊊S since ∅⊆S (shown previously) and ∅≠S if S is a nonempty set.
  • ℕ⊊ℤ⊊ℚ⊊ℝ⊊ℂ.
  • {1,2}⊊{1,2,3}.
  • {1,2}⊊̸{{1,2},2,3} and {1,2}⊈{{1,2},2,3}.
Clipboard

Exercise. Let A={1}.

1

Which of the following set(s) is a subset of A?

{1}
{}
{{1}}
{1,{1}}

2

Select the set(s) of which the set A is a subset.

{1}
{}
{{1}}
{1,{1}}

3

Select the set(s) of which the set A is an element.

{1}
{}
{{1}}
{1,{1}}


We call some commonly encountered subsets of ℝ intervals. For each real number a,b such that a<b,

  • (a,b)= def {x∈ℝ:a<x<b} (open intervals)
  • (a,b]= def {x∈ℝ:a<x≤b} (half-open (or half-closed) intervals)
  • [a,b)= def {x∈ℝ:a≤x<b} (half-open (or half-closed) intervals)
  • [a,b]= def {x∈ℝ:a≤x≤b} (closed intervals)

There are also some infinite intervals:

  • (−∞,a)= def {x∈ℝ:x<a}
  • (−∞,a]= def {x∈ℝ:x≤a}
  • (a,∞)= def {x∈ℝ:a<x}
  • [a,∞)= def {x∈ℝ:a≤x}
  • (−∞,∞)= def ℝ

Note: {x∈S:P(x)} is a shorthand of {x:x∈S and P(x)} (S is a set).

Example.

  • (0,1)⊆[0,1)⊆[0,1].
  • 2,e,π∈(1,4).
  • (0,1]⊈[0,1) since the element "1" of the set on LHS does not belong to the set on RHS.
  • (0,1)⊆(0,∞).

Example.

  • The set of (real) solutions of x2−9≤0 is [−3,3].
  • The set of (real) solutions of x2≤0 is {0}. (Note: we cannot express this set as [0,0] since it is required that a<b for an interval [a,b].)
  • The set of (real) solutions of x2<0 is ∅.
Clipboard

Exercise.

Which of the following is (are) valid interval(s)?

(0,0)
(0,0.000001)
(−2,−3)
[−1,∞]


Universal set and Venn diagram

[edit | edit source]

Definition. (Universal set) A universal set, denoted by U, is a set containing all elements considered in a certain investigation.

Example.

  • If we are studying real numbers, the universal set is ℝ.

Definition. (Complement) The complement of a set A that is a subset of the universal set U, denoted by Ac, is the set {x∈U:x∉A}.

Example.

  • Let A={1} and U={0,1,1,2}. Then, Ac={0,2}. (Note: U={0,1,2} also.)
  • For each universal set U, ∅c=U (since each element of U does not belong to ∅[4]) and Uc=∅ (since there are no elements of U that does not belong to U).
  • Let B={1,3,5} and U={2,4,6}. Then, Bc={2,4,6}=U since each element of U does not belong to B.
Clipboard

Exercise. Let the universal set be ℝ.

1

What is (−∞,1]c?

[1,∞)
(1,∞)
(−∞,1)
(−∞,1]

2

What is (−∞,1)c?

[1,∞)
(1,∞)
(−∞,1)
(−∞,1]

3

If the universal set is U instead, (−∞,1)c=(1,3). Which of the following can be U (there may be more than one answer)?

[1,3]
(1,3)
(1,∞)
(3,∞)
(−∞,3)


A Venn diagram is a diagram showing all possible logical relationships between a finite number of sets. The universal set is usually represented by a region enclosed by a rectangle, while the sets are usually represents by regions enclosed by circles. The following is a Venn diagram.

In this diagram, if the white region represents set A and the region enclosed by the rectangle represents the universal set, then the red region is the set Ac.

However, the following is not a Venn diagram.

This is because there are not regions in which only the yellow and blue region intersect, and only the red and green region intersect, respectively. So, not all logical relationships between the sets are shown.

To show all logical relationships between four sets, the following Venn diagram can be used.

Set operations

[edit | edit source]

Similar to the arithmetic operations for real numbers which combine two numbers into one, the set operations combine two sets into one.

Union of sets

[edit | edit source]

Definition. (Union of sets)

A Venn diagram for union of two sets.

The union of a set A and a set B, denoted by A∪B, is the set {x:x∈A or x∈B}.

Remark.

  • The "or" here is inclusive, i.e. if an element belongs to both A and B, it also belongs to A∪B.

Example.

  • {1,3,5}∪{2,4,6}={1,2,3,4,5,6}.
  • {1,3,5}∪{1,4,6}={1,3,4,5,6}.
  • {1,3,5}∪{1,3,5}={1,3,5}.
  • ℚ∪𝕀=ℝ.

Proposition. Let A,B and C be sets. Then,

  • A∪A=A
  • A∪B=B∪A (commutative law)
  • A∪(B∪C)=(A∪B)∪C (associative law)
  • A⊆A∪B and B⊆A∪B
  • A∪∅=A

Proof. (Formal) proof will be discussed later. For now, you may verify these results using Venn diagram.

◻

Remark.

  • Because of the associative law, we can write union of three (or more) sets without brackets. We will have similar results for intersection of sets, and so we can also write intersection of three (or more) sets without brackets.

Intersection of sets

[edit | edit source]

Definition. (Intersection of sets)

A Venn diagram for intersection of two sets.

The intersection of a set A and a set B, denoted by A∩B, is the set {x:x∈A and x∈B}.

Remark.

  • If A∩B=∅, we say that A and B are disjoint.

Proposition. Let A,B and C be sets. Then,

  • A∩A=A
  • A∩B=B∩A (commutative law)
  • A∩(B∩C)=(A∩B)∩C (associative law)
  • A∩B⊆A and A∩B⊆B
  • A∩∅=∅

Proof. (Formal) proof will be discussed later. For now, you may verify these results using Venn diagram.

◻

Proposition. (Distributive laws) Let A,B and C be sets. Then,

  • A∩(B∪C)=(A∩B)∪(A∩C) (the "A∩" is "distributed" to B and C respectively)
  • A∪(B∩C)=(A∪B)∩(A∪C)

Relative complement

[edit | edit source]

Definition. (Relative complement)

A venn diagram for relative complement. If the region enclosed by the left and right circle represents A and B respectively, then the red region represents B∖A.

The relative complement of a set A in a set B, denoted by B∖A, is the set {x:x∈B and x∉A}.

Remark.

  • Ac=U∖A if U is the universal set. So, the complement of a set A is also the relative complement of A in U.
  • The notation B∖A is read "B with A taken away".
  • We can see from the definition that B∖A=B∩Ac

Example.

  • {a,b,c}∖{b,c,d}={a}.
  • {a,b,c}∖{a,b,c,d}=∅.
  • {a,b,c}∖{1,2,3}={a,b,c}.
  • ℝ∖ℚ=𝕀.
  • ℤ∖ℕ={0,−1,−2,…}.
Clipboard

Exercise.

1

What is ℝ∖ℂ?

{x:x=a+bi,a,b∈ℝ and b≠0}
{x:x=bi,b∈ℝ}
∅
ℂ
ℝ

2

What is [1,10]∖(3,5)?

[1,3]∪[5,10]
[1,3)∪(5,10]
(1,3)∪(5,10)
(1,3]∪[5,10)

3

What is ℝ∖{0}?

(−∞,0)∪(0,∞)
(−∞,0]∪[0,∞)
(−∞,0)∩(0,∞)
(−∞,0]∩[0,∞)

4

Which of the following set(s) is (are) the set of all positive numbers?

ℝ∖(−∞,0)
ℝ∖(−∞,0]
(0,∞)
[0,∞)
ℝ∪(0,∞)
ℝ∩(0,∞)

5

What is ∅∖∅?

∅
The universal set.
{∅}


Proposition. Let A and B be sets. Then,

  • A∖A=∅.
  • A∖∅=A.
  • ∅∖A=∅.
  • A∖B=∅ if and only if A⊆B.
  • (A∖B)∩(B∖A)=∅.
  • A∩(B∖A)=∅.

Proof. (Formal) proof will be discussed later. For now, you may verify these results using Venn diagram.

◻

Theorem. (De Morgan's Laws) Let A and B be sets. Then, (A∪B)c=Ac∩Bc and (A∩B)c=Ac∪Bc.

Proof. (Formal) proof will be discussed later. For now, you may verify these results using Venn diagram.

◻

Example. Suppose the universal set is {1,2,3,4,5,6,7}, A={1,2,3} and B={1,3,5}. Since A∪B={1,2,3,5}, (A∪B)c={4,6,7}. On the other hand, since Ac={4,5,6,7} and Bc={2,4,6,7}, Ac∩Bc={4,6,7}=(A∪B)c.

Clipboard

Exercise.

What is (A∩B)c?

{4,6,7}
{4,5,6,7}
{2,4,6,7}
{2,4,5,6,7}



Symmetric difference

[edit | edit source]

Definition. (Symmetric difference)

A Venn diagram illustrating symmetric difference.

The symmetric difference of sets A and B, denoted by A△B, is the set (A∖B)∪(B∖A).

Example.

  • {0,1,2}△{1,2,3}={0}∪{3}={0,3}.
  • {x,y}△{y}={x}∪∅={x}
  • {x}△{y}={x}∪{y}={x,y}

Proposition. Let A,B and C be sets. Then,

  • A△A=∅
  • A△∅=A
  • A△B=(A∪B)∖(A∩B)
  • A△(B△C)=(A△B)△C (associative law)
  • A△B=B△A (commutative law)
Clipboard

Exercise.

1

What is ∅△∅?

∅
{∅}
{∅,{∅}}
{{∅}}

2

What is A△(B∖A)?

A∪B
A∩B
A∖B
A△B
B∖A
A
B

3

Does A△B△C=(A∪B∪C)∖(A∩B∩C)[5]? (Try to determine it using Venn diagrams. No mathematical proof is required at the moment.)

Yes.
No.



Power set

[edit | edit source]

Definition. (Power set) The power set of a set A, denoted by 𝒫(A), is the set of all subsets of A. In set-builder notation, 𝒫(A)={S:S⊆A}.

Remark.

  • Since ∅⊆A for each set A, ∅ is an element of each power set.
  • Also, since A⊆A for each set A, A is an element of the power set 𝒫(A).

Example.

  • 𝒫(∅)={∅}. Its cardinality is 1.
  • If A={1}, then 𝒫(A)={∅,A}={∅,{1}}. Its cardinality is 2.
  • If B={1,{1}}, then 𝒫(B)={∅,{1},{{1}},B}. Its cardinality is 4.
  • 𝒫({1,2,3})={∅,{1},{2},{3},{1,2},{2,3},{1,3},{1,2,3}}. Its cardinality is 8.

Theorem. (Cardinality of power set of a finite set) Let A be a finite set with cardinality n. Then, |𝒫(A)|=2n.

Proof. Assume A is a finite set with cardinality n. Since each element of the power set 𝒫(A) is a subset of A, it suffices to prove that there are 2n subsets of A. In the following, we consider subsets of A with different number of elements separately, and count the number of subsets of each of the different types using combinatorics.

  • For the subset with zero element, it is the empty set, and thus there is only one such subset.
  • For the subsets with one element, there are C1n subsets.
  • For the subsets with two elements, there are C2n subsets.
  • ...
  • For the subsets with n−1 elements, there are Cn−1n subsets.
  • For the subset with n elements, it is the set A, and thus there is only one such subset.

So, the total number of subsets of A is 1+C1n+C2n+⋯+Cn−1n+1=(1+1)n=2n by binomial theorem.

◻

Remark.

  • The proof method employed here is called direct proof, which is probably the most "natural" method, and most commonly used. We will discuss methods of proof in a later chapter.
  • There are alternative ways to prove this theorem.
Clipboard

Exercise. In each of the following questions, choose the power set of the set given in the question.

1

{∅}

{∅,{{∅}}}
{{∅},{{∅}}}
{∅,{∅}}
{∅,{∅},{{∅}}}

2

𝒫({∅})

{∅,{∅},{{∅}},{∅,{∅}}}
{∅,{∅,{∅}},{{∅}},{∅,{∅}}}
{∅,{{∅}},{{{∅}}},{{∅},{{∅}}}}
{∅,{∅},{{∅}},{{∅},{{∅}}}}

3

{a,{a}}

{∅,{a},{{a}},{a,{a}}}
{∅,a,{a},{a,{a}}}
{∅,a,{{a}},{a,{a}}}
{∅,a,{a},{{a}}}

4

S={1,3}△{3,5}

{∅,{1},{3},{5},{1,3},{3,5},{1,5},S}
{∅,{1},{3},{5},S}
{∅,S}
{∅,{1},{5},{1,5},S}


It is given that |A|=2. In each of the following questions, choose the cardinality of the set given in the question.

1

𝒫(𝒫(A))

4
8
16
32

2

𝒫(𝒫(∅))

0
1
2
4

3

{𝒫(A)}

1
2
4
8

4

𝒫({A})

1
2
4
8

5

𝒫(∅∩𝒫(A))

1
2
4
8



Cartesian product

[edit | edit source]

Definition. (Cartesian product) The Cartesian product of sets A and B, denoted by A×B, is A×B={(a,b):a∈A and b∈B}.

Remark.

  • (a,b) is the ordered pair (i.e. a pair of things for which order is important).
  • The ordered pair is used to specify points on the plane, and the ordered pair is called coordinates.
  • In particular, we have (a,b)≠(b,a) if a≠b.
  • (notation) We use A2 to denote A×A for each set A.
  • We can observe that |A×B|=|A|×|B|.

Example. Let A={0,1} and B={a,b,c}. Then,

  • A×B={(0,a),(0,b),(0,c),(1,a),(1,b),(1,c)}.
  • B×A={(a,0),(b,0),(c,0),(a,1),(b,1),(c,1)}.

Remark.

  • We can see from the above example that the Cartesian product is not commutative, i.e. it is not necessary for A×B=B×A.
Clipboard

Exercise. Let A={1,2,3}.

1

What is A×∅ (there may be more than one answer)?

{(1,0),(2,0),(3,0)}
{(1,∅),(2,∅),(3,∅)}
∅
∅×A
∅2

2

What is A2?

{(1,1),(2,2),(3,3)}
{(1,1),(1,2),(1,3),(2,1),(2,2),(2,3),(3,1),(3,2),(3,3)}
A
{(1,A),(2,A),(3,A)}


Similarly, we can define the Cartesian product of three or more sets.

Definition. (Cartesian product of three or more sets) Let n be an integer greater than 2. The Cartesian product of n sets A1,A2,…,An is A1×A2×⋯×An={(a1,a2,…,an):a1∈A1,a2∈A2,…, and an∈An}.

Remark.

  • (notation) We use An to denote A×A×⋯×A⏟n times, where n∈ℕ.


Logic

As discussed in the introduction, logical statements are different from common English. We will discuss concepts like "or," "and," "if," "only if." (Here I would like to point out that in most mathematical papers it is acceptable to use the term "we" when referring to oneself. This is considered polite by not commanding the audience to do something nor excluding them from the discussion.)

Truth and statement

[edit | edit source]

We encounter statements frequently in mathematics.

Definition. (Statement) A statement is a declarative sentence that is either true or false (but not both), and its truth value is true (denoted by T) or false (denoted by F).

Example. Consider the following sentences:

  1. The number 9 is even.
  2. 1<2.
  3. Mathematics is easy.
  4. How to solve x2+2x−3=0?
  5. Please read this book.
  • The sentence 1 and 2 above are statements (even if the sentence 1 is false).
  • The sentences 3, 4 and 5 are not statements, since they are not declarative sentences, and we cannot say whether each of them is true or false.
  • In particular, the sentence 3 is an opinion, the sentence 4 is a question, and the sentence 5 is a command. Thus, none of them are declarative.
Clipboard

Exercise.

Is the sentence "The 123th digit in the decimal expansion of π is 3." a statement?

Yes.
No.


For the sentences that are not statements, there is a special type of sentences among them, namely open statement.

Definition. (Open statement) An open statement is a sentence whose truth value depends on the input of certain variable.

Remark.

  • Since the truth value may change upon input change, we cannot determine the truth value of an open statement (we cannot say it is (always) true or it is (always) false).

Example. Consider the sentence P(x):x=2 (: is read "such that").

  • This sentence is true when x=2, and false otherwise.
  • This sentence is an open statement.

To express all possible combinations of truth values of some statements, we usually list them in a table, called a truth table.

Example. (Truth table for two statements) For two statements P and Q, the truth table for them is as follows: PQTTTFFTFF and there are four possible combinations of truth values of P and Q.

Example. (Truth table for three statements) For three statements P, Q and R, the truth table for them is as follows: PQRTTTTTFTFTTFFFTTFTFFFTFFF and there are eight possible combinations of truth values of P, Q and R.

Remark.

  • In general, there are 2×⋯×2⏟n times=2n possible combinations of truth values of n statements, since each statement has two possible truth values.
  • The truth table for three statement may seem to be complicated, and you may miss (or duplicate) some combinations in the truth table if you are not careful enough. Because of this, here is an advice for constructing such truth table:
  • for P, write four T's and then four F's, from top to bottom;
  • for Q, write in this pattern from top to bottom: TTFFTTFF;
  • for R, write in this pattern from top to bottom: TFTFTFTF.


Conjunction, disjunction and negation

[edit | edit source]

In this section, we will discuss some ways (conjunction and disjunction) to combine two statements into one statement, which is analogous to Mathematical Proof/Introduction to Set Theory#Set operations, in which two sets are combined into one set. Also, we will discuss a way (negation) to change a statement to another one.

Conjunctions

[edit | edit source]

Definition. (Conjunction) The conjunction of statements P and Q, denoted by P∧Q, is a statement that is true when both P and Q are true, and false otherwise.

Remark.

  • P∧Q is read "P and Q", and the conjunction of the statements P and Q can also be expressed by "P and Q" directly.

Example. (Truth table for P∧Q) The truth table for P∧Q (in terms of possible combinations of truth values of P and Q [6]) is PQP∧QTTTTFFFTFFFF

  • We can see that P∧Q is true only when both P and Q are true, and false otherwise.

Disjunctions

[edit | edit source]

Definition. (Disjunction) The disjunction of statements P and Q, denoted by P∨Q, is a statement that is false when both P and Q are false, and true otherwise.

Remark.

  • That is, P∨Q is true when at least one of P and Q is true, and false otherwise.
  • P∨Q is read "P or Q", and the disjunction of the statements P and Q can also be expressed by "P or Q" directly.
  • The meaning of "or" in mathematics may be different from the meaning of "or" as an English word. For "or" in mathematics, it is used inclusively, i.e. P or Q means P or Q or both. However, as an English word, "or" may be used exclusively, i.e. P or Q means P or Q but not both. For example, when someone say "I will go to library or go to park this afternoon.", we interpret this as "I will either go to library, or go to park, but not both.".

Example. (Truth table for P∨Q) The truth table for P∨Q is PQP∨QTTTTFTFTTFFF

  • We can see that P∨Q is false only when both P and Q are false, and true otherwise.

Negations

[edit | edit source]

Definition. The negation of a statement P, denoted by ∼P, is a statement with truth value that is opposite to that of P.

Remark.

  • P is read "not P", and the negation of the statement P can also be expressed by "not P", or "It is not the case that P" directly.
  • Another common notation for the negation of a statement P is ¬P.
  • We refer to process of expressing a negation of a statement as negating a statement.

Example. (Truth table for ∼P) The truth table for ∼P is P∼PTFFT

  • We can see that ∼P always has the opposite truth value to that of P.

To negate a statement, we usually add the word "not" into a statement, or delete it from a statement. For example, the negation of the statement "The number 4 is even." is "The number 4 is not even.", and the negation of the statement "The number 1 is not prime." is "The number 1 is not prime."

Clipboard

Exercise. Complete the following truth table: PQ∼P∼QP∨Q(∼P)∨(∼Q)∼(P∨Q)TTTFFTFF

Answer

PQ∼P∼QP∨Q(∼P)∨(∼Q)∼(P∨Q)TTFFTFFTFFTTTFFTTFTTFFFTTFTT

  • We can observe that in some combinations of truth values of P and Q, the truth values of (∼P)∨(∼Q) and ∼(P∨Q) are different.
Clipboard

Exercise. Let P be the statement "The number 3 is even.", and Q be the statement "The number 2 is irrational."

Write down (in words) the negation of each of P and Q without using the word "not".

Answer
  • The negation of P can be "The number 3 is odd.".
  • The negation of Q can be "The number 2 is rational."
Clipboard

Exercise. Let P be the statement 3>5. and Q be the statement 3<2..

(a) Is the statement ∼(P∧Q) true or false?

(b) Is the statement ∼(P∨Q) true or false?

(c) Is the statement (∼P)∧(∼Q) true or false?

(d) Is the statement (∼P)∨(∼Q) true or false?


Answer
  • First, we can see that both P and Q are false.

(a) Since P∧Q is false, the answer is true.

(b) Since P∨Q is false, the answer is true.

(c),(d) Since ∼P and ∼Q are both true, the answer for (c) and (d) are both true.



Conditionals

[edit | edit source]

Apart from the above ways to form a new statement, we also have another very common way, namely the "if-then combination". The statement formed using the "if-then combination" is called a conditional.

Definition. (Conditionals) The conditional of two statements P and Q is the statement "If P then Q.", denoted by P→Q. P and Q are called the hypothesis and consequent of the conditional respectively. The conditional P→Q is false when P is true and Q is false, and true otherwise.

Example. (Truth table for P→Q) The truth table for P→Q is PQP→QTTTTFFFTTFFT

  • We can observe that, in particular, even if the hypothesis P is false, the conditional P→Q is true, by definition [7].
  • Another observation is that when the consequent is true, then no matter the hypothesis is true or false, the conditional must be true (see 1st and 3rd row).

To understand more intuitively why the conditional is always true when the hypothesis is false, consider the following example.

Example. Suppose Bob is taking a mathematics course, called MATH1001. The course instructor of MATH1001 warns Bob that if he fails the final examination of this course, then he will fail this course. Let P be the statement "Bob fails the final examination of MATH1001.", and Q be the statement "Bob fails MATH1001". Then, the statement made by the course instructor is "P→Q".

For the statement made by the course instructor to be true, either Bob actually fails the final examination of MATH1001, and he actually fails the course, or Bob passes the final examination of MATH1001. In the latter case, whether Bob fails MATH1001 or not does not matter, since the course instructor does not promise anything if Bob passes the final examination of MATH1001 [8].

For the statement made by the course instructor to be false, the only situation is that Bob fails the final examination of MATH1001, but he still passes MATH1001 (P is true and Q is false) (this shows that the instructor is lying!).

Converse and biconditionals

[edit | edit source]

After discussing conditional of P and Q, we will discuss biconditional of P and Q. As suggested by its name, there are two conditionals involved. The conditional involved, in addition to P→Q, is Q→P, which is called the converse of the conditional P→Q.

In mathematics, given that the conditional P→Q is true, we are often interested in knowing whether its converse Q→P is true as well [9].

Example. The converse of the statement made by the course instructor in the previous example is "If Bob fails MATH1001, then he fails the final examination of MATH1001.".

Definition. (Biconditionals) The biconditional of two statements P and Q, denoted by P↔Q, is (P→Q)∧(Q→P), that is, "If P then Q." and "If Q then P.".

Remark.

  • We also write P if and only if Q in this case.
  • To understand the phrase "if and only if" more clearly, consider the following:
  • P if and only if Q can be interpreted as "P if Q and P only if Q".
  • For "P if Q", it should be easy to accept that it means "If Q then P".
  • For "P only if Q, it means P can only be true when Q is true. That is, Q is a necessary condition for P. Thus, we can deduce that when P is true, Q must be true (or else P cannot possibly be true). Hence, "P only if Q" means "If P then Q.".

Example. (Truth table for P↔Q) The truth table for P↔Q is PQP→QQ→PP↔QTTTTTTFFTFFTTFFFFTTT

  • We can see that P↔Q is true when both P and Q have the same truth values (i.e. either both P and Q are true, or both P and Q are false), and false otherwise.


Implication and logical equivalence

[edit | edit source]

When the conditional P→Q is true, we can say "P implies Q", denoted by P⇒Q. On the other hand, when P does not imply Q, i.e. P→Q is false, we denote this by P⇏Q.

We have some other equivalently ways to say "P implies Q", namely

  • P is a sufficient condition for Q (or P is sufficient for Q in short)
  • We call P to be sufficient for Q since when P implies Q, then "P is true" is sufficient to deduce "Q is true".
  • Q is a necessary condition for P (or Q is necessary for P in short)
  • We call Q to be necessary for P since when P implies Q, the hypothesis cannot be possibly true when the consequent Q is false (or else the conditional P→Q will be false). This explains the necessity of "Q is true".

When P⇒Q, we are often interested knowing whether the converse of P→Q is true or not, i.e. whether we have Q⇒P or not [10].

In the case where P⇒Q but Q⇏P, we have multiple equivalent ways to express this:

  • P is sufficient but not necessary for Q.
  • From the previous interpretation, when we say P is necessary for Q, we mean Q⇒P. Hence, when P is sufficient but not necessary for Q, we mean P⇒Q and Q⇏P.
  • P is a stronger condition than Q (or P is stronger than Q in short).

In the case where P⇒Q and Q⇒P as well, the biconditional P↔Q is also true, and we denote this by P⇔Q. There are also multiple equivalent ways to express this:

  • P is logically equivalent to Q.
  • We say they are logically equivalent since they always have the same truth values (because P↔Q is true), which is related to logic.
  • "P if and only if Q" (is true).
  • Recall that we also use "P if and only if Q" to express the biconditional P↔Q. Thus, technically, we should write "P if and only if Q" is true in the case where P⇔Q. However, we rarely write this in practice, and usually omit the phrase "is true" since it makes the expression more complicated. So, when we write "P if and only if Q" in this context, we mean that the biconditional is true without saying it explicitly.
  • Usually, when we just write "P if and only if Q", we have the meaning of the logical equivalence P⇔Q, rather than the statement P↔Q. If we really want to have the latter meaning, we should specify that "P if and only if Q" refers to a statement.
  • P is necessary and sufficient for Q.
  • Following the previous interpretation, P is necessary and sufficient for Q means Q⇒P and P⇒Q.

Theorem. (Some laws about conjunction, disjunction and negation) In the following, P, Q and R are arbitrary statements.

  • (∼(∼P))⇔P (double negation)
  • P∧Q⇔Q∧P (commutative law of conjunction)
  • P∨Q⇔Q∨P (commutative law of disjunction)
  • P∧(Q∧R)⇔(P∧Q)∧R (associative law of conjunction)
  • P∨(Q∨R)⇔(P∨Q)∨R (associative law of conjunction)
  • P∨(Q∧R)⇔(P∨Q)∧(P∨R) (distributive law)
  • P∧(Q∨R)⇔(P∧Q)∨(P∧R) (distributive law)
  • (∼(P∧Q))⇔(∼P)∨(∼Q) (De Morgan's law)
  • (∼(P∨Q))⇔(∼P)∧(∼Q) (De Morgan's law)

Proof. They can be shown using truth tables.

◻

Remark.

  • You may observe that there are also some analogous results in set theory (some even have the same name!), discussed in the chapter about set theory. This is because the results discussed in the chapter about set theory are actually proven from the corresponding results above almost directly.

Theorem. (Bridge between conditional and disjunction) The statements P→Q and (∼P)∨Q are logically equivalent.

Proof. It can be shown using the following truth table: PQ∼PP→Q(∼P)∨QTTFTTTFFFFFTTTTFFTTT

◻

Theorem. (Logical equivalence of a conditional and its contrapositive) The contrapositive of a conditional P→Q is defined to be another conditional (∼Q)→(∼P), and they are logically equivalent.

Proof. Using the bridge between conditional and disjunction and some other laws, it can be shown as follows: P→Q⇔(∼P)∨Q⇔Q∨(∼P)⇔(∼(∼Q))∨(∼P)⇔(∼Q)→(∼P).

◻

Remark.

  • It may seem "surprising" when we "suddenly" negate Q twice. Indeed, when we are thinking about how to prove the logical equivalence, we do not directly do this from nowhere. Instead, we are "motivated" to do so after observing that P→Q⇔(∼P)∨Q and (∼Q)→(∼P)⇔(∼(∼Q))∨(∼P). So, we sort of finish the above series of equivalence "like a sandwich" (from left to right and from right to left simultaneously). This may be useful for other similar proofs.
  • This result is very important for Proof by Contrapositive, which will be discussed later.


Tautologies and contradictions

[edit | edit source]

Before defining what tautologies and contradictions are, we need to introduce some terms first. In the previous sections, we have discussed the meaning of the symbols ∼,∨,∧,→ and ↔. These symbols are sometimes called logical connectives, and we can use logically connectives to make some complicated statements. Such statements, which are composed of at least one given (or component) statements (usually denoted by P,Q,R etc.) and at least one logical connective, are called compound statements.

Definition. (Tautologies and contradictions) A compound statement S is called a tautology (contradiction) if it is true (false) for each possible combination of truth values of the component statement(s) that comprise S.

Remark.

  • We use 𝐓 to denote a tautology and 𝐅 to denote a contradiction.
  • When a statement S is a tautology, we can also write S⇔𝐓, since it means S and 𝐓 always have the same truth value, and because the truth value of 𝐓 is always true, the truth value of S is also always true, i.e. S is a tautology.
  • Because of this, when we want to prove that a statement S is always true, one way is to show that S⇔𝐓. For example, if we want to prove that P→Q and (∼Q)→(∼P) are logically equivalent, we may show that [(P→Q)↔((∼Q)→(∼P))]⇔𝐓.

Example. Let P be an arbitrary statement. Then,

  • P∨(∼P) is a tautology.
  • P∧(∼P) is a contradiction.

This is because the truth table for P∨(∼P) is P∼PP∨(∼P)TFTFTT and the truth table for P∧(∼P) is P∼PP∧(∼P)TFFFTF.

Example. Let P and Q be arbitrary statements. Then, (P∧Q)→(P∨Q) is a tautology, since its truth table is PQP∧QP∨Q(P∧Q)→(P∨Q)TTTTTTFFTTFTFTTFFFFT.

Clipboard

Exercise. The following are some further questions on this example.

1

Is the converse of the statement in the example, (P∨Q)→(P∧Q), a tautology, contradiction, or neither?

Tautology.
Contradiction.
Neither.

2

Is the negation of the statement in the example, ∼((P∧Q)→(P∨Q)), a tautology, contradiction, or neither?

Tautology.
Contradiction.
Neither.

3

Is the contrapositive of the statement in the example, (∼(P∨Q))→(∼(P∧Q)), a tautology, contradiction, or neither?

Tautology.
Contradiction.
Neither.

Prove that (P∧Q)→(P∨Q) is a tautology without using truth tables.

Answer

Since (P∧Q)→(P∨Q)⇔(∼(P∧Q))∨(P∨Q)⇔((∼P)∨(∼Q))∨(P∨Q)⇔((∼P)∨P)∨((∼Q)∨Q)⇔𝐓∨𝐓⇔𝐓, the given conditional is a tautology.

A student claims that (P∨Q)→(P∧Q) is a contradiction with the following argument:

Since (P∨Q)→(P∧Q)⇔(∼(P∨Q))∨(P∧Q)⇔((∼P)∧(∼Q)))∨(P∧Q)⇔((∼P)∧P))∨((∼Q)∧Q)⇔𝐅∨𝐅⇔𝐅, the conditional is a contradiction.

Comment on his claim.

Answer
  • The claim is wrong.
  • The step ((∼P)∧(∼Q)))∨(P∧Q)⇔((∼P)∧P))∨((∼Q)∧Q) is incorrect, since we should use distributive law here instead, and we cannot apply associative law with two types of logical connector here.
  • Indeed, it is shown in an above question that the conditional (P∨Q)→(P∧Q) is neither tautology nor contradiction.


Theorem. (Laws about tautologies and contradictions) Let P be an arbitrary statement. Then,

  • P∨𝐓⇔𝐓.
  • P∧𝐓⇔P.
  • P∨𝐅⇔P.
  • P∧𝐅⇔F.
  • (∼𝐓)⇔𝐅.
  • (∼𝐅)⇔𝐓.

Proof. They can be shown using truth tables.

◻

Quantifiers

[edit | edit source]

Recall that an open statement is a sentence whose truth values depends on the input of certain variable. In this section, we will discuss a way to change an open statement into a statement, by "restricting the input" using quantifiers, and such statement made is called an quantified statement. For example, consider the statement "The square of each real number is nonnegative.". It can be rephrased as "For each real number x, x2≥0." We can let P(x) be the open statement "x2≥0". Then, it can be further rephrased as "For each real number x, P(x)." In this case, we can observe how an open statement (P(x)) is converted to a statement (For each real number x, P(x)), and the phrase "for each" is a type of the universal quantifier. Other phrases that are also universal quantifiers include "for every", "for all" and "whenever". The universal quantifier is usually denoted by ∀ (an inverted "A"). After introducing this notation, the statement we mention can be further rephrased as "∀x∈ℝ,x2≥0" (we also use some set notations here).

In general, we can use the universal quantifier to change an open statement P(x) to a statement, which is "∀x∈S,P(x)" in which S is a (universal) set (or domain) which restricts the input x.

Apart from the universal quantifier, another way to convert an open statement into a statement is using an existential quantifier. Each of the phrases "there exists", "there is", "there is at least one", "for some" [11], "for at least one" is referred to as an existential quantifier, and is denoted by ∃ (an inverted "E"). For example, we can rewrite the statement "The square of some real number is negative." as "∃x∈ℝ,x2<0." (which is false).

In general, we can use the existential quantifier to change an open statement P(x) to a statement, which is "∃x∈S,P(x)" in which S is a (universal) set (or domain) which restricts the input x.

Another quantifier that is related to existential quantifier is the unique existential quantifier. Each of the phrases "there exists a unique", "there is exactly one", "for a unique", "for exactly one" is referred to as unique existential quantifier, which is denoted by ∃!. For example, we can rewrite the statement "There exists a unique real number x such that 2x=0." as "∃!x∈ℝ,2x=0." We can express the unique existential quantifier in terms of existential and universal quantifiers, by defining "∃!x∈S,P(x)" as (∃x∈S,P(x))∧(∀x1,x2∈S,P(x1)∧P(x2)→x1=x2) where the left bracket is the existence part, and the right bracket is the uniqueness part. In words, the expression means

There exists x∈S such that P(x), AND for every x1,x2∈S, if P(x1) and P(x2), then x1=x2 (i.e., x1 and x2 are actually referring to the same thing, so there is exactly one x such that P(x)).

In general, we need to separate the existence and uniqueness part as above to prove statements involving unique existential quantifier.

Negation of quantified statements

[edit | edit source]

Example. The statement "∃A⊆U,A=U" [12] can be expressed in words (partially) as "There exists a set A⊆U such that A=U."

Clipboard

Exercise. Write down the negation of this statement in words (partially). (Hint: What is the negation of "n≥1 (n is a nonnegative integer)."? Hence, what is the negation of "There is at least one x∈S such that P(x)."?)

Answer
  • For the hint, the negation of "n≥1 (n is a nonnegative integer)." is "n=0", and the negation of "There is at least one x∈S such that P(x)." is hence "There is no x∈S such that P(x)". It can also be expressed equivalently as "For each x∈S, P(x) is not satisfied.", or ∀x∈S,∼P(x).
  • Inspired from the hint, the negation of this statement can be written as "For each set A⊆U, A≠U."


From this example, we can see that the negation of the statement "∃x∈S,P(x)" is logically equivalent to "∀x∈S,∼P(x)". Now, it is natural for us to want to know also the negation of the statement "∀x∈S,P(x). Consider this: when it is not the case that P(x) is true for each x∈S, it means that P(x) is false for at least one x∈S. In other words, ∃x∈S,∼P(x). Hence, we know that the negation of the statement "∀x∈S,P(x)" is logically equivalent to ∃x∈S,∼P(x).

Quantified statements with more than one quantifier

[edit | edit source]

A quantified statement may contain more than one quantifier. When only one type of quantifier is used in such quantified statement, the situation is simpler. For example, consider the statement "For each real number x and for each real number y, xy is a real number." It can be written as "∀x∈ℝ,∀y∈ℝ,xy∈ℝ". When we interchange "∀x∈ℝ" and "∀y∈ℝ", the meaning of the statement is not affected (the statement still means "The product of two arbitrary real numbers is a real number.") Because of this, we can simply write the statement as "∀x,y∈ℝ,xy∈ℝ" without any ambiguity.

For an example that involve two existential quantifiers, consider the statement "There exists an real number x and an real number y such that xy is a real number." It can be written as "∃x∈ℝ,∃y∈ℝ,xy∈ℝ." Similarly, interchanging "∃x∈ℝ" and "∃y∈ℝ" does not affect the meaning of the statement (the statement still means "For at least one pair of real numbers x and y, xy is a real number.") Because of this, we can simply write the statement as "∃x,y∈ℝ,xy∈ℝ" without any ambiguity.

However, when both types of quantifier are used in such quantified statement, things get more complicated. For example, consider the statement "For each integer x, there exists an integer y such that y<x." This can also be written as "∀x∈ℤ,∃y∈ℤ,y<x". It means that for each integer, we can find a (strictly) smaller one, and we can see that this is a true statement. For instance, if you choose x=13, I can choose y=−99,0 or 12. Indeed, for the integer x chosen by you, I can always choose my y as x−1 so that y<x.

Let's see what happen if we interchange "∀x∈ℤ" and "∃y∈ℤ". The statement becomes ∃y∈ℤ,∀x∈ℤ,y<x, meaning that there exists an integer y such that it is (strictly) smaller than every integer x! This is false, since, for example, there is no integer that is (strictly) smaller than itself (which is an integer). In this example, we can see that interchanging the positions of universal quantifier and existential quantifier can change the meaning of the statement. Hence, it is very important to understand clearly the meaning of a quantified statement with both universal and existential quantifiers. To ease the understanding, here is a tips for reading such statement:

For the variable associated to the quantifier ∃, it may depend on the variable(s) introduced earlier in the statement, but must be independent from the variable(s) introduced later in the statement.

What does it mean? For example, consider the above example. In the first case, we have ∀x∈ℤ,∃y∈ℤ,y<x.. Then, since the variable x appears earlier than the variable y which associated to ∃, y may depend on x (This is similar to the case in English. In a sentence, a thing may depend on other things mentioned earlier.). For instance, when you choose x=13, and I choose y=12. Then, y<x. However, if you change your choice to x=9, then my y=12 does not work, and I need to change my y to, say, 8 so that y<x. Then, we can see that y depends on x in this case. In the second case, we have ∃y∈ℤ,∀x∈Z,y<x. In this case, the variable x appears later than the variable y. Hence, the variable y must be independent from x. That is, when such y is determined, it needs to satisfy y<x for each x chosen, and the y cannot change depend on what x is. Indeed, y cannot possibly depend on x, since y is supposed to be determined when x is not even introduced!

Exercises

[edit | edit source]

In the following questions, P,Q,R,S are statements.

A. Construct the truth tables for each the following statements, and also give its converse and contrapositive:

  1. ∼P→Q
  2. P→(∼Q)
  3. (P∨Q)→R
  4. (P∧Q)→(R∨S)
  5. (R→S)→(P→Q)

B. Negate the following statements:

  1. P∧Q
  2. (P∨Q)∧(R∧S)
  3. (P∧∼Q)∨(∼R∨S)


Methods of Proof

There are many different ways to prove things in mathematics. This chapter will introduce some of those methods.

Introduction

[edit | edit source]

In this chapter, for every method of proof introduced, we will discuss it in this manner:

  1. Explaining why the method works, by considering its underlying logic.
  2. Introducing how to use the method.
  3. Giving examples of using the method (and possibly also some previous method introduced) to prove some results.

Before introducing the first proof method, let us go through the meanings of some frequently used terms in mathematics books (some are already used in previous chapters actually), which are used more frequently starting from this chapter.

  • Definition: an explanation of meaning of a term.
  • Theorem: an important and interesting true mathematical statement.
  • Proposition: a (relatively) less important theorem.
  • Lemma: a true mathematical statement that is useful in establishing the truth of other true statements, and is less important than a theorem.
  • Corollary: a true mathematical statement that can be deduced from a theorem (or proposition) simply.
  • Proof: an explanation of why a statement is true.
  • Axiom: a true mathematical statement whose truth is accepted without proof.
  • Conjecture: a statement that is believed to be true, but is not proven to be true.

Direct proof

[edit | edit source]

Many mathematical theorems can be expressed in the form of "∀x∈S,P(x)⟹Q(x), in which P(x) and Q(x) are open statements about elements x in a set S [13]. This expression means "If P(x) then Q(x)" is true for every x∈S. However, in practice, we rarely include the phrase "is true", and usually just write the theorem in the form of "For every x∈S, if P(x), then Q(x)." Sometimes, we write instead "Let x∈S. If P(x), then Q(x).", which has the same meaning.

In some situations, the statement is not stated in such a form directly, but can be expressed in such a form. For example, the statement "The square of an even integer is even." can be expressed as "For every x∈ℤ, x is even ⟹ x2 is even.", or "For every x∈ℤ, if x is even, then x2 is even.", or "Let x∈ℤ. If x is even, then x2 is even.", etc.

Now, we will introduce the first proof method to prove statements in such a form, which is known as direct proof. As suggested by its name, this method is quite "direct", and is probably the simplest method among all methods discussed in this chapter.

Consider the statement "∀x∈S,P(x)→Q(x)". We would like to prove that it is true. Suppose P(x0) is false for some x0∈S. Then, the conditional P(x0)→Q(x0) must be true for this x0 by definition, regardless of the truth value of Q(x0). Hence, in the proof, we do not need to consider those x∈S for which the hypothesis P(x) is false.

Because of this, to give a direct proof of "∀x∈S,P(x)⟹Q(x)", we first assume P(x) is true (So, we are considering every x∈S for which P(x) is true.), and then proceed to show that Q(x) is true for every such x (or else the conditional P(x)→Q(x) will be false).

This shows that P(x)→Q(x) is true for those x∈S for which P(x) is true, and this is enough to prove P(x)→Q(x) is true for every x∈S (for which P(x) may or may not be true), since we have mentioned that the conditional P(x)→Q(x) must be true for those x∈S for which P(x) is false.

Example. Prove that for every n∈ℤ, if n is odd, then 3n+1 is even.

Proof. Assume n is odd. Then, by definition we have n=2k+1 for some k∈ℤ. Thus, 3n+1=3(2k+1)+1=6k+4=2(3k+2)=2k′, where k′=3k+2∈ℤ (this follows from the definition of integers). This means 3n+1 can be written as 2k′ for some k′∈ℤ, and hence 3n+1 is even.

◻

In the previous proof, we have used the definitions of odd and even integers:

  • an integer n is even if n=2k for some integer k.
  • an integer n is odd if n=2k+1 for some integer k.

We can write the proof more concisely using logical notations, as follows:

Proof. n is odd⇒n=2k+1 for some k∈ℤ⇒3n+1=2(3k+2)(3k+2∈ℤ)⇒3n+1 is even.

◻

Both styles of proofs are acceptable, but for beginners, it is recommended to use the first type. Also, the first type can let the readers understand the proof easier.

Remark.

  • The property of an integer of whether it is even or odd is called parity.
  • When we use "n" in the proof, it is implicitly assumed it follows the same meaning as in the given statement, i.e., n is an integer. We can also let n to be an integer explicitly in the proof to be more clear.
  • In some other places, the first line "Assume ..." is simply omitted for convenience, but the assumptions are still used in the proof.
Clipboard

Exercise. Consider the statement "For every a,b∈ℤ, if a is odd and b is even, then 4a+5b is even.". A student provides the following proof to the statement:

Proof. Assume a is odd and b is even. That is, a=2k+1 and b=2k for some k∈ℤ. It follows that 4a+5b=8k+4+10k=2(9k+2), and thus 4a+5b is even.

◻

Is the proof correct? If not, point out the mistake, and write a correct proof.

Solution

The proof is incorrect. The mistake is that one should not use the same k for both a and b, since using the same k implies that a=b+1, which is not necessarily the case from the assumptions. The following proof is a correct one:

Proof. Assume a is odd and b is even. That is, a=2k1+1 and b=2k2 for some k1,k2∈ℤ. It follows that 4a+5b=8k1+4+10k2=2(4k1+5k2+2), and thus 4a+5b is even.

◻


Clipboard

Exercise. Prove that for every n∈ℤ, if n is even, then n2+n+1 is odd.

Proof

Proof. Assume n is even. Then, n=2k for some k∈ℤ. Thus, n2+n+1=4k2+2k+1=2(2k2+k)+1. Since k2+k∈ℤ, n2+n+1 is odd.

◻


Clipboard

Exercise. Prove every of the following statements.

(a) The sum of two arbitrary even integers is even.

(b) The sum of two arbitrary odd integers is even.

(c) The sum of an arbitrary even integer and an arbitrary odd integer is odd.

(d) The product of two arbitrary even integers is even.

(e) The product of two arbitrary odd integers is odd.

(f) The product of an arbitrary even integer and an arbitrary odd integer is even.

(Hint: rewrite the statements in the form of "∀x,y∈S,P(x,y)⟹Q(x,y)" first.)


Solution

(a) First, rewrite the statement as "For every x,y∈ℤ, if x and y are even, then x+y is even."

Proof. Assume x and y are even. Then, x=2k1 and y=2k2 for some k1,k2∈ℤ (notice that we should not use the same k for both x and y, since x may be different from y.). Thus, x+y=2(k1+k2), and hence x+y is even since k1+k2∈ℤ.

◻

(b) First, rewrite the statement as "For every x,y∈ℤ, if x and y are odd, then x+y is even."

Proof. Assume x and y are odd. Then, x=2k1+1 and y=2k2+1 for some k1,k2∈ℤ. Thus, x+y=2(k1+k2+1), and hence x+y is even since k1+k2+1∈ℤ.

◻

(c) First, rewrite the statement as "For every x,y∈ℤ, if x is odd and y is even, then x+y is odd."

Proof. Assume x is odd and y is even. Then, x=2k1+1 and y=2k2 for some k1,k2∈ℤ. Thus, x+y=2(k1+k2)+1, and hence x+y is odd since k1+k2∈ℤ.

◻

(d) First, rewrite the statement as "For every x,y∈ℤ, if x is even and y is even, then xy is even."

Proof. Assume x and y are even. Then, x=2k1 and y=2k2 for some k1,k2∈ℤ. Thus, xy=2(2k1k2), and hence xy is even since 2k1k2∈ℤ.

◻

(e) First, rewrite the statement as "For every x,y∈ℤ, if x is odd and y is odd, then xy is odd."

Proof. Assume x and y are odd. Then, x=2k1+1 and y=2k2+1 for some k1,k2∈ℤ. Thus, xy=(2k1+1)(2k2+1)=4k1k2+2k1+2k2+1=2(2k1k2+k1+k2)+1, and hence xy is odd since 2k1k2+k1+k2∈ℤ.

◻

(f) First, rewrite the statement as "For every x,y∈ℤ, if x is odd and y is even, then xy is even."

Proof. Assume x is odd and y is even. Then, x=2k1+1 and y=2k2 for some k1,k2∈ℤ. Thus, xy=(2k1+1)(2k2)=4k1k2+2k2=2(2k1k2+k2), and hence xy is even since 2k1k2+k2∈ℤ.

◻


Clipboard

Exercise. A real number x is defined to be rational if there exist integers p,q with q≠0 such that x=pq. Prove every of the following statements.

(a) The sum of two arbitrary rational numbers is rational.

(b) The difference of two arbitrary rational numbers is rational.

(c) The product of two arbitrary rational numbers is rational.

(d) The quotient of an arbitrary rational number by an arbitrary nonzero rational number is rational.

Solution

(a) First, rewrite the statement as "For every x,y∈ℝ, if x,y∈ℚ, then x+y∈ℚ.

Proof. Assume x,y∈ℚ. Then, x=p1q1 and y=p2q2 for some p1,p2,q1,q2∈ℤ with q1≠0 and q2≠0. Thus, x+y=p1q1+p2q2=p1q2+p2q1q1q2. Since p1q2+p2q1,q1q2∈ℤ with q1q2≠0, x+y∈ℚ.

◻

(b) First, rewrite the statement as "For every x,y∈ℝ, if x,y∈ℚ, then x−y∈ℚ.

Proof. Assume x,y∈ℚ. Then, y=pq for some p,q∈ℤ with q≠0. So, −q=−pq is rational since −p,q∈ℤ and q≠0. Thus, by (a), we have x−y=x+(−y)∈ℚ.

◻

(c) First, rewrite the statement as "For every x,y∈ℝ, if x,y∈ℚ, then xy∈ℚ.

Proof. Assume x,y∈ℚ. Then, x=p1q1 and y=p2q2 for some p1,p2,q1,q2∈ℤ with q1≠0 and q2≠0. Thus, xy=p1p2q1q2. Since p1p2,q1q2∈ℤ with q1q2≠0, xy∈ℚ.

◻

(d) First, rewrite the statement as "For every x,y∈ℝ, if x,y∈ℚ and y≠0 then xy∈ℚ.

Proof. Assume x,y∈ℚ and y≠0. Then, x=p1q1 and y=p2q2 for some p1,p2,q1,q2∈ℤ with p2≠0, q1≠0, and q2≠0. Thus, xy=p1q2p2q1. Since p1q2,p2q1∈ℤ with p2q1≠0, xy∈ℚ.

◻


Example. Prove that for every x∈ℝ, if x2−2x+1<0, then (x−2)3≥8.

Proof. For every x∈ℝ, x2−2x+1=(x−1)2≥0. Thus, the hypothesis is false, and hence the statement must be true.

◻


Remark.

  • Notice that we do not use direct proof here, since the false hypothesis makes the statement true. In this case, we call the proof as vacuous proof, and say that the result follows vacuously (the statement says nothing at all).

Example. Prove that for every x∈ℝ, if 0<x<1, then x2−x−2<−2.

Proof. Assume 0<x<1. Then, x2−x=x(x−1). Since x is positive and x−1 is negative by assumption, we have x2−x<0, and thus x2−x−2<0−2=−2.

◻


Remark.

  • Graphically, the function f(x)=x2−x−2 (we will discuss the concept of function in later chapter) looks like:

Clipboard

Exercise. Prove that for every x∈ℝ, if x2−x−2<−2, then 0<x<1 (this statement is the converse of the statement in above example). (Hint: The following property may be useful: for every a,b∈ℝ, if ab<0, then either (a<0 and b>0) or (a>0 and b<0).) (This statement seems to be true by inspecting the above graph, but inspecting graph is not a valid way of proving this statement.)

Proof

Proof. Assume x2−x−2<−2. Then, x2−x<0⟹x(x−1)<0 ("⟹" is read "which implies" in this context). It follows that we have either

  • x<0 and x−1>0, or
  • x>0 and x−1<0.

Since no real number x satisfies the first one, we must have the second one, which gives 0<x<1.

◻


Combining the two results in the previous example and exercise, we get an "if and only if" result:

For every x∈ℝ, we have x2−x−2<−2 if and only if 0<x<1.

In other words, using set language, {x∈ℝ:0<x<1}={x∈ℝ:(x−1)2<1}. (Both sets represent the curve (strictly) under the horizontal line y=−2 in the above graph.)

Letting P(x) and Q(x) be the open statement "x2−x−2<−2" and "0<x<1" respectively, we can express the above result symbolically: ∀x∈ℝ,P(x)⟺Q(x). Recall that "P(x)⟺Q(x)" means "P(x)⟹Q(x)" and "Q(x)⟹P(x)". So, to give a direct proof to the statement in the form of "∀x∈S,P(x)⟺Q(x)", a usual way is to break the proof into two parts:

  1. proving that ∀x∈S,P(x)⟹Q(x) (known as the "only if" part, or "⇒" direction)
  2. proving that ∀x∈S,Q(x)⟹P(x) (known as the "if" part, or "⇐" direction)

Example. Prove that for every n∈ℕ, n+1n≥2. (Hint: this inequality is equivalent to the inequality n2+1≥2n, obtained by multiplying both side by n, which is a positive integer.)

Proof. Using the hint, it suffices to prove that for every n∈ℕ, n2+1≥2n. But it follows from the fact that n2−2n+1=(n−1)2≥0.

◻

Clipboard

Exercise.

We can strengthen the statement (i.e., make the statement stronger (recall the meaning of "stronger" in previous chapter)) in the example, by changing ℕ to a larger set. Determine which of the following (may be more than one) can be the larger set.

ℤ
ℚ
ℝ
None of the above.

A student provides the following proof to the above statement:

Proof. Since n is a positive integer, multiplying n to both sides of the inequality yields n2+1≥2n. After rearranging, we get n2−2n+1=(n−1)2≥0, which is always true.

◻

Point out the mistake in the proof.

Solution

The mistake is that the student implicitly assumes n+1n≥2, which is what we want to prove, at the beginning of the proof. Thus, this proof does not prove the result. (Notice that in the proof in the example, we do not assume n+1n≥2. Instead, we start from the fact that (n−1)2≥0.)


Example. Let S={3,5,7,9,11}. Prove that for every n∈S, if n is prime, then n is odd.

Proof. Assume n is prime. Since the only primes in the set S are 3,5,7 and 11, this means n=3,5,7 or 11. Hence, n is odd.

◻

Clipboard

Exercise. Prove that for every n∈S, if n is even, then n is prime.

Proof

Proof. Since the set S only contains odd numbers, the hypothesis is false, and therefore the result follows vacuously.

◻



Example. (A special case of AM-GM inequality) Prove that for every x,y∈ℝ, if x and y are positive, then xy≤x+y2.

Proof. Assume x and y are positive. Then, (x−y)2≥0⟹(x+y)2−4xy≥0⟹(x+y)2≥4xy⟹x+y≥2xy⟹xy≤x+y2.

◻

Clipboard

Exercise. Suggest a condition where the equality holds, i.e., xy=x+y2.

Solution

The condition is x=y.


[edit | edit source]

After introducing the method of direct proof, let us apply this method on proving some results relating to congruence of integers. Before this, let us introduce the concept of congruence of integers. We begin by a motivation for the definition of congruence of integers.

We know that an integer x is either even or odd, i.e., can be expressed as 2k or 2k+1 for some integer k, according to whether the remainder is 0 or 1 when x is divided by 2. Thus, if two integers x and y have the same remainder when divided by 2 (i.e., have the same parity), then the difference x−y can be proved to be a multiple of 2 (it can be proved that the converse is also true). Similarly, an integer can be expressed as 3k,3k+1 or 3k+2 for some integer k, according to whether remainder is 0, 1 or 2 when x is divided by 3. Hence, if two integers x and y have the same remainder when divided by 3, then the difference x−y can be proved to be a multiple of 3 (the converse is also true).

Hence, "two integers have the same remainder when divided by some integer k" is equivalent to "their difference is a multiple of k". This leads us to the following definition.

Definition. (Congruence of integers) Let a,b∈ℤ and n∈ℕ with n≥2. Then, the integer a is congruent to b modulo n, denoted by a≡b(modn), if a−b is a multiple of n, i.e., a−b=nk for some k∈ℤ.

Remark.

  • Instead of "a−b is a multiple of n", we can also say a−b is divisible by n, or n divides a−b, denoted by n|(a−b) (in general, the notation x|y means "x divides y" (and x∤y means "x does not divide y").

Example. We have 13≡1(mod12) since 12|(13−1), and −23≡−13(mod12) since 12|(−23−13). But, 5≢10(mod4) since 4∤(5−10).

Clipboard

Exercise.

1

Choose the integers that are congruent modulo 3.

5,8
-9,7
-9,18
0,37
None of the above.

2

Choose the integers that are congruent modulo 6.

5,8
-9,7
-9,18
0,37
None of the above.

3

Choose the integers that are congruent modulo 9.

5,8
-9,7
-9,18
0,37
None of the above.


Example. (Clock arithmetic) A familiar application of the concept of congruence of integers is clock arithmetic. For instance, when we want to know adding 5 hours to 8 o'clock gives what time, we first calculate 8+5=13. But 13>12. So, we now think about 13 is congruent to which integer between 1 and 12. The integer is 1. Hence, the time is 1 o'clock.

In general, we can get the resulting time by performing the modulo operation, which gives the remainder when dividing the sum of the two numbers by 12 (called modulus). The notation for "a modulo n" is a mod n, which gives the remainder when a is divided by n (a and n are positive integers).

Now, let us apply direct proof to prove some results related to the congruence of integers.

Theorem. For every a,b,c,d,k∈ℤ and for every n∈ℕ with n≥2, if a≡b(modn) and c≡d(modn), then

  • (compatibility with addition) a+c≡b+d(modn).
  • (compatibility with translation) a+k≡b+k(modn).
  • (compatibility with scaling) ka≡kb(modn).
  • (compatibility with multiplication) ac≡bd(modn).

(For the compatibility with translation and scaling, the assumption that c≡d(modn) is not needed.)

Proof. We will only prove the compatibility with addition and multiplication. The proof of other two compatibilities is left to the following exercise.

Compatibility with addition: Assume that a≡b(modn) and c≡d(modn). Then, a−b=nk1 and c−d=nk2 for some k1,k2∈ℤ. Thus, (a+c)−(b+d)=(a−b)+(c−d)=nk1+nk2=n(k1+k2). Since k1+k2∈ℤ, we have a+c≡b+d(modn).

Compatibility with multiplication: Assume that a≡b(modn) and c≡d(modn). Then, a−b=nk1 and c−d=nk2 for some k1,k2∈ℤ. Thus, ac−bd=ac−bc+bc−bd=c(a−b)+b(c−d)=cnk1+bnk2=n(ck1+bk2). Since ck1+bk2∈ℤ, we have ac≡bd(modn).

◻

Remark.

  • We have applied the trick ac−bd=ac−bc+bc−bd in the proof of compatibility with multiplication. One can also prove it without using this trick. The details are left to the following exercise.
Clipboard

Exercise. Prove the compatibility with multiplication in the above theorem, without using the trick used in the above proof. (Hint: You may express a in terms of b and c in terms of d first.)

Proof

Assume that a≡b(modn) and c≡d(modn). Then, a−b=nk1 and c−d=nk2 for some k1,k2∈ℤ. That is, a=b+nk1 and c=d+nk2. Hence, ac−bd=(b+nk1)(d+nk2)−bd=bd+bnk2+dnk1+n2k1k2−bd=n(bk2+dk1+nk1k2). Since bk2+dk1+nk1k2∈ℤ, we have ac≡bd(modn).

Clipboard

Exercise. Prove the compatibility with translation and scaling in the above theorem.

Proof

One can of course use direct proof and the definition of congruence of integers to prove them, but we will just apply the compatibility with addition and multiplication (which are proven) to prove them (they can be regarded as corollaries of the compatibility with addition and multiplication).

Proof. Assume a≡b(modn). Since k−k=0(n), we have k≡k(modn). Hence, by the compatibility with addition, we have a+k≡b+k(modn). Also, by the compatibility with multiplication, we have ka≡kb(modn).

◻


In the above result, everything is with the same "modulo n". It is then natural to ask whether there are any results for different "modulo". The answer is yes, and to discuss a result, we need the concept of relatively prime integers.

Definition. (Relatively prime integers) Two integers are relatively prime if their greatest common divisor is 1.

Remark.

  • The integers are also called coprime or mutually prime.

Example.

  • 2 and 3 are relatively prime.
  • 4 and 12 are not relatively prime since their greatest common divisor is 4.
  • 9 and 66 are not relatively prime since their greatest common divisor is 3.

Theorem. Two integers a and b are relatively prime if and only if there exist integers x and y such that ax+by=1.

Proof. Omitted.

◻

Using this result, we can deduce the following result:

Theorem. For every a,b,m,n∈ℤ with m,n≥2, if a≡b(modm), a≡b(modn) and m,n are relatively prime, then a≡b(modmn).

Proof. Assume a≡b(modm), a≡b(modn), and m,n are relatively prime. Then, we have a−b=k1m and a−b=k2n for some k1,k2∈ℤ. This means k1m=k2n. Also, mx+ny=1 for some x,y∈ℤ. Multiplying both sides by the integer k1, we get xmk1+ynk1=k1. Putting m=k2nk1, we get xk2n+ynk1=k1⟹n(xk2+yk1)=k1. Putting this into a−b=k1m, we get a−b=mn(xk2+yk1). Since xk2+yk1∈ℤ, we have a≡b(modmn).

◻

Remark.

  • This theorem says in particular if an integer is a multiple of m, and also a multiple of n, and n and n are relatively prime, then the integer is a multiple of mn.
  • For example, if an integer is a multiple of 3 and also a multiple of 7, then the integer is a multiple of 21 since 3 and 7 are relatively prime.
Clipboard

Exercise. Give an example of integers a,b,m,n such that a≡b(modm), a≡b(modn), m and n are not relatively prime, and a≢b(modmn).

Solution

Take a=4,b=8,m=2,n=4. Then, 4≡8(mod2) and 4≡8(mod4). However, 4≢8(mod8).

Example. (Reflexivity, symmetry, and transitivity of the congruence of integers) Prove that for every n∈ℕ with n≥2,

  • (reflexivity) for every a∈ℤ, a≡a(modn).
  • (symmetry) for every a,b∈ℤ, if a≡b(modn), then b≡a(modn).
  • (transitivity) for every a,b,c∈ℤ, if a≡b(modn) and b≡c(modn), then a≡c(modn).

(Since the congruence of integers satisfies these three properties, it is said to be an equivalence relation. We will discuss the concept of (equivalence) relation in a later chapter.)

Proof.

Reflexivity:

Since a−a=0(n), we have a≡a(modn).

Symmetry:

Assume a≡b(modn). Then, a−b=kn for some k∈ℤ. Thus, b−a=−kn, and hence b≡a(modn) since −k∈ℤ.

Transitivity:

Assume a≡b(modn) and b≡c(modn). Then, a−b=k1n and b−c=k2n for some k1,k2∈ℤ. Hence, a−c=(a−b)−(b−c)=(k1−k2)n. Thus, a≡c(modn) since k1−k−2∈ℤ.

◻


Remark.

  • Notice that not all relations satisfy all these three properties. For instance, "≠" does not satisfy the reflexivity and transitivity, "<" does not satisfy the reflexivity and symmetry.

Example. Applying the compatibility with multiplication in the above theorem, we can get the following result:

Let a be an integer, m be a nonnegative integer, and n∈ℕ with n≥2. If a≡1(modn), then am≡1(modn).

We can prove it (a bit informally) as follows:

Proof. Assume a≡1(modn). First, a0=1≡1(modn). Second, we have a⋅a≡1⋅1(modn)⟹a2≡1(modn). Applying this argument again, we get a2⋅a≡1⋅1(modn)⟹a3≡1(modn). Thus, we have am≡1(modn) for every nonnegative integer m by applying the argument "again and again".

◻

To prove the result formally, we need to use proof by mathematical induction, which will be discussed later.

Example.

(a) Consider the remainder of 3n when divided by 4 (i.e., 3n mod 4) for n=0,1,2,3,4,5. Do you observe any pattern? Hence, suggest a conjecture.

(b) Prove the conjecture.

Solution.

(a) We have n0123453n mod 4131313 Notice that the remainder is 1 for n=0,2,4, and 3 for n=1,3,5. It is thus natural to expect that the same pattern continue for all other larger integers. Thus, a conjecture is

Let n be a nonnegative integer. If n is even, then 3n≡1(mod4). Also, if n is odd, then 3n≡3(mod4).

(b) We will just prove "If n is even, then 3n≡1(mod4).". The proof of the second part is left to the following exercise.

Proof. Assume n is even. Then, n=2k for some nonnegative integer k (n is a nonnegative integer). It follows that 3n=32k=9k. Since 9≡1(mod4), it follows that 9k≡1(mod4) by the result in previous example. Hence, 3n≡1(mod4).

◻

Clipboard

Exercise. Prove the second part in the above conjecture.

Proof

Proof. Assume n is odd. Then, n=2k+1 for some nonnegative integer k. It follows that 3n=32k+1=3⋅9k. From the prove above, we have 9k≡1(mod4). Thus, we get 3⋅9k≡3⋅1(mod4)⟹3n≡3(mod4).

◻



The following lemma is quite useful for proving results about congruence of integers.

Lemma. (Euclid's division lemma) For every integer a and b with b≠0, there exists a unique pair of integers q and r such that a=bq+r and 0≤r<|b|.

Proof. We separate the proof into existence part and uniqueness part.

Existence part:

Case 1: b<0.

Then, we set b′=−b>0 and q′=−q. After that, the equation a=bq+r can be rewritten equivalently as a=b′q′+r, and also the inequality 0≤r≤|b′| can be rewritten equivalently as 0≤r≤|b′|. Through this, we transform this case to case 2.

Case 2: b>0.

Subcase 1: a<0 and b>0.

Then, we set a′=−a, q′=−q−1, and r′=b−r. After that, the equation a=bq+r can be rewritten equivalently as a′=bq′+r′ (this is equivalent to −a=−bq−r). Also, the inequality 0≤r≤|b′| can be rewritten equivalently as 0≤r′<|b|. Through this, we transform this case to the subcase 2.

Subcase 2: a≥0 and b>0.

Set q1=0 and r1=a≥0. Then, we have a=bq1+r1.

Subsubcase 1: r1<b=|b|. Take q=q1 and r=r1. Then, we have a=bq+r and 0≤r<|b|, and we are done.

Subsubcase 2: r1≥b.

Set q2=q1+1 and 0≤r2=r1−b<r1. Then, we have a=bq2+r2 with 0≤r2<r1. Since there are exactly r1 nonnegative integers less than r1, we need to repeat this process at most r1 times (b≥1, so r2 is at most the preceding integer of r1) to get a rk such that 0≤rk<|b| [14] (and also a qk).

So, we take q=qk and r=rk. Then, we have a=bq+r and 0≤r<|b|, and we are done.

Uniqueness part:

Assume there exists another pair of integers q∗ and r∗ (in addition to the pair of integers q and r) such that a=bq∗+r∗ and 0≤r∗<|b|. Since we have also a=bq+r and 0≤r<|b|, we get, by subtracting the two equations, 0=b(q−q∗)+r−r∗⟹b(q−q∗)=r∗−r.

Also, by considering the above two inequalities, we get 0≤|r∗−r|<|b|⇒0≤|b(q−q∗)|<|b|⇒0≤|b||q−q∗|<|b|⇒0≤|q−q∗|<1(b≠0)⇒|q−q∗|=0⇒q=q∗. Putting it in the above equation, we get 0=r∗−r⟹r=r∗.

Thus, we have q=q∗ and r=r∗.

◻

Remark.

  • This lemma is the basis of Euclidean division, as known as division with remainder.
  • a is called the dividend, b is called the divisor, q is called the quotient, and r is called the remainder.
  • We employ the method of proof by cases in the proof, which is not a "new" way of proof strictly speaking. We just consider different cases in the proof. However, when we use this method, we need to ensure that the cases covers all possibilities for the "for every", so that we actually prove the statement.
  • From this lemma, we know that every integer has remainder either 0 or 1 or 2 or ... or n−1 (from the inequality 0≤r<|n|) when divided by an integer n with n≥2. In other words, for every integer x, we have either x≡0(modn) or x≡1(modn) or ... or x≡n−1(modn). For brevity, we can also write x≡0 or 1 or ⋯ or n−1(modn).

Example. Prove that for every integer n, n2≡0 or 1(mod4).

Proof. By Euclid's division lemma, we have n≡0 or 1 or 2 or 3(mod4). Thus, we have n2≡0 or 1 or 4 or 9(mod4). But 4≡0(mod4) and 9≡1(mod4). So, the result follows by the transitivity of the congruence of integers.

◻

Clipboard

Exercise. Propose a similar result for the congruence modulo 5, and prove it.

Solution

Proposition: For every integer n, n2≡0 or 1 or 4(mod5).

Proof. By Euclid's division lemma, we have n≡0 or 1 or 2 or 3 or 4(mod5). Thus, we have n2≡0 or 1 or 4 or 9 or 16(mod5). But 9≡4(mod5) and 16≡1(mod5). So, the result follows.

◻




[edit | edit source]

The proofs related to sets are often in the form of

  1. A set is a subset of another set.
  2. A set equals another set.

To prove that a set is a subset of another set, we use the definition of subset:

A set X is a subset of another set Y if for every element x, if x∈X, then x∈Y.

Thus, we can employ direct proof to prove that a set is a subset of another set.

For the equality of two sets, recall that:

A set X equals another set Y if and only if X⊆Y and Y⊆X.

Thus, to prove the equality of two sets, we often need to separate the proof into two parts: (i) proving that X⊆Y; (ii) proving that Y⊆X.

Example. (Transitivity of "⊆") Prove that for every set A,B and C, if A⊆B and B⊆C, then A⊆C.

Proof. Assume A⊆B and B⊆C. Then, for every x, x∈A⟹A⊆Bx∈B⟹B⊆Cx∈C, and hence A⊆C.

◻


Example. (Associative law) Prove that for every set A,B and C, A∪(B∪C)=(A∪B)∪C.

Proof. First, we prove that A∪(B∪C)⊆(A∪B)∪C. For every x, x∈A∪(B∪C)⟹(x∈A) or (x∈B or x∈C)⟹(x∈A or x∈B) or x∈C(Associative law of disjunction)⟹x∈(A∪B)∪C. Thus, we have A∪(B∪C)⊆(A∪B)∪C.

Now, we prove the reverse subset inclusion, i.e., (A∪B)∪C⊆A∪(B∪C). For every x, x∈(A∪B)∪C⟹(x∈A or x∈B) or x∈C⟹x∈A or (x∈B or x∈C)(Associative law of disjunction)⟹x∈A∪(B∪C). Thus, we have (A∪B)∪C⊆A∪(B∪C).

◻

Notice that the proof for reverse subset inclusion is very similar to the proof for the first part. Indeed, it is just a reverse of the proof for the first part. Hence, we can actually simplify the proof as follows:

Proof. For every x, x∈A∪(B∪C)⟺(x∈A) or (x∈B or x∈C)⟺(x∈A or x∈B) or x∈C(associative law of disjunction)⟺x∈(A∪B)∪C. Thus, we have A∪(B∪C)=(A∪B)∪C.

◻

Using this proof, we can prove the set equality directly (set A equals set B if for every x, x∈A⟺x∈B). (However, we should be careful about whether we really have "⟺".) But, in many cases, the proof for reverse subset inclusion is not just simply obtained by reversing the proof for the first part, and we have to separate the proof into proofs for two subset inclusions.

We can observe that to prove different laws for the sets, we just simply use the corresponding laws in logic to prove them. Hence, the proofs for other laws, e.g., commutative law and distributive law, are similar.

Clipboard

Exercise. (De Morgan's law) Let A and B subsets of a universal set U. Prove that (A∪B)c=Ac∩Bc.

Proof

Proof. For every x, x∈(A∪B)c⟺x∈U and (x∉A∪B)⟺x∈U and (∼(x∈A or x∈B))⟺x∈U and (∼(x∈A) and ∼(x∈B))(De Morgan's law in logic)⟺x∈U and (x∉A and x∉B)⟺(x∈U and (x∉A) and (x∈U and x∉B)⟺x∈Ac and x∈Bc⟺x∈Ac∩Bc.

◻


Example. Let A and B be subsets of a universal set U. Prove that A∖B=A∩Bc.

Proof. For every x, x∈A∖B⟺(x∈A and x∉B)⟺(x∈A and x∈Bc)⟺x∈A∩Bc.

◻

Clipboard

Exercise. Using this result, prove that (A∪B)∖(A∩B)=(A∖B)∪(B∖A). (Hint: you may use the laws in set theory in the proof.)

Proof

Here, we just use the laws of in set theory to prove the equality of sets: (A∪B)∖(A∩B)=(A∪B)∩(A∩B)c=(A∪B)∩(Ac∪Bc)(De Morgan's law)=((A∪B)∩Ac)∪((A∪B)∩Bc)(Distributive law)=((A∩Ac)∪(B∩Ac))∪((A∩Bc)∪(B∩Bc))(Distributive law)=(∅∪(B∩Ac))∪((A∩Bc)∪∅)=(B∩Ac)∪(A∪Bc)=(B∖A)∪(A∖B).(above result)


Example. Prove that for every set A and B, A⊆A∪B and A∩B⊆A.

Proof. For the first one, for every x, x∈A⟹x∈A or x∈B⟹x∈A∪B. (no matter x∈B is true or false, we always have the first implication.)

For the second one, for every x, x∈A∩B⟹x∈A and x∈B⟹x∈A.

◻

Clipboard

Exercise.

(a) Propose an assumption on the sets A and B such that we have both reverse subset inclusions, i.e., A∪B⊆A and A⊆A∩B. Prove them under this assumption.

(b) Propose an assumption on the sets A and B such that we have A∪B⊆A (the another reverse subset inclusion may or may not hold). Prove it under this assumption.

(c) Propose an assumption on the sets A and B such that we have A⊆A∩B (the another reverse subset inclusion may or may not hold). Prove it under this assumption.

(The assumptions proposed should be as weak (recall the meaning of weak in logic) as possible, so that the result can apply in more contexts.)

Solution

(a) Assumption: A=B.

Proof. Assume A=B. For the first one, for every x, x∈A∪B⟹x∈A or x∈B⟹x∈A or x∈A⟹x∈A. For the second one, for every x, x∈A⟹x∈A and x∈A⟹x∈A and x∈B⟹x∈A∩B.

◻

(One can also use the some results in set theory (e.g. A∪A=A, A∩A=A, etc.) in the proof.)

(b) Assumption: B⊆A.

Proof. Assume B⊆A. Then, for every x, x∈A∪B⟹x∈A or x∈B⟹x∈A or x∈A⟹x∈A.

◻

(c) Assumption: A⊆B.

Proof. Assume A⊆B. Then, for every x, x∈A⟹x∈A and x∈B⟹x∈A∩B. (We have the first implication, since if x∈A, then we have x∈A, and also x∈B since A⊆B)

◻



Clipboard

Exercise. Consider the statement: for every set A,B and C, (A∖B)∖C=(A∖C)∖(B∖C). A student gives the following proof:

Proof. For every x, x∈(A∖B)∖C⟺x∈A∖B and x∉C⟺x∈A and x∉B and x∉C⟺(x∈A and x∉C) and x∉B⟺(x∈A and x∉C) and x∉B∖C(B∖C⊆B, and consider contrapositive)⟺x∈A∖C and x∉B∖C⟺x∈(A∖C)∖(B∖C).

◻

Is the proof correct? If not, point out the mistake and give a correct proof.

Solution

The mistake is in this step: (x∈A and x∉C) and x∉B⟺(x∈A and x∉C) and x∉B∖C(B∖C⊆B, and consider contrapositive). We have "⟹", but do not necessarily have "⟸", since we generally do not have B⊆B∖C, and thus we cannot show "⟸" by contrapositive.

The following is a correct proof:

Proof. For every x, x∈(A∖B)∖C⟹x∈A∖B and x∉C⟹x∈A and x∉B and x∉C⟹(x∈A and x∉C) and x∉B⟹(x∈A and x∉C) and x∉B∖C(B∖C⊆B, and consider contrapositive)⟹x∈A∖C and x∉B∖C⟹x∈(A∖C)∖(B∖C). On the other hand, for every x, x∈(A∖C)∖(B∖C)⟹x∈A∖C and x∉B∖C⟹(x∈A and x∉C) and x∉B∖C⟹(x∈A and x∉C) and (x∉B or x∈C)(De Morgan's law)⟹(x∈A and x∉C) and x∉B) or (x∈A and x∉C and x∈C)(Distributive law)⟹(x∈A and x∉B and x∉C) or 𝐅⟹x∈A and x∉B and x∉C⟹x∈A∖B and x∉C⟹x∈(A∖B)∖C.

◻


Example. Prove that for every set A,B,C and D, if A⊆C and B⊆D, then A×B⊆C×D.

Proof. For every (x,y), (x,y)∈A×B⟹x∈A and y∈B⟹x∈C and y∈D(A⊆C and B⊆D)⟹(x,y)∈C×D.

◻


Example. Prove that for every set A,B and C, A×(B∪C)=(A×B)∪(A×C).

Proof. For every (x,y), (x,y)∈A×(B∪C)⟺x∈A and y∈B∪C⟺x∈A and (y∈B or y∈C)⟺(x∈A and y∈B) or (x∈A and y∈C)(Distributive law)⟺(x,y)∈A×B or (x,y)∈A×C⟺(x,y)∈(A×B)∪(A×C).

◻

Clipboard

Exercise. Prove that for every set A,B and C,

(a) A×(B∖C)=(A×B)∖(A×C).

(b) A×(B∩C)=(A×B)∩(A×C).

Solution
(a)

Proof. For every (x,y), (x,y)∈A×(B∖C)⟹x∈A and y∈B∖C⟹x∈A and y∈B and y∉C⟹(x,y)∈A×B and (x,y)∉A×C(y∉C)⟹(x,y)∈(A×B)∖(A×C). (Notice that for the third "⟹", we cannot change it to "⟺" since (x,y)∉A×C⟹y∉C.)

On the other hand, for every (x,y), (x,y)∈(A×B)∖(A×C)⟹(x∈A and y∈B) and (x∉A or y∉C)(De Morgan's law)⟹(x∈A and y∈B and x∉A) or (x∈A and y∈B and y∉C)(Distributive law)⟹𝐅 or (x∈A and y∈B∖C)⟹(x,y)∈A×(B∖C).

◻


(b)

Proof. For every (x,y), (x,y)∈A×(B∩C)⟺x∈A and y∈B∩C⟺x∈A and y∈B and y∈C⟺(x∈A and y∈B) and (x∈A and y∈C)⟺(x,y)∈A×B and (x,y)∈A×C⟺(x,y)∈(A×B)∩(A×C).

◻



Clipboard

Exercise. Consider the statement:

For every set A,B and C, if A×C=B×C and C≠∅, then A=B.

A student provides the following proof:

Proof. Assume A×C=B×C and C≠∅. For every a, a∈A⟺(a,c)∈A×C(C≠∅, so we can pick c∈C)⟺(a,c)∈B×C(A×C=B×C)⟺a∈B.

◻

Is the proof correct? If not, point out the mistake and give a correct proof.

Solution

The proof is correct.

Example. Prove that (A×B)∩(C×D)=(A∩C)×(B∩D) for every set A,B,C and D.

Proof. For every (x,y), (x,y)∈(A×B)∩(C×D)⟺(x,y)∈A×B and (x,y)∈C×D⟺(x∈A and y∈B) and (x∈C and y∈D)⟺(x∈A and x∈C) and (y∈B and y∈D)⟺x∈A∩C and y∈B∩D⟺(x,y)∈(A∩C)×(B∩D).

◻

Clipboard

Exercise. Prove that (A×B)∪(C×D)⊆(A∪C)×(B∪D) for every set A,B,C and D. (Hint: you may find the property P or Q⟹P useful.)

Proof

Proof. For every (x,y), (x,y)∈(A×B)∪(C×D)⟹(x,y)∈A×B or (x,y)∈C×D⟹(x,y)∈A×B⟹x∈A and y∈B⟹x∈A∪C and y∈B∪D⟹(x,y)∈(A∪C)×(B∪D).

◻


Remark.

  • The reverse subset inclusion does not hold. For instance, take A={1},B={2},C={3} and D={4}. Then, (A×B)∪(C×D)={(1,2),(3,4)} and (A∪C)×(B∪D)={1,3}×{2,4}={(1,2),(1,4),(3,2),(3,4)}. We can see that there is not reverse subset inclusion in this case.



Example. Let A and B be sets. Prove that A⊆B if and only if 𝒫(A)⊆𝒫(B).

Proof. "⇒" direction: Assume A⊆B. Then, for every set X, X∈𝒫(A)⟹X⊆A⟹X⊆B(A⊆B, and transitivity of ⊆)⟹X∈𝒫(B). Thus, we have 𝒫(A)⊆𝒫(B).

"⇐" direction: Assume 𝒫(A)⊆𝒫(B). Then, for every x, x∈A⟹{x}⊆A(trick)⟹{x}∈𝒫(A)⟹{x}∈𝒫(B)(𝒫(A)⊆𝒫(B))⟹{x}⊆B⟹x∈B. Thus, A⊆B.

◻

We can also prove the "⇐" direction more simply:

Assume 𝒫(A)⊆𝒫(B). Since for every set X, X⊆X, and thus X∈𝒫(X), we have A∈𝒫(A)⟹A∈𝒫(B)(𝒫(A)⊆𝒫(B))⟹A⊆B.(transitivity of ⊆)

Clipboard

Exercise. Let A and B be sets.

(a) Prove that 𝒫(A)∩𝒫(B)=𝒫(A∩B).

(b) Give an example of A and B such that 𝒫(A)∪𝒫(B)≠𝒫(A∪B).

(c) We will have 𝒫(A)∪𝒫(B)=𝒫(A∪B) under an assumption. Propose an assumption, and prove the equality under the assumption. (Hint: construct some simple examples to observe whether there are any patterns.)


Solution
(a)

Proof. Claim: X⊆A and X⊆B⟺X⊆A∩B.

Proof. "⇒" direction: Assume X⊆A and X⊆B. Then, for every x, x∈X⟹x∈A and x∈B⟹x∈A∩B. So, X⊆A∩B.

"⇐" direction: Assume X⊆A∩B. Then, for every x, x∈X⟹x∈A∩B⟹x∈A. Also, x∈X⟹x∈A∩B⟹x∈B. Hence, X⊆A and X⊆B.

◻

For every set X, X∈𝒫(A)∩𝒫(B)⟺X∈𝒫(A) and X∈𝒫(B)⟺X⊆A and X⊆B⟺X⊆A∩B⟺X∈𝒫(A∩B).

◻

(b) Take A={1} and B={2}. Then, 𝒫(A)∪𝒫(B)={∅,{1},{2}}, while 𝒫(A∪B)=𝒫({1,2})={∅,{1},{2},{1,2}}.

(c) An assumption is "A⊆B or B⊆A".

Proof. Assume A⊆B or B⊆A.

Case 1: A⊆B.

Then, A∪B=B. Hence, 𝒫(A∪B)=𝒫(B). On the other hand, by the above example, we have A⊆B⟹𝒫(A)⊆𝒫(B), and thus 𝒫(A)∪𝒫(B)=𝒫(B). Therefore, 𝒫(A)∪𝒫(B)=𝒫(A∪B).

Case 2: B⊆A.

The proof is similar (just interchange "A" and "B").

◻


Proof by contrapositive

[edit | edit source]

Recall that the contrapositive of a conditional P→Q is the statement ∼Q→∼P, which is logically equivalent to the original conditional P→Q. Hence, if we can show that ∼Q⟹∼P, then it follows that P⟹Q. This gives us another method of proof, namely proof by contrapositive.

A proof by contrapositive of the statement ∀x∈S,P(x)⟹Q(x) is a direct proof of ∀x∈S,∼Q(x)⟹∼P(x). That is, we first assume that ∼Q(x) is true, and proceed to show that ∼P(x) is true. In other words, we first assume that Q(x) is false, and proceed to show that P(x) is false.

Generally, when we encounter a statement ∀x∈S,P(x)⟹Q(x), and observe that the consequent Q(x) is "simpler" than the hypothesis P(x), using proof by contrapositive is usually more preferable.

Example. Prove that for every n∈ℤ, if 3n+1 is even, then n is odd.

Proof. Here, we use proof by contrapositive, that is we will prove that "for every n∈ℤ, if n is even, then 3n+1 is odd."

Assume n is even. Then, n=2k for some k∈ℤ. Thus, 3n+1=6k+1=2(3k)+1, and hence 3n+1 is odd since 3k∈ℤ.

◻

Remark.

  • Using proof by contrapositive here allows us to work with with n initially, instead of the more complicated expression 3n+1.


Example. Prove that for every n∈ℤ, n is even if and only if n2 is even.

Proof. "⇒" direction (or "only if" part):

Assume n is even. Then, n=2k for some k∈ℤ. Thus, n2=4k2=2(2k2). Hence, n2 is even since k2∈ℤ.

"⇐" direction (or "if" part):

We use proof by contrapositive, i.e., we will prove that "for every n∈ℤ, if n is odd, then n2 is odd." Now, assume n is odd. Then, n=2k′+1 for some k′∈ℤ. Hence, n2=4k'2+4k′+1=2(2k'2+2k′)+1, and so n2 is odd since 2k'2+2k′∈ℤ.

◻


Remark.

  • Using proof by contrapositive for the "⇐" direction allows us to work with n, instead of n2, initially.
  • The statement is logically equivalent to "for every n∈ℤ, n is odd if and only if n2 is odd." (since P↔Q⟺∼P↔∼Q).

Example. Prove that for every n∈ℤ, n2≡0(mod4) if and only if n≡0 or 2(mod4).

Proof.

"⇒" direction:

We use proof by contrapositive. First, assume n≢0(mod4) and n≢2(mod4). Since n≡0 or 1 or 2 or 3(mod4) by Euclid's division lemma, we have n≡1 or 3(mod4). Hence, n2≡1 or 9(mod4). But 9≡1(mod4). It follows that n2≡1(mod4), and hence n2≢0(mod4).

"⇐" direction:

Assume n≡0 or 2(mod4). Then, we have n2≡0 or 4(mod4). But 4≡0(mod4). So, we have n2≡0(mod4).

◻

Clipboard

Exercise. Prove that n2≡1(mod4) if and only if n≡1 or 3(mod4).

Proof

Proof.

"⇒" direction:

We use proof by contrapositive. First, assume n≢1(mod4) and n≢3(mod4). Since n≡0 or 1 or 2 or 3(mod4) by Euclid's division lemma, we have n≡0 or 2(mod4). Hence, n2≡0 or 4(mod4). But 4≡0(mod4). It follows that n2≡0(mod4), and hence n2≢1(mod4).

"⇐" direction:

Assume n≡1 or 3(mod4). Then, we have n2≡1 or 9(mod4). But 9≡1(mod4). So, we have n2≡1(mod4).

◻

Notice that we can also apply the fact that n2≡0 or 1(mod4) (proved before) to conclude that n2≢1(mod4)⟺n2≡0(mod4). Then, we can see that this statement is just logically equivalent to the above statement (since P↔Q⟺∼P↔∼Q).


Example. Let A and B be sets. Prove that A∪B=B if and only if A⊆B.

Proof.

"⇒" direction:

We use proof by contrapositive. Assume A⊈B, i.e., there exists an element a∈A such that a∉B. Since a∈A, it follows that a∈A∪B. But a∉B. So, A∪B≠B.

"⇐" direction:

Assume A⊆B. Since B⊆A∪B holds for every set A and B, it suffices to show that A∪B⊆B:

For every x, x∈A∪B⟹x∈A or x∈B⟹x∈B or x∈B.(A⊆B)⟹x∈B. So, A∪B⊆B.

◻


Clipboard

Exercise. Prove that for every set A and B, if (A×B)∩(B×A)=∅, then A∩B=∅. (Hint: A∩B≠∅ means that there exists an element x such that x∈A and x∈B.)

Proof

Proof. "⇒" direction:

We use proof by contrapositive. Assume A∩B≠∅. Then, there exists an element x such that x∈A and x∈B. So, we have (x,x)∈A×B and (x,x)∈B×A. This means (x,x)∈(A×B)∩(B×A). Thus, (A×B)∩(B×A)≠∅.

"⇐" direction:

We use proof by contrapositive. Assume (A×B)∩(B×A)≠∅. Then, there exists (x,y) such that (x,y)∈A×B and (x,y)∈B×A. It follows that x∈A and x∈B, meaning that x∈A∩B, and hence A∩B≠∅.

◻


Example. Prove that for every nonnegative real number a, if a<x for every positive real number x, then a=0.

Proof. We use proof by contrapositive, i.e., we will prove that "if a≠0, then a≥x for some positive real number x."

Assume a≠0. This means a>0 since a is nonnegative. Then, we pick x=a which is a positive real number, and we have a≥x.

◻


Clipboard

Exercise. Prove that for every x,y∈ℝ, if xy≤9, then x≤3 or y≤3.

Proof

Proof. We use proof by contrapositive. Assume x>3 and y>3. Then, we have xy>9 (by the property of ">").

◻


Clipboard

Exercise. An integer n is defined to be a perfect square if n=k2 for some k∈ℤ. Prove that for every a,b∈ℤ, if a2+b2 is a perfect square, then a is even or b is even. (Hint: consider a previous result about congruence of integers, that is related to perfect square.)

Proof

We use proof by contrapositive. Assume a is odd and b is odd. Then, a=2k1+1 and b=2k2+1 for some k1,k2∈ℤ. Hence, a2+b2=4k12+4k1+1+4k22+4k2+1=4(k12+k22+k1+k2)+2. This means a2+b2≡2(mod4) since k12+k22+k1+k2∈ℤ. However, no perfect square is congruent to 2 modulo 4 (recall that we have proved that for every integer m, m2≡0 or 1(mod4)). Thus, a2+b2 is not a perfect square.

Proof by cases

[edit | edit source]

In the previous sections, we have actually employed the method of proof by cases already. It is natural to use this method when we need to break down a problem into several cases, and then tackle every case individually ("divide and conquer"). Sometimes, we may even need to further divide a case into several subcases. The following are some typical cases:

  1. an integer is even or odd;
  2. a real number is less than 0, equal to 0, or greater than 0;
  3. for two nonzero real numbers x and y, either xy>0 or xy<0.
  • For every of the cases, it can be divided into two subcases:
  1. xy>0: (x>0 and y>0) or (x<0 and y<0)
  2. xy<0: (x>0 and y<0) or (x<0 and y>0)

But, we should be aware that when we use proof by cases to prove that "∀x∈S,…", the cases should cover all possibilities, i.e., all x∈S.

Example. Prove that for every n∈ℤ, n2+3n+4 is even.

Proof. We divide the proof into two cases: n is even and n is odd.

Case 1: n is even.

Then, n=2k for some k∈ℤ. Thus, n2+3n+4=4k2+6k+4=2(2k2+3k+2). Since 2k2+3k+2∈ℤ, n2+3n+4 is even.

Case 2: n is odd. Then, n=2k′+1 for some k′∈ℤ. Thus, n2+3n+4=4k'2+4k′+1+6k′+3+4=2(2k'2+5k′+4). Since 2k'2+5k′+4∈ℤ, n2+3n+4 is even.

It follows that n2+3n+4 is even for every n∈ℤ.

◻


Example. (Comparing parity) Prove that for every m,n∈ℤ, m and n are of the same parity (i.e., both even or both odd) if and only if m+n is even.

Proof. "⇒" direction: Assume m and n are of the same parity.

Case 1: m and n are both even.

Then, m=2k1 and n=2k2 for some k1,k2∈ℤ. Thus, m+n=2(k1+k2), and hence m+n is even since k1+k2∈ℤ.

Case 2: m and n are both odd.

Then, m=2k3+1 and n=2k4+1 for some k3,k4∈ℤ. Thus, m+n=2(k3+k4+1), and hence m+n is even since k3+k4+1∈ℤ.

"⇐" direction: We use proof by contrapositive. Assume m and n are of different parity.

Case 1: m is odd and n is even.

Then, m=2k5+1 and n=2k6 for some k5,k6∈ℤ. Thus, m+n=2k5+1+2k6=2(k5+k6)+1. Hence, m+n is odd since k5+k6∈ℤ.

Case 2: m is even and n is odd.

The proof is similar to case 1 (just exchange the role of m and n).

◻


Remark.

  • We sometimes use the phrase without loss of generality (WLOG) to indicate that the proofs of the two situations are similar, and thus the proof of only one of these situations is needed. For instance, for the "⇐" direction in the above proof, we may write "Assume m and n are of different parity. WLOG, assume m is odd and n is even. ...".
Clipboard

Exercise. Let a and b be integers. Prove that ab is even if and only if a is even or b is even.

Proof

Proof. "⇒" direction: We use proof by contrapositive. Assume a is odd and b is odd. Then, a=2k1+1 and b=2k2+1 for some k1,k2∈ℤ. Hence, ab=4k1k2+2k1+2k1+1=2(2k1k2+k1+k2)+1, and so ab is odd since 2k1k2+k1+k2∈ℤ.

"⇐" direction: Assume a is even or b is even. WLOG, assume a is even. Then, a=2k for some k∈ℤ. Thus, ab=2kb=2(kb). Since kb∈ℤ, ab is even.

◻


The following inequality is quite important in mathematics.

Theorem. (Triangle inequality) For every x,y∈ℝ, |x+y|≤|x|+|y|.

Proof.

Case 1: x≥0 and y≥0.

Then, x+y≥0, and so |x+y|=x+y=|x|+|y|.

Case 2: x<0 and y<0.

Then, x+y<0, and so |x+y|=(−x)+(−y)=|x|+|y|.

Case 3: one of x and y is nonnegative, and the other is negative.

WLOG, assume x≥0 and y<0.

Subcase 1: x+y≥0.

Then, |x+y|=x+y<x+(−y)(y<0<−y)=|x|+|y|.

Subcase 2: x+y<0.

Then, |x+y|=−(x+y)=(−x)+(−y)≤x+(−y)(−x≤0≤x)=|x|+|y|.

So, we have the desired inequality for every x,y∈ℝ.

◻

Proof by contradiction

[edit | edit source]

Another important method of proof is proof by contradiction.

Let P be a statement. Now, suppose we want to prove that P is true. If we can show that the conditional ∼S→𝐅 is true (i.e., ∼S⟹𝐅), then the truth table for conditional tells us that ∼S must be false, and hence S must be true, as desired.

The truth table: S∼S𝐅∼S→𝐅TFFTFTFF In words, the method of proof by contradiction is as follows: we first assume that the statement we want to prove to be true is false, and then proceed to show that this gives a contradiction, and therefore our assumption must be wrong. That is, it is impossible for the statement to be false since it leads to something "absurd". Hence, the statement is true.

The name of proof by contradiction comes from the fact that the assumption that the statement is false is later contradicted by some other fact. This is also known as reductio ad absurdum, which means reduction to absurdity.

In general, we often use the method of proof by contradiction when the statement we want to prove is negative sounding, e.g. "There is no ....", "There does not exist ...", etc.

Also, to indicate to the reader that we are using proof by contradiction, it is recommended that we write "assume to the contrary that ..." (or something similar) instead of just "assume ..." for the assumption that the statement is false.

Example. Prove that no odd number can be written as a sum of two odd numbers.

Proof. Assume to the contrary that the statement "no odd number can be written as a sum of two odd numbers" is false. That is, assume to the contrary that there is an odd number n that can be written as a sum of two odd numbers x and y. Then, we have x=2k+1 and y=2k′+1 for some k,k′∈ℤ. Hence, we have n=x+y=2(k+k′+1), which means n is even since k+k′+1∈ℤ. But this contradicts to our assumption that n is odd. So, the result follows.

◻


Example. Prove that there is no smallest positive real number.

Proof. Assume to the contrary that there is a smallest positive real number x. Now, consider the number x/2. Since x>0, it follows that x/2>0. Also, we have x/2<x. Hence, x/2 is a positive real number that is less than x, contradicting to our assumption that x is the smallest positive real number.

◻

Clipboard

Exercise.

Which of the following statement is/are true?

There is no smallest positive rational number.
There is no smallest positive integer.
There is no smallest nonnegative integer.

Prove that there is no greatest positive real number.

Proof

Proof. Assume to the contrary that there is a largest positive real number x. Now, consider the number 2x. Since x>0, it follows that 2x>0. Also, we have 2x>x. Hence 2x is a positive real number that is greater than x, contradicting to our assumption that x is the greatest positive real number.

◻



Example. Prove that the sum of an arbitrary rational number and an arbitrary irrational number is irrational.

Although this statement appears to be not so negative sounding, "irrational" just means "not rational". In this sense, we can see that this statement is also quite negative sounding. Also, it is not easy to show that a number is irrational directly (while, on the other hand, showing that a number is rational is quite easy: just express it as a quotient of an integer by a nonzero integer).

Proof. Assume to the contrary that the sum of an arbitrary rational number x and an arbitrary irrational number y is a rational number z. So, we have x+y=z where x=p1q1 and z=p2q2 where p1,p2,q1,q2∈ℤ with q1≠0 and q2≠0. But we can then rewrite the equation as y=z−x=p2q2−p1q1=p2q1−p1q2q1q2. Since p2q1−p1q2,q1q2∈ℤ and q1q2≠0, this means y is rational, contradicting to our assumption that y is irrational.

◻


The following is a typical example in introducing proof by contradiction:

Example. Prove that the number 2 is irrational.

Proof. Assume to the contrary that 2 is rational. Then, 2=pq for some p,q∈ℤ with q≠0. By dividing p and q by some common factor that is at least 2, if necessary, we can further assume that p and q have no common factor greater than or equal to 2, i.e., p/q has been expressed in (or reduced to) the lowest terms.

Taking square for the both sides of the equation 2=pq, we get 2=p2q2⟹p2=2q2. Since q2∈ℤ, this means p2 is even. By a previous result, this implies that p is even. Hence, we have p=2k for some k∈ℤ.

Now substituting it into the equation p2=2q2, we get 4k2=2q2⟹q2=2k2, which means q2 is also even since k2∈ℤ. By a previous result again, this implies that q is even.

Since both p and q are even, they have 2 as a common factor, contradicting to our assumption that p/q has been expressed in (or reduced to) the lowest terms.

◻


The following example is another typical example for demonstrating proof by contradiction. But before discussing it, we need to introduce the following theorem since it is used in the proof.

Theorem. (Fundamental theorem of arithmetic) Every integer n≥2 can be expressed as a product of one or more (not necessarily distinct) primes uniquely. That is, n=p1p2…pr for some prime numbers p1,p2,…,pk, uniquely.

Proof. We will prove this theorem after introducing proof by mathematical induction.

◻

Remark.

  • Notice that the "uniqueness" in the theorem is in the sense of the combination of prime number(s) used is unique. Simply changing the order of the multiplication is not counted as another expression.
  • This theorem is also called unique prime factorization.

Example. (Euclid's theorem) Prove that there are infinitely many prime numbers.

Proof. Assume to the contrary that there are finitely many prime numbers, say n prime numbers. We first list them in ascending order: p1<p2<⋯<pn. Now, consider the number q=p1p2⋯pn+1. Since the smallest prime number is 2, we have p1p2⋯pn≥1 [15], and hence q≥2. Applying the fundamental theorem of arithmetic, there is a unique prime factorization for q, and thus there is a prime number dividing q.

Since p1,…,pn are all the primes by our assumption, it follows that one of them, say pi, divides q, i.e., q=kpi for some k∈ℤ. In addition, we know that pi divides p1p2⋯pn, i.e., p1p2⋯pn=k′pi for some k′∈ℤ.

Therefore, we have 1=q−p1p2⋯pn=(k−k′)pi. This means pi divides 1, which is impossible (notice that 2 is the smallest prime, and only 1 divides itself). So, we are arriving at a contradiction.

◻


Remark.

  • This proof is first suggested by Euclid.

We can also use proof by contradiction to prove that a statement "∀x∈S,P(x)→Q(x)" is true. We first assume that the negation of the statement, i.e., "∃x∈S,P(x)∧(∼Q(x))" is true, and proceed to arrive at a contradiction. (Recall that P→Q⟺(∼P)∨Q. So, ∼(P→Q)⟺P∧(∼Q).) Thus, to prove that ∀x∈S,P(x)⟹Q(x) by contradiction, we assume that there exists x∈S such that P(x) is true and Q(x) is false, and then deduce a contradiction.

Example. Prove by contradiction that for every n∈ℤ, if n is odd, then 3n+1 is even.

Proof. Assume to the contrary that there exists n∈ℤ such that n is odd and 3n+1 is odd. Since n is odd, we have n=2k+1 for some k∈ℤ. Then, 3n+1=3(2k+1)+1=6k+4=2(3k+2). This means 3n+1 is even since 3k+2∈ℤ, contradicting to our assumption that 3n+1 is odd.

◻


Clipboard

Exercise. Prove by contradiction that for every nonnegative real number a, if a<x for every positive real number x, then a=0.

Proof

Proof. Assume to the contrary that a<x for every positive real number x and a≠0. Since a is nonnegative, this means a>0. Now, consider the number x=a>0. By assumption, we have a<x=a, which implies that 1<1, arriving at a contradiction.

◻


Example. Prove that x=log103 is irrational.

Proof. Assume to the contrary that x is rational, i.e., x=pq for some p,q∈ℤ∖{0} (x≠0). Notice that x>0. So, we only have the following cases:

Case 1: p,q∈ℕ.

Now, we have 10x=1⇒10p/q=3⇒10p=3q. But 10p is even, while 3q is odd (product of even (odd) numbers is even (odd)).

Case 2: p and q are both negative integers.

Then, we write x=−p−q. Now, we have 10x=3⇒10−p/−q=3⇒10−p=3−q. But 10−p is even, while 3−q is odd (−p and −q are positive integers).

So, in either case, we arrive at a contradiction.

◻

Clipboard

Exercise. A student provides the following proof to the claim "x=log101 is irrational.":

Proof. Assume to the contrary that x is rational, i.e., x=pq for some p,q∈ℤ∖{0} (x≠0). Notice that x>0. So, we only have the following cases:

Case 1: p,q∈ℕ.

Now, we have 10x=1⇒10p/q=1⇒10p=1. But 10p is even, while 1 is odd.

Case 2: p and q are both negative integers.

Then, we write x=−p−q. Now, we have 10x=1⇒10−p/−q=1⇒10−p=1. But 10−p is even, while 1 is odd.

So, in either case, we arrive at a contradiction.

◻

Is the proof correct? If not, point out the mistake.

Solution

The proof is incorrect. Indeed, log101=0 is rational. The mistake is that the student states that x≠0 and also x>0 in the proof, which are not true.


Clipboard

Exercise. Prove that for every x,y∈ℝ, if x+y is rational, then both x and y are rational, or both x and y are irrational.

Proof

Proof. Assume to the contrary that there exists x,y∈ℝ such that x+y∈ℚ and exactly one of x and y is rational, and the other irrational. WLOG, assume x∈ℚ and y∈𝕀. Then, since y=(x+y)−x, and x+y∈ℚ and x∈ℚ, we have y∈ℚ, contradicting to our assumption that y∈𝕀.

◻


Example. (Sum and product of a rational and an irrational number) Prove that for every x,y∈ℝ, (a) if x∈ℚ and y∈𝕀, then x+y∈𝕀;

(b) if x∈ℚ∖{0} and y∈𝕀, then xy∈𝕀.

Solution.

(a)

Proof. Assume to the contrary that there exist x,y∈ℝ such that x∈ℚ and y∈𝕀 and x+y∈ℚ. Then, y=(x+y)−x∈ℚ, contradicting to our assumption that y∈𝕀.

◻

(b)

Proof. Assume to the contrary that there exist x∈ℚ∖{0} and y∈𝕀 and xy∈ℚ. Then, y=xyx∈ℚ (x≠0), contradicting to our assumption that y∈𝕀.

◻


Sometimes we can prove a statement using multiple methods:

Example. Prove that for every positive real number x and y, if x≤y, then x2≤y2.

We can prove it using (i) direct proof; (ii) proof by contrapositive; (iii) proof by contradiction.

(i)

Proof. Assume x≤y. Then multiplying both sides by x gives x2≤xy. Also, multiplying both sides by y gives xy≤y2. Combining these two inequalities, we get x2≤y2.

◻

(ii)

Proof. Assume x2>y2. Rearranging the inequality gives x2−y2>0⟹(x−y)(x+y)>0. Now dividing both sides by the positive number x+y preserves the direction of inequality, and thus gives x−y>0⟹x>y.

◻

(iii)

Proof. Assume to the contrary that x≤y and x2>y2. Then, we have x≤y⟹x−y≤0. Also, since x and y are positive, x+y>0. So we have (x−y)(x+y)≤0⟹x2−y2≤0⟹x2≤y2, contradicting to our assumption that x2>y2.

◻


Clipboard

Exercise. Let x be a positive real number. Prove that if x−3x>2, then x>3 by (i) direct proof; (ii) proof by contrapositive; (iii) proof by contradiction.

Solution
(i)

Proof. Assume x−3x>2. Multiplying both side by x gives x2−3>2x⟹x2−2x−3>0⟹(x+1)(x−3)>0. Then, dividing both sides by the positive number x+1 gives x−3>0⟹x>3.

◻

(ii)

Proof. Assume x≤3. Then, x−3≤0. Also, x+1>0 (x is positive). Thus, (x−3)(x+1)≤0. This implies x2−2x−3≤0⟹x−3x≤2.

◻

(iii)

Proof. Assume to the contrary that x−3x>2 and x≤3. Then, x−3≤0. Also, x+1>0. So, (x−3)(x+1)≤0, and hence x−3x≤2. This contradicts to our assumption that x−3x>2.

◻


We can see that when proving a statement "∀x∈S,P(x)⟹Q(x)", we may be able to use both proof by contrapositive and proof by contradiction. However, the two proofs are different, and we will compare them in the following table:

Proving that "∀x∈S,P(x)⟹Q(x)."
Proof by contrapositive Proof by contradiction
Assumption ∼Q(x) P(x)∧∼Q(x)
Goal ∼P(x) 𝐅

From this table, we can see that the proof by contradiction is more advantageous in terms of assumption, since it has one more "help" from P(x) (when we assume P(x)∧∼Q(x), we can use both ∼Q(x) and P(x).) However, in terms of goal, the proof by contrapositive is more advantageous since the goal is more clear (∼P(x)), while for the proof by contradiction, it is not clear that what the form of the contradiction is. There can be many "ways" for arriving at a contradiction (compare the contradiction in the proof of "2 is irrational" vs. that of "there are infinitely many primes").

Existence proof

[edit | edit source]

Consider the statement "∃x∈S,P(x)". This statement is true if P(x) is true for at least one x∈S. Otherwise, it is false. Thus, to prove such kind of statement, it suffices to find one element x∈S such that P(x) is true, and this is known as an existence proof. In particular, we should verify that the choice of element x is actually belonging to S and P(x) is actually true for that choice.

Example. Prove that there exists positive integers a,b,c such that a2+b2=c2 (such integers a,b,c are known as a Pythagorean triple).

Proof. Take a=3, b=4 and c=5 (which are integers). Then, a2+b2=32+42=52=c2.

◻


Remark.

  • The choice of a,b,c is not unique. For instance, one can also take a=5,b=12 and c=13. But, giving one example of a,b and c that satisfies the requirement is enough.

Example. Prove that there exists an integer x such that x3=x.

Proof. Take x=1. Then, we have x3=13=1=x.

◻


The following example demonstrates a more advanced version of existence proof: non-constructive proof.

Example. Prove that there exist irrational numbers a and b such that ab is rational.

Proof. We have proved that 2 is irrational. So, we can make use of this fact in this proof.

Consider the real number 22. This number is either rational or irrational. Now we consider the following cases:

Case 1: 22 is rational. Then, we can take a=b=2∈𝕀, and then ab is rational.

Case 2: 22 is irrational. Then, we can take a=22∈𝕀 and b=2∈𝕀. Then, ab=(22)2=(2)2⋅2=(2)2=2, which is rational.

Thus, in either case, we can find two irrational numbers a and b such that ab is rational.

◻


Remark.

  • This type of proof is known as non-constructive proof since it does not actually construct an example a and b, and so we do not know which two irrational numbers a and b satisfy this requirement. However, this proof does prove the existence of such a and b.
Clipboard

Exercise.

(a) Prove that there exist distinct irrational numbers a and b such that ab is rational. (You may use the fact that 3 is irrational.)

(b) Prove that there exist a rational number a and an irrational number b such that ab is rational.

(c) Prove that there exist a rational number a and an irrational number b such that ab is irrational. (You may use the fact that 122 is irrational.)

(d) Prove that there exist rational numbers a and b such that ab is irrational.

Solution
(a)

Proof. Consider the real number 32. It is either rational or irrational. Now, we consider the following cases:

Case 1: 32 is rational. Then, we can take a=3∈𝕀 and b=2∈𝕀, and ab is rational.

Case 2: 32 is irrational. Then, we can take a=32∈𝕀 and b=2∈𝕀. Then, ab=(32)2=(3)2=3, which is rational.

◻

(b)

Proof. Take a=10 and b=log103. Recall that we have proved that b=log103 is irrational. Then, we have ab=10log103=3, which is rational.

◻

(c)

Proof. Consider the real number 21/(22). Now, consider the following cases:

Case 1: 21/(22) is irrational. Then, take a=2 and b=122∈𝕀, and ab is irrational.

Case 2: 21/(22) is rational. Then, take a=21/(22)∈ℚ and b=2∈𝕀. Then, ab=(21/(22))2=21/2=2, which is irrational.

◻

(d)

Proof. Take a=2 and b=1/2. Then, ab=21/2=2, which is irrational.

◻


Disproof

[edit | edit source]

Consider the statement "∀x∈S,P(x).". Suppose we somehow believe that the statement is false. Then, we want to prove that it is false, i.e., prove that "∃x∈S such that P(x) is false." An element x0∈S for which P(x0) is false is known as a counterexample of the statement, and a process of showing that the statement is false (in other words, disproving the statement) is called a disproof of the statement. One counterexample is enough to disprove the statement.

Example. Disprove that x3≥0 for every x∈ℝ.

Disproof. Take x=−1. Then, (−1)3=−1<0.

◻


Example. Disprove that the product of two arbitrary irrational numbers is irrational.

Disproof. To disprove this, we need to find x,y∈𝕀 such that xy∈ℚ.

Take x=y=2. Then, xy=2∈ℚ.

◻


To disprove the statement "∀x∈S,P(x)→Q(x), we show that there exists an element x0∈S such that P(x0)→Q(x0) is false, i.e., P(x0) is true and Q(x0) is false.

Example. Disprove that for every x∈ℤ, if x2≡1(mod4), then x≡1(mod4).

Disproof. Take x=3. Then x2=9≡1(mod4) but 3≢1(mod4).

◻


To disprove the statement "∃x∈S,P(x)", we need to show that there is no such x. That is, we need to show that "∀x∈S,∼P(x)" (the negation of statement) is true. In this case, we are not just constructing counterexamples. We have to prove that ∀x∈S,∼P(x), instead of ∃x∈S,∼P(x).

Example. Disprove that there exists n∈ℤ such that n2+3n+4 is odd.

Disproof. To disprove this, we need to prove that for every n∈ℤ, n2+3n+4 is even. But this has been proved previously (in the section about proof by cases).

◻


Often, before proving or disproving statements, the truth of falseness of them are not known, and we need to decide whether every of them is true or false. After that, we will prove it if it is true and disprove it otherwise. Of course, our decision is not perfectly accurate, and sometimes we make mistake, which leads us to do the opposite thing, i.e., proving a wrong statement or disproving a correct statement. Clearly, when we do such thing, we cannot succeed. However, the process of performing such wrong thing may give us some insights about what the correct direction is, and how to prove/disprove the statement.

To decide whether a statement is true or false, you may follow some tips below:

  • Follow your mathematical intuition. As you have learnt more about mathematics, you may have intuition and idea about whether a statement is true or false, before proving/disproving it.
  • Construct some simple examples. Such examples constructed may be a counterexample (for disproving "∀⋯")/example (for proving "∃⋯") if you are lucky. Even if they are not counterexamples/examples, you may observe some kind of patterns from it, which may give you some insights about how to prove/disprove the statement.

Example. Prove or disprove every of the following statements:

(a) There exists a real number x satisfying the equation x6+9x2+3=0.

(b) Let A,B and C be sets. If A×C=B×C, then A=B.

(c) For every real number x, x2+xx2−x=x+1x−1.

(d) There exists a real number x such that x3<x<x2.

Solution.

(a)

Disproof. Since x is a real number, we have x6≥0 and x2≥0. Hence, x6+9x2+3≥3, and thus x6+9x2+3≠0 for every x∈ℝ.

◻

(b)

Disproof. Take A={1}, B={2} and C=∅. Then, A×C=B×C=∅, but A≠B .

◻

(c)

Disproof. Take x=0. Then the LHS is undefined (the denominator is zero), but the RHS is -1.

◻

(d)

Proof. Take x=−2. Then, x3=−8 and x2=4, and we have x3<x<x2.

◻


Clipboard

Exercise. Prove or disprove every of the following statements:

(a) There exists a real number x such that 2−x and 2+x are both rational.

(b) There exists m,n∈ℚ with m≠n such that 1m+1n=3.

(c) There exist even numbers x and y such that 3x2+y2≡0(mod8).

(d) For every a,b,c,d∈ℝ, if a<b and c<d, then ac<bd.

(e) For every a,b∈ℚ with a<b, there exists x∈ℚ such that a<x<b.

Solution
(a)

Disproof. We want to prove the statement is false. We use proof by contradiction.

Assume to the contrary that the statement is true, i.e., there exists a real number x such that 2−x and 2+x are both rational. Then, we have (2−x)+(2+x)=22 is rational, which contradicts to the fact that 22 (product of a rational number and an irrational number) is irrational.

◻

(b)

Proof. Take m=1 and n=1/2. Then, 1m+1n=1+2=3.

◻

(c)

Proof. Take x=y=2. Then, 3x2+y2=3(2)2+22=12+4=16≡0(mod8).

◻

(d)

Disproof. Take a=c=−2 and b=d=1. Then, a<b and c<d, but ac=4>1=bd.

◻

(e)

Proof. For every a,b∈ℚ, choose x=m+n2∈ℚ (sum/product of two rational numbers is rational). Since m<n, we have m=m2+m2<m+n2<n2+n2=n, as desired.

◻


Proof by mathematical induction

[edit | edit source]

The last proof method discussed in this chapter is proof by mathematical induction. This method is used to prove a statement in the form of "For every integer n greater than or equal to an integer m, P(n) is true.". That is, it is used to prove that a sequence of statements P(m),P(m+1),P(m+2),… is true. Of course, we can prove that every of these statements is true one by one, but the principle of mathematical induction gives an alternative and more convenient method.

To prove the principle of mathematical induction, we need the well-ordering principle. Before introducing it, we need the definition of well-ordered.

Definition. (Well-ordered set) A nonempty set S of real numbers is well-ordered if every nonempty subset of S has a least element.

Example.

  • The set {−3,1,2} is well-ordered since its nonempty subsets are {−3},{1},{2},{−3,1},{−3,2},{1,2},{−3,1,2}, and every of these subsets has a least element.
  • The sets ℤ,ℚ,ℝ are not well-ordered since none of these sets themselves have a least element (it can be proved that there is no smallest integer/rational number/real number).

Now, one may ask that whether the set ℕ is well-ordered. It may appear that it is well-ordered. Here, we will just regard this as an axiom:

Axiom. (Well-ordering principle) The set ℕ is well-ordered.

The well-ordering principle can then be used to prove (a less general version of) the principle of mathematical induction.

Theorem. (The principle of mathematical induction)

The principle of mathematical induction can be illustrated by the sequential effect of falling dominoes. "P(m) is true" means the first domino can be pushed down, and "for every integer k≥m, P(k)⟹P(k+1)" means for every domino, if it falls down, then it will push the next domino down also. With these two requirements satisfied, every domino will fall down eventually (every statement involved is true).

For every m∈ℤ, if P(m),P(m+1),P(m+2),… are statements satisfying

(i) P(m) is true; and

(ii) for every integer k≥m, P(k)⟹P(k+1),

then the statements P(m),P(m+1),P(m+2),… are true.

This theorem is quite intuitive: with the conditions satisfied, we have an "infinite chain of implications":

  • P(m) is true (by (i)).
  • Thus, P(m+1) is true (by (ii)).
  • Thus, P(m+2) is true (by (ii)).
  • Thus, P(m+3) is true (by (ii)) ...

But strictly speaking, this is not counted as a proof. We will give a formal (partial) proof to this theorem below:

Proof. Here we only prove the case where m∈ℕ.

Assume to the contrary that the theorem is false. Then, the conditions (i) and (ii) are satisfied by the statements, but there exist some positive integers n for which P(n) is false. Now, let the set S={n∈ℕ:P(n) is false}. Since S is a nonempty [16] subset of ℕ, by the well-ordering principle, S contains a least element. Let us assume s to be the least element.

Since P(m) is true by the condition (i), m∉S. This means the least element s cannot be m. Hence, s≥m+1, which means s−1≥m.

Since s is the least element of S, we have s−1∉S, i.e., P(s−1) is a true statement. Then, by the condition (ii), P(s) is true (we have s−1≥m). It follows that s∉S. But this contradicts to our assumption that s is the least element of S (in particular, s∈S).

◻

Remark.

  • This proof can be extended to the case where m∈ℤ. But the proof needs to use the result that the set {i∈ℤ:i≥m} is well-ordered. Once we have proven this result, we can simply change the set S in the proof to {i∈ℤ:i≥m and P(i) is false}, and also modify some sentences in the proof slightly for the extension.
  • Notice that in the inductive hypothesis, we assume P(k) is true for an arbitrary integer k with k≥m, but not for every integer k≥m. This is because if we assume the latter, then we are assuming what we want to prove, and so the proof is invalid. While for the former assumption, we just assume P(k) is true for an arbitrary (but not every) integer k with k≥m, but this does not lose generality since k is arbitrary.

Using the principle of mathematical induction, to prove that the statement P(n) is true for every integer n≥m, it suffices to prove two things:

(i) P(m) is true.

(ii) For every integer k≥m, P(k)⟹P(k+1).

Thus, proof in this form is a two-step process. We often call the proof of (i) as the basis step or base case, and the proof of (ii) is called the inductive step. In particular, when we prove (ii), we usually use the method of direct proof, and first assume P(k) is true for an arbitrary integer k with k≥m. Such assumption is often called the inductive (or induction) hypothesis.

Example. Prove that for every n∈ℕ, P(n):1+2+⋯+n=n(n+1)2 is true.

Proof. Here we use the principle of mathematical induction.

Basis Step: Since 1=1(1+1)2, the statement P(1) is true.

Inductive Hypothesis: Let k be an arbitrary positive integer. Assume P(k) is true. That is, assume 1+2+⋯+k=k(k+1)2 is true.

Inductive Step: Since 1+2+⋯+k+(k+1)=k(k+1)2+(k+1)(inductive hypothesis)=k2+k+2k+22=(k+1)(k+2)2, it follows that P(k+1) is true. Hence, by the principle of mathematical induction, P(n) is true for every positive integer n.

◻


Remark.

  • One can also prove this statement using a trick:
First write the sum as 1+2+⋯+(n−1)+n.
Now also write the same sum, but in reverse order: n+(n−1)+⋯+2+1.
After that, add the two sums together in the following way:

1+2+⋯+(n−1)+n+)n+(n−1)+⋯+2+1HLINE TBD(n+1)+(n+1)+⋯+(n+1)+(n+1)⏟n times

Now, we can see that two times the sum gives n(n+1). Thus, the sum 1+2+⋯+(n−1)+n is n(n+1)2.
Clipboard

Exercise. For every n∈ℕ, consider the sum 13+23+⋯+n3. Guess a general formula for the sum and prove it. (Hint: you may compute the value of sum for some values of n, and see whether there are any patterns.)

Solution

When n=1,2,3,4, the sum is 1,9,36,100 respectively. Notice that 1=12,9=32=(1+2)2,36=62=(1+2+3)2 and 100=102=(1+2+3+4)2. Hence, it is natural to guess that the formula is, for every n∈ℕ, 13+23+⋯+n3=(1+2+⋯+n)2. But we have proved that 1+2+⋯+n=n(n+1)2. So this formula can be alternatively expressed as 13+23+⋯+n3=(n(n+1)2)2.

Proof. Let P(n) be the open statement "13+23+⋯+n3=(n(n+1)2)2".

Basis Step: Since 13=(1(1+1)2)3, P(1) is true.

Inductive Hypothesis: Assume P(k) is true for an arbitrary positive integer k. That is, assume 13+23+⋯+k3=(k(k+1)2)2.

Inductive Step: Since 13+23+⋯+k3+(k+1)3=(k(k+1)2)2+(k+1)3=k2(k+1)2+4(k+1)322=(k+1)2(k2+4(k+1))22=(k+1)2(k+2)222=((k+1)(k+2)2)2, P(k+1) is true. Hence, by the principle of mathematical induction, P(n) is true for every positive integer n.

◻

Remark.

  • The following diagram illustrates this statement:


We can use the proof by mathematical induction for proving some inequalities also:

Example. Prove that for every integer n≥5, 2n>n2.

Proof. Let P(n) be the open statement "2n>n2".

Basis Step: Since 25=32>25=52, P(5) is true.

Inductive Hypothesis: Assume P(k) is true for an arbitrary integer k with k≥5. That is, assume 2k>k2. Inductive Step: Since 2k+1=2(2k)>2k2(inductive hypothesis), it suffices to show that 2k2>(k+1)2. Now, consider 2k2−(k+1)2: 2k2−(k+1)2=k2−2k−1=(k−1)2−2>0.(k≥5) Thus, P(k+1) is true. Hence, by the principle of mathematical induction, P(n) is true for every integer n≥5.

◻


Clipboard

Exercise. Prove that for every integer n≥4, n!>2n.

Proof

Let P(n) be the open statement "n!>2n".

Basis Step: Since 4!=24>16=24, P(4) is true.

Inductive Hypothesis: Assume P(k) is true for an arbitrary integer k≥4. That is, assume k!>2k.

Inductive Step: Since (k+1)!=(k+1)k!>(k+1)2k>2⋅2k=2k+1, (we have k+1>2 since k≥4) P(k+1) is true. Hence, by the principle of mathematical induction, P(n) is true for every integer n≥4.

Example. (Sum of a geometric sequence) Prove that for every integer n≥0 and for every real number r≠1, we have 1+r+r2+⋯+rn=1−rn+11−r.

Proof. Let P(n) be the open statement "1+r+r2+⋯+rn=1−rn+11−r".

Basis Step: Since 1=1−r11−r, P(0) is true.

Inductive Hypothesis: Assume P(k) is true for an arbitrary nonnegative integer k. That is, assume 1+r+r2+⋯+rk=1−rk+11−r.

Inductive Step: Since 1+r+r2+rk+rk+1=1−rk+11−r+rk+1=1−rk+1+rk+1−rk+21−r=1−rk+21−r, P(k+1) is true. Hence, by the principle of mathematical induction, P(n) is true for every n≥0.

◻


Example. (Cardinality of power set) Prove that for every set A and for every integer n≥0, if A is finite with |A|=n, then |𝒫(A)|=2n.

Proof. Let An be a finite set with cardinality n and P(n) be the open statement |𝒫(An)|=2n.

Basis Step: Since A0=∅, and |𝒫(∅)|=|{∅}|=1=20, P(0) is true.

Inductive Hypothesis: Assume P(k) is true for an arbitrary nonnegative integer k. That is, assume |𝒫(Ak)|=2k. In other words, there are 2k subsets of Ak.

Inductive Step: First, fix an element a∈Ak+1. Now let B=Ak+1∖{a}. Then, B contains k elements, and thus by inductive hypothesis, there are 2k subsets of B.

Let S be a subset of B. Since B is a subset of Ak+1, it follows that S is a subset of Ak+1. But, a∉S since a∉B. So, S∪{a} is also a subset of Ak+1, that is distinct from S. Thus, every subset S of B gives rise to two subsets of Ak+1, namely S and S∪{a}. As a result, there are 2k subsets of Ak+1 without the element a and 2k subsets with the element a.

So, we have 2k+2k=2k+1 subsets of Ak+1 altogether. Hence, |𝒫(Ak+1)|=2k+1, and thus P(k+1) is true. Hence, by the principle of mathematical induction, P(n) is true for every integer n≥0.

◻


Clipboard

Exercise. (Generalization of De Morgan's law) Prove that for every subset A1,A2,…,An of a universal set U and for every integer n≥2, (A1∩A2∩⋯∩An)c=A1c∪A2c∪⋯∪Anc. (Hint: you may use the ordinary De Morgan's law, i.e., for every subset B,C of a universal set U, (B∩C)c=Bc∪Cc.)

Proof. Let P(n) be the open statement "(A1∩A2∩⋯∩An)c=A1c∪A2c∪⋯∪Anc.".

Basis Step: By the ordinary De Morgan's law, P(2) is true.

Inductive Hypothesis: Assume P(k) is true for an arbitrary integer k≥2. That is, assume (A1∩A2∩⋯∩Ak)c=A1c∪A2c∪⋯∪Akc. Inductive Step: Since (A1∩A2∩⋯∩Ak∩Ak+1)c=(A1∩A2∩⋯∩Ak)c∪Ak+1c(ordinary De Morgan's law)=(A1c∪A2c∪⋯∪Akc)∪Ak+1c(inductive hypothesis)=A1c∪A2c∪⋯∪Akc∪Ak+1c, it follows that P(k+1) is true. Hence, by the principle of mathematical induction, P(n) is true for every integer n≥2.

◻


The strong form of induction

[edit | edit source]

In this section, we will discuss a stronger form of mathematical induction. Sometimes, we need this form of mathematical induction since merely assuming "P(k) is true ..." in the inductive hypothesis may not be enough to show that P(k+1) is true. We may need some more helps, particularly the fact that the statement is true for all cases from the basis step to the given k. That is, if "m" is 1, then we assume P(1),…,P(k) are all true.

Since "P(1)∧P(2)∧⋯∧P(k)" is stronger than "P(k)", we have the name "the strong form of induction".

Theorem. (The strong form of induction) For every m∈ℤ, if P(m),P(m+1),P(m+2),… are statements satisfying

(i) P(m) is true; and

(ii) for every integer k≥m, P(m)∧P(m+1)∧⋯∧P(k)⟹P(k+1),

then the statements P(m),P(m+1),P(m+2),… are true.

This theorem is also quite intuitive: with the conditions satisfied, we get an "infinite chain of implications":

  1. P(m) is true by (i).
  2. Because of 1., P(m+1) is true by (ii).
  3. Because of 1. and 2., P(m+2) is true by (ii).
  4. Because of 1., 2., and 3., P(m+3) is true by (ii) ...

Proof. The proof for the strong form of induction is similar to that of the principle of mathematical induction. We just need to modify some parts of the proof. The blue part is the modified part.

Here we only prove the case where m∈ℕ.

Assume to the contrary that the theorem is false. Then, the conditions (i) and (ii) are satisfied by the statements, but there exist some positive integers n for which P(n) is false. Now, let the set S={n∈ℕ:P(n) is false}. Since S is a nonempty subset of ℕ, by the well-ordering principle, S contains a least element. Let us assume s to be the least element.

Since P(m) is true by the condition (i), m∉S. This means the least element s cannot be m. Hence, s≥m+1, which means s−1≥m.

Since s is the least element of S, we have s−1∉S, i.e., P(s−1) is a true statement. Also, s−2,s−3,…,m+1∉S (they are all less than s). Hence, P(m),P(m+1),…,P(s−2) are also true statements. Then, by the condition (ii), P(s) is true (we have s−1≥m). It follows that s∉S. But this contradicts to our assumption that s is the least element of S (in particular, s∈S).

◻

Hence, to prove that the statement P(n) is true for every n≥m by the strong form of induction, we need to prove

(i) the basis step: P(m) is true; and (ii) the inductive step: for every integer k≥m, if P(m),P(m+1),…,P(k) are true (the inductive hypothesis), then P(k+1) is true.

We usually use the strong form of induction to prove results that are related to recurrence relation.

Example. A sequence x1,x2,… of numbers is defined by x1=1, x2=3 and xn=2xn−1−xn−2 for every integer n≥3 (an equation in such form is called a recurrence relation). Prove that xn=2n−1 for every n∈ℕ.

Proof. Let P(n) be the open statement "xn=2n−1". Now, we will use the strong form of induction to prove that P(n) is true for every n∈ℕ.

Basis Step: Since x1=1=2⋅1−1, P(1) is true.

Inductive Hypothesis: Let k be an arbitrary positive integer. Assume that P(1),…,P(k) are true. That is, assume xi=2i−1 for every integer i with 1≤i≤k.

Inductive Step: We want to show that P(k+1) is true, i.e., xk+1=2(k+1)−1=2k+1. Now, using the recurrence relation, we have xk+1=2xk−xk−1(only holds when k+1≥3)=2(2k−1)−(2(k−1)−1)(inductive hypothesis)=2k+1. So, we have proved that P(k+1) is true for the case where k+1≥3. Now, it remains to prove that P(k+1) is true when k=1, but it is easy to prove that: x2=3=2(2)−1, so P(2) is true. Hence, by the strong form of induction, P(n) is true for every n∈ℕ.

◻


Clipboard

Exercise. A sequence x1,x2,… of numbers is defined by x1=1, x2=4 and xn=2xn−1−xn−2+2 for every integer n≥3. Guess a formula for xn for every n∈ℕ, and prove it.

Solution

When compute xn for n=3,4 according to the recurrence relation, we get x3=9 and x4=16. This pattern suggests us to guess that xn=n2 for every n∈ℕ.

Proof. Let P(n) be the open statement "xn=n2". Now, we will use the strong form of induction to prove that P(n) is true for every n∈ℕ.

Basis Step: Since x1=1=12.

Inductive Hypothesis: Let k be an arbitrary positive integer. Assume that P(1),…,P(k) are true.

Inductive Step: We divide our proof into two cases:

Case 1: k=1. Then, xk+1=x2=4=22=(k+1)2. So, P(k+1) is true.

Case 2: k≥2. Using recurrence relation, we have xk+1=2xk−xk−1+2=2k2−(k−1)2+2(inductive hypothesis)=k2+2k+1=(k+1)2. Thus, P(k+1) is true.

Hence, P(n) is true for every n∈ℕ by the strong form of induction.

◻


Example. A sequence x1,x2,… of numbers is defined by x1=1,x2=2,x3=3 and xn=xn−1+xn−2+xn−3 for every integer n≥4, then xn<2n for every n∈ℕ.

Proof. Let P(n) be the open statement xn<2n.

Basis Step: Since x1=1<21=2, P(1) is true.

Inductive Hypothesis: Let k be an arbitrary integer. Assume P(1),…,P(k) are true.

Inductive Step:

Case 1: k=1. Then, xk+1=x2=2<2k+1=22=4.

Case 2: k=2. Then, xk+1=x3=3<2k+1=23=8.

Case 3: k≥3. Then, xk+1=2xk−xk−1+2<2⋅2k−2k−1+2(inductive hypothesis)=2k+1+(2−2k−1)<2k+1.(2k−1>2 since k≥3) Hence, P(k+1) is true.

By the strong form of induction, P(n) is true for every n∈ℕ.

◻


Remark.

  • It may appear that we consider 2−2k−1 quite "suddenly" in the proof above. Indeed, if we "think from the bottom" for case 3, then it is natural to consider it: we want 2k+1−2k−1+2, which is in the form of 2k+1+something, to be less than 2k+1. So, it is natural consider the "something".
Clipboard

Exercise. Consider the sequence F1,F2,… of Fibonacci numbers, defined by F1=1,F2=1 and Fn=Fn−1+Fn−2 for every integer n≥3. (a) Construct a table for comparing the value of Fn against the value of n2 for n=1,2,…,15.

(b) Hence, make a guess in the form of "Fn>n2 for every integer n≥?.", and prove the statement.

(c) By considering the even Fibonacci numbers in the table in (a), make a guess in the form of "Fn is even if and only if n≡?(mod?), for every n∈ℕ.", and prove the statement. (Hint: since there is "if and only if" in the statement, in the inductive step, we need to prove both "⇒" direction and "⇐" direction. But, we can prove both directions at once in this case.

(d) Prove that Fn=φn−ψn5 for every n∈ℕ, where φ=1+52 (golden ratio) and ψ=1−52 (conjugate of golden ratio). This gives a direct formula to compute nth Fibonacci number, which is more efficient than using the recurrence relation in the definition for the computation. (Hint: The roots of the quadratic equation x2=x+1 are φ and ψ.)

Solution

(a) n123456789101112131415Fn1123581321345589144233377610n2149162536496481100121144169196225 (b) From (a), it appears that when n≥13, Fn increases faster than n2. So, it is natural to guess that Fn>n2 for every integer n≥13.

Proof. Let P(n) be the open statement Fn>n2.

Basis Step: Since F13=233>132=169, P(13) is true.

Inductive Hypothesis: Let k be an arbitrary integer with k≥13. Assume that P(13),P(14),…,P(k) are true.

Inductive Step: Using recurrence relation, we have Fk+1=Fk+Fk−1>k2+(k−1)2=2k2−2k+1=(k2+2k+1)+(k2−4k)>k2+2k+1(k2>4k since k≥13)=(k+1)2. Hence, P(k+1) is true, and by the strong form of induction, P(n) is true for every integer n≥13.

◻

(c) From the table in (a), when n=3,6,9,12,15 (which are all multiples of 3), Fn is even. This suggests us to guess that Fn is even if and only if n≡0(mod3) for every n∈ℕ.

Proof. Let P(n) be the open statement Fn is even if and only if n≡0(mod3).

Basis Step: Since F1 is odd and 1≢0(mod3), P(1) is true (𝐅⟺𝐅).

Inductive Hypothesis: Let k be a positive arbitrary integer. Assume that P(1),…,P(k) are true.

Inductive Step: By recurrence relation, Fk+1=Fk+Fk−1. So, Fk+1 is even⟺(Fk is even and Fk−1 is even) or (Fk is odd and Fk−1 is odd)⟺(k≡0(mod3) and k−1≡0(mod3)) or (k≢0(mod3) and k−1≢0(mod3))(inductive hypothesis)⟺(k≡0(mod3) and k≡1(mod3)⏟𝐅) or (k≢0(mod3) and k≢1(mod3))⟺k≡2(mod3)(Euclid's division lemma)⟺k+1≡3(mod3)⟺k+1≡0(mod3) (We have k−1≢0(mod3)⟺k≢1(mod3), since by the compatibility with translation, it can be shown directly that k−1≡0(mod3)⟺k≡1(mod3), and after showing this, we have the desired logical equivalence.)

Thus, P(k+1) is true. Hence, by the strong form of induction, P(n) is true for every n∈ℕ.

◻

(d)

Proof. Let P(n) be the statement Fn=φn−ψn5.

Basis Step: Since φ−ψ5=25/25=1=F1, P(1) is true.

Inductive Hypothesis: Let k be a positive arbitrary integer. Assume P(1),…,P(k) are true.

Inductive Step:

Case 1: k=1. Then, φk+1−ψk+15=φ2−ψ25=(φ−ψ)(φ+ψ)5=(25/2)(2/2)5=1=Fk+1=F2. Hence, P(k+1) is true.

Case 2: k≥2. Then, apply the recurrence relation: Fk+1=Fk+Fk−1=φk−ψk5+φk−1−ψk−15(inductive hypothesis)=φk+φk−1−ψk−ψk−15=φk−1(φ+1)−ψk−1(ψ+1)5=φk−1φ2−ψk−1ψ25(hint)=φk+1−ψk+15. Hence, P(k+1) is true.

Thus, by the strong form of induction, P(n) is true for every n∈ℕ.

◻



Relations

Introduction

[edit | edit source]

Intuitively, relation associates pairs of objects based on some rules and properties. That is, relation suggests some kinds of relationship or connection between two objects. Take marriage as an example. In the marriage registry, there is a record in which the names of husbands are associated with the names of their corresponding wives, to keep track of the marriages. The entries in the record can be interpreted as ordered pairs (a,b), where a is the husband, while b is the wife.

Expressing it mathematically, let M and W be the set of all men and women respectively. Then, the Cartesian product M×W={(a,b):a∈M and b∈W} consists of all pairs of people (first and second coordinate is a man and woman respectively). After that, we know that the record in the marriage registry, R, is a subset of M×W. If a man and a woman form an ordered pair in R, say (m,w), then it means they are married. Then, it is natural to say that m is related to w. In other words, if we find that (m,w)∈R, then it means that they are related by this relation R. Also, knowing what R exactly is (we have the record from the marriage registry) is the same as knowing all the husband and wife relationship.

Thus, it is natural to define the set R as a relation. Let us formally define relation below.

Terminologies

[edit | edit source]

Definition. (Relation) A relation R from a set A to a set B is a subset of A×B, i.e., R⊆A×B. In particular, when A=B, we say that R is a relation on A, and we have R⊆A×A. If (a,b)∈R, then we say that a is related to b by R, and write aRb. On the other hand, if (a,b)∉R, then we say that a is not related to b by R, and write aRb.

Example. Let A={a,b,c}, B={1,2,3,4}, and R={(a,1),(b,1),(b,2),(c,3)}. Since the set R is a subset of A×B, R defines a relation from set A to set B. Also, in this relation, a is related to 1, b is related to 1 and 2, c is related to 3. Thus, we have aR1,bR1,bR2 and cR3. But, we have, say aR2 or dR4, since (a,2),(d,4)∉R.

Clipboard

Exercise.

(a) Suggest a set S that is not a relation from set A to set B.

(b) Suggest a set T that is a relation from set A to set R.


Solution

(a) S={(a,5)} ((a,5)∉A×B, so S is not a subset of A×B).

(b) T={(a,(a,1))}.


Clipboard

Exercise. Let A and B be two nonempty sets. Are ∅ and A×B relations from A to B? Describe the relationships meant by these two sets.

Solution

Both ∅ and A×B are relations from A to B since both are subsets of A×B.

For ∅, it means nothing is related, i.e., there is no relationship between elements in A and elements in B.

For A×B, it means everything is related, i.e., every element in A is related to every element in B.

Example. Let H be a set of all human beings. Then, R={(a,b):a is the son of b}. Then, R is a subset of H×H, and defines the relation for son and (father or mother).

Example. The concept of "less than" defines a relation on ℝ. To be more precise, the relation corresponding to this concept is R={(a,b):a<b}⊆ℝ×ℝ=ℝ2. For instance, 1R2 but 2R1.

Example. The congruence of integers defines a relation on ℤ. To be more precise, the corresponding relation is R={(a,b):a≡b(modn)}⊆ℤ×ℤ (n∈ℕ with n≥2). For example, when n=3, then 2R5 but 1R3.

Clipboard

Exercise. Consider the relation on ℝ, corresponding the concept of "equal to": R={(x,y):x=y}⊆ℝ2.

(a) Sketch R in the Cartesian coordinate system.

(b) Consider also the relations S,T on ℝ corresponding the concept of "less than" and "greater than" respectively. Sketch also S and T in the graph in (a).

Solution

(a) and (b):

        y
        |    y=x     
########|#####/%%%
########|####/%%%% 
########|###/%%%%%
########|##/%%%%%%
########|#/%%%%%%%
########|/%%%%%%%%
--------*--------- x
#######/|%%%%%%%%% 
######/%|%%%%%%%%%
#####/%%|%%%%%%%%%
####/%%%|%%%%%%%%%
###/%%%%|%%%%%%%%%

*----*
|####|
|####| : y>x (relation T)
*----*

*----*
|%%%%|
|%%%%| : y<x (relation S)
*----*

Remark.

  • The sets R,S,T give a partition of ℝ. As we will see, there is a close relationship between the concept of relation and the concept of partition.


Example. Let A={1,2}. Define a relation on 𝒫(A), R={(S,T)∈𝒫(A)×𝒫(A):S⊆T}. Express R by listing method.

Solution. First, we have 𝒫(A)={∅,{1},{2},{1,2}}. So, R={(∅,∅),(∅,{1}),(∅,{2}),(∅,{1,2}),({1},{1}),({1},{1,2}),({2},{2}),({2},{1,2}),({1,2},{1,2})}.

Clipboard

Exercise. Let A={1,2} and B={3,4}. Consider a relation R on A×B defined by (a,b)R(c,d) if a+d=b+c. Express R by listing method.

Solution

First, A×B={(1,3),(1,4),(2,3),(2,4)}. So, R={((1,3),(1,3))((1,3),(2,4)),((1,4),(1,4)),((2,3),(2,3)),((2,4),(1,3)),((2,4),(2,4))}.

Definition. (Domain and range) Let R be a relation from a set A to a set B. The domain of R, denoted by dom⁡R is the subset of A defined by dom⁡R={a∈A:(a,b)∈R for some b∈B}. The range of R, denoted by ran⁡R, is the subset of B defined by ran⁡R={b∈B:(a,b)∈R for some a∈A}.

Remark.

  • You may have learnt about the domain and range for functions. Using the same terminologies for both relations and functions is indeed not a coincidence. This is because a function is actually a relation. That is, a function is indeed just a special case of relation.

Example. Let A={a,b,c}, B={1,2,3,4}, and R={(a,1),(b,1),(b,2),(c,3)}. Then, dom⁡R={a,b,c}=A and ran⁡R={1,2,3}.

Example. Consider the relation R on ℤ: R={(a,b):a and b are both even}. Then, dom⁡R is the set of all even numbers, and ran⁡R is the set of all even numbers also.

Clipboard

Exercise. Consider the relation R on ℤ: R={(a,b):a and b are of different parity}. Find dom⁡R and ran⁡R.

Solution

dom⁡R=ℤ and ran⁡R=ℤ.

Definition. (Inverse relation) Let R be a relation from a set A to a set B. The inverse relation R−1 from B to A is R−1={(b,a):(a,b)∈R}⊆B×A.

Remark.

  • Again, you may have learnt a similar concept (and also a similar notation) for functions: inverse functions. Indeed, inverse functions can be defined as the inverse relation of a function, provided that the inverse relation is also a function.
  • We can see that the inverse relation is obtained by "reversing" the order of elements in every ordered pair in the original relation.
  • When R is empty, then the inverse relation R−1 is also empty since there is no ordered pair in the empty set.

Example. Let A={a,b,c}, B={1,2,3,4}, and R={(a,1),(b,1),(b,2),(c,3)}. Then, the inverse relation R−1 is {(1,a),(1,b),(2,b),(3,c)}.

Clipboard

Exercise. Construct an example of sets A,B and a nonempty relation R from set A to set B such that R=R−1.

Solution

Take A=B={1}, and R={(1,1)}. Then, R−1={(1,1)}=R.

Reflexive, symmetric and transitive relations

[edit | edit source]

After introducing the terminologies related to relations, we will study three properties for a relation defined on a set.

Definition. (Reflexive, symmetric and transitive) Let A be a set and R be a relation defined on A. Then,

  • R is reflexive if xRx for every x∈A.
  • R is symmetric if for every x,y∈A, xRy⟹yRx.
  • R is transitive if for every x,y,z∈A, (xRy and yRz)⟹xRz.
Clipboard

Exercise. Let A be a set and R be a relation defined on A. Write down the meaning of (i) R is not reflexive; (ii) R is not symmetric; (iii) R is not transitive.

Solution

(i) There exists x∈A such that xRx.

(ii) There exist x,y∈A such that xRy but yRx.

(iii) There exist x,y,z∈A such that xRy and yRz, but xRz.

Example. Let A={1,2}, and let a relation defined on A be R={(1,1),(2,2),(1,2)}. Then, R is reflexive since (1,1),(2,2)∈R. But R is not symmetric since (1,2)∈R but (2,1)∉R.

Clipboard

Exercise. Is R transitive? Explain why.

Solution

R is transitive since

  • 1R1 and 1R2⟹1R2;
  • 1R1 and 1R2⟹1R2.

(There are no more ordered pairs (x,y) and (y,z) in the relation R, satisfying (x,y)∈R and (y,z)∈R.)


Example. The congruence of integers R={(a,b):a≡b(modn)} defines a relation on ℤ (n∈ℕ with n≥2). Prove that R is a reflexive, symmetric and transitive.

Proof.

Reflexive: For every x∈ℤ, x≡x(modn). So, xRx for every x∈ℤ.

Symmetric: For every x,y∈ℤ, xRy⟹x≡y(modn)⟹x−y=kn⟹y−x=(−k)n⟹y≡x(modn)⟹yRx where k is some integer.

Transitive: For every x,y,z∈ℤ, xRy and yRz⟹x−y=kn and y−z=k′n for some k,k′∈ℤ⟹x−z=(x−y)+(y−z)=(k+k′)n⟹xRz.(k+k′∈ℤ)

◻


Clipboard

Exercise. Which of the properties, reflexive, symmetric and transitive, does each of the following relations possesses? Prove your answer.

(a) R={(x,y)∈ℝ2:x≤y}.

(b) R={(x,y)∈ℝ2:x<y}.

(c) R={(x,y)∈ℤ×ℤ:xy>0}.

Solution

(a) R is reflexive, not symmetric, and transitive.

Proof.

Reflexive: For every x∈ℝ, x≤x. So, xRx.

Not symmetric: Take x=1 and y=2. Then, 1≤2, so xRy. However, 2>1. So, yRx.

Transitive: For every x,y,z∈ℝ, xRy and yRz⟹x≤y and y≤z and x≤z⟹xRz (this actually follows from the property of "≤").

◻

(b) R is not reflexive, not symmetric, and transitive.

Proof.

Reflexive: Take x=1. Then, 1 is not less than 1 itself. Hence, 1R1.

Not symmetric: Take x=1 and y=2. Then, 1<2, so xRy. However, 2>1. So, yRx.

Transitive: For every x,y,z∈ℝ, xRy and yRz⟹x<y and y<z and x<z⟹xRz (this actually follows from the property of "<").

◻

(c) R is reflexive, symmetric and not transitive.

Proof.

Reflexive: For every x∈ℤ,

Case 1: x≥0. Then, x(x)≥0. So, xRx.

Case 2: x<0. Then, x(x)>0. So, xRx.

Symmetric: For every x,y∈ℤ, xRy⟹xy≥0⟹yx=xy≥0⟹yRx.

Not transitive: Take x=1,y=0 and z=−1. Then, xy=0 and yz=0. So, xRy and yRz. However, since xy=−1<0, xRz.

◻


Clipboard

Exercise. Let R be a relation on a set A. Prove or disprove that

(a) if R is reflexive, then R−1 is reflexive;

(b) if R is symmetric, then R−1 is symmetric;

(c) if R is transitive, then R−1 is transitive.

Equivalence relations and equivalence classes

[edit | edit source]

After studying the three properties that a relation on a set can possess, let us focus on those relations that possess all three properties.

Definition. (Equivalence relation) Let A be a set. A relation R defined on A is an equivalence relation if it is reflexive, symmetric and transitive.

Remark.

  • To show that a relation is not an equivalence relation (i.e., to disprove that the relation is an equivalence relation), it suffices to show any one of the following: (i) it is not reflexive; (ii) it is not symmetric; (iii) it is not transitive, by considering the negation of the above definition.

Example. Let A={1,2}. Also let a relation defined on A be R={(1,1),(2,2),(1,2),(2,1)}. Prove or disprove that R is an equivalence relation.

Proof.

Reflexive: Since (1,1),(2,2)∈R, R is reflexive.

Symmetric: Since (1,1)∈R⟹(1,1)∈R, (2,2)∈R⟹(2,2)∈R, (1,2)∈R⟹(2,1)∈R, and (2,1)∈R⟹(1,2)∈R, R is symmetric.

Transitive: Since for every x,y,z∈A, xRy and yRz⟹xRz, R is transitive.

◻

Clipboard

Exercise. Give another equivalence relation that is defined on A.

Solution

R={(1,1),(2,2)}. It can be shown to be reflexive, symmetric and transitive.


Example. Since the congruence of integers defines a reflexive, symmetric and transitive relation, it defines an equivalence relation on ℤ.

Suppose R is an equivalence relation on a set A. Intuitively, for elements that are related by R, they are quite "closely related". Thus, when we consider the set consisting elements that are related to a given element of set A, the elements inside the set are "closely related", so the set, in some sense, forms a "group" of elements that are "relatives". It then appears that we can classify the elements of set A into different such "groups", according to an equivalence relation. As we will see, this is roughly the case. Hence, such "group" is quite important. Now, let us formally define what the "group" is:

Definition. (Equivalence class)

A graph that illustrates equivalence classes. The whole circle in the set on which the relation is defined, and when there is a line connecting two dots, it means the two dots (representing elements in the set) are related by the equivalence relation.

Let R be an equivalence relation defined on a set A. For every a∈A, the set [a]={x∈A:xRa} consisting of all elements in A that are related to a, is called an (equivalence) class of a by R.

Example. Let A={1,2,3,4}, and let a relation defined on A be R={(1,1),(2,2),(3,3),(4,4),(1,2),(1,3),(2,1),(3,1),(2,3),(3,2)}. This relation R can be shown to be an equivalence relation. The equivalence classes are given by [1]={1,2,3},[2]={1,2,3},[3]={1,2,3},[4]={4}. Since [1]=[2]=[3], there are only two distinct equivalence classes. Graphically, the situation looks like:

*----------**
|  .  .   / |
| 2   3  /  |
|  .    /.  |
| 1    /  4 |
*-----*-----*
  ^        ^
  |        |
[1]=[2]    [4]
=[3]
Clipboard

Exercise. Construct an equivalence relation R on A such that the equivalence classes are given by [1]={1,2},[2]={1,2},[3]={3,4},[4]={3,4}.

Solution

R={(1,1),(2,2),(3,3),(4,4),(1,2),(2,1),(3,4),(4,3). Graphically, the situation looks like:

*---*-------*
|  .| .     |
| 2 | 3     |
|  .\    .  |
| 1  \    4 |
*-----*-----*
  ^        ^
  |        |
[1]=[2]  [3]=[4]


Example. (Integers modulo n) Recall that the congruence of integers defines an equivalence relation R on ℤ. Using this equivalence relation, we can define the equivalence class [a] for every a∈ℤ, as follows:

  • [0]={x∈ℤ:xR0}={x∈ℤ:x≡0(modn)}={…,−2n,−n,0,n,2n,…}
  • [1]={x∈ℤ:xR1}={x∈ℤ:x≡1(modn)}={…,−2n+1,−n+1,1,n+1,2n+1,…}
  • ...
  • [n−1]={x∈ℤ:xR(n−1)}={x∈ℤ:x≡n−1(modn)}={…,−2n+(n−1),−n+(n−1),n−1,n+(n−1),2n+(n−1),…}={…,−2n−1,−n−1,−1,2n−1,…}
  • [n]={x∈ℤ:xRn}={x∈ℤ:x≡n(modn)}={x∈ℤ:x≡0(modn)}=[0]
  • [n+1]={x∈ℤ:xR(n+1)}={x∈ℤ:x≡n+1(modn)}={x∈ℤ:x≡1(modn)}=[1]

We can observe that starting from [n], the classes are not distinct from the previous classes. Indeed, if we consider the classes "backward":

  • [−1]={x∈ℤ:xR(−1)}={x∈ℤ:x≡−1(modn)}={x∈ℤ:x≡n−1(modn)}=[n−1]
  • [−2]={x∈ℤ:xR(−2)}={x∈ℤ:x≡−2(modn)}={x∈ℤ:x≡n−2(modn)}=[n−2]
  • ...

They also do not give new classes.

Hence, we conclude that there are only n distinct equivalence classes, namely [0],[1],…,[n−1]. Usually, the set of these equivalence classes, {[0],[1],…,[n−1]}, is denoted by ℤn, and is called integers modulo n. Notice that ℤn is a finite set itself, but each of its elements is an infinite set.

Remark.

  • We can illustrate the equivalence classes as follows (each column is an equivalence class, and the whole table is ℤ):
*----*----*---...---*-----*
| .  |    |         |  .  |
| .  |    |         |  .  |
| .  |    |         |  .  |
|-n  |-n+1|         |-2n-1|
| 0  | 1  |  ....   | n-1 |
| n  |n+1 |         |2n-1 |
| .  |    |         |  .  |
| .  |    |         |  .  |
| .  |    |         |  .  |
*----*----*---...---*-----*
  • When we consider integers modulo m and integers modulo n (m≠n) together, there may be some ambiguities for the elements. For example, ℤ2={[0],[1]} and ℤ3={[0],[1],[2]}. However, for instance, the "[0]" in ℤ2 and the "[0]" in ℤ3 are different. One of them contains all even numbers, another contains all multiples of 3.
  • To avoid such ambiguities, we may add a subscript to the classes. For instance, we may write ℤ2={[0]2,[1]2} and ℤ3={[0]3,[1]3,[2]3}.
Clipboard

Exercise. A relation R on ℤ is defined by aRb if 3a+b≡0(mod4). (a) Prove that R is an equivalence relation.

(b) Express each of the equivalence classes by R [0]R,[1]R,[2]R,[3]R in terms of [0]4,[1]4,[2]4,[3]4 (Hint: use the symmetric property of R).

Solution
(a)

Proof.

Reflexive: For every x∈ℤ, since 3x+x=4x≡0(mod4), xRx.

Symmetric: For every x,y∈ℤ, since xRy⟹3x+y≡0(mod4)⟹9x+3y≡0(mod4)⟹9x−8x+3y≡−8x⏟multiple of 4≡0(mod4)⟹yRx.

Transitive: For every x,y,z∈ℤ, xRy and yRz⟹3x+y≡0(mod4) and 3y+z≡0(mod4)⟹(3x+y)+(3y+z)≡0(mod4)⟹3x+z+4y≡0(mod4)⟹3x+z≡−4y≡0(mod4)⟹xRz.

◻

(b) [0]R={x∈ℤ:xR0}={x∈ℤ:0Rx}={x∈ℤ:x≡0(mod4)}=[0]4. (By the symmetric property of R, xR0⟹0Rx. Also, 0Rx⟹xR0. So, xR0⟺0Rx.) [1]R={x∈ℤ:xR1}={x∈ℤ:1Rx}={x∈ℤ:3+x≡0(mod4)}={x∈ℤ:4+x≡1(mod4)}={x∈ℤ:x≡1(mod4)}=[1]4. [2]R={x∈ℤ:xR2}={x∈ℤ:2Rx}={x∈ℤ:6+x≡0(mod4)}={x∈ℤ:8+x≡2(mod4)}={x∈ℤ:x≡2(mod4)}=[2]4. [3]R={x∈ℤ:xR3}={x∈ℤ:3Rx}={x∈ℤ:9+x≡0(mod4)}={x∈ℤ:12+x≡3(mod4)}={x∈ℤ:x≡3(mod4)}=[3]4.

Properties of equivalence classes

[edit | edit source]

In this section, we will discuss some properties of equivalence classes. In particular, we will address these two questions:

  1. When are two equivalence classes equal?
  2. Can two different equivalence classes contain a common element?

The answer to question 1 is given by the following theorem.

Theorem. Let R be an equivalence relation defined on a set A. For every a,b∈A, [a]=[b] if and only if aRb.

Proof. "⇒" direction: Assume [a]=[b]. Since R is an equivalence relation, and in particular, is reflexive, we have aRa. Thus, we have by definition a∈[a]. Then, since [a]=[b] by assumption, we have a∈[b].

"⇐" direction: Assume aRb. First, for every x∈A, x∈[a]⟹xRa(definition)⟹xRb(aRb and transitivity of R)⟹x∈[b].(definition) So, [a]⊆[b].

On the other hand, first, since aRb by assumption, we have bRa by the symmetry of R. Now, For every y∈A, y∈[b]⟹yRb(definition)⟹yRa(bRa and transitivity of R)⟹y∈[a].(definition) So, [b]⊆[a].

Hence, [a]=[b].

◻

Remark.

  • From this theorem, we know that "aRb" is the necessary and sufficient condition for "[a]=[b]". Also, we have [a]≠[b] if and only if aRb.

Now, let us consider the question 2. The answer to question 2 is, indeed, "No". The following corollary justifies this answer:

Corollary. Let R be an equivalence relation defined on a nonempty set A. For every a,b∈A, [a]≠[b] if and only if [a]∩[b]=∅.

Proof. "⇐" direction: [a]∩[b]=∅⟹[a] and [b] have distinct elements([a] and [b] are nonempty)⟹[a]≠[b]. ([a] and [b] are nonempty since R is reflexive. So they must contain, at least, a and b respectively.)

"⇒" direction: We use proof by contrapositive. [a]∩[b]≠∅⟹∃x∈[a]∩[b]⟹xRa and xRb⟹aRx and xRb(R is symmetric)⟹aRb(R is transitive)⟹[a]=[b].(above theorem)

◻

Remark.

  • From this result, we know that two equivalence classes are either equal or disjoint (since they are either equal or not equal). Hence, it is impossible for two different equivalence classes to contain a common element.

Now we have reached a key point in studying equivalence relations (and it is probably the major reason for studying equivalence relations at all): using equivalence relation on a set to construct a partition of that set, and vice versa. Before discussing it, let us define partition of a set:

Definition. (Partition) A partition of a nonempty set A is a set of nonempty subset(s) of A with the property that every element of A belongs to exactly one of the subset(s). In other words, P is a collection of pairwise disjoint and nonempty subset(s) of A whose union is A.

Example. Let A={1,2,3}. Then, a partition of A is {{1},{2},{3}}. Another one is {{1,2},{3}}. However, {{1,2},{2,3}} is not a partition of A since {1,2} and {2,3} are not disjoint (or the element "2" belongs to two sets). Also, {{1},{3}} is not a partition of A since the union of {1} and {3} is not the entire set A (or the element "2" does not belong to any of the sets inside the partition).

Clipboard

Exercise. Is {{1,2,3}} a partition of A?

Solution

Yes, since every element of A belongs to exactly one of the set inside the partition, namely the set {1,2,3}.


Example. Let A={1,2,3,4}, and let a relation defined on A be R={(1,1),(2,2),(3,3),(4,4),(1,2),(1,3),(2,1),(3,1),(2,3),(3,2)}. Recall that the two distinct equivalence classes are given by [1]={1,2,3},[4]={4}. We can see that every element of A belongs to exactly one of these equivalence classes. Hence, the set {[1],[4]}={{1,2,3},{4}} gives a partition of A.

Also, we can define another equivalence relation R on A such that the two distinct equivalence classes are given by [1]={1,2},[3]={3,4}. We can also see that every element of A belongs to exactly one of these equivalence classes. hence, the set {[1],[3]}={{1,2},{3,4}}.

Example. Recall that the congruence of integers defines an equivalence relation R on ℤ. Also, there are n distinct equivalence classes: [0],[1],…,[n−1]. By Euclid's division lemma, every integer belongs to exactly one of these n equivalence classes. Thus, the integers modulo n ℤn={[0],[1],…,[n−1]} gives a partition on ℤ.

We can observe from the previous examples that equivalence relation of a set can be used to give a partition of that set. The following theorem suggests that, in general, an equivalence relation on a set A can be used to give a partition of that set.

Theorem. Let R be an equivalence relation defined on a nonempty set A. Then the set of all distinct equivalence classes by R is a partition of A.

Proof. It suffices to show that every element of A belongs to exactly one of the distinct equivalence classes.

For every x∈A, since R is reflexive, we have x∈[x]. From this, we can ensure that every element of A belongs to at least one of the distinct classes. It now remains to show that every element of A also belongs to at most one of the distinct classes.

Assume that x also belongs to the class [y]. Then, we have xRy. Since R is an equivalence relation, it means [x]=[y] by a previous theorem. Thus, any two equivalence classes to which x belongs are equal. This means every element of A cannot belong to more than one of the distinct classes.

Hence, every x in A belongs to exactly one of the distinct classes, and thus the set of all distinct equivalence classes by R gives a partition of A.

◻

The following theorem suggests the converse of the above theorem is also true. To be more precise, we can use a partition of a set to construct an equivalence relation on that set. Before introducing the theorem, let us make some intuitive guesses on how to construct the equivalence relation in this way. First, from the previous theorem, roughly speaking, using an equivalence relation on a set, we can create several "groups" of elements in different classes, in which the elements are "relatives".

Now, given a partition of a set, it means we have several "groups" of elements. Such "grouping" intuitively indicates the elements inside the group are "relatives" in some sense. So, intuitively, a relation that relates the "relatives" seems to make the relation quite "close", and hence an equivalence relation.

The following theorem formalizes this intuition:

Theorem. Let P be a partition of a nonempty set A. Define a relation R on A by xRy if there exists S∈P such that x,y∈S. Then, the relation R is an equivalence relation on the set A.

Proof. It suffices to prove that R defined in this way is reflexive, symmetric, and transitive.

Reflexive: By the definition of partition, for every x∈A, x belongs to exactly one of S∈P, so there exists S∈P such that x∈S. Hence, xRx.

Symmetric: For every x,y∈A, xRy⟹∃S∈P,x,y∈S⟹∃S∈P,y,x∈S⟹yRx. Transitive: For every x,y,z∈A, assume xRy and yRz. Then, there exist S,T∈P such that x,y∈S and y,z∈T. But by the definition of partition, y belongs to exactly one of the set in the partition P. So, we have S=T. Hence, there exists a set S (=T) such that x,z∈S, and thus xRz.

◻

Example. Let R be a relation defined on ℤ by aRb if |a|=|b|.

(a) Prove that R is an equivalence relation.

(b) Determine all distinct equivalence classes by R and hence give a partition on ℤ.

Solution.

(a)

Proof. Reflexive: For every x∈ℤ, |x|=|x|. So, xRx.

Symmetric: For every x,y∈ℤ, xRy⟹|x|=|y|⟹|y|=|x|⟹yRx.

Transitive: For every x,y,z∈ℤ, xRy and yRz⟹|x|=|y| and |y|=|z|⟹|x|=|z|⟹xRz.

◻

(b) First, some equivalence classes are [0]={x∈ℤ:xR0}={x∈ℤ:|x|=0}={0},[1]={x∈ℤ:xR1}={x∈ℤ:|x|=1}={−1,1},[2]={x∈ℤ:xR2}={x∈ℤ:|x|=2}={−2,2},… So, all distinct equivalence classes are [0],[1],[2],… (−1∈[1], so [−1] is not distinct from them, etc.). Hence, a partition on A is {[0],[1],[2],…}={[n]:n is a nonnegative integer} (that is, every integer belongs to exactly one of [0],[1],[2],….)

Clipboard

Exercise. Let R be a relation defined on ℤ by aRb if a+b is even.

(a) Prove that R is an equivalence relation.

(b) Determine all distinct equivalence classes by R, and hence give a partition on ℤ.

Solution
(a)

Proof. Reflexive: For every x∈ℤ, since x+x=2x is even, xRx.

Symmetric: For every x,y∈ℤ, xRy⟹x+y is even⟹y+x=x+y is even⟹yRx.

Transitive: For every x,y,z∈ℤ, xRy and yRz⟹x+y is even and y+z is even⟹(x+y)+(y+z)=x+2y+z is even⟹x+2y+z−2y is even(−2y is even)⟹x+z is even⟹xRz.

◻

(b) First, some equivalence classes are [0]R={x∈ℤ:xR0}={x∈ℤ:x is even}=[0]2,[1]R={x∈ℤ:xR1}={x∈ℤ:x+1 is even}={x∈ℤ:x is odd}=[1]2. Since every integer belongs to exactly one of [0]2 and [1]2 (i.e., all other equivalence classes are not distinct from them), it follows that [0]R and [1]R are all distinct equivalence classes.

Remark.

  • Recall that the sum of two integers is even if and only if they have the same parity. So, this relation relates every pair of integers that have the same parity. So, intuitively, the relation R can partition the integers into two "pieces": set of all odd integers and set of all even integers.



Functions

Introduction

[edit | edit source]

In the previous chapter, we have discussed the concept of relations. There are not much restrictions on the relations. For instance, for a relation from set A to set B, every element of A can be related to no elements of B, exactly one element of B, or multiple elements of B. In this chapter, we will focus on a particular type of relations from set A to set B where every element in A is related to exactly one (or a unique) element of B.

You should have encountered the concept of functions before, e.g. a function defined by f(x)=x2 gives you a value of f(x) for every given value of x. The functions you have encountered are likely to be in the above form, i.e. in the form of an equation. Also, the value of x and f(x) are likely to be real numbers.

But we can generalize such ideas to more general situations where x and f(x) are not necessarily real numbers (e.g., they can be elements of certain sets), and the functions need not be expressed by a formula like above. As a result, the concept and definition of functions discussed here may seem foreign to you, and look quite different from what you have previously learnt about functions.

Definitions

[edit | edit source]

Definition. (Functions) Let A and B be sets. A function or mapping from set A to set B, written f:A→B, is a relation from set A to set B such that for every element a∈A, there exists a unique b∈B such that (a,b)∈f.

Remark.

  • The notation "(a,b)∈f" may seem weird at the first place. However, when we think about what f represents here, it becomes more natural: since f is a relation from set A to set B, it is indeed a subset of A×B. So, it makes sense to say (a,b) is an element of f.
  • However, it is much more common to write f(a)=b instead (and you should have seen this notation before).
  • Since f is a relation, we can apply the terminologies to functions: the set A is the domain of function f, denoted by dom⁡f.
  • We also have some more terminologies for functions: The set B is called the codomain of f, b=f(a) is the image of a under f. Also, a is referred to as the pre-image of b under f. Furthermore, we say that f maps a into b.
  • From the definition, every element a∈A has a unique (or exactly one) image.
  • When the set A is empty, then the only function (and also the only relation) from set A to B is the empty set. When set A is nonempty while the set B is empty, since the only relation from set A to B is also the empty set, but such relation does not satisfy the requirements to be a function (there does not exist b∈B such that (a,b)∈f for every a∈A).
Clipboard

Exercise. Write down the meaning of "f is not a function from A to B", i.e., the negation of the definition above. (Hint: first split the unique existential quantifier into two the existence part and uniqueness part.)

Solution

First, we express the meaning of "f is a function from A to B" using logical notations: (∀a∈A,∃b∈B,f(a)=b) and (∀a∈A,∀b,c∈B,if f(a)=b and f(a)=c, then b=c). Then, the meaning of "f is not a function from A to B" is: (∃a∈A,∀b∈B,f(a)≠b) or (∃a∈A,∃b,c∈B,f(a)=b and f(a)=c and b≠c). (LHS means the existential requirement is violated, and RHS means the uniqueness requirement is violated.) In other words, the meaning is "there exists some a∈A with no image, OR there exists some a∈A with more than one image".

Example. Let A={1,2,3} and B={a,b}. Then, f={(1,a),(2,a),(3,b)} defines a function. Graphically, it looks like

  A               B
*----*          *----*
|1*  #
|    |  #       |    |
|    |       #  |    |
|    |          |#   |
|2* # # # # # #  # *a|
|    |          |    |
|3* # # # # # #  # *b|
|    |          |    |
*----*          *----*

Here, a is the image of 1 and 2 under f. In other words, 1 and 2 are the pre-images of a. Similarly, b is the image of 3 under f and 3 is the pre-image of b under f.

Example. Let A={a,b,c,d} and B={1,2,3,4,5,6}. Then, f={(a,1),(a,2),(b,3),(c,4),(d,5)} is not a function from A to B since a has two images: 1 and 2. Also, f={(a,1),(b,3)} is not a function from A to B since c and d have no image.

Example. It is quite common to refer, say, "f(x)=x2" to as a "function". But, when we look at the definition of function, such saying actually has some issues, strictly speaking:

  1. What are the domain and codomain?
  2. f(x) is just an image of a real number x under f. The function f itself should be a set.

For the first question, usually the domain and codomain are taken to be ℝ. But for some functions, f(x) becomes undefined for some values of real number x. In this case, it is common to set the domain as {x:f(x) is a real number}, which is referred to as the natural domain.

For the second question, the actual function f is indeed the set f={(x,x2):x∈ℝ}. This set of point in the plane is the graph of f (a parabola). However, it is acceptable to have such saying for convenience.

Clipboard

Exercise. A commonly encountered function is the exponential function, which is defined by g(x)=ex. Another one is the natural logarithm function defined by h(x)=ln⁡x.

(a) Find the domain and codomain of the functions g and h.

(b) Express the functions g and h using sets.

Solution

(a) The domain and codomain of g are both ℝ. The domain of h is (0,∞) (when x is less than or equal to zero, ln⁡x is undefined), and the codomain of h is ℝ.

(b) g={(x,ex):x∈ℝ} and h={(x,ln⁡x):x∈(0,∞)}.

We should be aware that the codomain of a function is not necessarily the same as the range of a function. The following is the definition of the range of a function (same as the definition for a relation).

Definition. (Range of function) The range of a function f, denoted by ran⁡f, is ran⁡f={b∈B:b=f(x) for some x∈A}={f(x):x∈A}⊆B.

Remark.

  • Comparing the definitions of range and codomain, we can notice that for the range, it includes all elements in the codomain that have at least one pre-image. On the other hand, the codomain is the set that contains everything into which every element a∈A can be possibly mapped.
  • When the range and the codomain of a function f turn out to be the same, we call such function f to be surjective. We will discuss more properties for a function later.
  • We can observe that we can actually manually set (or restrict) the codomain of function to be its range. So, even if a given function is not surjective, we can make it surjective by changing its codomain manually.

Example. Let A={1,2} and B={3,4,5}. Define the function f by f={(1,3),(2,4)}. Then, ran⁡f={3,4}.

Clipboard

Exercise. Let A and B be sets, and b be a fixed element of B. Then, the function f:A→B defined by f(a)=b for every a∈A is called the constant function from A to B.

(a) What is the range of constant function?

(b) What is the codomain of constant function?

(c) Can the range of constant function equal its codomain?

(d) What is/are the pre-image(s) of b?

Solution

(a) The range is {b}.

(b) The codomain is the set B.

(c) Yes, if B={b}.

(d) The pre-images of b are all elements of A.

Example. (Identity function) Let A be a set. Then the function idA defined by idA(a)=a for every a∈A is called the identity function of A. Every a∈A is the image of itself. The domain, codomain, and range of idA are all A.

Remark.

  • This function is quite important in the section about inverse functions.

Example. Consider the function f:ℝ→ℝ defined by f(x)=ex. Find the range of the function f, ran⁡f, and prove your answer.

The range of the function f is ran⁡f=(0,∞).

Proof. To prove that ran⁡f=(0,∞), we will prove (i) ran⁡f⊆[0,∞); (ii) [0,∞)⊆ran⁡f.

Firstly, for ran⁡f⊆(0,∞): for every y, y∈ran⁡f⟹y=ex for some x∈ℝ⟹y>0(we do not have the reverse implication for this step)⟹y∈(0,∞). On the other hand, for (0,∞)⊆ran⁡f: for every y∈(0,∞), we choose x=ln⁡y∈ℝ. Then, f(x)=ex=eln⁡y=y. So, by definition, we have y∈ran⁡f.

◻


Clipboard

Exercise. Consider the function f:ℝ→ℝ defined by f(x)=x2. Find ran⁡f, and prove your answer.

Solution

We have ran⁡f=[0,∞).

Proof. First, for every y, y∈ran⁡f⟹y=x2 for some x∈ℝ⟹y≥0⟹y∈[0,∞). This shows that ran⁡f⊆[0,∞).

On the other hand, for every y∈[0,∞), we choose x=y∈ℝ. Then, f(x)=x2=(y)2=y . So, we have y∈ran⁡f. This shows that [0,∞)⊆ran⁡f, and we are done.

◻


Since the domain and codomain, in addition to the "way" of the mapping, all affect the "behaviour" and properties of a function, it is natural to incorporate all these features into the definition of equality of functions:

Definition. (Equality of functions) Let A and B be sets, and let f:A→B and g:A→B be two functions from A to B (notice that their domains and codomains have to be the same). Then, the functions f and g are said to be equal, written f=g, if f(a)=g(a) for every a∈A.

Clipboard

Exercise. Write down the meaning for two functions f and g to be not equal.

Solution

(f and g have different domain) or (f and g have different codomain) or (there exists a∈A such that f(a)≠g(a)).

Example. Consider the functions f:ℝ→ℝ and g:ℝ→(0,∞) defined by f(x)=ex and g(x)=ex. Although their "formulas" are the same, they are not equal since their codomains are different.

Clipboard

Exercise. Consider the functions f and g defined by f(x)=x and g(x)=x2x. Are the functions f and g equal? Why?

Solution

No.

Notice hat g(x) is undefined when x=0 (and defined for every other real number x), while f(x) is defined for every real number x. Thus, the domain of f is ℝ and the domain of g is ℝ∖{0}. So, f and g are not equal.

Injective, surjective and bijective functions

[edit | edit source]

In this section, we will discuss some important properties that a function may possess, namely injectivity, surjectivity, and bijectivity.

Definition. (Injective function) A function f:A→B is injective or one-to-one if for every x,y∈A, f(x)=f(y)⟹x=y, or equivalently (contrapositive), for every x,y∈A, x≠y⟹f(x)≠f(y).

Remark.

  • The definition tells us that an injective function from A to B maps distinct elements of A into distinct elements of B.
  • To prove that a function is injective, it is common to use a direct proof: for every x,y∈A, assume f(x)=f(y), and then proceed to prove that x=y.
Clipboard

Exercise. Write down the meaning of "a function f:A→B is not injective".

Solution

There exist x,y∈A such that f(x)=f(y) and x≠y.

Example. A function f:ℝ→ℝ is defined by f(x)=2x+5. Prove that f is injective.

Proof. For every x,y∈ℝ, f(x)=f(y)⟹2x+5=2y+5⟹2x=2y⟹x=y. Thus, f is injective.

◻


Example. A function f:ℝ→ℝ is defined by f(x)=x2. Prove or disprove that f is injective.

Disproof. Since f(−1)=f(1)=1, f is not injective.

◻

Clipboard

Exercise. A function g:[0,∞)→ℝ is defined by g(x)=x2. Prove that g is injective.

Proof

Proof. For every x,y∈[0,∞), g(x)=g(y)⟹x2=y2⟹x2=y2⟹|x|=|y|⟹x=y.

◻

Remark.

  • It suggests that the domain of a function is important when we determine whether a function is injective. We should not just look at the formula of the function.



Example. A function f:ℝ→ℝ is defined by f(x)=x2−3x+5. Prove or disprove that f is injective.

This time, it is not immediately clear that whether this function is injective or not. So, we may first try to prove that f is injective, and see what we get: for every x,y∈ℝ, f(x)=f(y)⟹x2−3x+5=y2−3y+5⟹x(x−3)=y(y−3). Notice that for the last equation to imply x=y, we need x≠3 and y≠3. However, x and y can take any real values. Hence, this suggests us to consider f(3) and disprove that f is injective. Another observation is that when x=3, then x(x−3)=0. But to make it equal zero, we can also take x=0. Thus, this gives us a counterexample for disproving that f is injective:

Disproof. Since f(0)=f(3)=5, f is not injective.

◻


Clipboard

Exercise. A function f:[−1,1]→[0,1] is defined by f(x)=1−x2. Prove or disprove that f is injective.

Solution

Disproof. Since f(−1)=f(1)=0, f is not injective.

◻

Remark.

  • The graph of this function is a semicircle located above the x-axis.


Definition. (Surjective function) A function f:A→B is surjective or onto if for every y∈B, there exists x∈A such that f(x)=y.

Remark.

  • The definition tells us that f is surjective if every element of the codomain B is the image of some element of A. In other words, ran⁡f=B.
Clipboard

Exercise. Write down the meaning of "f:A→B is not surjective".

Solution

There exists y∈B such that for every x∈A, f(x)≠y.

In other words, some element of the codomain B is not the image of every element of A. In other words, ran⁡f≠B (since ran⁡f⊆B by definition, we may also write this as ran⁡f⊂B).

Example. A function f:ℝ→ℝ is defined by f(x)=2x+5. Prove that f is surjective.

To prove that f is surjective, we need to prove that for every y∈ℝ, there exists x∈ℝ such that f(x)=y, i.e., y=2x+5. To show this, we can see that the choices of x∈ℝ to satisfy the requirement for different values of y are different. Indeed, the choice of x depend on the value of y∈ℝ. But it is not hard to choose such x∈ℝ with a given value of y∈ℝ: we can just rearrange the above equation to make x to be the subject of the equation: x=y−52∈ℝ

Proof. For every y∈ℝ, choose x=y−52∈ℝ. Then, f(x)=f(y−52)=2(y−52)+5=y−5+5=y.

◻


Example. Prove or disprove that the function f:ℝ→ℝ defined by f(x)=x2 is surjective.

Disproof. Take y=−1. Then, there is no x∈ℝ such that x2=f(x)=−1 since x2=−1 has no real solution. Hence, f is not surjective.

◻

Clipboard

Exercise. Prove that the function g:ℝ→[0,∞) defined by g(x)=x2 is surjective.

Proof

Proof. For every y∈[0,∞), choose x=y∈ℝ (it is possible to choose such real number x since y∈[0,∞)). Then, f(x)=f(y)=(y)2=y

◻

Remark.

  • It suggests that the codomain of a function is important when we determine whether a function is surjective. So, again, we should not just look at the formula of the function.



Definition. (Bijective function) A function f:A→B is bijective or one-to-one correspondence if it is both injective and surjective.

Remark.

  • We should be aware that "one-to-one correspondence" (which means bijective) is different from "one-to-one" (which means injective).
  • In other words, f is bijective if for every y∈B, there exists a unique x∈A such that f(x)=y (the existence part corresponds to the surjectivity, and the uniqueness part corresponds to the injectivity).
  • However, we usually still prove the bijectivity by proving the injectivity and surjectivity separately, similar to the case for proving "there exists a unique ..." where we prove the existence part and uniqueness part separately.
Clipboard

Exercise. Write down the meaning of "f:A→B is not bijective".

Solution

f is not injective or f is not surjective.

Example. We have proved the function f:ℝ→ℝ defined by f(x)=2x+5 is both injective and surjective. Hence, it is bijective.

Example. We have proved the function g1:[0,∞)→ℝ defined by g1(x)=x2 is injective and the function g2:ℝ→[0,∞) defined by g2(x)=x2 is surjective. Then, with basically the same proof, we can prove that the function g3:[0,∞→[0,∞) defined by g3(x)=x2 is both injective or surjective, and hence bijective.

Example. Prove that the function f:ℝ∖{1}→ℝ∖{3} defined by f(x)=3x+1x−1 is bijective.

For proving the surjective part, we need to make x as the subject for the equaton y=3x+1x−1: y=3x+1x−1⟺xy−y=3x+1⟺(y−3)x=y+1⟺x=y+1y−3.

Proof.

Injective: For every x,y∈ℝ∖{1}, f(x)=f(y)⟹3x+1x−1=3y+1y−1⟹3x+1=3y+1⟹3x=3y⟹x=y. Surjective: For every y∈ℝ∖{3}, choose x=y+1y−3. We then need to show that x∈ℝ∖{1}. Since x∈ℝ (y≠3, so x is defined), it suffices to show that x≠1. Let us prove it by contradiction:

Assume to the contrary that x=1. Then, y+1y−3=1⟹y+1=y−3⟹1=−3. So we arrive at a contradiction.

Then, we have f(x)=f(y+1y−3)=3(y+1y−3)+1y+1y−3−1=3y+3+y−3y+1−y+3=4y4=y.

◻


Clipboard

Exercise. Let A be a set. Prove that the identity function idA:A→A is bijective.

Proof

Proof.

Injective: For every x,y∈A, idA(x)=idA(y)⟹x=y.

Surjective: For every y∈A, choose x=y∈A. Then, idA(x)=idA(y)=y.

◻


Clipboard

Exercise. A function f:ℤ×ℤ→ℤ×ℤ is defined by f(m,n)=(n,m). Prove or disprove that f is bijective.

Solution

Proof.

Injective: For every (m1,n1),(m2,n2)∈ℤ×ℤ, f(m1,n1)=f(m2,n2)⟹(n1,m1)=(n2,m2)⟹n1=n2 and m1=m2⟹(m1,n1)=(m2,n2).

Surjective: For every (x,y)∈ℤ×ℤ, choose (y,x)∈ℤ×ℤ. Then, f(y,x)=(x,y).

◻


Clipboard

Exercise. Consider a function f:ℕ×ℕ→ℕ defined by f(m,n)=m+n, and another function g:ℕ×ℕ→ℕ defined by g(m,n)=mn.

(a) Prove or disprove that f is (i) injective; (ii) surjective.

(b) Prove or disprove that g is (i) injective; (ii) surjective.

Solution
(a) (i)

Disproof. Since f(1,2)=f(2,1)=3, f is not injective.

◻

(ii)

Disproof. Take y=1. Then, for every (m,n)∈ℕ×ℕ, m+n≠y=1.

◻

(b) (i)

Disproof. Since f(1,2)=f(2,1)=2, f is not injective.

◻

(ii)

Proof. For every y∈ℕ, choose (m,n)=(1,y)∈ℕ×ℕ. Then, f(m,n)=1(y)=y.

◻


Composition of functions

[edit | edit source]

Let A,B and C be nonempty sets, and let f:A→B and g:B→C be two functions. In this section, we are going to discuss a way to create a new function from "combining" the two functions f and g, called their composition:

Definition. (Composition) Let f:A→B and g:B→C be two functions, where A,B and C are nonempty sets. Then, the composition of f and g, denoted by g∘f (read "g-circle-f"), is the function from A to C defined by (g∘f)(a)=g(f(a)) for every a∈A.

Remark.

  • We can see that the composition g∘f is obtained by first applying f and then applying g.

Example. Let A={1,2,3},B={a,b,c,d} and C={4,5}. Consider the functions f:A→B and g:B→C defined by f={(1,a),(2,b),(3,b)} and g={((a,4),(b,5),(c,5),(d,5)}. Then, we have (g∘f)(1)=4,(g∘f)(2)=5 and (g∘f)(3)=5. So, the function g∘f:A→C is given by g∘f={(1,4),(2,5),(3,5)}. However, f∘g is undefined, since the codomain of g (C) is different from the domain of f (A).

Remark.

  • To make both g∘f and f∘g defined, we need to have f:A→B and g:B→A, that is, the domain (codomain) of f must be equal to the codomain (domain) of g.
  • In this case, g∘f is a function from B to B, and f∘g is a function from A to A. So, in order for them to be possibly equal, we need to further have A=B.
  • But, even if A=B, it is still possible that f∘g≠g∘f. Consider the following example.

Example. Let A={1,2}. Consider the functions f:A→A and g:A→A defined by f={(1,2),(2,2)} and g={(1,1),(2,1)}. Then, g∘f={(1,1),(2,1)} and f∘g={(1,2),(2,2)}. Since, for example, (g∘f)(1)=1≠2=(f∘g)(1), it follows that g∘f≠f∘g.

Remark.

  • This example shows that the composition of functions is not commutative. That is, after changing the order of the composition, the result may be different.

Although the composition of functions is not commutative, it is associative.

Theorem. (Associativity of the composition of functions) For every nonempty set A,B,C,D, and for every function f:A→B,g:B→C and h:C→D, we have h∘(g∘f)=(h∘g)∘f.

Proof. First, since g∘f is a function from A to C, it follows that h∘(g∘f) is a function from A to D. Similarly, since h∘g is a function from B→D, it follows that (h∘g)∘f is function from A to D.

It now remains to prove that both functions map every element a∈A into the same image in D. For every a∈A, (h∘(g∘f))(a)=h((g∘f)(a))=h(g(f(a))). (a bracket for g∘f means "grouping" g and f first, that is, we regard g∘f as a function first. To understand this more easily, one may write f1 instead of "g∘f" above.)

Also, ((h∘g)(f(a)))=h(g(f(a))).

◻

Example. Let A={1,2,3},B={a,b,c,d},C={4,5} and D={α,β,γ}. Consider the functions f:A→B, g:B→C and h:C→D defined by f={(1,a),(2,b),(3,b)},g={((a,4),(b,5),(c,5),(d,5)} and h={(4,β),(5,γ)}. Recall that we have shown that g∘f={(1,4),(2,5),(3,5)}. We can further show that h∘g={(a,β),(b,γ),(c,γ),(d,γ)}. Thus, h∘(g∘f):A→D and (h∘g)∘f:A→D are given by h∘(g∘f)=(h∘g)∘f={(1,β),(2,γ),(3,γ)}.

Now, let us study some results that are related to the composition, injectivity, surjectivity, and bijectivity.

Proposition. For every nonempty set A,B,C and for every function f:A→B and g:B→C,

(a) if f and g are injective, then g∘f is injective.

(b) if f and g are surjective, then g∘f is surjective.

Proof. For (a), assume that f and g are injective. Then, for every x,y∈A g∘f(x)=g∘f(y)⟹g(f(x))=g(f(y))⟹f(x)=f(y)(g is injective)⟹x=y.(f is injective) For (b), assume that f and g are injective. Then, for every c∈C, since g is surjective, there exists b∈B such that g(b)=c. For this b∈B, there must also exist a∈A such that f(a)=b since f is surjective. It follows that for every c∈C, there exists a∈A such that c=g(b)=g(f(a))=(g∘f)(a).

◻

Corollary. For every nonempty set A,B,C and for every function f:A→B and g:B→C, if f:A→B and g:B→C are bijective, then g∘f is bijective.

Proof. Assume that f and g are bijective, i.e., are injective and surjective. It follows by the above proposition that g∘f is injective and surjective, i.e., is bijective.

◻

After knowing such results, it is natural to question that whether the converse of the above proposition holds. Indeed, the converse does not hold, and we have the following results:

Proposition. For every nonempty set A,B,C and for every function f:A→B and g:B→C,

(a) if g∘f is injective, then f is injective.

(b) if g∘f is surjective, then g is surjective.

Proof. For (a), assume that g∘f is injective. Then, for every x,y∈A, f(x)=f(y)⟹g(f(x))=g(f(y))(definition of function)⟹x=y.(g∘f is injective) For (b), assume that g∘f is surjective. Then, for every c∈C, there exists a∈A such that g(f(a))=c. So, we now can show that g is surjective: for every c∈C, we can choose f(a)∈B, and then we have g(f(a))=c.

◻

Remark.

  • It follows that if g∘f is bijective, then f is injective and g is surjective.
  • For (a), with the assumption, f may or may not be surjective. Also, for (b), g may or may not be injective.

To summarize the results, we have the following table:

Summary
g∘f (given) f g
injective injective injective/not injective
surjective surjective surjective/not surjective
bijective injective surjective
Clipboard

Exercise. Disprove that for every nonempty set A,B,C and for every function f:A→B and g:B→C,

(a) if g∘f is injective, then g is injective.

(b) if g∘f is surjective, then f is surjective.

Solution
(a)

Disproof. Take A={1,2},B={1,2,3},C={1,2}, and take the functions f:A→B and g:B→C defined by f={(1,1),(2,2)},g={(1,1),(2,2),(3,1)}.

Then, the function g∘f:A→C is given by g∘f={(1,1),(2,2)}, which is injective, since for every x,y∈A, (g∘f)(x)=(g∘f)(y)⟹x=y. However, the function g is not injective since g(1)=g(3)=1.

◻

(b)

Disproof. Take A={1,2},B={1,2,3},C={1,2}, and take the functions f:A→B and g:B→C defined by f={(1,1),(2,2)},g={(1,1),(2,2),(3,1)}.

Then, the function g∘f:A→C is given by g∘f={(1,1),(2,2)}, which is surjective, since for every c∈C, there exists a∈A such that (g∘f)(a)=c. However, the function f is not surjective, since, for example, take c=3. Then, for every a∈A, f(a)≠c=3.

◻


Example. Consider two arbitrary functions f:ℝ→ℝ and g:ℝ→ℝ such that the function g∘f:ℝ→ℝ is given by g∘f(x)=x3. What properties do the functions f and g possess?

Solution. First, we claim that g∘f is bijective.

Proof.

Injective: for every x,y∈ℝ, (g∘f)(x)=(g∘f)(y)=x3=y3⟹x=y.

Surjective: for every y∈ℝ, choose x=y1/3∈ℝ. Then, (g∘f)(x)=(y1/3)3=y.

◻

Then, we can conclude that f is injective and g is surjective by the above proposition.

Clipboard

Exercise. Consider the function f:ℝ→ℝ satisfying (f∘f)(x)=x for every x∈ℝ. Prove or disprove that f is (i) injective; (ii) surjective.

Solution

(i) and (ii):

Proof. First, notice that f∘f=idℝ, and we have proved that idℝ is bijective. So, by the above proposition, f is injective and surjective.

◻


Inverse functions

[edit | edit source]

Recall that a function f:A→B is a special relation from set A to set B satisfying some requirements. Also, recall that given a relation from A to B, the inverse relation R−1 is defined to be R−1={(b,a):(a,b)∈R}⊆B×A. We know that the inverse relation is always a relation itself. However, is the inverse relation of a function f:A→B always a function from B to A itself? The answer is, indeed, no. Consider the following example.

Example. Let A={1,2,3} and B={a,b}. Consider the function f:A→B defined by f={(1,a),(2,a),(3,b)}. Then, the inverse relation (we are not calling it inverse function) of f, denoted by f−1, is f−1={(a,1),(a,2),(b,3)}. We can then see that this inverse relation f−1 is not a function from B to A, since the element a∈B has two images: 1 and 2.

Of course, when the inverse relation of a function f:A→B turns out to be also a function from B to A, it is natural to define it as the inverse function of f:

Definition. (Inverse function) Let A and B be sets, and let f:A→B be a function. The inverse function of the function f is the inverse relation of f, denoted by f−1, provided that f−1 is a function from B to A.

Remark.

  • Since given a relation from A to B, it has a unique (or exactly one) inverse relation from B to A (according to the definition), it follows that the inverse function of a function f, if exists, is unique.

We are then interested in knowing under what conditions the inverse relation f−1 is a function from B to A, so that the inverse function exists.

First, in order for f−1 to be a function from B to A, we must have dom⁡f−1=B. So, we need to ensure that every element of B is related to some elements in A, so that when we "reverse" the ordered pairs in f to get f−1, there is at least one image for every b∈B. This means ran⁡f=B, i.e., f needs to be surjective.

Of course, we also need to ensure that there is a unique image for every b∈B. Under the condition that f is surjective, there is at least one image for every b∈B already. So, it remains to ensure that there is at most one image for every b∈B.

To ensure this, we need the function f to be injective, since, if f is injective, then every element of B has at most one pre-image. So, when we "reverse" the ordered pairs in f to get f−1, every element of B has at most one image.

From this discussion, we know that if f−1 is a function from B to A, then f has to be injective and surjective, i.e. bijective. This shows that the bijectivity of f is the necessary condition for the existence of the inverse function. Is it also the sufficient condition? It turns out that the bijectivity of f is actually the necessary and sufficient condition for the existence of the inverse function:

Theorem. Let f:A→B be a function. Then its inverse relation f−1 is a function from B to A (i.e., the inverse function of f exists) if and only if the function f is bijective.

Proof.

"⇒" direction: Assume that f−1 is a function from B to A. Then, we will proceed to prove that f is injective and surjective:

Injective: For every x,y∈A, first assume z=f(x)=f(y)∈B. Then, (x,z),(y,z)∈f. By definition of inverse relation, we have (z,x),(z,y)∈f−1. Since f−1 is a function from B to A, we have by definition x=y.

Surjective: For every b∈B, since f−1 is a function from B to A, there exists a unique a∈A such that (b,a)∈f−1. This means by definition of inverse relation that (a,b)∈f, i.e., f(a)=b .

"⇐" direction: Assume that f is bijective. Then, we will proceed to prove that f−1 is a function from B to A. That is, we need to ensure that for every element b∈B, there exists a unique a∈A such that (b,a)∈f−1.

Existence: For every b∈B, since f is surjective, there exists a∈A such that f(a)=b, i.e. (a,b)∈f. Hence, (b,a)∈f−1. This shows that for every b∈B, there exists a∈A such that (b,a)∈f−1.

Uniqueness: Assume (b,a′)∈f−1, in addition to (b,a)∈f−1. So, we have (a,b),(a′,b)∈f, i.e., f(a)=f(a′)=b. Since f is injective, we have a=a′.

◻

Hence, from this theorem, we know that it is only meaningful to talk about inverse function of f when f is bijective. If f is not bijective, then its inverse function does not exist at all, and it is meaningless to talk about it. The following theorem further suggests that the inverse function must also be bijective.

Theorem. If the function f:A→B is bijective, then its inverse function f−1:B→A is also bijective.

Proof. Assume that f:A→B is bijective. Then, f−1 is a function from B to A. Then, we will show that it is injective and surjective.

Injective: For every b,b′∈B, first assume a=f−1(b)=f−1(b′). Then, (b,a),(b′,a)∈f−1. Thus, (a,b),(a,b′)∈f. It follows that b=b′ since f is a function.

Surjective: For every a∈A, since f is a function, there exists a unique b∈B such that f(a)=b, i.e., (a,b)∈f, and hence (b,a)∈f−1, i.e., f−1(b).

◻

Remark.

  • Notice that in the proof, we do not make use of the bijectivity of f to prove the injectivity and surjectivity of f−1. Indeed, we just use the definition of function to prove them. The bijectivity of f serves only one purpose: ensuring that the inverse function exists.

Another common definition of inverse function is that the inverse function of f, denoted by f−1, is a function satisfying f−1∘f=idA and f∘f−1=idB. It turns out that these two definitions of inverse function are indeed (logically) equivalent. Consider the following theorem.

Theorem. Let f:A→B and g:B→A be two functions such that f∘g=idA and g∘f=idB. Then, f is bijective and g equals the inverse function of f, f−1.

Proof. Let us first prove that f is bijective.

Injective: For every x,y∈A, f(x)=f(y)⟹g(f(x))=g(f(y))(g is a function)⟹(g∘f)(x)=(g∘f)(y)⟹idA(x)=idA(y)(assumption)⟹x=y. Surjective: For every y∈B, choose x=g(y)∈A. Then, f(x)=f(g(y))=idB(y)=y.

Now, let us prove that g=f−1. Since f is bijective, the inverse function f−1 exists. Then, since the domain and codomain of the inverse function f−1 is B and A respectively by definition, g and f−1 have the same domain and codomain. It now remains to show that g(b)=f−1(b) for every b∈B. Since f is surjective, for every b∈B, there exists a∈A such that f(a)=b. This means a=f−1(b). Now, we have for every b∈B, g(b)=g(f(a))=idA(a)=a=f−1(b).

◻

The converse of the above theorem is also true. More precisely, if f is bijective, and thus its inverse function f−1 exists, then we have f∘f−1=idA and f−1∘f=idB. (Details are left to the following exercise.) Hence, the two definitions are actually logically equivalent, in the sense that

  • by the above theorem, the conditions in the alternative definition imply the conditions in our definition.
  • by the above remark, the conditions in our definition imply the conditions in the alternative definition.

It then follows that the function g satisfying f∘g=idA and g∘f=idB is unique, since the inverse function is unique.

Clipboard

Exercise. Let f:A→B be a function. Prove that if f is bijective, and thus its inverse function f−1 exists, then we have f∘f−1=idA and f−1∘f=idB.

Proof. First, since f−1 is a function from B to A, it follows that f∘f−1 is a function from A to A, and f−1∘f is a function from B to B.

Then, for every a∈A, there exists a unique b∈B such that f(a)=b, and hence a=f−1(b). So, (f−1∘f)(a)=f−1(f(a))=f−1(b)=a. Also, for every b∈B, (f∘f−1)(b)=f(f−1(b))=f(a)=b.

◻


Here, we will introduce an approach to find a formula for the inverse function. But this approach does not always work.

Example. Recall that we have proved that the function f:ℝ∖{1}→ℝ∖{3} defined by f(x)=3x+1x−1 is bijective. So, its inverse function f−1 exists. Determine the inverse function f−1.

Solution. We have for every x∈ℝ∖{3}, (f∘f−1)(x)=x. Hence, x=(f∘f−1)(x)=f(f−1(x))=3f−1(x)+1f−1(x)−1⟹xf−1(x)−x=3f−1(x)+1⟹f−1(x)=x+1x−3. Thus, the inverse function f−1:ℝ∖{3}→ℝ∖{1} is given by f−1(x)=x+1x−3.

In this approach, we use some algebraic manipulation to find the inverse function. However, such method is not always possible. For instance, the function f:ℝ→(0,∞) defined by f(x)=ex is bijective, but its inverse function f−1:(0,∞)→ℝ is given by (indeed, defined to be) f−1(x)=ln⁡x. In this case, such inverse function cannot be obtained by such algebraic manipulation.

Clipboard

Exercise. Consider the function f:[0,1]→[0,1] defined by f(x)=1−x2. (a) Prove that f is bijective.

(b) Determine the formula for inverse function, f−1(x).


Solution
(a)

Proof.

Injective: For every x,y∈[0,1], f(x)=f(y)⟹1−x2=1−y2⟹1−x2=1−y2⟹x2=y2⟹x=y.(x,y≥0) Surjective: For every y∈[0,1], choose x=1−y2∈[0,1]. Then, f(x)=f(1−y2)=1−(1−y2)2=1−(1−y2)=y2=|y|=y.

◻

(b) Since f(f−1(x))=x for every x∈[0,1], we have x=1−(f−1(x))2⟹x2=1−(f−1(x))2⟹f−1(x)=±1−x2. But the codomain of the inverse function f−1 is [0,1]. So we should choose the positive square root as the formula, i.e., f−1(x)=1−x2.

Remark.

  • It turns out that, in this case the function f is equal to its inverse function f−1.


Image sets and preimage sets

[edit | edit source]

The concepts discussed in this section are the generalizations of the concepts of image and pre-image.

Definition. (Image (set) and preimage (set)) Let A and B be sets, and let f:A→B be a function.

(a) Suppose X⊆A. The image (set) of X is the set f(X)={y∈B:y=f(x) for some x∈X}⊆B. (b) Suppose Y⊆B. The preimage (set) of Y is the set f−1(Y)={x∈A:f(x)∈Y}⊆A.

Remark.

  • Notice that the "f−1" used in the notation for the preimage set is not referring to the inverse function. The preimage set f−1(Y) of Y still makes sense even if the function f is not bijective. However, the inverse function f−1 does not exist if the function f is not bijective.
  • In other words, the image set contains the image of every element x∈X. So, it is a set of images, and hence the name.
  • On the other hand, the preimage set contains the pre-images of every element y∈Y. That is, the preimage set f−1(Y) is the set of elements in A mapped into Y by f.
  • Special case: suppose a∈A and b∈B. Then, the image set of {a} is the set containing image of a under f: {f(a)}, and the preimage of set {b} is the set containing the preimages (if any) of b under f.

Graphically, the image set looks like:

   A              B
*------*       *------*
|      |       |      |
|  . X |       | f(X) |
|.###. |       |  .   |
|.###.--------->.###. |
|.###. |       |.###. |
|  .   |       |  .   |
*------*       *------*

The preimage set looks like

   A              B
*------*       *------*
|f-1(Y)|       |      |
|  .   |       |  Y   |
|.###. |       |  .   |
|.###.<---------.###. |
|.###. |       |.###. |
|  .   |       |  .   |
*------*       *------*

Example. Let A={1,2,3,4,5,6,7} and B={a,b,c,d,e}. Consider the function f:A→B defined by f={(1,a),(2,a),(3,b),(4,b),(5,d),(6,d),(7,a)}. Then,

  • f({1,3})={a,b}
  • f−1({a,b})={1,2,3,4}
  • f({1,2,3,4})={a,b}
  • f({1,2,3,4,5,6,7})={a,b,d}
  • f−1({c})=∅
  • f−1({a,c,d,e})={1,2,5,6,7}
  • f({1,2,5,6,7})={a,d}

Remark.

  • Notice that f is not bijective, but it is still meaningful to consider the preimage sets of f. For instance, we have f−1({a})={1,2}, but "f−1(a)" has no meaning since f−1 does not exist at all.
  • We can observe that f({1,3})={a,b} but f−1({a,b})={1,2,3,4}. So, f−1(f(X))≠X in general. Also, we can notice that after "applying" the image set and then preimage set on a set X, it seems that we may get some set that is larger than X.
  • On the other hand, we can see that f−1({a,c,d,e})={1,2,5,6,7} but f({1,2,5,6,7})={a,d}. So, f(f−1(Y))≠Y in general. Also, it seems that we get some set that is smaller than X.
  • Such kind of results turns out to be true in general (see the following theorem).
Clipboard

Exercise. Consider a function f:A→B. Find (a) f(A); (b) f−1(B); (c) f(∅); (d) f−1(∅).

Solution

(a) f(A)={y∈B:y=f(x) for some x∈A}=ran⁡f.

(b) f−1(B)={x∈A:f(x)∈B⏟always true}=A.

(c) f(∅)={y∈B:y=f(x) for some x∈∅⏟always false}=∅.

(d) f−1(∅)={x∈A:f(x)∈∅⏟always false}=∅.

Proposition. Let A and B be sets, and let f:A→B be a function. Then,

(a) X⊆f−1(f(X)) for every subset X⊆A.

(b) f(f−1(Y))⊆Y for every subset Y⊆B.

Proof. (a) For every subset X⊆A, we have f−1(f(X))={x∈A:f(x)∈f(X)}. So, for every x, x∈X⟹f(x)∈f(X)⟹x∈f−1(f(X)). (b) For every subset Y⊆B, we have f(f−1(Y))={y∈B:y=f(x) for some x∈f−1(Y)}. So, for every y, assume y∈f(f−1(Y)). Then, y=f(x) for some x∈f−1(Y). But x∈f−1(Y) means f(x)∈Y. So, we have y=f(x)∈Y.

◻

Clipboard

Exercise. Propose an additional assumption on the function f so that (a) X=f−1(f(X)) under this assumption; (b) Y=f(f−1(Y)) under this assumption. Then, prove them. (Hint: the assumption is either "f is injective" or "f is surjective". Construct some simple examples of injective/surjective functions to make your choice.)

Solution

(a) The assumption is "f is injective".

Proof. It suffices to show that f−1(f(X))⊆X, since another subset inclusion is immediate by the proposition above. For every x, x∈f−1(f(X))⟹f(x)∈f(X)⟹f(x)=f(x′) for some x′∈X⟹x=x′(injective).

◻

(b) The assumption is "f is surjective".

Proof. It suffices to show that Y⊆f−1(f(Y)). For every y, assume y∈Y. Then, since f is surjective, y=f(x) for some x∈A. This means x∈f−1(Y) since f(x)∈Y. Combining this with the previous equation, we have y=f(x) for some x∈f−1(Y). Thus, y∈f(f−1(Y)) by the definition of image set.

◻


Clipboard

Exercise. Prove or disprove that (a) if x∈X, then f(x)∈f(X); (b) if f(x)∈f(X), then x∈X.

Solution
(a)

Proof. Assume x∈X. Then by definition of image set, f(x)∈f(X).

◻

(b)

Disproof. Take A={1,2}, B={1}, and the function f:A→B defined by f={(1,1),(2,1)}. Then, take x=2 and X={1}. After that, we have f(x)=1∈{1}=f(X), but x=2∉{1}=X.

◻


Cardinalities of sets

[edit | edit source]

Recall that a set is S finite if it contains a finite number of elements, i.e., S=∅ or |S|=n for some n∈ℕ. On the other hand, a set is infinite if it is not finite. Previously, we have studied cardinalities of finite sets, and we have left cardinalities of infinite sets undefined. But, it turns out that we can define cardinalities of infinite sets in a more complicated way, using bijective functions.

It may now seem that we can write something like |S|=∞ for an infinite set S. But it turns out that this is not quite meaningful, and as we shall see, infinite sets can have different cardinalities, or different "sizes". That is, there are different sizes of infinity! (in some sense).

To motivate the definition for the cardinalities of infinite sets, let us first consider a simple example of finite sets.

Example. Let A={a,b,c} and B={1,2,3}. We can then clearly observe that |A|=|B|=3, just by counting the number of elements contained by each of them. Alternatively, we can pair off the elements of A and B in this way: Aabc↕↕↕B123 More precisely, such pairing defines a bijective function f:A→B given by f={(a,1),(b,2),(c,3)}.

This example suggests that for two finite (nonempty) sets A and B, they have the same cardinality if there exists a bijective function from A to B (or from B to A. One such function is given by the inverse function of the bijective function from A to B.) This leads us to the following definition:

Definition. Two (finite or infinite) sets A and B have the same cardinality (or are numerically equivalent), written |A|=|B|, if A and B are both empty, or there exists a bijective function from A to B.

Remark.

  • If two sets have different cardinalities, then we write |A|≠|B|. Having different cardinalities means (A is nonempty or B is nonempty) and (for every function from A to B, the function is not bijective). (The latter one, in other words, means there does not exist bijective function from A to B.)
  • It does not matter for the bijective function to be from A to B, or from B to A. Since existence of one of them implies the existence of another one, by considering the inverse function.
  • For finite sets (including empty set), this definition is a bit redundant since we can simply count the number of elements in a finite set. But for infinite sets, this definition is the basis for comparing their cardinalities or "sizes".
  • From this definition, we also know that a finite set and an infinite set cannot have the same cardinality, since there must not exist a bijective function from a finite set to an infinite set (one can show this using proof by contradiction).

Example. Let E be the set of all even integers, i.e., E={2x:x∈ℤ}. Prove that ℤ and E are numerically equivalent.

Proof. Define a function f:ℤ→E by f(x)=2x. Now, it remains to prove that it is bijective.

Injective: For every x,y∈ℤ, f(x)=f(y)⟹2x=2y⟹x=y.

Surjective: For every y∈E, choose x=y2∈ℤ. Then, f(x)=2(y/2)=y.

◻

Clipboard

Exercise. Let O be the set of all odd integers.

(a) Prove that ℤ and O are numerically equivalent.

(b) Prove that E and O are numerically equivalent.

Solution
(a)

Proof. Define a function f:ℤ→O by f(x)=2x+1. Now, it remains to prove that it is bijective.

Injective: For every x,y∈ℤ, f(x)=f(y)⟹2x+1=2y+1⟹x=y.

Surjective: For every y∈O, choose x=y−12∈ℤ. Then, f(x)=2(y−12)+1=y−1+1=y.

◻

(b)

Proof. Define a function f:E→O by f(x)=x+1. Now, it remains to prove that it is bijective.

Injective: For every x,y∈ℤ, f(x)=f(y)⟹x+1=y+1⟹x=y.

Surjective: For every y∈O, choose x=y−1∈E. Then, f(x)=y−1+1=y.

◻



The result in this example may seem strange and counter-intuitive, since ℤ seems to be twice as large as E, and E is a proper subset of ℤ, but they turn out to have the same cardinality. Such phenomenon is actually quite common when we deal with the cardinalities of infinite sets.

Fortunately, the numerical equivalence has some nice properties: reflexivity, symmetry and transitivity:

Theorem. For every set A,B,C,

  • (reflexivity) A is numerically equivalent to A.
  • (symmetry) If A is numerically equivalent to B, then B is numerically equivalent to A.
  • (transitivity) If A is numerically equivalent to B, and B is numerically equivalent to C, then A is numerically equivalent to C.

Proof.

Reflexivity:

Case 1: A is empty. Then, |A|=|A|=0.

Case 2: A is nonempty. Then, consider the identity function idA:A→A. We have shown that it is bijective.

Symmetry:

Case 1: A and B are both empty. Then, B must be numerically equivalent to A.

Case 2: One of A,B is empty, and another is nonempty. Then, A must not be numerically equivalent to B, and the result follows.

Case 3: Both A and B are nonempty. Then, assume A is numerically equivalent to B. This means there exists a bijective function f:A→B. Now, consider its inverse function f−1:B→A, which is bijective. So, B is numerically equivalent to A.

Transitivity:

Case 1: A,B,C are empty. Then, A must be numerically equivalent to C.

Case 2: Some of A,B,C are empty, and some are nonempty. Then, it is impossible for A to be numerically equivalent to B and B to be numerically equivalent to C. The result follows.

Case 3: A,B,C are nonempty. Then, assume A is numerically equivalent to B and B is numerically equivalent to C. Then, there exist bijective functions f:A→B and g:B→C. Thus, their composition g∘f:A→C is bijective. Hence, A and C are numerically equivalent.

◻

Now, let us focus on the set ℕ, and consider the (infinite) sets having the same cardinality as ℕ. We give a special name for such sets:

Definition. (Denumerable sets) A set A is denumerable if A is numerically equivalent to ℕ, i.e., there exists a bijective function f:ℕ→A.

Remark.

  • Again, the bijective function can be from A to ℕ, and it does not matter.
  • By the reflexivity of numerical equivalence, ℕ itself is denumerable.
  • Since ℕ is an infinite set, to be numerically equivalent to it, the set A must be infinite. That is, being an infinite set is a necessary (but not sufficient) condition for it to be denumerable.
  • The existence of such bijective function f:ℕ→A allows us to list out the denumerable set A as an infinite list f(1),f(2),f(3),…. Thus, we can list out the elements of A as a1,a2,a3,…, i.e., A can be expressed as {a1,a2,a3,…}.
  • Conversely, assuming ai≠aj for every i≠j (to ensure injectivity), then we can define a function f:ℕ→A by f(n)=an, which is bijective, based on the above infinite list.
  • The cardinality of ℕ is denoted by |ℕ|, or ℵ0 (read "aleph-zero" or "aleph-naught"). So, the cardinality of every denumerable set is ℵ0.

Using this definition, we can further define another property of a set:

Definition. (Countable sets) A set A is countable if it is either finite or denumerable. A set that is not countable is uncountable.

Remark.

  • Intuitively, we can still "count" the elements in a denumerable set. Also, we can clearly count the elements in a finite set. Hence, we call them as countable sets.
  • From this definition, we know that countably infinite sets are exactly the same as denumerable sets. In some other places, the term "countably infinite sets" is used instead of "denumerable sets".
  • Also, from this definition, we know that a set that is uncountable is necessarily infinite.

Example. Prove that the set ℤ is denumerable.

To prove this, we need to construct a bijective function f:ℕ→ℤ. So, we should have a one-to-one corresponding pairing between positive integers and integers.

Idea: we can label the integers as an infinite "queue": Label53124⋯−2−1012⋯ From this, we get an infinite "queue" of integers: 0,1,−1,2,−2,….

Proof. The following pairing suggests a way to construct a bijective function f:ℕ→ℤ: ℕ12345⋯↕↕↕↕↕↕ℤ01−12−2⋯ More precisely, we can define the function f:ℕ→ℤ by f(n)={n2, if n is even;1−n2, if n is odd. Then, it remains to prove that this function is bijective.

Injective: For every m,n∈ℕ,

Case 1: m and n are both even. Then, f(m)=f(n)⟹m2=n2⟹m=n.

Case 2: m and n are both odd. Then, f(m)=f(n)⟹1−m2=1−n2⟹1−m=1−n⟹m=n.

Case 3: m and n have different parities. Then, it is impossible to have f(m)=f(n), since f(m) is nonnegative, while f(n) is negative. The result follows.

Surjective: For every y∈ℤ,

Case 1: y is nonnegative. Then, choose n=2y∈ℕ, which is even. So, we have f(n)=2y2=y.

Case 2: y is negative. Then, choose n=1−2y∈ℕ, which is odd. So, we have f(n)=1−(1−2y)2=2y2=y.


◻


Remark.

  • The function above can also be defined using a single formula:

f(n)=1+(−1)n(2n−1)4.

  • This result is again quite weird, since ℕ⊂ℤ, but |ℕ|=|ℤ|.
  • By the transitivity and symmetry of numerical equivalence, the set of all even integers and the set of all odd integers are also denumerable.
Clipboard

Exercise. Let S3 be the set of all multiples of 3. Prove or disprove that S3 is denumerable.

Solution

Proof. Let us first prove that ℤ is numerically equivalent to S3. Define the function f:ℤ→S3 by f(n)=3n. We now prove that f is bijective:

Injective: For every m,n∈ℤ, f(m)=f(n)⟹3m=3n⟹m=n.

Surjective: For every y∈S3, choose n=y3∈ℤ. Then, f(n)=3(y/3)=y.

Then, since ℤ is numerically equivalent to ℕ, it follows that S3 is numerically equivalent to ℕ. Thus, S3 is denumerable.

◻


We now know that ℕ and ℤ have the same cardinality. It is then natural to consider the set of all rational numbers, ℚ. It appears that ℚ is much larger than ℤ, so it may seem that ℚ should no longer be denumerable, and be uncountable. But it turns out that ℚ is also denumerable.

Example.

(a) Prove that the set of all positive rational numbers, ℚ+ is denumerable.

(b) Hence, prove that the set of all rational numbers, ℚ is denumerable.

Solution.

(a) First, consider the following diagram:

This diagram arranges all rational numbers in an infinite array. Then, we obtain an infinite list of all rational numbers, following the arrows in the diagram: 11,21,12,13,22,31,41,…

Proof. Using the above infinite list, we can then define a bijective function f:ℕ→ℚ+: f(1)=11,f(2)=21,f(3)=12,f(4)=13,f(5)=22,f(5)=31,… In other words, the one-to-one corresponding pairing is ℕ123456⋯↕↕↕↕↕↕↕ℚ+112112133141⋯ In particular, we skip 22 for the function, since this number is the same as 11. So, to ensure the injectivity of the function f, we need to skip such repeated rational number. (The red numbers in the above diagram are the repeated rational numbers, and we have to skip them all in the definition of the function.) Such function f is bijective (since for every n∈ℕ, there exists a unique y∈ℚ+ such that f(n)=y), and so ℚ+ is denumerable.

◻


(b)

Proof. Since ℚ+ is denumerable, we are allowed to write ℚ+={q1,q2,q3,…}. Similarly, we can write the set of all negative rational numbers as ℚ−={−q1,−q2,−q3,…}. Hence, we can write the set of all rational numbers as ℚ=ℚ+∪{0}∪ℚ−={q1,q2,q3,…}∪{0}∪{−q1,−q2,−q3,…}={0,q1,−q1,q2,−q2,…}. More precisely, we can define a function f:ℕ→ℚ by f(1)=0,f(2)=q1,f(3)=−q1,f(4)=q2,f(5)=−q2,… (similar to the function for proving that ℤ is denumerable) In other words, the one-to-one corresponding pairing is ℕ12345⋯↕↕↕↕↕↕ℚ0q1−q1q2−q2⋯ This function f can be proved to be bijective (very similar proof as in the proof for ℤ is denumerable, but we now consider the indexes of "q"), and hence ℚ is denumerable.

◻


So, we have proved that |ℕ|=|ℤ|=|ℚ|. It turns out that even if ℚ seems much larger than ℕ and ℤ, it still has the same cardinality as them. A natural question then arises: is there any uncountable set at all? The answer is yes, and the best known example is the set of all real numbers, ℝ. In other words, there does not exist a bijective function from ℕ to ℝ. Since ℝ is uncountable, this suggests that the "size" of ℝ is different from the "size" of ℕ, i.e., there are different sizes of infinity (in some sense).

Example.

(a) Let a,b∈ℝ with b>a. Construct a bijective function f:(0,1)→(a,b)

(b) Using the bijective function in (a), prove that |(a,b)|=|(c,d)| for every a,b,c,d∈ℝ with b>a and d>c.

(c) Prove that the open interval (0,1) is uncountable.

(d) Prove that |(a,b)|=|ℝ| for every a,b∈ℝ with b>a. (Hint: You can use without proof the fact that the tangent function tan⁡:(−π/2,π/2)→ℝ is bijective.)

Solution.

(a) Define a function f:(0,1)→(a,b) by f(x)=a+(b−a)x. Now, we prove that f is bijective.

Proof.

Injective: For every x,y∈(0,1), f(x)=f(y)⟹a+(b−a)x=a+(b−a)y⟹(b−a)x=(b−a)y⟹x=y.

Surjective: For every y∈(a,b), choose x=y−ab−a∈(0,1). Then, f(x)=a+(b−a)⋅y−ab−a=a+y−a=y.

◻

(b)

Proof. By (a), we can construct a bijective function f:(0,1)→(a,b), and also a bijective function g:(0,1)→(c,d). These mean |(0,1)|=|(a,b)| and |(0,1)|=|(c,d)|. Then, by the symmetry and transitivity of numerical equivalence, we have |(a,b)|=|(c,d)|.

◻


(c) One can use the Cantor's diagonal argument to prove it.

(d)

Proof. Since the tangent function tan⁡:(−π/2,π/2)∈ℝ is bijective, we have |(−π/2,π/2)|=|ℝ|. Also, from part (b), we have for every a,b∈ℝ with b>a, |(a,b)|=|(−π/2,π/2)|. The result then follows from the transitivity of numerical equivalence.

◻


Remark.

  • Part (d) says in particular |(0,1)|=|ℝ|. So, this implies that ℝ is uncountable, since if it is countable (i.e., denumerable in this case) and |(0,1)|=|ℝ|, then it means (0,1) is denumerable, causing a contradiction.

The following results may be useful for comparing denumerable or uncountable sets.

Proposition. Every infinite subset of a denumerable set is denumerable.

Example. Let P be the set of all prime numbers. Prove that P is denumerable.

Proof. Recall that we have proved there are infinitely many prime numbers. Then, since P is an infinite subset of ℕ (which is denumerable), it follows that P is denumerable.

◻


Clipboard

Exercise. Prove that the set S={2n:n∈ℤ}={…,18,14,12,1,2,4,8,…} is denumerable.

Proof

Proof. Since the set S is an infinite subset of ℚ, and ℚ is denumerable, it follows that S is denumerable.

◻


Example. Prove that for every finite subset S of ℕ, |ℕ∖S|=|ℕ|. (This means that no matter we "take away" how many elements from ℕ, as long as the number of elements taken away is finite, then the cardinality is not affected.)

Proof. First, we have ℕ∖S⊆ℕ, and ℕ is denumerable. So, it remains to prove that ℕ∖S is infinite. We prove it by contradiction.

Assume to the contrary that ℕ∖S is finite. Since S is also finite, we have S∪(ℕ∖S)=ℕ is finite, contradicting to the fact that ℕ is infinite.

◻


Proposition. Let A and B be sets such that A⊆B. If A is uncountable, then B is uncountable.

Remark.

  • Using this result, we can give an alternative proof that ℝ is uncountable (we have (0,1) is uncountable and (0,1)⊆ℝ).

Example. Prove that [a,b] is uncountable for every a,b∈ℝ with b>a.

Proof. Since (a,b)⊆[a,b] and (a,b) is uncountable, we conclude that [a,b] is uncountable.

◻


Remark.

  • Notice that this just says that [a,b] is uncountable. It does not imply that |[a,b]|=|(a,b)|. As we will see, two uncountable sets may have different cardinalities.

Proposition. If A and B be denumerable sets, then A×B is denumerable.

Proposition. If A and B are denumerable sets, then A∪B is denumerable.

Clipboard

Exercise. Prove or disprove that if A and B are denumerable sets, then A∩B is denumerable.

Solution

Disproof. Take A to be the set of all even numbers and B to be the set of all odd numbers. Then, A∩B=∅, which is not denumerable.

◻


Example.

  • ℕ×ℕ is denumerable.
  • ℚ×ℤ is denumerable.
Clipboard

Exercise. Prove or disprove each of the following statements:

(a) For every nonempty set A,B, |A×B|=|B×A|.

(b) The set of all irrational numbers, 𝕀 is uncountable. (Hint: use proof by contradiction)

(c) Every infinite subset of 𝕀 is uncountable.

(d) For every set A,B,C, if A⊆B⊆C, and A,C are denumerable, then B is denumerable.

(e) {2}×ℚ is uncountable.

(f) The set S={(x,y)∈ℤ×ℝ:x+y=1} is denumerable.


Solution
(a)

Proof. Define a function f:A×B→B×A by f(a,b)=(b,a). It now remains to prove that f is bijective.

Injective: For every (a1,b1),(a2,b2)∈A×B, f(a1,b1)=f(a2,b2)⟹(b1,a1)=(b2,a2)⟹b1=b2 and a1=a2⟹(a1,b1)=(a2,b2). Surjective: For every (x,y)∈B×A, choose (a,b)=(y,x)∈A×B. Then, f(a,b)=(b,a)=(x,y).

◻

(b)

Proof. Assume to the contrary that 𝕀 is countable. Since 𝕀 is infinite, this means 𝕀 is denumerable. Also, since ℚ is denumerable, it follows that 𝕀∪ℚ=ℝ is denumerable, contradicting to the fact that ℝ is uncountable.

◻

(c)

Disproof. Consider the set S={k+2:k∈ℕ}⊆𝕀. Then, define the function f:ℕ→S by f(n)=n+2. It remains to prove that f is bijective.

Injective: For every m,n∈ℕ, f(m)=f(n)⟹m+2=n+2⟹m=n.

Surjective: For every y∈S, choose n=y−2∈ℕ. Then, f(n)=y−2+2=y.

◻

(d)

Proof. Assume A⊆B⊆C and A,C are denumerable. Since B⊆C and C is denumerable, it remains to prove that B is infinite. But since A is denumerable, and hence infinite, and also A⊆B, B must be infinite. We are done.

◻

(e)

Disproof. Let S be the set {2}×ℚ. Define a function f:ℚ→S by f(q)=(2,q). It now remains to prove that f is bijective.

Injective: For every q1,q2∈ℚ, f(q1)=f(q2)⟹(2,q1)=(2,q2)⟹q1=q2.

Surjective: For every (x,y)∈S, choose q=y∈ℚ. Then, f(q)=(2,y)=(x,y) (x must be 2).

◻

(f)

Proof. For every x∈ℤ, the only real number y such that x+y=1 is y=1−x. Thus, we can express the set S as S={(x,1−x)∈ℤ×ℝ:x∈ℤ}. Then, we can define a function f:S→ℤ by f(x,y)=x. It now remains to prove that f is bijective.

Injective: For every (x1,y1),(x2,y2)∈S, f(x1,y1)=f(x2,y2)⟹x1=x2⟹(x1,1−x1)=(x2,1−x2)⟹(x1,y1)=(x2,y2).

Surjective: For every z∈ℤ, choose (x,y)=(z,1−z)∈S. Then, f(x,y)=z.

◻



  1. ↑ There are various types of axiomatic set theory, in which Zermelo-Fraenkel set theory is the most well-known one.
  2. ↑ . Indeed, this is the axiom of extension in the Zermelo-Fraenkel set theory.
  3. ↑ For sets with exactly one element, they are called singleton. In this case, D is a singleton.
  4. ↑ There are no elements belonging to ∅.
  5. ↑ We need not to write brackets for LHS because of the associative law.
  6. ↑ When we construct a truth table for a statement that involves some statements, we need to also list all possible combinations of truth values of the statements involved, so that we can observe the truth value for that statement under all situations.
  7. ↑ In this case, we may call this conditional to be vacuously true, since the conditional is meaningless (when the hypothesis is false, no matter the consequent is true or false, the conditional is true. Thus, "the conditional is true" is "useless" when the hypothesis is false).
  8. ↑ For example, it may be the case that Bob does not hand in any assignment, and thus even if he passes the final examination, he still fails the course (P is false and Q is true). It may also be the case that Bob passes the final examination, and perform consistently well in all assignments, and thus he passes the course (P is false and Q is false).
  9. ↑ It is not necessary for Q→P to be true when P→Q is true. For example, when P is false and Q is true, P→Q is (vacuously) true, but Q→P is false.
  10. ↑ It is not necessary for Q⇒P when P⇒Q. See, for example, the third row of the above truth table for P↔Q, in which P→Q is true while Q→P is false. Indeed, it is a common mistake to think that we must also have Q⇒P when P⇒Q.
  11. ↑ "Some" in mathematics always means "at least one".
  12. ↑ In the form of "∃x∈S,P(x)", this statement can also be written as "∃A∈𝒫(U),A=U."
  13. ↑ Mathematical theorems can also have more than one variable, e.g., ∀x,y∈S,P(x,y)⟹Q(x,y).
  14. ↑ It is impossible for rk to be negative, since rk−1≥b (the number just before getting in the desired range), and thus rk=rk−1−b≥0.
  15. ↑ Of course we can write it as p1p2⋯pn≥2 (or even writing greater than or equal to some greater number if we know more prime numbers), but it is not necessary for applying the fundamental theorem of arithmetic on q.
  16. ↑ This is because there exist some positive integer n for which P(n) is false.