The proof we give here is closer to Euclid’s original proof. The key to that proof is the fact that if we have a fraction
\(\frac{a}{b}\) and then we find the smallest fraction equivalent to that, call if
\(\frac{x}{y}\) (ie where
\(x\) is as small as possible), then there must be some
\(n\) so that
\(a=nx\) and
\(b=ny\text{.}\) Now this feels quite obvious. Obvious until you have to prove it.
We follow the clever argument given
in this excellent article by Barry Mazur. Since the fractions
\(\frac{a}{b}\) and
\(\frac{x}{y}\) are equal, we know that
\begin{equation*}
ay = bx.
\end{equation*}
If \(a=x\) then \(n=1\) and we are done. So choose \(n\) to be the largest integer so that \(a \gt nx\text{.}\) Indeed we must have \(a-nx \geq x\) (otherwise we would pick \(n\) to be larger). And since \(x = \frac{y}{b} a\)
\begin{equation*}
nx = \frac{ny}{b} a
\end{equation*}
and so we must also have that \(ny \gt b\text{.}\)
Now consider the fraction \(\ds \frac{a-nx}{b-ny}\text{.}\) One can quickly verify by cross-multiplication that
\begin{equation*}
\frac{a-nx}{b-ny} = \frac{x}{y}.
\end{equation*}
So we have a new fraction that is also equal to \(\frac{a}{b}\) and \({x}{y}\text{.}\) But now, since \(\frac{x}{y}\) was minimal, we must have \(a-nx \geq x\text{,}\) and at the same time, we choose \(n\) so that \(a-nx \leq x\text{.}\) Thus we must have \(a-nx = x\text{.}\) In other words
\begin{equation*}
a = x(n+1).
\end{equation*}
and so \(a\) is a multiple of \(x\text{.}\) Substituting this back into \(ay=bx\) shows that
\begin{equation*}
b = y(n+1)
\end{equation*}
also.
This result implies that if we have
\begin{equation*}
\frac{a}{b}=\frac{c}{d}=r
\end{equation*}
then there is a unique smallest fraction \(\frac{x}{y}=r\) so that
\begin{align*}
a \amp=kx \amp b\amp=ky \\
c \amp=nx \amp d\amp=ny
\end{align*}
for some integers \(k,n\text{.}\) That is, the two fractions \(\frac{a}{b}, \frac{c}{d}\) reduce to the same fraction \(\frac{x}{y}\text{.}\)
Now let us go back and use this to prove that if \(p \mid ab\) and \(p \nmid b\) then \(p \mid a\text{.}\) Since \(p \mid ab\text{,}\) we know that \(ab = pc\text{.}\) Hence we have
\begin{equation*}
\frac{a}{p} = \frac{c}{b}.
\end{equation*}
From the above, we know that there exist \(k,n,x,y\) so that
\begin{align*}
a \amp= kx \amp c\amp= nx \\
p \amp= ky \amp b\amp= ny
\end{align*}
But we know that \(p\) is prime, so either \((k,y)=(p,1)\) or \((k,y)=(1,p)\text{.}\) The first case implies that \(p \mid a\text{,}\) while the second implies that \(p \mid b\text{.}\) Since \(p \nmid b\) by assumption, we know that \(p \mid a\text{.}\) And we are done.