ADM decomposition of the general scalar tensor theory Lagrangian I have question about ADM decomposition of some general scalar-tensor theory of gravity.
Starting with ADM form of the metric:
$$ds^2=-N^2dt^2+h_{ij}(dx^i+N^idt)(dx^j+N^jdt)$$
provided with extrinsic curvature:
$$K_{ij}=\frac{1}{2N}(\dot{h_{ij}}-D_iN_j-D_jN_i)$$,
where $N$ is lapse function and $N^i$'s are shift vector components. Timelike normal vector to the hypersurface is denoted as $n_a$.
I'm considering given action:
$$\int d^4x\sqrt{-g}[f(\phi) R-\nabla_\mu\phi\nabla^\mu\phi + U(\phi)]$$
and I want to recast this Lagrangian in the 3+1 form which is suitable for discussing Hamiltonian formulation of this theory.
Kinetic term $(X=\nabla_\mu\phi\nabla^\mu\phi)$ decomposes as:
$$
X=-A_*^2+D^i\phi D_i\phi
$$
where:
$A_*=n^\mu\nabla_\mu=\frac
{1}{N}(\dot{\phi}-N^iD_i\phi)$ and $D^i$ is 3d covariant derivative associated with metric $h_{ab}$ ($h^a_b\nabla_a=D_b$).
However, i have trouble with the first part of the action:
\begin{align}
\int d^4x\sqrt{-g}f(\phi) R=\int dt\int d^3x \sqrt{-h}N\Big[f(\phi)&\big(R^{(3)}+K_{ij}K^{ij}-K^2\\
&+2\nabla_{\mu}(n^\mu\nabla_\nu n^\nu-n^\nu\nabla_\nu n^\mu)\big)\Big].
\end{align}
First term is left as it is, while term involving derivatives of normal vector $n^\mu$ needs to be integrated by parts (dropping boundary term) - normally in GR this is total divergence and is discarded (this is not the case here):
\begin{align}
\int dtd^3x\sqrt{-h}N  f(\phi) 2\nabla_{\mu}(n^\mu\nabla_\nu n^\nu-n^\nu\nabla_\nu n^\mu) 
&=-2\int dtd^3x\sqrt{-h}N(n^\mu\nabla_\nu n^\nu-n^\nu\nabla_\nu n^\mu)\nabla_\mu f(\phi) \\
&= -2\int dtd^3x\sqrt{-h}N(n^\mu\nabla_\nu n^\nu)f_\phi\nabla_\mu\phi\\
&\quad+2\int dt d^3x\sqrt{-h}N(n^\nu\nabla_\nu n^\mu)f_\phi \nabla_\mu \phi\\
&=-2\int dt d^3x\sqrt{-h}N(n^\mu Kf_\phi\nabla_\mu\phi-n^\nu(\nabla_\nu n^\mu) f_\phi \nabla_\mu \phi)\\
&=-2\int dt d^3x\sqrt{-h}N (Kf_\phi A_*-(\nabla_\nu n^\mu )n^\nu 
 f_\phi\nabla_\mu \phi)
\end{align}
where  I used identity $K=\nabla_\nu n^\nu$ and $\nabla_\alpha f=f_\phi \nabla_\alpha \phi$ (chain rule).
I have trouble with the last part of the above equation - i have no idea how to simplify this expression and put it into 3+1 form.
Here are some references that I'm trying to follow:
https://arxiv.org/abs/1101.3403,
https://arxiv.org/abs/1708.02951,
https://arxiv.org/abs/1812.02667,
https://arxiv.org/abs/1512.06820.
 A: Before we start
Let's take a few steps back. The ADM decomposition implies the existence of a globally defined scalar field $T$. The spatial hypersurfaces are then the level surfaces of $T$. The unit normal (co)vector $n_\mu$  can be constructed as
$$
n_\mu = -N\nabla_\mu T.\tag{1}\label{normal}
$$
The lapse function $N$ shows up as a normalisation factor. The metric $g_{\mu\nu}$ then decomposes as
$$
g_{\mu\nu} = h_{\mu\nu} - n_\mu n_\nu.\tag{2}\label{metric}
$$
In this decomposition $h_{\mu\nu}$ is the embedding of your spatial 3-metric $h_{ab}$ in spacetime.
It is useful to define projectors parallel ($P_{\parallel}{}^{\alpha}_{\mu}$) and orthogonal ($P_{\perp}{}^{\alpha}_{\mu}$) to $n_\mu$:
\begin{align}
P_{\parallel}{}^{\alpha}_{\mu} &\equiv - n_\mu n^\alpha,\\
P_{\perp}{}^{\alpha}_{\mu} &\equiv \delta_\mu^\alpha - P_{\parallel}{}^{\alpha}_{\mu} = \delta_\mu^\alpha + n_\mu n^\alpha.
\end{align}
One can then construct spatial tensors by taking a tensor in your spacetime, and applying $P_{\parallel}$ to each component. In particular, for the gradient of  a scalar field $f$ one has
$$
D_\mu f = P_{\perp}{}^\alpha_\mu \nabla_\alpha f.
$$
Now, $D_\mu$ is the covariant derivative compatible with the spatial metric $h_{\mu\nu}$. You can check this by using the decomposition \eqref{metric}.
The derivative $D_\mu$ is equivalent to your $D_i$.
Regarding your question
The last term in your expression can be rewritten in terms of the quantities that I have defined above. With \eqref{normal} one can show that
$$
n^\nu\nabla_\nu n_\mu = P_{\perp}{}^{\nu}_{\mu}\nabla_\nu\log N = D_\mu\log{N}.
$$
Since this is a spatial vector, the only part of $f_\phi\nabla_\mu\phi$ that survives must also be spatial, to wit $D_\mu f$. Your term, in full, is then
$$
2\int {\rm d}t{\rm d}^3x\sqrt{h}N D^\mu\log{N} D_\mu f =
2\int {\rm d}t{\rm d}^3x\sqrt{h} \left[D^\mu(ND_\mu f) - N\Delta f\right],
$$
where $\Delta = D_\mu D^\mu$ is the Laplacian on the spatial hypersurface. The first term is a total spatial derivative and can be neglected, as you did before.
Note that $h_{\mu\nu}$ is positive definite, and so has a positive determinant.
References

*

*Reference on the ADM decomposition: https://arxiv.org/abs/gr-qc/0703035

*an example where this calculation is done: https://arxiv.org/abs/1712.08543
