Gluing. Part I. Integrals and symmetries

We review some aspects of the cutting and gluing law in local quantum field theory (QFT) and study it from a new point of view. In particular, we emphasize the description of gluing by a path integral over a space of polarized boundary conditions, which are given by leaves of some Lagrangian foliation in the phase space. We think of this path integral as a non-local ( d − 1)-dimensional gluing theory associated to the parent local d -dimensional QFT. This is a novel point of view paving the way for applications of the standard QFT techniques (that do not rely on locality) to the gluing theory. We describe various properties of this procedure and spell out conditions under which symmetries of the parent theory lead to symmetries of the gluing theory. The purpose of this paper is to set up a playground for the companion paper where these techniques are applied to obtain new results in supersymmetric theories.


JHEP04(2020)175
where W denotes W with opposite orientation, they can be attached along W , and this topological operation has a counterpart for the QFT data. 1 In topology, the gluing operation (or the fibered coproduct) is denoted by: where ∼ is the equivalence relation identifying points of W with those of W . A ddimensional QFT, denoted as QFT d , associates to W a space of states H W (a possibly infinite dimensional topological vector space) and its dual H ∨ W to W . The dynamics of quantum fields living in the bulk of M and N produces boundary states, which are described by (co)vectors from the corresponding spaces. We denote them using the standard bra-and -ket symbols: All physical information about the bulk dynamics of M and N that is accessible at the boundary W is encoded in these states. On the other hand, for a given QFT, the space H W depends only on the geometry of the infinitesimal neighborhood of W and not on any details of the deep bulk, 2 which are encoded in |Ψ ∈ H W . This is one key assumption in local QFTs, which further leads to the main axiom, the gluing or sewing property, stating that the gluing operation corresponds to the composition of boundary states: as also illustrated in figure 1. The opposite operation is cutting: if a QFT is defined on N ∪ W M , we can cut it along W , and the bulk dynamics will generate unique boundary states as in (1.3). The locality postulates that these two operations are exactly opposite to each other: one can construct QFT on a bigger space by gluing it from smaller pieces. The cutting and gluing axiom is closely related to linearity in quantum mechanics (in which case locality postulates existence of the Hilbert space and implies existence of the Hamiltonian) and goes back to Dirac and the resolution of the identity trick, 1 = |q dq q| [5,6]. This later led to the discovery of Feynman's path integrals [7], which for local theories can be deduced by cutting spacetime into infinitely many small 1 We will usually assume the manifolds to be smooth, both before and after gluing, see more comments on this later.
2 A more precise way to say it is that HW depends on the germ [W ] of W ⊂ N ∪W M .

JHEP04(2020)175
pieces and then gluing them back together. Skipping several decades ahead, the idea of cutting and gluing has become the base of Segal's approach to conformal field theories, which then took several more decades to be published [1][2][3]. Soon after this philosophy has emerged, and after the discovery of topological field theories [8,9], the cutting and gluing law (or "the sewing law") played a central role in the axiom system defining the mathematical notion of TQFT [10]. The main observation was that if one abstractly considers assignment of spaces of states to (d − 1)-manifolds W , the cutting and gluing property can be seen as a statement that this assignment is a functor from the category of appropriate cobordisms to the category of vector spaces. In the topological case, this was later expanded to include higher categories of cobordisms, which lead to the notion of extended TQFTs [11] (see also [12,13]) and their classification [14]. Recently, there has been a number of works on general perturbative quantization of (not necessarily topological) gauge theories on manifolds with boundary, where the so-called BV-BFV formalism compatible with cutting and gluing was developed [15][16][17][18][19][20][21]. More generally, this is part of a bigger program of functorial quantum field theory [4], which is a leading candidate (along with parallel progress in algebraic QFT) for the mathematical definition of QFT (see also [22] for some related discussions). A lot of developments in quantum field theory rely in one way or another on the gluing property, many of which are classics, such as the operator-state correspondence in CFT, or the crossing symmetry (which can be thought of as equating cutting-and-gluing in s and t channels) [23], etc. Any attempt to fully review this subject would require including thousands of references, which by itself requires a hardly justifiable amount of work, at least within the scope of this paper. Therefore, we choose to focus on a particular aspect of gluing that will be detailed soon.
Note that the standard TQFT axioms imply that the space of states is finitedimensional. In this case, Ψ 1 |Ψ 2 is understood as a straightforward pairing between finite-dimensional vector spaces. In addition, given that manifolds can be glued topologically, gluing in TQFT is also well-defined. Both of these properties become more subtle once we depart from the world of topological theories (or, more precisely, from the standard TQFT axiomatics). Already in quantum mechanics, the space of states can be infinite-dimensional: typically, it is a functional space, in which case the inner product is still well-defined, Ψ 1 |Ψ 2 = Ψ 1 |q dq q|Ψ 2 . Moving to QFTs in dimension d > 1, the "infinite-dimensionality" of the space of states grows, and it becomes more difficult to make sense of Ψ 1 |Ψ 2 . Explaining some properties of the latter is the main focus of the current paper. For completeness, we should say a few more words about other subtleties of gluing in non-TQFTs.
In non-topological theories, manifolds usually become equipped with smooth metric (and, possibly, other geometric structures), either Riemannian or pseudo-Riemannian (i.e., of Euclidean or Lorentzian signature). Therefore, not any pair of manifolds that can be glued topologically are allowed to be glued geometrically. It might happen that even though M and N have a common boundary component W , the metrics on M and N are incompatible: simply equipping N ∪ W M with a "sewed" metric results in some sort of discontinuity at W that is forbidden in the class of geometries that we are considering.

JHEP04(2020)175
In such cases, one could imagine smoothing out this discontinuity in the infinitesimal neighborhood of W , and it would be interesting to understand whether this can always be done and if it leaves an imprint on the resulting theory (in the form of some defect). This problem will not be addressed in this paper, and we will simply consider cases where the metrics on M and N are compatible, so that the "sewed" geometry is smooth. This is general enough because, as we mentioned, the space H W really depends on the germ of W inside the d-dimensional space [4], not on W alone.
Another problem that becomes apparent in a non-topological setting is that it is necessary to consider both Riemannian and pseudo-Riemannian geometries. From the physics point of view, the spaces H W and H ∨ W associated to W and W , as well as the "gluing" Ψ 2 |Ψ 1 , are more naturally described in terms of a QFT on a pseudo-Riemannian space W × R t . It is equipped with the metric ds 2 W − dt 2 , where t is a "time" coordinate on R t , and ds 2 W is a Riemannian metric on W . This is usually referred to as "quantizing on W ". On the other hand, one way to generate physical states in H W is by putting a theory on some arbitrary manifold M with ∂M = W . The path integral on M determines a boundary state in H W as a functional of boundary conditions. Close to the boundary, we could approximate M by W × R t , but globally M might not possess a pseudo-Riemannian metric. Therefore, in general M can only be a Riemannian manifold. This raises a practical concern: how do we describe a state living at the boundary of a Riemannian manifold as an element of the space H W , given that H W is defined using the pseudo-Riemannian geometry W × R t ? It turns out that while in the simplest cases the answer is trivialthe boundary state, described as a functional, is not sensitive to the signature of metric on R t -in a more general situation, the answer involves certain analytic continuation. This subtlety will be of some importance to us, thus more details will be provided in the following sections.
The standard strategy to describe a boundary state at W is by imposing various boundary conditions on quantum fields near W and studying how the answer depends on them. For example, in the situation of figure 1, the QFT on M with fixed boundary conditions B at W associates a number to M , the partition function. For Lagrangian field theories, we assume, at least formally, that this number is given by a path integral over all field configurations on M satisfying the boundary conditions B. This number is some functional of B, and we characterize the boundary state by this functional: (1.5) To fully determine this functional, that is to know how to evaluate it for arbitrary boundary conditions, it is enough to know Ψ 1 [B] for a certain complete family of boundary conditions, which is big enough but does not need to include all possible boundary conditions. A fairly general way to determine such families is by choosing a polarization P on the phase space X[W ] of our QFT quantized on W . The latter is the formal phase space of the quantum-mechanical sigma model whose target space is the infinite-dimensional fields space Fields [W ]. The complete family of boundary conditions is given by the family of integral leaves of polarization P. The Lagrangian leaves from this family determine consistent boundary conditions, and we call them polarized boundary conditions. So the boundary JHEP04(2020)175 states, in general, can be formally characterized by functionals of polarized boundary conditions. There can be many choices of polarization, hence many different ways to represent boundary states as functionals. Denoting the boundary conditions imposed at W and W by B| and |B respectively, we can formally write: The gluing procedure can be represented as integration over the space of polarized boundary conditions (space of Lagrangian leaves) for a given polarization: In spacetime dimension d > 1, this integration is infinite-dimensional, thus is formal and requires regularization, just like the usual bulk path integral (in fact, the gluing integral inherits regularization from the bulk, see the next subsection). Polarized boundary conditions can be described in terms of a set of independent fields on W (for example, these could be restrictions of certain fields on M to the boundary). This makes it very suggestive to interpret the path integral in (1.7) as a quantum field theory on W . In fact, this might be the unique way to interpret it: indeed, the only context in which we encounter path integrals is quantum field theory, and it might be the case that they simply do not exist outside of its framework, in a sense being synonymous to QFT. Within the scope of this paper, we simply think of (1.7) as a (d − 1)-dimensional QFT on W , and we call it the gluing theory. Therefore, we have the following correspondence: 3 QFT d −→ the gluing theory QFT d−1 . (1.8) It is clear, however, that in general, this gluing QFT d−1 cannot exist by itself as a (d − 1)-dimensional theory, -it can only be defined as a device sewing two d-dimensional theories. One obvious reason is that the integrand in (1.7) depends on states Ψ 1 and Ψ 2 . Therefore, it would not make sense to consider QFT d−1 on a separate (d − 1)-manifold W , it always should be an interface connecting two d-manifolds, and the d-dimensional physics determines the integrand Furthermore, as we will see later, the gluing theory might appear anomalous: it might happen that the measure DB is not invariant under global or even gauge symmetries. As we will see very explicitly in the next section, the gluing theory still makes perfect sense even in such situations due to the version of the anomaly inflow: the non-invariance of "DB" is canceled by the non-invariance of Ψ 2 [B]Ψ 1 [B] whenever we know that the d-dimensional theory is non-anomalous. 3 One could try to generalize it further to a cascade of theories of the form QFT d → QFT d−1 → QFT d−2 → . . . . Such generalization is expected if we perform further cuts, resulting in manifolds with corners of various codimension, while still using local boundary conditions. In this paper, we are not trying to make any sense of it and only study the first gluing theory QFT d−1 . JHEP04(2020)175

Addressing possible concerns
Is it possible to compute the path integral in (1.7), or even make any sense of it? At this level of generality, the problem seems hopeless: just to write the integrand of (1.7) already requires solving QFT d on M with arbitrary polarized boundary conditions B. Furthermore, gluing by the boundary path integral, as described above, is a purely formal procedure which ignores that the boundary conditions are quantum objects: they can receive quantum corrections, get renormalized, and undergo non-trivial RG flows. The latter set of problems is very familiar already in the case of bulk path integrals: it can be concisely stated as the need for regularization in QFT. Therefore, in order to make any precise sense of (1.7), one should assume the existence of good regularization. The most convenient choice is to "induce" regularization from the bulk path integral. Indeed, to define the bulk QFT, one already has to assume certain regularization. It would be quite unnatural to first remove that regularization and then reintroduce another regularization for gluing. Instead, one should perform gluing in the regularized theory. Vaguely speaking, this requires that the bulk regularization preserves locality, so that the gluing property holds in the regularized theory. The most canonical examples of such locality-preserving regularizations are lattice regularizations: once we assume that the bulk theory has been properly discretized, with the appropriate counterterms included (to ensure the existence of the continuum limit), the gluing integral becomes naturally discretized as well. It should be possible to adapt other physical regularizations to gluing as well. We will work under the assumption that the locality-preserving regularization exists.
With such an assumption, we can study certain general properties of (1.7) semiclassically, and under favorable conditions, even evaluate it exactly. One thing we can definitely tell about the gluing theory based on the semiclassical analysis is its field content. After fixing the family of polarized boundary conditions B over which we wish to integrate, we know what fields on W constitute this B. We will focus on theories whose UV Lagrangians are renormalizable and have no more than two derivatives, so the boundary fields will usually be given by restrictions of d-dimensional fields to the boundary, their normal derivatives, or various mixtures thereof.
One case when (1.7) can be evaluated exactly is for free theories, where it is possible to explicitly write the non-local action of QFT d−1 . This was first studied for bosons on Riemann surfaces in [24][25][26][27]. Recently, similar analysis was also performed for a free Maxwell theory (in arbitrary spacetime dimension) and 2d Yang-Mills in [28]. Another case in which one can efficiently evaluate the QFT d−1 path integral is in the presence of extra symmetries, such as supersymmetry: under favorable conditions, it allows to make sense of (1.7) using the supersymmetric localization.

What we really do
This paper is designed to be a preparation for the companion paper [29] and mostly reviews known facts, albeit from a new, or at least somewhat unfamiliar perspective. After reviewing necessary facts on symplectic geometry of quantum mechanics, we emphasize the point of view which is useful for applications in [29]: that gluing can be represented by JHEP04(2020)175 a (generally non-local) QFT d−1 on the gluing interface whose fields parametrize polarized boundary conditions of QFT d . Though such a point of view is not surprising, its systematic study, to the best of author's knowledge, has not appeared in the literature. Also, very importantly, this approach holds more generally than special cases of gluing that appeared previously throughout the literature, such as, e.g., "gluing by gauging". 4 We address the question of symmetries in QFT d−1 , namely, when non-anomalous symmetries of QFT d induce symmetries of QFT d−1 . The answer turns out to be quite elegant and simple, though important for the applications in [29], and is called The Main Lemma in section 2.3. As we will see, the symmetry of QFT d descends to QFT d−1 if the two conditions are satisfied: first, this symmetry should preserve the polarization that was used in the definition of QFT d−1 ; second, the states Ψ 1 and Ψ 2 that we want to glue should be annihilated by the corresponding charge. We will prove this for quantum mechanics in the next section. So far, we can simply say that the symmetry should preserve the family of polarized boundary conditions, namely transform one boundary condition into another inside the same family. Under this assumption, the gluing theory acquires a symmetry.
Interesting simplifications might occur in supersymmetric theories. Applying the Main Lemma to supersymmetry shows that whenever the polarization is preserved by SUSY Q of the parent theory QFT d , the gluing theory QFT d−1 describing the convolution of Q-closed states Ψ 1,2 becomes supersymmetric. In certain cases, we can further apply supersymmetric localization and reduce the path integral in (1.7) to a finite dimensional integral over the space of supersymmetric boundary conditions. This allows to derive a number of interesting formulas describing gluing of supersymmetric theories on manifolds with boundary. We call them "the gluing formulas". As was recently shown in [30], such formulas can be quite useful for various problems in SUSY field theories. For example, a certain gluing formula for 3D N = 4 theories on spheres and hemispheres was used in [30] as a tool to describe their quantized Coulomb branches. Such supersymmetric applications of the formalism developed in the current paper are discussed in a companion paper [29]. Speaking more broadly, the general idea of gluing has appeared in multiple references on supersymmetric field theories, see e.g. [31][32][33][34][35][36][37][38][39][40][41][42][43][44][45][46][47].

An important issue that we do not address
Before we proceed, we would like to make a final remark on limitations of our approach. The axioms of functorial QFT, at least in their current form [4], do not apply to generic physically interesting non-topological quantum field theories due to the following known, yet not widely appreciated, fact. General interacting QFT does not have an unambiguous partition function on a general curved manifold. The number we call a "partition function" depends on the "renormalization scheme", which is usually diagnosed by the presence of finite background gravity counterterms [48]. In certain cases, this problem can be alleviated 4 This refers to the following: gluing along W with the Dirichlet boundary conditions on the two sides is done by gauging diag(G×G), where G is the global part of gauge transformations preserved by the Dirichlet boundary condition. Such prescription only works in pure gauge theories, because in this case QFT d−1 is a theory of a single gauge field. For more general gauge theories, QFT d−1 would also include various matter fields. Gluing in the presence of matter is often done in the literature by adding boundary potentials.

JHEP04(2020)175
by interpreting partition function as a section of some bundle: while the numeric value depends on the trivialization of the latter, it still makes sense as a global geometric object. However, such special cases are not generic in the space of QFTs, and do not solve the problem in general.
The best known example of this issue comes from the study of sphere partition functions in two and four dimensions [48]. For 2d N = (2, 2) and 4d N = 2 SCFTs, the sphere partition function is known to compute the Kähler potential on the superconformal manifold, which in general admits an interpretation as a section of a bundle due to the Kähler transformation ambiguities. Less supersymmetric sphere partition functions in 2d and 4d, however, do not even admit such an interpretation, -they are truly ambiguous. Such ambiguities are clearly generic, and therefore require modifications to the axioms of functorial QFT. The modification will presumably involve incorporating the regularization/renormalization scheme data into the definition, perhaps using the ideas similar to those of [49]. In the current work, we completely ignore this issue, and proceed under the assumption that the unambiguous answer exists. It is an important first approximation to the general case, and also it is justifiable by the applications we discuss in part two [29], which all admit unambiguous partition functions due to extra symmetries.

The structure of this paper
The structure of this paper is as follows. In section 2 we start by describing the gluing formalism for the simplest case of Quantum Mechanics. We review some basic notions of geometric quantization, such as polarization, and show explicitly how this leads to the gluing theory (which is a zero-dimensional QFT in this case). We then prove that every symmetry of the parent theory (quantum mechanics in this case) that preserves polarization and the two boundary states descends to the symmetry of the gluing theory. Thinking of QFT d on W d−1 ×R as a quantum mechanics R → Fields[W d−1 ], we extend the statements in section 2 to the case of higher-dimensional quantum field theories (modulo caveats related to regularization as mentioned in sections 1.

Quantum mechanics
The simplest case in which the gluing problem can be formulated, in the sense that both QFT d and QFT d−1 exist, is that of quantum mechanics, i.e., when d = 1. On the one hand, this is expected to be a useful theoretical laboratory where we can explicitly answer many questions which are less accessible in higher-dimensional quantum field theories. On the other hand, quantum mechanics serves as a model example for higher-dimensional problems. Indeed, if we study gluing in d dimensions, then close to the boundary component W ⊂ ∂M , M looks like W × R. Interpreting R as the time direction, one can think of QFT d as a quantum mechanical sigma model with the infinite dimensional target (configuration space) given by the space of fields on W , denoted Fields [W ]. From this point of JHEP04(2020)175 view, passing from quantum mechanics to higher-dimensional quantum field theories corresponds to passing from finite-dimensional to infinite-dimensional configuration spaces. We know from our experience with quantum field theories that finite-dimensional models often capture the essential phenomena. The only new things that come with increased "infinite-dimensionality" are regularization and renormalization, as well as a possibility of new anomalies. As we will argue later, under the assumption that QFT d is anomaly-free and properly renormalized, the associated gluing theory QFT d−1 is automatically welldefined. Therefore, we expect to be able to capture all essential features of gluing already at the level of quantum mechanics.
In what follows, we will briefly review some relevant notions from geometric quantization (see [50] for a detailed review), and then proceed to describe boundary conditions, boundary terms, and gluing in the path integral formulation of quantum mechanics. The reason that we have to work with path integrals is that this is an essential ingredient in the physical understanding of higher-dimensional QFTs, even though in d = 1 it could be completely bypassed. After that we will comment on how gluing works in gauge theories, i.e., constrained Hamiltonian systems with the first class constraints. Finally, we will comment on the analytic continuation relevant for connecting the Lorentzian and Euclidean time wave functions: while trivial in the "position representation", it becomes important when we work with more general polarizations, such as the "momentum representation".

Polarization and geometric quantization
Quantum mechanical systems are often associated with quantization of some 2mdimensional symplectic manifold (X, ω). A quantization produces (in a non-canonical way) from (X, ω) an algebra of quantum observables, which is a non-commutative deformation of C ∞ (X), as well as its representation on a topological vector space H ("the Hilbert space") equipped with the appropriate Hermitian inner product. One often picks a special observable H -the Hamiltonian -which generates temporal evolution.
As an additional layer of structure, one can associate a special state ψ L ∈ H to each Lagrangian submanifold of (X, ω). Lagrangian submanifolds are locally defined by m = 1 2 dim X independent equations that Poisson-commute with each other (with respect to Poisson brackets associated to ω), and so at the quantum level they correspond to a common eigenstate of a maximal set of mutually commuting operators. This common eigenstate is ψ L . (We do not discuss its properties any further.) All these ideas can be made explicit in geometric quantization, which provides a concrete realization of the quantization procedure. Since there is no canonical quantization, any possible construction should take some arbitrary choice as an input data. For geometric quantization, the main such choice is a polarization of (X, ω).
Any symplectic manifold can be locally written, in the Darboux coordinates, as R 2m with coordinates (q i , p i ), i = 1 . . . m, and the symplectic form ω = i dp i ∧ dq i . When we can do this globally, we are in the simplest situation of "canonical quantization", 5 where JHEP04(2020)175 states are described as square-integrable functions of q i only, and quantum observables are constructed from q i and p i , where the latter acts as −i∂/∂q i on states. The wave functions depending only on q i can be characterized as living in the kernel of ∂/∂p i , i = 1 . . . m. When it is not possible to choose Darboux coordinates globally, or we do not wish to do so, one has to proceed differently. First of all, instead of considering functions, one generally studies sections of a certain line bundle L on X (a prequantization bundle). Second, one equips this bundle with a connection ∇ (whose curvature is ω/2π) and demands that all sections representing physical states are annihilated by ∇ P , where P is a set of vectors analogous to ∂/∂p i . One has to choose such vectors in tangent spaces to every point of X. They have to satisfy a certain consistency condition, meaning that such vectors at the adjacent points of X are not completely independent. This choice of P is called polarization, and the precise definition is as follows. A complex polarization is a choice of a complex distribution P ⊂ T C X = T X ⊗ C which satisfies the following conditions: 6 • For each p ∈ X, P p ⊂ T p X ⊗ C is Lagrangian, i.e. ω(u, v) = 0, ∀u, v ∈ P p and dim C P = m = 1 2 dim X.
• P ∩ P has constant dimension throughout X, where P is a complex conjugate of P.
In fact, this P ∩ P = D C is a complexification of a certain real distribution D ⊂ T X (and P + P = E C is a complexification of another real distribution usually denoted E ⊂ T X). Integrability of P implies integrability of D. Then D, by Frobenius theorem, can be integrated to define a foliation of X by leaves of this distribution -submanifolds whose tangent spaces coincide with D at every point. These leaves are isotropic submanifolds, meaning that symplectic form ω vanishes when restricted to any leaf. The space of such leaves is denoted X/D. The geometric quantization construction describes physical states as half-densities on X/D with values in the prequantization bundle. One important particular case is the real polarization, which is defined by demanding that: In this situation, D is a middle-dimensional real distribution, and by integrating it we get a foliation of X by Lagrangian submanifolds. If we denote coordinates on the space of leaves X/D by x, we can formally consider states |x labeled by Lagrangian submanifolds (only formally, because such states are not square-integrable in general, and should be understood in terms of projection operators x∈some region dx |x x|, as is always the case for continuous spectra). Then any wave function ψ(x) is formally thought of as x|ψ with ψ ∈ H, and we have the unitary evolution kernel:

JHEP04(2020)175
As we will discuss in the next subsection, such Lagrangian submanifolds labeled by x should be used as boundary conditions in the path integral formulation. Another useful polarization is the holomorphic polarization: the distribution P is generated by all (anti-)holomorphic vector fields on X; it exists and plays important role when X is Kähler, and it satisfies: Since D = 0, in this case X/D = X itself. The holomorphic polarization played a remarkable role in the study of Chern-Simons theory and 2d CFT [51][52][53].
One can also consider more general complex polarizations, such as when D C = P ∩ P is non-trivial but not maximal, i.e., leaves of D are isotropic but not Lagrangian submanifolds. In this paper we are not going to study these, neither will we consider holomorphic polarizations. Our main focus will be on real polarizations, even though we will make some comments on complex polarization at the end. It would be interesting to understand how to extend the gluing formalism of this paper to the case of complex polarizations. To be more precise, it is of course possible to glue using complex polarizations (one has to be careful with analytic continuation and integration cycles in the path integral); what is not clear, though, is whether such gluing can preserve symmetries of QFT d in a manner similar to how gluing based on real polarization does in the current paper.

Path integral description and polarized boundary conditions
Our main task in the present paper is to understand gluing of quantum fields theories in the path integral formalism. It is natural to address this sort of questions using the phase space path integral. The reason is that in the phase space description, equations of motion involve only first order derivatives, hence boundary conditions do not involve any derivatives at all and are simply given by submanifolds of the phase space X.
It is well-known that boundary conditions that have a good quantum interpretation are given by Lagrangian submanifolds of X. This is also where one makes contact with the formalism reviewed in the previous subsection. Namely, suppose we fix some real polarization P = D C of X and integrate it to a foliation of X by Lagrangian submanifolds. The space of leaves X/D is the space of "position variables", and suppose we pick two points x, y ∈ X/D. They are represented by Lagrangian submanifolds L x and L y . In the phase space path integral, in order to evaluate the transition amplitude like (2.2) between the points x and y, we integrate over all paths on X that start somewhere on L x and end on L y , as shown in the figure 2.
In order to have a slightly more concrete description of the quantum states, instead of working with the quotient space X/D, we could pick another Lagrangian submanifold, call it L ⊥ , transversal to the polarization. Points of this submanifold represent equivalence classes of the quotient X/D, and quantum states can be described as half-densities on L ⊥ . (See figure 2.) Indeed, in geometric quantization, physical states are covariantly constant along the leaves of D, and so they are uniquely determined by their restriction to L ⊥ .
To write the action in the phase space path integral, we proceed as follows. First, note that locally it is possible to pick such Darboux coordinates (q i , p i ) that polarization is gener-JHEP04(2020)175 Figure 2. Orange curves represent foliation of X by Lagrangian submanifolds corresponding to a given real polarization P. Blue curve is a trajectory starting at L x and ending at L y ; we integrate over such trajectories. Green curve represents a Lagrangian submanifold L ⊥ that is transverse to the polarization; it might be convenient to think of physical states written in polarization P as half-densities on L ⊥ . ated by the vector fields ∂/∂p i . Then leaves of D have constant q i and are parametrized by p i . The submanifold L ⊥ in such coordinates is then determined by p i = W i (q). Demanding that it is Lagrangian actually implies that W i (q) = ∂ i W (q), i.e., we have: We can further define another coordinate system: These are also Darboux coordinates, meaning that ω = i dP i ∧ dQ i . Furthermore, the polarization is still generated by the vector fields ∂/∂P i . One simplification is that now the manifold L ⊥ is given by: When working in such a coordinate system, the phase space action (in Minkowski time) takes the well-known form: The first term here is the integral of a local one-form: which is known as the symplectic potential, and it also plays a role of the local connection one-form on the prequantization line bundle in the geometric quantization formalism.

JHEP04(2020)175
Therefore, the first term in the phase space action is almost universal and is given by: where γ ⊂ X is the trajectory in the phase space. Here we are ignoring any possible issues related to the global topology of X, and essentially assuming that θ can be written globally. This is the case in all applications discussed later in this paper, however, it would be interesting to understand global properties too. In all examples we study, the phase space X is a total space of the cotangent bundle T * Y to the configuration space Y , and so θ is (cohomologous to) the canonical one-form of T * Y . The reason we called (2.9) "almost universal" is that this term is not completely unique. The main property of θ is that locally dθ = ω, and this property is preserved under θ → θ + dF , which are gauge transformations of the prequantization bundle. If γ : [0, 1] → X, this freedom gives rise to: However, in the action (2.7), there is no such freedom, and for a very good reason: adding "boundary terms" F γ(1) γ(0) at the endpoints of γ corresponds to changing the allowed boundary conditions in the phase space path integral. Let us understand this more precisely.
Already from the way the path integral formulation is usually "derived" from the operator approach (by inserting the decomposition of identity multiple times, either in the form 1 = |Q dQ Q| or 1 = |P dP P |), it is clear that the action (2.7) assumes boundary conditions fixing Q at the endpoints of γ. It is also known (for example from the Fourier transform) that if we wish to fix P i at the endpoints, we should write the action in a different form, namely: which differs from (2.7) by the boundary term −P i Q i γ(1) γ(0) . More general boundary conditions given by more general Lagrangian submanifolds give rise to more general boundary terms.
One possible way to understand the need for boundary terms is by looking at the equations of motion. In order for the path integral to have a good saddle-point approximation, the boundary conditions should be picked in such a way that classical equations of motions admit a unique solution. Then expanding around the classical trajectory provides a well-defined saddle point approximation. Taking variation of the Minkowski signature action (2.7) gives: We see that this yields standard Hamiltonian equations of motion only under the assumption that P i δQ i vanishes at the endpoints. For this to vanish, one should either have P i = 0

JHEP04(2020)175
or δQ i = 0. The former gives an isolated boundary condition that we are not interested in. The latter, on the other hand, gives a family of boundary conditions parametrized by the fixed value of Q i at the boundary, and this is the boundary condition which allows to calculate the transition amplitude Q = x 1 |e −itH |Q = x 2 . Therefore, we say that the action written in the form (2.7) is associated with the family of boundary conditions fixing Q i at the boundary, or the position-based polarization. In the same manner, varying (2.11) would produce a boundary variation −Q i δP i , which vanishes for a family of boundary conditions characterized by a fixed value of P i at the boundary. Similarly, we discard an isolated boundary condition Q i = 0 in this case. (Notice that these isolated boundary conditions that we discard are simply those for which the boundary term −P i Q i from (2.11) vanishes.) To account for more general boundary conditions given by some Lagrangian submanifolds L 0 and L 1 at the endpoints of γ, we would have to add boundary terms (or "boundary corrections" as we will call them later) F 0 (Q, P ) and F 1 (Q, P ) to the action (2.7), so that the variational problem becomes consistent with L 0 and L 1 . This is expressed as: so that the path integral: acquires a well-defined saddle-point approximation. However, requirements (2.13) do not determine F 0,1 uniquely, only up to an arbitrary function that is constant along L 0,1 . This is clear already from (2.7): we could add arbitrary functions of Q, denoted F (Q), at the endpoints of γ, and because Q is fixed there, it would not affect the variational problem. It corresponds to multiplying a wave function by e iF (Q) , and is simply a gauge transformation of the prequantization bundle. Suppose that we have added such boundary terms, say F (Q) γ(1) − F (Q) γ(0) . We could absorb them into the symplectic potential as follows: However, the L ⊥ submanifold given by P i = 0 would be described by the equation: What this discussion implies is that if we pick the submanifold L ⊥ and fix the coordinate system in such a way that L ⊥ is locally given by P i = 0, (in addition to the polarization being generated by ∂/∂P i ,) this removes the freedom of adding arbitrary boundary terms F (Q).

JHEP04(2020)175
To be more precise, if we have chosen Darboux coordinates (P i , Q i ) such that polarization is generated by ∂/∂P i and a transversal Lagrangian submanifold L ⊥ is determined by P i = 0, we still have a remaining freedom to perform a further coordinate change preserving all these conditions. Namely, we could perform a diffeomorphism: One can check that this is indeed a symplectomorphism, i.e., i dP i ∧ dQ i = i dy i ∧ dx i , that the polarization is now generated by ∂/∂y i , and that the submanifold L ⊥ is given by y i = 0. However, this symplectomorphism also preserves the canonical form of the symplectic potential: The latter means that it does not introduce any further ambiguity in the symplectic potential, which is uniquely fixed once we pick a polarization and a transversal submanifold L ⊥ . Actually, this fact can be understood in a more invariant way, without using coordinates explicitly, as follows. By picking a polarization and L ⊥ , we describe X locally as T * L ⊥ with the canonical symplectic structure and polarization along fibers, and any cotangent bundle has the canonical choice of the symplectic potential, which is the one we are using. The remaining freedom to perform symplectomorphisms preserving both L ⊥ and the polarization also preserves the symplectic potential. Therefore, to summarize, if we pick a polarization P and a transversal Lagrangian submanifold L ⊥ , this allows to make a canonical choice of the symplectic potential since locally X is symplectomorphic to T * L ⊥ . For that, we pick Darboux coordinates (P i , Q i ) in which P is generated by ∂/∂P i and L ⊥ is determined by the equations P i = 0, and in any such coordinate system define: If we start with an arbitrary coordinate system and make an arbitrary choice of θ, it might differ from θ 0 by a total derivative: (2.20) and this F , evaluated at the endpoints of the phase space trajectory, must be added to the action γ (θ −Hdt) to make it consistent with the boundary conditions given by Lagrangian leaves of P. Notice that now F is determined uniquely up to a constant.
To be completely general, we might be willing to write the "in" and "out" states of the path integral in different polarizations. Namely, we could be dealing with the two different polarizations P 0 and P 1 , and use Lagrangian leaves of P 0 as boundary conditions at t = 0, while Lagrangian leaves of P 1 could be taken as boundary conditions at t = 1. This is perfectly consistent with the above discussion, the only difference being that the boundary JHEP04(2020)175 corrections F 0 and F 1 for the two endpoints would have to be determined separately using the described procedure. In the end, we arrive at the expression: where now F 0,1 are determined uniquely up to a constant. This ambiguity is harmless and corresponds to the ambiguity of multiplying wave functions by a constant phase.
To emphasize the important notion of boundary conditions given by Lagrangian leaves of a chosen real polarization, we use a special name for it: Definition. For a given real polarization P = D C , boundary conditions determined by Lagrangian integral submanifolds for D are called polarized boundary conditions.

A remark on choices
One way to understand the need to pick L ⊥ in order to write an unambiguous phase space path integral is as follows. When we pass from the operator formalism (say, developed based on the geometric quantization techniques,) to the path integral description, we usually discretize time and insert identity in the form |q dq q| and |p dp p| multiple times. To do this, we actually have to choose two complementary polarizations, one called P, with the leaves labeled by q, and another called P ⊥ , with the leaves labeled by p. The quantum states formally associated to Lagrangian leaves of P are given by |q (modulo usual technicalities associated with the continuum spectrum), while those for P ⊥ are called |p . Then L ⊥ is simply one of the leaves of P ⊥ , the most convenient choice being p = 0.

Gluing and symmetry
The main lesson of subsection 2.2 is that, in general, if space-time has a boundary, then boundary terms have to be included in the path integral, like in (2.21). Moreover, the precise form of boundary terms is determined by the choice of polarization used for the description of quantum states. Boundary terms also become important once we start to act with symmetries, as we will see soon.
Let us now address the question of gluing. Suppose we have a state vector |ψ 1 and a covector ψ 2 |. We might think of |ψ 1 as living at the endpoint of an interval I 1 and representing the result of some quantum dynamics taking place inside the interval. Similarly ψ 2 | lives at the endpoint of I 2 . We think of |ψ 1 as living on a positively oriented endpoint (the "output") of the first interval, and ψ 2 | as living on a negatively oriented endpoint (the "input") of the second interval. As we know, we can glue the two intervals together by simply computing ψ 2 |ψ 1 . To write this sewing procedure explicitly, we pick a real polarization on X, choose a coordinate x on its space of leaves X/D (which we identify with L ⊥ ), and describe both states in terms of this polarization as x|ψ 1 and ψ 2 |x : This is the most standard quantum-mechanical fact, except that we choose to formulate it in terms of an arbitrary polarization. Now let us address the following question: when JHEP04(2020)175 does a symmetry of the original theory induce a symmetry of the integral in (2.22) (which can be considered as a zero-dimensional QFT)? At the very least, this symmetry must act on (2.22), meaning that it should transform x variables into x variables, without mixing them with other directions of the phase space. Since x parametrizes the space of leaves X/D, this means that the symmetry should act on this space, transforming one Lagrangian leaf into another. The latter means that it transforms any tangent space to a Lagrangian leaf to another such space, which can be simply reformulated as a condition that the symmetry preserves polarization. If our symmetry is generated by Φ ∈ C ∞ (X), and the corresponding vector field is: where ω −1 is the Poisson structure, then the condition that it preserves polarization P is: where [·, ·] is the commutator of vector fields. If we pick, as usual, local Darboux coordinates (P i , Q i ) in which P is generated by ∂/∂P i , then the generator of the most general symmetry that preserves P can be written in such coordinates as: which corresponds to the vector field: This follows immediately from the fact that the coefficient of ∂/∂Q i in V Φ equals −∂Φ/∂P i , and it should be some P i -independent function f i (Q) in order for [V Φ , P] ⊂ P to hold. This then integrates to (2.25). Now let us understand how this symmetry acts on the gluing formula (2.22). It is somewhat instructive to see how it works in the path integral formalism, however the related discussion is slightly technical, and for this reason it is presented in appendix A. Here we provide a shortcut argument. We are going to claim that Φ becomes a symmetry of (2.22) if the states ψ 1 and ψ 2 are annihilated by the corresponding quantum generator Φ. Let us resolve ordering ambiguity in a way that makes Φ Hermitian (final conclusion does not depend on this choice): where P i acts by −i∂/∂Q i ≡ −i∂ i . We also identify x = Q, where x is the coordinate on the space of leaves X/D ∼ = L ⊥ . We have: 28) or, by writing (1 + i Φ)|ψ 1 = |ψ 1 and assuming is infinitesimal, this can be expressed as:

JHEP04(2020)175
Analogously, when acting on the left: which is written infinitesimally as: Altogether, this implies: Now let us perform a diffeomorphism in the gluing integral (2.22). The measure dx will produce a Jacobian factor 1 + ( is still assumed to be infinitesimal). Then we obtain: where in the last equality we used (2.32). This line of reasoning proves: The Main Lemma. The gluing integral (2.22), considered as a zero-dimensional QFT, has a symmetry (2.33) provided that the states ψ 1 and ψ 2 are Φ-invariant, and V Φ preserves polarization P on the phase space.

Anomaly inflow
A slightly more accurate way to prove the above Lemma would be to consider half-densities ρ(ψ 1 ) = x|ψ 1 √ dx and ρ(ψ 2 ) = ψ 2 |x √ dx, rather than separate dx from the wavefunctions. The reason is that states are more naturally described by half-densities, as we know from the geometric quantization formalism. Such a point of view would also eliminate the logical step where we had to "cancel" the Jacobian factor e ∂ i f i (x) against the similar one coming from the integrand ψ 2 |x x|ψ 1 . Moreover, only the total density ρ(ψ 2 )ρ(ψ 1 ) has a chance of being generalizable to higher-dimensions, where the finite integral (2.22) would be replaced by a path integral, whereas generalizing dx separately to the "measure" Dφ is usually an ill defined step.
Nevertheless, there is a certain value in proving the Lemma in the way we did, even though it was slightly "unnatural". The reason is that it provides a simple illustration of the anomaly inflow mechanism. Indeed, if we wanted to consider the measure dx separately and use it to build a zero-dimensional QFT with some action S(x) invariant under (2.33), such a theory would not posses this symmetry in general, simply because the measure dx is not invariant, unless ∂ i f i (x) vanishes. However, in the gluing theory (2.22), the bulk contribution ψ 2 |x x|ψ 1 is similarly non-invariant and cancels the ∂ i f i (x) term coming from the measure. In this sense, it can be regarded as an example of the anomaly inflow.

JHEP04(2020)175
The way it works in higher dimensions is exactly the same: once we know that the d-dimensional theory is non-anomalous, so is the (d − 1)-dimensional gluing theory, even if the field content and symmetries look like it could be anomalous. One example will be gluing of 3D gauge theories with fermionic matter using the chiral polarization discussed in section 3.4: the gluing theory will be a 2D gauge theory with chiral fermions. Such a theory would usually be inconsistent due to gauge anomalies, however it makes perfect sense as a gluing theory thanks to the anomaly inflow from the bulk.
Furthermore, in section 3.5 we will give a simple example of gluing where the gluing theory appears to have a Z 2 global anomaly. Nevertheless, consistency of the parent theory implies that the global anomaly should be canceled by a similar Z 2 non-invariance of the bulk contribution. Strictly speaking, this type of anomaly is not covered by the above quantum-mechanical derivation, which only applies to local anomalies. Nevertheless, we still claim that it should cancel, simply because the parent theory is consistent and local, and thus the gluing property should hold.

Gauge theories
Discussion in the previous section is quite general: even though we ignore global issues related to possible non-trivial topology of the phase space, it always applies locally, and the final conclusion about gluing should hold generally. In particular, it applies to gauge theories if we properly perform gauge fixing first.
The modern way to do this at the highest level of generality is by applying the BV formalism: introducing additional fields and modifying the action, one trades gauge symmetry for the global odd BRST symmetry generated by Q B . More precisely, since we are interested in manifolds with boundary, one should use the BV-BFV formalism of [15][16][17][18][19][20][21] that was already mentioned in the introduction. In this case, Q B corresponds to an odd vector field in the extended phase space. Since it generates the global symmetry, we can simply apply our previous results and determine when it induces symmetry in the gluing theory. Every physical state is Q B -closed, hence if the polarization is also Q B -invariant, the gluing theory acquires an induced odd symmetry Q B . This Q B is the BV-BRST charge of the gluing theory, hence the gluing theory must be a gauge theory as well.
Unfortunately, this argument is not constructive. Furthermore, we are not going to discuss the BV-BFV formalism here -interested readers should consult the above references. Instead, much in the spirit of the rest of this paper, we take a more simply-minded approach, which makes sense in finite-dimensional cases. It will provide us with a simple and intuitive geometric picture for why the gluing theory is a gauge theory. Instead of fixing gauge, we describe gluing in a gauge-covariant way, such that the gluing theory has a manifest gauge symmetry.
From the canonical formalism point of view, gauge theories are constrained Hamiltonian systems with the first class constraints. 7 Suppose that we start with a symplectic manifold (N, ω) -the total phase space -and have a set of first class constraints defined on it:

JHEP04(2020)175
The fact that they are first class is usually expressed as: where {·, ·} is a Poisson bracket, and C k ij ∈ C ∞ (N ). The constraint surface is: Then, as a consequence of (2.36): Let V i denote Hamiltonian vector fields associated to φ i , i.e., dφ i + ι V i ω = 0. The above equation means that on C, they are tangent to C. These vector fields on C, equipped with their commutator as a Lie bracket, form a Lie algebra g -the algebra of gauge transformations, which exponentiates to the group of gauge transformations 8 G. By taking quotient, we get the physical phase space of the theory: This is nothing else but the standard symplectic reduction, with constraints φ i defining the moment map. The manifold X inherits symplectic structure in a canonical way (due to the Marsden-Weinstein theorem). The pullback of this symplectic structure from X to C with respect to the canonical projection, coincides with the symplectic structure of N restricted to C, i.e., ω| C . This ω| C is a closed two-form, but it is degenerate on C of course: all V i span its kernel. Boundary conditions for the theory with the phase space X are given, as usual, by Lagrangian submanifolds L ⊂ X. These submanifolds lift to the maximal isotropic submanifolds L of C (with respect to ω| C ), and under the further embedding L ⊂ C ⊂ N , they are Lagrangian submanifolds of N invariant under the gauge group action.
Suppose we have fixed a real polarization P on X and are studying the path integral for this theory that produces some boundary state written in terms of this polarization. According to the formalism described in earlier sections, for a given choice of symplectic potential θ, there is a canonical choice of the boundary term (up to a constant), and the path integral is given, say, by: where only at t = 0 we have explicitly specified a polarized boundary condition given by some Lagrangian submanifold L coinciding with one of the leaves of polarization P, and F (0) is the corresponding boundary term.

JHEP04(2020)175
Now we can pull θ back to C, i.e., consider pr * θ instead of θ. H, being a function on X = C/G, lifts to a G-invariant function on C. Therefore, in the above path integral, instead of integrating over trajectories in X, we could integrate over trajectories in C. This, of course, introduces a lot of unphysical freedom: every trajectory can be wiggled arbitrarily in the direction of G orbits without changing the action. In other words, if we integrate over trajectories into C, the above phase space path integral has gauge redundancies. This is the original gauge theory in a "gauge-unfixed" form. One has to fix gauge redundancies, and of course we know how to do this: the non-redundant, i.e. gauge-fixed, path integral goes over trajectories into X, not C.
What this discussion gives us is the following. The path integral over trajectories into X produces the boundary state ψ that can be described as a half-density ρ(ψ) (or sectionvalued half-density) on some Lagrangian submanifold L ⊥ , transversal to the polarization P on X. Instead, we could take a gauge-unfixed perspective, and extend this Lagrangian L ⊥ to a maximal isotropic submanifold L ⊥ ⊂ C. Then the boundary state generated by the path integral would extend to a G-invariant half-density ρ( ψ) on this L ⊥ .
As we glue states, we could either use ψ or ψ. In the former case, we simply write: and this is obviously correct as it originates from the quantization of the physical phase space. In the latter case, when we use ψ, the gluing could be naively expressed as: but this integral has a gauge symmetry that has to be further fixed: G acts on L ⊥ , and the integrand is G-invariant. Recalling that G is the group of gauge transformations generated by constraints, it is clear how to modify (2.43) to put it in agreement with (2.42), at least formally: To recapitulate, this is useful in gauge theories, where the boundary states are gaugeinvariant due to the Gauss law constraint, and we find that the gluing theory itself has a gauge symmetry. 9 If the theory is a pure gauge theory and we use Dirichlet polarization, our prescription reduces to the following recipe found in the literature: "Dirichlet boundary conditions break gauge symmetry at the boundary, leaving the leftover global symmetry G there; gluing can be performed via gauging the diagonal of G × G by adding the gauge multiplets that couple dynamics on the two sides of the gluing surface." (This procedure has been formulated in various ways, see e.g. [31][32][33].) Our discussion puts this into a more general perspective of cutting/gluing with symmetries, as well as provides generalizations. We will have some simple examples of the latter soon. Also, as we will learn in JHEP04(2020)175 the applications of [29], we often have more than just gauge fields (or multiplets) at the gluing surface.
Note that here we started from gluing in the gauge-fixed theory with the phase space X and, by lifting from X to C, recovered the gauge-unfixed version of the procedure. A polarization on X got lifted to a gauge-invariant distribution on C. In all practical examples, however, we will not have the gauge-fixed version available as an input. Therefore, in order for the gluing to work, it is important to pick a gauge-invariant distribution on C, so that it descends to a polarization on the quotient space X. In all examples, it will be quite clear how to make the corresponding choice, and we will refer to this gauge-invariant distribution (describing polarization after gauge-fixing) as a polarization as well. More details will be provided as we discuss an example in section 3.3.

Analytic continuation and the space-time signature
So far we have been working in Lorentzian time. For applications to higher-dimensional theories, it is also necessary to understand the case of Euclidean signature because a lot of higher-dimensional manifolds do not admit pseudo-Riemannian metrics. As a result of this, and because gluing procedure is most naturally formulated in Lorentzian signature, gluing of Euclidean QFTs, in general, will involve certain analytic continuation. The goal of this subsection is to explain this property at the level of quantum mechanics, which will later prove useful in our concrete applications to higher-dimensional QFTs.
Because in all higher-dimensional examples that we consider, the phase space is a cotangent bundle to another manifold, we will focus on this case for now: 10 X = T * Y. (2.45) Once we pick some local coordinates q i on the base Y , they generate a basis dq i in the fiber, and the corresponding coordinates in the fiber are denoted by p i , as usual. The canonical symplectic potential on X in these coordinates takes the well-known form: We are going to specialize even more and consider Hamiltonians that are at most quadratic in p i , again because all our examples are going to be of this sort: where g ij (q) is a non-degenerate matrix. The standard Lorentzian time action in the Hamiltonian formalism, designed for the boundary conditions fixing q at the endpoints, as 10 This holds globally for the simplest bosonic theories based on the second order Lagrangian, in which case Y is the configuration space. It also holds globally for the standard first order fermionic actions, in which case one can pick half of the fermions that determine polarization to parametrize an odd space Y , while the rest will define odd fibers of T * Y . This statement becomes less obvious for gauge theories, but still holds for those based on the Yang-Mills action. It definitely fails globally for theories based on the first order bosonic actions such as the Chern-Simons theory, in which case the phase space is not of the form T * Y globally. Hence any global statements made specifically for T * Y should not be expected to hold immediately for the first order theories like Chern-Simons.

JHEP04(2020)175
we know, is: Integrating out p gives it the on-shell value: where g ij is the inverse matrix of g ij . This is the textbook way to recover the Lagrangian description which reads: What changes upon Wick rotation? The first order action in Euclidean time is: and the on-shell expression for p acquires a factor of i in front ofq i : so that integrating out p gives a Euclidean time second order action: We see that the reality condition of p got modified on shell: which is totally fine at this point: we can still keep p real in the phase space path integral, and it acquires a complex value only on shell. We find the usual Euclidean action in this way. However, if we wish to apply the standard saddle-point reasoning to the second order Euclidean action and expand it around the classical solution, we encounter a small problem: equations of motion following from this action are complex because of "i" in front of the second term in the action (coupling to the magnetic potential a i (q)). In principle, this is not terrible, saddle points in the complex Gaussian integrals often turn out to be outside the integration cycle, but we can do slightly better by analytically continuing the magnetic field. Namely, consider a slightly modified Euclidean action: where s is now a real parameter. This action gives real EOMs with some real solution, and we can, in principle, expand around such a real saddle and compute the path integral. In the answer, we then have to go back to imaginary s:

JHEP04(2020)175
in order to recover the correct answer for the initial Euclidean action S E = S E (s = i). This might seem as an unnecessary complication, but it will in fact be helpful in a moment. Let us now see what happens if we choose to start from the first order action with the boundary terms included. For concreteness, we include boundary terms that make it consistent to fix p i at the endpoints. The corresponding Lorentzian time first order action is: and we impose p(0) = p (1) , p(T ) = p (2) . Integrating out p produces a second order action with the boundary terms: (2.58) It is easy to check, by looking at the boundary contribution in the equations of motion, that this action is consistent with the boundary conditions: This illustrates that the general boundary conditions in the phase space path integral with corresponding boundary corrections included have their counterpart in the configuration space path integral, with the corresponding boundary corrections included.
Let us see how this works in Euclidean time. Wick rotating the phase space action gives: After integrating out p, we obtain the configuration space Euclidean action: i q i (T ) If we look at the boundary conditions that are induced by the boundary terms in this action, they take the form:q This is unsatisfactory: if p (1,2) i are real, the boundary conditions violate reality of q i . Such boundary condition are simply inconsistent in the Euclidean path integral over real functions q i (τ ). This is of course similar to what we encountered a moment ago, because equations of motion are also complex due to the magnetic field coupling ia i (q)q i .

JHEP04(2020)175
It is clear how to resolve this issue: in addition to replacing ia i (q)q i by sa i (q)q i with s ∈ R, we have to relax reality of p i at the boundaries, namely replace p (1,2) i by iπ (1,2) i . The modified action reads: Now the EOMs are real, and the boundary conditions are real too: (2.64) After computing the path integral, we have to analytically continue the answer as follows: We can think of the analytic continuation of p i in terms of the original phase space X = T * Y as first enlarging the space by complexifying the fibers of T * Y : and then picking a different real cycle in each fiber. In this way, instead of the original X ⊂ X given by p i ∈ R, we pick a different symplectic submanifold, X E ⊂ X that has the same base Y but p i ∈ iR. What we learn from this discussion is that if we compute the boundary state as a functional of boundary conditions using the Euclidean path integral, rewriting it in the Lorentzian signature might involve performing additional analytic continuation of the arguments of this functional. In fact, the above picture suggests a geometric description of this analytic continuation: if the phase space of the theory (in Lorentzian time) is X = T * Y , we should consider an enlarged space X = T * C Y , which is still equipped with the two-form ω, and its symplectic subspaces X and X E related by the Wick rotation in the fibers of T * Y . If we have a wave function described as a half-density ρ(ψ) on some Lagrangian submanifold L E ⊂ X E , we extend it to a maximal isotropic (with respect to ω) submanifold L ⊂ X, which will intersect X along the Lagrangian submanifold L ⊂ X. In passing from Euclidean to Lorentzian signature, we have to analytically continue ρ(ψ) from L E to L.
In fact, as is also demonstrated in the appendix B for an example of simple harmonic oscillator, one has to perform this analytic continuation to correctly describe gluing of spacetime manifolds. This is because gluing naturally works when the normal direction to the boundary of spacetime has a signature of time. If we forget to analytically continue the boundary state in the way explained above, the gluing integral might end up being divergent, for example.
The procedure of complexification and choosing a different real symplectic slice might remind some readers the work of Gukov and Witten [54]. To make a closer connection, we JHEP04(2020)175 could assume that Y , the base of T * Y , is itself a real locus of some complex Y C . Then we could consider X C = T * (Y C ), a complex symplectic manifold insider of which we pick two different real symplectic slices X and X E . Description of the phase space as a real locus inside some complex symplectic manifold is precisely the framework of [54]. Since in this section we only focused on the case X = T * Y , we did not have to use the full structure of such a complex symplectic manifold: it was only sufficient to complexify the fibers of T * Y . It is conceivable, however, that if we were to study more general symplectic manifolds X, proper understanding of Wick rotation might have involved the full structure of X as a real slice inside of some complex symplectic manifold X C . It would be interesting to further explore this connection.

Elementary illustrative examples
In this section, we are going to describe a few very simple examples of gluing. There is no real novelty in these examples, and the only purpose they serve is to make sure that the reader has the right idea of what was explained in the previous section. Also, as we have already mentioned, the quantum mechanical derivation of gluing from the previous section applies in higher dimensions as well, simply because a QFT on space-time W × R can be thought of as a quantum mechanics on Fields[W ], the infinite dimensional space of fields on W , with R being the time direction. In all examples of this section, we are going to work in Euclidean space-time of general dimension n, remembering about caveats with analytic continuation of boundary wave functions associated to Euclidean signature, as explained in the previous subsection.

Scalar fields
Consider a real scalar field φ on an n-dimensional Riemannian manifold M . The action is: Each v ∈ C ∞ (W ) describes a Lagrangian submanifold in the phase space on W , and taking all possible v, we obtain a foliation of this phase space corresponding to a certain polarization. We refer to it as the Dirichlet polarization. Then the path integral computing the boundary state is simply: Alternatively, we could pick a different polarization, corresponding to the "momentum" representation, and fix ∂ ⊥ φ at the boundary, with the normal direction taken outwards. We might refer to this as the Neumann polarization. In this case we have to include a boundary term in order to obtain a correct representation of the boundary state as explained in earlier sections: The gluing works in a similar way, except that we have to include "−i" in front of p to account for the analytic continuation since Ψ[p] was computed by the Euclidean path integral: Both these examples demonstrate the gluing procedure in the simplest case possible. They do not illustrate the point about symmetries, because the theory is way too simple. Suppose now that we have N real scalar fields, and the potential V (φ) is such that the action has O(N ) symmetry: If we choose the Dirichlet polarization for all fields or, alternatively, the Neumann polarization, in either case we obtain a polarization preserved by O(N ). Therefore, the gluing theories would also have O(N ) symmetry.
On the other hand, if we choose the Dirichlet polarization for the first k fields, φ i , i = 1 . . . k, and the Neumann polarization for the remaining N − k fields, this breaks the O(N ) symmetry. Now the boundary state is given by: Such polarization is preserved only by the O(k) × O(N − k) subgroup, and this is the symmetry of the gluing theory: JHEP04(2020)175

Free fields
Notice that for the free scalars, one can go even further and explicitly evaluate the boundary states Ψ 1 and Ψ 2 as functionals of boundary conditions in terms of the bulk Green functions. These states are given by the exponentials of quadratic non-local functionals, roughly of the . Such computations were performed for the first time for free scalars on Riemann surfaces (in the context of string theory) in [24][25][26][27].

Spinor fields
The next simplest example to look at is the free Dirac spinor whose action is: where λ and λ are independent because we work on a general Euclidean Spin-manifold. Again we consider a boundary component W ⊂ ∂M . Canonical formalism applied to the first order action (3.9) implies that the phase space on W can be parametrized by fields λ W and λ W , whose Poisson brackets are: where δ W is the delta-function on W , and γ ⊥ = γ µ e µ ⊥ is the Dirac gamma matrix in the direction of the unit outward normal to W . We can choose to fix λ at the boundary, in which case the path integral representation of the boundary state is simply: DλD λ e −S , (3.11) and the gluing is done via: Alternatively, we could fix λ at the boundary. This requires including a boundary term in the path integral representation of the state: DλD λ e W λγ ⊥ λ−S , (3.13) and the gluing works in a similar way: (3.14) where one should also note that, unlike in the bosonic case, no factors of i are needed. We could also fix a more general linear combination of λ and λ at the boundary, but it would never involve normal derivatives because the equations of motion for (λ, λ) are of the first order. Generalization to N spinor fields invariant under U(N ) global rotations and the observation how polarization can break it down to various subgroups describing possible symmetries of the gluing theory works in analogy with the scalar field case.

A pure gauge theory
Now let us consider a pure Yang-Mills theory (based on a compact gauge group G) living on M , with the standard action: Applying canonical formalism to this theory is a well-known exercise. Canonical momentum is: This implies a constraint: π 0 = 0, (3.17) that further implies a secondary constraint: 11 These two are the first class constraints; they determine a constraint surface (that we denoted C before) and generate the gauge symmetry acting on it. It is quite common to complete this by the gauge-fixing conditions: The physical Hamiltonian is: 20) and the phase space action is: In the standard Dirichlet polarization, we fix gauge field A i at the boundary W ⊂ ∂M : The boundary state can either be described in a gauge-fixed or in a gauge-invariant way.
In the former case, it is described as a functional of a i defined on a subspace of fields satisfying D i a i = 0. In the latter case, we drop the gauge-fixing condition D i A i = 0 (like in the general discussion of gauge theories in section 2.4), and describe the state by a gauge-invariant functional of an unconstrained a i . Let us make a few remarks about A ⊥ , the normal component of the gauge field close to the boundary. Its most basic property is that it does not carry any physical data, and corresponds ot a purely gauge degree of freedom in the theory. Therefore, the actual JHEP04(2020)175 condition that A ⊥ satisfies at the boundary depends on the gauge-fixing condition that we pick in the bulk.
There are many ways to understand this fact. Most fundamentally, all physical information about the boundary condition is encoded in the state it produces. The boundary state, as a wave functional, only depends on A i , not on A ⊥ , which is also seen from the way we describe the phase space of the gauge theory: we have explained above that the classical description of the phase space involves A 0 = 0, the temporal gauge. In temporal gauge, the gauge field component normal to the spacial slice is zero, which implies that in this description, A ⊥ = 0 is a natural boundary condition. Indeed, it is easy to see that A ⊥ can always be gauged away at the boundary.
On the other hand, it was pointed out recently [55] that if we use Lorenz gauge in the bulk, then by restricting it to the boundary, one finds that This simply shows once again that the actual condition on A ⊥ depends on the gauge. In particular, if needed so for some reason (and especially since we are making contact with the canonical formalism, where the temporal gauge is most natural), we can always assume that we have picked the temporal gauge in the neighborhood of the boundary, and therefore A ⊥ = 0 holds. On the other hand, the gauge choice does not affect the boundary state Ψ[A i ], and hence the gluing procedure we are about to discuss does not depend on the boundary condition on A ⊥ . Quite often, the bulk calculations are most conveniently formulated in the Lorenz gauge. Therefore, for practical purposes of evaluating Ψ[A i ], it is often most useful to choose the Lorenz gauge, in which case A ⊥ would satisfy the Neumann boundary condition.
The boundary state is given by the usual path integral formula (after integrating out π i from the phase space path integral): To glue a state Ψ 1 [a] with the dual state Ψ ∨ 2 [a] on W ⊂ ∂N , we write: which by itself is a gauge theory on W . This is the "gluing by gauging at the boundary" explained in section 2.4. What if instead we choose the Neumann polarization? It means that we would like to impose: In the abelian case, this condition is gauge-invariant. The boundary wave function is simply a functional of this v, and the gluing theory does not have any further gauge symmetries: where the origin of −i is the same as before (the analytic continuation of momenta variables).

JHEP04(2020)175
The non-abelian case is trickier: a boundary condition with generic v breaks gauge symmetry at the boundary to a stabilizer of v. The gluing theory can still be formally written as (3.26), and consistency implies that the integrand of (3.26) is gauge-invariant, with the gauge symmetry being the adjoint action: g ∈ Hom(M, G). (3.27) Each v belongs to a gauge orbit isomorphic to Hom(M, G)/Stab v , and in the end one should perform gauge-fixing and integrate over the space of such orbits in the gluing integral. Note also that to properly generate the boundary state in this case, we have to include the boundary term, and the wave function is given by the following path integral formula: Of course, in order to evaluate this path integral, one has to fully fix gauge in the bulk, but we did not make it explicit in the above equation. The boundary term W A i F ⊥i = W A ∧ * v might appear to violate gauge-invariance. To understand why it does not, let us focus on the abelian case (which is the same as the non-abelian case for generic v, since v then explicitly breaks gauge symmetry at the boundary). Recall that the boundary terms were justified using canonical formalism. For gauge fields, the canonical form of the relevant boundary term is W A ∧ * π, where π i is the canonical momentum. In the gauge-fixed description of the phase space, as outlined above, we have d * W A W = d * W π W = 0, where d W is the exterior derivative along W . This means that the boundary value v should satisfy the constraint: (3.29) By writing V = * v, this constraint simply says d W V = 0. The boundary term then becomes W A ∧ V . If we relax the gauge condition d * W A = 0, the term W A ∧ V clearly remains invariant under small gauge transformations because of d W V = 0. It is not invariant under large gauge transformations shifting A by elements of H 1 (W, Z). The latter would produce a factor of (3.30) in the wave function, where Q : H 1 × H d−2 → R is the intersection pairing, and d − 1 = dim W . It would be quite interesting to explore this type of gluing more.

Free fields
As is always the case, for free fields one can go much further and actually compute the boundary states explicitly. Here we just note that the case of a free Maxwell theory was approached along these lines recently in [28], where they also considered the nonabelian Yang-Mills theory in two dimensions (and made attempts at generalizing to nonabelian theories in arbitrary dimensions, evaluating the boundary state approximately by truncating, in their language, the bulk-boundary interactions).

Gluing by anomalous theory and the inflow
Now we would like to present an example of consistent gluing where the gluing theory appears to have a gauge anomaly. Consider a three-dimensional U(1) gauge theory with N fermions of charge 1, meaning that we have N fields ψ iα i = 1, . . . , N of charge 1 and N fields ψ iα i = 1, . . . , N of charge −1. A part of the kinetic term that determines Poisson brackets of the fermions is given by: It is consistent to choose ψ i1 and ψ i1 as Poisson-commuting variables determining the polarization. Therefore, we choose the boundary conditions for the fermions as: and we notice that from the two-dimensional point of view, these χ i , χ i are chiral fermions.
In addition, we choose the standard Dirichlet polarization for the gauge field, i.e., the boundary condition is: Then the boundary states become functionals of a, χ and χ: so that the gluing of two states is represented by: This is the path integral of the two-dimensional gauge theory whose field content consists of the U(1) gauge field a and N charge-1 chiral fermions χ i , χ i . Such a 2D theory would normally be anomalous due to its unbalanced chiral matter. However, it is well-defined as the gluing theory, with the gauge anomaly canceled by the inflow from the 3D bulk. This cancellation was explicitly shown within the quantum-mechanical approach of the previous section, and we will always assume that once the full (d-dimensional) theory is well-defined and non-anomalous, the ((d − 1)-dimensional) gluing theory is also well-defined, with all apparent anomalies canceled through the inflow from the bulk. In particular, it means that only the full integration measure, , are not gauge invariant as functionals. The latter means that they are not annihilated by the Lie derivative implementing gauge transformations on the space of fields. Note that this does not contradict gauge-invariance of states! Both |Ψ 1 and Ψ 2 | are gauge-invariant as states, in the sense that they are annihilated by the Gauss law constraint. The Gauss law constraint is represented by a certain differential operator acting on the wave functional, which is not the same as the Lie derivative implementing gauge transformations on the space of fields.

Gluing despite global anomaly
Finally, we give an example of gluing in which the gluing theory appears to have a global anomaly.
Consider a 2D U(1) gauge field coupled to a single Dirac fermion of gauge charge 1. Such a theory is completely well-defined. Now suppose we put it on a cylinder S 1 × R, and cut it open along S 1 × {0}. We can then glue it back. By choosing the Dirichlet polarization for the gauge field and a proper gauge-invariant polarization for the fermion, we find that the gluing theory is a 1D U(1) gauge theory on S 1 with one Dirac fermion of gauge charge 1.
Such a 1D theory has a global Z 2 gauge anomaly. More generally, if the fermion has charge N ∈ Z, then the global anomaly is present for odd N . However, we expect the gluing theory to be completely well-defined, simply because the original 2D theory was consistent. Thus we conclude that the full integration measure of the gluing theory, DB Ψ 1 |B B|Ψ 2 , should be gauge-invariant: the bulk contribution ought to cancel the apparent global anomaly on S 1 .

Discussion and future directions
The goal of this paper was to discuss some general properties of the gluing law, which is at the heart of the so-called "Segal's approach" to quantum field theory, or "functorial field theory". We only gave a few trivial examples of gluing, with the purpose to illustrate general statements made earlier in the paper. The main take-home messages are of somewhat conceptual nature and include: the notion of "polarized boundary conditions" for a given polarization on the phase space; understanding that gluing in a Lagrangian theory QFT d is represented as an integral over a space of polarized boundary conditions (which we treat somewhat formally, only focusing on its local geometry); the idea that this gluing integral can be thought of as a QFT d−1 on its own, for which the Main Lemma provides sufficient conditions to acquire a symmetry induced from the symmetry of the parent theory QFT d .
More concrete and less trivial applications of our Main Lemma are discussed in a separate paper [29], where gluing in a supersymmetric QFT d is represented by a supersymmetric QFT d−1 that is solvable by localization.
With bigger goals in mind, we merely scratched the surface of the gluing idea. Moreover, everything said so far only applied to field theories admitting Lagrangian descriptions. While this is an extremely large class of theories a lot of which are well-studied and lead to interesting phenomena in physics and mathematics, there also exists a large number of local field theories of interest that do not have known Lagrangians, and hence cannot be defined using the path integral. Nevertheless, being local implies that they still satisfy the gluing property. It just cannot be formulated as an integral over polarized boundary conditions, simply because there is no obvious semiclassical description.
There is a number of generalizations and further directions related to matters discussed here that would be interesting to address in the future. They include:

JHEP04(2020)175
• Generalizations to manifolds with corners. It is very natural to study objects of all possible codimensions in QFT, and one way they can enter the theory is by making arbitrary cuts that produce corners. For example, if we take an ordinary manifold with boundary and make a cut that goes through the boundary, we create a codimension 2 corner. This is an admissible operation for local QFT d , and a similar gluing property should hold for such more general geometries. However, it would be wrong to expect that one can perform cutting and gluing purely within the "gluing theory" QFT d−1 , simply because it is non-local. Rather, it is a property of the local theory QFT d .
To have a sensible cutting and gluing prescription for manifolds with corners, we should always use local boundary conditions. Then we proceed in the following manner. First, given a manifold M with boundary N = ∂M , we choose some boundary condition at N and treat it as the fixed object -while before we were thinking of N as supporting some state in H N described by a functional of varying boundary conditions, now we refer to N as supporting a brane, which precisely means that we have fixed the boundary condition. Assuming that this boundary condition is local implies that we can perform a further cut of M along a codimension one surface Y , possibly resulting in corners. This Y supports some state, and the space of such states H Y might in principle depend on the boundary conditions we fixed in the previous step. After this, we can "fix a brane" on Y and perform a further cut etc. The gluing is done in the opposite order: at each step we simply integrate over polarized boundary conditions along the gluing surface, with all other boundaries supporting branes.
In this way, we can, at least in principle, describe theories on triangulated manifolds by gluing them from simplices. If M , dim(M ) = n, is triangulated, and M (k) denotes is k-skeleton, we can break gluing into steps according to codimension: first we integrate over boundary conditions at codimension one cells (i.e. at M (n−1) \ M (n−2) ), with boundary conditions having fixed values along M (n−2) , this integration is interpreted as our QFT d−1 ; then we integrate over values of boundary conditions at codimension two cells (i.e. at M (n−2) \ M (n−3) ) with fixed values at the codimension three, this integration is interpreted as QFT d−2 ; then we continue to integrate over values of boundary conditions in codimension three etc.
It would be interesting to exhibit this (or similar) cascade of integrations in some concrete examples, for example in Chern-Simons theory with compact group, where it has a potential to produce a state-integral model. It would also be instructive to follow this procedure for the complex Chern-Simons theory and compare the results with the known state-integral model description studied in a number of papers [56][57][58][59][60][61][62][63][64][65][66][67][68].
• Generalization to complex polarizations. In this paper, mostly for simplicity purposes, we chose to focus on real polarizations. As is well-known, one can quantize in complex polarizations, such as holomorphic polarization that is widely applied for Kähler phase spaces. The gluing procedure can certainly be described in this case too, with the integral going over some middle-dimensional cycle in the appropriate JHEP04(2020)175 space of complex boundary conditions. Precise understanding of this case, and in particular how to extent the Main Lemma to complex gluings, would be quite valuable, because it would allow to derive new representations of gluing that are not covered by the formalism of this and companion paper.
• Broadly speaking, it would be desirable to understand whether it is possible to obtain any concrete results from gluing in non-topological theories outside the context of symmetries discussed in this and companion paper. While supersymmetry of the gluing theory proves to be very useful for writing concrete non-perturbative finitedimensional gluing formulas in [29], it just adds another trick to a number of those already available in SUSY theories. Therefore, generalizations to broader classes of theories would be highly valuable.
• As already mentioned before, the formalism of this paper only applies to a certain class of Lagrangian theories. Strictly speaking, we should only expect it to work, at least in the current form, in renormalizable theories that do not require adding higher-derivative counterterms. It would be interesting to relax any of these restrictions, for example study theories with strongly-interacting UV fixed points (such as five-dimensional gauge theories). Another generalization is to go beyond the twoderivative actions, which would require a more general version of the canonical formalism -the Ostrogradsky formalism. Understanding how much of this can be extended to local effective field theories, which is clearly beyond the scope of the current paper, is also a question of some interest.
• Last but not least, extension to non-Lagrangian theories is in high demand for many topics of current interest. As mentioned earlier in this section, such theories, when they are local, definitely satisfy the gluing law. However, to understand it any better than just a formal inner product on the Hilbert space, one would require a more concrete description of boundary conditions and hence boundary states in non-Lagrangian theories.
There is also a number of potential supersymmetric applications and generalization apart from those addressed in the companion paper; they are listed in the Conclusions section of [29].

A Path integral derivation of the Main Lemma
In this appendix we would like to rederive the statement about symmetries of the gluing theory purely from the path integral point of view. In the main text we have used a more compact argument, but it is somewhat instructive to see how this works in the phase space path integral.
The path integral measure for the phase space formulation is usually written formally as Dy = t Pf [ω (y(t))]. Each factor is the canonical symplectic volume on X and is invariant under symplectomorphisms. We assume that Dy is also invariant in the bulk of the interval (for t > 0), i.e., that the symmetry generated by V Φ (the Hamiltonian vector field for Φ ∈ C ∞ (X)) is non-anomalous in the path integral. 12 However, one should be more careful with the definition of this measure, and in particular with the regularization. In the simplest case of symplectic form i dp i ∧ dq i , the standard definition (and the one following from the connection to operator formulation of quantum mechanics) uses lattice regularization: the time interval [−T, 0] gets discretized into a set of points t n = −T + n N T , n = 0 . . . N . Then one assigns a variable q i (n) to each site t n of the lattice and a variable p (n) i to each interval (t n−1 , t n ). The action is written as: This regularization is known to work well, however it makes the action of symplectomorphism V Φ somewhat non-trivial. Indeed, a general canonical transformation is a diffeomorphism that mixes position coordinates and momenta, however in such a regularization, positions live on the sites of a lattice while momenta live on the links. Furthermore, if we choose the standard boundary conditions and fix positions at the endpoints: then we have N sets of momenta variables p (n) i , n = 1 . . . N , and only N − 1 independent sets of position variables q i (n) , n = 1 . . . N − 1. We will present one way of dealing with this issue, which works at least for the problem at hands. We will not attempt understanding it in any more generality, such as in relation to other regularizations etc. This is left for brave minds willing to attack the problem of phase space path integral in the future. So, what we do is as follows. For any transformation δp = X(p, q), δq = Y (p, q), we write the discrete version as: 12 If it could be anomalous, we would restrict only to the class of such Φ that generate non-anomalous symmetries. However, it is believed that symplectomorphisms are non-anomalous in quantum mechanics, whereas covariance with respect to more general diffeomorphism can be broken by the anomaly [69].

JHEP04(2020)175
in other words, each time when we do not know which variable out of two to pick, we take the average of the two possible expressions. For example, since there is no preferred choice whether momentum p (n) should transform and mix with coordinates on the left, i.e. q (n−1) , or on the right, i.e. q (n) , we simply take the average of the two possible transformations. In particular, for our symplectomorphism generated by the transformations are: Suppose that we are fixing Q at both ends, that is Q (0) and Q (N ) are not integrated over. Then the measure can be written, up to a normalization constant, as follows: Applying infinitesimal transformation (A.5) generates Jacobian factors which we write for d m Q (n) as: and for d m P (n) as: Overall, we get: All factors inside the product cancel out (up to O( 2 ) which is neglected at the infinitesimal level anyways), and the only ones that remain are: We assume that in the continuum limit, the action transforms in the standard geometric way. Therefore, we expect the following equality to hold:

JHEP04(2020)175
where a = a + f (a ), and the same for b. As usual, we can ignore what is going on at the t = −T endpoint of the interval and simply focus on the t = 0 boundary. Also, we can go back to our previous level of generality and consider an arbitrary Lagrangian submanifold as the boundary condition. Then equality becomes: Dy e iS (. . . ), (A.12) where [L(x)] is the image of L(x) under x = x + f (x ), and S is the transformed action.

A.1 Gluing and symmetries
Looking at how the action transforms, we see that the −Hdt term is invariant, while the transformation of the boundary term F | t=0 is simply δF = X Φ (F ), and: So we can write: Dy e iS (. . . ) = If we recall that locally dF + θ = P i dQ i , the correction term in the action becomes: Assuming that additional insertions (. . . ) are invariant under X Φ , we obtain that: Dy e iS (. . . ) 16) where now x = x − f (x). Taking the term proportional to , we find: The latter is just the statement that ψ + (x) is annihilated by: This is the natural Hermitian quantum operator associated to Φ, and (A.17) is the usual property of the theory whose vacuum preserves the global symmetry: path integral with invariant insertions produces an invariant state. If we keep this statement in the form: 19) and note that the same computation for ψ − (which lives at the endpoint of the opposite orientation) gives:

JHEP04(2020)175
we can conclude that: On the other hand, the measure on X/D, or more concretely on L ⊥ , which is locally given by d m Q and is formally written as d m x, transforms in the opposite way: canceling the similar factor in ψ + ψ − . So ψ + (x)ψ − (x)d m x gives an invariant measure on X/D with the symmetry x → x− f (x) descending from V Φ acting on X by the polarizationpreserving symplectomorphisms: In other words, the QFT 0 that describes gluing and is given by the integral: has an induced symmetry if the parent theory QFT 1 has a symmetry V Φ that preserves polarization used in the definition of cutting/gluing. Moreover, for this property to hold, there is one more condition: quantum states ψ ± ∈ H should be annihilated by the conserved charge Φ. In the above, this was not made fully explicit and was almost automatic: we simply assumed that whatever happens at t = −T , preserves the symmetry, and then ψ + also does, as manifested by the equation (A.17). If there is a state ψ in ∈ H which we feed into the path integral as a boundary condition at t = −T , that state has to satisfy Φ|ψ in = 0. If we take T to infinity instead, then we should assume that at the infinite past, the system was in the vacuum state |0 , and the symmetry is preserved by the vacuum: Φ|0 = 0.
While the latter is certainly true for continuous symmetries in our 1-dimensional example, it might fail in higher dimensions if the symmetry is spontaneously broken. In this case, the path integral for QFT d would have a symmetry at the level of fields, but the vacuum would break it at the level of states. In such situations, the gluing theory QFT d−1 would not posses an induced symmetry.

B Wick rotation in phase space: harmonic oscillator
To illustrate how Wick rotation of boundary conditions discussed in section 2.5 works, let us consider an explicit example of a simple harmonic oscillator. Using it as a playground, we are going to observe that indeed, wave functions written in the momentum representation undergo additional analytic continuation in passing between Euclidean and Minkowsi signature, which is not present for the position space wave functions. This point, while being quite trivial in the present example, helps to avoid confusions in more complicated cases, such as higher-dimensional theories and more general polarizations. The main lesson it teaches is that gluing works naturally along space-like slices in a space-time of Lorentzian JHEP04(2020)175 signature, while gluing in Euclidean space-time should be properly understood through the analytic continuation.
With this motivation, consider the action: The Hamiltonian formalism action is: The standard (Lorentzian time and position space) transition amplitude is given by: where we give both the configuration space and the phase space path integral expressions.
Since the action is quadratic, both can be straightforwardly evaluated, with the answer: To obtain the momentum representation of the same transition amplitude, we can either perform the Fourier transform: This path integral is supposed to give an expression for p 2 |e −T H |p 1 that is related to (B.5) by a simple Wick rotation T → iT , so that the following is literally true from the operator formalism perspective too: Now let us try to proceed in steps and first integrate out p to write a Euclidean Lagrangian action with boundary terms. This gives: which is formally supposed to be correct, however it has one apparent problem: boundary conditions onq now break reality of q! Certainly, if we were to start from the Euclidean time path integral, we would impose boundary conditions that respect reality of the field variable. While it is acceptable to have classical solutions that violate reality conditionsthis simply means that the saddle point lies off the integration cycle, and we are allowed to deform the cycle to make it pass through the saddle point in the standard steepest descent approach -it is certainly safer to avoid reality-breaking boundary conditions. Therefore, we replace p a → iπ a in the above path integral, to define the following quantity: K E (π 1 , π 2 ; T ) = π 2 |e −T H |π 1 = q(0)=π 1 q(T )=π 2 Dqe −π 1 q(0)+π 2 q(T )− T 0 dτ q 2 2 + ω 2 q 2 2 .

(B.13)
This quantity has a well-defined path integral expression in the Euclidean time, however it is not immediately equal to the Wick-rotated momentum-space amplitude (B.5), (B.12).
The above discussion shows that the relation is through the additional analytic continuation of the momentum space variable:  Indeed, an explicit evaluation of the path integral shows that: K E (π 1 , π 2 , T ) = 1 2πω sinh ωT × exp 1 2ω sinh ωT [(π 2 1 + π 2 2 ) cosh ωT − 2π 1 π 2 ] , (B. 15) and wee see that this expression is related to (B.11) by π a → −ip a . This is the analytic continuation of the momentum variable discussed in the main text. After belaboring the point on analytic continuation this much that it becomes completely trivial, let us make a few more comments on physical states. We mentioned in the main text that one can use the Euclidean path integral on a compact manifold M with boundary N = ∂M to generate a state in H N . Such a state can be further fed into the path integral in Lorentzian signature as its boundary condition. For example, we can use a state ψ M ∈ H N generate by the Euclidean dynamics on M as a boundary condition at t = 0 on N × R + , with a time-like direction R + = (0, ∞), to propagate it along R + . Let us observe an example of this in our oscillator toy model. Unfortunately, it is not possible with a single oscillator, because there are no compact one-dimensional manifolds with a single boundary component (to which one would attach the "time" R + ), there is always an even number of boundaries. What we can do, however, is consider two copies of an oscillator as each evolving on its own "time" manifold R + . In other words, we take the "space" to consist of two disjoint points rather than one, so we consider a 1D QFT on R + R + with Lorentzian metric. Then we connect these two lines by a finite interval with Euclidean metric on it, which we interpret as creating a boundary state for the QFT 1 on R + R + , see illustration on figure 3.
We can interpret the red cap as a region creating the "in" state which we further evolve using Lorentzian dynamics. This state belongs to the space H pt pt = H pt ⊗ H pt . We could either equip the red cap with Lorentzian or Euclidean metric. In the former case, this would create a continuum spectrum-normalizable state (which does not belong to L 2 (R 2 )). With Euclidean metric, we obtain a square-normalizable state, which is known as the thermofield double state. The normalizability is manifestly true if we use the position representation to write down this state: where T is the length of the red cap region.

JHEP04(2020)175
However, in the momentum representation, with the naive boundary condition ∂ ⊥ q = (π 1 , π 2 ) (where ∂ ⊥ is a time derivative pointing outward, i.e. in time direction), one finds: Ψ E (π 1 , π 2 ) = ∂ ⊥ q|=(π 1 ,π 2 ) Dqe −S E (B.17) = 1 2πω sinh ωT × exp 1 2ω sinh ωT [(π 2 1 + π 2 2 ) cosh ωT + 2π 1 π 2 ] , We see that this is not normalizable in any way. Of course, as should be completely obvious by now, the resolution is to preform analytic continuation in momentum: where Ψ(p 1 , p 2 ) is perfectly square-normalizable now. As a consistency check, this Ψ(p 1 , p 2 ) is nothing else but a Fourier transform of Ψ(x 1 , x 2 ) from (B.16), Ψ(p 1 , p 2 ) = 1 2π dx 1 dx 2 e −ip 1 x 1 −ip 2 x 2 Ψ(x 1 , x 2 ). Another operation that could be performed on the Euclidean cap from figure 3 is gluing to itself, or to another copy of the Euclidean cap. The result of taking such an overlap of thermofield double states is of course the thermal partition function of an oscillator. In the position representation, gluing to itself is simply given by: which is indeed the thermal partition on S 1 of length T , while gluing to another copy of the cap is: dx 1 dx 2 Ψ(x 1 , x 2 )Ψ(x 1 , x 2 ) = 1 sinh ωT , (B.20) the same partition function but on the circle of length 2T . Now if we would like to perform the same gluing in momentum space, we clearly should not use the Euclidean wave function Ψ E (π 1 , π 2 ) as it is not square-integrable, instead we use the analytically continued (or Lorentzian) wave function Ψ(p 1 , p 2 ) = Ψ E (−ip 1 , −ip 2 ). For gluing to itself, we also write Ψ(p, −p) since orientations of the two ends must be opposite to allow gluing: dp Ψ E (−ip, ip) = 1 2 sinh ωT 2 , (B.21) while for gluing of the two copies we integrate as follows: dp 1 dp 2 Ψ E (−ip, −ip)Ψ E (ip, ip) = 1 sinh ωT . (B.22) The latter example is relevant for what we are doing in the companion paper [29], since we mostly glue Euclidean theories there, and as we emphasize here, to obtain correct answer we really should analytically continue Euclidean wave functions before gluing. This observations explains some otherwise mysterious factors of i in [29].

JHEP04(2020)175
Open Access. This article is distributed under the terms of the Creative Commons Attribution License (CC-BY 4.0), which permits any use, distribution and reproduction in any medium, provided the original author(s) and source are credited.