1 Introduction

The theoretical explanation of the ongoing accelerated expansion of the universe [1,2,3,4,5,6] is one of the most unsolved cosmological problems. Achieving accelerated expansion by adding a constant to Einstein-Hilbert(E-H) action suffers from fine-tuning problem [7]. There are many ways to explain the accelerated epoch of the current universe. In this context modified gravity theories have been developed by modifying the E-H action, for example, F(R) theories of gravity [8,9,10,11,12,13,14,15,16]. In recent times another class of most popular modified gravity theories is nonlocal gravity models [17,18,19,20]. These models are motivated by Einstein action’s ultraviolet (UV) and infrared (IR) corrections. They also provide a theoretical explanation of the accelerated expansion of the current universe. Some salient features of nonlocal gravity models are: (1) they can be employed to study cosmology in both the infrared and the ultraviolet, (2) valid cosmological perturbation theory, and (3) the resulting cosmology has good agreement with most observations.

In this direction, the nonlocal terms with Ricci scalar R and F(R) are extensively studied along with Einstein Hilbert action. These terms involve analytic transcendental functions of the covariant d’Alembert operator \(\Box \). Initially, as developed by Wetterich, models with correction terms like \( R\Box ^{-1}R \) are shown to be effective IR corrected nonlocal gravity model [21]. Further, Deser and Woodard [22] introduce a general form as\( Rf(\frac{1}{\Box }R) \) which can be responsible for the late-time cosmic expansion of the universe. In this line, for a recent review on this topic, refer to [23].

The nonlocal theory can have an equivalent scalar-tensor form by introducing auxiliary variables. Higher derivative terms with d’Alembertian operator and curvature can be considered higher derivative field theories. According to Ostrogradsky theorem [24], non-degenerate higher derivative Lagrangians are cursed with instabilities (popularly known Ostrogradsky instabilities). Generally, these instabilities are easy to identify by linear momentum terms within the Hamiltonian, which make it unbounded above and below depending on the structure [25]. However degenerate theories [26,27,28,29,30,31,32,33,34,35](for review, refer to [36, 37]) in this regard is free from these instabilities by reducing the phase space non trivially [38]

In order to check the appearance of Ostrogradsky instability in any higher derivative theory, a Hamiltonian analysis would be required. The Hamiltonian analysis of these types of theories can be performed by the Dirac method of constraint system [39,40,41,42,43]. The Hamiltonian analysis of the nonlocal model with inverse powers of d’Alembertian operators acting only on Ricci scalar is performed in [44]. A more general analysis of constructing Hamiltonian in this context from a modern perspective is done in [45] including terms with inverse d’Alembertian operators acting on Riemann tensor, Ricci tensor, and Ricci scalar.

In this work, we extend the analysis of Ref. [45] for a non local F(R) gravity models. Earlier works in this line can be found in [46, 47]. Authors of Ref. [46] consider a class of nonlocal gravity in which the Lagrangian is a general function of \(\Box ^{-1}R\) and derive the condition for the appearance of ghost fields by considering the kinetic term of the localized Lagrangian. In another Ref. [47], they have found the condition for the nonexistence of ghost degrees of freedom in nonlocal F(R) gravity. Here the ghosts are usually identified through the kinetic matrix of the Lagrangian with a negative determinant, and after appropriate modification in the Lagrangian, ghost-free condition can be obtained. Application of this model to cosmology has also been carried out in Ref. [47].

This work tries to shed some light on the results obtained in [46, 47] from the Hamiltonian point of view. Here we construct the Hamiltonian for the localized action and identify the linear momenta term in the Hamiltonian, which is usually responsible for the appearance of Ostrogradsky ghosts in any higher derivative theory. Then we show that by putting an appropriate condition in the structure of constraints, we can get rid of these ghosts analogous to the approach followed in [46, 47] by analyzing the kinetic term of the Lagrangian. For deriving Hamiltonian, first, we separate both spatial and time derivative terms in Lagrangian in terms of ADM variables, similar to the analysis done in [44, 45]. Then we identify several constraints of our theory, which eventually lead us to count the number of ghost degrees of freedom.

This paper has many sections. In Sect. 2, ADM formalism is reviewed. In Sect. 3, we formulate the Hamiltonian for the F(R) nonlocal model and shed light on conditions that can give ghost-free theories. In Sect. 4, we perform Hamiltonian formalism for a general action of \(\Box ^{-1}R\); we study the ghost structure from the Hamiltonian analysis. Finally, we summarise our results in Sect. 5.

2 ADM formalism

In this section, we review the 3 + 1 formalism’s basic features in order to formulate the Hamiltonian analysis of the purposed theory. Space time is characterized by \((M,g_{\mu \nu } )\), where M is a 4-dimensional differentiable manifold and \(g_{\mu \nu }\) is a Lorentzian metric. \((M,g_{\mu \nu } )\) can be foliated by the family of space like surface (\(\Sigma _{t}\)), for more details refer to [48,49,50]. Mathematically, four dimensional metric can be written in terms of induced metric \( h_{\mu \nu }\) and normal vector \( n_{\mu }\),

$$\begin{aligned} g_{\mu \nu }= h_{\mu \nu }- n_{\mu } n_{\nu }. \end{aligned}$$
(1)

The time-like future-directed vector \(n_{\mu } \) is normal to the three dimensional space like surface, having a property, \(n_{\mu }n^{\mu }=-1\). The time direction vector \(t^{a}=\frac{\partial }{\partial t}\), related to \(n^{\mu }\) as,

$$\begin{aligned} t^{\mu }=Nn^{\mu }+N^{\mu }, \end{aligned}$$
(2)

where, \(N^{\mu }\) is the shift vector, and N is the lapse function. The line element in the 3+1 decomposition reads

$$\begin{aligned} ds^2= -N^{2}dt^{2}+h_{ij}(dx^{i}+N^{i}dt)(dx^{j}+N^{j}dt). \end{aligned}$$
(3)

We used the indices \(i,j\ldots \) for showing spatial character of shift vector and spatial metric. The value of N and \( N^{i}\) in terms of metric is given as,

$$\begin{aligned} N=\frac{1}{\sqrt{-g^{00}}},\qquad N^i=-\frac{g^{0i}}{\sqrt{g^{00}}}. \end{aligned}$$
(4)

Further, the various metric elements can be written in terms of \(h_{ij},N^{i}\) and N as,

$$\begin{aligned} g_{00}&=-N^2+h_{ij}N^{i}N^{j},\qquad g_{0i}=N_{i},\qquad g_{ij}=h_{ij}, \nonumber \\ g^{00}&=\frac{1}{N^{2}},\qquad g^{0i}=\frac{N^i}{N^2}, \qquad g^{ij}=h^{ij}-\frac{N^i N^j}{N^2}. \end{aligned}$$
(5)

The normal vector in terms of lapse and shift function are

$$\begin{aligned} n_{0}=-N, \qquad n_{i}=0, \qquad n^{0}=\frac{1}{N}, \qquad n^{i}=\frac{N^{i}}{N}. \end{aligned}$$

The evolution of the spatial metric, \(h_{ij}\) is given by the Lie derivative along \(n^{a}\),

$$\begin{aligned} {\mathcal {L}}_{n}h_{ij}=2NK_{ij} \end{aligned}$$
(6)

where, \(K_{ij}\) is the extrinsic curvature which is,

$$\begin{aligned} K_{ij}=\frac{1}{2N}\left( \dot{h_{ij}}-{\mathcal {D}}_{i} N_{j}-{\mathcal {D}}_{j}N_{i}\right) . \end{aligned}$$
(7)

Here the overdot represents the Lie derivative with respect to the time flow vector \(t^{b}\) of the metric, and \({\mathcal {D}}_{i}\) denotes the spatial derivative. Evolution of \(K_{ij}\) is related to \(L_{n}K_{ij}\) which takes the form,

$$\begin{aligned} {\mathcal {L}}_{n}K_{ij}=\frac{1}{N}(\dot{K_{ij}}-{\mathcal {L}}_{\vec {N}}K_{ij}). \end{aligned}$$
(8)

where \({\mathcal {L}}_{\vec {N}}\) is Lie derivative with respect to shift vector, \(\dot{ K_{ij}}\) contains second order time derivative of induced metric \(h_{ij}\). The Ricci scalar in (3+1) decomposition takes the form,

$$\begin{aligned} R= {\mathcal {R}}+ K^{2}-3 K_{i j} K^{ij}+ 2 h^{ij} L_{n} K_{ij} -\frac{2}{N}D_{i}D^{i}N. \end{aligned}$$
(9)

Similarly \({\mathcal {L}}_{n} \phi \) containing the first order time derivative of any scalar \(\phi \) is defined as,

$$\begin{aligned} {\mathcal {L}}_{n}\phi =n^{a}\nabla _{a}\phi =\frac{1}{N}({\dot{\phi }}-{\mathcal {L}}_{\vec {N}}\phi ). \end{aligned}$$
(10)

The 3+1 decomposition of our action will help us construct canonical momenta for the Hamiltonian. Next, we derive a Hamiltonian for our model.

3 Hamiltonian formalism of nonlocal F(R) gravity model

Let us consider action with nonlocal terms of the form [47],

$$\begin{aligned} S=\int d^{4}x \sqrt{-g}\left[ G(R)+ F(R) \Box ^{-k}H(R) \right] , \end{aligned}$$
(11)

where, G(R), F(R) and H(R) are general functions of Ricci scalar, and k is a positive integer. This model is examined in detail for \(k=1\) and \(k=2\) from the Lagrangian point of view. It is shown that this theory is ghost free for \(k=1.\) However it can be made to be free from ghosts by adding extra fields for \(k=2\). Next, our plan is to analyze the same model in Hamiltonian formalism. For this we write the above action in an equivalent scalar-tensor form by introducing Lagrange multiplier C, which replaces R by Q,

$$\begin{aligned} S_{1}^{eqv} = \int d^{4}x \sqrt{-g}\left[ G(R)+ F(R) \Box ^{-k}H(R)+ C(R-Q) \right] ,\nonumber \\ \end{aligned}$$
(12)

introducing different set of auxiliary fields \(B_{k}\) and \(A_{k}\) [45], after some straightforward calculation, Eq. (12) can be written as,

$$\begin{aligned} S^{eqv}&= \int d^{4}x\sqrt{-g} \Bigg [ G(Q) + F(Q)A_{1} \nonumber \\&\quad + C\left( R -Q\right) -B_{k}H(Q) \nonumber \\&\quad -\sum _{n=1}^{k-1} B_{n} A_{n+1}+\sum _{n=1}^{k} B_{n}\Box A_{n} \Bigg ]. \end{aligned}$$
(13)

The last term of action Eq. (13) simplifies to

$$\begin{aligned} \int d^{4}x N\sqrt{h}\sum _{L=1}^{\infty } B_{n }\Box A_{n}&=-\int d^{4}x N\sqrt{h}\sum _{L=1}^{\infty }\nabla _{\rho }B_{n} \nabla ^{\rho } A_{n}\nonumber \\&\quad +\text {surface term}. \end{aligned}$$
(14)

Further, the Eq. (13) in terms of ADM variables looks,

$$\begin{aligned} S^{eqv}&= \int d^{3}x N\sqrt{h} \Bigg [G(Q) + F(Q)A_{1} \nonumber \\&\quad + C\left( K_{ij}K^{ij} -K^{2} + {\mathcal {R}} -Q\right) \nonumber \\&\quad -2K \ (n^{a} \nabla _{a}C) - \sum _{n= 1}^{k-1} B_{n} A_{n+1} - B_{k}H(Q) \nonumber \\&\quad - h^{ij} \sum _{n=1}^{k} {\mathcal {D}}_{i}B_{n}{\mathcal {D}}_{j}A_{n}\nonumber \\&\quad + \sum _{n=1}^{k} (n^{a}\nabla _{a}B_{n})(n^{b}\nabla _{b}A_{n}) +{\mathcal {D}}_{i}{\mathcal {D}}^{i}C\Bigg ]. \end{aligned}$$
(15)

Now we derive the canonical momenta with respect to set of variables \((N, N^i, h_{ij}, Q, A_{1},A_{2}\ldots A_{n}, B_{1},B_{2}\ldots B_{n})\), which are

$$\begin{aligned} \begin{aligned} \Pi _{N}&\approx 0, \ \ \ \ \ \Pi _{i} \approx 0,\\&\Pi ^{ij} = \sqrt{h} C( {\mathcal {K}}^{ij} -h^{ij}{\mathcal {K}} ) - \sqrt{h} h^{ij} (n^{a} \nabla _{a}C), \\ P_{Q}&\approx 0 , \qquad P_{C} = -2\sqrt{h} {\mathcal {K}}, \\ P_{A_{1}}&= \sqrt{h} (n^{a}\nabla _{a}B_{1}), P_{A_{2}} = (n^{a}\nabla _{a}B_{2}) \ ,\\0 P_{A_{k}}&=\sqrt{h} (n^{a}\nabla _{a}B_{k})\\ P_{B_{1}}&= \sqrt{h} (n^{a}\nabla _{a}A_{1}) P_{B_{2}} = \sqrt{h} (n^{a}\nabla _{a}A_{2}),\\ P_{B_{k}}&= \sqrt{h} (n^{a}\nabla _{a}A_{k}). \end{aligned} \end{aligned}$$
(16)

Here we use \(\Pi \) notation for denoting momenta for variables appearing from the gravity side \((N, N^i, h_{ij})\) and P for other auxiliary variables \((C, A_{1},A_{2}\ldots A_{n}, B_{1},B_{2}\ldots B_{n}).\) For further calculations, we follow the Dirac method for deriving the Hamiltonian for constraints system, in which variables with vanishing canonical momenta as primary constraints are denoted by the \(\approx \) sign in the constraint space \(\Gamma \). Thus, from the Eq. (16), the primary constraints in our theory are,

$$\begin{aligned} \Pi _{N}\approx 0 ,\ \ \Pi _{i}\approx 0 ,\ \ P_{Q}\approx 0. \end{aligned}$$

After deriving all the canonical momenta and identifying primary constraints, we can write Hamiltonian density for the corresponding Lagrangian Eq. (15) as,

$$\begin{aligned} {\mathcal {H}}=\Pi ^{ij}{\dot{h}}_{ij}+p^C {\dot{C}} +\sum _{n = 1}^{k}( P_{B_{n}}{\dot{B}}_{n} + P_{A_{n}} {\dot{A}}_{n})-L \end{aligned}$$
(17)

The time derivative of all variables to their corresponding momenta can be extracted form Eq. (16). After putting these values, the final form of Hamiltonian can be written as,

$$\begin{aligned} {\mathcal {H}}= N{\mathcal {H}}_{N} + N^{i} {\mathcal {H}}_{i}, \end{aligned}$$
(18)

with

$$\begin{aligned} {\mathcal {H}}_{N}&= \frac{1}{\sqrt{h} C} \Pi ^{ij} h_{ik} h_{jl} \Pi ^{kl} \nonumber \\&\quad -\frac{1}{3\sqrt{h} C} \Pi ^{2} -\frac{1}{3\sqrt{h}} \Pi P_{C} + \frac{1}{6 \sqrt{h}} C P_{C}^{2} \nonumber \\&\quad -\sqrt{h} C {\mathcal {R}}+ \sqrt{h}CQ - \sqrt{h} G(Q) - F(Q)A_{1} \nonumber \\&\quad +\sqrt{h}\sum _{n=1}^{k} A_{n+1}B_{n} +\sqrt{h}B_{k}H(Q) \nonumber \\&\quad +\sum _{n = 1}^{k} \frac{P_{A_{n}}P_{B_{n}}}{\sqrt{h}} -\sqrt{h} h^{ij} \sum _{n = 1}^{k} \Big ( {\mathcal {D}}_{i}B_{n} {\mathcal {D}}_{j}A_{n}\Big ), \end{aligned}$$
(19)

and

$$\begin{aligned} \begin{aligned} {\mathcal {H}}_{i}&= -2 h_{ik}{\mathcal {D}}_{j}\Pi ^{kj} + \sum _{n = 1}^{k} \Big (P_{A_{n}}{\mathcal {D}}_{i}A_{n} + P_{B_{n}}{\mathcal {D}}_{i}B_{n} \Big ) \\&\quad + P_{C}{\mathcal {D}}_{i}C. \end{aligned} \end{aligned}$$
(20)

The \(\Pi \) is defined as, \(h_{ij}\Pi ^{ij}=\Pi \). The total Hamiltonian density with primary constraints in terms of Lagrange multipliers \( \lambda ^{i},\lambda ^{N} \) and \(\lambda ^{Q}\) takes the form,

$$\begin{aligned} {\mathcal {H}}_{tot} = N{\mathcal {H}}_{N} + N^{i}{\mathcal {H}}_{i} +\lambda ^{i}\Pi _{i}+\lambda ^{N}\Pi _{N} + \lambda ^{Q}P_{Q}, \end{aligned}$$
(21)

and the total Hamiltonian is expressed as,

$$\begin{aligned} H_{total} = \int d^{3}x \Big ( N {\mathcal {H}}_{N} + N^{i} {\mathcal {H}}_{i} +\lambda ^{i}\Pi _{i}+\lambda ^{N}\Pi _{N} + \lambda ^{Q}P_{Q} \Big ),\nonumber \\ \end{aligned}$$
(22)

In Dirac method for constraints system, the constraints are classified according to their nature of time evolution. For \(\Pi _{N}\) and \(\Pi _{i}\), we get

$$\begin{aligned} \dot{\Pi _{N}}=\{\Pi _{N},{\mathcal {H}}_{tot}\}={\mathcal {H}}_N, \quad \dot{\Pi _{i}}=\{\Pi _{i},{\mathcal {H}}_{tot}\}={\mathcal {H}}_i, \end{aligned}$$
(23)

where \({\mathcal {H}}_{N}\) and \({\mathcal {H}}_{i}\) are secondary constraints, are known as Hamiltonian and diffeomorphism constraints respectively. On the constraint space \( \Gamma , \) the time evolution of constraints \({\mathcal {H}}_{N}\) and \({\mathcal {H}}_{i}\) vanishes weakly as,

$$\begin{aligned} \dot{{\mathcal {H}}}_{N}=\{{\mathcal {H}}_{N},H_{tot}\}\approx 0, \end{aligned}$$
(24)

and

$$\begin{aligned} \dot{{\mathcal {H}}}_i=\{{\mathcal {H}}_i,H_{tot}\}\approx 0. \end{aligned}$$
(25)

Hence, \({\mathcal {H}}_{N}\approx 0\) and \({\mathcal {H}}_{i}\approx 0\) generate no new constraints i.e. tertiary constraints and behave as generators of space time diffeomorphism. To make our definition more clear, we define a smeared momentum constraint as a functional,

$$\begin{aligned} {\mathcal {H}}(\vec {N})=\int d^{3}x N^{i} {\mathcal {H}}_{i} . \end{aligned}$$
(26)

By using the expression of \( {\mathcal {H}}_{i}\) given in Eq. (20), the Eq. (26) can be written as,

$$\begin{aligned} {\mathcal {H}}(\vec {N})= & {} \int d^{3}x \Bigg [ \Pi ^{jk} {\mathcal {L}}_{\vec {N}}h_{jk} \nonumber \\&+ \sum _{n = 1}^{k} \Big (P_{ A_{n}} {\mathcal {L}}_{\vec {N}}A_{n} + P_{B_{n}} {\mathcal {L}}_{\vec {N}}B_{n} \Big ) + P_{C} {\mathcal {L}}_{\vec {N}}C\Bigg ],\nonumber \\ \end{aligned}$$
(27)

where, \({\mathcal {L}}_{\vec {N}}h_{jk}=2{\mathcal {D}}_{(j}N_{k)}\), and \({\mathcal {L}}_{\vec {N}}\) is Lie derivative w.r.t. the shift vector \(N^{i}\). Then the Poisson brackets,

$$\begin{aligned} \{h_{jk},{\mathcal {H}}(\vec {N})\}={\mathcal {L}}_{\vec {N}}h_{jk},\ \ \ \ \ \ \{C,{\mathcal {H}}(\vec {N})\}={\mathcal {L}}_{\vec {N}}C, \nonumber \\ \{A_{n},{\mathcal {H}}(\vec {N})\}={\mathcal {L}}_{\vec {N}}A_{n}\ \ \ \ \ \ \ \ \{B_{n},{\mathcal {H}}(\vec {N})\}={\mathcal {L}}_{\vec {N}}B_{n}, \end{aligned}$$
(28)

where, n can take the values from 1 to k. Under the spatial diffeomorphism, the variables \((h_{ij}, C, A_{1},A_{2}\ldots A_{k}, B_{1},B_{2}\ldots B_{k})\) behave as regular scalars and tensors whereas their canonically conjugated momenta behave as scalars and tensors densities of unit weight. Consequently, under the spatial diffeomorphism, all constraints behave as unit weight scalars or tensors. Thus, the Poisson bracket of the momenta \((P_{C},P_{A_{1}},P_{A_{2}}\ldots P_{A_{k}}, P_{B_{1}},P_{B_{2}}\ldots P_{B_{k}})\) with the \({\mathcal {H}}(\vec {N})\) gives,

$$\begin{aligned} \{P_{C},{\mathcal {H}}(\vec {N})\}= & {} {\mathcal {D}}_{i}(N^{i}C),\ \ \ \ \ \{P_{A_{n}},{\mathcal {H}}(\vec {N})\}={\mathcal {D}}_{i}(N^{i}A_{n})\ \ \ \ \nonumber \\ \{P_{B_{n}},{\mathcal {H}}(\vec {N})\}= & {} {\mathcal {D}}_{i}(N^{i}B_{n}). \end{aligned}$$
(29)

In a similar way, we can define the smeared version of Hamiltonian constraint,

$$\begin{aligned} {\mathcal {H}}_{N}(N)=\int d^{3}x N {\mathcal {H}}_{N}. \end{aligned}$$
(30)

Here also, the Hamiltonian constraints is a scalar density of unit weight, its Poisson bracket with \({\mathcal {H}}(\vec {N})\) follow the Eq. (29),

$$\begin{aligned} \{{\mathcal {H}}_{N},{\mathcal {H}}(\vec {N})\}={\mathcal {D}}_{i}(N^{i}{\mathcal {H}}_{N}). \end{aligned}$$
(31)

With themselves, the momentum constraints satisfy the Lie algebra [51, 52],

$$\begin{aligned} \{{\mathcal {H}}(\vec {N_{1}}),{\mathcal {H}}(\vec {N_{2}})\}={\mathcal {H}}(\vec {N}),\ \ \ \ N^{i}=N_{1}^{k}{\mathcal {D}}_{k}N_{2}^{i}-N_{2}^{k}{\mathcal {D}}_{k}N_{1}^{i},\nonumber \\ \end{aligned}$$
(32)

and the Hamiltonian constraint obeys,

$$\begin{aligned} \{{\mathcal {H}}_{N}(N_{1}),{\mathcal {H}}_{N}(N_{2})\}={\mathcal {H}}(\vec {N}),\ \ \ N^{i}=N_{1}{\mathcal {D}}^{i}N_{2}-N_{2}{\mathcal {D}}^{i}N_{1}.\nonumber \\ \end{aligned}$$
(33)

The above calculation shows that the constraints \({\mathcal {H}}_{N}\) and \({\mathcal {H}}_{i}\) provide space time diffeomorphism and do not produce new constraints in theory. Further, we evaluate time evolution of primary constraint \(P_Q\) with total Hamiltonian,

$$\begin{aligned} \Xi _{Q}= & {} \partial _{t}P_{Q} =\{ P_{Q}, \nonumber \\ {\mathcal {H}}_{tot}\}= & {} N\sqrt{h}\Big \{-C +G'(Q) +F'(Q)A_{1} - H'(Q)B_{k}\Big \}\approx 0.\nonumber \\ \end{aligned}$$
(34)

where, the dashed sign (’) denotes the derivative with respect to Q, for example \(G'(Q)=\frac{\partial G(Q)}{\partial Q}\). \(\Xi _{Q}\approx 0\), \(\Xi _{Q}\) act as secondary constraint corresponding to primary constraint \(P_Q\approx 0\). Now, we check time evolution of \(\Xi _{Q}\) and demanding that it vanishes on constraint surface we obtain,

$$\begin{aligned} \dot{\Xi }_{Q}&= \{ \Xi _{Q},{\mathcal {H}}_{tot}\}= N \Bigg [ \frac{1}{3}(\Pi -CP_{C})\nonumber \\&\quad + F'(Q)P_{B_{1}} -H'(Q)P_{A_{k}}\Bigg ] \nonumber \\&\quad + \sqrt{h}\lambda ^{Q}(G''(Q) +F''(Q)A_{1}-H''(Q)B_{k})\approx 0. \end{aligned}$$
(35)

where the double dash (’ ’) show second order derivative with respect to Q. This condition Eq. (35) fixes the Lagrange multiplier \(\lambda ^{Q}\), and hence no tertiary constraint appears in this theory.

Now, we have identified all the primary and secondary constraints. Then we categorize them into first and second-class constraints. For which, we check the Poisson bracket of \(P_Q\) and \(\Xi _{Q}\),

$$\begin{aligned} \{P_Q,\Xi _{Q}\}\ne 0, \end{aligned}$$
(36)

and it implies that \(P_Q\) and \(\Xi _{Q}\) are second class constraints. All other Poisson brackets are obtained as,

$$\begin{aligned} \{ \Pi _{N}, \Pi _{i}\}&= \{ \Pi _{N}, \Pi _{N}\} = \{ \Pi _{N}, {\mathcal {H}}_{N}\}=\{ \Pi _{N},{\mathcal {H}}_{i}\} \approx 0 ,\nonumber \\ \{ \Pi _{i}, \Pi _{i}\}&= \{ \Pi _{i},{\mathcal {H}}_{N}\} = \{ \Pi _{i},{\mathcal {H}}_{i}\} \approx 0 ,\nonumber \\ \{ P_{Q}, P_{Q}\}&= \{ P_{Q}, \Pi _{N}\} = \{ P_{Q}, \Pi _{i}\} \approx 0. \end{aligned}$$
(37)

In summary, we have eight first class constraints \((\Pi _{N}, \Pi _{i}, {\mathcal {H}}_{N}, {\mathcal {H}}_{i})\) and two second class constraints \(P_Q \) and \( G_Q.\) Now we can derive results for various choices of general function G(R), F(R) , and H(R) from the above analysis.

3.1 Analysis for different choices of G(R), F(R) and H(R)

Here we reiterate that the Ostrogradsky ghost is seen in the Hamiltonian by linear momenta terms. It can be observed from Eq. (19) that there are k terms of linear momenta of auxiliary variables \(A_{k}\) and \(B_{k}\). We also note that for the general function G(R), F(R) , and H(R) , we obtain only two constraint equations. These constraints are not sufficient to remove all the linear momenta terms from Eq. (19). Now we analyze different cases.

  • For all our analysis we set \(C=G'(Q)\) in Eq. (34)ccc. Then we obtain the form of constraint \(\dot{\Xi }_{Q}\) as,

    $$\begin{aligned} \Xi _{Q}^{II}= & {} \dot{\Xi }_{Q} = N \Bigg [ F'(Q)P_{B_{1}} -H'(Q)P_{A_{k}}\Bigg ] \nonumber \\&+ \sqrt{h}\lambda ^{Q}(F''(Q)A_{1}-H''(Q)B_{k})\approx 0, \end{aligned}$$
    (38)

Case 1: If we choose \( F''(Q)=0\) and \( H''(Q)=0\), then the Lagrange multipliers remain undetermined. And these conditions hold only if F(Q) and H(Q) are linear functions of Q,  which provides a relation between F(Q) and H(Q) i.e \( H(Q)=\alpha F(Q)+\text {any constant}.\) For this case the Eq. (38) reads

$$\begin{aligned} \Xi _{Q}^{II}=\dot{\Xi }_{Q}^{} = N \Bigg [ P_{B_{1}} -\alpha P_{A_{k}}\Bigg ]\approx 0. \end{aligned}$$
(39)

Due to undetermined nature of Lagrange multiplier, the time evolution \(\Xi _{Q}^{II}\) with Hamiltonian generate new constraint (tertiary constraint),

$$\begin{aligned} \Xi _{Q}^{2I}=\dot{\Xi }_{Q}^{II} = N \Bigg [ A_{2} -\alpha B_{k-1}\Bigg ]\approx 0, \end{aligned}$$
(40)

and the time evolution \(\Xi _{Q}^{2I}\) with Hamiltonian becomes,

$$\begin{aligned} \Xi _{Q}^{2II}=\dot{\Xi }_{Q}^{} = N \Bigg [ P_{B_{2}} -\alpha P_{A_{k-1}}\Bigg ]\approx 0. \end{aligned}$$
(41)

Next we repeat the above procedure for n times which yields,

$$\begin{aligned} \Xi _{Q}^{nI}=\dot{\Xi }_{Q}^{n-1} = N \Bigg [ A_{n} -\alpha B_{1}\Bigg ]\approx 0. \end{aligned}$$
(42)

Time evolution of \(\Xi _{Q}^{nI}\) Eq. (42) becomes,

$$\begin{aligned} \Xi _{Q}^{nII}=\dot{\Xi }_{Q}^{I} = N \Bigg [ P_{B_{n}} -\alpha P_{A_{1}}\Bigg ]\approx 0. \end{aligned}$$
(43)

Now the chain of constraints ends and we have total 2n constraints (\(\Xi _{Q}^{},\Xi _{Q}^{II},\ \Xi _{Q}^{2I},\Xi _{Q}^{2II},\ \ldots ,\ \Xi _{Q}^{nI},\Xi _{Q}^{nII}\)). These constraints relate \(A_{1}\) to \( B_{n}\), \(A_{2}\) to \(B_{n-1}\)...\(A_{n}\) to \(B_{1}\), and similarly relate momenta \( P_{B_{n}}\) to \( P_{A_{1}}\), \(P_{B_{n-1}}\) to \(P_{A_{2}}\)...\( P_{B_{1}}\) to \( P_{A_{n}}.\) However for removing the linear momenta terms in Hamiltonian Eq. (19) relations between different momenta, i.e., \( P_{B_{1}}\) to \( P_{A_{1}}\), \(P_{B_{2}}\) to \(P_{A_{2}}\)...\( P_{B_{n}}\) to \( P_{A_{n}}\) are required. Because of the absence of these one to one relation in this theory, we get n ghosts.

For a special case like \(k=1\), Eq. (34) becomes,

$$\begin{aligned} \Xi _{Q}=N\sqrt{h}\big \{\alpha A_{1}-B_{1}\big \}\approx 0, \end{aligned}$$
(44)

and its time evolution is,

$$\begin{aligned} \Xi _{Q}^{II}=\dot{\Xi }_{Q}^{} = N \Bigg [ P_{B_{1}} -\alpha P_{A_{1}}\Bigg ]\approx 0. \end{aligned}$$
(45)

Equation (45) relates \(P_{A_{1}}\) to \(P_{B_{1}}\). Consequently, \(H_{N}\) in Eq. (22) reads,

$$\begin{aligned} {\mathcal {H}}_{N}&= \frac{1}{\sqrt{h} C} \Pi ^{ij} h_{ik} h_{jl} \Pi ^{kl} -\frac{1}{3\sqrt{h} C} \Pi ^{2} -\sqrt{h} C {\mathcal {R}}+ \sqrt{h}CQ \nonumber \\&\quad - \sqrt{h} G(Q) + \frac{P_{A_{1}}^{2}}{\sqrt{h}} -\sqrt{h} h^{ij} \sum _{n = 1}^{k} \Big ( {\mathcal {D}}_{i}A_{1} {\mathcal {D}}_{j}A_{1}\Big ), \end{aligned}$$
(46)

Here all the momenta terms are quadratic, and there is no place for Ostrogradsky ghost to appear.

  • Case 2: Here we choose \( H(Q)=Q\) and F(Q) is not a linear function of Q. In this case then the form of \(\dot{\Xi }_{Q}\) is,

    $$\begin{aligned} \Xi _{Q}^{II}= & {} \dot{\Xi }_{Q} = N \Bigg [ F'(Q) P_{B_{1}} -P_{A_{k}}\Bigg ] \nonumber \\&+ \sqrt{h}\lambda ^{Q} F''(Q)A_{1}\approx 0. \end{aligned}$$
    (47)

    It can be observed from Eq. (47) that by fixing the Lagrange multiplier, we cannot get rid of all the linear momenta terms in the Hamiltonian. A model of this kind is formulated in [47] from the Lagrangian point of view, where authors draw the result that ghosts exit as the determinant of kinetic matrix takes negative values. The same conclusions from our Hamiltonian analysis for this particular model can be drawn here. Case 3: Here we take F(Q)=H(Q) for which the structure of \(\Xi _{Q}^{II}\) becomes

    $$\begin{aligned} \Xi _{Q}^{II}= & {} \dot{\Xi }_{Q} = NF'(Q) \Bigg [ P_{B_{1}} -P_{A_{k}}\Bigg ] \nonumber \\&+ \sqrt{h}\lambda ^{Q}F''(Q)( A_{1}-B_{k})\approx 0. \end{aligned}$$
    (48)

    In this case we can fix the Lagrange multiplier which in turn provides only two constraints. However these constraints are not sufficient to remove all the linear momenta term from the Hamiltonian Eq. (19). Now, the theory with \(k=1\), we can remove the linear momenta term in the Hamiltonian by imposing the condition that \(A_{1}\) and \(B_{1}\) are related to each other linearly i.e. \(A_{1}=p B_{1},\) (p=constant). Under this condition no ghosts appear for \(k=1\) case and the constraint Eq. (34) becomes,

    $$\begin{aligned} \Xi _{Q}= & {} \partial _{t}P_{Q} =\{ P_{Q}, \nonumber \\&{\mathcal {H}}_{tot}\} = N\sqrt{h}\Big \{F'(Q)A_{1}( 1- p)\Big \}\approx 0, \end{aligned}$$
    (49)

    and its time evolution with Hamiltonian reads,

    $$\begin{aligned} \Xi _{Q}^{II}= & {} \dot{\Xi }_{Q} = NF'(Q) P_{B_{1}}\Bigg [ 1-p \Bigg ]\nonumber \\&+\sqrt{h}\lambda ^{Q}F''(Q)A_{1}(1-p)\approx 0. \end{aligned}$$
    (50)

    For a particular value of p, i.e., \(p=1,\) then \(A_{1}= B_{1}\) and their corresponding momenta are equal \( P_{A_{1}} = P_{B_{1}}.\) This implies \( \Xi _{Q}=0.\) This is a exact relation and happens only for special case when \(p=1.\) However for other values of p we have to use usual procedure to show the nonexistence of ghosts. Here we conclude that for \(k=1\) no Ostrogradsky ghost is present for the condition when auxiliary variables depend linearly on each other .

Next we consider \(k=2\) and the structure of constraints takes the form,

$$\begin{aligned} \Xi _{Q}= & {} \partial _{t}P_{Q} =\{ P_{Q}, \nonumber \\ {\mathcal {H}}_{tot}\}= & {} N\sqrt{h}\Big \{ F'(Q)(A_{1} -B_{2})\Big \}\approx 0. \end{aligned}$$
(51)

and its evolution gives,

$$\begin{aligned} \dot{\Xi }_{Q}&= \{ \Xi _{Q},{\mathcal {H}}_{tot}\}= N \Bigg [ F'(Q)(P_{B_{1}} -P_{A_{2}})\Bigg ] \nonumber \\&\quad + \sqrt{h}\lambda ^{Q}(F''(Q)(A_{1}-B_{2})\approx 0. \end{aligned}$$
(52)

Similar to the the analysis performed for \(k=1\), the mathematical structure of constraints Eqs. (51) and (52 relate \(A_{1} \) to \(B_{2}\), and \( P_{B_{1}}\) to \(P_{A_{2}}\). On top of it a linear relation between \( P_{B_{1}}\) and \(P_{A_{1}}\) is required to make the theory ghost free. But there is no way to achieve this for \(k=2.\) Generalizing the above analysis for values of \(k\ge 2,\) it can be shown that ghosts always appear.

For \(k=2\), [47], suggested a method for developing a ghost-free theory, we need to modify the Lagrangian. For clarity, we again reformulate the Hamiltonian formalism for \(k=2\). Now, we start with an action [47],

$$\begin{aligned} S=\int d^{4}x \sqrt{-g}\left[ R-\frac{1}{2} F(R) \Box ^{-2}F(R) \right] . \end{aligned}$$
(53)

Following [47], after introducing \(B_{1}=\frac{1}{2}{\tilde{A}}+{\tilde{B}}\) and \(B_{2}={\tilde{A}}-2{\tilde{B}}\) in Eq. (13), the final scalar tensor form of Eq. (53) reads,

$$\begin{aligned} S^{eqv}&= \int d^{4}x\sqrt{-g} \bigg [ Q - F(Q)A_{1} + C\left( R -Q\right) \nonumber \\&\quad - {\tilde{A}}^2+A_{1}\Box {\tilde{A}} \bigg ]. \end{aligned}$$
(54)

Despite these procedures, the Hamiltonian may still include linear momenta terms due to the presence of the term \(A_{1}\Box {\tilde{A}}.\) Next, we adopt a method put forward by authors of Ref. [47] where the kinetic term is modified to obtain a ghost-free action. Modified action takes the form,

$$\begin{aligned} S_{mod} = S^{eqv}+ \int d^{4}x\sqrt{-g} \bigg [\frac{\beta }{2}A_{1}\Box A_{1}+\frac{\alpha }{2}{\tilde{A}}\Box {\tilde{A}} \bigg ], \end{aligned}$$
(55)

and after putting \(S^{eqv}\),

$$\begin{aligned} S_{mod}&= \int d^{4}x\sqrt{-g} \bigg [ Q - F(Q)A_{1} + C\left( R -Q\right) \nonumber \\&\quad - {\tilde{A}}^2+A_{1}\Box {\tilde{A}} +\frac{\beta }{2}A_{1}\Box A_{1}+\frac{\alpha }{2}{\tilde{A}}\Box {\tilde{A}}\bigg ]. \end{aligned}$$
(56)

3+1 decomposition of \(S_{mod}\) becomes,

$$\begin{aligned} S_{mod}&= \int d^{4}x\sqrt{-g} \bigg [ Q -F(Q)A_{1} \nonumber \\&\quad + C\left( K_{ij}K^{ij} -K^{2} + {\mathcal {R}} -Q\right) \nonumber \\&\quad -2K \ (n^{a} \nabla _{a}C)- {\tilde{A}}^2\nonumber \\&\quad +(n^{a}\nabla _{a}A_{1})(n^{b}\nabla _{b}{\tilde{A}}) +\frac{\beta }{2}(n^{a}\nabla _{a}A_{1})(n^{b}\nabla _{b}A_{1})\nonumber \\&\quad +\frac{\alpha }{2}(n^{a}\nabla _{a}{\tilde{A}})(n^{b}\nabla _{b}{\tilde{A}}) -h^{ij}{\mathcal {D}}_{i}A_{1}{\mathcal {D}}_{j}{\tilde{A}} \nonumber \\&\quad -\frac{\beta }{2}h^{ij}{\mathcal {D}}_{i}A_{1}{\mathcal {D}}_{j}A_{} -\frac{\alpha }{2}h^{ij}{\mathcal {D}}_{i}{\tilde{A}}{\mathcal {D}}_{j}{\tilde{A}}+{\mathcal {D}}_{i}{\mathcal {D}}^{i}C\bigg ]. \end{aligned}$$
(57)

Here, we show the canonical momenta related to \(A_{1}\) and \({\tilde{A}}\) only, and the canonical momenta relation for \(C, N, N^{i}\) can be calculated similarly to the procedure used for previous cases of study. Thus,

$$\begin{aligned} P_{{\tilde{A}}}=\frac{\partial L}{\partial {\tilde{A}}}=\sqrt{h}\left\{ \left( n^{a}\nabla _{a}A_{1}\right) +\alpha \left( n^{a}\nabla _{a}{\tilde{A}}\right) \right\} \nonumber \\P_{A_{1}}=\frac{\partial L}{\partial A_{1}}=\sqrt{h}\left\{ (n^{a}\nabla _{a}{\tilde{A}})+\beta (n^{a}\nabla _{a}A_{1})\right\} \end{aligned}$$
(58)

After solving these equations for the \(n^{a}\nabla _{a}{\tilde{A}}\) and \(n^{a}\nabla _{a}A_{1}\) is,

$$\begin{aligned} n^{a}\nabla _{a}{\tilde{A}}= & {} \frac{1}{\sqrt{h}(\alpha \beta -1)}(\beta P_{{\tilde{A}}}- P_{A_{1}})\end{aligned}$$
(59)
$$\begin{aligned} n^{a}\nabla _{a}A_{1}= & {} \frac{1}{\sqrt{h}(\alpha \beta -1)}(\alpha P_{A_{1}}- P_{{\tilde{A}}}) \end{aligned}$$
(60)

The Hamiltonian of action Eq. (56) is written as,

$$\begin{aligned} {\mathcal {H}}=\Pi ^{ij}{\dot{h}}_{ij}+p^C {\dot{C}} + P_{{\tilde{A}}} \dot{{\tilde{A}}}+ P_{A_{1}} {\dot{A}}_{1}-L. \end{aligned}$$
(61)

After some simplification \({\mathcal {H}}\) is

$$\begin{aligned} {\mathcal {H}}= N{\mathcal {H}}_{N} + N^{i} {\mathcal {H}}_{i}, \end{aligned}$$
(62)

with

$$\begin{aligned} {\mathcal {H}}_{N}&= \frac{1}{\sqrt{h} C} \Pi ^{ij} h_{ik} h_{jl} \Pi ^{kl} -\frac{1}{3\sqrt{h} C} \Pi ^{2} -Q + F(Q)A_{1} \nonumber \\&\quad +{\tilde{A}}^2+ h^{ij}{\mathcal {D}}_{i}A_{1}{\mathcal {D}}_{j}{\tilde{A}}\nonumber \\&\quad +\frac{\beta }{2}h^{ij}{\mathcal {D}}_{i}A_{1}{\mathcal {D}}_{j}A_{1} +\frac{\alpha }{2}h^{ij}{\mathcal {D}}_{i}{\tilde{A}}{\mathcal {D}}_{j}{\tilde{A}}\nonumber \\&\quad +\frac{1}{2\,\alpha \,\beta -2\,}(\beta P_{{\tilde{A}}}^{2}-2\,P_{{\tilde{A}}}\,P_{A_{1}}+\alpha P_{A_{1}}^{2}) \end{aligned}$$
(63)

and

$$\begin{aligned} \begin{aligned} {\mathcal {H}}_{i} = -2 h_{ik}{\mathcal {D}}_{j}\Pi ^{kj} + \Big (P_{{\tilde{A}}}{\mathcal {D}}_{i}{\tilde{A}} + P_{A_{1}}{\mathcal {D}}_{i}A_{1} \Big ) + P_{C}{\mathcal {D}}_{i}C. \end{aligned}\nonumber \\ \end{aligned}$$
(64)

As we can see from above Hamiltonian that linear terms of \(P_{{\tilde{A}}}\) and \(P_{A_{1}}\) appear. We can remove the linear momenta terms only if \(\alpha \beta =1\), but the Hamiltonian is not finite with this choice. Therefore, the above method is not effective in removing linear terms of momenta from the Hamiltonian. In other words, a Hamiltonian formalism for \(\alpha \beta =1\) is unphysical. However, we will now show that it is possible to find the viable parameter space where no ghosts appear after diagonalization. To do this, let us start with the kinetic part of the last term of \(H_{N}\), which can take the form,

$$\begin{aligned} \begin{bmatrix} P_{{\tilde{A}}}&P_{A_{1}} \end{bmatrix} \begin{bmatrix} \alpha &{} -1 \\ -1 &{} \beta \end{bmatrix} \begin{bmatrix} P_{{\tilde{A}}} \\ P_{A_{1}} \end{bmatrix} \end{aligned}$$
(65)

Let \(M= \begin{bmatrix} \alpha &{} -1 \\ -1 &{} \beta \end{bmatrix}\) and after diagnolisation, we get the kinetic matrix as

$$\begin{aligned} \left[ \begin{array}{cc} \beta /2+\alpha /2-1/2\,\sqrt{{\alpha }^{2}-2 \,\beta \,\alpha +{\beta }^{2}+4}&{}0\\ 0&{}\beta /2+\alpha / 2+1/2\,\sqrt{{\alpha }^{2}-2\,\beta \,\alpha +{\beta }^{2}+4}\end{array} \right] \end{aligned}$$
(66)

Both the diagonal term should be positive for non-existence of ghosts we obtain the following conditions

$$\begin{aligned} \beta +\alpha > \sqrt{{\alpha }^{2}-2 \,\beta \,\alpha +{\beta }^{2}+4}, \end{aligned}$$
(67)

which holds only if

$$\begin{aligned} \,\alpha \,\beta>1, \, \, \text {and}\, \, \alpha +\beta >0. \end{aligned}$$
(68)

This matches with the results obtained in [47]. Next, we will create a Hamiltonian for some generalized nonlocal gravity models.

4 Hamiltonian formalism for \(f(R,\Box ^{-1}R,\Box ^{-2}R\ldots \Box ^{-n}R)\) gravity model

In this section, our aim is to perform Hamiltonian analysis of the model purposed in [46]. Here Lagrangian has a form as

$$\begin{aligned} L=\sqrt{-g}\ f(R,\Box ^{-1}R,\Box ^{-2}R\ldots \Box ^{-n}R), \end{aligned}$$
(69)

where, f is general function of \(\Box ^{-n}R\) \((n=1,2,3\ldots )\) and n is finite. Then action Eq. (69) satisfies the following condition,

$$\begin{aligned} \frac{\partial L}{\partial R \partial (\Box ^{-n}R)}\ne 0. \end{aligned}$$
(70)

By defining auxiliary variables \(Q, A_{1},..A_{n}, B_{1},\ldots B_{n}, C,\) the above non local action Eq. (69) can be written in localized form,

$$\begin{aligned} L= & {} \sqrt{-g}\bigg [ f(Q,A_{1},A_{2},\ldots A_{n})+C(R-Q)\nonumber \\&+B_{1}(Q-\Box A_{1})\nonumber \\&+B_{2}(A_{1}-\Box A_{2}),\ldots B_{n}(A_{n-1}-\Box A_{n})\bigg ], \end{aligned}$$
(71)

and further with straightforward calculation, transformed Lagrangian becomes,

$$\begin{aligned} L= & {} \sqrt{-g}\bigg [ f(Q,A_{1},A_{2},\ldots A_{n})+CR+Q( B_{1}-C)\nonumber \\&+g^{\mu \nu }(\partial _{\mu }B_{1}\partial _{\nu } A_{1}+\partial _{\mu }B_{2}\partial _{\nu }A_{2}\ldots \partial _{\mu }B_{n}\partial _{\nu }A_{n})\nonumber \\&+B_{2}A_{1} +B_{3}A_{2}\ldots B_{n}A_{n-1}\bigg ]. \end{aligned}$$
(72)

Using 3+1 decomposition the Eq. (72) reads,

$$\begin{aligned} \begin{aligned} S^{eqv}&= \int d^{3}x N\sqrt{h} \bigg [f(Q,A_{1},A_{2},\ldots A_{n})\\&\quad + C\left( K_{ij}K^{ij} -K^{2} + {\mathcal {R}} -Q\right) \\&\quad -2K \ (n^{a} \nabla _{a}C)+Q(B_{1}-C)+{\mathcal {D}}_{i}{\mathcal {D}}^{i}C - \sum _{k= 1}^{n-1} B_{k} A_{k+1}\\&\quad + h^{ij} \sum _{n=1}^{k} {\mathcal {D}}_{i}B_{n}{\mathcal {D}}_{j}A_{n} - \sum _{n=1}^{k} (n^{a}\nabla _{a}B_{n})(n^{b}\nabla _{b}A_{n}) \bigg ] \end{aligned}\nonumber \\ \end{aligned}$$
(73)

Likewise here the canonical momenta with respect to set of variables \((N, N^i, h_{ij}, Q, C, A_{L}, B_{L})\) are defined by the following relations,

$$\begin{aligned} \begin{aligned} \Pi _{N}&\approx 0, \quad \Pi _{i} \approx 0,\\&\Pi ^{ij} = \sqrt{h} C( {\mathcal {K}}^{ij} -h^{ij}{\mathcal {K}} ) - \sqrt{h} h^{ij} (n^{a} \nabla _{a}C), \\ P_{Q}&\approx 0 , \qquad P_{\Phi } = -2\sqrt{h} {\mathcal {K}}, \\ P_{A_{1}}&= \sqrt{h} (n^{a}\nabla _{a}B_{1}), \ \ P_{A_{2}} = (n^{a}\nabla _{a}B_{2}) ,\\ P_{A_{n}}&=\sqrt{h} (n^{a}\nabla _{a}B_{n}) \\ P_{B_{1}}&= \sqrt{h} (n^{a}\nabla _{a}A_{1})\ \ P_{B_{2}} = \sqrt{h} (n^{a}\nabla _{a}A_{2}),\\ P_{B_{n}}&= \sqrt{h} (n^{a}\nabla _{a}A_{n}). \end{aligned} \end{aligned}$$
(74)

Here, the primary constraints are \(\Pi _{N} \approx 0,\Pi _{i} \approx 0, P_{Q}\approx 0\). The final form of Hamiltonian is given as,

$$\begin{aligned} {\mathcal {H}}= N{\mathcal {H}}_{N} + N^{i} {\mathcal {H}}_{i,} \end{aligned}$$
(75)

with

$$\begin{aligned} \begin{aligned} {\mathcal {H}}_{N}&= \frac{1}{\sqrt{h} C} \Pi ^{ij} h_{ik} h_{jl} \Pi ^{kl} -\frac{1}{3\sqrt{h} C} \Pi ^{2} \\&\quad -\frac{1}{3\sqrt{h}} \Pi P_{C} + \frac{1}{6 \sqrt{h}} C P_{C}^{2} -\sqrt{h} C {\mathcal {R}} \\&\quad - \sqrt{h} f(Q,A_{1},A_{2},\ldots A_{n})-Q(B_{1}-C)-{\mathcal {D}}_{i}{\mathcal {D}}^{i}C\\&\quad + \sum _{k= 1}^{n-1} B_{k} A_{k+1} - h^{ij} \sum _{n=1}^{k} {\mathcal {D}}_{i}B_{n}{\mathcal {D}}_{j}A_{n} + \sum _{n=1}^{k} P_{B_{n}}P_{A_{n}}, \end{aligned}\nonumber \\ \end{aligned}$$
(76)

and

$$\begin{aligned} {\mathcal {H}}_{i}&= -2 h_{ik}{\mathcal {D}}_{j}\Pi ^{kj} + \sum _{n = 1}^{k} \Big (P_{A_{n}}{\mathcal {D}}_{i}A_{n} + P_{B_{n}}{\mathcal {D}}_{i}B_{n} \Big ) \nonumber \\&\quad + P_{\Phi }{\mathcal {D}}_{i}\Phi . \end{aligned}$$
(77)

The behaviour of primary constraints \(\Pi _{N} \approx 0, \Pi _{i} \approx 0\) is analogous to analysis discussed in Sect. 3. Here we mainly emphasize on \(P_{Q}\) and its evolution with total Hamiltonian gives rise to,

$$\begin{aligned} \Xi _{Q} = \partial _{t}P_{Q} =\{ P_{Q}, {\mathcal {H}}_{tot}\} = N\sqrt{h}\Big \{B_{1}-C -f'\Big \}\approx 0. \nonumber \\ \end{aligned}$$
(78)

where \(f'\) denotes derivative of f with respect to to Q. Further the evolution of \(\Xi _{Q}\) yields,

$$\begin{aligned} \Xi _{Q}^{II}= & {} \dot{\Xi }_{Q} = N \Bigg [\frac{1}{3}(\Pi -C P_{C}) +P_{A_{1}} -\frac{\partial f'}{\partial A_{1}}P_{B_{1}}\nonumber \\&+\frac{\partial f'}{\partial A_{2}}P_{B_{2}}+\cdots \frac{\partial f'}{\partial A_{j}}P_{B_{j}} \nonumber \\&+\cdots \frac{\partial f'}{\partial A_{n}}P_{B_{n}}\Bigg ] + \sqrt{h}\lambda ^{Q}( f'')\approx 0. \end{aligned}$$
(79)

Using \(\Xi _{Q}^{II}\) Lagrange multiplier \(\lambda ^{Q}\) can be evaluated which ensures appearance of no further constraints in this theory. Now, we have found all the constraints. The constraints Eq. (78) shows that any field \(A_{n}\) can be written in terms of the other fields,

$$\begin{aligned} A_{n}=A_{n}(Q,A_{j},C-B_{1}). \end{aligned}$$
(80)

After taking time derivatives of \(A_{n},\) we get

$$\begin{aligned} \dot{A_{n}}=\frac{\partial A_{n}}{\partial Q} {\dot{Q}}+\frac{\partial A_{n}}{\partial A_{j}} \dot{A_{j}}+\frac{\partial A_{n}}{\partial C} {\dot{C}}-\frac{\partial A_{n}}{\partial B_{1}}\dot{B_{1}} \end{aligned}$$
(81)

Replacing the time derivative terms of Eq. (81) by their corresponding momenta and ignoring the spatial derivative terms, then we obtain,

$$\begin{aligned} P_{B_{n}}=\frac{\partial A_{n}}{\partial Q} {\dot{Q}}+\frac{\partial A_{n}}{\partial A_{j}} P_{B_{j}}+\frac{\partial A_{n}}{\partial C} \frac{1}{3}(\Pi -C P_{C})-\frac{\partial A_{n}}{\partial B_{1}} P_{A_{1}}\nonumber \\ \end{aligned}$$
(82)

Whereas the time derivative of Q can be fixed by the equation \({\dot{Q}}=\frac{\partial H}{\partial P_{Q}}=\lambda _{Q}.\) Then Eq. (82), yields,

$$\begin{aligned} P_{B_{n}}=\frac{\partial A_{n}}{\partial Q} \lambda _{Q}+\frac{\partial A_{n}}{\partial A_{j}} P_{B_{j}}+\frac{\partial A_{n}}{\partial C} \frac{1}{3}(\Pi -C P_{C})-\frac{\partial A_{n}}{\partial B_{1}} P_{A_{1}}\nonumber \\ \end{aligned}$$
(83)

Finally we express \(P_{B_{n}}\) in terms of other variables. After putting \(P_{B_{n}}\) in Eq. (79), we get

$$\begin{aligned} \Xi _{Q}^{II}= & {} N \Bigg [\frac{1}{3}(\Pi -C P_{C})\left( 1+ \frac{\partial f'}{\partial A_{n}}\frac{\partial A_{n}}{\partial C}\right) \nonumber \\&+P_{A_{1}}\left( 1- \frac{\partial f'}{\partial A_{n}}\frac{\partial A_{n}}{\partial B_{1}}\right) \nonumber \\&-\left( \frac{\partial f'}{\partial A_{1}}+ \frac{\partial f'}{\partial A_{n}}\frac{\partial A_{n}}{\partial A_{1}}\right) P_{B_{1}}\nonumber \\&+\cdots +\left( \frac{\partial f'}{\partial A_{j}}+ \frac{\partial f'}{\partial A_{n}}\frac{\partial A_{n}}{\partial A_{j}}\right) P_{B_{j}} \nonumber \\&+\cdots \left( \frac{\partial f'}{\partial A_{n-1}}+ \frac{\partial f'}{\partial A_{n}}\frac{\partial A_{n}}{\partial A_{n-1}}\right) P_{B_{n-1}}\Bigg ] \nonumber \\&+ \sqrt{h}\lambda ^{Q}\left( f''+N\frac{\partial A_{n}}{\partial Q} \frac{\partial f'}{\partial A_{n}}\right) \approx 0. \end{aligned}$$
(84)

This constraint \(\Xi _{Q}^{II}\approx 0\) has a solution of the form

$$\begin{aligned} \frac{\partial A_{n}}{\partial C}&= -\frac{1}{ \frac{\partial f'}{\partial A_{n}}}=-\frac{1}{f_{,QA_{n}}} \end{aligned}$$
(85)
$$\begin{aligned} \frac{\partial A_{n}}{\partial A_{j}}&=-\frac{\frac{\partial f'}{\partial A_{j}}}{\frac{\partial f'(Q)}{\partial A_{n}}}=-\frac{f_{,QA_{j}}}{f_{,QA_{n}}}\end{aligned}$$
(86)
$$\begin{aligned} \frac{\partial A_{n}}{\partial B_{1}}&=-\frac{1}{ \frac{\partial f'}{\partial A_{n}}}=\frac{1}{f_{,QA_{n}}}\end{aligned}$$
(87)
$$\begin{aligned} N\frac{\partial A_{n}}{\partial Q}&= \frac{f''}{\frac{\partial f'}{\partial A_{n}}}=\frac{f_{,QQ}}{f_{,QA_{n}}} \end{aligned}$$
(88)

Taking the result from Eqs. (8588) then the Eq. (83) becomes,

$$\begin{aligned} P_{B_{n}}= & {} \frac{f_{,QQ}}{f_{,QA_{n}}} \lambda _{Q}+-\frac{f_{,QA_{j}}}{f_{,QA_{n}}} P_{B_{j}}\nonumber \\&-\frac{1}{f_{,QA_{n}}} \frac{1}{3}(\Pi -C P_{C})-\frac{1}{f_{,QA_{n}}} P_{A_{1}} \end{aligned}$$
(89)

Replacing \(P_{B_{n}}\) by the above expression in Eq. (76), we obtain

$$\begin{aligned} \begin{aligned} {\mathcal {H}}_{N}&= \frac{1}{\sqrt{h} C} \Pi ^{ij} h_{ik} h_{jl} \Pi ^{kl} -\frac{1}{3\sqrt{h} C} \Pi ^{2} -\frac{1}{3\sqrt{h}} \Pi P_{C} \\&\quad + \frac{1}{6 \sqrt{h}} C P_{C}^{2} -\sqrt{h} C {\mathcal {R}} \\&\quad - \sqrt{h} f(Q,A_{1},A_{2},\ldots A_{n})-Q(B_{1}-C)-{\mathcal {D}}_{i}{\mathcal {D}}^{i}C\\&\quad + \sum _{k= 1}^{n-1} B_{k} A_{k+1} - h^{ij} \sum _{n=1}^{k} {\mathcal {D}}_{i}B_{n}{\mathcal {D}}_{j}A_{n} + \sum _{k=1}^{n-1} P_{B_{n}}P_{A_{n}}\\&\quad +P_{A_{n}}\left( \frac{f_{,QQ}}{f_{,QA_{n}}} \lambda _{Q}+-\frac{f_{,QA_{j}}}{f_{,QA_{n}}} P_{B_{j}}\right. \\&\quad \left. -\frac{1}{f_{,QA_{n}}} \frac{1}{3}(\Pi -C P_{C})-\frac{1}{f_{,QA_{n}}} P_{A_{1}}\right) , \end{aligned}\nonumber \\ \end{aligned}$$
(90)

Finally, we arrive at the final form of Hamiltonian after exhausting all the constraints. Various linear momenta terms still exist in this Hamiltonian, which indicates the presence of the Ostrogradsky ghost in this theory.

4.1 Hamiltonian formalism for \(Rf(R,\Box ^{-1}R,\Box ^{-2}R\ldots \Box ^{-n}R)\)

In this section, we follow the analysis of previous section for deriving Hamiltonian of the Lagrangian in the action,

$$\begin{aligned} S= & {} \int d^{3}x \sqrt{-g}\ R f(\Box ^{-1}R,\Box ^{-2}R\ldots \Box ^{-n}R), \ \ \ \text {with} \ \ \ \ \nonumber \\&n \ne +\infty , \end{aligned}$$
(91)

and its scalar tensor form looks,

$$\begin{aligned} S= & {} \int d^{3}x\sqrt{-g}\bigg [Q f(A_{1},A_{2},\ldots A_{n})\nonumber \\&+C(R-Q)+B_{1}(Q-\Box A_{1})\nonumber \\&+B_{2}(A_{1}-\Box A_{2}),\ldots B_{n}(A_{n-1}-\Box A_{n})\bigg ]. \end{aligned}$$
(92)

Action Eq. (91) in a expanded form is,

$$\begin{aligned} S= & {} \int d^{3}x \sqrt{-g}\bigg [Q f(A_{1},A_{2},\ldots A_{n})+CR+Q( B_{1}-C)\nonumber \\&+g^{\mu \nu }(\partial _{\mu }B_{1}\partial _{\nu } A_{1}+\partial _{\mu }B_{2}\partial _{\nu }A_{2}\ldots \partial _{\mu }B_{n}\partial _{\nu }A_{n})\nonumber \\&+B_{2}A_{1} +B_{3}A_{2}\ldots B_{n}A_{n-1}\bigg ]. \end{aligned}$$
(93)

The above action in 3+1 decomposition can be written as,

$$\begin{aligned} \begin{aligned} S^{eqv}&= \int d^{3}x N\sqrt{h} \bigg [Q f(A_{1},A_{2},\ldots A_{n})\\&\quad + C\left( K_{ij}K^{ij} -K^{2} + {\mathcal {R}} -Q\right) \\&\quad -2K \ (n^{a} \nabla _{a}C)+Q(B_{1}-C)+{\mathcal {D}}_{i}{\mathcal {D}}^{i}C - \sum _{k= 1}^{n-1} B_{k} A_{k+1}\\&\quad + h^{ij} \sum _{n=1}^{k} {\mathcal {D}}_{i}B_{n}{\mathcal {D}}_{j}A_{n} - \sum _{n=1}^{k} (n^{a}\nabla _{a}B_{n})(n^{b}\nabla _{b}A_{n}) \bigg ]. \end{aligned}\nonumber \\ \end{aligned}$$
(94)

Here canonical momenta with respect to set \((N, N^i, h_{ij}, Q, C, A_{L}, B_{L})\) are,

$$\begin{aligned} \begin{aligned} \Pi _{N}&\approx 0, \ \ \ \ \ \Pi _{i} \approx 0,\ \ \ \Pi ^{ij} = \sqrt{h} C( {\mathcal {K}}^{ij} -h^{ij}{\mathcal {K}} ) \\&\quad - \sqrt{h} h^{ij} (n^{a} \nabla _{a}C), \\ P_{Q}&\approx 0 , \qquad \qquad P_{\Phi } = -2\sqrt{h} {\mathcal {K}}, \\ P_{A_{1}}&= \sqrt{h} (n^{a}\nabla _{a}B_{1}), \ \ \\ P_{A_{2}}&= (n^{a}\nabla _{a}B_{2}) ,\quad P_{A_{k}}=\sqrt{h} (n^{a}\nabla _{a}B_{k})\\ P_{B_{1}}&= \sqrt{h} (n^{a}\nabla _{a}A_{1})\ \ \\ P_{B_{2}}&= \sqrt{h} (n^{a}\nabla _{a}A_{2}),\quad P_{B_{k}} = \sqrt{h} (n^{a}\nabla _{a}A_{k}). \end{aligned} \end{aligned}$$
(95)

After some simplification Hamiltonian takes a form,

$$\begin{aligned} {\mathcal {H}}= N{\mathcal {H}}_{N} + N^{i} {\mathcal {H}}_{i,} \end{aligned}$$
(96)

with

$$\begin{aligned} \begin{aligned} {\mathcal {H}}_{N}&= \frac{1}{\sqrt{h} C} \Pi ^{ij} h_{ik} h_{jl} \Pi ^{kl} -\frac{1}{3\sqrt{h} C} \Pi ^{2} -\frac{1}{3\sqrt{h}} \Pi P_{C} \\&\quad + \frac{1}{6 \sqrt{h}} C P_{C}^{2} -\sqrt{h} C {\mathcal {R}} \\&\quad - \sqrt{h} Qf(A_{1},A_{2},\ldots A_{n})-Q(B_{1}-C)-{\mathcal {D}}_{i}{\mathcal {D}}^{i}C\\&\quad + \sum _{k= 1}^{n-1} B_{k} A_{k+1} - h^{ij} \sum _{n=1}^{k} {\mathcal {D}}_{i}B_{n}{\mathcal {D}}_{j}A_{n} + \sum _{n=1}^{k} P_{B_{n}}P_{A_{n}}, \end{aligned}\nonumber \\ \end{aligned}$$
(97)

and

$$\begin{aligned} {\mathcal {H}}_{i}&= -2 h_{ik}{\mathcal {D}}_{j}\Pi ^{kj} + \sum _{n = 1}^{k} \Big (P_{A_{n}}{\mathcal {D}}_{i}A_{n} + P_{B_{n}}{\mathcal {D}}_{i}B_{n} \Big ) \nonumber \\&\quad + P_{\Phi }{\mathcal {D}}_{i}\Phi . \end{aligned}$$
(98)

Here the constraint is

$$\begin{aligned} \Xi _{Q}= & {} \partial _{t}P_{Q} =\{ P_{Q}, \nonumber \\ {\mathcal {H}}_{tot}\}= & {} N\sqrt{h}\Big \{B_{1}-C -f(A_{1},A_{2}\ldots A_{n}\Big \}\approx 0. \end{aligned}$$
(99)

and its evolution yields,

$$\begin{aligned} \Xi _{Q}^{II}= & {} \dot{\Xi }_{Q} = N \Bigg [\frac{1}{3}(\Pi -C P_{C}) +P_{A_{1}} -\frac{\partial f}{\partial A_{1}}P_{B_{1}}\nonumber \\&+\frac{\partial f}{\partial A_{2}}P_{B_{2}}+\cdots \frac{\partial f}{\partial A_{j}}P_{B_{j}}+\cdots \frac{\partial f}{\partial A_{n}}P_{B_{n}}\Bigg ]\approx 0.\nonumber \\ \end{aligned}$$
(100)

Equivalently, the Eq. (100) can be written as,

$$\begin{aligned} \Xi _{Q}^{2I}=N \Bigg [\frac{1}{3}(\Pi -C P_{C}) + -\frac{\partial f}{\partial A_{1}}P_{B_{1}}+\zeta \Bigg ]\approx 0. \end{aligned}$$
(101)

where,

$$\begin{aligned} \zeta =\frac{\partial f}{\partial A_{2}}P_{B_{2}}+\cdots \frac{\partial f}{\partial A_{j}}P_{B_{j}} +\cdots \frac{\partial f}{\partial A_{n}}P_{B_{n}} \end{aligned}$$

\(\Xi _{Q}^{2I}\approx 0\) acts as a tertiary constraint and its time evolution is,

$$\begin{aligned} \Xi _{Q}^{2II}= & {} N \bigg [\frac{-\Pi ^{ij}}{\sqrt{h}} h_{ik} h_{jl} \Pi ^{kl} +\frac{1}{3\sqrt{h} C} \Pi ^{2} +\frac{1}{3\sqrt{h}} \Pi P_{C} \nonumber \\&- \frac{1}{6 \sqrt{h}} C P_{C}^{2}+\sqrt{h} C {\mathcal {R}} - \sqrt{h}C Q -\frac{\partial f}{\partial A_{1}} Q\nonumber \\&+P_{B_{1}}\{\frac{\partial f}{\partial A_{1}},{\mathcal {H}}\} +\{\zeta ,{\mathcal {H}}\} \bigg ]\approx 0. \end{aligned}$$
(102)

Further the time evolution of \(\Xi _{Q}^{2II}\) fixes the Lagrange multiplier \(\lambda _{Q}.\) Now, all the Lagrange multipliers are fixed, ensuring no further constraint appears in this theory. Therefore, we have four secondary constraints in our theory which are,

$$\begin{aligned} \Xi _{Q}\approx 0,\qquad \Xi _{Q}^{II}\approx 0,\qquad \Xi _{Q}^{2I}\approx 0,\qquad \Xi _{Q}^{2II}\approx 0. \end{aligned}$$
(103)

The constraint Eq. (99) field \(A_{n}\) is related to other \(A_{n}\) fields by the relation

$$\begin{aligned} A_{n}=A_{n}(A_{j},C-B_{1}). \end{aligned}$$
(104)

By taking the time derivatives of \(A_{n},\) we obtain

$$\begin{aligned} \dot{A_{n}}=\frac{\partial A_{n}}{\partial A_{j}} \dot{A_{j}}+\frac{\partial A_{n}}{\partial C} {\dot{C}}-\frac{\partial A_{n}}{\partial B_{1}}\dot{B_{1}} \end{aligned}$$
(105)

Equation (105) can be written in terms of momenta,

$$\begin{aligned} P_{B_{n}}=\frac{\partial A_{n}}{\partial A_{j}} P_{B_{j}}+\frac{\partial A_{n}}{\partial C} \frac{1}{3}(\Pi -C P_{C})-\frac{\partial A_{n}}{\partial B_{1}} P_{A_{1}}. \end{aligned}$$
(106)

Replacing \(P_{B_{n}}\) in Eq. (100) by using Eq. (106), we get

$$\begin{aligned} \Xi _{Q}^{I}= & {} N \Bigg [\frac{1}{3}(\Pi -C P_{C})\left( 1+ \frac{\partial f}{\partial A_{n}}\frac{\partial A_{n}}{\partial C}\right) \nonumber \\&+P_{A_{1}}\left( 1- \frac{\partial f}{\partial A_{n}}\frac{\partial A_{n}}{\partial B_{1}}\right) -\left( \frac{\partial f}{\partial A_{1}}+ \frac{\partial f}{\partial A_{n}}\frac{\partial A_{n}}{\partial A_{1}}\right) P_{B_{1}}\nonumber \\&+\cdots +\left( \frac{\partial f}{\partial A_{j}}+ \frac{\partial f}{\partial A_{n}}\frac{\partial A_{n}}{\partial A_{j}}\right) P_{B_{j}} \nonumber \\&+\cdots \left( \frac{\partial f}{\partial A_{n-1}}+ \frac{\partial f}{\partial A_{n}}\frac{\partial A_{n}}{\partial A_{n-1}}\right) P_{B_{n-1}}\Bigg ] \approx 0. \end{aligned}$$
(107)

This constraint has a solution of the form,

$$\begin{aligned} \frac{\partial A_{n}}{\partial C}&= -\frac{1}{ \frac{\partial f(Q)}{\partial A_{n}}}=-\frac{1}{f_{,A_{n}},}\end{aligned}$$
(108)
$$\begin{aligned} \frac{\partial A_{n}}{\partial A_{j}}&=-\frac{\frac{\partial f(Q)}{\partial A_{j}}}{\frac{\partial f'(Q)}{\partial A_{n}}}=-\frac{f_{,A_{j}}}{f_{,A_{n}}},\end{aligned}$$
(109)
$$\begin{aligned} \frac{\partial A_{n}}{\partial B_{1}}&=-\frac{1}{ \frac{\partial f(Q)}{\partial A_{n}}}=\frac{1}{f_{,A_{n}}}. \end{aligned}$$
(110)

Taking the result from Eqs. (108110) then the Eq. (107) becomes,

$$\begin{aligned} P_{B_{n}}= & {} -\frac{f_{,QA_{j}}}{f_{,QA_{n}}} P_{B_{j}}-\frac{1}{f_{,QA_{n}}} \frac{1}{3}(\Pi -C P_{C})-\frac{1}{f_{,QA_{n}}} P_{A_{1}}.\nonumber \\ \end{aligned}$$
(111)

After putting Eq. (111) into Hamiltonian Eq. (96) takes the form,

$$\begin{aligned} \begin{aligned} {\mathcal {H}}_{N}&= \frac{1}{\sqrt{h} C} \Pi ^{ij} h_{ik} h_{jl} \Pi ^{kl} -\frac{1}{3\sqrt{h} C} \Pi ^{2} -\frac{1}{3\sqrt{h}} \Pi P_{C} \\&\quad + \frac{1}{6 \sqrt{h}} C P_{C}^{2} -\sqrt{h} C {\mathcal {R}} \\&\quad - \sqrt{h} f(Q,A_{1},A_{2},\ldots A_{n})-Q(B_{1}-C)-{\mathcal {D}}_{i}{\mathcal {D}}^{i}C\\&\quad + \sum _{k= 1}^{n-1} B_{k} A_{k+1} - h^{ij} \sum _{n=1}^{k} {\mathcal {D}}_{i}B_{n}{\mathcal {D}}_{j}A_{n} + \sum _{k=1}^{n-1} P_{B_{n}}P_{A_{n}}\\&\quad +P_{A_{n}}\left( -\frac{f_{,QA_{j}}}{f_{,QA_{n}}} P_{B_{j}}-\frac{1}{f_{,QA_{n}}} \frac{1}{3}(\Pi -C P_{C})-\frac{1}{f_{,QA_{n}}} P_{A_{1}}\right) , \end{aligned}\nonumber \\ \end{aligned}$$
(112)

The final Hamiltonian form can then be obtained after exhausting all the constraints. This Hamiltonian still contains numerous linear momenta terms, which indicate the presence of the Ostrogradsky ghost.

5 Conclusion

There has been investigation of the instability issue in nonlocal theory, arising due to the presence of higher derivatives in the Lagrangian. Studies related to this show that it is possible to overcome the issue of Ostrogradsky instability in infinite derivative gravity models, [45, 53,54,55].

Further, the nonlocal F(R) gravity model is investigated in [47] and demonstrates under what conditions the issue of Ostrogradsky instability can be resolved simply by analyzing the kinetic matrix of the localized action. The final form of a kinetic matrix is obtained by relating the Lagrange multipliers using equations of motion. In order to obtain a consistent theory, it is necessary to examine the same formalism(obtaining no ghost conditions) from a Hamiltonian point of view. It is well known that Hamiltonian of non-degenerate higher derivative Lagrangian contains linear momenta terms, indicating the presence of Ostrogradsky ghost, and possible way to tackle ghost issue in Hamiltonian, first, to find any hidden condition(if any) that can relate both of linear momenta term, and second by adding a constraint. Here, we use the first method.

Our analysis starts with non-local action Eq. (11) of general functions of Ricci scalar. We derive the Hamiltonian and constraint for Eq. (11). By analyzing the constraint structure, we show the theory that the ghost issue cannot be resolved with \(F(R)\ne H(R)\). Next, we examine for the case when F(R) and H(R) are linear functions of Ricci scalar and notice that for \(k\ge 2\) ghost issue is always present. However, for the case \(k=1\), we show that no ghost appears.

Further we analyze the case when \(F(R)=H(R)\) and \(G(R)=R\) for two choices \(k=1\) and \(k=2.\) We can obtain a ghost free theory for \(k=1,\) whereas ghost issue is always present for \(k\ge 2.\) However in [47] it is shown that that by modifying the kinetic term in a particular fashion such that no ghost appears in later choice. When we analyze the Hamiltonian in this case we get the same ghost-free condition as in [47].

For completeness, we also study the Hamiltonian of most generalised non local models containing only Ricci scalars and find the structure of constraints and nature of ghosts in general.

Our model can be generalized for the more complicated form of the F(R) gravity model.