taocp

This site has no text of the book. Keep your own copy of TAOCP next to it. See what is checked.

Exercise · Volume 1 · 1.2.4-26

Exercise 1.2.4-26

proved in Lean solution written

RatingM15
MarkersM (mathematical)
KindK1, prove: show that a stated fact is true from the written solution
SectionSection 1.2.4 of Volume 1. Companion chapter: Integer functions and elementary number theory

The task

For an odd prime pp and any integer aa, show that b=a(p−1)/2b = a^{(p-1)/2} leaves the remainder 00, 11 or p−1p - 1 modulo pp.

The exact wording is in your copy of the book.

Hints

Open one hint at a time. Try the exercise again after each.

Hint 1

Square bb and use the previous exercise. Then factor b2−1b^2 - 1.

Hint 2

A prime that divides a product divides one of the factors (Exercise 1.2.4-21).

Solution

Show the solution

Since pp is odd, (p−1)/2≥1(p-1)/2 \ge 1 is an integer, and b2=ap−1b^2 = a^{p-1}.

Case p∣ap \mid a. Then p∣bp \mid b since bb has the factor aa at least once. So b mod p=0b \bmod p = 0.

Case p∤ap \nmid a. By Exercise 1.2.4-25, b2=ap−1≡1(modp)b^2 = a^{p-1} \equiv 1 \pmod p. So pp divides b2−1=(b−1)(b+1)b^2 - 1 = (b - 1)(b + 1). By Euclid's lemma (Exercise 1.2.4-21), p∣b−1p \mid b - 1 or p∣b+1p \mid b + 1. In the first case b≡1b \equiv 1 and b mod p=1b \bmod p = 1. In the second case b≡−1≡p−1b \equiv -1 \equiv p - 1, and 0≤p−1<p0 \le p - 1 < p, so b mod p=p−1b \bmod p = p - 1. □\square

Check

The values of a(p−1)/2 mod pa^{(p-1)/2} \bmod p for a=0,…,p−1a = 0, \ldots, p - 1 are, for p=7p = 7: 0,1,1,6,1,6,60, 1, 1, 6, 1, 6, 6. For p=11p = 11 the set of values is {0,1,10}\{0, 1, 10\}, and for p=13p = 13 it is {0,1,12}\{0, 1, 12\}.

Remarks

The value is 11 when aa is a square modulo pp and p−1p - 1 when it is not. This is Euler's criterion, the base of the Legendre symbol. The case p=2p = 2 is excluded: (p−1)/2(p-1)/2 is not an integer.

This solution is checked, and a person has not reviewed it yet. The source.

In Lean

proved The statement and its proof are in Lean. The kernel accepts the proof, and it uses the standard axioms only.

The status is computed from the Lean build. The node of the map.

Something is wrong? Report it.