2.1. General Theories of Gravity
Consider a general diffeomorphism-invariant theory of gravity in any number of dimensions. For simplicity and convenience, we will assume that the Lagrangian is a polynomial in the Riemann tensor but does not involve its derivatives. One may regard the Lagrangian formally as dependent on both the metric and the Riemann tensor even though of course the Riemann tensor depends on the metric [
2,
3]. Specifically, let the action be
        
We have set Newton’s constant to unity. Define
        
 has the same algebraic symmetries as the Riemann tensor, including cyclicity. One then finds that the equation of motion that follows from Equation (
1) (supplemented by appropriate generalizations of Gibbons-Hawking-like boundary terms and with minimal coupling to matter) is
        
For example, when the Lagrangian is 
, we find 
. Thus, the equation of motion is
        
This reduces to Einstein’s equation when .
Another example is Lovelock gravity [
4,
5], the most general extension of Einstein gravity for which the equations of motion do not contain derivatives of the Riemann tensor. The Lagrangian is 
, where 
 are constants of dimension 
, which are arbitrary as far as gravity is concerned, and 
 for even 
D dimensions and 
 for odd 
D. Each term 
 is made up of contractions of products of the Riemann tensor:
		
Here the 
δ symbol is the generalized Kronecker delta, defined as the sum over signed permutations of products of ordinary Kronecker deltas. The Einstein-Hilbert action with a cosmological constant is just a special case of the Lovelock action with 
 and 
. When 
, there are no other possible terms; the next term appears for 
. It is 
, known as Gauss-Bonnet gravity, which appears in the low-energy effective action of certain string theories [
6,
7]; its coefficient in ten-dimensional heterotic string theory is 
. The Gauss-Bonnet action is a topological invariant in four dimensions, just as the Einstein-Hilbert action is a topological invariant in two dimensions. It is convenient to write Equation (
5) in the form [
8]
        
Then, for the 
mth-order Lovelock Lagrangian, 
, which has the nice property that 
. The equation of motion for Lovelock theory is therefore
        
        which follows easily from Equation (
3).
In each of these theories, one can associate an entropy with Killing or black hole horizons. For example, in place of 
, the entropy in 
 gravity is [
9]
        
        while for Einstein-Gauss-Bonnet gravity, black holes have an entropy of
        
        where 
 is the scalar curvature of (the cross-section of) the horizon. We will show below that, as in Jacobson’s derivation of Einstein’s equation from 
 [
1], varying these entropies and imposing the Clausius relation, 
, leads directly to the equations of classical gravity.
  2.2. Wald Entropy
Wald [
2,
3] and other authors [
10,
11] have developed a powerful and elegant Lagrangian-based method for determining the entropy of a black hole with a Killing horizon. Wald’s method works for any diffeomorphism-invariant theory in any number of dimensions and does not require Euclideanization. Here we adopt a simplified version of the formalism [
12]. Consider a generally covariant Lagrangian, 
L, that depends on the Riemann tensor but does not contain derivatives of the Riemann tensor.
Under the diffeomorphism 
 the metric changes via 
. By diffeomorphism-invariance, the change in the action, when evaluated on-shell, is given only by a surface term. This leads to a conservation law, 
, for which we can write 
, where 
 defines (not uniquely) the antisymmetric Noether potential associated with the diffeomorphism 
 [
2].
For a Lagrangian of the type 
 direct computation shows that 
 is given by (see [
12])
        
        with 
. The Noether charge associated with a rigid diffeomorphism 
 is defined by integrating the Noether potential over a closed spacelike surface 
S:
		
When 
 is a timelike Killing vector (the one whose norm vanishes at the Killing horizon), it turns out [
2,
3] that the corresponding Noether charge is precisely the entropy, 
, associated with the horizon, apart from a few factors:
Here 
κ is the surface gravity of the black hole horizon. The integral for this “Wald entropy” can be evaluated over any spacelike cross-section of the Killing horizon [
10]. In fact we can formally define the quantity 
 on any closed spacelike surface, 
S, of codimension two (such as a section of a stretched horizon), and only at the end take the limit in which that 
S approaches a section of the Killing horizon. It can be shown, for example, that both Equation (
8) and Equation (
9) are just special cases of Wald entropy.
  2.3. Gravitation From Thermodynamics
Now let us show how the classical equations of gravity, Equation (
3), arise thermodynamically. (That the equations look thermodynamical has been shown for various special cases [
13,
14].) The set-up is as follows [
1]. Take any spacetime point 
p and pick any future-directed null vector 
 emanating from 
p. In the vicinity of 
p, the geometry is of course locally flat; this means that the metric is the Cartesian Minkowski metric to order 
 when Taylor-expanded in Riemann normal coordinates centered at 
p. The plane orthogonal to 
 thus defines a local acceleration, or Rindler, horizon, 
H. Thus, in effect, we are drawing a “local" horizon through every point in spacetime. Let 
 be any spacelike neighborhood of 
p of codimension two that lives on the Rindler plane, and let 
 be some further section of the Rindler plane along 
. Next, let 
 be a future-directed timelike vector that generates boosts and asymptotically approaches 
. For example, 
. This would be a true Killing vector if the spacetime were flat. Generically, 
 is an approximate Killing vector in that it satisfies Killing’s equation to order 
x in Riemann normal coordinates at 
p; we will always drop higher order terms below. A timelike congruence about 
 then defines a stretched horizon, Σ. As in the membrane paradigm [
15,
16], points on 
H and points on Σ can be put in one-to-one correspondence by, say, ingoing null rays that pierce both surfaces. Let 
 be the images of 
 on Σ via this correspondence. See 
Figure 1.
Let , where the norm α (which is the lapse) is taken to be constant over Σ. This norm vanishes at H, a Killing horizon. Let  be the proper velocity of a fiducial observer moving along the orbit of i.e., , where τ is the proper time. Let  be the spacelike unit normal to Σ, pointing in the direction of increasing α. Both  and  map to  in the limit that , for which .
After these preliminaries, we are ready to deduce the classical equations of gravity from thermodynamics. The key idea [
1] is to assign black hole thermodynamic properties to local Rindler horizons. The stretched horizon can be assigned a local temperature, 
, as well as the Wald entropy appropriate to the given theory of gravity; this means that the surface gravity, 
κ, is required to be approximately constant over Σ.
By Equation (
10) and Equation (
12), the Wald entropy associated with a compact section of the stretched horizon at time 
τ is
        
We now vary the entropy along the timelike congruence. Since the surface gravity is constant (to leading order) over Σ, 
κ can be taken outside the integral. Then the entropy change is
        
In the last step, we have used Stokes’ theorem for an antisymmetric tensor field 
:
		
        where the minus sign comes about because Σ is timelike. (To be explicit, our conventions here are 
 and 
 on 
, where the normal 
 to the stretched horizon points outwards, away from the true horizon.) Here we have discarded a surface term in Stokes’ theorem corresponding to the “vertical” boundaries joining the endpoints of 
 and 
; this can be justified by having the constant-time slices curve up so that 
 and 
 have common boundaries [
17]. Next, recall that 
 has the same algebraic symmetries as the Riemann tensor, including cyclicity. Using those symmetries, we find that
        
Now we will use the fact that 
 is an approximate timelike Killing vector, as defined earlier. Locally (to order 
x in Riemann normal coordinates), 
 satisfies Killing’s equation. Hence the terms in parentheses drop out since they are symmetric in the indices 
c and 
d, whereas 
 is antisymmetric. We will now assume the approximate validity of Killing’s identity, 
, a point we discuss further in the next section. Then we find
        
On the other hand, the locally-measured energy or heat flux into the stretched horizon is
        
Now we take the limit 
 in which the stretched horizon, Σ, becomes the true horizon, 
H. Then both 
 and 
 become proportional to the null vector 
 (with the same proportionality constant). Writing 
 where 
λ is some affine parameter, and equating 
 and 
, we can show that
        
As this holds for any 
p and any null 
, the integral does not depend on the domain, so the integrand must be zero, up to a term that vanishes when contracted with 
:
		
        for some scalar function 
. By demanding conservation of the stress tensor and using the Bianchi identities, we find that 
, where Λ is an integration constant. Thus we see that imposing 
 at any point in spacetime necessarily implies that
        
With the cosmological constant appearing as an integration constant, this is precisely the classical equation of motion, Equation (
3), for our theory of gravity.