Extended actions, dynamics of edge modes, and entanglement entropy

In this work we propose a simple and systematic framework for including edge modes in gauge theories on manifolds with boundaries. We argue that this is necessary in order to achieve the factorizability of the path integral, the Hilbert space and the phase space, and that it explains how edge modes acquire a boundary dynamics and can contribute to observables such as the entanglement entropy. Our construction starts with a boundary action containing edge modes. In the case of Maxwell theory for example this is equivalent to coupling the gauge field to boundary sources in order to be able to factorize the theory between subregions. We then introduce a new variational principle which produces a systematic boundary contribution to the symplectic structure, and thereby provides a covariant realization of the extended phase space constructions which have appeared previously in the literature. When considering the path integral for the extended bulk + boundary action, integrating out the bulk degrees of freedom with chosen boundary conditions produces a residual boundary dynamics for the edge modes, in agreement with recent observations concerning the contribution of edge modes to the entanglement entropy. We put our proposal to the test with the familiar examples of Chern-Simons and BF theory, and show that it leads to consistent results. This therefore leads us to conjecture that this mechanism is generically true for any gauge theory, which can therefore all be expected to posses a boundary dynamics. We expect to be able to eventually apply this formalism to gravitational theories.


Motivations
Gauge theories defined on manifolds with boundaries, be they asymptotic or at finite distance, exhibit emergent boundary degrees of freedom, sometimes referred to as edge modes. This wellestablished fact has been investigated in depth mostly for theories with no propagating bulk degrees of freedom, such as 3-dimensional gravity and Chern-Simons theory, where the edge modes posses an explicit boundary dynamics and encode physical properties of e.g. black holes [1][2][3] or condensed matter systems [4][5][6]. There is however no doubt that edge modes also encode non-trivial physics in theories with local degrees of freedom, such as e.g. 4-dimensional gravity and electromagnetism, although in this context no systematic investigation of the nature of the edge modes and of their boundary dynamics has been carried out, and the literature remains scarce (relevant references will be cited below). This stems from the obvious difficulties and subtleties in identifying the edge modes, and in disentangling their dynamics from that of the bulk degrees of freedom.
Recently, many new results revealing important insights into the role of edge modes have been obtained, both at finite distance and at infinity. At finite distance, there have been successful definitions of quasi-local holography through the path integral for quantum gravity [7][8][9][10][11][12], leading to boundary models which can be thought of as capturing the dynamics of the edge modes. There have also been efforts to characterize, for local subsystems, the most general boundary symmetry algebras spanned by the edge modes [13][14][15][16][17][18][19][20], with potentially important consequences for quantum gravity [21,22]. Another important development at finite distance has been the realization that a proper treatment of the edge modes is crucial even when dealing with fictitious entangling interfaces, which has consequences in the computations of entanglement entropy [23][24][25][26][27][28][29][30][31][32]. At infinity on the other hand, a lot of work has been dedicated towards understanding the intricate infrared properties of theories with massless excitations, and there a central role is played by large gauge transformations and soft modes [33]. While the connection between all these aspects is far from being understood 1 , a unifying thread is that of having degrees of freedom supported on the boundary. Therefore, a natural question to ask is whether these edge modes can be unequivocally identified, and whether there exists a framework for studying their dynamics. In this note we would like to take a step in this direction, and show that there is a unified treatment of the boundary dynamics of edge modes which furthermore sheds light on their contribution to the entanglement entropy. This agrees in particular with the proposal recently put forward in [35,36], and frames it in a slightly more general setup.
To understand how this construction comes about, let us first explain how the edge modes can be understood as arising from an extension of a given gauge theory. On a spatial hypersurface, the physical phase space and Hilbert space of a gauge theory both fail to be factorizable due to the presence of the gauge constraints 2 and the resulting inherent non-locality of gauge-invariant 1 For example, there is no clear understanding of the relationship between the edge modes at finite distance and the soft modes at infinity, appart possibly from [31,34]. 2 In the case of a continuum scalar field the factorization does actually already fail due to the requirement of observables. Aside from being a conceptual issue for the definition of local subsystems [14], this also represents an a priori technical obstruction to computing quantities such as the entanglement entropy of gauge fields across a fictitious interface between two regions [32]. This difficulty can however be bypassed by resorting to a so-called extended Hilbert space. The idea of this construction is that H Σ∪Σ can be factorized into factors attached to Σ andΣ provided that we extend these by attaching edge modes living on S = ∂Σ = ∂Σ and transforming under the action of a boundary symmetry group G S . Denoting the resulting extended Hilbert space by H Σ,S , one can then realize the total Hilbert space as a subspace H Σ∪Σ ⊂ H Σ,S ⊗ HΣ ,S , where the factorized right-hand side allows for the definition of a reduced density matrix. The total physical Hilbert space of gauge-invariant states is then recovered as H Σ∪Σ = H Σ,S ⊗ G S HΣ ,S , where ⊗ G S denotes an entangling product which identifies and gets "rid of" the extra boundary degrees of freedom. This construction has proven very useful in computations of entanglement entropy in lattice gauge theory [23-26, 32, 38, 39], and in the case of Chern-Simons theory can also be made precise in the continuum [40,41]. In [42] it has also been shown that the extended Hilbert space of 2-dimensional Yang-Mills theory naturally relates to the structure of an extended TQFT. Our description of the boundary dynamics of edge modes will take as its starting point the extended phase space, which is the classical counterpart of the extended Hilbert space, and which we will introduce in section 2.
Although the edge modes enabling for the definition of an extended Hilbert space may seem to be purely auxiliary and non-physical, they do actually contribute to the entanglement entropy. The computation of this latter being a notoriously subtle issue, a more precise statement is that there exist many ways of computing entanglement entropy (giving the same result but using different technical routes and tools, see e.g. [32]), with only some of these making manifest the role of the edge modes. In lattice gauge theory, the contribution of the edge modes of the extended Hilbert space to the entanglement entropy was noted in [24,38]. In Abelian Chern-Simons theory, the entanglement entropy (say for two spatial disc-like regions glued along a circle) has a universal and cut-off independent contribution which can be traced back to (the zero modes of) the edge modes [40,41,[43][44][45][46]. This is the so-called topological entanglement entropy [47,48], which is an important physical quantity since it can serve as an order parameter for topological phases. Similarly, the entanglement entropy of Maxwell fields has a contribution sometimes referred to as the Kabat contact term [49][50][51], which can be traced back to the contribution of edge modes in the form of normal electric field configurations [26][27][28][29][30].
The following question naturally arises: Given a gauge theory, what are the Lagrangian and Hamiltonian descriptions of the edge modes which contribute to the entanglement entropy and constitute the boundary dynamics? In other words, what is the action and the symplectic structure for the edge modes, and which freedom is there in their construction? Our proposal for answering this will be guided by the example of Chern-Simons theory, for which the dynamics of the edge continuity of the field across the entangling cut [37], but this is usually bypassed by resorting to a cutoff (or a lattice regularization). In the case of gauge theories, even the lattice construction fails because of the gauge constraints. modes and their contribution to the entanglement entropy is known. This will show that, as far as edge modes are concerned, generic gauge theories are not different from Chern-Simons theory in the sense that they do all posses a non-trivial boundary dynamics 3 . We will present here a framework for studying this dynamics, and give some preliminary examples of the subtleties and differences which arise for different gauge theories (e.g. depending on boundary conditions and Hamiltonians, and on whether the theory is topological or not). Briefly speaking, the symplectic structure of the edge modes will come from the above-mentioned extended phase space, which can be constructed in a systematic manner as a gauge-invariant boundary extension of the bulk phase space of a theory.
To study the dynamics of the edge modes, we will propose a new action principle which includes the edge modes in a boundary Lagrangian and then naturally reproduces the extended phase space and its symplectic structure. Then, we will explain how integrating out the bulk degrees of freedom in a subregion produces an effective boundary action which will contribute to the entanglement entropy.
Our construction is summarized schematically on figure 1. Consider two spacetime manifolds M andM with respective time-like boundaries ∂M and ∂M . A gauge theory on each manifold is defined by bulk fields, but also by boundary degrees of freedom. These edge modes are introduced via a boundary Lagrangian, which couples in a gauge-invariant manner the bulk gauge fields and the edge modes to a boundary current (which can be thought of as the edge mode's conjugate momentum). The presence of these edge modes is precisely what allows for the splitting of the path integral over M ∪M into two factors. This is the covariant analogue of the factorization in terms of extended Hilbert spaces, and it requires to relax the boundary conditions and to allow for open Wilson lines to end on the boundary. In a path integral context, one can then manipulate the factorized path integrals over M andM in two ways: i) integrating out the edge modes living on ∂M and ∂M (with suitable matching constraints) will glue the theories defined on the subregions and lead to the path integral over M ∪M , while ii) integrating out the bulk fields of regionM will produce an effective boundary theory on ∂M . This second point is very important. It means that integrating out the bulk degrees of freedom inM , when taking properly into account the presence of the edge modes on the boundary ∂M = ∂M , does not reproduce the path integral defined on M only: there is a residual contribution on the boundary due to the dynamics of the edge modes, and this will contribute in particular to the entanglement entropy.
One can clearly see the fundamental role played by the edge modes in this construction: they appear once we split a theory (i.e. its Hilbert space, phase space, or path integral), dictate how regions should be glued along an interface, and encode a leftover boundary dynamics once one of the bulk regions is integrated out. There is yet another elegant argument, due to Carlip [52], which justifies and highlights the role of these edge modes. Consider a theory defined on the total manifold M ∪M, and whose path integral Z can be computed to find a functional determinant. By defining the theory separately on the subregions, where one can compute Z M and ZM , it is however : On the top, we have a same gauge theory defined on two neighboring manifolds with boundaries. Each factor contains bulk fields and edge modes. Integrating out the edge modes leads to the theory defined over M ∪M and, conversely, the splitting of M ∪M into subregions requires to introduce edge modes on which Wilson lines can end. Once the theory is split into factors associated with the regions M andM , one bulk region can be integrated out, thereby leading to an effective boundary dynamics for the edge modes. This latter will in turn be seen by and contribute to the entanglement entropy.
not possible to reconstruct the total Z by simply multiplying the results for the subregions. This is because the functional determinants do not factorize, but instead satisfy a relation of the form Z = K Z M ZM , sometimes referred to as the Forman-Burghelea-Friedlander-Kappeler (FBFK) gluing formula [53][54][55][56]. Although this argument was initially formulated for a scalar field theory 4 , where the factor K is related to the so-called Poisson kernel of the Laplacian, it is clear that a similar relation should hold for gauge theories as well (although the determinants might be complicated to evaluate). This was made explicit in [29] in the case of 3-dimensional Maxwell theory (which is actually dual to a scalar field), where it was indeed shown that the boundary contributions obtained after integrating over the bulk of the subregions are necessary in order to reproduce the FBFK gluing 4 Our interpretation therefore suggests that even the scalar field has "scalar edge modes". Interestingly, such scalar edge modes have been identified at null infinity through the soft theorem / asymptotic symmetry correspondence of Strominger's infrared triangle [57], and can be given a gauge theory interpretation in terms of the dual 2-form theory [58,59].
formula once the two regions are glued back together. This has led the authors to identify the gluing factor K as the Kabat contact contribution to the entanglement entropy. However this was done without explicitly introducing edge modes, but instead via a Green decomposition of the gauge field and its momentum between their bulk and boundary parts. The authors of [35] have presented a more systematic and dimension-independent study of the boundary dynamics of Maxwell-Yang-Mills theory, and also argued that the boundary contribution obtained after going on-shell in the bulk is the Kabat contact term seen by the entanglement entropy. Here we will present a framework confirming the generality of these results and applicable to any gauge theory, and show explicitly how it provides a covariant realization of the extended Hilbert space (or phase space) construction. For this, we will first recall in section 2 how the edge modes can conveniently be parametrized in a Hamiltonian setting by using an extended phase space containing a boundary symplectic structure, then construct in section 3 compatible boundary actions, and finally present in section 4 examples and applications. Section 5 will describe prospects for future work. Some of our notations concerning the covariant phase space are gathered in appendix A, and subsequent appendices contain various details of calculations. We will always refer to Chern-Simons and Maxwell-Chern-Simons theory respectively as CS and MCS theory.

Extended phase spaces
For a given gauge theory, the extended phase space is the classical analogue of the above-mentioned extended Hilbert space. The extension consists in adding to the bulk phase space, for each type of gauge transformations in the theory, a corresponding edge mode field (which is nothing but a Stueckelberg field) living on the boundary. This idea was introduced and implemented in [14] for Yang-Mills theory and metric gravity, in [16] for non-Abelian BF and CS theories, in [17] for higher curvature gravity, in [18] for 3-dimensional gravity in first order connection-triad variables, in [60] for open string field theory, and in [61] for Einstein-Maxwell theory. It has also been used in [20] to describe magnetic charges and electromagnetic duality.
The construction of the extended phase space takes place in the covariant Hamiltonian formalism, and exploits a well-known corner (i.e. co-dimension 2) ambiguity [62,63], which is that of supplementing the (pre-symplectic) potential θ by a total exterior derivative dϑ. By adding edge mode fields living on the boundary S = ∂Σ of spatial hypersurfaces and transforming in a particular way under gauge transformations 5 (we will provide examples below), one can construct in a minimal way an extended potential θ e = θ + dϑ such that the associated symplectic structure disentangles in a natural manner the role of gauge transformations from that of boundary symmetries. This extended symplectic structure is indeed such that gauge transformations are generated by constraints which vanish on-shell and have no Hamiltonian charge, while boundary symmetries are generated by surface observables which satisfy a boundary symmetry algebra, and this without the need to impose boundary conditions on the dynamical fields or on the parameters of gauge or symmetry transformations 6 . The role of the edge mode fields appearing with their canonical momenta in the boundary symplectic structure is two-fold: i) to restore the seemingly broken gauge-invariance due to the presence of the boundary, ii) to parametrize the boundary symmetries and observables. Representing a gauge transformation by a tangent vector δ α in field space, one has in other words that the field space contraction 7 δ α Ω is integrable and vanishing on-shell. This is nothing but the familiar Hamiltonian generator of the transformation δ α , which is however stripped from its usual boundary charge because this latter has been cancelled by the contribution of the boundary symplectic structure containing the edge modes. This is a first advantage of the extended phase space: gauge transformations are null directions of the extended symplectic structure even when they have support on the boundary. Similarly, a boundary symmetry can be represented by a tangent vector ∆ α , and is characterized by a generator ∆ α Ω which is integrable, gauge-invariant in the sense that δ α ∆ β Ω = 0, equal to a boundary integral, and satisfies a boundary symmetry algebra ∆ α ∆ β Ω.
It has been shown in [16,18] that the generators of such boundary symmetries ∆ α are the usual Hamiltonian boundary observables introduced in [64][65][66][67][68][69], in which however the bulk fields are "dressed" in a gauge-invariant manner by the new edge mode fields which have been introduced on the boundary. This is a second advantage of the extended phase space: the edge modes which have been added through the boundary symplectic structure are now part of the phase space and parametrize the boundary observables and their symmetry algebra. While this description may seem formal at this point, we will provide explicit examples in section 4.
The natural next step is to search for a dynamical description of these edge modes, and to conceive them not as living only on the boundary S of a spatial slice, but on the whole time-like boundary S × R. This is a familiar situation in CS theory, where the time-like boundary is known to carry a gapless chiral theory [70][71][72]. However, the construction of the boundary dynamics in CS theory typically relies on studying the behavior under gauge transformations of the action itself. This explains the difference of treatment which has subsisted so far between e.g. Maxwell-Yang-Mills and CS theory: the former has a gauge-invariant action while the latter does not. From this, one would (wrongly) conclude that Maxwell-Yang-Mills theory does not posses a boundary dynamics. However, as we have argued above, the study of gauge (non)-invariance should instead be carried out at the level of the symplectic structure. There, one can easily motivate the need to 6 One can of course construct directly the extended symplectic structure which satisfies these desired properties.
However, following [14,16], it actually turns out to be easier and more systematic to derive this by considering finite and field-dependent gauge transformations of the potential. 7 See appendix A for our notations and conventions concerning the covariant phase space.
work with an extended phase space containing edge mode fields. Let us now describe how their boundary symplectic structure can be obtained from a boundary action.

Extended actions
Let us consider for simplicity that the d-dimensional spacetime manifold is of the form M = Σ × R, where the time-like boundary is ∂M = S × R. The extended symplectic structure described above can be thought of as arising from a 0-1-extended field theory, where the co-dimension 0 (i.e. bulk) and co-dimensional 1 (i.e. boundary) submanifolds each posses a Lagrangian, equations of motion, and a (pre-symplectic) potential. In order to see this, let us write the extended action and its variation in the form This is of course a familiar step in field theory and in the covariant phase space formalism, where it identifies the potential θ as the total exterior derivative term arising from the integrations by parts isolating the bulk equations of motion. In usual constructions of the covariant phase space [62,73,74], the introduction of a boundary Lagrangian L ∂M is simply understood as resulting in a shift θ → θ + δL ∂M of the potential. The boundary conditions defining the variational principle are then taken to be (θ +δL ∂M ) ∂M ! = 0, and one concludes that the boundary Lagrangian cannot affect the symplectic structure since upon taking a second variation to obtain the symplectic current one has δθ → δθ + δ 2 L ∂M = δθ by virtue of the property δ 2 = 0.
However, this viewpoint turns out to be unnecessarily restrictive, and one can be more general by realizing that this ambiguity in the boundary term fits perfectly well with the above-mentioned corner ambiguity. In other words, there is a natural way in which the boundary Lagrangian may provide a corner term. This is what was done already in [18] with the Gibbons-Hawking-York boundary term 8 (see also [75]), and what we will now explain in full generality. Coincidentally, while the present article was being written, along with an application of the formalism to 4-dimensional first order gravity [76], Harlow and Wu have constructed in [77] a version of the covariant phase space formalism which precisely describes and formalises the step we are going to take 9 . The idea is simply to realize that acceptable boundary conditions can be more generally taken to be 10 Although the result is unfortunately hidden in appendix B. 9 An important difference is that Harlow and Wu are not concerned with edge modes and extended phase spaces.
They describe how a boundary Lagrangian can provide a corner term and discuss at length the example (among others) of Einstein-Hilbert gravity with the Gibbons-Hawking-York term, but do not consider Lagrangians which include edge mode fields. Appart from this conceptual difference, our constructions are the same. 10 We allow ourselves to change the sign convention for c with respect to [77] in order to match the definition of the extended symplectic structure given above.
Interestingly, this fits nicely with our desire to encode the dynamics of the edge mode fields in the boundary Lagrangian. Indeed, if this latter contains derivatives, upon taking a field space variation one can then integrate by parts to isolate boundary equations of motion and a boundary pre-symplectic potential. We can then suggestively rewrite the variation of the action in (3.1) as where on the boundary we have now explicitly combined the potential θ of L M with part of the variations of L ∂M to get the boundary equations of motion, and also kept the total exterior derivative containing the potential c of L ∂M . In this picture, the boundary conditions (3.2) are just rewritten as the requirement that EOM ∂M ! = 0. As we will see in explicit examples below, this requirement will generally translate into several conditions, which can be fulfilled either by fixing some variables on ∂M (e.g. Dirichlet boundary conditions in gravity), or by imposing boundary equations of motion.
As explained in [77], the correct potential to consider for the construction of a conserved symplectic structure is then θ + dc, and therefore naturally includes a corner contribution. In our more general setup, where the boundary Lagrangian may contain edge mode fields, we will see that the correct extended symplectic potential θ e = θ + dϑ will be obtained once we explicitly rewrite θ + dc on-shell of (some of) the boundary equations of motion which identify c ≈ ϑ. This is of course fine since in any case the covariant phase space formalism is on-shell, and since going on-shell of the boundary equations of motion is simply enforcing part of the boundary conditions (3.2) defining the variational principle. More precisely, we will see that in the whole set EOM ∂M we will have to explicitly use the boundary equations of motion involving the initial potential θ. This is a desired feature, since it means that instead of holding fixed a field configuration on the boundary (e.g. the gauge potential of Maxwell theory), we are relaxing this condition by imposing the conjugated boundary equations of motion instead. Once again, this should become crystal clear in the following section where we present concrete examples.
In summary, in order to achieve our construction relating the boundary Lagrangian L ∂M (which is the object we are trying to identify) to the extended symplectic structure (2.1) defining the extended phase space (which is the object we already know from the various constructions [14, 16-18, 60, 61]), we simply have to look for a boundary Lagrangian whose potential c is such that the extended potential is obtained as (3.4) Our formalism and that of [77] guarantee that this is possible, and we will give illustrative examples in the next section. A few comments are now in order before going on. i) In this construction the boundary Lagrangian is more than a mere boundary term: it contains derivatives, and therefore a potential, which is then combined with the bulk potential in order to get the extended symplectic structure. As we have argued, this falls outside of the usual covariant Hamiltonian formalism of e.g. [62,73,74], and fixes unambiguously the corner contribution c. Furthermore, adding edge modes into the boundary Lagrangian achieves more than a simple change of polarization: it allows to completely relax the boundary conditions by replacing them with boundary equations of motion.
ii) One can be puzzled by the apparent sign mismatch between the boundary potential in (3.3) and its contribution to the extended potential in (3.4). This follows of course from the compatibility of the symplectic current (more precisely the conservation of the symplectic structure) with the boundary conditions (3.2). A more heuristic way to understand this is to remember that we are trying to match the corner terms constructed in [14, 16-18, 60, 61] by reaching the corner from the space-like hypersurface Σ, to the corner terms inherited from the boundary Lagrangian, and which therefore reach the corner from the time-like boundary ∂M . One can therefore understand the sign difference as coming from the sign of the bi-normal to the co-dimension 2 corner S, which depends on whether the corner is reached from a space-like slice or from a time-like boundary.
iii) We will see on the examples below that the boundary equations of motion which are used to write c ≈ ϑ are, in the language of [14], gluing constraints which determine the extended phase space by soldering together, via a classical fusion product, the boundary symplectic structure to the bulk one. The boundary Lagrangian L ∂M contains initially the edge mode fields and their unspecified conjugate momenta, and the boundary condition obtained through the boundary equation of motion involving θ identifies these momenta with part of the initial bulk fields.
iv) The minimal requirement which we have imposed so far on the boundary Lagrangian does only specify the symplectic structure for the edge mode fields, and not their dynamics. In order to access this later, we will have to resort to an on-shell evaluation of the bulk action, thereby leading to an effective boundary action. We are also free to add to the boundary Lagrangian terms which do not change the symplectic structure and which are compatible with gauge-invariance. Such terms are in fact boundary Hamiltonians, i.e. they affect the boundary conditions (or equations of motion), but not the symplectic structure. The details of this procedure will depend on the theory under consideration, so let us now finally discuss some examples.

Examples
We now present some relevant examples of extended bulk + boundary actions. This will illustrate in particular formulas (3.3) and (3.4), and reproduce the extended symplectic structures which have been studied before in the literature. It will also enable us to identify and discuss some remaining ambiguities in the characterization of the boundary dynamics, and to give more details on the factorization and the gluing of path integrals. We will also be able to establish a connection with previous results on the edge mode contributions to the entanglement entropy in various theories. We focus here on Abelian theories, and the discussion of the extended actions and phase spaces for non-Abelian theories is deferred to appendix F.

Chern-Simons theory
Let us focus on the Abelian case for simplicity, and describe in details all the steps of the calculations. As usual, the theory is defined in the bulk by a connection 1-form A, transforming under gauge transformations as δ α A = dα, and with curvature F = dA. On the boundary, we now add a 0-form a transforming as δ α a = −α, and a gauge-invariant 1-form j. With this field content, we can then form the action where the Abelian covariant derivative is Da := da + A, where * is the Hodge dual on the boundary, and where we have dropped for clarity the usual coupling constant k/(4π). The first term on the boundary, which is not gauge-invariant by itself, compensates for the gauge non-invariance of the bulk term, and the full action is therefore gauge-invariant. The presence of the last term, which requires to use the metric and therefore breaks the topological invariance of the theory, will be explained momentarily. This term is a boundary Hamiltonian h[j], whose choice does not affect the boundary symplectic structure, but does change the boundary dynamics.

Extended phase space
Following the discussion of the previous section, let us now see what the introduction of the two fields a and j via the boundary Lagrangian implies. The variation of the action can be written in the form (3.1) as where one can see that the potential coming from the bulk is θ = δA ∧ A. Writing explicitly the variation of the boundary action now leads to the form of expression (3.3), which is where on the boundary the first three terms identify the boundary equations of motion, and the last term identifies the boundary potential c. To access the bulk equations of motion, we need to impose the vanishing of the first term on the boundary. Conveniently, this can be done by imposing the boundary equation of motion j = Da instead of fixing the variation δA of the gauge potential to be vanishing. This boundary equation of motion is precisely the one involving the potential θ coming from the bulk Lagrangian. With this, the extended potential (3.4) becomes where we have been careful about the sign when including the boundary potential as our corner term, and then in the last equality used the boundary equation of motion involving θ. This result is interesting, as it reproduces precisely the extended potential which was derived in [16] for Abelian CS theory, thereby proving that the extended phase space structure can be recovered from the boundary Lagrangian introduced in (4.1) and the construction outlined in the previous section.
With this extended potential we have all the desirable properties mentioned in section 2. In particular, the extended symplectic structure (2.1) is given by and is such that for gauge transformations the generator defined by δ α Ω is integrable and vanishing on-shell. Indeed, this is The transformation δ α is therefore a true gauge transformation, even when it has support on the boundary, and as such it has no Hamiltonian charge. In addition, the transformation acting as ∆ α A = 0 and ∆ α a = α, which we will now call boundary symmetry as opposed to gauge transformation, has an integrable generator given by the manifestly gauge-invariant boundary integral and these generators satisfy the Abelian Kač-Moody commutation relation As is well-known, these are the boundary symmetries of CS theory on a spatial disc. One can see, as explained above, that their generator is a gauge-invariant "dressed" version of the usual Hamiltonian charge of δ α , where the dressing corresponds to the finite gauge transformation of A by the edge mode field a.

Boundary dynamics
The Kač-Moody commutation relations which we have derived on the extended phase space result from the presence of a chiral scalar field, which is evidently the edge mode field a. To access the dynamics of this scalar field, we will write and manipulate the path integral for the extended action (4.1), following [71]. The key point of this derivation is to expand the components of the gauge field in the action and to carefully perform the path integral. For this, we assume that the spacetime has the topology M = R × D of a cylinder, with coordinates x µ = (t, r, φ) such that ε trφ = 1 and φ is compact, and that the space-like normal to the boundary cylinder at finite radius r is s = (0, 1, 0).

The Hodge dual is then such that
After integrations by parts in the bulk, the total action (4.1) can be written explicitly as It is then clear that A t plays the role of a Lagrange multiplier. Path integrating 11 over A t imposes the bulk and boundary relations which are part of the equations of motion imposed by δA (i.e. the bulk equation of motion and the corresponding boundary condition). The first constraint can be solved by writing With this, after integrations by parts the bulk piece of the action becomes a boundary term, as and (4.9) reduces to the boundary action where we have introduced the gauge-invariant scalar combination ϕ := a + α. We recognize as the first term the canonical term of a chiral field. This is to be expected since so far the current j has in a sense played no role, and we have reproduced the classic calculation of [71] (where the authors obtain instead the boundary theory ∂ t α∂ φ α − A t ∂ φ α, since neither a not j have been introduced there). In [71], one then uses the boundary conditions A t ∝ A φ = ∂ φ α in order to get a Hamiltonian for the chiral field. In our setup however, the last step is to perform the Gaussian integral over the current j t to finally obtain the effective action which is known as the Floreanini-Jackiw action. Its equations of motion are that of a chiral field, i.e. ∂ t ϕ = ±∂ φ ϕ. This is the boundary dynamics of Abelian CS theory, and we have recovered it from the on-shell evaluation of the path integral for the extended bulk + boundary action (4.1). The authors of [35,36] have also presented a derivation of the edge mode dynamics of CS theory, but we believe that our presentation follows more closely the original construction presented in [35] 11 As the details do not matter for our purposes so far, we will not explicitly write the path integrals and the various pre-factors coming from the integrations, but simply the resulting effective actions.
for Maxwell theory. Moreover, we have shown explicitly the link between the extended action and the extended phase space. The last step of the above calculation makes clear the role of the quadratic j term introduced in (4.1). Without this term, the construction of the extended potential (4.4) would have of course gone through, but the derivation of the boundary dynamics would not have provided a desirable Hamiltonian for the chiral field after (4.13). This shows, as announced above, that the last term in (4.1) plays the role of a Hamiltonian: it does not affect the extended symplectic structure, but it changes the boundary dynamics. In this simple example of Abelian U(1) CS theory, this change of dynamics is equivalent to changing the velocity of the chiral bosons. It would be interesting to study richer Abelian theories, such as U(1) N , which admit topological boundary conditions [78] and gluing along heterointerfaces [40], and eventually the non-Abelian case and the classification of all possible boundary theories 12 .
As a subtlety, one can observe in (4.3) that the two boundary equations of motion obtained by varying A, j, when combined, simply imply that Da = ± * Da, meaning that a is a gauged chiral field. This is essentially the same equation of motion as that derived from the effective boundary action (4.14). From this, one could conclude that the boundary dynamics is in a sense already encoded in the initial bulk + boundary action (4.1). This is however just a coincidence due to our choice of boundary Hamiltonian. Indeed, if we choose instead h = (j t ∓ j φ )j φ , it is easy to see that replacing the last two terms in (4.13) by j t ∂ φ ϕ ∓ (∂ φ ϕ) 2 and then path integrating over j t leads once again to (4.14), while, however, the boundary equations of motion give D t a = (±2 − 1)D φ a. This last equation is once again that of a chiral field, but now the two chiralities have a different velocity. This is a known fact in CS theory and condensed matter, namely that the velocity is an external input which can be tuned by changing the Hamiltonian [6]. However, this example illustrates clearly the fact that there is a slight quantitative difference between the boundary equations of motion derived from the bulk + boundary action (4.1) and that derived from the on-shell evaluation of the action. For topological theories, these two views on the boundary dynamics are in a sense equivalent (at least qualitatively, as we have just seen), since on-shell bulk configurations are simply gauge transformations. For non-topological theories however, the on-shell evaluation of the action is crucial since it imprints on the boundary a left-over dynamics from the bulk (which is not just a gauge transformation). We will see with the example of Maxwell theory that the derivation of the boundary dynamics requires an on-shell evaluation of the action, and cannot be read off the initial extended action alone.
Finally, as a curiosity, and in order to make contact with previous literature on the subject, one can insert the boundary equation of motion j = Da back into the action to obtain The extended phase space of non-Abelian CS theory is derived form the extended action in appendix F.
which we recognize as the action for CS theory coupled to a gauged chiral field on the boundary [79]. As in [80], this constitutes the off-shell and gauge-invariant description of the boundary dynamics of CS theory, in the sense that it leads to the equations of motion of a chiral field without having to evaluate the bulk theory on-shell. However, a subtle yet important point is that variation with respect to a on the boundary of (4.15) leads to the equation of motion Da = ∓ * Da, which is the opposite chirality to what we have derived from (4.1). This is to be expected since inserting equations of motion into an action leads to a new action with generally inequivalent equations of motion.

Gluing of subregions
Referring to figure 1, we have so far described the operations of splitting and of integrating. Splitting CS theory on M ∪M requires to consider for each subregion with boundary the extended actions (4.1). Integrating over the bulk gauge field of a subregion leads to a path integral over boundary fields only, and the dynamics of the boundary edge mode field a is that of a chiral theory.
We can now describe the operation of gluing of two subregions, which will involve getting rid of the edge mode field contributions from the two boundaries. For two boundary theories on ∂M and ∂M with opposite chirality, the gluing of S[A, a, j] and S[Ā,ā,j] is then given by Here we have written the path integral over all the bulk and boundary fields coming from the two subregions and their boundaries, with two delta functions enforcing the identification of the edge modes coming from the two boundaries. After integrating overā and the two currents j andj, in the third equality we are left with a delta function on the boundary, imposing that the gauge fields incoming from the two subregions are equal up to a gauge transformation. Integrating overĀ ∂M then eliminates the last boundary integral, and we are left with the path integral for CS theory over M ∪M . In the last step we have simply eliminated a redundant integration over a by dropping a gauge volume factor. This gluing operation is the application to CS theory of the gluing described in appendix A of [35].

Entanglement entropy
Finally, let us conclude this section by discussing the role of the edge modes and the extended phase space in the computations of entanglement entropy. In general, the entanglement entropy S of a spatially bipartite system Σ ∪Σ receives contributions from two sources, The first piece, S bulk , comes from physical degrees of freedom in the bulk, while S edge originates from degrees of freedom localized at the boundary, which for the bipartite system is the entangling surface S = ∂Σ = ∂Σ between the two subregions. CS theory being topological, it does not have physical bulk degrees of freedom, and therefore the sole contribution to its entanglement entropy comes from the boundary degrees of freedom, i.e. the edge modes. Although the computation of entanglement entropy in CS theory is already well understood and has been studied by many authors, it is still worth briefly reviewing the different computational techniques in order to emphasize the role of the edge modes. After all, this is the narrative which we are trying to build in the present paper: there is a unified treatment of the extended phase space for all gauge theories, and a Lagrangian description of the corresponding edge modes. In CS theory, it is well accepted (and even tested!) that these edge modes have a dynamics and a contribution to entanglement entropy. This therefore strongly suggests that what is known about edge modes in CS theory is actually a generic feature of any gauge theory. There are essentially three approaches for computing entanglement entropy in CS theory. The first one exploits the knowledge of the surface symmetry algebra, the second one uses a Hamiltonian quantization of the effective boundary action [81], and the third one the replica trick calculation [82]. We briefly mention the first approach below, and summarize the second one in appendix E.
The computation of entanglement entropy from the surface symmetry follows from [40,41,45,45,46]. It relies on the extended Hilbert space construction, and on the factorization where H Σ,S denotes the extended Hilbert space on each subregion, containing edge states living on the entangling surface S. This extended Hilbert space, though it has the advantage of being factorized, contains in a sense two copies of the edge modes (one coming from each subregion) and therefore many non-physical states. The total Hilbert space of physical gauge-invariant states, which is a subspace of the factorized extended Hilbert space, is obtained as an entangling product 19) and is spanned by gauge-invariant states |ψ phys satisfying the quantum gluing condition Here, the boundary symmetry generators (4.7) derived from the classical theory are promoted to quantum operators, and correspondingly the Poisson brackets are turned into operator commutators. For Abelian CS theory, the algebra is the U(1) Kač-Moody algebra (with the factor k/4π restored), The fact that the boundary of CS theory carries a 2-dimensional chiral boson with corresponding Kač-Moody algebra allows us to use techniques in boundary conformal field theory. In terms of the mode expansions the algebra becomes Identifying α n = α −n , the gluing condition, which can now be rewritten as tell us that physical states are singlets under the action of left-moving and right-moving current operators on each side of the entangling surface (therefore the entanglement entropy in this case is known as left-right entanglement entropy). The gluing condition is solved by the conformallyinvariant Ishibashi states [83] where the orthogonal states are labelled by a quasiparticle charge q, such that the choice q = 0 corresponds to the vacuum state, and q = 0 to states with Wilson lines with charge q and −q piercing through Σ andΣ. The quantum numbers N, j label the descendants. The Ishibashi states are in general non-normalizable, and therefore need to be appropriately regularized. The regularized Ishibashi states are defined via the CFT modular Hamiltonian as where ǫ is a cut-off parameter, ℓ is the length of the entangling surface S, and c is the central charge of the corresponding CFT. With this, the generic edge states are linear combinations of the regularized Ishibashi states, and the entanglement entropy can be computed as the standard von-Neumann entropy. The result for the simplest case of a spherical hypersurface divided into two disks, S 2 = D ∪ D, and without quasiparticles, is given by [44,47,48] The first term is the non-universal area law, with A = 2πℓ, and the second term, which is area-and cut-off-independent, is the famous topological entanglement entropy of CS theory. Another way of computing this entanglement entropy is to apply the standard method of Hamiltonian quantization to the boundary effective action [81]. This leads to the same topological contribution from the edge modes. In appendix E we reproduce the details of the calculation for the interested reader.

Maxwell theory
We now turn to the case of Maxwell theory. To construct the bulk + boundary action, in addition to the bulk gauge field A, let us consider on the boundary a 0-form a transforming as δ α a = −α, and a gauge-invariant 2-form j. With this we can form the gauge-invariant action where once again Da := da + A and h[j] is a boundary Hamiltonian depending on the current j only. This simple action for Maxwell theory coupled to boundary currents is also the starting point of [35], where it is however introduced from the point of view of the gluing of Maxwell theory for two neighboring regions M andM (this gluing is strictly analogous to what we have described in section 4.1.3 for CS theory). This action is also motivated in [30] by the need to couple Maxwell theory to currents (or matter fields) in order to achieve its factorizability. The introduction of the boundary edge mode fields allows to factorize the theory between two neighboring subregions, and here we will furthermore show that these edge mode fields reproduce the extended phase space structure of [14]. Following [35], we will set h = 0 and show that even in this case there is a non-trivial boundary dynamics. We leave the study of various other possibilities for h and their physical interpretation for future work. Following (3.3), the variation of this action reveals the bulk and boundary equations of motion, as well as the boundary potential. This variation is (4.29) We can observe that the boundary equations of motion imposed by the variation of A and a on the boundary are together consistent with the bulk equations of motion. The boundary condition imposed by δA identifies the edge mode momentum j with the normal electric field ⋆F , i.e. states that 13 j = ⋆F . With this, the extended potential (3.4) becomes which is the extended potential derived in [14]. The extended symplectic structure derived from this potential is such that for gauge transformations the generator defined by δ α Ω is vanishing on-shell. Indeed, this is In addition, the transformation acting as ∆ α A = 0 and ∆ α a = α has an integrable generator given by the "electric charge" smeared with an arbitrary function α. We therefore see how the extended bulk + boundary action allows us to recover the extended phase space structure of Maxwell theory. We can now turn to the boundary dynamics. The boundary dynamics for the edge mode field a is obtained by integrating out the bulk degrees of freedom in the path integral, as done in [35] and above for CS theory. Since Maxwell theory is quadratic, the integration over the bulk gauge field A produces a determinant of the bulk operator multiplying the path integral for the bulk + boundary action evaluated on-shell. Using the fact that the on-shell bulk Maxwell action is itself a boundary term, and that on the boundary the normal electric field gets identified to the boundary current j according to the boundary equation of motion j = ⋆F , we have that the path integral for (4.28) is These equations can either be interpreted in the form given here, i.e. as the free bulk equations of motion with specific boundary conditions, or alternatively as a bulk equations of motion which are not free but sources by boundary currents. The equivalence between these viewpoints is explained in appendix D. The evaluation of A[j] depends on the background spacetime geometry under consideration, but will always lead to a linear expression in j. The effective action on the right-hand side of (4.33) is therefore quadratic in j, and integrating this auxiliary current out will therefore produce a boundary action quadratic in the edge mode field a. This is the same construction as in [35], and we have now shown its generality by comparison with the CS construction of the previous section.
To be more concrete, we can solve (4.34) as an example in the case of 3-dimensional Minkowski spacetime 14 . In the radial gauge A r = 0, the boundary condition j = ⋆F translates into the two which can be solved by writing Noticing the switch of components between A and j, one can see that the term j ∧ A[j] in (4.33) is indeed quadratic in j t and j φ . In order to satisfy the bulk equations of motion, which in the Lorentz gauge are A µ = 0, we simply need to restrict the sum over momenta k to k 2 = −k 2 t + k 2 r + k 2 φ = 0. It is then clear that integrating (4.33) over j produces a quadratic effective action for the edge mode a.
In appendix B we give a more generic formula for this, and explain in details how A[j] and the effective boundary action can be obtained in the case of 3-dimensional Maxwell theory in the radial gauge. The result of this calculation is that the effective path integral for the edge modes is where ϕ is simply a field-redefinition 15 of the initial edge modes a, and whereG(k) is the solution to (4.34). In appendix D, we explain how one can alternatively see the boundary conditions in (4.34) as boundary sources for the bulk equations of motion. By doing so we obtain an equivalent expression for the effective path integral for the edge modes, which is This is the Maxwell analogue of the Poisson kernel integral obtained in [52] in the case of a scalar field. There, it was argued that properly splitting and sewing scalar field theory path integrals on manifolds with boundaries requires "scalar edge modes" in order to reproduce the FBFK gluing formula for functional determinants 16 [53][54][55][56]84], and that the corresponding edge scalar partition function on each side of the boundary comes from the boundary term needed in order to have a well-defined variational principle for the bulk scalar field action. As such, this argument would be puzzling when transposed to Maxwell theory, since in Maxwell the bulk action already has a welldefined variational principle without the need to add a boundary term, and one does not see where 15 More precisely, we have ϕ := α+a, where α comes from the Hodge decomposition (4.49) of the 3-dimensional gauge field A. This variable ϕ is therefore gauge-invariant. Alternatively, if one does not use the Hodge decomposition, the on-shell evaluation of the action in (4.33) requires as usual a gauge-fixing, and the resulting effective action depends on a instead of ϕ. These two viewpoints are of course equivalent. 16 We come back to this point in section 4.3.3.
the Poisson kernel contributions of [52] could come from. We have shown that these contributions come from the path integral of the edge modes, whose introduction is natural since in a gauge theory they are needed in order to even have a notion of splitting of the path integral in the first place. Finally, it is interesting to point out that in [35] it was shown in great details how the effective action (4.33), when evaluated in Rindler space, produces the path integral introduced by Donnelly and Wall [27,28] in order to explain the origin of the Kabat contact contribution to the entanglement entropy.

Maxwell-Chern-Simons theory
In this section we study 3-dimensional MCS theory. This is equivalent to a theory of massive photons, where the so-called topological mass is provided by the CS term (and at the difference with higher dimensional Stuckelberg-like theories does not require to introduce new fields). This theory has a wide range of applications in condensed matter physics. Its boundary dynamics has been analyzed previously in [29,[85][86][87] in flat space, and in [88] in the context of AdS holography, and reveals the presence of a chiral edge mode, just like in pure CS theory. However, these references have conceptually different ways of introducing the edge degrees of freedom, so we believe it is useful to revisit MCS theory in the light of the general framework which we are presenting in this work. In particular, this will confirm the result of [29] concerning the contributions to the entanglement entropy, which will feature a contact term coming from the Maxwell part of the theory, but also a topological term coming from the CS part.
Introducing for convenience the topological mass m = k/(4π), where k is the coupling of CS theory, the bulk + boundary action is simply a combination of the extended actions (4.1) and (4.28), i.e.
where h is a boundary Hamiltonian depending only on j, and which we leave unspecified for now. Following the same logic as in the previous sections, we are going to study the extended phase space of this theory, the boundary symmetries, the effective boundary dynamics, and the edge mode contribution to the entanglement entropy.

Extended phase space
The variation of the action is The first thing one can notice is that, similarly to the case of pure Maxwell theory, the first and last set of boundary equations of motion (i.e. the ones obtained by varying A and a) are together consistent with the bulk equations of motion. Furthermore, acting on these bulk equations of motion with the operator ⋆d⋆ leads to which shows the equivalence of MCS theory with a massive scalar field. We will come back to the precise statement of this relationship below when deriving the effective dynamics.
We can now construct the extended potential following the prescription (3.4) and imposing the first boundary equation of motion in (4.42), which gives This in turn leads to the extended symplectic structure which as expected is that of Maxwell plus (m times) that of CS theory. From this one can now easily check that the generators of gauge transformations obtained as δ α Ω are indeed vanishing on-shell. For the boundary symmetries ∆ α (A, a) = (0, −α), one can compute ∆ α Ω to find that this quantity is integrable and has a manifestly gauge-invariant generator given by Gauge-invariance of this generator is the statement that δ α Q[β] = δ α ∆ β Ω = 0. Finally, the algebra of these boundary charges is again given by the Kač-Moody commutation relations This shows that the surface symmetry algebra of MCS theory is identical to that of pure CS theory, even though in both cases the generators are different. This suggests the presence of a chiral boundary field, which we will now identify by evaluating the path integral.

Boundary dynamics
We now focus on the effective boundary dynamics of the theory, which as in the previous sections will be obtained by integrating out the bulk degrees of freedom. For clarity we will proceed in three steps of increasing complexity, depending on the type of boundary. First, if the spacetime has no boundary, integrating out the bulk degrees of freedom will lead as expected to the path integral of a massive scalar field. Then, if the spacetime has an outer boundary, i.e. a boundary separating the bulk from an empty manifold, the bulk will give rise to the massive scalar field, and the boundary will carry a chiral field (for the specific Hamiltonian which we choose). Finally, for an entangling boundary within the spacetime, separating the bulk between two regions, the boundary will carry a chiral field but also an additional contact contribution due to the splitting of the path integral measure between the two subregions.
A convenient way to carry out these calculations is to use the temporal gauge A t = 0 as well has a Hodge decomposition of the phase space variables. All the details are given in appendix C and here we will only summarize the results. Forgetting for the moment about the boundary, we aim at computing the path integral for the bulk part S M of (4.39). Using the 2 + 1 decomposition together with the decomposition it is explained in appendix C that the path integral reduces to Here δ(G) is imposing the Gauss constraint coming from the use of the temporal gauge, and the factor of (det ∆) 1/2 comes from three contributions: inserting the Hodge decomposition (4.49) in the phase space measure, in the Gauss constraint, and performing a Gaussian integral over λ. This is, as expected, the path integral for a massive scalar field, and it represents the contribution of the bulk degrees of freedom of MCS theory. Now we have to discuss how this result will be affected by the presence of a boundary. The effective boundary dynamics will receive contributions from two sources: the boundary action S ∂M in the extended action (4.39), but also boundary terms coming from the the Hodge decomposition of the bulk action S M . As shown in appendix C, carefully collecting all these terms and imposing the bulk and boundary Gauss constraints due to the temporal gauge, we find that the boundary contributions are given by where B[β] is given in (C.20), and where we have defined the new field χ := a + α + ∂ t β/(2m).
Guided by the fact that the boundary symmetries (4.47) are that of a chiral field, we can now choose the boundary Hamiltonian to be where j φ is fixed by the temporal gauge to be (C. 22). With this the boundary contributions become and path integrating over j t finally yields the chiral action (4.54) In the limit m → ∞, which corresponds to isolating the CS piece of the action, we recover consistently (4.14). The result can be summarized by writing the total path integral for (4.39) as This is consistent with what we have observed from the classical theory, namely that the bulk equations of motion describe a massive scalar field, and that the boundary symmetries are that of a chiral field. However, it can seem that this result is inconsistent with that of the previous section, since by setting m = 0 one would expect to recover pure Maxwell theory and its edge dynamics (4.38), which here is not the case. The reason for this is two-fold. First, the limit m = 0 cannot actually be taken at the end of the calculation, after the various above manipulations of the edge action have been performed, so to write down pure Maxwell theory in the temporal gauge one has to start again from the extended action (4.28). Second, as we will see below, a crucial difference between the radial and temporal gauges is that in this latter there is a leftover determinant factor coming from the rewriting of the path integral measure, which is precisely the FBFK gluing factor identified in [29].
Let us now make a few important observations. The first one is that, due to our choice of boundary Hamiltonian, the constraint imposed by j t in (4.53), namely 2m∂ r β + ∂ t ∂ φ β = 0, corresponds actually to the vanishing of the normal electric field to the boundary. Indeed, this latter is given in the temporal gauge by (⋆F ) φ = F tr = ∂ t A r = ∂ t ∂ r α + ∂ t ∂ φ β = 2m∂ r β + ∂ t ∂ φ β, where for the last step we have used (C.13). In light of this, we can investigate further the boundary equations of motion given the choice of boundary Hamiltonian (4.52) we made. Explicitly, the first two sets of boundary equations of motion in (4.42) are Combining the two equations on the last line leads to F tr = 0, while combining the ones on the first line and using the boundary Gauss constraint (C.13) leads to which features the chiral and massive scalars. Second, let us point out that we can also use the decomposition (4.49) and the boundary Gauss constraint (C.13) into the boundary observable (4.46) (which we smear with a function ǫ since α is the notation used for the Hodge decomposition) to get This consistency check show that the boundary chiral field is indeed the variable χ which we have identified in the computation of the effective boundary action. The results of this section are in agreement with previous observations in the literature about the fact that adding a Maxwell term to CS theory does not change the boundary symmetry algebra nor affect the presence of a boundary chiral field [5,86,89]. However, this does not mean that the entanglement entropy of MCS will only receive a topological contribution from the CS term. As we are going to show, the Maxwell contact term does also appear in MCS theory, although in the form of the FBFK gluing factor identified in [29].

Entanglement entropy
In order to discuss contributions of the edge modes to entanglement entropy, we need to consider an inner boundary which is separating the spacetime between two subregions. In this case we are on top of figure 1, and we want to integrate the bulk degrees of freedom of one subregion.
At first sight, one would think that the result of the previous subsection is enough, and that the entanglement entropy receives contributions from two sources: the massive scalar field in the bulk (i.e. the usual distillable part with its non-universal area law), and the chiral bosons representing the effective boundary theory and providing the same topological contribution as in the pure CS case. However, as pointed out in [29,52,84], one should acknowledge that there is a third contribution coming from the splitting of the path integral measure and the constraint between the two subregions. Indeed, as can be seen in (C.12), before integrating over the bulk fields the path integral written in terms of the Hodge decomposition and the temporal gauge is (4.59) The determinant factor can be traced back to the change of integration measure and the rewriting of the Gauss law in terms of the Hodge variables following (C.10) and (C.11). Importantly, one should recognize that this factor is not here in the radial gauge path integral computed in appendix B. Crucially, this determinant does not simply split between the two subregions. Instead, according to the FBFK gluing formula [53][54][55][56], we have that where the extra factor K := det(K M + KM ) features the so-called Poisson kernels K M,M , which can be expressed in terms of the normal derivatives of the Green functions for ∆ restricted to M and M .
In fact, we could have expected the appearance of such a factor K on physical grounds. Indeed, in the previous subsection we have shown that, when using the Hodge decomposition, the Maxwell fields contribute in the form of (massive) scalars, and the CS term gives rise to a chiral boundary theory. Since the massive scalar is not a gauge theory and does not bring edge modes, it would naively seem that when using the Hodge decomposition we have lost track of some of the edge modes. This is not the case, and the factor of K precisely keeps track of the pure Maxwell edge modes. This is the contact term identified in [29]. We have already encountered it in the previous section when deriving the boundary dynamics of pure Maxwell theory (both with and without the Hodge decomposition in radial gauge), and here it resurfaces through our change of variables and the corresponding splitting of the Gauss constraint and path integral measure.
Putting all the ingredients together, we get that the pure bulk (i.e. glued) path integral Z M ∪M over M ∪M factorizes in terms of extended bulk + boundary actions For the first equality, we have introduced the edge modes (a, j) and (ā,j) on ∂M = ∂M , together with the constraints enforcing that the two left and right path integrals glue together when integrating over the edge modes. This is the step which was described in (4.16) for CS theory. For the second equality, we have simply used the Hodge decomposition, which has produced the factor of K, and for the third equality we have further split the Hodge decomposition into bulk and boundary actions. In the previous subsection we have seen that integrating out the bulk degrees of freedom in a subregion produces a chiral theory on its boundary. The contribution of this chiral theory has been computed in section 4.1.4. We can therefore conclude that the entanglement entropy in MCS 17 It should be noted that of course all the fields are integrated over in the path integrals. Here we have simply written the arguments of all the path integrals Z in (4.61) in order to keep track of which variables (i.e. the initial gauge fields, the fields of the Hodge decomposition, or the edge modes) are integrated over. theory receives contributions from three sources, i.e.

BF theory
We now discuss 3-dimensional Abelian BF theory. The generalization to arbitrary dimensions is straightforward, while the non-Abelian case is briefly discussed in appendix F. BF theory is an interesting case study because of its relevance for the description of topological phases of matter [90][91][92], which also involves the study of its entanglement entropy, and because in the non-Abelian case it describes 3-dimensional gravity in the first order formulation. Recently there has also been a lot of interest in a 2-dimensional BF theory model known as Jackiw-Teitelboim gravity (although there it appears with the non-Abelian gauge group SL(2, R)) [36,[93][94][95][96]. We hope to apply our construction of the boundary dynamics to these more complicated cases in the future. General ideas on the boundary dynamics of 3-dimensional BF theory have already been formulated in [97,98], where the authors have identified chiral boundary currents. Here we show that depending on the choice of boundary Hamiltonian it is possible to obtain a chiral or non-chiral boundary scalar field theory.
To construct the bulk + boundary action, in addition to the bulk 1-forms A and B we add on the boundary the 0-forms a and b and a current 1-form j, and consider (4.63) The role of the new boundary field b is to make the total action invariant under the so-called shift transformations This is the edge mode field for the shift symmetry. Similarly to the cases studied above, this action produces the corner term which is needed for the extended phase space. To see this, consider the variation Now, notice that there exists an alternative boundary action, related to this one by a change of polarization, and which reads 18 The bulk equations of motion are of course unchanged, and the on-shell variation is  Since the potentials derived from the two extended actions differ by a total field variation, they lead to the same symplectic structure (although in a discretized setting the change of polarization can lead to inequivalent symplectic structures [99][100][101]), which is (4.70) in agreement with [16]. With this extended symplectic structure, we can then show as expected that the "Lorentz" and shift gauge generators δ α Ω and δ φ Ω vanish on-shell. In addition, we now also have boundary symmetries acting on the edge modes as (4.71) and generated by the boundary observables As expected from CS theory, these generators satisfy a U(1) × U(1) Kač-Moody algebra Based on this algebra of boundary symmetries, we can expect to find two chiral fields on the boundary. Now, let us look at the effective boundary dynamics obtained by integrating out the bulk degrees of freedom. This calculation follows closely that in CS theory, since the actions are similar. In components, (4.63) becomes (4.74) As usual, the time components A t and B t are Lagrange multipliers enforcing the bulk Gauss and flatness constraints and on the boundary the relation Path integrating over A t and B t allows us to go on-shell and to write A a = ∂ a α and B a = ∂ a β, and with this the extended action reduces to where we have introduced the gauge-invariant scalars ϕ := a + α and ψ := b + β. Starting instead from the alternative action (4.67) we have 78) and path integrating over A t and B t gives The kinetic terms of the two effective boundary actions differ only by an integration by parts, and show that ϕ and ψ are canonically conjugated (with a derivative ∂ φ ). This means that we have the freedom of integrating out one of the fields (together with the current j) in order to obtain an effective boundary dynamics for the remaining one. This dynamics will depend on the choice of boundary Hamiltonian. With the chiral Hamiltonian h = (j t ∓ j φ )j φ which we have used previously in CS and MCS theory we obtain (4.80) Integrating over j t then yields the chiral action One can verify that using the alternative action (4.67) also leads to this chiral action. Alternatively, we can also use the boundary Hamiltonian 2h = ± * j ∧ j = ±(j 2 t − j 2 φ ). In CS theory, this has produced the chiral action (4.14). Here, integrating over j t leads to from which the equations of motion obtained by varying ϕ or ψ are chiral for ψ and ϕ respectively. This is the form of the edge theory which was studied in a condensed matter context in [91] (although in four dimensions), where it has been shown that it can also be quantized using the Hamiltonian methods of appendix E, and leads to a topological contribution to the entanglement entropy of − log k. Going one step further, one may also integrate out one of the two chiral fields. For example, integrating out ψ leads to which is now a single non-chiral scalar field.

Perspectives
Many recent papers are revisiting and unraveling the role of edge states in gauge theories and gravity, both quasi-locally and asymptotically. This effort is pushing forward and shedding new light onto ideas which have been around for a long time in condensed matter, pure gauge theory, and the study of black hole entropy [5,52,68,71,102], but whose generality has perhaps not yet been fully appreciated. In particular, this has highlighted the important role of edge states in the definition of entanglement entropy [23,24,32,35], their relationship with the infrared properties of massless theories [31,33,103], and has unraveled rich examples of boundary symmetries and dynamics in the gravitational context [3,[13][14][15]19,104]. In spite of these remarquable developments, we believe that there is still no unified treatment for describing how exactly the edge modes arise (in relation to e.g. specific choices of boundaries or boundary conditions) and for studying their dynamics. This is of course a notoriously complicated open issue, and for example already in the seemingly simple case of 2-dimensional gravity the boundary dynamics is not fully understood [36,96,104]. While we do not claim to have solved this issue, in the present work we have taken a small step towards proposing a conceptual general framework for describing the dynamics of edge modes. For this, we have first argued and recalled in the introduction and in section 2 why it is necessary to construct quasi-local extensions of the phase space of a gauge theory to include extra edge mode fields. The edge modes restore the seemingly broken gauge-invariance due to the presence of the boundary and parametrize the boundary symmetries of the theory. This has proven to lead to known and consistent results in the familiar cases of e.g. Chern-Simons and BF theory [16,18], but also enabled to unravel some new large sets of boundary symmetries in gravitational theories [14,19,20,22,76]. In section 3, we have then proposed an extended variational principle (similar to the one proposed in [77], although in a different context) which supplements the bulk symplectic structure with a boundary symplectic structure including the edge mode fields and descending from a boundary action. It is indeed natural to view the complete definition of a field theory as the specification of a Lagrangian for each submanifold, and fusion products gluing the associated symplectic structures together. The addition of a boundary action with edge modes provides a covariant realization of the extended Hilbert space construction and gives rise to the setup represented schematically on figure 1. The edge modes are necessary in order to factorize the Hilbert space, phase space, or path integral of a theory. Most importantly, once a theory has been split between two subregions by introducing edge modes on the boundary together with a boundary current j and a Hamiltonian enforcing boundary conditions, the bulk of a subregion can be evaluated on-shell and a residual dynamics gets imprinted on the boundary. This agrees with the proposal made in [35], which we have now therefore connected with the extended phase space constructions of [14,16,18].
We have put this proposal for deriving the boundary dynamics of edge modes to the test in various examples of theories with Abelian internal gauge symmetries (we plan to come back to the study of the non-Abelian case and diffeomorphisms in future work). In the case of Chern-Simons theory, we have shown that we recover consistently the known chiral boundary theory, and rederived the associated topological contribution of the edge modes to the entanglement entropy. More importantly, we have then applied this construction to Maxwell theory. In this case, the need to include edge modes in order to achieve a factorization of the path integral and the Hilbert space had already been acknowledged in [26,30,31,35]. We have now however explicitly shown how the inclusion of edge modes leads to a boundary action describing the extended phase space structure introduced in [14], and furthermore recovered the boundary dynamics of [35] once the bulk gauge field is integrated out. This confirms the contribution of the edge modes to the entanglement entropy of Maxwell fields. More precisely, in (4.33) we have obtained the generic form of the effective path integral for the extended Maxwell theory (4.28), with photons in the bulk and dynamical edge modes on the boundary. This expression is valid in any dimension. Specializing to the 3-dimensional case, we have used the radial gauge to rewrite the effective boundary path integral for the edge modes in the form (4.37) and (4.38). Then, we have reproduced this calculation in the temporal gauge with the inclusion of a Chern-Simons mass term. In this case, we have shown for a specific choice of boundary Hamiltonian that the boundary dynamics is that of a chiral field, but also that the path integral measure features a determinant factor which needs to be properly split between the two subregions if one wants to factorize the path integral. In agreement with [29], this is the origin of the contact term contribution to the entanglement entropy when using a Hodge decomposition and the temporal gauge.
Following this introductory work, whose goal was to present the framework and illustrate the connection between the boundary action, the extended phase space, and the on-shell boundary dynamics, many directions remain to be explored. We conclude by listing a few of these directions.
• Relationship between boundary conditions, Hamiltonian, and dynamics. It is now important to study more precisely the nature of the boundary theory obtained for Maxwell theory (first steps in this direction have been taken in [35]), and in particular to investigate its dependency on the choice of boundary Hamiltonian. We also plan on understanding the relationship with other constructions involving the quasi-local edge modes of Maxwell theory [105]. In the case of 2-and 3-dimensional non-Abelian BF theory (which describe first order gravity) on the other hand, studying the boundary dynamics for various choices of boundary Hamiltonians (i.e. boundary conditions) is an important task in order to connect with proposals for the boundary dynamics and the boundary symmetries which have been presented already in the literature [1,13,15,36,94,95,104,106,107].
• Contributions to entanglement entropy. In this work we have tried to argue from the point of view of the continuum theory that edge modes contribute to the computation of entanglement entropy. The reason for this can be traced back to the need to introduce edge modes in the first place in order to have a notion of decomposition of a region into subregions, and to the fact that a boundary dynamics gets induced once the bulk degrees of freedom of a subregion are integrated out. In the case of topological theories such as Chern-Simons and Abelian BF theory this fact is well established, as we have seen in section 4.1.4. In the case of Maxwell theory, we have argued along similar lines as [29,31,35] that the edge modes contribute through their effective boundary path integral (4.38). On the one hand, it was shown in [31] that this path integral, when evaluated in Rindler space, reproduces the edge mode contribution introduced in [27,28] in order to explain the origin of the Kabat contact term. It would be interesting to investigate further this relationship already in the case of Minkowski space. On the other hand, the authors of [29] have argued that the Kabat contact term arises from the FBFK gluing factor for functional determinants. This argument fits also nicely with that of [52] concerning the contribution of edge modes when factorizing a path integral between two subregions. However, in section 4.3 we were only able to argue that the FBFK gluing factor appears in Maxwell-Chern-Simons theory once we write the theory over M ∪M in the temporal gauge with the Hodge decomposition, and then decompose it between two subregions (which then requires to split the path integral measure and to use the FBFK formula). We were not able to compare the results of this calculation with that of pure Maxwell theory because the massless limit of Maxwell-Chern-Simons theory is anomalous. In future work, it would therefore be interesting to look more closely at the 3-dimensional Maxwell theory in the temporal gauge with the Hodge decomposition, and to attempt at obtaining explicitly the FBFK gluing factor from the effective boundary path integrals coming from the two separate subregions. In other words, while the present work has focused on the general framework and provided preliminary examples of the dynamics and the contribution of edge modes, in future work we will focus more precisely on 3-dimensional Maxwell theory in order to compare the various computations of entanglement entropy and contact terms which have appeared in the literature, the various gauge choices (temporal or radial), and the use of the Hodge decomposition to rewrite Maxwell theory as a scalar field. This should be able to provide a comprehensive picture of the relationship between the edge modes and the entanglement entropy for Maxwell fields.
• Extension to other theories. There are essentially two types of theories to which the present work should be extended: non-Abelian gauge theories, and theories with diffeomorphism symmetry. Here we have presented the construction of the extended action and symplectic structure for non-Abelian gauge theories in appendix F. This does not present any conceptual difference with the Abelian case. However, the study of the boundary dynamics of non-Abelian theories is for the most part unknown (preliminary steps have been taken in [35]). In the case of diffeomorphism symmetry however, already the introduction of the edge modes in the extended phase space or the boundary action is conceptually different from what we have presented in this work, since it requires embedding variables [14,108]. It would be interesting to construct and study a boundary action which introduces these embedding variables and leads to the extended symplectic structure for metric gravity derived in [14]. Finally, in the case of topological theories it would be interesting to investigate whether the boundary actions used to introduce edge modes on lower-dimensional submanifolds can be understood from the point of view of extended TQFTs [42,[109][110][111], and (in the case of e.g. 3-dimensional BF theory) if the edge modes introduced in [16] have an interpretation in terms of the corresponding extended TQFT data [112,113].
• Link with the dynamics of soft modes at asymptotic infinity. A major open question is to relate the edge modes presented in this work (and in all the references cited in the introduction) to the so-called soft modes which appear in the infrared regime of massless theories [33]. Some steps in this direction have already been taken in [31,34], and there have also been proposals for the description of the infrared dynamics itself [114,115]. It is therefore natural to ask whether such proposals can be recovered (or corrected) from the boundary dynamics of Maxwell theory presented in this work, provided we can choose appropriate boundary conditions and push the boundary to infinity.
• Link with other treatments of edge modes, gauge-invariance, and gluing. Finally, we would like to point out that an extensive framework for dealing with gauge symmetries and gaugeinvariance in gauge theories has been developed in a series of recent articles [116][117][118][119][120][121][122]. Instead of explicitly introducing edge mode fields in order to restore the seemingly-broken gaugeinvariance (as we do here), this framework adopts a more geometrical viewpoint and introduces instead a connection in field space. While there are some sharp conceptual differences between this approach and the one presented here, we would like in future work to investigate further the possible points of convergence, and whether the procedure of gluing/splitting presented here can be made more geometrical and recast in the above-mentioned formulation.
We hope that this work will trigger some of these developments, and eventually lead to a coherent picture for including edge modes in gauge theories and deriving their holographic dynamics.

A Covariant phase space
In the covariant phase space formalism, we make extensive use of the field variations δ and the notation δ α for gauge transformations with field-independent parameter α. Following a rather standard nomenclature, we view δ as a differential in the space of fields. For a Lagrangian defined on a d-dimensional spacetime manifold, the potential θ is therefore a (d − 1, 1)-form, meaning a (d − 1)-form in spacetime and a 1-form in the space of fields. Repeated action of δ is understood with anti-symmetrization, and the symplectic structure Ω is therefore a field space 2-form Gauge transformations δ α , if understood as tangent vectors, can then be contracted with field space differential forms. This is the meaning of the notation δ α Ω, which translates explicitly into By analogy with differential forms on spacetime, the object δ α Ω, which is the contraction of a field space vector with a 2-form, is therefore a field space 1-form.

B Maxwell theory in radial gauge
Inspired by holography, let us work in the radial Hamiltonian formulation, where the radial coordinate r is treated as the Hamiltonian time. The natural gauge fixing corresponding to this choice is then the radial gauge where we set A r = 0. This condition, together with the Lorenz gauge ∂ µ A µ = 0, are the gauge choices used in [35] and in section 4.2.
Let us focus on the 3-dimensional case, and decompose the spacetime coordinates x µ = (t, r, φ) as x µ = (r, y i ), with y i = (t, φ) the coordinates on the r = constant hypersurfaces. With this, the spacetime metric can be decomposed as where in cylindrical coordinates Placing the time-like boundary ∂M at r = ℓ, we have that the induced metric at the boundary is g ij ∂M = q ij (ℓ) =: q ij . With this radial decomposition, all the total derivatives are along the directions y i , and can therefore be discarded because of our choice of cylindrical topology M = R×D.
We will therefore freely integrate by parts over t and φ.
Similarly to the standard Hamiltonian analysis with respect to time t, the bulk Maxwell action in (4.28) can be written in radial Hamiltonian form as where the conjugate momentum to A i is Π i := −F ri , and the Hamiltonian is We now use a Hodge decomposition of the gauge field and the momenta by writing where β i and λ i are the divergence-free parts ∂ i β i = 0 = ∂ i λ i . The constraint enforced by the radial gauge fixing is that where we define ∂ 2 := ∂ i ∂ i to be the Laplace operator on the slices of constant radius r. In terms of this Hodge decomposition, the canonical term of the action and the terms of the Hamiltonian can be decomposed as With this, the bulk Maxwell action becomes The first term vanishes once the constraint (B.6) is imposed. Path integrating over the momentum variable λ then yields so one can see that the bulk contribution is determined by the divergence-free part of the Hodge decomposition. Notice that if we write explicitly the path integral with the Hodge decomposition, taking into account the change of measure and the change of variables in the Gauss constraint using the two determinant factors cancel out. Furthermore, there is no determinant factor produced when integrating over λ, and we are therefore left with the path integral over β of (B.9). This is a crucial difference with the Hodge decomposition of the path integral in the temporal gauge, which produces determinant factors as explained in appendix C.
We can now add to this the boundary action containing the edge mode field a to obtain the full bulk + boundary action (4.28). More precisely, using the radial gauge with the Hodge decomposition, imposing the constraint (B.6) and integrating out the momenta λ, we obtain the extended Maxwell action 19 where we have introduced the gauge-invariant scalar ϕ := a + α. Variation with respect to β i gives in the bulk the flat massless Klein-Gordon equation in cylindrical coordinates, and on the boundary the boundary condition where β i (ℓ, y) = β i (r, y) ∂M . Similarly to the calculation (4.33), path integrating over β in the bulk produces an operator determinant for the massless scalar, and, recalling that on-shell the bulk action is a boundary term, the total boundary action (i.e. the initial one in (4.28) plus the piece coming on-shell from the bulk) becomes where we have used the boundary condition. This expression is the effective boundary action in (4.33).
The boundary value β i [j] is now determined by solving the bulk equation of motion with respect to a Neumann-type boundary condition, i.e.
which is the 3-dimensional version of (4.34) in the radial gauge. The bulk equation is solved by going to momentum space, with k i = (k t , k φ ), as where k · y = k i y i , and J n denotes the Bessel function of integer order. Note that k φ has a discrete spectrum due to the compactness of the φ direction. Now, writing the boundary condition translates intõ We therefore obtain β at the boundary in the form 20) whereG(k) represents the momentum space Green function. In the present case, we havẽ .
Putting this together, the effective edge mode action becomes As expected, this action is quadratic inj. We can now choose to integrate overφ to obtain the condition which is equivalent to the condition that boundary current is conserved, i.e. dj = 0. The path integral then reduces to an integral over all conserved currents of the quadratic action written above. Alternatively, we can integrate out the currentj i in order to get the quadratic action forφ which is This is the effective boundary action in momentum space.

C Maxwell-Chern-Simons theory in temporal gauge
Here we present the detailed calculations of the Hodge decomposition of MCS theory, keeping carefully all the boundary terms, together with the manipulations of the path integral with and without boundaries. We recall that the spacetime has the topology M = R × D of an infinite cylinder with x µ = (t, r, φ) such that ε trφ = 1, so total derivatives ∂ t and ∂ φ can be ignored. We will constantly use this fact to freely move these derivatives around. For simplicity, even though we are using cylindrical-looking coordinates, our choice of metric will be g µν = diag(−1, 1, 1), so we will allow ourselves to write the expressions below with all spatial indices downstairs for simplicity, and drop the determinant |g| in the integrals. This does not affect the results of this appendix. We denote the spatial Levi-Civita tensor by ε ab := ε t ab , with ε ab ε ac = δ bc and ε rφ = 1. Finally, the spatial Laplacian will be denoted by ∆ := ∂ a ∂ a , the wave operator by = −∂ 2 t + ∆, and the time derivative ∂ t α by a dotα.
With a 2 + 1 decomposition identifying the momentum, the Gauss constraint, and the Hamiltonian, the bulk part of the action in (4.39) can be written as The momentum conjugated to the gauge field is where one should notice that the first term has picked up a sign because we have lowered the indices. The Gauss constraint is and the Hamiltonian is We are now going to rewrite these quantities using the Hodge decomposition In various expressions, we will only keep total derivatives in r since the ones in φ vanish when going to the boundary. In these total derivative, which will give boundary terms, we will furthermore use (C.2) and the temporal gauge A t = 0 to rewrite This is justified since on the boundary it is A (and therefore α and β) which is conjugated to the edge mode field a. The Hodge decomposition gives From this, we can now derive several results. First, let us focus on the bulk contributions to explain how the path integral for the massive scalar field arises. We will perform manipulations at the level of the Lorentzian path integral, but simply write the actions alone in order to avoid unnecessary notational cluttering. Working in the temporal gauge A t = 0 we have to impose the Gauss constraint, which we write here in the form G = ξ − mβ = 0. This transforms all the bulk terms above according to where for the second equality we have used the constraint enforced by the temporal gauge. Performing now the Gaussian integral over λ leads to Let us now keep track of the various determinants which have been produced by these manipulations in the path integral. First, when using the Hodge decomposition, the measure on phase space changes as we have also picked up a factor (det ∆) −1 when imposing the Gauss law with a delta function in the path integral. Then, the Gaussian integral over λ has produced a factor of (det ∆) −1/2 . Putting all these factors together, assuming that there is no boundary, and performing a final Gaussian integral over β in (C.9), we finally get that where we have dropped gauge volume factors (which can be absorbed by properly normalizing the path integral). As expected, we recover the evaluation of the path integral for a massive scalar field, and all the factors of det ∆ have cancelled out.
We can now look more carefully at all the boundary contributions coming from the bulk action S M , we will will denote by ∂S M . More precisely, these contributions come from the decomposition (C.7) and from (C.9). On the boundary, we will use the relation (C.6) to write the Gauss law as With this the boundary term in (C.9) is actually vanishing. More precisely, the boundary contributions are In order to get the dynamics of the edge modes, we have to compute the path integral for this boundary theory coupled to the boundary action in (4.39), in which we have to take into account the constraint imposed by the temporal gauge A t = 0. With this the boundary action (4.39) becomes where we have introduced ϕ := a + α. Combining the two boundary actions (C.14) and (C.16) into a total boundary action now leads to With a further change of variables χ := ϕ +β/(2m) we finally get We then have to choose a boundary Hamiltonian h and integrate over j t in order to get the final form of the effective boundary action. In the main text we use the Hamiltonian Noticing that the expression (C.15) for j φ can be written in terms of χ as with this Hamiltonian we get which can be path integrated over j t to finally obtain Note that this last step involves the fact that, under the constraint imposed by j t , we have

D Boundary conditions as boundary sources
In this appendix we show how the boundary conditions obtained from the extended boundary + boundary action can equivalently be treated as boundary sources. To see this in a simpler setting, we will use the 3-dimensional radial gauge formulation of Maxwell theory introduced in appendix B, where the coordinates are x µ = (t, r, φ) = (r, y i ) with y i = (t, φ). We have shown in (B.12) that in this case the extended action is given by where A i = ∂ i α + β i and ϕ = a + α. Variation with respect to β i leads to the bulk and boundary equations of motion where r = ℓ is the location of the boundary ∂M . Alternatively, we can use a Dirac delta to rewrite this action as which leads to the massless Klein-Gordon equation with boundary sources To solve this boundary problem we use the decomposition where β i 0 is the homogeneous solution with Dirichlet boundary condition, i.e.
β i 0 (r, y) = 0, β i 0 (ℓ, y) = 0, ∂ r β i 0 (ℓ, y) = 0, (D. 6) and the Green function satisfies Using this ansatz, the extended action can be written as Finally, focusing on the boundary piece (the bulk gives a factor of (det ) −1/2 computed with Dirichlet boundary conditions) and path integrating over j i leads to the effective action One can verify that in momentum space this effective edge mode action coincides with (B.24). We have shown that the boundary current j can be treated either as a boundary condition or as a boundary source. In general, this is valid for any theory whose equations of motion involve a Laplace-type operator. In order to see this, let us consider two functions ϕ and ψ defined over M and satisfying with the boundary conditions where n = n µ ∂ µ is a unit normal vector to the boundary. From Green's second identity which therefore means that ϕ| ∂M = ψ| ∂M .

E Hamiltonian quantization of the chiral bosons
For abelian CS theory, as we have seen in (4.14), the edge mode dynamics is that of a free 2dimensional chiral boson with action where the right moving and left moving bosons are to be identified respectively with the minus and plus signs. Taking into account the chiral action coming from both sides of the entangling surface, we can express the total action as where once again the different signs come from the different orientations of ∂M and ∂M . In addition to the left-right chiral bosons, we have also introduced here a gluing action (known in condensed matter as a tunneling term), and the gluing constraint along the entangling surface can be enforced by taking λ → ∞. This term provides a coupling between left and right moving fields.
Mode expansion. Since the boundary is a circle of length ℓ, we can write the fields ϕ L and ϕ R in a mode expansion With this the canonical term of the above action becomes showing that we have the canonical commutators Expanding the gluing contraint to quadratic order, the Hamiltonian is given by and is the sum of a zero mode and an oscillator part. In order to compute this Hamiltonian we first use This leads to where we have used (N R ) 2 + (N L ) 2 = (N R − N L ) 2 + (N R + N L ) 2 /2 and the fact that N R + N L annihilates the ground state. Then we use this annihilation condition again to get (E.9) Putting this together, we get that the zero mode Hamiltonian is given by while the oscillator Hamiltonian is given by (E.11) Zero mode density matrix. Introducing the discrete harmonic oscillator variables , ω = 8π √ λ, (E. 12) which are such that [X, P ] = i, we can rewrite the zero mode Hamiltonian as (E.13) In the low energy limit m → 0 or ℓ → ∞, we can treat this as a continuum system. The unnormalized ground state is given in terms of the eigenvalues ν of the operators N as (E.14) The constraint (N R + N L )|ψ 0 = 0 then leads to with cosh(2θ n ) = cosh 2 (θ n ) + sinh 2 (θ n ) = 1 + 2 sinh 2 (θ n ) = 1 E n 2πk ℓ |n| + 2λℓ 2 |n| , (E.18a) sinh(2θ n ) = 2 cosh(θ n ) sinh(θ n ) = − 1 E n 2πk ℓ 2λℓ 2 |n| , (E.18b) and E n = 2πk ℓ |n| 2 + 4λℓ 2 , (E. 19) we can diagonalise the oscillator Hamiltonian and write it in the simple form . (E.20) The ground state reduced density matrix (say for the right-moving sector) can be written formally in terms of an entanglement Hamiltonian as where the unknowns are the so-called entanglement energies h n . From this expression and the fact that Tr R ρ R α = 1 we get that The two-point correlation function can be written equivalently as an expectation value in the oscillator ground state |ψ α , or as a trace using the reduced density matrix, so we have the equality ψ α |α † n α n |ψ α = Tr R (ρ R α α † n α n ).
Thermal partition functions. We define the total thermal partition function as where the zero mode partition function is In the large ℓ limit, τ is small, the Jacobi function behaves as θ(0, τ ) ∼ 1/ √ −iτ , and the Dedekind function behaves as η(τ ) ∼ e iπ/12τ / √ −iτ . We therefore get that , (E. 35) and the total partition function behaves as .

F Extended action and phase space for non-Abelian theories
In this appendix we present the extended actions for non-Abelian Chern-Simons, Yang-Mills and BF theories, and show that they lead as expected to the extended phase space structures which have been derived in [14,16]. We postpone the study of the effective boundary dynamics to future work. Throughout this appendix, the gauge fields are 1-forms with values in the Lie algebra g, whose bracket is denoted by [· , ·]. The non-Abelian covariant derivative and field strength are given by Finally, recall that all the expressions below should be understood with an implicit pairing between the Lie algebra elements, which we choose to drop for notational clarity, and which is furthermore invariant under the adjoint action of the group on its algebra.

F.1 Chern-Simons theory
In non-Abelian CS theory, the edge mode field which we need to introduce is now a group element. We will denote it by u. Under the action of finite gauge transformations, this edge mode field transforms as g * u = g −1 u, and the current j transform as g * j = g −1 jg. With this, the extended bulk + boundary action naturally takes the form where by comparison with the Abelian case we have now included the bulk NWZW term. The variation of this action can be written as To obtain this form of the variation of the action, we have used several identities. The first one is the variation of the bulk WZNW term, which gives a boundary term according to The second one is δ(duu −1 ) = ud(u −1 δu)u −1 . Finally, we have also used the fact that which comes from the invariance of the (implicit) pairing under the adjoint action of u.
To obtain the extended potential, we have to remember that the bulk NWZW term also brings a contribution. The total extended potential is therefore given by Upon taking a further variation the NWZW term gets pushed to the corner using in agreement with [18]. As explained in this reference, similarly to what happens in Abelian Chern-Simons theory, we then have that the generators of δ α are integrable and vanishing on-shell, while the boundary symmetries acting as ∆ α A = 0 and ∆ α u = uα have a generator ∆ α Ω which satisfies a non-Abelian current algebra.

F.2 Yang-Mills theory
To treat the case of 4-dimensional Yang-Mills theory, we need once again a group element u and a current 2-form j, transforming respectively under gauge transformations as g * u = g −1 u and g * j = g −1 jg. With this we can then form the extended action where the third term on the boundary can actually be rewritten using The two boundary equations of motion imposed by δj and δuu −1 imply that the boundary current is conserved, i.e. d A j = 0. The extended potential is given by 14) in agreement with [14] and with the Abelian limit (4.30).

F.3 BF theory
For 3-dimensional non-Abelian BF theory, which is actually 3-dimensional first order gravity (here with a vanishing cosmological constant), the edge mode fields are a group element u and a Lie algebra element b, transforming respectively as g * u = g −1 u and g * b = g −1 bg. The extended action is in agreement with [16]. The computation of the extended symplectic structure, the boundary observables, and their algebra, then follows the results of this reference.