初等数论学习笔记(持续更新)

这是一个初等数论学习笔记,使用的教材为Gareth A.Jones and J.Mary Jones的 Elementary Number Theory。不是全按照书本上的讲法来的,目前只学到第八章,,,

发布日志

2025-01-17

整理至 THm 5.3,美化页面

2025-01-15

发布文章。(整理至 THm 5.1)

NOTE
  • 小标号以fjr老师的lecture为准,有跳跃的地方是因为觉得不是很重要所以没有记,可以忽略,,, 大标号按书本划分。
    由于是按照我的手写笔记整理的,有的地方思维会有些跳跃。 我就这样/bushi
  • 大部分未给出证明的地方都是我认为很好理解且显然的;所有仅给出证明links的都是不需要掌握的,感兴趣了解即可。
  • 现在正在整理第四章,,,,,,

1. Divisibility

1.1 Divisors

THm 1.1

If a,bZa,b\in \mathbb{Z} with b>0b>0, then there is a unique part of integers qq and rr such that a=qb+ra=qb+r and 0q<b0\leq q <b .

pf. The set S={anbnZ}S=\{ a-nb \mid n \in \mathbb{Z} \} contains some non-neg integers so SNS \cap \mathbb{N} has at least one element,for some qZq \in \mathbb{Z} , say r=aqb0r=a-qb \geq 0 . ■

Def 1.3

If r=0r=0 , we say that bb divides aa , denoted by bab \mid a . In the case, we also say that bb is a factor of aa or aa is a multiple of bb . And if b dose not divide a , we write bab \nmid a .

Ex 1.4

Every integer divides 00 ; if nn is a square ,then n0  or  1(mod  4)n \equiv 0 \; \text{or} \; 1 ( \text{mod} \; 4) .

Prop 1.5

If cc is divisible by a1,,ana_1, \dots , a_n , then cc is divisible by an integer linear combination of {a1,a2,,an}\{ a_1, a_2, \dots , a_n \} .

Def 1.6

If dad \mid a and dbd \mid b , then dd is a common divisor of aa and bb , All common divosors are bounded. There is a biggest common divisor of aa and bb denoted by gcd(a,b)\text{gcd} (a,b) .

Lemma 1.7 (Euclid's Algorithm)

If a=q1b+r1a=q_1 b+r_1 , then gcd(a,b)=gcd(b,r1)\text{gcd} (a,b)= \text{gcd} (b,r_1) , write r1=aq1br_1=a-q_1 b , using Prop 1.5 , we can repeat this operation and reduce the number rnr_n to 00 . And rn1r_{n-1} is the least common divisor of aa and bb . We have d=gcd(a,b)=rn1d= \text{gcd} (a,b) = r_{n-1} .

Remark 1.10: The result extends to any Euclidean ring .

1.2 Bezout's identity

THm 1.11

If a,bZa,b \in \mathbb{Z} , not both 00 , then there exist integers uu and vv , s. t. gcd(a,b)=au+bv\text{gcd} (a,b) = au + bv .

pf. using Lemma 1.7 and induction. Start from gcd(a,b)=rn1=rn3qn1rn2=\text{gcd} (a,b)= r_{n-1} =r_{n-3} - q_{n-1} r_{n-2}= \dots

Ex 1.11

Extend the result to k numbers.

gcd(a1,a2,,ak)=g1a1+g2a2++gkak.(giR1)\text{gcd} (a_1 , a_2 , \dots , a_k ) =g_1 a_1+g_2 a_2 + \dots +g_k a_k. (g_i \in \mathbb{R}^1)

Corollary 1.13

Suppose that gcd(a,b)=d\text{gcd} (a,b)=d , then an integer ee is of the form ax+byax+by for some xZx \in \mathbb{Z} , iff cc is a multiple of dd . In particular, dd is the least positive integer of such form.

pf. Because gcd(a,b)a\text{gcd} (a,b) \mid a and gcd(a,b)b\text{gcd} (a,b) \mid b . So gcd(a,b)ax+by\text{gcd} (a,b) \mid ax+by . ■

Def 1.14

Two integers aa and bb are coprime (or relatively prime) if gcd(a,b)=1\text{gcd} (a,b) = 1 . More generally a set of integers are coprime if gcd(a1,a2,,ak)=1\text{gcd} (a_1 ,a_2 , \dots ,a_k)=1 . (If the integers are mutually coprime , then they are collectively coprime)

Corollary 1.15

gcd(a,b)=1\text{gcd} (a,b) =1 iff ax+by=1ax+by=1 ,for some xx and yy .

Corollary 1.16

For aa , bb are coprime, we have that if aca \mid c and bcb \mid c then abcab \mid c ; if abca \mid bc , then aca \mid c .

1.3 Least common multiples

Def 1.17

If aca \mid c and bcb \mid c , we say cc is a common multiple of aa and bb . The set of all positive common multiple of a0a \neq 0 and b0b \neq 0 is clearly non-empty and bounded below. So there is a unique least common multiple of aa and bb , denoted by lcm(a,b)\text{lcm} (a,b) .

THm 1.18

Lets d=gcd(a,b) and m=lcm(a,b)d=\text{gcd} (a,b) \text{ and } m= \text{lcm} (a,b) , then ab=dmab=dm .

1.4 Linear Diophantine equations

THm 1.19 (Application of the Diophantine Equations)

Let a,b,cZa,b,c \in \mathbb{Z} with aa , bb are not both 00 and let d=gcd(a,b)d=\text{gcd} (a,b) . Then the equation ax+by=cax+by=c has an integer solution xx , yy iff cc is a multiple of dd .
In this case, there are infinitely many solution given by {x=x0+bndy=y0and\left\{ \begin{aligned} x = x_0 + \frac{bn}{d} \\ y = y_0 - \frac{an}{d} \end{aligned} \right. where bZb \in \mathbb{Z} and x0x_0 , y0y_0 is any particular solution.

pf. The existence of solution is guaranteed by Corollary 1.13 . The infinite solutions are easy to verify. ■

2. Prime Numbers

2.1 Prime numbers and prime-power factorisations

Def 2.1

We call a positive integer a prime iff its only positive divisor is itself. (the opposite is called coprime)

Lemma 2.3

If p is a prime and pa1a2akp \mid a_1a_2 \dots a_k , then pp must divide some aia_i .

Remark: Such a polynomial f(x)f(x) is reducible if f(x)=g(x)h(x)f(x)=g(x)h(x) , where g(x)g(x) and h(x)h(x) are non-constant polynomials with integer coefficients; otherwise, f(x)f(x) is irreducible.

2.2 Distribution of primes

THm 2.4 (Fundamental Theorem of Arithmetic)

A number can be factored uniquely as a product of prime powers.

pf. We prove this by contradiction. Suppose the factorization is not unique. Let n=p1p2pj=q1q2qkn = p_1 p_2 \dots p_j = q_1 q_2 \dots q_k be the smallest such composite number that can be factored in two different ways.

By Lemma 2.3 , we know that if a prime pp divides a product of numbers, it must divide at least one of the numbers in the product. Therefore, if n=p1p2pj=q1q2qkn = p_1 p_2 \dots p_j = q_1 q_2 \dots q_k , there must be some overlap between the prime factors in these two factorizations.

Without loss of generality, suppose that p1p_1 divides one of the qiq_i 's. Then, by Lemma 2.3 , we know that p1p_1 must divide some qiq_i , and we can continue this process recursively to break down nn into smaller numbers that must still obey the uniqueness of factorization. However, this contradicts the assumption that nn was the smallest number with two different factorizations.

Thus, the assumption that the factorization of nn is not unique leads to a contradiction, and we conclude that the factorization must be unique. ■

Remark: If pp is prime, we write penp^e \parallel n to indicate that pep^e is the highest power of pp dividing nn , that is, pep^e divides nn but pe+1p^{e+1} does not. We have that if peap^e \parallel a and pfbp^f \parallel b then pe+fabp^{e+f} \parallel ab , pefabp^{e-f} \parallel \frac{a}{b} , pmeamp^{me} \parallel a^m .

Lemma 2.5

Suppose that a1,a2,,ara_1,a_2, \dots ,a_r are mutually coprime positive integers. If a1a2ara_1a_2 \dots a_r is an m-th power, then so is each aia_i .

pf. Assume that a1,a2,,ara_1, a_2, \dots , a_r are mutually coprime positive integers, and that their product a1a2ara_1 a_2 \dots a_r is an m-th power. That is, there exists an integer kk such that: a1a2ar=kma_1 a_2 \dots a_r = k^m

We need to show that each aia_i is also an m-th power.

Since a1,a2,,ara_1, a_2, \dots , a_r are mutually coprime, no pair aia_i and aja_j share any common prime divisor. Therefore, for any prime pp that divides aia_i , pp cannot divide any other aja_j for jij \neq i .

Now, consider the prime factorization of a1a2ara_1 a_2 \dots a_r . Since a1a2ar=kma_1 a_2 \dots a_r = k^m , every prime factor of a1a2ara_1 a_2 \dots a_r must appear to a power that is divisible by mm. Specifically, if a prime pp divides aia_i , the exponent of pp in the prime factorization of a1a2ara_1 a_2 \dots a_r must be divisible by mm . Since aia_i is coprime with all other aja_j 's, the exponent of pp in the prime factorization of aia_i must also be divisible by mm . Thus, each aia_i must be an m-th power. ■

Corollary 2.6

If a positive integer mm is not a perfect square, then m\sqrt{m} is irrational.

pf. We use contradiction to prove it, assume that mm is rational, then we have m=ab\sqrt{m} = \frac{a}{b} , m=a2b2m= \frac{a^2}{b^2} , where a=p1e1p2e2pkeka=p_1^{e_1} p_2^{e_2} \dots p_k^{e_k} and b=p1f1p2f2pkfkb=p_1^{f_1} p_2^{f_2} \dots p_k^{f_k} . So m=(p1e1p2e2pkekp1f1p2f2pkfk)2    p12e1p22e2pk2ek=mp12f1p22f2pk2fkm=( \frac{ p_1^{e_1} p_2^{e_2} \dots p_k^{e_k} }{ p_1^{f_1} p_2^{f_2} \dots p_k^{f_k} } )^2 \implies p_1^{2e_1} p_2^{2e_2} \dots p_k^{2e_k} = m p_1^{2f_1} p_2^{2f_2} \dots p_k^{2f_k} . For m is not a square, the prime factorization of mm must include at least one prime with an odd exponent. And this creates a contradiction. ■

THm 2.7 (Infinitude of Primes)

There are infinitely many prime numbers.

pf. I just give 3 proofs here.
Euclid's Proof (Contradiction)

  1. Assume there are finitely many primes: p1,p2,,pnp_1, p_2, \dots, p_n .
  2. Construct N=p1p2pn+1N = p_1 \cdot p_2 \cdots p_n + 1 .
  3. NN is either prime or divisible by a prime:
  • If NN is prime, it is not in the list.
  • If NN is divisible by a prime pip_i , then Nmodpi=1N \mod p_i = 1 , a contradiction.
  1. Thus, primes are infinite.

Proof Using the Fundamental Theorem of Arithmetic

  1. Every integer n>1n > 1 has a unique prime factorization.
  2. Suppose there are only finitely many primes p1,p2,,pnp_1, p_2, \dots, p_n .
  3. The number of distinct products p1e1p2e2pnenp_1^{e_1} \cdot p_2^{e_2} \cdots p_n^{e_n} is finite.
  4. This contradicts the fact that there are infinitely many integers.
  5. Hence, primes must be infinite.

Proof Using the Density of Primes

  1. For any nn , consider the numbers 2,3,,n2, 3, \dots, n .
  2. By the Prime Number Theorem, the number of primes n\leq n grows approximately as nlogn\frac{n}{\log n} .
  3. Since nlogn\frac{n}{\log n} \to \infty as nn \to \infty , there are infinitely many primes. ■

THm 2.8 (Dirichlet's Theorem on Arithmetic Progressions)

If aa and bb are coprime integers (i.e., gcd(a,b)=1\gcd(a, b) = 1 ), then there are infinitely many primes of the form aq+baq+b .

pf. The proof of Dirichlet's Theorem is highly non-trivial and relies on advanced number theory, so we only prove the case when a=4a=4 and b=3b=3 .
Suppose that there have only finitely many primes of this form say p1,,pkp_1, \dots ,p_k .
Consider

c=4i=1kpi1c= 4 \prod_{i=1}^{k} p_i -1

where c must be an odd integer, if c has prime divisor, it must be of the form 4q+14q+1 or 4q+34q+3 . The integer cc is not divisible by any of the primes p1,p2,,pkp_1, p_2, \dots, p_k because of its form. So the divisor of cc can all be writen as 4q+14q+1 , then c=(4q1+1)(4qt+1)=4k+1c=(4q_1+1) \dots (4q_t+1) =4k+1 , this creates a contradiction. ■

THm 2.10 (Prime Number Theorem)

limxπ(x)xlnx=1        "Density"      π(x)x1lnx\lim_{x \to \infin} \frac{\pi (x)}{ \frac{x}{ \ln x} } =1 \; \; \; \; \text{"Density"} \; \; \; \frac{ \pi (x)}{ \lfloor x \rfloor} \approx \frac{1}{ \ln x}

li(x)=2xdtlnx=Li(x)Li(2)xlnx\mathrm{li} (x)= \int_{2}^{x} \frac{ \mathrm{d} t}{ \ln x} = \mathrm{Li} (x) - \mathrm{Li} (2) \sim \frac{x}{ \ln x}

Experiments indicate that π(x)\pi (x) is always less than Li(x)\mathrm{Li} (x) when xx is small. But Littlewood in 1914 proved that there is a crossover point, when xx is bigger than it, there is π(x)>Li(x)\pi (x) > \mathrm{Li} (x) ,and crossovers like this are infinitely many. (It has been proven that the first crossover is before 101910^{19} )

note: π(x)\pi (x) denotes the number of primes pxp \leq x .The above is conjectured by Gans and proven by Hadnard.

pf. See the proof at Newman's proof . ■

THm 2.11 (Riemann Hypothesis)

π(x)=li(x)12li(x)pli(xp)+(lower-order components)\pi (x) = \mathrm{li} (x) - \frac{1}{2} \mathrm{li} (\sqrt{x}) - \sum_p \mathrm{li} (x^p) + \text{(lower-order components)}

The heuristic reason for the term 12li(x)\frac{1}{2} \mathrm{li} ( \sqrt{x}) is that li(x)\mathrm{li} (x) actually counts powers of primes with pnp^n weightd by 1n\frac{1}{n} .
Conjecture x2.01\forall x \geq 2.01 , π(x)Li(x)xlnx| \pi (x) - \mathrm{Li} (x)| \leq \sqrt{x} * \ln x , is equivalent to Riemann Hypithesis.

仅作了解。

2.3 Fermat and Mersenne primes

Lemma 2.12

If 2m+12^m+1 is a prime, then m=2nm=2^n for some integer n0n \geq 0 .

pf. If mm has an odd factor qq , then m=2nqm=2^n *q , then 2m+1=(22n)q+12^m+1=( 2^{2^n} )^q+1 , which has factor 22n+12^{2^n} +1 , this contradicts the fact that
2m+12^m +1 is a prime number. ■

Def 2.13

Numbers of the form Fn=22n+1F_n = 2^{2^n} +1 are called Fermat numbers, and primes of the form are called Fermat prime.         \; \; \; \; Numbers of the form Mp=2p1M_p = 2^p -1 are called Mersenne numbers, and primes of the form are called Mersenne prime.

Lemma 2.14

Different Fermat Numbers are mutually coprime.

pf.

Fn2=22n1=k=0n1FkF_n -2 = 2^{2^n} -1 = \prod_{k=0}^{n-1} F_k

So FnF_n is coprime with F1,,Fn1F_1 , \dots , F_{n-1} . ■

Remark: (Gauss–Wantzel theorem) A number nn is constructible with a straightedge and compass iff n=2ep1p2pkn=2^e p_1 p_2 \dots p_k , where pip_i 's are Fermat primes.
See the proof at Proof of Gauss-Wantzel Theorem. (A graceful proof!!!)

2.4 Primality-testing and factorisation

Skip, it will be mentioned in the later chapters.

3. Congruences

NOTE

由于这一章的笔记完全没按照小节划分来,所以小节标号就不加了。
似乎从这里开始标号就和书本错开了,,,
今天刷到一篇很有意思的科普,感兴趣的可以看看: 从循环小数到群作用

Def 3.1

A binary relation \sim on a set XX is said to be an equiv relation if it is reflexive( aaa \sim a ), symmetric( aba \sim b iff bab \sim a ) and transitive( aba \sim b , ba    acb \sim a \implies a \sim c ).
The equivalence class of aa under \sim is defined as [a]={xXxa}[a]= \{ x \in X \mid x \sim a \} . aa is called a representative of [a][a] . Clearly [a]=[b][a] = [b] iff aba \sim b .

Def 3.2

Let nNn \in \mathbb{N} and a,bZa,b \in \mathbb{Z} . We say aa is congruent to b  ( ⁣ ⁣ ⁣modn)b \; ( \! \! \! \mod n) written as ab    ( ⁣ ⁣ ⁣modn)a \equiv b \; \; ( \! \! \! \mod n) if nabn \mid a-b . We denote the equivalence classes modular nn by Zn\mathbb{Z}_n .
[a]±[b]=[a±b][a] \pm [b] = [a \pm b] , [a][b]=[ab][a] [b] = [ab] , the three modular operqtions are well defined.


abstract algebra

To better understand the following content, we interrupt the note with something about abstract algebra.

Def 3.6 (Group)

A group GG is a set GG with a binary operation ()(*) , satisfying 1 ) Associativity 2 ) Identity 3 ) Inverse. A group is called alelian group if the operation ()(*) is commutative.

Def 3.7 (Ring)

A ring is a set RR with two binary relations (+,)(+,*) . Additive structure (R,+)(R,+) is an abelian group (with zero element 00 ) A ring satisfying 1 )Associativity 2 ) Distributivity 3 ) (not-necessary) Identity.

Ex. matrix ring, polynomial ring.

abstract algebra end


THm 3.8

Zn\mathbb{Z}_n under the modular addition and multiplication forms a ring.

Def 3.9

A set of integers containing one representative from each congruence class is called a complete set of residue mod nn .

Lemma 3.11

For fZ[x]f \in \mathbb{Z} [x] if ab  ( ⁣ ⁣ ⁣modn)a \equiv b \; ( \! \! \! \mod n) , then f(a)f(b)  ( ⁣ ⁣ ⁣modn)f(a) \equiv f(b) \; (\! \! \! \mod n) .

Ex 3.13 (failure of Hasse Principle)

The polynormial f(x)=(x213)(x217)(x2221)f(x) = (x^2 -13) (x^2 -17)(x^2 -221) has no integer roots. But we can see that for each integer n>1n>1 , there is a solution for f(x)0  ( ⁣ ⁣ ⁣modn)f(x) \equiv 0 \; (\! \! \! \mod n) .

Ex 3.14 (Euler's polynormial)

Euler found a remarkable polynormial f(x)=x2+x+41f(x)= x^2 +x +41 , f(x)f(x) is a prime for each 41<x<40-41<x<40 . (only 7 lucky numbers of Euler exists : 1,2,3,5,11,17,411,2,3,5,11,17,41 )

THm 3.15

There is no non-constant polynormial f(x)f(x) with integer coefficient such that f(x)f(x) assume prime value at each integer xx .

pf. Suppose that f(x)f(x) is prime for all xZx \in \mathbb{Z} and ff is non-constant.Pick an integer aa , then f(a)=bf(a)=b and Lemma 3.11 for ba  ( ⁣ ⁣ ⁣modp)b \equiv a \; ( \! \! \! \mod p) we have f(a)f(b)0  ( ⁣ ⁣ ⁣modp)f(a) \equiv f(b) \equiv 0 \; (\! \! \! \mod p) . But pp is a prime , so f(a)=f(b)=pf(a)=f(b)=p in this we get infinitely many xx s. t. f(x)=pf(x) = p , then (x)p( x) - p has infinitely many zero-point. Obviously there does not exist such f(x)f(x) . ■

Ex. If a1=7a_1=7 , an=an1+gcd(n,an1)a_n = a_{n-1} + \gcd (n, a_{n-1} ) , then gcd(n,an1)\gcd (n , a_{n-1} ) can only be a prime or 11 .

THm 3.16

The linear congruence axb  ( ⁣ ⁣ ⁣modn)ax \equiv b \; (\! \! \! \mod n)
1 ) has a solution iff d=gcd(a,n)d= \gcd (a,n) divides bb ( dbd \mid b ) , then the general solution is given by x=x0+ntd      (tZ)x= x_0 + \frac{nt}{d} \; \; \;(t \in \mathbb{Z} ) .
2 ) Moreover, the slolution have exactly dd congreuence classes modn\mod n . The representatives are given by t=1,2,,d1t=1,2, \dots ,d-1 .

pf.
1 ) is almost a reformulation of THm 1.19 .
2 ) Suppose x=ntdx' = \frac{nt'}{d} is another solution, then there is x0+ntdx0+ntd  ( ⁣ ⁣ ⁣modn)    nn(tt)d    dttx_0+ \frac{nt}{d} \equiv x_0 + \frac{nt'}{d} \; (\! \! \! \mod n) \iff n \mid \frac{n(t-t')}{d} \iff d \mid t-t' so there are only dd congruence classes. ■

Corollary 3.17

If gcd(a,n)=1\gcd (a,n) =1 , then the linear congruence axb  ( ⁣ ⁣ ⁣modn)ax \equiv b \; (\! \! \! \mod n) has a unique class of solution.

Remark 3.18: This suggests thai if gcd(a,n)=1\gcd (a,n) =1 , then we can define division [b]/[a][b]/[a] in Z\mathbb{Z} as the unique class [x][x] such that [a][x]=[b][a][x]=[b] .
In particular, Zp\{0}\mathbb{Z}_p \backslash \{ 0\} forms a group.

Lemma 3.18

(a) If mm divides a,b,na,b,n and let (a,b,n)=(a,b,n)/m(a',b',n')=(a,b,n)/m , then axb  ( ⁣ ⁣ ⁣modn)ax \equiv b \; (\! \! \! \mod n) iff axb  ( ⁣ ⁣ ⁣modn)a' x \equiv b' \; (\! \! \! \mod n') .
(b) If gcd(a,n)=1\gcd (a,n) =1 , mm divides a,ba,b ,and let (a,b)=(a,b)/m(a',b')=(a,b)/m , then axb  ( ⁣ ⁣ ⁣modn)ax \equiv b \; (\! \! \! \mod n) iff axb  ( ⁣ ⁣ ⁣modn)a' x \equiv b' \; (\! \! \! \mod n') .

Algorithm 3.19

Solve axb  ( ⁣ ⁣ ⁣modn)ax \equiv b \; (\! \! \! \mod n) .
The goal is using Lemma 3.18 to reduce aa to 11 .

  • Step 1 : Calculate d=gcd(a,n)d= \gcd (a,n) (If dbd \nmid b , then no solution )
  • Step 2 : Now dd divides a,b,na,b,n ,use Lemma 3.18 (a) to replace the original equation by a new congruence axb  ( ⁣ ⁣ ⁣modn)a' x \equiv b' \; (\! \! \! \mod n') . (where (a,b,n)=(a,b,n)/m(a',b',n')=(a,b,n)/m )
  • Step 3 : Use Lemma 3.18 (b) to replace the previous one by a new congruence axb  ( ⁣ ⁣ ⁣modn)a'' x \equiv b'' \; (\! \! \! \mod n') (where (a,b)=(a,b)/m(a'',b'')=(a',b')/m )
  • Step 4 : If a=1a''=1 , then we have done , otherwise we need to find a kk such that gcd(a,b+kn)1\gcd (a'',b'' + kn) \neq 1 , replace bb'' by b+knb''+ kn , go back to Step 3 and repeat until a=1a=1 .

THm 4.1 (Chinese Remainder Theorem)

Let n1,n2,,nkn_1 ,n_2 , \dots , n_k be mutually coprime, and b1,b2,,bkb_1,b_2, \dots , b_k be any integer. Then the solution of the system of congruences xbimodni    (i=1,2,,k)x \equiv b_i \mod n_i \; \; (i=1,2, \dots ,k) form a single congreuence class modn\mod n , where n=i=1knin= \prod_{i=1}^{k} n_i .

pf. Let ci=nni    (i=1,2,,k)c_i= \frac{n}{n_i} \; \; (i=1,2, \dots ,k) , cic_i is coprime to nin_i . Then Corollary 3.17 implies that cix1modnic_i x \equiv 1 \mod n_i has a single class [di][d_i] of solution. Now let x0=i=1kbicidix_0=\sum_{i=1}^{k} b_i c_i d_i , claim x0x_0 is a particular solution (xbicidimodni  ,    cidi1modni    xbimodni)(x \equiv b_i c_i d_i \mod n_i \; , \; \; c_i d_i \equiv 1 \mod n_i \implies x \equiv b_i \mod n_i) .
If xx is another solution, then there is nixx0n_i \mid x-x_0 for each ii , then there is nxx0n \mid x-x_0 . ■

Corollary 4.2

Let n=p1e1p2e2pkekn=p_1^{e_1} p_2^{e_2} \dots p_k^{e_k} be a prime power factorization. Then for any a,bZa,b \in \mathbb{Z} , we have that abmodna \equiv b \mod n iff abmodpieia \equiv b \mod p_i^{e_i} for each i=1,2,,ki=1,2, \dots ,k .


abstract algebra

To better understand the following content, we interrupt the note with something about abstract algebra.
A diagresion on groups and rings.

Def

Produce of sets X×Y={  (x,y)xX,yY}X \times Y= \{ \; (x,y) \mid x \in X ,y \in Y \}
Suppose G1,G2G_1 ,G_2 are groups, define G1×G2G_1 \times G_2 be the set G1×G2G_1 \times G_2 with multiplication given by (g1,g2)(h1,h2)=(g1h1,g2h2)(g_1,g_2)*(h_1,h_2)=(g_1*h_1,g_2*h_2) .
And similarly for the rings.

Def (Homonorphism)

(Group Homonorphism) φ:GH\varphi: G \rightarrow H (preserve multiplication)
(Ring Homonorphism) φ:RS\varphi: R \rightarrow S (preserve multiplication and addition)

Remark: If RR has identity, then SS has identity and φ(IR)=IS\varphi(I_R)=I_S .
Easy Fact: A group homonorphism must preserve identity and inverse.

Def

The kernal of a group homonorphism φ:GH\varphi: G \rightarrow H is ker(φ)={gGφ(g)=eH}\ker( \varphi )= \{ g \in G \mid \varphi (g) = e_H\}

Lemma

A group homonorphism φ:GH\varphi: G \rightarrow H is injective iff ker(φ)={eG}\ker( \varphi )= \{ e_G \} .

pf. Suppose not injective, then g1g2\exists g_1 \neq g_2 s.t. φ(g1)=φ(g2)    φ(g1)φ(g2)1=eH=φ(g1)φ(g21)    φ(g1g21)=eH\varphi (g_1) = \varphi (g_2) \\ \iff \varphi (g_1) \varphi (g_2)^{-1} = e_H = \varphi(g_1) \varphi (g_2^{-1}) \\ \iff \varphi(g_1 * g_2^{-1}) = e_H
g1g2    g1g21eGker(φ)g_1 \neq g_2 \implies g_1 * g_2^{-1} \neq e_G \in \ker(\varphi) , creates contradiction. ■

Remark: More generally, ZmZn\mathbb{Z}_m \rightarrow \mathbb{Z}_n is well defined iff nmn \mid m . In this case, the map is a ring homonorphism.
More generally, if fi:RS  (i=1,2,,k)f_i: R \rightarrow S \; (i=1,2, \dots ,k) are ring homonorphism, then RS1×S2××SkR \rightarrow S_1 \times S_2 \times \dots \times S_k is ring homonorphism.

Def

Group homonorphism φ:GH\varphi: G \rightarrow H is called an isomorphism is φ1\exists \varphi^{-1} and it is a group homonorphism. Then GG and HH are equivalent naturally.

abstract algebra end


THm 4.6 (Reformulation of CRT)

Suppose that gcd(ni,nj)=1  (ij)\gcd (n_i,n_j)=1 \; ( \forall i \neq j) . Then the map φ:ZnZn1×Zn2××Znk\varphi : \mathbb{Z_n} \rightarrow \mathbb{ Z_{ n_1 } } \times \mathbb{ Z_{ n_2 } } \times \dots \times \mathbb{ Z_{ n_k } } is a ring isomorphism.

pf. The two rings have the same number of elements, so we only need injectivity.     ker(φ)=0\iff \ker ( \varphi ) = 0. That is, if φ([a]n)=0\varphi ([a]_n)=0 then each [a]ni=0    nia    na    [a]n=0[a]_{n_i}=0 \iff n_i \mid a \implies n \mid a \implies [a]_n = 0 in Zn    φ\mathbb{Z}_n \implies \varphi is injective. ■

Remark: This proof is shorter than no explicit solution to this system of congruence.

(Extension of CRT)

THm 4.7 (Extension to nonlinear cases)

Let fZ[x]f \in \mathbb{Z}_{[x]} , let A(n)={[a]Znf(a)0modn}A(n)= \{ [a] \in \mathbb{Z}_n \mid f(a) \equiv 0 \mod n \} . If n1,,nkn_1, \dots , n_k are mutually coprime, and n=i=1knin= \prod_{i=1}^{k} n_i , then the map A(n)A(n1)××A(nk)A(n) \rightarrow A(n_1) \times \dots \times A(n_k) is bijective.
In particular, A(n)=A(n1)××A(nk)|A(n)| = |A(n_1)| \times \dots \times |A(n_k)| .

pf. Since n1,,nkn_1 , \dots , n_k are mutually coprime, f(a)0modnf(a) \equiv 0 \mod n iff f(a)0modnif(a) \equiv 0 \mod n_i for i=1,2,,ni=1,2, \dots , n . Therefore the map φ\varphi in THm 4.6 is restricts to the class of solution for f(a)0modnf(a) \equiv 0 \mod n , which is still bijective. ■

THm 5.1 (Extension to non-coprime cases)

xbimodnix \equiv b_i \mod{n_i} (i=1,,k)()(i=1, \dots ,k) (*)

Let n1,,nkn_1, \dots , n_k be positive integers. Then the solutions of the system ()(*) has a solution iff gcd(ni,nj)\gcd{ (n_i,n_j) } divides bibjb_i-b_j whenever iji \neq j . In the case, the general solution forms a single congruence class mod(n)\mod{ (n) } where n=lcm(n1,,nk)n= \text{lcm} (n_1, \dots , n_k) .

pf. Set nij=gcd(n1,nj)n_{ij}= \gcd{ (n_1,n_j) } . If a solution xx exists, then nixbin_i \mid x-b_i , then nijbibjn_{ij} \mid b_i-b_j . Let x0x_0 be any solution, then for any solution xx we have nixx0n_i \mid x-x_0 for each ii , this is equivalent to nxx0n \mid x-x_0 .
We remain to show the condition nijbibjn_{ij} \mid b_i-b_j guarantee the existence of a solution. We can replace each congruence xbimodnix \equiv b_i \mod{n_i} by an equivalent set of congruence xbimodpex \equiv b_i \mod{p^e} , where pep^e ranges over all the prime power factorization of nin_i . We can apply the original CRT to this situation, there is only one congruence for each pp . Let ee be the highest power of pp in all nin_i 's. We use the condition that gcd(ni,nj)bibj\gcd{ (n_i,n_j) } \mid b_i-b_j to discard all congruence modpd\mod{p^d} for d<ed<e . ■
*Suppose that penip^e \parallel n_i and pdnjp^d \parallel n_j then pdnijbibjp^d \mid n_{ij} \mid b_i-b_j , so pexbi    pdxbjp^e \mid x-b_i \implies p^d \mid x-b_j , so xbjmodpdx \equiv b_j \mod{p^d} .

4. Congruence with a Prime-power Modulus

4.1 The arithmetic of Zp\mathbb{Z}_p

THm 5.3 (lagrange)

Let pp be a prime, and let f(x)adxd++a1x+a0f(x) \in a_d x^d + \dots + a_1 x +a_0 where paip \nmid a_i for some ii

4.2 Pseudoprimes and Carmicheal numbers

4.3 Solving congruences mod ( pep^e )

5. Euler's Function

5.1 Units

5.2 Eulae's Function

5.3 Application of Euler's Function

6. The Group of Units

6.1 The group UnU_n

6.2 Primitive roots

6.3 The group UpeU_{p^e} , where pp is an odd prime

6.4 The group U2eU_{2^e}

6.5 The existence of primitive roots

6.6 Applications of primitive roots

6.7 The algebraic structure of UnU_n

6.8 The universal exponent