[proofplan]
We prove (ii) first by induction on $n$, using the recurrences $p_n = a_n p_{n-1} + p_{n-2}$ and $q_n = a_n q_{n-1} + q_{n-2}$ with initial data $p_{-1} = 1$, $q_{-1} = 0$, $p_0 = a_0$, $q_0 = 1$. The base case is a direct computation; the inductive step rewrites $[a_0, \ldots, a_n, \beta] = [a_0, \ldots, a_{n-1}, \gamma]$ with $\gamma = a_n + 1/\beta$ and substitutes into the inductive hypothesis. Part (i) then follows by specialising $\beta = a_{n+1}$. The strict-betweenness claim is deduced from the mediant inequality: the "weighted mediant" $(\beta p_n + p_{n-1})/(\beta q_n + q_{n-1})$ lies between $p_n/q_n$ and $p_{n-1}/q_{n-1}$ whenever $\beta > 0$.
[/proofplan]
[step:Recall the recurrences defining $p_n, q_n$]
Fix partial quotients $a_0 \in \mathbb{Z}$ and $a_1, a_2, \ldots \in \mathbb{Z}_{\geq 1}$. The convergent sequences $(p_n)_{n \geq -1}$ and $(q_n)_{n \geq -1}$ are defined by
\begin{align*}
p_{-1} &= 1, & p_0 &= a_0, & p_n &= a_n p_{n-1} + p_{n-2} \quad (n \geq 1), \\
q_{-1} &= 0, & q_0 &= 1, & q_n &= a_n q_{n-1} + q_{n-2} \quad (n \geq 1).
\end{align*}
An induction on $n$ using $a_n \geq 1$ for $n \geq 1$ gives $q_n \geq q_{n-1} \geq 1$ for $n \geq 1$, with strict inequality once $n \geq 2$. In particular, $q_n > 0$ for all $n \geq 0$.
The continued fraction bracket $[a_0, a_1, \ldots, a_n, \beta]$ is defined for $\beta \in \mathbb{R}_{>0}$ by the nested expression
\begin{align*}
[a_0, a_1, \ldots, a_n, \beta] &:= a_0 + \cfrac{1}{a_1 + \cfrac{1}{a_2 + \cfrac{1}{\ddots a_n + \cfrac{1}{\beta}}}}.
\end{align*}
[/step]
[step:Prove (ii) by induction on $n$]
We establish the identity
\begin{align*}
[a_0, a_1, \ldots, a_n, \beta] &= \frac{\beta p_n + p_{n-1}}{\beta q_n + q_{n-1}} \qquad (\text{for all } n \geq 0 \text{ and all } \beta > 0)
\end{align*}
by induction on $n$.
**Base case** $n = 0$. Direct computation gives
\begin{align*}
[a_0, \beta] &= a_0 + \frac{1}{\beta} = \frac{\beta a_0 + 1}{\beta} = \frac{\beta p_0 + p_{-1}}{\beta q_0 + q_{-1}},
\end{align*}
since $p_0 = a_0$, $p_{-1} = 1$, $q_0 = 1$, $q_{-1} = 0$.
**Inductive step.** Assume the identity holds for some $n - 1 \geq 0$ and all $\beta > 0$. Fix $\beta > 0$ and set
\begin{align*}
\gamma &:= a_n + \frac{1}{\beta}.
\end{align*}
Since $a_n \geq 1$ and $\beta > 0$, we have $\gamma > 0$. By the definition of the continued fraction bracket (unfolding the innermost two partial quotients),
\begin{align*}
[a_0, a_1, \ldots, a_{n-1}, a_n, \beta] &= [a_0, a_1, \ldots, a_{n-1}, \gamma].
\end{align*}
Applying the inductive hypothesis at level $n-1$ with parameter $\gamma$:
\begin{align*}
[a_0, a_1, \ldots, a_{n-1}, \gamma] &= \frac{\gamma p_{n-1} + p_{n-2}}{\gamma q_{n-1} + q_{n-2}}.
\end{align*}
Substituting $\gamma = a_n + 1/\beta$ and clearing the inner fraction by multiplying numerator and denominator by $\beta$:
\begin{align*}
\frac{\gamma p_{n-1} + p_{n-2}}{\gamma q_{n-1} + q_{n-2}} &= \frac{\beta(a_n p_{n-1} + p_{n-2}) + p_{n-1}}{\beta(a_n q_{n-1} + q_{n-2}) + q_{n-1}} = \frac{\beta p_n + p_{n-1}}{\beta q_n + q_{n-1}},
\end{align*}
using the recurrences $p_n = a_n p_{n-1} + p_{n-2}$ and $q_n = a_n q_{n-1} + q_{n-2}$. This completes the induction.
[guided]
We want to prove the identity
\begin{align*}
[a_0, a_1, \ldots, a_n, \beta] &= \frac{\beta p_n + p_{n-1}}{\beta q_n + q_{n-1}}
\end{align*}
for every $n \geq 0$ and every $\beta > 0$. Why fix $\beta$ as a free parameter throughout the induction rather than prove the statement for a specific value? The key observation is that the inductive step unfolds the innermost two partial quotients — $a_n$ and $\beta$ — into a single new "parameter" $\gamma = a_n + 1/\beta$, and this collapsed value need not be a partial quotient of the original sequence. If we had only proved the identity for $\beta \in \mathbb{Z}_{\geq 1}$, we could not apply the inductive hypothesis at $\gamma$, which is a general positive real.
**Base case.** For $n = 0$, we compute both sides directly. The left side is
\begin{align*}
[a_0, \beta] &= a_0 + \frac{1}{\beta} = \frac{a_0 \beta + 1}{\beta}.
\end{align*}
The right side uses the initial data of the recurrences: $p_0 = a_0$, $p_{-1} = 1$, $q_0 = 1$, $q_{-1} = 0$, giving
\begin{align*}
\frac{\beta p_0 + p_{-1}}{\beta q_0 + q_{-1}} &= \frac{\beta a_0 + 1}{\beta \cdot 1 + 0} = \frac{\beta a_0 + 1}{\beta}.
\end{align*}
The two sides agree.
**Inductive step.** Suppose the identity holds at level $n-1$ for all positive real parameters. Fix $\beta > 0$. The trick is to fold the tail of the bracket: observe that the innermost piece of $[a_0, \ldots, a_n, \beta]$ is
\begin{align*}
a_n + \frac{1}{\beta},
\end{align*}
which we christen $\gamma$. Since $a_n \geq 1$ and $\beta > 0$, $\gamma > 0$, so $\gamma$ is a legitimate input for the inductive hypothesis at level $n-1$. Moreover, by the very definition of the continued fraction bracket,
\begin{align*}
[a_0, \ldots, a_{n-1}, a_n, \beta] &= [a_0, \ldots, a_{n-1}, \gamma].
\end{align*}
The inductive hypothesis applied at level $n-1$ to the parameter $\gamma$ yields
\begin{align*}
[a_0, \ldots, a_{n-1}, \gamma] &= \frac{\gamma p_{n-1} + p_{n-2}}{\gamma q_{n-1} + q_{n-2}}.
\end{align*}
Now we substitute $\gamma = a_n + 1/\beta$. Multiplying numerator and denominator by $\beta$ to clear the inner fraction:
\begin{align*}
\frac{\gamma p_{n-1} + p_{n-2}}{\gamma q_{n-1} + q_{n-2}} &= \frac{(\beta a_n + 1) p_{n-1} + \beta p_{n-2}}{(\beta a_n + 1) q_{n-1} + \beta q_{n-2}} = \frac{\beta(a_n p_{n-1} + p_{n-2}) + p_{n-1}}{\beta(a_n q_{n-1} + q_{n-2}) + q_{n-1}}.
\end{align*}
The recurrences now reduce the bracketed sums to $p_n$ and $q_n$:
\begin{align*}
&= \frac{\beta p_n + p_{n-1}}{\beta q_n + q_{n-1}}.
\end{align*}
This completes the inductive step and hence the proof of (ii).
[/guided]
[/step]
[step:Deduce (i) by specialising $\beta = a_{n+1}$]
For $n \geq 0$, we show $p_n/q_n = [a_0, a_1, \ldots, a_n]$ by induction on $n$.
For $n = 0$: $[a_0] = a_0 = p_0/q_0$ since $q_0 = 1$.
For $n \geq 1$: by part (ii) with $\beta = a_n > 0$,
\begin{align*}
[a_0, a_1, \ldots, a_{n-1}, a_n] &= \frac{a_n p_{n-1} + p_{n-2}}{a_n q_{n-1} + q_{n-2}} = \frac{p_n}{q_n},
\end{align*}
applying the recurrences in the final equality.
[/step]
[step:Establish the mediant inequality]
We prove the following auxiliary fact: if $x, x', y, y' \in \mathbb{R}$ with $y, y' > 0$ and $x/y < x'/y'$, then for any weights $\alpha, \beta > 0$,
\begin{align*}
\frac{x}{y} &< \frac{\alpha x + \beta x'}{\alpha y + \beta y'} < \frac{x'}{y'}.
\end{align*}
Compute
\begin{align*}
\frac{\alpha x + \beta x'}{\alpha y + \beta y'} - \frac{x}{y} &= \frac{y(\alpha x + \beta x') - x(\alpha y + \beta y')}{y(\alpha y + \beta y')} = \frac{\beta(y x' - x y')}{y(\alpha y + \beta y')}.
\end{align*}
The numerator $y x' - x y' = y y'(x'/y' - x/y) > 0$ by hypothesis (both $y, y' > 0$, and $x/y < x'/y'$), and the denominator $y(\alpha y + \beta y') > 0$ since $y, y', \alpha, \beta > 0$. So the difference is positive.
Similarly,
\begin{align*}
\frac{x'}{y'} - \frac{\alpha x + \beta x'}{\alpha y + \beta y'} &= \frac{\alpha(x' y - x y')}{y'(\alpha y + \beta y')} > 0.
\end{align*}
Both strict inequalities hold.
[/step]
[step:Apply the mediant inequality to establish strict betweenness]
We show that
\begin{align*}
\frac{\beta p_n + p_{n-1}}{\beta q_n + q_{n-1}}
\end{align*}
lies strictly between $p_{n-1}/q_{n-1}$ and $p_n/q_n$ for every real $\beta > 0$.
We check the hypotheses of the mediant inequality with $(x, y) = (p_{n-1}, q_{n-1})$, $(x', y') = (p_n, q_n)$, $(\alpha, \beta_{\text{weight}}) = (1, \beta)$. We need $y, y' > 0$ and $x/y \neq x'/y'$; we then absorb the possible ordering into an appropriate orientation.
**Positivity of denominators.** From Step 1, $q_n > 0$ for all $n \geq 0$ and $q_{-1} = 0$. For $n \geq 1$, both $q_{n-1} \geq 1$ and $q_n \geq 1$, so both are strictly positive. For $n = 0$, $q_{-1} = 0$ fails the hypothesis; we address this case separately below.
**Distinctness of the two convergents.** By the [Determinant Relations](/theorems/1759),
\begin{align*}
p_n q_{n-1} - p_{n-1} q_n &= (-1)^{n-1} \neq 0.
\end{align*}
Dividing by $q_n q_{n-1} > 0$ (valid for $n \geq 1$) gives $p_n/q_n \neq p_{n-1}/q_{n-1}$.
**Case $n \geq 1$.** Swap the roles of the two endpoints if necessary to order them so that the smaller fraction is $(x, y)$ and the larger is $(x', y')$; this is a legal relabelling that does not affect whether the weighted mediant lies strictly between them. The mediant inequality of Step 5 then yields the strict betweenness.
**Case $n = 0$.** The formula reads
\begin{align*}
\frac{\beta p_0 + p_{-1}}{\beta q_0 + q_{-1}} &= \frac{\beta a_0 + 1}{\beta} = a_0 + \frac{1}{\beta}.
\end{align*}
Since $\beta > 0$, $1/\beta > 0$, so $a_0 + 1/\beta > a_0 = p_0/q_0$. A bound in the other direction requires comparison with $p_{-1}/q_{-1} = 1/0$ — which is not defined; in this degenerate edge case the claim as stated in (ii) only makes sense for $n \geq 1$, and we interpret "between $p_{-1}/q_{-1}$ and $p_0/q_0$" as "strictly greater than $p_0/q_0$", which we have just verified.
Combining the cases completes the proof of (ii), and Steps 2–3 together establish the full theorem.
[/step]