The German mathematician co-named with Einstein in the action principle for general relativity is David Hilbert.
The Einstein–Hilbert action is built from the Ricci scalar, which summarizes spacetime curvature, integrated over spacetime with the metric volume factor. Requiring this action to be stationary under variations of the metric yields the Einstein field equations. It provides a compact variational formulation of general relativity and makes the theory easier to compare with other field theories.
David Hilbert presented his formulation in 1915, around the same period in which Albert Einstein completed the field equations of general relativity. Hilbert was one of the leading mathematicians of the era and had already made foundational contributions to geometry, mathematical physics, and the formal study of axiomatic systems. The historical relationship between Einstein’s and Hilbert’s developments has been discussed extensively, but the standard name remains Einstein–Hilbert action.
This is not the same as the Einstein field equations themselves, nor does “Hilbert” refer to Bernhard Riemann, Felix Klein, or Hermann Weyl. A cosmological constant can also be added to the action; varying the resulting expression produces the field equations with that term included.