Folioby Interconnected
Log InSign Up

Divisibility and Congruences — Laying the Foundations of Number Theory

Starting from the definition of divisibility, we give a rigorous proof of the division algorithm (existence and uniqueness). We then introduce congruences, establish their basic properties and arithmetic rules, and construct the quotient ring Z/nZ.

FO
Folio Official
March 1, 2026

1 Definition of Divisibility

Definition 1 (Divisibility).
For integers a,b with a=0, we say that adividesb if there exists an integer q such that b=aq. We write a∣b. If a does not divide b, we write a∤b.
Theorem 2 (Basic properties of divisibility).
For integers a,b,c, the following hold:
  1. If a∣b and b∣c, then a∣c (transitivity).

  2. If a∣b and a∣c, then a∣(bx+cy) for all integers x,y (linear combinations).

  3. If a∣b and b∣a, then a=±b.

  4. If a∣b and b=0, then ∣a∣≤∣b∣.

Proof.
(1) Write b=aq1​ and c=bq2​. Then c=a(q1​q2​), so a∣c.

(2) Write b=aq1​ and c=aq2​. Then bx+cy=a(q1​x+q2​y), so a∣(bx+cy).

(3) Write b=aq1​ and a=bq2​. Then a=aq1​q2​, which gives q1​q2​=1. Since q1​,q2​ are integers, we must have q1​=q2​=1 or q1​=q2​=−1, so a=±b.

(4) Since b=aq and b=0, we have q=0, hence ∣q∣≥1. Therefore ∣b∣=∣a∣⋅∣q∣≥∣a∣. □

2 The Division Algorithm

Theorem 3 (Division algorithm).
For any integer a and positive integer b, there exist unique integers q (quotient) and r (remainder) such that
a=bq+r,0≤r<b.
Proof.
Existence. Consider the set S={a−bk∣k∈Z,a−bk≥0}. By choosing k sufficiently small, we can ensure a−bk>0, so S=∅. By the well-ordering principle, S has a least element r=a−bq. Since r∈S, we have r≥0. Suppose for contradiction that r≥b. Then r−b=a−b(q+1)≥0 and r−b<r, contradicting the minimality of r. Therefore 0≤r<b.

Uniqueness. Suppose a=bq1​+r1​=bq2​+r2​ with 0≤r1​,r2​<b. Then b(q1​−q2​)=r2​−r1​, so b∣(r2​−r1​). Since ∣r2​−r1​∣<b, it follows that r2​−r1​=0, and hence q1​=q2​. □

3 Congruences: Definition and Basic Properties

Definition 4 (Congruence).
For integers a,b and a positive integer n, we say that a is congruent tobmodulon if n∣(a−b), and write a≡b(modn).
Theorem 5 (Congruence is an equivalence relation).
For any integers a,b,c and positive integer n:
  1. a≡a(modn) (reflexivity).

  2. If a≡b(modn), then b≡a(modn) (symmetry).

  3. If a≡b(modn) and b≡c(modn), then a≡c(modn) (transitivity).

Proof.
(1) Since n∣0, we have a≡a. (2) If n∣(a−b), then n∣(b−a). (3) If n∣(a−b) and n∣(b−c), then n∣((a−b)+(b−c))=n∣(a−c). □
Theorem 6 (Arithmetic of congruences).
If a≡b(modn) and c≡d(modn), then:
  1. a+c≡b+d(modn).

  2. a−c≡b−d(modn).

  3. ac≡bd(modn).

  4. ak≡bk(modn) for every non-negative integer k.

Proof.
Write a−b=ns and c−d=nt. (1) (a+c)−(b+d)=n(s+t). (2) Analogous. (3) ac−bd=ac−bc+bc−bd=c(a−b)+b(c−d)=cns+bnt=n(cs+bt). (4) Follows by induction, applying (3) repeatedly. □

4 The Quotient RingZ/nZ

Definition 7 (Residue class).
For a positive integer n, the residue class of an integer a modulo n is aˉ={a+kn∣k∈Z}. The set of all n residue classes is denoted Z/nZ={0ˉ,1ˉ,…,n−1​}.
Remark 8.
The addition aˉ+bˉ=a+b​ and multiplication aˉ⋅bˉ=ab on Z/nZ are well-defined (independent of the choice of representatives), and Z/nZ forms a commutative ring. This ring is an integral domain if and only if n is prime, in which case Z/nZ is a field.
Example 9.
In Z/6Z, we have 2ˉ⋅3ˉ=0ˉ, so 2ˉ and 3ˉ are zero divisors and Z/6Z is not an integral domain. On the other hand, in Z/5Z every nonzero element is invertible (2ˉ⋅3ˉ=1ˉ, 4ˉ⋅4ˉ=1ˉ), so Z/5Z is a field.
Number TheoryAlgebraTextbookDivisibilityCongruences
FO
Folio Official

Mathematics "between the lines" — exploring the intuition textbooks leave out, written in LaTeX on Folio.

1 followers·107 articles
Number Theory TextbookPart 2 of 13
Previous
Number Theory: A Complete Summary of Definitions, Theorems, and Proofs
Next
The Greatest Common Divisor and the Euclidean Algorithm — Algebraic Foundations of an Algorithm

Share your expertise with the world

Write articles with LaTeX support, build your audience, and earn from your knowledge.

Start Writing — It's Free

More from Folio Official

Folio Official·March 1, 2026

Continued Fractions and Diophantine Approximation — The Theory of Rational Approximation

We define finite and infinite continued fractions, prove convergence, and rigorously establish the properties of convergents. We develop the theory of best rational approximations, solve the Pell equation x^2 - Dy^2 = 1 via continued fractions, and discuss the Stern--Brocot tree.

Number TheoryAlgebraTextbook
3
Folio Official·March 1, 2026

Primes and the Fundamental Theorem of Arithmetic — The Atomic Decomposition of Integers

We define prime numbers and establish their basic properties, including Euclid's proof of the infinitude of primes. We then give a rigorous proof of the fundamental theorem of arithmetic (existence and uniqueness of prime factorization), and discuss the sieve of Eratosthenes and the Miller--Rabin primality test.

Number TheoryAlgebraTextbook
3
Folio Official·March 1, 2026

Introduction to Algebraic Integers — Extending the Notion of Integer

Using the Gaussian integers Z[i] and the Eisenstein integers Z[omega] as concrete examples, we introduce rings of algebraic integers. We demonstrate the failure of unique factorization in Z[sqrt(-5)] and show how ideals and prime ideal factorization restore uniqueness. We define the class number and discuss its significance.

Number TheoryAlgebraTextbook
2
Folio Official·March 1, 2026

Arithmetic Functions and Multiplicative Functions — Functions on the Integers

We systematically define the principal multiplicative functions (phi, sigma, mu, d), develop the ring structure of Dirichlet convolution, and give a rigorous proof of the Moebius inversion formula. We also clarify the connection to the inclusion-exclusion principle.

Number TheoryAlgebraTextbook
1