Congruence and well defined operations
Algebra often constructs a new object by treating several old objects as equivalent. The construction works only if its operations do not depend on a hidden choice of representative. Congruence classes of integers offer a concrete place to learn that proof technique before using abstract quotients.
1 Equivalence classes
A relation on a set is an equivalence relation if it is reflexive, symmetric and transitive. The class consists of all elements equivalent to . Two classes are either identical or disjoint: an element in both lets transitivity connect their representatives. Thus classes partition the original set.
Fix an integer . Define when divides . The relation is reflexive because , symmetric because divisibility survives negation, and transitive because it survives addition. Division with remainder shows there are exactly classes, represented by . The set of classes is .
Define and . These require a well-definedness proof. If , , then and
Both differences are divisible by . Hence the resulting classes are independent of representatives. Exponentiation to nonnegative integer powers also respects congruence by repeated multiplication.
By contrast, a proposed operation is meaningless without additional conditions: might not be an integer, and a denominator class need not be invertible.
2 Groups domains and fields in one example
Under addition, the classes form an abelian group: zero is the identity, is the inverse, and associativity descends from integer addition. With multiplication they form a commutative ring with identity . A nonzero class can be a zero divisor, meaning it multiplies another nonzero class to zero. In , .
A unit is a class with a multiplicative inverse.
Unit criterion. is a unit modulo if and only if .
Proof. If the gcd is 1, Bézout gives integers with , so . Conversely, if , then is divisible by , so every common divisor of divides 1.
Bézout itself follows from the Euclidean algorithm: repeated division preserves the set of integer combinations, and back substitution expresses the last nonzero remainder, the gcd, as such a combination.
For example, , so modulo 10. Modulo a prime , every nonzero class is coprime to , so every nonzero class is a unit: is a field. Composite moduli fail: if with , the nonzero classes multiply to zero.
3 Solving a linear congruence
The congruence is solvable exactly when divides . Necessity follows because makes . For sufficiency, multiply a Bézout identity by to obtain a solution.
If one solution is , all solutions differ by multiples of modulo . Indeed, is divisible by exactly when is divisible by ; coprimality permits cancellation. There are exactly solution classes modulo .
For , divides 8. Dividing gives and the inverse of 3 modulo 7 is 5, so . The two classes modulo 14 are 6 and 13. Direct substitution verifies both.
Full integer proof reused in the congruence argument
In this integer proof means . The following division, gcd-invariance, termination and coefficient-update argument supplies the Bézout assertion used above; all signed and zero input cases are included.
Theorem
Division algorithm
Let with . Then there exist unique integers and such that
The integer is the quotient and is the remainder.
The condition is not decoration. It is what makes the remainder unique. For example,
has an allowed remainder , while
does not count as the division algorithm because is not smaller than .
For existence, first take and . The set
contains , so well-ordering supplies a least member . If , then would be a smaller nonnegative member. Hence . If and , the integer is nonnegative. Divide by the case just proved; rearranging gives with the same allowed remainder. For , divide by and replace the resulting quotient by . Thus no sign case requires a negative remainder.
For uniqueness, suppose with both remainders in range. Then , but . A nonzero integer multiple of has absolute value at least , so . Since , the remaining equality forces . The strict upper bound proves uniqueness; merely requiring a nonnegative remainder would not.
Theorem
Gcd step
If , then
Proof: Preserve the entire set of common divisors
The target is equality of two gcds. A stronger intermediate statement makes the proof direct: an integer divides both exactly when it divides both . In the forward direction use ; in the reverse direction use . Both steps use closure under integer linear combinations.
The two divisor sets therefore have the same greatest element when the inputs are not both zero. If , then and both gcds equal by convention. The identity itself does not need a remainder bound; the bound is needed to make the algorithm progress.
Concept lensAlgorithmic
An invariant and a decreasing computation
The gcd is the quantity preserved by each replacement . The remainder is the quantity made smaller. These serve different purposes: preservation proves that the final answer is the original gcd, while strict decrease proves that a final step will occur. Start with absolute values, swap to put the larger positive input first, and stop immediately if the other input is zero. In every remaining division the divisor is positive.
The algorithm must terminate because the remainders form a strictly decreasing sequence of nonnegative integers:
A strictly decreasing sequence of nonnegative integers cannot continue forever.
Back-substitution can also be organized forward. For positive inputs put , , and keep coefficients , starting with and . If , then
Substituting the two known linear combinations proves this update. Every coefficient remains integral, and the row for the last nonzero remainder supplies the required coefficients of the gcd.
Theorem
Bézout's identity
For any integers , there exist integers such that
For signed nonzero inputs, compute using and absorb their signs into the resulting coefficients. If one input is zero, use or its counterpart for ; for use . This proves all cases of the identity.
When the inputs are not both zero, the gcd is also the smallest positive integer linear combination. It is such a combination by the identity, and every positive combination is a positive multiple of the gcd, hence at least as large. For there is no positive combination.
4 Graded practice
E1 Foundation. List the units modulo 12 and identify one nonzero zero divisor.
E2 Congruence. Solve and .
E3 Well-definedness. Does define a function? Does ?
E4 Proof. In an integral domain, prove and imply . Explain why cancellation fails in .
5 Full solutions
S1. Units are , the classes coprime to 12. For example is a zero divisor since with both factors nonzero.
S2. The first reduces to , so : classes 4 and 9 modulo 10. The second has no solution because does not divide 5.
S3. Yes for : a difference divisible by 6 is divisible by 3. No for : but , so one input would receive two outputs.
S4. , and absence of zero divisors forces . Modulo 8, although , because . Nonzero is not enough for multiplicative cancellation in a ring with zero divisors.
Summary
Equivalence classes are sets of indistinguishable representatives. Operations and maps on them must be checked for well-definedness. Congruence arithmetic exhibits additive groups, rings, units and fields concretely, while the gcd controls both inverses and linear-congruence solvability.