For every positive real number, there exists an infinite sequence in the Stern Brocot tree (beggining at its root 1/1) that converges to the real number.
Can you please help me find the proof of this theorem?
My idea is to use the fact that every real number is present exactly once in the tree, and there are theoretically infinitely many ways how to "create" the branch, however I do not know how to proof the convergence.
Prerequisite / recommended reading:
- Stern-Brocot tree
- Computing Ancestors of # for Stern-Brocot Tree
For every positive real number, there exists an infinite sequence in the Stern Brocot tree [ .. ] that converges to the real number. And the OP asks us to prove this.Without loss of generality, attention shall be restricted to the (open) interval $]0,1[$. So let $0 \lt g \lt 1$ such a real number. For numbers $g > 1$, simply take $1/g < 1$ and turn fractions upside down in the end. At a certain level in the tree we have fractions with numerators $(m_1,m_2)$ and denominators $(m_2,n_2)$ such that: $$ \frac{m_1}{n_1} \lt g \lt \frac{m_2}{n_2} $$ Lemma. $$ m_2 n_1 - m_1 n_2 = 1 $$ Proof by mathematical induction.
The tree is rooted by the fractions $0/1$ and $1/1$, hence: $1\cdot 1 - 0\cdot 1 = 1$. And it may be continued in exactly two ways, namely
1. By tightening the lower bound $m_1/n_1$: $$ \frac{m_1+m_2}{n_1+n_2} \lt g \lt \frac{m_2}{n_2} \quad \Longrightarrow \quad m_2(n_1+n_2) - (m_1+m_2)n_2 = m_2 n_1 - m_1 n_2 = 1 $$ 2. By tightening the upper bound $m_2/n_2$: $$ \frac{m_1}{n_1} \lt g \lt \frac{m_1+m_2}{n_1+n_2} \quad \Longrightarrow \quad (m_1+m_2)n_1 - m_1(n_1+n_2) = m_2 n_1 - m_1 n_2 = 1 $$ This already proves the Lemma.
In practice, the tree search for $g$ is ended when its fractional approximation is within certain error bounds: $$ \left|\, g - \frac{m_1+m_2}{n_1+n_2}\, \right| < \epsilon $$ With help of the above Lemma we easily derive: $$ \frac{m_1}{n_1} \lt g \lt \frac{m_2}{n_2} \\ \frac{m_1}{n_1} - \frac{m_1+m_2}{n_1+n_2} \lt g - \frac{m_1+m_2}{n_1+n_2} \lt \frac{m_2}{n_2} - \frac{m_1+m_2}{n_1+n_2} \\ - \frac{1}{n_1(n_1+n_2)} \lt g - \frac{m_1+m_2}{n_1+n_2} \lt \frac{1}{(n_1+n_2)n_2} $$ It follows that convergence to $g$ is quadratically with the inverse of the denominators. Another consequence is: $$ \frac{m_1}{n_1} \lt \frac{m_1+m_2}{n_1+n_2} \lt \frac{m_2}{n_2} $$ That's where the name mediant comes from.
The above may be implemented in a computer program. The sample code below is written in my favorite programming language (Delphi) Pascal. An approximation is sought for $g = \ln(2)/\ln(3)$, which indeed is a real number between zero and one. Output: