Preprint typeset in JHEP style-HYPER VERSION Surface Operators and Separation of Variables

Alday, Gaiotto, and Tachikawa conjectured relations between certain 4d N = 2 supersymmetric field theories and 2d Liouville conformal field theory. We study generalizations of these relations to 4d theories with surface operators. For one type of surface operators the corresponding 2d theory is the WZW model, and for another type – the Liouville theory with insertions of extra degenerate fields. We show that these two 4d theories with surface operators exhibit an IR duality, which reflects the known relation (the so-called separation of variables) between the conformal blocks of the WZW model and the Liouville theory. Furthermore, we trace this IR duality to a brane creation construction relating systems of M5 and M2 branes in M-theory. Finally, we show that this duality may be expressed as an explicit relation between the generating functions for the changes of variables between natural sets of Darboux coordinates on the Hitchin moduli space. CALT 2015-032 ar X iv :1 50 6. 07 50 8v 1 [ he pth ] 2 4 Ju n 20 15


Introduction
One of the most interesting phenomena in supersymmetric gauge dynamics is the appearance of infrared (IR) duality: theories different in the ultraviolet (UV) regime may well flow to the same IR fixed point. A prominent example is the Seiberg duality in four-dimensional N = 1 super-QCD [1]. Similar dualities exist in three dimensions [2,3] and in two dimensions [4]. Moreover, it is known that certain two-dimensional dualities naturally arise on the twodimensional world-sheets of surface operators in four-dimensional N = 2 gauge theories [5,6].
In the present paper, we propose a new IR duality between 4d N = 2 supersymmetric theories with two types of surface operators that we call "codimension-2" and "codimension-4" for reasons that will become clear momentarily.
In general, in four dimensional gauge theory (with any amount of supersymmetry) we have two ways of constructing non-local operators supported on a surface D ⊂ M 4 [7]: • 2d-4d system: One can couple 4d gauge theory on M 4 to an auxiliary 2d theory on D in such a way that the gauge group G of the 4d theory is a subgroup of the global flavor symmetry of the 2d theory. In particular, the auxiliary 2d theory must have global symmetry G.
• singularity: One replaces the four-dimensional space-time M 4 with the complement M 4 \ D so that gauge fields (and, possibly, other fields) have a prescribed singular behavior along D. Thus, instead of introducing new degrees of freedom, one modifies the existing degrees of freedom.
Note that both of these methods may also be used to construct other non-local operators, such as line operators (for example, Wilson operators and 't Hooft operators, respectively). In the case of surface operators, the first of these two methods can be further subdivided into linear and non-linear sigma-model descriptions of 2d degrees of freedom on D. However, this distinction will not be important in this paper.
What will be important to us, however, is that sometimes these two constructions may lead to the same result. This happens when integrating out 2d degrees of freedom in the 2d-4d coupled system leaves behind a delta-function singularity, supported on D (for the 4d fields). In particular, this is what one finds in the case of N = 4 super-Yang-Mills theory. Thus, one obtains an equivalence of the theories with two types of surface operators, which may also be derived using brane constructions and T-dualities. Something similar may happen in certain gauge theories with less supersymmetry, e.g. free field theories, but in this paper focus on IR equivalence (or IR duality) of 4d N = 2 theories with the two types of surface operators.
Surface operators in 4d N = 2 theories were first considered in [8] and later incorporated in the framework of the Alday-Gaiotto-Tachikawa (AGT) correspondence in [9,10] relating a certain class of 4d N = 2 gauge theories (often called "class S") and 2d conformal field theories on a Riemann surface C g,n of genus g with n punctures [11]. According to these works, there is a relation between the instanton partition functions in the 4d theories in the presence of the two types of surface operators and conformal blocks in the WZW model for SL 2 and the Liouville theory with extra degenerate fields, respectively. We note that for the surface operators of the first type this relation was originally proposed by Braverman [12] and further analyzed in [10,[13][14][15].
Within this framework, the IR duality between the 4d theories with two types of surface operators is neatly expressed by an integral transform between the chiral partition functions of the WZW model and the Liouville theory: This relation, which is of interest in 2d CFT, was established by Feigin, Frenkel, and Stoyanovsky in 1995 as a generalization of the Sklyanin separation of variables for the Gaudin model [16] (which corresponds to the limit of the infinite central charge), see [17,18]. Hence we call this relation separation of variables. In this paper we present it in a more explicit form (see [19] for another presentation). One of our goals is thus to show that the relation (1.1) captures the IR duality of 4d N = 2 gauge theories of class S with surface operators. Thus, our work provides a physical interpretation -and perhaps a natural home -for the separation of variables (1.1) in 4d gauge theory, as well as the corresponding 6d (0, 2) theory on the fivebrane world-volume in M-theory.
Let's talk about the latter in more detail. In the context of the AGT correspondence and, more broadly, in 4d N = 2 theories constructed from M-theory fivebranes wrapped on Riemann surfaces [20][21][22][23] the two types of surface operators in 4d field theories described above are usually represented by different types of branes / supersymmetric defects in the 6d (0, 2) theory on the fivebrane world-volume. Codimension-4 defects that correspond to the membrane boundaries naturally lead to the surface operators described as 2d-4d coupled systems. Codimension-2 defects, on the other hand, may be thought of as intersections with another group of fivebranes and therefore they are usually characterized by a singularity for the gauge fields at D of a specific type (described in Appendix A).
Thus, altogether one has at least three different perspectives on the surface operators in 4d theories corresponding to the codimension-2 and codimension-4 defects in 6d theory (this is the reason why we will often refer to them as codimension-2 and codimension-4 surface operators). Namely, the 2d CFT perspective, the 4d gauge theory perspective, and the 6d fivebrane / M-theory perspective. Moreover, the 4d gauge theory perspective is further subdivided into UV and IR regimes. A simple way to keep track of these perspectives is to think of a sequence of RG flows, M-theory / 6d 4d gauge theory UV 4d gauge theory IR (1.2) where arrows correspond to integrating out more and more degrees of freedom. This relation between different theories is somewhat analogous to a more familiar relation between a 2d gauged linear sigma-model, the corresponding non-linear sigma-model, and the Landau-Ginzburg theory that describes the IR physics of the latter. It is natural to ask whether one can see any trace of our IR equivalence in the UV, either in 4d or 6d. We answer this question in the affirmative, by showing that the brane configurations in M-theory that give rise to the codimension-2 and codimension-4 surface operators are related by a certain non-trivial phase transition, a variant of the brane creation effect of Hanany and Witten [24] (see Figure 1 in Section 4.1). We will show that certain quantities protected by supersymmetry remain invariant under this phase transition, thereby revealing the 6d / M-theory origin of our IR equivalence. In four dimensions, the IR duality manifests itself in the most direct way as a relation between instanton partition functions in the presence of surface operators and conformal blocks in WZW/Liouville CFTs discussed above. However, what we actually claim here is that the IR duality holds for the full physical theories (and not just for specific observables); that is to say, the 4d theories with two types of surface operators become equivalent in the IR. This has many useful implications (and applications), far beyond a mere relation between the instanton partition functions.
In order to show that, we use the fact that the low-energy effective action in our theories is essentially determined by their respective effective twisted superpotentials (see Sections 4.2 and 4.3 for more details). Hence we need to compare the twisted superpotentials arising in our theories, and we compute them explicitly using the corresponding 2d conformal field theories. The result is that the two twisted superpotentials, which we denote by W M5 (a, x, τ ) and W M2 (a, u(a, x, τ ), τ ), respectively, are related by a field redefinition 1 W M5 (a, x, τ ) = W M2 (a, u(a, x, τ ), τ ) + W SOV (x, u(a, x, τ ), τ ) . (1.3) Here the variables x and u are parameters entering the UV-definitions of the two types of surface operators. The relation u = u(a, x, τ ) extremizes the superpotential on the right of (1.3), reflecting the fact that u becomes a dynamical field in our brane creation transition.
Formula (1.3) has an elegant interpretation in terms of the mathematics of the Hitchin integrable system for the group SL 2 . Namely, we show that the two effective twisted superpotentials are the generating functions for changes of variables between natural sets of Darboux coordinates for the Hitchin moduli space M H (C) of SL 2 .
There are in fact three such sets: (x, p), the natural coordinates on M H (C) arising from its realization as a cotangent bundle; (a, t), the action-angle coordinates making the complete integrability of M H (C) manifest; and (u, v), the so-called "separated variables" making the eigenvalue equations of the quantized Hitchin systems separate. We show that the twisted superpotentials W M5 (a, x, τ ) and W M2 (a, u, τ ) are the generating functions for the changes of Darboux coordinates (x, p) ↔ (a, t) and (u, v) ↔ (a, t), respectively. The generating function of the remaining change (x, p) ↔ (u, v) is the function W SOV (x, u, τ ) appearing on the RHS of the relation (1.3) -it is the generating function for the separation of variables in the Hitchin integrable system.
Thus, the IR duality between the 4d gauge theories with the two types of surface operators that we study in this paper becomes directly reflected in the separation of variables of the Hitchin integrable system.
To derive the relation (1.3), we first express the twisted superpotentials W M5 (a, x, τ ) and W M2 (a, u, τ ) as the subleading terms in the expansion of the logarithms of the instanton partition functions in the limit of vanishing Omega-deformation [26]. Assuming that the instanton partition function in our 4d theories are equal to the chiral partition functions in the WZW model and the Liouville theory, respectively [10,[12][13][14][15], we express the subleading terms of the instanton partition functions as the subleading terms of the chiral partition functions in the corresponding 2d CFTs. What remains to be done then is to find a relation between the subleading terms of these two chiral partition functions (one from the WZW model and one from the Liouville theory with extra degenerate fields).
This is now a problem in 2d CFT, which is in fact a non-trivial mathematical problem that is interesting on its own right. In this paper, by refining earlier observations from [27], we compute explicitly the subleading terms of the chiral partition functions in the WZW model and the Liouville theory (with extra degenerate fields) and identify them as the generating functions for the changes of Darboux coordinates mentioned above. In this way we obtain the desired relation (1.3).
The details of these computations are given in the Appendices, which contain a number of previously unpublished results that could be of independent interest. In performing these computations, we addressed various points in the mathematics of the WZW model and its relation to the Hitchin integrable system that, as far as we know, have not been discussed in the literature before (for example, questions concerning chiral partition functions on Riemann surfaces of higher genus). In particular, our results make precise the sense in which Liouville theory and the WZW model both appear as the result of natural quantizations of the Hitchin integrable systems using two different sets of Darboux coordinates, as was previously argued in [27].
Once we identify the subleading terms of the chiral partition functions of the two 2d CFTs with the generating functions, we obtain the relation (1.3). Alternatively, this relation also appears in the infinite central charge limit from the separation of variables relation (1.1) between conformal blocks in the WZW and Liouville CFTs. Therefore, the relation (1.1) may be viewed as a relation between the instanton partition functions in the 4d theories with two types of surface operators in non-trivial Omega-background. This suggests that these two 4d theories remain IR equivalent even after we turn on the Omega-deformation. However, in non-zero Omega-background this relation is rather non-trivial, as it involves not just a change of variables, but also an integral transform. This relation deserves further study, as does the question of generalizing our results from the group SL 2 to groups of higher rank.
The paper is organized as follows. In Section 2 we review class S supersymmetric gauge theories, AGT correspondence, surface operators, and the Hitchin system. In Section 3 we discuss the 4d theories with the surface operators obtained from codimension-2 defects in 6d, the brane construction, conformal blocks in the corresponding CFT (WZW model), and the relation to the Hitchin system. In Section 4 we consider the 4d theories with the surface operators obtained from codimension-2 defects in 6d and the corresponding CFT (Liouville theory with degenerate fields). We also discuss general properties of the 4d theories in the IR regime and the corresponding twisted superpotentials. Anticipating the IR duality that we establish in this paper, we start with the brane system introduced in Section 3 (the one giving rise to the codimension-2 defects) and deform it in such a way that the end result is a collection of codimension-4 defects. This allows us to demonstrate that the two types of defects preserve the same subalgebra of the supersymmetry algebra and to set the stage for the IR duality. In the second half of Section 4, we bring together the results of the previous sections to demonstrate the IR duality of two 4d gauge theories with surface operators and the separation of variables in conformal field theory and Hitchin system.
The necessary mathematical results on surface operators, on chiral partition functions in the WZW model and the Liouville theory, and on the separation of variables are presented in the Appendices. There one can also find detailed computations of the chiral partition functions of the WZW model and the Liouville theory and their classical limits (some of which have not appeared in the literature before, as far as we know).

Acknowledgments
We would like to thank D. Gaiotto, K. Maruyoshi, and N. Nekrasov for useful discussions and comments. The research of E.F. was supported by the NSF grants DMS-1160328 and DMS-1201335. The work of S.G. is funded in part by the DOE Grant DE-SC0011632 and the Walter Burke Institute for Theoretical Physics.

Preliminaries
In this section we review some background and introduce the notation that will be used in our paper. Toward this end, we will recall the notion of class S supersymmetric gauge theories and review very briefly how the Seiberg-Witten theory of this class is related to the Hitchin system.

Theories of class S and AGT correspondence
A lot of progress has been made in the last few years in the study of N = 2 supersymmetric field theories in four dimensions. Highlights include exact results on the expectation values of observables like supersymmetric Wilson and 't Hooft loop operators on the four-sphere S 4 , see [28,29] for reviews, and [30] for a general overview containing further references.
A rich class of field theories with N = 2 supersymmetry, often denoted as class S, can be obtained by twisted compactification of the six-dimensional (2, 0) theory with Lie algebra g [23]. Class S theories of type g = A 1 have Lagrangian descriptions specified by a pair of pants decompositions of C, which is defined by cutting C along a system C = {γ 1 , . . . , γ h } of simple closed curves on C [22]. In order to distinguish pants decompositions that differ by Dehn twists, we will also introduce a trivalent graph Γ inside C such that each pair of pants contains exactly one vertex of Γ, and each edge e of Γ goes through exactly one cutting curve γ e ∈ C. The pair σ = (C, Γ) will be called a refined pants decomposition.
Then, to a Riemann surface C of genus g and n punctures one may associate [22,23] a four-dimensional gauge theory G C with N = 2 supersymmetry, gauge group (SU(2)) h , h := 3g − 3 + n and flavor symmetry (SU(2)) n . The theories in this class are UV-finite, and therefore they are characterized by a collection of gauge coupling constants g 1 , . . . , g h . To the k-th boundary there corresponds a flavor group SU (2) k with mass parameter M k . The hypermultiplet masses are linear combinations of the parameters m k , k = 1, . . . , n as explained in more detail in [11,22].
The correspondence between the data associated to the surface C and the gauge theory G C is then summarized in the table below.
We place this in the context of M-theory, following the standard conventions of brane constructions [20]. Namely, we choose x 6 and x 10 as local coordinates on the Riemann surface C and parametrize the four-dimensional space-time M 4 by (x 0 , x 1 , x 2 , x 3 ). This choice of local coordinates can be conveniently summarized by the diagram: Brane 0 1 2 3 4 5 6 7 8 9 10 where each "x" represents a space-time dimensions spanned by the five-brane world-volume. Alday, Gaiotto, and Tachikawa (AGT) observed that the partition functions of A 1 theories on a four-sphere can be expressed in terms of Liouville correlation functions.

Seiberg-Witten theory
The low-energy effective actions of class S theories are determined as follows. Given a quadratic differential t on C one defines the Seiberg-Witten curve Σ SW in T * C as follows: The curve Σ SW is a two-sheeted covering of C with genus 4g − 3 + n. One may embed the Jacobian of C into the Jacobian of Σ SW by pulling back the holomorphic differentials on C under the projection Σ SW → C. Let H 1 (Σ SW , Z) = H 1 (Σ SW , Z)/H 1 (C, Z), and let us introduce a canonical basis B for H 1 (Σ SW , Z), represented by a collection of curves (α 1 , . . . , The corresponding periods of the canonical differential on v = v(u)du are defined as Using the Riemann bilinear relations, it can be shown that there exists a function F(a), a = (a 1 , . . . , a h ) such that a D k = ∂ a k F(a). The function F(a) is the prepotential determining the low-energy effective action associated to B.
Different canonical bases B for H 1 (Σ SW , Z) are related by Sp(2h, Z)-transformations describing electric-magnetic dualities in the low-energy physics. It will be useful to note that for given data σ specifying UV-actions there exists a preferred class of bases B σ for H 1 (Σ SW , Z) which are such that the curves α e project to the curves γ e ∈ C, e = 1, . . . , h defining the pants decomposition C, respectively.

Relation to the Hitchin system
The Seiberg-Witten analysis of the theories G C has a well-known relation to the mathematics of the Hitchin system [31,32] that we will recall next.
The phase space M H (C) of the Hitchin system for G = SL(2) is the moduli space of pairs (E, ϕ), where E is a holomorphic rank 2 vector bundle with fixed determinant, and ϕ ∈ H 0 (C, End(E) ⊗ K C ) is called the Higgs field. The complete integrability of the Hitchin system is demonstrated using the so-called Hitchin map. Given a pair (E, ϕ), we define the spectral curve Σ as Σ = (u, v) ∈ T * C ; 2v 2 = tr(ϕ 2 (u)) .
To each pair (E, ϕ) one associates a line bundle L on Σ, the bundle of eigenlines of ϕ for a given eigenvalue v. Conversely, given a pair (Σ, L), where Σ ⊂ T * C is a double cover of C, and L a holomorphic line bundle on Σ, one can recover (E, ϕ) via where π is the covering map Σ → C, and π * is the direct image. The spectral curves Σ can be identified with the curves Σ SW determining the low-energy physics of the theories G C on R 4 . However, in order to give physical meaning to the full Hitchin system one needs to consider an extended set-up. One possibility is to introduce surface operators.

Two types of surface operators
When the 6d fivebrane world-volume is of the form M 4 × C, where C is a Riemann surface, there are two natural ways to construct half-BPS surface operators in the four-dimensional space-time M 4 where the N = 2 theory G C lives. First, one can consider codimension-2 defects supported on D × C, where D ⊂ M 4 is a two-dimensional surface (= support of a surface operator). Another, seemingly different way, is to start with codimension-4 defects supported on D × {p}, where p ∈ C is a point on the Riemann surface.
In the case of genus-1 Riemann surface C = T 2 , both types of half-BPS surface operators that we study in this paper were originally constructed using branes in [7,33]. In these papers it was argued that the two types of operators are equivalent, at least for certain "supersymmetric questions". Here we will show that for more general Riemann surfaces C the two surface operators, based on codimension-4 and codimension-2 defects, may be different in the UV but become essentially the same in the IR regime. They correspond to two different ways to describe the same physical object. Mathematically, this duality of descriptions corresponds to the possibility of choosing different coordinates on the Hitchin moduli space, which will be introduced shortly. At first, the equivalence of the two types of surface operators may seem rather surprising since it is not even clear from the outset that they preserve the same subalgebra of the supersymmetry algebra. Moreover, the moduli spaces parametrizing these surface operators appear to be different.
Indeed, one of these moduli spaces parametrizes collections of n codimension-4 defects supported at D × {p i } ⊂ M 4 × C, and therefore it is Sym n (C) := C n /S n (2.5) (Here we consider only the "intrinsic" parameters of the surface operator, and not the position of D ⊂ M 4 , which is assumed to be fixed.) On the other hand, a surface operator constructed from a codimension-2 defect clearly does not depend on these parameters, since it wraps on all of C. Instead, a codimension-2 surface operator carries a global symmetry G -which plays an important role e.g. in describing charged matter -and, as a result, its moduli space is the moduli of G-bundles on C, Therefore, it appears that in order to relate the two constructions of surface operators, one must have a map between (2.5) and (2.6): It turns out that even though such a map does not exist, for G = SL(2) there is a map of the corresponding cotangent bundles, which is sufficient for our purposes. This is the celebrated classical separation of variables. Moreover, it has a quantum version, described in Section 4.7. The separation of variables allows us to identify the 4d theories with two types of surface operators in the IR.
The unbroken SUSY makes it possible to turn on an Omega-deformation, allowing us to define generalizations of the instanton partition functions. In the case of codimension-2 surface operators it turned out that the generalized instanton partition functions are calculable by the localization method, and in a few simple cases it was observed that the results are related to the conformal blocks in the SL(2)-WZW model. For codimension-4 surface operators one expects to find a similar relation to Liouville conformal blocks with a certain number of degenerate fields inserted.

Surface operators corresponding to the codimension-2 defects
Our goal in this paper is to establish a relation between the surface operators constructed from codimension-2 and codimension-4 defects. 2 In order to do that, we must show that they preserve the same subalgebra of the supersymmetry algebra. This will be achieved by realizing these defects using branes in M-theory (as we already mentioned earlier). This realization will enable us to link the two types of defects, and it will also illuminate their features.
In this section we present an M-theory brane construction of the codimension-2 defects and then discuss them from the point of view of the 4d and 2d theories. Then, in Section 4, we will deform -in a way that manifestly preserves supersymmetry -a brane system that gives rise to the codimension-2 defects into a brane system that gives rise to codimension-4 defects. Using this deformation, we will show that the two types of defects indeed preserve the same supersymmetry algebra, and furthermore, we will connect the two types of defects, and the corresponding 4d surface operators, to each other.

Brane construction
Following [7], we denote the support (resp. the fiber of the normal bundle) of the surface operator inside M 4 by D (resp. D ). In fact, for the purposes of this section, we simply take M 4 = D × D . Our starting point is the following "brane construction" of 4d N = 2 gauge theory with a half-BPS surface operator supported on D ⊂ M 4 (= D × D ): For simplicity, we will assume that D ∼ = D ∼ = D ∼ = R 2 and C is the only topologically nontrivial Riemann surface in the problem at hand. And, following the standard conventions of brane constructions [20], we use the following local coordinates on various factors of the eleven-dimensional space-time: With these conventions, the brane configuration (3.1) may be equivalently summarized in the following diagram: Brane 0 1 2 3 4 5 6 7 8 9 10 Note that M 5 -branes wrap the same UV curve C as the M 5-branes. This brane configuration is 1 8 -BPS, i.e. it preserves four real supercharges out of 32. Namely, the eleven-dimensional space-time (without any fivebranes) breaks half of supersymmetry (since T * C is a manifold with SU (2) holonomy), and then each set of fivebranes breaks it further by a half.
In particular, thinking of T * C as a non-compact Calabi-Yau 2-fold makes it clear that certain aspects of the system (3.1), such as the subalgebra of the supersymmetry algebra preserved by this system, are not sensitive to the details of the support of M5 and M5 branes within T * C as long as both are special Lagrangian with respect to the same Kähler form ω and the holomorphic 2-form Ω. Since T * C is hyper-Kähler, it comes equipped with a sphere worth of complex structures, which are linear combinations of I, J, K, and the corresponding Kähler forms ω I , ω J , ω K . Without loss of generality, we can choose ω = ω I and Ω = ω J +iω K . Then, the special Lagrangian condition means that both ω I and ω K vanish when restricted to the world-volume of M5 and M5 branes.

Four-dimensional description
As we explain below, surface operators originating from codimension-4 defects in 6d (0, 2) theory naturally lead to the coupled 2d-4d system, while those originating from codimension-2 defects in 6d descend to the second description of surface operators in 4d gauge theory, namely as singularities for the UV gauge fields A (r) µ (see Appendix A for more details): Here, following our conventions (3.2), we use a local complex coordinate x 2 + ix 3 = r 2 e iθ 2 on D such that surface operator is located at the origin (r 2 = 0). A surface operator defined this way breaks half of supersymmetry and also breaks SO(4) rotation symmetry down to SO(2) × SO (2). From the viewpoint of the 2d theory on D, the unbroken supersymmetry is N = (2, 2). The symmetries preserved by such a surface operator are exactly what one needs in order to put the 4d gauge theory in a non-trivial Omega-background. Mathematically, this leads to an SO(2) × SO(2) equivariant counting of instantons with a ramification along D. The resulting instanton partition function Z M5 (a, x, τ ; 1 , 2 ) , The relation between the parameters χ (r) and the counting parameters x r appearing in the instanton partition functions Z M5 was found in [10].

Relation to conformal field theory
Starting from the groundbreaking work of A. Braverman [12], a number of recent studies have produced evidence of relations between instanton partition functions in the presence of surface operators Z M5 (a, x, τ ; 1 , 2 ) and conformal blocks of affine Kac-Moody algebras g k [10,[13][14][15]. Such relations can be viewed as natural generalizations of the AGT correspondence. In the case of class S-theories of type A 1 one needs to choose g = sl 2 and k = −2 − 2 1 , as will be assumed in what follows.
The Lie algebra g k has generators J a n , a = 0, +, −, n ∈ Z. A large class of representation of g k is defined by starting from a representation R j of the zero mode subalgebra generated from J a 0 , which has Casimir eigenvalue parametrized as j(j + 1). One may then construct a representation R j of g k as the representation induced from R j extended to the Lie subalgebra generated by J a n , n ≥ 0, such that all vectors v ∈ R j ⊂ R j satisfy J a n v = 0 for n > 0. To be specific, we shall mostly discuss in the following the case that the representations R j have a lowest weight vector e j , but more general representations may also be considered, and may be of interest in this context [34].
In order to define the space of conformal blocks, let C be a compact Riemann surface and z 1 , . . . , z n an n-tuple of points of C with local coordinates t 1 , . . . , t n . We attach representations R r ≡ R jr of the affine Kac-Moody algebra g k of level k to the points z r , r = 1, . . . , n. The diagonal central extension of the direct sum n r=1 g ⊗ C((t r )) acts on the tensor product n r=1 R r . Consider the Lie algebra of g-valued meromorphic functions on C with poles allowed only at the points z 1 , . . . , z n . We have an embedding g out → n r=1 g ⊗ C((t r )). (3.6) It follows from the commutation relations in g and the residue theorem that this embedding lifts to the diagonal central extension of n r=1 g ⊗ C((t r )). Hence the Lie algebra g out acts on n r=1 R r . By definition, the corresponding space of conformal blocks is the space CB g (R 1 , . . . , R n ) of linear functionals The conditions (3.7) represent a reformulation of current algebra Ward identities well-known in the physics literature. The space CB g (R 1 , . . . , R n ) is infinite-dimensional in general.
To each ϕ ∈ CB g (R 1 , . . . , R n ) we may associate a chiral partition function Z(ϕ, C) by evaluating ϕ on the product of the lowest weight vectors, (3.8) In the physics literature one usually identifies the chiral partition functions with expectation values of chiral primary fields Φ r (z r ), inserted at the points z r , Considering families of Riemann surfaces C τ parametrized by local coordinates τ for the Teichmüller space T g,n one may regard the chiral partition functions as functions of τ , Large families of conformal blocks and the corresponding chiral partition functions can be constructed by the gluing construction. Given a (possibly disconnected) Riemann surface C with two marked points P i 0 , i = 1, 2 surrounded by parametrized discs D i one can construct a new Riemann surface by pairwise identifying the points in annuli A i ⊂ D i around the two marked points, respectively. Assume we are given conformal blocks ϕ C i associated to two surfaces C i with n i + 1 punctures P i 0 , P i 1 , . . . , P i n i with the same representation R 0 associated to P i 0 for i = 1, 2. Using this input one may construct a conformal block ϕ C 12 associated to the surface C 12 obtained by gluing the annular neighborhoods A i of P i 0 , i = 1, 2 as follows: The vectors v ν and v ∨ ν are elements of bases for the representation R 0 which are dual w.r.t. to the invariant bilinear form on R 0 . A standard choice for the twist element K(τ, x) ∈ End(R 0 ) appearing in this construction is K(τ, x) = e 2πiτ L 0 x J 0 0 , where the operator L 0 represents the zero mode of the energy-momentum tensor constructed from the generators J a n using the Sugawara construction. The parameter q ≡ e 2πiτ in (3.10) can be identified with the modulus of the annular regions used in the gluing construction of C 12 . However, it is possible to consider twist elements K(τ, x) constructed out a larger subset of the generators of g k . The rest of the notation in (3.10) is self-explanatory. The case that P i 0 , i = 1, 2 are on a connected surface can be treated in a similar way.
A general Riemann surface C g,n can be obtained by gluing 2g − 2 + n pairs of pants C v 0,3 , v = 1, . . . , 2g − 2 + n. It is possible to construct conformal blocks for the resulting Riemann surface from the conformal blocks associated to the pairs of pants C v 0,3 by recursive use of the gluing construction outlined above. This yields families ϕ σ j,x of conformal blocks parametrized by • the choice of a refined pants decomposition σ = (C, Γ), • the choice of representation R je for each of the cutting curves γ e defined by the pants decomposition, and • the collection of the parameters x e introduced via (3.10) for each curve γ e ∈ C.
The corresponding chiral partition functions are therefore functions The variables x = (x 1 , . . . , x 3g−3+n ) have a geometric interpretation as parameters for families of holomorphic G = SL(2)-bundles B. Indeed, in Appendix B it is explained how the definition of the conformal blocks can be modified in a way that depends on the choice of a holomorphic bundle B, and why the effect of this modification can be described using the twist elements K(τ, x) appearing in the gluing construction. It follows from the discussion in Appendix B that changing the twist elements K(τ, x) amounts to a change of local coordinates (τ, x) for the fibration of Bun G over T g,n (the moduli space of pairs: a Riemann surface and a G-bundle on it). The chiral partition functions satisfy the Knizhnik-Zamolodchikov-Bernard (KZB) equations. This is a system of partial differential equations of the form where H e is a second order differential operator containing only derivatives with respect to the variables x e . These equations can be used to generate the expansion of Z WZ σ (j, x; τ ; k) in powers of q e and x e , (3.12) The notation used in (3.12) indicates equality up to a factor which is j-independent. Such factors will be not be of interest for us. The equations (3.11) determine Z WZ σ (j, m, n; k) uniquely in terms of Z WZ 0,σ (j) = Z WZ (j, 0, 0; k). It is natural to assume that the normalization factor Z WZ 0 (j) can be represented as product over factors depending on the choices of representations associated to the three-holed spheres C v 0,3 appearing in the pants decomposition. We are now going to propose the following conjecture: There exists a choice of twist elements K e (τ e , x e ) such that we have assuming that (3.14) Evidence for this conjecture is provided by the computations performed in [10,[13][14][15] in the cases C = C 1,1 and C = C 0,4 . The relevant twist elements K(τ, x) were determined explicitly in these references. As indicated by the notation , we expect (3.13) to hold only up to j-independent multiplicative factors. A change of the renormalization scheme used to define the gauge theory under consideration may modify Z M5 by factors that do not depend on j. Such factors are physically irrelevant, see e.g. [35] for a discussion.

Relation to the Hitchin system
On physical grounds we expect that the instanton partition functions Z M5 σ (a, x, τ ; 1 , 2 ) behave in the limit 1 → 0, 2 → 0 as The first term is the bulk free energy, proportional to the prepotential F σ (a) defined previously. The second term is a contribution diverging with the area of the plane on which the surface operator is localized. It can be identified as the effective twisted superpotential of the degrees of freedom localized on the surface x 2 = x 3 = 0. The expression of the instanton partition function as a to conformal field theory (3.13) allows us to demonstrate that we indeed have an asymptotic behavior of the form (3.15). The derivation of (3.15) described in Appendix D leads to a precise mathematical description of the functions W M5 σ (a, x, τ ) appearing in (3.15) in terms the Hitchin integrable system that we will describe in the rest of this subsection. It turns out that W M5 σ (a, x, τ ) can be characterized as the generating function for the change of variables between two sets of Darboux coordinates for M H (C) naturally adapted to the description in terms of Higgs pairs (E, ϕ) and pairs (Σ, L), respectively.
Let us pick coordinates x = (x 1 , . . . , x h ) for Bun G . Possible ways of doing this are briefly described in Appendix C.2. One can always find coordinates p on M H (C) which supplement the coordinates x to a system of Darboux coordinates (x, p) for M H (C).
There exists other natural systems (a, t) of coordinates for M H (C) called action-angle coordinates making the complete integrability of M H (C) manifest. The coordinates a = (a 1 , . . . , a h ) are defined as periods of the Seiberg-Witten differential, as described previously. The coordinates t = (t 1 , . . . , t h ) are complex coordinates for the Jacobian of Σ parametrizing the choices of line bundles L on Σ. The coordinates t may be chosen such that (a, t) furnishes a system of Darboux coordinates for M H (C).
As the coordinates (a, t) are naturally associated to the description in terms of pairs (Σ, L), one may construct the change of coordinates between the sets of Darboux coordinates (x, p) and (a, t) using Hitchin's map introduced in Section 2.3. The function W M5 σ (a, x, τ ) in (3.15) can then be characterized as the generating function for the change of coordinates (x, p) ↔ (a, t), with periods a defined using a basis B σ corresponding to the pants decomposition σ used to define Z M5 σ (a, x, τ ; 1 , 2 ). Having defined (x, p) and (a, t), the equations (3.16) define W M5 σ (a, x, τ ) up to an (inessential) additive constant.

Physical interpretation
All of the integrable system gadgets introduced above seem to find natural homes in field theory and string theory. In particular, N five-branes on C describe a theory that in the IR corresponds to an M5-brane wrapped N times on C or, equivalently, wrapped on a N -fold cover Σ → C. Though in this paper we mostly consider the case N = 2 (hence a double cover Σ → C), certain aspects have straightforward generalization to higher ranks. It is also worth noting that we treat both SL(N ) and GL(N ) cases in parallel; the difference between the two is accounted for by the "center-of-mass" tensor multiplet in 6d (0, 2) theory on the five-brane world-volume.
Besides the "brane constructions" used in most of this paper, the physics of 4d N = 2 theories can be also described by compactification of type IIA or type IIB string theory on a local Calabi-Yau 3-fold geometry. This approach, known as "geometric engineering" [36,37], can be especially useful for understanding certain aspects of surface operators and is related to the brane construction by a sequence of various dualities. Thus, a single five-brane wrapped on Σ ⊂ T * C that describes the IR physics of 4d N = 2 theory is dual to type IIB string theory on a local CY 3-fold where P (u, v) is the polynomial that defines the Seiberg-Witten curve Σ SW . It can be obtained from our original M5-brane on Σ by first reducing on one of the dimensions transversal to the five-brane (down to type IIA string theory with NS5-brane on Σ) and then performing T-duality along one of the dimensions transversal to the NS5-brane. The latter is known to turn NS5-branes to pure geometry, and supersymmetry and a few other considerations quickly tell us that type IIB background has to be of the form (3.17). Now, let us incorporate M5 -brane which in the IR version of brane configuration (3.1) looks like: What becomes of the M5 -brane upon duality to type IIB setup (3.17)? It can become any brane of type IIB string theory supported on a holomorphic submanifold in the local Calabi-Yau geometry (3.17). Indeed, since the chain of dualities from Mtheory to type IIB does not touch the four dimensions parametrized by x 0 , . . . , x 3 the resulting type IIB configuration should still describe a half-BPS surface operator in 4d Seiberg-Witten theory on M 4 . Moreover, since type IIB string theory contains half-BPS p-branes for odd values of p, with (p + 1)-dimensional world-volume, M5 can become a p-brane supported on D × C p−1 , where C p−1 is a holomorphic submanifold in a local Calabi-Yau 3-fold (3.17).
Depending on how one performs the reduction from M-theory to type IIA string theory and then T-duality to type IIB, one finds different p-brane duals of the M5 -brane. Here, we will be mostly interested in the case p = 3, which corresponds to the reduction and then Tduality along the coordinates x 8 and x 9 , cf. (3.2). Effectively, one can think of compactifying the M-theory setup (3.18) on D = T 2 , and that gives precisely the type IIB setup (3.17) with extra D3-brane supported on Σ, i.e. at z = w = 0 in (3.17).
A D3-brane carries a rank-1 Chan-Paton bundle L → Σ. Therefore, we conclude that the surface operators made from codimension-2 defects that are obtained from the intersections with M5 -branes as described above, have an equivalent description in dual type IIB string theory in terms of pairs (Σ, L ). It seems likely that the line bundle L is closely related to the line bundle L appearing in the description of the Hitchin system in terms of pairs (Σ, L).
Note, the degree of this line bundle, d(L ), is equal to the induced D1-brane charge along the (x 0 , x 1 ) directions. For completeness, we describe what it corresponds to in the dual M-theory setup (3.18). The T-duality that relates type IIA and type IIB brane configurations maps D1-branes supported on (x 0 , x 1 ) into D2-branes with world-volume along (x 0 , x 1 , x 8 ). Hence, we conclude It seems worthwhile investigate the description of surface operators in terms of type IIB brane configurations in more detail.

Surface operators corresponding to codimension-4 defects
As we mentioned earlier, there is another way to construct surface operators in 4d N = 2 theories of class S -namely, by introducing codimension-4 defects in 6d five-brane theory [20][21][22]38].
In this section we present this construction. The idea is to start with the brane system which we used in the previous section to produce the codimension-2 defects and to deform it in such a way that the end result is a collection of codimension-4 defects. The advantage of this way of constructing them is that, as we will see below, this process does not change the subalgebra of the supersymmetry algebra preserved by the defects. Therefore, it follows that the two types of defects in fact preserve the same subalgebra.
In the next sections we will also use this link between the codimension-4 and codimension-2 defects in the 6d theory in order to establish the connection between the corresponding 4d N = 2 theories in the IR.

Brane construction
The origin of codimension-4 defects in 6d theory and the resulting surface operators in 4d N = 2 theory are best understood via the following brane construction: Brane 0 1 2 3 4 5 6 7 8 9 10 M 5 x where in addition to N M 5-branes supported on M 4 × C (as in Section 3.1) we have added a number of M 2-branes supported on D × R + , where R + = {x 7 ≥ 0}. Note that each of these M 2-branes is localized at one point of the UV curve C and therefore gives rise to a codimension-4 defect in the 6d theory. One of the main goals of this paper is to show that the surface operators in 4d N = 2 theory corresponding to these codimension-4 defects describe in the IR the same physical object as (3.1), up to a field transformation (which is related to a change of Darboux-coordinates in the associated integrable system). For such an equivalence to make sense, it is necessary that the two types of defects preserve the same supersymmetry subalgebra. This is a non-trivial statement that we explain presently.
A simple and elegant way to analyze supersymmetry and to gain further insight into the relation between the two types of surface operators is to perform a continuous deformation Figure 1: An M5 -brane wrapped on the curve C can be perturbed to a curve C which meets C at finitely many points u i . Then, separating the five-branes on C and C along the x 7 direction results in creation of M2-branes (shown in red). of one brane configuration into the other preserving the corresponding subalgebra of the supersymmetry algebra. 3 Starting with our original system (3.1), we keep the world-volume of the M5-branes to be D×D ×C, but deform the support of the M5 -branes to be D× C ×D , where C ⊂ T * C is a deformation of the zero section C ⊂ T * C, which is special Lagrangian with respect to ω = ω I and Ω = ω J + iω K : According to the discussion in Section 3.1, this deformation does not affect the amount of unbroken supersymmetry, and so (4.1) preserves the same part of the supersymmetry algebra as the original system (3.1). Note that deformations of special Lagrangian submanifolds are infinitesimally parametrized by H 1 (C) and, in most cases of interest, this is a fairly large space. However, what's even more important is that, after the deformation, C meets the original curve C only at finitely many points u i , as illustrated on Figure 1b. The number of such intersection points is determined by the Euler characteristic (or genus) of the curve C At low energies one may effectively represent the stack of M 5-branes in terms of a smooth curve Σ ⊂ T * C [20]. The M5 -branes will be represented by a curve Σ related to Σ by holomorphic deformation. Using the same arguments as above one may show, first of all, that two types of IR surface operators preserve the same SUSY and, furthermore, determines the number of intersection points on Σ to be The argument presented below applies equally well to a system where the UV curve C is replaced by the IR curve Σ. In fact, the latter version, which similarly explains that IR surface operators preserve the same SUSY is also responsible for the IR duality that underlies the separation of variables map.
where g Σ = 4g − 3 if C has no punctures [31], as will be assumed in this section for simplicity. After the deformation, every intersection of M5 and M5 locally looks like a product of R 2 with a submanifold in R 9 , which is a union of two perpendicular 4-spaces R 4 ∪ R 4 , intersecting at one point, times the real line R parametrized by the coordinate x 7 . Indeed, M5 and M5 overlap along a 2-dimensional part of their world-volume, D, and the remaining 4-dimensional parts of their world-volume span R 8 = {x 7 = 0}. If we separate these fivebranes in the x 7 direction, they become linked in the 9-dimensional space which is the part of the space-time orthogonal to D. Then, if we make one of the five-branes pass through the other by changing the value of its position in the x 7 direction, an M2-brane is created, as shown on Figure 1c. The support of the M2-brane is D × I, where I is the interval along x 7 connecting the deformations of the 4-spaces, which we denote by R 4 a and R 4 b (where a and b are the values of the coordinate x 7 corresponding to these two subspaces): This creation of the M2-brane between two linked M5-branes is a variant of the so-called Hanany-Witten effect [24]. What this means for us is that a surface operator represented by a codimension-2 defect wrapped on D × Σ in the fivebrane theory can be equivalently represented by a collection of codimension-4 defects supported at various points u i ∈ Σ. Indeed, globally, after separating M5 and M5 in the x 7 direction, the brane configuration (4.1) looks like this: Here, adding M2-branes does not break supersymmetry any further, so that (4.5) is a 1 8 -BPS configuration for arbitrary special Lagrangian submanifolds Σ and Σ ⊂ T * Σ. Of course, the special case Σ ≡ Σ takes us back to the original configuration (3.1), schematically shown in Conversely, reduction of (4.5) on the M-theory circle (parametrized by x 10 ) gives the type IIA system (4.6) shown on Figure 2a. How many M2-branes are created in the configuration (4.5)? If the number of M5-branes is N and the number of M5 -branes is k, then each intersection point u i ∈ Σ ∩ Σ contributes k · N M2-branes (due to the s-rule [24]). When we multiply this by the number of intersection points (4.3), we get the answer 2(g − 1)kN . This number, however, counts how many M2branes are created as one pulls a stack of M5 -branes through the stack of M5-branes by changing their x 7 -position from x 7 < 0 to x 7 > 0, while we are interested in a process that starts at x 7 = 0 and then goes to either x 7 < 0 or x 7 > 0.
The initial value x 7 = 0 is somewhat singular. However, as in a similar "geometric engineering" of 2d field theories with the same amount of supersymmetry [39], we shall assume that both phases x 7 < 0 and x 7 > 0 are symmetric and the same number of M2-branes is created (or destroyed) as we pass from x 7 = 0 to either x 7 < 0 or x 7 > 0. In fact, via a chain of dualities [40] our "brane engineering" of the 2d theory on M2-branes can be mapped to the "geometric engineering" of [39], which therefore justifies applying the same arguments. Then, it means that the answer we are looking for is only half of 2(g − 1)kN , i.e.
The case considered in this paper is N = k = 2, giving a number of 4g − 4 M2-branes created.
In the IR one may represent the M5 by a curve Σ in T * C. The M5 -branes are supported on a holomorphic deformation of Σ, which may be represented by a section of a line bundle of the same degree as K Σ , (4.8) It seems natural to assume that Σ is symmetric under the involution exchanging the two sheets of Σ. This implies that the projection π : Σ → C of the intersection points defines 4g − 4 points u = (u 1 , . . . , u 4g−4 ) on C. Following the discussion above, one expects to find a collection of M2-branes created with end-points at u r , r = 1, . . . , 4g − 4.
Since a surface operator supported on D ⊂ M 4 breaks translation invariance in the transverse directions (along D ), it must necessarily break at least part of supersymmetry of the 4d N = 2 gauge theory on M 4 . In addition, our analysis above shows that both types of surface operators preserve the same part of supersymmetry. It is convenient to express the unbroken parts of 4d Lorentz symmetry and supersymmetry in 2d language. Indeed, the unbroken generators of the Lorentz symmetry (in x 0 and x 1 directions along D) conveniently combine with the unbroken supercharges and the R-symmetry generators to form 2d N = (2, 2) supersymmetry algebra.

Four-dimensional description
We now start discussing the implications of this construction for the IR physics of 4d N = 2 gauge theories with surface operators.
The Lagrangian of a 4d N = 2 gauge theory with surface operators may have additional terms corresponding to 2d N = (2, 2) supersymmetric theories coupled to the surface operators. Recall that the Lagrangian of a theory with 2d N = (2, 2) supersymmetry is allowed to have a particular type of F-term called the twisted superpotential, denoted by W. From the point of view of a 4d theory, such a term is a two-dimensional feature, i.e. such terms would not be present in a 4d N = 2 theory without surface operators, and it is partially protected by the supersymmetry from quantum corrections. Moreover, in the IR, the 4d N = 2 gauge theory with surface operators is completely determined by the prepotential F and the twisted superpotential W (see e.g. [41] for a recent review).
Recall that the low-energy effective action has a four-dimensional part and a two-dimensional part, where F is the prepotential giving the low-energy effective action of the four-dimensional theory in the absence of a surface operator, and W is the holomorphic twisted superpotential. We will mostly consider F as a function F(a, τ ), with a being a collection a = (a 1 , . . . , a h ) of coordinates for the moduli space of vacua M vac , where h is the dimension of M vac , and τ being the collection of UV gauge coupling constants τ = (τ 1 , . . . , τ h ). The dependence on the mass parameters will not be made explicit in our notations. W ≡ W(a, κ, τ ) depends on a and τ , and may furthermore depend on a collection of parameters κ characterizing the surface operator in the UV. The presence of surface operators implies that the abelian gauge fields A r , r = 1, . . . , h appearing in the same vector-multiplet as the scalars a r will generically be singular at the support D of the surface operator. The singularity is such that the field strength F r associated to A r has a singularity of the form (F r ) 23 = 2πα r δ(x 2 )δ(x 3 ). The parameters α r are related to the twisted superpotential W by a relation of the form The parameters η r in (4.10) characterize the divergence of the dual gauge fields in a similar way. As indicated in (4.10), it is useful to combine the Gukov-Witten parameters α r and η r into complex variables t = (t 1 , . . . , t h ) which are functions of a, τ and κ.
The argument of the previous subsection shows that the brane configuration (3.1) that describes codimension-2 defects can be continuously deformed without changing the unbroken supersymmetry to a brane configuration describing codimension-4 defects: This has important implications for our story. First, it means that the same type of Omegabackground in both cases leads to the same kind of F-terms (appearing in the instanton partition functions) for both types of surface operators. Namely, in the language of unbroken 2d N = (2, 2) supersymmetry, it is the twisted superpotential W in both (3.15) and (4.18). Note that by itself, the existence of a continuous deformation relating surface operators corresponding to the codimension-2 defects to those corresponding to the codimension-4 defects does not necessarily imply their equivalence. Indeed, there are many physical systems related by a continuous deformation which describe completely different physics, e.g. gauge theory at different values of a coupling constant is a simple example. However, certain quantities may be insensitive to a change of parameter, and in fact, in the case at hand, we will show that the twisted superpotential W is precisely such a quantity that does not depend on the deformation described in the previous subsection (up to a change of variables).
But the twisted superpotential W determines the vacuum structure and the IR physics of the 4d theories with surface operators. Therefore if we can show that W is independent of the deformation, it will follow that the corresponding 4d theories are equivalent in the IR.
So, our plan is the following. In this subsection, we show that the twisted superpotential W is indeed independent of the separation of M5 and M5 in the x 7 direction, which was our deformation parameter in the brane configuration (4.5) that interpolates between (3.1) and (4.11). And then, in the next section, we will use this independence of W on the deformation parameter to argue that the 4d theories with the surface operators corresponding to the codimension-2 and codimension-4 defects describe the same physics in the IR regime (in other words, they are related by an IR duality).
In order to show the x 7 -independence of W, we need to focus more closely on the surface operators produced from codimension-4 defects and explain a few facts about the brane systems (4.5)-(4.11) that involve M2-branes. As we already pointed out earlier, the brane configuration (4.5) is simply an M-theory lift of the brane system (4.6) illustrated in Figure  2a. Usually, such M-theory lifts capture IR quantum physics of the original type IIA system, cf. [20]. In the present case, the relevant theory "lives" on D4-branes and D2-branes in (4.6). The theory on D4-branes is simply the 4d gauge theory on M 4 , and describing its IR physics via its M-theory lift was one of the main points of [20]. The theory on D2-branes is a 2d theory with N = (2, 2) supersymmetry preserved by the system (4.6), see e.g. [9,[42][43][44]. This 2d theory couples to 4d gauge theory and, hence, describes a half-BPS surface operator as a combined 2d-4d system. This has to be compared with our earlier discussion in Section 3.2, where we saw that surface operators constructed from codimension-2 defects naturally lead to singularities of gauge fields in the 4d gauge theory, while now we see that surface operators built from codimension-4 defects naturally lead to a description via combined 2d-4d system. Furthermore, the number N of D4-branes that determines the rank of the gauge group in four dimensions is the rank of the flavor symmetry group from the viewpoint of 2d theory on the D2-branes. In particular, in the basic case of N = 2 each D2-branes carries a U (1) linear sigma-model with N = 2 charged flavors, whose Higgs branch is simply the Kähler quotient C 2 / /U (1) ∼ = CP 1 .
This implies that codimension-4 defects give rise to a 2d-4d coupled system, in which gauge theory in the bulk is coupled to the CP 1 2d sigma-model on D ⊂ M 4 , which is IRequivalent to the corresponding 2d gauged linear sigma model. Moreover, this also shows why the deformation associated to the separation along x 7 direction in (4.5) does not affect the corresponding twisted superpotential. And here the identification of unbroken supersymmetry and the precise type of the F-terms in 2d becomes crucial.
Namely, from the viewpoint of the D2-branes in (4.6), the separation along the x 7 direction is the gauge coupling constant of the 2d gauged linear sigma-model [9,[42][43][44], On the other hand, it is a standard fact about 2d N = (2, 2) supersymmetry algebra that twisted superpotential is independent on the 2d gauge coupling constant [45]. The reader may observe that the number of variables u i parametrizing the positions of the created M2-branes exceeds the number of parameters χ (r) introduced via (3.3) for surfaces of genus g > 1. At the moment it does not seem to be known how exactly one may describe the system with M5-and M5 -branes at an intermediate energy scale in terms of a fourdimensional quantum field theory. It seems quite possible that the resulting description will involve coupling one gauge field A (r) µ to more than one copy of the CP 1 2d sigma-model on D ⊂ M 4 , in general.

Twisted superpotentials as generating functions
As we have seen in the previous subsection, regardless how different the theories with two types of surface operators may be in the UV, their effective descriptions in the IR have a relatively simple and uniform description. More specifically, the theories we are considering in this paper are essentially determined in the IR by their twisted superpotentials. Hence we focus on them.
The twisted superpotentials in the presence of codimension-2 and codimension-4 surface operators will be denoted by W M5 and W M2 , respectively. The twisted superpotential W M5 ≡ W M5 (a, x, τ ) depends besides a and τ on coordinates x for Bun G (C), and W M2 ≡ W M2 (a, u, τ ) on the positions of the points on C where the codimension-2 defects are located.
From both W M5 and W M2 we can find the corresponding Gukov-Witten parameters t M5 (a, x, τ ) and t M2 (a, u, τ ) via (4.10). If the two surface operators are equivalent in the deep IR there must in particular exist an analytic, locally invertible change of variables u = u * (x; a, τ ) relating the Gukov-Witten parameters t and t as t M5 (a, x, τ ) = t M2 (a, u * (x; a, τ ), τ ) . (4.13) It follows that the twisted superpotentials W M5 and W M2 may differ only by a function independent of a.
One may furthermore note that the variables u i are dynamical at intermediate scales, or with non-vanishing Omega-deformation. The system obtained by separating the M5 -branes by some finite distance ∆x 7 from the M5-branes will be characterized by a superpotential W depending both on x and u, in general. We had argued above that this superpotential does not depend on the separation ∆x 7 . Flowing deep into the IR region one expects to reach an effective description in which extremization of the superpotential determines u as function of x and the remaining parameters, u = u * (x, a, τ ). The result should coincide with W M5 (a, x, τ ), which is possible if the resulting superpotential W differs from W M2 (a, u, τ ) by addition of a function W (u, x, τ ) that is a-independent W (a, x, u, τ ) = W M2 (a, u, τ ) + W (u, x, τ ) ; (4.14) the additional piece W (u, x, τ ) may be attributed to the process creating the M2-branes from M5 -branes. Extremization of W implies that and W (a, x, u, τ ) u=u * should coincide with W M5 (a, x, τ ).
We are now going to argue that W M5 , W M2 and W represent generating functions for changes of variables relating three different sets of Darboux-coordinates for the same moduli space M 2d locally parametrized by the variables a and x (see, for example, [46], Section 2.1, for the definition of generating functions and a discussion of their role in the Lagrangian formalism).
Considering W M5 first, one may define other local coordinates for M 2d as Both (x, p) and (a, t), with t defined via (4.10), will generically define local coordinates for M 2d . Having a Poisson-structure on M 2d that makes (x, p) into Darboux-coordinates it follows from (4.10) and (4.16) that (a, t) will also be Darboux-coordinates for M 2d .
If x and u are related by a locally invertible change of variables u = u * (x; a, τ ) it follows from (4.15) that u together with the coordinates v defined by v r = ∂ ∂u r W M2 (a, u, τ ) , (4.17) will represent yet another set of Darboux coordinates for M 2d . In this way one may identify W M2 and W as the generating functions for changes of Darboux variables (a, t) ↔ (u, v) and (u, v) ↔ (x, p) for M vac , respectively. There are various ways to compute the twisted superpotential W. One (though not the only one!) way is to compute the asymptotic expansion of the Nekrasov partition function [26] in the limit 1,2 → 0. It takes the form Here, F is the Seiberg-Witten prepotential that does not depend on the surface operator and defines the corresponding IR 4d theory in the bulk. The next term in the expansion, W, is what determines the IR theory with the surface operator. 4 In what follows we will use the relations of the instanton partition functions to conformal blocks to determine W M5 (a, x, τ ) and W M2 (a, u, τ ) via (4.18). Both functions will be identified as generating functions for changes of Darboux-variables (x, p) ↔ (a, t) and (u, v) ↔ (a, t) for the Hitchin moduli space M H (C), respectively. Among other things, this will imply that W M5 (a, x, τ ) and W M2 (a, m; u) indeed satisfy a relation of the form W M5 (a, x, τ ) = W M2 (a, u * (x, a, τ ), τ ) + W SOV (u * (x, a, τ ), x, τ ) . In view of the discussion above one may view this result as nontrivial support for the conjectured IR duality relation between the theories with the surface operators of co-dimensions 2 and 4, if we set W ≡ W SOV .

Relation to conformal field theory
We had previously observed that the twisted superpotentials W M5 σ (a, x, τ ) that may be calculated from the instanton partition functions Z M5 σ (a, x, τ ; 1 , 2 ) via (3.15) represent changes of Darboux variables for the Hitchin integrable system. We will now discuss analogous results for W M2 σ (a, u, τ ). To this aim we begin by describing the expected relations between the instanton partition functions Z M2 σ (a, x, τ ; 1 , 2 ) and Liouville conformal blocks. Conformal blocks for the Virasoro algebra with central charge c b = 1 + 6(b + b −1 ) 2 may be defined in close analogy to the Kac-Moody conformal blocks discussed above. Our discussion shall therefore be brief. Given a Riemann surface C with n punctures, we associate representations V αr generated from highest weight vectors v αr to the punctures z r , r = 1, . . . , l. The Lie algebra Vect(C \{z 1 , . . . , z l }) of meromorphic vector fields on C with poles only at z r , r = 1, . . . , l, is naturally embedded into the direct sum of l copies of the Virasoro algebra with the central elements identified (using the expansion of the vector fields near the punctures). Conformal blocks ϕ are then defined as linear functionals on l r=1 V αr that are invariant under the action of Vect(C \ {z 1 , . . . , z l }). This invariance condition represents the conformal Ward identities. Chiral partition functions Z F (ϕ, C; b) are defined as the evaluation of ϕ on the product of highest weight vectors l r=1 v αr , in the physics literature often denoted as In general, the space of conformal blocks is infinite-dimensional. However, it can be decomposed into a direct sum (or direct integral, depending on the situation) of finitedimensional spaces (in some cases, such as that of the Liouville model, one-dimensional spaces, so that we obtain a basis) using the gluing construction reconstructing C from its pants decompositions specified by the data σ = (C, Γ) introduced in Section 2.1. Its elements are labeled by representation parameters β e assigned to the cut curves γ e ∈ C. We denote the resulting chiral partition functions by Z L (β, τ ; b).
We shall also discuss the situation of d additional degenerate representations V −1/2b (sometimes called Φ 1,2 primary fields) associated to points S = {u 1 , . . . , u d } ⊂ C that are distinct and different from the punctures z 1 , . . . , z l . The corresponding chiral partition functions then satisfy d second order differential equations resulting from the existence of degree 2 null vectors in V −1/2b . A basis for the space of solutions can be obtained by starting from a pants decomposition σ of C. Each pair of pants C v 0,3 obtained by cutting along C contains a subset S v of S. Choosing a pants decomposition of C v 0,3 \ S v one obtains a refined pants decomposition σ that can be used to define chiral partition functions Z L σ, (β, u, q; b) as before. The additional set of labels entering the definition of Z L σ, is constrained by the fusion rules for existence of conformal blocks with degenerate representations inserted, and may therefore be represented by elements of Z d 2 .

The precise definition of the instanton partition functions
in the presence of d codimension 4 surface operators depends on the choice of a refined pants decomposition σ, decorated with certain additional discrete data collectively denoted , see [44]. In [9] it was conjectured that the instanton partition functions Z M2 σ, coincide with Liouville conformal blocks with d additional degenerate fields inserted, given that the parameters are related as Further evidence for (4.21) and some of its generalizations were discussed in [6,44,47,48]. Now we are ready to bring together the results of the previous sections to demonstrate the IR duality of two 4d gauge theories with surface operators and to link it to the separation of variables in CFT and Hitchin system.

Relation to the Hitchin system and to the separation of variables
It is shown in the Appendix D that (4.21) implies that as already proposed in [9]. The function W M2 (a, u, τ ) is given as We are now going to explain that there exist other sets of natural Darboux-coordinates (u, v) for Hitchin moduli space allowing us to identify the function W M2 (a, u, τ ) defined in (4.24) as the generating function for the change of variables (a, t) ↔ (u, v).
Recall from Section 2.3 that the spectral cover construction allows us to describe M H (C) as the space of pairs (Σ, L). The line bundle L may be characterized by a divisor of zeros of a particular section of L representing a suitably normalized eigenvector of the Higgs field ϕ ∈ H 0 (C, End(E) ⊗ K C ) that we describe presently. Even though this divisor is not unique, it's projection onto C is uniquely determined by the data of the rank two bundle B with a fixed determinant 5 and the Higgs field ϕ.
Locally on C, we can trivialize the bundle B and choose a local coordinate z. Then we can write ϕ as We have the following explicit formula for the eigenvectors of ϕ Ψ ± = a(y) ± v(y) c(z) , v 2 (y) = 1 2 tr(ϕ 2 (y)) .
Note that for the matrix element c(z)dz to be well-defined globally on C and independent of any choices, we need to represent B as an extension of two line bundles, see Appendix C.2 for more details.
If c(z) = 0, then Ψ = 0 for either branch of the square root. If c(z) = 0, then one of them vanishes. Now recall that the line bundle L on the double cover Σ of C is defined precisely as the line bundle spanned by eigenvectors of ϕ (at a generic point p of C, ϕ has two distinct eigenvalues, which correspond to the two points, p and p , of Σ that project onto p, and the fibers of L over p and p are the corresponding eigenvectors). Therefore, if we denote by D the divisor of zeros of c(z)dz on C, Ψ gives rise to a non-zero section of L outside of the preimage of D in Σ.
Generically, D is multiplicity-free and hence may be represented by a collection u = (u 1 , . . . , u d ) of d := deg(D) distinct points. The number number d depends on the degrees of the line bundles used to represent B as an extension, in general. It may be larger than 3g − 3 + n, the dimension of Bun G . However, fixing the determinant of B defines a collection of constraints allowing us to determine u k , k = h + 1, . . . , d in terms of the coordinates u i , i = 1, . . . , u h .
There are two distinct points, u i and u i , in Σ over each u i ∈ C. Then for each i = 1, . . . , h, our section has a non-zero value at one of the points, u i or u i , and vanishes at another point. Thus, the divisor of this section on Σ is the sum of particular preimage of the points u i , i = 1, . . . , h, in Σ, one for each i. While there is a finite ambiguity remaining for this divisor, 6 the unordered collection u = (u 1 , . . . , u h ) of points of C is well-defined (generically). And then for each u i we choose the eigenvalue v k ∈ T * i C, for which our section provides a non-zero eigenvector. It is known that the collection (u, v) = ((u 1 , v 1 ), . . . , (u h , v h )) can be used to get to a system of Darboux coordinates for M H (C) [49,50], see also [51] for related results.
It was observed in [50] that the definition of the variables (u, v) outlined above can be seen as a generalization of the method called separation of variables in the literature on integrable models [16]. A familiar example is the so-called Gaudin-model which can be identified with the Hitchin integrable system associated to surfaces C of genus zero with n regular singularities at distinct points z 1 , . . . , z n . The Higgs field can then be represented explicitly as and the separated variables are obtained as the zeros of the lower left entry A − (y)dy of ϕ: One may think of the separation of variables as a useful intermediate step in the construction of the mapping from the original formulation of an integrable model to the description as the Hitchin fibration in terms of action-angle coordinates (a, t). The remaining step from the separated variables (u, v) to the action-angle variables is then provided by the Abel map. The function W M2 (a, u, τ ) is nothing but the generating function for the change of Darboux coordinates between (u, v) and (a, t). A few more details can be found in Appendix C.4.

IR duality of surface operators from the defects of codimension 2 and 4
In this section we combine the ingredients of the brane analysis in Section 4.1 with our results on the twisted superpotentials to show that the 4d gauge theories with the surface operators constructed from codimension-2 and codimension-4 defects are equivalent in the IR.
Indeed, their vacuum structures are controlled by the twisted superpotentials W M5 (a, x, τ ) and W M2 (a, u, τ ), and we have found that they are related by a change of variables (that is, a redefinition of fields).
Furthermore, when combined, the above arguments -including the brane creation upon the change of separation in the x 7 direction -show that two types of surface operators constructed from codimension-2 and codimension-4 defects preserve the same supersymmetry subalgebra and have the same twisted chiral rings. 7 This is sufficient to establish their equivalence for the purposes of instanton counting. In order to demonstrate the IR equivalence of the full physical theories, we need to show the isomorphism between their chiral rings (and not just the twisted chiral rings). In general, this is not guaranteed by the arguments we have used, but the good news is that for simple types of surface operators, including the ones considered here, the chiral rings are in fact trivial 8 and, therefore, we do obtain the equivalence of the two full physical theories.
As we already mentioned in the Introduction, this equivalence, or duality, between the IR physics of 4d N = 2 gauge theories with two types of surface operators is conceptually similar to the Seiberg duality of 4d N = 1 gauge theories [1]. In fact, it would not be surprising if there were a more direct connection between the two phenomena since they both enjoy the same amount of supersymmetry and in its brane realization, Seiberg's duality involves the same kind of "moves" as the ones described in the previous section.

Turning on the Omega-deformation
The relation between W M5 (a, x, τ ) and W M2 (a, u, τ ) has a rather nontrivial generalization in the case of non-vanishing Omega-deformation that we will describe in this subsection. The fact that in 2d this a variant to the separation of variables continues to hold for non-zero values of 1 and 2 suggests that the two 4d N = 2 gauge theories remain IR equivalent even after Omega-deformation. The possibility of such an equivalence certainly deserves further study.
When we quantize the Hitchin system, the separation of variables may also be quantized. In the genus zero case, in which the quantum Hitchin system is known as the Gaudin model, this was first shown by E. Sklyanin [16]. Note that the quantization of the classical Hitchin system corresponds, from the 4d point of view, to "turning on" one of the parameters of the 7 Twisted chiral rings are Jacobi rings of the twisted chiral superpotential W which has been our main subject of discussion in earlier sections. 8 In general, 2d N = (2, 2) theories may have non-trivial chiral and twisted chiral rings, see for example [52].
However, if we start with a 2d theory without superpotential, then, as long as chiral superfields are all massive in the IR, integrating them out leads to a theory of twisted chiral superfields with a twisted superpotential, and so the chiral ring is indeed trivial.
Omega-deformation which is the case studied in [53]. It has been explained in Section 6 of [17] that one may interpret the separation of variables in the Gaudin model, as well as more general quantum Hitchin systems, as the equivalence of two constructions of the geometric Langlands correspondence (Drinfeld's "first construction" and the Beilinson-Drinfeld construction). Feigin, Frenkel, and Stoyanovsky have shown (see [18]) that in genus zero the separation of variables of the quantum Hitchin system maybe further deformed when we "turn on" both parameters of the Omega deformation. This result was subsequently generalized to get relations between non-chiral correlation functions of the WZW-model and the Liouville theory in genus 0 [19], and in higher genus [54]. It has furthermore been extended in [27] to larger classes of conformal blocks. From the 4d point of view, this relation amounts to a rather non-trivial relation via an integral transform (a kind of "Fourier transform") between the instanton partition functions of the Omega-deformed 4d theories with surface operators corresponding to the defects of codimensions 2 and 4.
The resulting relation has its roots in the quantum Drinfeld-Sokolov reduction. We recall [55,56] that locally it amounts to imposing the constraint J − (z) = 1 on one of the nilpotent currents of the affine Kac-Moody algebra sl 2 . The resulting chiral (or vertex) algebra is the Virasoro algebra. Furthermore, if the level of sl 2 is then the central charge of the Virasoro algebra is Globally, on a Riemann surface C, the constraint takes the form J − (z)dz = ω, where ω is a one-form, if we consider the trivial SL 2 -bundle, or a section of a line bundle if we consider a non-trivial SL 2 -bundle that is an extension of two line sub-bundles (the representation as an extension is necessary in order to specify globally and unambiguously the current J − (z)dz). Generically, ω has simple zeros, which leads to the insertion at those points of the degenerate fields V −1/2b of the Virasoro algebra in the conformal blocks.
It is important to remember that classically the separated variables u i are the zeros of a particular component of the Higgs field ϕ. But the Higgs fields correspond to the cotangent directions on M H (C), parametrized by the p-variables. After quantization, these variables are realized as the derivatives of the coordinates along the moduli of SL 2 -bundles (the xvariables), so we cannot directly impose this vanishing condition. Therefore, in order to define the separated variables u in the quantum case, we must first apply the Fourier transform making the p-variables into functions rather than derivatives (this is already needed at the level of the quantum Hitchin system, see [17]). Since the Fourier transform is an integral transform, our formulas below involve integration. Indeed, the separation of variables linking the chiral partition functions in the WZW-model and the Liouville model is an integral transform.
In Appendix E it is shown that the relations described above can be used to derive the following explicit integral transformation, (4.26) whereŽ WZ andŽ L are obtained from Z WZ and Z L by taking the limit z n → ∞, and the kernel K SOV (x, u) is defined as ; N J is an (x, z)-independent normalization factor that will not be needed in the following. Note that the x-dependence it entirely in the first factor on the right hand side of (E.12). Using (3.15), (4.23) and (E.14) it is easy to see that the relation (4.19) follows from (4.26). Formula (4.26) is the relation (1.1) discussed in the Introduction made explicit. Thus, we see that the separation of variables in the most general case (with both parameters of the Omega deformation being non-zero), viewed as a relation between the chiral chiral partition functions in the WZW-model and the Liouville model, provides the most satisfying conceptual explanation of the IR duality of the 4d gauge theories with surface operators of two kinds discussed in this paper.

A. Surface operators and Nahm poles
Complex (co)adjoint orbits are ubiquitous in the study of both half-BPS surface operators and boundary conditions. This happens for a good reason, and here we present a simple intuitive explanation of this fact. In short, it's due to the fact that both half-BPS surface operators and boundary conditions are labeled by solutions to Nahm equations. Then, the celebrated work of Kronheimer [57] relates the latter to complex coadjoint orbits.
Suppose that in our setup (3.1) we take C = S 1 C × R and M 4 = D × D ∼ = R 4 , where D ∼ = R 2 is the "cigar." In other words, D is a circle fibration over the half-line, R + = {y ≥ 0}, with a singular fiber at y = 0 so that asymptotically (for y → +∞) D looks like a cylinder, see Figure 3. Then, the six-dimensional (2, 0) theory on M 4 × C with a codimension-2 defect on D × C can be reduced to five-dimensional super-Yang-Mills theory in two different ways. First, if we reduce on a circle S 1 C , we obtain a 5d super-Yang-Mills on M 4 × R ∼ = R 5 with a surface operator supported on D × R ∼ = R 3 . If we denote by r = e −y the radial coordinate in the plane transverse to the surface operator, then the supersymmetry equations take the form of Nahm's equations: where we used the following ansatz for the gauge field and for the Higgs field: On the other hand, if we first reduce on the circle fiber S 1 F of the cigar geometry D , we obtain a 5d super-Yang-Mills on R + × D × C with a non-trivial boundary conditions at y = 0 determined by the codimension-2 defect of the six-dimensional theory. Note, these boundary conditions are also associated with solutions to Nahm's equations (A.1) for the Higgs field φ = (a, b, c). Further dimensional reductions of these two systems yield many half-BPS boundary conditions and surface operators in lower-dimensional theories, all labeled by solutions to Nahm's equations.
Among other things, this duality implies that similar physical and mathematical structures can be found on surface operators as well as in the study of boundaries and interfaces. A prominent example of such structure is the algebra of parameter walls and interfaces, i.e. Janus-like solitons realized by monodromies in the space of parameters. (In the case of surface operators, such monodromy interfaces are simply line operators, which in general form non-commutative algebra if they can't move off the surface operator, as illustrated in Figure 4.) This description of walls, lines and interfaces as monodromies in the parameter space provides a simple and intuitive way of understanding their non-commutative structure and commutation relations; it is captured by the fundamental group of the parameter space [7]: For instance, in the case of C = T 2 one finds π 1 ((T C /S N ) reg ), which is precisely the braid group (in the case, of type A N −1 ). It is generated by parameter walls / interfaces L i that obey the standard braid group relations: From 2d and 3d perspectives, these systems are often described by sigma-models based on flag target manifolds (or their cotangent bundles) where the lines/walls L i are represented by twist functors; see [8,41] for further details and many concrete examples of braid group actions on boundary conditions. The case of the parameter space (2.5) is qualitatively similar.

B. Twisting of Kac-Moody conformal blocks
This appendix collects some relevant mathematical background concerning the dependence of Kac-Moody conformal blocks on the choice of a holomorphic bundle on C.

B.1 Twisted conformal blocks
A generalization of the defining invariance condition allows us to define a generalized notion of conformal blocks depending on the choice of a holomorphic G-bundle B on C. One may modify the defining invariance condition (3.7) by replacing the elements of the Lie algebra g out by a section of g B out := Γ(C, g B ) , Describing B in terms of a cover {U ı ; ı ∈ I} of C allows us to describe B in terms of the G-valued transition functions h ı (z) defined on the intersections U ı = U ı ∩ U  . The sections of g B out are represented by families of g-valued functions η ı in U ı , with η ı and η  related on the intersections U ı by conjugation with h ı (z). In this way one defines B-twisted conformal blocks ϕ B depending on the choice of a G-bundle B.
More concrete ways of describing the twisting of conformal blocks are obtained by choosing convenient covers {U ı ; ı ∈ I}. One convenient choice is the following: Let us choose discs D k around the points z k , k = 1, . . . , n such that U out := C \ {z 1 , . . . , z n } and U in = n k=1 D k form a cover of C. It is known that for G = SL(2) G-bundles B can always be trivialized in U out and U in . An arbitrary G-bundle B can then be represented by the G-valued transition functions h k (t k ) defined in the annular regions A k := U out ∩ D k modulo changes of trivialization in U in and in U out , respectively.
Introducing the dependence on the choice of B in the way described above makes it easy to see that infinitesimal variations δ of B can be represented by elements of n i=1 g ⊗ C((t i )). Choosing a lift X δ to the diagonal central extension of n i=1 g ⊗ C((t i )) allows us to define a (projective) action of T Bun G B on CB g (R 1 , . . . , R n ). This means that a differential operator δ representing an element T Bun G B can be represented on the conformal blocks in terms of the action of η δ on n r=1 R r , schematically δϕ(e [n] ) = ϕ η δ e [n] , e [n] := e 1 ⊗ · · · ⊗ e n .

(B.2)
This action describes the response of a conformal block ϕ B with respect to an infinitesimal variation of B.

B.2 Genus zero case
In the case of genus 0 it suffices to choose the transition functions h k (t k ) in the annular regions A k around the points z k to be the constant nilpotent matrices h k (t k ) = 1 x k 0 1 . The collection of parameters x = (x 1 , . . . , x n ) can be used to represent the dependence on the choice of B in this case. The action of T Bun G B on spaces of conformal blocks defined via (B.2) may then be represented more explicitly in terms of the differential operators J a r defined as The Casimir operator is represented as multiplication by j r (j r + 1). The parametrization in terms of n variables x = (x 1 , . . . , x n ) is of course redundant. The conformal Ward-identities (3.7) include the invariance under global sl 2 -transformations, allowing us to eliminate three out of the n variables x 1 , . . . , x n in the usual way.
The operators H r appearing in the Knizhnik-Zamolodchikov equations (3.11) are then given by the formulae where the differential operator J rs is defined as The operators H r commute, and may therefore be used as Hamiltonians for generalizations of the Gaudin models associated to more general representations of SL(2, C).

B.3 Higher genus cases
Instead of the covers considered in Subsection B.1 above one may use alternatively use covers defined using the gluing construction. One thereby gets a cover {U ı ; ı ∈ I} with intersections represented by annuli A e between pairs of pants or connecting two legs of the same pair of pants. Choosing constant diagonal transition functions in the annuli A e gives us a collection of local coordinates x e , e = 1, . . . , 3g − 3 + n for Bun G , G = SL(2). The resulting parameters x for Bun G are easily identified with the parameters x introduced in the gluing construction of conformal blocks via (3.10) provided we choose K(τ, x) to be e 2πiτ L 0 x J 0 0 . In order to have a globally well-defined current J − on C one needs to represent B as an extension. Taking appears to be particularly natural. This allows us to represent J − as a section of L ⊗ K C . As explained in Appendix C it is natural in our case to consider fixed line bundles L of degree d . Let us represent L as O(D ), with divisor D being represented by the points y 1 , . . . y d .
The bundle B may be described by using a cover {U ı ; ı ∈ I} for C containing small discs D k around y k , k = 1, . . . , d , with transition functions on the annuli A k = D k \{y k }, where t k is a coordinate on D k vanishing at y k . Sections of B may alternatively be represented locally by functions that are regular outside of {y k , k = 1, . . . , d } and may have poles with residue in a fixed line k at y k , k = 1, . . . , d . Using the transition functions (B.7) determines the lines k in terms of the parameters x k . Modifications of B that increase the degree d of L are called Hecke modifications. Using covers defined with the help of the gluing construction it appears to be natural to take d = 2g − 2. In this case one may assume that there is exactly one y k contained in each pair of pants. Kac-Moody conformal blocks associated to each pairs of pants appearing in the pants decomposition of a closed Riemann surface can then be defined using conformal blocks on C 0,4 , with one insertion being the degenerate representation of the Kac-Moody algebra R k/2 representing the Hecke modifications within conformal field theory [27]. If the Riemann surface has punctures, one may use conformal blocks on C 0,3 without extra insertion of R k/2 for the pairs of pants containing the punctures.
It is worth remarking that d = 2g − 2 is exactly the case where the current J − , being a section of K C ⊗ L, has 4g − 4 zeros u i , as required by the identification of the points u i with the end-points of the M2-branes created from the M5 -branes.

C. Holomorphic pictures for the Hitchin moduli spaces
The Hitchin space M H (C) was introduced in the main text as the space of pairs (B, ϕ). Interpreting the Higgs fields ϕ ∈ H 0 (C, End(E) ⊗ K C ) as representatives of cotangent vectors to Bun G , one may identify M H (C) with T * Bun G , the cotangent bundle of the moduli space of holomorphic G-bundles on C. This description equips M H (C) with natural complex and symplectic structures, leading to the definition of local sets of Darboux coordinates (x, p) parametrizing the choices of G-bundles via coordinates x, and the choices of Higgs fields ϕ in terms of holomorphic coordinates p.
In order to exhibit the relation with conformal field theory we will find it, following [27,58], useful to consider a family of other models for M H (C). We will consider moduli spaces M H (C) of pairs (B, ∇ ) consisting of holomorphic bundles B with holomorphic -connections ∇ . An -connection is locally represented by a differential operator ∇ = ( ∂ y +A(y))dy transforming as ∇ = g −1 · ∇ · g under gauge-transformations. Consideration of M H (C) will represent a useful intermediate step which helps clarifying the link between conformal field theory and the Hitchin system. Noting that any two -connections ∇ and ∇ differ by an element of H 0 (C, End(E) ⊗ K C ) one sees that M H (C) can be regarded as a twisted cotangent bundle T * Bun G . Picking a reference connection ∇ ,0 , one may represent a generic connection as ∇ = ∇ ,0 + ϕ.
To avoid confusion let us stress that the resulting isomorphism M H (C) T * Bun G is not canonical, being dependent on the choice of ∇ ,0 . Instead we could use the known results of Hitchin, Donaldson, Corlette and Simpson [59][60][61][62][63] relating pairs (B, ϕ) to flat connections on C to identify the moduli spaces M H (C) and M H (C). The description of M H (C) as twisted cotangent bundle yields natural complex and symplectic structures which are inequivalent for different values of . This can be used to describe the hyperkähler structure on M H (C), with being the hyperkähler parameter [64]. However, in order to discuss the relation with conformal field theory we find it useful to adopt a different point of view. The definition of conformal blocks depends on the choice of a G-bundle B, which may be parametrized by variables x in a way that does not depend on 1 and 2 . The gluing construction yields natural choices for the reference connection ∇ ,0 , e.g. the trivial one. All dependence on the parameter is thereby shifted into the relations between different charts U ı on M H (C) parametrized in terms of local coordinates (x ı , p ı ) in a way that does not explicitly depend on .
One may formally identify ϕ ∈ H 0 (C, End(E) ⊗ K C ) as an -connection for = 0. We therefore expect that the Darboux coordinates (x , p ) turn into the Darboux coordinates (x, p) discussed in the main text when → 0. This will be further discussed below, after having discussed possible choices of Darboux coordinates more concretely.

C.1 Three models for Hitchin moduli space
There are three models for M H (C) of interest for us: (A) As space of representations of the fundamental group Hom(π 1 (C), SL(2, C))/SL(2, C) .
(C.1) (B) As space of bundles with connections (E, ∇ ), Having n punctures z 1 , . . . , z n means that A(y) is allowed to have regular singularities at y = z r of the form where t(y) has n regular singularities at y = z r , and d apparent singularities at y = u k , Having an apparent singularity at y = u k means that the monodromy around u k is trivial in PSL (2, C). This is known [17,Section 3.9] to be equivalent to the fact that the residues H r , r = 1, . . . , n are constrained by the linear equations In order to describe the relation between (B) and (B') more concretely let us, without loss of generality, assume that elements of Bun G are represented as extensions Describing the bundles B by means of a covering U ı of C and transition functions B ı between patches U ı and U  , one may assume that all E ı are upper triangular, This implies that the lower left matrix element A − (y) of the -connection ∂ y + A(y) is a section of the line bundle (L ) −1 ⊗ L ⊗ K C , with K C being the canonical line bundle. The gauge transformation which transforms A(y) to the form (C.7) will be singular at the zeros u k of A − (y), leading to the appearance of the apparent singularities u k in (C.4).

C.2 Complex-structure dependent Darboux coordinates
Let us briefly discuss possible ways to introduce Darboux coordinates (x, p) for M H (C), and how the passage from -connections to opers defines a change of Darboux coordinates from (x, p) to (u, v).

Genus zero
In the cases of genus g = 0 we may parametrize the matrices A r in (C.2) as assuming that (x r , p r ) are a set of Darboux coordinates with {p r , x s } = δ r,s . Let P n be the phase space whose algebra of functions is generated by functions of (x r , p r ), r = 1, . . . , n.
The space M flat (C 0,n ) can be described as the symplectic reduction of P n w.r.t. the global sl 2 -constraints n r=1 A a r = 0 , (C.11) for a = −, 0, +, or, more conveniently, as the symplectic reduction of P n−1 w.r.t. the constraints (C.11) for a = −, 0 combined with sending z n → ∞. We will use the latter description. The change of (x, p) ↔ (u, v) induced by the relation between models (B) and (B') is explicitly described by the formulas (note that the same formulas (4.25) appear in the limit → 0): The resulting change of variables (x, p) ↔ (u, v) is known to be a change of Darboux coordinates. It is in fact the classical version of the separation of variables transformation for the Schlesinger system [65]. The dimension of the space of extension classes is then dim(H 1 (L −1 )) = g − 1 + deg(L) = 3g − 3. The moduli of Bun G can therefore be parametrized by the choices of extension classes. Coordinates x = (x 1 , . . . , x 3g−3 ) on H 1 (L −1 ) give coordinates for Bun G .
Serre duality implies that the dual of H 1 (L −1 ) is the space H 0 (L ⊗ K C ). Recall that the lower left matrix element A − (y) of an -connection ∂ y + A(y) is a section of the line bundle L ⊗ K C . Finding coordinates for H 0 (L ⊗ K C ) that are dual to the coordinates x on H 1 (L −1 ) with respect to the pairing provided by Serre duality will therefore give us coordinates p = (p 1 , . . . , p 3g−3 ) that are canonically conjugate to the coordinates x on Bun G .

C.3 Complex-structure independent Darboux coordinates
Representing elements of M flat (C) in terms of the model (A) mentioned above allows one to introduce useful Darboux coordinates which do not depend on a choice of complex structure of C as opposed to the coordinates (u, v) and (x, p) introduced before. A convenient description was given in [66] and references therein.
Let us use the set-up from Section 2.1. A trivalent where c ij (L s ) is defined as Restricting these Darboux coordinates to the Teichmüller component we recover the Fenchel-Nielsen length-twist coordinates well-known in hyperbolic geometry.

C.4 Limit → 0: Recovering the Higgs pairs
We now want to send → 0. One may note that the equation ( ∂ y + A(y))ψ(y; x, z) can in the limit be solved to leading order in by an ansatz of the form ψ(y; x, z) = e − 1 y du v(u) χ(y; x, z) , (C. 17) where χ(y; x, z) is an eigenvector of A(y) with eigenvalue v, A(y) χ(y; x, z) = v(y) χ(y; x, z) .
The function v(y) representing the eigenvalue of A(y) must satisfy v 2 + t(y) = 0, where Using t(y) we define the Seiberg-Witten curve as usual by Two linearly independent eigenvectors of A(y) are given by One of χ ± (y; x, z) vanishes at the zeros u k of A − (y). It easily follows from these observations that the coordinates (x, p) and (u, v) for M H (C) turn into the coordinates for M H (C) used in the main text when → 0. It follows from (C.17) that a e and k e are in the limit 2 → 0 representable in terms of periods of the canonical differential v on Σ. Given a canonical basis B = {α 1 , . . . , α h ; α D 1 , . . . , α D h } for H 1 (Σ, Z) = H 1 (Σ, Z)/H 1 (C, Z) one may define the corresponding periods as where ω k , k = 1, . . . , h are the Abelian differentials of the first kind on the spectral curve Σ which are dual to the differentials α i in the sense that α i ω k = δ ik . The functions t r represent coordinates on the Prym variety. The fact that the coordinates (a, t) represent Darboux coordinates for M H (C) follows from the fact that is a generating function for the change of coordinates (u, v) ↔ (a, t). Indeed, note that is an abelian differential on Σ satisfying α i ω k = δ ik as a consequence of (C.22). We may therefore conclude that W L (a, u, z) satisfies identifying W L (a, u, z) as the generating function for the change of coordinates (u, v) ↔ (a, t).

D. Classical limits of conformal field theory
We had in the main text introduced chiral partition functions Z L (β, u, τ ; b) and Z WZ (j, x, τ ; k) in Liouville theory and the WZWN model respectively. It will be helpful to parametrize the representation labels β and j appearing in the arguments of the functions Z L (β, u, τ ; b) and Z WZ (j, x, τ ; k) as Using this parametrization allows us to introduce chiral partition functions Z L (a, u, τ ; 1 , 2 ) and Z WZ (a, x, τ ; 1 , 2 ) depending on two parameters 1 and 2 . We may therefore define two different classical limits of Liouville theory and the SL(2)-WZW model by sending 1 or 2 to zero, respectively. We are interested in the limit where both 1 and 2 are sent to zero, but it helps to first study the limit 1 → 0 with 2 finite before sending 2 → 0. After sending 1 to zero we will find a relation to the moduli space M 2 H (C) of 2 -connections. The two cases related to Virasoro and Kac-Moody algebra, respectively, can be treated in very similar ways. In each of these cases we will show that the leading asymptotic behavior of the chiral partition functions, is represented by functions Y WZ (a, x, τ ; 2 ) and Y L (a, u, τ ; 2 ), which are generating functions for the changes of Darboux variables (x, p) ↔ (a, k) and (u, v) ↔ (a, k) for M 2 H (C), respectively.
The dependence on the variables x (resp. u) will be controlled by the partial differential equations satisfied by Z WZ (a, x, τ ; 1 , 2 ) (resp. Z L (a, u, τ ; 1 , 2 )), known as Knizhnik-Zamolodchikov-Bernard (KZB) and Belavin-Polyakov-Zamolodchikov (BPZ) equations. In order to control the dependence on the variables a in both cases the crucial tool will be the Verlinde loop operators defined by integrating the parallel transport defined by KZB-and BPZ-equations, respectively. The Verlinde loop operators can be represented as difference operators acting on the a-variables. The limit 1 → 0 of the relations between parallel transport and the corresponding difference operators will govern the a-dependence of Y WZ (a, x, τ ; 2 ) and Y L (a, u, τ ; 2 ). The following discussion considerably refines the previous observations [67,68] by supplementing the "other side of the coin" represented by the Verlinde loop operators.
To simplify the exposition we will spell out the relevant arguments only in the case when C has genus zero. The dependence on the complex structure of C may then be described using the positions z = (z 1 , . . . , z n ) of the marked points. We will therefore replace the parameters τ by the variables z in the following. The generalization of this analysis to higher genus Riemann surfaces will not be too hard.

D.1 Preparations: Insertions of degenerate fields
It will be useful to modify the conformal blocks by inserting a variable number of m extra degenerate fields at position y = (y 1 , . . . , y m ).
The corresponding chiral partition functions Ψ WZ (y; x, z) satisfy additional first order differential equations governing the y-dependence which will be formulated explicitly below. The family of chiral partition functions obtained in this way represents a convenient repackaging of the information contained in the chiral partition function Z WZ (x, z) without extra degenerate fields (m = 0). The chiral partition functions Z WZ (x, z) essentially represent the boundary conditions for the integration of the differential equations governing the y-dependence of Ψ WZ (y; x, z). One may recover Z WZ (x, z) from the family of Ψ WZ (y; x, z) by taking suitable limits. The presence of extra degenerate fields modifies the KZ-equations as where t a s denote the matrices representing sl 2 on the s-th tensor factor of (C 2 ) ⊗m , and J a r are the differential operators introduced in (B.3). In addition we get the following m differential equations: The space of solutions to the equations (D.7) is determined by the space of conformal blocks without extra degenerate fields m = 0. This follows from the fact that one may regard the partition function Z WZ (x, z) as initial values for the solution of (D.7). One may, on the other hand, recover the partition functions Z WZ (x, z) by considering even m and taking a limit where the insertion points y s collide pairwise.

Liouville theory
The situation is similar in the case of Liouville theory. In the presence of m degenerate fields of weight − 1 2 − 3 4 b −2 and l degenerate fields of weight − 1 2 − 3 4 b 2 the chiral partition functions will satisfy l BPZ equations (D.9a) We shall consider the Liouville conformal blocks Z L (y; u, z) ≡ (D.8) The conformal blocks (D.8) satisfy the null vector decoupling equations Equations (D.9) imply the fusion rules We will next discuss the behavior of the solutions to the null vector decoupling equations in the limit 1 → 0.

WZW-model
In order to study the limit 1 → 0 it is useful to multiply (D.7) by 1 and (D.6) by 2 1 . One may solve the system of equation (D.6) and (D.7) with the following ansatz, which will yield a solution to (D.7) provided ψ(y; x, z) and Y WZ (x, z) satisfy the following system of equations: We recognize model (B) for the flat connections. The limit of (D.6) yields in addition These equations characterize the Hamiltonians of the Schlesinger system. We have thereby reproduced results of [67,68].

Liouville theory
In order to study the limit 1 → 0 it is useful to multiply (D.9b) and (D.9a) by 1 2 . One may solve the system of equation (D.9a) and (D.9b) with the following ansatz, which will yield a solution (D.9b) provided ψ L (y; u, z) and Y L (u, z) satisfy the following system of equations: The equations (D.9a) yield in addition These equations define the Hamiltonians of the Garnier system.

D.3 Verlinde loop operators
The dependence of the chiral partition function on the variables a is controlled by the Verlinde loop operators. They are defined by modifying a conformal block by inserting the vacuum representation in the form of a pair of degenerate fields, calculating the monodromy of one of them along a closed curve γ on C, and projecting back to the vacuum representation, see [9,69] for more details. A generating set is identified using pants decompositions. The calculation of the Verlinde loop operators is almost a straightforward extension of what has been done in the literature. The necessary results have been obtained in [9,69] for Liouville theory without extra insertions of degenerate fields V −b/2 (y). It would be straightforward to generalize these observations to the cases of our interest. For the case of Kac-Moody conformal blocks one could assemble the results from the known fusion and braiding matrices of an extra degenerate field Φ 1 2 (w, y). As a shortcut let us note, however, that the results relevant for the problem of our interest, the limit 1 → 0, can be obtained in a simpler way.
One may start on the Liouville side. The key observation to be made is the fact that the presence of extra degenerate fields V −1/2b (y) modifies the monodromies of V −b/2 (y) only by overall signs, as the monodromy of V −b/2 (y) around V −1/2b (u k ) is equal to minus the identity. It is useful to observe (see Appendix E.4) that the separation of variables transformation maps the degenerate field Φ 1 2 (w, y) to the degenerate field V −b/2 (y). It follows that the monodromies of Φ 1 2 (w, y) must coincide with the monodromies of V −b/2 (y) up to signs. Using the results of [9,69] we conclude that (π V (γ e,s )Z WZ )(a, u, z) = ν e,s L e,s · Z WZ (a, u, z) , (π V (γ e,t )Z WZ )(a, u, z) = ν e,t L e,t · Z WZ (a, u, z) , (D. 17) where ν e,s ∈ {±1} and ν e,r ∈ {±1}, while the explicit expressions for the difference operators L e,s , L e,t are L e,s = 2 cosh(2πa e / 2 ) . (D.18a) L e,t = 2 cos(π 1 / 2 )(L e,2 L e,3 + L e,1 L e,4 ) + L e,s (L e,1 L e,3 + L e,2 L e,4 ) 2 sinh 2π 2 (a e + i 2 1 ) 2 sinh 2π 2 (a e − i 2 1 ) (D.18b) + ξ=±1 1 2 sinh(2πa e / 2 ) e πξke/ 2 c 12 (L r,s )c 34 (L r,s ) 2 sinh(2πa e / 2 ) e πξke/ 2 1 2 sinh(2πa e / 2 ) , using the notation c ij (L e,s ) = L 2 e,s + L 2 e,i + L 2 e,j + L e,s L e,i L e,j − 4, and k e = As the KZB-equations (D.7) turn into the horizontality condition (D.13a), the Verlinde loop operators will turn into trace functions when 1 → 0. The limit of the left hand side of (D.17) is therefore found by replacing π V (γ e,s ) and π V (γ e,t ) with the expressions in (C.15), calculated from the connection A(y) appearing in (D.13a). Note that the connection A(y) is thereby defined as a function of the parameters x and a. The limit 1 → 0 of the right hand side of (D.17) is straightforward to analyze by using (D.3) and (D.18). It can be expressed in terms of the derivative of Y WZ with respect to the variable a. In this way one finds that the the limit 1  It remains to discuss the behavior in the limit 2 → 0 of Y WZ (a, x, z; 2 ) and Y L (a, u, z; 2 ). We claim that in the two cases we find a behavior of the form Y WZ (a, x, z) ∼ Following the discussion in Appendix C.4 we may identify W L (a, u; z) as the generating function of the standard change of Darboux variables (u, v) ↔ (a, t) which is defined by the Abel map. The corresponding statement for W WZ (a, x; z) now follows easily from (D.13c), and the fact that Y WZ (a, x, z) and Y L (a, u, z) differ only by the generating function Y SOV (x; u, z) for the change of Darboux variables (x, p) ↔ (u, v) which does not depend on a.

E. Explicit relation between Kac-Moody and Virasoro conformal blocks
We will explain in this appendix how to obtain an explicit integral transformation between the conformal blocks in Liouville theory and in the WZW model using the observations made in Section 4.7. This is the separation of variables (SOV) relation (1.1) which we discussed in the Introduction.

(E.2)
The function Θ n (y, z) that appears in this relation is defined as The relation (E.2) will hold provided that the respective variables are related as follows: (1) The variables µ 1 , . . . , µ n−1 are related to u 1 , . . . , u n−3 , u 0 via .

E.2 Reformulation as integral transformation
We want to write the expression forŽ WZ (x, z) Z WZ (x, z) = dµ 1 µ 1 . . . dµ n−1 µ n−1 δ n−1 r=1 µ r Θ n (u, x) Z L (u, z) Note that the x-dependence it entirely in the first factor on the right hand side of (E.12). The choice of contours in (E.11) is a delicate issue that we will not address here. Using the standard contour R in the definition of the Fourier-transformations in (E.6) will of course determine a particular choice of contours in (E.11). Any choice of contours that ensures absence of boundary terms in the relation between the differential equations satisfied by Z WZ (x, z) and Z L (u, z) could also be taken to define a relation of the form (E.11) between bases of conformal blocks in the WZW-model and in Liouville theory. Changing the contours in (E.11) amounts to a change of basis in the space of solutions to the KZ-equations obtained from a fixed basis in the space of Liouville conformal blocks. It would be interesting to identify the basis defined by (E.11) for a given choice of contours precisely, and to investigate the dependence on the choice of contours.

E.4 SOV transformation in the presence of degenerate fields
We also use the version of this correspondence in the presence of the fields Φ 1 2 (w|y), as appear in (D.4). This is kind of interesting. Note that the Fourier-transformation of the null vector equations ∂ 2 w Φ 1 2 (w|y) = 0 gives µ 2 Φ 1 2 (µ|y) = 0. This indicates that conformal blocks containing Φ 1 2 (µ|y) must be understood as distributions with support at µ = 0. If we send µ r → 0 in the change of variables (E.4), we will loose the pole at t = z r on the left hand side. This means that one u k must approach z r in order to cancel the pole at t = z r on the right hand side of (E.4). It follows that the degenerate field e −b −1 φ(u k ) fuses with the field e 2αrφ(zr) . Applying these observations to the case where j r = 1/2, which corresponds to α r = 1 2 Q + b we get as leading term in the OPE of e −b −1 φ(u k ) e 2αrφ(zr) a field with conformal dimension ∆ −b/2 , which is degenerate. This indicates that the WZW conformal blocks (D.4) can be represented in terms of the Liouville conformal blocks (D.8) with l = n − 3, where the insertion of a field Φ 1 2 (w s |y s ) corresponds to the insertion of e −bφ(ys) . Even if the argument above may look delicate, the conclusion seems hard to avoid: We need to map the field Φ 1 2 (w|y) to another field with two-dimensional monodromy. The only candidate with the right behavior for b → 0 is e −bφ(ys) .