Use the positive-exponent quantum Fourier transform convention . The period of a function here is the least positive translation leaving the function unchanged on the cyclic group . The injective promise means exactly when . In particular : the subgroup of period translations is generated by , and wrapping the argument by preserves its value. This is exact quantum period finding on a finite cyclic group, rather than the truncated, nondividing-period version requiring continued fractions.
Prepare a uniform superposition state in the first quantum register using , and perform a reversible computation of the function into a second quantum register, cleaning its workspace by uncomputation:
A quantum measurement in the computational basis of the second quantum register leaves a periodic coset state in the first:
For the quantum Fourier transform of this periodic coset state, the finite geometric series vanishes unless the measured label is . On those labels its normalized amplitude is . Thus has the uniform distribution on a finite set on , irrespective of .
Compute the greatest common divisor by the Euclidean algorithm, and set , with . Since ,
The exact period recovery from a Fourier sample is therefore certified by testing . Every candidate divides and lies between and , so the injective promise makes that equality equivalent to . This includes , where the test uses input , and , which always succeeds. The test does not assert that an arbitrary equality of function values certifies an arbitrary period; the Fourier-derived divisor restriction is essential.
The concise result is
Here is the Euler totient function, with . The totient lower bound from the Mertens product gives for . Each trial uses polynomial time quantum Fourier transforms, function evaluations and Euclidean algorithm arithmetic in . Repeating independent trials gives constant success probability; the herald accepts only correct answers.
The printed asymptotic bound has the wrong direction for this argument. In Big O notation, the stated upper bound on the number of coprime integers supplies no success lower bound and is itself false uniformly: for prime , , not . Likewise the single-trial success need not be , since it tends to one for prime. The meaningful corrected guarantee is the lower bound above. If an upper-bounded success rate is literally required, one may deliberately retain an accepted result with an independent probability proportional to ; this discards useful successes and is unnecessary for efficient recovery.
A finite field extension is a separable field extension if every element of has a minimal polynomial over with distinct roots in an algebraic closure. The primitive element theorem says that a finite separable field extension is for some .
If is finite, then so is . The multiplicative group of a finite field is cyclic, so a generator of generates as a field. To justify the group fact, a finite subgroup of a field's multiplicative group is cyclic: in a finite abelian group its exponent is attained as an element order, while the polynomial root bound forces its size to be at most that exponent.
If is infinite, first consider . The minimal polynomials of and have distinct roots in an algebraic closure. Choose , , avoiding the finitely many values for which for a pair other than . Set . Over , the polynomials and have precisely one common root, . Their monic greatest common divisor is therefore , so and . Thus . Induct over finitely many generators of the finite separable field extension. This proves every finite separable extension is simple.
The Euclidean algorithm repeatedly replaces a pair by without changing its greatest common divisor. Reversing the divisions expresses as an integer linear combination , which is Bézout's identity.
Here , and therefore
One solution is . It is not unique: for every , is another solution.
By the prime ideal quotient criterion,
For a principal ideal, this is precisely the assertion that is a prime element. This closes the cycle and proves that (i)--(v) are equivalent.
Now let be a surjective ring homomorphism, where is a principal ideal domain and is an integral domain. Write
If , the first isomorphism theorem for rings makes an isomorphism. Otherwise
is an integral domain, so the equivalences just proved show that is maximal and is a field.
Next suppose that the polynomial ring is a principal ideal domain. It follows first that is an integral domain. For nonzero , the ideal
is principal. Since divides the nonzero constant , it is constant; since it also divides , that constant divides the coefficient , so is a unit. Therefore , and there are polynomials such that
Setting gives , so every nonzero is a unit. Hence
Finally, let be an integral domain in which every two nonzero elements have a greatest common divisor. If an irreducible divides , then is either a unit or an associate of . In the second case . In the first case, the Euclid lemma in a greatest-common-divisor domain gives . Thus every irreducible element of is prime.
At any division step , an integer divides both exactly when it divides both : one direction uses , and the other uses . Hence
Starting with , , the Euclidean division produces
The nonzero remainders form a strictly decreasing sequence of positive integers. Such a sequence must terminate, since there are only finitely many positive integers below . Suppose is the last nonzero remainder, so . The unchanged greatest common divisor at each step gives
The final equality holds because the positive common divisors of and are precisely the positive divisors of . This proves both termination and correctness of the Euclidean algorithm.
First recall why the two-variable Bézout's identity follows from the Euclidean algorithm. The initial values are integer linear combinations of . At every subsequent step, is again an integer linear combination of . Therefore the last nonzero remainder, which is their greatest common divisor, has that form.
Put . The preceding argument supplies integers with . Applying the same argument to gives integers such that
An integer divides exactly when it divides : if it divides , it divides , while itself divides both . Hence . Substituting the expression for proves
Thus
are integers satisfying . This also explains how to construct the coefficients using two applications of the Euclidean algorithm.
The euclidean algorithm computes the greatest common divisor of two integers by repeated division with remainder. Start with , , interchanging them if necessary, and repeatedly write
until a zero remainder occurs. The positive remainders strictly decrease, so the process terminates. At each step the common divisors of are exactly the common divisors of , because . Hence
If one input is zero, the answer is the absolute value of the other; the usual convention sets . Back-substitution also expresses the greatest common divisor as an integer linear combination of the inputs, as in Bézout's identity.
The greatest common divisor of and is , which divides . Divide the linear Diophantine equation by to obtain
Reducing modulo gives , so . Substitution gives the complete family of integer solutions
Every such pair satisfies the equation, and every solution must have this residue for , so none are omitted. Positivity requires and . For integer these are exactly . Thus the pairs with both entries positive are
Let be any positive integer. If divides and , it divides the integer linear combination . Conversely, if divides and , it divides . Thus and have exactly the same positive common divisors. Their greatest elements coincide:
This greatest common divisor invariance is the step behind the Euclidean algorithm; it does not require , although that additional bound ensures the algorithm terminates. If the convention permits , the same argument works and for .
The successive division with remainder steps of the Euclidean algorithm are
Each step preserves the greatest common divisor by part (a). The final nonzero remainder is , so
Write and . Divisibility is exactly comparison of prime exponents. Thus the greatest common divisor uses and the least common multiple uses . Since their sum is for each prime,
A return path with upward steps and downward steps satisfies . Since are coprime, this is equivalent to and for an integer . Its length is therefore .
Conversely, for each such , any ordering of upward and downward steps is an allowed positive-probability return path. The possible strictly positive return times are exactly the positive multiples of . By the definition of the period of a state in a Markov chain as their greatest common divisor,
In particular, none of the states is aperiodic.
The input size of an integer factorization problem is its number of bits . Trial division up to is exponential in ; advanced classical algorithms do substantially better, but no general polynomial-time classical factoring algorithm is known. The heuristic general-purpose general number field sieve has subexponential rather than polynomial scaling, roughly . This describes known algorithmic performance, not a proof that efficient classical factoring is impossible or that every large integer is difficult.
Choose with . A nontrivial greatest common divisor already supplies a factor; otherwise find the multiplicative order of modulo . If is even and , then
Minimality of the order also excludes , so factor extraction from an even modular order gives nontrivial factors through . Unhelpful choices of or odd orders require another trial. For , has successive residues and order four, giving
Computing the powers is easy by repeated squaring; discovering a large order is the step accelerated by Shor's algorithm.[ref]
Put and suppose . For each residue class , let
These are normalized uniform superpositions of the arguments with the same modular-exponentiation value. Their amplitudes repeat at separation within the finite register window. Exact cyclic periodicity requires . The correctly normalized entangled register state is
The equal prefactor in the displayed algorithm is exact when , for then every . It is not generally exact for an arbitrary unknown order. A physical implementation uses quantum modular exponentiation as a reversible map; its specified action on second-register input zero is extended to a unitary operator on the whole register space.
For the illustrative , and , the four first-register states are
Applying the positive-sign quantum Fourier transform to the general state gives
The bracket is a finite geometric Fourier amplitude. If , it vanishes unless for , when it equals . Hence
The second-register states are orthogonal, so their different phases do not change the marginal first-register probabilities. Measurement gives
In the example the possible outcomes are . A nonzero observed ratio estimates , not a prime factor directly. Reducing it gives denominator ; repeating avoids uninformative outcomes or recovers missing order factors. For example, or gives denominator four, whereas alone gives only two.
When , the Fourier probabilities have narrow peaks near instead of support only on an exact reciprocal grid. The general marginal distribution is
Choosing supplies the usual precision for continued-fraction recovery in quantum order finding: a nearest grid sample differs from the target rational by at most . Candidate denominators and extracted divisors are checked classically, and repetitions provide useful samples. The small example works exactly because its order divides the register size; it is not a general precision guarantee for factoring every four-bit integer.
Figure 1.
Exact reciprocal-period sampling for order four and broadened peaks when the order does not divide the register
. Details.
A sufficiently large reliable quantum computer would undermine RSA by efficient factorization. The related discrete-logarithm algorithm also threatens Diffie-Hellman key exchange and elliptic-curve public-key schemes. This does not imply that every communication scheme or symmetric cipher is broken by the same algorithm; post-quantum cryptography studies alternatives based on other problems. The mathematical speedup assumes a scalable quantum computation with enough precision and error control, not merely a small demonstration of factoring fifteen.
Every multiple of is a multiple of both and , so .
For the reverse inclusion, let lie in this intersection of ideals. Since are coprime integers, Bézout's identity supplies with . Multiplying by gives
Thus , and . Consequently
Here Bézout's identity follows from the allowed principal ideal domain property of : the ideal is generated by their greatest common divisor, which is .
Using the assumed square-free polynomial property, factor
into distinct monic polynomials that are irreducible polynomials, with . Part (b)(iii) identifies with , where .
By the first isomorphism theorem for rings, the image from part (c)(i) is , where is the kernel of a ring homomorphism. By part (a)(ii), for ideals . A field has only the zero ideal and the whole field as ideals, so each is either or the zero ring. Consequently, for a subset ,
This is the quotient of a finite product of fields principle. The subset is nonempty because , whereas the zero ring has only one unit. By part (a)(i),
Each factor is a positive integer. Since is a prime number, exactly one factor is and all remaining factors are one. Thus
so is a Mersenne prime. If with , then would be a proper divisor of ; thus is itself a prime number, although only the displayed form is needed.
The assumed square-free polynomial property can also be checked directly: in characteristic of a ring two, the formal derivative of is because is odd. These two polynomials have greatest common divisor one, since does not divide , so no repeated irreducible polynomial factor occurs.
In Pollard's p-1 algorithm, a large exponent containing many small factors makes divisible by a prime factor whose predecessor divides , by Fermat's little theorem. A greatest common divisor with the number being factored can then separate that prime factor from the others.
Choose base and build factorial exponents using modular exponentiation. The successive exponents , , and give
The first two greatest common divisors are . At the next step the Euclidean algorithm gives
Hence
Here the element order of modulo is , which divides , even though does not divide . The algorithm only needs the element order to divide the chosen exponent; divisibility by the full predecessor is a sufficient condition, not a necessary one.
Here the direction of the divisibility relation matters: means . The first two clauses say that is a common divisor of . The last clause says that every common divisor divides . These are precisely the defining properties of the greatest common divisor. Choose ; then
Hence
This also holds if the natural numbers include zero: use and . Every natural number divides zero, so for the last clause remains true. In the order obtained by reversing divisibility, the greatest common divisor is the least upper bound.
Set . At each iteration with , compute the remainder , then set
Stop at the first index with and return . The positive second coordinates strictly decrease, so algorithm termination follows from the well-ordering principle. The equality of greatest common divisors established in (ii) is a loop invariant, and at termination it gives
The greatest common divisor is the largest positive integer dividing both inputs:
This maximum exists because belongs to the set and all its elements are at most .