1 Introduction

In 1944, Atle Selberg proved the following integral formula:

$$\begin{aligned}&\int _0^1\dots \int _0^1 \prod _{1\leqslant i<j\leqslant k} |x_i-x_j|^{2\gamma } \prod _{i=1}^kx_i^{\alpha -1} (1-x_i)^{\beta -1}\ dx_1\dots dx_k \nonumber \\&\quad = \prod _{j=1}^k \frac{\Gamma (1+j\gamma )}{\Gamma (1+\gamma )}\, \frac{\Gamma (\alpha +(j-1)\gamma )\,\Gamma (\beta +(j-1)\gamma )}{\Gamma (\alpha +\beta + (k+j-2)\gamma )}\,, \end{aligned}$$
(1.1)

where \(\alpha , \beta , \gamma \) are complex numbers such that \({\text {Re}} \alpha >0\), \({\text {Re}} \beta >0\), and \({\text {Re}} \gamma > - \min \,[({\text {Re}} \alpha )/(n-1){\text {Re}} \beta )/(n-1)]\). See [1, 22]. Hundreds of papers are devoted to the generalizations of the Selberg integral formula and its applications, see for example [1, 10] and references therein. There are q-analysis versions of the formula, the generalizations associated with Lie algebras, elliptic versions, finite field versions, see some references in [1, 2, 4, 5, 7, 8, 10,11,12, 17, 18, 24, 27, 28, 30, 38, 39]. In the finite field versions, one considers additive and multiplicative characters of a finite field, which map the field to the field of complex numbers, and forms an analog of equation (1.1), in which both sides are complex numbers. The simplest of such formulas is the classical relation between Jacobi and Gauss sums, see [1, 2, 7].

In [21], we suggested another version of the Selberg integral formula, in which the \({\mathbb {F}}_p\)-Selberg integral is an element of the finite field \({\mathbb {F}}_p\) with an odd prime number p of elements.

Our motivation in [21] came from the theory of Knizhnik–Zamolodchikov (KZ) equations, see [6, 13]. These are the systems of linear differential equations, satisfied by conformal blocks on the sphere in the WZW model of conformal field theory. The KZ equations were solved in multidimensional hypergeometric integrals in [25], see also [31, 32]. The following general principle was formulated in [16]: if an example of the KZ-type equations has a one-dimensional space of solutions, then the corresponding multidimensional hypergeometric integral can be evaluated explicitly. As an illustration of that principle in [16], an example of the \({\mathfrak {sl}_2}\) differential KZ equations with a one-dimensional space of solutions was considered, the corresponding multidimensional hypergeometric integral was reduced to the Selberg integral and then evaluated by formula (1.1). See other illustrations in [8, 9, 20, 27, 28, 30, 33].

Recently in [26], the KZ equations were considered modulo a prime number p and polynomial solutions of the reduced equations were constructed, see also [23, 33,34,35,36,37]. The construction is analogous to the construction of the multidimensional hypergeometric solutions, and the constructed polynomial solutions were called the \({\mathbb {F}}_p\)-hypergeometric solutions.

In [21], we considered the reduction modulo p of the same example of the \({\mathfrak {sl}_2}\) differential KZ equations, that led in [16] to the Selberg integral. We evaluated the corresponding \({\mathbb {F}}_p\)-hypergeometric solution by analogy with the evaluation of the Selberg integral and obtained the \({\mathbb {F}}_p\)-Selberg integral formula in [21, Theorem 4.1].

In [30, Theorem 3.3], the Selberg integral formula of type \(A_2\) was proposed and proved,

$$\begin{aligned}&\int _{C^{k_1,k_2}[0,1]} \prod _{i=1}^{k_1} t_i^{\alpha -1}(1-t_i)^{\beta _1-1}\, \prod _{j=1}^{k_2}(1-s_j)^{\beta _2-1} \,\prod _{i=1}^{k_1}\prod _{j=1}^{k_2} |s_j-t_i|^{-\gamma } \nonumber \\&\qquad \times \, \prod _{1\leqslant i<i'\leqslant k_1} |t_i-t_{i'}|^{2\gamma } \prod _{1\leqslant j<j'\leqslant k_2} |s_j-s_{j'}|^{2\gamma }\, dt_1\dots dt_{k_1}\,ds_1\dots ds_{k_2} \nonumber \\&\quad = \prod _{i=1}^{k_1-k_2} \frac{\Gamma (\beta _1+(i-1)\gamma )}{\Gamma (\alpha +\beta _1+(i+k_1-2)\gamma )} \nonumber \\&\qquad \times \, \prod _{i=1}^{k_2}\ \frac{\Gamma (\beta _2+(i-1)\gamma )}{\Gamma (1+\beta _2+(i+k_2-k_1-2)\gamma )}\, \ \frac{\Gamma (\beta _1+\beta _2+(i-2)\gamma )}{\Gamma (\alpha +\beta _1+\beta _2+(i+k_2-3)\gamma )} \nonumber \\&\qquad \times \ \prod _{i=1}^{k_2} \frac{\Gamma (1+(i-k_1-1)\gamma )\,\Gamma (i\gamma )}{\Gamma (\gamma )}\ \prod _{i=1}^{k_1} \frac{\Gamma (\alpha +(i-1)\gamma )\,\Gamma (i\gamma )}{\Gamma (\gamma )}\,. \end{aligned}$$
(1.2)

Here, \({\text {Re}} \alpha >0\), \({\text {Re}} \beta _1 > 0\), \({\text {Re}} \beta _2>0\), \({\text {Re}} \gamma <0\) and \(|{\text {Re}} \gamma |\) is sufficiently small. The integration cycle \(C^{k_1,k_2}[0,1]\) is defined in [30, Sect. 3], also see its definition in [10, 38, 39].

The starting point of this formula was an example of the joint system of the \({\mathfrak {sl}_3}\) trigonometric differential KZ equations and associated dynamical difference equations, an example in which the space of solutions is one-dimensional. The \(A_n\)-type Selberg integral formula for arbitrary n was obtained in [38, 39], see also [10].

In this paper, we consider the reduction modulo p of the same example of the joint system of the \(\mathfrak {sl}_{n+1}\) trigonometric differential KZ equations and associated dynamical difference equations, which led in [30, 38] to the \(A_n\)-type Selberg integral formula. Using the reduction modulo p of these differential and difference equations, we obtain our \(A_n\)-type \({\mathbb {F}}_p\)-Selberg integral formula for \(n\geqslant 1\), see (3.11). For \(n=1\), the formula is proved in [21, Theorem 4.1]. For \(n=2\), the formula is proved in Theorem 3.4 below. We sketch the proof of the formula for \(n>2\) in Sect. 5.4. The details of that sketch will appear elsewhere.

The paper is organized as follows. In Sect. 2, we collect useful facts. In Sect. 3, we introduce the notion of \({\mathbb {F}}_p\)-integral and discuss the integral formula for the \({\mathbb {F}}_p\)-beta integral. In Sect. 3, we define the \(A_n\)-type \({\mathbb {F}}_p\)-Selberg integral and present its evaluation formula. Theorem 3.4 states that the formula holds for \(n=2\). In Section 3, we also prove Theorem 3.7, which is used in the transition from the \(A_{n-1}\)-type formula to the \(A_n\)-type formula, in particular, in the transition from the known \(A_1\)-type formula to the new \(A_2\)-type formula. In Sect. 4, we sketch the proof of formula (1.2) following [30]. In Sect. 5, we adapt this proof to prove Theorem 3.4.

The authors thank I. Cherednik, P. Etingof, E. Rains for useful discussions.

2 Preliminary remarks

In this paper, p is an odd prime number.

2.1 Cancellation of factorials

Lemma 2.1

If ab are non-negative integers and \(a+b=p-1\), then in \({\mathbb {F}}_p\) we have

$$\begin{aligned} a!\,b!\,=\,(-1)^{a+1}\,. \end{aligned}$$
(2.1)

Proof

We have \(a!=(-1)^a(p-1)\dots (p-a)\) and \(p-a= b+1\). Hence, \(a!\,b! = (-1)^a(p-1)!= (-1)^{a+1}\) by Wilson’s Theorem. \(\square \)

2.2 Dyson’s formula

We shall use Dyson’s formula

$$\begin{aligned} {\text {C.T.}} \prod _{1\leqslant i<j\leqslant k}(1-x_i/x_j)^c (1-x_j/x_i)^c = \frac{(kc)!}{(c!)^k}\,, \end{aligned}$$
(2.2)

where C.T. denotes the constant term. See the formula in [1, Sect. 8.8].

2.3 \({\mathbb {F}}_p\)-Integrals

Let M be an \({\mathbb {F}}_p\)-module. Let \(P(x_1,\dots ,x_k)\) be a polynomial with coefficients in M,

$$\begin{aligned} P(x_1,\dots ,x_k) = \sum _{d}\, c_d \,x_1^{d_1}\dots x_k^{d_k}. \end{aligned}$$
(2.3)

Let \(l=(l_1,\dots ,l_k)\in {\mathbb {Z}}_{>0}^k\). The coefficient \(c_{l_1p-1,\dots ,l_kp-1}\) is called the \({\mathbb {F}}_p\)-integral over the p-cycle \([l_1,\dots ,l_k]_p\) and is denoted by \(\int _{[l_1,\dots ,l_k]_p} P(x_1,\dots ,x_k)\,dx_1\dots dx_k\).

Lemma 2.2

For \(i=1,\dots ,k-1\), we have

$$\begin{aligned}&\int _{[l_1,\dots ,l_{i+1}, l_i,\dots , l_k]_p} P(x_1,\dots ,x_{i+1},x_i,\dots ,x_k) dx_1\dots dx_k \nonumber \\&= \int _{[l_1,\dots ,l_k]_p} P(x_1,\dots ,x_k)\,dx_1\dots dx_k\,. \end{aligned}$$
(2.4)

\(\square \)

Lemma 2.3

For any \(i=1,\dots ,k\), we have

$$\begin{aligned} \int _{[l_1,\dots ,l_k]_p} \frac{\partial P}{\partial x_i}(x_1,\dots ,x_k)\,dx_1\dots dx_k = 0\,. \end{aligned}$$

\(\square \)

Let \(\varvec{k}=(k_1,\dots ,k_n) \in {\mathbb {Z}}^n_{> 0}\) and

$$\begin{aligned} {[}\varvec{k}]_p := [(1)_{k_1};(k_1)_{k_2};\dots ; (k_{n-1})_{k_{n}}]_p, \end{aligned}$$
(2.5)

where \(x_y\) denotes the y-tuple \((x,\dots ,x)\). For example for \(n=2\), \(\varvec{k}=(3,2)\), we have \([\varvec{k}]_p = [1,1,1;3,3]_p\).

2.4 \({\mathbb {F}}_p\)-Beta integral

For non-negative integers, the classical beta integral formula says

$$\begin{aligned} \int _{0}^{1} x^{a}(1-x)^{b} dx =\frac{a!\,b!}{(a+b+1)!}\,. \end{aligned}$$
(2.6)

Theorem 2.4

([37]) Let \(a<p\), \(b<p\), \(p-1\leqslant a+b\). Then, in \({\mathbb {F}}_p\) we have

$$\begin{aligned} \int _{[1]_p} x^a(1-x)^b dx\, = \, - \,\frac{a!\,b!}{(a+b+1-p)!}\,. \end{aligned}$$
(2.7)

If \(a+b<p-1\), then

$$\begin{aligned} \int _{[1]_p} x^a(1-x)^b dx\, = 0\,. \end{aligned}$$
(2.8)

3 \({\mathbb {F}}_p\)-Selberg integral of type \(A_n\)

3.1 Admissible parameters

Let \(\varvec{k}=(k_1,\dots ,k_n) \in {\mathbb {Z}}^n_{>0}\)  and  \(k_{i}> k_{i+1}\), \(i=1,\dots ,n-1\). Set \(k_0=k_{n+1}=0\).

Let \(a,b_1,\dots ,b_n,c\in {\mathbb {Z}}_{>0}\). Denote \(b=(b_1,\dots ,b_n)\) and

$$\begin{aligned}&R_{\varvec{k}} (a,b,c) = \nonumber \\&\quad = \prod _{1\leqslant s\leqslant r\leqslant n}\prod _{i=1}^{k_r-k_{r+1}} \frac{(r-s + b_s+\dots +b_r + (i+s-r-1)c)!}{(r-s+1 + a_s+b_s+\dots +b_r + (i+s-r+k_s-k_{s-1}-2)c-\delta _{s,1}p)!} \nonumber \\&\qquad \times \ (-1)^{\sum _{i=1}^nk_i} \Big (\prod _{i=1}^{k_1}(a_1+(i-1)c)!\Big ) \Big (\prod _{r=1}^{n}\prod _{i=1}^{k_r} \frac{(ic)!}{c!}\Big ) \Big (\prod _{r=2}^{n}\prod _{i=1}^{k_r} (p+(i-k_{r-1}-1)c)! \Big ), \end{aligned}$$
(3.1)

where \(a_1=a\),  \(a_2=\dots =a_{n} =0\)\(\delta _{s,1}\) is 1 if \(s=1\) and is zero otherwise.

We say that \(a,b_1,\dots ,b_n,c\in {\mathbb {Z}}_{>0}\) are admissible if \(a+(k_1-1)c < p-1\) and for any factorial x! on the right-hand side of (3.1) we have \(0\leqslant x<p\). The set of all admissible (abc) is denoted by \(\mathcal A_{\varvec{k}}\).

Lemma 3.1

The set \(\mathcal A_{\varvec{k}}\) is defined in \({\mathbb {Z}}_{> 0}^{n+2}\) by the following system of inequalities:

$$\begin{aligned}&0\leqslant r-s + b_s+\dots +b_r + (s-r)c, \nonumber \\&r-s + b_s+\dots +b_r + (k_r-k_{r+1}+s-r-1)c\leqslant p-1, \end{aligned}$$
(3.2)

for \(1\leqslant s\leqslant r\leqslant n\);

$$\begin{aligned}&0\leqslant r-s +1+b_s+\dots +b_r + (s-r+k_s-k_{s-1}-1)c, \nonumber \\&r-s+1 +b_s+\dots +b_r + (s-r+k_r-k_{r+1}+k_s-k_{s-1}-2)c\leqslant p-1,\nonumber \\ \end{aligned}$$
(3.3)

for \(2\leqslant s\leqslant r\leqslant n\);

$$\begin{aligned}&p\leqslant r +a+b_1+\dots +b_r + (k_{1} - r)c, \nonumber \\&r +a+b_1+\dots +b_r + (k_r-k_{r+1}+k_{1}-r-1)c < 2p, \end{aligned}$$
(3.4)

for \(1\leqslant r\leqslant n\);

$$\begin{aligned} a+(k_1-1)c< p-1,\quad b_1\geqslant p-1-(a+(k_1-1)c), \quad 0< k_1c < p\,. \end{aligned}$$
(3.5)

\(\square \)

Lemma 3.2

Assume that \((a,b,c) \in \mathcal A_{\varvec{k}}\). Then,

$$\begin{aligned} b_1\geqslant p-1-(a+(k_1-1)c), \qquad b_s\geqslant (k_{s-1} - k_s+1)c-1, \quad s=2,\dots ,n.\nonumber \\ \end{aligned}$$
(3.6)

Proof

The inequality \(b_s\geqslant (k_{s-1} - k_s+1)c-1\) for \(s=2,\dots ,n\) follows from the first inequality in (3.3) for \(r=s\). The inequality \(b_1\geqslant p-1-(a+(k_1-1)c)\) follows from the first inequality in (3.4) for \(r=1\). \(\square \)

Example

Let \(n=1\), \(\varvec{k} =(k_1)\). Then,

$$\begin{aligned} R_{(k_1)} (a,b_1,c) = \prod _{i=1}^{k_1} \frac{(ic)!}{c!}\, \frac{(a+(i-1)c)!\, (b_1+ (i-1)c)!}{(1 + a+b_1 + (i+k_1-2)c-p)!} \end{aligned}$$
(3.7)

and \(\mathcal A_{(k_1)}\) consists of \(a,b, c\in {\mathbb {Z}}_{>0}\) such that

$$\begin{aligned}&a+(k_1-1)c< p-1, \qquad \qquad b_1+(k_1-1)c \leqslant p-1,\qquad k_1c\,\leqslant \,p-1, \nonumber \\&p-1\leqslant a+b_1+(k_1-1)c, \qquad a+b_1+(2k_1-2)c < 2p-1\ . \end{aligned}$$
(3.8)

3.2 Main result

Given \(\varvec{k}=(k_1,\dots ,k_n) \in {\mathbb {Z}}^n_{> 0}\) introduce \(k_1+\dots +k_n\) variables

$$\begin{aligned} t=(t^{(1)}, \dots ,t^{(n)}), \quad {\text {where}}\quad t^{(i)} = (t^{(i)}_1,\dots , t^{(i)}_{k_i}), \quad \, i=1,\dots ,n. \end{aligned}$$
(3.9)

Define the master polynomial

$$\begin{aligned} \Phi _{\varvec{k}}(t; a,b,c)= & {} \prod _{i=1}^n\Big ( \prod _{j=1}^{k_i} (t^{(i)}_j)^{a_i}(1-t^{(i)}_j)^{b_i} \prod _{1\leqslant j<j'\leqslant k_i}(t^{(i)}_{j} -t^{(i)}_{j'})^{2c}\Big ) \\&\prod _{i=1}^{n-1} \prod _{j=1}^{k_{i+1}}\prod _{j'=1}^{k_{i}} (t^{(i+1)}_{j} - t^{(i)}_{j'})^{p-c}\,. \end{aligned}$$

Denote

$$\begin{aligned} S_{\varvec{k}}(a,b,c) = \int _{[\varvec{k}]_p} \Phi _{\varvec{k}}\,d t\, . \end{aligned}$$
(3.10)

The \({\mathbb {F}}_p\)-integral \(S_{\varvec{k}}(a,b,c) \) is called the \({\mathbb {F}}_p\) -Selberg integral of type \(A_n\).

Conjecture 3.3

Let n be a positive integer. Let \(\varvec{k}=(k_1,\dots ,k_n) \in {\mathbb {Z}}^n_{>0}\) ,  \(k_{i}> k_{i+1}\), \(i=1,\dots ,n-1\). Then, for any \((a,b,c) \in \mathcal A_{\varvec{k}}\) we have the equality in \({\mathbb {F}}_p\):

$$\begin{aligned} S_{\varvec{k}}(a,b,c)\, = \,R_{\varvec{k}}(a,b,c)\,. \end{aligned}$$
(3.11)

For \(n=1\), formula (3.11) is proved in [21, Theorem 4.1]. For \(n=2\), formula (3.11) is proved in the next theorem.

Theorem 3.4

Let \(\varvec{k}=(k_1,k_2) \in {\mathbb {Z}}^2_{>0}\) ,  \(k_{1}> k_{2}\). Then, for any \((a,b,c) \in \mathcal A_{\varvec{k}}\) we have the equality in \({\mathbb {F}}_p\):

$$\begin{aligned} S_{\varvec{k}}(a,b,c)\, = \,R_{\varvec{k}}(a,b,c)\,. \end{aligned}$$
(3.12)

Formula (3.11) for \(n=2\) is deduced from formula (3.11) for \(n=1\) in Section 5.

More generally, for any k formula (3.11) for \(n=k\) can be deduced from formula (3.11) for \(n=k-1\) similarly, see the sketch of that in Sect. 5.4. Details of that deduction will appear elsewhere. Because of that formula (3.11) for any n is formulated as a conjecture and not as a theorem.

Remark

Theorem 3.4 can be extended to the case of \(\varvec{k}\) such that \(k_{1}\geqslant k_{2}\), but the structure of inequalities in Lemma 3.1 will depend on the appearance of the equality \(k_{1} = k_{2}\) in \(\varvec{k}\), and the proof of Theorem 3.4 will split into different sub-cases. To shorten the exposition, we restrict ourselves to \(\varvec{k}\) such that \(k_1>k_{2}\).

Example

Here is the simplest \(A_2\)-type \({\mathbb {F}}_p\)-Selberg integral formula with \(k_1=k_2=1\).

Theorem 3.5

Assume that \(a,b_1,b_2, c\) are integers such that

$$\begin{aligned}&0\leqslant a<p, \quad 0< c\leqslant p,\quad 0\leqslant b_2-c+1<p, \\&0\leqslant b_1+b_2-c+1<p, \quad p-1\leqslant a+b_1+b_2 -c +1< 2p-1. \end{aligned}$$

Then, in \({\mathbb {F}}_p\) we have

$$\begin{aligned}&\int _{[1;1]_p} t^{a}(1-t)^{b_1}(s-t)^{p-c} (1-s)^{b_2} dt\,ds \nonumber \\&\quad = \ \frac{a!\,(b_1+b_2-c+1)!}{(a+b_1+b_2-c+2-p)!}\, \frac{(p-c)!\,(b_2)!}{(b_2-c+1)!}\,. \end{aligned}$$
(3.13)

Proof

Change variables \(s=t+(1-t)v\), then the \({\mathbb {F}}_p\)-integral becomes equal to

$$\begin{aligned} \int _{[1,1]_p} t^{a}(1-t)^{b_1+b_2-c+1} v^{p-c} (1-v)^{b_2} dt\,dv . \end{aligned}$$

Applying the \({\mathbb {F}}_p\)-beta integral formula, we obtain the theorem. \(\square \)

The simplest \(A_3\)-type \({\mathbb {F}}_p\)-Selberg integral formula \(k_1=k_2=k_3=1\) is given by the next theorem.

Theorem 3.6

Let \(a,b_1,b_2,b_3,c\) be integers such that all factorials on the right-hand side of formula (3.14) are factorials of non-negative integers less than p. Then, in \({\mathbb {F}}_p\) we have

$$\begin{aligned}&\int _{[1;1;1]_p} t^{a}(1-t)^{b_1}(s-t)^{p-c} (1-s)^{b_2}(u-s)^{p-c} (1-u)^{b_2} dt\,ds\,du \nonumber \\&\quad = - \frac{a!\,(b_1+b_2+b_3-2c+2)!}{(a+b_1+b_2+b_3-2c+3-p)!}\, \frac{(p-c)!\,(b_2+b_3-c+1)!}{(b_2+b_3-2c+2)!}\, \frac{(p-c)!\,(b_3)!}{(b_3-c+1)!}\,.\nonumber \\ \end{aligned}$$
(3.14)

Proof

The proof is the same as the proof of the previous theorem. \(\square \)

The versions of identities (3.13), (3.14) over complex numbers see in [16, Theorem 1].

3.3 Relation between the \({\mathbb {F}}_p\)-Selberg integrals of types \(A_{n-1}\) and \(A_n\)

Theorem 3.7

Let \(n>1\) and \(\varvec{k}=(k_1,\dots ,k_n)\), \(\varvec{k}'=(k_1,\dots ,k_{n-1})\), \(b=(b_1,\dots ,b_n)\), \(b'=(b_1,\dots ,b_{n-1})\). Assume that formula (3.11) holds for the \({\mathbb {F}}_p\)-Selberg integral \(S_{[\varvec{k}']_p}(a,b',c)\) of type \(A_{n-1}\). Also assume that \(b_n=(k_{n-1}-k_n+1)c-1\). Then, formula (3.11) holds for the \({\mathbb {F}}_p\)-Selberg integral \(S_{[\varvec{k}]_p}(a,b,c)\) of type \(A_{n}\).

Proof

Under the assumption \(b_n=(k_{n-1}-k_n+1)c-1\), all variables \((t^{(n)}_j)\) in \(\Phi _{[\varvec{k}]_p}(\varvec{t};a,b,c)\) are used to reach the monomial \(\prod _{j=1}^{k_n} (t^{(n)}_j)^{k_{n-1}p-1}\) in the calculation of the \({\mathbb {F}}_p\)-integral \(S_{[\varvec{k}]_p}(a,b,c)\). The remaining free variables \((t^{(i)}_j)\) with \(i<n\) all belong to the factor

\(\Phi _{[\varvec{k}']_p}(t^{(1)},\dots ,t^{(n-1)};a,b',c)\) of \(\Phi _{[\varvec{k}]_p}(\varvec{t};a,b,c)\) and are used to calculate the coefficient of \(\prod _{j=1}^{k_1} (t^{(1)}_j)^{p-1}\prod _{i=2}^{n-1}\prod _{j=1}^{k_i} (t^{(i)}_j)^{k_{i-1}p-1}\).

More precisely, under the assumptions of the theorem we have

$$\begin{aligned}&S_{\varvec{k}}(a,b,c) = (-1)^{b_nk_n+ck_n(k_n-1)/2}\frac{(k_nc)!}{(c!)^{k_n}} \,S_{\varvec{k}'}(a',b',c), \end{aligned}$$

where \( (-1)^{b_nk_n+ck_n(k_n-1)/2}\frac{(k_nc)!}{(c!)^{k_n}}\) is the coefficient of \(\prod _{j=1}^{k_n} (t^{(n)}_j)^{k_{n-1}p-1}\) in the expansion of

$$\begin{aligned} \prod _{j=1}^{k_n} \prod _{j'=1}^{k_{n-1}} (t^{(n)}_j - t^{(n-1)}_{j'})^{p-c} \prod _{1\leqslant j<j'\leqslant k_n}(t^{(n)}_j -t^{(n)}_{j'})^{2c} \,, \end{aligned}$$

see Dyson’s formula. We have \( (-1)^{b_nk_n+ck_n(k_n-1)/2} = (-1)^{ (k_{n-1}k_n-k_n(k_n+1)/2)c-k_n}\). Hence,

$$\begin{aligned} S_{\varvec{k}}(a,b,c)= & {} (-1)^{ (k_{n-1}k_n-k_n(k_n+1)/2)c-k_n}\frac{(k_nc)!}{(c!)^{k_n}} \,S_{\varvec{k}'}(a,b',c) \\= & {} (-1)^{ (k_{n-1}k_n-k_n(k_n+1)/2)c-k_n}\frac{(k_nc)!}{(c!)^{k_n}} \,R_{\varvec{k}'}(a,b',c)\,, \end{aligned}$$

where \(S_{\varvec{k}'}(a,b',c) = R_{\varvec{k}'}(a,b',c)\) holds by assumptions. To prove the theorem, we need to show that

$$\begin{aligned} R_{[\varvec{k}]_p}(a, (b',b_n),c) = (-1)^{ (k_{n-1}k_n-k_n(k_n+1)/2)c-k_n}\frac{(k_nc)!}{(c!)^{k_n}} \,R_{\varvec{k}'}(a,b',c)\,. \end{aligned}$$

Indeed, we have

$$\begin{aligned}&R_{\varvec{k}}(a,(b',b_n),c) = \,R_{\varvec{k}'}(a,b',c)\, \prod _{i=1}^{k_n} \frac{(ic)!}{c!} \prod _{i=1}^{k_n} (p+(i-k_{n-1}-1)c)! \\&\qquad \times \prod _{1\leqslant s\leqslant n}\prod _{i=1}^{k_n} \frac{(n-s + b_s+\dots +b_n + (i+s-n-1)c)!}{(n-s+1 + a_s+b_s+\dots +b_n + (i+s-n+k_s-k_{s-1}-2)c-\delta _{s,1}p)!} \\&\qquad \times \prod _{1\leqslant s\leqslant n-1}\prod _{i=1}^{k_{n}} \frac{(n-s + a_s+b_s+\dots +b_{n-1} + (i+s-n+k_s-k_{s-1}-3)c-\delta _{s,1}p)!}{(n-1-s + b_s+\dots +b_{n-1} + (i+s-r-1)c)!} \\&\quad = \,R_{\varvec{k}'}(a,b',c)\, \prod _{i=1}^{k_n} \frac{(ic)!}{c!} \,\prod _{i=1}^{k_n} \frac{( b_n + (i-1)c)!\,(p+(i-k_{n-1}-1)c)!}{(1 +b_n + (i+k_n-k_{n-1}-2)c)!}\,. \\&\quad = \,R_{\varvec{k}'}(a,b',c)\, \prod _{i=1}^{k_n} \frac{(ic)!}{c!} \,\prod _{i=1}^{k_n} \frac{( (i+k_{n-1}-k_n)c-1)!\,(p+(i-k_{n-1}-1)c)!}{((i-1)c))!}\,. \\&\quad = \,R_{\varvec{k}'}(a,b',c)\, (-1)^{ (k_{n-1}k_n-k_n(k_n+1)/2)c-k_n} \frac{(k_nc)!}{(c!)^{k_n}}\,, \end{aligned}$$

where in the last step we use the cancellation Lemma 2.1. The theorem is proved. \(\square \)

Corollary 3.8

Let \(n>1\), \(\varvec{k}=(k_1,\dots ,k_n)\), and \((a,b_1,c) \in \mathcal A_{(k_1)}\). Let \(b=(b_1,\dots ,b_n)\), where \(b_i=(k_{i-1}-k_i+1)c-1\) for \(i=2,\dots ,n\). Then, formula (3.11) holds for the \({\mathbb {F}}_p\)-Selberg integral \(S_{[\varvec{k}]_p}(a,b,c)\) of type \(A_{n}\).

Proof

Formula (3.11) for the \({\mathbb {F}}_p\)-Selberg integrals of type \(A_1\) is proved in [21]. Hence, the corollary follows from Theorem 3.7 by induction on n. \(\square \)

4 The \(A_2\)-type Selberg integral over \({\mathbb {C}}\)

In this section, we formulate the \(A_2\)-type Selberg integral formula over \({\mathbb {C}}\), formulated and proved in [30], and sketch the proof of the formula, following [30]. In Sect. 5, we adapt this proof to prove the \(A_2\)-type \({\mathbb {F}}_p\)-Selberg integral formula, that is, formula (3.11) for \(n=2\).

4.1 The \(A_2\)-formula over \({\mathbb {C}}\)

For \(k_1\geqslant k_2\geqslant 0\), let \(t=(t_1,\dots ,t_{k_1})\), \(s=(s_1,\dots ,s_{k_2})\). Define the master function

$$\begin{aligned}&\Phi (t;s) = \prod _{i=1}^{k_1} t_i^{\alpha -1}(1-t_i)^{\beta _1-1}\, \prod _{j=1}^{k_2}(1-s_j)^{\beta _2-1} \,\prod _{i=1}^{k_1}\prod _{j=1}^{k_2} |s_j-t_i|^{-\gamma } \nonumber \\&\qquad \times \, \prod _{1\leqslant i<i'\leqslant k_1} |t_i-t_{i'}|^{2\gamma } \prod _{1\leqslant j<j'\leqslant k_2} |s_j-s_{j'}|^{2\gamma }\, \end{aligned}$$
(4.1)

and the integral

$$\begin{aligned} \tilde{S}(\alpha ,\beta _1,\beta _2,\gamma ) = \int _{C^{k_1,k_2}[0,1]}\, \Phi (t;s)\,dt\,ds\,, \end{aligned}$$
(4.2)

where the integration cycle \(C^{k_1,k_2}[0,1]\) is defined in [30, Section 3]. The explicit description of this cycle is of no importance in this paper.

Theorem 4.1

([30, Theorem 3.3]) Let \(\alpha ,\beta _1,\beta _2,\gamma \) be complex numbers such that \({\text {Re}} \alpha>0,\,{\text {Re}} \beta _1>0,\,{\text {Re}} \beta _2 > 0\), \({\text {Re}} \gamma <0\) and \(|{\text {Re}} \gamma |\) sufficiently small. Then,

$$\begin{aligned}&\tilde{S}(\alpha ,\beta _1,\beta _2,\gamma ) = \prod _{i=1}^{k_1-k_2} \frac{\Gamma (\beta _1+(i-1)\gamma )}{\Gamma (\alpha +\beta _1+(i+k_1-2)\gamma )} \nonumber \\&\qquad \times \, \prod _{i=1}^{k_2}\ \frac{\Gamma (\beta _2+(i-1)\gamma )}{\Gamma (1+\beta _2+(i+k_2-k_1-2)\gamma )}\, \ \frac{\Gamma (\beta _1+\beta _2+(i-2)\gamma )}{\Gamma (\alpha +\beta _1+\beta _2+(i+k_2-3)\gamma )} \nonumber \\&\qquad \times \ \prod _{i=1}^{k_2} \frac{\Gamma (1+(i-k_1-1)\gamma )\,\Gamma (i\gamma )}{\Gamma (\gamma )}\ \prod _{i=1}^{k_1} \frac{\Gamma (\alpha +(i-1)\gamma )\,\Gamma (i\gamma )}{\Gamma (\gamma )}\,. \end{aligned}$$
(4.3)

In the next Sect. 4.2, 4.3, we sketch the proof of formula (4.3) following [30].

4.2 Weight functions

To evaluate \(\tilde{S}(\alpha ,\beta _1,\beta _2,\gamma )\), we introduce a collection of new integrals \(J_{l_1,l_2,m}(\alpha ,\beta _1,\beta _2,\gamma )\), which also can be evaluated explicitly, see [30].

For a function \(f(t_1,\dots ,t_k)\) set

$$\begin{aligned} {\text {Sym}}_{t_1,\dots ,t_k} f(t_1,\dots ,t_k)\, =\,\frac{1}{k!}\, \sum _{\sigma \in S_k} f(t_{\sigma _1},\dots , t_{\sigma _k})\,. \end{aligned}$$

Given \(k_1\geqslant k_2\geqslant 0\), we say that a triple of non-negative integers \((l_1,l_2, m)\) is allowable if \(l_1\leqslant k_1-k_2+l_2, \,\,l_2\leqslant k_2\) and \(m\leqslant {\text {min}}(l_1,l_2)\). For any allowable triple \((l_1 , l_2 , m)\) define the weight function

$$\begin{aligned}&W_{l_1,l_2,m}(t_1,\dots ,t_{k_1};s_1,\dots ,s_{k_2}) = \\&\quad =\,{\text {Sym}}_{t_1,\dots ,t_{k_1}}{\text {Sym}}_{s_1,\dots ,s_{k_2}}\\&\qquad \times \Big ( \prod _{a=1}^{l_1} t_a\prod _{a=l_1+1}^{k_1}(1-t_a) \prod _{b=1}^m\frac{1-s_b}{s_b-t_b}\prod _{b=l_2+1}^{k_2}\frac{1-s_b}{s_b-t_{b+k_1-k_2}}\Big ) \end{aligned}$$

and the integral

$$\begin{aligned} J_{l_1,l_2,m}(\alpha ,\beta _1,\beta _2,\gamma ) = \int _{C^{k_1,k_2}[0,1]}\, \Phi (t;s)\, W_{l_1,l_2,m}(t;s)\,dt\,ds\,. \end{aligned}$$

In particular,

$$\begin{aligned} J_{0,k_2,0}(\alpha ,\beta _1,\beta _2,\gamma ) = \tilde{S}(\alpha ,\beta _1+1,\beta _2,\gamma ). \end{aligned}$$
(4.4)

4.3 Representations of \({\mathfrak {sl}_3}\)

Consider the complex Lie algebra \({\mathfrak {sl}_3}\) with standard generators \(f_1,f_2, e_1,e_2,h_1,h_2\), simple roots \(\sigma _1,\,\sigma _2\), fundamental weights \(\omega _1,\,\omega _2\). Let \(V_{\lambda _1}\), \(V_{\lambda _2}\) be the irreducible \({\mathfrak {sl}_3}\)-modules with highest weights

$$\begin{aligned} \lambda _1= -\frac{\alpha }{\gamma }\,\omega _1 \,, \qquad \lambda _2= -\frac{\beta _1}{\gamma }\,\omega _1 - \frac{\beta _2}{\gamma }\,\omega _2 \, \end{aligned}$$

and highest weight vectors \(v_1,\,v_2\). For \(k_1\geqslant k_2\geqslant 0\), consider the weight subspace

\(V_{\lambda _1}\otimes V_{\lambda _2}[\lambda _1+\lambda _2-k_1\sigma _1-k_2\sigma _2]\) of the tensor product \(V_{\lambda _1}\otimes V_{\lambda _2}\) and the singular weight subspace \({{\text {Sing}}}\, V_{\lambda _1}\otimes V_{\lambda _2}[\lambda _1+\lambda _2-k_1\sigma _1-k_2\sigma _2]\) consisting of the vectors \(w\in V_{\lambda _1}\otimes V_{\lambda _2}[\lambda _1+\lambda _2-k_1\sigma _1-k_2\sigma _2]\) such that \(e_1w=0\), \(e_2 w=0\). A basis of \(V_{\lambda _1}\otimes V_{\lambda _2}[\lambda _1+\lambda _2-k_1\sigma _1-k_2\sigma _2]\) is formed by the vectors

$$\begin{aligned} v_{l_1,l_2,m} = \frac{f_1^{k_1-k_2-l_1+l_2}[f_1,f_2]^{k_2-l_2}v_1\otimes f_1^{l_1-m}[f_1,f_2]^{m}f_2^{l_2-m}v_2}{(k_1-k_2-l_1+l_2)!\,(k_2-l_2)!\,(l_1-m)!\,m!\,(l_2-m)!} \end{aligned}$$

labeled by allowable triples \((l_1,l_2,m)\). It is known from the theory of KZ equations that the vector

$$\begin{aligned} J = \sum _{l_1,l_2,m} (-1)^{l_1} J_{l_1,l_2,m} (\alpha ,\beta _1,\beta _2,\gamma )\, v_{l_1,l_2,m} \end{aligned}$$

is a singular vector, see [14, Theorem 2.4], [15, Corollary 10.3], cf. [19].

The singular vector equations \(e_1J=0, \,e_2J=0\) are calculated with the help of the formulas:

$$\begin{aligned}&h_1 v_1 = -\frac{\alpha }{\gamma }\,v_1,\qquad h_2 v_1 = 0, \qquad \\&h_1 v_2 = -\frac{\beta _1}{\gamma }\,v_2,\qquad h_2 v_2 = -\frac{\beta _2}{\gamma }\,v_2\,, \\&{[}h_1,f_1]=-2f_1,\quad \ [h_1,f_2]=f_2, \quad [h_2,f_1]=f_1, \quad \ \ \ \ \ \ [h_2,f_2]=-2f_2, \\&{[}e_1,f_1]=h_1, \qquad \ \ \ \ \ [e_1,f_2]\ =\ [e_2,f_1]\ =\ 0,\qquad \ \ \ \ \ [e_2,f_2]=h_2, \\&{[}h_1,[f_1,f_2]]=-[f_1,f_2], \quad [h_2,[f_1,f_2]]=-[f_1,f_2], \\&{[}e_1,[f_1,f_2]]=f_2, \quad [e_2,[f_1,f_2]]=-f_1. \end{aligned}$$

Here are some of the singular vector relations.

Theorem 4.2

(cf. [30, Theorem 5.2]) We have

$$\begin{aligned} J_{0,l_2,0} = (-1)^{l_2}J_{0,0,0}\prod _{i=0}^{l_2-1} \frac{(k_1-k_2+i+1)\gamma }{\beta _2+i\gamma }\,. \end{aligned}$$
(4.5)

Proof

We have

$$\begin{aligned}&e_2 \frac{f_1^{k_1-k_2+i}[f_1,f_2]^{k_2-i}v_1\otimes f_2^{i}v_2}{(k_1-k_2+i)!\,(k_2-i)!\,i!} \\&\quad = - (k_1-k_2+i+1) \frac{f_1^{k_1-k_2+i+1}[f_1,f_2]^{k_2-i-1}v_1\otimes f_2^{i}v_2}{(k_1-k_2+i+1)!\,(k_2-i-1)!\,i!} \\&\qquad + \Big (-\frac{\beta _2}{\gamma } - i+1\Big ) \frac{f_1^{k_1-k_2+i}[f_1,f_2]^{k_2-i}v_1\otimes f_2^{i-1}v_2}{(k_1-k_2+i)!\,(k_2-i)!\,(i-1)!} \,. \end{aligned}$$

Calculating the coefficient of \(\frac{f_1^{k_1-k_2+i+1}[f_1,f_2]^{k_2-i-1}v_1\otimes f_2^{i}v_2}{(k_1-k_2+i)!\,(k_2-i)!\,i!}\) in \(e_2J=0\), we obtain

$$\begin{aligned} (k_1-k_2+i+1)\gamma \,J_{0,i,0} + (\beta _2 +i\gamma )\,J_{0,i+1,0} = 0. \end{aligned}$$
(4.6)

This implies the theorem. \(\square \)

Hence,

$$\begin{aligned} J_{0,k_2,0}(\alpha ,\beta _1,\beta _2,\gamma ) =(-1)^{k_2} J_{0,0,0}(\alpha ,\beta _1,\beta _2,\gamma ) \prod _{i=0}^{k_2-1} \frac{(k_1-k_2+i+1)\gamma }{\beta _2+i\gamma }\,.\quad \end{aligned}$$
(4.7)

Combining (4.4) and (4.7), we observe that formula (4.3) is equivalent to the formula

$$\begin{aligned}&J_{0,0,0}(\alpha ,\beta _1,\beta _2,\gamma ) = \prod _{i=1}^{k_1-k_2} \frac{\Gamma (1+\beta _1+(i-1)\gamma )}{\Gamma (1+\alpha +\beta _1+(i+k_1-2)\gamma )} \nonumber \\&\qquad \times \, \prod _{i=1}^{k_2}\ \frac{\Gamma (1+\beta _2+(i-1)\gamma )}{\Gamma (1+\beta _2+(i+k_2-k_1-2)\gamma )}\, \ \frac{\Gamma (1+\beta _1+\beta _2+(i-2)\gamma )}{\Gamma (1+\alpha +\beta _1+\beta _2+(i+k_2-3)\gamma )} \nonumber \\&\qquad \times \ \prod _{i=1}^{k_2} \frac{\Gamma ((i-k_1-1)\gamma )\,\Gamma (i\gamma )}{\Gamma (\gamma )}\ \prod _{i=1}^{k_1} \frac{\Gamma (\alpha +(i-1)\gamma )\,\Gamma (i\gamma )}{\Gamma (\gamma )}\,. \end{aligned}$$
(4.8)

Denote by \(R_{0,0,0}(\alpha ,\beta _1,\beta _2,\gamma )\) the right-hand side of (4.8).

To prove (4.8), we use the following observation. The weight subspace \(V_{\lambda _1}[\lambda _1-k_1\sigma _1-k_2\sigma _2]\subset V_{\lambda _1}\) is one-dimensional with a basis vector

$$\begin{aligned} v_{0,0,0}\,=\, \frac{f_1^{k_1-k_2}[f_1,f_2]^{k_2}v_1\otimes v_2}{(k_1-k_2)!\,(k_2)!} \,. \end{aligned}$$

By [15, Theorem 5.1], the vector-valued function \(J_{0,0,0}(\alpha ,\beta _1,\beta _2,\gamma ) v_{0,0,0}\) satisfies the dynamical difference equations introduced in [29],

$$\begin{aligned}&J_{0,0,0}(\alpha ,\beta _1-1,\beta _2,\gamma ) v_{0,0,0} = J_{0,0,0}(\alpha ,\beta _1,\beta _2,\gamma ) \,\mathbb B_1 v_{0,0,0}\,, \end{aligned}$$
(4.9)
$$\begin{aligned}&J_{0,0,0}(\alpha ,\beta _1,\beta _2-1,\gamma ) v_{0,0,0} = J_{0,0,0}(\alpha ,\beta _1,\beta _2,\gamma )\, \mathbb B_2 v_{0,0,0}\,. \end{aligned}$$
(4.10)

Here, \(\mathbb B_1,\,\mathbb B_2\) are certain linear operators acting on \(V_{\lambda _1}\) and preserving the weight decomposition of \(V_{\lambda _1}\), see formulas for these operators in the example in [15, Sect. 7.1] and in [15, Sect. 3.1], also see [29, Formula (8)].

Written explicitly equations (4.9), (4.10) give us the difference equations for the scalar function \(J_{0,0,0}(\alpha ,\beta _1,\beta _2,\gamma )\) with respect to the shift of the variables \(\beta _1 \rightarrow \beta _1-1\) and \(\beta _2 \rightarrow \beta _2-1\),

$$\begin{aligned}&J_{0,0,0}(\alpha ,\beta _1-1,\beta _2,\gamma ) = J_{0,0,0}(\alpha ,\beta _1,\beta _2,\gamma ) \, \prod _{i=1}^{k_1-k_2} \frac{\alpha +\beta _1+(i+k_1-2)\gamma }{\beta _1+(i-1)\gamma } \nonumber \\&\qquad \times \, \prod _{i=1}^{k_2}\ \frac{\alpha +\beta _1+\beta _2+(i+k_2-3)\gamma }{\beta _1+\beta _2+(i-2)\gamma } \,, \end{aligned}$$
(4.11)
$$\begin{aligned}&J_{0,0,0}(\alpha ,\beta _1,\beta _2-1,\gamma ) = J_{0,0,0}(\alpha ,\beta _1,\beta _2,\gamma )\, \nonumber \\&\qquad \times \, \prod _{i=1}^{k_2}\ \frac{\beta _2+(i+k_2-k_1-2)\gamma }{\beta _2+(i-1)\gamma }\ \frac{\alpha +\beta _1+\beta _2+(i+k_2-3)\gamma }{\beta _1+\beta _2+(i-2)\gamma } \,. \end{aligned}$$
(4.12)

The difference equations for \( J_{0,0,0}(\alpha ,\beta _1,\beta _2,\gamma )\, \) are the same as the difference equations for the function \(R_{0,0,0}(\alpha ,\beta _1,\beta _2,\gamma )\) with respect to the shift of the variables \(\beta _1 \rightarrow \beta _1-1\) and \(\beta _2 \rightarrow \beta _2-1\). Therefore, the functions \(J_{0,0,0}(\alpha ,\beta _1,\beta _2,\gamma )\) and \(R_{0,0,0}(\alpha ,\beta _1,\beta _2,\gamma )\) are proportional up to a periodic function of \(\beta _1,\beta _2\). The periodic function can be fixed by comparing asymptotics as \({\text {Re}} \beta _1 \rightarrow \infty \), \({\text {Re}} \beta _2 \rightarrow \infty \). This finishes the proof in [30] of formulas (4.8) and (4.3).

5 The \(A_2\)-type Selberg integrals over \({\mathbb {F}}_p\)

5.1 Relations between \({\mathbb {F}}_p\)-integrals

For \(\varvec{k}=(k_1,k_2)\), \(k_1> k_2> 0\) and integers

\(0\,<\,a,b_1,b_2,c\,<\,p\) define the master polynomial

$$\begin{aligned}&\Phi _{\varvec{k}}(t;s; a,b_1,b_2,c) = \prod _{i=1}^{k_1} t_i^{a}(1-t_i)^{b_1}\, \prod _{j=1}^{k_2}(1-s_j)^{b_2} \,\prod _{i=1}^{k_1}\prod _{j=1}^{k_2} (s_j-t_i)^{p-c} \nonumber \\&\qquad \times \, \prod _{1\leqslant i<i'\leqslant k_1} (t_i-t_{i'})^{2c} \prod _{1\leqslant j<j'\leqslant k_2} (s_j-s_{j'})^{2c}\, \end{aligned}$$
(5.1)

and the \({\mathbb {F}}_p\)-integral

$$\begin{aligned} S_{\varvec{k}}(a,b_1,b_2,c) = \int _{[\varvec{k}]_p}\, \Phi _{\varvec{k}}(t;s; a,b_1,b_2,c)\,dt\,ds\,, \end{aligned}$$
(5.2)

where the p-cycle \([\varvec{k}]_p\) is defined in (2.5). This is the \(A_2\)-type \({\mathbb {F}}_p\)-Selberg integral, see (3.10).

For an allowable triple \((l_1,l_2,m)\) define the \({\mathbb {F}}_p\)-integral

$$\begin{aligned}&I_{l_1,l_2,m}(a,b_1,b_2,c) \nonumber \\&\quad = \int _{[\varvec{k}]_p}\, \Phi _{\varvec{k}}(t;s; a,b_1,b_2,c)\, \frac{W_{l_1,l_2,m}(t;s)}{\prod _{i=1}^{k_1}t_i(1-t_i)\prod _{j=1}^{k_2}(1-s_j)} \,dt\,ds\,, \end{aligned}$$
(5.3)

where \( W_{l_1,l_2,m}(t;s)\) is the weight function defined in Section 4.2.

Clearly, we have

$$\begin{aligned} I_{0,k_2,0}(a,b_1,b_2,c) = S_{\varvec{k}}(a-1,b_1,b_2-1,c). \end{aligned}$$
(5.4)

Denote

$$\begin{aligned}&B_0(a,b_1,b_2,c) =(-1)^{k_2} \prod _{i=0}^{k_2-1} \frac{(k_1-k_2+i+1)c}{b_2+ic}\,, \nonumber \\&B_1(a,b_1,b_2,c) = \prod _{i=1}^{k_1-k_2} \frac{a+b_1+(i+k_1-2)c}{b_1+(i-1)c} \, \prod _{i=1}^{k_2}\ \frac{a+b_1+b_2+(i+k_2-3)c}{b_1+b_2+(i-2)c} \,, \nonumber \\&B_2(a,b_1,b_2,c) = \prod _{i=1}^{k_2}\ \frac{b_2+(i+k_2-k_1-2)c}{b_2+(i-1)c}\ \frac{a+b_1+b_2+(i+k_2-3)c}{b_1+b_2+(i-2)c} \,.\nonumber \\ \end{aligned}$$
(5.5)

Theorem 5.1

Assume that \(k_1<p\).

  1. (i)

    Assume that every factor in \(B_0\) in the numerator or denominator is a nonzero element of \({\mathbb {F}}_p\). Then,

    $$\begin{aligned} I_{0,k_2,0}(a,b_1,b_2,c) = B_0(a,b_1,b_2,c)\,I_{0,0,0}(a,b_1,b_2,c)\,. \end{aligned}$$
    (5.6)
  2. (ii)

    Assume that every factor in \(B_1\) in the numerator or denominator is a nonzero element of \({\mathbb {F}}_p\) and \(b_1>1\), then

    $$\begin{aligned}&I_{0,0,0}(a,b_1-1,b_2,c)\,=\, B_1(a,b_1,b_2,c) \,I_{0,0,0}(a,b_1,b_2,c). \end{aligned}$$
    (5.7)
  3. (iii)

    Assume that every factor in \(B_2\) in the numerator or denominator is a nonzero element of \({\mathbb {F}}_p\) and \(b_2>1\), then

    $$\begin{aligned}&I_{0,0,0}(a,b_1,b_2-1,c)\,=\, B_2(a,b_1,b_2,c) \,I_{0,0,0}(a,b_1,b_2,c). \end{aligned}$$
    (5.8)

Proof

Equation (5.6) is an \({\mathbb {F}}_p\)-analog of equation (4.7), and its proof is analogous to the proof of equation (4.7).

More precisely, consider the complex Lie algebra \({\mathfrak {sl}_3}\) with standard generators \(f_1,f_2\), \(e_1,e_2\), \(h_1,h_2\), simple roots \(\sigma _1,\,\sigma _2\), fundamental weights \(\omega _1,\,\omega _2\). Let \(V_{\lambda _1}\), \(V_{\lambda _2}\) be the irreducible \({\mathfrak {sl}_3}\)-modules with highest weights

$$\begin{aligned} \lambda _1= -\frac{a}{c+p}\,\omega _1 \,, \qquad \lambda _2= -\frac{b_1}{c+p}\,\omega _1 - \frac{b_2}{c+p}\,\omega _2 \, \end{aligned}$$

and highest weight vectors \(v_1,\,v_2\). The module \(V_{\lambda _1}\) has a basis \((f_1^{r_1}[f_1,f_2]^{r_{2}}v_1)\) labeled by non-negative integers \(r_1,r_2\), and the module \(V_{\lambda _2}\) has a basis \((f_1^{r_1}[f_1,f_2]^{r_{2}}f_2^{r_3}v_2)\) labeled by non-negative integers \(r_1,r_2, r_3\). For every generator of \({\mathfrak {sl}_3}\), the matrix of its action on \(V_{\lambda _1}\) or on \(V_{\lambda _2}\) in these bases is a polynomial in \( -\frac{a}{c+p}\)  \(-\frac{b_1}{c+p},\) \( - \frac{b_2}{c+p}\) with integer coefficients.

Consider the Lie algebra \(\mathfrak {sl}_3\) over the field \({\mathbb {F}}_p\). Let \(V_{\lambda _1}^{{\mathbb {F}}_p}\) be the vector space over \({\mathbb {F}}_p\) with basis \((f_1^{r_1}[f_1,f_2]^{r_{2}}v_1)\) labeled by non-negative integers \(r_1,r_2\) and with the action of \(\mathfrak {sl}_3\) defined by the same formulas as on \(V_{\lambda _1}\) but reduced modulo p. Similarly, we define the \(\mathfrak {sl}_3\)-module \(V_{\lambda _2}^{{\mathbb {F}}_p}\).

Recall \(\varvec{k}=(k_1,k_2)\), \(k_1> k_2> 0\). Consider the weight subspace \(V_{\lambda _1}^{{\mathbb {F}}_p}\otimes V_{\lambda _2}^{{\mathbb {F}}_p}[\lambda _1+\lambda _2-k_1\sigma _1-k_2\sigma _2]\) of the tensor product \(V_{\lambda _1}^{{\mathbb {F}}_p}\otimes V_{\lambda _2}^{{\mathbb {F}}_p}\). This weight subspace has a basis formed by the vectors

$$\begin{aligned} v_{l_1,l_2,m} = \frac{f_1^{k_1-k_2-l_1+l_2}[f_1,f_2]^{k_2-l_2}v_1\otimes f_1^{l_1-m}[f_1,f_2]^{m}f_2^{l_2-m}v_2}{(k_1-k_2-l_1+l_2)!\,(k_2-l_2)!\,(l_1-m)!\,m!\,(l_2-m)!} \end{aligned}$$

labeled by allowable triples \((l_1,l_2,m)\).

Lemma 5.2

The vector

$$\begin{aligned} I = \sum _{l_1,l_2,m} (-1)^{l_1} I_{l_1,l_2,l_m} (a,b_1,b_2,c)\, v_{l_1,l_2,m} \end{aligned}$$

is a singular vector of \(V_{\lambda _1}^{{\mathbb {F}}_p}\otimes V_{\lambda _2}^{{\mathbb {F}}_p}\), that is, \(e_1I=0, \,e_2I=0\).

Proof

Equations \(e_1I=0, \,e_2I=0\) are \({\mathbb {F}}_p\)-analogs of equations \(e_1J=0\),   \(e_2J=0\) over \({\mathbb {C}}\).

For \(i=1,2\), the vector \(e_iJ\) is the integral of a certain differential \(k_1+k_2\)-form \(\mu _i\). It is shown in [26, Theorems 6.16.2], [14, Theorem 2.4] that \(\mu _i= {\text {d}}\! \nu _i\), where \(\nu _i\) is some explicitly written differential \(k_1+k_2-1\)-form. This implies \(e_iJ=0\) by Stokes’ theorem.

The vector \(e_iI\) is the \({\mathbb {F}}_p\)-integral of the same \(\mu _i\) reduced modulo p. It is explained in [26, Section 4] that the differential form \(\nu _i\) also can be reduced modulo p and this implies that the \({\mathbb {F}}_p\)-integral \(e_iI\) is zero by Lemma 2.3. Cf. the proof of [26, Theorem 2.4].

Lemma 5.2 implies the equations

$$\begin{aligned} (k_1-k_2+i+1)c\,I_{0,i,0} + (b_2 +ic)\,I_{0,i+1,0} = 0 \end{aligned}$$
(5.9)

for \(i=0,\dots ,k_2-1\), similarly to the proof of equations (4.6). The iterated application of equation (5.9) implies equation (5.6).

The proof of equations (5.7), (5.8) is parallel to the proof of equations (4.11), (4.12). We prove (5.7). The proof of (5.8) is similar.

Equation (4.11) follows from equation (4.9):

$$\begin{aligned} J_{0,0,0}(\alpha ,\beta _1-1,\beta _2,\gamma ) v_{0,0,0} - J_{0,0,0}(\alpha ,\beta _1,\beta _2,\gamma ) \,\mathbb B_1 v_{0,0,0}\,=\,0 \end{aligned}$$
(5.10)

and equation \(\mathbb B_1 v_{0,0,0}= B_1 v_{0,0,0}\) in \(V_{\lambda _1}\). The explicit formulas for \(\mathbb B_1\) show that under the assumptions of Theorem 5.1 the action of \(\mathbb B_1\) on \(v_{0,0,0}\) is well-defined modulo p and gives the same result \(\mathbb B_1 v_{0,0,0}= B_1 v_{0,0,0}\) but in \(V_{\lambda _1}^{{\mathbb {F}}_p}\).

The proof of (5.10) in [15] goes as follows. The left-hand side of (5.10) is a vector-valued integral of a suitable differential \(k_1+k_2\)-form \(\mu \). It is shown in [14, Theorem 5.1] that \(\mu = {\text {d}}\! \nu \), where \(\nu \) is some explicitly written differential \(k_1+k_2-1\)-form. This implies (5.10) by Stokes’ theorem.

The p-analog of the left-hand side of (5.10) is the element

$$\begin{aligned} I_{0,0,0}(a,b_1-1,b_2,c) v_{0,0,0} - I_{0,0,0}(a,b_1,b_2,c) \,\mathbb B_1 v_{0,0,0}\,\in \,V_{\lambda _1}^{{\mathbb {F}}_p}\,. \end{aligned}$$
(5.11)

This element is the \({\mathbb {F}}_p\)-integral of the same \(\mu \) reduced modulo p. It is explained in [26, Section 4] that the differential form \(\nu \) also can be reduced modulo p and this implies that the \({\mathbb {F}}_p\)-integral in the left-hand side of (5.11) equals zero by Lemma 2.3. Hence, equation (5.7) is proved and Theorem 5.1 is proved. \(\square \)

5.2 Proof of Theorem 3.4

Recall the set of admissible parameters \(\mathcal A_{\varvec{k}}\) introduced in Section 3.1 for \(\varvec{k} = (k_1,k_2)\), \(k_1> k_2> 0\).

Lemma 5.3

Assume that \((a,b_1-1,b_2,c), (a,b_1,b_2,c) \in \mathcal A_{\varvec{k}}\). Then,

$$\begin{aligned} S_{\varvec{k}}(a,b_1-1,b_2,c)= & {} S_{\varvec{k}}(a,b_1,b_2,c) \prod _{i=1}^{k_1-k_2} \frac{1+a+b_1+(i+k_1-2)c-p}{b_1+(i-1)c} \nonumber \\\times & {} \prod _{i=1}^{k_2} \frac{2+a+b_1+b_2+(i+k_1-3)c-p}{1+b_1+b_2+(i-2)c}\,. \end{aligned}$$
(5.12)

Assume that \((a,b_1,b_2-1,c), (a,b_1,b_2,c) \in \mathcal A_{\varvec{k}}\). Then,

$$\begin{aligned} S_{\varvec{k}}(a,b_1,b_2-1,c)= & {} S_{\varvec{k}}(a,b_1,b_2,c) \prod _{i=1}^{k_2} \frac{1+b_2+(i+k_2-k_1-2)c}{b_2+(i-1)c} \nonumber \\\times & {} \prod _{i=1}^{k_2} \frac{2+a+b_1+b_2+(i+k_1-3)c-p}{1+b_1+b_2+(i-2)c}\,. \end{aligned}$$
(5.13)

Proof

The lemma follows from formulas (5.4) and (5.6) and Theorem 5.1. \(\square \)

For \(n=2\), formula (3.1) takes the form:

$$\begin{aligned}&R_{\varvec{k}}(a,b_1,b_2,c) = (-1)^{k_1+k_2}\,\prod _{i=1}^{k_1-k_2} \frac{(b_1+(i-1)c)!}{(1+a+b_1+(i+k_1-2)c-p)!} \nonumber \\&\qquad \times \, \prod _{i=1}^{k_2}\ \frac{(b_2+(i-1)c)!}{(1+b_2+(i+k_2-k_1-2)c)!}\, \ \frac{(1+b_1+b_2+(i-2)c)!}{(2+a+b_1+b_2+(i+k_1-3)c-p)!} \nonumber \\&\qquad \times \ \prod _{i=1}^{k_1} (a+(i-1)c)!\, \prod _{i=1}^{k_2} (p+(i-k_1-1)c)! \prod _{r=1}^2\prod _{i=1}^{k_r} \frac{(ic)!}{c!}\,. \end{aligned}$$
(5.14)

Lemma 5.4

Assume that \((a,b_1-1,b_2,c), (a,b_1,b_2,c) \in \mathcal A_{\varvec{k}}\). Then,

$$\begin{aligned} R_{\varvec{k}}(a,b_1-1,b_2,c)= & {} R_{\varvec{k}}(a,b_1,b_2,c) \prod _{i=1}^{k_1-k_2} \frac{1+a+b_1+(i+k_1-2)c-p}{b_1+(i-1)c} \nonumber \\&\times \prod _{i=1}^{k_2} \frac{2+a+b_1+b_2+(i+k_1-3)c-p}{1+b_1+b_2+(i-2)c}\,. \end{aligned}$$
(5.15)

Assume that \((a,b_1,b_2-1,c), (a,b_1,b_2,c) \in \mathcal A_{\varvec{k}}(a,b_1,b_2,c)\). Then,

$$\begin{aligned} R_{\varvec{k}}(a,b_1,b_2-1,c)= & {} R_{\varvec{k}}(a,b_1,b_2,c) \prod _{i=1}^{k_2} \frac{1+b_2+(i+k_2-k_1-2)c}{b_2+(i-1)c} \nonumber \\&\times \prod _{i=1}^{k_2} \frac{2+a+b_1+b_2+(i+k_1-3)c-p}{1+b_1+b_2+(i-2)c}\,. \end{aligned}$$
(5.16)

\(\square \)

By Lemmas 5.3 and 5.4, the functions \(S_{\varvec{k}}(a,b_1,b_2,c)\) and \(R_{\varvec{k}}(a,b_1,b_2,c)\) defined on \(\mathcal A_{\varvec{k}}\) satisfy the same difference equations with respects to the shifts of variables \(b_1\rightarrow b_1-1\) and \(b_2\rightarrow b_2-1\).

Lemma 5.5

Assume that ac are positive integers such that \(0\,<k_1c\,\leqslant p-1\),

\(a+(k_1-1)c \,<\,p-1\). Then, the point

$$\begin{aligned} (a,b_1,b_2,c) = (a, p-1 - (a +(k_1-1)c), (k_1-k_2+1)c-1, c) \end{aligned}$$
(5.17)

lies in \(\mathcal A_{\varvec{k}}\).

Proof

If \((a,b_1,b_2,c)\) is given by (5.17), then

$$\begin{aligned} R_{\varvec{k}}= & {} (-1)^{k_1+k_2}\,\prod _{i=1}^{k_1-k_2} \frac{(p-1-(a+(k_1-i)c))!}{((i-1)c)!} \nonumber \\&\times \, \prod _{i=1}^{k_2}\ \frac{((k_1-k_2+i)c-1)!}{((i-1)c)!}\, \ \frac{(p-1-(a+(k_2-i)c))!}{((k_1-k_2+i-1)c)!} \nonumber \\&\times \ \prod _{i=1}^{k_1} (a+(i-1)c)!\, \prod _{i=1}^{k_2} (p+(i-k_1-1)c)! \prod _{r=1}^2\prod _{i=1}^{k_r} \frac{(ic)!}{c!}\,. \end{aligned}$$

This proves the lemma. \(\square \)

Lemma 5.6

Assume that \(\tilde{a}, \tilde{c}\) are non-negative integers such that \(0<k_1\tilde{c}\,\leqslant p-1\), \(\tilde{a}+(k_1-1)\tilde{c} \,\leqslant \,p-1\). Denote by \(\mathcal A_{\varvec{k}}(\tilde{a},\tilde{c})\) the set of all \((a,b_1,b_2,c)\in \mathcal A_{\varvec{k}}\) such that \(a=\tilde{a}\), \(c = \tilde{c}\). Then, \(\mathcal A_{\varvec{k}}(\tilde{a},\tilde{c})\) consists of the pairs \((b_1,b_2)\) of non-negative integers satisfying the inequalities

$$\begin{aligned} p-1 - (\tilde{a} +(k_1-1)\tilde{c})\leqslant b_1,\qquad (k_1-k_2+1)\tilde{c}-1\leqslant b_2 \end{aligned}$$
(5.18)

and some other inequalities of the form

$$\begin{aligned} b_1\leqslant A_1, \qquad b_2\leqslant A_2\qquad b_1+b_2\leqslant A_{12}, \end{aligned}$$
(5.19)

where \(A_1,\,A_2,\,A_{12}\) are some integers such that

$$\begin{aligned}&A_1\geqslant p-1 - (\tilde{a} +(k_1-1)\tilde{c}),\quad A_2 \geqslant (k_1-k_2+1)\tilde{c}-1, \\&A_{12}\geqslant p -1 - (\tilde{a} +(k_1-1)\tilde{c}) + (k_1-k_2+1)\tilde{c}-1\,. \end{aligned}$$

Proof

The lemma follows from Lemmas 3.1 and 3.2. \(\square \)

Corollary 5.7

Any point \((\tilde{a}, b_1,b_2,\tilde{c}) \in \mathcal A_{\varvec{k}}(\tilde{a},\tilde{c})\) can be connected with the point \((\tilde{a}, p-1-(\tilde{a}+(k_1-1)\tilde{c}), (k_1-k_2+1)\tilde{c}-1,\tilde{c})\in \mathcal A_{\varvec{k}}(\tilde{a},\tilde{c})\) by a piece-wise linear path in \(\mathcal A_{\varvec{k}}(\tilde{a},\tilde{c})\) consisting of the vectors \((0,-1,0,0)\) or \((0,0,-1,0)\). \(\square \)

Proof of Theorem 3.4. For \(n=1\)\(\varvec{k}=(k_1)\) and the point \((\tilde{a}, p-1-(\tilde{a}+(k_1-1)\tilde{c}), \tilde{c})\) formula (3.11) holds by [21, Theorem 4.1].

For \(n=2\),  \(\varvec{k} = (k_1,k_2)\) and the point \((\tilde{a}, p-1-(\tilde{a}+(k_1-1)\tilde{c}), (k_1-k_2+1)\tilde{c}-1,\tilde{c})\), formula (3.11) holds by Lemma 5.5 and Theorem 3.7.

For \(n=2\)\(\varvec{k} = (k_1,k_2)\) and arbitrary \((\tilde{a}, b_1,b_2,\tilde{c}) \in \mathcal A_{\varvec{k}}(\tilde{a},\tilde{c})\), formula (3.11) holds by Lemmas 5.3, 5.4 and Corollary 5.7. Theorem 3.4 for \(n=2\) is proved. \(\square \)

Corollary 5.8

Let \(n>2\), \(\varvec{k}=(k_1,\dots ,k_n)\), and \((a,(b_1,b_2),c) \in \mathcal A_{(k_1,k_2)}\). Let \(b=(b_1,\dots ,b_n)\), where \(b_i=(k_{i-1}-k_i+1)c-1\) for \(i=3,\dots ,n\). Then, formula (3.11) holds for the \({\mathbb {F}}_p\)-Selberg integral \(S_{[\varvec{k}]_p}(a,b,c)\) of type \(A_{n}\).

Proof

Formula (3.11) for the \({\mathbb {F}}_p\)-Selberg integrals of type \(A_2\) is proved in Theorem 3.4. Hence, the corollary follows from Theorem 3.7 by induction on n. \(\square \)

5.3 Evaluation of \(I_{0,0,0}(a,b_1,b_2,c)\)

In this section, we evaluate \(I_{0,0,0}(a,b_1,b_2,c)\) without using the evaluation of \(S_{\varvec{k}}(a,b_1,b_2,c)\).

Theorem 5.9

Let \(\varvec{k}=(k_1,k_2)\), \(k_1>k_2> 0\) and \(a,b_1,b_2,c\in {\mathbb {Z}}_{>0}\). Assume that

\(a+(k_1-1)c<p\) and all factorials on the right-hand side of the next formula are factorials of the non-negative integers less than p. Then,

$$\begin{aligned}&I_{0,0,0}(a,b_1,b_2,c) = (-1)^{k_1+k_2}\,\prod _{i=1}^{k_1-k_2} \frac{(b_1+(i-1)c)!}{(a+b_1+(i+k_1-2)c-p)!} \nonumber \\&\qquad \times \, \prod _{i=1}^{k_2}\ \frac{(b_2+(i-1)c)!}{(b_2+(i+k_2-k_1-2)c)!}\, \ \frac{(b_1+b_2+(i-2)c)!}{(a+b_1+b_2+(i+k_1-3)c-p)!} \nonumber \\&\qquad \times \ \prod _{i=1}^{k_1} (a+(i-1)c-1)!\, \prod _{i=1}^{k_2} (p+(i-k_1-1)c-1)! \prod _{r=1}^2\prod _{i=1}^{k_i} \frac{(ic)!}{c!}\,.\qquad \end{aligned}$$
(5.20)

Proof

The proof is parallel to the proof of Theorem 3.4 for \(n=2\).

Denote by \(\mathcal A^I_{\varvec{k}}\) the set of all \(a,b_1,b_2,c\in {\mathbb {Z}}_{>0}\) satisfying the assumptions of Theorem 5.9. Notice that if \((a,b_1,b_2,c)\in \mathcal A^I_{\varvec{k}}\), then

$$\begin{aligned} b_1\geqslant p-(a+(k_1-1)c), \qquad b_2\geqslant (k_1-k_2+1)c. \end{aligned}$$
(5.21)

\(\square \)

Lemma 5.10

Formula (5.20) holds if \(b_2=(k_1-k_2+1)c\) and \((a, b_1, (k_1-k_2+1)c, c)\in \mathcal A^I_{\varvec{k}}\).

Proof

If \(b_2=(k_{1}-k_2+1)c\), then all variables \((s_j)\) in the integrand of \(I_{0,0,0}(a, b_1,(k_1-k_2+1)c, c)\) are used to reach the monomial \(\prod _{j=1}^{k_n} s_j^{k_{1}p-1}\) in the calculation of the \({\mathbb {F}}_p\)-integral \(I_{0,0,0}(a, b_1, (k_1-k_2+1)c, c)\). The remaining free variables \((t_i)\) all belong to the factor

$$\begin{aligned} \Phi _{(k_1)}(t_1,\dots ,t_{k_1}, a-1, b_1,c)= \prod _{1\leqslant i<i'\leqslant k_1}(t_i-t_{i'})^{2c}\prod _{i=1}^{k_1} t_i^{a-1}(1-t_i)^{b_1} \end{aligned}$$

of the integrand and are used to calculate the coefficient of the monomial \(\prod _{j=1}^{k_1} t_i^{p-1}\).

More precisely, under the assumptions of the theorem we have

$$\begin{aligned} I_{0,0,0}(a, b_1, (k_1-k_2+1)c, c) = (-1)^{b_2k_2+ck_2(k_2-1)/2}\frac{(k_2c)!}{(c!)^{k_2}} \,S_{(k_1)}(a-1,b_1,c), \end{aligned}$$

cf. the proof of Theorem 3.7. We have \( (-1)^{b_2k_2+ck_2(k_2-1)/2}= (-1)^{ (k_{1}k_2-k_2(k_2+1)/2)c-k_2}\).

By [21, Theorem 4.1] we have \(S_{(k_1)}(a-1,b_1,c) = R_{(k_1)}(a-1,b_1,c)\). Hence,

$$\begin{aligned}&I_{0,0,0}(a, b_1, (k_1-k_2+1)c, c) = (-1)^{ (k_{1}k_2-k_2(k_2+1)/2)c} (-1)^{k_1+k_2} \nonumber \\&\qquad \times \, \frac{(k_2c)!}{(c!)^{k_2}} \ \prod _{j=1}^{k_1} \frac{(jc)!}{c!}\, \frac{(a+(j-1)c-1)!\,(b+(j-1)c)!}{(a+b + (k_1+j-2)c-p)!}\,. \end{aligned}$$
(5.22)

Denote by \(R^I_{\varvec{k}}(a,b_1,b_2,c)\) the right-hand side in (5.20). We have

$$\begin{aligned}&R^I_{\varvec{k}}(a,b_1,(k_1-k_2+1)c,c) = (-1)^{k_1+k_2}\,\prod _{i=1}^{k_1-k_2} \frac{(b_1+(i-1)c)!}{(a+b_1+(i+k_1-2)c-p)!} \nonumber \\&\qquad \times \, \prod _{i=1}^{k_2}\ \frac{((k_1-k_2+1)c+(i-1)c)!}{((k_1-k_2+1)c+(i+k_2-k_1-2)c)!}\, \nonumber \\&\qquad \times \, \prod _{i=1}^{k_2}\ \frac{(b_1+(k_1-k_2+1)c+(i-2)c)!}{(a+b_1+(k_1-k_2+1)c+(i+k_1-3)c-p)!} \nonumber \\&\qquad \times \ \prod _{i=1}^{k_1} (a+(i-1)c-1)!\, \prod _{i=1}^{k_2} (p+(i-k_1-1)c-1)! \prod _{r=1}^2\prod _{i=1}^{k_i} \frac{(ic)!}{c!}\,. \nonumber \\&\quad = (-1)^{k_1+k_2} (-1)^{ (k_{1}k_2-k_2(k_2+1)/2)c} \,\nonumber \\&\qquad \frac{(k_2c)!}{(c!)^{k_2}}\, \prod _{j=1}^{k_1} \frac{(ic)!}{c!}\,\frac{(a+(j-1)c-1)!\,(b+(j-1)c)!}{(a+b + (k_1+j-2)c-p)!}, \end{aligned}$$
(5.23)

where we used the cancellation Lemma 2.1 in the last step. Hence,

\(I_{0,0,0}(a, b_1, (k_1-k_2+1)c, c) = R^I_{\varvec{k}}(a, b_1, (k_1-k_2+1)c, c)\) and Lemma 5.10 is proved. \(\square \)

Comparing equations (5.7), (5.8) and the formula for \(R^I_{\varvec{k}}(a, b_1, b_2, c)\), we conclude that the functions \(I_{0,0,0}(a, b_1, b_2, c)\) and \(R^I_{\varvec{k}}(a, b_1, b_2, c)\) on \(\mathcal A^I_{\varvec{k}}\) satisfy the same difference equations with respect to the shifts of variables \(b_1\rightarrow b_1-1\) and \(b_2\rightarrow b_2-1\) and are equal if \(b_2\) takes its minimal value \((k_1-k_2+1)c\). This implies Theorem 5.9, cf. Lemmas 5.5, 5.6 and Corollary 5.7.

5.4 Sketch of the proof of formula (3.11) for \(n>2\)

The proof is parallel to the proof of Theorem 3.4.

Analogously to the proof of Theorem 5.1, consider the Lie algebra \(\mathfrak {sl}_{n+1}\) and its representations \(V_{\lambda _1}^{{\mathbb {F}}_p}\) and \( V_{\lambda _2}^{{\mathbb {F}}_p}\) over \({\mathbb {F}}_p\) with highest weights

$$\begin{aligned} \lambda _1= -\frac{a}{c+p}\,\omega _1 \,, \qquad \lambda _2= -\frac{b_1}{c+p}\,\omega _1 -\dots - \frac{b_n}{c+p}\,\omega _n \, \end{aligned}$$

and highest weight vectors \(v_1,\,v_2\). Consider the PBW basis \(\mathcal B = (u)\) of the weight subspace \(V_{\lambda _1}^{{\mathbb {F}}_p}\otimes V_{\lambda _2}^{{\mathbb {F}}_p}[\lambda _1+\lambda _2-\sum _{i=1}^n k_i\sigma _i]\) like in the proof of Theorem 5.1. We distinguish two elements of that basis:

$$\begin{aligned}&u_1 = \frac{ f_1^{k_1-k_2}[f_1,f_2]^{k_2-k_3}\dots [f_1,[f_2, \dots , [f_{n-1},f_n]\dots ]]^{k_n}v_1 \otimes v_2}{ (k_1-k_2)!\,(k_2-k_3)!\,\dots \,(k_n)!}\,, \\&u_2 = \frac{ f_1^{k_1}v_1 \otimes f_2^{k_2}\dots f_n^{k_n} v_2}{ (k_1)!\,(k_2)!\,\dots \,(k_n)!}\,. \end{aligned}$$

For \(n=2\), these vectors are the vectors \(v_{0,0,0}\) and \( v_{0,k_2,0}\) in the proof of Theorem 5.1.

To any basis vector \(u\in \mathcal B\), we assign the weight function \(W_u(t)\) defined in [19, Section 6.1], here t is the collection of variables defined in (3.9). Then, we consider the \({\mathbb {F}}_p\)-integrals

$$\begin{aligned} I_u(a,b,c) = \int _{[\varvec{k}]_p} \Phi (t,a,b,c) W_u(t)\,dt. \end{aligned}$$

It follows from the formulas for the weight functions that

$$\begin{aligned} I_{u_2}(a,b,c) = S_{\varvec{k}}(a-1,b_1,b_2-1,\dots ,b_n-1,c), \end{aligned}$$

cf. (5.4). It is known from the theory of KZ equations that the vector

$$\begin{aligned} I(a,b,c) = \sum _{u\in \mathcal B} I_u(a,b,c)\, u \end{aligned}$$

is a singular vector in \(V_{\lambda _1}^{{\mathbb {F}}_p}\otimes V_{\lambda _2}^{{\mathbb {F}}_p}[\lambda _1+\lambda _2-\sum _{i=1}^n k_i\sigma _i]\). From the singular vector condition, it follows that

$$\begin{aligned} I_{u_2}(a,b,c)= B_0(a,b,c)\,I_{u_1}(a,b,c), \end{aligned}$$
(5.24)

where \(B_0(a,b,c)\) is an explicit expression like in (5.6).

The vector \(I_{u_1}(a,b,c) u_1\) is a generator of the one-dimensional weight subspace \(V_{\lambda _1}^{{\mathbb {F}}_p}[\lambda _1+\lambda _2-\sum _{i=1}^n k_i\sigma _i]\). That vector satisfies the dynamical equations defined in [29]. The dynamical equations take the form

$$\begin{aligned} I_{u_1}(a,b_1,\dots ,b_i-1,\dots ,b_n,c) = B_i(a,b,c) I_{u_1}(a,b,c), \qquad i=1,\dots ,n,\nonumber \\ \end{aligned}$$
(5.25)

where \(B_i(a,b,c)\) are explicit products like in (5.7) and (5.8).

Equation (5.24) and difference equations (5.25) imply that the two functions \(S_{\varvec{k}}(a,b,c)\) and \(R_{\varvec{k}}(a,b,c)\), defined on the set \(\mathcal A_{\varvec{k}}\), satisfy the same difference equations with respect to the shift of variables \(b_i\rightarrow b_i-1\) for \(i=1,\dots ,n\). By Corollary 3.8, we also know that the two functions are equal at the distinguished point

$$\begin{aligned}&(a,p-1-(a+(k_1-1)c), (k_1-k_2+1)c-1,\dots ,(k_{n-1}-k_n+1)c-1,c)\\&\qquad \in \ \mathcal A_{\varvec{k}}\,. \end{aligned}$$

This implies that the two functions are equal (cf. Corollary 5.7) and formula (3.11) holds for any n. The details of this sketch will be published elsewhere.