-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMath437_Notes.tex
More file actions
2024 lines (1709 loc) · 83.2 KB
/
Math437_Notes.tex
File metadata and controls
2024 lines (1709 loc) · 83.2 KB
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
\documentclass[11pt]{article}
\usepackage{hyperref}
\usepackage[margin=1in]{geometry}
\usepackage{amsmath}
\usepackage{amsthm}
\usepackage{amssymb}
\usepackage{amsfonts}
\usepackage{graphicx} %\usepackage[pdftex]{graphicx}
%\usepackage{tikz}
\newtheorem{thm}{Theorem}[section]
\newtheorem{cor}{Corollary}[thm]
\newtheorem{lemma}[thm]{Lemma}
\theoremstyle{definition}
\newtheorem{defn}{Definition}[section]
\newtheorem{example}{Example}[section]
\newtheorem{prop}{Proposition}[section]
\newtheorem{pty}{Property}[section]
\newtheorem{remark}{Remark}[section]
\newtheorem{obs}{Observation}[section]
\newcommand{\The}[2]{\begin{#1}#2\end{#1}}
\newcommand{\ord}[0]{\text{ord}}
% notes
\iftrue
\newcommand{\f}[2]{\frac{#1}{#2}}
\newcommand{\re}[1]{\frac{1}{#1}}
\newcommand{\half}[0]{\frac{1}{2}}
\newcommand{\ift}[0]{It follows that}
\newcommand{\cp}[1]{\overline{#1}}
\newcommand{\Note}[0]{\noindent\textbf{Note: }}
\newcommand{\Claim}[0]{\noindent\textbf{Claim: }}
\newcommand{\Lemma}[1]{\noindent\textbf{Lemma #1}: } %
\newcommand{\Ex}[0]{\noindent\textbf{Example: }} %
\newcommand{\Special}[0]{\noindent\textbf{Special case: }} %
\newcommand{\solution}[2]{\item[]\proof[Solution to #1] #2 \qedhere}
\newcommand{\legendre}[2]{\left(\frac{#1}{#2}\right)}
\newcommand{\dent}[0]{\hspace{0.5in}}
\fi
\newcommand{\sm}[0]{\setminus}
\newcommand{\set}[1]{\left\{ #1 \right\}}
\newcommand{\nl}[0]{\vspace{12pt}}
\newcommand{\rng}[2]{#1,\dots,#2}
\newcommand{\srng}[3]{#1_#2,\dots,#1_#3}
\newcommand{\st}[0]{\text{ such that }}
\newcommand{\et}[0]{\text{ and }}
\newcommand{\then}[0]{\text{ then }}
\newcommand{\forsome}[0]{\text{ for some }}
\newcommand{\floor}[1]{\lfloor #1 \rfloor}
% misc
\newcommand{\abs}[1]{\left\lvert#1\right\rvert} %
% lcm ???
\DeclareMathOperator{\lcm}{lcm}
% blackboard bold
\newcommand{\RR}{\mathbb{R}}
\newcommand{\FF}{\mathbb{R}}
\newcommand{\QQ}{\mathbb{Q}}
\newcommand{\ZZ}{\mathbb{Z}}
\newcommand{\NN}{\mathbb{N}}
\newcommand{\CC}{\mathbb{C}}
% vectors
\newcommand{\vvec}[1]{\textbf{#1}} %
\newcommand{\ii}[0]{\vvec{i}} %
\newcommand{\jj}[0]{\vvec{j}} %
\newcommand{\kk}[0]{\vvec{k}} %
\newcommand{\hvec}[1]{\hat{\textbf{#1}}} %
\newcommand{\cvec}[3]{ %column vector
\ensuremath{\left(\begin{array}{c}#1\\#2\\#3\end{array}\right)}}
\newcommand{\pfrac}[2]{\frac{\partial#1}{\partial#2}} %
\newcommand{\norm}[1]{\left\lVert#1\right\rVert} %
% dotp roduct
\makeatletter
\newcommand*\dotp{\mathpalette\dotp@{.5}}
\newcommand*\dotp@[2]{\mathbin{\vcenter{\hbox{\scalebox{#2}{$\m@th#1\bullet$}}}}}
\makeatother
% divrg and curl
\newcommand{\divrg}[0]{\nabla\dotp} %
\newcommand{\curl}[0]{\nabla\times} %
\title{Math 437 Notes}
\author{Henry Xia}
%\date{15 September 2017}
\begin{document}
\maketitle
\tableofcontents
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% 2017 09 08
\section{Divisibility}
Consider $a,b\in\ZZ, a>0$. There exists uniquely $q,r\in\ZZ$ such that
$$ \begin{cases} b = aq+r \\ 0 \le r < a \end{cases} $$
\The{cor}{
$a \mid b \iff r=0$.
}
\The{defn} {
Let $a,b\in\ZZ$, not both 0. Then there exists a finite set of common divisors of both $a$ and $b$.
Denote greatest common divisor of $a$ and $b$ as $\gcd(a,b) = (a,b)$.
}
\begin{prop} Let $D = \gcd(a,b)$, then
\begin{enumerate}
\item if $d \mid a$ and $d \mid b$, then $d \mid D$.
\item $D$ is the least positive integer of the form $ax+by$, for some $x,y\in\ZZ$.
\end{enumerate}
\end{prop}
\proof [Proof of $(2) \implies (1)$] $D = ax_0+by_0, d \mid ax_0+by_0 = D$
\proof [Proof of $(2)$] Let $S = \set{ax + by > 0 : x,y \in \ZZ}$. Clearly $S$ is nonempty. Let $s = \min S$. Since $D \mid ax+by$, so $D\mid s \implies D \le s$. \\
\textbf{Claim}: $s\mid a$ and $s\mid b$. It suffices to prove $s\mid a$. We divide $a$ by $s$ so that $a = sq+r$ and $0\le r < s$. It suffices to prove that $r=0$. Since $a$ is a linear combination of $a$ and $b$, and $s$ is a combination of $a$ and $b$, then $r = a-sq$ must be a combination of $a$ and $b$. But $r < s$ so $r \notin S$ so $r$ cannot be positive. Therefore $r=0$.
Now since $s\mid a$ and $s\mid b$, then $s \mid D \implies s \le D$. Therefore $s = D$.
\qedhere
\begin{prop}[i]
Let $c\in\NN$, then $\gcd(ac,bc) = c\gcd(a,b)$.
\end{prop}
\begin{prop}[ii]
Let $d\in\ZZ$ s.t. $d\mid a$ and $d\mid b$, then $\gcd\left(\f{a}{d}, \f{b}{d}\right) = \gcd(a,b)/d$.
\end{prop}
\proof [Proof of $(1) \implies (2)$] $d\gcd\left(\f{a}{d}, \f{b}{d}\right) = \gcd(a,b)$
\proof [Proof of $(1)$] $\gcd(ac,bc) = \text{least positive integer of the form } acx + bcy \\ = c(\text{least positive integer of the form } ax+by) = c\gcd(a,b)$.
\qedhere
\begin{prop} $\gcd(a,b) = \gcd(\pm a, \pm b) = \gcd(a, b+ac)$ for any $c\in\ZZ$. \end{prop}
\proof Any linear combination of $a$ and $b$ is a linear combination of $a$ and $b+ac$ since $ax+(b+ac)y = a(x+cy)+by$.
\proof $\begin{bmatrix} a \\ b+ac \end{bmatrix} = \begin{bmatrix} 1 & 0 \\ c & 1 \end{bmatrix}\begin{bmatrix} a \\ b \end{bmatrix}$ and $\begin{bmatrix} 1&0\\c&1 \end{bmatrix}^{-1} = \begin{bmatrix} 1&0\\-c&1\end{bmatrix}$. This is a reversible transformation.
\qedhere
\The{cor}{
We can use the Euclidean Algorithm to find $\gcd(a,b)$ and write $\gcd(a,b)$ as a linear combination of $a$ and $b$.
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% 2017 09 11
\subsection{Greatest Common Divisor}
\The{defn}{
Let $a_1,\dots,a_n \in \ZZ$, not all $0$. We define $\gcd(a_1,\dots,a_n)$ to be the greatest common divisor of all $a_i$.
}
\begin{pty}[i]
If $d\mid a_i$ for $i=\rng{1}{n}$, then $d\mid \gcd(\srng{a}{1}{n})$.
\end{pty}
\begin{pty}[ii] $\gcd(\srng{a}{1}{n})$ is the least positive integer which can be written as $\sum_{i=1}^{n}{a_ix_i}$ for $x_i\in\ZZ$.
\end{pty}
\begin{thm}
If $(a,b)=1$ and $(a,c)=1$, then $(a,bc)=1$.
\end{thm}
\proof Since $(a,b)=1, \exists x,y\in\ZZ$ such that $ax+by=1$.
Also, $\exists z,t\in\ZZ$ \st $az+ct=1$.
$$(ax+by)(az+ct)=1 \implies a(axz+xct+zby)+bc(yt) = 1 \implies \gcd(a,bc)=1.$$
\qedhere
\begin{thm}
If $a\mid bc$ and $(a,b)=1$, then $a\mid c$.
\end{thm}
\proof $\exists x,y\in\ZZ$ \st $ax+by=1\mid c \implies acx+bcy=c$. Since $a\mid acx$ and $a\mid bcy$, then $a\mid c$.
\qedhere
\subsection{Least Common Multiple}
\The {defn} {
Let $a,b\in\ZZ\sm\set{0}$. We define the $\lcm[a,b]$ be the least positive integer which is a common multiple of $a$ and $b$. Similarly define $\lcm[\srng{a}{1}{n}]$.
}
\begin{prop} Let $M=\lcm[a,b]$.
\begin{enumerate}
\item If $m$ is a common multiple of $a$ and $b$, then $M\mid m$.
\item If $c\in\NN$, then $\lcm[ac,bc] = c\cdot\lcm[a,b]$.
\item $\gcd(a,b)\cdot\lcm[a,b] = \abs{ab}$.
\end{enumerate}
\end{prop}
\proof[Proof of 1.] We divide $m$ by $M$ to get $m = Mq + r \st 0 \le r < M$. It suffices to prove that $r=0$. We know $a\mid M \implies Mq$ and $a\mid m$ therefore $a\mid r$. Similarly, $b\mid r$. Therefore $r$ is a common multiple of $a$ and $b$ and we must have $r=0$ because there does not exist a common multiple of $a$ and $b$ between $1$ and $M-1$ inclusive.
\qedhere
\proof[Proof of 2.] Let $M_1 = \lcm[ac,bc]$. We want $M_1 = c\cdot M$. We have $a\mid M \implies ac\mid c\cdot M$ and similarly $bc\mid c\cdot M$. Therefore $M_1 = \lcm[ac,bc]\mid c\cdot M$.
We also have $c\mid ac\mid M_1 \implies M_1 = cx$ for some $x\in\ZZ$. Then $ac\mid M_1 = cx \implies a\mid x$. Similarly $b\mid x$.
Then $x$ is a common multiple of $a$ and $b$ so $\lcm[a,b]\mid x \implies c\cdot\lcm[a,b]\mid M_1$.
Now we have both $M_1\mid c\cdot M$ and $c\cdot M\mid M_1$, and $c\cdot M = M_1$.
\qedhere
\proof[Proof of 3.] Let $d = (a,b)$ and $M = [a,b]$. Without loss of generality assume $a,b>0$.
\\Look at the $\lcm$. $dM = d\lcm[a,b] = \lcm[da,db]$. Since $d\mid a$ and $d\mid b$, then $db\mid ab$ and $da\mid ab$, so $\lcm[da,db] \mid ab \implies dM\mid ab$.
\\Look at the $\gcd$. $dM = \gcd(a,b)M = \gcd(aM,bM)$. Since $ab\mid aM$ and $ab\mid bM$, then $ab\mid \gcd(aM,bM) \implies ab\mid dM$.
\\ Now we have both $ab\mid dM$ and $dM\mid ab$ so $dM = ab$.
\qedhere
\subsection{Primes}
\The{defn} {
An integer $n>1$ is called prime if its only positive divisors are 1 and itself.
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% 2017 09 13
\begin{lemma} If $n>1$ is an integer, then there exists a prime $p$ dividing $n$. \end{lemma}
\proof Proof by induction.
\\Case $n=2$: obvious.
\\Case $n>2$: We assume that the statement holds for all $k=\rng{2}{N-1}$. Suppose that $N$ is prime, then $N\mid N$ and we are done. Otherwise there exists some integer $d$ such that $1<d<N$ and $d\mid N$. Since there exists a prime $p$ such that $p\mid d$, we must have $p\mid d\mid N$.
\qedhere
\begin{thm}There exists infinitely many prime numbers\end{thm}
\proof Suppose that there exists only finitely many prime numbers $\srng{p}{1}{k}$. Consider $N = \prod_{i=1}^{k}p_i + 1.$
By the lemma, there exists some prime $q$ such that $q\mid N$. Since $q$ is prime, let $q=p_j$. Then $p_j\mid \prod_{i=1}^{k}p_i + 1$ and $p_j\mid \prod_{i=1}^{k}p_i$. It follows that $p_j\mid 1$ and we have a contradiction.
\qedhere
\begin{prop}[i] If $p$ is prime, $a\in\ZZ$, then $\gcd(a,p)\in\set{1,p} \et \gcd(a,p)=p\iff p\mid a$. \end{prop}
\begin{prop}[ii] $p$ is prime, $a,b\in\ZZ$. If $p\mid ab$ then $p\mid a$ or $p\mid b$. \end{prop}
\proof[idea for Proof of (i)] $p$ only has divisors $1$ and $p$.
\proof[Proof of (ii)] Assume that $p\nmid a$. Then $\gcd(a,p)=1$, so $p\mid b$, and we are done. \qedhere
\begin{cor} If $p$ is prime and $p\mid \prod_{i=1}^{n} a_i$, then $p\mid a_i$ for some $i=\srng{a}{1}{n}$. \end{cor}
%%%%
\begin{thm}[\textbf{Fundamental Theorem of Arithmetic}]
Any integer $n>1$ can be written uniquely as a product of primes if we disregard the order of factors.
\end{thm}
\proof
\textbf{Claim 1}: $n>1$ can be written as a product of primes.
\emph{Proof of Claim 1}: Proof by induction. Clearly $n=2$ works. There exists some integer $d$ such that $1<d<N$ and $d\mid N$. Then $N = d\cdot\frac{N}{d}$ and we are done.
\textbf{Claim 2}: If $p_i \et q_j$ are primes and $p_1\cdots p_n = q_1 \cdots q_m$, then $n=m$ and there exists a permutation $\sigma$ of $\set{\rng{1}{n}} \st p_i=q_{\sigma(i)}$.
\emph{Proof of Claim 2}: Assume that there exists some positive integer $N$ that can be written as a product of primes in two ways. That is $p_1\cdots p_n = q_1\cdots q_m$. Without loss of generality, assume that $n+m$ is minimum among all possible products of primes.
It follows that $p_i\neq q_j$ for $1\le i\le n$ and $1\le j\le m$ because otherwise we can divide both sides by the repeated primes.
Then it follows that $p_1\mid\prod_{i=1}^{n}p_i$ but $p_1\nmid\prod_{j=1}^{m}q_j$.
\qedhere
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% 2017 09 15
\section{Congruences}
\begin{defn} For $m\in\ZZ\sm\set{0} \et a,b\in\ZZ$ we say that $a$ is congruent with $b$ modulo $m$, that is $a\equiv b\pmod{m}$, if $m\mid a-b$. \end{defn}
For $m\in\ZZ\sm\set{0}$ and $a\in\ZZ$, we denote by $\bar{a}$ the residue class of $a$ modulo $m$.
\begin{pty}[i] $a\equiv a\pmod{m}$. \end{pty}
\begin{pty}[ii] If $a\equiv b\pmod{m}$, then $b\equiv a\pmod{m}$. \end{pty}
\begin{pty}[iii] if $a\equiv b\pmod{m} \et b\equiv c\pmod{m}$, then $a\equiv c\pmod{m}$. \end{pty}
\begin{pty} Given $m\in\NN$, for any $a\in\ZZ, \exists k\in\set{0,\rng{1}{m-1}} \st \bar{a}=\bar{k}$. \end{pty}
\proof By the division algorithm, $\exists q\in\ZZ \et k\in\set{0,\rng{1}{m-1}} \st a=mq+k$. This implies $a\equiv k\pmod{m}$. \qedhere
\begin{pty} If $d\mid m \et a\equiv b\pmod{m}$, then $a\equiv b\pmod{d}$. \end{pty}
\proof $a\equiv b\pmod{m} \implies m\mid a-b \implies d\mid a-b \implies a\equiv b\pmod{d}$.
\begin{pty} If $a\equiv b\pmod{m} \et c\equiv d\pmod{m} \then a+c\equiv b+d\pmod{m}$. \end{pty}
\proof $m\mid a-b \et m\mid c-d \implies m\mid (a+c)-(b+d)$. \qedhere
\begin{pty} If $a\equiv b\pmod{m} \et c\equiv d\pmod{m} \then ac\equiv bd\pmod{m}$ \end{pty}
\proof $a\equiv b\pmod{m} \implies a-b=mx \forsome x\in\ZZ, \et c\equiv d\pmod{m} \implies c-d=my \forsome y\in\ZZ$. Then $ac = (mx+b)(my+d) = m^2xy + m(dx+by) + bd \implies ac\equiv bd\pmod{m}$.
\qedhere
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% 2017 09 18
\The{defn}{ $\ZZ/m\ZZ = \set{\overline{0}, \overline{1}, ..., \overline{m-1}}$ is a complete set of residues modulo $m$.
}
\The{defn}{ We say that $a\in\ZZ$ is invertible modulo $m\in\ZZ\sm\set{0}$ if there exists $b\in\ZZ$ such that $ab \equiv 1 \pmod{m}$.
}
\The{defn}{ $(\ZZ/m\ZZ)*$ is the set of residues $\overline{i}$ such that $\overline{i}$ is invertible.
}
\The{prop}{ Let $\srng{m}{1}{r}\in\ZZ\sm\set{0}$, then $x\equiv y \pmod{m_i}$ for $i=\rng{1}{r}$ if and only if $x\equiv y\pmod{\lcm[\srng{m}{1}{r}]}$.
}
\The{prop}{ $ax\equiv ay\pmod{m} \iff x\equiv y\pmod{\frac{m}{\gcd(a,m)}}$.
} \proof Let $d=\gcd(a,m)$. Then $a=da_1 \et m=dm_1$ and $\gcd(a_1,m_1)=1$. It follows that
\The{align*}{
ax\equiv ay \pmod{m} &\iff m\mid a(x-y) \\
&\iff dm_1\mid da_1(x-y) \\
&\iff m_1\mid a_1(x-y) \\
&\iff m_1\mid x-y \iff x\equiv y\pmod{m_1}.
}
\The{prop}{ Let $f\in\ZZ[x]$. If $a\equiv b\pmod{m}$, then $f(a)\equiv f(b)\pmod{m}$.
} \proof Write $f(x) = \sum_{i=0}^{r} {c_i x^i}$. Then
$$ f(a)\equiv f(b) \pmod{m} \iff \sum_{i=0}^{r}c_ia^i \equiv \sum_{i=0}^{r}c_ib^i \pmod{m}. $$
It suffices to show $a^i \equiv b^i \pmod{m}$.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% 2017 09 20
Let $N=\overline{a_na_{n-1}...a_0} = a_n10^n + a_{n-1}10^{n-1} + \cdots + a_0$ where $a_i \in\set{\rng{0}{9}}$.
\begin{itemize}
\item $2\mid N \iff 2\mid a_0$.
\item $4\mid N \iff 4\mid 10a_1+a_0 = \overline{a_1a_0}$.
\item $5\mid N \iff 5\mid a_0$.
\item $3\mid N \iff 3\mid \sum{a_i}$ because $10\equiv 1\pmod{3} \implies 10^k\equiv 1\pmod{3}$.
\item $9\mid N \iff 9\mid \sum{a_i}$ similarly to $3$.
\item $11\mid N \iff 11\mid \sum{(-1)^ia_i}$ similarly to $9$.
\end{itemize}
\subsection{Fermat's Little Theorem, Euler's Theorem, Wilson's Theorem}
\begin{thm}[Fermat's (Little) Theorem]
Let $p$ be a prime and $a\in\ZZ$ such that $\gcd{a,p}=1$. Then $a$ is invertible modulo $p$ and $a^{p-1}\equiv a\pmod{p}$.
\end{thm}
\proof Let $S = \set{\overline{1}, \overline{2}, ..., \overline{p-1}}$. Let $f_a:S\to S$ such that $f_a(\overline{k}) = \overline{ak}$. This is well defined because $p\nmid a \et p\nmid k$, then $p$ cannot divide $ak$.
\noindent\textbf{Claim}: $f_a$ is bijective. \\
It suffices to prove that $f_a$ is injective. This is true because
$$\overline{ai} = \overline{aj} \implies p\mid{ai-aj} \implies p\mid{i-j} \implies \overline{i} = \overline{j}. $$
Since $p\nmid(p-1)!$, it follows that from the claim that
$$\overline{1}\cdot\overline{2}\cdots\overline{p-1} = \overline{a\cdot1}\cdot\overline{a\cdot2}\cdots\overline{a\cdot(p-1)} \implies (p-1)! \equiv (p-1)!\cdot a^{p-1} \pmod{p}.$$
Then $a^{p-1}\equiv 1\pmod{p}$.
\qedhere
\The{defn} {
Let $m\in\NN$. Then Euler's function $\phi(m)$ is the cardinality of \\$\set{0\le i<m: \gcd(i,m)=1}$.
}
\begin{itemize}
\item $\phi(1) = 1$.
\item If $p$ is prime, then $\phi(p)=p-1$.
\item If $p$ is prime, then $\phi(p^n) = p^{n} - p^{n-1}$.
\end{itemize}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% 2017 09 22
\begin{thm}[Euler's Theorem]
Let $m\in\NN \et a\in\ZZ$ such that $\gcd(a,m)=1$. Then $$a^{\phi(m)} \equiv 1 \pmod{m}.$$
\end{thm}
\proof Let $S = \set{\overline{i}: 0\le i \le m-1, \gcd(i,m)=1}$. Then $\phi(m)=\#S$.
Let $f_a:S\to S$ defined by $f_a(\overline{i}) = \overline{a\cdot i}$.
This function is well defined because
$$ \gcd(i,m)=1 \et \gcd(a,m)=1 \implies \gcd(a\cdot i, m) = 1 . $$
Now we prove that $f_a$ is bijective (it suffices to prove that $f_a$ is injective).
Observe that
$$ f_a(\overline{i}) = f_a(\overline{j}) \implies a\cdot i \equiv a\cdot j \pmod{m} \implies m\mid a(i-j) \implies m\mid (i-j). $$
It follows that $\overline{i}=\overline{j}$ and $f_a$ must be bijective.
Now let $P = \prod_{k\in S}k$. Observe that $P$ is coprime with $m$ because each $k\in S$ is coprime with $m$. Then
$$ P\cdot a^{\phi(m)} \equiv P \pmod{m} \implies a^{\phi(m)} \equiv 1 \pmod{m}. $$
\qedhere
\begin{thm}[Wilson's Theorem]
Let $p$ be a prime. Then
$$ (p-1)! \equiv -1 \pmod{p}. $$
\end{thm}
\proof
We claim that $\forall i\in\set{\rng{2}{p-2}}, \exists! j\in\set{\rng{2}{p-2}}$ such that $ij\equiv 1\pmod{p}$, and $i\neq j$.
First we check that the inverse of $i$ cannot be $1$ or $-1$. If $j=1$, then $ij\equiv i\pmod{p} \implies i\equiv 1 \pmod{p}$. If $j=-1$, then $ij\equiv -i \implies i\equiv p-1 \pmod{p}$.
Now $j\neq i$ because if $j=i$, then $i^2\equiv 1 \pmod{p} \implies p\mid (i-1)(i+1)$. Contradiction.
It follows that
$$ (p-1)! = (1\cdot(p-1)) \cdot (i_1\cdot j_1) \cdots (i_\frac{p-3}{2}\cdot j_\frac{p-3}{2}) \equiv -1 \pmod{p}. $$
\qedhere
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% 2017 09 25
\begin{prop}[i]
If $p\equiv 1 \pmod{4}$ is prime, then
$$ \left(\left(\frac{p-1}{2}\right)!\right)^2 \equiv -1 \pmod{p}. $$
\end{prop}
\begin{prop}[ii]
If $p\equiv 3 \pmod{4}$ is prime, then
$$ \left(\left(\frac{p-1}{2}\right)!\right)^2 \equiv 1 \pmod{p}. $$
\end{prop}
\proof Wilson's Theorem gives
\begin{align*}
(p-1)! &\equiv -1 \pmod{p} \\
1\cdot2\cdots\left(\frac{p-1}{2}\right)\cdot\left(\frac{p+1}{2}\right)\cdots(p-1) &\equiv -1 \pmod{p} \\
\left(\frac{p-1}{2}\right) \cdot (-1)^{\frac{p-1}{2}}\left(\frac{p-1}{2}\right) &\equiv -1 \pmod{p}
\end{align*}
If $p\equiv1\pmod{4}$, then $\frac{p-1}{2}$ and the result follows. If $p\equiv3\pmod{4}$, then $\frac{p-1}{2}$ is odd and the result follows.
\qedhere
\subsection{Sum of two squares}
\begin{thm}[i]
If $p\equiv 1 \pmod{4}$, then there exists 2 distinct residue classes $\overline{x}$ such that $x^2\equiv -1\pmod{p}$.
\end{thm}
\begin{thm}[ii]
If $p\equiv 3 \pmod{4}$, then there exists no integer $x$ such that $x^2\equiv -1 \pmod{p}$.
\end{thm}
\proof[Proof of (i)]
There exists two residue classes $\overline{\pm\left(\frac{p-1}{2}\right)!}^2 \equiv -1 \pmod{p}$. These are the only two residue classes.
If $x^2\equiv y^2 \pmod{p}$, then $(x-y)(x+y) \equiv 0 \pmod{p}$ so $x\equiv y \pmod{p}$ and $x\equiv -y \pmod{p}$.
\qedhere
\proof[Proof of (ii)]
Assume $\exists x\in\ZZ \st x^2 \equiv -1 \pmod{p}$. This implies $\gcd(x,p)=1$. Therefore $$ -1 \equiv (-1)^\frac{p-1}{2} \equiv (x^2)^\frac{p-1}{2} \equiv x^{p-1} \equiv 1 \pmod{p} $$
because $\frac{p-1}{2}$ is odd.
\qedhere
\The{cor} {
Let $p\equiv 3 \pmod{4}$ be a prime. If $p\mid a^2+b^2$, then $p\mid a \et p\mid b$.
}
\proof Suppose that $p\mid a^2+b^2 \et p\nmid a$. Then $p\nmid b$.
Since $p$ is prime, there exists $c\in\ZZ \st bc\equiv 1\pmod{p}$. Then $a^2+b^2 \equiv 0 \pmod{p} \implies (ac)^2+(bc)^2 \equiv 0 \pmod{p} \implies (ac)^2\equiv -1 \pmod{p}$.
\qedhere
\The{defn} {
For any prime $p$ and any positive integer $n$, we define $\exp_p(n)$ be the exponent of $p$ in the prime factorization of $n$.
}
\The{prop} {
Let $p\equiv 3 \pmod{4}$ be a prime. If $n\in\NN \et a,b\in\ZZ$ such that $n=a^2+b^2$, then $\exp_p(n)$ is even.
}
\proof If $p\nmid n$, we are done. So assume $p\mid n$. Then $p\mid a \et p\mid b \implies p^2\mid n$.
Then we let $\alpha = \min\set{\exp_p(a), \exp_p(b)}$, without loss of generality let $\exp_p(a) = \alpha$. Then $p^{2\alpha} \mid n \implies n = p^{2\alpha} m$ for some $m\in\NN$.
Now let $a=p^\alpha c \et b=p^\alpha d$ for some $c,d\in\NN$. Then $m=c^2+d^2$. Now $p\nmid m$ because $p\nmid c$. Therefore $\exp_p(n) = 2\alpha$.
\qedhere
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% 2017 09 27
\The{prop} {
$ (a^2+b^2)(c^2+d^2) = (ac-bd)^2 + (ad+bc)^2 $.
}
\The{prop} {
Let $p\equiv 1 \pmod{4}$ be a prime. There exists $a,b\in\NN \st a^2+b^2 = p$.
}
\proof
Let $S=\set{c\in\NN : \exists a,b\in\NN, a^2+b^2=c\cdot p}$. Now $S$ is nonempty because $p\in S$ because $p\cdot p = p^2 + 0^2$.
Consider $c_0 = \min S$. It suffices to show that $c_0 = 1$.
\nl
\Lemma{1} $c_0 < p$.
\\\indent\emph{proof}. There exists $x\in\ZZ \st x^2 \equiv -1 \pmod{p}$. Let $x\in\set{0,\rng{1}{p-1}}$. Now $x^2 + 1 \le (p-1)^2 + 1 < p^2$. Then $x^2+1 = kp$ and $k<p$ so $k\in S$.
\\--- END LEMMA ---\nl
Let $a_0,b_0\in\NN\cup\set{0} \st a_0^2 + b_0^2 = c_0 \cdot p$.
\nl
\Lemma{2} $\gcd(a_0,c_0) = \gcd(b_0,c_0) = 1$.
\\\indent\emph{proof}. It suffices to prove that $\gcd(a_0,c_0) = 1$ by symmetry.
Suppose that there exists a prime $q \st q\mid a_0 \et q\mid c_0$. Then $q\mid c_0\cdot p = a_0^2 + b_0^2 \implies q\mid b_0$. Now since $q \le c_0 < p$ (Lemma 1), we must have $q\nmid p$. Then
$$ a_0^2 + b_0^2 = c_0\cdot p \implies \left(\frac{a_0}{q}\right)^2 + \left(\frac{b_0}{q}\right)^2 = \frac{c_0}{q^2}\cdot p $$
and we get a contradiction.
\\--- END LEMMA ---\nl
Now we proceed by contradiction. Assume that $c_0 > 1$.
There exists
$$ a_1,b_1\in\ZZ \st \begin{cases}
a_0 \equiv a_1 \pmod{c_0} \et b_0 \equiv b_1 \pmod{c_0} \\
\abs{a_1} \le \frac{c_0}{2} \et \abs{b_1}\le\frac{c_0}{2} \\
\abs{a_1}\neq 0 \et \abs{b_1}\neq 0
\end{cases}
$$
Part 2 can be shown by listing the residue classes. Part 3 can be shown by considering Lemma 2 and the assumption $c_0 > 1$.
Now
$$ c_0 \mid a_0^2 + b_0^2 \et a_1^2 + b_1^2 \equiv a_0^2 + b_0^2 \pmod{c_0} \implies a_1^2 + b_1^2 = c_0 \cdot c_1. $$
It follows that $c_1 < c_0$ because
$$ a_1^2+b_1^2 \le \left(\frac{c_0}{2}\right)^2 + \left(\frac{c_0}{2}\right)^2 < c_0^2. $$
Now we get
\begin{align*}
(a_0^2 + b_0^2)(a_1^2 + b_1^2) &= p\cdot c_0^2 \cdot c_1 \\
(a_0a_1 + b_0b_1)^2 + (a_0b_1 - a_1b_0)^2 &= p\cdot c_0^2 \cdot c_1 \\
\left(\frac{a_0a_1 + b_0b_1}{c_0}\right)^2 + \left(\frac{a_0b_1 - a_1b_0}{c_0}\right)^2 &= p\cdot c_1
\end{align*}
It follows that $c_1\in S$ and $c_1 < c_0$, contradicting the minimality of $c_0$.
Therefore $c_0$ must be 1.
\qedhere\nl
\noindent\textbf{Question}: What positive integers can be written as a sum of 2 squares?
$$ n = 2^\alpha \cdot \prod_{i=1}^{r} p_i^{\beta_i} \cdot \prod_{j=1}^{s} q_j^{\gamma_j} $$
where $p_i \equiv 1 \pmod{4} \et q_j \equiv 3 \pmod{4}$.
Now since $2$ and each $p_i$ can be written as a sum of two squares. It suffices that $\prod_{j=1}^{s} q_j^{\gamma_j}$ is a square, that is $\gamma_j$ is even for all $j$.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% 2017 09 29
% MIDTERM 1
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% 2017 10 02
\subsection{Chinese Remainder Theorem}
\begin{thm}[\textbf{Chinese Remainder Theorem}]
Let $\srng{m}{1}{r}\in\ZZ\sm\set{0}$ be pairwise coprime integers. Let $\srng{a}{1}{r}\in\ZZ$ be arbitrary. Then the system of congruences
\begin{align*}
x \equiv a_1 \pmod{m_1} \\
\vdots
x \equiv a_r \pmod{m_r} \\
\end{align*}
has a unique solution modulo $\prod_{i=1}^{r}m_i$.
\end{thm}
\proof
Let $M_i = \prod_{j\neq i} m_j$ for each $i=\rng{1}{r}$. Then since $\gcd(m_i,M_i)=1$, there exists
$$ y_i\in\ZZ \st y_iM_i\equiv 1 \pmod{m_i} . $$
Then $x = \sum_{i=1}^{r} a_i y_i M_i$ is a solution to the system. Consider $x$ modulo $m_j$.
\begin{align*}
\sum_{i=1}^{r} a_i y_i M_i &\equiv a_j y_j M_j + \sum{i\neq j} a_i y_i M_i \pmod{m_j} \\
&\equiv a_j y_j M_j \mod{m_j} \\
&\equiv a_j \pmod{m_j}
\end{align*}
If $x'\in\ZZ$ is another solution to the system of congruences, then $x-x' \equiv 0 \pmod{m_i}$ for all $i = \rng{1}{r}$. This is equivalent to $\lcm[\srng{m}{1}{r}] = \prod_{i=1}^{r} m_i \mid x-x'$. However our mod is $\prod_{i=1}^{r}m_i$ so the solution $x$ must be unique.
\qedhere
%%% %
\subsection{Euler's Totient Function $\phi$}
The function $\phi:\NN\to\NN$ is defined as follows $\phi(n) = \#\set{0 \le i \le n-1 : \gcd(i,n)=1} = \#(\ZZ/n\ZZ)^*$.
\The{prop} {
If $\gcd(m,n)=1$, then $\phi(mn) = \phi(m)\phi(n)$.
}
\proof Observation: $\gcd(i,mn)=1 \iff \gcd(i,m)=1 \et \gcd(i,n)=1$.
Let $f:(\ZZ/mn\ZZ)^* \to (\ZZ/m\ZZ)^* \times (\ZZ/n\ZZ)^*$ defined as $f(\overline{i}) = (i\mod{m}, i\mod{n})$. This function is well defined (if direction of the observation).
For any $i,j$ such that
$$ \begin{cases}
0 \le i \le m-1 \et \gcd(i,m)=1 \\
0 \le j \le n-1 \et \gcd(j,n)=1
\end{cases} $$
then CRT yeilds the existence of a unique $x$ modulo $mn$ such that
$$ \begin{cases}
x \equiv i \pmod{m} \\
x \equiv j \pmod{m}
\end{cases} $$
Then $f(\overline{x}) = (i\mod{m}, j\mod{n})$.
Now $f$ is both surjective and injective.
Therefore $f$ is bijective so $\phi(mn) = \phi(m)\phi(n)$.
\qedhere
Since Euler's function is multiplicative, then
\begin{align*}
\phi\left(n=\prod_{i=1}^{r}p_i^{\alpha_i}\right) &= \prod_{i=1}^{r}(p_i^{\alpha_i} - p_i^{\alpha_i-1}) \\
&= n\left(1-\frac{1}{p_i}\right)
\end{align*}
\The{defn} {
For the function $f:\NN\to\CC$, we say that $f$ is {multiplicative} if $f(mn) = f(m)f(n)$ whenever $\gcd(m,n)=1$.
If we do not need the condition $\gcd(m,n)=1$, we call $f$ {completely multiplicative}.
}
\The{prop} {
The function $d(n) = \#\set{\text{positive divisors of } n}$ is multiplicative.
}
\proof
If $\gcd(m,n)=1$ and $d\mid mn$, then $d = \gcd(d,m) \gcd(d,n)$.
\qedhere
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% 2017 10 04
\section{The congruence $f(x) \equiv 0 \pmod{p^\alpha}$}
In this section $p$ will always be prime.
\The{prop} {
Let $f\in\ZZ[x]$ and for each nonzero $m\in\ZZ$, we let $N_f(m)$ be the number of solutions to the congruence $f(x)\equiv 0\pmod{m}$. Then $N_f:\NN \to \NN\cup\set{0}$ is multiplicative.
}
\proof Suppose $\gcd(m,n)=1$, then $f(x)\equiv 0 \pmod{mn} \iff f(x)\equiv0 \pmod{m} \et f(x)\equiv0 \pmod{n}$.
Now if $x_1$ is a solution to $f(x)\equiv0 \pmod{m}$ and $x_2$ is a solution to $f(x)\equiv0 \pmod{n}$, then there exists a unique $x \mod mn$ such that $x\equiv x_1 \pmod{m}$ and $x\equiv x_2 \pmod{n}$ (by CRT).
Then $f(x) \equiv 0 \pmod{mn}$. It suffices to count the solutions.
\qedhere
\nl
Now suppose we want to solve the congruence $f(x)\equiv 0 \pmod{n}$. We should write $n=\prod_{i=1}^{r}p_i^{\alpha_i}$. Then it suffices to solve
$$ \begin{cases}f(x)\equiv0 \pmod{p_i^{\alpha_i}} \\ \vdots \\ f(x)\equiv0 \pmod{p_r^{\alpha_r}} \end{cases} $$
By CRT, we can solve these congruences independently.
\The{defn} {
A degree $n$ polynomial $f$ is monic if $f(x) = \sum_{i=0}^{n} a_nx^n$ and $a_n=1$.
}
\The{prop} {
Let $f\in\ZZ[x]\sm\set{0}$ of degree $n\ge0$. Without loss of generality, let $f$ be monic. Then for any prime $p$, there exists at most $n$ solutions to $f(x)\equiv 0 \pmod{p}$.
}
\proof
We prove this by induction on $n$.
Case $n=0$: We want to solve $f(x)=1\equiv0 \pmod{p}$. There are 0 solutions and $0\le 0$, so we are done.
Now assume that the proposition is true for all monic polynomials of degree less than $n$. Suppose there exists some $x_1$ such that $f(x_1) \equiv 0 \pmod{p}$.
We can write $f(x) = (x-x_1)g(x) + R(x)$ where $R(x)$ has degree less than $1$. It follows that $r = f(x_1) \equiv 0 \pmod{p}$.
Now solving $f(x)\equiv 0 \pmod{p}$ is equivalent to solving $(x-x_1)g(x) \equiv 0 \pmod{p}$. Suppose $x_2\not\equiv x_1 \pmod{p}$ is another solution to $f(x)\equiv 0 \pmod{p}$. Then $(x_2-x_1)g(x) \equiv 0 \pmod{p}$. Since $p \nmid x_2-x_1$, then we must have $p \mid g(x) \implies g(x) \equiv 0 \pmod{p}$.
Observe that $g$ is monic and $\deg(g)=n-1 < n$. Then by induction, there are at most $n-1$ solutions to the congruence $g(x)\equiv0 \pmod{p}$. It follows that $f(x)\equiv 0 \pmod{p}$ has at most $n$ solutions.
\qedhere
\The{prop} {
Given any $f\in\ZZ[x]$ of degree $n\ge0$, we can find a $g\in\ZZ[x]$ with less that $p$ such that $f(x) \equiv g(x) \pmod{p}$.
}
\proof
For any $x\in\ZZ$, we have $x^p \equiv x \pmod{p}$. Then $f(x) = (x^p-x)Q(x) + R(x)$ where $\deg(R) < p$.
Then $f(x) \equiv 0 \pmod{p} \iff R(x) \equiv 0 \pmod{p}$.
Observe that $f$ has $p$ solutions if and only if $R(x) \equiv 0 \pmod{p}$ for all $x\in\ZZ$.
\qedhere
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% 2017 10 06
\subsection{Hensel's Lemma}
\begin{thm}[\textbf{Hensel's Lifting Lemma}]
Let $f\in\ZZ[x]$, let $p$ be a prime and let
$$x_1\in\ZZ \st f(x_1)\equiv0\pmod{p} \et f'(x_1)\not\equiv0\pmod{p}.$$
Then for any $n\in\NN$, there exists a unique solution $x_n$ to the congruence
$$f(x)\equiv0\pmod{p^n} \et x_n\equiv x_1\pmod{p}.$$
\end{thm}
\proof
It suffices to show that if $f(x_n)\equiv 0 \pmod{p^n} \et x_n\equiv x_1\pmod{p}$, then there exists a unique solution $x_{n+1}$ to $f(x)\equiv 0\pmod{p^{n+1}} \et x_{n+1} \equiv x_n \pmod{p^n}$.
We write
\begin{align*}
f(x) &= \sum_{i=0}^{d} c_i x^i \\
x_{n+1} &= x_n + p^n k \\
f(x_{n+1}) &= f(x_n + p^n k) = \sum_{i=0}^{d} c_i(x_n + p^n k) \\
&= \sum_{i=0}^{d} c_i \sum_{j=0}^{i} \binom{i}{j} x_n^j (p^nk)^{i-j} \\
&= \left(\sum_{i=0}^{d} c_i x_n^i\right) + \left(p^nk \sum_{i=1}^{d} ic_i x_n^{i-1} \right) + p^{2n} A \\
&= f(x_n) + p^n k f'(x_n) \equiv 0 \pmod{p^{n+1}}
\end{align*}
Now since $f(x_n)\equiv 0 \pmod{p^n} \iff f(x_n) = p^n b$, it
$$ p^n b + p^n k f'(x_n) \equiv 0 \pmod{p^{n+1}} \iff b+kf'(x_n) \equiv 0 \pmod{p}. $$
Then by the assumption that $x_n \equiv x_1 \pmod{p}$, we get $f'(x_n) \equiv f'(x_1) \not\equiv 0 \pmod{p}$, so $f'(x_n)$ is invertible modulo $p$. Then we can uniquely solve for $k$ modulo $p$.
Therefore we get a unique solution $x_{n+1} = x_n + p^n k$ modulo $p^{n+1}$.
\qedhere
\begin{thm}[Refined Hensel's Lemma]
If $x_0$ is a solution to $f(x_0) \equiv 0 \pmod{p}$ and
$$\exp_p(f(x_0)) > 2\exp_p(f'(x_0)),$$
then it always lifts.
\end{thm}
Example: $x^2 + x + 37 \equiv 0 \pmod{7}$.
Everything lifts to level 2, only some lift to level 3.
Example: $x^2 + 2x + 50 \equiv 0 \pmod{7}$.
Everything lifts to level 2, nothing lift to level 3.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% 2017 10 11
\subsection{The Congruence $a^n \equiv 1 \pmod{m}$}
\The{defn} {
Let $m\in\ZZ\sm\set{0}$ and let $a\in\ZZ \st \gcd(a,m)=1$. We define the order of $a$ modulo $m$, denoted $\ord_m(a)$ be the least positive integer $d$ such that $a^d \equiv 1 \pmod{m}$.
}
Since $a^{\phi(m)} \equiv 1 \pmod{m}$, we have $\ord_m(a) \le \phi(m)$.
\begin{lemma}
If $p$ is a prime and $d\in\NN$ divides $p-1$, then there are exactly $d$ solutions to
$$ x^d - 1 \equiv 0 \pmod{p}. $$
\end{lemma}
\proof
Let $k = \frac{p-1}{d} \in\NN$. Now
$$\underbrace{x^{p-1}-1}_{\text{exactly } p-1 \text{ solutions}}
= (x^d-1)\underbrace{(x^{d(k-1)} + x^{d(k-2)} + \cdots + 1)}_{\text{at most } d(k-1)=p-d \text{ solutions}}. $$
It follows that $x^d-1\equiv0\pmod{p}$ has at least $d$ solutions because modulo prime.
However, since $\deg(x^d-1) = d$, it cannot have more than $d$ solutions.
Therefore, $x^d-1\equiv0\pmod{p}$ has exactly $d$ solutions.
\qedhere
\begin{lemma}
For any $n\in\NN \st a^n\equiv1\pmod{m}$, we have $\ord_m(a)\mid n$.
\end{lemma}
\proof
Let $d = \ord_m(a)$.
Let $q\et r$ be the quotient and remainder respectively when we divide $n$ by $d$.
That is $n = dq+r$ with $0\le r < d$. It suffices to show $r=0$.
$$ 1 \equiv a^n \equiv a^{dq+r} \equiv (a^d)^q a^r \equiv a^r \pmod{m}. $$
It follows that $r = 0$, implying that $d\mid n$.
\qedhere
\begin{lemma}
Let $d = \ord_m(a)$.
If $k\in\ZZ$, then $\ord_m(a^k) = \frac{d}{\gcd(k,d)}$
\end{lemma}
\proof
Let $D = \gcd(d,k)$ and let $d = l\gcd(d,k) = D l$.
Now we need to show that $\ord_m(a^k) = l$.
$$ (a^k)^l \equiv a^{\frac{k}{D} D l} \equiv (a^{d})^{\frac{k}{D}} \equiv 1 \pmod{m} .$$
So, $\ord_m(a^k) \mid l$.
Furthermore,
$$ a^{k\ord_m(a^k)} \equiv (a^k)^{\ord_m(a^k)} \equiv 1 \pmod{m} $$
so $\ord_m(a) = d \mid kd_1 \implies \frac{d}{D} \mid \frac{k}{D} d_1 \implies l \mid d_1$.
\qedhere
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% 2017 10 13
\begin{lemma}
If $d_1 = \ord_m(a_1) \et d_2 = \ord_m(a_2) \et \gcd(d_1,d_2)=1$, then $\ord_m(a_1a_2) = d_1d_2$.
\end{lemma}
\proof
Let $d = \ord_m(a_1a_2)$.
$$ (a_1a_2)^{d_1d_2} \equiv (a_1^{d_1})^{d_2} (a_2^{d_2})^{d_1} \equiv 1 \pmod{m} $$
so $d \mid d_1d_2$.
$$ 1 \equiv ((a_1a_2)^d)^{d_1} \equiv (a_1a_2)^{dd_1} \equiv (a_1^{d_1})^d a_2^{dd_1} \equiv a_2^{dd_1} \pmod{m} $$
so $d_2 \mid dd_1 \implies d_2 \mid d$.
Similarly, we must have $d_2 \mid d$.
Therefore $d_1d_2 \mid d$ so we must have $d = d_1d_2$.
\qedhere
\begin{lemma}
Let $p,q$ be primes and $\alpha\in\NN \st q^\alpha \mid p-1$. Then there exist exactly $q^\alpha - q^{\alpha-1}$ residue classes of integers $a \st \ord_p(a) = q^\alpha$.
\end{lemma}
\proof
Since $q^\alpha \mid p-1$, there exist exactly $q^\alpha$ solutions to the congruence
$$ x^{q^\alpha} \equiv 1 \pmod{p} . $$
For each solution $a$ of this congruence, we must have $\ord_p(a) \mid q^\alpha$, that is $\ord_p(a) = q^\beta$ where $0\le\beta\le\alpha$.
\textbf{Consider} the case where $\beta<\alpha$. This implies
$$ a^{q^{\alpha-1}} \equiv 1 \pmod{p} . $$
Now since $q^{\alpha-1} \mid p-1$, there are exactly $q^{\alpha-1}$ solutions to this congruence.
The lemma follows.
\qedhere
\begin{thm}
Let $p$ be a prime, then there exists $a\in\ZZ \st \ord_p(a) = p-1$.
\end{thm}
\proof
For $p=2$, we can choose $a=1$.
For $p>2$, let $p-1 = \prod_{i=1}^{l} q_i^{\alpha_i}$.
By the previous lemma, for each $i=\rng{i}{l}$, let $a_i\in\ZZ$ such that $\ord_p(a_i) = q_i^{\alpha_i}$.
Now let $a = \prod_{i=1}^{l} a_i$, $\ord_p(a) = p-1$.
\qedhere
\begin{defn}
If $\ord_p(a) = p-1$, then $a$ is a primitive root modulo $p$.
\end{defn}
\begin{cor}
There exist exactly $\phi(p-1)$ primitive roots modulo $p$.
\end{cor}
\proof
We know there exists one primitive root $g$ modulo $p$.
Now we can write all nonzero residue classes of $p$ as $g^{\alpha}$.
\Claim $\set{g^\alpha: 0\le\alpha\le p-2} = \set{\overline{1}, \overline{2}, ..., \overline{p-1}}$ \\
It suffices to prove that $g^\alpha\not \equiv g^\beta \pmod{p}$ if $0\le\alpha<\beta\le p-2$.
If $g^\alpha \equiv g^\beta \pmod{p}$, then $g^{\beta-\alpha} \equiv 1 \pmod{p}$.
Now this is a contradiction because $\beta-\alpha < p-1 = \ord_p(g)$.
Observe that we want $\gcd(\alpha, \ord_p(g)) = 1$ in order for $g^\alpha$ to be a primitive root.
$$ \ord_p(g^\alpha) = \frac{\ord_p(g)}{\gcd(\alpha, \ord_p(g))} = p-1 \iff \gcd(\alpha, p-1) = 1. $$
It follows that there are exactly $\phi(p-1)$ primitive roots.
\qedhere
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% 2017 10 16
\begin{lemma}
Let $a,b\in\ZZ, m\in\ZZ\sm\set{0}$ and let $d = \gcd(a,m)$. Consider the congruence
$$ ax \equiv b \pmod{m}. $$
\begin{enumerate}
\item[(a)] If $d\mid b$, then there exists exactly $d$ solutions.
\item[(b)] If $d\nmid b$, then there exists no solution.
\end{enumerate}
\end{lemma}
\proof
To see that $d$ must divide $b$ in order for there to be solutions, observe that
$$ m\mid ax-b \implies d\mid ax-b \implies d\mid b. $$
Now let $a = da_1, b = db_1, m = dm_1$. Now $ax \equiv b \pmod{m} \iff a_1 x \equiv b_1 \pmod{m_1}$.
There exists a unique $x_0$ modulo $m_1$ that is the solution to $a_1 x \equiv b_1 \pmod{m_1}$.
Then the solutions to $ax\equiv b \pmod{m}$ are
$$ x_0,\ x_0+m_1,\ ...,\ x_0 + (d-1)m_1 , $$
a total of $d$ solutions.
\qedhere
\begin{thm}
Let $p$ be a prime and $a\in\ZZ$ not divisible by $p$ and $n\in\NN$. Let $d = \gcd(n,p-1)$.
\begin{enumerate}
\item[(a)] If $a^{\frac{p-1}{d}} \not\equiv 1 \pmod{p}$, then there is no solution to $x^n \equiv a \pmod{p}$.
\item[(b)] If $a^{\frac{p-1}{d}} \equiv 1 \pmod{p}$, then there exist $d$ solutions to $x^n \equiv a \pmod{p}$.
\end{enumerate}
\end{thm}
\proof
Let $g$ be some primitive root modulo $p$.
Then there exists some $\alpha\in\set{\rng{1}{p-2}}$ such that $a \equiv g^\alpha \pmod{p}$.
Now any solution $x$ to $x^n\equiv a \pmod{p}$ can be written as $g^\beta$ where $\beta\in\set{\rng{1}{p-2}}$.
Then the congruence becomes
\begin{align*}
(g^\beta)^n \equiv g^\alpha \pmod{p} &\iff g^{n\beta} \equiv g^\alpha \pmod{p} \\
&\iff g^{\abs{n\beta-\alpha}} \equiv 1 \pmod{p} \\
&\iff p-1 = \ord_p(g) \mid n\beta - \alpha.
\end{align*}
Now this last divisibility is equivalent to the congruence
$$ n\beta \equiv \alpha \pmod{p} . $$
By the previous lemma, we are done.
\qedhere
\begin{cor}
If $p$ is an odd prime and $a\in\ZZ$ not divisible by $p$, then
\begin{enumerate}
\item[(a)] If $a^{\frac{p-1}{2}} \not\equiv 1 \pmod{p}$, then there is no solution to $x^2 \equiv a \pmod{p}$.
\item[(b)] If $a^{\frac{p-1}{2}} \equiv 1 \pmod{p}$, then there are $2$ solutions to $x^2 \equiv a \pmod{p}$.
\end{enumerate}
\end{cor}
%%%
\subsection{Primitive Roots}
\begin{thm}
Let $p$ be an odd prime and $\alpha\in\NN$. Then there is a primitive root $g$ modulo $p^{\alpha}$, that is
$$ \ord_{p^\alpha}(g) = \phi(p^{\alpha}) = p^{\alpha-1}(p-1). $$
\end{thm}
\proof
We know there exists $g_1\in\ZZ$ such that $ord_p(g_1) = p-1$.
We construct $g_2\in\ZZ$ such that $\ord_{p^2}(g_2) = p(p-1)$.
Now if $g_2 \equiv g_1 \pmod{p}$, then $\ord_p(g_2) = \ord_p(g_1) = p-1$.
Now we must have $p-1 \mid \ord_{p^2}(g_2)$ because we need $g_2^n \equiv 1 \pmod{p}$ if we want $g_2^n \equiv 1 \pmod{p^2}$.
By Euler's Theorem, we get $\ord_{p^2}(g_2) \mid \phi(p^2) = p(p-1)$, hence it suffices to show that there exists some $g_2$ such that
$$ \ord_{p^2}(g_2) \neq p-1 .$$
Now if $\ord_{p^2}(g_2) = p-1$, this means $g^{p-1} \equiv 1 \pmod{p^2}$. Hence $g_2^p \equiv g_2 \pmod{p^2}$.
We can write $g_2 = g_1 + pk$ and get
\begin{align*}
g_2^p &= (g_1+pk)^p \\
&= g_1^p + \sum_{i=1}^{p} {g_1^{p-i} (pk)^i} \\
&\equiv g_1^p \pmod{p^2}
\end{align*}
Now this is equivalent to
$$ g_2 \equiv g_2^p \equiv g_1^p \equiv g_1 + pk \pmod{p^2}. $$
This means
$$ (g_1^p - g_1) - pk \equiv 0 \pmod{p^2} $$
which is true for at most one residue class $k$.
Therefore there exist $p-1$ residue classes modulo $p^2$ such that $\ord_{p^2}(g_2) \neq p-1$.
Hence we must have $\ord_{p^2}(g_2) = p(p-1)$.
This proves that there is a primitive root modulo $p^2$.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% 2017 10 18
\nl
\Claim $g_2$ is a primitive root modulo $p^\alpha$ for any $\alpha \ge 1$.
We already know that the claim is valid for $\alpha \le 2$.
We prove this claim by induction on $\alpha$.
Suppose that $g_2$ is a primitive root for all $\beta \le \alpha$ for some $\alpha \ge 2$.
We want to show $\ord{p^{\alpha+1}}(g_2) = p^{\alpha}(p-1) = \phi(p^{\alpha+1})$.
Observe that
$$ g_2^{\ord_{p^{\alpha+1}}(g_2)} \equiv 1 \pmod{p^\alpha} \implies \ord_{p^\alpha}(g_2) \mid \ord_{p^{\alpha+1}}(g_2). $$
This means $p^{\alpha-1}(p-1) \mid \ord_{p^{\alpha+1}}(g_2)$.
Hence suffices to prove that $\ord_{p^{\alpha+1}}(g_2) \neq p^{\alpha-1}(p-1)$, that is
$$ g_2^{p^{\alpha-1}(p-1)} \not\equiv 1 \pmod{p^{\alpha+1}}. $$
Now since we are dealing with orders, we get
$$ g_2^{p^{\alpha-2}(p-1)} \not\equiv 1 \pmod{p^\alpha} $$
$$ g_2^{p^{\alpha-2}(p-1)} \equiv 1 \pmod{p^{\alpha-1}} $$
Hence we write
$$ g_2^{p^{\alpha-2}(p-1)} = 1 + p^{\alpha-1}k $$
where $p\nmid k$.
Therefore we can compute
\begin{align*}
\text{Let } q &= g_2{p^{\alpha-2}} \\
\text{Let } h &= g^{\alpha-1} \\
q^p &= (1 + hk)^p \\
&= 1 + \binom{p}{1} hk + \binom{p}{2} (hk)^2 + \cdots + (hk)^p \\
&= 1 + p^\alpha k + \sum_{i=2}^{p} \binom{p}{i} (hk)^i
\end{align*}
Now for $i = \rng{2}{p-1}$, we have
$$ \exp_p\left(\binom{p}{i}(p^{\alpha-1}k)^i\right) = 1 + i(\alpha-1) \ge 1 + 2(\alpha-1) \ge \alpha+1 $$
and for $i=p$, we have
$$ \exp_p((p^{\alpha-1}k)^p) = p(\alpha-1) \ge 3(\alpha-1) \ge \alpha+1. $$
Now we are done.
\qedhere
\begin{lemma}
If $\alpha \ge 3$, there is no primitive root modulo $2^\alpha$.
\end{lemma}
\proof
We prove that if $x$ is odd, then
$$ x^{2^{\alpha-2}} \equiv 1 \pmod{2^\alpha}. $$
We already know this is true for $\alpha=3$.
We use induction on $\alpha$.
Assume that this is true for $\alpha$ and prove the result for $\alpha+1$.
We can compute
$$ x^{2^{\alpha-1}} = (x^{2^{\alpha-2}})^2 = (1+2^\alpha k)^2 = 1 + 2^{\alpha+1}k + 2^{2\alpha}k^2 \equiv 1 \pmod{2^{\alpha+1}}. $$
(The reason is the exponent is not large enough)
\qedhere
\begin{lemma}
Let $m,n\in\NN \st \gcd(m,n)=1$. If $a$ is a primitive root modulo $mn$, then
\begin{enumerate}
\item[(a)] $a$ is a primitive root modulo $m$ and modulo $n$.
\item[(b)] $\gcd(\phi(m), \phi(n)) = 1$.
\end{enumerate}
\end{lemma}
\proof
Let $d_1 = \ord_m(a) \et d_2 = \ord_n(a)$.
$$ a^{d_1d_2} \equiv (a^{d_1})^{d_2} \equiv 1 \pmod{m} $$
$$ a^{d_1d_2} \equiv (a^{d_2})^{d_1} \equiv 1 \pmod{n} $$
Since $\gcd(m,n)=1$, we have $a^{d_1d_2} \equiv 1 \pmod{nm}$. Hence
$$ \phi(mn) = \ord_{mn}(a) \mid d_1d_2 \mid \phi(m)\phi(n) = \phi(mn). $$
Now this means $d_1 = \phi(m) \et d_2 = \phi(n)$, and part (a) follows.
Replacing $d_1d_2$ with $\lcm[d_1,d_2]$ gives part (b) because we get
$$ \phi(mn) = \ord_{mn}(a) \mid \lcm[d_1,d_2] \mid d_1d_2 \mid \phi(m)\phi(n) = \phi(mn). $$
Then $\lcm[d_1,d_2] = d_1d_2$ so $\gcd(\phi(m), \phi(n)) = 1$.
\qedhere
\nl
\noindent\textbf{CONCLUSION}: $n$ admits a primitive root if
\begin{itemize}
\item $n = 2^\alpha$, where $\alpha \le 2$.
\item $n = p^\alpha$, where $p$ is an odd prime.
\item $n = 2 \cdot p^\alpha$, where $p$ is an odd prime.
\end{itemize}
\Claim If $a$ is some primitive root $p^\alpha$, then either $a$ or $a+p^\alpha$ is a primitive root modulo $2\cdot p^\alpha$.
\proof
Without loss of generality, $a$ is odd. Then $\ord_{2\cdot p^\alpha}(a) = \phi(p^\alpha)$ is divisible by $\ord_{p^\alpha}(a) = \phi(p^\alpha)$.
\qedhere
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% 2017 10 20
% MIDTERM 2
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% 2017 10 23
\section{Quadratic Reciprocity}
\subsection{Quadratic Residues and the Legendre Symbol}
Recall the congruence
$$ (a^{\frac{p-1}{2}})^2 \equiv 1 \pmod{p} . $$
Then there are two possibilities:
$$ a^{\frac{p-1}{2}} \equiv 1 \pmod{p} \implies x^2 \equiv a \pmod{p} \text{ has 2 solutions} , $$
$$ a^{\frac{p-1}{2}} \equiv -1 \pmod{p} \implies x^2 \equiv a \pmod{p} \text{ has 0 solutions} . $$
Recall that the congruence
$$ x^2 \equiv -1 \pmod{p} $$
is solvable if $p \equiv 1 \pmod{4}$ and not solvable if $p \equiv 3 \pmod{4}$.
\begin{defn}
Let $p$ be an odd prime and $a\in\ZZ$. The Legendre symbol is
$$ \left(\frac{a}{p}\right) \text{ is }
\begin{cases}
0, \text{ if } p\mid a \\
1, \text{ if } p\nmid a \et a^\frac{p-1}{2} \equiv 1 \pmod{p} \\
-1, \text{ if } p\nmid a \et a^\frac{p-1}{2} \equiv -1 \pmod{p} \\
\end{cases} $$
\end{defn}
\begin{remark}
Observations for odd primes $p$.
\begin{enumerate}
\item If $\legendre{a}{p} \in \set{0,1}$, then $a$ is called a quadratic residue modulo $p$ (square mod $p$).
\item There are $\frac{p-1}{2}$ nonzero quadratic residues modulo $p$. They are $1^2, 2^2, ... , (\frac{p-1}{2})^2$.
\item $\legendre{a}{p} \equiv a^{\frac{p-1}{2}} \pmod{p}$.
\end{enumerate}
\end{remark}
\proof[Proof of observation 2]
It suffices to show that the residue classes are distinct.
That is if $1 \le i < j \le \frac{p-1}{2}$ then $i^2 \not\equiv j^2 \pmod{p}$.
Suppose that there exists $i^2 \equiv j^2 \pmod{p}$ for contradiction.
Then
$$ (i-j)(i+j) \equiv 0 \pmod{p} \iff i \equiv j \pmod{p} \text{ or } i+j \equiv 0 \mod{p}. $$
This cannot be true.
\qedhere
\begin{lemma}