1 Introduction

The \(\Lambda \text {CDM}\) model for cosmology depends on 6 parameters [1, 2]. Various features of our universe are successfully described by the \(\Lambda \text {CDM}\) model. Setting aside the cosmological constant problem and other theoretical issues, it provides us the simplest description of the universe with the cosmic microwave background radiation, the large-scale structure and the accelerated expansion, the last of which we probe for example by supernovae observations. Up to now, this model is still considered the best fitting model to the cosmological data sets.

Despite the success of the \(\Lambda \text {CDM}\) model to describe our universe, it faces tensions in explaining a few parameters from various cosmological data sets. This situation motivates us to consider models beyond \(\Lambda \text {CDM}\). The most famous and significant tension lies between the estimation of today’s Hubble expansion parameter \(H_{0}\) from Planck data [3], and its measurement from observations of the local universe, such as those from the Hubble Space Telescope (HST) [4], \(\text {H}0\text {LiCOW}\) [5], Megamaser Cosmology Project (MCP) [6], Carnegie-Chicago Hubble Program (CCHP) Collaboration [7], etc. The significance of this first tension goes up to \(5.3\sigma \) [5]. This discrepancy can be understood as a tension between late time data, which do not assume any prior cosmological model, and early universe data, which assume a prior model, i.e. the \(\Lambda \text {CDM}\). It comes to light as the early universe and the late time observations (HST) have achieved greater precision in their measurements. At present, there are several approaches to resolve this particular tension, including modified gravity (see  [8,9,10] for example), or adding new types of matter content (as early dark energy [11] for example).

The number two tension lies between the estimation of the growth of structure \(S_{8}\) from Planck data and that from the redshift space distortion data. The disagreement has a statistical significance of up to \(3.2\sigma \) [12]. There are several investigations to address this issue from the perspective of modified gravity theories [13, 14].

Two other results could fit the bill as tensions within the \(\Lambda \)CDM model. The Planck 2018 result has reported a preference for a higher lensing amplitude [15, 16]. This anomaly has been argued to be related to a new possible tension in the \(\Lambda \text {CDM}\) model of cosmology, known as \(\Omega _{K}\) tension, which is investigated in [17,18,19]. In fact the Planck collaboration also has reported that the Planck data alone prefers a closed universe [20]. In [19], it has been found that the curvature parameter of the universe is in tension with the Planck+late time data and BAO data sets. In their investigation they have found better fit to closed universe than \(\Lambda \text {CDM}\).

The cosmological tensions arising within \(\Lambda \text {CDM}\) can be interpreted as the indication that \(\Lambda \text {CDM}\) may be only a first approximation to a more accurate theory of cosmology. In this context it is worth investigating the cosmology of modified theories of gravity to address these various tensions. As mentioned, there have been several attempts which rely on modified theories of gravity. In this work, we focus on a certain class of modified theories of gravity in which there are only two local gravitational degrees of freedom propagating, dubbed minimally modified gravity (MMG) theories in [21] and then further developed in [22,23,24,25] (see [26,27,28,29] for an earlier example with two local gravitational degrees of freedom in the context of massive gravity and also [30,31,32,33,34] for more examples of MMG theories). These theories break four dimensional diff-invariance keeping the three dimensional diff-invariance so that the standard framework of cosmological studies can be applied. Even though breaking four dimensional diff-invariance leads, in general, to new degrees of freedom in addition to the usual two gravitational modes, MMG theories have Hamiltonians linear in the lapse function so that they come with a Hamiltonian constraint that will reduce the dimension of the physical phase space and leave only two tensorial modes in the theory.

Recently there has been a Hamiltonian construction for a class of MMG theories, dubbed \(f(\mathcal {H})\) theories [24], in which the standard Hamiltonian constraint \(\mathcal {H}\) of general relativity (GR) is modified to a free function \(f(\mathcal {H})\). This leads to changing the kinetic structure of the theory from GR in a background-dependent way and provides an opportunity to address the cosmological tensions.

In this article we study the cosmology in \(f(\mathcal {H})\) theories, considering a model that we have named “kink” model as it has a kink in the first derivative of the free function \(f'\left( \mathcal {H}\right) \). We introduce a consistent coupling to matter which relies on a gauge fixing in the Hamiltonian as it was done in [22, 35], and we study linear perturbations so that we can exhibit the no ghost conditions. We then implement the scalar linear perturbation equations in the Boltzmann code called CLASS [36], with covariantly corrected baryon equations of motion [37]. Subsequently a Monte Carlo sampling, using MontePython [38, 39], is done against various cosmological data sets. We consider data of Planck 2018 with planck_highl_TTTEEE, planck_lowl_EE, planck_lowl_TT, polarization [20, 40,41,42,43], of HST observations [4] consisting in the single data point of the Hubble constant \(H_{0}=74.03_{-1.42}^{+1.42}\), of the baryon acoustic oscillation (BAO) from 6dF Galaxy Survey [44] and the Sloan Digital Sky Survey [45, 46], and of the joint light curves (JLA) comprised of 740 type Ia supernovae [47]. We refer to all these data sets as Planck2018+HST+BAO+JLA. The chains are then analyzed using the well-suited GetDist package [48]. We find that there is a remarkable improvement with respect to \(\Lambda \text {CDM}\) in the likelihood-parameter \(\chi ^{2}\) with a difference of \(\Delta \chi ^{2}=16.6\) for the chosen data sets. Although there is only a minimal improvement for the \(H_{0}\) tension, the other tensions that have appeared within \(\Lambda \)CDM have a chance to be addressed by the \(f(\mathcal {H})\) theory.

This paper is organized as follows. In Sect. 2, we review \(f(\mathcal {H})\) theories from their inception, and discuss the particular matter coupling that has to be adopted to avoid the propagation of unwanted degrees of freedom. In Sect. 3, we use the Lagrangian introduced in Sect. 2 to derive the dynamics of the cosmological background, as well as its perturbations. In Sect. 4, we propose a concrete model where the function f depends on three free parameters and has a kink in its first derivative. As we will show subsequently, such a model has a very good fit to cosmological data. Then, in Sect. 5 we show that the kink model consistently gives a better fitness parameter than \(\Lambda \)CDM, considering both early and late time cosmological data sets together. This comparison is the main result of this paper. Finally, we conclude in Sect. 6 with a summary of results and a discussion.

2 Minimally modified gravity and f(H) theories

Minimally modified gravity (MMG) theories are modifications of four-dimensional GR with two local gravitational degrees of freedom. A systematic construction of gravitational theories with only (up to) two degrees of freedom has been initiated in [21,22,23] (see also [35] for a different perspective). The idea consists in renouncing the invariance under four dimensional diffeomorphisms but keeping the three dimensional (spatial) diff-invariance. As generically Lorentz-breaking gravity theories have more than two degrees of freedom, one has to find the conditions for the theory to possess enough constraints that would kill the extra degrees of freedom, which would leave us with (at most) two gravitational modes only. This section is devoted to review these conditions following [24].

In the first part, we will quickly recall the basis of the construction of MMG theories as it was done in [24] where the Hamiltonian point of view was adopted. Then, we will show how \(f(\mathcal {H})\) theories naturally emerge as simple but interesting examples of MMG theories. Finally, we will explain how to couple matter to these theories without introducing new degrees of freedom in the gravitational sector, following the construction developed in [22, 23].

2.1 Modifying the phase space

The construction of the \(f(\mathcal{H})\) class of MMG theories presented in [24] relies on the Hamiltonian formulation of GR. The idea consists in modifying the phase space of GR, and not directly the Lagrangian, in such a way that the modified theory remains invariant under spatial diffeomorphisms only but still propagates two tensorial degrees of freedom.

Hence, we start with the Arnowitt-Deser-Misner (ADM) parametrization of the metric,

$$\begin{aligned} ds^{2}\;=\;-N^{2}dt^{2}+\gamma _{ij}(dx^{i}+N^{i}dt)(dx^{j}+N^{j}dt)\,, \end{aligned}$$

in terms of the lapse function N, the shift vector \(N^{i}\) and the induced spatial metric \(\gamma _{ij}\). Hereafter, we will denote by \(D_{i}\) the covariant derivative compatible with \(\gamma _{ij}\), we will lower and raise spatial indices by the metric \(\gamma _{ij}\) and its inverse \(\gamma ^{ij}\), and we will use the notation \(\gamma \) for the determinant of the spatial metric.

The phase space is parametrized by the usual ten pairs of conjugate variables,

$$\begin{aligned} \{\gamma _{ij}(x),\pi ^{kl}(y)\}= & {} \frac{1}{2}(\delta _{i}^{k}\delta _{j}^{l}+\delta _{i}^{l}\delta _{j}^{k})\,\delta (x-y)\,,\nonumber \\ \{N^{i}(x),\pi _{j}(y)\}= & {} \delta _{j}^{i}\,\delta (x-y)\,, \nonumber \\ \{N(x),\pi _{N}(y)\}= & {} \delta (x-y)\,, \end{aligned}$$

where \(\pi ^{ij}\), \(\pi _{i}\) and \(\pi _{N}\) are momenta, and \(\delta (x-y)\) is the 3-dimensional \(\delta \)-distribution.

In GR, N and \(N^{i}\) are Lagrange multipliers, thus their conjugate momenta \(\pi _{N}\) and \(\pi _{i}\) vanish, which produces a set of four primary constraints,

$$\begin{aligned} \pi _{N}\,\approx \,0\,,\qquad \pi _{i}\,\approx \,0\,. \end{aligned}$$

We are using the notation \(\approx \) for the weak equality in the phase space, i.e. the equality up to constraints. Concerning the momenta conjugate to \(\gamma _{ij}\), they are easily related to the extrinsic curvature tensor by,

$$\begin{aligned} \pi ^{ij}= & {} \sqrt{\gamma }\left( K^{ij}-K\gamma ^{ij}\right) \,, \nonumber \\ K_{ij}\equiv & {} \frac{1}{2N}\left( \dot{\gamma }_{ij}-D_{i}N_{j}-D_{j}N_{i}\right) \,, \end{aligned}$$

with \(K\equiv K^{i}{}_{i}\) being the trace of the extrinsic curvature. As a consequence, one can immediately compute the Hamiltonian of GR which takes the very well-known form,

$$\begin{aligned} H\;=\;\int d^{3}x\sqrt{\gamma }\left( N\mathcal{H}_{0}+N^{i}\mathcal{H}_{i}\right) \,, \end{aligned}$$

where the Hamiltonian constraint \(\mathcal{H}_{0}\) and the vectorial (momentum) constraints \(\mathcal{H}_{i}\) are given by,

$$\begin{aligned} \mathcal{H}_{0}\equiv \frac{1}{\gamma }\left( \pi _{ij}\pi ^{ij}{-}\frac{1}{2}\pi ^{2}\right) {-}R\,,\qquad \mathcal{H}_{i}\equiv -2D^{j}\left( \frac{\pi _{ij}}{\sqrt{\gamma }}\right) \,,\nonumber \\ \end{aligned}$$

with R being the spatial curvature of the metric \(\gamma _{ij}\). The conservation under time evolution of the primary constraints (3) leads to the secondary constraints \(\mathcal{H}_{0}\approx 0\) and \(\mathcal{H}_{i}\approx 0\), which form together with (3) a set of first class constraints. The Hamiltonian analysis closes here: as we started with 10 pairs of variables (2) and we found 8 first class constraints, we end up with the expected 2 tensorial degrees of freedom of GR.

In [24], one proposed a deformation of the phase space of GR requiring that the modified theory remains invariant under spatial diffeomorphisms only yet still propagates two tensorial degrees of freedom. In this approach, one starts with the same (non-physical) phase space parametrized by the usual ten pairs of conjugate variables (2) and one looks for a total Hamiltonian of the form,

$$\begin{aligned} H_{\mathrm{def}}\;=\;\int d^{3}x\sqrt{\gamma }\left[ \mathcal{S}(\gamma _{ij},\pi ^{ij},R_{ij},N,D_{i})+N^{i}\mathcal{H}_{i}\right] \,,\nonumber \\ \end{aligned}$$

where \(\mathcal{S}\) is a three-dimensional scalar constructed from the variables \((\gamma _{ij},\pi ^{ij},R_{ij},N)\) and their spatial derivatives. It was implicitly assumed that neither N nor \(N^{i}\) are dynamical variables. Requiring that the theory propagates only two degrees of freedom (or less) leads necessarily to the condition that \(\mathcal{S}\) is an affine function of N, i.e.

$$\begin{aligned} \mathcal{S}(\gamma _{ij},\pi ^{ij},R_{ij},N,D_{i})\;= & {} \;\mathcal{V}(\gamma _{ij},\pi ^{ij},R_{ij},D_{i}) \nonumber \\&+N\,\mathcal{H}_{0\mathrm{def}}(\gamma _{ij},\pi ^{ij},R_{ij},D_{i})\,,\nonumber \\ \end{aligned}$$

which is, of course, compatible with the fact that N is not dynamical. Hence, \(\mathcal{H}_{0\mathrm{def}}\) can be viewed as a deformation of the usual Hamiltonian constraint of general relativity whereas \(\mathcal{V}\) is a new term. However, the functions \(\mathcal{V}\) and \(\mathcal{H}_{0\mathrm{def}}\) are not arbitrary and must satisfy extra conditions to ensure that no degrees of freedom other than the two tensor modes propagate [24]. Even though these conditions have not been solved in full generality and rigor, it was shown that any theory whose Hamiltonian is given by (7) with

$$\begin{aligned} \{\mathcal{H}_{0\mathrm{def}}(x)\,,\,\mathcal{H}_{0\mathrm{def}}(y)\}\,\approx \,0\,, \end{aligned}$$

while \(\mathcal{V}\) is totally free, defines a MMG theory. In other words, (9) is a sufficient condition for the theory defined by the Hamiltonian (7) to propagate (at most) two degrees of freedom.

2.2 Deforming the Hamiltonian constraint: \(f(\mathcal {H})\) theories

Finding all the functions \(\mathcal{H}_{0\mathrm{def}}(\gamma _{ij},\pi ^{ij},R_{ij},N,D_{i})\) which satisfy (9) seems a priori to be a highly complicated problem. The reason is that, for the theory to propagate gravitational waves, \(\mathcal{H}_{0\mathrm{def}}\) must depend on both \(\pi ^{ij}\) (which contains time derivative of \(\gamma _{ij}\)) and three-dimensional curvature terms (which contain gradients of \(\gamma _{ij}\)), and the Poisson bracket between two such terms has, in general, a very complex expression. Fortunately, this problem admits a solution that we know very well, that is the Hamiltonian constraint \(\mathcal{H}_{0}\) of GR (6) which satisfies,

$$\begin{aligned} \{\mathcal{H}_{0}[N_{1}]\,,\,\mathcal{H}_{0}[N_{2}]\}\;=\;\mathcal{H}_{i}[N_{1}D^{i}N_{2}-N_{2}D^{i}N_{1}]\,\approx \,0\,,\nonumber \\ \end{aligned}$$

where \(\mathcal{H}_{0}[N]\) and \(\mathcal{H}_{i}[N^{i}]\) are smeared constraints defined, for any function N and any vector field \(N^{i}\), by the integrals,

$$\begin{aligned} \mathcal{H}_{0}[N]\,\equiv & {} \,\int d^{3}x\sqrt{\gamma }\,N(x)\,\mathcal{H}_{0}(x)\,, \nonumber \\ \mathcal{H}_{i}[N^{i}]\,\equiv & {} \,\int d^{3}x\sqrt{\gamma }\,N^{i}(x)\,\mathcal{H}_{i}(x)\,. \end{aligned}$$

As it is very well-known, the property (10) is intimately linked to the invariance under diffeomorphisms of GR. An immediate consequence is that any deformed Hamiltonian constraint of the form

$$\begin{aligned} \mathcal{H}_{0\mathrm{def}}(x)\;=\;f(\mathcal{H}_{0})\,, \end{aligned}$$

where f is an arbitrary function, is also a solution of (9), because it satisfies,

$$\begin{aligned} \{\mathcal{H}_{0\mathrm{def}}[N_{1}]\,,\,\mathcal{H}_{0\mathrm{def}}[N_{2}]\}\;= & {} \;\mathcal{H}_{i}[(f'(\mathcal{H}_{0}))^{2}\left( N_{1}D^{i}N_{2}\right. \nonumber \\&-\left. N_{2}D^{i}N_{1}\right) ]\,\approx \,0\,, \end{aligned}$$

for any \(N_{1}\) and \(N_{2}\). The MMG theories defined by (12) have been dubbed \(f(\mathcal {H})\) theories with reference to f(R) theories. However, contrary to f(R) theories, \(f(\mathcal {H})\) theories do not propagate a scalar mode in addition to the tensor modes. More precisely, \(f(\mathcal {H})\) theories were defined with the additional condition that \(\mathcal{V}=0\) in the Hamiltonian (8), which we will also assume hereafter.

By a Legendre transformation, one can easily compute the corresponding action. Indeed, the equation of motion for \(\gamma _{ij}\),

$$\begin{aligned} \dot{\gamma }_{ij}\;=\;D_{i}N_{j}+D_{j}N_{i}+\frac{N}{\sqrt{\gamma }}(2\pi _{ij}-\pi \gamma _{ij})f'(\mathcal{H}_{0})\,, \end{aligned}$$

enables us to relate the momenta \(\pi _{ij}\) to the extrinsic curvature \(K_{ij}\) as follows,

$$\begin{aligned} K_{ij}\;=\;\frac{f'(\mathcal{H}_{0})}{\sqrt{\gamma }}\left( \pi _{ij}-\frac{1}{2}\pi h_{ij}\right) \,, \end{aligned}$$

from which we can implicitly obtain \(\pi _{ij}\) in terms of \(K_{ij}\) because, in general, this equation is non-linear in \(\pi _{ij}\). Nonetheless, one can compute the action which, after a simple calculation, is given by

$$\begin{aligned} S_{\text {grav}}[\gamma _{ij},N,N^{i}]\;= & {} \;\int d^{4}xN\sqrt{\gamma }\nonumber \\&\quad \left[ \frac{2}{f'(C)}(K_{ij}K^{ij}-K^{2})-f(C)\right] \,,\nonumber \\ \end{aligned}$$

where C is formally obtained by solving the equation

$$\begin{aligned} C\;=\;\frac{K_{ij}K^{ij}-K^{2}}{[f'(C)]^{2}}-R\,. \end{aligned}$$

Hence, we obtained the gravitational part of the action of \(f(\mathcal{H})\) theories. Now we are going to explain how to couple consistently this action to matter.

2.3 Coupling to matter: problem and solution

As was shown first in [22, 35], one cannot couple matter minimally at this stage of the construction (except in the trivial case \(f(\mathcal {H}_{0})=\mathcal {H}_{0}\)) precisely due to the deformation of the Hamiltonian constraint. As long as there is no matter, the deformed Hamiltonian constraint \(f(\mathcal{H}_{0})\) satisfies the deformed diffeomorphisms algebra (13) which ensures that \(f(\mathcal{H}_{0})\) remains first class. However, if one directly adds the matter part to the gravitational constraints as it is done in GR, one should consider the gravity+matter constraints

$$\begin{aligned} \bar{\mathcal {H}}_{0\text {def}}=f(\mathcal {H}_{0})+\mathcal {H}_{0\text {,mat}}\,,\qquad \bar{\mathcal {H}}_{i}=\mathcal {H}_{i}+\mathcal {H}_{i\text {,mat}}\,, \end{aligned}$$

and one shows that the new deformed Hamiltonian constraint \(\bar{\mathcal {H}}_{0\text {def}}\) is, in general, no longer first class because

$$\begin{aligned}&\{\bar{\mathcal {H}}_{0\text {def}}[N_{1}],\bar{\mathcal {H}}_{0\text {def}}[N_{2}]\} =\mathcal{H}_{i}[(f'(\mathcal{H}_{0}))^{2} \nonumber \\&\qquad \left( N_{1}D^{i}N_{2}-N_{2}D^{i}N_{1}\right) ]\nonumber \\&\qquad +\{\mathcal {H}_{0\text {,mat}}[N_{1}],\mathcal {H}_{0\text {,mat}}[N_{2}]\} +\int d^{3}x\,\sqrt{\gamma }f'(\mathcal {H}_{0})\frac{\partial \mathcal {H}_{0}}{\partial \pi ^{ij}} \nonumber \\&\qquad \left( N_{1}\frac{\delta \mathcal {H}_{0\text {,mat}}[N_{2}]}{\delta \gamma _{ij}} - N_{2}\frac{\delta \mathcal {H}_{0\text {,mat}}[N_{1}]}{\delta \gamma _{ij}}\right) \ne \bar{\mathcal{H}}_{i}[\ldots ]\approx 0\,.\nonumber \\ \end{aligned}$$

In short, \(\{\bar{\mathcal {H}}_{0\text {def}}[N_{1}],\bar{\mathcal {H}}_{0\text {def}}[N_{2}]\}\) is not weakly vanishing and then the Hamiltonian constraint is downgraded to a second class constraint, which leads to the existence of an extra degree of freedom in the theory. A solution to this problem was suggested in [22]: it consists in adding a gauge fixing term at the level of the vacuum Hamiltonian, that will split the Hamiltonian constraint into a pair of second class constraints, which then allows to couple matter minimally. We will follow this procedure, and give an explicit example for a gauge-fixing in the next subsection.Footnote 1

2.4 Consistent gauge-fixing in the Hamiltonian

In this subsection, we specify a gauge fixing procedure that can be used to couple matter fields consistently. By adding the gauge fixing term thanks to the Lagrange multiplier \(\tilde{\lambda }^{i}\),

$$\begin{aligned} H_{\text {gf}}=\int d^{3}x\sqrt{\gamma }\,\tilde{\lambda }^{i}\partial _{i}\left( \frac{\pi }{\sqrt{\gamma }}\right) \,, \end{aligned}$$

to the Hamiltonian of the \(f(\mathcal {H})\) theory, we obtain a new form of the gravitational Hamiltonian given by,

$$\begin{aligned} H_{\text {grav}}\equiv H_{\text {def}}+H_{\text {gf}}&=\int d^{3}x\sqrt{\gamma }\left[ Nf(\mathcal {H}_{0})+\frac{\pi ^{ij}}{\sqrt{\gamma }}(D_{i}N_{j} \right. \nonumber \\&\quad +\left. D_{j}N_{i})-\frac{\pi }{\sqrt{\gamma }}D_{k}\tilde{\lambda }^{k}\right] \,, \end{aligned}$$

where we used a simple integration by part in the gauge fixing term.

Now, the Hamiltonian equation of motion for \(\gamma _{ij}\) leads to

$$\begin{aligned} K_{ij}=f'(\mathcal {H}_{0})\left( \frac{\pi _{ij}}{\sqrt{\gamma }}-\frac{1}{2}\frac{\pi }{\sqrt{\gamma }}\gamma _{ij}\right) -\frac{1}{2N}\gamma _{ij}D_{k}\tilde{\lambda }^{k}\,, \end{aligned}$$

which can be solved with respect to \(\pi _{ij}\) as

$$\begin{aligned} {\pi _{ij}}=\frac{{\sqrt{\gamma }}}{f'(\mathcal {H}_{0})}(K_{ij}-K\gamma _{ij}-N^{-1}\gamma _{ij}D_{k}\tilde{\lambda }^{k})\,. \end{aligned}$$

Here \(\mathcal {H}_{0}\) is viewed as a function of the velocities \(K_{ij}\) (and no more of the momenta \(\pi ^{ij}\)), and is obtained from the following implicit equation,

$$\begin{aligned} \mathcal {H}_{0}= & {} \frac{1}{[f'(\mathcal {H}_{0})]^{2}}\left[ K^{ij}K_{ij}-K^{2}\right. \nonumber \\&-\left. \frac{2K}{N}D_{k}\tilde{\lambda }^{k}-\frac{3}{2N^{2}}(D_{k}\tilde{\lambda }^{k})^{2}\right] -R\,, \end{aligned}$$

that generalizes (17) in the presence of the gauge fixing term.

Performing a Legendre transformation, we immediately obtain the Lagrangian density

$$\begin{aligned} \mathcal {L}_{\text {grav}}= & {} \pi ^{ij}\dot{\gamma }_{ij} -N\sqrt{\gamma }f(\mathcal {H}_{0})\nonumber \\&-\pi ^{ij}(D_{i}N_{j}+D_{j}N_{i})+\pi D_{k}\tilde{\lambda }^{k}\nonumber \\= & {} \frac{2N\sqrt{\gamma }}{f'(\mathcal {H}_{0})}\left[ (K^{ij}K_{ij}-K^{2})-\frac{2K}{N}D_{k}\tilde{\lambda }^{k}\right. \nonumber \\&\left. -\frac{3}{2N^{2}}(D_{k}\tilde{\lambda }^{k})^{2}\right] - N\sqrt{\gamma }f(\mathcal {H}_{0})\nonumber \\= & {} N\sqrt{\gamma }\left[ 2(\mathcal {H}_{0}+R)f'(\mathcal {H}_{0})-f(\mathcal {H}_{0})\right] \,, \end{aligned}$$

where \(\mathcal{H}_{0}\) is still given by (24). In order to implement the relation (24) directly in the Lagrangian, we consider, instead of (25), the equivalent Lagrangian density

$$\begin{aligned} \tilde{\mathcal {L}}_{\text {grav}}= & {} \mathcal {L}_{\text {grav}}+N\sqrt{\gamma }\,\lambda _{1}\left[ K^{ij}K_{ij}-K^{2}-\frac{2K}{N}D_{k}\tilde{\lambda }^{k}\right. \nonumber \\&- \left. \frac{3}{2N^{2}}(D_{k}\tilde{\lambda }^{k})^{2}-(C+R)[f'(C)]^{2}\right] \nonumber \\= & {} N\sqrt{\gamma }\left\{ (C+R)[2-\lambda _{1}f'(C)]f'(C)-f(C) \right. \nonumber \\&+\left. \lambda _{1}\left[ K^{ij}K_{ij}{-}K^{2}{-}\frac{2K}{N}D_{k}\tilde{\lambda }^{k}{-}\frac{3}{2N^{2}}(D_{k}\tilde{\lambda }^{k})^{2}\right] \right\} \,,\nonumber \\ \end{aligned}$$

where the Lagrange multiplier \(\lambda _{1}\) ensures that the new field C satisfies \(C=\mathcal {H}_{0}\). At this stage, we can safely introduce matter fields minimally coupled to the metric (1) and then we will use this Lagrangian density in the remainder of the paper.

3 Cosmology: background and linear perturbations

This section aims at studying cosmological properties of \(f(\mathcal{H})\) theories whose dynamics is governed by the Lagrangian density (26) supplemented with a matter Lagrangian density \(\mathcal{L}_{\mathrm{mat}}\) of a perfect fluid which is given by the Sorkin-Schutz Lagrangian density [50] (see also [37, 51,52,53] for example). In the first subsection, we introduce some notations, compute the equations of motion for a cosmological (homogeneous and isotropic) background and give preliminary results concerning linear perturbations about this background. This enables us to extract in particular linear stability conditions for the tensor modes and the scalar mode. In the last two subsections, we explain how to implement the equations for the background and the linear perturbations in the Boltzmann code solver in order to solve them numerically and to compare to Planck data and other experimental probes, which we are going to do in the subsequent sections.

3.1 Cosmology of \(f(\mathcal{H})\) theories: notations and preliminary results

As we have just announced in introducing this section, we consider the total Lagrangian density

$$\begin{aligned} \mathcal {L}\;=\;\frac{M_\mathrm{P}^{2}}{2}\,\tilde{\mathcal {L}}_{\text {grav}}+\mathcal {L}_{\mathrm {mat}}\,, \end{aligned}$$

where \(M_\mathrm{P}\) is the Planck mass, \(\tilde{\mathcal {L}}_{\text {grav}}\) the \(f(\mathcal{H})\) Lagrangian density (26) and the matter is supposed to be a perfect fluid whose dynamics is governed by the Schutz-Sorkin Lagrangian density \(\mathcal {L}_{\mathrm {mat}}\),

$$\begin{aligned} \mathcal {L}_{\mathrm{mat}}= & {} -N\sqrt{\gamma }[\rho (n)+J^{\mu }\partial _{\mu }\varphi ]\,,\qquad n\equiv \sqrt{-J^{\alpha }J^{\beta }g_{\alpha \beta }}\,,\nonumber \\ \end{aligned}$$

where \(\varphi \) is a scalar field, \(\rho \) is the energy density, which depends on the number density n defined from the vector \(J^{\mu }\) and the metric \(g_{\mu \nu }\) according to (28). A detailed study of this Lagrangian density can be found in [37].

To study both the dynamics of the cosmological background and of the linear perturbations, we consider a three-dimensional spatial metric given by a perturbed flat Friedmann-Lemaître-Robertson-Walker (FLRW) geometry, i.e. in the form

$$\begin{aligned} \gamma _{ij}=a(t)^{2}\,(1+2\zeta +h_{ij})+2\,\partial _{i}\partial _{j}E+\frac{1}{2}a(t)\,(\partial _{i}\beta _{j}+ \partial _j \beta _i)\,, \end{aligned}$$

where a(t) is the scale factor, \(\zeta \) and E are scalar perturbations, \(\beta _{i}\) is a vector perturbation and \(h_{ij}\) a tensor perturbation. Notice that we have already decomposed the perturbations following the usual scalar-vector-tensor decomposition which implies that \(\beta _{i}\) is divergenceless whereas \(h_{ij}\) is transverse and traceless on the FLRW background, i.e.,

$$\begin{aligned} \delta ^{ij}\partial _{i}\beta _{j}=0\,,\qquad \delta ^{ik}\partial _{i}h_{kj}=0\,,\qquad \delta ^{ij}h_{ij}=0\,. \end{aligned}$$

The remaining components of the metric, the lapse function and shift vector, are parametrized by

$$\begin{aligned} N=N(t)\,(1+\alpha )\,,\qquad N_{i}=N(t)(\,\partial _{i}\chi +\chi _{i})\,, \end{aligned}$$

where \(\alpha \) and \(\chi \) are scalar perturbations whereas \(\chi _{i}\) is a divergenceless vectorial perturbation, i.e. \(\delta ^{ij}\partial _{i}\chi _{j}=0\). To finish with the variables entering in the gravitational Lagrangian density, one should also perturb the auxiliary fields \(\lambda _{1}\), \(\tilde{\lambda }_{i}\) and C according to,

$$\begin{aligned} \lambda _{1}= & {} \lambda _{1}(t)+\delta \lambda _{1}\,, \nonumber \\ \tilde{\lambda }^{i}= & {} \frac{1}{a(t)^{2}}\delta ^{ij}(\delta \lambda _{2j}+\partial _{j}\delta \lambda _{2})\,,\nonumber \\ C= & {} C(t)+\delta C\,, \end{aligned}$$

where, again, \(\delta \lambda _{1}\), \(\delta \lambda _{2}\), \(\delta C\) are scalar perturbations, and \(\delta \lambda _{2i}\) is a divergenceless vectorial perturbation, i.e. \(\delta ^{ij}\partial _{i}\delta \lambda _{2j}=0\). Note that, as usual, the background quantities are time-dependent only, and the values of \(\tilde{\lambda }^{i}\) and \(N_{i}\) vanish due to their vectorial nature and the background symmetry.

Concerning the variables entering specifically in the matter Lagrangian density (28), they are parametrized as follows

$$\begin{aligned} J^{0}= & {} J^{0}(t)\,(1+\delta J)\,, \nonumber \\ J^{i}= & {} \frac{1}{a^{2}}\,\delta ^{il}\,\partial _{l}\delta j\,, \nonumber \\ \varphi= & {} \varphi (t)-\rho _{,n}\,v\,, \end{aligned}$$

where \(\delta J\), \(\delta j\), and v are scalar perturbations.

Now, we have introduced all the necessary variables to study the dynamics of the background and of the linear perturbations. For that purpose, we expand the total Lagrangian density (27) up to the second order in perturbations. The Lagrangian density linear in the perturbations provides the following equations of motion for the background,

$$\begin{aligned}&J^{0}(t)=\frac{\mathcal {N}_{\mathrm{tot}}}{N\,a^{3}}\,\qquad \varphi (t)=-\int ^{t}N\,\rho _{,n}dt'\,,\nonumber \\&\quad \lambda _{1}(t)=\frac{1}{f_{,C}}\,,\qquad \frac{M_\mathrm{P}^{2}}{2}\,f+\rho =0\,,\end{aligned}$$
$$\begin{aligned}&C(t)=-\frac{6}{f_{,C}^{2}}\frac{\dot{a}^{2}}{N^{2}a^{2}}=-\frac{6}{f_{,C}^{2}}\,H^{2}\,, \nonumber \\&\quad \frac{f_{,CC}}{f_{,C}^{2}}=\frac{2M_\mathrm{P}^{2}\dot{H}/N+f_{,C}(\rho +P)}{12H^{2}(\rho +P)}\,, \nonumber \\&\quad \frac{\dot{\rho }}{N}=-3\,H\,(\rho +P)\,, \end{aligned}$$

where \(f_{,C}\) and \(f_{,CC}\) are respectively the first and second derivatives of f with respect to C, \(H=\dot{a}/(aN)\) is the Hubble constant and the so-called total particle number \(\mathcal{N}_{\mathrm{tot}}\) is an integration constant obtained from integrating the conservation constraint \(\nabla _{\mu }J^{\mu }=0\) on a flat FLRW geometry. The last equation of (34) and the last two equations of (35) are the modified Friedmann equations and the usual conservation equation for the minimally coupled matter. It is easy to verify that, in the limit \(f_{,C}\rightarrow 1\), we recover the GR equations of motion coupled to a perfect fluid. Taking the time derivative of the first equation of (35), and using the modified Friedmann equations together with the conservation equation, we find the useful relation,

$$\begin{aligned} 0=\frac{M_\mathrm{P}^{2}}{2}\,f_{,C}\,\dot{C}-3\,N\,H\,(\rho +P)=0\quad \Longleftrightarrow \quad \frac{\dot{C}}{N}=\frac{6\,H\,(\rho +P)}{M_\mathrm{P}^{2}\,f_{,C}}\,. \end{aligned}$$

Therefore, the equations of motion enable us to express the four quantities \(f,\dot{H}\), C and \(\dot{C}\) in terms of \(f_{,C}\), \(f_{,CC}\) and the other standard cosmological quantities \(a,H,\rho ,\dots \) only. Hence, we can eliminate the variables \(f,\dot{H}\), C and \(\dot{C}\) by a direct substitution, which we are going to do from now on.

Expanding the Lagrangian density at second order in perturbations and Fourier transforming as usual with respect to the spatial comoving coordinates, we can then find, for high \(k\equiv |\mathbf {k}|\) (with \(\mathbf {k}\) the comoving momentum), the no-ghost conditions, together with the speeds of propagation. Tensor perturbations give

$$\begin{aligned} Q_{T}=(f_{,C})^{-1}>0\,,\qquad c_{T}^{2}=(f_{,C})^{2}\,, \end{aligned}$$

so that letting \(f_{,C}>0\) at all times is sufficient to avoid the presence of ghost-like tensor modes. Furthermore, the famous constraint on the speed of propagation of gravitational waves today [54] (at redshift \(z=0\)) imposes that \(c_{T}\approx 1\) to the accuracy of order \(\mathcal {O}(10^{-15})\), which leads to the condition that \((f_{,C})^{2}\approx 1\) to the accuracy of order \(\mathcal {O}(10^{-15})\) at \(z=0\) as well.

The analysis of scalar perturbations gives,

$$\begin{aligned} Q_{s}= & {} \frac{\rho ^{2}a^{2}}{2k^{2}n\rho _{,n}}=\frac{\rho ^{2}a^{2}}{2k^{2}\,(\rho +P)}>0\,,\end{aligned}$$
$$\begin{aligned} c_{s}^{2}= & {} \frac{n\rho _{,nn}}{\rho _{,n}}+\frac{2}{M_\mathrm{P}^{2}}\,\frac{f_{,CC}}{f_{,C}^{2}}\,(\rho +P)\,. \end{aligned}$$

Hence, we find that as long as \(f_{,CC}\ne 0\), the speed of propagation changes for any matter component, dust included. Finally, and as expected, there are no propagating vector perturbations in the gravity sector.

3.2 Implementation of background equations of motion

Now, we are going to explain in detail the way we have implemented the background equations of motion in the code. First, we extend the theory to the case where several fluids are coupled to gravity (in order to model radiation, dust and eventually dark energy components) by adding to the total Lagrangian density (27) different matter Lagrangian densities. In that case, the two modified Friedmann equation and the conservation equation given in (3435) become,

$$\begin{aligned}&\frac{M_\mathrm{P}^{2}}{2}\,f+\sum _{i}\rho _{i}=0\,,\nonumber \\&\quad \frac{f_{,CC}}{f_{,C}^{2}}=\frac{2M_\mathrm{P}^{2}\dot{H}/N+f_{,C}\sum _{i}(\rho _{i}+P_{i})}{12H^{2}\sum _{i}(\rho _{i}+P_{i})}\,, \nonumber \\&\quad \frac{\dot{\rho }}{N}=-3\,H\,\sum _{i}(\rho _{i}+P_{i})\,, \end{aligned}$$

where the subscript i parametrizes the different fluids, while the remaining equations of motion are unchanged,

$$\begin{aligned} J_{i}^{0}(t)= & {} \frac{\mathcal {N}_{i\mathrm{tot}}}{N\,a^{3}}\,\nonumber \\ \varphi _{i}(t)= & {} -\int ^{t}N\,\rho _{i,n}dt'\,,\nonumber \\ \lambda _{1}(t)= & {} \frac{1}{f_{,C}}\,, \nonumber \\ C(t)= & {} -\frac{6}{f_{,C}^{2}}\,H^{2}\,. \end{aligned}$$

On using the equation for C(t) in (41), the first modified Friedmann equation in (40) can be rewritten as

$$\begin{aligned} H^{2}=\varrho _{f}+\sum _{i}\varrho _{i}\qquad \mathrm{or\,\,equivalently}\qquad 1=\Omega _{f}+\sum _{i}\Omega _{i}\,, \end{aligned}$$

where we used the notations,

$$\begin{aligned} \varrho _{f}\equiv & {} \frac{\rho _{f}}{3M_\mathrm{P}^{2}}\equiv \frac{1}{6}\,(f-C\,f_{,C}^{2})\,,\nonumber \\ \varrho _{i}\equiv & {} \frac{\rho _{i}}{3M_\mathrm{P}^{2}}\,,\nonumber \\ \Omega _{f}\equiv & {} \frac{\varrho _{f}}{H^{2}}\,, \nonumber \\ \Omega _{i}\equiv & {} \frac{\varrho _{i}}{H^{2}}\,. \end{aligned}$$

Hence, the modification of GR shows up, in the first Friedmann equation, as a fluid of effective density \(\rho _{f}\). Following a similar procedure we can also find the expression for the effective pressure \(P_{f}\) or equivalently \(p_{f}\equiv P_{f}/(3M_\mathrm{P}^{2})\). Indeed, using the definitions of \(\varrho _{f}\) and \(\varrho _{i}\) given in (43), the second modified Friedmann equation in (40) can be reformulated as follows,

$$\begin{aligned} \frac{2}{3}\frac{\dot{H}}{a}+\left( \varrho _{f}+p_{f}\right) +\sum _{i}(\varrho _{i}+p_{i})=0\,, \end{aligned}$$

where we used the notations,

$$\begin{aligned} p_{f}= & {} -(1-f_{,C}-2\,Cf_{,{ CC}})\sum _{i}(\varrho _{i}+p_{i})-\frac{1}{6}\,(f-C\,f_{,C}^{2})\,,\nonumber \\ p_{i}= & {} \frac{P_{i}}{3M_\mathrm{P}^{2}}\,. \end{aligned}$$

Hence, \(p_{f}\) is the (normalized) pressure of the effective fluid which describes the modifications of GR in a cosmological background. Finally, we also define the effective equation of state \(w_{f}\equiv p_{f}/\varrho _{f}\).

Now, we are ready to show how to implement these equations of motion in the code. We start by choosing the lapse function so that it coincides with the scale factor, i.e. \(N=a\), and then the time t becomes the conformal time \(\tau \). Hence, from now on, an overdot represents the derivative with respect to \(\tau \), i.e.,

$$\begin{aligned} \dot{F}\equiv \frac{dF}{d\tau }\,, \end{aligned}$$

for any function F. This choice is motivated by the fact that most of the Boltzmann solvers are written in terms of the conformal time. It is also convenient, from this section on, to introduce the derivative with respect to \(N_{e}\equiv -\ln (a/a_{0})\), where \(a_{0}\) is the scale factor today (at \(z=0\)) for any function F. The \(\tau \) and \(N_{e}\) derivatives are related by

$$\begin{aligned} \dot{F}=\frac{da}{d\tau }\,\,\frac{dF}{da}=\dot{a}\,\frac{dN_{e}}{da}\,\frac{dF}{dN_{e}}=-\frac{\dot{a}}{a}\,\frac{dF}{dN_{e}}=-a\,H\,\frac{dF}{dN_{e}}\,. \end{aligned}$$

Then, we differentiate the first Friedmann equation in (40) with respect to \(\tau \) and, after using the conservation equations (35) for each fluid, we obtain the dynamical equation,

$$\begin{aligned} \dot{C}=\frac{6\,a\,H\,\sum _{i}(\rho _{i}+P_{i})}{M_\mathrm{P}^{2}f_{,C}}=\frac{18\,a\,H\,\sum _{i}(\varrho _{i}+p_{i})}{f_{,C}}\,, \end{aligned}$$

which is equivalent to

$$\begin{aligned} \frac{dC}{dN_{e}}=-\frac{18\,\sum _{i}(\varrho _{i}+p_{i})}{f_{,C}}\,. \end{aligned}$$

As a consequence, the dark energy component does not contribute to the derivative of C and, if we denote by \(\rho _{m}\) the dark matter density and by \(\rho _{r}\) the radiation density, we have

$$\begin{aligned} \left\{ \begin{array}{ll} \dfrac{dC}{dN_{e}} &{} =-{18\,(\varrho _{m}+4\varrho _{r}/3)}/{f_{,C}}=-{6\,H_{0}^{2}\,(3\Omega _{m0}a+4\,\Omega _{r0})}/({f_{,C}\,a^{4}})\,,\\ \dfrac{da}{dN_{e}} &{} =-a\,, \end{array}\right. \nonumber \\ \end{aligned}$$

where \(H_{0}\) and \(\Omega _{i0}\) are the values of H and \(\Omega _{i}\) today (at \(z=0\)). The second differential equation has been introduced so that we obtain an autonomous system of Ordinary Differential Equations (ODEs). We need to provide the initial conditions, namely \(C(N_{e}=0)=C_{0}\) and \(a(0)=1\) to fully integrate the systemFootnote 2. Therefore, in order to have C at any value of the redshift z (\(z>0\)) we just need to integrate the system of ODEs up to \(N_{e}=\ln (1+z)\). Finally, on solving the system of ODEs (50) for a given function f(C) we are also able to find at any redshift the value of every relevant background quantity.

Let us now discuss the initial conditions. From (42), we know that today \(\Omega _{f0}=1-\sum _{i}\Omega _{i0}\). On combining this relation with the first Friedmann equation in (40), we find that

$$\begin{aligned} f(z=0)=-6H_{0}^{2}(1-\Omega _{f0})\,,\qquad [f_{,C}(z=0)]^{2}\,C_{0}=-6H_{0}^{2}\,. \end{aligned}$$

Furthermore, since we impose from observations that \([f_{,C}(z=0)]^{2}\approx 1\) to the accuracy of order \(\mathcal {O}(10^{-15})\) (see discussion below Eq. (37)), we find that \(C_{0}\approx -6H_{0}^{2}\), and we can safelyFootnote 3 set this value as the initial condition for C.

3.3 Implementation of perturbation equations

In this subsection, we are going to compute the equations for the linear scalar perturbations and reduce them to a minimal but complete system where we have eliminated the redundant variables. We start with \((7+3\,s)\) scalar perturbations (where s is the number of matter components): for the metric, we introduced \(\zeta \), E, \(\alpha \), \(\chi \) in (29)-(31), for the matter components we introduced \(\delta J_{i}\), \(\delta j_{i}\) and \(v_{i}\) in (33), and finally we introduced \(\delta \lambda _{1}\), \(\delta \lambda _{2}\), \(\delta C\) in (32) for the remaining variables. As usual, we need to expand the total Lagrangian density for \(f(\mathcal {H})\) theories coupled to matter fields up to second order and we perform a Fourier transformation with respect to the spatial comoving coordinates to obtain the equations of the perturbations. In the sequel, we will denote by \(E_{Q}=0\) the equation of motion of the perturbation variable Q obtained by deriving the quadratic Lagrangian density with respect to Q. For instance, we find

$$\begin{aligned} \frac{E_{\chi }}{M_\mathrm{P}^{2}}= & {} -2\,k^{2}a^{2}H\,\delta \lambda _{1}+\frac{k^{4}}{a\,f_{,C}}\,\delta \lambda _{2}+\frac{2k^{2}a^{2}H}{f_{,C}}\,\alpha \nonumber \\&+3\,k^{2}a^{2}\sum _{i}n_{i}\varrho _{i,n}v_{i}-\frac{2k^{2}a}{f_{,C}}\,\dot{\zeta }=0\,, \end{aligned}$$

and similar equations can be computed for the other variables. Of course, we make use of the equations of motion for the background to simplify several expressions, in particular, the background lapse function still coincides with the scale factor, namely \(N(\tau )=a(\tau )\), where \(\tau \) is the conformal time.

The first step consists in eliminating the redundant variables. We can see that we can integrate out the auxiliary variables \(\delta J_{i}\), \(\delta j_{i}\) in the matter Lagrangian density, only leaving the fields \(v_{i}\) and \(\delta _{i}\) for each matter field components (see [37] for details). In the gravitational sector, we make use of the spatial gauge freedom (the invariance under three-dimensional diffeomorphisms) to fix \(E=0\) as it is often done. Furthermore, as we are going to see later on, it is convenient to use the same gauge invariant combinations of fields as the ones used in \(\Lambda \)CDM to describe perturbations in the Newtonian gauge. Hence, we make the following field redefinitions,

$$\begin{aligned} \frac{\delta \rho _{i}}{\rho _{i}}\equiv & {} \delta _{i}+\frac{3\dot{a}n_{i}\varrho _{i,n}}{a^{2}\,\varrho _{i}}\,\chi \,,\nonumber \\ \alpha\equiv & {} \psi -\frac{\dot{\chi }}{a}\,, \nonumber \\ \zeta\equiv & {} -\phi -\frac{\dot{a}}{a^{2}}\,\chi \,,\nonumber \\ v_{i}\equiv & {} -\frac{a}{k^{2}}\,\theta _{i}+\chi \,. \end{aligned}$$

Again, these combinations, in the language of GR, correspond to the gauge-invariant combinations which reduce to the Newtonian fields (when we adopt the Newtonian gauge).

Now, we have all the ingredients to compute and simplify the equations for the perturbations. We start with the matter equations which are given by,

$$\begin{aligned} E_{v}^{(i)}\equiv & {} \dot{\delta }_{i}+\frac{\varrho _{i}+p_{i}}{\varrho _{i}}\,\theta _{i}-\frac{3\dot{a}}{a}\left( \frac{p_{i}}{\varrho _{i}}-\frac{n_{i}\varrho _{i,nn}}{\varrho _{i,n}}\right) \delta _{i}\nonumber \\&-\frac{3(\varrho _{i}+p_{i})}{\varrho _{i}}\,\dot{\phi }=0\,,\end{aligned}$$
$$\begin{aligned} E_{\delta \rho }^{(i)}\equiv & {} \dot{\theta }_{i}-k^{2}\psi -\frac{\varrho _{i}}{\varrho _{i}+p_{i}}\,\frac{n_{i}\varrho _{i,nn}}{\varrho _{i,n}}\,k^{2}\,\delta _{i}\nonumber \\&+\frac{\dot{a}}{a}\left( 1-\frac{3n_{i}\varrho _{i,nn}}{\varrho _{i,n}}\right) \theta _{i}+k^{2}\sigma _{i}=0\,, \end{aligned}$$

where \({n_{i}\varrho _{i,nn}}/{\varrho _{i,n}}=\dot{p}_{i}/\dot{\varrho }_{i}\) and \(\sigma _{i}\) is the shear perturbation for each fluid. We see that the form of the equations of motion in the matter sector is identical to the ones in GR in the Newtonian gauge. This is a consequence of the fact that the auxiliary field C in the \(f(\mathcal {H})\) theory does not have any direct coupling with matter fields, and matter is minimally coupled to the gravitational sector.

Then, we study the equations \(E_{\delta \lambda _{1}}\), \(E_{\delta \lambda _{2}}\) and \(E_{\delta C}\). After a direct calculation, we see that we can integrate out the variables \(\delta \lambda _{1}\), \(\delta C\) and \(\delta \lambda _{2}\) according to,

$$\begin{aligned} \delta \lambda _{1}= & {} -\frac{f_{,CC}}{f_{,C}^{2}}\,\delta C\,,\qquad \delta C=\frac{4k^{2}}{a^{2}}\,(\phi +H\chi )\,, \end{aligned}$$
$$\begin{aligned} \delta \lambda _{2}= & {} \left[ {\frac{a^{2}(f_{{,C}}-12\,f_{,CC}H^{2})}{6f_{{,C}}H{k}^{2}}}-\frac{a^{3}\dot{H}}{2H{k}^{4}}\right] a\,\delta C-{\frac{2a^{2}\dot{\phi }}{{k}^{2}}} \nonumber \\&+\left( {\frac{2a\dot{H}}{H{k}^{2}}}-{\frac{2}{3H}}\right) a\,\phi -{\frac{2a^{3}H\psi }{{k}^{2}}}\,. \end{aligned}$$

Furthermore, on considering the equation of motion \(E_{\chi }=0\), we can also find \(\chi \) as follows,

$$\begin{aligned} \chi =\frac{9af_{,C}}{k^{2}[9f_{,C}\sum _{j}(\varrho _{j}+p_{j})+2\,k^{2}/a^{2}]}\,\sum _{i}(\varrho _{i}+p_{i})\theta _{i}\,. \end{aligned}$$

Finally, it remains to study the equations which determine the dynamics for the perturbations in the gravitational sector, namely for \(\phi \) and \(\psi \). We start by substituting the Newtonian gauge fields (53) directly in the total Lagrangian density \(\mathcal{L}\) so that we obtain a new equivalent Lagrangian density \(\mathcal {L}'\) for these new variables. Interestingly, we find that the equation for \(\chi \), that we denote \(\bar{E}_{\chi }=0\), is a new one and can be written as

$$\begin{aligned} E_{1}\equiv & {} \dot{\phi }+aH\,\psi +\frac{4k^{2}Hf_{,CC}}{af_{,C}}\,\phi \nonumber \\&+\frac{3a^{2}}{\Gamma _{1}k^{2}}\left[ 6\Gamma _{2}H^{2}\frac{f_{,CC}}{f_{,C}}-\frac{1}{2}\Gamma a^{2}f_{,C}^{2}-\frac{k^{2}\Gamma _{1}}{9\Gamma _{2}}\right] ] \sum _{i}(\varrho _{i} \nonumber \\&+p_{i})\,\theta _{i}=0\,, \end{aligned}$$

where we have introduced the notations,

$$\begin{aligned} \Gamma\equiv & {} \sum _{i}n_{i}\varrho _{i,n}=\sum _{i}(\varrho _{i}+p_{i})\,, \nonumber \\ \Gamma _{1}\equiv & {} \Gamma \,a^{2}f_{,C}+\frac{2}{9}k^{2}\,,\nonumber \\ \Gamma _{2}\equiv & {} \Gamma \,a^{2}+\frac{2}{9}k^{2}f_{,C}\,. \end{aligned}$$

In the limit where \(f_{,C}\rightarrow 1\) and \(f_{,CC}\rightarrow 0\), we recover the expected results of GR and, (59) represents one of the two fundamental equations which involve the metric perturbation variables, that Boltzmann solvers need to solve besides the equations of motion for the matter variables.

At this stage, we need another equation for \(\psi \). We find it by the following procedure. First of all we consider \(\bar{E}_{\psi }=0\). This equation can be written as

$$\begin{aligned} \frac{\bar{E}_{\psi }}{3a^{4}HM_\mathrm{P}^{2}}= & {} -\frac{2}{3}\,f_{,C}\,\frac{k^{2}}{a^{2}H}\,\phi -\frac{1}{H}\sum _{i}\varrho _{i}\,\delta _{i}\nonumber \\&-\frac{3a\Gamma _{2}}{k^{2}\Gamma _{1}}\sum _{i}n_{i}\varrho _{i,n}\theta _{i}=0\,. \end{aligned}$$

Then, we compute \(\dot{\bar{E}}_{\psi }\) and we obtain an equation that involves the terms \(\dot{\phi }\), \(\dot{\delta }_{i}\) and \(\dot{\theta }_{i}\). Therefore from linear combinations of this equation with \(E_{1}\) and the matter equations of motion, as well as \(\bar{E}_{\psi }\), we can remove each of these derivatives. Finally we obtain the remaining expected equation,

$$\begin{aligned} E_{2}\equiv & {} \psi +\frac{(4f_{,CC}k^{2}-a^{2}f_{,C})\Gamma _{1}}{a^{2}\Gamma _{2}}\,\phi +\frac{9a^{2}f_{,C}}{2k^{2}}\sum _{i}(\varrho _{i} \nonumber \\&+ p_{i})\sigma _{i}-\frac{a^{2}(f_{,C}^{2}-1)}{\Gamma _{2}}\,\sum _{i}\frac{n_{i}\varrho _{i,nn}}{\varrho _{i,n}}\,\varrho _{i}\,\delta _{i}\nonumber \\&+ \frac{1}{k^{2}\Gamma _{1}\Gamma _{2}}\left[ a^{4}f_{,C}(f_{,C}^{2}-1)(\dot{\Gamma }+2Ha\Gamma )\right. \nonumber \\&+\left. 2Ha\frac{f_{,CC}}{f_{,C}}\left( 2f_{,C}^{2}k^{2}\Gamma _{1}-9a^{2}\Gamma \Gamma _{2}\right) \right] \nonumber \\&\quad \sum _{i}(\varrho _{i}+p_{i})\theta _{i}\,=0\,, \end{aligned}$$

which, in the GR limit, reduces to the correct shear perturbation equation.

We have now all the dynamical equations of motion necessary to implement the dynamics of the whole system: the matter equations (54) and (55) together with the “gravitational” equations (59) and (62) couple the perturbation variables \(\theta _{i},\delta _{i},\phi \) and \(\psi \). Notice that this theory does not add any new propagating degree of freedom and this is the reason why we do not need to add any new equation to the Boltzmann code. The main difference between this theory and GR lies, at the level of perturbations, on the two modified equations of motion for the metric perturbation variables.

4 A Concrete example: the “kink” model

In the following, we will consider one explicit example of f(H) theories by choosing a particular class of functions for f. Before presenting the model in details, we give our motivations and also some of the most important results we have obtained with it.

This model has been built so that it is consistent with the constraint \(c_{T}=1\) at low redshifts, which means \(f_{,C}(z=0)\approx 1\), and it possibly addresses some so-far unsolved cosmological puzzles. We have found that the model we are to introduce is capable of fitting the chosen data sets better than \(\Lambda \)CDM. Even if this model does not improve much the fit to the \(H_{0}\) measurement, it achieves a better fit especially for Planck data. Furthermore, although in the context of spatially curved (\(\Omega _{K0}\ne 0\)) \(\Lambda \)CDM, one is able to fit Planck data alone better, as soon as we introduce late time data, BAO data in particular, \(\Omega _{K0}\ne 0\) is strongly constrained. Some authors [19] are led to state that \(\Lambda \)CDM is ruled out in the light of such behavior. However, the model we are going to introduce, does not feel such a strong constraint from late time data. Before and after the insertion of late time data, Planck data are considerably fit better by the model we are about to discuss. Hence, this study opens a window on using modified gravity models to address not only late time cosmology but even cosmology at intermediate/high redshifts.

Before defining our model, let us remind that \(\Lambda \)CDM corresponds to the case where f(C) is an affine function of C, i.e. of the form \(f(C)=C-C_{0}+f_{0}\) with \(f_0 \equiv f(C_{0})\). The model we are now considering consists in choosing f(C) such that its derivative is of the form,

$$\begin{aligned} f_{,C}=1+\frac{1}{2}a_{1}-\frac{1}{2}a_{1}\tanh \!\left[ \frac{1}{a_{3}}\left( \frac{C}{H_{0}^{2}}+a_{2}\right) \right] , \end{aligned}$$

where \(a_{1}\), \(a_{2}\) and \(a_{3}\) are free positive real parameters. The fact that \(a_1>0\) ensures \(f_{,C}>0\) which is the condition to avoid the presence of ghost-like tensor modes (37). The hyperbolic tangent function gives \(f_{,C}\) a kink shape and, for this reason, we dub it the “kink”-model. A direct integration with respect to the C variable leads to

$$\begin{aligned} f(C)= & {} f_{0}+(1+a_{1})\,(C-C_{0})\nonumber \\&+\frac{a_{1}a_{3}H_{0}^{2}}{2}\left[ \mathrm{softplus}\!\left( \frac{2a_{2}H_{0}^{2}+2C_{0}}{a_{3}H_{0}^{2}}\right) \right. \nonumber \\&-\left. \mathrm{softplus}\!\left( \frac{2a_{2}H_{0}^{2}+2C}{a_{3}H_{0}^{2}}\right) \right] , \end{aligned}$$

where \(f_{0}\) is the integration constant, \(C_{0}\) is the value of C today, and we have made use of the softplus functionFootnote 4.

Some of the free parameters are constrained by the initial conditions (51). Indeed, as \(C_{0}\approx -6H_{0}^{2}\) and \(f_{,C}\approx 1\) at \(z=0\), then the parameters \(a_{2}\) and \(a_{3}\) must satisfy the condition \((a_{2}-6)/a_{3}\gg 1\) which implies that \(a_{2}\gg a_{3}\). Furthermore, on using the Friedmann equation, we already know that \(f_{0}=-6H_{0}^{2}(1-\Omega _{f0})\).

Now, let us study some properties of the model at very early times when \(C<0\) and \(|C|\gg a_{2}H_{0}^{2}\). In that case, the function f(C) simplifies and becomes,

$$\begin{aligned} f(C)\approx & {} (1+a_{1})\,(C+6H_{0}^{2})+f_{0,\mathrm{eff}}\,\,,\nonumber \\ f_{0,\mathrm{eff}}\equiv & {} 6H_{0}^{2}\Omega _{f0}-6H_{0}^{2}+\frac{a_{1}a_{3}H_{0}^{2}}{2}\,\mathrm{softplus}\!\left( \frac{2a_{2}-12}{a_{3}}\right) .\nonumber \\ \end{aligned}$$

As a consequence, at early times, the theory is equivalent to a GR theory with f(C) an affine function of C, i.e. of the form \(f(C)=\alpha C+\beta \), where however the constants \(\alpha \) and \(\beta \) are different with respect to \(\Lambda \)CDM, i.e. \(\alpha \ne 1\), in general. Hence, on using the expression of C given in (35) and the definitions (43), we find at early times that

$$\begin{aligned} \lim _{z\rightarrow \infty }\Omega _{f}= & {} 1-\frac{f}{C\,f_{,C}^{2}}=1-\frac{f_{0,\mathrm{eff}}+(1+a_{1})\,(C-C_{0})}{(1+a_{1})^{2}C} \nonumber \\\approx & {} 1-\frac{1}{1+a_{1}}\ne 0\,, \end{aligned}$$

which means that f has non-trivial contributions at early times. In particular, this implies that \(\Omega _{r}\) does not go to unity at early times, in general. Then one may wonder if this is enough to rule out at once the model. To see this is not the case, let us study the behavior of the effective equation-of-state for the f(C) component at early times, for instance during radiation domination when \(\Omega _{r}\gg \Omega _{m}\). A direct calculation shows that

$$\begin{aligned} \lim _{z\rightarrow \infty }w_{f}\equiv & {} \frac{p_{f}}{\varrho _{f}} \nonumber \\= & {} \frac{-\left[ 1-f_{,C}-2\,Cf_{,{ CC}}\right] \sum _{i}(\varrho _{i}+p_{i})-\frac{1}{6}\,(f-C\,f_{,C}^{2})}{\frac{1}{6}\,(f-C\,f_{,C}^{2})}\nonumber \\\approx & {} -1+\frac{a_{1}\sum _{i}(\varrho _{i}+p_{i})}{\frac{1}{6}\,[f_{0,\mathrm{eff}}+(1+a_{1})\,(C-C_{0})-(1+a_{1})^{2}\,C]}\nonumber \\= & {} -1+\frac{6a_{1}\sum _{i}(\varrho _{i}+p_{i})}{f_{0,\mathrm{eff}}-(1+a_{1})\,C_{0}+(1+a_{1})C(1-1-a_{1})}\nonumber \\\approx & {} -1+\frac{6a_{1}\sum _{i}(\varrho _{i}+p_{i})}{-(1+a_{1})a_{1}\,C}\approx -1-\frac{6H^{2}(1+w_{r})\Omega _{r}}{(1+a_{1})\,C}\nonumber \\= & {} -1-\frac{-f_{,C}^{2}C(1+w_{r})\Omega _{r}}{(1+a_{1})\,C}=-1+(1+a_{1})(1+w_{r})\Omega _{r}\nonumber \\\approx & {} -1+(1+a_{1})(1+w_{r})(1-\Omega _{f})=w_{r}=\frac{1}{3}\,, \end{aligned}$$

where we have used Eq. (66). Therefore this model gives an effective contribution to radiation at early times. Therefore when \(w_{f}\approx 1/3\), then \(\varrho _{f}\) will contribute to the effective radiation energy density \(\varrho _{r}^{\text {eff}}=\varrho _{r}+\varrho _{f}\) so that, on the background, the effective \(\Omega _{r}^{\text {eff}}\) will have an extra component due to \(\Omega _{f}\) and \(\lim _{z\rightarrow \infty }\Omega _{r}^{\text {eff}}=1\), as we expect. We want to make clear that this model is not a model of “dark radiation” for at least two reasons: (1) it gives an effective radiation component only during radiation domination, whereas at late times, \(\rho _{f}\), on the background, behaves instead as an effective cosmological constant; (2) no extra (massive or massless) degree of freedom is introduced in the theory at any time, even during radiation domination.

5 Results

In this section, we present the results obtained from running a Monte Carlo sampling of the parameter space for the kink model. Sampling the parameter space helps understanding the features of the model, as otherwise we would find it hard to predict which part of the parameter space is more appealing with respect to cosmology. The fitness parameter \(\chi ^{2}\) is an important quantity, which tells how much the data prefer the model under investigation in the parameter estimation. Whenever a model has a better, i.e. lower, \(\chi ^{2}\) than the standard cosmological model \(\Lambda \text {CDM}\), that model deserves attention in the context of cosmological tensions. As we already wrote in the previous section, we will see that the kink model (64) consistently gives a better fitness parameter than \(\Lambda \)CDM. For this reason, we report on the kink model.

We present here our study of the behavior of both \(\Lambda \)CDM and the kink model for several data sets constraining the evolution of the background and perturbations both at high and low redshifts. We used a Monte-Carlo sampling in order to find the bestfit parameter points for both models which minimize the \(\chi ^{2}\). We gave very broad priors on the free parameters of the kink model. In particular we set \(-1<a_{1}<50\) (with a flat prior), \(0.5<\log _{10}a_{2}<18\) (with log-flat prior), and \(-9<\log _{10}\beta <-0.75\) (with log-flat prior) where \(a_{3}=\beta \,a_{2}\). We set such large priors as the model was to be applied to a large redshift range, without a priori knowing whether the procedure would find any good fit at all in the allocated sampling time. However, in the limit \(a_{1}\rightarrow 0\) the kink model reduces to \(\Lambda \)CDM. We knew therefore that there should have been at least some non-zero good-fit interval for the parameters. Despite those very broad priors, the procedure successfully converged to a good fit.

5.1 Comparison of \(\chi ^2\)

We found that the kink model performs better than \(\Lambda \)CDM: the fitness parameters \(\chi ^{2}\) (total and respective to each experiment) are compared to those obtained in the \(\Lambda \)CDM case in Table 1.

Table 1 Comparison of the total \(\chi ^2\) for the bestfit for both \(\Lambda \)CDM and the kink model for all the considered data sets.

The difference in \(\chi ^{2}\) between the two models is \(\Delta \chi ^{2}=16.6\). Even though we have three more parameters, we find that the kink model is preferable and fits the data much better than \(\Lambda \)CDM. To be more precise in Table 2 we give two different information criteria for model comparison [55, 56], namely, Akaike Information Criterion (AIC), and its corrected version, AIC-cFootnote 5. Accordingly, we have \(\Delta {(\text {AIC})} \approx 10.6\), and \(\Delta {(\text {AIC-c})} \approx 10.57\). This shows that the data sets prefer the kink model (we have considered here a sample size of order 3000). In the future, if experiments are not mistaken, the discrepancy between \(\Lambda \)CDM and the kink model might increase, as error bars may shrink. Of course, as an alternative, it is still possible that some yet unknown systematics are tilting the balance in disfavor of \(\Lambda \)CDM, especially for early time data.

Before studying the bestfit of the model, we want to make a few statements about this result. First of all we can see that the kink model, performs better than \(\Lambda \)CDM on the HST data point, thus alleviating the tension in measurements of the value of today’s Hubble factor to some degree. The model performs in a way very similar to \(\Lambda \)CDM for the other late time data, consisting mainly of BAO and Supernova Type Ia data (JLA). The fact that the model is similar to \(\Lambda \)CDM on these last experiments is afterall maybe not a surprise because the kink model was constructed as to reduce to \(\Lambda \)CDM at late times (with possibly different values for the background parameters, like \(H_{0}\) for instance).

However, there is an important difference at early time when \(f_{,C}\ne 1\). In fact, we find that the main contribution to a lower value of the \(\chi ^{2}\) takes place in the redshift interval, which goes from today up to values of redshift sensitive to Planck results, and the kink model performs consistently better than \(\Lambda \)CDM for any of the Planck experiments: \(\Delta \chi _{\mathrm{TTTEEE}}^{2}=12.53\), \(\Delta \chi _{\mathrm{lowl\ EE}}^{2}=1.01\), and \(\Delta \chi _{\mathrm{lowl\ TT}}^{2}=1.55\). The reason for such an improvement is due to both a modification of the background (an effective radiation component, which at late times changes into a cosmological constant contribution, and, as we will see, to a fast change of the value of H at intermediate redshift \(z\simeq 743\)), and to a different dynamics for the perturbations (whenever \(f_{,C}\ne 1\)). With these considerations, it is now time to focus our attention to the constraints and the bestfit of the model in order to understand its characteristics.

5.2 Two dimensional likelihoods and bestfit

On analyzing the chains obtained after Monte-Carlo sampling we show the two-dimensional marginalized likelihoods for the cosmological variables of interest in Fig. 1.

Table 2 Comparison of \(\Lambda \)CDM and the kink model according to the Akaike information criterion and its corrected version.
Fig. 1
figure 1

Marginalized two dimensional likelihoods for the kink model on fitting all chosen data sets (both early and late time ones)

The results for the one-dimensional 2\(\sigma \) constraints are summarized in Table 3.

Table 3 One-dimensional 2\(\sigma \) constraints for the cosmological parameters of interest obtained by fitting early times and late times data sets.

First of all, it is interesting to see the bound on \(a_{1}\), which evidently states that \(a_1\) is different from 0 at 2\(\sigma \), i.e. the data suggests non-negligible deviation from \(\Lambda \)CDM. The bound on \(a_{2}\) is also interesting as we have a lower and an upper limit. In particular, the value of \(a_{2}\) selects the energy at which \(f_{,CC}\) changes significantly. We will comment later on at which redshift this change occurs. Finally let us briefly discuss about the parameter \(\beta \), which has been defined above as \(a_{3}=\beta \,a_{2}\). The value of \(\beta \) does not affect the value of the \(\chi ^{2}\) when it is sufficiently small. In fact, in order to study better the dependence of the \(\chi ^{2}\) on the parameter \(\beta \), we have performed the experiment of changing the value of \(\beta \) for the best fit and confirmed that its value does not affect the minimum of \(\chi ^2\), as shown in Fig. 2 which plots the behavior of the likelihood when \(\beta \) varies, as long as \(\log _{10}\beta \lesssim -4.1\), for higher precision.

This means that we have a degeneracy for small values of \(\beta \). In fact, the allowed lower bound was hitting the lower prior limit (which was set to be \(10^{-9}\)). Much smaller values would in fact require a sufficiently high precision which is not allowed in our computations. The meaning of a small \(\beta \) is anyhow simple, the redshift range for which \(f_{,CC}\) changes significantly cannot be too large, i.e. the transition between the two different \(f_{,C}\) cannot be adiabatic. Later on, when we study in detail the minimum for the whole data sets, we will also try to understand the reason why large values of \(\beta \) seem to be excluded.

As already stated above for these all-redshift-range data sets, we can see that the bestfit kink model alleviates the \(H_{0}\) tension slightly, but, mostly, it gives a better fit on Planck data compared with \(\Lambda \)CDM. In fact, a value for \(\Delta \chi ^{2}=16.6\) is large enough (even on considering three more parameters for the kink model) as to exclude \(\Lambda \)CDM at 2\(\sigma \) (because \(a_{1}\) is different from 0 at 2\(\sigma \), and the \(a_{1}\rightarrow 0\) limit is a smooth one, as we have no other propagating mode than \(\Lambda \)CDM). This result is encouraging for the kink model and at least tells that flat-\(\Lambda \)CDM does not necessarily give the better fit to Planck data, or we may conclude that, if flat-\(\Lambda \)CDM is the only allowed model a priori, Planck data indicate some unknown systematics. A simple solution, in this sense following Occam’s razor, is that models different from \(\Lambda \)CDM have an arena to test gravity already in the Planck data sets and at high redshifts.

In summary, we have found a model which fits Planck data better than flat \(\Lambda \)CDM. The fact that there are models which fit Planck data better than flat \(\Lambda \)CDM is not new (see e.g. [18, 19, 58], the last one describing a model in the context of Horndeski theories). For example, it is now well known that Planck data prefer \(\Omega _{K}\ne 0\) [18, 20]. However, a non-flat model is then in strong tension with BAO and inflationary paradigm at the same time [19]. On the contrary, we have shown here that BAO data do not constrain much this model (or they constrain it as much as flat-\(\Lambda \)CDM) and, as a consequence, do not spoil the fact that the kink model still performs better than flat \(\Lambda \)CDM.

Fig. 2
figure 2

Independence of \(\ln \mathcal {L}_{\text {min}}\) on \(\beta \)

5.3 Background evolution

In the following we study in detail the behavior of the minimum of the \(\chi ^{2}\) starting with the background evolution. We have fixed the various background parameters to their bestfit values and integrated the background equations of motion. The results of the evolution of the three \(\Omega _{i}\) functions are given in Fig. 3.

Fig. 3
figure 3

Evolution of the several \(\Omega _{i}\) (\(i=f,m,r\)) functions during the evolution of the background for the bestfit kink model. Around \(z\approx 743\) some non trivial behavior can be seen. Such a behavior will be studied more in detail in the following. The plot has been obtained on fixing \(h=0.691867\), \(\Omega _{m0}=0.2951803\), \(a_{1}=2.766667\times 10^{-3}\), \(\log _{10}a_{2}=8.949697\), \(\log _{10}\beta =-4.5\), \(\Omega _{f0}=0.7047323\)

We can see that some non-trivial dynamics happens at intermediate redshifts (\(z\simeq 743\)). In order to understand better what happens we further study the dynamics of the background for several variables. One variable of interest is \(\varepsilon _{H}\equiv -\dot{H}/(NH^{2})\) (which can be calculated via Eq. (44)), as it shows whether the universe accelerates (when \(\varepsilon _{H}<1\)), decelerates (approaching 2 during radiation domination), and if some non-trivial singularity is present (besides the big-bang). In Fig. 4, we can see that around \(z\simeq 743\), there is a fast but smooth transition at which \(\varepsilon _{H}\) grows but remains finite. Therefore no singularity is present. Furthermore, we can see that this behavior takes place in an interval \(\Delta z<1\). Finally this variable shows that the universe starts being radiation dominated, then matter dominated, and finally the universe starts accelerating.

Fig. 4
figure 4

Dynamics of the background variable \(\varepsilon _{H}=-\dot{H}/(NH^{2})\). On the left panel we can see that today the universe accelerates (since \(\varepsilon _{H}<1\)), whereas at early times the universe is radiation dominated (as \(\varepsilon _{H}\rightarrow 2\)). On the right panel, we zoom around the redshift \(z\simeq 743\), and we show that the transition is fast but smooth, i.e. no singularity is present (and this also implies that numerics are stable)

Another variable of interest is represented by \(w_{f}=p_{f}/\rho _{f}\), i.e. the effective equation of state for the f-component. Its behavior is shown in Fig. 5, where we can see that the f-component, as already mentioned before, behaves as radiation at early times, but as a cosmological constant at late times.

Fig. 5
figure 5

Dynamics of the equation of state variable \(w_{f}\) for the f-component. On the left panel we can see that today the universe tends to be dominated by a cosmological constant (since \(w_{f}\approx -1\)), whereas at early times the f-component tends to behave as a radiation-component as \(w_{f}\approx 1/3\). On the right panel, we zoom around the redshift \(z\simeq 743\), and we show that also for \(w_{f}\) the transition is fast and smooth

5.4 Evolution of the perturbations

Fig. 6
figure 6

Evolution of the squared speeds of propagation for the scalar-matter modes and tensor modes. On the left panel we can see that the squared speeds of propagation for both dust (\(c_{m}^2\)) and radiation (\(c_{r}^2\)) change, and their values become negative during the transition. For a short time gradient instabilities take place, but as we will see later on, it is not so catastrophic (because the transition is short enough) as to make the matter perturbations totally unstable. This implies that \(\beta \) (the parameter which determines how fast the transition is) must be small enough so that the instability-era is negligible. On the right panel, we show instead that at early times the speed of tensor modes was not unity, but today it is indistinguishable from unity as to pass the multi-messenger constraints.

Fig. 7
figure 7

Dynamics of the perturbation variable \(\delta _{\gamma }\), the photon energy density contrast. It is clear from both panels (the right one describing its evolution during the transition-era), that such a variable still evolves in a way similar to GR after this transition ends). For this plot we have used the same bestfit parameters of the background, and on top of that \(\omega _{b}=0.02284032\), \(\omega _{c}=0.1184566\), \(\tau _{\mathrm{reio}}=0.05183895\), \(\ln (10^{10}A_{s})=3.039270\), \(n_{s}=0.9778259\), and, as for the size of the wave-vector, \(k=0.1\) Mpc\(^{-1}\) (to enhance the effect of the instability in the very short wavelengths, but still linear)

Fig. 8
figure 8

Dynamics of the perturbation variable \(\theta _{\gamma }\), related to the photon velocity perturbation, and the photon shear \(\sigma _{\gamma }\). For low redshifts, these variables become more and more negligible, as expected from their behaviors in GR. In the right panel, in order to enhance the change in the shear (with respect to the change of \(\theta _{\gamma }\)) we have multiplied its difference about the mean value at the transition era (\(\approx 0.07\)), by a factor of 20

Fig. 9
figure 9

Dynamics of the perturbation variables \(\theta _{b}\) and \(\theta _{c}\) (related to the velocity perturbations for the baryons and the CDM components respectively). Also for these variables, after the transition-era ends, their evolution is not too different from GR

Fig. 10
figure 10

Left panel: dynamics of the perturbation variables \(\delta _{b}\) and \(\delta _{c}\) (i.e. the density contrasts for baryons and CDM). Their evolution is dominated by the Jeans instability which leads to galaxy formation, in a way still consistent with GR. Right panel: TT correlation dimensionless coefficients \(C_{l}^{\mathrm{TT}}\) which are bound by observations. This variable, involving typically an integral over the line of sight, smooths out the transition era for the perturbations

After having studied in details the behavior of the background, we now focus on the dynamics of the perturbations. First of all, let us see what happens for the speed of propagation for the modes. In Fig. 6, we can see that the perturbation variables undergo an era of instability (because \(c_{s}^{2}<0\)), whereas tensor modes acquire a velocity of propagation different from unity (at early times, i.e. for \(z>743\)). The fact that there is an era of instability should make us worried, however such an era is relatively short.Footnote 6 Therefore, there is the chance that the matter perturbations still remain finite after that transition-era ends. This is exactly what happens. After all, we already know that the \(\chi ^{2}\) is really good for this model. In fact, the \(\chi ^{2}\) from Planck comes from correlations of quantities (for example TT correlations) which typically involve an integral over the line-of-sight. Therefore, we expect that, if perturbations follow again GR evolution after the transition-era, the results for any such integral will be smooth. Since linear perturbations remains under control, one may expect a similar behavior for higher order perturbations, although we have not studied here this complicated issue.

Let us then study the evolution of the perturbation variables. As shown in Fig. 7, the photon energy density contrast \(\delta _{\gamma }\) remains finite and once the transition is over, its evolution returns to the one similar to GR. Similar considerations can be made for the other perturbation variables, as shown in Figs. 89 and 10.

To conclude the study of the best fit model, we want to emphasize again that the transition era is short-lived enough as to make the instability inefficient so that as soon as it ends, the dynamics is once again following the GR evolution. Therefore this model changes the \(\chi ^{2}\) not because of the transition, but because of the different behavior which it shows at early times (i.e. for \(z>743\)). It should be noticed that the numerics have been always stable as to be sensitive to small variations of \(a_{1}\) (which on the bestfit is about \({+2}\times 10^{-3}\), whereas \(a_{1}=0\) corresponds to \(\Lambda \)CDM) and of the parameter \(\beta \) governing the duration of the transition era. This sensitivity has been achieved by reducing the standard tolerance parameters (\(\simeq 10^{-5}\)) which determine the precision of the numerical solution of the Boltzmann solver, CLASS, by about ten orders of magnitude.

6 Conclusion

We have studied a “kink model” within the class of minimally modified gravity theories dubbed \(f(\mathcal {H})\) theories, which was shown in the present work to have a fit to several early times and late times data sets better than \(\Lambda \)CDM by \(\Delta \chi ^{2}=16.6\). We are impressed by several aspects of it. Most importantly, this model shows once for all that Planck data and \(\Lambda \)CDM do not fit so well with each other. In particular, the kink model performs better than \(\Lambda \)CDM especially on Planck 2018, but also on \(H_{0}\) single-point data sets.

In the context of \(\Lambda \)CDM this aspect is ameliorated for Planck data alone notably if one introduces a non-zero curvature term, which however is not well motivated by inflation and moreover it is strongly suppressed by late time data (especially BAO). On the other hand, late time data do not strongly constrain the kink model, at most as much as flat-\(\Lambda \)CDM, and the kink model still keeps a better fit to Planck 2018 data.

On top of this consideration, the bestfit kink model is characterized by the presence of a transition era which happens at a redshift of \(z\simeq 743\)Footnote 7. Such a transition era happens at intermediate redshifts and not at very high energies. This means that there is the possibility that such a transition may occur in other contexts with strong gravity (inside a star for example). Furthermore during this transition era, the scalar perturbations have an instability (\(c_{s}^{2}<0\)) which, at least, as long as linear perturbation theory holds, does not seem to be catastrophic because of its short duration (\(\Delta z\simeq 0.1\) around \(z\simeq 743\)) so that the matter perturbations (for which we have many constraints) do not show any divergent behavior. In particular, this transition era seems to be washed out when we look at observables which imply a line-of-sight integration.

The kink model then opens up an arena for modified gravity models, which so far are introduced mostly to address late time data only. This model in fact, addresses and resolves tension for \(\Lambda \)CDM in Planck data and at the same time shows a non-trivial window for phenomenology at intermediate redshifts. Future work is needed to address several points which remain to be explored, such as the existence, composition and evolution of compact objects for this model.