-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.tex
6045 lines (5579 loc) · 227 KB
/
test.tex
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
% One and only one of the next two lines should be uncommented
% \documentclass{test} % for making book
\documentclass[compact]{test} % for making handout for students
\usepackage{testtext} % for the text only; answers-only is another .sty
\usepackage{etoolbox}
\usepackage{comment}
\newbool{euclid}
% \booltrue{euclid} % Euclid's proof of Euclid's Lemma
\boolfalse{euclid} % Bezout proof of Euclid's Lemma
\ifbool{euclid}{
\includecomment{euclidproof}
\excludecomment{bezoutproof}
}{
\excludecomment{euclidproof}
\includecomment{bezoutproof}
}
\frontmatter
\begin{document}
\coverpage{}
\include{flyleaf}
\ifbool{optioncompact}{}{\include{preface}}
\mainmatter
\pagestyle{bodypage}
\chapter{Number Theory}
We begin with results about the integers $\Z=\set{\ldots,-2,-1,0,1,2,\ldots}$.
In this chapter ``number'' means integer.
Some statements refer to the natural numbers $\N=\set{0,1,2,\ldots}$.
% .....................................
\section{Divisibility}
\begin{df}
For two integers $d,n$ we say that
$d$ \definend{divides}~$n$
if there is an integer~$k$ such that $d\cdot k=n$.
Here, $d$~is the \definend{divisor},
$n$~is the \definend{dividend},
and~$k$ is the \definend{quotient}.
(Alternative wordings are:
$d$~\definend{is a factor of}~$n$,
or $d$~\definend{goes evenly into}~$n$,
or $n$~\definend{is a multiple of}~$d$.)
We denote the relationship as
$d\divides n$ if $d$~is a divisor of~$n$
or as $d\ndivides n$ if it is not.
\end{df}
\begin{df}
A natural number is \definend{even} if it is divisible by~$2$,
otherwise it is \definend{odd}.
(Alternative wording is that the number \definend{has even parity}
or \definend{has odd parity}.)
\end{df}
The notation $d\divides n$ signifies a relationship between two numbers.
It is different than the fraction $d/n$, which is a number.
We can sensibly ask ``Does $2$ divide~$5$?''\spacefactor=1000\
but ``Does $2/5$?''\spacefactor=1000\ is not sensible.
\begin{problem} \notetext{Interaction of parity and sign}
\label{ex:InteractionOfParityWithSign}
\pord.
\begin{exes}
\begin{exercise}
If a number is even then its negative is even.
\end{exercise}
\begin{answer}
If $n\in\Z$ is even then $n=2k$ for some $k\in\Z$.
Then $-n=2\cdot(-k)$ shows that the negative is also even.
\end{answer}
\begin{exercise}
If a number is odd then its negative is odd.
\end{exercise}
\begin{answer}
With the prior item in mind we first show that a number is even
if and only if its negative is even.
Suppose that a number $n\in\Z$ has a negative $-n$ that is even.
Since the negative of $-n$ is~$n$, the prior item shows that $n$ is even.
Thus $n$ is even if and only if $-n$ is even, and therefore
if $n$ is not even then $-n$ is also not even.
\end{answer}
\begin{exercise}
If $d\divides a$ then $-d\divides a$ and $d\divides -a$.
\end{exercise}
\begin{answer}
Assume that $d\divides a$ for $d,a\in\Z$, so that
$a=dk$ for some~$k\in\Z$.
For the first, that $-d\divides a$, observe that
$a=(-d)\cdot(-k)$.
For the second, observe that $-a=d\cdot(-k)$.
\end{answer}
\begin{exercise}
If $d\divides a$ then $d\divides\absval{a}$.
(Recall that the absolute value of a number $\absval{a}$ is~$a$
if $a\geq 0$ and is~$-a$ if $a<0$.)
\end{exercise}
\begin{answer}
Suppose that $d\divides a$.
For the $a\geq 0$ case, the implication that if $d\divides a$ then
$d\divides a$ is trivial.
For the $a<0$ case,
the implication that if $d\divides a$ then $d\divides -a$ was
proved in the prior item.
\end{answer}
\end{exes}
\end{problem}
\begin{problem} \notetext{Interaction of parity and addition}
\pord.
\begin{exes}
\begin{exercise}
The sum of two evens is even.
The difference of two evens is even.
\end{exercise}
\begin{answer}
Let $a,b\in\Z$ be even so that $a=2m$ and~$b=2n$ for some $m,n\in\Z$.
Then $a+b=2m+2n=2(m+n)$ is even, and $a-b=2m-2n=2(m-n)$ is even.
\end{answer}
\begin{exercise}
The sum of two odds is odd.
The difference of two odds is odd.
\end{exercise}
\begin{answer}
Both statements are false: for instance $1$ and~$3$ are odd
but both $1+3$ and~$1-3$ are even.
\end{answer}
\begin{exercise}
Where $a,b\in\Z$, the number $a+b$ is even if and only if $a-b$ is even.
\end{exercise}
\begin{answer}
First suppose that the sum is even, so $a+b=2k$ for some $k\in\Z$.
Then $a-b=a+b-2b=2k-2b=2(k-b)$ is even.
The other half is similar:
if $a-b=2m$ for $m\in\Z$ then $a+b=a-b+2b=2k+2b$ is even.
\end{answer}
\begin{exercise}
Generalize the first item to arbitrary divisors~$d$.
\end{exercise}
\begin{answer}
A reasonable generalization is that for any $d\in\Z$
the sum and difference of multiples of~$d$ is again a multiple of~$d$.
For a proof
let $a,b\in\Z$ be multiples of~$d$ so that $a=dm$ and~$b=dn$
for some $m,n\in\Z$.
Then $a+b=dm+dn=d(m+n)$ is a multiple of~$d$
and $a-b=dm-dn=d(m-n)$ is multiple of~$d$.
\end{answer}
% \item The sum of two evens is even.
% The difference of two evens is even.
% \item The sum of two odds is odd.
% The difference of two odds is odd.
% \item Where $a,b\in\Z$, the number $a+b$ is even if and only if $a-b$ is even.
% \item Generalize the first item to arbitrary divisors~$d$.
% \end{exes}
% \begin{ans}
% \begin{exes}
% \item Let $a,b\in\Z$ be even so that $a=2m$ and~$b=2n$ for some $m,n\in\Z$.
% Then $a+b=2m+2n=2(m+n)$ is even, and $a-b=2m-2n=2(m-n)$ is even.
% \item Both statements are false: for instance $1$ and~$3$ are odd
% but both $1+3$ and~$1-3$ are even.
% \item First suppose that the sum is even, so $a+b=2k$ for some $k\in\Z$.
% Then $a-b=a+b-2b=2k-2b=2(k-b)$ is even.
% The other half is similar:
% if $a-b=2m$ for $m\in\Z$ then $a+b=a-b+2b=2k+2b$ is even.
% \item A reasonable generalization is that for any $d\in\Z$
% the sum and difference of multiples of~$d$ is again a multiple of~$d$.
% For a proof
% let $a,b\in\Z$ be multiples of~$d$ so that $a=dm$ and~$b=dn$
% for some $m,n\in\Z$.
% Then $a+b=dm+dn=d(m+n)$ is a multiple of~$d$
% and $a-b=dm-dn=d(m-n)$ is multiple of~$d$.
\end{exes}
\end{problem}
\begin{problem} \notetext{Interaction of parity and multiplication}
\pord.
\begin{exes}
\begin{exercise}
The product of two evens is even.
\end{exercise}
\begin{answer}
Let $a,b\in\Z$ be even
so that $a=2m$ and~$b=2n$ for some $m,n\in\Z$.
Then $ab=2m\cdot 2n=2(m\cdot 2n)$ is even.
\end{answer}
\begin{exercise}
The quotient of two evens, if it is an integer, is even.
\end{exercise}
\begin{answer}
This is false since both $6$ and~$2$ are even but the quotient $6/2$
is not even.
\end{answer}
\begin{exercise}[\midlength]
Generalize the first item to any divisor~$d$.
\end{exercise}
\begin{answer}
The first item can generalize to: for any~$d\in\N$,
the product of two multiples of~$d$ is a multiple of~$d$.
For the proof, let $a,b\in\Z$ be multiples of~$d$
so that $a=dm$ and~$b=dn$ for some $m,n\in\Z$.
Then $ab=dm\cdot dn=d(m\cdot dn)$ is a multiple of~$d$.
(The first item can also generalize to: a product of two multiples of
$d$ is a multiple of~$d^2$.)
\end{answer}
% \item The product of two evens is even.
% \item The quotient of two evens, if it is an integer, is even.
% \item Generalize the first item to any divisor~$d$.
% \end{exes}
% \begin{ans}
% \begin{exes}
% \item Let $a,b\in\Z$ be even
% so that $a=2m$ and~$b=2n$ for some $m,n\in\Z$.
% Then $ab=2m\cdot 2n=2(m\cdot 2n)$ is even.
% \item This is false since both $6$ and~$2$ are even but the quotient $6/2$
% is not even.
% \item The first item can generalize to: for any~$din\N$,
% the product of two multiples of~$d$ is a multiple of~$d$.
% For the proof, let $a,b\in\Z$ be multiples of~$d$
% so that $a=dm$ and~$b=dn$ for some $m,n\in\Z$.
% Then $ab=dm\cdot dn=d(m\cdot dn)$ is a multiple of~$d$.
% (The first item can also generalize to: a product of two multiples of
% $d$ is a multiple of~$d^2$.)
\end{exes}
\end{problem}
\begin{problem} \notetext{Divisibility Properties}
\label{ex:DivisibilityProperties}
Let $d$, $m$, and $n$ be integers.
Prove each.
\begin{exes}
\begin{exercise}
\notetext{Reflexivity} Every number divides itself.
\end{exercise}
\begin{answer}
Any number $a\in\Z$ satisfies that $a=a\cdot 1$.
\end{answer}
\begin{exercise}
Every number divides $0$ while
the only number that $0$ divides is itself.
\end{exercise}
\begin{answer}
For every $k\in\Z$ the equation~$0=k\cdot 0=0\cdot k$ has~$0$
as a multiple of~$k$.
That equation also shows that the only number that~$0$ divides is itself.
\end{answer}
\begin{exercise}
\notetext{Transitivity} If $d\divides n$ and $n\divides m$
then $d\divides m$.
\end{exercise}
\begin{answer}
Suppose that $d, n, m\in\Z$ are such that $d\divides n$ and
$n\divides m$.
Then there are $i,j\in\Z$ such that $n=di$ and~$m=nj$.
Substitute to get $m=(di)\cdot j=d\cdot(ij)$, which shows that
$d$ divides~$m$.
\end{answer}
\begin{exercise}
\notetext{Cancellation}
For $d,n\in\Z$, if for some nonzero integer~$a$ we have that $ad\divides an$
then $d\divides n$.
Conversely, if $d\divides n$ then $ad\divides an$ for all~$a\in\Z$.
\end{exercise}
\begin{answer}
Fix~$d,n\in\Z$.
First suppose that $ad\divides an$ for some $a\in\Z$ such that $a\neq 0$.
Then $an=adk$ for some $k\in\Z$ and
since $a\neq 0$ we can multiply by $1/a$ to get $n=dk$, giving
$d\divides n$.
For the converse,
if $d\divides n$ then $n=dk$ for some $k\in\Z$ and for all~$a\in\Z$
we have $an=adk$, which shows that $ad\divides an$.
\end{answer}
\begin{exercise}
\notetext{Comparison}
For $d,n\in\Z^+$, if $n$ is a multiple of~$d$ then $n\geq d$.
\end{exercise}
\begin{answer}
Assume $d,n\in\Z^+$.
Because $n$ is a multiple of $d$ we have that $n=dk$ for some $k\in\Z$.
Note that $k\geq 1$ since otherwise $n\leq 0$ but $n$ is given as positive.
Multiplying by the positive number~$d$ gives $n=dk\geq d$.
\end{answer}
\begin{exercise}
Every number is divisible by $1$.
The only numbers that divide~$1$ are $1$ and~$-1$.
\end{exercise}
\begin{answer}
That every number is divisible by~$1$ follows from the fact that
for every $a\in\Z$ the equation $a=1\cdot a$ holds.
For the other part
first consider a divisor~$d$ of~$1$ that is a positive integer.
By the prior item $1\geq d$ so the only such divisor is~$d=1$.
Clearly $0$ is not a divisor of~$1$ so the only remaining candidates
are negative integers.
We have shown that for $d,a\in\Z$, if $d\divides a$ then $-d\divides a$,
so if a negative number~$d$ divides~$1$ then the positive~$-d$
also divides~$1$.
Since the only such positive number is~$-d=1$, the only
candidate for a negative divisor is $d=-1$.
\end{answer}
\begin{exercise}
The largest divisor of $a$ is $\absval{a}$, for $a\in\Z$ with $a\neq 0$.
\end{exercise}
\begin{answer}
Fix $a\in\Z$.
First note that $\absval{a}$ does indeed divide~$a$ because
if $a\geq 0$ then $\absval{a}\divides a$ follows from
$a=\absval{a}\cdot 1$,
while if $a<0$ then $\absval{a}\divides a$ follows from
$a=\absval{a}\cdot(-1)$.
We finish by showing that no divisor of~$a\neq 0$ is larger than $\absval{a}$.
We have shown that for $d,a\in\Z$ if $d\divides a$ then $d\divides -a$,
if a negative~$a$ had a divisor greater than~$\absval{a}$ then the
positive number~$-a$ would also have such a divisor.
So we will be done if
we show there is no dividend~$a>0$ with a divisor larger than $\absval{a}=a$.
By the Comparison property, a positive dividend is greater than or
equal to any of its divisors.
Thus~$\absval{a}$ is maximal.
\end{answer}
\begin{exercise}
Every nonzero integer has only finitely many divisors.
\end{exercise}
\begin{answer}
By the prior item if $a\neq 0$ then all of the divisors of~$a$
are in the interval of integers from $-a$ to~$a$.
\end{answer}
% \item \notetext{Reflexivity} Every number divides itself.
% \item Every number divides $0$ while
% the only number that $0$ divides is itself.
% \item \notetext{Transitivity} If $d\divides n$ and $n\divides m$
% then $d\divides m$.
% \item \notetext{Cancellation}
% For $d,n\in\Z$, if for some nonzero integer~$a$ we have that $ad\divides an$
% then $d\divides n$.
% Conversely, if $d\divides n$ then $ad\divides an$ for all~$a\in\Z$.
% \item \notetext{Comparison}
% For $d,n\in\Z^+$, if $n$ is a multiple of~$d$ then $n\geq d$.
% \item Every number is divisible by $1$.
% The only numbers that divide~$1$ are $1$ and~$-1$.
% \item The largest divisor of $a$ is $\absval{a}$, for $a\in\Z$ with $a\neq 0$.
% \item Every nonzero integer has only finitely many divisors.
% \end{exes}
% \begin{exes}
% \item Any number $a\in\Z$ satisfies that $a=a\cdot 1$.
% \item For every $k\in\Z$ the equation~$0=k\cdot 0=0\cdot k$ has~$0$
% as a multiple of~$k$.
% That equation also shows that the only number that~$0$ divides is itself.
% \item Suppose that $d, n, m\in\Z$ are such that $d\divides n$ and
% $n\divides m$.
% Then there are $i,j\in\Z$ such that $n=di$ and~$m=nj$.
% Substitute to get $m=(di)\cdot j=d\cdot(ij)$, which shows that
% $d$ divides~$m$.
% \item Fix~$d,n\in\Z$.
% First suppose that $ad\divides an$ for some $a\in\Z$ such that $a\neq 0$.
% Then $an=adk$ for some $k\in\Z$ and
% since $a\neq 0$ we can multiply by $1/a$ to get $n=dk$, giving
% $d\divides n$.
% For the converse,
% if $d\divides n$ then $n=dk$ for some $k\in\Z$ and for all~$a\in\Z$
% we have $an=adk$, which shows that $ad\divides an$.
% \item Assume $d,n\in\Z^+$.
% Because $n$ is a multiple of $d$ we have that $n=dk$ for some $k\in\Z$.
% Note that $k\geq 1$ since otherwise $n\leq 0$ but $n$ is given as positive.
% Multiplying by the positive number~$d$ gives $n=dk\geq d$.
% \item That every number is divisible by~$1$ follows from the fact that
% for every $a\in\Z$ the equation $a=1\cdot a$ holds.
% For the other part
% first consider a divisor~$d$ of~$1$ that is a positive integer.
% By the prior item $1\geq d$ so the only such divisor is~$d=1$.
% Clearly $0$ is not a divisor of~$1$ so the only remaining candidates
% are negative integers.
% We have shown that for $d,a\in\Z$, if $d\divides a$ then $-d\divides a$,
% so if a negative number~$d$ divides~$1$ then the positive~$-d$
% also divides~$1$.
% Since the only such positive number is~$-d=1$, the only
% candidate for a negative divisor is $d=-1$.
% \item Fix $a\in\Z$.
% First note that $\absval{a}$ does indeed divide~$a$ because
% if $a\geq 0$ then $\absval{a}\divides a$ follows from
% $a=\absval{a}\cdot 1$,
% while if $a<0$ then $\absval{a}\divides a$ follows from
% $a=\absval{a}\cdot(-1)$.
% We finish by showing that no divisor of~$a\neq 0$ is larger than $\absval{a}$.
% We have shown that for $d,a\in\Z$ if $d\divides a$ then $d\divides -a$,
% if a negative~$a$ had a divisor greater than~$\absval{a}$ then the
% positive number~$-a$ would also have such a divisor.
% So we will be done if
% we show there is no dividend~$a>0$ with a divisor larger than $\absval{a}=a$.
% By the Comparison property, a positive dividend is greater than or
% equal to any of its divisors.
% Thus~$\absval{a}$ is maximal.
% \item By the prior item if $a\neq 0$ then all of the divisors of~$a$
% are in the interval of integers from $-a$ to~$a$.
\end{exes}
\end{problem}
\begin{problem}
Give the converse of Reflexivity: what conclusion can you make
if $a\divides b$ and~$b\divides a$?
\begin{ans}
We will show that for $a,b\in\Z$, if both $a\divides b$ and~$b\divides a$
then $a=\pm b$.
By definition $a\divides b$ and~$b\divides a$ implies that $b=ak$
and $a=bm$ for some $k,m\in\Z$.
Substitution gives $a=bm=akm$ and then cancellation gives $1=km$ (cancellation
does not apply if $a=0$ but in this case the proof is easy).
The only divisors of $1$ are $1$ and~$-1$, so $k=\pm 1$ and~$m=\pm 1$.
Thus $b=\pm a$ and~$a=\pm b$.
\end{ans}
\end{problem}
\begin{problem} \label{ex:DividesAndLinearCombinations}
Suppose that $a,b,c\in\Z$.
\begin{exes}
\begin{exercise}
Prove that if $a\divides b$ then $a\divides bc$ for all integers~$c$.
\end{exercise}
\begin{answer}
If $a\divides b$ then $b=ak$ for some~$k\in\Z$.
Thus $bc=akc=a\cdot(kc)$ is a multiple of~$a$.
\end{answer}
\begin{exercise}
Prove that if $a\divides b$ and $a\divides c$ then $a$ divides the
sum~$b+c$ and difference~$b-c$.
\end{exercise}
\begin{answer}
Suppose that $a,b,c\in\Z$ and that $a\divides b$ and $a\divides c$.
Then $b=ak$ and $c=am$ for some $k,m\in\Z$.
Substitution
$b+c=ak+am=a\cdot(k+m)$
shows that $a$ divides the sum~$b+c$.
A similar substitution
$b-c=ak-am=a\cdot(k-m)$
shows that $a$ divides the difference.
\end{answer}
\begin{exercise} % Needed for Bezout's Lemma
\notetext{Linearity} Generalize the prior item.
\end{exercise}
\begin{answer}
A natural generalization is that $a$ divides any combination
$i\cdot b+j\cdot c$ where $i,j\in\Z$.
The proof is
$ib+jc=i\cdot (ak)+j\cdot(am)=a\cdot(ik+jm)$.
\end{answer}
\end{exes}
% \begin{exes}
% \item Prove that if $a\divides b$ then $a\divides bc$ for all integers~$c$.
% \item Prove that if $a\divides b$ and $a\divides c$ then $a$ divides the
% sum~$b+c$ and difference~$b-c$.
% \item \notetext{Linearity} Generalize the prior item.
% \end{exes}
% \begin{ans}
% \begin{exes}
% \item If $a\divides b$ then $b=ak$ for some~$k\in\Z$.
% Thus $bc=akc=a\cdot(kc)$ is a multiple of~$a$
% \item Suppose that $a,b,c\in\Z$ and that $a\divides b$ and $a\divides c$.
% Then $b=ak$ and $c=am$ for some $k,m\in\Z$.
% Substitution
% $b+c=ak+am=a\cdot(k+m)$
% shows that $a$ divides the sum~$b+c$.
% A similar substitution
% $b-c=ak-am=a\cdot(k-m)$
% shows that $a$ divides the difference.
% \item A natural generalization is that $a$ divides any combination
% $i\cdot b+j\cdot c$ where $i,j\in\Z$.
% The proof is
% $ib+jc=i\cdot (ak)+j\cdot(am)=a\cdot(ik+jm)$.
% \end{exes}
% \end{ans}
\end{problem}
% .....................................
\section{Interlude: induction}
Results in the prior section need only proof techniques that are natural
for people with a mathematical aptitude.
However some results to follow require a technique
that is less natural, mathematical induction.
This section is a pause for an introduction to induction.
We will start with exercises about summations
(note, though, that induction is not about summation;
we use these only because they make helpful initial exercises).
For example, many people have noticed that the odd natural numbers sum to
perfect squares: $1+3=4$, $1+3+5=9$, $1+3+5+7=16$, etc.
We will prove the statement,
``The sum $1+3+5+\cdots+(2n+1)$ equals $(n+1)^2$.''
That statement has a natural number variable~$n$ that is free,
meaning that setting $n$ to be $0$, or~$1$, etc., gives
a family of cases: $S(0)$, or~$S(1)$,
etc.
For instance, the statement $S(1)$ asserts that $1+3$ equals $2^2$.
Our induction proofs will all involve statements with one free
natural number variable.
These proofs have two steps.
For the \definend{base step}
we will show that the statement holds for some intial number~$i\in\N$.
The \definend{inductive step} is more subtle;
we will show that the following implication holds.
\begin{equation*}
\begin{tabular}{l}
\textit{If} the statement holds from the
base number up to and including $n=k$ \\
\hspace*{0.618em}\textit{then} the statement holds also in the~$n=k+1$ case.
\end{tabular}
\tag{$*$}
\end{equation*}
The \definend{Principle of Mathematical Induction} is that
completing both steps proves
that the statement is true for all natural
numbers greater than or equal to~$i$:
that $S(i)$ is true, and~$S(i+1)$ is true, etc.
For the example statement about odd numbers and squares,
the intuition behind the principle is first that the base step
directly verifies the statement for the case of the initial number~$n=0$.
Then because the inductive step verifies the implication~($*$) for all $k$,
that implication applied to~$k=0$ gives
that the statement is true for the case of the number~$n=1$.
Now, with the statement established for both $0$ and~$1$,
apply ($*$) again to conclude that the statement is true for the number~$n=2$.
In this way, induction bootstraps to all natural numbers~$n\geq 0$.
Below is an induction argument for the example statement,
with separate paragraphs for the base step and the inductive step.
\begin{proof}
We show that $1+3+\cdots+(2n+1)=(n+1)^2$ by induction.
For the $n=0$ base step note that on the left the sum has a single term, $1$,
which equals the value on the right, $1^2$.
For the inductive step assume that the
formula is true for $n=0$, $n=1$, \ldots, $n=k$, and
consider the $n=k+1$ case.
The sum is $1+3+\cdots+(2k+1)+(2(k+1)+1)=1+3+\cdots+(2k+1)+(2k+3)$.
By the inductive hypothesis the statement is true in the $n=k$ case
so we can substitute
$1+3+\cdots+(2k+1)+(2k+3)=(k+1)^2+(2k+3)=(k^2+2k+1)+(2k+3)=(k+2)^2$.
This is the required expression for the $n=k+1$~case.
\end{proof}
\begin{problem}
Prove by induction.
\begin{exes}
\begin{exercise}
$0+1+2+\cdots+n=n(n+1)/2$
\end{exercise}
\begin{answer}
For the $n=0$ base step note that the sum on the left
has the single term~$0$
while the right side is $0\cdot(0+1)/2$, which also equals~$0$.
For the inductive step take the inductive hypothesis
that the statement is true for $n=0$,~\ldots, $n=k$ and consider $n=k+1$.
We have
$0+1+\cdots+k+(k+1)=(k(k+1)/2)+(k+1)=(k+1)\cdot(k/2+1)=(k+1)\cdot(k+2)/2$,
as required
(the first equality is from applying the inductive hypothesis in
the $n=k$ case).
\end{answer}
\begin{exercise}
$0+1+4+9+\cdots+n^2=n(n+1)(2n+1)/6$
\end{exercise}
\begin{answer}
The $n=0$ base step is that the left side has the single term~$0$
while the right side is $0\cdot(0+1)\cdot(2\cdot 0+1)/6$, and the
two are equal.
For the inductive step assume that the statement is true for
$n=0$,~\ldots, $n=k$ and consider $n=k+1$.
Applying the inductive hypothesis in the $n=k$ case and reducing gives
$0+1+4+\cdots+k^2+(k+1)^2=k(k+1)(2k+1)/6+(k+1)^2
=(k+1)\cdot [k(2k+1)/6+(k+1)]
=(k+1)\cdot [k(2k+1)+6(k+1)]/6
=(k+1)\cdot [2k^2+7k+6]/6
=(k+1)(k+2)(2(k+1)+1)/6$,
as required.
\end{answer}
% \begin{exercise}
% $0+1+8+27+\cdots+n^3=n^2(n+1)^2/4$
% \end{exercise}
% \begin{answer}
% The base step is~$n=0$.
% The left side has the single term $0$ while the right side is
% $0^2(1)^2/4$, so they are equal.
% For the inductive step assume that the statement is true when $n=0$,
% \ldots, $n=k$.
% Then
% $0+8+\cdots+k^3+(k+1)^3
% =k^2(k+1)^2/4+(k+1)^3
% =(k+1)^2\cdot [(k^2/4)+(k+1)]
% =(k+1)^2\cdot (k^2+4k+4)/4
% =(k+1)^2(k+2)^2/4$.
% \end{answer}
\begin{exercise}
$1+2+4+8+\cdots+2^n=2^{n+1}-1$
\end{exercise}
\begin{answer}
The $n=0$ base step has a sum on the left with a single term, $1$.
The expression on the right is $2^1-1=1$, and they are equal.
The inductive hypothesis is that
the statement is true for the cases $n=0$, \ldots, $n=k$.
The $n=k+1$ summation is
$1+2+4+\cdots+2^k+2^{k+1}$.
Apply the inductive hypothesis to get
$(2^{k+1}-1)+2^{k+1}=2\cdot 2^{k+1}-1=2^{k+2}-1$, as required.
\end{answer}
\end{exes}
% \begin{exes}
% \item $0+1+2+\cdots+n=n(n+1)/2$
% \item $0+1+4+9+\cdots+n^2=n(n+1)(2n+1)/6$
% % \item $0+1+8+27+\cdots+n^3=n^2(n+1)^2/4$
% \item $1+2+4+8+\cdots+2^n=2^{n+1}-1$
% \end{exes}
% \begin{ans}
% \begin{exes}
% \item For the $n=0$ base step note that the sum on the left
% has the single term~$0$
% while the right side is $0\cdot(0+1)/2$, which also equals~$0$.
% For the inductive step take the inductive hypothesis
% that the statement is true for $n=0$,~\ldots, $n=k$ and consider $n=k+1$.
% We have
% $0+1+\cdots+k+(k+1)=(k(k+1)/2)+(k+1)=(k+1)\cdot(k/2+1)=(k+1)\cdot(k+2)/2$,
% as required
% (the first equality is from applying the inductive hypothesis in
% the $n=k$ case).
% \item The $n=0$ base step is that the left side has the single term~$0$
% while the right side is $0\cdot(0+1)\cdot(2\cdot 0+1)/6$, and the
% two are equal.
% For the inductive step assume that the statement is true for
% $n=0$,~\ldots, $n=k$ and consider $n=k+1$.
% Applying the inductive hypothesis in the $n=k$ case and reducing gives
% $0+1+4+\cdots+k^2+(k+1)^2=k(k+1)(2k+1)/6+(k+1)^2
% =(k+1)\cdot [k(2k+1)/6+(k+1)]
% =(k+1)\cdot [k(2k+1)+6(k+1)]/6
% =(k+1)\cdot [2k^2+7k+6]/6
% =(k+1)(k+2)(2(k+1)+1)/6$,
% as required.
% % \item The base step is~$n=0$.
% % The left side has the single term $0$ while the right side is
% % $0^2(1)^2/4$, so they are equal.
% % For the inductive step assume that the statement is true when $n=0$,
% % \ldots, $n=k$.
% % Then
% % $0+8+\cdots+k^3+(k+1)^3
% % =k^2(k+1)^2/4+(k+1)^3
% % =(k+1)^2\cdot [(k^2/4)+(k+1)]
% % =(k+1)^2\cdot (k^2+4k+4)/4
% % =(k+1)^2(k+2)^2/4$.
% \item The $n=0$ base step has a sum on the left with a single term, $1$.
% The expression on the right is $2^1-1=1$, and they are equal.
% The inductive hypothesis is that
% the statement is true for the cases $n=0$, \ldots, $n=k$.
% The $n=k+1$ summation is
% $1+2+4+\cdots+2^k+2^{k+1}$.
% Apply the inductive hypothesis to get
% $(2^{k+1}-1)+2^{k+1}=2\cdot 2^{k+1}-1=2^{k+2}-1$, as required.
% \end{exes}
% \end{ans}
\end{problem}
\begin{problem}
Prove each by induction. Suppose that $a,b\in\R$ and that $r\in\R$ with $r\neq 1$.
\begin{exes}
\begin{exercise} \notetext{Geometric Series}
$1+r+r^2+\cdots+r^n=(r^{n+1}-1)/(r-1)$
\end{exercise}
\begin{answer}
The $n=0$ base step has the single term~$1$ in the left summation and
$(r^1-1)/(r-1)$ on the right, and they are equal.
For the inductive step assume that the statement is true for
$n=0$, \ldots, $n=k$.
The $n=k+1$ case is
$1+r+r^2+r^3+\cdots+r^k+r^{k+1}
=(r^{k+1}-1)/(r-1)+r^{k+1}
=[r^{k+1}-1+r^{k+1}(r-1)]/(r-1)
=[r\cdot r^{k+1}-1]/(r-1)
=(r^{k+2}-1)/(r-1)$ for $r\neq 1$.
\end{answer}
\begin{exercise} \notetext{Arithmetic Series}
$b+(a+b)+(2a+b)+\cdots+(na+b)=(n(n+1)/2)\cdot a+(n+1)\cdot b$
\end{exercise}
\begin{answer}
The base step is~$n=0$.
The summation on the left has one term, $b$,
while the expression on the right is
$0\cdot a+1\cdot b$, so the two sides are equal.
For the inductive step assume that the statement holds when $n=0$,
\ldots, $n=k$ and consider the $n=k+1$~case.
We have
$b+(a+b)+(2a+b)+\cdots+(ka+b)+((k+1)a+b)
=[(k(k+1)/2)\cdot a+(k+1)\cdot b]+((k+1)a+b)
=[(k+1)\cdot((k/2)+1)]\cdot a+[k+2]\cdot b
=((k+1)(k+2)/2)\cdot a+(k+2)\cdot b$,
as required.
\end{answer}
\end{exes}
% \item \notetext{Geometric Series} For all $r\in\R$ with $r\neq 1$ we have
% $1+r+r^2+\cdots+r^n=(r^{n+1}-1)/(r-1)$.
% \item \notetext{Arithmetic Series} We have
% $b+(a+b)+(2a+b)+\cdots+(na+b)=(n(n+1)/2)\cdot a+(n+1)\cdot b$
% for all $a,b\in\R$.
% \end{exes}
% \begin{ans}
% \begin{exes}
% \item The $n=0$ base step has the single term~$1$ in the left summation and
% $(r^1-1)/(r-1)$ on the right, and they are equal.
% For the inductive step assume that the statement is true for
% $n=0$, \ldots, $n=k$.
% The $n=k+1$ case is
% $1+r+r^2+r^3+\cdots+r^k+r^{k+1}
% =(r^{k+1}-1)/(r-1)+r^{k+1}
% =[r^{k+1}-1+r^{k+1}(r-1)]/(r-1)
% =[r\cdot r^{k+1}-1]/(r-1)
% =(r^{k+2}-1)/(r-1)$ for $r\neq 1$.
% \item The base step is~$n=0$.
% The summation on the left has one term, $b$,
% while the expression on the right is
% $0\cdot a+1\cdot b$, so the two sides are equal.
% For the inductive step assume that the statement holds when $n=0$,
% \ldots, $n=k$ and consider the $n=k+1$~case.
% We have
% $b+(a+b)+(2a+b)+\cdots+(ka+b)+((k+1)a+b)
% =[(k(k+1)/2)\cdot a+(k+1)\cdot b]+((k+1)a+b)
% =[(k+1)\cdot((k/2)+1)]\cdot a+[k+2]\cdot b
% =((k+1)(k+2)/2)\cdot a+(k+2)\cdot b$,
% as required.
% \end{exes}
% \end{ans}
\end{problem}
\begin{problem}
Prove by induction that $n<2^n$ for all $n\in\N$.
\begin{ans}
The $n=0$ base case is that $0$ is less than~$2^0$, which is clear.
For the inductive step assume that the statement holds when
$n=0$, \ldots, $n=k$ and consider the~$n=k+1$ case.
We have $k+1<2^k+1\leq 2^{k+1}$ (the second holds because $2^k<2^{k+1}$).
\end{ans}
\end{problem}
\begin{problem}
Prove each by induction.
\begin{exes}
\begin{exercise}
For all $n\in\N$, the number~$n^2+n$ is even.
\end{exercise}
\begin{answer}
For the $n=0$ base step observe that $0^2+0$ is even.
For the inductive step assume the statement for $n=0$, \ldots, $n=k$
and consider the $n=k+1$ case.
We have $(k+1)^2+(k+1)=k^2+2k+1+k+1=(k^2+k)+(2k+2)$.
By the inductive hypothesis $k^2+k$ is even, and clearly $2k+2$ is even,
so the sum is even.
\end{answer}
\begin{exercise}
For all $n\geq 2$ the number $n^3-n$ is divisible by $6$.
\hint take the base case to be $2$.
\end{exercise}
\begin{answer}
The base step is $n=2$.
Since $6$ divides $2^3-2=8-2$, the statement holds in this case.
For the inductive step assume that the statement is true for
the cases $n=0$, \ldots, $n=k$.
In the $n=k+1$ case, consider
$(k+1)^3-(k+1)=(k^3+3k^2+3k+1)-(k+1)=(k^3+3k^2+3k)-k$.
The inductive hypothesis gives that $6$ divides $(k^3-k)$ so we will
be finished if we show that it divides $3k^2+3k$.
We have $3k^2+3k=3\cdot k(k+1)$, and since
$k(k+1)$ is even (this was shown in the prior item),
the product is divisible by $6$.
\end{answer}
\begin{exercise}
If $n\in\N$ then $4\divides 13^n-1$.
\end{exercise}
\begin{answer}
The $n=0$ base step is clear, since four divides $13^0-1=0$.
For the inductive step assume that the statement is true for all cases
with $0\leq n\leq k$ and consider the $n=k+1$ case.
Then $13^{k+1}-1=(13^{k+1}-13)+(13-1)=13(13^k-1)+12$.
The first term is divisible by~$4$ by the inductive hypothesis, while the
second term is obviously divisible by~$4$, and so the statement holds in
this case.
\remark
this illustrates that
sometimes when you have finished a proof by induction,
while you now are sure that the statement is true,
you can nonetheless be left with the sense
that you are not sure really \emph{why} it is true.
You can prove that this statement holds in a
way that gives more intuition by plugging $13$ into the formula for a
geometric series.
\end{answer}
\begin{exercise}
If $n\in\Z^+$ then
$(1+\sfrac{1}{1})\cdot(1+\sfrac{1}{2})\,\cdots\,(1+\sfrac{1}{n})=n+1$.
\end{exercise}
\begin{answer}
The base step is a product with $n=1$~term.
The left side is $(1+\sfrac{1}{1})=2$ while the right side is $1+1=2$,
and they are equal.
Assume the inductive hypothesis, that the statement is true for
$n=1$, \ldots, $n=k$ and consider the $n=k+1$ case.
We have
$(1+\sfrac{1}{1})\cdot(1+\sfrac{1}{2})\,\cdots\,(1+\sfrac{1}{k})\cdot(1+\sfrac{1}{k+1})
=
(k+1)\cdot(1+\sfrac{1}{k+1})
=(k+1)+(k+1)/(k+1)
=k+2$.
\end{answer}
\end{exes}
% \end{ans}
% \item For all $n\in\N$, the number~$n^2+n$ is even.
% \item For all $n\geq 2$ the number $n^3-n$ is divisible by $6$.
% \hint take the base case to be $2$.
% \item If $n\in\N$ then $4\divides 13^n-1$.
% \item If $n\in\Z^+$ then
% $(1+\sfrac{1}{1})\cdot(1+\sfrac{1}{2})\,\cdots\,(1+\sfrac{1}{n})=n+1$.
% \end{exes}
% \begin{ans}
% \begin{exes}
% \item For the $n=0$ base step observe that $0^2+0$ is even.
% For the inductive step assume the statement for $n=0$, \ldots, $n=k$
% and consider the $n=k+1$ case.
% We have $(k+1)^2+(k+1)=k^2+2k+1+k+1=(k^2+k)+(2k+2)$.
% By the inductive hypothesis $k^2+k$ is even, and clearly $2k+2$ is even,
% so the sum is even.
% \item The base step is $n=2$.
% Since $6$ divides $2^3-2=8-2$, the statement holds in this case.
% For the inductive step assume that the statement is true for
% the cases $n=0$, \ldots, $n=k$.
% In the $n=k+1$ case, consider
% $(k+1)^3-(k+1)=(k^3+3k^2+3k+1)-(k+1)=(k^3+3k^2+3k)-k$.
% The inductive hypothesis gives that $6$ divides $(k^3-k)$ so we will
% be finished if we show that it divides $3k^2+3k$.
% We have $3k^2+3k=3\cdot k(k+1)$, and since
% $k(k+1)$ is even (this was shown in the prior item),
% the product is divisible by $6$.
% \item The $n=0$ base step is clear, since four divides $13^0-1=0$.
% For the inductive step assume that the statement is true for all cases
% with $0\leq n\leq k$ and consider the $n=k+1$ case.
% Then $13^{k+1}-1=(13^{k+1}-13)+(13-1)=13(13^k-1)+12$.
% The first term is divisible by~$4$ by the inductive hypothesis, while the
% second term is obviously divisible by~$4$, and so the statement holds in
% this case.
% \remark
% this illustrates that
% sometimes when you have finished a proof by induction,
% while you now are sure that the statement is true,
% you can nonetheless be left with the sense
% that you are not sure really \emph{why} it is true.
% You can prove that this statement holds in a
% way that gives more intuition by plugging $13$ into the formula for a
% geometric series.
% \item The base step is a product with $n=1$~term.
% The left side is $(1+\sfrac{1}{1})=2$ while the right side is $1+1=2$,
% and they are equal.
% Assume the inductive hypothesis, that the statement is true for
% $n=1$, \ldots, $n=k$ and consider the $n=k+1$ case.
% We have
% $(1+\sfrac{1}{1})\cdot(1+\sfrac{1}{2})\,\cdots\,(1+\sfrac{1}{k})\cdot(1+\sfrac{1}{k+1})
% =
% (k+1)\cdot(1+\sfrac{1}{k+1})
% =(k+1)+(k+1)/(k+1)
% =k+2$.
% \end{exes}
% \end{ans}
\end{problem}
\begin{problem}
Prove that $n+1$-term sums of reals commute:
$a_0+a_1+\cdots+a_n=a_n+\cdots+a_0$ for all $n\geq 1$,
starting from the assumption that sum of two terms commutes.
\begin{answer}
The $n=1$ base step is the commutativity assumption $a_0+a_1=a_1+a_0$.
For the inductive step assume the statement is true for all
sums of~$n+1$ terms with
with $1\leq n\leq k$, and consider a sequence with $n=k+2$~terms.
We have
$a_0+a_1+\cdots+a_k+a_{k+1}
=(a_0+a_1+\cdots+a_k)+a_{k+1}
=a_{k+1}+(a_0+a_1+\cdots+a_k)$ with the second equality coming from
two-term commutativity.
By the inductive hypothesis that is equal to
$a_{k+1}+(a_k+\cdots+a_0)=a_{k+1}+a_k+\cdots+a_0$.
\end{answer}
\end{problem}
\begin{problem}[\maxlength]
The sequence of \definend{Fibonacci numbers}
$0,1,1,2,3,5,8,13, \ldots$ is defined by the condition that
each succeeding number in the sequence is the sum of the
two numbers before it $f_{n+1}=f_n+f_{n-1}$, subject to the initial conditions
$f_0=0$ and~$f_1=1$.
Where does this argument, which purports to show that
all Fibonacci numbers are even, go wrong?
``The base case is clear since $0$ is even.
For the inductive step, assume the statement
is true for all cases up to and including $n=k$.
By definition
the next case $f_{k+1}$ is the sum of the two prior numbers, which by
the inductive hypothesis are both even.
Thus their sum is even.''
\begin{answer}
The recurrence $f_{n+1}=f_n+f_{n-1}$ first applies to computing $f_2$.
So to begin we must verify that both $f_0$ and~$f_1$ are even.
Of course, $f_1=1$ is not even.
\end{answer}
\end{problem}
While many induction arguments use the inductive
hypothesis only in the $n=k$ case,
some break from that pattern.
\begin{problem}
The game of Nim starts with two piles, each containing $n$~chips.
Two players take turns picking a pile and removing
some nonzero number of chips from that pile.
The winner is the player who takes the final chip.
Prove by induction on~$n$ that the second player always wins by
playing this way: whatever number of chips the first player removes
from one pile, the second player removes the same number from the other pile.
\begin{answer}
The base step is where the two piles have $n=1$~chips.
The first player must pick a pile and must remove a chip, leaving one chip
in one pile, so the second player wins.
For the inductive step assume that the strategy wins when there are two piles
with $n=1$, \ldots, $n=k$~chips and consider two piles with
$k+1$~chips.
The first player picks a pile and removes some nonzero number of chips.
If the second player removes the same number of chips from the other
pile then we have reduced to a game with equal-sized piles, each
with~$k$ or fewer chips, which the inductive hypothesis says
is a win for the second player.
\end{answer}
\end{problem}
\begin{df}
The \definend{Least Number Principle}
(or \definend{Well-ordering Principle})
is that any nonempty
subset of the natural
numbers has a least element.
\end{df}
\begin{problem}
Show that the Principle of Induction implies the Least Number
Principle.
\hint
show by induction that if a set of natural numbers does not
have a least element then that set is empty.
\begin{answer}
We shall use induction to prove for all $n\in\N$ that if a set~$A$