Course contentsShow
← Mathematics
Lesson 2732 of 3,12154. Number TheoryFree lesson

Addition and Subtraction in Modular Arithmetic

Learn how to add and subtract congruences: if a ≡ b and c ≡ d (mod n), then a+c ≡ b+d (mod n).

Addition and Subtraction in Modular Arithmetic

What You'll Learn

You'll discover how to add and subtract numbers in modular arithmetic using the powerful property that congruent values can be combined while preserving their congruence relationships.

The Core Idea

In everyday arithmetic, if two pairs of numbers are equal, you can add them: if a = b and c = d, then a + c = b + d. Modular arithmetic has an analogous rule for congruences.

The Addition/Subtraction Rule: If a ≡ b (mod n) and c ≡ d (mod n), then:

  • a + c ≡ b + d (mod n)
  • a - c ≡ b - d (mod n)

Think of congruence classes as containers that hold all numbers with the same remainder when divided by n. This rule says you can "reach into" any container, pick representatives, perform addition or subtraction, and the result will always land in the same answer-container regardless of which representatives you chose.

Why It Works

Since a ≡ b (mod n), we know n divides (a - b). Similarly, n divides (c - d). When you add these differences together, n still divides the total: n divides [(a - b) + (c - d)] = [(a + c) - (b + d)]. Therefore, a + c ≡ b + d (mod n).

Example

Working modulo 7:

  • We know 15 ≡ 1 (mod 7) because 15 = 2·7 + 1
  • We know 23 ≡ 2 (mod 7) because 23 = 3·7 + 2

Therefore: 15 + 23 ≡ 1 + 2 ≡ 3 (mod 7)

Check: 15 + 23 = 38 = 5·7 + 3 ✓

This lets us simplify calculations by replacing numbers with their smaller congruent counterparts before computing.

Key Takeaway: Congruences are preserved under addition and subtraction—you can add or subtract corresponding sides of congruences and the result remains valid in the same modulus.