Set of Rational Numbers whose Numerator Divisible by p is Closed under Addition

Theorem
Let $p$ be a prime number.

Let $A_p$ be the set of all rational numbers which, when expressed in canonical form has a numerator which is divisible by $p$.

Then $A_p$ is closed under rational addition.

Proof
Let $a, b \in A_p$.

Then $a = \dfrac {p n_1} {d_1}, b = \dfrac {p n_1} {d_1}$ where:
 * $n_1, n_2 \in \Z$
 * $d_1, d_2 \in \Z_{>0}$
 * $p n_1 \perp d_1, p n_2 \perp d_2$.

Then:

From Euclid's Lemma for Prime Divisors, if $p \mathop \backslash d_1 d_2$ then either $p \mathop \backslash d_1$ or $p \mathop \backslash d_2$.

But neither of these is the case, so $p \nmid d_1 d_2$.

Hence by Prime Not Divisor then Coprime:
 * $p \perp d_1 d_2$

where $\perp$ denotes coprimeness.

Now consider $\dfrac {q_1}{q_2} = \dfrac {n_1 d_2 + n_2 d_1} {d_1 d_2}$.

To express $\dfrac {q_1}{q_2}$ in canonical form, it is necessary to divide top and bottom by $\gcd \left\{{q_1, q_2}\right)$.

As $p \nmid q_2$ it follows that $p \nmid \gcd \left\{{q_1, q_2}\right)$.

Thus $\dfrac {p \left({n_1 d_2 + n_2 d_1}\right)} {d_1 d_2} \in A_p$.

Hence the result.