[proofplan]
The irrationality of $\theta$ supplies the infinite simple continued fraction setting; the coprimality argument itself uses only the standard recurrence and the positivity of the partial quotients after $a_0$. We first verify the initial convergent and prove by induction that all denominators $q_n$ are positive. We then prove the standard determinant identity relating two consecutive convergents:
\begin{align*}
p_nq_{n-1}-p_{n-1}q_n = (-1)^{n-1}
\end{align*}
for every $n \ge 1$. Once this identity is known, any common divisor of $p_n$ and $q_n$ must divide the integer $(-1)^{n-1}$, hence must be $1$.
[/proofplan]
custom_env
admin
[step:Verify the initial convergent is already in lowest terms]
From the recurrence at $n=0$, using $p_{-1}=1$, $p_{-2}=0$, $q_{-1}=0$, and $q_{-2}=1$, we obtain
\begin{align*}
p_0 = a_0p_{-1}+p_{-2}=a_0.
\end{align*}
The same initial values give
\begin{align*}
q_0 = a_0q_{-1}+q_{-2}=1.
\end{align*}
Therefore
\begin{align*}
\gcd(p_0,q_0)=\gcd(a_0,1)=1.
\end{align*}
[/step]
custom_env
admin
[step:Prove all denominators are positive]
For a simple continued fraction, the partial quotients satisfy $a_m \in \mathbb{N}$ for every integer $m \ge 1$, so $a_m \ge 1$. We prove $q_n>0$ for every integer $n \ge 0$ by induction. The initial value is
\begin{align*}
q_0=1>0.
\end{align*}
For $n=1$, the recurrence and $q_{-1}=0$ give
\begin{align*}
q_1=a_1q_0+q_{-1}=a_1>0.
\end{align*}
Now let $n \ge 2$ and assume $q_{n-1}>0$ and $q_{n-2}>0$. Since $a_n \ge 1$, the recurrence gives
\begin{align*}
q_n=a_nq_{n-1}+q_{n-2}>0.
\end{align*}
By induction, $q_n>0$ for every integer $n \ge 0$.
[/step]
custom_env
admin
[step:Prove the determinant identity for consecutive convergents]For each integer $n \ge 1$, define the determinant-like integer
\begin{align*}
D_n := p_nq_{n-1}-p_{n-1}q_n.
\end{align*}
We prove by induction that
\begin{align*}
D_n = (-1)^{n-1}
\end{align*}
for every $n \ge 1$.
For $n=1$, the recurrence gives
\begin{align*}
p_1 = a_1p_0+p_{-1}=a_1a_0+1.
\end{align*}
It also gives
\begin{align*}
q_1 = a_1q_0+q_{-1}=a_1.
\end{align*}
Hence
\begin{align*}
D_1=(a_1a_0+1)\cdot 1-a_0a_1=1=(-1)^0.
\end{align*}
Now let $n \ge 2$ and assume
\begin{align*}
D_{n-1}=p_{n-1}q_{n-2}-p_{n-2}q_{n-1}=(-1)^{n-2}.
\end{align*}
Using the recurrence for $p_n$ and $q_n$, we compute
\begin{align*}
D_n=(a_np_{n-1}+p_{n-2})q_{n-1}-p_{n-1}(a_nq_{n-1}+q_{n-2}).
\end{align*}
Expanding and cancelling the two equal terms $a_np_{n-1}q_{n-1}$ and $-a_np_{n-1}q_{n-1}$ gives
\begin{align*}
D_n=p_{n-2}q_{n-1}-p_{n-1}q_{n-2}.
\end{align*}
By the definition of $D_{n-1}$, this is $-D_{n-1}$. Therefore the induction hypothesis gives
\begin{align*}
D_n=-D_{n-1}=-(-1)^{n-2}=(-1)^{n-1}.
\end{align*}
By induction, the determinant identity holds for every $n \ge 1$.[/step]
custom_env
admin
[guided]The purpose of this step is to prove an arithmetic invariant of the recurrence. Define, for each integer $n \ge 1$, the integer
\begin{align*}
D_n := p_nq_{n-1}-p_{n-1}q_n.
\end{align*}
This quantity measures the cross-difference of two consecutive convergents. We will show that it is always equal to either $1$ or $-1$:
\begin{align*}
D_n = (-1)^{n-1}.
\end{align*}
We start with $n=1$. From the recurrence and the initial values,
\begin{align*}
p_0 = a_0p_{-1}+p_{-2}=a_0.
\end{align*}
The denominator recurrence gives
\begin{align*}
q_0 = a_0q_{-1}+q_{-2}=1.
\end{align*}
Applying the recurrence once more gives
\begin{align*}
p_1 = a_1p_0+p_{-1}=a_1a_0+1.
\end{align*}
Similarly,
\begin{align*}
q_1 = a_1q_0+q_{-1}=a_1.
\end{align*}
Therefore
\begin{align*}
D_1=(a_1a_0+1)\cdot 1-a_0a_1=1=(-1)^0.
\end{align*}
This proves the base case.
Now suppose $n \ge 2$ and assume the identity has already been proved at the previous index:
\begin{align*}
D_{n-1}=p_{n-1}q_{n-2}-p_{n-2}q_{n-1}=(-1)^{n-2}.
\end{align*}
We compute $D_n$ directly from the recurrence. The key point is that the terms involving $a_n$ cancel. Substituting $p_n=a_np_{n-1}+p_{n-2}$ and $q_n=a_nq_{n-1}+q_{n-2}$ into the definition of $D_n$ gives
\begin{align*}
D_n=(a_np_{n-1}+p_{n-2})q_{n-1}-p_{n-1}(a_nq_{n-1}+q_{n-2}).
\end{align*}
Expanding the products gives
\begin{align*}
D_n=a_np_{n-1}q_{n-1}+p_{n-2}q_{n-1}-a_np_{n-1}q_{n-1}-p_{n-1}q_{n-2}.
\end{align*}
Cancelling the two opposite terms involving $a_n$ leaves
\begin{align*}
D_n=p_{n-2}q_{n-1}-p_{n-1}q_{n-2}.
\end{align*}
The last expression is the negative of $D_{n-1}$, since
\begin{align*}
D_{n-1}=p_{n-1}q_{n-2}-p_{n-2}q_{n-1}.
\end{align*}
Thus the induction hypothesis gives
\begin{align*}
D_n=-D_{n-1}=-(-1)^{n-2}=(-1)^{n-1}.
\end{align*}
This completes the induction and proves the determinant identity for every $n \ge 1$.[/guided]
custom_env
admin
[step:Use the determinant identity to rule out nontrivial common divisors]
Fix an integer $n \ge 1$. Let $d:=\gcd(p_n,q_n)$, so $d$ is a positive integer satisfying $d \mid p_n$ and $d \mid q_n$. Since $d \mid p_n$, the integer $d$ divides $p_nq_{n-1}$. Since $d \mid q_n$, the integer $d$ divides $p_{n-1}q_n$. The elementary divisibility rule $d\mid x$ and $d\mid y$ imply $d\mid x-y$ now gives
\begin{align*}
d \mid \bigl(p_nq_{n-1}-p_{n-1}q_n\bigr).
\end{align*}
By the determinant identity proved above,
\begin{align*}
p_nq_{n-1}-p_{n-1}q_n = (-1)^{n-1}.
\end{align*}
Hence $d \mid (-1)^{n-1}$. Since $d$ is positive, this forces $d=1$. Thus
\begin{align*}
\gcd(p_n,q_n)=1
\end{align*}
for every $n \ge 1$.
[/step]
custom_env
admin
[step:Combine positivity and coprimality]
The first step proved $\gcd(p_0,q_0)=1$. The positivity step proved $q_n>0$ for every integer $n \ge 0$. The previous step proved $\gcd(p_n,q_n)=1$ for every integer $n \ge 1$. Therefore, for every integer $n \ge 0$, the convergent
\begin{align*}
\frac{p_n}{q_n}
\end{align*}
has positive denominator and is in lowest terms.
[/step]