Cosmology, or at least basic cosmology, models the world as perfectly homogeneous and isotropic. Everything in the study of the evolution of the Universe actually works out fine if this is at least true at all times on the largest scales, and observations confirm it pretty much is. But at smaller scales, our Universe does not appear like a featureless, homogeneous soup, but as an immense tree of fractal complexity and divisions and subdivisions. Superclusters, clusters, galaxies, stars, planets, mountains and craters. And then there's life on Earth, an incredible variety of desperate machines grasping for survival. And on the top of the tree (for what we know), human civilizations, our actions and thoughts and the information we produce and consume. All of this complexity is concentrated in minuscule oases of useful information lost in a huge, huge blackness filled only by what is essentially thermal noise.

A pretty picture, but doesn't that sound... wrong? Is that supposed to happen? On the face of it, all of this complexity arises and continues to exist because of an intricate array of physical phenomena and interactions on which life piggybacks. The varied chemistry of carbon allows for the extraordinary machineries of biology, fluid mechanics drives the weather and the tectonic cycle, electromagnetism and the theory of conductivity is the foundation for all of electronics, computers, and the Internet. We could list thousands of examples, but you get the idea.

As any person who "fucking loves science" will tell you, we are made of stardust, in the sense that our existence is based on many natural phenomena in a mechanical Universe. You would assume that is a satisfying explanation: many complex elements and interactions, thus great complexity in the results. However, all of these interactions naturally push towards death and decay. Organic matter burns and turns into vapour and dissolves into the atmosphere. Atomic bombs explode. Light bounces around and loses coherence. Hard drives break. Information scrambles. It's just the second law of thermodynamics. And the "complexity" of the interactions never really matters - a triple pendulum or the entire standard model in a box both tend to the same result: thermal equilibrium, and nothing happening. In schools we teach two essential lessons of both life and science: that everything in existence is the product of a chaotic and uncaring Universe, and that anything worth something requires care and work to be preserved, and would otherwise disassemble in time. But we don't point out the apparent contradiction between the two for some reason. At least not from the physics, even though this is very much a physics issue.

Creationists (to the extent that they actually exist and aren't an elaborate practical joke by the US on the rest of the world) like to argue that it is impossible for life on Earth to have spontaneously arisen, because it would mean a transition from "disorder" to "order", or more precisely a spontaneous creation of new useful information, in violation of the second law of thermodynamics. This very abstract conceptualization of life as a decrease in entropy, as a transition from equilibrium to non-equilibrium, is not wrong and is actually the view Schrödinger tried to push in "What is Life?". The obvious mistake, as the fucking lover of fucking science will make very sure to point out, is forgetting about the massive thermonuclear reactor in the sky. The Earth is not a closed system and receives constant input of "useful" energy from the Sun. This "negative entropy" (more precisely free energy) drives the Earth system and keeps it out of equilibrium. Alternatively, the Earth still has to cool its core and there's a bit of free energy being provided to the crust from the temperature difference between the core and the coldness of empty space, and a few organisms can live on that. None of these things can last forever, but for now they work.

However, this begs the question. If all our free energy comes from the Sun, then... who made the Sun? What brought it all out of equilibrium? The solar system started out as a relatively featureless, less differentiated protostellar cloud of hydrogen and helium. It was **dead**. Now it's neatly organized in differentiated bodies, a nuclear furnace forging heavy elements, a bunch of random planets with different composition and varied moons, and one even has life and roads and bucatini all'amatriciana. That *is* a potential violation of the second law. Hydrogen in a tank does not do that - it does not form tiny solar systems with tiny people, it fills the tank homogeneously and stays dead in all aspects. In fact, no substance does that. Essentially every system I can think of, when isolated in a small tank, will eventually "die" and decompose and reach thermal equilibrium. So why does a lot of hydrogen in space do the opposite?

The reason has to do with the unusual thermodynamic properties of gravity and gravitationally-dominated systems. Consider a gas of particles (which might be molecules, or stars, or galaxies!) interacting only gravitationally. Then the total internal energy of the system is the kinetic + gravitational potential energy:

$$ U = U_k + U_G $$

However, also recall that for the gravitational interaction the virial theorem implies $$ U_G = - 2 U_k $$ (at least as a time-average) so that you can simplify

$$ U = - U_k \,.$$

Now, there is a common myth that kinetic energy is proportional to the temperature - we don't need such a strong (and occasionally false) statement. We just need to know that it is an increasing function of temperature. More precisely, you could write \( U_k(T,P)\) or \( U_k(T,V)\) and it would be an increasing function of \( T \) in either case. This means that for a gravitational system, the heat capacity either at constant pressure or volume is **negative**:

$$ \frac{\partial U}{\partial T} |_P < 0 $$

$$ \frac{\partial U}{\partial T} |_V < 0 $$

That is, a gravitational system gets colder when you give it energy, and gets hotter when you take it away. Note this also holds if there are additional interactions other than gravitational

$$ U = U_k + U_G + U_\text{other} $$

provided the gravitational potential is large enough compared to the other forces.

This changes everything. Let me just review briefly how normal thermodynamic systems always push towards equilibrium. Imagine a system has some type of inhomogeneity in the form of a temperature difference between two subsystems C and H, and let's say C is colder and H is hotter. Heat flows spontaneously from the hotter to the colder system, and that is always true. As C receives heat, and like most systems has positive heat capacity, it gets a bit hotter. Conversely, H is donating heat and gets colder. The temperature difference is reduced and the subsystems walk back into equilibrium.

However, if the heat capacity is negative, this doesn't work. Heat still moves from H to C, but H gets hotter and C gets colder. All inhomogeneities are amplified and the system moves *away* from equilibrium. Thus gravitational systems possesses the essential ingredient for the creation of life. But still, the second law of thermodynamics seems to be broken and that is always a bad sign. The 2nd law is a very, very general statement; it could be simplified as just the idea that the information in an imprecise or coarse-grained description of reality can only degrade, not improve. There just aren't any exceptions to this.

How does gravity manage to reduce entropy? It is commonly claimed that the Universe after the Big Bang was in a "low-entropy" state, while what awaits it in the far-future (heat death?) is a "high-entropy" state, and this difference actually gives the arrow of time, and is the reason for which we define it such that the Big Bang is in the past and the heat death in the future. It is true that there is an entropy difference between these two extremities, and that the *total* entropy increases monotonically between these two values. But the specific entropy in the early Universe is not particularly low compared to what we experience here on Earth - the early Universe was a homogeneous state in thermal equilibrium. If you consider the particles that compose a human body, the entropy they have now is much, much lower than the same particles (to the extent that this makes sense) right after the recombination of hydrogen, simply because the first is a complex, ordered system, in fact a living being composed of literally tens of trillions of little working machines, capable of withholding information and performing calculations and reasoning, while the latter is just... noise. So there *is* a decrease of entropy. It is gravity that is able to create such lower and lower-entropy states through gravitational collapse.

If a gravitational system has a typical size \( R \), then its potential energy will go as \( U_G \sim - 1/R\) which means \( \frac{dU}{dR} > 0 \). Intuitive: if you give energy to a gravitationally-bound system, orbits get wider. Since we already know the heat capacity is negative, this means \( \frac{dT}{d R} < 0 \), and that the more it shrinks, the hotter it gets. Like a satellite in orbit: if you take orbital energy away from it, it grazes the atmosphere and starts burning up.

However, entropy decreases as the system shrinks - a normal behaviour for usual systems but unexpected considering the weird thing we saw with the temperature. Ignoring pressure for now, the first law implies

$$ dS = dU/T = \frac{1}{T} \left(\frac{dU}{dR}\right) dR \Rightarrow \frac{dS}{dR} > 0 $$

So gravitational collapse violates the second law of thermodynamics and should never happen. But we are forgetting about the bizzarre property of spontaneous divergence from equilibrium of gravitational systems that I introduced before: they can (and will in time) split into subsystems of ever-increasing temperature difference. We know which one is the one getting hotter and hotter: it's the part that collapses. The one getting colder and colder is "radiation": actual radiation (gravitational or electromagnetic) escaping the gravitating mass or just expelled matter that has become gravitationally unbound. "Radiation" can move in a very large space and is not constrained by gravity to satisfy the conclusion $$ -2U_k = U_G $$ of the virial theorem, and thus carries a very large entropy. So a mass *can* collapse, but it needs to sacrifice part of itself to store a very large entropy, so that the part that continues collapsing can have a decreased entropy while still satisfying the second law of thermodynamics as a whole. While this is not an unusual or unseen occurrence (e.g.: I can reduce the entropy of a deck of cards by sorting it, but the minimum computations necessary in my brain will increase entropy by a larger amount), gravity is special and unique among all physical phenomena in that it does this spontaneously.

Thus the early Universe collapses gravitationally expelling "radiation", and the process is repeated at various scales. We therefore find little pockets of very low entropy in a very large high-entropy expanse. (Black holes are an exception, but for the sake of simplicity let's put them aside). It explains the tree of increasing complexity and the giant cold expanse of sparse thermal garbage.

You can imagine life without the chemistry, nuclear physics, condensed matter physics we know. You can imagine intelligence made of plasma or computers made of dancing stars in clusters. If you have a powerful enough imagination, every cog in the architecture of life is replaceable. Except for one: gravity. Only gravity can reduce entropy and create complexity where it doesn't already exist. It is, ultimately, the origin of anything worthwhile in the Universe. So, if you really need to worship something, or need a mantra, or are stupid enough to want a tattoo of a physics formula, let it be this one:

$$ F = -\frac{GM_1 M_2}{r^2} $$

because it's the closest thing to a loving God physics is going to give us.

Now, with this said, why the heat death? Well, the reason is that in all of this I meant gravity *gravity*, that is the long-range interaction between masses governed by Newton's law. Not all of general relativity and the range of phenomena it predicts. In particular in the presence of dark energy / cosmological constant, the acceleration of mass \( M_1\) due to mass \( M_2\) is corrected as

$$ \ddot {\vec r} = - \frac{GM_2}{r^2} + \frac{\Lambda c^2}{3} r $$

so, a repulsive force which grows linearly with distance. The thing with the virial theorem applied to an interaction potential that goes as \(r^2\) gives \(U_k = U_\Lambda\) and so this means a positive contribution to the heat capacity. If dark energy is dominant, and it will be in the not-so-far future, then it undoes the creative property of gravity. In a dark-energy dominated system, we move towards thermal equilibrium instead of away from it. The natural order according to which all things spontaneously degrade and die is recovered, and all things will spontaneously degrade and die.