Relations (See Chapter 2. of SN) : CISC-102
Relations (See Chapter 2. of SN) : CISC-102
Relations (See Chapter 2. of SN) : CISC-102
1 of 24
!
CISC-102
Fall 2017
Week 5
1
Week 5 page ! 2 of 24
!
Product sets
Let A and B be two arbitrary sets. The set of all ordered pairs (a,b) where a ∈ A and b ∈ B is
A × B = {(a,b) : a ∈ A and b ∈ B }
A “famous” example of a product set is R , that is the product of the Reals, or the two
2
2
Week 5 page ! 3 of 24
!
Relations
Definition: Let A and B be arbitrary sets. A binary relation, or simply a relation from A to B is a
subset of A × B.
A × B = {(a,b) : a ∈ A, and b ∈ B }
= {(1,1),(1,4),(1,6),(3,1),(3,4),(3,6),(6,1),(6,4)(6,6)}
Example: Consider the relation ≤ on A × B where A and B are defined above. The subset of A ×
{(1,1),(1,4),(1,6),(3,4),(3,6),(6,6)}
3
Week 5 page ! 4 of 24
!
Vocabulary
When we have a relation on S × S (which is a very common occurrence) we simply call it a
relation on S, rather than a relation on S × S.
R3 = {(1,3), (2,1)}
R4 = ∅
4
Week 5 page ! 5 of 24
!
An alternate way to define antisymmetric relations (as found in Schaum’s Notes) is:
then a1 = a2.
NOTE: There are relations that are neither symmetric nor antisymmetric or both symmetric and
antisymmetric.
Transitive: A relation R is transitive if whenever (a1, a2) ∈ R and (a2, a3) ∈ R then (a1, a3) ∈ R.
5
Week 5 page ! 6 of 24
!
R3 = {(1,3), (2,1)}
R4 = ∅
6
Week 5 page ! 7 of 24
!
Consider the relations <, ≤, and = on the Natural numbers. (less than, less than or equal to, equal
to)
The relation < on the Natural numbers {(a,b) : a,b ∈ N, a < b} is:
Functions as relations
If a & b are integers the quotient a/b may not be an integer. For example if c = 1/2, then c is not
an integer.
7
Week 5 page ! 8 of 24
!
We can say that there exists integers a,b such that c = a/b is not an integer.
We can also say that for all integers a,b, b ≠ 0, we have c = a/b is a rational number.
8
Week 5 page ! 9 of 24
!
Divisibility
Let a,b ∈ ℤ, a ≠ 0.
b
If c =
a is an integer,
or alternately if c ∈ ℤ such that b = ca
then we say that a divides b or equivalently,
b is divisible by a, and this is written
a∣b
Referring to the long division example, b = 32, is the divisor a = 487 is the dividend. The
quotient q = 15 and the remainder r = 7.
b∤a
and we can write a = bq + r or, 487 = (32) (15) + 7
a = bq + r, 0 ≤ r < | b |
9
Week 5 page ! 10 of 24
!
Notation
22 = (7)(3) + 1
but
-22 = (-7)(4) + 6.
10
Week 5 page 11
! of 24
!
Divisibility Theorems.
Proof:
(1) b = aj
( 2) c = bk
( 3) c = ajk
11
Week 5 page ! 12 of 24
!
Divisibility Theorems.
Proof:
Since a ∣ b there exists an integer j such that
ajc
It should be obvious that a ∣ ajc ( = jc is an integer)
a
so a | bc . ◻
12
Week 5 page ! 13 of 24
!
Divisibility Theorems.
Proof:
If a | b and b | a then | a | = | b |.
If a | 1 then | a | = 1.
13
Week 5 page ! 14 of 24
!
Prime Numbers
Definition: A positive integer p > 1 is called a prime number if its only divisors are 1, -1, and p, -
p.
Definition: If an integer c > 2 is not prime, then it is composite. Every composite number c can
be written as a product of two integers a,b such that a,b ∉ {1,-1, c, -c}.
14
Week 5 page ! 15 of 24
!
15
Week 5 page ! 16 of 24
!
Theorem: Every integer n > 1 is either prime or can be written as a product of primes.
For example:
12 = 2 × 2 × 3.
17 is prime.
90 = 2 × 5 × 3 × 3.
143 = 11 × 13.
147 = 3 × 7 × 7.
330 = 2 × 5 × 3 × 11.
48 = 24 × 3.
16
Week 5 page ! 17 of 24
!
Theorem: Every integer n > 1 is either prime or can be written as a product of primes.
Proof:
(1) Suppose there is an integer k > 1 that is the largest integer that is the product of primes.
This then implies that the integer k+1 is not prime or a product of primes.
(3) Observe that |a| < k+1 and |b| < k+1, because a | k+1 and b | k+1. We assume that k+1 is
the smallest positive integer that is not prime or the product of primes, therefore |a| and |b|
are prime or a product of primes.
(4) Since k+1 is a product of a and b it follows that it too is a product of primes.
(5) Thus we have contradicted the assumption that there is a largest integer that is the product of
primes, and we can therefore conclude that every integer n > 1 is either prime or written as a
product of primes. ◻
17
Week 5 page ! 18 of 24
!
Let P(n) be a proposition defined on a subset of the Natural numbers (b, b+1, b+2, ...) such that:
i) P(b) is true
(Base)
ii) Assume P(j) is true for all j, b ≤ j ≤ k.
(Induction Hypothesis)
iii) Use Induction Hypothesis to show that P(k+1) is true.
(Induction Step)
NOTE: Go back to all of the proofs using mathematical induction that we have seen so far and
replace the assumption
(1) Assume P(k) is true for k ≥ b. (b is the base case value) by
(2) Assume P(j) is true for all j, b ≤ j ≤ k.”
Assumption (2) above is stronger than assumption (1). Sometimes this form of induction is
called strong induction.
18
Week 5 page ! 19 of 24
!
Proof:
= 2(2k+1 ) 2
k+2
=2 2 ⧠
19
Week 5 page ! 20 of 24
!
Theorem: Every integer n > 1 is either prime or can be written as a product of primes.
Proof: (Mathematical Induction of the 2nd form) Let P(n) be the proposition that all natural
numbers n ≥ 2 are either prime or the product of primes.
(2) Observe that if k+1 is prime P(k+1) is true, so consider the case where k+1 is composite. That
is: k+1 = ab, a,b ∈ ℤ, a,b ∉ {1,-1, k+1, -(k+1)}.
(3) Therefore, |a| < k+1 and |b| < k+1.
So |a| and |b| are prime or a product of primes.
(4) Since k+1 is a product of a and b it follows that it too is a product of primes.
(5) Therefore, by the 2nd form of mathematical induction we can conclude that P(n) is true for
all n ≥ 2. ◻
20
Week 5 page ! 21 of 24
!
Well-Ordering Principle
In our initial proof that shows that integers greater than 2 are either prime or a product of primes
we assumed that if that wasn’t true for all integers greater than 2, then there was a smallest
integer where the proposition is false. (we called that integer k.) This statement may appear to be
obvious, but there is a mathematical property of the positive integers at play that makes this true.
Theorem: Well Ordering Principle: Let S be a non-empty subset of the positive integers. Then S
contains a least element, that is, S contains an element a ≤ s for all s ∈ S.
21
Week 5 page ! 22 of 24
!
NOTE: The Well Ordering Principle can be used to prove both forms of the Principle of
Mathematical Induction.
In essence the statement “use the proposition P(k) to show that P(k+1) is true” uses an
underlying assumption:
“Should there be a value of n where the proposition is false then there must be a smallest
value of n where the proposition is false”
In all of our induction proofs so far the value k+1 plays the role of that smallest value of n where
the proposition may be false. For all other values j, b ≤ j ≤ k, we can assume that P(j) is true. In
the induction step we show that P(k+1) is also true, in essence showing that there is no smallest
value of n where the proposition is false. And by well ordering this implies that the result is true
for all values of n.
22
Week 5 page ! 23 of 24
!
Theorem: There exists a prime greater than n for all positive integers n. (We could also say that
there are infinitely many primes.)
Proof: Consider y = n! and x = n! + 1. Let p be a prime divisor of x, such that p ≤ n. This implies
that p is also a divisor of y, because n! is the product of all natural numbers from 1 to n. So we
have p | x and p | y. According to one of the divisibility theorems we have
p | x - y. But x - y = 1 and the only divisor of 1 is -1, or 1, both not prime. So there are no prime
divisors of x less than n. And since every integer is either prime or a product if primes, we either
have x > n is prime, or there exists a prime p, p > n in the prime factorization of x. ◻
23
Week 5 page ! 24 of 24
!
(Proof by contradiction.)
Suppose there is a largest prime. So we can write down all of the finitely many primes as:
p ,p ,...,p
{ 1 2 !}.
Now let n = p 1 ⇥ p2 ⇥ · · · ⇥ p ! + 1 .
Observe that n must be larger the p! the largest prime. Therefore n is composite and is a
product of primes. Let pk denote a prime factor of n. Thus we have
pk ∣ n
We know that pk ∣ n and pk ∣ (n-1) implies that pk ∣ n - (n-1) or pk ∣ 1. But no integer divides 1
except 1, and 1 is not prime, so pk ∣ 1 is impossible, and raises a mathematical contradiction. This
p
implies that our assumption that ! is the largest prime is false, and so we conclude that there
is no largest prime. ◻
24