Similarly, we can solve equations like \(\frac{2}{3}\cdot x=5\) over the rational numbers. Why? Because \(\frac{2}{3}\) has a (group) inverse in the group \(\mathbb{Q}\setminus\{0\}\) (under multiplication), namely \(\left(\frac{2}{3}\right)^{-1}=\frac{3}{2}\text{,}\) and

First, this is certainly a set. Since we earlier proved that any two elements of a residue class have the same gcd with a modulus, the definition makes sense, and we know how to check if something is in it.

Next, the set is associative with respect to multiplication, because it’s really the same as multiplication over \(\mathbb{Z}\text{.}\) The identity element \([1]\) is likewise inherited from \(\mathbb{Z}\text{.}\) We have inverses because we only allow elements that will have solutions to \(ax\equiv 1\) according to Proposition 5.1.1; see also Question 5.3.6 and Exercise 5.6.5.

Finally, we do need to check whether the multiplication is closed on this set. After all, it’s not obvious that if \(ax\equiv 1\) and \(bx\equiv 1\) have solutions, then so does \((ab)x\equiv 1\text{!}\) But if \(\gcd(a,n)\) and \(\gcd(b,n)\) are both \(1\text{,}\) then \(ab\) will also be coprime to \(n\text{,}\) which is all that is needed^{ 1 }. All in all, that means \(U_n\) really and truly is a group.

Subsubsection9.1.2.2More facts and examples

The terminology units makes sense too. If you are in a number system with addition and multiplication, then a unit is an element that has a multiplicative inverse.

Example9.1.5.

Here are some examples of units.

In the integers, \(\pm 1\) are the units.

More unusual is the set of complex numbers (!), which are all units (except zero). In fact, the inverse of \(r\left(\cos(\theta)+i\sin(\theta)\right)\) is

And \(U_n\) is the set of all the integers modulo \(n\) that have multiplicative inverses. By our previous investigations, we know this is when \(ax\equiv 1\) (mod \(n\)) has a solution. Since multiplication is the operation, there are inverses!

Naturally, it can take a while to list all the elements of \(U_n\text{,}\) but it’s worth doing. Try it for \(n=10\text{,}\)\(n=11\text{,}\) and \(n=12\) by hand (see Exercise 9.6.1).

Sage has commands to list the group of units and give the order of the group. Try them interactively here, or individually below.

Sage note9.1.6.Reminder to try things out.

Remember, you can use these yourself by using these commands, or by cutting and pasting them in a Sage or Jupyter notebook, CoCalc, or command line interface. They are tedious to type, though!

Try proving this two ways, using tools in Chapter 3 and then those in Chapter 6.