\noindent Let $M\to N$ (resp.\ $C\to N$) be the fibre bundle of pseudo-Riemannian metrics of a given signature (resp.\ the bundle of linear connections) on an orientable connected manifold $N$. A geometrically defined class of first-order Ehresmann connections on the product fibre bundle $M\times_NC$ is determined such that, for every connection $\gamma $ belonging to this class and every $\mathrm{ Diff}N$-invariant Lagrangian density $\Lambda $ on $J^1(M\times_NC)$, the corresponding covariant Hamiltonian $\Lambda ^\gamma $ is also $\mathrm{ Diff}N$-invariant. The case of $\mathrm{ Diff}N$-invariant second-order Lagrangian densities on $J^2M$ is also studied and the results obtained are then applied to Palatini and Einstein-Hilbert Lagrangians.
Categories: math-ph math.MP