{'fraction_non_alphanumeric': 0.07808456250099233, 'fraction_numerical': 0.020418208087896735, 'mean_word_length': 3.4094091290954913, 'pattern_counts': {'":': 0, '<': 50, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 23, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Double affine Hecke algebras and bispectral quantum Knizhnik-Zamolodchikov equations

We use the double affine Hecke algebra of type GL_N to construct an explicit consistent system of q-difference equations, which we call the bispectral quantum Knizhnik-Zamolodchikov (BqKZ) equations. BqKZ includes, besides Cherednik's quantum affine KZ equations associated to principal series representations of the underlying affine Hecke algebra, a compatible system of q-difference equations acting on the central character of the principal series representations. We construct a meromorphic self-dual solution \Phi of BqKZ which, upon suitable specializations of the central character, reduces to symmetric self-dual Laurent polynomial solutions of quantum KZ equations. We give an explicit correspondence between solutions of BqKZ and solutions of a particular bispectral problem for the Ruijsenaars' commuting trigonometric q-difference operators. Under this correspondence \Phi becomes a self-dual Harish-Chandra series solution \Phi^+ of the bispectral problem. Specializing the central character as above, we recover from \Phi^+ the symmetric self-dual Macdonald polynomials.

Let H be the extended affine Hecke algebra of type GL N . For fixed ζ ∈ T the vector space M admits an H-module structure, turning M into the principal series module M (ζ) of H with central character ζ. The BqKZ naturally splits up into two subsystems of q-difference equations. The first subsystem acts only on the first T -component of T × T and as such it realizes, for any fixed ζ ∈ T , Cherednik's [9] quantum affine KZ equation qKZ ζ acting on M (ζ)-valued meromorphic functions on T × {ζ}. The second, dual subsystem is obtained from the first by replacing the role of (t, ζ) ∈ T × T by (ζ −1 , t −1 ) and conjugating the q-connection matrices by an explicit complex linear automorphism C ι of M . Hence, it acts only on the second T -component of T × T and it essentially realizes qKZ t −1 for fixed t ∈ T . In particular, this provides a quantum isomonodromic interpretation of qKZ. This should be compared with the interpretation of rational KZ equations as quantizations of Schlesinger equations, see [38] and [22].
The BqKZ is constructed using Cherednik's [9] double affine Hecke algebra H of type GL N . As a vector space H is isomorphic to with H 0 the finite Hecke algebra of type A N −1 . Cherednik's antialgebra involution * : H → H essentially interchanges, under the above vector space identification, the role of the two copies of C[T ]. For w, w ′ ∈ W = S N ⋉ Z N we consider the map h → S w h S * w ′ (h ∈ H), where the S w ∈ H are Cherednik's nonnormalized (X-)intertwiners. Restricted to w, w ′ ∈ Z N , suitable renormalizations of these maps become the q-connection matrices of BqKZ, with H 0 playing the role of M . The anti-involution * of H gives rise to the automorphism C ι interchanging the qKZ subsystem of BqKZ with its dual subsystem in BqKZ.
qKZ ζ is gauge equivalent to Frenkel and Reshetikhin's [20] quantum KZ equations associated with the N -fold tensor product of the vector representation of quantum sl N (see [9, §1.3.2]). A special case of qKZ ζ was considered earlier by Smirnov [42]. Etingof and Varchenko [18] used quantum group methods to construct systems of q-difference equations (so-called dynamical q-difference equations) that are compatible with Frenkel and Reshetikhin's quantum KZ equations associated to evaluation representations of quantum affine algebras. It is likely that the system of dynamical q-difference equations associated with qKZ ζ is equivalent to the dual qKZ subsystem in BqKZ.
Preceding the above mentioned work [18] of Etingof and Varchenko, dynamical equations for various degenerations of quantum KZ equations have been analyzed in detail; see, e.g., [19], [47], [44], [46], [45] and [29]. An interesting aspect in, e.g., [47] and [46], is the observation that various degenerations of quantum KZ equations are the duals of their associated dynamical equations with respect to (gl r , gl s ) duality. In the present set-up (which corresponds to r = s = N ), this duality is incorporated by the automorphism C ι , which reflects Cherednik's duality anti-involution of the double affine Hecke algebra H on the level of BqKZ.
We investigate the space SOL of M -valued meromorphic solutions of BqKZ in detail. We first analyze BqKZ in a suitable asymptotic region. It leads to a solution Φ of BqKZ which is self-dual, in the sense that Φ(t, γ) = C ι Φ(γ −1 , t −1 ) as M -valued meromorphic functions in (t, γ) ∈ T × T . We construct a basis of solutions of SOL in terms of Φ, and we give an explicit formula for the leading term of Φ(t, γ) as function of t.
Cherednik [6,Thm. 3.4] constructed for arbitrary root systems a correspondence between solutions of quantum KZ equations and solutions of a system of q-difference equations. In [6,Thm. 4.4], Cherednik made the correspondence precise for GL N . It yields an explicit map χ + from solutions of qKZ ζ to solutions of the spectral problem of Ruijsenaars' [39] commuting trigonometric q-difference operators with spectral parameter ζ −1 (the Ruijsenaars operators are also frequently referred to as Macdonald-Ruijsenaars operators). The latter result has been generalized to arbitrary root systems in [26,Thm. 4.6] and [7]. We analyze the map χ + in the present bispectral setting. It leads to the interpretation of χ + as an embedding of SOL into the space of meromorphic solutions of a bispectral problem involving the above Ruijsenaars operators as well as Ruijsenaars operators acting on the spectral parameter.
The application of the correspondence to the self-dual solution Φ of BqZK leads to a self-dual Harish-Chandra series solution Φ + of the bispectral problem. Harish-Chandra series solutions of the Ruijsenaars operators with fixed spectral parameter were investigated before in, e.g., [15], [16], [27] and [31]. The present approach to Harish-Chandra series, which uses quantum KZ equations in an essential way, has the advantage that it leads to new results on the convergence and singularities of the Harish-Chandra series. These results, together with Cherednik's recent work [10], form important building blocks in deriving the c-function expansion of Cherednik's global (q, t)-spherical function (this will be detailed in a forthcoming paper of the second author).
The q-connection matrices of the dual qKZ subsystem of BqKZ can be used to map solutions of qKZ ζ for a fixed central character ζ ∈ T to solutions of qKZ ζ ′ with respect to a suitably shifted central character ζ ′ . Applied to a constant solution we obtain a symmetric Laurent polynomial solution Q λ for any non-increasing Ntuple λ of integers, which is automatically self-dual. We express Q λ in terms of a suitable specialization of the solution Φ of BqKZ. Applying χ + to Q λ we obtain a symmetric self-dual Laurent polynomial eigenfunction of the Ruijsenaars operators, which is the normalized Macdonald [32] polynomial of degree λ. We show that the well-known duality and evaluation formula for the Macdonald polynomials (see [32,Chpt. VI]) are direct consequences of the properties of the Laurent polynomials Q λ .
Many results in the present paper, in particular the BqZK equations themselves, can be extended to arbitrary root systems. These extensions use the root system generalizations of H and their fundamental properties (see [9]). We have chosen to restrict the present exposition to the GL N theory, not only in order to present the basic ideas while limiting the technicalities, but also because the GL N theory deserves extra attention by its particularly strong ties with quantum groups and quantum integrable lattice models (see, e.g., [14], [24]). The theory for arbitrary root systems is detailed in a forthcoming paper of the first author. Conventions -⊗ always stands for tensor product over C and End(M ), for a module M over C, stands for C-linear endomorphisms. We identify occasionally the set of labels by the group Z N of integers modulo N .
Write W Q for the affine Weyl group of affine type A N −1 . In terms of its Coxeter generators s i (i ∈ Z N ), the characterizing group relations are the quadratic relations s 2 i = 1 and, if N ≥ 3, the braid relations s i s i+1 s i = s i+1 s i s i+1 , The subgroup generated by s 1 , . . . , s N −1 is isomorphic to the symmetric group S N in N letters, where s i is identified with the simple transposition i ↔ i + 1.
Let Aut(D) be the group of automorphisms of the affine Dynkin diagram of type A N −1 . Let c ∈ Aut(D) the element of order N , acting on the label set Z N of the vertices of D by c(i) = i + 1. We view c as automorphism of W Q by c(s i ) = s i+1 .
Let Ω = π be the infinite cyclic group with cyclic generator π. It acts by group automorphisms on W Q by π → c. Accordingly we can define the semi-direct product group W = Ω ⋉ W Q , which is called the extended affine Weyl group (associated to GL N ). We denote e for the identity element of W .
Since s 0 = πs N −1 π −1 , the subgroups S N and Ω already generate W as a group. Furthermore we have W ≃ S N ⋉Z N . The cyclic generator π of Ω corresponds to π = σǫ N , where {ǫ i } N i=1 denotes the standard Z-basis of Z N and σ = s 1 s 2 · · · s N −1 ∈ S N is the "clockwise rotation" which maps N to 1 and all other i to i + 1. Conversely, (2.2) ǫ j = s j−1 · · · s 2 s 1 πs N −1 s N −2 · · · s j for j = 1, . . . , N .
Remark 2.1. Under the identification W ≃ S N ⋉ Z N , we have W Q = S N ⋉ Q with Q ⊂ Z N the sublattice of rank N − 1 consisting of N -tuples of integers that sum up to zero (this is the (co)root lattice of the root system R = {ǫ i − ǫ j } 1≤i =j≤N of type A N −1 ).
For w ∈ W let w ′ ∈ W Q and ω ∈ Ω be the unique group elements such that w = w ′ ω, then we define the length ℓ(w) of w to be the length of w ′ ∈ W Q , i.e., it is the minimal number r such that w ′ can be expressed as w ′ = s i1 · · · s ir for some i k ∈ Z N (such an expression of w ′ , as well as the resulting expression for w = w ′ ω, is called a reduced expression). Thus Ω consists of the elements of W of length zero.
A central role in this paper is played by an action of the extended affine Weyl group W by q-difference reflection operators on suitable function spaces on T := (C × ) N , where C × := C \ {0}. Here q is taken to be real and strictly between zero and one (with minor technical adjustments the condition on q may be relaxed to 0 < |q| < 1, and a parallel theory can be developed for |q| > 1). Since q is fixed once and for all, we will in general suppress the dependence on q in notations. We start with an action of W on T by for t = (t 1 , . . . , t N ) ∈ T . It is convenient to introduce κ λ := (κ λ1 , . . . , κ λN ) for κ ∈ C × and λ ∈ Z N , so that the action of λ ∈ Z N on t ∈ T can simply be written as λt = q λ t in standard vector notation. Note that the action of π ∈ Ω is given by Consider the algebra Let C(T ) be the field of rational functions on T , O(T ) be the ring of analytic functions on T , and M(T ) be the field of meromorphic functions on T . Note that M(T ) is the quotient field of O(T ) (cf. [23,Thm. 7.4.6]). The W -action on T gives rise to a left W -action by algebra automorphisms on for w ∈ W , t ∈ T . We can, in particular, form the smashed product algebra C(T )#W . Recall that if G is a group and A is a G-algebra over C (that is, a unital associative algebra over C endowed with a left G-action by algebra automorphisms), then the smashed product algebra A#G is the unique complex unital associative algebra such that are satisfied for a, b ∈ A and g, h ∈ G.
We will always write ag := a ⊗ g ∈ A#G (a ∈ A, g ∈ G). Observe that A#G canonically acts on any G-algebra B containing A as a G-subalgebra.
Note that the smashed product algebra C(T )#W depends on q, since the Waction on C(T ) depends on q (see (2.3)). Sometimes it is convenient to emphasize its q-dependence, in which case we write C(T )# q W instead of C(T )#W .
The canonical left C(T )#W -action on C(T ) (and M(T )) is faithful and realizes C(T )#W as the algebra of q-difference S N -reflection operators with coefficients in C(T ). If f ∈ C(T ) then we write f (X) for the associated element in C(T )#W (it is the operator defined as multiplication by f ). In particular, X i is multiplication by the coordinate function x i .

2.2.
The extended affine Hecke algebra and Cherednik's basic representation. In this subsection we recall some constructions and results due to Cherednik (see, e.g., [9, Chpt. 1] and references therein).
Fix a nonzero complex number k.
Definition 2.2. The affine Hecke algebra H Q = H Q (k) is the complex, unital, associative algebra generated by T i (i ∈ Z N ) and satisfying (2) the quadratic relations The Dynkin diagram automorphism c ∈ Aut(D) can also be viewed as automorphism of H Q by c(T i ) = T i+1 . Accordingly, Ω acts by algebra automorphisms on H Q by π → c. The extended affine Hecke algebra H = H(k) is the associated smashed product algebra H Q #Ω.
For a reduced expression w = s i1 · · · s ir ω ∈ W (i k ∈ Z N , ω ∈ Ω), the element The finite Hecke algebra is the subalgebra H 0 of H generated by T 1 , . . . , T N −1 . The elements T w (w ∈ S N ) form a linear basis of H 0 . Note that H is already generated as algebra by H 0 and π ±1 , since T 0 = πT N −1 π −1 . Put We have the following characterization of H, due to Bernstein. For details we refer to Lusztig [30] in H; and (iii) the following cross relations Cherednik realized the affine Hecke algebra H inside the algebra C(T )#W of q-difference reflection operators as follows.
Theorem 2.4. There is a unique injective algebra homomorphism ρ = ρ k,q : Note that for the affine Hecke algebra H = H(k) with fixed parameter k, Theorem 2.4 yields a one-parameter family of realizations of H (the additional parameter being q). We frequently identify H with its image under ρ in C(T )#W . We now come to the definition of Cherednik's double affine Hecke algebra which depends, besides on k, on the additional parameter q.
Definition 2.6. The double affine Hecke algebra H = H(k, q) is the subalgebra of C(T )# q W generated by ρ k,q (H) and by the multiplication operators f (X) (f ∈ C[T ]).
and h ∈ H. The following theorem is the so-called Poincaré-Birkhoff-Witt (PBW) property of the double affine Hecke algebra.
The PBW property is an essential ingredient in deriving the characterizing relations for the double affine Hecke algebra H in terms of its algebraic generators Since we are not going to use this presentation explicitly in this paper, we refer the reader to [9] for further details. We use though one of its direct consequences, namely the existence of the duality anti-isomorphism (see Cherednik [9,Thm. 1.4.8]): Theorem 2.8. There exists a unique C-linear anti-algebra involution * : H → H determined by

2.3.
Intertwiners. In this subsection we recall the construction of the (nonnormalized) affine intertwiners associated to the double affine Hecke algebra H. The intertwiners play an important role in the construction of a nontrivial W × Wcocycle in the next section. Consider the elements The following facts are well known (cf., e.g., [9, §1.3]). For the convenience of the reader, we give a short sketch of the proof.
Proposition 2.9. Let w ∈ W and let w = s j1 · · · s jr π m be a reduced expression in C(T )#W . By, e.g., Macdonald [34, (2.2.9)], we know that is independent of the reduced expression of w. Hence S w ∈ C(T )#W is well defined.
(ii) Note that S i can be written as which shows that it lies in H. Furthermore, π ±1 ∈ H, hence S ±1 π ∈ H and S 0 = π S N −1 π −1 ∈ H. Consequently, S w ∈ H ⊂ C(T )#W . (iii) is immediate from (i), while (iv) and (v) are clear from the definition of the S i and S π .
Definition 2.10. The elements S w (w ∈ W ) are called the affine intertwiners of H.

The bispectral quantum KZ equations
3.1. Construction of the cocycle. Let ι denote the nontrivial element of the two group Z 2 . We define the group W as the semidirect product where ι ∈ Z 2 acts on W × W by switching the components: ι(w, w ′ ) = (w ′ , w)ι for w, w ′ ∈ W . We first use the double affine Hecke algebra, its affine intertwiners, and its duality anti-isomorphism to construct a group homomorphism τ = τ k : W → GL C (H K 0 ) depending on the Hecke algebra parameter k, where K := M(T × T ) is the field of meromorphic functions on T × T .
The representation τ will be constructed from the complex linear endomorphisms σ (w,w ′ ) (w, w ′ ∈ W ) and σ ι of the double affine Hecke algebra H, defined by In the following lemma we collect some elementary properties of the maps σ (w,w ′ ) and σ ι . First we introduce some auxiliary notations.
For a regular function g ∈ C[T ], we write g(x) ∈ C[T × T ] (respectively g(y) ∈ C[T × T ]) for the corresponding regular function on T × T constant with respect to the second (respectively first) T -component. In particular, the x i (respectively y i ) are the standard coordinate functions of the first (respectively second) copy of Lemma 3.1. The complex linear endomorphisms σ (w,w ′ ) and σ ι of H satisfy the following properties: Proof. These are direct consequences of Proposition 2.9 and Theorem 2.8.
To construct a W-action from the maps σ (w,w ′ ) and σ ι , we need to renormalize the maps appropriately. To do so, we describe as a first step the behavior of the maps σ (w,w ′ ) and σ ι with respect to the L-module structure (2.6) on H. This will allow us to extend the maps σ (w,w ′ ) and σ ι to endomorphisms of H K 0 ≃ K ⊗ L H, which is a suitably flexible surrounding for the normalizations of the maps to take place in.
Consider the group involution ♦ : W → W defined by w ♦ = w for w ∈ S N and λ ♦ = −λ for λ ∈ Z N . Then W acts on T × T by . . , t −1 N ) ∈ T and the action of W on T is by q-dilations and permutations; see (2.3). By transposition, this defines an action of W on K = M(T × T ) by field automorphisms, Proof. From Proposition 2.9 we know that S w p(X) = (wp)(X) S w in H for p ∈ C[T ] and w ∈ W . For p ∈ C[T ] let p ♦ ∈ C[T ] be defined by p ♦ (t) = p(t −1 ), then we also have . The first formula of (3.2) now follows since (w ′ r ♦ ) ♦ = w ′♦ r. The second is immediate from the definition of the duality anti-involution.
As a direct consequence of Lemma 3.2 the maps σ (w,w ′ ) (w, w ′ ∈ W ) and σ ι uniquely extend to complex linear endomorphisms of H K 0 ≃ K ⊗ L H such that (3.2) is valid for all f ∈ K and h ∈ H K 0 . We keep the same notations σ (w,w ′ ) and σ ι for these maps. Note that the properties of σ (w,w ′ ) and σ ι as described in Lemma 3.1 also hold true as identities between endomorphisms of H K 0 . Theorem 3.3. There is a unique group homomorphism for w, w ′ ∈ W and f ∈ H K 0 . It satisfies τ (w)(g · f ) = wg · τ (w)(f ) for g ∈ K, f ∈ H K 0 and w ∈ W. Proof. The last statement is clear.
The action τ of W × {e} arises naturally from left multiplication by normalized affine intertwiners on a suitable localization of the double affine Hecke algebra (see Cherednik [9,§1.3]). In the present set-up, one observes that Lemma 3.2 and Lemma 3.1(i)-(ii) imply that the τ (s i , e) (i ∈ Z N ) satisfy the A N −1 braid relations and the quadratic relations τ (s i , e) 2 = id H K 0 . Since furthermore τ (π, e) is a complex linear automorphism of H K 0 with inverse τ (π −1 , e), and τ (π, e)τ (s i , e)τ (π −1 , e) = τ (s i+1 , e) for i ∈ Z N by Lemma 3.2 and Lemma 3.1(iii), we conclude that the formulas (3.3) for the maps τ (s i , e) (i ∈ Z N ) and τ (π, e) uniquely extend to a group homomorphism τ : W × {e} → GL C (H K 0 ). It follows from Proposition 2.9 and its proof that the resulting group homomorphism satisfies for w ∈ W . This is in accordance with formula (3.3).
Combining Lemma 3.1(iv) with Lemma 3.2 we can relate the complex endomorphism τ (e, w) (see (3.3)) of H K 0 to τ (w, e) by the formula (3.4) τ (e, w) = τ (ι)τ (w, e)τ (ι), where τ (ι) is given by the second formula of (3.3). Since τ (ι) 2 = σ 2 ι = id H K 0 we conclude that W ∋ w → τ (e, w) (see (3.3)) defines a left W -action on H K 0 . By Lemma 3.1 and Lemma 3.2 (v) we have τ (w, e)τ (e, w ′ ) = τ (w, w ′ ) = τ (e, w ′ )τ (w, e) for all w, w ′ ∈ W . Thus τ : W × W → GL C (H K 0 ), defined by the first formula of (3.3), is a group homomorphism. Combined with (3.4) and τ (ι) 2 = id H K 0 we conclude that τ (3.3) indeed defines a complex linear action of W on H K 0 . For w ∈ W and f ∈ H K 0 = K ⊗ H 0 we write wf for the action of w on the K-coefficients of f in its expansion along a basis of H 0 . In other words, viewing f (t, γ) as H 0 -valued meromorphic function in (t, γ) ∈ T × T , the action is given by (wf )(t, γ) = f (w −1 (t, γ)). Consider GL K (H K 0 ) as a W-group by the corresponding conjugation action ) by group automorphisms. We have the following direct consequence of the previous theorem.
For more details on non-abelian group cohomology, see, e.g., the appendix in [43].
is the K-linear extension of a complex linear endomorphism of H 0 . This is, for instance, the case for the cocycle value C ι (see Subsection 4.2).
Remark 3.6. One may replace in this subsection K by the field C(T × T ) of rational functions on T ×T . Consequently, the cocycle value C w (t, γ) for w ∈ W is a rational End(H 0 )-valued function in (t, γ) ∈ T × T . We presented the results with respect to K = M(T × T ) since this is the natural setting for the applications of the cocycle C in the analytic theory of the quantum KZ equations (to which we come at a later stage).

3.2.
Bispectral quantum KZ equations. In this subsection, we use the cocycle C w ∈ GL K (H K 0 ) (w ∈ W) to define a holonomic system of q-difference equations on the space H K 0 of H 0 -valued meromorphic functions on T × T . The constructions thus far have led to a C-linear action τ of W on H K 0 . In terms of the cocycle C w (w ∈ W), it is given by for w ∈ W and f ∈ H K 0 , where (3.6) should be read as identities between H 0 -valued meromorphic functions in (t, γ) ∈ T × T . It follows that viewed as identities between H 0 -valued meromorphic functions on T × T .
Definition 3.7. We call the q-difference equations (3.7) the bispectral quantum KZ (BqKZ) equations. We write SOL for the set of functions f ∈ H K 0 satisfying the BqKZ equations (3.7).
Let F ⊂ K denote the subfield consisting of f ∈ K satisfying (λ, µ)f = f for all λ, µ ∈ Z N . Let furthermore S N denote the subgroup Z 2 ⋉ (S N × S N ) of W.

The explicit form of the bispectral quantum KZ equations
In this section we derive explicit expressions for the cocycle values C w (w ∈ W) and, in particular, for the q-connection matrices C (λ,µ) (λ, µ ∈ Z N ) of the BqKZ. It will become apparent that the C (λ,e) (·, ζ) (λ ∈ Z N ) with ζ ∈ T fixed coincide with the q-connection matrices of Cherednik's quantum affine KZ equation associated to the principal series module of H(k) with central character ζ. They also turn up as gauged q-connection matrices for a Frenkel-Reshetikhin [20] type quantum KZ equation associated to the quantum affine algebra U k ( sl N ).
We occasionally view η(h) as End(H 0 )-valued regular function in γ ∈ T , in which case we write it as T ∋ γ → η(h)(γ). Extending the ground ring C[{1} × T ] to K = M(T × T ) we obtain an algebra homomorphism , which we shall also denote by η. From this viewpoint, η(h)(γ) is the regular End(H 0 )-valued function in (t, γ) ∈ T × T which is constant in t. Note that η(h) for h ∈ H 0 is constant as End(H 0 )-valued function on T × T (see Remark 3.5).
Lemma 4.1. For w ∈ S N and 1 ≤ i < N we have Proof. The first formula follows directly from the definitions. For the second formula it suffices to verify that · s j for some 1 ≤ j < N (and this is a reduced expression of w). We find, making repetitive use of the cross relation which is the desired relation in H.
The general case is now proved by induction on ℓ(w). Let w = 1 and decompose it as w = s i u with 1 ≤ i < N and u ∈ S N such that ℓ(s i u) = ℓ(u) + 1. Suppose that πT u = T σu Y u −1 (N ) in H. In order to prove that πT w = T σw Y w −1 (N ) we may, in view of the previous paragraph, assume without loss of generality that 1 ≤ i ≤ N − 2. Then s i (N ) = N and ℓ(s i+1 σu) = ℓ(σu) + 1. (The latter equality is equivalent to (σu) −1 (i + 1) < (σu) −1 (i + 2), which follows from u −1 (i) < u −1 (i + 1), which again is equivalent to the assumption ℓ(s i u) = ℓ(u) + 1.) Then in H, which completes the proof.
In view of the explicit expression (2.8) for the intertwiner S i ∈ H (1 ≤ i < N ) and the definition of the duality anti-involution, we have S * w ∈ H for all w ∈ S N . We now set and w ∈ S N ; see the proof of Lemma 3.2. Combining the two observations gives (4.3). It follows from Proposition viewed as a rational End(H 0 )-valued function in z. The results of the previous subsection implies that the R i (z) satisfy the following Yang-Baxter type equations (see Cherednik [9, §1.3.2]).
in view of the explicit expression (2.8) for S i , c k (2.5) and d si (see the proof of Lemma 2.9). For the second statement of the lemma, note that the cocycle property of C implies for 1 ≤ i < N and 1 ≤ j < N − 1 that Observe that C ι is the K-linear extension of the anti-algebra involution of H 0 mapping T w to T w −1 for all w ∈ S N . Note furthermore that Together with the explicit description of C (si,e) (1 ≤ i < N ) from the previous lemma, these formulas determine the values C w (w ∈ W) uniquely (cf. Corollary 3.4). In particular, the cocycle property of C implies that as End(H 0 )-valued rational functions in (t, γ) ∈ T × T .
Proof. By the cocycle condition, C (w,e) (t, γ) can be written as a product of factors C (si,e) (ut, γ) (1 ≤ i < N , u ∈ W ) and η(π ±1 )(γ). By Lemma 4.1 and the fact that R i (z) has a single pole at z = k −2 , we conclude (i) and (ii).
In the following lemma, we compute the q-connection matrices C (λ,e) for λ ∈ Z N of BqKZ explicitly in case λ is one of these two types of basis elements of Z N .
Proof. (i) By the cocycle property of C and by the expression (2.2) for ǫ j ∈ W , we obtain an explicit expression for C (ǫj ,e) in terms of the C (si,e) (1 ≤ i < N ) and C (π,e) . Combining (4.5) and the previous lemma then gives the desired expression for C (ǫj ,e) (t, γ).
so we find a reduced expression Combined with (4.7) we get a reduced expression for ̟ i . Using the cocycle condition for C w repeatedly, we get the desired result.
We end this subsection by computing the asymptotic leading terms of the q- Consider the subring We write Q(A) for its quotient field and Q 0 (A) for the subring of Q(A) consisting of rational functions which are analytic at the point as a subring of C(T × T ) in the natural way. The first part of the following corollary is a refinement of Lemma 4.4(i) in case w ∈ Z N .
Proof. To prove (4.9) it suffices, in view of the cocyle property of C, to verify (4.9) for λ = ǫ i . The statement then follows from Lemma 4.5(i), Lemma 4.1 and the explicit expression of R i (z).
Observe that lim z→0 R i (z) = kη(T −1 i ) for 1 ≤ i < N . Combined with Lemma 4.5(i) and the explicit expression for Y j (see (2.4)) we obtain for 1 ≤ j ≤ N , as |t αi | → 0 for all 1 ≤ i < N . To derive the asymptotics of C (λ,e) (t, γ) as |t −αi | → 0 for 1 ≤ i < N we use the cocycle property to write for w ∈ S N , as well as ), which is also denoted by η ζ . In this subsection we consider the BqKZ for specialized values of γ. In view of for the resulting specialized cocycle values, viewed as End(H 0 )-valued rational func- ). In other words, as rational H 0 -valued functions in t ∈ T . Comparing the cocycle values C ζ λ (λ ∈ Z N ) to the ones in [9, §1.3] we obtain the following result.
is Cherednik's quantum affine KZ equation associated to the principal H-module M (ζ) with central character ζ.
Remark 4.8. The quantum KZ equations (4.10) are gauge equivalent to Frenkel and Reshetikhin's [20] quantum KZ equations associated with the N -fold tensor product representation C N (t 1 ) ⊗ · · · ⊗ C N (t N ) of the quantum affine algebra U k ( sl N ), where C N (t i ) is the evaluation representation of the vector representation C N of U k (sl N ) (see [9, §1.3.2] and [14] for the details).
In view of Corollary 4.7 the BqKZ equations (3.7) are a holonomic extension of the quantum KZ equations (4.10) by q-difference equations in the central character ζ of M (ζ). These may be thought of as analogs of isomonodromy transformations; in fact, in view of Lemma 4.2 and Corollary 4.6 the q-difference equations in ζ (which are essentially the quantum KZ equations again!) are reminiscent of Schlesinger transformations. This should be compared with the quantum isomonodromic interpretation of (rational) KZ equations as quantizations of Schlesinger equations, see [38] and [22].
From a different perspective we may think of the cocycle values C (e,w) (w ∈ W ) as shift operators, in the sense that they map solutions of quantum KZ equations to solutions of quantum KZ equations with respect to shifted central characters.
To formulate the precise result, we view in the following proposition γ → C (e,w) (·, γ) as Proof. By the cocycle property we have for f ∈ SOL w ♦−1 ζ and λ ∈ Z N , Hence C (e,w) (·, ζ)f ∈ SOL ζ . The S N -equivariance of the map is again a consequence of the cocycle property of C w (w ∈ W); indeed, for v ∈ S N and f ∈ SOL w ♦−1 ζ we have which is the desired result.
From the quantum group perspective (see Remark 4.8), Proposition 4.9 resembles the action of the dynamical Weyl group on solutions of quantum KZ equations from [18]. We expect that the second half of the BqKZ is closely related to the Varchenko-Etingof dynamical difference equations [18, §9]; see also [19], [47], [44], [46], [45] and [29] for detailed studies of various degenerate cases. An interesting aspect, e.g., in [47] and [46], is the observation that KZ equations are dual to the associated dynamical equations using (gl r , gl s ) duality (our set-up relates to r = s = N ). In the present theory this duality is incorporated by the cocycle value C ι , which relates the q-connection matrices C (λ,e) (λ ∈ Z N ) of the quantum KZ equation to the dual q-connection matrices C (e,λ) by conjugation, as End(H 0 )-valued meromorphic functions in (t, γ) ∈ T × T . In turn, C ι is a direct reflection of (the existence of) Cherednik's duality anti-isomorphism of the double affine Hecke algebra (see Theorem 2.8).

Solutions of the bispectral quantum KZ equations
In this section we use asymptotic analysis to construct a ι-invariant solution Φ κ of BqKZ, which we call the basic asymptotically free solution. It depends in a mild way on an auxiliary parameter κ ∈ C × (in fact, FΦ κ is independent of κ). The orbit of Φ κ under the action of {e} × S N ⊂ S N turns out to be an F-basis of SOL consisting of asymptotically free solutions. Along the way we derive various additional properties of Φ κ . 5.1. The leading term. Let θ ∈ M(T ) denote the renormalized Jacobi theta function .
By Corollary 4.6, the formal asymptotic form of the quantum KZ equations Lemma 5.1. W κ ∈ K enjoys the following properties.
Observe that, more generally, W κ ∈ K satisfies the q-difference equations

5.2.
The basic asymptotically free solution Φ κ . We now gauge BqKZ by W κ ∈ K. Concretely, for λ, µ ∈ Z N we write The existence of a solution Ψ ∈ H K 0 of (5.6) admitting a convergent H 0 -valued power series expansion in the asymptotic region |t αi | ≫ 0 and |γ −αi | ≫ 0 (1 ≤ i < N ) is guaranteed by the following properties of the gauged q-connection matrices D (λ,µ) . Consider the subring . Write Q(B) for its quotient field and Q 0 (B) for the subring of Q(B) consisting of rational functions which are analytic at the point y αj = 0 (1 ≤ j < N ). We consider Q 0 (A) ⊗ B and A ⊗ Q 0 (B) as subrings of C(T × T ) in the natural way.
where we use (5.5) and (4.5) for the second equality, and Lemma 4.1 and σ N = e for the third equality.
(ii) Note that It follows from the explicit expressions for the cocycle values The statement for B j follows from this using the cocycle property C (e,̟j ) (t, γ) = (iii) Recall that ξ w = η( S * w −1 )T e with S w the intertwiners of H (see Proposition 2.9). By induction on ℓ(w), using the explicit expression (2.8) of the intertwiners S i , it follows that ξ w ∈ B ⊗ H 0 and that the value of ξ w at y By Corollary 4.6 and (5.5), To prove (5.9) we consider In addition, C ι restricts to the anti-algebra involution on H 0 mapping T w to T w −1 for w ∈ S N , hence Formula (5.9) then follows from specializing (5.11) at x −αi = 0 (1 ≤ i < N ) and replacing w by w 0 w −1 w 0 in the resulting formula.
For ǫ > 0, put B ǫ := {t ∈ T | |t αi | < ǫ, ∀i} and B −1 Theorem 5.3. There exists a unique solution Ψ ∈ H K 0 of the gauged equations (5.6) satisfying, for some ǫ > 0, (i) Ψ(t, γ) admits an H 0 -valued power series expansion Proof. It follows from the previous lemma that the commuting endomorphisms A all (a, b) ∈ S and i. Under these conditions, the holonomic system of q-difference equations (5.6) admits a unique solution Ψ satisfying the desired properties; see Theorem 8.6 in the appendix (to show that the gauged BqKZ falls in the class of holonomic systems of q-difference equations to which Theorem 8.6 applies, one should take M = 2(N −1), q i = q for 1 ≤ i < N and variables z i = x −αi and z N −1+j = y αj for 1 ≤ i, j < N in the appendix).
Remark 5.4. In a small neighborhood of a fixed (t ′ , γ ′ ) ∈ T × T , the meromorphic solution Ψ of (5.6) can be expressed in terms of the power series expansion (5.12) by the formula We call Φ κ := W κ Ψ ∈ SOL the basic asymptotically free solution of BqKZ.
Note that Φ κ ∈ F × Φ κ ′ for κ, κ ′ ∈ C × . The κ-flexibility will come in handy when we consider specializations of Φ κ . In the following subsections, we derive various properties of the basic asymptotically free solution Φ κ .
We first show that F µ β (γ) is regular at γ ∈ T \ S + . By (5.5) and by the cocycle is regular at γ = ζ for all 1 ≤ j ≤ N and ν ∈ Λ. The latter statement follows from the fact that R i (z) has only a (simple) pole at z = k −2 and from the explicit expression which follows from Lemma 4.5(ii) and the cocycle property of C.
Let U ⊂ T \ S + be a relatively compact open subset. Choose µ ∈ Λ such that the closure of q µ U is contained in B ǫ , where q µ U := {q µ γ | γ ∈ U }. As meromorphic with the sums converging normally on compacta of B −1 ǫ × U (note that the sums over β are finite). It follows that Γ α (α ∈ Q + ) has a unique H 0 -valued meromorphic extension to T which, on U , is given by such that Ψ on B −1 ǫ × U admits the power series expansion which converges normally on compacta of B −1 ǫ × U . It follows from (5.14) and the previous paragraph that Γ α is analytic on T \ S + .
The arguments from the proof of Lemma 5.7, applied to both torus variables of Ψ(t, γ) at the same time, directly lead to the following result.
Proposition 5.9. Let ζ ∈ T \ S + . (i) The H 0 -valued meromorphic function Ψ(t, γ) in (t, γ) ∈ T × T can be specialized at γ = ζ, giving rise to a meromorphic H 0 -valued function Ψ(t, ζ) in t ∈ T . It has the power series expansion Proof. (i) Restricting to t ∈ B −1 ǫ for ǫ > 0 small enough, the statement is correct by Lemma 5.7. If t ′ ∈ T is arbitrary then there exists a λ ∈ Λ such that q −λ t ′ ∈ B −1 ǫ . For t ∈ T in a small neighborhood of t ′ we then have 5.5. Evaluation formula. We write z; q ∞ = ∞ m=0 (1 − q m z) for the q-shifted factorial. Recall the power series expansion Ψ(t, γ) = α∈Q+ Γ α (γ)t −α for |t αi | ≫ 0 (1 ≤ i < N ) from Subsection 5.4. We call the following result the evaluation formula for the basic asymptotically free solution Φ κ = W κ Ψ of BqKZ, since it implies the celebrated evaluation formula for the Macdonald polynomials (see Subsection 7.4).
Theorem 5.10. We have Γ 0 (γ) = K(γ)T w0 with K ∈ M(T ) explicitly given by Proof. We use the notations of Lemma 5.2. Recall that Ψ satisfies the gauged In view of the proof of Lemma 5.2 and Lemma 5.7, it reduces in the limit |t −αi | → 0 (1 ≤ i < N ) to It remains to show that K is explicitly given by (5.16). Write L(γ) for the right hand side of (5.16). Then L ∈ M(T ) is characterized by the following three properties: It thus suffices to show that K(γ) satisfies the three properties (i)-(iii). It is clear that K ∈ M(T ) satisfies (i); see Subsection 5.4. Theorem 5.3(ii) implies (ii) for K. What remains is the verification of the q-difference equations (iii) for K. Using the notations of Lemma 5.2, we write where the second equality follows from a direct computation using the explicit expression (2.5) of c k . By (5.5) we have and C (e,̟j ) (t, γ) is given explicitly by (5.13). Since R i (z) = c k (z) −1 (η(T i ) − k) + 1, Lemma 4.1 and the reduced expression (4.8) for σ i imply that with ≤ the Bruhat order on S N and with with the sum running over w ∈ S N satisfying w ≤ σ −j and w(̟ j ) = w 0 (̟ j ). In particular, a j w0 (γ) = k − δ,̟j b j σ −j (γ). This completes the proof of (5.17). 5.6. Consistency of the bispectral quantum KZ equations. In this subsection, we show that BqKZ is a consistent system of q-difference equations, i.e., dim F (SOL) = dim C (H 0 ), by explicitly constructing an F-basis of SOL. Since the q-connection matrices C (λ,µ) (t, γ) (λ, µ ∈ Z N ) depend rationally on (t, γ) ∈ T × T , the consistency of BqKZ follows also from the abstract arguments in [13, §5].
We start with a preliminary lemma on the cocycle values C (e,w) for w ∈ S N .
Proof. Using the natural identification End(H 0 ) K ≃ End K (H K 0 ) as K-algebras, we need to verify that U ∈ GL K (H K 0 ). Set Φ w := τ (e, w)Φ κ and Ψ w := τ (e, w)Ψ for w ∈ S N , so that Φ w (t, γ) = W κ (t, w −1 γ)Ψ w (t, γ). Since C (e,w) (t, γ) is independent of t ∈ T , we simply write it as C (e,w) (γ). Recall the W -invariant subset S ⊂ T (see (4.6)), which contains S + . By Lemma 4.4 and Lemma 5.7, we have for some ǫ > 0 the power series expansion ǫ × T \ S, converging normally on compacta of B −1 ǫ × T \ S. We write Γ w α (γ) := C (e,w) (γ) Γ α (w −1 γ) in the remainder of the proof. It is a meromorphic function in γ ∈ T , analytic on T \ S, and the power series expansion of Ψ w becomes The matrix M (t, γ) may be specialized at γ = ζ and the limit of M (t, ζ) as t −αi → 0 (1 ≤ i < N ) exists. We write M (0) (ζ) for the limit and V (0) (ζ) for the corresponding linear endomorphism of H 0 . We then have given by (5.16). Note that K(w −1 ζ) = 0 since ζ α / ∈ q Z for all α ∈ R. By the explicit expression for the cocycle value C (e,w) (ζ) ∈ End(H 0 ) (see the proof of the previous lemma) we have Proof. (i) If U ′ is an End(H 0 )-valued meromorphic solution of BqKZ then, since U is invertible, we have for all λ, µ ∈ Z N , γ) for all λ, µ ∈ Z N (cf. the proof of (i)), hence f ∈ H F 0 . (iii) This is clear from (ii) and from the definition of U . By Proposition 5.9 and by the proofs of Lemma 5.12 and Proposition 5.13 we obtain the following consistency statement for the quantum KZ equation (4.10) with specialized central character (see [7] and [9]). Recall the W -invariant subset S ⊂ T given by (4.6). Recall furthermore that C (e,w) (t, γ) for w ∈ S N only depends on γ, so we simply write it as C (e,w) (γ).

The correspondence with bispectral problems
For a finite dimensional affine Hecke algebra module M , Cherednik [7, Thm. 4.2] derived, for arbitrary root systems, a correspondence between solutions of the quantum affine KZ equations associated to M and solutions of a system of (possibly matrix-valued) q-difference equations. This correspondence was considered before in [6, Thm. 3.4] for a special class of modules M , in which case the corresponding q-difference operators contain the Macdonald q-difference operator (the latter observation is due to Cherednik [6,Thm. 4.4] for GL N , and due to Kato [26,Thm. 4.6] and Cherednik [7] for general root systems). In the classical setting (q = 1) it goes back to Matsuo [35].
In the present GL N setting, with M = M (ζ) the minimal principal series module with specialized central character ζ ∈ T , these constructions give rise to an explicit map χ + (independent of ζ) from the solution space SOL ζ of the quantum KZ equation (4.10) to the solution space of the spectral problem for the commuting Ruijsenaars' [39] trigonometric q-difference operators with spectral parameter ζ −1 , see [6,Thm. 4.4] (for GL N the Macdonald q-difference operators coincide with the Ruijsenaars' operators). We recall this result in detail in Subsection 6.4.
In this section we investigate the map χ + when applied to solutions of the bispectral extension of the quantum KZ equations; see Subsection 3.2. In order to do so, we need to replace in the correspondence as described in the previous paragraph, the role of M (ζ) by the infinite dimensional, formal principal series module of H as defined in Subsection 4.1. We then show that the same map χ + gives rise to an embedding of the solution space SOL of BqKZ into the solution space of a bispectral problem for the Ruijsenaars operators. The techniques employed in this section are analogous to the ones for the usual correspondence (see [9,Chpt. 1]). For the convenience of the reader we provide full details of the arguments involved.
6.1. The monodromy cocycle. Observe that F ∈ End(H 0 ) K is a End(H 0 )valued meromorphic solution of BqKZ if and only if where the W-action τ on End(H 0 ) K is defined by for w ∈ W and F ∈ End(H 0 ) K , viewed as identities between End(H 0 )-valued meromorphic functions in (t, γ) ∈ T × T . By Proposition 5.13(i), given an End(H 0 )-valued meromorphic solution F of BqKZ, there exists a unique G ∈ End(H 0 ) F such that F = U G. Accordingly, G describes the deviation of F from the fundamental solution U of BqKZ, and therefore can be thought of as a connection matrix. We will consider the special cases when F are the End(H 0 )-valued meromorphic solutions τ (w)U (w ∈ W) of BqKZ.
For w ∈ W we set Note that End(H 0 ) F is a W-stable subalgebra of End(H 0 ) K with respect to the action (wF )(t, γ) = F (w −1 (t, γ)). The following lemma now shows that the T w (w ∈ W) define a cocycle of W with values in the group of units of End(H 0 ) F .

Proof. (i) This follows immediately from the fact that U is an End(H 0 )-valued meromorphic solution of BqKZ.
(ii) Note that T w = U −1 C w w(U ) for w ∈ W. By the cocycle condition for C w ∈ End(H 0 ) K , which reads in the present notations as for all w, w ′ ∈ W. Remark 6.3. Connection matrices and Riemann-Hilbert problems for ordinary linear q-difference equations have been extensively studied; see, e.g., [3] and [41]. For quantum KZ equations, connection matrices have been computed explicitly in, e.g., [20], [14, §12], and [27].
6.2. The correspondence. Consider the algebra C(T × T )#W, where W acts as field automorphisms on C(T × T ) by the formula (3.1). Recall that C(T × T )#W naturally acts on K. We write Df for the action of D ∈ C(T × T )#W on f ∈ K.
We have a representation ϑ : C(T × T )#W → End(End(H 0 ) K ) given by Under the natural action of C(T × T )#W on C(T × T ), the subalgebra D identifies with the algebra of q-difference operators on T × T with rational coefficients. Set H * 0 := Hom(H 0 , C). We will regard a linear functional χ ∈ H * 0 also as an element of Hom χ ∈ H * 0 , v ∈ H 0 for its matrix coefficients. Note that for any D ∈ C(T ×T )#W, χ ∈ H * 0 and v ∈ H 0 , (6.1) The second claim follows from the fact that T w = id for w ∈ Z N × Z N .
We now are going to look for a particular linear functional χ such that the matrix coefficients φ U χ,v (v ∈ H 0 ) of U solves a bispectral problem with respect to two commuting families of Ruijsenaars' trigonometric q-difference operators (one family acting on the first torus component, the second on the second torus component). In view of (6.1) and the previous lemma, to obtain q-difference equations for φ χ,v we have to deal with the cocycle value C w and the monodromy matrix T w in the . It is convenient to postpone the analysis of the monodromy cocycle by initially absorbing it into the action ϑ of C(T × T )#W via the twisted algebra homomorphism for F ∈ End(H 0 ) K . Note that ϑ T is indeed an algebra homomorphism, thanks to the cocycle condition for T . Moreover, ϑ T | D = ϑ| D .
For D ∈ C(T × T )#W we will occasionally use the notations . Reformulating (6.1) and Lemma 6.4 in terms of the twisted action ϑ T yields the following result.
for all χ ∈ H * 0 and v ∈ H 0 . Proof. (i) This is clear from Lemma 6.4 and the definition of ϑ T . (ii) By Lemma 6.4 and (6.1), we obtain The result now follows from (i).
We define the restriction map Res : Lemma 6.4(ii) implies that if we have a linear functional χ + ∈ H * 0 such that Lemma 6.6. Define χ + ∈ H * 0 by χ + (T w ) = k ℓ(w) for all w ∈ S N . Then Proof. Since C ι (T w ) = T w −1 for w ∈ S N we have χ + • C ι = χ + . By the cocycle condition for C w (w ∈ S N ) it remains to prove that χ + • C (si,e) = χ + for 1 ≤ i < N . But this follows from the expression If D ∈ C(T × T )#W satisfies ϑ T (D)U = λU for some λ ∈ K, then it follows from (6.3) that the matrix coefficients φ U χ+,v (v ∈ H 0 ) are eigenfunctions of Res(D) with eigenvalue λ. We will now construct such a commuting family of D's. It leads to the interpretation of the φ χ+,v (v ∈ H 0 ) as solutions of a bispectral problem.
The appropriate elements D ∈ C(T × T )#W are obtained as images of elements from the center Z(H) of the affine Hecke algebra H under the faithful algebra homomorphism ρ from Theorem 2.4. Since we aim at a bispectral version, we will interpret ρ as algebra map ρ : H → C(T × T )#W in two different ways. We have, on the one hand, the algebra homomorphism Remark 6.8. Let • : H(k −1 ) → H(k) be the algebra isomorphism defined by π • = π and T • i = T −1 i for 1 ≤ i < N . Then This follows by verifying the identity ρ y k,q −1 (h • ) = ιρ x k −1 ,q (h)ι for the algebraic generators π and T i (1 ≤ i < N ) of H(k −1 ) using Theorem 2.4.
Recall the formal principal series representation, encoded by the algebra homomorphism η : H(k) → End(H 0 ) K (see Subsection 4.1).
where we used that c k −1 (z −1 ) = c k (z) in the first equality, while the second equality follows from Lemma 6.5(i) and the third equality from Lemma 4.3.
(ii) Unfortunately it is not possible to derive (ii) directly from (i) and from (6.5). Instead, one has to repeat the steps of the proof of (i). It again amounts to verifying (6.7) for h = π ∈ H(k) and for h = T i ∈ H(k) (1 ≤ i < N ). We show the second case, the first case is left to the reader.
Let 1 ≤ i < N . Then we have for T i ∈ H(k), Since C (e,si ) = C ι ι(C (si ,e) )C ι by the cocycle condition (recall Remark 3.5) and since C 2 ι = id and C (si,e) (t, γ) −1 = C (si,e) (s i t, γ), Lemma 4.3 implies that Substituting in (6.8) gives ϑ T (D y Ti )U = C ι ι(η(T ‡ i ))C ι U , as desired. The following lemma plays an important role in the bispectral version of the correspondence. Recall that the center Z(H) of the affine Hecke algebra H is given by C Y [T ] SN (Bernstein, see [30]).

Proof. By (2.4) it immediately follows that Y
This implies the first formula.
For the second formula, it suffices to show that , where the last equality follows from the fact that p(Y −1 ) ∈ Z(H(k)). To prove (6.9), note that T w0 T −1 by (2.4), for 1 ≤ i < N . Hence (6.9) holds for Y i+1 if it is true for Y i . It thus remains to prove (6.9) for i = 1. We will use the following observation. Write σ i = s i s i+1 · · · s N −1 (1 ≤ i < N ) and τ i = s j · · · s N −2 (1 ≤ j < N − 1), which are reduced expressions in S N . Then the longest Weyl group element w 0 ∈ S N can be written as (6.10) and ℓ(w 0 ) is the sum of the lengths of the factors in the respective products in (6.10).
By (2.4), formula (6.9) for i = 1 will be valid if in H(k). By the first expression in (6.10) and the fact that π −1 T i+1 π = T i for 1 ≤ i < N − 1, we have in H(k), so that (6.11) will follow from in H(k). But this is a direct consequence of the second expression of w 0 in (6.10).
is the algebra isomorphism defined in Remark 6.8.
Proof. This follows from the previous lemma and the fact that † = ‡ • • .
where p(Y ) is the corresponding element in Z(H(k)).
By Corollary 6.11 and (6.5) we have Furthermore, it is well-known (see [9] and [34]) that the L Similarly, the L y p = ιL see, e.g., [9, §1.3.5] and [28]. Hence, the L x ei (1 ≤ i ≤ N ) are, under their natural interpretation as q-difference operators on M(T ), Ruijsenaars' commuting, trigonometric q-difference operators from [39]. Definition 6.13. Consider the bispectral problem for f ∈ K, where the equations (6.13) are viewed as identities between meromorphic functions in (t, γ) ∈ T × T . We write BiSP ⊂ K for the set of solutions f ∈ K of (6.13).
Remark 6.14. The bispectral problem for ordinary linear differential operators was introduced by Duistermaat and Grünbaum in [12]. Many different types of bispectral problems have since been considered. In particular, in [21] the bispectral problem for ordinary linear second-order q-difference operators is investigated. For N = 2, our bispectral problem belongs to this class.
The preceding remarks on the invariance properties of the L x p and the L y p (p ∈ C[T ] SN ) directly give We can now prove the following bispectral version of the correspondence between solutions of the quantum KZ equations and the spectral problem of the L x p (p ∈ C[T ] SN ).
Proof. Suppose that w∈SN a w (t, γ)Φ + w (t, γ) = 0 as meromorphic functions in (t, γ) ∈ T × T with coefficients a w ∈ F (w ∈ S N ). Replacing t by q −mδ t (m ∈ N) and using (5.5) we obtain as meromorphic functions in (t, γ) ∈ T × T . Fix u ∈ S N . We are going to derive from (6.16) that a u = 0. For this we will use the fact that for w = u, Recall the W -invariant subset S ⊂ T (see (4.6)), which contains S + . For generic ζ ∈ T (concretely, ζ ∈ S, and a w (t, γ) and W κ (t, w −1 γ) specializable at γ = ζ for all w ∈ S N ), it follows from Proposition 5.9 and (6.16) that, for all m ∈ N, as meromorphic function in t ∈ T . Using (6.17) and the power series expansion (6.15), the limit m → ∞ of (6.18) yields, for generic ζ ∈ uw 0 (B 1 ), a u (t, ζ)W κ (t, u −1 ζ)Γ + 0 (u −1 ζ) = 0 as meromorphic function in t ∈ T . This implies a u = 0, as desired. Proof. Note that χ + τ (e, w)Φ κ ) = Φ + w (w ∈ S N ). The statement follows now directly from Proposition 6.20 and Proposition 5.13. 6.4. Specialized central character and Harish-Chandra series. We write SN } for the spectral problem of the Ruijsenaars q-difference operators with fixed spectral parameter ζ ∈ T . Note that SP ζ ⊂ H and w ∈ S N . By [13,Prop. 5.2], the quantum KZ equations (4.10) are consistent for all values ζ ∈ T of the central character. The arguments from Subsection 6.2, applied to the quantum KZ equations (4.10) for fixed ζ and with the role of U taken over by an invertible matrix solution U ζ of (4.10), result in the following special case of the Cherednik-Matsuo correspondence from [6,7] (concretely, in the notations of [7], take the principal series module V = M (ζ) in [7,Thm. 4.2] and let τ be the projection from M (ζ), along the direct sum decomposition of M (ζ) in H 0 -isotypical components, onto the trivial component).
Harish-Chandra type series solutions of the spectral problem of the Ruijsenaars q-difference operators L x p (p ∈ C[T ] SN ) with fixed spectral parameter ζ ∈ T were studied in, e.g., [15] and [27] (see also [31] for arbitrary root systems). The results of the previous subsection allow us to reobtain these solutions by specialization of the basic Harish-Chandra series Φ + κ . It leads to new results on the convergence and singularities of these solutions, which we state now explicitly.
Definition 6.24. Let ζ ∈ T \ S. The Φ + w (·; ζ) ∈ SP ζ (w ∈ S N ) are the Harish-Chandra series solutions of the spectral problem L x p f = p(ζ −1 )f (p ∈ C[T ] SN ). Remark 6.25. In [15] (and [31]) the Harish-Chandra series are investigated as formal power series solutions to the spectral problem of the Ruijsenaars operators. The advantage of the present approach is the fact that it implies the convergence of the formal power series, basically as a consequence of a general statement about convergence of formal power series solutions of holonomic systems of q-difference equations (see the appendix). Chalykh's [5] Baker-Akhiezer functions arise as Harish-Chandra series solutions for special values of k; see [31, §4.4]. In [27], the Harish-Chandra series solutions of the Ruijsenaars operators are constructed as matrix coefficients of products of vertex operators. By this approach, one obtains an explicit integral representation of the Harish-Chandra series.
Remark 6.26. Observe that (6.19) lim The solution space SP q λ k −δ contains the symmetric Macdonald polynomial of degree λ ∈ Λ. It turns out though that Φ + κ (·, q λ k −δ ) is not a multiple of the Macdonald polynomial of degree λ ∈ Λ, but Φ + κ (·, q w0(λ) k δ ) is (this will become apparent in the next section). On the other hand, the leading coefficient K (see (5.16)) also naturally appears as a normalized limit of the Macdonald polynomial when the degree λ ∈ Λ of the polynomial tends to infinity; see [10,Lemma 4.3] (this limit was proven in [40] in the L 2 -sense).

Polynomial theory
We assume throughout this section that k ∈ C × satisfies the generic conditions in γ ∈ T are at γ α ∈ k 2 q −N for some α ∈ R + . The possible poles of γ → C (e,λ) (·, γ) are at γ α ∈ k −2 q −N for some α ∈ R + .
Proof. Since R i (z) has only a (simple) pole at z = k −2 , this follows from (5.13) and the cocycle property of C; see Lemma 5.7.
Since k satisfies k 2j ∈ q Z for 1 ≤ j ≤ N by (7.1), the spectrum of η q λ k −δ C Y [T ]) is simple and the ξ w (q λ k −δ ) (w ∈ S N ) form a C-basis of H 0 for all λ ∈ Λ. Furthermore, for such k we have that γ → C (e,λ) (·, γ) ±1 is regular at γ = k −δ for all λ ∈ Λ; see Lemma 7.1. The additional conditions on k in (7.1) will play a role in Subsection 7.3 and Subsection 7.4. Proposition 4.9 now immediately implies the following result.
The special interest in the quantum KZ equations for the particular central characters γ = q λ k −δ (λ ∈ Λ) comes from the fact that it admits S N -invariant polynomial solutions. The key step in deriving this result is the following lemma.
Proof. Note that R i (z)v + = v + , so by Lemma 4.1 and Lemma 4.5(ii), for any ζ ∈ T , Then use ℓ(σ −i w) − ℓ(w) = δ, w −1 ̟ i for 1 ≤ i ≤ N (for the proof of this formula, it suffices to prove it for i = 1. In that case, look at the positive roots that are mapped to negative roots by σ −1 w). It implies that In particular, C k −δ ̟i (t)v + = v + for all i. Note, furthermore, that R i (z)v + = v + implies that ς(s i )v + = C k −δ si (t)v + = v + for all 1 ≤ i < N (with ς given by (4.11)).
Proof. Note that Corollary 7.2 and Lemma 7.3 imply that 0 = Q λ ∈ SOL q λ k −δ and that Q λ is S N -invariant. The triangularity property (7.2) follows from the cocycle property, (5.13), the explicit form of the R i (z) and the fact that which is a direct consequence of Lemma 4.1.
The polynomial solutions Q λ of the quantum KZ equations are self-dual in the following sense.
Lemma 7.7. Let λ ∈ Λ. There exists a unique Ξ λ ∈ SOL q λ k −δ such that, for ǫ > 0 sufficiently small, we have an H 0 -valued power series expansion converging normally on compacta of B −1 ǫ and with leading coefficient Proof. Consider the gauged quantum KZ equations for 1 ≤ i ≤ N , with q-connection matrices A i (t) = q − λ,̟i C (̟i,e) (t, q λ k −δ ). Note that A N (t) = id; see Lemma 5.2. Observe that Ξ is a solution of the holonomic system (7.4) of q-difference equations if and only if x λ Ξ ∈ SOL q λ k −δ . By Corollary 4.6, we have A i ∈ Q 0 (A) ⊗ End(H 0 ) and i (1 ≤ i < N ) are semisimple endomorphisms of H 0 . A basis of simultaneous eigenvectors of H 0 is given by η q λ k −δ (T w0 )ξ w (q λ k −δ ) (w ∈ S N ). In fact, for all 1 ≤ i < N and w ∈ S N with γ w,i = q λ,w −1 w0(̟i)−̟i k δ,̟i−w −1 w0(̟i) ; see (5.10). Note, in particular, that γ w,i ∈ q −N for all w ∈ S N and all 1 ≤ i < N by the generic conditions (7.1) on k, and that γ w0,i = 1 for all 1 ≤ i < N . Hence, Theorem 8.6 in the appendix, applied to (7.4) by taking M = N − 1, q i = q and variables z i = x −αi (1 ≤ i < N ) shows that there exists a unique Ξ ∈ M(T ) ⊗ H 0 satisfying (7.4) and admitting an H 0 -valued power series expansion converging normally on compacta of B −1 ǫ for some ǫ > 0 small enough, and having as leading coefficient Γ 0 (λ) = η q λ k −δ (T w0 )ξ w0 (q λ k −δ ). This directly implies the lemma.
Recall that the cocycle values C (e,w) (t, γ) (w ∈ S N ) are independent of t ∈ T . We suppress t from the notation and simply write C (e,w) (γ). Recall that C (e,w) (γ) for w ∈ S N is an End(H 0 )-valued regular function in γ ∈ T .
It remains to compute r κ := r κ (0). Using the fact that C (e,si) (γ) = C ι R i (γ −αi )C ι , with R i (z) = c k (z) −1 (η(T −1 i )−k −1 )+1 for 1 ≤ i < N , as well as that C ι (T −1 w −1 T w0 ) = T w0w −1 for all w ∈ S N , we get C (e,w0) (γ)T w0 = w≤w0 e w (γ)T w0w −1 as H 0 -valued regular function in γ ∈ T with e w ∈ C[T ] and with Taking the T e -coefficient in the expansion of the formula with respect to the C-basis {T w } w∈SN of H 0 , we conclude that Substituting the explicit expressions (2.5) and (5.16) of c k and K, respectively, we get the desired formula (7.7) for r κ .
The following formula is an analog for the Q λ (λ ∈ Λ) of the evaluation formula for the self-dual symmetric Macdonald polynomials (see Subsection 7.4).
The following consequence should be compared with the general expansion formula of v + = w∈SN k ℓ(w) T w ∈ H 0 in terms of the ξ w (γ) (w ∈ S N ); see [37,Lemma 2.27 (2)].
Corollary 7.10. The element v + = w∈SN k ℓ(w) T w ∈ H 0 can be written as Proof. We have v + = Q 0 = K 0 (0), hence the previous corollary gives the first equality of (7.12). The second equality then follows from (7.9).
Applying the map χ + to the first line of (7.12) gives w∈SN k 2ℓ(w) = P (k 2 ) with P (k 2 ) given by (7.11), which is a well-known product formula for the Poincaré series of S N ; see [33,Cor. (2.5)]. 7.4. Relation to symmetric self-dual Macdonald polynomials. In this subsection we collect various consequences of the previous subsections for the symmetric Laurent polynomials χ + Q λ ) ∈ C[T ] SN (λ ∈ Λ). We keep the generic conditions (7.1) on k ∈ C × . We denote By Proposition, 7.4 we have ) ∈ C all but finitely many zero, and with leading coefficient K + 0 (λ) = 0 by Corollary 7.9 and (7.1). Theorem 7.11. The E λ ∈ C[T ] SN (λ ∈ Λ) are the symmetric self-dual Macdonald polynomials. In other words, the E λ are the unique symmetric regular functions on T satisfying Proof. By Proposition 6.22, E λ ∈ C[T ] SN satisfies (7.13). Since the S N -orbits S N (q −λ k δ ) (λ ∈ Λ) in T are pairwise different by (7.1), the eigenvalue equations (7.13) uniquely characterize E λ ∈ C[T ] SN up to a nonzero constant multiple. Now E λ (k δ ) = P (k 2 ) −1 χ + (Q λ (k δ )) = 1 by Lemma 7.5, which fixes the normalization of the solution E λ ∈ C[T ] SN of (7.13) uniquely.
The duality property of Q λ (see Proposition 7.6) immediately gives the wellknown duality property of the Macdonald polynomials.
Remark 7.13. The self-duality of (the suitably normalized) Macdonald polynomials was initially proved by Koornwinder using Pieri formulas in an unpublished manuscript (the argument is reproduced in [32, VI (6. We also immediately reobtain the well-known evaluation formula for the symmetric Macdonald polynomials; see [32,VI (6.11)] (the parameters (n, q, t) in [32, Chpt. VI] correspond to (N, q −1 , k 2 ) in our notations).

Appendix on holonomic systems of q-difference equations
In the appendix we detail the construction of power series solutions of holonomic systems of q-difference equations. Special cases have been investigated in, e.g., [2], [20] and [14, §12]. Many arguments go back to classical works [1], [3], [4], [48] on ordinary linear q-difference equations.
We begin with the construction of formal asymptotic solutions to holonomic systems of q-difference equations. Let  We make the following assumptions on the system of q-difference equations (8.1): (a) The system (8.1) is holonomic, that is for all 1 ≤ i, j ≤ M . Note that the holonomy implies that the leading coefficients A for all γ ∈ S and 1 ≤ k ≤ M .
Consider the system (8.1) of q-difference equations and suppose that (a)-(d) are satisfied. Then there exists a unique solution The proposition is a consequence of the following lemma.   We now proceed to prove the lemma. We assume that we have a formal power series solution f m ∈ C[[z 1 , . . . , z m ]] ⊗ V of (8.3) for some 0 ≤ m < M . We write r T r f m = f m , where the last equality follows from the fact that f m is assumed to satisfy (8.3). Furthermore, using the holonomy (8.2) and the q-difference equation (8.7) in z m+1 satisfied by f m+1 , we have We conclude that g r satisfies the characterizing properties of f m+1 . Hence g r = f m+1 , i.e., A (m+1) r T r f m+1 = f m+1 .
We conclude that g s satisfies the characterizing properties of f m+1 . Hence g s = f m+1 , i.e.
A for all n ≥ 1. We use this recurrence formula to find bounds for Φ m;n in a neighborhood of 0 ∈ C m . Turn the finite-dimensional complex vector space V into an inner product space, with corresponding norm denoted by · . We also write · for the operator norm of the associated finite-dimensional normed space End(V ). We continue the proof of the proposition with two technical sublemmas. First we find a proper uniform bound for A (m) m+1;l for all l (see (8.8)). Proof. In the proof of this lemma, we write q instead of q m+1 . By assumption, Φ m;0 = Φ (m) converges normally on compacta of D m ǫ if 0 < ǫ < δ. We now use the recurrence relation (8.8) to obtain the desired results for Φ m;n with n ≥ 1.
By the proof of Lemma 8.2 and since 0 < q < 1, there exists some ǫ > 0 (independent of n ≥ 1) such that det(1 − q n A (m) m+1 ) −1 is analytic on D m ǫ for all n ≥ 1 and such that | det(1−q n A (m) m+1 ) −1 | is bounded on the closure D m ǫ of D m ǫ , with bound independent of n ≥ 1. For such ǫ, it follows from (8.8) that Φ m;n converges normally on compacta of D m ǫ for all n ≥ 1. Furthermore, by (e), 0 < q < 1, and Cramer's rule, it implies that for ǫ > 0 small enough, ǫ for all n ≥ 1, with C ′ > 0 also independent of n. By (8.8), 0 < q < 1 and the previous lemma, we thus obtain for ǫ > 0 small enough, Combined with (8.9), the lemma now follows immediately.
To conclude the proof of the proposition, note that the previous lemma shows that Φ (m+1) =  Of course, the definition of A λ (z) makes sense by the holonomy conditions for the A i . Furthermore, (8.10) together with the holonomy conditions for the A i show that the power series solution Φ v of (8.2) has a unique extension to a meromorphic V -valued solution on C M of (8.2).