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 n} (x_i-x_j)^{2\gamma } \prod _{i=1}^nx_i^{\alpha -1} (1-x_i)^{\beta -1}\ {\mathrm{d}}x_1\dots {\mathrm{d}}x_n \nonumber \\&\quad =\ \prod _{j=1}^n \frac{\Gamma (1+j\gamma )}{\Gamma (1+\gamma )}\, \frac{\Gamma (\alpha +(j-1)\gamma )\,\Gamma (\beta +(j-1)\gamma )}{\Gamma (\alpha +\beta + (n+j-2)\gamma )}, \end{aligned}$$
(1.1)

see [2, 22].Footnote 1 Hundreds of papers are devoted to the generalizations of the Selberg integral formula and its applications, see for example [2, 11] 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,9, 11,12,13, 18, 19, 24, 28,29,31, 39,40,41]. 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 Eq. (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 this paper we suggest 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, see Theorem 4.1.

Our motivation comes from the theory of the Knizhnik–Zamolodchikov (KZ) equations, see [6, 14]. 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 [32, 33]. The following general principle was formulated in [17]: 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 [17], an example of 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). Other illustrations see in [9, 10, 20, 28,29,30, 34].

Recently in [26] the KZ equations were considered modulo a prime number p and polynomial solutions of the reduced equations were constructed, see also [27, 35,36,37,38]. 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 this paper we consider the reduction modulo p of the same example of the KZ equations, that led in [17] to the Selberg integral. The space of solutions of the reduced KZ equations is still one-dimensional and, according to the principle, we may expect that the corresponding \({{\mathbb {F}}}_p\)-hypergeometric solution is related to a Selberg type formula. Indeed we have evaluated that \({{\mathbb {F}}}_p\)-hypergeometric solution by analogy with the evaluation of the Selberg integral and obtained our \({{\mathbb {F}}}_p\)-Selberg integral formula in Theorem 4.1.

The paper contains three proofs of our \({{\mathbb {F}}}_p\)-Selberg integral formula. There might be more proofs. It would be interesting to see if our formula can be deduced from the known relations between the multidimensional Gauss and Jacobi sums, see for example [2, Section 8.11].

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. 4 we formulate our main result, Theorem 4.1, and prove it by developing an \({{\mathbb {F}}}_p\)-analog of Aomoto’s recursion, defined in [3] for the Selberg integral. In Sect. 5 we give another proof of Theorem 4.1, based on Morris’ identity, which is deduced from the classical Selberg integral formula (1.1) in [16]. In Sect. 6 we sketch a third proof of Theorem 4.1 based on a combinatorial identity, also deduced from the Selberg integral formula (1.1). In Sect. 7 we discuss in more detail how our \({{\mathbb {F}}}_p\)-Selberg integral formula is related to the \({{\mathbb {F}}}_p\)-hypergeometric solutions of KZ equations reduced modulo p.

The authors thank C. Biró, I. Cherednik, P. Etingof, E. Rains, A. Slinkin for useful discussions and the referee for helpful suggestions.

2 Preliminary Remarks

2.1 Lucas’ Theorem

Theorem 2.1

[15] For nonnegative integers m and n and a prime p,  the following congruence relation holds : 

$$\begin{aligned} \left( {\begin{array}{c}n\\ m\end{array}}\right) \equiv \prod _{i=0}^a \left( {\begin{array}{c}n_i\\ m_i\end{array}}\right) \quad ({\text {mod}}\ p), \end{aligned}$$
(2.1)

where \(m=m_{b}p^{b}+m_{b-1}p^{b-1}+\cdots +m_{1}p+m_{0}\) and \(n=n_{b}p^{b}+n_{b-1}p^{b-1}+\cdots +n_{1}p+n_{0}\) are the base p expansions of m and n respectively. This uses the convention that \(\left( {\begin{array}{c}n\\ m\end{array}}\right) =0\) if \(n<m\). \(\square \)

2.2 Binomial Lemma

Lemma 2.2

[38] Let ab be positive integers such that \(a<p,\) \(b<p,\) \(p\leqslant a+b.\) Then we have an identity in \({{\mathbb {F}}}_p,\)

$$\begin{aligned} b\,\left( {\begin{array}{c}b-1\\ a+b-p\end{array}}\right) = b\,\left( {\begin{array}{c}b-1\\ p-a-1\end{array}}\right) = (-1)^{a+1}\,\frac{a! \,b!}{(a+b-p)!}. \end{aligned}$$
(2.2)

\(\square \)

2.3 Cancellation of Factorials

Lemma 2.3

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

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

Proof

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

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

3.1 Definition

Let p be an odd prime number and M 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}$$
(3.1)

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 cycle \([l_1,\dots ,l_k]_p\) and is denoted by \(\int _{[l_1,\dots ,l_k]_p} P(x_1,\dots ,x_k)\,{\mathrm{d}}x_1\dots {\mathrm{d}}x_k\).

Lemma 3.1

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){\mathrm{d}}x_1\dots {\mathrm{d}}x_k \nonumber \\&\quad =\int _{[l_1,\dots ,l_k]_p} P(x_1,\dots ,x_k)\,{\mathrm{d}}x_1\dots {\mathrm{d}}x_k. \end{aligned}$$
(3.2)

\(\square \)

Lemma 3.2

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,\ldots ,x_k) = 0. \end{aligned}$$

\(\square \)

3.2 \({{\mathbb {F}}}_p\)-Beta Integral

For nonnegative integers ab the classical beta integral formula says

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

Theorem 3.3

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

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

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

$$\begin{aligned} \int _{[1]_p} x^a(1-x)^b {\mathrm{d}}x= 0. \end{aligned}$$
(3.5)

Proof

We have \( x^a(1-x)^b = \sum _{k=0}^b(-1)^k \left( {\begin{array}{c}b\\ k\end{array}}\right) x^{k}, \) and need \(a+k=p-1\). Hence \(k=p-1-a\) and

$$\begin{aligned} \int _{[1]_p} x^a(1-x)^b{\mathrm{d}}x \, = (-1)^{p-1-a}\left( {\begin{array}{c}b\\ p-1-a\end{array}}\right) . \end{aligned}$$

Now Lemma 2.2 implies (3.4). Formula (3.5) is clear. \(\square \)

4 n-Dimensional \({{\mathbb {F}}}_p\)-Selberg and \({{\mathbb {F}}}_p\)-Aomoto Integrals

4.1 n-Dimensional Integral Formulas

The n-dimensional Selberg integral formula for nonnegative integers abc is

$$\begin{aligned}&\int _0^1\dots \int _0^1 \prod _{1\leqslant i<j\leqslant n} (x_i-x_j)^{2c} \prod _{i=1}^nx_i^a (1-x_i)^b\ {\mathrm{d}}x_1\dots {\mathrm{d}}x_n \nonumber \\&= \prod _{j=1}^n \frac{(jc)!}{c!}\, \frac{(a+(j-1)c)!\,(b+(j-1)c)!}{(a+b + (n+j-2)c+1)!}, \end{aligned}$$
(4.1)

and for \(k=1,\dots ,n-1\), the n-dimensional Aomoto integral formula is

$$\begin{aligned}&\int _0^1\dots \int _0^1\prod _{i=1}^kx_i \prod _{1\leqslant i<j\leqslant n} (x_i-x_j)^{2c} \prod _{i=1}^nx_i^a (1-x_i)^b\ {\mathrm{d}}x_1\dots {\mathrm{d}}x_n\nonumber \\&\quad =\, \prod _{j=1}^k \frac{a+(n-j)c+1}{a+b+(2n-j-1)c+1}\, \prod _{j=1}^n \frac{(jc)!}{c!}\, \frac{(a+(j-1)c)!\,(b+(j-1)c)!}{(a+b + (n+j-2)c+2)!},\nonumber \\ \end{aligned}$$
(4.2)

[2, 3, 22].

Theorem 4.1

Assume that abc are nonnegative integers such that

$$\begin{aligned} p-1\leqslant a+b+(n-1)c, \quad a+b+(2n-2)c < 2p-1. \end{aligned}$$
(4.3)

Then we have an integral formula in \({{\mathbb {F}}}_p{:}\)

$$\begin{aligned}&\int _{[1,\dots ,1]_p} \prod _{1\leqslant i<j\leqslant n} (x_i-x_j)^{2c} \prod _{i=1}^nx_i^a (1-x_i)^b\ {\mathrm{d}}x_1\dots {\mathrm{d}}x_n \nonumber \\&\quad = (-1)^n\,\prod _{j=1}^n \frac{(jc)!}{c!}\, \frac{(a+(j-1)c)!\,(b+(j-1)c)!}{(a+b + (n+j-2)c+1-p)!}. \end{aligned}$$
(4.4)

Also,  if \(k=1,\dots ,n-1,\) and

$$\begin{aligned} p-1\leqslant a+b+(n-1)c, \quad a+b+(2n-2)c < 2p-2, \end{aligned}$$
(4.5)

then

$$\begin{aligned}&\int _{[1,\dots ,1]_p} \prod _{i=1}^kx_i\prod _{1\leqslant i<j\leqslant n} (x_i-x_j)^{2c} \prod _{i=1}^nx_i^a (1-x_i)^b\ {\mathrm{d}}x_1\dots {\mathrm{d}}x_n \nonumber \\&\quad = \,(-1)^n\, \prod _{j=1}^k \frac{a+(n-j)c+1}{a+b+(2n-j-1)c+2}\, \prod _{j=1}^n \frac{(jc)!}{c!}\, \frac{(a+(j-1)c)!\,(b+(j-1)c)!}{(a+b + (n+j-2)c+1-p)!}.\nonumber \\ \end{aligned}$$
(4.6)

The first proof of Theorem 4.1 is given in Sects. 4.24.4, the second in Sect. 5, and the third one is sketched in Sect. 6.

Remark

Formula (4.4) can be rewritten as

$$\begin{aligned}&\sum _{x_1,\dots ,x_n\in {\mathbb {F}}_p} \prod _{1\leqslant i<j\leqslant n} (x_i-x_j)^{2c}\prod _{i=1}^n x_i^a(1-x_i)^b \nonumber \\&\quad =\prod _{j=1}^n\frac{(jc)!}{c!}\, \frac{(a+(j-1)c)!(b+(j-1)c)!}{(a+b+(n+j-2)c+1-p)!}, \end{aligned}$$
(4.7)

if additionally \(a+b+(2n-2)c < 2p-2\).

Remark

The fact that the \({{\mathbb {F}}}_p\)-Selberg integral on the left-hand side of (4.4) equals an explicit alternating product on the right-hand side of (4.4) is surprising. But even more surprising is the fact that the alternating product on the right-hand side of (4.4) is simply given by the alternating product on the right-hand of the classical formula (4.1) with just several of factorials shifted by p.

Remark

The Selberg integral (4.1) is related to the \({\mathfrak {sl}_2}\) KZ differential equations, see Sect. 7, and is called the Selberg integral of type \(A_1\). The Selberg integral of type \(A_n\), related to the \(\mathfrak {sl}_{n+1}\) KZ differential equations, is introduced in [30, 39,40,41].

We call the \({{\mathbb {F}}}_p\)-integral (4.4) the \({{\mathbb {F}}}_p\)-Selberg integral of type \(A_1\). The \({{\mathbb {F}}}_p\)-Selberg integral of type \(A_n\), \(n>1\), is introduced in [21]. The \({{\mathbb {F}}}_p\)-Selberg integral formula of type \(A_n\) is deduced in [21] from the \({{\mathbb {F}}}_p\)-Selberg integral formula (4.4) by induction on n.

Remark

The integral analogous to (4.4) but with \(x_i-x_j\) factors raised to an odd power vanishes:

$$\begin{aligned} \int _{[1,\dots ,1]_p} \prod _{1\leqslant i<j\leqslant n} (x_i-x_j)^{2c+1} \prod _{i=1}^nx_i^a (1-x_i)^b\ {\mathrm{d}}x_1\dots {\mathrm{d}}x_n=0. \end{aligned}$$
(4.8)

Indeed, after expanding the \((x_1-x_2)^{2c+1}\) factor, the integral (4.8) equals

$$\begin{aligned} \sum _{m=0}^{2c+1}(-1)^{m+1} \left( {\begin{array}{c}2c+1\\ m\end{array}}\right) \int _{[1,\dots ,1]_p} x_1^{a+m} x_2^{a+(2c+1-m)} f(x_1,\ldots ,x_n) \ {\mathrm{d}}x_1\dots {\mathrm{d}}x_n=0, \end{aligned}$$

with f symmetric in \(x_1\) and \(x_2\). The terms corresponding to m and \(2c+1-m\) cancel each other, making the sum 0.

4.2 Auxiliary Lemmas

Denote

$$\begin{aligned} P_n(a,b,c) =(-1)^n\, \prod _{j=1}^n \frac{(jc)!}{c!}\, \frac{(a+(j-1)c)!\,(b+(j-1)c)!}{(a+b + (n+j-2)c+1-p)!}. \end{aligned}$$
(4.9)

The polynomial

$$\begin{aligned} \Phi (x_1,\dots , x_n,a,b,c)= \prod _{1\leqslant i<j\leqslant n} (x_i-x_j)^{2c} \prod _{i=1}^nx_i^a (1-x_i)^b \end{aligned}$$

is called the master polynomial. Denote

$$\begin{aligned} S_n(a,b,c)= & {} \int _{[1,\dots ,1]_p} \prod _{1\leqslant i<j\leqslant n} (x_i-x_j)^{2c} \prod _{i=1}^nx_i^a (1-x_i)^b {\mathrm{d}}x_1\dots {\mathrm{d}}x_n,\\ S_{k,n}(a,b,c)= & {} \int _{[1,\dots ,1]_p} \prod _{i=1}^k x_i \prod _{1\leqslant i<j\leqslant n} (x_i-x_j)^{2c} \prod _{i=1}^nx_i^a (1-x_i)^b\, {\mathrm{d}}x_1\dots {\mathrm{d}}x_n, \end{aligned}$$

for \(k=0,\dots ,n\). Then \(S_{0,n}(a,b,c)= S_n(a,b,c)\), \(S_{n,n}(a,b,c)= S_n(a+1,b,c)\). By (3.2), we also have

$$\begin{aligned} S_{k,n}(a,b,c) = \int _{[1,\dots ,1]_p} \prod _{i=1}^k x_{\sigma _i} \prod _{1\leqslant i<j\leqslant n} (x_i-x_j)^{2c} \prod _{i=1}^nx_i^a (1-x_i)^b\, {\mathrm{d}}x_1\dots {\mathrm{d}}x_n \end{aligned}$$

for any \(1\leqslant \sigma _1<\dots <\sigma _k\leqslant n\).

Lemma 4.2

We have \(S_n(a,b+p,c) = S_n(a,b,c)\).

Proof

We have \((1-x_i)^{b+p} = (1-x_i)^{b}(1-x_i)^{p} =(1-x_i)^{b}(1-x_i^p)\). Hence the factors \((1-x_i)^{b}\) and \((1-x_i)^{b+p}\) contribute to the coefficient of \(x_i^{p-1}\) in the same way. \(\square \)

Lemma 4.3

If \(a+b+(2n-2)c < 2p-2\) and \(c>0,\) then \(n<p\). \(\square \)

Lemma 4.4

If \(a+b+(n-1)c < p-1,\) then \(S_n(a,b,c)=0\).

Proof

The coefficient of \(x_1^{p-1}\dots x_n^{p-1}\) in the expansion of \(\Phi (a,b,c)\) equals zero. \(\square \)

Lemma 4.5

If \(p\leqslant a+(n-1)c,\) then \(S_n(a,b,c)=0\).

Proof

Expand \(\Phi (x,a,b,c)\) in monomials \(x_1^{d_1}\dots x_n^{d_n}\). If \(p\leqslant a+(n-1)c\), then each monomial \(x_1^{d_1}\dots x_n^{d_n}\) in the expansion has at least one of \(d_1,\dots ,d_n\) greater than \(p-1\), Hence the coefficient of \(x_1^{p-1}\dots x_n^{p-1}\) in the expansion equals zero. \(\square \)

Lemma 4.6

If \(a+b+(2n-2)c<2p-1,\) then \(S_n(a,b,c)=S_n(b,a,c)\).

Proof

Expand \(\Phi (x,a,b,c)\) in monomials \(x_1^{d_1}\dots x_n^{d_n}\). If \(a+b+(2n-2)c <2p-1\), then

(a) for each monomial \(x_1^{d_1}\dots x_n^{d_n}\) in the expansion all of \(d_1,\dots ,d_n\) are less than \(2p-1\).

We also have

$$\begin{aligned} \Phi (1-y_1,\dots ,1-y_n,a,b,c)= \prod _{1\leqslant i<j\leqslant n} (y_i-y_j)^{2c} \prod _{i=1}^ny_i^a (1-y_i)^b. \end{aligned}$$

This transformation does not change the \({{\mathbb {F}}}_p\)-integral due to Lucas’ Theorem and property (a), see a similar reasoning in the proof of [36, Lemma 5.2]. \(\square \)

4.3 Case \(a+b+(n-1)c=p-1\)

Lemma 4.7

If \(a+b+(n-1)c=p-1,\) then

$$\begin{aligned} S_n(a,b,c) = (-1)^{bn+cn(n-1)/2}\,\frac{(cn)!}{(c!)^n}. \end{aligned}$$
(4.10)

Proof

If \(a+b+(n-1)c=p-1\), then \(S_n(a,b,c)\) equals \((-1)^{bn}\) multiplied by the coefficient of \((x_1\dots x_n)^c\) in \(\prod _{1\leqslant i<j\leqslant n} (x_i-x_j)^{2c}\), which equals \((-1)^{cn(n-1)/2}\frac{(cn)!}{(c!)^n}\) by Dyson’s formula

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

Here C.T. denotes the constant term. See the formula in [2, Section 8.8]. \(\square \)

Lemma 4.8

If \(a+b+(n-1)c=p-1,\) then

$$\begin{aligned} P_n(a,b,c) =(-1)^{bn+cn(n-1)/2}\,\frac{(cn)!}{(c!)^n}. \end{aligned}$$
(4.12)

Proof

We have

$$\begin{aligned} P_n(a,b,c)= & {} (-1)^n\, \prod _{j=1}^n \frac{(jc)!}{c!}\, \frac{(a+(j-1)c)!\,(b+(j-1)c)!}{(a+b + (n+j-2)c+1-p)!} \\= & {} (-1)^n\,\prod _{j=1}^n \frac{(jc)!}{c!}\, \frac{(a+(j-1)c)!\,(b+(j-1)c)!}{c!\,(2c)!\dots ((n-1)c)!}. \end{aligned}$$

By Lemma 2.2 we have \(a!\,(b+(n-1)c)! = (-1)^{b+(n-1)c+1}\), \((a+c)!\,(b+(n-2)c)! = (-1)^{b+(n-2)c+1}\), and so on. This proves the lemma. \(\square \)

Lemmas 4.7 and 4.8 prove formula (4.4) for \(a+b+(n-1)c=p-1\).

4.4 Aomoto Recursion

We follow the paper [3], where recurrence relations were developed for the classical Selberg integral. See also [2, Section 8.2].

Using Lemma 3.2, for \(k=1,\dots ,n\) we have

$$\begin{aligned} 0&= \int _{[1,\dots ,1]_p} \frac{\partial }{\partial x_1} \bigg [(1-x_1)\prod _{i=1}^k x_i \Phi (x,a,b,c)\bigg ] {\mathrm{d}}x_1\dots {\mathrm{d}}x_n \nonumber \\&= (a+1) \int _{[1,\dots ,1]_p} (1-x_1)\prod _{i=2}^k x_i \Phi (x,a,b,c) {\mathrm{d}}x_1\dots {\mathrm{d}}x_n \nonumber \\&\quad - (b+1) \int _{[1,\dots ,1]_p} \prod _{i=1}^k x_i \Phi (x,a,b,c) {\mathrm{d}}x_1\dots {\mathrm{d}}x_n \nonumber \\&\quad + 2c \int _{[1,\dots ,1]_p} \sum _{j=2}^n \frac{1-x_1}{x_1-x_j} \prod _{i=1}^k x_i \Phi (x,a,b,c) {\mathrm{d}}x_1\dots {\mathrm{d}}x_n. \end{aligned}$$
(4.13)

Lemma 4.9

The \({{\mathbb {F}}}_p\)-integral

$$\begin{aligned} \int _{[1,\dots ,1]_p}\frac{1}{x_1-x_j}\,\prod _{i=1}^kx_i\,\Phi (x,a,b,c)\, {\mathrm{d}}x_1\dots {\mathrm{d}}x_n \end{aligned}$$
(4.14)

equals 0 if \(2\leqslant j\leqslant k\) and equals \(S_{k-1,n}/2\) if \(k<j\leqslant n\). The \({{\mathbb {F}}}_p\)-integral

$$\begin{aligned}&\int _{[1,\dots ,1]_p}\frac{x_1}{x_1-x_j}\,\prod _{i=1}^kx_i\,\Phi (x,a,b,c)\, {\mathrm{d}}x_1\dots {\mathrm{d}}x_n \end{aligned}$$
(4.15)

equals \(S_{k,n}/2\) if \(2\leqslant j\leqslant k\) and equals \(S_{k,n}\) if \(k<j\leqslant n\).

Proof

By Lemma 3.1 each of these integrals does not change if \(x_1,x_j\) are permuted. The four statements of the lemma hold since \(\frac{x_1x_j}{x_1-x_j}+\frac{x_1x_j}{x_j-x_1}=0\), \(\frac{x_1}{x_1-x_j}+\frac{x_j}{x_j-x_1}=1\), \(\frac{x_1^2x_j}{x_1-x_j}+\frac{x_1x_j^2}{x_j-x_1}=x_1x_j\), \(\frac{x_1^2}{x_1-x_j}+\frac{x_j^2}{x_j-x_1}=x_1+x_j\), respectively. \(\square \)

Lemma 4.10

For \(k=1,\dots ,n\) we have

$$\begin{aligned} S_{k,n}=\frac{a+(n-k)c+1}{a+b+(2n-k-1)c+2}\,S_{k-1,n}. \end{aligned}$$
(4.16)

Proof

Using Lemma 4.9 we rewrite (4.13) as

$$\begin{aligned} 0 = (a+1)S_{k-1,n} - (a+b+2)S_{k,n} + c(n-k)S_{k-1,n} - c(2n-k-1)S_{k,n}. \end{aligned}$$

\(\square \)

4.5 Proof of Theorem 4.1

Theorem 4.1 is proved by induction on a and b. The base induction step \(a+b+(n-1)c=p-1\) is proved in Sect. 4.3.

Lemma 4.10 gives

$$\begin{aligned} S_n(a+1,b,c) = S_n(a,b,c)\, \prod _{j=1}^n \frac{a+(n-j)c+1}{a+b+(2n-j-1)c+1}. \end{aligned}$$

Together with the symmetry \(S_n(a,b,c)=S_n(b,a,c)\) this gives formula (4.4). Then formula (4.16) gives formula (4.6). Theorem 4.1 is proved.

4.6 Relation to Jacobi Polynomials

The statements (4.6) for different values of k can be captured in a single equation, which involves a Jacobi polynomial—like it was done by K. Aomoto in [3] for the classical Selberg integral. Recall that the degree n Jacobi polynomial is

$$\begin{aligned} P^{(n)}_{\alpha ,\beta }(x)=\frac{1}{n!}\sum _{\nu =0}^n \left( {\begin{array}{c}n\\ \nu \end{array}}\right) \prod _{i=1}^\nu (n+\alpha +\beta +i)\prod _{i=\nu +1}^n(\alpha +i) \left( \frac{x-1}{2}\right) ^\nu . \end{aligned}$$

Proposition 4.11

Assuming inequalities (4.5) let \(\alpha =(a+1)/c-1,\) \(\beta =(b+1)/c-1\). Then

$$\begin{aligned}&\int _{[1,\ldots ,1]_p} \prod _{i=1}^n (x_i-t) \cdot \Phi (x,a,b,c) {\mathrm{d}}x_1\ldots {\mathrm{d}}x_n\nonumber \\&\quad = \frac{n!c^n \cdot S_n(a,b,c)}{\prod _{i=n-1}^{2n-2} (a+b+ic+2)} \cdot P^{(\alpha ,\beta )}_n(1-2t). \end{aligned}$$
(4.17)

The proof is the same is in [3]: After expanding \(\prod _{i=1}^n (x_i-t)\) we have the sum of integrals of the type

$$\begin{aligned} \int _{[1,\ldots ,1]_p} x_{\sigma _1}x_{\sigma _2}\ldots x_{\sigma _k} \Phi (x,a,b,c) {\mathrm{d}}x_1\ldots {\mathrm{d}}x_n, \end{aligned}$$

which—by symmetry (3.2)—are equal to \(S_{k,n}(a,b,c)\). Substituting

$$\begin{aligned} S_{k,n}(a,b,c)= S_n(a,b,c)\cdot \prod _{j=1}^k\frac{a+(n-j)c+1}{a+b+(2n-j-1)c+2}\end{aligned}$$

from (4.4) and (4.6) yields (4.17).

5 \({{\mathbb {F}}}_p\)-Selberg Integral from Morris’ Identity

5.1 Morris’ Identity

In this section we work out the integral formula (4.4) for the \({{\mathbb {F}}}_p\)-Selberg integral from Morris’ identity. Suppose that \(\alpha ,\beta ,\gamma \) are nonnegative integers. Then

$$\begin{aligned}&{\text {C.T.}}\,\prod _{i=1}^n (1-x_i)^\alpha (1-1/x_i)^\beta \prod _{1\leqslant j\ne k\leqslant n} (1-x_j/x_k)^\gamma \nonumber \\&\quad = \prod _{j=1}^n \frac{(j\gamma )!}{\gamma !}\, \frac{(\alpha +\beta +(j-1)\gamma )!}{(\alpha +(j-1)\gamma )!\,(\beta +(j-1)\gamma )!}. \end{aligned}$$
(5.1)

Morris identity was deduced in [16] from the integral formula (4.1) for the classical Selberg integral, see [2, Section 8.8].

The left-hand side of (5.1) can be written as

$$\begin{aligned} {\text {C.T.}}\,(-1)^{\left( {\begin{array}{c}n\\ 2\end{array}}\right) \gamma + n\beta } \prod _{1\leqslant i<j\leqslant n}(x_i-x_j)^{2\gamma } \prod _{i=1}^n x_i^{-\beta -(n-1)\gamma }(1-x_i)^{\alpha +\beta }, \end{aligned}$$
(5.2)

while

$$\begin{aligned} S_n(a,b,c) = {\text {C.T.}}\, \prod _{1\leqslant i<j\leqslant n}(x_i-x_j)^{2c} \prod _{i=1}^n x_i^{a+1-p}(1-x_i)^{b}, \end{aligned}$$
(5.3)

where the constant term is projected to \({{\mathbb {F}}}_p\).

Putting \(a +1-p = -\beta -(n-1)\gamma , \, b=\alpha +\beta , c= \gamma \), or

$$\begin{aligned} \alpha = a+b+(n-1)c+1-p,\quad \beta = p-a-(n-1)c-1,\quad \gamma = c. \end{aligned}$$
(5.4)

we obtain the following theorem.

Theorem 5.1

If the nonnegative integers abc satisfy the inequalities

$$\begin{aligned} p-1\leqslant a+b+(n-1)c,\quad a+(n-1)c\leqslant p-1, \end{aligned}$$
(5.5)

then the \({{\mathbb {F}}}_p\)-Selberg integral is given by the formula : 

$$\begin{aligned} S_n(a,b,c)= & {} (-1)^{\left( {\begin{array}{c}n\\ 2\end{array}}\right) c + na} \nonumber \\&\times \, \prod _{j=1}^n \frac{(jc)!}{c!}\, \frac{(b +(j-1)c)!}{(p-a-(n-j)c-1)!\,(a+b +(n+j-2)c+1-p)!},\nonumber \\ \end{aligned}$$
(5.6)

where the integer on the right-hand side is projected to \({{\mathbb {F}}}_p\).

Lemma 5.2

If both inequalities (4.3) and (5.5) hold,  that is,  if

$$\begin{aligned}&p-1\leqslant a+b+(n-1)c, \quad a+b+(2n-2)c< 2p-1, \end{aligned}$$
(5.7)
$$\begin{aligned}&a+(n-1)c\leqslant p-1, \end{aligned}$$
(5.8)

then in \({{\mathbb {F}}}_p\) we have

$$\begin{aligned}&(-1)^{\left( {\begin{array}{c}n\\ 2\end{array}}\right) c + na} \prod _{j=1}^n \frac{(jc)!}{c!}\, \frac{(b +(j-1)c)!}{(p-a-(n-j)c-1)!\,(a+b +(n+j-2)c)!},\nonumber \\&\quad =\,(-1)^n\,\prod _{j=1}^n \frac{(jc)!}{c!}\, \frac{(a+(j-1)c)!\,(b+(j-1)c)!}{(a+b + (n+j-2)c+1-p)!}, \end{aligned}$$
(5.9)

and hence (5.6)

$$\begin{aligned} S_n(a,b,c)= (-1)^n\,\prod _{j=1}^n \frac{(jc)!}{c!}\, \frac{(a+(j-1)c)!\,(b+(j-1)c)!}{(a+b + (n+j-2)c+1-p)!}. \end{aligned}$$
(5.10)

Notice that by Lemma 4.5 we have \(S_n(a,b,c)=0\) if inequality (5.8) does not hold.

Proof

We have

$$\begin{aligned} \prod _{j=1}^n \frac{1}{(p-a-(n-j)c-1)!}= & {} \prod _{j=1}^n \frac{(a+(n-j)c)!}{(p-a-(n-j)c-1)!\,(a+(n-j)c)!}\\= & {} \prod _{j=1}^n (-1)^{a+(n-j)c+1}(a+(n-j)c)!, \end{aligned}$$

by Lemma 2.3. This implies the Lemma 5.2. \(\square \)

5.2 More on Values of \(S_n(a,b,c)\)

Theorem 5.3

If inequalities (5.5) hold and \(a=p-1-(n-1)c-k,\) then

$$\begin{aligned}&S_n(p-1-(n-1)c-k,b,c) = (-1)^{\left( {\begin{array}{c}n\\ 2\end{array}}\right) c + na} \,\frac{(nc)!}{(c!)^n}\, \prod _{j=1}^n \frac{\left( {\begin{array}{c}b+(j-1)c\\ k\end{array}}\right) }{\left( {\begin{array}{c}(j-1)c+k\\ k\end{array}}\right) }, \end{aligned}$$
(5.11)

where the integer in the right-hand side is projected to \({{\mathbb {F}}}_p\). \(\square \)

Notice that the projections to \({{\mathbb {F}}}_p\) of the binomial coefficients \(\left( {\begin{array}{c}b+(j-1)c\\ k\end{array}}\right) \) can be calculated by Lucas’s Theorem and both integers in the binomial coefficients \(\left( {\begin{array}{c}(j-1)c+k\\ k\end{array}}\right) \) are nonnegative and less than p.

Proof

We have

$$\begin{aligned}&\frac{(\alpha +\beta +(j-1)\gamma )!}{(\alpha +(j-1)\gamma )!\,(\beta +(j-1)\gamma )!} =\left( {\begin{array}{c}\alpha +\beta +(j-1)\gamma \\ \beta \end{array}}\right) \prod _{i=1}^{(j-1)\gamma } \frac{1}{\beta + i}\\&\quad =\, \left( {\begin{array}{c}b +(j-1)c\\ p-a-(n-1)c-1\end{array}}\right) \prod _{i=1}^{(j-1)c} \frac{1}{p-a-(n-1)c-1 + i}. \end{aligned}$$

If \(a=p-1-(n-1)c-k\), then this equals

$$\begin{aligned} \left( {\begin{array}{c}b +(j-1)c\\ k\end{array}}\right) \prod _{i=1}^{(j-1)c} \frac{1}{k + i}= & {} \left( {\begin{array}{c}b +(j-1)c\\ k\end{array}}\right) \frac{k!}{((j-1)c)!\,\prod _{i=1}^k ((j-1)c+i)}\, \\= & {} \frac{1}{((j-1)c)!}\frac{\left( {\begin{array}{c}b +(j-1)c\\ k\end{array}}\right) }{\left( {\begin{array}{c}(j-1)c+k\\ k\end{array}}\right) }. \end{aligned}$$

Substituting this to (5.6) we obtain (5.11). \(\square \)

Example

Formula (5.11) gives

$$\begin{aligned} S_2(p-c-1,b,c) = (-1)^c \left( {\begin{array}{c}2c\\ c\end{array}}\right) , \quad S_2(p-c-2,b,c) = (-1)^c \left( {\begin{array}{c}2c\\ c\end{array}}\right) \,\frac{b(b+c)}{c+1}, \end{aligned}$$

and so on. Notice that these values are not given by Theorem 4.1. See more examples in Fig. 1.

Fig. 1
figure 1

Tables of \(S_1(a,b,-)\), \(S_2(a,b,3)\), \(S_3(a,b,3)\) values for \(p=11\) and small integers ab. Yellow shading indicates the range covered by Theorem 4.1, and the dotted lines enclose the region covered by Theorem 5.1. The structure of the gray shading is discussed in Sect. 5.3

5.3 Factorization Properties

By Lemmas 4.2 and 4.5 we have \(S_n(a,b+p,c) = S_n(a,b,c)\) and \(S_n(a,b,c)=0\) if \(a\geqslant p-(n-1)c\). Thus, for given c, it is enough to analyze \(S_n(a,b,c)\) in the rectangle \(\Omega =\{ (a,b) \ | \ a\in [0, p-1-(n-1)c], b\in [0,p-1]\}\). This rectangle is partitioned into n smaller rectangles :

$$\begin{aligned} \Omega _0(n,c)= & {} \{ (a,b) \ | \ a\in [0, \ p-1-(n-1)c], \ \ b\in [0,\ p-1-(n-1)c]\},\\ \Omega _i(n,c)= & {} \{ (a,b) \ | \ a\in [0,\ p-1-(n-1)c], \\&b\in [p-1-(n-i)c+1, \ p-1-(n-i-1)c]\}, \quad i=1,\dots , n-1, \end{aligned}$$

see the tables in Fig. 1. The values of \(S_n(a,b,c)\) in \(\Omega _0(n,c)\) are given by Theorem 4.1 and Lemma 4.4. The values of \(S_n(a,b,c)\) in a rectangle \(\Omega _i(n,c)\) are given by Theorem 4.1 and Lemma 4.4 also, but applied to \({{\mathbb {F}}}_p\)-Selberg integrals of smaller dimensions with the same value of c and suitable choices of values for a and b. Namely, we have the following factorization property.

Theorem 5.4

For \((a,b)\in \Omega _i(n,c)\) with \(i>0,\) we have

$$\begin{aligned} S_n(a,b,c)= & {} (-1)^{(n-i)ic}\,\left( {\begin{array}{c}nc\\ ic\end{array}}\right) \nonumber \\&\times \frac{\prod _{j=1}^{n-i}\left( {\begin{array}{c}p-1-(n-j)c-a\\ (j-1)c\end{array}}\right) \,\prod _{j=1}^{i}\left( {\begin{array}{c}p-1-(n-j)c-a\\ (j-1)c\end{array}}\right) }{\prod _{j=1}^{n}\left( {\begin{array}{c}p-1-(n-j)c-a\\ (j-1)c\end{array}}\right) }\nonumber \\&\times S_{n-i}(a+ic,b,c) \, S_{i}(a+(n-i)c, b+(n-i)c-p,c).\nonumber \\ \end{aligned}$$
(5.12)

Notice that all binomials \(\left( {\begin{array}{c}\alpha \\ \beta \end{array}}\right) \) in the second line of (5.12) have \(p>\alpha \geqslant \beta \geqslant 0\). Notice also that \((a+ic,b) \in \Omega _0(n-i,c)\) and \((a+(n-i)c,b+(n-i)c-p)\in \Omega _0(i,c)\), and hence Theorem 4.1 and Lemma 4.4 can be applied to \(S_{n-i}(a+ic,b,c)\) and \(S_{i}(a+(n-i)c, b+(n-i)c -p,c)\).

Proof

The theorem follows from formula (5.11) and Lucas’ Theorem. \(\square \)

6 A Remarkable Combinatorial Identity

In this section we sketch another proof of Theorem 4.1. We do this because at the heart of this proof there is a remarkable identity (Theorem 6.1) for polynomials in two variables.

Notation. Let cn be positive integers. For \(1\leqslant i< j\leqslant n\) we will consider non-negative integers \(0 \leqslant m_{ij} \leqslant 2c\) and we set \(\overline{m}_{ij}=2c-m_{ij}\). For \(1\leqslant k\leqslant n\) define

$$\begin{aligned} r_k=\sum _{1\leqslant i<k} \overline{m}_{ik} + \sum _{k<i\leqslant n} m_{ki}, \quad s_k=\sum _{1\leqslant i<k} m_{ik} + \sum _{k<i\leqslant n} \overline{m}_{ki}. \end{aligned}$$

We will use the Pochhammer symbol \((x)_m=x(x+1)(x+2)\cdots (x+m-1)\).

Theorem 6.1

Let \(n\geqslant 2,\ c\geqslant 1\) be positive integers. In \({\mathbb {Z}}[x,y]\) we have the identity

$$\begin{aligned}&\sum _{\mathbf{m}} \left( (-1)^{\sum _{i<j} m_{ij}} \prod _{i<j} \left( {\begin{array}{c}2c\\ m_{ij}\end{array}}\right) \cdot \prod _{k=1}^n (x)_{r_k} (y)_{s_k} \right) \\&\quad = \prod _{k=1}^{n-1}\frac{((k+1)c)!}{c!}(x)_{kc}(y)_{kc} (x+y+(2n-k-2)c)_{kc}, \end{aligned}$$

where by \(\sum _{\mathbf{m}}\) we mean the \(\left( {\begin{array}{c}n\\ 2\end{array}}\right) \)-fold summation \( \sum _{m_{12}=0}^{2c} \sum _{m_{13}=0}^{2c} \sum _{m_{14}=0}^{2c} \ldots \sum _{m_{n-1,n}=0}^{2c} \).

The summands of the left-hand side are of degree \(4c\left( {\begin{array}{c}n\\ 2\end{array}}\right) \) polynomials, and according to the theorem, their sum is the right-hand side, which is the product of degree \(3c\left( {\begin{array}{c}n\\ 2\end{array}}\right) \), with linear factors. The reader is invited to verify that for \(n=2\) the theorem reduces to a hypergeometric identity, namely Dixon’s Theorem [2, Theorem 3.4.1] on the factorization of \({}_3F_2\) with certain parameters. For instance the \(n=2, c=2\) case of Theorem 6.1 states that the sum of the terms

$$\begin{aligned}&(x+2)(x+3)(y+2)(y+3), \quad -4x(x+2)y(y+2), \quad 6x(x+1)y(y+1),\\&\quad -4x(x+2)y(y+2), \quad (x+2)(x+3)(y+2)(y+3) \end{aligned}$$

is \(12(x+y+2)(x+y+3)\) (here we canceled the factor \(xy(x+1)(y+1)\), which appears in each term and on the right-hand side as well). The explicit form of the identity for \(n=3\) is

$$\begin{aligned}&\sum _{m_{12}, m_{23}, m_{13}=0}^{2c} (-1)^{m_{12}+m_{13}+m_{23}} \left( {\begin{array}{c}2c\\ m_{12}\end{array}}\right) \left( {\begin{array}{c}2c\\ m_{23}\end{array}}\right) \left( {\begin{array}{c}2c\\ m_{13}\end{array}}\right) \\&\qquad \times \prod _{k=0}^{m_{12}+m_{13}-1} (x+k) \prod _{k=0}^{2c-m_{12}+m_{23}-1}(x+k) \prod _{k=0}^{4c-m_{13}-m_{23}-1}(x+k) \\&\qquad \times \prod _{k=0}^{4c-m_{12}-m_{13}-1} (y+k) \prod _{k=0}^{2c-m_{23}+m_{12}-1} (y+k) \prod _{k=0}^{m_{13}+m_{23}-1}(y+j) \\&\quad =\ \frac{(2c)!}{c!}\,\ \frac{(3c)!}{c!}\ \prod _{k=1}^c (x+k-1) (y+k-1) (x+y+4c-k) \\&\qquad \times \ \prod _{k=1}^{2c} (x+k-1) (y+k-1)(x+y+4c-k). \end{aligned}$$

Sketch of the proof of Theorem 6.1. Consider Eq. (4.1) for a positive integer c, that is, the classical Selberg integral formula in n dimensions. On the left-hand side we decouple the variables, i.e. we substitute \( (x_i-x_j)^{2c}=\sum _{m_{ij}=0}^{2c} \left( {\begin{array}{c}2c\\ m_{ij}\end{array}}\right) x_i^{m_{ij}}(-x_j)^{\overline{m}_{ij}}. \) We obtain

$$\begin{aligned}&\sum _{\mathbf{m}} \left( (-1)^{\sum _{i<j} m_{ij}} \prod _{i<j} \left( {\begin{array}{c}2c\\ m_{ij}\end{array}}\right) \cdot \prod _{k=1}^n \left( \int _0^1 x_k^{a+r_k}(1-x_k)^b {\mathrm{d}}x_k\right) \right) \\&\quad = \prod _{j=1}^n \frac{(jc)!}{c!} \frac{(a+(j-1)c)!(b+(j-1)c)!}{(a+b+(n+j-2)c+1)!}. \end{aligned}$$

Now writing \(\Gamma (a+r_k+1)\Gamma (b+1)/\Gamma (a+r_k+b+2)\) for the one-dimensional Selberg integrals on the left-hand side, and substituting

$$\begin{aligned} x=a+1 ,\quad y=-(a+2(n-1)c+b+1), \end{aligned}$$

the obtained identity rearranges to the statement in the theorem. \(\square \)

We believe that the identity in Theorem 6.1 is interesting in its own right, but here is a sketch of how to use the identity to prove Theorem 4.1.

Consider the left-hand side of (4.4), and carry out the same decoupling of variables as we did in the proof of Theorem 6.1. We obtain a sum, parameterized by choices of \(m_{ij}\), and in each summand we get a product of one-dimensional \({{\mathbb {F}}}_p\)-Selberg integrals of the form \( \int _{[1]_p} x_k^{A_k}(1-x_k)^b {\mathrm{d}}x_k \) for some \(A_k\). Substituting the value \(-A_k!b!/(A_k+b+1-p)!\) for such a one-dimensional integral (formula (3.4)), we obtain an explicit formula (no integrals anymore!) for the left-hand side of (4.4). The summation Theorem 6.1 brings that sum to a product form, and one obtains exactly the right-hand side of (4.4).

In this proof one has to pay additional attention to the case \(a+b < p-1\), when some integrals \(\int _{[1]_p} x_k^{A_k}(1-x_k)^b {\mathrm{d}}x_k\) have \(A_k+b<p-1\) and are equal to zero by formula (3.5). Still in this case the sum of nonzero terms is transformed to the desired product by the identity of Theorem 6.1 with parameter c replaced by \(d:= a+b+(n-1)c+1-p\).

\(\square \)

7 KZ Equations

7.1 Special Case of \({\mathfrak {sl}_2}\) KZ Equations Over \({{\mathbb {C}}}\)

Let efh be the standard basis of the complex Lie algebra \({\mathfrak {sl}_2}\) with \([e,f]=h\), \([h,e]=2e\), \([h,f]=-2f\). The element

$$\begin{aligned} \Omega = e \otimes f + f \otimes e + \frac{1}{2} h \otimes h\ \in \ {\mathfrak {sl}_2}\otimes {\mathfrak {sl}_2}\end{aligned}$$
(7.1)

is called the Casimir element. For \(i\in {{\mathbb {Z}}}_{\geqslant 0}\) let \(V_i\) be the irreducible \(i+1\)-dimensional \({\mathfrak {sl}_2}\)-module with basis \(v_i, fv_i,\dots ,f^iv_i\) such that \(ev_i=0\), \(hv_i=iv_i\).

Let \(u(z_1,z_2)\) be a function taking values in \(V_{m_1}\otimes V_{m_2}\) and solving the KZ equations

$$\begin{aligned} \kappa \,\frac{\partial u}{\partial z_1} = \frac{\Omega }{z_1-z_2}\,u, \quad \kappa \,\frac{\partial u}{\partial z_2} = \frac{\Omega }{z_2-z_1}\,u, \end{aligned}$$
(7.2)

where \(\kappa \in {{\mathbb {C}}}^\times \) is a parameter of the equations. Let \({{\text {Sing}}}[m_1+m_2-2n]\) denote the space of singular vectors of weight \(m_1+m_2-2n\) in \(V_{m_1}\otimes V_{m_2}\),

$$\begin{aligned} {{\text {Sing}}}[m_1+m_2-2n] = \{v\in V_{m_1}\otimes V_{m_2}\ | \ hv = (m_1+m_2-2n)v, \ ev=0\}. \end{aligned}$$

This space is one-dimensional if the integer n satisfies \(0\leqslant n\leqslant {\text {min}}(m_1,m_2)\) and is zero-dimensional otherwise. According to [25], solutions u with values in \({{\text {Sing}}}[m_1+m_2-2n]\) are expressible in terms of n-dimensional hypergeometric integrals

$$\begin{aligned} u(z_1,z_2) = \sum _r u_r(z_1,z_2)\,f^{r}v_{m_1}\otimes f^{n-r}v_{m_2} \end{aligned}$$

with

$$\begin{aligned} u_r(z_1,z_2)= (z_1-z_2)^{m_1m_2/2\kappa }\int _C W_r(z_1,z_2,t) \Psi (z_1,z_2,t) \,{\mathrm{d}}t_1\dots {\mathrm{d}}t_n. \end{aligned}$$

Here the domain of integration is the simplex \(C=\{ t\in {{\mathbb {R}}}^n\ |\ z_1\leqslant t_n\leqslant \dots \leqslant t_1\leqslant z_2\}\). The function \(\Psi (z_1,z_2, t)\) is called the master function,

$$\begin{aligned} \Psi (z_1,z_2, t) = \prod _{1\leqslant i<j\leqslant n} (t_i-t_j)^{2/\kappa } \prod _{i=1}^n(t_i-z_1)^{-m_1/\kappa }(t_i-z_2)^{-m_2/\kappa }, \end{aligned}$$

the rational functions \(W_r(z_1,z_2,t)\) are called the weight functions,

$$\begin{aligned} W_r(z_1,z_2,t) = \sum _{\begin{array}{c} J\subset \{1,\dots ,n\} \\ |J|=r \end{array}} \ \prod _{j\in J}\ \frac{1}{t_j-z_1}\ \prod _{j\notin J}\frac{1}{t_i-z_2}. \end{aligned}$$

The fact that u is a solution in \({{\text {Sing}}}[m_1+m_2-2n]\) implies that

$$\begin{aligned} (n-r)(m_2-n+r+1) u_r + (r+1)(m_1-r) u_{r+1} = 0,\quad r=1,\dots ,n-1.\nonumber \\ \end{aligned}$$
(7.3)

The coordinate functions \(u_r\) are generalizations of the Selberg integral. In fact, \(u_0\) and \(u_n\) are exactly the Selberg integrals. For example,

$$\begin{aligned} u_0(z_1,z_2)= & {} (z_1-z_2)^{m_1m_2/2\kappa }\!\! \int _C \prod _{1\leqslant i<j\leqslant n} \!\!\! (t_i-t_j)^{2/\kappa }\\&\times \prod _{i=1}^n(t_i-z_1)^{-m_1/\kappa }(t_i-z_2)^{-m_2/\kappa -1}{\mathrm{d}}t_1\dots {\mathrm{d}}t_n. \end{aligned}$$

The change of variables \(t_i = (z_2-z_1)s_i+z_1\) for \(i=1,\dots , n\) gives

$$\begin{aligned} u_0(z_1,z_2) = \frac{(-1)^A(z_1-z_2)^B}{n!}\,\tilde{S}_n\left( 1-\frac{m_1}{\kappa }, -\frac{m_2}{\kappa },\frac{1}{\kappa }\right) , \end{aligned}$$

where \({\tilde{S}}_n(\alpha ,\beta ,\gamma )\) denotes the Selberg integral (1.1), \(A=\frac{n(n-1-m_1)}{\kappa }+n\), \(B=\frac{m_1m_2-2n(m_1+m_2) + 2n(n-1)}{2\kappa }\). By formula (7.3), we obtain

$$\begin{aligned} u(z_1,z_2)= & {} \kappa ^n\,\frac{(-1)^A(z_1-z_2)^B}{n!}\, \prod _{j=1}^n \frac{\Gamma (1+\frac{j}{\kappa })}{\Gamma (1+\frac{1}{\kappa })}\, \frac{\Gamma (1-\frac{m_1-j+1}{\kappa })\,\Gamma (1-\frac{m_2-j+1}{\kappa })}{\Gamma (1-\frac{m_1+m_2-n-j+2}{\kappa })},\nonumber \\&\times \sum _{r=0}^n (-1)^r\left( {\begin{array}{c}n\\ r\end{array}}\right) \frac{f^rv_1\otimes f^{n-r}v_2}{\prod _{j=1}^r(m_1-j+1) \prod _{j=1}^{n-r}(m_2-j+1)}. \end{aligned}$$
(7.4)

7.2 Special Case of \({\mathfrak {sl}_2}\) KZ Equations Over \({{\mathbb {F}}}_p\)

Let p be an odd prime number. Let \(\kappa \) be a ratio of two integers not divisible by p. Let \(m_1, m_2 \) be positive integers such that \(m_1,m_2<p\). Consider the Lie algebra \({\mathfrak {sl}_2}\) over the field \({{\mathbb {F}}}_p\). Let \(V^p_{m_1}\), \(V^p_{m_2}\) be the \({\mathfrak {sl}_2}\)-modules over \({{\mathbb {F}}}_p\), corresponding to the complex representations \(V_{m_1}\), \(V_{m_2}\). Then the KZ differential equations (7.2) with values in \(V^p_{m_1}\otimes V^p_{m_2}\) are well-defined, and we may discuss their polynomial solutions in variables \(z_1,z_2\). Let

$$\begin{aligned} {{\text {Sing}}}[m_1+m_2-2n]_p = \{v\in V_{m_1}^p\otimes V_{m_2}^p\ | \ hv = (m_1+m_2-2n)v, \ ev=0\}. \end{aligned}$$

This space is one-dimensional, if the integer n satisfies \(0\leqslant n\leqslant {\text {min}}(m_1,m_2)\) and is zero-dimensional otherwise.

Choose the least positive integers \(M_1, M_2, M_{12}, c\) such that

$$\begin{aligned} M_i\equiv -\frac{m_i}{\kappa }, \quad M_{12}\equiv \frac{m_1m_2}{2\kappa },\quad c\equiv \frac{1}{\kappa }\quad ({\text {mod}}\,p). \end{aligned}$$
(7.5)

According to [26], solutions u with values in \({{\text {Sing}}}[m_1+m_2-2n]_p\) are expressible in terms of n-dimensional \({{\mathbb {F}}}_p\)-hypergeometric integrals

$$\begin{aligned} u(z_1,z_2) = \sum _r u_r(z_1,z_2)\,f^{r}v_{m_1}\otimes f^{n-r}v_{m_2} \end{aligned}$$
(7.6)

with

$$\begin{aligned} u_r(z_1,z_2)= (z_1-z_2)^{M_{12}}\int _{[1,\dots ,1]_p} W_r(z_1,z_2,t) \Psi _p(z_1,z_2,t) \,{\mathrm{d}}t_1\dots {\mathrm{d}}t_n, \end{aligned}$$

where \(\Psi _p(z_1,z_2, t)\) is the master polynomial,

$$\begin{aligned} \Psi _p(z_1,z_2, t) = \prod _{1\leqslant i<j\leqslant n} (t_i-t_j)^{2c} \prod _{i=1}^n(t_i-z_1)^{M_1}(t_i-z_2)^{M_2}. \end{aligned}$$

Theorem 7.1

Assume that \(M_1,M_2, M_{12}, c, n\) are positive integers such that

$$\begin{aligned}&M_1+(n-1)c< p, \quad M_2+(n-1)c< p,\nonumber \\&p\leqslant M_1+M_2+(n-1)c, \quad M_1+M_2+(2n-2)c < 2p-1. \end{aligned}$$
(7.7)

Then the function \(u(z_1,z_2),\) defined by (7.6),  is given by the formula

$$\begin{aligned} u(z_1,z_2)= & {} (-1)^A (z_1-z_2)^B\, \prod _{j=1}^n \frac{(jc)!}{c!}\, \frac{(M_1+(j-1)c)!\, (M_2+(j-1)c)!}{(M_1+M_2 +(n+j-2)c-p)!},\nonumber \\&\times \sum _{r=0}^n (-1)^r\left( {\begin{array}{c}n\\ r\end{array}}\right) \frac{f^rv_1\otimes f^{n-r}v_2}{\prod _{j=1}^r(M_1+(j-1)c) \prod _{j=1}^{n-r}(M_2+(j-1)c)}, \end{aligned}$$
(7.8)

where

$$\begin{aligned} A=n(M_1+(n-1)c +1),\quad B= M_{12}+n(M_1+M_2+(n-1)c-p). \end{aligned}$$

For \(n=1\) this is [38, Theorem 4.3].

Proof

The proof follows from the \({{\mathbb {F}}}_p\)-Selberg integral formula of Theorem 4.1 and formula (7.3), cf. Sect. 7.1. \(\square \)