Multiplicative Inverses in Congruences Recall the Cancellation property of congruences: m ). ac ≡ bc (mod m) ⇒ a ≡ b (mod (c,m ) € € € This means that in general, division is not an allowable operation for congruences: if ac ≡ bc € (mod m), we may not be able to conclude that a ≡ b (modm). This is possible only if (c, m) = 1. In other words, numbers have multiplicative inverses mod m only when they are relatively prime to m. How do we tell? By using the Euclidean algorithm, we can check that (c, m) = 1, but by using the extended Euclidean algorithm, we can actually find the inverse of c: (c, m) = 1 ⇒ ∃x, y (cx + my = 1) ⇒ ∃x, y (cx + my ≡ 1 (mod m)) ⇒ ∃x, y (cx ≡ 1 (mod m)) whence x is the multiplicative inverse of c mod m. (Recall that while the integer x is not a unique € solution to the Diophantine equation cx + my = 1, all other solutions are conrguent to x mod m, so the congruence class of x is unique; that is, c has a unique multiplicative inverse as a congruence class mod m.) We can now extend our knowledge about solving linear Diophantine equations to the solution of linear congruences. Fundamental Theorem of Linear Congruences The linear congruence ax ≡ b (mod m) is solvable only if (a, m)|b. When it does have solutions, the congruence has exactly (a, m) congruence classes of solutions: if x0 is one congruence class that solves € the congruence, all others have the form € € € €m x = x0 + (a,m) k, for k = 0,1,K, (a,m) − 1. Proof Solving the congruence ax ≡ b (mod m) is equivalent to solving the linear Diophantine €equation ax + my = b. So by Brahmagupta’s Theorem, the congruence is solvable precisely when € (a, m)|b, and has solutions of the desired form m k for integral values of k. These x = x0 + (a,m) € solutions are distinct mod m for exactly the (a, m) values indicated above. // € €