I've tried searching the answer to my question on the internet (including MSE) but to no avail. I was reading through a proof of Wolstenholme's theorem: For $p \ge 5$, $$1 + \frac 12 + \frac 13 + \ldots + \frac 1{p - 1} = \frac mn \Longrightarrow p^2 \mid m.$$ But my question isn't actually much related to the theorem itself. Clearly the fractions above are regular fractions, but in the proof I was reading, the fractions at one point magically turn into multiplicative fractions… The proof was as follows:
- The statement is equivalent to proving $1 + \frac 12 + \ldots + \frac 1{p - 1} \equiv 0 \pmod {p^2}$.
This is supposedly justified because $a \mid m$ in $\frac mn \Longleftrightarrow$ $a \mid \frac mn$ which I don't understand at all. How do you even work with fractions mod something?
- If we pair up terms $\frac 1i$ and $\frac 1{p-i}$, we get $$\sum_{i = 1}^{p - 1} \frac 1i = \sum_{i = 1}^{\frac {p-1}2} \bigg(\frac 1i + \frac 1{p - 1}\bigg) = p \sum_{i = 1}^{\frac{p - 1}2} \frac 1{i(p - i)} \equiv 0 \pmod p.$$ This proves the result mod $p$.
I don't understand this either since clearly $\sum_{i = 1}^{\frac{p - 1}2} \frac 1{i(p - i)}$ is not necessarily an integer.
- It remains to prove $\sum_{i = 1}^{\frac{p - 1}2} \frac 1{i(p - i)} \equiv 0 \pmod p$ as well. We multiply by $2$ and since $p - i \equiv -i \pmod p$, we get $$2\sum_{i = 1}^{\frac{p - 1}2} \frac 1{i(p - i)} = \sum_{i = 1}^{p - 1} \frac {-1}{i^2} \pmod p.$$ Taking the inverse is a bijection from $\{1, \ldots, p - 1\}$ to itself so $$-\sum_{i = 1}^{p - 1} \frac 1{i^2} = -\sum_{i = 1}^{p - 1} (i^{-1})^2 = -\sum_{i = 1}^{p - 1} i^2 = -\frac{(p - 1)p(2p - 1)}6 \equiv 0 \pmod p,$$ since $p \ge 5$. QED
This is even more confusing. I understand everything except how you could possibly justify $\frac 1{i(p - i)} = \frac 1{-i^2} = -(i^2)^{-1}$ mod $p$. Just because you are working mod $p$ doesn't mean you can substitute $-i$ for $p - i$ everywhere, let alone treat regular fractions as multiplicative inverses.
I'm clearly missing something here. Could someone elaborate on why all this is possible?