I'm reading a book and there is some strange proof (strange for me) of the theorem that within each interval, no matter how small, there are rational points. Proof: we need only take a denominator $n$ large enough so that the interval $[0, \frac{1}{n}]$ is smaller than the interval $[A, B]$ in question; then at least one of the fractions $\frac{m}{n}$ must lie within the interval.
I can't understand how they figured out that $[A, B]$ contains at least one $\frac{m}{n}$ and how it's connected to the interval $[0, \frac{1}{n}]$.
Given a natural number $n$, if no fraction with denominator $n$ is contained in $[A,B]$, then there is a fraction $\frac mn$ which is the largest one which is below $[A,B]$ (meaning $\frac mn< A$), and in addition we have that the next fraction with denominator $n$, which is $\frac{m+1}n$, must be above $[A,B]$ (meaning $B<\frac{m+1}n$).
Note take those two inequalities, and add them together, left side with left side, and right side with right side, and get $$ \frac mn+B<\frac{m+1}n +A\\ B-A<\frac{m+1}n-\frac mn=\frac1n $$ meaning that $[A,B]$ is smaller than $[0,\frac1n]$.
Reversing this (using the so-called contrapositive), it means that if $[0,\frac1n]$ is no larger than $[A,B]$, then there must be a fraction of the form $\frac mn$ in the interval $[A,B]$.