For positive integer moduli , the simultaneous integer congruences and are solvable exactly when . When solvable, they determine a unique congruence class modulo . To see the condition, put : the remaining equation is the linear congruence , which is solvable exactly when the greatest common divisor divides .
For example, and give , hence and . Thus . Changing the second remainder to two makes the conditions incompatible: the first requires an odd integer, while the second requires an even integer. Article 32 of Carl Friedrich Gauss's Disquisitiones arithmeticae gives a successive construction for simultaneous remainders, including the greatest common divisor and least common multiple that enter this general case. [ref]
Equivalence class Created 2026-10-05 Updated 2026-10-14
An equivalence class collects all the set elements indistinguishable from a specified set element under an equivalence relation. For an equivalence relation on a set , the precise definition is
The ambient set matters: a finite class for integer congruence restricted to differs from the infinite residue class for the same integer congruence on all integers. We write when the equivalence relation and ambient set are clear.
In the finite modulo-three example,
There are nine names but only three distinct equivalence classes. In particular, , whereas : the first statement is membership of a set element; the second is equality of two sets.
For any equivalence relation on , the essential rule is
Reflexivity puts in , so the equivalence classes are nonempty and cover . If two equivalence classes share , the symmetric relation property and transitivity relate their defining elements through ; transitivity then makes their members coincide. Thus distinct equivalence classes are disjoint, giving a partition of a set. Conversely, declare two set elements equivalent when they belong to the same block of a partition of a set. The three relation properties follow immediately and its equivalence classes recover the blocks. [ref]
Equivalence relation Created 2026-09-24 Updated 2026-10-14
An equivalence relation says which set elements should count as the same for a particular purpose. In modular arithmetic, for example, distinct integers with the same remainder are equivalent. The relation gathers interchangeable set elements into equivalence classes; the quotient set then treats each whole equivalence class as one object.
Formally, an equivalence relation on a set is a binary relation , written , satisfying three conditions for all :
These conditions make the equivalence classes a partition of a set: each set element belongs to exactly one class. [ref]
For a worked example, take the finite set and restrict integer congruence modulo three to :
Reflexivity follows because . The symmetric relation property follows by changing the sign of a difference, and transitivity follows by adding and : divisibility by three is preserved in both steps. Thus and force . The three equivalence classes are , and . Their members alternate along the number line; membership in an equivalence class need not mean being close together.
Figure 1.
Congruence modulo three divides the integers from zero through eight into three equivalence classes
. Details.
The transitivity requirement rules out a tempting alternative. On , define nearness by the absolute value condition . This binary relation is reflexive and symmetric, but is near and is near while is not near . Its neighborhoods , and overlap without being equal. They are not equivalence classes or a partition of a set.
Least common multiple Created 2026-09-24 Updated 2026-10-14
For positive integers , their least common multiple is the smallest positive integer that is an integer multiple of both. Write it as . A positive common integer multiple always exists, since is one, but it can be larger than necessary.
For example, the positive integer multiples of begin , while those of begin . Their first positive coincidence is , so . Both also divide zero, but the word positive excludes zero from this minimum.
Suppose two events happen every twelve and eighteen days, and both happen at day . Their next meeting is at day , after three twelve-day intervals and two eighteen-day intervals. Through day , their common event times are .
Figure 1.
Events every 12 and 18 days, starting together, meet again every 36 days
. Each row marks the nonnegative integer multiples of its interval from zero through 72. The highlighted columns are shared; 36 is the first positive one and hence the least common multiple. Details.
The prime factorization explains why this coincidence occurs. For the integers and ,
A common integer multiple must contain at least the prime valuations required by each input. Taking the larger prime valuation at each prime number meets both requirements with no extra factors. The greatest common divisor uses the smaller prime valuations instead. This is the same coordinate comparison developed under prime factorization, applied in opposite directions.
Figure 2.
For 12 and 18, smaller prime valuations give greatest common divisor 6 and larger ones give least common multiple 36
. Bars show the exponents of the prime numbers two and three in , , and . The table makes the minimum and maximum in each column explicit. Details.
For any positive integers , the prime valuations give
The proof outline is one observation at each prime number: . Hence the two sides have identical prime factorizations. Numerically, . This also gives a calculation using the Euclidean algorithm for the greatest common divisor, without first finding the prime factors of both inputs.
Every positive common integer multiple is an integer multiple of the least common multiple, because its prime valuations must be at least the larger input prime valuations. Including negatives and zero, the common integer multiples of and are exactly for integers . For more than two positive integers, the same definition and rule of taking the largest prime valuations apply; one may also combine inputs successively. For example, .
For nonzero signed integers, take absolute values: . We extend the definition to zero by the convention , since zero is then the only common integer multiple; this is an extension, not a positive minimum. In particular must be handled separately from the displayed quotient, which would involve division by zero.
The least common multiple is useful for combining fractions with the smallest positive shared denominator. For example,
Its scheduling interpretation requires care about starting times. If the events start at integer days and , a common time must satisfy the integer congruences and . The Chinese remainder theorem for noncoprime moduli says a solution exists exactly when . If it exists, solutions form one congruence class modulo , but the first meeting need not be day . With starts , the first meeting is day and subsequent meetings are ; with , they never meet. The beauty of the least common multiple is the exact shared spacing, while the integer congruences determine whether and where the spacing begins.
Book VII, Proposition 34 of Euclid's Elements constructs the least common multiple of two numbers, and Proposition 36 extends the construction to three by first combining two of them. In modern notation this is . These are specific ancient treatments of the construction, rather than a claim about its first discovery. [ref] [ref]
Least nonnegative residue 2026-10-14
The least nonnegative residue of an integer modulo a positive integer modulus is the unique representative of its congruence class in . Euclidean division gives . For example, , so ; the integer congruence does not assert equality of those two integers.
Modular arithmetic Created 2026-10-03 Updated 2026-10-13
Modular arithmetic performs addition and multiplication on integers while remembering only their remainders for a fixed positive integer modulus . The relation means that divides : the two integers lie in the same congruence class. For example, , and represent one class modulo . Choosing the least nonnegative residue gives exactly representatives, , even though each congruence class contains infinitely many integers.
A clock supplies a familiar example. Represent the twelve positions by , with at the position usually labelled twelve. Starting at ten and moving seven positions gives
The integer congruence records the final position; it discards the number of complete revolutions. Adding another twelve changes the elapsed count while preserving the position. The picture also shows a single congruence class modulo five spread along the number line.
Figure 1.
Clock addition wraps modulo twelve, while integers separated by five represent one congruence class
. Details.
The useful surprise is that discarding this information still preserves the arithmetic. If and modulo , then and modulo . Thus a large calculation can reduce its intermediate integers after every step. For instance,
Replacing by gives the same answers with smaller intermediate values. The congruence classes with these operations form the quotient ring ; their addition alone forms a cyclic group. This passage from integers to a finite arithmetic system is the setting for modular exponentiation, primality testing and the RSA cryptosystem. [ref]
Multiplicative cancellation needs extra care. Modulo six, , but : multiplication by two has merged distinct congruence classes. Cancelling a factor while retaining the integer modulus is justified when that factor has a modular multiplicative inverse, equivalently when it is coprime to the integer modulus. A linear congruence can consequently have no solutions, one solution class, or several solution classes. The Chinese remainder theorem supplies a complementary operation: splitting a calculation across coprime integer moduli and reconstructing its class modulo their product.
Small remainders can also certify impossibility. A perfect square has residue zero or one modulo four, as checking the four congruence classes shows. Therefore an integer equation has no solution. The converse direction needs care: a permitted residue does not guarantee an integer solution, since but five is not a perfect square. Such local tests provide necessary conditions for Diophantine equations without replacing the full problem.
In Disquisitiones arithmeticae (1801), Carl Friedrich Gauss defines integer congruence in article 1 and adopts the symbol in article 2. Article 12 derives divisibility tests from powers of ten and explains checking arithmetic by its remainders. These passages show a systematic treatment of the same idea; they are not a claim that remainders were first used in 1801. [ref]
Pigeonhole principle Created 2026-09-24 Updated 2026-10-13
Place objects into boxes, assigning each object to exactly one box. Here is a nonnegative integer and is a positive integer. The pigeonhole principle says that if , some box contains at least two objects. Equivalently, a function from an -element finite set to an -element finite set cannot be an injective function when . The boxes may stand for categories rather than physical containers. [ref]
For thirteen objects and twelve boxes, a box containing at least two is unavoidable. Thinking of thirteen people and their birth months gives the same conclusion: at least two share a birth month. Twelve people could occupy the twelve months one apiece, so thirteen is the smallest number that forces a shared month. The generalized pigeonhole principle quantifies how many objects must share a box when there are still more objects.
The useful surprise is that the pigeonhole principle proves existence without needing to locate the objects involved. Choosing a good assignment rule is often the creative step: equal labels can mean equal remainders, nearby points, or repeated states of an algorithm. Once the rule is chosen, a short count can force a relationship among a much larger collection of objects. The pigeonhole principle itself does not name the crowded box. When the objects and their assignments are explicitly available, a simple algorithm finds one: scan the objects, keep the first object seen in each box, and stop when a later object enters an occupied box. At most scanned objects are needed when .
A geometric example. Any five points in a square of side one contain two whose Euclidean distance is at most . Give each point Cartesian coordinates . Divide both ranges into the intervals and , making four cells. Thus belongs to the left half and to the right half; belongs to the lower half and to the upper half. This convention assigns every boundary point to exactly one cell.
The pigeonhole principle puts two of the five points in the same cell. Their differences in Cartesian coordinates have magnitude at most , so the Pythagorean theorem gives their Euclidean distance the bound
For the plotted points , , , and , the first two occupy the lower-left cell and have Euclidean distance . These Cartesian coordinates exhibit the forced pair; the argument applies to every placement of five points.
Figure 1.
The pigeonhole principle places two of five points in one of four cells of a square, bounding their Euclidean distance by
. Details.
An arithmetic example. Assign eight integers to their seven residue classes modulo the integer modulus . The pigeonhole principle gives two with the same residue class, so is an integer divisor of their difference. In , for example, and satisfy the integer congruence , and . Likewise, assigning fractional parts to short intervals gives the Dirichlet approximation theorem; its existing article explains the approximation bound.
Quotient set Created 2026-09-28 Updated 2026-10-14
A quotient set packages each equivalence class as a single new set element. It remembers which class an original set element belongs to and forgets which member of that class it was. For an equivalence relation on a set ,
Each set element of the quotient set is itself a nonempty subset of . The canonical projection of a quotient set sends an original set element to this entire equivalence class. [ref]
For integer congruence modulo three restricted to , the quotient set is
It has cardinality three. The set is a choice of equivalence class representatives, not literally this quotient set: is an integer, while is a set. The function sending each chosen equivalence class representative to its equivalence class is a bijection between these two different sets.
Figure 1.
The quotient projection sends nine elements to three classes, with each class appearing as one fiber
. Details.
A quotient set alone specifies no arithmetic. To obtain the familiar modular arithmetic example with addition, use integer congruence on the whole set of integers. Its quotient set is , where is an infinite residue class. Define addition by
The answer must be independent of the equivalence class representatives. If and , then , so both sums have the same residue class. This is what it means for the group operation to be well-defined. With this addition, the quotient set is a cyclic group, with identity and inverse for . [ref]
For example, . Choosing and as different representatives of an equivalence class for gives the same sum; choosing and gives again. These calculations use residue classes of all integers. Raw addition on the finite does not stay in : . The formula for addition on therefore cannot be applied as a raw inherited operation on that finite example.
For an odd prime number , put . Both and are divisible by . By Wilson's theorem, they are also congruent modulo , because each is modulo . The coprime integers therefore both divide their difference, giving the displayed integer congruence. This combines the prime-modulus factorial identity with an elementary divisibility constraint.
Wilson's theorem 2026-10-14
For an integer , Wilson's theorem characterizes prime numbers by a factorial:
The right side is an integer congruence, so the least nonnegative remainder is . For example, certifies that five is a prime number, whereas rules out six. [ref]
Figure 1.
Factorial residues distinguish primes from composites, with inverse pairs explaining the prime case
. Details.
For an odd prime number , each nonzero congruence class has a unique modular multiplicative inverse. Pair each class with its inverse: each distinct pair contributes one. A class is its own inverse exactly when ; since , Euclid's lemma leaves only . Their product is . The prime number two needs a separate check: . Conversely, a proper divisor divides both and , so the displayed integer congruence would force , a contradiction. [ref]
The composite numbers have an even sharper pattern: for every composite number , but . To check the zero claim, write with . If , both occur as different factors in the factorial. If , the different factors and both occur since , and their product is divisible by . The only excluded case is . Thus four is an exception to the zero pattern, but still fails Wilson's theorem: its required remainder would be three.
This is an exact primality testing criterion, but direct evaluation is expensive: even reducing modulo after every multiplication still takes a number of multiplications proportional to , which grows exponentially with the number of binary digits of . The problem is not merely storing a huge factorial. The more useful role of Wilson's theorem is simplifying factorial expressions in modular arithmetic. For instance, if is a prime number, then gives by a modular multiplicative inverse.