$T^{*}_{s_{1}^{-1}}\Delta_{\tilde{S},{}^{s_{1}}\xi}(\mathbf{1}_{{\rm
Iw}})=c_{\alpha_{1}-\alpha_{2}}({}^{s_{1}}\xi)-1-p^{-2}+p^{-1}(p-1)\frac{1-p^{-1}\chi^{-1}(a_{2\alpha_{2}-\alpha_{0}})}{1+\chi^{-1}(a_{2\alpha_{2}-\alpha_{0}})}.$

Since

$c_{\alpha_{1}-\alpha_{2}}({}^{s_{1}}\xi)-1-p^{-2}=\frac{1-p^{-2}\chi^{2}(a_{2\alpha_{2}-\alpha_{0}})}{1-\chi^{2}(a_{2\alpha_{2}-\alpha_{0}})}-1-p^{-2}=-\frac{1-p^{-2}\chi^{-2}(a_{2\alpha_{2}-\alpha_{0}})}{1-\chi^{-2}(a_{2\alpha_{2}-\alpha_{0}})},$

we thus have

$\displaystyle
T^{*}_{s_{1}^{-1}}\Delta_{\tilde{S},{}^{s_{1}}\xi}(\mathbf{1}_{{\rm Iw}})$
$\displaystyle=-\frac{1-p^{-2}\chi^{-2}(a_{2\alpha_{2}-\alpha_{0}})}{1-\chi^{-2}(a_{2\alpha_{2}-\alpha_{0}})}+p^{-1}(p-1)\frac{1-p^{-1}\chi^{-1}(a_{2\alpha_{2}-\alpha_{0}})}{1+\chi^{-1}(a_{2\alpha_{2}-\alpha_{0}})}$
$\displaystyle=\frac{1-p^{-1}\chi^{-1}(a_{2\alpha_{2}-\alpha_{0}})}{1+\chi^{-1}(a_{2\alpha_{2}-\alpha_{0}})}\left[\frac{1+p^{-1}\chi^{-1}(a_{2\alpha_{2}-\alpha_{0}})}{\chi^{-1}(a_{2\alpha_{2}-\alpha_{0}})-1}+1-p^{-1}\right]$
$\displaystyle=-\frac{1-p^{-1}\chi^{-1}(a_{2\alpha_{2}-\alpha_{0}})}{1+\chi^{-1}(a_{2\alpha_{2}-\alpha_{0}})}\cdot\frac{p^{-1}+\chi^{-1}(a_{2\alpha_{2}-\alpha_{0}})}{1-\chi^{-1}(a_{2\alpha_{2}-\alpha_{0}})}$
$\displaystyle=-\chi^{-1}(a_{2\alpha_{2}-\alpha_{0}})\frac{1-p^{-2}\chi^{-2}(a_{2\alpha_{2}-\alpha_{0}})}{1-\chi^{-2}(a_{2\alpha_{2}-\alpha_{0}})}\cdot\frac{1+p^{-1}\chi(a_{2\alpha_{2}-\alpha_{0}})}{1+p^{-1}\chi^{-1}(a_{2\alpha_{2}-\alpha_{0}})}.$

Since
$c_{\alpha_{1}-\alpha_{2}}(\xi)=\frac{1-p^{-2}\chi^{-2}(a_{2\alpha_{2}-\alpha_{0}})}{1-\chi^{-2}(a_{2\alpha_{2}-\alpha_{0}})}$,
we get the desired formula. ∎

######  Lemma 5.19.

Suppose that $\xi$ satisfies the hypothesis of Proposition 5.11. We have

$\int_{s_{1}{N}^{\alpha_{1}-\alpha_{2}}({\bf
Z}_{p})}\xi^{-1}\delta^{1/2}_{B_{\mathbf{G}}}(b(x))\chi_{\tilde{S}}^{-1}(\tilde{s}(x))dx=-\frac{1}{p^{2}}\left[1+(p-1)\frac{1-p\chi(a_{2\alpha_{2}-\alpha_{0}})}{1+\chi(a_{2\alpha_{2}-\alpha_{0}})}\right].$

###### Proof.

Given $x=s_{1}x_{\alpha_{1}-\alpha_{2}}(y)\in
s_{1}{N}^{\alpha_{1}-\alpha_{2}}({\bf Z}_{p})$, with $y=a_{y}+b_{y}\delta$
such that $y\overline{y}+b_{y}\neq 0$, Lemma 5.15(2) shows that

$(\xi^{-1}\delta^{1/2}_{B_{\mathbf{G}}})(b(x))\chi_{\tilde{S}}^{-1}(\tilde{s}(x))=\left|y\overline{y}+b_{y}\right|^{-1}(\xi_{1}\xi_{0})(y\overline{y}+b_{y}).$

Since $\xi$ is unramified, we can write

$(\xi_{1}\xi_{0})(y\overline{y}+b_{y})=\left|y\overline{y}+b_{y}\right|^{2z_{1}+z_{0}},$

for some complex numbers $z_{1},z_{0}$. Notice that, by hypothesis, using the
central character condition, $z_{0}$ and $z_{1}$ satisfy
$2\mathrm{Re}(z_{1})+\mathrm{Re}(z_{0})-1>0$. The integral, away from the
elements $y=a_{y}+b_{y}\delta$ such that
$a_{y}^{2}-\delta^{2}b_{y}^{2}+b_{y}\neq 0$, reads as

$\int_{s_{1}N^{\alpha_{1}-\alpha_{2}}({\bf
Z}_{p})}\xi^{-1}\delta^{1/2}_{B_{\mathbf{G}}}(b(x))\chi_{\tilde{S}}^{-1}(\tilde{s}(x))dx=\int_{\mathcal{O}_{p}}\left|a_{y}^{2}-\delta^{2}b_{y}^{2}+b_{y}\right|^{2z_{1}+z_{0}-1}da_{y}db_{y},$

where we have used the isomorphism $\mathcal{O}_{p}\simeq{\bf Z}_{p}^{2}$
which sends $dy$ to $da_{y}db_{y}$. We write the integral as the sum of two by
splitting the domain into $p\mathcal{O}_{p}\cup\mathcal{O}_{p}^{\times}$ and
study each separately. We first start from the integral over
$\mathcal{O}_{p}^{\times}$. When $y\in\mathcal{O}_{p}^{\times}$,
$a_{y}^{2}-\delta^{2}b_{y}^{2}\in{\bf Z}_{p}^{\times}$, hence by changing
variable $b_{y}^{\prime}:=b_{y}(a_{y}^{2}-\delta^{2}b_{y}^{2})^{-1}$, the
integral becomes

$\displaystyle\int_{\mathcal{O}_{p}^{\times}}\left|a_{y}^{2}-\delta^{2}b_{y}^{2}+b_{y}\right|^{2z_{1}+z_{0}-1}da_{y}db_{y}$
$\displaystyle=\int_{\mathcal{O}_{p}^{\times}}\left|1+b_{y}^{\prime}\right|^{2z_{1}+z_{0}-1}da_{y}db_{y}^{\prime}$
$\displaystyle=\int_{\\{y\in\mathcal{O}_{p}^{\times}\,:\,b_{y}^{\prime}\not\equiv-1\,[p]\\}}\\!\\!\\!\\!da_{y}db_{y}^{\prime}+{\rm
vol}({\bf Z}_{p})\int_{p{\bf Z}_{p}}|t|^{2z_{1}+z_{0}-1}dt$
$\displaystyle=\tfrac{p^{2}-p-1}{p^{2}}+\sum_{i\geq
1}p^{-i(2z_{1}+z_{0}-1)}{\rm vol}(p^{i}{\bf Z}_{p}-p^{i+1}{\bf Z}_{p})$
$\displaystyle=\tfrac{p^{2}-p-1}{p^{2}}+(1-p^{-1})\sum_{i\geq
1}p^{-i(2z_{1}+z_{0})}$
$\displaystyle=\tfrac{p^{2}-p-1}{p^{2}}+\tfrac{1-p^{-1}}{p^{2z_{1}+z_{0}}-1},$
(25)

where in the second equality we have made the change of variable
$t=1+b_{y}^{\prime}$, and in the third we used the convergence of the
geometric series as $2\mathrm{Re}(z_{1})+\mathrm{Re}(z_{0})>1$. We now
evaluate the integral over $p\mathcal{O}_{p}\simeq p{\bf Z}_{p}\times p{\bf
Z}_{p}$. We may factor the ideal $p{\bf Z}_{p}=\bigsqcup_{i\geq 1}p^{i}{\bf
Z}_{p}-p^{i+1}{\bf Z}_{p}$ to get

$\int_{p{\bf Z}_{p}\times p{\bf
Z}_{p}}\left|a_{y}^{2}-\delta^{2}b_{y}^{2}+b_{y}\right|^{2z_{1}+z_{0}-1}da_{y}db_{y}=\sum_{i,j\geq
1}\int_{p^{i}{\bf Z}_{p}-p^{i+1}{\bf Z}_{p}}\int_{p^{j}{\bf Z}_{p}-p^{j+1}{\bf
Z}_{p}}\left|a_{y}^{2}-\delta^{2}b_{y}^{2}+b_{y}\right|^{2z_{1}+z_{0}-1}db_{y}da_{y}.$

By direct computation we get

$\left|a_{y}^{2}-\delta^{2}b_{y}^{2}+b_{y}\right||_{p^{i}{\bf
Z}_{p}-p^{i+1}{\bf Z}_{p}\times p^{j}{\bf Z}_{p}-p^{j+1}{\bf
Z}_{p}}=\left\\{\begin{smallmatrix}p^{-j}&if\;j<2i\\\
p^{-2i}&if\;j>2i\end{smallmatrix}\right.$

Writing $\mathrm{vol}_{i,j}=\mathrm{vol}(p^{i}{\bf Z}_{p}-p^{i+1}{\bf
Z}_{p})\cdot\mathrm{vol}(p^{j}{\bf Z}_{p}-p^{j+1}{\bf Z}_{p})$, then the
integral is equal to

$\displaystyle\sum_{i\geq 1}\sum_{j=1}^{j=2i-1}\mathrm{vol}_{i,j}\cdot
p^{-j(2z_{1}+z_{0}-1)}+\sum_{i\geq 1}\sum_{j=2i+1}\mathrm{vol}_{i,j}\cdot
p^{-2i(2z_{1}+z_{0}-1)}$ (26) $\displaystyle+\sum_{i\geq
1}\int_{(p)^{i}-(p)^{i+1}}\int_{(p)^{2i}-(p)^{2i+1}}\left|a_{y}^{2}-\delta^{2}b_{y}^{2}+b_{y}\right|^{2z_{1}+z_{0}-1}db_{y}da_{y}.$
(27)

First of all, we compute (26) explicitly: since $\mathrm{vol}(p^{i}{\bf
Z}_{p}-p^{i+1}{\bf Z}_{p})=p^{-i}(1-p^{-1})$, (26) is equal to

$\displaystyle(1-p^{-1})^{2}\left(\sum_{i\geq
1}\sum_{j=1}^{2i-1}p^{-j(2z_{1}+z_{0})-i}+\sum_{i\geq 1}\sum_{j\geq
2i+1}p^{-2i(2z_{1}+z_{0}-\frac{1}{2})-j}\right).$

We analyze each sum separately. By direct computation,

$\sum_{j=1}^{2i-1}p^{-j(2z_{1}+z_{0})-i}=p^{-i}\sum_{j=1}^{2i-1}p^{-j(2z_{1}+z_{0})}=-p^{-i}\frac{1-p^{2z_{1}+z_{0}-2i(2z_{1}+z_{0})}}{1-p^{2z_{1}+z_{0}}}=\frac{p^{2z_{1}+z_{0}-i(2(2z_{1}+z_{0})+1)}-p^{-i}}{1-p^{2z_{1}+z_{0}}}.$

Therefore

$\displaystyle\sum_{i\geq 1}\sum_{j=1}^{2i-1}p^{-j(2z_{1}+z_{0})-i}$
$\displaystyle=\frac{1}{1-p^{2z_{1}+z_{0}}}\left(p^{2z_{1}+z_{0}}\sum_{i\geq
1}p^{-i(2(2z_{1}+z_{0})+1)}-\sum_{i\geq 1}p^{-i}\right)$
$\displaystyle=\frac{1}{1-p^{2z_{1}+z_{0}}}\left(\frac{p^{2z_{1}+z_{0}}}{p^{2(2z_{1}+z_{0})+1}-1}-\frac{1}{p-1}\right)$
$\displaystyle=\frac{p^{2z_{1}+z_{0}+1}+1}{(p-1)(p^{2(2z_{1}+z_{0})+1}-1)},$

as long as $\mathrm{Re}(2z_{1}+z_{0})>-1/2$. Regarding the second sum, we get

$\sum_{j\geq
2i+1}p^{-2i(2z_{1}+z_{0}-\frac{1}{2})-j}=p^{-2i(2z_{1}+z_{0}-\frac{1}{2})}\sum_{j\geq
2i+1}p^{-j}=p^{-2i(2z_{1}+z_{0}-\frac{1}{2})}\frac{p^{-2i}}{p-1}=\frac{p^{-2i(2z_{1}+z_{0}+\frac{1}{2})}}{p-1}.$

Therefore

$\sum_{i\geq 1}\sum_{j\geq
2i+1}p^{-2i(2z_{1}+z_{0}-\frac{1}{2})-j}=\frac{1}{p-1}\sum_{i\geq
1}p^{-2i(2z_{1}+z_{0}+\frac{1}{2})}=\frac{1}{(p-1)(p^{2(2z_{1}+z_{0})+1}-1)}.$

Hence, the sum of (26) is equal to

$\displaystyle(p-1)\frac{p^{2z_{1}+z_{0}-1}+2p^{-2}}{p^{2(2z_{1}+z_{0})+1}-1}.$
(28)

We now evaluate (27). Writing any element $\alpha\in p^{\bullet}{\bf
Z}_{p}-p^{\bullet+1}{\bf Z}_{p}$ as $\alpha=p^{\bullet}\tilde{\alpha}$, with
$\tilde{\alpha}\in{\bf Z}_{p}^{\times}$, we can write it as

$\sum_{i\geq 1}p^{-2i(2z_{1}+z_{0}-1)}p^{-3i}\int_{{\bf
Z}_{p}^{\times}\times{\bf
Z}_{p}^{\times}}\left|\tilde{a}_{y}^{2}-\delta^{2}p^{2i}\tilde{b}_{y}^{2}+\tilde{b}_{y}\right|^{2z_{1}+z_{0}-1}d\tilde{a}_{y}d\tilde{b}_{y},$
(29)

where the volume factor comes from the Jacobian of the change of variables
$(\tilde{a}_{y},\tilde{b}_{y})=(p^{-i}a_{y},p^{-2i}b_{y})$, which is exactly

$\tfrac{\mathrm{vol}(p^{i}{\bf Z}_{p}-p^{i+1}{\bf
Z}_{p})\cdot\mathrm{vol}(p^{2i}{\bf Z}_{p}-p^{2i+1}{\bf Z}_{p})}{{\rm
vol}({\bf Z}_{p}^{\times})^{2}}=p^{-3i}.$

By doing the variables change
$(\alpha_{y},\beta_{y})=(\tilde{a}_{y}\tilde{b}_{y}^{-1},\tilde{b}_{y}^{-1}-\delta^{2}p^{2i})$,
which has trivial Jacobian, then

(29) $\displaystyle=\sum_{i\geq 1}p^{-i(2(2z_{1}+z_{0})+1)}\int_{{\bf
Z}_{p}^{\times}\times{\bf
Z}_{p}^{\times}}\left|\alpha_{y}^{2}+\beta_{y}\right|^{2z_{1}+z_{0}-1}d\alpha_{y}d\beta_{y}$
$\displaystyle=\sum_{i\geq 1}p^{-i(2(2z_{1}+z_{0})+1)}(1-p^{-1})\int_{{\bf
Z}_{p}^{\times}}\left|1+u\right|^{2z_{1}+z_{0}-1}du$
$\displaystyle=\sum_{i\geq
1}p^{-i(2(2z_{1}+z_{0})+1)}(1-p^{-1})(\tfrac{p-2}{p}+\tfrac{1-p^{-1}}{p^{2z_{1}+z_{0}}-1})$
$\displaystyle=(1-p^{-1})\tfrac{1}{p^{2(2z_{1}+z_{0})+1}-1}(\tfrac{p-2}{p}+\tfrac{1-p^{-1}}{p^{2z_{1}+z_{0}}-1}),$
(30)

where for the second equality we did the change of variables
$u=\beta_{y}/\alpha_{y}^{2}$, for the third we have divided the integral into
the one over $1+u\not\in p{\bf Z}_{p}$ and $1+u\in p{\bf Z}_{p}$, and, for the
convergence of the geometric series, we have used that ${\rm
Re}(2z_{1}+z_{0})>1$.

Summing the contributions of (25), (28), and (30), we get

$\displaystyle=\frac{1}{p^{2}}\left[p^{2}-p-1+\tfrac{p^{2}-p}{p^{2z_{1}+z_{0}}-1}+\tfrac{(p-1)(p^{2z_{1}+z_{0}+1}+2)}{p^{2(2z_{1}+z_{0})+1}-1}+\tfrac{p-1}{p^{2(2z_{1}+z_{0})+1}-1}(p-2+\tfrac{p-1}{p^{2z_{1}+z_{0}}-1})\right]$
$\displaystyle=\frac{1}{p^{2}}\left[-1+(p-1)\frac{p^{2z_{1}+z_{0}+1}+1}{p^{2z_{1}+z_{0}}-1}\right]$
$\displaystyle=-\frac{1}{p^{2}}\left[1+(p-1)\frac{1-p\chi(a_{2\alpha_{2}-\alpha_{0}})}{1+\chi(a_{2\alpha_{2}-\alpha_{0}})}\right],$

where, by (9) and the fact that $\chi_{E_{p}/{\bf Q}_{p}}(p)=-1$, in the last
equality we have used that
$-\chi(a_{2\alpha_{2}-\alpha_{0}})=p^{2z_{1}+z_{0}}.$

∎

We are finally ready to prove Theorem 4.5.

######  Theorem 5.20.

For every $n\geq 0$, we have

$\tilde{\mathcal{S}}_{p}(g_{-n})=\frac{p^{-2n}\prod_{\begin{subarray}{c}\alpha\in\Phi_{\mathbf{P}\mathbf{H}}^{+}\end{subarray}}c_{\alpha}(\xi)}{Qe^{\check{\rho}}(g_{\chi})\prod_{\alpha\in\Phi_{\mathbf{P}\mathbf{H}}^{+,l}}(1+p^{-1}\chi(a_{-\alpha}))}\mathcal{A}\left((-1)^{n}e^{\check{\rho}+n(\check{\alpha}_{1}+\check{\alpha}_{2})}\prod_{\alpha\in\Phi^{+,s}_{{\rm
Sp}_{4}}}(1+p^{-1}e^{-\check{\alpha}})\right)(g_{\chi}).$

###### Proof.

The theorem follows directly from the discussion in [33, §8] and using the
Propositions 5.16 and 5.18. Let us start by recalling the formula obtained in
(16): for every $n\geq 0$, we have

$\tilde{\mathcal{S}}_{p}(g_{-n})=Q^{-1}\sum_{\omega\in
W_{\mathbf{H}}}\prod_{\begin{subarray}{c}\alpha\in\Phi_{\mathbf{P}\mathbf{H}}^{+}\\\
\omega\alpha>0\end{subarray}}c_{\alpha}(\xi)({}^{\omega}\xi^{-1}\delta^{1/2}_{B_{\mathbf{G}}})(g_{n})T^{*}_{\omega^{-1}}\Delta_{\tilde{S},^{\omega}{\xi}}(\mathbf{1}_{\rm
Iw}).$ (31)

Firstly we look at
$T^{*}_{\omega^{-1}}\Delta_{\tilde{S},^{\omega}{\xi}}(\mathbf{1}_{\rm Iw})$.
Applying the expressions of Propositions 5.18 and 5.16 one after the other we
get:

$\displaystyle
T^{*}_{(s_{1}s_{2})^{-1}}\Delta_{\tilde{S},^{s_{1}s_{2}}{\xi}}(\mathbf{1}_{\rm
Iw})$
$\displaystyle=T^{*}_{s_{2}^{-1}}(T^{*}_{s_{1}^{-1}}\Delta_{\tilde{S},^{s_{1}s_{2}}{\xi}}(\mathbf{1}_{\rm
Iw}))$
$\displaystyle=(-1)^{\ell(s_{1})}c_{\alpha_{1}+\alpha_{2}-\alpha_{0}}(\xi)\chi(a_{-2\alpha_{1}+\alpha_{0}})\frac{1+p^{-1}\chi(a_{2\alpha_{1}-\alpha_{0}})}{1+p^{-1}\chi(a_{-2\alpha_{1}+\alpha_{0}})}T^{*}_{s_{2}^{-1}}(\Delta_{\tilde{S},^{s_{2}}{\xi}}(\mathbf{1}_{\rm
Iw}))$
$\displaystyle=(-1)^{\ell(s_{1}s_{2})}c_{\alpha_{1}+\alpha_{2}-\alpha_{0}}(\xi)c_{2\alpha_{2}-\alpha_{0}}(\xi)\chi(a_{-2\alpha_{1}+\alpha_{0}})\chi(a_{\alpha_{2}-\alpha_{1}})\frac{1+p^{-1}\chi(a_{2\alpha_{1}-\alpha_{0}})}{1+p^{-1}\chi(a_{-2\alpha_{1}+\alpha_{0}})}$
$\displaystyle=(-1)^{\ell(s_{1}s_{2})}\prod_{\begin{subarray}{c}\alpha\in\Phi_{\mathbf{P}\mathbf{H}}^{+}\\\
s_{1}s_{2}\alpha<0\end{subarray}}c_{\alpha}(\xi)\prod_{\begin{subarray}{c}\alpha\in\Phi_{\mathbf{P}\mathbf{H}}^{+}\\\
s_{2}s_{1}\alpha<0\end{subarray}}\chi(a_{-\alpha})\prod_{\begin{subarray}{c}\alpha\in\Phi^{+,l}_{\mathbf{P}\mathbf{H}}\\\
s_{2}s_{1}\alpha<0\end{subarray}}\frac{1+p^{-1}\chi(a_{\alpha})}{1+p^{-1}\chi(a_{-\alpha})},$

where recall that $\Phi^{+,l}_{\mathbf{P}\mathbf{H}}$ stands for the set of
positive long roots. The identical expression (with $s_{1}s_{2}$ in place of
$s_{2}s_{1}$ and viceversa) holds for $s_{2}s_{1}$. In general, since
$s_{1},s_{2}$ generate $W_{\mathbf{H}}$, applying recursively Propositions
5.16 and 5.18, we get the following expression for any $\omega\in
W_{\mathbf{H}}$. If we let $\iota:W_{\mathbf{H}}\to W_{\mathbf{H}}$ be the map
which swaps $s_{1}$ and $s_{2}$, then we have

$\displaystyle
T^{*}_{\omega^{-1}}\Delta_{\tilde{S},^{\omega}{\xi}}(\mathbf{1}_{\rm Iw})$
$\displaystyle=(-1)^{\ell(\omega)}\prod_{\begin{subarray}{c}\alpha\in\Phi_{\mathbf{P}\mathbf{H}}^{+}\\\
\omega\alpha<0\end{subarray}}c_{\alpha}(\xi)\prod_{\begin{subarray}{c}\alpha\in\Phi_{\mathbf{P}\mathbf{H}}^{+}\\\
\iota(\omega)\alpha<0\end{subarray}}\chi(a_{-\alpha})\prod_{\begin{subarray}{c}\alpha\in\Phi^{+,l}_{\mathbf{P}\mathbf{H}}\\\
\iota(\omega)\alpha<0\end{subarray}}\frac{1+p^{-1}\chi(a_{\alpha})}{1+p^{-1}\chi(a_{-\alpha})}.$

Plugging this into (31), we get

$\displaystyle
Q^{-1}\delta^{1/2}_{B_{\mathbf{G}}}(g_{n})\prod_{\begin{subarray}{c}\alpha\in\Phi_{\mathbf{P}\mathbf{H}}^{+}\end{subarray}}c_{\alpha}(\xi)\sum_{\omega\in
W_{\mathbf{H}}}(-1)^{\ell(\omega)}({}^{\omega}\xi^{-1})(g_{n})\prod_{\begin{subarray}{c}\alpha\in\Phi_{\mathbf{P}\mathbf{H}}^{+}\\\
\iota(\omega)\alpha<0\end{subarray}}\chi(a_{-\alpha})\prod_{\begin{subarray}{c}\alpha\in\Phi^{+,l}_{\mathbf{P}\mathbf{H}}\\\
\iota(\omega)\alpha<0\end{subarray}}\frac{1+p^{-1}\chi(a_{\alpha})}{1+p^{-1}\chi(a_{-\alpha})}.$

Note that, since $g_{n}=\left(\begin{smallmatrix}p^{n}I&\\\
&I\end{smallmatrix}\right)$, we can write
$({}^{\omega}\xi^{-1})(g_{n})=(-1)^{n}\cdot{}^{\iota(\omega)}\chi(a_{n(2\alpha_{1}-\alpha_{0})})$;
hence, reordering the sum, we have

$\displaystyle
Q^{-1}\delta^{1/2}_{B_{\mathbf{G}}}(g_{n})\prod_{\begin{subarray}{c}\alpha\in\Phi_{\mathbf{P}\mathbf{H}}^{+}\end{subarray}}c_{\alpha}(\xi)\sum_{\omega\in
W_{\mathbf{H}}}(-1)^{\ell(\omega)+n}({}^{\omega}\chi(a_{n(2\alpha_{1}-\alpha_{0})}))\prod_{\begin{subarray}{c}\alpha\in\Phi_{\mathbf{P}\mathbf{H}}^{+}\\\
\omega\alpha<0\end{subarray}}\chi(a_{-\alpha})\prod_{\begin{subarray}{c}\alpha\in\Phi^{+,l}_{\mathbf{P}\mathbf{H}}\\\
\omega\alpha<0\end{subarray}}\frac{1+p^{-1}\chi(a_{\alpha})}{1+p^{-1}\chi(a_{-\alpha})}.$

Proceeding as in [33], using the expression (75) of _loc.cit._ with
$k_{\alpha}=\chi(a_{-\alpha})$, we rewrite

$\prod_{\begin{subarray}{c}\alpha\in\Phi_{\mathbf{P}\mathbf{H}}^{+}\\\
\omega\alpha<0\end{subarray}}\chi(a_{-\alpha})=\chi(a_{-\rho+\omega^{-1}\rho}),$

where $\rho$ is the half-sum of the positive roots. Similarly, letting
$k_{\alpha}=1+p^{-1}\chi(a_{-\alpha})$ in (75) of _loc.cit._ , we have

$\prod_{\begin{subarray}{c}\alpha\in\Phi^{+,l}_{\mathbf{P}\mathbf{H}}\\\
\omega\alpha<0\end{subarray}}\frac{1+p^{-1}\chi(a_{\alpha})}{1+p^{-1}\chi(a_{-\alpha})}=\frac{\omega^{-1}\left(\prod_{\alpha\in\Phi_{\mathbf{P}\mathbf{H}}^{+,l}}(1+p^{-1}\chi(a_{-\alpha}))\right)}{\prod_{\alpha\in\Phi_{\mathbf{P}\mathbf{H}}^{+,l}}(1+p^{-1}\chi(a_{-\alpha}))}.$

Thus, the formula becomes

$\displaystyle
Q^{-1}\delta^{1/2}_{B_{\mathbf{G}}}(g_{n})\prod_{\begin{subarray}{c}\alpha\in\Phi_{\mathbf{P}\mathbf{H}}^{+}\end{subarray}}c_{\alpha}(\xi)\sum_{\omega\in
W_{\mathbf{H}}}(-1)^{\ell(\omega)+n}\chi(a_{-\rho+\omega(\rho+n(2\alpha_{1}-\alpha_{0}))})\frac{\omega\left(\prod_{\alpha\in\Phi_{\mathbf{P}\mathbf{H}}^{+,l}}(1+p^{-1}\chi(a_{-\alpha}))\right)}{\prod_{\alpha\in\Phi_{\mathbf{P}\mathbf{H}}^{+,l}}(1+p^{-1}\chi(a_{-\alpha}))},$

where we have used that
${}^{\omega}\chi(a_{n(2\alpha_{1}-\alpha_{0})})=\chi(\omega^{-1}a_{n(2\alpha_{1}-\alpha_{0})}\omega)=\chi(a_{\omega^{-1}(n(2\alpha_{1}-\alpha_{0}))})$
and we reordered the sum by changing $\omega$ with its inverse.

To further simplify the formula, we can express it all in terms of the Satake
paramaters $g_{\chi}$ of $I_{\mathbf{H}}(\chi)$. Let
$i:X^{\star}(T_{\mathbf{PH}}({\bf C}))\simeq X_{\star}(T_{{\rm Sp}_{4}}({\bf
C}))$ be the isomorphism induced from the duality between $\mathbf{PH}({\bf
C})$ and $\mathrm{Spin}_{5}({\bf C})$ and the exceptional isomorphism
$\mathrm{Spin}_{5}({\bf C})\simeq{\rm Sp}_{4}({\bf C})$. This map identifies
the long roots $\Phi^{+,l}_{\mathbf{P}\mathbf{H}}$ with the short roots
$\Phi^{+,s}_{{\rm Sp}_{4}}$, in the sense that it maps (see [32, Lemma 2.3.1])

$\\{\alpha_{1}-\alpha_{2},\alpha_{1}+\alpha_{2}-\alpha_{0},2\alpha_{1}-\alpha_{0},2\alpha_{2}-\alpha_{0}\\}\to\\{\check{\alpha}_{2},\check{\alpha}_{1},\check{\alpha}_{1}+\check{\alpha}_{2},\check{\alpha}_{1}-\check{\alpha}_{2}\\}.$

Via the isomorphism $i$ and definition of the Satake parameters, we then
obtain the equality

$\chi(a_{\alpha})=e^{i(\alpha)}(g_{\chi}).$

We obtain the desired formula by rewriting the resulting formula in terms of
the roots of ${\rm Sp}_{4}({\bf C})$, namely we have

$\displaystyle\frac{p^{-2n}\prod_{\begin{subarray}{c}\alpha\in\Phi_{\mathbf{P}\mathbf{H}}^{+}\end{subarray}}c_{\alpha}(\xi)}{Qe^{\check{\rho}}(g_{\chi})\prod_{\alpha\in\Phi_{\mathbf{P}\mathbf{H}}^{+,l}}(1+p^{-1}\chi(a_{-\alpha}))}\mathcal{A}\left((-1)^{n}e^{\check{\rho}+n(\check{\alpha}_{1}+\check{\alpha}_{2})}\prod_{\alpha\in\Phi^{+,s}_{{\rm
Sp}_{4}}}(1+p^{-1}e^{-\check{\alpha}})\right)(g_{\chi}),$

where we used the definition of the alternator
$\mathcal{A}(\cdot)=\sum_{\omega}(-1)^{\ell(\omega)}\omega(\cdot)$ and that
$\delta^{1/2}_{B_{\mathbf{G}}}(g_{n})=p^{-2n}$. ∎

######  Remark 5.21.

Notice that, using the relations

$\chi^{2}(a_{-(2\alpha_{1}-\alpha_{0})})=\xi(a_{\alpha_{1}+\alpha_{2}-\alpha_{0}}),\,\,\chi^{2}(a_{-(2\alpha_{2}-\alpha_{0})})=\xi(a_{\alpha_{1}-\alpha_{2}}),$

we have

$\prod_{\begin{subarray}{c}\alpha\in\Phi^{+,s}_{\mathbf{H}}\end{subarray}}c_{\alpha}(\xi)=\prod_{\alpha\in\Phi_{\mathbf{P}\mathbf{H}}^{+,l}}\frac{1-p^{-2}\chi^{2}(a_{-\alpha})}{1-\chi^{2}(a_{-\alpha})},$

therefore
$\prod_{\alpha\in\Phi_{\mathbf{P}\mathbf{H}}^{+,l}}(1+p^{-1}\chi(a_{-\alpha}))$
divides the numerator of
$\prod_{\begin{subarray}{c}\alpha\in\Phi^{+}_{\mathbf{P}\mathbf{H}}\end{subarray}}c_{\alpha}(\xi)$.

We conclude this chapter by re-normalising the Shalika functional as presented
in Theorem 4.5.

######  Corollary 5.22 (Theorem 4.5).

For a suitable normalisation, the spherical Shalika functional satisfies

$\mathcal{S}_{p}\left(\left(\begin{smallmatrix}p^{n}I_{2}&\\\
&I_{2}\end{smallmatrix}\right)\right)=\frac{p^{-2n}}{1+p^{-1}}\mathcal{A}\left((-1)^{n}e^{\check{\rho}+n(\check{\alpha}_{1}+\check{\alpha}_{2})}\prod_{\alpha\in\Phi^{+,s}_{{\rm
Sp}_{4}}}(1+p^{-1}e^{-\check{\alpha}})\right)(g_{\chi})(\mathcal{A}(e^{\check{\rho}})(g_{\chi}))^{-1}.$

###### Proof.

Recall that $I_{\mathbf{H}}(\chi)$ and $I_{\mathbf{G}}(\xi)$ are irreducible;
this implies, by [6, Proposition 3.5] and Remark 5.21, that the following
constant

$C:=\frac{\prod_{\begin{subarray}{c}\alpha\in\Phi_{\mathbf{P}\mathbf{H}}^{+}\end{subarray}}c_{\alpha}(\xi)}{\prod_{\alpha\in\Phi^{+,l}_{\mathbf{H}}}(1-p^{-1}\chi(a_{-\alpha}))},$

is invertible. Moreover, $\mathcal{A}(e^{\check{\rho}})(g_{\chi})$ is
invertible too (cf. [12, Theorem 24.2]). We can therefore normalise the
Shalika functional by multiplying our formula by
$\frac{Qe^{\check{\rho}}(g_{\chi})}{1+p^{-1}}(C\mathcal{A}(e^{\check{\rho}})(g_{\chi}))^{-1}$.
∎

##  6\. The zeta integral

In what follows, we study the zeta integral given in the introduction and
relate it to the degree 5 $L$-function of $\mathrm{PGSp}_{4}$ twisted by the
quadratic Hecke character $\chi_{E/{\bf Q}}$.

###  6.1. The zeta integral and Shalika models

####  6.1.1. Siegel Eisenstein series on ${{\rm GSp}}_{4}$

We define the Siegel Eisenstein series associated to $\mathbf{H}$ and
recollect some of their properties. We follow [11, §5] closely. Recall that we
have introduced the Siegel parabolic $P_{\mathbf{H}}$ of $\mathbf{H}$ with
Levi decomposition $M_{\mathbf{H}}N_{\mathbf{H}}$ and modulus character given
by

$\displaystyle\delta_{P_{\mathbf{H}}}$
$\displaystyle:\left(\begin{smallmatrix}g&\star\\\ &\mu
I_{2}^{\prime}{}^{t}g^{-1}I_{2}^{\prime}\end{smallmatrix}\right)\mapsto\left|\tfrac{{\rm
det}(g)}{\mu}\right|^{3}.$

We let $I_{P_{\mathbf{H}}}(s)$ be the degenerate principal series
representation of $\mathbf{H}({\bf A})$ consisting of smooth functions $f_{s}$
on $\mathbf{H}({\bf A})$ such that

$f_{s}(nmg)=\delta_{P_{\mathbf{H}}}^{\tfrac{1}{3}(s+1)}(m)f_{s}(g),\;\forall
n\in N_{\mathbf{H}}({\bf A}),\forall m\in M_{\mathbf{H}}({\bf A}).$

Given a standard holomorphic section $f_{s}\in I_{P_{\mathbf{H}}}(s)$, we
define the degenerate Eisenstein series

${\rm Eis}_{P_{\mathbf{H}}}(g,s,f_{s})=\sum_{\gamma\in{P_{\mathbf{H}}}({\bf
Q})\backslash\mathbf{H}({\bf Q})}f_{s}(\gamma g),$

which is absolutely convergent in the half-plane ${\rm Re}(s)>2$ and admits
analytic continuation to a meromorphic function on ${\bf C}$ which satisfies a
functional equation

${\rm Eis}_{P_{\mathbf{H}}}(g,s,f_{s})={\rm
Eis}_{P_{\mathbf{H}}}(g,1-s,M_{s}f_{s}),$

where $M_{s}$ is a certain intertwining operator.

At a finite prime $p$, let $f_{p,s}^{0}$ be the function in
$I_{P_{\mathbf{H}}({\bf Q}_{p})}^{\mathbf{H}({\bf Q}_{p})}(s)$ such that
$f_{p,s}^{0}(k)=1$ for all $k\in\mathbf{H}({\bf Z}_{p})$. We assume that
$f_{s}$ is a pure tensor and denote by $f_{p,s}$ its $p$-adic component, which
equals $f_{p,s}^{0}$ almost everywhere. Let $S$ be the finite set of places
containing $\infty$ and all the primes $p$ such that $f_{p,s}\neq
f_{p,s}^{0}$. We then define the normalised Siegel Eisenstein series to be
equal to

$E^{*}_{P_{\mathbf{H}}}(g,s):=\zeta^{S}(s+1)\zeta^{S}(2s){\rm
Eis}_{P_{\mathbf{H}}}(g,s,f_{s}).$

It follows from [26, Theorem 1.1 and Theorem 4.12] that
$E^{*}_{P_{\mathbf{H}}}(g,s)$ has at most simple poles at the points $s=1,2$.

####  6.1.2. The unfolding

Let $\Pi$ be a cuspidal automorphic representation of $\mathbf{G}$ with
trivial central character. Let $S$ be a finite set of places containing
$\infty$ and all the ramified primes for $\Pi$. We take a cusp form
$\varphi\in\Pi$, which we assume to be a pure tensor. Recall that we have the
embedding

$\mathbf{H}\hookrightarrow\mathbf{G};$

hence we consider the following integral:

$I(\varphi,s):=\int_{\mathbf{H}({\bf Q})Z_{\mathbf{H}}({\bf
A})\setminus\mathbf{H}({\bf A})}E^{*}_{P_{\mathbf{H}}}(h,s)\varphi(h)dh,$

where $E^{*}_{P_{\mathbf{H}}}(h,s)$ is the normalised Siegel Eisenstein series
for $\mathbf{H}$ defined above associated to a normalised standard holomorphic
section $f_{s}=\otimes_{v}^{\prime}f_{v,s}\in I_{P_{\mathbf{H}}}(s)$, i.e.
such that

$f_{p,s}=\zeta_{p}(s+1)\zeta_{p}(2s)f_{p,s}^{0},\;\forall p\not\in S.$

Note that this integral converges absolutely as the restriction to
$\mathbf{H}({\bf A})$ of $\varphi$ is rapidly decreasing. Furthermore, due to
the property of the Eisenstein series, it defines a meromorphic function.

We have the following.

######  Proposition 6.1.

The integral $I(\varphi,s)$ unfolds to

$\int_{{\rm GL}_{2}({\bf A})N_{\mathbf{H}}({\bf A})\setminus\mathbf{H}({\bf
A})}f_{s}(h)\mathcal{S}_{\varphi}^{\eta}(h)dh.$

###### Proof.

We start by unfolding the Eisenstein series: for ${\rm Re}(s)$ big enough, we
get

$\int_{P_{\mathbf{H}}({\bf Q})Z_{\mathbf{H}}({\bf A})\setminus\mathbf{H}({\bf
A})}f_{s}(h)\varphi(h)dh.$

Collapse the sum over the unipotent radical $N_{\mathbf{H}}$ of
$P_{\mathbf{H}}$ to get

$\displaystyle\int_{M_{\mathbf{H}}({\bf Q})N_{\mathbf{H}}({\bf
A})Z_{\mathbf{H}}({\bf A})\setminus\mathbf{H}({\bf
A})}\int_{N_{\mathbf{H}}({\bf Q})\backslash N_{\mathbf{H}}({\bf
A})}f_{s}(nh)\varphi(nh)dndh=\int_{\cdots}f_{s}(h)\int_{N_{\mathbf{H}}({\bf
Q})\backslash N_{\mathbf{H}}({\bf A})}\varphi(nh)dndh,$

as $f_{s}\in I_{P_{\mathbf{H}}}(s)$. Now consider the Siegel parabolic for
$\mathbf{G}$ and its unipotent radical $N_{\mathbf{G}}$. Fourier expanding
over $[N_{\mathbf{G}}/N_{\mathbf{H}}]$, the integral equals

$\int_{M_{\mathbf{H}}({\bf Q})N_{\mathbf{H}}({\bf A})Z_{\mathbf{H}}({\bf
A})\setminus\mathbf{H}({\bf A})}f_{s}(h)\sum_{\chi}\varphi_{\chi}(h)dh,$

where the sum runs over the characters
$\chi:[N_{\mathbf{G}}/N_{\mathbf{H}}]\to{\bf C}^{\times}$ and where we have
denoted

$\varphi_{\chi}(h)=\int_{N_{\mathbf{G}}({\bf Q})\backslash N_{\mathbf{G}}({\bf
A})}\varphi(n^{\prime}h)\chi^{-1}(n^{\prime})dn^{\prime}.$

Any character $\chi:[N_{\mathbf{G}}/N_{\mathbf{H}}]\to{\bf C}^{\times}$ can be
described as follows. Recall that any character $\chi:[N_{\mathbf{G}}]\to{\bf
C}^{\times}$ is of the form $n^{\prime}\mapsto\psi({\rm
Tr}(A\cdot\left(\begin{smallmatrix}\alpha&x\\\
y&\bar{\alpha}\end{smallmatrix}\right))),$ where $A\in M_{2\times 2}(E)$ is
such that $\overline{A}^{t}=I^{\prime}_{2}AI^{\prime}_{2}$, $\psi$ is a non-
trivial additive character on ${\bf Q}\backslash{\bf A}$, and where we have
written

$n^{\prime}=\left(\begin{smallmatrix}1&&\alpha&x\\\ &1&y&\bar{\alpha}\\\
&&1&\\\ &&&1\end{smallmatrix}\right),\;\text{ with }x,y\in{\bf
A},\alpha\in{\bf A}_{E}.$

If $A=(a_{i,j})$, the associated character $\chi$ is trivial on
$N_{\mathbf{H}}({\bf A})$ if $a_{1,1}+a_{2,2}=0$ and $a_{1,2}=a_{2,1}=0$. We
deduce that any character $\chi:[N_{\mathbf{G}}/N_{\mathbf{H}}]\to{\bf
C}^{\times}$ is of the form

$n^{\prime}\mapsto\psi({\rm Tr}(\left(\begin{smallmatrix}\eta&\\\
&-\eta\end{smallmatrix}\right)\cdot\left(\begin{smallmatrix}\alpha&x\\\
y&\bar{\alpha}\end{smallmatrix}\right)))=\psi(\eta\alpha-\eta\bar{\alpha}),$

with $\eta\in E^{\times}$ such that $\bar{\eta}=-\eta$. To emphasize its
dependence on $\eta$, we denote this character by $\chi_{\eta}$.

As $M_{\mathbf{H}}$ acts on $N_{\mathbf{G}}$ by conjugation and this action
preserves $N_{\mathbf{H}}$, $M_{\mathbf{H}}({\bf Q})$ acts on the space of
characters of $[N_{\mathbf{G}}/N_{\mathbf{H}}]$. Indeed, if
$m=\left(\begin{smallmatrix}g&\\\ &\mu
I_{2}^{\prime}{}^{t}g^{-1}I_{2}^{\prime}\end{smallmatrix}\right)\in
M_{\mathbf{H}}({\bf Q})$ ,

$\chi_{\eta}(mn^{\prime}m^{-1})=\chi_{\eta^{\prime}}(n^{\prime}),\;\text{ with
}\eta^{\prime}=\mu^{-1}{\rm det}(g)\eta.$

Then, $M_{\mathbf{H}}({\bf Q})$ acts on the space of characters of
$[N_{\mathbf{G}}/N_{\mathbf{H}}]$ with two orbits, the trivial one and an open
one associated to any $\chi_{\eta}$ with $\eta\neq 0$. Using this action, we
can write the integral as

$\displaystyle\int_{M_{\mathbf{H}}({\bf Q})N_{\mathbf{H}}({\bf
A})Z_{\mathbf{H}}({\bf A})\setminus\mathbf{H}({\bf
A})}f_{s}(h)\int_{[N_{\mathbf{G}}]}\varphi(n^{\prime}h)dn^{\prime}dh+\int_{M_{\eta}({\bf
Q})N_{\mathbf{H}}({\bf A})Z_{\mathbf{H}}({\bf A})\setminus\mathbf{H}({\bf
A})}f_{s}(h)\varphi_{\chi_{\eta}}(h)dh,$ (32)

where $M_{\eta}({\bf Q})$ denotes the stabiliser in $M_{\mathbf{G}}({\bf Q})$
of $\chi_{\eta}$. Precisely, $m\in M_{\eta}({\bf Q})$ if $\mu={\rm det}(g)$,
hence we can fix an isomorphism ${\rm GL}_{2}({\bf Q})\simeq M_{\eta}({\bf
Q})$, sending $g\mapsto m(g,{\rm det}(g))$. As the first integral of (32)
vanishes because of cuspidality of $\varphi$ along $[N_{\mathbf{G}}]$,

$I(\varphi,s)=\int_{{\rm GL}_{2}({\bf Q})N_{\mathbf{H}}({\bf
A})Z_{\mathbf{H}}({\bf A})\setminus\mathbf{H}({\bf
A})}f_{s}(h)\varphi_{\chi_{\eta}}(h)dh.$

Collapse the sum over $[{\rm GL}_{2}]$, to get

$\displaystyle I(\varphi,s)$ $\displaystyle=\int_{{\rm GL}_{2}({\bf
Q})N_{\mathbf{H}}({\bf A})Z_{\mathbf{H}}\setminus\mathbf{H}({\bf
A})}f_{s}(h)\varphi_{\chi_{\eta}}(h)dh$ $\displaystyle=\int_{{\rm GL}_{2}({\bf
A})N_{\mathbf{H}}({\bf A})\setminus\mathbf{H}({\bf A})}\int_{{\rm GL}_{2}({\bf
Q})Z_{\mathbf{H}}({\bf A})\backslash{\rm GL}_{2}({\bf A})}f_{s}(m(g,{\rm
det}(g))h)\varphi_{\chi_{\eta}}(m(g,{\rm det}(g))h)dgdh$
$\displaystyle=\int_{{\rm GL}_{2}({\bf A})N_{\mathbf{H}}({\bf
A})\setminus\mathbf{H}({\bf A})}f_{s}(h)\int_{{\rm GL}_{2}({\bf
Q})Z_{\mathbf{H}}({\bf A})\backslash{\rm GL}_{2}({\bf
A})}\varphi_{\chi_{\eta}}(gh)dgdh$ $\displaystyle=\int_{{\rm GL}_{2}({\bf
A})N_{\mathbf{H}}({\bf A})\setminus\mathbf{H}({\bf
A})}f_{s}(h)\mathcal{S}_{\varphi}^{\eta}(h)dh,$

where we have used that $\delta_{P_{\mathbf{H}}}(m(g,{\rm
det}(g)))=\left|\tfrac{{\rm det}(g)}{{\rm det}(g)}\right|^{3}=1$. ∎

As an immediate corollary of Theorems 2.6 and 2.7, we get the following.

######  Corollary 6.2.

The integral $I(\varphi,s)$ is identically zero unless one of the following
equivalent conditions hold

  1. (1)

$\Pi$ is globally generic and $L^{S}(s,\Pi,\wedge^{2}_{t})$ has a simple pole
at $s=1$,

  2. (2)

$\Pi$ appears as a subquotient of $\Theta(\sigma^{+})$, where $\sigma^{+}$ is
an irreducible cuspidal automorphic representation of $\mathbf{H}^{+}({\bf
A})$ appearing in $\sigma_{|_{\mathbf{H}^{+}({\bf A})}}$, with $\sigma$ a
globally generic cuspidal automorphic representation of $\mathbf{H}$ with
trivial central character.

In order to relate $I(\varphi,s)$ with an $L$-function, we study the local
integrals

$I_{p}(\phi,f_{p,s},s)=\int_{{\rm GL}_{2}({\bf Q}_{p})N_{\mathbf{H}}({\bf
Q}_{p})\setminus\mathbf{H}({\bf
Q}_{p})}f_{p,s}(h)\Lambda_{p,\mathcal{S}}(h\cdot\phi)dh,$

where $\phi\in\Pi_{p}$ and $\Lambda_{p,\mathcal{S}}:\Pi_{p}\to{\bf C}$ is any
functional with the property that

$\Lambda_{p,\mathcal{S}}(u\cdot\phi)=\chi_{\eta,p}(u)\Lambda_{p,\mathcal{S}}(\phi),\;\forall
g\in{\rm GL}_{2}({\bf Q}_{p}),\forall u\in N_{\mathbf{G}}({\bf Q}_{p}).$

Suppose that $\Pi=\otimes_{v}^{\prime}\Pi_{v}$ satisfies one (hence both) of
the two equivalent conditions of Corollary 6.2. By the compatibility between
local and global theta lifts, we have that
$\Pi_{v}\simeq\theta(\sigma_{v}^{+})$. By Theorem 3.8, the Shalika model for
$\Pi_{p}$ is unique for every finite prime $p$ not in $S$. This let us write

$\displaystyle\mathcal{S}_{\varphi}^{\eta}(h)=\mathcal{S}_{\varphi_{S}}^{\eta}(h_{S})\prod_{p\not\in
S}\mathcal{S}_{p}(h_{p}),$ (33)

where $\varphi_{S}=\otimes_{v\in S}\varphi_{v}$, $h=h_{S}\cdot\prod_{p\not\in
S}h_{p}$,
$\mathcal{S}_{p}(g_{p}):=\Lambda_{p,\mathcal{S}}(g_{p}\cdot\phi_{0})$ is the
Shalika functional of $\Pi_{p}$ evaluated at the spherical vector $\phi_{0}$
of $\Pi_{p}$, and $\mathcal{S}_{\varphi_{S}}^{\eta}(h_{S})$ is the unitary
Shalika period over ${\bf A}_{S}={\bf R}\times\prod_{p\in S}{\bf Q}_{p}$. When
$p\not\in S$, $\mathcal{S}_{p}$ will be normalised following Theorem 4.4 and
Corollary 5.22. The decomposition (33) let us write

$I(\varphi,s)=I_{S}(\varphi_{S},f_{s},s)\prod_{p\not\in
S}I_{p}(\phi_{0},f_{p,s},s),$

where, if we let $f_{S,s}=\otimes_{v\in S}f_{v,s}$,

$I_{S}(\varphi_{S},f_{s},s)=\int_{{\rm GL}_{2}({\bf A}_{S})N_{\mathbf{H}}({\bf
A}_{S})\setminus\mathbf{H}({\bf
A}_{S})}f_{S,s}(h_{S})\mathcal{S}_{\varphi_{S}}^{\eta}(h_{S})dh_{S}.$

Combining Theorem 6.6, Theorem 6.8, Proposition 6.9, and Theorem 6.16, we have
the following.

######  Theorem 6.3.

Let $\Pi$ be an irreducible globally generic cuspidal automorphic
representation of ${\rm GU}_{2,2}({\bf A})$ with trivial central character.
Suppose that $\Pi$ appears as a subquotient of $\Theta(\sigma^{+})$, with
$\sigma^{+}$ and $\sigma$ as in Corollary 6.2. We have

$I(\varphi,s)=I_{S}(\varphi_{S},f_{s},s)L^{S}(s,\sigma,{\rm
std}\otimes\chi_{E/{\bf Q}}),$

where $S$ is a finite set of places containing $\infty$, the ramified primes
for $\Pi$, $\sigma$, and $E/{\bf Q}$. Moreover, the partial $L$-function
$L^{S}(s,\sigma,{\rm std}\otimes\chi_{E/{\bf Q}})$ extends to a holomorphic
function for all $s$.

###  6.2. Calculation at unramified primes

Suppose that $\Pi_{p}$ is unramified and let $\phi_{0}$ be a spherical vector
in $\Pi_{p}$, then, using the Iwasawa decomposition $\mathbf{H}({\bf
Q}_{p})=P_{\mathbf{H}}({\bf Q}_{p})\mathbf{H}({\bf Z}_{p})$ and the fact that
$f_{p,s}$ and $\phi_{0}$ are $\mathbf{H}({\bf Z}_{p})$-invariants, we get

$I_{p}(\phi_{0},f_{p,s},s)=\int_{{\rm GL}_{2}({\bf Q}_{p})N_{\mathbf{H}}({\bf
Q}_{p})\setminus P_{\mathbf{H}}({\bf
Q}_{p})}\delta_{P_{\mathbf{H}}}^{-1}(g)f_{p,s}(g)\mathcal{S}_{p}(g)dg.$

As $P_{\mathbf{H}}({\bf Q}_{p})=M_{\mathbf{H}}({\bf Q}_{p})N_{\mathbf{H}}({\bf
Q}_{p})$ and the multiplier identifies ${\rm GL}_{2}({\bf Q}_{p})\backslash
M_{\mathbf{H}}({\bf Q}_{p})\simeq{\bf Q}_{p}^{\times}$, we have

$\displaystyle I_{p}(\phi_{0},f_{p,s},s)$ $\displaystyle=\int_{{\bf
Q}_{p}^{\times}}\delta_{P_{\mathbf{H}}}^{-1}(\left(\begin{smallmatrix}I&\\\
&\mu I\end{smallmatrix}\right))f_{p,s}(\left(\begin{smallmatrix}I&\\\ &\mu
I\end{smallmatrix}\right))\mathcal{S}_{p}(\left(\begin{smallmatrix}I&\\\ &\mu
I\end{smallmatrix}\right))d^{\times}\mu$ $\displaystyle=f_{p,s}(1)\int_{{\bf
Q}_{p}^{\times}}|\mu|^{2-s}\mathcal{S}_{p}(\left(\begin{smallmatrix}I&\\\ &\mu
I\end{smallmatrix}\right))d^{\times}\mu.$

######  Lemma 6.4.

If $\mathcal{S}_{p}(\left(\begin{smallmatrix}I&\\\ &\mu
I\end{smallmatrix}\right))\neq 0$, then $|\mu|\geq 1$.

###### Proof.

As $\phi_{0}$ is spherical, we have for $u\in N^{\prime}({\bf Z}_{p})$

$\displaystyle\mathcal{S}_{p}(\left(\begin{smallmatrix}I&\\\ &\mu
I\end{smallmatrix}\right))$
$\displaystyle=\Lambda_{p,\mathcal{S}}(\left(\left(\begin{smallmatrix}I&\\\
&\mu I\end{smallmatrix}\right)u\right)\cdot\phi_{0})$
$\displaystyle=\Lambda_{p,\mathcal{S}}(\left(\left(\begin{smallmatrix}I&\\\
&\mu I\end{smallmatrix}\right)u\left(\begin{smallmatrix}I&\\\
&\mu^{-1}I\end{smallmatrix}\right)\left(\begin{smallmatrix}I&\\\ &\mu
I\end{smallmatrix}\right)\right)\cdot\phi_{0})$
$\displaystyle=\chi_{\eta,p}\left(\left(\begin{smallmatrix}I&\\\ &\mu
I\end{smallmatrix}\right)u\left(\begin{smallmatrix}I&\\\
&\mu^{-1}I\end{smallmatrix}\right)\right)\mathcal{S}_{p}(\left(\begin{smallmatrix}I&\\\
&\mu I\end{smallmatrix}\right)).$

Hence, since by hypothesis $\mathcal{S}_{p}(\left(\begin{smallmatrix}I&\\\
&\mu I\end{smallmatrix}\right))\neq 0$, then

$\chi_{\eta,p}\left(\left(\begin{smallmatrix}I&\\\ &\mu
I\end{smallmatrix}\right)u\left(\begin{smallmatrix}I&\\\
&\mu^{-1}I\end{smallmatrix}\right)\right)=1.$

This implies that $|\mu|\geq 1$. ∎

By Lemma 6.4, we can further write the integral as

$\displaystyle I_{p}(\phi_{0},f_{p,s},s)$ $\displaystyle=f_{p,s}(1)\sum_{n\geq
0}p^{n(2-s)}\mathcal{S}_{p}\left(\left(\begin{smallmatrix}I&\\\
&p^{-n}I\end{smallmatrix}\right)\right)$ $\displaystyle=f_{p,s}(1)\sum_{n\geq
0}p^{n(2-s)}\mathcal{S}_{p}(\left(\begin{smallmatrix}p^{n}I&\\\
&I\end{smallmatrix}\right)),$

where in the latter we have used that the central character of $\Pi_{p}$ is
assumed to be trivial. In what follows, we explicitly calculate
$I_{p}(\phi_{0},s)$ by dividing the two cases of $p$ split or inert in $E$.

####  6.2.1. The unramified calculation at split primes

Suppose $p$ is split in $E$. Then, the local component $\Pi_{p}$ can be
identified with an unramified representation $\pi_{p}=I_{{\rm GL}_{4}}(\chi)$
of ${\rm GL}_{4}({\bf Q}_{p})$ with trivial central character. As we recalled
in §4.1, $\pi_{p}$ has a Shalika model if its Frobenius conjugacy class is in
${\rm Sp}_{4}({\bf C})$, precisely of the form
$g_{\chi}=(\chi_{1}(p),\chi_{2}(p),\chi_{2}^{-1}(p),\chi_{1}^{-1}(p))$. As the
theta correspondence is functorial at primes which are split in $E$, then
$\pi_{p}$ is the theta lift of a representation $\sigma_{p}$ of
${\mathbf{P}}\mathbf{H}({\bf Q}_{p})$ with same semi-simple conjugacy class
$g_{\chi}$.

Recall that we have denoted by ${\rm std}:{\rm Sp}_{4}({\bf C})\to{\rm
GL}_{5}({\bf C})$ the irreducible representation $\rho_{1,1}$ of highest
weight $(1,1)$, which is given by the composition of the projection of ${\rm
Spin}_{5}({\bf C})$ to ${\rm SO}_{5}({\bf C})$ with the standard
representation of the latter. Following [3, § 4], the “standard” Euler factor
satisfies the following equality

$L(s,\sigma_{p},{\rm
std})=\sum_{k=0}^{\infty}\mathrm{tr}\left(g_{\chi}|\mathrm{Sym}^{k}\rho_{1,1}\right)p^{-ks},$

where $\mathrm{tr}\left(g_{\chi}|\mathrm{Sym}^{k}\rho_{1,1}\right)$ is the
character associated to the representation $\mathrm{Sym}^{k}\rho_{1,1}$ of
${\rm Sp}_{4}({\bf C})$ evaluated at $g_{\chi}$. In order to explicit the
formula, we have to decompose into irreducible factors the representation
$\mathrm{Sym}^{k}\rho_{1,1}$ for every $k\geq 0$.

######  Lemma 6.5.

We have that

$\mathrm{Sym}^{k}(\rho_{1,1})=\bigoplus_{i=0}^{\lfloor
k/2\rfloor}\rho_{k-2i,k-2i},$

where $\rho_{k-2i,k-2i}$ is the irreducible representation of highest weight
$(k-2i)(\alpha_{1}+\alpha_{2})$.

###### Proof.

The symplectic form defining ${\rm Sp}_{4}$ defines a surjection

${\rm Sym}^{2}\rho_{1,1}\to{\bf C},$

which induces a surjection, for all $k\geq 2$,

$\mathrm{Sym}^{k}(\rho_{1,1})\to\mathrm{Sym}^{k-2}(\rho_{1,1}),$

with kernel the representation $\rho_{k,k}$ of highest weight
$k\alpha_{1}+k\alpha_{2}$ (cf. [12, Exercise 16.11]). Therefore

$\mathrm{Sym}^{k}(\rho_{1,1})=\rho_{k,k}\oplus\mathrm{Sym}^{k-2}(\rho_{1,1}).$

Using this formula recursively, we obtain that

$\mathrm{Sym}^{k}(\rho_{1,1})=\bigoplus_{i=0}^{\lfloor
k/2\rfloor}\rho_{k-2i,k-2i}.$

∎

Lemma 6.5 implies that

$L(s,\sigma_{p},{\rm std})=\sum_{k=0}^{\infty}\sum_{i=0}^{\lfloor
k/2\rfloor}\mathrm{tr}\left(g_{\chi}|\rho_{k-2i,k-2i}\right)p^{-ks}.$

Using Weyl’s character formula (cf. [12, Theorem 24.2]), the latter equals to

$\sum_{k=0}^{\infty}\sum_{i=0}^{\lfloor
k/2\rfloor}\frac{\mathcal{A}\left(e^{\check{\rho}+(k-2i,k-2i)}\right)}{\mathcal{A}\left(e^{\check{\rho}}\right)}(g_{\chi})p^{-ks},$
(34)

where we denoted $(k-2i,k-2i)=(k-2i)(\check{\alpha}_{1}+\check{\alpha}_{2})$.

This is crucially used to prove the following.

######  Theorem 6.6.

We have

$I_{p}(\phi_{0},f_{p,s},s)=L(s,\sigma_{p},{\rm std}).$

###### Proof.

Substituting the formula of Theorem 4.4 in the integral, we have

$\displaystyle I_{p}(\phi_{0},f_{p,s},s)$ $\displaystyle=f_{p,s}(1)\sum_{n\geq
0}p^{n(2-s)}\mathcal{S}_{p}(\left(\begin{smallmatrix}p^{n}I&\\\
&I\end{smallmatrix}\right))$
$\displaystyle=f_{p,s}(1)(1+p^{-1})^{-1}\sum_{n\geq
0}p^{-ns}\mathcal{A}\Big{(}e^{\check{\rho}+n(\check{\alpha}_{1}+\check{\alpha}_{2})}\cdot\prod_{\alpha\in\Phi_{{\rm
Sp}_{4}}^{+,s}}(1-p^{-1}e^{-\check{\alpha}})\Big{)}(g_{\chi})({\mathcal{A}\left(e^{\check{\rho}}\right)}(g_{\chi}))^{-1}.$

We now examine the alternator sum appearing above. First, recall that
$\Phi_{{\rm Sp}_{4}}^{+,s}$ consists of the roots $\alpha_{1}-\alpha_{2}$ and
$\alpha_{1}+\alpha_{2}$. Then, the term
$\mathcal{A}(e^{\check{\rho}+n(\check{\alpha}_{1}+\check{\alpha}_{2})}\cdot\prod_{\alpha\in\Phi_{{\rm
Sp}_{4}}^{+,s}}(1-p^{-1}e^{-\check{\alpha}}))$ equals

$\displaystyle\mathcal{A}(e^{\check{\rho}+n\check{\alpha}_{1}+n\check{\alpha}_{2}}-p^{-1}e^{\check{\rho}+(n-1)\check{\alpha}_{1}+(n-1)\check{\alpha}_{2}}-p^{-1}e^{\check{\rho}+(n-1)\check{\alpha}_{1}+(n+1)\check{\alpha}_{2}}+p^{-2}e^{\check{\rho}+(n-2)\check{\alpha}_{1}+n\check{\alpha}_{2}}).$
(35)

Now, let $s_{1}$ be the Weyl element associated to $\alpha_{1}-\alpha_{2}$; it
acts on the alternator as multiplication by $-1$, i.e.

$\mathcal{A}(e^{s_{1}\cdot\check{\mu}})=-\mathcal{A}(e^{\check{\mu}}).$ (36)

This let us rearrange (35) as

$\displaystyle(1+p^{-1})\mathcal{A}(e^{\check{\rho}+n\check{\alpha}_{1}+n\check{\alpha}_{2}}-p^{-1}e^{\check{\rho}+(n-1)\check{\alpha}_{1}+(n-1)\check{\alpha}_{2}}).$
(37)

Substituting (37) in the integral yields

$I_{p}(\phi_{0},f_{p,s},s)=f_{p,s}(1)\sum_{n\geq
0}p^{-ns}\frac{\mathcal{A}(e^{\check{\rho}+n\check{\alpha}_{1}+n\check{\alpha}_{2}}-p^{-1}e^{\check{\rho}+(n-1)\check{\alpha}_{1}+(n-1)\check{\alpha}_{2}})}{\mathcal{A}\left(e^{\check{\rho}}\right)}(g_{\chi}).$

For every $n\geq-1$, denote the term
$a_{n}:=\frac{\mathcal{A}(e^{\check{\rho}+n\check{\alpha}_{1}+n\check{\alpha}_{2}})}{\mathcal{A}\left(e^{\check{\rho}}\right)}(g_{\chi})$;
notice that for $n=-1$ we have that
$a_{-1}=\frac{\mathcal{A}(e^{\check{\rho}-(\check{\alpha}_{1}+\check{\alpha}_{2})})}{\mathcal{A}\left(e^{\check{\rho}}\right)}(g_{\chi})$.
Let $s_{2}$ be the Weyl element associated to the root $2\alpha_{2}$, then
$s:=s_{2}s_{1}s_{2}$ acts on the alternator
$\mathcal{A}(e^{\check{\rho}-(\check{\alpha}_{1}+\check{\alpha}_{2})})$ as in
(36). Since $\check{\rho}-(\check{\alpha}_{1}+\check{\alpha}_{2})$ is
invariant under $s$ we conclude that $a_{-1}=0$.

Recall that

$f_{p,s}(1)=\zeta_{p}(s+1)\zeta_{p}(2s).$

Using the Cauchy product formula, we have

$\displaystyle I_{p}(\phi_{0},f_{p,s},s)$
$\displaystyle=\zeta_{p}(s+1)\sum_{n\geq 0}p^{-2ns}\cdot\sum_{n\geq
0}p^{-ns}(a_{n}-p^{-1}a_{n-1})$ $\displaystyle=\zeta_{p}(s+1)\sum_{n\geq
0}\Big{(}\sum_{k=0}^{\lfloor
n/2\rfloor}(a_{n-2k}-p^{-1}a_{n-1-2k})\Big{)}p^{-ns}$
$\displaystyle=\zeta_{p}(s+1)\sum_{n\geq 0}\Big{(}\sum_{k=0}^{\lfloor
n/2\rfloor}a_{n-2k}-p^{-1}\sum_{k=0}^{\lfloor(n-1)/2\rfloor}a_{n-1-2k}\Big{)}p^{-ns},$

where for the latter equality we have used that $a_{-1}=0$. This expression is
terribly close to the one of (34). Indeed, a simple manipulation of the series
above gives that

$\displaystyle I_{p}(\phi_{0},f_{p,s},s)$
$\displaystyle=\zeta_{p}(s+1)\left(\sum_{n\geq 0}p^{-ns}\sum_{k=0}^{\lfloor
n/2\rfloor}a_{n-2k}-p^{-1}\sum_{n\geq
0}p^{-ns}\sum_{k=0}^{\lfloor(n-1)/2\rfloor}a_{n-1-2k}\right)$
$\displaystyle=\zeta_{p}(s+1)\left(\sum_{n\geq 0}p^{-ns}\sum_{k=0}^{\lfloor
n/2\rfloor}a_{n-2k}-p^{-1-s}\sum_{n\geq
0}p^{-(n-1)s}\sum_{k=0}^{\lfloor(n-1)/2\rfloor}a_{n-1-2k}\right)$
$\displaystyle=\zeta_{p}(s+1)(1-p^{-1-s})\sum_{n\geq
0}p^{-ns}(\sum_{k=0}^{\lfloor n/2\rfloor}a_{n-2k})$ $\displaystyle=\sum_{n\geq
0}\sum_{k=0}^{\lfloor
n/2\rfloor}\frac{\mathcal{A}\left(e^{\check{\rho}+(n-2k,n-2k)}\right)}{\mathcal{A}\left(e^{\check{\rho}}\right)}(g_{\chi})p^{-ns}$
$\displaystyle=L(s,\sigma_{p},{\rm std}),$

where the last equality follows from (34). ∎

####  6.2.2. The unramified calculation at inert primes

Let $p$ be inert in $E$. Let $\Pi_{p}$ be the irreducible generic unramified
constituent of $I_{\mathbf{G}}(\xi)$ of $\mathbf{G}({\bf Q}_{p})$ with trivial
central character. Suppose that $\Pi_{p}$ is the local theta lift of the
generic component of $I_{\mathbf{H}^{+}}(\chi)$, with

$\displaystyle\xi=(\chi_{0}\circ N_{E_{p}/{\bf Q}_{p}},\chi_{2}\chi_{0}\circ
N_{E_{p}/{\bf Q}_{p}},\chi_{1}\chi_{E_{p}/{\bf Q}_{p}}),$
$\displaystyle|\cdot|^{\pm
1}\not\in\\{\chi_{1},\chi_{2},\chi_{1}\chi_{2},\chi_{1}\chi_{2}^{-1}\\},\,\chi_{1}\chi_{2}\chi_{0}^{2}=1.$

If we call $\sigma_{p}$ the unramified principal series $I_{\mathbf{H}}(\chi)$
with trivial central character, and $\sigma_{p}^{+}$ the generic component of
its restriction to $\mathbf{H}^{+}({\bf Q}_{p})$, then
$\Pi_{p}=\theta(\sigma_{p}^{+})$. As the theta correspondence is not
functorial at inert primes, the Frobenius conjugacy classes of $\sigma_{p}$
and $\Pi_{p}$ do not coincide via an embedding of $L$-groups. Rather than a
limitation, this is a feature of the construction. Let $g_{\chi}$ be the
Frobenius conjugacy class of $\sigma_{p}$.

######  Lemma 6.7.

We have

$L(s,\sigma_{p},{\rm std}\otimes\chi_{E_{p}/{\bf
Q}_{p}})=\sum_{n=0}^{\infty}(-1)^{n}\cdot\sum_{i=0}^{\lfloor
n/2\rfloor}\frac{\mathcal{A}\left(e^{\check{\rho}+(n-2i)(\check{\alpha}_{1}+\check{\alpha}_{2})}\right)}{\mathcal{A}\left(e^{\check{\rho}}\right)}(g_{\chi})p^{-ns}.$

###### Proof.

The proof of this is similar to the one of (34). In particular, it follows
from the formula

$L(s,\sigma_{p},{\rm std}\otimes\chi_{E_{p}/{\bf
Q}_{p}})=\sum_{n=0}^{\infty}(-1)^{n}\cdot\mathrm{tr}\left(g_{\chi}|\mathrm{Sym}^{n}\rho_{1,1}\right)p^{-ns},$

as $\chi_{E_{p}/{\bf Q}_{p}}^{n}(p)=(-1)^{n}$, and the decomposition of Lemma
6.5. ∎

This Lemma implies the following.

######  Theorem 6.8.

We have

$I_{p}(\phi_{0},f_{p,s},s)=L(s,\sigma_{p},{\rm std}\otimes\chi_{E_{p}/{\bf
Q}_{p}}).$

###### Proof.

Using the formula for $\mathcal{S}_{p}(\left(\begin{smallmatrix}p^{n}I&\\\
&I\end{smallmatrix}\right))$ of Theorem 4.5, we get

$\displaystyle I_{p}(\phi_{0},f_{p,s},s)$ $\displaystyle=f_{p,s}(1)\sum_{n\geq
0}p^{n(2-s)}\mathcal{S}_{p}(\left(\begin{smallmatrix}p^{n}I&\\\
&I\end{smallmatrix}\right))$
$\displaystyle=f_{p,s}(1)(1+p^{-1})^{-1}\sum_{n\geq
0}p^{-ns}\mathcal{A}\Big{(}(-1)^{n}e^{\check{\rho}+n(\check{\alpha}_{1}+\check{\alpha}_{2})}\cdot\prod_{\alpha\in\Phi_{{\rm
Sp}_{4}}^{+,s}}(1+p^{-1}e^{-\check{\alpha}})\Big{)}(g_{\chi})({\mathcal{A}\left(e^{\check{\rho}}\right)}(g_{\chi}))^{-1}.$

The term
$\mathcal{A}((-1)^{n}e^{\check{\rho}+n(\check{\alpha}_{1}+\check{\alpha}_{2})}\cdot\prod_{\alpha\in\Phi_{{\rm
Sp}_{4}}^{+,s}}(1+p^{-1}e^{-\check{\alpha}}))$ equals

$\displaystyle(-1)^{n}\mathcal{A}(e^{\check{\rho}+n\check{\alpha}_{1}+n\check{\alpha}_{2}}+p^{-1}e^{\check{\rho}+(n-1)\check{\alpha}_{1}+(n-1)\check{\alpha}_{2}}+p^{-1}e^{\check{\rho}+(n-1)\check{\alpha}_{1}+(n+1)\check{\alpha}_{2}}+p^{-2}e^{\check{\rho}+(n-2)\check{\alpha}_{1}+n\check{\alpha}_{2}}).$

Proceeding as in Theorem 6.6, we write it as

$\displaystyle(1+p^{-1})(-1)^{n}\mathcal{A}(e^{\check{\rho}+n\check{\alpha}_{1}+n\check{\alpha}_{2}}+p^{-1}e^{\check{\rho}+(n-1)\check{\alpha}_{1}+(n-1)\check{\alpha}_{2}}).$

For every $n\geq-1$, denote the term
$a_{n}^{\prime}:=\frac{\mathcal{A}((-1)^{n}e^{\check{\rho}+n\check{\alpha}_{1}+n\check{\alpha}_{2}})}{\mathcal{A}\left(e^{\check{\rho}}\right)}(g_{\chi})$;
then the integral becomes

$\displaystyle I_{p}(\phi_{0},f_{p,s},s)$ $\displaystyle=f_{p,s}(1)\sum_{n\geq
0}p^{-ns}(a_{n}^{\prime}-p^{-1}a_{n-1}^{\prime}).$

Proceeding exactly as in Theorem 6.6, we have that

$\displaystyle I_{p}(\phi_{0},f_{p,s},s)$ $\displaystyle=\sum_{n\geq
0}p^{-ns}\left(\sum_{k=0}^{\lfloor n/2\rfloor}a_{n-2k}^{\prime}\right)$
$\displaystyle=\sum_{n\geq 0}(-1)^{n}\cdot\sum_{k=0}^{\lfloor
n/2\rfloor}\frac{\mathcal{A}\left(e^{\check{\rho}+(n-2k)(\check{\alpha}_{1}+\check{\alpha}_{2})}\right)}{\mathcal{A}\left(e^{\check{\rho}}\right)}(g_{\chi})p^{-ns}$
$\displaystyle=L(s,\sigma_{p},{\rm std}\otimes\chi_{E_{p}/{\bf Q}_{p}}),$

where the latter equality follows from Lemma 6.7. ∎

###  6.3. The integral at ramified places

In what follows, we look at the integral

$I_{S}(\varphi_{S},f_{S,s},s)=\int_{{\rm GL}_{2}({\bf
A}_{S})N_{\mathbf{H}}({\bf A}_{S})\setminus\mathbf{H}({\bf
A}_{S})}f_{S,s}(h_{S})\mathcal{S}_{\varphi_{S}}^{\eta}(h_{S})dh_{S},$

where ${\bf A}_{S}=\prod_{v\in S}{\bf Q}_{v}={\bf R}\times\prod_{p\in S}{\bf
Q}_{p}$ and $f_{S,s}=\otimes_{v\in S}f_{v,s}$. Adapting the methods of [14]
and of [15] to our setting, we prove the following.

######  Proposition 6.9.

Let $s_{0}\in{\bf C}$. Then, there exist data $\varphi_{S}$ and $f_{S,s}$ such
that $I_{S}(\varphi_{S},f_{S,s},s)$ extends to a meromorphic function to all
$s\in{\bf C}$, which is non-vanishing at $s_{0}$.

Before we prove the statement we need to introduce some notation and an
auxiliary Lemma.

Let us denote by

$G(\varphi_{S},k_{S},s):=\int_{{\rm GL}_{2}({\bf A}_{S})\setminus
M_{\mathbf{H}}({\bf
A}_{S})}\delta^{\frac{1}{3}(s+1)}(m_{S})\mathcal{S}_{\varphi_{S}}^{\eta}(m_{S}k_{S})dm_{S}.$

The subgroup ${\rm GL}_{2}({\bf A}_{S})\subset\mathbf{H}({\bf A}_{S})$
contains the centre of $\mathbf{H}({\bf A}_{S})$. Hence ${\rm GL}_{2}({\bf
A}_{S})N_{\mathbf{H}}({\bf A}_{S})\setminus\mathbf{H}({\bf
A}_{S})\simeq\mathrm{PGL}_{2}({\bf A}_{S})N_{\mathbf{PH}}({\bf
A}_{S})\setminus\mathbf{PH}({\bf A}_{S})$. Let $K({\bf A}_{S})=\prod_{v\in
S}K_{v}$, with $K_{v}$ the maximal compact subgroup of $\mathbf{PH}({\bf
Q}_{v})$. Using the Iwasawa factorization, we get

$I_{S}(\varphi_{S},f_{S,s},s)=\int_{\tilde{K}({\bf
A}_{S})}f_{S,s}(k_{S})G(\varphi_{S},k_{S},s)dk_{S},$ (38)

where $\tilde{K}({\bf A}_{S}):=\left({\rm GL}_{2}({\bf A}_{S})\cap K({\bf
A}_{S})\right)\left(N_{\mathbf{H}}({\bf A}_{S})\cap K({\bf
A}_{S})\right)\setminus K({\bf A}_{S})$. Since the global zeta integral
$I(\varphi,s)$ and $L^{S}(s,\sigma,\mathrm{std}\otimes\chi_{E/{\bf Q}})$ have
meromorphic continuation, $I_{S}(\varphi_{S},f_{S,s},s)$ has meromorphic
continuation too. For any subgroup $R({\bf A}_{S})$ of $G({\bf A}_{S})$ and
$\phi\in\mathcal{C}^{\infty}_{c}\left(N_{\mathbf{G}}({\bf A}_{S})\right)$ we
denote the action of the Hecke algebra on $\varphi_{S}$ by

$\phi*\varphi_{S}(g):=\int_{R({\bf A}_{S})}\phi(r)\varphi_{S}(gr)dr.$

######  Lemma 6.10.

  1. (1)

When $\mathrm{Re}(s)$ is sufficiently large, the integral
$G(\varphi_{S},k_{S},s)$ is absolutely convergent. Furthermore, the function
$k_{S}\mapsto G(\varphi_{S},k_{S},s)$ and the functional $\varphi_{S}\mapsto
G(\varphi_{S},1,s)$ are continuous.

  2. (2)

The function $G(\varphi_{S},1,s)$ admits meromorphic continuation to the whole
complex plane.

  3. (3)

There exists $\varphi_{S}$ so that $G(\varphi_{S},1,s)\neq 0$.

###### Proof.

The proof follows the ones of [14, Lemma 15.7] and of [15, Lemma 9.1].

_(1)_. By reproducing the proof of [14, Lemma 15.7], one can show the function
$k_{S}\mapsto G(\varphi_{S},k_{S},s)$ is absolutely convergent and the
functional $\varphi_{S}\mapsto G(\varphi_{S},k_{S},s)$ is continuous.
Therefore, since the function
$k_{S}\mapsto\mathcal{S}_{\varphi_{S}}^{\eta}(k_{S})$ is continuous and the
integral $G(\varphi_{S},k_{S},s)$ is absolutely convergent, the second part of
_(1)_ follows.

_(2)_. Since $\Pi$ has trivial central character, the restriction to
$\mathbf{H}$ of the smooth function $\varphi_{S}$ can be realised as a smooth
function over $\mathbf{PH}({\bf A}_{S})$. The group $\mathbf{PH}({\bf R})$ is
a semisimple (adjoint) Lie group. Hence, by the Iwasawa decomposition, there
is a diffeomorphism $B_{\mathbf{PH}}({\bf R})\times
K_{\infty}\to\mathbf{PH}({\bf R})$. This allows us to realise
$\varphi_{\infty}\in\mathcal{C}^{\infty}(B_{\mathbf{PH}}({\bf R})\times
K_{\infty})$. Moreover, by [36, Theorem 39.2], the space
$\mathcal{C}_{c}^{\infty}(B_{\mathbf{PH}}({\bf
R}))\otimes\mathcal{C}^{\infty}(K_{\infty})$ is (sequentially) dense in
$\mathcal{C}^{\infty}(B_{\mathbf{PH}}({\bf R})\times K_{\infty})$. Since, by
the previous point, the functional $\varphi_{S}\to G(\varphi_{S},k_{S},s)$ is
continuous, it is enough to show the meromorphic continuation for some
$\varphi_{S}$, whose component $\varphi_{\infty}$ (as a function on
$\mathbf{PH}({\bf R})$) lies in $\mathcal{C}^{\infty}_{c}(B_{\mathbf{PH}}({\bf
R}))\otimes\mathcal{C}^{\infty}(K_{\infty})$. From now on, we will assume so.

To prove the statement, we establish a connection between the functions
$G(\varphi_{S},1,s)$ and $I_{S}(\varphi_{S},f_{S,s},s)$ for a certain choice
of section $f_{S,s}$. The function $G(\varphi_{S},k_{S},s)$ can be expressed
as the iteration of the local integrals

$G_{v}(\varphi_{S},k_{v},s):=\int_{{\rm GL}_{2}({\bf Q}_{v})\setminus
M_{\mathbf{H}}({\bf
Q}_{v})}\delta^{\frac{1}{3}(s+1)}(m_{v})\mathcal{S}_{\varphi_{S}}^{\eta}(m_{v}k_{v})dm_{v}.$

By making use of the smoothness of $\varphi_{S}$, we will show that the
integral over $\prod_{v\in S\setminus\\{\infty\\}}\tilde{K}_{v}$ of (38) is
constant and reduce the integral $G$ to an archimedean one.

When $p$ is a finite place, we denote by $K^{\prime}_{p}$ the compact open
subgroup so that
$\mathcal{S}_{\varphi_{S}}^{\eta}(m_{p}k_{p})=\mathcal{S}_{\varphi_{S}}^{\eta}(m_{p})$.
Due to [7, Lemma 3.1.1], there is a section $\tilde{f}_{s,p}$ so that
$\tilde{f}_{s}|_{K_{p}}$ equals the characteristic function of
$K^{\prime}_{p}$. When $v=\infty$, by the discussion above we can assume that
$\varphi_{S}|_{\mathbf{H}({\bf R})}$ has $\infty$-component given by a pure
tensor
$\varphi_{B}\otimes\varphi_{K}\in\mathcal{C}^{\infty}_{c}(B_{\mathbf{PH}}({\bf
R}))\otimes\mathcal{C}^{\infty}(K_{\infty})$. Therefore, by a theorem of
Dixmier-Malliavin [10, Theorem 3.3], we are able to express $\varphi_{\infty}$
as a finite linear combination of functions of the form
$\phi_{i,\infty}*\varphi_{i,\infty}$, where
$\phi_{i,\infty}\in\mathcal{C}^{\infty}(K_{\infty})$ and smooth
$\varphi_{i,\infty}\in\Pi_{\infty}$. Writing
$\varphi_{i,S}=\varphi_{i,\infty}\otimes\bigotimes_{p\in
S\smallsetminus\\{\infty\\}}\varphi_{p}$, then we have that

$\sum_{i}I_{S}\left(\phi_{i,\infty}*\varphi_{i,S},\phi_{i,\infty}^{\prime}\otimes\left(\otimes_{p\in
S\setminus\\{\infty\\}}\tilde{f}_{s,p}\right),s\right)=\left(\prod_{p\in
S\smallsetminus\\{\infty\\}}\mathrm{vol}(K^{\prime}_{p})\right)G(\varphi_{S},1,s),$
(39)

where we have set $\phi^{\prime}_{i,\infty}(g):=\int_{\left({\rm GL}_{2}({\bf
R})\cap K_{\infty}\right)\left(N_{\mathbf{H}}({\bf R})\cap
K_{\infty}\right)}\phi_{i}(gk_{p})dk_{p}$. Since the left hand side of (39)
admits meromorphic continuation to the whole complex plane, we get the desired
statement.

_(3)_. To prove the statement, we trivialize the local integrals
$G_{p}(\varphi_{S},1,s)$ at any finite prime $p\in S$ as follows. Let
$\phi\in\mathcal{C}^{\infty}_{c}(N_{\mathbf{G}}({\bf Q}_{p}))$. Since ${\rm
GL}_{2}({\bf Q}_{p})\setminus M_{\mathbf{H}}({\bf Q}_{p})$ acts by conjugation
on $N_{\mathbf{H}}({\bf Q}_{p})\setminus N_{\mathbf{G}}({\bf Q}_{p})$, we get

$G_{p}(\phi*\varphi_{S},1,s)=\int_{{\rm GL}_{2}({\bf Q}_{p})\setminus
M_{\mathbf{H}}({\bf
Q}_{p})}\hat{\phi^{\prime}}(m_{p})\delta^{\frac{1}{3}(s+1)}(m_{p})\mathcal{S}_{\varphi_{S}}^{\eta}(m_{p})dm_{p},$

with $\phi^{\prime}(g)=\int_{N_{\mathbf{H}}({\bf Q}_{p})}\phi(ng)dn$ and
$\hat{\phi^{\prime}}(m_{p})=\int_{N_{\mathbf{H}}({\bf Q}_{p})\setminus
N_{\mathbf{G}}({\bf Q}_{p})}\phi^{\prime}(x)\chi_{\eta}(m_{p}xm_{p}^{-1})dx$.
According to the proof of Proposition 6.1, $M_{\mathbf{H}}({\bf Q}_{p})$ acts
on the set of characters $\psi:N_{\mathbf{G}}({\bf Q}_{p})/N_{\mathbf{H}}({\bf
Q}_{p})\to{\bf C}^{\times}$ with two orbits: one generated by the trivial
character $\mathds{1}$ and the open orbit ${\rm GL}_{2}({\bf Q}_{p})\setminus
M_{\mathbf{H}}({\bf Q}_{p})\cdot\chi_{\eta}$. Hence we may regard
$\hat{\phi}^{\prime}$ as the Fourier transform of $\phi^{\prime}$ restricted
to the characters in the open orbit ${\rm GL}_{2}({\bf Q}_{p})\setminus
M_{\mathbf{H}}({\bf Q}_{p})\cdot\chi_{\eta}$. The averaging map used to define
$\phi^{\prime}$ gives a surjective map
$\mathcal{C}^{\infty}_{c}(N_{\mathbf{G}}({\bf
Q}_{p}))\to\mathcal{C}^{\infty}_{c}(N_{\mathbf{G}}({\bf
Q}_{p})/N_{\mathbf{H}}({\bf Q}_{p}))$. Moreover, by the Fourier inversion
theorem, the Fourier transform defines a bijective map
$\mathcal{C}^{\infty}_{c}(N_{\mathbf{G}}({\bf
Q}_{p}))\to\mathcal{C}^{\infty}_{c}(\widehat{N_{\mathbf{G}}({\bf
Q}_{p})/N_{\mathbf{H}}({\bf Q}_{p})})$. When $p$ is finite, due to the
continuity of $\mathcal{S}_{\varphi_{S}}^{\eta}(m_{p})$, we can then choose
$\phi_{p}\in\mathcal{C}^{\infty}_{c}\left(N_{\mathbf{G}}({\bf Q}_{p})\right)$
so that $\hat{\phi}^{\prime}_{p}$ is the characteristic function of the
compact open subgroup $K^{\prime}_{p}$ so that
$\mathcal{S}_{\varphi_{S}}^{\eta}(m_{p})=\mathcal{S}_{\varphi_{S}}^{\eta}(1)\neq
0$. Therefore, up to normalising the $\phi_{p}$’s, we can choose $\phi_{p}$ at
each finite place in $S$ for which

$\displaystyle G(\otimes_{p\in
S\setminus\\{\infty\\}}\phi_{p}*\varphi_{S},1,s)=G_{\infty}(\varphi_{S},1,s).$
(40)

We are left to show that for some choice of data
$G_{\infty}(\varphi_{S},1,s)\neq 0$. Take $\phi_{\infty}$ such that
$\hat{\phi}^{\prime}_{\infty}$ has support in a sufficiently small
neighborhood $K^{\prime}_{\infty}$ of $1$, over which
$\mathcal{S}_{\varphi_{S}}^{\eta}$ is non-zero. Note that
$K^{\prime}_{\infty}$ exists by continuity of
$g\mapsto\mathcal{S}_{\varphi_{S}}^{\eta}(g)$ and that
$\mathcal{S}_{\varphi_{S}}^{\eta}(1)\neq 0$. Using the same argument as above,
we get $G_{\infty}(\phi_{\infty}*\varphi_{S},1,s)\neq 0$. ∎

Using Lemma 6.10, we can now prove Proposition 6.9.

###### Proof of Proposition 6.9.

We have already discussed that $I_{S}(\varphi_{S},f_{S,s},s)$ extends to a
meromorphic function to all $s\in{\bf C}$. We are thus left to show that,
given $s_{0}\in{\bf C}$, there exist some data $\varphi_{S},f_{S,s}$ such that
$I_{S}(\varphi_{S},f_{S,s},s_{0})\neq 0$.

Given $\varphi_{S}$, by (39) and (40), there exist data $\varphi_{S}^{\prime}$
and $f_{S,s}$ such that
$I_{S}(\varphi_{S}^{\prime},f_{S,s},s)=G_{\infty}(\varphi_{S},1,s)$. Moreover,
by Lemma 6.10(3), there exists $\varphi_{S}$ such that function
$G_{\infty}(\varphi_{S},1,s)\neq 0$. The result then follows from these two
facts. ∎

###  6.4. Location of poles

In what follows, we locate the possible poles of the zeta integral. This is
used to study the holomorphicity of $L^{S}(s,\sigma,{\rm
std}\otimes\chi_{E/{\bf Q}})$ by means of our zeta integral.

####  6.4.1. The Klingen Eisenstein series

Let $Q_{\mathbf{H}}$ denote the Klingen parabolic of $\mathbf{H}$ with Levi
decomposition $M_{Q_{\mathbf{H}}}N_{Q_{\mathbf{H}}}$ where

$M_{Q_{\mathbf{H}}}=\left\\{\left(\begin{smallmatrix}a&&\\\ &g&\\\
&&d\end{smallmatrix}\right),\;g\in{\rm GL}_{2},a,d\in{\rm GL}_{1}\;:\;ad={\rm
det}(g)\right\\}\simeq{\rm GL}_{2}\times{\rm GL}_{1},$

and $N_{Q_{\mathbf{H}}}\simeq\mathbf{G}_{a}^{3}$. Denote by
$\delta_{Q_{\mathbf{H}}}$ the modulus character of ${Q_{\mathbf{H}}}$, given
by

$\displaystyle\delta_{Q_{\mathbf{H}}}$
$\displaystyle:\left(\begin{smallmatrix}a&&\\\ &g&\\\
&&d\end{smallmatrix}\right)\mapsto\left|\tfrac{a}{d}\right|^{2}.$

Let $I_{Q_{\mathbf{H}}}(s)$ be the degenerate principal series representation
of $\mathbf{H}({\bf A})$ consisting of smooth functions $f_{s}^{\prime}$ on
$\mathbf{H}({\bf A})$ such that

$f_{s}^{\prime}(nmg)=\delta_{Q_{\mathbf{H}}}^{\tfrac{1}{2}(s+1/2)}(m)f_{s}^{\prime}(g),\;\forall
n\in N_{Q_{\mathbf{H}}}({\bf A}),\forall m\in M_{Q_{\mathbf{H}}}({\bf A}).$

Given a smooth section $f_{s}^{\prime}\in I_{Q_{\mathbf{H}}}(s)$, we define
the degenerate (Klingen) Eisenstein series

${\rm
Eis}_{Q_{\mathbf{H}}}(g,s,f_{s}^{\prime})={\sum_{\gamma\in{Q_{\mathbf{H}}}({\bf
Q})\backslash\mathbf{H}({\bf Q})}}f_{s}^{\prime}(\gamma g).$

In the study of the poles of our integral, we employ two facts regarding this
Eisenstein series. The first one is a result of Ikeda and regards a first term
identity between the Siegel and Klingen Eisenstein series.

######  Proposition 6.11.

There exists a section $f_{1/2}^{\prime}\in I_{Q_{\mathbf{H}}}(1/2)$ such that

${\rm Res}_{s=1}E_{P_{\mathbf{H}}}^{*}(g,s)=\frac{{\rm
Res}_{s=1}(\zeta^{S}(s))\zeta^{S}(3)}{2\zeta^{S}(2)}{\rm
Eis}_{Q_{\mathbf{H}}}(g,1/2,f_{1/2}^{\prime}).$

###### Proof.

This is basically [22, Proposition 1.10]. Notice that the result of _loc.cit._
is for ${\rm Sp}_{4}$-Eisenstein series. In order to use it, we consider the
following. By [19, p. 11], we have a factorization

$\mathbf{H}({\bf A})=\mathbf{H}({\bf Q})Z_{\mathbf{H}}({\bf A}){\rm
Sp}_{4}({\bf A})\mathbf{H}({\bf A}_{f}).$

Then, given any Eisenstein series $E(g,s,f_{s})$ defined over $\mathbf{H}({\bf
A})$, we may write

$E(g,s,f_{s})=E(g_{0}zg_{1}g_{f},s,f_{s})=E(g_{1}g_{f},s,f_{s})=E(g_{1},s,r(g_{f})f_{s}),$

by the invariant properties of the Eisenstein series, and where $r(g_{f})$
denotes the right multiplication action of $g_{f}$ on $f_{s}$. In particular,
the values of the Eisenstein series $E_{P_{\mathbf{H}}}(g,s,f_{s})$ and ${\rm
Eis}_{Q_{\mathbf{H}}}(g,s,f_{s}^{\prime})$ at $g$ equal to the values at
$g_{1}$ of the Eisenstein series $E_{P_{{\rm
Sp}_{4}}}(g_{1},s,r(g_{f})f_{s})$, $E_{Q_{{\rm
Sp}_{4}}}(g_{1},s,r(g_{f})f_{s}^{\prime})$ for ${\rm Sp}_{4}$ associated
respectively to the parabolics $P_{{\rm Sp}_{4}}=P_{\mathbf{H}}\cap{\rm
Sp}_{4}$ and $Q_{{\rm Sp}_{4}}=Q_{\mathbf{H}}\cap{\rm Sp}_{4}$, and to the
elements $r(g_{f})f_{s}\in{\rm Ind}_{P({\bf A})}^{{\rm Sp}_{4}({\bf
A})}\nu_{P}^{s+1}$, $r(g_{f})f_{s}^{\prime}\in{\rm Ind}_{Q({\bf A})}^{{\rm
Sp}_{4}({\bf A})}\nu_{Q}^{2s+1}$. Here we denoted

$\displaystyle\nu_{P}:$ $\displaystyle\left(\begin{smallmatrix}g&\star\\\
&I_{2}^{\prime}{}^{t}g^{-1}I_{2}^{\prime}\end{smallmatrix}\right)\mapsto\left|{\rm
det}(g)\right|,$ $\displaystyle\nu_{Q}:$
$\displaystyle\left(\begin{smallmatrix}a&&\\\ &g&\\\
&&a^{-1}\end{smallmatrix}\right)\mapsto\left|a\right|.$

With respect to [22], the Eisenstein series $E_{P_{{\rm
Sp}_{4}}}(g_{1},s,r(g_{f})f_{s})$, resp. $E_{Q_{{\rm
Sp}_{4}}}(g_{1},s,r(g_{f})f_{s}^{\prime})$ have complex variable $s$ shifted
by $-1/2$. We now apply [22, Proposition 1.10], which says that, given
$\omega$ the longest element of $W_{M_{\mathbf{H}}}\backslash W_{\mathbf{H}}$
($M_{\mathbf{H}}$ being the Levi of $P_{\mathbf{H}}$) and $M_{\omega}$ the
corresponding intertwining operator, then

${\rm Res}_{s=1}E_{P_{{\rm
Sp}_{4}}}(g_{1},s,r(g_{f})f_{s})=\tfrac{1}{2}E_{Q_{{\rm
Sp}_{4}}}(g_{1},1/2,{\rm Res}_{s=1}M_{\omega}(r(g_{f})f_{s})).$

As $M_{\omega}$ is an intertwining map, the action of $g_{f}$ commutes with
it, hence we have

${\rm Res}_{s=1}E_{P_{{\rm
Sp}_{4}}}(g_{1},s,r(g_{f})f_{s})=\tfrac{1}{2}E_{Q_{{\rm
Sp}_{4}}}(g_{1},1/2,{\rm Res}_{s=1}r(g_{f})M_{\omega}(f_{s})).$

This implies that ${\rm Res}_{s=1}E_{P_{\mathbf{H}}}(g,s,f_{s})$ equals to
$\tfrac{1}{2}{\rm Eis}_{Q_{\mathbf{H}}}(g,s,{\rm
Res}_{s=1}M_{\omega}(f_{s}))$, i.e. $f_{1/2}^{\prime}$ can be taken to be
${\rm Res}_{s=1}M_{\omega}(f_{s})$. After normalising $f_{s}$, we thus get the
desired result for the normalised Eisenstein series
$E_{P_{\mathbf{H}}}^{*}(g,s)$ (see also [22, Proposition 1.8]). ∎

The second fact needed concerns the vanishing of the following integral:

$J(\varphi,f_{s}^{\prime},s):=\int_{\mathbf{H}({\bf Q})Z_{\mathbf{H}}({\bf
A})\setminus\mathbf{H}({\bf A})}{\rm Eis}_{Q_{\mathbf{H}}}(h,s)\varphi(h)dh,$
(41)

where $\varphi$ is a cusp form in $\pi$ and ${\rm Eis}_{Q_{\mathbf{H}}}(g,s)$
is the degenerate Klingen Eisenstein series for $\mathbf{H}$.

######  Proposition 6.12.

The integral $J(\varphi,f_{s}^{\prime},s)$ is identically zero.

######  Remark 6.13.

Notice that if the induced datum of the Klingen Eisenstein series is not
degenerate, the corresponding integral calculates the
$\wedge^{2}_{t}\times{\rm Std}$ $L$-function on ${{\rm GU}}_{2,2}\times{\rm
GL}_{2}$. A proof of this claim will appear in forthcoming work of the
authors.

###### Proof of Proposition 6.12.

We start by unfolding the Eisenstein series. For big enough ${\rm Re}(s)$, we
get

$\int_{{Q_{\mathbf{H}}}({\bf Q})Z_{\mathbf{H}}({\bf
A})\setminus\mathbf{H}({\bf A})}f_{s}^{\prime}(h)\varphi(h)dh.$

Collapse the sum over the unipotent radical $N_{Q_{\mathbf{H}}}$ of
${Q_{\mathbf{H}}}$ to get

$\displaystyle\int_{M_{Q_{\mathbf{H}}}({\bf Q})N_{Q_{\mathbf{H}}}({\bf
A})Z_{\mathbf{H}}({\bf A})\setminus\mathbf{H}({\bf
A})}f_{s}^{\prime}(h)\int_{N_{Q_{\mathbf{H}}}({\bf Q})\backslash
N_{Q_{\mathbf{H}}}({\bf A})}\varphi(nh)dndh.$

We now Fourier expand over $[N^{\prime\prime}/N_{Q_{\mathbf{H}}}]$, with
$N^{\prime\prime}$ being the unipotent radical of the Klingen parabolic of
$\mathbf{G}$. The integral equals

$\int_{M_{Q_{\mathbf{H}}}({\bf Q})N_{Q_{\mathbf{H}}}({\bf
A})Z_{\mathbf{H}}({\bf A})\setminus\mathbf{H}({\bf
A})}f_{s}^{\prime}(h)\sum_{\chi}\varphi_{\chi}(h)dh,$

where the sum runs over the characters
$\chi:[N^{\prime\prime}/N_{Q_{\mathbf{H}}}]\to{\bf C}^{\times}$ and where we
have denoted

$\varphi_{\chi}(h)=\int_{N^{\prime\prime}({\bf Q})\backslash
N^{\prime\prime}({\bf
A})}\varphi(n^{\prime\prime}h)\chi^{-1}(n^{\prime\prime})dn^{\prime\prime}.$

Any character $\chi:[N^{\prime\prime}/N_{Q_{\mathbf{H}}}]\to{\bf C}^{\times}$
can be described as follows. Recall that any character
$\chi:[N^{\prime\prime}/[N^{\prime\prime},N^{\prime\prime}]]\to{\bf
C}^{\times}$ is of the form $n^{\prime\prime}\mapsto\psi({\rm Tr}_{E/{\bf
Q}}(\alpha x+\beta y)),$ where $\alpha,\beta\in E$, $\psi$ is a non-trivial
additive character on ${\bf Q}\backslash{\bf A}$, and where we have written

$n^{\prime\prime}\equiv\left(\begin{smallmatrix}1&x&y&0\\\ &1&&\bar{y}\\\
&&1&-\bar{x}\\\ &&&1\end{smallmatrix}\right),\;\text{ mod
}[N^{\prime\prime},N^{\prime\prime}]\;\text{ with }x,y\in{\bf A}_{E}.$

Such a character $\chi$ is trivial on $N_{Q_{\mathbf{H}}}({\bf A})$ if
$\alpha+\bar{\alpha}=\beta+\bar{\beta}=0$. We deduce that any character
$\chi:[N^{\prime\prime}/N_{Q_{\mathbf{H}}}]\to{\bf C}^{\times}$ is of the form
$n^{\prime\prime}\mapsto\psi({\rm Tr}_{E/{\bf Q}}(\alpha x+\beta y))$, with
$\alpha,\beta\in E$ such that $\bar{\alpha}=-\alpha$ and $\bar{\beta}=-\beta$.
To remark the dependence by these data, denote such a character by
$\chi_{\alpha,\beta}$.

As $M_{Q_{\mathbf{H}}}$ acts on $N^{\prime\prime}$ by conjugation and this
action preserves $N_{Q_{\mathbf{H}}}$, $M_{Q_{\mathbf{H}}}({\bf Q})$ acts on
the space of characters of $[N^{\prime\prime}/N_{Q_{\mathbf{H}}}]$. Indeed, if
$m=\left(\begin{smallmatrix}a&&\\\ &g&\\\ &&d\end{smallmatrix}\right)\in
M_{Q_{\mathbf{H}}}({\bf Q})$ and $g^{-1}=(\tilde{g}_{i,j})$,

$\displaystyle\chi_{\alpha,\beta}(mn^{\prime}m^{-1})$
$\displaystyle=\psi(a\cdot{\rm Tr}_{E/{\bf
Q}}(\alpha(\tilde{g}_{1,1}x+\tilde{g}_{2,1}y)+\beta(\tilde{g}_{1,2}x+\tilde{g}_{2,2}y)))$
$\displaystyle=\psi({\rm Tr}_{E/{\bf
Q}}(a(\alpha\tilde{g}_{1,1}+\beta\tilde{g}_{1,2})x+a(\alpha\tilde{g}_{2,1}+\tilde{g}_{2,2})y))$
$\displaystyle=\chi_{\alpha^{\prime},\beta^{\prime}}(n^{\prime}),$

with $\alpha^{\prime}=a(\alpha\tilde{g}_{1,1}+\beta\tilde{g}_{1,2})$ and
$\beta^{\prime}=a(\alpha\tilde{g}_{2,1}+\tilde{g}_{2,2})$. Then,
$M_{Q_{\mathbf{H}}}({\bf Q})$ acts on the space of characters of
$[N^{\prime\prime}/N_{Q_{\mathbf{H}}}]$ with two orbits, the trivial one and
an open one. A representative of the open orbit is given by the character
$\chi_{\alpha,0}$ with $\bar{\alpha}=-\alpha\neq 0$. Using this action, we can
write the integral as

$\displaystyle\int_{M_{Q_{\mathbf{H}}}({\bf Q})N_{Q_{\mathbf{H}}}({\bf
A})Z_{\mathbf{H}}({\bf A})\setminus\mathbf{H}({\bf
A})}f_{s}^{\prime}(h)\int_{[N^{\prime\prime}]}\varphi(n^{\prime\prime}h)dn^{\prime\prime}dh+\int_{M_{\alpha}({\bf
Q})N_{Q_{\mathbf{H}}}({\bf A})Z_{\mathbf{H}}({\bf A})\setminus\mathbf{H}({\bf
A})}f_{s}^{\prime}(h)\varphi_{\chi_{\alpha,0}}(h)dh,$ (42)

where $M_{\alpha}({\bf Q})$ denotes the stabiliser in $M_{Q_{\mathbf{H}}}({\bf
Q})$ of $\chi_{\alpha,0}$. From the explicit description above, notice that

$M_{\alpha}({\bf Q})=\left\\{\left(\begin{smallmatrix}a&&&\\\ &a&b&\\\ &&d&\\\
&&&d\end{smallmatrix}\right)\;\right\\}=L_{\alpha}({\bf Q})N_{\alpha}({\bf
Q}),$

where $L_{\alpha}$ (resp. $N_{\alpha}$) denotes its Levi part (resp. unipotent
part).

The first integral of (42) vanishes because of cuspidality of $\varphi$ along
$[N^{\prime\prime}]$, hence

$J(\varphi,f_{s}^{\prime},s)=\int_{M_{\alpha}({\bf Q})N_{Q_{\mathbf{H}}}({\bf
A})Z_{\mathbf{H}}({\bf A})\setminus\mathbf{H}({\bf
A})}f_{s}^{\prime}(h)\varphi_{\chi_{\alpha,0}}(h)dh.$

Collapse the sum over $[N_{\alpha}]$ to get

$\displaystyle J(\varphi,f_{s}^{\prime},s)$
$\displaystyle=\int_{L_{\alpha}({\bf Q})N_{\alpha}({\bf
A})N_{Q_{\mathbf{H}}}({\bf A})Z_{\mathbf{H}}\setminus\mathbf{H}({\bf
A})}f_{s}^{\prime}(h)\int_{[N_{\alpha}]}\varphi_{\chi_{\alpha,0}}(nh)dndh.$

Notice that the inner integral
$\int_{[N_{\alpha}]}\varphi_{\chi_{\alpha,0}}(nh)dn$ equals the Fourier
coefficient of $\varphi$ with respect to the unipotent radical of the Borel
subgroup of $\mathbf{G}$ and the choice of a character on it which is
degenerate (as it’s only supported on the entry (1,2)). As a consequence,
$\int_{[N_{\alpha}]}\varphi_{\chi_{\alpha,0}}(nh)dn$ contains, as an inner
integral, the period of $\varphi$ over the unipotent radical of the Siegel
parabolic of $\mathbf{G}$, which vanishes by cuspidality of $\varphi$. This
completes the proof. ∎

######  Remark 6.14.

Proposition 6.12 has potential applications to the study of the archimedean
regulator of the cohomology classes introduced in [9]. Indeed, we expect the
vanishing of this integral to imply that the image via the archimedean
regulator of the motivic incarnation of the classes of [9, Definition 6.6]
contributes entirely to Eisenstein cohomology.

####  6.4.2. Periods and residues

For any cusp form $\varphi$ on $\mathbf{G}({\bf A}_{\bf Q})$, we consider

$\varphi^{\mathbf{H}}(g):=\int_{\mathbf{H}({\bf Q})Z_{\mathbf{H}}({\bf
A})\setminus\mathbf{H}({\bf A})}\varphi(hg)dh.$

This automorphic period vanishes if $\varphi$ is any globally generic cusp
form.

######  Lemma 6.15.

Let $\Pi$ be a globally generic cuspidal automorphic representation of
$\mathbf{P}\mathbf{G}({\bf A}_{\bf Q})$. For any cusp form $\varphi$ in $\Pi$
and $g\in\mathbf{G}({\bf A}_{\bf Q})$, the period $\varphi^{\mathbf{H}}(g)=0$.

###### Proof.

Since ${\rm Sp}_{4}$ is a normal subgroup of $\mathbf{H}$, the result is
implied by showing that, for any $\varphi$ in $\Pi$ and $g\in\mathbf{G}({\bf
A}_{\bf Q})$,

$\varphi^{{\rm Sp}_{4}}(g):=\int_{[{\rm Sp}_{4}]}\varphi(hg)dh=0.$

We show the latter by contradiction. Suppose that there exists $\varphi$ in
$\Pi$ and $g\in\mathbf{G}$ for which $\varphi^{{\rm Sp}_{4}}(g)\neq 0$. This
defines a non-trivial ${\rm Sp}_{4}$-functional on $\Pi$. Let $p$ be an
unramified prime for $\Pi$ which splits in $E$. We can further assume that
$g_{p}=1$. Since $p$ splits, we can identify $\Pi_{p}$ with an unramified
generic representation $\pi_{p}$ of ${\rm GL}_{4}({\bf Q}_{p})$ with trivial
central character. As the linear span $V_{p}$ of the
$\textbf{P}\mathbf{G}({\bf Q}_{p})$-right translates of $\varphi$ is
isomorphic to $\pi_{p}$, the map

$V_{p}\ni\varphi^{\prime}\mapsto\left(g^{\prime}\mapsto\int_{[{\rm
Sp}_{4}]}\varphi^{\prime}(hgg^{\prime})dh\right)$

defines an injective intertwining map in ${\rm Hom}_{{\rm GL}_{4}({\bf
Q}_{p})}(\pi_{p},{C}_{c}^{\infty}({\rm Sp}_{4}({\bf Q}_{p})\backslash{\rm
GL}_{4}({\bf Q}_{p})))$. This contradicts the genericity of $\pi_{p}$ (cf.
[20, Theorem 3.2.2]). ∎

####  6.4.3. Location of poles

Proposition 6.12 and Lemma 6.15 imply the following.

######  Theorem 6.16.

Let $\Pi$ be a globally generic cuspidal automorphic representation of
$\mathbf{G}({\bf A})$, with trivial central character and let $\varphi$ be a
cusp form in $\Pi$. The integral $I(\varphi,s)$ is holomorphic for all $s$.

###### Proof.

Recall that the normalised Eisenstein series $E_{P_{\mathbf{H}}}^{*}(g,s)$
achieves poles at $s=1,2$ of order at most one, thus $I(\varphi,s)$ may have a
pole at these two values.

At $s=1$, the residue of the integral equals to

$\displaystyle{\rm Res}_{s=1}I(\varphi,s)$ $\displaystyle={\rm
Res}_{s=1}\int_{\mathbf{H}({\bf Q})Z_{\mathbf{H}}({\bf
A})\setminus\mathbf{H}({\bf A})}E^{*}_{P_{\mathbf{H}}}(h,s)\varphi(h)dh$
$\displaystyle=\int_{\mathbf{H}({\bf Q})Z_{\mathbf{H}}({\bf
A})\setminus\mathbf{H}({\bf A})}{\rm
Res}_{s=1}E^{*}_{P_{\mathbf{H}}}(h,s)\varphi(h)dh$
$\displaystyle=C\cdot\int_{\mathbf{H}({\bf Q})Z_{\mathbf{H}}({\bf
A})\setminus\mathbf{H}({\bf A})}{\rm
Eis}_{Q_{\mathbf{H}}}(g,1/2,f_{1/2}^{\prime})\varphi(h)dh$
$\displaystyle=C\cdot J(\varphi,f_{1/2}^{\prime},1/2),$

where the third equality follows from Proposition 6.11 and $C=\frac{{\rm
Res}_{s=1}(\zeta^{S}(s))\zeta^{S}(3)}{2\zeta^{S}(2)}$. The latter integral
vanishes by Proposition 6.12, hence $I(\varphi,s)$ is holomorphic at $s=1$.

At $s=2$, the picture is different. Indeed, $s=2$ is the end of the critical
strip and the residue of the Eisenstein series is the constant representation,
i.e. there exists $f_{s}\in I_{P_{\mathbf{H}}}(s)$ such that ${\rm
Res}_{s=2}E_{P_{\mathbf{H}}}^{*}(g,s)$ is constant. Therefore

$\displaystyle{\rm Res}_{s=2}I(\varphi,s)$
$\displaystyle=\int_{\mathbf{H}({\bf Q})Z_{\mathbf{H}}({\bf
A})\setminus\mathbf{H}({\bf A})}{\rm
Res}_{s=2}E^{*}_{P_{\mathbf{H}}}(h,s)\varphi(h)dh$
$\displaystyle=C\cdot\int_{\mathbf{H}({\bf Q})Z_{\mathbf{H}}({\bf
A})\setminus\mathbf{H}({\bf A})}\varphi(h)dh.$

Hence, $I(\varphi,s)$ achieves a pole at $s=2$ if $\varphi^{\mathbf{H}}(1)\neq
0$. However, the latter is always zero because of Lemma 6.15. ∎

## References

  * [1] Adler, J. D., and Prasad, D. On certain multiplicity one theorems.  Isr. J. Math. 153 (2006), 221–245.
  * [2] Blasius, D., and Rogawski, J. D. Zeta functions of Shimura varieties.  Motives (Seattle, WA, 1991) 55, Part 2 (1994), 525–571.
  * [3] Bump, D. The Rankin-Selberg method: an introduction and survey.  Automorphic representations, L-functions and applications: progress and prospects 11 (2005), 41–73.
  * [4] Bump, D., Friedberg, S., and Ginzburg, D. Whittaker-orthogonal models, functoriality, and the Rankin-Selberg method.  Inventiones mathematicae 109, 1 (1992), 55–96.
  * [5] Cartier, P., et al. Representations of p-adic groups: a survey.  In Automorphic forms, representations and L-functions (Proc. Sympos. Pure Math., Oregon State Univ., Corvallis, Ore., 1977), Part (1979), vol. 1, pp. 111–155.
  * [6] Casselman, W. The unramified principal series of $p$-adic groups. I. the spherical function.  Compositio Mathematica 40, 3 (1980), 387–406.
  * [7] Casselman, W., Adler, J., Anspach, P. H., Boller, J., Chriss, N., DeBacker, S., Graham, B., Levy, J., and Roche, A. Introduction to the theory of admissible representations of p-adic reductive groups, 2008.
  * [8] Casselman, W., and Shalika, J. The unramified principal series of $p$-adic groups. II. the Whittaker function.  Compositio Mathematica 41, 2 (1980), 207–231.
  * [9] Cauchi, A. Norm-compatible systems of cohomology classes for ${\rm GU}(2,2)$.  International Journal of Number Theory 16, 03 (2020), 461–510.
  * [10] Dixmier, J., and Malliavin, P. Factorisations de fonctions et de vecteurs indefiniment différentiables.  Bull. Sci. Math., II. Sér. 102 (1978), 305–330.
  * [11] File, D. On the degree five $L$-function for $\mathrm{GSp}_{4}$.  Transactions of the American Mathematical Society 365, 12 (2013), 6471–6497.
  * [12] Fulton, W., and Harris, J. Representation theory: a first course, vol. 129.  Springer Science & Business Media, 2013.
  * [13] Furusawa, M., and Morimoto, K. Shalika periods on ${\rm GU}(2,2)$.  Proceedings of the American Mathematical Society 141, 12 (2013), 4125–4137.
  * [14] Gan, W. T., and Gurevich, N. Non-tempered Arthur packets of $G_{2}$.  In Automorphic representations, $L$-functions and applications. Progress and prospects. Proceedings of a conference honoring Steve Rallis on the occasion of his 60th birthday, Columbus, OH, USA, March 27–30, 2003. Berlin: de Gruyter, 2005, pp. 129–155.
  * [15] Gan, W. T., and Savin, G. An exceptional Siegel–Weil formula and poles of the Spin $L$-function of $\mathrm{PGSp}_{6}$.  Compositio Mathematica 156, 6 (2020), 1231–1261.
  * [16] Gan, W. T., and Takeda, S. The local Langlands conjecture for $\mathrm{Sp}(4)$.  International Mathematics Research Notices 2010, 15 (2010), 2987–3038.
  * [17] Gelbart, S., Piatetski-Shapiro, I., and Rallis, S. Explicit constructions of automorphic $L$-functions, vol. 1254.  Springer, 2006.
  * [18] Gelbart, S. S., and Knapp, A. W. L-indistinguishability and R groups for the special linear group.  Advances in Mathematics 43, 2 (1982), 101–121.
  * [19] Harris, M., and Kudla, S. S. On a conjecture of Jacquet.  In Contributions to automorphic forms, geometry, and number theory. Baltimore, MD: Johns Hopkins University Press, 2004, pp. 355–371.
  * [20] Heumos, M., and Rallis, S. Symplectic-Whittaker models for ${\rm GL}_{n}$.  Pacific Journal of Mathematics 146, 2 (1990), 247–279.
  * [21] Hironaka, Y. Spherical functions and local densities on hermitian forms.  Journal of the Mathematical Society of Japan 51, 3 (1999), 553–581.
  * [22] Ikeda, T. On the location of poles of the triple $L$-functions.  Compositio Mathematica 83, 2 (1992), 187–237.
  * [23] Jacquet, H., and Rallis, S. Uniqueness of linear periods.  Compositio Mathematica 102, 1 (1996), 65–123.
  * [24] Jacquet, H., and Shalika, J. Exterior square $L$-functions.  Automorphic forms, Shimura varieties, and L-functions 2 (1990), 143–226.
  * [25] Kim, H., and Krishnamurthy, M. Twisted exterior square lift from ${\rm GU}(2,2)_{E/F}$ to ${\rm GL}_{6}/F$.  J. Ramanujan Math. Soc 23, 4 (2008), 381–412.
  * [26] Kudla, S. S., and Rallis, S. A regularized Siegel-Weil Formula: The First Term Identity.  Annals of Mathematics 140, 1 (1994), 1–80.
  * [27] Li, J.-S. Some results on the unramified principal series of $p$-adic groups.  Mathematische Annalen 292, 1 (1992), 747–761.
  * [28] Mœglin, C., Vignéras, M.-F., and Waldspurger, J.-L. Correspondances de Howe sur un corps p-adique, vol. 1291.  Springer, 1987.
  * [29] Morimoto, K. On the theta correspondence for $({{\rm GSp}}(4),{{\rm GSO}}(4,2))$ and Shalika periods.  Representation Theory of the American Mathematical Society 18, 3 (2014), 28–87.
  * [30] Pollack, A. Unramified Godement-Jacquet theory for the spin similitude group.  J. Ramanujan Math. Soc. 33, 3 (2018), 249—282.
  * [31] Prasad, D. Trilinear forms for representations of $\mathrm{GL}(2)$ and local $\varepsilon$-factors.  Compositio Mathematica 75, 1 (1990), 1–46.
  * [32] Roberts, B., and Schmidt, R. Local newforms for ${\mathrm{GSp}}(4)$.  Springer Science & Business Media, 2007.
  * [33] Sakellaridis, Y. A Casselman–Shalika formula for the Shalika model of ${\rm GL}_{n}$.  Canadian Journal of Mathematics 58, 5 (2006), 1095–1120.
  * [34] Shahidi, F. On Certain $L$-functions.  American Journal of Mathematics 103, 2 (1981), 297–355.
  * [35] Sugano, T. On Dirichlet series attached to holomorphic cusp forms on ${\rm SO}(2,q)$.  Adv. Stud. Pure Math 7 (1985), 333–362.
  * [36] Trèves, F. Topological vector spaces, distributions and kernels.  New York-London: Academic Press 1967. XVI, 565 p. (1967)., 1967\.


# GPT-2C: A GPT-2 parser for Cowrie honeypot logs

1st Febrian Setianto  Center for Ubiquitous Computing
University of Oulu
Oulu, Finland
<EMAIL_ADDRESS>2nd Erion Tsani  Computer Engineering & Informatics
University of Patras
Patra, Grece
<EMAIL_ADDRESS>3rd Fatima Sadiq  Center for Ubiquitous Computing
University of Oulu
Oulu, Finland
<EMAIL_ADDRESS>4th Georgios Domalis  Computer Engineering & Informatics
University of Patras
Patra, Grece
<EMAIL_ADDRESS>5th Dimitris Tsakalidis  NOVELCORE
Patra, Grece
<EMAIL_ADDRESS>6th Panos Kostakos  Center for Ubiquitous Computing
University of Oulu
Oulu, Finland
<EMAIL_ADDRESS>
###### Abstract

Deception technologies like honeypots produce comprehensive log reports, but
often lack interoperability with EDR and SIEM technologies. A key bottleneck
is that existing information transformation plugins perform well on static
logs (e.g. geolocation), but face limitations when it comes to parsing dynamic
log topics (e.g. user-generated content). In this paper, we present a run-time
system (GPT-2C) that leverages large pre-trained models (GPT-2) to parse
dynamic logs generate by a Cowrie SSH honeypot. Our fine-tuned model achieves
89% inference accuracy in the new domain and demonstrates acceptable execution
latency.

###### Index Terms:

Cowrie, parser, logs, honeypots, GPT-2, language models, Question Answering

##  I Introduction

The continuously evolving landscape of cyberspace attacks has led to advanced
defence strategies in the area of network forensics. These include the use of
automated agents with the ability to make knowledgeable decisions and plan
dynamic responses, as well as the use of deception techniques and tools,
including honeypots and honeynets, which can detect, prevent and identify
malicious activities.

Honeypots have evolved from simple low-interaction systems simulating specific
parts of real systems to high-interaction systems that are set up to appear as
complete operating systems with real network services, real or virtual devices
and realistic information of users [22]. Their main role is to engage
attackers and captivate their behavior and practices so that operators can
analyze in-depth the vulnerabilities of their systems [20]. Honeynets are
networks of interconnected honeypots operating as a whole alongside a
functional Intrusion Detection System (IDS) [8].

Cowrie is a virtual Secure Shell (SSH) and Telnet honeypot, utilized to
continuously monitor brute force attacks, by producing log files capturing the
actions of malicious users. However, they can be easily identified by
adversaries, since they are rarely customized to systems, due to the lack of
standard frameworks [3]. To better understand and leverage the deceptive
capabilities of Cowrie, it is important to automate the parsing methodologies
of the log files produced.

##  II Towards AI-based parsing

Unstructured information describes data as a large text-corpus collection with
no predefined model. Massive volumes of unstructured information is extracted
from various domains in a variance of forms, from media, texts to log files.
They can be processed and parsed for semantic search [13], anomaly detection
[10], cognitive management [1], autonomous problem validation [2], incident
management or root cause analysis [19]. Information extraction from
unstructured data is enabled through (i) relation-based extraction, (ii)
template-based extraction, (iii) deep learning-based extraction[19, 6].

Relationship-based extraction requires linguistic data. Named entity
recognition and text classification along with Conditional Random Fields
(CRFs) enable the identification of patterns in word sequencing leading to the
recognition of entities by the pattern of sequence containing it [21]. Another
relationship-based approach focuses on the metadata extraction by utilizing a
part of speech tagging methodology followed by a morphological analysis that
identifies nested words and assigns them labels based on its context towards
extracting features [6].

In contrast to relationship-based extraction, template-based information
extraction utilises various data mining techniques and is used mostly on non-
linguistic unstructured data. Agent-based approaches that analyse data based
on a unique protocol classifies it and extracts table templates in
heterogeneous sources, but are effective on specific message corpora [9].
Pattern learning techniques have been widely adopted for template-based
information extraction. A widely used open-source algorithm, namely the Simple
Logfile Clustering Tool (SLCT), works in three steps: word vocabulary
construction and capture word frequency, clustering the inputs from word
vocabulary, and construction of the template through the log messages[23].

Deep learning techniques used for data analysis and information extraction are
solely dependent on data. DeepDeSRT, a deep learning neural network performs
image analysis to identify table formats, constructs templates [17]. On the
other hand, DeepLog enables Long Short-Term Memory (LSTM) to recognize word
distribution patterns rather than analyse data and extract information[4].

In general, parsers struggle with the domain/vendor-specific technical
language, while developing and maintaining them is a time-consuming process
with high demanding domain expertise. An autonomous log parser to be (i)
resilient to different data formats, (ii) eliminate the need for human
intervention, (iii) independent from labelled training data, (iv) does not
require a dictionary to parse different table components such as rows,
columns, and headers[11].

Generative Pre-trained Transformer (GPT) models by OpenAI [14] have taken the
natural language processing (NLP) community by storm by introducing very
powerful language models. These models can perform various NLP tasks like
question answering, textual entailment, and text summarisation without any
supervised training.

GPT-2 is a transformers pre-trained model [5] on a very large corpus of
internet text data in English, more precisely a dataset of 8 million web pages
(WebText). The model was trained to _guess the next word in sentences_ , so it
performs best on the pre-trained domain, however, it performs well on
downstream tasks. In this paper, we present a GPT-2 based approach that
leverages deep learning to automate the process of extracting and parsing
information from unstructured log files to better understand and leverage the
deceptive capabilities of Cowrie.

##  III Methods

GPT-2C is a run-time tool that leverages a fine-tuned GPT-2 model to help
overcome the bottleneck of dynamic log reports generated by Cowrie. Trained on
cowrie log data, the model enables us to essentially translate a typical data
transformation task into a Question Answering (QA) problem.

###  III-A Training Data

We fine-tuned a GPT-2 model on the CyberLab honeynet dataset which is freely
available in Zenodo [18]. The dataset contains Cowrie honeypot logs with
attributes in JSON format from May 2019 to February 2020. For the purposes of
our experiment, we extracted only the `message` attribute which is the most
dynamic topic in the log output, containing Linux commands and utilities used
during attacks. To minimise computing time, we collected data from 29 randomly
selected JSON log files out of the total 290. Next, we explain how we fine-
tuned our model following the required QA format using the Hugging Face
library[5].

###  III-B Fine-tuning GPT-2 log parser: Q&A model

For the experiment, we selected the GPT-2 small model with 117M parameters, 12
layers and 1024 dimensionality as GPT-2 can only generate a maximum of 1024
tokens per request. Furthermore, the GPT-2 small size model is easy to fine-
tune and the weight of the model can adapt better to honeypot logs data[16].
Our data contains 36,445 unique commands and was split into training (32,801),
validation (3,645) and test (999) sets. We used two epochs and a batch size of
two, depending on the maximum sequence length and GPU memory.

###  III-C Evaluation Metrics

For evaluation metrics, in addition to the loss function that the base GPT-2
provides, we also calculated the F1-score, a common metric for NLP tasks. The
formula for the standard F1-score is the harmonic mean of the precision and
recall. A perfect model has an F-score of 1.

$F_{1}=2*\frac{precision*recall}{precision+recall}=\frac{tp}{tp+1/2(fp+fn)}$

_where tp stands for true positive, fp for false positive and fn for false
negative_

In the Span-based QA task we compared the tokens of the correct answer and the
predicted. To achieve this, we have reused the methods developed for
evaluating models targeting the Stanford Question Answering Dataset
(SQuAD)[12].

###  III-D The Cowrie SSH Honeypot

The Cowrie instance was set up on top of Ubuntu 20.04.2 LTS and deployed in
the cloud. We changed the actual SSH port to establish a remote connection
since the default port (22) is employed by Cowrie. Next, we set the firewall
to permit incoming connections towards both ports. Additionally, we replaced
several default values from Cowrie’s configuration to diminish the likelihood
of attackers acknowledging the honeypot environment. Some of the variations
including hostname, Linux distribution, user accounts, CPU information and
mounted media. While Cowrie produced log files in plain text and JSON formats,
the subsequent processing pipeline only took the structured JSON logs.

###  III-E Transformer Pipeline architecture

We developed a pipeline to deploy the fine-tuned GPT-2 model and tested it on
real-time logs produced by the Cowrie honeypot. Our testing environment was
set up on top of Ubuntu 20.04.2 LTS and comprised of two nodes as illustrated
in Fig. 1. The first node, VM 1, is deployed on an instance with 4GB of RAM
and 3 CPU cores, as the purpose is to serve as a honeypot. The second node is
equipped with 112GB of RAM, 14 CPU cores, and an NVIDIA Tesla P100. All the
nodes were deployed in cloud infrastructure which is based on OpenStack.

Several components are part of the building blocks of this system. First is
Cowrie, the honeypot instance which records the intruders’ actions, timestamp,
and several other fields. The second is Filebeat which is responsible for
collecting Cowrie’s log files and harvesting the content. The third is
Logstash which process each log message or line as a JSON object. It also
parsed the timestamp field with ISO8601 format. It then removed unnecessary
information, such as log file location, and send the attackers’ commands to an
Inference Server if the message satisfies a condition. The fourth is the
Inference Server, which is constructed on top of FastAPI. It provides an
endpoint that accepts the attacker’s commands, feeds them to the machine
learning model to perform the inference, and returns the prediction result
with the score as the response. The fifth is Elasticsearch which stores and
indexes the log messages given by Logstash to support data exploration and
aggregation. The last is the front-end that provides an easy to use user
interface for data exploration and visualization, powered by Kibana.

Figure 1: End-to-end pipeline architecture, with arrows depicting data flow.

###  III-F Run-time transformer parser: FastAPI to deploy the GPT-2 model

Instead of mandating Logstash to load the ML model and perform the inference
on each of the attackers’ commands, the responsibility is lifted to a
dedicated entity named Inference Server. This design allows separation of
concern: Logstash utilized its resources to parse and transform the logs, and
Inference Server to load the ML model and serve incoming requests
concurrently.

The Inference Server was built on top of FastAPI[7], a fast web framework for
building web APIs. A Python-based framework was chosen to support the
inference, as the ML model itself was trained and saved according to PyTorch’s
format[15]. It exposed a RESTful API over HTTP protocol, where it only accepts
a request with JSON-formatted payload.

When Logstash makes the HTTP request, Controller first checks the request’s
validity. An invalid request then will be rejected with an appropriate
response and status code. On the contrary, Controller forwards a valid request
payload to the Model Manager. The Model Manager will then accept the string,
invoke the inference function, and return the prediction result along with the
confidence score. Next, the Controller will wrap the results in a Python
`dictionary`, and it will convert it into a JSON-formatted response. The Model
Manager only loaded the ML model once when the Server was starting up. This
method allows the inference process to use the once-loaded model from memory.
Fig. 2 illustrates the complete process.

Figure 2: The interaction among Logstash, Inference Server, and ML model.

##  IV Results

Following prior work [12], in order to gauge the performance of our system,
our evaluation task is a span-based Question Answering task, where the context
is an array of utilities and the answer is the utility predicted by our model.
As shown in Table I, the proposed approach returns an accuracy of 89%
(F1-score) on the out-of-sample test set. The dual learning curves in Fig.3
suggest a good fit, with the training and validation loss ranging from 0.07 to
0.10.

TABLE I: GPT-2 Model Generated Results Epochs/Batch size | 2
---|---
Training Samples | 32801
Longest Token | 783
Validation samples | 3645
Overall time taken | 2:54
testing f1 score | 0,89827

Figure 3: Training loss and validation loss curves.

To evaluate the performance of the model at run-time, we configured
Elasticsearch to collect various metrics from our Cowrie instance. Performance
metrics are subsequently visualised in a Kibana dashboard shown in Fig. 4. The
explanation of each panel from the top left to bottom right is as follows:

  1. 1.

Top left: Top 20 usernames that the attackers have used.

  2. 2.

Top middle: Top 20 passwords that the attackers have used.

  3. 3.

Top right: Top 20 tools predicted from ML model. Inference result from
leveraging the ML model.

  4. 4.

Bottom left: Log volume per 12 hours bucket. Counted from each log stored in
Elasticsearch.

  5. 5.

Bottom right: Average, 95th and 99th percentiles of inference latency. 1 in
100 inference process could take up to 4 seconds. Blanks between the lines
indicate the temporary lack of attackers’ activities.

Figure 4: Kibana as the front-end supports various visualization types.

##  V Conclusion

In this paper, we present a prototype that leverages large pre-trained models
for parsing dynamic log-lines from a Cowrie SSH honeypot. Our experiments have
focused on parsing utilities and commands that are often abused by malware,
and have achieved good accuracy on out-of-sample validation set. Furthermore,
system metrics indicate an acceptable inference latency on run-time. The
simplicity of the proposed system and the rapid conversion of the GPT-2 model
on the specific domain can facilitate the adaptation of AI-driven solutions in
EDR and SIEM technologies.

## Acknowledgment

This research work has been financially supported by EU Horizon 2020 project
GLASS (959879), EU Horizon 2020 project IDUNN (101021911) and by Academy of
Finland 6Genesis Flagship (318927).

## References

  * [1] Sara Ayoubi, Noura Limam, Mohammad A. Salahuddin, Nashid Shahriar, Raouf Boutaba, Felipe Estrada-Solano, and Oscar M. Caicedo.  Machine learning for cognitive network management.  IEEE Communications Magazine, 56(1):158–165, 2018.
  * [2] Ivan Beschastnikh, Yuriy Brun, Sigurd Schneider, Michael Sloan, and Michael D. Ernst.  Leveraging existing instrumentation to automatically infer invariant-constrained models.  In ESEC/FSE 2011: The 8th joint meeting of the European Software Engineering Conference (ESEC) and the ACM SIGSOFT Symposium on the Foundations of Software Engineering (FSE), pages 267–277, Szeged, Hungary, September 2011.
  * [3] Warren Cabral, Craig Valli, Leslie Sikos, and Samuel Wakeling.  Review and analysis of cowrie artefacts and their potential to be used deceptively.  In 2019 International Conference on Computational Science and Computational Intelligence (CSCI), pages 166–171, 2019.
  * [4] Min Du, Feifei Li, Guineng Zheng, and Vivek Srikumar.  DeepLog: Anomaly Detection and Diagnosis from System Logs through Deep Learning, page 1285–1298.  Association for Computing Machinery, New York, NY, USA, 2017.
  * [5] Thomas Wolf et. al.  Transformers: State-of-the-art natural language processing.  In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing: System Demonstrations, pages 38–45, Online, October 2020. Association for Computational Linguistics.
  * [6] Woojin Paik et al.  Applying natural language processing (nlp) based metadata extraction to automatically acquire user preferences.  In Proceedings of the 1st International Conference on Knowledge Capture, K-CAP ’01, page 116–122, New York, NY, USA, 2001. Association for Computing Machinery.
  * [7] FastAPI.  Fastapi.
  * [8] Javier Franco, Ahmet Aris, Berk Canberk, and A Selcuk Uluagac.  A survey of honeypots and honeynets for internet of things, industrial internet of things, and cyber-physical systems.  arXiv preprint arXiv:2108.02287, 2021.
  * [9] Qiang Fu, Jian-Guang Lou, Yi Wang, and Jiang Li.  Execution anomaly detection in distributed systems through unstructured log analysis.  In 2009 Ninth IEEE International Conference on Data Mining, pages 149–158, 2009.
  * [10] Shilin He, Jieming Zhu, Pinjia He, and Michael R. Lyu.  Experience report: System log analysis for anomaly detection.  In 2016 IEEE 27th International Symposium on Software Reliability Engineering (ISSRE), pages 207–218, 2016.
  * [11] Shubham Jain, Amy de Buitléir, and Enda Fallon.  An extensible parsing pipeline for unstructured data processing.  In 2021 23rd International Conference on Advanced Communication Technology (ICACT), pages 312–318, 2021.
  * [12] Samuel Kierszbaum.  F1 score in nlp span-based question answering task, 2020.
  * [13] Panos Kostakos.  Strings and things: A semantic search engine for news quotes using named entity recognition.  In 2020 IEEE/ACM International Conference on Advances in Social Networks Analysis and Mining (ASONAM), pages 835–839. IEEE, 2020.
  * [14] OpenAI.  Better language models and their implications, 2019.
  * [15] Adam et. al. Paszke.  Pytorch: An imperative style, high-performance deep learning library.  In H. Wallach, H. Larochelle, A. Beygelzimer, F. d'Alché-Buc, E. Fox, and R. Garnett, editors, Advances in Neural Information Processing Systems 32, pages 8024–8035. Curran Associates, Inc., 2019.
  * [16] Alec Radford, Jeffrey Wu, Rewon Child, David Luan, Dario Amodei, Ilya Sutskever, et al.  Language models are unsupervised multitask learners.  OpenAI blog, 1(8):9, 2019.
  * [17] Sebastian Schreiber, Stefan Agne, Ivo Wolf, Andreas Dengel, and Sheraz Ahmed.  Deepdesrt: Deep learning for detection and structure recognition of tables in document images.  In 2017 14th IAPR International Conference on Document Analysis and Recognition (ICDAR), volume 01, pages 1162–1167, 2017.
  * [18] Urban Sedlar, Matej Kren, Leon Štefanič Južnič, and Mojca Volk.  Cyberlab honeynet dataset, February 2020.
  * [19] Weiyi Shang, Zhen Ming Jiang, Hadi Hemmati, Brain Adams, Ahmed E. Hassan, and Patrick Martin.  Assisting developers of big data analytics applications when deploying on hadoop clouds.  In 2013 35th International Conference on Software Engineering (ICSE), pages 402–411, 2013.
  * [20] L. Spitzner.  Honeypots: catching the insider threat.  In 19th Annual Computer Security Applications Conference, 2003. Proceedings., pages 170–179, 2003.
  * [21] Candace Suh-Lee.  Mining unstructured log messages for security threat detection.  2016\.
  * [22] Michail Tsikerdekis, Sherali Zeadally, Amy Schlesener, and Nicolas Sklavos.  Approaches for preventing honeypot detection and compromise.  In 2018 Global Information Infrastructure and Networking Symposium (GIIS), pages 1–6, 2018.
  * [23] R. Vaarandi.  A data clustering algorithm for mining patterns from event logs.  In Proceedings of the 3rd IEEE Workshop on IP Operations Management (IPOM 2003) (IEEE Cat. No.03EX764), pages 119–126, 2003.