Relation between Lagrangian and Stress energy tensor in General Relativity In General Relativity, given a Lagrangian $L$ which describes matter or radiation, the Stress Energy Tensor associated is the following
$$T_{uv}=-2\frac{\partial (L\sqrt g)}{\partial g_{uv}}\frac{1}{\sqrt g}.$$
What are the assumptions under this formula?
I need them because I would like to know if exist a general procedure that, given a Stress Energy Tensor and a minimal set of assumptions, gives back the associated Lagrangian.
 A: The Einstein-Hilbert action has scalar Lagrangian density proportional to $R-2\Lambda$, with $R$ the Ricci scalar and $\Lambda$ the cosmological constant. Your formula for $T_{\mu\nu}$ is a definition chosen so it will be proportional to $$\frac{\delta S}{\delta g_{\mu\nu}}=R_{\mu\nu}-\frac{R}{2}g_{\mu\nu}+\Lambda g_{\mu\nu}$$(note this functional derivative must of course be a rank-$2$ tensor, even before we evaluate it). The proof of this result is quite involved because of the complicated dependence of $R_{\mu\nu\rho\sigma},\,R_{\mu\nu},\,R,\,\sqrt{\left| g\right|}$ on a $g_{\mu\nu}$ variation. However, the basic premise is that we vary the scalar density $\mathcal{L}\sqrt{\left| g\right|}$ with respect to the tensor $g_{\mu\nu}$ (note we can't pull the $\sqrt{\left| g\right|}$ factor outside the differentiation as we usually can when obtaining curved-spacetime field equations), giving a tensor density that must be divided by $\sqrt{\left| g\right|}$ to obtain a true tensor. You will see from the proof that $T_{\mu\nu}$ is obtainable from the action's matter sector (i.e. everything besides Einstein-Hilbert); comparing this result to the aforementioned calculation then gives us a field equation.
