text:
\section{Introduction}
Integral transforms with a hypergeometric function as a kernel have been the subject of many papers in the literature. A famous example is the Jacobi transform, first studied by Weyl \cite{We10}, which is an integral transform with a certain $_2F_1$-function, the Jacobi function, as a kernel. The inverse of the Jacobi transform can be obtained from spectral analysis of the hypergeometric differential operator $D$, which is an unbounded self-adjoint operator on a weighted $L^2$-space of functions on $[0,\infty)$. We refer to \cite{Koo84} for a survey on Jacobi functions. In a recent paper \cite{Ne05} Neretin studied the hypergeometric differential operator $D$ as a self-adjoint operator on a weighted $L^2$-space of functions on $\mathbb R$. In this setting the spectral analysis of $D$ leads to an integral transform with two different Jacobi functions (vector-valued Jacobi functions) as a kernel, corresponding to the multiplicity two of the continuous spectrum.

In this paper we obtain a $q$-analogue of Neretin's vector-valued Jacobi transform (or double index hypergeometric transform). There exist several $q$-analogues of Jacobi functions, namely the little and big $q$-Jacobi functions and the Askey-Wilson functions, see \cite{K95}, \cite{KMU95}, \cite{KS01}, \cite{KS03}. Here we consider the big $q$-Jacobi function, which is a basic hypergeometric $_3\phi_2$-function that is the kernel in the big $q$-Jacobi transform by Koelink and Stokman \cite{KS03}. The big $q$-Jacobi transform and its inverse arise from spectral analysis of a second order $q$-difference operator $L$, that is an unbounded self-adjoint operator on an $L^2$-space consisting of square integrable functions with respect to a discrete measure on $[-1,\infty)$. In this paper we study the same $q$-difference operator $L$ as an unbounded self-adjoint operator on a different Hilbert space, namely an $L^2$-space of functions on $\mathbb R$ with a discrete measure. The continuous spectrum of $L$ has multiplicity two, thus leading to an integral transform pair with two different big $q$-Jacobi functions as a kernel.  We call this the vector-valued big $q$-Jacobi transform.

The vector-valued Jacobi transform has an interpretation in the representation theory of Lie algebra $\mathfrak{su}(1,1)$ (or equivalently $\mathfrak{sl}(2,\mathbb R)$) as follows, see \cite[Section 4]{Ne05}. The hypergeometric differential operator $D$ arises from a suitable restriction of the Casimir operator in the tensor product of two principal unitary series. The spectral analysis of $D$ now gives the decomposition into irreducible representations, and the vector-valued Jacobi transform can be used to construct explicitly the intertwiner for these representations. The multiplicity two of the continuous spectrum corresponds to the multiplicity of the principal unitary series occurring in the decomposition, see \cite{Pu61}, \cite{Ma75} for the precise decomposition. There is a similar interpretation of the vector-valued big $q$-Jacobi transform in the representation theory of the quantized universal enveloping algebra $\mathcal U_q(\mathfrak{su}(1,1))$. However, the corresponding representation is no longer a tensor product representation, but a sum of two tensor products of principal unitary series. This will be the subject of a future paper.

The big $q$-Jacobi functions are nonpolynomial extensions of the big $q$-Jacobi polynomials \cite{AA85}, but they can also be considered as extensions of the continuous dual $q^{-1}$-Hahn polynomials, see \cite{KS03}. In this light, the vector-valued big $q$-Jacobi transform may also be considered as a $q$-analogue of the integral transform corresponding to the $_3F_2$-functions $(\Xi_n^{(1)}, \Xi_n^{(2)})$ from \cite[Thm.1.3]{Ne05}, and of the continuous Hahn transform from \cite{GKR05}. In both transforms the kernel consists of two $_3F_2$-functions that are extensions of the continuous dual Hahn polynomials.

The organization of this paper is as follows. In Section \ref{sec2} we introduce the second order $q$-difference operator $L$ and a weighted $L^2$-space of functions on $\mathbb R_q$, a $q$-analogue of the real line. The difference operator $L$ is an unbounded operator on this $L^2$-space. We define the Casorati determinant, a difference analogue of the Wronskian, and with the Casorati determinant we determine a dense domain on which $L$ is self-adjoint. In section \ref{sec3} we introduce the big $q$-Jacobi functions as eigenfunctions of $L$ given by a specific $_3\phi_2$-series. We also give the asymptotic solutions, which are $_3\phi_2$-series with nice asymptotic behavior at $+\infty$ or $-\infty$. A crucial point here is the fact that all eigenfunctions that we consider can uniquely be extended to functions on $\mathbb R_q$. In Section \ref{sec4} we define the Green kernel using the asymptotic solutions and we determine the spectral decomposition for $L$. In Section 5 we define the vector-valued big $q$-Jacobi transform $\mathcal F$, and we determine its inverse. A left inverse $\mathcal G$ of $\mathcal F$ follows immediately from the spectral analysis done in Section \ref{sec4}. To show that $\mathcal G$ is also a right inverse, we use a classical method that essentially comes down to approximating with the Fourier transform. Finally, in the appendix two lemmas are proved which involve rather long computations. \\

\textit{Notations}.
We use standard notations for $q$-shifted factorials, $\theta$-functions and basic hypergeometric series \cite{GR04}.
We fix a number $q \in (0,1)$. The $q$-shifted factorials are defined by
\[
(x;q)_\infty = \prod_{k=0}^\infty (1-xq^k), \qquad (x;q)_n = \frac{ (x;q)_\infty }{(xq^n;q)_\infty}, \ n \in \mathbb Z.
\]
The (normalized) Jacobi $\theta$-function is defined by
\[
\theta(x) = (x,q/x;q)_\infty, \qquad x \not\in q^\mathbb Z.
\]
From this definition it follows that the $\theta$-function satisfies
\[
\theta(x)=\theta(q/x) =-x\theta(qx) = -x \theta(1/x).
\]
We often use these identities without mentioning them. For products of $q$-shifted factorials and products of $\theta$-functions we use the shorthand notations
\begin{align*}
(x_1,x_2,\ldots, x_k;q)_n &=(x_1;q)_n (x_2;q)_n \cdots (x_k;q)_n , & n \in \mathbb Z \cup \{\infty \},\\
\theta(x_1,x_2,\ldots,x_k)&=\theta(x_1)\theta(x_2)\cdots \theta(x_k),
\end{align*}
and
\[
(xy^{\pm 1};q)_\infty= (xy,x/y;q)_\infty, \qquad \theta(xy^{\pm 1})= \theta(xy,x/y).
\]
An identity for $\theta$-functions that we frequently use is
\begin{equation} \label{eq:theta prod}
\theta(xv,x/v,yw,y/w)-\theta(xw,x/w,yv,y/v) = \frac{y}{v} \theta(xy,x/y,vw,v/w),
\end{equation}
see \cite[Exer. 2.16(i)]{GR04}. The basic hypergeometric function $_r\phi_s$ is defined by
\[
\ph{r}{s}{x_1,x_2,\ldots, x_r}{y_1,y_2,\ldots,y_s}{q,z} = \sum_{k=0}^\infty \frac{ (x_1,x_2,\ldots,x_r;q)_k }{ (q,y_1,y_2,\ldots,y_s;q)_k } \Big((-1)^k q^{k(k-1)/2} \Big)^{1+s-r} z^k.
\]

\section{The second order $q$-difference operator} \label{sec2}
In this section we introduce an unbounded second order $q$-difference operator $L$ acting on functions on a $q$-analogue of the real line, and we determine a dense domain on which $L$ is self-adjoint.
\subsection{The difference operator}We fix two real numbers $z_+>0$ and $z_-<0$. Let $\mathbb R_q^+$ and $\mathbb R_q^-$ be the two sets
\[
\mathbb R_q^+= \{z_+q^n\ | \ n \in \mathbb Z \}, \qquad \mathbb R_q^-= \{z_-q^n\ | \ n \in \mathbb Z \},
\]
and define
\[
\mathbb R_q=\mathbb R_q^- \cup \mathbb R_q^+,
\]
which we consider as a $q$-analogue of the real line. For $x \in \mathbb R_q$ we sometimes write $x=zq^{k}$, which means that $z=z_-$ or $z=z_+$, and $k \in \mathbb Z$. We denote by $F(\mathbb R_q)$ the linear space of complex-valued functions on $\mathbb R_q$.

The second order difference operator $L$ we are going to study depends on four parameters. Let $P_{q,z_-,z_+}$ be the set consisting of pairs of parameters $(\alpha,\beta) \in \mathbb C^2$ such that $\alpha,\beta \not\in z_{\pm}^{-1}q^\mathbb Z$, and one of the following conditions is satisfied:
\begin{itemize}
\item $\alpha=\overline{\beta}$
\item there exists a $k_0 \in \mathbb Z$ such that $z_+q^{k_0} <\beta^{-1}<\alpha^{-1}< z_+q^{k_0-1}$
\item there exists a $k_0 \in \mathbb Z$ such that $z_-q^{k_0-1} <\alpha^{-1}<\beta^{-1}< z_-q^{k_0}$
\end{itemize}
In particular this implies that $q <|\alpha/\beta|\leq 1$, and $\alpha$ and $\beta$ have the same sign in case they are real.
We define the parameter domain $P$ to be the following set,
\[
P = \big\{ (a,b,c,d) \in \mathbb C^4 \ | \ (a,b) \in P_{q,z_-,z_+},\, (c,d) \in P_{q,z_-,z_+},\, a\neq b \big\}.
\]
From here on we assume that $(a,b,c,d) \in P$, unless explicitly stated otherwise.

We define a linear operator $L=L_{a,b,c,d}: F(\mathbb R_q) \rightarrow  F(\mathbb R_q)$ by
\[
L = A(\cdot) T_{q^{-1}}  + B(\cdot) T_q +C(\cdot)id,
\]
where $T_\alpha$ is the shift operator $(T_\alpha f)(x)= f(\alpha x)$ for $\alpha \in \mathbb C$, $id$ denotes the identity operator, and
\[
\begin{split}
A(x) &= s^{-1}\left(1-\frac{q}{ax}\right) \left(1-\frac{q}{bx}\right),\\
B(x) &= s\left(1-\frac{1}{cx}\right)\left(1-\frac{1}{dx}\right), \\
C(x)&= s^{-1}+s-A(x)-B(x),
\end{split}
\]
where $s=\sqrt{cdq/ab}$. Here we use the usual branch of $\sqrt{\cdot}$ that is positive on $\mathbb R_+$. Note that the conditions on the parameters ensure that $A(x) \neq 0$ and $B(x) \neq 0$ for all $x \in \mathbb R_q$.
\begin{rem} \label{rem:symmetry}
(a) There is an obvious symmetry in the parameters;
\[
L_{a,b,c,d} = L_{b,a,c,d} = L_{a,b,d,c}.
\]
This will be useful when we study eigenfunctions of $L$ later on.

(b) Let $a=z_+^{-1}q^{1-m}$, $m \in \mathbb Z$ fixed, (so $(a,b,c,d) \not\in P$), then the coefficient $A(x)$ vanishes at the point $x=z_+q^m$. In this case certain restrictions of the difference operator $L$ are well known in the literature. Let $L_-$ (respectively $L_+$) denote the operator $L$ restricted to functions on $\{z_+q^k\ | \ k \in \mathbb Z_{\geq m} \}$ (respectively $\{z_+q^k\ | \ k \in \mathbb Z_{\leq m-1} \}$). Then $L_\pm$ is equivalent to the Jacobi operator for the continuous dual $q^{\pm 1}$-Hahn polynomials, which are Askey-Wilson polynomials with one of the parameters equal to zero,  see \cite{AW85}, \cite{KS98}. Moreover, the operator $L$ restricted to functions on $\mathbb R_q^- \cup \{z_+q^k\ | \ k \in \mathbb Z_{\geq m} \}$ is equivalent to the difference operator studied by Koelink and Stokman \cite{KS03} to obtain the big $q$-Jacobi function transform.

If we also set $c=z_-^{-1}q^{-n}$, $n \in \mathbb Z$ fixed, then the coefficient $B(x)$ vanishes at the point $x=z_-q^n$. In this case the operator $L$ restricted to functions on $\{z_-q^k \ | \ k \in \mathbb Z_{\geq n} \} \cup \{z_+q^k\ | \ k \in \mathbb Z_{\geq m} \}$ is equivalent to the difference operator for big $q$-Jacobi polynomials, see \cite[Sect.10]{KS03} where the orthogonality relations for the big $q$-Jacobi polynomials are obtained from spectral analysis of $L$. See also \cite{AA85} and \cite{KS98} for the big $q$-Jacobi polynomials.
\end{rem}

\subsection{The Casorati determinant}
The Jackson $q$-integral is defined by
\begin{gather*}
\int_{0}^\alpha f(x) d_qx =  (1-q) \sum_{k=0}^\infty f(\alpha q^k)\alpha q^k,\\
\int_\alpha^\beta f(x) d_qx =  \int_0^\beta f(x) d_qx - \int_0^\alpha f(x) d_qx\\
\int_0^{\infty(\alpha)} f(x) d_qx = (1-q) \sum_{k=-\infty}^\infty f(\alpha q^k) \alpha q^k,
\end{gather*}
for $\alpha,\beta \in \mathbb C^*$, and $f$ is a function such that the sums converge absolutely. We will denote
\[
\int_{\mathbb R_q} f(x) d_qx = \int_0^{\infty(z_+)} f(x) d_qx - \int_0^{\infty(z_-)} f(x) d_qx,
\]
We define a weight function $w$ on $\mathbb R_q$ by
\begin{equation} \label{def:weight w}
w(x)=w(x;a,b,c,d;q) = \frac{ (ax, bx;q)_\infty }{ (cx, dx;q)_\infty } .
\end{equation}
Note that for $(a,b,c,d) \in P$ the weight function $w$ is positive on $\mathbb R_q$, and $w$ is continuous at the origin. Let $\mathcal L^2=\mathcal L^2(\mathbb R_q,w(x)d_qx)$ be the Hilbert space consisting of functions $f \in F(\mathbb R_q)$ that have finite norm with respect to the inner product
\[
\langle f, g \rangle_{\mathcal L^2}=\int_{\mathbb R_q} f(x) \overline{g(x)} w(x) d_qx.
\]
For $k,l,m,n \in \mathbb Z$ we define a truncated inner product by
\[
\langle f, g \rangle_{k,l;m,n} =
 \int_{z_-q^k}^{z_-q^{l+1}} f(x) \overline{g(x)}w(x) d_qx + \int_{z_+q^{m+1}}^{z_+q^n} f(x) \overline{g(x)}w(x) d_qx \\
\]
If $f,g \in \mathcal L^2$ we have
\[
\lim_{\substack{l,m \rightarrow \infty \\k,n \rightarrow -\infty}} \langle f, g \rangle_{k,l;m,n} = \langle f, g \rangle_{\mathcal L^2}.
\]
We define a function $u$ on $\mathbb R_q$, closely related to the weight function $w$, by
\[
u(x) = (1-q)^2B(x)x^2w(x) = (1-q)^2 \sqrt{q/abcd}  \frac{ (ax,bx;q)_\infty }{ (cqx,dqx;q)_\infty }.
\]\

\begin{Def} \label{def:Casorati}
For $f,g \in F(\mathbb R_q)$ we define the Casorati determinant $D(f,g) \in F(\mathbb R_q)$ by
\[
\begin{split}
D(f,g)(x)&= \Big( f(x) g(qx) - f(qx) g(x) \Big) \frac{u(x)}{(1-q)x} \\
&= \Big( (D_qf)(x) g(x) - f(x) (D_qg)(x) \Big) u(x).
\end{split}
\]
\end{Def}
Here $D_q:F(\mathbb R_q)\rightarrow F(\mathbb R_q)$ is the $q$-difference operator given by
\[
(D_qf)(x) = \frac{ f(x) - f(qx) }{x(1-q)}.
\]

\begin{prop} \label{prop:Casorati}
For $f,g \in F(\mathbb R_q)$ we have
\[
\begin{split}
\langle Lf, g \rangle_{k,l;m,n} &- \langle f,L g \rangle_{k,l;m,n} =\\
& D(f,\overline{g})(z_-q^{l})-D(f,\overline{g})(z_-q^{k-1})+ D(f,\overline{g})(z_+q^{n-1}) -D(f,\overline{g})(z_+q^{m}).
\end{split}
\]
\end{prop}
\begin{proof}
For $f,g \in F(\mathbb R_q)$,
\[
\begin{split}
\Big(&(Lf)(x)g(x) - f(x) (Lg)(x)\Big) xw(x)  =\\
 &A(x) \Big( f(x/q)g(x) - f(x)g(x/q) \Big) x w(x) \\
& \quad+ B(x)\Big( f(xq)g(x) - f(x)g(xq) \Big) xw(x) \\
=& \Big( f(x/q)g(x) - f(x)g(x/q) \Big)  \frac{ (ax/q,bx/q;q)_\infty } { (cx,dx;q)_\infty }  \frac{q^2}{xsab}  \\
& \quad + \Big( f(xq)g(x) - f(x)g(xq) \Big) \frac{ (ax,bx;q)_\infty }{ (cqx,dqx;q)_\infty } \frac{s}{cdx}
\end{split}
\]
Note that $abs/q =\sqrt{abcd/q}= cd/s$, so we obtain
\[
\Big((Lf)(x)g(x) - f(x) (Lg)(x)\Big) (1-q)xw(x) = D(f,g)(x/q)- D(f,g)(x).
\]
Now the sums of the truncated inner products in the lemma become telescoping, and then the result follows.
\end{proof}
In order to determine a suitable domain on which $L$ is self-adjoint, we need to find the limit behavior of Casorati determinants. First, to find the asymptotic behavior of $D(f,g)(x)$ for large $x$, we need the behavior of $u(x)$ for large $x$.
\begin{lem} \label{lem:asymp w&u}
Let $x=zq^{-k} \in \mathbb R_q$, then for $k \rightarrow \infty$
\[
\begin{split}
xw(x) &=  (1-q)^{-1}K_zs^{-2k} \big(1+\mathcal O(q^k) \big), \\
\frac{u(x)}{x} &= (1-q)K_z  s^{1-2k}\big(1+\mathcal O(q^k) \big),
\end{split}
\]
where
\[
K_z =K_z(a,b,c,d;q)= z(1-q) \frac{ \theta(az,bz)}{ \theta(cz,dz)}.
\]

\end{lem}
\begin{proof}
Let $x=zq^{-k} \in \mathbb R_q$. Using the identity
\[
\frac{ (\alpha q^{-n};q)_n }{ (\beta q^{-n};q)_n} = \frac{ (q/\alpha;q)_n }{ (q/\beta;q)_n } \left( \frac{\alpha}{\beta} \right)^n,
\]
and the definition \eqref{def:weight w} of the weight function $w$ we obtain
\[
w(zq^{-k}) =  \frac{ (q/az,q/bz;q)_k (az,bz;q)_\infty }{ (q/cz,q/dz;q)_k (cz,dz;q)_\infty } \left(\frac{ab}{cd}\right)^{k},
\]
and
\[
u(zq^{-k}) = (1-q)^2 \sqrt{q/abcd} \frac{ (q/az,q/bz;q)_k (az,bz;q)_\infty} { (1/cz,1/dz;q)_k (zcq,zdq;q)_\infty }   \left(\frac{ab}{cdq^2}\right)^{k}
\]
From this the asymptotic behavior of $xw(x)$ and $u(x)/x$ for large $x$ follows.
\end{proof}

\begin{lem} \label{lem:lim infty}
Let $f,g \in \mathcal L^2$, then
\[
\lim_{x \rightarrow \pm \infty} D(f,g)(x)=0.
\]
\end{lem}
\begin{proof}
Let $f,g \in \mathcal L^2$. Using the asymptotic behavior of $xw(x)$ for large $x$, see Lemma \ref{lem:asymp w&u}, we find that $f$ and $g$ satisfy
\[
\lim_{k  \rightarrow \infty} s^{-k}  f(zq^{-k})=\lim_{k  \rightarrow \infty} s^{-k}  g(zq^{-k})=0.
\]
From Definition \ref{def:Casorati} and the asymptotic behavior of $u(x)/x$ from Lemma \ref{lem:asymp w&u} we now see that $\lim_{k \rightarrow \infty} D(f,g)(zq^{-k})=0$.
\end{proof}

\subsection{Self-adjointness}
For $f \in F(\mathbb R_q)$ we denote
\begin{align*}
f(0^-)&=\lim_{k \rightarrow \infty}f(z_-q^k), & f(0^+)&=\lim_{k \rightarrow \infty} f(z_+q^k), \\
f'(0^-)&=\lim_{k \rightarrow \infty}(D_qf)(z_-q^k), & f'(0^+)&=\lim_{k \rightarrow \infty} (D_qf)(z_+q^k),
\end{align*}
provided that all these limits exist.
\begin{Def}
We define the subspace $\mathcal D \subset \mathcal L^2$ by
\[
\mathcal D= \left\{ f \in \mathcal L^2 \ | \ Lf \in \mathcal L^2,\ f(0^-)=f(0^+),\ f'(0^-)= f'(0^+) \right\}.
\]
\end{Def}
The domain $\mathcal D$ contains the finitely supported functions in $\mathcal L^2$, hence $\mathcal D$ is dense in $\mathcal L^2$.

\begin{prop}
The operator $(L,\mathcal D)$ is self-adjoint.
\end{prop}
The proposition is proved in the same way as \cite[Prop.2.7]{KS03}. For convenience we repeat the proof here.
\begin{proof}
First we need to show that $(L,\mathcal D)$ is symmetric. Let $f,g \in \mathcal D$. Using the second expression in Definition \ref{def:Casorati} we find
\[
\begin{split}
D(f,\overline{g})(0^-) &= u(0)\Big( (D_qf)(0^-)\overline{g(0^-)} - f(0^-) \overline{ (D_qg)(0^-)} \Big)\\
&= u(0)\Big((D_qf)(0^+)\overline{g(0^+)} - f(0^+) \overline{ (D_qg)(0^+)} \Big) \\
&= D(f,\overline{g})(0^+),
\end{split}
\]
By Proposition \ref{prop:Casorati} and Lemma \ref{lem:lim infty} this leads to
\[
\begin{split}
\langle Lf, g \rangle_{\mathcal L^2}- \langle f,Lg \rangle_{\mathcal L^2} &= \lim_{\substack{l,m \rightarrow \infty \\ k,n \rightarrow -\infty}}\Big( \langle Lf, g \rangle_{k,l;m,n}- \langle f,Lg \rangle_{k,l;m,n} \Big)\\
& =  D(f,\overline{g})(0^+)-D(f,\overline{g})(0^-)=0,
\end{split}
\]
hence $(L,\mathcal D)$ is symmetric with respect to $\langle \cdot, \cdot \rangle_{\mathcal L^2}$.

Now we know that $(L,\mathcal D) \subset (L^*, \mathcal D^*)$, where $(L^*, \mathcal D^*)$ is the adjoint of the operator $(L,\mathcal D)$. Observe that
\[
L^* = L|_{\mathcal D^*}.
\]
Indeed, let $f$ be a nonzero function with support at only one point $x \in \mathbb R_q$ and let $g \in F(\mathbb R_q)$, then
\[
\langle Lf,g \rangle_{\mathcal L^2}=\langle f, Lg \rangle_{\mathcal L^2}.
\]
In particular, for $g \in \mathcal D^*$ we then have $\langle f, Lg \rangle_{\mathcal L^2} = \langle f, L^*g \rangle_{\mathcal L^2}$, so $(Lg)(x)=(L^*g)(x)$. This holds for all $x \in \mathbb R_q$, hence $L^*=L|_{\mathcal D^*}$.

Finally we show that $\mathcal D^* \subset \mathcal D$. Let $f \in \mathcal D$ and let $g \in \mathcal D^*$. Using Proposition \ref{prop:Casorati} and Lemma \ref{lem:lim infty},
\[
D(f,\overline{g})(0^-)-D(f,\overline{g})(0^+) = \langle Lf,g \rangle_{\mathcal L^2} - \langle f,L^*g \rangle_{\mathcal L^2}=0.
\]
Since this holds for all $f \in \mathcal D$, we find that the limits $g(0^-)$, $g(0^+)$, $g'(0^-)$ and $g'(0^+)$ exist, and
\[
\begin{split}
g(0^-) =  g(0^+), \qquad g'(0^-)&=  g'(0^+),
\end{split}
\]
hence $g \in \mathcal D$, which proves the proposition.
\end{proof}
\begin{rem}
Let $f \in \mathcal D$ and let $\alpha$ be a complex number with $|\alpha|=1$. We define
\[
\tilde f(x) =
\begin{cases}
f(x),& x \in \mathbb R_q^-,\\
\overline{\alpha} f(x), & x \in \mathbb R_q^+,
\end{cases}
\]
then it is easy to verify that $\tilde f(0^-)=\alpha \tilde f(0^+)$ and $\tilde f'(0^-) = \alpha \tilde f'(0^+)$. So we have a family of dense domains
\[
\mathcal D_\alpha = \left\{ f \in \mathcal L^2 \ | \ Lf \in \mathcal L^2,\ f(0^-)=\alpha f(0^+),\ f'(0^-)= \alpha f'(0^+) \right\},
\]
such that $(L,\mathcal D_\alpha)$ is self-adjoint. Without loss of generality we may work with the dense domain $\mathcal D=\mathcal D_1$.
\end{rem}

\section{Eigenfunctions} \label{sec3}
In this section we study eigenfunctions of the second order difference operator $L$.

\subsection{Spaces of eigenfunctions}
For $\mu \in \mathbb C$ we introduce the spaces
\[
\begin{split}
V_\mu^-&=\{ f: \mathbb R_q^- \rightarrow \mathbb C \ | \ Lf=\mu f \},\\
V_\mu^+&=\{ f: \mathbb R_q^+ \rightarrow \mathbb C \ | \ Lf =\mu f \},\\
V_\mu &= \{ f: \mathbb R_q \rightarrow \mathbb C \ | \ Lf=\mu f, \ f(0^-)=f(0^+), \ f'(0^-)=f'(0^+) \}
\end{split}
\]
\begin{lem} \label{lem:dim V}
Let $\mu \in \mathbb C$.

\textnormal{(a)} For $f,g \in V_\mu^\pm $ the Casorati determinant $D(f,g)$ is constant on $\mathbb R_q^\pm$.

\textnormal{(b)} For $f,g \in V_\mu$ the Casorati determinant $D(f,g)$ is constant on $\mathbb R_q$.

\textnormal{(c)} $\dim V_\mu^\pm = 2$.

\textnormal{(d)} $\dim V_\mu \leq 2$.
\end{lem}
\begin{proof}
For (a) let $f,g \in F(\mathbb R_q)$. From the proof of Proposition \ref{prop:Casorati} we have
\[
\Big((Lf)(x)g(x) - f(x) (Lg)(x)\Big) (1-q)xw(x) = D(f,g)(x/q)- D(f,g)(x).
\]
Now if $f$ and $g$ satisfy $(Lf)(x)=\mu f(x)$ and $(Lg)(x)=\mu g(x)$, we find $D(f,g)(x/q)= D(f,g)(x)$, hence $D(f,g)$ is constant on $\mathbb R_q^+$ and $\mathbb R_q^-$.

Let $f,g \in V_\mu$. Statement (b) follows from (a) and the fact that $D(f,g)(0^-) =  D(f,g)(0^+)$.

For (c) we write $f(zq^k)= f_k$, then we see that $Lf =\mu f$ gives a recurrence relation of the form $\alpha_k f_{k+1} +\beta_k f_k + \gamma_k f_{k-1} = \mu f_k$, with $\alpha_k, \gamma_k \neq 0$ for all $k \in \mathbb Z$. Solutions of such a recurrence relation are uniquely determined by specifying $f_k$ at two different points $k=l$ and $k=m$. So there are two independent solutions, which means that $\dim V_\mu^\pm=2$.

Finally, suppose that $f_1,f_2 \in V_\mu$ are such that the restrictions $f_i^{res}=f_i|_{\mathbb R_q^+}$ are linearly independent in $V_\mu^+$. By (a) the Casorati determinant $D(f_1^{res},f_2^{res})(x)$ is nonzero and constant on $\mathbb R_q^+$, hence $D(f_1,f_2)$ is nonzero and constant on $\mathbb R_q$. Therefore $f_1$ and $f_2$ are linearly independent. Now choose a function $f_3 \in V_\mu$. Since $\dim V_\mu^+=2$, we have $f_3^{res} = \alpha f_1^{res} + \beta f_2^{res}$ for some constants $\alpha,\beta \in \mathbb C$. This shows that
\[
\begin{split}
D(f_3,f_1) = D(f_3^{res},f_1^{res}) &= \beta D(f_2^{res},f_1^{res}) = \beta D(f_2,f_1), \\
D(f_3,f_2) = D(f_3^{res},f_2^{res}) &= \alpha D(f_1^{res},f_2^{res}) = \alpha D(f_1,f_2),
\end{split}
\]
hence $f_3 = \alpha f_1 +\beta f_2$. So $\dim V_\mu\leq2$.
\end{proof}

\subsection{Big $q$-Jacobi functions}
Let $P_{\mathrm{gen}}$ be the dense subset of $P$ given by
\[
P_{\mathrm{gen}} = \{ (a,b,c,d) \in P \ |\ c \neq d, \ c/a,c/b,d/a,d/b,cd/ab \not\in q^\mathbb Z\}.
\]
From here on we assume that $(a,b,c,d) \in P_{\mathrm{gen}}$, unless stated otherwise.

The difference operator $L$ is equivalent to the difference operator studied in \cite{KS03}. To see this set
\begin{equation} \label{eq:param KS}
X=-\frac{ax}{q},\quad A=s, \quad B=\frac{qc}{sa},\quad C= \frac{qd}{sa},
\end{equation}
where the capitals stand for the parameters in \cite{KS03}. We have the following eigenfunction, which is called a big $q$-Jacobi function,
\begin{equation} \label{def:phi}
\varphi_\gamma(x) = \varphi_\gamma(x;a,b,c,d|q) =  \ph{3}{2}{q/ax, s\gamma, s/\gamma}{cq/a, dq/a}{q,bx}, \qquad |x| <  \frac{1}{|b|} .
\end{equation}
If $|x|<|q/b|$, the function $\varphi_\gamma$ is a solution of the eigenvalue equation
\begin{equation} \label{eq:eigenvalue equation}
(Lf)(x) = \mu(\gamma)f(x), \qquad \mu(\gamma)=\gamma+\gamma^{-1},
\end{equation}
where $\gamma \in \mathbb C^*$ and $x \in \mathbb R_q$. This can be obtained from \cite{KS03}, or directly from the contiguous relation \cite[(2.10)]{GIM96}. For a function $f$ depending on the parameters $a,b,c,d$, $f = f(\cdot;a,b,c,d)$, we write
\[
f^\dagger=f^\dagger(\cdot;a,b,c,d)= f(\cdot;b,a,c,d).
\]
Clearly, we have $(f^\dagger)^\dagger =f$. Since $L_{a,b,c,d}=L_{b,a,c,d}$, cf.~ Remark \ref{rem:symmetry}(a), it is immediately clear that $\varphi_\gamma^\dagger$ is also a solution for the eigenvalue equation \eqref{eq:eigenvalue equation}. If $a=\overline{b}$, we have $\varphi_\gamma^\dagger(x) = \overline{\varphi_{\overline{\gamma}}(x)}$. The symmetry $L_{a,b,c,d}=L_{a,b,d,c}$ does not give rise to different eigenfunctions.

So far the functions $\varphi_\gamma(x)$ and $\varphi_\gamma^\dagger(x)$ are defined for small $x \in \mathbb R_q$. Using the eigenvalue equation \eqref{eq:eigenvalue equation} the functions $\varphi_\gamma$ and $\varphi_\gamma^\dagger$ can uniquely be extended to functions on whole $\mathbb R_q$ (that we also denote by $\varphi_\gamma$ and $\varphi_\gamma^\dagger$) that also satisfy \eqref{eq:eigenvalue equation}. Later on we give explicit expressions for the functions $\varphi_\gamma(x)$ and $\varphi_\gamma^\dagger(x)$ for $|x|>q/|b|$.

First we establish the $q$-differentiability at the origin of the functions $\varphi_\gamma$ and $\varphi_\gamma^\dagger$.
\begin{prop} \label{prop:diff origin}
The functions $\varphi_\gamma$ and $\varphi_\gamma^\dagger$ are continuous differentiable at the origin. At $x=0$ we have
\[
\begin{split}
\varphi_\gamma(0;a,b,c,d|q) &= \ph{2}{2}{\gamma\sqrt{cdq/ab}, \sqrt{cdq/ab}/\gamma}{cq/a, dq/a}{q,\frac{bq}{a} }, \\ \varphi_\gamma'(0;a,b,c,d|q)&=\frac{b(1-s\gamma)(1-s/\gamma)}{(1-q)(1-cq/a)(1-dq/a)} \varphi_\gamma(0;aq^{-\frac{1}{2}},bq^{-\frac{1}{2}},cq^\frac{1}{2}, dq^\frac{1}{2}|q).
\end{split}
\]
\end{prop}
\begin{proof}
The expression for $\varphi_\gamma(0)$ follows from letting $x \rightarrow 0$ in \eqref{def:phi}.
If $|x|$ is small enough, we find from the explicit expression \eqref{def:phi} for $\varphi_\gamma$,
\[
\begin{split}
\varphi_\gamma(x)-\varphi_\gamma(qx) = &\sum_{n=1}^\infty \frac{ (s\gamma,s/\gamma;q)_n }{ (q,cq/a,dq/a;q)_n } (bx)^n \Big[ (q/ax;q)_n - (1/ax;q)_n q^n \Big] \\
=& \sum_{n=1}^\infty \frac{ (s\gamma,s/\gamma;q)_n }{ (q,cq/a,dq/a;q)_n } (bx)^n (q/ax;q)_{n-1} (1-q^n)\\
=& \frac{ bx (1-s\gamma)(1-s/\gamma) }{ (1-cq/a)(1-dq/a)} \ph{3}{2}{ q/ax, sq \gamma, sq/\gamma}{cq^2/a, dq^2/a}{q,bx}.
\end{split}
\]
Now it follows that the $q$-derivative of $\varphi_\gamma$ is given by
\[
(D_q \varphi_\gamma)(x) = \frac{b(1-s\gamma)(1-s/\gamma)}{(1-q)(1-cq/a)(1-dq/a)} \varphi_\gamma(xq^\frac{1}{2};a q^{-\frac{1}{2}},bq^{-\frac{1}{2}}, cq^{\frac{1}{2}}, dq^\frac{1}{2}  |q).
\]
Letting $x \rightarrow 0$ gives the result.
\end{proof}

\subsection{Asymptotic solutions}
We define the set of regular spectral values
\[
\mathcal S_{\mathrm{reg}} = \mathbb C^*\setminus \{\pm q^{\frac{1}{2} k} \ |\ k \in \mathbb Z \}.
\]
For $\gamma \in \mathcal S_{\mathrm{reg}}\cup \{ \pm 1\}$ another solution for the eigenvalue equation \eqref{eq:eigenvalue equation} is the function
\begin{equation} \label{def:Phi}
\begin{split}
\Phi_\gamma(x)&=\Phi_\gamma(x;a,b,c,d|q) \\
&= (s\gamma)^k \frac{ (q/bx, q^2\gamma/asx;q)_\infty }{ (q/cx, q/dx ; q)_\infty } \ph{3}{2}{ q \gamma/s, cq\gamma/sa, dq\gamma/sa}{ q^2 \gamma /asx, q\gamma^2}{q, \frac{ q}{bx} }, \quad |x| > \frac{q}{|b|},
\end{split}
\end{equation}
where $x=zq^{-k}$, see \cite{KS03}. For $x \rightarrow \pm \infty$ we have
\begin{equation} \label{eq:asymp Phi}
\Phi_\gamma(zq^{-k})= (s\gamma)^k(1+\mathcal O(q^k)), \quad k \rightarrow \infty.
\end{equation}
Clearly $\Phi_{\gamma^{-1}}$, $\Phi_{\gamma}^\dagger$ and $\Phi_{\gamma^{-1}}^\dagger$ are also solutions to \eqref{eq:eigenvalue equation}. We remark that it follows from applying the transformation \cite[(III.9)]{GR04} for $_3\phi_2$-series, that
\[
\Phi_\gamma(x) = (s\gamma)^k \frac{ (q/ax, q^2\gamma/bsx;q)_\infty }{ (q/cx, q/dx;q)_\infty } \ph{3}{2}{ q \gamma/s, cq\gamma/sb, dq\gamma/sb}{ q^2 \gamma /bsx, q\gamma^2}{q, \frac{q}{ax} }, \quad x=zq^{-k}.
\]
So we see that $\Phi_\gamma=\Phi_{\gamma}^\dagger$, and if $\gamma \in \mathbb R$ we see that $\Phi_\gamma$ is real-valued. Using the eigenvalue equation $L\Phi_{\gamma}=\mu(\gamma)\Phi_\gamma$ we can extend $\Phi_\gamma$ to single-valued functions $\Phi^+_\gamma$ on $\mathbb R_q^+$, respectively $\Phi^-_\gamma$ on $\mathbb R_q^-$. We call $\Phi_\gamma^+$ and $\Phi_\gamma^-$ the asymptotic solutions of $Lf=\mu(\gamma)f$ on $\mathbb R_q^+$, respectively $\mathbb R_q^-$. The following lemma shows that $\Phi_\gamma^\pm$ and $\Phi_{\gamma^{-1}}^\pm$ are linear independent, hence they form linear bases for the eigenspaces $V_{\mu(\gamma)}^\pm$.
\begin{lem} \label{lem:det Phi}
For $\gamma \in \mathcal S_{\mathrm{reg}}$ we have
\[
D(\Phi_\gamma^\pm,\Phi_{1/\gamma}^\pm)(z_{\pm}q^{-k}) =  (\gamma-1/\gamma)K_{z_\pm}.
\]
\end{lem}
\begin{proof}
Since $\Phi_\gamma^+$ lies in $V^+_{\mu(\gamma)}$, the Casorati determinant $D(\Phi_\gamma^+,\Phi_{1/\gamma}^+)$ is constant on $\mathbb R_q^+$, so we can find the Casorati determinant by taking the limit $x \rightarrow  \infty$. From Lemma \ref{lem:asymp w&u} we find
\[
\lim_{k \rightarrow \infty} \frac{s^{2k-1} u(z_+q^{-k})}{z_+q^{-k}(1-q)} = K_{z_+},
\]
and then it follows from the first expression in Definition \ref{def:Casorati} and \eqref{eq:asymp Phi} that
\[
\lim_{k \rightarrow \infty} D(\Phi_\gamma^+,\Phi_{1/\gamma}^+)(z_+q^{-k})=  (\gamma-1/\gamma)K_{z_+}.
\]
The proof for $\Phi^-_\gamma$ is similar.
\end{proof}
Now we can expand the functions $\varphi_\gamma$ and $\varphi_\gamma^\dagger$ on $V_{\mu(\gamma)}^\pm$ in terms of $\Phi_{\gamma^{\pm 1}}^\pm$. The expansion of $\varphi_\gamma$ in terms of $\Phi_{\gamma^{\pm1}}^+$ (respectively $\Phi_{\gamma^{\pm1}}^-$) gives an explicit expression for $\varphi_\gamma$ for $x>q/|b|$ (respectively $x<-q/|b|$). For $\gamma \in \mathcal S_{\mathrm{reg}}$ we define a function $c_z(\gamma)$ by
\[
c_z(\gamma) = c_z(\gamma;a,b,c,d|q) = \frac{ (s/\gamma, cq/as\gamma, dq/as\gamma;q)_\infty \theta( bsz\gamma ) } { (cq/a, dq/a, 1/\gamma^2;q)_\infty \theta(bz) }.
\]
The desired expansion uses the $c$-function, see \cite[Prop.4.4]{KS03} with parameters as in \eqref{eq:param KS} and $Z = za/q$, or use the three-term transformation for $_3\phi_2$-functions \cite[(III.33)]{GR04}.
\begin{prop} \label{prop:c function exp}
For $\gamma \in \mathcal S_{\mathrm{reg}}$ and $x = z_{\pm}q^k \in \mathbb R_q$,
\[
\begin{split}
\varphi_\gamma(x) &= c_{z_\pm}(\gamma) \Phi_\gamma^\pm(x) + c_{z_\pm}(\gamma^{-1}) \Phi_{\gamma^{-1}}^\pm(x),\\
\varphi_\gamma^\dagger(x) &= c^\dagger_{z_\pm}(\gamma) \Phi_\gamma^\pm(x) + c^\dagger_{z_\pm}(\gamma^{-1}) \Phi_{\gamma^{-1}}^\pm(x).
\end{split}
\]
\end{prop}

The spaces $V^\pm_2$ and $V^\pm_{-2}$ are 2-dimensional by Lemma \ref{lem:dim V}, but they are clearly not spanned by $\Phi_\gamma^\pm$ and $\Phi_{1/\gamma}^\pm$, since $\gamma=\pm 1$ here. In the following lemma we give linear bases for the spaces $V^\pm_2$ and $V^\pm_{-2}$ that will be useful later on.
\begin{lem} \label{lem:ga = 1}
For $\gamma=1$ or $\gamma=-1$, the functions $\Phi_\gamma^\pm$ and $\left.\dfrac{d\Phi_{\gamma'}^\pm}{d\gamma'}\right|_{\gamma'=\gamma}$ form a linear basis for the spaces $V^\pm_2$, respectively $V^\pm_{-2}$.
\end{lem}
\begin{proof}
Differentiating the equation $L\Phi_\gamma^+=\mu(\gamma)\Phi_\gamma^+$ to $\gamma$, and setting $\gamma=\pm 1$ shows that $\frac{d\Phi_\gamma^+}{d\gamma}|_{\gamma=\pm 1}$ is an eigenfunction of $L$ for eigenvalue $\pm 2$. From the asymptotic behavior \eqref{eq:asymp Phi} of $\Phi_\gamma^+$ we find
\[
\frac{d\Phi_\gamma^+}{d\gamma}(zq^{-k}) = sk (s\gamma)^{k-1}\Big(1+\mathcal O(q^k)\Big), \quad k \rightarrow \infty,
\]
and then using Lemma \ref{lem:asymp w&u} it follows that
\[
D\Big(\Phi_\gamma^+, \frac{d\Phi_\gamma^+}{d\gamma}\Big)(x)= \gamma^{2k-2} K_{z_+}, \qquad x \in \mathbb R_q^+.
\]
For $\gamma =\pm1 $ we see that $D(\Phi_{\pm 1}^+,\left.\frac{d\Phi_\gamma^+}{d\gamma}\right|_{\gamma=\pm 1})= K_{z_+} \neq 0$. This proves the lemma for $\Phi_{\gamma}^+$. For $\Phi_\gamma^-$ the proof is the same.
\end{proof}

\subsection{A basis for $V_\mu$}
We are going to show that, under certain conditions on $\gamma$, the solutions $\varphi_\gamma$ and $\varphi_\gamma^\dagger$ form a linear basis for $V_{\mu(\gamma)}$. We do this by computing the Casorati determinant $D(\varphi_\gamma,\varphi_{\gamma}^\dagger)$.
\begin{lem} \label{lem:det phi}
For $x \in \mathbb R_q$ and $\gamma\in \mathbb C^*$ we have
\[
D(\varphi_\gamma, \varphi_\gamma^\dagger)(x) = \frac{(1-q)q}{as} \frac{ (s\gamma,s/\gamma;q)_\infty\theta(a/b)} {(cq/a,cq/b,dq/a,dq/b;q)_\infty}.
\]
\end{lem}
\begin{proof}
Let $\gamma \in \mathcal S_{\mathrm{reg}}$. From Proposition \ref{prop:diff origin} we know that $\varphi_\gamma, \varphi_\gamma^\dagger \in V_{\mu(\gamma)}$, hence by Lemma \ref{lem:dim V} the Casorati determinant $D(\varphi_\gamma, \varphi_\gamma^\dagger)$ is constant on $\mathbb R_q$. In order to calculate $D(\varphi_\gamma, \varphi_\gamma^\dagger)(x)$ we use the $c$-function expansions from Proposition \ref{prop:c function exp},
\[
D(\varphi_\gamma, \varphi_\gamma^\dagger)(x) = \sum_{\epsilon,\eta\in\{-1,1\}}c_{z_+}(\gamma^{\epsilon})c_{z_+}^\dagger(\gamma^\eta) D(\Phi_{\gamma^\epsilon}^+,\Phi_{\gamma^\eta}^+)(x), \qquad x = z_+q^{-k}.
\]
We apply Lemma \ref{lem:det Phi}, then
\[
D(\varphi_\gamma, \varphi_\gamma^\dagger)(z_+q^{-k}) = (\gamma-1/\gamma) K_{z_+} \Big( c_{z_+}(\gamma)c^\dagger_{z_+}(1/\gamma) - c_{z_+}(1/\gamma)c^\dagger_{z_+}(\gamma) \Big).
\]
Using $cq/as= bs/d$ and $dq/as=bs/c$, we find
\[
\begin{split}
 c_{z_+}(\gamma)&c^\dagger_{z_+}(1/\gamma) - c_{z_+}(1/\gamma)c^\dagger_{z_+}(\gamma)  = \\
&\frac{ (s\gamma,s/\gamma;q)_\infty }{ (\gamma^2,1/\gamma^2;q)_\infty  (cq/a,cq/b,dq/a,dq/b;q)_\infty \theta(az_+,bz_+) } \\
\times&  \Big(\theta(q/bsz_+\gamma, q\gamma/asz_+, cq\gamma/bs, cq/as\gamma) -  \theta(q\gamma/bsz_+, q/asz_+\gamma, cq/bs\gamma, cq\gamma/as) \Big)
\end{split}
\]
Now we use the $\theta$-product identity \eqref{eq:theta prod} with
\begin{align*}
x&= \frac{qe^{\frac{1}{2} i\kappa}}{bs} \sqrt{\frac{|c|}{z_+}},& v&=\gamma e^{\frac{1}{2} i\kappa} \sqrt{|c|z_+}, \\ y&=\frac{qe^{\frac{1}{2} i\kappa}}{as} \sqrt{\frac{|c|}{z_+}},& w&=\gamma e^{-\frac{1}{2} i\kappa}\sqrt{\frac{1}{|c|z_+}},
\end{align*}
where $c=|c|e^{i\kappa}$, then we obtain
\[
c_{z_+}(\gamma)c^\dagger_{z_+}(1/\gamma) - c_{z_+}(1/\gamma)c^\dagger_{z_+}(\gamma)
= \frac{ q}{asz_+(\gamma-1/\gamma)}  \frac{(s\gamma,s/\gamma;q)_\infty \theta(a/b,cz_+,dz_+) }{(cq/a,cq/b,dq/a,dq/b;q)_\infty \theta(az_+,bz_+)} .
\]
With the explicit expression for $K_{z_+}$ we find the desired result for $\gamma \in \mathcal S_{\mathrm{reg}}$. By continuity in $\gamma$ the result holds for all $\gamma \in \mathbb C^*$.
\end{proof}
Let $\mathcal S_{\mathrm{pol}}$ be the set of zeros of $\gamma \mapsto D(\varphi_\gamma,\varphi_\gamma^\dagger)$, i.e.,
\[
\mathcal S_{\mathrm{pol}} = \left\{ sq^k \ | \ k \in \mathbb Z_{\geq 0} \right\} \cup \left\{ s^{-1}q^{-k} \ | \ k \in \mathbb Z_{\geq 0} \right\}.
\]
\begin{prop} \label{prop:basis Vmu}
Let $\gamma \in \mathbb C^*\setminus \mathcal S_{\mathrm{pol}}$, then $\dim V_{\mu(\gamma)}=2$ and the set $\{\varphi_\gamma,\varphi_\gamma^\dagger\}$ is a linear basis of $V_{\mu(\gamma)}$.
\end{prop}
\begin{proof}
From Lemma \ref{lem:det phi} it follows that $\varphi_\gamma$ and $\varphi_\gamma^\dagger$ are linearly independent if $\gamma \not\in \mathcal S_{\mathrm{pol}}$. Since both functions are continuously differentiable at the origin, see Proposition \ref{prop:diff origin}, and since $\dim V_{\mu(\gamma)}\leq 2$ by Lemma \ref{lem:dim V}, we have $\dim V_{\mu(\gamma)}=2$, and $\varphi_\gamma$ and $\varphi_\gamma^\dagger$ form a linear basis for $V_{\mu(\gamma)}$.
\end{proof}
\begin{cor} \label{cor:extensions}
For $\gamma \in \mathbb C^*\setminus \mathcal S_{\mathrm{pol}}$ every function in $V_{\mu(\gamma)}^+$ (respectively $V_{\mu(\gamma)}^-$) has a unique extension to $V_{\mu(\gamma)}$.
\end{cor}
\begin{proof}
Fix a $\gamma \in \mathbb C^*\setminus \mathcal S_{\mathrm{pol}}$ and denote $\mu = \mu(\gamma)$. We consider the restriction map $res:V_\mu \rightarrow V_\mu^+$ defined by $f^{res} = f|_{\mathbb R_q^+}$. Let $f$ and $g$ be linearly independent in $V_\mu$. As in the proof of Lemma \ref{lem:dim V} it follows that $f^{res}$ and $g^{res}$ are linearly independent in $V_\mu^+$. Since $\dim V_\mu = \dim V_\mu^+ =2$ the map ${res}$ is a linear isomorphism. In a similar way a linear isomorphism between $V_\mu$ and $V_\mu^-$ can be constructed.
\end{proof}

For $\gamma \in \mathcal S_{\mathrm{pol}}$ the big $q$-Jacobi functions $\varphi_\gamma$ and $\varphi_\gamma^\dagger$ are actually multiples of big $q$-Jacobi polynomials, see \cite[Prop.5.3]{KS03}. The big $q$-Jacobi polynomials, see \cite{AA85}, \cite{KS98}, are defined by
\[
P_k(x;\alpha,\beta,\delta;q) = \ph{3}{2}{q^{-k}, \alpha \beta q^{k+1}, x}{\alpha q, \delta q}{q,q}, \qquad k \in \mathbb Z_{\geq 0}.
\]

\begin{lem} \label{lem:phi pol}
Let $\gamma_k=sq^k \in \mathcal S_{\mathrm{pol}}$ or $\gamma_k=s^{-1}q^{-k} \in \mathcal S_{\mathrm{pol}}$, then
\[
\varphi_{\gamma_k}(x) = \frac{ (cq/b, dq/b;q)_k }{ (cq/a, dq/a;q)_k } \left( \frac{b}{a} \right)^k \varphi_{\gamma_k}^\dagger(x),
\]
and
\[
\varphi_{\gamma_k}^\dagger(x) =  q^{-\frac{1}{2} k (k+1)} \left( -\frac{ a}{c} \right)^k \frac{ (cq/a;q)_k }{ (dq/b;q)_k } P_k(cx;c/b, d/a, c/a;q),
\]
for $x \in \mathbb R_q$.
\end{lem}
\begin{proof}
Let $k \in \mathbb Z_{\geq 0}$ and $\gamma_k= sq^k$. From Lemma \ref{lem:det phi} we see that the Casorati determinant $D(\varphi_{\gamma_k},\varphi_{\gamma_k}^*)(x)$, $x \in \mathbb R_q$, is equal to zero, hence $\varphi_{\gamma_k}(x) = C_k \varphi_{\gamma_k}^\dagger(x)$, for some constant $C_k$ independent of $x$. To find the constant $C_k$ we use Proposition \ref{prop:c function exp}. We have $c_{z}(\gamma_k)=0$ and $c_{z}^\dagger(\gamma_k)=0$, hence
\[
\varphi_{\gamma_k}(x) = c_{z_+}(1/\gamma_k)\Phi_{1/\gamma_k}^+(x) = \frac{c_{z_+}(1/\gamma_k)}{c_{z_+}^\dagger(1/\gamma_k)}\varphi_{\gamma_k}^\dagger(x), \qquad x=z_+q^n \in \mathbb R_q.
\]
Using $\theta(q^k x) = (-x)^{-k} q^{-\frac{1}{2} k (k-1)} \theta(x)$ we find
\[
C_k=\frac{c_{z_+}(1/\gamma_k)}{c_{z_+}^\dagger(1/\gamma_k)} = \frac{ (cq/b, dq/b;q)_k }{ (cq/a, dq/a;q)_k } \left( \frac{b}{a} \right)^k.
\]
Since $\varphi_\gamma = \varphi_{1/\gamma}$ the result also holds for $\gamma_k=s^{-1}q^{-k}$, $k \in \mathbb Z_{\geq 0}$.

Finally, writing out $\varphi_{\gamma_k}^\dagger(x)$ explicitly as a $_3\phi_2$-series using \eqref{def:phi} and then applying the transformation formula \cite[(III.13)]{GR04} shows that $\varphi_{\gamma_k}^\dagger(x)$ is a multiple of a big $q$-Jacobi polynomial in the variable $cx$.
\end{proof}

\subsection{Extensions of the asymptotic solutions}
By Corollary \ref{cor:extensions} the asymptotic solutions $\Phi_\gamma^+ \in V_{\mu(\gamma)}^+$ and $\Phi_\gamma^- \in V_{\mu(\gamma)}^-$ have unique extensions to $V_{\mu(\gamma)}$, provided that $\gamma \in \mathbb C^*\setminus \mathcal S_{\mathrm{pol}}$. We denote these extensions again by $\Phi_\gamma^+$ and $\Phi_\gamma^-$. Propositions \ref{prop:basis Vmu} and \ref{prop:c function exp} enable us to expand $\Phi_{\gamma^{\pm 1}}^\pm$ in terms of the basis $\{ \varphi_\gamma, \varphi_\gamma^\dagger\}$ of $V_{\mu(\gamma)}$.
\begin{prop} \label{prop:Phi+-}
For $x \in \mathbb R_q$ and $\gamma \in \mathcal S_{\mathrm{reg}}\setminus \{sq^k \ | \ k \in \mathbb Z_{\geq 0} \}$
\[
\begin{split}
\Phi^+_\gamma(x) &= d_{z_+}(\gamma)\varphi_\gamma(x)+ d^\dagger_{z_+}(\gamma)\varphi_\gamma^\dagger(x),\\
\Phi^-_\gamma(x) &= d_{z_-}(\gamma)\varphi_\gamma(x)+ d^\dagger_{z_-}(\gamma)\varphi_\gamma^\dagger(x),
\end{split}
\]
where
\[
d_z(\gamma)=d_z(\gamma;a,b,c,d|q) = \frac{  (cq/a, dq/a;q)_\infty \theta(bz) }{  \theta(a/b,cz,dz) } \ \frac{ (cq\gamma/sb, dq\gamma/sb;q)_\infty \theta(asz/q\gamma) }{ (q\gamma^2,s/\gamma;q)_\infty}.
\]
\end{prop}
\begin{proof}
Let $\gamma \in \mathcal S_{\mathrm{reg}}\setminus \mathcal S_{\mathrm{pol}}$. By Proposition \ref{prop:basis Vmu} we may expand
\[
\Phi_\gamma^\pm(x) = d_{z_\pm}(\gamma) \varphi_\gamma(x) + e_{z_\pm}(\gamma) \varphi_\gamma^\dagger(x), \qquad x \in \mathbb R_q,
\]
for some coefficients $d_{z}(\gamma)$ and $e_z(\gamma)$ independent of $x$. In order to compute the coefficients $d_z(\gamma)$ and $e_z(\gamma)$ we observe that it follows from $\Phi_\gamma^{\pm \dagger} = \Phi_\gamma^\pm$ that $e_z(\gamma) = d_z^\dagger(\gamma)$. To compute $d_z(\gamma)$ we use
\[
d_{z_{\pm}}(\gamma) = \frac{ D(\Phi_\gamma^\pm , \varphi_\gamma^\dagger)(x) }{ D(\varphi_\gamma, \varphi_\gamma^\dagger)(x) }.
\]
From the $c$-function expansion, Proposition \ref{prop:c function exp}, we find
\[
D(\Phi_\gamma^\pm, \varphi_\gamma^\dagger)(x) = c^\dagger_{z_\pm}(1/\gamma)D(\Phi_\gamma^\pm,\Phi_{1/\gamma}^\pm)(x), \qquad x \in \mathbb R_q,
\]
and then it follows from Lemmas \ref{lem:det Phi} and \ref{lem:det phi} that
\[
\begin{split}
d_z(\gamma) &= \frac{(\gamma-1/\gamma)K_z \,c^\dagger_z(1/\gamma) }{D(\varphi_\gamma,\varphi_\gamma^\dagger)}  \\
&= \frac{ asz (cq/a, dq/a;q)_\infty \theta(bz) }{ q\, \theta(a/b,cz,dz) } \ \frac{(\gamma-1/\gamma) (cq\gamma/bs, dq\gamma/bs;q)_\infty \theta(asz/\gamma) }{ (\gamma^2,s/\gamma;q)_\infty }.
\end{split}
\]
Here we also used the explicit expression for $K_z$ from Lemma \ref{lem:asymp w&u}. This is the desired result for $\gamma \in \mathcal S_{\mathrm{reg}}\setminus \mathcal S_{\mathrm{pol}}$. By continuity in $\gamma$ it holds also for $\gamma \in \{ s^{-1}q^{-k} \ | \ k \in \mathbb Z\}$.
\end{proof}
For $\gamma=s^{-1}q^{-k}$, $k \in \mathbb Z_{\geq 0}$, the Casorati determinant $D(\varphi_\gamma,\varphi_\gamma^\dagger)$ is equal to zero, hence $\varphi_\gamma$ is a multiple of $\varphi_\gamma^\dagger$. In this case Proposition \ref{prop:Phi+-} states that $\Phi_\gamma^\pm$ is also a multiple of $\varphi_\gamma^\dagger$.
\begin{cor} \label{cor:Phi pol}
For $\gamma_k = s^{-1}q^{-k}$, $k \in \mathbb Z_{\geq 0}$,
\[
\Phi_{\gamma_k}^\pm(x) = q^{\frac{1}{2} k(k-1)}\left(\frac{-1}{az_{\pm}} \right)^{k} \frac{ (cq/b,dq/b;q)_k }{ (s^2;q)_k  } \varphi_{\gamma_k}^\dagger(x).
\]
\end{cor}
\begin{proof}
Using Proposition \ref{prop:Phi+-} and Lemma \ref{lem:phi pol}, we find
\[
\Phi_{\gamma_k}^+(x) = \frac{b}{aq}\left(\frac{b}{qcdz_+} \right)^{k-1} \frac{ (cq/b,dq/b;q)_k\ F_{z_+}}{ (q^{1-k}/s^2;q)_k \theta(b/a,cz_+, dz_+, s^2) } \varphi_{\gamma_k}^\dagger(x),
\]
with
\[
F_{z_+} = \theta(cq/a, dq/a, q/bz_+, cdqz_+/b) - \theta( cq/b, dq/b, q/az_+, cdqz_+/a).
\]
Applying the $\theta$-product identity \eqref{eq:theta prod} with
\[
x=\frac{qe^{i(\kappa+\delta)}\sqrt{|cd|}}{b}, \quad y=\frac{qe^{i(\kappa+\delta)}\sqrt{|cd|}}{a}, \quad v= \frac{e^{-i(\kappa+\delta)}}{z_+\sqrt{|cd|}}, \quad w= e^{i(\kappa-\delta)}\sqrt{\left|\frac{c}{d}\right|},
\]
where $c=|c|e^{i\kappa}$ and $d=|d|e^{i\delta}$, we obtain
\[
F_{z_+} = \frac{ cdqz_+}{a} \theta(cdq^2/ab, a/b, 1/dz_+, 1/cz_+).
\]
Applying $(q^{1-k}/y;q)_k=(-y)^{-k}q^{-\frac{1}{2} k(k-1)} (y;q)_k$, identities for $\theta$-functions, and  $s^2=cdq/ab$, the result follows for $\Phi^+_{\gamma_k}$. Replacing $z_+$ by $z_-$ gives the result for $\Phi^-_{\gamma_k}$.
\end{proof}

In the expansion of $\Phi_\gamma^\pm$ in Proposition \ref{prop:Phi+-} we have assumed that $\gamma \not\in \{sq^k \ | \ k \in \mathbb Z\}$. At first sight it seems that the functions $\Phi_\gamma^\pm(x)$, considered as functions of $\gamma$ and with $x \in \mathbb R_q$ fixed, have simple poles at the points $\gamma= sq^k$, $k \in \mathbb Z_{\geq 0}$, which are the poles of the function $d_z(\gamma)$. It turns out that the functions $\Phi_\gamma^\pm(x)$ are actually analytic at these points.
\begin{prop} \label{prop:Phi pol}
For a given $x \in \mathbb R_q$ the functions $\gamma \mapsto \Phi_\gamma^\pm(x)$ are analytic on $\mathcal S_{\mathrm{reg}}$. In particular, for $\gamma_k=sq^k$, $k \in \mathbb Z_{\geq 0}$,
\[
\begin{split}
\Phi_{\gamma_k}^\pm(x) &= \left.\Res{\gamma=\gamma_k}\big( d_{z_\pm}(\gamma)\big)\,\frac{ d}{d\gamma}\varphi_\gamma(x)\right|_{\gamma=\gamma_k} + \left. \Res{\gamma=\gamma_k}\big( d_{z_{\pm}}^\dagger(\gamma)\big)\,\frac{ d}{d\gamma}\varphi_\gamma^\dagger(x)\right|_{\gamma=\gamma_k} + \tilde d_{z_\pm}(\gamma_k)\varphi_{\gamma_k}^\dagger(x),
\end{split}
\]
where
\[
\tilde d_{z}(\gamma_k) = \lim_{\gamma \rightarrow \gamma_k} \Bigg(\frac{ (cq/b, dq/b;q)_k }{ (cq/a, dq/a;q)_k } \left( \frac{b}{a} \right)^k d_{z}(\gamma) + d_{z}^\dagger(\gamma) \Bigg).
\]
\end{prop}
\begin{proof}
The expansion from Proposition \ref{prop:Phi+-} shows that the functions $\gamma \mapsto \Phi_\gamma^\pm(x)$, for a given $x \in \mathbb R_q$, are analytic functions on $\mathcal S_{\mathrm{reg}} \setminus \{ sq^k \ | \ k \in \mathbb Z\}$. So we only have to consider the functions $\Phi_\gamma^\pm(x)$ at the points $\gamma_k = sq^k$, $k \in \mathbb Z_{\geq 0}$.

Fix a $k \in \mathbb Z_{\geq 0}$ and a $x \in \mathbb R_q$. The function $\gamma \mapsto d_z(\gamma)$ has a simple pole at $\gamma=\gamma_k$ coming from the zero of the infinite product $(s/\gamma;q)_\infty$, and the functions $\gamma \mapsto \varphi_\gamma(x)$ and $\gamma \mapsto \varphi_\gamma^\dagger(x)$ are analytic at $\gamma=\gamma_k$. From Proposition \ref{prop:Phi+-} and Lemma \ref{lem:phi pol} it follows that
\[
\begin{split}
\Phi_\gamma^+(x) =& (\gamma-\gamma_k) d_{z_+}(\gamma) \frac{ \varphi_\gamma(x) - \varphi_{\gamma_k}(x)}{\gamma-\gamma_k} + (\gamma-\gamma_k) d_{z_+}^\dagger(\gamma) \frac{\varphi_\gamma^\dagger(x) - \varphi_{\gamma_k}^\dagger(x)}{\gamma-\gamma_k}\\
& + \Bigg(\frac{ (cq/b, dq/b;q)_k }{ (cq/a, dq/a;q)_k } \left( \frac{b}{a} \right)^k d_{z_+}(\gamma) + d_{z_+}^\dagger(\gamma) \Bigg) \varphi_{\gamma_k}^\dagger(x).
\end{split}
\]
We see that the limit $\lim_{\gamma \rightarrow \gamma_k} \Phi_\gamma^+(x)$ exists if $\tilde d_{z_+}(\gamma_k)$, as defined in the proposition, exists. Let us define
\[
\hat d_z(\gamma) = (s/\gamma;q)_\infty d_z(\gamma),
\]
then $\gamma \mapsto \hat d_z(\gamma)$ is regular at $\gamma=\gamma_k$. By a straightforward computation we obtain
\[
\frac{ (cq/b, dq/b;q)_k }{ (cq/a, dq/a;q)_k } \left( \frac{b}{a} \right)^k \hat d_z(\gamma_k) + \hat d_z^\dagger(\gamma_k) =0,
\]
and then it follows that $\tilde d_z(\gamma_k)$ exists.
\end{proof}

We now have the following properties of the functions $\Phi^\pm_\gamma$.
\begin{thm} \label{thm:properties Phi}
For $\gamma \in \mathcal S_{\mathrm{reg}}$ the functions $\Phi_\gamma^\pm$ satisfy the following properties:

\textnormal{(a)} $\Phi^\pm_\gamma \in V_{\mu(\gamma)}$.

\textnormal{(b)} For $|\gamma|<1$ we have
\[
\int_{\infty(z_-)}^0 \left|\Phi_\gamma^-(x)\right|^2 w(x) d_qx<\infty, \qquad
\int_0^{\infty(z_+)} \left|\Phi_\gamma^+(x)\right|^2 w(x) d_qx<\infty.
\]

\textnormal{(c)} The Casorati determinant $v(\gamma)=D(\Phi^+_\gamma, \Phi_\gamma^-)$ is constant on $\mathbb R_q$, and
\[
\begin{split}
&v(\gamma) = v(\gamma;a,b,c,d;z_-,z_+|q) \\
&=  -\frac{z_+(1-q) \theta(z_-/z_+) }{\theta(cz_-, dz_-, cz_+, dz_+)}
 \frac{ (cq\gamma/as, dq\gamma/as, cq\gamma/bs, dq\gamma/bs, s\gamma, q\gamma/s;q)_\infty  \theta(absz_- z_+/q\gamma) }{\gamma(q\gamma^2;q)_\infty^2}
\end{split}
\]
\end{thm}
\begin{proof}
Properties (a) and (b) follow directly from Proposition \ref{prop:Phi+-} and the asymptotic behavior of $\Phi_\gamma^\pm(x)$ for $|x| \rightarrow \infty$, so we only need to check the third property.

Let $\gamma \in \mathcal S_{\mathrm{reg}}\setminus \{sq^k \ | \ k \in \mathbb Z_{\geq 0} \}$. Since $\Phi^\pm_\gamma \in V_{\mu(\gamma)}$ the Casorati determinant $D(\Phi^-_\gamma, \Phi_\gamma^+)$ is constant on $\mathbb R_q$ by Lemma \ref{lem:dim V}. To calculate the determinant we use Proposition \ref{prop:Phi+-}, then
\[
D(\Phi^+_\gamma, \Phi^-_\gamma) = d_{z_-}(\gamma) D(\Phi^+_\gamma,\varphi_\gamma) + d^\dagger_{z_-}(\gamma)D(\Phi^+_\gamma,\varphi^\dagger_\gamma).
\]
We find from Proposition \ref{prop:c function exp} and Lemma \ref{lem:det Phi},
\[
\begin{split}
D(\Phi_\gamma^+,\varphi_\gamma) &= c_{z_+}(1/\gamma) D(\Phi_\gamma^+,\Phi_{1/\gamma}^+) = (\gamma-1/\gamma)c_{z_+}(1/\gamma) K_{z_+}, \\
D(\Phi_\gamma^+,\varphi_\gamma^\dagger) &= c_{z_+}^\dagger(1/\gamma) D(\Phi_\gamma^+,\Phi_{1/\gamma}^+) = (\gamma-1/\gamma)c_{z_+}^\dagger(1/\gamma) K_{z_+},
\end{split}
\]
so we have
\[
D(\Phi^+_\gamma, \Phi^-_\gamma) = (\gamma-1/\gamma)K_{z_+} \Big(d_{z_-}(\gamma)c_{z_+}(1/\gamma)  + d^\dagger_{z_-}(\gamma)c_{z_+}^\dagger(1/\gamma) \Big) .
\]
From the explicit expression for $d_{z_-}(\gamma)$ and $c_{z_+}(\gamma)$ we obtain
\[
\begin{split}
d_{z_-}(\gamma)c_{z_+}(1/\gamma) & + d^\dagger_{z_-}(\gamma)c_{z_+}^\dagger(1/\gamma) =
\frac{bsz_- (cq\gamma/as, dq\gamma/as, cq\gamma/bs, dq\gamma/bs, s\gamma;q)_\infty }{q\gamma (\gamma^2,q\gamma^2,s/\gamma;q)_\infty \theta(cz_-,dz_-,b/a,az_+,bz_+)  } \\
& \times \Big[ \theta(bz_-, az_+, asz_-/\gamma, bsz_+/\gamma) - \theta(az_-, bz_+, bsz_-/\gamma, asz_+/\gamma) \Big].
\end{split}
\]
Using the $\theta$-product identity \eqref{eq:theta prod} with
\begin{align*}
x&=\frac{ise^{i(\alpha+\beta)/2} \sqrt{ |abz_+z_-|}}{\gamma}, & y &= ie^{i(\alpha+\beta)/2}\sqrt{|abz_+z_-|}, \\
v&= ie^{i(\alpha-\beta)/2}\sqrt{\left|\frac{ az_-}{bz_+}\right|}, &
w&= ie^{i(\beta-\alpha)/2}\sqrt{\left|\frac{bz_-}{az_+}\right|}.
\end{align*}
where $a=|a|e^{i\alpha}$ and $b=|b|e^{i\beta}$, the term between square bracket equals
\[
bz_+ \theta(z_-/z_+, a/b, s/\gamma, absz_-z_+/\gamma).
\]
Using the explicit expression for $K_{z_+}$ we now find the Casorati determinant given in the theorem. By continuity in $\gamma$, the result holds for all $\gamma \in \mathcal S_{\mathrm{reg}}$.
\end{proof}

\section{The spectral measure} \label{sec4}
In this section we calculate explicitly the spectral measure $E$ for the self-adjoint operator $(L,\mathcal D)$ using the formula, see \cite[Thm.XII.2.10]{DS63},
\begin{equation} \label{eq:Stieltjes-Perron}
\langle E(\lambda_1,\lambda_2)f, g \rangle_{\mathcal L^2} = \lim_{\delta \downarrow 0} \lim_{\varepsilon \downarrow 0} \frac{1}{2\pi i} \int_{\lambda_1 + \delta}^{\lambda_2-\delta} \Big( \langle R(\mu+i\varepsilon) f,g \rangle_{\mathcal L^2} - \langle R(\mu-i\varepsilon) f,g \rangle_{\mathcal L^2} \Big) d\mu,
\end{equation}
for $\lambda_1<\lambda_2$ and $f,g \in \mathcal L^2$. Here $R(\mu)=(L-\mu)^{-1}$, $\mu \in \mathbb C \setminus \mathbb R$, denotes the resolvent operator. Our first goal is to find a useful description for the resolvent $R(\mu)$.

\subsection{The resolvent}
Let $\lambda \in \mathbb C \setminus \mathbb R$, and let $\gamma_\lambda$ be the unique complex number such that $|\gamma_\lambda|<1$ and $\lambda=\mu(\gamma_\lambda)$. Note that $\gamma_\lambda \not\in \mathbb R$, so $\gamma_\lambda \in \mathcal S_{\mathrm{reg}}$. Let $\mathcal V$ denote the set of zeros of $v(\gamma)$, i.e.,
\[
\mathcal V = \left(\bigcup_{\alpha \in \{\frac{cq}{as}, \frac{dq}{as}, \frac{cq}{bs}, \frac{dq}{bs}, s, \frac{q}{s} \} } \Big\{ \frac{1}{\alpha q^k}\ \big| \ k \in \mathbb Z_{\geq 0} \Big\} \cup \Big\{ z_- z_+q^k\sqrt{abcd/q} \ \big| \ k \in \mathbb Z \Big\} \right).
\]
If $v(\gamma)=D(\Phi_\gamma^+,\Phi_\gamma^-)\neq 0$ the functions $\Phi_\gamma^+$ and $\Phi_\gamma^-$ are linearly independent, hence for $\gamma \in \mathcal S_{\mathrm{reg}} \setminus \mathcal V$ they form a basis for the solution space $V_{\mu(\gamma)}$.

For $\lambda \in \mathbb C\setminus (\mathbb R \cup \mu(\mathcal V))$ we define the operator $R_\lambda:\mathcal D \rightarrow F(\mathbb R_q)$ by
\[
(R_\lambda f)(y) = \langle f, \overline{K_\lambda(\cdot,y)} \rangle_{\mathcal L^2}, \qquad f\in \mathcal D, \  y \in \mathbb R_q,
\]
where $K_\lambda:\mathbb R_q \times \mathbb R_q \rightarrow \mathbb C$ is the Green kernel defined by
\[
K_\lambda(x,y) =
\begin{cases}
\displaystyle \frac{ \Phi_{\gamma_\lambda}^-(x) \Phi_{\gamma_\lambda}^+(y) }{ v(\gamma_\lambda)}, & x \leq y ,\\ \\
\displaystyle \frac{ \Phi_{\gamma_\lambda}^-(y) \Phi_{\gamma_\lambda}^+(x) }{ v(\gamma_\lambda)}, & x >y.
\end{cases}
\]
Observe that by Theorem \ref{thm:properties Phi} we have $K_\lambda(x,\cdot) \in \mathcal D$ as well as $K_\lambda(\cdot,y) \in \mathcal D$ for $x,y \in \mathbb R_q$. So $R_\lambda$ is well-defined as an operator mapping from $\mathcal D$ to $F(\mathbb R_q)$. From Propositions \ref{prop:Phi+-} and \ref{prop:Phi pol} we know that the functions $\Phi^\pm_\gamma(x)$, considered as functions in $\gamma$, are analytic on $\mathcal S_{\mathrm{reg}}$. Now we see that, for $x,y \in \mathbb R_q$, the Green kernel $K_{\mu(\gamma)}(x,y)$ is a meromorphic function in $\gamma$, with poles coming from the zeros of $v(\gamma)$.

\begin{prop}
For $\lambda \in \mathbb C \setminus (\mathbb R \cup \mu(\mathcal V))$, the operator $R_{\lambda}$ is the resolvent of $(L,\mathcal D)$.
\end{prop}
\begin{proof}
The operator $(L,\mathcal D)$ is self-adjoint, hence the spectrum is contained in $\mathbb R$. So for $\lambda \in \mathbb C\setminus \mathbb R$ the resolvent $R(\lambda)$ is a bounded linear operator mapping from $\mathcal L^2$ to $\mathcal D$, and therefore for a given $y \in \mathbb R_q$ the assignment $f \mapsto (R(\lambda)f)(y)$ defines a bounded linear functional on $\mathcal L^2$. By the Riesz representation theorem there exists a kernel $K'_\lambda(\cdot,y) \in \mathcal L^2$ such that $(R(\lambda) f)(y) = \langle f, K'_\lambda(\cdot,y) \rangle_{\mathcal L^2}$. So it suffices to show that $(L-\lambda)R_\lambda f = f$ for $f \in \mathcal D$.

Suppose that $y> 0$, then,
\[
\begin{split}
(&L-\lambda)R_\lambda f(y)\\
= & \int_{\mathbb R_q} f(x) \Big(A(y) K_\lambda(x,y/q) + B(y) K_\lambda(x,yq) + (C(y)-\lambda) K_\lambda(x,y)\Big) w(x) d_q x \\
= & \frac{1}{v({\gamma_\lambda})}\int_{\infty(z_-)}^{yq} f(x)\Phi_{\gamma_\lambda}^-(x) \Big(A(y)\Phi_{\gamma_\lambda}^+(y/q) + B(y)\Phi_{\gamma_\lambda}^+(yq) + (C(y)-\lambda)\Phi_{\gamma_\lambda}^+(y) \Big) w(x)d_qx \\
+&\frac{1}{v({\gamma_\lambda})}\int_{y/q}^{\infty(z_+)} f(x)\Phi_{\gamma_\lambda}^+(x) \Big(A(y)\Phi_{\gamma_\lambda}^-(y/q) + B(y)\Phi_{\gamma_\lambda}^-(yq) + (C(y)-\lambda)\Phi_{\gamma_\lambda}^-(y) \Big) w(x)d_qx \\
+&\frac{(1-q)yw(y)}{v({\gamma_\lambda})} f(y) \Big(A(y)\Phi_{\gamma_\lambda}^-(y) \Phi_{\gamma_\lambda}^+(y/q)+B(y)\Phi_{\gamma_\lambda}^-(yq) \Phi_{\gamma_\lambda}^+(y) + (C(y)-\lambda)\Phi_{\gamma_\lambda}^-(y) \Phi_{\gamma_\lambda}^+(y)  \Big)\\
=& \frac{(1-q)yB(y)w(y)}{v({\gamma_\lambda})} f(y) \Big(\Phi_{\gamma_\lambda}^+(y)\Phi_{\gamma_\lambda}^-(yq) - \Phi_{\gamma_\lambda}^+(yq)\Phi_{\gamma_\lambda}^-(y) \Big)\\
=& f(y).
\end{split}
\]
Here we used that $\Phi_{\gamma_\lambda}^\pm$ are solutions of $Lf=\lambda f$, $v(\gamma) = D(\Phi_\gamma^+,\Phi_\gamma^-)$, and Definition \ref{def:Casorati} of the Casorati determinant.  The proof for $y < 0$ runs along the same lines.
\end{proof}

\subsection{The continuous spectrum}
We are going to investigate the integrand in \eqref{eq:Stieltjes-Perron}. Using the definition of the Green kernel we have
\begin{equation} \label{eq:int R}
\begin{split}
\langle R_\mu f, g \rangle_{\mathcal L^2} &= \iint \limits_{\mathbb R_q \times \mathbb R_q} f(x)\overline{g(y)} K_\mu(x,y) w(x)w(y) d_qx\, d_qy\\
&= \iint \limits_{\substack{(x,y) \in  \mathbb R_q \times \mathbb R_q \\ x \leq y }} \frac{ \Phi^-_{\gamma_\mu}(x) \Phi^+_{\gamma_\mu}(y)}{v(\gamma_\mu)} \big(f(x)\overline{g(y)}+f(y)\overline{g(x)}\big)\big(1-\frac{1}{2}\delta_{x,y}\big) w(x) w(y) d_qx\,d_qy.
\end{split}
\end{equation}
The Kronecker-delta function $\delta_{xy}$ is needed here to prevent the terms on the diagonal $x=y$ from being counted twice.

We define two functions $v_1$ and $v_2$ that we need to describe the spectral measure $E$;
\begin{align*}
v_1(\gamma) &= \frac{ (cq/a, dq/a;q)_\infty^2 \theta(bz_+,bz_-) }{(1-q)abz_-^2z_+^2 \theta(z_-/z_+,z_+/z_-,a/b,b/a)}\\
& \times \frac{(\gamma^{\pm2};q)_\infty}{(s\gamma^{\pm1}, cq\gamma^{\pm1}/as, dq\gamma^{\pm1}/as;q)_\infty \theta(s\gamma^{\pm1},absz_- z_+\gamma^{\pm 1})}\\
& \times \Big( z_-\theta(az_+, cz_+, dz_+, bz_-, asz_-\gamma^{\pm1}) -  z_+\theta(az_-, cz_-, dz_-, bz_+, asz_+\gamma^{\pm1})  \Big),\\
v_2(\gamma) &= \frac{(cq/a,dq/a,cq/b,dq/b;q)_\infty \theta(az_+, az_-, bz_+, bz_-, cdz_- z_+) }{abz_-^2z_+(1-q)\theta(z_+/z_-,a/b,b/a)} \\
& \times \frac{ (\gamma^{\pm2};q)_\infty }{ (s\gamma^{\pm1};q)_\infty \theta(s\gamma^{\pm1}, absz_- z_+\gamma^{\pm1}) }.
\end{align*}
Note that $v_1$ and $v_2$ are both invariant under $\gamma \leftrightarrow 1/\gamma$. Let $\mathcal D_{\text{fin}} \subset \mathcal D$ be the subspace consisting of finitely supported functions in $\mathcal L^2$. To a function $f \in \mathcal D_{\mathrm{fin}}$ we associate two functions $\mathcal F_cf$ and $\mathcal F_c^\dagger f$ on the unit circle $\mathbb T=\{z\in \mathbb C \ | \ |z|=1\}$ defined by
\[
\begin{split}
(\mathcal F_cf)(\gamma) &= \int_{\mathbb R_q} f(x) \varphi_\gamma(x) w(x) d_q x, \\
(\mathcal F_c^\dagger f)(\gamma) &= \int_{\mathbb R_q} f(x) \varphi_\gamma^\dagger(x) w(x) d_q x,
\end{split}
\]
where $\gamma \in \mathbb T$.

We are now almost ready to describe the spectral measure $E((\lambda_1,\lambda_2))$ for $(\lambda_1,\lambda_2) \subset (-2,2)$. First we give a preliminary result. The proof is an easy, but rather tedious computation that we  carry out in the appendix.
\begin{lem} \label{lem:I(x,y)}
For $x,y \in \mathbb R_q$ and  $\gamma, \gamma^{-1} \in \mathcal S_{\mathrm{reg}}\setminus \mathcal V$ we have
\[
\begin{split}
&\frac{ \Phi_{1/\gamma}^-(x) \Phi_{1/\gamma}^+(y)}{v(1/\gamma)} - \frac{ \Phi_{\gamma}^-(x) \Phi_{\gamma}^+(y)}{v(\gamma)} = \\
&\quad\frac{1}{\gamma-1/\gamma}\Big[ v_1(\gamma) \varphi_\gamma(x) \varphi_\gamma(y) + v_2(\gamma) \big(\varphi_\gamma(x) \varphi_\gamma^\dagger(y) + \varphi_\gamma^\dagger(x) \varphi_\gamma(y) \big) + v_1^\dagger(\gamma) \varphi_\gamma^\dagger(x)\varphi_\gamma^\dagger(y)\Big].
\end{split}
\]
\end{lem}

\begin{prop} \label{prop:E(-2,2)}
Let $(a,b,c,d) \in P_{\mathrm{gen}}$, let $0< \psi_1<\psi_2< \pi$, and let $\lambda_1=\mu(e^{i\psi_2})$ and $\lambda_2=\mu(e^{i\psi_1})$. Then for $f,g \in \mathcal D_{\text{fin}}$,
\[
\begin{split}
\langle E(\lambda_1,\lambda_2)f,g \rangle_{\mathcal L^2}= \frac{1}{2\pi}\int_{\psi_1}^{\psi_2}\big( (\mathcal F_c^\dagger \overline{g})(e^{i\psi}) \, (\mathcal F_c \overline{g})(e^{i\psi}) \big)
\begin{pmatrix}
v_2(e^{i\psi}) & v_1^\dagger(e^{i\psi}) \\
v_1(e^{i\psi}) & v_2(e^{i\psi})
\end{pmatrix}
\vect{(\mathcal F_cf)(e^{i\psi})}{(\mathcal F_c^\dagger f)(e^{i\psi})} d\psi.
\end{split}
\]
\end{prop}
\begin{proof}
Let $\lambda \in (-2,2)$, then $\lambda = \mu(e^{i\psi})$ for a unique $\psi \in (0,\pi)$.  In this case we have
\[
\lim_{\varepsilon \downarrow 0} \gamma_{\lambda \pm i\varepsilon} = e^{\mp i\psi}.
\]
Now we obtain
\[
\begin{split}
\lim_{\varepsilon \downarrow 0} &\Big( \frac{ \Phi_{\gamma_{\lambda+i\varepsilon}}^-(x) \Phi_{\gamma_{\lambda+i\varepsilon}}^+(y)}{v(\gamma_{\lambda+i\varepsilon})} - \frac{ \Phi_{\gamma_{\lambda-i\varepsilon}}^-(x) \Phi_{\gamma_{\lambda-i\varepsilon}}^+(y)}{v(\gamma_{\lambda-i\varepsilon})} \Big) \\
&= \frac{ \Phi_{e^{-i\psi}}^-(x) \Phi_{e^{-i\psi}}^+(y)}{v(e^{-i\psi})} - \frac{ \Phi_{e^{i\psi}}^-(x) \Phi_{e^{i\psi}}^+(y)}{v(e^{i\psi})},
\end{split}
\]
which is symmetric in $x$ and $y$ by Lemma \ref{lem:I(x,y)}. Symmetrizing the double $q$-integral from \eqref{eq:int R} then gives
\[
\begin{split}
\lim_{\varepsilon \downarrow 0}&\Big(\langle R_{\lambda+i\varepsilon} f,g \rangle_{\mathcal L^2} - \langle R_{\lambda-i\varepsilon} f,g \rangle_{\mathcal L^2}\Big) = \\
&\iint \limits_{\mathbb R_q \times \mathbb R_q}
\frac{1}{\gamma-1/\gamma}\Big[ v_1(\gamma) \varphi_\gamma(x) \varphi_\gamma(y) + v_2(\gamma) \big(\varphi_\gamma(x) \varphi_\gamma^\dagger(y) + \varphi_\gamma^\dagger(x) \varphi_\gamma(y) \big) + v_1^\dagger(\gamma) \varphi_\gamma^\dagger(x)\varphi_\gamma^\dagger(y)\Big] \\
& \quad \times  f(x) \overline{g(y)} w(x) w(y) d_qx\, d_qy,
\end{split}
\]
where $\gamma = e^{i\psi}$.
Rewriting this expression in vector notation and using formula \eqref{eq:Stieltjes-Perron}, we obtain the desired result.
\end{proof}
The previous proposition implies that $(-2,2)$ is contained in the spectrum $\sigma(L)$ of $L$. Since $\varphi_\gamma, \varphi_\gamma^\dagger \not\in \mathcal L^2$ for $\gamma \in \mathbb T$, $(-2,2)$ is part of the continuous spectrum. Observe that the spectral projection is on a 2-dimensional space of eigenvectors, so $(-2,2)$ has multiplicity two. Because the spectrum is a closed set, the points $-2$ and $2$ must be elements of the spectrum $\sigma(L)$.
\begin{lem} \label{lem:-2 2}
The points $-2$ and $2$ are elements of the continuous spectrum of $L$.
\end{lem}
\begin{proof}
Since the residual spectrum of a self-adjoint operator is empty, $\mu(-1)=-2$ and $\mu(1)=2$ must either be elements of the point spectrum or the continuous spectrum. We show that $2$ is not in the point spectrum of $L$. The proof for $-2$ is the same.

Suppose that there exists a function $f \in \mathcal L^2$ that satisfies $Lf=2f$, then the restriction $f^{\mathrm{res}}$ of $f$ to $\mathbb R_q^+$ is an element of $V_2^+$. From Lemma \ref{lem:ga = 1} it follows that $f^{\mathrm{res}}=\alpha \Phi_1^+ + \beta \left.\frac{ d\Phi_\gamma^+}{d\gamma} \right|_{\gamma=1}$ for some coefficients $\alpha$ and $\beta$. But neither of the functions $\Phi_1^+$ and $\left.\frac{ d\Phi_\gamma^+}{d\gamma} \right|_{\gamma=1}$ is integrable with respect to $w(x)$ on $\mathbb R_q^+$, see \eqref{eq:asymp Phi} and Lemma \ref{lem:asymp w&u}, which contradicts the fact that $f \in \mathcal L^2$.
\end{proof}

\subsection{The point spectrum}
Let $\mu \in \mathbb R\setminus [-2,2]$, then
\[
\lim_{\varepsilon \downarrow 0} \gamma_{\mu\pm i \varepsilon} = \gamma_\mu.
\]
From \eqref{eq:Stieltjes-Perron} and \eqref{eq:int R} we see that in this case the only contribution to the spectral measure $E$ comes from the real poles of the Green kernel $K_{\mu(\gamma)}(x,y)$, $x,y \in \mathbb R_q$, considered as a function of $\gamma$. Let $\Gamma \subset \mathcal V$ denote the set of poles of the Green kernel inside the interval $(-1,1)$. We now have the following property for the spectral measure.
\begin{prop} \label{prop:E=0}
For real numbers $\mu_1< \mu_2$ satisfying \mbox{$(\mu_1,\mu_2) \cap \Big( \mu(\Gamma) \cup [-2,2] \Big) = \emptyset$}, we have $E((\mu_1,\mu_2))=0$.
\end{prop}
The set $\Gamma$ of real poles of the Green kernel inside the unit disc is given by
\[
\begin{split}
\Gamma &=  \Gamma^{\mathrm{fin}}_{s} \cup \Gamma^{\mathrm{fin}}_{q/s} \cup \Gamma^{\mathrm{fin}}_{dq/as}\cup \Gamma^{\mathrm{inf}},\\
\Gamma^{\mathrm{fin}}_\alpha &=  \Bigg\{ \frac{1}{\alpha q^{k} }\ \Big| \ k\in\mathbb Z_{\geq 0},\ \alpha q^{k}>1 \Bigg\},\\
\Gamma^{\mathrm{inf}} &= \Bigg\{ z_-z_+q^{k}\sqrt{abcd/q} \ \Big| \ k \in \mathbb Z, \ -z_-z_+q^k\sqrt{abcd/q}<1 \Bigg\}.
\end{split}
\]
The superscripts `fin' and `inf' refer to the finite or infinite cardinality of the sets. Recall that for $a,b,c,d \in \mathbb R$ we have assumed that $q<a/b<1$ and $q<c/d<1$, therefore
\[
 \frac{acq}{bd} ,  \frac{bcq}{ad} ,  \frac{adq}{bc} <1, \qquad 1<\frac{bdq}{ac}<\frac{1}{q}.
\]
So the factor $(cq\gamma/as, dq\gamma/as, cq\gamma/bs, dq\gamma/bs;q)_\infty$ of the function $v(\gamma)$ has at most one zero inside the interval $(-1,1)$, and this zero only occurs when $a,b,c,d \in \mathbb R$. This shows that the set $\Gamma_{dq/as}^{\mathrm{fin}}$ has at most one element. We remark that for $(a,b,c,d) \in P_{\mathrm{gen}}$ the real poles of the Green kernel are simple.

Next we need to find the spectral measure on the set $\mu(\Gamma)$. For this the following lemma is useful.
\begin{lem} \label{lem:Phi on si_p}
For $\gamma \in \Gamma$ we have
\[
\Phi_\gamma^+(x) = b(\gamma) \Phi_\gamma^-(x), \qquad x \in \mathbb R_q,
\]
where $b(\gamma)=b(\gamma;a,b,c,d;z_-,z_+;q)$ is given by
\[
b(\gamma)=
\begin{cases}
\left(\dfrac{z_+}{z_-}\right)^{k+1}\dfrac{\theta(cz_-,dz_-)}{\theta(cz_+,dz_+)}, &\gamma =z_-z_+q^{k}\sqrt{abcd/q} \in \Gamma^{\mathrm{inf}},\\
\left(\dfrac{z_-}{z_+}\right)^k ,& \gamma = s^{-1}q^{-k} \in \Gamma^{\mathrm{fin}}_s,\\
\left( \dfrac{z_-}{z_+} \right)^k \dfrac{ \theta(az_+, bz_+, cz_-, dz_-) }{ \theta(az_-, bz_-, cz_+, dz_+) }, &\gamma = sq^{-1-k} \in \Gamma^{\mathrm{fin}}_{q/s},\\
\dfrac{ \theta(bz_+,cz_-)}{\theta(bz_-,cz_+)}, &\gamma = \dfrac{as}{dq} \in \Gamma^{\mathrm{fin}}_{dq/as}.
\end{cases}
\]
\end{lem}
\begin{proof}
If $\gamma \in \Gamma$, then $v(\gamma) = D(\Phi_\gamma^-,\Phi_\gamma^+) = 0$, hence $\Phi_\gamma^+ = b(\gamma) \Phi_\gamma^-$ for some nonzero factor $b(\gamma)$. For $\gamma_k = s^{-1}q^{-k} \in \Gamma^{\mathrm{fin}}_s$ the value of $b(\gamma_k)$ follows from Corollary \ref{cor:Phi pol}. For the other cases it is enough by Proposition \ref{prop:Phi+-} to show that $d_{z_+}(\gamma)=b(\gamma) d_{z_-}(\gamma)$ and $d_{z_+}^\dagger(\gamma)=b(\gamma) d_{z_-}^\dagger(\gamma)$. This is verified by a straightforward calculation. Note that for $\gamma = as/dq \in \Gamma^{\mathrm{fin}}_{dq/as}$ we have $d_{z_+}^\dagger(\gamma)=d_{z_-}^\dagger(\gamma)=0$.
\end{proof}

We are now ready to calculate the spectral measure $E$ of $(L,\mathcal D)$ for the discrete part of the spectrum $\sigma(L)$. We will write $E(\{\mu(\gamma)\})$ for the spectral measure $E((a,b))$, if $(a,b)$ is an interval such that $(a,b) \cap \mu(\Gamma) = \{\mu(\gamma)\}$. For $f \in \mathcal L^2$ we define a function $\mathcal F_pf$ on $\Gamma$ by
\[
(\mathcal F_pf)(\gamma) = \langle f, \Phi_\gamma^+ \rangle_{\mathcal L^2}, \qquad \gamma \in \Gamma.
\]
Note that Theorem \ref{thm:properties Phi}(b) and Lemma \ref{lem:Phi on si_p} imply that $\Phi_\gamma^+ \in \mathcal L^2$ for $\gamma \in \Gamma$, so the inner product above exists for all $f \in \mathcal L^2$.
\begin{prop} \label{prop:E point}
Let $(a,b,c,d) \in P_{\mathrm{gen}}$. For $f,g \in \mathcal L^2$ and $\gamma \in \Gamma$, the spectral measure $E(\{\mu(\gamma)\})$ is given by
\[
\langle E(\{\mu(\gamma)\})f,g \rangle_{\mathcal L^2} = (\mathcal F_pf)(\gamma) \overline{(\mathcal F_p g)(\gamma)} N(\gamma),
\]
where
\[
N(\gamma)=N(\gamma;a,b,c,d;z_-,z_+|q) = b(\gamma)^{-1}\Res{\lambda=\gamma} \left(\frac{ 1/\lambda-\lambda}{\lambda v(\lambda)} \right),
\]
and $b(\gamma)$ is given in Lemma \ref{lem:Phi on si_p}.
\end{prop}
\begin{proof}
Let $\gamma \in \Gamma$, and $f,g \in \mathcal L^2$. We use \eqref{eq:Stieltjes-Perron} and \eqref{eq:int R} to calculate the spectral measure $E(\{\mu(\gamma)\})$. By the residue theorem we find
\[
\begin{split}
\langle E(\{\mu(\gamma)\})f,g \rangle_{\mathcal L^2} =& \frac{1}{2\pi i}\int_{\mathcal C} \langle R_\mu f,g \rangle_{\mathcal L^2} d\mu \\
=&\iint \limits_{\substack{(x,y) \in  \mathbb R_q \times \mathbb R_q \\ x \leq y }} -\Res{\lambda= \gamma} \left((1-1/\lambda^2)\frac{ \Phi^-_{\lambda}(x) \Phi^+_{\lambda}(y)}{v(\lambda)}\right) \\
&\qquad \times \big(f(x)\overline{g(y)}+f(y)\overline{g(x)}\big)\big(1-\frac{1}{2}\delta_{x,y}\big) w(x) w(y) d_qx\,d_qy
\end{split}
\]
Here $\mathcal C$ is a clockwise oriented contour encircling $\mu(\gamma)$ once, and $\mathcal C$ does not encircle any other points in $\Gamma$. The factor $1-1/\lambda^2$ comes from changing the integration variable $\mu=\mu(\lambda)$ to $\lambda$. By Lemma \ref{lem:Phi on si_p} we have $\Phi_{\gamma}^+ = b(\gamma) \Phi_{\gamma}^-$, so we may symmetrize the double $q$-integral, and then
\[
\langle E(\{\mu(\gamma)\})f,g \rangle_{\mathcal L^2} = b(\gamma)^{-1} \langle f,\Phi_{\gamma}^+\rangle_{\mathcal L^2} \langle \Phi_{\gamma}^+, g \rangle_{\mathcal L^2} \, \Res{\lambda=\gamma} \left(\frac{ 1/\lambda-\lambda}{\lambda v(\lambda)} \right).
\]
This proves the proposition.
\end{proof}
It is an easy exercise to calculate the weight $N(\gamma)$, $\gamma \in \Gamma$, explicitly. The result is as follows. For $\gamma= as/dq \in \Gamma^{\mathrm{fin}}_{dq/as}$ we have
\[
N(\gamma) = \frac{ \theta(bz_-, cz_+, cz_+, dz_-, dz_+) (ac/bdq;q)_\infty}{ z_+(1-q) \theta(bz_+, bdz_-z_+, z_-/z_+) (q,a/b, a/d, c/b, c/d;q)_\infty },
\]
for $\gamma = s^{-1}q^{-k} \in \Gamma^{\mathrm{fin}}_{s}$
\[
\begin{split}
N(\gamma) =& \frac{ \theta(cz_-,cz_+, dz_-,dz_+) (ab/cdq;q)_\infty }{ z_+(1-q)\theta(z_-/z_+, cdz_-z_+) (q,a/c,a/d, b/c,b/d;q)_\infty } \\
& \times \frac{ (q^2cd/ab, qcd/ab;q)_{2k} }{ (q,cq/a, cq/b, dq/a, dq/b, qcd/ab;q)_k } \left(- \frac{abz_+^2}{q} \right)^k q^{\frac32 k(k-1)},
\end{split}
\]
for $\gamma = sq^{-1-k} \in \Gamma^{\mathrm{fin}}_{q/s}$
\[
\begin{split}
N(\gamma) = & \frac{ \theta(az_-,bz_-, cz_+, cz_+, dz_+, dz_+) (cd/abq;q)_\infty }{z_+(1-q) \theta(az_+, bz_+, z_-/z_+, abz_-z_+) (q, c/a,c/b, d/a,d/b;q)_\infty } \\
& \times \frac{ (qab/cd, ab/cd;q)_{2k} }{ (q,aq/c,aq/d, bq/d, bq/d, abq/cd;q)_k } \left( -\frac{ z_+^2 q^4 }{cd } \right)^k q^{\frac32 k(k-1)},
\end{split}
\]
and finally for $\gamma = absz_-z_+q^{k-1} \in \Gamma^{\mathrm{inf}}$ we have
\[
\begin{split}
N(\gamma) = & \frac{ \theta(cz_+, dz_+)^2 (abcdz_-^2z_+^2/q, abcdz_-^2z_+^2;q)_\infty }{z_+(1-q) \theta(z_-/z_+) (q,q,abz_-z_+,acz_-z_+, adz_-z_+, bcz_-z_+, bdz_-z_+, cdz_-z_+;q)_\infty } \\
& \times \frac{ (abz_-z_+,acz_-z_+, adz_-z_+, bcz_-z_+, bdz_-z_+, cdz_-z_+;q)_k }{ (abcdz_-^2z_+^2/q, abcdz_-^2z_+^2;q)_{2k} } \left( \frac{z_-}{z_+} \right)^{k+1} (-1)^kq^{\frac{1}{2} k(k+1)}.
\end{split}
\]

As a result of Proposition \ref{prop:E point} we obtain orthogonality relations for $\Phi_\gamma^+$, $\gamma \in \Gamma$.
\begin{cor} \label{cor:orth rel}
Let $\gamma, \gamma' \in \Gamma$, then
\[
\langle \Phi_\gamma^+, \Phi_{\gamma'}^+ \rangle_{\mathcal L^2} = \frac{\delta_{\gamma \gamma'}}{N(\gamma)}.
\]
\end{cor}
\begin{proof}
Eigenfunctions corresponding to different eigenvalues of a self-adjoint operator are pairwise orthogonal. Since for $\gamma, \gamma' \in \Gamma$, $\gamma \neq \gamma'$, the functions $\Phi_\gamma^+$ and $\Phi_{\gamma'}^+$ are eigenfunctions of $(L,\mathcal D)$ with distinct eigenvalues $\mu(\gamma)$ and $\mu(\gamma')$, orthogonality follows.

Let $\gamma \in \Gamma$. By Proposition \ref{prop:E point},
\[
\langle \Phi_\gamma^+, \Phi_{\gamma}^+ \rangle_{\mathcal L^2} = \langle E(\{\mu(\gamma)\})\Phi_\gamma^+, \Phi_{\gamma}^+ \rangle_{\mathcal L^2} =N(\gamma) \langle \Phi_\gamma^+, \Phi_{\gamma}^+ \rangle_{\mathcal L^2}^2 ,
\]
from which the squared norm of $\Phi_\gamma^+$ follows.
\end{proof}
\begin{rem}
For $\gamma, \gamma' \in \Gamma^{\mathrm{fin}}_s$ Corollary \ref{cor:orth rel} gives orthogonality relations for a finite number of big $q$-Jacobi polynomials, see Proposition \ref{prop:Phi pol} and Lemma \ref{lem:phi pol}.
\end{rem}
Since $\Phi_{s^{-1}}^+(x)=1$, Corollary \ref{cor:orth rel} gives an evaluation of the integral $\langle 1,1 \rangle_{\mathcal L^2}$ in case $\Gamma^{\mathrm{fin}}_s$ is not empty, i.e., if $s>1$.
\begin{cor}
For $\sqrt{ab/cdq}<1$ we have
\[
\begin{split}
\frac{1}{1-q}&\int_{\mathbb R_q} \frac{ (ax, bx;q)_\infty }{ (cx,dx;q)_\infty } d_q x \\
=& z_+ \frac{ (az_+, bz_+;q)_\infty }{ (cz_+, dz_+;q)_\infty } {}_2\psi_2 \left( \genfrac{.}{.}{0pt}{}{cz_+,dz_+}{az_+,bz_+}\ ;q,q \right)- z_- \frac{ (az_-, bz_-;q)_\infty }{ (cz_-, dz_-;q)_\infty } {}_2\psi_2 \left( \genfrac{.}{.}{0pt}{}{cz_-,dz_-}{az_-,bz_-}\ ;q,q \right) \\
=& z_+\frac{  (q,a/c,a/d,b/c,b/d;q)_\infty \theta(z_-/z_+, cdz_-z_+) }{ (ab/cdq;q)_\infty \theta(cz_-, dz_-, cz_+, dz_+;q)_\infty },
\end{split}
\]
\end{cor}
Here $_2\psi_2$ denotes the usual bilateral series as defined in \cite{GR04}.
\begin{rem}
This is the summation formula from \cite[Exer.5.10]{GR04}, and it is actually valid without the restrictions on $a,b,c,d$ as long as the denominator of the integrand is nonzero for all $x \in \mathbb R_q$. Note that there is a misprint in \cite[Exer.5.10]{GR04}: the factors $(e/ab,q^2f/e;q)_\infty$ on the left hand side must be replaced by $(c/qf,q^2f/c;q)_\infty$.
\end{rem}

\begin{cor}
Let $(a,b,c,d) \in P_{\mathrm{gen}}$. The spectrum of the self-adjoint operator $(L,\mathcal D)$ consists of the continuous spectrum $\sigma_c(L) = [-2,2]$, with multiplicity two, and the point spectrum $\sigma_p(L)=\mu(\Gamma)$, with multiplicity one.
\end{cor}
\begin{proof}
This follows from Propositions \ref{prop:E(-2,2)}, \ref{prop:E=0}, \ref{prop:E point} and Lemma \ref{lem:-2 2}.
\end{proof}

\section{The vector-valued big $q$-Jacobi function transform} \label{sec5}
In this section we define the vector-valued big $q$-Jacobi function transform $\mathcal F$, which is closely related to the maps $\mathcal F_c$, $\mathcal F_c^\dagger$ and $\mathcal F_p$. We show that $\mathcal F$ is an isometric isomorphism mapping from $\mathcal L^2$ into a certain Hilbert space $\mathcal H$, and we also determine $\mathcal F^{-1}$. The vector-valued big $q$-Jacobi function transform diagonalizes the second order difference operator $L$; let $M$ be the multiplication operator defined by $(M f)(\gamma) = \mu(\gamma)f(\gamma)$ for all $\mu(\gamma) \in \sigma(L)$, then
\[
(\mathcal F \circ L \circ \mathcal F^{-1})f = M f,
\]
for all $f \in \mathcal H$ such that $M f \in \mathcal H$.

We still assume that $(a,b,c,d) \in P_{\mathrm{gen}}$, and we distinguish between the cases $a \neq \overline{b}$ and $a=\overline{b}$. For a vector $y=\vect{y_1}{y_2} \in \mathbb C^2$ we denote
\[
y^T=
\begin{cases}
(\overline{y_1}\ \overline{y_2} ), &\text{if }a = \overline{b},\\
(\overline{y_2}\ \overline{y_1} ), &\text{if }a \neq \overline{b}.
\end{cases}
\]
With this convention we have for $\gamma \in \mathbb R \cup \mathbb T$ and $x \in \mathbb R_q$
\[
\vect{\varphi_\gamma(x)}{\varphi_\gamma^\dagger(x)}^T =  \big( \varphi_\gamma^\dagger (x) \ \varphi_\gamma(x) \big),
\]
since $\overline{\varphi_\gamma(x)} = \varphi_\gamma^\dagger(x)$ if $a = \overline{b}$, and $\overline{\varphi_\gamma(x)}=\varphi_\gamma(x)$ if $a \neq \overline{b}$.

\subsection{The vector-valued big $q$-Jacobi function transform $\mathcal F$}
Let $F(\mathbb T \cup \Gamma)$ be the linear space consisting of functions that are complex-valued on $\Gamma$ and $\mathbb C^2$-valued on $\mathbb T$. With the maps $\mathcal F_c$, $\mathcal F_c^\dagger$ and $\mathcal F_p$ we define an integral transform $\mathcal F:\mathcal D_{\mathrm{fin}} \rightarrow F(\mathbb T\cup \Gamma)$.
\begin{Def}
For $f \in \mathcal D_{\mathrm{fin}}$ we define the vector-valued big $q$-Jacobi function $\mathcal F$ by
\[
(\mathcal F f)(\gamma) =
\begin{cases}
\displaystyle \vect{(\mathcal F_c f)(\gamma)}{(\mathcal F_c^\dagger f)(\gamma)}, & \gamma \in \mathbb T,\\ \\
(\mathcal F_p f)(\gamma), & \gamma \in \Gamma.
\end{cases}
\]
\end{Def}
We define a kernel $\Psi(x,\gamma)$, $x \in \mathbb R_q$, $\gamma \in \mathbb T \cup \Gamma$, by
\begin{equation} \label{eq:Psi}
\Psi(x,\gamma) =
\begin{cases}
\displaystyle \vect{\varphi_\gamma(x)}{\varphi_\gamma^\dagger(x)}, & \gamma \in \mathbb T,\\ \\
\Phi_\gamma^+(x), & \gamma \in \Gamma,
\end{cases}
\end{equation}
We may write $\mathcal F$ as an integral transform with kernel $\Psi$,
\[
(\mathcal Ff)(\gamma) = \int_{\mathbb R_q} f(x) \Psi(x,\gamma) w(x) d_qx, \qquad f \in \mathcal D_{\mathrm{fin}},\quad \gamma \in \mathbb T \cup \Gamma.
\]
We are going to show that $\mathcal F$ extends to a continuous operator mapping from $\mathcal L^2$ into a Hilbert space $\mathcal H$, that we now define.

We define a matrix-valued function $\mathbf v$ on $\mathbb T$ by
\[
\gamma \mapsto \mathbf v(\gamma) =
\begin{pmatrix}
v_2(\gamma) & v_1^\dagger(\gamma) \\
v_1(\gamma) & v_2(\gamma)
\end{pmatrix}.
\]
We remark that $\mathbf v(\gamma)$, $\gamma \in \mathbb T$, is positive-definite. Let $\mathcal H_c'$ be the Hilbert space consisting of $\mathbb C^2$-valued functions on $\mathbb T$, that have finite norm with respect to the inner product
\[
\langle g_1, g_2 \rangle_{\mathcal H_c'} = \frac{1}{4\pi i} \int_\mathbb T g_2(\gamma)^T \mathbf v(\gamma)
g_1(\gamma) \frac{ d\gamma}{\gamma},
\]
where the unit circle $\mathbb T$ is oriented in the counter-clockwise direction. Let $r$ denote the reflection operator defined by $(r g)(\gamma) = g(\gamma^{-1})$. We define the Hilbert space $\mathcal H_c$ to be the subspace of $\mathcal H_c'$ consisting of functions $g$ that satisfy $r g=g$ in $\mathcal H_c'$. We denote the inner product on $\mathcal H_c$ by $\langle \cdot, \cdot \rangle_{\mathcal H_c}$. Furthermore, let $\mathcal H_p$ be the Hilbert space consisting of complex-valued functions on $\Gamma$, that have finite norm with respect to the inner product
\[
\langle g_1, g_2 \rangle_{\mathcal H_p} = \sum_{\gamma \in \Gamma} g_1(\gamma) \overline{g_2(\gamma)} N(\gamma).
\]
We define the Hilbert space $\mathcal H \subset F(\mathbb T\cup \Gamma)$ by $\mathcal H = \mathcal H_c \oplus \mathcal H_p$.
\begin{prop} \label{prop:F iso}
The map $\mathcal F$ extends uniquely to an operator $\mathcal F : \mathcal L^2 \rightarrow \mathcal H$, satisfying
\[
\langle \mathcal Ff_1, \mathcal Ff_2 \rangle_{\mathcal H} = \langle f_1,f_2 \rangle_{\mathcal L^2}, \qquad f_1,f_2 \in \mathcal L^2.
\]
Hence, $\mathcal F$ is an isometric isomorphism onto its range $\mathcal R(\mathcal F) \subset \mathcal H$.
\end{prop}
\begin{proof}
Let $f_1,f_2 \in \mathcal D_{\mathrm{fin}}$. Combining Propositions \ref{prop:E(-2,2)} and \ref{prop:E point} we find
\[
\langle f_1, f_2 \rangle_{\mathcal L^2} = \langle E(\mathbb R) f_1, f_2 \rangle_{\mathcal L^2} = \langle \mathcal Ff_1, \mathcal Ff_2 \rangle_{\mathcal H}.
\]
Here we used
\[
\big( (\mathcal F_c^\dagger \overline{f})(\gamma)\  (\mathcal F_c \overline{f})(\gamma) \big) =
\vect{(\mathcal F_c^\dagger f)(\gamma)}{(\mathcal F_c f)(\gamma)}^T.
\]
Since $\mathcal D_{\mathrm{fin}}$ is dense in $\mathcal L^2$, the map $\mathcal F$ extends uniquely to a continuous operator, also denoted by $\mathcal F$, mapping isometrically into $\mathcal R(\mathcal F) \subset \mathcal H$.
\end{proof}

\begin{lem} \label{lem:Psi in H}
Let $y \in \mathbb R_q$ and let $f_y(x)=\delta_{xy}/w(y) \in \mathcal L^2$, then $\mathcal Ff_y = \Psi(y,\cdot) \in \mathcal H$.
\end{lem}
\begin{proof}
We have
\[
(\mathcal F f_y)(\gamma) =
\begin{cases}
\displaystyle \vect{\varphi_\gamma(y)}{\varphi_\gamma^\dagger(y)}, & \gamma \in \mathbb T,\\ \\
\Phi^+_\gamma(y), & \gamma \in \Gamma,
\end{cases}
\]
so $\mathcal Ff_y=\Psi(y, \cdot)$. By Proposition \ref{prop:F iso} this lies in $\mathcal H$.
\end{proof}

We define an integral transform $\mathcal G : \mathcal H \rightarrow F(\mathbb R_q)$ by
\[
(\mathcal Gg)(x) = \langle g, \Psi(x,\cdot) \rangle_{\mathcal H}, \qquad g \in \mathcal H, \quad x \in \mathbb R_q.
\]
By Lemma \ref{lem:Psi in H} this inner product exists for all $g \in \mathcal H$. We denote by $\mathcal G_c$, respectively $\mathcal G_p$, the integral transform $\mathcal G$ restricted to $\mathcal H_c$, respectively $\mathcal H_p$.
\begin{prop} \label{prop:GF=id}
$\mathcal G \mathcal F = id_{\mathcal L^2}$
\end{prop}
\begin{proof}
Let $f \in \mathcal L^2$ and let $f_y \in \mathcal L^2$ be defined as in Lemma \ref{lem:Psi in H}, then it follows from Proposition \ref{prop:F iso} that
\[
f(y) = \langle f, f_y \rangle_{\mathcal L^2} = \langle \mathcal Ff, \mathcal Ff_y \rangle_{\mathcal H} =
\big(\mathcal G(\mathcal Ff) \big)(y).\qedhere
\]
\end{proof}
We showed that $\mathcal G$ is a left inverse of $\mathcal F$. Next we are going show that $\mathcal G$ is also a right inverse. We do this for the transforms $\mathcal G_c$ and $\mathcal G_p$ separately. First a preliminary result. We denote by $\langle f, g \rangle_{k;n}$ the limit of the truncated inner product $\lim_{l,m \rightarrow \infty} \langle f,g \rangle_{k,l;m,n}$, provided that this limit exists.
\begin{lem} \label{lem:inprod phi psi}
Let $\gamma_1,\gamma_2 \in \mathbb C^*$ such that $\mu(\gamma_1) \neq \mu(\gamma_2)$, then for $\phi \in V_{\mu(\gamma_1)}$ and $\psi \in V_{\mu(\gamma_2)}$,
\[
\langle \phi, \overline{\psi} \rangle_{k;n} = \frac{D(\phi, \psi)(z_+q^{n-1})- D(\phi, \psi)(z_-q^{k-1})}{\mu(\gamma_1)-\mu(\gamma_2)}.
\]
\end{lem}
\begin{proof}
Functions in $V_\mu$, $\mu \in \mathbb C$, are continuously differentiable at the origin, therefore
\[
\lim_{l \rightarrow \infty} D(\phi, \psi)(z_\pm q^{l}) =0.
\]
Since $\phi$ and $\psi$ are eigenfunctions of $L$ for eigenvalue $\mu(\gamma_1)$, respectively $\mu(\gamma_2)$, we obtain from Proposition \ref{prop:Casorati}
\[
\big(\mu(\gamma_1)-\mu(\gamma_2)\big) \langle \phi, \overline{\psi} \rangle_{k;n} =D(\phi, \psi)(z_+q^{n-1})- D(\phi, \psi)(z_-q^{k-1}). \qedhere
\]
\end{proof}
We are going to apply the previous lemma to the functions $\varphi_\gamma$, $\varphi_\gamma^\dagger$ and $\Phi_\gamma^\pm$, which are functions in $V_{\mu(\gamma)}$ by Propositions \ref{prop:basis Vmu} and \ref{prop:Phi+-}. The following lemma will be useful.
\begin{lem} \label{lem:asympt DPhi}
For $k \rightarrow \infty$,
\[
D(\Phi_{\gamma_1}^\pm,\Phi_{\gamma_2}^\pm)(z_\pm q^{-k}) = (\gamma_1-\gamma_2)  K_{z_\pm}(\gamma_1 \gamma_2)^{k-1}\big(1+\mathcal O(q^k)\big).
\]
\end{lem}
\begin{proof}
This follows from the definition of the Casorati determinant \eqref{def:Casorati}, and from the asymptotic behavior of $\Phi_\gamma^\pm(x)$ and $u(x)/x$ for large $|x|$, see \eqref{eq:asymp Phi} and Lemma \ref{lem:asymp w&u}. See also the proof of Lemma \ref{lem:det Phi}.
\end{proof}
As a consequence we obtain the following orthogonality relation.
\begin{lem} \label{lem:orth varphi Phi}
Let $\gamma \in \mathbb T$ and $\gamma' \in \Gamma$, then
\[
\langle \varphi_\gamma, \Phi^+_{\gamma'} \rangle_{\mathcal L^2} =0, \qquad \langle \varphi_\gamma^\dagger, \Phi^+_{\gamma'} \rangle_{\mathcal L^2} =0.
\]
\end{lem}
\begin{proof}
From Lemmas \ref{lem:inprod phi psi}, \ref{lem:asympt DPhi} and the $c$-function expansions from Proposition \ref{prop:c function exp} we find
\[
\langle \varphi_\gamma, \Phi^+_{\gamma'} \rangle_{\mathcal L^2} = \lim_{k,n \rightarrow -\infty}\big( c_{z_+}(\gamma) \langle \Phi^+_\gamma, \Phi^+_{\gamma'} \rangle_{k;n} +c_{z_+}(1/\gamma)\langle \Phi^+_{1/\gamma}, \Phi^+_{\gamma'} \rangle_{k;n} \big) = 0,
\]
since $|\gamma'|<1$. In the same way it follows that $\langle \varphi_\gamma^\dagger, \Phi^+_{\gamma'} \rangle_{\mathcal L^2} =0$.
\end{proof}

We are now ready to show that $\mathcal G_p$ is a partial right inverse of the map $\mathcal F$.
\begin{prop} \label{prop:Gp}
The map $\mathcal G_p : \mathcal H_p \rightarrow F(\mathbb R_q)$ satisfies
\[
\langle \mathcal G_p g_1, \mathcal G_pg_2 \rangle_{\mathcal L_2} = \langle g_1, g_2 \rangle_{\mathcal H_p}, \qquad g_1,g_2 \in \mathcal H_p.
\]
Moreover, for $g \in \mathcal H_p$ we have $\mathcal F (\mathcal G_{p}g) = \mathbf 0 +g$ in $\mathcal H$, where $\mathbf 0$ denotes the zero function in $\mathcal H_c$.
\end{prop}
\begin{proof}
Let $g,h$ be finitely supported functions in $\mathcal H_p$. Then we find from Corollary \ref{cor:orth rel},
\[
\begin{split}
\langle \mathcal G_pg, \mathcal G_ph \rangle_{\mathcal L^2} &= \int_{\mathbb R_q} \Big( \sum_{\gamma \in \Gamma} g(\gamma) \Phi_\gamma^+(x) N(\gamma) \Big)  \overline{\Big( \sum_{\gamma' \in \Gamma} h(\gamma') \Phi_{\gamma'}^+(x) N(\gamma') \Big)}w(x) d_qx\\
&= \sum_{\gamma,\gamma' \in \Gamma} \langle \Phi_\gamma^+,  \Phi_{\gamma'}^+ \rangle_{\mathcal L^2} g(\gamma) \overline{h(\gamma')} N(\gamma) N(\gamma') \\
&= \sum_{\gamma \in \Gamma} g(\gamma) \overline{h(\gamma)} N(\gamma) = \langle g, h \rangle_{\mathcal H_p}.
\end{split}
\]
In order to prove the identity $\mathcal F(\mathcal G_p g)=\mathbf 0 + g$, we split this identity into three different cases:
\[
\mathcal F_p (\mathcal G_p g)=g, \qquad \mathcal F_c (\mathcal G_p g)=0 \quad \text{and} \quad \mathcal F_c^\dagger (\mathcal G_p g)=0.
\]
The identity $\mathcal F_p (\mathcal G_p g)= g$ is proved in a similar way as in the proof of Proposition \ref{prop:GF=id}, and the other two identities follow from Lemma \ref{lem:orth varphi Phi}. Since the set of finitely supported functions is dense in $\mathcal H_p$, the proposition follows.
\end{proof}
Next we are going to show that $\mathcal G_c$ is also a partial right inverse of $\mathcal F$. For this we apply a classical method used by G\"otze \cite{Go65} and by Braaksma and Meulenbeld \cite{BM67} for the Jacobi function transform.

We define for $\gamma \in \mathbb T$,
\begin{equation} \label{eq:def u1 u2}
\begin{split}
u_1(\gamma)=u_1(\gamma;a,b,c,d;z_-,z_+|q)&=K_{z_+}\,c_{z_+}(\gamma)c_{z_+}(1/\gamma)-K_{z_-}\,c_{z_-}(\gamma)c_{z_-}(1/\gamma),\\
u_2(\gamma)=u_2(\gamma;a,b,c,d;z_-,z_+|q)& = K_{z_+}\,c_{z_+}(\gamma)c_{z_+}^\dagger(1/\gamma)-K_{z_-}\,c_{z_-}(\gamma)c_{z_-}^\dagger (1/\gamma).
\end{split}
\end{equation}
Explicitly, using the expressions for $c_z$ and $K_z$, we have
\[
\begin{split}
u_1(\gamma) &=   \frac{(1-q) (s\gamma^{\pm 1}, cq\gamma^{\pm 1}/as, dq\gamma^{\pm 1}/as;q)_\infty }{ (cq/a,cq/a,dq/a,dq/a,\gamma^{\pm 2};q)_\infty \theta(bz_+, bz_-, cz_+, cz_-, dz_+, dz_-)} \\
& \times \Big( z_+\theta(az_+, bz_-, cz_-, dz_-, bsz_+\gamma^{\pm 1})-z_- \theta(az_-, bz_+, cz_+, dz_+, bsz_-\gamma^{\pm 1}) \Big).
\end{split}
\]
For $u_2$ we have
\[
\begin{split}
u_2(\gamma) =& \frac{(1-q)q\gamma}{as}\frac{ (s\gamma^{\pm 1}, cq/as\gamma, cq\gamma/bs, dq/as\gamma, dq/bs;q)_\infty }{ (cq/a, cq/b, dq/a, dq/b, \gamma^{\pm2};q)_\infty } \\
&\times \Bigg( \frac{\theta(bsz_-\gamma,asz_-/q\gamma)}{\theta(cz_-,dz_-)} - \frac{\theta(bsz_+\gamma,asz_+/q\gamma)}{\theta(cz_+,dz_+)}  \Bigg).
\end{split}
\]
Using the $\theta$-product identity \eqref{eq:theta prod} with
\[
x=z_-e^{i(\kappa+\delta)/2} \sqrt{|cd|}, \quad y= z_+ e^{i(\kappa+\delta)/2}\sqrt{|cd|}, \quad v = \frac{bs \gamma e^{-i(\kappa+\delta)/2}}{\sqrt{|cd|}}, \quad w= e^{i(\kappa-\delta)/2}\sqrt{\left| \frac{c}{d} \right| },
\]
where $c=|c|e^{i\kappa}$ and $d= |d|e^{i\delta}$, we obtain
\[
u_2(\gamma) =  z_+(1-q) \frac{ (s\gamma^{\pm1},  cq\gamma^{\pm1}/as, cq\gamma^{\pm1}/bs , dq\gamma^{\pm 1}/as, dq\gamma^{\pm1}/bs;q)_\infty \theta(z_-/z_+, cdz_-z_+)}{(cq/a, cq/b, dq/a, dq/b, \gamma^{\pm2};q)_\infty  \theta(cz_-, cz_+, dz_+, dz_-) }.
\]
Observe that $u_2=u_2^\dagger$ and $u_2(\gamma)=u_2(1/\gamma)$, and that $u_2$ is real-valued on $\mathbb T\setminus\{-1,1\}$.

Let $C_0(\mathbb T)$ be the set of functions defined by
\[
C_0(\mathbb T) = \Big\{ g:\mathbb T \rightarrow \mathbb C \ | \ g \text{ is continuous,}\ g(-1)=g(1)=0,\ g(\gamma)=g(1/\gamma) \Big\}.
\]
\begin{prop} \label{prop:lim kn}
Let $g \in C_0(\mathbb T)$ and let $\gamma'\in \mathbb T\setminus\{-1,1\}$, then
\[
\begin{split}
\lim_{k,n \rightarrow -\infty} \frac{1}{4\pi i} \int_\mathbb T g(\gamma) \langle \varphi_\gamma, \overline{\varphi_{\gamma'}} \rangle_{k;n}\frac{d\gamma}{\gamma } &= g(\gamma')u_1(\gamma'), \\
\lim_{k,n \rightarrow -\infty} \frac{1}{4\pi i} \int_\mathbb T g(\gamma) \langle \varphi_\gamma^\dagger, \overline{\varphi_{\gamma'}} \rangle_{k;n}\frac{d\gamma}{\gamma } &=g(\gamma')u_2(\gamma')
\end{split}
\]
\end{prop}
\begin{proof}
We prove the first identity in the proposition, the second identity is proved in the same way.
Let us fix a $g \in C_0(\mathbb T)$, and let us define
\[
I_{z}^m(\theta') = \frac{1}{2\pi} \int_0^{\pi} g(e^{i\theta}) \frac{ D(\varphi_{e^{i\theta}}, \varphi_{e^{i\theta'}})(zq^{-m})} { 2\cos(\theta) - 2 \cos(\theta') } d\theta.
\]
From Lemma \ref{lem:inprod phi psi} we find
\[
\frac{1}{4\pi i}\int_\mathbb T g(\gamma) \langle \varphi_\gamma, \overline{\varphi_{\gamma'}} \rangle_{k;n}\frac{d\gamma}{\gamma} = I_{z_+}^{1-n}(\theta') - I_{z_-}^{1-k}(\theta'),
\]
where $\gamma'= e^{i\theta'}$ with $\theta' \in (0,\pi)$. We see that we need to investigate the limit of $I_z^m(\theta')$ when $m \rightarrow \infty$. Using the $c$-function expansion from Proposition \ref{prop:c function exp} and Lemma \ref{lem:asympt DPhi} we obtain, for large $m$,
\[
I_z^m(\theta') = \frac{K_z}{2\pi} \sum_{\xi,\eta \in \{-1,1\}} \int_0^\pi g(e^{i\theta}) \Big(\psi_z^m(\theta,\theta';\xi,\eta) +\mathcal O(q^m) \Big) d\theta,
\]
where
\[
\psi_z^m(\theta,\theta';\xi,\eta) = \frac{ (e^{i \xi \theta}- e^{i \eta \theta'}) e^{i(m-1)(\xi\theta+\eta \theta')}c_z(\xi \theta) c_z(\eta \theta') }{2 \cos(\theta) - 2 \cos(\theta')}.
\]
Since $c_z(\gamma)$ is continuous on $\mathbb T\setminus\{-1,1\}$ the functions $\psi_z^m$, considered as functions of $\theta$, are continuous on $(0,\pi)\setminus\{\theta'\}$. We see immediately that $\psi_z^m(\theta,\theta';1,1)$ and $\psi_z^m(\theta,\theta';-1,-1)$ have a removable singularity at $\theta=\theta'$. Now by the Riemann-Lebesgue Lemma the terms with these two functions vanish in the limit, and this leaves us with
\[
\lim_{m \rightarrow \infty} I_z^m(\theta') = \lim_{m \rightarrow \infty} \frac{K_z}{2\pi}\int_0^\pi g(e^{i\theta}) \big(\psi_z^m(\theta,\theta';1,-1)+ \psi_z^m(\theta,\theta';-1,1)\big) d\theta.
\]
Here we applied dominated convergence to get rid of the $\mathcal O(q^{m})$-terms.
Using the identity $\cos(\alpha) - \cos(\beta) = 2 \sin(\frac{\alpha+\beta}{2}) \sin(\frac{ \alpha-\beta}{2})$ we find
\begin{align}
\psi_z^m(\theta,\theta';1,-1)+ \psi_z^m(\theta,\theta';-1,1) & \nonumber\\
=\frac{ 1}{4 \sin\left(\frac{\theta+\theta'}{2} \right) \sin\left( \frac{ \theta - \theta'}{2}\right) } &\Big(c_z(e^{i\theta}) c_z(e^{-i\theta'}) e^{i(m-1)(\theta-\theta')} (e^{i\theta}-e^{-i\theta'}) \nonumber \\
\qquad &+ c_z(e^{-i\theta}) c_z(e^{i\theta'}) e^{i(m-1)(\theta'-\theta)} (e^{-i\theta}-e^{i\theta'}) \Big) \nonumber \\
=\frac{ 1}{4 \sin\left(\frac{\theta+\theta'}{2} \right) \sin\left( \frac{ \theta - \theta'}{2}\right) } &
\Big( [c_z(e^{-i\theta})c_z(e^{i\theta'})- c_z(e^{i\theta})c_z(e^{-i\theta'})] e^{i(m-1)(\theta'-\theta)}(e^{-i\theta}-e^{i\theta'}) \nonumber\\
&+ c_z(e^{i\theta}) c_z(e^{-i\theta'}) \psi^m(\theta,\theta') \Big), \label{eq:psi}
\end{align}
where
\[
\begin{split}
\psi^m(\theta,\theta') &= e^{i(m-1)(\theta'-\theta)}(e^{-i\theta}-e^{i\theta'}) + e^{i(m-1)(\theta-\theta')}(e^{i\theta}-e^{-i\theta'})\\
&= 2\cos\big(m\theta -(m-1) \theta'\big) - 2\cos\big((m-1)\theta - m\theta'\big).
\end{split}
\]
The first term in \eqref{eq:psi} has a removable singularity, so by the Riemann-Lebesgue Lemma this term also vanishes in the limit, and now we have
\[
\begin{split}
\lim_{m \rightarrow \infty} I_z^m(\theta')& = \lim_{m \rightarrow \infty} \frac{K_z}{2\pi}\int_0^\pi g(e^{i\theta})c_z(e^{i\theta}) c_z(e^{-i\theta'})  \frac{\psi^m(\theta,\theta') }{4 \sin\left(\frac{\theta+\theta'}{2} \right) \sin\left( \frac{ \theta - \theta'}{2}\right) }d\theta\\
&= \lim_{m \rightarrow \infty} \frac{K_z}{2\pi}\int_0^\pi g(e^{i\theta})c_z(e^{i\theta}) c_z(e^{-i\theta'}) D_m(\theta;\theta') d\theta,
\end{split}
\]
where $D_m(\theta;\theta')$ is the Dirichlet kernel
\[
D_m(\theta;\theta') = \frac{ \sin\left( (m-\frac{1}{2})(\theta-\theta') \right) }{ \sin\left(\frac{1}{2}(\theta-\theta') \right) }.
\]
From the well-known properties of the Dirichlet-kernel we obtain
\[
\lim_{m \rightarrow \infty} I_z^m(\theta') = K_z\, g(e^{i\theta'}) c_z(e^{i\theta'})c_z(e^{-i\theta'}),
\]
and from this the result follows.
\end{proof}

\begin{prop} \label{prop:Fg1g2}
Let $g_1,g_2 \in C_0(\mathbb T)$ and let $\gamma' \in \mathbb T\setminus\{-1,1\}$, then
\[
\int_{\mathbb R_q} \Bigg[ \frac{1}{4\pi i} \int_\mathbb T \vect{\varphi_\gamma(x)}{\varphi_\gamma^\dagger(x)}^T \vect{g_1(\gamma)}{g_2(\gamma)} \frac{ d\gamma}{\gamma}\Bigg] \vect{\varphi_{\gamma'}(x)}{\varphi_{\gamma'}^\dagger(x)} w(x) d_qx= \mathbf{u}(\gamma')\vect{g_1(\gamma')}{g_2(\gamma')},
\]
where $\mathbf u$ is the matrix-valued function on $\mathbb T\setminus\{-1,1\}$ defined by
\[
\gamma \mapsto \mathbf{u}(\gamma) =
\begin{pmatrix}
u_2(\gamma) & u_1(\gamma) \\
u_1^\dagger(\gamma) & u_2(\gamma)
\end{pmatrix}.
\]
\end{prop}
\begin{proof}
Let $g_1,g_2 \in C_0(\mathbb T)$ and $\gamma,\gamma' \in \mathbb T\setminus\{-1,1\}$. From Proposition \ref{prop:lim kn} we find
\[
\begin{split}
g_2(\gamma')u_1(\gamma') &= \lim_{k,n \rightarrow -\infty} \frac{1}{4\pi i} \int_\mathbb T g_2(\gamma) \Big(\int_{z_-q^{k}}^{z_+q^{n}} \varphi_\gamma(x) \varphi_{\gamma'}(x)w(x) d_qx\Big) \frac{d\gamma}{\gamma} \\
&= \int_{\mathbb R_q} \varphi_{\gamma'}(x)\Big( \frac{1}{4\pi i} \int_\mathbb T
g_2(\gamma) \varphi_\gamma(x) \frac{d\gamma}{\gamma} \Big) w(x) d_qx.
\end{split}
\]
To justify the interchanging of the order of integration, we note that it follows from the explicit expressions for $\varphi_\gamma(x)$ and $w(x)$ that
\[
\varphi_\gamma(x) \varphi_{\gamma'}(x)w(x) = 1 + \mathcal O(q^m), \qquad x=z_{\pm}q^m \rightarrow 0,
\]
so that the sums
\[
\sum_{m=n}^\infty \varphi_\gamma(z_\pm q^m) \varphi_{\gamma'}(z_\pm q^m) q^m w(z_\pm q^m),
\]
both converge uniformly on $\mathbb T\setminus\{-1,1\}$. In the same way we find
\[
\begin{split}
g_2(\gamma')u_2(\gamma') = \int_{\mathbb R_q} \varphi_{\gamma'}^\dagger(x)\Big( \frac{1}{4\pi i} \int_\mathbb T
g_2(\gamma) \varphi_\gamma(x) \frac{d\gamma}{\gamma} \Big) w(x) d_qx,\\
g_1(\gamma')u_1^\dagger(\gamma') = \int_{\mathbb R_q} \varphi_{\gamma'}^\dagger(x)\Big( \frac{1}{4\pi i} \int_\mathbb T
g_1(\gamma) \varphi_\gamma^\dagger(x) \frac{d\gamma}{\gamma} \Big) w(x) d_qx, \\
g_1(\gamma')u_2(\gamma') = \int_{\mathbb R_q} \varphi_{\gamma'}(x)\Big( \frac{1}{4\pi i} \int_\mathbb T
g_1(\gamma) \varphi_\gamma^\dagger(x) \frac{d\gamma}{\gamma} \Big) w(x) d_qx.
\end{split}
\]
Now the proposition follows.
\end{proof}
The matrix-valued function $\mathbf u$ has the following useful property, which is proved in the appendix.
\begin{lem} \label{lem:u^-1 = v}
For $\gamma \in \mathbb T \setminus \{-1,1\}$,
\[
\mathbf{u}(\gamma)^{-1} = \mathbf{v}(\gamma).
\]
\end{lem}
We define
\[
C_0(\mathbb T;\mathbb C^2) = \Bigg\{ g=\vect{g_1}{g_2}\ \Big|\ g_1,g_2 \in C_0(\mathbb T) \Bigg\} \subset \mathcal H_c.
\]
We are now in a position to show that $\mathcal G_c$ is a partial right inverse of $\mathcal F$.
\begin{prop} \label{prop:Gc}
The map $\mathcal G_c:\mathcal H_c \rightarrow F(\mathbb R_q)$ satisfies
\[
\langle \mathcal G_cg_1, \mathcal G_cg_2 \rangle_{\mathcal L^2} = \langle g_1,g_2 \rangle_{\mathcal H_c}, \qquad g_1,g_2 \in \mathcal H_c.
\]
Moreover, for $g \in \mathcal H_c$ we have $\mathcal F(\mathcal G_c g)=g+\mathbf 0$ in $\mathcal H$, where $\mathbf 0$ denotes the zero function in $\mathcal H_p$.
\end{prop}
\begin{proof}
Let $\gamma' \in \mathbb T\setminus\{-1,1\}$, let $g^{(1)},g^{(2)} \in C_0(\mathbb T)$ and define $g= \vect{g^{(1)}}{g^{(2)}}$. Since $v_1$, $v_1^\dagger$ and $v_2$ are continuous on $\mathbb T$, both components of the $\mathbb C^2$-valued function
\[
\gamma \mapsto
\mathbf{v}(\gamma)
\vect{g^{(1)}(\gamma)}{g^{(2)}(\gamma)}
\]
are in $C_0(\mathbb T)$. Now by Proposition \ref{prop:Fg1g2} and Lemma \ref{lem:u^-1 = v} we have
\[
\vect{\big(\mathcal F_c(\mathcal G_c g)\big)(\gamma')}{\big(\mathcal F_c^\dagger(\mathcal G_c g)\big)(\gamma')} = \mathbf u(\gamma') \mathbf v(\gamma')g(\gamma') = g(\gamma').
\]
Moreover, for $\gamma' \in \Gamma$,
\[
\begin{split}
\big(\mathcal F_p ( \mathcal G_c g)\big)(\gamma') &= \lim_{k,n \rightarrow -\infty} \langle \mathcal G_c g, \Phi_{\gamma'}^+ \rangle_{k;n} \\
&= \lim_{k,n \rightarrow -\infty} \frac{1}{4\pi i} \int_\mathbb T \big( \langle \varphi_\gamma^\dagger, \Phi_{\gamma'}^+ \rangle_{k;n} \ \langle \varphi_\gamma, \Phi_{\gamma'}^+ \rangle_{k;n} \big) \mathbf v(\gamma) g(\gamma) \frac{d\gamma}{\gamma} \\
&=0,
\end{split}
\]
by dominated convergence and Lemma \ref{lem:orth varphi Phi}. This shows that $\mathcal F(\mathcal G_c g) = g+\mathbf 0$ in $\mathcal H$.

Let $g_1,g_2 \in C_0(\mathbb T^2)$, then it follows from Proposition \ref{prop:F iso} that
\[
\langle g_1,g_2 \rangle_{\mathcal H_c} =\langle g_1+\mathbf 0, g_2+\mathbf 0 \rangle_{\mathcal H}= \langle \mathcal F(\mathcal G_c  g_1), \mathcal F(\mathcal G_c g_2) \rangle_{\mathcal H} = \langle \mathcal G_c g_1, \mathcal G_c g_2 \rangle_{\mathcal L^2}.
\]
Since the set $C_0(\mathbb T;\mathbb C^2)$ is dense in $\mathcal H_c$, the proposition follows.
\end{proof}

Collecting the results of this subsection we come to the main theorem.
\begin{thm} \label{thm:F}
For $(a,b,c,d) \in P$, the map $\mathcal F:\mathcal L^2 \rightarrow \mathcal H$ is an isometric isomorphism with inverse $\mathcal G$.
\end{thm}
\begin{proof}
Let $(a,b,c,d) \in P_{\mathrm{gen}}$. Combining Propositions \ref{prop:Gp} and \ref{prop:Gc} gives $\mathcal F \mathcal G= id_{\mathcal H}$. Together with Proposition \ref{prop:GF=id} this leads to the theorem.  By continuity in the parameters, the result holds for all $(a,b,c,d) \in P$.
\end{proof}
\begin{cor} \label{cor:orth basis}
The set $\{ \Psi(x,\cdot) \ | \ x \in \mathbb R_q\}$ forms an orthogonal basis for $\mathcal H$ with squared norm $\|\Psi(x,\cdot) \|^2_{\mathcal H} = w(x)^{-1}$.
\end{cor}
\begin{proof}
This follows from Lemma \ref{lem:Psi in H} and Theorem \ref{thm:F}, since the functions $f_y$ defined in Lemma \ref{lem:Psi in H} form an orthogonal basis for $\mathcal L^2$ with squared norm $w(y)^{-1}$.
\end{proof}
\begin{rem}
The Hilbert space $\mathcal H$ and the inverse $\mathcal G$ of the vector-valued big $q$-Jacobi function transform depend essentially on five parameters, namely
$az_-,bz_-,cz_-,dz_-$ and $z_+/z_-$.
\end{rem}
\subsection{An equivalent integral transform}
For $f \in \mathcal D_{\mathrm{fin}}$ and $\gamma \in \Gamma$ we have $(\mathcal Ff)(\gamma) = \langle f, \Phi_\gamma^+ \rangle_{\mathcal L^2}$. Since the function $\Phi_\gamma^+$ can be expressed in terms of big $q$-Jacobi functions by Proposition \ref{prop:Phi+-}, we can define an integral transform with only the big $q$-Jacobi functions $\varphi_\gamma$ and $\varphi_\gamma^\dagger$ as a kernel, which is equivalent to $\mathcal F$. This new integral transform can of course also be extended to an isometric isomorphism. We only state the result here, and we leave the details to the reader.\\

For $f \in \mathcal D_{\mathrm{fin}}$ we define an integral transform $\mathcal J$ that is closely related to the vector-valued big $q$-Jacobi function transform $\mathcal F$ by
\[
(\mathcal J f)(\gamma) = \int_{\mathbb R_q} f(x) \vect{\varphi_\gamma(x)}{\varphi_\gamma^\dagger(x)} w(x) d_q x, \qquad \gamma \in \mathbb T\cup \Gamma.
\]
For $(a,b,c,d) \in P$ we define an inner product on the vector space of $\mathbb C^2$-valued functions by
\[
\langle f,g \rangle_{\mathcal M} = \frac{ 1}{4\pi i } \int_\mathbb T g(\gamma)^T
\mathbf v(\gamma)
f(\gamma) \frac{ d\gamma}{\gamma} + \sum_{\gamma \in \Gamma} g(\gamma)^T \mathbf v_p(\gamma) f(\gamma).
\]
Here $\mathbf v_p(\gamma)$ is the matrix-valued function on $\Gamma$ given by
\[
\gamma \mapsto \mathbf v_p(\gamma)=
\begin{pmatrix}
v_{3,p}(\gamma) & v_{4,p}(\gamma) \\
v_{1,p}(\gamma) & v_{2,p}(\gamma)
\end{pmatrix},
\]
where the matrix coefficients $v_{i,p}(\gamma)=v_{i,p}(\gamma;a,b,c,d;z_-,z_+|q)$, $i=1,\ldots,4$, are defined as follows:\\
For $\gamma \in \Gamma^{\mathrm{inf}} \cup \Gamma^{\mathrm{fin}}_{q/s}$,  $v_{4,p}(\gamma) = v_{1,p}^\dagger(\gamma)$, $v_{3,p}(\gamma) = v_{2,p}(\gamma)$, and
\begin{align*}
v_{1,p}(\gamma)&= d_{z_+}^2(\gamma) N(\gamma), \\
v_{2,p}(\gamma) &= d_{z_+}(\gamma)d_{z_+}^\dagger(\gamma)N(\gamma).
\end{align*}
For $\gamma \in \Gamma^{\mathrm{fin}}_{dq/as} \cup \Gamma^{\mathrm{fin}}_{s}$, $v_{2,p}(\gamma)=v_{4,p}(\gamma)=0$, and

\[
\begin{split}
v_{1,p}(\gamma)& =
\begin{cases}
0, & \text{if } a=\overline{b},\\
\dfrac{ N(\gamma)}{\big(c_{z_+}(\gamma)\big)^2 }, & \text{if } a \neq \overline{b},
\end{cases} \\
v_{2,p}(\gamma) & =
\begin{cases}
\dfrac{ N(\gamma)}{c_{z_+}(\gamma) c_{z_+}^\dagger(\gamma) }, & \text{if } a=\overline{b},\\
0, & \text{if } a \neq \overline{b}.
\end{cases}
\end{split}
\]
Recall here that $\Gamma^{\mathrm{fin}}_{dq/as}$ is only non-empty  if $a\neq\overline{b}$. Now denote by $\mathcal M= \mathcal M(a,b,c,d;z_-,z_+|q)$ the closure of the set
\[
\mathrm{span} \left\{ \gamma \rightarrow \vect{ \varphi_\gamma(x) }{ \varphi_\gamma^\dagger(x) } \ \Big| \ x \in \mathbb R_q \right\}
\]
with respect to the norm $\| \cdot \|_{\mathcal M}$. Note that a function $g \in \mathcal M$ satisfies $rg=g$.

Let $\Theta:\mathcal M \rightarrow \mathcal H$ be the operator defined by
\[
(\Theta g)(\gamma) =
\begin{cases}
g(\gamma), & \gamma \in \mathbb T,\\
\big(d_{z_+}(\gamma) \ d_{z_+}^\dagger(\gamma) \big) g(\gamma),& \gamma \in \Gamma^{\mathrm{inf}} \cup \Gamma^{\mathrm{fin}}_{q/s},\\
\big( c_{z_+}(\gamma)^{-1}\ 0 \big) g(\gamma), & \gamma \in \Gamma^{\mathrm{fin}}_s\cup \Gamma^{\mathrm{fin}}_{dq/as},
\end{cases}
\]
then
\[
\langle \Theta g_1, \Theta g_2 \rangle_{\mathcal H} = \langle g_1, g_2 \rangle_{\mathcal M},
\]
for functions  $g_i \in \mathcal M$, $i=1,2$. In particular, we have
\[
\left(\Theta \vect{\varphi_{\cdot}(x) }{\varphi_{\cdot}^\dagger(x)}\right)(\gamma) = \Psi(x,\gamma), \qquad x \in \mathbb R_q, \quad \gamma \in \mathbb T \cup \Gamma,
\]
so $\Theta:\mathcal M \rightarrow \mathcal H$ is an isomorphism. Also, $\mathcal Ff = (\Theta \circ \mathcal J)f$ for $f \in \mathcal D_{\mathrm{fin}}$.

\begin{thm}
The map $\mathcal J: \mathcal D_{\mathrm{fin}} \rightarrow \mathcal M$ extends uniquely to an isometric isomorphism $\mathcal J_{\mathrm{ext}}:\mathcal L^2 \rightarrow \mathcal M$. Moreover, $\mathcal I = \mathcal G \circ \Theta : \mathcal M \rightarrow \mathcal L^2$ is the inverse of $\mathcal J_{\mathrm{ext}}$.
\end{thm}

\begin{rem}
(i) Let $f \in \mathcal L^2$ be a function for which $\mathcal Ff$ can be written as an integral transform, i.e.,
\[
(\mathcal Ff)(\gamma) =
\int_{\mathbb R_q} f(x) \Psi(x,\gamma) w(x) d_q x, \qquad \gamma \in \mathbb T \cup \Gamma.
\]
Then $\mathcal J_{\mathrm{ext}}f$ can in general \emph{not} be written as the integral
\[
\int_{\mathbb R_q} f(x) \vect{\varphi_\gamma(x) }{ \varphi_\gamma^\dagger(x)} w(x) d_q x,
\]
when $f \not\in \mathcal D_{\mathrm{fin}}$, since the integrals in the components of this vector might be divergent for $\gamma \in \Gamma$.

(ii) The inverse $\mathcal I$ of $\mathcal J_{\mathrm{ext}}$ can be given explicitly by
\[
(\mathcal Ig)(x) = \Bigg \langle g, \vect{\varphi_\cdot(x)}{\varphi_{\cdot}^\dagger(x)} \Bigg \rangle_{\mathcal M}, \qquad x \in \mathbb R_q,
\]
for all $g \in \mathcal M$ for which the above inner product exists.

(iii) Like $\mathcal F$, the map $\mathcal J_{\mathrm{ext}}$ diagonalizes $L$;
\[
(\mathcal J_{\mathrm{ext}} \circ L \circ \mathcal J_{\mathrm{ext}}^{-1})g = M g,
\]
for functions $g \in \mathcal M$ such that $M g \in \mathcal M$.
\end{rem}

redpajama_set_name: RedPajamaArXiv