Number

The symbol is the sign of a shuffle

Multiplying every residue modulo p by a fixed number rearranges them. That rearrangement is a permutation, permutations have a sign, and the sign is exactly the Legendre symbol — so a question about squares becomes a question about crossings.

Worth reading first: Counting one rectangle, twice · The crossings that will not come out even.

Take the residues modulo eleven, multiply every one of them by three, and write down where each went. Nothing has been created or destroyed: the eleven residues have been rearranged among themselves.

Multiplication by 3 modulo 11, and the sign of the shuffle. Residues in two rows joined by strings showing where multiplication sends each one, with a strip beneath comparing the sign of the shuffle to the Legendre symbol for every multiplier.
Fig. 1 Multiplication by three modulo eleven, drawn as strings from one row of residues to the other. It is two cycles of length five and a fixed point, so its sign is +1 — which is the Legendre symbol of three modulo eleven. The strip beneath sweeps every multiplier and puts the sign of the shuffle beside the symbol from Euler’s criterion.

A rearrangement of a finite set has a sign, +1+1 or 1-1, and it is the one bit of information that survives every way of writing the rearrangement down. A rearrangement of the residues modulo pp has a Legendre symbol attached to the number doing the rearranging. These are two entirely unrelated-looking constructions on the same object.

They are the same. That is Zolotarev’s theorem, published in 1872, and it is the shortest route from a question about squares to a proof of quadratic reciprocity.

Multiplication really is a rearrangement

Fix an odd prime pp and a residue aa not divisible by pp. The map xaxmodpx \mapsto ax \bmod p sends the set {0,1,,p1}\{0, 1, \ldots, p-1\} to itself, and it is one-to-one, because axayax \equiv ay implies a(xy)0a(x-y) \equiv 0, and pp being prime and not dividing aa forces xyx \equiv y.

So πa\pi_a is a permutation of pp things. It fixes 00 and shuffles the other p1p-1.

Its cycle structure is not arbitrary. Following 1aa21 \mapsto a \mapsto a^2 \mapsto \cdots returns to 11 after exactly dd steps, where dd is the multiplicative order of aa — and starting anywhere else gives a cycle of the same length dd, because the orbit of xx is xx times the orbit of 11. So the moved residues split into (p1)/d(p-1)/d cycles of length dd, all the same size.

That regularity is the whole of the computation. A cycle of length dd is d1d-1 transpositions, so

sign(πa)=(1)(p1)(p1)/d=(1)(p1)(11/d).\operatorname{sign}(\pi_a) = (-1)^{(p-1) - (p-1)/d} = (-1)^{(p-1)(1 - 1/d)}.

Where the sign comes out

Write p1=dmp - 1 = d \cdot m, so there are mm cycles of length dd and the exponent above is p1mp - 1 - m. Since p1p-1 is even, the sign is 1-1 exactly when mm is odd — that is, exactly when the number of cycles is odd.

Now bring in the group structure. The non-zero residues form a cyclic group of order p1p-1; fix a generator gg and write a=gka = g^k. The order of aa is d=(p1)/gcd(k,p1)d = (p-1)/\gcd(k, p-1), so the number of cycles is m=gcd(k,p1)m = \gcd(k, p-1).

p1p-1 is even, so gcd(k,p1)\gcd(k, p-1) is odd exactly when kk is odd. And a=gka = g^k is a square exactly when kk is even. So:

  • aa a square     \iff kk even     \iff mm even     \iff sign(πa)=+1\operatorname{sign}(\pi_a) = +1;
  • aa a non-square     \iff kk odd     \iff mm odd     \iff sign(πa)=1\operatorname{sign}(\pi_a) = -1.

Which is to say sign(πa)=(ap)\operatorname{sign}(\pi_a) = \left(\frac{a}{p}\right), and the proof is four lines long once the cyclic structure is available.

Multiplication by 2 modulo 13, and the sign of the shuffle. Residues in two rows joined by strings showing where multiplication sends each one, with a strip beneath comparing the sign of the shuffle to the Legendre symbol for every multiplier.
Fig. 2 Multiplication by two modulo thirteen. Two is a generator, so there is a single cycle through all twelve moved residues; one cycle is eleven transpositions, an odd number, and two is not a square modulo thirteen.

The extreme cases make it vivid

If aa is a generator, there is exactly one cycle, of length p1p-1. One cycle of even length is an odd permutation, so a generator is never a square — which is obvious for a different reason, since a square has order dividing (p1)/2(p-1)/2.

If a=1a = 1, the permutation is the identity: p1p-1 cycles of length one, and p1p-1 is even, so the sign is +1+1. And 11 is a square. Consistent, and the smallest case.

If a=1a = -1, the permutation pairs each xx with pxp - x: that is (p1)/2(p-1)/2 transpositions, so the sign is (1)(p1)/2(-1)^{(p-1)/2} — which is the first supplement, arriving here as a count of two-cycles rather than as an exponent. Two proofs of the same statement that share no step.

Multiplying by 2, over and over, on a dial of 13. Starting at 1 and multiplying by 2 each time closes after 12 steps, visiting 12 of the 12 non-zero residues. 12 divides 12, as it must.
Fig. 3 The orbit of two modulo thirteen, drawn round the dial: a single closed walk through all twelve non-zero residues. The number of cycles a multiplier makes is what decides its sign, and here that number is one.

The cycle count, worked through at eleven

It is worth doing one modulus completely, because the pattern in the numbers is the theorem in disguise.

Modulo eleven the non-zero residues form a cyclic group of order ten, and 22 is a generator: its powers run 2,4,8,5,10,9,7,3,6,12, 4, 8, 5, 10, 9, 7, 3, 6, 1, which is all ten of them. So every residue is 2k2^k for exactly one kk between 11 and 1010, and the squares are the even powers — 4,5,9,3,14, 5, 9, 3, 1, which is five residues, as the counting argument requires.

Now take the multipliers one at a time. Multiplication by 22 has order ten, so one cycle of length ten: nine transpositions, odd, sign 1-1, and 22 is indeed a non-square. Multiplication by 3=283 = 2^8 has order 10/gcd(8,10)=510/\gcd(8,10) = 5, so two cycles of length five: each is four transpositions, eight in all, even, sign +1+1 — and 3=283 = 2^8 is an even power, so a square. Multiplication by 10=110 = -1 has order two: five cycles of length two, five transpositions, odd, sign 1-1, and 1-1 is not a square modulo eleven because 113(mod4)11 \equiv 3 \pmod 4.

Every line of that is a count of cycles and every line lands on the right answer. The gear connecting them is the identity m=gcd(k,p1)m = \gcd(k, p-1): the number of cycles is a greatest common divisor, its parity is the parity of kk because p1p-1 is even, and the parity of kk is whether the residue is a square. Three different-looking parities, and all of them are the same one.

There is a small trap in the middle of that chain and it is worth flagging. It is not true in general that gcd(k,N)\gcd(k, N) is odd exactly when kk is odd; it is true when NN is even, which is the only case here. For an odd modulus of the group — which cannot happen for a prime p>2p > 2 — the argument would collapse, and the collapse is the same one that makes the whole subject about odd primes.

Two ways to compute a sign, and why both are needed

The sign of a permutation can be had from its cycles, as above, or by counting crossings in a drawing of it — how many pairs of strings cross when the two rows are laid out in order. The two agree, and the agreement is not trivial: the crossing count depends on how the strings are drawn and its parity does not.

Here the crossing count has a name. Laying out 0,1,,p10, 1, \ldots, p-1 on both rows and joining xx to axmodpax \bmod p, the number of crossings is the number of pairs x<yx < y with axmodp>aymodpax \bmod p > ay \bmod p — the inversions of the shuffle. So the Legendre symbol counts inversions modulo two, and the hero figure computes both and refuses to draw if they disagree.

That redundancy is deliberate. The cycle route is an argument and the inversion route is a measurement of the picture; agreeing, they certify that the drawing is of the permutation the argument is about. A figure whose strings were routed wrongly would still have a cycle structure, and only the second count would notice.

Every permutation of 4 places, by sign. All 24 permutations of 4 places listed in cycle notation with the number of pairs each puts out of order, coloured by whether that number is even or odd, and the two halves counted.
Fig. 4 Every rearrangement of four places with its sign, computed from the crossings and again from the cycles. The sign is a property of the rearrangement rather than of any drawing of it, and that is what makes it available to be identified with something arithmetic.

Reciprocity, from one rectangle riffled two ways

The reason Zolotarev’s theorem is more than a curiosity is what it does next. Consider the residues modulo pqpq for distinct odd primes pp and qq, and lay them out in a p×qp \times q rectangle in two different ways: filling row by row, and filling column by column.

By the Chinese remainder theorem each residue modulo pqpq is a pair — its residue modulo pp and its residue modulo qq — so both layouts are honest coordinate systems on the same set. The map from one layout to the other is a permutation of pqpq things, and its sign can be computed directly: it is a riffle, and the count of its inversions is (p2)(q2)\binom{p}{2}\binom{q}{2}-ish in a way that reduces to (1)p12q12(-1)^{\frac{p-1}{2}\cdot\frac{q-1}{2}}.

On the other hand, that same permutation factors through the multiplication maps: reading the rectangle one way and then the other is multiplication by qq on one factor and by pp on the other, so its sign is (qp)(pq)\left(\frac{q}{p}\right)\left(\frac{p}{q}\right) by the theorem above.

Setting the two computations of one sign equal gives

(pq)(qp)=(1)p12q12,\left(\frac{p}{q}\right)\left(\frac{q}{p}\right) = (-1)^{\frac{p-1}{2}\cdot\frac{q-1}{2}},

which is the law. The whole proof is one object counted two ways — which is the same shape as the lattice-point argument and a completely different object.

What the two proofs have in common, and what they do not

The Eisenstein proof counts lattice points under a diagonal; this one counts inversions of a shuffle. Both end in the exponent p12q12\frac{p-1}{2}\cdot\frac{q-1}{2}, and both get there by counting one thing two ways.

What differs is what they generalise to. The lattice count is geometric and its natural extension is to other lattices and other slopes — which is how it reaches Dedekind sums and the reciprocity of certain finite sums. Zolotarev’s is algebraic: it says the Legendre symbol is a sign character, a homomorphism from the residues to {±1}\{\pm 1\} realised inside the symmetric group, and its natural extension is to other groups and other transfer maps. The modern statement is that the symbol is a transfer homomorphism, and Zolotarev’s rectangle is the smallest instance of a general construction.

Neither generalisation is visible from inside the other proof, which is the reason a theorem accumulates proofs rather than settling on one.

Who found it, and how long it stayed lost

Yegor Zolotarev published the argument in 1872, three-quarters of a century after Gauss’s first proof, in a paper whose main subject was something else — the theory of ideal numbers in quadratic fields. The reciprocity proof is a few pages of it, and it was not the point.

It then had a curious afterlife. The result is short, elementary, requires nothing but the cyclic structure of the residues, and would fit on a page of any undergraduate course — and it is absent from most of them. Frobenius rediscovered essentially the same argument in 1914, and the modern group-theoretic reading, in which the symbol is a transfer map, arrived later still and made it look inevitable in retrospect.

A proof can be short, correct, and still fail to circulate, and the usual reason is the one operating here: it does not fit the shape of the surrounding course. A first course in number theory reaches reciprocity before it has said anything about permutation signs, and a first course in algebra reaches permutation signs with no reason to care about residues. The proof sits in the gap between two syllabuses and belongs to neither.

Which is a decent argument for a collection organised by argument rather than by subject. The two halves of Zolotarev’s proof are on this site already and were written years apart in its own terms — the sign of a rearrangement in algebra and the rectangle counted twice in number theory — and the essay joining them is this one.

The Jacobi symbol comes along for free

Zolotarev’s statement does not need pp prime. Multiplication by aa is a permutation of the residues modulo any nn coprime to aa, that permutation has a sign, and the sign turns out to be the Jacobi symbol (an)\left(\frac{a}{n}\right) — the product of the Legendre symbols over the prime factors of nn, counted with multiplicity.

The proof is the multiplicativity of the sign under the Chinese remainder decomposition: splitting Z/n\mathbb{Z}/n into its prime-power factors splits the permutation into a product, and signs multiply.

That is a genuinely stronger statement, and it explains a fact about the Jacobi symbol that otherwise looks like a bookkeeping accident: the symbol is defined as a product over prime factors and yet obeys reciprocity as though it were a single Legendre symbol. It obeys reciprocity because it is the sign of a shuffle, and shuffles do not know how the modulus factors.

The divisors of 60. Every divisor as a lattice point, one axis per prime, joined when one divides the other by a single prime.
Fig. 5 Sixty’s divisors, arranged by which prime powers divide them. The Jacobi symbol is a product over the prime factors of its lower argument counted with multiplicity, and the sign of a shuffle modulo a composite splits along exactly this decomposition.
One number, two dials: 3 and 5. A grid of remainder pairs, each cell holding the smallest number that leaves those two remainders.
Fig. 6 The residues modulo fifteen as a three-by-five grid, addressed by the pair of residues modulo three and modulo five. Reading the grid along its rows and along its columns gives two orderings of the same fifteen residues, and the permutation between them is the object Zolotarev’s proof of the law counts.

What a sign character is, once it has been seen twice

Having found the symbol inside the symmetric group, it is worth asking what kind of object has been found, because the answer is what the modern proof is a statement about.

A homomorphism from a group to {+1,1}\{+1, -1\} is a way of splitting the group into two halves, one of them a subgroup of index two. The residues modulo pp have exactly one such splitting, into squares and non-squares, because the group is cyclic of even order and a cyclic group has exactly one subgroup of each order dividing it. The symmetric group on nn letters also has exactly one, into even and odd permutations, for a quite different reason — because its commutator subgroup is the alternating group.

Zolotarev’s theorem says one of those splittings pulls back to the other. The map aπaa \mapsto \pi_a embeds the residues into the symmetric group on pp letters; the sign character on the big group restricts to a character on the small one; and since the small group has only one non-trivial character to {±1}\{\pm 1\}, the restriction is either trivial or the Legendre symbol. Checking one generator settles which, and the four-line argument above is exactly that check.

That reformulation costs nothing and buys the Jacobi extension immediately, because the uniqueness argument never used primality — only that the group of units has even order and a unique index-two subgroup in each factor. It also names what to look for elsewhere: a group embedded in a bigger one whose sign character restricts to something arithmetically meaningful. The general machine is called the transfer, and this is its smallest interesting output.

Where it fails, and what it needs

The multiplier must be invertible. If gcd(a,n)>1\gcd(a, n) > 1 then xaxx \mapsto ax is not a permutation — it collapses — and there is no sign to speak of. That matches the symbol, which is defined to be zero in exactly that case, but the match is a convention rather than a theorem: zero is not a sign.

The cyclic structure is doing real work. The four-line proof above uses that the non-zero residues modulo a prime form a cyclic group, which is itself a theorem and not a small one. Zolotarev’s argument is short because it is standing on that; the lattice-point proof stands on nothing beyond counting.

And the sign is a statement about the whole permutation. It cannot be localised: there is no sense in which some residues contribute more than others. That is what makes the symbol so useful and so uninformative at once — it answers one bit and refuses every follow-up question, such as which residue actually squares to aa.

What the pictures cannot show

A drawing of a shuffle grows unmanageable fast. At p=11p = 11 the strings are readable; at p=101p = 101 they are a grey band. Every claim here is about all pp, and the pictures are at the largest size a picture can still be read at.

The rectangle argument is drawn only for one pair. The grid figure shows fifteen residues in two orderings. The general statement is about all pairs of odd primes, and the count of inversions that produces the exponent is arithmetic that happens off the page.

And nothing here shows the sign being well defined. That a permutation has a sign at all is the theorem the crossings essay exists to prove, and everything above assumes it. A figure of this page’s kind takes it for granted, which is the right division of labour and worth saying out loud.

Where the ladder goes next

The next rung leaves counting behind entirely. The Gauss sum adds the pp-th roots of unity with the Legendre symbol as the sign on each, and squaring the result gives ±p\pm p — an identity in the complex numbers whose evaluation two ways is the law again. That is the proof that generalises furthest, and it is the first one on this ladder to leave the integers.

Sideways: the polygon the roots of unity make is where the next rung’s object lives, and the cyclic structure of the residues is what this rung leaned on throughout.

What is worth carrying away

A quantity defined by one construction can turn out to be computed by a completely different one, and when that happens the two constructions inherit each other’s theorems.

The Legendre symbol was defined to answer whether something is a square. The sign of a permutation was defined to make determinants well defined. Neither definition mentions the other and they coincide, which means every fact about permutation signs is now a fact about squares modulo pp — including the one that matters here, that a sign can be computed by counting a rectangle two ways.

The general move is to look for a second definition of a quantity that already has one. It is rarely available and it is worth a great deal when it is, because the two definitions almost never generalise in the same direction.

What links here

Computed from the collection, not written here: the essays that point at this one.

Shares its objects with

Essays that name at least two of the same things, and that neither author linked.

Named objects

A dashed tag is an object no other essay names yet.

Counting-two waysCyclic groupLegendre symbolModular arithmeticPermutation parityPrimitive elementQuadratic reciprocityQuadratic residue