The Timpson Lyceum · Discrete Math (2025)
Number Theory and Dividing - Lecture 18 (Discrete Math)
Overview
This lecture opens the study of number theory — the analysis of the integers and rationals under the basic axioms of arithmetic — with its single most foundational result: the Division Algorithm. The idea is the same long division you learned in grade school, made precise: dividing one integer by a positive integer produces exactly one quotient and exactly one remainder. We make the statement rigorous, practice it through the div and mod operations (including the subtle case of negative dividends), and then prove it in full. The lecture closes with two corollaries that fall right out of the theorem: every integer is even or odd but not both, and two integers are congruent modulo 2 exactly when they have the same parity.
Key Concepts
-
The Division Algorithm. Let and be integers with . Then there exist unique integers and such that Here is the quotient (how many times fits into ) and is the remainder. The restriction loses no generality: division involving negatives reduces to a positive divisor.
-
Why the remainder must satisfy . If were equal to or larger than , you could pull out one more copy of and lower the remainder. So is never allowed — the remainder is always strictly smaller than the divisor, and it may be .
-
divandmod. Given the same , , , :- — returns only the quotient.
- — returns only the remainder.
This is exactly the
modoperator from programming. It is an operation (two numbers in, one number out), distinct from the congruence relation , which relates two numbers but is not the same thing.
-
Negative dividends. With a negative , your first instinct gives a negative remainder, which is illegal. Fix it by lowering the quotient by one and adding to the remainder. For example, : the naive " remainder " becomes , , since .
-
Modding by small divisors. is when is even and when is odd. for every integer , since divides every integer evenly.
-
Proof tools. The Well-Ordering Principle — every non-empty subset of the natural numbers has a least element — drives the existence half of the proof. Uniqueness uses proof by contradiction: assume a second answer exists and show it must equal the first.
-
Corollary 1 — parity. Every integer is even or odd, and not both. Dividing any by forces a unique remainder of or : remainder means (even), remainder means (odd).
-
Corollary 2 — congruence mod 2. if and only if and have the same parity, where means .
Worked Example
Existence half of the Division Algorithm. Fix integers with . Build the set of all possible remainders and pick the smallest non-negative one.
It remains to show . Suppose instead . Then set . Since we get , so , yet — contradicting that is the least element of . Hence .
Uniqueness. Suppose with both remainders in . Subtracting gives , so . But two numbers in differ by at most , and the only multiple of with absolute value below is . Thus , and then with forces . The quotient and remainder are unique.
Summary
- The Division Algorithm says that for integers and there are unique integers with and — formalizing grade-school division.
- The remainder is always non-negative and strictly less than the divisor; if it isn't, pull out another .
- gives the quotient and gives the remainder; this
modis an operation, not the congruence relation. - For negative dividends, lower the quotient by one and add to keep the remainder in range, e.g. .
- Existence comes from the Well-Ordering Principle (the smallest non-negative member of is the remainder); uniqueness comes from a contradiction argument.
- Two quick corollaries: every integer is even or odd but not both, and exactly when and share the same parity.