Class: CSE 16 Subject: computer-science discrete-math Date: 2024-11-06 Teacher: Prof. Musacchio

Contrapositive Proof

Congruent Modulo n

  • Given integers and and , we say that and are congruent modulo if . We express this as (mod n). If and are not congruent modulo , we write this as (mod n).

Examples

  1. (mod 4) because .
  2. (mod 4) because .
  3. (mod 4) because .
  • In practical terms, a ≡ b (mod n) means that a and b have the same remainder when divided by n.

Example 1

  • Proposition Let a, b ∈ Z and n ∈ N. If a ≡ b (mod n), then a2 ≡ b2 (mod n).
    • Proof. Suppose a ≡ b (mod n).
    • By definition of congruence of integers, this means n | (a − b).
    • Then by definition of divisibility, there is an integer c for which a − b = nc.
    • Now multiply both sides of this equation by a + b.
      • a − b = nc
      • (a − b)(a + b) = nc(a + b)
      • a2 − b2 = nc(a + b)
    • Since c(a + b) ∈ Z, the above equation tells us n | (a2 − b2).
    • According to Definition 5.1, this gives a2 ≡ b2 (mod n)