Cosmological higher-curvature gravities

We examine higher-curvature gravities whose Friedmann–Lemaître–Robertson–Walker configurations are specified by equations of motion which are of second order in derivatives, just like in Einstein gravity. We name these theories Cosmological Gravities and initiate a systematic exploration in dimensions D⩾3 . First, we derive an instance of Cosmological Gravity to all curvature orders and dimensions D⩾3 . Second, we study Cosmological Gravities admitting non-hairy generalizations of the Schwarzschild solution characterized by a single function whose equation of motion is, at most, of second order in derivatives. We present explicit instances of such theories for all curvature orders and dimensions D⩾4 . Finally, we investigate the equations of motion for cosmological perturbations in the context of generic Cosmological Gravities. Remarkably, we find that the linearized equations of motion for scalar cosmological perturbations in any Cosmological Gravity in D⩾3 contain no more than two time derivatives. We explicitly corroborate this aspect by presenting the equations for the scalar perturbations in some four-dimensional Cosmological Gravities up to fifth order in the curvature.


Introduction
The quest for the theory of Quantum Gravity remains as one of the most puzzling, challenging and fundamental problems of Physics.It has been a vivid and central theme for both the gravitational and theoretical high-energy physics communities over the last decades, in which some potential candidates for Quantum Gravity have been put forward and developed, String Theory being the most prominent one.At the level of low-energy effective actions, it corrects the Einstein-Hilbert Lagrangian through the introduction of specific higher-order terms in the spacetime curvature [1][2][3][4][5][6].This way, the study of quantum corrections to General Relativity (GR) amounts to the exploration of higher-order gravities (equivalently, higher-curvature or higher-derivative gravities).
Another realm in which higher-curvature gravities have proven to be extremely useful is that of cosmology.Such an insight is due to Starobinsky [55,56], who realized that adding a Ricci-scalar squared term R 2 into the Einstein-Hilbert action provides a natural explanation for cosmic inflation, which furthermore fits very well to current observations [57].This has motivated the exploration of more generic higher-curvature gravities for cosmological purposes, placing special emphasis on the investigation of f (R) theories [58][59][60][61][62][63][64][65].Their choice corresponds to the fact that they are classically equivalent to scalar-tensor theories with equations of motion of second order in derivatives [66].Nonetheless, it is clear that these theories do not represent the most general effective theories of gravity, which would feature higher-curvature terms with explicit Riemann curvature and Ricci curvature tensors.
However, given the vast number of higher-curvature gravities existing at each curvature order, it is more convenient to initiate the (cosmological) exploration of such more generic theories with the study of certain higher-curvature gravities -including Riemann curvature and Ricci curvature tensors -possessing some special features, such as having second-order equations of motion for Friedmann-Lemaître-Robertson-Walker (FLRW) configurations.There are several reasons to impose such a condition.First, because it dramatically simplifies the study of cosmological solutions with higher-curvature corrections.Second, since an analogous requirement in the context of spherically symmetric solutions has turned out to be greatly successful [14,18,[67][68][69][70][71][72][73].And third, because theories with second-order equations of motion on cosmological backgrounds automatically provide instances of holographic theories satisfying a holographic c-theorem [74][75][76][77][78].
Interestingly enough, examples of higher-curvature theories in four spacetime dimensions with second-order equations for FLRW backgrounds have been constructed at cubic order in the curvature [79], quartic (and quintic) order [80] and up to eighth order in the curvature [81].Among other things, it was found that the aforementioned cubic theory yields equations of motion for scalar perturbations on top of FLRW backgrounds which are of second order in time derivatives [80] and that they provide a mechanism for cosmic inflation devoid of additional fields to the metric [79,[81][82][83][84].For other aspects of these theories, we refer the reader to [85][86][87][88][89][90] and references therein.Also, in the context of theories fulfilling a holographic c-theorem, higher-order gravities with second-order equations on top of FLRW backgrounds were derived at any curvature order in D = 3 [77], while for generic dimensions a recursive algorithm to find Cosmological Gravities at all curvature orders (although with explicit covariant derivatives of the curvature) was provided in Reference [78].
However, there still remain many open questions regarding theories with second-order equations for the scale factor in FLRW configurations.For example, is it possible to obtain an explicit example of a theory of this class at all curvature orders (and without covariant derivatives) in four dimensions?And in generic dimensions D ≥ 4? Could it be feasible to derive an instance of a theory at any curvature order and dimensions D ≥ 4 that possesses second-order equations of motion for both FLRW backgrounds and static and spherically symmetric configurations?And regarding cosmological perturbations, could it be possible that ensuring second-order equations of motion for FLRW backgrounds forces the equations for scalar perturbations to be of second order in time derivatives?
In the present manuscript, we address and answer all previous questions in the affirmative.Specifically, if we coin the name Cosmological Gravity to refer to any (higher-curvature) theory of gravity with second-order equations on top of FLRW configurations, we have managed to derive the results listed below.

Summary of results
1. Section 2 provides some preparatory material regarding the properties of curvature invariants when evaluated on top of FLRW backgrounds.More concretely, it is proven that the equations of motions for FLRW backgrounds in generic higher-curvature gravities may be obtained through the variation of the Lagrangian evaluated on such ansätze and that all curvature invariants on these configurations may be expressed as polynomials of two independent functions.
2. Section 3 introduces the class of Cosmological Gravities and presents an extremely simple condition (see Proposition 4) to determine whether a theory is a Cosmological Gravity.This condition is further used to derive, for the first time, an instance of a Cosmological Gravity at every curvature orders and for all spacetime dimensions1 D ≥ 3, see Theorem 1.
3. Section 4 focuses on the interplay between Cosmological Gravities and the class of Generalized Quasitopological Gravities, characterized by possessing non-hairy spherically symmetric black holes fully specified by one single function.On the one hand, for D ≥ 5 we find an example of a Cosmological Gravity also belonging to the restricted class of Quasitopological Gravities (in which the equation for the function characterizing the spherically symmetric solution is algebraic) at all curvature orders.Then, on the other hand, in D = 4 we are able to construct an instance of a Cosmological Generalized Quasitopological Gravity at all curvature orders.
4. Section 5 is devoted to the study of cosmological perturbations in Cosmological Gravities.More concretely, scalar perturbations are considered, proving that all Cosmological Gravities in D ≥ 3 possess equations of motion for the scalar perturbations on top of FLRW backgrounds which are of second order in time derivatives (although featuring higher-order spatial derivatives).We also study the cosmological scalar perturbations for the four-dimensional Cosmological Generalized Quasitopological Gravities derived in Section 4 and show the associated equations of motion for the perturbations up to order n = 5.
5. Finally, in Section 6 we present our conclusions and discuss possible future directions.

Note on conventions
We will be using the spacelike (i.e., mostly-plus) signature for the metric g ab , as well as the conventions of Reference [91] for the spacetime curvature.Specifically, the Riemann curvature tensor R abc d reads: where Γ ab c denotes the Christoffel symbols and where [ab] stands for antisymmetrization of indices, including the corresponding weights.The Ricci curvature tensor R ab and the Ricci scalar R are defined as follows: In another vein, the Weyl tensor W abc d and the traceless Ricci tensor Z ab of a D-dimensional Lorentzian manifold are given by: 2 Higher-order gravities and their structure on FLRW configurations Consider the most general diffeomorphism-invariant theory of gravity L(g ab , R abcd ) which is built out from arbitrary contractions2 of the Riemann curvature tensor R abcd associated to a metric g ab .We will assume that it reduces to GR at sufficiently low energies and that it admits an effective expansion in powers of the curvature, so that it can be expressed as follows: where Λ stands for the cosmological constant, ℓ denotes the typical length scale from which on the effects of higher-curvature terms become relevant (e.g., the Planck scale), α n,m are dimensionless couplings and the terms R (n,m) represent the g n different (linearly independent) curvature invariants which can be constructed at order 2n in derivatives 3 .In particular, the Lagrangian (2.1) takes the form of a higher-order (or higher-curvature) gravity, which generically possesses infinitely-many terms with an increasing number of derivatives, but which could also be truncated at a certain order.
We shall be interested in studying D-dimensional (D ≥ 3) cosmological configurations corresponding to the following FLRW ansatz for the metric: where a(t) stands for the scale factor and k = −1, 0, 1 controls the topology of the spatial sections (hyperbolic, planar or spherical).Two remarks should be done at this point.On the one hand, we allow the spacetime dimension D to be an arbitrary integer larger than two.Indeed, higher-curvature gravities in dimensions larger than four appear naturally in the context of String Theory (see e.g.References [1,2,6,92]) and within the exploration of holographic Conformal Field Theories (CFTs) in generic dimensions (for instance, check References [19, 23-25, 27, 35, 75-78]).On the other hand, observe that we have included a time-dependent function F (t), which could be reabsorbed via a time-reparametrization.The main motivation to keep F (t) explicit is that it will be highly useful for the derivation of the subsequent generalized Friedmann equations (the equations of motion of L(g ab , R abcd ) on FLRW configurations (2.2)), as we will momentarily show.For further reference, let us also present corresponding FLRW metric with F (t) = 1, which we will indistinctly denote as ds 2 a,1 , or ds 2 a : If necessary, we will refer to ds 2 a as the comoving FLRW ansatz.Analogously, we will denote by L a,F = L| a,F the reduced Lagrangian obtained by evaluation of L(g ab , R abcd ) on the FLRW ansatz (2.2).Proposition 1.Let L(g ab , R abcd ) be any (higher-order) theory of gravity 4 .The equations of motion of L(g ab , R abcd ) for FLRW configurations (2.2) are given by the Euler-Lagrange variation of La,F = |g| a,F L a,F with respect to a and F : where5 dot stands for time derivative.After the functional variation, one can reparametrize time to set F = 1.
Proof.Let us consider an arbitrary metric g ab and some coordinates (t, r, x i ), with i = 1, 2, ..., D − 2. Write g tt = −F (t), g rr = a 2 (t)/(1 − kr 2 ) and g ij = a 2 (t)r 2 h ij , where the indices i, j refer the (D − 2) coordinates transverse to the (t, r) coordinates.Observe that: where E ab denotes the generic gravitational field equations of the theory L(g ab , R abcd ) (not evaluated on any particular configuration).If we now evaluate E ab on the FLRW ansatz (2.2), so that t becomes naturally a time coordinate, r represents a radial variable and h ij is simply the metric of the (D − 2)-dimensional round sphere, then the symmetries of such an FLRW spacetime fix E ab to be of the form: where g ab is the FLRW metric given in Equation (2.2).This implies that the whole system of Einstein equations reduces to a system of two coupled ordinary differential equations.At this point, evaluation of Equations (2.6) and (2.7) on the background (2.3) and subsequent use of Equation (2.8) reveals that: δ La,F δa (2.10) Since s 1 (t) and s 2 (t) are precisely the unique independent components of the gravitational equations of motion, we conclude.
Proposition 1 provides us with a very convenient way to compute the equations of motion of any theory for (comoving) FLRW ansätze (2.3).In particular, one just needs to evaluate the corresponding higher-curvature Lagrangian L(g ab , R abcd ) on the configuration (2.2) and carry out the functional derivatives of the resulting reduced Lagrangian with respect to a and F (and setting afterwards F (t) = 1 if desired).Consequently, it would be extremely convenient for the study of cosmological solutions of higher-order gravities to have a better understanding on the structure of higher-curvature terms when evaluated on the FLRW ansatz (2.2).
To this aim, it is appropriate to express all curvature invariants in terms of Weyl tensors W abcd (1.3), traceless Ricci tensors Z ab (1.4) and Ricci scalars R (1.2).This is clearly useful, since metrics of the form given at Equation (2.2) are conformally flat: (2.11) Hence any higher-curvature term containing Weyl tensors will exactly vanish on FLRW configurations, so we may forget about them for the computation of the subsequent equations of motion on such backgrounds.We need, thus, to concentrate on those terms made up with traceless Ricci tensors and Ricci scalars.For that, we observe that: where we remind that dot stands for time derivative (with respect to comoving time).This means that all contractions of traceless Ricci tensors will be proportional to an appropriate power of Γ. Define: (2.13) The previous argumentation shows the following proposition.
Proposition 2. All non-zero curvature invariants built out from p Weyl tensors, q traceless Ricci tensors and m Ricci scalars are proportional to each other when evaluated on the FLRW ansatz (2.2).More concretely, if (R m W p Z q ) i is any possible way of contracting all such tensors, then This latter proposition implies that any linear combination of invariants of n-th order in the curvature, when evaluated on the FLRW ansatz (2.2), takes the form: for some coefficients β i and non-negative integers b As far as one is interested in FLRW configurations, it turns out that one can always exchange any curvature invariant R (n) by a specific combination of curvature invariants which, evaluated on an FLRW ansatz, is equal to is a polynomial of Σ and Γ, one may wonder if it is possible to choose a finite number of low-order curvature invariants which, evaluated on FLRW ansätze, generate in a multiplicative way (together with the Ricci scalar) all possible polynomials (2.15).To this aim, define: They satisfy: (2.17) We have the following result.
Proposition 3. Let R (n) be any linear combination of invariants of n-th order in the curvature.Then: Definition 1.A theory L(g ab , R abcd ) is said to be a Cosmological Gravity if its equations of motion for FLRW configurations (2.2) -and henceforth for comoving FLRW configurations (2.3) -are of second order in time derivatives.
The most direct examples of Cosmological Gravities are Einstein Gravity or Lovelock gravities.However, these cases are somewhat trivial, since such theories possess second order equations of motion for any background.There also exist other instances of Cosmological Gravities which do not possess second order equations of motion when evaluated on generic backgrounds, as the following example shows.
Example 1.Consider the following higher-curvature theory in D = 4 [79]: Although the generic gravitational field equations are of fourth order in derivatives, this theory possesses second-order equations of motion on top of FLRW backgrounds, so it is an example of a Cosmological Gravity.
In general, given a certain higher-order gravity L(g ab , R abcd ), one could check whether it is a Cosmological Gravity by studying whether the whole set of gravitational equations of motion for FLRW backgrounds boils down to the resolution of second-order equations of motion for the scale factor.Nevertheless, it would be desirable to test this condition by a more direct procedure which circumvents the task of deriving the general equations of motion.If L a,F denotes (as before) the reduced Lagrangian obtained by evaluating L(g ab , R abcd ) on the FLRW ansatz (2.2), it turns out that there exists a concise requirement to discern whether a given theory is of the cosmological type, as we present next.This condition had already been analyzed in Reference [78,93], and here we prove in detail that it is a necessary and sufficient condition to have second-order equations for a(t).Proposition 4. A theory L(g ab , R abcd ) is a Cosmological Gravity if and only if the associated reduced Lagrangian L a,1 = L a,F | F =1 on the comoving FLRW ansatz (2.3) is linear in ä: for the purposes of this proposition we may equivalently work directly with L a,F .All potential terms including third or fourth time-derivatives may arise from the following terms, appearing in the aforementioned functional derivatives (note that no second derivatives of F appear in curvature invariants): First, let us take a look at the term t 1 .Clearly, t 1 would not produce terms with three time derivatives of the scale factor a if: Note now the following identities: Hence the previous condition (3.6) is equivalent to: Equation (2.15) implies that the reduced Lagrangian L a,F , which we assume includes terms up to n-th curvature order, may be expressed as L a,F = n p=0 β p Γ p Σ n−p , for some couplings β p .Then: where we defined Since the set of Γ p Σ l is linearly independent (both when F = 1 and when not), we conclude that the previous expressionand a fortiori ∂ 2 L a,F ∂ä 2 -is zero if and only if: Let us move now to the study of the term t 2 .Observe that Equation (3.8) guarantees that t 2 will possess no more than two time derivatives of F , so we can concentrate our efforts on potential higher-derivatives of the scale factor.To this aim, let us momentarily set F = 1.
In such a case, t 2 will not contain terms of third order or higher in derivatives of the scale factor if and only if: On the one hand: where Σ a,1 and Γ a,1 denote evaluation of Σ and Γ on F = 1.Noting that: then we get: , where we made use of the constraint (3.10) and where we defined By appropriate linear combinations of (3.10) when evaluated on p and p + 1, one can derive that On the other hand, the first term of (3.11) reads: .
(3.17) Subtracting the latter expression to the previous one (3.16),direct use of Equation (3.10) reveals that Expression (3.11) is identically satisfied.If we now recover a generic F (t) by a time reparametrization, we observe that Equation (3.11) would remain unaffected, on account of Equation (3.8).Hence Equation (3.8) (either for generic F (t) or for F = 1) is a necessary and sufficient condition for a theory to be a Cosmological Gravity and we conclude.
Having derived a convenient way with which to check if a higher-curvature gravity is of the cosmological type, our next goal will be to obtain the form of the equations of motion on FLRW backgrounds for the most general Cosmological Gravity.To this aim, we introduce some notation first.Definition 2. Two Cosmological Gravities are said to be inequivalent if their equations of motion on the FLRW ansatz (2.2) are linearly independent.Otherwise, we call them equivalent.
The previous definition introduces naturally the notion of equivalence classes of Cosmological Gravities.In particular, we will refer to each different equivalence class as inequivalent Cosmological Gravity.Those Cosmological Gravities which are equivalent to the theory defined by a Lagrangian equal to zero form the trivial class of Cosmological Gravities, and the remaining theories will give rise to non-trivial inequivalent Cosmological Gravities.We are going to see next that there is one and only one non-trivial inequivalent Cosmological Gravity at each curvature order and all dimensions D ≥ 3.
For that, consider a higher-curvature gravity , each piece L (n) being of n-th curvature order.By Proposition 2 and Equation (2.15), the evaluation of L (n) on the comoving FLRW ansatz (2.3), which we denote as L (n) a,1 , reads: where we assume that both Γ and Σ are evaluated at F = 1.Also, β 1 = 0 since no linear piece in Γ may come from an actual curvature invariant evaluated on a comoving FLRW configuration.The condition (3.4), in terms of the couplings β n , was obtained in Equation (3.10), where it was written in terms of . Equation (3.10) may be expressed in terms of the constants β n as follows: If we set β 0 to be a free parameter, then (3.19) defines a linear system of n − 2 equations for n − 2 unknowns, since β 1 = 0.For every n, it turns out that it admits a unique solution given by: Therefore, we conclude that there exists a unique equivalence class of Cosmological Gravities at each order n, since the subsequent equations of motion on FLRW backgrounds, up to a constant, are unambiguously fixed at each curvature order.In virtue of Proposition 3 and Equation (2.17), it turns out that a representative C (n) for each equivalence class may be expressed as follows 6 : This proves the following theorem.
Theorem 1.The most general Cosmological Gravity L cosmo , up to equivalent Cosmological Gravities, is given by7 where the terms C (n) were given previously (3.22), µ p are dimensionless couplings and ℓ is a length scale.
Therefore, we have managed to identify a representative of the unique non-trivial equivalence class of Cosmological Gravities at arbitrary curvature order n and for any space-time dimension D ≥ 3. Taking into account that Cosmological gravities satisfy automatically a holographic c-theorem and vice versa [78], instances of Cosmological Gravities were built up to all orders in8 D = 3 [77], to eighth order in the curvature in four dimensions [79][80][81] and also a recursive algorithm to construct Cosmological Gravities (with covariant derivatives of the curvature, though) in generic spacetime dimension was provided in Reference [78].Now, 6 These n-th order invariants C (n) turn out to satisfy the following intriguing recursive relation: exactly with those theories satisfying a holographic c-theorem presented in [77], see Equation (141) of that Reference (v2 in arXiv).As pointed there, the n-th order three-dimensional invariants coincide, up to terms vanishing on FLRW ansätze, with those invariants arising in the expansion of the so-called Born-Infeld Massive Gravity [94][95][96].
with the present result, we are able to confirm the existence of Cosmological Gravities (without covariant derivatives of the curvature) by an explicit example in all spacetime dimensions and curvature orders n.And, by the argumentation of [78], we can equivalently claim to have found an instance of a theory satisfying a holographic c-theorem for all dimensions and curvature orders.The lowest-order Cosmological Gravities presented in Equation (3.22) read as follows 9 : Let us now present the form of the equations of motion of the most general Cosmological Gravity on comoving FLRW backgrounds (2.3).For that, it is enough to consider the theory (3.23).In presence of a perfect fluid with density ρ and pressure p, the generalized Friedmann equations associated to the theory (3.23) are given by: where Λ is the cosmological constant and 4 Cosmological Generalized Quasitopological Gravities Once we have found an explicit representative of the unique non-trivial inequivalent Cosmological Gravity existing at each curvature order in all dimensions D ≥ 3, our next goal will be to find other representatives which satisfy additional properties when evaluated on different gravitational backgrounds.
We will be interested in looking for Cosmological Gravities which admit, furthermore, a special type of non-hairy generalizations of the Schwarzschild-Tangherlini black-hole solution.
In particular, we will concentrate on those Cosmological Gravities for which the aforementioned static and spherically symmetric black holes are fully characterized by a single function whose equation of motion can be analytically integrated into a second-order one.Such static and spherically symmetric configurations may be written as follows: where dΩ 2 D−2 is the metric of the round D − 2 sphere.Higher-curvature gravities (nonnecessarily cosmological) enjoying these features have been extensively explored in the literature under the name of Generalized Quasitopological Gravities (GQTGs) [14,18,[67][68][69][70][71][72][73].The space of GQTGs may be further subdivided into the class of Quasitopological Gravities, for which the equation of motion for f (r) can be integrated into a purely algebraic one, and the class of proper GQTGs, for which such an integrated equation is strictly of second order in derivatives of f (r).Additional relevant properties satisfied by GQTGs are that they allow for the analytic computation of black-hole thermodynamics, possess second-order linearized equations of motion on top of maximally symmetric backgrounds and form a perturbative basis for the space of effective theories of gravity [16,17,[69][70][71][72][73][100][101][102][103].Definition 3. A theory L(g ab , R abcd ) is said to be a Cosmological GQTG if and only if it is both a Cosmological Gravity and a GQTG.Specifically, a Cosmological GQTG possesses equations of motion of second order in derivatives for the function f (r) in static and spherically symmetric configurations (4.1) and for the scale factor a(t) in FLRW backgrounds (2.3).If the theory is of the quasitopological class, we will coin the name Cosmological Quasitopological Gravity.
Apart from the somewhat trivial case of Einstein gravity (and Lovelock gravities for generic spacetime dimension), explicit examples of cosmological GQTGs have been explicitly found in D = 4.
Example 2. Consider again the four-dimensional cubic theory proposed in Reference [79], which we rewrite here for the benefit of the reader: where the combinations of cubic invariants P and P were presented in Equations (3.2) and (3.3).We already explained in Example 1 that this theory is a Cosmological Gravity.However, by direct computation one observes that P is identically zero when evaluated on generic static and spherically symmetric backgrounds, and one may also notice that P actually coincides with the celebrated Einsteinian Cubic gravity [69], the first proper GQTG ever identified.Consequently, we conclude that L AEJ is an instance of Cosmological GQTG.
In the previous example, we implicitly used the notion of trivial GQTGs.They are defined as combinations of curvature invariants which do not contribute to the subsequent equations of motion of the function f (r) in Equation (4.1).They will be crucial in the following, since they will allow us to convert non-cosmological GQTGs into Cosmological GQTGs, as we will momentarily see.
Having said this, now we proceed to the problem of finding an instance of Cosmological GQTG at each curvature order and for all dimensions10 D ≥ 4. Previous literature in the topic focused on the four-dimensional case and identified Cosmological GQTGs up to eighth order in the curvature.Nevertheless, no closed expression valid for arbitrary orders in the curvature is known.Moreover, in dimensions D ≥ 5, the problem of finding Cosmological GQTGs seems not to have been previously explored (with the celebrated exception of cubiccurvature theories, for which it was noted the existence of a Quasitopological Gravity of the cosmological type [78]).First, we devote ourselves to the identification of Cosmological GQTGs in dimensions D ≥ 5 at all curvature orders and, afterwards, we concentrate on the four-dimensional case, finding instances of Cosmological GQTGs at all orders.

Cosmological GQTGs in D ≥ 5
Let us begin by presenting some notation, extracted from Reference [104].We define the following curvature invariants: Remember that D ≥ 5. Also, we introduce: where Now consider the following order-n curvature invariants: ) where γ n,l,p is only non-zero for l, p ≥ −2 and l + p + 4 ≤ n, in which case It was shown in Reference [104] that Z (n) defines a Quasitopological gravity for all D ≥ 5 and curvature order n ≥ 1.Now we are going to try to build Cosmological GQTGs of order n in the curvature by adding trivial GQTGs (i.e., combinations of curvature invariants which do not contribute to the equation of f (r) in Equation (4.1)) to Z (n) .It is important to note that this is a quite adventurous proposal.Indeed, for D ≥ 5 there exist n − 1 GQTGs at each curvature order n providing linearly independent equations of motion for the function f (r), only one of the quasitopological class [73,104].Therefore, it is not clear at all that starting solely from the Quasitopological Gravity Z (n) and deforming it through the addition of trivial terms will result in a Cosmological Quasitopological Gravity.However, such an idea turns out to be successful, as we proceed to show.For that, let us consider the following trivial GQTGs: They satisfy T Z (n+2) ds 2 f = 0, so they are trivial GQTGs.However, T Z (n+2) does not vanish when evaluated on FLRW backgrounds (2.3), so it does contribute to the equations of motion of cosmological backgrounds.In particular, we have that where Γ was defined back at Equation (2.12).Having said this, now observe that the Quasitopological Gravities presented in Equation (4.18) have a quite simple form when evaluated on the FLRW background (2.2): where Interestingly enough, it turns out that Z (n) for n ≤ 3 is already a Cosmological Gravity for every D ≥ 5, without adding further curvature invariants.To find Cosmological GQTGs (of the quasitopological class) at all curvature orders n ≥ 4, let us consider: where η n,l are certain constants.The evaluation on top of the FLRW background (2.2) reads: Now, according to Proposition 4, Q (n) will be a Cosmological Gravity if and only if: After some computations, it can be seen that this requirement uniquely fixes the coefficients η n,l to be: where ⌊x⌋ denotes the largest integer less or equal than x and n ≥ 4. With this choice, will automatically satisfy condition (4.26).Since T Z (l+2) is a trivial GQTG, we arrive to the following theorem.
Theorem 2. Let us consider the n-th order higher-curvature gravities: where the constants η n,l are given by Equation (4.27) and T Z (l+4) denotes the trivial GQTGs presented in Equation (4.20).Then, Q (n) is a Cosmological Quasitopological Gravity for all D ≥ 5 and n ≥ 1.
To the best of our knowledge, these represent the first instances ever of Cosmological Quasitopological Gravities, which will also satisfy a holographic c-theorem by construction.Given that Quasitopological Gravities form a very particular subset of the whole space of GQTGs in D ≥ 5, it is remarkable that adding some trivial GQTGs to the theories Z (n) given in Equation (4.18) produces Cosmological GQTGs at all curvature orders n and dimensions D ≥ 5. Indeed, one is tempted to talk about a Quasitopological miracle.
For low orders, the Cosmological GQTGs we have found in generic D ≥ 5 read as follows: Higher-order Cosmological Quasitopological Gravities in generic dimensions D ≥ 5 may be found in Appendix A.
In another vein, it is important to note that it is possible to produce Cosmological GQTGs by adding trivial GQTGs to combinations of proper GQTGs.To illustrate this feature, let us work momentarily in D = 5 and consider the following proper quartic GQTG: If we now construct the theory: one can readily check that this defines a Cosmological GQTG in D = 5 which is not of the quasitopological type.Therefore, proper GQTGs may also be used to obtain Cosmological GQTGs.All these results show that the complete characterization of the space of Cosmological GQTGs in D ≥ 5 is a quite rich and interesting problem to be explored in the future.

Four-dimensional Cosmological GQTGs
Let us now explore the problem of finding Cosmological GQTGs in D = 4.The existence of such theories has been established up to eighth order in the curvature [79][80][81].Our goal is extend this result to all curvature orders n by finding an example of a four-dimensional Cosmological GQTG for every n.
To this aim, let us start by presenting an instance of a (proper) GQTG in D = 4 at any curvature order n ≥ 1 [104]: where S (2) coincides with the Gauss-Bonnet invariant and

.41)
The strategy to find instances of four-dimensional Cosmological GQTGs at arbitrary curvature order is the same as in previous section: add appropriate trivial GQTGs which do not vanish on FLRW background and allow us to satisfy the cosmological condition, in conjunction with the GQTG definition.To this aim, let us consider the following combination of curvature invariants: where By direct computation one checks that T S n is a trivial GQTG for every n ≥ 3. Also, one may readily see that S (n) + T S n satisfies Equation (3.4) for every n, so it also belongs the cosmological class.Thus we prove the following theorem.Theorem 3.For any curvature order n, consider the following higher-curvature gravity: with T S (n) given by Equations (4.42) and (4.43).It defines an example of Cosmological GQTG at all curvature orders.
Consequently, we have managed to extend the existence of Cosmological GQTGs for all curvature orders.Equivalently, we may claim to have found instances of GQTGs of arbitrary order which furthermore satisfy a holographic c-theorem.Expression (4.47) provides the following Lagrangians at the lowest curvature orders: In the appendix we present additional expressions for Q (n) up to n = 9.
Let us now relate the cubic and quartic theories we have obtained to other theories that have already appeared in the literature.On the one hand, the cubic Lagrangian Q (3) turns out to be related to the theory presented in Equation (3.1) through the expression As a matter of fact, up to constant factors, Q (3) represents the unique combination of cubic invariants which forms a Cosmological GQTG.
On the other hand, Cosmological GQTGs of quartic order have been explored in Reference [89].In their writing, they list three examples of quartic Cosmological GQTGs: R A (4) , R B and R C (4) (See Equations (5)(6)(7) in Reference [89]).The relation between their theories and our Q (4) is given by T ′ (4) being a trivial GQTG of quartic order.

Cosmological Perturbations in Cosmological Gravities
In this final section of the manuscript we devote ourselves to the study of cosmological perturbations in the context of Cosmological Gravities.As it is well known, cosmological perturbations may be divided into scalar, vector and tensor perturbations.On the one hand, vector perturbations can be argued to be negligible in an expanding Universe -such as ours -, while tensor perturbations are associated to gravitational waves [105].On the other hand, scalar perturbations couple to both density and pressure perturbations and are responsible for the formation of structures in the Universe, so we decide to focus on them.
In the conformal-Newtonian gauge, scalar perturbations of FLRW backgrounds may be encompassed in two scalar functions Φ(η, x i ) and Ψ(η, x i ) which modify the FLRW ansatz as follows: where η stands for the conformal time 11 and γ ij dx i dx j stands either for the metric of the (D − 1)-dimensional round sphere, hyperbolic space or plane space.
There is a crucial property satisfied by all Cosmological Gravities in all dimensions D ≥ 3.Not only they possess second-order equations of motion for the scale factor a(t) on FLRW backgrounds, but also the equations of motion for the scalar perturbations Φ and Ψ are strictly of second-order in time derivatives.This feature was already observed to hold for cubic Cosmological Gravities in D = 4 in Reference [80] and for certain quartic Cosmological Gravities in Reference [89], and now we proceed to prove it in complete generality.
Theorem 4. Let L(g ab , R abcd ) be any Cosmological Gravity.Then, the linear equations of motion for cosmological scalar perturbations of the form (5.1) are of second order in time derivatives.
Proof.The general gravitational equations of motion for any higher-curvature gravity L(g ab , R abcd ) take the form [106]: where P abcd = ∂L ∂R abcd .From here, it is clear that all derivatives of metric components of higher-degree than two arise from the piece ∇ c ∇ d P acbd .
Assume that L(g ab , R abcd ) is a Cosmological Gravity and consider the perturbed FLRW metric (5.1).First, we observe that the linear equations of motion for Φ and Ψ may not contain any term with four temporal derivatives of Φ or Ψ.Indeed, if Φ = Φ(η) and Ψ = Ψ(η) had only time dependence, relabel η → t and associate a 2 (η)(1 + 2Φ(η)) with F (t) and a 2 (η)(1 − 2Φ(η)) with a 2 (t) in Equation (2.2).Since L(g ab , R abcd ) is a Cosmological Gravity, no time derivatives of order larger than two may appear in the subsequent equations of motion, and this guarantees the absence of terms with four temporal derivatives of Φ or Ψ.As a byproduct, we also note that no terms of the form ∂ 3 η Φ or ∂ 3 η Ψ may appear.Hence all potential terms with more than two temporal derivatives must be of the form Such pieces may arise either from mixed derivatives ∂ η ∂ i Φ or ∂ η ∂ i Ψ in the tensor P abcd or from second-order time derivatives ∂ 2 η Φ and ∂ 2 η Ψ.In the latter case, the potentially higher-derivative terms would arise from ∇ i ∇ η P aibη + ∇ η ∇ i P aηbi .By commuting partial derivatives with the introduction of appropriate contractions with Riemann curvature tensors, one observes that all possible higher-derivative terms Noting that, at leading order, those terms in P aηbi already linear in the perturbations may be considered to be acted by covariant derivatives of the unperturbed FLRW space, ∇ η ∇ i P aηbi would generate terms ∂ 3 η Φ or ∂ 3 η Ψ, which are forbidden according to the argumentation above.Therefore, all terms ∂ 3 η ∂ i Φ or ∂ 3 η ∂ i Ψ may only arise from terms containing ∂ η ∂ i Φ or ∂ η ∂ i Ψ in the tensor P abcd evaluated at linear order in the perturbations.Now, let R (1) , Z (1)  ab and W (1)   ab cd denote the Ricci scalar, traceless Ricci tensor and Weyl curvature tensor at first order in the perturbations.The following properties hold: ab ab cd ) ab ∂W (1)   ab cd where f 1 (η) is a certain function whose specific form is unimportant for the purposes of this proof.These properties ensure that we just need to care about potential terms with ∂ η ∂ i Ψ and, furthermore, we know that they may only arise from terms containing the traceless Ricci tensor at linear order in the perturbations.
Let us then consider all terms that may contain ∂ η ∂ i Ψ at linear order in the perturbations of a generic tensor P abcd of any higher-curvature gravity.Note the following properties: for any c 1 , c 2 ∈ R.These aspects imply that any potential piece 12 A abcd in P abcd containing ∂ η ∂ i Ψ must have the following schematic form: where Γ and Σ were defined back in Equations (2.12), f 2 (η) is a certain function and (2.13) and (dZ Terms arising from ∂R ∂R abcd and ∂W ijkl ∂R abcd may be seen not to contribute to pieces with ∂ η ∂ i Ψ from the properties of the traceless Ricci tensor of the unperturbed FLRW spacetime and Equations (5.5) and (5.6).Now, when we consider ∇ c ∇ d A acbd , the pieces with ∂ 3 η ∂ i Ψ must arise from the covariant derivatives with c = η and d = η acting on ∂ η ∂ i Ψ necessarily.However, from the properties of the unperturbed FLRW metric, it turns out that: Consequently, no third time derivatives of Φ or Ψ may appear in the subsequent equations for the linear perturbations of Cosmological Gravities and we conclude.
Therefore, Cosmological Gravities do also yield equations of motion of second order in time derivatives for scalar cosmological perturbations.However, this does not exclude the presence of higher-derivative terms in the linear equations of motion for the perturbations, such as pieces affected by two time derivatives and two spatial derivatives.After all, Cosmological higher-curvature Gravities do not possess equations of motion of second-order for generic backgrounds, so one should expect the presence of such higher-derivative terms in the linear equations of motion for the perturbations 13 .In fact, we are going to explicitly check this by computing the equations of motion for the scalar perturbations for our fourdimensional Cosmological GQTGs derived in Equation (4.47).This shall be the goal of next subsection.
Nonetheless, before closing this part, there are two additional aspects that deserve to be mentioned.First, note that Cosmological Gravities which are identically vanishing on top of FLRW backgrounds might contribute to the equations for scalar perturbations, so one should pay attention to such type of terms.Second, one may wonder whether Cosmological Gravities do also produce linear equations of motion of second order in time derivatives for all cosmological perturbations, including tensor and vector modes.However, direct check of the (trivial) Cosmological Gravity W abcd W abcd shows that the equations of motion for tensor perturbations in the usual transverse and traceless gauge are of fourth order in time derivatives, thus showing that not all Cosmological Gravities may provide equations of second order in time derivatives for all perturbation modes.

Cosmological Perturbations of four-dimensional Cosmological GQTGs
Once proven that every Cosmological Gravity features equations of motion of second order in time derivatives for scalar cosmological perturbations, we will present such equations for the four-dimensional Cosmological GQTGs we have obtained in Theorem 3.For the sake of simplicity, we will restrict ourselves to the case of transverse planar spatial 3-sections, so that γ ij can be taken to be Euclidean metric in Cartesian coordinates.
We begin by computing the tensor P abcd associated to the n-th order Cosmological GQTG Q (n) presented in Equation (4.47).It is given by: where O(Φ 2 , Ψ 2 , ΦΨ) stands for curvature invariants that become second-order in the perturbations if evaluated on (5.1).Notice that in this expression all terms beyond linear order in the Weyl tensor are O(Φ 2 , Ψ 2 , ΦΨ).When evaluated on Equation (5.1), one may explicitly check (by direct computation) that ∇ c ∇ d P acbd carries at most second-order temporal derivatives in the scalar degrees of freedom Φ and Ψ, as guaranteed by Theorem 4. Now, write the gravitational equations of motion in the form where T ab stands for the stress-energy tensor, which one could take to be that of a perfect fluid, if ab denote the contribution to E ab arising from the n-th order Cosmological GQTG Q (n) .Define the Hubble factor H in terms of the comoving time t, aH = ȧ.In terms of the conformal time η, we trivially have a 2 H = a ′ , where prime denotes the partial derivative with respect to conformal time η.Write down the perturbations in Fourier space: for three-momentum k = (k x , k y , k z ).Let Ẽab and Ẽ(n) ab be the subsequent equations of motion in Fourier space: Inspired by previous work [89], we decompose Ẽ(n) ab as follows: where i and j refer to the spatial indices.Then, we obtain the following expressions for Ẽ(n) ηη , A (n) , B (n) and C (n) at linear order in the perturbations and for the Cosmological GQTGs of curvature orders n = 3, 4 and 5.

Cubic case
The equations of motion for the scalar perturbations in the cubic theory Q (3) read as follows: -25 - Scalar perturbations of Cosmological GQTGs at cubic order have already been explored in the literature [80,89].Since, as commented before, there is a unique (up to an innocent global factor) four-dimensional Cosmological GQTG at cubic order, the equations we have just found should exactly coincide with those of [80,89].This is the case for the equations in Reference [89], but some disagreements with the values presented in Reference [80] have been encountered 14 .Given the exact matching of our equations with those of [89], we believe the disagreements with [80] are due to the present of some small typos in the latter Reference.

Quartic case
In this case, the linearized equations of motion read If we compare these equations to those of Reference [89], we observe that they are not the same.But this is of course to be expected, since our theory and the one considered by that Reference are not the same, see Equation (4.52).Nonetheless, we have been able to check that on adding the quartic trivial GQTG introduced in Equation (4.53), we recover exactly (up to an innocent global factor) the equations of Reference [89].

Quintic case
Finally, we present the perturbations for the n = 5 order.The expression of the associated equations of motion are given by (5.25) (5.26) We would like to emphasize that these represent the first computations ever of cosmological perturbations in quintic Cosmological GQTGs.

Conclusions
In conclusion, in this work we have carried out an exhaustive study of higher-curvature gravities with second-order equations of motion on FLRW backgrounds in generic dimensions D ≥ 3. First, after examining the properties of curvature invariants when evaluated on FLRW backgrounds, we were able to derive Proposition 4, which provides an extremely simple requirement to check whether a given higher-curvature gravity is of the cosmological type in generic D. This condition depends solely on the properties of the theory when evaluated on FLRW ansätze.Next, we obtained the unique expression, in terms of the Ricci scalar and the unique independent component of the traceless Ricci tensor on FLRW configurations, which satisfies the aforementioned condition at each curvature order and dimension D. With this result, we obtained an instance of Cosmological Gravity at each curvature order and spacetime dimension D. Since one is free to add and remove terms that vanish on top of FLRW backgrounds (such as any curvature invariant containing at least one Weyl curvature tensor), our result completes the classification of all inequivalent Cosmological Gravities, defined as those equivalence classes arising after stating that two Cosmological Gravities are equivalent if they differ by a piece that vanishes for FLRW backgrounds.In the literature, examples of Cosmological Gravities had been built at all curvature orders in D = 3 and a recursive relation was derived to obtain theories (with covariant derivatives of the curvature) of the cosmological type at all orders and dimensions (although studied from the holographic c-theorem perspective), so our results complete the study of Cosmological Gravities without covariant derivatives of the curvatures for all orders and dimensions, providing explicit and relatively simple examples of such theories.Next, we studied the compatibility between the cosmological condition and the requirement of being a GQTG.We considered D ≥ 4 and we observed that not every Cosmological Gravity belongs to the GQTG class.Nevertheless, we were able to prove two remarkable results.On the one hand, for dimensions D ≥ 5, we showed that Quasitopological Gravities (i.e., GQTGs with algebraic equations of motion for static and spherically symmetric configurations) can always be transformed into a Cosmological Quasitopological Gravity by adding a prescribed combination of curvature invariants that vanishes on top of static and spherically symmetric backgrounds.We proved this by showing an example of such a theory at all curvature orders and dimensions D ≥ 5. On the other hand, for D = 4, we presented an instance of a Cosmological GQTG at all curvature orders, thus completing previous works in the literature which found examples of Cosmological GQTGs up to eighth order in the curvature.Observe that all the aforementioned Cosmological Gravities (not necessarily fulfilling the GQTG condition) will also satisfy a holographic c-theorem by construction [78].
Finally, we studied the properties of cosmological perturbations in Cosmological Gravities.Remarkably, we showed that every Cosmological Gravity for any dimension D ≥ 3 is such that the subsequent linearized equations of motion for scalar cosmological perturbations possess at most two time derivatives (although they may contain spatial derivatives of higher order).Then we restricted our attention to the four-dimensional Cosmological GQGTs we had previously derived, provided the necessary ingredients to compute the linear equations of motion for scalar cosmological perturbations and presented these equations for theories up to fifth order in the curvature.
In the future, there are several intriguing avenues to be explored.For example, it would be interesting to further characterize the class of Cosmological Gravities in generic dimensions.Is it possible to obtain full classification results of these theories at all curvature orders, beyond inequivalent Cosmological Gravities?Similarly, one could ask the same question in the context of Cosmological GQTGs.More specifically, in the same way it is possible to transform Quasitopological Gravities in D ≥ 5 and at any curvature order into Cosmological Quasitopological Gravities by adding combinations of curvature invariants that vanish on static and spherically symmetric configurations, could we upgrade proper GQTGs in D ≥ 5 into Cosmological GQTGs 15 ?On the other hand, in the four-dimensional case, it is tanta-lizing to find the expression for all theories that fulfill both the definitions of Cosmological Gravity and GQTG.In particular, one may wonder about the properties of these theories beyond FLRW and static and spherically symmetric configurations.For instance, it can be checked that the unique four-dimensional cubic Cosmological GQTG also possesses Taub-NUT solutions whose equations of motion are of second order in derivatives [111], so it would be interesting to investigate whether this trend continues to all curvature orders or whether there are further constraints to be imposed.
On a different front, another clear future direction corresponds to the study of vector and tensor perturbations in the context of Cosmological Gravities.As mentioned in Section 5, while scalar perturbations are guaranteed to have equations of motion with no more than two time derivatives, this is no longer the case for tensor perturbations in Cosmological Gravities.However, there are specific Cosmological Gravities in which cosmological tensor perturbations do obey equations of motion with no more than two temporal derivatives [89], so it is intriguing to examine which further conditions need to be required so that cosmological tensor (and vector) perturbations possess equations of second order in time derivatives.
Finally, there are two canonical extensions of our Cosmological Gravities whose examination would be interesting in the future.First, one could investigate the addition of (nonminimally coupled) matter to Cosmological Gravities, such as a scalar field or a U(1) gauge field.Regarding this last point, it is known that the definition of GQTGs may be canonically extended to allow for non-minimal couplings to a U(1) vector [41,[112][113][114][115], so it makes sense to explore whether a similar situation may occur for Cosmological Gravities, Also, the inclusion of this type of matter has mainly been considered in the context of minimally coupled non-linear electrodynamics [116][117][118], so this aspect deserves careful scrutiny.Second, a natural question would be the addition of terms with covariant derivatives of the curvature, expected to appear from an effective field theory perspective.In particular, after the recent discovery of GQTGs with covariant derivatives [18], it is tantalizing to investigate whether there exist Cosmological Gravities featuring covariant derivatives of the curvature which also satisfy the GQTG condition.We expect to address these directions in the near future.B Four-dimensional Cosmological Generalized Quasitopological Gravities at orders n = 6, 7, 8 and 9 We devote this appendix to the presentation of examples of four-dimensional Cosmological Generalized Quasitopological Gravities from the sixth up to the ninth curvature order, thus extending previous results in the literature [79][80][81].These theories have been derived by setting n = 6, 7, 8 and 9 in Equation (4.47).

20736RZ a b Z b a Z c d Z d e Z e c + 1080 W abcd W abcd 3 −
1620 W abcd W abcd 2

4 −Q ( 9 ) 2 − 2 −
abcd W abcd 4 − 9072 W cdef W cdef 3 Z ab Z ab + 108864 Z ab Z ab = R 9 + 216R 7 W abcd W abcd − 432R 7 Z ab Z ab − 10584R 6 W cd ab W ef cd W ab ef + 9072R 6 Z a b Z c d W bd ac + 12096R 6 Z a b Z b c Z c a + 17010R 5 W abcd W abcd 27216R 5 W abcd W abcd Z ef Z ef + 40824R 5 Z a b Z b a 163296R 5 Z a b Z b c Z c d Z d a − 176904R 4 W ghij W ghij W cd ab W ef cd W ab ef + 272160R 4 W cd ab W ef cd W ab ef Z gh Z gh

W abcd W abcd 4 − 4 − 3919104R Z e f Z f e 2 Z
81648R W abcd W abcd 3 Z ef Z ef + 979776R Z ab Z ab a b Z b c Z c d Z d a − 48600 W ghij W ghij 3 W cd ab W ef cd W ab ef + 69984 W ghij W ghij 2 W cd ab W ef cd W ab ef Z kl Z kl + 995328 Z de Z de 3 Z a b Z b c Z c a .(B.4) 5W abcd W abcd − 252R5Z ab Z ab − 4410R 4 W cd ab W ef cd W ab Z ab Z ac Z b c + 4725R 3 W abcd W abcd 2 − 7560R 3 W abcd W abcd Z ef Z ef + 11340R 3 Z ab Z ab 2 − 45360R 3 Z a b Z b c Z c d Z d a − 29484R 2 W ghij W ghij W cd ab W ef cd W ab ef + 45360R 2 W cd ab W ef cd W ab ef Z gh Z gh + 72576R 2 Z ab Z ab Z cd Z de Z e c + 7560R W abcd W abcd 3 − 11340R W abcd W abcd 2 Z ef Z ef + 45360R Z ab Z ab 3 − 181440RZ ef Z ef Z a b Z b c Z c d Z d a + 62208 Z de Z de 2