1 Introduction

The most successful description of the dynamics and the large-scale structure of the Universe via excellent agreement with a wide variety of the currently available data [1,2,3,4,5], in the literature so far, is known to be presented by the standard (base) Lambda cold dark matter (\(\Lambda \)CDM) model that relies on the inflationary paradigm [6,7,8,9,10,11,12,13]. Despite its great success, in addition to the notoriously challenging theoretical issues related to \(\Lambda \) (cosmological constant) [14,15,16,17], it has recently begun to suffer from some persistent tensions of various degrees of significance between some existing data sets (see, e.g., [18,19,20,21,22] for further reading). Such tensions have received immense attention as these could be signaling new physics beyond the well established fundamental theories of physics underpinning the standard \(\Lambda \)CDM model. For example, the value of the Hubble constant \(H_{0}\) predicted by the cosmic microwave background (CMB) Planck data [2, 5] within the framework of the standard \(\Lambda \)CDM model is in serious disagreement with the direct local distance ladder measurements [23,24,25,26]. This tension becomes even more compelling as it worsens (relieves only partially) when the \(\Lambda \) is replaced by the simplest minimally coupled single-field quintessence (phantom or quintom models), see [27,28,29,30] and [31] for further references. Surprisingly, it has been reported that the \(H_0\) tension – as well as a number of other persistent low-redshift tensions – may be alleviated by a dynamical dark energy (DE) whose density can assume negative values or vanish at high redshifts [31,32,33,34,35,36,37,38,39,40,41,42,43,44]. The fact that the CMB Planck data favor positive spatial curvature – which imitates a negative energy density source – on top of the standard \(\Lambda \)CDM model in contrast to the inflationary paradigm might also be signaling a need for such DE sources [5] (see also [45,46,47]).

The constraint on \(H_0\) from CMB data is inferred by analyzing the separation/distances in the acoustic peak positions, which depend on the angular scale \(\theta _{\star } = r_{\star }/D_\mathrm{M}\), where \(r_{\star }=\int ^{\infty }_{z_{\star }}c_sH^{-1}\mathrm{d}z\) is the comoving sound horizon at recombination – the comoving distance traveled by a sound wave from the reheating to the recombination epoch determined by the pre-recombination (\(z>z_{\star }\)) physics – and \(D_\mathrm{M}=\int _0^{z_{\star }}H^{-1}\mathrm{d}z\) is the comoving angular diameter distance at recombination – determined by the post-recombination physics, viz., by the H(z) for \(z<z_{\star }\) [48]. As DE (generically, described by the equation of state (EoS) of the form \(p\sim -\rho \)) is negligible at large redshifts, it does not affect the pre-recombination physics, viz., \(r_{\star }\). Also, Planck satellite measures \(\theta _{\star }\) very robustly and almost independently of the cosmological model with a high precision [5]. Therefore, \(D_\mathrm{M}\) must remain the same in different DE models (with an exception of the Early Dark Energy models [49], which modify \(r_{\star }\)). Thus, a DE assuming negative energy density values at large redshifts – when it is still not negligible (say when \(z\lesssim 2\)) – will lead to a decrease in H(z) compared to the standard \(\Lambda \)CDM model at large redshifts (for \(z > rsim 2\)), more than the phantom/quintom DE models could achieve. The compensation of this decrease, viz., keeping \(D_\mathrm{M}\) unaltered, then implies an enhanced H(z) for \(z\lesssim 2\), i.e., \(H_0\) as well. Moreover, the sign change in the DE density can even lead to a non-monotonic behavior of H(z), say, at \(z\sim 2\), which in turn may reconcile such models with the Ly-\(\alpha \) forest measurement of the baryon acoustic oscillations (BAO) data as well. Indeed, the DE that assumes negative density values at large redshift came to the agenda first when it turned out that, within the standard \(\Lambda \)CDM model, the Ly-\(\alpha \) forest measurement by the BOSS collaboration prefers a smaller value of the dust density parameter compared to the value preferred by the CMB data [32]. They then reported a clear detection of DE consistent with \(\Lambda >0\) for \(z<1\), but with a preference for negative energy density values for \(z>1.6\), and argued that this Ly-\(\alpha \) data from \(z\approx 2.34\) can be described by a non-monotonic evolution of H(z), which is difficult to achieve in any model with non-negative DE density [33]. The Planck collaboration excludes the Ly-\(\alpha \) data from their default BAO compilation as it persistently remains in large tension with the standard \(\Lambda \)CDM model [5]. They argue, in line with [33], that it is difficult to construct well-motivated extensions to the standard \(\Lambda \)CDM model that can resolve the tension with the Ly-\(\alpha \) data, and suggest further work to assess whether this is a statistical fluctuation caused by small systematic errors, or is a signature of new physics. Of course, an actual (physical) DE source with a negative density would be physically ill, which might be pointing a necessity of considering modified theories of gravity (see [50,51,52,53,54,55,56] for reviews on DE and modified theories of gravity), from which an effective DE source with desired features could be defined. In line with all these, it was argued in [34] that the Ly-\(\alpha \) data could be in tension not only with the standard \(\Lambda \)CDM model but also with standard DE models – restricted to positive energy density values and based on the standard Friedmann equation of general relativity (GR) – , which might be implying (i) DE assuming negative energy density values at high redshifts, (ii) there is a non-conservation of matter source, or (iii) the standard Friedmann equation of GR is inadequate since one could be dealing with a modified gravity theory. An example of (iii) is provided by models in which the \(\Lambda \) is screened (or compensated) by a dynamically evolving counter-term, which arises in the Friedmann equation due to the modified gravity. Such examples are in fact familiar from an effective source defined by the collection of all modifications to the usual Einstein field equations in scalar-tensor theories of gravitation, namely, when the cosmological gravitational coupling strength gets weaker with increasing redshift [57, 58]. See, e.g., Refs. [59,60,61,62] suggesting larger \(H_0\) values in the light of observational analyses when the Brans-Dicke theory or its extensions are considered. There is a wide range of examples, related to these three possibilities, that exist (i) in theories in which \(\Lambda \) relaxes from a large initial value via an adjustment mechanism [63,64,65], (ii) in the models in which \(\Lambda \) itself spontaneously switches sign [42, 66], (iii) in cosmological models based on Gauss-Bonnet gravity [67], (iv) in braneworld models [68, 69], (v) in loop quantum cosmology [70, 71], (vi) in higher-dimensional cosmologies that accommodate dynamical reduction of the internal space [72,73,74,75], (vii) in generalisations of the form of the matter Lagrangian in a non-linear way [76,77,78], (viii) in some constructions within the unimodular gravity violating the local energy-momentum conservation law [44].

In this paper, we carry out a detailed theoretical and observational investigation of the Rastall gravity [79, 80], which presents a simple mathematical generalization of GR leading to physically rich features that could be related to the cosmological points discussed above. As it was pointed out in [81], an equivalent of a cosmological model constructed within the Rastall gravity can always be achieved by introducing a particular non-minimal coupling between the cosmological constant and matter stresses within the usual GR, which, however, could be neither trivial nor economical (see Sect. 3). Although the Rastall gravity presents a simple generalization of GR (derived from Einstein–Hilbert action) at the level of the field equations, there is no consensus on that it could be derived from an action of a well established fundamental theory, but some attempts in this direction have been made. It was shown in [82] that its field equations can be derived from a variational principle in a Weyl–Cartan theory, in which the metricity condition for the connection is dropped and the torsion is allowed. Some Lagrangian formulations for it have been proposed within the framework of f(RT) and \(f(R,\mathcal {L}_m)\) gravities [83, 84].

The original physical idea behind the Rastall gravity was the fact that the tight constraints on the local energy-momentum conservation law (\(\nabla ^{\mu }T_{\mu \nu }=0\)) in flat-spacetime do not necessarily imply that this law is valid in curved-spacetime (e.g., in an expanding Universe on cosmological scales) as well [79, 80]. This idea was then followed by the introduction of the relation \(\nabla ^{\mu }T_{\mu \nu }\propto \nabla _{\nu }R\) between the energy-momentum tensor (EMT) and the scalar curvature (the simplest curvature invariant of a Riemannian manifold). This leads to a simple mathematical generalization of the standard Einstein field equations of GR adding the term \(g_{\mu \nu }R\) to the field equations with an arbitrary coefficient, the so-called Rastall gravity: \(R_{\mu \nu }-\alpha g_{\mu \nu }R= T_{\mu \nu }\) with \(\alpha \) being a real constant. The particular case \(\alpha =\frac{1}{2}\) leading to the Einstein tensor \(G_{\mu \nu }\) of GR is unique as it, through the twice-contracted Bianchi identity, yields \(\nabla ^{\mu }G_{\mu \nu }=0\), and therefore guarantees the local conservation of the EMT of the total material content, i.e., \(\nabla ^{\mu }T_{\mu \nu }=0\). Therefore, any deviation from \(\alpha =\frac{1}{2}\) (GR) will lead to two simultaneous modifications of different nature in the standard Einstein field equations: (i) The new term \(\epsilon g_{\mu \nu }R\) (with \(\epsilon =\alpha -\frac{1}{2}\)) of the form of the usual vacuum energy of quantum field theory (QFT) (\(T_{\mu \nu }=g_{\mu \nu }\Lambda \)) appears in the spacetime geometry side of the Einstein field equations of GR. (ii) The evolution of the energy density of an actual material source gets altered from its usual one in GR, in a certain way owing to the non-conservation of the EMT described by \(\nabla ^{\mu }T_{\mu \nu }=-\epsilon \nabla _{\nu }R\). These two simultaneous features tempted us to carefully study the extension of the standard \(\Lambda \)CDM model replacing the gravity theory from GR to Rastall gravity due to the following reasons: The new term \(\epsilon g_{\mu \nu }R\) could dynamically screen the usual vacuum energy at high redshifts for a certain range of \(\epsilon \) as suggested, e.g., in [34]. In addition, this extension could also modify inverse proportionality of the dust (e.g., the CDM) energy density to the comoving volume scale factor. It is not clear whether these two simultaneous modifications in the Friedmann equation will support or act against each other, and then whether these together could address the low redshift tensions.

The Rastall gravity has been attracting a lot of attention by the communities in the field of gravitation and cosmology in the recent years. See, for instance, [85] for black hole solutions, [86] for gravitational collapse, [87] for thermodynamic analysis, and [88,89,90,91] for some cosmological applications. It has been suggested in [90] that, when the Renyi entropy of non-extensive systems is attributed to the horizon of spatially flat Friedmann-Robertson-Walker Universe in Rastall gravity, the late time acceleration can be generated from the non-conservation of dust. It was argued in [91] that Rastall theory provides a proper platform for generalizing the unimodular gravity (the trace-free Einstein gravity) [92, 93], wherein the usual vacuum energy does not gravitate but the cosmological constant arises as an integration constant. The authors of Ref. [89] impose the Rastall gravity contributions from the non-conservation of dust upon DE which makes it clustering. Then, it is suggested in [94, 95] that this model resembles the standard \(\Lambda \)CDM model at the background level (with an \(\epsilon \) not strictly constrained, provided that the DE yields an equation of state parameter very close to minus unity), while in [96] that the evolution of the growth index displays a significant deviation from that in the standard \(\Lambda \)CDM model. One of the main motivations behind such attempts is that observational signatures of non-conservation in the dark sector is expected in the non-linear regime on intermediate or small scales, and is not inconsistent with the currently available cosmological data (see [97] for details). In fact, just upon the proposal of the Rastall gravity, the Rastall parameter has been quite tightly constrained from local physics, relying basically on the non-conservation property of the model, to be \(|\epsilon |\lesssim 10^{-15}\), which suggests that the Rastall gravity deviates from GR only negligibly and thereby it is rather unattractive [98]. Using realistic equations of state for the neutron star interior, an astrophysical constraint is placed on the Rastall gravity suggests that it is well consistent with GR as \(|\epsilon |\lesssim 10^{-2}\) [99]. In contrast, the study [100] on much larger scales, using 118 galaxy-galaxy strong gravitational lensing systems, reports the constraint \(\epsilon =-0.163\pm 0.001\) (\(68\%\) CL) excluding GR.

Here, we study the robust and accurate observational constraints on the Rastall gravity extension of the standard \(\Lambda \)CDM model. These would not only be important to see whether the Rastall gravity is a good candidate for studying the cosmological tensions discussed above or not, but also, as being robust and accurate, may provide a guide for the research community that studies the Rastall gravity in various aspects of gravitation and cosmology. Accordingly, we first construct the Rastall gravity extension of the base \(\Lambda \)CDM model at the background level (Sect. 2) and elucidate its general relativistic equivalence (Sect. 3). We carry out a preliminary investigation of the model which provides a guide to its working and parameters (Sect. 4). After deriving the linear perturbation equations (Sect. 5), we constrain the model parameters using the latest full Planck CMB data, with and without including BAO data, in comparison to the standard \(\Lambda \)CDM model (Sect. 6). We finally present a statistical comparison of the fit via Bayesian evidence (Sect. 7) and conclude our findings (Sect. 8).

2 Rastall gravity extension of the base \(\Lambda \)CDM model

The Rastall gravity offers a simple generalization of the standard Einstein field equations of GR by relaxing the contribution of the term \(g_{\mu \nu }R\) to the field equations and leads to the following modified Einstein field equations:

$$\begin{aligned} R_{\mu \nu }-\left( \frac{1}{2}+\epsilon \right) g_{\mu \nu }R= \kappa T_{\mu \nu }, \end{aligned}$$
(1)

where \(\kappa \) is Newton’s constant scaled by a factor of \(8\pi \) (and henceforth \(\kappa =1\)) and units are used such that \(c=1\), \(R_{\mu \nu }\) is the Ricci tensor, R is the curvature scalar, \(g_{\mu \nu }\) is the metric tensor, and \(T_{\mu \nu }\) is the EMT describing the material content. The real constant \(\epsilon \) is the Rastall parameter that measures the deviation from GR (\(\epsilon =0\)).

This modification in the spacetime geometry side (l.h.s.) of the Einstein field equations of GR corresponds to two simultaneous modifications of different nature in the material content side (r.h.s.): (i) Firstly, this modification is mathematically equivalent to adding, in a certain way, new contributions of the actual material sources to the right hand side of the standard Einstein field equations, which then can be interpreted as an effective source accompanying to the actual material sources considered in the model. For, we can rewrite (1) in a mathematically equivalent way as follows:

$$\begin{aligned} R_{\mu \nu }-\frac{1}{2}g_{\mu \nu }R= T_{\mu \nu }+ \hat{T}_{\mu \nu }, \end{aligned}$$
(2)

where

$$\begin{aligned} \hat{T}_{\mu \nu }=-\frac{\epsilon }{1+4\epsilon }g_{\mu \nu }T \end{aligned}$$
(3)

is the EMT describing the effective source that arises from the actual material source. Here, we have made use of the relation \(T\equiv g^{\mu \nu }T_{\mu \nu }=-(1+4\epsilon )R\) between the trace of the EMT of the actual material source and the curvature scalar, obtained by contracting (1) with the inverse metric tensor \(g^{\mu \nu }\). (ii) Secondly, this modification leads, in general, to a violation of the local conservation of the EMT of an actual material source (therefore, that of the effective source as well), as its divergence is not necessarily null, viz.,

$$\begin{aligned} \nabla ^{\mu }T_{\mu \nu }=-\epsilon \nabla _{\nu }R=\frac{\epsilon }{1+4\epsilon }\nabla _{\nu }T. \end{aligned}$$
(4)

It implies that the evolution of the energy density of an actual material source is, in general, modified compared to its usual evolution in general relativistic models. The reason is that only the covariant derivative of the Einstein tensor (\(G_{\mu \nu }\equiv R_{\mu \nu }-\frac{1}{2}g_{\mu \nu }R\)) part of the Rastall gravity (1) is guaranteed to be null \(\nabla ^{\mu }G_{\mu \nu }=0\) through the twice-contracted Bianchi identity.

In this work, we study the Rastall gravity extension of the standard (the six-parameter base) \(\Lambda \)CDM model parameterized by only one additional degree of freedom, the Rastall parameter \(\epsilon \), while keeping all the constituents (e.g., the physical ingredients of the Universe, the laws of the local physics) of the standard model as usual. Accordingly, we consider the spatially maximally symmetric and flat Friedmann-Robertson-Walker (FRW) spacetime

$$\begin{aligned} \mathrm{d}s^2=-\mathrm{d}t^2+a^2(t)\,\mathrm{d}\mathbf {x}^2, \end{aligned}$$
(5)

where the scale factor a(t) is function of proper time t only. For describing the standard material content of the Universe, as usual, we consider the perfect fluid EMTs:

$$\begin{aligned} T^{\mu \nu }_{i}=(\rho _i+p_i)u^{\mu }u^{\nu }+\,p_i\,g^{\mu \nu }, \end{aligned}$$
(6)

where the index i runs over the different actual sources described by the EoS of the form \(p_i/\rho _i=w_i=\mathrm const.\) (with \(\rho _i\) and \(p_i\) being the energy density and the pressure of the \(i^\mathrm{th}\) fluid, respectively), \(u_\mu =(-1,0,0,0)\) is its velocity in the comoving frame (rest frame of the fluid) satisfying \(u_{\mu }u^{\mu }=-1\) and \(\nabla _{\nu }u^{\mu }u_{\mu }=0\).

We proceed with writing the modified Friedmann equations in a proper manner, namely, in a manner clearly identifying and handling the two simultaneous modifications of different nature in the material content side (r.h.s.) of the Einstein field equations of GR due to the Rastall gravity. We first note that the EMT describing the effective source is always of the form that of the usual vacuum energy of QFT:

$$\begin{aligned} \hat{T}^{\mu \nu }_{i}=\hat{p}_i\,g^{\mu \nu }. \end{aligned}$$
(7)

This could be deduced from

$$\begin{aligned} \hat{\rho }_i=-\hat{p}_i=\frac{\epsilon }{1+4\epsilon }(3w_i-1)\rho _{i}, \end{aligned}$$
(8)

which is obtained by using (6) in (3) along with the trace of the EMT of the ith fluid \(T_i=\rho _{i}(3w_i-1)\).

The Einstein field equations of the model under consideration can explicitly be written as a set of two linearly independent differential equations with the unknown functions H and \(\rho _i\) as follows;

$$\begin{aligned} 3H^{2} =&\sum _i\rho _{i}+\rho _\mathrm{X}, \end{aligned}$$
(9)
$$\begin{aligned} -3H^{2}-2\dot{H}=&\sum _i w_i\rho _i+p_\mathrm{X}, \end{aligned}$$
(10)

where \(H=\frac{\dot{a}}{a}\) is the Hubble parameter and the overdot denotes the derivative with respect to t. Note that \(\rho _\mathrm{X}=\sum _i\hat{\rho }_i\) and \(p_\mathrm{X}=\sum _i\hat{p}_i\) (satisfying \(p_\mathrm{X}=-\rho _\mathrm{X}\)) stand for the total energy density and pressure of the usual vacuum energy-like effective source accompanying to the actual sources and are not independent functions but are fully determined by the actual sources through (8).

The dynamics of the actual sources – and hence the dynamics of the effective source as well – can directly be obtained from the continuity equation (4), which explicitly is

$$\begin{aligned} \sum _i \big [\dot{\rho }_i+ 3H(1+ w_i)\rho _i\big ]= \frac{\epsilon }{1+4\epsilon }\sum _i\dot{\rho }_i(1-3w_i). \end{aligned}$$
(11)

It is reasonable to suppose that the fluids (actual sources) on cosmological scales are minimally interacting, i.e., interacting only gravitationally, which implies the separation of (11) for each type of fluid. In this case, we find the following redshift (\(z=-1+1/a\)) dependency for the background evolution of the energy density of the \(i^\mathrm{th}\) fluid (actual source):

$$\begin{aligned} \rho _{i}=&\rho _{i0}\left( 1+z\right) ^{3(w_{i}+1)\left[ 1+\epsilon \frac{1-3w_{i}}{1+3\epsilon (1+w_{i})}\right] }. \end{aligned}$$
(12)

Here and henceforth a subscript 0 denotes the present-day (\(z=0\)) value of any quantity. We see that, except the cases \(w_i=-1\,\mathrm{and}\,\frac{1}{3}\), the redshift dependence of the energy density of an actual source is modified with respect to its standard dependence \(\rho _{i}=\rho _{i0} (1+z)^{3(1+w_i)}\). Thus, we have the usual relations \(\rho _{\mathrm{vac}}=\rho _{\mathrm{vac0}}=\mathrm{const.}\) for the usual vacuum energy \(\left( w_{\mathrm{vac}}=-1\right) \) and \(\rho _{\mathrm{r}}=\rho _{\mathrm{r0}}(1+z)^4\) for radiation \(\left( w_{\mathrm{r}}=\frac{1}{3}\right) \), while a modified redshift dependence \(\rho _{\mathrm{m}}=\rho _{\mathrm{m0}}(1+z)^{3+\frac{3\epsilon }{1+3\epsilon }}\) for dust \(\left( w_{\mathrm{m}}=0\right) \).

Next, considering (8) and (12), it turns out that despite the fact that the effective source resembles the usual vacuum energy with an EoS parameter \(\frac{p_\mathrm{X}}{\rho _\mathrm{X}}=w_\mathrm{X}=-1\), its energy density is not a constant, but

$$\begin{aligned} \rho _\mathrm{X}=\frac{\epsilon }{1+4\epsilon }\sum _i (3w_i-1)\rho _{i0}\left( 1+z\right) ^{3(w_{i}+1)\left[ 1+\epsilon \frac{1-3w_{i}}{1+3\epsilon (1+w_{i})}\right] }. \end{aligned}$$
(13)

This obviously results from the non-conservation of the EMT of the actual material sources, see (4). Consequently, we have

$$\begin{aligned} \rho _\mathrm{X}=\hat{\rho }_\mathrm{vac}+\hat{\rho }_\mathrm{r}+\hat{\rho }_\mathrm{m}, \end{aligned}$$
(14)

where

$$\begin{aligned} \begin{aligned} \hat{\rho }_\mathrm{vac}=&-\frac{4\epsilon }{1+4\epsilon }\rho _\mathrm{vac0},\quad \hat{\rho }_\mathrm{r}=0\quad \text {and}\quad \\ \hat{\rho }_\mathrm{m }=&-\frac{\epsilon }{1+4\epsilon }\rho _\mathrm{m0}\left( 1+z\right) ^{3+\frac{3\epsilon }{1+3\epsilon }}. \end{aligned} \end{aligned}$$
(15)

Note that \(\hat{\rho }_\mathrm{r}=0\) due to the fact that radiation is traceless \(\left( T=0\right) \). Therefore, it does not contribute to the effective source, i.e., to \(\rho _\mathrm{X}\), as like it has been preserving its usual evolution \(\rho _\mathrm{r}\propto (1+z)^{4}\). The usual vacuum energy (\(w_\mathrm{vac}=-1\)) of the QFT, on the other hand, still contributes to the Friedmann equation (9) like a cosmological constant, albeit with a rescaled value as \(\rho _\Lambda =\rho _\mathrm{vac}+\hat{\rho }_\mathrm{vac}=\frac{1}{1+4\epsilon }\rho _\mathrm{vac}\). According to this, for a positive vacuum energy, \(\rho _\mathrm{vac}>0\), to contribute to the Friedmann equation like a positive cosmological constant, \(\rho _\Lambda >0\), there is a condition \(\epsilon >-\frac{1}{4}\). In what follows, we stick to this condition considering the fact that the recent observations provide a clear detection of DE consistent with \(\rho _{\Lambda }>0\) in the vicinity of present-day Universe, viz., for \(z<1\) (see, for instance, [33]). The further condition \(\epsilon >0\) leads to \(\rho _\mathrm{X}<0\) (viz., \(\hat{\rho }_\mathrm{vac}<0\) and \(\hat{\rho }_\mathrm{m}<0\)). Namely, under this condition, we have \(\rho _\mathrm{X}(z=0)=-\frac{\epsilon }{1+4\epsilon }(4\rho _\mathrm{vac}+\rho _\mathrm{m0})<0\), and \(\rho _\mathrm{X}\) continuously growing in larger negative values in the past. Thus, in this case (\(\epsilon >0\)), the effective source \(\rho _\mathrm{X}\) dynamically screens the vacuum energy \(\rho _\mathrm{vac}\) in the finite past, and in particular, the complete screening (viz., when \(\rho _\mathrm{vac}+\rho _\mathrm{X}=0\)) takes place at the redshift:

$$\begin{aligned} z_*=\left( \frac{1}{\epsilon }\frac{\rho _\mathrm{vac0}}{\rho _\mathrm{m0}}\right) ^{\frac{1+3\epsilon }{3+12\epsilon }}-1. \end{aligned}$$
(16)

This situation achieved for \(\epsilon >0\) is of particular interest and tempting for its further theoretical and observational investigation, as it has recently been reported in [31,32,33,34,35,36,37,38,39,40,41,42,43,44] that a number of persistent low-redshift tensions, including the \(H_0\) tension, may be alleviated by a dynamical DE that assumes negative energy density values (or in cosmological models wherein the cosmological constant is dynamically screened) at finite redshift (see Sect. 1).

Finally, the modified Friedmann equation (9) for the Rastall gravity extension of the standard \(\Lambda \)CDM (Rastall-\(\Lambda \)CDM) reads

$$\begin{aligned} \begin{aligned} 3 H^2 =\rho _\mathrm{vac0}+\rho _\mathrm{m0}\left( 1+z\right) ^{3+\frac{3\epsilon }{1+3\epsilon }}+\rho _\mathrm{r0}\left( 1+z\right) ^{4}+\rho _\mathrm{X}, \end{aligned} \end{aligned}$$
(17)

where

$$\begin{aligned} \rho _\mathrm{X}=-\frac{\epsilon }{1+4\epsilon }\left[ 4\rho _\mathrm{vac0}+\rho _\mathrm{m0}\left( 1+z\right) ^{3+\frac{3\epsilon }{1+3\epsilon }}\right] . \end{aligned}$$
(18)

This can be rewritten in terms of density parameters, \(\Omega _{i0}=\frac{\rho _{i0}}{3H_0^2}\), as follows:

$$\begin{aligned} \begin{aligned} \frac{H^2}{H_0^2}=&\,\Omega _\mathrm{vac0}+\Omega _\mathrm{m0}\left( 1+z\right) ^{3+\frac{3\epsilon }{1+3\epsilon }}+\Omega _\mathrm{r0}\left( 1+z\right) ^4 \\&+\Omega _\mathrm{X0}\frac{4\Omega _\mathrm{vac0}+\Omega _\mathrm{m0}\left( 1+z\right) ^{3+\frac{3\epsilon }{1+3\epsilon }}}{4\Omega _\mathrm{vac0}+\Omega _\mathrm{m0}}, \end{aligned} \end{aligned}$$
(19)

where

$$\begin{aligned} \Omega _\mathrm{X0}=-\frac{\epsilon }{1+4\epsilon }\left( 4\Omega _\mathrm{vac0}+\Omega _\mathrm{m0}\right) , \end{aligned}$$
(20)

and the consistency relation \(\Omega _\mathrm{vac0}+\Omega _\mathrm{m0}+\Omega _\mathrm{r0}+\Omega _\mathrm{X0}=1\) is satisfied.

3 General relativistic equivalence: non-minimally coupled \(\Lambda \) and matter

As it was pointed out in [81], an equivalent of a cosmological model constructed within the Rastall gravity can always be constructed within the usual GR. But, this must be understood correctly. This does not imply that the Rastall gravity and GR are equivalent – namely, that the same set of sources leads to the same cosmological models –, but that the cosmological model in the presence of a certain set of sources constructed within the Rastall gravity can be reproduced upon a particular setup in the matter sector of the usual GR. When we compare the Einstein field equations of the usual GR, \(R_{\mu \nu }-\frac{1}{2}g_{\mu \nu }R+\Lambda g_{\mu \nu }=\kappa T_{\mu \nu }\), to the Rastall gravity field equations (1), it turns out that the Rastall parameter \(\epsilon \) sets the relation \(\Lambda g_{\mu \nu }\rightarrow \epsilon R g_{\mu \nu }\) between the cosmological ‘constant’ and scalar curvature – the two parameters that are of the same in nature –, which implies

$$\begin{aligned} \Lambda =-\epsilon R, \end{aligned}$$
(21)

and then – through the twice-contracted Bianchi identity \(\nabla ^{\mu }(R_{\mu \nu }-\frac{1}{2}g_{\mu \nu }R)=0\) leading to the relation \(\nabla ^{\mu }(\kappa T_{\mu \nu }+g_{\mu \nu }\Lambda )=0\) – a non-minimal interaction between the cosmological ‘constant’ and matter fields as

$$\begin{aligned} \nabla ^{\mu }T_{\mu \nu }=Qu_{\nu }\quad \text {and}\quad \nabla _{\nu }\Lambda =-Qu_{\nu }, \end{aligned}$$
(22)

described by the energy-momentum transfer function

$$\begin{aligned} Qu_{\nu }=\frac{\epsilon }{1+4\epsilon }\nabla _{\nu }T. \end{aligned}$$
(23)

Thus, the Rastall gravity extension of the standard \(\Lambda \)CDM (Rastall-\(\Lambda \)CDM) model under consideration in this study, corresponds to a very particular cosmological setup within the usual GR, namely, to a uniquely tailored extension of the standard \(\Lambda \)CDM model, wherein the cosmological ‘constant’ now is a dynamical quantity – relying on its non-minimal interaction with the matter fields – in a particular way that guarantees it to remain proportional to the curvature scalar. Namely, in principle, we could have constructed exactly the same cosmological model under consideration here well within the usual GR from the beginning. Indeed, one may check that it is equivalent to a general relativistic cosmological model wherein the energy transfer function between the cosmological ‘constant’ and matter fields is given in the following cumbersome form:

$$\begin{aligned} \begin{aligned} Q&=\frac{\epsilon }{1+4\epsilon }H(z)(1+z)\sum _i (1-3w_i)\frac{\mathrm{d}\rho _{i}}{\mathrm{d}z} \\&=\frac{\sqrt{3}\epsilon }{1+3\epsilon }\rho _\mathrm{m0}\left( 1+z\right) ^{3+\frac{3\epsilon }{1+3\epsilon }}\\&\quad \times \bigg [\frac{1}{1+4\epsilon } \rho _\mathrm{vac0}+\frac{1+3\epsilon }{1+4\epsilon }\rho _\mathrm{m0}\left( 1+z\right) ^{3+\frac{3\epsilon }{1+3\epsilon }} \\&\quad +\rho _\mathrm{r0}\left( 1+z\right) ^{4}\bigg ]^{1/2}. \end{aligned} \end{aligned}$$
(24)

Indeed, it is obvious that the Rastall-\(\Lambda \)CDM model – wherein we simply control the coupling strength of the curvature scalar to the gravity via the Rastall parameter \(\epsilon \) – is completely different than the standard \(\Lambda \)CDM model, and moreover the alternative construction of this model within the usual GR from the beginning, is neither trivial nor economical. Yet we have learned one another important lesson from this discussion: The model under consideration here presents a particular example of general relativistic cosmological models wherein there is non-minimal interaction within the dark sector [101, 102] – i.e., between the ‘cold’ dark matter and DE (in our case \(\Lambda \)). Such cosmological models are of particular interest in the current cosmological studies [103,104,105,106,107,108,109] as it has recently turned out that they are potential candidates for addressing the so-called \(H_0\) tension prevailing within the standard \(\Lambda \)CDM model. Therefore, it is conceivable that the Rastall-\(\Lambda \)CDM model must also be a potential candidate for addressing the \(H_0\) tension. Indeed, we will show in what follows, without switching to the GR construction of the model, that the deviation term in the Rastall gravity, \(\epsilon g_{\mu \nu }R\), can dynamically screen the usual vacuum energy at high redshifts, which in turn leads to larger \(H_0\) values compared to the standard \(\Lambda \)CDM.

4 A preliminary investigation

In this section, we present a preliminary investigation for a demonstration of how the Rastall-\(\Lambda \)CDM model works, and a guide to the values of the parameters of it. We first derive some useful parameters that we shall use to discuss some features/limitations of the model.

First of all, since the usual radiation evolution is not affected from the Rastall gravity extension, we can safely use the relevant standard equations. The photon energy density today \(\rho _{{\gamma }0}\) is then still well constrained, relying on a simple relation: \(\rho _{\gamma }=\frac{\pi ^2}{15} T_\mathrm{CMB}^4\) with the CMB monopole temperature [48], which is very precisely measured to be \(T_{\mathrm{CMB}0}=2.7255\pm 0.0006\,\mathrm{K}\) [110]. We suppose, in line with standard particle physics, three neutrino species (\(N_\mathrm{eff}=3.046\)) with minimum allowed mass \(\sum m_{\nu }=0.06\, \mathrm{eV}\). Then, the radiation density parameter can be given in the standard way: \(\Omega _{\mathrm{r}0}=\Omega _{\mathrm{\gamma }0}+\Omega _{{\nu }0}=4.18343\times 10^{-5} h^{-2}\), where h is the dimensionless reduced Hubble constant parametrizing the Hubble constant via \(H_0=100\,h\, \mathrm{km\,s}^{-1}\,\,\mathrm{Mpc}^{-1}\) [48]. Using a reasonable value, for instance, \(H_0=68\, \mathrm{km\,s}^{-1}\,\,\mathrm{Mpc}^{-1}\), we find that the density parameter of the radiation today is negligible, viz., \(\Omega _{\mathrm{r}0}=9.0472 \times 10^{-5}\). Neglecting this small contribution of radiation today, we have \(\Omega _\mathrm{vac0}+\Omega _\mathrm{m0}+\Omega _\mathrm{X0}=1\). Using this relation with (20), we can write the present-day density parameter of the effective source as follows:

$$\begin{aligned} \Omega _\mathrm{X0}=-4\epsilon +3\,\epsilon \,\Omega _\mathrm{m0}. \end{aligned}$$
(25)

From this, we read off \(\frac{\rho _\mathrm{X0}}{\rho _\mathrm{m0}}=-\epsilon \,\left( \frac{4}{\Omega _\mathrm{m0}}-3\right) \), while we have \(\frac{\rho _\mathrm{X}}{\rho _\mathrm{m}}\approx -\frac{\epsilon }{1+4\epsilon }\) for \(z\gg 0\), say, in the early Universe, see (12) and (15). Using the relation (25) along with (16), the redshift at which the vacuum energy is completely screened by the effective source reads as

$$\begin{aligned} z_*=\left( \frac{1}{\epsilon \,\Omega _\mathrm{m0}}+\frac{4}{\Omega _\mathrm{m0}}-\frac{1}{\epsilon }-3\right) ^{\frac{1+3\epsilon }{3+12\epsilon }}-1. \end{aligned}$$
(26)

Since the evolution of radiation remains unaltered in the Rastall gravity, we basically do not expect any modification in the standard history of the Universe throughout the radiation epoch. Yet, the modified evolution of dust would have consequences on the transition from radiation to dust domination. The radiation-matter (dust) transition is one of the most important epochs in the history of the Universe, as it alters the growth rate of density perturbations: during the radiation epoch, which yields \(H^2(z)\propto (1+z)^{4}\), perturbations well inside the horizon are nearly frozen but once matter domination commences as H(z) flattens to yield \(H^2(z)\propto (1+z)^{3}\) during the dust epoch, perturbations on all length scales are able to grow by gravitational instability and therefore it sets the maximum of the matter power spectrum. The modified matter-radiation equality (\(\rho _\mathrm{r}=\rho _\mathrm{m}\)) redshift reads

$$\begin{aligned} \begin{aligned} z_\mathrm{eq}=\left( \frac{\Omega _\mathrm{m0}}{\Omega _\mathrm{r0}}\right) ^{1+3\epsilon }-1, \end{aligned} \end{aligned}$$
(27)

where, for a given value of the ratio of the density parameters – of course, we suppose \(\frac{\Omega _\mathrm{m0}}{\Omega _\mathrm{r0}}>1\) – positive (negative) \(\epsilon \) values shift \(z_\mathrm{eq}\) to larger (smaller) values. This in turn shifts the turnover in the matter power spectrum via a highly sensitive parameter to the modifications to GR, namely, the wavenumber of a mode that enters the horizon at the radiation-matter transition:

$$\begin{aligned} \begin{aligned} k_\mathrm{eq}=\frac{H_\mathrm{eq}}{1+z_\mathrm{eq}}=H_0 \sqrt{\frac{2+7\epsilon }{1+4\epsilon }\Omega _\mathrm{m0}\left( \frac{\Omega _\mathrm{m0}}{\Omega _\mathrm{r0}}\right) ^{1+6\epsilon }}, \end{aligned} \end{aligned}$$
(28)

where we have ignored \(\Omega _{\mathrm{vac}0}\) since its contribution is safely negligible.

Note that the condition \(\epsilon >-\frac{1}{4}\) that we introduced for \(\rho _{\Lambda }>0\) in the previous section, ensures the real positive values of \(k_\mathrm{eq}\) and \(H^2(z)\propto (1+z)^{3+\frac{3\epsilon }{1+3\epsilon }}\) during the dust era to be flatter than \(H^2(z)\propto (1+z)^{4}\) during the radiation era. These two parameters, \(H_\mathrm{eq}\) and \(k_\mathrm{eq}\), are not expected to deviate much from the ones obtained within the standard \(\Lambda \)CDM model. Therefore, these are very useful to give an opinion whether a cosmological model is well behaved at high redshifts, for instance, with regard to the CMB data relevant to \(z\sim 1100\).

We can now make use of the parameters derived here for a preliminary investigation of the model: The values of these parameters may be utilized for making estimations on \(\epsilon \) by manipulating the late time dynamics of the Universe in our model, for instance, to better describe the existing model independent \(H_0\) data as well as the BAO data from \(z\lesssim 2.4\). We, of course, must also check the price paid for this manipulation from the chosen \(\epsilon \) value in the dynamics of the earlier Universe, for instance, in the cosmological parameters physically related/sensitive to the presence/amount of radiation.

We proceed with a reasonable set of values: \(\Omega _\mathrm{m0}= 0.31\) and \(H_0=68\, \mathrm{km\,s}^{-1}\,\,\mathrm{Mpc}^{-1}\), acceptable with regard to both the recent Planck predictions [5] and the model independent tip of the red giant branch (TRGB) \(H_0\) value [26], along with the choice of \(\epsilon =0.06\). We find, for the present-day Universe, a considerable amount of negative contribution of the effective source, \(\Omega _\mathrm{X0}=-0.184\) [see (25)], which is then compensated by the increased value of the usual vacuum energy, \(\Omega _\mathrm{vac0}=0.874\), so that to yield a cosmological constant-like contribution, \(\Omega _{\Lambda 0}=0.69\), as in the standard \(\Lambda \)CDM (\(\epsilon =0\)). On the other hand, this enhanced amount of the usual vacuum is completely screened by the effective source at \(z_*=2.4\) [see (26) and Fig. 1], which is pretty close to the values suggested in [33, 34, 42] for relaxing a number of persistent low-redshift tensions, including the \(H_0\) tension, that arise within the standard \(\Lambda \)CDM model. It is worth noting that, as may be seen in the same figure, for \(z_*>2.4\), the dust energy density assumes values larger than the total energy density of the Universe. Yet, the ratio of the energy density of the effective source to that of the dust is \(\frac{\rho _\mathrm{X0}}{\rho _\mathrm{m0}}=-0.59\) today but it settles in a value pretty close to zero, \(\frac{\rho _\mathrm{X}}{\rho _\mathrm{m}}\approx -0.048\), at high redshifts (\(z\gg 0\)). This implies that the impact of the effective source on the dynamics of the Universe diminishes (yet not completely) with the increasing redshift. However, the price (due to the modification in the EMT conservation) we paid for this tempting result (say, the screening of the vacuum energy) is that the dust energy density grows considerably faster than it does in the usual GR, \(\rho _\mathrm{m}\propto (1+z)^{3.15}\) (which is also tracked by the effective source at high redshifts), whereas the radiation energy density always grows as usual, \(\rho _\mathrm{r}\propto (1+z)^{4}\). This leads to unrealistic values for the key parameters relevant to the early Universe, namely, \(z_\mathrm{eq}=15303\) and \(k_\mathrm{eq}=0.04470 \,\, \mathrm{Mpc}^{-1}\), which are extremely different than the values \(z_\mathrm{eq}=3391\) and \(k_\mathrm{eq}=0.01045\,\, \mathrm{Mpc}^{-1}\) obtained in the case of the standard \(\Lambda \)CDM model (\(\epsilon =0\)). This situation signals that the Rastall-\(\Lambda \)CDM model with \(\epsilon =0.06\), which is tempting as it leads to \(z_*=2.4\) in line with [33, 34, 42], is not well behaved at large redshifts. Thus, it is conceivable that the high redshift cosmological data would not allow such large positive values of \(\epsilon \).

Fig. 1
figure 1

Plot of \(\rho /\rho _\mathrm{c0}\) vs z for different combinations of energy densities. In all cases, we use \(\Omega _\mathrm{m0}= 0.31\) and \(H_0=68\, \mathrm{km\,s}^{-1}\,\,\mathrm{Mpc}^{-1}\) and \(\epsilon =0.06\). Here the vertical dashed line refers to the redshift \(z_*=2.4\), at which the effective source \(\rho _\mathrm{X}\) completely screens the usual vacuum energy \(\rho _\mathrm{vac}\)

Fig. 2
figure 2

Plot of \(H(z)/(1+z)\) vs z for some selected values of \(\epsilon \) and \(H_0\) as shown in the legend. In all cases, we use \(\Omega _{\mathrm{m}0}=0.31\). The three error bars stand for \(H_0= 69.8 \pm 0.8\, \mathrm{km\,s}^{-1}\,\,\mathrm{Mpc}^{-1}\) from the TRGB \(H_0\) [26], \(H(z=0.57) = 97.9 \pm 3.4\,\mathrm{km\,s}^{-1}\,\,\mathrm{Mpc}^{-1}\) [111], and \(H(z=2.34) = 222.4 \pm 5.0\,\mathrm{km\,s}^{-1}\,\,\mathrm{Mpc}^{-1}\) from the latest BAO data [32]

Next, we proceed to have a closer look at the dynamics of the Universe by focusing on a narrow redshift range \(0\le z\le 3\), within which we can, in a relatively straightforward way, compare the H(z) function of the Rastall-\(\Lambda \)CDM model with the model independent \(H_0\) measurements, e.g., \(H_0= 69.8 \pm 0.8\, \mathrm{km\,s}^{-1}\,\,\mathrm{Mpc}^{-1}\) from the TRGB \(H_0\) [26], and the latest high precision BAO data: \(H(z=0.57) = 97.9 \pm 3.4\,\mathrm{km\,s}^{-1}\,\,\mathrm{Mpc}^{-1}\) [111] and \(H(z=2.34) = 222.4 \pm 5.0\,\mathrm{km\,s}^{-1}\,\,\mathrm{Mpc}^{-1}\) [32]. To do so, along with these data points, we plot the function \(H(z)/(1+z)\) versus z in Fig. 2 considering four different pair of values of the parameters \(\epsilon \) and \(H_0\) as mentioned in the legend of this figure, wherein we keep \(\Omega _\mathrm{m0}=0.31\) in all the cases (two of which correspond to the cases in Fig. 1). First, we notice that the Rastall-\(\Lambda \)CDM model (green curve, \(\epsilon =0.06\), \(H_0= 68\, \mathrm{km\,s}^{-1}\,\,\mathrm{Mpc}^{-1}\), which leads to \(z_*=2.4\)) does better than the GR-\(\Lambda \)CDM (red curve, \(\epsilon =0\), \(H_0= 68\, \mathrm{km\,s}^{-1}\,\,\mathrm{Mpc}^{-1}\)) to describe the lower-redshift BAO data (\(z=0.57\)), but the faster growth of \(H(z)/(1+z)\) at high redshifts leads to an increased tension of the Rastall-\(\Lambda \)CDM model with the high-redshift BAO Ly-\(\alpha \) data (\(z=2.34\)) compared to the standard \(\Lambda \)CDM model. This seems to suggest that negative values of \(\epsilon \) can help better representation of the high-redshift BAO Ly-\(\alpha \) data (\(z=2.34\)) in the Rastall-\(\Lambda \)CDM model, which of course implies compromise from the feature of screening the usual vacuum energy by the effective source at a finite redshift. For, we see that the Rastall-\(\Lambda \)CDM model (blue solid curve, \(\epsilon =-0.06\), \(H_0= 68\, \mathrm{km\,s}^{-1}\,\,\mathrm{Mpc}^{-1}\)) better represents the high-redshift BAO Ly-\(\alpha \) data (\(z=2.34\)) due to slow growth of \(H(z)/(1+z)\) at higher redshifts. But in this case, this model worsens in representing the lower-redshift BAO data (\(z=0.57\)) compared to the GR-\(\Lambda \)CDM model. However, surprisingly, if we use a larger \(H_0\) value as well, for instance, \(H_0= 70\, \mathrm{km\,s}^{-1}\,\,\mathrm{Mpc}^{-1}\) very close to the model independent TRGB \(H_0\) measurement, it turns out that the Rastall-\(\Lambda \)CDM model (blue dashed curve, \(\epsilon =-0.06\), \(H_0= 70\, \mathrm{km\,s}^{-1}\,\,\mathrm{Mpc}^{-1}\)) reconciles with all the three data points simultaneously. This makes negative \(\epsilon \) values promising with regard to addressing the so called \(H_0\) tension on top of a good description of the both BAO data (the standard \(\Lambda \)CDM model has known to be suffering from). However, most likely, it would lead to an inconsistency with the CMB data, as the values of \(\epsilon \) leading to a significant improvement in this direction would give rise to unacceptable amount of shifts in the values of \(z_\mathrm{eq}\) and \(k_\mathrm{eq}\). Indeed, \(\epsilon =-0.06\), that we have used just to develop an opinion, leads to the unacceptable values \(z_\mathrm{eq}=790\) and \(k_\mathrm{eq}\sim 0.025 \,\,\mathrm{Mpc}^{-1}\), which obviously signals spoiling of a successful description of the early Universe.

The lesson we learned in this section may be summarized as follows: Through this preliminary investigation, it is not possible to reach to a decisive conclusion whether the \(H_0\) and/or BAO data show tendency of \(\epsilon \) deviating from zero (GR) in a certain direction. Moreover, a significant improvement with regard to \(H_0\) and/or BAO data would most likely lead to spoiling of a successful description of the early Universe, which signals that CMB data would keep \(\epsilon \) values close to zero. Therefore, we expect only an insignificant deviation from the standard \(\Lambda \)CDM model when it is extended via the Rastall gravity. A conclusive answer, of course, cannot be given unless we rigorously confront the model with the observational data.

5 Linear perturbations

In this section, we derive the general form of the equations which describe small cosmological perturbations within the Rastall-\(\Lambda \)CDM model. We consider the perturbed RW metric, \(g_{\mu \nu }= g_{\mu \nu }^{(0)} + h_{\mu \nu }\), where \(g_{\mu \nu }^{(0)}\) indicates the background of the spatially flat RW metric (5) with a small fluctuation, \(h_{\mu \nu }\), and we choose the synchronous gauge (\(h_{\mu 0} = 0\)). The line element has the form

$$\begin{aligned} \begin{aligned} \mathrm{d}s^2= a(\eta )^2\left[ -\mathrm{d}\eta ^2+\left( \delta _{jk}+h_{jk}\right) \mathrm{d}x^{j}\mathrm{d}x^{k}\right] , \end{aligned} \end{aligned}$$
(29)

where \(x^{j}\), with \(j=(1,2,3)\), are the spatial components in Cartesian coordinates and \(\eta \) is the conformal time. The comoving coordinates are related to the proper time t and positions r by \(\mathrm{d}x^0=\mathrm{d}\eta =\frac{\mathrm{d}t}{a(\eta )}\), \(\mathrm{d}x=\frac{\mathrm{d}r}{a(\eta )}\). We introduce the perturbations as follows:

$$\begin{aligned} \rho _i = \rho _i^{(0)}+\delta \rho _i, \;\; p_{i}= p_{i}^{(0)}+\delta p_{i},\;\; u_{i}=u_{i}^{(0)}+\delta u_{i},\quad \;\; \end{aligned}$$
(30)

where the superscript (0) indicates the background functions and \(\delta \rho _{i}\), \(\delta u_{i}\) and \(\delta p_{i}\) are the perturbed quantities in energy density, four-velocity and pressure, respectively. We also introduce the following definitions:

$$\begin{aligned} \delta _{i} \equiv&\frac{\delta \rho _{i}}{\rho _{i}} \,,\quad c_{s,i}^2=\frac{\delta p_i}{\delta \rho _i} \,,\quad \theta \equiv&\partial _{k}\delta u^{k}\,, \quad h \equiv \frac{h^{k}{}_k}{a^{2}}, \end{aligned}$$
(31)

where \(c_{s,i}^2\) is adiabatic sound speed squared.

Within the formalism, the continuity equation reads

$$\begin{aligned} \begin{aligned}&\sum _i \Bigg [\delta '_{i}\left[ \frac{1+3\epsilon (1+w_i)}{1+4\epsilon }\right] +3\mathcal {H}\left( c_{s,i}^2-w_i\right) \delta _i\\&\quad +(1+w_i)\left( \theta _{i}+\frac{h'}{2}\right) \Bigg ]=0, \end{aligned} \end{aligned}$$
(32)

from the perturbations of the actual EMT conservation equation [see (4)] for \(\nu =0\). Here the prime denotes derivative with respect to \(\eta \) and \(\mathcal {H}=\frac{a'}{a}\). For \(\nu =i\), Euler equation reads:

$$\begin{aligned} \begin{aligned}&\sum _i \Bigg [\theta '_{i}+ \frac{1-3w_i}{1+3\epsilon (1+w_i)}\mathcal {H}\theta _{i}\\&\quad -\frac{k^2\delta _i}{(1+4\epsilon )(1+w_i)}\left[ \epsilon +(1+\epsilon )c_{s,i}^2\right] \Bigg ]=0. \end{aligned} \end{aligned}$$
(33)

The relativistic species remain unaltered in Rastall gravity both at the background and perturbative levels. Thus, the Boltzmann hierarchy for the relativistic relics follows the standard procedures as described in [112] (see also [113]). We suppose that the evolution of baryons (\(w_\mathrm{b}=c_{s,\mathrm b}^2=0\)) is not altered by the Rastall gravity but that of the cold dark matter (\(w_\mathrm{cdm}=c_{s,\mathrm cdm}^2=0\)), for which we modify the procedures given in [112, 113] accordingly [114]. And, the first order continuity and Euler equations from (32) and (33) read

$$\begin{aligned}&\delta '_\mathrm{cdm}\frac{1+3\epsilon }{1+4\epsilon }+\theta _\mathrm{cdm}+\frac{h'}{2}=0, \end{aligned}$$
(34)
$$\begin{aligned}&\theta '_\mathrm{cdm}+\frac{1}{1+3\epsilon }\mathcal {H}\theta _\mathrm{cdm}-\frac{\epsilon }{1+4\epsilon }k^2\delta _\mathrm{cdm}=0. \end{aligned}$$
(35)

6 Observational constraints

Considering the background and perturbation dynamics presented above, in what follows, we explore the full parameter space of the Rastall-\(\Lambda \)CDM model – namely, the Rastall gravity extension of the six-parameter base \(\Lambda \)CDM based on GR via the Rastall parameter \(\epsilon \) –, and, for comparison, that of the standard \(\Lambda \)CDM (GR-\(\Lambda \)CDM) model. The baseline seven free parameters set of the Rastall-\(\Lambda \)CDM model is, therefore:

$$\begin{aligned} \mathcal {P}= \Big \{ \omega _\mathrm{b}, \, \omega _\mathrm{cdm}, \, \theta _s, \, A_s, \, n_s, \, \tau _\mathrm{reio}, \, \epsilon \Big \}, \end{aligned}$$

where the first six parameters are the baseline parameters of the standard \(\Lambda \)CDM model, namely: \(\omega _\mathrm{b}\) and \(\omega _\mathrm{cdm}\) are respectively the dimensionless densities of baryons and cold dark matter; \(\theta _s\) is the ratio of the sound horizon to the angular diameter distance at decoupling; \(A_s\) and \(n_s\) are respectively the amplitude and spectral index of the primordial curvature perturbations, and \(\tau _\mathrm{reio}\) is the optical depth to reionization. The uniform priors used for the model parameters are \(\omega _b\in [0.018,0.024]\), \(\omega _\mathrm{cdm}\in [0.10,0.14]\), \(100\,\theta _{s}\in [1.03,1.05]\), \(\ln (10^{10}A_s)\in [3.0,3.18]\), \(n_s\in [0.9,1.1]\), \(\tau _\mathrm{reio}\in [0.04,0.125]\), and \(\epsilon \in [-0.04,0.04]\).

In order to constrain the models, we use the latest Planck CMB and BAO data: we use the recently released full Planck-2018 [5] CMB temperature and polarization data which comprise of the low-l temperature and polarization likelihoods at \(l \le 29\), temperature (TT) at \(l \ge 30\), polarization (EE) power spectra, and cross correlation of temperature and polarization (TE). The Planck-2018 CMB lensing power spectrum likelihood [119] is also included. Along with the Planck CMB data, we consider the measurements of BAO provided by the distribution of galaxies in galaxy-redshift surveys. We use BAO distance measurements probed by (i) Six Degree Field Galaxy Survey (6dFGS) at effective redshift \(z_\mathrm{eff} = 0.106\) [120], (ii) the Main Galaxy Sample of Data Release 7 of Sloan Digital Sky Survey (SDSS-MGS) at effective redshift \(z_\mathrm{eff} = 0.15\) [121], (iii) the LOWZ and CMASS galaxy samples of Data Release 11 (DR11) of the Baryon Oscillation Spectroscopic Survey (BOSS) LOWZ and BOSS-CMASS at effective redshifts \(z_\mathrm{eff} = 0.32\) and \(z_\mathrm{eff} = 0.57\), respectively [111], (iv) correlation of Lyman-\(\alpha \) forest absorption and quasars at \(z_\mathrm{eff} = 2.35\) obtained in SDSS DR14 [122]. Also, we use the measurement obtained in [123], where the BAO scale is measured at \(z_\mathrm{eff} =2.34\).

Table 1 Constraints (68% and 95% CLs) on the free and some derived parameters of the Rastall-\(\Lambda \)CDM and GR-\(\Lambda \)CDM models for CMB and CMB+BAO data. The parameter \(H_\mathrm{0}\) is measured in the units of km s\({}^{-1}\)   Mpc\({}^{-1}\). The entries in blue color represent the constraints on the corresponding GR-\(\Lambda \)CDM parameters
Fig. 3
figure 3

One-dimensional marginalized distributions of the free and some derived parameters of the Rastall-\(\Lambda \)CDM and GR-\(\Lambda \)CDM models

We have implemented the model in publicly available CLASS [113] code, and used the Multinest [124] algorithm in the parameter inference Monte Python [125] code with uniform priors on the model parameters to obtain correlated Monte Carlo Markov Chain samples and Bayesian evidence. Further, we have used the GetDist Python package to analyze the samples. We obtain the observational constraints on all the Rastall-\(\Lambda \)CDM model parameters by using first only the CMB data and then the combined CMB+BAO data. For comparison purposes, we also show the constraints on the GR-\(\Lambda \)CDM model parameters. The CMB data set alone is known to well constrain the six baseline parameters of the GR-\(\Lambda \)CDM model. The Rastall-\(\Lambda \)CDM model carries an additional parameter, namely \(\epsilon \). Therefore, we also combine the BAO data with CMB in order to obtain possibly tighter constraints on the Rastall-\(\Lambda \)CDM model parameters, and also to break any possible degeneracy of the new parameter \(\epsilon \) with the other baseline parameters.

Fig. 4
figure 4

Two-dimensional (68% and 95% CLs) marginalized distributions of the free and some derived parameters of the Rastall-\(\Lambda \)CDM and GR-\(\Lambda \)CDM

Fig. 5
figure 5

Two-dimensional (68% and 95% CLs) marginalized distributions of \(\epsilon \) with the other baseline parameters of the Rastall-\(\Lambda \)CDM model

Table 1 displays the constraints, at 68% and 95% confidence levels (CLs), on the baseline seven free parameters and some derived parameters of the Rastall-\(\Lambda \)CDM model and, for comparison, on those of the GR-\(\Lambda \)CDM model, both from the CMB and combined CMB+BAO data sets. For these constraints presented for both models in the same table, Fig. 3 shows the one-dimensional marginalized distributions and Fig. 4 shows the two-dimensional (68% and 95% CLs) marginalized distributions of the derived parameters with regard to the baseline free parameters. From all these, we immediately notice that, as it is the case for the GR-\(\Lambda \)CDM model as well, the CMB+BAO data set puts tight constraints on the parameters of the Rastall-\(\Lambda \)CDM model, when compared to the constraints put by CMB data set alone. On the other hand, in contrast to the GR-\(\Lambda \)CDM model, when the BAO data set is not included, we notice larger error bounds (loose constraints) on some of the Rastall-\(\Lambda \)CDM model parameters, for instance, the error bounds of \(\omega _\mathrm{cdm}\) and the derived parameters are larger in the Rastall-\(\Lambda \)CDM model compared to the GR-\(\Lambda \)CDM model, as a consequence of the deviation of the Rastall parameter \(\epsilon \) from zero. It turns out that the parameter of our main concern, the Rastall parameter \(\epsilon \) measuring the deviation from GR, is constrained as

$$\begin{aligned} \begin{aligned} \epsilon&=-0.0010\pm 0.0008\pm 0.0015 \quad \text {from CMB,}\\ \epsilon&=0.0003\pm 0.0004\pm 0.0008 \quad \text {from CMB+BAO}, \end{aligned} \end{aligned}$$

at 68% and 95% CLs. The constraints from the CMB data as well as the combined CMB+BAO data set suggest that, in line with our conclusion reached via a preliminary investigation in Sect. 4, the Rastall parameter \(\epsilon \) is well consistent with zero at 95% CL, which in turn implies that there is no significant statistical evidence for deviation from GR via Rastall gravity. We note however that, as may be seen from the probability regions and mean values of \(\epsilon \), the Rastall parameter prefers negative values in the case of CMB data while positive values when BAO data set is included (CMB+BAO data). Further, although they are mostly minor, the Rastall gravity extension of the standard \(\Lambda \)CDM has some consequences on the cosmological parameters, which deserve further discussion that could be informative about the features of the Rastall gravity and/or whether it is a promising modified gravity theory or not.

In Fig. 5, we present the two-dimensional (68% and 95% CLs) marginalized distributions that show how the six of the baseline parameters of the GR-\(\Lambda \)CDM model are affected by the Rastall gravity extension, i.e., \(\epsilon \). We observe that \(\epsilon \) is negatively correlated with \(\omega _\mathrm{cdm}\) and \(\omega _\mathrm{b}\) for both the CMB data and the combined CMB+BAO data sets. Other four parameters, \(\theta _s\), \(A_s\), \(n_s\) and \(\tau _\mathrm{reio }\) seem to have minor positive correlations with \(\epsilon \) in the case of CMB data but no correlation in the case of CMB+BAO data. Accordingly, in Table 1 and Fig. 3, one may notice the shifts in the mean values and one dimensional probability distributions of different parameters. Also, see Fig. 4 for the consequences of the Rastall gravity extension, i.e., \(\epsilon \), via the two-dimensional marginalized distributions of the derived parameters with regard to the baseline free parameters. The last column of the same figure is of particular interest as it displays the two-dimensional marginalized distributions of the derived parameters with regard to the constraints on the Rastall parameter \(\epsilon \). We notice that smaller values of \(\epsilon \) lead to larger values of the present-day density parameter of matter \(\Omega _\mathrm{m0}\) because of the negative correlation between these two parameters. It is in line with (12) which suggests that matter energy density dilutes less efficiently with time in a universe with negative values of \(\epsilon \), and thereby leading to larger matter density parameter in the present-day Universe. Accordingly, in the case of CMB data, where \(\epsilon \) has higher probability to lie in the negative range, we see higher values of \(\Omega _\mathrm{m0}\) in the Rastall-\(\Lambda \)CDM when compared to the GR-\(\Lambda \)CDM. Namely, the CMB data set predicts \(\Omega _\mathrm{m0}=0.347^{+ 0.024}_{-0.027}\) for the Rastall-\(\Lambda \)CDM model, while \(\Omega _\mathrm{m0}=0.316^{+0.007}_{-0.007}\) for the GR-\(\Lambda \)CDM. On the other hand, the combined CMB+BAO data set prefers larger probability region of \(\epsilon \) in the positive range, and thereby it predicts smaller values of \(\Omega _\mathrm{m0}\) in the Rastall-\(\Lambda \)CDM when compared to the GR-\(\Lambda \)CDM. For, the combined CMB+BAO data set predicts \(\Omega _\mathrm{m0}=0.304^{+ 0.009}_{-0.009}\) for the Rastall-\(\Lambda \)CDM model, while \(\Omega _\mathrm{m0}=0.308^{+0.006}_{-0.006}\) for the GR-\(\Lambda \)CDM model, see Table 1. We notice a positive correlation between the present-day density parameter of the usual vacuum energy and the Rastall parameter for the both data sets. The CMB (CMB+BAO) data set favors smaller (larger) values of the density parameter of the usual vacuum energy density, viz., \(\Omega _\mathrm{vac0}=0.650^{+0.029}_{-0.026}\) (\(\Omega _\mathrm{vac0}=0.697^{+0.010}_{-0.010}\)) for the Rastall-\(\Lambda \)CDM while \(\Omega _\mathrm{vac0}=0.684^{+0.007}_{-0.007}\) (\(\Omega _\mathrm{vac0}=0.692^{+0.006}_{-0.006}\)) for the GR-\(\Lambda \)CDM. This reduced (enhanced) amount of the usual vacuum energy density parameter is however compensated just slightly by that of the effective source (which behaves like a cosmological constant at \(z\sim 0\)) as the CMB (CMB+BAO) data set favors its positive (negative) values owing to the almost perfect negative correlation between its present-day density parameter \(\Omega _\mathrm{X0}\) and the Rastall parameter \(\epsilon \). Namely, the constraint on total present-day density parameter of those of the usual vacuum energy and the effective source reads \(\Omega _\mathrm{vac0}+\Omega _\mathrm{X0}=0.653^{+0.027}_{-0.024}\) (68% CL) from the CMB data set, and \(\Omega _\mathrm{vac0}+\Omega _\mathrm{X0}=0.696\pm 0.009\) (68% CL) from the combined CMB+BAO data set. Figure 6 displays the two-dimensional posterior distributions of \(\{\Omega _\mathrm{m0},\Omega _\mathrm{vac0}\}\) colour coded by the \(\Omega _\mathrm{X0}\), at 68% and 95% CLs for the combined CMB+BAO data set. Here, we notice that the posterior distribution sample points of \(\Omega _\mathrm{X0}\) (and the corresponding contours for 68% and 95% CLs) pretty much cluster around a line that deviates from the GR-\(\Lambda \)CDM line \(\Omega _\mathrm{m0}+\Omega _\mathrm{vac0}=1\), due to the presence of \(\Omega _\mathrm{X0}\).

Fig. 6
figure 6

Two-dimensional posterior distributions of \(\{\Omega _\mathrm{m0}, \Omega _\mathrm{vac0}\}\) colour coded by \(\Omega _\mathrm{X0}\) with CMB+BAO data. The line across the contours is given by \(\Omega _\mathrm{m0}+\Omega _\mathrm{vac0}=1\)

We note that while the CMB data set by alone favors positive energy density values for the effective source \(\rho _\mathrm{X}\) accompanying to the actual energy sources due to the Rastall gravity extension, the CMB+BAO data set including BAO data (relatively low-redshift data compared to the CMB data set) favors negative energy density values for it, namely, \(\Omega _\mathrm{X0}=0.0030\pm 0.0023\) (68% CL) from the CMB data set, and \(\Omega _\mathrm{X0}=-0.0010\pm 0.0013\) (68% CL) from the combined CMB+BAO data set. This shows that, when the BAO data set is included, the effective source \(\rho _\mathrm{X}\) indeed screens the usual vacuum energy at finite redshift and that the Rastall gravity may be counted among the cosmological models [31,32,33,34,35,36,37,38,39,40,41,42,43,44] that were suggested for alleviating a number of persistent low-redshift tensions, including the \(H_0\) tension, by a dynamical DE that assumes negative energy density values (or by a mechanism dynamically screening the cosmological constant) at finite redshift. In Fig. 7, in order to visualize the screening mechanism, we show the evolution of the total energy density of the effective source plus the usual vacuum energy (scaled to the present-day critical energy density), \((\rho _\mathrm{X}+\rho _\mathrm{vac})/\rho _\mathrm{c0}\), versus the redshift with probability regions up to 95% CL (the darker the more probable), using the fgivenx python package [126]. We see that the effective source completely screens the usual vacuum energy, \(\rho _\mathrm{X}+\rho _\mathrm{vac}=0\), at a redshift \(z_*> 13.65\) (68% CL) and \(z_*> 11.68\) (95% CL). However, these are too large compared to the \(z_*\) values suggested in, e.g., Refs. [33, 34, 42]. This might be signaling that this mechanism does not work efficiently enough in the Rastall-\(\Lambda \)CDM model. For instance, we indeed observe almost a perfect positive correlation between \(H_0\) and \(\epsilon \), which implies that larger values of \(\epsilon \) would correspond to larger values of \(H_0\). We see in Table 1 that, in comparison to the GR-\(\Lambda \)CDM model, the combined CMB+BAO data set favors a slightly larger mean value for \(H_0\) in the Rastall-\(\Lambda \)CDM model, which seems to be an improvement for a better agreement with, e.g., the model independent \(H_0\) values measured from the distance ladder measurements (e.g., \(H_0= 69.8\pm 0.8\) from a recent calibration of the TRGB applied to Type Ia supernovae [26]), see Figs. 8 and 9. However, a more careful look reveals that this improvement is not robust. The combined CMB+BAO data set predicts \(H_0=68.31^{+ 0.76+1.50}_{-0.76-1.50}\,\mathrm{km\,s}^{-1}\,\,\mathrm{Mpc}^{-1}\) for the Rastall-\(\Lambda \)CDM model, while \(H_0=67.92^{+0.43+0.83}_{-0.43-0.82}\,\mathrm{km\,s}^{-1}\,\,\mathrm{Mpc}^{-1}\) for the GR-\(\Lambda \)CDM model. We note that, in contrast to the GR-\(\Lambda \)CDM model, \(H_0\) in the case of the Rastall-\(\Lambda \)CDM model, even at \(68\%\) CL, agrees with the TRGB \(H_0\) value. This may be found promising, but, this is because of the large widening in the one-dimensional marginalized probability distribution of \(H_0\), viz., largely increased errors, while a minor shift to the larger mean value of \(H_0\). This shows that the Rastall-\(\Lambda \)CDM model offers a relaxation to the so called \(H_0\) tension prevailing within the GR-\(\Lambda \)CDM model, though not robustly. In Fig. 9, we plot \(H(z)/(1+z)\) to display the situation with respect to TRGB \(H_0\) and BAO data by considering the constraints from the combined CMB+BAO data. We see only a slightly better representation of the three data points by the Rastall-\(\Lambda \)CDM model.

Fig. 7
figure 7

Plot of \((\rho _\mathrm{X}+\rho _\mathrm{vac})/\rho _\mathrm{c0}\) vs z with 68% and 95% error regions in the case of CMB+BAO data

Fig. 8
figure 8

Two-dimensional (68% and 95% CLs) marginalized distributions of \(H_0\) versus \(\Omega _\mathrm{X0}\) for the Rastall-\(\Lambda \)CDM model. The horizontal blue band is for the model independent TRGB \(H_0\) measurement \(H_0= 69.8 \pm 0.8\, \mathrm{km\,s}^{-1}\,\,\mathrm{Mpc}^{-1}\) [26]

It seems that, as we have discussed in Sect. 4, the screening mechanism provided via the effective source due to the Rastall gravity when \(\epsilon >0\) does not work efficiently as the altered redshift dependence of dust (due to the violation of the local energy-momentum conservation) opposes that by keeping \(\epsilon \) close to zero, and the CMB data set (as well as the Ly-\(\alpha \) data, see the discussion in Sect. 4) tends \(\epsilon \) towards negative values. Next, we observe that both data sets lead to a positive correlation of \(\epsilon \) with \(\sigma _8\), similar to \(H_0\). Therefore, the larger (smaller) values of \(\epsilon \) would correspond to larger (smaller) values of both \(H_0\) and \(\sigma _8\), which in turn implies that both the so called \(H_0\)- and \(\sigma _8\)-tensions prevailing within the GR-\(\Lambda \)CDM model cannot be relaxed together in the Rastall-\(\Lambda \)CDM model (see, e.g., [107] achieving a simultaneous relaxation of the two tensions by a non-minimal interaction in the dark sector).

Fig. 9
figure 9

\(H(z)/(1+z)\) vs z with 68% and 95% error regions in the case of CMB+BAO data. Here, the red curve stands for the GR-\(\Lambda \)CDM model corresponding to the mean values of the parameters. The three error bars stand for \(H_0= 69.8 \pm 0.8\, \mathrm{km\,s}^{-1}\,\,\mathrm{Mpc}^{-1}\) from the TRGB \(H_0\) [26], \(H(z=0.57) = 97.9 \pm 3.4\,\mathrm{km\,s}^{-1}\,\,\mathrm{Mpc}^{-1}\) [111], and \(H(z=2.34) = 222.4 \pm 5.0\,\mathrm{km\,s}^{-1}\,\,\mathrm{Mpc}^{-1}\) from the latest BAO data [32]

Finally, we have a look at the situation of the wavenumber of a mode that enters the horizon at the radiation-matter transition, \(k_\mathrm{eq}\), which is a highly sensitive parameter to the modifications to GR, and related to the dynamics of the Universe at a redshift larger than the redshifts related to the CMB data. In the case of the Rastall-\(\Lambda \)CDM model, we find the constraints \( k_\mathrm{eq}=0.010427\pm 0.000078\,\,\mathrm{Mpc}^{-1}\) from CMB data, and \(k_\mathrm{eq}=0.010406\pm 0.000081\,\,\mathrm{Mpc}^{-1}\) from CMB+BAO data. On the other hand, for the GR-\(\Lambda \)CDM model, CMB data provide \(k_\mathrm{eq}=0.010448\pm 0.000081\,\,\mathrm{Mpc}^{-1}\), and the CMB+BAO data provide \(k_\mathrm{eq}=0.010354\pm 0.000068\,\,\mathrm{Mpc}^{-1}\). Figure 10 shows one dimensional marginalized distributions of \(k_\mathrm{eq}\) in the four cases. We notice that \(k_\mathrm{eq}\) probability curves of the Rastall-\(\Lambda \)CDM model are bit together but we see a larger shift among the ones for the GR-\(\Lambda \)CDM model when compared to the Rastall-\(\Lambda \)CDM model. Though this shift is not significant, but may be signaling a better consistency of the Rastall-\(\Lambda \)CDM model with both the data sets in comparison to the GR-\(\Lambda \)CDM model.

Fig. 10
figure 10

One-dimensional marginalized distribution of \(k_\mathrm{eq}\) for the Rastall-\(\Lambda \)CDM and GR-\(\Lambda \)CDM models

For a better understanding of the results we obtained for the Rastall-\(\Lambda \)CDM model, it may be useful to elucidate the reason behind the fact that the CMB data (CMB+BAO data) favor smaller (larger) \(H_0\) values compared to the GR-\(\Lambda \)CDM model. As mentioned in the introduction, the constraint on \(H_0\) from CMB data depends on the angular scale on the sky, \(\theta _{\star } = r_{\star }/D_\mathrm{M}\), where \(r_{\star }=\int ^{\infty }_{z_{\star }}c_sH^{-1}\mathrm{d}z\) is the comoving sound horizon at recombination – determined by the pre-recombination (\(z>z_{\star }\)) physics – and \(D_\mathrm{M}=\int _0^{z_{\star }}H^{-1}\mathrm{d}z\) is the comoving angular diameter distance at recombination – determined by the post-recombination (\(z<z_{\star }\)) evolution of H(z) [48]. We notice that none of the terms in (19) scale faster than the radiation (within the allowed region for \(\epsilon \) by the observations, see Table 1 for the constraints) and \(k_\mathrm{eq}\) is almost the same in both models – whether the constraints from the CMB data or the combined CMB+BAO are considered –, which in turn imply almost the same \(r_{\star }\) value in all cases as the pre-combination physics/dynamics does not differ in any case – recall that the radiation dominated Universe solutions do not differ in the Rastall gravity and GR. Also, Planck satellite measures \(\theta _{\star }\) (cf. \(\theta _\mathrm{s}\), see Table 1 for constraints) very robustly and almost independently of the cosmological model with a high precision. Therefore, \(D_\mathrm{M}\) must be almost the same in all cases. Now, we notice that the CMB data by alone favor slightly negative values of \(\epsilon \) accompanied by an enhancement in \(\omega _\mathrm{cdm}\), which then result in an enhancement in \(\Omega _\mathrm{m0}\) and positive \(\Omega _\mathrm{X0}\), see, e.g. Fig. 3. One may check that, in comparison to the GR-\(\Lambda \)CDM when the constraints on the parameters given in Table 1 are considered, despite the fact that the slightly negative mean value of \(\epsilon \) leads the dust-like contributions in H(z) [see (19)] to scale slightly slower than the usual \((1+z)^3\) dependence, the enhanced \(\Omega _\mathrm{m0}\) value and the positivity of \(\Omega _\mathrm{X0}\) – i.e., reduced \(\Omega _\mathrm{vac0}\) – lead H(z) to grow faster for \(z<z_{\star }\) and become larger for the interval \(0\lesssim z<z_{\star }\). The compensation of this enhanced H(z) in the interval \(0\lesssim z<z_{\star }\) in turn implies a diminished H(z) for \(z\sim 0\) – a smaller \(H_0\) as well – to keep \(D_\mathrm{M}\) (almost) unaltered. This situation leads to a strong correlation between \(H_0\) and \(\epsilon \), which can be seen in Fig. 4. The inclusion of the BAO data, in addition to the CMB data, in our analyses not only decreases the errors on \(\epsilon \) but also brings its mean value to a value just slightly larger than zero, which in turn yields smaller errors on \(H_0\) and its slightly larger mean value than the one predicted within the GR-\(\Lambda \)CDM model, though it is not significant enough to relax the so-called \(H_0\) problem (see Table 1, and Figs. 3 and 8).

In the case of CMB data, we notice larger error regions of all the six baseline parameters (except \(\theta _s\), \(A_s\) and \(\tau _\mathrm{reio }\)) and other derived parameters in the Rastall-\(\Lambda \)CDM model when compared to the GR-\(\Lambda \)CDM model. Indeed, the additional parameter \(\epsilon \) in the Rastall-\(\Lambda \)CDM model penalizes the statistical fit of this model to the data when compared to the GR-\(\Lambda \)CDM model. However, inclusion of BAO data, that is, CMB+BAO data put tight constraints on all the model parameters, and thereby reduce the error regions of the parameters considerably in both the models. In the following section, we calculate Bayesian evidences of the two models, and thereby do a comparison of the statistical fit.

Table 2 Bayesian evidences of the Rastall-\(\Lambda \)CDM and GR-\(\Lambda \)CDM models, where \(\ln \mathcal {E}_\mathrm{Rastall, \mathrm GR}=\ln \mathcal {E}_\mathrm{Rastall}-\ln \mathcal {E}_\mathrm{GR}\)

7 Bayesian evidence of the fit

For comparing statistical fit of the models under consideration in this work to the observational data, we use Bayesian evidence. In this regard Bayes’ theorem reads

$$\begin{aligned} P(\Theta |D, \mathcal {M}) = \frac{\mathcal {L}(D|\Theta , \mathcal {M}) \pi (\Theta |\mathcal {M})}{\mathcal {E}(D|\mathcal {M})}, \end{aligned}$$
(36)

for a given model \(\mathcal {M}\) with the set of parameters \(\Theta \) and the cosmological data D. Here, \(P(\Theta |D, \mathcal {M})\) is the posterior distribution of the parameters \(\Theta \); \(\mathcal {L}(D|\Theta , \mathcal {M})\) is the likelihood function; \(\pi (\Theta |\mathcal {M})\) is the prior probability of the model parameters, and \(\mathcal {E}(D|\mathcal {M})\) is the Bayesian evidence calculated as

$$\begin{aligned} \mathcal {E}(D|\mathcal {M}) = \int _\mathcal {M} \mathcal {L}(D|\Theta , \mathcal {M}) \pi (\Theta |\mathcal {M}) \text {d}\Theta . \end{aligned}$$
(37)

Further, we compute the ratio of the posterior probabilities for a model \(\mathcal {M}_a\) with respect to a reference model \(\mathcal {M}_b\) as

$$\begin{aligned} \frac{P(\mathcal {M}_a|D)}{P(\mathcal {M}_b|D)} = B_{ab}\frac{P(\mathcal {M}_a)}{P(\mathcal {M}_b)}, \end{aligned}$$
(38)

where \(B_{ab}\) is the Bayes’ factor, evaluated as

$$\begin{aligned} B_{ab} = \frac{\mathcal {E}_a}{\mathcal {E}_b}. \end{aligned}$$
(39)

The Jeffreys’ scale [127] is used to interpret the Bayes’ factor by calculating \(|\ln B_{ab}|\). The value of \(|\ln B_{ab}|\) lying in the range [0,1) implies the strength of the evidence to be weak or inconclusive, while a definite or positive evidence is implied by the values in the range [1,3). Further, the strength of the evidence is strong for \(|\ln B_{ab}|\) lying in [3,5), and is the strongest for \(|\ln B_{ab}|\) greater than 5. Table 2 displays the Bayesian evidence of Rastall-\(\Lambda \)CDM in comparison with the GR-\(\Lambda \)CDM model in the case of CMB and CMB+BAO data, where \(\mathcal {E}_\mathrm{Rastall}\) and \(\mathcal {E}_\mathrm{GR}\), respectively stand for the Bayesian evidences of the Rastall-\(\Lambda \)CDM and GR-\(\Lambda \)CDM models. We observe a definite evidence (\(|\ln \mathcal {E}_\mathrm{Rastall, \mathrm GR}|\in [1,3)\)) in the case of CMB data, whereas weak evidence (\(|\ln \mathcal {E}_\mathrm{Rastall, \mathrm GR}|\in [0,1)\)) is observed in the case of the CMB+BAO data. Thus, the GR-\(\Lambda \)CDM model finds a better fit to the CMB data in comparison to the Rastall-\(\Lambda \)CDM model, but the weak evidence in the case of the combined CMB+BAO data, suggests that both the models fit equally well to the CMB+BAO data, as expected.

8 Conclusions

We have constructed the extension of the standard \(\Lambda \)CDM model (GR-\(\Lambda \)CDM) by switching the gravity theory from GR to the Rastall gravity (Rastall-\(\Lambda \)CDM), see Sect. 2. We then have reviewed it – via a preliminary investigation of its features for a demonstration of how it works, and a guide to the values of its parameters – in a proper manner, namely, in a manner clearly identifying and handling the two simultaneous modifications of different nature in the material content side of the Einstein field equations of GR, see Sects. 2, and 4. It has then turned out that it is not possible to reach a decisive conclusion only through a preliminary investigation, for instance, whether the \(H_0\) and/or BAO data show tendency of \(\epsilon \) deviating from zero (GR) in a certain direction. Further, we also have learned that a significant improvement with regard to \(H_0\) and/or BAO data would most likely lead to spoiling of a successful description of the early Universe, which signals that CMB data would keep \(\epsilon \) values close to zero. These inspections have led us to expect only an insignificant deviation from the standard \(\Lambda \)CDM model when it is extended from GR via the Rastall gravity, and persuaded us that a conclusive answer cannot be given unless the model is rigorously confronted/constrained with the observational data.

Considering the background and perturbation dynamics (Sect. 5), we have explored the full parameter space of the Rastall-\(\Lambda \)CDM model – viz., the Rastall gravity extension of the six-parameter base GR-\(\Lambda \)CDM described by the additional parameter \(\epsilon \) – using the latest CMB data set as well as the latest combined CMB+BAO data set, see Sect. 6. Also, for comparison, we have presented the corresponding constraints/results on the GR-\(\Lambda \)CDM model. It turned out that, as it is the case for the GR-\(\Lambda \)CDM model as well, the CMB+BAO data set puts tight constraints on the parameters of the Rastall-\(\Lambda \)CDM model and that, in contrast to the case for the GR-\(\Lambda \)CDM model, the CMB data set by alone puts loose constraints (larger error bounds) on some of the Rastall-\(\Lambda \)CDM model parameters – particularly, on the dimensionless density of cold dark matter \(\omega _\mathrm{cdm}\) and all of the derived parameters – as a consequence of a wider range of deviation of the Rastall parameter \(\epsilon \) from zero. Yet, both analyses suggest that, in line with our conclusion reached via a preliminary investigation in Sect. 4, the Rastall parameter \(\epsilon \) is well consistent with zero at 95% CL, which in turn implies that there is no significant statistical evidence for deviation from GR via the Rastall gravity. We note however that, as may be seen from the probability regions and mean values of \(\epsilon \), the Rastall parameter prefers negative values in the case of CMB data while positive values when BAO data set is included (CMB+BAO data). Despite the fact that they are basically minor within the allowed small range of the Rastall parameter from the data, we have explored the consequences of/tendencies led by the Rastall gravity on the cosmological parameters in the light of the observational analyses. Our results can be a guide for the research community that studies the Rastall gravity in various aspects of gravitation and cosmology, where, in general, as we have found in this work that the Rastall parameter cannot be out of the range \(-0.0001< \epsilon < 0.0007\) at 68% CL. Being that range an observational boundary imposed from high precision full CMB data set along with the BAO data set, it, in principle, must be obeyed as a new bound in any qualitative study within this modified theory of gravity. Finally – in support of our conclusions here – comparing statistical fit of these two models to the observational data by using Bayesian evidence, the GR-\(\Lambda \)CDM model finds a better fit to the CMB data in comparison to the Rastall-\(\Lambda \)CDM model, but the weak evidence in the case of the combined CMB+BAO data, suggests that both the models fit equally well to the CMB+BAO data.

It also is worth mentioning as one of our conclusions that, if we assume that the standard physical ingredients of the Universe considered here are the true physical ingredients of the actual Universe, our finding that the term \(g_{\mu \nu }R\) contributes to the Einstein field equations (1) with a coefficient in the range \((-0.5001,-0.4993)\) from the combined CMB+BAO data at 68% CL, i.e., a coefficient equal to \(-1/2\) with a precision of \(\mathcal {O}(10^{-4})\), can be taken as another new demonstration of the power of general relativity (which guarantees the local conservation of the total energy-momentum tensor relying on the twice-contracted Bianchi identity).

On the other hand, the Rastall gravity, in fact, possesses interesting features that could be of interest in the context of cosmology, for instance, to address some of the tensions prevailing within the standard \(\Lambda \)CDM model based on GR. One particular example may be that, for positive values of \(\epsilon \), the effective source arising due to the Rastall gravity assumes negative energy density values and screens the usual vacuum energy in line with Refs. [31,32,33,34,35,36,37,38,39,40,41,42,43,44], which suggest such a scenario for alleviating a number of persistent low-redshift tensions, including the so called Hubble constant \(H_0\) tension (deficiency). Indeed, our observational analyses show an almost perfect positive correlation between \(H_0\) and \(\epsilon \), which implies that larger values of \(\epsilon \) would correspond to larger values of \(H_0\). And, as the combined CMB+BAO data set favors slightly positive values of \(\epsilon \), this feature of the model works in the right direction and leads to predictions of larger \(H_0\) values (compared to the GR-\(\Lambda \)CDM model) consistent with, for instance, the model independent TRGB \(H_0\) measurements. However, a more careful look revealed that this improvement is not robust as it arises from the large widening in the one-dimensional marginalized probability distribution of \(H_0\), viz., largely increased errors, while a minor shift to the larger mean value of \(H_0\). We remind that the effective source comes along with a modification in the energy density redshift dependence of the actual matter source (viz., CDM) due to the EMT non-conservation feature of the Rastall gravity. Such a modification would obviously be more and more effective on the dynamics of the Universe with the increasing redshift. Therefore, in the case of the combined CMB+BAO data, it is conceivable that the high redshift data (viz., the CMB data relevant to \(z\sim 1100\)), in particular, tend to keep the redshift dependence of the actual matter source very close to its usual \((1+z)^3\) dependence, i.e, \(\epsilon \) values almost equal to zero, and then does not allow the Rastall gravity to successfully realize a scenario wherein the usual vacuum energy is dynamically screened by the effective source. The lesson we learned from this is that, as we have seen the first signs in this direction in our preliminary investigations of the Rastall-\(\Lambda \)CDM model, the two simultaneous modifications of different nature in the material content side of the standard Einstein field equations, arising from the relaxation of the contribution of the term \(g_{\mu \nu }R\) on the spacetime geometry side, act against each other. And, through a further modification of the Rastall gravity, it could probably be possible to reach a new modified theory of gravity which is relaxed from such a dichotomy between the two simultaneous modifications of different nature in the material content side of the standard Einstein field equations arising from a modification in the spacetime geometry side. We find this result important as such situations may exist in some other similar type of modified gravity theories.