Lean, informalized

Nielsen & Chuang · Chapter 5, The quantum Fourier transform and its applications · p. 233

Theorem 5.2 - How a square root of one modulo a number, other than plus or minus one, yields a factor of it

A nontrivial square root of one gives a factor.

Hover over a blue or green term in the text, or a node in the graph, to find it in the other. Select it to read its declaration both in Lean and in words.

The Exercise

One classical step of Shor’s factoring algorithm starts from a number xx whose square is 11 modulo NN, the number to be factored, while xx itself is neither 11 nor −1-1 modulo NN. Theorem 5.2 of the book says that such an xx yields a factor of NN other than 11 and NN: the greatest common divisor of NN with x−1x-1, or the one with x+1x+1.

Nontrivial Factors

A nontrivial factor dd of a natural number nn is a divisor of nn that lies strictly between 11 and nn: d∣n,1<d<n.d \mid n, \qquad 1 < d < n.(1)✦

The Claim

Theorem 1. Let NN and xx be natural numbers with N>0N > 0 and x≥1x \ge 1, such that x2≡1(mod⁡N)x^2 \equiv 1 \pmod N, x≢1(mod⁡N)x \not\equiv 1 \pmod N and x+1≢0(mod⁡N)x + 1 \not\equiv 0 \pmod N. Then at least one of the two numbers gcd⁡(x−1,N),gcd⁡(x+1,N)\gcd(x-1, N), \qquad \gcd(x+1, N)(2)✦ is a nontrivial factor of NN.

With x+1≢0x + 1 \not\equiv 0 read as x≢−1(mod⁡N)x \not\equiv -1 \pmod N, this is the exercise.

What Is Checked

The claim is stated over the natural numbers NN and xx, the greatest common divisor, congruence modulo NN, and the nontrivial factor of (1). What the library proves about these constructions is the claim (2) itself, for all NN and xx that meet its hypotheses.