The auxiliary Higman group has no nontrivial finite quotients of a group. One can use this permitted property directly, but there is a short verification. In any finite quotient, let be the order of the image of . Since conjugation sends to its square, must be odd. If some , choose the least prime number dividing any . It is odd. Conjugation by the preceding generator gives
The multiplicative order of modulo is therefore a divisor of . It is greater than one and divides by the Fermat little theorem, so it has a prime divisor smaller than . That prime also divides , contradicting the choice of . Hence every and the quotient is trivial.
Given any finitely presented group , form , and apply part (a) to the word . This word is nontrivial by the normal form theorem for a free product, so the output contains by the embedding already proved.
To check its finite quotients, let be any group homomorphism to a finite group. The image of the copy of is trivial by the preceding property. The identifications make all trivial. Thus the equations give, in the image,
Since , this forces for all generators of , including . The defining word then has trivial image, so as well. Every generator of has trivial image. Therefore
This uses the concrete construction of part (a), not an assumption that arbitrary quotients preserve an embedding of .
Here the true multiplicative order is four, and it divides every power-of-two Fourier-register size , including the choice from part (ii). A second-register measurement produces one of the four periodic cosets
Its quantum Fourier transform has nonzero amplitudes only at , and each has squared modulus . The inverse transform only changes phases or permutes these four labels. Hence the measured ratios are equally likely.
For or , continued-fraction recovery in quantum order finding returns denominator four. Part (i) then gives factors three and five. For , the reduced denominator is two. Although two is not a period, the candidate-denominator gcd post-processing in part (ii) still gives a factor:
The zero outcome produces no useful even candidate and the run fails. For the factor-extraction procedure specified above, three of the four outcomes succeed:
There is an important convention behind this answer. A version that rejects a candidate unless before attempting any gcd rejects , since . Under that validated-period convention only the two odd-numerator phases succeed, giving
Thus the probability of recovering the true multiplicative order is , whereas the probability of finding a factor with direct gcd post-processing is . The printed question does not specify this classical post-processing detail; stating it avoids identifying these two different events.
Let . In the Shor algorithm, first use classical arithmetic to deal with even and perfect powers, and to reject prime inputs. Perfect-power recognition and primality testing have polynomial-time classical algorithms. Factoring a perfect power , with , already gives a nontrivial factor . We may therefore consider an odd composite with at least two distinct prime factors.
Choose uniformly from and compute its greatest common divisor with using the Euclidean algorithm. A proper nontrivial divisor ends the computation. Otherwise is a unit, and the remaining task is quantum order finding. Set
Prepare a uniform quantum superposition in a -qubit register and use quantum modular exponentiation in a second register to obtain
Repeated squaring and reversible modular multiplication implement this step with polynomially many quantum gates in . Apply the inverse quantum Fourier transform to the first register and perform a quantum measurement in the computational basis, obtaining . Measuring the second register first, and Fourier-transforming the resulting periodic coset, gives the same distribution of .
Here is a quantitative quantum Fourier sampling bound for order finding. If , multiplication by cycles its orbit states. The Fourier eigenstates of that cycle have eigenvalues , and the initial state has squared overlap with each, for . Therefore
Conditioned on a particular eigenphase , its nearest integer outcome obeys and has probability at least . Indeed the absolute amplitude is , where . For , the numerator is at least and the denominator at most ; the limiting value at is one.
If , the fraction is reduced, and gives
Use continued-fraction recovery in quantum order finding. The relevant approximation theorem says that reduced fractions satisfying are continued fraction convergents of . For an input rational of digits, their candidates can be enumerated classically in time, and their denominators are at most the reduced input denominator. This is the supplied continued-fraction result; discard candidate denominators exceeding . A zero measurement is treated as a failed order-finding sample.
For each remaining even candidate denominator , compute by repeated squaring, and try and . Return only a divisor with ; otherwise repeat the quantum sample or choose another . This candidate-denominator gcd post-processing cannot return an incorrect factor, since its output is checked directly. When the recovered denominator is the true even multiplicative order and the square root of one is nontrivial, part (i) guarantees success. Checking before trying the gcds is also a valid, more restrictive convention; the single-run distinction matters in part (iii).
Two further standard quantitative facts explain why repetitions remain efficient. First, for a uniformly chosen unit modulo an odd integer with at least two distinct prime divisors, the probability of a useful unit in Shor factorization is at least : its true multiplicative order is even and . To see the source of this bound, the Chinese remainder theorem for unit groups makes the prime-power components independent. Each odd-prime-power unit group is cyclic. If its 2-primary order is , the probability of the largest possible value of is , and the probability of any specified smaller value is at most . Failure requires all components to have the same : either all zero, making odd, or all the same positive value, making the halfway power in every component. Conditioning on one component, the chance another component matches it is at most , so total failure is at most .
Second, the fraction of phase numerators coprime to is , where is the Euler totient function. The elementary totient-ratio lower bound suffices: if the distinct prime divisors are , then and . The totient product formula therefore gives
Thus for a good , the probability of sampling a coprime phase numerator with the required accuracy is at least . This is inverse-polynomial in the input length, so polynomially many repetitions achieve any fixed success probability. The quantum Fourier transform uses elementary rotations and Hadamard gates in the ideal gate description, and the other quantum and classical stages are polynomial in .
The reduction is therefore polynomial in the bit length:
A small denominator need not itself be the true multiplicative order; verification of the final factor is essential, and no guarantee is claimed for every individual sample.
For coprime integers , the multiplicative order is the smallest positive exponent
It exists because multiplication by is an element of the finite group of units modulo an integer. For the example, the successive residues are
None of the first three is one, so the order is four.
The factor extraction from an even modular order uses the factorization . If the multiplicative order is even, put . Minimality of the multiplicative order excludes ; we also require . Thus is a nontrivial square root of one. Neither nor is divisible by all of . If either were coprime to , its inverse modulo , applied to , would make the other divisible by , a contradiction. Hence the greatest common divisors
are proper nontrivial factors. For odd , and have no common prime divisor of , so these two divisors are complementary. If the initial is not coprime to , a proper already supplies a factor without quantum order finding.
For and , and , which is neither nor . The factors are
The necessary conditions for this order-based reduction are a unit , even true multiplicative order, and .
For an odd prime number , the Legendre symbol is zero when , one when is a nonzero quadratic residue modulo , and minus one otherwise. The number-theoretic Gauss lemma says that, for , , where counts those least positive residues of exceeding .
For , the residues are simply , so . Examining the four odd residue classes modulo eight gives
Now and is odd. The multiplicative order of divides but not . Since is a power of two, every proper divisor of divides , whence . Lagrange's theorem for finite groups gives . Because , this implies , so the supplementary law just proved gives . By Euler's criterion, , and consequently . Therefore
An Euler pseudoprime is an odd composite number with satisfying , where the right side is the Jacobi symbol. A weaker convention requires only ; it is distinguished below. A strong pseudoprime, with and odd, satisfies or for some .
By the Chinese remainder theorem for unit groups, the unit group modulo is . Modulo , . Thus the only possible sign in is positive. Modulo , writing for a primitive root, the condition is , equivalently . Consequently has multiplicative order dividing in each factor. Its square is either or in each factor, but these signs must agree: modulo , the Legendre symbol is for square and for square , and the same is true modulo . The Euler pseudoprime condition additionally requires the product of those Legendre symbols to be . Hence
Each sign has two roots modulo each prime, hence four roots modulo . There are eight pseudoprime bases modulo under the Jacobi symbol convention. Under the weaker sign-only convention there are instead sixteen pseudoprime bases, since the two signs of the squares need not agree; the stated equivalence therefore specifically uses the Jacobi symbol convention.
For the strong pseudoprime condition, . Since the unit group has exponent of a finite group , the only possibilities are or . The six pseudoprime bases are . For example , while has but . Thus the strong-pseudoprime pseudoprime bases are not a subgroup.
Let be a primitive fifth root of unity. Over , the Frobenius automorphism acts by , so the splitting field of has degree equal to the multiplicative order of modulo . Its Galois group is generated by Frobenius and is cyclic. The possible orders are therefore for , for , and for .
Put . The polynomial satisfies the Eisenstein criterion at , so . Also . The intersection of these two fields has degree dividing both and , hence is . Since the splitting field is ,
Label the five roots by , . The Galois group acts through the affine group over a finite field:
Its possible nontrivial cycle types are , , and ; in particular, no element has a three-cycle. By the Dedekind factorization cycle test, the reduction of modulo any prime therefore has no irreducible cubic factor.
The multiplier of the Frobenius element is . If or , then has order four; every affine map with this multiplier has one fixed point and one four-cycle. Hence is a product of a linear factor and an irreducible quartic. If , Frobenius is a translation : it is the identity when , giving complete splitting, and is a five-cycle when , giving an irreducible polynomial.
Let be a splitting field of over . Its formal derivative is
The assumption on the characteristic of says that in . Any root of is nonzero, and hence . Thus and have no common root, so is a separable polynomial. Since it has degree and splits over , it has exactly distinct roots. This is the separability of roots of unity.
Fix a primitive root of unity . Define the th cyclotomic polynomial by
It is monic and has degree given by the Euler totient function . Partitioning all th roots of unity according to their exact multiplicative order gives the cyclotomic factorization
We now prove by mathematical induction that . The base case is . If the result holds for every proper divisor of , then
is monic and belongs to . Polynomial division of by the monic integer polynomial produces a quotient and remainder in . The factorization over says that the remainder is zero and the quotient is , proving the claim.
It remains to prove irreducibility of cyclotomic polynomials. Let be a monic irreducible polynomial dividing , let be a root of , and write . We claim that is a root of for every prime number . Otherwise is a root of , so is a root of . Since is the minimal polynomial of over , Gauss lemma for polynomials gives
After reduction of an integer polynomial modulo a prime, the Frobenius endomorphism gives
Choose an irreducible factor of the nonconstant monic polynomial . Then , so . The cyclotomic factorization would then make divide over . This is impossible because its derivative is coprime to it when .
Thus for every prime . Iterating this fact over a prime factorization shows that whenever . These are all primitive th roots, so
Because divides , equality holds and . Hence every cyclotomic polynomial is irreducible over .
Finally, direct multiplication gives
Also
Applying the cyclotomic factorization to the two factors on the right gives
and therefore
Since , cancellation yields
The thirtieth cyclotomic polynomial is irreducible over by the theorem just proved, so is irreducible.
The multiplicative order of modulo is the least positive integer such that
It exists because and are coprime integers.
Suppose that is even and
The minimality of also gives . Since
the factor extraction from an even modular order yields
as a nontrivial factor of ; equivalently one may also compute . Thus the required conditions are that be even and that .
Choose a power of two with
Since the multiplicative order is less than , this guarantees . Prepare two quantum registers in the state
and use quantum modular exponentiation to obtain
Measure the second register. The order as the exact period of modular exponentiation implies that, conditional on the measured value, the first register is a normalized truncated periodic coset
where is the largest integer for which .
Apply the quantum Fourier transform to the first register and measure it, obtaining . The supplied Fourier-transform theorem states that, with probability of order , is an integer nearest to for some coprime to . On that event,
The supplied continued-fraction theorem, applied through continued-fraction recovery in quantum order finding, therefore recovers the reduced fraction from . Because and are coprime, its denominator is the exact order . The candidate is checked classically by verifying .
The quantum Fourier transform, quantum modular exponentiation, continued-fraction algorithm, and final modular check all take polynomial time in . Since , the successful event has probability of order , as required.
Euler's criterion states that for an odd prime number and ,
where the right-hand side is the Legendre symbol.
Let be a primitive root modulo . Its multiplicative order is , so . This power has square , and the only roots of modulo the odd prime are . Therefore
Euler's criterion now gives , so every primitive root is a quadratic nonresidue.
Now let be a Fermat prime, with . The number of primitive roots modulo is
There are also exactly quadratic nonresidues. Since every primitive root is a nonresidue, these equally large sets coincide. Thus every quadratic nonresidue modulo is a primitive root, as summarized by Quadratic nonresidues modulo a Fermat prime.
Finally, and . Quadratic reciprocity therefore gives
Hence is a quadratic nonresidue modulo , and consequently
The Fermat-Euler theorem gives
so the multiplicative order exists. For every integer ,
Thus the modular exponential is periodic with period . If were a smaller period, then would give , contradicting the minimality of . Hence is its least positive period.