Basic . definitions:Parity. An . integer. n is called . even. . if, and only if. , . there exists . an integer k such that . n = 2*k. .. An integer n is called . odd. if, and only if, . it is not even.. ID: 667928
DownloadNote  The PPT/PDF document "Number Theory and Techniques of Proof" is the property of its rightful owner. Permission is granted to download and print the materials on this web site for personal, noncommercial use only, and to display it on your personal computer provided you do not modify the materials and that you retain all copyright notices contained in the materials. By downloading content from our website, you accept the terms of this agreement.
Number Theory
and Techniques of Proof
Slide2Basic
definitions:Parity
An
integer
n is called
even
if, and only if
,
there exists
an integer k such that
n = 2*k
.
An integer n is called
odd
if, and only if,
it is not even.
Corollary: An integer n is called odd if, and only if, there exists an integer k such that
n = 2*k + 1
The property of an integer as being either odd or even is known as its
parity
.
Slide3Arguing the positive: Universal Statements
Let’s consider the following statement:
“The sum of an odd and an even integer is odd.”
Slide4Arguing the positive: Universal Statements
Let’s consider the following statement:
“The sum of an odd and an even integer is odd.”
Do you believe this statement?
Yes
No
Slide5Arguing the positive: Universal Statements
Let’s consider the following statement:
“The sum of an odd and an even integer is odd.”
Do you believe this statement?
If you believe it,
you have to try to prove
that it’s
true (argue the positive/affirmative)
Yes
No
Slide6Proof, take 1
Claim to be proven
true
(we argue its
affirmative):
“The sum of an odd and an even integer is odd.”Proof:Let
be
any odd integer.
Then,
Let
be
any even integer.
Then, (2)By (1) and (2), we have that (3). We set . Clearly, . (4)Substituting (4) into (3) yields: + 1, which means that is odd.End of proof.
Slide7
Proof, take 1
Claim to be proven
true
(we argue its
affirmative):
“The sum of an odd and an even integer is odd.”Proof:Let
be
any odd integer.
Then,
Let
be
any even integer.
Then, (2)By (1) and (2), we have that (3). We set . Clearly, . (4)Substituting (4) into (3) yields: + 1, which means that is odd.End of proof.
WHOOPS
!
What does this proof actually prove?
Slide8Proof, take 1
Claim to be proven
true
(we argue its
affirmative):
“The sum of an odd and an even integer is odd.”Proof:Let
be
any odd integer.
Then,
Let
be
any even integer.
Then, (2)By (1) and (2), we have that (3). We set . Clearly, . (4)Substituting (4) into (3) yields: + 1, which means that is odd.End of proof.
WHOOPS
!
What does this proof actually prove?
It proves that two
consecutive
integers sum to an odd number!
Slide9Proof, take 2
Claim to be proven
true
(we argue its
affirmative):
“The sum of an odd and an even integer is odd.”Proof:Let
be
any odd integer.
Then,
Let
be
any even integer.
Then, (2)By (1) and (2), we have that (3). We set . Clearly, is an integer. (4)Substituting (4) into (3) yields:
+ 1, which means that
is odd.
End of proof.
Slide10
Mathematical claims and theorems can be stated in various different ways!
Statements of claims / theorems
“The sum of an odd and an even integer is odd.”
“
Any two
integers of
opposite parity
sum to an
odd
number”
“
Every pair of
integers of
opposite parity
sum
s to an odd number”
Slide11
Statements of claims / theorems
Mathematical claims and theorems can be stated in various different ways!
Other ideas?
“The sum of an odd and an even integer is odd.”
“
Any two
integers of
opposite parity
sum to an
odd
number”
“
Every pair of
integers of
opposite parity
sums to an odd number”
Slide12Your turn, class!
Let’s split into teams and prove the following claims
true
:
The square of an odd integer is also odd.
If
is an integer, then
is even.
Slide13
Arguing the affirmative of
existential
statements
Two methods:
Constructive
NonConstructive
In “constructive” proofs we either
explicitly show or construct an element of the domain that answers our query.In
nonconstructive
proofs (very rare in this class) we prove that
it is a logical necessity
for such an element to exist!
But we neither explicitly, nor implicitly, show or construct such an element!
Slide14Our first constructive proof
Claim
: There exists a natural number that you
cannot
write as a sum of three squares of natural numbers.
Slide15Constructive proofs in Number Theory (and one nonconstructive one)
Slide16Our first constructive proof
Claim
: There exists a natural number that you
cannot
write as a sum of three squares of natural numbers.
Examples of numbers you
can write as a sum of three squares:
Try to find a number that
cannot
be
written as such.
Slide17
Proof
The natural number 7 cannot be written as the sum of three squares.
This we can prove by case analysis:
Can’t use 3, since
Can’t use
more than once, since
So, we can use 2, one or zero times.
If we use 2 once, we have
If we use 2 zero times, the maximum value is
Slide18
Your turn, class!
Let’s split in teams and prove the following theorems:
There exists an integer
that can be written in two ways as a sum of two prime numbers.
There is a
perfect square
that can be written as a sum of two other
perfect squares.
Suppose
. Then, (
There exists an integer
that can be written in two ways as a sum of two cubed integers.
(Hard)
Slide19
Your turn, class!
Let’s split in teams and prove the following theorems:
There exists an integer
that can be written in two ways as a sum of two prime numbers.
There is a
perfect square
that can be written as a sum of two other
perfect squares.
Suppose
. Then,
(
There exists an integer
that can be written in two ways as a sum of two cubed integers.
(Hard)
How is the 3rd proof different from the others?
Slide20Our first (and last?) nonconstructive proof
Theorem
: There exists a pair of
irrational
numbers
and
such that
is a
rational
number.
Proof
: Let
. Since
is irrational,
and
are both irrational. Is rational? Two cases:If is rational, then we have proven the result. Done.If is irrational, then we will name it . Then, observe that is rational, since . Since both and are irrationals, but is rational, we are done.
Slide21Divisibility
Let
and
. Then, we say or denote any one of the following:
d
divides
n
n
is divided by
d
d

n
d is a
divisor (or factor) of nn is a multiple of dif, and only if, We sometimes call k the quotient of the division of n by d.If d does not divide n, we denote that by (note the small strikethrough)
Slide22Pop Quizzes
3  6
Yes
No
Slide23Pop Quizzes
3  6
Y
6  3
Yes
No
Slide24Pop Quizzes
3  6
Y
6  3
N
10  10
Yes
No
Slide25Pop Quizzes
3  6
Y
6  3
N
10  10
Y
10
10
Yes
No
Slide26Pop Quizzes
3  6
Y
6  3
N
10  10
Y
10
10
N
5  0
Yes
No
Slide27Pop Quizzes
3  6
Y
6  3
N
10  10
Y
10
10
N
5  0
Y
0  5
Yes
No
Slide28Pop Quizzes
3  6
Y
6  3
N
10  10
Y
10
10
N
5  0
Y
0  5 N
Yes
No
Slide29Pop Quizzes
3  6
Y
6  3
N
10  10
Y
10
10
N
5  0
Y
0  5 N
N (
YesNo
Slide30Pop Quizzes
3  6
Y
6  3
N
10  10
Y
10
10
N
5  0
Y
0  5 N
N (
N (any nonzero integer divides 0) YesNo
Slide31Universal claims with divisibility
Let’s all try to prove the
affirmative
of this claim:
Slide32
Universal claims with divisibility
Let’s all try to prove the
affirmative
of this claim:
Proof:
From (1) and (2), we have that
So
Done.
Slide33
Proof by contradiction
Sometimes, proving a fact
directly
is tough.
In such cases, we can attempt an
indirect
proofThe most common type of indirect proof is
proof by contradictionBriefly: We want to prove a fact , so we assume
and hope that we reach a contradiction (a
falsehood
).
Example: We will prove that if a prime number divides an integer
, it cannot possible divide
.
Slide34
Proofs by contradiction in Number Theory
Slide35First proof by contradiction
Claim: Let
Then, if
, then
Slide36
First proof by contradiction
Claim: Let
Then, if
, then
Proof:
Assume that
. Then, this means that
(I)
We already know that
(II)
Substituting (II) into (I) yields:
which is a
contradiction
. Therefore,
Slide37
Infinitude of primes
Assume that the primes are finite. Then, we can list them in ascending order:
Slide38
Infinitude of primes
Assume that the primes are finite. Then, we can list them in ascending order:
Let’s create the number
Slide39
Infinitude of primes
Clearly,
is bigger than any
. We have two cases:
N
is prime. Contradiction, since
is bigger than any prime.
N
is composite. This means that N has at least one factor
. Let’s take the smallest factor of
N,
and call it
.
Then, this number is prime (why?)
Since
is prime, it divides . By the previous theorem, this means that it cannot possibly divide . Contradiction, since we assumed that is a factor of N.Therefore, the primes are not finite.
Slide40Modular Arithmetic
Slide41Modular Arithmetic
We say that
(read
“a is congruent to b mod m”)
means that
.
Examples:
Convention:
THINK: Take large number
divide by
, remainder is
Terminology: “Reducing
Slide42
vs
In Logic,
mean that
and
have the same truth table
(are logically equivalent)
In Number Theory,
, read
“a is
congruent
to b mod m”) means !
Slide43vs
In Logic,
mean that
and
have the same truth table
(are logically equivalent)
In Number Theory,
, read
“a is
congruent
to b mod m”) means !THESE TWO ARE VERY DIFFERENT!!!! THEY HAVE NOTHING TO DO WITH EACH OTHER!
Slide44Properties of equivalence
If
and
, then:
Slide45
Properties of equivalence
If
and
, then:
Proof:
(I)
Similarly,
(II)
Therefore, by (I) and (II) we have:
Slide46
Properties of equivalence
If
and
, then
Slide47
Properties of equivalence
If
and
, then
Proof: For you to figure out. Might be in:
Homework
Quiz
Midterm 1
Midterm 2
Final
Any combination of the above
How many possibilities are there?
Slide48
First proof revisited
Recall that we proved that the sum of an even and an odd integer is odd.
Note that:
If
is even (so 2 divides it), then
If
is
odd, then
So now we can redo the proof with modular arithmetic!
Slide49
Proof with modular arithmetic
Claim: Any two integers of opposite parity sum to an odd number.
Proof:
Since
,
are opposite parity,
without loss of generality
, assume that
and
Using the
properties of modular arithmetic
, we obtain:
Done.
Slide50
More proofs
Similarly, you can show that
Slide51
More proofs
Similarly, you can show that
Proof:
is
throughout to save space.
We have two cases:
Then,
. Done.
. Then,
. Done.
Slide52
Advantages of this notation
Theorem (clumsy): If
is such that when you divide x by 4 you get a remainder of 2, and
is such that when you divide y by 4 you get a remainder of 3, then when you divide
by 4 you get a remainder of 2.
Slide53
Advantages of this notation
Theorem (clumsy): If
is such that when you divide x by 4 you get a remainder of 2, and
is such that when you divide y by 4 you get a remainder of 3, then when you divide
by 4 you get a remainder of 2.
THIS SOUNDS AWFUL!
Slide54
Advantages of this notation
Theorem (clumsy): If
is such that when you divide x by 4 you get a remainder of 2, and
is such that when you divide y by 4 you get a remainder of 3, then when you divide
by 4 you get a remainder of 2.
THIS SOUNDS AWFUL!
Theorem
(elegant): If
and
, then
4).
Slide55
Advantages of this notation
Theorem (clumsy): If
is such that when you divide x by 4 you get a remainder of 2, and
is such that when you divide y by 4 you get a remainder of 3, then when you divide
by 4 you get a remainder of 2.
THIS SOUNDS AWFUL!
Theorem
(elegant): If
and
, then
4).
Proof:
All
are mod 4. Then:
Slide56
Proofs by contrapositive in Number Theory
Slide57Proof by contraposition
Applicable to all kinds of statements of type:
Slide58
Proof by contraposition
Applicable to all kinds of statements of type:
Sometimes, proving the implication in this way is
hard
.
On the other hand, proving its
contrapositive
might be easier:
Slide59
Examples
Proving this
directly
is somewhat
hard
On the other hand, the contrapositive is child’s (or 250 student’s) play:
]
Slide60
Examples
Proving this
directly
is somewhat
hard
On the other hand, the contrapositive is child’s (or 250 student’s) play:
Proof: Since
, we have that
So,
Slide61
Another example
If
, then
Slide62
Another example
If
, then
Proof (contrapositive):
Cases (all
are mod 5):
0
Done.
Slide63
A historical proof by contradiction
Slide64Proof that
is irrational
Let’s assume BY WAY OF CONTRADICTION that
is rational.
So
and
do not have common factors.
So
so
(1)
By the previous theorem,
this means that
S
o
for some integer . (2)Substituting (2) into (1) yields: So both and are both even, have common factor of 2.Contradiction.
Slide65Proof that
is irrational
Let’s assume BY WAY OF CONTRADICTION that
is rational.
So
and
do not have common factors.
So
so
(1)
By the previous theorem,
this means that
S
o
for some integer . (2)Substituting (2) into (1) yields: So both and are both even, have common factor of 5.Contradiction.
Slide66Proof that
is irrational (???)
Why can we
not
use this machinery to prove that
is irrational (which is wrong anyway)?
Slide67
Using the Unique Factorization Theorem
Slide68Unique Factorization: examples
There is no other way to factor 91
into a product of primes.
Once again, no other way to factor 18 into a product of primes.
Since
is prime, there is trivially no other way to factor it into primes.
prime or not?
Slide69
Unique Factorization: examples
There is no other way to factor 91
into a product of primes.
Once again, no other way to factor 18 into a product of primes.
Since
is prime, there is trivially no other way to factor it into primes.
prime or not?
Nope!
(1049 is prime)
Slide70
Statement of Theorem
Every number
can be
uniquely
factored into a product of prime numbers
like so:
Proving
existence
is
easy (Jason)
Proving
uniqueness
is
hard (Bill)
Slide71
What is “uniqueness”?
By “uniqueness” we mean that the product is unique
up to reordering of the factors
.
Examples:
Slide72
Proof of
with PFT
Proof (once again by contradiction): Assume that
, so
Slide73
Proof of
with PFT
Proof (once again by contradiction): Assume that
, so
Let
be the
largest
integer such that
(By UPFT)
Similarly, let
be the
largest
integer such that
(By UPFT)
Slide74Proof of
with UFT
Proof (once again by contradiction):
Assume that
, so
Since
Slide75
Proof of
with UFT
Since
Let
be the
largest
integer such that
Let
be the
largest
integer such that
Since
are largest
ints, and are odd, so odd (we proved this)
=
Even number of 2s on left side, odd number of 2s on right
Contradiction.
Slide76
Proof of
with UFT
Proof (by contradiction)
Assume that
Let
be
the largest integers
such that
.
Clearly,
, so
(make sure you’re convinced)
Even number of 5s on the left, odd on the right.
Contradiction.
Slide77
Proof that
(???) with UFT
Why can we
not
use this machinery to prove that
is irrational (which is wrong anyway)?
Slide78
Speed of Computations
in Number Theory
Slide79Basic assumptions
and
have
unit cost
This is not true if
are
too large
Jason
:
Do you mean
bits or something?
Bill:
Nobody cares, just say “large”.
Slide80
First problem
How fast can we compute
Obviously, we can compute
and
mod that large number by
.
Slide81
First problem
How fast can we compute
Obviously, we can compute
and
mod that large number by
.
Is this algorithm ?
Good
Bad
Ugly
Slide82
First problem
How fast can we compute
Obviously, we can compute
and
mod that large number by
.
Is this algorithm ?
Good
Bad
Ugly
Because:
Jason:
Numbers can get above 32 bits, and that’s a storage and computation problem.
Bill: Numbers get “too freaking large”.
Slide83First
problem, second approach
We could start computing
until the product becomes larger than
, reduce and repeat until we’re done.
Slide84
First
problem, second approach
We could start computing
until the product becomes larger than
, reduce and repeat until we’re done.
Is this better?
Yes
No
Something Else
Slide85First
problem, second approach
We could start computing
until the product becomes larger than
, reduce and repeat until we’re done.
Is this better?
Yes
No
Something Else
We no longer produce huge numbers!
However, we still need
multiplications.
Slide86
First problem
How fast can we compute
We always need
steps
We can do it in roughly
steps
We can do it in roughly
steps
Something Else
Slide87First problem
How fast can we compute
We always need
steps
We can do it in roughly
steps
We can do it in roughly
steps
Something Else
Slide88Example
Computing
in
steps.
All
are
(mod 99).
Slide89
Example
Computing
in
steps.
All
are
(mod 99).
Aha!
Slide90
Good news, bad news
Good news: By using
repeated squaring
, can compute
quickly (roughly
steps)
Bad news: What if our
exponent
is
not
a power of 2?
Slide91
Example
Computing
with the same method
All
are
(mod 99).
Slide92
Example (contd.)
To avoid large numbers, reduce product as you go:
Slide93
Algorithm to compute
in
log
steps
Step 1: Write
,
Step 2: Note that
Step 3: Use
repeated squaring
to compute:
using
Step 4: Compute
mod m reducing when necessary to avoid large numbers
Slide94
The key step
The key step is Step #3:
Use repeated squaring to compute:
using
When computing
mod m,
already have
computed
Note that all numbers are below
because we reduce mod m every step of the way
So
is
unit cost
and
anything mod m
is also unit cost!
Slide95Second problem: Greatest Common Divisor (GCD)
If
, then the GCD of
is the
largest
nonzero integer
such that
and
Slide96
Second problem: Greatest Common Divisor (GCD)
If
, then the GCD of
is the
largest
nonzero integer
such that
and
What is the GCD of
…
and 15?
Slide97
Second problem: Greatest Common Divisor (GCD)
If
, then the GCD of
is the
largest
nonzero integer
such that
and
What is the GCD of
…
and 15?
5
12 and 90?
Slide98
Second problem: Greatest Common Divisor (GCD)
If
, then the GCD of
is the
largest
nonzero integer
such that
and
What is the GCD of
…
and 15?
5
12 and 90?
620 and 29?
Slide99Second problem: Greatest Common Divisor (GCD)
If
, then the GCD of
is the
largest
nonzero integer
such that
and
What is the GCD of
…
and 15?
5
12 and 90?
620 and 29? 1 (20 and 29 are called coprime or relatively prime)153 and 181
Slide100Second problem: Greatest Common Divisor (GCD)
If
, then the GCD of
is the
largest
nonzero integer
such that
and
What is the GCD of
…
and 15?
5
12 and 90?
620 and 29? 1 (20 and 29 are called coprime or relatively prime)153 and 181 17
Slide101Euclid’s GCD algorithm
Recall: If
and
then
The GCD algorithm finds the
greatest
common divisor by executing this recursion (assume a > b):
Until its arguments are the same.
Slide102
Greatest Common Divisor (GCD)
Recall: If
and
then
The GCD algorithm finds the
greatest
common divisor by executing this recursion (assume
a > b
):
Until its arguments are the same.
Question: If we implement this in a programming language,
it can only be done recursively
Yes
(why)No (Why)Something Else(What)
Slide103Greatest Common Divisor (GCD)
Recall: If
and
then
The GCD algorithm finds the
greatest
common divisor by executing this recursion:
Until its arguments are the same.
Question: If we implement this in a programming language,
it can only be done recursively
Yes
(why)
No
(Why)Something Else(What)left = a;right = b;while(left != right){ if(left > right) left = left – right; else right = right  left;}print "GCD is: " left; // Or rightTail recursion
Slide104GCD example
GCD(18, 100) =
GCD(18, 100
–
18) = GCD(18, 82)=
GCD(18, 82 – 18 = GCD(18, 64) =
GCD(18, 64 – 18) = GCD(18, 46) = GCD(18, 46 – 18) = GCD(18, 28) =GCD(18, 28
–
18) = GCD(18, 10) =
GCD(18  10, 10) = GCD(8, 10)=
GCD(8, 10  8)= GCD(8, 2) =
GCD(8  2, 2) = GCD(6, 2) =GCD(6  2, 2) = GCD(4, 2) = GCD(4 2, 2) = GCD(2, 2) = 2
Slide105GCD example
GCD(18
, 100) =
GCD(18, 100
–
18) = GCD(18, 82)=GCD(18, 82 – 18 = GCD(18, 64) =
GCD(18, 64 – 18) = GCD(18, 46) = GCD(18, 46 – 18) = GCD(18, 28) =GCD(18, 28 –
18) = GCD(18, 10) =
GCD(18  10, 10) = GCD(8, 10)=
GCD(8, 10  8)= GCD(8, 2) =
GCD(8  2, 2) = GCD(6, 2) =
GCD(6  2, 2) = GCD(4, 2) = GCD(4 2, 2) = GCD(2, 2) = 2
Given integers
with
(without loss of generality), approximately how many steps does this algorithm take? a stepsb stepsSomething Elseab steps
Slide106GCD example
GCD(18
, 100) =
GCD(18, 100
–
18) = GCD(18, 82)=GCD(18, 82 – 18 = GCD(18, 64) =
GCD(18, 64 – 18) = GCD(18, 46) = GCD(18, 46 – 18) = GCD(18, 28) =GCD(18, 28 –
18) = GCD(18, 10) =
GCD(18  10, 10) = GCD(8, 10)=
GCD(8, 10  8)= GCD(8, 2) =
GCD(8  2, 2) = GCD(6, 2) =
GCD(6  2, 2) = GCD(4, 2) = GCD(4 2, 2) = GCD(2, 2) = 2
Given integers
with
(without loss of generality), approximately how many steps does this algorithm take? a stepsb stepsSomething Elseab stepsRoughly
Slide107Can we do better?
GCD(18
, 100) =
GCD(18, 100
–
18) = GCD(18, 82)=GCD(18, 82 – 18 = GCD(18, 64) =
GCD(18, 64 – 18) = GCD(18, 46) = GCD(18, 46 – 18) = GCD(18, 28) =GCD(18, 28 –
18) = GCD(18, 10) =
GCD(18  10, 10) = GCD(8, 10)=
GCD(8, 10  8)= GCD(8, 2) =
GCD(8  2, 2) = GCD(6, 2) =
GCD(6  2, 2) = GCD(4, 2) = GCD(4 2, 2) = GCD(2, 2) = 2
Yes
No
Something Else
Slide108Can we do better?
GCD(18
, 100) =
GCD(18, 100
–
18) = GCD(18, 82)=GCD(18, 82 – 18 = GCD(18, 64) =
GCD(18, 64 – 18) = GCD(18, 46) = GCD(18, 46 – 18) = GCD(18, 28) =GCD(18, 28 –
18) = GCD(18, 10) =
GCD(18  10, 10) = GCD(8, 10)=
GCD(8, 10  8)= GCD(8, 2) =
GCD(8  2, 2) = GCD(6, 2) =
GCD(6  2, 2) = GCD(4, 2) = GCD(4 2, 2) = GCD(2, 2) = 2
Yes
No
Something ElseGCD(18, 100 – 5 x 18)GCD(8 – 3 x 2, 2)GCD(18, 100) = GCD(18, 100 – 5 x 18) = GCD(18, 10) = GCD(18 – 10, 10) = GCD(8, 10) = GCD(8, 10  8) = GCD(8, 2) = GCD(8 – 3 x 2, 2) = GCD(2, 2) = 2From 10 to 4 steps!
Slide109How fast is this new algorithm?
Given nonzero integers
with
,
roughly how many steps does this new algorithm take to compute GCD(a, b
)?
loga
Something Else
Slide110How fast is this new algorithm?
Given nonzero integers
with
,
roughly how many steps does this new algorithm take to compute GCD(a, b
)?
In fact, it takes
, where
is the
golden ratio.
Proof by Gabriel Lam
é
in 1844,
considered
to
be the first ever result in Algorithmic Complexity theory. logaSomething Else
Today's Top Docs
Related Slides