Reduced Residue Systems and the Totient Function
How many numbers between and share no common factor with ? This innocent counting question is asked of a fixed modulus . It turns out to organize an enormous amount of arithmetic. The units modulo — the residue classes with a multiplicative inverse mod — form a finite group under multiplication. The question above is exactly the question of how large that group is. Once we know how to count and manipulate these units cleanly, deep facts fall out almost for free. These include Euler's theorem and Fermat's little theorem. The idea matters because multiplication modulo behaves very differently from addition modulo . Every residue class is invertible under addition. But only some are invertible under multiplication — precisely those coprime to . Isolating this smaller, well-behaved set is the key structural move. It turns "arithmetic mod " into "group theory mod ." A reduced residue system is a systematic choice of representatives for exactly these invertible classes. Euler's totient function records how many there are. The big picture is this: , the set of units mod , is a finite abelian group of order . Reduced residue systems are simply lists of coset representatives for it. Everything downstream rests on this foundation. This includes Euler's theorem, the structure of primitive roots, and RSA-style cryptography. It rests on knowing this group exists, and knowing its size exactly. It also rests on knowing that multiplying a reduced residue system by any unit merely permutes it. This article builds the theory from the ground up. It gives the precise definition of a reduced residue system. It proves that its size is always , regardless of which system you choose. It also presents the permutation lemma that makes Euler's theorem possible. We prove every claim and work two nontrivial numerical examples. We show exactly what breaks if the coprimality hypothesis is dropped.
- A residue class mod is a unit iff it has a multiplicative inverse mod , iff it is coprime to .
- A reduced residue system (RRS) mod is a set of integers, one from each unit class mod .
- Every RRS mod has exactly elements, where .
- If and is an RRS mod , then is also an RRS mod .
- This permutation property is the engine behind Euler's theorem: for .
- Key idea: the units mod form a group of size , and multiplying by a unit always permutes that group.
Where this lives today
Reduced residue systems and are the quiet engine behind RSA public-key cryptography: choosing for distinct primes , one uses to construct encryption/decryption exponents that are inverses modulo , and Euler's theorem (proved above via the permutation property) guarantees correct decryption. In computational number theory, fast algorithms for primality testing and factoring lean on the group structure of established here. In combinatorics, appears in counting formulas for cyclic groups (the number of generators of a cyclic group of order is exactly ), in the theory of cyclotomic polynomials (the degree of the -th cyclotomic polynomial is ), and in analytic number theory through the average order and Dirichlet series of . The permutation lemma itself is a special case of the general fact that a group acts on itself by left multiplication (Cayley's theorem in miniature), linking elementary number theory directly to abstract algebra.
Ask the tutor: How does the permutation property of reduced residue systems generalize to prove Euler's theorem for arbitrary finite abelian groups?
Let be an integer.
Unit residue class. A residue class is called a unit (or is said to be coprime to ) if there exists an integer with . By the theory of Modular Inverses, such exists if and only if ; this condition depends only on the class , not on the chosen representative, since for every integer .
Euler's totient function. Define
By convention (the single class counts as a unit).
Reduced residue system. A set of integers is a reduced residue system modulo (RRS mod ) if: 1. (Coprimality) for every ; 2. (Completeness among units) every integer coprime to is congruent mod to some ; 3. (Distinctness) for . Equivalently, an RRS mod is obtained by choosing exactly one representative from each unit residue class mod .
Intuition
Picture the residue classes mod as equally spaced points on a circle, labeled . A complete residue system picks up every point once. Now shade the points that share a common factor with : these are the "dead" points, useless for multiplicative inverses, because if then can never be inverted mod (multiplying by anything lands only on multiples of , never on unless ). The unshaded points are exactly the units — the reduced residue system lives on them. The second picture in your head should be multiplication as a symmetry of this unshaded set. Fix a unit . Multiplying every unshaded point by (mod ) sends units to units — because a product of two units is again a unit — and it is injective on residues mod because is invertible. Since the unshaded set is finite, an injective self-map of it is a bijection: multiplying by just permutes the unshaded points among themselves. This single fact, visualized as "rotating/scrambling the dots without ever touching a shaded dot," is exactly what powers Euler's theorem later.
Let be an integer.
(A) Well-definedness of size. If is any reduced residue system mod , then .
(B) Permutation property. Suppose is a reduced residue system mod , and is an integer with . Then is also a reduced residue system mod .
Proof of (A). By definition, is a complete residue system mod (it has one representative of every class, since these integers are pairwise incongruent mod and every integer is congruent to exactly one of them). Among these representatives, exactly satisfy , by the very definition of . Call this subset , so . Now let be an arbitrary RRS mod . By property (1) of the definition each is coprime to , hence congruent mod to a unique element of (reduce mod into the range ; coprimality is preserved since ). Since , this unique representative lies in . This defines a map
is injective. If then , so ; by property (3) (distinctness) this forces . is surjective. Let . Then , so by property (2) (completeness among units) there is some with . By definition is the unique element of congruent to mod ; since and , uniqueness gives . So is a bijection between and , giving . This proves (A). (technique: bijection/counting argument)
Proof of (B). Let be an RRS mod and let . Set for . We check the three defining properties for . Coprimality. Since and , and is multiplicative over products in the sense that a prime divides only if or (Euclid's lemma), no prime factor of divides . Hence , i.e. . Distinctness. Suppose , i.e. . Since , has an inverse mod (by Modular Inverses); multiplying both sides by gives . By distinctness of the original RRS, . Hence the are pairwise incongruent mod , and there are of them. Completeness among units. Let be any integer with . Since , let be an inverse of mod ; then as well (if a prime divided , then from we would get after considering forces contradictions — more directly, is itself a unit because it has as its own inverse). Consider . Since and , the same Euclid's-lemma argument as above gives . By property (2) for the original RRS, there is some with . Multiplying both sides by :
using . So , showing every unit class mod is represented among the . We have verified properties (1), (2), (3) for , so it is a reduced residue system mod . (technique: direct verification of the RRS axioms via invertibility of )
∎With notation as in the theorem, since both and are reduced residue systems mod , and any two RRS's mod are permutations of one another's residue classes (immediate from the definition: both list each unit class exactly once), we have
Both products range over the same set of residue classes mod — namely all unit classes mod , each appearing exactly once — just possibly in different order, since and are both equal (as sets of residue classes) to the full set of unit classes. Multiplication of congruence classes is commutative and depends only on the classes involved, so reordering a finite product of classes does not change its value mod . Hence the two products are congruent mod . (Technique: rearrangement invariance of a product over a finite index set.)
∎Writing , the Lemma gives . Since each is a unit mod , so is (a finite product of units is a unit), hence is cancellable mod , yielding
This is Euler's Theorem; its full statement and independent applications are developed elsewhere, but the reduced-residue-system machinery above is precisely what makes the one-line proof work.
Worked examples
Example 1: . First compute directly from the definition: list and keep those with . Since , we discard multiples of or :
are the survivors (check: , , , , , ; all other residues share a factor of or with ). So
and is one RRS mod . Now test the permutation property with (note ). Compute for each :
The resulting residues are exactly reordered — confirming the Theorem's part (B): multiplying an RRS by a unit permutes it. As a bonus check of the Corollary, should be : indeed , , so , matching Euler's theorem exactly.
Example 2: , an RRS not of the "standard" form. Here . The standard RRS from is (discard multiples of and ), so . To illustrate that any set of representatives, one per unit class, works — not just the least positive one — build a deliberately asymmetric RRS by shifting some representatives by multiples of and even using negative numbers:
Check each is coprime to and matches a distinct class among :
All eight target classes appear exactly once, and of each listed integer with is (e.g. , , ). So is a bona fide RRS mod with , confirming part (A) even though looks nothing like . Now apply the permutation property with () to the standard RRS :
The image set is , confirming the permutation property once more, this time with an that is not itself in the RRS's "obvious" range in a special way (it's just a generic unit).
The Theorem's part (B) requires . Drop this and let , take the RRS (indeed ), but now multiply by , which is not coprime to . Compute :
The resulting set is . This is not a reduced residue system mod at all: every element shares the factor with , so for all . Property (1) (coprimality) fails outright, and in fact consists entirely of non-units mod . This shows the coprimality hypothesis is not a cosmetic convenience: without it, multiplication by need not even send units to units, let alone permute them. The mechanism in the proof breaks at the very first step (coprimality), since Euclid's lemma argument used essentially to conclude no prime dividing divides .
Scope, edge cases & common traps
| Situation | What holds | What can fail |
|---|---|---|
| ; the unique class is (vacuously) a unit; RRS mod 1 is any single integer | Nothing unusual, but easy to mis-define by mistake | |
| prime | Every is a unit; | None; this is the cleanest case |
| composite | Only classes are units; in general | Confusing "complete residue system" ( elements) with "reduced residue system" ( elements) |
| Multiplier with | Multiplying an RRS by produces non-units, not a permuted RRS | Silently assuming the permutation property for arbitrary (see counterexample) |
| Choosing "the" RRS | Representatives can be any integers, one per unit class (need not lie in ) | Assuming an RRS must be filtered by coprimality; Example 2 shows otherwise |
The mathematician behind it
Origins · 1 minLeonhard Euler and how this was discovered
Euler introduced the totient function (though not that name — it was coined later by James Joseph Sylvester) in his generalization of Fermat's little theorem. Working in an era before formal group theory existed, Euler nonetheless captured the essential structure: the units modulo behave coherently under multiplication, and their count governs the exponent needed to force . His 1763 memoir on the subject predates the language of groups by roughly a century, yet contains, in substance, the permutation argument at the heart of this article.
What is the difference between a complete residue system and a reduced residue system?
A complete residue system (CRS) mod contains exactly one representative from every residue class mod , so it always has elements — units and non-units alike. A reduced residue system (RRS) mod contains exactly one representative from only the unit classes, i.e. classes with , so it has elements. Every RRS mod can be extracted from a CRS mod by discarding the non-coprime representatives; conversely every CRS contains an RRS as a subset. When is prime, the two nearly coincide (differing only by the class ), but for composite they can differ substantially, e.g. has a CRS of size 12 but an RRS of size .
Why does the size of a reduced residue system not depend on which representatives are chosen?
This is precisely the content of part (A) of the Theorem. Any RRS mod is, by definition, in bijective correspondence with the set of unit residue classes mod — one representative per class, no repeats, no omissions. The bijection is constructed by reducing each representative to its unique value in , landing exactly in , whose size is by definition. Since bijections preserve cardinality, any RRS has exactly elements, whether its representatives are small positive integers, large integers, or negative integers, as illustrated in Example 2.
Is the permutation property (multiplying an RRS by a unit gives another RRS) true for complete residue systems too?
Yes, and the proof is essentially the same, but it requires exactly as in the reduced case. If is a CRS mod and , then is also a CRS mod : injectivity again follows from cancelling via its inverse, and since there are pairwise-incongruent classes among total classes, they must cover all of them. This CRS-level permutation fact is often proved even earlier, as a lemma feeding into the definition and study of reduced residue systems.
Does have a closed formula in terms of the prime factorization of ?
Yes, though its derivation typically uses either the Chinese Remainder Theorem or an inclusion–exclusion count over prime divisors — both are natural next steps after establishing reduced residue systems, and are treated in the dedicated article on Euler's Totient Function. The formula is , where the product ranges over the distinct primes dividing . For instance, for , this gives , matching the direct count in Example 1.
Why is the permutation property the "engine" behind Euler's theorem?
Euler's theorem states whenever . The proof given in the Corollary multiplies together all elements of an RRS in two ways: once directly, giving a product , and once after scaling every element by , giving . Because the permutation property guarantees the scaled set is the same set of classes, just reordered, the two products must be congruent mod : . Cancelling the unit (which is legal precisely because , a product of units, is itself invertible) leaves . Without the permutation property this cancellation trick has no foothold.
Can ever equal ?
Only when : then by the convention that the single class mod counts as a unit (vacuously, since there is only one class and modular arithmetic mod is trivial). For every , the class is never a unit (since whenever ... more precisely ), so at least one class among , namely itself, is excluded, forcing .
What goes wrong if we try to define an RRS using a modulus together with a multiplier that shares a factor with ?
As the counterexample demonstrates, scaling an RRS by such an produces a set where every element has (since any common factor of and automatically divides too). None of the resulting numbers is a unit mod , so the scaled set fails the very first defining property of an RRS. This is why the coprimality hypothesis on cannot be relaxed to, say, " nonzero" or " coprime to some divisor of " — it must be coprime to itself.