1 Introduction

General Relativity (GR) offers a model for gravity, based on Riemannian geometry, which is in excellent agreement with most observations, but still exhibits problems at the largest (e.g., rotational curves of galaxies or the accelerated expansion of the Universe) and the smallest scales (e.g., tensions with quantum theory). This indicates that it is necessary to look for a more general gravitational theory. Whereas there is an ongoing debate on which extensions of Riemannian geometry are the most suitable, there is quite a wide consensus that the dynamics of such an extended model for gravity should be based on the principle of minimal action – i.e., on the calculus of variations.

Typically, in building extensions of GR, once the kinematics is fixed, the Lagrangian is postulated, the associated field equations and their consequences being subsequently derived from it. Examples of such modified theories include Horndeski gravity, where the spacetime geometry is still described by Riemannian geometry but an additional scalar degree of freedom is present, see [1,2,3], or metric-affine theories of gravity, where the gravitational degree of freedom comes from both the spacetime metric and an independent affine connection, see [4,5,6,7].

Yet, the choice of these Lagrangians is very often based on formal arguments, aimed to indirectly control the expected behaviour of the solutions of the associated Euler–Lagrange equations. While we would not argue against the soundness of this approach in itself, we note that it usually fails to single out a theory, or a class of theories, that stays closest to a desired phenomenological behaviour. One may then want to find a refined, or, at least, complementary, technique for selecting the best models.

With this aim, we propose to revert for a moment the roles and start from the field equations. More precisely, imagine we postulate an approximate form of the desired field equations – which may be variational or not – based on some physical principles or phenomenological considerations. A Lagrangian, together with a set of “corrected”, fully variational field equations obtained by adding a canonical correction term, can then be derived from this “educated guess”; the technique, called canonical variational completion (or briefly, variational completion), was introducedFootnote 1 in [8]. The said canonical correction term is expressed in terms of the Helmholtz form, [9], measuring the obstruction from variationality of the original equations; in this sense, the corrected equations are the closest variational equations to the original ones.

To give an idea on this technique, a motivating example was the historically first version of the Einstein field equations:

$$\begin{aligned} R_{\mu \nu }=\kappa T_{\mu \nu }, \end{aligned}$$
(1)

which accurately predicted some physical facts, but was inconsistent with local energy–momentum conservation. In this case, the variational completion procedure gives precisely

$$\begin{aligned} R_{\mu \nu }-\frac{1}{2}Rg_{\mu \nu }=\kappa T_{\mu \nu } \end{aligned}$$
(2)

as the “corrected” field equations.

This paper is the first of a two-part work aiming to select the metric-affine models that produce equations closest to those of the \(\Lambda \)CDM model of cosmology, based on the above procedure. More precisely, in this first part, we establish the necessary formal aspects, whereas in the forthcomingFootnote 2 Part 2, we concretely present its application to cosmology.

A first such necessary step, which we present here, is to extend the variational completion method to situations where one wants to build a theory depending on more than one dynamical variable, but only has an educated guess at the field equations of one of these dynamical variables, say \(y^{A}.\) In this case, we show in Theorem 2 that one can still canonically determine a Lagrangian, up to boundary terms and terms that have no dependence on \(y^{A}\) or its derivatives. Such a setup is particularly appealing for the construction of modified theories of gravity, since once can apply this procedure with \(y^{A}=g^{\mu \nu },\) taking lessons from GR for the educated guess of the metric field equations.

Further, we apply this result to metric-affine theories of gravity, starting from an educated guess of the metric equations \({\mathfrak {G}}_{\mu \nu }=0.\) Here are our findings:

  1. 1.

    According to Theorem 2, all the terms in the Lagrangian containing the metric or its derivatives can be “bootstrapped” by variational completion. The corresponding metric field equations are then the closest variational equations to our initial guess.

  2. 2.

    Under the assumption that the Lagrangians we are looking for are generally covariant, terms that do not involve the metric (and thus cannot be recovered by the above procedure) are then determined by specific techniques for finding differential invariants [10, 11]. More precisely, we show that these are of order at most one and are given by polynomial expressions of bounded degree in the distortion tensor components and their derivatives. A full classification of these possible terms, over 4-dimensional backgrounds, is presented in Appendix B.

The paper is structured as follows: Sect. 2 is a somewhat minimalist (though, we hope, self-contained) review of the method of variational completion. Section 3 then extends variational completion to the situation where one only has an educated guess at the form of a part of the equations; we also present one example showing how the procedure behaves in a well-known case. Further, in Sect. 4, we apply this method to the case of metric-affine theories, to find all possible metric-dependent terms in the Lagrangian, starting from an approximate form (educated guess) of the metric equations. All metric-independent, generally covariant Lagrangians on 4-dimensional spacetimes are then determined in Sect. 5. Finally, in Sect. 6, we summarize our findings and present further directions of research.

2 Variational completion of differential equations

This section presents in brief the method of canonical variational completion introduced in [8]. For more details on the formalism of the calculus of variations on fibered manifolds, we refer to the monographs [9, 12].

Consider an arbitrary PDE system of n equations of order r,  in n dependent variables, say \(y^{B} = y^{B}\left( x^{\mu }\right) \):

$$\begin{aligned} {\mathcal {E}}_{A}(x^{\mu };\partial _\mu y^B; \ldots , \partial _{\mu _1}\cdots \partial _{\mu _r}y^B)=0. \end{aligned}$$
(3)

The inverse problem of the calculus of variations consists in finding out if the given system is (locally or globally) variational, i.e., if it arises (locally, respectively, globally) as the Euler–Lagrange system attached to some Lagrangian. The question of local variationality is usually answered by means of some differential relations involving \({\mathcal {E}}_{A},\) called the Helmholtz conditions. In the event of a negative answer, it is sometimes – under some quite strong constraints – possible to transform the given system into an equivalent one which is locally variational, by means of variational multipliers, see [13].

The method of variational completion proposes a completely different approach: it transforms the given PDE system (3) into a – generally, non-equivalent – variational one, by canonically adding a correction term. The canonical correction term, which is expressed in terms of the Helmholtz coefficients of the given system, is built so as to measure the obstructions from variationality of the original system and can, with a few exceptions, always be constructed. The method can thus also act as an elegant way of checking variationality.

2.1 Geometric setup: fields, Lagrangians, Euler–Lagrange forms and source forms

In Lagrangian field theories, physical fields are understood as local sections of fibered manifolds.

A fibered manifold is a triple \((Y,\pi ,M),\) where M and Y are smooth manifolds of dimensions m and \(m+n\) respectively, and \(\pi :Y\rightarrow M\) is a surjective submersion of class \({\mathcal {C}}^{\infty },\) called the projection. Y is called the total space and M the base manifold. This structure allows one to find on Y an atlas consisting of fibered charts \(\left( V,\psi \right) ,\) \(\psi =\left( x^{\mu }, y^{A}\right) ,\) in which \(\pi \) is represented as

$$\begin{aligned} \pi :\left( x^{\mu },y^{A}\right) \mapsto \left( x^{\mu }\right) ; \end{aligned}$$
(4)

here, \(\left( \pi (V), \psi _M\right) ,\) \(\psi _M {:}{=}(x^\mu )\) is a chart on the base manifold M. Fibered manifolds are physically interpreted as configuration spaces of physical systems and include, as a subclass, fiber bundles.

Most typically, these configuration spaces actually belong to the more restrictive subclass of natural bundles, which are obtained via a “universal”, functorial construction \({\mathfrak {F}} : M\mapsto Y {:}{=}{\mathfrak {F}}M\) that applies to the whole category of m-dimensional manifolds (e.g., the tangent/cotangent bundle, tensor bundles, connection bundles). On natural bundles, each local coordinate system \(\left( x^{\mu }\right) \) on M induces so-called natural coordinates \(\left( x^{\mu },y^{A}\right) \) on Y;  accordingly, each coordinate change on M induces a natural coordinate change on Y (e.g., by a tensor, or connection coefficients rule).

In the following, unless elsewhere specified, by \(\left( Y,\pi ,M\right) \) we will denote a general fibered manifold, with no extra structure.

Local sections \(\gamma :U\rightarrow Y,\) which are smooth maps obeying \(\pi \circ \gamma ={{\,\textrm{Id}\,}}_{U}\) (where \(U\subset M\) is open) are described in fibered coordinates by \((x^{\mu }) \mapsto \left( x^{\mu },y^{A}\left( x^{\mu }\right) \right) ,\) i.e., by specifying a dependence between the (a priori independent) coordinates \(x^{\mu }\) and \(y^{A}\):

$$\begin{aligned} y^{A}=y^{A}\left( x^{\mu }\right) . \end{aligned}$$
(5)

These are, as announced above, physically interpreted as fields.

Adding derivatives of the field variables (up to some order r) into the picture is tantamount to considering jets of order r of sections: given a section \(\gamma : U\rightarrow Y\) and \(x\in U,\)

$$\begin{aligned} J_{x}^{r}\gamma \! {:}{=}\!\left( x^{\mu };y^{A}\left( x^{\mu }\right) ;\partial _{\nu }y^{A}\!\left( x^{\mu }\right) ;\cdots ;\partial _{\nu _{1}}\cdots \partial _{\nu _{r}}y^{A}\left( x^{\mu }\right) \right) .\nonumber \\ \end{aligned}$$
(6)

It is worth mentioning that the definition of the jet is independent of the choice of fibered charts, see [9].

The set \(J^{r}Y=\left\{ J_{x}^{r}\gamma ~|~\gamma :U\rightarrow Y~\text {-section}, x\in U\right\} \) of jets of all local sections of Y,  at all points of their domains, is called the jet bundle of order r of Y. This is a smooth manifold, with coordinate charts \(\left( V^{r},\psi ^{r}\right) ,\) with

$$\begin{aligned} V^{r}{:}{=}J^{r}V,\quad \psi ^{r}{:}{=}(x^{\mu },y^{A},y_{~\nu }^{A},\ldots ,y_{~\nu _{1}\cdots \nu _{r}}^{A}), \end{aligned}$$
(7)

naturally induced by \((V,\psi )\). The coordinate functions \(y_{~\nu _{1}\cdots \nu _{s}}^{A}\) (where \(\nu _{1}\le \cdots \le \nu _{s}\) and \(s\le r\)) can be interpreted as slots into which, inserting a prolonged section \(J^{r}\gamma : U\rightarrow J^{r}Y : x\mapsto J_{x}^{r}\gamma ,\) one gets the partial derivatives up to order r at x of the functions \(y^{A}=y^{A}\left( x^{\mu }\right) \) associated with \(\gamma \); that is

$$\begin{aligned} y_{~\nu _{1}\cdots \nu _{s}}^{A}\left( J_{x}^{r}\gamma \right) =\partial _{\nu _{1}}\cdots \partial _{\nu _{s}}y^{A}\left( x^{\mu }\right) . \end{aligned}$$
(8)

Jet bundles \(J^rY\) come naturally equipped with the structure of a fibered manifold (induced by that of Y) in multiple ways:

  1. 1.

    With base M,  with projection

    $$\begin{aligned} \pi ^r : J^rY \rightarrow M : J^r_x\gamma \mapsto \pi ^r(J^r_x\gamma ) {:}{=}x. \end{aligned}$$
    (9)
  2. 2.

    With base \(J^sY,\) for \(s\le r\); the projection

    $$\begin{aligned} \pi ^{r,s} : J^rY \rightarrow J^sY : J^r_x\gamma \mapsto \pi ^{r,s}(J^r_x\gamma ) {:}{=}J^s_x\gamma , \end{aligned}$$
    (10)

    “forgets all derivatives of order more than s”.

In principle, a locally defined differential form on \(J^{r}Y\) is expressed, in fibered charts, as a linear combination of wedge products of the differentials \(\textrm{d}x^{\mu },\) \(\textrm{d}y^{A},\) \(\textrm{d}y_{~\mu }^{A},\ldots ,\textrm{d}y_{~\mu _{1}\cdots \mu _{r}}^{A}.\) Yet, for our purposes, only two classes of such forms will be relevant:

  1. 1.

    Horizontal k-forms, with \(k\le m,\) which can be written (in one, then, in any fibered chart) as linear combinations of wedge products \(\textrm{d}x^{\mu _{1}}\wedge \cdots \wedge \textrm{d}x^{\mu _{k}}\) only. Their set will be denoted by \(\Omega _{k,M}\left( V^{r}\right) .\) The most important subclass is represented by Lagrangians of order r,  which are defined as horizontal forms of maximal rank \(k=m.\) In coordinates:

    $$\begin{aligned} \lambda ={\mathcal {L}}\textrm{d}x\in \Omega _{m,M}\left( V^{r}\right) , \end{aligned}$$
    (11)

    where \(\textrm{d}x{:}{=}\textrm{d}x^{0}\wedge \cdots \wedge \textrm{d}x^{m-1}\) and \({\mathcal {L}}={\mathcal {L}}(x^{\mu },y^{A},y_{~\nu }^{A},\ldots ,y_{~\nu _{1}\cdots \nu _{r}}^{A})\) is the Lagrangian density.

    In particular, on a natural bundle \({\mathfrak {F}}M ,\) a generally covariant, or natural, Lagrangian of order r is a globally defined Lagrangian \(\lambda \in \Omega _{m,M}\left( J^{r}{\mathfrak {F}}M\right) \) which is invariant under changes of natural coordinates on \(J^{r}{\mathfrak {F}}M \) induced by completely arbitrary coordinate changes (local diffeomorphisms) of M; in other words, a natural Lagrangian is a Lagrangian that makes sense globally, with the same formula, over any m-dimensional spacetime manifold M.

  2. 2.

    Source forms, or dynamical forms, which are \(\left( m+1\right) \)-forms expressible (in any fibered chart) as:

    $$\begin{aligned} {\mathcal {E}}={\mathcal {E}}_{A}\textrm{d}y^{A}\wedge \textrm{d}x\in \Omega _{m+1}(V^{r}), \end{aligned}$$
    (12)

    where \({\mathcal {E}}_{A}={\mathcal {E}}_{A}(x^{\mu },y^{A},y_{~\nu }^{A},\ldots ,y_{~\nu _{1}\cdots \nu _{r}}^{A}).\) For a coordinate-free definition of the concept, employing the notion of contact form and bundle projections, we refer to [9]. The most notorious example of a source form is the EulerLagrange form \({\mathcal {E}}\left( \lambda \right) \) of a Lagrangian \(\lambda ,\) given by

    $$\begin{aligned} {\mathcal {E}}_{A}=\dfrac{\delta {\mathcal {L}}}{\delta y^{A}}. \end{aligned}$$
    (13)

    More generally, any PDE system of \(m=\dim M\) equations of order r,  in the unknowns \(y^{A}=y^{A}\left( x^\mu \right) \) can be encoded into a source form; for instance, Eq. (3) above can be encoded as:

    $$\begin{aligned} {\mathcal {E}}_{A}\circ J^{r}\gamma = 0, \end{aligned}$$
    (14)

    where \(\gamma \) is the local section of Y given by \(y^{A}=y^{A}\left( x^\mu \right) .\)

A source form \({\mathcal {E}}\) on \(J^{r}Y\) is called locally variational if, for any chart domain \(V^{r}\subset J^{r}Y,\) there exists a Lagrangian \(\lambda _{V}\) whose Euler–Lagrange form is \({\mathcal {E}}.\) Accordingly, \({\mathcal {E}}\) is called globally variational if there exists a Lagrangian \(\lambda \) defined throughout \(J^{r}Y,\) such that \({\mathcal {E}} = {\mathcal {E}}\left( \lambda \right) .\)

Before going further, we should introduce one operation allowing to build horizontal forms on jet bundles. The horizontalization operator is the unique mapping \(h:\Omega (J^{r}Y)\rightarrow \Omega (J^{r+1}Y),\) compatible with the wedge productFootnote 3 (i.e. h is a morphism of exterior algebras) and obeying, in any fibered chart,

$$\begin{aligned} hf=f\circ \pi ^{r+1,r} \quad \text {and}\quad h\textrm{d}f=\textrm{d}_{\mu }f\textrm{d}x^{\mu }, \end{aligned}$$
(15)

for all \(f : J^{r}Y \rightarrow {\mathbb {R}}\); here, \(\textrm{d}_{\mu }f {:}{=}\partial _{\mu }f + \dfrac{\partial f}{\partial y^{A}}y_{~\mu }^{A}+ \cdots + \dfrac{\partial f}{\partial y_{~\nu _{1}\cdots \nu _{r}}^{A}}y_{~\nu _{1}\cdots \nu _{r}\mu }^{A}\) denotes the total derivative (of order \(r+1\)) with respect to \(x^{\mu }.\) As a direct consequence of (15), one has

$$\begin{aligned} h\textrm{d}x^{\mu }= & {} \textrm{d}x^{\mu },\ h\textrm{d}y^{A} = y_{~\mu }^{A}\textrm{d}x^{\mu }, \ldots ,\nonumber \\ h\textrm{d}y_{~\nu _{1}\cdots \nu _{k}}^{A }= & {} y_{~\nu _{1}\cdots \nu _{k}\mu }^{A}\textrm{d}x^{\mu },\quad k=1,\ldots ,r. \end{aligned}$$
(16)

Relations (16) and the compatibility with the wedge product then ensure that, given a form \(\rho \in \Omega _{k}(J^rY),\) the form \(h\rho \in \Omega _{k,M}(J^{r+1}Y)\) is horizontal.

Actually, the latter relations point out a natural differential operator, called the horizontal (or formal) exterior derivative, [14]:

$$\begin{aligned} \textrm{d}_H {:}{=}h \circ \textrm{d}: \Omega (J^{r}Y)\rightarrow \Omega (J^{r+1}Y), \end{aligned}$$

where \(\textrm{d}: \Omega (J^rY) \rightarrow \Omega (J^rY)\) is the exterior derivative on \(J^rY.\) Intuitively, \(\textrm{d}_H\) tells us what remains of the exterior derivative of \(\rho \in J^rY\) when evaluated along a prolonged section – in the sense that, for any section \(\gamma \) of Y:

$$\begin{aligned} \textrm{d}_M(J^r\gamma ^* \rho ) = J^{r+1}\gamma ^* \textrm{d}_H\rho , \end{aligned}$$
(17)

where \(\textrm{d}_M : \Omega (M) \rightarrow \Omega (M)\) is the exterior derivative on the base manifold M. As total derivatives commute, the formal exterior derivative obeys:

$$\begin{aligned} \textrm{d}_H \circ \textrm{d}_H \equiv 0. \end{aligned}$$
(18)

Furthermore, a Lagrangian \(\lambda \in \Omega _{m,M}(V^r)\) is variationally trivial (that is, it has an identically vanishing Euler–Lagrange form) if and only if there exists a form \(\mu \in \Omega _{m-1}(V^{r-1})\) such that \(\lambda = \textrm{d}_H \mu \) [9, p. 134]. This requirement is equivalent to the condition that \(\lambda \) is given by a divergence expression i.e., for any fibered chart \((V,\psi ),\) there exist functions \(g^\mu : V^r \rightarrow {\mathbb {R}}\) such that \(\lambda = \left( \textrm{d}_\mu g^\mu \right) \textrm{d}x\) [9, p. 134].

2.2 Canonical variational completion

In the following, we will only study local variationality; thus, we can assume with no loss of generality that \(V^{r}\subset {\mathbb {R}}^{N}\) (for an appropriate value of N) and omit the explicit mention of \(\psi ^{r}.\)

Consider now an arbitrary PDE system (3) and build, as in (12), the corresponding source form \({\mathcal {E}}={\mathcal {E}}_{A}\textrm{d}y^{A}\wedge \textrm{d}x\in \Omega _{m+1}(V^{r}).\) We will assume from the beginning that the domain \(V^{r}\) is vertically star-shaped with center \(\left( x^{\mu },0,\ldots ,0\right) \); that is, for every point \((x^{\mu },y^{A},y_{~\nu }^{A},\ldots ,y_{~\nu _{1}\cdots \nu _{r}}^{A})\in V^{r},\) the whole segment \((x^{\mu },ty^{A},ty_{~\nu }^{A},\ldots ,ty_{~\nu _{1}\cdots \nu _{r}}^{A}),\) \(t\in [0,1],\) joining the center with the given point, lies in \(V^{r}.\)

Under this assumption, one can introduce on the given chart domain \(V^{r},\) the VainbergTonti Lagrangian \(\lambda _{{\mathcal {E}}}={\mathcal {L}}_{{\mathcal {E}}}\textrm{d}x,\) where,Footnote 4 [9]:

$$\begin{aligned} {\mathcal {L}}_{{\mathcal {E}}} {:}{=}y^{A}\int _{0}^{1}{\mathcal {E}}_{A}\circ \chi _{t} \textrm{d}t, \end{aligned}$$
(19)

where \(\chi _{t} :V^{r}\rightarrow V^{r}\) is given by

$$\begin{aligned} \chi _{t}(x^{\mu },\!y^{A},\!y_{~\nu }^{A},\ldots ,y_{~\nu _{1}\cdots \nu _{r}}^{A})\,{:}{=}\, (x^{\mu },ty^{A},ty_{~\nu }^{A},\ldots ,ty_{~\nu _{1}\cdots \nu _{r}}^{A}). \nonumber \\ \end{aligned}$$
(20)

Remarks:

  1. 1.

    The Vainberg–Tonti Lagrangian is, in general, just defined on a coordinate chart. Yet, on tensor bundles Y – which is our case of interest – if the quantities \({\mathcal {E}}_{A}\) are tensor densities, then \({\mathcal {L}}_{{\mathcal {E}}}\) is a scalar density and \(\lambda _{{\mathcal {E}}}={\mathcal {L}}_{{\mathcal {E}}}\textrm{d}x\) is globally well defined. Actually, in this case, \(\lambda _{{\mathcal {E}}}\) is generally covariant provided that \({\mathcal {E}}\) itself is so.

  2. 2.

    If the coordinate chart domain \(V^{r}\) is not vertically star-shaped with center \(\left( x^{\mu },0,\ldots ,0\right) \) (which is obviously the case in gravity theories, where one cannot set all the field components \(g_{\mu \nu }\) to zero), the Vainberg–Tonti Lagrangian will be understood as a limit:

    $$\begin{aligned} {\mathcal {L}}_{{\mathcal {E}}}{:}{=}\underset{a\rightarrow 0}{\lim }\ y^A \int _{a}^{1}{\mathcal {E}}_{A}\circ \chi _{t}\textrm{d}t \end{aligned}$$
    (21)

    and it makes sense whenever this limit is finite, see [16].

The Vainberg–Tonti Lagrangian \(\lambda _{{\mathcal {E}}}\) gives rise to the Euler–Lagrange expressions \(\dfrac{\delta {\mathcal {L}}_{{\mathcal {E}}}}{\delta y^{A}}.\) These are related to the coefficients of \({\mathcal {E}}\) by

$$\begin{aligned} \frac{\delta {\mathcal {L}}_{{\mathcal {E}}}}{\delta y^{A}}=H_{A}+{\mathcal {E}}_{A}, \end{aligned}$$
(22)

where \(H_{A}\) are linear combinations of the coefficients \(H_{AB}, H_{AB}^{\nu },\ldots , H_{AB}^{\nu _{1}\cdots \nu _{r}}\) of the so-called Helmholtz form, [9, 13], whose vanishing is equivalent to the local variationality of \({\mathcal {E}}\) (see also Appendix A, for their precise expressions in the case \(r=2\)). Consequently:

  • If the original system is locally variational, then \(\dfrac{\delta {\mathcal {L}}_{{\mathcal {E}}}}{\delta y^{A}}={\mathcal {E}}_{A},\) i.e., the Vainberg–Tonti Lagrangian \(\lambda _{{\mathcal {E}}}\) is a Lagrangian for the original system,

  • The quantities \(H_{A}\) measure the “obstructions from variationality” of \({\mathcal {E}}_{A}.\)

The following definition thus makes sense:

Definition 1

[8] Given a PDE system (3) (equivalently, (14)), its canonical variational completion is the Euler–Lagrange system

$$\begin{aligned} \dfrac{\delta {\mathcal {L}}_{{\mathcal {E}}}}{\delta y^{A}}\circ J^{r}\gamma =0 \end{aligned}$$
(23)

of its attached Vainberg–Tonti Lagrangian.

In other words, the canonical variational completion of a PDE system is obtained by adding, as correction terms, the “obstruction from local variationality”, \(H_{A},\) to the respective system; one Lagrangian for the “corrected” variational system is the Vainberg–Tonti Lagrangian (19).

Example: Einstein tensor as canonical variational completion of the Ricci tensor, [8].

As already mentioned in the introduction, a motivation for the above construction was given by the historically first variant of gravitational field equations proposed by Einstein:

$$\begin{aligned} R_{\mu \nu }=\kappa T_{\mu \nu }. \end{aligned}$$
(24)

The configuration bundle is, in this case, the fibered manifold \(({{\,\textrm{Met}\,}}(M) ,\pi ,M),\) where \({{\,\textrm{Met}\,}}(M)\) is the set of symmetric and nondegenerate tensors of type \(\left( 0,2\right) \) over a given manifold M. Its sections are metric tensors \(\varvec{g},\) locally described by \(\left( x^{\rho }\right) \mapsto \left( g_{\mu \nu }\left( x^{\rho }\right) \right) .\) On the jet bundle \(J^{2}{{\,\textrm{Met}\,}}(M),\) one can thus consider as local coordinates \(\left( x^{\mu };g_{\mu \nu }; g_{\mu \nu ,\rho }; g_{\mu \nu ,\rho \sigma }\right) .\) With this choice, the left hand side of (24) can be encoded (after raising the indices and densitizing) into the invariant source form

$$\begin{aligned} {\mathcal {E}}=R^{\mu \nu }\sqrt{\left| \det g\right| }\textrm{d}g_{\mu \nu }\wedge \textrm{d}x\in \Omega _{m+1}\left( J^{2}{{\,\textrm{Met}\,}}\left( M\right) \right) , \end{aligned}$$
(25)

where \(R^{\mu \nu }\) is the formal Ricci tensor (the word “formal” means that \(R^{\mu \nu }\) is calculated by the usual formula but, in this expression, \(g_{\mu \nu },\) \(g_{\mu \nu ,\rho }\) and \(g_{\mu \nu ,\rho \sigma }\) are regarded as independent coordinate functions on \(J^{2}{{\,\textrm{Met}\,}}\left( M\right) ,\) not as functions of \(x^{\mu }\)).

A direct calculation then shows that the Vainberg–Tonti Lagrangian of \({\mathcal {E}}\) is actually the Einstein–Hilbert Lagrangian

$$\begin{aligned} \lambda _{g} {:}{=}R \sqrt{\left| \det (g)\right| } \textrm{d}x, \end{aligned}$$
(26)

where R is the formal Ricci scalar, leading to the Einstein equations (2).

Other applications of the canonical variational completion algorithm studied so far are, e.g., symmetrisation of canonical energy–momentum tensors in the special-relativistic limit, [8], Finsler gravity, [17], and Gauss–Bonnet gravity, [16].

3 What if we only know a part of the equations?

The above procedure is helpful as such in the case of purely metric theories of gravity. Yet, in theories of gravity employing a metric and another variable (e.g., a scalar field or a connection), one often has an “educated guess” on the form of the metric equations only – for instance, resemblance with the Einstein equations with a cosmological constant. For these situations, we prove below that one can recover the Lagrangian, up to boundary terms and terms that do not involve the metric or its derivatives; as a byproduct, we find the variationally completed metric equations, which are the closest variational equations to our initial guess. Possible Lagrangian terms that are independent of the metric remain to be found by other means.

More generally, assume one wants to build a variational theory involving two groups of dynamical variables, say \(y^{A}=y^{A}\left( x^{\mu }\right) \) and \(z^{I}=z^{I}\left( x^{\mu }\right) ,\) but only have an educated guess about the field equations with respect to \(y^{A}\):

$$\begin{aligned} {\mathcal {E}}_{A}\Big (x^{\mu };y^{B}, \partial _{\nu } y^{B},\ldots , \partial _{\nu _{1}}\cdots \partial _{\nu _{r}}y^{B}; z^{I}, \partial _{\nu }z^{I}, \ldots ,\nonumber \\ \partial _{\nu _{1}}\cdots \partial _{\nu _{r}}z^{I}\Big ) = 0, \end{aligned}$$
(27)

where the number of equations is equal to the number of \(y^{A}\)-variables. In the following, we will try to recover the variationally completed \(y^{A}\)-equations and, in so far as possible, the missing \(z^{I}\)-equations.

3.1 Variational bootstrapping

The configuration manifold corresponding to the situation described above is a fibered product manifold

$$\begin{aligned} Y=Y_{1}\times _{M}Y_{2}, \end{aligned}$$
(28)

equipped with fibered charts \(\left( V,\psi \right) ,\) \(\psi =\left( x^{\mu };y^{A},z^{I}\right) .\)

On the jet bundle \(J^{r}Y\equiv J^{r}Y_{1}\times _{M}J^{r}Y_{2},\) we will denote the naturally induced charts \(\left( V^{r},\psi ^{r}\right) ,\) with \(\psi ^{r}=(x^{\mu };y^{A},y_{~\nu }^{A},\ldots ,y_{~\nu _{1}\cdots \nu _{r}}^{A};z^{I},z_{~\nu }^{I},\ldots ,z_{~\nu _{1}\cdots \nu _{r}}^{I})\) and by

$$\begin{aligned} p_{1}:J^{r}Y\rightarrow J^{r}Y_{1},\quad p_{2}:J^{r}Y\rightarrow J^{r}Y_{2}, \end{aligned}$$
(29)

the projections onto the two factors of \(J^{r}Y.\)

Any source form on \(V^{r}\) is then uniquely written as a sum of two components

$$\begin{aligned} {\mathcal {E}}= & {} {\mathcal {E}}_{A}\textrm{d}y^{A}\wedge \textrm{d}x+{\mathcal {E}}_{I}\textrm{d}z^{I}\wedge \textrm{d}x=:{\mathcal {E}}_{(1) }\nonumber \\ {}{} & {} \quad +{\mathcal {E}}_{\left( 2\right) }\in \Omega _{m+1}\left( V^{r}\right) , \end{aligned}$$
(30)

where \({\mathcal {E}}_{\left( 1\right) }\) is \(p_{2}\)-horizontal (i.e., contains no terms in \(\textrm{d}z^{I},\ldots ,dz_{~\nu _{1}\cdots \nu _{r}}^{I}\)) and \({\mathcal {E}}_{\left( 2\right) }\) is \(p_{1}\)-horizontal; the functions \({\mathcal {E}}_{A}\) and \({\mathcal {E}}_{I}\) each depend, in principle, on all the coordinates \((x^{\mu };y^{B},y_{~\nu }^{B},\ldots ,y_{~\nu _{1}\cdots \nu _{r}}^{B};z^{I},z_{~\nu }^{I},\ldots ,z_{~\nu _{1}\cdots \nu _{r}}^{I}).\)

Our postulated equations (27) are thus completely encoded into the component \({\mathcal {E}}_{\left( 1\right) }\) of \({\mathcal {E}};\) we do not have any input information about \({\mathcal {E}}_{(2)}.\) Hence, the best thing we can do is to variationally complete \({\mathcal {E}}_{\left( 1\right) },\) as follows:

Fix a vertically star-shaped fibered chart \(\left( V^{r},\psi ^{r}\right) \) on \(J^{r}Y\) and define the partial fiber homothety \(\chi _{t,1}{:}{=}\left( \chi _{t},{{\,\textrm{Id}\,}}\right) :V^{r}\rightarrow V^{r},\) acting on the variables \(y^{A},y_{~\nu }^{A},\ldots ,y_{~\nu _{1}\cdots \nu _{r}}^{A}\) only

$$\begin{aligned}{} & {} \chi _{t,1}(x^{\mu };y^{A},\ldots ,y_{~\nu _{1}\cdots \nu _{r}}^{A};z^{I},\ldots ,z_{~\nu _{1}\cdots \nu _{r}}^{I})\nonumber \\{} & {} \quad {:}{=}(x^{\nu };ty^{A},\ldots ,ty_{~\nu _{1}\cdots \nu _{r}}^{A};z^{I},\ldots ,z_{~\nu _{1}\cdots \nu _{r}}^{I}) \end{aligned}$$
(31)

and, accordingly, the partial Vainberg–Tonti Lagrangian \(\lambda _{1}= {\mathcal {L}}_{1}\textrm{d}x\in \Omega _{m,M}\left( J^{r}Y\right) \) as

$$\begin{aligned} {\mathcal {L}}_{1} {:}{=}y^{A}\int _0^1 {\mathcal {E}}_{A}\circ \chi _{t,1}\textrm{d}t. \end{aligned}$$
(32)

Having realized these, we then obtain quite easily:

Theorem 2

(Variational bootstrapping) If the partial differential system (27) is locally variational and the Vainberg–Tonti-type Lagrangian \(\lambda _{1}={\mathcal {L}}_{1}\textrm{d}x\) as in (32) can be defined,  then : 

  1. 1.

    \(\lambda _{1}\) is a locally defined Lagrangian for (27);

  2. 2.

    Any other Lagrangian \(\lambda \) producing (27) as its \(y^{A}\)-field equations can only differ from \(\lambda _{1}\) by a \(y^{A}\)-independent term \(\lambda _{2}\) and a boundary term \(\lambda _{0}{:}\)

    $$\begin{aligned} \lambda =\lambda _{1}+\lambda _{2}+\lambda _{0}, \end{aligned}$$
    (33)

    where \(\lambda _{2}={\mathcal {L}}_{2}(x^{\mu };z^{I},z_{~\mu }^{I},\ldots ,z_{~\mu _{1}\cdots \mu _{r}}^{I})\textrm{d}x\) (i.e.,  \(\lambda _{2}\) is projectable onto the second factor \(J^{r}Y_{2})\) and \(\lambda _{0}=\left( \textrm{d}_{\mu }f^{\mu }\right) \textrm{d}x\) is given by a divergence expression.

Proof

As discussed above, the configuration system for (27) is the fibered product \(Y=Y_{1}\times _{M}Y_{2},\) as in (28). Fix a vertically star-shaped fibered chart domain \(V^{r}\subset J^{r}Y\) and encode the left-hand sides of our equations into the source form \({\mathcal {E}}_{\left( 1\right) }={\mathcal {E}}_{A}\textrm{d}y^{A}\wedge \textrm{d}x\) on \(V^{r}.\)

  1. 1.

    Proving that \(\lambda _{1}\) is indeed a Lagrangian for \({\mathcal {E}}_{\left( 1\right) }\) is done by direct computation, in a completely similar way to, e.g., [9, Sec. 4.9], or [16] – with the only difference that here we have an extra variable \(z^{I},\) which, yet, remains unaffected. For courtesy to the reader, we briefly reproduce in Appendix A the calculation for \(r=2.\)

  2. 2.

    Since \(\lambda \) and \(\lambda _{1}\) should produce the same Euler–Lagrange expressions with respect to \(y^A,\) it follows that they can only differ by terms that do not contribute in any way to these expressions – that is, terms that do not have any dependence on \(y^{A}, y^{A}_\mu ,\ldots , y^{A}_{\mu _{1} \cdots \mu _{r}} ,\) or divergence expressions.

\(\square \)

If the given Eq. (27) are not locally variational, then, the partial variational completion procedure guarantees that the correction terms \(\dfrac{\delta {\mathcal {L}}_{1}}{\delta y^{A}}-{\mathcal {E}}_{A}\) still have the meaning of obstructions from \(y^{A}\)-variationality of \({\mathcal {E}}_{\left( 1\right) }.\)

3.2 A first example: Einstein–Klein–Gordon equations

Before passing to our case of interest, which are metric-affine theories of gravity, let us check how the variational bootstrapping method works in a case where a Lagrangian is already known. A straightforward such example is the one of a single real-valued scalar field \(\phi \) minimally coupled to the metric \(\varvec{g}\) in the context of General Relativity.

In this case, the dynamical variables are a metric tensor and a scalar field; the corresponding configuration space is

$$\begin{aligned} Y={{\,\textrm{Met}\,}}\left( M\right) \times _{M}\left( M\times {\mathbb {R}}\right) . \end{aligned}$$
(34)

Accordingly, we can consider on \(J^{2}Y\) the naturally induced fibered coordinates \(\left( x^{\mu }; g_{\mu \nu },g_{\mu \nu ,\rho }, g_{\mu \nu ,\rho \tau }; \phi ,\phi _{\rho },\phi _{\rho \tau }\right) .\) This situation is notoriously described by the Einstein–Klein–Gordon Lagrangian \(\lambda _{\tiny {\text {EKG}}}={\mathcal {L}}_{\tiny {\text {EKG}}}\textrm{d}x,\) with

$$\begin{aligned} {\mathcal {L}}_{\tiny {\text {EKG}}}=\left( \dfrac{1}{2\kappa } R - \dfrac{1}{2} g^{\alpha \beta } \phi _{\alpha }\phi _{\beta } - V\left( \phi \right) \right) \sqrt{\left| \det g\right| }, \end{aligned}$$
(35)

(where \(\kappa \in {\mathbb {R}}_0\) is a constant and \(V=V\left( \phi \right) \) is a real-valued smooth function), which produces the field equations

$$\begin{aligned} \left\{ \begin{array}{c} G_{\mu \nu }=\kappa T_{\mu \nu }^{\left( \phi \right) } \\ \square \phi =V^{\prime }\left( \phi \right) \end{array} \right. , \end{aligned}$$
(36)

where \(\square = g^{\mu \nu }\nabla _{\mu }\nabla _{\nu }\) is the covariant d’Alembertian and

$$\begin{aligned} T_{\mu \nu }^{\left( \phi \right) }=\phi _{\mu }\phi _{\nu } - \dfrac{1}{2} g^{\alpha \beta }\phi _{\alpha }\phi _{\beta } g_{\mu \nu } - V\left( \phi \right) g_{\mu \nu }. \end{aligned}$$
(37)

Let us pretend for one moment to have no idea about the Lagrangian (35) and recover it from the metric equations (36) by \({{\,\textrm{Met}\,}}\left( M\right) \)-variational completion. Considering \(g_{\mu \nu }\) as our dynamical variables, the relevant “partial” source form is \({\mathcal {E}}_{g}={\mathcal {E}}^{\mu \nu }\textrm{d}g_{\mu \nu }\wedge \textrm{d}x,\) where

$$\begin{aligned} {\mathcal {E}}^{\mu \nu }{} & {} {:}{=}-\dfrac{1}{2}\Bigg (\dfrac{1}{\kappa } G^{\mu \nu } - \phi ^{\mu }\phi ^{\nu } + \dfrac{1}{2} g^{\alpha \beta } \phi _{\alpha }\phi _{\beta }g^{\mu \nu } \nonumber \\ {}{} & {} \quad + V\left( \phi \right) g^{\mu \nu }\Bigg )\times \sqrt{\left| \det g\right| }, \end{aligned}$$
(38)

with \(\phi ^\alpha {:}{=}g^{\alpha \beta }\phi _\beta .\) The Vainberg–Tonti Lagrangian \(\lambda _1 ={\mathcal {L}}_{1}\textrm{d}x\) is then given by:

$$\begin{aligned} {\mathcal {L}}_{1} = g_{\mu \nu }\int _0^1 {\mathcal {E}}^{\mu \nu }\circ \chi _{t,1}\textrm{d}t, \end{aligned}$$
(39)

where the lower integration point is understood as a limit and the partial fibered homotheties

$$\begin{aligned}{} & {} \chi _{t,1}:\left( x^{\mu },g_{\mu \nu },g_{\mu \nu ,\rho }, g_{\mu \nu ,\rho \tau }; \phi , \phi _{\rho }, \phi _{\rho \tau }\right) \\{} & {} \quad \mapsto \left( x^{\mu },t g_{\mu \nu }, t g_{\mu \nu ,\rho }, t g_{\mu \nu ,\rho \tau }; \phi , \phi _{\rho }, \phi _{\rho \tau }\right) \end{aligned}$$

only affect \(g_{\mu \nu }\) and their derivatives. We then have

(40)
(41)

where \(,\) and are, respectively, the formal Christoffel symbols, formal curvature tensor and formal Ricci tensor of the Levi-Civita connection associated to \(\varvec{g}.\) This leads to:

$$\begin{aligned} {\mathcal {L}}_{1}= & {} -\dfrac{1}{2} g_{\mu \nu } \int _0^1 \left\{ \left( \dfrac{1}{\kappa }G^{\mu \nu } - \phi ^{\mu }\phi ^{\nu } + \dfrac{1}{2}g^{\alpha \beta }\phi _{\alpha }\phi _{\beta }g^{\mu \nu }\right) \right. \nonumber \\{} & {} \left. t^{\frac{m}{2}-2}+ V\left( \phi \right) g^{\mu \nu } t^{\frac{m}{2}-1}\right\} \sqrt{\left| \det g\right| }\textrm{d}t\end{aligned}$$
(42)
$$\begin{aligned}= & {} \left( \dfrac{1}{2\kappa }R - \dfrac{1}{2}g^{\alpha \beta }\phi _{\alpha }\phi _{\beta } - V\left( \phi \right) \right) \sqrt{\left| \det g\right| } = {\mathcal {L}}_{\tiny {\text {EKG}}}.\nonumber \\ \end{aligned}$$
(43)

Moreover, according to Theorem 2, Lagrangian terms that cannot be recovered by \({{\,\textrm{Met}\,}}(M)\)-variational completion are either variationally trivial (boundary terms), or independent of the metric and its derivatives. Let us investigate the second possibility, that is, we are looking for Lagrangians \(\lambda _2={\mathcal {L}}_{2}\textrm{d}x\) built using \(\phi \) and its partial derivatives only. The only natural (generally covariant) operators we can use, without employing the metric or its derivatives, are the exterior derivative and the wedge product (see also the discussion in the beginning of Sect. 5.2 below). From the coordinate function \(\phi ,\) one can build the 1-form \(\textrm{d}_H\phi = \phi _\mu \textrm{d}x^\mu \in \Omega _{1,M}(J^1Y)\) but this does not allow to build forms of higher rank, considering that \(\textrm{d}_H\left( \textrm{d}_H\phi \right) \equiv 0\) and \(\textrm{d}_H\phi \wedge \textrm{d}_H\phi \equiv 0.\)

In other words, if \(\dim (M)>1\) (which is our case of interest), there are no natural Lagrangian terms \(\lambda _2\) that can be built from a scalar field and its partial derivatives alone.Footnote 5 It follows that the full Lagrangian of the theory is given, up to boundary terms, by (43). Variation with respect to \(\phi \) then allows to also recover the second equation of (36), the Klein–Gordon equation.

The above statement can be generalized to any theory employing as dynamical variables a metric and a single, real-valued scalar field \(\phi \) minimally coupled to it; in these theories, any natural Lagrangian can be fully recovered, up to boundary terms, from the metric equations only.

4 The case of metric-affine theories

In metric-affine theories, the dynamical variables are, a priori, a metric \(\varvec{g}\) and an independent connection \(\Gamma .\) Yet, since, on the one hand, a metric automatically determines its Levi-Civita connection – which we will in the following denote by – and, on the other hand, the difference between two connections is tensorial, it is customary to split \(\Gamma \) as

(44)

where \({\textbf{L}}\) is a tensor field of type \(\left( 1,2\right) \) over the spacetime manifold M,  called the distortion tensor. This way, the problem of determining the pair \(\left( \varvec{g},\Gamma \right) \) is equivalent to the one of determining the pair \(\left( \varvec{g},{\textbf{L}}\right) .\) Such pairs are local sections of the fibered product:

$$\begin{aligned} Y={{\,\textrm{Met}\,}}\left( M\right) \times _{M}T_{2}^{1}M , \end{aligned}$$
(45)

where \(T_{2}^{1}M\) is the vector bundle of all tensors of type \(\left( 1,2\right) \) over M. Assuming that Y is equipped with local fibered coordinates \((x^{\mu };g_{\mu \nu },L^{\mu }_{\nu \rho }),\) a general source form of order r will have a \(g_{\mu \nu }\)-part and an \(L^{\mu }_{\nu \rho }\) one:

$$\begin{aligned} {\mathcal {E}} = {\mathcal {E}}^{\mu \nu }\textrm{d}g_{\mu \nu }\wedge \textrm{d}x+{\mathcal {E}}^{\nu \rho }_{\mu } \textrm{d}L^{\mu }_{\nu \rho }\wedge \textrm{d}x=:{\mathcal {E}}_{g}+{\mathcal {E}}_{L}. \end{aligned}$$
(46)

In the following, we assume that we have an educated guess for the metric equations \({\mathcal {E}}_{\mu \nu }=0,\) that is, we know

$$\begin{aligned} {\mathcal {E}}_{g}={\mathcal {E}}^{\mu \nu }\textrm{d}g_{\mu \nu }\wedge \textrm{d}x \end{aligned}$$
(47)

and we are only looking for generally covariant metric-affine Lagrangians.

The following result will be helpful in our quest:

Theorem 3

(Janyska, [10]) All generally covariant Lagrangians \(\lambda ={\mathcal {L}}\textrm{d}x,\) of order r in a metric tensor and another tensor variable \(\varvec{\Phi }\) are given by : 

(48)

where denotes covariant -derivatives up to order r and is the (formal) curvature tensor of

Picking \(\varvec{\Phi } = {\textbf{L}}\) leads to an immediate consequence:

Corollary 4

All the variationally nontrivial (non-boundary) terms of a generally covariant metric-affine Lagrangian,  containing the metric tensor or its derivatives,  can be recovered by \({{\,\textrm{Met}\,}}(M)\)-variational completion. The only terms that cannot be recovered by this procedure are purely affine terms;  these are built from the distortion tensor and its Levi-Civita covariant derivatives,  in such a way that the Christoffel symbols (and their derivatives) eventually cancel out.

Let us explore, in the following, all the possibilities of building natural purely affine Lagrangians, over 4-dimensional spacetimes.

5 Purely affine invariants

Fix \(\dim M=4.\) We will determine all generally covariant (or natural) Lagrangians

$$\begin{aligned} \lambda ={\mathcal {L}}(L^{\alpha }_{\beta \gamma },L^{\alpha }_{\beta \gamma ,\mu }, \ldots , L^{\alpha }_{\beta \gamma ,\mu _{1}\cdots \mu _{r}})\textrm{d}x \end{aligned}$$
(49)

which can be built on 4-dimensional metric-affine backgrounds \(\left( M,\varvec{g}, \Gamma \right) ,\) from the components of the distortion tensor \({\textbf{L}}\) of the connection and their derivatives – briefly, on \(L,\partial L,\partial \partial L,\cdots \) alone – i.e., that are completely independent of the metric \(\varvec{g}.\) In other words, we are looking for a generally covariant differential form

$$\begin{aligned} \lambda \in \Omega _{4,M} (J^{r}T_{2}^{1}M). \end{aligned}$$
(50)

The technique we use below is the so-called algebraic method for finding differential invariants by Kolar et al. [11].

5.1 The polynomial property

We will first prove that natural Lagrangians depending on distortion alone must actually be polynomial in the components of \({\textbf{L}}\) and their derivatives. To this aim, we start by using Theorem 3 in the previous section, which shows that any natural metric-affine Lagrangian \(\lambda \) must, apart from the metric tensor and derivatives of the curvature tensor \(,\) be expressed as a smooth function of \(L^{\alpha }_{\beta \gamma }\) and their -(formal) covariant derivativesFootnote 6 up to some order r. According to Corollary 4, purely affine terms must be of the form:

(51)

The advantage of the latter writing is that all the building blocks of \(\lambda \) are tensor fields; in other words, we transfer our problem of finding a mapping \(\lambda \) defined on the fibers of a jet bundle, into one of finding a function defined on a Cartesian product of vector spaces. More precisely, the formal covariant differentiation operator acts linearly on the fibers of \(T_{2}^{1}M \) (to be even more precise, is a vector bundle morphism covering the identity of M) and thus its image is again a vector bundle; similarly, the images of further iterations of are again vector bundles. That is, fixing an arbitrary point \(x\in M,\) and a chart around it, we obtain that the fibers

(52)

where with r terms \(,\) are all finite dimensional real vector spaces, whereas the restriction of the Lagrangian density to these fibers becomes a mapping

$$\begin{aligned} f\;{:}{=}\; {\hat{\mathcal {L}}}_{x}:V_{0}\times V_{1}\times \cdots \times V_{r}\rightarrow {\mathbb {R}} \end{aligned}$$
(53)

defined on a Cartesian product of vector spaces. This allows us to use the following result:

Theorem 5

(Homogeneous Function Theorem [11]) Let \(V_{i},\) \(i=0,\ldots ,r\) be finite dimensional real vector spaces. If \(f :V_{0}\times \cdots \times V_{r}\rightarrow {\mathbb {R}}\) is a smooth function with the property that there exist \(b\in {\mathbb {R}}\) and \(a_{i}>0,\) \(i=0,\ldots , r\) such that : 

$$\begin{aligned} k^{b}f\left( v_{0},\ldots ,v_{r}\right) =f\left( k^{a_{0}}v_{0},\ldots ,k^{a_{r}}v_{r}\right) ,\quad \forall k>0, \end{aligned}$$
(54)

then,  f must be a sum of polynomials of degree \(d_{i}\) in \(v_{i},\) where \(d_{i}\in {\mathbb {N}}\) satisfy the relation

$$\begin{aligned} a_{0}d_{0} + \cdots + a_{r}d_{r}=b. \end{aligned}$$
(55)

If there are no non-negative integers \(d_{0},\ldots ,d_{r}\) with the above property,  then f is the zero function.

Let us apply the homogeneous function theorem to our situation. The requirement that \(\lambda ={\hat{\mathcal {L}}}\textrm{d}x\) should be invariant under any coordinate changes naturally induced by local coordinate changes \(x^{\mu }=x^{\mu }\big (x^{\nu ^{\prime }}\big )\) on the base manifold implies, in particular, the invariance under homotheties (with constant factor \(k>0\))

$$\begin{aligned} x^{\alpha }=kx^{\alpha ^{\prime }},\quad \alpha =0,1,2,3. \end{aligned}$$
(56)

Under these transformations, the wedge product \(\textrm{d}x = \textrm{d}x^{0}\wedge \textrm{d}x^{1}\wedge \textrm{d}x^{2}\wedge \textrm{d}x^{3}\) changes as

$$\begin{aligned} \textrm{d}x=k^{4}\textrm{d}x^{\prime }. \end{aligned}$$
(57)

The invariance condition on \(\lambda ={\hat{\mathcal {L}}}\textrm{d}x\) then implies

(58)

where primes on L denote the components of L and of its covariant derivatives in the new coordinates \(x^{\alpha ^{\prime }}\) (and we have omitted the indices for simplicity). Moreover, we have that

which then leads to:

(59)

Now, fix an arbitrary point \(x\in M.\) The restriction of \({\hat{\mathcal {L}}}\) to the fiber at x of our configuration space is a smooth mapping defined on a Cartesian product of vector spaces (53). Applying to it the homogeneous function theorem, with

$$\begin{aligned} b = 4,~\ a_{0} = 1,~\ a_{1} = 2,\ldots , a_{r} = r+1, \end{aligned}$$
(60)

it follows that \({\hat{\mathcal {L}}}\) must be a sum of r homogeneous polynomials in etc., whose degrees \(d_{i}\in {\mathbb {N}}\) in the derivatives of order i in L satisfy

$$\begin{aligned} d_{0} + 2 d_{1} + 3 d_{2} + \cdots + \left( r+1\right) d_{r}=4. \end{aligned}$$
(61)

In particular, we must have \(r\le 3.\) We have then proven:

Proposition 6

Any smooth,  generally covariant Lagrangian \(\lambda ={\hat{\mathcal {L}}}\textrm{d}x\) depending only on the distortion tensor of an affine connection \(\Gamma \) and its derivatives is of order at most three. Moreover,  the Lagrangian density \({\hat{\mathcal {L}}}\) must be expressed as a sum of homogeneous polynomials of degrees \(d_{0},\) \(d_{1},\) \(d_{2}\) and,  respectively,  \(d_{3}\) in the variables \(,\) and,  respectively,  satisfying : 

$$\begin{aligned} d_{0} + 2 d_{1} + 3 d_{2} + 4 d_{3}=4. \end{aligned}$$
(62)

The next step is to realize that, under the hypothesis that \(\lambda \) cannot depend on the metric \(\varvec{g},\) it cannot depend on either the coefficients or their derivatives; that is, and their derivatives must eventually cancel out in the expression of \({\hat{\mathcal {L}}},\) giving

(63)

This leaves us with \({\mathcal {L}}\) as a sum of homogeneous polynomials in L\(\partial L,\) \(\partial \partial L\) and \(\partial \partial \partial L,\) of the same degrees as in (62). We thus obtain:

Corollary 7

Any smooth,  generally covariant Lagrangian \(\lambda ={\hat{\mathcal {L}}}\textrm{d}x\) depending only on the distortion tensor of an affine connection \(\Gamma \) and its derivatives is of order at most three. Moreover,  it must be a sum of homogeneous polynomials,  of degrees \(d_{0},\) \(d_{1},\) \(d_2\) and,  respectively,  \(d_3\) in the variables L\(\partial L,\) \(\partial \partial L\) and,  respectively,  \(\partial \partial \partial L\) satisfying

$$\begin{aligned} d_{0} + 2 d_{1} + 3 d_{2} + 4 d_{3}=4. \end{aligned}$$
(64)

Remark. In the Homogeneous Function Theorem, the smoothness assumption on f on an entire Cartesian product of vector spaces \(V_{0}\times \cdots \times V_{n}\) (in particular, smoothness at its zero vector) is essential. As a consequence, the result cannot be applied to find Lagrangians depending on a metric tensor, since the condition \(\det g \not = 0\) forbids \(\left( g_{\alpha \beta }\right) \) from being all zero; otherwise stated, we cannot pick any of the fibers of \({{\,\textrm{Met}\,}}\left( M\right) \) as \(V_{0},\) since these fibers are not vector spaces. This allows for non-polynomial natural Lagrangian forms in the metric, such as \(\sqrt{\left| \det g\right| }\textrm{d}x.\)

Yet, in our case, our configuration space \(T_{2}^{1}M \) is a vector bundle, therefore the Homogeneous Function Theorem can be safely applied, ensuring that \(\lambda \) must be polynomial, as in (64). Actually, as we will see in the next subsection, relation (64) can be further simplified.

5.2 Classification of pure distortion Lagrangians

To find all generally covariant (natural), pure distortion Lagrangians \(\lambda \in \Omega _{4,M}\left( J^{r}T_{2}^{1}M \right) ,\) we will use Corollary 7 above, together with several known results in the literature, which we briefly review below:

  1. 1.

    Any natural Lagrangian (which is an equivariant mapping, under the action of the differential group), must be obtained as the result of a natural operator [10].

  2. 2.

    The only possible first order natural operators acting on differential p-forms on a manifold and returning a \((p+1)\)-form, are constant multiples of the exterior derivative \(\textrm{d}\) [10, 11]. Moreover, natural (generally covariant) differential operators on arbitrary tensor bundles are (see, e.g., [18, p4]) compositions of exterior differentiation and invariant (natural) algebraic operators. Actually, when producing Lagrangians, which are horizontal differential forms on fibered manifolds, the appropriate operator is the horizontal (or formal) exterior derivative \(\textrm{d}_H = h \circ \textrm{d}.\) In particular, since \(\textrm{d}_H\circ \textrm{d}_H \equiv 0,\) there are no natural operators of order \(r > 1\) on tensor bundles, involving the tensor variables and their derivatives alone.

  3. 3.

    Natural algebraic operators on tensor bundles are, [18], only finite iterations of: permutations of indices, tensor product with invariant tensors, trace with respect to one subscript and one superscript and linear combinations of these.

Using the above mentioned results, together with Corollary 7, we find:

Theorem 8

Assume \(\dim (M)=4.\) Then,  all natural metric-affine Lagrangians depending on the distortion of the connection alone are of order at most one and must be expressed as a sum whose terms fall into one of the following classes : 

  1. 1.

    Purely algebraic terms :  These must be expressed as homogeneous polynomials of degree 4 in the components \(L^{\alpha }_{\beta \gamma }\) of the distortion tensor.

  2. 2.

    First order terms :  These must be either quadratic in L and linear in \(\partial L,\) or quadratic in \(\partial L\) (and independent of L). In any of the two cases,  these must be obtained via horizontal exterior differentiation and/or wedge product,  from differential forms of rank at most three,  depending algebraically on L.

Proof

Assume \(\lambda ={\mathcal {L}}\textrm{d}x\) is a natural Lagrangian of order r on \(T_{2}^{1}M .\) According to Corollary 7, we must have \(r\le 3\) and the density \({\mathcal {L}}={\mathcal {L}}\left( L,\partial L,\partial \partial L,\partial \partial \partial L\right) \) must be polynomial in all its variables, with the respective degrees \(d_{0},\) \(d_{1},\) \(d_{2},\) \(d_{3}\) satisfying (64); but, taking into account remark no. 2 above, we must actually have

$$\begin{aligned} d_{2} = d_{3} = 0. \end{aligned}$$
(65)

In other words, \(\lambda \) is of order at most one. Moreover, Eq. (64) becomes:

$$\begin{aligned} d_{0} + 2 d_{1} = 4. \end{aligned}$$
(66)

This leaves room for three possibilities:

  1. 1.

    \(d_{0}=4, d_{1}=0,\)

  2. 2.

    \(d_{0} = 2, d_{1} = 1,\)

  3. 3.

    \(d_{0} = 0, d_{1} = 2,\)

corresponding to the two situations in the statement of the theorem.

The statement on the exterior derivative/wedge product structure for the latter two cases follows again from the results recalled in the beginning of this subsection. \(\square \)

A complete list of the possibilities of building such Lagrangians is given in Appendix B.

6 Conclusion

In the present paper, we have shown that, in any physical theory involving more than one dynamical variable, having an educated guess (which can be based, e.g., on some physical principle) at the field equations with respect to one such variable, say \(y^{A},\) one can find in a systematic way, the closest variational equations \(\dfrac{\delta {\mathcal {L}}}{\delta y^{A}} = 0\) to our original guess. Using this procedure, all (non-boundary) terms in the Lagrangian density \({\mathcal {L}}\) that involve in a way or another \(y^{A}\) or their derivatives can be recovered. The obtained Lagrangian density then also determines the Euler–Lagrange equations for the other dynamical variables, say \(z^I\)-again, up to terms that are completely independent of \(y^A\) and their derivatives.

As a first application, we studied the case of metric-affine theories. Assuming that one has a guess at the metric equations, one can recover the closest equations to these, that are Euler–Lagrange equations for some Lagrangian. In that case, we also classified the terms in the Lagrangian that cannot be recovered by our technique (i.e. terms that are completely independent of the metric tensor). We found that these are given by polynomial expressions (of degree at most 4) in the distortion of the connection and its first order derivatives.

In a forthcoming paper, we will apply this technique to determine the metric-affine models of gravity that give the closest metric equations to the \(\Lambda \)CDM model of cosmology. This will then further allow us to constrain the evolution equations for the connection (i.e., for the distortion tensor).

Of course, the procedure outlined in this paper is fully general and can thus be applied to a variety of other contexts, e.g., to scalar–tensor theories, or scalar–vector–tensor theories. To further extend our procedure it might also be interesting to study in detail cases where the convergence of the Vainberg–Tonti Lagrangian, as defined in this paper, cannot be guaranteed. We leave these and other questions for future works.