MATH 1240: Elementary Discrete Math Notes
MATH 1240: Elementary Discrete Math Notes
Andrii Arman
University of Manitoba
Robert Craigen
University of Manitoba
Michelle Davidson
University of Manitoba
Karen Gunderson
University of Manitoba
November 6, 2024
©2024 Robert Craigen, Michelle Davidson, Karen Gunderson2
This work is licensed under Creative Commons Attribution-NonCommercial-
ShareAlike 4.0 International. To view a copy of this license, visit https://
[Link]/licenses/by-nc-sa/4.0/.
Contents
1 Introduction 1
1.1 Review . . . . . . . . . . . . . . . . . . . . . 2
2 Fundamentals of Logic 4
2.1 Logical propositions and truth tables. . . . . . . . . . . 4
2.2 Laws of logic . . . . . . . . . . . . . . . . . . . 5
2.3 Logical implication . . . . . . . . . . . . . . . . . 7
2.4 Quantifiers . . . . . . . . . . . . . . . . . . . . 8
2.5 Definitions and proofs . . . . . . . . . . . . . . . . 9
2.6 Principle of mathematical induction . . . . . . . . . . . 10
2.7 Recursive definitions. . . . . . . . . . . . . . . . . 12
3 Set Theory 13
3.1 Sets and subsets . . . . . . . . . . . . . . . . . . 13
3.2 Cartesian Products . . . . . . . . . . . . . . . . . 14
3.3 Set operations and laws . . . . . . . . . . . . . . . 14
5 Principles of Counting 22
5.1 Rules of Sum and Product . . . . . . . . . . . . . . 22
5.2 Permutations . . . . . . . . . . . . . . . . . . . 22
5.3 Combinations and the Binomial Theorem . . . . . . . . . 23
5.4 Cardinalities of unions . . . . . . . . . . . . . . . . 24
6 Graph Theory 25
6.1 Graphs, vertices, and edges . . . . . . . . . . . . . . 25
6.2 Special graphs and new graphs from old . . . . . . . . . 27
6.3 Adjacency, neighbourhoods, and degrees . . . . . . . . . 28
6.4 Graph isomorphism . . . . . . . . . . . . . . . . . 30
6.5 Walks and connected graphs . . . . . . . . . . . . . . 30
6.6 Trees . . . . . . . . . . . . . . . . . . . . . . 32
iv
CONTENTS v
8 Relations 37
8.1 Relations . . . . . . . . . . . . . . . . . . . . . 37
8.2 Properties of relations . . . . . . . . . . . . . . . . 37
8.3 Equivalence relations . . . . . . . . . . . . . . . . 38
9 Modular Arithmetic 39
9.1 Integers modulo n and modular arithmetic . . . . . . . . 39
Appendices
Back Matter
References 45
Chapter 1
Introduction
1
CHAPTER 1. INTRODUCTION 2
1.1 Review
1.1.1 Sigma Notation
Pn
Notation 1.1.1 Sigma notation. The sigma notation expression i=1 Xi ,
X
n
also written Xi , is an abbreviation for the expression X1 + X2 + · · · + Xn ;
i=1
that is, the sum of terms X1 , X2 , . . . , Xn .
Real numbers R
Integers Z = {0, ±1, ±2, . . .}
na o
Rational Q= | a, b ∈ Z, b ̸= 0
numbers b
CHAPTER 1. INTRODUCTION 3
Intervals • [a, b] = {x ∈ R | a ≤ x ≤ b}
• (a, b) = {x ∈ R | a < x < b}
• [a, b) = {x ∈ R | a ≤ x < b}
• (a, b] = {x ∈ R | a < x ≤ b}
• [a, ∞) = {x ∈ R | a ≤ x}
• (a, ∞) = {x ∈ R | a < x}
• (−∞, b) = {x ∈ R | x < b}
• (−∞, b] = {x ∈ R | x ≤ b}
• (−∞, ∞) = R (doubly infinite)
Fundamentals of Logic
p ¬p
0 1
1 0
♢
Definition 2.1.3 Conjunction. The conjunction of p and q, p ∧ q (read
“p and q”), is true if and only if both p and q are true.
p q p∧q
0 0 0
0 1 0
1 0 0
1 1 1
♢
Definition 2.1.4 Disjunction. The disjunction of p and q, p ∨ q (read “p
or q”), is true if and only if p is true or q is true (or both are true).
p q p∨q
0 0 0
0 1 1
1 0 1
1 1 1
4
CHAPTER 2. FUNDAMENTALS OF LOGIC 5
♢
Definition 2.1.5 Implication. The implication p → q (read “p implies q”
or “if p, then q”) is true if and only if p being true implies q is true.
p q p→q
0 0 1
0 1 1
1 0 0
1 1 1
♢
Definition 2.1.6 Biconditional. The biconditional p ↔ q (read “p if and
only if q”) is true if and only if (p → q) and (q → p) are both true.
The phrase “if and only if” is commonly abbreviated “iff”.
p q p↔q
0 0 1
0 1 0
1 0 0
1 1 1
♢
Definition 2.1.7 Compound and primitive propositions. A proposition
is called a compound proposition if it is formed by connecting two propo-
sitions with conjunction, disjunction, implication, or biconditional or by the
negation of a proposition. A proposition that is not a compound proposition
is called a primitive proposition. The primitive propositions used in the
formation of a compound proposition are called its components. ♢
Remark 2.1.8 When building compound propositions from other compound
propositions, parentheses are required to make the definition unambiguous. For
example, the disjunction of the propositions a ∧ b and c is written (a ∧ b) ∨ c.
These are required as the proposition (a ∧ b) ∨ c is different from a ∧ (b ∨ c).
The expression a ∧ b ∨ c is ambiguous and ‘ill-formed’. The convention is that
¬ negates the first proposition to its right in an expression so for example,
¬p → q is unambiguous: It means (¬p) → q, not ¬(p → q).
In Section 2.2 we shall see some situations where some further parentheses
can be dropped.
Definition 2.1.9 Tautology and Contradiction. A compound proposition
is a tautology if and only if it is true for all truth value assignments of its
components. A tautology is usually denoted T0 .
A compound proposition is a contradiction if and only if it is false for all
truth value assignments of its components. A contradiction is usually denoted
by F0 . ♢
Remark 2.2.5 Given the Associative Laws for both conjunction and disjunc-
tion, it is common place to drop the parentheses in compound expressions
where all connectives are conjunctions or all connective are disjunctions. The
expression p ∧ q ∧ r is used to mean either p ∧ (q ∧ r) or (p ∧ q) ∧ r (which are
logically equivalent). Similarly, p ∨ q ∨ r is used to mean either p ∨ (q ∨ r) or
(p ∨ q) ∨ r.
Theorem 2.2.6 Implication as disjunction.
p → q ⇔ ¬p ∨ q
Theorem 2.2.7 Contrapositive of an implication.
p → q ⇔ ¬q → ¬p
Note that applying Theorem 2.2.7 to the converse of a proposition shows
that the converse of p → q (which is q → p) is logically equivalent to the inverse
of p → q (which is ¬p → ¬q). However, one can check (for example using truth
tables) that an implication is not logically equivalent to either its converse nor
its inverse.
CHAPTER 2. FUNDAMENTALS OF LOGIC 7
• Rule of Conjunction.
p (p ∧ q) → (p ∧ q)
q
p∧q
• Rule of Disjunctive Amplification.
p p ⇒ (p ∨ q)
p∨q
• Rule of Conditional Proof.
p∧q [(p ∧ q) ∧ [p → (q → r)]] ⇒ r
p → (q → r)
r
• Rule of the Constructive Dilemma.
p→q [(p → q)∧(r → s)∧(p∨r)] ⇒
r→s (q ∨ s)
p∨r
q∨s
• Rule of the Destructive Dilemma.
p→q [(p → q) ∧ (r → s) ∧ (¬q ∨
r→s ¬s)] ⇒ (¬p ∨ ¬r)
¬q ∨ ¬s
¬p ∨ ¬r
Proof template 2.3.4 Proof template for proof by rules of inference.
In a proof of the validity of an argument by the rules of inference, the format
is numbered lines given in two columns. The left column contains statements
and the right column contains justifications. The last line of the proof is the
conclusion of the argument.
• Premises are introduced with justification Premise.
2.4 Quantifiers
Definition 2.4.1 Open statement. A declarative sentence is an open
statement if
• It contains one or more variables.
involving n]”
• F0 = 0, F1 = 1, and
• for n > 1, Fn = Fn−1 + Fn−2 .
♢
Chapter 3
Set Theory
Recall the definitions in Definition 1.1.2, Definition 1.1.3, Notation 1.1.4, and
Definition 1.1.6
13
CHAPTER 3. SET THEORY 14
A1 × A2 × · · · × An = {(a1 , a2 , . . . , an ) | ai ∈ Ai , 1 ≤ i ≤ n}.
♢
Notation 3.2.3 For a set A, the n fold product A1 × A2 × · · · × An where for
all 1 ≤ i ≤ n, A = Ai is sometimes denoted Ak .
Union: A ∪ B = {x | (x ∈ A) ∨ (x ∈ B)}
Intersection: A ∩ B = {x | (x ∈ A) ∧ (x ∈ B)}
Symmetric A ∆ B = {x | (x ∈ A ∪ B) ∧ (x ∈
/ A ∩ B)}
difference:
♢
Definition 3.3.2 Disjoint sets. For any universe U and S, T ⊆ U , then S
and T are disjoint if and only if S ∩ T = ∅. ♢
Definition 3.3.3 Complement of a set. For a set A ⊆ U , the complement
of A, denoted A, is {x | (x ∈ U ) ∧ (x ∈
/ A)}. ♢
Definition 3.3.4 Relative complement of a set. For sets A, B ⊆ U , the
relative complement of A in B, denoted B \ A, is {x | (x ∈ B) ∧ (x ∈
/ A)}.
♢
Remark 3.3.5 Notice that the complement of a set is its relative complement
in the universe, A = U \ A.
Definition 3.3.6 Union or intersection over an index set. Let I be a
nonempty set and U a universe. For each i ∈ I let Ai ⊆ U . Then I is called
an index set and each i ∈ I is called an index. Under these conditions,
[
Ai = {x ∃i [x ∈ Ai ]}
i∈I
\
Ai = {x ∀i [x ∈ Ai ]}
i∈I
♢
Definition 3.3.7 Partition. Let A be a set and let {Ai | i ∈ I} be a
collection of nonempty subsets A. Then {Ai | i ∈ I} is a partition of A iff
S
• A = i∈I Ai , and
CHAPTER 3. SET THEORY 15
Proof template 3.3.10 Template for set theory proofs. To prove a set
theory identity X = Y there are two steps: proving X ⊆ Y and Y ⊆ X.
1. To prove X ⊆ Y : Let x ∈ X. Use definitions and previously proven
results to show that x ∈ Y . Conclude that X ⊆ Y .
2. To prove Y ⊆ X: Let y ∈ Y . Use definitions and previously proven
results to show that y ∈ X. Conclude that Y ⊆ X.
16
CHAPTER 4. PROPERTIES OF THE INTEGERS 17
a | (c1 x1 + c2 x2 + · · · + cn xn ).
x = c1 x1 + . . . + ck+1 xk+1 ,
y = c 1 x1 + . . . + c k xk ,
z = ck+1 xk+1 .
N = p1 · p2 · · · · · pk + 1.
a = bq + r, 0 ≤ r < b.
Proof. We start with showing uniqueness, namely that for every integers a, b
the quotient q and remainder r from the statement of the theorem are unique
(if they exist at all). Next we prove the theorem for the case a ≥ 0 using strong
mathematical induction, and finally prove the theorem for the negative values
of a.
To show uniqueness assume that a ∈ Z, b ∈ Z+ and let q1 , q2 , r1 , r2 with 0 ≤
r1 , r2 < b be such that
q 1 b + r1 = a = q 2 b + r2 .
Then (q1 − q2 )b = r2 − r1 . So b | r2 − r1 . Now, since 0 ≤ r1 , r2 ≤ b − 1, we
have −(b − 1) ≤ r2 − r1 ≤ b − 1.
If r2 − r1 > 0, by Theorem 4.1.3(2), b ≤ r2 − r1 ≤ b − 1, a contradiction. So
this case is impossible.
Similarly, if r1 −r2 > 0, by Theorem 4.1.3(2), b ≤ r1 −r2 ≤ b−1, a contradiction.
So this case is impossible.
Therefore, r1 = r2 . From bq1 + r1 = bq2 + r2 we conclude q1 = q2 . So, r1 = r2
and q1 = q2 , this finishes the proof of uniqueness.
Let b ∈ Z+ be fixed for the remainder of the proof. For every a ≥ 0 let
S(a) be the statement that there exist integers q, r, such that a = bq + r and
0 ≤ r ≤ b − 1. We cannot use induction to prove that S(a) is true for all a ∈ Z,
but we can show that S(a) is true for all a ≥ 0 using strong mathematical
induction.
Indee, start by considering base cases S(0), S(1), . . . , S(b − 1). For each i ∈
{0, 1, 2, . . . , b − 1} we can take q = 0 and r = i. Then i = qb + r with
0 ≤ r ≤ b − 1. Therefore, for every i ∈ {0, 1, . . . , b − 1}, the proposition S(i) is
true.
Now, let k ≥ b − 1 be an integer, and assume that all propositions
S(0), S(1), . . . , S(k) are true.
Consider k + 1 = (k + 1 − b) + b. Since k ≥ b − 1, we have 0 ≤ k + 1 − b ≤ k.
So S(k + 1 − b) is true (by inductive hypothesis).
Therefore, there are q, r ∈ Z such that k + 1 − b = qb + r and 0 ≤ r ≤ b − 1.
Then k + 1 = (q + 1)b + r. So S(k + 1) holds.
This finishes the proof of inductive step. By PMI (strong form), S(a) is true
CHAPTER 4. PROPERTIES OF THE INTEGERS 19
for all a ≥ 0.
Finally, if a < 0, then −a > 0, so S(−a) holds.
Then there are q, r such that −a = qb + r and 0 ≤ r ≤ b − 1.
If r = 0, then a = (−q)b + 0, so S(a) also is true.
If r ≥ 1, then 1 ≤ r ≤ b − 1, so −a = −(qb + r) = (−q − 1)b + b − r. S(a) is
true in this case as well (with a choice of quotient −q − 1 and remainder b − r).
■
One of the applications of the Division Algorithm is expressing numbers in
other than decimal numeral systems.
Theorem 4.1.7 Base b representation of n. Let b ≥ 2, n ≥ 1 be integers.
Then there is unique sequence r0 , r1 , r2 , . . . , rk ∈ {0, 1, 2, . . . , b − 1} with rk ̸= 0
such that
n = rk bk + rk−1 bk−1 + · · · + r2 b2 + r1 b + r0 .
In this case we write n = (rk rk−1 rk−2 . . . r2 r1 r0 )b and say that
rk rk−1 rk−2 . . . r2 r1 r0 is base b representation of n.
Remark 4.1.8 If base b is not defined, by default we take b = 10. For example,
gcd(b, r1 ) = gcd(r1 , r2 ).
gcd(rk−1 , rk ) = gcd(rk , 0) = rk .
■
Remark 4.2.6 Note that for each step in the Euclidean algorithm, the exis-
tence of a unique qi and ri for that step is guaranteed by the division algorithm.
Lemma 4.2.7 Bézout’s Lemma. Let a, b ∈ Z, not both equal to zero, and
let d = gcd(a, b). Then there are x0 , y0 ∈ Z such that
ax0 + by0 = d
CHAPTER 4. PROPERTIES OF THE INTEGERS 21
xt = x0 + tb1 , yt = y0 − ta1
ax + py = 1.
abx + pby = b.
Since p | ab, we have p | abx. Also p | pby, so by Theorem 4.1.3, p | abx + pby,
and so p | b in this case. ■
Theorem 4.3.2 A prime dividing a product of integers divides one
of them. Let p be a prime and {ai | 1 ≤ i ≤ n} ⊆ Z+ with p | a1 a2 · · · an .
Then, there exists i with 1 ≤ i ≤ n so that p | ai .
Theorem 4.3.3 Fundamental Theorem of Arithmetic. Every integer
n > 1 can be written uniquely as a product of primes (up to the order of the
primes).
Chapter 5
Principles of Counting
♢
Theorem 5.1.2 Rule of Sum, or ROS. Suppose one is to perform a task
T , which can be broken into two disjoint cases, which we shall call task A and
task B. If A can be performed in m ways and B can be performed in n ways
then the number of ways in which T can be performed is m + n.
Theorem 5.1.3 Rule of Product, or ROP. Suppose task T can be broken
into a sequence of steps—task A and then task B—where A can be performed
in m ways and B can be performed in n ways regardless of the way in which A
is performed, then the number of ways of performing T is mn.
Theorem 5.1.4 Cardinalities of power sets. Let U be any universe and
A ⊆ U be any finite set. Then,
|P(A)| = 2|A| .
5.2 Permutations
Definition 5.2.1 Permutation. A permutation of a finite set X is a linear
arrangement of the elements of X. ♢
Remark 5.2.2 It is possible to extend the notion of permutations to infi-
nite sets. The necessary material and applications of that will come up in
Sections Chapter 7 and Section 7.4.
Definition 5.2.3 Permutation of size r. For any non-negative integers n,
r, and a collection of n distinct objects, a permutation of size r is is a linear
arrangement of r of the n objects. ♢
Notation 5.2.4 The number of permutations of size r ≥ 0 from a set of size
n is denoted P (n, r).
Note that while the notation P (n, r) is useful in stating problems and per-
forming your work it is generally not acceptable for use in the final form of a
22
CHAPTER 5. PRINCIPLES OF COUNTING 23
(x1 + x2 + · · · + xt )n
is
n!
.
n 1 ! n 2 ! n3 ! · · · n t !
Notation 5.3.7 The notation r1 , r2 ,n..., rn may be used to denote the multi-
nomial coefficient n1 ! n2 !n!
n3 !···nt ! .
CHAPTER 5. PRINCIPLES OF COUNTING 24
Graph Theory
c d
Figure 6.1.5 Two different drawings of the same graph
These are two valid drawings of the graph G. Depending on the context or
application, one particular drawing may be preferable to another. □
Definition 6.1.6 Directed graph. A directed graph (or digraph) G is
an ordered pair (V, E) with V ̸= ∅ and E ⊆ V × V . An element of V is called
a vertex (plural is vertices) and elements of E are called directed edges or
arcs.
A directed edge of the form (a, a) is called a loop. ♢
Like graphs, digraphs are drawn with dots or circles for the vertices. Di-
rected edges/arcs are drawn as lines or curves with an arrow. A directed edge
(x, y) is drawn with an arrow pointing from x to y.
25
CHAPTER 6. GRAPH THEORY 26
y z
x
Figure 6.1.7 Example of a digraph
Definition 6.1.8 Multigraph. A multigraph is an ordered pair (V, E),
where V is a non-empty set and E is a collection of unordered pairs (that can
repeat the same vertex) from E. In a multigraph, E need not be a set; a pair
{x, y} may occur more than once. ♢
3.5 2.1
200
Figure 6.1.12 Weighted graph and hypergraph
CHAPTER 6. GRAPH THEORY 27
K1
K2
K3 K4
K5
Figure 6.2.2 Complete graphs
There is also the empty graph En on n vertices, which has no edges.
Note that in a drawing of a graph, dashed lines are sometimes used to
indicate the absence of edges. For example, the first few empty graphs can be
drawn as follows:
E1
E2
E3 E4
E5
Figure 6.2.3 Empty graphs
Definition 6.2.4 Bipartite graph. A graph G = (V, E) is bipartite iff
there exist disjoints sets X, Y with V = X ∪ Y so that each edge in G contains
one vertex from each of X and Y . In such a case, the sets X and Y are called
partite sets.
For m, n ∈ Z+ , the complete bipartite graph Km,n is a bipartite graph
with two sets V = X ∪ Y , X ∩ Y = ∅, where if |X| = m, |Y | = n, and contains
all possible mn edges. ♢
In a drawing of a bipartite graph, vertices are sometimes drawn in two
columns with no edges between vertices in the same column. The first graph
below is redrawn on the right to more clearly show the bipartite structure.
K3,3
K1,3 K2,3 K4,3
Proof. Let G = (V, E) be a graph with finitely many edges. Count each edge
once for each of its endpoints in two different ways.
On the one hand, there are |E| edges and each edge has 2 endpoints, so the
total count is 2|E|.
On the other hand, for every vertex v, count the number of incident edges. For
any v ∈ V , there are deg(v) neighbours and soPdeg(v) incident edges. Therefore,
summing over all vertices, the total count is v∈V deg(v).
Since both methods count the same thing, they are equal and so 2|E| =
P
v∈V deg(v). ■
Note that the same proof of Theorem 6.3.8 can P be applied to graphs with
multiple edges and loops. In that setting again v∈V deg(v) = 2|E|. In the
case of directed graphs, onePcan instead countPeach arc once for either endpoint
to show that in a digraph v∈V deg+ (v) = v∈V deg− (v) = |E|.
Example 6.3.9 Prove that in a graph G = (V, E), P the sum of the degrees of
the vertices is [Link] the Handshaking lemma, v∈V deg(v) = 2|E|. Since
2|E| is even, the sum of the degrees of the vertices is even. □
Example 6.3.10 Prove that if G = (V, E) is a finite graph, then G has an
even number of vertices of odd [Link] G = (V, E) be a finite graph and let
Ve be the set of vertices of G with even degree and let V0 be the set of vertices
of G with odd degree.
By the Handshaking Lemma,
X X X
2|E| = deg(v) = deg(v) + deg(v).
v∈V v∈Ve v∈Vo
P P
Since 2|E| is even and v∈Ve deg(v) is even, by Item 6, v∈Vo deg(v) is also
even. Since a sum of odd integers is even only if there are an even number of
summands, |Vo | is even.
Therefore, G has an even number of vertices of odd degree. □
Example 6.3.11 Prove that if k ≥ 0 and G = (V, E) is a k-regular graph,
|
then |E| = k|V
2 .Let k ≥ 0 and let G = (V, E) is a k-regular graph. By the
Handshaking Lemma,
X X
2|E| = deg(v) = k = k|V |
v∈V v∈V
k|V |
which can be rearranged to give |E| = 2 .Note that this shows that if k is
CHAPTER 6. GRAPH THEORY 30
odd and G = (V, E) is a k-regular graph, then |V | is even. So, for example,
there are no 3-regular graphs on 9 vertices. □
Example 6.3.12 Prove that for every n ≥ 1, the hypercube Qn has 2n ver-
tices and is n-regular. Deduce that Qn has n2n−1 [Link] any n ≥ 1, the
hypercube Qn has 2n vertices because there are 2n different strings of length
n with entries in {0, 1}.
To show that Qn is n-regular, consider any vertex v = (v1 , v2 , . . . , vn ).
There are n different coordinates of v, and for each coordinate i, there is a
unique vertex v′ that differs from v in the i-th coordinate. Therefore, v is
adjacent to n other vertices.
For example, in Q4 , the neighbours of 1101 are: 0101, 1001, 1111, 1100.
Since Qn is n-regular and has 2n vertices, by a previous example, Qn has
n2n
2 = n2
n−1
edges. □
d c z w
a b x y
Figure 6.4.3 Two isomorphic graphs
One function showing that these two graphs are isomorphic is the function
f : {a, b, c, d} → {x, y, z, w} defined by f (a) = x, f (b) = y, f (c) = z, and
f (d) = w. This function is a bijection, and it preserves both edges and non-
edges. □
of the walk are the same, and no other vertices are repeated. A cycle on
n vertices is denoted by Cn .
♢
In this reference a path with n vertices is denoted by Pn ; as in Figure
Figure 6.5.3. Note that this notation is not universal and some references will
use Pn to denote a path with n edges.
P1
P3 P4
P2
Figure 6.5.3 Small paths
C3 C4 C6
C5
Figure 6.5.4 Small cycles
Theorem 6.5.5 δ(G) ≥ 2 implies a cycle. If G is a graph with δ(G) ≥ 2,
then G contains a cycle.
Proof. Let P = (x0 , x1 , . . . , xk ) be any path in G of maximum length. Suppose,
in hopes of a contradiction, that x0 had a neighbour y, not contained in the path
P . Then, (y, x0 , x1 , . . . , xk ) is a path in G that is longer than P , contradicting
the assumption that P has maximum length.
···
x0 x1 x2 xk−1 xk
Therefore, every neighbour of x0 is in the set {x1 , x2 , . . . , xk }. We know that x0
is adjacent to x1 and since deg(x0 ) ≥ δ(G) ≥ 2, x0 has some other neighbour.
Let i ∈ {2, 3, . . . , k} with {x0 , xi } ∈ E.
··· ···
x0 x1 x2 xi−1 xi xk−1 xk
Then (x0 , x1 , x2 , . . . , xi−1 , xi , x0 ) is a cycle in G, completing the proof. ■
Proof template 6.5.6 Proof template with instantiation of a useful
structure. Within the justification of a proof, it can sometimes be useful to
instatiate a structure not mentioned in the proof statement. These are often
largest or smallest structures with some property.
CHAPTER 6. GRAPH THEORY 32
For example, the proof of Theorem 6.5.5, uses the instantiation “Let
v1 , v2 , . . . , vk be a longest path in the graph”. Such a path must exist since
every graph contains paths and so in a finite graph, some must be longest.
This path is then used to construct a cycle.
Definition 6.5.7 Connected. A graph G is connected iff for any two
vertices x and y, there exists a path from x to y (called an x-y path). If a
graph is not connected, it is disconnected. ♢
Definition 6.5.8 Connected component. A connected component of
a graph is a maximal connected subgraph. ♢
6.6 Trees
Definition 6.6.1 Acyclic. A graph is called acyclic iff it contains no cycles.
♢
Definition 6.6.2 Tree, forest. A tree is a connected acyclic graph.
A forest is an acyclic graph. ♢
Theorem 6.6.3 Most trees have leaves. Every tree with at least 2 vertices
has at least two leaves.
Proof. This proof follows the same idea as Theorem 6.5.5. Let T = (V, E) be
a tree with at least two vertices. Let P = (x0 , x1 , . . . , xk ) be any path in T
of maximum length. Since T has at least 2 vertices, k ≥ 1. Since P is a path
of maximum length, all of the neighbours of each of x0 and xk are contained
in the path (since otherwise the path could be extended, contradicting its
maximality).
Suppose, in hopes of a contradiction, that x0 had a neighbour in the path,
other than x0 , call it xi . Then, (x0 , x1 , . . . , xi−1 , xi , x0 ) would be a cycle in T ,
contradicting the assumption that T is a tree. Thus, the only neighbour of x0
is x1 , and so x0 is a leaf.
A similar argument shows that the only neighbour of xk is xk−1 and so xk is
a leaf. Therefore, T has at least two leaves. ■
Theorem 6.6.4 Number of edges in a tree. For every finite tree T =
(V, E), |V | = |E| + 1.
Proof. We prove this by induction on the number of vertices. For any n ≥ 1,
let S(n) be the statement that every tree with n vertices has n − 1 edges.
Base case: S(1) is true since the only tree with one vertex is isomorphic to K1
and has 0 edges.
Inductive step: Fix k ≥ 1 and suppose that S(k) is true. That is, suppose
every tree with k vertices has k − 1 edges.
Let T = (V, E) be a tree with k + 1 vertices. By Theorem 6.6.3, T has a
leaf, call it x. Let T ′ = (V ′ , E ′ ) be the tree obtained by removing x and its
incident edge from T . Then, T ′ has k + 1 − 1 = k vertices and by the inductive
hypothesis, S(k), T ′ has exactly k − 1 edges. Since T has one more vertex and
one more edge than T ′ , we have |V | = (k − 1) + 1 = (k + 1) − 1. Since T was
an arbitrary tree with k + 1 vertices, S(k + 1) is true and so S(k) → S(k + 1)
is true, completing the induction step.
Therefore, by the principle of mathematical induction, for every n ≥ 1, S(n)
is true and so for every finite tree T = (V, E), |E| = |V | − 1, which can be
rearranged to get |V | = |E| + 1. ■
CHAPTER 6. GRAPH THEORY 33
♢
Definition 7.1.3 Preimage of a set. If f : A → B and B1 ⊆ B, then
f −1 (B1 ) = {x ∈ A | f (x) ∈ B1 }.
34
CHAPTER 7. FUNCTIONS AND CARDINALITY 35
1A (a) = a.
♢
Definition 7.2.2 Equality of functions. Two functions f, g : A → B are
said to be equal, written f = g, iff for all a ∈ A, f (a) = g(a). ♢
Definition 7.2.3 Composition. For functions f : A → B and g : B → C,
the composition of f and g, denoted g ◦ f : A → C, is the function defined
for a ∈ A, by (g ◦ f )(a) = g(f (a)) for all a ∈ A. ♢
Definition 7.2.4 Inverse of a function. A function f : A → B is called
invertible if there is a function g : B → A such that g ◦ f = 1A and f ◦ g = 1B .
In this case, g is called an inverse of f . ♢
Theorem 7.2.5 The composition of one-to-one and onto functions.
Let f : A → B and g : B → C.
• f is invertible.
Theorem 7.3.2 Pigeonhole principle. Let n ∈ Z+ . If n + 1 objects are
placed into n holes, then at least one hole contains at least 2 objects.
CHAPTER 7. FUNCTIONS AND CARDINALITY 36
Relations
8.1 Relations
Definition 8.1.1 (binary) relation from A to B. For sets A, B, a (binary)
relation from A to B is any subset of A × B. ♢
Definition 8.1.2 (binary) relation on A. For a set A, a (binary) relation
on A is any subset of A × A. ♢
Definition 8.1.3 Converse of a relation. If R is a relation from A to B,
then the converse relation Rc is the relation from B to A defined by
37
CHAPTER 8. RELATIONS 38
[x] = {y ∈ A | y ∼ x}.
♢
Theorem 8.3.2 An equivalence relation defines a partition. Let ∼ be
an equivalence relation on the set A. Then the equivalence classes
[x] x ∈ A
define a partition of A.
Theorem
S 8.3.3 A partition defines an equivalence relation. Let A =
A
i∈I i be a partition of a set A. Define a relation, ∼, on A by
Modular Arithmetic
{(a, b) ∈ Z × Z : n | (a − b)}
is an equivalence relation on Z.
Definition 9.1.2 Integers Modulo n. Let n ∈ Z+ and n > 1. For a, b ∈ Z,
a is congruent to b modulo n, written a ≡ b (mod n), iff n | a − b, or,
equivalently, if there exists k ∈ Z with a = b + kn.
The set of equivalence classes for this relation is denoted Zn . ♢
Theorem 9.1.3 Addition and multiplication in Zn . Let n ∈ Z+ and
a, b, c, d ∈ Z with a ≡ c (mod n) and b ≡ d (mod n). Then,
• (a + b) ≡ (c + d) (mod n) and
• ab ≡ cd (mod n),
Theorem 9.1.4 Multiplicative inverses in Zn . Let n ∈ Z+ and a ∈ Z.
Then there exists b ∈ Z with ab ≡ 1 (mod n) if and only if gcd(a, n) = 1.
39
Appendix A
Chapter 1 Introduction
Definition 1.1.2 Universe
Definition 1.1.3 Set, element
Definition 1.1.6 Standard sets
Definition 1.1.7 Function
Definition 1.1.8 Onto or surjection
Definition 1.1.9 One-to-one or injection
Definition 1.1.10 Bijection
40
APPENDIX A. LIST OF DEFINITIONS AND THEOREMS 41
Chapter 8 Relations
Definition 8.1.1 (binary) relation from A to B
Definition 8.1.2 (binary) relation on A
Definition 8.1.3 Converse of a relation
Definition 8.2.1 Reflexive, symmetric, antisymmetric and transitive relations
Definition 8.2.2 Partial order
Definition 8.2.3 Equivalence relation
Definition 8.3.1 Equivalence class of x
Theorem 8.3.2 An equivalence relation defines a partition
Theorem 8.3.3 A partition defines an equivalence relation
44
References
[1] Robert Craigen, Michelle Davidson, Local Notes, course notes, Winter
2021.
[2] Robert Borgersen, Robert Craigen, Michelle Davidson, Michael Doob,
Tyrone Ghaswala, Karen Gunderson, Edward Timko, MATH 1240 De-
finitions and Theorems, course notes, Winter 2019, Fall 2019, Winter
2020, Fall 2020.
[3] Michelle Davidson, Definitions and Theorems for MATH 1240 Fall 2021:
Also known as the (Math 1240) Local Notes, course notes, Fall 2021.
[4] Ralph P. Grimaldi, Discrete and combinatorial mathematics: an applied
introduction, Fifth edition, New York, N.Y., Pearson, 2017.
[5] David Gunderson, Tentative definitions and theorems for MATH 1240,
lecture notes, 10 January 2018.
45
Colophon
This book was authored in PreTeXt.
The Handshaking Lemma states that in any graph, the sum of the degrees of all vertices is equal to twice the number of edges, expressed as \( \sum_{v \in V} \deg(v) = 2|E| \). This lemma helps understand graphs by ensuring the balance of incidences in the graph structure, verifying that every edge contributes two degrees overall. It is often used to justify calculations related to network structure and confirm the consistency of vertex degrees and edge counts .
In graph theory, a regular graph is one where every vertex has the same degree. When a graph is k-regular, every vertex has the degree k exactly. The significance lies in their uniform edge distribution, which can simplify analysis and provide symmetries useful in applications like network design and symmetry operations. Regular graphs often have properties that make them easier to analyze mathematically, and understanding their structure helps in exploring connectivity and completeness in network models .
The principle of mathematical induction is a proof technique for establishing that a statement p(n) holds for all integers n greater than or equal to a specific value N. It involves two main steps: the base step, where the statement is proved for the initial value N, and the inductive step, where it is assumed that the statement holds for an arbitrary integer k, and from this assumption, it is shown that it holds for k + 1. This principle is foundational because it relies on the well-ordering of integers and allows for the establishment of properties across all integers from a base case and an inductive step .
A variable in a logical expression is bound if it is within the scope of a quantifier such as ∃x or ∀x, otherwise it is considered free. The distinction is crucial because if all variables in an open statement are bound by quantifiers, the expression is classified as a proposition, meaning it has a definite truth value, as opposed to an open statement, which does not have a truth value assigned without specific variable assignments .
A graph is defined as an ordered pair G = (V, E) where V is a non-empty set of vertices, and E is a set of unordered pairs of vertices called edges. A multigraph differs in that its edge set allows multiple occurrences of the same unordered pair of vertices. A directed graph, or digraph, is characterized by having a set of vertices and a set of ordered pairs of vertices (called directed edges or arcs), where the direction of connection between vertices is significant .
The order of quantifiers can significantly change the meaning of logical statements, especially when they are not of the same type. For instance, the statements ∀x∃y p(x, y) and ∃y∀x p(x, y) are distinct because the first implies that for every x there exists a y such that p(x, y) holds, whereas the second suggests there is a single y that works for all x. However, when quantifiers are of the same type, such as ∀x∀y or ∃x∃y, the order does not matter, and thus they are logically equivalent .
A bipartite graph is a graph whose vertices can be divided into two disjoint sets X and Y such that every edge connects a vertex in X to one in Y, and no edge connects two vertices within the same set. It can be identified by checking if the vertex set can indeed be partitioned into these two subsets without violating the edge-condition requirement. Graphs redrawn to visually display this partition with vertices from different sets typically placed in opposing columns can help verify the bipartite nature .
The Euclidean algorithm finds the greatest common divisor (GCD) by exploiting the property that gcd(a, b) = gcd(b, a mod b) for integers a and b. The process involves repeated calculations of the remainder of division until a remainder of zero is reached, with the last non-zero remainder being the GCD. This method is efficient because it reduces the size of the numbers rapidly through division, requiring only logarithmic time complexity relative to the number of digits in the smaller number, thus offering a quick computational approach to determining GCDs .
The power set of a set A, denoted P(A), is the collection of all subsets of A, including the empty set and A itself. The significance of its cardinality being 2 raised to the power of the cardinality of A lies in the fact that it ensures that each element of A can either be included or not included in a subset, corresponding to the binary choice (0 or 1) for each element, resulting in 2^|A| possible subsets .
In a regular mathematical induction proof, after establishing the base case, the inductive step assumes the statement is true for a particular n and proves it for n + 1. Strong induction, however, allows the assumption that the statement is true for all integers up to n (not just for a single n) when proving it for n + 1. Strong induction is preferred when the statement depends on multiple preceding cases rather than just the immediately preceding one, making it useful for problems like proving properties about sequences where each element depends on several previous ones .