The tensor hierarchy of 8-dimensional field theories

We construct the tensor hierarchy of generic, bosonic, 8-dimensional field theories. We first study the form of the most general 8-dimensional bosonic theory with Abelian gauge symmetries only and no massive deformations. This study determines the tensors that occur in the Chern-Simons terms of the (electric and magnetic) field strengths and the action for the electric fields, which we determine. Having constructed the most general Abelian theory we study the most general gaugings of its global symmetries and the possible massive deformations using the embedding tensor formalism, constructing the complete tensor hierarchy using the Bianchi identities. We find the explicit form of all the field strengths of the gauged theory up to the 6-forms. Finally, we find the equations of motion comparing the Noether identities with the identities satisfied by the Bianchi identities themselves. We find that some equations of motion are not simply the Bianchi identities of the dual fields, but combinations of them.


Introduction
Over the last years, a great effort has been made to explore the most general field theories. This exploration has been motivated by two main reasons. First of all there is the need to search for viable candidates to describe the fundamental interactions known to us (specially gravity) and the universe at the cosmological scale, solving the theoretical problems encountered by the theories available today. The second reason is the desire to map the space of possible theories and the different relations and dualities existing between them.
In the String Theory context, the landscape of N = 1, d = 4 vacua has focused most of the attention, but more general compactifications have also been studied. At the level of the effective field theories the exploration has been carried out within the space of supergravity theories. Most ungauged supergravity theories (excluding those of higher order in curvature) and some of the gauged ones have been constructed in the past century [1], but the space of possible gaugings and massive deformations (related to fluxes, symmetry enhancements etc. in String theory) has started to be studied in a systematic way more recently with the introduction of the embeddingtensor formalism in Refs. [2,3,4]. The formalism was developed in the context of the study of the gauging of N = 8, d = 4 supergravity in Refs. [5,6], but it has later been used in theories with less supersymmetry in different dimensions. 1 The embedding-tensor formalism comes with a bonus: the tensor hierarchy [25,6,26,23,27]. Using electric and magnetic vector fields in d = 4 dimensions as gauge fields requires the introduction of 2-form-potentials in the theory, which would be dual to the scalars. In d = 6 dimensions certain gaugings require the introduction of magnetic 2-form and 3-form potentials [28]. But the addition of higher-rank potentials does not stop there: as a general rule, the construction of gauge-invariant field strengths for the new p-form fields requires the introduction of (p + 1)-form fields with Stückelberg couplings. This leads to a tensor hierarchy that includes all the electric and magnetic fields of the theory and opens up the systematic construction of gauged theories: construct the hierarchy using gauge invariance as a principle expressed through the Bianchi identities and find the equations of motion by using the duality relations between electric and magnetic fields of ranks p and d − p − 2.
This approach has been used in Refs. [23,18] to construct the most general 4-, 5-and 6-dimensional field theories 2 with gauge invariance with at most two derivatives. In this paper we want to consider the 8-dimensional case and construct the most general 8-dimensional field theory with gauge invariance and of second order in derivatives in the action: tensor hierarchy, Bianchi identities, field strengths, duality relations and action. 3 Our main motivation for considering this problem is to simplify and systematize the construction of a one-parameter family of inequivalent gaugings with the same SO(3) group of maximal 8-dimensional supergravity, whose existence was conjectured in Ref. [8]: 4 using Scherk-Schwarz's generalized dimensional reduction [13] Salam and Sezgin obtained from 11-dimensional reduction an 8-dimensional SO(3)-gauged maximal supergravity in which the 3 Kaluza-Klein vectors played the role of gauge fields [14]. 5 The ungauged theory, though, has a second triplet of vector fields coming from the reduction of the 11-dimensional 3-form that can also be used as gauge fields and an SL(2, R) global symmetry that relates these two triplets of vectors, suggesting one could use as gauge fields any linear combination of these triplets.
The gauged theory in which the second tripet of vectors (those coming from the reduction of the 11-dimensional 3-form) played the role of gauge fields was obtained in Ref. [8] by dimensional reduction of a non-covariant deformation of 11-dimensional supergravity proposed in Ref. [7,9]. 6 This theory has different Chern-Simons terms and a different scalar potential and provides an early example of inequivalent gauging with the same gauge group of a given supergravity theory. However, for the reasons explained above, the existence of a full 1-parameter family of inequivalent SO (3) gaugings is expected and it would be interesting to construct it and compare it with the 1-parameter family of inequivalent 7 SO(8) gaugings of N = 8, d = 4 supergravity obtained in Ref. [22] and consider the possible higher-dimensional origin of the new parameter.
The construction of that 1-parameter family interpolating between Salam-Sezgin's theory and that of Ref. [8] is a complicated problem that will be addressed in a forthcoming publication [29]. In this paper we want to consider the general deformations (gaugings and massive transformations) of generic 8-dimensional theories. This result paves the way for the constraction of the 1-parameter family of gauged N = 2, d = 8 theories which is our ultimate goal. However, it is an interesting problem by itself whose solution will provide us with the most general theories with gauge symmetry in 8 dimensions up to two derivatives. context if exceptional field theory. 4 By inequivalent here we mean theories which have different interactions, including, in particular, different scalar potentials. A more restrictive definition of inequivalent theories (a more general concept of equivalence of theories) is often used in the literature (in Ref. [22], for instance): theories related by a field redefinition (including non-local field redefinitions such as electric-magnetic dualities) are not considered to be inequivalent. With this definition, the theories in the family we are talking about would not be considered to be inequivalent. 5 Other, more general, gaugings can be obtained via Scherk-Schwarz reduction [11,12], but it is always the Kaluza-Klein vectors that play the role of gauge fields. 6 Many gauged supergravities whose 11-dimensional origin is unkonown or, in more modern parlance, they contain non-geometrical fluxes (like Roman's 10-dimensional massive supergravity or alternative, inequivalent gaugings of other theories) can be obtained systematically from this non-covariant deformation of 11-dimensional supergravity [10], which seems to encode many of these non-geometrical fluxes.
7 Inequivalent in the more restrictive sense explained above.
The construction of the most general 8-dimensional theory with gauge symmetry and at most two derivatives, and this paper, are organized as follows: first, in Section 1, we study the structure and symmetries (including electric-magnetic dualities of the 3form potentials) of generic (up to second order in derivatives) 8-dimensional theories with Abelian gauge symmetry and no Chern-Simons terms.
In Section 2, we consider Abelian, massless deformations of those theories, which consist, essentially, in the introduction via some constant "d-tensors" of Chern-Simons terms in the field strengths and action. The new intereactions are required to preserve the Abelian gauge symmetries and, formally, the symplectic structure of the electricmagnetic duality transformations of the 3-form potentials. We determine explicitly the form of all the electric and magnetic field strengths up to the 7-form field strengths, and give the gauge-invariant action in terms of the electric potentials. This will be our starting point for the next stage.
In Section 3 we consider the most general gauging and massive deformations (Stückelberg couplings) of the Abelian theory constructed in the previous section using the embedding-tensor formalism. We proceed as in Refs. [18,15], finding Bianchi identities for field strengths from the identities satisfied by the Bianchi identities of the lower-rank field strengths and, then, solving them. We have found the Bianchi identities satisfied by all the field strengths and we have managed to find the explicit form of the field strengths up to the 6-form.
In this approach, the "d-tensors" that define the Chern-Simons terms will be treated in a different way as in Ref. [18]: they will not be treated as deformations of the theory to be gauged, but as part of its definition. Therefore, we will not associate to them any dual 7-form potentials.
In Section 4 we study the construction of an action for the theory. The equations of motion are related to the Bianchi identities by the duality relations between electric and magnetic field strengths, but, at least in this case, they are not directly equal to them. In general they can be combinations of the Bianchi identities. To find the right combinations we derive the Noether identities that the off-shell equations of motion of these theories should satisfy as a consistency condition that follows from gauge invariance. Then, we compare those Noether identities with the identities satisfied by the Bianchi identities. Once the equations of motion have been determined in this way, we proceed to the construction of the action, which we achieve up to terms that only contain 1-forms and their derivatives, whose form is too complicated.
Section 5 contains our conclusions and the main formulae (field strengths, Bianchi identities etc.) of the ungauged and gauged theories are collected in the appendices to simplify their use.

Ungauged d = 8 theories
In this section we are going to consider the construction of generic (bosonic) d = 8 theories coupled to gravity containing terms of second order or lower in derivatives of any given field 8 . The field content of a generic d = 8 theory are the metric g µν , scalar fields φ x , 1-form fields For the moment, we place no restrictions on the range of the indices labeling these fields nor on the symmetry groups that may act on them leaving the theory invariant.
We are going to start by the simplest theory one can construct with these fields to later gauge it and deform it in different ways.
The simplest field strengths one can construct for these fields are their exterior derivatives: They are invariant under the gauge transformations where the local parameters σ I , σ m , σ a are, respectively, 0-, 1-, and 2-forms.
The most general gauge-invariant action which one can write for these fields is where the kinetic matrices G xy , M I J , M mn , ℑmN ab as well as the matrix ℜeN ab are scalar-dependent 9 . One could add CS terms to this action, but this possibility will arise naturally in what follows. The equations of motion of the 3-forms C a can be written in the form 10 These equations can be solved locally by introducing a set of dual 3-forms C a implicitly defined through their field strengths G a R a = G a ≡ dC a .
(1.6) 8 The Chern-Simons (CS) terms may have terms with more than two derivatives, but they do not act on the same field. 9 If ℜeN ab is constant, then the last term is a total derivative. 10 The equation of motion of a p-form field, δS/δω (p) , is an (8 − p) − f orm defined by With our conventions, when acting on p-forms, ⋆ 2 = (−1) p−1 .
It is convenient to construct vectors containing the fundamental and dual 3-forms: so that the equations of motion and the Bianchi identities for the fundamental field strengths take the simple form In other words: we have traded an equation of motion by a Bianchi identity and a duality relation. In what follows we will do the same for all the fields in the action so that, in the end, we will have only a set of Bianchi identities and a set of duality relations between magnetic and electric fields.
The vector of field strengths G i satisfies the following linear, twisted, self-duality constraint is a symplectic symmetric matrix 11 . The equations (1.8) are formally invariant under arbitrary GL(2n 3 , R) transformations (n 3 being the number of fundamental 3-forms) but, just as it happens for 1-forms in d = 4, the self-duality constraint Eq. (1.9) is only preserved by Sp(2n 3 , R). As usual, the only Sp(2n 3 , R) transformations which are true symmetries of the equations of motion are those associated to the transformations of the scalars which are isometries of G xy and which also induce linear transformations of the other kinetic matrices. We will discuss this point in more detail later on. The dualization of the other fields does not lead to any further restrictions.
In what follows we are going to generalize the simple Abelian theory that we have constructed by deforming it, adding new couplings. We will use two guiding principles: preservation of gauge symmetry (even if it needs to be deformed as well) and preservation of the formal symplectic invariance that we have just discussed.

Abelian, massless deformations
The deformations that we are going to consider in this section consist, essentially, in the introduction of CS terms in the field strengths and in the action. Stückelberg coupling will be considered later. Only the 3-and 4-form field strengths admit these massless Abelian deformations. It is convenient to start by considering this simple modification of G a : 12 where d a I m is a constant tensor. The gauge transformations need to be deformed accordingly: The action Eq. (1.3) remains gauge-invariant but the formal symplectic invariance is broken: if we do not modify the action, the dual 4-form field strengths are just G a = dC a and Sp(2n 3 , R) cannot rotate these into G a in Eq. (2.1). Furthermore, the 1-form and 2-form equations of motion do not have a symplectic-invariant form. This problem can be solved by adding a CS term to the action: invariant under the deformed gauge transformations 12 We will often suppress the wedge product symbols ∧ in order to simplify the expressions that involve differential forms.
However, the deformed gauge transformations do not leave invariant the CS term Eq. (2.3). The only solution 13 is to add another term of the form 14 provided the following constraint holds: Observe that we are just using formal symplectic invariance: the symplectic vector d i I m is transformed into a different one. Thus, in general, one gets Sp(2n 3 , R) multiplets of theories, except when d i I m is a symplectic invariant tensor, 15 which requires, at least, one of the indices I or m to be a symplectic index. In most cases the part of the symmetry group of the theory acting on the 3-forms, while embedded in Sp(2n 3 , R), will be a much smaller group and, then, full symplectic invariance of d i I m may not be required.
As a nice check of the formal symplectic invariance of the deformed theory, we can check this invariance on the dual field strengths of the remaining fields 16 , which is tantamount to checking the invariance of the equations of motion of the fundamental fields.
Using the duality relation R a = G a the equations of motion of the 1-forms can be written in the form and can be solved by identifying all the terms inside the brackets with dÃ I , whereÃ I is a set of 5-forms. Taking into account gauge invariance, the 6-form field strengthsF I have the following definition, duality relation and Bianchi identities: 14) 13 We have not found any other. 14 We use the compact notation A I J... = A I A J · · · , F I J... = F I F J · · · , B mn... = B m B n · · · etc., where we have suppressed the wedge product symbols. 15 The only symplectic-invariant vector is 0. 16 We leave aside the scalars for the moment. and the equations of motion are of the 1-forms given by the Bianchi identities of the dual 6-form field strengths up to duality relations: Using the duality relation R a = G a and following the same steps for the 2-forms , we findH 18) and the equations of motion of the 2-forms are given by the Bianchi identities of the dual 5-form field strengths up to duality relations: This completes the first Abelian deformation. The second non-trivial deformation of G a that one could consider is the addition of a CS 4-form term ∼ d a I JK A I F J A K . The gauge transformation of this term is not a total derivative and we cannot make G a gauge-invariant by deforming the gauge transformation rule of C a only: we must also deform that of B m , which, in its turn, induces a deformation of H m by addition of a CS 3-form term. Since the deformation of H m is essentially unique, it is more convenient to start from this side and redefine where d mI J = d mJ I 17 which is invariant under the gauge transformations and satisfies the Bianchi identities Under these gauge transformations and a generic δ σ C a Adding a CS 4-form term to G a 17 The antisymmetric part is a total derivative that can be absorbed into a redefinition of B m .
The last term can be made to vanish by simply requiring Symmetrizing both sides of this equation w.r.t. I JK we conclude that and going back to the original (unsymmetrized) equation this implies that α = 1/3. We arrive to the field strength, gauge transformation and Bianchi identities If these deformations are going to preserve formal symplectic invariance, we expect that these results extend to the dual 3-forms and 4-forms field strengths, that is: This requires the introduction of new CS terms in the action. If we define the CS terms in the 4-form field strengths by ∆G i (G i = dC i + ∆G i ), then we expect the following terms to be present: Instead of checking in detail the gauge-invariance of these terms, it is more convenient to take the formal exterior derivative and check whether it is entirely given in terms of the gauge-invariant field strengths found above. if it is not, it should fail only by a total derivative which we can compensate by adding the corresponding terms to the action.
We have found that one has to relate d i (I| m d i|J) n to the tensor d mI J . The relation can be established by introducing a new tensor d mnp = −d nmp and is given by n does not necessarily vanish.
Using the above relation we find a result of the expected form 18 (2.38) from which it follows that the gauge-invariant CS term in the action is given, up to total derivatives, by Observe that only the completely antisymmetric part of d mnp enters the action, even though we have only assumed it to be antisymmetric in the first two indices. We will henceforth assume that d mnp is completely antisymmetric. Now, as a final check of the consistency of our results, we can compute the dual field strengthsH m andF I , which should be formally symplectic invariant if the theory is, and their Bianchi identities, which should be given entirely in terms of other field strengths if the theory is indeed gauge invariant.
We find 18 We use repeatedly the identity The duality relations are the same as in the undeformed case.
As a further check of this construction, taking the exterior derivative of the Bianchi identities of all the field strengths one finds consistent results upon use of the properties of the deformation tensors d i I m , d mI J , d mnp . We will not compute the gauge transformations of the higher-rank form fields since they will not be necessary in what follows.

The 6-form potentials and their 7-form field strengths
On general grounds (see [19] and references therein) the 6-form potentials are expected to be the duals of the scalars. However, maintaining the manifest invariances of the theory in the dualization procedure requires the introduction of as many 6-forms D A as generators of global transformations δ A leaving the equations of motion (not just the action) invariant. Hence, the index A labels the adjoint representation of the duality group. The 7-form field strengths K A are the Hodge duals of the piece j associated to those symmetries (or, better, dualities) [20] which only depend on the scalar fields 19 19 This is the contribution of the σ-model to the Noether current. The symmetries of the equations of motion are necessarily symmetries of the σ-model, i.e. isometries of the σ-model metric G xy (φ) generated by Killing vectors k A x . The indices A, B, C label the symmetries of the theory and, therefore, run over the adjoint representation of the Lie algebra of that symmetry group G. The contribution of the σ-model and their Bianchi identities follow from the conservation law for those currents where we have used the conservation of the NGZ current.
The simplest procedure to compute ∆j A is to contract the equations of motion of the scalars with the Killing vectors k A x (φ) of the σ-model metric G xy (φ), which is given by (2.46) Using the Killing equation, we get (2.47) We must now use the fact that the isometry generated by k A will only be a symmetry of the equations of motion if 20 where the matrices T A I J , T A m n and are generators of the symmetry group G in the representation in which the 1-forms, 2-forms and 3-forms transform As we have discussed, this implies that the matrices T A i j are generators of the symplectic group (2.51) Upon use of the duality relations between field strengths, we find that This means that we can rewrite that equation locally as the conservation of the NGZ current where ∆j A is a very long and complicated expression whose explicit form will not be useful for us. A local solution is provided by ⋆[j

(σ)
A + ∆j A ] = −dD A for the 6-form potential D A and we get the definition of the 7-form field strength (2.55) Its Bianchi identity is given by In the kind of theories that we are considering here there is no reason to include potentials of rank higher than 6, unless we introduce a scalar potential depending on new coupling constants: one can then introduce 7-form potentials dual to those coupling constants. Since the introduction of these parameters would be purely ad hoc, we will postpone the study of this duality to the next section in which we will be able to use in the definition of the scalar potential the embedding tensor and the massive deformation parameters, which have well-defined properties.
One can also generalize the theory by adding a scalar potential. This addition is associated to the introduction of new deformation parameters. In gauged supergravity, which is the main case of interest, these deformation parameters are the components of the embedding tensor and the scalar potential arises in the gauging procedure, associated to the fermion shifts in the fermion's supersymmetry transformations. Thus, it is natural to deal with the scalar potential in the next section too.
The results obtained in this and the previous Section are summarized in Appendix A.

Non-Abelian and massive deformations: the tensor hierarchy
The next step in the construction of the most general d = 8 field theory is the gauging of the global symmetries of the theory. The most general possibilities can be explored using the embedding tensor formalism 21 and in this section we are going to set it up for the Abelian theories we have just found. 22 For the sake of convenience we are going to reproduce some of the formulae obtained above. The starting point is the assumption that the equations of motion of the theory are invariant under a global symmetry group with infinitesimal generators {T A } satisfying the algebra The group acts linearly on all the forms of rank ≥ 1, including the 3-forms if the electric and magnetic 3-forms C a and C a are combined into a single symplectic vector We have ) but the period matrix undergoes fractional-linear transformations which, infinitesimally, take the form 21 In this section we will follow Ref. [15], where the essential references on the embedding tensor formalism can be found. We will also use the same notation. 22 Observer that, in general, the theories that we are considering are just the bosonic sector of a theory that also contains fermions and whose symmetry group may include symmetries that only act on them. The total symmetry group would, then, be larger and the embedding tensor should take this fact into account.
(3.5) The k-form field strengths will transform in the same representation as the corresponding (k − 1)-form potential, but only if the d-tensors d mI J , d i I m and d mnp are invariant under the global symmetry group, i.e. if they must satisfy The theories we have constructed are invariant under Abelian gauge transformations with 0-, 1-and 2-form parameters σ I , σ m , σ i : In order to gauge the global symmetries, we promote the global parameters α A to local ones α A (x) and we identify them with some combinations of the gauge parameters of the 1-forms σ I via the embedding tensor ϑ I A as follows: Using this redefinition in the transformation of the kinetic matrices M I J , M mn , W ij one immediately finds their gauge transformations: 9) where we have defined the matrices The gauge fields for these symmetries are given by With them we can construct gauge-covariant derivatives, which we will then use to derive Bianchi identities. Is is convenient to start by constructing the covariant derivatives of the kinetic matrices M I J , M mn , W ij (N ) which transform linearly. According to the general rule, the covariant derivative of a field Φ transforming as δ A Φ is given by These derivatives transform covariantly under gauge transformations δ σ = σ I ϑ I A δ A provided that the embedding tensor is gauge-invariant δ σ ϑ I A = 0 , (3.16) and provided that the 1-forms transform as The condition Eq. (3.16) leads to the so-called quadratic constraint To determine ∆ σ A I we have to construct the gauge-covariant 2-form field strengths F I .

2-form field strengths
The simplest way to find the 2-form field strengths F I is through the Ricci identities. A straightforward calculation using the quadratic constraint Eq. (3.18) leads to and analogous equations for M I J and W ij (N ), with Under gauge transformations, provided that Given the field content of the theory, the natural candidate to ∆F I and ∆ σ A I are where the new tensor Z I m is gauge-invariant and orthogonal to the embedding tensor: In the ungauged limit ϑ I A = Z I m = 0 we get the Abelian gauge transformations of the 2-form Eq. (2.21) if we identify the above 1-form σ m (relabeled σ g m ) with σ m − d mI J A I σ J , confirming the identification of the d-tensor. Using that variable makes the non-Abelian gauge transformations more complicated and, therefore, we will stick to the above σ m .

3-form field strengths
Again, the shortest way to find ∆B m and the gauge-covariant 3-form field strength H m is through the Bianchi identities. Taking the covariant derivative of the 2-form field strength, and using the generalized Jacobi identity where In the ungauged limit ϑ I A = Z I m = 0 we recover the Abelian 3-form field strength in Eq. (2.20). On the other hand, by construction, the above field strength is gaugecovariant up to terms annihilated by Z I m under Eqs. (3.29) and (3.30). To show this explicitly, we will need further identities between the tensors of the theory that are more easily discovered by computing first the 4-form field strengths.

4-form field strengths
From this moment, following Ref. [18], we will determine the general form of the field strengths using the Bianchi identities and their consistency relations. This procedure yields gauge-covariant field strengths and one can later find explicitly the gauge transformations of the fields that produce that result.
Thus, we take the covariant derivative of both sides of Eq. (3.33), use the Ricci identity Eq. (3.19) for the l.h.s. and the explicit form of H m in Eq. (3.34) for the r.h.s., and we find the Bianchi identity for H m to be ∆DH m has to be gauge-invariant and scalar-independent and the only possibility is a 4-form combination of field strengths. F I ∧ F J has already been used and we must use G i , whose explicit form will be determined by consistency.
The tensor d i I m coincides with the one we introduced as an Abelian deformation. Also, observe that this relation makes the condition of gauge invariance of Z in redundant.
We get (3.40) These 4-form field strengths reduce exactly to the Abelian ones in Eq. (2.31). Now we are ready to check explicitly using the identity/constraint Eq. (3.38) that H m in Eq. (3.34) with ∆H m = Z im C i is gauge covariant up to terms proportional to Z im , which are automatically annihilated by Z I m . We find that

5-form field strengths
Taking, once again, the covariant derivatives of both sides of the Bianchi identity for H m , Eq. (3.37), and using the Bianchi identity for F I , Eq. (3.33) and the newly introduced tensor d i I m , we find that where Z i m is a new gauge-invariant tensor orthogonal to Z im Z i m Z in = 0 , (3.44) and where the sign of that term has been chosen so as to get the same signs as in the ungauged case. In principle these two tensors could be completely unrelated (except for the constraints). However, since, in the physical theory, G i is self-dual andH m is the electric-magnetic dual of H m , it is natural to expect that the same tensors appear in both field strengths. Thus, we are going to assume that Z i m has been obtained from Z jm by raising the index with the symplectic metric tensor Ω ij , that is Then, there is no new constraint associated to its gauge invariance and, we just have the constraint Eq. (3.44) analogous to a constraint satisfied by the embedding tensor in 4-dimensional field theories. and rewrite the constraint as

6-form field strengths
Using these constraints and the same reasoning as in the previous cases we find the next Bianchi identity and we can also solve it 24

7-form field strengths
Provided that we impose the additional constraint 25 where we are denoting by G i the part of G i that only contains 1-forms A I and their derivatives dA I .

8-form field strengths
Taking the covariant derivative of Eq. (3.54) and using several of the constraints imposed above, we find that According to the general arguments in Ref. [19] the last term must vanish. It cannot arise in the Bianchi identity of the dual Noether-Gaillard-Zumino current associated to the global symmetries of the theory. Thus, we impose d m(I J d m KLM) = 0 , (3.57) and, from the definition of the X tensors, we get where Y A ♯ is a tensor orthogonal to the embedding tensor and where the index ♯ runs over all the deformation tensors introduced so far, that we are going to denote collectively by c ♯ . As argued in Ref. [18], the natural candidates for the Y A ♯ tensors are the variations of the deformation tensors c ♯ under the global symmetries of the theory where A runs over the whole Lie algebra of the global symmetry group, because all the deformation tensors are required to be gauge invariant where we have defined the constraints Q A ♯ . At this point there are two possibilities: 1. We can consider that all the independent tensors 26 {ϑ I A , Z Im , Z im , −d mI J , d i I m } are deformations of the original theory introduced at the same time as the gauging of the global symmetries of the original symmetry is carried out. In this case they only have to be invariant under the global symmetries that have been gauged and not the stronger condition for any of them.

2.
We can consider only the tensors {ϑ I A , Z Im , Z im } are deformations of the original theory, whose definition includes the tensors {−d mI J , d i I m }. In this case, the latter must be invariant under the whole global symmetry group by hypothesis. The corresponding Y A ♯ tensors are assumed to vanish identically, before they are contracted with the embedding tensor. This is the point of view that we have adopted here and it implies that there are only three sets of 8-form field strengths {L ♯ } = {L A I , L Im , L im } and only three corresponding sets of 7form potentials {E ♯ } = {E A I , E Im , E im } which are dual to the deformation tensors {ϑ I A , Z Im , Z im }. In an action in which these tensors are generalized to spacetimedependent fields, these dual potentials appear as Lagrange multipliers enforcing their constancy [24,23].
We, thus, have to consider three constraints associated to gauge invariance and two constraints associated to global invariance and the final form of the Bianchi identity for the 7-form field strengths is The occurrence of these Y A ♯ has to be confirmed by taking again the covariant derivative of this Bianchi identity.

9-form field strengths
Taking the covariant derivative of both sides of the Bianchi identity Eq. (3.68) we arrive to 27 27 By direct computation we have not found any constraint or Y A ♯ tensor associated to either d m I JK or d mnp .
Since we have assumed 28 Q AmI J = Q A i I m = 0, we arrive to the Bianchi identities where the W ♯ β tensors are invariant tensors annihilated by the Y A ♯ ones As shown in Ref. [18] these tensors are nothing but the derivatives of all the constraints satisfied by the deformation tensors (labeled by β) with respect to the deformation tensors themselves. This means that there are as many 9-form field strengths M β and corresponding 8-form potentials N β as constraints Q β = 0. In a general action the top-form potentials N β would occur as the Lagrange multipliers enforcing the constraints Q β = 0.
As usual, this can be confirmed by acting yet again with the covariant derivative on the above three Bianchi identities. Let us first list all the constraints we have met:  67)).

Thirdly we have the orthogonality constraints between the three deformation tensors
From Eqs. (3.71) and (3.72) we get very similar equations which guarantee the consistency of the whole construction of the tensor hierarchy that we have carried out in this section.

Gauge-invariant action for the 1-, 2-and 3-forms
The Bianchi identities of the full tensor hierarchy give rise to the equations of motion of the electric fields of the theory upon use of the duality relations (on-duality-shell). For field strengths of the 6-,5-, 4-forms they are given by For the field strengths of the magnetic 3-forms they are given by where R a has been defined in Eq. (1.5). Finally, the field strength of the 7-forms is, according to Refs. [23,18], dual to the derivatives of the gauge-invariant scalar potential with respect to the deformation parameters, denoted collectively by c ♯ This identity follows from the scalar equation of motion in presence of a scalar potential together with the condition which implies, after multiplication by the embedding tensor ϑ I A , the gauge-invariance of the scalar potential.
In general, the equations of motion are combinations of different Bianchi identities on-duality-shell. In order to determine the combinations that correspond to the equations of motion we have to examine which combinations of Bianchi identities satisfy the Noether identities associated to the gauge invariances of the theory.
To start with, we need to introduce some notation for the Bianchi identities. This has been done in Appendix B.2. These Bianchi identities are related by a hierarchy of identities that are obtained by taking the covariant derivative of those with lower rank, as we have shown. These identities of Bianchi identities are collected in Appendix B.3. Now, let us assume that a standard gauge-invariant action for the 0-forms M (or φ x ), 1-forms A I , 2-forms B m and electric 3-forms C a exists. This means that the Bianchi identities B(Q β ), B(c ♯ ) and B(DM), B(F I ), B(H m ), B(G a ) are satisfied, at least up to duality relations. The kinetic terms of the electric fields are written in terms of the gauge-invariant field strengths and this implies that the magnetic fields C a ,B m must necessarily occur in the action, albeit not as dynamical fields: their equations of motion will be trivial on-duality-shell.
Under these assumptions, the identities satisfied by the non-trivial Bianchi identities (i.e. those involving the magnetic field strengths) take the simplified form 29 If such an action exists, its invariance with respect to gauge transformations with parameters σ m , σ i , σ m , σ I will imply that the equations of motion satisfy, off-shell, associated Noether identities. Up to the field equations ofB m and C a which are assumed to be satisfied up to dualities, they take the form Comparing directly with the above identities satisfied by the Bianchi identities, we conclude that, up to dualities, the equations of motion of the electric fields are related to the Bianchi identities of the magnetic field strengths by This identification determines completely the field theory. For instance, the equation of motion for the electric 3-forms C a must be etc.
Can we write an action gauge-invariant action for the electric fields φ x , A I , B m and C a from which these equations of motion follow, up to duality relations? We can follow the step-by-step procedure used in Ref. [18] for the 5-and 6-dimensional cases. This procedure consists in considering first an action S (0) containing only the gaugeinvariant kinetic terms for the all the electric potentials φ x , A I , B m , C a and start adding the necessary Chern-Simons terms S (1) , S (2) , . . . to obtain the equations of motion of all the potentials occurring in S (0) in order of decreasing rank:B m , C a , C a , B m , A I . At the first step it will be necessary to introduce terms S (1) containingB m but no new terms containing this potential will be introduced in the following steps. At the second step we will introduce terms S (2) containing C a (but noB m ) and in the following steps we will not introduce any more terms containing it and so on and so forth.
We will not carry this procedure to the end because in eight dimensions the number of Chern-Simons terms involving just 2-and 1-form potentials is huge and its structure is very complicated. Nevertheless we are going to check that everything works as expected for the potentials of highest rankB m , C a , C a and we are going to find that only under certain conditions the action we are looking for exists Our starting point is, therefore, the action where we have added a scalar potential V(φ). This action gives This equations should be trivial on-duality-shell and, therefore, we must add to the action S (0) so that The equation for C a that follows from S (0) + S (1) is and, comparing with Eq. (4.17), we see that the term +d aI m F I H m is missing and we must add a term of the form Under this assumption, which will also prove crucial to obtain the equations of motion of other fields, the equation of motion of C a is Eq. (4.17), as we wanted. The equation of the magnetic potential C a , which should be trivial on-duality-shell which follows from the action we have constructed is The last two terms belong to the field strengthH m and we need to add where H m is the part of the field strengthH m that only contains 1-form potentials and their exterior derivatives. Observe that neitherB m nor C a appear in this term and, therefore, their equations of motion are not modified. Observe also that we are facing here the same problem we faced in getting the equation of motion of C a : only d [b| I m Z |a] m can enter the action while the equation of motion contains also the symmetric part. The solution to this problem is the same: we demand d (a| I m Z |b) m = − 1 2 X I ab = 0 .  (4.28) The expression in brackets in the r.h.s. is identical to B(H m ) up to dualities and up to the term d m I JK F I JK . The next term vanishes on-duality-shell and the remaining terms should be eliminated. Observe that in the terms that need to be eliminated and introduced neitherB m nor C i occur (they only depend on B m , A I and their derivatives) and, therefore, their equations of motion will not be modified.

Conclusions
Following the same procedure as in Refs. [18,15], in this paper we have constructed the most general 8-dimensional theory with gauge symnmetries and with at most two derivatives: field strengths (up to 6-forms), all the Bianchi identities and duality relations satisfied by all the field strengths (up to the 9-forms 30 ), and the equations of motion of the fundamental fields. We have shown that they are characterized by a small number of invariant tensors (d-tensor, embedding tensor ϑ and massive deformations Z) that satisfy certain constraints that relate them among themselves and to the structure constants and generators of the global symmetry group, which has to act on the n 3 3-form potentials of the theory as a subgroup of Sp(2n 3 , R).
We have found that the Bianchi identities satisfied by the 7-form field strengths (dual to the generalized Noether-Gaillard-Zumino current) have the general form predicted in Ref. [19], although in this case it is very difficult to find the explicit form of the 7-form field strengths.
We have constructed an action from which one can derive all the equations of motion except for those of the 1-form potentials because identifying the terms that only contain 1-forms becomes extremely complicated and time-consuming.
This general result can be applied to any 8-dimensional theory with a given field content, d-tensors defining Chern-Simons interactions and global symmetry group, such as maximal d = 8 supergravity. In a forthcoming publication we will solve the constraints satisfied by the deformation tensors (d-tensor, embedding tensor ϑ and massive deformations Z) searching for a 1-parameter family of different SO(3) gaugings of that theory.

B.2 Bianchi identities
The Here ♯ labels the deformation parameters and β the constraints, as discussed in Sections 3.7 and 3.8.