Lecture 13: modular division and exponentiation


We quickly did the proof that multiplication in Zm is well defined. It is very similar to the proof that addition of equivalence classes is well defined.

Proof sketch: Assume [a] = [aʹ] and [b] = [bʹ]. Unfolding these definitions gives a = aʹ − mc and b = bʹ − mc. Muliplying these gives ab = aʹbʹ + m(⋯). Rearranging gives us ab − aʹbʹ = m(⋯), so mab − aʹbʹ, and thus [ab] = [aʹbʹ] as required.


Raising an equivalence class to an integer power is well defined.

In more detail: exp: Zm × Z → Zm given by exp: [a], n↦[an] is well defined. We could prove this directly, but it follows from the fact that raising a to the n is just multiplying a by itself n times. One can do induction on n; the inductive step just uses the fact that multiplication is well defined.

Raising an integer (or an equivalence class) to the power of an equivalence class is not well defined.

In more detail: exp: Z × ZmZm given by exp: n, [a]↦[na] is not well defined. For example, working mod 5, we would hope that 2[3] = 2[8]. But 23 = 8 and 28 = 256, and [8] = [3] ≠ [1] = [256].

Summary: [a]n is okay, n[a] is not.

We will recover exponentiation next lecture.


Unlike the integers, you can divide by some of the elements of Zm.



Units in Zm

Important Fact: [a] ∈ Zm is a unit if and only if gcd(a, m) = 1. This is only true if a and m share no common factors (other than 1). In this case, a and m are said to be coprime or relatively prime.

You are proving this fact on the current homework.

Definition: (Zm) *  is the set of units of Zm.


Definition: The totient of m, written ϕ(m) is the number of units of Zm.