On thermodynamics of compact objects

With the recent progress in observations of astrophysical black holes, it has become more important to understand in detail the physics of strongly gravitating horizonless objects. If the objects identified in the observations are indeed horizonless and ultracompact, high curvature effects may become important, and their explorations may be intimately related to new physics beyond General Relativity (GR). In this paper, we revisit the concept of statistical thermodynamics in curved spacetime, focusing on self-gravitating compact systems without event horizons. In the literature, gravitational field equations are in general assumed a priori in the thermodynamic treatment, which may lead to difficulties for theories of modified gravity, given the more complicated structure of field equations. Here, we consider thermodynamic behavior of the matter source, instead of the physical mass, hence avoiding the explicit input of field equations in the derivation of thermodynamic laws. We show that the conventional first law of thermodynamics is retrieved once the thermodynamic volume, which is in general different from the geometric volume, is appropriately identified. For demonstrations of our approach, we consider familiar examples of self-gravitating gas in GR, where the connection to previous studies becomes clear. We also discuss 2-2-holes in quadratic gravity, a novel example of black hole mimickers that features super-Planckian curvatures in the interior. These objects exhibit universal high curvature effects in thermodynamics, which happen to be conveniently encoded in the thermodynamic volume. Interesting connections to black hole thermodynamics also emerge when the physical mass is treated as the total internal energy.


Introduction
The key ingredient behind black hole thermodynamics is the event horizon [1][2][3][4][5][6], which leads to the information loss problem (see Ref. [7] for a review). Yet, current observations of astrophysical black holes in the electromagnetic and gravitational wave windows only confirm the GR predictions at the order of the horizon size with no direct implications regarding physics immediately outside the horizon. This motivates a closer investigation of the possibility of horizonless ultracompact objects being the endpoint of gravitational collapse, which provides a resolution for the information loss problem. A variety of theoretical candidates have been proposed, and their potential observational consequences have been studied (see Ref. [8] for a review). Among all, the global thermodynamics of ultracompact objects, analogous to black hole thermodynamics, has received relatively little attention. Without the event horizon, the nontrivial contribution from background spacetime is absent [9], and the focus is rather on the matter source contribution and how conventional thermodynamics is influenced by curvature effects.
The statistical thermodynamics of self-gravitating systems in GR has long been explored. It was shown that the maximum entropy principle of statistical mechanics could be used to derive the basic equations describing a static and spherically symmetric self-gravitating gas in GR [10,11] (see Refs. [12][13][14] for recent reviews). Explicit examples include the self-gravitating black-body radiation [15,16] and fermion gas [17], corresponding to the equilibrium solutions for photon stars and neutron stars, respectively. As a result, the total internal energy for the system is identified as the physical mass of the object, and an intimate relation between thermodynamic stability and dynamical stability is revealed. This method, nonetheless, has some limitations [12]. Since the Einstein equations are implicitly assumed in the derivation, this procedure may not be attainable for theories of modified gravity, given the more complicated structure of field equations. Also, not all information encoded in the field equations can be derived from the maximum entropy principle.
In this paper, we study the thermodynamics of self-gravitating systems from a different perspective. Instead of deriving the profile of local thermodynamic quantities from the global ones by using a subset of the gravitational field equations, we focus on the curved spacetime effects on global thermodynamic quantities for the matter source in a general theory of gravity (GR and beyond). This is particularly relevant to horizonless ultracompact objects where the metric resembles black hole spacetime closely from the exterior, while the interior may feature high curvatures.
In this picture, without the explicit input of field equations (and hence for a general metric), we define global extensive variables for the matter source directly from the local ones, and intensive variables by the matter properties measured at spatial infinity. The total internal energy U , which is defined by properly integrating the energy density of the matter source over the relevant volume, is then used to establish a well-defined thermodynamic system. The first law of thermodynamics for global variables applies once a so-called thermodynamic volume V th is appropriately identified. 1 For instance, for photon gas with zero chemical potential, the first law takes the conventional form: dU = T ∞ dS − p ∞ dV th . The thermodynamic volume V th = R 0 dr g rr (r)/g 3 tt (r)d 3 r, which is larger than the ordinary geometric one V geo = R 0 dr g rr (r)d 3 r in general. This provides a generic description of the thermodynamic behavior of the matter source for a gravitational object without an event horizon. Compared with the first law involving the physical mass, we find dM − dU = p ∞ (dV th − dV geo g −3/2 tt (R)) for the self-gravitating photon gas in GR, where the difference of V th and V geo gives rise to the difference of two internal energies. Furthermore, when we consider a novel example of horizonless ultracompact objects, 2-2-holes, in quadratic gravity as sourced by photon gas, the geometric volume term becomes negligible and the difference dM − dU comes mostly from the p ∞ dV th term. This yields dM = T ∞ dS, indicating that black hole thermodynamics can manifest in other previously unexplored scenarios without the need to delve into quantum details. The close resemblance between the exterior metric of horizonless ultracompact objects and black holes, coupled with their ability to satisfy black hole thermodynamics, provides a compelling response to potential objections to the notion of horizonless configurations in the context of the information paradox.
The rest of the paper is organized as follows. In Sec. 2, we present the generic description of the thermodynamic behavior of the matter sources in curved spacetime. The generalization of the first law for different kinds of matter and the general rule of identifying the thermodynamic volume are also given. In Sec. 3, we discuss concrete examples of horizonless compact objects with vacuum spacetime at infinity in different theories of gravity, including self-gravitating photon gas and Fermi gas in GR as well as 2-2-holes with various sources. We summarize in Sec. 4. We adopt the convention c = ℏ = k B = 1 throughout this work unless stated otherwise.

Thermodynamics in curved spacetime and thermodynamic volume
In this section, we revisit thermodynamics and statistical mechanics for self-gravitating systems in curved spacetime. For simplicity, we restrict to static, asymptotically flat, and spherically symmetric spacetimes, for which the line element is generically expressed as and the metric functions A(r) and B(r) are determined through the field equations imposed by the corresponding theory of gravity. We treat the matter source as a perfect fluid, whose energy-momentum tensor is given as where ρ and p denote the proper energy density and the isotropic pressure, and u µ is the fourvelocity, normalized as u µ u µ = −1. In the rest frame of the fluid, the tensor takes the familiar form T µ ν = diag(−ρ, p, p, p). In the following, we first review the well-known properties of local variables in Sec. 2.1. Then, we turn to global thermodynamical variables in Sec. 2.2 by assuming the additivity of the extensive variables. As a result, we find a local-global thermodynamic correspondence for a generic curved spacetime. We argue that the internal energy U for the matter source (instead of the physical mass M ) can be used to establish a well-defined conventional thermodynamic system as long as one can identify an appropriate form of thermodynamic volume. In Sec. 2.3 and Sec. 2.4, we illustrate the idea by considering examples of non-interacting gas described by canonical and grand canonical ensembles. The additivity of global thermodynamic potentials can be verified by derivations from the global partition function. The specific form of thermodynamic volume is also displayed.

Properties of local variables
In curved spacetime, a fluid element sufficiently small can be described by local thermodynamic variables in the local rest frame of the fluid element [21]. According to the equivalence principle, these local thermodynamic variables shall respect the fundamental laws of thermodynamics. Here, we take two basic relations as the starting point. One is the local Euler equation for thermodynamics [22], relating the proper quantities in the local frame, where s is the entropy density, n is the number density, µ is the chemical potential and T is the temperature. The other relation comes from the local version of the first law (together with the second law) of thermodynamics [23] dρ = ρ + p − s T n dn + T ds = µ dn + T ds , where the energy density ρ is treated as a function of number density n and entropy density s.
For the canonical ensemble, the local thermodynamic potential is the Helmholtz free energy density f . It is clear from the fundamental equation that f = ρ − s T is a function of n and T . Following Eq. (4), we have from which the chemical potential and entropy density can directly be found as Using Eq. (6) and the local Euler equation, given in Eq. (3), together with the definition of f , one obtains the energy density ρ and the pressure p in terms of f as Similarly, for the grand canonical ensemble, we consider the grand potential density ω = ρ − s T − µ n = −p. As a function of T and µ, the total differential is In analogy with Eqs. (6) and (7), we obtain the derived quantities as follows: The spacetime variation of local thermodynamic quantities is governed by the conservation law of the stress tensor, ∇ µ T µν = 0. For a static and spherically symmetric spacetime, this yields a single constraint from the momentum conservation along the radial direction. For the metric in Eq. (1) and stress tensor in Eq. (2), this constraint is obtained as where ( ′ ) denotes derivative with respect to r. As recently emphasized in Ref. [24], the momentum conservation of the stress tensor is directly related to Tolman's law for local thermal equilibrium in curved spacetime. With use of the local Euler equation, given in Eq. (3), Eq. (10) can be expressed as The term in the parenthesis vanishes due to the first law given in Eq. (4), and therefore When the chemical potential is zero, as for the photon gas, Eq. (12) reduces to the commonly known Tolman's law [10,11]: T (r) B(r) = T ∞ . The constant T ∞ is the temperature of the gas at spatial infinity or the redshifted temperature for observers at spatial infinity. More generally, the quantity µ/T , the exponential of which is commonly called fugacity, is position independent, i.e. (µ/T ) ′ = 0, as the condition of vanishing heat flow and diffusion for a system in equilibrium [25]. This then leads to the generalized version of Tolman's law [26] T This means that the temperature and chemical potential as intensive quantities are each uniquely specified by single numbers, T ∞ and µ ∞ , respectively. Since we consider only equilibrium thermodynamics, we employ the condition of constant fugacity throughout this work.

The global picture and the role of thermodynamic volume
The global thermodynamic characteristics of a strongly gravitating system are of interest to observers far away from the gravitational potential. For a generic discussion here, we write down global extensive thermodynamic variables in terms of their local counterparts by assuming additivity [27]. This is expected for a variety of matter sources and will be explicitly verified for non-interacting gas in later subsections. Thermodynamic potentials are then obtained by appropriately integrating the corresponding potential energy density such as where the factor √ A B comes from the term √ −g, with g being determinant of the metric, and R denotes the boundary of the matter distribution. U , F , and Ω are the total internal energy, Helmholtz free energy, and the grand potential, respectively. The energy densities multiplied by √ B can be interpreted as the redshifted values measured at spatial infinity. The total number of particles N and the entropy S are defined through the spatial integral of the temporal components of the conserved currents J µ and S µ (with √ −g in the integrand). Considering that the densities are given as n = −J µ u µ and s = −S µ u µ , and that the four-velocity in the rest frame of fluid becomes u µ = (1/ √ B, 0, 0, 0), it is obtained that where the factor √ B drops out from each integrand and the volume element becomes the geometric one.
Let's consider the canonical ensemble to verify the conventional thermodynamics. Given the Helmholtz free energy density f = ρ − s T and the Tolman's law Eq. (13), we can first obtain the fundamental equation Then, taking the total differential of the Helmholtz free energy F and implementing Eqs. (5) and (13), we have The last term (dF ) N,T∞ denotes the variation of the metric function or size of the system independent of N and T ∞ . If we attribute this change to the variation of a thermodynamic volume element the conventional equation can be recovered Thus, by considering F as a function of N , T ∞ and V th , one gets the consistent picture with the desired relations By using these relations and Eq. (16), the internal energy can be simply expressed as Then, with Eqs. (16) and (19), one obtains the fundamental thermodynamic relation for internal energy, as the manifestation of the first law of thermodynamics for global variables. Similarly, for the grand canonical ensemble (see Appendix A for the microcanonical ensemble), given Tolman's law in Eq. (13), the global grand potential satisfies where the term in parenthesis is the grand potential density w = −p, as defined above Eq. (8). Together with Eq. (19), the total differential of Ω is given as where the thermodynamic volume can be expressed in terms of the grand potential as and consequently, the required relations are obtained as In short; we have seen that global thermodynamic variables obey conventional thermodynamics in the sense that their definitions fully encode the curved spacetime effects. The key ingredient is to appropriately identify the thermodynamic volume V th as in Eqs. (18) and (24). Finding the explicit expression for V th is not in general straightforward and its attainability highly depends on the equation of state in question. This can be conveniently seen from the definition given in Eq. (24). Unlike T (r), µ(r) that follow Tolman's law, the spatial variation of pressure depends on the equation of state as we will see later in our examples. The difficulty is in separating the spatial integral from the T ∞ when the latter is tangled in position-dependent non-trivial functions. If such a separation is possible, then one can have a clear expression for V th . For instance, in the case of a massless ideal gas with the equation of state ρ = 3p, which yields p ∝ T 4 , we have p(r)/p ∞ = B 2 (r) from the Tolman's law, and the thermodynamic volume emerges as with Ω = −p ∞ V th . Apparently, V th differs from the geometric volume When the curved spacetime features a deep gravitational potential, i.e. B(r) ≪ 1, V th will be much larger than V geo . As we will show later in Sec. 3 by explicit examples of compact objects with back-reaction taken into account, a larger V th is responsible for the difference between the physical mass M and internal energy U . Thus, in comparison to previous studies where M is interpreted as the internal energy, we keep U unchanged but replace V geo by V th , where the gravitational field contribution is more conveniently encoded.

Semi-classical ideal gas
As the first example, we consider a box of a semi-classical ideal gas in thermal equilibrium. The local thermodynamic variables can be derived from the Boltzmann distribution in the local rest frame. For later discussion, we display expressions [22] for the number density, energy density, pressure, and entropy density, where E = p 2 + m 2 is the locally measured proper energy of a particle, K 1 , K 2 are the modified Bessel functions, and b ≡ m/T .
To complete our previous derivation of consistency between local and global pictures, we first verify the additivity of the global Helmholtz free energy in Eq. (14). The starting point is the fundamental equation in the canonical ensemble, namely, where Z N is the N-particle global partition function. As usual, we evaluate the one-particle partition function Z 1 first. Taking the energy eigenstates of the HamiltonianĤ, we have where l = (l x , l y , l z ) labels the momentum eigenstates in the box, and the summation over l is approximated by an integral for the box sufficiently large. E ∞ = −ξ µ p µ is the conserved energy, where ξ µ = (1, 0) is the timelike killing vector of the static spacetime and p µ is the particle's four-momentum. The density of states available to one-particle g(E ∞ ) for a given energy E ∞ can be obtained by g(E ∞ ) = dP (E ∞ )/dE ∞ , with the invariant phase space volume [28,29] P where Θ is the Heaviside step function accounting for the volume of momentum space with energy less than or equal to E ∞ . The one-particle partition function is then where Eqs. (15) and (28) are used in the last step to relate Z 1 and N . Note that E = E ∞ / √ B is the proper energy and so E/T = E ∞ /T ∞ . The physics behind the metric dependence for E and T is different. E = E ∞ / √ B is gravitational redshift due to the change of reference frames, while T = T ∞ / √ B is the Tolman's law due to thermodynamic equilibrium [29,30]. As in the case of flat spacetime, the N-particle global partition function, Z N , in the semiclassical limit is related to the one-particle partition function by Z N ≈ Z N 1 /N ! ≈ (Z 1 e/N ) N , where the Stirling approximation [31] is used. Thus, with Eqs. (30), (32) and (35), the global Helmholtz free energy is where the local Euler equation, given in Eq. (3), and f = ρ − s T are used in the last step. This supports the earlier definition Eq. (14) based on additivity.
Next, let us examine the explicit expressions for global variables. Considering the massless particle case first, the one-particle partition function is given through Eq. (35) as In the last step, the thermodynamic volume is directly identified as that in Eq. (26) since the T ∞ dependence is fully separable from the spatial integral. This is consistent with the general definition of dV th in Eq. (18) from the global Helmholtz free energy F . To see this, we first write down F as a function of N , T ∞ and V th , Eq. (18) implies that the intensive quantity p ∞ is the conjugate to V th from Eq. (20), On the other hand, in the massless limit, the local pressure p ∝ T 4 from Eq. (28-31) and satisfies p(r)B 2 (r) = p ∞ from Tolman's law Eq. (13). Together with Eq. (30), we can find This agrees with the derivative definition in Eq. (39), and so it validates the V th definition in Eq. (26). This shows that the thermodynamic system mimics the one in flat spacetime with the extensive global variables properly encoding the curvature effects and the intensive quantities given by the ideal gas properties at spatial infinity. Then from Eq. (20), we can find the total entropy and chemical potential from F as As expected S, derived in this way, agrees with the definition in Eq. (15) with the local variable s = n(4 − µ/T ) from Eq. (31). The internal energy is obtained as which agrees with the local definition in Eq. (14) as well, with ρ = 3nT from Eq. (29). The first law of thermodynamics, given in Eq. (21), follows accordingly. For the massive particle case, the one-particle partition function is and the global Helmholtz free energy F is given as In contrast to the massless case, the thermodynamic volume V th cannot be simply identified as the spatial integral part in the partition function due to the T ∞ dependence in the Bessel function K 2 (m √ B/T ∞ ). Instead, we determine its differential form by evaluating the total derivative of F as given in Eq. (18). By using the pressure at infinity p ∞ , found from Eqs. (28) and (30) as we obtain the differential form of thermodynamic volume In the massless limit, with K 2 (b) = b 2 /2, this agrees with Eq. (26). In general, dV th is sensitive to the particle mass m and is quite different from the universal geometric volume. As we will show later in Sec. 3.2, the combination p ∞ dV th might be insensitive to the mass if ultracompact objects feature a deep gravitational potential and the spatial integral is dominated by the relativistic contribution. The total entropy, chemical potential, and total internal energy are derived in a similar way as which agree with the quantities obtained from the local parameters. In comparison to the massless gas, S and U include additional terms that depend on the spatial integral of K 1 (b). This is also related to the difficulty in defining the full form of V th from Eq. (47).

Quantum ideal gas
When the quantum nature of the source is taken into account, the particle number can fluctuate and hence is not appropriate to be treated as a state parameter in equilibrium thermodynamics. Therefore, the grand canonical ensemble is generally used to describe quantum gases where the chemical potential µ, in addition to temperature and volume, can be a state parameter that handles the change of particle number and is appropriately fixed.
In similarity with the canonical ensemble, we verify the consistency between the global and local pictures in the grand canonical ensemble by demonstrating the additivity of the global grand potential Ω, given in Eq. (14). In the global picture, as in the conventional thermodynamics [32], the grand potential can be derived from the fundamental equation where the global partition function Z is For a given quantum state labeled by l, the trace is evaluated with the number of eigenstates n l . For Bose-Einstein and Fermi-Dirac gas, summing over n l leads to where g = 2σ + 1 denotes the multiplicity for massives particles with spin σ and g = 2 for massless particles. As in the case of canonical ensemble, the sum can be approximated by the integral over the density of states P (E ∞ ). From Eq. (34), one obtains that where ω = −p is the grand potential density. The main difference for the grand canonical ensemble here is that the connection between local and global pictures in Eq. (54) is established through the logarithm of the partition function, given that the sum over states appears after taking the logarithm. For canonical ensemble, on the other hand, we take the sum over states before taking the logarithm, and the additivity emerges from the overall dependence on N . Note that from Eq. (9), by using the expression for w given in Eq. (54), one can find the other local quantities. For instance, the common case of relativistic gas of bosons and fermions for which we can assume for simplicity that m, µ ≪ T , one obtains the (average) quantities as where ζ(3) ≈ 1.2 is the Riemann zeta function of argument 3 [32], g b and g f are the total bosonic and fermionic degrees of freedom respectively, which are the generalizations of g in Eq. (54). For pure radiation (photons), since m = µ = 0, the expressions in Eq. (55) become exact rather than approximate (with g b = 2 , g f = 0), which will be our first example below. Now we will proceed to examine some examples and identify the thermodynamic volume in each case.
Photon gas: As massless Bose-Einstein gas, the particle number of photon gas is not conserved, and so its chemical potential vanishes, i.e. µ = 0. The local variables in this case are given as Plugging in the Tolman's law, given in Eq. (13), we can obtain the relations where ρ ∞ = 3p ∞ = π 2 T 4 ∞ /15 and s ∞ = 4π 2 T 3 ∞ /45 denote the gas properties at spatial infinity. These relations are insensitive to the numerical coefficients in Eq. (56) and can be directly read from the momentum conservation law in Eq. (10), given the equation of state ρ = 3p and the local Euler equation, given in Eq (3).
With Eqs. (54) and (56), the global grand potential is obtained as With vanishing chemical potential, Ω is a function of T ∞ and V th . The thermodynamic volume V th is again identified as that in Eq.  58) and (25), we can obtain the total entropy and internal energy with s ∞ , ρ ∞ given below Eq. (57). These expressions are consistent with the expected local definitions, given in Eqs. (14) and (15).
Cold Fermi gas at T = 0: At zero temperature, all states of the cold Fermi gas below the cutoff Fermi energy are occupied. The local variables are then characterized by the corresponding Fermi momentum k F and the fermion mass m as where g = 2 is the multiplicity in Eq. (53), ρ c = m 4 /(6π 2 ) is the critical density, and With vanishing temperature, the local Euler equation now becomes ρ+p = nµ, where the chemical potential is given as µ = k 2 F + m 2 and Tolman's law in Eq. (13) imposes the constraint µ(r) B(r) = µ ∞ .
The global grand potential is a function of the chemical potential µ ∞ and the thermodynamic volume V th , and is given as Similar to the massive case for a semi-classical ideal gas, the thermodynamic volume V th cannot simply be identified as the spatial integral part in Ω due to the complicated T ∞ dependence in h p (k F /m). It is then found from the generic derivative definition Eq. (24). By using p ∞ = 3ρ c h p (k F,∞ /m) from Eq. (61), we obtain where k F /m = µ 2 ∞ /(B m 2 ) − 1 and the demanded relation, p ∞ = −(∂Ω/∂V th ) µ∞ , is then recovered. Similarly, dV th is sensitive to the fermion mass, in general.

Examples of horizonless compact objects
We discuss explicit examples of horizonless compact objects by starting from self-gravitating gas in GR in Sec. 3.1. The relation of laws presented in Sec. 2 to those in previous studies in the literature is discussed. Then, in Sec. 3.2, we consider a novel example of horizonless ultracompact objects, 2-2-holes, in quadratic gravity. They are as compact as black holes, but feature a novel high-curvature interior. The high curvature effects turn out to make significant contributions to global thermodynamic variables, where interesting connections to black hole thermodynamics emerge.

Compact objects in GR
Self-gravitating systems in GR provide us with natural examples to see the curvature effects on statistical thermodynamics. Here, we consider two concrete examples of compact objects, self-gravitating photon gas confined to a spherical box [15] and neutron stars composed of cold Fermi gas (i.e. the Oppenheimer-Volkof model) [33].
Considering static and spherically symmetric solutions, the Einstein field equations can be simplified by the conservation of the stress-tensor and the ToV equation, given in Eq. (10) and Eq. (92) of Appendix B, respectively. For a given equation of state (EoS) of the matter source, the pressure p(r) and mass profiles M(r) ≡ r 0 4πr ′2 ρ(r ′ )dr ′ can be solved simultaneously as functions of the central pressure p c at the origin. The solutions obey a simple scaling behavior, with the following rescaled dimensionless quantities uniquely determined by the field equations. A one-parameter family of solution for p(r), M(r) can then be obtained by scaling with an arbitrary length scale λ. In GR, the physical mass of the object takes a simple form Given that the metric determinant √ A B < 1 in the interior, the total internal energy U , defined in Eq. (14), is always smaller than the mass M , and its smallness reflects the contribution from the gravitational field. Let's first consider self-gravitating photon gas confined to a spherical box, with the EoS given in Eq. (56). Here, a finite box of radius R is imposed to prevent the massless gas from spreading all the way to infinity. Self-gravitating photon gas confined to a spherical box is then described by a two-parameter family of solutions, and the scaling behavior in Eq. (65) can be used to relate solutions of different p c with λ = p    59) and (60). When the mass-to-radius ratio M/R is small, the solution describes the dilute photon gas in a box. Gravitational effects become strong with increasing M/R. The maximal M/R ≈ 0.25 defines a turning point, beyond which the solutions become unstable. Along the way, the internal-energyto-mass ratio U/M decreases slowly from unity and reaches the minimum U ≈ 0.64M around the turning point. In the weak gravity regime, the thermodynamic volume V th is very close to the geometric one V geo and the entropy S ∝ R 3 with T ∞ roughly a constant. In the unstable branch, V th becomes slightly larger and S ∝ R 3/2 grows slower with R given T ∞ ∝ R −1/2 .
The numerical solutions can be used to examine the first law of thermodynamics. Since the solutions are described by the two parameters p c and R, the entropy S (or the temperature T ∞ ) and the thermodynamic volume V th can vary independently. The conventional first law then applies, i.e. dU = T ∞ dS − p ∞ dV th , as we would expect from the general derivation in Sec. 2. On the other hand, it has been proved in GR [15] that the physical mass M satisfies the following first law, where M is considered as a function of S and V geo instead. The difference between the physical mass and total internal energy is then Considering the gravitational potential in the object's interior, i.e. B(R) > B(r) for r < R, we expect V th > V geo B(R) −3/2 and then dM > dU . This reveals the U and M relation from a different perspective apart from their definitions. Interestingly, we find no discussion of such a relation between Eq. (67) and the conventional first law in the literature. As the second example, we consider neutron stars composed of cold Fermi gas at zero temperature, with the EoS given in Eq. (61). In contrast to the self-gravitating photon gas, the radius R of neutron stars is determined with p(R) = 0 and is not an independent parameter. Neutron stars composed of cold Fermi gas are then described by a two-parameter family of solutions, i.e. the central pressure p c and the Fermion mass m, and the scaling behavior in Eq. (93) can be used to relate solutions of different mass m, with λ = 1/m.  In the stable branch of solutions, the physical mass M and the total number of particles N increase, and the radius R decreases. In the weak gravity regime, we find N ∝ r H /(m ℓ 2 Pl ), µ ∞ ∝ r 0 H m. The maximum of M/R remains the turning point, but the value is slightly smaller than that of self-gravitating photon gas. The internal energy to mass ratio U/M decreases from unity in a similar way and is bounded from below by U ≈ 0.72M . For the first law of thermodynamics, since the solution for a given Fermion mass m is described by only one parameter, the particle number N and the thermodynamic volume V th cannot vary independently. The conventional first law Eq. (21) then may not be properly defined at zero temperature limit. From the numerical solutions, we find that This can be viewed as the first law built upon the physical mass M . The thermodynamic volume term in Eq. (21), which accounts solely for the contribution of the gravitational field, is incorporated into dM . In practice, neutron stars may have a small but nonvanishing temperature. The pressure, then, would not drop to zero at a hard surface, and so a small independent dV th term would appear in Eq. (69). For the unstable solutions, the global variables vary less with the central pressure and become attracted by the infinite pressure limit [33].
As a final remark, the compactness M/R is sensitive to source matter properties. With exotic EoSs, it is possible to realize ultra-compact objects in GR with R smaller than the photon sphere radius, i.e. M/R ≳ 0.33, or even black hole mimickers with M/R ∼ 0.5 and no horizon [8]. Nonetheless, no candidate makes connections between black hole thermodynamics and the conventional one as we focus on here. In the following subsection, we will discuss a candidate in a theory of modified gravity, where such a connection appears due to super-Planckian high curvature effects.

Not quite black holes in quadratic gravity
An interesting candidate for horizonless ultracompact objects is a new type of solution, 2-2holes [34,35], in quadratic gravity as described by the classical action, given in Eq. (96) in Appendix B. The existence of 2-2-holes relies on the Weyl term C µνρσ C µνρσ , which introduces a new spin-2 mode with the Compton wavelength λ 2 . In the presence of a compact matter source, a typical 2-2-hole with mass M much larger than the minimum mass M min ∼ m 2 Pl λ 2 resembles a black hole closely from the exterior, while a novel interior takes over right above the would-be horizon r H = 2M ℓ 2 Pl . The interior curvature can easily reach super-Planckian values when λ 2 ∼ ℓ Pl , and approaches infinity at the origin. In contrast to proposed ultracompact objects in GR, the 2-2-hole properties are crucially determined by the high curvature interior, while being quite insensitive to the details of EoS. Thus, 2-2-holes provide a tractable model to study the influence of high curvature effects on statistical thermodynamics. In the following, we consider concrete examples of 2-2-holes sourced by various simple forms of matter.
First, we consider thermal 2-2-holes sourced by massless particles, i.e. photon gas 2 and massless classical ideal gas, e.g. EoS being ρ ∞ = 3p ∞ . The gas profile and the metric functions can be solved from the momentum conservation of the stress-tensor Eq. (10), which yields p(r)B(r) 2 = p ∞ for relativistic gas, and two field equations, given in Eq. (97) in Appendix B. Fig. 3 displays the 2-2-hole solutions with two different values of mass M ≫ M min . Despite the complicated form of field equations in quadratic gravity, the numerical solutions of 2-2-holes turn out to be governed by simple qualitative features. The exterior (r ≳ r H ), where the curvature becomes lower for increasing size of the object, obeys the Einstein field equations to a good approximation and follows the conventional scaling in Eq. (65). The interior r < r H , on the other hand, is a high curvature regime and features a huge gravitational potential. At the leading order of high curvature expansion, it is described by a novel scaling behavior, with the following rescaled dimensionless quantities [35] p(r) = p(r)λ 2 2 ℓ 2 Pl ,Ã(r) = A(r) uniquely determined as functions ofr = r/r H . Similarly, a box has to be imposed to make the total energy finite, and the box radius R has to be considerably larger than r H to not ruin the simple behavior.
The thermodynamic volume V th in Eq. (26) can be separated into two parts, the interior contribution V In comparison to the flat spacetime scaling V (in) th ∼ r 3 H , the high curvature effects lead to a large enhancement of order (r H /λ 2 ) 2 . The gain could be enormous given that λ 2 can be as small as ℓ Pl . The exterior contribution encodes the box radius R dependence. Since the gas temperature drops drastically at r > r H as shown in Fig. 3, we expect a trivial dependence V (ex) th ∝ R 3 from the cold and dilute gas outside as in the case of GR. Thus, for macroscopic 2-2-holes with R not significantly larger than r H , we expect V th to be dominated by the interior contribution. This is also true for the total internal energy and entropy of the gas, which are proportional to V th . With Eqs. (60), (71), and (72), the total internal energy is Since the compactness of 2-2-holes is nearly maximal, it is not surprising that its internal energy-to-mass ratio is far smaller than that for compact objects in GR. The same ratio has also been obtained in the brick wall model [38], but there, the back-reaction has not been taken into account. Using Eqs. (56), (59), (71), and (72), we can obtain the temperature at spatial infinity and the entropy whereM min = M min /m Pl = 0.63λ 2 /ℓ Pl , the Hawking temperature T BH = m 2 Pl /8πM and the Bekenstein-Hawking entropy S BH = π r 2 H /ℓ 2 Pl . 3 As a result of high curvature effects, a 2-2hole sourced by relativistic particles exhibits Hawking-like temperature and the entropy area law [35]. Given that S = s ∞ V th in Eq. (59), we can see that the enormous amount of microscopic entropy is achieved here mainly through the huge value of V (in) th given in Eq. (72). This is usually considered difficult for self-gravitating objects with no horizon. The numerical values of T ∞ and S differ from the black hole counterparts due to the M min or λ 2 dependence.
For the first law of thermodynamics, as 2-2-holes sourced by photon gas are described by two parameters r H and R, the entropy S and the thermodynamic volume V th can vary independently, and the conventional first law still applies, i.e. dU = T ∞ dS − p ∞ dV th , as we would expect. Given the absence of analytical solutions, the variation of the physical mass M requires to be checked numerically. Using T ∞ S (in) = 4 p ∞ V In comparison to Eq. (67), the work performed at the box radius is numerically negligible for th . The major difference between the physical mass and total internal energy is then accounted for by the thermodynamic volume contribution It is instructive to make some comparisons with black hole thermodynamics. For Schwarzschild black holes, dM = T ∞ dS applies without the volume term because of the vanishing thermodynamic pressure. For thermal 2-2-holes, Eq. (75) holds at the leading order of high curvature expansion since the volume term associated with variation of the box boundary has a negligible contribution. This shows that certain aspects of black hole thermodynamics could be derived from conventional thermodynamics by utilizing the non-trivial structure of curved spacetime, and thus are not too mysterious.
For 2-2-holes sourced by a semiclassical ideal gas, there is the additional dependence on the conserved number of particles N or the nonzero chemical potential µ ∞ given in Eq. (42). The relation between U and M remains the same as in Eq. (73), while the temperature and total entropy change. With Eqs. (28), (30), and (41) for the massless ideal gas, we obtain Given that exp(µ ∞ /T ∞ ) ≪ 1 for a semiclassical ideal gas, the corresponding thermal 2-2-holes have higher temperature and lower entropy than holes sourced by photon gas of the same mass in Eq. (74). As the generalization of conventional thermodynamics, it is not surprising that thermal 2-2-hole characteristics can depend on certain aspects of matter properties.
Considering the entropy S as a function of two independent variables M and N as given in Eq. (41), the total differential of S for the interior contribution is with V (in) th ∝ M 5 and T ∞ N (in) ∝ M . This yields a generalization of Eq. (75) with the additional contribution from the conserved number of particles, The exterior contributions are again ignored. Since black holes do not conserve charges associated with global symmetries [39], this has no counterpart in black hole thermodynamics. For a macroscopic 2-2-hole, the particle-number-to-mass ratio N m Pl /M ≈ m Pl /(8T ∞ ) ∝ M/m Pl is enormous, and it can increase indefinitely with the hole mass, unlike the local charge of black holes to be bounded by the extremal limit. 2-2-holes can also be sourced by semiclassical ideal gas with nonzero mass. As the temperature satisfies Tolman's law T (r) B(r) = T ∞ , the gas becomes relativistic around the origin, while the density and pressure are suppressed by the Boltzmann factor when T (r) drops below the particle mass m. Although the field equations, given in Eq. (99) in Appendix B, are more involved for this case, the interior metric functions and gas profile remain characterized by the same scaling behavior Eq. (70) as for relativistic thermal gas, for a given m √ λ 2 ℓ Pl . Interestingly, global thermodynamic quantities such as T ∞ , S, N , and U are found to be quite insensitive to the particle mass due to the dominance of the relativistic contribution. Thus, the results obtained for the massless case can be used as a reliable approximation for the massive case, with the mass dependence having a negligible impact on the leading order results. This includes the intricacy of identifying the thermodynamic volume for the massive case, as discussed around Eq. (47).
Another example is 2-2-holes sourced by the cold Fermi gas, which may serve as the endpoint of the gravitational collapse of neutron stars after sufficient cooling. Together with Tolman's law Eq. (13) for chemical potential, the metric functions and gas profile are solved from the field equations (Eq. (99) in Appendix B) with EoS given in Eq. (61). The cold Fermi gas becomes relativistic around the origin due to the quantum pressure. As in the case of neutron stars in GR, the pressure (and the Fermi momentum k F ) drops to zero at some radius R and defines the object's surface. The difference is that R is within the would-be horizon r H for 2-2-holes, while it is considerably larger than r H for neutron stars.
For a given m √ λ 2 ℓ Pl , the interior is again characterized by the novel scaling behavior in Eq. (70). With this scaling, the rescaled chemical potential redshifted to infinity is Since R < r H , the total internal energy and (average) number of particles receive contributions only from the 2-2-hole interior. The internal energy to mass ratio U/M remains roughly 3/8. The rescaled number of particles is Note that the r H (or M ) dependences of µ ∞ and N are quite different from that for neutron stars, but resemble closely that for T ∞ and S for thermal 2-2-holes in Eq. (76). With Eqs. (79) and (80), it is straightforward to obtain the analog of Eq. (69) for neutron stars and of Eq. (78) for thermal 2-2-holes. Again, the thermodynamic volume term accounts for the difference 1 − U/M , and the contribution is the same as in the case of thermal 2-2-holes. In summary, the global thermodynamic variables of 2-2-holes exhibit interesting universal characteristics due to the high curvature interior and its novel scaling behavior. It is intimately related to the greatly enhanced interior thermodynamic volume that dominates the contribution for macroscopic holes. This renders the EoS dependence rather weak, as opposed to the situation in GR.

Summary
We have studied the thermodynamics of self-gravitating systems in a new approach to better characterize horizonless ultracompact objects in a general theory of gravity. In Sec. 2, we have derived generic thermodynamic laws of global variables for the matter source, without the explicit input of gravitational field equations, from the curved spacetime generalizations of thermodynamic potentials for different statistical ensembles. Consequently, unlike the common treatment in the literature, there is no direct reference to the physical mass and the total internal energy U is defined as usual in Eq. (14). The conventional thermodynamic laws then arise directly from the global and local correspondence, except that thermodynamic volume V th has to be appropriately identified. The most generic definition of V th can be derived from the first law of thermodynamics, as given by Eqs. (18) and (24) for canonical and grand canonical ensembles, respectively. For illustration, we have considered examples of non-interacting gas, where the global thermodynamic potentials can be derived from the global partition functions. The explicit form of global thermodynamic variables is displayed. For relativistic gas in particular, i.e. with EoS ρ = 3p, it is possible to identify the explicit form of V th , as given in Eq. (26), with the help of Tolman's law, given in Eq. (13). It is in general larger than the geometric volume V geo , given in Eq. (27), due to the extra enhancement from gravitational redshift.
Then in Sec. 3, we have studied specific examples of horizonless ultracompact objects with vacuum spacetime at infinity. We have first considered familiar examples of self-gravitating gas in GR, including photon gas in a box and cold Fermi gas. In comparison with the previous studies, where the physical mass M of the system is identified as the total internal energy, we have highlighted the difference between the forms the first law takes in these two approaches. The difference between M and U turns out to be directly related to the difference between thermodynamic volume V th and the geometric one V geo , as given in Eq. (68). For the case where the object boundary is determined by gravitational field equations, e.g. the cold Fermi gas, V th does not vary independently and its contribution has to be absorbed into the variation of M .
Furthermore in Sec. 3, we have considered another candidate for horizonless ultracompact objects, 2-2-hole in quadratic gravity, sourced by similar kinds of gases used in the previous examples. These objects are as compact as black holes and are drastically different from the proposed ultracompact objects in GR due to the novel interior with super-Planckian curvatures. A novel scaling behavior in Eq. (70) emerges for the interior solution, to be compared with the GR scaling in Eq. (65). As a result, the interior thermodynamic volume V (in) th is strongly enhanced by a factor of r 2 H /ℓ 2 Pl for macroscopic holes in comparison to the naive estimate of order r 3 H . This then leads to Hawking-like temperature and the entropy area law for 2-2-holes from conventional thermodynamics as given in Eqs. (74) and (76). Such large V th is also what is necessary to account for the large difference between M and U . Because of the dominance of the high curvature effects, the 2-2-hole thermodynamics shows universal characteristics and is much less sensitive to matter EoS than compact objects in GR. Note that the peculiar thermodynamic characteristics for 2-2-holes are only verified numerically due to the absence of analytical relations between M and the source properties. The possibility for a more analytical derivation, as in the case of GR, requires further investigation.
For other theories of modified gravity with nonvacuum spacetime at infinity, e.g. scalartensor theories, the generic descriptions for the matter source in Sec. 2 still apply, with the effects of the scalar charge encoded in the metric functions. The main change to what we presented above is the additional contribution of the scalar charge to the difference of dM and dU in Eq. (68) [40,41]. More generally, the exact meaning of the thermodynamic volume V th requires a more comprehensive understanding. In this study, the volume is modified to ensure the validity of the first law of global thermodynamics. Nevertheless, it would be intriguing to explore the implications of this modification in the context of emergent gravity from thermodynamics [42][43][44][45][46]. One question that arises is whether it is feasible to derive the field equations from the modified version of thermodynamic laws. Additionally, a closer examination of fuzzballs in string theory, which serve as prominent examples of horizonless ultra-compact objects, would be captivating [47,48]. These aspects warrant more comprehensive investigations, which we leave as avenues for future research. state parameters in this ensemble are total internal energy U , the total number of particles N , and the thermodynamic volume V th . Before going into the example, let's first have a general discussion. The total differential of entropy S(U, V th , N ), directly from the fundamental relation (21), is given as It is clear that in order to have a consistent picture we have to define the thermodynamic volume, in analogy to the canonical (18) and grand canonical (24) cases, as Here again, we have the issue we ran into in the other ensembles. If the spatial dependence in s can be separated from the quantities measured at infinity, we can simply find the expression for V th , otherwise it is not clear if an explicit expression can be obtained. For ideal gas, the total entropy is obtained as where N N (U ) is the number of microstates for N indistinguishable particles with total energy U fixed, and given as where P N (U ) is the N -particle phase space, which can be expressed as for the metric given in Eq. (1). The √ B factor in the bracket accounts for the gravitational redshift and a factor of √ A is to treat spatial integral properly. The step function Θ function is included to account for the fact that the total energy of the system at the spatial infinity is fixed in the microcanonical ensemble. This function should not be confused with the one used in the one-particle phase space in the canonical ensemble, as in Eq. (34). The latter is to find an appropriate definition for conserved energy for each particle [28,29] and account for the redshift effect E(r i ) B(r i ) = E ∞ . Hence it is contained in each of the N integrals in Eq. (87) and not explicitly shown here.
We now proceed with an example to derive the total entropy from the fundamental relation Eq. (85) and identify the corresponding thermodynamic volume. For simplicity, we focus on massless semi-classical ideal gas. The N -particle phase space for this case can simply be found as As in the case of the canonical ensemble, we identify at this stage the thermodynamic volume as that in Eq. (26). Then, from Eqs. (85), (86), and (88), we have where N ! ≈ (N/e) N is employed as usual. From Eq. (83), the global variables are then found to satisfy justifying the identification of V th . Therefore, entropy becomes in consistency with the local descriptions. Here, the local Euler equation, given in (3), is used for ρ = 3p, as well as the condition that µ/T is constant. Finally, notice that thermodynamic volume V th found above is by default consistent with our general definition in Eq. (84) based on entropy, given in Eq. (89), further confirming this identification of V th .

B Field equations for compact objects
In this appendix, we provide details for field equations used in Sec. 3. Firstly in GR, Einstein field equations for static, spherically symmetric solutions can be reduced to the momentum conservation of the stress tensor Eq. (10) and the ToV equation −r 2 p ′ (r) = GM(r)ρ(r) 1 + p(r) ρ(r) 1 + 4πr 3 p(r) where G = ℓ 2 Pl is the Newtonian constant and M(r) ≡ r 0 4πr ′2 ρ(r ′ )dr ′ is the mass profile. For a given EoS, the profiles p(r) and M(r) are solved simultaneously for a given value of central pressure p c at the origin. It turns out that these solutions have a simple scaling behavior. Defining the following dimensionless quantities p = p λ 4 ,ρ = ρ λ 4 ,r = r λ −2 ℓ Pl ,M(r) = M(r) λ −2 ℓ 3 Pl .
where λ is some length scale. Eq. (92) can be used to solvep(r),M(r), and then solutions for p(r), M(r) for an arbitrary λ can be obtained by the scaling.
Inside the objects, r < R, the metric functions are given by Outside the objects, r ≥ R, it is simply the Schwarzschild solution with B(r) = A(r) −1 = 1 − 2M/r and the physical mass It is worth mentioning that this simple expression for the physical mass is a consequence of the Einstein field equations, and shall not be expected to be valid in a general theory of gravity. Classical quadratic gravity is used as an example of modified gravity in the paper, with the classical action below where α, β are dimensionless couplings associated with the quadratic curvature terms. This is treated as the classical approximation of the renormalizable and asymptotically free quantum quadratic gravity [49], rather than a truncation of the effective field theory. Since the Weyl term C µναβ C µναβ softens gravitational interaction with increasing energy, quantum quadratic gravity provides a weakly coupled field theory description for gravity at high energy scale [35]. However, it brings in the problematic spin-2 ghost with mass m 2 = m Pl / √ 2α. The ghost clearly causes problems in the classical theory, but its fate at the quantum level remains under debate. Putting aside the ghost problem, the Weyl term in Eq. (96) gives rise to a new type of static and spherically symmetric solutions, 2-2-holes, where the volume shrinks to zero at the origin. It is more generic than black holes and hence may serve as the endpoint of gravitational collapse if quantum quadratic gravity is the fundamental theory for gravity.
The 2-2-hole solutions are governed by two field equations. For simplicity, we turn off the R 2 contribution in Eq. (96), and focus on the effects of the Weyl term. For relativistic thermal gas, by implementing the momentum conservation p(r)B(r) 2 = p ∞ , the equations are H 1 and H 2 are functions of the metric, where H 1 depends only on the Einstein term and H 2 includes the essential contribution from the Weyl term. λ 2 = 1/m 2 is the Compton wavelength of the spin-2 mode.
More generally, for the stress tensor with a nonzero trace, the field equations in Eq. (97) become The right-hand sides take more complicated forms with where T µ µ denotes the trace of the stress tensor and