diff --git a/front.tex b/cover.tex similarity index 100% rename from front.tex rename to cover.tex diff --git a/header.tex b/header.tex index 5b4d41c..ea56e74 100644 --- a/header.tex +++ b/header.tex @@ -7,6 +7,7 @@ \usepackage[UKenglish]{babel} \usepackage{commath} \usepackage{enumitem} +\usepackage{etoolbox} \usepackage{fancyhdr} \usepackage[margin=1in]{geometry} \usepackage{graphicx} @@ -23,37 +24,97 @@ \addto\captionsUKenglish{\renewcommand{\abstractname}{Syllabus}} \delimitershortfall5pt \ifx\thm\undefined\newtheorem{n}{}\else\newtheorem{n}{}[\thm]\fi -\let\g\gg -\let\l\ll +\newcommand\newoperator[1]{\ifcsdef{#1}{\cslet{#1}{\relax}}{}\csdef{#1}{\operatorname{#1}}} \setlength{\parindent}{0cm} % Environments \theoremstyle{plain} \newtheorem{algorithm}[n]{Algorithm} +\newtheorem*{algorithm*}{Algorithm} +\newtheorem{algorithm**}{Algorithm} \newtheorem{conjecture}[n]{Conjecture} +\newtheorem*{conjecture*}{Conjecture} +\newtheorem{conjecture**}{Conjecture} \newtheorem{corollary}[n]{Corollary} +\newtheorem*{corollary*}{Corollary} +\newtheorem{corollary**}{Corollary} \newtheorem{lemma}[n]{Lemma} +\newtheorem*{lemma*}{Lemma} +\newtheorem{lemma**}{Lemma} \newtheorem{proposition}[n]{Proposition} +\newtheorem*{proposition*}{Proposition} +\newtheorem{proposition**}{Proposition} \newtheorem{theorem}[n]{Theorem} +\newtheorem*{theorem*}{Theorem} +\newtheorem{theorem**}{Theorem} \theoremstyle{definition} -\newtheorem{axiom}{Axiom} +\newtheorem{aim}[n]{Aim} +\newtheorem*{aim*}{Aim} +\newtheorem{aim**}{Aim} +\newtheorem{axiom}[n]{Axiom} +\newtheorem*{axiom*}{Axiom} +\newtheorem{axiom**}{Axiom} +\newtheorem{condition}[n]{Condition} +\newtheorem*{condition*}{Condition} +\newtheorem{condition**}{Condition} \newtheorem{definition}[n]{Definition} -\newtheorem{example}[n]{Example} -\newtheorem{exercise}{Exercise} \newtheorem*{definition*}{Definition} +\newtheorem{definition**}{Definition} +\newtheorem{example}[n]{Example} \newtheorem*{example*}{Example} - -\theoremstyle{remark} -\newtheorem{notation}[n]{Notation} -\newtheorem{remark}[n]{Remark} +\newtheorem{example**}{Example} +\newtheorem{exercise}[n]{Exercise} +\newtheorem*{exercise*}{Exercise} +\newtheorem{exercise**}{Exercise} +\newtheorem{fact}[n]{Fact} \newtheorem*{fact*}{Fact} +\newtheorem{fact**}{Fact} +\newtheorem{goal}[n]{Goal} +\newtheorem*{goal*}{Goal} +\newtheorem{goal**}{Goal} +\newtheorem{law}[n]{Law} +\newtheorem*{law*}{Law} +\newtheorem{law**}{Law} +\newtheorem{plan}[n]{Plan} +\newtheorem*{plan*}{Plan} +\newtheorem{plan**}{Plan} +\newtheorem{problem}[n]{Problem} +\newtheorem*{problem*}{Problem} +\newtheorem{problem**}{Problem} +\newtheorem{question}[n]{Question} +\newtheorem*{question*}{Question} +\newtheorem{question**}{Question} +\newtheorem{warning}[n]{Warning} +\newtheorem*{warning*}{Warning} +\newtheorem{warning**}{Warning} +\newtheorem{acknowledgements}[n]{Acknowledgements} +\newtheorem*{acknowledgements*}{Acknowledgements} +\newtheorem{acknowledgements**}{Acknowledgements} +\newtheorem{annotations}[n]{Annotations} +\newtheorem*{annotations*}{Annotations} +\newtheorem{annotations**}{Annotations} +\newtheorem{assumption}[n]{Assumption} +\newtheorem*{assumption*}{Assumption} +\newtheorem{assumption**}{Assumption} +\newtheorem{conclusion}[n]{Conclusion} +\newtheorem*{conclusion*}{Conclusion} +\newtheorem{conclusion**}{Conclusion} +\newtheorem{claim}[n]{Claim} +\newtheorem*{claim*}{Claim} +\newtheorem{claim**}{Claim} +\newtheorem{notation}[n]{Notation} \newtheorem*{notation*}{Notation} +\newtheorem{notation**}{Notation} +\newtheorem{note}[n]{Note} \newtheorem*{note*}{Note} +\newtheorem{note**}{Note} +\newtheorem{remark}[n]{Remark} \newtheorem*{remark*}{Remark} +\newtheorem{remark**}{Remark} -% Commands +% Lectures \newcommand{\lecture}[3]{ % Lecture \marginpar{ @@ -63,33 +124,144 @@ } } +% Blackboard + +\renewcommand{\AA}{\mathbb{A}} % Blackboard A +\newcommand{\BB}{\mathbb{B}} % Blackboard B +\newcommand{\CC}{\mathbb{C}} % Blackboard C +\newcommand{\DD}{\mathbb{D}} % Blackboard D +\newcommand{\EE}{\mathbb{E}} % Blackboard E +\newcommand{\FF}{\mathbb{F}} % Blackboard F +\newcommand{\GG}{\mathbb{G}} % Blackboard G +\newcommand{\HH}{\mathbb{H}} % Blackboard H +\newcommand{\II}{\mathbb{I}} % Blackboard I +\newcommand{\JJ}{\mathbb{J}} % Blackboard J +\newcommand{\KK}{\mathbb{K}} % Blackboard K +\newcommand{\LL}{\mathbb{L}} % Blackboard L +\newcommand{\MM}{\mathbb{M}} % Blackboard M +\newcommand{\NN}{\mathbb{N}} % Blackboard N +\newcommand{\OO}{\mathbb{O}} % Blackboard O +\newcommand{\PP}{\mathbb{P}} % Blackboard P +\newcommand{\QQ}{\mathbb{Q}} % Blackboard Q +\newcommand{\RR}{\mathbb{R}} % Blackboard R +\renewcommand{\SS}{\mathbb{S}} % Blackboard S +\newcommand{\TT}{\mathbb{T}} % Blackboard T +\newcommand{\UU}{\mathbb{U}} % Blackboard U +\newcommand{\VV}{\mathbb{V}} % Blackboard V +\newcommand{\WW}{\mathbb{W}} % Blackboard W +\newcommand{\XX}{\mathbb{X}} % Blackboard X +\newcommand{\YY}{\mathbb{Y}} % Blackboard Y +\newcommand{\ZZ}{\mathbb{Z}} % Blackboard Z + +% Brackets + \renewcommand{\eval}[1]{\left. #1 \right|} % Evaluation \newcommand{\br}{\del} % Brackets \newcommand{\abr}[1]{\left\langle #1 \right\rangle} % Angle brackets \newcommand{\fbr}[1]{\left\lfloor #1 \right\rfloor} % Floor brackets \newcommand{\lbr}[1]{\left\lfloor #1 \right\rfloor} % Ceiling brackets +\newcommand{\st}{\ \middle| \ } % Such that + +% Calligraphic + +\newcommand{\AAA}{\mathcal{A}} % Calligraphic A +\newcommand{\BBB}{\mathcal{B}} % Calligraphic B +\newcommand{\CCC}{\mathcal{C}} % Calligraphic C +\newcommand{\DDD}{\mathcal{D}} % Calligraphic D +\newcommand{\EEE}{\mathcal{E}} % Calligraphic E +\newcommand{\FFF}{\mathcal{F}} % Calligraphic F +\newcommand{\GGG}{\mathcal{G}} % Calligraphic G +\newcommand{\HHH}{\mathcal{H}} % Calligraphic H +\newcommand{\III}{\mathcal{I}} % Calligraphic I +\newcommand{\JJJ}{\mathcal{J}} % Calligraphic J +\newcommand{\KKK}{\mathcal{K}} % Calligraphic K +\newcommand{\LLL}{\mathcal{L}} % Calligraphic L +\newcommand{\MMM}{\mathcal{M}} % Calligraphic M +\newcommand{\NNN}{\mathcal{N}} % Calligraphic N +\newcommand{\OOO}{\mathcal{O}} % Calligraphic O +\newcommand{\PPP}{\mathcal{P}} % Calligraphic P +\newcommand{\QQQ}{\mathcal{Q}} % Calligraphic Q +\newcommand{\RRR}{\mathcal{R}} % Calligraphic R +\newcommand{\SSS}{\mathcal{S}} % Calligraphic S +\newcommand{\TTT}{\mathcal{T}} % Calligraphic T +\newcommand{\UUU}{\mathcal{U}} % Calligraphic U +\newcommand{\VVV}{\mathcal{V}} % Calligraphic V +\newcommand{\WWW}{\mathcal{W}} % Calligraphic W +\newcommand{\XXX}{\mathcal{X}} % Calligraphic X +\newcommand{\YYY}{\mathcal{Y}} % Calligraphic Y +\newcommand{\ZZZ}{\mathcal{Z}} % Calligraphic Z + +% Fraktur + +\newcommand{\aaa}{\mathfrak{a}} % Fraktur a +\newcommand{\bbb}{\mathfrak{b}} % Fraktur b +\newcommand{\ccc}{\mathfrak{c}} % Fraktur c +\newcommand{\ddd}{\mathfrak{d}} % Fraktur d +\newcommand{\eee}{\mathfrak{e}} % Fraktur e +\newcommand{\fff}{\mathfrak{f}} % Fraktur f +\renewcommand{\ggg}{\mathfrak{g}} % Fraktur g +\newcommand{\hhh}{\mathfrak{h}} % Fraktur h +\newcommand{\iii}{\mathfrak{i}} % Fraktur i +\newcommand{\jjj}{\mathfrak{j}} % Fraktur j +\newcommand{\kkk}{\mathfrak{k}} % Fraktur k +\renewcommand{\lll}{\mathfrak{l}} % Fraktur l +\newcommand{\mmm}{\mathfrak{m}} % Fraktur m +\newcommand{\nnn}{\mathfrak{n}} % Fraktur n +\newcommand{\ooo}{\mathfrak{o}} % Fraktur o +\newcommand{\ppp}{\mathfrak{p}} % Fraktur p +\newcommand{\qqq}{\mathfrak{q}} % Fraktur q +\newcommand{\rrr}{\mathfrak{r}} % Fraktur r +\newcommand{\sss}{\mathfrak{s}} % Fraktur s +\newcommand{\ttt}{\mathfrak{t}} % Fraktur t +\newcommand{\uuu}{\mathfrak{u}} % Fraktur u +\newcommand{\vvv}{\mathfrak{v}} % Fraktur v +\newcommand{\www}{\mathfrak{w}} % Fraktur w +\newcommand{\xxx}{\mathfrak{x}} % Fraktur x +\newcommand{\yyy}{\mathfrak{y}} % Fraktur y +\newcommand{\zzz}{\mathfrak{z}} % Fraktur z + +% Geometry + +\newcommand{\CP}{\mathbb{CP}} % Complex projective space +\newcommand{\iintd}[4]{\iint_{#1} \, #2 \, \dif #3 \, \dif #4} % Double integral +\newcommand{\RP}{\mathbb{RP}} % Real projective space +\newcommand{\intd}[4]{\int_{#1}^{#2} \, #3 \, \dif #4} % Single integral +\newcommand{\iiintd}[5]{\iint_{#1} \, #2 \, \dif #3 \, \dif #4 \, \dif #5} % Triple integral -\newcommand{\function}[5][]{ % Function +% Logic + +\newcommand{\iffb}[2]{\br{#1 \leftrightarrow #2}} % Biconditional +\newcommand{\andb}[2]{\br{#1 \land #2}} % Conjunction +\newcommand{\orb}[2]{\br{#1 \lor #2}} % Disjunction +\newcommand{\nib}[2]{\br{#1 \notin #2}} % Element of +\newcommand{\eqb}[2]{\br{#1 = #2}} % Equal to +\newcommand{\teb}[1]{\br{\exists #1}} % Existential quantifier +\newcommand{\impb}[2]{\br{#1 \rightarrow #2}} % Implication +\newcommand{\ltb}[2]{\br{#1 < #2}} % Less than +\newcommand{\leb}[2]{\br{#1 \le #2}} % Less than or equal to +\newcommand{\notb}[1]{\br{\neg #1}} % Negation +\newcommand{\inb}[2]{\br{#1 \in #2}} % Not element of +\newcommand{\neb}[2]{\br{#1 \ne #2}} % Not equal to +\newcommand{\subb}[2]{\br{#1 \subseteq #2}} % Subset +\newcommand{\fab}[1]{\br{\forall #1}} % Universal quantifier + +% Maps + +\newcommand{\bijection}[7][]{ % Bijection \ifx & \begin{array}{rcl} - #2 & \longrightarrow & #3 \\ - #4 & \longmapsto & #5 + #2 & \longleftrightarrow & #3 \\ + #4 & \longmapsto & #5 \\ + #6 & \longmapsfrom & #7 \end{array} \else - \fullfunction{#1}{#2}{#3}{#4}{#5} + \begin{array}{ccrcl} + #1 & : & #2 & \longrightarrow & #3 \\ + & & #4 & \longmapsto & #5 \\ + & & #6 & \longmapsfrom & #7 + \end{array} \fi } - -\newcommand{\F}{\mathbb{F}} % Finite fields -\newcommand{\N}{\mathbb{N}} % Natural numbers -\newcommand{\Z}{\mathbb{Z}} % Integral numbers -\newcommand{\Q}{\mathbb{Q}} % Rational numbers -\newcommand{\R}{\mathbb{R}} % Real numbers -\newcommand{\C}{\mathbb{C}} % Complex numbers -\renewcommand{\H}{\mathbb{H}} % Quaternion numbers -\newcommand{\A}{\mathbb{A}} % Affine spaces -\renewcommand{\P}{\mathbb{P}} % Projective spaces - \newcommand{\correspondence}[2]{ % Correspondence \cbr{ \begin{array}{c} @@ -105,120 +277,204 @@ \end{array} } } +\newcommand{\function}[5][]{ % Function + \ifx & + \begin{array}{rcl} + #2 & \longrightarrow & #3 \\ + #4 & \longmapsto & #5 + \end{array} + \else + \begin{array}{ccrcl} + #1 & : & #2 & \longrightarrow & #3 \\ + & & #4 & \longmapsto & #5 + \end{array} + \fi +} +\newcommand{\functions}[7][]{ % Functions + \ifx & + \begin{array}{rcl} + #2 & \longrightarrow & #3 \\ + #4 & \longmapsto & #5 \\ + #6 & \longmapsto & #7 + \end{array} + \else + \begin{array}{ccrcl} + #1 & : & #2 & \longrightarrow & #3 \\ + & & #4 & \longmapsto & #5 \\ + & & #6 & \longmapsto & #7 + \end{array} + \fi +} -\newcommand{\intd}[4]{\int_{#1}^{#2} \, #3 \, \dif #4} % Single integral -\newcommand{\iintd}[4]{\iint_{#1} \, #2 \, \dif #3 \, \dif #4} % Double integral -\newcommand{\iiintd}[5]{\iint_{#1} \, #2 \, \dif #3 \, \dif #4 \, \dif #5} % Triple integral +% Matrices -\newcommand{\onebytwo}[2]{ % One by two matrix +\newcommand{\onebytwo}[2]{ % One by two matrix \begin{pmatrix} #1 & #2 \end{pmatrix} } -\newcommand{\onebythree}[3]{ % One by three matrix +\newcommand{\onebythree}[3]{ % One by three matrix \begin{pmatrix} #1 & #2 & #3 \end{pmatrix} } -\newcommand{\twobyone}[2]{ % Two by one matrix +\newcommand{\twobyone}[2]{ % Two by one matrix \begin{pmatrix} #1 \\ #2 \end{pmatrix} } -\newcommand{\twobytwo}[4]{ % Two by two matrix +\newcommand{\twobytwo}[4]{ % Two by two matrix \begin{pmatrix} #1 & #2 \\ #3 & #4 \end{pmatrix} } -\newcommand{\threebyone}[3]{ % Three by one matrix +\newcommand{\threebyone}[3]{ % Three by one matrix \begin{pmatrix} #1 \\ #2 \\ #3 \end{pmatrix} } -\newcommand{\threebythree}[9]{ % Three by three matrix +\newcommand{\threebythree}[9]{ % Three by three matrix \begin{pmatrix} #1 & #2 & #3 \\ #4 & #5 & #6 \\ #7 & #8 & #9 \end{pmatrix} } +\newcommand{\twobytwosmall}[4]{ % Two by two small matrix + \begin{psmallmatrix} + #1 & #2 \\ + #3 & #4 + \end{psmallmatrix} +} -\renewcommand{\aa}{\mathfrak{a}} % Fraktur a -\newcommand{\bb}{\mathfrak{b}} % Fraktur b -\newcommand{\cc}{\mathfrak{c}} % Fraktur c -\newcommand{\dd}{\mathfrak{d}} % Fraktur d -\newcommand{\ee}{\mathfrak{e}} % Fraktur e -\newcommand{\ff}{\mathfrak{f}} % Fraktur f -\renewcommand{\gg}{\mathfrak{g}} % Fraktur g -\newcommand{\hh}{\mathfrak{h}} % Fraktur h -\newcommand{\ii}{\mathfrak{i}} % Fraktur i -\newcommand{\jj}{\mathfrak{j}} % Fraktur j -\newcommand{\kk}{\mathfrak{k}} % Fraktur k -\renewcommand{\ll}{\mathfrak{l}} % Fraktur l -\newcommand{\mm}{\mathfrak{m}} % Fraktur m -\newcommand{\nn}{\mathfrak{n}} % Fraktur n -\newcommand{\oo}{\mathfrak{o}} % Fraktur o -\newcommand{\pp}{\mathfrak{p}} % Fraktur p -\newcommand{\qq}{\mathfrak{q}} % Fraktur q -\newcommand{\rr}{\mathfrak{r}} % Fraktur r -\renewcommand{\ss}{\mathfrak{s}} % Fraktur s -\renewcommand{\tt}{\mathfrak{t}} % Fraktur t -\newcommand{\uu}{\mathfrak{u}} % Fraktur u -\newcommand{\vv}{\mathfrak{v}} % Fraktur v -\newcommand{\ww}{\mathfrak{w}} % Fraktur w -\newcommand{\xx}{\mathfrak{x}} % Fraktur x -\newcommand{\yy}{\mathfrak{y}} % Fraktur y -\newcommand{\zz}{\mathfrak{z}} % Fraktur z - -\renewcommand{\AA}{\mathcal{A}} % Calligraphic A -\newcommand{\BB}{\mathcal{B}} % Calligraphic B -\newcommand{\CC}{\mathcal{C}} % Calligraphic C -\newcommand{\DD}{\mathcal{D}} % Calligraphic D -\newcommand{\EE}{\mathcal{E}} % Calligraphic E -\newcommand{\FF}{\mathcal{F}} % Calligraphic F -\newcommand{\GG}{\mathcal{G}} % Calligraphic G -\newcommand{\HH}{\mathcal{H}} % Calligraphic H -\newcommand{\II}{\mathcal{I}} % Calligraphic I -\newcommand{\JJ}{\mathcal{J}} % Calligraphic J -\newcommand{\KK}{\mathcal{K}} % Calligraphic K -\newcommand{\LL}{\mathcal{L}} % Calligraphic L -\newcommand{\MM}{\mathcal{M}} % Calligraphic M -\newcommand{\NN}{\mathcal{N}} % Calligraphic N -\newcommand{\OO}{\mathcal{O}} % Calligraphic O -\newcommand{\PP}{\mathcal{P}} % Calligraphic P -\newcommand{\QQ}{\mathcal{Q}} % Calligraphic Q -\newcommand{\RR}{\mathcal{R}} % Calligraphic R -\renewcommand{\SS}{\mathcal{S}} % Calligraphic S -\newcommand{\TT}{\mathcal{T}} % Calligraphic T -\newcommand{\UU}{\mathcal{U}} % Calligraphic U -\newcommand{\VV}{\mathcal{V}} % Calligraphic V -\newcommand{\WW}{\mathcal{W}} % Calligraphic W -\newcommand{\XX}{\mathcal{X}} % Calligraphic X -\newcommand{\YY}{\mathcal{Y}} % Calligraphic Y -\newcommand{\ZZ}{\mathcal{Z}} % Calligraphic Z +% Number theory -\newcommand{\notb}[1]{\br{\neg #1}} % Negation -\newcommand{\orb}[2]{\br{#1 \lor #2}} % Disjunction -\newcommand{\andb}[2]{\br{#1 \land #2}} % Conjunction -\newcommand{\impb}[2]{\br{#1 \rightarrow #2}} % Implication -\newcommand{\iffb}[2]{\br{#1 \leftrightarrow #2}} % Biconditional -\newcommand{\fab}[1]{\br{\forall #1}} % Universal quantifier -\newcommand{\teb}[1]{\br{\exists #1}} % Existential quantifier -\newcommand{\eqb}[2]{\br{#1 = #2}} % Equal to -\newcommand{\ltb}[2]{\br{#1 < #2}} % Less than -\newcommand{\leb}[2]{\br{#1 \le #2}} % Less than or equal to -\newcommand{\neb}[2]{\br{#1 \ne #2}} % Not equal to -\newcommand{\inb}[2]{\br{#1 \in #2}} % An element of -\newcommand{\nib}[2]{\br{#1 \notin #2}} % Not an element of -\newcommand{\subb}[2]{\br{#1 \subseteq #2}} % Subset of +\renewcommand{\symbol}[2]{\br{\tfrac{#1}{#2}}} % Power residue symbol +\newcommand{\unit}[1]{\br{\ZZ / #1\ZZ}^\times} % Unit group + +% Operators + +\newoperator{ab} % Abelian +\newoperator{AG} % Affine geometry +\newoperator{alg} % Algebraic +\newoperator{Ann} % Annihilator +\newoperator{area} % Area +\newoperator{Aut} % Automorphism +\newoperator{card} % Cardinality +\newoperator{ch} % Characteristic +\newoperator{Cl} % Class +\newoperator{col} % Column +\newoperator{Corr} % Correspondence +\newoperator{diam} % Diameter +\newoperator{Disc} % Discriminant +\newoperator{dom} % Domain +\newoperator{Em} % Embedding +\newoperator{End} % Endomorphism +\newoperator{fin} % Finite +\newoperator{Fix} % Fixed +\newoperator{Frac} % Fraction +\newoperator{Frob} % Frobenius +\newoperator{Fun} % Function +\newoperator{Gal} % Galois +\newoperator{GL} % General linear +\newoperator{Ham} % Hamming +\newoperator{Homeo} % Homeomorphism +\newoperator{Hom} % Homomorphism +\newoperator{id} % Identity +\newoperator{Im} % Image +\newoperator{Ind} % Index +\newoperator{Ker} % Kernel +\newoperator{lcm} % Least common multiple +\newoperator{Mat} % Matrix +\newoperator{mult} % Multiplicity +\newoperator{new} % New +\newoperator{Nm} % Norm +\newoperator{old} % Old +\newoperator{ord} % Order +\newoperator{Pay} % Payley +\newoperator{PG} % Projective geometry +\newoperator{PGL} % Projective general linear +\newoperator{PSL} % Projective special linear +\newoperator{rad} % Radical +\newoperator{ran} % Range +\newoperator{Res} % Residue +\newoperator{rk} % Rank +\newoperator{Re} % Real +\newoperator{row} % Row +\newoperator{sgn} % Sign +\newoperator{Sing} % Singular +\newoperator{sp} % Span +\newoperator{SL} % Special linear +\newoperator{SO} % Special orthogonal +\newoperator{Spec} % Spectrum +\newoperator{Stab} % Stabiliser +\newoperator{star} % Star +\newoperator{srg} % Strongly regular graph +\newoperator{Sym} % Symmetric +\newoperator{tors} % Torsion +\newoperator{Tr} % Trace +\newoperator{vol} % Volume +\newoperator{wt} % Weight + +% Roman + +\newcommand{\A}{\mathrm{A}} % Roman A +\newcommand{\B}{\mathrm{B}} % Roman B +\newcommand{\C}{\mathrm{C}} % Roman C +\newcommand{\D}{\mathrm{D}} % Roman D +\newcommand{\E}{\mathrm{E}} % Roman E +\newcommand{\F}{\mathrm{F}} % Roman F +\newcommand{\G}{\mathrm{G}} % Roman G +\renewcommand{\H}{\mathrm{H}} % Roman H +\newcommand{\I}{\mathrm{I}} % Roman I +\newcommand{\J}{\mathrm{J}} % Roman J +\newcommand{\K}{\mathrm{K}} % Roman K +\renewcommand{\L}{\mathrm{L}} % Roman L +\newcommand{\M}{\mathrm{M}} % Roman M +\newcommand{\N}{\mathrm{N}} % Roman N +\renewcommand{\O}{\mathrm{O}} % Roman O +\renewcommand{\P}{\mathrm{P}} % Roman P +\newcommand{\Q}{\mathrm{Q}} % Roman Q +\newcommand{\R}{\mathrm{R}} % Roman R +\renewcommand{\S}{\mathrm{S}} % Roman S +\newcommand{\T}{\mathrm{T}} % Roman T +\newcommand{\U}{\mathrm{U}} % Roman U +\newcommand{\V}{\mathrm{V}} % Roman V +\newcommand{\W}{\mathrm{W}} % Roman W +\newcommand{\X}{\mathrm{X}} % Roman X +\newcommand{\Y}{\mathrm{Y}} % Roman Y +\newcommand{\Z}{\mathrm{Z}} % Roman Z -\newcommand{\jacobi}[2]{\br{\tfrac{#1}{#2}}} % Jacobi symbol -\newcommand{\Unit}[1]{\br{\dfrac{\Z}{#1\Z}}^\times} % Unit group vertical -\newcommand{\unit}[1]{\br{\Z / #1\Z}^\times} % Unit group horizontal +\renewcommand{\a}{\mathrm{a}} % Roman a +\renewcommand{\b}{\mathrm{b}} % Roman b +\renewcommand{\c}{\mathrm{c}} % Roman c +\renewcommand{\d}{\mathrm{d}} % Roman d +\newcommand{\e}{\mathrm{e}} % Roman e +\newcommand{\f}{\mathrm{f}} % Roman f +\newcommand{\g}{\mathrm{g}} % Roman g +\newcommand{\h}{\mathrm{h}} % Roman h +\renewcommand{\i}{\mathrm{i}} % Roman i +\renewcommand{\j}{\mathrm{j}} % Roman j +\renewcommand{\k}{\mathrm{k}} % Roman k +\renewcommand{\l}{\mathrm{l}} % Roman l +\newcommand{\m}{\mathrm{m}} % Roman m +\renewcommand{\n}{\mathrm{n}} % Roman n +\renewcommand{\o}{\mathrm{o}} % Roman o +\newcommand{\p}{\mathrm{p}} % Roman p +\newcommand{\q}{\mathrm{q}} % Roman q +\renewcommand{\r}{\mathrm{r}} % Roman r +\newcommand{\s}{\mathrm{s}} % Roman s +\renewcommand{\t}{\mathrm{t}} % Roman t +\renewcommand{\u}{\mathrm{u}} % Roman u +\renewcommand{\v}{\mathrm{v}} % Roman v +\newcommand{\w}{\mathrm{w}} % Roman w +\newcommand{\x}{\mathrm{x}} % Roman x +\newcommand{\y}{\mathrm{y}} % Roman y +\newcommand{\z}{\mathrm{z}} % Roman z % Tikz diff --git a/main.tex b/main.tex index da95ca9..1b4a13f 100644 --- a/main.tex +++ b/main.tex @@ -20,7 +20,7 @@ \begin{document} -\input{front} +\input{cover} \section{Introduction} @@ -45,10 +45,10 @@ \section{Euclid's algorithm and unique factorisation} \subsection{Divisibility} \begin{definition} -If $ a, b \in \Z $, we say that $ a $ \textbf{divides} $ b $, and $ a \mid b $, if there exists $ c \in \Z $ such that $ b = ac $. If $ a $ does not divide $ b $, write $ a \nmid b $. +If $ a, b \in \ZZ $, we say that $ a $ \textbf{divides} $ b $, and $ a \mid b $, if there exists $ c \in \ZZ $ such that $ b = ac $. If $ a $ does not divide $ b $, write $ a \nmid b $. \end{definition} -If $ a \mid b $ and $ a \mid c $ then $ a \mid rb + sc $ for any $ r, s \in \Z $. +If $ a \mid b $ and $ a \mid c $ then $ a \mid rb + sc $ for any $ r, s \in \ZZ $. \begin{definition} The \textbf{greatest common divisor (gcd)} or \textbf{highest common factor (hcf)} of $ a $ and $ b $ is the largest positive integer dividing $ a $ and $ b $. Write it as $ \br{a, b} $. @@ -59,11 +59,11 @@ \subsection{Divisibility} \end{example*} \begin{note*} -The ring $ \Z $ is a principal ideal domain (PID). If $ f_1, \dots, f_n \in R $, write $ \br{f_1, \dots, f_n} $ for the ideal generated by the $ f_i $. Then for $ a, b \in \Z $, the ideal $ \br{a, b} $ is generated by the gcd $ \br{a, b} $, by Theorem \ref{thm:6} below. +The ring $ \ZZ $ is a principal ideal domain (PID). If $ f_1, \dots, f_n \in R $, write $ \br{f_1, \dots, f_n} $ for the ideal generated by the $ f_i $. Then for $ a, b \in \ZZ $, the ideal $ \br{a, b} $ is generated by the gcd $ \br{a, b} $, by Theorem \ref{thm:6} below. \end{note*} \begin{definition} -$ n \in \Z $ is \textbf{prime} if $ n $ has exactly two positive divisors, namely $ 1 $ and $ n $. +$ n \in \ZZ $ is \textbf{prime} if $ n $ has exactly two positive divisors, namely $ 1 $ and $ n $. \end{definition} \begin{note*} @@ -77,7 +77,7 @@ \subsection{Divisibility} \subsection{Euclid's algorithm} \begin{proposition} -If $ a, b \in \Z $, not both zero, then for any $ n \in \Z $, $ \br{a, b} = \br{a, b - na} $. +If $ a, b \in \ZZ $, not both zero, then for any $ n \in \ZZ $, $ \br{a, b} = \br{a, b - na} $. \end{proposition} \begin{proof} @@ -86,14 +86,14 @@ \subsection{Euclid's algorithm} \begin{theorem} \label{thm:5} -Let $ a, b \in \Z $ with $ b > 0 $. Then there exist unique $ q, r \in \Z $ with $ 0 \le r < b $ and $ a = qb + r $. +Let $ a, b \in \ZZ $ with $ b > 0 $. Then there exist unique $ q, r \in \ZZ $ with $ 0 \le r < b $ and $ a = qb + r $. \end{theorem} \begin{proof} Take $ q = \fbr{a / b} $. By definition $ 0 \le a / b - q < 1 $, that is $ 0 \le a - qb < b $, so take $ r = a - qb $. Uniqueness is easy. \end{proof} -\textbf{Euclid's algorithm} is as follows. Let $ a, b \in \Z $ not both zero. Without loss of generality, $ 0 \le b \le a $. +\textbf{Euclid's algorithm} is as follows. Let $ a, b \in \ZZ $ not both zero. Without loss of generality, $ 0 \le b \le a $. \begin{enumerate}[leftmargin=0.5in, label=Step \arabic*.] \item If $ b = 0 $, output $ a $. \item Otherwise, replace $ \br{a, b} $ with $ \br{b, r} $ as in Theorem \ref{thm:5}. Then go to step 1. @@ -132,11 +132,11 @@ \subsection{Euclid's algorithm} \begin{theorem} \label{thm:6} -If $ a, b \in \Z $, not both zero, then there exist $ r, s \in \Z $ such that $ \br{a, b} = ra + sb $. +If $ a, b \in \ZZ $, not both zero, then there exist $ r, s \in \ZZ $ such that $ \br{a, b} = ra + sb $. \end{theorem} \begin{proof} -Exercise: idea is to write $ \br{a_n, b_n} $ for the sequence of pairs in Euclid's algorithm, and use downwards induction on $ n $. +Idea is to write $ \br{a_n, b_n} $ for the sequence of pairs in Euclid's algorithm, and use downwards induction on $ n $. \footnote{Exercise} \end{proof} \pagebreak @@ -145,7 +145,7 @@ \subsection{Unique factorisation} \begin{proposition} \label{prop:7} -Let $ n, a, b \in \Z $ with $ n \mid ab $ and $ \br{n, a} = 1 $. Then $ n \mid b $. +Let $ n, a, b \in \ZZ $ with $ n \mid ab $ and $ \br{n, a} = 1 $. Then $ n \mid b $. \end{proposition} \begin{proof} @@ -171,10 +171,10 @@ \subsection{Unique factorisation} \end{proposition} \begin{proof} -By \ref{thm:6}, we can write $ 1 = ra + sb $ with $ r, s \in \Z $. So $ n = r\br{na} + s\br{nb} $, which is divisible by $ ab $. +By \ref{thm:6}, we can write $ 1 = ra + sb $ with $ r, s \in \ZZ $. So $ n = r\br{na} + s\br{nb} $, which is divisible by $ ab $. \end{proof} -We say that $ m_1, \dots, m_n \in \Z $ are \textbf{pairwise coprime} if $ \br{m_i, m_j} = 1 $ for all $ i \ne j $. +We say that $ m_1, \dots, m_n \in \ZZ $ are \textbf{pairwise coprime} if $ \br{m_i, m_j} = 1 $ for all $ i \ne j $. \begin{corollary} \label{cor:10} @@ -182,12 +182,12 @@ \subsection{Unique factorisation} \end{corollary} \begin{proof} -Exercise: induction on $ n $, where $ n = 2 $ is Proposition \ref{prop:9}. +Induction on $ n $, where $ n = 2 $ is Proposition \ref{prop:9}. \footnote{Exercise} \end{proof} \begin{proposition} \label{prop:11} -Every $ n \in \Z^* $ can be written as $ \pm p_1 \dots p_r $ where $ p_i $ are prime, and $ r $ could be zero. +Every $ n \in \ZZ^* $ can be written as $ \pm p_1 \dots p_r $ where $ p_i $ are prime, and $ r $ could be zero. \end{proposition} \begin{proof} @@ -195,21 +195,17 @@ \subsection{Unique factorisation} \end{proof} \begin{theorem} -Every $ n \in \Z_{> 0} $ can be written as $ \pm p_1 \dots p_r $ where $ p_i $ are prime and are uniquely determined up to ordering. +Every $ n \in \ZZ_{> 0} $ can be written as $ \pm p_1 \dots p_r $ where $ p_i $ are prime and are uniquely determined up to ordering. \end{theorem} \begin{proof} -Existence is Proposition \ref{prop:11}. For uniqueness, suppose that -$$ n = p_1 \dots p_r = q_1 \dots q_s, $$ -with $ p_i $ and $ q_i $ prime. Then without loss of generality suppose $ r, s \ge 1 $. Then $ p_1 \mid p_1 \dots p_r $, so $ p_1 \mid q_1 \dots q_s $. By Corollary \ref{cor:8}, either $ p_1 \mid q_1 $ or $ p_1 \mid q_2 \dots q_s $. Proceeding inductively, eventually $ p_1 \mid q_i $ for some $ i $. Since $ q_i $ is prime this means $ p_1 = q_i $. We then have -$$ p_2 \dots p_r = q_1 \dots q_{i - 1}q_{i + 1} \dots q_s. $$ -Since this product is smaller than $ n $, by the inductive hypothesis we must have $ r - 1 = s - 1 $ and the $ p_i $, except $ p_1 $, are a rearrangement of the $ q_j $, except $ q_i $. +Existence is Proposition \ref{prop:11}. Suppose that $ n = p_1 \dots p_r = q_1 \dots q_s $, with $ p_i $ and $ q_i $ prime. Then without loss of generality suppose $ r, s \ge 1 $. Then $ p_1 \mid p_1 \dots p_r $, so $ p_1 \mid q_1 \dots q_s $. By Corollary \ref{cor:8}, either $ p_1 \mid q_1 $ or $ p_1 \mid q_2 \dots q_s $. Proceeding inductively, eventually $ p_1 \mid q_i $ for some $ i $. Since $ q_i $ is prime this means $ p_1 = q_i $. We then have $ p_2 \dots p_r = q_1 \dots q_{i - 1}q_{i + 1} \dots q_s $. Since this product is smaller than $ n $, by the inductive hypothesis we must have $ r - 1 = s - 1 $ and the $ p_i $, except $ p_1 $, are a rearrangement of the $ q_j $, except $ q_i $. \end{proof} \subsection{Linear diophantine equations} -Let $ a, b, c \in \Z^* $. Want to solve -$$ ax + by = c, \qquad x, y \in \Z. $$ +Let $ a, b, c \in \ZZ^* $. Want to solve +$$ ax + by = c, \qquad x, y \in \ZZ. $$ \begin{example*} $ 2x + 6y = 3 $ has no solutions. @@ -217,7 +213,7 @@ \subsection{Linear diophantine equations} In general, there are no solutions if $ \br{a, b} \nmid c $. Suppose that $ \br{a, b} \mid c $. Then $$ ax + by = c \qquad \iff \qquad \dfrac{a}{\br{a, b}}x + \dfrac{b}{\br{a, b}}y = \dfrac{c}{\br{a, b}}. $$ -By Theorem \ref{thm:6}, since $ \br{a / \br{a, b}, b / \br{a, b}} = 1 $, we can find $ r, s \in \Z $ with $ ar / \br{a, b} + bs / \br{a, b} = 1 $, so +By Theorem \ref{thm:6}, since $ \br{a / \br{a, b}, b / \br{a, b}} = 1 $, we can find $ r, s \in \ZZ $ with $ ar / \br{a, b} + bs / \br{a, b} = 1 $, so $$ \dfrac{a}{\br{a, b}}\br{\dfrac{rc}{\br{a, b}}} + \dfrac{b}{\br{a, b}}\br{\dfrac{sc}{\br{a, b}}} = \dfrac{c}{\br{a, b}}. $$ So $ x = rc / \br{a, b} $ and $ y = sc / \br{a, b} $ is a solution. Then $ X $ and $ Y $ is another solution if and only if $$ \dfrac{a}{\br{a, b}}X + \dfrac{b}{\br{a, b}}Y = \dfrac{a}{\br{a, b}}x + \dfrac{b}{\br{a, b}}y \qquad \iff \qquad \dfrac{a}{\br{a, b}} \ \Bigg| \ y - Y, \qquad \dfrac{b}{\br{a, b}} \ \Bigg| \ X - x. $$ @@ -231,24 +227,24 @@ \section{Congruences and modular arithmetic} \subsection{Congruences} \begin{definition} -Let $ n \in \Z^* $, usually $ n > 0 $. Let $ a, b \in \Z $. We say that $ a $ is \textbf{congruent to $ b \mod n $} if and only if $ n \mid a - b $. Write $ a \equiv b \mod n $. +Let $ n \in \ZZ^* $, usually $ n > 0 $. Let $ a, b \in \ZZ $. We say that $ a $ is \textbf{congruent to $ b \mod n $} if and only if $ n \mid a - b $. Write $ a \equiv b \mod n $. \end{definition} -$ \equiv $ is an equivalence relation, and we write $ \Z / n\Z $ for the equivalence classes, which is a ring. +$ \equiv $ is an equivalence relation, and we write $ \ZZ / n\ZZ $ for the equivalence classes, which is a ring. \begin{example*} If $ a \equiv b \mod n $ and $ c \equiv d \mod n $, then $$ a + c \equiv b + d \mod n, \qquad ac \equiv bd \mod n. $$ \end{example*} -If $ a \in \Z $, we sometimes write $ \overline{a} $ for the image of $ a $ in $ \Z / n\Z $. +If $ a \in \ZZ $, we sometimes write $ \overline{a} $ for the image of $ a $ in $ \ZZ / n\ZZ $. \begin{example*} If $ n = 12 $, then $ \overline{25} = \overline{1} $. \end{example*} -So every element of $ \Z / n\Z $ is equal to $ \overline{r} $ for some unique $ r \in \cbr{0, \dots, n - 1} $. We often write -$$ \dfrac{\Z}{n\Z} = \cbr{0, \dots, n - 1}. $$ +So every element of $ \ZZ / n\ZZ $ is equal to $ \overline{r} $ for some unique $ r \in \cbr{0, \dots, n - 1} $. We often write +$$ \ZZ / n\ZZ = \cbr{0, \dots, n - 1}. $$ \begin{example*} If $ n = 6 $, we could write $ 3 + 4 = 1 $ and $ 3 \times 4 = 0 $. @@ -259,18 +255,18 @@ \subsection{Congruences} \begin{example*} \hfill \begin{itemize} -\item $ \Z^\times = \cbr{\pm 1} $. -\item $ \Q^\times = \Q \setminus \cbr{0} = \cbr{x \in \Q \mid x \ne 0} $. +\item $ \ZZ^\times = \cbr{\pm 1} $. +\item $ \QQ^\times = \QQ \setminus \cbr{0} = \cbr{x \in \QQ \st x \ne 0} $. \end{itemize} \end{example*} -We want to understand $ \unit{n} $. Which elements of $ \cbr{0, \dots, n - 1} $ are in $ \unit{n} $? If $ r \in \Z $ and $ r \in \unit{n} $ then there exists $ s \in \Z $ such that $ rs \equiv 1 \mod n $. This implies that $ \br{r, n} = 1 $. Conversely, if $ \br{r, n} = 1 $, then there exist $ x, y \in \Z $ such that $ rx + ny = 1 $, that is $ rx \equiv 1 \mod n $, that is $ r $ is a unit. So -$$ \Unit{n} = \cbr{0 \le i < n \mid \br{i, n} = 1}. $$ +We want to understand $ \unit{n} $. Which elements of $ \cbr{0, \dots, n - 1} $ are in $ \unit{n} $? If $ r \in \ZZ $ and $ r \in \unit{n} $ then there exists $ s \in \ZZ $ such that $ rs \equiv 1 \mod n $. This implies that $ \br{r, n} = 1 $. Conversely, if $ \br{r, n} = 1 $, then there exist $ x, y \in \ZZ $ such that $ rx + ny = 1 $, that is $ rx \equiv 1 \mod n $, that is $ r $ is a unit. So +$$ \unit{n} = \cbr{0 \le i < n \st \br{i, n} = 1}. $$ \begin{example*} If $ p $ is a prime, then -$$ \Unit{p} = \cbr{1, \dots, p - 1}. $$ -So $ \Z / p\Z $ is a ring with the property that every non-zero element has a multiplicative inverse, so it is a field. Another equivalent way to see this is to check that $ p\Z $ is a maximal ideal of $ \Z $. +$$ \unit{p} = \cbr{1, \dots, p - 1}. $$ +So $ \ZZ / p\ZZ $ is a ring with the property that every non-zero element has a multiplicative inverse, so it is a field. Another equivalent way to see this is to check that $ p\ZZ $ is a maximal ideal of $ \ZZ $. \end{example*} Thus every non-zero congruence class modulo $ p $ is a unit. @@ -282,9 +278,9 @@ \subsection{Linear congruence equations} \lecture{3}{Wednesday}{10/10/18} Consider the question of solving -$$ ax \equiv b \mod c, \qquad a, b, c, x \in \Z. $$ +$$ ax \equiv b \mod c, \qquad a, b, c, x \in \ZZ. $$ This is equivalent to solving -$$ ax + cy = b, \qquad y \in \Z. $$ +$$ ax + cy = b, \qquad y \in \ZZ. $$ We saw yesterday that this has solutions if and only if $ \br{a, c} \mid b $. Furthermore, there is a unique solution modulo $ c / \br{a, c} $, because all the solutions are obtained by adding multiples of $ c / \br{a, c} $ to our given $ x $, and subtracting the corresponding multiple of $ a / \br{a, c} $ from $ y $. This implies that there are $ \br{a, c} $ solutions to the original congruence modulo $ c $. If $ x_0 $ is one solution, the others are $$ x_0 + \dfrac{cj}{\br{a, c}}, \qquad 0 \le j < \br{a, c}. $$ In particular, if $ \br{a, c} = 1 $ then there is a unique solution to $ ax \equiv b \mod c $. Indeed $ a \in \unit{c} $, so it has an inverse $ a^{-1} $, and $ x \equiv a^{-1}b \mod c $ is the unique solution. @@ -301,10 +297,10 @@ \subsection{The Chinese remainder theorem} \begin{theorem}[Chinese remainder theorem] \label{thm:14} -Let $ m_1, \dots, m_n \in \Z_{> 0} $ be pairwise coprime. Then the natural map -$$ \dfrac{\Z}{m_1 \dots m_n\Z} \xrightarrow{\sim} \dfrac{\Z}{m_1\Z} \times \dots \times \dfrac{\Z}{m_n\Z} $$ +Let $ m_1, \dots, m_n \in \ZZ_{> 0} $ be pairwise coprime. Then the natural map +$$ \ZZ / m_1 \dots m_n\ZZ \xrightarrow{\sim} \ZZ / m_1\ZZ \times \dots \times \ZZ / m_n\ZZ $$ is an isomorphism of rings. Consequently, -$$ \Unit{m_1 \dots m_n} \xrightarrow{\sim} \Unit{m_1} \times \dots \times \Unit{m_n} $$ +$$ \unit{m_1 \dots m_n} \xrightarrow{\sim} \unit{m_1} \times \dots \times \unit{m_n} $$ is an isomorphism of abelian groups. \end{theorem} @@ -314,12 +310,12 @@ \subsection{The Chinese remainder theorem} \begin{proof} The map -$$ \dfrac{\Z}{m_1 \dots m_n\Z} \to \dfrac{\Z}{m_1\Z} \times \dots \times \dfrac{\Z}{m_n\Z} $$ +$$ \ZZ / m_1 \dots m_n\ZZ \to \ZZ / m_1\ZZ \times \dots \times \ZZ / m_n\ZZ $$ is a ring homomorphism between two rings of order, or cardinality, $ m_1 \dots m_n $. So to show that it is an isomorphism, it is enough to show that it is an injection, so we only need to check that the kernel is zero. So we need to know that if $ m_i \mid N $ for all $ i $, then $ m_1 \dots m_n \mid N $. This is Corollary \ref{cor:10}. For the second part, just use that if $ R $ and $ S $ are rings, then $$ \br{R \times S}^\times \cong R^\times \times S^\times. $$ \end{proof} -The first part says that given any $ a_i \in \Z $, there is a unique $ x \mod m_1 \dots m_n $ with $ x \equiv a_i \mod m_i $. Write +The first part says that given any $ a_i \in \ZZ $, there is a unique $ x \mod m_1 \dots m_n $ with $ x \equiv a_i \mod m_i $. Write $$ M = m_1 \dots m_n, \qquad M_i = \dfrac{M}{m_i}. $$ Choose $ q_i $ such that $ q_iM_i \equiv 1 \mod m_i $, using $ \br{M_i, m_i} = 1 $ because $ \br{m_j, m_i} = 1 $ for all $ j \ne i $. Then take $$ x = a_1q_1M_1 + \dots + a_nq_nM_n. $$ @@ -333,7 +329,7 @@ \section{The structure of \texorpdfstring{$ \unit{n} $}{Z/nZ}} \subsection{The Euler \texorpdfstring{$ \Phi $}{Phi} function} Let $ \Phi\br{n} $ be the order of $ \unit{n} $, that is -$$ \Phi\br{n} = \#\cbr{1 \le i < n \mid \br{i, n} = 1}. $$ +$$ \Phi\br{n} = \#\cbr{1 \le i < n \st \br{i, n} = 1}. $$ \begin{example*} If $ p $ is prime, $ \Phi\br{p} = p - 1 $. @@ -348,13 +344,9 @@ \subsection{The Euler \texorpdfstring{$ \Phi $}{Phi} function} \end{definition} $ \Phi $ is multiplicative by Theorem \ref{thm:14}, because if $ \br{m, n} = 1 $ then -$$ \Unit{mn} \xrightarrow{\sim} \Unit{m} \times \Unit{n}. $$ -$ \Phi $ is not strongly multiplicative, since -$$ \Phi\br{4} = 2 \ne 1 = \Phi\br{2}\Phi\br{2}. $$ -Write $ n = \prod_i p_i^{a_i} $, where $ p_i $ are distinct primes. Then -$$ \Phi\br{n} = \prod_i \Phi\br{p_i^{a_i}}. $$ -If $ p $ is prime then -$$ \Phi\br{p^a} = \#\cbr{1 \le i < p^a \mid \br{i, p^a} = 1} = \#\cbr{1 \le i < p^a \mid p \nmid i} = p^a - p^{a - 1} = p^a\br{1 - \dfrac{1}{p}}. $$ +$$ \unit{mn} \xrightarrow{\sim} \unit{m} \times \unit{n}. $$ +$ \Phi $ is not strongly multiplicative, since $ \Phi\br{4} = 2 \ne 1 = \Phi\br{2}\Phi\br{2} $. Write $ n = \prod_i p_i^{a_i} $, where $ p_i $ are distinct primes. Then $ \Phi\br{n} = \prod_i \Phi\br{p_i^{a_i}} $. If $ p $ is prime then +$$ \Phi\br{p^a} = \#\cbr{1 \le i < p^a \st \br{i, p^a} = 1} = \#\cbr{1 \le i < p^a \st p \nmid i} = p^a - p^{a - 1} = p^a\br{1 - \dfrac{1}{p}}. $$ If $ n = \prod_i p_i^{a_i} $, then $$ \Phi\br{n} = \prod_i \Phi\br{p_i^{a_i}} = \prod_i p_i^{a_i}\br{1 - \dfrac{1}{p_i}} = n\prod_i \br{1 - \dfrac{1}{p_i}} = n\prod_{p \mid n} \br{1 - \dfrac{1}{p}}. $$ @@ -382,19 +374,15 @@ \subsection{Euler's theorem} Next, want to understand the structure of $ \unit{n} $. By Theorem \ref{thm:14}, it is enough to study the case that $ n $ is a prime power. We will begin by considering the case that $ n $ is prime. \begin{example*} -Let $ n = 5 $. Then -$$ \Unit{5} = \cbr{1, 2, 3, 4}. $$ -This has order four. So it is either cyclic of order four or a product of two cyclic groups of order two. $ 2^2 = 4 $, $ 2^3 = 3 $, and $ 2^4 = 1 $ in $ \unit{5} $. So $ \unit{5} $ is cyclic of order four. +Let $ n = 5 $. Then$ \unit{5} = \cbr{1, 2, 3, 4} $. This has order four. So it is either cyclic of order four or a product of two cyclic groups of order two. Since $ 2^2 = 4 $, $ 2^3 = 3 $, and $ 2^4 = 1 $, $ \unit{5} $ is cyclic of order four. \end{example*} -\pagebreak - Next, $ \unit{p} $ is cyclic of order $ p - 1 $ for any prime $ p $. \lecture{4}{Friday}{12/10/18} \begin{definition} -If $ G $ is a group and $ g \in G $ is an element, the \textbf{order} of $ g $ is the least $ a \ge 1 $ such that $ g^a = 1 $. In particular, if $ \br{g, n} = 1 $, then we write $ ord_n\br{g} $ for the order of $ g $ in $ \unit{n} $, the \textbf{order of $ g $ modulo $ n $}. +If $ G $ is a group and $ g \in G $ is an element, the \textbf{order} of $ g $ is the least $ a \ge 1 $ such that $ g^a = 1 $. In particular, if $ \br{g, n} = 1 $, then we write $ \ord_n g $ for the order of $ g $ in $ \unit{n} $, the \textbf{order of $ g $ modulo $ n $}. \end{definition} \begin{proposition} @@ -406,38 +394,29 @@ \subsection{Euler's theorem} If $ n = ab $ then $ g^n = \br{g^a}^b = 1^b = 1 $. Conversely, write $ n = ab + r $ with $ 0 \le r < a $. Then $ g^r = 1 $ and since $ r < a $ we have $ r = 0 $. \end{proof} -In particular, if $ \br{g, n} = 1 $, then $ g^{\Phi\br{n}} = 1 $, by Euler's theorem, so Proposition \ref{prop:19} implies that $ ord_n\br{g} \mid \Phi\br{n} $. We want to prove that if $ p $ is prime, then $ \unit{p} $ is cyclic. Equivalently, we need to show that there exists $ g $ such that -$$ ord_p\br{g} = \Phi\br{p} = p - 1. $$ -We will do this by counting the number of elements of each order. The key point is that $ \Z / p\Z $ is a field. For any $ d \ge 1 $, the elements of $ \unit{p} $ of order dividing $ d $ are exactly the roots of the $ X^d - 1 $ in $ \Z / p\Z $, by Proposition \ref{prop:19}. +\pagebreak + +In particular, if $ \br{g, n} = 1 $, then $ g^{\Phi\br{n}} = 1 $, by Euler's theorem, so Proposition \ref{prop:19} implies that $ \ord_n g \mid \Phi\br{n} $. We want to prove that if $ p $ is prime, then $ \unit{p} $ is cyclic. Equivalently, we need to show that there exists $ g $ such that $ \ord_p g = \Phi\br{p} = p - 1 $. We will do this by counting the number of elements of each order. The key point is that $ \ZZ / p\ZZ $ is a field. For any $ d \ge 1 $, the elements of $ \unit{p} $ of order dividing $ d $ are exactly the roots of the $ X^d - 1 $ in $ \ZZ / p\ZZ $, by Proposition \ref{prop:19}. \begin{example*} The equation $ X^2 = 1 $ has exactly two solutions modulo $ p $ for any prime $ p $, namely $ \pm 1 $, but it can have more modulo $ n $ if $ n $ is composite. For example, if $ n = 15 $, then $ 4 $ and $ 11 $ are also solutions, since $ X^2 - 1 \equiv 0 \mod n $ if and only if $ n \mid \br{X + 1}\br{X - 1} $, for example $ 15 \mid \br{4 + 1}\br{4 - 1} $. \end{example*} \begin{definition} -$ g \in \Z $ with $ \br{g, p} = 1 $ is a \textbf{primitive root} if $ ord_p\br{g} = p - 1 $, that is $ \unit{p} = \abr{g} $. +$ g \in \ZZ $ with $ \br{g, p} = 1 $ is a \textbf{primitive root} if $ \ord_p g = p - 1 $, that is $ \unit{p} = \abr{g} $. \end{definition} \begin{lemma} \label{lem:21} -Let $ R $ be a commutative ring, and let $ P\br{X} \in R\sbr{X} $. If $ \alpha \in R $ has $ P\br{\alpha} = 0 $, then there exists $ Q\br{X} \in R\sbr{X} $ such that -$$ P\br{X} = \br{X - \alpha}Q\br{X}. $$ +Let $ R $ be a commutative ring, and let $ P\br{X} \in R\sbr{X} $. If $ \alpha \in R $ has $ P\br{\alpha} = 0 $, then there exists $ Q\br{X} \in R\sbr{X} $ such that $ P\br{X} = \br{X - \alpha}Q\br{X} $. \end{lemma} \begin{example*} -If $ R = \Z / 15\Z $, -$$ X^2 - 1 = \br{X + 1}\br{X - 1} = \br{X + 4}\br{X - 4}. $$ +If $ R = \ZZ / 15\ZZ $, $ X^2 - 1 = \br{X + 1}\br{X - 1} = \br{X + 4}\br{X - 4} $. \end{example*} \begin{proof} -Induction on $ \deg\br{P} $. $ \deg\br{P} = 0 $ is obvious. Let $ \deg\br{P} = d $, and assume the result holds for degree at most $ d - 1 $. Let -$$ P\br{X} = cX^d + \dots, \qquad S\br{X} = P\br{X} - cX^{d - 1}\br{X - \alpha}. $$ -Then $ S\br{X} $ has degree at most $ d - 1 $. Also $ S\br{\alpha} = 0 $. By induction, we can write -$$ S\br{X} = \br{X - \alpha}R\br{X}. $$ -Set -$$ Q\br{X} = cX^{d - 1} + R\br{X}. $$ -Then -$$ \br{X - \alpha}Q\br{X} = cX^{d - 1}\br{X - \alpha} + S\br{X} = P\br{X}. $$ +Induction on $ \deg P $, where $ \deg P = 0 $ is obvious. Let $ \deg P = d $, and assume the result holds for degree at most $ d - 1 $. Let $ P\br{X} = cX^d + \dots $ and $ S\br{X} = P\br{X} - cX^{d - 1}\br{X - \alpha} $. Then $ S\br{X} $ has degree at most $ d - 1 $. Also $ S\br{\alpha} = 0 $. By induction, we can write $ S\br{X} = \br{X - \alpha}R\br{X} $. Set $ Q\br{X} = cX^{d - 1} + R\br{X} $. Then $ \br{X - \alpha}Q\br{X} = cX^{d - 1}\br{X - \alpha} + S\br{X} = P\br{X} $. \end{proof} \begin{theorem} @@ -446,7 +425,7 @@ \subsection{Euler's theorem} \end{theorem} \begin{proof} -Induction on $ d = \deg\br{P} $. $ d = 1 $ is obvious. If $ P $ has no roots, then we are done. Otherwise, let $ \alpha $ be a root. By Lemma \ref{lem:21}, $ P\br{X} = \br{X - \alpha}Q\br{X} $, and $ Q\br{X} $ has degree $ d - 1 $, so we are done by induction. +Induction on $ d = \deg P $, where $ d = 1 $ is obvious. If $ P $ has no roots, then we are done. Otherwise, let $ \alpha $ be a root. By Lemma \ref{lem:21}, $ P\br{X} = \br{X - \alpha}Q\br{X} $, and $ Q\br{X} $ has degree $ d - 1 $, so we are done by induction. \end{proof} \begin{corollary} @@ -455,13 +434,11 @@ \subsection{Euler's theorem} \end{corollary} \begin{proof} -We have to show that $ X^d - 1 $ has exactly $ d $ roots in $ \Z / p\Z $. $ X^{p - 1} - 1 $ has exactly $ p - 1 $ roots, by Fermat's little theorem. Since $ d \mid p - 1 $, we can write -$$ X^{p - 1} - 1 = \br{X^d - 1}\br{\br{X^d}^{\tfrac{p - 1}{d} - 1} + \dots + 1} = \br{X^d - 1}Q\br{X}, \qquad \deg\br{Q} = p - 1 - d. $$ +We have to show that $ X^d - 1 $ has exactly $ d $ roots in $ \ZZ / p\ZZ $. By Fermat's little theorem, $ X^{p - 1} - 1 $ has exactly $ p - 1 $ roots. Since $ d \mid p - 1 $, we can write +$$ X^{p - 1} - 1 = \br{X^d - 1}\br{\br{X^d}^{\tfrac{p - 1}{d} - 1} + \dots + 1} = \br{X^d - 1}Q\br{X}, \qquad \deg Q = p - 1 - d. $$ Then $ X^{p - 1} - 1 $ has exactly $ p - 1 $ roots, $ X^d - 1 $ has at most $ d $ roots, and $ Q\br{X} $ has at most $ p - 1 - d $ roots, by Theorem \ref{thm:22}. So $ X^d - 1 $ has exactly $ d $ roots. \end{proof} -\pagebreak - \begin{example*} Let $ p = 7 $. There are \begin{itemize} @@ -479,18 +456,18 @@ \subsection{Euler's theorem} \end{lemma} \begin{proof} -For each $ d \mid n $, the elements of $ \cbr{1, \dots, n} $ with $ \br{i, n} = n / d $ are exactly those of the form -$$ i = \br{\dfrac{n}{d}}j, \qquad 1 \le j \le d, \qquad \br{j, d} = 1. $$ -There are exactly $ \Phi\br{d} $ such elements. Since the $ n / d $ run over all the divisors of $ n $, we are done. +For each $ d \mid n $, the elements of $ \cbr{1, \dots, n} $ with $ \br{i, n} = n / d $ are exactly those of the form $ i = \br{n / d}j $ for $ 1 \le j \le d $ and $ \br{j, d} = 1 $. There are exactly $ \Phi\br{d} $ such elements. Since the $ n / d $ run over all the divisors of $ n $, we are done. \end{proof} +\pagebreak + \begin{theorem} \label{thm:25} Let $ p $ be prime, and let $ d \mid p - 1 $. Then there are exactly $ \Phi\br{d} $ elements of $ \unit{p} $ of order $ d $. In particular, there are $ \Phi\br{p - 1} $ primitive roots, and $ \unit{p} $ is cyclic. \end{theorem} \begin{proof} -Induction on $ d $. $ d = 1 $ is obvious. Assume the result holds for all $ d' \mid d $ and $ d' \ne d $. Then by Lemma \ref{lem:24}, +Induction on $ d $, where $ d = 1 $ is obvious. Assume the result holds for all $ d' \mid d $ and $ d' \ne d $. Then by Lemma \ref{lem:24}, $$ \Phi\br{d} = d - \sum_{d' \mid d, \ d' \ne d} \Phi\br{d'}. $$ Now use the inductive hypothesis and Corollary \ref{cor:23}. \end{proof} @@ -504,56 +481,27 @@ \subsection{Euler's theorem} \begin{proof} Consider three cases. \begin{itemize}[leftmargin=0.5in] -\item[$ n = 1 $] Theorem \ref{thm:25}. -\item[$ n = 2 $] Let $ g $ be a primitive root modulo $ p $. Claim that either $ g^{p - 1} \not\equiv 1 \mod p^2 $ and $ g $ is a generator for $ \unit{p^2} $, or $ g^{p - 1} \equiv 1 \mod p^2 $ and $ g + p $ is a generator for $ \unit{p^2} $. Either way, $ \unit{p^2} $ is cyclic. -\begin{itemize} -\item Suppose firstly that $ g^{p - 1} \not\equiv 1 \mod p^2 $. Then $ \#\unit{p^2} = \Phi\br{p^2} = p\br{p - 1} $. So -$$ ord_{p^2}\br{g} \mid p\br{p - 1}. $$ -On the other hand, $ g^{ord_{p^2}\br{g}} \equiv 1 \mod p^2 $, so $ g^{ord_{p^2}\br{g}} \equiv 1 \mod p $, so -$$ p - 1 \mid ord_{p^2}\br{g}, $$ -because $ ord_p\br{g} = p - 1 $ by assumption. But -$$ ord_{p^2}\br{g} \ne p - 1, $$ -as $ g^{p - 1} \not\equiv 1 \mod p^2 $. So -$$ ord_{p^2}\br{g} = p\br{p - 1}, $$ -as required. -\item Suppose now that $ g^{p - 1} \equiv 1 \mod p^2 $. It suffices to show that -$$ \br{g + p}^{p - 1} \not\equiv 1 \mod p^2, $$ -as we can then apply the analysis above with $ g + p $ in place of $ g $. By the binomial theorem, +\item[$ n = 1 $.] Theorem \ref{thm:25}. +\item[$ n = 2 $.] Let $ g $ be a primitive root modulo $ p $. Claim that either $ g^{p - 1} \not\equiv 1 \mod p^2 $ and $ g $ is a generator for $ \unit{p^2} $, or $ g^{p - 1} \equiv 1 \mod p^2 $ and $ g + p $ is a generator for $ \unit{p^2} $. Either way, $ \unit{p^2} $ is cyclic. Suppose firstly that +$$ g^{p - 1} \not\equiv 1 \mod p^2. $$ +Then $ \#\unit{p^2} = \Phi\br{p^2} = p\br{p - 1} $. So $ \ord_{p^2} g \mid p\br{p - 1} $. On the other hand, $ g^{\ord_{p^2} g} \equiv 1 \mod p^2 $, so $ g^{\ord_{p^2} g} \equiv 1 \mod p $, so $ p - 1 \mid \ord_{p^2} g $, because $ \ord_p g = p - 1 $ by assumption. But $ \ord_{p^2} g \ne p - 1 $, as $ g^{p - 1} \not\equiv 1 \mod p^2 $. So $ \ord_{p^2} g = p\br{p - 1} $, as required. Suppose now that +$$ g^{p - 1} \equiv 1 \mod p^2. $$ +It suffices to show that $ \br{g + p}^{p - 1} \not\equiv 1 \mod p^2 $, as we can then apply the analysis above with $ g + p $ in place of $ g $. By the binomial theorem, $$ \br{g + p}^{p - 1} \equiv g^{p - 1} + \br{p - 1}g^{p - 2}p \equiv 1 + \br{p - 1}g^{p - 2}p \mod p^2. $$ -Since $ p \nmid \br{p - 1}g^{p - 2} $, -$$ \br{g + p}^{p - 1} \not\equiv 1 \mod p^2, $$ -as required. -\end{itemize} - -\pagebreak - -\item[$ n \ge 2 $] It suffices to show that if $ ord_{p^2}\br{g} = p\br{p - 1} $, then $ ord_{p^n}\br{g} = p^{n - 1}\br{p - 1} $. We do this by induction on $ n $. So assume that -$$ ord_{p^n}\br{g} = p^{n - 1}\br{p - 1}. $$ -Then -$$ ord_{p^n}\br{g} \mid ord_{p^{n + 1}}\br{g}, $$ -and -$$ ord_{p^{n + 1}}\br{g} \mid \Phi\br{p^{n + 1}} = p^n\br{p - 1}. $$ -So either $ ord_{p^{n + 1}}\br{g} = p^n\br{p - 1} $, or $ ord_{p^{n + 1}}\br{g} = p^{n - 1}\br{p - 1} $. So we need to show that +Since $ p \nmid \br{p - 1}g^{p - 2} $, $ \br{g + p}^{p - 1} \not\equiv 1 \mod p^2 $, as required. +\item[$ n \ge 2 $.] It suffices to show that if $ \ord_{p^2} g = p\br{p - 1} $, then $ \ord_{p^n} g = p^{n - 1}\br{p - 1} $. We do this by induction on $ n $. So assume that $ \ord_{p^n} g = p^{n - 1}\br{p - 1} $. Then $ \ord_{p^n} g \mid \ord_{p^{n + 1}} g $, and $ \ord_{p^{n + 1}} g \mid \Phi\br{p^{n + 1}} = p^n\br{p - 1} $. So either $ \ord_{p^{n + 1}} g = p^n\br{p - 1} $, or $ \ord_{p^{n + 1}} g = p^{n - 1}\br{p - 1} $. So we need to show that $$ g^{p^{n - 1}\br{p - 1}} \not\equiv 1 \mod p^{n + 1}. $$ -To do this, consider $ g^{p^{n - 2}\br{p - 1}} $ modulo $ p^{n - 1} $ and modulo $ p^n $. Since $ \Phi\br{p^{n - 1}} = p^{n - 2}\br{p - 1} $, -$$ g^{p^{n - 2}\br{p - 1}} \equiv 1 \mod p^{n - 1}, $$ -by Euler's theorem. Write -$$ g^{p^{n - 2}\br{p - 1}} = 1 + p^{n - 1}t. $$ -Since $ ord_{p^n}\br{g} = p^{n - 1}\br{p - 1} $ by assumption, -$$ g^{p^{n - 2}\br{p - 1}} \not\equiv 1 \mod p^n, $$ -that is $ p \nmid t $. Then +To do this, consider $ g^{p^{n - 2}\br{p - 1}} $ modulo $ p^{n - 1} $ and modulo $ p^n $. Since $ \Phi\br{p^{n - 1}} = p^{n - 2}\br{p - 1} $, by Euler's theorem, $ g^{p^{n - 2}\br{p - 1}} \equiv 1 \mod p^{n - 1} $. Write $ g^{p^{n - 2}\br{p - 1}} = 1 + p^{n - 1}t $. Since $ \ord_{p^n} g = p^{n - 1}\br{p - 1} $ by assumption, $ g^{p^{n - 2}\br{p - 1}} \not\equiv 1 \mod p^n $, that is $ p \nmid t $. Then \begin{align*} g^{p^{n - 1}\br{p - 1}} -& = \br{g^{p^{n - 2}\br{p - 1}}}^p \\ -& = \br{1 + p^{n - 1}t}^p \\ -& = 1 + p^nt + \twobyone{p}{2}p^{2\br{n - 1}}t^2 + \dots + p^{p\br{n - 1}}t^p \\ +& = \br{g^{p^{n - 2}\br{p - 1}}}^p += \br{1 + p^{n - 1}t}^p += 1 + p^nt + \binom{p}{2}p^{2\br{n - 1}}t^2 + \dots + p^{p\br{n - 1}}t^p \\ & \equiv 1 + p^nt \mod p^{n + 1}, \end{align*} since $ r\br{n - 1} \ge n + 1 $ if and only if $ \br{r - 1}n \ge r + 1 $ and $ p > 2 $, so -$$ p^{n + 1} \ \Bigg| \ p^{2n - 1} = p^{2\br{n - 1} + 1} \ \Bigg| \ \twobyone{p}{2}p^{2\br{n - 1}}. $$ -So -$$ g^{p^{n - 1}\br{p - 1}} \not\equiv 1 \mod p^{n + 1}, $$ -because $ p \nmid t $. +$$ p^{n + 1} \ \Bigg| \ p^{2n - 1} = p^{2\br{n - 1} + 1} \ \Bigg| \ \binom{p}{2}p^{2\br{n - 1}}. $$ +So $ g^{p^{n - 1}\br{p - 1}} \not\equiv 1 \mod p^{n + 1} $, because $ p \nmid t $. \end{itemize} \end{proof} @@ -575,27 +523,21 @@ \subsection{Euler's theorem} \end{lemma} \begin{proof} -Induction on $ n $. $ n = 0 $ is obvious. Assume that $ 5^{2^n} = 1 + 2^{n + 2}t $ with $ t $ odd. Then +Induction on $ n $, where $ n = 0 $ is obvious. Assume that $ 5^{2^n} = 1 + 2^{n + 2}t $ with $ t $ odd. Then $$ 5^{2^{n + 1}} = \br{1 + 2^{n + 1}t}^2 = 1 + 2^{n + 3}t + 2^{2\br{n + 2}}t^2 = 1 + 2^{n + 3}\br{t + 2^{n + 1}t^2}, $$ where $ t + 2^{n + 1}t^2 $ is odd. \end{proof} \begin{proposition} If $ n \ge 2 $ then there is an isomorphism -$$ \Unit{2^n} \xrightarrow{\sim} \dfrac{\Z}{2\Z} \times \dfrac{\Z}{2^{n - 2}\Z}. $$ +$$ \unit{2^n} \xrightarrow{\sim} \ZZ / 2\ZZ \times \ZZ / 2^{n - 2}\ZZ. $$ In particular, if $ n \ge 3 $, then $ \unit{2^n} $ is not cyclic. \end{proposition} \begin{proof} -Let $ \abr{g} $ denote the group -$$ \cbr{1, \dots, g^{ord\br{g} - 1}} $$ -generated by $ g $. Consider the natural map -$$ \abr{-1} \times \abr{5} \to \Unit{2^n}. $$ -This is injective, because if $ \pm 1\br{5}^s \equiv 1 \mod 2^n $ then in particular $ \pm 1\br{5}^s \equiv 1 \mod 4 $ so $ \pm 1 \equiv 1 \mod 4 $, so we must have $ 5^s \equiv 1 \mod 2^n $, that is $ 5^s = 1 $ in $ \abr{5} $. Then $ \abr{-1} $ has order $ 2 $ and $ \abr{5} $ has order $ ord_{2^n}\br{5} = 2^{n - 2} $ by Lemma \ref{lem:27}. So $ \abr{-1} \times \abr{5} $ has order -$$ 2\br{2^{n - 2}} = 2^{n - 1} = \Phi\br{2^n} = \#\Unit{2^n}. $$ -So the map -$$ \abr{-1} \times \abr{5} \to \Unit{2^n} $$ -is an injection of groups of the same order, so it is a bijection. +Let $ \abr{g} $ denote the group $ \cbr{1, \dots, g^{\ord g - 1}} $ generated by $ g $. Consider the natural map +$$ \abr{-1} \times \abr{5} \to \unit{2^n}. $$ +This is injective, because if $ \pm 1\br{5}^s \equiv 1 \mod 2^n $ then in particular $ \pm 1\br{5}^s \equiv 1 \mod 4 $ so $ \pm 1 \equiv 1 \mod 4 $, so we must have $ 5^s \equiv 1 \mod 2^n $, that is $ 5^s = 1 $ in $ \abr{5} $. Then $ \abr{-1} $ has order $ 2 $ and $ \abr{5} $ has order $ \ord_{2^n} 5 = 2^{n - 2} $ by Lemma \ref{lem:27}. So $ \abr{-1} \times \abr{5} $ has order $ 2\br{2^{n - 2}} = 2^{n - 1} = \Phi\br{2^n} = \#\unit{2^n} $. So the map $ \abr{-1} \times \abr{5} \to \unit{2^n} $ is an injection of groups of the same order, so it is a bijection. \end{proof} \begin{theorem} @@ -609,7 +551,7 @@ \subsection{Euler's theorem} \lecture{6}{Wednesday}{17/10/18} -Primitive roots are generators of $ \unit{n} $. Find them in practice by guessing small values of $ g $, and seeing if $ g $ is a generator. There are $ \Phi\br{p - 1} $ primitive roots, which means that you have a high probability of success. Could work out $ 1, \dots, g^{p - 2} $ and check these are distinct. This would be inefficient. Better is to check for some prime $ q \mid p - 1 $ whether $ g^{\br{p - 1} / q} = 1 $ or not. This works, because if $ g^{\br{p - 1} / q} = 1 $ then $ g $ is not a primitive root, while if $ g^{\br{p - 1} / q} \ne 1 $ then $ ord_p\br{g} \mid p - 1 $ and $ ord_p\br{g} \nmid \br{p - 1} / q $. If this holds for all $ q \mid p - 1 $, then $ ord_p\br{g} = p - 1 $, because otherwise it would be a proper divisor, and so would divide $ \br{p - 1} / q $ for some prime $ q \mid p - 1 $. +Primitive roots are generators of $ \unit{n} $. Find them in practice by guessing small values of $ g $, and seeing if $ g $ is a generator. There are $ \Phi\br{p - 1} $ primitive roots, which means that you have a high probability of success. Could work out $ 1, \dots, g^{p - 2} $ and check these are distinct. This would be inefficient. Better is to check for some prime $ q \mid p - 1 $ whether $ g^{\br{p - 1} / q} = 1 $ or not. This works, because if $ g^{\br{p - 1} / q} = 1 $ then $ g $ is not a primitive root, while if $ g^{\br{p - 1} / q} \ne 1 $ then $ \ord_p g \mid p - 1 $ and $ \ord_p g \nmid \br{p - 1} / q $. If this holds for all $ q \mid p - 1 $, then $ \ord_p g = p - 1 $, because otherwise it would be a proper divisor, and so would divide $ \br{p - 1} / q $ for some prime $ q \mid p - 1 $. \begin{example*} Let $ p = 31 $, so $ p - 1 = 30 = \br{2}\br{3}\br{5} $. Then $ g $ is a primitive root if and only if @@ -624,19 +566,19 @@ \subsection{Euler's theorem} \section{Primality testing and factorisation} -The idea is that testing whether $ n \in \Z $ is prime is easy. Factoring $ n $ is expected to be hard. Easy here means that there is an algorithm to check whether $ n $ is prime or not which runs in time polynomial in $ \log\br{n} $. It is known that a deterministic algorithm exists to do this, the \textbf{Agrawal-Kayal-Saxena (AKS) algorithm}, in 2005. We will see an algorithm that runs faster than this in practice. On the other hand, for factoring there are algorithms which are better than exponential in $ \log\br{n} $, but there is nothing close to polynomial time, and the general expectation is that no such algorithm should exist. +The idea is that testing whether $ n \in \ZZ $ is prime is easy. Factoring $ n $ is expected to be hard. Easy here means that there is an algorithm to check whether $ n $ is prime or not which runs in time polynomial in $ \log n $. It is known that a deterministic algorithm exists to do this, the \textbf{Agrawal-Kayal-Saxena (AKS) algorithm}, in 2005. We will see an algorithm that runs faster than this in practice. On the other hand, for factoring there are algorithms which are better than exponential in $ \log n $, but there is nothing close to polynomial time, and the general expectation is that no such algorithm should exist. \subsection{Factorisation} How do we factor three digit numbers, or small four digit numbers, say at most $ 400 $ if we wanted to factor with a paper or a calculator? If $ n \le 400 $ and $ n $ is composite, then it has a prime factor at most $ \sqrt{400} = 20 $, since if $ d \mid n $ then $ d\br{n / d} = n $, so either $ d \le \sqrt{n} $ or $ n / d \le \sqrt{n} $. So you only have to be able to check for divisibility by $$ 2, \quad 3, \quad 5, \quad 7, \quad 11, \quad 13, \quad 17, \quad 19. $$ \begin{itemize}[leftmargin=0.75in] -\item[$ 2, 5 $] Checking for divisibility is easy, by just looking at the last digit. -\item[$ 3, 11 $] Use that $ 10 \equiv 1 \mod 3 $ and $ 10 \equiv -1 \mod 3 $. So +\item[$ 2, 5 $.] Checking for divisibility is easy, by just looking at the last digit. +\item[$ 3, 11 $.] Use that $ 10 \equiv 1 \mod 3 $ and $ 10 \equiv -1 \mod 3 $. So $$ \sum_i a_i10^i \equiv \sum_i a_i \mod 3, \qquad \sum_i a_i10^i \equiv \sum_i a_i\br{-1}^i \mod 11. $$ So you can check divisibility by $ 3 $, or $ 9 $, by checking for the sum of the digits, and $ 11 $ by taking the alternating sum. -\item[$ 7 $] $ 10x + y \equiv 0 \mod 7 $ if and only if $ -2\br{10x + y} \equiv 0 \mod 7 $, if and only if $ x - 2y \equiv 0 \mod 7 $. -\item[$ 13, 17, 19 $] There are no good tests. +\item[$ 7 $.] $ 10x + y \equiv 0 \mod 7 $ if and only if $ -2\br{10x + y} \equiv 0 \mod 7 $, if and only if $ x - 2y \equiv 0 \mod 7 $. +\item[$ 13, 17, 19 $.] There are no good tests. \end{itemize} If $ n \le 400 $ and $ n $ is not divisible by $ 2, 3, 5, 7, 11 $, then the smallest prime factor of $ n $ is at least $ 13 $. Since $ 13^3 > 400 $, it can have at most two prime factors. So if you want to factor numbers at most $ 400 $, you only have to remember a short list $$ 13^2, \quad 13\br{17}, \quad 13\br{19}, \quad 13\br{23}, \quad 13\br{29}, \quad 17^2, \quad 17\br{19}, \quad 17\br{23}, \quad 19^2. $$ @@ -669,7 +611,7 @@ \subsection{Factorisation} \pagebreak -There exist algorithms for factoring $ n $ which run in better than exponential time in $ \log\br{n} $, such as the quadratic sieve and the general number field sieve. +There exist algorithms for factoring $ n $ which run in better than exponential time in $ \log n $, such as the quadratic sieve and the general number field sieve. \begin{example*} Let $ n = 1649 $. Then $ 40^2 < 1649 < 41^2 $, so @@ -686,26 +628,26 @@ \subsection{Factorisation} $$ \br{194, 1649} = 97, \qquad \br{34, 1649} = 17. $$ Can do this quickly using Euclid's algorithm. To make this into an efficient algorithm, need to have a way given $ x_1, \dots, x_r $ to find a subset whose product is a square. If we know the prime factorisation for the $ x_i $, we can write $$ x_i = p_1^{a_{i1}} \dots p_k^{a_{ik}}. $$ -Want to choose $ \epsilon_i \in \cbr{0, 1} $ such that $ \prod_{i = 1}^r x_i^{\epsilon_i} $ is a square. Equivalently, for each $ j $, want the exponent of $ p_j $ to be even, that is +Want to choose $ \epsilon_i = 0, 1 $ such that $ \prod_{i = 1}^r x_i^{\epsilon_i} $ is a square. Equivalently, for each $ j $, want the exponent of $ p_j $ to be even, that is $$ \sum_{i = 1}^r \epsilon_ia_{ij} \equiv 0 \mod 2. $$ Let $$ x_1 = 2^5, \qquad x_2 = \br{5}\br{23}, \qquad x_3 = \br{2}^3\br{5}^2, \qquad p_1 = 2, \qquad p_2 = 5, \qquad p_3 = 23. $$ Ignore all numbers with a large prime factor, so here ignore $ 23 $. Then $$ \onebytwo{\epsilon_1}{\epsilon_2}\twobytwo{5}{0}{3}{2} \equiv \onebytwo{0}{0} \mod 2 \qquad \iff \qquad \onebytwo{\epsilon_1}{\epsilon_2}\twobytwo{1}{0}{1}{0} = \onebytwo{0}{0} $$ -in $ \Z / 2\Z $, a field $ \F_2 $, that is $ \epsilon_1 + \epsilon_2 = 0 $, so $ \epsilon_1 = \epsilon_2 = 1 $. +in $ \ZZ / 2\ZZ $, a field $ \FF_2 $, that is $ \epsilon_1 + \epsilon_2 = 0 $, so $ \epsilon_1 = \epsilon_2 = 1 $. \end{example*} -This step, solving linear equations in $ \Z / 2\Z $, can be done efficiently. The remaining difficulty is to find a supply of $ m \in \Z $ such that $ m^2 - n $ has only small prime factors. The idea is that if we fix a list of small primes to start with, we get congruence conditions on $ m $. It turns out that there is a straightforward algorithm for solving $ m^2 \equiv n \mod p $. This gives two possible values for $ m \mod p $. If you do this for lots of primes $ p $, you get a supply of congruence conditions for $ m $, so you can eliminate ever considering $ m $ such that $ m^2 - n $ has large prime factors. +This step, solving linear equations in $ \ZZ / 2\ZZ $, can be done efficiently. The remaining difficulty is to find a supply of $ m \in \ZZ $ such that $ m^2 - n $ has only small prime factors. The idea is that if we fix a list of small primes to start with, we get congruence conditions on $ m $. It turns out that there is a straightforward algorithm for solving $ m^2 \equiv n \mod p $. This gives two possible values for $ m \mod p $. If you do this for lots of primes $ p $, you get a supply of congruence conditions for $ m $, so you can eliminate ever considering $ m $ such that $ m^2 - n $ has large prime factors. \begin{example*} $ m^2 = 1649 \equiv 2 \mod 3 $ has no solutions. \end{example*} -\lecture{8}{Tuesday}{23/10/18} - \subsection{Testing primality} -Euler's theorem states that if $ \br{a, n} = 1 $ then $ a^{\Phi\br{n}} \equiv 1 \mod n $. In particular if $ p $ is prime then $ a^{p - 1} \equiv 1 \mod p $, for $ 1 \le a \le p - 1 $. In particular, if $ 2^{n - 1} \not\equiv 1 \mod n $, then $ n $ cannot be prime. The problem is that there exists $ n $ composite such that $ a^{n - 1} \equiv 1 \mod n $ for all $ \br{a, n} = 1 $, the \textbf{Carmichael numbers}. It is known that infinitely many of these exist. The \textbf{Miller-Rabin test} is a test for whether odd $ n \in \Z $ is prime or not. Today let $ n \equiv 3 \mod 4 $. Example sheet is $ n \equiv 1 \mod 4 $. +\lecture{8}{Tuesday}{23/10/18} + +Euler's theorem states that if $ \br{a, n} = 1 $ then $ a^{\Phi\br{n}} \equiv 1 \mod n $. In particular if $ p $ is prime then $ a^{p - 1} \equiv 1 \mod p $ for $ 1 \le a \le p - 1 $. In particular, if $ 2^{n - 1} \not\equiv 1 \mod n $, then $ n $ cannot be prime. The problem is that there exists $ n $ composite such that $ a^{n - 1} \equiv 1 \mod n $ for all $ \br{a, n} = 1 $, the \textbf{Carmichael numbers}. It is known that infinitely many of these exist. The \textbf{Miller-Rabin test} is a test for whether odd $ n \in \ZZ $ is prime or not. Today let $ n \equiv 3 \mod 4 $. Example sheet is $ n \equiv 1 \mod 4 $. \begin{lemma} \label{lem:30} @@ -728,8 +670,8 @@ \subsection{Testing primality} so $$ 1 \equiv 1 + \br{\dfrac{n - 1}{2}}p \mod p^2, $$ then $ p \mid \br{n - 1} / 2 $, so $ p \mid n - 1 $. But $ p \mid n $, a contradiction. -\item The remaining case is that $ n $ is composite but not a power of a prime. Write $ n = rs $, for $ r, s > 1 $, and odd, and $ \br{r, s} = 1 $. By the Chinese remainder theorem, -$$ \dfrac{\Z}{n\Z} \cong \dfrac{\Z}{r\Z} \times \dfrac{\Z}{s\Z}. $$ +\item The remaining case is that $ n $ is composite but not a power of a prime. Write $ n = rs $ for $ r, s > 1 $, and odd, and $ \br{r, s} = 1 $. By the Chinese remainder theorem, +$$ \ZZ / n\ZZ \cong \ZZ / r\ZZ \times \ZZ / s\ZZ. $$ Choose $ a $ such that $$ a \equiv -1 \mod r, \qquad a \equiv 1 \mod s. $$ Then $ \br{a, r} = \br{a, s} = 1 $, so $ \br{a, n} = 1 $. Since $ n \equiv 3 \mod 4 $, $ \br{n - 1} / 2 $ is odd, so @@ -757,8 +699,8 @@ \subsection{Testing primality} The set of such elements is a proper subgroup of $ \unit{n} $ by Lemma \ref{lem:31}, so it has index at least two. \end{proof} -In fact, with a bit more work, you can improve this to show that at least $ 3 / 4 $ of the numbers $ 1 \le a \le n - 1 $ satisfy $ a^{\br{n - 1} / 2} \not\equiv \pm 1 \mod n $. So if you randomly choose numbers $ 1 \le a \le n - 1 $ $ x $ times, and $ n $ is composite, the probability that you find some $ a $ with $ a^{\br{n - 1} / 2} \not\equiv \pm 1 \mod n $ is at least $ 1 - \br{1 / 4}^x $. This gives a probabilistic algorithm to check if $ n $ is prime in polynomial time. If you assume the generalised Riemann hypothesis (GRH) you can find some -$$ 1 \le a \le \left\lceil 2 \br{\log\br{n}}^2 \right\rceil, \qquad a^{\tfrac{n - 1}{2}} \not\equiv \pm 1 \mod n. $$ +In fact, with a bit more work, you can improve this to show that at least $ \tfrac{3}{4} $ of the numbers $ 1 \le a \le n - 1 $ satisfy $ a^{\br{n - 1} / 2} \not\equiv \pm 1 \mod n $. So if you randomly choose numbers $ 1 \le a \le n - 1 $ $ x $ times, and $ n $ is composite, the probability that you find some $ a $ with $ a^{\br{n - 1} / 2} \not\equiv \pm 1 \mod n $ is at least $ 1 - \br{\tfrac{1}{4}}^x $. This gives a probabilistic algorithm to check if $ n $ is prime in polynomial time. If you assume the generalised Riemann hypothesis (GRH) you can find some +$$ 1 \le a \le \left\lceil 2 \br{\log n}^2 \right\rceil, \qquad a^{\tfrac{n - 1}{2}} \not\equiv \pm 1 \mod n. $$ In practice it is even better. \begin{example*} @@ -773,27 +715,27 @@ \section{Public-key cryptography} \subsection{Messages as sequences of classes modulo \texorpdfstring{$ n $}{n}} -How do we turn messages into numbers in $ \Z / n\Z $? The idea is to choose $ n $ very large. Say $ n > 2^{8k} $. Write down your message. Break it up into strings of at most $ k $ characters. Encode each character as an $ 8 $ bit binary number. String these integers together to get an $ 8k $ bit binary number. Regard that as an integer modulo $ n $. +How do we turn messages into numbers in $ \ZZ / n\ZZ $? The idea is to choose $ n $ very large. Say $ n > 2^{8k} $. Write down your message. Break it up into strings of at most $ k $ characters. Encode each character as an $ 8 $ bit binary number. String these integers together to get an $ 8k $ bit binary number. Regard that as an integer modulo $ n $. \subsection{The Rivest-Shamir-Adleman (RSA) algorithm} -Now apply some function $ f : \Z / n\Z \to \Z / n\Z $, and then tell whoever you are trying to communicate with the result of this computation. Then they should apply some other function $ g : \Z / m\Z \to \Z / n\Z $, to get back the number you started with. So want $ f $ to be injective. Want to be able to make $ f $ public without making $ g $ public. The idea is to choose two large prime numbers $ p $ and $ q $ and set $ n = pq $. Choose $ \br{e, \Phi\br{n}} = 1 $. Find $ d $ such that +Now apply some function $ f : \ZZ / n\ZZ \to \ZZ / n\ZZ $, and then tell whoever you are trying to communicate with the result of this computation. Then they should apply some other function $ g : \ZZ / m\ZZ \to \ZZ / n\ZZ $, to get back the number you started with. So want $ f $ to be injective. Want to be able to make $ f $ public without making $ g $ public. The idea is to choose two large prime numbers $ p $ and $ q $ and set $ n = pq $. Choose $ \br{e, \Phi\br{n}} = 1 $. Find $ d $ such that $$ de = 1 \mod \Phi\br{n} = \br{p - 1}\br{q - 1} = n - \br{p + q} + 1. $$ Publish $ n $ and $ e $, and you keep $ p, q, \Phi\br{n}, d $ secret. Let $ f\br{x} = x^e \mod n $ and $ g\br{x} = x^d \mod n $. Then $$ \br{x^e}^d \equiv x^{de} \equiv x \mod n, $$ -because $ de \equiv 1 \mod \Phi\br{n} $ and $ x^{\Phi\br{n}} \equiv 1 \mod n $. So if someone wants to send you a message $ c \in \Z / n\Z $, they compute $ c^e \in \Z / n\Z $, and send it to you. To decode it, you compute +because $ de \equiv 1 \mod \Phi\br{n} $ and $ x^{\Phi\br{n}} \equiv 1 \mod n $. So if someone wants to send you a message $ c \in \ZZ / n\ZZ $, they compute $ c^e \in \ZZ / n\ZZ $, and send it to you. To decode it, you compute $$ \br{c^e}^d \equiv c^{de} \equiv c \mod n. $$ This assumes that $ \br{c, n} = 1 $, but the probability of this is extremely high. The prevailing assumption is that with only the information $ n $ and $ e $, it is hopeless to discover $ d $, or to find any other way of recovering $ c $ from $ c^e $. \lecture{9}{Wednesday}{24/10/18} -Lecture 9 is a problem class. - -\lecture{10}{Friday}{26/10/18} +Lecture 9 is a problems class. \subsection{Signing with RSA} -If you have functions $ f, g : \Z / n\Z \to \Z / n\Z $ with $ f \circ g = g \circ f = id $, then you can also verify your identity, that is sign messages. Again, make $ f $ public, and any time you publish a message $ m $, you also publish $ g\br{m} $. Then anyone can apply $ f $ to $ g\br{m} $ to recover $ m = f\br{g\br{m}} $, but without $ g $, no one can forge your signature. +\lecture{10}{Friday}{26/10/18} + +If you have functions $ f, g : \ZZ / n\ZZ \to \ZZ / n\ZZ $ with $ f \circ g = g \circ f = \id $, then you can also verify your identity, that is sign messages. Again, make $ f $ public, and any time you publish a message $ m $, you also publish $ g\br{m} $. Then anyone can apply $ f $ to $ g\br{m} $ to recover $ m = f\br{g\br{m}} $, but without $ g $, no one can forge your signature. \subsection{Discrete logarithms} @@ -840,7 +782,7 @@ \subsection{Quadratic residues} \begin{proof} The map -$$ \function{\Unit{p}}{\Unit{p}}{x}{x^2} $$ +$$ \function{\unit{p}}{\unit{p}}{x}{x^2} $$ is a group homomorphism with kernel $ \cbr{\pm 1} $. So the image has order $ \br{p - 1} / 2 $, and the image is exactly the QRs. \end{proof} @@ -856,16 +798,13 @@ \subsection{Quadratic residues} \begin{proof} Let $ H $ be the image of -$$ \function{\Unit{p}}{\Unit{p}}{x}{x^2}, $$ -that is $ H $ is the QRs. Then $ \unit{p} / H $ is a group of order two by Lemma \ref{lem:34}, so it is cyclic of order two. This statement is a restatement of Proposition \ref{prop:35}, since -$$ \Unit{p} = H \cup 1 + H. $$ +$$ \function{\unit{p}}{\unit{p}}{x}{x^2}, $$ +that is $ H $ is the QRs. Then $ \unit{p} / H $ is a group of order two by Lemma \ref{lem:34}, so it is cyclic of order two. This statement is a restatement of Proposition \ref{prop:35}, since $ \unit{p} = H \cup 1 + H $. \end{proof} -\pagebreak - \begin{definition} -Let $ a \in \Z $ and $ p $ a prime. Then the \textbf{Legendre symbol} is -$$ \jacobi{a}{p} = +Let $ a \in \ZZ $ and $ p $ a prime. Then the \textbf{Legendre symbol} is +$$ \symbol{a}{p} = \begin{cases} 1 & a \ \text{is a QR modulo} \ p \\ 0 & p \mid a \\ @@ -875,31 +814,29 @@ \subsection{Quadratic residues} \end{definition} Proposition \ref{prop:35} can be restated as saying that -$$ \function{\Unit{p}}{\cbr{\pm 1}}{a}{\jacobi{a}{p}} $$ +$$ \function{\unit{p}}{\cbr{\pm 1}}{a}{\symbol{a}{p}} $$ is a group homomorphism, that is -$$ \jacobi{ab}{p} = \jacobi{a}{p}\jacobi{a}{p}. $$ +$$ \symbol{ab}{p} = \symbol{a}{p}\symbol{a}{p}. $$ Even holds if we do not assume that $ \br{a, p} = \br{b, p} = 1 $. \lecture{11}{Tuesday}{30/10/18} \begin{theorem}[Euler's criterion] If $ p $ is an odd prime, and $ p \nmid a $, then -$$ \jacobi{a}{p} \equiv a^{\tfrac{p - 1}{2}} \mod p. $$ +$$ \symbol{a}{p} \equiv a^{\tfrac{p - 1}{2}} \mod p. $$ \end{theorem} +\pagebreak + \begin{proof} -Let $ g $ be a primitive root modulo $ p $, and write $ a \equiv g^r \mod p $ for $ 0 \le r < p - 1 $. Now -$$ \br{g^{\tfrac{p - 1}{2}}}^2 = g^{p - 1} \equiv 1 \mod p. $$ -So $ g^{\br{p - 1} / 2} \equiv \pm 1 \mod p $. Since $ g $ is a primitive root, -$$ g^{\tfrac{p - 1}{2}} \not\equiv 1 \mod p, $$ -so $ g^{\br{p - 1} / 2} \equiv -1 \mod p $. So +Let $ g $ be a primitive root modulo $ p $, and write $ a \equiv g^r \mod p $ for $ 0 \le r < p - 1 $. Now $ \br{g^{\br{p - 1} / 2}}^2 = g^{p - 1} \equiv 1 \mod p $. So $ g^{\br{p - 1} / 2} \equiv \pm 1 \mod p $. Since $ g $ is a primitive root, $ g^{\tfrac{p - 1}{2}} \not\equiv 1 \mod p $, so $ g^{\br{p - 1} / 2} \equiv -1 \mod p $. So $$ a^{\tfrac{p - 1}{2}} \equiv \br{g^r}^{\tfrac{p - 1}{2}} \equiv \br{g^{\tfrac{p - 1}{2}}}^r \equiv \br{-1}^r \mod p. $$ But \begin{align*} -\jacobi{a}{p} = 1 \qquad -& \iff \qquad \exists s \in \Z, \ \br{g^s}^2 \equiv a \mod p \\ +\symbol{a}{p} = 1 \qquad +& \iff \qquad \exists s \in \ZZ, \ \br{g^s}^2 \equiv a \mod p \\ & \iff \qquad 2s \equiv r \mod p - 1 \\ -& \iff \qquad r \in 2\Z \\ +& \iff \qquad r \in 2\ZZ \\ & \iff \qquad \br{-1}^r \equiv 1 \mod p. \end{align*} \end{proof} @@ -912,9 +849,9 @@ \subsection{Computing Legendre symbols} \begin{proof} $ p = 2 $ is trivial. If $ p > 2 $, then by Euler's criterion, -$$ \jacobi{-1}{p} \equiv \br{-1}^{\tfrac{p - 1}{2}} \mod p, $$ +$$ \symbol{-1}{p} \equiv \br{-1}^{\tfrac{p - 1}{2}} \mod p, $$ so in fact -$$ \jacobi{-1}{p} = \br{-1}^{\tfrac{p - 1}{2}}. $$ +$$ \symbol{-1}{p} = \br{-1}^{\tfrac{p - 1}{2}}. $$ Then $$ \br{-1}^{\tfrac{p - 1}{2}} = \begin{cases} @@ -924,105 +861,102 @@ \subsection{Computing Legendre symbols} $$ \end{proof} -\pagebreak - \begin{proposition}[Gauss' lemma] -$$ \jacobi{2}{p} = +$$ \symbol{2}{p} = \begin{cases} 1 & p \equiv \pm 1 \mod 8 \\ -1 & p \equiv \pm 3 \mod 8 \end{cases}, $$ that is -$$ \jacobi{2}{p} = \br{-1}^{\tfrac{p^2 - 1}{8}}. $$ +$$ \symbol{2}{p} = \br{-1}^{\tfrac{p^2 - 1}{8}}. $$ \end{proposition} -\begin{example*} -\hfill -\begin{itemize} -\item $ \jacobi{2}{7} = 1 $, since $ 2 \equiv 3^2 \mod 7 $. -\item $ \jacobi{2}{11} = -1 $, since squares modulo $ 11 $ are $ 1, 4, 9, 5, 3 $. -\item $ \jacobi{-1}{11} = -1 $, so $ \jacobi{-2}{11} = \jacobi{2}{11}\jacobi{-1}{11} = \br{-1}^2 = 1 $, since $ -2 \equiv 3^2 \mod 11 $. -\end{itemize} -\end{example*} - \begin{proof} -$$ \jacobi{2}{p} \equiv 2^{\tfrac{p - 1}{2}} \mod p, $$ +$$ \symbol{2}{p} \equiv 2^{\tfrac{p - 1}{2}} \mod p, $$ by Euler's criterion. Let $ q = \br{p - 1} / 2 $, and let $$ Q = \br{2}\br{4} \dots \br{p - 3}\br{p - 1} = \br{2\br{1}} \dots \br{2\br{q}} = 2^qq! = 2^{\tfrac{p - 1}{2}}q!. $$ Subtracting $ p $ from every term which is bigger than $ q $, $$ Q \equiv \br{2}\br{4} \dots \br{-3}\br{-1} \equiv \br{-1}^rq! \mod p, $$ -where $ r $ is the number of odd integers in $ 1, \dots, q $. Since $ p \nmid q! $, we have -$$ 2^{\tfrac{p - 1}{2}} \equiv \br{-1}^r \mod p. $$ -Now the following holds. +where $ r $ is the number of odd integers in $ 1, \dots, q $. Since $ p \nmid q! $, we have $ 2^{\br{p - 1} / 2} \equiv \br{-1}^r \mod p $. Now the following holds. \footnote{Exercise} $$ \br{-1}^r = \begin{cases} 1 & p \equiv \pm 1 \mod 8 \\ -1 & p \equiv \pm 3 \mod 8 \end{cases}. $$ -(Exercise: check) \end{proof} +\pagebreak + \begin{example*} -If $ p \equiv 1 \mod 8 $, say $ p = 1 + 8n $, so $ q = 4n $. Odd integers in $ 1, \dots, 4n $ are $ 1, 3, \dots, 4n - 3, 4n - 1 $, so $ r = 2n $. +If $ p \equiv 1 \mod 8 $, say $ p = 1 + 8n $, then $ q = 4n $. Odd integers in $ 1, \dots, 4n $ are $ 1, 3, \dots, 4n - 3, 4n - 1 $, so $ r = 2n $. +\end{example*} + +\begin{example*} +\hfill +\begin{itemize} +\item $ \symbol{2}{7} = 1 $, since $ 2 \equiv 3^2 \mod 7 $. +\item $ \symbol{2}{11} = -1 $, since squares modulo $ 11 $ are $ 1, 4, 9, 5, 3 $. +\item $ \symbol{-1}{11} = -1 $, so $ \symbol{-2}{11} = \symbol{2}{11}\symbol{-1}{11} = \br{-1}^2 = 1 $, since $ -2 \equiv 3^2 \mod 11 $. +\end{itemize} \end{example*} \begin{theorem}[Law of quadratic reciprocity] \label{thm:40} If $ p $ and $ q $ are odd primes, then -$$ \jacobi{p}{q} = \jacobi{q}{p}\br{-1}^{\br{\tfrac{p - 1}{2}}\br{\tfrac{q - 1}{2}}}, $$ -that is $ \jacobi{p}{q} = \jacobi{q}{p} $ unless $ p \equiv q \equiv 3 \mod 4 $, when $ \jacobi{p}{q} = -\jacobi{q}{p} $. +$$ \symbol{p}{q} = \symbol{q}{p}\br{-1}^{\br{\tfrac{p - 1}{2}}\br{\tfrac{q - 1}{2}}}, $$ +that is $ \symbol{p}{q} = \symbol{q}{p} $ unless $ p \equiv q \equiv 3 \mod 4 $, when $ \symbol{p}{q} = -\symbol{q}{p} $. \end{theorem} -\pagebreak - \begin{example*} \hfill \begin{itemize} -\item $ \jacobi{5}{p} = \jacobi{p}{5} $ for $ p \ne 5 $. QRs modulo $ 5 $ are $ 1 $ and $ 4 $. So -$$ \jacobi{5}{p} = +\item $ \symbol{5}{p} = \symbol{p}{5} $ for $ p \ne 5 $. QRs modulo $ 5 $ are $ 1 $ and $ 4 $. So +$$ \symbol{5}{p} = \begin{cases} 1 & p \equiv \pm 1 \mod 5 \\ -1 & p \equiv \pm 2 \mod 5 \end{cases}. $$ -\item What is $ \jacobi{3}{p} $ for $ p \ne 3 $? If $ p \equiv 1 \mod 4 $, then -$$ \jacobi{3}{p} = \jacobi{p}{3} = +\item What is $ \symbol{3}{p} $ for $ p \ne 3 $? If $ p \equiv 1 \mod 4 $, then +$$ \symbol{3}{p} = \symbol{p}{3} = \begin{cases} 1 & p \equiv 1 \mod 3 \\ -1 & p \equiv -1 \mod 3 \end{cases}. $$ If $ p \equiv -1 \mod 4 $, then -$$ \jacobi{3}{p} = -\jacobi{p}{3} = +$$ \symbol{3}{p} = -\symbol{p}{3} = \begin{cases} 1 & p \equiv -1 \mod 3 \\ -1 & p \equiv 1 \mod 3 \end{cases}. $$ So -$$ \jacobi{3}{p} = +$$ \symbol{3}{p} = \begin{cases} 1 & p \equiv \pm 1 \mod 12 \\ -1 & p \equiv \pm 5 \mod 12 \end{cases}. $$ -For example, $ \jacobi{3}{7} = -1 $, since QRs are $ 1, 2, 4 $, and $ \jacobi{3}{11} = 1 $, since $ 5^2 \equiv 3 \mod 11 $. -\item $ \jacobi{6}{19} = \jacobi{2}{19}\jacobi{3}{19} = \br{-1}\br{-1} = 1 $, since $ \jacobi{2}{19} = -1 $, because $ 19 \equiv 3 \mod 8 $, and $ \jacobi{3}{19} \equiv -1 \mod 12 $, by the above. +For example, $ \symbol{3}{7} = -1 $, since QRs are $ 1, 2, 4 $, and $ \symbol{3}{11} = 1 $, since $ 5^2 \equiv 3 \mod 11 $. +\item $ \symbol{6}{19} = \symbol{2}{19}\symbol{3}{19} = \br{-1}\br{-1} = 1 $, since $ \symbol{2}{19} = -1 $, because $ 19 \equiv 3 \mod 8 $, and $ \symbol{3}{19} \equiv -1 \mod 12 $, by the above. \end{itemize} \end{example*} -In general to compute $ \jacobi{a}{p} $, we could do the following. Use that if $ a \equiv b \mod p $ then $ \jacobi{a}{p} = \jacobi{b}{p} $. So without loss of generality $ \abs{a} < p $. Then write $ a = \pm \prod_i q_i^{s_i} $ for $ q_i $ prime. Then -$$ \jacobi{a}{p} = \jacobi{\pm 1}{p} \prod_i \jacobi{q_i}{p}^{s_i}. $$ -If $ s_i $ is even, then $ \jacobi{q_i}{p}^{s_i} = 1 $. If $ s_i $ is odd, then $ \jacobi{q_i}{p}^{s_i} = \jacobi{q_i}{p} $. We have formulas for $ \jacobi{-1}{p} $ and $ \jacobi{2}{p} $. If $ q $ is an odd prime, $ q < p $, then use quadratic reciprocity to relate $ \jacobi{q}{p} $ and $ \jacobi{p}{q} $. Then repeat modulo $ q $. +In general to compute $ \symbol{a}{p} $, we could do the following. Use that if $ a \equiv b \mod p $ then $ \symbol{a}{p} = \symbol{b}{p} $. So without loss of generality $ \abs{a} < p $. Then write $ a = \pm\prod_i q_i^{s_i} $ for $ q_i $ prime. Then +$$ \symbol{a}{p} = \symbol{\pm 1}{p} \prod_i \symbol{q_i}{p}^{s_i}. $$ +If $ s_i $ is even, then $ \symbol{q_i}{p}^{s_i} = 1 $. If $ s_i $ is odd, then $ \symbol{q_i}{p}^{s_i} = \symbol{q_i}{p} $. We have formulas for $ \symbol{-1}{p} $ and $ \symbol{2}{p} $. If $ q $ is an odd prime, $ q < p $, then use quadratic reciprocity to relate $ \symbol{q}{p} $ and $ \symbol{p}{q} $. Then repeat modulo $ q $. -\lecture{12}{Wednesday}{31/10/18} +\pagebreak \subsection{Proof of quadratic reciprocity} -The proof of this is due to Rousseau, in 1991. This resembles the proof we gave that $ \jacobi{2}{p} = \br{-1}^{\br{p^2 - 1} / 8} $. +\lecture{12}{Wednesday}{31/10/18} + +The proof of this is due to Rousseau, in 1991. This resembles the proof we gave that $ \symbol{2}{p} = \br{-1}^{\br{p^2 - 1} / 8} $. \begin{theorem}[Wilson's theorem] If $ p $ is prime, then $ \br{p - 1}! \equiv -1 \mod p $. @@ -1032,18 +966,15 @@ \subsection{Proof of quadratic reciprocity} We will write down several choices of coset representatives for $ \cbr{\pm 1} $, and compare them, that is we will write down choices of $ x $ or $ -x $ for each $ x \in \unit{pq} $. Write elements of $ \unit{pq} $ as pairs $ \br{\alpha, \beta} \in \unit{p} \times \unit{q} $. \begin{itemize} \item For our first set of coset representatives, take -$$ \cbr{\br{x, y} \mid 1 \le x \le \tfrac{p - 1}{2}, \ 1 \le y \le q - 1}. $$ +$$ \cbr{\br{x, y} \st 1 \le x \le \tfrac{p - 1}{2}, \ 1 \le y \le q - 1}. $$ Let $ A $ be the product of these coset representatives. This is by definition $$ A = \br{\br{\br{\tfrac{p - 1}{2}}!}^{q - 1}, \br{-1}^{\tfrac{p - 1}{2}}}. $$ \item The second set of representatives is -$$ \cbr{\br{x, y} \mid 1 \le x \le p - 1, \ 1 \le y \le \tfrac{q - 1}{2}}. $$ +$$ \cbr{\br{x, y} \st 1 \le x \le p - 1, \ 1 \le y \le \tfrac{q - 1}{2}}. $$ Let $ B $ be the product of these representatives. Then by symmetry, $$ B = \br{\br{-1}^{\tfrac{q - 1}{2}}, \br{\br{\tfrac{q - 1}{2}}!}^{p - 1}}. $$ - -\pagebreak - \item For the third set of representatives, select the pairs $ \br{x, y} $ which correspond via the Chinese remainder theorem to the set -$$ \cbr{1 \le i \le \tfrac{pq - 1}{2} \mid \br{i, pq} = 1}. $$ +$$ \cbr{1 \le i \le \tfrac{pq - 1}{2} \st \br{i, pq} = 1}. $$ Let $ C $ be the product of these coset representatives. What is the $ x $-coordinate of $ C $? It is $$ \prod_{i = 1, \ \br{i, pq} = 1}^{\tfrac{pq - 1}{2}} i. $$ So @@ -1062,67 +993,63 @@ \subsection{Proof of quadratic reciprocity} Combining $ \br{\ref{eq:1}}, \br{\ref{eq:2}}, \br{\ref{eq:3}} $, get that the $ x $-coordinate of the product is $$ \prod_{i = 1, \ \br{i, pq} = 1}^{\tfrac{pq - 1}{2}} i = \dfrac{\br{p - 1}!^{\tfrac{q - 1}{2}}\br{\tfrac{p - 1}{2}}!}{q^{\tfrac{p - 1}{2}}\br{\tfrac{p - 1}{2}}!} = \dfrac{\br{-1}^{\tfrac{q - 1}{2}}}{q^{\tfrac{p - 1}{2}}}. $$ So $ C $, the product of these representatives, is -$$ C = \br{\br{-1}^{\tfrac{q - 1}{2}}\jacobi{q}{p}, \br{-1}^{\tfrac{p - 1}{2}}\jacobi{p}{q}}. $$ +$$ C = \br{\br{-1}^{\tfrac{q - 1}{2}}\symbol{q}{p}, \br{-1}^{\tfrac{p - 1}{2}}\symbol{p}{q}}. $$ \end{itemize} + +\pagebreak + $ A, B, C $ all agree up to sign, that is up to multiplication by $ \pm 1 $, that is up to multiplication by -$$ \br{-1, -1} \in \Unit{p} \times \Unit{q}. $$ -Looking at $ y $-coordinates, $ C = \jacobi{p}{q}A $. Similarly $ C = \jacobi{q}{p}B $. So -$$ B = \jacobi{q}{p}\jacobi{p}{q}A. $$ -To swap between $ A $ and $ B $, just change the signs of everything with $ 1 \le x \le \br{p - 1} / 2 $ and $ \br{q + 1} / 2 \le y \le q - 1 $. So +$$ \br{-1, -1} \in \unit{p} \times \unit{q}. $$ +Looking at $ y $-coordinates, $ C = \symbol{p}{q}A $. Similarly $ C = \symbol{q}{p}B $. So $ B = \symbol{q}{p}\symbol{p}{q}A $. To swap between $ A $ and $ B $, just change the signs of everything with $ 1 \le x \le \br{p - 1} / 2 $ and $ \br{q + 1} / 2 \le y \le q - 1 $. So $$ B = \br{-1}^{\br{\tfrac{p - 1}{2}}\br{\tfrac{q - 1}{2}}}A. $$ So -$$ \jacobi{q}{p}\jacobi{p}{q} = \br{-1}^{\br{\tfrac{p - 1}{2}}\br{\tfrac{q - 1}{2}}}, $$ -that is -$$ \jacobi{q}{p} = \br{-1}^{\br{\tfrac{p - 1}{2}}\br{\tfrac{q - 1}{2}}}\jacobi{p}{q}. $$ +$$ \symbol{q}{p}\symbol{p}{q} = \br{-1}^{\br{\tfrac{p - 1}{2}}\br{\tfrac{q - 1}{2}}}. $$ \end{proof} -\pagebreak - \subsection{Jacobi symbols} These are an extension of Legendre symbols which are useful for making computations. \begin{definition} Write $ b = \prod_i p_i^{r_i} $ for $ p_i $ distinct primes. Then the \textbf{Jacobi symbol} is -$$ \jacobi{a}{b} = \prod_i \jacobi{a}{p_i}^{r_i}. $$ +$$ \symbol{a}{b} = \prod_i \symbol{a}{p_i}^{r_i}. $$ \end{definition} -A warning is that $ \jacobi{a}{b} = 1 $ does not imply that $ a $ is a square modulo $ b $. On the other hand, $ \jacobi{a}{b} = -1 $ implies that $ a $ is not a square modulo $ b $. +A warning is that $ \symbol{a}{b} = 1 $ does not imply that $ a $ is a square modulo $ b $. On the other hand, $ \symbol{a}{b} = -1 $ implies that $ a $ is not a square modulo $ b $. \lecture{13}{Friday}{02/11/18} \begin{lemma} \hfill \begin{enumerate} -\item $ \jacobi{a_1a_2}{b} = \jacobi{a_1}{b}\jacobi{a_2}{b} $ and $ \jacobi{a}{b_1b_2} = \jacobi{a}{b_1}\jacobi{a}{b_2} $. -\item $ \jacobi{a}{b} $ depends only on $ a \mod b $. -\item $ \jacobi{a^2}{b} = 1 $. -\item $ \jacobi{-1}{b} = \br{-1}^{\br{b - 1} / 2} $. -\item $ \jacobi{2}{b} = \br{-1}^{\br{b^2 - 1} / 8} $. +\item $ \symbol{a_1a_2}{b} = \symbol{a_1}{b}\symbol{a_2}{b} $ and $ \symbol{a}{b_1b_2} = \symbol{a}{b_1}\symbol{a}{b_2} $. +\item $ \symbol{a}{b} $ depends only on $ a \mod b $. +\item $ \symbol{a^2}{b} = 1 $. +\item $ \symbol{-1}{b} = \br{-1}^{\br{b - 1} / 2} $. +\item $ \symbol{2}{b} = \br{-1}^{\br{b^2 - 1} / 8} $. \item If $ a, b > 0 $ are both odd -$$ \jacobi{a}{b}\jacobi{b}{a} = \br{-1}^{\br{\tfrac{a - 1}{2}}\br{\tfrac{b - 1}{2}}}. $$ +$$ \symbol{a}{b}\symbol{b}{a} = \br{-1}^{\br{\tfrac{a - 1}{2}}\br{\tfrac{b - 1}{2}}}. $$ \end{enumerate} \end{lemma} \begin{proof} -All of these statements are true for Legendre symbols, that is for $ b $ prime, and $ a $ prime in $ 6 $. $ 1 $ to $ 3 $ follow immediately. $ 4 $ to $ 6 $ also follows from $ 1 $ and the corresponding statements for Legendre symbols. For $ 5 $, it is enough to show that if it holds for $ b_1 $ and $ b_2 $, then it holds for $ b_1b_2 $. Since -$$ \jacobi{2}{b_1b_2} = \jacobi{2}{b_1}\jacobi{2}{b_2}, $$ +All of these statements are true for Legendre symbols, that is for $ b $ prime, and $ a $ prime in $ 6 $. $ 1 $ to $ 3 $ follow immediately, and $ 4 $ to $ 6 $ also follows from $ 1 $ and the corresponding statements for Legendre symbols. For $ 5 $, it is enough to show that if it holds for $ b_1 $ and $ b_2 $, then it holds for $ b_1b_2 $. Since +$$ \symbol{2}{b_1b_2} = \symbol{2}{b_1}\symbol{2}{b_2}, $$ we need to show that $$ \br{-1}^{\tfrac{b_1^2 - 1}{8}}\br{-1}^{\tfrac{b_2^2 - 1}{8}} = \br{-1}^{\tfrac{\br{b_1b_2}^2 - 1}{8}}, $$ that is need $$ \br{b_1^2 - 1} + \br{b_2^2 - 1} \equiv \br{b_1b_2}^2 - 1 \mod 16, $$ -that is -$$ \br{b_1^2 - 1}\br{b_2^2 - 1} \equiv 0 \mod 16. $$ -This is true because $ b_1^2 \equiv b_2^2 \equiv 1 \mod 4 $. +that is $ \br{b_1^2 - 1}\br{b_2^2 - 1} \equiv 0 \mod 16 $. This is true because $ b_1^2 \equiv b_2^2 \equiv 1 \mod 4 $. \end{proof} \begin{example*} +Since \begin{align*} -\jacobi{7411}{9283} -& = -\jacobi{9283}{7411} = -\jacobi{1872}{7411} = -\jacobi{16}{7411}\jacobi{117}{7411} = -\jacobi{117}{7411} = -\jacobi{7411}{117} = -\jacobi{40}{117} \\ -& = -\jacobi{8}{117}\jacobi{5}{117} = -\jacobi{2}{117}\jacobi{5}{117} = \jacobi{5}{117} = \jacobi{117}{5} = \jacobi{2}{5} = -1. +\symbol{7411}{9283} +& = -\symbol{9283}{7411} = -\symbol{1872}{7411} = -\symbol{16}{7411}\symbol{117}{7411} = -\symbol{117}{7411} = -\symbol{7411}{117} = -\symbol{40}{117} \\ +& = -\symbol{8}{117}\symbol{5}{117} = -\symbol{2}{117}\symbol{5}{117} = \symbol{5}{117} = \symbol{117}{5} = \symbol{2}{5} = -1, \end{align*} -So $ 7411 $ is not a square modulo $ 9283 $. +$ 7411 $ is not a square modulo $ 9283 $. \end{example*} \pagebreak @@ -1134,8 +1061,8 @@ \section{Sums of squares} \subsection{Sums of two squares} \begin{definition} -We say that $ n \in \Z $ is a \textbf{sum of two squares} if -$$ n = x^2 + y^2, \qquad x, y \in \Z. $$ +We say that $ n \in \ZZ $ is a \textbf{sum of two squares} if +$$ n = x^2 + y^2, \qquad x, y \in \ZZ. $$ \end{definition} \begin{example*} @@ -1147,14 +1074,13 @@ \subsection{Sums of two squares} \end{example*} \begin{definition} -The \textbf{Gaussian integers} $ \Z\sbr{i} $ are the subring of $ \C $ consisting of -$$ a + bi, \qquad a, b \in \Z. $$ +The \textbf{Gaussian integers} $ \ZZ\sbr{i} $ are the subring of $ \CC $ consisting of +$$ a + bi, \qquad a, b \in \ZZ. $$ \end{definition} The \textbf{norm} is defined by -$$ \function[N]{\Z\sbr{i}}{\Z_{> 0}}{a + bi}{a^2 + b^2}, $$ -that is $ N\br{z} = z\bar{z} $. Then -$$ N\br{zw} = \br{zw}\br{\bar{zw}} = \br{z\bar{z}}\br{w\bar{w}} = N\br{z}N\br{w}. $$ +$$ \function[\N]{\ZZ\sbr{i}}{\ZZ_{> 0}}{a + bi}{a^2 + b^2}, $$ +that is $ \N\br{z} = z\bar{z} $. Then $ \N\br{zw} = \br{zw}\br{\bar{zw}} = \br{z\bar{z}}\br{w\bar{w}} = \N\br{z}\N\br{w} $. \begin{lemma} \label{lem:46} @@ -1174,29 +1100,27 @@ \subsection{Sums of two squares} Lemma \ref{lem:46} and Theorem \ref{thm:47} together allow you to give a complete classification of the integers which are sums of two squares, in terms of their prime factorisations. \begin{definition} -A ring $ R $ is a \textbf{Euclidean domain} if it is an integral domain, that is $ ab = 0 $ implies that $ a = 0 $ or $ b = 0 $, and there exists a function $ N : R \to \Z_{\ge 0} $ such that for all $ a, b \in R $ with $ b \ne 0 $, there exist $ q, r \in R $ such that $ a = qb + r $, and $ r = 0 $ or $ N\br{r} < N\br{b} $. +A ring $ R $ is a \textbf{Euclidean domain} if it is an integral domain, that is $ ab = 0 $ implies that $ a = 0 $ or $ b = 0 $, and there exists a function $ \N : R \to \ZZ_{\ge 0} $ such that for all $ a, b \in R $ with $ b \ne 0 $, there exist $ q, r \in R $ such that $ a = qb + r $, and $ r = 0 $ or $ \N\br{r} < \N\br{b} $. \end{definition} -If $ R $ is a Euclidean domain, then you can carry out Euclid's algorithm. In particular, irreducible elements are the same as prime elements, and every element can be factored as a product of primes, uniquely up to reordering and multiplication by units. $ \Z\sbr{i} $ together with $ N $ is a Euclidean domain. By definition, $ n \in \Z $ is a sum of two squares if and only if there exists $ z \in \Z\sbr{i} $ with $ N\br{z} = n $. Since $ N\br{zw} = N\br{z}N\br{w} $, all we have to do is to figure out what the primes in $ \Z\sbr{i} $ are, and what their norms are. (Exercise: show that the units in $ \Z\sbr{i} $ are $ \pm 1 $ and $ \pm i $) Two elements of $ \Z\sbr{i} $ are \textbf{associates} if their ratio is a unit, that is $ z $ and $ w $ are associates if $ z = uw $, for $ u \in \cbr{\pm 1, \pm i} $. +If $ R $ is a Euclidean domain, then you can carry out Euclid's algorithm. In particular, irreducible elements are the same as prime elements, and every element can be factored as a product of primes, uniquely up to reordering and multiplication by units. Then $ \ZZ\sbr{i} $ together with $ \N $ is a Euclidean domain. By definition, $ n \in \ZZ $ is a sum of two squares if and only if there exists $ z \in \ZZ\sbr{i} $ with $ \N\br{z} = n $. Since $ \N\br{zw} = \N\br{z}\N\br{w} $, all we have to do is to figure out what the primes in $ \ZZ\sbr{i} $ are, and what their norms are. The units in $ \ZZ\sbr{i} $ are $ \pm 1 $ and $ \pm i $. \footnote{Exercise} Two elements of $ \ZZ\sbr{i} $ are \textbf{associates} if their ratio is a unit, that is $ z $ and $ w $ are associates if $ z = uw $ for $ u = \pm 1, \pm i $. \lecture{14}{Tuesday}{06/11/18} \begin{lemma} -Let $ p $ be a prime in $ \Z\sbr{i} $. Then there is a prime $ q $ of $ \Z $ such that either $ N\br{p} = q $ or $ N\br{p} = q^2 $. In the latter case, $ p $ is an associate of $ q $. Given $ q $ a prime in $ \Z $, there exists $ p $ such that $ N\br{p} = q $ if and only if $ q $ is a sum of two squares. +Let $ p $ be a prime in $ \ZZ\sbr{i} $. Then there is a prime $ q $ of $ \ZZ $ such that either $ \N\br{p} = q $ or $ \N\br{p} = q^2 $. In the latter case, $ p $ is an associate of $ q $. Given $ q $ a prime in $ \ZZ $, there exists $ p $ such that $ \N\br{p} = q $ if and only if $ q $ is a sum of two squares. \end{lemma} \begin{proof} -Write $ n = N\br{p} $, and let $ n = q_1^{s_1} \dots q_r^{s_r} $ be the prime factorisation of $ n $ in $ \Z $. By definition $ n = p\bar{p} $, so $ p \mid n $ in $ \Z\sbr{i} $, and so since $ p $ is prime, $ p \mid q_i $ for some $ i $. Write $ q = q_i $. Then $ p \mid q $ implies that $ q = pv $ for some $ v $, so -$$ N\br{p}N\br{v} = N\br{pv} = N\br{q} = q^2. $$ -If $ N\br{p} = 1 $, then $ p $ is a unit, a contradiction. So $ N\br{p} \mid q^2 $, so $ N\br{p} = q $ or $ N\br{p} = q^2 $, as claimed. If $ N\br{p} = q^2 $, then $ N\br{v} = 1 $, so $ v $ is a unit, and since $ q = pv $, $ p $ is an associate of $ q $, by definition. If $ N\br{p} = q $, then writing $ p = a + bi $, we have $ q = a^2 + b^2 $. Conversely, if $ q = a^2 + b^2 = \br{a + bi}\br{a - bi} $, -then since $ p \mid q $, we have either $ p \mid a + bi $ or $ p \mid a - bi $, so $ N\br{p} \mid N\br{a + bi} = q $ or $ N\br{p} \mid N\br{a - bi} = q $, and either way $ N\br{p} = q $. +Write $ n = \N\br{p} $, and let $ n = q_1^{s_1} \dots q_r^{s_r} $ be the prime factorisation of $ n $ in $ \ZZ $. By definition $ n = p\bar{p} $, so $ p \mid n $ in $ \ZZ\sbr{i} $, and so since $ p $ is prime, $ p \mid q_i $ for some $ i $. Write $ q = q_i $. Then $ p \mid q $ implies that $ q = pv $ for some $ v $, so $ \N\br{p}\N\br{v} = \N\br{pv} = \N\br{q} = q^2 $. If $ \N\br{p} = 1 $, then $ p $ is a unit, a contradiction. So $ \N\br{p} \mid q^2 $, so $ \N\br{p} = q $ or $ \N\br{p} = q^2 $, as claimed. If $ \N\br{p} = q^2 $, then $ \N\br{v} = 1 $, so $ v $ is a unit, and since $ q = pv $, $ p $ is an associate of $ q $, by definition. If $ \N\br{p} = q $, then writing $ p = a + bi $, we have $ q = a^2 + b^2 $. Conversely, if $ q = a^2 + b^2 = \br{a + bi}\br{a - bi} $, +then since $ p \mid q $, we have either $ p \mid a + bi $ or $ p \mid a - bi $, so $ \N\br{p} \mid \N\br{a + bi} = q $ or $ \N\br{p} \mid \N\br{a - bi} = q $, and either way $ \N\br{p} = q $. \end{proof} \pagebreak \begin{corollary} \label{cor:50} -The primes in $ \Z\sbr{i} $ are either of the form $ a + bi $ with $ a^2 + b^2 $ a prime in $ \Z $, or are primes of $ \Z $ which are not sums of two squares. +The primes in $ \ZZ\sbr{i} $ are either of the form $ a + bi $ with $ a^2 + b^2 $ a prime in $ \ZZ $, or are primes of $ \ZZ $ which are not sums of two squares. \end{corollary} \begin{theorem} @@ -1204,9 +1128,9 @@ \subsection{Sums of two squares} \end{theorem} \begin{proof} -By Corollary \ref{cor:50}, we just have to show that $ p $ is not a prime in $ \Z\sbr{i} $. There exists $ n $ such that $ n^2 \equiv -1 \mod p $. If $ p = 2 $ obvious, and if $ p \equiv 1 \mod 4 $, -$$ \jacobi{-1}{p} = \br{-1}^{\tfrac{p - 1}{2}} = 1, $$ -by Euler's criterion. That is, $ p \mid n^2 + 1 = \br{n + i}\br{n - i} $. If $ p $ were prime, then $ p \mid n + i $ or $ p \mid n - i $, that is there exist $ c, d \in \Z $ such that $ n \pm i = p\br{c \pm di} $, so $ 1 = pd $, a contradiction. +By Corollary \ref{cor:50}, we just have to show that $ p $ is not a prime in $ \ZZ\sbr{i} $. There exists $ n $ such that $ n^2 \equiv -1 \mod p $. If $ p = 2 $ obvious, and if $ p \equiv 1 \mod 4 $, +$$ \symbol{-1}{p} = \br{-1}^{\tfrac{p - 1}{2}} = 1, $$ +by Euler's criterion. That is, $ p \mid n^2 + 1 = \br{n + i}\br{n - i} $. If $ p $ were prime, then $ p \mid n + i $ or $ p \mid n - i $, that is there exist $ c, d \in \ZZ $ such that $ n \pm i = p\br{c \pm di} $, so $ 1 = pd $, a contradiction. \end{proof} \begin{remark*} @@ -1214,16 +1138,16 @@ \subsection{Sums of two squares} \end{remark*} \begin{remark*} -In practice, to go from $ n^2 + 1 \equiv 0 \mod p $ to finding $ a $ and $ b $ with $ a^2 + b^2 = p $, you just compute $ \br{n + i, p} = a + bi $. You can do this computation with Euclid's algorithm in $ \Z\sbr{i} $. +In practice, to go from $ n^2 + 1 \equiv 0 \mod p $ to finding $ a $ and $ b $ with $ a^2 + b^2 = p $, you just compute $ \br{n + i, p} = a + bi $. You can do this computation with Euclid's algorithm in $ \ZZ\sbr{i} $. \end{remark*} \begin{theorem} -$ n \in \Z $ is a sum of two squares if and only if its prime factorisation only contains primes congruent to $ 3 \mod 4 $ to even powers, that is +$ n \in \ZZ $ is a sum of two squares if and only if its prime factorisation only contains primes congruent to $ 3 \mod 4 $ to even powers, that is $$ n = 2^a\prod_{p_i \equiv 1 \mod 4} p_i^{r_i}\prod_{q_i \equiv 3 \mod 4} q_i^{2s_i}. $$ \end{theorem} \begin{proof} -Suppose $ n $ is of this form. Then $ 2 $, each $ p_i $, and each $ q_i^2 $ are all sums of two squares, so $ n $ is a sum of two squares by Lemma \ref{lem:46}. Conversely suppose that $ n = a^2 + b^2 $, and write $ a + bi $ as a product of primes in $ \Z\sbr{i} $. Then $ n = N\br{a + bi} $ is the product of the norms of these primes, and we already saw that the norms of primes in $ \Z\sbr{i} $ are either $ 2 $, a prime which is $ 1 \mod 4 $, or the square of a prime which is $ 3 \mod 4 $. +Suppose $ n $ is of this form. Then $ 2 $, each $ p_i $, and each $ q_i^2 $ are all sums of two squares, so $ n $ is a sum of two squares by Lemma \ref{lem:46}. Conversely suppose that $ n = a^2 + b^2 $, and write $ a + bi $ as a product of primes in $ \ZZ\sbr{i} $. Then $ n = \N\br{a + bi} $ is the product of the norms of these primes, and we already saw that the norms of primes in $ \ZZ\sbr{i} $ are either $ 2 $, a prime which is $ 1 \mod 4 $, or the square of a prime which is $ 3 \mod 4 $. \end{proof} \subsection{Sums of four squares - the ring of quaternions} @@ -1231,8 +1155,8 @@ \subsection{Sums of four squares - the ring of quaternions} Lagrange's theorem states that every positive integer is a sum of four squares. \begin{definition} -$ \H $, the \textbf{ring of quaternions}, is the ring of sums -$$ a + bi + cj + dk, \qquad a, b, c, d \in \R, $$ +$ \HH $, the \textbf{ring of quaternions}, is the ring of sums +$$ a + bi + cj + dk, \qquad a, b, c, d \in \RR, $$ such that \begin{itemize} \item addition is @@ -1243,13 +1167,13 @@ \subsection{Sums of four squares - the ring of quaternions} If $ z = a + bi + cj + dk $, we write $ z^* = a - bi - cj - dk $, so $ \br{zw}^* = w^*z^* $. \end{definition} -Define $ N\br{z} = zz^* = a^2 + b^2 + c^2 + d^2 $. Then -$$ N\br{zw} = zw\br{zw}^* = zww^*z^* = zN\br{w}z^* = zz^*N\br{w} = N\br{z}N\br{w}, $$ -because $ N\br{w} \in \R $. So +Define +$$ \N\br{z} = zz^* = a^2 + b^2 + c^2 + d^2. $$ +Then $ \N\br{zw} = zw\br{zw}^* = zww^*z^* = z\N\br{w}z^* = zz^*\N\br{w} = \N\br{z}\N\br{w} $, because $ \N\br{w} \in \RR $. So \begin{align*} \br{a^2 + b^2 + c^2 + d^2}\br{x^2 + y^2 + z^2 + w^2} -= \ & N\br{a + bi + cj + dk}N\br{x + yi + zj + wk} \\ -= \ & N\br{\br{a + bi + cj + dk}\br{x + yi + zj + wk}} \\ += \ & \N\br{a + bi + cj + dk}\N\br{x + yi + zj + wk} \\ += \ & \N\br{\br{a + bi + cj + dk}\br{x + yi + zj + wk}} \\ = \ & \br{ax - by - cz - dw}^2 + \br{ay + bx + cw - dz}^2 \\ + & \br{az - bw + cx + dy}^2 + \br{aw + bz - cy + dx}^2. \end{align*} @@ -1270,27 +1194,25 @@ \subsection{Proof of Lagrange's theorem} \end{lemma} \begin{proof} -Firstly, claim there exists $ a $ such that $ \jacobi{a}{p} = 1 $ and $ \jacobi{a + 1}{p} = -1 $. If not, since $ \jacobi{1}{p} = 1 $, we must have -$$ \jacobi{2}{p} = \dots = \jacobi{p - 1}{p} = 1. $$ -But we know that there are $ \br{p - 1} / 2 $ values of $ b $ with $ 1 \le b \le p - 1 $ and $ \jacobi{b}{p} = -1 $, a contradiction. Since $ p \equiv 3 \mod 4 $, $ \jacobi{-1}{p} = -1 $ by Euler's criterion. So -$$ \jacobi{-\br{a + 1}}{p} = \jacobi{a + 1}{p}\jacobi{-1}{p} = 1. $$ +Firstly, claim there exists $ a $ such that $ \symbol{a}{p} = 1 $ and $ \symbol{a + 1}{p} = -1 $. If not, since $ \symbol{1}{p} = 1 $, we must have +$$ \symbol{2}{p} = \dots = \symbol{p - 1}{p} = 1. $$ +But we know that there are $ \br{p - 1} / 2 $ values of $ b $ with $ 1 \le b \le p - 1 $ and $ \symbol{b}{p} = -1 $, a contradiction. Since $ p \equiv 3 \mod 4 $, $ \symbol{-1}{p} = -1 $ by Euler's criterion. So +$$ \symbol{-\br{a + 1}}{p} = \symbol{a + 1}{p}\symbol{-1}{p} = 1. $$ Choose $ x $ and $ y $ such that $$ x^2 \equiv a \mod p, \qquad y^2 \equiv -\br{a + 1} \mod p. $$ Then $ x^2 + y^2 \equiv -1 \mod p $. \end{proof} -By Lemma \ref{lem:54}, there exist $ x, y \in \Z $ such that +By Lemma \ref{lem:54}, there exist $ x, y \in \ZZ $ such that $$ x^2 + y^2 + 1 = pr, $$ -for some $ r $. Since the congruence -$$ x^2 + y^2 + 1 \equiv 0 \mod p $$ -only depends on $ x $ and $ y $ modulo $ p $, we can find $ x $ and $ y $ with $ -p / 2 < x, y < p / 2 $. Then +for some $ r $. Since the congruence $ x^2 + y^2 + 1 \equiv 0 \mod p $ only depends on $ x $ and $ y $ modulo $ p $, we can find $ x $ and $ y $ with $ -p / 2 < x, y < p / 2 $. Then $$ \dfrac{x^2 + y^2 + 1}{p} = r < p. $$ \begin{proposition} \label{prop:55} Suppose that $$ x^2 + y^2 + z^2 + w^2 = pr, \qquad 1 \le r < p. $$ -If $ r > 1 $, there exist $ x', y', z', w', r' $, for +If $ r > 1 $, there exist $ x', y', z', w', r' $ such that $$ x'^2 + y'^2 + z'^2 + w'^2 = pr', \qquad 1 \le r' < r. $$ \end{proposition} @@ -1308,13 +1230,7 @@ \subsection{Proof of Lagrange's theorem} $$ x \equiv a \mod r, \qquad y \equiv b \mod r, \qquad z \equiv c \mod r, \qquad w \equiv d \mod r. $$ Then $$ a^2 + b^2 + c^2 + d^2 \equiv x^2 + y^2 + z^2 + w^2 = pr \equiv 0 \mod r. $$ -Write -$$ a^2 + b^2 + c^2 + d^2 = rr'. $$ -Then -$$ rr' < 4\br{\dfrac{r}{2}}^2 = r^2, $$ -so $ 0 \le r' < r $. If $ r' = 0 $ then $ a = b = c = d = 0 $, so $ r' $ divides each of $ x, y, z, w $. Since -$$ x^2 + y^2 + z^2 + w^2 = pr, $$ -we get $ r^2 \mid pr $ so $ r \mid p $, and since $ r < p $, we get $ r = 1 $, and we are done. Otherwise $ 1 \le r' < r $. Then +Write $ a^2 + b^2 + c^2 + d^2 = rr' $. Then $ rr' < 4\br{r / 2}^2 = r^2 $, so $ 0 \le r' < r $. If $ r' = 0 $ then $ a = b = c = d = 0 $, so $ r' $ divides each of $ x, y, z, w $. Since $ x^2 + y^2 + z^2 + w^2 = pr $, we get $ r^2 \mid pr $ so $ r \mid p $, and since $ r < p $, we get $ r = 1 $, and we are done. Otherwise $ 1 \le r' < r $. Then \begin{align*} \br{rr'}\br{rp} = \ & \br{a^2 + b^2 + c^2 + d^2}\br{x^2 + y^2 + z^2 + w^2} \\ @@ -1336,13 +1252,11 @@ \subsection{Proof of Lagrange's theorem} \begin{remark} This can be interpreted as a version of Euclid's algorithm in the ring -$$ \cbr{\dfrac{a + bi + cj + dk}{2} \ \Bigg| \ a \equiv b \equiv c \equiv d \mod 2}. $$ +$$ \cbr{\dfrac{a + bi + cj + dk}{2} \st a \equiv b \equiv c \equiv d \mod 2}. $$ \end{remark} \begin{note*} -This ring is non-commutative, and also, for example, -$$ 5 = \br{1 - 2i}\br{1 - 2i} = \br{1 + 2j}\br{1 - 2j}, $$ -so you have to be careful with unique factorisation, etc. +This ring is non-commutative, and also, for example, $ 5 = \br{1 - 2i}\br{1 - 2i} = \br{1 + 2j}\br{1 - 2j} $, so you have to be careful with unique factorisation, etc. \end{note*} \subsection{Sums of three squares} @@ -1362,7 +1276,7 @@ \section{Pell's equation} \subsection{Pell's equation} -Let $ d \in \Z_{> 1} $ be squarefree. \textbf{Pell's equation} is +Let $ d \in \ZZ_{> 1} $ be squarefree. \textbf{Pell's equation} is $$ x^2 - dy^2 = 1. $$ \begin{example*} @@ -1372,41 +1286,36 @@ \subsection{Pell's equation} We will find it useful to write $$ x^2 - dy^2 = \br{x + \sqrt{d}y}\br{x - \sqrt{d}y}. $$ This suggests that we should look at a ring like -$$ \Z\sbr{\sqrt{d}} = \cbr{a + b\sqrt{d} \mid a, b \in \Z}. $$ +$$ \ZZ\sbr{\sqrt{d}} = \cbr{a + b\sqrt{d} \st a, b \in \ZZ}. $$ \begin{definition} -If $ \alpha \in \C $, then $ \Z\sbr{\alpha} $ is the \textbf{smallest subring of $ \C $ containing $ \alpha $}. +If $ \alpha \in \CC $, then $ \ZZ\sbr{\alpha} $ is the \textbf{smallest subring of $ \CC $ containing $ \alpha $}. \end{definition} \begin{example*} \hfill \begin{itemize} -\item If $ \alpha = 1 $, then $ \Z\sbr{\alpha} = \Z $. -\item If $ \alpha = i $, $ \Z\sbr{i} $ is what we wrote before. -\item On the other hand $ \Z\sbr{\pi} $ is the ring of -$$ a_0 + \dots + a_n\pi^n, \qquad a_i \in \Z, $$ -for $ n $ arbitrary. -\item Also $ \Z\sbr{\sqrt[3]{2}} $ is not just the set -$$ \cbr{a + b\sqrt[3]{2} \mid a, b \in \Z}, $$ -because this set does not contain $ \br{\sqrt[3]{2}}^2 = \sqrt[3]{4} $. -\item Also $ \Z\sbr{1 / p} $ contains $ 1 / p^n $ for all $ n $, so in fact -$$ \Z\sbr{\dfrac{1}{p}} = \cbr{\dfrac{a}{p^n} \ \Bigg| \ a \in \Z, \ n \ge 0}. $$ +\item If $ \alpha = 1 $, then $ \ZZ\sbr{\alpha} = \ZZ $. +\item If $ \alpha = i $, $ \ZZ\sbr{i} $ is what we wrote before. +\item On the other hand $ \ZZ\sbr{\pi} $ is the ring of $ a_0 + \dots + a_n\pi^n $ for $ a_i \in \ZZ $ and $ n $ arbitrary. +\item Also $ \ZZ\sbr{\sqrt[3]{2}} $ is not just the set $ \cbr{a + b\sqrt[3]{2} \st a, b \in \ZZ} $, because this set does not contain $ \br{\sqrt[3]{2}}^2 = \sqrt[3]{4} $. +\item Also $ \ZZ\sbr{\tfrac{1}{p}} $ contains $ 1 / p^n $ for all $ n $, so in fact $ \ZZ\sbr{\tfrac{1}{p}} = \cbr{a / p^n \st a \in \ZZ, \ n \ge 0} $. \end{itemize} \end{example*} -An alternative definition is that $ \Z\sbr{\alpha} $ is the intersection of all subrings of $ \C $ containing $ \alpha $. +An alternative definition is that $ \ZZ\sbr{\alpha} $ is the intersection of all subrings of $ \CC $ containing $ \alpha $. \lecture{16}{Friday}{09/11/18} -Lecture 16 is a problem class. +Lecture 16 is a problems class. -\lecture{17}{Tuesday}{13/11/18} +\subsection{Quadratic subrings of \texorpdfstring{$ \CC $}{C}} -\subsection{Quadratic subrings of \texorpdfstring{$ \C $}{C}} +\lecture{17}{Tuesday}{13/11/18} \begin{definition} -Say that $ \alpha \in \C $ is an \textbf{algebraic integer of degree two} if it is a root of a polynomial -$$ X^2 + aX + b, \qquad a, b \in \Z, \qquad \alpha \notin \Z. $$ +Say that $ \alpha \in \CC $ is an \textbf{algebraic integer of degree two} if it is a root of a polynomial +$$ X^2 + aX + b, \qquad a, b \in \ZZ, \qquad \alpha \notin \ZZ. $$ \end{definition} \begin{example*} @@ -1417,17 +1326,14 @@ \subsection{Quadratic subrings of \texorpdfstring{$ \C $}{C}} \end{itemize} \end{example*} -\pagebreak - \begin{proposition} If $ \alpha $ is an algebraic integer of degree two, then -$$ \Z\sbr{\alpha} = \cbr{x + y\alpha \mid x, y \in \Z}. $$ +$$ \ZZ\sbr{\alpha} = \cbr{x + y\alpha \st x, y \in \ZZ}. $$ \end{proposition} \begin{proof} -Since $ \alpha \notin \Z $, we have $ \alpha \notin \Q $, since if $ \alpha = r / s $ for $ \br{r, s} = 1 $ then -$$ r^2 + ars + bs^2 = 0, $$ -so $ s \mid r^2 $, so $ s \mid 1 $, so $ \alpha \in \Z $. So if $ x, y \in \Z $ and $ x + y\alpha = 0 $, then $ x = y = 0 $. Certainly every $ x + y\alpha \in \Z\sbr{\alpha} $. The set $ \cbr{x + y\alpha} $ is closed under addition and subtraction, so we only have to check that is closed under multiplication. But +Since $ \alpha \notin \ZZ $, we have $ \alpha \notin \QQ $, since if $ \alpha = r / s $ for $ \br{r, s} = 1 $ then $ r^2 + ars + bs^2 = 0 $, +so $ s \mid r^2 $, so $ s \mid 1 $, so $ \alpha \in \ZZ $. So if $ x, y \in \ZZ $ and $ x + y\alpha = 0 $, then $ x = y = 0 $. Certainly every $ x + y\alpha \in \ZZ\sbr{\alpha} $. The set $ \cbr{x + y\alpha} $ is closed under addition and subtraction, so we only have to check that is closed under multiplication. But \begin{align*} \br{x + y\alpha}\br{X + Y\alpha} & = xX + \br{xY + yX}\alpha + yY\alpha^2 \\ @@ -1436,62 +1342,48 @@ \subsection{Quadratic subrings of \texorpdfstring{$ \C $}{C}} \end{align*} \end{proof} -If $ \alpha $ is an algebraic integer of degree two, say that $ \Z\sbr{\alpha} $ is a \textbf{real quadratic subring} of $ \C $ if $ \alpha \in \R $, and an \textbf{imaginary quadratic subring} of $ \C $ if $ \alpha \notin \R $. Let $ \alpha^* $ be the other root of $ X^2 + aX + b = 0 $. - -\begin{example*} -\hfill -\begin{itemize} -\item $ i^* = -i = \bar{i} $. -\item $ \sqrt{d}^* = -\sqrt{d} $. -\end{itemize} -\end{example*} +\pagebreak -If $ z = x + y\alpha \in \Z\sbr{\alpha} $, write $ z^* = x + y\alpha^* $. If $ \Z\sbr{\alpha} $ is imaginary quadratic, then $ \alpha^* = \bar{\alpha} $, and $ z^* = \bar{z} $. This is not true if $ \Z\sbr{\alpha} $ is real quadratic. Define $ N\br{z} = zz^* $. Since $ \alpha $ and $ \alpha^* $ are the roots of $ X^2 + aX + b $, we have -$$ \alpha + \alpha^* = -a, \qquad \alpha\alpha^* = b. $$ -If $ z = x + y\alpha $, then -$$ N\br{z} = \br{x + y\alpha}\br{x + y\alpha^*} = x^2 + xy\br{\alpha + \alpha^*} + y^2\alpha\alpha^* = x^2 - axy + by^2 \in \Z. $$ -We have $ \br{zw}^* = z^*w^* $, so -$$ N\br{z}N\br{w} = zz^*ww^* = \br{zw}\br{zw}^* = N\br{zw}. $$ -So $ N : \Z\sbr{\alpha} \to \Z $ is multiplicative. (Exercise: $ N\br{x + y\alpha} = 0 $ if and only if $ x = y = 0 $) If $ \Z\sbr{\alpha} $ is imaginary quadratic then $ z^* = \bar{z} $, and $ N\br{z} \ge 0 $. If $ \Z\sbr{\alpha} $ is real quadratic, we can have $ N\br{z} < 0 $. +If $ \alpha $ is an algebraic integer of degree two, say that $ \ZZ\sbr{\alpha} $ is a \textbf{real quadratic subring} of $ \CC $ if $ \alpha \in \RR $, and an \textbf{imaginary quadratic subring} of $ \CC $ if $ \alpha \notin \RR $. Let $ \alpha^* $ be the other root of $ X^2 + aX + b = 0 $. \begin{example*} -$ N\br{\sqrt{d}} = \br{\sqrt{d}}\br{-\sqrt{d}} = -d < 0 $. +$ i^* = -i = \bar{i} $ and $ \sqrt{d}^* = -\sqrt{d} $. \end{example*} +If $ z = x + y\alpha \in \ZZ\sbr{\alpha} $, write $ z^* = x + y\alpha^* $. If $ \ZZ\sbr{\alpha} $ is imaginary quadratic, then $ \alpha^* = \bar{\alpha} $, and $ z^* = \bar{z} $. This is not true if $ \ZZ\sbr{\alpha} $ is real quadratic. Define $ \N\br{z} = zz^* $. Since $ \alpha $ and $ \alpha^* $ are the roots of $ X^2 + aX + b $, we have $ \alpha + \alpha^* = -a $ and $ \alpha\alpha^* = b $. If $ z = x + y\alpha $, then +$$ \N\br{z} = \br{x + y\alpha}\br{x + y\alpha^*} = x^2 + xy\br{\alpha + \alpha^*} + y^2\alpha\alpha^* = x^2 - axy + by^2 \in \ZZ. $$ +We have $ \br{zw}^* = z^*w^* $, so $ \N\br{z}\N\br{w} = zz^*ww^* = \br{zw}\br{zw}^* = \N\br{zw} $. So $ \N : \ZZ\sbr{\alpha} \to \ZZ $ is multiplicative. Then $ \N\br{x + y\alpha} = 0 $ if and only if $ x = y = 0 $. \footnote{Exercise} If $ \ZZ\sbr{\alpha} $ is imaginary quadratic then $ z^* = \bar{z} $, and $ \N\br{z} \ge 0 $. If $ \ZZ\sbr{\alpha} $ is real quadratic, we can have $ \N\br{z} < 0 $. + \begin{example*} -If $ \alpha = \sqrt{d} $, -$$ N\br{x + y\sqrt{d}} = \br{x + y\sqrt{d}}\br{x + y\sqrt{d}}^* = \br{x + y\sqrt{d}}\br{x - y\sqrt{d}} = x^2 - dy^2. $$ -So solutions to Pell's equation are the same thing as elements of $ \Z\sbr{\alpha} $ of norm one. +If $ \alpha = \sqrt{d} $, then $ \N\br{\sqrt{d}} = \br{\sqrt{d}}\br{-\sqrt{d}} = -d < 0 $, and +$$ \N\br{x + y\sqrt{d}} = \br{x + y\sqrt{d}}\br{x + y\sqrt{d}}^* = \br{x + y\sqrt{d}}\br{x - y\sqrt{d}} = x^2 - dy^2. $$ +So solutions to Pell's equation are the same thing as elements of $ \ZZ\sbr{\alpha} $ of norm one. \end{example*} \subsection{Factorisation in quadratic rings} \begin{definition} -The \textbf{units} of $ \Z\sbr{\alpha} $ are by definition the elements with multiplicative inverses, and they form a group $ \Z\sbr{\alpha}^\times $ under multiplication. We say that $ z, w \in \Z\sbr{\alpha} $ are \textbf{associates} if $ z = uw $ for $ u \in \Z\sbr{\alpha}^\times $. +The \textbf{units} of $ \ZZ\sbr{\alpha} $ are by definition the elements with multiplicative inverses, and they form a group $ \ZZ\sbr{\alpha}^\times $ under multiplication. We say that $ z, w \in \ZZ\sbr{\alpha} $ are \textbf{associates} if $ z = uw $ for $ u \in \ZZ\sbr{\alpha}^\times $. \end{definition} -If $ u \in \Z\sbr{\alpha}^\times $, then write $ 1 = uv $. Then -$$ 1 = N\br{1} = N\br{u}N\br{v}, $$ -so $ N\br{u} = \pm 1 $. Conversely if $ N\br{u} = \pm 1 $, then $ \pm 1 = N\br{u} = u\br{u^*} $, so $ u\br{\pm u^*} = 1 $, so $ u \in \Z\sbr{\alpha}^\times $. So -$$ \Z\sbr{\alpha}^\times = \cbr{z \in \Z\sbr{\alpha} \mid N\br{z} = \pm 1}. $$ +If $ u \in \ZZ\sbr{\alpha}^\times $, then write $ 1 = uv $. Then $ 1 = \N\br{1} = \N\br{u}\N\br{v} $, so $ \N\br{u} = \pm 1 $. Conversely if $ \N\br{u} = \pm 1 $, then $ \pm 1 = \N\br{u} = u\br{u^*} $, so $ u\br{\pm u^*} = 1 $, so $ u \in \ZZ\sbr{\alpha}^\times $. So +$$ \ZZ\sbr{\alpha}^\times = \cbr{z \in \ZZ\sbr{\alpha} \st \N\br{z} = \pm 1}. $$ Write -$$ \Z\sbr{\alpha}^{\times, 1} = \cbr{z \in \Z\sbr{\alpha} \mid N\br{z} = 1}. $$ -Then $ \Z\sbr{\alpha}^{\times, 1} $ is a multiplicative subgroup of $ \Z\sbr{\alpha}^\times $. - -\pagebreak +$$ \ZZ\sbr{\alpha}^{\times, 1} = \cbr{z \in \ZZ\sbr{\alpha} \st \N\br{z} = 1}. $$ +Then $ \ZZ\sbr{\alpha}^{\times, 1} $ is a multiplicative subgroup of $ \ZZ\sbr{\alpha}^\times $. \subsection{Back to Pell's equation} \begin{example*} -If $ \alpha = \sqrt{d} $, for $ d > 1 $ squarefree, then -$$ \Z\sbr{\sqrt{d}}^{\times, 1} = \cbr{x + y\sqrt{d} \mid x^2 - dy^2 = 1}. $$ +If $ \alpha = \sqrt{d} $ for $ d > 1 $ squarefree, then +$$ \ZZ\sbr{\sqrt{d}}^{\times, 1} = \cbr{x + y\sqrt{d} \st x^2 - dy^2 = 1}. $$ \end{example*} -(Exercise: if $ \Z\sbr{\alpha} $ is imaginary quadratic, show that $ \Z\sbr{\alpha}^\times = \Z\sbr{\alpha}^{\times, 1} $ is finite, so what are the possibilities for this group?) What is $ \Z\sbr{\sqrt{d}}^{\times, 1} $? Certainly contains $ \pm 1 $. Anything else will be of the form $ x + y\sqrt{d} $ with $ x, y \ne 0 $. +If $ \ZZ\sbr{\alpha} $ is imaginary quadratic, then $ \ZZ\sbr{\alpha}^\times = \ZZ\sbr{\alpha}^{\times, 1} $ is finite. What are the possibilities for this group? \footnote{Exercise} What is $ \ZZ\sbr{\sqrt{d}}^{\times, 1} $? Certainly contains $ \pm 1 $. Anything else will be of the form $ x + y\sqrt{d} $ with $ x, y \ne 0 $. \begin{lemma} \label{lem:62} -Let $ x + y\sqrt{d} $ be an element of $ \Z\sbr{\sqrt{d}}^{\times, 1} $. Then +Let $ x + y\sqrt{d} $ be an element of $ \ZZ\sbr{\sqrt{d}}^{\times, 1} $. Then \begin{align*} x > 0, \qquad y > 0 \qquad & \iff \qquad x + y\sqrt{d} > 1, \\ x > 0, \qquad y < 0 \qquad & \iff \qquad 0 < x + y\sqrt{d} < 1, \\ @@ -1504,52 +1396,49 @@ \subsection{Back to Pell's equation} If $ x, y > 0 $ then $ x + y\sqrt{d} > y\sqrt{d} \ge \sqrt{d} > 1 $. Then $ x - y\sqrt{d} = 1 / \br{x + y\sqrt{d}} \in \br{0, 1} $. So replacing $ y $ by $ -y $, we get $ x > 0 $ and $ y < 0 $, so $ 0 < x + y\sqrt{d} < 1 $. Replacing $ \br{x, y} $ with $ \br{-x, -y} $ gives the forward in the third and fourth lines. Since the four possibilities for the right hand side are exhaustive for $ x, y \ne 0 $, we are done. \end{proof} +\pagebreak + \begin{lemma} \label{lem:63} -Let $ z = x + y\sqrt{d} $ and $ z' = x' + y'\sqrt{d} $ be two elements of $ \Z\sbr{\sqrt{d}}^{\times, 1} $ with $ z, z' > 1 $, that is $ x, y, x', y' > 0 $. Then $ z > z' $ if and only if $ y > y' $. +Let $ z = x + y\sqrt{d} $ and $ z' = x' + y'\sqrt{d} $ be two elements of $ \ZZ\sbr{\sqrt{d}}^{\times, 1} $ with $ z, z' > 1 $, that is $ x, y, x', y' > 0 $. Then $ z > z' $ if and only if $ y > y' $. \end{lemma} \begin{proof} -$$ z - \dfrac{1}{z} = x + y\sqrt{d} - \br{x - y\sqrt{d}} = 2y\sqrt{d}, $$ -so just need to check that $ z > z' $ if and only if $ z - 1 / z > z' - 1 / z' $. But $ z - 1 / z $ is increasing, since its derivative is $ 1 + 1 / z^2 > 0 $. +$ z - 1 / z = x + y\sqrt{d} - \br{x - y\sqrt{d}} = 2y\sqrt{d} $, so just need to check that $ z > z' $ if and only if $ z - 1 / z > z' - 1 / z' $. But $ z - 1 / z $ is increasing, since its derivative is $ 1 + 1 / z^2 > 0 $. \end{proof} \lecture{18}{Wednesday}{14/11/18} -Suppose that there exists $ z \in \Z\sbr{\sqrt{d}}^{\times, 1} $, so $ z \ne \pm 1 $. By replacing $ z $ by $ \pm z^{\pm 1} $, we can assume that $ z > 1 $. So by Lemma \ref{lem:62}, if $ z = x + y\sqrt{d} $, then $ x, y > 0 $. Let -$$ \epsilon = x + y\sqrt{d} \in \Z\sbr{\sqrt{d}}^{\times, 1}, \qquad x, y > 0, $$ -with $ y $ as small as possible. Call $ \epsilon $ the \textbf{fundamental $ 1 $-unit} of $ \Z\sbr{\sqrt{d}} $. +Suppose that there exists $ z \in \ZZ\sbr{\sqrt{d}}^{\times, 1} $, so $ z \ne \pm 1 $. By replacing $ z $ by $ \pm z^{\pm 1} $, we can assume that $ z > 1 $. So by Lemma \ref{lem:62}, if $ z = x + y\sqrt{d} $, then $ x, y > 0 $. Let +$$ \epsilon = x + y\sqrt{d} \in \ZZ\sbr{\sqrt{d}}^{\times, 1}, \qquad x, y > 0, $$ +with $ y $ as small as possible. Call $ \epsilon $ the \textbf{fundamental $ 1 $-unit} of $ \ZZ\sbr{\sqrt{d}} $. \begin{proposition} -Suppose that $ \Z\sbr{\sqrt{d}}^{\times, 1} \ne \cbr{\pm 1} $, and let $ \epsilon $ be the fundamental $ 1 $-unit. Then every element of $ \Z\sbr{\sqrt{d}}^{\times, 1} $ is of the form $ \pm \epsilon^n $ for some $ n \in \Z $. Conversely, $ N\br{\pm \epsilon^n} = N\br{\pm 1}N\br{\epsilon}^n = 1 $. +Suppose that $ \ZZ\sbr{\sqrt{d}}^{\times, 1} \ne \cbr{\pm 1} $, and let $ \epsilon $ be the fundamental $ 1 $-unit. Then every element of $ \ZZ\sbr{\sqrt{d}}^{\times, 1} $ is of the form $ \pm\epsilon^n $ for some $ n \in \ZZ $. Conversely, $ \N\br{\pm\epsilon^n} = \N\br{\pm 1}\N\br{\epsilon}^n = 1 $. \end{proposition} \begin{proof} -Let $ z \in \Z\sbr{\sqrt{d}}^{\times, 1} $, so $ z \ne \pm 1 $. After replacing $ z $ by $ \pm z^{\pm 1} $, we may assume that $ z > 1 $. Choose $ n \ge 0 $ such that $ \epsilon^n \le z < \epsilon^{n + 1} $. Then $ 1 \le z\epsilon^{-n} < \epsilon $, and $ N\br{z\epsilon^{-n}} = N\br{z}N\br{\epsilon}^{-n} = 1 $. So $ z\epsilon^{-n} \in \Z\sbr{\sqrt{d}}^{\times, 1} $. So by the choice of $ \epsilon $, and Lemma \ref{lem:63}, we have $ z\epsilon^{-n} = 1 $, that is $ z = \epsilon^n $. +Let $ z \in \ZZ\sbr{\sqrt{d}}^{\times, 1} $, so $ z \ne \pm 1 $. After replacing $ z $ by $ \pm z^{\pm 1} $, we may assume that $ z > 1 $. Choose $ n \ge 0 $ such that $ \epsilon^n \le z < \epsilon^{n + 1} $. Then $ 1 \le z\epsilon^{-n} < \epsilon $, and $ \N\br{z\epsilon^{-n}} = \N\br{z}\N\br{\epsilon}^{-n} = 1 $. So $ z\epsilon^{-n} \in \ZZ\sbr{\sqrt{d}}^{\times, 1} $. So by the choice of $ \epsilon $, and Lemma \ref{lem:63}, we have $ z\epsilon^{-n} = 1 $, that is $ z = \epsilon^n $. \end{proof} \begin{example*} Let $ d = 2 $ and $ x^2 - 2y^2 = 1 $. Then $ y = 2 $ and $ x = 3 $ is a solution. So $ \epsilon = 3 + 2\sqrt{2} $. Then $ \epsilon^2 = \br{3 + 2\sqrt{2}}^2 = 17 + 12\sqrt{2} $, and $ 17^2 - 2\br{12}^2 = 1 $. \end{example*} -\pagebreak - \subsection{Constructing the fundamental \texorpdfstring{$ 1 $}{1}-unit} -The idea is that if $ x^2 - dy^2 = 1 $, for $ x, y > 0 $, then $ x / y \approx \sqrt{d} $. -$$ \abs{x - y\sqrt{d}} = \dfrac{1}{\abs{x + y\sqrt{d}}}, $$ -which is small. So one way to try to find $ 1 $-units is to find rational numbers which are good approximations to $ \sqrt{d} $. Want to make $ \abs{x / y - \sqrt{d}} $ as small as possible for $ y $ of a given size. More generally, if $ \alpha \in \R \setminus \Q $, we might want to find $ x, y > 0 $ such that +The idea is that if $ x^2 - dy^2 = 1 $ for $ x, y > 0 $, then $ x / y \approx \sqrt{d} $. Then $ \abs{x - y\sqrt{d}} = 1 / \abs{x + y\sqrt{d}} $, which is small. So one way to try to find $ 1 $-units is to find rational numbers which are good approximations to $ \sqrt{d} $. Want to make $ \abs{x / y - \sqrt{d}} $ as small as possible for $ y $ of a given size. More generally, if $ \alpha \in \RR \setminus \QQ $, we might want to find $ x, y > 0 $ such that $$ \abs{\dfrac{x}{y} - \alpha} < \dfrac{C}{y^n}, $$ where $ C $ and $ n $ are fixed. \begin{itemize}[leftmargin=1in] -\item[$ n = 0 $] Trivial. -\item[$ n = 1 $, $ C = 1 $] Trivial, by just choosing any $ y $ and $ x / y $ as close to $ \alpha $ as you can. -\item[$ n = 2 $, $ C = 1 $] Not obvious. In fact there always exist infinitely many $ x $ and $ y $ with $ \abs{x / y - \alpha} < 1 / y^2 $, as we now show. +\item[$ n = 0 $.] Trivial. +\item[$ n = 1 $, $ C = 1 $.] Trivial, by just choosing any $ y $ and $ x / y $ as close to $ \alpha $ as you can. +\item[$ n = 2 $, $ C = 1 $.] Not obvious. In fact there always exist infinitely many $ x $ and $ y $ with $ \abs{x / y - \alpha} < 1 / y^2 $, as we now show. \end{itemize} \begin{theorem}[Dirichlet's theorem] \label{thm:65} -Let $ \alpha \in \R \setminus \Q $, and let $ Q \in \Z_{> 1} $. Then there exist $ p, q \in \Z $, such that +Let $ \alpha \in \RR \setminus \QQ $, and let $ Q \in \ZZ_{> 1} $. Then there exist $ p, q \in \ZZ $, such that $$ 1 \le q < Q, \qquad \abs{p - q\alpha} < \dfrac{1}{Q}. $$ \end{theorem} @@ -1558,29 +1447,27 @@ \subsection{Constructing the fundamental \texorpdfstring{$ 1 $}{1}-unit} $$ \sbr{0, \dfrac{1}{Q}}, \qquad \dots, \qquad \sbr{\dfrac{Q - 1}{Q}, 1}. $$ The set $$ \cbr{0, \alpha - a_1, \dots, \br{Q - 1}\alpha - a_{Q - 1}, 1}, $$ -contains $ Q + 1 $ elements, so some pair of them must be in the same interval. The difference of these two elements is of the form $ p - q\alpha $, for $ 1 \le q < Q $. +contains $ Q + 1 $ elements, so some pair of them must be in the same interval. The difference of these two elements is of the form $ p - q\alpha $ for $ 1 \le q < Q $. \end{proof} +\pagebreak + \begin{corollary} \label{cor:66} -For any $ \alpha \in \R \setminus \Q $, there exist infinitely many pairs $ p, q \in \Z $ such that +For any $ \alpha \in \RR \setminus \QQ $, there exist infinitely many pairs $ p, q \in \ZZ $ such that $$ \abs{\alpha - \dfrac{p}{q}} < \dfrac{1}{q^2}. $$ \end{corollary} \begin{proof} Certainly there exists $ p $ for $ q = 1 $. It is then enough to prove that if $ \abs{\alpha - p / q} < 1 / q^2 $, there exist $ p' $ and $ q' $ such that $$ \abs{\alpha - \dfrac{p'}{q'}} < \dfrac{1}{\br{q'}^2}, \qquad \abs{\alpha - \dfrac{p'}{q'}} < \abs{\alpha - \dfrac{p}{q}}. $$ -Choose $ Q $ such that -$$ \dfrac{1}{Q} < \abs{\alpha - \dfrac{p}{q}}. $$ -By Theorem \ref{thm:65}, there exist $ p' $ and $ q' $ with +Choose $ Q $ such that $ 1 / Q < \abs{\alpha - p / q} $. By Theorem \ref{thm:65}, there exist $ p' $ and $ q' $ with $$ 1 \le q' < Q, \qquad \abs{\alpha - \dfrac{p'}{q'}} < \dfrac{1}{Qq'} < \dfrac{1}{\br{q'}^2}. $$ Also $$ \abs{\alpha - \dfrac{p'}{q'}} < \dfrac{1}{Qq'} \le \dfrac{1}{Q} < \abs{\alpha - \dfrac{p}{q}}, $$ as required. \end{proof} -\pagebreak - We can now show the following. \begin{theorem} @@ -1588,33 +1475,27 @@ \subsection{Constructing the fundamental \texorpdfstring{$ 1 $}{1}-unit} \end{theorem} \begin{proof} -By Corollary \ref{cor:66}, there exist infinitely many $ \br{p_i, q_i} $ for $ p_i, q_i > 0 $ such that -$$ \abs{\dfrac{p_i}{q_i} - \sqrt{d}} < \dfrac{1}{q_i^2}, $$ -that is -$$ \abs{p_i - q_i\sqrt{d}} < \dfrac{1}{q_i}. $$ -Then +By Corollary \ref{cor:66}, there exist infinitely many $ \br{p_i, q_i} $ for $ p_i, q_i > 0 $ such that $ \abs{p_i / q_i - \sqrt{d}} < 1 / q_i^2 $, that is $ \abs{p_i - q_i\sqrt{d}} < 1 / q_i $. Then $$ \abs{p_i + q_i\sqrt{d}} \le \abs{p_i - q_i\sqrt{d}} + 2q_i\sqrt{d} < \dfrac{1}{q_i} + 2q_i\sqrt{d} < 3q_i\sqrt{d}. $$ So -$$ \abs{N\br{p_i + q_i\sqrt{d}}} = \abs{p_i + q_i\sqrt{d}}\abs{p_i - q_i\sqrt{d}} < 3q_i\sqrt{d}\br{\dfrac{1}{q_i}} = 3\sqrt{d}. $$ -So there exists $ M \in \br{-3\sqrt{d}, 3\sqrt{d}} $ such that $ N\br{p_i + q_i\sqrt{d}} = M $ for infinitely many $ i $. Then there exists $ \br{p_0, q_0} $ such that +$$ \abs{\N\br{p_i + q_i\sqrt{d}}} = \abs{p_i + q_i\sqrt{d}}\abs{p_i - q_i\sqrt{d}} < 3q_i\sqrt{d}\br{\dfrac{1}{q_i}} = 3\sqrt{d}. $$ +So there exists $ M \in \br{-3\sqrt{d}, 3\sqrt{d}} $ such that $ \N\br{p_i + q_i\sqrt{d}} = M $ for infinitely many $ i $. Then there exists $ \br{p_0, q_0} $ such that $$ p_i \equiv p_0 \mod M, \qquad q_i \equiv q_0 \mod M, $$ for infinitely many $ i $. Now consider $ \br{p_i, q_i} \ne \br{p_j, q_j} $ of this form, that is -$$ N\br{p_i + q_i\sqrt{d}} = N\br{p_j + q_j\sqrt{d}} = M, \qquad p_i \equiv p_j \mod M, \qquad q_i \equiv q_j \mod M. $$ +$$ \N\br{p_i + q_i\sqrt{d}} = \N\br{p_j + q_j\sqrt{d}} = M, \qquad p_i \equiv p_j \mod M, \qquad q_i \equiv q_j \mod M. $$ Then $$ \dfrac{p_i - q_i\sqrt{d}}{p_j - q_j\sqrt{d}} = \dfrac{\br{p_i - q_i\sqrt{d}}\br{p_j + q_j\sqrt{d}}}{M} = \dfrac{\br{p_ip_j - dq_iq_j} + \br{p_iq_j - p_jq_i}\sqrt{d}}{M}, $$ $$ p_iq_j \equiv p_jq_i \mod M, \qquad p_ip_j - dq_iq_j \equiv p_i^2 - dq_i^2 = M \equiv 0 \mod M. $$ So -$$ N\br{\dfrac{p_i - q_i\sqrt{d}}{p_j - q_j\sqrt{d}}} = \dfrac{M}{M} = 1, $$ -so -$$ \dfrac{p_i - q_i\sqrt{d}}{p_j - q_j\sqrt{d}} \in \Z\sbr{\sqrt{d}}^{\times, 1}, $$ -as required. +$$ \N\br{\dfrac{p_i - q_i\sqrt{d}}{p_j - q_j\sqrt{d}}} = \dfrac{M}{M} = 1, $$ +so $ \br{p_i - q_i\sqrt{d}} / \br{p_j - q_j\sqrt{d}} \in \ZZ\sbr{\sqrt{d}}^{\times, 1} $, as required. \end{proof} -\lecture{19}{Friday}{16/11/18} - \subsection{The equation \texorpdfstring{$ x^2 - dy^2 = - 1 $}{x2 - dy2 = -1}} -$ x^2 - dy^2 = -1 $ has a solution if and only if there exists $ u \in \Z\sbr{\sqrt{d}}^\times $ such that $ N\br{u} = -1 $. Given such a $ u $, all solutions to the equation are given by $ \pm u\epsilon^n $, for $ n \in \Z $, since $ N\br{v} = -1 $ if and only if $ N\br{v} = N\br{u} $ if and only if $ N\br{v / u} = 1 $. +\lecture{19}{Friday}{16/11/18} + +$ x^2 - dy^2 = -1 $ has a solution if and only if there exists $ u \in \ZZ\sbr{\sqrt{d}}^\times $ such that $ \N\br{u} = -1 $. Given such a $ u $, all solutions to the equation are given by $ \pm u\epsilon^n $ for $ n \in \ZZ $, since $ \N\br{v} = -1 $ if and only if $ \N\br{v} = \N\br{u} $, if and only if $ \N\br{v / u} = 1 $. \begin{example*} If $ d = 3 $, there are no solutions, as $ X^2 \equiv -1 \mod 3 $ has no solutions. @@ -1626,10 +1507,10 @@ \section{Continued fractions} \subsection{Rational continued fractions} -Let $ p / q \in \Q $. Write -$$ \dfrac{p}{q} = a_0 + r_0, \qquad a_0 = \fbr{\dfrac{p}{q}} \in \Z, \qquad 0 \le r_0 < 1. $$ +Let $ p / q \in \QQ $. Write +$$ \dfrac{p}{q} = a_0 + r_0, \qquad a_0 = \fbr{\dfrac{p}{q}} \in \ZZ, \qquad 0 \le r_0 < 1. $$ If $ r_i \ne 0 $, write -$$ \dfrac{1}{r_i} = a_{i + 1} + r_{i + 1}, \qquad a_{i + 1} = \fbr{\dfrac{1}{r_i}} \in \Z_{\ge 1}, \qquad 0 \le r_{i + 1} < 1. $$ +$$ \dfrac{1}{r_i} = a_{i + 1} + r_{i + 1}, \qquad a_{i + 1} = \fbr{\dfrac{1}{r_i}} \in \ZZ_{\ge 1}, \qquad 0 \le r_{i + 1} < 1. $$ Eventually get some $ r_n = 0 $. Write $$ \dfrac{p}{q} = a_0 + \dfrac{1}{a_1 + \dfrac{1}{\dots + \dfrac{1}{a_n}}}. $$ @@ -1639,10 +1520,10 @@ \subsection{Rational continued fractions} \subsection{Infinite continued fractions} -Let $ \alpha \in \R \setminus \Q $. As above, set $ a_0 = \fbr{\alpha} $, write -$$ \alpha = a_0 + r_0, \qquad a_0 = \fbr{\alpha} \in \Z, \qquad 0 \le r_0 < 1. $$ -Define sequences $ a_i, r_i $ by -$$ \dfrac{1}{r_i} = a_{i + 1} + r_{i + 1}, \qquad a_{i + 1} = \fbr{\dfrac{1}{r_i}} \in \Z_{\ge 1}, \qquad 0 \le r_{i + 1} < 1. $$ +Let $ \alpha \in \RR \setminus \QQ $. As above, set $ a_0 = \fbr{\alpha} $, write +$$ \alpha = a_0 + r_0, \qquad a_0 = \fbr{\alpha} \in \ZZ, \qquad 0 \le r_0 < 1. $$ +Define sequences $ a_i $ and $ r_i $ by +$$ \dfrac{1}{r_i} = a_{i + 1} + r_{i + 1}, \qquad a_{i + 1} = \fbr{\dfrac{1}{r_i}} \in \ZZ_{\ge 1}, \qquad 0 \le r_{i + 1} < 1. $$ By definition, $ a_i \ge 1 $ if $ i > 0 $. Write $$ \alpha = a_0 + \dfrac{1}{a_1 + \dfrac{1}{a_2 + \dfrac{1}{\dots}}}. $$ @@ -1662,25 +1543,24 @@ \subsection{Infinite continued fractions} $$ \end{example*} -\pagebreak - -If $ a_0, \dots, a_n \in \R $, then +If $ a_0, \dots, a_n \in \RR $, then $$ \sbr{a_0; a_1, \dots, a_n} = a_0 + \dfrac{1}{a_1 + \dfrac{1}{\dots + \dfrac{1}{a_n}}}. $$ +\pagebreak + \begin{lemma} \label{lem:68} -If $ a_0, \dots, a_n \in \R $, define $ p_i $ and $ q_i $ for $ 0 \le i \le n $ by +If $ a_0, \dots, a_n \in \RR $, define $ p_i $ and $ q_i $ for $ 0 \le i \le n $ by $$ p_0 = a_0, \qquad q_0 = 1, \qquad p_1 = a_0a_1 + 1, \qquad q_1 = a_1, \qquad p_i = a_ip_{i - 1} + p_{i - 2}, \qquad q_i = a_iq_{i - 1} + q_{i - 2}. $$ -Assuming that no $ q_i = 0 $, we have -$$ \sbr{a_0; a_1, \dots, a_n} = \dfrac{p_n}{q_n}. $$ +Assuming that no $ q_i = 0 $, we have $ \sbr{a_0; a_1, \dots, a_n} = p_n / q_n $. \end{lemma} \begin{proof} Induction on $ n $. \begin{itemize}[leftmargin=0.5in] -\item[$ n = 0 $] $ a_0 = a_0 / 1 $ is trivial. -\item[$ n = 1 $] $ a_0 + 1 / a_1 = \br{a_0a_1 + 1} / a_1 $ is trivial. -\item[$ n > 1 $] Define sequences $ p_i' $ and $ q_i' $ for $ 0 \le i \le n - 1 $ by applying the definition to the sequence +\item[$ n = 0 $.] $ a_0 = a_0 / 1 $ is trivial. +\item[$ n = 1 $.] $ a_0 + 1 / a_1 = \br{a_0a_1 + 1} / a_1 $ is trivial. +\item[$ n > 1 $.] Define sequences $ p_i' $ and $ q_i' $ for $ 0 \le i \le n - 1 $ by applying the definition to the sequence $$ a_0, \dots, a_{n - 2}, a_{n - 1} + \dfrac{1}{a_n}. $$ By definition, $ p_i' = p_i $ and $ q_i' = q_i $ if $ i \le n - 2 $. By induction, $$ \sbr{a_0; a_1, \dots, a_{n - 2}, a_{n - 1} + \dfrac{1}{a_n}} = \dfrac{p_{n - 1}'}{q_{n - 1}'}. $$ @@ -1699,15 +1579,9 @@ \subsection{Infinite continued fractions} \end{itemize} \end{proof} -Suppose now that $ a_i \ge 1 $ if $ i \ge 1 $. Then -$$ q_i = a_iq_{i - 1} + q_{i - 2} \ge q_{i - 1} + q_{i - 2}. $$ -So the $ q_i $ form an increasing sequence, in fact with -$$ q_i \ge q_{i - 1} + q_{i - 2} \ge 2q_{i - 2}, $$ -so it even increases exponentially. If $ a_0, a_1, \dots \in \R $ is an infinite sequence with $ a_i \ge 1 $ for all $ i $, say that $ p_i / q_i $ is the \textbf{$ i $-th convergent} to +Suppose now that $ a_i \ge 1 $ if $ i \ge 1 $. Then $ q_i = a_iq_{i - 1} + q_{i - 2} \ge q_{i - 1} + q_{i - 2} $. So the $ q_i $ form an increasing sequence, in fact with $ q_i \ge q_{i - 1} + q_{i - 2} \ge 2q_{i - 2} $, so it even increases exponentially. If $ a_0, a_1, \dots \in \RR $ is an infinite sequence with $ a_i \ge 1 $ for all $ i $, say that $ p_i / q_i $ is the \textbf{$ i $-th convergent} to $$ a_0 + \dfrac{1}{a_1 + \dfrac{1}{a_2 + \dfrac{1}{\dots}}}. $$ -\pagebreak - \begin{lemma} \label{lem:69} For all $ n $, @@ -1725,38 +1599,32 @@ \subsection{Infinite continued fractions} \end{proof} \begin{note*} -If $ a_i \in \Z $, then $ p_i, q_i \in \Z $, and Lemma \ref{lem:69} implies that $ \br{p_n, q_n} = 1 $. In general, Lemma \ref{lem:69} implies that +If $ a_i \in \ZZ $, then $ p_i, q_i \in \ZZ $, and Lemma \ref{lem:69} implies that $ \br{p_n, q_n} = 1 $. In general, Lemma \ref{lem:69} implies that $$ \abs{\dfrac{p_n}{q_n} - \dfrac{p_{n - 1}}{q_{n - 1}}} = \dfrac{1}{q_nq_{n - 1}}. $$ -If $ a_i \ge 1 $ for all $ i \ge 1 $, then the sequence $ q_i $ increases exponentially. So -$$ \sum_{i = 1}^n \dfrac{1}{q_iq_{i - 1}} $$ -converges, so that $ \br{p_n / q_n} $ is a Cauchy sequence, so it converges. +If $ a_i \ge 1 $ for all $ i \ge 1 $, then the sequence $ q_i $ increases exponentially. So $ \sum_{i = 1}^n 1 / q_iq_{i - 1} $ converges, so that $ \br{p_n / q_n} $ is a Cauchy sequence, so it converges. \end{note*} +\pagebreak + \lecture{20}{Tuesday}{20/11/18} \begin{lemma} \label{lem:70} -Let $ \alpha \in \R \setminus \Q $, and let $ \sbr{a_0; a_1, a_2, \dots} $ be the corresponding continued fraction. Then $ p_n / q_n < \alpha $ if $ n $ is even, and $ p_n / q_n > \alpha $ if $ n $ is odd. +Let $ \alpha \in \RR \setminus \QQ $, and let $ \sbr{a_0; a_1, a_2, \dots} $ be the corresponding continued fraction. Then $ p_n / q_n < \alpha $ if $ n $ is even, and $ p_n / q_n > \alpha $ if $ n $ is odd. \end{lemma} \begin{proof} Induction on $ n $. \begin{itemize}[leftmargin=0.5in] -\item[$ n = 0 $] $ a_0 = \fbr{\alpha} < \alpha $ and $ p_0 / q_0 = a_0 / 1 = a_0 $. -\item[$ n $ odd] By induction, we have -$$ \sbr{a_1; a_2, \dots, a_n} < \dfrac{1}{\alpha - a_0}, $$ -since $ \alpha = a_0 + 1 / \dots $. That is, -$$ \alpha - a_0 < \dfrac{1}{\sbr{a_1; a_2, \dots, a_n}}, $$ -that is +\item[$ n = 0 $.] $ a_0 = \fbr{\alpha} < \alpha $ and $ p_0 / q_0 = a_0 / 1 = a_0 $. +\item[$ n $ odd.] By induction, we have $ \sbr{a_1; a_2, \dots, a_n} < 1 / \br{\alpha - a_0} $, since $ \alpha = a_0 + 1 / \br{a_1 + 1 / \dots} $. That is, $ \alpha - a_0 < 1 / \sbr{a_1; a_2, \dots, a_n} $, that is $$ \alpha < a_0 + \dfrac{1}{\sbr{a_1; a_2, \dots, a_n}} = \sbr{a_0; a_1, \dots, a_n} = \dfrac{p_n}{q_n}. $$ -\item[$ n $ even] The same argument with $ > $. +\item[$ n $ even.] The same argument with $ > $. \end{itemize} \end{proof} \begin{corollary} -Assume $ \alpha \in \R \setminus \Q $ and $ a_0, a_1, \dots \in \Z $ be coming from its continued fraction. Let -$$ \dfrac{p_n}{q_n} = \sbr{a_0; a_1, \dots, a_n} $$ -be the $ n $-th convergent. Then +Assume $ \alpha \in \RR \setminus \QQ $ and $ a_0, a_1, \dots \in \ZZ $ be coming from its continued fraction. Let $ p_n / q_n = \sbr{a_0; a_1, \dots, a_n} $ be the $ n $-th convergent. Then $$ \abs{\alpha - \dfrac{p_n}{q_n}} < \dfrac{1}{q_nq_{n + 1}}. $$ In particular, $ p_n / q_n \to \alpha $ as $ n \to \infty $. \end{corollary} @@ -1771,14 +1639,12 @@ \subsection{Infinite continued fractions} $ 1 / q_nq_{n + 1} < 1 / q_n^2 $, so the sequence $ \br{p_n / q_n} $ satisfies the requirements of Dirichlet's theorem. \end{note*} -\pagebreak - \subsection{Best approximations} -Fix $ \alpha \in \R \setminus \Q $. Define $ a_i $ and $ r_i $ by -$$ \alpha = a_0 + r_0, \qquad a_0 = \fbr{\alpha} \in \Z, \qquad 0 < r_0 < 1, $$ +Fix $ \alpha \in \RR \setminus \QQ $. Define $ a_i $ and $ r_i $ by +$$ \alpha = a_0 + r_0, \qquad a_0 = \fbr{\alpha} \in \ZZ, \qquad 0 < r_0 < 1, $$ If $ i \ge 1 $, -$$ \dfrac{1}{r_i} = a_{i + 1} + r_{i + 1}, \qquad a_{i + 1} = \fbr{\dfrac{1}{r_i}} \in \Z_{\ge 1}, \qquad 0 < r_{i + 1} < 1. $$ +$$ \dfrac{1}{r_i} = a_{i + 1} + r_{i + 1}, \qquad a_{i + 1} = \fbr{\dfrac{1}{r_i}} \in \ZZ_{\ge 1}, \qquad 0 < r_{i + 1} < 1. $$ \begin{lemma} \label{lem:72} @@ -1787,10 +1653,7 @@ \subsection{Best approximations} \end{lemma} \begin{proof} -$$ \alpha = \sbr{a_0; a_1, \dots, a_n, \dfrac{1}{r_n}}, $$ -so set -$$ p_{n + 1} = \dfrac{p_n}{r_n} + p_{n - 1}, \qquad q_{n + 1} = \dfrac{q_n}{r_n} + q_{n - 1}. $$ -Then by Lemma \ref{lem:68}, +$ \alpha = \sbr{a_0; a_1, \dots, a_n, 1 / r_n} $, so set $ p_{n + 1} = p_n / r_n + p_{n - 1} $ and $ q_{n + 1} = q_n / r_n + q_{n - 1} $. Then by Lemma \ref{lem:68}, $$ \alpha = \dfrac{p_{n + 1}}{q_{n + 1}} = \dfrac{p_n / r_n + p_{n - 1}}{q_n / r_n + q_{n - 1}} = \dfrac{p_n + p_{n - 1}r_n}{q_n + q_{n - 1}r_n}. $$ \end{proof} @@ -1800,51 +1663,36 @@ \subsection{Best approximations} \end{corollary} \begin{proof} -By Lemma \ref{lem:72}, -$$ \alpha\br{q_n + q_{n - 1}r_n} = p_n + p_{n - 1}r_n, $$ -so -$$ \alpha q_n - p_n = r_n\br{p_{n - 1} - \alpha q_{n - 1}}. $$ -So -$$ \abs{\alpha q_n - p_n} = r_n\abs{\alpha q_{n - 1} - p_{n - 1}} < \abs{\alpha q_{n - 1} - p_{n - 1}}, $$ -so +By Lemma \ref{lem:72}, $ \alpha\br{q_n + q_{n - 1}r_n} = p_n + p_{n - 1}r_n $, so $ \alpha q_n - p_n = r_n\br{p_{n - 1} - \alpha q_{n - 1}} $. So $ \abs{\alpha q_n - p_n} = r_n\abs{\alpha q_{n - 1} - p_{n - 1}} < \abs{\alpha q_{n - 1} - p_{n - 1}} $, so $$ \abs{\alpha - \dfrac{p_n}{q_n}} = \dfrac{1}{q_n}\abs{\alpha q_n - p_n} < \dfrac{1}{q_n}\abs{\alpha q_{n - 1} - p_{n - 1}} < \dfrac{1}{q_{n - 1}}\abs{\alpha q_{n - 1} - p_{n - 1}} = \abs{\alpha - \dfrac{p_{n - 1}}{q_{n - 1}}}. $$ \end{proof} +\pagebreak + \begin{theorem} \label{thm:74} -Let $ h, k \in \Z $ and $ 0 < \abs{k} < q_{n + 1} $. Then +Let $ h, k \in \ZZ $ and $ 0 < \abs{k} < q_{n + 1} $. Then $$ \abs{k\alpha - h} \ge \abs{\alpha q_n - p_n}, $$ with equality only if $ \abs{k} = q_n $. If $ \abs{k} \le q_n $, then $$ \abs{\dfrac{h}{k} - \alpha} \ge \abs{\dfrac{p_n}{q_n} - \alpha}, $$ with equality if and only if $ h / k = p_n / q_n $. \end{theorem} -\pagebreak - \begin{proof} -By Lemma \ref{lem:69} there exist $ u, v \in \Z $ such that -$$ h = up_n + vp_{n + 1}, \qquad k = uq_n + vq_{n + 1}, $$ -since +By Lemma \ref{lem:69} there exist $ u, v \in \ZZ $ such that $ h = up_n + vp_{n + 1} $ and $ k = uq_n + vq_{n + 1} $, since $$ \twobyone{h}{k} = \twobytwo{p_n}{p_{n + 1}}{q_n}{q_{n + 1}}\twobyone{u}{v} \qquad \iff \qquad \twobyone{u}{v} = \twobytwo{p_n}{p_{n + 1}}{q_n}{q_{n + 1}}^{-1}\twobyone{h}{k} = \dfrac{1}{\br{-1}^n}\twobytwo{q_{n + 1}}{-p_{n + 1}}{-q_n}{p_n}\twobyone{h}{k}. $$ By assumption, $ 0 < \abs{k} < q_{n + 1} $. So $ u \ne 0 $, else $ k = vq_{n + 1} $, so $ \abs{v} < 1 $ is a contradiction. If $ v \ne 0 $, then $ u $ and $ v $ have opposite signs, else $$ \abs{k} = \abs{uq_n} + \abs{vq_{n + 1}} \ge q_n + q_{n + 1} > q_{n + 1}. $$ If $ v = 0 $, then $ h = up_n $ and $ k = uq_n $, and everything is easy. If $ v \ne 0 $, then write $$ k\alpha - h = u\br{\alpha q_n - p_n} + v\br{\alpha q_{n + 1} - p_{n + 1}}. $$ -Then $ u $ and $ v $ have opposite signs. By Lemma \ref{lem:70}, -$$ \alpha q_n - p_n, \qquad \alpha q_{n + 1} - p_{n + 1} $$ -also have opposite signs. So -$$ u\br{\alpha q_n - p_n}, \qquad v\br{\alpha q_{n + 1} - p_{n + 1}} $$ -have the same sign. So +Then $ u $ and $ v $ have opposite signs. By Lemma \ref{lem:70}, $ \alpha q_n - p_n $ and $ \alpha q_{n + 1} - p_{n + 1} $ also have opposite signs. So $ u\br{\alpha q_n - p_n} $ and $ v\br{\alpha q_{n + 1} - p_{n + 1}} $ have the same sign. So $$ \abs{k\alpha - h} = \abs{u\br{\alpha q_n - p_n}} + \abs{v\br{\alpha q_{n + 1} - p_{n + 1}}} > \abs{\alpha q_n - p_n}, $$ -if $ u, v \ne 0 $. For the last part, if $ \abs{k} \le q_n $ then $ 1 / \abs{k} \ge 1 / q_n $. So -$$ \dfrac{1}{\abs{k}}\abs{k\alpha - h} \ge \dfrac{1}{q_n}\abs{q_n\alpha - p_n}, $$ -that is -$$ \abs{\alpha - \dfrac{h}{k}} \ge \abs{\alpha - \dfrac{p_n}{q_n}}. $$ +if $ u, v \ne 0 $. For the last part, if $ \abs{k} \le q_n $ then $ 1 / \abs{k} \ge 1 / q_n $. So $ \abs{k\alpha - h} / \abs{k} \ge \abs{q_n\alpha - p_n} / q_n $, that is $ \abs{\alpha - h / k} \ge \abs{\alpha - p_n / q_n} $. \end{proof} \begin{corollary} \label{cor:75} -If $ h, k \in \Z $ with $ \abs{\alpha - h / k} < 1 / 2k^2 $, then +If $ h, k \in \ZZ $ with $ \abs{\alpha - h / k} < 1 / 2k^2 $, then $$ \dfrac{h}{k} = \dfrac{p_n}{q_n}, $$ for some $ n $. \end{corollary} @@ -1856,17 +1704,13 @@ \subsection{Best approximations} & \le \abs{\dfrac{p_n}{q_n} - \alpha} + \abs{\alpha - \dfrac{h}{k}} = \dfrac{1}{q_n}\abs{\alpha q_n - p_n} + \dfrac{1}{k}\abs{\alpha k - h} \\ & \le \br{\dfrac{1}{q_n} + \dfrac{1}{k}}\abs{\alpha k - h} -= k\br{\dfrac{1}{q_n} + \dfrac{1}{k}}\abs{\alpha - \dfrac{h}{k}} \\ -& < \dfrac{1}{2k}\abs{\dfrac{1}{q_n} + \dfrac{1}{k}} += k\br{\dfrac{1}{q_n} + \dfrac{1}{k}}\abs{\alpha - \dfrac{h}{k}} +< \dfrac{1}{2k}\abs{\dfrac{1}{q_n} + \dfrac{1}{k}} \le \dfrac{1}{kq_n}, \end{align*} -by Theorem \ref{thm:74}. So -$$ \abs{\dfrac{p_n}{q_n} - \dfrac{h}{k}} < \dfrac{1}{kq_n}. $$ -So $ p_n / q_n - h / k = 0 $, as required. +by Theorem \ref{thm:74}. So $ \abs{p_n / q_n - h / k} < 1 / kq_n $. So $ p_n / q_n - h / k = 0 $, as required. \end{proof} -\pagebreak - \subsection{Returning to Pell's equation} \lecture{21}{Wednesday}{21/11/18} @@ -1880,30 +1724,19 @@ \subsection{Returning to Pell's equation} \begin{proof} \hfill \begin{itemize} -\item Firstly suppose $ x^2 - dy^2 = 1 $. It is enough to show that $ x / y = p_n / q_n $ for some $ n $. Since $ \br{p_n, q_n} = 1 $, this implies that $ x = rp_n $ and $ y = rq_n $ for some $ r $, and then -$$ 1 = x^2 - dy^2 = r^2\br{p_n^2 - dq_n^2}, $$ -so $ r = 1 $. By Corollary \ref{cor:75}, it suffices to prove that $ \abs{\sqrt{d} - x / y} < 1 / 2y^2 $. Since -$$ x - y\sqrt{d} = \dfrac{1}{x + y\sqrt{d}} > 0, $$ -so $ x > y\sqrt{d} $, and $ x / y > \sqrt{d} $. So +\item Firstly suppose $ x^2 - dy^2 = 1 $. It is enough to show that $ x / y = p_n / q_n $ for some $ n $. Since $ \br{p_n, q_n} = 1 $, this implies that $ x = rp_n $ and $ y = rq_n $ for some $ r $, and then $ 1 = x^2 - dy^2 = r^2\br{p_n^2 - dq_n^2} $, so $ r = 1 $. By Corollary \ref{cor:75}, it suffices to prove that $ \abs{\sqrt{d} - x / y} < 1 / 2y^2 $. Since $ x - y\sqrt{d} = 1 / \br{x + y\sqrt{d}} > 0 $, so $ x > y\sqrt{d} $, and $ x / y > \sqrt{d} $. So $$ \abs{\dfrac{x}{y} - \sqrt{d}} = \dfrac{x}{y} - \sqrt{d} = \dfrac{1}{y}\br{x - y\sqrt{d}} = \dfrac{1}{y}\br{\dfrac{1}{x + y\sqrt{d}}} < \dfrac{1}{y}\br{\dfrac{1}{y\sqrt{d} + y\sqrt{d}}} = \dfrac{1}{2\sqrt{d}y^2} < \dfrac{1}{2y^2}. $$ -\item Now assume $ x^2 - dy^2 = -1 $. Again enough to show that $ x / y = p_n / q_n $. Trick is to rewrite as -$$ y^2 - \dfrac{x^2}{d} = \dfrac{1}{d}. $$ -Then -$$ y - \dfrac{x}{\sqrt{d}} = \dfrac{\tfrac{1}{d}}{y + \tfrac{x}{\sqrt{d}}} > 0. $$ -So $ y > x / \sqrt{d} $, so + +\pagebreak + +\item Now assume $ x^2 - dy^2 = -1 $. Again enough to show that $ x / y = p_n / q_n $. Trick is to rewrite as $ y^2 - x^2 / d = 1 / d $. Then $ y - x / \sqrt{d} = \br{1 / d} / \br{y + x / \sqrt{d}} > 0 $. So $ y > x / \sqrt{d} $, so $$ \abs{\dfrac{y}{x} - \dfrac{1}{\sqrt{d}}} = \dfrac{y}{x} - \dfrac{1}{\sqrt{d}} = \dfrac{1}{x}\br{y - \dfrac{x}{\sqrt{d}}} = \dfrac{1}{x}\br{\dfrac{1 / d}{y + x / \sqrt{d}}} < \dfrac{1}{x}\br{\dfrac{1 / d}{x / \sqrt{d} + x / \sqrt{d}}} = \dfrac{1 / \sqrt{d}}{2x^2} < \dfrac{1}{2x^2}. $$ -So Corollary \ref{cor:75} implies that $ y / x $ is a convergent for the continued fraction of $ 1 / \sqrt{d} $. Then $ \fbr{1 / \sqrt{d}} = 0 $, so the continued fraction for $ 1 / \sqrt{d} $ is of the form $ \sbr{0; a_0, a_1, \dots} $. The next step is $ 1 / \br{1 / \sqrt{d}} = \sqrt{d} $. So if -$$ \sqrt{d} = \sbr{a_0; a_1, a_2, \dots}, $$ -then -$$ 1 / \sqrt{d} = \sbr{0; a_0, a_1, \dots}, $$ -since +So Corollary \ref{cor:75} implies that $ y / x $ is a convergent for the continued fraction of $ 1 / \sqrt{d} $. Then $ \fbr{1 / \sqrt{d}} = 0 $, so the continued fraction for $ 1 / \sqrt{d} $ is of the form $ \sbr{0; a_0, a_1, \dots} $. The next step is $ 1 / \br{1 / \sqrt{d}} = \sqrt{d} $. So if $ \sqrt{d} = \sbr{a_0; a_1, a_2, \dots} $, then $ 1 / \sqrt{d} = \sbr{0; a_0, a_1, \dots} $, since $$ \sqrt{d} = a_0 + \dfrac{1}{a_1 + \dfrac{1}{a_2 + \dfrac{1}{\dots}}}, \qquad \dfrac{1}{\sqrt{d}} = 0 + \dfrac{1}{a_0 + \dfrac{1}{a_1 + \dfrac{1}{\dots}}}. $$ So the convergents for $ 1 / \sqrt{d} $ are the $ q_n / p_n $. So $ y / x = q_n / p_n $ for some $ n $, and $ x / y = p_n / q_n $. \end{itemize} \end{proof} -\pagebreak - \begin{example*} \hfill \begin{itemize} @@ -1920,7 +1753,7 @@ \subsection{Returning to Pell's equation} We say that $ \sbr{a_0; a_1, a_2, \dots} $ is \textbf{eventually periodic} if there exist $ N, d > 0 $ such that $ a_{n + d} = a_n $ for all $ n \ge N $. We say that it is \textbf{periodic} if we can take $ N = 0 $. \end{definition} -\begin{remark} +\begin{fact} The following are facts. \begin{itemize} \item The continued fraction of $ \sqrt{d} $ is eventually periodic. @@ -1930,14 +1763,18 @@ \subsection{Returning to Pell's equation} \item The $ n $ for which $ p_n^2 - dq_n^2 = \pm 1 $ are exactly the $ n $ for which $ n \equiv -1 \mod m $. If $ n = lm - 1 $, then $$ p_n^2 - dq_n^2 = \br{-1}^{lm}. $$ \item The fundamental $ 1 $-unit is -$$ p_{m - 1} + q_{m - 1}\sqrt{d} $$ -if $ m $ is even and -$$ p_{2m - 1} + q_{2m - 1}\sqrt{d} $$ -if $ m $ is odd. +$$ +\begin{cases} +p_{m - 1} + q_{m - 1}\sqrt{d} & m \ \text{even} \\ +p_{2m - 1} + q_{2m - 1}\sqrt{d} & m \ \text{odd} +\end{cases}. +$$ \item There is a solution to $ x^2 - dy^2 = -1 $ if and only if $ m $ is odd, in which case the solutions are $$ \br{x, y} = \br{p_n, q_n}, \qquad n \equiv m - 1 \mod 2m. $$ \end{itemize} -\end{remark} +\end{fact} + +\pagebreak \begin{example*} \hfill @@ -1963,22 +1800,18 @@ \subsection{Returning to Pell's equation} q & 1 & 1 & 2 & 3 & 5 \end{array}, $$ -so $ 18^2 - 13\br{5}^2 = -1 $ is the smallest solution, and $ N\br{18 + 5\sqrt{13}} = -1 $, so -$$ N\br{\br{18 + 5\sqrt{13}}^2} = N\br{649 + 180\sqrt{13}} = 1. $$ +so $ 18^2 - 13\br{5}^2 = -1 $ is the smallest solution, and $ \N\br{18 + 5\sqrt{13}} = -1 $, so +$$ \N\br{\br{18 + 5\sqrt{13}}^2} = \N\br{649 + 180\sqrt{13}} = 1. $$ In fact, it follows from our facts that this is the fundamental $ 1 $-unit, that is $ p_9 + q_9\sqrt{13} $. \end{itemize} \end{example*} -\pagebreak - \subsection{Periodic continued fractions} \lecture{22}{Friday}{23/11/18} \begin{definition} -$ \alpha \in \R \setminus \Q $ is a \textbf{quadratic irrational} if it is a root of some -$$ aX^2 + bX + c = 0, $$ -for $ a, b, c \in \Q $ not all zero. +$ \alpha \in \RR \setminus \QQ $ is a \textbf{quadratic irrational} if it is a root of some $ aX^2 + bX + c = 0 $, for $ a, b, c \in \QQ $ not all zero. \end{definition} \begin{proposition} @@ -1990,21 +1823,10 @@ \subsection{Periodic continued fractions} \begin{itemize} \item Suppose firstly that the continued fraction of $ \alpha $ is periodic. Suppose $ a_{n + d} = a_n $ for all $ n $, for some $ d \ge 1 $. Then $$ \alpha = a_0 + \dfrac{1}{a_1 + \dfrac{1}{\dots + \dfrac{1}{a_{d - 1} + \dfrac{1}{\alpha}}}}. $$ -This gives an equation of the form -$$ \alpha = \dfrac{x\alpha + y}{z\alpha + w}, \qquad w, x, y, z \in \Z, $$ -by applying Lemma \ref{lem:72} to $ \sbr{a_0; a_1, \dots, a_{d - 1}, \alpha} $. Then -$$ \br{z\alpha + w}\alpha - \br{x\alpha + y} = 0, $$ -that is -$$ z\alpha^2 + \br{w - x}\alpha - y = 0. $$ -Since $ \alpha \in \R \setminus \Q $, we conclude that $ \alpha $ is a quadratic irrational. +This gives an equation of the form $ \alpha = \br{x\alpha + y} / \br{z\alpha + w} $ for $ w, x, y, z \in \ZZ $, by applying Lemma \ref{lem:72} to $ \sbr{a_0; a_1, \dots, a_{d - 1}, \alpha} $. Then $ \br{z\alpha + w}\alpha - \br{x\alpha + y} = 0 $, that is $ z\alpha^2 + \br{w - x}\alpha - y = 0 $. Since $ \alpha \in \RR \setminus \QQ $, we conclude that $ \alpha $ is a quadratic irrational. \item Suppose now that $ \alpha $ is only eventually periodic. Then $$ \alpha = a_0 + \dfrac{1}{a_1 + \dfrac{1}{\dots + \dfrac{1}{a_N + \dfrac{1}{\beta}}}}, $$ -where $ \beta $ has a periodic continued fraction. So $ \beta $ is a quadratic irrational. To complete the proof, we need to show that if $ \gamma $ is a quadratic irrational, then $ 1 / \gamma $ and $ \gamma + n $ are quadratic irrationals for any $ n \in \Z $. If $ \gamma $ is a root of -$$ aX^2 + bX + c = 0, $$ -then $ 1 / \gamma $ is a root of -$$ cX^2 + bX + a = 0, $$ -and $ \gamma + n $ is a root of -$$ a\br{X - n}^2 + b\br{X - n} + c = 0. $$ +where $ \beta $ has a periodic continued fraction. So $ \beta $ is a quadratic irrational. To complete the proof, we need to show that if $ \gamma $ is a quadratic irrational, then $ 1 / \gamma $ and $ \gamma + n $ are quadratic irrationals for any $ n \in \ZZ $. If $ \gamma $ is a root of $ aX^2 + bX + c = 0 $, then $ 1 / \gamma $ is a root of $ cX^2 + bX + a = 0 $, and $ \gamma + n $ is a root of $ a\br{X - n}^2 + b\br{X - n} + c = 0 $. \end{itemize} \end{proof} @@ -2017,75 +1839,55 @@ \section{Diophantine approximation} \subsection{Liouville's theorem} \begin{definition} -Let $ d \in \Z_{\ge 1} $. Then $ \alpha \in \C $ is \textbf{algebraic of degree $ d $} if there exists a polynomial of degree $ d $ with integer coefficients and $ \alpha $ as a root, and there does not exist such a polynomial of smaller degree. +Let $ d \in \ZZ_{\ge 1} $. Then $ \alpha \in \CC $ is \textbf{algebraic of degree $ d $} if there exists a polynomial of degree $ d $ with integer coefficients and $ \alpha $ as a root, and there does not exist such a polynomial of smaller degree. \end{definition} \begin{example*} -$ d = 1 $ is $ \Q $ and $ d = 2 $ is the quadratic irrationals. +$ d = 1 $ is $ \QQ $ and $ d = 2 $ is the quadratic irrationals. \end{example*} \begin{theorem}[Liouville's theorem] -Let $ \alpha \in \R $ be algebraic of degree $ d $. Then for any $ e \in \R_{> d} $, there are only finitely many $ p / q \in \Q $ with +Let $ \alpha \in \RR $ be algebraic of degree $ d $. Then for any $ e \in \RR_{> d} $, there are only finitely many $ p / q \in \QQ $ with $$ \abs{\dfrac{p}{q} - \alpha} < \dfrac{1}{q^e}. $$ \end{theorem} \begin{proof} -Let $ P\br{X} $ be a polynomial of degree $ d $ with coefficients in $ \Z $, with $ P\br{\alpha} = 0 $. Choose $ \epsilon > 0 $ such that the only root of $ P\br{X} $ in $ \sbr{\alpha - \epsilon, \alpha + \epsilon} $ is $ \alpha $. Write -$$ P\br{X} = \br{X - \alpha}Q\br{X}. $$ -Then $ Q\br{X} $ is a polynomial of degree $ d - 1 $ with real coefficients, so in particular it is continuous, so there exists $ K $ such that -$$ \abs{Q\br{x}} \le K, \qquad x \in \sbr{\alpha - \epsilon, \alpha + \epsilon}. $$ -Assume that -$$ \abs{\dfrac{p}{q} - \alpha} < \dfrac{1}{q^e}. $$ -We may assume that $ q $ is large enough that $ 1 / q^e < \epsilon $. Since $ P $ has integer coefficients and is of degree $ d $, we have -$$ \abs{P\br{\dfrac{p}{q}}} \ge \dfrac{1}{q^d}. $$ -Note that $ P\br{p / q} \ne 0 $, or we could replace $ P $ by $ P' $ with $ P\br{X} = \br{qX - p}P'\br{X} $. Since $ \abs{p / q - \alpha} < \epsilon $, $ p / q \in \sbr{\alpha - \epsilon, \alpha + \epsilon} $, so +Let $ P\br{X} $ be a polynomial of degree $ d $ with coefficients in $ \ZZ $, with $ P\br{\alpha} = 0 $. Choose $ \epsilon > 0 $ such that the only root of $ P\br{X} $ in $ \sbr{\alpha - \epsilon, \alpha + \epsilon} $ is $ \alpha $. Write $ P\br{X} = \br{X - \alpha}Q\br{X} $. Then $ Q\br{X} $ is a polynomial of degree $ d - 1 $ with real coefficients, so in particular it is continuous, so there exists $ K $ such that $ \abs{Q\br{x}} \le K $ for $ x \in \sbr{\alpha - \epsilon, \alpha + \epsilon} $. Assume that $ \abs{p / q - \alpha} < 1 / q^e $. We may assume that $ q $ is large enough that $ 1 / q^e < \epsilon $. Since $ P $ has integer coefficients and is of degree $ d $, we have $ \abs{P\br{p / q}} \ge 1 / q^d $. Note that $ P\br{p / q} \ne 0 $, or we could replace $ P $ by $ P' $ with $ P\br{X} = \br{qX - p}P'\br{X} $. Since $ \abs{p / q - \alpha} < \epsilon $, $ p / q \in \sbr{\alpha - \epsilon, \alpha + \epsilon} $, so $$ \dfrac{1}{q^d} \le \abs{P\br{\dfrac{p}{q}}} = \abs{\dfrac{p}{q} - \alpha} \abs{Q\br{\dfrac{p}{q}}} \le K \abs{\dfrac{p}{q} - \alpha} < \dfrac{K}{q^e}. $$ So $ K > q^{e - d} $, so $ K^{1 / \br{e - d}} > q $. So there are only finitely many possible $ q $, so only finitely many $ p / q $. \end{proof} \subsection{Constructing transcendentals} -Recall that $ \alpha \in \C $ is \textbf{algebraic} if it is algebraic of some degree $ d $, and otherwise it is \textbf{transcendental}. The set of polynomials with integer coefficients is countable, so the set of algebraic numbers is countable. Since $ \R $ is uncountable, transcendental numbers exist. Liouville's theorem gives a criterion. If for every $ e > 0 $, there are infinitely many $ p / q $ with $ \abs{\alpha - p / q} < 1 / q^e $, then $ \alpha $ cannot be algebraic. +Recall that $ \alpha \in \CC $ is \textbf{algebraic} if it is algebraic of some degree $ d $, and otherwise it is \textbf{transcendental}. The set of polynomials with integer coefficients is countable, so the set of algebraic numbers is countable. Since $ \RR $ is uncountable, transcendental numbers exist. Liouville's theorem gives a criterion. If for every $ e > 0 $, there are infinitely many $ p / q $ with $ \abs{\alpha - p / q} < 1 / q^e $, then $ \alpha $ cannot be algebraic. \begin{example*} -Let -$$ \alpha = \sum_{n \ge 1} \dfrac{1}{10^{n!}}, \qquad \alpha_k = \sum_{n = 1}^k \dfrac{1}{10^{n!}}. $$ -Then $ \alpha_k $ is rational, with denominator $ q = 10^{k!} $, and +Let $ \alpha = \sum_{n \ge 1} 10^{-n!} $ and $ \alpha_k = \sum_{n = 1}^k 10^{-n!} $. Then $ \alpha_k $ is rational with denominator $ q = 10^{k!} $, and $$ \abs{\alpha - \alpha_k} = \sum_{n = k + 1}^\infty \dfrac{1}{10^{n!}} = \dfrac{1}{10^{\br{k + 1}!}}\br{1 + \dfrac{1}{10^{\br{k + 2}! - \br{k + 1}!}} + \dots} = \dfrac{1}{q^{k + 1}}\br{1 + \dfrac{1}{10^{k + 1}} + \dots} < \dfrac{2}{q^{k + 1}}. $$ -If $ d \in \Z_{> 0} $, and $ k > d $, then $ 2 / q^{k + 1} < 1 / q^d $. So there exist infinitely many $ p / q = \alpha_k $ such that $ \abs{\alpha - p / q} < 1 / q^d $. Take $ d $ arbitrarily large, so $ \alpha $ is transcendental. +If $ d \in \ZZ_{> 0} $, and $ k > d $, then $ 2 / q^{k + 1} < 1 / q^d $. So there exist infinitely many $ p / q = \alpha_k $ such that $ \abs{\alpha - p / q} < 1 / q^d $. Take $ d $ arbitrarily large, so $ \alpha $ is transcendental. \end{example*} -\pagebreak - \subsection{Roth's theorem} \lecture{23}{Tuesday}{27/11/18} \begin{theorem}[Roth's theorem] -Suppose that $ \alpha $ is algebraic. Then for any $ \epsilon > 0 $, there exist only finitely many $ x / y \in \Q $ with -$$ \abs{\alpha - \dfrac{x}{y}} < \dfrac{1}{y^{2 + \epsilon}}. $$ +Suppose that $ \alpha $ is algebraic. Then for any $ \epsilon > 0 $, there exist only finitely many $ x / y \in \QQ $ with $ \abs{\alpha - x / y} < 1 / y^{2 + \epsilon} $. \end{theorem} This can be used to show that many more numbers are transcendental than Liouville's theorem could. \begin{example*} -$$ \sum_{n \ge 1} \dfrac{1}{10^{3^n}} $$ -is transcendental. +$ \sum_{n \ge 1} 10^{-3^n} $ is transcendental. \end{example*} \begin{example*} -We saw that if $ d > 1 $ is squarefree, then $ x^2 - dy^2 = 1 $ has infinitely many solutions with $ x, y \in \Z $. Suppose now that $ d > 1 $, and consider $ x^3 - dy^3 = 1 $. +We saw that if $ d > 1 $ is squarefree, then $ x^2 - dy^2 = 1 $ has infinitely many solutions with $ x, y \in \ZZ $. Suppose now that $ d > 1 $, and consider $ x^3 - dy^3 = 1 $. \begin{itemize} -\item $ d = e^3 $ is a cube. Then -$$ x^3 - dy^3 = x^3 - \br{ey}^3 = 1, $$ -so either $ \br{x, y} = \br{1, 0} $ or $ \br{x, y} = \br{0, 1} $ and $ d = 1 $. -\item $ d $ is not a cube. Then $ \sqrt[3]{d} \in \R \setminus \Q $ is algebraic, as it is a root of $ X^3 - d = 0 $. Suppose $ x > 1 $, so $ x > \sqrt[3]{d}y $. Then -$$ x - \sqrt[3]{d}y = \dfrac{x^3 - dy^3}{x^2 + x\sqrt[3]{d}y + \sqrt[3]{d^2}y^2} = \dfrac{1}{x^2 + x\sqrt[3]{d}y + \sqrt[3]{d^2}y^2} < \dfrac{1}{3\br{\sqrt[3]{d}y}^2} = \dfrac{1}{3\sqrt[3]{d^2}y^2}. $$ -So -$$ \abs{\dfrac{x}{y} - \sqrt[3]{d}} < \dfrac{1}{3\sqrt[3]{d^2}y^3}. $$ -Choose any $ 0 < \epsilon < 1 $. Then -$$ \dfrac{1}{3\sqrt[3]{d^2}y^3} < \dfrac{1}{y^{2 + \epsilon}}, $$ -for all $ y $ sufficiently large. So Roth's theorem tells us that there are only finitely many solutions. Similarly if $ x < 0 $. +\item $ d = e^3 $ is a cube. Then $ x^3 - dy^3 = x^3 - \br{ey}^3 = 1 $, so either $ \br{x, y} = \br{1, 0} $ or $ \br{x, y} = \br{0, 1} $ and $ d = 1 $. +\item $ d $ is not a cube. Then $ \sqrt[3]{d} \in \RR \setminus \QQ $ is algebraic, as $ X^3 - d = 0 $. Suppose $ x > 1 $, so $ x > \sqrt[3]{d}y $. Then +$$ x - \sqrt[3]{d}y = \dfrac{x^3 - dy^3}{x^2 + x\sqrt[3]{d}y + \sqrt[3]{d^2}y^2} = \dfrac{1}{x^2 + x\sqrt[3]{d}y + \sqrt[3]{d^2}y^2} < \dfrac{1}{3\sqrt[3]{d^2}y^2} = \dfrac{1}{3\sqrt[3]{d^2}y^2}. $$ +So $ \abs{x / y - \sqrt[3]{d}} < 1 / 3\sqrt[3]{d^2}y^3 $. Choose any $ 0 < \epsilon < 1 $. Then $ 1 / 3\sqrt[3]{d^2}y^3 < 1 / y^{2 + \epsilon} $, for all $ y $ sufficiently large. So Roth's theorem tells us that there are only finitely many solutions. Similarly if $ x < 0 $. \end{itemize} \end{example*} @@ -2141,7 +1943,7 @@ \subsection{Elementary results} \end{lemma} \begin{proof} -Certainly $ p $ is odd. Then $ x^2 + 1 \equiv 0 \mod p $, so $ x^2 \equiv -1 \mod p $, so $ \jacobi{-1}{p} = 1 $, so $ p \equiv 1 \mod 4 $. +Certainly $ p $ is odd. Then $ x^2 + 1 \equiv 0 \mod p $, so $ x^2 \equiv -1 \mod p $, so $ \symbol{-1}{p} = 1 $, so $ p \equiv 1 \mod 4 $. \end{proof} \begin{theorem} @@ -2169,7 +1971,7 @@ \subsection{Elementary results} \begin{theorem} \label{thm:91} -Let $ p \ne q $ be prime, and let $ a \in \Z $. Then $ p \mid \Phi_q\br{a} $ if and only if $ a $ has order $ q \mod p $. +Let $ p \ne q $ be prime, and let $ a \in \ZZ $. Then $ p \mid \Phi_q\br{a} $ if and only if $ a $ has order $ q \mod p $. \end{theorem} \begin{proof} @@ -2180,7 +1982,7 @@ \subsection{Elementary results} \begin{corollary} \label{cor:92} -If $ p \ne q $ is prime, and $ a \in \Z $, and $ p \mid \Phi_q\br{a} $, then $ p \equiv 1 \mod q $. +If $ p \ne q $ is prime, and $ a \in \ZZ $, and $ p \mid \Phi_q\br{a} $, then $ p \equiv 1 \mod q $. \end{corollary} \begin{proof} @@ -2194,15 +1996,13 @@ \subsection{Elementary results} \begin{proof} Let $ S $ be a finite set of primes which are congruent to $ 1 \mod q $. Let $$ R = \prod_{p \in S} p. $$ -Consider $ \Phi_q\br{qR} \ge qR + 1 > 1 $. Let $ p $ be a prime factor of $ \Phi_q\br{qR} $. By Corollary \ref{cor:92}, either $ p = q $, or $ p \equiv 1 \mod q $. Since -$$ \Phi_q\br{qR} = \br{qR}^{q - 1} + \dots + 1 \equiv 1 \mod qR, $$ -so $ p \ne q $, $ p \notin S $, and $ p \equiv 1 \mod q $. +Consider $ \Phi_q\br{qR} \ge qR + 1 > 1 $. Let $ p $ be a prime factor of $ \Phi_q\br{qR} $. By Corollary \ref{cor:92}, either $ p = q $, or $ p \equiv 1 \mod q $. Since $ \Phi_q\br{qR} = \br{qR}^{q - 1} + \dots + 1 \equiv 1 \mod qR $, so $ p \ne q $, $ p \notin S $, and $ p \equiv 1 \mod q $. \end{proof} \subsection{Cyclotomic polynomials} \begin{definition} -Let $ n \in \Z_{\ge 1} $. Then +Let $ n \in \ZZ_{\ge 1} $. Then $$ \Phi_n\br{X} = \prod_{1 \le a \le n, \ \br{a, n} = 1} \br{X - e^{\tfrac{2\pi ai}{n}}}. $$ \end{definition} @@ -2219,19 +2019,17 @@ \subsection{Cyclotomic polynomials} From this it is easy to deduce the following. \begin{lemma} -For any $ n \ge 1 $, $ \Phi_n\br{X} \in \Z\sbr{X} $. +For any $ n \ge 1 $, $ \Phi_n\br{X} \in \ZZ\sbr{X} $. \end{lemma} \begin{proof} -By induction on $ n $. If $ n = 1 $, $ \Phi_1\br{X} = X - 1 $. Assume that the result holds for all $ d \mid n $, for $ d < n $. By Lemma \ref{lem:95}, if we set +By induction on $ n $. If $ n = 1 $, $ \Phi_1\br{X} = X - 1 $. Assume that the result holds for all $ d \mid n $ for $ d < n $. By Lemma \ref{lem:95}, if we set $$ P\br{X} = \prod_{d \mid n, \ 0 < d < n} \Phi_d\br{X}, $$ -then $ P\br{X} \in \Z\sbr{X} $, $ P\br{X} $ is monic, and $ X^n - 1 = \Phi_n\br{X}P\br{X} $. Write +then $ P\br{X} \in \ZZ\sbr{X} $, $ P\br{X} $ is monic, and $ X^n - 1 = \Phi_n\br{X}P\br{X} $. Write $$ \Phi_n\br{X} = \sum_i a_iX^i, \qquad P\br{X} = \sum_i b_iX^i, $$ -and assume that not all $ a_i \in \Z $. Let $ q $ be maximal with $ a_q \notin \Z $. Let $ e = \deg\br{P} $, so -$$ P\br{X} = X^e + b_{e - 1}X^{e - 1} + \dots + b_0. $$ -Then the coefficient of $ X^{q + e} $ in $ \Phi_n\br{X}P\br{X} $ is -$$ a_q + a_{q + 1}b_{e - 1} + \dots + a_{q + e}b_0, \qquad a_{q + 1}b_{e - 1} + \dots + a_{q + e}b_0 \in \Z. $$ -Since $ \Phi_n\br{X}P\br{X} = X^n - 1 \in \Z\sbr{X} $, this is a contradiction. +and assume that not all $ a_i \in \ZZ $. Let $ q $ be maximal with $ a_q \notin \ZZ $. Let $ e = \deg P $, so $ P\br{X} = X^e + b_{e - 1}X^{e - 1} + \dots + b_0 $. Then the coefficient of $ X^{q + e} $ in $ \Phi_n\br{X}P\br{X} $ is +$$ a_q + a_{q + 1}b_{e - 1} + \dots + a_{q + e}b_0, \qquad a_{q + 1}b_{e - 1} + \dots + a_{q + e}b_0 \in \ZZ. $$ +Since $ \Phi_n\br{X}P\br{X} = X^n - 1 \in \ZZ\sbr{X} $, this is a contradiction. \end{proof} \pagebreak @@ -2271,23 +2069,23 @@ \subsection{Cyclotomic polynomials} \begin{theorem} \label{thm:100} -Suppose $ p \nmid n $ and $ a \in \Z $. Then $ p \mid \Phi_n\br{a} $ if and only if $ a $ has order exactly $ n \mod p $. +Suppose $ p \nmid n $ and $ a \in \ZZ $. Then $ p \mid \Phi_n\br{a} $ if and only if $ a $ has order exactly $ n \mod p $. \end{theorem} \begin{proof} -Firstly suppose that $ a $ has order exactly $ n $. Then $ a $ is a root of $ X^n - 1 \mod p $, but not a root of $ X^d - 1 $ for any $ d \mid n $, for $ d < n $. Since $ \Phi_d\br{X} \mid X^d - 1 $, $ a $ cannot be a root of $ \Phi_d\br{X} $ for any $ d \mid n $, for $ d < n $. Let +Firstly suppose that $ a $ has order exactly $ n $. Then $ a $ is a root of $ X^n - 1 \mod p $, but not a root of $ X^d - 1 $ for any $ d \mid n $ for $ d < n $. Since $ \Phi_d\br{X} \mid X^d - 1 $, $ a $ cannot be a root of $ \Phi_d\br{X} $ for any $ d \mid n $ for $ d < n $. Let \begin{equation} \label{eq:4} X^n - 1 = \Phi_n\br{X}\prod_{d \mid n, \ 0 < d < n} \Phi_d\br{X}, \end{equation} -so $ a $ is a root of $ \Phi_n\br{X} \mod p $, that is $ p \mid \Phi_n\br{a} $. Conversely, suppose that $ p \mid \Phi_n\br{a} $. Then $ a $ is a root of $ \Phi_n\br{X} \mod p $, so by $ \br{\ref{eq:4}} $, $ a $ is a root of $ X^n - 1 \mod p $. We need to show that $ a $ is not a root of $ X^d - 1 $ for any $ d \mid n $, for $ d < n $. Writing +so $ a $ is a root of $ \Phi_n\br{X} \mod p $, that is $ p \mid \Phi_n\br{a} $. Conversely, suppose that $ p \mid \Phi_n\br{a} $. Then $ a $ is a root of $ \Phi_n\br{X} \mod p $, so by $ \br{\ref{eq:4}} $, $ a $ is a root of $ X^n - 1 \mod p $. We need to show that $ a $ is not a root of $ X^d - 1 $ for any $ d \mid n $ for $ d < n $. Writing $$ X^d - 1 = \prod_{e \mid d} \Phi_e\br{X}, $$ $ a $ would be a root of $ \Phi_e\br{X} $ for some $ e \mid d \mid n $. So by $ \br{\ref{eq:4}} $, $ a $ is a root of both $ \Phi_n\br{X} $ and $ \Phi_e\br{X} $, so $ a $ is a repeated root of $ X^n - 1 \mod p $. This contradicts Corollary \ref{cor:99}. \end{proof} \begin{corollary} \label{cor:101} -If $ p \nmid n $, and $ a \in \Z $, then if $ p \mid \Phi_n\br{a} $, then $ p \equiv 1 \mod n $. +If $ p \nmid n $, and $ a \in \ZZ $, then if $ p \mid \Phi_n\br{a} $, then $ p \equiv 1 \mod n $. \end{corollary} \begin{proof} @@ -2299,20 +2097,18 @@ \subsection{Primes congruent to \texorpdfstring{$ 1 \mod n $}{1 mod n}} We are now in a position to prove the following. \begin{theorem} -If $ n \in \Z_{\ge 1} $, there are infinitely many primes $ p $ with $ p \equiv 1 \mod n $. +If $ n \in \ZZ_{\ge 1} $, there are infinitely many primes $ p $ with $ p \equiv 1 \mod n $. \end{theorem} \begin{proof} Let $ S $ be a finite set of primes congruent to $ 1 \mod n $, and let $$ R = \prod_{p \in S} p. $$ -For each $ k $, let -$$ Q_k = \Phi_n\br{knR} \in \Z. $$ -Note that not all $ Q_k $ are $ \pm 1 $, since $ \Phi_n\br{X} $ is a non-constant polynomial. Thus choose $ k $ large enough that $ Q_k > 1 $, so there is a prime $ p $ dividing $ Q_k $. Since $ Q_k $ divides $ \br{knR}^n - 1 $, no prime dividing $ n $ or $ R $ can divide $ Q_k $. Thus $ p $ is not in $ S $, and by Corollary \ref{cor:101} $ p $ is congruent to $ 1 \mod n $. +For each $ k $, let $ Q_k = \Phi_n\br{knR} \in \ZZ $. Note that not all $ Q_k $ are $ \pm 1 $, since $ \Phi_n\br{X} $ is a non-constant polynomial. Thus choose $ k $ large enough that $ Q_k > 1 $, so there is a prime $ p $ dividing $ Q_k $. Since $ Q_k $ divides $ \br{knR}^n - 1 $, no prime dividing $ n $ or $ R $ can divide $ Q_k $. Thus $ p $ is not in $ S $, and by Corollary \ref{cor:101} $ p $ is congruent to $ 1 \mod n $. \end{proof} \lecture{25}{Friday}{30/11/18} -Lecture 25 is a problem class. +Lecture 25 is a problems class. \pagebreak @@ -2320,7 +2116,7 @@ \section{Arithmetic functions} \lecture{26}{Tuesday}{04/12/18} -An \textbf{arithmetic function} is a function $ f : \Z_{\ge 1} \to \C $, such as $ \Phi $. +An \textbf{arithmetic function} is a function $ f : \ZZ_{\ge 1} \to \CC $, such as $ \Phi $. \subsection{Dirichlet convolution} @@ -2345,7 +2141,7 @@ \subsection{Dirichlet convolution} \subsection{M\"obius inversion} -The \textbf{M\"obius function} $ \mu : \Z_{\ge 1} \to \C $ is defined as follows. +The \textbf{M\"obius function} $ \mu : \ZZ_{\ge 1} \to \CC $ is defined as follows. $$ \mu\br{n} = \begin{cases} 1 & n = 1 \\ @@ -2363,7 +2159,7 @@ \subsection{M\"obius inversion} $ \epsilon\br{1} = \br{1 * \mu}\br{1} = 1 \times 1 $. If $ n > 1 $, we just have to check that $$ \sum_{d \mid n} \mu\br{d} = \sum_{ab = n} 1\br{a}\mu\br{b} = 0. $$ Let $ p_1, \dots, p_k $ be the distinct primes dividing $ n $. Then -$$ \sum_{d \mid n} \mu\br{d} = \sum_{\br{\epsilon_1, \dots, \epsilon_k}, \ \epsilon_i \in \cbr{0, 1}} \br{-1}^{\epsilon_1 + \dots + \epsilon_k} = \br{\sum_{\epsilon_1 = 0}^1 \br{-1}^{\epsilon_1}} \dots \br{\sum_{\epsilon_k = 0}^1 \br{-1}^{\epsilon_k}} = 0, \qquad n = \prod_{i = 1}^k p_i^{\epsilon_i}. $$ +$$ \sum_{d \mid n} \mu\br{d} = \sum_{\br{\epsilon_1, \dots, \epsilon_k}, \ \epsilon_i = 0, 1} \br{-1}^{\epsilon_1 + \dots + \epsilon_k} = \br{\sum_{\epsilon_1 = 0}^1 \br{-1}^{\epsilon_1}} \dots \br{\sum_{\epsilon_k = 0}^1 \br{-1}^{\epsilon_k}} = 0, \qquad n = \prod_{i = 1}^k p_i^{\epsilon_i}. $$ \end{proof} \begin{proposition}[M\"obius inversion] @@ -2375,7 +2171,7 @@ \subsection{M\"obius inversion} \end{proof} \begin{example*} -Let $ Id\br{n} = n $. Then $ Id = \Phi * 1 $. That is, $ n = \sum_{d \mid n} \Phi\br{d} $. So $ \Phi = Id * \mu $. So +Let $ \id\br{n} = n $. Then $ \id = \Phi * 1 $. That is, $ n = \sum_{d \mid n} \Phi\br{d} $. So $ \Phi = \id * \mu $. So $$ \Phi\br{n} = \sum_{d \mid n} \mu\br{d}\dfrac{n}{d} = n\sum_{d \mid n} \dfrac{\mu\br{d}}{d}. $$ \end{example*} @@ -2387,29 +2183,39 @@ \section{The distribution of prime numbers} \subsection{Reminder of asymptotic notation} -\begin{itemize} -\item $ A \l B $ means there exists a constant $ C > 0 $ such that $ \abs{A} \le CB $. For example if $ x \ge 1 $, $ x \l x^2 \l e^x / x^{100} $. -\item $ B \g A $ means $ A \l B $. -\item $ A = O\br{B} $ means $ A \l B $. -\item $ A \l_k B $ means $ A \l B $ with the constant $ C $ depending on $ k $. For example, $ kx \l_k x $. -\item $ A = o\br{B} $ means for all $ \epsilon > 0 $ we have $ \abs{A} \le \epsilon B $ as some other specified parameter becomes large enough. For example, $ 1 / \log\br{x} = o\br{1} $ as $ x \to \infty $. -\item $ A \sim B $ means $ A = \br{1 + o\br{1}}B $. -\end{itemize} +$ A \ll B $, or $ A = \O\br{B} $, means there exists a constant $ C > 0 $ such that $ \abs{A} \le CB $, and $ B \gg A $ means $ A \ll B $. + +\begin{example*} +If $ x \ge 1 $, $ x \ll x^2 \ll e^x / x^{100} $. +\end{example*} + +$ A \ll_k B $ means $ A \ll B $ with the constant $ C $ depending on $ k $. + +\begin{example*} +$ kx \ll_k x $. +\end{example*} + +$ A = \o\br{B} $ means for all $ \epsilon > 0 $ we have $ \abs{A} \le \epsilon B $ as some other specified parameter becomes large enough. + +\begin{example*} +$ 1 / \log x = \o\br{1} $ as $ x \to \infty $. +\end{example*} + +$ A \sim B $ means $ A = \br{1 + \o\br{1}}B $. \subsection{The prime number theorem} \begin{theorem}[Prime number theorem] -$$ \pi\br{X} \sim \dfrac{X}{\log\br{X}}, $$ -as $ X \to \infty $. +$$ \pi\br{X} \sim \dfrac{X}{\log X}, \qquad X \to \infty. $$ \end{theorem} \begin{theorem} There exist constants $ 0 < c_1 < 1 < c_2 $ such that for all sufficiently large $ X $, -$$ c_1\dfrac{X}{\log\br{X}} \le \pi\br{X} \le c_2\dfrac{X}{\log\br{X}}. $$ +$$ c_1\dfrac{X}{\log X} \le \pi\br{X} \le c_2\dfrac{X}{\log X}. $$ \end{theorem} This implies that -$$ \pi\br{X} = O\br{\dfrac{X}{\log\br{X}}}. $$ +$$ \pi\br{X} = \O\br{\dfrac{X}{\log X}}. $$ \lecture{27}{Wednesday}{05/12/18} @@ -2424,50 +2230,40 @@ \subsection{The prime number theorem} Given $ \br{\ref{eq:5}} $, we have $$ \br{2n}^{\pi\br{2n}} \ge \prod_{p \le 2n} p \ge C_1^n. $$ Taking logarithms, -$$ \pi\br{2n} \ge \br{\dfrac{1}{2}\log\br{C_1}}\dfrac{2n}{\log\br{2n}}. $$ -This gives the lower bound if $ X = 2n \in \Z $ is even, but since $ \pi\br{X + 1} - \pi\br{X} \le 1 $, it is easy to get the lower bound for all $ X $. We will prove $ \br{\ref{eq:5}} $ by considering the prime factors of -$$ \twobyone{2n}{n} = \prod_{p \le 2n} p^{v_p\br{n}}. $$ - -\pagebreak - +$$ \pi\br{2n} \ge \br{\dfrac{1}{2}\log C_1}\dfrac{2n}{\log 2n}. $$ +This gives the lower bound if $ X = 2n \in \ZZ $ is even, but since $ \pi\br{X + 1} - \pi\br{X} \le 1 $, it is easy to get the lower bound for all $ X $. We will prove $ \br{\ref{eq:5}} $ by considering the prime factors of +$$ \binom{2n}{n} = \prod_{p \le 2n} p^{\v_p\br{n}}. $$ Claim that \begin{enumerate} -\item if $ p > \sqrt{2n} $ then $ v_p\br{n} \le 1 $, -\item for all $ p \le 2n $, $ p^{v_p\br{n}} \le 2n $, and -\item $ \prod_{p \le 2n} p^{v_p\br{n}} \ge 4^n / \br{2n + 1} $. +\item if $ p > \sqrt{2n} $ then $ \v_p\br{n} \le 1 $, +\item for all $ p \le 2n $, $ p^{\v_p\br{n}} \le 2n $, and +\item $ \prod_{p \le 2n} p^{\v_p\br{n}} \ge 4^n / \br{2n + 1} $. \end{enumerate} + +\pagebreak + Suppose $ 1 $ to $ 3 $ are true. Then \begin{align*} \dfrac{4^n}{2n + 1} -& \le \prod_{p \le 2n} p^{v_p\br{n}} & \text{by} \ 3 \\ -& = \prod_{p \le \sqrt{2n}} p^{v_p\br{n}} \prod_{\sqrt{2n} < p \le 2n} p^{v_p\br{n}} \\ -& \le \br{2n}^{\pi\br{\sqrt{2n}}} \prod_{\sqrt{2n} < p \le 2n} p^{v_p\br{n}} & \text{by} \ 2 \\ +& \le \prod_{p \le 2n} p^{\v_p\br{n}} += \prod_{p \le \sqrt{2n}} p^{\v_p\br{n}} \prod_{\sqrt{2n} < p \le 2n} p^{\v_p\br{n}} & \text{by} \ 3 \\ +& \le \br{2n}^{\pi\br{\sqrt{2n}}} \prod_{\sqrt{2n} < p \le 2n} p^{\v_p\br{n}} & \text{by} \ 2 \\ & \le \br{2n}^{\pi\br{\sqrt{2n}}} \prod_{\sqrt{2n} < p \le 2n} p & \text{by} \ 1 \\ -& \le \br{2n}^{\pi\br{\sqrt{2n}}} \prod_{p \le 2n} p \\ -& \le \br{2n}^{\sqrt{2n}} \prod_{p \le 2n} p. +& \le \br{2n}^{\pi\br{\sqrt{2n}}} \prod_{p \le 2n} p +\le \br{2n}^{\sqrt{2n}} \prod_{p \le 2n} p. \end{align*} So $$ \prod_{p \le 2n} p \ge \dfrac{4^n}{\br{2n + 1}\br{2n}^{\sqrt{2n}}}. $$ -(Exercise: show that for $ n $ sufficiently large, and any $ 4 > C_1 $, the right hand side is at least $ C_1^n $, that is if $ K > 1 $, $ K^n \ge \br{2n + 1}\br{2n}^{\sqrt{2n}} $ for all $ n $ sufficiently large) +For $ n $ sufficiently large, and any $ 4 > C_1 $, the right hand side is at least $ C_1^n $, that is if $ K > 1 $, $ K^n \ge \br{2n + 1}\br{2n}^{\sqrt{2n}} $ for all $ n $ sufficiently large. \footnote{Exercise} \begin{enumerate} \item In the first example sheet question $ 11 $, the exact power of $ p $ dividing $ m! $ is $ \sum_{i = 1}^\infty \fbr{m / p^i} $. So -$$ v_p\br{n} = \sum_{i = 1}^\infty \br{\fbr{\dfrac{2n}{p^i}} - 2\fbr{\dfrac{n}{p^i}}}, $$ -since -$$ \twobyone{2n}{n} = \dfrac{\br{2n}!}{n!n!}. $$ -For any $ x \in \R $, $ \fbr{2x} - 2\fbr{x} \ge 0 $, and in fact $ \fbr{2x} - 2\fbr{x} = 0 $ or $ \fbr{2x} - 2\fbr{x} = 1 $. If $ p > \sqrt{2n} $, then $ p^2 > 2n $, so all terms in the sum vanish if $ i \ge 2 $, so the sum is at most one. +$$ \binom{2n}{n} = \dfrac{\br{2n}!}{n!n!} \qquad \implies \qquad \v_p\br{n} = \sum_{i = 1}^\infty \br{\fbr{\dfrac{2n}{p^i}} - 2\fbr{\dfrac{n}{p^i}}}. $$ +For any $ x \in \RR $, $ \fbr{2x} - 2\fbr{x} \ge 0 $, and in fact $ \fbr{2x} - 2\fbr{x} = 0 $ or $ \fbr{2x} - 2\fbr{x} = 1 $. If $ p > \sqrt{2n} $, then $ p^2 > 2n $, so all terms in the sum vanish if $ i \ge 2 $, so the sum is at most one. \item Note that the terms in the sum are zero as soon as $ p^i > 2n $, that is -$$ i > \dfrac{\log\br{2n}}{\log\br{p}}. $$ -So -$$ v_p\br{n} \le \dfrac{\log\br{2n}}{\log\br{p}}, $$ -that is $ p^{v_p\br{n}} \le 2n $. +$$ i > \dfrac{\log 2n}{\log p} \qquad \implies \qquad \v_p\br{n} \le \dfrac{\log 2n}{\log p} \qquad \implies \qquad p^{\v_p\br{n}} \le 2n. $$ \item -$$ 4^n = 2^{2n} = \br{1 + 1}^{2n} = \sum_{i = 0}^{2n} \twobyone{2n}{i} \le \br{2n + 1}\twobyone{2n}{n}, $$ -so -$$ \prod_{p \le 2n} p^{v_p\br{n}} = \twobyone{2n}{n} \ge \dfrac{4^n}{2n + 1}. $$ +$$ 4^n = 2^{2n} = \br{1 + 1}^{2n} = \sum_{i = 0}^{2n} \binom{2n}{i} \le \br{2n + 1}\binom{2n}{n} \qquad \implies \qquad \prod_{p \le 2n} p^{\v_p\br{n}} = \binom{2n}{n} \ge \dfrac{4^n}{2n + 1}. $$ \end{enumerate} - -\pagebreak - \item Claim that there exists $ C_2 > 1 $ such that for all $ X $ sufficiently large, we have \begin{equation} \label{eq:6} @@ -2478,29 +2274,28 @@ \subsection{The prime number theorem} Taking logarithms, \begin{equation} \label{eq:7} -\pi\br{X} \le \pi\br{\dfrac{X}{2}} + \dfrac{X\log\br{C_2}}{\log\br{\tfrac{X}{2}}}. +\pi\br{X} \le \pi\br{\dfrac{X}{2}} + \dfrac{X\log C_2}{\log \tfrac{X}{2}}. \end{equation} Suppose that $ X $ is large enough that $ \br{\ref{eq:6}} $ holds for $ X, \dots, X / 2^{m - 1} $. Substituting $ X, \dots, X / 2^{m - 1} $ into $ \br{\ref{eq:7}} $, and summing, -$$ \pi\br{X} \le \pi\br{\dfrac{X}{2^m}} + 2\log\br{C_2}\sum_{i = 1}^m \dfrac{\tfrac{X}{2^i}}{\log\br{\tfrac{X}{2^i}}}. $$ +$$ \pi\br{X} \le \pi\br{\dfrac{X}{2^m}} + 2\log C_2\sum_{i = 1}^m \dfrac{\tfrac{X}{2^i}}{\log \tfrac{X}{2^i}}. $$ + +\pagebreak + Now fix $ X $ and choose $ m $ to be largest possible with $ 2^m \le \sqrt{X} $. Then $ X / 2^m \ge \sqrt{X} $, so $ \br{\ref{eq:6}} $ is indeed valid for $ X, \dots, X / 2^{m - 1} $ provided that $ X $ is sufficiently large. Since $ m $ is maximal such that $ 2^m \le \sqrt{X} $, we have $ 2^m \ge \sqrt{X} / 2 $. So $$ \pi\br{\dfrac{X}{2^m}} \le \dfrac{X}{2^m} \le 2\sqrt{X}. $$ So substituting into the above, -$$ \pi\br{X} \le 2\sqrt{X} + 2\log\br{C_2}\sum_{i = 1}^m \dfrac{\tfrac{X}{2^i}}{\log\br{\tfrac{X}{2^i}}} \le 2\sqrt{X} + \dfrac{2\log\br{C_2}}{\tfrac{1}{2}\log\br{X}}\sum_{i = 1}^m \dfrac{X}{2^i} \le 2\sqrt{X} + \br{4\log\br{C_2}}\br{\dfrac{X}{\log\br{X}}}. $$ -This gives our upper bound, because $ \sqrt{X} \l X / \log\br{X} $. Now remains to prove $ \br{\ref{eq:6}} $. We saw above that if $ n \in \Z $ then -$$ \prod_{n < p \le 2n} p \le \twobyone{2n}{n} \le 4^n = \sum_{i = 0}^{2n} \twobyone{2n}{i}. $$ +$$ \pi\br{X} \le 2\sqrt{X} + 2\log C_2\sum_{i = 1}^m \dfrac{\tfrac{X}{2^i}}{\log \tfrac{X}{2^i}} \le 2\sqrt{X} + \dfrac{2\log C_2}{\tfrac{1}{2}\log X}\sum_{i = 1}^m \dfrac{X}{2^i} \le 2\sqrt{X} + \br{4\log C_2}\br{\dfrac{X}{\log X}}. $$ +This gives our upper bound, because $ \sqrt{X} \ll X / \log X $. Now remains to prove $ \br{\ref{eq:6}} $. We saw above that if $ n \in \ZZ $ then +$$ \prod_{n < p \le 2n} p \le \binom{2n}{n} \le 4^n = \sum_{i = 0}^{2n} \binom{2n}{i}. $$ Take $ n = \fbr{X / 2} $. Then $ 2n \le X $, and we get -$$ \prod_{\tfrac{X}{2} < p \le 2\fbr{\tfrac{X}{2}}} p \le 2^{2n} \le 2^X. $$ -So -$$ \prod_{\tfrac{X}{2} < p \le X} p \le X2^X < C_2^X, $$ +$$ \prod_{\tfrac{X}{2} < p \le 2\fbr{\tfrac{X}{2}}} p \le 2^{2n} \le 2^X \qquad \implies \qquad \prod_{\tfrac{X}{2} < p \le X} p \le X2^X < C_2^X, $$ for $ X $ sufficiently large, for any $ C_2 > 2 $. \end{itemize} \end{proof} \lecture{28}{Friday}{07/12/18} -Lecture 28 is a problem class. - -\pagebreak +Lecture 28 is a problems class. \subsection{The Brun-Titchmarsh theorem and the Selberg sieve} @@ -2509,59 +2304,48 @@ \subsection{The Brun-Titchmarsh theorem and the Selberg sieve} What can we say about the number of primes $ p $ with $ X < p \le X + Y $? That is, $ \pi\br{X + Y} - \pi\br{X} $. Think of $ Y $ being fixed for a moment. The best possible lower bound is zero. \begin{example*} -$$ n! + 2, \qquad \dots, \qquad n! + n $$ -is a sequence of consecutive composite numbers. +$ n! + 2, \dots, n! + n $ is a sequence of consecutive composite numbers. \end{example*} -It was conjectured, in 1920s, by Hardy and Littlewood that -$$ \pi\br{X + Y} \le \pi\br{X} + \pi\br{Y}, $$ -that is $ \pi\br{X + Y} - \pi\br{X} \le \pi\br{Y} $. This is no longer believed. +It was conjectured, in 1920s, by Hardy and Littlewood that $ \pi\br{X + Y} \le \pi\br{X} + \pi\br{Y} $, that is $ \pi\br{X + Y} - \pi\br{X} \le \pi\br{Y} $. This is no longer believed. \begin{theorem} \label{thm:107} -$$ \pi\br{X + Y} - \pi\br{X} \le \dfrac{\br{2 + o\br{1}}Y}{\log\br{Y}}, $$ -where $ o\br{1} $ is as $ Y \to \infty $ and $ X $ is fixed. +$$ \pi\br{X + Y} - \pi\br{X} \le \dfrac{\br{2 + \o\br{1}}Y}{\log Y}, $$ +where $ \o\br{1} $ is as $ Y \to \infty $ and $ X $ is fixed. \end{theorem} -In -$$ X + 1, \qquad \dots, \qquad X + Y, $$ -about half of these are divisible by two, about a third of these are divisible by three, and about a sixth of these are divisible by six. If $ p_1, \dots, p_k $ are primes, the error term is $ 2^k $, so can only consider the first $ \log\br{Y} $ primes, which implies Theorem \ref{thm:107} for $ Y / \log\br{\log\br{Y}} $. Selberg's idea is to weight the inclusion-exclusion count. +In $ X + 1, \dots, X + Y $, about half of these are divisible by two, about a third of these are divisible by three, and about a sixth of these are divisible by six. If $ p_1, \dots, p_k $ are primes, the error term is $ 2^k $, so can only consider the first $ \log Y $ primes, which implies Theorem \ref{thm:107} for $ Y / \log \log Y $. Selberg's idea is to weight the inclusion-exclusion count. \begin{proof} -Let $ \lambda_1, \lambda_2, \dots \in \R $ be any sequence with $ \lambda_1 = 1 $. Let $ R < Y $ be fixed for now. Later we will choose $ R = Y^{1 / 2 - \epsilon} $. Set +Let $ \lambda_1, \lambda_2, \dots \in \RR $ be any sequence with $ \lambda_1 = 1 $. Let $ R < Y $ be fixed for now. Later we will choose $ R = Y^{\tfrac{1}{2} - \epsilon} $. Set $$ \nu\br{n} = \br{\sum_{d \mid n, \ d \le R} \lambda_d}^2 \ge 0. $$ Suppose that $ p $ is prime, and $ p > R $. Then by definition, $ \nu\br{p} = \lambda_1^2 = 1 $, so $$ \pi\br{X + Y} - \pi\br{X} = \sum_{X < p \le X + Y} 1 \le \pi\br{R} + \sum_{X < n \le X + Y} \nu\br{n} \le R + \sum_{X < n \le X + Y} \nu\br{n}. $$ + +\pagebreak + Now have to choose $ \lambda_i $ to minimise $ \sum_{X \le n \le X + Y} \nu\br{n} $, so \begin{align*} \sum_{X < n \le X + Y} \nu\br{n} -& = \sum_{X < n \le X + Y} \br{\sum_{d \mid n, \ d \le R} \lambda_d}^2 \\ -& = \sum_{X < n \le X + Y} \br{\sum_{d_1 \mid n, \ d_1 \le R} \lambda_{d_1}}\br{\sum_{d_2 \mid n, \ d_2 \le R} \lambda_{d_2}} \\ -& = \br{\sum_{d_1, d_2 \le R} \lambda_{d_1}\lambda_{d_2}}\br{\sum_{X < n \le X + Y, \ d_1 \mid n, \ d_2 \mid n} 1} \\ -& = \br{\sum_{d_1, d_2 \le R} \lambda_{d_1}\lambda_{d_2}}\br{\dfrac{Y\br{d_1, d_2}}{d_1d_2} + O\br{1}}, +& = \sum_{X < n \le X + Y} \br{\sum_{d \mid n, \ d \le R} \lambda_d}^2 += \sum_{X < n \le X + Y} \br{\sum_{d_1 \mid n, \ d_1 \le R} \lambda_{d_1}}\br{\sum_{d_2 \mid n, \ d_2 \le R} \lambda_{d_2}} \\ +& = \br{\sum_{d_1, d_2 \le R} \lambda_{d_1}\lambda_{d_2}}\br{\sum_{X < n \le X + Y, \ d_1 \mid n, \ d_2 \mid n} 1} += \br{\sum_{d_1, d_2 \le R} \lambda_{d_1}\lambda_{d_2}}\br{\dfrac{Y\br{d_1, d_2}}{d_1d_2} + \O\br{1}}, \end{align*} -since -$$ \mathrm{lcm}\br{d_1, d_2} = \dfrac{d_1d_2}{\br{d_1, d_2}}. $$ - -\pagebreak - -Putting this together, -$$ \pi\br{X + Y} - \pi\br{X} \le Y\sum_{d_1, d_2 \le R} \dfrac{\lambda_{d_1}\lambda_{d_2}\br{d_1, d_2}}{d_1d_2} + R + O\br{1}\sum_{d_1, d_2 \le R} \abs{\lambda_{d_1}\lambda_{d_2}}, $$ +since $ \lcm\br{d_1, d_2} = d_1d_2 / \br{d_1, d_2} $. Putting this together, +$$ \pi\br{X + Y} - \pi\br{X} \le Y\sum_{d_1, d_2 \le R} \dfrac{\lambda_{d_1}\lambda_{d_2}\br{d_1, d_2}}{d_1d_2} + R + \O\br{1}\sum_{d_1, d_2 \le R} \abs{\lambda_{d_1}\lambda_{d_2}}, $$ where the leading term is $$ Y\sum_{d_1, d_2 \le R} \dfrac{\lambda_{d_1}\lambda_{d_2}\br{d_1, d_2}}{d_1d_2}, $$ and the error term is -$$ R + O\br{1}\sum_{d_1, d_2 \le R} \abs{\lambda_{d_1}\lambda_{d_2}}. $$ -Now choose $ \lambda_i $ such that $ \lambda_1 = 1 $, in such a way as to minimise the leading term. Then choose $ R = Y^c $ for $ c < 1 / 2 $. Check that for any $ \epsilon > 0 $, we have $ \lambda_d \l_\epsilon d^\epsilon $. Then +$$ R + \O\br{1}\sum_{d_1, d_2 \le R} \abs{\lambda_{d_1}\lambda_{d_2}}. $$ +Now choose $ \lambda_i $ such that $ \lambda_1 = 1 $, in such a way as to minimise the leading term. Then choose $ R = Y^c $ for $ c < \tfrac{1}{2} $. Check that for any $ \epsilon > 0 $, we have $ \lambda_d \ll_\epsilon d^\epsilon $. Then $$ \sum_{d_1d_2} \abs{\lambda_{d_1}\lambda_{d_2}} \le R^{2 + 2\epsilon} = Y^{2c\br{1 + \epsilon}}. $$ -Choose $ \epsilon < 1 / 2c - 1 $, then $ Y^{2c\br{1 + \epsilon}} \l Y / \log\br{Y} $. Write $ \overrightarrow{\lambda} = \br{\lambda_1, \lambda_2, \dots} $, so +Choose $ \epsilon < 1 / 2c - 1 $, then $ Y^{2c\br{1 + \epsilon}} \ll Y / \log Y $. Write $ \overrightarrow{\lambda} = \br{\lambda_1, \lambda_2, \dots} $, so $$ Q\br{\overrightarrow{\lambda}} = \sum_{d_1, d_2 \le R} \dfrac{\lambda_{d_1}\lambda_{d_2}\br{d_1, d_2}}{d_1d_2}. $$ -Want to minimise this subject to $ \lambda_1 = 1 $. Want to diagonalise $ Q\br{\overrightarrow{\lambda}} $. Use, a slight variant of, M\"obius inversion. For any $ m $, $ m = \sum_{d \mid m} \Phi\br{d} $. Take $ m = \br{d_1, d_2} $. Then -$$ \br{d_1, d_2} = \sum_{\delta \mid \br{d_1, d_2}} \Phi\br{\delta}, $$ -so +Want to minimise this subject to $ \lambda_1 = 1 $. Want to diagonalise $ Q\br{\overrightarrow{\lambda}} $. Use, a slight variant of, M\"obius inversion. For any $ m $, $ m = \sum_{d \mid m} \Phi\br{d} $. Take $ m = \br{d_1, d_2} $. Then $ \br{d_1, d_2} = \sum_{\delta \mid \br{d_1, d_2}} \Phi\br{\delta} $, so $$ Q\br{\overrightarrow{\lambda}} = \sum_{d_1, d_2 \le R} \dfrac{\lambda_{d_1}\lambda_{d_2}\br{d_1, d_2}}{d_1d_2} = \sum_{\delta \le R} \Phi\br{\delta}\br{\sum_{\delta \mid d, \ d \le R} \dfrac{\lambda_d}{d}}^2, $$ -by using that $ \delta \mid d_1 $ and $ \delta \mid d_2 $ if and only if $ \delta \mid d_1d_2 / \br{d_1, d_2} $. Set -$$ u_\delta = \sum_{\delta \mid d, \ d \le R} \dfrac{\lambda_d}{d}. $$ -Then +by using that $ \delta \mid d_1 $ and $ \delta \mid d_2 $ if and only if $ \delta \mid d_1d_2 / \br{d_1, d_2} $. Set $ u_\delta = \sum_{\delta \mid d, \ d \le R} \lambda_d / d $. Then $$ Q\br{\overrightarrow{\lambda}} = \sum_{\delta \le R} \Phi\br{\delta}u_\delta^2. $$ \lecture{30}{Wednesday}{12/12/18} @@ -2580,36 +2364,34 @@ \subsection{The Brun-Titchmarsh theorem and the Selberg sieve} 0 & \text{otherwise} \end{cases}. $$ -The sum is equal to -$$ \sum_{m \mid d' / d} \mu\br{m} = \br{1 * \mu}\br{\dfrac{d'}{d}} = \epsilon\br{\dfrac{d'}{d}}. $$ \pagebreak +The sum is equal to +$$ \sum_{m \mid d' / d} \mu\br{m} = \br{1 * \mu}\br{\dfrac{d'}{d}} = \epsilon\br{\dfrac{d'}{d}}. $$ The condition that $ \lambda_1 = 1 $ translates via $ \br{\ref{eq:8}} $ to the condition that $ 1 = \sum_{\delta \le R} \mu\br{\delta}u_\delta $. The Cauchy-Schwarz inequality is $ \abs{ab} \le \abs{a}\abs{b} $, that is $$ \sum_i a_ib_i \le \br{\sum_i a_i^2}^{\tfrac{1}{2}}\br{\sum_i b_i^2}^{\tfrac{1}{2}}, $$ with equality if and only if there exists $ \lambda $ such that $ b_i = \lambda a_i $ for all $ i $. So $$ 1 = \sum_{\delta \le R} \mu\br{\delta}u_\delta \le \br{\sum_{\delta \le R}\Phi\br{\delta}u_\delta^2}^{\tfrac{1}{2}}\br{\sum_{\delta \le R}\dfrac{\mu\br{\delta}^2}{\Phi\br{\delta}}}^{\tfrac{1}{2}}. $$ So $$ Q\br{\overrightarrow{\lambda}} = \sum_{\delta \le R} \Phi\br{\delta}u_\delta^2 \ge \dfrac{1}{D}, \qquad D = \sum_{\delta \le R} \dfrac{\mu\br{\delta}^2}{\Phi\br{\delta}}. $$ -Equality holds when $ u_\delta = \mu\br{\delta} / D\Phi\br{\delta} $. We are going to show that $ D \ge \log\br{R} + O\br{1} $. Since $ R = Y^c $, this gives us a leading term of -$$ \dfrac{Y}{\log\br{R}} = \dfrac{Y}{\log\br{Y^c}} = \dfrac{1}{c}\br{\dfrac{Y}{\log\br{Y}}}. $$ -$ c < 1 / 2 $ implies that $ 1 / c > 2 $, so +Equality holds when $ u_\delta = \mu\br{\delta} / D\Phi\br{\delta} $. We are going to show that $ D \ge \log R + \O\br{1} $. Since $ R = Y^c $, this gives us a leading term of +$$ \dfrac{Y}{\log R} = \dfrac{Y}{\log Y^c} = \dfrac{1}{c}\br{\dfrac{Y}{\log Y}}. $$ +$ c < \tfrac{1}{2} $ implies that $ 1 / c > 2 $, so $$ D = \sum_{\delta \le R} \dfrac{\mu\br{\delta}^2}{\Phi\br{\delta}} = \sum_{\delta \le R, \ \delta \ \text{squarefree}} \dfrac{1}{\Phi\br{\delta}}. $$ If $ \delta $ is squarefree, write $ \delta = p_1 \dots p_k $. Then $$ \Phi\br{\delta} = \br{p_1 - 1} \dots \br{p_k - 1} = p_1 \dots p_k\br{1 - \dfrac{1}{p_1}} \dots \br{1 - \dfrac{1}{p_k}}. $$ So $$ D = \sum_{\delta \le R, \ \delta \ \text{squarefree}} \dfrac{1}{\delta}\prod_{p \mid \delta} \br{1 - \dfrac{1}{p}}^{-1}. $$ Now, $ \br{1 - 1 / p}^{-1} = 1 + 1 / p + \dots $. So -$$ D = \sum_{\delta \le R, \ \delta \ \text{squarefree}} \dfrac{1}{\delta}\prod_{p \mid \delta} \br{1 + \dfrac{1}{p} + \dots} \ge \sum_{n \le R} \dfrac{1}{n} = \log\br{R} + O\br{1}, $$ +$$ D = \sum_{\delta \le R, \ \delta \ \text{squarefree}} \dfrac{1}{\delta}\prod_{p \mid \delta} \br{1 + \dfrac{1}{p} + \dots} \ge \sum_{n \le R} \dfrac{1}{n} = \log R + \O\br{1}, $$ by taking $ n \le R $, and writing $ n = p_1^{a_1} \dots p_m^{a_m} $ and $ \delta = p_1 \dots p_m \le R $ squarefree, so $$ \dfrac{1}{n} = \dfrac{1}{\delta}\br{\dfrac{1}{p_1^{a_1 - 1}} \dots \dfrac{1}{p_m^{a_m - 1}}}. $$ -The only thing remaining is to show that $ \lambda_d \l_\epsilon d^\epsilon $. Recall that $ u_\delta = \mu\br{\delta} / D\Phi\br{\delta} $. So +The only thing remaining is to show that $ \lambda_d \ll_\epsilon d^\epsilon $. Recall that $ u_\delta = \mu\br{\delta} / D\Phi\br{\delta} $. So $$ \lambda_d = d\sum_{d \mid \delta, \ \delta \le R} \mu\br{\dfrac{\delta}{d}}u_\delta = \dfrac{d}{D}\sum_{d \mid \delta, \ \delta \le R} \dfrac{\mu\br{\tfrac{\delta}{d}}\mu\br{\delta}}{\Phi\br{\delta}} = \dfrac{d}{D}\sum_{d \mid \delta, \ \delta \le R, \ \delta \ \text{squarefree}} \dfrac{\mu\br{\tfrac{\delta}{d}}\mu\br{\delta}}{\Phi\br{\delta}}. $$ Write $ \delta' = \delta / d $. Since $ \delta = \delta'd $, and $ \delta $ is squarefree, we have $ \br{\delta', d} = 1 $, so $ \Phi\br{\delta} = \Phi\br{\delta'}\Phi\br{d} $. So $$ \abs{\lambda_d} \le \dfrac{d}{\Phi\br{d}D}\sum_{\delta' \le R, \ \delta' \ \text{squarefree}} \dfrac{1}{\Phi\br{\delta'}} = \dfrac{d}{\Phi\br{d}}. $$ -Need to show that $ \Phi\br{d} \g_\epsilon d^{1 - \epsilon} $ if $ d $ is squarefree, where -$$ \Phi\br{d} = \prod_{p \mid d} \br{p - 1}. $$ -If $ p $ is sufficiently large, then $ p - 1 \ge p^{1 - \epsilon} $. If $ p $ is not sufficiently large, then $ \br{p - 1} / p > 0 $ can be regarded as a constant. +Need to show that $ \Phi\br{d} \gg_\epsilon d^{1 - \epsilon} $ if $ d $ is squarefree, where $ \Phi\br{d} = \prod_{p \mid d} \br{p - 1} $. If $ p $ is sufficiently large, then $ p - 1 \ge p^{1 - \epsilon} $. If $ p $ is not sufficiently large, then $ \br{p - 1} / p > 0 $ can be regarded as a constant. \end{proof} \end{document} \ No newline at end of file