# Consequence of diffeomorphisms invariance in General Relativity

Let's consider a theory with gravity and matter field(s) $$\Phi$$. The action of this theory is the following: $$$$S[g,\Phi] = S_g[g]+S_m[g,\Phi] = \frac{1}{16\pi G}\int_Md^4x\sqrt{-g}R+\int_Md^4x\sqrt{-g}\mathcal{L}_m[x,\Phi].$$$$ The fact the the Einstein-Hilbert action $$S_g[g]$$ is invariant under diffeomorphisms implies the conservation of the Einstein tensor $$G_{\mu\nu}$$: $$$$\delta_\xi S_g[g]=0\Longrightarrow \nabla_\mu G^{\mu\nu}=0.$$$$ The fact that the matter action $$S_m[g,\Phi]$$ is invariant under diffeomorphism implies the conservation of the energy-momentum tensor $$T^{\mu\nu}$$: $$$$\delta_\xi S_m[g,\Phi]=0\Longrightarrow \nabla_\mu T^{\mu\nu}=0.$$$$ But in the end, isn't it the total action $$S[g,\Phi]$$ that is supposed to be invariant under diffeomorphisms? So could we imagine some kind of transformations where $$S_g[g]$$ and $$S_m[g,\Phi]$$ are not invariant but the sum the two is? So the transformation of the two terms would cancel each other.

Is this precisely what Einstein's equations are saying?

The matter action must be invariant under diffeomorphisms, so we have $$\delta_{\xi} S_M [g,\phi^{I}] = 0 = \int \frac{\delta S_M}{\delta g^{\mu \nu}}\delta g^{\mu \nu} + \int \frac{\delta S_M}{\delta \Phi^I}\delta \phi^I \ .$$ The last term, the variation w.r.t to the matter fields, is zero if $$\phi$$ satisfies the matter equations of motion. Then using the definition of $$T^{\mu \nu}$$ and knowing to use the Lie derivative of the metric, we arrive at $$\nabla^{\mu}T_{\mu \nu} = 0$$ (I assume you know how to fill in those steps).
The Einstein Hilbert action $$S_{EH}$$ is diffeomorphism invariant, not just because we want it to be. You can do the calculation in full (i.e. without assuming it). So you'd need to use a different gravitational action in order to be in the situation you're describing.