How to interpret $\left(\begin{smallmatrix}p_n & p_{n-1}\\ q_n & q_{n-1}\end{smallmatrix}\right)$? We know that \begin{equation*}
a_0+\cfrac{1}{a_1+\cfrac{1}{a_2+\cfrac{1}{a_3+\cfrac{1}{\ddots+\cfrac{1}{a_n}}}}}=[a_0,a_1, \cdots, a_n]
\end{equation*}
If $\frac{p_n}{q_n}=[a_0,a_1, \cdots, a_n]$.

How to prove that $$
    \begin{pmatrix}
    p_n & p_{n-1} \\
    q_n & q_{n-1} \\
    \end{pmatrix}=\begin{pmatrix}
    a_0 &1 \\
    1 & 0 \\
    \end{pmatrix}\begin{pmatrix}
    a_1 &1 \\
    1 & 0 \\
    \end{pmatrix}\cdots\begin{pmatrix}
    a_n &1 \\
    1 & 0 \\
    \end{pmatrix}
$$.

I am getting the answer while checking with $n=0,1,2,3$. I think that it could be done by induction but after assuming $k=n-1$ when I am going to prove $k=n$ the calculation is getting messy. Please help me out in proving this.

This follows from the fact that $p_n=a_np_{n-1}+p_{n-2}$, $q_n=a_nq_{n-1}+q_{n-2}$, with conditions $p_{-1}=1,p_{-2}=0,q_{-1}=0,q_{-2}=1$. Just verify the following identity:
$$\begin{pmatrix}p_n & p_{n-1}\\ q_n & q_{n-1}\end{pmatrix}=\begin{pmatrix}p_{n-1} & p_{n-1}\\ q_n & q_{n-1}\end{pmatrix}\begin{pmatrix}a_{n} & 1\\1 & 0\end{pmatrix},$$
along with the initial condition above.
