from wikipedia:
In modular arithmetic, a number g is a primitive root modulo n if every number a coprime to n is congruent to a power of g modulo n. That is, g is a primitive root modulo n, if for every integer a coprime to n, there is some integer k for which gk ≡ a (mod n). Such a value k is called the index or discrete logarithm of a to the base g modulo n. Note that g is a primitive root modulo n if and only if g is a generator of the multiplicative group of integers modulo n.
This is part II of the explanation of primitive root, directly following the previous part which introduces some prelimanary concepts and how we can identify primitive root, as well as the proof for the order of magnitude of them. We shall proceed with the proof for existence of primitive root.
Finding Primitive Root
Theorem 3
Z n \mathbb{Z}_n Zn has primitive root if and only if n = 2 , 4 , p k , a n d 2 p k n = 2, 4, p^k,and\space 2p^k n=2,4,pk,and 2pk where p p p is an odd prime.
1 is the primitive root modulo 2, while 3 is the primitive root modulo 4. Let’s proceed with odd primes.
Theorem 3.1
For odd prime p p p, Z p \mathbb{Z}_p Zp has primitive root.
To prove this, consider any 2 integer a , b a,b a,b that is coprime with p p p.
Start with the prime factorisation for ϵ m ( a ) , ϵ m ( b ) , \epsilon_m(a),\epsilon_m(b), ϵm(a),ϵm(b),
ϵ m ( a ) = ∏ i = 1 n p i α i , ϵ m ( b ) = ∏ i = 1 n p i β i \epsilon_m(a)=\prod_{i=1}^n{p_i^{\alpha_i}},\epsilon_m(b)=\prod_{i=1}^n{p_i^{\beta_i}} ϵm(a)=i=1∏npiαi,ϵm(b)=i=1∏npiβi
then let
a
1
=
∏
p
i
α
i
,
a
2
=
ϵ
m
(
a
)
a
1
,
w
h
e
r
e
α
i
>
β
i
a_1=\prod{p_i^{\alpha_i}},a_2=\dfrac {\epsilon_m(a)}{a_1} ,where \space{\alpha_i>\beta_i}
a1=∏piαi,a2=a1ϵm(a),where αi>βi
and
b
1
=
∏
p
i
β
i
,
b
2
=
ϵ
m
(
b
)
b
1
,
w
h
e
r
e
α
i
<
β
i
b_1=\prod{p_i^{\beta_i}},b_2=\dfrac {\epsilon_m(b)}{b_1},where \space{\alpha_i<\beta_i}
b1=∏piβi,b2=b1ϵm(b),where αi<βi
From Theorem 4.1 we have
ϵ m ( a a 1 ) = ϵ m ( a ) gcd ( ϵ m ( a ) , a 1 ) = a 1 a 2 a 1 = a 2 \epsilon_m\left(a^{a_1}\right)=\frac{\epsilon_m(a)}{\gcd\big(\epsilon_m(a),a_1\big)}=\frac {a_1a_2}{a_1}=a_2 ϵm(aa1)=gcd(ϵm(a),a1)ϵm(a)=a1a1a2=a2
and
ϵ m ( b b 2 ) = ϵ m ( b ) gcd ( ϵ m ( b ) , b 2 ) = b 1 b 2 b 2 = b 1 \epsilon_m\left(b^{b_2}\right)=\frac{\epsilon_m(b)}{\gcd\big(\epsilon_m(b),b_2\big)}=\frac {b_1b_2}{b_2}=b_1 ϵm(bb2)=gcd(ϵm(b),b2)ϵm(b)=b2b1b2=b1
Since
gcd
(
a
2
,
b
1
)
=
1
\gcd(a_2,b_1)=1
gcd(a2,b1)=1(notice how we split the factors),from the multiplicability of primitive root
ϵ
m
(
a
a
1
b
b
1
)
=
ϵ
m
(
a
a
1
)
ϵ
m
(
b
b
2
)
=
a
1
b
2
=
lcm
(
ϵ
p
(
a
)
,
ϵ
p
(
b
)
)
\begin{aligned} \epsilon_m\left(a^{a_1}b^{b_1}\right)=& \epsilon_m\left(a^{a_1}\right)\epsilon_m\left(b^{b_2}\right)\\ =&a_1b_2\\ =&\operatorname{lcm}\big(\epsilon_p(a),\epsilon_p(b)\big) \end{aligned}
ϵm(aa1bb1)===ϵm(aa1)ϵm(bb2)a1b2lcm(ϵp(a),ϵp(b))
Thus, there exist integer
k
k
k such that
ϵ
p
(
k
)
=
lcm
(
ϵ
p
(
a
)
,
ϵ
p
(
b
)
)
\epsilon_p(k)=\operatorname{lcm}\big(\epsilon_p(a),\epsilon_p(b)\big)
ϵp(k)=lcm(ϵp(a),ϵp(b))
Since all integers from 1 to
p
p
p-1 is coprime to
p
p
p, then there exist integer
j
j
j
such that
ϵ
p
(
j
)
=
lcm
(
ϵ
p
(
i
)
,
i
∈
[
1
,
p
−
1
]
)
\epsilon_p(j)=\operatorname{lcm}\big(\epsilon_p(i),i\in[1,p-1]\big)
ϵp(j)=lcm(ϵp(i),i∈[1,p−1])
Thus, ϵ p ( i ) ∣ ϵ p ( j ) ( i ∈ [ 1 , p − 1 ] ) \epsilon_p(i)\mid\epsilon_p(j)\space(i\in[1,p-1]) ϵp(i)∣ϵp(j) (i∈[1,p−1]),and i ∈ [ 1 , p − 1 ] i\in[1,p-1] i∈[1,p−1] are roots to the equations x ϵ p ( j ) ≡ 1 ( m o d p ) x^{\epsilon_p(j)}\equiv 1\pmod p xϵp(j)≡1(modp)
From Lagrange’s theorem (number theory), ϵ p ( j ) ≥ p − 1 \epsilon_p(j) \geq p-1 ϵp(j)≥p−1
From Fermat’s little theorem, j p − 1 ≡ 1 ( m o d p ) , h e n c e ϵ p ( j ) ≤ p − 1 j^{p-1}\equiv1\pmod p,\\hence\space\epsilon_p(j) \leq p-1 jp−1≡1(modp),hence ϵp(j)≤p−1,and ϵ p ( j ) = p − 1 = φ ( p ) \epsilon_p(j)=p-1=\varphi(p) ϵp(j)=p−1=φ(p).
Hence, j j j is a primitive root modulo p p p .
Theorem 3.2
For odd prime p p p, α ∈ N ∗ \alpha \in \mathbb{N}^{*} α∈N∗, Z p α \mathbb{Z}_{p^\alpha} Zpα has primitive root.
To prove this, suppose odd prime
p
p
p has primitive root
r
r
r, notice that
ϵ
p
(
r
)
=
φ
(
p
)
=
p
−
1
\epsilon_p(r)=\varphi(p)=p-1
ϵp(r)=φ(p)=p−1
Let
k
=
ϵ
p
2
(
r
)
k=\epsilon_{p^2}(r)
k=ϵp2(r), thus
r
k
≡
1
(
m
o
d
p
2
)
a
n
d
r
k
≡
1
(
m
o
d
p
)
s
i
n
c
e
g
c
d
(
r
k
,
p
2
)
=
1
r^k\equiv1\pmod {p^2}\\ and\space r^k\equiv1\pmod{p}\\ since\space gcd(r^k,p^2)=1
rk≡1(modp2)and rk≡1(modp)since gcd(rk,p2)=1
From Theorem 1.2,we have
ϵ
p
(
r
)
=
φ
(
p
)
=
p
−
1
∣
k
\epsilon_p(r)=\varphi(p)=p-1|k
ϵp(r)=φ(p)=p−1∣k and
k
∣
φ
(
p
2
)
=
p
(
p
−
1
)
k|\varphi(p^2)=p(p-1)
k∣φ(p2)=p(p−1)
Hence, k = p ( p − 1 ) k=p(p-1) k=p(p−1) or p − 1 p-1 p−1.
When k = p ( p − 1 ) k=p(p-1) k=p(p−1), since φ ( p 2 ) = p ( p − 1 ) \varphi(p^2)=p(p-1) φ(p2)=p(p−1), k k k is the primitive root of p 2 p^2 p2.
When k = p − 1 k=p-1 k=p−1, take m = p + r m=p+r m=p+r which is also a primitive root of r r r,
Similar to r r r, let l = ϵ p 2 ( m ) l=\epsilon_{p^2}(m) l=ϵp2(m), then l = p ( p − 1 ) l=p(p-1) l=p(p−1) or p − 1 p-1 p−1.
However, note that
m
p
−
1
≡
(
p
+
r
)
p
−
1
≡
p
∗
r
p
−
2
+
r
p
−
1
≡
p
∗
r
p
−
2
+
1
(
m
o
d
p
2
)
\begin{aligned} m^{p-1}\equiv&(p+r)^{p-1}\\ \equiv&p*r^{p-2}+r^{p-1}\\ \equiv&p*r^{p-2}+1\pmod{p^2} \end{aligned}
mp−1≡≡≡(p+r)p−1p∗rp−2+rp−1p∗rp−2+1(modp2)
since
p
∤
r
p
−
2
,
p
2
∤
p
r
p
−
2
p\not|r^{p-2}, p^2\not|pr^{p-2}
p∣rp−2,p2∣prp−2, and
m
p
−
1
≢
1
(
m
o
d
p
2
)
m^{p-1}\not\equiv1\pmod{p^2}
mp−1≡1(modp2).
Hence, l = p ( p − 1 ) l=p(p-1) l=p(p−1) and thus m m m a primitive root of p 2 p^2 p2.
We can prove by induction that p α p^\alpha pα has a primitive root for all α ∈ N ∗ \alpha\in\mathbb{N^*} α∈N∗ using a similar argument.
m = 2 p α m=2p^{\alpha} m=2pα,其中 p p p 为奇素数, α ∈ N ∗ \alpha\in\mathbb{N}^* α∈N∗。
Theorem 3.3
For odd prime p p p, α ∈ N ∗ \alpha \in \mathbb{N}^{*} α∈N∗, Z 2 p α \mathbb{Z}_{2p^\alpha} Z2pα has primitive root.
To prove this, let s s s be a primitive root modulus p α p^\alpha pα, then s + p α s+p^\alpha s+pα is another primitive modulus p α p^\alpha pα.
Note that exactly one of the two is odd, suppose it is s 0 s_0 s0, then gcd ( s 0 , 2 p α ) = 1 \gcd(s_0,2p^\alpha)=1 gcd(s0,2pα)=1
Since s 0 ϵ 2 p α ( s 0 ) ≡ 1 ( m o d 2 p α ) , s 0 ϵ 2 p α ( s 0 ) ≡ 1 ( m o d p α ) {s_0}^{\epsilon_{2p^\alpha}(s_0)}\equiv1\pmod{2p^\alpha},\space{s_0}^{\epsilon_{2p^\alpha}(s_0)}\equiv1\pmod{p^\alpha} s0ϵ2pα(s0)≡1(mod2pα), s0ϵ2pα(s0)≡1(modpα)
From Theorem 1.2, φ ( 2 p α ) ∣ ϵ 2 p α ( s 0 ) \varphi(2p^\alpha)|\epsilon_{2p^\alpha}(s_0) φ(2pα)∣ϵ2pα(s0),
Again from Theorem 1.2, ϵ 2 p α ( s 0 ) ∣ φ ( 2 p α ) \epsilon_{2p^\alpha}(s_0)|\varphi(2p^\alpha) ϵ2pα(s0)∣φ(2pα),
Thus, ϵ 2 p α ( s 0 ) = φ ( 2 p α ) \epsilon_{2p^\alpha}(s_0)=\varphi(2p^\alpha) ϵ2pα(s0)=φ(2pα), s 0 s_0 s0 is a primitive root modulus 2 p α 2p^\alpha 2pα