1.3.3. Primitive roots for primes

This section is based on part of [BUR11, Sec. 8.2]. Its aim is to prove that all primes admit a primitive root (Theorem 1.3.3.7).

Lemma 1.3.3.1.

Let

f⁢(x)=a0+a1⁢x+a2⁢x2+⋯+an⁢xn,ai∈ℤ,n≥1,f(x)=a_{0}+a_{1}x+a_{2}x^{2}+\cdots+a_{n}x^{n},\qquad a_{i}\in\mathbb{Z},\ n% \geq 1,

be a polynomial of degree nn with integer coefficients. Then, for b∈ℤ{b\in\mathbb{Z}},

f⁢(x)=(x−b)⁢q⁢(x)+f⁢(b),f(x)=(x-b)q(x)+f(b),

where q⁢(x)q(x) is a polynomial of degree n−1{n-1} with integer coefficients and leading coefficient ana_{n}.

Proof.

Indeed,

f⁢(x)−f⁢(b)\displaystyle f(x)-f(b) =(a0+a1⁢x+a2⁢x2+⋯+an⁢xn)−(a0+a1⁢b+a2⁢b2+⋯+an⁢bn)\displaystyle=(a_{0}+a_{1}x+a_{2}x^{2}+\cdots+a_{n}x^{n})-(a_{0}+a_{1}b+a_{2}b% ^{2}+\cdots+a_{n}b^{n})
=a1⁢(x−b)+a2⁢(x2−b2)+⋯+an⁢(xn−bn).\displaystyle=a_{1}(x-b)+a_{2}(x^{2}-b^{2})+\cdots+a_{n}(x^{n}-b^{n}).

Finally, for 1≤k≤n{1\leq k\leq n} we have the standard identity

xk−bk=(x−b)⁢(xk−1+xk−2⁢b+⋯+x⁢bk−2+bk−1).x^{k}-b^{k}=(x-b)(x^{k-1}+x^{k-2}b+\cdots+xb^{k-2}+b^{k-1}).

Therefore,

f⁢(x)−f⁢(b)=q⁢(x)⁢(x−b)f(x)-f(b)=q(x)(x-b)

for some polynomial q⁢(x)q(x) of degree n−1{n-1} with integer coefficients and leading coefficient ana_{n}. This finishes the proof. ∎

Theorem 1.3.2.5 relates to the existence of solutions to the congruence

xn≡b(modp),x^{n}\equiv b{\pmod{p}},

where pp is an odd prime. In order to prove that every odd prime admits a primitive root, we make use of the following statement concerning the number of (integer) solutions to a polynomial congruence.

Theorem 1.3.3.2 (Lagrange).

Let pp be a prime and

f⁢(x)=a0+a1⁢x+a2⁢x2+⋯+an⁢xn,ai∈ℤ,n≥0,f(x)=a_{0}+a_{1}x+a_{2}x^{2}+\cdots+a_{n}x^{n},\qquad a_{i}\in\mathbb{Z},\ n% \geq 0,

be a polynomial with integer coefficients and degree nn. Suppose that an≢0(modp){a_{n}\not\equiv 0\pmod{p}}, that is, the leading coefficient of ff is not divisible by pp. Then the congruence

f⁢(x)≡0(modp)f(x)\equiv 0\pmod{p}

admits at most nn pairwise non-congruent solutions modulo pp.

Proof.

The claim is trivial if n=0{n=0}: in this case, f⁢(x)=a0∈ℤ{f(x)=a_{0}\in\mathbb{Z}} is constant and the congruence a0≡0(modp){a_{0}\equiv 0\pmod{p}} is false by assumption. Therefore, we may assume that n≥1{n\geq 1}.

We prove the claim by induction on the degree n≥1{n\geq 1} of ff. For n=1{n=1}, Proposition 1.2.1.6(4) implies that the solutions of the congruence a1⁢x+a0≡0(modp){a_{1}x+a_{0}\equiv 0\pmod{p}} equal the solutions of the congruence a1⁢x≡−a0(modp){a_{1}x\equiv-a_{0}\pmod{p}}. Since a1≢0(modp){a_{1}\not\equiv 0\pmod{p}}, Corollary 1.2.2.6 implies that the latter congruence has a unique solution modulo pp.

Let n≥1{n\geq 1} and suppose that the claim holds for all polynomials of degree nn whose leading coefficient is not divisible by pp. Consider a polynomial

f⁢(x)=a0+a1⁢x+a2⁢x2+⋯+an⁢xn+an+1⁢xn+1,ai∈ℤ,f(x)=a_{0}+a_{1}x+a_{2}x^{2}+\cdots+a_{n}x^{n}+a_{n+1}x^{n+1},\qquad a_{i}\in% \mathbb{Z},

such that an+1≢0(modp){a_{n+1}\not\equiv 0\pmod{p}}. The claim holds trivially if the congruence

f⁢(x)≡0(modp)f(x)\equiv 0\pmod{p}

admits no solutions. Suppose then that there exists a∈ℤ{a\in\mathbb{Z}} such that

f⁢(a)≡0(modp).f(a)\equiv 0\pmod{p}.

By Lemma 1.3.3.1,

f⁢(x)=q⁢(x)⁢(x−a)+f⁢(a)f(x)=q(x)(x-a)+f(a)

for some polynomial q⁢(x)q(x) of degree nn with integer coefficients and leading coefficient an+1a_{n+1}. Consequently,

f⁢(x)≡(x−a)⁢q⁢(x)(modp).f(x)\equiv(x-a)q(x)\pmod{p}.

Suppose that b∈ℤ{b\in\mathbb{Z}} is a solution of the congruence f⁢(x)≡0(modp){f(x)\equiv 0\pmod{p}} such that b≢a(modp){b\not\equiv a\pmod{p}}. Then

f⁢(b)≡0(modp)andf⁢(b)≡(b−a)⁢q⁢(b)(modp).f(b)\equiv 0\pmod{p}\qquad\text{and}\qquad f(b)\equiv(b-a)q(b)\pmod{p}.

Proposition 1.2.1.6(2) and Proposition 1.2.1.6(3) imply that

(b−a)⁢q⁢(b)≡0(modp).(b-a)q(b)\equiv 0\pmod{p}.

Equivalently, p∣(b−a)⁢q⁢(b){p\mid(b-a)q(b)}. Since pp is prime and p∤(b−a){p\nmid(b-a)} by assumption, Euclid’s Lemma (Theorem 1.1.4.2) implies that p∣q⁢(b){p\mid q(b)}. Thus,

q⁢(b)≡0(modp)q(b)\equiv 0\pmod{p}

and bb is a solution of the congruence q⁢(x)≡0(modp){q(x)\equiv 0\pmod{p}}. Since the leading coefficient of q⁢(x)q(x) is an+1a_{n+1} and an+1≢0(modp){a_{n+1}\not\equiv 0\pmod{p}}, the induction hypothesis implies that the congruence q⁢(x)≡0(modp){q(x)\equiv 0\pmod{p}} admits at most nn solutions that are pairwise non-congruent modulo pp. This shows that the congruence f⁢(x)≡0(modp){f(x)\equiv 0\pmod{p}} admits at most n+1{n+1} pairwise non-congruent solutions modulo pp. ∎

Warning 1.3.3.3.

Lagrange’s Theorem (Theorem 1.3.3.2) is false for composite moduli. Let nn be composite and write n=k⁢ℓ{n=k\ell} with k,ℓ>1{k,\ell>1}. The linear congruence k⁢x≡0(modn){kx\equiv 0\pmod{n}} admits the solutions 0 and ℓ\ell, and ℓ≢0(modn){\ell\not\equiv 0\pmod{n}}.

Remark 1.3.3.4.

Not covered in the lectureLagrange’s Theorem (Theorem 1.3.3.2) has the following familiar analogue, studied in the Analysis and Linear Algebra lectures: let f:ℝ→ℝ{f\colon\mathbb{R}\to\mathbb{R}} be a polynomial function of degree n≥0{n\geq 0}. Then ff has at most nn distinct roots; that is, the equation f⁢(x)=0{f(x)=0} has at most nn distinct solutions.

Corollary 1.3.3.5.

Let pp be a prime and d≥1{d\geq 1} an integer such that d∣p−1{d\mid p-1}. Then the congruence

xd≡1(modp)x^{d}\equiv 1\pmod{p}

has exactly dd pairwise non-congruent solutions modulo pp.

Proof.

By Lagrange’s Theorem (Theorem 1.3.3.2), the congruence

xd≡1(modp)x^{d}\equiv 1\pmod{p}

has at most dd pairwise non-congruent solutions modulo pp. Therefore, it is enough to prove that the congruence has at least dd pairwise non-congruent solutions modulo pp. Since d∣p−1{d\mid p-1} by assumption, there exists k∈ℤ{k\in\mathbb{Z}} such that p−1=k⁢d{p-1=kd}; since p−1≥1{p-1\geq 1} and d≥1{d\geq 1}, we have k≥1{k\geq 1}. Then

xp−1−1=xk⁢d−1=(xd−1)⁢(1+xd+x2⁢d+⋯+x(k−1)⁢d).x^{p-1}-1=x^{kd}-1=(x^{d}-1)(1+x^{d}+x^{2d}+\cdots+x^{(k-1)d}).

Set

f⁢(x)≔∑j=0k−1xj⁢d=(1+xd+x2⁢d+⋯+x(k−1)⁢d).f(x)\coloneqq\sum_{j=0}^{k-1}x^{jd}=(1+x^{d}+x^{2d}+\cdots+x^{(k-1)d}).

By Lagrange’s Theorem (Theorem 1.3.3.2), the congruence f⁢(x)≡0(modp){f(x)\equiv 0\pmod{p}} has at most

(k−1)⁢d=k⁢d−d=(p−1)−d(k-1)d=kd-d=(p-1)-d

pairwise non-congruent solutions modulo pp. On the other hand, Fermat’s Little Theorem (Corollary 1.2.3.2) implies that the congruence xp−1−1≡0(modp){x^{p-1}-1\equiv 0\pmod{p}} has the p−1{p-1} solutions 1,2,…,p−1{1,2,\ldots,p-1} that are clearly pairwise non-congruent modulo pp.

Let a∈ℤ{a\in\mathbb{Z}} be a solution to the congruence xp−1−1≡0(modp){x^{p-1}-1\equiv 0\pmod{p}}. Since

ap−1−1=(ad−1)⁢f⁢(a)a^{p-1}-1=(a^{d}-1)f(a)

and ap−1−1≡0(modp){a^{p-1}-1\equiv 0\pmod{p}} by assumption, Euclid’s Lemma (Theorem 1.1.4.2) implies that p∣(ad−1){p\mid(a^{d}-1)} or p∣f⁢(a){p\mid f(a)} (possibly both). Thus, every solution to the congruence xp−1−1≡0(modp){x^{p-1}-1\equiv 0\pmod{p}} that is not a solution of f⁢(x)≡0(modp){f(x)\equiv 0\pmod{p}} is a solution to xd≡1(modp){x^{d}\equiv 1\pmod{p}}.

This shows that the congruence xd−1≡0(modp){x^{d}-1\equiv 0\pmod{p}} must have at least

(p−1)−(p−1−d)=d(p-1)-(p-1-d)=d

pairwise non-congruent solutions modulo pp, namely those solutions to the congruence xp−1−1≡0(modp){x^{p-1}-1\equiv 0\pmod{p}} that are not one of the at most p−1−d{p-1-d} solutions of the congruence f⁢(x)≡0(modp){f(x)\equiv 0\pmod{p}}. ∎

We are ready to prove that all odd primes admit a primitive root. In fact, we have the following more general statement.

Theorem 1.3.3.6.

Let pp be a prime and d≥1{d\geq 1} an integer such that d∣p−1{d\mid p-1}. Then there are exactly φ⁢(d)\varphi(d) pairwise non-congruent integers with order dd modulo pp.

Proof.

We introduce the number-theoretic function

ψ≔c⟼#⁢{a∈ℤ:1≤a<p⁢ and ⁢ordp⁡(a)=c}.\psi\coloneqq c\longmapsto\#\{a\in\mathbb{Z}\colon{1\leq a<p\text{ and }% \operatorname{ord}_{p}(a)=c}\}.

Corollary 1.3.1.6 implies that ψ⁢(c)=0{\psi(c)=0} if c∤p−1{c\nmid p-1}.

We need to prove that ψ⁢(d)=φ⁢(d){\psi(d)=\varphi(d)}. We claim that

d=∑c∣dψ⁢(c).d=\sum_{c\mid d}\psi(c).

By Corollary 1.3.3.5,

d=#⁢{a∈ℤ:1≤a<p⁢ and ⁢ad≡1(modp)}.d=\#\{a\in\mathbb{Z}\colon{1\leq a<p\text{ and }a^{d}\equiv 1\pmod{p}}\}.

Moreover, Theorem 1.3.1.5 implies that

{a∈ℤ:1≤a<p⁢ and ⁢ad≡1(modp)}=∐c∣d{a∈ℤ:1≤a<p⁢ and ⁢ordp⁡(a)=c}.\{a\in\mathbb{Z}\colon{1\leq a<p\text{ and }a^{d}\equiv 1\pmod{p}}\}\\ =\coprod_{c\mid d}\{a\in\mathbb{Z}\colon{1\leq a<p\text{ and }\operatorname{% ord}_{p}(a)=c}\}.

Consequently,

d=∑c∣dψ⁢(c).d=\sum_{c\mid d}\psi(c).

Finally, set

F⁢(e)≔∑c∣eψ⁢(c).F(e)\coloneqq\sum_{c\mid e}\psi(c).

By the preceding claim, applied to ee in place of dd, F⁢(e)=e{F(e)=e} if e∣p−1{e\mid p-1}. The Möbius Inversion Formula (Theorem 1.1.6.7) applied to FF then yields

ψ⁢(d)=∑c∣dμ⁢(c)⁢F⁢(dc)=∑c∣dμ⁢(c)⁢dc=d⁢∑c∣dμ⁢(c)c=φ⁢(d).\psi(d)=\sum_{c\mid d}\mu(c)F(\tfrac{d}{c})=\sum_{c\mid d}\mu(c)\frac{d}{c}=d% \sum_{c\mid d}\frac{\mu(c)}{c}=\varphi(d).

The second equality uses that d/cd/c divides p−1{p-1} (since dd divides p−1{p-1}), and the last equality is Theorem 1.2.5.12. This finishes the proof. ∎

Theorem 1.3.3.7.

Let pp be a prime. Then, considered modulo pp, there are exactly φ⁢(p−1){\varphi(p-1)} pairwise non-congruent primitive roots of pp.

Proof.

This is the case d=p−1{d=p-1} of Theorem 1.3.3.6. ∎

Warning 1.3.3.8.

Not covered in the lectureIn the proof of Theorem 1.3.3.6, notice that ψ≠φ{\psi\neq\varphi}. Indeed, φ\varphi never takes the value 0, while ψ⁢(c)=0{\psi(c)=0} if c∤p−1{c\nmid p-1}. For example,

ψ⁢(p)=0≠p−1=φ⁢(p).\psi(p)=0\neq p-1=\varphi(p).

The proof only shows that φ⁢(d)=ψ⁢(d){\varphi(d)=\psi(d)} if d∣p−1{d\mid p-1}.

End of Lecture 11