1
00:00:00,500 --> 00:00:05,370
So now we begin on four
classes on number theory.
2
00:00:05,370 --> 00:00:08,580
The purpose of taking it
up now is that we're still
3
00:00:08,580 --> 00:00:09,620
practicing proofs.
4
00:00:09,620 --> 00:00:14,920
And number theory is
a nice self-contained
5
00:00:14,920 --> 00:00:17,120
elementary subject
as we'll treat it,
6
00:00:17,120 --> 00:00:20,140
which has some
quite elegant proofs
7
00:00:20,140 --> 00:00:24,210
and illustrates contradiction
and other structures
8
00:00:24,210 --> 00:00:26,120
that we've learned about.
9
00:00:26,120 --> 00:00:29,270
A little bit of induction, and
definitely some applications
10
00:00:29,270 --> 00:00:32,350
of the well-ordering principle.
11
00:00:32,350 --> 00:00:35,200
The ultimate punchline
of the whole unit
12
00:00:35,200 --> 00:00:39,810
is to understand the RSA
crypto system and how it works.
13
00:00:39,810 --> 00:00:44,950
Along the way, we will--
today, actually-- establish
14
00:00:44,950 --> 00:00:46,870
one of those mother's
milk facts that we all
15
00:00:46,870 --> 00:00:49,550
take for granted about unique
factorization of integers
16
00:00:49,550 --> 00:00:51,140
into primes.
17
00:00:51,140 --> 00:00:52,630
But in fact, that's
a theorem that
18
00:00:52,630 --> 00:00:56,880
merits some proof as an
example, and the homework
19
00:00:56,880 --> 00:01:01,490
shows where we exhibited
a system of numbers
20
00:01:01,490 --> 00:01:03,850
which didn't factor uniquely.
21
00:01:03,850 --> 00:01:07,670
And finally, we will be able
to knock off the Die Hard
22
00:01:07,670 --> 00:01:09,630
story once and for all.
23
00:01:13,850 --> 00:01:18,780
So let's begin by stating
the rules of the game.
24
00:01:18,780 --> 00:01:21,980
We're going to assume all
of the usual algebraic rules
25
00:01:21,980 --> 00:01:24,500
for addition and
multiplication and subtraction.
26
00:01:24,500 --> 00:01:26,790
So you may know
some of these rules
27
00:01:26,790 --> 00:01:28,500
have names like
the first equality
28
00:01:28,500 --> 00:01:32,650
is called distributivity of
multiplication over plus--
29
00:01:32,650 --> 00:01:36,170
of times over plus-- and
then the second rule here
30
00:01:36,170 --> 00:01:39,970
is called commutativity
of multiplication,
31
00:01:39,970 --> 00:01:43,260
and here are some
more familiar rules.
32
00:01:43,260 --> 00:01:46,160
This is called associativity
of multiplication.
33
00:01:46,160 --> 00:01:48,950
This is called the
additive identity.
34
00:01:48,950 --> 00:01:52,620
a minus a is 0-- or
actually additive inverse.
35
00:01:52,620 --> 00:01:58,100
0 is the additive identity and
minus a is the inverse of a.
36
00:01:58,100 --> 00:02:02,810
a plus 0 equals a is
the definition of 0
37
00:02:02,810 --> 00:02:05,060
being an additive identity.
38
00:02:05,060 --> 00:02:06,320
a plus 1 is greater than a.
39
00:02:06,320 --> 00:02:08,330
So these are all
standard algebraic facts
40
00:02:08,330 --> 00:02:10,705
that we're going to take for
granted and not worry about.
41
00:02:10,705 --> 00:02:14,000
And one more fact that
we also know and we're
42
00:02:14,000 --> 00:02:19,170
going to take as an
axiom, if I divide
43
00:02:19,170 --> 00:02:21,000
a positive number-- sorry.
44
00:02:21,000 --> 00:02:25,060
If I divide a number a
by a positive number b,
45
00:02:25,060 --> 00:02:28,650
then when we're talking about
integers, what I'm going to get
46
00:02:28,650 --> 00:02:30,310
is a quotient and a remainder.
47
00:02:30,310 --> 00:02:32,860
What's the definition of the
quotient and a remainder?
48
00:02:32,860 --> 00:02:36,430
Well, the division
theorem says that if I
49
00:02:36,430 --> 00:02:42,110
divide a by b, that means if
I take the quotient times b
50
00:02:42,110 --> 00:02:44,621
plus the remainder I get a.
51
00:02:44,621 --> 00:02:48,380
And in fact, there's a
unique quotient of a/b
52
00:02:48,380 --> 00:02:51,490
and there's a unique
remainder of a/b
53
00:02:51,490 --> 00:02:53,910
where the remainder--
what makes it unique
54
00:02:53,910 --> 00:02:56,410
is the remainder is
constrained to be
55
00:02:56,410 --> 00:02:58,570
in the interval greater
than or equal to 0
56
00:02:58,570 --> 00:03:02,950
and less than the divisor b.
57
00:03:02,950 --> 00:03:05,745
So we're going to take
this fact for granted too.
58
00:03:08,620 --> 00:03:11,627
Proving it is not worth
thinking about too hard,
59
00:03:11,627 --> 00:03:14,210
because it's one of those facts
that's so elementary that it's
60
00:03:14,210 --> 00:03:18,410
hard to think of other things
that would more legitimately
61
00:03:18,410 --> 00:03:18,910
prove it.
62
00:03:18,910 --> 00:03:20,300
I'm sure it could be
proved by induction,
63
00:03:20,300 --> 00:03:22,180
but I haven't really
thought that through.
64
00:03:22,180 --> 00:03:22,680
OK.
65
00:03:24,980 --> 00:03:28,280
A key relation that we're
going to be looking at today
66
00:03:28,280 --> 00:03:31,950
is the relation of
divisibility between integers.
67
00:03:31,950 --> 00:03:34,740
So by the way, all of the
variables for the next week
68
00:03:34,740 --> 00:03:39,060
or so are going to be understood
to range over the integers.
69
00:03:39,060 --> 00:03:41,070
So when I say number,
I mean integer.
70
00:03:41,070 --> 00:03:43,710
When I talk about
variables a and c and k,
71
00:03:43,710 --> 00:03:46,650
I mean that they're
taking integer values.
72
00:03:46,650 --> 00:03:49,940
So I'm going to define c divides
a using this vertical bar
73
00:03:49,940 --> 00:03:50,560
notation.
74
00:03:50,560 --> 00:03:55,260
It's read as divides. c
divides a if and only if a is
75
00:03:55,260 --> 00:03:57,980
equal to k times c for some k.
76
00:04:00,960 --> 00:04:05,690
And there are a variety
of synonyms for a divides
77
00:04:05,690 --> 00:04:10,960
b, like-- a is a-- a
divides c-- sorry--
78
00:04:10,960 --> 00:04:17,010
c divides a is to say
that a is a multiple of c
79
00:04:17,010 --> 00:04:21,220
and c is a divisor of a.
80
00:04:21,220 --> 00:04:22,019
OK.
81
00:04:22,019 --> 00:04:23,060
Let's just practice this.
82
00:04:23,060 --> 00:04:24,470
So 5 divides 15?
83
00:04:24,470 --> 00:04:28,800
Well, because 15 is 3 times 5.
84
00:04:28,800 --> 00:04:30,550
A number n divides 0.
85
00:04:30,550 --> 00:04:31,970
Every number n divides 0.
86
00:04:31,970 --> 00:04:37,800
Even 0 divides 0, because
0 is equal to 0 times n.
87
00:04:37,800 --> 00:04:42,410
So 0 is a multiple
of every number.
88
00:04:42,410 --> 00:04:45,890
Another trivial fact that
follows from the definition
89
00:04:45,890 --> 00:04:50,640
is that if c divides a, then c
divides any constant times a.
90
00:04:50,640 --> 00:04:52,380
Well, let's just
check that out, how
91
00:04:52,380 --> 00:04:55,180
it follows from the definition.
92
00:04:55,180 --> 00:04:57,270
If I'm given that
c divides a, that
93
00:04:57,270 --> 00:05:01,190
means that a is equal to k
prime c for some k prime.
94
00:05:01,190 --> 00:05:05,780
That implies that if I multiply
both sides of this equality
95
00:05:05,780 --> 00:05:09,650
by s, I get that s a is
equal to s k prime c,
96
00:05:09,650 --> 00:05:13,980
and if I parenthesize the s k
prime, I can call that to be k,
97
00:05:13,980 --> 00:05:18,190
and I have found, sure enough,
that s a is a multiple of c.
98
00:05:18,190 --> 00:05:20,570
That's a trivial proof,
but we're just practicing
99
00:05:20,570 --> 00:05:21,445
with the definitions.
100
00:05:25,710 --> 00:05:28,870
So we have just
verified this fact
101
00:05:28,870 --> 00:05:33,036
that if c divides a, then c
divides a constant times a.
102
00:05:33,036 --> 00:05:35,450
As a matter of fact,
if c divides a and c
103
00:05:35,450 --> 00:05:39,140
divides b, then c
divides a plus b.
104
00:05:39,140 --> 00:05:42,090
Let's just check that one.
105
00:05:42,090 --> 00:05:51,650
What we've got is c
divides a means that a
106
00:05:51,650 --> 00:05:54,290
is equal to k1 times c.
107
00:05:54,290 --> 00:06:00,380
And c divides b means that
b is equal to k2 times c.
108
00:06:00,380 --> 00:06:04,960
So that means that a plus b
is simply k1 plus k2 times
109
00:06:04,960 --> 00:06:12,400
c, where what I've done here
is used the distributivity law
110
00:06:12,400 --> 00:06:15,800
to factor c out and used
the fact that multiplication
111
00:06:15,800 --> 00:06:19,810
is commutative so that I can
factor out on either side.
112
00:06:19,810 --> 00:06:21,730
OK.
113
00:06:21,730 --> 00:06:23,620
Let's put those facts together.
114
00:06:23,620 --> 00:06:28,457
If c divides a and c divides
b, then c divides s a plus t
115
00:06:28,457 --> 00:06:31,770
b, where s and t are
any integers are all.
116
00:06:31,770 --> 00:06:35,520
So a combination of two
numbers, a and b, like this
117
00:06:35,520 --> 00:06:37,590
is called a linear
combination of a and b--
118
00:06:37,590 --> 00:06:39,716
an integer linear combination,
but since we're only
119
00:06:39,716 --> 00:06:41,090
talking about
integers, I'm going
120
00:06:41,090 --> 00:06:42,990
to stop saying integer
linear combination
121
00:06:42,990 --> 00:06:44,880
and just say linear combination.
122
00:06:44,880 --> 00:06:46,960
A linear combination
of a and b is
123
00:06:46,960 --> 00:06:51,580
what you get by of multiplying
them by coefficients s and t
124
00:06:51,580 --> 00:06:53,970
and adding.
125
00:06:53,970 --> 00:06:54,470
OK.
126
00:06:54,470 --> 00:06:56,230
So we've just figured
out that in fact
127
00:06:56,230 --> 00:06:58,920
if c divides a and
c divides b, then
128
00:06:58,920 --> 00:07:01,670
c divides an integer
linear combination of b.
129
00:07:01,670 --> 00:07:05,850
When c divides two numbers,
it's called a common divisor
130
00:07:05,850 --> 00:07:07,450
of those two numbers.
131
00:07:07,450 --> 00:07:10,060
So we could rephrase
this observation
132
00:07:10,060 --> 00:07:14,550
by saying common divisors
of a and b divide integer
133
00:07:14,550 --> 00:07:18,535
linear combinations of a
and b, which is a good fact
134
00:07:18,535 --> 00:07:21,320
to just file away in your head.
135
00:07:21,320 --> 00:07:23,320
Now, what we're going
to be focusing on
136
00:07:23,320 --> 00:07:28,100
for the rest of today is
the concept of the greatest
137
00:07:28,100 --> 00:07:32,260
common divisor of a and be,
called the GCD of a and b.
138
00:07:32,260 --> 00:07:34,720
The greatest common
divisor of a and b
139
00:07:34,720 --> 00:07:37,390
exists by the
well-ordering principle,
140
00:07:37,390 --> 00:07:40,640
because it's a set of
non-negative integers
141
00:07:40,640 --> 00:07:43,070
with an upper bound.
142
00:07:43,070 --> 00:07:46,580
Namely, a is an upper bound
on the greatest common divisor
143
00:07:46,580 --> 00:07:47,350
of a and b.
144
00:07:51,480 --> 00:07:55,190
So as we did in
an exercise, or I
145
00:07:55,190 --> 00:07:58,720
think in the text, that implies
that there will be the greatest
146
00:07:58,720 --> 00:08:00,470
one among all the
common divisors,
147
00:08:00,470 --> 00:08:01,990
assuming there are any.
148
00:08:01,990 --> 00:08:04,230
But 1 is always
a common divisor,
149
00:08:04,230 --> 00:08:08,460
so there are
guaranteed to be some.
150
00:08:08,460 --> 00:08:11,030
Let's look at some examples.
151
00:08:11,030 --> 00:08:13,327
The greatest common
divisor of 10 and 12.
152
00:08:13,327 --> 00:08:13,910
You can check.
153
00:08:13,910 --> 00:08:15,600
It's 2.
154
00:08:15,600 --> 00:08:19,720
Mainly because 10 factors
into 2 times 5 and 12 factors
155
00:08:19,720 --> 00:08:27,690
into 2 times 6, and the 6 and
the 5 have no common factors.
156
00:08:27,690 --> 00:08:30,900
So the only one that
they share is 2.
157
00:08:30,900 --> 00:08:34,780
The GCD of 13 and 12 is 1.
158
00:08:34,780 --> 00:08:37,630
They have no common
factors in common.
159
00:08:37,630 --> 00:08:39,580
You can see that
because 13 is a prime,
160
00:08:39,580 --> 00:08:45,554
and so it has no factors
other than 1 and 13,
161
00:08:45,554 --> 00:08:49,050
and 13 doesn't divide
12 because it's too big.
162
00:08:49,050 --> 00:08:50,300
So it's got to be 1.
163
00:08:53,000 --> 00:08:55,174
The GCD of 17 and 17 is 17.
164
00:08:55,174 --> 00:08:56,340
That's a general phenomenon.
165
00:08:56,340 --> 00:08:59,460
The GCD of n and n is always n.
166
00:08:59,460 --> 00:09:03,950
The greatest common
divisor of 0 and n
167
00:09:03,950 --> 00:09:07,060
is equal to n for
any positive n.
168
00:09:07,060 --> 00:09:10,710
That's because everything
is a divisor of 0
169
00:09:10,710 --> 00:09:13,650
and it means the GCD
of 0 and n is simply
170
00:09:13,650 --> 00:09:18,060
the greatest divisor of n,
which is of course n by itself.
171
00:09:18,060 --> 00:09:22,140
One final fact to set things
up for the next segment
172
00:09:22,140 --> 00:09:25,610
is to think about the GCD
of a prime and a number,
173
00:09:25,610 --> 00:09:28,600
and it's either 1 or p.
174
00:09:28,600 --> 00:09:31,190
The reason is that the
only divisors of a prime
175
00:09:31,190 --> 00:09:33,250
are plus/minus 1
and plus/minus p.
176
00:09:33,250 --> 00:09:40,810
So if p divides a, the GCD is
p, and otherwise the GCD is 1.