@fresh_42 Here is what I got about how to generalize the example from Underwood's text. Before I begin, I don't like the notation ##S^{-1}A##. Does this part ##S^{-1}## of the notation denote elements in it to mean ##\frac{1}{s}\in S^{-1}, s\in S?##
Some definitions.##\\\\##
The ##p##-adic valuation ##v_p(n)## is defined as the highest exponent ##e## such that ##p^e## divides ##n##.##\\\\## Formally:##\\\\##
##v_p(n) = \max \{ e \geq 0 : p^e \mid n \}.\\\\##
For ##n = p_1^{e_1} p_2^{e_2} \cdots p_k^{e_k}##, we have ##v_{p_i}(n) = e_i##. In the context of ##(\mathbb{Z}_n)_p##, if ##p = p_i##, then ##e = v_p(n) = e_i##, and the number of equivalence classes is: ##p^{v_p(n)}.\\\\##
##\textbf{Note:}## The valuation ##v_p(n)## determines the size of the ##p##-primary component, directly giving the number of classes.##\\\\##
Definition of the ##p-##primary Component.##\\\\##
The ##p##-primary component of ##\mathbb{Z}_n## is the localization ##(\mathbb{Z}_n)_p##, isomorphic to ##\mathbb{Z}_{p^{v_p(n)}}##, consisting of fractions ##\frac{a}{b}## with ##b \in S = \{1, p, \ldots, p^{e-1}\}##. It isolates the part of ##\mathbb{Z}_n## associated with the prime ##p.\\\\##
Note that the ##p##-primary component ##(\mathbb{Z}_n)_p \cong \mathbb{Z}_{p^e}## has order ##p^e##, where ##e = v_p(n)##. The number of equivalence classes is thus:##.\\\\##
##p^{v_p(n)}## directly tied to the size of the ##p##-primary component.##\\\\##
We generalize the example of ##\mathbb{Z}_6)_3## to the general case of localization of ##\mathbb{Z}_n)_p
## in several steps, and we provide two computational examples to illustrate the steps.##\\\\##
3. Generalization of the set ##S.\\\\##
The set ##S## in the example of ##\mathbb{Z}_6)_3 ## is ##S = \{3^n : n \geq 0\} = \{1, 3\}## in ##\mathbb{Z}_6##. For the general case of ##(\mathbb{Z}_n)_p##, we define:##\\\\##
##S = \{p^k : k \geq 0\} \subset \mathbb{Z}_n,\\\\##
where ##p## is a prime dividing ##n##, and exponents ##k## are taken modulo the ring ##\mathbb{Z}_n##. Since ##n = p^e m## with ##\gcd(p, m) = 1## and ##e = v_p(n), p_i## (the ##p##-adic valuation of ##n##), we have ##p^e \equiv 0 \pmod{n}##. Thus:##\\\\##
##S = \{p^0, p^1, p^2, \ldots, p^{e-1}\} = \{1, p, p^2, \ldots, p^{e-1}\},\\\\##
since ##p^e \equiv 0 \pmod{n}##, and higher powers do not produce new elements. The set ##S## is multiplicatively closed because ##1 \in S## (for ##k = 0##) and the product ##p^k \cdot p^l = p^{k+l} \in S## if ##k + l < e##, or ##p^{k+l} \equiv 0 \notin S##, but only non-zero elements are included.##\\\\##
2. Then we list the elements of ##\mathbb{Z}_n \times S\\\\##
The set ##\mathbb{Z}_n \times S## is the Cartesian product:##\\\\##
##\mathbb{Z}_n \times S = \{(a, s) : a \in \mathbb{Z}_n, s \in S\},\\\\##
where ##\mathbb{Z}_n = \{0, 1, 2, \ldots, n-1\}## and ##S = \{1, p, p^2, \ldots, p^{e-1}\}##. Thus:##\\\\##
##\mathbb{Z}_n \times S = \{(a, p^k) : a = 0, 1, \ldots, n-1, k = 0, 1, \ldots, e-1\}.\\\\##
The number of elements is ##|\mathbb{Z}_n| \cdot |S| = n \cdot e##, since ##|S| = e.\\\\##
3. We then list the equivalence classes in ##(\mathbb{Z}_n)_p\\\\##
The equivalence relation##\\\\## on ##\mathbb{Z}_n \times S## is defined as ##(a, b) \sim (c, d)## if there exists ##s \in S## such that:
##s (ad - bc) \equiv 0 \pmod{n}.\\\\##
The localization ##(\mathbb{Z}_n)_p = S^{-1} \mathbb{Z}_n## is the set of equivalence classes ##\frac{a}{b}##, where ##(a, b) \in \mathbb{Z}_n \times S##. To list the equivalence classes, note that ##(\mathbb{Z}_n)_p \cong \mathbb{Z}_{p^e}##, where ##e = v_p(n)##. Thus, the equivalence classes correspond to residues ##\{0, 1, \ldots, p^e - 1\}## in ##\mathbb{Z}_{p^e}.\\\\##
To find representatives, consider the map ##\lambda:\mathbb{Z}_n \to (\mathbb{Z}_n)_p, a \mapsto \frac{a}{1}##. The equivalence classes are:
$$\{\frac{a}{1} : a = 0, 1, \ldots, p^e - 1\}$$
where ##\frac{a}{1} = \frac{c}{d}## if there exists ##s = p^k \in S## such that ##p^k (ad - c) \equiv 0 \pmod{n}##. Since ##n = p^e m##, this implies ##ad \equiv c \pmod{p^e}.\\\\##
4. We then eliminate the repeats of equivalence c'lasses##\\\\##
To eliminate repeats, choose representatives ##\frac{a}{1}## for ##a = 0, 1, \ldots, p^e - 1##. For any ##(c, d) \in \mathbb{Z}_n \times S##, find an ##a## for which:##\\\\##
##\frac{c}{d} = \frac{a}{1} \implies \exists s = p'^k \in S \text{ such that } p^k (c - ad) \equiv 0 \pmod{n}.\\\\##
Since ##n = p^e m##, this means ##c \equiv ad \pmod{p^e}##. Solve for ##a \equiv c d^{-1} \pmod{p^e}##, where ##d = p^k## is invertible modulo ##p^e## (since ##\gcd(p^k, p^e) = p^k##). We calculate the inverse via employing the extended Euclidean algorithm. The steps can be summarized in a##\\\\##
##\textbf{systematic processes:}\\\\##
1'. For each ##(c, p^k) \in \mathbb{Z}_n \times S##, compute ##d^{-1} \pmod{p^e}.\\\\##
2'. Compute ##a \equiv c d^{-1} \pmod{p^e}.\\\\##
3'. The class of ##(c, p^k)## is ##\frac{a}{1}.\\\\##
This ensures each class is represented exactly once by ##\frac{a}{1}, a = 0, 1, \ldots, p^e - 1.\\\\##
##\textbf{Note:}## The choice of representatives modulo ##p^e## avoids duplication by mapping all pairs to a unique residue.##\\\\##
5. Making sure the elements in the list is exhaustive##\\\\##
The list ##\{\frac{0}{1}, \frac{1}{1}, \ldots, \frac{p^e - 1}{1}\}## is exhaustive because:##\\\\##
- ##\textbf{Surjectivity:}## Every ##(c, p^k) \in \mathbb{Z}_n \times S## is equivalent to some ##\frac{a}{1}##, as shown above.##\\\\##
- ##\textbf{Injectivity:}## If ##\frac{a}{1} = \frac{b}{1}##, then there exists ##p^k \in S## such that ##p^k (a - b) \equiv 0 \pmod{n}##, implying ##a \equiv b \pmod{p^e}##, so ##a = b## in ##\{0, 1, \ldots, p^e - 1\}.\\\\##
Since ##(\mathbb{Z}_n)_p \cong \mathbb{Z}_{p^e}##, and ##\mathbb{Z}_{p^e}##has exactly ##p^e## elements, the list covers all classes.##\\\\##
6. The number of equivalence classes##\\\\##
The number of equivalence classes in ##(\mathbb{Z}_n)_p## is the order of the ring ##\mathbb{Z}_{p^e}##, which is: ##p^e, \text{ where } e = v_p(n).\\\\##
This is due to the isomorphism ##(\mathbb{Z}_n)_p \cong \mathbb{Z}_{p^e}.\\\\##
##\textbf{Note:}## The formula ##p^{v_p(n)}## counts the elements in the ##p##-primary component.##\\\\##
Showing ##(\mathbb{Z}_n)_p \cong \mathbb{Z}_{p^e}.\\\\##
7. Functions ##f## and ##f^{-1}## for the Isomorphism ##(\mathbb{Z}_n)_p \cong \mathbb{Z}_{p^e}\\\\##
Define the isomorphism ##f: (\mathbb{Z}_n)_p \to \mathbb{Z}_{p^e}## and its inverse:##\\\\##
##f\left( \frac{a}{b} \right) = a b^{-1} \pmod{p^e}, \quad b = p^k \in S,\\\\##
where ##b^{-1}## is the inverse of ##b## modulo ##p^e##. The inverse is:##\\\\##
##f^{-1}(c) = \frac{c}{1}, \quad c \in \mathbb{Z}_{p^e}.\\\\##
##\textbf{Computing compositions:} f \circ f^{-1},f^{-1} \circ f\\\\##
- ##f \circ f^{-1}:\\\\##
##f(f^{-1}(c)) = f\left( \frac{c}{1} \right) = c \cdot 1^{-1} \equiv c \pmod{p^e},\\\\##
so ##f \circ f^{-1} = \text{id}_{\mathbb{Z}_{p^e}}.\\\\##
- ##f^{-1} \circ f:\\\\##
##f^{-1}\left( f\left( \frac{a}{b} \right) \right) = f^{-1}(a b^{-1}) = \frac{a b^{-1}}{1} = \frac{a}{b}= \text{id}_{(\mathbb{Z}_n)_p},\\\\##
because ##\frac{a b^{-1}}{1} = \frac{a}{b}## in ##(\mathbb{Z}_n)_p##, as ##b (a b^{-1} \cdot 1 - a \cdot 1) = b (a b^{-1} - a) = a - a = 0.\\\\##
8. ##\textbf{Computational examples:}\\\\##
##\textbf{Examples for: }n = 232792560\\\\##
We compute ##n##'s factorization:##\\\\##
The factorization of ##232792560## is ##232792560 = 2^4 \cdot 3^2 \cdot 5 \cdot 7 \cdot 47 \cdot 2207.\\\\##
##\mathbf{p = 2: }\\\\##
- For ##p = 2, e = v_2(n) = 4##, so ##S = \{2^0, 2^1, 2^2, 2^3\} = \{1, 2, 4, 8\}##. Then:##\\\\##
##\mathbb{Z}_{232792560} \times S = \{(a, s) : a = 0, 1, \ldots, 232792559, s \in \{1, 2, 4, 8\}\},\\\\##
with ##232792560 \cdot 4 = 931170240## elements.##\\\\##
- For ##p = 2, e = 4##, so ##p^e = 2^4 = 16##. The classes are ##\{\frac{0}{1}, \frac{1}{1}, \ldots, \frac{15}{1}\}## in ##\mathbb{Z}_{16}.\\\\##
- And, ##e = v_2(n) = 4##, and so there are ##2^4 = 16## classes.##\\\\##
- Also, ##p = 2, e = 4, p^e = 16\\\\##.
Let ##\frac{a}{b} = \frac{5}{2}: q\left( \frac{5}{2} \right) = 5 \cdot 2^{-1} \pmod{16}.\\\\##
Compute ##2^{-1} \pmod{16}: 2 \cdot 8 = 16 \equiv 0##, but ##2 \cdot 9 = 18 \equiv 2 \pmod{16}##, so no inverse exists unless restricted to odd numbers. For in ##\mathbb{Z}_{16}##, we use the extended Euclidean algorithm. Also we verify the representative class:##\\\\##
##q^{-1}(5) = \frac{5}{1}.\\\\##
##\mathbf{p = 3: }\\\\##
- For ##p = 3, e = v_3(n) = 2##, so ##S = \{1, 3\}##. Then:##\\\\##
##\mathbb{Z}_{232792560} \times S = \{(a, s) : a = 0, 1, \ldots, 232792559, s \in \{1, 3\}\},####\\\\##
with ##232792560 \cdot 2 = 465585120## elements.##\\\\##
- And, ##p = 3, e = 2##, so ##p^e = 3^2 = 9##. The classes are ##\{\frac{0}{1}, \frac{1}{1}, \ldots, \frac{8}{1}\}## in ##\mathbb{Z}_9.\\\\##
- Also, ##p = 3, e = v_3(n) = 2##, and so there are ##3^2 = 9## classes.##\\\\##
##q^{-1}(5) = \frac{5}{1}.\\\\##
- Lastly, ##p = 3, e = 2, p^e = 9, \frac{a}{b} = \frac{5}{3}:\\\\##
##q\left( \frac{5}{3} \right) = 5 \cdot 3^{-1} \pmod{9}.\\\\##
Since ##3 \cdot 3 = 9 \equiv 0##, the inverse is: ##3 \cdot 6 = 18 \equiv 0##, but compute modulo 9 correctly later.##\\\\##